LB Booster
IDE and Compiler >> Compiler >> Differences when compiled http://lbb.conforums.com/index.cgi?board=compiler&action=display&num=1417107930 Differences when compiled
Post by Richard Russell on Nov 27th, 2014, 4:05pm
One unfortunate characteristic of LB 4.04 is that code sometimes runs properly when executed from the IDE, but fails when compiled (i.e. run as a TKN). It would appear that the syntax checking performed is different. This can be difficult to diagnose, since the usual fault-finding techniques (e.g. using the debugger) don't help.
Although I wouldn't want to say that it's impossible for something similar to happen in LBB, as far as I know there are no circumstances in which code that runs correctly from the IDE will fail when run as an EXE. Indeed, when you run a program from the LBB IDE exactly the same runtime engine is used as when the program is run as an EXE.
The only difference is that when compiled to an EXE comments and unnecessary spaces are deleted from the program, so you may find that it runs slightly more quickly.
Richard.
Re: Differences when compiled
Post by Richard Russell on Dec 31st, 2014, 11:23am
One unfortunate characteristic of LB 4.04 is that code sometimes runs properly when executed from the IDE, but fails when compiled
Another 'feature' of LB 4.04, which has come up recently at the Community Forum, is that a compiled program may run significantly more slowly than it does in the IDE. This is indeed unexpected, and once again I can confidently state that LBB won't show a similar behaviour (if there is any noticeable speed difference it should be the compiled version which runs faster).
Carl states that "TKN files are not guaranteed to run faster than their non-TKN version" and I would not necessarily expect them to, since LB and LBB programs are interpreted. But running significantly slower is another matter and Carl has so far failed to explain that.
He additionally comments that "Liberty BASIC does not compile to native machine code. It compiles to an intermediary form". Anybody with LBB and a (registered) version of LB can discover for themselves exactly what a TKN file contains; all they need to do is compile a program in LB 4.04 and load the generated TKN file into the LBB editor (their User Name and LB Password are required).
If you do that, one obvious difference is that the TKN version contains more 'whitespace' than the original code. For example consider this simple program:
Code:
texteditor #w.te,10,10,280,280
open "Test" for window as #w
#w.te sqr(2)
wait
When 'compiled' to a TKN this becomes:
Code:
TEXTEDITOR #w.te , 10 , 10 , 280 , 280
OPEN "Test" FOR window AS #w
#w.te SQR( 2 )
WAIT
END
You can see that additional spaces have been inserted around the commas, and to separate the 2 from the surrounding parentheses. In a typical program these additional spaces can amount to a substantial increase in the overall size of the code, and I wonder if this contributes to the slowness of execution.
Ironically, the main difference between a compiled LBB program and the version you see in the IDE (when the 'Show LBB pane' option is selected) is that unnecessary white space is removed!
Richard.
Re: Differences when compiled
Post by net2014 on Dec 31st, 2014, 3:41pm
Wow, that's useful info!
Compliments of the season Richard and many thanks for your continued support and development. Long live LBB.
Re: Differences when compiled
Post by SarmedNafi on Jan 3rd, 2015, 02:37am
At Last You declare this fact.
Richard, It's made no change, the tkn files is secure enough, at least on my area. LBB is useful, no doubt, yesterday I got a great help from (endless) LBB error messages. I Thank you very much.
Sarmed
Re: Differences when compiled
Post by Richard Russell on Jan 3rd, 2015, 09:55am
It's not 'new information'. The LBB Help file says this: "You can alternatively load a .TKN file created by Liberty BASIC. This can be very useful if you have deleted or mislaid a program, but still have a TKN file generated from it. Note that you must know the original user's Name and LB Password; it is not possible to load a TKN file created by Just BASIC or an unregistered copy of Liberty BASIC."
Going back more than a year, the list of changes in LBB v2.30 stated: "A bug in the TKN decoder, causing very long lines to be garbled, is fixed".
Quote:
It's made no change, the tkn files is secure enough
LBB hasn't compromised the security of TKN files, since it only allows you to decode them if you know the User Name and Password with which they were created (in other words, you can only decode a TKN which you created yourself).
The real security breach occurred long before LBB even existed, when somebody (not me!) published online a program to decode TKN files without knowing that information. This allowed commercial programs created using Liberty BASIC to be reverse-engineered.
Richard.
Re: Differences when compiled
Post by net2014 on Jan 3rd, 2015, 10:42am
LBB hasn't compromised the security of TKN files, since it only allows you to decode them if you know the User Name and Password with which they were created (in other words, you can only decode a TKN which you created yourself).
Richard.
That's why I was pleased to discover that LBB could reveal my TKNs. I had some from years back, for which the LB source had been lost. I was not aware of any other 'dodgy' methods.
Re: Differences when compiled
Post by Richard Russell on Jan 3rd, 2015, 3:20pm
It's extremely kind of you to say so, but sadly it is not a view universally shared. Indeed there is at least one member of this forum who not only would like LBB to have a short life, they would like me to have a short life too!
Never before have I encountered such a degree of personal animosity. I will continue to try to ignore it, but it isn't always easy.
Richard.
Re: Differences when compiled
Post by net2014 on Jan 4th, 2015, 09:10am
It's extremely kind of you to say so, but sadly it is not a view universally shared. Indeed there is at least one member of this forum who not only would like LBB to have a short life, they would like me to have a short life too!
Never before have I encountered such a degree of personal animosity. I will continue to try to ignore it, but it isn't always easy.
Richard.
Very sad (and pathetic, shame on those responsible)! LB has failed due to very slow development progress and unfulfilled promises. It is still one of the easiest languages to build windows applications but has too many faults and LBB has bought dramatic improvements quickly. Time is of the essence for us oldies, who do not have too many years left to continue waiting on promises which do not materialise.