venice

command module
v0.0.0-...-4a27929 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2021 License: MIT Imports: 10 Imported by: 0

README

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src
compiler
* * The Venice compiler.
* * The Venice compiler.
vm
* * Data structures for the representation of Venice values by the virtual machine.
* * Data structures for the representation of Venice values by the virtual machine.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL