Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google App Engine support C++? [closed]

The main App Engine page states "Application code written for the Python environment must be written exclusively in Python. Extensions written in the C language are not supported."

https://developers.google.com/appengine/docs/whatisgoogleappengine

We need to port a C/C++ app to a SaaS service. Can it be done with Google App Engine?

like image 607
RobG Avatar asked Apr 04 '13 02:04

RobG


1 Answers

There are currently four runtimes available for Google App Engine: Go, Java, Python & PHP.

Not only are these the only runtimes available, but you're also limited in the capabilities of the language. Many traditionally available subsystems aren't available to you to help your web application scale. The primary examples on the page you linked to mention that opening sockets or writing to a filesystem aren't allowed. Threading or performing computations that take longer than a minute of wall clock time are another common limitation.

The Sandbox

Applications run in a secure environment that provides limited access to the underlying operating system. These limitations allow App Engine to distribute web requests for the application across multiple servers, and start and stop servers to meet traffic demands. The sandbox isolates your application in its own secure, reliable environment that is independent of the hardware, operating system and physical location of the web server.

Examples of the limitations of the secure sandbox environment include:

  • An application can only access other computers on the Internet through the provided URL fetch and email services. Other computers can only connect to the application by making HTTP (or HTTPS) requests on the standard ports.
  • Applications cannot write to the file system in any of the runtime environments. An application can read files, but only files uploaded with the application code. The app must use the App Engine datastore, memcache or other services for all data that persists between requests. The Python 2.7 environment allows bytecode to be read, written, and modified.
  • Application code only runs in response to a web request, a queued task, or a scheduled task, and must return response data within 60 seconds in any case. A request handler cannot spawn a sub-process or execute code after the response has been sent.

The focus for Google App Engine is to write a single threaded application built upon the scalable services they provide. It's quite a paradigm shift from traditional C/C++ app development because you're required to use Google's mechanism for storing data, accessing other resources on the internet, sending and receiving email, caching. The reason for this is to eliminate bottlenecks in your application so that a large number of instances of your application can brought up and torn down based on request demands.

Porting a traditional C/C++ app to GAE (and many other SaaS) will most likely require so much refactoring that a rewrite will be required to take advantage of the gains you can make running on a SaaS platform.

like image 71
GilbertErik Avatar answered Oct 30 '22 06:10

GilbertErik