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.

Edited by Jacques1
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.