News for hackers. Stuff that matters.
Re:Ask HN: Programming language power and 10 years to mastery by thomanil on Tuesday April 21, 2009 @04:56PM (#572986)
Check out the book 'The Little Schemer'. Good way to ease your mind into functional programming.

Also consider learning a dynamic 'scripting' language like Ruby or Python. They have some functional aspects, and will teach you programming style and idioms that you probably haven't picked up from Java and C.

Re:Ask HN: Programming language power and 10 years to mastery by thomanil on Tuesday April 21, 2009 @05:06PM (#573001)
Oh and if you plan on doing anything web-related, learn Javascript (properly!) - this will also expose you to functional programming technique.

http://javascript.crockford.com/little.html

Re:Ask HN: Programming language power and 10 years to mastery by warfangle on Tuesday April 21, 2009 @06:02PM (#573098)
Crockford's videos up over here: http://developer.yahoo.com/yui/theater/ are extremely useful, too. A little bit dry, but he knows his stuff.

It's interesting to point out that, while not optimized for it, Javascript (don't think ruby can do this, since you can't pass blocks to blocks) can perform tail recursion: http://warfangled.com/js_examples/fib.js

Re:Ask HN: Programming language power and 10 years to mastery by kqr2 on Tuesday April 21, 2009 @05:48PM (#573081)
Crockford's "Javascript: The Good Parts" is also a nice little read.

http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfor...

Re:Ask HN: Programming language power and 10 years to mastery by hs on Tuesday April 21, 2009 @05:36PM (#573053)
or just use jquery

it's the lispiest (or fp) framework i used (i used prototype before and it felt like java)

Re:Ask HN: Programming language power and 10 years to mastery by jacoblyles on Tuesday April 21, 2009 @07:13PM (#573194)
Is there a "Dive into Javascript" like there is a "Dive Into Python"?. The DIP style is by far my favorite way to learn a new language.
Re:Ask HN: Programming language power and 10 years to mastery by alanthonyc on Tuesday April 21, 2009 @05:03PM (#572997)
I concur.

The big advantage to picking up one of these Lisp-like languages (rather than Lisp itself) is that with their corresponding web-frameworks (Rails and Django), you will be able to put up some pretty cool apps pretty quickly. This helps your motivation as well as your bottom line personal ROI (they're both pretty marketable skillsets).

I don't think you lose all that much, as far as the experience of picking up a functional paradigm goes. (This last bit is not fully backed up by experience with Lisp on my part.)

Re:Ask HN: Programming language power and 10 years to mastery by javert on Tuesday April 21, 2009 @06:40PM (#573145)
I wouldn't call Rails and Python "Lisp-like languages."
Re:Ask HN: Programming language power and 10 years to mastery by silentbicycle on Tuesday April 21, 2009 @07:04PM (#573174)
Python's lead designer is actively hostile to this, actually. (And Rails isn't a language, goshdarnit...)

Lua is very Scheme-y, though, much the way Javascript is.

While I don't use Ruby much (Python and Lua fit that niche for me), it seems more Lisp-y than Python.

Re:Ask HN: Programming language power and 10 years to mastery by alanthonyc on Tuesday April 21, 2009 @07:36PM (#573219)
Yes, I did read his post about his basing Python more on C and Algol than functional languages.

But then he goes on to explain how and why Python got more functional programming features.

Also, I based my assumption that Python is "lisp-like" on a statement I remembered from one of PG's essays:

"Each one is progressively more like Lisp. Python copies even features that many Lisp hackers consider to be mistakes. You could translate simple Lisp programs into Python line for line."

If there is more context to all this that I am missing, then my mistake. Anyway, I wasn't looking to make any detailed comparisons between languages for the OP. I was just saying...hey, Python or something else could be fun to learn...

Re:Ask HN: Programming language power and 10 years to mastery by silentbicycle on Tuesday April 21, 2009 @08:00PM (#573251)
It's "Lisp-like" in the sense that it's garbage-collected and has an interpreter for incremental development, rather than only being batch-compiled. If PG were a Smalltalk fan, though, he would probably be talking about how every language is getting more Smalltalk-like (the above, plus class-based OO in the core language). It says at least as much about him as it does language design.

Python's lambdas are quite a bit less powerful than any Lisp's, and it doesn't have any tail call optimization. It's like, you can kinda sorta do functional programming in C, you just need to recast function pointers and do manual memory allocation.

Python is carefully designed to encourage programming in a certain relatively straightforward style, and while you can force some FP techniques into it, it doesn't sit well with the rest of the language, and it's kind of unfair to anybody else who will have to deal with the code down the road.

While I don't have much experience working with web frameworks (not my thing at the moment), Python is a very good all-purpose language.

Re:Ask HN: Programming language power and 10 years to mastery by alanthonyc on Tuesday April 21, 2009 @08:25PM (#573277)
I gotcha.

Well, I picked up PG's book and was starting on the language, when I came up with a project I wanted to get up and running quickly. So, I figured Django would help me get something going (it was either that or Ruby/Rails).

What I failed to ask, I guess is...is there an equivalent web framework for Lisp? I guess I might have gone in that direction if I knew of one.

Re:Ask HN: Programming language power and 10 years to mastery by SwellJoe on Tuesday April 21, 2009 @08:07PM (#573258)
"Also consider learning a dynamic 'scripting' language like Ruby or Python"

He mentioned he knows Perl, which is arguably the lispiest of the lot (not in syntax, but in sheer number of lisp-inspired features). But perhaps he "knows" Perl in the way that one who knows how to whip up a one to twenty line script to do something simple but repetitive, and then throw it away.

Re:Ask HN: Programming language power and 10 years to mastery by simplegeek on Tuesday April 21, 2009 @07:39PM (#573224)
I've been meaning to read that book, one question, do you really need to know Scheme to be able to read this book? Please enlighten me. Thanks!
Re:Ask HN: Programming language power and 10 years to mastery by sharkbrainguy on Tuesday April 21, 2009 @07:47PM (#573233)
No, the little schemer will teach you scheme, or rather a subset of scheme.