logoalt Hacker News

shevy-javatoday at 6:29 AM7 repliesview on HN

> languages without types tend to grow them, like PHP in 7.4 and Python type annotations

Well ... that is a trend that is driven largely by people who love types.

Not everyone shares that opinion. See ruby.

It is very hard to try to argue with people who love types. They will always focus on "types are great, every language must have them". They, in general, do not acknowledge trade-offs when it comes to type systems.

So the claim "tend to grow them" ... it is not completely wrong, but it also does not fully capture an independent want to add them. It comes ALWAYS from people who WANT types. I saw this happen "live" in ruby; I am certain this happened in python too.

> inevitably, people want to push types. even Go. C++ templates are the ultimate example. if it can be computed at compile time, at some point someone wants to, like Rust's ongoing constification.

And many people hate C++ templates. But comparing that language to e. g. ruby is already a losing argument. Languages are different. So are the trade-offs.

> dependent types can get you there. hence perfectable.

So the whole point about claiming a language is "perfectable", means to have types? I don't agree with that definition at all.

> most languages have no facility for this,

How about lisp?

> this lets you design APIs in layers and hide them behind syntax.

The language already failed hard syntax-wise. This is a problem I see in many languages - 99% of the language designers don't think syntax is important. Syntax is not the most important thing in the world, but to neglect it also shows a lack of understanding why syntax ALSO matters. But you can not talk about that really - I am 100% certain alok would disagree. How many people use a language also matters a LOT - you get a lot more momentum when there are tons of people using a language, as opposed to the global 3 or 4 using "lean".


Replies

andaitoday at 12:26 PM

You mentioned there are reasons not to type check your program. I would very much like to hear what they are!

Also, I have to point out that of course Ruby has types. And it does type checking. It just does it when the line of code actually runs. (i.e. runtime type errors).

So the discussion here isn't should we check types or not. It's a question of when to do it.

Do you want to know you've made a mistake when you actually make it? Or do you want to find out an unknown amount of time later (e.g. in unfortunate cases, several months later, debugging an issue in prod. Not that I would know anything about that ;)

---

My own thinking on the subject is that it should be configurable.

Rust's level of correctness, for example is probably overkill for a game jam. (As is, arguably, using a low level language in the first place.)

But my thinking here is that correctness should be opt out rather than opt-in. If you have a good reason to make your program wrong by default, then you should be allowed to do that. But it should be a conscious choice! And every source file, at the top of the file, should remind you that you are making that choice: #JAMMODE

And if you intend to actually ship the thing, and charge money for it, in Serious Release Mode the compiler should refuse to build anything that's still in jam mode.

My point here is that some languages make jam mode the only option you have.

ChadNauseamtoday at 6:32 AM

> So the claim "tend to grow them" ... it is not completely wrong, but it also does not fully capture an independent want to add them. It comes ALWAYS from people who WANT types.

Who else would add them, besides people who want them? I'm confused about what you're even claiming here. It sounds like you feel that there's a vocal minority of type enthusiasts who everyone else is just humoring by letting them bolt on their type systems.

mastermagetoday at 6:57 AM

Well Ruby kinda brought forth Crystal which while its own Programming Language is kinda Ruby but with Types.

vouwfietsmantoday at 10:45 AM

> do not acknowledge trade-offs when it comes to type systems

Could you elaborate?

show 1 reply
andersmurphytoday at 7:23 AM

> How about lisp?

I was wondering why lisp (and forth) were omitted from the initial list of languages named in the post.

I guess Scheme is in the list has ok macros.

show 1 reply
lelanthrantoday at 10:56 AM

> > languages without types tend to grow them, like PHP in 7.4 and Python type annotations

...

> Not everyone shares that opinion. See ruby.

All programming languages that have values (i.e. all of them) have types, because you cannot have a concrete value that doesn't have a type. This includes Ruby.

The only difference is whether the language lets you annotate the source code with the expected type of each value.

This is why you observe that all languages trend towards visible typing: The types are already there and it's only a matter of whether the language lets the programmer see it, or lets a linter enforce it, and everyone likes linters.

> So the claim "tend to grow them" ... it is not completely wrong, but it also does not fully capture an independent want to add them. It comes ALWAYS from people who WANT types.

Maybe you misidentified where the type declaration is coming from? It might not be coming from people who want to see types in the source code, it most probably is coming from people who want a decent linter.

In 2026, programming without type-enforcement is like programming using an LLM; it's quicker, but less safe.

show 2 replies
ModernMechtoday at 12:40 PM

Here's a recent talk about how "concrete syntax matters, actually": https://www.youtube.com/watch?v=kQjrcSMYpaA

Highly recommended!