Learn about what makes Wren unique
Wren is a small, fast, class-based concurrent scripting language. Think Smalltalk in a Lua-sized package with a dash of Erlang and wrapped up in a familiar, modern syntax.
Small. The VM is under 4,000 semicolons of readable and lovingly-commented C.
Fast. A smart, single-pass compiler produces tight, efficient bytecode.
Class-based. Classes and objects are front and center.
Concurrent. Lightweight fibers are built into the language.
Scripting. Embeddable, no dependencies, a small standard library, and an easy-to-use C API.
The heart of Wren is the VM. The Wren Virtual Machine is the core of the language and executes all Wren source code. It is just a library, not a standalone application. It’s designed to be embedded in a larger host application.
You can find Wren embedded in such projects as:
You can even embed Wren inside your own projects. For Exercism purposes the host application we'll be using is Wren Console - allowing us to run and test our Wren scripts from the terminal.
Lua is nice: it’s small, simple, and fast. But—and I don’t mean this as a criticism—it’s also weird if you’re used to languages like C++ and Java. The syntax is different. The semantics, especially the object model are unusual. Anyone can get used to 1-based indexing, but things like metatables really show that objects were bolted onto Lua after the fact.
I think there’s room for a language as simple as Lua, but that feels natural to someone with an OOP background. Wren is my attempt at that.