[chuck] Wishlist and bugreport from hacking

Ge Wang gewang at CS.Princeton.EDU
Thu Dec 9 03:51:41 EST 2004

Hi Mikael et. al,

> * capability to build ulib_foo functions that can treat the dur 
> primitive
>   type.

They actually can, in a semi-hack way.  dur and time are passed as
double-precision floats (or t_CKDUR and t_CKTIME).  When defining
the prototype, you only need to specify "dur" or "time".  The semantic
of both is that they both count samples (or fractions thereof).  There 
ways of converting samples to sample-rate independent time, the
most basic of which is to normalize by the system sample rate in 

> * The handling of parameter input to ulib functions is severely flawed,
>   including lack of type security across platforms and probably not
>   64-bit secured:

Um, yes - there are some egregious hacks in that area of the code.  We
have tried to alleviate the data width with consistent types across the
system (t_CKFLOAT, t_CKINT, etc), and hopefully a configure script would
be able to resolve that across platforms.

As for the (non-existent) type-checking at the ckx level, this is so 
currently ckx are viewed as "trusted" modules to be plugged in, and 
the paradigm of ChucK allows for externals to be added, ChucK reduces 
need for many externals because of the flexibility of timing mechanism 
soon the ability to write unit generators directly in ChucK.  (the idea 
is to
move away from dependence on plug-in modules, but support them anyway)
Also, such checks may reduce performance.  Given this and priorities for
other features, no type-checking is performed when a ckx is dynamically
loaded or when the functions are invoked.  However, we are open to
methods of efficiently handling this, especially when we release (by 
I mean document) the CKX way of importing modules written in other

> * You have several various memory leaks and similar problems; use of
>   valgrind is advised.

We have documented some known leaks, most of which is in the type
checker / emitter, which accumulates slowly when loading new parse
trees and such (but is stable otherwise).  Which ones are you referring 
Much of this is being fixed as we work on the rewrite, which overhauls 
type checker and emitter, and parts of the VM.

We should continue this discussion on chuck-dev.

Thanks for looking into this!


More information about the chuck mailing list