Check out Haskell, the way of thinking is way different than imperative programming (c, c++, java, etc.) but it's a lot of fun to learn and makes many types of operations (especially those involving arrays) way easier.
Originally posted by dockeen:
What is the top level, here's the dog, here's the tree
explanation of functional programming languages versus
what I'm used to...Pascal, Ada, C, Perl, Python etc.?
What are the strengths of functional languages, i.e. what
sort of problems are they well suited for, not so well
suited for?
Originally posted by Stephan T. Lavavej:
STRUCT = _STR_ange acronym for _U_ser-defined abtra_C_t data _T_ype
Why have more ways to make new types when you can have one?
No way. Functional programming languages are (in my experience - thus far Scheme and Lisp) allergic to bit-level twiddling. For example, writing a program that returns the SHA-1 cryptographically secure one-way hash of a file would probably be nasty or ugly (that's an inclusive or, by the way). In C, it's very natural and easy. And by bit-level twiddling, I do not mean unportable, assembly-like twiddling of registers, nor anything that is implementation-dependent.
Functional programming is all fine and dandy, and allows you to express some concepts cleanly. But I am still not convinced that it's all that and a bag of chips.
Originally posted by Stephan T. Lavavej:
Ah, union. I did forget it. In my defense, it is very rarely used. :->
Originally posted by Stephan T. Lavavej:
Actually, unions are seen very rarely in comparison to structs
Originally posted by Stephan T. Lavavej:
Actually, unions are seen very rarely in comparison to structs.
I believe the proper reference for this is _Expert C Programming: Deep C Secrets_ by Peter van der Linden (or perhaps _C Traps and Pitfalls_ by Andrew Koenig), but I don't have either with me right now. I could only bring one C programming book home with me, and it had to be a K&R2.
You can harp on my lack of knowledge wrt functional programming - in fact, I'm probably going to gut http://stl.caltech.edu/essay3.html in light of it
- but I know a fair amount about C, and more every day. ^_^
Originally posted by .mobius:
PS. Ooh. I just had a thought. I may have to go get the O'Caml stuff, and see if I can use it to do what I'm doing in Python right now. And I've heard there's a scheme shell for Linux. That could be a lot of fun.
But that's not to say it hasn't ever got stuck in an infinite loop and then fallen off the server. A crash is as good as a hang in my book.but nothing I've yet found will crash it
Originally posted by .mobius:
And I've heard there's a scheme shell for Linux. That could be a lot of fun.
Originally posted by PeterB:
But that's not to say it hasn't ever got stuck in an infinite loop and then fallen off the server. A crash is as good as a hang in my book.
Originally posted by jemfinch:
Quote: "Originally posted by .mobius:
PS. Ooh. I just had a thought. I may have to go get the O'Caml stuff, and see if I can use it to do what I'm doing in Python right now. And I've heard there's a scheme shell for Linux. That could be a lot of fun."
...
So what are you doing in Python that you'd consider doing in O'Caml?
(As far as scsh (scheme shell) goes, if I need a _real_ programming language for replacing some shell scripting, I'll use Python -- Scheme is really overkill for small shell scripting tasks, and Python's more readable syntax, more os-independent os binding, and larger user community for support ensures that the final result will almost invariably be superior when written in Python than when written in scsh.)
Jeremy
Originally posted by .mobius:
It's a fairly easy task, except I've never really done useful file I/O before, and I'm trying to find an elegant way to parse the config file. Right now, my best solution uses global variables and loops that the control has to break out of, which juist feels icky.
O'Caml sounds like fun, but I'll wait until I'm done with SICP, I think. I have enough to do as it is without picking up a third language; I have to get to know C++ for the AP exam come May.
Then again, I just got into college (w00t!), so I can afford to do a little more of what I want.
Originally posted by jemfinch:
Python has a standard ConfigParser module that might come in useful for that. I've never used it myself, but it might be useful.
Quote: "
O'Caml sounds like fun, but I'll wait until I'm done with SICP, I think. I have enough to do as it is without picking up a third language; I have to get to know C++ for the AP exam come May.
"
I thought they changed the AP exam to Java. I guess I was wrong![]()
Quote: "
Then again, I just got into college (w00t!), so I can afford to do a little more of what I want.
"
Congratulations! So where are you going?
Jeremy
Congratulations! The BBQ is better at Chicago, doncha know.Originally posted by .mobius:
Well, either Caltech or University of Chicago. I can't make up my mind. It's tough, honest!