A fast and flexible scripting language for Go developers and DevOps.
Risor modules integrate the Go standard library, making it easy to use functions that you're already familiar with as a Go developer.
Scripts are compiled to bytecode internally which it then runs on a lightweight virtual machine. Risor is written in pure Go.
Documentation is available at risor.io.
You might also want to try evaluating Risor scripts from your browser.
Head over to Getting Started in the documentation.
That said, if you use Homebrew, you can install the Risor CLI as follows:
brew tap risor-io/risor
brew install risor
Having done that, just run risor
to start the CLI or risor -h
to see
usage information.
Risor is designed to be versatile and accommodate a variety of usage patterns. You can leverage Risor in the following ways:
-
REPL: Risor offers a Read-Evaluate-Print-Loop (REPL) that you can use to interactively write and test scripts. This is perfect for experimentation and debugging.
-
Library: Risor can be imported as a library into existing Go projects. It provides a simple API for running scripts and interacting with the results, in isolated environments for sandboxing.
-
Executable script runner: Risor scripts can also be marked as executable, providing a simple way to leverage Risor in your build scripts, automation, and other tasks.
-
API: (Coming soon) A service and API will be provided for remotely executing and managing Risor scripts. This will allow integration into various web applications, potentially with self-hosted and a managed cloud version.
Here's a short example of how Risor feels like a hybrid of Go and Python, with
new features like pipe expressions for transformations, and with access to portions
of the Go standard library (like the strings
package):
array := ["gophers", "are", "burrowing", "rodents"]
sentence := array | strings.join(" ") | strings.to_upper
print(sentence)
Output:
GOPHERS ARE BURROWING RODENTS
A Risor VSCode extension is already available which currently only offers syntax highlighting.
You can also make use of the Risor TextMate grammar.
Risor is intended to be a community project. You can lend a hand in various ways:
- Please ask questions and share ideas in GitHub discussions
- Share Risor on any social channels that may appreciate it
- Open GitHub issue or a pull request for any bugs you find
- Star the project on GitHub
Please visit the GitHub discussions page to share thoughts and questions.
Risor is a young project and until June 28, 2023 was known as Tamarin. For various reasons, the project needed a new name that would take the project into the future. Risor is a fun name, a bit shorter, and I can get a domain name for the project. Thanks for bearing with me during this update!
Check CREDITS.md.
Released under the Apache License, Version 2.0.
Copyright Curtis Myzie / github.com/myzie.