re: Joke reply, re: Elixir
@socks big emi....
-F
Serious reply, re: Elixir
@Felthry They make it very difficult to debug when something is wrong. It's not a problem at all when it's something built into the language's standard library and thoroughly well-tested but as soon as you step out of that, you're walking on thin ice
re: Serious reply, re: Elixir
@socks I'm guessing in this context it means something more complicated than how people typically use C preprocessor macros, then?
oh and assembler macros are hard to program without, i don't want to have to remember which memory location we stored this variable in and every location we referenced it in case we have to change it
-F
re: Serious reply, re: Elixir
@socks @noiob if you say `int x = 3`, that's (bar any compiler optimizations) reserving some amount of memory (4 bytes on modern computers) for x to occupy, until it's done being x and can be used for something else (figuring out when it's done being x can be a hard problem if you don't explicitly say it's done being x, this is the cause of many memory leaks). If x is never anything other than 3, it would be more efficient to just use immediate opcodes instead of 1) taking up some memory and 2) requiring additional memory fetches (which are way slower than processor cycles)
-F
re: Serious reply, re: Elixir
@Felthry Well yeah, that stuff is handled by language constructs themselves usually. By macros I basically mean code that is autogenerated at compile time
In Elixir they're used all over the place, and they're very convenient but I don't trust user-defined macros. In Haskell you see it in libraries like Persistent for example, where typing out the definition of a database table with Haskell functions is very tedious and you wanna automate it to some extent
re: Serious reply, re: Elixir
@socks ah, so like the GENERATE block in VHDL! yeah we find those annoying to comprehend and debug too
-F
Joke reply, re: Elixir
@Felthry Nothing, I am really big myself sometimes