On 01/23/2018 03:38 AM, Mike Franklin wrote:
import std.stdio;
void main() @safe
{
string foo = "foo";
string* ls0;
string* p1, p2;
ls0 = &foo;
p1 = ls0;
ls0.destroy();
p2 = ls0;
writeln(p2.length);
}
Compile with `-dip1000`
Error: program killed by sig
On Tuesday, 23 January 2018 at 02:25:57 UTC, Mike Franklin wrote:
Should `destroy` be `@system` so it can't be called in `@safe`
code, or should the compiler be smart enough to figure out the
flow control and throw an error?
Interestingly, `destroy` is an unsafe operation for classes.
import
On Tuesday, 23 January 2018 at 02:38:42 UTC, Mike Franklin wrote:
So that's bad. But it looks like a bug in `-dip1000`
https://issues.dlang.org/show_bug.cgi?id=18283
On Tuesday, 23 January 2018 at 02:25:57 UTC, Mike Franklin wrote:
Not sure how to precisely define the problem here. Should
`destroy` be `@system` so it can't be called in `@safe` code,
or should the compiler be smart enough to figure out the flow
control and throw an error?
Mike
The compi
On Tuesday, 23 January 2018 at 02:25:57 UTC, Mike Franklin wrote:
Due to the aforementioned bugs in my prior posts, I couldn't
even make an example to demonstrate in @safe code, so I
modified the example slightly in an effort to reproduce the
same problem.
import std.stdio;
void main() @saf
On Tuesday, 23 January 2018 at 01:08:19 UTC, ag0aep6g wrote:
The real question is about this line:
p2 = ls[0];
That's an out-of-bounds access, and the compiler does not catch
this statically. Instead, it inserts bounds-checking code that
crashes the program safely with an `Error`.
Due
On Tuesday, 23 January 2018 at 01:08:19 UTC, ag0aep6g wrote:
The real question is about this line:
p2 = ls[0];
That's an out-of-bounds access, and the compiler does not catch
this statically. Instead, it inserts bounds-checking code that
crashes the program safely with an `Error`.
In t
On Tuesday, 23 January 2018 at 01:08:19 UTC, ag0aep6g wrote:
If you add `@safe`, the compiler rejects this line:
ls ~= &foo;
But that line would only be problematic if the pointer would
leave the scope of the function. It doesn't, so this is
actually safe. But the compiler isn't smart en
On 01/23/2018 01:20 AM, Mike Franklin wrote:
I would be surprised if
the compiler allowed you to do something like this in `@safe` code.
You might get surprised then, if you expect the compiler to reject code
like that statically.
If you add `@safe`, the compiler rejects this line:
ls ~
On Tuesday, 23 January 2018 at 00:20:45 UTC, Mike Franklin wrote:
On Monday, 22 January 2018 at 23:30:16 UTC, Aedt wrote:
[...]
D is not memory safe by default (unfortunately), so it's not
surprising to me that you can do this in `@system` code. I
would be surprised if the compiler allowed
On Monday, 22 January 2018 at 23:30:16 UTC, Aedt wrote:
I was asked in Reddit
(https://www.reddit.com/r/learnprogramming/comments/7ru82l/i_was_thinking_of_using_d_haxe_or_another/) how would D handle the following similar D code. I'm surprised that both dmd and ldc provides no warnings even with
I was asked in Reddit
(https://www.reddit.com/r/learnprogramming/comments/7ru82l/i_was_thinking_of_using_d_haxe_or_another/) how would D handle the following similar D code. I'm surprised that both dmd and ldc provides no warnings even with -w argument passed.
import std.stdio;
void main()
{
On Monday, 15 January 2018 at 19:28:08 UTC, Ali Çehreli wrote:
I know a project where D could benefit from gRPC in D, which is
not among the supported languages:
https://grpc.io/docs/
Do you think gRPC support is worth adding to GSOC 2018 ideas?
https://wiki.dlang.org/GSOC_2018_Ideas
Ali
On Monday, 22 January 2018 at 05:54:31 UTC, Dmitry Olshansky
wrote:
On Monday, 22 January 2018 at 04:40:53 UTC, Andrew Benton wrote:
On Monday, 15 January 2018 at 19:28:08 UTC, Ali Çehreli wrote:
I know a project where D could benefit from gRPC in D, which
is not among the supported languages:
On Friday, 5 January 2018 at 03:28:10 UTC, Walter Bright wrote:
There's a lot of technical debt I've been trying to fix with
that, and nobody else seems willing to do it. For example,
fixing the error messages so they make use of color syntax
highlighting. It's boring, tedious, unfun work, mea
15 matches
Mail list logo