[m-dev.] How to add another grade (target language)

Charles Shuller charles.shuller at gmail.com
Tue Jun 16 00:41:06 AEST 2015


> (Both papers are available for download via tha papers page.)
>

Awesome!   The links on the Developer Documentation page did not work, but
I was able to download at least the first paper.


>
> For generating Javascript an alternative to adding a new backend may be
> to use Emscripten to compile the C code generated by the Mercury
> compiler.
>
>
I'm already setting up to do the Emscripten thing with mercury's output C.
It doesn't quite consume raw C, but  is a fun project and I intend to look
at how they are interacting with asmjs.   However, my immediate goal is to
get the Mercury language into Code Combat ( https://codecombat.com/ ) which
requires outputting a JavaScript/JSON/AST sort of thing (
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API
).   And instead of writing a mercury compiler in JavaScript (which is what
they do for Python and Clojure) I figured it would be easier to write a
JavaScript backend for the existing Mercury Compiler.   I figure I can
output the AST along side the JavaScript.

Also, I get enough of a "Glue these two projects together with a build
script" at work and want something a bit more challenging at home.


Thanks!

Charles
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/developers/attachments/20150615/b3ecc86c/attachment.html>


More information about the developers mailing list