Spasm 0.1.3 released - with bindings to web apis
WebFreak001
d.forum at webfreak.org
Sat Jan 26 15:34:15 UTC 2019
On Saturday, 26 January 2019 at 10:24:05 UTC, Sebastiaan Koppe
wrote:
> Spasm is a betterC library for web development that uses LDC to
> compile to WebAssembly, and I just released a major update.
>
> It now has bindings to most web api's, like the dom, fetch,
> audio, webgl, etc.
>
> So you can do things like this:
>
> ---
> import spasm.bindings;
> import spasm.dom;
> import spasm.types;
>
> extern (C) export void _start()
> {
> auto elem = document.createElement("div").as!HTMLElement;
> elem.style.backgroundColor = "green";
> elem.innerHTML = "BLA BLA!";
> elem.addEventListener("mouseover",(event){
> console.log("onmouseover");
> console.log(event);
> console.log(event.as!MouseEvent.clientX);
> });
>
> auto root = document.querySelector("body").front;
> root.appendChild(elem);
> }
> ---
>
> And have it Just Work.
>
> See the repo for more info: https://github.com/skoppe/spasm
>
> It is still a WIP but I am getting there.
amazing! I would really like to try it but it seem the
precompiled LDC version doesn't support the wasm output and I
have no idea what that wercker stuff is you mentioned or how to
use the container you sent with compiling on my local filesystem
and not inside a sandbox :/
Still looks great having this, especially now with all these
APIs. I would really like to try making WebGL run with this in
the future
Great work, keep it up!
More information about the Digitalmars-d-announce
mailing list