Skip to content

Releases: quark-programming/quark

Quark 0.5 Pre-release

27 Feb 04:07

Choose a tag to compare

Quark 0.5 Pre-release Pre-release
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); // 7

In 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.1pre An 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.2pre Fixed an issue where using types that are in different structure declarations would generate a false non-trait error.
  • 0.5.3pre Fixed function type declaration order (section 1 to section 0)
  • 0.5.4pre Fixed 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.5pre New structure parser and complete support for private fields. Partial support for static keyword in structs.

Extra

Full Diff: 0.4.1...0.5.5pre

Quark 0.4.1

16 Jan 00:31
272a05e

Choose a tag to compare

Added the ability to specify multiple import directories using the -l (including the cwd)

What's Changed

  • multiple import directories by @ephf in #52

Full Changelog: 0.4.0b...0.4.1

Quark 0.4.0b

16 Jan 00:13
b2e412e

Choose a tag to compare

Added functions like print_i32 seen in the documentation, the negative - operator, and iMAX, uMAX, LongLong, and ULongLong types.

What's Changed

  • print_NUMBER() functions in lib::io + iMAX and uMAX types + ull and l… by @ephf in #51

Full Changelog: 0.4.0a...0.4.0b

Quark 0.4 Feature: Lambdas

16 Jan 17:54

Choose a tag to compare

Pre-release

Adds lambdas and function types,

int (int, int) add_lambda = int (int a, int b) => a + b;

What's Changed

  • update README with links to Quick Start by @ephf in #53

Full Changelog: 0.4.1...0.4.feat-lambda-1

Quark 0.4.0a

15 Jan 23:38
d1740ef

Choose a tag to compare

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

14 Jan 17:42
d75652c

Choose a tag to compare

Quark 0.3.2 Pre-release
Pre-release

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

14 Jan 14:10
600da6a

Choose a tag to compare

Quark 0.3.1c Pre-release
Pre-release

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.h

What's Changed

  • update .gitignore by @Angluca in #39
  • 0.3.1c With C Keyword Fix and Include Flag by @ephf in #45

Full Changelog: 0.3.1b...0.3.1c

Quark 0.3.1b

14 Jan 03:10
f1c64cb

Choose a tag to compare

Quark 0.3.1b Pre-release
Pre-release

See 0.3.1a

What's Changed

Full Changelog: 0.3.1a...0.3.1b

Quark 0.3.1a

14 Jan 03:04
c6daaf5

Choose a tag to compare

Quark 0.3.1a Pre-release
Pre-release

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

Full Changelog: 0.3.0...0.3.1a

Quark 0.3.0

07 Dec 21:04

Choose a tag to compare

Quark 0.3.0 Pre-release
Pre-release

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