Poll

What method would you prefer to translate BASIC to a cross platform binary executable.

Daniel's uCalc Transform --> C++
1 (33.3%)
ScriptBasic --> Nimrod --> C (project abandoned by John)
0 (0%)
Nimrod --> C
0 (0%)
Python --> Nimrod --> C
1 (33.3%)
C BASIC (Charles Pegge's BASIC wrapper for C)
1 (33.3%)
Other (post your idea)
0 (0%)

Total Members Voted: 2

Author Topic: BAS2NIM  (Read 45967 times)

kryton9

  • Guest
Re: BAS2NIM
« Reply #15 on: October 11, 2013, 08:13:11 PM »
Thanks John. Well if you can make an SB version and then I will convert it to Nimrod unless I get stuck. That should be a good way for me to get up to speed on both languages again.

So John: make scriptbasic version  Kent: make Nimrod version and if possible php, I could use the refresher on it as well!

Does this sound like a plan?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #16 on: October 11, 2013, 08:39:05 PM »
I would leave both ScriptBasic and PHP out of the picture right now. I personally have no interest in writing a BASIC to PHP translator. PHP was a mistake and security nightmare from the beginning and still is. Unfortunately everything we use on the web is written in it.  >:( All we are trying to do is create a map to write a text translator. (in SB) Just use traditional BASIC syntax for your examples. Before we get too far down the road, can you do a DIM to var translation so everyone understands how Nimrod variables work?


kryton9

  • Guest
Re: BAS2NIM
« Reply #17 on: October 11, 2013, 08:53:20 PM »
I got John, ok.

I am going to use GW-BASIC since it is command line and would be a good reference text.
http://www.divonasperi.it/divona/tam/tecnologia/dow-all/GW%20Basic%20(inglese).pdf

1. I am going to study cloud9 docs first.
2. Then work on this project next.



« Last Edit: October 11, 2013, 08:55:40 PM by kryton9 »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #18 on: October 11, 2013, 09:18:41 PM »
Sounds like a great plan. Let me know what I can do to help.


Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #19 on: October 11, 2013, 10:33:59 PM »
Kent,

Your comment about PHP got me thinking about something I briefly passed over in the Nimrod docs. Nimrod translates to more than just C. Here is a translation of the hello.nim to hello.js. The last line of the file is where all the action is at for this script.

Code: [Select]
/* Generated by the Nimrod Compiler v0.9.3 */
/*   (c) 2013 Andreas Rumpf */


var Globals = this;
var framePtr = null;
var excHandler = null;
var NTI830 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI832 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI842 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI103 = {size: 0,kind: 31,base: null,node: null,finalizer: null};
var NTI6452 = {size: 0, kind: 18, base: null, node: null, finalizer: null};
var NTI808 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI137 = {size: 0,kind: 28,base: null,node: null,finalizer: null};
var NTI139 = {size: 0,kind: 29,base: null,node: null,finalizer: null};
var NTI891 = {size: 0,kind: 22,base: null,node: null,finalizer: null};
var NTI824 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI828 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI840 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NTI844 = {size: 0, kind: 17, base: null, node: null, finalizer: null};
var NNI844 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI844.node = NNI844;
var NNI840 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI840.node = NNI840;
var NNI828 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI828.node = NNI828;
NTI891.base = NTI824;
var NNI824 = {kind: 2, len: 4, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "parent", len: 0, typ: NTI891, name: "parent", sons: null},
{kind: 1, offset: "name", len: 0, typ: NTI139, name: "name", sons: null},
{kind: 1, offset: "message", len: 0, typ: NTI137, name: "msg", sons: null},
{kind: 1, offset: "trace", len: 0, typ: NTI137, name: "trace", sons: null}]};
NTI824.node = NNI824;
var NNI808 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI808.node = NNI808;
NTI824.base = NTI808;
NTI828.base = NTI824;
NTI840.base = NTI828;
NTI844.base = NTI840;
var NNI6452 = {kind: 2, len: 2, offset: 0, typ: null, name: null, sons: [{kind: 1, offset: "Field0", len: 0, typ: NTI139, name: "Field0", sons: null},
{kind: 1, offset: "Field1", len: 0, typ: NTI103, name: "Field1", sons: null}]};
NTI6452.node = NNI6452;
var NNI842 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI842.node = NNI842;
NTI842.base = NTI840;
var NNI832 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI832.node = NNI832;
var NNI830 = {kind: 2, len: 0, offset: 0, typ: null, name: null, sons: []};
NTI830.node = NNI830;
NTI830.base = NTI828;
NTI832.base = NTI830;
var nim_program_result = 0;
var globalraisehook_5411 = null;
var localraisehook_5416 = null;
var outofmemhook_5419 = null;
function cstrToNimstr(c_6734) {
    var result = [];
    for (var i = 0; i < c_6734.length; ++i) {
      result[i] = c_6734.charCodeAt(i);
    }
    result[result.length] = 0; // terminating zero
    return result;
  }
function ArrayConstr(len_7668, value_7669, typ_7670) {
    var result = new Array(len_7668);
    for (var i = 0; i < len_7668; ++i) result[i] = NimCopy(value_7669, typ_7670);
    return result;
  }
function add_5433(x_5436, x_5436_Idx, y_5437) {
var F={procname:"system.add",prev:framePtr,filename:"lib/system.nim",line:0};
framePtr = F;
      var len = x_5436[0].length-1;
      for (var i = 0; i < y_5437.length; ++i) {
        x_5436[0][len] = y_5437.charCodeAt(i);
        ++len;
      }
      x_5436[0][len] = 0
    framePtr = framePtr.prev;
}
function auxwritestacktrace_6447(f_6449) {
var result_6450 = [null];
var it_6455 = f_6449;
var i_6456 = 0;
var total_6457 = 0;
var tempframes_6461 = ArrayConstr(64, {Field0: null, Field1: 0}, NTI6452);
L1: while (true) {
if (!(!((it_6455 == null)) && (i_6456 <= 63))) break L1;
tempframes_6461[i_6456].Field0 = it_6455.procname;
tempframes_6461[i_6456].Field1 = it_6455.line;
i_6456 += 1;
total_6457 += 1;
it_6455 = it_6455.prev;
}
L2: while (true) {
if (!!((it_6455 == null))) break L2;
total_6457 += 1;
it_6455 = it_6455.prev;
}
result_6450[0] = cstrToNimstr("");
if (!((total_6457 == i_6456))) {
result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr("("));
result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr(((total_6457 - i_6456))+""));
result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr(" calls omitted) ...\x0A"));
}

var j_6535 = 0;
var X3Atmp_6539 = 0;
X3Atmp_6539 = (i_6456 - 1);
var res_6541 = X3Atmp_6539;
L3: while (true) {
if (!(0 <= res_6541)) break L3;
j_6535 = res_6541;
add_5433(result_6450, 0, tempframes_6461[j_6535].Field0);
if ((0 < tempframes_6461[j_6535].Field1)) {
result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr(", line: "));
result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr((tempframes_6461[j_6535].Field1)+""));
}

result_6450[0] = (result_6450[0].slice(0,-1)).concat(cstrToNimstr("\x0A"));
res_6541 -= 1;
}
return result_6450[0];
}
function rawwritestacktrace_6542() {
var result_6544 = null;
if ((framePtr == null)) {
result_6544 = cstrToNimstr("No stack traceback available\x0A");
}
else {
result_6544 = (cstrToNimstr("Traceback (most recent call last)\x0A").slice(0,-1)).concat(auxwritestacktrace_6447(framePtr));
framePtr = null;
}

return result_6544;
}
function eqStrings(a_6790, b_6791) {
    if (a_6790 == b_6791) return true;
    if ((!a_6790) || (!b_6791)) return false;
    var alen = a_6790.length;
    if (alen != b_6791.length) return false;
    for (var i = 0; i < alen; ++i)
      if (a_6790[i] != b_6791[i]) return false;
    return true;
  }
function toJSStr(s_6738) {
    var len = s_6738.length-1;
    var result = new Array(len);
    var fcc = String.fromCharCode;
    for (var i = 0; i < len; ++i) {
      result[i] = fcc(s_6738[i]);
    }
    return result.join("");
  }
function raiseException(e_6560, ename_6561) {
var Tmp1;
e_6560.name = ename_6561;
if (!((excHandler == null))) {
excHandler.exc = e_6560;
}
else {
var buf_6601 = [rawwritestacktrace_6542()];
if (!!(eqStrings(e_6560.message, null))) Tmp1 = false; else {Tmp1 = !((e_6560.message[0] == 0)); }if (Tmp1) {
buf_6601[0] = (buf_6601[0].slice(0,-1)).concat(cstrToNimstr("Error: unhandled exception: "));
buf_6601[0] = (buf_6601[0].slice(0,-1)).concat(e_6560.message);
}
else {
buf_6601[0] = (buf_6601[0].slice(0,-1)).concat(cstrToNimstr("Error: unhandled exception"));
}

buf_6601[0] = (buf_6601[0].slice(0,-1)).concat(cstrToNimstr(" ["));
add_5433(buf_6601, 0, ename_6561);
buf_6601[0] = (buf_6601[0].slice(0,-1)).concat(cstrToNimstr("]\x0A"));
alert(toJSStr(buf_6601[0]));
}

throw e_6560;}
function raiseOverflow() {
var e_6638 = null;
e_6638 = {m_type: NTI844, parent: null, name: null, message: null, trace: null};
e_6638.message = cstrToNimstr("over- or underflow");
raiseException(e_6638, "EOverflow");
}
function raiseDivByZero() {
var e_6657 = null;
e_6657 = {m_type: NTI842, parent: null, name: null, message: null, trace: null};
e_6657.message = cstrToNimstr("divison by zero");
raiseException(e_6657, "EDivByZero");
}
function rawEcho() {
var node_7038 = document.getElementsByTagName("body")[0];
if ((node_7038 == null)) {
var e_7053 = null;
e_7053 = {m_type: NTI832, parent: null, name: null, message: null, trace: null};
e_7053.message = cstrToNimstr("<body> element does not exist yet!");
raiseException(e_7053, "EIO");
}

      for (var i = 0; i < arguments.length; ++i) {
        var x = toJSStr(arguments[i]);
        node_7038.appendChild(document.createTextNode(x))
      }
    node_7038.appendChild(document.createElement("br"));
}
rawEcho(cstrToNimstr("Hello World!"));

kryton9

  • Guest
Re: BAS2NIM
« Reply #20 on: October 11, 2013, 10:58:35 PM »
Your interesting post just gave me an idea too John.

We don't even need to go through Nimrod. We can cut it out totally.
Why not write a translator that outputs to a format Bacon
or PowerbasicToCpp or any other translator you might know of that we can use?

This way all work will be in BASIC and probably easier to do?

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #21 on: October 12, 2013, 12:44:53 AM »
BAD IDEA !!!

The reason for BAS2NIM is that once your code (where ever it comes from) is in Nimrod format, you can develop and compile on ALL the major platforms with one copy of the source. BaCon is Linux only. (Windows if you want a kludge)  Trust me and lets forge ahead as planned.

« Last Edit: October 12, 2013, 12:50:25 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #22 on: October 12, 2013, 01:00:53 AM »
Why I like github.

Code: [Select]
scriptbasic@nimrod:~/639761/Nimrod (master) $ git pull
remote: Counting objects: 34, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 22 (delta 18), reused 19 (delta 15)
Unpacking objects: 100% (22/22), done.
From git://github.com/Araq/Nimrod
   67dedcd..173ca8d  master     -> origin/master
Updating 67dedcd..173ca8d
Fast-forward
 compiler/jsgen.nim     |  2 +-
 compiler/vm.nim        | 29 ++++++++++++-----------------
 compiler/vmdef.nim     |  3 +++
 doc/c2nim.txt          |  8 +-------
 lib/pure/ftpclient.nim |  3 ++-
 lib/pure/sockets.nim   |  4 ++--
 lib/system.nim         |  9 +++++++--
 7 files changed, 28 insertions(+), 30 deletions(-)
scriptbasic@nimrod:~/639761/Nimrod (master) $

Rebuild of Nimrod

Code: [Select]
scriptbasic@nimrod:~/639761/Nimrod (master) $ bin/nimrod c koch
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/babel-0.1.0' [Path]
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/' [Path]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/koch.nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: koch [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: parseopt [Processing]
Hint: osproc [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
koch.nim(170, 11) Hint: 'dir' is declared but not used [XDeclaredButNotUsed]
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_koch.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_koch.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_system.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_system.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_os.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_os.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strutils.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strutils.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseutils.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseutils.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_times.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_times.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/posix_posix.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/posix_posix.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseopt.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseopt.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_osproc.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_osproc.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strtabs.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strtabs.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_hashes.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_hashes.c
gcc -c -w -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_streams.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_streams.c
gcc   -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/koch  /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_streams.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_hashes.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strtabs.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_osproc.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseopt.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/posix_posix.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_times.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_parseutils.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_strutils.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/pure_os.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_system.o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/nimcache/Nimrod_koch.o  -ldl
Hint: operation successful (16681 lines compiled; 4.749 sec total; 27.281MB) [SuccessX]
scriptbasic@nimrod:~/639761/Nimrod (master) $ ./koch boot -d:release
iteration: 1
compiler/nimrod0 cc  -d:release compiler/nimrod.nim
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/babel-0.1.0' [Path]
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/' [Path]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/compiler/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: nimrod [Processing]
Hint: commands [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: msgs [Processing]
Hint: options [Processing]
Hint: lists [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: tables [Processing]
Hint: math [Processing]
Hint: ropes [Processing]
Hint: platform [Processing]
Hint: crc [Processing]
Hint: sockets [Processing]
Hint: nversion [Processing]
Hint: condsyms [Processing]
Hint: idents [Processing]
Hint: extccomp [Processing]
Hint: osproc [Processing]
Hint: streams [Processing]
Hint: wordrecg [Processing]
Hint: babelcmd [Processing]
Hint: lexer [Processing]
Hint: nimlexbase [Processing]
Hint: llstream [Processing]
Hint: nimconf [Processing]
Hint: main [Processing]
Hint: ast [Processing]
Hint: intsets [Processing]
Hint: idgen [Processing]
Hint: astalgo [Processing]
Hint: rodutils [Processing]
Hint: syntaxes [Processing]
Hint: parser [Processing]
Hint: pbraces [Processing]
Hint: filters [Processing]
Hint: renderer [Processing]
Hint: filter_tmpl [Processing]
Hint: rodread [Processing]
Hint: types [Processing]
Hint: trees [Processing]
Hint: memfiles [Processing]
Hint: rodwrite [Processing]
Hint: passes [Processing]
Hint: magicsys [Processing]
Hint: nimsets [Processing]
Hint: bitsets [Processing]
Hint: semthreads [Processing]
Hint: importer [Processing]
Hint: lookups [Processing]
Hint: semdata [Processing]
Hint: treetab [Processing]
Hint: evals [Processing]
Hint: semfold [Processing]
Hint: saturate [Processing]
Hint: transf [Processing]
Hint: cgmeth [Processing]
Hint: sempass2 [Processing]
Hint: guards [Processing]
Hint: lambdalifting [Processing]
Hint: evaltempl [Processing]
Hint: sem [Processing]
Hint: procfind [Processing]
Hint: pragmas [Processing]
Hint: semtypinst [Processing]
Hint: sigmatch [Processing]
Hint: parampatterns [Processing]
Hint: docgen [Processing]
Hint: rstast [Processing]
Hint: rst [Processing]
Hint: rstgen [Processing]
Hint: highlite [Processing]
Hint: algorithm [Processing]
Hint: sequtils [Processing]
Hint: aliases [Processing]
Hint: patterns [Processing]
Hint: cgen [Processing]
Hint: ccgutils [Processing]
Hint: cgendata [Processing]
Hint: ccgmerge [Processing]
Hint: jsgen [Processing]
Hint: json [Processing]
Hint: lexbase [Processing]
Hint: unicode [Processing]
Hint: passaux [Processing]
Hint: depends [Processing]
Hint: docgen2 [Processing]
Hint: service [Processing]
Hint: parseopt [Processing]
Hint: modules [Processing]
Hint: pretty [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/Nimrod_system.o compiler/nimcache/Nimrod_system.c
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/compiler_commands.o compiler/nimcache/compiler_commands.c
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/pure_sockets.o compiler/nimcache/pure_sockets.c
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/pure_osproc.o compiler/nimcache/pure_osproc.c
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/pure_memfiles.o compiler/nimcache/pure_memfiles.c
gcc -c -w -O3 -fno-strict-aliasing -I/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/lib -o compiler/nimcache/compiler_jsgen.o compiler/nimcache/compiler_jsgen.c
gcc   -o /var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/compiler/nimrod  compiler/nimcache/compiler_pretty.o compiler/nimcache/compiler_modules.o compiler/nimcache/pure_parseopt.o compiler/nimcache/compiler_service.o compiler/nimcache/compiler_docgen2.o compiler/nimcache/compiler_depends.o compiler/nimcache/compiler_passaux.o compiler/nimcache/pure_unicode.o compiler/nimcache/pure_lexbase.o compiler/nimcache/pure_json.o compiler/nimcache/compiler_jsgen.o compiler/nimcache/compiler_ccgmerge.o compiler/nimcache/compiler_cgendata.o compiler/nimcache/compiler_ccgutils.o compiler/nimcache/compiler_cgen.o compiler/nimcache/compiler_patterns.o compiler/nimcache/compiler_aliases.o compiler/nimcache/collections_sequtils.o compiler/nimcache/pure_algorithm.o compiler/nimcache/docutils_highlite.o compiler/nimcache/docutils_rstgen.o compiler/nimcache/docutils_rst.o compiler/nimcache/docutils_rstast.o compiler/nimcache/compiler_docgen.o compiler/nimcache/compiler_parampatterns.o compiler/nimcache/compiler_sigmatch.o compiler/nimcache/compiler_semtypinst.o compiler/nimcache/compiler_pragmas.o compiler/nimcache/compiler_procfind.o compiler/nimcache/compiler_sem.o compiler/nimcache/compiler_evaltempl.o compiler/nimcache/compiler_lambdalifting.o compiler/nimcache/compiler_guards.o compiler/nimcache/compiler_sempass2.o compiler/nimcache/compiler_cgmeth.o compiler/nimcache/compiler_transf.o compiler/nimcache/compiler_saturate.o compiler/nimcache/compiler_semfold.o compiler/nimcache/compiler_evals.o compiler/nimcache/compiler_treetab.o compiler/nimcache/compiler_semdata.o compiler/nimcache/compiler_lookups.o compiler/nimcache/compiler_importer.o compiler/nimcache/compiler_semthreads.o compiler/nimcache/compiler_bitsets.o compiler/nimcache/compiler_nimsets.o compiler/nimcache/compiler_magicsys.o compiler/nimcache/compiler_passes.o compiler/nimcache/compiler_rodwrite.o compiler/nimcache/pure_memfiles.o compiler/nimcache/compiler_trees.o compiler/nimcache/compiler_types.o compiler/nimcache/compiler_rodread.o compiler/nimcache/compiler_filter_tmpl.o compiler/nimcache/compiler_renderer.o compiler/nimcache/compiler_filters.o compiler/nimcache/compiler_pbraces.o compiler/nimcache/compiler_parser.o compiler/nimcache/compiler_syntaxes.o compiler/nimcache/compiler_rodutils.o compiler/nimcache/compiler_astalgo.o compiler/nimcache/compiler_idgen.o compiler/nimcache/collections_intsets.o compiler/nimcache/compiler_ast.o compiler/nimcache/compiler_main.o compiler/nimcache/compiler_nimconf.o compiler/nimcache/compiler_llstream.o compiler/nimcache/compiler_nimlexbase.o compiler/nimcache/compiler_lexer.o compiler/nimcache/compiler_babelcmd.o compiler/nimcache/compiler_wordrecg.o compiler/nimcache/pure_streams.o compiler/nimcache/pure_osproc.o compiler/nimcache/compiler_extccomp.o compiler/nimcache/compiler_idents.o compiler/nimcache/compiler_condsyms.o compiler/nimcache/compiler_nversion.o compiler/nimcache/pure_sockets.o compiler/nimcache/compiler_crc.o compiler/nimcache/compiler_platform.o compiler/nimcache/compiler_ropes.o compiler/nimcache/pure_math.o compiler/nimcache/collections_tables.o compiler/nimcache/pure_hashes.o compiler/nimcache/pure_strtabs.o compiler/nimcache/compiler_lists.o compiler/nimcache/compiler_options.o compiler/nimcache/compiler_msgs.o compiler/nimcache/posix_posix.o compiler/nimcache/pure_times.o compiler/nimcache/pure_parseutils.o compiler/nimcache/pure_strutils.o compiler/nimcache/pure_os.o compiler/nimcache/compiler_commands.o compiler/nimcache/Nimrod_system.o compiler/nimcache/compiler_nimrod.o  -ldl -lm
Hint: operation successful (67238 lines compiled; 17.628 sec total; 202.207MB) [SuccessX]
iteration: 2
compiler/nimrod1 cc  -d:release compiler/nimrod.nim
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/babel-0.1.0' [Path]
config/nimrod.cfg(36, 2) Hint: added path: '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/.babel/pkgs/' [Path]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/var/lib/stickshift/525387a75973caafd40003a0/app-root/data/639761/Nimrod/compiler/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: nimrod [Processing]
Hint: commands [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: msgs [Processing]
Hint: options [Processing]
Hint: lists [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: tables [Processing]
Hint: math [Processing]
Hint: ropes [Processing]
Hint: platform [Processing]
Hint: crc [Processing]
Hint: sockets [Processing]
Hint: nversion [Processing]
Hint: condsyms [Processing]
Hint: idents [Processing]
Hint: extccomp [Processing]
Hint: osproc [Processing]
Hint: streams [Processing]
Hint: wordrecg [Processing]
Hint: babelcmd [Processing]
Hint: lexer [Processing]
Hint: nimlexbase [Processing]
Hint: llstream [Processing]
Hint: nimconf [Processing]
Hint: main [Processing]
Hint: ast [Processing]
Hint: intsets [Processing]
Hint: idgen [Processing]
Hint: astalgo [Processing]
Hint: rodutils [Processing]
Hint: syntaxes [Processing]
Hint: parser [Processing]
Hint: pbraces [Processing]
Hint: filters [Processing]
Hint: renderer [Processing]
Hint: filter_tmpl [Processing]
Hint: rodread [Processing]
Hint: types [Processing]
Hint: trees [Processing]
Hint: memfiles [Processing]
Hint: rodwrite [Processing]
Hint: passes [Processing]
Hint: magicsys [Processing]
Hint: nimsets [Processing]
Hint: bitsets [Processing]
Hint: semthreads [Processing]
Hint: importer [Processing]
Hint: lookups [Processing]
Hint: semdata [Processing]
Hint: treetab [Processing]
Hint: evals [Processing]
Hint: semfold [Processing]
Hint: saturate [Processing]
Hint: transf [Processing]
Hint: cgmeth [Processing]
Hint: sempass2 [Processing]
Hint: guards [Processing]
Hint: lambdalifting [Processing]
Hint: evaltempl [Processing]
Hint: sem [Processing]
Hint: procfind [Processing]
Hint: pragmas [Processing]
Hint: semtypinst [Processing]
Hint: sigmatch [Processing]
Hint: parampatterns [Processing]
Hint: docgen [Processing]
Hint: rstast [Processing]
Hint: rst [Processing]
Hint: rstgen [Processing]
Hint: highlite [Processing]
Hint: algorithm [Processing]
Hint: sequtils [Processing]
Hint: aliases [Processing]
Hint: patterns [Processing]
Hint: cgen [Processing]
Hint: ccgutils [Processing]
Hint: cgendata [Processing]
Hint: ccgmerge [Processing]
Hint: jsgen [Processing]
Hint: json [Processing]
Hint: lexbase [Processing]
Hint: unicode [Processing]
Hint: passaux [Processing]
Hint: depends [Processing]
Hint: docgen2 [Processing]
Hint: service [Processing]
Hint: parseopt [Processing]
Hint: modules [Processing]
Hint: pretty [Processing]
Hint: operation successful (67238 lines compiled; 6.592 sec total; 202.207MB) [SuccessX]
executables are equal: SUCCESS!
scriptbasic@nimrod:~/639761/Nimrod (master) $ nimrod -v
Nimrod Compiler Version 0.9.3 (2013-10-12) [Linux: amd64]
Copyright (c) 2004-2013 by Andreas Rumpf

scriptbasic@nimrod:~/639761/Nimrod (master) $
« Last Edit: October 12, 2013, 01:19:00 AM by John »

kryton9

  • Guest
Re: BAS2NIM
« Reply #23 on: October 12, 2013, 02:55:14 AM »
BAD IDEA !!!

The reason for BAS2NIM is that once your code (where ever it comes from) is in Nimrod format, you can develop and compile on ALL the major platforms with one copy of the source. BaCon is Linux only. (Windows if you want a kludge)  Trust me and lets forge ahead as planned.

I haven't played with any of the translators, so I will take your word and continue on as we planned then.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #24 on: October 12, 2013, 11:05:02 AM »
Sorry about the BAD IDEA comment. No idea is a bad idea unless it kills you.  ;D

BAS2NIM is a different kind of translator that doesn't focus on it's input as much as its output. In other words, BAS2NIM is a utility not a language.
« Last Edit: October 12, 2013, 11:46:17 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #25 on: October 12, 2013, 11:37:02 AM »
Here is the set of BASIC directives and functions that I would like to see converted to Nimrod as the first pass. I can then start working on the SB converter getting its general functionality in place and prepare for the next round.

Code: [Select]
DIM
FOR/NEXT
IF/THEN/ELSE
WHILE/WEND
<LET> Assignment
GOTO
GOSUB/RETURN


ASC
VAL
STR
MID
LEFT
UCASE
LCASE
UBOUND
LBOUND

Dream Team

AIR - Project repositories (git master) and Nimrod / C mentor.

Charles - How it works mentor and advisor so we don't paint ourself into a corner.

Daniel - uCalc Transform mentor / contributor

José Roca - Windows API / COM specialist

John - Project facilitator and GOTO guy.

Kent - BASIC to Nimrod syntax translation mapper, agreed upon concept tester and keeper/creator of the docs.

Others - Work with the above team as advocates testing the BAS2NIM utility for proper / efficient translation to Nimrod.


« Last Edit: October 13, 2013, 12:35:36 AM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #26 on: October 12, 2013, 12:29:58 PM »
I'm thinking that this might be a lot easier if we were to use Danial's uCalc Transform software instead of ScriptBasic to do the translation. I will contact Daniel and let him know what we are up to and see if he could mentor / contribute to the project. I have forked Daniel's PowerBASIC to C++ project on Github to the ScriptBasic / BAS2NIM project. I will add this repository to the Cloud9 IDE git interface.

Since uCalc Transform is Windows only and a language translation template tool, the goal would be to use Daniel's tool to get the project far enough along that a cross platform Ninrod based BAS2NIM could be self compiled.

uCalc Patterns Documentation

Note: I was unable to run uCalc Transform in Wine. (complained about VB missing dependencies) I'm running it in a VirtualBox on Ubuntu 64.
« Last Edit: October 12, 2013, 05:40:40 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #27 on: October 12, 2013, 03:41:53 PM »
I have attached the forked uCalc Transform project BAS2NIM to the project Cloud9 IDE. Changes will now be reflected in the github repository. Nimrod is currently up to date as of yesterdays rebuild.


kryton9

  • Guest
Re: BAS2NIM
« Reply #28 on: October 12, 2013, 04:03:07 PM »
Thanks for the initial command list to focus on John.
I will work on it some more tonight following that as a guide.

You have assembled a great set of tools for us
on a very cool web based collaboration system.

Everyone should try it, because it surprises you
on how well it works and how handy it is.

I think this is a great project to really test
the new frontier in programming and working
together.

Thanks for figuring it all out and setting it up!

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: BAS2NIM
« Reply #29 on: October 12, 2013, 04:06:33 PM »
That's what facilitators do.   :)