- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
magnificient absolute comment!
Admin
And yet he trusted the compiler not to use successive approximation for the SQRT?
Admin
Only an Ada deals in absolutes
Admin
MAGRA, good god, What is it good for? ABSOLUTELY NOTHING
Admin
Somehow abs seems to be a popular target for wannabe optimizers. I remember back in the 1990s, when Usenet was popular, someone proudly posted his hand-optimized inline-assembler version of integer abs in a Turbo Pascal newsgroup. While better than the absolute naive code with branches, it performed worse than even the code TP emitted by default. This means something because while TP was a quick compiler, it barely did any optimization at all.
Admin
(though I’ve never actually heard of anyone using it either…)
Er yes, that would be us.
Back in 1987 we designed and built the first commercially-available system built in ADA and deployed as an embedded application on a piece of custom hardware. We delivered it on time, within budget, and it worked first time.
Admin
ADA is still was in the military domain.
Some ships, planes and other things are coded in ADA.
It may explain the 'nobody talks about ada' part, I guess.
Admin
...not to mention when you pass a large number and get an overflow error...
Admin
At my current job, we have a screen in our app where the user selects which days in a calendar week they want a specific event to occur. How do you pass around basically 7 Booleans? The old version of that screen chose an integer with bit fiddling... because “optimization”
Admin
Ada was created by the US Department of Defense for military purposes. You don't hear much about it because most code written in Ada is classified.
Admin
Another example for use of ADA is the Ariane rocket's control software, that was mathematically proven to be correct and still lead to the failure of the first launch test (https://en.wikipedia.org/wiki/Ariane_5#Notable_launches). One of the two examples I know of a mathematically proven piece of software that contained a bug.
Admin
Ah yes, the Wrath of Magra.
Admin
I think we all know how the saying goes... "You can write FORTRAN in any language"
Admin
My main experience with ADA was in one of my earliest jobs working for a defense contractor. Several of the veteran developers who had spend most of their career writing ADA suddenly found themselves working with this newfangled C thing (this is early 2000s, mind you), and not doing a very good job with the transition. So there I was, a still-green college grad, trying to explain pointers to these guys... Ah, memories.
Admin
Bit masks are pretty standard. Optimization might not be the main issue here, but they may actually be more readable and maintainable than 7 separate parameters, and perhaps 7 DB fields to store them etc., if you know understand them. And if you don't understand bit masks (or for that matter, Boolean expressions with more than one operator), you really shouldn't be a programmer.
Admin
I only used Ada in one course in university. Pointers are called Access types in Ada. If I recall my professor from 30 years ago correctly, the developers of the specification saw the problems that pointers can cause in languages like C, so specified that pointers were not be available in Ada, but the people actually writing the language found them so useful that they stuck a restricted-use pointer (restricted compared to pointers in C) in anyway and called it an Access type. By the time the specification people caught wind of what this Access type really was, it was too late; it had survived too many iterations and approvals of the language so far and too much had been written using it to scrap it and rewrite everything that relied on it to do something else.
Admin
I consistently fail to understand why people think they can "do better" than the folks who designed the language and all its libraries. Sure, some things are WTFs waiting to happen (just look at code written in any language by fresh "developers" who just graduated with a degree in "count from 1 to 300 by 17s and add those numbers up") because of ignorance, but what if RA is an irrational value? Pi?? 1/3???? If you call this an "ABS Function":
then not only do you not understand how to use documentation to find out what libraries and built-ins are available, but you probably don't understand Math, Computers, Programming, or Common Sense, either.
Addendum 2019-12-12 10:11: EDIT: Yes, I realize 1/3 is rational, but I used it to point out the rounding problem
Admin
Ada has access type types, which are better than pointers, and address types which are pointers. I suspect that they were not doing very well before the transition either.
Admin
A language like Java who has no 'pointers' still throws null pointer exceptions ...
Admin
Ada I do believe I failed you. Ada I know I let you down. Don’t you know I tried so hard to love you in my way? It’s easy let it go…
Admin
Last job - school years 2009, 2010 and 2011. Worked in a vocational shop called programming and web development. previous name was data processing.
they still taught programming in cobol until about 2006. we taught in visual basic, java and javascript. python may have happened later. big accomplishments for me was getting the name updated to pwd. it amazed me that the future programmers were still being taught cobol rather than something more modern. at this level, the name of the game is to lay down fundamentals and foundations. I am of the age that my high school taught in basic (early 80s) and computer science was taught in C in the late 80s. Why cobol in 2005 was still an appropriate standard in a state that prides itself on being a top leader in public education, still amuses me.
Admin
Whenever I think of ADA, I always think of a high school programming competition I participated in. This was in the early '90s in Michigan. Our team came in 2nd; the winning team (which had won many years in a row) used ADA (just like they always did).
I never learned ADA, but it does hold a kind of mythical presence in my mind ever since then.
Admin
Ada was designed by and for the US Defense Department, so when it came out in the early 80s it was (relatively) slow, unwieldy, and very ungainly and verbose - like Pascal, but more (and it has a weird task model). Most people just went 'ffft' and went back to using languages more suited for their own domains - BASIC, C, FORTRAN, COBOL, or ASM.
Since then the hardware and compilers have more than caught up, and Java is just as unwieldy and verbose. But since Ada still has the 'uncool' stink on it, and a lot of people don't like the US DoD, it mostly only gets used for super-critical applications where you really want all the guarantees it has, usually avionics. If you run into it in school it's usually as a passing curiosity.
But since we love to re-invent things, Rust is basically the industry re-inventing Ada.
Admin
ADA is a verbose version of Pascal. But ADA's one of the few languages where parallelism is built into the language itself - you can have implicit locking and critical sections and monitors and stuff because it's part of the language without having to manually deal with those things yourself.
VHDL is also derived from ADA, because hardware is naturally parallel.
Had to learn it for a parallel programming class. Or was it an OS class, I can't remember. basically everything was happening in parallel and it helped to abstract out the need to worry about mutexes, semaphores and locks.
And yes, both ADA and VHDL are more DoD things, industry uses other languages for parallel programming and HDLs (i.e., Verilog). (Think of it this way - I took a semester of VHDL to do stuff with it. I had a week of Verilog to get competent in it).
Admin
Off: a subset of Ada is known as Oracle PL/SQL
Admin
Floating and fixed point numbers (which ADA has) cannot represent irrational numbers, including pi. Square and square-root of 1.0/3 has the same rounding error as 1.0/3 itself (which already cannot be represented exactly) in any common FP type.
So while this method of doing abs is bad, it's not for the reasons you seem to think.
Admin
"A language like Java who has no 'pointers' still throws null pointer exceptions ..."
This always bugged me. Couldn't they just call it a "null reference exception"? It's not like Java abstracts away the concept of the null reference or something, the only thing it abstracts away is the numerical nature of the pointer (aka you can't add +1 to it to move around the memory), so there is no reason it shouldn't be a "null reference exception".
Typical Sun Microsystems unix-beards, exposing internal details of the things they are abstracting right and left I guess...
Admin
'Couldn't they just call it a "null reference exception"?'
I'd prefer "null derefence exception. It's not the null reference that's the problem (okay, philosophically, maybe it is - but that's not what there was a problem executing), it's the attempt to dereference it.
Admin
Your point is right. But...
RA can never be irrational.
Normal floating point representations are unable to represent irrational numbers. (They may approximate them.) Heck, they don't even represent "all" the rational numbers (even within the range of values that those types support).
Yes, saying it again, your point is valid: squaring a floating point number and taking the square root may not always bring you back to the exact same number.
Admin
We Ada users like to call it Ada, not (please) ADA. I don’t think you’d write PASCAL, which is also a person’s name.
Admin
First, it wasn’t mathematically proven. Second, even if it had been, taking an intertial reference system proven to work on one rocket and use it on another rocket (which happened to have a similar name) without any testing was beyond foolish.
Admin
If it's IEEE floating point you can just use some pointer massaging and an OR.
Admin
Mathematically correct "according to specification", but the specs might be wrong ;)
Like the 737 MAX, the code was doing what it was supposed to do, it just did not consider the case when hardware failure supplied incorrect values to begin with.
Admin
To my knowledge they simply chose the wrong data type. The old sensor just delivered a byte of acceleration data (e.g. 200 as 2g) and it was used as byte. The new booster delivered 3g (which would be 300 on the same scale).
Admin
Back in the day I wrote and read a lot of FORTRAN. Don't recall seeing anything as dumb as those ABS simulations.
Admin
Wowzers. Seems like Remy and everybody here fell asleep in math class. In more abstract terms, an absolute value is the distance from the origin. In a vector space, that means the Pythagorean theorem.
magra
is the magnitude ofra
. Ra had a lot of magnitude before O'Neil (that's one L) and Jackson blew him to smithereens.Admin
When you think of the billions of lines of COBOL still in daily use all over the world, teaching COBOL is not such a dumb idea. Most of the people who wrote the original code have retired or are about to. So who is going to maintain this legacy code?
Admin
Thou shalt square the components of thy vectors and then square root the sum to find their magnitudes, even though thy vectors are one-dimensional, even though that may cause errors in the magnitudes of thy vectors, lest face the fury of Ulysses.
Admin
There are software errors and there are harware errors, and when the new Ariadne rocket engine output exeeded previous models and caused a vertical owerflow, it was a hardware failure, not a software failure and not a failure with Ada.
Admin
Go read through the .NET reference source and tell me you still trust the designers of the language and its libraries.
Admin
I wrote a lot of Ada (not "ADA"), mostly early in my career. It was an excellent language for our domain (aerospace/military).
The worst Ada code was almost always written by former FORTRAN coders. We usually referred to this as "AdaTRAN".
Admin
The reason there isn't a site for that is that the site itself wouldn't be reliable enough...
Admin
I cannot imaging a real FORTRAN coder would do that - I'm confident they would do some sort of fancy bitwise operation in place of calling a built in function (i.e. manually clear the sign bit?). But even though there are efficient bitwise algorithms to sqr and sqrt an integer I'd be very supprised if an old school FORTRAN coder would use them in place of ABS()
Admin
i worked on ALSN...Ada Language System/Navy...in the mid '80s. we wrote a text editor & a formatter...ur tax$$$ at work reinventing the wheel;-} but Ada was a pleasure to code in, and certainly helped me transition to oo languages.
and when john mccormack moved from c to ada in his realtime programming course @ suny/plattsburgh http://archive.adaic.com/projects/atwork/trains.html the number of students successfully completing projects went from ZERO to >75%
only cult45 would try to ignore that reality
Admin
i worked on ALSN...Ada Language System/Navy...in the mid '80s. we wrote a text editor & a formatter...ur tax$$$ at work reinventing the wheel;-} but Ada was a pleasure to code in, and certainly helped me transition to oo languages.
and when john mccormack moved from c to ada in his realtime programming course @ suny/plattsburgh http://archive.adaic.com/projects/atwork/trains.html the number of students successfully completing projects went from ZERO to >75%
only cult45 would try to ignore that reality