- 18 years old.
- Five years of programming experience.
- One year of professional experience at Stickman Ventures.
- Source: https://github.com/jaccarmac/creative-app-engine
- Submodules:
- Python/Java/PHP/Go.
- Python: PyPI.
- Java: Maven Central/Clojars/Gradle
- Go: Standard library/the Internet.
- PHP: ?/App Engine’s extensions.
- Google’s libraries.
from google.appengine.ext import ndb
class TestModel(ndb.Model):
x = ndb.StringProperty(required=True)
y = ndb.GeoPtProperty
z = ndb.DateTimeProperty(auto_now_add=True)
TestModel(x="test").put()
TestModel.query(TestModel.x == "test")
- Nine classes.
- Three instance types.
- Automatic.
- Manual.
- Basic.
- Free instance hours.
- 28/8/8.
- Limited file I. No O.
- No native extensions.
- Response time limits.
- Python is slow.
- Java is complex.
- Go is new.
- PHP is PHP.
- Configuration won’t transfer to other hosts (exception: Java…).
- App Engine libraries only work on App Engine.
- App Engine uses the JVM, which is fantastic.
- You can use your favorite JVM language (Scala, Clojure, Python, Ruby).
- WAR directories seem fancy, but they aren’t.
- Class files.
- XML.
- Generate an archetype.
mvn archetype:generate com.google.appengine.archetypes:skeleton-archetype 1 com.jaccarmac.neumont-dlc example 0-1-0 Y
- Edit
example/example-ear/src/main/application/META-INF/appengine-application.xml
.<application>example</application>
- Edit
example/pom.xml
.<appengine.target.version>1.9.6</appengine.target.version>
- Compile everything.
mvn clean install
- Write Java servlets.
- Generate a Compojure project.
lein new compojure example
- WAR it up.
lein ring uberwar
- Unzip the WAR.
- Write your own
example/appengine-web.xml
.<appengine-web-app xlmns="http://appengine.google.com/ns/1.0"> <application>example</application> <version>0-1-0</version> <threadsafe>true</threadsafe> </appengine-web-app>
- Copy it into
example/war/WEB-INF
. - Deploy or test.
dev_appserver.sh war appcfg.sh update war
- Make class files.
- Put them in a WAR.
- Write some XML.
- Deploy.
- Profit?
- Go is relatively fast.
- Go runs the first time (!).
- Go is still young.
- Access great libraries.
- Write fast.
- Run slow.
Get from this:
import webapp2
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'text/plain'
self.response.write('Hello, world!')
app = webapp2.WSGIApplication([('/', MainPage)], debug=True)
To this:
import flask
app = flask.Flask(__name__)
@app.route('/')
def helloworld():
return('Hello, world!')
Or, for Lisp lovers:
What you want to do:
virtualenv venv -p python2.7
source venv/bin/activate
pip install Flask
dev_appserver.py .
What you have to do:
hy2py main.hy > main.py
Now get out there and hack some stuff.