DEV Community

Fauzan Baig
Fauzan Baig

Posted on

I made Jam, a language for unserious programmers

Hey everyone. I made Jam, a little programming language for fun, weekend experiments, and tiny tools. For fellow unserious programmers who open their editor to fix one annoying thing and somehow end up starting another project.

It looks like this:

fn main():
    plans = ["build a tiny game", "automate one annoying thing"]
    plans.append("start another side project")

    for plan in plans:
        print("-", plan)
Enter fullscreen mode Exit fullscreen mode

Save that as plans.jam and run jam run plans.jam. You can also use jam build plans.jam -o plans to get a native executable that runs without Jam installed.

A few things it has:

  • Indentation-based syntax, static types, and inferred local variable types.
  • Automatic garbage collection.
  • Structs, enums, pattern matching, and modules.
  • Built-in file operations, cooperative tasks, and a small HTTP server.

The compiler and runtime are written in Jam itself. It emits LLVM IR and uses Clang to build native executables. Getting it to compile itself has been a fun part of the project.

It's experimental: syntax and APIs can change, and the Python-looking syntax doesn't mean it runs Python packages. Building from source currently needs Clang with LLVM IR support; there are bootstrap seeds for macOS arm64 and Linux x86_64/aarch64.

Mostly, I wanted something to mess around with and make small, silly things in. If that sounds like your kind of programming, give it a go. I'd love to hear what you build, what breaks, or what feels awkward.

Code, examples, and setup: https://github.com/grandimam/jam

It's MIT licensed. It also has a little jam jar mascot called Jammie, which was clearly an essential language feature.

Top comments (0)