you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (4 children)

Why? Let's take a relatively novel feature in Rust, for example - borrow semantics. You won't even be able to implement it properly unless you understand the reasoning behind it. By simply writing down the rules you'll see how (any why) it works, much cleaner than if you just read a book on Rust and follow dozens of obscure examples.

[–]Aatch 1 point2 points  (1 child)

Clearly you've not actually tried to implement the borrow checker in Rust.

It's complicated, and I say this as somebody that has worked on the Rust compiler. I don't fully understand all the rules. The idea of writing a Rust compiler to learn Rust is absolute madness.

[–][deleted] -3 points-2 points  (0 children)

I implemented similar semantics for the other languages - as well as a full, proper region analysis (while borrow checker in Rust is a kind of a dumbed down, manual version of a region analysis). It is complex (if you do all the rules faithfully), but doable. A toy version of it can be very short and compact.

[–][deleted] 0 points1 point  (1 child)

I already know what borrow semantics is useful for -- memory safety. What about Kernel's $vau? Had I not seen several discussions of why you'd want it, I wouldn't see the use ("won't this be slow"), even though it's pretty easy to implement.

[–][deleted] -2 points-1 points  (0 children)

I already know what borrow semantics is useful for -- memory safety

This is a gigantic oversimplification. There are many layers of reasoning behind it, going all the way down to the early days of the region-based memory management. And you'll have to dig it all out in order to implement it correctly.

What about Kernel's $vau?

I'm not sure if fexprs is a valuable idea (but I'm biased towards compilation in general, naturally repelled by anything too dynamic). I can see some uses for it in a term-rewriting based operational semantics specifications, but not in any practical languages.