frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Lowtype: Elegant Types in Ruby

https://codeberg.org/Iow/type
24•birdculture•4d ago

Comments

graypegg•4d ago
It's not always a good thing, but I love Ruby's ability to define new runtime-valid syntax that looks pretty much native to Ruby itself.

    def method(thing: String | "default value")
the pipe operator seems to be defined here, as just a regular method: https://codeberg.org/Iow/type/src/commit/aaa079bf3dd2ac6b471... the type gets picked out by the module included in the class you want typechecked, which reads the default value from all methods (which is the "real" ruby syntax here, where `thing` is assigned a default value of the result of calling `String | "default value"`) and uses that for type checking.

I like that over-flexibility... it's regularly too clever and makes it difficult to follow the flow of an application, but I like it all the same.

brudgers•2d ago
Though the ability to arbitrarily create first class syntax is why Rails is Rails, my favorite use case is FizzBuzz as a property of Integers. YMMV.
ryukoposting•4d ago
Mixed feelings here. Type annotations are a thing Ruby lacks, that other languages have, that I like using in other languages. Ergo, I'd like to have them in Ruby, right?

My knee-jerk reaction is "yes I'd like that" but when I pause to think about how I actually write Ruby code... hmm. I tend to use Ruby when its flexible syntax and type system are helpful. How much would I actually benefit from something that restricts the flexibility of the type system?

Bear in mind, I'm not a "Ruby dev" per se. It's a well-loved tool in my mostly firmware-focused repetoire. I use it for little CLI tools, and toy game engines too (mri embeds into C really cleanly). Fun little things that most folks would use Python for, I just like Ruby better.

vidarh•2d ago
Ruby has had "officiak" type annotations since 3.0.0 via RBS.

Exactly because of the concerns you described, RBS originally used only separate files for the type annotations, so it can be selectively and gradually applied. You can add Ruby signatures inline as comments as well, but frankly both options looks ugly, and so does many of the alternatives like Sorbet signatures.

jonathaneunice•5m ago
I had exactly this reaction when gradual typing came to Python. "Do we really need this??"

But over time, I've grown to love it. Programming is communication—not just with the machine, but with other developers and/or future me. Communicating what types are expected, what types are delivered, and doing so in a natural, inline, graceful way? Feels a big win.

Lio•2d ago
I love these new approaches to type checking such as this and Literal[1]. I think they really show how far we could go with runtime ruby syntax.

For both though I have questions:

A. How do I use this day to day to improve my tooling and developer experience?

B. If at some point in the future I decide to get rid of this how easy is it to eject?

I've seen too many adandoned dependencies over the years to trust anything I can't easily remove when it's time to upgrade.

These runtime typing efforts look nicer than Sorbet but, as far as I can see, you still have to have complete test coverage to trigger runtime checks if you want to spot correctness issues before you deploy into production.

Sorbet doesn't have that problem right now. Maybe something clever using Prism might be a way round that?

1. https://literal.fun/

Learning Music with Strudel

https://terryds.notion.site/Learning-Music-with-Strudel-2ac98431b24180deb890cc7de667ea92
223•terryds•6d ago•51 comments

I Designed and Printed a Custom Nose Guard to Help My Dog with DLE

https://snoutcover.com/billie-story
104•ragswag•2d ago•12 comments

Mistral 3 family of models released

https://mistral.ai/news/mistral-3
402•pember•3h ago•130 comments

Nixtml: Static website and blog generator written in Nix

https://github.com/arnarg/nixtml
61•todsacerdoti•3h ago•12 comments

Addressing the adding situation

https://xania.org/202512/02-adding-integers
223•messe•6h ago•66 comments

YesNotice

https://infinitedigits.co/docs/software/yesnotice/
81•surprisetalk•1w ago•33 comments

Advent of Compiler Optimisations 2025

https://xania.org/202511/advent-of-compiler-optimisation
270•vismit2000•8h ago•41 comments

Poka Labs (YC S24) Is Hiring a Founding Engineer

https://www.ycombinator.com/companies/poka-labs/jobs/RCQgmqB-founding-engineer
1•arbass•1h ago

Lowtype: Elegant Types in Ruby

https://codeberg.org/Iow/type
24•birdculture•4d ago•6 comments

Python Data Science Handbook

https://jakevdp.github.io/PythonDataScienceHandbook/
121•cl3misch•5h ago•27 comments

Show HN: Marmot – Single-binary data catalog (no Kafka, no Elasticsearch)

https://github.com/marmotdata/marmot
60•charlie-haley•3h ago•12 comments

A series of vignettes from my childhood and early career

https://www.jasonscheirer.com/weblog/vignettes/
101•absqueued•5h ago•65 comments

Apple Releases Open Weights Video Model

https://starflow-v.github.io
374•vessenes•12h ago•122 comments

What will enter the public domain in 2026?

https://publicdomainreview.org/features/entering-the-public-domain/2026/
421•herbertl•14h ago•281 comments

YouTube increases FreeBASIC performance (2019)

https://freebasic.net/forum/viewtopic.php?t=27927
133•giancarlostoro•2d ago•30 comments

Comparing AWS Lambda ARM64 vs. x86_64 Performance Across Runtimes in Late 2025

https://chrisebert.net/comparing-aws-lambda-arm64-vs-x86_64-performance-across-multiple-runtimes-...
103•hasanhaja•8h ago•47 comments

Lazier Binary Decision Diagrams for set-theoretic types

https://elixir-lang.org/blog/2025/12/02/lazier-bdds-for-set-theoretic-types/
34•tvda•5h ago•4 comments

Apple to beat Samsung in smartphone shipments for first time in 14 years

https://sherwood.news/tech/apple-to-beat-samsung-in-smartphone-shipments-for-first-time-in-14-years/
18•avonmach•41m ago•9 comments

Beej's Guide to Learning Computer Science

https://beej.us/guide/bglcs/
290•amruthreddi•2d ago•108 comments

How Brian Eno Created Ambient 1: Music for Airports (2019)

https://reverbmachine.com/blog/deconstructing-brian-eno-music-for-airports/
160•dijksterhuis•10h ago•84 comments

Show HN: RunMat – runtime with auto CPU/GPU routing for dense math

https://github.com/runmat-org/runmat
16•nallana•2h ago•3 comments

Fallout 2's Chris Avellone describes his game design philosophy

https://arstechnica.com/gaming/2025/12/fallout-2-designer-chris-avellone-recalls-his-first-forays...
42•LaSombra•2h ago•13 comments

An LED panel that shows the aviation around you

https://github.com/AxisNimble/TheFlightWall_OSS
64•yzydserd•5d ago•16 comments

Rootless Pings in Rust

https://bou.ke/blog/rust-ping/
107•bouk•11h ago•73 comments

Progress on TypeScript 7 – December 2025

https://devblogs.microsoft.com/typescript/progress-on-typescript-7-december-2025/
9•DanRosenwasser•29m ago•2 comments

Proximity to coworkers increases long-run development, lowers short-term output (2023)

https://pallais.scholars.harvard.edu/publications/power-proximity-coworkers-training-tomorrow-or-...
134•delichon•4h ago•101 comments

4.3M Browsers Infected: Inside ShadyPanda's 7-Year Malware Campaign

https://www.koi.ai/blog/4-million-browsers-infected-inside-shadypanda-7-year-malware-campaign
6•janpio•1h ago•0 comments

Tom Stoppard has died

https://www.bbc.com/news/articles/c74xe49q7vlo
159•mstep•2d ago•57 comments

After Windows Update, Password icon invisible, click where it used to be

https://support.microsoft.com/en-us/topic/august-29-2025-kb5064081-os-build-26100-5074-preview-3f...
167•zdw•15h ago•197 comments

Reverse math shows why hard problems are hard

https://www.quantamagazine.org/reverse-mathematics-illuminates-why-hard-problems-are-hard-20251201/
152•gsf_emergency_6•15h ago•35 comments