News for hackers. Stuff that matters.
Re:Notes on Idris (2017) by FeepingCreature on Thursday June 07, 2018 @04:01PM (#17259670)
D has something like type-safe printf. You can pass the printf string as a compiletime parameter, so ie. format!`%s is bigger than %s`(2, 3, 4) will error during compilation.
Re:Notes on Idris (2017) by ben-schaaf on Thursday June 07, 2018 @08:32PM (#17261596)
It also has similar type safety for native to `byte[]` conversion, ie. `bigEndianToNative!int` takes a `byte[4]`, which you can pass in from a `byte[]` using `data[0..4]`.
Re:Notes on Idris (2017) by icebraining on Friday June 08, 2018 @03:24AM (#17263320)
The question is whether that's a special case of the compiler or if it can be implemented by regular D code.
Re:Notes on Idris (2017) by FeepingCreature on Friday June 22, 2018 @01:51AM (#17371677)
It is implemented by regular D code in std.format. Logging libraries often do the same thing.