3.6 KiB
^title Getting Started
Trying out the language
If you'd like to try Wren, you have a few options.
- In your browser. You can try Wren right here!
- On your computer. The Wren CLI project is a downloadable executable to run scripts with access to file io and more. See the Wren CLI docs.
- Embedded in your code. See how to build and embed Wren below.
And then read the embedding guide!
Once you have somewhere to explore, it's time to learn the language.
Embed the VM
The Wren Virtual Machine is the core of the language that executes Wren source code. It is just a library, not a standalone application. It's designed to be embedded in a larger host application.
It has no dependencies beyond the C standard library. You can use it as a static library, shared library, or simply compile the source into your app.
Building Wren
To build the Wren library, we look inside the projects/ folder.
In here you'll find ready to go projects for Visual Studio, XCode and tools like make.
- Windows Open
wren.slninsideprojects/vs2019/(orvs2017), hit build. - Mac Open
wren.xcworkspaceinsideprojects/xcode/, hit build. - Linux Run
makeinside ofprojects/make/.
In each case, there will be library files generated into the root lib/ folder.
These are what you'll link into your project, based on your needs.
- Static Linking
wren.libon Windows,libwren.aelsewhere. - Dynamic Linking
wren.dllon Windows,libwren.soon Linux, andlibwren.dylibon Mac.
Other platforms
If your platform isn't explicitly supported,
it is recommended that you include the Wren source
in your project for a portable experience.
Including the code in your project
all source files
The alternative to building via the provided projects is to include the wren source code in your project.
Since it has no dependencies this is simple, all the code in src/ comes along. There's a readme in src/ for details.
'amalgamated' build
If you want an even simpler way, there's an 'amalgamated' build (often called blob, or unity builds.).
This is all of the wren source code in one file.
This file can be generated by running python3 util/generate_amalgamation.py > build/wren.c,
which saves the generated output in build/wren.c.
Include build/wren.c and src/include/wren.h in your project code and you're good to go.
Ideally later we can automate generating this and include it in the repo.
If you run into bugs, or have ideas or questions, any of the following work:
- Join the discord community.
- Ask on the Wren mailing list (which is pretty quiet).
- Tell us on twitter at @munificentbob or @ruby0x1.
- File a ticket at the GitHub repo.
- The CLI also has tickets and a GitHub repo too.
- Pull requests are welcome.