views:

1275

answers:

10

When all you have is a pair of bolt cutters and a bottle of vodka, everything looks like the lock on the door of Wolf Blitzer's boathouse. (Replace that with a hammer and a nail if you don't read xkcd)

I currently program Clojure, Python, Java and PHP, so I am familiar with the C and LISP syntax as well as the whitespace thing. I know imperative, functional, immutable, OOP and a couple type systems and other things. Now I want more!

What are languages that take a different approach and would be useful for either practical tool choosing or theoretical understanding?

I don't feel like learning another functional language(Haskell) or another imperative OOP language(Ruby), nor do I want to practice impractical fun languages like Brainfuck.

One very interesting thing I found myself are monoiconic stack based languages like Factor.

Only when I feel I understand most concepts and have answers to all my questions, I want to start thinking about my own toy language to contain all my personal preferences.

+12  A: 

What about Prolog (for unification/backtracking etc), Smalltalk (for "everything's a message"), Forth (reverse polish, threaded interpreters etc), Scheme (continuations)?

Not a language, but the Art of the Metaobject Protocol is mind-bending stuff

Paul
Correct me if I'm wrong, but I think Python sortof does continuations already. And from what I have read, I'd rather learn Factor and Objective-C than Forth and Smalltalk, but I might be cutting corners there.
Pepijn
@pepijn, python doesn't have first class continuations (though I'm working on a bytecode hack to fake it)
aaronasterling
+3  A: 

One of the languages which i am interested for have a very different point of view (including a new vocabulary to define the language elements and a radical diff syntax) is J. Haskell would be the obvious choice for me, although it is a functional lang, cause its type system and other unique features open your mind and makes you rethink you previous knowledge in (functional) programming.

jneira
+60  A: 

Matters of practicality are highly subjective, so I will simply say that learning different language paradigms will only serve to make you a better programmer. What is more practical than that?

Functional, Haskell - I know you said that you didn't want to, but you should really really reconsider. You've gotten some functional exposure with Clojure and even Python, but you've not experienced it to its fullest without Haskell. If you're really against Haskell then good compromises are either ML or OCaml.

Declarative, Datalog - Many people would recommend Prolog in this slot, but I think Datalog is a cleaner example of a declarative language.

Array, J - I've only just discovered J, but I find it to be a stunning language. It will twist your mind into a pretzel. You will thank J for that.

Stack, Factor/Forth - Factor is very powerful and I plan to dig into it ASAP. Forth is the grand-daddy of the Stack languages, and as an added bonus it's simple to implement yourself. There is something to be said about learning through implementation.

Dataflow, Oz - I think the influence of Oz is on the upswing and will only continue to grow in the future.

Prototype-based, Javascript/Io/Self - Self is the grand-daddy and highly influential on every prototype-based language. This is not the same as class-based OOP and shouldn't be treated as such. Many people come to a prototype language and create an ad-hoc class system, but if your goal is to expand your mind, then I think that is a mistake. Use the language to its full capacity. Read Organizing Programs without Classes for ideas.

Expert System, CLIPS - I always recommend this. If you know Prolog then you will likely have the upper-hand in getting up to speed, but it's a very different language.

Frink - Frink is a general purpose language, but it's famous for its system of unit conversions. I find this language to be very inspiring in its unrelenting drive to be the best at what it does. Plus... it's really fun!

Functional+Optional Types, Qi - You say you've experience with some type systems, but do you have experience with "skinnable* type systems? No one has... but they should. Qi is like Lisp in many ways, but its type system will blow your mind.

Actors+Fault-tolerance, Erlang - Erlang's process model gets a lot of the buzz, but its fault-tolerance and hot-code-swapping mechanisms are game-changing. You will not learn much about FP that you wouldn't learn with Clojure, but its FT features will make you wonder why more languages can't seem to get this right.

Enjoy!

fogus
+1 - a great answer.
duffymo
i think maybe you would point to Eiffel ;-)
jneira
Thank you for pointing me to so many languages to learn.
delnan
I would add Erlang for actor based programming and Fortress for parallel Programming stuff.
nickik
@jneira The intressting thing about Eiffel is the contract based programming stuff. That stuff is quite cool but other than that Eiffel is not extreamly spezial.
nickik
Thanks! I'm convinced about Haskell, reassured about dataflow and stack based languages and inspired by the others!
Pepijn
@nickik Added Erlang. Its processes are nice, but the fault-tolerance machinery is cooler. :-)
fogus
+1 for a few I'd never heard of
smirkingman
+1 for Erlang's hot swap and fault tolerance recognition
Mic
No assembly? It's good to have an understanding of how processors work to learn what sort of code they like.
Nick T
Well, he mentioned that he knew C, so I didn't push assembly. Undoubtably learning some form of assembly would be nice, it helped me to learn that I didn't want to ever do that again. ;-)
fogus
@fogus I actually meant to say I know the C-ish syntax used by PHP, Java and the likes. Assembly or C is probably a good idea to learn as well.
Pepijn
@fogus And the fault-tolerance machinery works with processes :)
nickik
@pepjin: Learning C is pretty important if you want to master Python, since CPython is written in it.
intuited
@intuited: Couldn't you just focus on Python, since that's what PyPy is written in? ;-)
fogus
@fogus: well... technically PyPy is written in RPython, from which C/java/CIL code is generated. So to really know what's going on with PyPy is probably more complicated.. I was just going easy on the poor fellow :) Also, CPython is the reference implementation.
intuited
@intuied PyPy is way more complicated. The idea is this: write a interpreter in RPython (for any langauge not just python) and let pypy analyse that. Then PyPy gives you a very fast interpreter or JIT back. So langauge implementers can save the trouble to write there interpreter/JIT in C or Java.So PyPy is two things. 1) a interpreter/JIT generator 2) a Python interpreter/JIT that was made be 1)
nickik
+1  A: 

perhaps you might want to try LabView for it's visual programming, although it's for engineering purposes.

nevertheless, you seem pretty interested in all that's out there, hence the suggestion

also, you could try the android appinventor for visually building stuff

Belun
LabView has a funny 'syntax' but it's a real pain to click and drag all your code. I would not recommend it to a programmer.
Ishtar
That's what ships with the Lego NXT, right? Totally didn't work for me. Thanks for the suggestion though.
Pepijn
it's from National Instruments. LabVIEW is a graphical development environment that makes scientists and engineers more productive
Belun
+8  A: 

I second Haskell. Don't think "I know a Lisp, so I know functional programming". Ever heard of type classes? Algebraic data types? Monads? "Modern" (more or less - at least not 50 years old ;) ) functional languages, especially Haskell, have explored a plenthora of very powerful useful new concepts. Type classes add ad-hoc polymorphism, but type inference (yet another thing the languages you already know don't have) works like a charm. Algebraic data types are simply awesome, especially for modelling trees-like data structures, but work fine for enums or simple records, too. And monads... well, let's just say people use them to make exceptions, I/O, parsers, list comprehensions and much more - in purely functional ways!

Also, the whole topic is deep enough to keep one busy for years ;)

delnan
+1  A: 

Just like fogus has suggested it to you in his list, I advise you too to look at the language OzML/Mozart Many paradigms, mainly targetted at concurrency/multi agent programming.

Concerning concurrency, and distributed calculus, the equivalent of Lambda calculus (which is behind functionnal programming) is called the Pi Calculus.

I have only started begining to look at some implementation of the Pi calculus. But they already have enlarged my conceptions of computing.

Stephane Rolland
+5  A: 

From Peter Norvig's site:

"Learn at least a half dozen programming languages. Include one language that supports class abstractions (like Java or C++), one that supports functional abstraction (like Lisp or ML), one that supports syntactic abstraction (like Lisp), one that supports declarative specifications (like Prolog or C++ templates), one that supports coroutines (like Icon or Scheme), and one that supports parallelism (like Sisal). "

http://norvig.com/21-days.html

Galactus
+2  A: 

In the types as theorems / advanced type systems: Coq ( I think Agda comes in this category too).

Coq is a proof assistant embedded into a functional programing language.

You can write mathematical proofs and Coq helps to build a solution. You can write functions and prove properties about it.

It has dependent types, that alone blew my mind. A simple example:

concatenate: forall (A:Set)(n m:nat), (array A m)->(array A n)->(array A (n+m))

is the signature of a function that concatenates two arrays of size n and m of elements of A and returns an array of size (n+m). It won't compile if the function doesn't return that!

Is based on the calculus of inductive constructions, and it has a solid theory behind it. I'm not smart enough to understand it all, but I think is worth taking a look, specially if you trend towards type theory.

EDIT: I need to mention: you write a function in Coq and then you can PROVE it is correct for any input, that is amazing!

GClaramunt
+2  A: 

Dataflow programming, aka flow-based programming is a good step ahead on the road. Some buzzwords: paralell processing, rapid prototyping, visual programming (not as bad as sounds first).

Wikipedia's articles are good:

In computer science, flow-based programming (FBP) is a programming paradigm that defines applications as networks of "black box" processes, which exchange data across predefined connections by message passing, where the connections are specified externally to the processes. These black box processes can be reconnected endlessly to form different applications without having to be changed internally. FBP is thus naturally component-oriented.

Read JPM's book: http://jpaulmorrison.com/fbp/

(We've written a simple implementation in C++ for home automation purposes, and we're very happy with it. Documentation is under construction.)

ern0
A: 
  1. Programming does not cover the task of programmers.
  2. New things are always interesting, but there are some very cool old stuff.

The first database system was dBaseIII for me, I was spending about a month to write small examples (dBase/FoxPro/Clipper is a table-based db with indexes). Then, at my first workplace, I met MUMPS, and I got headache. I was young and fresh-brained, but it took 2 weeks to understand the MUMPS database model. There was a moment, like in comics: after 2 weeks, a button has been switched on, and the bulb has just lighten up in my mind. MUMPS is natural, low level, and very-very fast. (It's an unbalanced, unformalized btree without types.) Today's trends shows the way back to it: NoSQL, key-value db, multidimensional db - so there are only some steps left, and we reach Mumps.

Here's a presentation about MUMPS's advantages: http://www.slideshare.net/george.james/mumps-the-internet-scale-database-presentation

A short doc on hierarchical db: http://www.cs.pitt.edu/~chang/156/14hier.html

An introduction to MUMPS globals (in MUMPS, local variables, short: locals are the memory variables, and the global variables, short: globals are the "db variables", setting a global variable goes to the disk immediatelly): http://gradvs1.mgateway.com/download/extreme1.pdf (PDF)

ern0