logo

drewdevault.com

[mirror] blog and personal website of Drew DeVault git clone https://hacktivis.me/git/mirror/drewdevault.com.git
commit: 1b4f1683855a297d0e6af8fc1f509facfac6a335
parent e0c67e1a6f63a4751342856fc16fffc6994d707e
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 19 Mar 2021 12:53:50 -0400

A new systems programming language

Diffstat:

M.build.yml8++++++--
Massets/main.scss16+++++++++++++---
Acontent/blog/A-new-systems-language.gmi72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/blog/A-new-systems-language.md113+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 204 insertions(+), 5 deletions(-)

diff --git a/.build.yml b/.build.yml @@ -2,10 +2,10 @@ image: alpine/edge packages: - rsync - go - - hugo sources: - https://git.sr.ht/~sircmpwn/drewdevault.com - https://git.sr.ht/~sircmpwn/openring + - https://git.sr.ht/~sircmpwn/hugo secrets: - 160a72cf-34d6-47b7-928b-c13b42b4d4f6 triggers: @@ -13,6 +13,10 @@ triggers: condition: always to: Drew DeVault <sir@cmpwn.com> tasks: +- hugo: | + cd hugo + go build --tags extended + sudo cp hugo /usr/local/bin/ - openring: | cd openring go build -o openring @@ -30,7 +34,7 @@ tasks: -s https://100r.co/links/rss.xml \ < webring-in.template \ > layouts/partials/webring-out.html - hugo + /usr/local/bin/hugo - upload: | cd drewdevault.com echo "StrictHostKeyChecking=no" >> ~/.ssh/config diff --git a/assets/main.scss b/assets/main.scss @@ -242,8 +242,18 @@ blockquote { } } -ul { - li:not(:last-child) { - margin-bottom: 1rem; +dl { + display: grid; + grid-template-columns: auto 1fr; + grid-gap: 0.2rem 1rem; + + dt { + font-weight: bold; + grid-column-start: 1; + } + + dd { + grid-column-start: 2; + margin: 0; } } diff --git a/content/blog/A-new-systems-language.gmi b/content/blog/A-new-systems-language.gmi @@ -0,0 +1,72 @@ +It’s an open secret: the “secret project” I’ve been talking about is a new systems programming language. It’s been underway since December ‘19, and we hope to release the first version in early 2021. The language is pretty small — we have a mostly complete specification which clocks in at 60 pages. It has manual memory management, no runtime, and it uses a superset of the C ABI, making it easy to link with libraries and C code. It should be suitable almost anywhere C is useful: compilers, system utilities, operating systems, network servers and clients, and so on. + +```A "hello world" code sample +use io; + +export fn main() void = { + const greetings = [ + "Hello, world!", + "¡Hola Mundo!", + "Γειά σου Κόσμε!", + "Привет мир!", + "こんにちは世界!", + ]; + for (let i = 0z; i < len(greetings); i += 1) { + io::println(greetings[i]); + }; +}; +``` + +We could compare our language to many other languages, but let’s start with how it compares to C: + +* More robust error handling via tagged unions +* Improved, Unicode-aware string support +* Memory safe array, slice, and pointer types (and unsafe versions, if needed) +* Direct compatibility with the C ABI for trivial C interop +* A simpler, context-free, expression-oriented syntax +* A standard library free of the constraints of POSIX or the C standard + +I plan to continue keeping the other details a secret until the release — we want the first release to be a complete, stable, production-ready programming language with all of the trimmings. The first time most people will hear about this language will also be the first time they can ship working code with it. + +However, if you want to get involved sooner, there’s a way: we need your help. So far, we’ve written most of the spec, the first of two compilers, and about 15,000 lines of the standard library. The standard library is what needs the most help, and I’m seeking volunteers to get involved. + +The standard library mandate begins with the following: + +> The •••• standard library shall provide: +> +> * Useful features to complement •••• language features +> * An interface to the host operating system +> * Implementations of broadly useful algorithms +> * Implementations of broadly useful formats and protocols +> * Introspective meta-features for ••••-aware programs +> +> Each of these services shall: +> +> * Have a concise and straightforward interface +> * Correctly and completely implement the useful subset of the required behavior +> * Provide complete documentation for each exported symbol +> * Be sufficiently tested to provide confidence in the implementation + +We have a number of focus areas for standard library development. I expect most contributors, at least at first, to stick to one or two of these areas. The focus areas we’re looking into now are: + +Algorithms: Sorting • compression • math • etc + +Cryptography: Hashing • encryption • key derivation • TLS • etc + +Date & time support: Parsing • formatting • arithmetic • timers • etc + +Debugging tools: ELF and DWARF support • vDSO • dynamic loading • etc + +Formats & encodings: JSON • XML • Gemtext • MIME • RFC 2822 • tar • etc + +•••• language support: Parsing • type checker • hosted toolchain • etc + +Networking: IP & CDIR handling • sockets • DNS resolver • Gemini • etc + +Platform support: New platforms and architectures • OS-specific features + +String manipulation: Search, replace • Unicode • Regex • etc + +Unix support: chmod • mkfifo • passwd • setuid • TTY management • etc + +If any of this sounds up your alley, we’d love your help! Please write me an email describing your interest areas and previous systems programming experience. diff --git a/content/blog/A-new-systems-language.md b/content/blog/A-new-systems-language.md @@ -0,0 +1,113 @@ +--- +title: We are building a new systems programming language +date: 2021-03-19 +formats: [html, gemtext] +--- + +It's an open secret: the "secret project" I've been talking about is a new +systems programming language. It's been underway since December '19, and we hope +to release the first version in early 2021. The language is pretty small &mdash; +we have a mostly complete specification which clocks in at 60 pages. It has +manual memory management, no runtime, and it uses a superset of the C ABI, +making it easy to link with libraries and C code. It should be suitable almost +anywhere C is useful: compilers, system utilities, operating systems, network +servers and clients, and so on. + +<!-- +Hello, clever reader :) I was too lazy to make a dedicated build of Hugo with a +fake name for the language. Since you bothered to check, head to +https://harelang.org for the rest of the details. Please keep it to yourself! +--> +```hare +use io; + +export fn main() void = { + const greetings = [ + "Hello, world!", + "¡Hola Mundo!", + "Γειά σου Κόσμε!", + "Привет мир!", + "こんにちは世界!", + ]; + for (let i = 0z; i < len(greetings); i += 1) { + io::println(greetings[i]); + }; +}; +``` + +We could compare our language to many other languages, but let's start with how +it compares to C: + +- More robust error handling via tagged unions +- Improved, Unicode-aware string support +- Memory safe array, slice, and pointer types (and unsafe versions, if needed) +- Direct compatibility with the C ABI for trivial C interop +- A simpler, context-free, expression-oriented syntax +- A standard library free of the constraints of POSIX or the C standard + +I plan to continue keeping the other details a secret until the release &mdash; +we want the first release to be a complete, stable, production-ready programming +language with all of the trimmings. The first time most people will hear about +this language will also be the first time they can ship working code with it. + +However, if you want to get involved sooner, there's a way: we need your help. +So far, we've written most of the spec, the first of two compilers, and about +15,000 lines of the standard library. The standard library is what needs the +most help, and I'm seeking volunteers to get involved. + +The standard library mandate begins with the following: + +> The <span style="color: transparent">xxxx</span> standard library shall provide: +> +> 1. Useful features to complement <span style="color: transparent">xxxx</span> language features +> 2. An interface to the host operating system +> 3. Implementations of broadly useful algorithms +> 4. Implementations of broadly useful formats and protocols +> 5. Introspective meta-features for <span style="color: transparent">xxxx</span>-aware programs +> +> Each of these services shall: +> +> 1. Have a concise and straightforward interface +> 2. Correctly and completely implement the useful subset of the required behavior +> 3. Provide complete documentation for each exported symbol +> 4. Be sufficiently tested to provide confidence in the implementation + +We have a number of focus areas for standard library development. I expect most +contributors, at least at first, to stick to one or two of these areas. The +focus areas we're looking into now are: + +<dl> + <dt>Algorithms</dt> + <dd>Sorting • compression • math • etc</dd> + + <dt>Cryptography</dt> + <dd>Hashing • encryption • key derivation • TLS • etc</dd> + + <dt>Date & time support</dt> + <dd>Parsing • formatting • arithmetic • timers • etc</dd> + + <dt>Debugging tools</dt> + <dd>ELF and DWARF support • vDSO • dynamic loading • etc</dd> + + <dt>Formats & encodings</dt> + <dd>JSON • XML • HTML • MIME • RFC 2822 • tar • etc</dd> + + <dt><span style="color: transparent">xxxx</span> language support</dt> + <dd>Parsing • type checker • hosted toolchain • etc</dd> + + <dt>Networking</dt> + <dd>IP & CDIR handling • sockets • DNS resolver • HTTP • etc</dd> + + <dt>Platform support</dt> + <dd>New platforms and architectures • OS-specific features</dd> + + <dt>String manipulation</dt> + <dd>Search, replace • Unicode • Regex • etc</dd> + + <dt>Unix support</dt> + <dd>chmod • mkfifo • passwd • setuid • TTY management • etc</dd> +</dl> + +If any of this sounds up your alley, we'd love your help! Please [write me an +email](mailto:sir@cmpwn.com) describing your interest areas and previous systems +programming experience.