August 19, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | "H. S. Teoh" <hsteoh@quickfur.ath.cx> wrote in message news:mailman.186.1376878962.1719.digitalmars-d@puremagic.com... > On Sun, Aug 18, 2013 at 06:52:14AM +0200, deadalnix wrote: [...] >> I feel pretty confident I can do a wat speech for D. > [...] > > Please do, I'm curious to hear it. :) > import std.algorithm : filter, map; void main() { foreach(c; map!"a"("hello")) // Identity map function static assert(c.sizeof == 4); // Passes foreach(c; filter!"true"("hello")) // Pass-all filter static assert(c.sizeof == 4); // Passes foreach(c; "hello") static assert(c.sizeof == 4); // Fails } WAT. |
August 20, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Piotr Szturmaj | On Thursday, 15 August 2013 at 20:21:46 UTC, Piotr Szturmaj wrote:
> This is SDL and std.algorithm code translated to JavaScript with emscripten. I've used the latest git versions of LDC and emscripten (the latter needed some modifications).
>
> https://gist.github.com/pszturmaj/6244260
> https://gist.github.com/pszturmaj/6244266
>
> I couldn't manage to post it as single gist, and it seems there's a bug in the sdl.html gist (it looks empty). Just click Download Gist or '< >' icon (view raw) and save it as sdl.html.
>
> Then open sdl.html in the web browser. It should print sorted and mapped array contents and run simple graphics demo.
>
> I'm starting to work on this to fix the rest of the druntime so it can work under JS VM. Any help with this will be appreciated :-)
This is very interesting subject.
I bet lots of people will want to help.
Give a shout when you setup repository etc ;)
|
August 20, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to nazriel | I agree with those who are against it. For a variety of reasons, one of them being that, yes, anything that produces javasc*t does a) recognize js and b) embold and support it. Web pages are/should be about *content* not about eye candy and gadgets. Furthermore, increasingly many (like myself) have js filters, often in "brutal" mode (cutting out *all* js and enabling it expressly if needed/wished). The real solution isn't to add one more way to the existing 3 gazillion ways for js but to create a real alternative. Seen from D's perspective a D interpreter would be a start. Although, frankly, most web hackers won't like it; it's too unfriendly and hard, they want some kind of web basic (which js happens to be). And why and what for? HTML5 is rich enough. If I want to put serious computing work on the client I'd rather put it in a web server (written in D). And if I just want to put fancy blabla into a browser I can chose from 2,5 gazillion toys. |
August 20, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ramon | Ha! Expanding on myself: Have simple web server written in D on the client and then a "D-script" interpreter in that server. Possibly some minimalist "friendly" interpreter thingy like Lua too (or optionally). Only problem I see: Does D compile to/for Arm w/ Android and iphone "OS"? Might be important as increasingly many users browse from their gadgets (rather than from their PCs) |
August 21, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ramon | W dniu 21.08.2013 01:43, Ramon pisze: > I agree with those who are against it. > > For a variety of reasons, one of them being that, yes, anything that > produces javasc*t does a) recognize js and b) embold and support it. > > Web pages are/should be about *content* not about eye candy and gadgets. > Furthermore, increasingly many (like myself) have js filters, often in > "brutal" mode (cutting out *all* js and enabling it expressly if > needed/wished). It's not about simple web pages with fancy gadgets. It's about RIAs. > The real solution isn't to add one more way to the existing 3 gazillion > ways for js but to create a real alternative. This is unreal. Consider a business case: your employer wants some dynamic behavior on a web page (and it must work on IE6). > Seen from D's perspective a D interpreter would be a start. Although, > frankly, most web hackers won't like it; it's too unfriendly and hard, > they want some kind of web basic (which js happens to be). They will still use JS. I don't want to replace JS, because I want to support existing browsers. > And why and what for? HTML5 is rich enough. If I want to put serious > computing work on the client I'd rather put it in a web server (written > in D). And if I just want to put fancy blabla into a browser I can chose > from 2,5 gazillion toys. What about Facebook? But I rather have RIAs in mind. For example: http://www.smartclient.com/#showcaseApp . Among the others are ExtJS, GWT, qooxdoo, etc. In this case code doesn't need to be very fast. It just need to be reliable and _maintainable_. All I currently want is using those RIA libraries from D code. This should give me huge productivity boost when writing _complex_ web applications. Another case is WebGL and online games. I'd rather go to hell than write and maintain 100k lines of code in JS. Even if you do not see a reason for it, there _is_ a demand for it. And money behind it. |
August 21, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ramon | W dniu 21.08.2013 01:49, Ramon pisze: > Ha! Expanding on myself: > > Have simple web server written in D on the client and then a "D-script" > interpreter in that server. Possibly some minimalist "friendly" > interpreter thingy like Lua too (or optionally). > > Only problem I see: Does D compile to/for Arm w/ Android and iphone "OS"? Don't worry. My solution just needs HTML + JS so it will work _everywhere_. > Might be important as increasingly many users browse from their gadgets > (rather than from their PCs) |
August 21, 2013 Re: Experiments with emscripten and D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Piotr Szturmaj | On Wednesday, 21 August 2013 at 00:41:58 UTC, Piotr Szturmaj wrote:
> W dniu 21.08.2013 01:49, Ramon pisze:
>> Ha! Expanding on myself:
>>
>> Have simple web server written in D on the client and then a "D-script"
>> interpreter in that server. Possibly some minimalist "friendly"
>> interpreter thingy like Lua too (or optionally).
>>
>> Only problem I see: Does D compile to/for Arm w/ Android and iphone "OS"?
>
> Don't worry. My solution just needs HTML + JS so it will work _everywhere_.
>
>> Might be important as increasingly many users browse from their gadgets
>> (rather than from their PCs)
I still disagree. But I understand your point of view and wish you the best of luck. May the keyboard be with you ;)
|
Copyright © 1999-2021 by the D Language Foundation