Replies: 3 comments 1 reply
-
|
I completely agree on the idea of reorganizing libraries, it is something very welcome.
|
Beta Was this translation helpful? Give feedback.
-
|
As far as STM32 goes the libs are not on the device, so when they are packed into the application any unused modules are pruned, (unless prune is set to false) so these modules will never end up on the device. The only downside I see is for ESP32 is that we would want to implement some of the esp32boot functionality into main.c, like checking the app partition in NVS (to allow OTA app updates). |
Beta Was this translation helpful? Give feedback.
-
|
Let me push this idea again, especially considering that with JIT and escriptize some of the ideas have progressed. We definitely should make prune the only way for packbeam to work and provide for a declarative way to circumvent it if it removes too much code. I was thinking of developing a more agressive pruning algorithm that could remove functions (for example we never call module_info functions yet they are in every lib), and maybe literals. We could consider .avm format to be a temporary storage between desktop and device, and each .avm be very specific to a given application and device. This is where we could decide to natively compile code if needed as well. We wouldn't ship the .avm anymore but rather the pristine .beams and rebar3/mix/gleam would do the work of packing, pruning, natively compiling if needed and flashing. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Libraries shipped with AtomVM are currently:
main on ESP32 and RP2 loads atomvm lib and then the user application. So does
atomvmscript on Generic Unix. On STM32, there is a single AVM while emscripten can load any number of avm. atomvmlib is the combination of several of the libraries above.Proposal is to:
For example:
ekernel (equivalent of OTP kernel + erts)
estdlib (equivalent of OTP stdlib + crypto + ssl)
eavmlib platform independent utilities
eavmlib_websocket
eavmlib_esp32 esp32 hardware interface
eavmlib_rp2 rp2 hardware interface
eavmlib_stm32 stm32
eavmlib_emscripten emscripten hardware interface
etest (equivalent of OTP eunit)
alisp (unchanged)
These libraries would have Elixir and Gleam equivalents, i.e. exavmlib would be split.
Beta Was this translation helpful? Give feedback.
All reactions