Top 1,000 Features Creators Resources Extensions Blog Explorer CSV Download
GitHub icon

Wax

< >

Wax is a programming language created in 2020 by Lingdong Huang.

#1480on PLDB 4Years Old
Download source code:
git clone https://github.com/LingDong-/wax

Try now: Web


Language features

Feature Supported Token Example
Operators โœ“
;; << >> = && || >= <= <>
;; + - * / ^ % & | ! ~ < >
Line Comments โœ“ ;
; a comment
Macros โœ“
(@define MY_CONSTANT 5)
(@if MY_CONSTANT 5
    (print "yes, it's")
    (print @MY_CONSTANT)
)
Ternary operators โœ“
(set y (? (= x 0) 1 2))
Prefix Notation โœ“
(+ 1 1)
Structs โœ“
(struct point
    (let x float)
    (let y float)
)
Lists โœ“
(let x (arr (vec 3 float)))
Maps โœ“
(let m (map str int) (alloc (map str int)))

(set m "xyz" 123)

(insert m "abc" 456) ; exactly same as 'set'

(print (get m "xyz"))

(remove m "xyz")

(print (get m "xyz"))
;^ if a value is not there, the "zero" value of the element type is returned
; for numbers, 0; for compound types, null.
Strings โœ“
Floats โœ“
Assignment โœ“
(set x 42)
Integers โœ“
(let x int 42)

View source

- Build the next great programming language ยท About ยท Acknowledgements ยท Published by Breck's Lab