Languages Features Creators CSV Resources Challenges Add Language
GitHub icon

Topaz

Topaz - Programming language

< >

Topaz is a programming language created in 2021 by m-schm.

#1556on PLDB 2Years Old 0Books
0Papers

Dependently typed language that compiles to JavaScript


Example from the web:
;; This is a comment ;; `Ven n a` represents lists that are `n` long, that contain `a`s ;; A Vec is either: type Vec (n: Uint) (a: Type) = ;; empty, with length 0... Nil: {a} -> Vec 0 a ;; or 1 item longer than a Vec of length n. `::`: {n a} -> a -> Vec n a -> Vec (n+1) a ;; `zip` should take two lists and return a list of pairs. ;; The two lists are required to be the same length because `n` is the same for ;; both parameters. let zip {n a b} (left: Vec n a) (right: Vec n b): Vec n (a, b) = match left, right in ;; Either both lists are empty... Nil, Nil => Nil ;; or they both contain at least one item. x :: xs, y :: ys => (x, y) :: zip xs ys ;; No other cases are needed, because the lists are the same length!
fuzuli.html 路 topaz-lang.html 路 concurnas.html

View source

- Build the next great programming language Search Day 214 About Blog Acknowledgements Traffic Traffic Today GitHub feedback@pldb.com