TNT HQ, England
Hey! I just found out why TNT has a limitted speed: because it does not compile!
Yep, TNT Basic's engine isn't a compiler, but it's not an interpreter either. It falls somewhere between the two. We're going to rewrite it's engine at some point this year which will speed it up quite a lot.
I is not like hypercard, where the player comes seperatly. When you think it's compilling, in fact TNT is just shoving your resources INTO a player.
You make it sound like there's something wrong with doing this or something! This is how most tools that produce executables work - they have a template (or player) which you supply with some resources to create a standalone product. When you run this, it uses the resources to run your game.
For those who didn't understand, look at this example:
When you launch a game REALLY compiled, the computer receives those messages:
-Hide the cursor
-Darken the screen
-Show a sprite
As in TNT it just does:
-Open the code
-Read the first line
-if the first line is Hide Cursor then Hide the cursor
-if the first line is Fade Down then Darken the screen
-and so it goes on
as you can see this is much slower, though I don't know if it is actually accessible for TNT's developpers.
TNT Basic doesn't interpret your code as it goes along because that would indeed be very slow. What is does is much closer to your first example than your second.
It runs through your code once when it loads it, converts it into a form that it can run much faster then runs it. It's not a meta compiler or a true compiler, but isn't an interpreter either.
I think the point you're trying to make is that the code is telling the TNT Basic engine what it wants to do, then the engine is telling the Mac, rather than the code telling the Mac directly. This is obviously slower than if there wasn't this layer inbetween the two - but isn't as slow as you might think.
When we rewrite our engine, we'll cut down on this layer greatly and it will speed things up a lot, but it will always be there as it's how we manage to report run time errors when you do something bad in your code instead of letting your crash the mac.
For example, if your code told the mac to draw graphics to a canvas that you hadn't opened, then it would crash (or if on Mac OS X , your game would be terminated). Instead TNT Basic intercepts this and points out that you've not opened the canvas.
Forget about Object-oriented commands . I just started learning how to do Object-Oriented programming and I just realised a language IS or IS NOT object. You can't insert features.
I'm afraid I don't understand this. Can you explain?
TNT Basic will probably gain object-orientated features with the engine re-write.
I would LOVE to have a TAB option ( spaces when you enter statements )
I'm not sure I understand you again :(
You can use tab in Hieroglyph to indent your code - is that what you mean?
Quebec ( Canada )
Sorry for the compilling thing, I was mistaking! ( I didn't mean to make it sound bad, I just meant to point out why I thought it was slower )
Well, it is possible to add features looking object-oriented, but it will stay a BASIC language unless you add pointers, methods, classes ! If TNT was COMPLETELY object-oriented, the codes made in earlier versions would not work anymore. That's what I meant. Next time I'll try to be more preciseful :) .
I would mean an automatic tab option: click on tab and all spaces are just placed automatically!