5 ms·
Any suggestions on packages you're using for your Go toolchain? I'm a django developer that's somewhat fed up with python's slowness. I love django but I'm loo
by lumpypua 12y ago
Any suggestions on packages you're using for your Go toolchain?
I'm a django developer that's somewhat fed up with python's slowness. I love django but I'm looking to diversify. I've worked through a bunch of Go tutorials, but I don't have a good feel at all for the go ecosystem.
- aaron-lebo 12y agoI've also done a lot of Django hacking and have the same feelings about Python. You aren't going to find anything as complete as Django in Go. There just hasn't been enough consolidation on a single framework and things are too much in flux. I never found an ORM I liked, but pongo2 [1] is directly modeled after Django's templating language. There's also negroni [2] and its ecosystem. Gorilla [3] is an excellent set of packages as well. It all feels a lot like using a less mature Flask (mainly because Armin Ronacher has put years of work into it). As much as I want a speedup from Python (as well as good concurrency) I'm finding Python is still a lot more expressive and takes less code. Your mileage may vary. I suspect what Go would be really useful for is a JSON API that a Flask app (or something similar) consumes. 1. https://github.com/flosch/pongo2 https://github.com/flosch/pongo2 2. https://github.com/codegangsta/negroni https://github.com/codegangsta/negroni 3. http://www.gorillatoolkit.org/ http://www.gorillatoolkit.org/
- themartorana 12y agoThese are good, and seconded on the maturity front. I'm a fan of goji and more recently have been using Gin [0]. For databases I'm playing with sqlx [1] and modl [2] from Jason Moiron (because they're based on gorp, and because he wrote Johnny-cache for Django which is amazing and I use on every Django project I work on.) Gin is young, but has great potential and I'm already using it in production (with a keen understanding of its current shortcomings). [0] http://gin-gonic.github.io/gin/ http://gin-gonic.github.io/gin/ [1] https://github.com/jmoiron/sqlx https://github.com/jmoiron/sqlx [2] https://github.com/jmoiron/modl https://github.com/jmoiron/modl
- victorhooi 12y agoYeah, the current web frameworks on Golang seem to be quite...chaotic to an outsider. And the landscape is constantly changing. It's not like Ruby or Python, which seem to have one clear mature do-everything framework, and some more lightweight ones beneath. Is there such a thing as a Django-equivalent in Golang at this point in time? Or what's the closest analogue? None of them seem to package an ORM together, so not sure what people tend to do here, to reduce boilerplate code in their models.
- quaunaut 12y agoPart of the issue there is that Golang doesn't have any mature ORM-type packages. The one I've heard the most about is [Gorp](https://github.com/coopernurse/gorp https://github.com/coopernurse/gorp), but none of the current Golang web libraries really sanction anything- but that's part of Go's nature. Go by default doesn't encourage big frameworks. It encourages you to use the rather well-built standard libraries to get most things done, and do the rest of the augmentation yourself. However, as it's being looked at more and more as a great systems language, people are building bigger, more frameworky systems in it all the time, and as a result it's getting friendlier. It's going to be chaotic no matter what for the next year, but that's how new languages, especially popular ones, are. If you're looking for easy choices, it might be better to wait for now. If you want to get your hands dirty, I guarantee you'll find something you want if you keep looking, or you'll get good enough to run with it yourself. (Just be sure you know your web basics to do webdev on it, as no one is going to hold your hand in Goland.)
- crucialfelix 12y agoFor many years in python there were several contenders for webframeworks. Only after many years did Django eventually dominant. I've used Django a lot and personally I would prefer smaller lightweight frameworks where its easier to select packages that provide solutions to specific problems. I'm not looking for the next Django. Something the size of Express would be perfect.
- jarpineh 12y agoI love Django for its docs and sensible defaults to just about everything. I've been reading the Light Weight Django book, now nearing completion at O'Reilly, and Django can be used as lightly as Express. I'd link to source example, but I can't find the code anywhere and the ebook is not on this device... I don't know if it's lighter than regular Django in terms of speed, but by the measure of how much you need to code you can't do much better. Couple of pain points are declaring settings for middleware and template processors, even when you don't really need them, but other than that it is really basic. This is your URL pattern, this is your view function to call when a request comes for such URL. From there you can do what you want with the request, as long as you convert your response to Django's HttpResponse object (which takes a string). For something a bit different, I recommend taking a look into Morepath: http://morepath.readthedocs.org/en/latest/ http://morepath.readthedocs.org/en/latest/ It looks to have some genuine useful parts from Zope, rethought for today's more RESTful, Javascripted world. My next personal project will probably use it as a base.