Re:Why I rewrote my Rust keyboard firmware in Zig: consisten...
by Rochus on Sunday March 07, 2021 @07:38AM
(#26375417)
Thanks. I'm not familiar with Zig. I responded to the "arbitrary compile-time execution" by adding Lisp to the proposed list of D, Nim, and Haxe. Also the latter might raise some concerns when looking at details as you did with Lisp.
Re:Why I rewrote my Rust keyboard firmware in Zig: consisten...
by kazinator on Sunday March 07, 2021 @09:29PM
(#26381794)
For instance, even if x and y have the same meaning, (let (x) ...) and (let (y) ... ) will not. So if you can't do that in Zig, that implies you can't write a custom binding construct.
Re:Why I rewrote my Rust keyboard firmware in Zig: consisten...
by pron on Monday March 08, 2021 @04:10AM
(#26383628)
A let expression isn't parameterised by x and y but binds their meaning, and the bound variable isn't free in the expression, and you can't substitute it at all. A simple example is an expression that prints the syntactic name of its argument. You can do that in C, C++, Lisp and Rust, but not in Zig (this is OK, because Zig obviates the need for that with excellent backtraces). But this means that you can understand all Zig code as simple Zig code, and that there is no complex meta-language with super-powers as there is in all those other languages I mentioned.
[1]: I.e. if x and y have the same meaning ("reference"), in Lisp -- and in any other language with macros -- you could write a parameterised expression e, such that e(x) does not have the same meaning as e(y); you can't do that in Zig.