Hacker News new | ask | show | jobs
by superkuh 1354 days ago
It's okay. Portability depends on the behavior of the developers on average, not the rate of new features added to a language. Bash developers are generally conservative and not going to be using the newest backwards incompatible features for at least a decade. Whereas, say, Rust dev demographics are more bleeding edge types and when they get new features they use them immediately.

That's why bash scripts can be interpreted on any OS from 1995 to now and Rust can only be compiled on an OS which has updated it's rustc in the last 3 months.

Gotta hand it to Bash devs. They do a good job.

1 comments

> That's why bash scripts can be interpreted on any OS from 1995 to now and Rust can only be compiled on an OS which has updated it's rustc in the last 3 months.

You can get the same effect by trying to run scripts with bash 5.x features on a version of bash from 1995.

Rust code since 1.0 has the same level of backwards compatibility that bash does.

>Rust code since 1.0 has the same level of backwards compatibility that bash does.

That's true and exactly what I said. It's the rust developer demographic that lacks the consideration to write backwards compatible code.

I'm not sure the message is being conveyed properly -- looking up the GNU archive, it seems Bash 1.14 was the current release in 1995. Are people still making sure their scripts are compatible in Bash 1.14? Surely there's a subset of scripts that happen to work, but with numerous features that have been added since, there are plenty of scripts that won't.

Backwards compatibility isn't really about whether you can run code on _old versions_, but if you can run _old code_ on new versions. Scripts that were written with Bash 1.14 should work today (barring all the other external dependencies they may have...), but scripts that are written today won't necessarily work on 1.14.

That's the same as the Rust analogy: code written with Rust 1.0 should compile and run today, but code written today won't necessarily work on Rust 1.0 (albeit, there must be a subset of new code that would happen to work).

>Backwards compatibility isn't really about whether you can run code on _old versions_, but if you can run _old code_ on new versions.

Ah, sorry, I guess I mean forwards compabitibility then. The ability to interpret/compile code written by devs today on machines with software from years ago (or months ago in rust's case).