• Welcome to Theos PowerBasic Museum 2017.

thinBasic is out

Started by Eros Olmi, November 27, 2008, 12:33:35 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eros Olmi

After many months of hard work and thanks to the big, big help thinBasic development team had from many thinBasic users, we are very proud to announce the availability of thinBasic programming language version

This new release is the biggest thinBasic update ever, no doubts!
The list of improvements is so big and cover so many aspects that it is better to demand its reading directly to the on-line help at http://www.thinbasic.com/public/products/thinBasic/help/html/version_1_7_0_0.htm

Just to mention few of the main features:

  • callbacks for windows and controls. Now every dialog and almost every control can be driven by script functions callback quite the same real compilers. This is a big enhancement comparing to previous message handling system. A lot of examples are available showing this new way of handling UI scripts
  • improved thinAir IDE
  • improved TBGL, OpenGL module
  • complete set or MAT functions working on matrix calculation
  • TAB control is now supported with a very easy syntax, just few lines of code.
  • TreeView control
  • ImageCTX control can be used to show any image file format handled by Internet Explorer
  • real MDI applications can be now created
  • UDT can now have dynamic strings as elements. Allocations and deallocation of memory is automatically handled by thinBasic engine
  • TCP and UDP communications can now be drive by windows events if used with user interface scripts
  • ...
and many many more.

Many of the new features are described in great details in TBJ (thinBasic Journal) Issue 2 at http://community.thinbasic.com/index.php?topic=2310.msg17554#msg17554

Attached an OpenGL example created with new thinBasic. It feature new TBGL (OpenGl module for thinBasic created by Petr Schreiber) and new UI callbacks.
If interested, full thinBasic source code can be downloaded from http://community.thinbasic.com/index.php?topic=2311.msg17556#msg17556

Have fun.
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

José Roca

Congratulations for the update and the thinBASIC journal. Very nice layout!

Eros Olmi

Thanks José.

Merit goes to Petr Schreiber and his strong passion  ;)
thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Theo Gottwald

Eros, is there any plan to make thinBasic compilable?

There are many ways to do so, even without making an own compiler.

You could - for example - convert the ThinBasic to another compiler language like C, PowerBasic or PureBasic (x64) and then compile with this language.

As the Runtimes are in PowerBasic it looks to me as if such an conversion is at least thinkable, if not to say "easy".

In the most easy case, the Runtime would be an include file or PB-SLL and the Script will be converted into "calling code", that just calls the SLL-Library for any command.

This way timecritical stuff could be "converted" and then compiled, as an alternative to using the Scripting Runtime.

Petr Schreiber

Hi Theo,

I leave the official reply to Eros, but from my side:

ThinBASIC has "Oxygen" module, done by wizard Charles Pegge. It allows to JIT compile BASIC code, and link it together with ThinBASIC. This way part of the application can run in interpreted mode, and the time critical part can be compiled. The JIT routines can be called from interpreted part.

Here little example of JIT usage:


Uses "Oxygen"     

Function TBMain()
  ' -- CODEPTRs for JIT modules
  Dim oxyCalculation, oxyFinish As DWord
  ' -- This is source code for JIT compilation
  Dim callbackCode As String = "     
  Function Oxygen_Calculation( Byval a As Long) As Long Link #oxyCalculation
    dim i as long
    dim myVal as long
    for i = 1 to a   
      myVal = myVal + i
    return myVal
  End Function 
  Sub Oxygen_Finish() Link #oxyFinish
  End Sub                             
  ' -- Here we JIT compile it 
  O2_BASIC callbackCode
  ' -- Did compile succeeded?
  If Len(O2_ERROR) Then
    MsgBox 0, O2_ERROR, "JIT compilation failed"
    ' -- Execute (performs the actual linking]

    ' -- Overlay interpreter definition over JIT part   
    Declare Function Oxygen_Calculation( ByVal a As Long ) As Long At oxyCalculation
    Declare Sub      Oxygen_Finish() At oxyFinish
    ' -- Call functions from JIT directly   
    MsgBox 0, Format$(Oxygen_Calculation(5))
    MsgBox 0, Format$(Oxygen_Calculation(10))
    MsgBox 0, Format$(Oxygen_Calculation(15))
    ' -- Release oxygen
  End If
End Function           

ThinBASIC also contains Tokenizer module, which could be suitable for converting one language to another. I already used it in the past to automate translation from MatLab to C.

I am using ThinBASIC (and PB too for COM) at work, and for GUI and 3D applications there was so far no problem with the fact TB is interpreted.


P.S. This thread is ooold. ThinBASIC is already out.
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3


Eros Olmi

Hi Theo,

Petr has already replied reading my mind  ;D

No, from my side there is no intention to create a compiler or a translator.
My intention is to improve thinBasic (the labguage), thinAir (the editor), thinDebug (the debugger) in terms of stability, execution speed, features and easy programming.

Oxygen module from Charles Pegge has given the power in case of power is needed in some critical area.
Charles is continuing developing his stand alone language and thinbasic module.

Latest thinBasic version is http://www.thinbasic.com/community/showthread.php?11345
thinBasic version history: http://www.thinbasic.com/public/products/thinBasic/help/html/whatsnew.htm


thinBasic Script Interpreter - www.thinbasic.com | www.thinbasic.com/community
Win7Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

Theo Gottwald

Thanks, Peter & Eros for replying.
I have sen some games in thinBasic that looked rather "phat" (not thin).
Maybe there are no real speed reasons there for a conversion/compilation.