triangletoot.party is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon instance focused on the Triangle region of North Carolina. Keeping out jerks since 2019. Anti-racist, anti-fascist, and anti-TERF.

Server stats:

78
active users

#lua

1 post1 participant0 posts today

I've finished writing v1 of my "Intro to Game Development for Teens" for the camp I'm teaching this week.

The instructions are available for free and after this week I will also be writing a free teacher's guide if anyone else wants to go over this with their class or kids or whatever else.

(It's "for teens" because you need knowledge of the x, y coordinate plane and the guide covers the distance formula.)

moosadee.gitlab.io/courses/kid

#gamedev#love2d#lua
Continued thread

From Forth to ual

github.com/ha1tch/ual/blob/mai

This is a new addition from the perspective of the philosophy of programming languages.

Some of you may be interested in this particular addition, feel free to ignore the rest in the series if you are exclusively focused on the Forth-like aspects of ual,

GitHubual/doc/philo/ual-philosophy-04-forth.md at main · ha1tch/ualual is a stack-oriented programming language for small systems with a unified approach to program safety. - ha1tch/ual
#ual#uallang#foss

UPDATE: The philosophy of ual.

If you're more the kind of person who would like to understand better from a humanistic point of view what values are encoded in the language, this is for you. It's not a big proclamation, and it's nothing like Larry Wall's exegesis, but I needed to try to understand myself at least in this way that works for me. Hope it works for some of you too.
github.com/ha1tch/ual/tree/mai

GitHubual/doc/philo at main · ha1tch/ualual is a stack-oriented programming language for small systems with a unified approach to program safety. - ha1tch/ual
#ual#uallang#foss

UPDATE: ual docs now differentiate between specs and proposals.

github.com/ha1tch/ual/tree/mai

The documents marked as proposals are not definitive, are subject to evolution and discussion, and features presented in them may or may not be introduced as presented in forthcoming versions of the specification.

What's new:

ual Design: Strengths and Limitations

github.com/ha1tch/ual/blob/mai

Proposal: macros

github.com/ha1tch/ual/blob/mai

Proposal: conditional compilation

GitHubual/spec at main · ha1tch/ualual is the daughter of Forth, Lua, and Go. Contribute to ha1tch/ual development by creating an account on GitHub.
#ual#uallang#foss

*** Regarding the consider construct in #ual ***

The semantics of consider really convey a sense of deliberate evaluation. It implies that you're not just executing a branch of code, but you're consciously weighing both outcomes—success and error—in a single, cohesive construct. Instead of passively matching on a value, consider encourages you to actively decide how to handle each scenario. This semantic choice highlights the importance of addressing all possible outcomes explicitly, which can lead to more robust and readable code.

consider communicates both the action (evaluating the result) and the mindset (being thoughtful about handling success versus error) behind this pattern.

Thus, while ual's error handling is Rust-inspired, I believe it also offers something more that's very idiosyncratically ual's own contribution.

Of course, dear Spidey, that with great power comes great responsibility, creating too many stacks can be overkill for some resource-constrained systems. But this is becoming less of a problem with new multi-core MCUs running at hundreds of Mhz, and with several megabytes of RAM.

What #ual says is: if your machine is not very powerful, we may be able to make it less painful to program highly optimised code for it. If your target machine is powerful, we may help to speed up your development cycles, and you may construct more nuanced, sophisticated, and reliable software with less effort.

Continued thread

New #ual programmers can start coding following most ideas they would assume to work using Lua, and progressively adopt the ual-specific stacked mode when it makes sense. For example, in resource-constrained systems where an algorithm using a Forth-like stack can be more efficient for certain tasks.

The > operator indicates a line that operates on the stack system, using a vocabulary for the most part similar to Forth's.

The @stackname > expression allows the programmer to select on which stack the operations are executed. The system comes with a data stack (@dstack) and a return stack (@rstack) built-in, but you can instantiate new ones, since stacks are first class objects in ual.

Take for example this implementation of Dijkstra's shortest path algorithm, uses its own separate stack to perform its computation.
github.com/ha1tch/ual/blob/mai

Hope you like it!

Continued thread

Other ideas in the works:

  • Adding the zxa assembler as one additional backend, to produce Z80 binaries.
    github.com/ha1tch/zxa
    in the future this could allow ual programs to target the ZX Spectrum and the RC2014.

  • Adding a uxntal backend to produce uxn roms.

Introducing the concept of transmutation

  • Write ual, or Z80 assembler, then send uxn or Z80 binaries to an ESP32 system, and have the binaries transmuted into Xtensa or RISC-V binaries as sort of shaders that run in-mcu.
GitHubGitHub - ha1tch/zxa: A simple Z80 assembler for the ZX Spectrum written in GoA simple Z80 assembler for the ZX Spectrum written in Go - ha1tch/zxa

ual is a new programming language for small systems, it borrows from Lua, Forth, and Go/TinyGo.
github.com/ha1tch/ual

It's not a scripting language, it compiles to TinyGo, and Go, therefore binaries are produced for the same targets of those compilers. In the case of TinyGo using an optimised LLVM-based backend (esp32, risc-v, wasm, various mcus), and for mainstream server/desktop computing architectures via the Go compiler's own backend (x86-64, arm64, etc.) and OSes (Linux, Mac, Windows).
The general idea is that this design allows developers for fast iteration cycles on a workstation, with sound and safely tested algorithms before moving to a second stage workflow on the real embedded platform.

((Work in progrees))
Not ready to use yet, but I thought I'd RFC before I complete the first implementation, whilst there's still time to influence design.

Hope you find it interesting!

Spec:
github.com/ha1tch/ual/tree/mai

Examples:
github.com/ha1tch/ual/tree/mai

Let me know what you think!

GitHubGitHub - ha1tch/ual: ual is the daughter of Forth, Lua, and Go.ual is the daughter of Forth, Lua, and Go. Contribute to ha1tch/ual development by creating an account on GitHub.

ual is a new programming language for small systems, it borrows from Lua, Forth, and Go/TinyGo.
github.com/ha1tch/ual

It's not a scripting language, it compiles to TinyGo, and Go, therefore binaries are produced for the same targets of those compilers. In the case of TinyGo using an optimised LLVM-based backend (esp32, risc-v, wasm, various mcus), and for mainstream server/desktop computing architectures via the Go compiler's own backend (x86-64, arm64, etc.) and OSes (Linux, Mac, Windows).

((Work in progrees))
Not ready to use yet, but I thought I'd RFC before I complete the first implementation, whilst there's still time.

Hope you find it interesting!

Spec:
github.com/ha1tch/ual/tree/mai

Examples:
github.com/ha1tch/ual/tree/mai

Let me know what you think!

GitHubGitHub - ha1tch/ual: ual is the daughter of Forth, Lua, and Go.ual is the daughter of Forth, Lua, and Go. Contribute to ha1tch/ual development by creating an account on GitHub.

This week I am positively chuffed about evolving hackable platforms.

I've been grooving on writing #lua to integrate the various cogs and gears of Neovim's rich ecosystem of software development tools, and it's reminded me of just how much I love feeling like I'm playing with incredibly powerful LEGOs, carefully choosing the ons I want, then stacking and connecting them, ultimately building something powerful and beautiful.

The key is everyone agreeing upon protocols so everything can be pieced together easily.

And when I say 'evolution' I mean actually being able to build upon those protocols and agreements up the stack in ways that bring value to end users.

Language servers are a great example. There is a ton of missing connective tissue to help developers actually leverage LSP features, but the @neovim core team is working hard on filling that gap.

The vim.lsp.config features added in 0.11 are a great example of this. They make LSP configuration vastly easier.

I've been building some of same said connective tissue in my own configuration, and maybe I can contribute some of that upstream to Neovim core.

Anyway, enough gushing :)

So, I've published a static site generator, as one does.

git.sr.ht/~akkartik/gen_site

Unique points:
- Lua and only Lua
- no Markdown, you have to edit HTML

A couple of years ago I ripped out my old Rails site and replaced it with static html cobbled together with some scripts. Many thanks to @joeldn for nudging me to find some reusable core in it.

I always assumed there'd be a zillion SSGs in any language, but surprisingly I can't find more than a couple in #Lua. If you like one please share.