Comment by sakras
2 months ago
I was pretty excited about Hare until Devault said that Hare wouldn't be doing multithreading as he preferred multiprocessing. That was a pretty big dealbreaker for me. The rest of the language looks quite clean though!
hare-ev [0] is using epoll under the covers, which means multithreading is there, already. Especially as ev may be merged into the stdlib at some point.
[0] https://git.sr.ht/~sircmpwn/hare-ev
Maybe I'm misunderstanding something, but it seems like ev is still multiprocessing? Reading the code, it looks like you can read/write to files, and if you want to kick off some other work it spawns a process. I don't see any instance of threads there.
epoll is threaded, not multiprocess. [0]
hare-ev is using rt to make the epoll syscalls. [1]
> On Linux, ev is implemented with epoll. Note that, on Linux, I/O on regular files is always blocking.
[0] https://www.man7.org/linux/man-pages/man7/epoll.7.html
[1] https://docs.harelang.org/rt#SYS_epoll_create
1 reply →
You could always link to pthread and use that in your Hare code, no?
Conceptually yes, but I suspect there's going to be a lot hairier in practice. For instance, I think there's some stuff that needs language support such as thread-local storage. I'd guess it would be simpler to just re-implement threading from scratch using syscalls. But I also don't think the language provides any support for atomics, so you'd have to roll your own there.