https://github.com/glebbash/LO Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} glebbash / LO Public * Notifications * Fork 0 * Star 101 * LO - small programming language targeting WASM that aims to be as simple as possible 101 stars 0 forks Branches Tags Activity Star Notifications * Code * Issues 0 * Pull requests 1 * Discussions * Actions * Projects 0 * Wiki * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Projects * Wiki * Security * Insights glebbash/LO This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main BranchesTags Go to file Code Folders and files Name Name Last commit message Last commit date Latest commit History 707 Commits .devcontainer .devcontainer .vscode .vscode docs/assets docs/assets examples examples src src vscode-ext vscode-ext .editorconfig .editorconfig .gitignore .gitignore .gitpod.yml .gitpod.yml Cargo.toml Cargo.toml README.md README.md build.sh build.sh lo.wasm lo.wasm utils.mjs utils.mjs View all files Repository files navigation * README [lo] 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 little to no dependencies * Be easy to use and modify * Emit WASM to have the biggest target coverage with little code Development Log Parts [0..6] - Building the initial compiler. (text based blog) Parts [7..] - Building the self-hosted compiler. (YouTube playlist) Overview Check out example .lo programs including standard library sources and WIP self-hosted compiler in the ./examples folder. Here are some of them with syntax highlighting from the LO VS Code extension: * Hello world (source): Hello World sample * Advent of Code 2020 Day 1 (source): AOC 2020 sample * Dark Maze (WASM-4 demo game) play it here or check the source: Dark Maze gif Getting started Option 1 (recommended): Using VS Code extension only This option also works in vscode.dev * Install the LO VS Code 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 Option 2: Using wasmtime * Install wasmtime * Compiling files: wasmtime --dir=. lo.wasm .lo > .wasm * Getting diagnostics (in json format): wasmtime --dir=. lo.wasm .lo --inspect Option 3: Using Node.js * Install Node.js * Compiling files: ./utils.mjs compile .lo > .wasm * Compiling & running files: ./utils.mjs run .lo Building the initial compiler * Requirements: + Install rustup + Switch to nightly: rustup toolchain install nightly + Add WASM target: rustup target add wasm32-unknown-unknown + You can also find configs for GitHub Codespaces and GitPod in this repo * Run ./build.sh This will build the compiler with cargo, putting resulting WASM binary into lo.wasm Running tests * Requirements: + Install Node.js for running tests * Run ./utils.mjs test This runs tests defined in utils.mjs. Test programs are located in examples/test About LO - small programming language targeting WASM that aims to be as simple as possible Topics language compiler webassembly Resources Readme Activity Stars 101 stars Watchers 1 watching Forks 0 forks Report repository Languages * Rust 80.0% * JavaScript 12.4% * TypeScript 7.5% * Shell 0.1% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.