From 645af428ea9e6a5166b156c56bdcd0e59e36438b Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Mon, 27 May 2024 13:37:31 -0600 Subject: [PATCH] Remove first page and add conditionals draft --- README.md | 84 +------------------------------ content/nativity/_index.md | 39 +++++++++++--- content/nativity/first-page.md | 9 ---- content/nativity/folder/_index.md | 10 ---- content/nativity/folder/leaf.md | 7 --- 5 files changed, 33 insertions(+), 116 deletions(-) delete mode 100644 content/nativity/first-page.md delete mode 100644 content/nativity/folder/_index.md delete mode 100644 content/nativity/folder/leaf.md diff --git a/README.md b/README.md index b1ee95d..af9efb3 100644 --- a/README.md +++ b/README.md @@ -1,83 +1 @@ -# Hextra Starter Template - -[![Deploy Hugo site to Pages](https://github.com/imfing/hextra-starter-template/actions/workflows/pages.yaml/badge.svg)](https://github.com/imfing/hextra-starter-template/actions/workflows/pages.yaml) -[![Netlify Status](https://api.netlify.com/api/v1/badges/6e83fd88-5ffe-4808-9689-c0f3b100bfe3/deploy-status)](https://app.netlify.com/sites/hextra-starter-template/deploys) -![Vercel Deployment Status](https://img.shields.io/github/deployments/imfing/hextra-starter-template/production?logo=vercel&logoColor=white&label=vercel&labelColor=black&link=https%3A%2F%2Fhextra-starter-template.vercel.app%2F) - - -🐣 Minimal template for getting started with [Hextra](https://github.com/imfing/hextra) - -![hextra-template](https://github.com/imfing/hextra-starter-template/assets/5097752/c403b9a9-a76c-47a6-8466-513d772ef0b7) - -[🌐 Demo ↗](https://imfing.github.io/hextra-starter-template/) - -## Quick Start - -Use this template to create your own repository: - - - -You can also quickly start developing using the following online development environment: - -- [GitHub Codespaces](https://github.com/codespaces) - - [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/imfing/hextra-starter-template) - - Create a new codespace and follow the [Local Development](#local-development) to launch the preview - -- [Gitpod](https://gitpod.io) - - [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/imfing/hextra-starter-template) - - -## Deployment - -### GitHub Pages - -A GitHub Actions workflow is provided in [`.github/workflows/pages.yaml`](./.github/workflows/pages.yaml) to [publish to GitHub Pages](https://github.blog/changelog/2022-07-27-github-pages-custom-github-actions-workflows-beta/) for free. - -For details, see [Publishing with a custom GitHub Actions workflow](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#publishing-with-a-custom-github-actions-workflow). - -Note: in the settings, make sure to set the Pages deployment source to **GitHub Actions**: - - - -[Run the workflow manually](https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow) if it's not triggered automatically. - -### Netlify - -[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/imfing/hextra-starter-template) - -### Vercel - -[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fimfing%2Fhextra-starter-template&env=HUGO_VERSION) - -Override the configuration: - - - -## Local Development - -Pre-requisites: [Hugo](https://gohugo.io/getting-started/installing/), [Go](https://golang.org/doc/install) and [Git](https://git-scm.com) - -```shell -# Clone the repo -git clone https://github.com/imfing/hextra-starter-template.git - -# Change directory -cd hextra-starter-template - -# Start the server -hugo mod tidy -hugo server --logLevel debug --disableFastRender -p 1313 -``` - -### Update theme - -```shell -hugo mod get -u -hugo mod tidy -``` - -See [Update modules](https://gohugo.io/hugo-modules/use-modules/#update-modules) for more details. - +# Birth Software website diff --git a/content/nativity/_index.md b/content/nativity/_index.md index 44960e7..4313834 100644 --- a/content/nativity/_index.md +++ b/content/nativity/_index.md @@ -1,6 +1,5 @@ --- title: Nativity -next: first-page --- Nativity is the language and compiler for Birth Software. @@ -26,24 +25,26 @@ Nonetheless, self-hosting is the main immediate goal of the project, so after th Before self-hosting, there will be no float or vector support. Intrinsics will only be implemented as needed. After self-hosting, an implementation of all this will follow. -# Basic types +# Language draft -## Boolean +## Basic types + +### Boolean Nativity does not support boolean types since there is no hardware concept of it. Instead, integer types should support the boolean use case. -## Integers +### Integers Nativity supports 1-bit to 64-bit signed and unsigned integers. -## Float +### Float Nativity does not support float types just yet. Support for 32-bit and 64-bit floats will be added. -## Vector +### Vector Nativity does not support vector types just yet. Support will be added. -## Hello, World! +### Hello, World! This is a valid hello world with libc linked @@ -55,3 +56,27 @@ fn [cc(.c)] main [export] () s32 { return 0; } ``` + +## Conditionals + +```nat {filename="main.nat"} +module std; + +fn [cc(.c)] main [export] () s32 { + // With integers: + >a: u32 = 1; + if (a) { + // 'a' is not zero + } else { + // 'a' is zero + } + + // With pointers + >pointer: ?*u32 = a.&; + if (?a) { + // Here the variable is shadowed, the attribute "non-null" is added to the backend to the pointer variable + } else { + // Here the pointer is null + } +} +``` diff --git a/content/nativity/first-page.md b/content/nativity/first-page.md deleted file mode 100644 index 4af40a1..0000000 --- a/content/nativity/first-page.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: Demo Page -type: docs -prev: / -next: docs/folder/ ---- - -A simple demo page. - diff --git a/content/nativity/folder/_index.md b/content/nativity/folder/_index.md deleted file mode 100644 index 5050ade..0000000 --- a/content/nativity/folder/_index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: Folder -type: docs -prev: docs/first-page -next: docs/folder/leaf -sidebar: - open: true ---- - -Pages can be organized into folders. diff --git a/content/nativity/folder/leaf.md b/content/nativity/folder/leaf.md deleted file mode 100644 index 7c9ee2a..0000000 --- a/content/nativity/folder/leaf.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Leaf Page -type: docs -prev: docs/folder/ ---- - -This page is under a folder.