Experiments with emscripten and D

Gambler fake at feather.org.ru
Sat Aug 17 07:42:19 PDT 2013


On 8/15/2013 5:55 PM, Piotr Szturmaj wrote:
> bearophile:
>> Piotr Szturmaj:
>> I have found some related activity from Rust people:
>> https://github.com/mozilla/rust/issues/2235
>> https://github.com/Yoric/Mozilla-Student-Projects/issues/33
>> https://mail.mozilla.org/pipermail/rust-dev/2012-April/001607.html
>>
>> Once your work is more more completed, the dlang site could show (in a
>> sub-page) the compiler that compiles the online examples of the docs
>> that's able to produce html+JS on the fly from the D code written in the
>> browser.
> 
> Yes, and it could be used to write rich web applications (which is the
> reason I'm working on it). JavaScript certainly wasn't created for big
> codebases...

Never understood the excitement about things like these. Yes, it's
somewhat interesting and technically impressive, but in the end, the
only language that benefits here *is* JavaScript. And it's already
spreading like cancer. Why help it if you don't like it?

If even 1/10th of the effort spent on compile-everything-to-JS projects
was directed towards properly bringing other languages into the browser
land, the web would be a much better place now.

> The other big advantage would having one codebase shared between server,
> browser (including mobile) and desktop apps.

Yes, in theory. In practice, this is just something Node.JS people came
up with for advocacy of their platform. It's false. In-browser
JavaScript has so many constraints imposed on it that it will never
behave exactly like server-side code. (For example, your gist doesn't
work in IE. Not that I use IE normally, but you get my point.)

Worse, no one took time to actually design a sensible model of
interaction between server and the client for a "shared" codebase. It's
all a jumbled mess of ad-hoc implementations and subverted web
technologies that were originally meant for an entirely different
purpose. I sometimes see JS examples like this:

if (imOnTheServer){
    //do one thing
} eles {
    //do another thing
} //Yay, "shared" code!!!

Every time I do, I get the urge to abandon programming and change my
occupation.


More information about the Digitalmars-d mailing list