Skip to content

Adding Embedded Linux platform #1480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: public
Choose a base branch
from

Conversation

linfan68
Copy link

@linfan68 linfan68 commented Apr 3, 2025

This pull request introduces support for the linemb platform, targeting embedded Linux devices such as the Raspberry Pi Zero. The changes include updates to several configuration and source files to ensure compatibility and functionality for this new platform.
The original disscussion: Running on ARM Linux boards (Raspberry Pi Zero)

The most important changes are summarized below:

Main Entrance for new platform:

Build System:

  • Added tools/mcconfig/make.linemb.mk to define the build process for the linemb platform, including toolchain configurations and compilation flags.

Platform-Specific Headers:

  • Added a new platform header file xs/platforms/linemb/xsPlatform_linemb.h to define platform-specific macros and include necessary headers for the linemb platform.

Platform Support:

  • Added linemb platform configuration in various manifest.json files to include necessary modules and settings for the linemb platform. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Documentation:

  • Created a new documentation file documentation/devices/linemb.md to guide users on setting up and using the Moddable SDK with embedded Linux devices. This includes preparation steps, toolchain installation, and sample project build instructions.

@linfan68
Copy link
Author

linfan68 commented Apr 5, 2025

I will add this for "why we need this new platform?" in the linemb.md file. Please also comment on new use cases:

  1. Ultra-Low Resource Consumption on Small Linux Devices​​
    Moddable's embedded JS runtime requires minimal memory and CPU resources compared to Node.js, making it ideal for resource-constrained IoT devices. For example, Node.js processes in production environments often consume 200MB+ RSS memory, while Moddable operates efficiently even on microcontrollers like ESP32. Its lightweight architecture (designed for low-cost hardware) enables faster startup times and lower RAM/ROM footprints.
  2. ​​Single-Executable Deployment​​
    The platform eliminates dependency sprawl by bundling all required components into one self-contained executable. This contrasts with Node.js' heavy reliance on npm modules and system libraries. Moddable's integrated SDK approach ensures portable deployment without complex environment configurations.
  3. ​​Seamless C Language Interoperability​​
    Native extensions in Moddable require minimal boilerplate compared to Node.js' N-API/V8 binding complexities. Developers can directly invoke C functions from JavaScript via XS engine bindings, similar to embedded C development paradigms. This enables hybrid apps combining JS logic with hardware-level C optimizations and hardware operation.
  4. ​​Cross-Environment Testing via Hardware Abstraction​​
    With a robust Hardware Abstraction Layer (HAL), automated tests targeting embedded devices can run unmodified on Linux servers for CI/CD pipelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant