digitalmars.D - New blog post featuring D
- Brian Callahan (7/7) Jan 22 It's not the star of the show, but my latest blog post features D
- Matheus Catarino (6/13) Jan 22 Nice. In fact, in this case, the LDC is not being the
- Walter Bright (3/11) Jan 22 Nice work! Minor suggestion: The D example is too short to benefit from ...
- Patrick Schluter (4/18) Jan 23 You shouldn't advertise -release flag as long as it does "wrong
- Walter Bright (2/5) Jan 23 -release has not removed array bounds checking for about 17 years now :-...
- jmh530 (5/12) Jan 23 The documentation says "Array bounds checking is not done for
- Walter Bright (2/14) Jan 24 You're right. It is not removed from @safe code.
- Siarhei Siamashka (25/28) Jan 23 The "-release" option removes bounds checking from the unsafe
It's not the star of the show, but my latest blog post features D as one of the heroes to quickly solve one of my problems. Was a nice reminder that if you make content, it doesn't have to be "about" D in order to show D off. Just a nod to "when I have a problem, I use D to solve it" can be helpful. https://briancallahan.net/blog/20240122.html ~Brian
Jan 22
On Monday, 22 January 2024 at 14:00:05 UTC, Brian Callahan wrote:It's not the star of the show, but my latest blog post features D as one of the heroes to quickly solve one of my problems. Was a nice reminder that if you make content, it doesn't have to be "about" D in order to show D off. Just a nod to "when I have a problem, I use D to solve it" can be helpful. https://briancallahan.net/blog/20240122.html ~BrianNice. In fact, in this case, the LDC is not being the protagonist. Perhaps, a bash script could do the same. Based on what you did it is similar to my zigcc wrapper for ldc2. Replacing the system toolchain. https://github.com/kassane/sokol-d/blob/main/tools%2Fzigcc.zig
Jan 22
On 1/22/2024 6:00 AM, Brian Callahan wrote:It's not the star of the show, but my latest blog post features D as one of the heroes to quickly solve one of my problems. Was a nice reminder that if you make content, it doesn't have to be "about" D in order to show D off. Just a nod to "when I have a problem, I use D to solve it" can be helpful. https://briancallahan.net/blog/20240122.html ~BrianNice work! Minor suggestion: The D example is too short to benefit from -O -release flags. Also, `-fas` is redundant as `as` is produced by default.
Jan 22
On Monday, 22 January 2024 at 20:57:58 UTC, Walter Bright wrote:On 1/22/2024 6:00 AM, Brian Callahan wrote:You shouldn't advertise -release flag as long as it does "wrong thing"™ like removing array bound checking and assertions (it is contradictory to your normal memory safety stance).It's not the star of the show, but my latest blog post features D as one of the heroes to quickly solve one of my problems. Was a nice reminder that if you make content, it doesn't have to be "about" D in order to show D off. Just a nod to "when I have a problem, I use D to solve it" can be helpful. https://briancallahan.net/blog/20240122.html ~BrianNice work! Minor suggestion: The D example is too short to benefit from -O -release flags. Also, `-fas` is redundant as `as` is produced by default.
Jan 23
On 1/23/2024 1:58 AM, Patrick Schluter wrote:You shouldn't advertise -release flag as long as it does "wrong thing"™ like removing array bound checking and assertions (it is contradictory to your normal memory safety stance).-release has not removed array bounds checking for about 17 years now :-)
Jan 23
On Tuesday, 23 January 2024 at 21:30:28 UTC, Walter Bright wrote:On 1/23/2024 1:58 AM, Patrick Schluter wrote:The documentation says "Array bounds checking is not done for system and trusted functions, and assertion failures are undefined behaviour." https://dlang.org/dmd-windows.html#switch-releaseYou shouldn't advertise -release flag as long as it does "wrong thing"™ like removing array bound checking and assertions (it is contradictory to your normal memory safety stance).-release has not removed array bounds checking for about 17 years now :-)
Jan 23
On 1/23/2024 1:45 PM, jmh530 wrote:On Tuesday, 23 January 2024 at 21:30:28 UTC, Walter Bright wrote:You're right. It is not removed from safe code.On 1/23/2024 1:58 AM, Patrick Schluter wrote:The documentation says "Array bounds checking is not done for system and trusted functions, and assertion failures are undefined behaviour." https://dlang.org/dmd-windows.html#switch-releaseYou shouldn't advertise -release flag as long as it does "wrong thing"™ like removing array bound checking and assertions (it is contradictory to your normal memory safety stance).-release has not removed array bounds checking for about 17 years now :-)
Jan 24
On Tuesday, 23 January 2024 at 09:58:53 UTC, Patrick Schluter wrote:You shouldn't advertise -release flag as long as it does "wrong thing"™ like removing array bound checking and assertions (it is contradictory to your normal memory safety stance).The "-release" option removes bounds checking from the unsafe code, but keeps them in the code that is annotated as ` safe`. The only problem is that ` safe` is not the default function attribute in D. So all samples from the blog post need a ` safe:` line added in the beginning of the source file to opt-in the safety. The first sample would turn into: ```D safe: import std.string; import std.process; int main(string[] args) { string[] av = new string[args.length + 2]; av[0] = "/usr/bin/cc", av[1] = "-xassembler", av[2] = "-c"; size_t ac = 3; foreach (i; 1 .. args.length) av[ac++] = args[i]; return spawnProcess(av).wait(); } ``` Also there's an error in one of the samples: ```D int main(strings[] args) { ```
Jan 23