Getting an old BASIC program to run online

T

trippeer

I have the source code to an old BASIC program that a friend of mine
would like to run online. I am a beginner at JS, but I think that it
would be a good choice for the project. My background is in C/C++ and
web development.

Any suggestions that might get me off to a good start here? I can
provide more information if needed, but I am not sure what would be
helpful. The program is 550 lines in what appears to be BASIC and is a
calendar conversion program. You give it a date and it will convert it
into one of many other date reckoning systems (Gregorian, Hebrew,
Egyptian, etc, etc).
 
T

trippeer

Yes, I would like to convert it to JS. As far as I know, I cannot get
it to run in a web page as is, so I plan on using the source code to
decipher the logic and rewrite it in JS.

I don't know what version of BASIC, but it seems pretty
straightforward. Lots of GOSUBS and GOTOs, and the arrays are populated
with a FOR/NEXT construction with READ and DATA keywords.
 
E

Evertjan.

[please do not toppost on usenet]
Yes, I would like to convert it to JS. As far as I know, I cannot get
it to run in a web page as is, so I plan on using the source code to
decipher the logic and rewrite it in JS.

I don't know what version of BASIC, but it seems pretty
straightforward. Lots of GOSUBS and GOTOs, and the arrays are
populated with a FOR/NEXT construction with READ and DATA keywords.

Automatic conversion is impossible, methinks.

Suggestion:
Try to understand the programme and write a JS programme
that has the same effect.

Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions. and rightly so.
 
B

Bart Van der Donck

Evertjan. said:
[...]
Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions.

<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO
 
E

Evertjan.

Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
Evertjan. said:
[...]
Modern progamming is module oriented, so the "goto" concept, heavily
attacked by Dijkstra in the 1970s, has been removed from the modern
language versions.

<quote>
GOTO is found in FORTRAN, Algol, COBOL, SNOBOL, BASIC, Common Lisp, C,
C++, C#, D, Pascal, Perl, PHP6 and many other languages.
</quote>

http://en.wikipedia.org/wiki/GOTO

"modern language _versions_" of _BASIC_,
thought that was obvious, Bart.

In your <http://en.wikipedia.org/wiki/GOTO> link:

"One famous criticism of GOTO is a 1968 letter by Edsger Dijkstra
called Go To Statement Considered Harmful."

also: <http://en.wikipedia.org/wiki/Edsger_Dijkstra>
or: <http://nl.wikipedia.org/wiki/Edsger_Dijkstra>
 
B

Bart Van der Donck

Evertjan. said:
Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:

"modern language _versions_" of _BASIC_,
thought that was obvious, Bart.

AFAIK GOTO should be present in all Basic versions/variants. I agree it
should not be used too much (just common 'structural' sense), but you
don't need GOTO to write spaghetti code :)
 
E

Evertjan.

Bart Van der Donck wrote on 09 aug 2006 in comp.lang.javascript:
AFAIK GOTO should be present in all Basic versions/variants. I agree it
should not be used too much (just common 'structural' sense), but you
don't need GOTO to write spaghetti code :)

That may be your opinion, Bart.
I tend, after many years of doubt, to agree with Dijkstra it should not.

Fact is it is not present in VB and VBS,
the only "modern versions" of Basic I know of..
 
J

John Fredrickson

Tripper,

There is no automated conversion system that I know of for going from an old
BASIC to JavaScript. It would be best if you analyzed the program and
documented its behavior and then rewote it by hand. A BASIC compiler or
interpreter may come in handy to guarantee that the new JavaScript program
behaves identically to the old BASIC program.

Perhaps you would like to share the BASIC source code so we can experiment
with it.

John Fredrickson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top