Nicolas Cannasse | 1 Aug 14:27 2007

Re: trouble building nekoml 1.6.0 from sources on Linux

>> Could you try to run the command inside gdb then send me the backtrace ?
> 
> neko used over 2G process memory (on my 512M machine) under gdb, 
> and took 20 minutes to produce this stack trace. 
> 
> Is it typical for neko compilations to use that much RAM, or is it a
> symptom of a problem? Can neko be run in interpreted mode (without JIT) 
> or be forced to collect garbage more frequently?

This is a symptom of the problem. Looks like the neko_module_jit method 
start an infinite loop that allocates memory when compiled with -O3 on 
your OS. Could you try to investigate the sources in neko/vm/jit_x86.c 
and check what is going wrong ?

Best,
Nicolas

--

-- 
Neko : One VM to run them all
(http://nekovm.org)

Stephane Le Dorze | 1 Aug 15:22 2007
Picon

Actor Model

Has anybody implemented an scalable asynchronous event based language on top of Neko VM (think Erlang and/or  IO)?

- Is there other languages than NekoML and Haxe implemented on top of it?
- Is there a tutorial/example to show how to create another language on top of it?
- Is there some facility regarding asynchronous event management in Neko?

Thanks!
Stephane.

--

-- 
Neko : One VM to run them all
(http://nekovm.org)
Nicolas Cannasse | 1 Aug 17:09 2007

Re: Actor Model

> Has anybody implemented an scalable asynchronous event based language on 
> top of Neko VM (think Erlang and/or  IO)?

Hi St├ęphane,

> - Is there other languages than NekoML and Haxe implemented on top of it?

Some experiments have been done to run existing languages (Ruby,Lisp) on 
top of Neko but I don't know if there was languages designed to run on 
Neko (except NekoML and haXe of course).

> - Is there a tutorial/example to show how to create another language on 
> top of it?

Not really.
What you need to do in order to create a language targeting Neko is :

a) read the full Neko specification at http://nekovm.org/specs and think 
about mapping your language X to Neko

b) write a code generator that can convert a program written in language 
X into another Neko program that performs the will you the same result.

After that, in order to ease your program X error reporting, you can use 
the NXML format when generating your neko programs. See 
http://nekovm.org/doc/nxml

> - Is there some facility regarding asynchronous event management in Neko?

There's a multithreading API available 
(http://nekovm.org/doc/view/thread), with two primitives thread_send and 
thread_read_message that can be used to exchange messages between 
threads. You can also implement message queues with the thread locks.

Best,
Nicolas

--

-- 
Neko : One VM to run them all
(http://nekovm.org)

Joe Wilson | 1 Aug 17:11 2007
Picon

Re: trouble building nekoml 1.6.0 from sources on Linux


--- Nicolas Cannasse <ncannasse <at> motion-twin.com> wrote:

> >> Could you try to run the command inside gdb then send me the backtrace ?
> > 
> > neko used over 2G process memory (on my 512M machine) under gdb, 
> > and took 20 minutes to produce this stack trace. 
> > 
> > Is it typical for neko compilations to use that much RAM, or is it a
> > symptom of a problem? Can neko be run in interpreted mode (without JIT) 
> > or be forced to collect garbage more frequently?
> 
> This is a symptom of the problem. Looks like the neko_module_jit method 
> start an infinite loop that allocates memory when compiled with -O3 on 
> your OS. Could you try to investigate the sources in neko/vm/jit_x86.c 
> and check what is going wrong ?

You can reproduce this neko 1.6.0 build segfault by compiling with gcc 4.1.1 
using -O1 or higher and gc6.8 or gc-7.0. I don't know if the problem is with 
the jit or the gc.

gcc 4.2.1 is fine on any optimization level.

Does Neko have an interpreted (non-jit) mode?

       
____________________________________________________________________________________
Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it
out. 
http://answers.yahoo.com/dir/?link=list&sid=396545433

--

-- 
Neko : One VM to run them all
(http://nekovm.org)

Nicolas Cannasse | 1 Aug 17:54 2007

Re: trouble building nekoml 1.6.0 from sources on Linux

>>>> Could you try to run the command inside gdb then send me the backtrace ?
>>> neko used over 2G process memory (on my 512M machine) under gdb, 
>>> and took 20 minutes to produce this stack trace. 
>>>
>>> Is it typical for neko compilations to use that much RAM, or is it a
>>> symptom of a problem? Can neko be run in interpreted mode (without JIT) 
>>> or be forced to collect garbage more frequently?
>> This is a symptom of the problem. Looks like the neko_module_jit method 
>> start an infinite loop that allocates memory when compiled with -O3 on 
>> your OS. Could you try to investigate the sources in neko/vm/jit_x86.c 
>> and check what is going wrong ?
> 
> You can reproduce this neko 1.6.0 build segfault by compiling with gcc 4.1.1 
> using -O1 or higher and gc6.8 or gc-7.0. I don't know if the problem is with 
> the jit or the gc.
> 
> gcc 4.2.1 is fine on any optimization level.
> 
> Does Neko have an interpreted (non-jit) mode?

Yes, you need to run with -interp

But in that case it seems that the error does not seems to occur in the 
JIT'ed code but while the neko module JIT code is produced. Try to 
disable the JIT_ENABLE define in neko/vm/jit_x86.c to completely 
disactivate the jit.

Nicolas

--

-- 
Neko : One VM to run them all
(http://nekovm.org)

Joe Wilson | 1 Aug 18:38 2007
Picon

Re: trouble building nekoml 1.6.0 from sources on Linux


> > You can reproduce this neko 1.6.0 build segfault by compiling with gcc 4.1.1 
> > using -O1 or higher and gc6.8 or gc-7.0. I don't know if the problem is with 
> > the jit or the gc.
> > 
> > gcc 4.2.1 is fine on any optimization level.
> > 
> > Does Neko have an interpreted (non-jit) mode?
> 
> Yes, you need to run with -interp
> 
> But in that case it seems that the error does not seems to occur in the 
> JIT'ed code but while the neko module JIT code is produced. Try to 
> disable the JIT_ENABLE define in neko/vm/jit_x86.c to completely 
> disactivate the jit.

If JIT_ENABLE is not #defined, neko 1.6.0 will build successfully with 
gcc 4.1.1 with any optimization level.

       
____________________________________________________________________________________
Looking for a deal? Find great prices on flights and hotels with Yahoo! FareChase.
http://farechase.yahoo.com/

--

-- 
Neko : One VM to run them all
(http://nekovm.org)

Stephane Le Dorze | 2 Aug 21:07 2007
Picon

Typos...

Here: http://nekovm.org/doc/nxml

  • <g v="field">e</p> field access of a subexpression (e).field
  • <c>e0 e1 e2 e3...</p> call of e0(e1,e2,e3...)
Should be:
  • <g v="field">e</g> field access of a subexpression (e).field
  • <c>e0 e1 e2 e3...</c> call of e0(e1,e2,e3...)

--

-- 
Neko : One VM to run them all
(http://nekovm.org)
Franco Ponticelli | 2 Aug 21:11 2007
Picon

Re: Typos...

Corrected, thank you.
Login and edit is open to anyone ... ;-)

On 8/2/07, Stephane Le Dorze <stephane.ledorze <at> gmail.com > wrote:
Here: http://nekovm.org/doc/nxml

  • <g v="field">e</p> field access of a subexpression (e).field
  • <c>e0 e1 e2 e3...</p> call of e0(e1,e2,e3...)
Should be:
  • <g v="field">e</g> field access of a subexpression (e).field
  • <c>e0 e1 e2 e3...</c> call of e0(e1,e2,e3...)


--
Neko : One VM to run them all
(http://nekovm.org)

--

-- 
Neko : One VM to run them all
(http://nekovm.org)
Stephane Le Dorze | 3 Aug 21:46 2007
Picon

Fwd: not thread based ...



---------- Forwarded message ----------
From: Stephane Le Dorze <stephane.ledorze <at> gmail.com>
Date: Aug 2, 2007 1:15 PM
Subject: not thread based ...
To: 46B0A235.6010102 <at> motion-twin.com

Ok, back on this subject; I ve implemented kind of erlang Actors in Haxe.
Now the problem I face is serialisation of these actors (which are based on closures).
The reflect Api do not allows me to 'see' the variable of an anonymous function.
Is there any mean for me to obtain this?

basic example: if I have something like this:

    static    public    function impact (val)
    {
        return function (mess)
        {
            trace("Impact state");
            trace(val);

            return new Cont(idle());
        };
    }

Once the function called, I get an anonymous function which captured the val variable.
I would like to serialise this and be able to restore it on need.

Another possibility that would work for me is to know the original function that was called + its parameters...
Is this possible? (I think it depends on the underlying representation of closures).

Obviously I can done all the tracking explicitely by hand but want to make it easy to use by others and error prone.
any help on this?

Stephane.

--

-- 
Neko : One VM to run them all
(http://nekovm.org)
blackdog | 6 Aug 02:03 2007

Problem with static prims


Hi Nicolas

I'm trying to use freepascal for ndlls. So far I have a really simple
test which works if I don't load the prim as a static, e.g. this works

class Tests {
	//static var testint = neko.Lib.load("libnice","tester",1);

	static function main() {
		var testint = neko.Lib.load("libnice","tester",1);
		trace("blah");
		trace(testint(1));
	}
}

but this fails

class Tests {
	static var testint = neko.Lib.load("libnice","tester",1);

	static function main() {
	//	var testint = neko.Lib.load("libnice","tester",1);
		trace("blah");
		//trace(testint(1)); // <-- notice I'm not even calling
this, it fails because of the load
	 }
}

I don't want to bog you down with too much info, so can you think of
any reason why a static might fail to load but the var to load? If you
do want some more info then read on ;)

I added some debug to load.c to see if the function is found or
not and allocated as a neko prim or not, so for the failure I get this

I've removed a number of calls for brevity

.... removed some debug here ...
got 0xb7cc9e40,allocated std <at> sys_exists,ok 
got 0xb7cca7c0,allocated std <at> put_env,ok 
got 0xb7cca680,allocated std <at> set_cwd,ok 
got 0xb7cb3bf0,allocated std <at> unserialize,ok 
got 0xb7cb2d70,allocated std <at> serialize,ok 

did get in here first:44
code:B7C8B998
got 0xb7c8b998,allocated libnice <at> tester,ok  < --- Seems to be allocated

got 0xb7cb09a0,allocated std <at> math_tan,ok 
got 0xb7cb0ae0,allocated std <at> math_sqrt,ok 
.... removed some debug here ...
got 0xb7cb19f0,allocated std <at> random_new,ok 
got 0xb7cb0670,allocated std <at> math_pi,ok 
Runtime error 207 at $B7CEA4C5		    
 $B7CEA4C5
 $080A8AAC
 $FFFFFFFF

Error : Command failed

The failure doesn't seem to be in the allocation of libnice <at> tester, but
further on after all the other prims are loaded. Runtime
error 207 is a pascal exception for an invalid float operation, so i
have no idea why that is finally getting thrown, as my pascal doesn't
use fp as far as I know - and in the fail I haven't even called tester.

If you're interested the pascal looks like this, I've hard
coded the DEFINE_PRIM right now

library nice;

uses neko;

function tester(b:value):value ; cdecl;
	begin

		if val_is_int(b) then
			tester := alloc_string('nice')
		else
			tester := alloc_string('boo');

	end;

function tester__1():Pointer; cdecl;

	begin
	writeln('did get in here
first:',sizeof(Pointer),sizeof( <at> tester));

	
	tester__1 :=   <at> tester;
	Writeln('code:',hexstr(Longint( <at> tester),8));
	end;

exports
 tester__1,tester;

end.

Thanks for any wisdom,

bd

-- 
http://www.blackdog-haxe.com/

"It is no measure of health to be well adjusted to a profoundly sick
society." --Jiddu Krishnamurti

--

-- 
Neko : One VM to run them all
(http://nekovm.org)


Gmane