Hacker News new | ask | show | jobs
by georgeecollins 1685 days ago
I hope that Rust joins the pantheon of eternal languages. I feel like it has a lot of the advantages of a language like C, but is just more modern and well thought through.

Also, you did not mention Java. I have very old Java code that still works fine.

6 comments

Java is probably the biggest "eternal" language we have these days. Probably tied with C and C++.

There's <<so much>> Java code churned out that it's unbelievable. Business systems have a ton more code than infrastructure systems.

> Java is probably the biggest "eternal" language we have these days

Is it? I haven't followed it in years but i remember reading about people sticking with Java 8 because later versions broke backwards compatibility in some cases.

Its a bit complicated, technically java language never broke backward compatibility. you can run existing java programs fine in higher java jvm's by adding extra command line parameters to include all existing libraries in default module. But it becomes complicated by the use of intermediate tools which are not updated to handle this.
Yep, modules were a big break, however all the relevant libraries that actually matter on the Java ecosystem are available on latest versions.

Basically it is the same kind of effect like school/university teachers whose idea of C++ is C with extras, and if they teach something more close to C++98 proper even in 2021, one should consider themselves lucky.

> [java] Probably tied with C and C++.

i think java wins over c/c++, because there's very little low level, machine specific code you can do in java, where as you surely can do that in c/c++.

True, and instead of rewriting the whole stuff, if some C or C++ is actually required there is always JNI, JNA, or the upcoming Panama.
I would check on cobol first.
There's a ton more Java out there. Java is much newer but it's from a time when we're talking about tens of millions of developers worldwide, instead of tens of thousands. A lot more people have been churning out Java since 1996 than Cobol since 1955 or so.
Do you have a feeling for how many Java LOC are out there?
I've worked for a 10 person company where 5 were working on a Java backend, the app was about 10 years old. 250k lines.

I used to work for a mediocre multinational with about 50 people working on a big Java front end to their many servers. Just the frontend was about 3 million lines.

You've never heard of either of them, the multinational had a market cap of about half a billion.

I've worked for a bunch of bigger companies but I don't have numbers, I just know they had bigger systems.

I wouldn't be shocked if there are tens of billions to hundreds of billions of lines of Java in production right now. I imagine that something like half a billion are added each year.

There are so many big Java middleware companies nobody has heard of. You wouldn't even know they use Java if you wouldn't look at the job listings.

If you multiply the 5000 LoC each developer at your 10-person company wrote yearly by the tens of millions of Java developers in your previous comment, you get much more than half an (American) billion
That's going to be quite a loaded metric considering how verbose Java is.
Java is at most longer than “short program” by a small constant factor, and that is mostly around project initialization.

Also, I have never really understood it — c++ is not the shortest thing either with duplicating headers/implementations, go’s error handling deserves a whole discussion in terms of verbosity yet these languages are not considered repetitive.

Well as a former cobol programmer, I would argue that it is no less verbose than pretty much any language.
C# is also probably in a similar league, for the same reasons.
> I hope that Rust joins the pantheon of eternal languages.

I'm torn about this. On one hand, Rust is so much better than C it is ridiculous and I really hope it does become a language with decade-long longevity.

On the other hand, Rust is the first new "systems programming" language in forever and is finally prying the door open to something other than C/C++. I'm really hoping that Rust opening the door and paving the way means that now we can get something better.

What worries me about Rust is the impedance mismatch down at the very primitive hardware level--bytes and registers. The embedded guys are doing an amazing job papering over it, but the abstractions leak through quite a lot and you have to twist things around to satisfy them.

The problem is: that's a lot of fiddly code with all kinds of corner cases. So, you either have a lot of work or you throw up your hands and invoke C (like Zig does).

I'd give it another 2-5 years before the syntax settles. Some serious improvements have recently been pushed out and I wouldn't be surprised if further improvements are on the horizon.
editions still allow backwards compatibility though, it's not like the syntax changes will break it
Rare example of broken backward compatibility: `cargo install gltf-viewer` doesn't work today because of an error in gltf library. The error is fixed, but gltf-viewer is not updated to use the fix.

   Compiling gltf v0.11.3
  error[E0597]: `buf` does not live long enough
   --> /home/vlisivka/.cargo/registry/src/github.com-1ecc6299db9ec823/gltf-0.11.3/src/binary.rs:225:35
      |
  119 | impl<'a> Glb<'a> {
      |      -- lifetime `'a` defined here
  ...
  225 |                     Self::from_v2(&buf)
      |                     --------------^^^^-
      |                     |             |
      |                     |             borrowed value does not live long enough
      |                     argument requires that `buf` is borrowed for `'a`
  ...
  233 |             }
      |             - `buf` dropped here while still borrowed
I'd like it to be so, but i dont have faith for it. rust doesnt have a standard like lisp/c/c++ and it stands to those languages for their eternality, and at least with lisp and C their relative simplicity makes all the difference for something like that. they feel like, despite how opposite they are, discoveries rather than inventions when compared to something so complex like rust and c++
I don’t think Rust will (at least not in current form). It’s breaking too much ground in the (real world) PL-design space. We just don’t know what really work yet!
Eh; sum types, everything-is-an-expression, and composition over inheritance get you very very far toward optimal language design. Sure there are some potential economic improvements that could made to Rust, but the foundation is so strong that I don’t see anything that makes those same design decisions supplanting Rust. More likely that a new Rust edition would incorporate those kinds of changes.
Java is younger than Python.
But Java 1.0 code is still (mostly) compile-able on recent Java versions, not so much with Python where I'd worry about going back 5 years.
Many Python developers and users were burned when the Python project decided to set fire to billions of lines of code.

I have zero trust in Python as far as code longevity is concerned.

More like trillions of lines of code, from probably millions of developers, dating back to the 90's.

"The total code size of Zope 2 and its dependencies has decreased by over 200,000 lines of code as a result." - from the 2013 Zope documentation... how many lines of code was it before then?

Python really burned its bridges. It's shown that it's a toy language now, and demonstrably unfit for any real production-quality projects.

> how many lines of code was [Zope] before then?

Soooo many. Zope was a very formidable code base to delve into. I was trying to learn it because my company was using Plone, and Zope quickly surfaced through the abstractions.

Zope's codebase might have been more accessible if type annotations were a thing back then. Their implementation of "interfaces" for Python were very interesting back in the Python 2.3 days.

I disagree that Python is a "toy" language now. It started out as one, and has been stumbling awkwardly away from that ever since the mid 2000s - virtualenvs, pip, pyenv, pipenv/poetry, type annotations, mypy etc.

In my entirely unscientific opinion, I think it was Django that started this journey, then of course scikit, numpy leading into pandas etc.

Both NumPy and Django were created in 2005, but Numeric, the ancestor of NumPy, is nearly as old as Python itself, and predates SciPy.
Bullshit. 2 => 3 transition was mostly mechanical and programmers who are unable to do it should get better.

I haven't seen py2 code in several years. Granted, I would look away in disgust if I did.

Right right right. I'll let my CTO know.
I wrote code that worked with both interpreters simultaneously for many years. I don't know why you'd worry so much.