-
Notifications
You must be signed in to change notification settings - Fork 110
-
Do you have any example of its usage using Erlang (and not elixir) that are not imply npm also?
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2
Replies: 10 comments
-
The fib.erl example for the interpreter.
Beta Was this translation helpful? Give feedback.
All reactions
-
Expanding on my last answer.
Following the liblumen_eir_interpreter README, but skipping the decompile step because we're not using Elixir:
For liblumen_eir_interpreter/examples/fib
cd liblumen_eir_interpretercargo run -- --ident fib:run/0 examples/fib/fib.erl
For liblumen_eir_interpreter/examples/simple_server
cd liblumen_eir_interpretercargo run -- --ident foo:run/0 examples/simple_server/*
Are those what you were looking for @benoitc?
Beta Was this translation helpful? Give feedback.
All reactions
-
😕 2
-
yes defintely. this is interesting i will try it and report there.
Beta Was this translation helpful? Give feedback.
All reactions
-
@benoitc The lumen tests (hello_world.rs and cli.rs) use Erlang (hello_world/init.erl and cli/init.erl, respectively) with the compile (lumen). The one restriction with the compiler currently is that the entry point must be init:start/0, so it need to be exported from your own code:
hello_world
cli
https://github.com/lumen/lumen/blob/8cfd9dfeeecca1c29da9fab3a4feafeeae4d9624/lumen/tests/cli/init.erl#L1-L2
https://github.com/lumen/lumen/blob/8cfd9dfeeecca1c29da9fab3a4feafeeae4d9624/lumen/tests/cli/init.erl#L5-L15
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
All the integration tests for liblumen_otp are now written as the Rust checking the stdout of lumen compiled .erl files. All of those can be found under https://github.com/lumen/lumen/tree/develop/native_implemented/otp/tests.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
You can also use the language search to get all the Erlang files in the repo in general. This can be done from the UI by clicking on Erlang in the Language composition on the project home:
- Go to https://github.com/lumen/lumen
- Click Erlang in this widget
Screen Shot 2020年08月12日 at 9 28 37 AM
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
-
Expanding on my last answer.
Following the
liblumen_eir_interpreterREADME, but skipping the decompile step because we're not using Elixir:For
liblumen_eir_interpreter/examples/fib
this link has "404 not found" status..
but thank you for examples in messages under this one!
thank you the much!
really! erlang-in-wasm = the great idea!
thank you for this implementation! 👍 :))
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 1
-
also one more question --
can i try to prog a tiny io game with lumen for wasm right now?
is lumen "just for fun coding"-ready? or not yet?
not for any production -- just for fun only -- coding a bit + play with friend a bit!! ))
Beta Was this translation helpful? Give feedback.
All reactions
-
@221V The lumen compiler we just release cannot target WASM yet (we're trying to nudge the WASM Community Group along to add stack switching to make WASM more like x8_64), so when targeting WASM you can have the runtime and OTP BIFs, but the layer that is your application needs to either be ported to Rust like I did for the spawn-chain WASM demo OR use the browser interpreter, but IDK if the interpreter is in a working state. We had to break it to get x86_64 compiling working. If you're interested in using the interpreter, then @hansihe can help you. If you're interested in porting to Rust for the application layer, I can help you.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
@KronicDeth i do not know Rust yet :)
and only a bit can read C code (not C++)
and i do not know ok FASM - just newbie-beginner, noob)
i know ok (at this moment) --
-
vanilla.js in browser only (no OOP - procedural only),
-
php (like js - no OOP, but i was start from it - 12 years ago, and few last years not working with this),
-
erlang (only one moment not ok yet --
i have problem to read fully-parallel-code -
when minimal FP code, max actors-everywhere) -
haskell (not "hard things" - mainly not that high-math-root things,
"easy way" only now - but my haskell code ok nice works, i am happy)
so FP is omw -- i have planning became true-senior with erlang and haskell now,
and try get the same with Rust and FASM in future :)
and no more langs, no more other --
cause there are many other interesting things in our world ))
not programming and pc/internet gaming-and-programming only))
i think so)
thank you! :)
thanks for true-anwer, cool answer!
there are many cool wasm examples-demos in the internet -
but.. i can not read and use that all))
i do not know OOP js,
i do not know C++ (and want not lose time for this two),
and i do not know the Rust yet ) cause needs more free time (and/or a bit more money in family) for learn it :)
and examples Haskell -> wasm = oh.. "hard things" again (high-math-root things),
- +not fully wasm yet, yes? :)
so i am in search for get cool tool-for-deal-with-wasm in browsers :)
thats why i ask question(s) here (:
i see lumen is the cool great idea!
really cool for me! <3 and need tool like it! ))
thank you a lot! :)
Beta Was this translation helpful? Give feedback.