简体   繁体   中英

Multiple server-side languages in one file?

As a web developer I know I can communicate between multiple languages using GET and POST, but that involves having at least one file per language even if all those files are only used together and for only one task.

One thing I have not been able to find information on (even information completely denying/disproving the idea) is having all those multiple languages in a single file and have each language processed by the server - specifically in such a way that the order in which the languages are used doesn't matter, so that variables/functions can be used interchangeably. The closest thing I have found to this is SNAP , but even that simply reproduces the functions, not actually making them directly usable in an interchangeable manner.

All the information I can find about language interoperability is focused on having the languages separate , which leads me to believe that same-file interoperability cannot work (at least between non-related languages, like combining PHP with ASP.Net) but I would like to have this clarified.

I have seen example of embedded SQL in other languages which work quite nicely. I think the problem is the complexity of supporting this code increases dramatically.

You can run PHP, Java and .NET currently by having one call the other but its not clean or natural or supported by IDEs and its often better to pick one language and use that where possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM