This is a list of significant differences between Nova and the current v1a1.5 release of the official Kepler implementation. Most functional Kepler programs will likely run in Nova as is, or only require small modifications to account for the changes. Most of the changes are fixes to bugs or other strange behavior in Kepler, but some changes are made since the original behavior is difficult to implement when compiling to native code. Some bugs are intentionally replicated in Nova, particularly ones that are easy to re-implement and may cause errors if fixed.
- In Kepler, unsigned int literals are incorrectly parsed as if they were signed. For example,
u-1is a valid literal butu2147483648is not. Nova fixes this so unsigned literals are valid in the range fromu0tou4294967295. - In Kepler, tokens that start with a digit are invalid
Generictokens, whereas most other characters will be parsed as a valid variable. For example,.1x,-2x, and==xare valid identifiers but0xis not. The same is true for float or signed integer literals that are outside of their representable range. In Nova, identifiers can start with a digit, and out of range signed number values will parse as float (possibly ±inf). - In Kepler, quote characters are not allowed in strings, but they will be included in the string if it is the first character. For example,
"Quote ""and"Inside"Me"are invalid, but"""and"" + "are valid strings with the values"and" + ". Nova fixes this so that quotes cannot be used anywhere in a string. - Kepler multiline comments will comment out the rest of the line that they end on if there's code after it, which is possibly a bug, but this behavior is kept in Nova. However Nova allows for singleline or multiline comments to be started inline, while the current Kepler version will give an error in this case.
- In Kepler, variables declared as
Constantwill allow reassignment when the value is a literal, and won't allow a later first initialization if it is an expression. Nova changes this so that constants allow any first assignment, but none afterwards. (Multiple values in the same statement are allowed.) - Kepler type declarations do not have any actual effect on the type of a variable; a variable's type is only set when a value is assigned. In Nova, a prior type declaration must match the type when initializing a value, but later contradicting type declarations without a value or in a declaration with a value are allowed, and will have no effect.
- In Kepler,
NaNis a separate type, and so variables with the valueNaNcannot be reassigned to a different value, andNaNcannot be assigned to an already assigned variable. This means that you will get a type error for statements likevar is 1/0followed byvar is 1/2since the variable's type can depend on the values of arguments, which is possibly an oversight. Additionally, since whether a value isNaNcan depend on user input, it can't always be determined prior to program execution. Because of this, Nova does not implement theNaNtype. Instead, the standard floating point NaN is used for Float calculations, and other calculations that would result inNaNwill instead error, which would be likely to happen upon later use of the value regardless. - In Kepler, a name can simultaneously be assigned to both a variable an a function, giving the variable value in expressions and the function value in calls. Nova gives an error if a name has both function and variable declarations.
- Kepler often casts Strings or Floats through other types intermediately when being converted for casts or comparisons, and will sometimes fail even if the operation could work directly. Most of these casts are replicated in Nova, but Float to Bool conversions are done directly and will work regardless of the Float's size rather than throwing an error when out of Int range.