Author Topic: ScriptO2  (Read 5526 times)

0 Members and 1 Guest are viewing this topic.

JRS

  • Guest
Re: ScriptO2 - Array Benchmark
« Reply #15 on: June 20, 2018, 12:34:27 PM »
As a baseline, here is Script BASIC predefining an array with 1,000,000 elements initialize to zero and then it assigns the index as a value to each element.

Code: Script BASIC
  1. ' Array Benchmarks
  2.  
  3. SPLITA STRING(1000000,"0") BY "" TO array
  4. FOR idx = 0 TO 999999
  5.   array[idx] = idx
  6. NEXT
  7. PRINT "Lower Array Bound ", LBOUND(array),"\n"
  8. PRINT "Upper Array Bound ", UBOUND(array),"\n"
  9. PRINT "Index 500,000 Value ", array[500000],"\n"
  10.  


jrs@jrs-laptop:~/sb/examples/test$ time scriba arraybench.sb
Lower Array Bound 0
Upper Array Bound 999999
Index 500,000 Value 500000

real   0m1.225s
user   0m0.944s
sys   0m0.116s
jrs@jrs-laptop:~/sb/examples/test$


This is an example of creating a second dimension of letters and numbers for a dynamically defined associative array.

Code: Script BASIC
  1. SPLITA "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" BY "," TO letters
  2. SPLITA "0,1,2,3,4,5,6,7,8,9" BY "," TO values
  3. array{"alphabet"} = letters
  4. array{"numbers"} = values
  5. FOR i = 0 TO 25
  6.   PRINT array{"alphabet"}[i]
  7. NEXT
  8. PRINTNL
  9. FOR i = 0 TO 9
  10.   PRINT array{"numbers"}[i]
  11. NEXT
  12. PRINTNL
  13. PRINT UBOUND(array),"\n"
  14. PRINT UBOUND(array{"alphabet"}),"\n"
  15. PRINT UBOUND(array{"numbers"}),"\n"
  16.  


jrs@jrs-laptop:~/sb/examples/test$ scriba arraymix.sb
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
3
25
9
jrs@jrs-laptop:~/sb/examples/test$



Note: There were no programmers harmed in this demonstration by using line numbers, LET and  $ (string notation) optional SB syntax.
« Last Edit: June 21, 2018, 12:51:04 AM by John »

JRS

  • Guest
Re: ScriptO2
« Reply #16 on: June 23, 2018, 07:16:43 PM »
I'm not seeing much interest in a scripting front end for O2. I don't see EZGUI, Brian's BASIC or the external debugger project making any headway either.

At this point in the O2 development cycle, I'm just going to be happy with DLLC as a Windows only extension module.

I'm going to create a thread on AllBASIC showing the evolution of  BASIC from Dartmoth to VB6 using Script BASIC code examples.
« Last Edit: June 23, 2018, 09:46:01 PM by John »

Laurent

  • Guest
Re: ScriptO2
« Reply #17 on: June 24, 2018, 12:14:12 PM »
I don't see EZGUI, Brian's BASIC or the external debugger project making any headway either.

Although o2debugger is functional I need some feedback to make it evolve or at least fix bugs.
So I'm waiting you John .... The others too ;-)

JRS

  • Guest
Re: ScriptO2
« Reply #18 on: June 24, 2018, 01:59:34 PM »
My next O2 related task is to clean up DLLC removing the the threaded IUP functionality. The main features of DLLC is the dynamic FFI, bstr / wide strings, C structures create / access and low level COM support.

I already have a cross platform threading extension module (SBT) and my IUP extension module allows multiple instances of the message loop to run in threads. COM/OLE automation is provided in a CallByName wrapper.

As much as I like O2 and Charles, I have a working BASIC project to facilitate and without others interest in contributing external solutions to O2, It seems to be a waste of my time. At my age, time utilization is at the top of my list.

O2 may run code faster but when the difference is under a second, I'm not willing to give up the ease of use and the unlimited functionality SB gives me.

« Last Edit: June 24, 2018, 02:49:07 PM by John »