View Full Version : Debugging of DLLs
Most of the compilers do their work with producing more or less bloat.
Using the PBWin compiler option in ThinBasic leads to best results currently. But programming does not consist of some few or a hundred of lines of code regulary, but because of it's complexity of thousands or hundredthousands of lines. So, work is not done with a compiler and a simple editor like Notepad or similiar with a built in debugger with the comfort of DOS even stepping through comment lines. (ThinBasic does NOT!).
It is also important to be able to edit large projects with dozens of include files and even search and find declares and functions and their references in the whole project. I think I need not to explain this in detail.
The most missed tool is a debugger for DLL coding, when there exists for instance one EXE and some DLLs. Just a debugging interpreter could do helpful work under these standard conditions. I think that a program like thinbasic would never leave an experimental state if it's programmers would not concentrate from the beginning on real large projects which are common nowadays. Currently it seems there exists only the new MS way of producing large bloat .NET programs or some poor trials to build projects with a debugger producing itself more work than writing the code.
A programmer who has to concentrate on complicated database or math solutions must be provided with a comfortable debugging tool with hoovering variables by cursor and so on...
So, what is the pupose of ThinBasic in future? Will it become a professional tool? Will it be able to really debug DLLs?
Petr Schreiber
17-05-2008, 20:42
Hi ibd,
welcome to the forums.
I wont answer to all your questions, for complete statement please wait for words from true thinBASIC authors - Eros and Roberto.
I am not native speaker so maybe I understood something wrong :)
So, work is not done with a compiler and a simple editor like Notepad or similiar with a built in debugger with the comfort of DOS even stepping through comment lines. (ThinBasic does NOT!).
Since quite recent version, there is possibility to step through lines.
When you start thinAir, thinBASIC IDE, create new script and want to debug, you have two options:
Click Debug/Start debug ( or press F8 )
Use "Trace" module in your project and it will turn on debugger each time script is executed
The Debugger is work in progress, but already allows stepping and adding watches, which is more than I ever needed.
I am not sure if you compare thinAIR to Notepad, I think thinAIR is to Notepad what is Lamborghini Diablo to Trabant :).
In fact along with PSPAD and IndeEd it is one of IDEs I consider exactly matching my needs ( multiple file opened, syntax highlighting, advanced editation, templates, export of HTML color code, ... )
I am little bit lost when you speak about DLL coding - do you mean in PowerBASIC ( I agree, great compiler ) or thinBASIC?
thinBASIC is interpreter, so not a tool to create DLL files. thinBASIC can produce stand alone EXEcutable, but it is not compiled EXE, "just" smartly packed interpreter and script ( still in many cases smaller than EXEs produced by some compilers ).
A programmer who has to concentrate on complicated database or math solutions must be provided with a comfortable debugging tool with hoovering variables by cursor and so on...
As I never used debugger, I can only recommend you to make post in thinAir / Suggest new features.
For tracking of important values I use output to console, but I understand you are used to debuggers.
Will it be able to really debug DLLs?
Answer to this question is no, because of its interpreter nature ( so it does not create DLLs ).
Being interpreted brings some advantages and disadvantages. One of the disadvantages could be the impossibility to create DLLs, on other side with interpreter you can do many things not present in compilers. Calling functions by name composed from string, evaluate expressions ... and yes, even use assembler ( provided via Oxygen official module by Charles Pegge ) with SSE - SSE4 instruction set :)
Thanks for your opinions and ideas, I am sure others will comment more soon.
What is the task you would like thinBASIC to use for?
Petr
ibd, welcome to the site. PowerBasic is different than thinBasic. PowerBasic compiles and probably applies to more what you are writing about and possible missing features.
Like a good project manager.
ThinBasic as Petr mentioned is on its way to giving us tracing features and already via thinAir provides pretty nice project management.
Eros, thinBasic developer is away, but should be back tomorrow to comment more with official info.
Michael Hartlef
18-05-2008, 09:47
To my knowledge, thinBasic is used in professional environments so to me thinBasic seems to be a professional tool for the task it is designed. It all depends of what you wanna do with it. You said complex math operations. Well, then I would use a compiled language anyway as any interpreted language simply lack the speed that it is important for such a task.
Thanks to all of You for your kind answers.
I confess I hate all MS compilers ans some others because of their bloatware results.
For me, an interpreter has primary the task to give me a very close contact to the code results while running it step by step. May be that we use the word 'interpreter' with different aspects. For me, an interpreter cannot really have the function to produce code ready to use in a professional environment. But it could be very helpful because of it's advanced features to debug complicated code sequences just to be able to control interim results step by step and to watch variable contents by simply hoovering them via cursor.
Also, the editor should have at least one important feature: Allowing to add simple graphical comments in the code script to explain for instance geometrical math operations by first view and not by searching and studying a code you can no more remember in the mean time.
Working with DLLs is normal. It is not an option. But just debugging of DLLs by referencing the source code seems to be a lack of common programming languages, (even if the DLL always uses the same memory as it's invoking EXE). Shure we cannot interpret DLLs when they are already compiled. But we could interpret source code of DLLs used as include files even with an interpreter as long as we are simply invoking functions inside the DLL source code. Compiling DLLs and also using their compiled code should not be a problem for an interpreter.
It's like a toolbox only conatinig a srew driver and a hammer. My fantasy lets me imagine what ever single tasks I could do with it .... but I never could really achive a professional result. The same is with an interpreter or compiler. So I think the most important work of a compiler or an interpreter should be to offer professional debugging options for any code. Otherwise, this tool could only offer some funny highlights in a user's experimental or learning state but without the possibility to produce real professional and large code. I write this here in my poor English because I'm engaged in prgramming already since 1976 and could work with some professional programming languages intensively and a lot of others appearing and disappearing after a short time. I confess that my experience currently tends to think about the future of any non MS programming language when they will stop access to their SDK. This is called monopolism. But nevertheless I'd whish to see ThinBasic merely as a complete and intelligent debugging tool, not so much as an EXE producer of the kind of many others.
ErosOlmi
19-05-2008, 12:17
Hi ibd and welcome here.
I have to confes I'm a bit confused about you first post because it seems to me that some terms were mixed with different concepts. So my first reply is to try to clarify what is thinBasic and what to expect from it (well from us).
thinBasic is a 100% interpreted language.
by 100% I mean thinBasic engine does not even produce any intermediate code in memory or any "just in time" compiled (or semi compiled) code. thinBasic engine continuosly parse and interpret source code. To get things to the extreme it could be even possible to change the source code while script is running. So, please, do not consider thinBasic comparing it with a compiler because they are two different software families.
thinBasic cannot produce DLLs
Again, thinBasic is a parser/interpreter. It does not produce any pure executable or DLL.
It is true that thinBasic can produce executable but to be 100% honest we call them "bundled" exe because executable produced by thinBundle are like compressed box containing the source code produced by the programmer (usually in obfuscated way) plus the full thinBasic engine. When executed, a thinBasic exe explode the package on disk and execute the included script
thinBasic has a debugger
As mentioned by Petr, since version 1.6.0.5 (http://www.thinbasic.com/public/products/thinBasic/help/html/version_1_6_0_5.htm) we have introduced a tracer/debugger. It is at its very beginning stage but so far you can:
execute scripts step by step
set break-points
watch simple variables (string, numeric and variants are supported so far)
If your scripts execute external fucntions (standard API or 3rd party DLL) you can trace their execution but of course you cannot get into them (we can debug other DLLs? Just a machine code debugger but that is another story).
thinBasic debugger as been developed as thinBasic module. Once at a good stage with its development (it is very recent) I will release source code of this module to demonstrate how easy will be to develop 3rd party tools that interact with executed scripts.
Some aspects I will improve in debugger in next versions are:
better variable inspection handling (possibility to inspect complex structures, possibility to get values with MouseHover)
better user interface (tollbars, tabs, list of variables)
handling of execution fucntions levels (stack position/inspection)
About thinBasic possibility to develop professional projects
Well, we can discuss 2/3 days here. One of the original target of thinBasic (and still it is) was to have high level functionalities in order to do things with very few lines of code. So things that in other languages require many lines, in thinBasic you just need 1 line. An example is the PARSE family of functions. This to say that lenght of a source code is not an important parameter to say if a project is professional or not. As mentioned by Michael, it depends on what you have to develop and how (single user, multi-user working at the same time on the same project sources, ...). thinBasic sources can have unlimited number of includes located in many different directories both with relative or absolute paths. It is up to you how to organize you sources and how complex make your file organization.
About thinAir (thinBasic editor and project manager)
thinAir is the thinBasic editor. It started as a simple editor but Roberto introduced many many tools to simplify coding.
F2 key opens a code browser that give you the complete visibility of your code.
F8 key execute the script in debug mode. Type in the right pane a variable name and you will have values shown.
Do you need some feature? thinAir is 100% written by Roberto, even the syntax coloring coding area (he didn't use any 3rd party toll for that). So if request is interesting we will try to implement it.
About thinBasic execution speed
Depending on the projects, thinBasic can be considered as valid or not as development tool. I can say thinBasic is quite fast, in many cased very fast. But I can say that when millions of interactions per seconds are involved, thinBasic is not the right choice. This due to its interpretative nature. Execution speed cannot be compared against a real compiler. Compiled code will remain much faster than interpreted code. But, please, test by yourself executing the many script we provide and the many others you can find in Bonus Pack download area: http://www.thinbasic.com/index.php?option=com_docman&task=cat_view&gid=23&Itemid=66
_________________________________________________
That said, I'm with you when you worried about the many different languages that along the years appeared and disappeared. As programmer or project developer you need to consider your investments in learning a new language. What I can tell you is that we are here to stay (we are just at the beginning) and do things as better as we can. You can evaluate how we do things by yourself looking at thinBasic help material and this support forum.
Ciao
Eros
Eros, thank You for Your explanation.
developing on the base of .NET is not my programming style and will never be, because I'm coming from unix and dont want to become an MS slave.
Look, even Borland has followed the steps of MS, which I would not have been able to imagine in former times.
I would have looked foward using ThinBasic as a tool getting a functional concept of code, test it with the interpreter and to transfer it to a compiler afterwards. The reason is simply that there no more exists a real complete developing tool with all the things I need to work directly with the Win SDK with a plain and complete (DLL) sourcecode debugger and/or an interpreter of same kind simulating the code without having to compile it each time. My project I'm working on since 1983 with different programming languages has nearly 1 mio lines and consists of many small and simply editable modular DLLs. But as You tell me, ThinBasic is only a kind of macro interpreter, which I cannot use, sorry. But its always better to ask.
Again, thank You
ErosOlmi
20-05-2008, 21:20
No problem, ibd.
If thinBasic will be able to help you in any way we will be happy.
Consider also we didn't talk about the possibility to expand thinBasic with modules. All DLLs you see in thinBasic\Lib\ directory are thinBAsic modules developed with different compiled languages using thinBasic SDK. Modules are special DLLs that interact and expand main thinBasic functionalities. Main thinBasic engine is responsible only of the flow of the script, the main numeric and string functions and memory allocation. All the rest is done by modules.
Ciao
Eros
PS: what areas is your project working on?
1 million lines seem referring to an ERP or kind of. Or maybe a scientific application.