Why can't we derive struct's? (Hansel & Gretel)

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 21 23:42:49 UTC 2018


On Fri, Dec 21, 2018 at 10:53:28PM +0000, Mike Franklin via Digitalmars-d wrote:
> On Friday, 21 December 2018 at 21:42:35 UTC, Walter Bright wrote:
> > D isn't any more suitable for in-browser code than C++ is. A native
> > language with raw pointers would not be a good choice for an
> > embeddable scripting language.
> > 
> > Javascript has been incredibly successful as an embedded language in
> > web pages.
> 
> Now that web assembly has arrived, C++ is a perfectly suitable
> language for the browser.  I'm predicting Javascript will become a
> legacy language for the web in 5 years.

Although I agree with the sentiment that, in the long term, Javascript
is a dead-end, I really doubt that it would become obsolete in 5 years.
I'm expecting it will be more like 15-20 years, give or take.


> I recently wrote 2 applications in C# web assembly (using Blazor) and
> they probably took me 20% of the time had I needed to write a backend
> in C# and a frontend in Javascript.  It was an awesome, eye-opening
> experience, and I'm never going back.

That's awesome, and in retrospect, not at all surprising, given the --
shall we call it, idiosyncrasies? -- of Javascript. While modern
Javascript has come a long way since the early days of "on click,
display an annoying flashing marquee", it has never been able to
overcome the fundamental design limitations it inherited from those
days. Writing non-trivial code in Javascript is an exercise in
masochism, and I've had to *maintain* such code in the past. A
nightmarish experience I would not wish on anyone.


> There may still be a need for Javascript for a few things, but not
> many.  Javascript's days are numbered.  IMO, C#, C++, Rust, and other
> general purpose languages that can compile to web assembly is where
> it's at for the future of the web.  And, I don't see why D can't be a
> major player there, as I know it already has been demonstrated to be:
> https://forum.dlang.org/post/zwmszfalyeprtyyhxfeq@forum.dlang.org
[...]

While I still have qualms about the idea of running arbitrary code in a
browser (no matter how encapsulated the sandbox is claimed to be), I
*would* quite look forward to the day when I don't have to touch
Javascript in order to deploy code on the web. Especially if said
deployment can be done in D!


T

-- 
Never ascribe to malice that which is adequately explained by incompetence. -- Napoleon Bonaparte


More information about the Digitalmars-d mailing list