announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
eggsyntax 2021-03-07T18:50:22.261200Z

Next time I'd say this would be better in #news-and-articles, please. Thanks!

jeff tang 2021-03-07T18:50:36.261500Z

Will do sorry!

eggsyntax 2021-03-07T18:51:58.261700Z

No stress, it's kind of an edge case

jeff tang 2021-03-07T18:52:25.262100Z

Hopefully not for long

eggsyntax 2021-03-07T18:54:36.262300Z

Well, we've tried to keep #announcements to be new project or project version announcements, since so many people get notifications for it. It does definitely seem like there's lots of excitement about Athens; definitely a really cool project!

seancorfield 2021-03-07T19:21:30.264300Z

(thanks @eggsyntax -- I was just about to say the same since this is not a project/library release announcement)

seancorfield 2021-03-07T19:25:09.264500Z

I see you posted this in #jobs as well @tangj1122 so it really should not be in #announcements as well.

jeff tang 2021-03-07T19:30:20.264700Z

Deleted

seancorfield 2021-03-07T19:31:11.265Z

Thank you.

nooga 2021-03-07T22:08:26.270600Z

I’d like to share a hobby project of mine -> A Bytecode VM and compiler for a Clojure-like language: https://github.com/nooga/let-go 🚨 This is not a Clojure lib, in fact it’s not even written in Clojure. Nevertheless, I think it belongs here :thinking_face: 🐥 It’s super early stage (16 days old) but already starts resembling everybody’s favourite language. Hope you find it interesting:crossed_fingers:

❤️ 1
🎉 9
nooga 2021-03-08T13:43:38.274900Z

@ben.sless yes, the compiler targets the VM. I have chosen this approach to get a constrained execution environment decoupled from the language itself. This way it should be easier to optimize for runtime performance eventually and, perhaps even use the bytecode as IR for another stage that would produce machine code. Your idea with piggybacking on Go compiler crossed my mind but I’m not anywhere near this yet. One could imagine being able to dump the VM state as a standalone executable that would also contain the interpreter (compiler+vm) that only kicks in for the dynamic stuff. This is possible with bytecode alone but who knows where it goes in the future 🙂

Ben Sless 2021-03-08T13:48:32.275100Z

Thank you. Do you think the decision to generate bytecode will hamper you in the future if and when you want to emit machine code? You might end up having to write your own compiler from scratch, which is a shame because Golang has a really good compiler. How constrained would you say the execution environment is given Golang has managed memory? Do you manage memory yourself? Do you feel like going a bit in depth regarding the VM's architecture?

nooga 2021-03-08T13:56:27.275300Z

The current VM is stack based, just a for loop with a big switch inside. It’s utterly slow as it performs runtime checks on everything - this serves mainly as an aid in development - it’s easier to debug when something goes awry. I will slowly turn it towards unsafe when the compiler matures enough that we can trust it. One thing to note is that each call frame has its own instance of the VM and the call stack is handled by Go at the moment - this is slow but will avoid GIL.

👍 1
nooga 2021-03-08T13:58:40.275500Z

performance is my last priority as I want to get a correct interpreter as the baseline before I go into any attempts at speeding this up

nooga 2021-03-08T14:04:48.275700Z

as for compiling to machine code - when I get to it I will probably rely on an existing optimizing compiler anyway. In this case it’s much easier to translate a set of well defined bytecode instructions than it is to go from sexp level to target language/IR

borkdude 2021-03-08T14:07:24.275900Z

Maybe you can target LLVM and re-use that toolchain, eventually

nooga 2021-03-08T15:40:28.282400Z

@borkdude either this or, like @ben.sless suggested, use Go compiler as a library and generate some Go SSA on the fly 🙂