Nelua Samples
This repository contains some examples of applications written in Nelua, all of them follow these rules:
- The sample has minimal dependencies (no external libraries other than Nelua compiler).
- The sample can run on both web browser and desktop.
- The sample is minimal, it just serves as an example.
- The sample source code is contained in a single file.
- The sample have C generated code at c directory for reference.
- The sample have WASM generated code at docs directory so it can be lively tested on GitHub pages.
The libs directory contains some single header C libraries and its bindings generated with nelua-decl.
Sokol Nuklear Calculator
This is a simple Calculator using Sokol graphics library and Nuklear UI library.
- Can be lively tested in the browser at this page.
- Check the Nelua code in this file.
- You can check the generated C code in this file.
Compiling
To compile for the desktop, simply run for example:
nelua sokol-nuklear-calculator.nelua
no extra setup is needed.
To compile for the web, install Emscripten compiler, then inside its environment simply run for example:
nelua --cc=emcc sokol-nuklear-calculator.nelua
and your browser will popup with the example running, no extra setup is needed.