FW: Partial WebAssembly backend

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

FW: Partial WebAssembly backend

Marcus G. Daniels


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pip Cet
Sent: Saturday, March 04, 2017 9:30 AM
To: [hidden email]
Subject: Partial WebAssembly backend

I'd like to announce a WebAssembly backend for the GNU toolchain (binutils, gcc, glibc) that I've been working on for a while.

WebAssembly (https://www.w3.org/community/webassembly/) is an object file format for a virtual machine implementing conventional 32-bit integer/64-bit floating-point arithmetic. Version 1 has been released on February 28 (https://lists.w3.org/Archives/Public/public-webassembly/2017Feb/0002.html),
and enabled in various browsers, including Mozilla.

This binutils port produces and deals with ELF files containing WebAssembly code; WebAssembly modules (in the WebAssembly object file
format) can be output using special linker scripts and -Obinary, but they cannot be used as input for any of the binutils programs at present.

(While the gcc port, in particular, makes some decisions that negatively affect performance, the binutils port is quite general and should permit the assembly, linking, and manipulation of all WebAssembly code, provided it is still encapsulated in ELF files).

The code is at https://github.com/pipcet/binutils-gdb, included from the larger project at https://github.com/pipcet/asmjs. Some documentation is available at https://github.com/pipcet/asmjs/blob/everything/wasm32.org (specific to the wasm32 target) and https://github.com/pipcet/asmjs/blob/everything/asmjs.org (for all three targets: asmjs, wasm32, and wasm64). The GitHub sources include support for using asm.js instead of wasm, and some rudimentary support for simulating a 64-bit machine using wasm.

I'd appreciate any questions, comments or advice, and in particular I'd like to ask whether it is possible in theory to include this backend in the standard GNU binutils distribution; some work would be required on my end to do that, and I'm not sure it's worth the effort if there is no chance of inclusion at the end of the process.

If anyone else has been or is planning to work on a WebAssembly backend, it would be great to hear from them, and maybe some of my code could be reused for that.

Pip Cet
============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
Reply | Threaded
Open this post in threaded view
|

Re: FW: Partial WebAssembly backend

Owen Densmore
Administrator
Yup, WebAsm is now enabled in modern browsers, thanks to a stable API for several releases. It's amazing how quickly this was defined and got implemented! (Unlike es6 modules, es2015, going on 2 years late!).

An interesting intro:
Four browsers commit to current API (also above)
.. and it looks like latest dev releases have it turned on by default, rather than via flags.

It's not gonna kill JavaScript but it may provide entry for other languages, as long as they can be compiled to LLVM (Low Level Virtual Machine). The issue is getting the standard libraries converted. C/C++ are go, as I understand it. I think Fortran too!

   -- Owen

On Sat, Mar 4, 2017 at 9:40 AM, Marcus Daniels <[hidden email]> wrote:


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pip Cet
Sent: Saturday, March 04, 2017 9:30 AM
To: [hidden email]
Subject: Partial WebAssembly backend

I'd like to announce a WebAssembly backend for the GNU toolchain (binutils, gcc, glibc) that I've been working on for a while.

WebAssembly (https://www.w3.org/community/webassembly/) is an object file format for a virtual machine implementing conventional 32-bit integer/64-bit floating-point arithmetic. Version 1 has been released on February 28 (https://lists.w3.org/Archives/Public/public-webassembly/2017Feb/0002.html),
and enabled in various browsers, including Mozilla.

This binutils port produces and deals with ELF files containing WebAssembly code; WebAssembly modules (in the WebAssembly object file
format) can be output using special linker scripts and -Obinary, but they cannot be used as input for any of the binutils programs at present.

(While the gcc port, in particular, makes some decisions that negatively affect performance, the binutils port is quite general and should permit the assembly, linking, and manipulation of all WebAssembly code, provided it is still encapsulated in ELF files).

The code is at https://github.com/pipcet/binutils-gdb, included from the larger project at https://github.com/pipcet/asmjs. Some documentation is available at https://github.com/pipcet/asmjs/blob/everything/wasm32.org (specific to the wasm32 target) and https://github.com/pipcet/asmjs/blob/everything/asmjs.org (for all three targets: asmjs, wasm32, and wasm64). The GitHub sources include support for using asm.js instead of wasm, and some rudimentary support for simulating a 64-bit machine using wasm.

I'd appreciate any questions, comments or advice, and in particular I'd like to ask whether it is possible in theory to include this backend in the standard GNU binutils distribution; some work would be required on my end to do that, and I'm not sure it's worth the effort if there is no chance of inclusion at the end of the process.

If anyone else has been or is planning to work on a WebAssembly backend, it would be great to hear from them, and maybe some of my code could be reused for that.

Pip Cet
============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove


============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
Reply | Threaded
Open this post in threaded view
|

Re: FW: Partial WebAssembly backend

Marcus G. Daniels

The issue is getting the standard libraries converted. C/C++ are go, as I understand it. I think Fortran too!

 

PGI is supposedly targeting their Fortran compiler to LLVM but it still seems to be slideware.   The github address in their slides is from back in November and either it was never there or they removed it.  

 

However, it appears the GCC suite support is standalone, so I think any GCC supported language would work.  There is also a glibc tree.  

 

Firefox performance compared to native.

 

https://2r4s9p1yi1fa2jd7j43zph8r-wpengine.netdna-ssl.com/files/2016/11/asmjs-wasm-comparison-updated.png


============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
Reply | Threaded
Open this post in threaded view
|

Re: FW: Partial WebAssembly backend

Gillian Densmore
In reply to this post by Owen Densmore
lol and I'm wating for a pythonscript with processing..because python (for me) is really fun to learn.



On Sat, Mar 4, 2017 at 10:56 AM, Owen Densmore <[hidden email]> wrote:
Yup, WebAsm is now enabled in modern browsers, thanks to a stable API for several releases. It's amazing how quickly this was defined and got implemented! (Unlike es6 modules, es2015, going on 2 years late!).

An interesting intro:
Four browsers commit to current API (also above)
.. and it looks like latest dev releases have it turned on by default, rather than via flags.

It's not gonna kill JavaScript but it may provide entry for other languages, as long as they can be compiled to LLVM (Low Level Virtual Machine). The issue is getting the standard libraries converted. C/C++ are go, as I understand it. I think Fortran too!

   -- Owen

On Sat, Mar 4, 2017 at 9:40 AM, Marcus Daniels <[hidden email]> wrote:


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pip Cet
Sent: Saturday, March 04, 2017 9:30 AM
To: [hidden email]
Subject: Partial WebAssembly backend

I'd like to announce a WebAssembly backend for the GNU toolchain (binutils, gcc, glibc) that I've been working on for a while.

WebAssembly (https://www.w3.org/community/webassembly/) is an object file format for a virtual machine implementing conventional 32-bit integer/64-bit floating-point arithmetic. Version 1 has been released on February 28 (https://lists.w3.org/Archives/Public/public-webassembly/2017Feb/0002.html),
and enabled in various browsers, including Mozilla.

This binutils port produces and deals with ELF files containing WebAssembly code; WebAssembly modules (in the WebAssembly object file
format) can be output using special linker scripts and -Obinary, but they cannot be used as input for any of the binutils programs at present.

(While the gcc port, in particular, makes some decisions that negatively affect performance, the binutils port is quite general and should permit the assembly, linking, and manipulation of all WebAssembly code, provided it is still encapsulated in ELF files).

The code is at https://github.com/pipcet/binutils-gdb, included from the larger project at https://github.com/pipcet/asmjs. Some documentation is available at https://github.com/pipcet/asmjs/blob/everything/wasm32.org (specific to the wasm32 target) and https://github.com/pipcet/asmjs/blob/everything/asmjs.org (for all three targets: asmjs, wasm32, and wasm64). The GitHub sources include support for using asm.js instead of wasm, and some rudimentary support for simulating a 64-bit machine using wasm.

I'd appreciate any questions, comments or advice, and in particular I'd like to ask whether it is possible in theory to include this backend in the standard GNU binutils distribution; some work would be required on my end to do that, and I'm not sure it's worth the effort if there is no chance of inclusion at the end of the process.

If anyone else has been or is planning to work on a WebAssembly backend, it would be great to hear from them, and maybe some of my code could be reused for that.

Pip Cet
============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove


============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove


============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove
Reply | Threaded
Open this post in threaded view
|

Re: FW: Partial WebAssembly backend

Marcus G. Daniels
In reply to this post by Owen Densmore

Mozilla releases support today..

 

https://www.mozilla.org/en-US/firefox/52.0/releasenotes/

 

“Added support for WebAssembly, an emerging standard that brings near-native performance to Web-based games, apps, and software libraries without the use of plugins.”

 

From: Friam [mailto:[hidden email]] On Behalf Of Owen Densmore
Sent: Saturday, March 04, 2017 10:56 AM
To: The Friday Morning Applied Complexity Coffee Group <[hidden email]>
Subject: Re: [FRIAM] FW: Partial WebAssembly backend

 

Yup, WebAsm is now enabled in modern browsers, thanks to a stable API for several releases. It's amazing how quickly this was defined and got implemented! (Unlike es6 modules, es2015, going on 2 years late!).

 

An interesting intro:

Four browsers commit to current API (also above)

.. and it looks like latest dev releases have it turned on by default, rather than via flags.

 

It's not gonna kill JavaScript but it may provide entry for other languages, as long as they can be compiled to LLVM (Low Level Virtual Machine). The issue is getting the standard libraries converted. C/C++ are go, as I understand it. I think Fortran too!

 

   -- Owen

 

On Sat, Mar 4, 2017 at 9:40 AM, Marcus Daniels <[hidden email]> wrote:



-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Pip Cet
Sent: Saturday, March 04, 2017 9:30 AM
To: [hidden email]
Subject: Partial WebAssembly backend

I'd like to announce a WebAssembly backend for the GNU toolchain (binutils, gcc, glibc) that I've been working on for a while.

WebAssembly (https://www.w3.org/community/webassembly/) is an object file format for a virtual machine implementing conventional 32-bit integer/64-bit floating-point arithmetic. Version 1 has been released on February 28 (https://lists.w3.org/Archives/Public/public-webassembly/2017Feb/0002.html),
and enabled in various browsers, including Mozilla.

This binutils port produces and deals with ELF files containing WebAssembly code; WebAssembly modules (in the WebAssembly object file
format) can be output using special linker scripts and -Obinary, but they cannot be used as input for any of the binutils programs at present.

(While the gcc port, in particular, makes some decisions that negatively affect performance, the binutils port is quite general and should permit the assembly, linking, and manipulation of all WebAssembly code, provided it is still encapsulated in ELF files).

The code is at https://github.com/pipcet/binutils-gdb, included from the larger project at https://github.com/pipcet/asmjs. Some documentation is available at https://github.com/pipcet/asmjs/blob/everything/wasm32.org (specific to the wasm32 target) and https://github.com/pipcet/asmjs/blob/everything/asmjs.org (for all three targets: asmjs, wasm32, and wasm64). The GitHub sources include support for using asm.js instead of wasm, and some rudimentary support for simulating a 64-bit machine using wasm.

I'd appreciate any questions, comments or advice, and in particular I'd like to ask whether it is possible in theory to include this backend in the standard GNU binutils distribution; some work would be required on my end to do that, and I'm not sure it's worth the effort if there is no chance of inclusion at the end of the process.

If anyone else has been or is planning to work on a WebAssembly backend, it would be great to hear from them, and maybe some of my code could be reused for that.

Pip Cet
============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove

 


============================================================
FRIAM Applied Complexity Group listserv
Meets Fridays 9a-11:30 at cafe at St. John's College
to unsubscribe http://redfish.com/mailman/listinfo/friam_redfish.com
FRIAM-COMIC http://friam-comic.blogspot.com/ by Dr. Strangelove