#rocketlang

4 posts · Last used 16d

Back to Timeline
OOTS @oots@infosec.exchange · Jul 29, 2026

#RocketLang update:

I added support for "Union types": You can now declare variables (and function parameters of types like int32 | None. The variables can hold values of both types (and functions can be called with parameters of both types).the functionality is still a bit rough around the edges (not as comfortable to use as I'd like), but the core functionality is there.

This is actually on the "critical path" towards my current goal of implementing a unit testing library: When discovering tests (iterating through folders, finding test files, loading them and then finding the test cases in them), I need a list of test-cases. Currently only ArrayLists are (kind-of) implemented. But they require... arrays - and if a type doesn't have a default value, you can't initialise the array. Concretely: When I'm building a list of test cases, that's a ArrayList[func() -> None]. But func() -> None doesn't have a default value, so creating a RawArray[func() -> None] fails, so there's no list. Now, with union types I can create an ArrayList[func() -> None] that uses a RawArray[(func() -> None) | None] as backing storage.

0
0
0
OOTS @oots@infosec.exchange · Jul 12, 2026

Project #RocketLang update:

While working towards my current goal of having a unit-testing library in #Rocket, I came across a few bugs:

  1. string_1 + string_2 actually didn't work when one or both of the strings where empty. Fixed and added test cases.
  2. os.scandir(path) actually wasn't working properly. Most of my test cases used mocking, but the function errored out when run without mocks. The test cases without mocking didn't properly check the results. Now I implemented a proper testcase that creates a temporary directory, puts some files there and checks for those.

The os.scandir() test case above actually turned out to be a bit flaky: It worked locally, but failed in my CI/CD pipeline. The reason was that os.scandir() returned the files in a different order on the CI/CD server. So I tried sorting them by name which ... requires supporting <, <=, >, and >= for strings. So I implemented that, too (lexicographic sorting).

And ByteString got a new method: ends_with.

#Programming

0
0
0
OOTS @oots@infosec.exchange · Jul 11, 2026

Another update on #RocketLang (my pet #programming language):

I just implemented the dir() function for modules, so that you can discover what's declared in a module. (Really, I had most of it stashed already.)

Another step towards implementing a unit-testing library for #Rocket, more specifically: auto-discovery of test cases.

0
0
0
OOTS @oots@infosec.exchange · Jul 11, 2026

#RocketLang update:

Yesterday I implemented typecasting (with runtime checks), so you can now write:

x = cast_to[T](y)

where T is the target type.

This required first implementing function templates (generic functions) at all, that's another new feature.

As a consequence, using the cast_to functions, it's now possible to call dir() on all types, including Type itself.

That's one step closer to my current goal of implementing a unit-testing library: When you get a test class (inheriting from unittest.TestCase) you have to find it's methods. That's where dir() comes in.

0
0
0

You've seen all posts