August 04, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Parker | On Thursday, 4 August 2016 at 09:57:57 UTC, Mike Parker wrote: > On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: > >> >> And a blogpost explaining the technique is available here: >> http://code.alaiwan.org/wp/?p=103 >> (Spoiler: at some point, it involves lowering the source code back to C) > > Reddit: https://www.reddit.com/r/programming/comments/4w3svq/running_a_d_game_in_the_browser/ HN: https://news.ycombinator.com/item?id=12225036 |
August 04, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastien Alaiwan | Very cool! Is it's possible now to write not graphical Apps for web in D? I do not need graphics, but I need normal language instead of js that can help me to do some computation. For example is it's possible to write in D app that would validate some fileds in HTML and simply show (even on console) information about data in them. |
August 04, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastien Alaiwan | On Wednesday, 3 August 2016 at 20:26:23 UTC, Sebastien Alaiwan wrote: > Hi, > > I finally managed to compile some D code to asm.js, using Emscripten. [...] > You can play a minimalistic demo: > http://code.alaiwan.org/dscripten/full.html [...] > Please let me know what you think! Fascinating! |
August 04, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kai Nacke | On Wednesday, 3 August 2016 at 20:40:47 UTC, Kai Nacke wrote:
> That's awesome!
>
> Do you still know the modifications you made to compile LDC with emscripten-fastcomp? I would be interested to have a look into the "PNaCl legalization passes" problem.
That would be great, and might simplify the toolchain a lot.
First we must get the build to pass again ; I'm working on it at the moment, I have a patch to making the build work (only for the binary "ldc2", not other tools of the package). I can send it to you if you want.
|
August 05, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastien Alaiwan | On Thursday, 4 August 2016 at 19:17:34 UTC, Sebastien Alaiwan wrote: > at the moment, I have a patch to making the build work (only for the binary "ldc2", not other tools of the package). I created a dedicated github branch "fastcomp-ldc". The patch: https://github.com/Ace17/dscripten/blob/fastcomp-ldc/ldc2.patch |
August 05, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sebastien Alaiwan | On Friday, 5 August 2016 at 05:39:57 UTC, Sebastien Alaiwan wrote: > On Thursday, 4 August 2016 at 19:17:34 UTC, Sebastien Alaiwan wrote: >> at the moment, I have a patch to making the build work (only for the binary "ldc2", not other tools of the package). > I created a dedicated github branch "fastcomp-ldc". > The patch: https://github.com/Ace17/dscripten/blob/fastcomp-ldc/ldc2.patch That patch doesn't look too bad. Could you introduce a CMake option for building with Emscripten-fastcomp? And a #define "LDC_LLVM_EMSCRIPTEN" or something like that, so that you can change `#if LDC_LLVM_VER >= 309 && 0` to `#if LDC_LLVM_VER >= 309 && !LDC_LLVM_EMSCRIPTEN`. Should be mergable into LDC master then! cheers, Johan |
August 08, 2016 Re: Running a D game in the browser | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johan Engelen | On Friday, 5 August 2016 at 13:18:38 UTC, Johan Engelen wrote:
> That patch doesn't look too bad.
> Could you introduce a CMake option for building with Emscripten-fastcomp?
> And a #define "LDC_LLVM_EMSCRIPTEN" or something like that, so that you can change `#if LDC_LLVM_VER >= 309 && 0` to `#if LDC_LLVM_VER >= 309 && !LDC_LLVM_EMSCRIPTEN`.
>
> Should be mergable into LDC master then!
I could definitely formalize things a bit, but any patch of this kind would quickly be obsolete, as Emscripten catches up with LLVM versions.
Moreover, I don't feel comfortable polluting LDC with the specificities of some obscure use case (as cool as this use case can be!).
It might be preferable - though harder - to patch Emscripten so it aligns on LLVM official API versions.
|
Copyright © 1999-2021 by the D Language Foundation