Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glebbash/lo
LO - small programming language targeting WASM that aims to be as simple as possible
https://github.com/glebbash/lo
compiler language webassembly
Last synced: 5 days ago
JSON representation
LO - small programming language targeting WASM that aims to be as simple as possible
- Host: GitHub
- URL: https://github.com/glebbash/lo
- Owner: glebbash
- Created: 2021-12-25T13:09:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-19T13:51:29.000Z (6 months ago)
- Last Synced: 2024-05-19T14:48:30.386Z (6 months ago)
- Topics: compiler, language, webassembly
- Language: Rust
- Homepage:
- Size: 33.4 MB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
LO - small programming language targeting WASM that aims to be as simple as possible
- [🏆 Goals](#-goals)
- [🪵 DevLog + Docs](#-devlog--docs)
- [👀 Examples](#-examples)
- [🚀 Getting started](#-getting-started)
- [🔦 VSCode extension](#-vscode-extension)
- [❔ More info](#-more-info)## 🏆 Goals
- Make both the language and the compiler small and easy to understand
- Have little to no dependencies
- Be easy to use and modify
- Emit WASM to have the biggest target coverage with little code
- Document the process## 🪵 DevLog + Docs
The journey is documented in the [LO DevLog](https://carrot-blog.deno.dev/?tag=lo).
And the actual docs for the compiler are in the [docs](./docs/README.md) folder.
## 👀 Examples
Check out example `.lo` programs including standard library sources and WIP self-hosted compiler in the [./examples](./examples/) folder.
Here are some of them with syntax highlighting from the [LO VS Code extension](#vscode-extension):
- Hello world [(source)](examples/test/demos/hello-world.lo):
![Hello World sample](./docs/assets/hello-world.png)
- Advent of Code 2020 Day 1 [(source)](examples/test/demos/hello-world.lo):
![AOC 2020 sample](./docs/assets/aoc-2020-day1.png)
- Dark Maze (WASM-4 demo game) [play it here](https://rawcdn.githack.com/glebbash/LO/da8305293f5438967619e91c6ecfd472111ccf91/examples/test/demos/wasm4/builds/dark-maze.html) or check the [source](examples/test/demos/wasm4/src/dark-maze.lo):
![Dark Maze gif](./docs/assets/dark-maze.gif)
## 🚀 Getting started
1️⃣ Using VS Code extension (recommended)
> This option also works in vscode.dev
- Install the [LO VS Code extension](#vscode-extension)
- To create a new project: Open empty folder, execute Command Palette: `LO: Initialize project in current workspace`
- To run currently open file: execute Command Palette: `LO: Run current file`, or press ▶️ button in the top toolbar
- Compiling files:
- Open Web Shell: execute Command Palette: `Terminal: Create New Web Shell`
- Run: `run lo.wasm .lo > .wasm`---
2️⃣ Using wasmtime
- Install [wasmtime](https://github.com/bytecodealliance/wasmtime)
- Compiling files: `wasmtime --dir=. lo.wasm .lo > .wasm`
- Getting diagnostics (in json format): `wasmtime --dir=. lo.wasm .lo --inspect`---
3️⃣ Using Node.js
- Install [Node.js](https://github.com/bytecodealliance/wasmtime)
- Compiling files: `./utils.mjs compile .lo > .wasm`
- Compiling & running files: `./utils.mjs run .lo`---
> Additional info on compiler usage is in the [docs](./docs/README.md)
## 🔦 VSCode extension
Available on:
- [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=glebbash.lo)
- [Open VSX Registry](https://open-vsx.org/extension/glebbash/lo)> See [Inspection](./docs/README.md#52-inspecting-code-ide-intergration) if you are interested in intergrating with other IDEs
## ❔ More info
More info including building initial compiler and running tests is available in the [docs](./docs/README.md)