I see, yes.  Would this essentially give us something like a dynamically typed Chuck?  I would love that...  but I think that we're going to get serious resistance from the devs on this one.  I think you're right, though.  If we had a better type system, then none of this kind of stuff would be such a hurdle to get over.

I personally, really appreciate what LiCK does for Chuck, but I think it's a lot of boiler plate to write, when having a more flexible language implementation / type system would allow us to avoid all that.

-mike
 

On Sun, Jan 10, 2010 at 5:34 PM, Hans Aberg <haberg@math.su.se> wrote:
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


_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users



--
http://michaelclemow.com
http://semiotech.org