Files
newt/newt/JSLib.newt
Steve Dunham 151f678f75 Work on usable codegen
- escape js names
- executable output
- better FC in parsing
- experiment with IO
2024-09-29 22:17:51 -07:00

18 lines
424 B
Plaintext

module JSLib
ptype Int
ptype String
infixl 4 _+_
infixl 5 _*_
pfunc _+_ : Int -> Int -> Int := "(x,y) => x + y"
pfunc _*_ : Int -> Int -> Int := "(x,y) => x * y"
ptype JVoid
-- REVIEW - maybe we only have body, use names from the pi-type and generate
-- the arrow (or inline?) ourselves
pfunc log : String -> JVoid := "x => console.log(x)"
pfunc debug : {a : U} -> String -> a -> JVoid := "(_,x,a) => console.log(x,a)"