Version française
Home     About     Download     Resources     Contact us    
Browse thread
What is a future of ocaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kuba Ober <ober.14@o...>
Subject: Re: [Caml-list] What is a future of ocaml?

On Jan 15, 2009, at 5:20 PM, Oliver Bandel wrote:

> Hi,
>
> Zitat von Benedikt Grundmann <benedikt.grundmann@googlemail.com>:
>
>> I would even go so far as to say that
>>
>> One of the advantages of OCaml's current development model is
>> that it is not changing the language very quickly.
>>
>> OCaml is already a big language (featurer/syntax and so on wise),
>> it should (IMHO) not grow a lot more at least not without giving
>> each change a lot of thought.
> [...]
>
>
> Yes, I agree fullheartedly!
>
> So many other languages evolve a lot, and there is enough
> busy-ness / daily business, that needs attention.
> Always changing the API or other properties of the language would
> be a factor of annoyance.
>
> Such permanent changes and "add-ons" is/are necessary, when there
> is a language that is quite weak, so that it is necessary to be  
> enhanced
> permanently.
>
> But OCaml is such a good language, that it can compete with it's
> language features without that kind of ADH-disorder, that many other
> environments offer.  Such ADHD is provided as an advantage, but it
> shows me, that there is not only room for enhancement... there also is
> a necessity for enhancement of such languages!
>
> And I don't say, OCaml is perfect or any way of making it better  
> should
> be deined. But it's strong with it's features.
>
> And with it's it-does-not-change-every-week it is a good base for
> long-term developments, IMHO.
>
> Many languages, which will be changed permanently,
> also incorporate functional features. I have heard that C++ now has
> lambda terms... but it lacks many other things...

OCaml-based Prolog can be as fast as SWI Prolog in principle since all  
SWI
Prolog does is compile to bytecode and run a bytecode virtual machine  
written in C.
What you were doing, most likely, is interpreting instead of  
compiling. I.e. you were
perhaps walking the parsed representation of predicates? Writing a  
Prolog
implementation in OCaml can be a bit less work than doing it in C,  
since your
VM can reuse OCaml's garbage collector, and of course it can use  
features
of a real high-level programming language. It should be entirely doable
to write a Prolog-to-OCaml cross-compiler. The result should be faster  
than
SWI Prolog, methinks.

Rant: C++ has had a pure functional metaprogramming language built in
for half a decade now (or is it longer?). This is something that  
unfortunately
even OCaml doesn't have. Of course LISP and Scheme's macro system blows
that out of the water, but there is a whole class of problems that are  
quite hard
to cleanly solve without compile-time execution of some sort. Of course,
metaprogramming is an art, that's why there are whole books about it
(Graham's "On Lisp" and Abrahams/Gurtovoy's "C++ Template  
Metaprogramming").
It's true, of course, that C++'s metaprogramming language feels like  
writing
for the Turing machine, but it's there, and it does find applications.
camlp4 has to be an external pass on the source code because there's no
way to get OCaml's compiler to execute code ;)

Cheers, Kuba