Giter Site home page Giter Site logo

void's Introduction

Very Original Interface Definition

void is an interface definition language created as a way to learn the Rust programming language. The void language allows you to define types and endpoints used to generate code in various languages. A module is a versioned collection of types, structs and endpoints. An API is a collection of compatible modules that export said types, objects and endpoints.

Progress / Wishlist

Language definition:

  • Primitives
  • Modules
  • Apis / Packages
  • Comments
  • Enum
  • List
  • Map
  • Set
  • HTTP Endpoints
  • WebSocket Endpoints
  • Docstrings
  • Streams

Compiler modules:

  • Lexer
  • AST
  • Parser
  • Typescript backend
  • Python backend
  • Go backend
  • Caching

Language Characteristics

  • Typed
  • Semicolons
  • CamelCase for types, lowercase for primitives
  • Whitespace insensitive
  • Versioned

Examples

# Custom structures
type Foo struct {
    bar: int,
    oof: Map<string, int>,
    rab: List<float>,
    raboof: Set<int>,
}

# Type aliases
type UUID string;

# Enums
type Bar enum {
    ONE,
    TWO,
    THREE,
}

# Endpoints
type PerformTransactionResponse struct {};
endpoint PerformTransaction {
    request: struct { userId: int, data: List<string> },
    response: PerformTransactionResponse
}

# Docstrings
/*
General description of type.
modules: A list of module IDs to fetch status for.
*/
type GetStatusRequest struct {
    modules: List<int>
}

/*
General description of endpoint.
*/
endpoint GetStatus {
    request: GetStatusRequest,
    response: GetStatusResponse
}

# Versioned modules
module payment version 3.2;

include customers version 1.2;

type Foo string;

# Versioned APIs. Will expose all APIs defined in the included modules.
api version 1.0;

include customers 1.0;
include batch 1.0;
include payment 1.0;

void's People

Contributors

myth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.