Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I learned a bunch of these when trying to make an f-string-like library for Lua [1], but `f"{...}" and the walrus ones caught me off-guard.

Glad this is nowhere near Wat [2], though.

[1]: https://ezhik.jp/f-string.lua/

[2]: https://www.destroyallsoftware.com/talks/wat



There are many mistakes in the Wat talk from destroyallsoftware. The biggest one is that he types `{}+[]` and claims that he's adding an object and a list. It's actually an empty scope followed by a unary + applied to a list. You can convince yourself of that by noting that `({}+[])` gives different output.

A smaller mistake that I find nonetheless amusing is that he uses Array(16) hoping to get 16 string separators. Oops, off by one error :)


Arguably that first one is just substituting one Wat for another.


That library looks awesome




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: