Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 946 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
anyone have experience with haskell? #187110
03/05/08 11:57
03/05/08 11:57
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
gday gday.

uni starts next week, and apparently we'll be taught haskell. the change to a functional language looks like a big step. i'm not having any particular trouble getting a headstart with tutorials or anything, but i'd like to hear what more experienced users have to say about haskell.

what's it good for?

does it have a place in the games industry?

anything else interesting regarding haskell...

most people seem to seek experience in imperative languages, so i'd also like to know why one might think to teach haskell first in a programming course?

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: anyone have experience with haskell? [Re: JibbSmart] #187111
03/05/08 13:41
03/05/08 13:41
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Hi Julz,

I'm currently taking a functional programming class in uni (5 weeks now), and haskell is the main language we use. It is indeed a big step from imperative programming, but I must say I absolutely love haskell. Our first assignment was to write a functional query language (think SQL). I wrote a table print function, select, project, join function (and some helper functions) in about 100 lines of code. Amazing isn't it? If you write a function and it gets past the compiler, 99% of the time it will just work the first time.

The expressiveness is great, but it means there is much more information on a single line of code. So if you read code at the speed you read C-Script, you won't understand it. That's one thing you have to get used to, but more important is the lack of state. There are no assignments, no side effects in normal haskell functions. This takes some getting used to. You can't have a loop counter.

Adoption of functional programming in the software industry has been slow, but I think this is mainly due to a lack of functional programmers. FP certainly has some real world advantages >for some applications<. For example, because of the lack of state, you simply can't make some bugs. You can't possibly follow a null pointer or something like that. Another important advantage that will become more important in the future is concurent programming. Haskell has some very simple, non-intrusive "hints" that allow the compiler to automatically paralellise your application. This is much harder in impertative langauges, because it is much harder to mathematically prove things about a program written in an imperative language, than a program written in a functional language.

So far, FP has mostly been used for academic applications. But you can use OpenGL, and I think there have been entire FPSs made with haskell.

To conclude, don't expect your programming knowledge of imperative languages to help you, and functional programming can be a lot of fun. Try to program in an imperative way and your in for a painfull ride..

Oh by the way, I think starting out with a functional language doesn't make much sense for a CS education. Are you studying mathematics or something like that?

Re: anyone have experience with haskell? [Re: JibbSmart] #187112
03/05/08 22:45
03/05/08 22:45
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
I would not be concerned about getting a headstart- it will all be explained in class. My university uses its own functional language Opal:
http://uebb.cs.tu-berlin.de/~opal/ocs/doc/html/index.html

The reasons were twofold:
a) give students a strong foundation in logical thinking
b) level the playing field so that long-time C/Java programmers don't have an advantage over other students

Sorry for being cynical, but I don't think functional languages have a reason for existence outside of academia & research. Particularly in computer games you want performance and control. Neither of which is provided by functional languages. The one thing I did like about Opal was its support for lambda functions- but that I can get with Boost on C++ as well.

Enjoy the course and the language, but don't expect to use much of it beyond the current semester.

Re: anyone have experience with haskell? [Re: Marco_Grubert] #187113
03/05/08 23:32
03/05/08 23:32
Joined: Jul 2000
Posts: 8,973
Bay Area
Doug Offline
Senior Expert
Doug  Offline
Senior Expert

Joined: Jul 2000
Posts: 8,973
Bay Area
Ditto to almost everything posted above.

Don't expect to use Haskell outside of school, but learning new programming languages, IMHO, is key to becoming a computer scientist and not just another code monkey.

When you're trying to program for 4th dimensional computer hardware in 2020, being able to think in multiple ways will come in handy.


Conitec's Free Resources:
User Magazine || Docs and Tutorials || WIKI
Re: anyone have experience with haskell? [Re: Doug] #187114
03/06/08 11:18
03/06/08 11:18
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
Quote:

Sorry for being cynical, but I don't think functional languages have a reason for existence outside of academia & research. Particularly in computer games you want performance and control. Neither of which is provided by functional languages.


that's what i was thinking from what i've read.

we had an orientation today where no direct reference to haskell was made, but they said we'd be starting with something that focuses on problem solving and as little code as possible. sounds like haskell to me.

thanks, Excessus, for the nice big post describing your experiences with haskell. i don't have much to comment about it, but took a lot out of it.

Quote:

I would not be concerned about getting a headstart- it will all be explained in class.


it's not so much about the headstart, but about knowing what i'm gonna be doing.

one question... i hear that prior knowledge of imperative languages is useless with functional programming (as Excessus touched on), but doesn't it work both ways? surely learning a functional language would be of little use to soon-to-be imperative programmer? or would the purpose be more to get students capable of producing programs sooner rather than later?

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: anyone have experience with haskell? [Re: JibbSmart] #187115
03/06/08 13:00
03/06/08 13:00
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I wouldn't say experience with imperative languages is useless for learning fp. Knowing the basic types (int, char, bool,...), the concepts of operators and precedence (ok maybe that's just math), understanding the difference between a function call and a function definition (something that absolute beginners often have problems with), and many other things that are so natural to you now, are still usefull in haskell.

I don't know (yet), if learning haskell will be usefull for programming in imperative languages for me. As others have sayd above, I think that learning to think in new ways is always usefull in the long run. And maybe it will prove usefull to apply some patterns found in fp in an imperative language. Like recursion, folds, etc. I'll see.

Re: anyone have experience with haskell? [Re: Excessus] #187116
03/06/08 22:55
03/06/08 22:55
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
okay that makes sense. so much of that i take for granted, but at orientation week i met a couple of people who had been doing computer science for a couple of years and asked me "are you one of those guys that start the course already knowing all these languages?" and thought it hilarious when i said i only know a couple, because most people go in not knowing anything.

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: anyone have experience with haskell? [Re: JibbSmart] #187117
03/07/08 01:26
03/07/08 01:26
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Quote:

okay that makes sense. so much of that i take for granted, but at orientation week i met a couple of people who had been doing computer science for a couple of years and asked me "are you one of those guys that start the course already knowing all these languages?" and thought it hilarious when i said i only know a couple, because most people go in not knowing anything.


That is unusual- when I was a TA most people taking CS classes already had some programming background. There were a few exceptions who didn't.

Re: anyone have experience with haskell? [Re: Marco_Grubert] #187118
03/07/08 02:53
03/07/08 02:53
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline OP
Expert
JibbSmart  Offline OP
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
that's interesting. a few of my mates are interested in programming (a small few), and they have dabbled in it but are by no means proficient at any language.

julz


Formerly known as JulzMighty.
I made KarBOOM!

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1