[
+ {
+ "name": "Beta Release 0.1.8",
+ "path": "release-0.1.8",
+ "date": "28th November 2023",
+ "description": "This is an exciting release for Onyx! It is the first release to ship with MacOS support and an automated installer. It also brings many improvements to package management and the general ergonomics of the language."
+ },
{
"name": "Beta Release 0.1.7",
"path": "release-0.1.7",
--- /dev/null
+<h2>MacOS Support</h2>
+<p>
+Onyx finally has first class support for MacOS!
+Onyx ships with natively compiled AMD64 and ARM64 binaries, which can be
+easily installed on your system (see below).
+</p>
+
+<p>
+Some of the native libraries may not be working just yet, as the were not
+originally designed for MacOS. This should be easy to fix, by changing how
+these libraries are built and linked on the host system on a per library basis.
+</p>
+
+<h2>Single install script</h2>
+<p>
+Onyx is now very easy to install. Simply run this command on your Linux or
+MacOS machine, and let the install do its magic.
+</p>
+
+<pre class="hljs"><code class="language-sh">sh <(curl https://get.onyxlang.io -sSfL)</code></pre>
+
+<p>
+Onyx will be installed in your HOME directory, at <code>~/.onyx</code>.
+You will be prompted add Onyx to your path, and to define the <code>ONYX_PATH</code> environment variable, which is how Onyx knows where it is installed on your system. If you want to move it somewhere else, make sure you change your <code>ONYX_PATH</code>.
+</p>
+
+<h2>Package manager changes</h2>
+<p>
+Onyx's package manager saw a big renovation in this release.
+The most noticeable fact is that it now use <code>.kdl</code> instead of <code>.ini</code> files.
+<a href="https://kdl.dev">KDL</a> files offer more flexibility and future proofing compared to the old format. Not to mention, they look a lot better.
+</p>
+
+<p>
+To migrate existing projects using the old format, simply run this command.
+</p>
+
+<pre class="hljs"><code class="language-sh">onyx package migrate</code></pre>
+
+<p>
+Because this conversion is a lossless transition, there should be no problems do the migration on any project.
+</p>
+
+<h2>Minor library changes</h2>
+<p>
+Because this release mostly focused on things outside of the core libraries of Onyx, there is not much to say for new things in the core library. However, there is one thing: the start of a <strong>Memory Debugger</strong>!
+</p>
+
+<p>
+While in its early phases, this memory debugger can let you receive information about every allocation, reallocation, or free in your code base.
+You can use this information to figure out places that leaking memory, or potentially using memory after its been freed.
+</p>
+
+<p>
+There is development on a memory debugger tool for this purpose that should be available soon. However, I didn't want to withhold memory debugger allocator in case someone else can make something cool with.
+</p>
+
+<h2>Full Changelog</h2>
+<pre>
+Additions:
+- MacOS compatibility
+ - Using Wasmer runtime, MacOS on ARM and AMD64 are supported.
+- Memory debugger
+ - A custom allocator that intercepts allocations and frees and reports them
+ to a client for visualizations and debugging.
+- New installation script
+ - sh <(curl https://get.onyxlang.io -sSfL)
+ - Works on Linux and MacOS
+- KDL document parsing support
+ - Used as the new format for the package manager.
+ - See https://kdl.dev for details
+- `os.chdir` for changing the current directory
+ - Supported on WASIX and Onyx runtime
+- `os.getcwd` for getting the current directory
+ - Supported on WASIX and Onyx runtime
+- Basic build configurations into package manager.
+ - Configure sources files, runtime, target file,
+ included files, and CLI arguments
+ - Multiple configurations per project.
+ - Build with 'onyx package build <config_name>'
+
+Removals:
+
+Changes:
+- Simplified using union variants of type `void`.
+ - Now instead of `.{ Foo = .{} }`, use `.Foo` instead.
+- Renamed `--no-std` flag to `--no-core`, since Onyx does not call its standard
+ library "std", the name did not make any sense.
+- `net.make_ipv4_address` now has a reasonable definition using a string for the IP,
+ instead of an integer.
+
+Bugfixes:
+- Formatting of days and months were incorrect `time.strftime`.
+- Infinite loop in TCP server when a client disconnects.
+</pre>
+
@media (max-width: 799px) {
:root {
--default-flex-direction: column;
- font-size: 12pt;
+ font-size: 10pt;
}
}
a {
color: var(--text);
- text-decoration: underline;
+ text-decoration: none;
+ border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
a.link-button {
padding: 8px;
border-radius: 4px;
text-decoration: none;
+ border-bottom: none;
background-color: var(--primary);
transition: all 300ms;
position: relative;
}
a.link-button:hover {
- top: -6px;
+ /* top: -6px; */
box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2);
cursor: pointer;
}
}
a.cta-button:hover {
- top: -6px;
+ /* top: -6px; */
box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2);
cursor: pointer;
}
}
.container.header {
+ top: -80px;
+ padding-top: 160px;
position: relative;
- /* background: var(--header-color); */
color: var(--header-text);
+ background: url(/static/images/header-background.png);
+ background-position: bottom;
}
@media screen and (min-width: 800px) {
/* Navigation */
@media screen and (min-width: 800px) {
.navbar-container {
- position: sticky;
+ position: relative;
+ background: none;
+ color: var(--text);
top: 0;
z-index: 1000;
- background-color: var(--accent-background);
- color: var(--text);
width: 100%;
}
@media screen and (max-width: 799px) {
.navbar-container {
- background-color: var(--accent-background);
+ position: relative;
+ background: none;
color: var(--header-text);
width: 100%;
margin: 0 auto;
+ top: 0;
+ z-index: 1000;
}
}
navbar a {
color: var(--header-text);
text-decoration: none;
+ border-bottom: none;
}
@media (min-width: 800px) {
display: block;
padding: 2px 0;
text-decoration: none;
+ border-bottom: none;
color: var(--accent);
}
#homepage-logo #path537 { transform: translate(24px, 0); }
#homepage-logo #path1062 { transform: translate(24px, 0); }
#homepage-logo #path274 { transform: matrix(0.307405,0,0,0.303728,47.782897,16.545361); }
-#homepage-logo #path67 { transform: matrix(0.14795386,0,0,0.14795386,29.382719,1.6710591); }
+#homepage-logo #path67 { transition: opacity 0s, transform 1s; transform: matrix(0.14795386,0,0,0.14795386,29.382719,1.6710591); }
#homepage-logo:hover #path31 { transform: translate(33.5px, -2.5px) rotate(60deg); }
#homepage-logo:hover #path1180 { transform: translate(46.25px, 7px) rotate(120deg); }
#homepage-logo:hover #path537 { transform-origin: center; transform: rotate(150deg) translate(6.7px, -10.1px); }
#homepage-logo:hover #path1062 { transform: translate(48px, 2px) rotate(90deg); }
#homepage-logo:hover #path274 { transform: matrix(0.307405,0,0,0.303728,34.782897,16.545361); }
-#homepage-logo:hover #path67 { opacity: 0; }
+#homepage-logo:hover #path67 { opacity: 0; transform: matrix(0.14795386,0,0,0.14795386,100.382719,-1000.6710591); }
@media (max-width: 799px) {
#mobile_logo {
#desktop_logo {
display: none;
}
+
+ .copy-button {
+ display: none;
+ }
}
#install-command .copy-button {
#install-card {
width: 800px;
}
-}
-.homepage-quicklinks {
- z-index: 10000;
- position: relative;
- max-width: 1200px;
- margin: 0 auto;
-
- text-align: right;
-}
-
-.homepage-quicklinks a {
- flex: 1;
- display: inline;
- text-align: center;
+ #homepage-header {
+ top: -50px;
+ }
}
-.homepage-quicklinks a span {
- display: inline-block;
- margin: 4px;
- padding: 8px 20px;
- transition: all 0.3s;
+#homepage-header {
+ position: relative;
}
-.homepage-quicklinks a span:hover {
- cursor: pointer;
- background-color: var(--header-accent);
- /* box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2); */
-}
+@media screen and (min-width: 800px) {
+ .scrollport {
+ mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%);
+ -webkit-mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%);
-.scrollport {
- mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%);
- -webkit-mask-image: linear-gradient(to right, #0000 0, #000 10%, #000 90%, #0000 100%);
+ overflow-x: auto;
+ overscroll-behavior-x: contain;
- overflow-x: auto;
- overscroll-behavior-x: contain;
+ display: flex;
+ gap: 100px;
+ align-items: start;
+ padding: 0 100px;
+ padding-bottom: 32px;
+ }
- display: flex;
- gap: 100px;
- align-items: start;
- padding: 0 100px;
- padding-bottom: 32px;
+ .scrollport > div {
+ min-width: 1000px;
+ }
}
table {
-webkit-mask-image: var(--header-color);
}
-.scrollport > div {
- min-width: 1000px;
-}
-
::-webkit-scrollbar{
width: 8px;
}
</div>
<div class="container">
- <h2>Getting Started</h2>
+ <div class="title">
+ <h2>Getting Started</h2>
+ </div>
+
<p>
Install Onyx locally on your system and write your first program.
</p>
- <p>
- <a class="link-button" href="/docs/getting_started">Getting Started</a>
- <a class="link-button" href="/docs/install">Install</a>
- <a class="link-button" href="/docs/setup">Environment Setup</a>
- </p>
+ <ul>
+ <li><a href="/docs/getting_started">Getting Started</a></li>
+ <li><a href="/docs/install">Install</a></li>
+ <li><a href="/docs/setup">Environment Setup</a></li>
+ </ul>
</div>
<div class="container">
- <h2>Learn</h2>
+ <div class="title">
+ <h2>Learn</h2>
+ </div>
+
<p>
Learn the core ideas behind programming in Onyx, and how to use developer tooling.
</p>
- <p>
- <a class="link-button" href="/docs/guides">Guides</a>
- <a class="link-button" href="/docs/packages">Package Manager</a>
- <a class="link-button" href="https://docs.onyxlang.io/book">Language Reference</a>
- </p>
+ <ul>
+ <li><a href="/docs/guides">Guides</a></li>
+ <li><a href="/docs/packages">Package Manager</a></li>
+ <li><a href="https://docs.onyxlang.io/book">Language Reference</a></li>
+ </ul>
</div>
<div class="container">
- <h2>Package Reference</h2>
+ <div class="title">
+ <h2>Package Reference</h2>
+ </div>
<p>
Reference material for all packages shipped with the Onyx toolchain.
</p>
- <p>
- <a class="link-button" href="https://docs.onyxlang.io/packages/core">Core packages</a>
- <a class="link-button" href="/docs/packages/list">External packages</a>
- </p>
+ <ul>
+ <li><a href="https://docs.onyxlang.io/packages/core">Core packages</a></li>
+ <li><a href="/docs/packages/list">External packages</a></li>
+ </ul>
</div>
{{ endblock }}
<div class="container">
<h2>Run your program!</h2>
- <p>To run the program our newly created program, we use the following command from within the project folder.</p>
+ <p>To run our newly created program, we use the following command from within the project folder.</p>
<pre class="hljs"><code class="language-onyx">$ onyx run main.onyx
Hello, Onyx!</code></pre>
// Create a new window
raylib.InitWindow(1200, 900, "Raylib Example");
+ // Limit FPS to 60
+ raylib.SetTargetFPS(60);
+
while !raylib.WindowShouldClose() {
// Start drawing
raylib.BeginDrawing();
<p>
Let's expand your simple window testing program by making a (very simple) game.
- In this game, you will control a character, and your job is to run to a checkpoint,
+ In this game, you will control a character, and your job is to go to a checkpoint,
but in your way will be random mines that you need to avoid.
</p>
score: i32;</code></pre>
<p>
- Next, you can add some code to reset the game state in <code>resetGame</code>, generate new mines
- and move the checkpoint in <code>moveCheckpointAndSpawnMines</code>.
+ Next, you can add some code to reset the game state in <code>resetGame</code>, and spawn new mines and move the checkpoint in <code>moveCheckpointAndSpawnMines</code>.
</p>
<pre class="hljs"><code class="language-onyx">resetGame :: () {
<p>
The above uses a couple of utility functions that you need to write.
- The first one checks if a mine that is going to be place collides with
+ The first one checks if a mine that is going to be placed collides with
the checkpoint or the player.
</p>
This iterator never ends, and will infinitely produce random mines.
When combined with <code>iter.skip_while</code>, you can easily
find the first mine that meets a constraint.
- In this case, the first mine thatis infinite does not collide with the checkpoint
+ In this case, the first mine that does not collide with the checkpoint
or the player.
</p>
// Create a new window
raylib.InitWindow(1200, 900, "Raylib Example");
+ // Limit FPS to 60
+ raylib.SetTargetFPS(60);
+
while !raylib.WindowShouldClose() {
// Update player based on keys pressed
dt := raylib.GetFrameTime();
<p>
When you publish a package using <code>onyx package publish</code>, it simply increments the version number in the package file,
commits that change, creates a new tag at that commit, and pushes all changes and tags to the Git server.
- When someone else runs <code>onyx package update</code>, the new version will be found and updated to.
</p>
+
+ <p>
+ When someone else runs <code>onyx package update</code>, all packages will be updated to their newest compatible version.
+ </p>
+
+ <blockquote style="margin-top: 8px">
+ Do note that, in order to use Onyx's package manager, you <strong>MUST</strong> have Git installed and it must be in the PATH.
+ </blockquote>
</div>
<div class="container">
{{ let navbar_page = "home" }}
{{ let navbar_logo_hidden = true }}
-{{ let navbar_hidden = true }}
{{ block "page_content" }}
-<div style="position: relative">
+<div id="homepage-header">
<canvas id="animation"></canvas>
- <div class="homepage-quicklinks">
- <a target="_blank" href="https://try.onyxlang.io"><span>Try Onyx</span></a>
- <a href="/docs"><span {{ if navbar_page == "docs" }} class="active" {{ endif }}>Docs</span></a>
- <a href="/news"><span {{ if navbar_page == "news" }} class="active" {{ endif }}>News</span></a>
- <a href="https://github.com/onyx-lang/onyx" target="_blank"><span>GitHub</span></a>
- </div>
-
- <div class="container header" style="z-index: 100; background: none">
- <div style="height: 20rem; display: flex; flex-direction: column; place-content: center;">
+ <div class="container header" style="z-index: 100; background: none; position: relative">
+ <div style="display: flex; flex-direction: column; place-content: center;">
<svg viewBox="0 0 64 16" version="1.1" alt="Onyx Logo" id="homepage-logo">
{% partial "partials/logo_svg" %}
</svg>
<h1>The <b>Onyx</b> Programming Language</h1>
</div>
<div style="font-size: 20pt; text-align: center; margin-top: 8px">
- <p>A data-oriented, safe, and modern programming language</p>
+ <p>A data-oriented, expressive, and modern programming language</p>
</div>
</div>
<div style="font-size: 14pt; font-family: fira; padding: 20px;">
<div><span style="color: #444;">$</span> <span style="font-style: italic; color: #99a;"># Install Onyx in one command</span></div>
<div id="install-command">
- <span style="color: #444;">$</span> <span style="color: var(--accent)">sh</span> <(curl https://get.onyxlang.io -sSfL)
+ <span style="color: #444;">$</span> <span style="color: var(--accent)">sh</span> <(curl https://get.onyxlang.io -sSfL)
<span class="copy-button">Copy</span>
</div>
<div><span style="color: #444;">$</span> <span style="font-style: italic; color: #99a;"># Read the docs</span></div>
<div>
<h2>Fast Compilation</h2>
<br />
- <p>Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in <b>49 milliseconds</b>.</p>
+ <p>Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in <b>47 milliseconds</b>.</p>
</div>
- <pre class="hljs"><code>$ onyx build -V ./src/app.onyx
+ <pre class="hljs"><code class="language-sh">$ onyx build -V -r wasi -DWASIX -o site.wasm build.onyx
File search path:
- /usr/share/onyx
- .
+ /home/brendan/.onyx
+ .
-Type table size: 131244 bytes.
+Type table size: 151092 bytes.
Foreign blocks size: 8 bytes.
-Tagged procedure size: 504 bytes.
+Tagged procedure size: 840 bytes.
Tagged global size: 8 bytes.
Statistics:
- Time taken: 49.000000 ms
- Processed 20607 lines (420551.031250 lines/second).
- Processed 107338 tokens (2190571.500000 tokens/second)
-</code></pre>
+ Time taken: 47.000000 ms
+ Processed 22144 lines (471148.937500 lines/second).
+ Processed 115240 tokens (2451915.000000 tokens/second).
+
+Outputting to WASM file: site.wasm</code></pre>
</div>
<div>
let ctx = canvas.getContext("2d", {alpha: false});
ctx.imageSmoothingEnabled = false;
+ let columns = 0;
+ let rows = 0;
+
function resize() {
let rect = canvas.getBoundingClientRect();
+ columns = Math.ceil(rect.width / 24);
+ rows = 19 - (canvas.width > 800 ? 0 : 2);
+
canvas.width = rect.width;
canvas.height = rect.height;
ctx.fillStyle = '#060609';
let even = true;
function draw() {
even = !even;
- for (let y = 0; y < 18; y++) {
- for (let x = 0; x < 100; x++) {
+ for (let y = 0; y < rows; y++) {
+ for (let x = 0; x < columns; x++) {
if (even == ((x + y) % 2 == 0)) continue;
- if (y > 10 && (y + x % 11 + x % 3) - 16 > x % 6) continue;
+ if (y > 11 && (y + x % 11 + x % 3) - 16 > x % 6) continue;
let v = noise.get(x / 10, y / 10, Date.now() / 2500) * 3 - 1.5;
let r = 6 * (1 - v) + 56 * v;
drawHex(x, y, `rgba(${r}, ${r}, ${r * 1.5}, 1)`);
</div>
<span>
- Data-oriented, safe, and modern programming language for application development.
+ Data-oriented, expressive, and modern programming language for application development.
</span>
</div>
+{{ let homepage = false }}
+{{ if navbar_logo_hidden == true }}
+ {{ let homepage = true }}
+{{ endif }}
<div class="navbar-container">
<navbar>
- {{ if navbar_logo_hidden == true }}
- {{ else }}
+ {{ if homepage == false }}
<a href="/" aria-label="Go to the homepage">
<svg viewBox="0 0 64 16" version="1.1" id="desktop_logo" alt="Onyx Logo">
{% partial "partials/logo_svg" %}