[chuck-users] wishlist for the new year
Hans Aberg
haberg at math.su.se
Sun Jan 10 17:34:29 EST 2010
On 10 Jan 2010, at 22:38, mike clemow wrote:
>> You are sort of reinventing the wheel, or at least (Standard) ML,
>> here. See
>> http://en.wikipedia.org/wiki/Standard_ML
>> http://en.wikipedia.org/wiki/ML_(programming_language)
>
> We're not reinventing the wheel so much as exploring how certain
> features might be added to the Chuck language--features that appear
> in many other languages (JavaScript, Haskell, Python, and ML too).
> I mean, LISP did this stuff before any of the others...
I just meant that the things you are experimenting with have already
been done - there would be problem to add it. Easier. :-)
One needs to figure out how to add a type system. But if one scraps
the Hindley-Milner type system, at least in the global form it appears
in SML and Haskell, there would be less of a problem.
> I think it's great to look at the way other languages do things as
> examples, but we're not about to re-make the Chuck system using
> Haskell syntax or LISP, or ML. It's highly likely that Chuck will
> get new features, but the ones it gets will be the ones that seem
> most important to the devs and the community, I suppose.
Sorry, I treated the actual syntax as irrelevant - it should of course
be ChucKish, but what works can be found out when plugging into the .y
grammar file. So I thought of x |-> f or \x -> f or fn x => f or
(lambda x f) as merely different ways to say the same thing.
One can in Haskell use a syntax closer to your:
bing :: Num a => a -> a -> a
bing b = funk
where funk i = b + i
It says essentially the same as
fun fun int bing(int b) {
fun int funk(int i) { return b+i; }
return funk;
}
though strictly speaking, the return type is "fun int (int)" or
something.
The problem is probably not adding functions as objects, but finding a
good type system, especially when polymorphy is added.
Hans
More information about the chuck-users
mailing list