caoimhe
banner
caoimhe.dev
caoimhe
@caoimhe.dev
hi, i'm caoimhe! (she/her), i do a lot of things, maybe they'll be interesting enough to put here someday

💻 github.com/caoimhebyrne
🎵 last.fm/user/caoimhereal

🏳️‍🌈 🇮🇪
one click join is now on modrinth!

this is a minecraft mod that allows you to join your last minecraft server through a button on the main menu!

modrinth.com/mod/one-clic...
March 25, 2025 at 4:02 PM
haven't posted a petal update in a while!

i've been busy with other stuff, but it is at a stage where we have almost-parity with what it was like before i started the refactor.

today i implemented references again, which are working a little bit better than before!

(1/2)
January 18, 2025 at 9:53 PM
today in petal:

we did a live stream on twitch! the refactor is going well :) a few things were implemented, most importantly though: diagnostics got a refresh! ^^
January 4, 2025 at 8:21 PM
petal now has imports! i'd like to write an entire post about this, but i'll leave that until tomorrow.

i have a lot of code to clean up from the last few days of building 💤
December 31, 2024 at 11:04 PM
yep, looks like a bug!

the `null` value is considered to be `0` for integer literals (see `%force-unwrap = icmp eq i64 %optional1, 0`).

i'll have to reimplement the code-generation in a better way, thanks for pointing this out 🫶
December 31, 2024 at 5:58 PM
your blog is a little... one-sided on my monitor 😢
December 31, 2024 at 4:49 PM
to keep things safe, you must unwrap an optional before you can pass it to a function that expects a non-optional value.

passing an optional to something that expects a non-optional value will result in a compilation error.

(2/3)
December 31, 2024 at 4:30 PM
new in petal: optionals!

variables previously had to be initialized with a value, but if your variable may not have a value, prefixing it with `?` tells the compiler that it may be null.

(1/3)
December 31, 2024 at 4:30 PM
i've never gotten this far with a programming language project before! almost 100 commits over the last week ^^

i said to myself that i'd try to overcome any challenges i meet instead of just giving up. sticking to that has pushed me to go further than before! :)

github.com/caoimhebyrne...
December 30, 2024 at 5:54 PM
also new in petal today: passing values by reference!

this was a bit easier than i thought, i'm still a little unsure of the syntax, but it'll do for now :)
December 30, 2024 at 5:44 PM
new in petal: type aliasing!

this required a refactor of the type system. the AST now generates unresolved types, which the typechecker now resolves and verifies before code-generation.

the `type` keyword will also be used for some cool stuff in the future ^^
December 30, 2024 at 1:27 PM
1 hour later, we have a full type-checker that supports all nodes within petal!
December 29, 2024 at 9:02 PM
as an example, here is the typechecker not allowing a floating-point value to be assigned to an integer variable:
December 29, 2024 at 8:05 PM
that actually turned out to be a way better idea!

as you can see by the screenshot, it now verifies types for number literals in variable declarations, and coerces them if it can safely do so!

it should be pretty trivial to expand this typechecking to function call arguments
December 29, 2024 at 8:05 PM
today in petal:

number literals are now generated with their expected type, instead of just `i32`. this currently only applies to variable declarations + binary operations, since it's a bit more work to make this apply to return statements & function parameters!
December 29, 2024 at 6:56 PM
the fact that i can use LLVM's C api to build LLVM modules from my own language is crazy!!!

the compiler for the language is written in C, and produces binaries using LLVM. the goal is to get to a stage where i can re-write the compiler in itself.

still haev a lot of work to do!
December 26, 2024 at 2:06 PM
that was a lot of effort but i think it was worth it?
December 26, 2024 at 1:56 PM
you mean X, "The Everything App"™?
December 26, 2024 at 1:55 PM