OCaml features: a static type system, type inference, parametric polymorphism, tail recursion, pattern matching, first class lexical closures, functors (parametric modules), exception handling, and incremental generational automatic garbage collection.
Ocaml compiles and runs fast but has ugly syntax compared to Haskell.
That's the main reason why it fails.
Another is that it has a small community, and they're mostly French.
Name:
Anonymous2007-07-21 4:41 ID:56erBxHb
Ocaml is designed by people who wouldn't know "clean" or "consistent" if it raped them in a back alley.
In my case, what broke the camel's back was a global namespace for all records within a module. For those of you not familiar with the terminology, think of being unable to have the same name inside two different structs. Those of you who've ever done 3D (a.x, a.y, a.z!) will be screaming about now.
I can rant and rave all day about all the stupidities in Ocaml, but it's not going to be fixed. Look elsewhere unless you'd like a death by a thousand cuts.
>>9
You just used “incorrect” double quotation marks. Double quotation marks are indicated by ‘“’ and ‘”’, not by two grave accents ‘``’ and two apostrophes ‘''’. Please remember this.
Name:
Anonymous2007-07-21 9:18 ID:tfNdUpBi
>>11 not by two grave accents ‘``’ and two apostrophes ‘''’
They are in TeX.
>>16
I'm gradually realising there are a lot of people in here who have never seen that language.
Name:
Anonymous2007-07-21 21:16 ID:nWiyBvQ1
>>16
No, I was trolling, but what's with struct? It's most commonly seen in C, but how's that related to this thread? Or is it just your way to say "I've read K&R"?
Name:
Anonymous2007-07-21 22:03 ID:1WF9MypZ
>>18
dude, it has nothing to do with static vs. dynamic. use your head a little bit. If >>5 mentioned structs, which are in C, which is not a dynamic language, then how the fuck do you reached that conclusion?
Name:
Anonymous2007-07-21 22:28 ID:nWiyBvQ1
20GET
Name:
Anonymous2007-07-21 22:38 ID:dArJ/JzN
>>18,20
That's all you have to say? Defend your honour, if you have any.
Ocaml has really clean syntax for a statically typed language. It is very clear what is going on the type system helps in debugging. Anyone here is commenting on the superficial and they even get that wrong
let f x = x *. x
let sqr_list l = List.map f l
let sqr_list l = List.map (fun x -> x *. x) l
let rec sqr_list = function
[] -> []
| x::xs -> ( x *. x ) :: sqr_list xs
let sqr_list l =
let ol = ref [] in
List.iter (fun x ->
ol := x :: !ol
) l
List.rev ol
let sqr_list l =
let ol = ref [] in
let len = length l in
for i = 0 to (len - 1) do
ol := (List.nth l (len - 1 - i)) :: !ol
done
ol
;;
So whatever. It all works and you can do the same thing multiple ways in multiple paradigms.
Name:
Anonymous2007-07-22 20:39 ID:2/9FIl0v
Anyone here is commenting on the superficial and they even get that wrong
Until they fix that record issue, I'm not touching it again. That's beyond braindead.
Name:
Anonymous2007-07-22 22:02 ID:YckDbpi2
what is the record issue? The shared namespace? The mutable attributes?
Name:
Anonymous2007-07-22 22:29 ID:vhhuNwz6
"quotes``
Name:
Anonymous2007-07-22 22:30 ID:vhhuNwz6
''quotes``
Name:
Anonymous2007-07-22 22:36 ID:2/9FIl0v
>>32
Fields in different records in the same file cannot have the same name, yes.
>>40
Yes because you're so cool doing f x instead of f(x) (or (f x)), let's see if it's so cool when you need to do f g x. Is it f(g)(x) or f(g(x))? What about f g && h i * j k?
>>41
f g x = (f g x)
f (g x) = (f (g x))
but yeah, still stupid.
Name:
Anonymous2007-07-24 10:49 ID:vAmBXIRJ
>>41
Noone makes you write "f g && h i * j k", it's your fault for writing it. Lisp allows you not to indent your code, and programmers who don't indent their code are at fault, not lisp. Same with perl parenthesis. It's okay not to restrict users.
Name:
Anonymous2007-07-24 11:30 ID:aPHMTHrz
>>43
By allowing such a thing, you're making sauce fugly, and complicating the rules users need to know to read others' code.
Name:
Anonymous2007-07-24 11:50 ID:vAmBXIRJ
>>44
So you're ignoring my example about indentation, right?
Name:
Anonymous2007-07-24 14:26 ID:a/2RvH+O
>>30
Haskell syntax:
let f x = x *. x
>f x = x * x
sqr_list l = List.map f l
>sqrList = map f
let sqr_list l = List.map (fun x -> x *. x) l
>sqrList = map (\x -> x * x)
or
>sqrList = map (^2)
let rec sqr_list = function
[] -> []
| x::xs -> ( x *. x ) :: sqr_list xs
>sqrList [] = []
>sqrList (x:xs) = x*x : sqrList xs
Name:
Anonymous2007-07-24 14:40 ID:a/2RvH+O
>>45
No, by allowing such ambiguity, the programmer has to learn how the compiler resolves it when reading others code. This sucks.
The fact that there is a (bad) programmer to blame for it doesn't help the one who has to read his code. That's just an excuse not to fix it in the language.
Name:
Anonymous2007-07-24 14:48 ID:vAmBXIRJ
the programmer has to learn how the compiler resolves it when reading others code.
uh what? Well, yes, you obviously have to learn when learning new language. Are you expecting every language to be the same?
Name:
Anonymous2007-07-24 15:10 ID:iLuDVxNr
Wow you fags are still griping about syntax. How superfical. Why don't you all go out and reinvent the wheel again for the 40th time.
the programmer has to learn how the compiler resolves it when reading others code. uh what? Well, yes, you obviously have to learn when learning new language. Are you expecting every language to be the same?
If the grammar is ambiguous, you have to learn the precedence of the operator, not because you need to use this feature yourself but because others (like retards) might use it.
For some, like * and +, it's obvious, but for others it's a PITA.
Name:
Anonymous2007-07-24 20:26 ID:c8V6JOdd
>>51
LOL WHAT IS OPERATOR PRECEDENCE (* (+ 1 3 3 5) 2 4 5 (/ 22 4))
Name:
Anonymous2007-07-24 22:47 ID:ASk0swJh
>>49 Why don't you all go out and use Haskell. ML is on the fast track to being a dead language anyway.
fix'd
If you want to play with an ML, SML is a better language than Ocaml.
Name:
Anonymous2007-07-24 23:10 ID:4AWphtn5
>>41
It is pretty obvious after five minutes how the parentesis work: exactly as in lisp (except for the outer most parentesis) unless infix comes into play, in which case, infix has a greater precedence over non infix (resolution between infix operators is harder to rembember, but just use parentesis if in doubt). And that's pretty much it. In fact I have to admit, being a lisper, I'm more confortable writing some operations in infix. there is a difference between "not . even" and "(compose #'not '#even)", so much that people write a "negate" function.