Oxygen Basic

Information => Open Forum => Topic started by: kryton9 on September 14, 2013, 01:26:45 PM

Title: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 14, 2013, 01:26:45 PM
http://nimrod-code.org/

I just came across this language today. It has many cool features and bindings and
it and all its libraries are written in Nimrod.

List of libraries: Windows and Linux and wrapper libs:
http://nimrod-code.org/lib.html
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 14, 2013, 01:49:40 PM
It looks very interesting and reminds me of Euphoria. It has a IUP binding and cross platform. I think some benchmarking is in order.

It doesn't look too difficult creating a scripting language binding. (based on popular scripting language interfaces already in progress or completed)

Quote
Why learn Another Language?

The first answer is: because it's fun. Just as a botanist is excited to find a new plant, programming language nerds like trying out new languages. Secondly, any new language uses new strategies for dealing with the basic problems of communicating algorithms to computers and intents to other programmers. So it is the most sincere form of criticism: a working implementation to constrast with the approaches taken by other languages. There's far too much armchairing and bikeshedding involved in discussions about languages, and you have to admire a guy who has spent a sizeable chunk of his life trying something new like Nimrod's author, Andreas Rumpf.

If you're not a language nerd, a new language might provide a solution to an actual computing problem you are facing. (Who would have guessed?)
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 14, 2013, 06:29:42 PM
I was able to get the Nimrod IUP example to compile and run.

(http://files.allbasic.info/Nimrod/nimrod_iup.png)

Code: [Select]
# IupTabs: Creates a IupTabs control.

import iup

discard iup.Open(nil, nil)

var vbox1 = Iup.Vbox(Iup.Label("Inside Tab A"), Iup.Button("Button A", ""), nil)
var vbox2 = Iup.Vbox(Iup.Label("Inside Tab B"), Iup.Button("Button B", ""), nil)

Iup.SetAttribute(vbox1, "TABTITLE", "Tab A")
Iup.SetAttribute(vbox2, "TABTITLE", "Tab B")

var tabs1 = Iup.Tabs(vbox1, vbox2, nil)

vbox1 = Iup.Vbox(Iup.Label("Inside Tab C"), Iup.Button("Button C", ""), nil)
vbox2 = Iup.Vbox(Iup.Label("Inside Tab D"), Iup.Button("Button D", ""), nil)

Iup.SetAttribute(vbox1, "TABTITLE", "Tab C")
Iup.SetAttribute(vbox2, "TABTITLE", "Tab D")

var tabs2 = Iup.Tabs(vbox1, vbox2, nil)
Iup.SetAttribute(tabs2, "TABTYPE", "LEFT")

var box = Iup.Hbox(tabs1, tabs2, nil)
Iup.SetAttribute(box, "MARGIN", "10x10")
Iup.SetAttribute(box, "GAP", "10")

var dlg = Iup.Dialog(box)
Iup.SetAttribute(dlg, "TITLE", "IupTabs")
Iup.SetAttribute(dlg, "SIZE", "200x100")

discard Iup.ShowXY(dlg, IUP_CENTER, IUP_CENTER)
discard Iup.MainLoop()
Iup.Close()

jrs@laptop:~/nimrod/examples$ nimrod c -d:release iupex1.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: iupex1 [Processing]
Hint: iup [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/iupex1.o examples/nimcache/iupex1.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/system.o examples/nimcache/system.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/iup.o examples/nimcache/iup.c
gcc   -o /home/jrs/nimrod/examples/iupex1  examples/nimcache/iup.o examples/nimcache/system.o examples/nimcache/iupex1.o  -ldl
Hint: operation successful (8425 lines compiled; 0.498 sec total; 9.922MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./iupex1
jrs@laptop:~/nimrod/examples$ ls -l iupex1
-rwxrwxr-x 1 jrs jrs 24456 Sep 14 19:22 iupex1
jrs@laptop:~/nimrod/examples$

Here is the ScriptBasic IUP extension module version of the above.

Code: [Select]
' Creates a Iup::Tabs control.

IMPORT iup.bas

GLOBAL CONST IUP_CENTER = 0xFFFF

Iup::Open()

vbox1 = Iup::Vbox(Iup::Label("Inside Tab A"), Iup::Button("Button A", ""))
vbox2 = Iup::Vbox(Iup::Label("Inside Tab B"), Iup::Button("Button B", ""))

Iup::SetAttribute(vbox1, "TABTITLE", "Tab A")
Iup::SetAttribute(vbox2, "TABTITLE", "Tab B")

tabs1 = Iup::Tabs(vbox1, vbox2)

vbox1 = Iup::Vbox(Iup::Label("Inside Tab C"), Iup::Button("Button C", ""))
vbox2 = Iup::Vbox(Iup::Label("Inside Tab D"), Iup::Button("Button D", ""))

Iup::SetAttribute(vbox1, "TABTITLE", "Tab C")
Iup::SetAttribute(vbox2, "TABTITLE", "Tab D")

tabs2 = Iup::Tabs(vbox1, vbox2)
Iup::SetAttribute(tabs2, "TABTYPE", "LEFT")

box = Iup::Hbox(tabs1, tabs2)
Iup::SetAttribute(box, "MARGIN", "10x10")
Iup::SetAttribute(box, "GAP", "10")

dlg = Iup::Dialog(box)
Iup::SetAttribute(dlg, "TITLE", "IupTabs")
Iup::SetAttribute(dlg, "SIZE", "200x80")

Iup::ShowXY (dlg, IUP_CENTER, IUP_CENTER)
Iup::MainLoop ()
Iup::Close ()

END
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 15, 2013, 05:13:19 PM
Wow John, you are able to wrap your brain around things a lot faster than I can!  I am impressed.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 15, 2013, 06:37:57 PM
If you experiment (play) with enough languages, they all start looking the same.

Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 18, 2013, 10:48:59 PM
I thought I would try Nimrod under Windows XP.

(http://files.allbasic.info/Nimrod/wingui.png)

Code: [Select]
# test a Windows GUI application

import
  windows, shellapi, nb30, mmsystem, shfolder

#proc MessageBox(hWnd: int, lpText, lpCaption: CString, uType: uint): int
#  {stdcall, import: "MessageBox", header: "<windows.h>"}

discard MessageBox(0, "Hello World!", "Nimrod GUI Application", 0)

F:\Nimrod\examples>nimrod c -d:release wingui.nim
f:\nimrod\config\nimrod.cfg(36, 11) Hint: added path: 'C:\Documents and Settings\John\.babel\libs\' [Path]
Hint: used config file 'F:\Nimrod\config\nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: wingui [Processing]
Hint: windows [Processing]
Hint: shellapi [Processing]
Hint: nb30 [Processing]
Hint: mmsystem [Processing]
Hint: shfolder [Processing]
gcc.exe   -o f:\nimrod\examples\wingui.exe  f:\nimrod\examples\nimcache\shfolder.o f:\nimrod\examples\nimcache\mmsystem.o f:\
nimrod\examples\nimcache\nb30.o f:\nimrod\examples\nimcache\shellapi.o f:\nimrod\examples\nimcache\windows.o f:\nimrod\exampl
es\nimcache\system.o f:\nimrod\examples\nimcache\wingui.o
Hint: operation successful (35390 lines compiled; 21.982 sec total; 23.235MB) [SuccessX]

F:\Nimrod\examples>wingui
F:\Nimrod\examples>dir wingui.exe
 Volume in drive F is Dev
 Volume Serial Number is 0C60-620E

 Directory of F:\Nimrod\examples

09/18/2013  11:36 PM            79,023 wingui.exe
               1 File(s)         79,023 bytes
               0 Dir(s)  36,617,568,256 bytes free

F:\Nimrod\examples>

Nimrod also has an interpretive mode that is interesting.

F:\Nimrod\examples>nimrod i
f:\nimrod\config\nimrod.cfg(36, 11) Hint: added path: 'C:\Documents and Settings\John\.babel\libs\' [Path]
Hint: used config file 'F:\Nimrod\config\nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: stdin [Processing]
>>> echo "Hello World"
Hello World
>>> var x: int
>>> x = 123
>>> echo(x)
123
>>> quit()
f:\nimrod\examples\stdin(5, 5) Hint: quit() called [QuitCalled]

F:\Nimrod\examples>

This is a nice language feature. (From)

Quote
From statement

We have already seen the simple import statement that just imports all exported symbols. An alternative that only imports listed symbols is the from import statement:

from mymodule import x, y, z

Here is the Windows screen shot of the IUP tab demo. (same as the Linux code above)

(http://files.allbasic.info/Nimrod/iupnimwin.png)
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 19, 2013, 01:43:58 PM
Thanks John, I think I will download and try nimrod out once I install ubuntu on my netbook as dual boot instead of virtual machine.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 19, 2013, 01:47:03 PM
Let me know if you need any help getting there.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 19, 2013, 01:56:29 PM
John which version of Ubuntu are you using?

My netbook is a dual core AMD, but only 1gHz speed, I did upgrade the RAM to 4gb(max the netbook can take).
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 19, 2013, 02:12:51 PM
I run Ubuntu 12.04 LTS 64 bit on my Toshiba 64 bit dual core laptop.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 19, 2013, 02:32:35 PM
Thanks John, will try that out.
Title: ubuntu on messed up windows
Post by: kryton9 on September 20, 2013, 12:14:10 AM
I tried installing ubuntu, the 64 bit version would give an error, so downloaded and installed the 32 bit version.
Got ubuntu installed but it messed up my Windows boot and then when I went to repair Windows it messed up grub so I lost both ubuntu and windows.

Anyways, decided since things were messed up, just to play with ubuntu, so I did a clean install.

I finally got nimrod to compile and compiled the ide Aporia.  I can't get Aporia to run, probably because of missing dependencies but I get no messages.
I couldn't figure out how to get the dependencies in ubuntu. I tried apt-get "name of dependency" but no luck.

I copied and pasted your iup example code john in a text editor and save it as john.nim.  I got it to compile, but it won't run because I can't figure out how to get iup.
I read on the forums about how nimrod is useless without the module libraries and they were talking about coming up with a portable bundle. But I had no luck.

Here is the c code it generated however after the compile in release mode.

Code: C
  1. /* Generated by Nimrod Compiler v0.9.2 */
  2. /*   (c) 2012 Andreas Rumpf */
  3. /* The generated code is subject to the original license. */
  4. /* Compiled for: Linux, i386, gcc */
  5. /* Command for C compiler:
  6.    gcc -c  -w -O3 -fno-strict-aliasing  -I/home/k9/lib -o bin/nimrods/examples/nimcache/john.o bin/nimrods/examples/nimcache/john.c */
  7. #define NIM_INTBITS 32
  8. #include "nimbase.h"
  9. typedef struct ihandle67212 ihandle67212;
  10. typedef N_CDECL_PTR(int, TY67311) (int* argc, NCSTRING** argv);
  11. typedef N_CDECL_PTR(ihandle67212*, TY67680) (ihandle67212* child, ...);
  12. typedef N_CDECL_PTR(ihandle67212*, TY67789) (NCSTRING title);
  13. typedef N_CDECL_PTR(ihandle67212*, TY67773) (NCSTRING title, NCSTRING action);
  14. typedef N_CDECL_PTR(void, TY67476) (ihandle67212* ih, NCSTRING name, NCSTRING value);
  15. typedef N_CDECL_PTR(ihandle67212*, TY67820) (ihandle67212* child, ...);
  16. typedef N_CDECL_PTR(ihandle67212*, TY67698) (ihandle67212* child, ...);
  17. typedef N_CDECL_PTR(ihandle67212*, TY67782) (ihandle67212* child);
  18. typedef N_CDECL_PTR(int, TY67458) (ihandle67212* ih, int x, int y);
  19. typedef N_CDECL_PTR(int, TY67324) (void);
  20. typedef N_CDECL_PTR(void, TY67318) (void);
  21. struct ihandle67212 {
  22. char dummy;
  23. };
  24. static N_INLINE(void, initStackBottom)(void);
  25. N_NOINLINE(void, setStackBottom)(void* thestackbottom);
  26. N_NOINLINE(void, systemInit)(void);
  27. N_NOINLINE(void, systemDatInit)(void);
  28. N_NOINLINE(void, iupInit)(void);
  29. N_NOINLINE(void, iupDatInit)(void);
  30. N_NOINLINE(void, johnInit)(void);
  31. N_NOINLINE(void, johnDatInit)(void);
  32. extern TY67311 Dl_67310;
  33. ihandle67212* vbox1_70003;
  34. extern TY67680 Dl_67679;
  35. extern TY67789 Dl_67788;
  36. extern TY67773 Dl_67772;
  37. ihandle67212* vbox2_70005;
  38. extern TY67476 Dl_67475;
  39. ihandle67212* tabs1_70009;
  40. extern TY67820 Dl_67819;
  41. ihandle67212* tabs2_70015;
  42. ihandle67212* box_70018;
  43. extern TY67698 Dl_67697;
  44. ihandle67212* dlg_70022;
  45. extern TY67782 Dl_67781;
  46. extern TY67458 Dl_67457;
  47. extern TY67324 Dl_67323;
  48. extern TY67318 Dl_67317;
  49.  
  50. static N_INLINE(void, initStackBottom)(void) {
  51.         void* volatile locals;
  52.         locals = 0;
  53.         locals = ((void*) (&locals));
  54.         setStackBottom(locals);
  55. }
  56. int cmdCount;
  57. char** cmdLine;
  58. char** gEnv;
  59. N_CDECL(void, NimMain)(void) {
  60.         systemDatInit();
  61.         iupDatInit();
  62.         johnDatInit();
  63.         initStackBottom();
  64.         systemInit();
  65.         iupInit();
  66.         johnInit();
  67. }
  68. int main(int argc, char** args, char** env) {
  69.         cmdLine = args;
  70.         cmdCount = argc;
  71.         gEnv = env;
  72.         NimMain();
  73.         return nim_program_result;
  74. }
  75. N_NOINLINE(void, johnInit)(void) {
  76.         int LOC1;
  77.         ihandle67212* LOC2;
  78.         ihandle67212* LOC3;
  79.         ihandle67212* LOC4;
  80.         ihandle67212* LOC5;
  81.         ihandle67212* LOC6;
  82.         ihandle67212* LOC7;
  83.         ihandle67212* LOC8;
  84.         ihandle67212* LOC9;
  85.         int LOC10;
  86.         int LOC11;
  87.         LOC1 = Dl_67310(NIM_NIL, NIM_NIL);
  88.         LOC2 = Dl_67788("Inside Tab A");
  89.         LOC3 = Dl_67772("Button A", "");
  90.         vbox1_70003 = Dl_67679(LOC2, LOC3, NIM_NIL);
  91.         LOC4 = Dl_67788("Inside Tab B");
  92.         LOC5 = Dl_67772("Button B", "");
  93.         vbox2_70005 = Dl_67679(LOC4, LOC5, NIM_NIL);
  94.         Dl_67475(vbox1_70003, "TABTITLE", "Tab A");
  95.         Dl_67475(vbox2_70005, "TABTITLE", "Tab B");
  96.         tabs1_70009 = Dl_67819(vbox1_70003, vbox2_70005, NIM_NIL);
  97.         LOC6 = Dl_67788("Inside Tab C");
  98.         LOC7 = Dl_67772("Button C", "");
  99.         vbox1_70003 = Dl_67679(LOC6, LOC7, NIM_NIL);
  100.         LOC8 = Dl_67788("Inside Tab D");
  101.         LOC9 = Dl_67772("Button D", "");
  102.         vbox2_70005 = Dl_67679(LOC8, LOC9, NIM_NIL);
  103.         Dl_67475(vbox1_70003, "TABTITLE", "Tab C");
  104.         Dl_67475(vbox2_70005, "TABTITLE", "Tab D");
  105.         tabs2_70015 = Dl_67819(vbox1_70003, vbox2_70005, NIM_NIL);
  106.         Dl_67475(tabs2_70015, "TABTYPE", "LEFT");
  107.         box_70018 = Dl_67697(tabs1_70009, tabs2_70015, NIM_NIL);
  108.         Dl_67475(box_70018, "MARGIN", "10x10");
  109.         Dl_67475(box_70018, "GAP", "10");
  110.         dlg_70022 = Dl_67781(box_70018);
  111.         Dl_67475(dlg_70022, "TITLE", "IupTabs");
  112.         Dl_67475(dlg_70022, "SIZE", "200x100");
  113.         LOC10 = Dl_67457(dlg_70022, ((int) 65535), ((int) 65535));
  114.         LOC11 = Dl_67323();
  115.         Dl_67317();
  116. }
  117.  
  118. N_NOINLINE(void, johnDatInit)(void) {
  119. }
  120.  

Will try again tomorrow after some sleep. Maybe better luck then.

Screenshot of trying to get IUP, don't know what is wrong? Any help would be appreciated John, thanks in advance.


X
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: Charles Pegge on September 20, 2013, 01:04:46 AM

Simple practical test for a programming language: Search for it using Google images :)
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 20, 2013, 07:44:49 AM
You will need to download and install the IUP libraries from the IUP site. (selecting the proper distribution for your OS) Unzip the the archives (IUP & CD) to a temp directory. Within these directories is an install.sh and a install-dev.sh script to actually install IUP/CD in the proper system directories. (use sudo)

Note I had to change the Nimrod IUP support file to indicate I was running IUP 3.8. Change the IF Linux logic to use libiup.so eliminating the version numbers within the parentheses.

Have you already installed development essentials? (assuming you did if you got Nimrod to compile)
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 20, 2013, 11:05:56 PM
Kent,

Here is a simple Gtk Nimrod Linux example.


(http://files.allbasic.info/Nimrod/smnimwin.png)

ex5.nim
Code: [Select]
import
  glib2, gtk2

proc destroy(widget: pWidget, data: pgpointer){.cdecl.} =
  main_quit()

proc widgetDestroy(w: PWidget) {.cdecl.} =
  destroy(w)

nimrod_init()
var window = window_new(WINDOW_TOPLEVEL)
var button = button_new("Click me")
set_border_width(Window, 5)
add(window, button)
discard signal_connect(window, "destroy",
                       SIGNAL_FUNC(ex5.destroy), nil)
discard signal_connect_object(button, "clicked",
                              SIGNAL_FUNC(widgetDestroy),
                              window)
show(button)
show(window)
main()
Title: Nimrod: Tuples are Structures
Post by: JRS on September 21, 2013, 10:06:37 PM
Code: [Select]
type
    TPerson = tuple [name: string, age:int]

proc result(): TPerson = ("Bob",42)

var r = result()
echo(r)             # default stringification
echo (r.name)       # access by field name
var (name,age) = r  # tuple unpacking
echo (name,"|",age)

jrs@laptop:~/nimrod/examples$ nimrod c -d:release tuple.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: tuple [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/tuple.o examples/nimcache/tuple.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/system.o examples/nimcache/system.c
gcc   -o /home/jrs/nimrod/examples/tuple  examples/nimcache/system.o examples/nimcache/tuple.o  -ldl
Hint: operation successful (7450 lines compiled; 3.350 sec total; 8.870MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./tuple
(name: Bob, age: 42)
Bob
Bob|42
jrs@laptop:~/nimrod/examples$
Title: Nimrod: A new head
Post by: JRS on September 21, 2013, 10:35:12 PM
A Nimrod version of the Linux head console command.

Code: [Select]
import parseopt
from strutils import parseInt
from os import existsFile

const usage = """
head [flags] filename
  -n: number of lines (default 10)
  -h,--help: this help
  -v,--version: version
"""

proc showUsage(msg: string) =
  if msg != nil: echo("head: ",msg)
  quit(usage,1)
  
proc head(file: string, n: int) =
  if not existsFile(file):  quit("file " & file & " does not exist")
  var
    f = open(file)
    i = 0
  for line in f.lines:
    echo(line)
    i += 1
    if i == n: break
  
proc parseCommands() =
  var
    files: seq[string]
    n = 10
  newSeq(files,0)
  for kind, key, val in getopt():
    case kind
    of cmdArgument:
      files.add(key)
    of cmdLongOption, cmdShortOption:
      case key
      of "help", "h": showUsage(nil)
      of "n":
        n = parseInt(val)
      of "version", "v":
          echo("1.0")
          return
    of cmdEnd: assert(false) # cannot happen
  if len(files) == 0:
    # no filename has been given, so we show the help:
    showUsage("please supply filename")
  if len(files) == 1:
    head(files[0],n)
  else:
    for f in files:
      echo("----- ",f)
      head(f,n)
  
parseCommands()

jrs@laptop:~/nimrod/examples$ nimrod c -d:release nhead.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: nhead [Processing]
Hint: parseopt [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/nhead.o examples/nimcache/nhead.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/parseopt.o examples/nimcache/parseopt.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/os.o examples/nimcache/os.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/strutils.o examples/nimcache/strutils.c
gcc   -o /home/jrs/nimrod/examples/nhead  examples/nimcache/posix.o examples/nimcache/times.o examples/nimcache/parseutils.o examples/nimcache/strutils.o examples/nimcache/os.o examples/nimcache/parseopt.o examples/nimcache/system.o examples/nimcache/nhead.o  -ldl
Hint: operation successful (14375 lines compiled; 0.569 sec total; 15.158MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./nhead -n=5 nhead.nim
import parseopt
from strutils import parseInt
from os import existsFile

const usage = """
jrs@laptop:~/nimrod/examples$
jrs@laptop:~/nimrod/examples$ ls -l nhead
-rwxrwxr-x 1 jrs jrs 67253 Sep 21 23:34 nhead
jrs@laptop:~/nimrod/examples$

Title: Nimrod: Has class
Post by: JRS on September 21, 2013, 11:24:24 PM
Quote
Here we are making objects which are references (by default they are value types, like tuples, unlike java), initialized with the standard procedure new. Note the Pascal-like special variable result in procedures!

As expected, you may pass Germans to sayit, because a German is a person, but greeting has to be declared as a method for this to work; if it were a proc, we would get a warning about the second greeting being unused, and Germans are then addressed in English.

The cool thing about multi-methods is that they restore symmetry; a traditional polymorphic call a.foo(b) is only polymorphic in a. This makes sense in a language where dot method notation is just sugar for procedure calls where the first argument matches the type.

Code: [Select]
type
    TPerson = object of TObject
        name: string
        age: int

proc setPerson(p: ref TPerson, name: string, age:int) =
    p.name = name
    p.age = age

proc newPerson(name: string, age:int): ref TPerson =
    new(result)
    result.setPerson(name,age)

method greeting(p: ref TPerson):string = "Hello " & p.name & ", age " & $p.age

type
    TGerman = object of TPerson

proc newGerman(name: string, age:int): ref TGerman =
    new(result)
    result.setPerson(name,age)

method greeting(p: ref TGerman):string = "Hallo " & p.name & ", " & $p.age & " Jahre alt"

var john = newPerson("John",60)
var rene = newGerman("Rene",43)

proc sayit(p: ref TPerson) = echo p.greeting

sayit(john)
sayit(rene)

jrs@laptop:~/nimrod/examples$ nimrod c -d:release class.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: class [Processing]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/class.o examples/nimcache/class.c
gcc   -o /home/jrs/nimrod/examples/class  examples/nimcache/system.o examples/nimcache/class.o  -ldl
Hint: operation successful (7468 lines compiled; 0.297 sec total; 8.870MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./class
Hello John, age 60
Hallo Rene, 43 Jahre alt
jrs@laptop:~/nimrod/examples$
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: kryton9 on September 21, 2013, 11:30:44 PM
John, I am going to hold off on nimrod till I get better in Ubuntu usage.  I got dual boot windows7 64bit and ubuntu 12.04 64 bit working today.
Found this neat program for multi booting, http://neosmart.net/EasyBCD/

I did a clean install of Ubuntu, then I partitioned a drive D in ntfs and made an unused area for later Windows install.

I installed windows 7 today hoping it would see ubuntu and offer dual boot, but it didn't.

Then I found EasyBCD and was able to set it all up to see my ubuntu and boot into windows by default after so many seconds.

Having drive D as ntfs is nice because I can access a lot of common files both in Ubuntu and Windows now like Oxygen.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 21, 2013, 11:46:19 PM
Thanks for the update. I'll keep a light on for you.

(http://www.historyplace.com/worldwar2/defeat/d-day-invasion-atlantic-watch.jpg)
Title: Nimrod: Looks like SB
Post by: JRS on September 22, 2013, 12:49:32 AM
The more I play with Nimrod the more ScriptBasic parallels in a lot of ways.


I have to say that BaCon has some serious (open source) competition in the HLL (High Level Language) to C arena.
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: Charles Pegge on September 22, 2013, 01:11:09 AM

This is how I would do the polymorphic OOP example in Oxygen:

Code: [Select]
class person
  string name
  int age
  'default methods:
  method sayit() as string
  return "Hi " & name & ", age " & age
  end method
  '
end class

class EnglishSpeaker
  person
  method sayit() as string
  return "Hello " & name & ", age " & age
  end method
end class

class GermanSpeaker
  person
  method sayit() as string
  return "Hallo " & name & ", " & age & " Jahre alt"
  end method
end class

let anon=Person         : anon = {"Anonymous",42}
let john=EnglishSpeaker : john = {"John",60}
let rene=GermanSpeaker  : rene = {"Rene",43}

def sayit %1.sayit

print sayit john
print sayit rene
print sayit anon
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 22, 2013, 01:50:02 AM
Cool!

Nice to see O2 show off its OOP style compared to other approaches.

I'm beginning to see some synergy developing among us.
Title: Re: Nimrod: All BASIC Development forum
Post by: JRS on September 22, 2013, 08:57:56 AM
I'm forking this thread to the All BASIC forum (translator board) so the project isn't a distraction to the O2 forum.

FYI Nimrod has a C header conversion tool that might be useful for the O2 project.

@Kent - It would be great if you would join us on All BASIC. (Charles is a member) Just send me an e-mail and I'll set you up.

Title: Re: Nimrod: Aporia IDE
Post by: JRS on September 22, 2013, 09:39:34 AM
Nimrod has a IDE (Aporia) that is written in Nimrod. Aporia uses GTK as the default toolkit and the gtksourceview for the text editor component. Its not only a nice IDE but the Nimrod source is a great reference in itself.

(http://files.allbasic.info/Nimrod/aporia.png)

Code: [Select]
jrs@laptop:~/nimrod/Aporia-master$ nimrod c -d:release aporia.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: used config file '/home/jrs/nimrod/Aporia-master/aporia.nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: aporia [Processing]
Hint: glib2 [Processing]
Hint: gtk2 [Processing]
Hint: atk [Processing]
Hint: pango [Processing]
Hint: gdk2pixbuf [Processing]
Hint: gdk2 [Processing]
Hint: gtksourceview [Processing]
Hint: dialogs [Processing]
Hint: os [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: times [Processing]
Hint: posix [Processing]
Hint: osproc [Processing]
Hint: strtabs [Processing]
Hint: hashes [Processing]
Hint: streams [Processing]
Hint: pegs [Processing]
Hint: unicode [Processing]
Hint: parseopt [Processing]
Hint: asyncio [Processing]
Hint: sockets [Processing]
Hint: encodings [Processing]
Hint: tables [Processing]
Hint: math [Processing]
Hint: algorithm [Processing]
Hint: settings [Processing]
Hint: utils [Processing]
Hint: AboutDialog [Processing]
Hint: CustomStatusBar [Processing]
Aporia-master/CustomStatusBar.nim(92, 11) Hint: 'tid' is declared but not used [XDeclaredButNotUsed]
Aporia-master/utils.nim(494, 11) Info: instantiation from here
lib/pure/pegs.nim(873, 14) Warning: injected 'matches' might be affected by new scoping rules in 0.9.4 [User]
Hint: cfg [Processing]
Hint: parsecfg [Processing]
Hint: lexbase [Processing]
Hint: search [Processing]
Hint: re [Processing]
Hint: pcre [Processing]
Aporia-master/search.nim(60, 14) Hint: 'brackets' is declared but not used [XDeclaredButNotUsed]
Aporia-master/search.nim(120, 13) Hint: 'matches' is declared but not used [XDeclaredButNotUsed]
Hint: suggest [Processing]
Hint: processes [Processing]
Aporia-master/processes.nim(145, 14) Info: instantiation from here
lib/pure/pegs.nim(873, 14) Warning: injected 'matches' might be affected by new scoping rules in 0.9.4 [User]
Aporia-master/processes.nim(162, 19) Info: instantiation from here
lib/pure/pegs.nim(873, 14) Warning: injected 'matches' might be affected by new scoping rules in 0.9.4 [User]
Aporia-master/processes.nim(334, 18) Warning: thread analysis incomplete due to unknown call 'echod(["[Thread] Process already running"])' [AnalysisLoophole]
Aporia-master/processes.nim(339, 12) Info: instantiation from here
lib/pure/streams.nim(42, 41) Warning: thread analysis incomplete due to unknown call 's.closeImpl(s)' [AnalysisLoophole]
Aporia-master/processes.nim(349, 17) Info: instantiation from here
lib/pure/streams.nim(51, 23) Warning: thread analysis incomplete due to unknown call 's.atEndImpl(s)' [AnalysisLoophole]
Aporia-master/processes.nim(352, 21) Info: instantiation from here
lib/pure/streams.nim(185, 21) Info: instantiation from here
lib/pure/streams.nim(123, 14) Info: instantiation from here
lib/pure/streams.nim(76, 26) Warning: thread analysis incomplete due to unknown call 's.readDataImpl(s, buffer, bufLen)' [AnalysisLoophole]
Hint: rst [Processing]
Hint: rstast [Processing]
lib/packages/docutils/rst.nim(853, 20) Hint: 'dkAuthor' is declared but not used [XDeclaredButNotUsed]
lib/packages/docutils/rst.nim(1362, 6) Hint: 'rst.$(t: TToken): string' is declared but not used [XDeclaredButNotUsed]
lib/packages/docutils/rst.nim(853, 31) Hint: 'dkAuthors' is declared but not used [XDeclaredButNotUsed]
Aporia-master/suggest.nim(66, 12) Warning: get_size is deprecated, get_width should be used [User]
Aporia-master/suggest.nim(277, 13) Hint: 'f' is declared but not used [XDeclaredButNotUsed]
Aporia-master/suggest.nim(412, 12) Hint: 'lang' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1066, 26) Hint: 'startOldLineOffset' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1204, 27) Hint: 'cfgFile' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1610, 10) Hint: 'cmpB' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1832, 14) Hint: 'OpenItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1842, 16) Hint: 'SearchItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1839, 14) Hint: 'RedoItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1829, 17) Hint: 'NewFileItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1834, 14) Hint: 'SaveItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(1837, 14) Hint: 'UndoItem' is declared but not used [XDeclaredButNotUsed]
Aporia-master/aporia.nim(179, 16) Hint: 'aporia.saveAllTabs()' is declared but not used [XDeclaredButNotUsed]
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/aporia.o Aporia-master/nimcache/aporia.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/system.o Aporia-master/nimcache/system.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/glib2.o Aporia-master/nimcache/glib2.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/gtk2.o Aporia-master/nimcache/gtk2.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/atk.o Aporia-master/nimcache/atk.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/pango.o Aporia-master/nimcache/pango.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/gdk2pixbuf.o Aporia-master/nimcache/gdk2pixbuf.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/gdk2.o Aporia-master/nimcache/gdk2.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/gtksourceview.o Aporia-master/nimcache/gtksourceview.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/dialogs.o Aporia-master/nimcache/dialogs.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/os.o Aporia-master/nimcache/os.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/strutils.o Aporia-master/nimcache/strutils.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/parseutils.o Aporia-master/nimcache/parseutils.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/times.o Aporia-master/nimcache/times.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/posix.o Aporia-master/nimcache/posix.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/osproc.o Aporia-master/nimcache/osproc.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/strtabs.o Aporia-master/nimcache/strtabs.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/hashes.o Aporia-master/nimcache/hashes.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/streams.o Aporia-master/nimcache/streams.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/pegs.o Aporia-master/nimcache/pegs.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/unicode.o Aporia-master/nimcache/unicode.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/parseopt.o Aporia-master/nimcache/parseopt.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/asyncio.o Aporia-master/nimcache/asyncio.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/sockets.o Aporia-master/nimcache/sockets.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/encodings.o Aporia-master/nimcache/encodings.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/tables.o Aporia-master/nimcache/tables.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/math.o Aporia-master/nimcache/math.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/algorithm.o Aporia-master/nimcache/algorithm.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/settings.o Aporia-master/nimcache/settings.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/utils.o Aporia-master/nimcache/utils.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/AboutDialog.o Aporia-master/nimcache/AboutDialog.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/CustomStatusBar.o Aporia-master/nimcache/CustomStatusBar.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/cfg.o Aporia-master/nimcache/cfg.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/parsecfg.o Aporia-master/nimcache/parsecfg.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/lexbase.o Aporia-master/nimcache/lexbase.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/search.o Aporia-master/nimcache/search.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/re.o Aporia-master/nimcache/re.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/pcre.o Aporia-master/nimcache/pcre.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/suggest.o Aporia-master/nimcache/suggest.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/processes.o Aporia-master/nimcache/processes.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/rst.o Aporia-master/nimcache/rst.c
gcc -c -w -pthread -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o Aporia-master/nimcache/rstast.o Aporia-master/nimcache/rstast.c
gcc   -o /home/jrs/nimrod/Aporia-master/aporia  Aporia-master/nimcache/rstast.o Aporia-master/nimcache/rst.o Aporia-master/nimcache/processes.o Aporia-master/nimcache/suggest.o Aporia-master/nimcache/pcre.o Aporia-master/nimcache/re.o Aporia-master/nimcache/search.o Aporia-master/nimcache/lexbase.o Aporia-master/nimcache/parsecfg.o Aporia-master/nimcache/cfg.o Aporia-master/nimcache/CustomStatusBar.o Aporia-master/nimcache/AboutDialog.o Aporia-master/nimcache/utils.o Aporia-master/nimcache/settings.o Aporia-master/nimcache/algorithm.o Aporia-master/nimcache/math.o Aporia-master/nimcache/tables.o Aporia-master/nimcache/encodings.o Aporia-master/nimcache/sockets.o Aporia-master/nimcache/asyncio.o Aporia-master/nimcache/parseopt.o Aporia-master/nimcache/unicode.o Aporia-master/nimcache/pegs.o Aporia-master/nimcache/streams.o Aporia-master/nimcache/hashes.o Aporia-master/nimcache/strtabs.o Aporia-master/nimcache/osproc.o Aporia-master/nimcache/posix.o Aporia-master/nimcache/times.o Aporia-master/nimcache/parseutils.o Aporia-master/nimcache/strutils.o Aporia-master/nimcache/os.o Aporia-master/nimcache/dialogs.o Aporia-master/nimcache/gtksourceview.o Aporia-master/nimcache/gdk2.o Aporia-master/nimcache/gdk2pixbuf.o Aporia-master/nimcache/pango.o Aporia-master/nimcache/atk.o Aporia-master/nimcache/gtk2.o Aporia-master/nimcache/glib2.o Aporia-master/nimcache/system.o Aporia-master/nimcache/aporia.o  -ldl -pthread -lm
Hint: operation successful (60707 lines compiled; 14.303 sec total; 90.926MB) [SuccessX]
jrs@laptop:~/nimrod/Aporia-master$
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: Aurel on September 22, 2013, 11:08:11 AM
Hmmm
I see this but i don't know why not work on windows version,probably because of some
problems with GTK.
Title: Re: Nimrod: All BASIC Development forum
Post by: kryton9 on September 22, 2013, 11:26:58 AM
I'm forking this thread to the All BASIC forum (translator board) so the project isn't a distraction to the O2 forum.

FYI Nimrod has a C header conversion tool that might be useful for the O2 project.

@Kent - It would be great if you would join us on All BASIC. (Charles is a member) Just send me an e-mail and I'll set you up.

THanks John for the invite. I went to ALL BASIC forum and it looked it was for language developers. So I just browse as guest, but if I can
join, yes I will send a request from there. Especially to follow your impressive work Nimrod and getting so far a long.

Too show you how bad I am at with Linux, I couldn't even get scriptbasic to run in ubuntu. I downloaded it as mentioned, unzipped it, but
when I ran the command line instruction if couldn't find the file.  I then looked in the repositories for it and no luck either.
I always see on many video people using apt-get install and was always jealous on how easy that was at it put and did everything for you.
And everything I get that way works fine, but nimrod and scriptbasic don't have apt-get install scripts and it is tough.

Anyways, I think nimrod will be a good language to use for my help system if I can get it working. Thanks for your encouraging progress on Nimrod.
Title: Re: Nimrod: All BASIC Development forum - SB install
Post by: JRS on September 22, 2013, 11:53:01 AM
Hi Kent,

I registered you on All BASIC with the same user ID and e-mail address you are using here. A temporary password was sent to get you in. You can change both user ID and password to your preference.

Welcome!

Lets assume you unzipped you SB archive in /home/kent/scriptbasic. All you need to do to get scriba to run from anywhere is point your search path to the SB bin directory.

Code: [Select]
export PATH=$PATH:/home/kent/scriptbasic/bin

You can add these startup commands to your login shell profile once you get settled in.

John
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 22, 2013, 12:09:37 PM
Hmmm
I see this but i don't know why not work on windows version,probably because of some
problems with GTK.


Make sure you have all your dependencies installed/accessible. (dev versions and runtime) Did you find a Windows version of the gtksourceview widget?

Title: Re: Nimrod: An interesting language that might interest you guys
Post by: Aurel on September 22, 2013, 03:00:44 PM
Yeah..
maybe i download wrong version

Quote
minimal installer for Windows XP/Vista/7 (i386, 32bit): download/nimrod_gamera_0.9.2.exe ("Gamera edition": includes only a minimal GCC)

maybe i will try :
Quote
installer for Windows XP/Vista/7 (i386, 32bit): download/nimrod_0.9.2.exe (includes GCC and everything else you need)

heh...
for example seed7 for windows work like a charm....

X
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 22, 2013, 03:39:41 PM
Sorry, I don't have much interest in Nimrod on Windows at this time. OxygenBasic is my preferred compiler on that platform.

Title: Re: Nimrod: All BASIC Development forum - SB install
Post by: kryton9 on September 22, 2013, 07:57:34 PM
...Lets assume you unzipped you SB archive in /home/kent/scriptbasic. All you need to do to get scriba to run from anywhere is point your search path to the SB bin directory.
Code: [Select]
export PATH=$PATH:/home/kent/scriptbasic/bin
...You can add these startup commands to your login shell profile once you get settled in.
John

Thanks John, will try it out tonight!
Title: Re: Nimrod: An interesting language that might interest you guys
Post by: JRS on September 22, 2013, 08:44:09 PM
One thing I should mention and will be changed in the next SB 2.2 beta release is the SB include path in the configuration file doesn't work like the module path as relative to where scriba is started from. The include path is relative to where you are not where scriba lives. Once you decide where you are going to install ScriptBasic, edit the SB configuration file and use full paths for the module and include paths.  

Here is my SB startup script I run after opening a terminal window.

Code: [Select]
export PATH=/home/jrs/sb/sb22/bin:$PATH
export SCRIBACONF=/home/jrs/sb/sb22/bin/basic.conf
export UBUNTU_MENUPROXY=0

Note the last entry is because I use the classic shell and not Unity. This prevents a client area size display issue with IUP.

To rebuild your basic.conf file to its binary form, follow these steps.

You can dump the current SB configuration to the screen or file (scriba -D > basic.conf.txt) and edit it in gedit. To convert the text file version of the basic.conf to its binary form, scriba -k basic.conf.txt will create a binary form where ever SCRIBACONF path points to. Just type scriba at the command line for a list of switches.

Title: A Peek into Nimrod's Compiler
Post by: kryton9 on September 24, 2013, 09:25:27 PM
Charles and Peter, you guys might be interested in looking at this. It is all about the Nimrod Compiler and hacking it.
http://nimrod-code.org/intern.html
Title: A Peek into Nimrod's Translator
Post by: JRS on September 24, 2013, 10:31:06 PM
Correction: Hacking the Nimrod translator. Nimrod generates C code by default.