I
I
imperiumcat2015-12-25 10:29:32
Lisp
imperiumcat, 2015-12-25 10:29:32

Lisp or Haskell?

Good afternoon.
I really like FP for its intellectual sophistication. I choose what is better to dive into: Lisp (if so, what dialect?) or Haskell? (English is normal, so if you advise good literature on the topic, I will be grateful).
Because I am not a programmer (yet), but an ordinary PM, then the subject itself is interesting, without a serious practical component (unfortunately).
Required results from the study:
1. Enjoyment of the process
2. Pumping thinking
3. Better understanding of the FP paradigm that can be used in Java and Javascript.
There is only one criterion, but a serious one - little free time;
So far this is the impression:
1. Haskell - has practically reached the level of mass OOP languages, there is a trend towards the folding of a normal infrastructure - a large community, libraries, commercial projects. Accordingly, it is friendlier in terms of syntax, general readability, a lot of literature.
2. LISP - a thing in itself, a kind of esoteric sect - boundless and many-sided like the ocean, of little practicality, of little use, but interesting.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
Nikita Vorontsov, 2016-02-29
@imperiumcat

Let's start with the fact that Lisp is not functional. For those who come to Lisp from the world of imperative languages, it may seem that way, but I came to Lisp after Haskell, and I tell you for sure, Lisp is not functional.
Now on the topic - both languages ​​are extremely interesting and capable of blowing your brain, but Haskell inserts more, it is really abstruse and replete with super-duper new sophisticated programming technologies (Applicative functors, combinators, monads, lazy evaluation), but what will really blow your mind is purity of the language (you can’t do side effects, i.e. you can’t write to the console anywhere you want, you can’t assign a value to a variable), the absence of cycles and declarativeness (you don’t write “how”, but write “what” is the task). But this is only at the beginning. Once you get the hang of it, Haskell turns out to be very expressive and concise. But he also has disadvantages - he is very complicated, VERY. Seriously, even after half a year, you will still have problems. I'm sure 95% of Haskellists won't explain in detail how Hello world works in Haskell,

main::IO ()
main = do
putStrLn "Hello world!"

it doesn't look complicated, but here's what's hiding under the water: all the calculations happen in the IO monad. Only in it side effects are allowed. The side effect (I/O action) is only executed when it returns to main. side effects are only allowed in main (and therefore only in the IO monad since main returns IO () ). What is IO()? It's like a list of actions that are pushed there and combined into a chain to be sequential (outside the monad, the order in which your instructions are executed is not defined, happy debugging). These actions are not actually performed immediately, but are a "promise" to do this action, which is implemented as soon as something already in action does not require a result, in our case it is the console ... in general, and this is just the tip of the iceberg, I I haven't talked about types yet.
In general, Haskell is interesting, but very difficult. Even if you don’t break your teeth, you will have problems with debugging for a very long time, with understanding all sorts of astral techniques that multiply day and night, like arrows or lenses. Yes, and it is often very difficult to understand someone else's Haskell code, because everyone thinks that he is simply obliged to apply all the abstruse things that he knows, because isn't that why he learned Haskell? But then people will read it...
Now a couple of words about Lisp - I have less experience here, but the idea is this - it's a programmable programming language. In addition to the fact that it has macros - special tools to write a program that will write a program, the language itself is a syntax tree in its original form, which opens up endless possibilities in metaprogramming. In general, the idea is this - this language in capable hands becomes absolutely anything you want. Do you like Haskell and FP? Great, let's do it now. Do you want lazy calculations? On the! Do you want classes? Here! Do you want logic programming? Hold on! With all this, the language is extremely simple, maybe even simpler than C.
So what can I advise you? Probably, start with Haskell - it drags along a huge theoretical base and a whole arsenal of such programming techniques that you never dreamed of. You will learn, you will get used - think of a lisp. But! You'll need to install Emacs anyway - it's the best environment for both languages, and Emacs is configured on Emacs Lisp so you'll have a chance to look at it. Watch the video on emax https://www.youtube.com/playlist?list=PLECBtie1W1t... (there is also a chapter about Emacs Lisp), then download "Haskell for the sake of good" and "Oh Haskell in a human way" and read them in parallel - in the first, a good soft introduction, and in the second, practice - it is needed right away in order to at least know how to create a project using cabal and assemble it, otherwise Lipovach sits half the book in the interpreter.

P
Pavel Ivanov, 2015-12-25
@eastywest

Try Clojure, a dialect of Lisp. In addition to the FP paradigm, get the opportunity to use Java libraries.

Z
ZloyEngineer, 2015-12-30
@ZloyEngineer

First, Lisp for immersion in FP, preferably not the original, but one of its dialects, for example, Scheme, as, in my opinion, the most academic. Then Haskell for getting practical skills.
As for the gentlemen who talk about the impracticality of Haskell, I can advise you to abandon the way of thinking "if I don't know how to do something, then it can't be done in principle." Haskell has its practical application in real life no less than, for example, Python. The only problem is the rather high threshold for entering the language. High for a Canadian lumberjack who decides to complete a week-long course and become a highly paid programmer. As for programmers of an average level or a little lower, Haskell makes it possible for them to write fast, stable programs, spending significantly less time than in the same Java. I'm talking about real programs, and not about puzzles from olympiads about putting coins into piles, about programs in 200+ lines in Haskell, which translates into C ++ / Java 2000+ lines.

V
Vasily minodvesP, 2016-05-10
@benoni

1. If you are interested/like one of the JVM or .NET platforms and you are interested/like Lisp, then you can choose from the following Lisp dialects:
- JVM : Clojure, Armed Bear Common Lisp or Kawa (scheme dialect)
- .NET: IronScheme
2. If If you use Emacs as an editor/IDE, then you should probably learn ELisp so that you can configure emax for yourself or write some useful plug-in.
3. And, finally, if you still have free time and want to delve into the functionality, then there is also: Standard ML, OCaml, Scala, F #, Neverle and other less well-known ones. Type in taste and color)
4. Languages ​​written in Haskell: Elm (for the web), Idris and Agda. And if you are only interested in the web, then maybe you should look at Elm, which has Haskell syntax and seems to be simpler than Haskell (as far as I know). Also, a dialect of the HuskScheme scheme (it seems to be called so) is written in Haskell.

D
dponyatov, 2016-08-25
@dponyatov

And who will say anything about Racket?
I read PLAI ( https://cs.brown.edu/~sk/Publications/Books/ProgLangs/ ) ,
like even without knowledge of Lisp (I scrolled through the first 100 pages of SICP, no more)
examples give a feeling of understanding how it is in C ++ implement (racket-plai dialect uses typing)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question