0.4.0 • Published 2 years ago

voidc v0.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Void

An experimental WebAssembly language. Designed to make writing high performance web apps fun for individuals and teams alike.

https://justforfunnoreally.dev/

// Find the value of the fibonacci sequence at index n
fn fib(n:i32) -> i32
    if (n < 2)
        n
        fib(n - 1) + fib(n - 2)

// All binary programs have a main function
fn main() -> void
    var index = 0
    for num in range(15)
        // Print fibonacci sequence at index using UFCS.
        num.fib().print()

Disclaimer Void is in it's very early stages and should not be used for production applications. Most MVP features have not been implemented yet. The language does run and compile though. So feel free to play around.

Core values:

  • Developer satisfaction
  • Predictability
  • Balance between performance and simplicity. Zero-Cost abstractions is a non-goal.
  • First class WebAssembly support
  • Play nice with others
  • Fast performance
  • Prefer existing standards when possible
  • Quality libraries for web, server, and graphics applications.

Features:

  • Fn syntax
  • Primitive macro
  • Infix support
  • Standard function notation
  • Parenthetical elision
  • UFCS (dot notation)
  • Variables
  • If statements
  • WASM code generation
  • Function overloading
  • Booleans
  • Tuple and Struct destructuring
  • Tail recursion
  • Generics
  • Modules 🚧
  • Std library 🚧
  • Test framework
  • Type checking
  • Type inference
  • Safety semantics (unsafe, ownership etc)
  • Match statements
  • Loops
  • Algebraic data types
  • Optionals
  • Algebraic effects
  • Reference Types (Boxes? / Mutable Borrows? / GC?)
  • Traits
  • Syntax Objects and Syntax Traits / Interfaces
  • Hygienic Macros
  • String literals 🚧
  • Struct literals 🚧
  • Tuple literals 🚧
  • Array literals 🚧
  • Named arguments
  • Rest parameters
  • WASM module function exports
  • Access control (public / private etc)
  • Comments
  • First class functions
  • Scoping / (Namespacing?)
  • Syntax Highlighting
  • Language Sever Protocol
  • Website
  • Debugger

Getting Started

Install

npm i -g voidc

Usage

voidc path/to/code.void

Documentation

To get a feel of the language, check out the overview.md file.

For an in depth language guide, check out the reference folder.