Releases: XenLanguage/Xen
Xen v0.5.5
Xen v0.5.5 brings some new additions to the language.
Added
envnamespace with.args(array) and.argc(number) members.askeyword for casting primitive typesiskeyword for type-checking values at run timeErrortype
Xen v0.5.4
Xen v0.5.4 brings lots of bug fixes and reliability tweaks, as well as some new additions to the language.
Added
os.sleep()function for sleeping the current processUInt8Arraytype for storing byte sequencesdictionarynamespace and constructor withDictionary().len()to dictionaries
Changed
- Renamed
dictnamespace todictionary - Made all constructors capitalized:
number("10")->Number("10")
Fixed
- String literals get properly decoded now so
io.println("\n")will print an actual newline instead of a literal "\n" (as well as any other functions that accept string input) - Memory leaks from certain objects not getting properly destroyed
- Bug in token scanner when matching tokens
Xen v0.5.3
Added
netnamespace withTcpListenerandTcpStreamclasses:
include net;
var l = new net.TcpListener(8080);Changed
- Refactored builtin code and moved builtin namespace implementations to dedicated source files in src/builtin
Fixed
- Build system bugs
Xen v0.5.2
Xen v0.5.2 brings support to both x64 and ARM64 macOS systems, as well as some small bug fixes and improvements.
Xen v0.5.1
Added
- New methods to the
osnamespace:mkdir,rmdir,rm, andexists. - Arrow functions are valid inside of class bodies
Fixed
- Class
initbug where classes that had initializers would returnnullon construction. - General improvements to code
Xen v0.5.0
Added
- Classes (#2)
- Dictionaries (#3)
- A new
osnamespace with platform utilities such asos.exit()andos.exec() - Additional methods to the
ionamespace (io.clear,io.pause) - String character indexing with
[] - Line history to REPL (#9)
Changed
- Moved
readtxtandreadlinefromionamespace toosnamespace
Fixed
- Incorrect formatting when printing numbers (#8)
Known Bugs
- Segfault when executing a line of code immediately following a runtime error. This needs to be investigated further but I've narrowed down a
method for reproducing it consistently.
Xen v0.4.1
Changed
- Arrow functions no longer require a semicolon
;at the end of the function anymore:
// OLD
fn xadd(x) => ++x;
// needed here as well
// v
some_func(fn(x) => x / 2;, 100);
// NEW
fn xadd(x) => ++x
some_func(fn(x) => x / 2, 100);Xen v0.4.0
Xen 0.4 adds constructors, methods and properties, lambdas, and constant variable declarations. It also makes some breaking changes to the io namespace and adds syntactic sugar for single-line implicit return functions. The bulk of Xen's features have been implemented (or at least the foundation laid), so major updates won't be as frequent going forward. The goal now is to shift towards improving what's already been implemented and ensuring everything is robust before continuing to build more features.
Added
- Object methods and properties (i.e,
my_string.lenormy_array.push(69)). - Anonymous functions (lambdas).
- Arrow syntax
=>for single-line implicit return functions. - Additional methods to the
ionamespace for file reading (readtxtandreadlines). - Constructors for numbers, strings, booleans, and arrays.
- Constant variables with
const var.
Changed
- Array literals have a max size of 256 elements. Arrays can be dynamically resized to any size (up to your memory limit of course).
io.readlineis nowio.inputand accepts an optional string argument for prefix text.
Removed
Nothing.
Fixed
- Large numbers would print in scientific notation instead of displaying all digits. This was caused by the use of
%ginstead of%fin the correspondingprintfcall (see xvalue.c).
Known Bugs
- When indexing arrays, the parser doesn't recognize operations performed directly on the indexed object. For example,
my_arr[0]++does not work. Neither doesmy_arr[0]()in an array of function elements.
Xen v0.3.0
Xen 0.3 brings arrays to the table. At the moment they can only store up to 256 elements per array, but this is likely to change in the near future. Eight bits are just easier to work with when implementing and testing new features. Iteration can be achieved in a multitude of different ways, offering flexibility to the programmer. The array module has also been added that includes a lot of useful array operations such as len, first, last, index_of, join, and many more.
Added
- Array objects (
xen_obj_array) arraymodule
Changed
io.printlndoesn't add a space between each argument when printing anymoretypeofremains in the global namespace; everything else has been moved to specialized namespaces.
Removed
- Bytecode emission has been disabled for now
Fixed
-
Operator precedence incorrectly set to
PREC_NONEfor some tokens in the parse rules table. Settting these toPREC_CALLfixed the problem -
Xen object equality check was missing certain cases
Xen v0.2.0
This is the update that brings the bulk of Xen's features to life. Support has been added for:
- Control flow (
if/else,for/while) blocks andandorkeywords- Namespaces and object properties
- Package imports (
includekeyword) - Recursion
- Compound operators (
+=,/=,%=, etc.) - Iteration via C-style or range-based loops (
for(def; cond; iter)orfor(var in min..max)) - Pre- and post-fix operators for incrementing and decrementing values (
++x,x++,--x,x--)
A lot of work has also been spent developing Xen's standard library, which now boasts four modules: io, math, string, and datetime. Documentation for these will be coming in the near future. These can be
imported and used in Xen scripts like so:
include io;
io.println("Hello, Xen!");