methodology
Not necessarily.
> And haskell has extensible records, they are just a library like anything else:
And OCaml has monads, they are just a library like else.
package main
import "fmt"
func main() {
go func() {
for ;; {}
}()
for ;; {
fmt.Println("still here")
}
}
Even bigger pointless programs also freeze: package main
import "fmt"
func f(v int) int {
return v+1
}
func g(x int) int {
if (x > 100) {
return 1
}
return 0
}
func main() {
go func() {
for ;; {
if g(f(111)) == 0 {
break
}
}
}()
for ;; {
fmt.Println("still here")
}
}
This is of course by design, because Go was designed only to support useful programs. The programmer trying to figure out how the concurrency model works may whine that it's inconsistent and he can't figure it out, but that's only granted because threading is hard. Go makes it easier by only supporting useful cases.Actually there are in certain cases [1], but there's a good reason for that.
1. http://stackoverflow.com/questions/25628920/slicing-operatio...
It was designed to compile fast, and compiles faster than most languages and still has near C-speed. It doesn't have a GIL so it has better concurrency (Java style memory model). It has no complicated features like generics, instead you just use type assertions when you need. It also has impeccable tooling.
When I learned Haskell, I just read Learn You A Hasekell in a few days, and immediately understood the practical value of Algebraic Data Types. They simply are like the types in C,Java,etc but more general because unions can have "fields". This alone means you can represent things like Maybe without any trouble, whereas in C/Java, you'd have to use casting, explicit tagged unions, or the visitor pattern. ML has largely the exact same features as Haskell, except you have to explicitly say which module you're using, instead of the typeclass system doing it for you. Do you also "get" ML? It sounds more like you are claiming to "get" some sort of theory, rather than Haskell or ML, which are trivial, but you make it sound like you need to be somehow enlightened to understand.
The only hard part I ever found in Haskell is lazy evaluation, which to me is just another type of magic which nobody gets, just like the Java Memory Model. The other hard part of Haskell are the extensions to type classes, which make you start thinking about open research problems.
edit: Which part of the above is downvoting material? Please explain so I can avoid being downvoted in the future.