Wasm – 2d water editor – testing

About Monkey 2 Forums Monkey 2 Projects Wasm – 2d water editor – testing

Tagged: , , ,

This topic contains 10 replies, has 5 voices, and was last updated by  Pakz 1 year, 10 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #8668

    Pakz
    Participant

    I had not used Monkey2 for a while and only noticed that it could compile to wasm today. I tried it and it worked straight away. I am not that familiar with the differences with emscripten and wasm but the newest surely must be the best? From what I have been reading about wasm is that it is smaller and faster.

    I compiled a older project (2d water) and put it on my site. It seems to work allright in my browser.  I could also open it offline.

    https://cromdesi.home.xs4all.nl/wasm/2dwater/Main.html

    (Instructions on the screen)

    #8669

    Hezkore
    Participant

    I have no idea what the difference between emscripten, wasm and HTML5 is…
    But yeah… wasm seems to work really great! I haven’t been able to get it working on any of my iOS products though.

    And It’s funny, I had just done a sand experiment and was about to add water to it when I saw your demo heh.

    #8670

    Pakz
    Participant

    Nice screenshot. Is that procedurally generated sand? Kind of reminds me of the old worms game map generator.

    #8671

    Hezkore
    Participant

    It works like your demo.
    You drop some sand and it falls down and reacts to the other sand, like your water.

    #8672

    Mark Sibly
    Keymaster

    Ok, a quick overview of the differences between all these techs:

    WASM (short for WebAssembly) is proper ‘virtual machine code’ and is compiled to real machine code inside the browser. This should eventually give very near ‘native’ level performance while remaining sandboxed/secure etc. This is IMO pretty *#$&ig exciting tech…

    ASM.JS uses a small subset of javascript as a sort of virtual nachine code. This means browsers that don’t know anything about ASM.JS code can run it anyway, and those that do can optimize it. ASM.JS is in the process of getting replaced by WASM, which is faster, smaller has a cooler name etc.

    Emscripten is an llvm based set of compiler tools that can produce both ASM.JS and WASM code. When it comes to mx2, I generally use ’emscripten’ to mean asm.js, and wasm to mean wasm.

    ‘Html5’ usually just means the DOM Canvas class, which is used by monkey-x for 2d graphics, but not by monkey2 (which uses webgl for graphics).

    #8673

    Hezkore
    Participant

    So really…
    We should mainly just care about WASM, since ASM.JS is being replaced by WASM and HTML5 isn’t used by M2?

    #8674

    Mark Sibly
    Keymaster

    Well, ASM.JS will probably give you a little more compatibility for a while yet, perhaps with Edge and on Macos. But WASM is the future..!

    #8675

    Pakz
    Participant

    I have been googling a bit (while watching e3 shows:) ) on wasm and noticed it has already been put into the test version of webkit(for mac and ios web) So I hope it will work on the ipad in a few months.

    What I find strange is that the java applets and the flash applets failed and this somehow succeeds. I wonder if wasm will get those security issues as well and will be in hard waters.

    I am kind of happy right now that wasm is now possible. I always had the thought that there had to be no reason for the browsers not to be able to run software at full speed. Was just a matter of time.

    #8676

    scurty
    Participant

    I can second Mark. Web Assembly will do what ASM did for Computing in the 50-60s. Give it time. 😉

    #8681

    Jesse
    Participant

    Well Pakz demo works on my 2013 MacBook Air. So OS X is not far off.

    [edit]
    using Safari.

    #8683

    Pakz
    Participant

    I just tested it on my ipad 2017 and it works there also. There was an update not so long ago so maybe support for it was added then?

    The size is the only slightly negative thing compared to monkeyx’s html5. I am looking forward to using wasm now for my website. Not many reasons left for me to continue to use monkeyx. Only it’s flash applets are useful to me now. Having those on google sites an being able to put them in blogger posts is a really neat feature.

    One thing I noticed in the wasm progs is that if I use the F1 key in chrome then it opens a help page. Not to sure if that can be worked around.

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.