caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Christian Szegedy <szegedy@t-online.de>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Looking for collaborators on a hobby project
Date: 28 May 2004 08:09:04 +1000	[thread overview]
Message-ID: <1085695743.6826.154.camel@pelican.wigram> (raw)
In-Reply-To: <40B65986.2030603@t-online.de>

On Fri, 2004-05-28 at 07:11, Christian Szegedy wrote:
> Dear Skaller!
> 
> Is the Vyper project public?
> 
> I could not find any version of Vyper on the net. :(

It used to be on Sourceforge, but it's gone now
and I don't have a copy myself. What it did
was interpret the AST directly.

> You have written, that the analyis of the type information
> turned out be difficult. I can believe this. :)

For Python. Functions like 'eval' really make it
hard. Python has deprecated 'eval(str)' now: you're
supposed to use 'eval(str, dict)' so the dict
captures the dynamic variables instead of the current
scope. locals() hasn't work for ages due to compiled
function locals (special fast fetch bytecode).

But it is still very hard: Python class and objects are
also both dynamically extensible.

> Suppose, we have the following Ruby class:

I've never seen a Ruby program before. I have no idea
how dynamic it is..?

> After that, OCaml would take care of all the typing stuff...

Yes, but it won't help you optimise integer addition:
you'll have to do some special checks yourself,
and modify the generated Ocaml so it knows when
something is an integer.

> Of course using the myref class comes with a performance penalty also.
> This can be eliminated if one does not allow nil at all: that is all
> instance variables must have valid default value.
> I think, this is a good idea anyway...

Alternatively you can try to do flow analysis to see
which variables can't be nil, ever, and change their
type from 'a myref to 'a. Ocaml will propagate the typing
and your result will be optimised .. but you will need to change
all uses to match .. meaning you'll have to do type analysis
yourself .. Ocaml will check your analysis, but it won't
do it for you.

In Felix I do this kind of thing, and the generated C++
is again type checked by  g++, so only casting errors
tend to escape early detection. Its very nice to check
your static type checking with someone else's static
type checker :)

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2004-05-27 22:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27 21:11 Christian Szegedy
2004-05-27 22:09 ` skaller [this message]
2004-05-27 23:00   ` Christian Szegedy
  -- strict thread matches above, loose matches on Subject: below --
2004-05-26 20:21 Christian Szegedy
2004-05-26 21:36 ` Brandon J. Van Every
2004-05-26 21:37   ` Richard Jones
2004-05-28  9:17 ` Richard Zidlicky

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=1085695743.6826.154.camel@pelican.wigram \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@inria.fr \
    --cc=szegedy@t-online.de \
    /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).