defer delete(&contents);
res->render("pages/news_article", &.{
- article = .{ contents = contents, name = article.name }
+ article = .{ contents = contents, name = article.name, description = article.description }
});
} else {
logger := http.server.logger(style=.V2);
pipes->pipe(&logger);
- app := http.server.tcp(pipes, .{ thread_count = 4 });
- app->serve(8081);
+ app := http.server.tcp(pipes, .{ thread_count = 0 });
+
+ port := conv.parse_int(os.env("SERVER_PORT") ?? "8000");
+
+ app->serve(~~port);
println("Server stopping...");
}
"name": "Beta Release 0.1.7",
"path": "release-0.1.7",
"date": "25th October 2023",
- "description": "Onyx's beta 0.1.7 release"
+ "description": "This release of Onyx brings exciting and overdue features, including switch expressions, WASIX support and an overhauled networking layer."
},
{
"name": "Beta Release 0.1.6",
"path": "release-0.1.6",
"date": "24th September 2023",
- "description": "Onyx's beta 0.1.6 release"
+ "description": "There has not been a new release of Onyx in several months. I have been working on other projects (using Onyx!) and have not had the time needed to dedicate to new features in the language. That being said, Onyx already has many of the features that I need for my projects, so I have not felt the need to add new features. However, I have been fixing bugs and blatant wrong implementations of core library procedures that have been getting in my way. Enough of these have accumulated over the past couple of months that I believe it is worth it to publish them in a new bugfix release."
},
{
"name": "Beta Release 0.1.5",
"path": "release-0.1.5",
"date": "18th July 2023",
- "description": "Onyx's beta 0.1.5 release"
+ "description": "This release brings additions to Onyx's platform layer, allowing for missing things like <em>futexes</em> and TTY control."
},
{
"name": "Beta Release 0.1.4",
"path": "release-0.1.4",
"date": "22nd June 2023",
- "description": "Onyx's beta 0.1.4 release"
+ "description": "This is a small release that brings a <strong>big breaking change</strong> to most Onyx programs. In short, <code>map.get</code> now returns an <em>Optional</em>, instead of the value directly. This leads to cleaner and more understandable code."
},
{
"name": "Beta Release 0.1.3",
"path": "release-0.1.3",
"date": "18th June 2023",
- "description": "Onyx's beta 0.1.3 release"
+ "description": "This release of Onyx brings a large change to the compile-time code blocks feature, runtime stack traces, as well as a massive speedup to Onyx's <code>ovmwasm</code> runtime. There are also numerous additions to the standard library."
},
{
"name": "Beta Release 0.1.2",
"path": "release-0.1.2",
"date": "28th May 2023",
- "description": "Onyx's beta 0.1.2 release"
+ "description": "This release of Onyx brings a substantial new feature called <em>tagged unions</em>, and a collection of other small bugfixes."
},
{
"name": "Beta Release 0.1.1",
"path": "release-0.1.1",
"date": "15th May 2023",
- "description": "Onyx's beta 0.1.1 release"
+ "description": "This release of Onyx brings minor changes and additions, with some general bugfixes."
},
{
"name": "Onyx's Custom Runtime",
-<h1>Onyx's Custom Runtime</h1>
-
<p>
As Onyx targets WebAssembly (WASM) exclusively, running code outside of the browser requires a <a href="https://webassembly.github.io/spec/core/appendix/embedding.html">WASM embedder</a>.
The job of the embedder is to translate the WASM Virtual Instruction Set Architecture into a "real" architecture that can be executed on the host system.
-<h1>Beta Release 0.1.1</h1>
-
-<p>
- This release of Onyx brings minor changes and additions, with some general bugfixes.
-</p>
-
<h2>WASI Improvements</h2>
<p>
Much of the work done in this release was focused on improving the support of the <a href="https://wasi.dev">WASI</a> runtime.
-<h1>Beta Release 0.1.2</h1>
-
-<p>
- This release of Onyx brings a substantial new feature called <em>tagged unions</em>, and a collection of other small bugfixes.
-</p>
-
<h2>Tagged Unions</h2>
<p>
Tagged unions are a big addition to the type system in Onyx, as they allow you to represent a new <em>kind</em> of type.
-<h1>Beta Release 0.1.3</h1>
-
-<p>
-This release of Onyx brings a large change to the compile-time code blocks feature, runtime stack traces, as well as a massive speedup to Onyx's <code>ovmwasm</code> runtime. There are also numerous additions to the standard library.
-</p>
-
<h2>Code blocks with captures</h2>
<p>
Code blocks have always been a very powerful feature of Onyx, especially when combined with macros. Most of the <code>core.slice</code> library is builtin around using code blocks. However, they were always a little weird, as you had to use the name of the variable as it was prescribed by the procedure you were calling. Look at <code>core.slice.fold</code> as an example.
-<h1>Beta Release 0.1.4</h1>
-
-<p>
-This is a small release that brings a <strong>big breaking change</strong> to most Onyx programs.
-In short, <code>map.get</code> now returns an <em>Optional</em>, instead of the value directly.
-This leads to cleaner and more understandable code.
-</p>
-
-<p>
-The Onyx package manager also sees a small update in the outputted library directory when packages are synchronized.
-Assuming you are using the provided <code>packages.onyx</code> file, this should be a transparent change.
-</p>
-
<h2>Map uses Optional</h2>
<p>
-<h1>Beta Release 0.1.5</h1>
-
-<p>
-This release brings additions to Onyx's platform layer, allowing for missing things like <em>futexes</em> and TTY control.
-</p>
-
<h2>Futexes</h2>
<p>
-<h1>Beta Release 0.1.6</h1>
-<p>
-There has not been a new release of Onyx in several months. I have been working on other projects (using Onyx!) and have not had the time needed to dedicate to new features in the language. That being said, Onyx already has many of the features that I need for my projects, so I have not felt the need to add new features. However, I have been fixing bugs and blatant wrong implementations of core library procedures that have been getting in my way. Enough of these have accumulated over the past couple of months that I believe it is worth it to publish them in a new bugfix release.
-</p>
-
<p>
There is <em>one</em> new feature worth mentioning and that is <em>tagged globals</em>.
</p>
-<h1>Beta Release 0.1.7</h1>
-<p>
- This release of Onyx brings exciting and overdue features, including switch expression, WASIX support and an overhauled networking layer.
-</p>
-
<h2>Switch Expressions</h2>
<p>
Switch expressions allow you to write inline <code>switch</code> statements that evaluate to values, removing
box-sizing: border-box;
}
-@media (prefers-color-scheme: dark) {
- .ui-theme {
- --terminal-background-color: #070707;
- --terminal-foreground-color: #ffffff;
-
- --background-color: #222;
- --light-background-color: #333;
- --dark-background-color: #111;
- --active-color: #555;
- --link-color: #bbf;
- --visited-link-color: #bfbfff;
- --foreground-color: #fff;
- }
-}
+.ui-theme {
+ --terminal-background-color: #dddddd;
+ --terminal-foreground-color: #000000;
-@media (prefers-color-scheme: light) {
- .ui-theme {
- --terminal-background-color: #dddddd;
- --terminal-foreground-color: #000000;
+ --background-color: #f0f0f5;
+ --light-background-color: #e0e0e6;
+ --dark-background-color: var(--header-color);
+ --active-color: #cccccc;
- --background-color: #f0f0f0;
- --light-background-color: #e0e0e0;
- --dark-background-color: #c0c0c0;
- --active-color: #cccccc;
- --link-color: #448;
- --visited-link-color: #669;
- --foreground-color: #000000;
- }
+ --header-color: #303033;
+ --header-text: #ffffff;
+ --header-accent: #505055;
+
+ --link-color: #448;
+ --visited-link-color: #669;
+ --foreground-color: #000000;
}
@media (min-width: 800px) {
.container.dark {
background: var(--dark-background-color);
+ color: var(--header-text);
}
.container.light {
background: var(--light-background-color);
}
+.container.header {
+ background: var(--header-color);
+ color: var(--header-text);
+}
+
@media screen and (min-width: 800px) {
.container .split {
display: flex;
/* Navigation */
@media screen and (min-width: 800px) {
.navbar-container {
+ background: var(--header-color);
+ color: var(--header-text);
+
+ width: 100%;
+ }
+
+ navbar {
max-width: 1200px;
margin: 0 auto;
}
@media screen and (max-width: 799px) {
.navbar-container {
+ background: var(--header-color);
+ color: var(--header-text);
+
width: 100%;
margin: 0 auto;
}
navbar {
- background: var(--background-color);
- color: var(--foreground-color);
+ background: var(--header-color);
+ color: var(--header-text);
padding: 0 12px;
display: flex;
navbar a span:hover {
cursor: pointer;
- background-color: var(--light-background-color);
+ background-color: var(--header-accent);
}
navbar a:visited {
- color: var(--foreground-color);
+ color: var(--header-text);
}
navbar a {
- color: var(--foreground-color);
+ color: var(--header-text);
text-decoration: none;
}
{{ block "page_content" }}
-<div class="container">
+<div class="container header">
<h1>Onyx Docs</h1>
</div>
{{ block "page_content" }}
-<div class="container">
+<div class="container header">
<h1>Installing Onyx</h1>
<p>
<a class="link-button" href="#online">Online</a>
{{ block "page_content" }}
-<div class="container">
+<div class="container header">
<h1>Setting Up Your Environment for Onyx</h1>
<p>The following sections will help set up an environment for you to program Onyx effectively.</p>
{{ block "page_content" }}
-<div class="container">
+<div class="container header">
<div style="text-align: center;">
<h1>The <b>Onyx</b> Programming Language</h1>
</div>
</div>
</div>
+
+<div class="container">
+ <div style="text-align: center;">
+ <div style="margin-bottom: 26px">
+ Run the following command in your favorite shell on <strong>Linux or MacOS</strong> and get started with Onyx.
+ </div>
+ <div>
+ <span style="font-size: 16pt; font-family: monospace; padding: 20px; color: var(--header-text); background: var(--header-color); border-radius: 8px; box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)">
+ sh <(curl https://get.onyxlang.io -sSfL)
+ </span>
+ </div>
+ <div style="margin-top: 40px">
+ Or try Onyx online and read the docs!
+ </div>
+ <div style="margin-top: 26px; display: flex; flex-direction: row; gap: 40px;">
+ <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; background: var(--header-color); color: var(--header-text); box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/playground">TRY ONLINE</a>
+ <a style="flex: 1; border-radius: 8px; padding: 16px; font-size: 16pt; background: var(--header-color); color: var(--header-text); box-shadow: 0px 1px 4px 1px rgba(0, 0, 0, 0.4)" href="/docs">READ THE DOCS</a>
+ </div>
+ </div>
+</div>
+
+
+
<div class="container light">
<h2 style="margin-bottom: 8px">Recent News</h2>
</div>
{{block "page_content"}}
-<div class="container">
+<div class="container header">
<h1>News</h1>
</div>
<main>
{% partial "partials/navbar" %}
+ <div class="container header">
+ <h1>
+ {% $article.name %}
+ </h1>
+ <p>
+ {% $article.description %}
+ </p>
+ </div>
+
<div class="container">
{% $article.contents %}
</div>