Ask HN: Help me find an exotic programming language to learn next
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?
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.
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.
- 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/
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.
Just curious what is so nice / difficult about Haskell?
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.
http://www.bitmover.com/lm/L.html
It's not really that interesting to most people, it was designed to be easy to read, easy to maintain larger programs in, in particular, it was designed to be easy to read and review, that was the point.
It was not designed to be interesting to hackers like the folks here, I strongly suspect that 98% of you will go WTF? You based this on top of tcl? Are you retarded? And the answer is "well, yeah, sort of. But it fit our needs".
Anyway, we're in the midst of a commercial product release but after that I can see about getting the source out for anyone who wants (BSD license or whatever tcl is, I know it's BSD or BSD like) as well as prebuilt images for all the common platforms (Windows, Mac, Linux, *BSD, HPUX, Solaris, AIX, even IRIX and SCO for the 3 people in the world still using those).
If anyone has constructive feedback, bring it on. It's a moving target which is why we haven't released yet, haven't nailed down 1.0 hard enough that we want to live with it. We are using it internally.
I actually started implementing a DSL in TCL a while ago, it was meant for a YubNub replacement but the project was scrapped and I never finished it.
Once it is really stable, we plan on provide a pile of canned triggers (email notification of commits, other workflow stuff) as part of our commercial product.
And we have some plans for future products where L will be the glue that holds them together. An example would be a generic importer $SCM => BitKeeper written in L and shipped as source so that if you have some oddball SCM that we don't understand you can do your own importer.
But the main point is to redo our guis. We're still playing around but this is an example - not polished yet but not as sucky as some stuff we've done in the past: http://bitmover.com/lm/explorer-l.gif
http://en.wikipedia.org/wiki/Categorical_list_of_programming...
http://en.wikipedia.org/wiki/Programming_paradigm
I'd say learn Haskell, Clojure, and Scala before anything else because they seem like they might actually be 3 of the best programming languages out there. After that I'd recommend Oz (in conjunction with the textbook Concepts, Techniques, and Models of Computer Programming, which Peter Norvig mentions as being a possible modern equivalent to SICP (Structure and Interpretation of Computer Programs, a classic MIT Scheme-based text)), Scheme (with SICP), and Erlang.
Can't say I've done all this myself, it's just what I would do if I had a really strong interest in learning new programming languages.
But, if what you want to do is to learn about programming languages, the thing to do is to write one of your own. Language design is among the most difficult of human intellectual tasks because the language elements must be composable to create larger, more capacious elements. A common error is to "add a statement to do X" rather than creating a conceptual framework that works with other language elements to allows X (and other things) to be performed.
A book worth reading on the design of language is Alexander Stephanov and Paul McJones, Elements of Programming. A talk covering some of the material in this book is scheduled for the Stanford EE Computer Systems Colloquium for November 3rd (http://ee380.stanford.edu). The lecture is open to the public, webcast live, and archived for on-demand viewing. Eventually it will be out on YouTube, iTunes, and elsewhere.
And while we are on the ideas of language design, you might want to look into some of the theories of natural language. George Lakoff's ideas in cognitive linguistics seem to apply to programming languages as well. Language, in his view, is motivated by metaphor.
I also think anyone who is serious about programming languages needs to have programmed in several assembly languages and to have experimented with macro assemblers. Macro assemblers provide a powerful tool for creating nonce programming languages at the assembly level.
I would also suggest that learning about optimizations would be of interest. At some level, optimizations are about mapping programming language concepts onto real machines for efficient execution. There is a dymaxion tension between programming languages and computer hardware with each influencing the other. Today, the need to efficiently map programs onto multi-core machines has renewed interest in parallel programming languages.
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.
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.
J (closed source, free),
A+ (GPL, inactive),
K (closed source, commercial)
Also, learn Scheme, or Lisp. You'll rethink recursion after that.
http://wiki.portal.chalmers.se/agda/pmwiki.php?n=ReferenceMa...
http://www.atariage.com/2600/programming/index.html
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?).
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 :)
- CLOS (not just Lisp, but it's wonderful "standard" object system)
- PostScript - which is actually a nice interactive programming language that just happens to have nice graphics capabilities
I've spent years working in CLOS and PostScript (on the same project!) and of all of the languages I've used these were the ones that I found the most satisfying. I still keep a copy of AMOP on my desk in my study at home to browse occasionally.
[Deleted reference to APL after seeing previous post]
Lisp is a lot more exotic than you might think! What it does to your brain is unmatched!
Lua. A tiny yet powerful language whose only data structure is the associative table. Can be learned in half a day.
http://lolcode.com/specs/1.2
Still, Brainfuck is cool in that it's really easy to write compilers for it.
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.