From: Brendan Hansen Date: Wed, 29 Nov 2023 20:08:01 +0000 (-0600) Subject: many minor updates X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=6fc0c6806ac14af3feb05e546013a1e1179ac652;p=onyxlang.io.git many minor updates --- diff --git a/www/news-articles/index.json b/www/news-articles/index.json index 949c83f..76d27ba 100644 --- a/www/news-articles/index.json +++ b/www/news-articles/index.json @@ -1,4 +1,10 @@ [ + { + "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", diff --git a/www/news-articles/release-0.1.8.html b/www/news-articles/release-0.1.8.html new file mode 100644 index 0000000..b3ffcd0 --- /dev/null +++ b/www/news-articles/release-0.1.8.html @@ -0,0 +1,96 @@ +

MacOS Support

+

+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). +

+ +

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

+ +

Single install script

+

+Onyx is now very easy to install. Simply run this command on your Linux or +MacOS machine, and let the install do its magic. +

+ +
sh <(curl https://get.onyxlang.io -sSfL)
+ +

+Onyx will be installed in your HOME directory, at ~/.onyx. +You will be prompted add Onyx to your path, and to define the ONYX_PATH 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 ONYX_PATH. +

+ +

Package manager changes

+

+Onyx's package manager saw a big renovation in this release. +The most noticeable fact is that it now use .kdl instead of .ini files. +KDL files offer more flexibility and future proofing compared to the old format. Not to mention, they look a lot better. +

+ +

+To migrate existing projects using the old format, simply run this command. +

+ +
onyx package migrate
+ +

+Because this conversion is a lossless transition, there should be no problems do the migration on any project. +

+ +

Minor library changes

+

+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 Memory Debugger! +

+ +

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

+ +

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

+ +

Full Changelog

+
+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.
+
+ diff --git a/www/static/css/new_style.css b/www/static/css/new_style.css index 7f341e8..3dd90b0 100644 --- a/www/static/css/new_style.css +++ b/www/static/css/new_style.css @@ -30,7 +30,7 @@ @media (max-width: 799px) { :root { --default-flex-direction: column; - font-size: 12pt; + font-size: 10pt; } } @@ -43,13 +43,15 @@ body { 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; @@ -57,7 +59,7 @@ a.link-button { } a.link-button:hover { - top: -6px; + /* top: -6px; */ box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2); cursor: pointer; } @@ -80,7 +82,7 @@ a.cta-button { } a.cta-button:hover { - top: -6px; + /* top: -6px; */ box-shadow: 0 6px 15px 8px rgba(200, 200, 230, 0.2); cursor: pointer; } @@ -134,9 +136,12 @@ a.cta-button:hover { } .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) { @@ -213,11 +218,11 @@ p code { /* 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%; } @@ -230,11 +235,14 @@ p code { @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; } } @@ -279,6 +287,7 @@ navbar a:visited { navbar a { color: var(--header-text); text-decoration: none; + border-bottom: none; } @media (min-width: 800px) { @@ -342,6 +351,7 @@ navbar a { display: block; padding: 2px 0; text-decoration: none; + border-bottom: none; color: var(--accent); } @@ -406,13 +416,13 @@ main li { #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 { @@ -425,6 +435,10 @@ main li { #desktop_logo { display: none; } + + .copy-button { + display: none; + } } #install-command .copy-button { @@ -448,48 +462,34 @@ main li { #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 { @@ -531,10 +531,6 @@ canvas#animation { -webkit-mask-image: var(--header-color); } -.scrollport > div { - min-width: 1000px; -} - ::-webkit-scrollbar{ width: 8px; } diff --git a/www/static/images/header-background.png b/www/static/images/header-background.png new file mode 100644 index 0000000..0a114f7 Binary files /dev/null and b/www/static/images/header-background.png differ diff --git a/www/templates/pages/docs.html b/www/templates/pages/docs.html index ac61874..b75a879 100644 --- a/www/templates/pages/docs.html +++ b/www/templates/pages/docs.html @@ -11,38 +11,46 @@ Onyx Documentation
-

Getting Started

+
+

Getting Started

+
+

Install Onyx locally on your system and write your first program.

-

- Getting Started - Install - Environment Setup -

+
-

Learn

+
+

Learn

+
+

Learn the core ideas behind programming in Onyx, and how to use developer tooling.

-

- Guides - Package Manager - Language Reference -

+
-

Package Reference

+
+

Package Reference

+

Reference material for all packages shipped with the Onyx toolchain.

-

- Core packages - External packages -

+
{{ endblock }} diff --git a/www/templates/pages/docs/getting_started.html b/www/templates/pages/docs/getting_started.html index 054c2b3..f93ea3c 100644 --- a/www/templates/pages/docs/getting_started.html +++ b/www/templates/pages/docs/getting_started.html @@ -69,7 +69,7 @@ main :: () {

Run your program!

-

To run the program our newly created program, we use the following command from within the project folder.

+

To run our newly created program, we use the following command from within the project folder.

$ onyx run main.onyx
 Hello, Onyx!
diff --git a/www/templates/pages/docs/guide_raylib.html b/www/templates/pages/docs/guide_raylib.html index 7c2f2c3..596b33d 100644 --- a/www/templates/pages/docs/guide_raylib.html +++ b/www/templates/pages/docs/guide_raylib.html @@ -70,6 +70,9 @@ main :: () { // Create a new window raylib.InitWindow(1200, 900, "Raylib Example"); + // Limit FPS to 60 + raylib.SetTargetFPS(60); + while !raylib.WindowShouldClose() { // Start drawing raylib.BeginDrawing(); @@ -107,7 +110,7 @@ main :: () {

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.

@@ -143,8 +146,7 @@ mines: [..] Mine; score: i32;

- Next, you can add some code to reset the game state in resetGame, generate new mines - and move the checkpoint in moveCheckpointAndSpawnMines. + Next, you can add some code to reset the game state in resetGame, and spawn new mines and move the checkpoint in moveCheckpointAndSpawnMines.

resetGame :: () {
@@ -183,7 +185,7 @@ moveCheckpointAndSpawnMines :: () {
 
     

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.

@@ -193,7 +195,7 @@ moveCheckpointAndSpawnMines :: () { This iterator never ends, and will infinitely produce random mines. When combined with iter.skip_while, 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.

@@ -235,6 +237,9 @@ mineGenerator :: () -> Iterator(Mine) { // 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(); diff --git a/www/templates/pages/docs/package.html b/www/templates/pages/docs/package.html index 389a7ec..45e3c1f 100644 --- a/www/templates/pages/docs/package.html +++ b/www/templates/pages/docs/package.html @@ -39,8 +39,15 @@

When you publish a package using onyx package publish, 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 onyx package update, the new version will be found and updated to.

+ +

+ When someone else runs onyx package update, all packages will be updated to their newest compatible version. +

+ +
+ Do note that, in order to use Onyx's package manager, you MUST have Git installed and it must be in the PATH. +
diff --git a/www/templates/pages/homepage.html b/www/templates/pages/homepage.html index ad8d4da..c8552b8 100644 --- a/www/templates/pages/homepage.html +++ b/www/templates/pages/homepage.html @@ -4,22 +4,14 @@ {{ let navbar_page = "home" }} {{ let navbar_logo_hidden = true }} -{{ let navbar_hidden = true }} {{ block "page_content" }} -
+
- - -
-
+
+
@@ -28,7 +20,7 @@

The Onyx Programming Language

-

A data-oriented, safe, and modern programming language

+

A data-oriented, expressive, and modern programming language

@@ -36,7 +28,7 @@
$ # Install Onyx in one command
- $ sh <(curl https://get.onyxlang.io -sSfL) + $ sh <(curl https://get.onyxlang.io -sSfL) Copy
$ # Read the docs
@@ -106,24 +98,25 @@ main :: () {

Fast Compilation


-

Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in 49 milliseconds.

+

Onyx's compiler is written entirely in C and features incredibly fast compilation. The web-server for this website was compiled in 47 milliseconds.

-
$ onyx build -V ./src/app.onyx
+    
$ 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)
-
+ 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
@@ -217,9 +210,15 @@ for(var PERLIN_YWRAPB=4,PERLIN_YWRAP=1< 800 ? 0 : 2); + canvas.width = rect.width; canvas.height = rect.height; ctx.fillStyle = '#060609'; @@ -252,11 +251,11 @@ for(var PERLIN_YWRAPB=4,PERLIN_YWRAP=1< 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)`); diff --git a/www/templates/partials/footer.html b/www/templates/partials/footer.html index c32c740..f1e3823 100644 --- a/www/templates/partials/footer.html +++ b/www/templates/partials/footer.html @@ -7,7 +7,7 @@
- Data-oriented, safe, and modern programming language for application development. + Data-oriented, expressive, and modern programming language for application development.
diff --git a/www/templates/partials/navbar.html b/www/templates/partials/navbar.html index 60a8f42..032d793 100644 --- a/www/templates/partials/navbar.html +++ b/www/templates/partials/navbar.html @@ -1,8 +1,11 @@ +{{ let homepage = false }} +{{ if navbar_logo_hidden == true }} + {{ let homepage = true }} +{{ endif }}