Revel, high-productivity Go web framework modeled on Play Framework
robfig.github.com
robfig.github.com
Just wanted to alert people that this is not ready for prime time yet. I have a sizable list of items to get through before I was planning to publicize. For example, the packaging/deployment is not there yet (working on that presently). Also, I have only tested it on OSX (in theory, it should be cross platform, but I'm sure there are bugs to smoke out).
That said, please feel free to give it a try and open issues for anything you find.
Secondly a question :)
Play team solved the compile "problem" of java using a lib from eclipse so it compiles files on the fly. do you have something similar, or do you plan to include something similar? I think compiling on every change you make while developing an app is painful, the biggest problem java frameworks have, excluding Play! of course.
Here is a description of how it works: http://robfig.github.com/revel/manual/howrevelworks.html
Basically: In development mode, it runs a proxy (called the "harness") that watches your source for changes and recompiles/restarts your server on the next request, if necessary, using the "go build" tool. The go build process is incremental, so in theory should only recompile packages that have changed (and those that depend on them)
Code: http://code.google.com/p/rsc/source/browse/#hg%2Fdevweb
// Devweb is a simple environment for developing a web server.
// It runs its own web server on the given address and proxies
// all requests to the http server program named by importpath.
// It takes care of recompiling and restarting the program as needed.
And, he uses "go build" to build the program: out, err := exec.Command("go", "build", "-o", "prox.exe", rootPackage).CombinedOutput()
It appears to do more than Revel does, though -- I will look at it more closely to see what extra it provides. Wish I had seen this before!It's not what's used in the App Engine SDK. I believe it was inspired by what we do in the App Engine SDK, though.
This is a good reason to learn go :)
How should deployment work for an app created in this framework?
From the "How Revel Works" page it mentions:
>> If the app compiled successfully, it runs the app ...<snip>...
Is it simply a case of lifting and dropping the binary (ensuring it's linker dependencies are satisfied on the dest host)?Would the final artifact be deployable to google app engine?
It needs the source directories since templates and assets are kept within them. Also, it is frequently useful to have access to the source in production, e.g. for sending exception emails.
The goal is to make deployment to a server without a Go environment very easy.
EDIT: To answer your original question: in the current version, you must have a working Go installation to run your Revel app. Then: "rev run import/path/to/app prod". I am pretty sure that it will not work on GAE -- I realize this is an important/valuable use case and will investigate it in the future.
Meantime I've just installed go... Wish me luck!
I see this is also from one of the Go contributors. Nice!
(I've never used the "rev" unix command before, so I didn't think much of it)
PS: I regret that no performance analysis nor benchmarks are presented on the project page. It could be nice to have a comparison with Play on that domain.
I think that GORP is the current leader (https://github.com/coopernurse/gorp), and it is pretty easy to make a plugin/interceptor that initializes it and starts/ends transactions before / after requests.
I am planning on adding an example of this to the samples in the near future.
ORMs make little sense other than to make flawed OO type systems match relational databases. Just do it right from the start: use a database model that matches your application.
~/Dropbox/Documents/Go % bin/rev github.com/robfig/revel/samples/booking
~
~ revel! http://robfig.github.com/revel
~
~ unknown command "github.com/robfig/revel/samples/booking"
Run 'rev help' for usage.
~/Dropbox/Documents/Go % rev help
~
~ revel! http://robfig.github.com/revel
~
~ usage: rev command [arguments]
~
~ The commands are:
~
~ run run a Revel application
~ new create a skeleton Revel application
~
~ Use "rev help [command]" for more information.
It would be nice if the 'quick start' would just work.First impressions you know ... :-)
But now it fails with an error that I don't really know how to fix as a Go noob ...
Go Compilation Error (in /usr/local/Cellar/go/1.0.2/src/pkg/github.com/robfig/revel/samples/booking/app/controllers/db.go:6): import "github.com/mattn/go-sqlite3": cannot find package
You can fix it manually with:
go get github.com/mattn/go-sqlite3
Also, I believe that the go command line figures out the dependencies for you, so this should get everything you need: go get github.com/robfig/revel/samples/booking bin/rev run github.com/robfig/revel/samples/booking
Changed in last two commits and I was a laggard in updating the site. Updating now, thanks. Template Compilation Error (in errors/404.html:10): function "include" not defined
Hey Rob, how about reposting this when things are in better shape? I've been waiting for a good excuse to play with Go and your web framework looks like something I could use for some real experiments, but it needs to be a little more finished first I think.Will certainly repost when it gets a little further along.
I chose Play! (1.x) because it is by far the most productive development environment I have ever used (especially for boring business admin pages). (Out of Django, JSP, Lift, GSE/GXP, Jetty, etc).
For my own part, a lot of my work has some connection to a scaling problem of some kind. A mandatory/single-database-type ORM is totally out of the question and largely why I had to abandon Django for Flask in my Python work. I might at some point migrate to Pyramid for Python, but I haven't evaluated the state of their persistence story. I was mostly wooed by their testing strategy (it's drop dead sexy).
http://code.google.com/p/gorilla/
https://github.com/bmizerany/pat
And just say no to ORM.
Disclaimer: I contributed to the original Gorilla design, but all the credit should go to moraes (and everyone else who was contributed to the project).
If you write a "vanilla" application which can run on GAE and other platforms without significant work, then I don't see how you'd get much benefit from GAE itself, but I might be missing something.