Ask HN: Help me find an exotic programming language to learn next

27 points by bobds ↗ HN
I want to start learning a new programming language but frankly none of the popular languages appeal to me right now.

I have written code in these languages, in order of experience:

- PHP, Javascript. Java, Python, Perl, C

I've been doing some random walks on the massive list of programming languages on Wikipedia and I've found a few interesting choices. Here is a small list:

- Cofeescript http://coffeescript.org/

- Fantom http://fantom.org/

- HaXe http://haxe.org/

- Neko http://nekovm.org/specs

- K http://en.wikipedia.org/wiki/K_%28programming_language%29

- Factor http://factorcode.org/

- Ragel http://www.complang.org/ragel/

I think learning a niche language will be fun, could give me a different perspective than the procedural and OO languages I've used so far and could prove to be a valuable and marketable skill in the future.

Which exotic programming language would you recommend?

65 comments

[ 3.6 ms ] story [ 126 ms ] thread
How about a Lisp?
I've considered it but it doesn't feel right at the moment. Definitely a language I want to learn in the future though.
Well if complex syntax is your thing, then don't go there.

Lisp is a lot more exotic than you might think! What it does to your brain is unmatched!

More specifically, a Scheme. Racket is nice.
I don't see the point of learning Coffeescript (compiles in an obvious manner to js). Fantom and HaXe have the somewhat interesting problem of an API that is compatible with many backend VMs. neko is the opposite and also possibly interesting. None of the above languages will teach you anything about syntax or semantics, they're mostly implementation details.

K and Factor should teach you about composability, semantics and expressivity. I have read some about Factor and I like the philosophy. Ragel looks extremely interesting and (from this list) is probably the one I would choose.

But the languages you know already are all semantically derived from Algol. You should program a lot more stuff in functional languages. I highly recommend Haskell to anyone wanting to expand their understanding of programming languages. There's a LOT to learn from Haskell, and few other languages capture as many Things Which Are Different.

I don't think I'm ready for Haskell, but we are thinking along the same lines. Coffeescript is indeed the least interesting of the list. It seems I've accidentally ordered the list in ascending order of interest. Ragel has caught my eye from the first time I saw it, a couple years ago, and it seems like it would be useful for an immense number of projects.
If you're not ready for Haskell you could try Scheme.
I also started looking at functional languages recently. I started with lisp (the free book) then moved to clojure (since it is lispy and probably may a better future (just a guess - i am no expert on functional languages - so no flames please.)

Just curious what is so nice / difficult about Haskell?

Haskell is a research language - it was built by programming languages researchers, and lots of researchers now work with it, extend it and so on. As such, it is not "nice" in the sense that it is easy to learn how to use.

In fact, there are a lot of assumptions that Haskell throws out that you may be used to. One example is strictness. When you call a function in most programming languages, you can assume that the arguments to the function are evaluated before the function is called, but that's not necessarily true in Haskell. In fact, nothing is evaluated until its result is needed for something else -- such as adding two numbers; if you need to evaluate + (an addition), then you need to know what the values of the left and right hand sides are.

However, there are advantages to such assumption-breaking ideas. For example, you can have a function which produces an infinite data structure, and another function which consumes pieces of it at a later time. The functions need not know about each other at all. Such a system would be much more difficult to implement without this intrinsic laziness feature.

There's a lot more to learn, much of it quite mind-bending. If you grok Haskell, you won't design programs in other languages in quite the same way, because you realize what silly assumptions were being made before.

Thanx - sounds very intriguing. Haskell definitely would be in my list now:)
6502 Assembler.
This may look like a silly choice to some, but if your goal is to stretch your mind a bit, assembler will definitely do the trick. 6502 assembler is less annoying than its i386 equivalent, and can be used in e.g. C64 or Apple emulators.
And you can write Atari 2600 games :)

http://www.atariage.com/2600/programming/index.html

Which is just what I'm doing with it, so I brought it up here!

I've had the urge to homebrew an 8-bit computer from the chip up, but I don't know if I have it in me to go that deep just yet, so I'm testing the waters by homebrewing some 2600 ware first. If I like it, maybe I'll build a hardware emulator somehow (Typing that I thought of half a dozen obstacles, but hey, why not?).

I highly recommend the "2600 Programming For Newbies". I worked through it a few years back and loved it.

Word of warning, though - 2600 programming is particularly tricky, because you only have a couple of screen buffers, and each is a byte. So when changing the background, you have to keep track of where the electron gun is and write things at the right time if you want the left and right side of the screen to be different :)

I was gonna say assembler too, but something more relevant, like ARMv7. Lots of uses there.
You should go for a functional language like Haskell, Clojure or OCaml/F#. They're mainstream/practical enough that you could write real programs in them, but different enough from the imperative languages you already know that they'll open your mind to new things.
A side-question: Are there any Haskell-oriented groups of people in the Bay Area? I'm increasingly convinced that I'm going to need help if I'm going to teach myself Haskell.

BTW, for the others following along: I've found Haskell to be hands down the most mind-bending of the functional languages. Even with a background in Lisp (actually Scheme) and ML, I still struggle to write non-trivial programs in Haskell. I say this as someone who learned Tcl on the job and gave a presentation on how to program in Tcl just a few months later.

How about APL? (Well, I think APL is expensive, I think there's open source variants?)

Watch someone program Conway's Game of Life in one line of APL: http://www.youtube.com/watch?v=a9xAKttWgP4

It's black magic to me, but pretty cool looking, too.

I've looked at the languages related to APL and it doesn't seem there is a solid open-source implementation.

J (closed source, free),

A+ (GPL, inactive),

K (closed source, commercial)

How about Go? http://golang.org/
Listened to a lecture by Rob Pike last week. Blown away!

This guy has consolidating what he and his cohorts have learnt from C, C++, ANSI C (Plan9), Limbo (Inferno).

Might be the most cutting edge language of the moment.

i didnt think it was mindblowing. The CSP stuff is kind of unice but othe than that i dont think its cutting edge. In therms of systems programming D is better. The go concurency story is still unsave (pasing pointers to channels). Note: i dont say go is a bad language.
I recommend writing a programming language.
Definitely, I wish I could upvote that more.

That said, writing a programming language sounds a little daunting if you've never been introduced. So here's my recommendation: Work your way through at least the first half of Programming Languages: Application and Interpretation by Shriram Krishnamurthi (free online http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/). Probably the most influential book of my entire CS degree, not too difficult once you get used to Scheme, and incredibly rewarding (and fun!).

Your experience is mostly OO and procedural. Let's round it out with the functional cannon: In the first half of PLAI you implement the crown jewels of the paradigm: first-class functions, both with dynamic and static scope (aka closures), lazy evaluation ala Haskell, true language-supported continuations, recursion (the Y combinator is in there), mutable vs. immutable variables and more.

The implementation language is Scheme, which is really really easy to grasp the basics of quickly. So as a side effect you will learn an interesting esoteric language just as you wanted. I would think any competent programmer could learn enough Scheme to work through PLAI in under 2 days. Basic Scheme is kinda like "lisp light" compared to CL/Clojure, so it's a great way to start.

I wish I could upvote that more. PLAI was awesome. To me, scheme is to lisp what coffeescript is to javascript. More or less. Don't let it intimidate you. Throughout the book, you'll see awesome things, like how switching from static to dynamic scope is merely changing a bunch of lines of code. When I finally got my type inferencer working, I was euphoric.
Interesting suggestion, thanks.
CoffeeScript is hardly "exotic", as other comments on this post mention. But, if you want to try playing around with a mini programming language of your own, it could serve as a good starting point -- especially if you want to make something that runs in the browser.

It's one thing if you want to deal with integer representations and memory allocation, and quite another to want to experiment with language design, grammars and object models (and be playing with <canvas> animations tomorrow). The CoffeeScript codebase is only 2,200 lines of code in toto, and it's all annotated to help you get started and make sense of things.

http://jashkenas.github.com/coffee-script/documentation/docs...

I'll second the motion for you to write your own thing.

Scala, I've had a lot of fun with it. You can also try generative and meta-programming using emf/gmf/acceleo maybe some xtext as well. Learning exotic frameworks can be useful/fun as well. Maybe try a different domain like physics, finance, or even buy a fpga and learn some vhdl?
agree with scala. you'll enjoy it.
Forget the exotic tag, learn clojure or Haskell.
Those two are at the top of my list for sure. Haskell because I believe I can learn more from it than any other single language, and Clojure because after I've been enlightened I will want to sit down and build something quickly.
Forth could be interesting to look at. It does offer a quite different perspective to programming.
Agreed! Different, refreshing..and good.
Try to find a language that has "weird" features that you've never seen before. Try something like f#/ocaml, prolog, or vhdl/verilog. For vhdl/verilog run it in a simulator and look on opencores for source. Also, perhaps something like Cg or one of the other gpu languages, the further you get from Von Neumann arch the more you will learn, beacause so much of programming languages are leaky abstractions. Also, try forth it's pretty strange as well.
Erlang. At least syntax wise it will seem exotic given the languages you know.
I highly recommend learning Factor. It's a really incredible system and has the benefit of encouraging different ways of thinking and approaching algorithms.