Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] recomendations for a functional language
- Date: Wed, 4 Nov 2009 22:11:30 +0900
- From: Jianshi Huang <jianshi.huang@example.com>
- Subject: Re: [tlug] recomendations for a functional language
- References: <87hbtdtfch.fsf@example.com> <20091101131525.5f4312bd.attila@example.com> <a63167770911010442pd642beco3268ed5c4a41d02@example.com> <20091102082821.GA28406@example.com> <a63167770911020112q1bd12b27ub5209902a971a6c9@example.com> <20091102150646.GD16339@example.com> <20091103140253.7bf511a4.attila@example.com> <20091104060406.GE26028@example.com>
On Wed, Nov 4, 2009 at 3:04 PM, Curt Sampson <cjs@example.com> wrote: > On 2009-11-03 14:02 +0100 (Tue), Attila Kinali wrote: > >> Hmm.. didn't we had a discussion on STM just a few months ago? > > Yup. That, I believe, was before I'd learned about how STM works in C, > and so I didn't understand that the cool thing Haskell had was not STM > itself, but Haskell's type system that makes STM practical. > Could you elaborate why haskell's type system make STM practical? For me it's haskell's purify, since the efficiency of STM largely depends on whether you can successfully partition the data to avoid conflicts. > Common lisp has various looping constructs, and the standard doesn't > require tail call optimization (though many compilers do provide it), > so a program that uses tail recursion over large data structures > or whatever is not guaranteed not to blow up the stack on some CL > implementations. (Scheme requires tail call optimization.) So that was > why I reckoned that CL encouraged looping rather than recursion, and why > I'm a little doubtful about Stephen's correction on that. But he would > probably know better than me. > Tail calls are structured gotos, if you look it that way, you might feel loops are abstractions of tail recursions. But sometimes tail recursions are more handy, ex. a state machine. >> What would you say about first learning Scheme and then going Haskell? >> Scheme has the very persuasive property of being compact which >> promises that i get a quick start and do the tedious learning of >> concepts as i walk along a nice path. > > I'd say don't bother, unless you intend to do some serious research > into programming with macros. Haskell has marginally more syntax than > Scheme, but for learning the basics that Haskell and Scheme have in > common, the languages will be about equally easy to start with. Haskell > is quite as compact as Scheme, by the way, probably more so as you get > more sophisticated with it. Why not both? Macros is a reason good enough. And there's first class continuations. Actually Scheme is a very low-level language for understanding how to program, which could be as enlightening as Haskell. >> And, if i understood you correctly, Haskell seems to be a superset >> of concepts of Lispy and other functional languages? > > Right. Syntax differences aside, you can think of ML as being much like > a Lisp with a different syntax, no macros, and a Hindley-Milner type > system. Haskell adds purity, changes evaluation from strict to lazy, and > gives you libraries full of Monads. Wrong. Haskell is too far from Lisp. 1) Lisp is all about macrology. 2) Lisp is dynamic and all the reflexive. 3) Lisp is about incremental development. 4) Lisp is about hooking to the compiler and runtime. which I don't think any of the Haskell implementation focuses on currently. >> Can you elaborate that a little bit? >> I didn't know about H-M before and cannot immediatly see what >> makes it more powerfull than the dynamic typing i'm used from >> dynamic languages. > > With dynamic typing, if you make a mistake, you have a failure at > runtime. Static typing systems offer a computer-verified proof that > certain types of failures cannot happen at runtime (baring something > like hardware failure). That means you don't need to bother to test > certain parts of your code, since you've got a proof that they cannot > fail. It still can fail. ex. stack overflow is a common mistake. Holding but not releasing resources is another. And deadlocks. It depends on how much and which aspect of my program the type system can prove.Though I agree Haskell's type system eliminates a large proportion of errors. We programmers can take it if the errors we didn't understand or couldn't foresee, but for trivial errors, it's a shame. So it's more of a psychological boost. Static type system gives you a safe belt so you will feel you are protected, but never try driving over 180. Cheers, Jianshi
- Follow-Ups:
- Re: [tlug] recomendations for a functional language
- From: Jianshi Huang
- Re: [tlug] recomendations for a functional language
- From: Curt Sampson
- References:
- Re: [tlug] recomendations for a functional language
- From: Stephen J. Turnbull
- [tlug] recomendations for a functional language
- From: Attila Kinali
- Re: [tlug] recomendations for a functional language
- From: Alan Busby
- Re: [tlug] recomendations for a functional language
- From: Curt Sampson
- Re: [tlug] recomendations for a functional language
- From: Alan Busby
- Re: [tlug] recomendations for a functional language
- From: Curt Sampson
- Re: [tlug] recomendations for a functional language
- From: Attila Kinali
- Re: [tlug] recomendations for a functional language
- From: Curt Sampson
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Files copied to USB thumb drive completely gone
- Next by Date: Re: [tlug] recomendations for a functional language
- Previous by thread: Re: [tlug] recomendations for a functional language
- Next by thread: Re: [tlug] recomendations for a functional language
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links