Hello World in Wren

Published on 20 April 2018 (Updated: 16 May 2023)

Welcome to the Hello World in Wren page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

System.print("Hello, World!")

Hello World in Wren was written by:

This article was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

Personally, I'm getting hints of Java and Python here just in terms of syntax.

At any rate, let's break it down. Obviously, we only have one line, but it's at least a little more interesting than most scripting languages.

For starters, we have the built-in System class. This class comes with the core module along with a few other goodies like String, Sequence, Fiber, and Bool.

Now, one of the functions of System is print. Obviously, print writes text to standard output. But, I find Wren's print functionality particularly interesting because it's similar to Java. In fact, it accepts any object as input. If the input is not a String, print will convert it to a String using the toString functionality, a method available to all objects.

So, basically we call the static method print of the System class which prints the input to the user. How cool is that?

How to Run the Solution

You can download a copy of Wren to your local machine, grab a copy of Hello World in Wren, and then run this:

wren_cli hello-world.wren

Alternatively, you can use an online Wren interpreter.