Tried to draw an ONI sigil with Krita with my drawing tablet and the program keep crashing on me :/ so this is the best attempt so far. Will use it for now, but will likely replace it with a better version in the future.

#PLDev #onilang

Added a couple of examples to the Readme and kind of got sidetracked exploring some Wormrote sigils for the language name lol

#pldev #onilang

Ok I think I found a good name for my programming language. It's short and sweet and I haven't seen it used anywhere for other PL projects:

The Oni programming language

Named after the evil japanese yokai. Seems in-theme with the previous "badlang" name.

I've acquired oni-lang.com and will be updating my repos to use the new name soon. Perhaps this is a good opportunity to start adding a website and documentation.

#PLDev #badlang #onilang

Yesterday I had the horrible realization that multiple people seems to have created programming languages called BadLang. To this end I think it’s probably time for me to choose a definitive name for my language. We floated the name of Badlands. But I need to ponder this a bit more. #pldev #badlang

Made a little RMS/Peak meter that averages the measurement across N audio frames.

#badlang #pldev #PlayDate

Hi there! Seems this little thing has a mic, neat!

#pldev #badlang #playdate

Having a lot of fun with this, I sense a new toy project incoming :)

This is using the wavreader from the badlang standard library with a custom playdate IO.Reader and a simple sample playback DSP code. All written in my own little language.

#badlang #pldev #playdate

Without too much trouble I managed to run Badlang code on the Playdate. Just had to override the panic function to use the pd system log and to create some wrapper functions.

I also added a custom allocator, meaning I can use most of the relevant stuff from the standard library. Here is shown a directory list, a file being read (and the written) and timing information. Additionally I can draw using the system drawing functions (for text and sprites) and directly on the framebuffer (as seen on the grid behind).

Perhaps I’ll have a bit more fun with this soon :)

#badlang #pldev

Started exploring Result::(Error, Val) types and implemented a `tryor` operator (??). The previous `try` operator (?) would unwrap or return the default zeroed value for the current function. With this new operator we can perform some extra action before returning and give our desired return type.

Equivalent to:

let a = funcall() ?? ret_expr
let a = {
let tmp = funcall()
if not tmp.ok() then return ret_expr
tmp.val()
}

Since `ret_expr` is an expression, you could log a message before returning or something like that.

Pretty happy with this approach, I don't like to just blindly propagate an error, it needs to get handled somewhere or transform across type boundaries, which this should be able to handle.

#badlang #pldev

Back home. Been doing some light programming on the side, namely bugfixing, adding support for typed enums (still only integer types, but this way you can stuff enums into structs and arrays and control their size) and exploring adding type aliases.

My initial implementation is super simple, just literally an alias so any function that takes the original type would also take the alias and vice-versa. Starting adding a more complex implementation where aliases are new types that could be casted back and forth between the original and alias implementation. This would become a hard typecheck failure if an alias is used instead of the original type and would enable having specific methods for aliased types.

Unsure if the complexity is worth the cost for this particular feature. Thoughts?

#badlang #pldev

Soft type alias: Both types are the same type
33.3%
Hard type alias: Distinct types, support methods
66.7%
Poll ended at .