Delight

bearophile bearophileHUGS at lycos.com
Sat Oct 11 10:33:15 PDT 2008


Thomas Leonard:

> I might rename some other types too. e.g.
>   int16, int32, int64
>   uint16, uint32, uint64

I don't like to type "int32" all the time, so I think "int" and "long" may be better.

An intermediate solution of mine that allows for shorter names is to use the number of bytes instead:

int1, int2, int4, int8, uint1, uint2, uint4, uint8
float4, float8, float10
int uint (they are ssize_t/size_t, that is the signed/unsigned size_t).

But maybe keeping the current D names may be better...


>> - The syntax for "new" may be improved
> How? It could be removed, I suppose, as in Python.

I don't know. Maybe the D syntax:
new Classname

May become as in Ruby:
Classname.new


> Like this?
>   if ':' in aString: ...
>   if "seq" in aString: ...
> Would be nice.

Yes, like that.


> Any chance of getting this in D?

I think Walter doesn't like that in D.

But I think your "compiler" may translate this Delight code:
if ':' in aString: ...

into the equivalent of the following D:
if isIn(':', aString) { ...

You can find the isIn() function template is in my libs. Tango probably has a similar function.


> Likewise.

It's just a module of mine, so (once it's complete) you can add it to the stanrdard modules of Delight... You may even load it by default, but Delight isn't Python, so adding an import when you want to use sets seems acceptable.
(If necessary, it's probably easy to translate my "sets" module into Delight code).


> Let me know if you still didn't get a reply...<

I have received it now (generally I don't want to disturb, so I didn't press myself in other ways, thinking you were uninterested in my comments).

I suggest you to add few more examples of small Delight programs in your site, plus if you want a few benchmarks to compare it with D/Python (benchmarks can be found here:  http://shootout.alioth.debian.org/gp4/index.php), so you can give put some numbers behind your statement that performance is sometimes one advantage of Delight over Python (but not in everything, for example Python dicts are often faster, etc).

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list