Giter Club home page Giter Club logo

quarry's Introduction

Quarry

A systems programming language focused on compile time evaluation semantics.

Examples

Types

let A = int8      // signed 8 bit integer
let B = uint64    // unsigned 64 bit integer
let C = uint      // unsigned pointer-sized integer
let D = float64   // 64 bit float
let E = int&      // int reference 
let F = int mut&  // mutable int reference 
let G = int?      // optional int 
let H = [int: 4]  // array of 4 ints 
let I = [int]     // slice of ints (reference and length) 
let J = [mut int] // mutable slice of ints
let K = type [a: int, b: float, c: bool] // record/struct
let L = type A | B | C // tagged union
let M = type(uint8) A: uint8 = 1 | B: float = 3 | bool // tagged union

let N = int8      // weak type alias
let O = type int8 // strong type alias

Constant Evaluation

let sum = (int mut until) int {
    let mut sum = 0
    loop until >= 0 {
        sum += until
        until -= 1
    }

    sum
}

let mysum = const sum(10) // equals 55

Miscellaneous

let b = const a
let c = const b
let d = const c
int32 a = 3

let array_size = () int8 { 4 }

let main = (int8 argc) int8 {
    [int8: array_size()] arr = [1, 2, 3]
    0
}
let value = const sum()

let MySize = uint?mut &?

let main = (int8 foo = 23) int8 {
    let foo1 = [foo, a, 1, 2]
}

let f = main(2)

let Foo = Data
let Data = type(int) uint A | B

quarry's People

Contributors

nohenry 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.