Nice documentation. Ada looks a lot like Pascal. It is interesting that SPARK is a subset of subset of Ada.
It's Pascal inspired but certainly not any of Wirth's syntaxes, like 1/2 line if's, semi colons in weird places making blocks look odd. Ada has a more inclusive syntax, whereby "is" or "begin" and "end" encases what is inside it. Compare Modula's: MODULE X; ... END MODULE X. and Ada's: package X is ... end X; Ada's package feels like one statement containing others, whereby Modula's looks like it ends on the first li…
Introduction to Ada
141–150 of 193 posts
Re: Introduction to Ada
#142Earlier quoted context omitted.
I was a fairly junior software engineer at the time. And took the job only because it was 2008 and I was unemployed. Had never used Ada but the employer (rhymes with "Going") didn't seem to mind. My mother was kind of enough to supply me with all of her old Ada books when she finished laughing about me taking a job using a language she had long since left behind. The money was about... market rate for the time. Not g…
And precisely because it's a niche language, and you have the experience now, you should definitely accept those legacy maintenance requests, as a freelancer, and ask for big bucks. You're wasting opportunities here.
So they'll happily hire anyone with a clearance. If they can't find someone who already knows the language they'll eventually just hire someone who doesn't and let them figure it out on the job. Defense contractors do not pay big bucks for niche skills on legacy maintenance programs. Not to mention, it is some of the most boring work in the industry.
Re: Introduction to Ada
#143I spent about 4 years of my early career working with Ada in the aerospace industry (specifically, I worked on the GPS satellite program). It was rather career-limiting because I ended up as a young engineer with a lot of experience in an extremely niche language. It took a while, but I was finally able to escape and start working with more modern technology (involved a lot of self-learning on side projects and final…
Ada is just a language. The 99.99% of the experience you've acquired there perfectly transfers to any other domain or language - only uneducated HR gatekeepers won't recognize this.
Companies rarely want to pay for someone to learn on their dime unless there's a specific gain. It typically takes 3-6 months for an engineer to become truly effective and that's with domain knowledge transfer.
Domain experience is valuable and allows speed to get up and running.
Re: Introduction to Ada
#144Earlier quoted context omitted.
And precisely because it's a niche language, and you have the experience now, you should definitely accept those legacy maintenance requests, as a freelancer, and ask for big bucks. You're wasting opportunities here.
Ada is/was heavily used in the defense/aerospace industry. Most of these legacy maintenance requests come from defense contractors who do not want to pay top-dollar for expertise. They want to put butts-in-seats to soak up billable time and keep the govt customer just content enough not to cancel their contract. So they'll happily hire anyone with a clearance. If they can't find someone who already knows the language…
At the time I was a student, and was working as simple designer (AutoCAD) for an architect teacher who just opened his private architecture firm (6 months prior only). But the guy went to the board in question in last day, with a different bid. He proposed them bigger changes, not just renovation of exterior walls, but also design changes of interior space. Now doing that he made them go back to Ministry of Internal Affairs where the entire project instead of being billable as simple renovation, was changes and the entire budget would qualify for a superior plateau inside the Ministry levels of budgets. It jumped the qualification from (roughly estimated for today's $$$) $1M to $5M. And my boss at the time won. For next 6 months I worked my ass in AutoCAD to do all the changes and I am very proud of it even today, as it still stands as is currently.
Now here's your take of my above story. Get interested in their proposals, see what is about the projects and see if they can't actually be helped to jump to a bigger plateau of prices within government. You have the technical expertise, maybe it's time to create your relation expertise as well. They will jump through hoops and all if you bring them something to bill to something much higher their client (the defense department). Then you can really enjoy a bigger pay. Good luck and have fun.
Re: Introduction to Ada
#145Earlier quoted context omitted.
Thank you for posting that. Especially interesting in light of Walter Bright's comment(s) in this thread. I didn't quite understand why someone who wrote a c++ compiler would think Ada was insurmountable - this adds some context. In my nativité I'd have guessed that writing an Ada compiler was on par with Pascal (but with more types and stuff). This is probably the same (wrong) reasoning by which Mr Bright tricked hi…
I had always heard that PL/I and Ada are much more difficult languages for producing a suitable compiler.
The GNAT Ada compiler is OSS, so you can look it yourself. It has a hand-crafted lexer (for speed), but otherwise it's not complex. It uses recursive descent (for good error messages), but lots of compilers do that & it's not hard to understand either. (If you don't understand creating a recursive descent parser then you'll need to learn that, but it's a one-time cost to learn about that).
Ada is really easy to parse compared to C++. There aren't the backwards-compatible-with-C historical stuff that makes things complicated.
Ada has built-in support for tasks, including safe communication mechanisms for them. Many other languages today do too, so that's not such a big deal today.
Generating very good code is hard in any language. GNAT "cheats" by building on gcc, which already works on this problem. GNAT parses source code & then generates the internal structures needed for gcc to do its thing. Many language implementations parse & then pass things on to an infrastructure (gcc or LLVM), so that's not unusual.
PL/I is complicated in part because of its baroque "automatically figure out all the conversions" rules. Ada in general makes you be explicit about types, so that is a non-issue.
Re: Introduction to Ada
#146The GNAT Ada compiler is open source, generates good code, and has really good error messages. There's a story behind its development, which I tried to summarize here: https://dwheeler.com/essays/make-it-simple-dewar.html
"Dewar personally told me that when implementing the GNAT compiler, whenever they looked at the language specification and thought it might be complicated to implement, they assumed they didn’t understand the language specification and looked for a simpler way to do it. This mindset that “there is probably an easy way to do this” seems to have been different from others, who seemed to assume that complexity was always an inevitable part of the job."
I've been on the losing side of this battle my entire career. While I thought striving for simplicity was core to the job, it's only harmed me. Though it's nice to read about another person who apparently thinks like me.
If any one needs me, I'll in the basement with my stapler, sipping my now cold coffee.
Re: Introduction to Ada
#147One thing I liked about Ada is that the authors of the language also wrote why they choose things the way they are, what was rejected, etc... Their is a document about this called "The Ada Rationale" available on the web: http://www.ada-auth.org/standards/rationale12.html I did contribute the HTML version of the Ada 1995 Rationale (first language revision) back in the day: https://www.adaic.org/resources/add_content/…
It actually quite common in ISO processes, there are similar documents for C and C++ language revisions.
Re: Introduction to Ada
#148Earlier quoted context omitted.
I spent a lot of time circa 2009/2010 teaching myself Ada for similar reasons. I work in avionics systems (or used to, present job is not) and Ada is grossly underutilized. I’d be willing to wager half the bugs that I saw make it to the testers or, worse, the field would not have happened if we’d used Ada (and used the type system properly). And these days, using Spark, even more bugs could be detected before compila…
Using Spark contracts to specify and verify low level requirements should be a huge time saver. I too don't understand why everybody seems to use C/C++ nowadays. I guess commercial Ada is just too expensive.
Here's extensive research results based on function point analysis. http://www.ifpug.org/wp-content/uploads/2017/04/IYSM.-Thirty...
Whole lotta' mything going on!
Re: Introduction to Ada
#149I wish Rust had Ada's type system. It makes a lot of sense to define types specific to your algorithms and have the storage type determined at compile time.
Sorry, can you elaborate? I'm skimming through the documentation and I can't find a section on having "the storage type determined at compile time", except for the section on arbitrary-range integers.
Example 1:
type Byte_Count is range 1 .. 4
with Static_Predicate => Byte_Count in 1 | 2 | 4; -- Aspects are Ada 2012
type Component_Count is range 1 .. 4;
V1 : Byte_Count := 3; -- compiler error: expression fails predicate check
V2 : Component_Count := V1; -- compiler error: requires explicit conversion
For these two types I'm not really concerned about how they are represented by the hardware, but I could if I needed to.Example 2:
Extra constraints added to some pre-defined types:
subtype String8 is String
with Dynamic_Predicate => String8'Length Even_Integer mod 2 = 0,
Predicate_Failure => "Even_Integer must be a multiple of 2";
Example 3:Use big-endian for some network packets:
type Packet_Type is record
Header : Header_Type;
Data : Data_Type;
end record;
Low-level representation (placed in the private part of a package spec): for Packet_Type use record
Header at 0 range 0 .. 255;
Data at 0 range 256 .. 1855;
end record;
for Packet_Type'Bit_Order use System.High_Order_First;
for Packet_Type'Scalar_Storage_Order use System.High_Order_First;
for Packet_Type'Size use 232 * System.Storage_Unit;Re: Introduction to Ada
#150(Yes, I know the actual capitalization of my example identifier in JavaScript is "XMLHTTPRequest". That’s what makes it such a good example. :)