Asm.js or Javascript source output

19 views
Skip to first unread message

Joe Siebenmann

unread,
Mar 26, 2023, 7:31:15 PM3/26/23
to emscripten-discuss
I'd just like to know if it's possible to get actual Asm.js or Javascript source code output somewhere from building .c code with emcc and or clang.  I'm not interested in any binaries or WebAssembly output at this time.  I've looked at the output files after a build and see nothing that resembles what the Asm.js or Javascript source might look like.  I have the emsdk working on Windows, and emcc is working.  If it is possible, what commands should I use to get some source output somewhere?  Thanks!

Shlomi Fish

unread,
Mar 27, 2023, 12:13:19 AM3/27/23
to Joe Siebenmann, emscripte...@googlegroups.com
hi Joe,
-s WASM=0 -s LEGACY_VM_SUPPORT=1

also see:
https://github.com/shlomif/fc-solve/blob/master/fc-solve/scripts/Makefile.to-javascript.mak

note that I recall reading it was no longer pure asm.js

--

Shlomi Fish https://www.shlomifish.org/
My Photos - https://www.flickr.com/photos/shlomif/

Beware from accumulating too much wisdom. It is not wise to be too wise.
https://is.gd/a9QW7q

Please reply to list if it's a mailing list post - https://shlom.in/reply .

Sam Clegg

unread,
Mar 27, 2023, 1:10:34 PM3/27/23
to emscripte...@googlegroups.com
Yes, that is correct.  `-sWASM=0` is the setting that disables WebAssembly output and gives you pure JavaScript. 

As Shlomi says, its no longer pure asm.js, just normal JavaScript.  However, that shouldn't matter because legacy browsers/runtimes that don't support wasm most likely don't support the pure form of asm.js anyway.  

cheers,
sam

--
You received this message because you are subscribed to the Google Groups "emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emscripten-disc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emscripten-discuss/20230327071311.34e25b32%40shlomifish.org.

Shlomi Fish

unread,
Mar 28, 2023, 12:28:52 AM3/28/23
to 'Sam Clegg' via emscripten-discuss
On Mon, 27 Mar 2023 10:10:20 -0700
"'Sam Clegg' via emscripten-discuss" <emscripte...@googlegroups.com>
wrote:

> Yes, that is correct. `-sWASM=0` is the setting that disables WebAssembly
> output and gives you pure JavaScript.
>
> As Shlomi says, its no longer pure asm.js, just normal JavaScript.
> However, that shouldn't matter because legacy browsers/runtimes that don't
> support wasm most likely don't support the pure form of asm.js anyway.
>
> cheers,
> sam

Thanks for the confirmation, Sam.

>
> On Sun, Mar 26, 2023 at 9:13 PM Shlomi Fish <shl...@shlomifish.org> wrote:
>
> > hi Joe,
> >
> > On Sun, 26 Mar 2023 09:56:17 -0700 (PDT)
> > Joe Siebenmann <joes...@gmail.com> wrote:
> >
> > > I'd just like to know if it's possible to get actual Asm.js or
> > Javascript
> > > source code output somewhere from building .c code with emcc and or
> > clang.
> > > I'm not interested in any binaries or WebAssembly output at this time.
> > > I've looked at the output files after a build and see nothing that
> > > resembles what the Asm.js or Javascript source might look like. I have
> > the
> > > emsdk working on Windows, and emcc is working. If it is possible, what
> > > commands should I use to get some source output somewhere? Thanks!
> > >
> >
> > -s WASM=0 -s LEGACY_VM_SUPPORT=1
> >
> > also see:
> >



https://www.shlomifish.org/humour/bits/New-versions-of-the-GPL/

Faith: Becky… you have a lot of potential. You’re more than a pretty face.
Becky: Heh, I knew that I have potential, but do you really think I have
a pretty face?
https://www.shlomifish.org/humour/Buffy/A-Few-Good-Slayers/
Reply all
Reply to author
Forward
0 new messages