Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will Haskell be a good choice for my task?

I'm starting a new project and don't know which language to use.

My 'must have' requirements are:

  1. Be able to run on Windows/LinuxMacOs natively (native executable) – user should be able to just run the .exe (when on Windows, for example) and see the results.
  2. No runtimes/interpreters (no JVM, CLR etc.) – one file download should be enough to run the application.
  3. Full Unicode support.
  4. Be able to manipulate OS threads (create them, run multiple tasks in parallel on multi-core CPUs, etc.)
  5. Be reasonably fast (Python level performance and better).
  6. To have some kind of standard library that does low-level, mundane tasks.
  7. Not very niche and have some community behind it to be able to ask questions.

My 'nice to have' requirements are:

  1. Language should be functional.
  2. It should have good string manipulation capabilities (not necessarily regex).
  3. Not extremely hard to learn.

I'm thinking about Haskell now, but keeping in mind OCaml as well.

Update: This application is intended to be a simple language parsing and manipulation utility.

Please advice, if my choice is correct.

like image 953
Narzanka Avatar asked Feb 11 '11 07:02

Narzanka


People also ask

Is Haskell Worth Learning 2022?

Yes, Haskell is worth learning in 2022 because functional languages like it are getting more popular among big companies like Facebook. Functional languages are typically ideal for big data and machine learning.

Should I use Haskell?

Today, Haskell is widely used in the software industry. Although it's not as popular as Python/Java/C++, Haskell has many benefits compared to them: Concise, high-level, practical and also very fast. An advanced system, which provides a lot of extra safety and flexibility.

What is Haskell not good for?

It's not as good and polished as rust's cargo but it's ahead several other languages. Still, as a language, Haskell is not ideal for teaching and productivity. There too many different ways of doing things (eg. strings, records); compiler errors need improvement, prelude has too many exceptions-throwing functions (eg.

What is Haskell best for?

Haskell is a purely functional programming language. It is general-purpose and statically typed. Programs in Haskell are always written as mathematical functions which have no side effects. It is mainly used in research and academia.


1 Answers

Haskell:

1: It runs on Linux, Windows and OS X, in many cases without changes to source code.

2: Native binaries generated. No VM.

3: Full Unicode support. All UTF variants supported.

4: Full threading support, plus if you only want parallelisation then you can use "par" with a 100% guarantee that it only affects the time taken rather than the semantics.

5: As fast as C, although some tweaking can be required, the skills required are currently rather obscure, and apparently minor tweaks can have multiple orders of magnitude impact.

6: Standard library included, and "Hackage" has lots more packages including a range of parser libraries.

7: Friendly community on IRC (#haskell) and here.

Edit: On the "nice to have" points:

1: Haskell is an uncompromisingly pure functional language.

2: It has generally good string manipulation, with regexes if you want them. As someone said in a later comment, beware the efficiency of the built-in "String" type (it represents a string as a linked list of characters), but the ByteString and Text libraries will solve that for you.

3: Is it hard to learn? Its nowhere near as complicated as C++, and probably a lot simpler than Java or even maybe Python. But its pure functional nature means that it is very different to imperative languages. The problem is not so much learning Haskell as unlearning imperative thought patterns.

like image 92
Paul Johnson Avatar answered Sep 29 '22 16:09

Paul Johnson