Oxygen Basic

Programming => Example Code => General => Topic started by: Arnold on February 23, 2015, 06:09:35 AM

Title: Checking some demos?
Post by: Arnold on February 23, 2015, 06:09:35 AM
Hi Charles,

there are some demos which would work with only minor changes. Maybe you will check these?

c:\oxygenbasic\examples\DataProcessing\CommaFormat.o2bas:
   line 8 needs round(v) -- conforming to HelpFile
EvalExpr2.o2bas:
   line 95 needs case else
c:\oxygenbasic\examples\DLLs\EmbedFile32.o2bas:
   parameters for embedfile not correct, t.txt must exist
c:\oxygenbasic\examples\UseRTL32\FBO2DLLtest\dll_math_o2.o2bas:
   the first lines must be adapted to create a dll file. I did not test with Freebasic.

In c:\oxygenbasic\projectsA\InProgress\Physics there is zone.o2bas which includes wFunc.h. Can I find this file anywhere?

Is there a special reason why you keep an older verson of console.inc in \projectsA\LeanLisp? If I delete this file and adapt the include statements in some of the demos they work ok too (I think). Lispish3UseDll.o2bas gives a GPF at the end.

Roland




Title: Re: Checking some demos?
Post by: Arnold on February 23, 2015, 04:42:53 PM
Hi Charles,

it is amazing. You already fixed everything. Please do not forget to modify the example for embedfile in a future Oxygen Helpfile.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on February 23, 2015, 09:19:58 PM

Fixed or removed :)

I have moved most of the Language projects to ProjectsC

A minimal version of Oxygen is now available. It contains the main directory, inc files and help.

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip

OxyMin Update (900k)
http://www.oxygenbasic.org/o2zips/OxyMin.zip

OxygenBasic Full Update (4700k)
http://www.oxygenbasic.org/o2zips/OxygenBasic.zip
Title: Re: Checking some demos?
Post by: Arnold on February 27, 2015, 01:42:43 AM
Hi Charles,

exploring the demos with asm instructions I found four programs which behave differently:

c:\oxygenbasic\examples\Asm32
---------------------------
repne.o2bas

 ; ASM ERR:    lea esi,[@a+offs]!!  Expecting  ']'
 ; AFTER:      ._main
 ; LINE:       18

c:\oxygenbasic\examples\MetaProg
---------------------------
MetaVal.o2bas

 ; ASM ERR:    mov ecx,[eax*4+@a+m*2]!!  Expecting  ']'
 ; AFTER:      ._main
 ; LINE:       30

Most of the demos use instructions like:

  lea edi,[ebp-4]  lea edx,[eax+2]  lea eax,[ph]  lea edx,stack  lea esi,pp  lea eax,cap

so I do not know if @a+offset must be resolved with some other instructions now?

c:\oxygenbasic\examples\Diagnostics
---------------------------
RegTrace.o2bas

 ; ASM ERR:    popad mov eax,1  pushad!!  Junk after instruction: popad

 ; AFTER:      ._over_
 ; LINE:       45

if I use:

  def SHOW
  #define MSG
  def FLAGS
  #define x

the demo runs as expected. Is there a difference between def and #define?

c:\oxygenbasic\src\InProgress
---------------------------
concatenate.o2bas

 ; ASM ERR:    enc edx!!  Unidentified instruction: enc
 ; AFTER:      .z1bytelen
 ; LINE:       59

Is this simply a typo and inc should be used?

Btw I find the error messages very useful. Most of the time they lead to the line with the critical problem.


Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on February 27, 2015, 03:43:46 AM
Hi Roland,

Thank you again for reporting these breakages.

The @ offset syntax is obsolete, so I have altered repne.o2bas, and dumped metavel.o2bas

Example:

lea esi,[@a+40]

should be replaced by

addr esi,a
add esi,40



#define follows C lexing rules, but macro is very similar in functionality.

%,  def,  #def behave like DOS macros, with optional %1 %2 %3 ... parameters




RegTrace with block format def:
Code: OxygenBasic
  1. '
  2. '-----------------------------------
  3. 'TRACING EXECUTION OF ASSEMBLY CODE
  4. 'INSPECT REGISTERS AFTER INSTRUCTION
  5. '===================================
  6.  
  7.  
  8.    
  9.   '----------------
  10.  'DIAGNOSTIC MACROS
  11.  '================
  12.    
  13.   def SHOW
  14.     pushad : mov a,%1 : print "%1: " hex a : popad
  15.   end def
  16.   '
  17.  def MSG
  18.     pushad : print %1 : popad
  19.   end def
  20.   '
  21.  def FLAGS
  22.     pushad : pushf : pushf : pop eax : mov a,eax : print "Flag Register: " hex a : popf : popad
  23.   end def
  24.   '
  25.  def x
  26.     : pushad : pushf : call showregs : popf : popad :
  27.   end def
  28.  
  29.  
  30.   dim a
  31.  
  32.   sub showregs()
  33.     dim as long v(9) at [ebp+8]
  34.     dim as string tab=chr 9
  35.     print "
  36.     Registers:
  37.    
  38.     EAX:   " tab hex (v(9)) "
  39.     ECX:   " tab hex (v(8)) "
  40.     EDX:   " tab hex (v(7)) "
  41.     EBX:   " tab hex (v(6)) "
  42.     ESP:   " tab hex (v(5)) "
  43.     EBP:   " tab hex (v(4)) "
  44.     ESI:   " tab hex (v(3)) "
  45.     EDI:   " tab hex (v(2)) "
  46.     EFLAGS:  " hex (v(1)) "
  47.     "
  48.   end sub
  49.  
  50.   '--------  
  51.  'ASM TEST
  52.  '========
  53.  
  54.   'PLACE "x" AT ANY INSTRUCTION TO SEE THE REGISTER CONTENTS
  55.  
  56.   mov ecx,0
  57.   X mov eax,1 X
  58.   cmp eax,0 X
  59.   'FLAGS
  60.  jz nif
  61.     'MSG "condition Not met"
  62.    mov ecx,1
  63.   nif:
  64.   'SHOW ecx
  65.  
  66.  


enc inc edx :)



Title: Re: Checking some demos?
Post by: Arnold on February 27, 2015, 08:04:07 AM
Hi Charles,

thank you for the explanation. I assume in RegTrace I can use these combinations:

  SHOW Reg
  MSG Reg
  FLAGS

and it should be possible to use console.inc to print the results in a console window?

Roland

Title: Re: Checking some demos?
Post by: Charles Pegge on February 27, 2015, 08:40:21 AM
Sure,

Improved layout, and console output:

Code: Text
  1. '
  2. '-----------------------------------
  3. 'TRACING EXECUTION OF ASSEMBLY CODE
  4. 'INSPECT REGISTERS AFTER INSTRUCTION
  5. '===================================
  6.  
  7.   includepath "$\inc\"
  8.   include     "console.inc"
  9.    
  10.   '----------------
  11.   'DIAGNOSTIC MACROS
  12.   '================
  13.    
  14.   def SHOW
  15.     pushad : mov a,%1 : printl "%1: " hex a : popad
  16.   end def
  17.   '
  18.   def MSG
  19.     pushad : printl %1 : popad
  20.   end def
  21.   '
  22.   def FLAGS
  23.     pushad : pushf : pushf : pop eax : mov a,eax : printl "Flag Register: " hex a : popf : popad
  24.   end def
  25.   '
  26.   def x
  27.     : pushad : pushf : call showregs : popf : popad :
  28.   end def
  29.  
  30.  
  31.   dim a
  32.  
  33.   sub showregs()
  34.     dim as long v(9) at [ebp+8]
  35.     dim as string tab=chr 9
  36.     printl "
  37.     Registers:
  38.    
  39.     EAX:   " tab hex (v(9),8) "
  40.     ECX:   " tab hex (v(8),8) "
  41.     EDX:   " tab hex (v(7),8) "
  42.     EBX:   " tab hex (v(6),8) "
  43.     ESP:   " tab hex (v(5),8) "
  44.     EBP:   " tab hex (v(4),8) "
  45.     ESI:   " tab hex (v(3),8) "
  46.     EDI:   " tab hex (v(2),8) "
  47.     EFLAGS:" tab hex (v(1),4) "
  48.     "
  49.   end sub
  50.  
  51.   '--------  
  52.   'ASM TEST
  53.   '========
  54.  
  55.   'PLACE "x" AT ANY INSTRUCTION TO SEE THE REGISTER CONTENTS
  56.  
  57.   mov ecx,0
  58.   X mov eax,1 X
  59.   cmp eax,0 X
  60.   'FLAGS
  61.   jz nif
  62.     'MSG "condition Not met"
  63.     mov ecx,1
  64.   nif:
  65.   'SHOW ecx
  66.  
  67. waitkey
  68.  
Title: Re: Checking some demos?
Post by: Arnold on March 03, 2015, 07:26:18 AM
Hi Charles,

learning about OxygenBasic and exploring the demos in projectsB\RosettaCode I found some programs which did not work as expected. I tried with Vista 32bit and Win7 64bit using Oxygenbasic Version: A40 19:30 25/02/2015
 
1) CompileTime.o2bas

ERROR:   Unidentified operand
WORD:    pling10
LINE:    
PASS:    1

if I delete quote and replace ===Source=== with " then the demo works.

2) ConstrainedGenericity.o2bas

Linker found unidentified names:
food:   level 0
food:   level 0

in line 6 there is: enum food foodlist
in the TEST section you use:
Hamper.put food.pudding,large,several
Hamper.put food.pie,huge,few
but I have no idea what should happen?
 
3) Evolution.o2bas

ERROR:   Syntax:[ebx+0x1004]
WORD:    le
LINE:    6
PASS:    1

le is given in line 5 and line 6

4) LibraryFunctions.o2bas

ERROR:   parameters mismatch for procedure string:
params given :

OPTIONS:
string(sys,sys) returns string
string(sys,zstring) returns string
string(sys,string) returns string

WORD:    string
LINE:    5
PASS:    1

If I comment out the first declaration then the demo works.

5) RunTimeLoadLib.o2bas

Error:
ERROR:   Must refer to a proc pointer: messagebox
WORD:    messagebox
LINE:    9
PASS:    2

I do not know why this does not work.

Some demos do not work at all.

6) Accumfactory.o2bas:
7) ActiveObject.o2bas:
8  RetVals.o2bas
gxo2.exe / co2.exe crashes . Win7 64bit shows gxo2.exe in the TaskManager for some time, which then disappears.

9)  MatrixClass.o2bas:
10) PolymorphicCopy.o2bas:
These demos print the first result, but after 'OK' gxo2.exe crashes. Win7 64bit shows gxo2.exe for some time.

This demo shows a different result:

11) ConcatArrays.o2bas:
result should be 70, but shows 0

I wonder if in some of these cases a different syntax must be used?

The website of rosettacode.org lists 66 pages of resolved tasks, but I can only find 46 files in the RosettaCode directory? There seems to be no easy way to load the tasks of a language all at once from the website. Searching for a single file and copy / paste is a bit tedious.


Roland
Title: Re: Checking some demos?
Post by: Arnold on March 03, 2015, 05:06:52 PM
Hi Charles,

using your latest build with Oxygen version A40 22:42 03/03/2015 the RosettaCode demos worked ok. I compared them to see what has changed. There are only minor modifications but sometimes they are not easy to find. I think I have to create a checklist for using @, *,  _ and new.

Roland
 
Title: Re: Checking some demos?
Post by: Charles Pegge on March 03, 2015, 10:05:04 PM
Hi Roland,

Yes, there was a change in syntax, since the Rosetta examples were coded.

When returning any pointered variable in a procedure, the address must be returned explicitly. (using @ or &)

I pulled ActiveObject.o2bas. I hope to produce a simpler cleaner version.

Many thanks.
Title: Re: Checking some demos?
Post by: Arnold on March 09, 2015, 03:29:34 AM
Hi Charles,

in examples\OOP\Interfaces a found the demo Interface1.o2bas which uses:

class
   has ...
    /\
end class

which did not work. In OxyLog.txt I saw that you introduced /\ already in 2011. Is this syntax deprecated now? Interface5.o2bas seems to do the same work and still some more.

There are two other examples with the /\ syntax:

examples\OOP\Features:

ClassBasic.o2bas
ClassFormat2.o2bas

and in oxygenbasic\projectsA\Controls I found Controls.inc which is used by DlgCtrl.o2bas, DlgCtrlSliders.o2bas and Noise.o2bas.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 09, 2015, 11:34:17 AM
Hi Roland,

That is the lower level class syntax.

class classname
inherited classes,types,macros
static variables...
method protoypes...
/\
variables...
end class

methods of classname
full definition of methods
end methods


Fixed the ptoblem for all examples using this sytax

Many thanks! :)
Title: Re: Checking some demos?
Post by: Arnold on March 10, 2015, 01:34:36 AM
Hi Charles,

the demos now work and the controls in \projectsA\Controls look really impressive. Yet I am far away from understanding the internal activities. I found a tutorial in Wikibooks which seems to introduce OOP in a more general way, maybe this helps.

Unfortunately there are three demos now which show a new error:

examples\OOP\Features
MultiInherit.o2bas

ERROR:   Class must be EXTERNAL/COM
WORD:    p.greet
LINE:    41
PASS:    1

examples\OOP\Interfaces
Interface5.o2bas

ERROR:   Class must be EXTERNAL/COM
WORD:    "zaphod"
LINE:    74
PASS:    1

projectsB\RosettaCode
InheritMulti.o2bas

ERROR:   Class must be EXTERNAL/COM
WORD:    cp.viewphoto
LINE:    25
PASS:    1

These demos ran without problem using OxygenBasic version before, although InheritMulti.o2bas does not show a result. I assume it's purpose is to serve as a template for own projects?

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 10, 2015, 01:39:25 PM

Another fix!

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip

OxyMin Update (800k)
http://www.oxygenbasic.org/o2zips/OxyMin.zip

OxygenBasic Full Update (4700k)
http://www.oxygenbasic.org/o2zips/OxygenBasic.zip
Title: Re: Checking some demos?
Post by: Arnold on March 11, 2015, 01:42:18 AM
Hi Charles,

apparently you can treat OOP as versatile as all the styles of statements in OxygenBasic. It is formidable to see how you can manage all this variety.
Using the last build of Oxygen and compiling all the demos, there is a message which has not been before:

ProjectsC\PowerBasic

ObjectsPB3.o2bas

ERROR:   not a class/type: class
WORD:    methods
LINE:    152
PASS:    1

 ---------------------------
ObjectsPB6.o2bas

ERROR:   not a class/type: class
WORD:    methods
LINE:    198
PASS:    1

 ---------------------------
ObjectsPB7.o2bas

ERROR:   not a class/type: class
WORD:    methods
LINE:    212
PASS:    1

the message refers to 'from'. The helpfile of Oxygenbasic states:
 
'of', 'has' and 'from' currently means 'inherits. They
indicate derivation from a single parental class.

There must be a small difference with the use of these keywords. (Some day I will find out which one). The only additional demo which I found with 'from' is projectsB\RosettaCode\InheritSingle.o2bas, but it's use is slightly different.

Roland

Title: Re: Checking some demos?
Post by: Charles Pegge on March 11, 2015, 05:14:10 AM
Hi Roland,

from and of  (equivalent) are for single line inheritance, and has is used for inheriting from several classes.

COM and Java uses single-line inheritance only, and C++ is capable of both.

I am afraid many of these examples make OOP look complicated and obscure, because they are dealing with special cases.


Yet Another fix! (they are all related to the same problem)

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip

OxyMin Update (800k)
http://www.oxygenbasic.org/o2zips/OxyMin.zip

OxygenBasic Full Update (4700k)
http://www.oxygenbasic.org/o2zips/OxygenBasic.zip

Title: Re: Checking some demos?
Post by: Arnold on March 12, 2015, 06:38:56 AM
Hi Charles,

I was curious about the example DemoTheo.o2bas in the Powerbasic folder. It turned out that only few changes were necessary to run it with the latest build of Oxygen. I modified:

DemoTheo.o2bas
Line 92 (in WndProc)
  Select Case wMsg

and in
PbLib.inc
Line 46 (in macro varptr)
strptr v

"generate" in PbLib.inc only includes RTL64.inc. Is conditional include possible with OxygenBasic? If I comment out the generate in line 14 of the inc file, DemoTheo runs fine in Oxide.

Roland

Title: Re: Checking some demos?
Post by: Charles Pegge on March 12, 2015, 08:48:10 AM
Thanks Roland,

I fixed a flaw in #if
this enables the RTL conditional includes

Yes, case syntax change was required.

but the varptr macro was okay (@v)


Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip




Title: Re: Checking some demos?
Post by: Arnold on March 12, 2015, 11:45:40 AM
Hi Charles,

yes, this works with me too. I compared with HelloWin1.o2bas and thought I had to use strptr. But in DemoTheo there is a local szClassName as asciiz which changes everything.

There are only a few messages left now. Two programs which do not work are in examples\DimFeatures: AddressRes.o2bas and InlineTypes.o2bas (Unknown type pixel4f). Is the purpose of these demos to create a variable of a type with values in one go? I think I did not see this construction in one of the remaining examples.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 12, 2015, 12:45:09 PM
Hi Roland,

I think we can forget about those examples. The dim/type combined syntax was dropped some time ago.

  dim as pixel4f {single r,g,b,a} pixel

should now read:

  type pixel4f {single r,g,b,a}  : dim as pixel4f pixel

or more simply:

  type pixel4f single r,g,b,a  : pixel4f pixel

Thanks again! 
Title: Re: Checking some demos?
Post by: Arnold on March 13, 2015, 01:51:24 AM
Hi Charles,

using your example above I changed:
  '
  'dim as pixel4f {single r,g,b,a} pixel
  type pixel4f {single r,g,b,a} : pixel4f pixel

  'dim as materialf {pixel4f ambient,diffuse, specular, single shininess} material[16]
  type materialf {pixel4f ambient,diffuse, specular, single shininess} : materialf material[16]

this works and I think it is easier to understand.

Roland
Title: Re: Checking some demos?
Post by: Arnold on March 13, 2015, 10:13:57 AM
Hi Charles,

is this correct what I am doing?

\examples\Constructs\StackFrame.o2bas, line 5:
! funA cdecl (sys a,b,c,d) as sys at @_funA

TempProto.o2bas, line 6:
! g (double a,b,c,d) at @f

\examples\OpenGl\PentFractal.o2bas, line 62:
! Vertex3fv(vector*v) at @glVertex3dv

When I use these changes the demos run. (hopefully ok).

There is examples\Constructs\TypeDefProcC.o2bas which I cannot solve although I tried all kinds of @ and *. The expected result should be 6?

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 13, 2015, 02:52:37 PM
Hi Roland,

Yes, that is correct for StackFrame:

! funA cdecl (sys a,b,c,d) as sys at @_funA

and TempProto:

! g (double a,b,c,d) at @f

and also Fractal, but I recently relaxed type checking so that functions like glVertex3dv, will accept (byref) vectors containing doubles, as well as doubles. So the overlay is no longer necessary:
Code: OxygenBasic
  1.   function RenderPent(vector *p0,*p1,*p2,*p3,*p4,*p5,sys m)
  2.   =========================================================
  3.   glBegin GL_TRIANGLE_FAN
  4.   glNormal3f 0.,0.,1.
  5.   glTexCoord2f 0.5,0.5 : glVertex3dv p0
  6.   glTexCoord2f 0.0,0.0 : glVertex3dv p1
  7.   glTexCoord2f 1.0,0.0 : glVertex3dv p2
  8.   glTexCoord2f 1.0,1.0 : glVertex3dv p3
  9.   glTexCoord2f 0.5,1.0 : glVertex3dv p4
  10.   glTexCoord2f 0.0,1.0 : glVertex3dv p5
  11.   glTexCoord2f 0.0,0.0 : glVertex3dv p1
  12.   glend
  13.   if m=1
  14.     glTranslatef 0.,0.,.001
  15.     glDisable GL_LIGHTING
  16.     glDisable GL_TEXTURE_2D
  17.     glColor4f 1.,1.,1.,1.
  18.     glBegin GL_LINE_STRIP
  19.     glVertex3dv p1
  20.     glVertex3dv p2
  21.     glVertex3dv p3
  22.     glVertex3dv p4
  23.     glVertex3dv p5
  24.     glVertex3dv p1
  25.     glEnd
  26.     glEnable GL_LIGHTING
  27.     glEnable GL_TEXTURE_2D
  28.     glTranslatef 0.,0.,-.001
  29.   end if
  30.   end function
  31.  

The final example required a fix, as well as @foo

Code: OxygenBasic
  1. float foo(int a) label {return a*2}
  2. typedef float (*g)(int a)
  3. g f = @foo
  4. print f 3
  5.  

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip

Thanks :)

Title: Re: Checking some demos?
Post by: JRS on March 13, 2015, 11:48:02 PM
Roland,

I just wanted to say thanks as well for rehashing all the demos and making sure they are up to current O2 standards. Your efforts are what makes open source projects work. (and helps reduce author burnout)

John
Title: Re: Checking some demos?
Post by: Arnold on March 14, 2015, 12:52:05 AM
Hi Charles,

I must thank you because of your patience. For me it is like a tour of OxygensBasic's development in the last few years.

Unfortunately there has slipped in a small side effect with the latest build using Oxygen.dll version A40 22:34 13/03/2015: I can run the files using Scite or my editor but I cannot compile them neither with gxo2.exe nor co2.exe. (Linker found unidentified names). With the version before A40 12:56 11/03/2015 there was no problem at all.

Roland


Title: Re: Checking some demos?
Post by: Arnold on March 14, 2015, 01:08:55 AM
Hi John,

I wished I could be of some more help, but at the moment I am still exploring the versatile capabilities of OxygenBasic. When I started last year I was not completely aware of this flexibility.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 14, 2015, 02:14:53 AM
Oops sorry!
I was working on the linker.

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip
Title: Re: Checking some demos?
Post by: Arnold on March 14, 2015, 04:46:07 AM
Hi Charles,

with the latest update everything works as expected.

There is an error message which has been all the time before and I am not sure if this is an error at all? In projectsA\LeanLisp\ I can run all the examples (In ListManip.o2bas and in t.o2bas I had to use include "$\inc\console.inc"), but only lispish1 and lispish3usedll can be compiled to an .exe file. Creating LeanLisp.dll does also work. Compiling the other files gives this message:

ERROR:   Macro recursion suspected:
WORD:    wr
LINE:    782
FILE:    LispishUtil.inc
PASS:    1

This error message only occurs with the LeanLisp demos. Usually if I can run a progrom I can also compile it. When running the demos I cannot see an abnormal behaviour. But maybe there is a special reason why you prevent these examples from getting compiled?

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 14, 2015, 07:22:32 AM
Hi Roland,

Part of LispishUtil invokes oxygen dynamic compiling, which is not supported by the RTLs. Only dependent compiling + oxygen.dll will support dynamic compiling.

To make a dependent binary work, Oxygen.dll must be present in the same folder, or a small textfile, oxygen.cfg must be present, giving the filepath to Oxygen.dll.

oxygen.cfg
Code: [Select]
..\..\oxygen.dll

Alternatively:

For LispishUtil, this switch excludes operators using dynamic compiling, and independent compiling will be possible.

% NoOxygenCompile

Lispish2.o2bas
Code: OxygenBasic
  1. % UseSystemConsole
  2. % NoOxygenCompile
  3. '#file "t.exe" 'for dependent compiling only
  4. '% filename "t.exe"
  5. includepath "$/inc/"
  6. include "rtl32.inc"
  7. include console.inc
  8. includepath ""
  9. include LispishUtil.inc
  10. printl lisp getfile "LispishTest2.txt"
  11. waitkey
  12.  
Title: Re: Checking some demos?
Post by: Arnold on March 14, 2015, 11:43:48 AM
Hi Charles,

% NoOxygenCompile in the second line was sufficient to compile the examples succesfully.

Regarding oxygen.cfg I would like to mention that the file must contain more than one line. When I copied the text above into my config.cfg and saved without using the carriage return, the compiled files did not find oxygen.dll. This is no problem at all, only something to keep in mind.

Roland

Title: Re: Checking some demos?
Post by: Arnold on March 16, 2015, 12:33:56 AM
Hi Charles,

these are my last few issues concerning OxygenBasic demos for the moment because I do not find more.

I could run these examples:

\examples\Linkage\FuncLinks.o2bas line 19:
  declare function f1(string* s) at @f#string

FuncCasting.o2bas line 8:
declare fn() as sys at @fc   (is this sufficient?)

examples\Math\InProgress\Quaternion.o2bas line 9:
method normalise()

I did not touch projectsB\FreeImage (the style of declaring the functions looks much different), OxygenBasic\tools\t.o2bas (draft?), examples\Constructs\TokenLangWIP.o2bas (did this ever work?), projectsA\ManualGenerator\ManualCreate2WIP.o2bas (work in progress), projectsB\ConsoleOOP\old\TestConsoleC02.o2bas (include statements), projectsB\RosettaCode\inProgress\Sets.o2bas (in Progress), projectsB\C_codeWIP\C switch.o2bas (seems to be gxo2/co2 problem, but of minor interest).

Hopefully I did not bother you too much with my questions. My goal was to be able to compile every demo with OxygenBasic and to see the differences between Version A40 and the earlier versions. I noticed that there is A39,38,37,36. I do not think that they are fully compatible with A40. This would be like using FreeBasic 0.18 with programs written for FreeBasic 1.01.

I expect that there are some examples which will not work correctly or crash due to a slightly different memory access (pointered variables?), but to find these demos they must be run and and the code checked. Until now I have managed about a third of the ca 760 examples. For me there is still a lot to learn about OxygenBasic.

Roland


Title: Re: Checking some demos?
Post by: JRS on March 16, 2015, 01:15:41 PM
Quote
My goal was to be able to compile every demo with OxygenBasic and to see the differences between Version A40 and the earlier versions. I noticed that there is A39,38,37,36. I do not think that they are fully compatible with A40.

Are you using the download links from the main site or clicking on the wizard at the top right corner of the forum for Charles's latest build?

Title: Re: Checking some demos?
Post by: Arnold on March 16, 2015, 03:02:36 PM
I always use the link below the wizard because this is very handy and I get the complete build. But of course I also look what is on the main web site. In fact I start from the main site and then change to the forum.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 17, 2015, 03:34:01 AM
Hi Roland,

I've removed most of the WIPs (Work in Progress), which I will retain locally, until they are completed, recycled or deleted. Less frustrating for users, I hope.

I detected a problem with functions returning char*. That is also rectified.

The others should be okay.

Thanks :)
Title: Re: Checking some demos?
Post by: Arnold on March 17, 2015, 10:03:01 AM
Hi Charles,

using your latest build with version A40 07:25 17/03/2015 everything works like expected. I tried with Win 32bit and Win 64bit.

Unfortunately I am a bit conservative so I cannot show my enthusiasm like I should. But I am really excited.

As said now that I can compile almost everything at once it should be easier to find the examples which will crash by calling them directly without the editor. I mean something like this:

examples\Constructs\UnprototypedRect.o2bas:
Code: OxygenBasic
  1. type rectangle long left,top,right,bottom
  2.  
  3. function f(...)
  4. indexbase 1
  5. rectangle r at param[1]
  6. print r.left "   " r.top "   " r.right "   " r.bottom
  7. end function
  8.  
  9. rectangle t={10,20,30,40}
  10.  
  11. f t   'auto pass byref
  12. f @t  'explicit pass byref
  13.  

This demo compiles without problem, butl crashes due to f t. If I comment out f t the example will run as expected. f @t makes much more sense to me, I assume this is what you mean by 'pointered variables'? Or have you not yet decided what to do with the first construct?

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 17, 2015, 01:27:52 PM
Hi Roland,

I've fixed the problem. This is quite an extreme example, but the compiler is expected to infer that a compound variable (UDT) should always be passed by reference.

Oxygen DLL Update (200k)
http://www.oxygenbasic.org/o2zips/Oxygen.zip


Title: Re: Checking some demos?
Post by: Arnold on March 18, 2015, 01:27:54 AM
Hi Charles,

everything works ok with my system. And I realize more and more that you want OxygenBasic to be as tolerant as possible.

At the moment I try to run the compiled .exe files to see if there is a failure when starting them. As you have done so much during the last two months to improve the stable behaviour of OxygenBasic I doubt that I will find many programs if any at all. But I think it shoúld be proved. Maybe I can use a batch file if it is possible to get an errorlevel because doing this manually is still a bit time-consuming.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 19, 2015, 02:37:42 AM
Hi Roland,

We will have to devise an automated system, at least for the smaller programs. Ultimately, a more formal series of unit tests.
Title: Re: Checking some demos?
Post by: Arnold on March 19, 2015, 05:12:13 AM
Hi Charles,

this was a lot of pressing keystrokes and mouse clicks in spite of using a batch file. But I think I have seen all of your demos (at least for some moments). There are a lot of really nice demos in the directories.  Using Windows Vista 32bit on a notebook with AMD processor I found some compiled files which did not work:

Oxygenbasic Version: A40 21:04 17/03/2015.
 
c:\oxygenbasic\examples\DataProcessing
---------------------------
setofstrings.exe

c:\oxygenbasic\examples\OOP
---------------------------
pseudoretvals.exe

c:\oxygenbasic\examples\System
---------------------------
detect64bit.exe
 
c:\oxygenbasic\examples\OOP\ClassLibrary
---------------------------
classlibrarycompo.exe 
classlibtest.exe

c:\oxygenbasic\examples\OOP\Features
---------------------------
localclass.exe

c:\oxygenbasic\projectsA\WaveSynth
---------------------------
makewavefile1.exe

c:\oxygenbasic\projectsC\ScriptBasic\EmbedSb
---------------------------
sbwin.exe


Using my editor I can compile the .o2bas files but I cannot run them. Maybe this list (I think it is complete) can help you to decide if something in the code must be changed?

Roland
Title: Re: Checking some demos?
Post by: Arnold on March 19, 2015, 05:39:51 AM
Hi Charles,

regarding unit tests, I think Mike has also suggested this. It would be the next logical step and it would help you to discover anomalies earlier.

Roland
Title: Re: Checking some demos?
Post by: Arnold on March 20, 2015, 08:54:10 AM
Hi Charles,

I just downloaded your latest build and compiled and ran the examples (32bit currently). As I can use a batch file this only takes a few minutes. 99.2 % of the demos run ok. But only you can decide if in the remaining examples the code must be adapted or if something should be changed in OxygenBasic.

There were 2 new messages when compiling the demos which have not been before:

c:\oxygenbasic\examples\Constructs
---------------------------
ReturnColor.o2bas

Linker found unidentified names:
colorsave:   level 0
colorset:   level 0
colorload:   level 0
colorpop:   level 0
colorset:   level 0
colorpush:   level 0

ReturnShortVec.o2bas

Linker found unidentified names:
shortvecsave:   level 0
shortvecset:   level 0
shortvecload:   level 0
shortvecpop:   level 0
shortvecset:   level 0
shortvecpush:   level 0

I must admit I do not know where these error messages come from. They make no sense.

I can compile these .o2bas files with my editor but I cannot run them (GPF):

c:\oxygenbasic\examples\Constructs
---------------------------
unprototypedrect.o2bas       (if commenting line 12 then it works)

c:\oxygenbasic\examples\DataProcessing
---------------------------
setofstrings.o2bas

c:\oxygenbasic\projectsC\ScriptBasic\EmbedSb
---------------------------
sbwin.exe


I also found the demo examples\math\Mandeltextb.exe which I have to kill with the Taskmanager. Probably there is a missing freememory statement?


Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 20, 2015, 01:35:28 PM

Hi Roland,

Thanks for all that testing.

I have pulled about half of those examples and fixed the others.

I'm reintroducing operators. They may be implemented for any type, such as complex numbers and vectors. It caused those linker errors for two of the examples (now obsolete)
Title: Re: Checking some demos? (finished)
Post by: Arnold on March 21, 2015, 05:21:30 AM
Hi Charles,

it was not my intention to be a tester of OxygenBasic. But by restarting my projects I realized my total ignorance. I had used wrong statements and strategies and I searched in the demos for patterns which I could use. As some of the examples did not work I thought it could not harm to ask you. Often I had to overcome my fear that I only would ask silly questions. But I experienced much of the versatility of OxygenBasic and how flexible it can treat the flow of a program and it's statements.

Maybe you should store a snapshot of your latest A40 version in Sourceforge and create a subfolder for the elder versions. I really believe that the actual version A40 is much more powerful and more reliable than the previous versions. I could not resist and compared with A39. There are only about 430 examples and I find more error messages than in A40 with about 800 examples. The reason in A40 for these very few messages are either logical (Unique.o2bas) or are caused by the code of the example, not by OxygenBasic. There are 3 crashes when starting the demos of A39. With A40 there is only one (sbwin.o2bas). In Internet I have seen links which point to OxygenBasic A39 and even A35 in Sourceforge.net. It would be a pity if people would not see the power of version A40. The only weak point in the moment maybe is that there is no find / replace functionality in OxIde.

I know that you have removed some examples and that you will add them some day again. And you will add new features too as you are capable to do this and you know OxygenBasic by heart. If you don't mind and nobody else does I will notify you if there are major deviations.

Roland
Title: Re: Checking some demos?
Post by: Charles Pegge on March 21, 2015, 07:19:11 AM
Hi Roland,

Your testing has been a great service for us.

I have updated Sourceforge with the full A40 :)

SbWin.o2bas works now, but of course, relies on Scriptbasic.
Title: Re: Checking some demos?
Post by: Mike Lobanovsky on March 22, 2015, 02:07:43 AM
Hi Charles,

Can we consider A40 at Sourceforge as a kind of OxygenBasic Stable that the users can rely on in their own dev work for some period in the fereseeable future regardless of your usual almost-nightly W.I.P. builds?

I'm certain that at least some of the users have been waiting for this to happen for quite some time. :)
Title: Re: Checking some demos?
Post by: Charles Pegge on March 22, 2015, 02:24:25 AM
Yes certainly, Mike.

We are now on A41 :) There are still a few C-isms which need fixing.

OxygenBasic's maintenance department would like to know whether you have further plans for OxyScheme. There are a few small fixes in A40: projectsC/OxyScheme

.
Title: Re: Checking some demos?
Post by: Mike Lobanovsky on March 22, 2015, 02:54:04 AM
Being one of the aforementioned Oxygen users, I hasten to inform the Maintenance Dept of my willingness to resume my dev work as soon as O2 Stable is announced. :)

In the meantime, inspired by the recent developments at the thinBasic front, I'm totally absorbed by my own W.I.P., brand new FBSL Executable Compiler, that's going to automate the process of FBSL script compilation and enrich it with access to all sorts of Windows resources that were not so easy to integrate in an FBSL standalone executable until now.

.
Title: Re: Checking some demos?
Post by: Charles Pegge on March 22, 2015, 03:10:48 AM
Will it be able to compile down to binary, Mike?
Title: Re: Checking some demos?
Post by: Mike Lobanovsky on March 22, 2015, 03:51:24 AM
No, not in v3.5. Compile-to-native-code will be an option in v4.0 that's also going to have a BASIC jitter in place of current BASIC interpreter. Yet I'm planning to keep the BASIC jitter Variant-based and fully backward compatible with v3.5, Inshallah.

The compiler depicted above is written entirely in FBSL BASIC except for a dozen lines written in DynC to parse an RCDATA resource that's to be shown in the respective tab's hex viewer. Interpretative parsing is annoyingly slow when the resource size is larger than some 100KB. But FBSL BASIC's GUI per se is rock solid.

The app GUI is a friendly cartoon of linuxoid Code::Blocks that we've been using to compile the FBSL sources in for over a dozen years. The alternative (rejected) options for the app name were Goldie::Locks and Code::Sucks. :)

.
Title: Re: Checking some demos?
Post by: Charles Pegge on March 22, 2015, 04:14:49 AM
And are you planning for 64bit JIT  :D

Coming back to OxyScheme. I am trying to establish whether Lisp, Scheme, and the various concatenation languages are doomed to confinement in academia, and whether they are worth pursuing as practical high level languages.

I can see the benefits of using them as infrastructure.
Title: Re: Checking some demos?
Post by: Mike Lobanovsky on March 22, 2015, 04:53:31 AM
I guess v4.0 is going to be my swan song. I'd very much like to see it 32- and 64-bit capable under Windows, Linux, and Mac OSX -- six times Inshallah, respectively. :D

I'd be also eager to see a functional language (Scheme is currently my closest) that's as efficient, GUI-wise, as any other compatible PL product. I guess that's not so hard to do but IMHO it would require some skilled practitioner involvement rather than sporadic attempts to develop its/their functionality and interface only inasmuch as required for this or that immediate academic task.

It is really painful for me to look at Rob's quest for a working toolchain to at least minimally suit his needs. And I think he isn't the only one of the kind. :)
Title: Re: Checking some demos?
Post by: Charles Pegge on March 22, 2015, 11:50:35 AM
I think it would be easier to incorporate functionalism into Basic than to provide full GUI to these languages.

Basic has the most complex syntax, yet is amongst the most user-friendly of programming languages.
Title: Re: Checking some demos?
Post by: JRS on March 22, 2015, 03:48:41 PM
I think the TinyScheme extension module for Script BASIC offers the best of both worlds. One could create a library of Scheme functions and call them from BASIC.

Title: Re: Checking some demos?
Post by: Charles Pegge on March 22, 2015, 08:37:50 PM

I would like to see a practical task that is better expressed in Scheme/Lisp, than in Basic. I am taking a sceptical stance :)
Title: Re: Checking some demos?
Post by: JRS on March 22, 2015, 08:39:47 PM
+1

Scheme's pitch for illegitimacy (https://xivilization.net/~marek/tex/schemerocks/schemerocks.pdf)

FWIW - Racket (PLT Scheme) weighs in at 3.5 MB. About the same as Python and PHP. (SB < 700KB)