What are important languages to learn to understand different approaches and concepts? [closed]
Asked Answered
M

24

172

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.

Mele answered 18/10, 2010 at 11:27 Comment(11)
I'd +1 for xkcd reference alone, but the question is interesting too.Incite
You seem to be a successful programmer, the rest is incremental. Not trying to be a dick, but ... how is your life finance-wise, relationships-wise, health-wise, fun-wise, hobby-wise? Perhaps now is the time to pursue some of those things. I do not believe you need to know more than a dozen of languages at once. If you get paid to use one - learn it. If you want to write a book about one - learn it. Other than that you have a good programming base. Why learn something (like J - my subj opinion :)) that you will not seriously (read make $) use anywhere? Don't be coolest hacker at a cemetery.Coletta
Yes, I am a successful programmer according to my own standards. I don't currently make a lot of money, but hey, I'm 19. I invest time in all those points and more, but I find both hobby and fun in programming. I also want to say there is a difference between understanding a language and mastering it. Mastering Python and Clojure is enough for me. I do want to understand the other options there are, because it'll improve my code, help me understand my computer and help me define my own programming language.Mele
(Was thinking about answering about C++, but got afraid of downvotes)Temporal
Have you seen Programmers.SE? This falls into the type of question better asked there.Rector
Yet a great question that will end up "closed as subjective"Leet
This book might be interesting: Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages, by Bruce A. TateSuperheterodyne
Being familiar with C syntax and C the language are two different things. The syntax is superficially like Java and PHP, but the language is much lower level forcing you to learn manual memory management, pointers etc. I would go ahead and actually learn C if I were OP. Bonus points if he learns C on a microcontroller because then he will also learn low level hardware access!Tantrum
@Hamish Grubijan: Just because somebody wants to improve their skills when they're already skilled in does not mean their lives are lacking in other areas. You shouldn't assume people who want to learn multiple languages or spend a lot of time learning new programming-related things spends their entire life locked in a basement. Lots of successful programmers don't fit the stereotype and we shouldn't assume they do just because they spend lots of time programming. PS: A dozen languages = ~12 That is plenty for learning the different paradigms. Also more to life than maximizing financial incomeTantrum
Following on from the last comment, while you may never seriously use something like J, learning such languages will make you a better programmer in ANY language (read ones you do use seriously) because it will give you a new perspective on programming and problem solving and will add a new set of abstractions and cognitive tools to your programming toolbox regardless of what language you actually use seriouslyTantrum
how is this not on community wiki or somewhere other than overflow ?Keratinize
F
287

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!

Fabron answered 18/10, 2010 at 11:27 Comment(21)
i think maybe you would point to Eiffel ;-)Jinnah
I would add Erlang for actor based programming and Fortress for parallel Programming stuff.Unbrace
@Jinnah 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.Unbrace
Thanks! I'm convinced about Haskell, reassured about dataflow and stack based languages and inspired by the others!Mele
@Unbrace Added Erlang. Its processes are nice, but the fault-tolerance machinery is cooler. :-)Fabron
+1 for a few I'd never heard ofUnemployable
+1 for Erlang's hot swap and fault tolerance recognitionInterclavicle
No assembly? It's good to have an understanding of how processors work to learn what sort of code they like.Interrelated
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. ;-)Fabron
@Fabron 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.Mele
@Fabron And the fault-tolerance machinery works with processes :)Unbrace
@pepjin: Learning C is pretty important if you want to master Python, since CPython is written in it.Impure
@intuited: Couldn't you just focus on Python, since that's what PyPy is written in? ;-)Fabron
@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.Impure
@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)Unbrace
great reply!! you mention a number of languages for different purposes, it would have been awesome to have some definition/description (or just a link to a such a categorical explanation).Jerricajerrie
wrt haskell, I recently got a paper copy of learnyouahaskell.com and it is mind-altering. Definitely something worth learning. wrt erlang, it is my favourite language. It's nominally functional, but realistically not so much. But hot swapping, fault tolerance, and built in concurrency constructs are freakin' amazingPlumbism
You could mention APL as grand-daddy of J, which is far more puzzling to look at!Lynettalynette
+1 for highlighting that OOP isn't necessarily always the shitCosmopolite
I would have added a dependently-typed language to this list, e.g. Twelf, Coq, Agda, et cetera. I think Twelf is the most accessible, but I'd have to say Coq is more powerful.Entomb
I've wanted to dig into Agda for some time, but sadly I have not had the time. I was hesitant to add a language that I have not explored myself.Fabron
C
33

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 plethora 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 ;)

Cherish answered 18/10, 2010 at 11:27 Comment(2)
"Also, the whole topic is deep enough to keep one busy for years ;)" -- I wonder, why would this be a good thing? After all, our lives are finite.Minette
@vegai: Why would it be a bad thing? There are worse ways to spend a lifetime on than learning. And nobody said you have to study for years just to use the language properly - just that the topic isn't exhausted after a short time. (Also note the smiley - that part isn't entirely serious.)Incite
U
33

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

Underclothing answered 18/10, 2010 at 11:27 Comment(3)
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.Mele
@pepijn, python doesn't have first class continuations (though I'm working on a bytecode hack to fake it)Eustoliaeutectic
Objective-C draws from Smalltalk, but I think the real takeaway from ST is the dynamism of the environment itself.Bekki
S
32

I currently program Clojure, Python, Java and PHP [...] What are languages that take a different approach and would be useful for either practical tool choosing or theoretical understanding?

C

There's a lot of C code lying around---it's definitely practical. If you learn C++ too, there's a big lot of more code around (and the leap is short once you know C and Java).

It also gives you (or forces you to have) a great understanding of some theoretical issues; for instance, each running program lives in a 4 GB byte array, in some sense. Pointers in C are really just indices into this array---they're just a different kind of integer. No different in Java, Python, PHP, except hidden beneath a surface layer.

Also, you can write object-oriented code in C, you just have to be a bit manual about vtables and such. Simon Tatham's Portable Puzzle Collection is a great example of fairly accessible object-oriented C code; it's also fairly well designed and well worth a read to a beginner/intermediate C programmer. This is what happens in Haskell too---type classes are in some sense "just another vtable".

Another great thing about C: engaging in Q&A with skilled C programmers will get you a lot of answers that explain C in terms of lower-level constructs, which builds your closer-to-the-iron knowledge base.

I may be missing OP's point---I think I am, judging by the other answers---but I think it might be a useful answer to other people who have a similar question and read this thread.

Saransarangi answered 18/10, 2010 at 11:27 Comment(1)
This needs more upvotes. C is the number one language when you need or want to get down to the bare metal and understand the workings of the machine - or higher-level programming languages - from the ground up. Moreover, it is also a very universal, C compilers exist for (almost) every CPU architecture ever devised.Czarina
S
27

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

Sneakers answered 18/10, 2010 at 11:27 Comment(0)
G
13

I'm amazed that after 6 months and hundreds of votes, noone has mentioned SQL ...

Grasso answered 18/10, 2010 at 11:27 Comment(0)
T
10

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!

Trehala answered 18/10, 2010 at 11:27 Comment(3)
I second coq. When learning most languages you can still use your old techniques, but coq forces you to write total programs that always work.Fenella
I tried to learn Coq last summer but gave up because I found ti difficult to find good documentation on learning and using it. Any suggestions?Tantrum
I learned from a course at my uni and then read "Coq'Art: The Calculus of Inductive Constructions" It's not enough to really master it, but sufficient to appreciate it.Fenella
J
6

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.

Jinnah answered 18/10, 2010 at 11:27 Comment(0)
E
5

You've learned a lot of languages. Now is the time to focus on one language, and master it.

Eyeglasses answered 18/10, 2010 at 11:27 Comment(0)
I
5

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.)

Imposing answered 18/10, 2010 at 11:27 Comment(1)
+1, I believe dataflow and flow-based programming (possibly also functional-reactive programming) will become an important part of our multicore future.Tantrum
C
5

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.

Cybele answered 18/10, 2010 at 11:27 Comment(0)
T
3

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

Troublemaker answered 18/10, 2010 at 11:27 Comment(3)
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.Seena
That's what ships with the Lego NXT, right? Totally didn't work for me. Thanks for the suggestion though.Mele
it's from National Instruments. LabVIEW is a graphical development environment that makes scientists and engineers more productiveTroublemaker
K
2

Mercury: http://www.mercury.csse.unimelb.edu.au/

It's a typed Prolog, with uniqueness types and modes (i.e. specifying that the predicate append(X,Y,Z) meaning X appended to Y is Z yields one Z given an X and Y, but can yield multiple X/Ys for a given Z). Also, no cut or other extra-logical predicates.

If you will, it's to Prolog as Haskell is to Lisp.

Kahn answered 18/10, 2010 at 11:27 Comment(0)
I
2

Bruce A. Tate, taking a page from The Pragmatic Programmer wrote a book on exactly that: Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages

In the book, he covers Clojure, Haskell, Io, Prolog, Scala, Erlang, and Ruby.

Immaterialize answered 18/10, 2010 at 11:27 Comment(1)
Be warned that the book is chock full of references to movies that have apparently become part of US pop culture. If you haven't seen the movies, you'll be left wondering what Tate's on about. If you have seen the movies, you may still be put off by the constant anthropomorphication of programming languages or by simply not liking the characters in question (I don't like Mary Poppins; coincidentally I also don't like Ruby, so the analogy may be on to something).Once
J
1

One thing that I see missing from the other answers: languages based on term-rewriting.

You could take a look at Pure - http://code.google.com/p/pure-lang/ .

Mathematica is also rewriting based, although it's not so easy to figure out what's going on, as it's rather closed.

Jokjakarta answered 18/10, 2010 at 11:27 Comment(0)
C
1

While not meeting your requirement of "different" - I'd wager that Fantom is a language that a professional programmer should look at. By their own admission, the authors of fantom call it a boring language. It merely shores up the most common use cases of Java and C#, with some borrowed closure syntax from ruby and similar newer languages.

And yet it manages to have its own bootstrapped compiler, provide a platform that has a drop in install with no external dependencies, gets packages right - and works on Java, C# and now the Web (via js).

It may not widen your horizons in terms of new ways of programming, but it will certainly show you better ways of programming.

Carbineer answered 18/10, 2010 at 11:27 Comment(0)
R
1

There's also anic:

https://code.google.com/p/anic/

From its site:

Faster than C, Safer than Java, Simpler than *sh

anic is the reference implementation compiler for the experimental, high-performance, implicitly parallel, deadlock-free general-purpose dataflow programming language ANI.

It doesn't seem to be under active development anymore, but it seems to have some interesting concepts (and that, after all, is what you seem to be after).

Rainier answered 18/10, 2010 at 11:27 Comment(0)
G
1

Erlang, Forth and some embedded work with assembly language. Really; buy an Arduino kit or something similar, and create a polyphonic beep in assembly. You'll really learn something.

Gish answered 18/10, 2010 at 11:27 Comment(0)
D
1

PostScript. It is a rather interesting language as it's stack based, and it's quite practical once you want to put things on paper and you want either to get it done or troubleshoot why isn't it getting done.

Erlang. The intrinsic parallelism gives it a rather unusual feel and you can again learn useful things from that. I'm not so sure about practicality, but it can be useful for some fast prototyping tasks and highly redundant systems.

Try programming GPUs - either CUDA or OpenCL. It's just C/C++ extensions, but the mental model of the architecture is again completely different from the classic approach, and it definitely gets practical once you need to get some real number crunching done.

Dugong answered 18/10, 2010 at 11:27 Comment(0)
D
1

For anyone who hasn't been around since the mid 80's, I'd suggest learning 8-bit BASIC. It's very low-level, very primitive and it's an interesting exercise to program around its holes.

On the same line, I'd pick an HP-41C series calculator (or emulator, although nothing beats real hardware). It's hard to wrap your brain around it, but well worth it. A TI-57 will do, but will be a completely different experience. If you manage to solve second degree equations on a TI-55, you'll be considered a master (it had no conditionals and no branches except a RST, that jumped the program back to step 0).

And last, I'd pick FORTH (it was mentioned before). It has a nice "build your language" Lisp-ish thing, but is much more bare metal. It will teach you why Rails is interesting and when DSLs make sense and you'll have a glipse on what your non-RPN calculator is thinking while you type.

Daven answered 18/10, 2010 at 11:27 Comment(0)
N
1

While learning new languages on an academical level is an interesting hobby, IMHO you can't really learn to use one until you try to apply it to a real world problem. So, rather than looking for a new language to learn, I'd in your place first look for a new things to build, and only then I'd look for the right language to use for that one specific project. First pick the problem, then the tool, not the other way around..

Nubilous answered 18/10, 2010 at 11:27 Comment(0)
I
1

Say you want to write a love poem...

Instead of using a hammer just because there's one already in your hand, learn the proper tools for the task: learn to speak French.

Once you've reached near-native speaking level, you're ready to start your poem.

Imagine answered 18/10, 2010 at 11:27 Comment(2)
Of course, it will be a rubbish poem, because you need to speak well above ordinary native level to write poetry. And your girlfriend will need to learn French to read it. Unless she's already French, in which case she'll probably find it embarrassing.Hughhughes
Delicious irony, John, I like it (I'm french, btw)Hammonds
I
1
  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)

Imposing answered 18/10, 2010 at 11:27 Comment(0)
K
0

APL, Forth and Assembly.

Have some fun. Pick up a Lego Mindstorm robot kit and CMU's RobotC and write some robotics code. Things happen when you write code that has to "get dirty" and interact with the real world that you cannot possibly learn in any other way. Yes, same language, but a very different perspective.

Kelsy answered 18/10, 2010 at 11:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.