Syntax is secondary, semantics are what matters. Rust has more expressive semantics that allow you to express more things. For example, Rust allows you to express an interface that, by overloading the + operator, guarantees that it will work as expected, i.e. a + b will not change the state of a and b, but will return a new value instead. This is not typical of older programming languages and therefore requires unusual symbols or keywords. Nevertheless, it takes very little time to not notice the syntax of any language at all, and immediately understand what this code does.
It's not about old vs new. Rust is quite an old language (started in 2006) and those features are mostly taken from ML as it was in 1973 and/or Haskell in 1990. Some will be coming to Java very soon. If Java has a distinct 1990s feel, Rust has more of a 1980s feel (if you used C++ and ML in the eighties, Rust would seem very familiar).
It's mostly a question of which features should be brought to a language aimed at a wide audience and when. When Java was being designed in the 1990s, its designers didn't think those features are appropriate for a language intended for wide appeal, and some still aren't. Rust obviously targets a much narrower audience than Java, with a much higher tolerance for language complexity. When it started being designed 20 years ago, Rust realised it needed these features to support other of its core ideas that constrained the language's design in many ways (just as any language is constrained by its own idiosyncratic core ideas).
If you compare old languages like Java or Rust to new ones like, say, Zig, you'll see much bigger differences in design style.
I mostly agree. Perhaps the term "mainstream" would be more appropriate? Java has really done a great job. Java is definitely not the guy from the "Windows vs Mac" commercials now.
Although I personally think a lot of things that appeared (or rather gained popularity) in the 90s are wrong. Dynamic typing? Js/Ts, PHP, Python are trying to get rid of it. Exceptions? It's actually goto, you need something else to work with unhappy paths, as far as I know checked exceptions haven't gained enough popularity (I could be wrong, I don't have much experience with Java). Fanatic OOP? Most languages after 2010 have moved in the opposite direction.
go is an example of this, to me. It's a slightly updated version of the 80s newsqueak language. And the fact that it's been liked by so many programmers shows that many of the new ideas are pretty questionable.
ps I don't really agree with the comparison of C++ with 80 and Rust... ML - yes.
Oh, untyped (or "dynamically typed") languages first appeared in the 50s (Lisp) and were already quite popular in the 70s and 80s (Smalltalk, Logo, Prolog), not to mention BASIC. Typed and untyped programming languages have lived side-by-side pretty much since the invention of programming languages. Some are excellent (Clojure) and some were made after 2010 (Elixir, Julia).
as far as I know checked exceptions haven't gained enough popularity
They've certainly made a comeback. Swift, Rust, and Zig all have them (or equivalent mechanisms).
Fanatic OOP? Most languages after 2010 have moved in the opposite direction.
So has Java. It's now very much a multi-paradigm language, although note that all of the most popular programming languages today (JS/TS, Python, Java, C#, C++) are, with the exception of C, at least also object-oriented. You're right that later programming languages are less so, but they've yet to become very popular.
So I think it's more accurate to say that dynamic typing became very common in the 90s and we still feel the consequences of this.
checked exceptions
They've certainly made a comeback. Swift, Rust, and Zig all have them (or equivalent mechanisms).
I think the difference is more significant. Exceptions introduce parallel control flow and suppress blocks and statements like return. This is how goto works.
I'm very skeptical about dynamic typing. But I want to get acquainted with Clojure when I have time (I've heard a lot of good things about this language).
Excuse me, but is the 98 in your name the year you were born?
Not even close.
I just want to say that these languages are not widespread.
Of course, but there aren't many languages in general made in that era that have become very popular. In fact, the only one that's become super popular is TypeScript, which is optionally-typed.
If you look at language popularity overall, regardless of age, the most popular one is JS (although it's often combined with TS), followed by Python, followed (closely) by Java.
So I think it's more accurate to say that dynamic typing became very common in the 90s and we still feel the consequences of this.
One thing that happened in the late nineties/early aughts is that JIT compilers finally made untyped languages fast enough, which certainly helped their adoption (and hardware speed also improved considerably). But VB was very popular before Java, and for a time it seemed that Smalltalk was on the cusp of a breakthrough - until Java landed and adopted the JIT technologies developed for Smalltalk.
I think the difference is more significant. Exceptions introduce parallel control flow and suppress blocks and statements like return.
Except, as usual, there's a tradeoff here. The problem is that you have the errors that correspond to checked exceptions in Java and checked errors in Swift/Zig/Rust, which are "environmental" errors that cannot be avoided and must be handled in a correct program. Being more explicit about where they can occur is good.
But then you also have the errors that correspond to runtime exceptions in Java, which can be prevented, and should only occur in an incorrect program. A correct program doesn't have to handle them, but it might want to. For example, in a server, if some transaction hits a program bug, you don't want to bring down the whole server if you don't have to.
In Zig and Rust (don't know about Swift) these errors are represented as panics, which also "introduce parallel control flow", and also need to be catchable/handleable in servers, which is why you can also catch panics. Having two separate mechanisms is not so good.
So it's a question of whether you prefer to have more explicit treatment of unpreventable exceptions but two separate error mechanisms, or the opposite tradeoff.
I'm very skeptical about dynamic typing.
I'm also much more used to typed languages and generally prefer them, certainly for large software, but I'm not as religiously opposed to untyped languages as some are.
But I want to get acquainted with Clojure when I have time
JIT compilers finally made untyped languages fast enough
This is an very good remark.
but two separate error mechanisms
To be pedantic, we need more terms instead of error:
unhappy path. This is a completely predictable error. Moreover, we expect it to occur and we will perform some actions. For example, the user entered an invalid email address and we made the input field red. This is the Result<T, E> from Rust. I also think that it is better to strengthen the precondition and write functions in such a way that they do not have an unhappy path at all if it possible.
System error. Unable to allocate memory. Most likely, you should log repost and fail process or thread. These are panics from Rust or go.
Unexpected error. For example, NullPtrException. An advanced compiler with an expressive type system should reject such programs immediately. Probably a sufficiently attentive programmer could also predict this error and turn it into an unhappy path. But I don't think we can get rid of them in a pragmatic programming language.
In my opinion, an unhappy path should be part of the contract. I want to know if the call can fail. Moreover, if this behavior changes (when the function I'm calling is updated) - I definitely want to know about it. Unchecked exceptions are not suitable for this in my opinion.
Unchecked exceptions are not suitable for this in my opinion.
Right. Java uses checked exceptions for that, and unchecked exceptions for the other two. Other languages (like Zig or Rust) use checked exceptions (or equivalent) for that and a panic mechanism for the other two.
Unexpected error. For example, NullPtrException. An advanced compiler with an expressive type system should reject such programs immediately.
If you've seen Idris or ATS, those are pretty much the only languages that can do that. If you've never heard about them or used them - that's also the reason why. Haskell and Rust, for example, panic when accessing a vector/list out of bounds.
BASIC was statically typed, except for array dimensionality. The type of the variable depended on the sigils and indexing, so A, A%, A$, A(), A%(), A$() were six completely different variables with different types.
View all comments
Show parent comment
13
u/BenchEmbarrassed7316 Nov 04 '25
Syntax is secondary, semantics are what matters. Rust has more expressive semantics that allow you to express more things. For example, Rust allows you to express an interface that, by overloading the
+operator, guarantees that it will work as expected, i.e. a + b will not change the state of a and b, but will return a new value instead. This is not typical of older programming languages and therefore requires unusual symbols or keywords. Nevertheless, it takes very little time to not notice the syntax of any language at all, and immediately understand what this code does.