agoric-labs / jessica

Jessica - Jessie (secure distributed Javascript) Compiler Architecture
Apache License 2.0
36 stars 9 forks source link

compile Jessie to AssemblyScript? #38

Open dckc opened 3 years ago

dckc commented 3 years ago

When I first looked at AssemblyScript, it seemed kinda silly - you might as well write C if all you get is integer types and such.

But this week I found a bignum class as part of a smart contract library (somewhere near mirror protocol or terra money but I can't seem to find it today; no matter...). It got me thinking...

We have a prototype compiler from Jessie to C; surely compiling to AssemblyScript would be even easier.

erights commented 3 years ago

If I remember AssemblyScript correctly, this is plausible if we say the source language is not quite exactly Jessie. It might still be a valuable thing to do. It would probably be close enough to Jessie to run most Jessie programs. Thanks!

dckc commented 3 years ago

I'm talking about compiling all of Jessie to AssemblyScript, and hence to WASM.

Other possibilities might make sense too, of course.

erights commented 3 years ago

I'm talking about compiling all of Jessie to AssemblyScript,

Including all of JavaScript's coercion rules around +?

dckc commented 3 years ago

ew. well, yes, I suppose the idea does entail dealing with those coercion rules.

erights commented 3 years ago

If the answers to such questions is similarly yes, then compiling actual Jessie to AssemblyScript would be very cool.