5 ms·
I never quite understood why Ada/Spark dont get the same attention or love.
by ksec 5y ago
I never quite understood why Ada/Spark dont get the same attention or love.
- programmer_dude 5y agoAda syntax is too verbose.
- MaxBarraclough 5y agoAda deliberately places readability before writeability. It's interested in the maintainability of large mature programs, and isn't intended for rapid application development. I don't have enough experience with Ada to comment on whether its verbose and keyword-heavy syntax succeeds in this goal.
- zerr 5y agoCode is not a prose. C-like syntax is much easier to read compared to Ada/Pascal's text blobs.
- oblio 5y agoAccording to studies which we have none of right now. So that's like... your opinion, man.
- zerr 5y agoBesides, if the prose would have been preferable over symbols, we'd be writing e.g. "an unknown number of apples summed up with an unknown number of pears equals to one hundred entities" instead of "x + y = 100" in math classes :)
- MaxBarraclough 5y agoThat's a caricature. We sometimes use words for summation, e.g. Python's sum and fsum functions. I do wonder though if people had to write like that before the development of modern mathematical syntax. Even the '=' symbol is relatively young. Wikipedia tells me it was invented in 1557. SQL is another 'wordy' language. There are many, many things wrong with the SQL language, but I wouldn't say its wordiness is one of them.
- mech422 5y agoAncedotally, I agree with zerr's comment below. Its generally not the syntax/keywords that make code hard to read, or easy to maintain. If you're familiar with the language, you learned to parse those basically sub-consciously. For me, its always the var/function names and comments that determine how readable a program is.
- cogman10 5y agoQuiet frankly, they solve different problems. Ada includes a GC as part of the runtime and can still run into memory safety issues if you don't use the GC. Rust has opt-in memory safety issues but outside of those, does not require a GC. Rust does not have Ada's constraint system. In that way, rust is easier (and arguably less safe) to program. Ada didn't get the same love as Rust for the same reason D goes pretty unloved. The problem systems engineers needed solved was memory safety without a GC. Neither D nor Ada solve that problem.
- docandrew 5y agoThis is incorrect, Ada's spec leaves open the possibility for GC, but none is mandated or even used AFAIK. The GNAT runtime is non-GC.
- masklinn 5y agoMemory safety without a GC. AFAIK short of SPARK: * Ada has pointer arithmetic, you can overflow buffers or read out of bounds. * Dynamic allocation is straight unsafe and unchecked (unless you have a GC, in which case… you have a GC), you can use-after-free and double-free if you copy pointers beforehand. * Accessing uninitialised variables is not forbidden. * You can dereference null pointers (though it should cause an exception so I guess that's memory-safe).
- onox 5y ago> * Ada has pointer arithmetic, you can overflow buffers or read out of bounds. Not true. Arrays have bounds and those are checked. However, you can do arithmetic with the type ptrdiff_t of the package Interfaces.C.Pointers. You can also do an Ada.Unchecked_Conversion on a pointer that you get from a C function. Obviously that's unsafe. > * Dynamic allocation is straight unsafe and unchecked If allocation on the heap fails, it will raise a Storage_Error, but you can catch it. Also, the language has a lot of restrictions on when you may copy and store a pointer. > * Accessing uninitialised variables is not forbidden. True, but there are pragmas like Normalize_Scalars (to initialize them to invalid values) or Initialize_Scalars. > * You can dereference null pointers True, but dereferencing will raise an exception. Also you can define non-null pointers like this: type Foo_Ptr is not null access Foo; or add a "not null" constraint to a nullable pointer type: procedure Bar (Value : not null Foo_Access);
- shakow 5y agoIMHO, Ada missed its chance to shine when it didn't have any satisfactory FLOSS build chain right at the time that paying for a compiler became a thing of the past.
- MaxBarraclough 5y agoI think you may be right, but it's disheartening that this essentially boils down to a failure of hype. Ada may be a good language, and GNAT may be a fine Free and Open Source Ada compiler, but Ada isn't a new programming language. Software developers only chase shiny new things. Ada is held back by its beginnings as a niche language with expensive compilers, it doesn't matter that this hasn't been the case for decades now.
- bigbillheck 5y ago> it's disheartening that this essentially boils down to a failure of hype. That kind of thing happens; we're in a profession that is made up out of people.
- kbenson 5y agoDon't undersell that programming is tribal, and any language that deviates too far from the C/C++ syntax (from the ALGOL mold, that is) will constantly be fighting against what people consider the "norm" and those preconceptions. The closer the language is targeted at something that C and C++ are still commonly the main choice for, the harder it will be to get some people to consider an alternative if it using different syntax or structure in any way. I think one big stumbling block people had in adopting ADA (along with there not being a good open source toolchain for a long while as noted here) is that it just looks different to people that primarily use C and similar languages, and that puts some people off. That's sad, and I would rather it not be true, but it's become increasingly obvious to me from how people treat numerous newer languages I've seen pop up over the years.
- tomtheelder 5y agoThere are plenty of very successful languages that look nothing like the C family. I think the syntax of ADA has a different issue, which is that it- to me at least- evokes languages that are considered old fashioned or out of date like BASIC/Fortran/COBOL. I'd be more than willing to give Ada a chance, but when I looked at code samples I definitely had to fight an automatic response of thinking it was something out of date based on how it looks.