Skip to content

A modern, high-level, statically-typed programming language

License

Notifications You must be signed in to change notification settings

iafisher/venice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Venice programming language

NOTE: Venice is in the early stages of development, and not yet ready for use.

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(map<string: Json>),
  JsonArray(list<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";
    }
  }
}

About

A modern, high-level, statically-typed programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages