firefly
firefly copied to clipboard
An alternative BEAM implementation, designed for WebAssembly
When Lumen raises `badarity` and it is passed through a monitor, it has `Info` as `{badarity, {Fun, Args}}`, but it is supposed to be `{{badarity, {Fun, Args}}, Stacktrace}`. I believe...
## `init.erl` ```erlang -module(init). -export([start/0]). -import(erlang, [display/1]). -import(lumen, [log_exit/1]). start() -> lumen:log_exit(false), {ParentPid, ParentMonitorReference} = spawn_monitor(fun () -> ChildPid = spawn_link(fun () -> wait_to_shutdown(), exit(shutdown) end), ChildMonitorRef = monitor(process, ChildPid),...
## Commands ``` mkdir _lumen_build lumen compile --output-dir _lumen_build --output gen_server --opt-level 0 --include lib/kernel/include lib/stdlib/src/gen_server.erl --emit=all ``` ## Output ``` Compiling lib/stdlib/src/gen_server.erl UNIMPL: MapPut { action: [Put, Put, Put,...
We might need to add some sleeps if everything is waiting and all we're doing is checking for signals in the outer scheduler loop. A simple `receive` with no `after`...
Subbinaries are being stored as HeapBinary in compiled code, so that the bit-count is lost. ## `init.erl` ```erlang -module(init). -export([start/0]). -import(erlang, [binary_part/2, byte_size/1, display/1]). start() -> Binary = , Start...
As seen in #433, [Check Run 830608416](https://github.com/lumen/lumen/pull/433/checks?check_run_id=830608416) ``` failures: ---- erlang::are_equal_after_conversion_2::test::with_local_pid_left::with_different_local_pid_right_returns_false stdout ---- thread 'erlang::are_equal_after_conversion_2::test::with_local_pid_left::with_different_local_pid_right_returns_false' panicked at 'called `Result::unwrap()` on an `Err` value: Number { number: 32768, backtrace: }', native_implemented/otp/src/erlang/are_equal_after_conversion_2/test/with_local_pid_left.rs:61:25...
As seen in https://cirrus-ci.com/task/5041448550662144 and other test runs, `otp::erlang::term_to_binary_1::test::roundtrips_through_binary_to_term` sometimes fails. For this specific failure it was shrunk to ``` thread 'otp::erlang::term_to_binary_1::test::roundtrips_through_binary_to_term' panicked at 'called `Result::unwrap()` on an `Err` value:...
The documentation for `ProcessControlBlock::acquire_heap` is reentrant. This code seems to use the rust std `Mutex`, which is not. https://github.com/lumen/lumen/blob/aeae1721d0fc02982898c8bcd1e7ed0ae5db151c/liblumen_alloc/src/erts/process.rs#L202-L204 This causes issues when (for instance) using `ProcessControlBlock::tuple_from_iter` along with an...
The strategies for heap binaries pre-date the `ProcBin` implementation, so they generate byte sequences that can be > 64 bytes, the cut-off for `ProcBin` and so the "heap binary" tests...
In order to have a way to compile a Mix project via Lumen in the near term, we are going to use a Mix task which compiles the Elixir source...