What language should I learn after Haskell?

As my first programming language, I decided to learn Haskell. I am an analytical philosophy, and Haskell allowed me to quickly and correctly create programs of interest, for example, converters for natural language analysis, theoreticians of theorems and translators. Although I only programmed for two and a half months, I found the Haskell semantics and syntax much easier to learn than the more traditional imperative languages, and now I feel comfortable (with most of my designs).

Haskell programming is like witchcraft, and I would like to expand my programming knowledge. I would like to choose a new programming language to learn, but I don’t have enough time to choose an arbitrary language, drop it and repeat it. So I thought that I would pose a question here, as well as a few points about the type of language I'm looking for. Some of them are subjective, some of them are designed to facilitate the transition from Haskell.

  • Strong type system. One of my favorite pieces of programming in Haskell is writing type declarations. This helps to structure my thoughts about individual functions and their relation to the program as a whole. It also facilitates an informal justification of the correctness of my program. I am concerned about correctness, not efficiency.
  • Emphasis on recursion, not iteration. I use iterative constructs in Haskell, but implement them recursively. However, it is much easier to understand the structure of a recursive function than a complex iterative procedure, especially when using combinators and higher-order functions, such as maps, folds, and snapping.
  • Learning Award. Haskell is a useful language to work with. This is a bit like reading Kant. My experience a few years ago with C, however, was not. I'm not looking for C. The language should impose a conceptually interesting paradigm that, in my completely subjective opinion, C-like doesn't.

Weighing the answers . These, of course, are just notes. I would just like to answer everyone who gave good answers. You were very helpful.

1) Several answers showed that a strong, statically typed language that emphasizes recursion means another functional language. Although I want to continue to work actively with Haskell, camcann and larsmans correctly pointed out that another such language "will make the transition too easy." These comments were very helpful because I do not want to write Haskell in Caml! Of the proofs helpers, Coq and Agda look interesting. In particular, Coq will provide a solid introduction to constructive logic and formal type theory. I spent a bit of time with a first-order predicate and modal logic (Mendelssohn, Enderton, some of Hinman), so I probably would have had a lot of fun with Coq.

2) Others prefer Lisp (generic Lisp, Schema, and Clojure). From what I collect, both Common Lisp and Scheme have excellent introductory material (On Lisp and The Reasoned Schemer, SICP). The stuff in SICP makes me lean toward the Scheme. In particular, the scheme through SICP will cover a different evaluation strategy, the implementation of laziness and the ability to focus on topics such as continuations, interpreters, symbolic calculations, etc. Finally, as others have noted, Lisp code / data processing will be completely new. Therefore, I am strongly inclined towards option (2), Lisp.

3) Thirdly, Prolog. There is a lot of interesting material in Prolog, and its main domain is the one that interests me. It has simple syntax and is easy to read. At the moment, I can not comment anymore, but after reading the Prolog review and removing some introductory materials, he is among the number (2). And it seems like Prolog backtracking is always hacked into Haskell!

4) Of the main languages, Python looks the most interesting. Tim Yates makes languages ​​sound very attractive. Python apparently teaches first-graders CS; therefore, he is either conceptually rich or easy to learn. I will need to do more research.

Thank you all for your recommendations! It seems that it is recommended to use Lisp (Scheme, Clojure), Prolog or a validation helper such as Coq or Agda.

+85
programming-languages haskell
Sep 22 2018-10-22T00:
source share
17 answers

I would like to expand my programming knowledge. (...) I thought I would pose a question here, as well as a few points about the type of language I'm looking for. Some of them are subjective, some of them are designed to facilitate the transition from Haskell.

Strong type system. (...) He also makes informal discussions about the correctness of my program easier. I am concerned about correctness, not efficiency.

Emphasis on recursion, not iteration. (...)

I'm afraid you can make the transition here a little easier. A very strict type system and a purely functional style are characteristic of Haskell, and almost everything that looks like the main programming language will require compromise on at least one of them. So, with that in mind, here are a few broad suggestions aimed at preserving most of what you like about Haskell, but with some significant shift.
  • Ignore practicality and move on to "more Haskell than Haskell." : A Haskell-type system is full of holes, due to ceasing and other erratic compromises. Clear the mess and add more powerful functions, and you will get languages ​​like Coq and Agda , where the type of the function contains proof of its correctness (you can even read the arrow -> function as a boolean!). These languages ​​were used for mathematical proofs and for programs with extremely high requirements for correctness. Coq is perhaps the most famous language in style, but Agda has a greater sense of Haskell-y (and also written in Haskell).

  • Types of ignoring, add more magic . If Haskell is witchcraft, Lisp is the original creation magic. Lisp family languages ​​(including Scheme and Clojure ) have almost unprecedented flexibility combined with extreme minimalism. Languages ​​essentially have no syntax; writing code directly as a tree data structure; metaprogramming in Lisp is simpler than not meta-programming in some languages.

  • A compromise approach and closer to the core : Haskell falls into a wide family of languages ​​that strongly influence ML, any of which you could probably go without too much difficulty. Haskell is one of the most rigorous when it comes to guarantees of the correctness of types and the use of a functional style, where others are often either hybrid styles or / or make pragmatic compromises for various reasons. If you want to expose OOP and access to many major technology platforms, either Scala on the JVM or F # on .NET have much in common with Haskell, while providing easy compatibility with Java and .NET platforms. F # is directly supported by Microsoft, but has some annoying limitations compared to Haskell and portability issues on non-Windows platforms. Scala has direct comparisons to a large number of systems such as Haskell and the cross-platform potential of Java, but it has a heavier syntax and does not have the powerful third-party support that F # uses.

Most of these recommendations are also mentioned in other answers, but hopefully my justification for them gives some enlightenment.

+85
Sep 22 '10 at 16:30
source share

I am going to be this guy and suggest that you ask for the wrong one.

First you say you want to expand your horizons. Then you describe the language that you need, and its horizons sound incredible, as you already have horizons. You will not get very much by learning the same thing over and over again.

I would advise you to learn Lisp - i.e. generic lisp, circuit / rocket or clojure. All of them are dynamically typed by default, but have some kind of hint or optional static input. Racket and Clojure are probably your best bet.

Clojure is later and has more Haskellisms, like default immutability and a lot of lazy evaluation, but it is based on the Java virtual machine, which means it has some odd warts (for example, the JVM does not support tail call removal, so recursion is a kind of hack).

Racket is much older, but is gaining a lot of strength along the way, such as supporting static type and focusing on functional programming. I think you are likely to get the most out of Racket.

Macros in Lisps are very interesting and significantly more powerful than anything you see anywhere else. This alone is worth a look.

+20
Sep 22 '10 at 17:23
source share

In terms of what suits your major, the obvious choice seems to be a logical language such as Prolog or its derivatives. Logical programming can be done very carefully in a functional language (see, for example, The Reasoned Schemer ), but you may like to work with the logical paradigm directly.

An interactive theoretical proof system, such as twelf or coq, can also amaze your imagination.

+19
Sep 22 2018-10-22T00:
source share

I would advise you to learn Coq , which is a powerful proof-of-concept assistant with syntax that will be convenient for the Haskell programmer. The great thing about Coq is that it can be extracted to other functional languages, including Haskell. There is even a package ( Meldable-Heap ) in Hackage, which was written in Coq, the properties were proved in its work, and then extracted into Haskell.

Another popular language that offers more features than Haskell, Agda - I don’t know that Agda does not know that it depends on the type on Hackage, and people whom I respect are well respected, but for me these are good enough reasons.

I would not expect this to be easy. But if you know Haskell and want to switch to a language that provides more energy than a system like Haskell, then they should be considered.

+18
Sep 22 '10 at 15:35
source share

As you did not mention any restrictions other than your subjective interests and emphasize the “reward to learn” (well, well, I will ignore the restriction of static typing), I would suggest studying several languages ​​of different paradigms and preferably those that are “exemplary” for each of them.

  • A Lisp is a dialect for data-data-data / homoconicity codes because they are good, if not better, examples of dynamic (more or less strict) functional programming languages.
  • Prolog as the predominant logical programming language
  • Smalltalk as the only true OOP language (also interesting because of its usually extremely image-oriented approach)
  • maybe Erlang or Clojure if you are interested in languages ​​created for parallel / parallel / distributed programming.
  • Forth for stack oriented programming
  • (Haskell for strict functional statically typed lazy programming)

Especially Lisps (CL is not as strong as Scheme) and Prolog (and Haskell) embrace recursion.

Although I am not a guru in any of these languages, I spent some time with each of them, except Erlang and Fort, and all of them gave me revealing and interesting knowledge, since each of them approaches solving problems from a different angle.

So, although it may seem that I have ignored the part that you do not have time to try several languages, I rather think that the time spent with any of them will not be wasted, and you should take a look at all of them.

+11
Sep 22 2018-10-18
source share

How about a stack programming language ? Cat hits your high points. It:

  • Statically typed with output type.
  • Makes you rethink common imperative languages, such as the loop. Conditional execution and the loop are performed using combinators .
  • Rewarding - makes you understand another model of computing. Gives you another way to think and break down problems.

R. Dobbs published a short article on Cat in 2008, although the language has changed a bit.

+10
22 Sep '10 at 16:07
source share

If you need a strong (er) lame Prolog, Mercury is an interesting choice. I did this in the past, and I liked the other perspective he gave me. It also has moded-ness (which parameters should be free / fixed) and determinism (how many results are there?) In the type system.

Clean is very similar to Haskell, but has a unique typing that is used as an alternative to Monads (more specifically, IO monad). The uniqueness of the input also makes interesting material for working with arrays.

+10
Sep 23 '10 at 8:32
source share

I'm a little late, but I see that no one has mentioned a couple of paradigms and related languages ​​that might interest you in their high level of abstraction and generality:

+9
08 Oct 2018-10-10T00:
source share

Despite the fact that it does not meet one of your big criteria (static * typing), I'm going to make an example for Python. Here are a few reasons why I think you should take a look at this:

  • For an imperative language, this is surprisingly functional. That was one of the things that struck me when I found out about it. For example, a list of concepts . It has lambdas, first-class features and many functionally inspired compositions on iterators (cards, folds, zippers ...). This gives you the opportunity to choose any paradigm that is best suited for this problem.
  • IMHO, this, like Haskell, is beautifully encoded. The syntax is simple and elegant.
  • It has a culture that focuses on doing things straightforwardly, rather than focusing too carefully on efficiency.

I understand if you are looking for something else. Logic programming, for example, can be right up your mall, as others have suggested.




* I assume that you mean static typing here, since you want to declare types. Techincally, Python is a strongly typed language because you cannot arbitrarily interpret, say, a string as a number. Interestingly, there are Python derivatives that allow static typing, such as Boo .

+8
Sep 22 '10 at 15:34
source share

Given your description, I would suggest Ocaml or F # .

The ML family is generally very good in terms of a strong type system. The emphasis on recursion combined with pattern matching is also clear.

Where I doubt a little, it's a reward to find out a piece. Of course, studying them was useful to me. But, given your limitations and your description of what you want, it seems you are not really looking for something much more than Haskell.

If you did not specify your limitations, I would suggest Python or Erlang , both of which will take you out of your comfort zone.

+8
Sep 22 '10 at 16:29
source share

I would recommend Erlang to you. This is not a strong typed language, and you should try it. This is a completely different approach to programming, and you may find that there are problems when strong typing is not the best tool (TM). Anyway, Erlang provides you with tools for checking the static type (typer, dialyzer), and you can use strong typing on the parts where you benefit from this. It may be interesting for you, but to be prepared, it will be a completely different feeling. If you are looking for a “conceptually interesting paradigm”, you can find them in Erlang, messaging, sharing memory instead of sharing, distributing, OTP, handling errors and spreading errors instead of preventing errors, etc. Erlang may be away from your current experience, but your brains are still tickling if you have experience with C and Haskell.

+8
Sep 22 2018-10-22
source share

In my experience, strong text input + emphasis on recursion means another functional programming language. Again, it seems to me that this is very useful, given that none of them will be as "clean" as Haskell.

Like other posters, Prolog and Lisp / Scheme are good, although both are dynamically typed. Many great books with a strong theoretical “taste” for them have been published about the Scheme in particular. Take a look at SICP , which also conveys a lot of common wisdom in computer science (meta-circular translators, etc.).

+6
Sep 22 '10 at 15:31
source share

Factor would be a good choice.

+6
Sep 23 '10 at 12:51 on
source share

You can start your search for Lisp .

Prologue is a cool language.

+5
Sep 22 2018-10-22T00:
source share

If you decide to deviate from your preference for a type system, you might be interested in the programming language J. This is great because it emphasizes the functional composition. If you like Haskell's unlimited style, then the unspoken J form will be useful. I found this extremely thoughtful, especially regarding semantics.

True, this does not correspond to your preconceptions about what you want, but let him take a look. Just knowing it is worth discovering. The only source of complete implementations is J Software, jsoftware.com.

+5
Oct 02 2018-10-10T00:
source share

Go with one of the main threads. Given the available resources, the future competitiveness of your skill, the rich ecosystem of the developer, I think you should start with Java or C # .

0
Sep 22 '10 at 18:06
source share

Great question. I recently requested this after spending several months enjoying Haskell completely, although my background is very different (organic chemistry).

Like you, C and his words are out of the question.

I hesitated between Python and Ruby as two practical scripting languages ​​(mules?), Which both have functional components for them to make me happy. Without starting any discussions with Rubyist / Pythonist, but my personal pragmatic answer to this question is:

Find out which one (Python or Ruby) was your first excuse.

0
Sep 30 '10 at 18:21
source share



All Articles