talang

Talang - our lispy rule interpreter at Talon.one

View the Project on GitHub talon-one/talang

Travis Codecov GoDoc go-report

Talang

Talang is a custom programming language, specifically a lisp-dialect, implemented in Go, that we developed and use internally at Talon.One.

Motivation

The motivation behind developing our own custom language is that the very nature of what our customers are doing in the core of our product is a form of programming. We needed a language to represent these “programs” with certain characteristics:

No existing language would fit these requirements and was also easy to integrate.

How do we use Talang at Talon.One?

Within our product, we let our customers write their own sets of what we call “Rules”. These are concluded of two main types of expressions:

We needed a way to give our customers the flexibility and control when composing such “Rules”.

At the core of our product we developed a processing engine which takes these predefined Rules, gives them an execution context, and evaluates them. The return result(s) from this engine then returned to our customers to process / work with.

Why would you need it?

Talang is a very simple, fast and flexible language which is very easy to represents in JSON objects. When you desire a language, customizable, expandable, with no compiling time and fast evaluation time - Talang can be a very good choice for your requirements.

Usage

Get the package:

$ go get github.com/talon-one/talang

Then import it and use the Interpreter:

interp := talang.MustNewInterpreter()
result, err := interp.LexAndEvaluate(`(+ 1 2)`)
if err != nil {
	panic(err)
}
fmt.Println(result.Stringify()) // 3

You can refer to the examples folder for more examples and usages.

Here you can see a list of the embedded function in the language.

Playing Around

Check out our brand new playground at https://talang-land.talon.one/.

Or alternatively, get our CLI locally and play with Talang in your consolse!

Contributing

We have collected notes on how to contribute to this project in CONTRIBUTING.md.

License

Talang is released under the MIT License.