One little compiler flag makes a surprisingly large difference: api_call - wren 0.05s 0.0017 130.52% relative to baseline api_foreign_method - wren 0.24s 0.0017 144.54% relative to baseline binary_trees - wren 0.21s 0.0032 112.27% relative to baseline binary_trees_gc - wren 0.75s 0.0288 115.02% relative to baseline delta_blue - wren 0.13s 0.0031 103.24% relative to baseline fib - wren 0.20s 0.0036 120.56% relative to baseline fibers - wren 0.04s 0.0007 108.52% relative to baseline for - wren 0.07s 0.0009 124.45% relative to baseline method_call - wren 0.12s 0.0010 95.58% relative to baseline map_numeric - wren 0.30s 0.0031 110.11% relative to baseline map_string - wren 0.11s 0.0098 111.38% relative to baseline string_equals - wren 0.19s 0.0064 115.49% relative to baseline
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.
System.print("Hello, world!")
class Wren {
flyTo(city) {
System.print("Flying to %(city)")
}
}
var adjectives = Fiber.new {
["small", "clean", "fast"].each {|word| Fiber.yield(word) }
}
while (!adjectives.isDone) System.print(adjectives.call())
-
Wren is small. The VM implementation is under 4,000 semicolons. You can skim the whole thing in an afternoon. It's small, but not dense. It is readable and lovingly-commented.
-
Wren is fast. A fast single-pass compiler to tight bytecode, and a compact object representation help Wren compete with other dynamic languages.
-
Wren is class-based. There are lots of scripting languages out there, but many have unusual or non-existent object models. Wren places classes front and center.
-
Wren is concurrent. Lightweight fibers are core to the execution model and let you organize your program into an army of communicating coroutines.
-
Wren is a scripting language. Wren is intended for embedding in applications. It has no dependencies, a small standard library, and an easy-to-use C API. It compiles cleanly as C99, C++98 or anything later.
If you like the sound of this, let's get started. You can even try it in your browser! Excited? Well, come on and get involved!