Releases: brendanfh/onyx
Releases · brendanfh/onyx
Array Literals (and other core changes)
Release v0.0.5
Additions:
- array literals; use
(type).[ (vals) ]
as the syntax; They work as global variables, and
local variables, and as intermediates (such as function arguments). - polymorphic procedures can be instantiated in many more places now due to clean up.
- added
#context_scope
block. It automatically stores and restores the context at the beginning
and the end of the block respectively. use
statements work on pointers to structures.--fun
flag displays a bar graph of where each of the entities in the compilation
pipeline are. Compiles the program slower purely to make it look better.--verbose
prints statistics about the compilation including time taken, lines
processed and token processed.abs
function in core/math.onyx.read_word
in core.string.reader.- Better error reporting for invaild binary operators.
Removals:
- field accesses on things that are not lvals. This was a bug anyway, so it
should not require any code changes, but the feature is gone. - i32map, strmap, ptrmap modules. Use generic map in map.onyx instead.
Changes:
- BREAKING: The type name
string
, and the package namestr
, have been swapped. use
statements are more powerful.use package
can occur at any scope level,
anduse <value>
can occur at file scope.- struct literals can now have arbitrary package prefixes on them, i.e.
some.deeply.nested.packages.Struct.{ ... };
- struct literals can have arbitrary expressions as their type, i.e.
(#type [] void).{ ... };
- cleaned up CLI
- assignment over an array type copies the array instead of just the pointer.
Bug fixes:
- globals that were #foreign caused several bugs, which have been squashed.
- field accesses can only happen on lvals.
- Bitwise NOT on unsigned integers did not work.
- 'use' statements now work in polymorphic procedures
- resizing heap allocated memory at the end of memory would not grow underlying memory.
- stack position variables introduced from for loops, ifs, whiles, or switchs would produce
very bad side effects if they were not in a stack based function. - array.remove was broken when the semantics of
for: lo .. hi
changed.
Core Rewrites
Release v0.0.4
Additions:
- Ability to pass complicated structs by value. Very useful in polymorphic data types.
- bitwise not operator, ~
- auto cast operator, ~~. In many circumstances, will automatically determine what to cast to.
- Will also report errors in the cast is not possible.
- Arbitrarily typed varargs. They behave similar to C-style varargs.
- vararg_get builtin procedure to retrieve a value from a ... vararg.
- #private_file directive for placing a symbol at file scope.
- a basic implentation of printf in the standard library.
- use statements at the function level.
- nested packages, i.e. 'core.array'
- Still testing it out; could change at in the future
- basic printf implementation
- core.str.reader library
Removals:
Changes:
- Massive renaming of packages, since nested packages are now allowed.
- Most collections of function simply were put into a package, instead of being prefixed,
i.e. array_map -> array.map
- Most collections of function simply were put into a package, instead of being prefixed,
- Numeric literals now no longer have a concrete type; they become whatever type is needed,
reporting an error if that is not possible. - Procedure definitions now require parentheses, even if there are no arguments. This was
done to allow forproc { foo, bar }
to be the overload syntax. - array.map takes an arbitrary parameter of polymorphic type to make up for the fact that
anonymous procs do not have closure. New type signature is:
array_map :: proc (arr: ^[..] $T, data: $R, f: proc (T, R) -> T) - better syntax highlighting for VIM.
- Compiler internals changed to make it easier to do advanced things in the future.
Bug fixes:
- many bugs related to var args and procedure calls in general.
- polymorphic structs caused segmentation fault when trying to produce an error message.
- polymorhpic structs caused scope to change when using a struct literal of a polymoprhic type.
- #char """ did not work.
- nested function calls returning non-basic types would simply be wrong.
- Recursive structs are no longer possible.
- For loop array/slice/dynarray used to use signed indicies, which was wrong.
Polymorphic Structs
Release v0.0.3
Additions:
- Added polymorphic structs.
- Added polymorphic structs to polymorphic pattern matching.
- Added I32Map polymorphic structure to core library.
- Added println to core library; print followed by a newline.
- Added tests/ folder and runtests.sh which will compile and execute the programs in the
folder and test against their expected output. - #private_file for specifying symbols at the file scope.
Removals:
Changes:
- BREAKING: 'use package' now places included symbols at the file scope, not package scope.
- Switched to using TCC as the primary compiler, while maintaining support for GCC.
- boolean literals are compile time known so they can be used at top level.
- #file_contents now results in [] u8, not *u8.
Bug fixes:
- Fixed error message index for struct literal member type mismatch.
- Added struct member name in struct literal member type mismatch.
- Fixed freeing non-allocated memory when generating documentation.
- Fixed alignment issue with struct members.
SIMD Intrinsics
Introduces the very basics of SIMD intrinsics as specified by https://webassembly.github.io/simd/. Although most browsers do not support it yet, it is a feature that will be very useful in the future.
Initial Release
This is the first release of the Onyx compiler. It is by no means production ready. It does not have Windows or MacOS support and undoubtedly has many, many bugs. Use at your own risk.