

Code iOS Apps in OCaml - amirmc
http://psellos.com/ocaml/

======
ootachi
OCaml is a highly underappreciated language. The biggest problem is the
haphazard syntax, but if you can get over that, it's really a joy to use for
application programming. You get the strongly-typed, type-inferred, functional
aspects of Haskell, but without the drawbacks of laziness (for example, you
can safely do IO outside the IO monad, and space leaks are less common) and
with a simpler type system. There are no null pointers, and coupled with
exhaustiveness checks in pattern matching, you frequently find that "if it
compiles, it works". The compiler is a simple non-optimizing compiler, but
it's more mature than, for example, that of Go (especially in the GC), so it
beats Go in performance.

~~~
michaelochurch
OCaml's largest problems, IMO, are:

1\. Global interpreter-lock, and the effect that has on the ability to write
multi-threaded programs.

2\. False negative proof, the same issue Haskell has. The fact that it's "had
its chance" to catch on and hasn't done so marks it as a failure (or "not
production ready") in the eyes of people who make decisions.

Scala has better odds than Ocaml and Haskell for this reason alone.

3\. The perception that there's a lack of libraries relative to, say, the JVM.
I say "perception" because Ocaml has bindings to leverage the C libraries.
However, it doesn't have the Java libraries, and those are proving to be an
important asset even in un-Javay languages like Clojure.

On Scala, since I'm resigned to the fact that it is more likely to win (and
find I like the language a lot) the unresolved question in my mind is: _is
Scala an acceptable ML?_ I like Scala a lot and I'm leaning toward "Yes", but
I haven't worked with Scala on something big enough to have a fully formed
opinion there.

4\. (Small one.) The name. I would like it just as much if it were called
FishGuts, but names matter in adoption. I think Ocaml's a fine name, but I'm
weird.

~~~
Dn_Ab
I do not think Scala is an ML. The use of the word acceptable and indeed
restricting it to an ML derivative loses the point of what Scala is supposed
to be. Scala is supposed to be something different: a successful melding of
OOP and functional. And it is the best at that I have seen. It succeeds on
this better than the next biggest contender: F#, which is the most acceptable
ML, IMO. F# is more typically functional, using the usual Hindley Milner
Inference and sharing a core with OCaml but with significant whitespace. So it
can be very succinct. Typically functional idioms like algebraic data types,
Piping, point free, currying and combinators is more natural to F# than
Scala's more OOP way. I prefer F# to Scala but that is merely a subjective
preference.

There are a number of things that Scala does naturally that are cumbersome in
other languages because of how it manages to meld a powerful combination of
orthogonal features. To use Scala as just another functional language is to
miss its power. Those who criticize OOP have not used a language that does it
right. Abstractly, in a simplified categoric setting, we can consider OOP
(objects as coalgebras) and FP (algebraic data types) as duals of each other.
A proper unification of the concepts gives something more powerful than
either. I think Scala comes the closest. Sure you can be 100% functional in
it, or replicate Java but to call it one or the other is to make the same
mistake as to say that light is both a wave and a particle and think you
understand what that means.

~~~
michaelochurch
Brilliant synopsis. Thanks!

------
ramses
OCaml would be my main and only language if it had real concurrency ... but
I'll definitely have to give this a try.

------
mwerty
Is there a Haskell equivalent?

