November 18, 2017, 11:19:11 PM

Author Topic: BlitzMax-NG and the web?  (Read 326 times)

Offline sphinx

  • Full Member
  • ***
  • Posts: 182
    • Ancientsoft
BlitzMax-NG and the web?
« on: September 13, 2017, 01:02:15 PM »
I see you can build for the Web (JS), is it implemented or not yet?!

I tried a very simple program

Code: [Select]
Print "Hello HTML"
When trying to build and run I get:
Quote
Building Test_Web
[  0%] Compiling:appstub.linux.c
[  0%] Compiling:allchblk.c
[  0%] Compiling:alloc.c
[  0%] Compiling:backgraph.c
[  1%] Compiling:blacklst.c
[  1%] Compiling:checksums.c
[  1%] Compiling:darwin_stop_world.c
[  1%] Compiling:dbg_mlc.c
[  1%] Compiling:dyn_load.c
[  2%] Compiling:finalize.c
[  2%] Compiling:gc_dlopen.c
[  2%] Compiling:gcj_mlc.c
[  2%] Compiling:headers.c
[  2%] Compiling:mach_dep.c
[  3%] Compiling:malloc.c
[  3%] Compiling:mallocx.c
[  3%] Compiling:mark.c
sh: emcc: command not found
Build Error: failed to compile (32512) /Applications/BlitzMaxNG/mod/brl.mod/appstub.mod/appstub.linux.csh: emcc: command not found

Process complete

I am building on my Mac.
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline MikeHart

  • Sr. Member
  • ****
  • Posts: 347
Re: BlitzMax-NG and the web?
« Reply #1 on: September 13, 2017, 01:31:35 PM »
Do you have Emscripten installed?

Offline sphinx

  • Full Member
  • ***
  • Posts: 182
    • Ancientsoft
Re: BlitzMax-NG and the web?
« Reply #2 on: September 13, 2017, 04:46:16 PM »
Do you have Emscripten installed?

Nope!

I will try to install it and get back to you.
Thanks
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline Derron

  • Full Member
  • ***
  • Posts: 190
Re: BlitzMax-NG and the web?
« Reply #3 on: September 13, 2017, 05:57:48 PM »



NG currently seems to have (still) issues with emscripten - even for basic samples:


Code: BlitzMax
  1. SuperStrict
  2. Framework Brl.Standardio
  3.  
  4.  
  5. Print "hello"
  6.  






Code: [Select]
[100%] Linking:untitled1.html
aborting from js compiler due to exception: unknown vector type <2 x i16> | undefined
Traceback (most recent call last):
  File "/usr/share/emscripten/emscripten.py", line 1352, in <module>
    _main(environ=os.environ)
  File "/usr/share/emscripten/emscripten.py", line 1340, in _main
    temp_files.run_and_clean(lambda: main(
  File "/usr/share/emscripten/tools/tempfiles.py", line 39, in run_and_clean
    return func()
  File "/usr/share/emscripten/emscripten.py", line 1348, in <lambda>
    DEBUG_CACHE=DEBUG_CACHE,
  File "/usr/share/emscripten/emscripten.py", line 1235, in main
    jcache=jcache, temp_files=temp_files, DEBUG=DEBUG, DEBUG_CACHE=DEBUG_CACHE)
  File "/usr/share/emscripten/emscripten.py", line 292, in emscript
    assert len(output) == 2, 'Did not receive forwarded data in an output - process failed? We only got: ' + output[0][-3000:]
AssertionError: Did not receive forwarded data in an output - process failed? We only got:  var $1=HEAP32[((22248)>>2)];
 var $2=HEAP32[((22256)>>2)];
 var $3=($1|0)==($2|0);
 if($3){label=2;break;}else{var $18=$1;label=3;break;}
 case 2:
 var $5=HEAP32[((22264)>>2)];
 var $6=$1;
 var $7=$5;
 var $8=((($6)-($7))|0);
 var $9=$8>>2;
 var $10=((($9)+(256))|0);
 var $11=$5;
 var $12=$10<<2;
 var $13=_bbMemExtend($11,$8,$12);
 var $14=$13;
 HEAP32[((22264)>>2)]=$14;
 var $15=(($14+($10<<2))|0);
 HEAP32[((22256)>>2)]=$15;
 var $16=(($14+($9<<2))|0);
 HEAP32[((22248)>>2)]=$16;
 var $18=$16;label=3;break;
 case 3:
 var $18;
 var $19=(($18+4)|0);
 HEAP32[((22248)>>2)]=$19;
 HEAP32[(($18)>>2)]=$clas;
 return;
  default: assert(0, "bad label: " + label);
 }
}
function _bbStringToString($t){
 var label=0;
 return $t;
}
function _bbStringCompare($x,$y){
 var label=0;
 label = 1;
 while(1)switch(label){
 case 1:
 var $1=(($x+4)|0);
 var $2=HEAP32[(($1)>>2)];
 var $3=(($y+4)|0);
 var $4=HEAP32[(($3)>>2)];
 var $5=($2|0)<($4|0);
 var $_=($5?$2:$4);
 var $6=($_|0)>0;
 if($6){var $k_02=0;label=3;break;}else{label=5;break;}
 case 2:
 var $8=($14|0)<($_|0);
 if($8){var $k_02=$14;label=3;break;}else{label=5;break;}
 case 3:
 var $k_02;
 var $9=(($x+8+($k_02<<1))|0);
 var $10=(((((HEAPU8[($9)])|(HEAPU8[((($9)+(1))|0)]<<8))<<16)>>16));
 var $11=(($y+8+($k_02<<1))|0);
 var $12=(((((HEAPU8[($11)])|(HEAPU8[((($11)+(1))|0)]<<8))<<16)>>16));
 var $13=(($10<<16)>>16)==(($12<<16)>>16);
 var $14=((($k_02)+(1))|0);
 if($13){label=2;break;}else{label=4;break;}
 case 4:
 var $16=($10&65535);
 var $17=($12&65535);
 var $18=((($16)-($17))|0);
 var $_0=$18;label=6;break;
 case 5:
 var $19=((($2)-($4))|0);
 var $_0=$19;label=6;break;
 case 6:
 var $_0;
 return $_0;
  default: assert(0, "bad label: " + label);
 }
}
function _bbStringFind($x,$y,$i){
 var label=0;
 label = 1;
 while(1)switch(label){
 case 1:
 var $1=($i|0)<0;
 var $_i=($1?0:$i);
 var $2=(($y+4)|0);
 var $3=HEAP32[(($2)>>2)];
 var $4=((($3)+($_i))|0);
 var $5=(($x+4)|0);
 var $6=HEAP32[(($5)>>2)];
 var $7=($4|0)>($6|0);
 if($7){var $_01=-1;label=8;break;}else{label=2;break;}
 case 2:
 var $8=(($y+8)|0);
 var $_05=$_i;label=3;break;
 case 3:
 var $_05;
 var $10=($3|0)==0;
 if($10){var $_01=$_05;label=8;break;}else{label=4;break;}
 case 4:
 var $11=(($x+8+($_05<<1))|0);
 var $_024_i=$11;var $_015_i=$8;var $_in_i=$3;label=5;break;
 case 5:
 var $_in_i;
 var $_015_i;
 var $_024_i;
 var $12=((($_in_i)-(1))|0);
 var $13=HEAP16[(($_024_i)>>1)];
 var $14=HEAP16[(($_015_i)>>1)];
 var $15=(($13<<16)>>16)==(($14<<16)>>16);
 if($15){label=6;break;}else{label=7;break;}
 case 6:
 var $17=(($_024_i+2)|0);
 var $18=(($_015_i+2)|0);
 var $19=($12|0)==0;
 if($19){var $_01=$_05;label=8;break;}else{var $_024_i=$17;var $_015_i=$18;var $_in_i=$12;label=5;break;}
 case 7:
 var $21=((($_05)+(1))|0);
 var $22=((($3)+($21))|0);
 var $23=($22|0)>($6|0);
 if($23){var $_01=-1;label=8;break;}else{var $_05=$21;label=3;break;}
 case 8:
 var $_01;
 return $_01;
  default: assert(0, "bad label: " + label);
 }
}
Traceback (most recent call last):
  File "/usr/share/emscripten/emcc", line 1864, in <module>
    final = shared.Building.emscripten(final, append_ext=False, extra_args=extra_args)
  File "/usr/share/emscripten/tools/shared.py", line 1276, in emscripten
    assert os.path.exists(filename + '.o.js') and len(open(filename + '.o.js', 'r').read()) > 0, 'Emscripten failed to generate .js: ' + str(compiler_output)
AssertionError: Emscripten failed to generate .js:
Build Error: Failed to link /PATH/TO/BlitzMaxNG/tmp/untitled1.html
Process complete




PS: Something is odd here - having the "log" in the post-form every cursor-key-hit scrolls to bottom of page - even if I click somewhere inbetween the post content.


Offline sphinx

  • Full Member
  • ***
  • Posts: 182
    • Ancientsoft
Re: BlitzMax-NG and the web?
« Reply #4 on: September 13, 2017, 07:48:21 PM »
I have hard times installing (Windows and Mac OS) emscripten!!!! :(
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com

Offline Derron

  • Full Member
  • ***
  • Posts: 190
Re: BlitzMax-NG and the web?
« Reply #5 on: September 13, 2017, 08:03:05 PM »
sudo apt-get install emscripten


*entered password*
*confirmed to-install-packages*


*waited ~20 seconds*


done




bye
Ron

Offline Derron

  • Full Member
  • ***
  • Posts: 190
Re: BlitzMax-NG and the web?
« Reply #6 on: September 13, 2017, 10:04:45 PM »
Brucey replied to the issue I created on github.


So in the current state I would say that the emscripten/html5-target is not working now.




bye
Ron

Offline IanMartin

  • Jr. Member
  • **
  • Posts: 60
    • Retrolutionary.com
Re: BlitzMax-NG and the web?
« Reply #7 on: September 14, 2017, 08:04:35 PM »
I'd like to see this working.  I've got a game idea I'd like to do on PC/Android/and HTML-5 all at the same time.  Coding it in BlitzMax would be awesome!
Platfinity (made with BlitzMax) on Steam:
http://store.steampowered.com/app/365440/Platfinity/

Offline sphinx

  • Full Member
  • ***
  • Posts: 182
    • Ancientsoft
Re: BlitzMax-NG and the web?
« Reply #8 on: September 14, 2017, 09:53:06 PM »
I'd like to see this working.  I've got a game idea I'd like to do on PC/Android/and HTML-5 all at the same time.  Coding it in BlitzMax would be awesome!
Ditto!
Kind regards,
Maher F. Farag
www.ancientsoft.com
www.osakit.com