| --- |
| title: LCPU Advanced Arithmetic Engine |
| emoji: ๐ ๏ธ |
| colorFrom: gray |
| colorTo: indigo |
| sdk: gradio |
| sdk_version: 6.14.0 |
| app_file: app.py |
| tags: |
| - ml-intern |
| pinned: true |
| --- |
| |
| # ๐ ๏ธ LCPU: Advanced Arithmetic Engine |
|
|
| Write C code, compile it to WebAssembly (WASM), run it instantly, and visualize the binary as a 1080p grayscale texture. |
|
|
| ## Features |
|
|
| 1. **The Forge** โ Write C code, compile to WASM with Emscripten (auto-installed on first run) |
| 2. **The Runner** โ Execute exported functions with arguments, powered by `pywasm` |
| 3. **The Visualizer** โ Render WASM binaries as tiled 1920ร1080 grayscale images |
|
|
| ## Example C Code |
|
|
| ```c |
| int add(int a, int b) { |
| return a + b; |
| } |
| |
| int mul(int a, int b) { |
| return a * b; |
| } |
| ``` |
|
|
| Compile as `math_core`, then run `add` with arguments `10, 20`. |
|
|
| ## Notes |
|
|
| - First compile may take 1-2 minutes while Emscripten installs |
| - Functions are auto-exported by Emscripten SIDE_MODULE mode |
| - Persistent WASM files are stored in `/data` |