Repls, repls, everywhere

Have a new-years resolution to try out a new programming language, but in too much of a hurry to pick only one, or install anything?

Online REPs and REPLs

Today there’s 61 different languages on that list. That many, there’s gotta be at least one that strikes your fancy.

Best batch execution site: ideone.com with 50 unique languages.

Best interactive REPL site: repl.it with 16 unique languages.

Quickrefs for Python and Vim

More quick reference booklets:

I don’t really need the qr for Python, but I thought it might be good to have ready should a friend a coworker wish to start learning Python.

As for Vim, the reference is certainly terrible – I’ve barely used it at all. The qr is just a list of commands that looked useful. I’ll edit the qr as I go, perhaps using the last pages for notes.

Go: Defer, Panic, and Recover

It seems after much resistance to the idea, Go has added exception handling to the language in the form of defer, panic, and recover.

The Go Programming Language Blog: Defer, Panic, and Recover.

Don’t get me wrong, I think the’ve got something here.  Defer gives you the equivalent of C#’s finally/using; or a nice subset of C++’s destructors; or Lisp’s unwind-protect.  Panic = throw / raise.  Recover = catch.

The blog post gives the impression that you can’t programmatically access the value passed to panic — “recover returns nil” — but before judging that behavior I should try to confirm it in the Go documentation.

All in all, I’m giving this design a thumbs up. No element of it is new, but they seem to have brought exception handling in without compromising their mantra of practical and simple.

Best and Free Programming Ebooks

(updated / switched link to source article on stack overflow)

So, I wrote my list of some unique programming texts. But on the more practical side, there’s this:

Best and Free Programming Ebooks.

Free full texts, covering: Bash, C, C++, C#, Common Lisp, Haskell Java, JavaScript, Lua, Objective-C, Perl, PHP, PowerShell, Prolog, Python, Ruby, SQL, x86 assembly, algorithms, version control, and a couple other topics.  I’ll still be putting together my own preferred lists, but half of what I’ve got is already on this list.

Is it better to remain blissfully unaware…

I was once asked “why bother learning these other languages, if you can’t use them”. It hadn’t occurred to this person that I code off hours. I’ve also been asked “what if you find these other languages actually are better than C++? Won’t you find it depressing having to code in a normal language then?”

It’s a good question. I don’t know if there’s one answer, but I’ve found mine.

Learning Lisp, Haskell, Python, and others has given me a greater appreciation for computer science, for the theory and universe of knowledge that lies underneath the surface of programming. Now when I code, I don’t just solve the problem at hand. I see different ways to solve it. I see other remote problems its related to. I appreciate the aesthetic of it all.

It’s not for everyone, but I find the mathematics underlying it all very beautiful.

And as for my day job in old-school-C++? Well, I hack together a prototype in Python in a couple hours, then spend a week translating it to C++ (adding verbosity, manual error handling, unfolding metaprogramming, etc). My boss doesn’t necessarily understand the whole languages thing, but he’s happy when I get a 2 wk job done in one. I’m happy too; having gotten through the icky bits of the problem in Python, I spend less time working on the boring bits in C++, and can move on to the next project sooner.

There is one last question, that I’m not sure I really have a good answer to. “Won’t you be tempted to use features that don’t exist in a normal language?” I’m hoping this will evaporate. Templates have existed in C++ since ’88 (pdf), various people have hacked lambdas in, and VC10 has added them for real. Short those facilities, it’s not like I have forgotten how to write imperative code. It’s still an option – I just now realize the development expenses of that option.

~

I’m curious, other answers do you choose for these question?

Best way to learn a Programming Language

(Update, added Casting SPELs)

For better or worse, it’s accepted in our industry to be fluent in only a single programming language or technology. It’s lame, but there are plenty of excuses for this. “Turing equivalence” right? Finding quality tools is hard. And worse yet, to learn a new language you have to spend days and weeks reading some lame introductory text, right? Wrong!

There are tons of good intro guides out there that can get you up and running quickly, if only you know where to look. I’ve accumulated a bunch of these, and would like to spread the good wealth:

Learn You a Haskell, example image

Continue reading

My programming languages story

It’s bad style, but I must start with an aside:  on reddit/scheme, there was a link to a blog series on developing a Scheme interpreter over January 2010.  It might not implement any particular Scheme standard or particularly many libraries, but it’s got all the functional elements.  Bootstrapping a programming language is fun and easy.

Anyway, he also posted a his personal history of programming language study, and it got me thinking about my own personal programming languages history.

It all started with Logo…

Continue reading

Comparing “Go” to “Brand X”

The old-timers might figure out what Brand X really is before the end. For the rest of us, the reveal at the end is just as shocking as the author intended.  All and all, it confirms what I suspected: Go nice enough, but it is hardly original.  Sure it looks like a great language to write in compared to C, but then again, what doesn’t?

Comparison of Google’s new language “Go” to mysterious “Brand X”, and the shocking reveal of Brand X’s true identity.

As found through http://www.foldl.org/, a digest blog on various programming language topics.

Programming Language Popularity

Some interesting metrics of programming language popularity.

  • LangPop.com – statistics on greping search queries on various web properties — usage in open source projects, books published on Amazon.com, etc.
  • TIOBE index – similar listing, of search engine results exclusively.  Longer tail listing, and shows trending.
  • Happiest users – this one is just a static blog post, but takes the additional dimension of not just frequency of posts, but the satisfaction level being expressed.  The data set is absymally small — I hope eventually another group will follow up with a more comprehensive analysis of more languages, and more satisfaction dimensions.

Usage data might be more interesting or ‘scientific’ (number of statements executing, new applications/modules shipped, etc).  However, ‘mindshare’ is itself an interesting dimension, as the technical merits of programming languages are typical less considered than social pressures and perception.