Nape with Neko

105 views
Skip to first unread message

Ali Hassan

unread,
May 14, 2015, 7:00:45 PM5/14/15
to haxef...@googlegroups.com
has anyone got nape to work with Neko  ? i was trying to use it in a project on linux .. but it didn't even compile ...
it just prints "Uncaught exception - std@module_read"

did I do something wrong here . or Is that a common problem ? ...

thanks you

Waynetron

unread,
May 14, 2015, 7:12:39 PM5/14/15
to haxef...@googlegroups.com
I started a project with Nape and I think it worked with Neko.
I'll find the source code for you when I get home tonight.

Waynetron

unread,
May 16, 2015, 9:31:09 AM5/16/15
to haxef...@googlegroups.com
So this was a Ludum Dare game that I started but scrapped. The code is a mess but I tested it in Neko and it works.
I've attached the entire project, perhaps it might help.
LD32.zip

Ali Hassan

unread,
May 16, 2015, 12:33:47 PM5/16/15
to haxef...@googlegroups.com
thanks for answering .. it works great ..

I think i just assumed it doesn't work .. because when i downloaded the flxNape demo it gave me the same error as well ..

I guess it might be something in the project.xml file ...

I will post the difference once I find it .

thanks again :D

Gama11

unread,
May 16, 2015, 12:47:01 PM5/16/15
to haxef...@googlegroups.com, alithe...@gmail.com
This is an old issue. The problem is that neko has a hardcoded limitation regarding the lines of byte code. Using two large libraries like HaxeFlixel + Nape can be enough to exceed that limit.

Neko's opcode limit has been increased quite a while ago already actually, but there hasn't been a haxe release including a new neko version so far. You could try installing a nightly build.

Defining no-inline sometimes helps, since that reduces the size of the generated byte code. That could have an impact on performance though.

<haxedef name="no-inline" />

On Saturday, May 16, 2015 at 6:33:47 PM UTC+2, Ali Hassan wrote:
thanks for answering .. it works great ..

i think i just assumed it doesn't work .. because when i downloaded the flxNape demo it gave me the same erros as well ..

i guess it might be something in the project.xml file ...

i will post the difference once i find it .

thanks again :D

Ali Hassan

unread,
May 16, 2015, 1:19:45 PM5/16/15
to haxef...@googlegroups.com, alithe...@gmail.com
I tried adding the line you proposed in project.XML .. but it didn't fix my problem though ..
the error message now changed to this ..
Segmentation fault (core dumped)

Smiz Meal

unread,
May 18, 2015, 6:56:56 PM5/18/15
to haxef...@googlegroups.com
Ali, I was also running into problems getting my HaxeFlixel project to compile with the Neko target using Nape. I did resolve it, in a roundabout way...

First, I was getting the "Uncaught exception - std@module_read" error just like you, and after some searching decided to use these lines in my project.xml

    <haxedef name="NAPE_RELEASE_BUILD"/>
   
<haxeflag name="-dce full" />
   
<haxedef name="NAPE_NO_INLINE" if="neko" />

The first line forces it to use the release build of Nape (not always practical during debugging/development, but it supposedly gives better performance). The second line tells the haxe compiler to use full dead code elimination. The third line (which I found searching the internet) is apparently needed to undo the trouble that Nape's inline code causes with Neko.

I also updated my version of Neko to a nightly (windows) build. Even then I was still running into problems with zpp_nape code, this time producing the error:

Called from zpp_nape/callbacks/CbType.hx line 348
Called from nape/callbacks/CbType.hx line 179
Called from nape/callbacks/CbType.hx line 198
Called from zpp_nape/callbacks/CbType.hx line 174
Called from zpp_nape/callbacks/CbType.hx line 353
Called from zpp_nape/ID.hx line 186
Uncaught exception - Invalid operation (+)

 which is apparently caused by trying to increment a static variable "_CbType" that should be initialized to zero, but instead never gets initialized (possibly due to dead code elimination?). Anyway, I modified that part of ID.hx as so:

public static function CbType(){
       
//return _CbType++;
       
if(_CbType == null){
            _CbType
= 0;
       
}
        _CbType
= _CbType + 1;
       
return _CbType;
}

which finally got my HaxeFlixel project that uses Nape to compile to the Neko target. Honestly, this is a pretty bad hack but I needed to get back to developing, and Neko is good for quick compilations. Perhaps if others encounter the same issue it should get reported as to the Nape / Neko people.

Ali Hassan

unread,
May 20, 2015, 6:19:59 PM5/20/15
to haxef...@googlegroups.com
sorry if that's a stupid question .. but how to setup a nightly build of neko on linux ?

Gama11

unread,
May 21, 2015, 3:44:13 AM5/21/15
to haxef...@googlegroups.com, alithe...@gmail.com
Good question, the readme isn't very helpful in that regard ("just build it from source"). I think you'll have to build it using the Makefile.
Reply all
Reply to author
Forward
0 new messages