Reschivon / movForth

LLVM frontend for the Forth Language
MIT License
80 stars 4 forks source link

Great presentation at Forth2020 today. #3

Open helmersji opened 2 years ago

helmersji commented 2 years ago

Thanks for your work on this project. It may well attract many programmers to Forth.

I took the liberty of editing the LLVM Wikipedia page to include Forth in the languages that compile to LLVM. I included a link to this GitHub project. https://en.wikipedia.org/wiki/LLVM

Reschivon commented 2 years ago

Thank you!

I'm very glad to see that movForth is now in the passages of the Great Holy Wiki.

scherrey commented 1 year ago

Any progress on this project? I know LLVM is very much biased towards register based architectures. Has that been an issue with resulting code (dis-)satisfaction? Or have you just basically accomplished what you set out to do already?

Reschivon commented 1 year ago

One of the original goals for this project was to show that even a stack machine can be compiled to (fundamentally different!) modern hardware. And not just possible, but to generate optimal IR.

This required building a meticulous data dependency graph for every stack operation. It allowed for very nice translation to register IR, almost indistinguishable after optimization passes. So I would call it a success. Fundamentally, they are just moving data to the right operations. un-fundamentally, it was a year's work!

There are issues with supporting full wordset in practice. PICK does not manipulate the stack in the same way, for example. I would like to see LLVM support multiple returns since that is not a limitation at asm level

jemo07 commented 1 year ago

Hi, I just came across this, what a great project. Just wondering if there is support for variables number conversions, etc … and I don’t seem to find it?

Reschivon commented 1 year ago

Hey @jemo07, this project was a proof-of-concept so I didn't bother supporting anything other than signed integers. However you are welcome to submit a pr with support for other number types!