Could D be used by Jonathan Blow rather jai language?

Bruce Carneal bcarneal at gmail.com
Sat Nov 21 01:52:36 UTC 2020


On Friday, 20 November 2020 at 16:12:35 UTC, Ola Fosheim Grøstad 
wrote:
> On Friday, 20 November 2020 at 15:53:42 UTC, Bruce Carneal 
> wrote:
>> Constraints are key.  The question is when they are applied 
>> and by whom.  Does the language designer choose the 
>> constraints ahead of time or does the programmer opt-in/out of 
>> full capability at need?
>
> The challenge is that opt-in/out is a source of serious bugs. 
> Also very difficult to prove that the overall system is sound 
> if you have many options that you can turn on/off.

The challenge is to provide as much readily accessible power as 
you can safely and correctly.  It is a language design error to 
promise something that you can not check automatically/correctly 
in the compiler.  If a language has such errors it needs an 
upgrade.

I also consider it an language design error to have defaulted to 
unsafe modes.  Things should default to safe/correct with opt-out 
capability to fast/dangerous. (I support @safe as default, for 
example, just not the extern(C) == safe nonsense)

>
> Another problem is that even if you can make it work for single 
> threaded it might break down when you add concurrency, for 
> instance, you can create a parallel high level language that 
> provably cannot deadlock. With low level multi-threading that 
> is basically off the table.

If "it", whatever that is, precludes safe parallelism in 
libraries or language extensions then "it" should be removed from 
the language.

Again, defaults really matter here.  If the right way is the 
default way then leaving the "wrong" way escape hatch costs less, 
in my view, than forcing two or more languages.



More information about the Digitalmars-d mailing list