Does anyone here have any experience with functional programming? I've been learning OCaml and Haskell recently, but there are things which are really painful to do with them (interactive programs).
Don't know if that ever works, some people say once you get used to that paradigm it's wondaful, but either way it'll be slow as hell, that's why I haven't bothered.
Name:
Anonymous2005-02-28 7:54
OCaml is wonderfully quick, if you're referring to execution speed.
Name:
Anonymous2005-02-28 21:01
Functional is good at algorithms, not IO.
Since OCaml can mesh so nicely with C, why not use two languages?
You're convincing me there. Anything that mixes well with C means it's unlimited - whatever you can't do or can't do properly/fast, you do in C. OCaml, I'll give it a try when I have some time.
Name:
Christy McJesus!DcbLlAZi7U2005-03-08 13:53
Lisp. Get Touretzky's book from his website. You'll never look back.
Name:
Anonymous2005-03-08 15:58
ocaml's syntax causes me nightmares =(
Name:
Anonymous2005-03-08 15:58
ocaml's syntax causes me nightmares =(
Name:
Christy McJesus!DcbLlAZi7U2005-03-09 14:46
Lisp doesn't have any syntax. You code in raw s-expressions. You can still have nightmares from it though if your tutor's idea of teaching you is to say "write a program that can play Go. yu0 have 4 weeks."
Bill Teahan needs more death.
Name:
Anonymous2007-06-21 13:10 ID:DT7e0vRB
>>4
that's why multiparadigm programming is so good. When you need to do IO, you write imperatively.
Somehow I get the idea that someone just bumped this thread to make the point that he hasn't read SICP.
Name:
Anonymous2007-06-21 16:27 ID:Z5xwF4bf
>>13
Is that relevant to this thread, or is that just your way of saying 'I've read SICP'?
Name:
Anonymous2007-06-21 19:08 ID:Jm79q95N
If you're wondering how interactive programs can be written in functional languages, you really should take a look at xmonad. It's a dwm-style tiling window manager in ~500 lines of Haskell. It had its first release after around a month of development, and at that point it already did things that dwm (written in C) didn't.
Name:
Anonymous2007-06-21 20:07 ID:Nf66BqSZ
>>13
When I first read your post, my thoughts were that you in fact not human, but a chimpanzee that had somehow managed to escape from the animal nuthouse. Upon closer inspection, I came to realize the horrible truth. You are without exception the most pitiful and woeful example of mankind that ever existed. You are the one who puts the 'Homo' in 'Homo sapien'. I am at a loss for words powerful enough to describe your pathetically sub-par intellect and nealithic communication skills, so instead you have forced me to rape and murder several small towns just to block out the extensive amounts of trauma caused by reading your post. I can only hope that this thread does not fall into the hands of more innocent victims, and one day, you will commit suicide in such an horrific manner that it cures some of the readers' trauma.
>>17
yeah i am >>16 and dont fuckin do that fuckass dissing me bullshit i9ts fuckin rude, uncalled for and all that and im disgusted with thelack of morals and discipline on this site i remember back in the good old days when you knew everyone and you could take a troll down the forums without having to worry about who is going to flame you and people that are just out to get a cheap fuckin laugh. You could really feel safe back then not like now where no matter what you do and how you act your feelings will be hurt and self esteem lost.
Please try to be nicer to me in the future as I will be reporting this incident to the proper authorites and the administration will be left to deal with the fallout of this dark day in 4chan history
Name:
Anonymous2007-06-22 6:41 ID:PuHWQoBh
there are things which are really painful to do with them (interactive programs).
In the spirit of replying to these ancient posts, here's my take:
interact :: (String -> String) -> IO ()
The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.
Name:
Anonymous2007-06-22 8:33 ID:8ZR9fYab
Chris Hanssen is still around in some *chans, I don't remember which one.