From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA12568 for caml-red; Sat, 10 Feb 2001 22:17:40 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA08012 for ; Fri, 9 Feb 2001 19:11:24 +0100 (MET) Received: from shell5.ba.best.com (shell5.ba.best.com [206.184.139.136]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f19IBNP19743 for ; Fri, 9 Feb 2001 19:11:23 +0100 (MET) Received: from localhost (bpr@localhost) by shell5.ba.best.com (8.9.3/8.9.2/best.sh) with ESMTP id KAA29233; Fri, 9 Feb 2001 10:11:00 -0800 (PST) Date: Fri, 9 Feb 2001 10:11:00 -0800 (PST) From: Brian Rogoff To: Jacques Garrigue cc: bpr@best.com, caml-list@inria.fr Subject: Re: OCaml's long range graphical direction? In-Reply-To: <20010209102801K.garrigue@kurims.kyoto-u.ac.jp> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis@pauillac.inria.fr On Fri, 9 Feb 2001, Jacques Garrigue wrote: > From: Brian Rogoff > > After all of the admonitions against the use of Obj.magic it's a bit > > disconcerting to count 41 Obj.magic usages in lablgtk. I recall > > hearing that that will change. What's the plan? > > Do not forget that any "external" declaration also amounts to an > Obj.magic, and there are 955 of them in lablgtk. OK, you're right, I deserved that :-) > Seriously, most Obj.magic in lablgtk amount to a cast of an external > after checking its validity, and I see no way to avoid that. Sure, but it seems to me that even if such things are implemented with Obj.magic under the hood we ought to come up with new names and eventually move "approved and safe usages" to the Sys module. I am probably under the influence of Modula-3 and Ada here... > What should disappear after ocaml 3.01 is release is the use of > external coerce ... = "%identity" > which is an equivalent of Obj.magic used to go around some limitations > of the type system. There are 24 of them, but they will not be needed > anymore thanks to variance annotations in types. Cool, but you also write in another message > The last problem is how to stay type safe when you load a text file. > Basically this means that you will be more verbose, and that will > compare badly with guile-gtk or python-gtk based applications. I think for this problem we need some dynamic typing in the language. It seems the Clean and Mercury languages have or will adopt such a solution; I don't know about Haskell. This is the same issue as with safe marshalling right, so we are told that there is some help on the way. > So, there might be something to do, but I'm not so much convinced it > will help with a language like ocaml. Then ocaml will have to become like something else. It won't be the first time. -- Brian