I think I'm going to add trying to understand the major benefits of dynamic typing and closures/lambda to my wishlist for the new year (I feel old every time I read stuff like this... I just see hard-to-read and hence unmanagable code as being the result). Mike or anyone, do you have any pointers to good articles explaining this?
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:I just meant that the things you are experimenting with have already been done - there would be problem to add it. Easier. :-)
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...
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.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.
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.
One can in Haskell use a syntax closer to your:bing b = funk
bing :: Num a => a -> a -> a
where funk i = b + i
It says essentially the same asthough strictly speaking, the return type is "fun int (int)" or something.
fun fun int bing(int b) {
fun int funk(int i) { return b+i; }
return funk;
}
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
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users