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
3•mmcodes•5h 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•5h 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•4h ago
This is exactly right. I am also very impressed how AI can pick up an unknown language and start coding in it.

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

https://github.com/kossisoroyce/timber
68•kossisoroyce•4h ago•7 comments

Show HN: I built a zero-browser, pure-JS typesetting engine for bit-perfect PDFs

https://github.com/cosmiciron/vmprint
16•cosmiciron•16h ago•7 comments

Show HN: Vibe Code your 3D Models

https://github.com/ierror/synaps-cad
33•burrnii•2d ago•10 comments

Show HN: OpenTamago – P2P GenAI Tamagotch

https://open.tamago.chat
2•boiling_eggs•59m ago•0 comments

Show HN: HN Bot Detector - Detects LLM-Generated Comments on Hacker News

https://github.com/umairnadeem/hn-bot-detector
4•umairnadeem123•1h ago•1 comments

Show HN: Logira – eBPF runtime auditing for AI agent runs

https://github.com/melonattacker/logira
13•melonattacker•5h ago•1 comments

Show HN: Audio Toolkit for Agents

https://github.com/shiehn/sas-audio-processor
55•stevehiehn•13h ago•9 comments

Show HN: Sun – Realtime voice agent for group conservation not just turn taking

https://www.getsun.io/
4•anand_pattern•3h ago•2 comments

Show HN: Now I Get It – Translate scientific papers into interactive webpages

https://nowigetit.us
288•jbdamask•1d ago•128 comments

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

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

Show HN: Vertex.js – A 1kloc SPA Framework

https://lukeb42.github.io/vertex-manual.html
30•LukeB42•17h ago•19 comments

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

https://github.com/chronologos/lightjj
2•Chronologos•4h ago•0 comments

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

https://github.com/dzervas/mcp-firewall
2•ttouch•4h ago•0 comments

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

https://github.com/martianoff/gala
3•mmcodes•5h ago•2 comments

Show HN: I built speedmux, a libghostty-powered terminal multiplexer

https://github.com/webforspeed/speedmux
4•n89nanda•5h ago•1 comments

Show HN: Ductwork – A Go platform for running AI agents on autopilot

https://github.com/dneil5648/ductwork
4•dneil8675•6h ago•3 comments

Show HN: LocalRAG – Ask AI about your own documents (iOS/Android)

https://localrag.app
2•snakaya•7h ago•0 comments

Show HN: SwarmClaw – Orchestration dashboard for OpenClaw and AI agents

https://github.com/swarmclawai/swarmclaw
2•jamesweb•7h ago•1 comments

Show HN: Lightweight, S3-compatible object storage server with built-in web dash

https://github.com/eniz1806/VaultS3
6•open_source_new•7h ago•0 comments

Show HN: Updater – one command for macOS app updates

https://github.com/lu-zhengda/updater
3•zhengda-lu•8h ago•0 comments

Show HN: Deploybase – Compare GPU and LLM pricing across all major providers

https://deploybase.ai
3•grasper_•8h ago•0 comments

Show HN: Unfucked - version all changes (by any tool) - local-first/source avail

https://www.unfudged.io/
136•cyrusradfar•3d ago•85 comments

Show HN: Mrkd – A native macOS Markdown viewer with iTerm2/VSCode theme import

https://github.com/jahala/mrkd
3•jahala•8h ago•0 comments

Show HN: RetroTick – Run classic Windows EXEs in the browser

https://retrotick.com/
191•lqs_•2d ago•59 comments

Show HN: PraxisJS – signal-driven front end framework and AI experiment

https://praxisjs.org/
2•mateusgx•9h ago•0 comments

Show HN: Claude-File-Recovery, recover files from your ~/.claude sessions

https://github.com/hjtenklooster/claude-file-recovery
97•rikk3rt•2d ago•41 comments

Show HN: SplatHash – A lightweight alternative to BlurHash and ThumbHash

https://github.com/junevm/splathash
59•unsorted2270•1d ago•20 comments

Show HN: Boucle – A self-dogfooding autonomous AI agent framework in Rus

https://github.com/Bande-a-Bonnot/Boucle-framework
2•ElFitz•11h ago•0 comments

Show HN: Spekkio: Reverse-engineer specs from vibe-coded apps

https://github.com/paulkarayan/spekkio
5•tessier0ashpool•11h ago•0 comments

Show HN: I built a tool that turns any API into a CLI for agents

https://instantcli.com
6•stugreen13•11h ago•9 comments