4 ms·
erlangs bit matching syntax, case statements for structs... incredibly elegant. I don't know about Rust or Lua, maybe they have this too.
by sunkencity 8y ago
erlangs bit matching syntax, case statements for structs... incredibly elegant. I don't know about Rust or Lua, maybe they have this too.
- steveklabnik 8y agoRust doesn’t have the bit matching syntax, but we do have match generally.
- anuragsoni 8y agoIt'd be interesting to explore something similar to the bitstring[1] library for Ocaml. Where should one start if exploring syntax extensions for Rust. I haven't looked into rust in a while now so i'm not sure how far one can get with macros these days. [1] https://github.com/xguerin/bitstring https://github.com/xguerin/bitstring
- steveklabnik 8y ago“Macros 1.2” is what you want to look up; it’s in FCP right now!
- timgilbert 8y agoIn particular, the elixir_ale library is a very pleasant interface to various bits of hardware you might want to interact with at the GPIO/i2c/etc level. https://github.com/fhunleth/elixir_ale https://github.com/fhunleth/elixir_ale
- zeckalpha 8y agoMetaLua does!