Hello there, and welcome to Hyper!, an exhilarating and quirky programming language designed for those who either want to express their limitless amount of energy or need stimulation while coding until late hours of the night. Inspired by HyperTalk and Python, Hyper! employs speech-like syntax for an easier, pragmatic experience.
!!! this is a single line commment
!?
this is a
multi-line
comment
?!
Static Semantic Errors
Undeclared variables
Mismatching types
Incompatible types
Breaking or continuing outside of a loop
Not declaring a function before calling it
Returning an incorrect function return type
Returning a statement outside of a function
Having return statements in a void(nonetype) function
Declaring object methods with the same name
Not declaring an object before initializing it
Subscripting of non array and non tuple
Example Programs
Hello, World!
Hyper!
Python
SAY("HELLO, WORLD!")!
print('Hello, World!')
Fibonacci
Hyper!
Python
FUNC INT fibonacci(INT num):
TRY num EQUALS 0:
GIMME 0!
NO?TRY num EQUALS 1 OR num EQUALS 2:
GIMME 1!
GIMME fibonacci(num SUB 2) ADD fibonacci(num SUB 1)!
FUNC INT gcd(INT x, INT y):
UNTIL y:
x IS y!
y IS x MOD y!
GIMME x!
defgcd(x, y):
while(y):
x, y=y, x%yreturnx
Finding the Largest of Three Numbers
Hyper!
Python
INT num1 IS 10!
INT num2 IS 14!
INT num3 IS 12!
INT largest!
TRY (num1 GRTEQ num2) AND (num1 GRTEQ num3):
largest IS num1!
NO?TRY (num2 GRTEQ num1) AND (num2 GRTEQ num3):
largest IS num2!
NO???:
largest IS num3!
SAY("The largest number is ", largest)!
num1=10num2=14num3=12if (num1>=num2) and (num1>=num3):
largest=num1elif (num2>=num1) and (num2>=num3):
largest=num2else:
largest=num3print("The largest number is", largest)
Multiplying Numbers in a Loop
Hyper!
Python
INT num IS 12!
LOOKAT INT i IN RANGE(1, 11):
SAY(num, "x", i, "=", num MULT i)!
num=12foriinrange(1, 11):
print(num, 'x', i, '=', num*i)
Finding the Even Number
Hyper!
Python
FUNC BOO isEven(INT num):
GIMME num MOD 2 EQUALS 0!