[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing Goo libraries



On Thursday, July 25, 2002, at 03:31  AM, Chris Double wrote:
> For those writing libraries in Goo what sort of steps do you follow in
> terms of organising where the code lives, how to update, etc?
>
> What sort of advice can you give on developing in Goo based on your
> experience?
>
> Some things for discussion:
>
> Where do you have the code 'live'? In the 'src' subdirectory somewhere
> or some local repository? How do you get Goo to know about the local
> repository?

If you look at system.goo, you can see where goo looks for files.
For modules, it searches in a few places:
$(HOME)/.goo/mods/
$(GOO_ROOT)/local/mods/
$(GOO_ROOT)/mods/
Thus, the answer would be to install it in $(GOO_ROOT)/local/mods/ for 
system-wide installation, and ~/.goo/mods for user installation. You can 
add paths to the variable *module-search-path* to make it search in more 
places if you wish.

> When you have some code written, do you 'use' that module and then
> add/modify definitions as appropriate via the r-e-p? Or do you prefer
> just re-loading the module to catch up on all changes? What works
> best?

Unfortunately there is not really any way to unload a module once its 
been loaded. Thus, I end up just evaluating the expressions.

> What about those projects mixing 'C' code and Goo code (The GUI for
> example). How do you minimize having to rebuild the Goo system
> whenever you add new 'C' functionality?

Well right now the GUI core stuff is pretty much all C I think. SWIG 
generates C code which gets loaded in via the so-load call. The GOO core 
never gets recompiled. There is an issue with this, though, in that the 
C code is introducing bindings which the static g2c compiler does not 
know about. Thus it is currently impossible to have code in goo-proper 
which depends on the SWIG'd code.

> Does dynamic compilation help, hinder or anything else?

It doesn't do much but make the program run faster. :) One thing to 
watch for - If you're pasting something into the REP, it helps to put it 
all in a (seq) so that the compiler can get it all at once instead of 
separately compiling and loading each statement.

> When (if) you define a generic function via the r-e-p and realise that
> the arguments to the function aren't correct what do you do? Redefine
> the generic with a different name? Quit out and restart?

Well you can do ,restart 2 to "Replace #{Gen foo (<any>)} with an empty 
generic congruent with #{Met foo ((a <any>) (b <any>))}." But I just put 
a bunch of "dg"s at the top of the file, which define the generics I'm 
going to use and thus replace anything previously defined so I don't run 
into the problem


> Anyone game on writing up what their Goo development environment is
> like in actual Goo usage? (Emacs, Eclipse, etc?)

Everyone I know writes in emacs.


james