modularml / mojo

The Mojo Programming Language
https://docs.modular.com/mojo/manual/
Other
22.82k stars 2.58k forks source link

[Feature Request] FreeBSD ports collection #3288

Open syleishere opened 1 month ago

syleishere commented 1 month ago

Review Mojo's priorities

What is your request?

Add ports package to FreeBSD for users wanting to play with mojo.

What is your motivation for this change?

Many people have switched from Linux/kvm to FreeBSD/bhyve for host OS ever since demise of Centos. Would be nice to have support here.

Any other details?

For TCP sockets FreeBSD uses kqueue instead of epoll, perhaps a 3rd party library using libev or libevent may be able to combine the two, or just separate implementations.

martinvuyk commented 1 month ago

Hi, sorry to be a bummer but realistically FreeBSD is not on the priority list. Currently very many efforts are going into adding support for Windows and better Python and eventually (nex year) C interop.

For TCP sockets FreeBSD uses kqueue instead of epoll

I'm currently trying to implement sync TCP (others have already done it, I'm just adapting code), but trying to setup an async API to eventually implement kqueue for freeBSD and other BSD family (+ Apple) and maybe io_uring for linux (there is someone implementing it in Mojo), and IOCP for windows.

If you are interested, here is the link to the discussion I opened and where I'm trying to get the thing to work. If you're only interested in building your own FFI you still might be interested in looking at this file where I adapted some old code to work (w/ latest nightly) for calling some libc funcs.

You can also use the online notebooks, though I've never used them. Ask around in the discord server if you need any help :)