Posted: Mar 20, 2012 12:13 pm
by VazScep
Sigillum Militum wrote:F# is virtually the same as OCaml, which is my FP language of choice. (Haskell is just as impractical as all hell.)
Is F# or Ocaml your language of choice? Either's awesome. Do you manage to use either in your professional work?

Note that while OCaml's name implies object orientation, no one is forcing you to use the object system. The standard library, as far as I know, doesn't use it, and neither do a lot of major third party libraries, like ocamlgraph and Batteries. You can "subclass" certain modules with functors though.
I'm not really sure what you're thinking of here.

There will be some overlap, because in languages like C# and Java, the class system is used for multiple purposes. It is used for single-dynamic-dispatch (a form of subtyping), which is something that Ocaml's modules cannot do. But it is also used for modular programming, which is something that Ocaml's modules can do, and can often do better.

For instance, suppose you want to abstract over a function which creates an object of abstract type t. In Ocaml/Standard ML, this is a completely natural thing to do, and is handled by having a signature declaring an abstract type "t" and a function "create_t" of a type with form ".. -> .. -> .. -> t".

In Java, I would need to abstract over constructors, which I can't do. So I end up with a more convoluted design involving two interfaces, one for the returned type and one for the constructing function (typically called an "abstract factory"). Yuck.

VazScep wrote:If it makes sense to say, I find Common Lisp far too powerful.
In that the de facto standard runs over 1,000 pages, I guess CL is powerful in the sense that it has a lot of features but I never did understand people who think they're Jedi knights because they use it. CL is a bloated, ugly, design-by-committee language.
It's too powerful in that I think it's too hackable. I suspect that is what leads to any Jedi Knight phenomenon, and the failure to realise that just because it's possible to hack some weird shit into CL, it doesn't mean it's a good idea.

In the end, most of the things that got me interested in CL were things that were done just as well if not better in statically typed functional languages. The only thing that left it unique were macros, whose utility I grossly overestimated.