First Release of Night!
Night comes in both Windows and Linux binaries, which can be found at the bottom of this Release. You can also find some example code in the programs
directory.
Instructions on how to get started are in the Readme file.
Night supports,
- Arithmetic and Boolean expressions
- Arrays and basic array operations
- Variable declaration and assignment
- If, Elif, Else statements
- For and While Loops
- Functions
In the near future Releases, planned support includes,
- Classes
- File IO
- Imports
In addition, there are many behind the scenes features in Night, including,
- Type checking. This includes variable assignment, conditions in if statements, and function parameters and return values.
- Compile time array initialization. When creating an array with constant expression size, and an initializer list, then Night will automatically truncate the array if the initialized size is smaller than the initializer list size, or increase the array with default elements if the initialized size is larger than the initializer list size (
0
for numeric values and\0
for characters). Also works on multidimensional arrays! - Runtime array initialization. If an array size can not be evaluate at compile time, then it will be evaluated during runtime but initializer lists can not be used.
- Strings as mutable character arrays. Night also provides a built in
len()
function for all arrays including strings.input()
returns a character arrays. If passing a string to a function, the function can modify the original string. - Optimizes constant expressions. Constant expressions are optimized to a single constant value before bytecode generation. For example 2 + 3 will get turned into 5.
- Implicit type casting for arrays. During array initialization, constant expression elements will implicitly be type casted to the array’s type if both types are primitive, otherwise an error will occur. For example,
my_arr int[] = [ 2, 3.14 ]; // 2, 3
. - Some design decision justification. Can be found in
bytecode.hpp
. While this is the only one, it lays the foundation for more to come in future Releases, as well as better documentation overall.