leostera / caramel

:candy: a functional language for building type-safe, scalable, and maintainable applications
https://caramel.run
Apache License 2.0
1.06k stars 25 forks source link

How does one run the compiled erlang in the README example? #34

Closed drewolson closed 4 years ago

drewolson commented 4 years ago

I've been able to compile the example in the README, but when I attempt to run the generated erlang, I'm told that the function process:make does not exist. It seems this module is provided as part of caramel's stdlib, but it doesn't appear to be in erlang's load path. Is it expected that I somehow make this available before running my program? Should these definitions instead be inlined during compilation?

Am I missing some step that makes this "just work"?

Thanks!

leostera commented 4 years ago

Hi 👋🏼 -- the standard library is distributed as both typings and erlang sources, so you have to compile it and make it available in your path as follows:

# after unzipping the release
$ erlc ./caramel/lib/caramel/stdlib/beam/*.erl
$ erl -pa ./caramel/lib/stdlib/beam
Erlang/OTP 23 [erts-11.0.3] [source] [64-bit] [smp:64:64] [ds:64:64:10] [async-threads:1] [hipe]

Eshell V11.0.3  (abort with ^G)
1> caramel_runtime:binary_concat(<<"hello, ">>, <<"world!">>).
<<"hello, world!">>

Let me know how this goes :) I tried this steps when I documented them in the README (check the end of the Getting Started section) but its possible that I may have broken something too.