10 ms·
I think the visual style of the language rubs off. There is for example C-like: Curly brackets, small keyword count, etc ... This is a language for people w
by hyperman1 5y ago
I think the visual style of the language rubs off. There is for example
C-like: Curly brackets, small keyword count, etc ... This is a language for people who want to write fast code that gets things done, not a gram of weight too much. Hacker spirit.
Python-like: Indentation. A bit more keywords. This is a language that wants to be clear, beautiful, abstract, communicating to other readers. Academic spirit.
Cobol-like: A huge wall of text. Lots of Divisions and Organization. Bureaucratic, smells of meetings, punch cards and months of delay. Enterprise spirit.
Ada, unfortunately, looks cobol-like, so someone who knows nothing automatically assumes a ton of bureaucracy. Run away if you want work done.
Note this is purely cosmetic and has nothing to do with actual language quality.
- touisteur 5y agoStrangely, Ada, while aimed for large-scale developments (hence the 'bureaucratic' feeling?) since conception, puts a heavy weight on readability and maintainability. No implicit shortcut operators, words instead of symbols, specific block markers (for loops, ifs, lexical block, embedded functions, ...) and explicit generic instantiation. Can be a pain to write, but it's really easier for me (whose days consist mostly of Ada, java, python, C++, C - don't ask - coding and reading) to read.
- gavinray 5y agoA lot of this has been much-improved with Ada 2022 and recent changes. Notably, lambdas, pattern matching, less-verbose operators, etc. https://blog.adacore.com/going-beyond-ada-2022 https://blog.adacore.com/going-beyond-ada-2022
- touisteur 5y agoYou say 'improved' but I feel it doesn't always go the 'more readable' way. I'm very much not a fan of the 'dot notation' and still like to use named parameters, and force explicit types instead of the creeping auto trend. I read much more code than I write and I'm feeling... not heard on the recent changes to ease code writing. At least I can write libadalang scripts (or langserv one day 'to right-click add back what I need in for-of loops, or dot-notation.
- onox 5y agoSorry, but I disagree. Maybe in the 80s when developers were all yelling while coding :p Does this look like cobol to you? type GUID_String is new String (1 .. 32) with Dynamic_Predicate => (for all C of GUID_String => C in '0' .. '9' | 'a' .. 'f'); The only thing Ada has in common with cobol is that you can define decimal fixed point types (you specify the number of digits and a delta, which must be a power of 10) [1] I usually use ordinary fixed point types: type Axis_Position is delta 2.0 ** (-15) range -1.0 .. 1.0 - 2.0 ** (-15) with Size => 16; or (from wayland-ada [2]): type Fixed is delta 2.0 ** (-8) range -(2.0 ** 23) .. +(2.0 ** 23 - 1.0) with Small => 2.0 ** (-8), Size => Integer'Size; [1] https://en.wikibooks.org/wiki/Ada_Programming/Types/delta#Differences_between_Ordinary_and_Decimal_Fixed_Point_Types https://en.wikibooks.org/wiki/Ada_Programming/Types/delta#Di... [2] https://github.com/onox/wayland-ada https://github.com/onox/wayland-ada
- ajdude 5y agoIt's kind of the opposite for me. It takes much less time to understand what Ada-written code is doing compared to any of the C-type languages, or even Rust. It is very plainly written. Verbose, yes, but much more plainly written. Just take a look at this, and tell me it's not legible: https://github.com/joakim-strandberg/advent_of_code/blob/master/stda.ads https://github.com/joakim-strandberg/advent_of_code/blob/mas...
- mamcx 5y agoThe Pascal family could benefit by a bit more of brevity, but I trade the syntax of it to C-like langs like Rust any day. They are not that less verbose at the end: Is only in the "small" that look compact.
- Lucretia9 5y agoMaybe a bit like this? https://github.com/Lucretia/orenda/blob/master/samples/module1.om https://github.com/Lucretia/orenda/blob/master/samples/modul...
- mamcx 5y agoYeah, not bad. Another one, because look like you are looking for inspiration: https://www.elementscompiler.com/elements/oxygene/language.aspx https://www.elementscompiler.com/elements/oxygene/language.a...
- Lucretia9 5y agoYeah, I remember seeing that years ago, shame it's not open and only win/mac.
- 0xDEEPFAC 5y ago> Ada, unfortunately, looks cobol-like, so someone who knows nothing automatically assumes a ton of bureaucracy. Run away if you want work done. The Ada++ project (a modified GNAT compiler) might interest you then. http://www.adapplang.com/ http://www.adapplang.com/
- Jtsummers 5y agoHave you had a release since last April 1st? Or fixed the ugly case statement? case Variable: -- <==== when 0 => Put_Line ("Zero"); when 1 .. 9 => Put_Line ("Positive Digit"); when 10 | 12 | 14 | 16 | 18 => Put_Line ("Even Number between 10 and 18"); when others => Put_Line ("Something else"); } -- <==== Matching : with } does not make for clearer code.
- exitcode0 5y agoWhat other suggestions do you have besides changes to the case statements?
- Jtsummers 5y agoAda++ makes two changes to the Ada language. First, it changes some keywords into new keywords or symbols, but in a gross way (the case example, is becomes : as a blanket rule, even when it leads to : being paired with }). This could be done by a (tedious) awk program or sed script. The second change it makes is that use will also with a package, that's a nice ergonomic feature. But it's the only thing of modest complexity that it does to change the language. There are no other enhancements to the language that it introduces that make it a compelling thing or an obvious non-joke (it's release date for 0.2.0 was 1 April 2021). The actual Ada developers are focused on actual language enhancements with the Ada 2022 standard and increasing the scope of properties that SPARK (a proper subset of Ada now) can prove about a program. Including approaching some of the properties that people find desirable with Rust's borrow checker and lifetime analysis. Ada++ should be doing things like that, meaningfully improving the language and not just being a glorified awk program that doesn't change or add any real syntactic or semantic properties of the language. Also, the author should stop doing releases on April Fool's Day if they really want to be taken seriously.
- Jtsummers 5y ago> Ada, unfortunately, looks cobol-like, so someone who knows nothing automatically assumes a ton of bureaucracy. Run away if you want work done. Ada looks nothing like COBOL., except perhaps in the most superficial sense (a bit keyword heavy compared to most other languages). The syntactic structure is really not far from what people are familiar with, in sharp contrast to COBOL. Rosettacode is a good site if you want to find some interesting (small) comparisons between languages. This is from the GCD page: The COBOL version: IDENTIFICATION DIVISION. PROGRAM-ID. GCD. DATA DIVISION. WORKING-STORAGE SECTION. 01 A PIC 9(10) VALUE ZEROES. 01 B PIC 9(10) VALUE ZEROES. 01 TEMP PIC 9(10) VALUE ZEROES. PROCEDURE DIVISION. Begin. DISPLAY "Enter first number, max 10 digits." ACCEPT A DISPLAY "Enter second number, max 10 digits." ACCEPT B IF A < B MOVE B TO TEMP MOVE A TO B MOVE TEMP TO B END-IF PERFORM UNTIL B = 0 MOVE A TO TEMP MOVE B TO A DIVIDE TEMP BY B GIVING TEMP REMAINDER B END-PERFORM DISPLAY "The gcd is " A STOP RUN. The Ada version: function Gcd (A, B : Integer) return Integer is M : Integer := A; N : Integer := B; T : Integer; begin while N /= 0 loop T := M; M := N; N := T mod N; end loop; return M; end Gcd; The C version on that page demonstrates what I'd consider a bad practice, but I'll show it and how a clearer version might be written: static int gcd(int a, int b) { while (b != 0) b = a % (a = b); // not clear at all, good way to avoid a temporary variable return a; } static int gcd(int a, int b) int t; while (b != 0) { t = b; b = a % b; a = b; } return a; } Compared to Ada, that second C one is 3 lines shorter, which corresponds to the lack of `begin` and reusing the parameter variables rather than defining two new local variables for the loop. Ada doesn't permit you to assign to "in" parameters, which is the default. http://rosettacode.org/wiki/Greatest_common_divisor http://rosettacode.org/wiki/Greatest_common_divisor
- hyperman1 5y agoThis is one of those post where I'm happy to see so much people disagreeing, except I'm not sure we're disagreeing. Your key sentence is: ... except in the most superficial sense... That is exactly the barrier Ada needs to overcome. If people take the time to really look at Ada,they'd see its actually quite reasonable. But if someone asks what language to learn, they start with shortening the almost infinite list of languages to something worth looking at. This filtering process happens in the crudest possible way, based more on feelings and hearsay than on verified facts: How big is the ecosystem, how will other people look at my code, ... This proces delivers, say, about 10 to 20 languages worth actually spending time looking at them. That's the hurdle Ada has to jump. This is a marketing problem. If you look at rust, the work done by Mozilla and people like e.g. Steve Klabnik to put the language on the map is enourmously valuable. With code examples, blog post, fixing real world pain points, answering questions, .... It took years but they did it. If Ada had a group of people and a bigname organization, all doing this work, it would be a completely different story.