3 ms·
> Things like mixing in a data file is incredibly useful and not something I would want to use a rebuild step for at all. It’s not directly part of the const f
by coder543 7y ago
> Things like mixing in a data file is incredibly useful and not something I would want to use a rebuild step for at all.
It’s not directly part of the const function, but rust has compiler built-ins to import files as values as compile time, which makes it easy to declare global static variables that contain that data.
This is different from being able to walk a directory and read random files.
https://doc.rust-lang.org/std/macro.include_str.html https://doc.rust-lang.org/std/macro.include_str.html
https://doc.rust-lang.org/std/macro.include_bytes.html https://doc.rust-lang.org/std/macro.include_bytes.html
> They share the same frontend so there is very little difference.
That’s excellent.
- EvenThisAcronym 7y ago> This is different from being able to walk a directory and read random files. D doesn't allow you to do that either. You have to specify what files you are importing via a compiler switch: https://dlang.org/spec/expression.html#import_expressions https://dlang.org/spec/expression.html#import_expressions
- WalterBright 7y agoYes. That's another barrier I put in to prevent a carefully crafted source code from being a malware vector.