Jump to content

GW Basic, Turbo Pascal


Arctic

Recommended Posts

I want to program old-fashioned basic on my web pages.
Is it possible, and which solution is best for getting it done?

This is an example of what I want to program and execute on webpage:

10 INPUT "Enter a numer" $NUMBER
20 IF $NUMBER >100 GOTO 40
30 PRINT "The number was lower than 100"
40 PRINT " The number was higher than 100"

What opportunities exist today for such programming on web pages?
I understand that php is not suitable for this, when the program gets big with many thousands of lines?

Link to comment
Share on other sites

Your question is oddly phrased.

 

If you want to execute Pascal code (or any other language), then you obviously need a compiler or interpreter for this specific language. Where is that supposed to come from? Are you planning to write your own from scratch? Or do you already have a compiler/interpreter on your server and merely want to invoke it through PHP?

 

Writing your own compiler for a nontrivial language is a shitload of work and requires deep technical knowledge. It may be realistic for a small subset of BASIC like the code you've posted. It's hardly realistic for anything else.

 

Or are you asking us how to invoke your favorite Pascal compiler with PHP? Then we need more specific information. What compiler? How does it work? etc.

 

In any case, one major problem will be security. When you have a website which executes arbitrary code, then one of the first things people will do is execute malware. You obviously don't want that. So now we're talking about a complex filter and sandboxing mechanism, which is a very difficult problem even for experts. I'm not sure you understand what you're getting yourself into.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.