The Venice programming language
Venice is a modern, high-level, statically-typed programming language. It pairs the elegance and expressiveness of Python with the safety and modern language features of Rust.
import map, join from "itertools"
enum Json {
JsonObject({string: Json}),
JsonArray([Json]),
JsonString(string),
JsonNumber(real),
JsonBoolean(bool),
JsonNull,
}
func serialize_json(j: Json) -> string {
match j {
case JsonObject(obj) {
let it = ("\(key): \(serialize_json(value))" for key, value in obj)
return "{" ++ join(it, ", ") ++ "}"
}
case JsonArray(values) {
return "[" ++ join(map(values, serialize_json), ", ") ++ "]"
}
case JsonString(s) {
return s.quoted()
}
case JsonNumber(x) {
return string(x)
}
case JsonBoolean(x) {
return string(x)
}
case JsonNull {
return "null"
}
}
}
For a full introduction to the language, read the tutorial.
NOTE: Venice is in the early stages of development, and not yet ready for production use.
Installation
Install Venice with Go:
$ go get github.com/iafisher/venice
The Venice binary will be installed at $GOBIN/venice
.
Run venice
to open the interactive read-eval-print loop (REPL), venice compile example.vn
to compile a Venice program to bytecode, or venice execute example.vn
to compile and execute a program in one step.