Gem Programming Language v1.3.0

A modern, statically-typed language that prioritizes safety, clarity, and developer experience. Beautiful syntax with strong safety guarantees.

Gem combines elegant syntax with compile-time safety, creating a language that's both powerful and delightful to write. No more choosing between safety and beauty.

Memory Safe Type Safe Fast Developer Friendly Beautiful Syntax
hello.gem
Terminal
$ gemc hello.gem
Loading Gem interpreter...

Try it yourself! Edit the code above and click "Run" to see Gem in action. This is a real Gem interpreter running in your browser - experience the language's safety and elegance firsthand.

What Makes Gem Special

🔒

Memory Safety

Automatic scope-based memory management with compile-time borrow checking. No memory leaks, no use-after-free errors.

🛡️

Type Safety

Enhanced static typing with nullability and mutability control. Catch errors at compile time, not runtime.

Performance

Bytecode compilation with JIT optimization. Get the speed of compiled languages with modern safety features.

🎯

Developer Experience

Clear error messages, interactive REPL, and intuitive syntax. Built for productivity and developer happiness.

🧩

Modern Features

First-class functions, classes, inheritance, modules, and a growing standard library.

Beautiful Syntax

Clean, expressive syntax that's genuinely pleasant to read and write. Code that's not only safe and fast, but beautiful.

The Journey to Gem

From Humble Beginnings to Something Awesome

Gem's story began as a fork of the Monkey interpreter from "Writing an Interpreter in Go." As the language evolved, it transitioned to being based on Lox from "Crafting Interpreters," where it was known as Embr (embrlang.com).

But we weren't satisfied with just another interpreter. We wanted something special. Something that captured beautiful syntax and developer happiness while incorporating strong memory safety and type checking to eliminate common programming errors.

So we stripped back the language and rebuilt it, creating Gem - a language with elegant syntax and strong safety guarantees. Gem is designed to be an awesome fucking language that you'll actually enjoy using.

🐒

Monkey Era

Started as a fork of the Monkey interpreter, learning the fundamentals of language design.

🔥

Embr Phase

Transitioned to Lox-based architecture as Embr, exploring bytecode compilation and optimization.

Gem Reborn

Complete rewrite with focus on safety, beauty, and developer happiness. The language we always wanted.

🎯 Design Philosophy

Gem focuses on beautiful syntax and developer joy, while providing strong memory safety and type checking. We believe you shouldn't have to choose between safety and beauty, between performance and elegance. Gem gives you all of it.

Elegant syntax + Strong safety = Developer happiness

Code Examples

Type Safety

# Variables are immutable by default
string name = "Alice"
# name = "Bob"  # ❌ Error: Cannot modify immutable

# Use 'mut' keyword for mutable variables (recommended)
mut int counter = 0        # Mutable with mut
counter = counter + 1      # ✅ Valid: counter is mutable

# Alternative syntax with '!' suffix
int! altCounter = 0        # Mutable with ! (alternative)
altCounter = altCounter + 1 # ✅ Valid: altCounter is mutable

Memory Safety

# Automatic scope-based cleanup
begin
    obj resource = FileHandle("data.txt")
    resource.process()
    # resource automatically cleaned up here
end
# resource is no longer accessible

# Borrow checking prevents use-after-drop
# puts resource.data  # ❌ Compile error

Functions & Classes

# First-class functions with type safety
def calculate(int x, int y, func operation) int
    return operation(x, y)
end

# Classes with inheritance
class Animal
    def speak() string
        return "Some sound"
    end
end

class Dog : Animal
    def speak() string
        return "Woof!"
    end
end