/hacklang

The Hack programming language

Primary LanguageGoMIT LicenseMIT

hacklang

The Hack programming language

run

$ dep ensure

Start REPL shell

$ go run cmd/main.go

example

number

-> 1
1

bool

-> true
true
-> false
false

string

-> `hello world`
`hello world`

list

-> [1, 2, 3]
[1, 2, 3]

map

-> {a: 1, b: 2}
{a: 1, b: 2}

function

-> i => { print(i) }
<function>

See example for more examples.

run file

$ go run cmd/main.go example/hello_world.hack

format file

$ go run cmd/main.go --format example/hello_world.hack