Author |
Message |
|
stef
Newbie
Joined: 15 Aug 2006 Posts: 36
|
Posted: 25 Aug 2006 11:37:53 am Post subject: |
|
|
I know it's not about TI-Basic,
but on the other forum there's not much traffic,
and as Basic is close to Pascal,
I decided to post the question here.
I hearda rumour that there is a Pasal compiler for TI-83 and or TI-84,
but some searches with several search engines didn't reveal anything.
Does anyone know if a Pascal compiler exists,
I'ld love to get rid of gotos ;-)
cheers,
Stef |
|
Back to top |
|
|
Weregoose Authentic INTJ
Super Elite (Last Title)
Joined: 25 Nov 2004 Posts: 3976
|
Posted: 25 Aug 2006 12:59:12 pm Post subject: |
|
|
I moved it anyway.
Not as much traffic as TI-Basic?
Well, that's true, but there aren't just the eight posts that you see...
Now, to answer your question:
http://www.ocf.berkeley.edu/~pad/faq/prog.html wrote: There is also a Pascal compiler called UltraPascal for the 68K calculators. The code generated is usually of tolerable quality, but not nearly as good as you get from TI-GCC. I wouldn't know of Pascal⇒TI-Basic conversion, though. |
|
Back to top |
|
|
stef
Newbie
Joined: 15 Aug 2006 Posts: 36
|
Posted: 25 Aug 2006 01:28:53 pm Post subject: |
|
|
ok, thanks for the answer.
I just looked at the description of UltraPascal,
but it's only suited for the 68k calculators ;-)
Pascal => TI-basic should be possible,
although it will be a limited Pascal,
where I guess, the major limitation will be
the unavailabilty of local vars.
cheers,
Stef |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 25 Aug 2006 05:30:52 pm Post subject: |
|
|
As long as you're writing the code in Pascal, you might as well translate it to assembly. |
|
Back to top |
|
|
stef
Newbie
Joined: 15 Aug 2006 Posts: 36
|
Posted: 26 Aug 2006 09:10:02 am Post subject: |
|
|
writing a compiler is much complexer task,
than simply writing a pre-processor ;-)
Viewing at the TI-basic language structure,
I think at lot of profit can be gained,
by just adding the element "procedure".
This will not only make the progam much more readable,
but also faster to execute.
As I've not much experience with TI-basic,
so there might be a few other of these tricks.
But maybe it's just a crazy wild idea,
of a totally unexperienced user.
Some more: what about a list of unused variables / lables etc ? |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 26 Aug 2006 10:38:04 am Post subject: |
|
|
You don't really gain much from having procedures if you don't have local variables and can't pass arguments (other than in global variables) But if you could, it would be really cool - I don't think that's possible in TI-Basic without using slow and complicated methods, though. |
|
Back to top |
|
|
stef
Newbie
Joined: 15 Aug 2006 Posts: 36
|
Posted: 27 Aug 2006 09:30:03 am Post subject: |
|
|
DarkerLine wrote: You don't really gain much from having procedures if you don't have local variables and can't pass arguments (other than in global variables) But if you could, it would be really cool - I don't think that's possible in TI-Basic without using slow and complicated methods, though.
[post="87150"]<{POST_SNAPBACK}>[/post]
I just tried it with a little piece of code, passing the elements through L6,
- if you need a procedure just once, the overhead is much
- it's always much too slow (I passed 3 parameters.
So indeed you're right, procedures in the real sense is not the way to go.
So I'll try another way around, virtual procedures, which will be written inline, which is in fact nothing more than macro-substitution,
but it could make a program more readible and less error sensitive.
cheers,
Stef |
|
Back to top |
|
|
elfprince13 Retired
Super Elite (Last Title)
Joined: 11 Apr 2005 Posts: 3500
|
Posted: 27 Aug 2006 07:14:01 pm Post subject: |
|
|
in other words parameters are always passed by reference, not value. a lot of times its more memory efficient to separate often used chunks of code into a separate program which you can then call. |
|
Back to top |
|
|
stef
Newbie
Joined: 15 Aug 2006 Posts: 36
|
Posted: 28 Aug 2006 01:01:13 pm Post subject: |
|
|
elfprince13 wrote: in other words parameters are always passed by reference, not value. a lot of times its more memory efficient to separate often used chunks of code into a separate program which you can then call.
[post="87207"]<{POST_SNAPBACK}>[/post]
Yes but that has a few disadvantages
- you need to download all your subprogs from the archive (and loose them when you crash), and AFAIK there's no way to download the subprogs by program code
- if subprog uses some vars, they are unavailable as global for the main program
So I still think macro's is thé way to go (within the limitations of TI-basic).
cheers,
Stef |
|
Back to top |
|
|
|