caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: bpr@best.com
Cc: caml-list@inria.fr
Subject: Re: OCaml's long range graphical direction?
Date: Sat, 10 Feb 2001 22:01:38 +0900	[thread overview]
Message-ID: <20010210220138R.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <Pine.BSF.4.21.0102090957480.18552-100000@shell5.ba.best.com>

Hi Brian,

From: Brian Rogoff <bpr@best.com>
> On Fri, 9 Feb 2001, Jacques Garrigue wrote:
> > 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...

I checked again the cases, and they really amount to changing types
according to the dynamic type of some C value.  Since C has no dynamic
typing, we cannot go very far...
But you're right, this number could be considerably reduced by making
specialized versions of Obj.magic specifying a bit more about the
input and output type.  I just avoided that, in case people would
start using this function as a safe one.

> > 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.  

Dynamic typing will still have a syntactic overhead. My point is that
a typed language should have its own better ways to do things easy
to do in scripting languages, and they can be different.

> > 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. 

I'm not sure of what you mean by that, but if you want to do things
like add downcast to ocaml, then this is a discussion we had several
years ago.  Even if dynamic typing is introduced, it will probably
have a more type dispatching flavor, forcing (or helping) the
programmer to write exhaustive code.

The credo of type safety can be hard to follow at times. But
abandoning it just to be like other languages will not make us
progress.  We already know that at least for pure ML programming
(including interfacing to many external libraries), one can find
strongly typed ways to work.  If using some external tool creates
problem with that, I personally will prefer rethinking the external
tool (or the way to use it), rather than forget that credo.

It may seem like fanatism for the type religion, but for me ocaml is
really that: a _typed_ language.

Jacques



  reply	other threads:[~2001-02-10 21:46 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-05 17:48 Daniel Ortmann
2001-02-06  9:28 ` Xavier Leroy
2001-02-06 18:19   ` Sven LUTHER
2001-02-07 21:30     ` Pierre Weis
2001-02-08  7:32       ` Sven
2001-02-08  1:59     ` Jacques Garrigue
2001-02-08  7:55       ` Sven
2001-02-09  8:47         ` Claudio Sacerdoti Coen
2001-02-09 10:00           ` Sven LUTHER
2001-02-08 20:35       ` Brian Rogoff
2001-02-09  1:28         ` Jacques Garrigue
2001-02-09 18:11           ` Brian Rogoff
2001-02-10 13:01             ` Jacques Garrigue [this message]
2001-02-09 20:01           ` Marcin 'Qrczak' Kowalczyk
2001-02-12 14:52             ` Nicolas barnier
2001-02-12 23:47               ` Jacques Garrigue
2001-02-15 12:21                 ` [Caml-list] " Sven LUTHER
2001-02-08 10:28     ` Alan Schmitt
2001-02-09  1:24       ` bcpierce
2001-02-06 20:30   ` Dale Arntson
2001-02-07  0:39   ` John Max Skaller
2001-02-08 20:01   ` Francois Rouaix
2001-02-09  9:41     ` Sven LUTHER
2001-02-09  9:49     ` Jacques Garrigue
2001-02-09 19:58       ` Jerome Vouillon
2001-02-10 12:36         ` Jacques Garrigue
2001-02-10 21:25         ` Pierre Weis
2001-02-09 17:50     ` John Max Skaller
2001-02-06 19:33 Maxence
2001-02-09 23:31 Arturo Borquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010210220138R.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=bpr@best.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).