Open piranna opened 9 years ago
Yeah, check out this https://github.com/kesla/runtime-node-net (by @kesla). It's still work in progress, but the idea is to provide Node.js compatible net module on top of runtime. Later we can teach runtimeify to use it automatically, so existing Node.js apps would just work without any modifications.
Great! :-D
@piranna we now have net, dns & http for runtimejs!
Very early days, but compatibility is getting there
Very early days, but compatibility is getting there
Wohoo! :-D
In its current status, NodeOS has too much dependency on processes. Maybe in the future we remove them if we make it a Javascript-only OS (at this moment the only binary is Node.js, I hope LLVM.js cames soon so I don't need to have a gcc binary for compiled modules...), but until that I'll wait for them. Keep working, good job :-)
LLVM.js?
how will that work?
LLVM.js?
https://github.com/kripken/llvm.js, it's LLVM (and Clang) compiled itself to Javascript using Emscripten, although seems to be abandoned... :-( But this could allow to have a C/C++ compiler written (transpiled) in Javascript so it can be used in NodeOS for the compiled modules and also for runtime.js :-)
@piranna sounds to crazy to be a good idea to me. I'd much rather see that we skip support for c++ modules all together and go strong on full js-modules.
Yeah, for runtime.js I would definitely go for pure Javascript modules, and only have C++ to expose to that Javascript modules the most internal and low-level parts (interruptions, ports address, memory...) as Javascript objects.
NodeOS make use of some compiled modules to have access to the Linux syscalls as if they were functions, but it's possible to change them to call methods on runtime.js core objects :-)
Oh right, so I'm not a pro around this - but wouldn't it be possible to use https://www.npmjs.com/package/ffi for this?
but wouldn't it be possible to use https://www.npmjs.com/package/ffi for this?
In fact, it's being integrated natively in the core of upcoming versions of Node.js... :-D
There's some of the internal modules published on npm and seems it's the way to go, so the core will be minimal and probably it's mostly a matter of having a require() function and delegate everything to modules as @groundwater proposed. Later one of those modules could provide an environment and API layer that a Node.js app would expect. I know runtime.js will try first to allow to exec single Javascript apps, but that single app could be a Node.js emulator similar to what diferent libOS libraries do on the exokernels, isn't it? :-)
(And yes, I'm asking for this to exec NodeOS on runtime.js ;-) )