Code Monkey home page Code Monkey logo

nexusjs's Introduction

Nexus.js โ€” Multi-threaded I/O for JavaScript.

Join the chat at https://gitter.im/voodooattack/nexusjs

Nexus.js is a multi-threaded JavaScript run-time built on top of JavaScriptCore (Webkit) with a focus on high performance and dynamic scaling above all else.

Nexus.js uses an asynchronous, non-blocking I/O model, and a thread-pool scheduler to make the most of modern hardware concurrency.

Nexus.js is Promise-based and embraces ES6 in full; and as a result, it is not compatible with Node.js APIs.

Building

Build Requirements

Obtaining Nexus.js

Simply clone Nexus using git to your chosen directory.

git clone https://github.com/voodooattack/nexusjs.git nexusjs
cd nexusjs 
git submodule update --init --recursive

Or you might wish to do a shallow clone to avoid a longer download:

git submodule update --init --recursive --depth 1

Building Nexus.js

After making sure you have all the dependencies installed, use CMake to build Nexus.js. I recommend using CCMake (or your favourite CMake UI)

$ cd nexusjs/
$ mkdir build
$ cd build/
$ ccmake ..

Documentation

The Nexus.js API is a shifting haze. Because it changes so much from commit to commit, no documentation is currently available; but you can look into the tests directory for an insight into how to use it.

Fear not, though! For a comprehensive manual is planned! Along with a package manager to make Nexus proud!

Native add-ons

While still a big topic for debate, native add-ons should be very feasible in the future, once a proper ABI is chosen. Please discuss this here.

Contributing

All pull requests, suggestions, and questions are welcome.

Read more

You can read more on Nexus.js and the progress of development in the following articles:

FAQ

  • Will you implement require()?

Not likely. Nexus.js will use the Promise-based import(...) API for dynamic loading, and otherwise use the import and export keywords for normal module loading. require() can still be implemented by a third-party in pure JavaScript of course, it just won't come built-in.

  • Why are you avoiding require()? Are you planning on breaking all backward-compatibility with Node.js?

Yes. I know the decision is harsh, but it will be better in the long run. It will make porting libraries harder, but the result will be a pure ES6 ecosystem with ES6 modules at its core. This is necessary because Nexus.js is multi-threaded, and most Node.js libraries use globals in one form or another, which means they'd be broken anyway. While accessing globals concurrently will not corrupt them or crash the program, it will produce unexpected behaviour in any event-loop based code. Since it assumes a single-threaded environment.

  • How does concurrent access to variables work? Do you use a Mutex for every variable?

No, please see Locking in WebKit, it explains it better than I ever could.

  • Can Nexus.js libraries override globals?

The globals are created on-demand in every context that accesses them, and this makes it impossible to replace them. For example, Nexus.EventEmitter exists in every context, but if you replace it in a library it will not affect the Nexus.EventEmitter available in a different library, or in the main context.

I do plan on offering certain hooks for transpiling utilities and the such. If you're using Babel to transpile JSX for an isomorphic (universal) application, you need not worry.

nexusjs's People

Contributors

gitter-badger avatar voodooattack avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.