Jump to page: 1 2
Thread overview
Article: Running D without its runtime
Nov 10, 2016
Guillaume Piolat
Nov 10, 2016
thedeemon
Nov 10, 2016
Guillaume Piolat
Nov 10, 2016
Olivier Pisano
Nov 10, 2016
Guillaume Piolat
Nov 10, 2016
ag0aep6g
Nov 10, 2016
Guillaume Piolat
Nov 10, 2016
ag0aep6g
Nov 10, 2016
Guillaume Piolat
Nov 10, 2016
Olivier Pisano
Nov 10, 2016
Russel Winder
Nov 10, 2016
Guillaume Piolat
Nov 11, 2016
Guillaume Piolat
Nov 12, 2016
Russel Winder
Nov 10, 2016
qznc
Nov 10, 2016
Guillaume Piolat
November 10, 2016
https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html

"Our products now run with the D language runtime disabled. This post is both a post-mortem and tutorial on how to live without the D runtime. "

This only covers the middle road where you link with the runtime and not initialize it.

Basically describes the process of leaving the D runtime disabled for products that used to rely on it. I present a simple way to have MM exceptions in @nogc (an idea originally from Adam D Ruppe I think).

It wasn't very hard just took lots of grunt work. What striked me most during the process was the cascade of things that couldn't be "nothrow @nogc" because Object.~this isn't. So the workaround is rather ugly, and you don't get to reuse things using the regular .destroy (like Unique, scoped!, etc.)
November 10, 2016
On Thursday, 10 November 2016 at 00:56:02 UTC, Guillaume Piolat wrote:
> https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html

Great post and useful pieces of code, thanks!

"every class object's destructor is assumed to throw exceptions and use the GC by default."

This is the schizophrenic part of D, since allocations inside destructors are not allowed by its own runtime and cause immediate stop of the program. A sane language would either insist on making all destructors @nogc or allow some allocations during the GC phase (like CLR and JVM do, I suppose).

And exceptions in destructors should not be allowed: there is no sane place to catch and handle exceptions arising during the GC phase (which can be triggered by arbitrary allocation anywhere in the code), so if we can't reason about them and handle them we shouldn't allow them.
November 10, 2016
I cannot read your website on Firefox 45 (no text is displayed). It works on chromium anyway.
November 10, 2016
On Thursday, 10 November 2016 at 00:56:02 UTC, Guillaume Piolat wrote:
> https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
>
> "Our products now run with the D language runtime disabled. This post is both a post-mortem and tutorial on how to live without the D runtime. "

For runtime users the good news is that speed is already fine. :)

The hacks you needed to go through are ugly. Any ideas how this could be improved?

(animated background arrrrg...)
November 10, 2016
On Thursday, 10 November 2016 at 06:52:12 UTC, Olivier Pisano wrote:
> I cannot read your website on Firefox 45 (no text is displayed). It works on chromium anyway.

I develop it on Firefox. What is your OS?
November 10, 2016
On Thursday, 10 November 2016 at 10:30:36 UTC, qznc wrote:
> On Thursday, 10 November 2016 at 00:56:02 UTC, Guillaume Piolat wrote:
>> https://www.auburnsounds.com/blog/2016-11-10_Running-D-without-its-runtime.html
>>
>> "Our products now run with the D language runtime disabled. This post is both a post-mortem and tutorial on how to live without the D runtime. "
>
> For runtime users the good news is that speed is already fine. :)
>
> The hacks you needed to go through are ugly. Any ideas how this could be improved?

Barely.

I'm not wise enough to know what this would imply. In my uninformed opinion, making attribute inference work on destroy() and making class destructors "nothrow @nogc" would go a long way.
As it is, doing D without the runtime isolates you in a tiny universe.

About exceptions, if we modify Throwable to have a "release()" virtual function called (or better own an allocator?), then we could have the caller catch exception regardless of how they are allocated.
November 10, 2016
On 11/10/2016 12:11 PM, Guillaume Piolat wrote:
> On Thursday, 10 November 2016 at 06:52:12 UTC, Olivier Pisano wrote:
>> I cannot read your website on Firefox 45 (no text is displayed). It
>> works on chromium anyway.
>
> I develop it on Firefox. What is your OS?

I'm on Ubuntu 16.04 and the text is missing for me too. Seems to be an issue with the Fira Sans font.
November 10, 2016
On Thursday, 10 November 2016 at 11:20:38 UTC, ag0aep6g wrote:
> On 11/10/2016 12:11 PM, Guillaume Piolat wrote:
>> On Thursday, 10 November 2016 at 06:52:12 UTC, Olivier Pisano wrote:
>>> I cannot read your website on Firefox 45 (no text is displayed). It
>>> works on chromium anyway.
>>
>> I develop it on Firefox. What is your OS?
>
> I'm on Ubuntu 16.04 and the text is missing for me too. Seems to be an issue with the Fira Sans font.

Thanks. Are you behind a proxy? I've had such reports before.
November 10, 2016
Thanks for reading!

On Thursday, 10 November 2016 at 06:08:22 UTC, thedeemon wrote:
> This is the schizophrenic part of D, since allocations inside destructors are not allowed by its own runtime and cause immediate stop of the program.

But this restriction is only there when called by the GC. If you have GC and a deterministic object graph, it can be completely safe to allocate in destructor.
I feel this is a separate problem, "GC calling destructors".

> And exceptions in destructors should not be allowed: there is no sane place to catch and handle exceptions arising during the GC phase (which can be triggered by arbitrary allocation anywhere in the code), so if we can't reason about them and handle them we shouldn't allow them.

Good point.
November 10, 2016
On 11/10/2016 12:21 PM, Guillaume Piolat wrote:
> Thanks. Are you behind a proxy? I've had such reports before.

Nope. No proxy.
« First   ‹ Prev
1 2