Topic:   Haskell   (Read 20255 times)


0 Members and 1 Guest are viewing this topic.

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Haskell
« on: July 29, 2009, 01:17:08 PM »
Hey guys, seems like I'm moving up again.
Haskell-
Quote
Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy, purely functional language, quite different from most other programming languages. The language is named for Haskell Brooks Curry, whose work in mathematical logic serves as a foundation for functional languages. Haskell is based on the lambda calculus, hence the lambda we use as a logo.
On the language speed shootout, it scored the second highest speed. Right below C.
I was pointed to go into this language from a professional programmer working for the Shell company and many other companies. He said that this will give me a high enough step into C.
I'm unsure what may happen to Tf and any other projects I have, though I may be able to port it in the future.


-Gandolf

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Haskell
« Reply #1 on: July 29, 2009, 04:41:38 PM »
*facepalm*

You learned Java in what, a week? C and C++ are not that hard. If you really want to learn C, then stop mucking around and do it.
« Last Edit: July 29, 2009, 04:41:59 PM by WarHampster »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Haskell
« Reply #2 on: July 29, 2009, 06:48:34 PM »
I've been working in Java for 5 months now... I'm ready to move on, though C is still above me. The memory management of C/C++/Obj-C is quite complex, Haskell is the bridge I need to get across to it.


-Gandolf

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Haskell
« Reply #3 on: July 29, 2009, 07:37:21 PM »
If you want to learn about memory management then I wouldn't use Haskell... isn't the language designed to abstract you from low-level stuff?

EDIT - Also, if you don't to manually deallocate memory from stuff you're not using, you can always use a garbage collector.
« Last Edit: July 29, 2009, 07:43:46 PM by WarHampster »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Haskell
« Reply #4 on: July 29, 2009, 07:56:28 PM »
How well do you know Haskell, or even C?
A professional programmer told me that Haskell would be the best route to get good enough for C.


-Gandolf

WarHampster


  • GMG Extraordinaire

  • ***


  • Posts: 1501

  • The People's Moderator
    • Arcade of the Absurd
Re: Haskell
« Reply #5 on: July 29, 2009, 08:02:20 PM »
I've used C for GBA stuff, and took a class on C++ (but have never really used it for anything big), never heard of Haskell until today :P

I'm just saying that after reading up on Haskell, it doesn't look like the best language for getting familiar with memory management.

EDIT - taken from the Haskell site:

Quote
3.9 Built-in memory management
Very many sophisticated programs need to allocate dynamic memory from a heap. In C this is done with a call to malloc, followed by code to initialize the store just allocated. The programmer is responsible for returning the store to the free pool when it isn't needed any more, a notorious source of "dangling-pointer" errors. To make matters worse, malloc is fairly expensive performance-wise, so programmers often malloc a single large chunk of store, and then allocate "by hand" out of this.

Every functional language relieves the programmer of this storage management burden. Store is allocated and initialized implicitly, and recovered automatically by the garbage collector. The technology of storage allocation and garbage collection is now well developed, and the performance costs are rather slight.

4 When C is better
It isn't all roses, of course. The C quicksort uses an extremely ingenious technique, invented by Hoare, whereby it sorts the array in place; that is, without using any extra storage. As a result, it runs quickly, and in a small amount of memory. In contrast, the Haskell program allocates quite a lot of extra memory behind the scenes, and runs rather slower than the C program.

In effect, the C quicksort does some very ingenious storage management, trading this algorithmic complexity for a reduction in run-time storage management costs.

In applications where performance is required at any cost, or when the goal is detailed tuning of a low-level algorithm, an imperative language like C would probably be a better choice than Haskell, exactly because it provides more intimate control over the exact way in which the computation is carried out.
« Last Edit: July 29, 2009, 08:05:37 PM by WarHampster »

Gan


  • Administrator

  • ^ This guy is amazing.

  • *****


  • Posts: 4411
Re: Haskell
« Reply #6 on: July 29, 2009, 08:35:22 PM »
I'm unsure, though I hardly know much about Haskell. I guess I'll just have to go through it and see what happens.

By the way, compiled my first Haskell application:
http://screencast.com/t/iXOlgWTPYJ

:) Can't take all the credit, I only followed a tutorial and compiled some glued together code. ;) At most, I probably can guess the proper use and function of around 25% of the code.
Now all I need to do is find an IDE and a few more tuts... this is so exciting. :D


-Gandolf
« Last Edit: July 29, 2009, 08:35:34 PM by Gandolf »

GMG Hendo


  • GMG-er

  • **


  • Posts: 155

  • [WITTY TEXT GOES HERE]
Re: Haskell
« Reply #7 on: August 04, 2009, 07:44:27 PM »
Dude, Garbage Collection basically handles all memory management for you in Obj-C (although its still good practice to try and deallocate things). Trust me man, you don't need Haskell to learn C. I moved from Applescript to Obj-C and im not finding it that hard. Your just wasting your time.