Do you prototype code in another language?

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Do you prototype code in another language?

Post by benryves »

I was just curious as to whether people prototype code in another language before rewriting it in assembly, ala Ken Silverman and QuickBasic.

I find it a lot easier to work in a higher level language to try and work out how to do something before implementing it in Z80. I'll start with everything in floating point, then slowly convert down to fixed point until it's all using 16-bit or 8-bit variables. Some things, if I can automatically think of them in a fixed-point style, I'll write in Z80 assembly straight up.

Does anyone else do this?
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

Not for Z80 projects, those are simple enough (at least the ones I made so far) to be quite tractable. As for bigger ones, I found that prototyping in a high-level domain specific language can be very helpful. One example was a parse tree postprocessor which transformed trees by certain rules and also required pattern matching. I wrote a prototype in Prolog, then rewrote it in C++ after the algorithm reached its final shape.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I usually don't, but sometimes when I start working on something new, something I have never done before, I prefer to try things out in a language I am most comfortable with at that time, before rewriting it in the desired language. That way I spend less time implementing and more time thinking about the logic behind it, which can be quite beneficial.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

I agree with Timendus, though I don't code in z80 Asm I have done something similar to this. When I was in Comp Sci I used to code the assignment in TI-Basic, which would get me thinking of the logic rather than the actual code, then go onto the computer and code it. Sadly it was a Java class, but I was able to do some things in it.
User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Psuedocode is a valuable tool, code it up in that language, then translate it to whatever.
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
KermMartian
Calc Wizard
Posts: 549
Joined: Tue 05 Jul, 2005 11:28 pm
Contact:

Post by KermMartian »

Never. Sometimes I flowchart, but I don't prototype at all before ASMing it.
Image Image Image
Spencer
Extreme Poster
Posts: 346
Joined: Mon 17 Jan, 2005 8:56 am
Location: Indiana

Post by Spencer »

That's an interesting question. I'd say all of us rely on some sort of organizational tool if we're working on a particularly tricky algorithm. Higher level languages are quite useful since, often, there are obvious analogues to our assembly. Dry erase boards are actually my preference. :)
Gambit
Sir Posts-A-Lot
Posts: 252
Joined: Mon 21 Feb, 2005 5:34 am
Location: Laveen, Arizona

Post by Gambit »

If it's a "simple" program, then no, I jump straight to low level logic and add comments to supplement the lack of pre-code. For any massive project, however, I write the logic in pseudocode (on paper if I'm at school, in a text editor at home), where it is then broken down to low-level logic (i.e. routines, macros, defines), and finally coded (with comments). This "modularization" method (+comments) eliminates most of the potential logic errors and therefore I don't have to recode it after a month just because "the code is weird" or "I don't know what the * I did" :)
"If SOURCE is outlawed, only outlaws will have SOURCE."
the_unknown_one
Calc Master
Posts: 1089
Joined: Fri 17 Dec, 2004 9:53 am

Post by the_unknown_one »

I don't, except if i'm making something for calculator which I already made on PC.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

I used to do that a bit when i was learning z80, but only on some of the tougher things. It can be really helpful if the algorithm in question is pretty large. Plus if its something that is unproven, it can be a nice way to validate it quicker.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

I do things backwards. I code my ideas in Calculator BASIC before doing anything in GBA code. This way, I can see my logic run "as it happens" due to the calcs slowness, and pretty much identify any logic errors in real time. Being able to easily look at variable values is nice too, as you can see them even if the program crashes.
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I do what tgf does.
Image
KevinJB
Calc Wizard
Posts: 501
Joined: Sat 28 May, 2005 5:34 am
Location: Chesapeake, Virginia
Contact:

Post by KevinJB »

When I was in Comp Sci I used to code the assignment in TI-Basic, which would get me thinking of the logic rather than the actual code, then go onto the computer and code it. Sadly it was a Java class, but I was able to do some things in it.
Dude! Me too, same situation!
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
KevinJB | RevSoft
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Rezek wrote:
When I was in Comp Sci I used to code the assignment in TI-Basic, which would get me thinking of the logic rather than the actual code, then go onto the computer and code it. Sadly it was a Java class, but I was able to do some things in it.
Dude! Me too, same situation!
Cool, now I don't feel alone! :D
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

I'm still really bad at coding and I find it just hard to convert pseudo code to real code sometimes because I still don't know all the little details of z80 and C syntax :(
Image Image Image
Post Reply