Colossus Cipher Challenge Winner On Ada 168
An anonymous reader writes "Colossus Cipher Challenge winner Joachim Schueth talks about why he settled on Ada as his language of choice to unravel a code transmitted from the Heinz Nixdorf Museum in Germany, from a Lorenz SZ42 Cipher machine (used by the German High Command to relay secret messages during the World War II). 'Ada allowed me to concisely express the algorithms I wanted to implement.'"
Too bad he did not mention his choice of NetBSD (Score:1, Informative)
http://www.netbsd.org/gallery/schueth-interview.html [netbsd.org]
Re:Type Casting (Score:3, Informative)
It does (unchecked_conversion), but never (AFAIK) *implicitly*.
Re:Wimp using ASCII (Score:2, Informative)
You're using ASCII twice so you're twice the wimp!
Software and recorded audio can be found here (Score:2, Informative)
Another interview (Score:1, Informative)
http://www.adacore.com/home/ada_answers/lorenz-code/ [adacore.com]
Re:What are the good ones? (Score:3, Informative)
The GNAT is based on GCC. It's free and it is damn good.
I was also using AONIX and they have a free (as in beer) version. I have always preferred GNAT though.
I am not sure about a website though...
Re:What are the good ones? (Score:4, Informative)
The GNU compiler suite also has an ADA compiler (GNAT, GNU Ada Translator). Should be possible to get it and plug it in without much trouble, and then it'd integrate with everything else. Heck, should be possible to include ADA modules into an Objective-C Cocoa application, even.
There is also a GNU FORTRAN, worth checking out. Even today, you can't do mathematics as efficiently in C as you can in FORTRAN. (This is because of the language; in Fortran, taking the address of an existing variable isn't normal, so variables don't end up with the possibility of "aliases" that they don't know about, which means a lot more stuff can safely be done all in registers and stuff like that.)
There is also a GNU Pascal, but unlike ADA and FORTRAN, I'm not personally aware of any reason to actually use it.
Re:Programmer not langauge. (Score:5, Informative)
I have written Web Apps in FORTRAN 77 just to prove that you can. However I wouldn't say it would be OK to consult a client to do the same, as it really isn't the right tool for the job.
Re:Comparison with Allies cypher machine (Score:4, Informative)
http://www.sjsu.edu/mscs/research/projects/chan_wing-on.pdf [sjsu.edu]
In normal use, it appears to have had a keyspace of about 48 bits, which is not easy to attack now with a modest distributed effort, but way out of the reach of WWII technology.
However, a variant of the machine used for communication between the US President and British PM had an effective keyspace of 95+ bits, which (if you have access to some known plaintext) can be reduced to 86 bits, which although shorter than key lengths in common use today is still out of reach.
Re:ADA Resurgence? (Score:5, Informative)
Ada is not trendy, but it has had built-in portable concurrency and many other killer features for more than a decade. Proper specifications are one of my favs.
Of course there are other factors, like the lack of good and free compilers. Fortunately now the gcc toolchain has put this to rest. Also there are few libraries. Really few. Binding to C is easy, but still a deterrent for the hobbyist.
It's emphasis in making maintenance easy over quick programming really pays in the end, not even in the middle/long term but shortly after getting familiar with the language. I find myself much more productive. When something compiles, I'm sure that the only bugs remaining are logical, not some funny pointer or unexpected type conversion or overflow. Nowadays I rarely fire the debugger more than once a month. My C/C++ has improved because Ada forbids the things that are considered bad practices in C/C++, but you still end doing because "you know better".
I think that Ada is getting now more exposure because, albeit a niche language, Adacore is pushing hard behind it. Also, its SPARK derivative by Praxis has made some headlines with large and difficult projects getting flying marks. SPARK has made static analysis a reality for large projects.
I'd say that anyone capable of discipline will enjoy the benefits of Ada. It's not the thing for quick hacking, but it is perfect for anything not trivial. Software engineers should love it. I have heard somewhere that it is a safe C++, and I concur: feature-wise is more or less on par, it catches bugs sooner and prevents many typical ones.
Have I already said that concurrency is built-in and portable
Re:Type Casting (Score:2, Informative)
Re:Type Casting (Score:3, Informative)
> It does (unchecked_conversion), but never (AFAIK) *implicitly*.
Unchecked_Conversion reinterprets the bits of the argument as a value of the specified type.
Ada also allows ordinary value conversions (for example, converting 3.1 to type Integer yields 3) among sufficiently closely related types; for example, a value of any numeric type can be converted to any other numeric type. It requires such conversions to be explicit in more cases than many other languages.
And yes, my experience is that it's more common in Ada than in, say, C, for a program to work correctly the first time you get it to compile successfully.
Obvious.. (Score:2, Informative)
Re:Horses for courses - please explain (Score:3, Informative)
Ada has an equivilant with packed types. You can set the 'Size attribute on custom types with bit precision, and you can pack multiple custom types into a record just like bitfields. We use this to read in packed data from hardware all the time.
The only major failing I found was using these for stream IO (file in/out): unless you redefine the stream attributes for the type, Ada will automatically assume that the minimum size of the type is 8 bits, and will resize fields smaller than this. Makes for a lot of fun when trying to figure out why your file format is wrong, or you read in incorrect data.
C has bitwise operators that actually works (compared to Ada), which makes it a lot more suitable for bitmanipulation than Ada.
Oh, hell yes. Bitwise operations in Ada are so clumsy they made me tear my hair out.
C also treat arrays and pointers as the same, and pointers are not checked, and you can cast data and pointers to whatever you want, this is why it is suitable for low level memory manipulation.
I don't consider treating arrays and pointers the same to be a huge benefit; it's more of a kludge. Anyway, you can get the same performance as C pointers by using Ada access types; just make sure your types are aliased.
Re:Horses for courses - please explain (Score:2, Informative)
Yes, this is true, and it is one of the areas where Ada is very nice, i.e. for doing packet decoding (though in my opinion, erlang is nicer in this aspect).
The bad thing is that the syntax for declaring your packed records in Ada is a bit redundant.
Re:Programmer not langauge. (Score:2, Informative)
Re:Let the raging tardfight commence (Score:3, Informative)
You worked with the symbolic cyphertexts. He worked with raw baseband audio from the radio receiver, complete with noise.
You knew this, of course, because you RTFA.