Has Node.js/libuv been ported to Haiku?

Quick question… Could find some comments but not a link - has libuv and node.js been ported to Haiku?

Thanks all!

Dave

Libuv: compiles fine, but doesn’t have the platform specific Code (somebody needs to write it), so it is BROKEN. Recipe is in Haikuports git.

Node.js: needs v8. The v8 Haiku port is too old, needs to be re-ported.

So the answers: no, no.

But why to ask something, what you can find out: https://github.com/haikuports/haikuports

Thanks for the reply! I actually searched with Google to find if there was a Haiku port for Node but I couldn’t find anything. Thank you for pointing me in the right direction.

For future reference the recipe is here: https://github.com/haikuports/haikuports/blob/ea482d4a386d8a3aa7dbe8a0c555fe526b30b99c/dev-libs/libuv/libuv-1.10.2.recipe

Yep, i made it, and it is known broken:

1 Like

The reason I brought this up originally was that it would be quite a cool project to create a bridge between Node.js and Haiku’s UI, so you can write first-class applications in ES5/ES6 (so basically port Node.js and LibUV, and then build a wrapper around the BApplication classes to allow UIs to be created from Javascript).

We do have jsc (JavaScript Shell) from WebKit. I don’t know if it is possible to add native bindings to it, however.

I see you took a shot at libuv, do know what is still missing to get it working correctly in haiku? would you be interested in joining efforts with me to try and port it ? i’m also interested v8 and node.js.
Let me know if you have some free time and are motivated.
ps: I’m not a developper myself but we can always ask for help when we get stuck somewhere.

Yes i saw that already, i guess you mean there is nothing you & i could do about it? or maybe you’re just not interested?

Miqlas does a lot of stuff for Haiku and he’s probably just run out of time!

There’d be an awful lot of work required to port Node.js to Haiku. Not only would you need to get Libuv working, you’d also need to customise Turbofan, the part of V8 that generates machine-specific code from bytecode. Quite a big task.

Personally I’d love to see Node.js on Haiku as I think the entire world seems to be going towards Javascript on both the client and server (Slack, Spotify, Atom, VS Code all written in Javascript) - but it seems a long way off.

Yes i am well aware of that, he is a real buzzy Bee on haikuports , that’s why i carefully chose words like “free time” “motivation” and ask for help from the devs.

1 Like

Gotcha. If I have a moment I’ll try and build libuv on my Haiku box but I reckon trying to get the latest version of V8 going will be damn tricky.

It isnt Hard to get it compiled, but check the resulted libs for UND symbols!

I also, on libuv for bit, got pretty far, though lack somebody knowledge in finishing some platform specific implemenation parts. @extrowerk I actually used your patch as a basis to start off of. Here’s my work: github.com/CodeforEvolution/libuv, look in the haiku branch.

Looks great, thanks!
But as i told plenty times, i don’t do programming, the skills missing. I just adjust and tailor existing code, so i can’t help with the platform specific things.
Maybe @robcsi can help from IRC, AFAIK he is also interested in libuv.

You seem to have gone quite a bit further, anything i can do to help?
now that you’re a little more familliar with the code, what functions still need to be implemented?

I can’t tell you as your code doesn’t compiles on x86_64.
I suppose libuv comes with test cases. Have you tried them? (make check, or make test)

My reply was actually addressed to CodeforEvolution, i tried his branch on a 32 bit system it compiles and the make check revealed several missing functionnalities, some of them i believe they don’t even exist in haiku, but we may not need all of them though.
just try to git clone his repo and don’t forget to do “git checkout haiku” before compiling.

Well, it does still compile, interesting…well, as you said, some functionalities are unimplemented (or incorrectly implemented, there is only so much I know :sweat_smile:) Though as for functionalities to be implemented, file polling (could be implemented with the node monitor), changing names of process titles (I don’t think this is possible within Haiku), network should be fully implemented (just borrowed the freebsd implementation, thank you freebsd network compatibility), and high res time and normal polling is implemented through posix compliant included functions.