LingDong-/wax logo

LingDong-/wax

Free

A tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua and WebAssembly 🚀

FreeFree tier
Type
Open Source
Company
LingDong-

About LingDong-/wax

Wax is a tiny, experimental programming language designed to transpile seamlessly to multiple major imperative languages, including C, C++, Java, TypeScript, Python, C#, Swift, Lua, and WebAssembly. It aims to be a common subset of these languages, avoiding unique fancy features to achieve readable, editable, and integrable output code that looks like handwritten code in the target language. The syntax is inspired by WebAssembly Text Format (wat) and uses S-expressions reminiscent of Lisp but with an imperative, C-like design. Wax is strongly statically typed and has built-in support for arrays, hashtables, structs, and C-like macros. It provides an online playground for experimentation. As an experimental project, it may contain bugs and areas for improvement.

Key Features

Transpiles to 9 target languages: C, C++, Java, TypeScript, Python, C#, Swift, Lua, and WebAssembly
Produces readable and editable output code resembling handwritten code in the target language
Output can be imported as libraries in the target language ecosystem
Syntax based on S-expressions inspired by WebAssembly Text Format (wat)
Strongly statically typed with built-in arrays, hashtables, and structs
Supports C-like macros for conditional compilation and code generation
Online playground at https://lingdong-.github.io/wax/ for quick experimentation
Open source and available on GitHub (LingDong-/wax)

Pros & Cons

Pros
  • Transpiles to a wide range of popular languages including WebAssembly
  • Output code is readable, editable, and integrable as native libraries
  • Simple, consistent S-expression syntax that maps directly to ASTs
  • Strong static typing and built-in data structures (arrays, hashtables, structs)
  • Open source and free to use
  • Active GitHub repository with community contributions welcome
Cons
  • Experimental — may contain bugs and is not recommended for production use
  • Missing advanced features found in individual target languages (e.g., classes, async/await, generics)
  • Syntax (S-expressions) may feel unfamiliar to developers used to C-like syntax
  • Limited ecosystem and documentation outside of the GitHub repository
  • Not well-known or widely adopted compared to established transpilers like Haxe

Best For

Transpiling a single codebase to multiple programming languages for cross-platform developmentGenerating human-readable, editable code in a target language when the original source is unavailableUsing transpiled code as a library within a larger project in the target languageLearning similarities and differences between imperative languages via a common subsetRapid prototyping with a consistent syntax that can be deployed to various environments

FAQ

What is wax?
Wax is a tiny programming language that transpiles to C, C++, Java, TypeScript, Python, C#, Swift, Lua, and WebAssembly. It is designed to be a common subset of major imperative languages, producing readable, editable, and integrable code in each target.
What languages does wax support as output?
Wax currently supports transpilation to C, C++, Java, TypeScript, Python, C#, Swift, Lua, and directly to WebAssembly.
Is wax production-ready?
No, wax is labeled as experimental. The repository states there may be bugs and aspects to improve, and contributions via pull requests and issues are welcome.
What does 'readable, editable, integrable' output mean?
It means the generated code looks like handwritten code in the target language (readable), can be edited by humans if the original wax source is lost (editable), and can be imported as a library in the target language (integrable).