Skip to content

Commit ab6c080

Browse files
authored
Update README.md
1 parent f487726 commit ab6c080

File tree

1 file changed

+20
-105
lines changed

1 file changed

+20
-105
lines changed

README.md

+20-105
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
## What is Nucleoid?
44

5-
Nucleoid is a state-based data storage with vanilla JavaScript. Nucleoid runtime is embedded inside Node.js and as
6-
writing just any other codes in Node.js, it rerenders the same JavaScript codes and makes the necessary adjustments
7-
in the state as well as stores on the disk, so that your application doesn't require external database.
5+
Nucleoid is a low-code framework for JavaScript and embedded inside Node.js. As writing just like any other codes in
6+
Node.js, it rerenders the very same JavaScript codes and makes the necessary adjustments in the state as well as stores
7+
on the disk, so that your application doesn't require external database or anything else.
88

9-
### ...but why?
9+
### ..but why?
1010

11-
Even simple applications today require lots of coding, libraries, tuning etc., and majority of them are technical codes
12-
rather than business logic. Declarative runtimes like Nucleoid can organically reduce numbers of code lines needed.
11+
Even simple applications today require lots of coding, libraries, tuning etc., and majority of them are technical
12+
requirements rather than business logic. Declarative runtimes like Nucleoid lets you immediately start writing business
13+
logic with less code lines.
1314

1415
### Nucleoid in a nutshell
1516

@@ -21,115 +22,29 @@ rather than business logic. Declarative runtimes like Nucleoid can organically r
2122
const nucleoid = require("nucleoidjs");
2223
const app = nucleoid();
2324

24-
class User {}
25+
class User {constructor(name){this.name = name}}
2526
nucleoid.register(User);
2627

27-
app.post("/users", () => new User());
28+
// 👇 This is it!
29+
app.post("/users", () => new User("Daphne"));
2830

2931
app.listen(3000);
3032
```
3133

3234
It is pretty much it, you successfully persisted your first object with this :point_up_2:
3335

34-
> Just the reminder, you don't need external database, `const app = nucleoid()` will do the magic.
36+
> Just the reminder, you don't need external database, `const app = nucleoid()` will do the magic. :sunglasses:
3537
36-
<br/>
38+
Learn more at [nucleoid.com](https://nucleoid.com)
3739

38-
This passes HTTP information into the runtime
40+
# Status
3941

40-
```javascript
41-
class User {
42-
constructor(name) {
43-
this.name = name;
44-
}
45-
}
46-
nucleoid.register(User);
47-
48-
app.post("/users", (req) => new User(req.body.name));
49-
50-
app.get("/users", (req) => User.filter((user) => user.name === req.query.name));
51-
```
52-
53-
<br/>
54-
55-
...and CRUD operations:
56-
57-
```javascript
58-
app.post("/users", (req) => new User(req.body.name));
59-
60-
app.get("/users/:id", (req) => User[req.params.id]);
61-
62-
app.post("/users/:id", (req) => {
63-
let user = User[req.params.id];
64-
65-
if (user) {
66-
user.name = req.body.name;
67-
return user;
68-
}
69-
});
70-
71-
app.delete("/users/:id", (req) => delete User[req.params.id]);
72-
```
73-
74-
<br/>
75-
76-
Nucleoid also opens terminal channel at `8448` port for queries like in SQL, so that you can write code snippet for data operations
77-
78-
![Terminal](https://media.giphy.com/media/aGQyuZ4ggB4SaPRc1g/giphy.gif)
79-
80-
In the meanwhile, you can still call underlying Express APIs for non-Nucleoidic functions
81-
82-
```javascript
83-
const app = nucleoid();
84-
85-
const express = app.express();
86-
87-
express.get("/test", (req, res) => res.send("Hello!"));
88-
```
89-
90-
---
91-
92-
---
93-
94-
### Under the hood: Declarative Runtime Environment
95-
96-
The declarative runtime environment isolates a behavior definition of a program from its technical instructions and
97-
executes declarative statements, which represent logical intention without carrying any technical details. In this
98-
paradigm, there is no segregation regarding what data is or not, instead approaches how data is related with others so
99-
that any type of data including business rules can be added without requiring any additional actions such as compiling,
100-
configuring, restarting as a result of plasticity.
101-
102-
### Syntax and Semantics
103-
104-
In declarative programming, as its name suggests, it runs based on definition of syntax, where a syntax is often
105-
followed by developers in order to achieve behaviors in specifications. For example:
106-
107-
```
108-
> a = 1
109-
> b = a * 2
110-
```
111-
112-
`=` represents assignment of expression to a variable. In Nucleoid runtime, it follows formal logic as semantics in ES6
113-
syntax. So, if the expression contains another variable, it is considered as dependency, and by the design, whenever the
114-
variable is changed, the dependent variable also has to change along with, otherwise it breaks its logical integrity.
115-
116-
However, in imperative programming, for the same example, when `a` is changed, it changes memory location where `a`
117-
refers, but the change doesn't alter variable `b` because in the context of IP, it is just a representation of memory
118-
location.
119-
120-
### Control Flow
121-
122-
An important difference in declarative programming oppose to imperative is who manages the control flow. In IP, a
123-
programmer has full control of instructions that runs on CPU through programming language, but in declarative
124-
programming, it is based on semantics, and in Nucleoid, it follows formal logic as semantics.
125-
126-
Due to its plasticity, the runtime is able to adjust control flow as receives more statements, so that externalized
127-
configuration files are optional.
128-
129-
### Persistency
42+
Track at [Trello](https://trello.com/b/TZ73H1Fk/nucleoid)
13043

131-
Nucleoid runtime cumulatively stores statements in order as received so that the runtime doesn't require external
132-
database. This feature is enabled by declarative programming as a result of plasticity and lowers complexity of the
133-
system along with gaining better performance since there is no network communication required.
44+
- [X] Working [beta](https://www.npmjs.com/package/nucleoidjs) is out, but still testing
45+
- [X] ES6 support
46+
- [ ] ES2018 support
47+
- [ ] IDE (WiP)
48+
- [ ] Production-ready
13449

135-
Learn more about the declarative runtime at https://nucleoid.org/tutorial/
50+
Please report an issue or ask a question at [Issues](https://github.com/NucleoidJS/Nucleoid/issues)

0 commit comments

Comments
 (0)