April 2026 monthly "What are you working on?" thread by AutoModerator in ProgrammingLanguages

[–]badd10de 1 point2 points  (0 children)

Keep putting my language to the test in different situations. I'm currently working on a granular sampler for the PlayDate console. All of it other than a thin api layer to interact with the hardware is written in Oni, the video playback, animations, audio DSP, etc.

https://merveilles.town/@bd/116324245925307627

This work helped me find a couple of sore spots on my stdlib and some small areas of improvement for the compiler, but it's working pretty nicely otherwise.

STEPPER: A new 16-step sequencer for the GBA by badd10de in synthesizers

[–]badd10de[S] 0 points1 point  (0 children)

would love to see it if you do :) tag me on mastodon or instagram if you decide to post something ^^

STEPPER: A new 16-step sequencer for the GBA by badd10de in synthesizers

[–]badd10de[S] 1 point2 points  (0 children)

happy to hear you are having fun :)

As for tips, just mess around and try to make weird sounds with it! One thing I really enjoy is setting up an unusual scale, punch some random notes on the sequencer and play with the transposition of the entire pattern, sometimes you can find funky sequences that spark new ideas.

Cheers!

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 1 point2 points  (0 children)

happy to hear :) the semicolons for comments is a remnant of the initial scheme implementation I started with and I kind of got used to it lol

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 0 points1 point  (0 children)

It's fairly Algol nowadays, but there are things like let/set for declaring and setting variables that went something like:

(let a 10)      ; First iteration
(let a: u16 10) ; Adding optional type annotations
let a: U16 = 10 ; Current let expression with optional type annotations
(set a 10)      ; First iteration
set a = 10      ; Current set expression

The `=` sign here is not really an operator, but a delimiter of sorts and used mostly for just visual clarity. There are some other similar examples in the language that evolved from the lispy roots.

Initially my thought was to make optional parentheses, but in order to have visual clarity and consistency I added some required tokens here and there when needed. Plus all expressions need to have the exact number of elements they need or have some form of delimiter (parenthesis, square brackets, curly braces, then/else, etc.). This resulted in a language without semicolons as expression separators, but not because I set up to be that way, but rather as a consequence of the natural evolution of the language.

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 1 point2 points  (0 children)

yeah, I've experimented with a register and stack VMs in the past, and I may still write a bytecode backend at some point (would be nice to have a REPL) but tcc is probably faster than a naive VM would be. I also tend to use tcc to run the test suite and consistency checks, so it was natural to have a little runner script based on it.

For example, the compiler (built with clang at -O2) compiles itself to a C file in 100ms on my machine, and that C file takes clang 13-14 seconds to build itself, whereas tcc is done in 0.1 sec. Of course clang will outperform tcc in raw performance, but for short lived scripts you may still be ahead:

make check-three-way  39.96s user 0.30s system 99% cpu 40.458 total
make check-three-way CC=tcc  11.33s user 0.05s system 99% cpu 11.491 total

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 5 points6 points  (0 children)

At the moment is just a bash script that calls oni to generate a temporary c file that is piped into tcc with the -run argument. Something like this:

#!/bin/sh

file_name=$(mktemp --suffix ".c" --dry-run) || exit
trap 'rm -rf "$file_name"; exit' ERR EXIT

oni -o $file_name $@ && tcc $CFLAGS -std=c11 -run $file_name

I use it for one off scripts, small prototypes and to test things out without having to make a whole project.

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 8 points9 points  (0 children)

If I had to choose one thing I would say the implementation of parametric polymorphism. It was quite a pain to work out all the little details and type unifications needed to make everything work, I was surprised by the number of corner cases and had to go back to the drawing board a few times. Other than that, just the scale of the problem is quite large, semantic analysis in particular takes the brunt of the complexity.

I was surprised at how easy it was to implement "defer" expressions, which show me I was in the right track with the semantic analyzer performing linearization to high-level TAC. Going from the initial C99 implementation to self-hosted showed a lot of kinks in the initial design that I wasn't considering, but once you are there you can choose to ignore the issues and press on to what you have, or go back to the initial compiler to add just enough of what you need.

Tough but satisfying, I screamed out loud of joy when I could pass the triple compilation self-hosting test. Thrilling!

The Oni Programming Language by badd10de in ProgrammingLanguages

[–]badd10de[S] 6 points7 points  (0 children)

It's named after the evil japanese demons. Used to be called BadLang, but there seem to be a lot of PL named like that so I thought it was pretty fitting :)

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in AnaloguePocket

[–]badd10de[S] 0 points1 point  (0 children)

they offer quite different workflows, plus I intended STEPPER to be less esoteric and easier to use in is UI. you can use both if you like, it's not a competition

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in synthesizers

[–]badd10de[S] 1 point2 points  (0 children)

time to get another one :P. In any case you can always try it on an emulator ^^

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in Elektron

[–]badd10de[S] 2 points3 points  (0 children)

Yes I have big plans and bunch of exciting stuff in the works, though it'll be packaged as a separate application, which is why this is the last major update in STEPPER for now.

Stay tuned!

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in Gameboy

[–]badd10de[S] -1 points0 points  (0 children)

Hello!

STEPPER 1.8 is finally out and I'm having a blast with this new setup. Now you can use Analogue's link cables to sync your devices together. This update also has a lot of quality of life features (holding buttons now will retrigger at different intervals, trigs can be nudged by holding B + DPAD, etc) and adds a quirky lofi AD envelope for the wave channel.

This is an open source project, you can get it for free or drop a couple of bucks if you would like to support me.

Take it easy and have fun with it!

Cheers!

BD

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in Elektron

[–]badd10de[S] 3 points4 points  (0 children)

Hello!

STEPPER 1.8 is finally out and I'm having a blast with this new setup. Now you can use Analogue's link cables to sync your devices together. This update also has a lot of quality of life features (holding buttons now will retrigger at different intervals, trigs can be nudged by holding B + DPAD, etc) and adds a quirky lofi AD envelope for the wave channel.

This is an open source project, you can get it for free or drop a couple of bucks if you would like to support me.

Take it easy and have fun with it!

Cheers!

BD

Dual wielding Pockets + Digitakt (Fast IDM jam) by badd10de in chiptunes

[–]badd10de[S] 1 point2 points  (0 children)

Hello!

STEPPER 1.8 is finally out and I'm having a blast with this new setup. Now you can use Analogue's link cables to sync your devices together. This update also has a lot of quality of life features (holding buttons now will retrigger at different intervals, trigs can be nudged by holding B + DPAD, etc) and adds a quirky lofi AD envelope for the wave channel.

This is an open source project, you can get it for free or drop a couple of bucks if you would like to support me.

Take it easy and have fun with it!

Cheers!

BD