Skip to content

kramermt/val

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Val

Val aims to be a safe, concurrent, general-purpose programming language based on value semantics.

// Declares a generic 'Pair' type.
type Pair<T, U> { var fst: T; var snd: U }

// Instantiates the type 'Pair', inferring the specialization arguments.
var foo = Pair(fst: 4, snd: 2)

// Copies the instance an mutates it.
var bar = foo
bar.fst = 8

// Prints 4, not 8, because 'foo' and 'bar' are two independent values.
print(bar.fst)

Val is heavily inspired by (and implemented in) Swift and adopts many of its features, including higher-order functions, mutating methods, and a relatively powerful support for generic programming (a.k.a. parametric polymorphism).

Releases

No releases published

Packages

No packages published

Languages

  • Swift 99.8%
  • Other 0.2%