We've launched a project that it can automate data and logic in Node.js, so that it can organically reduce code lines.
Nucleoid Low-code Framework works with underlying declarative runtime environment that re-renders very same JavaScript codes makes a connections in the graph and eventually save the JavaScript state so that it doesn't require external database.
Hello World
app.post("/test", () => {
var a = 1
var b = a + 2;
var c = b + 3;
})
app.get("/test", () => {
return b;
})
This π will save and return variables without external database even if the program restarted.
The Nucleoid runtime environment tracks JavaScript state like variables, object, class, etc. that it can control all technical codes like pooling, connections, in meanwhile, developers can focus to build up business logic with vanilla JavaScript.
Example with actual objects:
class User {
constructor(name) {
this.name = name;
}
}
app.post("/users", () => new User("Daphne"));
app.get("/users", () => {
return User.filter((user) => user.name === "Daphne")
});
Theory
Applying declarative programming at the runtime gives us ability to include data management in the same process.
In different words, the main objective of the project is to manage both of data and logic under the same runtime, at the same time, we can also stream/export data to external database like NoSQL.
How it works
nucleoid.run(() => {
var a = 1;
var b = a + 2;
var c = b + 3;
});
Once a variable is defined like var a = 1
, the runtime does 3 major things. First, it places the var a
in the graph and makes the connection between dependent variables.
Second, updates state with new values in order get affect
State | |
---|---|
var a |
1 |
var b |
3 |
var c |
6 |
However, actual execution is different since variables are tracked in the graph.
state.a = 1;
state.b = state.a + 2;
state.c = state.b + 3;
and finally stores statements in the runtime-managed fs
.
IDE (OpenAPI Editor)
The framework works with Express.js, we also made small UI that builds up the very same codes with OpenAPI, package and run on CodeSandbox.
This paradigm is still a part of the declarative programming, but applied at the runtime unlike Prolog or Haskell. As we are still discovering what we can do with this powerful programming model, please join us with any types of contribution!
Top comments (3)
Nice Can, looking to contribute very soon!
lookin like a cool project!