3 ms·
The compiler can inject information at compile time so no runtime reflection is necessary.
by gdotdesign 2y ago
The compiler can inject information at compile time so no runtime reflection is necessary.
- wavemode 2y agoWell, there's nothing stopping the language from having builtin functions and constants in the standard library that are handled specially by the compiler, the same way this echo keyword is. That would've had the added benefit of being backwards compatible (which new keywords are not).
- _danielle_ 2y agoGleam reserved a handful of keywords in 1.0 (including echo), so it isn't a new keyword.
- keeganpoppen 2y agothat is basically just a keyword with extra steps...
- wavemode 2y ago> That would've had the added benefit of being backwards compatible (which new keywords are not).
- keeganpoppen 2y agoexcept it’s not a new keyword. and is your argument that you could easily define python print() to something else in a way that having a “print” keyword disallows? no wonder python 2=>3 was such a bear…
- lpil 2y agoWhat you're describing is what `echo` is in terms of functionality and implemented, and it's not a new keyword so it is backwards compatible. There are disadvantages of blurring the lines of what a function is an can do. Gleam values clarity above all things, so we don't have back-doors or special-cases. Everything plays by the same rules.
- ivanjermakov 2y agoCall site can be inlined in compile time, without special syntax. Full stack trace would require runtime support anyway.