amuletml / amulet

An ML-like functional programming language
https://amulet.works/
BSD 3-Clause "New" or "Revised" License
326 stars 15 forks source link

Documentation: Compilation #287

Closed ShalokShalom closed 4 years ago

ShalokShalom commented 4 years ago

The Readme, homepage or anything else doesn't tell me, where Amulet compiles into. This page says Lua, is this true and if, is this the only goal? Thanks

https://andregarzia.com/2020/06/languages-that-compile-to-lua.html

SquidDev commented 4 years ago

I think the fact that Amulet compiles to Lua is more that it's convenient (small language, tail recursion, LuaJIT, I like Lua) rather than an explicit goal. I want Amulet to generate largely readable Lua code, but also it's not the most ... interesting part of the project as it were.

The more fundamental issue with Amulet, (or Haxe, or any other typed language which compiles to Lua) is that interop ends up being incredibly painful. You have to write bindings for any external library you want to use, and the different calling conventions of Lua and Amulet (curried vs uncurried functions) means that some stuff isn't expressible.

I'd love to improve all of this, but have never found a nice approach. Right now I'd describe Amulet as "a language which happens to compile to Lua" rather than one which is designed to play nice with it.


Also worth noting that we did have a Scheme backend at one point, it's just the performance was abysmal. Something I'd quite like to bring back at one point though.

ShalokShalom commented 4 years ago

My point is, that the documentation is silent about the compilation target.