Hacker News new | ask | show | jobs
by MaxBarraclough 2924 days ago
> tagged pointer representation allowing integers (and sometimes floats) to be encoded directly in the reference

I don't see how that could work for Java. Every Java object can be used as a mutex. This strikes me as very silly, but it's part of Java. Incidentally .Net went the same way, and I'm not the only person who thinks it was a silly decision for both frameworks [0]

Java also tags objects with type information for runtime checking, but that would play ok with tagged pointers as you're describing, as far as I can see.

Seems to me .Net generally has the right idea on types. Primitives are not objects, but you can do List<int> without autoboxing.

> Another alternate model is to pass the type of a value separately from the value itself, and allow the value to be of variable size.

Wouldn't that bloat the stack considerably? Wouldn't it be better to have a type-system that eliminates the need for that sort of thing?

> Java simply made the wrong tradeoff, and while it wasn't fully apparent at the time, there's no good defense of that decision today.

Are there any modern frameworks at all similar to Java, that do as you describe? Dog-slow dynamic languages aren't really the same beast.

[0] https://stackoverflow.com/a/282342/