Go+ supports bytecode backend and Go code generation.
We introduce some features for enhancement.
We reinvent the error handling specification in Go+.
You can use Go+ programs as shell scripts now.
We introduce the rational number as native Go+ types. We use suffix r to denote rational literals. For example, (1r << 200) means a big int whose value is equal to 2200. And 4/5r means the rational constant 4/5.
a := 1r << 65 // bigint, large than int64 b := 4/5r // bigrat c := b - 1/3r + 3 * 1/2r println(a, b, c)
sum := 0 for x <- [1, 3, 5, 7, 11, 13, 17], x > 3 { sum += x } println(sum) resultMap := [k+","+s for k, s <- {"Hello": "xsw", "Hi": "Go+"}] println(resultMap) array := [1, 2, 3, 4, 5, 6] resultArray := [[a, b] for a <- arr, a < b for b <- arr, b > 2] println(resultArray)
You can use Go+ programs as shell scripts now.
#!/usr/bin/env gop run println("Hello, Go+")
Github:https://github.com/goplus/gop. Powered By Qiniu.com.