Earlier quoted context omitted.
Go's biggest flaw for backends is the error handling. No exceptions and nothing checking that you use the err. Java's issue might be the lack of cooperative multitasking until recently (virtual threads). Best you could do was those promises frameworks that mangle your code, and Google in particular uses something a hundred times worse called Guice (which is also DI).
Java's biggest problem is the fact that mutability is so baked into the language. I'm working on a project now where I always need to dig deep to find out if something has been mutated or not. Yes, there are records and we are now getting into data oriented programming. But older codebases are really hard to read.
Should I choose Ada, SPARK, or Rust over C/C++? (2024)
121–130 of 173 posts
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#122Earlier quoted context omitted.
Java's biggest problem is the fact that mutability is so baked into the language. I'm working on a project now where I always need to dig deep to find out if something has been mutated or not. Yes, there are records and we are now getting into data oriented programming. But older codebases are really hard to read.
Java also has (In my experience) a higher concentration of inept developers who seem to have never heard of guard conditiona and early returns, and prefer instead to wrap everything in if conditions, pushing the actual logic into deeper nesting levels. Pyramids of doom all over.
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#123Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#124Earlier quoted context omitted.
Java's biggest problem is the fact that mutability is so baked into the language. I'm working on a project now where I always need to dig deep to find out if something has been mutated or not. Yes, there are records and we are now getting into data oriented programming. But older codebases are really hard to read.
One of the classic problems with OOP
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#125Their example of why Ada has better strong typing than Rust is that you can have floats for miles and floats for kilometers and not get them mixed up. News flash, Rust has newtype structs, and you can also do basically the same thing in C++. I don't know much about Ada. Is its type system any better than Rust's?
This was posted to about a day ago: https://github.com/johnperry-math/AoC2023/blob/master/More_D... But a noteworthy excerpt: ``` Ada programs tend to define types of the problem to be solved. The compiler then adapts the low-level type to match what is requested. Rust programs tend to rely on low-level types. That may not be clear, so two examples may help: Ada programmers prefer to specify integer types in terms of…
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#126Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#127Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#128I really like the other compilers he worked on, e.g., SPITBOL, SETL
He taught CS but he studied chemistry as a student
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#129I found that learning Ada was a good way to learn how to write good C++ code, because both languages are at the same level of abstraction but Ada is clean and opinionated. The best a example is RAII. This is a pattern in C++ that you have to follow if you don't want to make a mess. In Ada it's a language feature called Controlled Types.
Do you feel the same is true for someone who does mainly rust nowadays ? I had the same feeling with rust & python ; If there are any patterns that help in other languages I'd definitely like to look them up
Re: Should I choose Ada, SPARK, or Rust over C/C++? (2024)
#130Earlier quoted context omitted.
I am no expert here what I remember is mostly from CS courses, but isn't the entire point of a formal program proof that you can reason about the combinatorics of all data and validate hypothesis on those? It's one thing to say: "objects of this type never have value X for field Y", or "this function only works on type U and V", but its a lot more impressive to say "in this program state X and Y are never achieved si…
But isn't the entire point of rust's verbose type system to declare valid states at compile time? I don't exactly see how this can't be proved in rust.
Yes, you could theoretically generate a Rust program that does not compile if some theorem does not hold, but this is often times (unless the theorem is about types) not a straightforward Rust program for the problem at hand.
I also think that, although Rust is blurring the lines a bit, equating formal verification and type-checking is not a valid stance. A type checker is a specific kind of formal verification that can operate on a program, but it will only ever verify a subset of all hypotheses: those about object types.