Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: thinBasic as script

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    thinBasic as script

    Guys, since the goal, from some of the posts I read about thinBasic, is to be a powerful scripting language. That is to augment other programs and not be the one and only be all language to make professional applications. Do you see it as being like python then?

    The reason I ask is, maybe you should look at the best third party libraries out there, like you did with Bass for sound and make thinBasic commands to work with these libraries and engines as the scripting language. The thought came to mind tonight as I read on coding monkeys the post by Mike about openAL.

    It would be neat if thinBasic tied in seamlessly with the best out there in engines like these: OGRE, physx, openAL etc as TBGL ties into openGL and of course the existing commands for BASS.

    OGRE and ODE seem to work together, I have not used either. I don't know what is a good input library or engine. But maybe there could be a thread to take a poll on coding monkeys for such a wish list. I would say there rather than here to get an idea from the wider programming audience and possible ways to bring more users to thinBasic.

    What do you guys think? If you like the idea Eros or Roberto should start it as you guys are thinBasic and it would show interest in this direction and maybe get the eyes of other programmers.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

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

    Re: thinBasic as script

    Hi kryton9,

    interesting ! In my opinion, I think the way to communicate with such a third parties would be better by set of headers ( include files ) rather than making it into the modules.

    I like thinBASIC is still in acceptable size for download. thinBASIC is developing very fast, and I want to have every latest version ;D. But idea that I will download 50MB ( including all thirdparties ) package every few weeks is scary for me. So my suggestion is to create some "includes" repository, where everybody could upload his version of headers. Maybe on http://scripts.thinbasic.com/ ?

    I think it would be massacre to want Eros and Roberto make all this extra work - they are making excellent job, but I am afraid it already bites out big piece of their personal life.

    But I am all for the poll, I could help with headers when needed.


    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

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

    Re: thinBasic as script

    Yes, I agree with Petr.

    When you think you have an idea to create an interface for external libs, in thinBasic there are 2 ways:
    • create text .inc file with all the necessary DECLARE and include it in your script
    • make a thinBasic module compiled using Power Basic or C or possibly Delphi when I will solve string passing


    The preferred one is an interface file with all the DECLAREs. Very easy to maintain/share and no need to include in thinBasic all the libraries (sometimes bigger than thinBasic itself).

    Why I made some modules instead of file? It depends library from library. For example C++ libraries are not easy to interface because they use objects (pointers to objects). Some other libs are not free so I need to pass a key I cannot share with thinBasic users. And other reasons.

    So, Kryton9, if you want to start an interface file for some of the libraries you mentioned, I will try to help. Consider I'm looking at Delphi string problem so, when solved, you will be able to use Delphi to create thinBasic modules.

    At the moment we do not have enough time to dedicate to external 3rd party libraries even if we would like and it would be very interesting. We nned to concentrate our time on Core module stability and functionalities because if this will not work fine, all will fail.

    Let me know.
    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

  4. #4
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinBasic as script

    Petr and Eros, thanks for clearing up a bit more for me how all of this works. I didn't know it could be done with just headers, although I am not sure how headers work and are made.

    That makes perfect sense your explanations about download size and of course keeping up with updates, this way of making headers sounds like the best solution and really the way it should be.

    Can one of you guys write a short example of how a header is made. Where would I get the information from the third party library, how would I convert it to a header for thinBasic?

    Now about making modules, can you provide an example in C for a dll to be compiled to a DLL, so I can try it out with the various C/C++ languages I have to see if I can get it to work. Would C# work also?

    Thanks, I guess understanding all of these will help me better plan my thinBasic work flow.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

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

    Re: thinBasic as script

    Kryton9,

    you can get some include file examples under \thinBasic\Inc directory.
    I made include file for ODBC, Petr made include files for GL and GLU. RMChart.inc is another.

    How to create an include file? First thing is to know how the function you want to use is declared in your libray documentation. Than write an include file following parameter types. Very important is the passing by mode. By default thinBasic pass all paramaters to external function BYREF unless something different specified. Most of the time external libs (like Windows API) pass parameters BYVAL, so important to specify BYVAL just in front the parameter.

    Regarding C/C++ examples, please have a look at \thinBasic\SDK\ directory. There is a .zip file you can expand in order to get relevant interface and few examples.

    C#? We didn't produce any interface for .Net languages mainly due to missing time
    Roberto is a .Net guru so if you are really interested we can spend some time to create a thinBasic/.Net interface.

    Anyhow, we are here to help you.

    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

  6. #6
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinBasic as script

    Thanks for all the info, a pleasure to ask a question and get such very nice answers back so quickly. I will look through all the SDK stuff that is included with thinBasic and if I can get one of those working that will be great. If not, will ask about maybe c# version, but not needed at the moment. I just wasn't sure if the c/c++ stuff would work with c#, I didn't think it would, but thought I would ask to make sure.

    I was playing with Turbo Delphi and the problem in the example that is causing the problem is the line pchar = 0. I noticed Turbo Delphi says it converts the 0 to NIL. Apparently Delphi 6 allowed this to pass 0 and never converted to NIL. I don't know if that will help troubleshoot the Delphi SDK code. Also I noticed my DLL from Turbo Delphi is twice the size of Petr's DLL made from Delphi 6. That really surprised me. Any of you guys have an idea of why that would be?
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

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

    Re: thinBasic as script

    Regarding Delphi dll size, see if there is an option to leave debug information in there. In this case the size will even double or more.
    Onestly I didn't have time to see the problem regarding string parameter passing. I have a document to look at kindly posted by Mike Stefanik in PB forum: http://www.codexterity.com/memmgr.htm
    I will have a look ASAP.

    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,782
    Rep Power
    10

    Re: thinBasic as script

    Kryton9,

    forgot to say that thinBasic syntax to write external declares files is very, very close to Power Basic syntax and also very close to Free Basic syntax.
    So if you are looking for a library ath is also present in Free Basic distribution, you can get Free Basic .inc files (if not copyrighted) and see what happen. You should be able to use them quite stright away.

    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

  9. #9
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinBasic as script

    Thanks Eros, never used powerbasic or free basic, but glad to know to study I can look at their stuff. Thanks!!

    I jump into the water before knowing how to swim, but I seem to learn faster that way. I can't figure out how to compile the dll's so far, other than the one in Delphi. I will keep tracking down the errors to figure out what I am doing wrong. I will give myself till late tonight, which will be late in the morning by the time I get to sleep. If I make no progress I will ask for help with maybe better questions on where I am stuck.

    I will get this figured out one or another and I am sure of that with your guys great help!!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: thinBasic as script

    Not to change the subject, but it also does tie into the subject. When you read about scripting languages 2 stand out. For games Lua and for games & general purpose Python.

    1. What made you guys take on this monumental task to write a scripting language when 2 very good and popular ones exist and seem to do everything? I have not used either because have wanted to settle in on a compiled language, but playing with thinBasic I do see the benfits of having an interpreted language as a tool to work along with a compiled language.

    2. With the knowledge obviously Eros and Roberto have, I was wondering what you saw you didn't like in those languages or what you thought could be different in what thinBasic could do or offer?

    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 3 123 LastLast

Similar Threads

  1. DLL ready so Thinbasic can be used as a script language?
    By Michael Hartlef in forum thinBasic General
    Replies: 8
    Last Post: 29-02-2008, 12:03

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
  •