News for hackers. Stuff that matters.
Re:Cakelisp: A Programming Language for Games by akhilcacharya on Monday December 21, 2020 @12:15AM (#25492319)
I’m interested in this “comptime” aspect. Zig has it too, but are there any other languages that use this? I’m under the impression that there’s a distinction between comptime evaluation and typical lisp macros.
Re:Cakelisp: A Programming Language for Games by makuto on Monday December 21, 2020 @12:37AM (#25492394)
The big distinction to me is that there is a final executable that eventually gets created, whereas Lisp programs can continue to generate code and self-modify at runtime.

Cakelisp differs from Zig in that arbitrary code modification is supported, which is a step closer to the modifiable environment of Lisps. Very few languages besides lisp allow you to do things like "iterate over every function defined and change their bodies, and create a new function which calls them". Zig does not support that. It's extremely useful for some tasks (e.g. hot-reloading code modification, mentioned in the article)

Jai isn't out yet, but I was inspired by many of the comptime ideas.

Re:Cakelisp: A Programming Language for Games by david2ndaccount on Monday December 21, 2020 @01:26AM (#25492583)
I don’t know how comptime works in Zig, but D has nearly unrestricted compile time code execution.
Re:Cakelisp: A Programming Language for Games by moonchild on Monday December 21, 2020 @02:53AM (#25492953)
?

Lots of things don't work in d's CTFE.

It's certainly very useful, and much better than e.g. c++ constexpr. But it's still worlds away from proper lisp metaprogramming.