Ask HN: How would you modify this list of best Perlis languages?
"Perlis language" is a subjective term. That is, does a language represent a new way of thinking for you? On the other hand, I think we can agree that a good Perlis language: * implements the most powerful and representative features of a paradigm * does not require learning much more than what is needed to use the paradigm * does not mix non-orthogonal paradigms * is developed enough that you can build working applications with it
I tried to list every distinct paradigm and match it with the best implementation. Some languages came up as the best for multiple paradigms. There were a few paradigms that I was really interested in but couldn't find a suitable implementation. In the end, I was surprised at how short my list is.
What would you change? Would you argue for a different language, or to add/delete a paradigm?
C -- procedural
Forth -- build it yourself
Emacs Lisp -- macros, code as data
Erlang -- impure functional, eager evaluation, dynamic typing, actor concurrency
Clean -- pure functional, lazy evaluation, static typing
GNU Smalltalk -- class-based OOP
Io -- prototype-based OOP, reflection
APL -- array-based, built on a small set of powerful operators
Prolog -- unification, backtracking, logic variables
24 comments
[ 7.2 ms ] story [ 86.6 ms ] threadI thought a bit about Google's Go. It gets rid of the preprocessor and cleans up handling of pointers. But it also does away with manual memory management. That may be getting too far away from the machine for learning purposes.
I also thought about Ada, but that seems to impose a heavy learning overhead.
What about going the other direction, down to assembly? Unlike many people, I have no loathing of assembly programming. I find well-structured and commented assembly code to be just as easy to read as similar quality C code. Although it has a reputation for being hard, experienced ASM coders tell me it's just a matter a familiarity. They claim to be just as productive in ASM as in C.
My decision to pass over assembly is because modern processors no longer have a straightforwardly sequential execution model. The image you get from tracing assembly code is only an approximation of what will happen in the processor, which is the same as you can say for C code. So my perception is that there is no particular benefit to knowing ASM any more. (Unless you are working with older, simpler designs as in embedded systems.)
Re: Assembly -- I disagree. With the increasing popularity of heterogenous multi-processor systems (cpu + specialized processors like GPUs, etc.) learning languages that are more constrained to the hardware is still valuable/important.
Also, note that building specialized code generators (be they stand along or embedded DSLs) to the assembly language can give you a nice payoff.
Forth isn't just a framework for expressing algorithms, it's a whole philosophy of system development. You start with nearly nothing, sometimes not even an operating system, and build up precisely and only what you need. http://www.yosefk.com/blog/my-history-with-forth-stack-machi...
That said, from a practical standpoint, Factor is excellent.
In fact, I'm surprised that more of the recent language implementations haven't used Factor as their backend rather than e.g. llvm.
People had high hopes for Prolog in the 1970s, but it proved to be a total disappointment. It was terribly slow and had a complicated performance model. These days, the niche for which Prolog is a good choice is very small. For combinatorial problems, Prolog has been superceded by extensions like Choco and Gecode and by easier and faster dedicated systems like Essence, Minion, and G12. Prolog is still sometimes chosen for small projects in constraint programming or text manipulation.
Be sure to read this article on how Prolog really works. http://www.amzi.com/articles/prolog_under_the_hood.htm
I like Dyalog and they have a free book (http://www.dyalog.com/intro/) but there are others (http://www.rexswain.com/aplinfo.html)
Prototype OOP really was a challenge for this list. Although several prorotype-based languages have been developed, I think only Io and JavaScript have made it into production use. (Unless you count the crippled and long-dead NewtonScript.)
So why not JavaScript? Well, ugh, JavaScript is a mess, not just the language, but also the production environments, the documentation, and the user community. In addition to prototypes, JavaScript incorporates the functional paradigm plus a lot of random warts. Developing JavaScript apps for release is a nightmare because of platform differences. Documentation is little help, because even advanced books on JS take the approach that class-based OOP is what you really want, so they focus on how to hammer JS into something that looks like Java. They are many excellent 3rd party libraries, but they either treat JS as a functional language or force it into the class-based mould. So, I'd answer that you can write good prototype-based code in JavaScript, but you really need to be proficient before going in.
Ruby gets recommended a lot as a modern alternative. It has a very clean syntax and the OOP machinery is closely copied from Smalltalk. By my experience is that while Ruby code at first seems clean and elegant, it turns out to be confusing. The design philosophy is like Perl, have multiple ways to do anything. The larger and more complicated grammar makes it harder to learn. I thought that while regexes and class management were smoothly integrated, many other syntactic features were inconsistent, nonstandard, or ambiguous. In all, there were just too many other things going on to make Ruby a good vehicle for dipping into class-based OOP.
Python, also, might be suggested, since Python 3 has made the OOP features more integrated than once was the case. However, Python is a big language, there is a lot to become aware of, and the OOP machinery is not all that close to Smalltalk any more.
GNU Smalltalk is what I recommend. It is a straightforward implementation of traditional Smalltalk with one big difference. Instead of being image-based and editable only in the Smalltalk browser environment, GST is text-based. You write code in a text editor as with any other language, though there is also a browser environment available. GNU Smalltalk is designed as a scripting language, so it has the usual facilities for system interaction.
A Smalltalk IDE is unlike any other. The integration of language and 'operating system' changes the way you look at most other languages; it's not just an OO thing. You lose all that if you go running to the familiar, comfortable 'standard' of a text editor.
Personally, I'd suggest Pharo Smalltalk as an ideal starting point: it's clean, modern and under vigorous development, with a thriving community.
Also, I strongly disagree with 'unwieldy class libraries' - I've found the libraries a joy to use. Clear, logical, and very easy to explore even without reams of documentation.
There is some confusion over the handling of state in Clean versus Haskell. It is usually said that Haskell uses monads and Clean uses uniqueness types. This is partly true. A more accurate explanation that monads and uniqueness types are distinct features that can coincidentally both be used to manage state. Haskell doesn't have uniqueness types. Clean has both, and you can use either, but the developers prefer uniqueness types. Having tried both methods, I'd say that uniqueness types are easier to understand but monads give cleaner structure to the code.
I see so many laments from people who tried Haskell and gave up. My guess is that there would be a much lower attrition rate if they started with Clean instead.
I think Erlang's legacy is the fact that it's exposing those other features that you mention to a wide audience of language aficionados that they are spreading (gaining legitimacy/traction) within other languages / libraries.
That said, I want to recommend languages that introduce people to new ideas with a minimum of distractions. If the syntax is an issue, then I should point to alternatives. For the important concepts in Erlang, I'd appreciate suggestions.
Alas, CL is an old, bloated nightmare. :-( :-)
I think the new poster child for "Lisp" is Clojure.
Also, for learning programming, I'm still a big fan of Scheme.
Of course, there are tons of Java programmers out there and several really interesting languages for the JVM. I have thought that there should really be a list similar to mine, for people who are already working in the Java environment.
I think either J or K is better than APL in this category.
I would also add Pure <http://pure-lang.googlecode.com>; for general term rewriting (lambda calculus? Just a special case!)
I would need some convincing with J, though. I've studied both and I thought APL had much better tutorial material, development tools, and conceptual straightforwardness. I didn't stick with J for very long, so I'm sure I missed important aspects of its use. Could you explain some ways in which you think J gives a better demonstration of the possibilities of the array-oriented paradigm?
Pure is a dynamically-typed, eager, impure functional language with Haskell-ish syntax. It also has optional type declarations and forced lazy evaluation. "Term rewriting" is the evaluation model.
Maude. Pure. OBJ3 - term rewriting
Inform 7 - object-relational
Kaleidoscope. - constraint imperative
Bloom. Dedalus. - Temporal Logic; monotonic data.
Excel. Spreadsheets. - reactive dataflow.
Conway's Game of Life - Cellular automata.
Oz/Mozart - distributed unification.
I would suggest Dedalus (datalog + time) as a cleaner example than Prolog of how to lift logic programming into general purpose computation.