Show HN: AGL a toy language that compiles to Go

by alain_gilberton 6/25/2025, 3:36 PMwith 13 comments

I spent the past 2 weeks making this toy programming language.

I basically forked the Go scanner/parser, and changed the syntax to have functions return a single value. This enable proper Result/Option type to be used as well as propagating errors with an operator.

I also wanted to have short "type inferred" anonymous functions to be able to use functions like Map/Reduce/Filter, without having to use 100 characters to specify the types.

by ben0x539on 6/28/2025, 10:25 PM

Cool language. Only two weeks for this? Damn!

This seems to nicely smooth out a lot of the pain points I had back when I regularly wrote Go but also switched to other more expression-based languages occasionally. Being able to get all these conveniences while still being able to call into existing Go code seems amazing!

Also, I appreciate the pun, but did you have to use AI for the logo? Haha

by lordofgibbonson 6/29/2025, 12:30 AM

This is so awesome! I tried building literally this year or so ago after being inspired by Borgo, but my kung fu wasn't as strong as yours.

Are nil pointers still possible/allowed in AGL? After a lack of enums, this is my biggest pet peeve.

by maylion 6/28/2025, 9:53 PM

That's pretty cool, I ways want Result/Option/Err types in python.

by LudwigNagasenaon 6/28/2025, 11:16 PM

Wow, looks like a great QoL improvement. I have a few questions though.

Propagation of optional values is an unconventional design decision. Why have you chose it over short circuiting as in C#, JS, Swift?

What’s your opinion on error wrappers and stack trace providers that are often used in go projects complicating simple error propagation? Have you consciously avoided adding similar functionality or just haven’t thought about it yet?