Author Topic: ScriptO2  (Read 3048 times)

0 Members and 1 Guest are viewing this topic.

John

  • Hero Member
  • *****
  • Posts: 3640
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: (sb) [Select]
' Array Benchmarks

SPLITA STRING(1000000,"0") BY "" TO array
FOR idx = 0 TO 999999
  array[idx] = idx
NEXT
PRINT "Lower Array Bound ", LBOUND(array),"\n"
PRINT "Upper Array Bound ", UBOUND(array),"\n"
PRINT "Index 500,000 Value ", array[500000],"\n"


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: (sb) [Select]
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
SPLITA "0,1,2,3,4,5,6,7,8,9" BY "," TO values
array{"alphabet"} = letters
array{"numbers"} = values
FOR i = 0 TO 25
  PRINT array{"alphabet"}[i]
NEXT
PRINTNL
FOR i = 0 TO 9
  PRINT array{"numbers"}[i]
NEXT
PRINTNL
PRINT UBOUND(array),"\n"
PRINT UBOUND(array{"alphabet"}),"\n"
PRINT UBOUND(array{"numbers"}),"\n"


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 »

John

  • Hero Member
  • *****
  • Posts: 3640
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

  • Newbie
  • *
  • Posts: 11
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 ;-)

John

  • Hero Member
  • *****
  • Posts: 3640
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 »