static type analysis, formatted compiler errors, hex support, composite types, updated cli, more global builtins, fix list form, fix value refs

This commit is contained in:
Neemek 2025-03-18 20:22:46 +01:00
parent 84cc845748
commit 954308b29f
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
18 changed files with 1352 additions and 285 deletions

View file

@ -18,7 +18,7 @@ while n <= terms {
tot = tot * 6
# get the absolute value of a number
func abs(x) {
func abs(x: number) number {
if x < 0 {
return -x
}
@ -30,7 +30,7 @@ func abs(x) {
# see: https://en.wikipedia.org/wiki/Newton's_method
# The required accuracy
SQRT_ACC := 0.00000001
func sqrt(x) {
func sqrt(x: number) number {
pg := 0 # previous guess
g := 1 # current guess
@ -45,4 +45,4 @@ func sqrt(x) {
tot = sqrt(tot)
# output the result
write(tot)
write(str(tot))