From: Christian Szegedy Date: 2002-09-29T22:31:44+09:00 Subject: OT: Ocaml (was: R) Friedrich Dominicus wrote: >\ > No it is not, and it's even easy to find examples where it's faster > than C. > OK, show me an example, I would be interested. >>3) The OO support is quite artificial and (at least aesthetically) >> does not fit into the core language. > > Why? 1) First of all : there exist practically no object oriented built libraries for the language. If you use the functional ones, so if you develop object oriented stuff you must switch between the two paradigms, what I don't like. 2) The definition of properties (attributes) more cumbersome than in Ruby or Delphi) 3) Too many method/mutable keywords in the class definition. This is too verbose for me. I hate using the # symbol as a delimiter. Clearly these are the most unimportant ones, and a matter of taste. 4) All methods are virtual (in the C++ sense: i.e. dispatched dynamically. This seems to be unimportant, but I use ocaml to write fast code (if I don't need speed, I use Ruby). In fact I experienced 8x slowdown while using the objective features (after several different reimplementation and optimization of the same stuff.) (In fact the classes were rather small, but this clearly indicated the serious overhead associated with using classes.) 5) Side effects are the very nature of OO languages, but they don't really fit into the functional philosophy. This made me use the old traditional system, which is really great but of course much more error prone to write every time: Hashtbl.add t x t.add x I think Ocaml has a lot of room for improvement: it is quite nice as a functional language but clearly suboptimal as an object oriented one. I think overloadable methods would be much more important for ocaml, than some OO-looking stuff attached on it. It would simply solve all my problems: I would be completely content if I could write "add t x" instead of "Hashtbl.add t x" or "t#add x". Regards, Christian