Proposal for porting D runtime to WebAssembly

Sebastiaan Koppe mail at skoppe.eu
Mon Nov 25 13:52:29 UTC 2019


On Monday, 25 November 2019 at 13:28:17 UTC, Ola Fosheim Grøstad 
wrote:
> On Monday, 25 November 2019 at 12:52:46 UTC, Sebastiaan Koppe 
> wrote:
>> As an example, it is just a matter of time before a PaaS 
>> provider fully embraces wasm.
>
> This sounds interesting, I've been pondering about serverless 
> FaaS (function as a service), where you basically (hopefully) 
> get functions triggered by NoSQL database updates and not have 
> to bother with your own webserver.

This is already doable with dynamodb, or kinesis streams. Or 
google's dataflow.

Using wasm just makes that more seamless (and faster).

> I see that CloudFlare has support for webassembly in their 
> workers, but for Google Functions I only see Node10, but maybe 
> they can run webassembly as well? I haven't found anything 
> definitive on it though...

Node has good wasm support, I don't know how you would get the 
wasm binary in, but it probably can be done.

>> Instead of having docker containers you just compile to wasm, 
>> which will be pretty small and can boot in (sub) milli-seconds 
>> (plus they don't necessarily need a linux host kernel running 
>> and can run it closer to the hypervisor.)
>
> Yes, but the biggest potential I see is when you don't have to 
> set up servers to process data.

I rather not setup servers for anything.

> Just throw the data into the distributed database, which 
> triggers a Function that updates other parts of the database 
> and then triggers another function that push the resulting PDF 
> (or whatever) to a service that serves the files directly (i.e. 
> cached close to the user like CloudFlare).

You don't have to wait for that. That future is already here. The 
in and output could also be distributed storage, event streams or 
some queue.

The problem, however, is often when using those tools you get 
pushed into a small set of supported programming languages. Like 
AWS' glue that focuses on Scala or Python, or google's functions 
that only support js/python and go. Understandable, but I rather 
choose my own language. Wasm makes that possible.


More information about the Digitalmars-d-announce mailing list