unethical blogger - Ada http://unethicalblogger.com/taxonomy/term/22/0 Posts related to Ada hacking en S.A.D. - Seasonal Ada Disorder http://unethicalblogger.com/posts/2011/01/sad_seasonal_ada_disorder <p>Last Sunday, I announced the "0.1" release of my <a href="http://adacommons.org/Memcache">memcache-ada</a> project on <a href="http://groups.google.com/group/comp.lang.ada/browse_thread/thread/c70dc869310ffb51#">comp.lang.ada</a>, thus ending a 2 month experiment with the Ada programming language.</p> <p>In my <a href="http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman">previous post</a> on the topic, I mentioned some of the things that interested me with regards to Ada and while I didn't use all the concepts that make Ada a powerful language, I can now confidentally say that I know enough to be dangerous (not much more though).</p> <p><center><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/terminaloperator.png" alt="Old school"/><br><em>This is what my coworkers thought of me, learning Ada.</em></center></p> <p>All said and done I spent <em>less than</em> two months off and on creating memcache-ada, mostly on my morning and evening commutes. The exercise of beginning and ending my day with a language which tends to be incredibly strict was interesting to say the least. Due to the lack of an REPL such as Python's, I found myself writing more and more unit and integration tests to get a <em>feel</em> for the language and the behavior of my library. <!--break--> Due to my "fluency" in Python, I tend to think in Python when scratching out code, similar to how a native speaker of a language will write or speak "from the hip" instead of doing large amount of mental work to construct statements. With Ada, not only am I not yet "fluent", the langauge won't let me get away with as much as Python allows me.</p> <p>The overhead of writing Ada, in my opinion, is a double-edged sword, I can very quickly informally test, debug and rewrite Python but with Ada such a process is (in my opinion) onerous. My 20 minute walk to the train station would be spent contemplating how and what I wanted to write and where. By the time I sat down on the train, I had thought out and designed things internally, so I would immediately write out tests around my ideas and assumptions before writing code to pass the tests. The time spent writing code was minimal since I rarely had to rewrite code, I can think of only one function that had to be rewritten after it had passed tests (botched some socket reading) in the whole project.</p> <p>I'm not yet sure what will be my next project in Ada, I am certain that I don't want to build anything of consequence in C again. Working with a language, like C, that not only gives you the rope with which to hang yourself but will often times push you off the chair is more masochism than I feel comfortable with these days. Ada on the other hand will allow you to hang yourself, but it'll make damn certain that have the perseverence to go through with it. Frankly, I don't have that kind of drive to really shoot myself in the foot anymore. I want to build software that works with a language that doesn't want to make me suffer, which means I'll be in a weird Ada + Python love triangle until future notice.</p> http://unethicalblogger.com/posts/2011/01/sad_seasonal_ada_disorder#comments Ada Opinion Software Development Mon, 24 Jan 2011 15:00:00 +0000 R. Tyler Croy 306 at http://unethicalblogger.com Ada? Surely you jest Mr. Pythonman http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman <p><a href="http://www.amazon.com/gp/product/0070116075?ie=UTF8&tag=unethicalblog-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0070116075"><img hspace="10" align="right" border="0" src="http://ecx.images-amazon.com/images/I/41HUUCwx7%2BL._SL160_.jpg"></a><img src="http://www.assoc-amazon.com/e/ir?t=unethicalblog-20&l=as2&o=1&a=0070116075" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> The past couple weeks I've been spending my <a href="http://bart.gov">BART</a> commutes learning the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Ada_(programming_language)">Ada programming language</a>. Prior to starting to research Ada, I sat in my office frustrated with Python for my free time hackery. Don't get me wrong, I <strong>love</strong> the Python language, I have enjoyed the ease of use, dynamic model, rapid prototyping and expressiveness of the Python language, I just fall into slumps occasionally where some of Python's "quirks" utterly infuriating. Quirks such as its loosey-goosey type system (which I admittedly take advantage of often), lack of <strong>good</strong> concurrency in the language, import subsystem which has driven lesser men mad and its difficulty in scaling organically for larger projects (I've not yet seen a large Python codebase that hasn't been borderline "clusterfuck".)</p> <p>Before you whip out the COBOL and Fortran jokes, I'd like to let it known up front that Ada is a <em>modern</em> language (as I <a href="http://www.reddit.com/r/programming/comments/eh462/ada_surely_you_jest_mr_pythonman/c181zqy">mentioned on reddit</a>, the first Ada specification was in 1983, 11 years after C debuted, and almost 30 years after COBOL and Fortran were designed). It was most recently updated with the "Ada 2005" revision and supports a lot of the concepts one expects from modern programming languages. For me, Ada has two strong-points that I find attractive: extra-strong typing and built-in concurrency.</p> <h3>Incredibly strong typing</h3> <p>The typing in Ada is unlike anything I've ever worked with before, coming from a C-inspired languages background. Whereas one might use the plus sign operator in Python to add an <code>int</code> and a <code>float</code> together without an issue, in Ada there's literally <strong>zero</strong> auto-casting (as far as I've learned) between types. To the inexperienced user (read: me) this might seem annoying at first, but it's fundamental to Ada's underlying philosophy of "no assumptions." If you're passing an <code>Integer</code> into a procedure that expects a <code>Float</code>, there will be no casting, the statement will error at compile time.</p> <h3>Concurrency built-in</h3> <p>Unlike C, Java, Objective-C and Python (languages I've used before), Ada has concurrency defined as part of the language, as opposed to an abstraction on <a href="http://www.amazon.com/gp/product/0521866979?ie=UTF8&tag=unethicalblog-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0521866979"><img border="0" hspace="10" align="right" src="http://ecx.images-amazon.com/images/I/41FMkfK74-L._SL160_.jpg"></a><img src="http://www.assoc-amazon.com/e/ir?t=unethicalblog-20&l=as2&o=1&a=0521866979" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> top of an OS level library (pthreads). In Ada this concept is called "<a href="https://secure.wikimedia.org/wikibooks/en/wiki/Ada_Programming/Tasking">tasking</a>" which allows for building easily concurrent applications. Unlike OS level bindings built on top of pthreads (for example) Ada provides built in mechanisms for communicating between "tasks" called "rendezvous" along with scheduling primitives.</p> <p>Being able to define a "task" as this concurrent execution unit that uses this rendezvous feature to provide "entries" to communicate with it is something I still haven't wrapped my head around to be honest. The idea of a language where concurrency is a core component is so new to me I'm not sure how much I can do with it.</p> <p>For my first "big" project with Ada, I've been tinkering with a <a href="https://github.com/rtyler/memcache-ada">memcached client in Ada</a> which will give me the opportunity to learn some Ada fundamentals before I step on to bigger projects. Disregarding the condescending jeers from other programmers who one could classify as "leet Django haxxorz", I've been enjoying the experience of learning a new <strong><em>vastly</em></strong> different language than one that I've tried before.</p> <p>So stop picking on me you big meanies :( <!--break--></p> http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman#comments Ada Opinion Software Development Mon, 06 Dec 2010 15:00:00 +0000 R. Tyler Croy 304 at http://unethicalblogger.com