Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OCaml

Name: Anonymous 2011-01-21 19:04

Dear /prog/,

Why do only so few people actually use the OCaml Programming language? I've just recently started learning OCaml (in a serious way; I've tried to learn it before, but stopped whenever I've reached the part about classes), and it's actually much much easier to go with than Haskell:


class myClass =
    object(self)
        initializer self#init

        val mutable m_name: string = ""

        method init =
            Printf.printf "init() called\n";

        method setName n =
            m_name <- n;

        method getName =
            m_name;
    end;;


let () =
    let instance = new myClass in
        instance#setName "john";
        Printf.printf "name = %s\n" (instance#getName)
    ;;


Things I've found a little odd are, that classmembers are accessed via '#', and not with a dot... but that's alright. Alltogether, I'd say OCaml is the better Haskell.

Name: Anonymous 2011-01-21 19:08

OCaml is a dialect of ML. It adds logic programming and object oriented programming to ML, neither of which I think ML needs.

Name: Anonymous 2011-01-21 19:32

I use it from time to time, but I can't say I'm fond of it.

Name: Anonymous 2011-01-21 20:26

It's very rigid about types, a little too rigid for my taste. I can forgive it for that, though, and I intend to use F# for a project I'm working on.

I feel the same way about Haskell. The things I like about Haskell mostly come from the ML-influence, making ML dialects (though I'd say OCaml is a little more than a dialect, for good or bad) preferable to me.

I think every language supporting lambdas and the like should have the option of using a long form for delimiting code blocks. I can't stand the sight of nested mixed curlies and parens, I've even changed my font to address that situation.

Name: Anonymous 2011-02-18 19:57


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List