I've seen great web tutorials for Haskell, but is there any better entry-level language that teaches me to no longer think like a computer?
Lisp.
If you have little experience in functional programming, I'd start out with Racket, which comes with an IDE (used to be called PLT-Scheme).
Use the SICP book/lectures to actually learn how to think and write code like a lisp programmer.
I'm not sure what you mean when you say that Haskell teaches you to think like a computer. Could you provide an example? The thing that you are trying to avoid might be unavoidable in any practical sense.
hxxp://en.wikipedia.org/wiki/Curry_(programming_language)
Curry is also a good idea especially because it includes logic programming as well as functional programming.
Racket
I learned on Python
I would follow >>3's advice. Learn actual programming from a book instead of just learning a language. And SICP is a good book. Also recommending Intro. to Algorithms by Manber.
Erlang it's simple and cute.
Read SICP ( http://mitpress.mit.edu/sicp/full-text/book/book.html ) with Racket ( http://racket-lang.org/ ) or Haskell ( http://hackage.haskell.org/platform/ ) with Learn you a Haskell ( http://learnyouahaskell.com/chapters )
>>10
this
>>4
I suspect "thinking like a computer" would mean thinking in concepts of having to do stuff in a predefined algorithm sequence, which functional programming (according to my very limited knowledge of the field) appears to avoid.
No. Functional programming also works in a "predefined algorithm sequence" (that's the whole point of programming, innit).
What it does, it tries to get rid of this idea, which is brittle (i.e. difficult to get right):
You have a state (a bunch of variables with their values at some time t) that you manipulate with procedures so that at time t+1, the values of those variables has changed and the set of variables has changed.
Instead the approach is:
You have functions (machines that transform input values into output values, where the input values and output values can themselves be functions) that you apply on values to get a result (and any state is temporary and just an artifice of expressing how your function works).
I think "a computer" >>1 means is so-called Von Neumann-type computer.
Procedural programming needs global states, variables and substitutions like current computer architectures.
Functional programming also has values but they never change once they have been defined, and yet it works because of λ-calculus like >>13 said.
I recommend Haskell for Functional programming novices too.
Haskell is a bit idealistic language, but people can learn a lot for it.
Ruby. The Best of All EVER.
Simple. Beauty. Force.
Just Works.
require 'sinatra'
get '/' do
"Hello World!"
end
Web-server with hello-world-main-page. 4 lines. :)
p Array.new(gets.to_i){gets.to_i}.sort
Input (any size), sorting and output array. 38 symbols.
Functional programming in the box with OO together.
Sorry for bad English. :) I'm from Russia, and I speak in Ruby.
>>15
I can do that with Node.js, or any other framework out there. That is still stupid. If you don't understand why "my_whole_web_site_just_work();" is lame, please stop programming.
I know, I've been trolled once again :(
Such baseless novelties, try Nimrod, son.
State is easily reintroduced into functional programming with f-coalgebras. Then you model your computation as a function working on a state space S and several outcomes (bottom = no terminating or undefined), just the next state or an exception and the next state. This model also apply on java. From this model, functional languages are rather explicit with their state passing.
S[sub]t[/sub] -> bottom + S[sub]t+1[/sub] + S[sub]t+1[/sub] x E
Learn brainfuck, trust me. Its a great language and will teach you the fundamentals of a language like Assembly, but in a more complicated way, which is definitely better.
>>13
You have a memory (a bunch of memory locations with their values at some time t) that you manipulate with functions so that at time t+1, the values of those memory locations has changed and the set of stack memory locations has changed.
Instead the approach is:
You have procedures (machines that transform input values into output values, where the input values and output values can themselves be procedures) that you apply on values to get a result (and any memory is temporary and just an artifice of expressing how your procedure works).
Also you have unsafe IO procedures to call some devil functions because von neumann or something. It's not like someone forgot computer functions were jumps in the instruction pointer and not actual mathematical functions..
I would say Ruby. The Russian guy is kind of dumb though. Ruby has what you want plus there is a great community and Ruby Gems are pretty great as well.