sapphire-lang 0.8.0

Gradually typed scripting language where every value is an object and types are optional, checked at runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# hello.spr — variables, arithmetic, string interpolation

name = "Sapphire"
version = 1

print "Hello from #{name} v#{version}!"

x = 10
y = 3
print "#{x} + #{y} = #{x + y}"
print "#{x} - #{y} = #{x - y}"
print "#{x} * #{y} = #{x * y}"
print "#{x} / #{y} = #{x / y}"
print "#{x} % #{y} = #{x % y}"

pi = 3.14159
print "pi is approximately #{pi}"
print "pi rounded down: #{pi.to_i}"