Releases: quark-programming/quark
Quark 0.5 Pre-release
Quark 0.5 Pre-release Changlog
- Major changes to the generics system for improved type following
- New module system instead of the previous
#include-like system - Partial support for function lambdas and function types
- Unused declarations no longer compile, giving you a smaller output file without redundant symbols
Generics Changes
Although a lot has changed behind to scenes to make generics more smooth to write, no syntactical changes have been made. The next big change to generics would be in the form of generics operators #35, but this feature may not be implemented in the first 0.5.0 full release.
Generics were split into left and right so binary operations can no longer have mismatching generics metadata when types are being matched together. Much of the logic for autos has also be slightly reworked to simplify the process and make it easier to debug.
Module System
Important
Due to the changes with the module system, the $QUARK_ROOT/$QUARK_LIB has changed from the root of the cloned repo to lib/. (use -l $QUARK_LIB)
# New .basrch or .zshrc
export QUARK_ROOT="/aboslute/path/to/SDK/quark"
export QUARK_LIB="$QUARK_ROOT/lib"
export PATH="$PATH:$QUARK_ROOT"Quark now tracks modules and relative file paths instead of copy and pasting source files into the parser. Along with the reworked import statement, there is now the private keyword which currently only works on function and variable declarations to make them file specific.
To demonstrate the changes, lets say we have a file layout like this, where utils is a folder and the entry point is main.qk:
# utils
\_ * math.qk
* print.qk
* main.qk
We can start by creating a hello() function in print.qk,
// print.qk
void hello() {
print("Hello World!");
}We can import the print module strait from the entry file without any configuration:
// main.qk
import print;
print::hello(); // Hello World!Similarly, you can import a file within a folder. I'll make an add() function to demonstrate this
// utils/math.qk
i32 add(i32 a, i32 b) {
return a + b;
}// main.qk
import utils::math;
i32 sum = math:add(3, 4); // 7In import statements, you can also specify which functions to import, or all using a wildcard,
// main.qk
import print::{ hello };
import utils::math::*;Functions can be specified as private using the private keyword. Note that regular imports and selective imports using curly brackets are private by default while wildcard imports are public.
// This function cannot be used outside of its enclosing file
private str get_password() {
return "MyP4s5w0rd!";
}Function Types and Lambdas
Quark now has better support for compiling function types and allows you to specify them using a nameless function with nameless arguments,
i32 (i32, i32) sum_function = /* ... */;You can specify a lambda in the same way using argument names and a => or {:
auto sum = i32 (i32 a, i32 b) => a + b;
auto say_hello = void () {
print("Hello!");
}Its important to note that, at their current stage, function lambdas cannot access external context,
void () curry(i32 number) {
return void () {
print_i32(number); // will not work
}
}Fixes
0.5.1preAn issue with modules using their reference in a volatile vector structure has been fixed, this issue may have made it impossible to run the compiler.0.5.2preFixed an issue where using types that are in different structure declarations would generate a false non-trait error.0.5.3preFixed function type declaration order (section 1 to section 0)0.5.4preFixed a couple of seg-faults caused by error paths, fixed an issue where some structures wouldn't produce their declarations, and fixed the>>token not working in generics.0.5.5preNew structure parser and complete support forprivatefields. Partial support forstatickeyword in structs.
Extra
Full Diff: 0.4.1...0.5.5pre
Quark 0.4.1
Added the ability to specify multiple import directories using the -l (including the cwd)
What's Changed
Full Changelog: 0.4.0b...0.4.1
Quark 0.4.0b
Added functions like print_i32 seen in the documentation, the negative - operator, and iMAX, uMAX, LongLong, and ULongLong types.
What's Changed
Full Changelog: 0.4.0a...0.4.0b
Quark 0.4 Feature: Lambdas
Adds lambdas and function types,
int (int, int) add_lambda = int (int a, int b) => a + b;What's Changed
Full Changelog: 0.4.1...0.4.feat-lambda-1
Quark 0.4.0a
Addition of operator overrides,
struct Slice<T> {
Operator::index(self, usize size) { /* ... */ }
}
[i32] x = [1, 2, 3];
i32 first = x[0];What's Changed
- Add Screenshot to README by @ephf in #48
- Operator Overrides and Structure References by @ephf in #49
- 0.4.0a (untested) by @ephf in #50
Full Changelog: 0.3.2...0.4.0a
Quark 0.3.2
Minor bug fixes and righthand casting
u32 value = 15;
i32 x = value.(i32);What's Changed
Full Changelog: 0.3.1c...0.3.2
Quark 0.3.1c
Fixed issues with identifiers overlapping with C keywords and added -i flag to specify external C includes.
./qc [...] -i my_lib.h -i my_other_lib.hWhat's Changed
Full Changelog: 0.3.1b...0.3.1c
Quark 0.3.1b
Quark 0.3.1a
Major compiler overhauls and overall more stable build. 0.3.1a is being released in preparation for 0.3.1-stable
Important
The later release 0.3.1b, has a few minor, but very necessary fixes.
What's Changed
- Many Small improvements by @zhrexx in #2
- Add help -h and unwrap_or by @Angluca in #15
- Dev by @ephf in #18
- Merge pull request #18 from quark-programming/dev by @ephf in #19
- Revise security policy and reporting guidelines by @ephf in #23
- update makefile by @Angluca in #20
- Major bug fixes and compiler re-writes + a couple small features by @ephf in #41
New Contributors
- @zhrexx made their first contribution in #2
- @Angluca made their first contribution in #15
- @ephf made their first contribution in #18
Full Changelog: 0.3.0...0.3.1a
Quark 0.3.0
Added builtin Option<T> syntax using the? operator along with optional coalescing.
i32? /* same as */ Option<i32>
i32? maybe_number = Option::Some(15);
struct Struct {
i32 field;
void method(self) {}
}
Struct? object = Option::None();
i32? field = object?.field;
object?.method();
Full Changelog: 0.2.1...0.3.0