Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Haskell vs D

Name: Anonymous 2012-03-06 14:06

which should i learn?

Name: Anonymous 2012-03-06 14:10

For what purpose? Purely recreational? They're fairly opposite in philosophy as far as languages go.

I prefer D.

Name: Anonymous 2012-03-06 14:13

>>1
>>2
You will never have a job.

Just kill yourself.

Name: Anonymous 2012-03-06 14:15

Both are statically typed shit.

Name: Anonymous 2012-03-06 14:32

>>3
NEET PRIDE WORLD WIDE

Name: Anonymous 2012-03-06 14:34

Both are typically shitted static.

Name: Anonymous 2012-03-06 14:38

>>3
Your quotes are inefficient. Kill yourself.

Name: Anonymous 2012-03-06 14:41

Learn the one that will make you employable.

OH WAIT

Name: Anonymous 2012-03-06 14:42

>>4
Why would you not like static typing? Oh wait, you're probably a PHP programmer.

Name: Anonymous 2012-03-06 15:09

>>9
PHP is static typing - it uses classes and all the Set Theory jewishness.

Name: Anonymous 2012-03-06 15:17

lisp

actually lisp is probably in between a c style lang and a haskell style one

Name: Anonymous 2012-03-06 15:32

>>11
The author of Land of Lisp recommends Haskell to people who want a language as theoretically well-intentioned as Scheme and as powerful as Common Lisp.

Name: Anonymous 2012-03-06 18:17

LISP

Name: Anonymous 2012-03-06 23:30

>>12
really?

Name: tiffany key necklace 2012-03-06 23:45

http://www.uktiffany-online.com                                            Tiffany Silver
http://www.uktiffany-online.com/tiffany-co-pendants/Paloma-Picasso-Loving-Heart-Pendant-uk.html                                            star pendant
http://www.uktiffany-online.com/tiffany-co-pendants.html                                            tiffany heart
http://www.uktiffany-online.com/tiffany-co-bracelets-bangles/1837-TCo-Bracelet-1-uk.html                                            octogonal drop earrings
http://www.uktiffany-online.com/tiffany-collections/tiffany-keys.html                                            tiffany key necklace

Name: Anonymous 2012-03-07 0:29

Trick question: both are shit!

Name: Anonymous 2012-03-07 0:39

>>11
Lisp was there before both C and Haskell. Lisp even pioneered the automatic paralleling:
http://en.wikipedia.org/wiki/MultiLisp

Name: Anonymous 2012-03-07 0:47

>>11
$a = 1
$a.killyourself()

Fatal error: Unknown function: killyourself()

Name: Anonymous 2012-03-07 0:52

>>14
If you chose [the wolf in sheep's clothing], you’re someone who wants it all: the power of ANSI CL and the mathematical beauty of Scheme. At this time, no Lisp dialect completely fits the bill, but that could change in the future. One language that might work for you (although it is sacrilege to make this claim in a Lisp book) is Haskell. It is not considered a Lisp dialect, but its followers obey paradigms popular among Lispers, such as keeping the syntax uniform, supporting native lists, and relying heavily on higher-order functions. More important, it has an extreme mathematical rigor (even more so than Scheme) that allows it to hide very powerful functionality under a squeaky clean surface. It’s essentially a wolf in sheep’s clothing. Like Lisp, Haskell is a language that any programmer would benefit from investigating further.

Name: Anonymous 2012-03-07 0:57

>>19
- Just like C++, Haskell is very hard to learn, and takes years to master. Things like Monads, Functors, Monoids, Higher-Order Types and a myriad of morphisms are hard to understand, especially without mathematical background. Most programmers probably don't have the ability or will to learn Haskell. Learning Haskell's syntax, libraries, functional programming techniques won't bring you closer to understanding: the true path to understand Haskell lies through Monoid-Functor-Applicative-Arrow-Monad. And even if you mange to learn Haskell, programming it still hogs a lot of brain resources, which could have been put to something more useful than just showing off about how clever you can be. "Haskell for Kids" even proposes exposing children to Haskell from yearly age, meaning Haskell, similar to mathematics and natural language, will be much harder to grasp at older age. "Zygohistomorphic prepromorphism: Zygo implements semi-mutual recursion like a zygomorphism. Para gives you access to your result à la paramorphism.", "Haskell is not 'a little different,' and will not 'take a little time.' It is very different and you cannot simply pick it up" -- HaskellWiki
- Poor backward compatibility: haskellers "don't want to replicate Java, which is outright flawed in order to avoid even the most unlikely of broken code", meaning they don't care if new version of GHC will break your code. Haskell projects are struggling under the weight of "DLL hell": typical Haskell package consist of just a few lines of code, thus many other projects depend on dozens of different packages, either directly or indirectly. It's near-impossible to embark on a serious Haskell project without spending time fighting dependency version issues.
- Haskell is slow and leaks memory. GHC's inefficient stop-the-world GC does not scale. A good understanding of evaluation order is very important for writing practical programs. People using Haskell often have no idea how evaluation affects the efficiency. It is no coincidence that Haskell programmers end up floundering around with space and time leaks that they do not understand. Functions take time to complete and debugging for time leaks is much more difficult than to debug for type errors. "The next Haskell will be strict." -- Simon Peyton-Jones
- Haskell's API lacks higher levels of abstraction, due to absence of variadic functions, optional arguments and keywords. Macros aren't possible either, due to overly complex syntax of Haskell. API documentation is very lacking: if you want to use regexes, you start at Text.Regex.Posix, seeing that =~ and =~~ are the high level API, and the hyperlinks for those functions go to Text.Regex.Posix.Wrap, where the main functions are not actually documented at all, so you look at the type signatures, trying to understand them and they are rather intimidating (class RegexOptions regex compOpt execOpt => RegexMaker regex compOpt execOpt source | regex -> compOpt execOpt, compOpt -> regex execOpt, execOpt -> regex compOpt where). They are using multi-parameter type classes and functional dependencies. The signature really wont give you any clue to how to actually use this API, which is a science in itself. Haskell is a language where memoization is a PhD-level topic.
- Haskell programming relies on mathematical modeling with type system (a version of mathematical Set Theory). If one does not use the type system for anything useful, it obviously will be nothing but a burden. Programs are limited by the expressiveness of the type system of the language - e.g. heterogeneous data structures aren't possible w/o reinventing explicit tagging. All that makes Haskell bad for prototyping or anything new, due to need of having design document with all types beforehand, which changes often during prototyping. Complex project are forced to reinvent dynamic typing. For instance, Grempa uses dynamic typing because the semantic action functions are put in an array indexing rule and production numbers (Ints) to functions, and they all have different types and so can not be put in an ordinary array expecting the same type for each element.
- The IDE options cannot be as good as those of dynamic programming languages, due to absence of run-time information and access to running program's state. Haskell's necrophilia forces you to work with "dead" code. Like other static languages, Haskell isn't well-known for its "reload on the fly" productivity. No eval or self-modifying code. Haskell code can't be changed without recompiling half of application and restarting the process. GHCI - is the best Haskell's interactivity can get, and still wont allow you to change types during runtime, while the single assignment semantics prevents redefinition of functions. As said Simon Peyton-Jones, "In the end, any program must manipulate state. A program that has no side effects whatsoever is a kind of black box. All you can tell is that the box gets hotter."
- Type system produced compile-time and link-time errors are distracting and make it harder to run and test your code, while type-checking isn't a substitute for testing, it is about correspondence to mathematical model, which has nothing to do with correctness - i.e. two numbers can be integers, but their quotient can still result into division by zero. Even though you may hear strong static-typing advocates say, "When your program type-checks, you'll often find that it just works", this is simply not true for large, intricate programs. Although type-checking may help you find model-related errors, it is not the same as testing.
- Absence of dynamic scope, implicit open recursion, late binding, and duck typing severely limits Haskell, since there are things that can't be done easily without these features: you can't implement dynamic scope in general (and be type-safe) without converting your entire program to use tagged values. So in this respect, Haskell is inferior to dynamic typing languages.
- Haskell makes it easy to write cryptic programs that no-one understands, not even yourself a few days later. Rich, baroque syntax, lazy evaluation and a tradition defining an operator for every function - all help obfuscation a lot. As a general rule, Haskell syntax is incredibly impenetrable: who in their right mind thought up the operators named .&., <|> and >>=?

Name: Anonymous 2012-03-07 1:17

>>20
This isn't nearly as good as the one where the dude goes nuts over a segfault in GHC 5.x. Could you find that one too? Thanks.

Name: Anonymous 2012-03-07 1:37

Name: Anonymous 2012-03-07 1:42

>>21
I got a segfault in SBCL by running:

(defun call/cc (f)
  (let ((r nil))
    (tagbody (setf r (funcall f (lambda (v)
                                  (setf r v)
                                  (go l))))
             l)
      r))

(call/cc #'call/cc)

Name: Anonymous 2012-03-07 1:47

>>23
Yes but Lisp is allowed to have segfaults. Haskell is not.

Name: Anonymous 2012-03-07 1:51

>>10
Nah, it's half-assed OOP as an afterthought, with the other half inconsistently procedural.

It's still shit.

Name: Anonymous 2012-03-07 2:02

>>24
Lisp is allowed to have segfaults.
Only in CFFI code, as a result of user's actions or invoked C/C++ code. Base forms, like tagbody, should behave gracefully.

Name: Anonymous 2012-03-08 6:01

>>1
Haskell is an interesting language used widely in academia featuring concepts that are appearing more and more in mainstream languages.

D is a useless sepples clone missing sepples' only redeeming qualities (popularity and compatibility with c).
It had already been antiquated before it was implemented. While slightly better than sepples in some ways it is but a sad joke compared to other modern languages like scala.

Name: Anonymous 2012-03-08 6:05

>>26
Depends on optimization settings used. If you get a segfault or memory access or some other weird error - just tweak optimization/debug settings (supported in standard CL) - CL can sometimes generate code that crashes instead of returning some custom error (of course, it should behave properly when dealing with documented conditions and when doing stuff as defined in the standard).

Name: Anonymous 2012-03-08 6:05

*CL implementations can sometimes

Name: Anonymous 2012-03-08 13:24

>>27
Look at it this way.

If C++ is CVS, then D is Subversion. It is trying to ``do X right'' but in reality there is no right way to do X, because X is the wrong thing to begin with.

Name: Anonymous 2012-03-08 14:25

>>20
10/10
Well done, good sir.

Name: D learner guy 2012-03-08 16:39

How would I actually learn D? The tutorials I found are shit. They explain syntax and stuff but not the standard library.

Name: Anonymous 2012-03-08 17:48

>>9

static typing is the opiate of the masses.

the problems with programs today are largely problems of misconception. implementation issues like type errors are easy to fix, and simply not that much of a problem in large systems. what really matters is the ability to adapt to changing requirements.

static typing is also anti-repl. when you input data into the haskell interpter, it has to decide what it means and it is not always correct.

static typing is also anti modular. in any modern language, i should be able to do "a" + "b" and get "ab". even javascript has that, but haskell, the advanced language,  does not.

i think haskell could learn a thing or two from lisp.

Name: Anonymous 2012-03-08 18:21

>>33
{-# LANGUAGE FlexibleInstances #-}

instance Num [Char] where
  (+) = (++)
  ...

Name: Anonymous 2012-03-08 18:23

>>33
I'm gonna call you DYNAMIC LOWERCASE TYPING GUY from now on.

Name: Anonymous 2012-03-08 18:36

>>33
the problems with programs today are largely problems of misconception. implementation issues like type errors are easy to fix, and simply not that much of a problem in large systems. what really matters is the ability to adapt to changing requirements.

You are still offloading to the machine relatively trivial matters such as checking that the code which was previously expecting a string now works with a tuple, etc. It's not as if there isn't any meaning to types.

static typing is also anti-repl. when you input data into the haskell interpter, it has to decide what it means and it is not always correct.

Yes, I'll have to give you that. The most egregious fault of ghci is its inability to define types at runtime. That's a disgrace. However, you can easily type-hint to solve the problem you cited.

static typing is also anti modular.
That's mostly a buzzword. Yes, it makes coupling apparent and a matter for the compiler, but it isn't as if it weren't there in the first place.

+ for concatenation and addition retardedness
I like my strings/lists and my numbers separate, thank you. It's the one thing that PHP got right. But yes, Haskell does have that kind of polymorphism in Typeclasses. If anything, Haskell already went overboard with genericity with its strings; by being lists it'll choke on decomposed Unicode characters... but at least Everyone's Doing It™.

Name: Anonymous 2012-03-08 21:04

>>33
static typing is also anti modular. in any modern language, i should be able to do "a" + "b" and get "ab". even javascript has that, but haskell, the advanced language,  does not.
2012
overloading addition function to include string concatenation
ISYGDDT

Name: Anonymous 2012-03-09 0:44

i think haskell could learn a thing or two from lisp.
CL-USER> (+ "a" "b")                                                           
; Evaluation aborted on #<TYPE-ERROR expected-type: NUMBER datum: "a">.


Yep, WHBT

Name: Anonymous 2012-03-09 5:07

>>36
>The most egregious fault of ghci is its inability to define types at runtime.
7.4.1 fixed it.

Name: Anonymous 2012-03-09 11:03

>>39
They changed a fundamental rule of the language in a minor version update?

That's the last straw. I am never using Haskell.

Name: Anonymous 2012-03-09 11:20

>>40
That's nothing. Ruby completely changed everything about strings between 1.8 and 1.9.

Name: Anonymous 2012-03-09 11:23

>>41
I never had any question about using Ruby.

I don't even like the name.

Name: Anonymous 2012-03-09 11:46

>>42
Absolut valid reason to not use anything.

Name: Anonymous 2012-03-09 17:13

>>43
Chick my abslut dubles

Name: Anonymous 2012-03-10 0:45

>>40
That's not a "fundamental rule of the language", it's a feature of the REPL. ghci has always just supported a subset of Haskell, and now it's a slightly larger subset. Also, since it's just ghci and not the compiler, it won't break any existing code or anything.

Don't change these.
Name: Email:
Entire Thread Thread List