Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: ThinBasic... an alternative?

  1. #1

    ThinBasic... an alternative?

    Hello everyone!
    I'm a User of PureBasic which I realy love for its speed, libs, small exe's and alot other stuff.

    Yesterday I was chilling at the Forums when I read something about THINBasic. I though "What the...?" And sofortly started searching about ThinBasic and PowerBasic. PowerBasic seems to be nice but I dislike to spend a few houndred dollar if I already got a good language (PureBasic). But then I started to take a clooser look at ThinBasic. From what I heared its fast and supports 2D / 3D very well. (TBGL...?) Anyway I got some questions now:

    What makes ThinBasic special?
    Should I switch from PB to TB?
    WHY should I switch?
    Is TB realy that much fast then PB?
    How big are the EXE's from TB and do I have to give any additional file?
    What exactly is TBGL and who develops it?

    I know I might be able to answer that questions myself with some more searching... but I hope you might help me with that.

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: ThinBasic... an alternative?

    Hi Polarwolf and welcome here.

    I will try to give you some fast info that maybe some other thinBasic user will be able to integrate.

    First and most important
    thinBasic is an interpreted language not a compiler. PowerBasic and PureBasic are compilers. It means they produce real 32bit code.
    thinBasic does not produce any 32bit executable code but read a text file (your source code), parse it and interpret it on the fly.

    What makes ThinBasic special?
    Well, this is very personal question. thinBasic can be special in different ways for different users. I think everyone of us should reply to this question. And if nothing special, maybe thinBasic is not the right tool. But I'm sure if one programmer or just someone loving programming spend enough time with thinBasic and thinBasic community, everyone will be able to find something special.

    Should I switch from PB to TB?
    I think NO. PB (here stand for PowerBasic / PureBasic) is very special and good product.
    thinBasic is something else maybe used in conjunction with PB or for some special projects.

    WHY should I switch?
    You do not have to switch but use the best tool for every specific project.
    There can be projects where you absolutely need a compiler. Other where an interpreted language like thinBasic can be used.

    Is TB realy that much fast then PB?
    An interpreted language cannot be fast as a an executable application generated by a true compiler.
    That said, thinBasic is very fast compared with other interpreted languages. You can have a look inside "\thinBasic\SampleScripts\general\Speed\" directory. There are some benchmark scripts that can give you an idea about how fast is thinBasic. Also you will find some posts here in community forum talking about thinBasic execution speed. We worked on execution speed a lot.

    How big are the EXE's from TB and do I have to give any additional file?
    Even if thinBasic is an interpreted language, Roberto has created what we call Bundled Exe.
    Bundled Exe are executable produced by thinAir IDE that are very similar to ZIP compressed files. They contains the main thinBasic engine plus the original script (usually obfuscated) plus additional files the programmer decide to add in there. When Bundled Exe are executed, all files included in there are exploded on disk and a special process is in change to start the main script. At the end, Bundled Exe behave is similar a standard exe.
    Usually executable created by thinAir are not bigger that 300/400 Kb but if you have used many modules or you decide to put images, sounds, or other files or even directories inside them, size will increase proportionally.

    What exactly is TBGL and who develops it?
    thinBasic has a modular structure.
    It means it has a Core engine in charge of the main parsing process plus all memory handling, variables, program flow, ... Around the main Core engine there are many additional modules (special DLLs) that implements the main thinBasic language adding many new keywords. There are modules for: file handling, user interface, console, math, ... and OpenGl. TBGL is one of the many modules specifically designed to implement OpenGL and a lot of additional stuffs like bone system, entity system. TBGL is developed by Petr Schreiber.
    Modules can be developed using different languages and compilers: PowerBasic, C, C++, ASM, FreeBasic.

    _________________________________________________
    Well, for the moment I think this can be enough. Hope other will add more.

    Ciao
    Eros

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: ThinBasic... an alternative?

    Hi Polarwolf,

    welcome to the world of ThinBasic

    I agree with Eros in all points, just have some additional comments:

    Speed
    ThinBasic is interpreter, but quite fast one, in my experience faster than default Windows Visual Basic Script for example, even for loops. On other side TB cannot compete with loop performance of compilers.

    But it has few nice speed tweakers:
    • Lot of commands which "do a lot" internally so they run at native speed ( array scanning, model rendering )
    • Dynamic string concatentation using "+" is faster than C# one ( without string builder )
    • ThinBasic has module for assembler, so you can code functions or smaller proggies which can match compiled speed, as long as you are friend with ASM
    • Memory overlays can save time spent with data conversion


    TBGL
    Author of this module is just writing this post TBGL is developed thanks to supporting ThinBasic community for almost 3 years now. Language used to produce DLL is PowerBASIC for Windows, 8.04.

    TBGL is module based on OpenGL library, so it provides access to hardware accelerated graphics. It is not basic 1:1 wrapper for OpenGL. Here are some features:
    • Initialization of OpenGL, including creating and destroying window
    • Basic keyboard and mouse input
    • Model loading and animation
    • Entity based system to for easier work with basic objects like cameras, lights, 3D primitives, models and more
    • Plotting text on screen or in 3D space
    • Automatic display list and texture garbage collection


    ... and much more, while maintaining compatibility with most cards on the market. Unlike GLUT for example, it is not callback based and it can be used to go more highlevel.
    At the same time it can be freely combined with native low level OpenGL up to v2.1, which is provided to ThinBasic via header file.

    You can learn more about TBGL from following resources:
    TBGL website - some tutorials and articles, plus download of auxiliary tools ( format converters, exporters, ... )
    TBGL Bonus Pack 1.6.0.10 - big package of 2D/3D graphics scripts contributed by forum members.


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4

    Re: ThinBasic... an alternative?

    WoW. Thank you people! You know what I love about "small" Languages? Exactly. The Codingteam is as close to the people who use their language as possible. (Sorry for my english... Im german) From what I hear now I'm kinda excited and will play around with Thin once I get some free days. Thank you very much!

  5. #5

    Re: ThinBasic... an alternative?

    Hi fellow and welcome here,

    yes you have mentioned a great or lets call it special feature that you don't find in PureBasic or any other basic out there. The developers of thinBasic and the 3rd party modules are all active thinBasic users and listen to your request to an extend that I have never seen elsewhere. We are like a family here, treat everyone with respect and help each other. THAT makes thinBasic stand out from all the other languages. Plus the fact that it is easily expandable with its SDK's.

    Cheers
    Michael

  6. #6

    Re: ThinBasic... an alternative?

    Yo! (Texan for Hello in plain english)

    More questions to add to this post.
    Why did you choose to make thinBasic an interpreted language instead of compiled?
    Why a scripting language?
    What exactly do scripting languages provide? (advantages/disadvantages)

    The Codingteam is as close to the people who use their language as possible.

    I agree with the above. I'm a noob but I am definitely impressed with the quick responses and enthusiasm from the code team.

    Pipes
    Contempt Prior to Investigation = Everlasting Ignorance

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: ThinBasic... an alternative?

    Why did you choose to make thinBasic an interpreted language instead of compiled?
    I started to develop thinBasic from a simple math parser I developed.
    I do not have any experience in developing compilers so for me it was natural to go with an interpreter. I like parsers, tokenizer, and in general handling with complex data structures but zero knowledge on the EXE generation.
    Roberto joined the project after some years I already developed thinBasic. He has a strong knowledge in ASM and EXE formats but not so strong in compilers too. He sometimes push me in the direction of creating a compiler. Maybe, in future, maybe.

    Why a scripting language?
    Well, I do not know how to reply to this question. Scripting is in general an application reading a text file (a script) and interpret it. So to me scripting language and interpreter are the same thing.

    What exactly do scripting languages provide? (advantages/disadvantages)
    I cannot reply with an exact answer to this question. There are many interpreter out there and everyone has its pro/cons, everyone has its own specific characteristics and peculiarities. We think to have some big advantages in the way we developed our module SDK. Everyone can contribute to thinBasic project developing modules that are compiled with real compiler. You can use PowerBasic, FreeBasic, C, ASM and few other compilers to develop thinBasic modules. Modules are special DLLs that implement new keywords in the language. Programmer developing modules has extreme freedom on how to design the syntax. thinBasic give you the parsing functionalities to interface with the main core. The rest is 100% your choice.
    In general the biggest pro and also cons in scripting languages is the execution speed. It will not be even close to the speed you can get from a compiled application. But also on this area thinBasic can be a nice surprise. Everyone can try and test. For many many kind of applications thinBasic can be an alternative to compiled applications.

    Hope to have replied to your questions.
    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  8. #8
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: ThinBasic... an alternative?

    Quote Originally Posted by Pipes
    I agree with the above. I'm a noob but I am definitely impressed with the quick responses and enthusiasm from the code team.
    Everyone can be code team in thinBasic.
    Just develop a module and you will be in the crew
    And if you like, we will open a dedicated forum where you can support your module.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  9. #9

    Re: ThinBasic... an alternative?

    Dudes I love you more'n more. Can ThinBasic already use Peek&Poke for Memoryaltering?

  10. #10
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: ThinBasic... an alternative?

    Hi Polarvolf,

    here is very basic example, as a bonus with memory variables overlays as well:
    [code=thinbasic]
    uses "console"

    ' -- Variable initalized to 3
    dim LuckyNumber as long = 3

    Printl "Lucky number : ", LuckyNumber

    ' -- Getting number using PEEK and pointer
    Printl "Lucky number from pointer : ", peek( long, varptr(LuckyNumber) )

    ' -- Setting number using POKE
    poke( long, varptr(LuckyNumber), 7 )
    Printl "Lucky number after pointer assignment : ", LuckyNumber

    ' -- Create variable over already existing one
    Dim HijackNumber as long at varptr(LuckyNumber)

    HijackNumber = 9
    Printl "Lucky number changed using overlay var: ", LuckyNumber

    waitkey
    [/code]

    VARPTR returns variable pointer to any thinBasic variable.
    For dynamic strings you can use STRPTR.

    Here is another trick - overlaying different data types:
    [code=thinbasic]
    uses "console"

    ' -- String variable
    dim MyText as string = "ABC"

    ' -- BYTE array overlayed over string
    dim MyASCII(3) AS BYTE at strptr(MyText)

    PRINTL "MyText variable :", MyText

    ' -- As MyASCII overlays MyText, it contains its ASCII values anytime
    ' -- To print MyASCII array values you can write all elements of array
    ' -- with any delimiter using JOIN$
    PRINTL "MyText variable ASCII values:", join$(MyASCII, ",")

    ' -- By assigning BYTE values we overwrite the string with D, E and F
    ARRAY ASSIGN MyASCII() = 68, 69, 70

    PRINTL "MyText modified from array :", MyText

    waitkey
    [/code]


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Page 1 of 2 12 LastLast

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •