At 23:48 03/10/2007 -0700, chromatic wrote:
On Wednesday 03 October 2007 12:55:54 François PERRAD wrote:

> 3) garbage collection
> How write code without GC problems ?
> How track down and fix GC problems ?

I'm happy to help, but I have difficulty running Lua programs from the command
line.  I notice that the test harness chdirs out of languages/lua/ as well.
Is that fixable?  Ideally I'd like to be able to run:

        $ parrot lua.pbc lua_file

... which should make debugging GC problems and performing any optimizations
much easier.

in which context : standalone or test suite ?

- for me, in standalone context, it's OK (except you 'require' alarm or lfs package).
in languages/lua, you could run :
        $ parrot --no-gc lua.pbc  t/shootout/hello.lua
or
        $ cp t/shootout/hello.lua hello.lua
        $ parrot --no-gc lua.pbc  hello.lua

- tests written in PIR (for PMC) could be run in languages/lua
        $ perl -I../../lib t/pmc/boolean.t

- tests written in Lua MUST be run in languages
        $ perl -I../lib -Ilua/t lua/t/assign.t

In Lua source, there are no chdir or equivalent, so I think that the limitation comes from
languages/lua/t/harness or languages/lua/t/Parrot/Test/Lua.pm.
I wrote (in old time) these files with copy/paste from 'languages/bc'.

For GC problem, you could modify the behavior of test suite, by setting the environment
variable PARROT_LUA_TEST_PROG=luap.pir (see t/Parrot/Test/Lua.pm)
That's split compilation & execution phase, for example :
        $ parrot luap.pir --target=pir hello.lua > hello.pir
        $ parrot --no-gc hello.pir

You could notice that the compilation part runs already without --no-gc.

François.

-- c


Reply via email to