[chuck-users] "Or"

Hans Aberg haberg-1 at telia.com
Sat Sep 4 04:57:51 EDT 2010


On 4 Sep 2010, at 01:27, Kassen wrote:

> I would really like to see that the language design is seriously  
> reworked and all kinds of syntactic sugar introduced - especially  
> lambdas and better forms of iterators.
>
> What would you use a lambda for, concretely? What kind of iterator?
>
> I do -for example- see a issue with how we can't some things to  
> arrays without knowing their type. For example; you could randomise  
> or reverse the order of elements in a array without knowing it's  
> type as that wouldn't matter, but ChucK doesn't permit this. I feel  
> that's more of a issue of arrays and the type-system than a lack of - 
> say- (map) and (lambda).
>
> In the past few weeks I wrote quite a bit of Scheme; I'm certainly  
> not opposed to lambda or to iterating in some quite specific way  
> that fits the current context and aim, but I still wonder how things  
> like that would be used concretely in ChucK.

There is Haskore for Haskell, by which one can write structured  
scores, sort of:
   http://haskell.org/haskellwiki/Haskore

I haven't used it, but it got me interested into developing a  
microtonal interval model. Haskell is good for such prototyping, in  
view of it OO type-system. The lambda makes code very succinct.

It is not having a type system that is causing problems, but that it  
often is a bit underdeveloped. For example, if one wants dynamic  
typing, that can be done by having a type by which the other types can  
be derived dynamically. Then the problems like the one above cane be  
done by introducing a new type.

Such problems show in Haskell, which uses a Hindley-Milner type  
system, where the idea is that the type of an expression can be  
compute via unification. So it does not have the function name  
overloading one is used to in C++ and derivatives. Also, Haskell uses  
lazy evaluation as default, which is incompatible with imperative  
structures, leading complicated ways of doing such programming, which  
would not be suitable for Chuck.



More information about the chuck-users mailing list