Skip to content
プロジェクト

概要

LO は WASM をターゲットとする小さなプログラミング言語で、できるだけシンプルであることを目指しています。

言語・ランタイム

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

LO - small programming language targeting WASM that aims to be as simple as possible

🏆 Goals

  • Make both the language and the compiler small and easy to understand
  • Have literally no dependencies (except for WASM)
  • Be easy to use and modify
  • Emit WASM to have the biggest target coverage with little code
  • Document the process
  • Get to self-hosted (done) and beyond 🚀

🪵 DevLog + Docs

The journey is documented in the LO DevLog.

And the actual docs for the compiler are in the docs.

👀 Examples

Check out sample .lo programs including standard library and self-hosted compiler in the lib (the compiler is in lib/lo) and test folders.

Here are some of them with syntax highlighting from the LO VS Code extension:

Hello World sample

AOC 2020 sample

Dark Maze gif

🚀 Getting started

1️⃣ Using the LO Playground (recommended)

No install, no login: VS Code with the compiler, a WASM-4 game runtime with hot reload, a shell and git, all running in a browser tab

  • Open lo.glebbash.dev
  • Follow the quick start (LO Playground in the bottom left) to make a game or change the compiler

2️⃣ Using VS Code extension

This option also works in vscode.dev

  • Install the LO VS Code extension
  • To get the compiler: Open empty folder, execute Command Palette: LO: Download compiler (lo.wasm) (downloads the latest lo.wasm from GitHub into the folder, asks before overwriting an existing one)
  • To run currently open file: execute Command Palette: LO: Run current file, or press ▶️ button in the top toolbar. Works for WASI programs, raw fn main(): u32 programs and WASM-4 games (which open in a tab next to the source).
  • Compiling files:
    • Open Web Shell: execute Command Palette: Terminal: Create New Web Shell
    • Run: run lo.wasm compile <input>.lo > <output>.wasm

3️⃣ Using wasmtime

  • Install wasmtime
  • Download lo.wasm from this repo to your project's folder
  • Compiling files: wasmtime --dir=. lo.wasm compile <input>.lo > <output>.wasm
  • Getting diagnostics (in json format): wasmtime --dir=. lo.wasm inspect <input>.lo

4️⃣ Using lo.js

  • Install any Node.js 24 compatible runtime (Deno and Bun should work)
  • Download lo.js from this repo to your project's folder, mark it as executable
  • Compiling files: ./lo.js compile <input>.lo > <output>.wasm
  • Compiling & running files: ./lo.js run <input>.lo
  • For more info commands run ./lo.js and check the usage or read it's contents

Additional info on compiler usage is in the docs

🔦 VSCode extension

Available on:

See Inspection 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

関連プロジェクトを探す

読み込み中…