Rewrite module loading in order to be smaller
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c, erlang
- Domain
- compilers, embedded-iot
Research direction
Start with the module loading and parsing implementation in opcodesswitch.h, where IMPL_CODE_LOADER enables the current code. Investigate how the mega-switch handles opcode definitions and BIF calls, then assess whether a table-driven parsing loop can reduce flash usage and detect missing BIFs. Done means a smaller loader that checks consistency and avoids crashes from missing BIFs.
Written by the indexing model from the issue text.
Description
Module code loading / parsing is implemented in opcodesswitch.h when IMPL_CODE_LOADER is defined, that relies on the mega-switch and a lot on inlined code.
As a consequence the compile code takes a lot of space.
The whole functionality can be replaced with a smaller parsing loop that relies on some kind of opcode definition table, saving quite a lot of space on flash memory.
Last but not least, a good smarter implementation, should verify consistency and avoid some issues, such as calling missing BIFs (it causes a crash).
- Dominant language
- Erlang
- Stars
- 2.3k
- Forks
- 171
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from atomvm/AtomVM
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
lwIP sockets: a failed listen or connect leaves the socket lock held, a later close hangs foreverOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 3 days
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 3 days
-
from-agent
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug high-priority
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dividebysandwich/rust-dos#1032 ·
Maintainers usually reply within 1 day