Live data from Hacker News

Giving Ada a Chance

ajxs.me

221–230 of 261 posts

Re: Giving Ada a Chance

#221

Earlier quoted context omitted.

There's a lot of Python dislike on here, so I thought I'd add my anecdotal story. I learned Basic, C, Assembly, and Matlab in college (in that order). However, I was never a very good programmer. After graduating, I bought an intro to Python book and read it cover to cover and did the examples. I then started writing scripts and it all kind of clicked. I found it really simple to build stuff. There's lists, tuples, d…

I started the other way round and came to Python long after I coded a lot in statically typed languages like Object Pascal, C++, Java, Scala and Rust. My feelings about Python are quite opposite to yours. I'm actually quite surprised how clunky Python is from my perspective. I expected a small, simple beginner-friendly language, optimized for gluing stuff together, but I've found a huge number of overlapping features…

Possibly lol. I find Rust & Scala to also require far too much boilerplate to get simple stuff done.

I suppose it depends on your intent. If you're writing a bunch of glue code, I seriously doubt Rust will be anywhere near as easy to reason about. Based on my own experience with the language, I can't imagine any coworkers ever grokking the language. Python on the other hand is picked up pretty quick. The beauty of Python is you don't need all that boilerplate nonsense like even having yo know what ADTs are or pattern matching or factory factory class. In Python, you just write code. A lot of people just have a few globals and a bunch of little functions and others use classes.

Maybe your domain is different? I might hate Python as much as you if I had to build a bunch of large backend code bases.

Re: Giving Ada a Chance

#222

Earlier quoted context omitted.

I started the other way round and came to Python long after I coded a lot in statically typed languages like Object Pascal, C++, Java, Scala and Rust. My feelings about Python are quite opposite to yours. I'm actually quite surprised how clunky Python is from my perspective. I expected a small, simple beginner-friendly language, optimized for gluing stuff together, but I've found a huge number of overlapping features…

Possibly lol. I find Rust & Scala to also require far too much boilerplate to get simple stuff done. I suppose it depends on your intent. If you're writing a bunch of glue code, I seriously doubt Rust will be anywhere near as easy to reason about. Based on my own experience with the language, I can't imagine any coworkers ever grokking the language. Python on the other hand is picked up pretty quick. The beauty of Py…

Not sure what boilerplate in Rust or Scala you're talking about.

I admit Rust is much harder to learn initially, but once learned properly, the amount of code in both languages is very similar (as long as we're not comparing one program calling out to a library and another one doing everything from scratch). Both can be very high level.

Here is a study where they've found Python to be not much less verbose than Java actually, despite Java being generally considered a verbose language:

https://blog.wolfram.com/2012/11/14/code-length-measured-in-...

> I seriously doubt Rust will be anywhere near as easy to reason about.

I find Rust easier to reason about because there are certain constraints on sharing mutable state forcing developers to keep to very simple data flows (complex data flows / dependencies are getting hard very quickly and the compiler will fight that a lot with you). Python has none of these, so reasoning about data structures that can be freely shared and mutated anywhere can be hard. Python needs a lot of self-discipline to not end up with unmaintainable code.

Re: Giving Ada a Chance

#223
post #53

I like the "clean feel" of Ada's syntax: it combines the elegance of Python with a bit more structure and does not suffer from Python's significant whitespace issues. The so-called "Ada comb" structure that is used for packages, subprograms, and even declare blocks makes it easy to find what you are looking for because it makes the source code more regular. The "Ada comb" is formed by the shape of the source code wit…

I use PL/SQL a fair bit, which was inspired by Ada. Unfortunately, the designers did not bring over ShortName is New ReallyLongAndAwkardName; Ah, well.

Some things are partially implemented:

  - type BOOLEAN is (FALSE, TRUE);
  - type VARCHAR2 is NEW CHAR_BASE;
  - generic collections
  - varargs
Unfortunately, they are only available for the PL/SQL team itself.

Re: Giving Ada a Chance

#224
post #53

Earlier quoted context omitted.

I use PL/SQL a fair bit, which was inspired by Ada. Unfortunately, the designers did not bring over ShortName is New ReallyLongAndAwkardName; Ah, well.

> I use PL/SQL a fair bit, which was inspired by Ada. I have a bit of a project-idea here: PL/SQL+Ada+VHDL all together in an IDE. > Unfortunately, the designers did not bring over > ShortName is New ReallyLongAndAwkardName; Do you mean renames? Package Text renames Ada.Strings.Fixed; IIRC, RENAME is in the keywords list for PL/SQL.

RENAME is a command in Oracle SQL. I see in the documentation that PL/SQL gives it as a "keyword", not as a "reserved word". This means, I gather that you can name a subprogram as RENAME, though Oracle recommends against it. You could not, on the other hand name a subprogram INSERT, unless you double-quoted it--which, again, Oracle recommends against.

Re: Giving Ada a Chance

#225

I tend to like Ada, but it is a tiring language to read with the all caps. Also, it 'feels' like it has a gatekeeper group and really doesn't come up in any mobile conversation. I still believe someone will do something akin to a syntax substitution and come up with a well liked language. Also, modern Fortran is not that bad of a language much like the modern parts of C++.

The community is definitely not helping, or has not helped. It seems to be improving but I've seen a lot of negative responses to novices that read like some of the things I saw in the 00s when trying to get into Common Lisp. Some individuals are willing to push past this, for others it's a deal breaker. The community is becoming more open (AdaCore has been very helpful here), I think, but you still have a fair amoun…

If it's any consolation, the Common Lisp community nowadays is very welcoming!

Re: Giving Ada a Chance

#226

Earlier quoted context omitted.

The community is definitely not helping, or has not helped. It seems to be improving but I've seen a lot of negative responses to novices that read like some of the things I saw in the 00s when trying to get into Common Lisp. Some individuals are willing to push past this, for others it's a deal breaker. The community is becoming more open (AdaCore has been very helpful here), I think, but you still have a fair amoun…

If it's any consolation, the Common Lisp community nowadays is very welcoming!

It is, and I should have said that. I pushed past the issues in the larger community when I started because I had a good local community (grad school, prof was pushing it). About the same time the general community behavior was improving, and now it's a very welcoming language community. You still occasionally get curmudgeons but they aren't the loudest voices.

Re: Giving Ada a Chance

#227

Earlier quoted context omitted.

Possibly lol. I find Rust & Scala to also require far too much boilerplate to get simple stuff done. I suppose it depends on your intent. If you're writing a bunch of glue code, I seriously doubt Rust will be anywhere near as easy to reason about. Based on my own experience with the language, I can't imagine any coworkers ever grokking the language. Python on the other hand is picked up pretty quick. The beauty of Py…

Not sure what boilerplate in Rust or Scala you're talking about. I admit Rust is much harder to learn initially, but once learned properly, the amount of code in both languages is very similar (as long as we're not comparing one program calling out to a library and another one doing everything from scratch). Both can be very high level. Here is a study where they've found Python to be not much less verbose than Java…

That study is also based off of Rosetta code tasks. I'm not sure if that accurately portrays code in the wild. Java codebases are full of design patterns that are entirely uneccessary in Python. Ever hear someone talk about design patterns for Python? It exists, but it is niche instead of the norm and I've literally never heard it mentioned in hundreds of hours talking about Python with coworkers.

I'm sure Rust makes lots of sense when it comes to concurrency and systems programming, but that's not where Python shines or is meant to be used. In scripting, task automation, data science...etc it is really hard to beat. So maybe we're arguing over the usage of an axe and a sword on the battlefield and not about different swords lol.

Re: Giving Ada a Chance

#228
post #190

Earlier quoted context omitted.

> "As of Rust 2018, this still can cause undefined behavior." This is referring to the fact that you have to be careful when accessing the fields of a packed struct that everything is aligned correctly. Normally anything where "you have to be careful" in order to uphold memory safety requires use of the `unsafe` keyword, but due to an oversight Rust doesn't currently require it in this instance. So, in typical Rust f…

That is a mistake. Architectures are being updated to support unaligned access. MIPS, PowerPC, and ARM have all been updated. The machines that can't handle unaligned access are going the way of machines with sign-magnitude integers, trap representations, 9-bit bytes, base-16 floating-point, and so many other terrible things that must have seemed like good ideas at the time.

Misbehavior manifests even on x86, see the tracking https://github.com/rust-lang/rust/issues/27060 for examples. If you have more information, please leave a comment there.

Re: Giving Ada a Chance

#229

Earlier quoted context omitted.

Beginners to programming don't agonize over variable types, they don't have the mental model of statically typed language in their head.

They may not have "a mental model of statically typed languages," but they sure "agonize" when there are eight different incompatible datatypes that represent a datetime and the library functions they want to use don't even specify which of these they take or return.

It's true that compulsory static typing can mitigate documentation bugs. But the effect isn't significant in the programming beginner experience.

Re: Giving Ada a Chance

#230
post #36

Earlier quoted context omitted.

I enjoyed Fortran/FORTRAN. Is a nice succinct language. "Lovecraftian hieroglyphics of Fortran" <-- the author never programmed in Perl, I presume.

> "Lovecraftian hieroglyphics of Fortran" Or in Fortran, it's a relatively verbose language from what I remember of it (that said, I learned Fortran 90/95, so maybe the older variants were worse)

Modern Fortran (2008/2018) syntax is a bliss. You would almost not notice if your are coding in MATLAB or Fortran with the advantage of your code being orders of magnitude faster in Fortran. Those who criticize the syntax of Fortran have probably not learned anything beyond F77, or at best F90.
Post reply on HN