From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: Hash clash in polymorphic variants
Date: Wed, 16 Jan 2008 04:40:09 +0000 [thread overview]
Message-ID: <200801160440.09295.jon@ffconsultancy.com> (raw)
In-Reply-To: <20080116.122627.-10635426.garrigue@math.nagoya-u.ac.jp>
On Wednesday 16 January 2008 03:26:27 Jacques GARRIGUE wrote:
> > I suspect OCaml's marshalling is used almost entirely between same
> > versions of the same programs.
>
> I'm not so sure. Actually, I do it all the time when recompiling
> ocaml. Otherwise I would have to bootstrap after any modification in
> the compiler. Fortunately, this is not the case, and one only needs to
> bootstrap when the data structures are modified (or semantics changed).
Interesting.
> > Yes. This would probably also work ok if you used a symbol table to store
> > exact identifier names rather than just a hash. The symbol's index in the
> > table would serve the same purpose as the hash.
>
> No, because in order to produce efficient code you have to know the
> hash at compile time, and in your scheme you only know it at link time
> or runtime.
You could still use the same hashing scheme but you could fall back to linear
search of symbols by name in the event of a clash.
> > Exactly, that is a limitation of LablGL's design and, therefore, I think
> > it is was quite wrong of you to claim "LablGL shows is that in practice
> > only a small number of tags are used together" when LablGL's use of
> > small, closed sum types is actually a design limitation that would not be
> > there if it supported all of OpenGL, i.e. the extension mechanism.
>
> I don't see your point. Even with the extension mechanism, extra
> GLenum's are still only allowed for some specific functions. So you
> can still define some subsets of GLenum that should be conflict free,
> you don't need to prohibit all conflicts in GLenum. This is what I
> mean by lablGL's design.
Provided you can enumerate which tags can be used with which functions
including the presence of extensions, yes. I suppose that would be possible
and you could end up with many small sets of tags and much less chance of
clashing.
> The problem with lablGL and extensions is the implementation, not the
> API design. What we would need was some kind of AOP approach to the
> stubs, where you could describe what functions are extended by which
> extensions.
I think it would be better to remove all complexity from the C stubs, have
them all autogenerated and then write a higher-level API on top entirely in
OCaml. GLCaml is the start of a good foundation for OpenGL, IMHO. I think it
would be very productive to merge the projects at some point.
> ...
> I don't agree with all these points (otherwise I wouldn't be
> maintaining a GUI toolkit), but there is some truth in it. I actually
> got similar reactions from industry in Japan, if for different
> reasons: they don't need the GUI, because they prefer to do it
> themselves, to differentiate from others. People doing in-house
> programming have a different point of view. I remember somebody from a
> bank who told me he wrote a program to be used in all their branches
> using labltk. In this case you don't need anything flashy, it just has
> to be functional (err, to work).
>
> Concerning IDEs, since eclipse is more and more used, good support
> for it seems a must. But you won't have me use anything other than
> emacs and ocamlbrowser!
Visual Studio's Intellisense makes GUI programming much easier in F# than
ocamlbrowser+ocaml. I think the single most productive thing that could be
added to ocamlbrowser is hyperlinks from the quoted definitions to all
related definitions.
Now that I come to think of it, you can just run ocamldoc on the LablGTK
sources and use a browser to do that. Is the ocamldoc HTML output for the
latest LablGTK2 on the web anywhere?
> > Yes. A better FFI could also be enormously beneficial. Improving
> > upon OCaml's FFI is one of the most alluring aspects of a
> > reimplementation on LLVM, IMHO.
>
> The current FFI works well, but it's true that the way it cuts the
> work in small pieces (stubs in C on one side, externals on the other)
> makes it difficult to automate its use. In my experience it is very
> flexible, but badly lacks abstraction.
What sorts of abstractions would you like?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
next prev parent reply other threads:[~2008-01-16 4:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-10 17:09 Jon Harrop
2008-01-10 20:35 ` [Caml-list] " Eric Cooper
2008-01-10 21:24 ` Jon Harrop
2008-01-10 21:40 ` David Allsopp
2008-01-11 13:30 ` Kuba Ober
2008-01-11 13:48 ` Jon Harrop
2008-01-11 16:14 ` Kuba Ober
2008-01-11 18:40 ` David Allsopp
2008-01-14 12:20 ` Kuba Ober
2008-01-14 14:44 ` Stefan Monnier
2008-01-14 14:56 ` [Caml-list] " Kuba Ober
2008-01-14 15:37 ` David Allsopp
2008-01-14 15:44 ` Kuba Ober
2008-01-14 16:03 ` David Allsopp
2008-01-14 15:45 ` Stefan Monnier
2008-01-15 3:36 ` [Caml-list] " Jacques Garrigue
2008-01-15 4:59 ` Jon Harrop
2008-01-15 9:01 ` Jacques Garrigue
2008-01-15 18:17 ` Jon Harrop
2008-01-15 19:20 ` Gerd Stolpmann
2008-01-15 22:04 ` Jon Harrop
2008-01-16 13:48 ` Kuba Ober
2008-01-16 15:02 ` Dario Teixeira
2008-01-16 19:00 ` Jon Harrop
2008-01-17 13:09 ` Kuba Ober
2008-01-18 5:33 ` Kuba Ober
2008-01-18 5:19 ` Kuba Ober
2008-01-18 5:39 ` Kuba Ober
2008-01-16 3:26 ` Jacques GARRIGUE
2008-01-16 3:34 ` Yaron Minsky
2008-01-16 3:42 ` Jon Harrop
2008-01-16 4:40 ` Jon Harrop [this message]
2008-01-16 16:03 ` Eric Cooper
2008-01-16 10:50 ` Richard Jones
2008-01-14 17:14 ` Jon Harrop
2008-01-14 17:36 ` Alain Frisch
2008-01-11 0:15 ` [Caml-list] " Jacques Garrigue
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=200801160440.09295.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.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).