Arc Forumnew | comments | leaders | submitlogin
A native Arc compiler for Linux (github.com)
11 points by stefano 6008 days ago | 6 comments


9 points by stefano 6008 days ago | link

As you will see from the link, the compiler is still far from being complete, but is has macros and it can compile itself. I know that this project is quite overlapping with arc2c (it generates assembly instead of C), but I started the project from scratch to learn more about compilers and not to build a full-blown Arc system. This is why the name is "Not Yet an Arc Compiler" -- I don't know if it will ever be Arc compatible, but I hope one day it will be :)

-----

5 points by stefano 6004 days ago | link

Update: continuations support is almost complete. 'ccc works on the simple test cases I've tried. It should work on more complex cases too, but no testing has been done yet.

-----

2 points by almkglor 6008 days ago | link

How'd you implement macros?

-----

1 point by stefano 6007 days ago | link

I've implemented them as I've described here: http://arclanguage.org/item?id=7097

They still have some problems when you use the compiler to compile itself, because macros have to run in the host compiler environment and not in the target environment (that doen't still exist). I'll write more about this problem in a NOTES file I have to add to the repository. The key point in implementing macros in a compiled system is first to get the system able to compile itself: once that point is reached, they are quite straightforward to implement, except for the problem mentioned before. The last two functions in transformations.arc plus the function eval in lib.arc implement macros.

-----

1 point by conanite 6008 days ago | link

awesome, congratulations. I'll have to fire up my linux machine and give it a shot!

-----

1 point by stefano 6007 days ago | link

Thank you :)

What OS do you use? If it's unix compatible there are chances to get the compiler to work. If it's windows, I don't know. There exist gcc for windows, but I don't know if it has the following linux functions: dlopen, mmap, open, read, write. Obviously the windows equivalent of these functions exist, but I don't have a windows machine, so I can't develop the windows port.

-----