frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: Gala – Sealed types, pattern matching, and monads for Go

https://github.com/martianoff/gala
2•mmcodes•1h ago
Hi HN, I'm the author. GALA started from a simple frustration: I love Go's ecosystem, tooling, and performance, but I kept writing the same boilerplate — type switches that miss cases silently, nil checks everywhere, manual struct copy functions.

GALA is a language that transpiles to Go source code. You get sealed types (algebraic data types), exhaustive pattern matching, Option/Either/Try/Future monads, immutable-by-default values, and functional collections — and the output is readable Go that links against any Go library.

A quick taste:

  sealed type Shape {
      case Circle(Radius float64)
      case Rectangle(Width float64, Height float64)
  }

  func area(s Shape) string = s match {
      case Circle(r)       => fmt.Sprintf("circle area: %.2f", 3.14 * r * r)
      case Rectangle(w, h) => fmt.Sprintf("rect area: %.2f", w * h)
  }
  
This compiles to a flat Go struct with a variant tag. The compiler enforces exhaustiveness — add a Triangle case and forget to handle it, you get a compile error, not a runtime bug.

The standard library is written in GALA itself: Option[T], Either[A,B], Try[T], Future[T], plus immutable List, Array, HashMap, HashSet, TreeSet, TreeMap — all with Map, Filter, FoldLeft, Collect, etc.

How I actually develop in GALA — no IDE needed:

The biggest honest gap right now is traditional IDE support. There's an IntelliJ plugin for syntax highlighting, but no LSP, no autocomplete, no go-to-definition. Here's the thing though: I built the entire language and standard library using Claude Code as my development environment. Claude knows the GALA grammar, the type system, and the standard library — it writes GALA fluently, catches transpiler errors, and suggests idiomatic patterns. For me it's been a more productive workflow than any IDE could offer for a young language. If you're already using AI-assisted development, GALA works great today. If you need traditional IDE tooling to be productive, that's a real limitation I want to be upfront about.

Some other honest notes: - This is pre-1.0. The language works (107 verified examples, CI on every commit), but I'm sure there are edge cases I haven't hit. - The transpiler is a single-developer project. It handles multi-file packages, generics, type inference, and full Go interop, but it's early. - The compiler — type inference, sealed type code generation, exhaustiveness checking — was built collaboratively with Claude as a pair programmer. Happy to answer questions about that workflow.

Technical details for the compiler nerds: GALA source → ANTLR4 parse tree → GALA AST → Go AST → Go source. Type inference resolves lambda parameter types, generic type arguments, and method return types without annotations in most cases.

Repo: https://github.com/martianoff/gala

I'm curious what people think about the sealed-type-to-flat-struct compilation approach and the tradeoffs of transpiling vs. extending Go directly.

Comments

jlongo78•1h ago
Gala looks interesting. The sealed types approach in Go reminds me of how Rust handles enums for exhaustive matching. One practical tip when using this with AI coding agents: have them generate the type hierarchies first, then pattern match logic separately. Agents tend to hallucinate less when the type contracts are explicit upfront. The monad abstractions here could also make agent-generated error handling chains much more predictable and testable.
mmcodes•1h ago
This is exactly right. I am also very impressed how AI can pick up an unknown language and start coding in it.

A U.S. scholarship thrills a teacher in India. Then came soul-crushing questions

https://www.npr.org/2026/03/01/g-s1-104772/teacher-india-school-patriarchy-fulbright
1•aanet•2m ago•0 comments

Most common fields of study, from 1970 to now

https://flowingdata.com/2026/02/19/fields-of-study-ranked-by-bachelors-degrees-since-1970/
1•gmays•2m ago•0 comments

Show HN: ClawShield – Open-source security proxy for AI agents (Go, eBPF)

https://github.com/SleuthCo/clawshield-public
1•sleuthco•3m ago•1 comments

Show HN: Israel and Iran launch new strikes, 3 U.S. service members killed

https://useviralize.com
1•jcrosbz•5m ago•0 comments

Quarkdown: Markdown with Superpowers

https://quarkdown.com/
1•amichail•6m ago•0 comments

Show HN: Remoat – Control Antigravity from your phone via Telegram

https://github.com/optimistengineer/remoat
1•optimistengr•7m ago•0 comments

Show HN: EWA Compare – Compare 21 earned wage access providers worldwide

https://www.earnedwageaccess.com
1•Bielrv•8m ago•0 comments

Waymo robotaxi blocks EMS responding to Austin mass shooting

https://www.axios.com/local/austin/2026/03/02/waymo-vehicle-blocks-ems-austin-mass-shooting
1•mikhael•10m ago•0 comments

Show HN: LightJJ – Web-Based UI for Jujutsu VCS

https://github.com/chronologos/lightjj
1•Chronologos•16m ago•0 comments

Show HN: Timber – Ollama for classical ML models, 336x faster than Python

https://github.com/kossisoroyce/timber
2•kossisoroyce•17m ago•0 comments

Claude and the Dow: AI is unlike other tech because AI has embedded judgment

https://www.dbreunig.com/2026/03/01/the-issue-is-embedded-judgment.html
1•dbreunig•22m ago•0 comments

Clickout staff journalists sacked and misleadingly replaced with AI writers

https://pressgazette.co.uk/news/staff-journalists-sacked-and-misleadingly-replaced-with-ai-writers/
1•starkparker•23m ago•0 comments

Show HN: Big Prompt Hub – Sharing AI Prompts

https://www.bigprompthub.com
1•bighub•25m ago•0 comments

Amazon's cloud unit reports fire after objects hit UAE data center

https://www.reuters.com/world/middle-east/amazons-cloud-unit-reports-fire-after-objects-hit-uae-d...
3•nomilk•32m ago•1 comments

Show HN: Not an AI Notepad. 5MB local only notes app for Windows (Rust, SQLite)

https://notanainotepad.gumroad.com/l/mfqjtl
1•collapseindex•33m ago•1 comments

The AI Foundation Paradox: Funding the Roof While the House Is on Fire

https://architectureintel.com/the-ai-foundation-paradox-funding-the-roof-while-the-house-is-on-fi...
1•younss•34m ago•0 comments

Picking Up a Zillion Pieces of Litter

https://www.sixstepstobetterhealth.com/litter.html
2•colinbartlett•34m ago•0 comments

I built a small movie guessing browser game using AI – looking for feedback

https://frameguesser.vercel.app/
1•mmschreiber•34m ago•1 comments

Elite Doctors Served Jeffrey Epstein While Treating His 'Girls' [Gift Article]

https://www.nytimes.com/2026/02/28/us/jeffrey-epstein-doctors.html
5•areoform•35m ago•0 comments

Small-molecule inverse agonist of PPARγ for advanced solid tumors

https://www.nature.com/articles/s41591-026-04263-3
1•bookofjoe•41m ago•0 comments

Marathon's Story Page

https://marathon.bungie.org/story/
2•temp0826•44m ago•1 comments

If AI writes code, should the session be part of the commit?

https://github.com/mandel-macaque/memento
2•mandel_x•47m ago•5 comments

Show HN: MCP-firewall: I created a policy engine for CLI Agents

https://github.com/dzervas/mcp-firewall
1•ttouch•50m ago•0 comments

Show HN: Shannon's Revenge – detect Claude in your codebase for DoD compliance

https://github.com/dabrez/shannonsRevenge
2•dabrez•51m ago•0 comments

Awesome libghostty

https://github.com/Uzaaft/awesome-libghostty
3•lawrencechen•53m ago•0 comments

The AI agent that runs your customer operation from one widget

https://www.chatrai.app/
1•sammyjoze1•55m ago•1 comments

Mercury 2: The First Diffusion Model That 'Thinks'" [video]

https://www.youtube.com/watch?v=Bqdf6Um_8OE
2•matthewsinclair•1h ago•0 comments

Code World Models for Parameter Control in Evolutionary Algorithms

https://www.alphaxiv.org/abs/2602.22260
2•camilochs•1h ago•0 comments

ProofGateway – Collect and publish customer testimonials in minutes

2•elufadeju•1h ago•0 comments

JSON-up: Stop scattering "if" checks for old JSON formats across your codebase

https://github.com/Nano-Collective/json-up
2•mrspence•1h ago•1 comments