Nick Mudge Ignition Software Consulting & Development

I've been reading the new Coders at Work book. It is great. I'm reading it straight through and I'm in the middle of the interview with Joshua Bloch. One really interesting subject that has been brought up in that interview is the trade off of power and complexity in programming languages.

It seems that the more power and flexibility you add to a programming language the more complexity you add to it. The more complex a language is the harder it is for programmers to understand it, read it and maintain it. Also the more complex it is the more likely it will be subsetted which can reduce the portability of the language among programmers. One programmer may know one subset of a language and another programmer a different subset. C++ seems a fine example of this.

That brings up some interesting questions. What philosophy should you take in creating a new programming language that you simply want to be beautiful and awesome? I know that's pretty general, but I'm kind of general about it right now. I think I tend toward the minimalist language design where you design a small powerful language from which you can build up complexity in different directions. Lispy sounding, isn't it? I wonder what other languages are like that.

Comments

solrize
2 November 2009

Lisp was brilliant 50 years ago but ridiculous today. Haskell has most of the best new ideas which are missing from lisp, but it's also something of a laboratory creature, not all that tractable for day-to-day coding. there have been a few waves of language design that reached endpoints in (say) lisp, c, and java. haskell seems to me to be in the middle of another wave but it will take another few iterations to reach an endpoint.
Mike Stone
smellsblue.blogspot.com/
2 November 2009

I would argue that complexity in a language is fine if the language does what you expect when you try something you don't know how to do.

I feel Matz's ideal of the principle of least surprise made Ruby a very elegant, yet complex (and powerful) language. I've heard a few people say it is an acceptable Lisp. Yet, it doesn't SEEM like there are a lot of complex features, because they all integrate well and provide a mostly seamless and intuitive experience.

However, take what I say with a grain of salt... Ruby is by far my favorite language, so I'm clearly biased :-)
Mark Dalgarno
blog.software-acumen.com/
2 November 2009

Nick, you're spot on with your thoughts w.r.t. Lisp. It's power comes from its minimalism.

I sat in a room of 300 C++ developers last year while the leynote asked them what a 10 line program did - there were at least 4 different opinions not including those who didn't have a clue - time for some language simplification I felt.

Solrize - why do you think Lisp is 'ridiculous'? Sure, it's been around for 50+ years - but in many different forms. Doesn't its longevity indicate it's a powerful way of working?
Quentin Moser
2 November 2009

Basing a language on a small consistent core is probably not enough to actually prevent subsetting. What usually happens is that some library functionality becomes part of the de facto core that people work with. Sine that functionality is by definition external, you then have a high risk of seeing many different implementations appear with different APIs. In essence, excessive complexity in the language definition is replaced by excessive complexity in the "base libraries". I don't think there's any real way to prevent subsetting besides creating a strong, consistent culture (which is of course easier said than done). Or keeping your userbase in the low 100s, of course :).


A very nice minimalistic language you might want to take a look at is Lua. The online version of "Programming in Lua" (http://www.lua.org/pil/) is a short read, and should allow you to see what the language is like.


(Obligatory comment:) I don't, at all, consider Haskell "not all that tractable for day-to-day coding". I don't see any problems with it in that repect except for its (GHC's, rather) lack of a JVM or .NET backend.
Jesper
2 November 2009

His name is Joshua Bloch, not Block.
fasteez
2 November 2009

@Mark

beware, cobol is old too :p

lisp powerful way of working made it to other programming languages, that would be a nice indicator :)
Nick Mudge
2 November 2009

Fixed, thanks.
Mark Dalgarno
blog.software-acumen.com/
4 November 2009

@fasteez

*Some* of Lisp's way of working made it to other languages - in the face of a lot of resistance from the 'community'. When all its powerful features make it mainstream I'll be happy - but then we'll all be using Lisp then by definition :-)

Yes, Cobol is old, but I don't see anyone making new Cobol-like languages these days unlike Lisp (e.g. Clojure). (I realise there might be some somewhere but I'd rather not know about this aberration :-))
autism
www.vitabits.co.uk/antioxidant
14 November 2009

I think, the power and the complexity have the regression relationship between them. Complexity in every programming is there. But the power is depend upon the strength of the coding standard of the programming.
data recovery program
www.datadoctor.biz
8 November 2011

Really in order to provide good programming interface simplified approach is prior in this regard; we need to have easy code that provide an good programming interface for proper work that saves time and efforts.
<a href="http://www.datadoctor.biz">data recovery program</a>
Name: (required)
Email: (required)
Website:
What has four legs, rhymes with bat and says, "Meow?" (One word answer.)
Spam Filter: