Running patsopt in the browser

43 views
Skip to first unread message

gmhwxi

unread,
Oct 24, 2015, 4:04:09 PM10/24/15
to ats-lang-users

Here is a small experiment I did:

https://ats-lang.github.io/EXPERIMENT/test_libatsopt/test_libatsopt.html

So finally it is a reality that one can compile ATS source code in the browser.
Note that compilation is done entirely on the client's side, and there is no
involvement of the server (except for delivering files needed for compilation).

What can we do with the C code generated from ATS source?

1) Download it locally and then use a C compiler to compile it
2) I will soon make Atscc2js available for running entirely in the browser. In
    this way, the generated C code can be compiled to JS code in the browser
    and then evaluated.

I guess what really stands out here is that libatsopt(JS) makes it possible for
everyone (not just ATS developers) to build what I did here. See the source at:

https://github.com/githwxi/ATS-Postiats/tree/master/utils/libatsopt/JS/TEST

gmhwxi

unread,
Oct 24, 2015, 10:11:57 PM10/24/15
to ats-lang-users
More on how to use the C code generated from
running patsopt inside the browser:

It just occurred to me that one could readily send the
C code to a web server running locally and then have it
compiled there by gcc, clang, tcc, or even avr-gcc.

Cheers!
Message has been deleted

gmhwxi

unread,
Oct 27, 2015, 2:23:21 PM10/27/15
to ats-lang-users

Here is a webworker-based version of patsopt(JS):

https://ats-lang.github.io/EXPERIMENT/test_libatsopt/wktest_libatsopt.html

It works inside Firefox but not Chromium (due to Chromium using a smaller
call stack for each webworker).



On Saturday, October 24, 2015 at 4:04:09 PM UTC-4, gmhwxi wrote:
Reply all
Reply to author
Forward
0 new messages