Fork me on GitHub
#announcements
<
2021-03-07
>
jeff tang18:03:11

Athens Research budgets $10,000 in bounties for 20 issues over the next 3 weeks. Learn more about this bounty program here: https://www.notion.so/athensresearch/Bounty-Experiment-3-07-21-3-28-21-d2839e46b19b4bf9aeb6299845974622

eggsyntax18:03:22

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

jeff tang18:03:36

Will do sorry!

eggsyntax18:03:58

No stress, it's kind of an edge case

jeff tang18:03:25

Hopefully not for long

eggsyntax18:03:36

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!

seancorfield19:03:30

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

seancorfield19:03:09

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

nooga22:03:26

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:

🎉 27
❤️ 3
Ben Sless07:03:29

Something I've been wondering about since coming across this project - if I understand correctly, the compiler targets the VM? Is your end goal something like gccemacs's native-compiler? Did you consider the approach of plugging in to Golang's compiler internals and just generate ASTs directly from the code? That would require dynamic linking at runtime and I'm not sure if that's even possible

6
nooga13:03:38

@UK0810AQ2 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 Sless13:03:32

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?

nooga13:03:27

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.

👍 3
nooga13:03:40

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

nooga14:03:48

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

borkdude14:03:24

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

nooga15:03:28

@U04V15CAJ either this or, like @UK0810AQ2 suggested, use Go compiler as a library and generate some Go SSA on the fly 🙂