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?
Anyway, on my wishlist is a facility for easily writing your own UGen code
in ChucK. Maybe some system for making dynamically linked libraries that
could be included into the ChucK VM?
Happy ChucK Year Everyone!
/Stefan
2010/1/10 mike clemow
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
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)http://en.wikipedia.org/wiki/ML_%28programming_language%29
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
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
-- Release me, insect, or I will destroy the Cosmos!