Author |
Topic: Differences when compiled (Read 1315 times) |
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Differences when compiled
« Thread started 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.
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Differences when compiled
« Reply #1 on: Dec 31st, 2014, 11:23am » |
|
on Nov 27th, 2014, 4:05pm, Richard Russell wrote: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.
|
|
|
|
net2014
New Member
member is offline
Posts: 37
|
|
Re: Differences when compiled
« Reply #2 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.
|
|
Logged
|
|
|
|
SarmedNafi
Junior Member
member is offline
Posts: 93
|
|
Re: Differences when compiled
« Reply #3 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
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Differences when compiled
« Reply #4 on: Jan 3rd, 2015, 09:55am » |
|
on Jan 3rd, 2015, 02:37am, SarmedNafi wrote:At Last You declare this fact. |
|
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.
|
|
Logged
|
|
|
|
net2014
New Member
member is offline
Posts: 37
|
|
Re: Differences when compiled
« Reply #5 on: Jan 3rd, 2015, 10:42am » |
|
on Jan 3rd, 2015, 09:55am, Richard Russell wrote: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.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Differences when compiled
« Reply #6 on: Jan 3rd, 2015, 3:20pm » |
|
on Dec 31st, 2014, 3:41pm, net2014 wrote: 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.
|
|
Logged
|
|
|
|
net2014
New Member
member is offline
Posts: 37
|
|
Re: Differences when compiled
« Reply #7 on: Jan 4th, 2015, 09:10am » |
|
on Jan 3rd, 2015, 3:20pm, Richard Russell wrote: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.
Iv'e sent you a PM.
|
|
Logged
|
|
|
|
|