Skip to content

Commit

Permalink
Rename org to nucleoidai
Browse files Browse the repository at this point in the history
  • Loading branch information
canmingir committed Jun 8, 2024
1 parent d84aa86 commit 85e7799
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 39 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://www.apache.org/licenses/LICENSE-2.0">
<img src="https://img.shields.io/badge/Apache-2.0-yellow?style=for-the-badge&logo=apache" alt="License" />
</a>
<a href="https://www.npmjs.com/package/@nucleoidjs/synapses">
<a href="https://www.npmjs.com/package/@nucleoidai/react-event">
<img src="https://img.shields.io/badge/NPM-red?style=for-the-badge&logo=npm" alt="NPM" />
</a>
<a href="https://discord.com/invite/eWXFCCuU5y">
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 3
Creates application

```javascript
const nucleoid = require("nucleoidjs");
const nucleoid = require("nucleoidai");
const app = nucleoid();
```

Expand Down
14 changes: 7 additions & 7 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Learn more at [nucleoid.com/docs/runtime](/docs/runtime/)

## Code of Conduct

Please read our [Code of Conduct](https://github.com/NucleoidJS/Nucleoid/blob/main/CODE_OF_CONDUCT.md)
Please read our [Code of Conduct](https://github.com/NucleoidAI/Nucleoid/blob/main/CODE_OF_CONDUCT.md)

## Join our [Thinkers Club](https://github.com/NucleoidJS/Nucleoid/discussions/categories/thinkers-club)
## Join our [Thinkers Club](https://github.com/NucleoidAI/Nucleoid/discussions/categories/thinkers-club)

If you have an opinion, you are already a philosopher. We are working on brand-new approach to data and logic. Come join us in [discussions](https://github.com/NucleoidJS/Nucleoid/discussions/categories/thinkers-club).
If you have an opinion, you are already a philosopher. We are working on brand-new approach to data and logic. Come join us in [discussions](https://github.com/NucleoidAI/Nucleoid/discussions/categories/thinkers-club).

[![Nobel](https://cdn.nucleoid.com/media/nobel.png)](https://github.com/NucleoidJS/Nucleoid/discussions/categories/thinkers-club)
[![Nobel](https://cdn.nucleoid.com/media/nobel.png)](https://github.com/NucleoidAI/Nucleoid/discussions/categories/thinkers-club)

### Pinned Discussions

[![Discussion 25](https://cdn.nucleoid.com/media/discussion-25x500.png)](https://github.com/NucleoidJS/Nucleoid/discussions/25)
[![Discussion 26](https://cdn.nucleoid.com/media/discussion-26x500.png)](https://github.com/NucleoidJS/Nucleoid/discussions/26)
[![Discussion 28](https://cdn.nucleoid.com/media/discussion-28x500.png)](https://github.com/NucleoidJS/Nucleoid/discussions/28)
[![Discussion 25](https://cdn.nucleoid.com/media/discussion-25x500.png)](https://github.com/NucleoidAI/Nucleoid/discussions/25)
[![Discussion 26](https://cdn.nucleoid.com/media/discussion-26x500.png)](https://github.com/NucleoidAI/Nucleoid/discussions/26)
[![Discussion 28](https://cdn.nucleoid.com/media/discussion-28x500.png)](https://github.com/NucleoidAI/Nucleoid/discussions/28)
4 changes: 2 additions & 2 deletions docs/datastore.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Nucleoid is not designed for specific scalability model, in fact high plasticity
The smart sharding takes a JavaScript function and lets developers create own scalability policies unlike limited configuration options in major databases. The function receives additional data such as request headers, body etc. and it also comes with Nucleoid runtime along with the built-in data store, so that the sharding function can persist user data in order to support `memtable` like in Cassandra.

```shell
npx nucleoidjs start --cluster
npx nucleoidai start --cluster
```

This `npx` command starts specialized Nucleoid instance and acts like a front door to the cluster. The default sharding function takes `Process` header from REST and looks up in process list for IP and port information, and cluster instances can be added with calling terminal with `process1 = new Process("127.0.0.1", 8448)`.
Expand Down Expand Up @@ -118,7 +118,7 @@ https://nucleoid.com/ide/sample

> Performance benchmark is run in t2.micro of AWS EC2 instance and both databases had dedicated servers with no indexes and default configurations.
https://github.com/NucleoidJS/benchmark
https://github.com/NucleoidAI/benchmark

This does not necessary mean Nucleoid runtime is faster than MySQL or Postgres, instead many DBs in production require constant maintenance by DBA team with adjusting indexing, caching, purging etc. but Nucleoid tries to solve this problem with managing logic and data internally.

Expand Down
4 changes: 2 additions & 2 deletions docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 1

# Get Started

[![npm](https://img.shields.io/npm/v/nucleoidjs)](https://www.npmjs.com/package/nucleoidjs) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nucleoidjs/nucleoid/test.yml?branch=main)](https://github.com/NucleoidJS/Nucleoid/actions/workflows/test.yml)
[![npm](https://img.shields.io/npm/v/nucleoidai)](https://www.npmjs.com/package/nucleoidai) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nucleoidai/nucleoid/test.yml?branch=main)](https://github.com/NucleoidAI/Nucleoid/actions/workflows/test.yml)

Nucleoid serves as a reasoning engine for neuro-symbolic AI, implementing symbolic AI through declarative (logic-based) programming. Integrated within the Node.js runtime, it observes and manages statements in JavaScript, establishing intricate relationships among variables, objects, and functions in a graph structure. Installation is straightforward via npm, with no need for an external database, enhancing its accessibility and efficiency for neuro-symbolic applications.

Expand All @@ -21,7 +21,7 @@ Nucleoid serves as a reasoning engine for neuro-symbolic AI, implementing symbol
Once included in the project, you can initialize as:

```javascript
const nucleoid = require("nucleoidjs");
const nucleoid = require("nucleoidai");
const app = nucleoid();
```

Expand Down
8 changes: 4 additions & 4 deletions docs/learn.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import ReactPlayer from "react-player";

# Learn

[![NPM](https://img.shields.io/npm/l/nucleoidjs)](https://www.apache.org/licenses/LICENSE-2.0) [![npm](https://img.shields.io/npm/v/nucleoidjs)](https://www.npmjs.com/package/nucleoidjs)
[![NPM](https://img.shields.io/npm/l/nucleoidai)](https://www.apache.org/licenses/LICENSE-2.0) [![npm](https://img.shields.io/npm/v/nucleoidai)](https://www.npmjs.com/package/nucleoidai)

## Introduction

Expand Down Expand Up @@ -138,20 +138,20 @@ human1.mortal;
Nucleoid runtime runs top of Node.js, it can be installed as a npm package:

```shell
> npm i nucleoidjs
> npm i nucleoidai
```

Initialize the runtime with this:

```javascript
const nucleoid = require("nucleoidjs");
const nucleoid = require("nucleoidai");
const app = nucleoid();
```

> :bulb: The runtime uses local files for internal data management, and stores every statement locally. This clears local data:
>
> ```shell
> > npx nucleoidjs clear
> > npx nucleoidai clear
> ```
## Variables
Expand Down
24 changes: 11 additions & 13 deletions docs/synapses.md → docs/react-event.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
---
sidebar_position: 9
title: Synapses
title: react-event
---

# Synapses

<h1 align="center">Synapses</h1>
<h1 align="center">react-event</h1>

<p align="center">
<a href="https://www.apache.org/licenses/LICENSE-2.0">
<img src="https://img.shields.io/badge/Apache-2.0-yellow?style=for-the-badge&logo=apache" alt="License" />
</a>
<a href="https://www.npmjs.com/package/@nucleoidjs/synapses">
<a href="https://www.npmjs.com/package/@nucleoidai/react-event">
<img src="https://img.shields.io/badge/NPM-red?style=for-the-badge&logo=npm" alt="NPM" />
</a>
<a href="https://discord.com/invite/eWXFCCuU5y">
Expand All @@ -28,19 +26,19 @@ title: Synapses
<br/>

```shell
npm i @nucleoidjs/synapses
npm i @nucleoidai/react-event
```

Synapses is an alternative to React Context with event-driven style communication that helps to build loosely coupled components.
`react-event` is an alternative to React Context with event-driven style communication that helps to build loosely coupled components.

### How it works?

Subscribers are registered an event with the custom hook `useEvent(eventType, initialValue)`, once publisher posts an event and its payload, Synapses asynchronously sends the event to subscribed components and subscribed components will eventually be re-rendered with fresh data.
Subscribers are registered an event with the custom hook `useEvent(eventType, initialValue)`, once publisher posts an event and its payload, `react-event` asynchronously sends the event to subscribed components and subscribed components will eventually be re-rendered with fresh data.

Example:

```javascript
import { publish } from "@nucleoidjs/synapses";
import { publish } from "@nucleoidai/react-event";

const PublishComponent = () => {
return (
Expand All @@ -56,7 +54,7 @@ const PublishComponent = () => {
```

```javascript
import { useEvent } from "@nucleoidjs/synapses";
import { useEvent } from "@nucleoidai/react-event";

const Component1 = () => {
const [event] = useEvent("BUTTON_CLICKED", { number: 10 });
Expand All @@ -66,7 +64,7 @@ const Component1 = () => {
```

```javascript
import { useEvent } from "@nucleoidjs/synapses";
import { useEvent } from "@nucleoidai/react-event";

const Component2 = () => {
const [event] = useEvent("BUTTON_CLICKED", { string: "blue" });
Expand All @@ -75,13 +73,13 @@ const Component2 = () => {
};
```

<img src="https://cdn.nucleoid.com/media/synapses-sample.gif" alt="Sample Synapses" width="350" />
<img src="https://cdn.nucleoid.com/media/synapses-sample.gif" alt="Sample react-event" width="350" />

The complete sample project is [here](./sample).

### Stateless Handling

Synapses supports stateless components with caching last published payload for the event type, so that if the component is re-rendered, it won't lose the payload. For example, Component 3 in this example is not re-rendered yet, but Synapses holds the last payload for the event type, and once the component is rendered, it returns the payload instead of initial value.
`react-event` supports stateless components with caching last published payload for the event type, so that if the component is re-rendered, it won't lose the payload. For example, Component 3 in this example is not re-rendered yet, but Synapses holds the last payload for the event type, and once the component is rendered, it returns the payload instead of initial value.

<img src="https://cdn.nucleoid.com/media/synapses.drawio.png" alt="Synapses Diagram" width="350" />

Expand Down
6 changes: 3 additions & 3 deletions docs/runtime/mechanics.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Important objectives of Nucleoid runtime manages the control flow with graph and
## Example

```javascript
const nucleoid = require("nucleoidjs");
const nucleoid = require("nucleoidai");

nucleoid.run(() => {
var a = 1;
Expand All @@ -51,7 +51,7 @@ Here is the logical diagram of the runtime, and let's dive into to details

![Mechanics](../../static/media/mechanics.drawio.png)

1. When Node.js passes over the function, very first step is the function string is parsed into [`$nuc`](https://github.com/NucleoidJS/Nucleoid/tree/main/src/lang/%24nuc) structure as [CIL](https://en.wikipedia.org/wiki/Common_Intermediate_Language) language, which holds input statements as executable.
1. When Node.js passes over the function, very first step is the function string is parsed into [`$nuc`](https://github.com/NucleoidAI/Nucleoid/tree/main/src/lang/%24nuc) structure as [CIL](https://en.wikipedia.org/wiki/Common_Intermediate_Language) language, which holds input statements as executable.

> Something keep in mind, every programming language actually works with string and compiles to executable binaries or bytes, one thing is slightly different in the Nucleoid project, all CIL conversion happens at runtime instead of compile time. This gives advantages when manipulating [Control Flow](https://en.wikipedia.org/wiki/Control_flow) and data.
Expand All @@ -69,7 +69,7 @@ class $FUNCTION extends $ {
}
```

2. After an entry function is converted into `$nuc`, it runs each statement in [`stack.js`](https://github.com/NucleoidJS/Nucleoid/blob/main/src/stack.js), which is the core part of the runtime because the control flow is managed by stack and the stack decides sequence of statement based on the graph. For example:
2. After an entry function is converted into `$nuc`, it runs each statement in [`stack.js`](https://github.com/NucleoidAI/Nucleoid/blob/main/src/stack.js), which is the core part of the runtime because the control flow is managed by stack and the stack decides sequence of statement based on the graph. For example:

```javascript
class Item {
Expand Down
6 changes: 3 additions & 3 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const config = {
onBrokenLinks: "warn",
onBrokenMarkdownLinks: "warn",
favicon: "https://cdn.nucleoid.com/media/icon.png",
organizationName: "NucleoidJS",
organizationName: "NucleoidAI",
projectName: "Nucleoid",
titleDelimiter: "-",
i18n: {
Expand All @@ -35,7 +35,7 @@ const config = {
docs: {
routeBasePath: "/",
sidebarPath: require.resolve("./sidebars.js"),
editUrl: "https://github.com/NucleoidJS/docs/tree/main/",
editUrl: "https://github.com/NucleoidAI/docs/tree/main/",
},
blog: false,
theme: {
Expand Down Expand Up @@ -69,7 +69,7 @@ const config = {
position: "right",
},
{
href: "https://github.com/NucleoidJS/Nucleoid",
href: "https://github.com/NucleoidAI/Nucleoid",
html: require("fs").readFileSync("./github.html", "utf8"),
position: "right",
},
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ function Footer() {
></IconButton>
<IconButton
onClick={() =>
window.open("https://twitter.com/NucleoidJS", "_blank")
window.open("https://twitter.com/NucleoidAI", "_blank")
}
>
<TwitterIcon style={{ fill: "#ffffff" }} />
</IconButton>
<IconButton
onClick={() =>
window.open("https://github.com/NucleoidJS/Nucleoid", "_blank")
window.open("https://github.com/NucleoidAI/Nucleoid", "_blank")
}
>
<GitHubIcon style={{ fill: "#ffffff" }} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/StarUsMessageDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const StarUsMessageDialog = () => {
page_location: window.location.href,
page_path: window.location.pathname,
});
window.open("https://github.com/NucleoidJS/Nucleoid", "_blank");
window.open("https://github.com/NucleoidAI/Nucleoid", "_blank");
};

if (!open) {
Expand Down

0 comments on commit 85e7799

Please sign in to comment.