LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Haskell, Lisp, Clisp, Scala, Erlang (http://www.linuxquestions.org/questions/programming-9/haskell-lisp-clisp-scala-erlang-4175447536/)

jokar.mohsen 01-28-2013 08:18 AM

Haskell, Lisp, Clisp, Scala, Erlang
 
Hello Folk.
Excuse me, I read some wiki about Lisp, Haskell, Clisp and Erlang, Are they Academic language?
Why Lisp and its family used today?
A friend told me that, He launches a project with Haskell about one day but if he wants use C\C++ for doing it, It takes 6 months, is it correct?
Can you tell me the Advantages and Disadvantages؟

Thank you.

bigearsbilly 01-28-2013 08:58 AM

Lisp is a wonderful language...
and so is C.
But they have different goals.

It depends on what you want to do, they are different tools.

Code:


C/C++
=====
Brain------------------------------> keyboard --> machine

Lisp
=====
Brain --> Keyboard -----------------------------> machine


Snark1994 01-28-2013 09:09 AM

bigearsbilly's post was slightly elliptic - I assume he was referring to Lisp being a bit closer to the way you think about problems (a claim often put forward by "functional programming" languages, such as Haskell) compared to C/C++, as well as the fact that you need to compile C/C++ code before you run it, while Lisp is interpreted (making C++ faster in general).

Haskell is certainly used for real-world applications (aurora and xmonad being two which spring to mind) but its use is rare compared to languages such as C/C++ or Java.

I think if a project would take 1 day to do in Haskell and 6 months to do in C++, then that says far more about the programmer's relative familiarity with Haskell compared to C++ than anything else - I consider it highly unlikely that such a dramatic difference in implementation time exists at any level, for someone who is reasonably competent in both languages.

dugan 01-28-2013 09:30 AM

Quote:

Originally Posted by jokar.mohsen (Post 4879030)
Why Lisp and its family used today?

Script-Fu (Gimp's scripting language) and Emacs Lisp (Emac's scripting language) are Lisp-based.

LINQ, .NET's data querying library (which AFAIK is still very widely used), is heavily based on Haskell.

Haskell has a couple of extremely interesting and performant web frameworks available for it: snap and yesod.

And if you count Javascript as part of the "Lisp family" (which it is to a large extent), then it's obviously used everywhere.

And Snark, what is this aurora project that you refer to?

Sergei Steshenko 01-28-2013 10:12 AM

LISP is widely in CAS (Computer Algebra System).

CLISP is a well known implementation of LISP. SBCL is a faster than CLISP implementation, bey requires a LISP for bootstrapping when built from source - that's why I build both.

bigearsbilly 01-28-2013 01:07 PM

Quote:

Originally Posted by Snark1994 (Post 4879065)
bigearsbilly's post was slightly elliptic - I assume he was referring to Lisp being a bit closer to the way you think about problems

exactly!

sundialsvcs 01-28-2013 06:19 PM

There are hundreds of computer programming languages out there which are, somewhere, still in use. Even extensively.

jlinkels 01-28-2013 09:02 PM

3DWings, a 3D modeller is written in Erlang.

jlinkels

jokar.mohsen 01-29-2013 05:18 AM

All answers are correct but In your opinion, Lisp is good for learn or Haskell or Scala?

Snark1994 01-29-2013 06:50 AM

Quote:

Originally Posted by dugan (Post 4879086)
And Snark, what is this aurora project that you refer to?

Sorry, I meant Aura, not Aurora (though Aurora does roughly the same thing, it's in Python and not as good). It's an Arch linux package manager (or rather, an interface to the AUR, Arch User Repository, that uses the same options as the default package manager does): https://wiki.archlinux.org/index.php/Aura

Quote:

All answers are correct but In your opinion, Lisp is good for learn or Haskell or Scala?
Well, it will help you a little bit more with Haskell than Scala - Scala is based more on Java, though both use functional programming ideas which are present in LISP. Lisp is probably the most widely used still, but I would say that both Haskell and Scala are increasing in popularity (with Scala even being touted as a potential long-term replacement for Java).

(see e.g. http://www.tiobe.com/index.php/conte...pci/index.html, though its accuracy is questionable)

jokar.mohsen 01-29-2013 07:59 AM

Quote:

Originally Posted by Snark1994 (Post 4879826)
Sorry, I meant Aura, not Aurora (though Aurora does roughly the same thing, it's in Python and not as good). It's an Arch linux package manager (or rather, an interface to the AUR, Arch User Repository, that uses the same options as the default package manager does): https://wiki.archlinux.org/index.php/Aura



Well, it will help you a little bit more with Haskell than Scala - Scala is based more on Java, though both use functional programming ideas which are present in LISP. Lisp is probably the most widely used still, but I would say that both Haskell and Scala are increasing in popularity (with Scala even being touted as a potential long-term replacement for Java).

(see e.g. http://www.tiobe.com/index.php/conte...pci/index.html, though its accuracy is questionable)

Excuse me, In your opinion Scala is a replacemnet for JAVA?

Snark1994 01-29-2013 09:52 AM

Quote:

Originally Posted by jokar.mohsen (Post 4879870)
Excuse me, In your opinion Scala is a replacemnet for JAVA?

Not quite, in James Strachan's opinion: http://www.infoq.com/news/2009/07/scala-replace-java. I have done little Java and less Scala, though if I were to choose one to code in, I would choose Scala for its functional features.

dugan 01-29-2013 11:07 AM

Quote:

Originally Posted by jokar.mohsen (Post 4879747)
All answers are correct but In your opinion, Lisp is good for learn or Haskell or Scala?

Learn Scheme by going through the SICP. Picking up any other functional programming language afterwards will be easy.

hydraMax 01-29-2013 11:51 PM

Quote:

Originally Posted by jokar.mohsen (Post 4879030)
Hello Folk.
Excuse me, I read some wiki about Lisp, Haskell, Clisp and Erlang, Are they Academic language?
Why Lisp and its family used today?
A friend told me that, He launches a project with Haskell about one day but if he wants use C\C++ for doing it, It takes 6 months, is it correct?
Can you tell me the Advantages and Disadvantages؟

Thank you.

Haskell is my favorite language, so I can tell you about that one at least. Haskell is a pure Functional Programming language, with a very powerful typing system. It is "academic" in the sense that it borrows a lot of theory from lambda calculus and category theory, and it can be difficult to understand at first for someone used to the more popular imperative languages (C, C++, Java, Perl, Python, etc.)

One big difference is that, as an FP language, the programmer focuses more on what the program "is" that what it "does". Instead of listing steps of things to do to solve a problem, you define your functions, and then your program resolves itself (like a big equation). And the strict (but dynamic) and polymorphic type system allows you to abstract programming concepts away to an insanely high level. Consequently, you can basically encode the logic of your program into the structure of the code as you write it, rather than doing that as a before-thought or after-thought.

Haskell is completely pure, meaning that IO operations never happen inside functions, unless the function is purposefully tainted as an IO function. A pure function (one that simply does calculations) can never be treated like an impure function (one that has side effects) and vice versa. Therefore, a function will never do "IO" things, like changing a global variable, or printing to stdout, unless you were expecting it to do so.

And of course, it has higher order functions, currying, and partial application. This means you can create a new function from another function by passing in only a few of the arguments it needs (this is really helpful). Also, you can easily pass in functions to other functions (functions and data are all the same to Haskell). So you could, for example, easily create a function that reads lines from a file, and then pass another function into it, which it could use to parse those lines.

There's more that could be said, but I'll just end by praising Haskell as one of the few programming languages out there that isn't inherently boring, and it allows you to rise to very great heights in programming knowledge and theory.

jokar.mohsen 02-03-2013 06:42 AM

Can you compare Haskell with Clojure or Scala?


All times are GMT -5. The time now is 04:31 AM.