Oxygen Basic

Information => Development => DLLC => Topic started by: JRS on May 30, 2018, 08:54:33 PM

Title: ScriptO2
Post by: JRS on May 30, 2018, 08:54:33 PM
I've decided to get the ball rolling and get ScriptO2 version 1.0 assembled. The first version will use existing O2 / DLLC resources and will be a name change / repackaging job. I will setup a public BitBucket repository for the project. My hope is Mike will find this interesting and contribute.

I plan to use libscriba (SB in a DLL) which should make version 1.0 of ScriptO2 about 50 KB.
Title: Re: ScriptO2
Post by: JRS on June 02, 2018, 11:25:05 AM
Update

It looks like I'm going alone on this effort to merge Script BASIC with O2. The good news is ScriptO2 already exists, just has too much junk in the trunk in it's current form.

I'm unfortunately extremely busy with real life projects so this will be a labor of love when I find a moment.
Title: Re: ScriptO2
Post by: JRS on June 12, 2018, 12:45:25 AM
ScriptO2 offers everything that Script BASIC does plus the following O2 features.

I plan to include the SWIG to DLLC FFI definition utility with SciptO2 1.0.
Title: Re: ScriptO2
Post by: Mike Lobanovsky on June 12, 2018, 04:45:26 PM
BSTR, WIDE with ASCII conversation.

Mmm... WCHAR?.. Conversion?..

Quote
... SciptO2 1.0.

Shouldn't there be some ScriptO2 0.1 first just for starters?
Title: Re: ScriptO2
Post by: JRS on June 12, 2018, 05:45:28 PM
That should have been BSTR to SB string conversion.

Going for 1.0 might be slightly aggressive.
Title: Re: ScriptO2
Post by: JRS on June 15, 2018, 11:59:08 PM
With the speed of today's computers, what type of applications justify using ASM? (via O2)

When I run Scipt BASIC code I'm seeing microsecond execution speeds. Most apps aren't rotating pinecones but doing data entry and reporting. Have we exceeded fast and it's now a moot point?

Personally, I see O2 shinning as an interpretive language booster until it matures and isn't so low level.
Title: Re: ScriptO2
Post by: JRS on June 16, 2018, 10:52:15 AM
The advantage of using O2 as SB's extension API rather than the existing C API is you can extend your code dynamically at ASM speeds using milti-line O2 code text strings in your SB script.

I'm reserving the C extension API for integrating open source popular libraries.
Title: Re: ScriptO2
Post by: JRS on June 17, 2018, 08:48:47 AM
Script BASIC is a comfortable set of clothes O2 can wear now until it stops growing and starts wearing its own.
Title: Re: ScriptO2
Post by: JRS on June 17, 2018, 10:05:00 PM
Quote from: Mike
So how can your SB elaborations help the O2 developer or user's immediate needs?

It lets the user frame out their project in SB and externally enhance it using O2 JIT, dynamic FFI or the SB C extension API.
Title: Re: ScriptO2
Post by: JRS on June 18, 2018, 03:59:17 PM
I really don't see a huge difference between what Brian is doing with O2 and the ScriptO2 effort.
Title: Re: ScriptO2
Post by: JRS on June 18, 2018, 04:12:43 PM
Quote from: Mike@JRS

All compliant BASICs should, as a minimum, be able to run Dartmouth code as-is. All more advanced features of the language are just dialect-specific extensions, regretfully, non-standardized up till now.

A good example of compliant BASIC is your hateful Script BASIC that runs the code snippets from the book I quoted earlier without a single change (except for the DATA/READ commands that wouldn't be hard to fix if need be). There are some other dialects that are able to do the same with equal ease.

And if O2 isn't able to read and execute Dartmouth code (directly or with a dedicated, special-purpose include file) as flawlessly, then I am afraid O2 cannot be called a compliant BASIC, regardless of its versatility and polymorphism.

Dartmouth is the definition of BASIC. It has all the constructs of a functional language. Most languages still use core BASIC as a foundation to their language variation.

If you want to run a modern version of Dartmouth BASIC, PvxPlus.com (ProvideX Business BASIC) offers a single user version of the language for non-commercial use for free.
Quote
Script BASIC that runs the code snippets from the book I quoted earlier without a single change (except for the DATA/READ commands)

SB SPLIT does a DATA/READ in one statement.  8)

Quote
There are some other dialects that are able to do the same with equal ease

I'm pretty sure the Quick BASIC language could run Dartmouth out of the box.

150 BASIC Variations


  Dartmouth BASIC  (the original)
  ANSI Standard Minimal Basic (specification X3.60-1978)
  ISO Standard Minimal Basic (specification ISO 6373-1984 (E))
  ANSI Standard Full Basic (specification X3.113-1987)
  True Basic
  Decimal Basic
 
  VAX BASIC
  DEC BASIC
  BASIC Plus
 
  MAI Basic Four Business Basic
  Data General Business Basic
  AlphaBasic
  Visual PRO/5 (Basis)
  MicroShare Basic
  ProvideX (Sybex Ltd.)
  OpenBASIC
  SMBasic
  Thoroughbred Basic
  Universal Business Basic
  UniBasic
  THEOS (Business) Basic
  Wang BASIC-2
  KCML (Kerridge Computer Company Ltd.)
 
  HP Basic
  Rocky Mountain Basic (Hewlett Packard)
  BTI Basic (Basic Timesharing)
 
  Palo Alto Tiny BASIC
  Altair BASIC
  Processor Technology BASIC
  Northstar BASIC
  VIP Basic (Cosmac ELF 1802)
  Apple I Integer Basic
  Apple Integer Basic - Apple II
  TRS-80 Level-I Basic
  TRS-80 Color Computer Basic (MS)
  Disk Extended Color Computer 3 Basic
  CoCo Extended Color BASIC
  Atari Basic (400/800)
  Commodore PET Basic
  Benton Harbor BASIC (Heathkit)
  Timex Sinclair 1000 (ZX80) Basic
  Sinclair ZX81 Basic
  Sinclair Spectrum Basic
  Sinclair QL Basic
  Acorn Atom Basic
  BBC Basic
  Dragon Basic
  Basic09 (OS-9)
 
  Commodore Basic (VIC-20, C64)
  BASIC v7.0 from Commodore 128
  TI-BASIC (for TI-99/4A)
 
  ST Basic   (AtariST)
  STOS Basic (AtariST)
  dBASIC     (DTACK/Atari)
 
  ALTAIR BASIC (Gates & Allen)
  BASIC (for CP/M)
  BASICA
  GWBASIC (for PCDOS)
  MS BASIC (for non-PC compatible MSDOS)
  GFA Basic (AtariST, Amiga, DOS, MS-Windows)
  QuickBASIC
  QBASIC
  VB/DOS
  Visual Basic
  Visual BASIC for Applications (VBA)
  BasicScript (VBScript)
  Visual Basic .NET
 
  AppleSoft Basic - Apple II+
  TRS-80 Level-II (MS Basic)
  Level-3 Basic
  Basic cartridge for Exidy Sorcerer
  Macintosh Basic (MS)
  MS QuickBasic for Macintosh
 
  Apple MacBasic (never sold)
  ZBasic
  FutureBasic

  NS Basic ( Apple Newton , WinCE, PalmOS)
  LBasic ( for a 8-bit computer 'Laser') ( Amstrad? )
  Casio Basic ( for Casio 80's digital diary )
  Chipmunk BASIC (for Mac and Unix)
  cbasPad ( for USR PalmPilot )
  HotPaw Basic (PalmOS)
  CrossBasic (Mac)
  SC-Basic (Mac)
  VIP-Basic (Mainstay)
  ACE Basic (Amiga)
  AMOS Basic (Amiga)
  AmigaBasic
 
  Summsoft Basic
  Oracle Power Objects Basic
  Pick/BASIC
  NetBasic

  CBASIC (Digital Research)
  SBASIC (Came with many KAYPRO's)
  Turbo BASIC (Borland?)
 
  Bywater Basic (unix)
  YABasic (unix)
  SmallBasic (linux/PalmOS)
  FreeBasic
  wxBasic
  Blassic
  Dunfield MBasic
  GBasic (DOS)
  qb2c
  dds (obfuscated source interpreter)
  dds (obfuscated source compiler)
  JavaBasic
  Hot Tea Basic (java)
  JBasic    - (java)
  COCOA Basic   (java)
 
  Moonrock BASIC
  Liberty BASIC
  Just BASIC
  UBASIC (high precision)
  ASIC
  O'Basic95
  First Basic
  PowerBASIC
  ScriptBasic (Peter Verhas)
 
  XBASIC (Basmark)
  Basic (Intel, 8051)
 
  Array Basic
  M-BASIC    for CP/M ?
  Basic BHT (To read bar codes ?)
  GB Basic (Game Boy)
  Flash Basic
  Enable Basic - a TurboCAD V3.0 script language
  Shepardson Basic
 
  Access Module Basic
  GBASIC
  BasicBasic
  APBasic
 
  BASIC PRO/5
  BASIS BB/x Progression 2,3,4
  Basic11
  BasicX
  BlitzBasic
  DarkBasic
  Envelop BASIC
  GEM Basic
  GS BASIC
  GaBASIC
  Gammasoft BASIC
  MBASIC
  MSX Basic
  NewBasic
  NewBrain BASIC
  Omikron Basic
  OmniBASIC
  PBasic
  Pluto Business BASIC
  PureBasic
  RealBasic
  UltraBasic
  X/TEND Business BASIC for the AS/400
  X11-Basic

  Tiny Pasic  (typo ??)
 
  CARealizer   - (??)
  Force (Half BASIC, mixed with a little C and Pascal)
  UDF - industrial BASIC for control systems (HVAC)

  A BASIC - ??
  Rapid-Q ?
  NIAKWA ?
  UBB, U/BL, B32 (from Data General)
  Kelly's BASIC ?


The reason you have my respect Mike is the truth means something to you.
Title: Re: ScriptO2
Post by: Mike Lobanovsky on June 19, 2018, 01:56:30 AM
Thank you, John.

But to tell you the ultimate truth, there are even more BASICs (http://basic.mindteq.com/index.php?i=74) than there are entries in your rather comprehensive BASIC dialect list. :)
Title: Re: ScriptO2
Post by: Charles Pegge on June 19, 2018, 04:17:28 AM
I wonder how many are Basic compilers?
Title: Re: ScriptO2
Post by: JRS on June 19, 2018, 07:44:41 AM
PB and O2 are the only BASIC compilers I have ever used. There have been a few B2C translators but most have been interpreters.

I don't view pcode based languages like VB a compiler.
Title: Re: ScriptO2
Post by: JRS on June 19, 2018, 09:34:53 AM
I think the point everyone is missing is it isn't about Script BASIC code, it's about SB running BASIC code no matter what BASIC it was originally created under.

If BASIC isn't of interest to people, why are there so many variations of the language?

If SDK style programming is your thing, O2 in it's current form is a great option.
Title: Re: ScriptO2 - Array Benchmark
Post by: JRS 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.
Title: Re: ScriptO2
Post by: JRS 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.
Title: Re: ScriptO2
Post by: Laurent 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 ;-)
Title: Re: ScriptO2
Post by: JRS 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.