Arctic Posted June 15, 2017 Share Posted June 15, 2017 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" $NUMBER20 IF $NUMBER >100 GOTO 4030 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? Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted June 15, 2017 Share Posted June 15, 2017 (edited) 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 June 15, 2017 by Jacques1 Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 16, 2017 Share Posted June 16, 2017 Uh, why can't that sample code be implemented using PHP on your webpage? What's the problem with it? That is what php is all about! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.