Recent

Author Topic: BAScript - Simple scripting interpreter  (Read 2226 times)

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
BAScript - Simple scripting interpreter
« on: February 15, 2026, 02:39:20 pm »
I've released BAScript 2.3.β.

BAScript is a simple scripting engine written in Object Pascal you can use to add scripting to your Lazarus or Free Pascal applications ("host program") to extend their functionality without the need of recompiling them. You should note that BAScript is intended to be lightweight, so it has not mechanisms to handle complex data structures or large amounts of data or code. On the other hand, it has less need for memory and resources than other scripting interpreters. If you need more power you may try PascalScript.

This version fixes some (quite silly) bugs and adds support for fixed-point number (less accurate than floating-point ones (Real) but enough for most cases) and a new language similar to BASIC and Lua named Kor, so there are three supported languages: Kor, BriefC y BAScript.

You can download from here.

Comments and suggestions are welcome.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

gidesa

  • Full Member
  • ***
  • Posts: 227
Re: BAScript - Simple scripting interpreter
« Reply #1 on: February 15, 2026, 03:50:10 pm »
Hello, very nice project!
I download it, compilation is OK with Fpc 3.2.2 (Fpc trunk 3.3.1 has errors).
It should be very good to have an example of embedding the engine in an host program, calling host functions.

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1186
Re: BAScript - Simple scripting interpreter
« Reply #2 on: February 16, 2026, 05:48:03 am »
Very interesting.

Thanks.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
Re: BAScript - Simple scripting interpreter
« Reply #3 on: February 18, 2026, 11:35:31 am »
Thanks for the comments

I download it, compilation is OK with Fpc 3.2.2 (Fpc trunk 3.3.1 has errors).
Can you post the error messages?

It should be very good to have an example of embedding the engine in an host program, calling host functions.
Besides the basrun app, documentation has a tutorial.  It's in file ~/docs/lib/howtos.html.
« Last Edit: February 18, 2026, 11:37:21 am by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

gidesa

  • Full Member
  • ***
  • Posts: 227
Re: BAScript - Simple scripting interpreter
« Reply #4 on: February 18, 2026, 12:10:21 pm »
I download it, compilation is OK with Fpc 3.2.2 (Fpc trunk 3.3.1 has errors).
Can you post the error messages?

Executing "make" these are the errors:

Code: Pascal  [Select][+][-]
  1. "BAScript 2.3.β"
  2. "(c) Guillermo Martínez J. 2006-2026"
  3. https://bascript.sourceforge.net
  4. ECHO disattivato.
  5. fpc -O3 -CX -Xs -XX -Si -vm5024 -vm6058 -Mobjfpc  -Fusrc/basrun/ -Fusrc/rtl/ -Fusrc/bascript/ -FEbin/ -FUobj/ src/basrun/basrun.pas
  6. Free Pascal Compiler version 3.3.1-17136-g3b7d9956ca-dirty [2024/12/27] for x86_64
  7. Copyright (c) 1993-2024 by Florian Klaempfl and others
  8. Target OS: Win64 for x64
  9. Compiling src\basrun\basrun.pas
  10. Compiling .\src\rtl\baslibtypes.pas
  11. Compiling .\src\bascript\bascript.pas
  12. Compiling .\src\rtl\baslibstr.pas
  13. Compiling .\src\rtl\baslibmath.pas
  14. Compiling .\src\rtl\baslibconio.pas
  15. Compiling .\src\bascript\baskor.pas
  16. Compiling .\src\bascript\bascompiler.pas
  17. bascompiler.pas(1326,54) Error: Incompatible type for arg no. 2: Got "Array[0..5] Of AnsiString", expected "basStringArray"
  18. bascompiler.pas(1339,46) Error: Incompatible type for arg no. 2: Got "Array[0..6] Of AnsiString", expected "basStringArray"
  19. bascompiler.pas(2268) Fatal: There were 2 errors compiling module, stopping
  20. Fatal: Compilation aborted
  21. Error: D:\programmi\FPC3.3.1\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode
  22.  

Okoba

  • Hero Member
  • *****
  • Posts: 651
Re: BAScript - Simple scripting interpreter
« Reply #5 on: February 21, 2026, 01:39:58 pm »
Where can I learn more about these languages?

d2010

  • Sr. Member
  • ****
  • Posts: 257
Re: BAScript - Simple scripting interpreter
« Reply #6 on: February 21, 2026, 02:03:59 pm »
Where can I learn more about these languages?

We need Visual-Learning. This year we are AI very good, that reason : How to Learn together Secondary script for "Lazarus?
 E.g (InnoSetup-Script, other, Clojure or BasScript, LUA-script)
The main problem for many many programmer/s:
C:Q1= How to Learning only visual-Learning.?. because (for algorithmic, old method Learning , Bytes, Octal, TstringList, the Sort Method-Learning, ) for these, compilator Lazarus is very very good. :-\
C:Q2=How to increase Visual Learning for BasScript?
C:Q3=Perhaps how to increase Visual Learning for LAzarus? . . .
« Last Edit: February 22, 2026, 10:04:05 am by d2010 »

Thaddy

  • Hero Member
  • *****
  • Posts: 18797
  • Glad to be alive.
Re: BAScript - Simple scripting interpreter
« Reply #7 on: February 21, 2026, 04:43:37 pm »
Interesting, but I stick with Python for scripting (or Pascal Script)
Recovered from removal of tumor in tongue following tongue reconstruction with a part from my leg.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
Re: BAScript - Simple scripting interpreter
« Reply #8 on: February 23, 2026, 08:28:43 pm »
I download it, compilation is OK with Fpc 3.2.2 (Fpc trunk 3.3.1 has errors).
Can you post the error messages?

Executing "make" these are the errors:

Code: Pascal  [Select][+][-]
  1. "BAScript 2.3.β"
  2. "(c) Guillermo Martínez J. 2006-2026"
  3. https://bascript.sourceforge.net
  4. ECHO disattivato.
  5. fpc -O3 -CX -Xs -XX -Si -vm5024 -vm6058 -Mobjfpc  -Fusrc/basrun/ -Fusrc/rtl/ -Fusrc/bascript/ -FEbin/ -FUobj/ src/basrun/basrun.pas
  6. Free Pascal Compiler version 3.3.1-17136-g3b7d9956ca-dirty [2024/12/27] for x86_64
  7. Copyright (c) 1993-2024 by Florian Klaempfl and others
  8. Target OS: Win64 for x64
  9. Compiling src\basrun\basrun.pas
  10. Compiling .\src\rtl\baslibtypes.pas
  11. Compiling .\src\bascript\bascript.pas
  12. Compiling .\src\rtl\baslibstr.pas
  13. Compiling .\src\rtl\baslibmath.pas
  14. Compiling .\src\rtl\baslibconio.pas
  15. Compiling .\src\bascript\baskor.pas
  16. Compiling .\src\bascript\bascompiler.pas
  17. bascompiler.pas(1326,54) Error: Incompatible type for arg no. 2: Got "Array[0..5] Of AnsiString", expected "basStringArray"
  18. bascompiler.pas(1339,46) Error: Incompatible type for arg no. 2: Got "Array[0..6] Of AnsiString", expected "basStringArray"
  19. bascompiler.pas(2268) Fatal: There were 2 errors compiling module, stopping
  20. Fatal: Compilation aborted
  21. Error: D:\programmi\FPC3.3.1\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode
  22.  

Ok.  I take note (Ticket #3) and I'll fix it for the stable version.

Thanks. :)
« Last Edit: February 23, 2026, 08:30:43 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
Re: BAScript - Simple scripting interpreter
« Reply #9 on: February 23, 2026, 08:29:52 pm »
Interesting, but I stick with Python for scripting (or Pascal Script)
As you need.  Actually BAScript doesn't aim to replace them.  It started as a pet project to learn myself then I found it would be useful for smeone else.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
Re: BAScript - Simple scripting interpreter
« Reply #10 on: March 02, 2026, 10:58:11 am »
Where can I learn more about these languages?
There are documentation in the ~/docs/language subdirectory.  Also there are a few examples in the bin directory.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1222
    • Burdjia
Re: BAScript - Simple scripting interpreter
« Reply #11 on: March 02, 2026, 11:42:49 am »
So after checking the feedback and testing while updating my small IDE (that uses it) I've fixed a bunch of stuff so I decided to release it as stable.  Enjoy.

Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

 

TinyPortal © 2005-2018