2 days ago
Well, that use of markdown didn't go well!

Anyhow, I changed my mind. I think the correct change is to just remove the -release switch from the druntime build.
2 days ago
On 08/05/2025 10:31 AM, Walter Bright wrote:
> Well, that use of markdown didn't go well!
> 
> Anyhow, I changed my mind. I think the correct change is to just remove the -release switch from the druntime build.

Huzzah!

I was really worried, I'd end up fighting you on -release at the next meeting :)

2 days ago
On 5/8/25 00:02, Walter Bright wrote:
> Next, there's druntime being compiled with `-release`. What does that mean for the array bounds check:
> ```
> void main(){
>       int[2] x=[0,1];
>       auto y=x[1..2];
>       x[]=y[];
> }
> ```
> Compile with -vasm -release -check=on
> ```
> core.exception.RangeError@x.d(4): Range violation

Yes, with DMD this command line works, but it seems LDC still calls into a druntime assert(0).

$ ./ldc2-1.41.0-beta1-linux-x86_64/bin/ldmd2 -release -check=on -run test.d
Error: /tmp/test-116bf6 failed with status: -2
       message: Illegal instruction (core dumped)
Error: program received signal 2 (Interrupt)
2 days ago
On 5/8/25 00:31, Walter Bright wrote:
> Well, that use of markdown didn't go well!
> 
> Anyhow, I changed my mind. I think the correct change is to just remove the -release switch from the druntime build.

🎉 :)

Thanks!
2 days ago
On 5/7/2025 3:31 PM, Walter Bright wrote:
> Anyhow, I changed my mind. I think the correct change is to just remove the -release switch from the druntime build.

https://github.com/dlang/dmd/pull/21356
2 days ago
I'm going to have to defer to Martin on that.
2 days ago

On Wednesday, 7 May 2025 at 22:31:30 UTC, Walter Bright wrote:

>

Well, that use of markdown didn't go well!

Anyhow, I changed my mind. I think the correct change is to just remove the -release switch from the druntime build.

Okay, I use that approach too, but it requires you to distinguish between assert and debug assert and invariants, but druntime and phobos were written with an assumption that assert has the purpose of debug assert, so it uses assert for all sorts of contract and extensive debug checks.

2 days ago

On Wednesday, 7 May 2025 at 23:10:56 UTC, Timon Gehr wrote:

>

Yes, with DMD this command line works, but it seems LDC still calls into a druntime assert(0).

$ ./ldc2-1.41.0-beta1-linux-x86_64/bin/ldmd2 -release -check=on -run test.d
Error: /tmp/test-116bf6 failed with status: -2
message: Illegal instruction (core dumped)
Error: program received signal 2 (Interrupt)

The array copy hook is in rt.array.

2 days ago
>

distinguish between assert and debug assert

between defensive asserts and debug asserts

1 day ago
On Wednesday, 7 May 2025 at 23:10:56 UTC, Timon Gehr wrote:
> On 5/8/25 00:02, Walter Bright wrote:
>> Next, there's druntime being compiled with `-release`. What does that mean for the array bounds check:
>> ```
>> void main(){
>>       int[2] x=[0,1];
>>       auto y=x[1..2];
>>       x[]=y[];
>> }
>> ```
>> Compile with -vasm -release -check=on
>> ```
>> core.exception.RangeError@x.d(4): Range violation
>
> Yes, with DMD this command line works, but it seems LDC still calls into a druntime assert(0).
>
> $ ./ldc2-1.41.0-beta1-linux-x86_64/bin/ldmd2 -release -check=on -run test.d
> Error: /tmp/test-116bf6 failed with status: -2
>        message: Illegal instruction (core dumped)
> Error: program received signal 2 (Interrupt)

I think this is an LDC bug:
https://github.com/ldc-developers/ldc/issues/3793

It came up in the Learn forum recently:
https://forum.dlang.org/post/krzyhjmbzkhqgolpemxz@forum.dlang.org
1 2 3 4 5 6 7 8 9 10
Next ›   Last »