Oops, I just reread your post... Support Generators LIKE python  :-D
Ok, now I'm feeling like an idiot.  By generator, I figured you meant
output to whatever system...

Oh well, I'll leave Nicolas to answer this one and keep quiet.

Lee



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: 13 March 2006 12:47
To: [email protected]
Subject: [Neko] Fwd: Some questions about generators,unicode and
benchmarking

Hi to you all,

Neko looks like a very promissing project for dynamic languages.
I'm impressed with the speed at which it is being developped, the size
of
the vm and the (unoptimized) speed of execution.

I just stumbled upon www.nekovm.org and a couple of questions came up.

* Does neko (or nekoml) support generators like python
(http://www.python.org),
Boo (http://boo.codehaus.org) or .NET 2.0? I looked through the neko
documentation and found it fairly complete in functionality but I missed
the
generator functionality, which I find a very usefull addition to
programming. It
is a construction that makes lazy loading very easy and it mostly used
in
iterator pattern ("for a in b"). A generator type would be nice.

For example a generator in Boo:

def myGenerator(x):
    x += 1
    yield x  //return x, but next call will continue here
    x += 10
    yield x

for a in MyGenerator(3):
    print a

would print "4" and "14"

In Neko it could be something like.
var gen = generator(x){
  x += 1;
  yield x;
  x += 10;
  yield x;
}

while(gen.next()){ //or $next(gen)
  a = gen.value;   //or $value(gen)
  $print(a);
}

* Unicode: most current programming languages use a unicode string
representation. I'm not sure about this, but Neko seems to have a single
byte
string representation, but with support for UTF8. Is it wise to stick to
the
(old fashioned?) single byte representation?

* Benchmarking. Since it is/will be an issue for the adoptation of neko,
it is
nice to implement some of the benchmarks of the computer language
shootout
(http://shootout.alioth.debian.org/) and apply for an entry in this
shootout.

Cheers,

Edwin

-- 
Neko : One VM to run them all
(http://nekovm.org)

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to