#language #programming-language #lua #compiler #transpiler

app clue

C/Rust like programming language that compiles into Lua code

8 stable releases

3.1.0 Feb 21, 2023
3.0.1 Feb 5, 2023
3.0.0 Jan 29, 2023
2.5.3 Nov 24, 2022
2.4.2 Aug 23, 2022

#13 in Programming languages

Download history 8/week @ 2022-12-03 3/week @ 2022-12-10 1/week @ 2022-12-17 16/week @ 2022-12-24 3/week @ 2022-12-31 8/week @ 2023-01-07 21/week @ 2023-01-14 6/week @ 2023-01-21 43/week @ 2023-01-28 36/week @ 2023-02-04 25/week @ 2023-02-11 45/week @ 2023-02-18 5/week @ 2023-02-25 3/week @ 2023-03-04 20/week @ 2023-03-11 30/week @ 2023-03-18

60 downloads per month

MIT license


The Clue programming language

Crates.io Crates.io

Clue is a programming language that compiles blazingly fast into Lua code with a syntax similar to languages like C or Rust.

Clue tries to be almost as simple as Lua (with only a slightly more advanced syntax) but adds many optional features that can make code look better or make some things (like metatables) easier to code.

Clue does not compile to a specfic version of Lua: flags can be toggled to alter the output to allow most if not all versions or modifications of Lua to be compiled to with Clue.

General syntax differences

  • Code blocks are now inside {} instead of then/do/repeat and end/until
  • Comments are made with // ... or /* ... */

If you want a complete documentation of every change and addition in Clue check the wiki.

Example code

print("Hello world!")

local fn add(x, y) {
    return x + y

global n = 1

while n < 10 {
    n += add(n, n)
    if n == 3 {continue}

More examples can be found in the wiki, the Examples directory or you can check an example program made with LOVE using Clue.

How to install

Using Cargo

  1. Paste and run this command in the console: cargo install clue
  2. Type clue in the console to run the compiler, it will explain the rest

Clue supports extra features that can be toggled when installing:

  • interpreter: adds the --execute flag to let Clue run the generated output using mlua
  • rpmalloc: uses rpmalloc to improve performance, not available on all platforms

By default Clue enables both features.

Manual insallation

  1. Download the latest release and save it somewhere
  2. Open your system environment variables
  3. Add the path to the directory that contains clue.exe in the PATH variable
  4. Type clue in your cmd/PowerShell to run the compiler, it will explain the rest

More coming soon!

There are still some features that I'm considering adding and others that will be added soon. The most likely ones to be added in the future are:

  • types (coming in 4.0)
  • selectable lua targets (coming in 3.1)

For any suggestion or bug you can make a github issue. If you need help with the language itself, you can check out the new Discord server.

I hope Clue will be useful to you :)

Why is Clue named Clue?

I have no clue.


~80K SLoC