jump to navigation

Oracle and the Future of Java August 26, 2010

Posted by ddouthitt in Industry, Java, JVM Languages.
Tags: , ,
add a comment

Oracle recently filed suit against Google over their use of Java and their rebuilding of the Java APIs to suit the Android environment. This has people wondering about the future of Java, and what it means for Java implementations such as Apache Harmony and others.

I’ve always felt that Java fell short of being object-oriented, which was a shame: it should have been fully object-oriented – i.e., without primitive types for one. It also has been very wordy, with some declarations requiring four or more keywords to declare.

This is why the new languages that run on the Java Virtual Machine (or JVM) will start to come into their own. There are some well-known and powerful players that will grow (such as Scala, Clojure, JRuby, and others) and some not so well-known (such as Armed Bear Common Lisp and Erjang).

Since truly diving into the alternative JVM languages, I’ve truly become excited about what they have to offer. To me, the most interesting are Scala and ABCL – but who knows what knew things will come out down the line?


Simplifying Perl Variable Types December 25, 2009

Posted by ddouthitt in Perl.
Tags: ,
add a comment

Perl uses punctuation such as $ and @ to specify what type the variable is – scalar, array, hash, etc. When one first learns Perl, you learn:

$a = 4;    # scalar
@a = ( 4, 5, 6 );    # array
%a = ( a => 4, b => 6 );    # hash

But then constructs like @$a (a valid construct: a reference to an array) can become confusing. If you think of these marks as operators instead, then it becomes clearer and simpler. Then $a becomes “treat a as a scalar” and @a becomes “treat a as an array”. Thus @$a is “treat $a (a is a scalar) as an array”.

The book Effective Perl Programming by Joseph Hall et al covers this and is an excellent resource for all Perl programmers. According to the book, there is a web site at http://www.effectiveperl.com but this seems to be in Russian – though it is indeed about Perl. The author, Joseph Hall, has a blog at http://effectiveperl.blogspot.com but it hasn’t been updated since 2007. At least, there’s a second edition of the book coming out soon. This book should be on every Perl programmer’s bookshelf.

Debugging: A Perl Pet Peeve December 24, 2009

Posted by ddouthitt in Debugging, Perl, Ruby.
add a comment

When Ruby hit 1.45 years ago, I tried it and fell in love with it right away. The biggest problem with Ruby is the same now as it was then: its not available on every platform; most commercial UNIXes don’t include Ruby.

Thus, I have kept up my Perl skills. However, I found that debugging is not the same – and thus a pet peeve of mine.

You can always introduce print statements – which is what one of the developers of C and UNIX maintains is the only way to go (instead of “debuggers”).

When debugging Ruby, one can do this:

p $a;

When debugging Perl, this is required instead:

use Data::Dumper;

print Dumper($a);

I’m also always confusing Dump() with Dumper() as well.

Why didn’t Perl use a simple method instead of a complicated library process? Who knows?

Even so, Perl has a sophisticated built-in debugger which Ruby does not – but as mentioned before, printing variable contents can be more profitable for debugging purposes.

New Version of Haskell Released: Haskell 2010 December 6, 2009

Posted by ddouthitt in Functional, Haskell.
Tags: ,
add a comment

On November 24, Simon Marlow announced the release of the new version of the Haskell language, Haskell 2010. There are a few new features in the language, and the features will be propagating into compilers over time.

The new specification was coordinated by the Haskell Prime committee, which will continue its work in language development.

Hackers and Disaster Relief November 17, 2009

Posted by ddouthitt in Industry.
Tags: , , ,
add a comment

Disaster relief is an area of concern close to my heart; amateur radio operators have been part of disaster relief for years. When things like Hurricane Rita, Hurricane Andrew, 9/11, and more happen, it is the disaster relief workers such as folks from ARES, the American Red Cross (or the International Red Cross), Doctors Without Borders (or Medicins Sans Frontieres), and many others that help and provide needed services.

What can a programmer – a hacker – do in these cases? During the first ever Random Hacks of Kindness conference put on by Microsoft, Yahoo, Google, NASA, the World Bank, and the PR firm Second Muse, programmers from all over put their talents to providing software and other solutions to problems faced in disasters.

The event came about after the Crisis Camp held in Washington, D.C. in June 2009.

The only thing that I keep thinking about many technological solutions is that assumptions are often made that will not be true in practice:

  • The Internet is available. The Internet will likely be unavaiable, since many of the affected sites will be data centers, and perhaps even Internet central hubs like MAE West and MAE East and others. Any Internet bandwidth that is available will likely be saturated during the immediate disaster aftermath.
  • Cellular services will be available. The same problems that exist with the Internet will exist for cellular services as well. During 9/11 the cellular system was nonfunctional, if not because of the massive traffic hit, but also because the World Trade Center towers held major cell-phone tower installations for the area.
  • Electricity will be available. In many cases, it is electrical lines that will be down and the entire city – or more – can be without power. During Hurricane Rita, this was certainly the case.
  • Telephones will be available. Like the others, any available phone services will be overwhelmed, both from within and from without – even as the available space for phone calls is reduced.

It is for these reasons that amateur radio operators still provide a valuable service – after all, every year they practice operating with nothing more than they can carry. Wikipedia has a nice article on Field Day.

The technological problems that I remember hearing about from the aftermath of Hurricane Rita was that the Federal Emergency Management Agency (FEMA) was unable to handle the influx of requests, and the server – Windows-based – groaned under the weight.

There was also the “I’m alright!” aspect: letting people know that one was alright. Several web sites sprung up that let people know that loved ones were alright, and where they were.

During a disaster, it seems to me that most technology services will be either severely curtailed or impossible; amateur radio and other self-sustaining environments will be of the biggest help.

What would be helpful? Here are some ideas:

  • Mesh-based mobile phone networks. Mobile phone towers are likely to be unavailable and normal methods of communication overwhelmed. Mesh-based networks do not rely on a large and static infrastructure, but rather a “crowd” of tiny rebroadcast stations – such as other phone users.
  • Self-contained portable data centers. Data centers will inevitably be affected by many disasters; getting a business back up and running will take time. Disaster services will also be able to use the services of a portable data center to provide services.
  • Data restoration services. Businesses will find that their backups (if they have any) will need to be retrieved and restored quickly.
  • Low power devices. With electricity at a premium, low-power ready to go servers and workstations will be of great help.

Google’s Languages: Introducing Go November 15, 2009

Posted by ddouthitt in General Languages.
Tags: , , ,
add a comment

A few days ago, Google introduced the Go programming language (with a flurry of press attention). It’s not the first time – Google created the Noop language for the Java Virtual Machine, and Simple, a BASIC-derivative for Android – but it does seem to be creating quite a stir, more so than the others.

It appears that the Go language will be used in-house in time, though it is not currently so.

The language was created by several Google engineers, including some UNIX historical icons: Ken Thompson and Rob Pike (with Robert Griesemer). Thus, is it any wonder that the icon for Go is very similar to that for Plan 9, the unsuccessful follow-up act to UNIX?

The press attention has been amazing. Chris Dawson over at ZDNet wrote Is Google’s Go language worth teaching or learning? – I say yes to both. The magazine eWeek had an article about the launch,ComputerWorld’s IT Blogwatch had an article detailing a smattering of blog reactions, and InfoWeek also covered the language’s introduction as well.

Over at Ars Technica, they had an extensive writeup on the language (though they seem to have used an illustration from P.D. Eastman’s Go Dog Go! – isn’t it still under copyright?) The article talked with Rob Pike about the language and provided some examples.

Perhaps the most interesting article for programmers was an article by Google’s own Mark Chu-Carroll over at Good Math, Bad Math – which article he followed up the next day with another about concurrency in Go.

The only sour note so far is from Frank McCabe, who states that the name was taken by his Go! language since 2000. The issue came up in the language’s issues section and was noticed by InformationWeek; no word yet on what Google will do.

Project Euler: Programming (and Math!) Practice November 7, 2009

Posted by ddouthitt in Mathematics, Scala.
Tags: ,
add a comment

As one who loved mathematics (and still do – I considered becoming a mathematician) – Project Euler is a beautiful place to try and get practice on new programming languages as well as mathematical principles. Project Euler provides problems that require solutions, and which are designed for less than one minute solutions using the computer. The problems also highlight a mathematical principle in their solution.

I’ve only worked on a very few problems so far, but it appears that it is quite easy to write a brute force programming algorithm for some of these problems; personally, I am attempting to find the mathematical solution as well as solving the problem in Scala. There is a nice article about one person using Scala to solve Project Euler problems.

The biggest problem in using Project Euler for learning a programming language is that Project Euler isn’t set up for multiple language users: each user is able to specify (and track) solutions in only one language – but this is not a problem really.

If you want to solve more mathematical problems (not necessarily with a computer), the MathsChallenge web site is an excellent one, and is apparently the predecessor to the Project Euler site.

Why I Like COBOL October 30, 2009

Posted by ddouthitt in Cobol.
1 comment so far

COBOL over the years has been attacked as a dinosaur and as irrelevant to the modern age (where “modern” is 1980s and forward). The COBOL standard has, nonetheless, been updated several times over the years.

The most interesting thing about the COBOL standards over the years was the standardization of object-oriented COBOL in 2002.

There are many commercial providers of COBOL compilers and so on, including IBM, Fujitsu, and Microfocus. Microfocus also sponsors a COBOL Portal which is a one-stop resource for Cobol. Some of the Fujitsu compilers appear to be available from a company called Alchemy Solutions. There are also several significant open source compilers, including OpenCobol and TinyCOBOL. There is even a complete development environment called the Cobos Project from Metrixware. There is even a COBOL IDE for Eclipse.

ComputerWorld had a nice article in October of 2006 titled Cobol: Not Dead Yet. In December of 2006 TechWorld had an interview with MicroFocus titled The Future’s Bright – The Future’s Cobol. The first article describes how Cobol remains present, despite attempts to get rid of it; the second describes how Cobol is still relevant today and is still alive. More recently, the Guardian newspaper had an article about Cobol’s 50th anniversary titled Cobol Hits 50 and Keeps Counting. CIO Magazine had an article titled COBOL – Still Doing the Business, and Jeff Atwood over at Coding Horror had a nice discussion entitled (Cobol: Everywhere and Nowhere) relating to the article as well.

There is a company called LegacyJ that will actually help you to run Cobol code on the Java JVM. They have a whitepaper on the Future of Cobol.

For more resources, check out the COBOL bookmarks on del.icio.us.

To me, the biggest complaint about Cobol would be its wordiness – and that isn’t a very big complaint at that. I’d much rather be programming in Cobol than in RPG. I like Cobol – it’s not my favorite by a long shot, but it’s like an old friend that never goes away.

Concurrency October 29, 2009

Posted by ddouthitt in Erlang, Haskell, Scala.
Tags: ,
add a comment

One of the most interesting things about some of these languages (such as Scala) is their innate support of concurrency.

Concurrency is a huge benefit for making systems work together or for making programming systems that can scale (that is, grow and adapt to heavier usage).

Ted Leung at his blog wrote an article about concurrency called The Cambrian Period of Concurrency (and a follow-up). He also gave a talk at OSCON 2009 titled A Survey of Concurrency Constructs which was well received.

Tim Bray, also from Sun Microsystems, created a series of articles on the same topic entitled Concur.next. He talks about Haskell, Erlang, and Clojure. Erlang and Haskell are fascinating, but to me Clojure seems like it took Lisp and obfuscated it and made it harder to learn and use – and became slower besides.

After reading Tim’s article, one of the Glaskow Haskell Compiler (GHC) folks wrote an article comparing parallelism and concurrency. (By the way, not everyone thinks of Haskell when one talks of GHC…)

What intrigues me most about concurrent systems is the ability of multiple systems to work together – not as a cluster, nor in a failover configuration – but as a coherent set of multiple systems doing what each does best. A compute-farm with dynamically responding discrete and unique systems would be one example. Another example (which intrigues me to no end) is a network of servers that responds as a whole to a threat on any one of the servers individually.

Concurrent programming over the network, when used to its fullest, means that a server no longer needs to be the largest unit of response: it means that a network may respond, not just the server. It means that information can be shared among a group of servers rather than just one. Concurrency opens up a vast amount of fascinating ideas.

More Resources for Scala Programmers October 28, 2009

Posted by ddouthitt in Scala.
add a comment

There are a number of excellent resources for those that want to program in Scala – or learn to.

O’Reilly Media recently came out with a book Programming Scala by Wampler and Payne. The real interesting thing is that Programming Scala is also available for reading free online – and it is also available as an ebook.

There is a nice set of slides to introduce you to Scala. There are two quotes in the slides that I just love:

If I were to pick a language to use today other than Java, it would be Scala.
– James Gosling

I can honestly say that if someone had shown me the Programming in Scala book … back in 2003, I’d probably have never created Groovy.
– James Strachan