Hacker News new | ask | show | jobs
by kloud 2012 days ago
Very cool project, great to see more s-expression based languages. I maintain a list of lisp-flavored languages [0], so I will add Cakelisp there.

How did you implement the macro expansion? Are you translating the macros to C/C++, then compile it with C/C++ compiler and execute the temporary binary or do you have an interpreter for that?

I work on a somewhat similar project called Liz, which is basically a lisp-flavored dialect of Zig [1]. I did not implement user-defined macros yet, planning to learn more about comptime and its limitations first. But the compiler itself uses macro-expansion to implement many features.

[0] https://github.com/dundalek/awesome-lisp-languages

[1] https://github.com/dundalek/liz

2 comments

Thanks for maintaining this list, it looks super interesting and it was exactly what I was looking for!
Yes, they are compiled just like the final exe, only they become dynamic libraries that I load with libdl. On subsequent builds, they are loaded again, unless the macro changed.