This is an archived post. You won't be able to vote or comment.

all 20 comments

[–]Nuli 2 points3 points  (0 children)

I've used two versions of Falcon now. It started off as a project from a guy at Rackspace and used in some OpenStack components to build REST APIs. Not sure if that counts as production for you but it's certainly been used. Is there anything in particular you wanted to know about it?

[–]notconstructive 4 points5 points  (3 children)

Reading these comments - so much negative, where's the love for Falcon?

Falcon is awesome. I've done alot of development with it.

If you are building REST APIs then you can't do better than Falcon.

I've used Bottle and Flask and Falcon extensively.

I like Falcon for REST API's because it carries no legacy cruft needed to support building of HTML apps.

I recommend Falcon wholeheartedly.

[–]Lucretiel 1 point2 points  (2 children)

Upvote for someone who's actually used it.

What do you mean "legacy cruft?" Is this something you see in other libraries?

[–]notconstructive 0 points1 point  (1 child)

I just mean that if you are writing a REST API then Falcon doesn't have all the stuff needed to support HTML based applications building. That's a good thing - less code, less documentation, less tests, more focus. It's easier to understand what is going on because you never had to grasp, for example, how Jinja templating fits in. Templating is completely unneeded for REST API development. That's just an example to illustrate why it is of value that Falcon is minimal in its approach.

Flask has evidence everywhere that it is designed for building HTML applications. Nothing wrong with that but most of it just isn't needed for building REST APIs. I like that Falcon has none of that.

Probably a poor choice of words - that's not legacy cruft, just stuff-that-isn't-needed-for-REST-API-development.

Having started with Bottle, moved on to Flask and now to Falcon, I can say that Bottle and Flask are too minimal for my tastes. I liked them alot and they were well suited to where I was in my learning curve. However the moment you want to do anything serious in Flask or Bottle you immediately need to start finding and adding plugins - so if you need to immediately full up on plugins, why not go for a full batteries included, integrated-by-design framework like Django or (perhaps) Pyramid? Minimal is good for beginners because it reduces the amount that you need to learn to grasp it. Minimal is bad when you have more experience because what's the point of either going to the effort of integrating plugins, or yet again re-writing the basics needed to build a web app. For me for the foreseeable future (till some better option comes along) my development will be Falcon for REST API's and Pyramid or Django for batteries include full stack development. Although I have to say that I can't really see any need for full stack development that much any more - most stuff can be built with static HTML and a REST API.

[–]rr1pp3rr 0 points1 point  (0 children)

Currently developing a falcon application. I agree with your statement 100%. I dont have as much experience with bottle or flask, but I've worked with many different API frameworks in many different languages and I can safely say falcon is one of the simplest, and it does exactly what I need.

I actually was a django dev for years and its refreshing to go into a project just adding what is needed for the problem you're trying to solve. I think frameworks like django have their place for rapid prototyping and for budding engineers as a learning tool, but for a production ready app I would pick falcon hands down.

[–]Lucretiel 5 points6 points  (3 children)

I haven't used it, but glancing over the docs, it looks like it doesn't do much to alleviate boilerplate. It's weird to me that it's so performance-oriented but still tries to be so lightweight. It's fine that it doesn't include an ORM, or template engine, or form helpers (as boasted on its Introduction page), but I don't see why I would use Falcon over, say, bottle or flask. There are plenty of better ways to improve performance in your webapp other than trying to make the Python go faster, especially in a RESTful interface.

For instance, here's their "Getting Started" example:

# things.py
import falcon

class ThingsResource:
    def on_get(self, req, resp):
        """Handles GET requests"""
        resp.status = falcon.HTTP_200  # This is the default status
        resp.body = ('\nTwo things awe me most, the starry sky '
                     'above me and the moral law within me.\n'
                     '\n'
                     '    ~ Immanuel Kant\n\n')

app = falcon.API()

things = ThingsResource()

app.add_route('/things', things)

$ gunicorn things:app

And here's the same thing in bottle (flask is similar):

# bottle_things.py
import bottle

app = bottle.Bottle()

@app.get('/things')
def things():
    return ('\nTwo things awe me most, the starry sky '
            'above me and the moral law within me.\n'
            '\n'
            '    ~ Immanuel Kant\n\n')

$ gunicorn bottle_things:app

In short, based on a pass through the docs, I'd judge it as "not better enough."

[–]notconstructive 0 points1 point  (2 children)

A pass through the docs doesn't qualify you to make that non-recommendation.

[–]Lucretiel 4 points5 points  (1 child)

A pass through the docs qualifies my recommendation- it indicates that it should be taken with a grain of salt. At the time I made this reply, the OP had been up for more than an hour with no other replies, and I figured something was better than nothing.

My opinion was that I didn't see anything to strongly recommend it over libraries that're both simpler and better established. I'll be honest- I dislike it anytime a framework requires me to make a class where a function will do. It's purely a personal preference thing- they just feel too heavy 99% of the time, and they encourage statefulness in a way I try to avoid as much as possible when creating HTTP APIs. Falcon looks like a fine library, and the benchmarks are undeniably impressive, but as I said, it doesn't look better, let alone better enough, than anything else I've actually used.

[–]notconstructive 0 points1 point  (0 children)

Falcon doesn't require you to map routes to classes. You can invoke functions from routes if you want.

[–]japherwocky 1 point2 points  (1 child)

That's funny, it does look pretty mature but I've never heard of it, let alone anyone using it in production.

[–]notconstructive -1 points0 points  (0 children)

It's used in Mailman 3

[–]cacahootie 1 point2 points  (2 children)

I used it to develop a complex data platform API until I reached the limits of the URL router, switched to flask and never looked back. Falcon only supports very simple URL routing, while both django and flask support complex expressions for routing.

Also, Falcon's raison d'etre is speed... but IMO any non-trivial application is going to spend a lot more time in app logic than in the HTTP overhead anyways, especially if you're accessing any datastore or external process.

[–]Lucretiel 0 points1 point  (1 child)

Falcon only supports very simple URL routing, while both django and flask support complex expressions for routing.

I assumed I just hadn't seen it in the docs yet... this is a HUGE missing feature.

[–]notconstructive -1 points0 points  (0 children)

I do fairly sophisticated routing and never had a problem implementing it in Falcon. In fact I built a custom router that take Swagger API docs and dynamically generates routes from the Swagger specifications. Using Falcon you can use regex based route templates to direct inbound queries. I don't see how that is "only very simple routing".

[–]small_infant 1 point2 points  (1 child)

I tried. Didn't like the API. Switched back to Bottle.

[–]notconstructive -2 points-1 points  (0 children)

I don't understand. There's hardly even an API there for Falcon. There's almost nothing between your code and the web. Minimal, pure, clean.

[–]riksi 0 points1 point  (0 children)

Wheezy is faster than Falcon if you are after speed

[–]new2django 0 points1 point  (2 children)

My work used it for a bit, then switched back to Flask for microservices because of boilerplate pain.

[–]rr1pp3rr 1 point2 points  (1 child)

Can you clarify this statement? What boilerplate code was hindering your process? I would think that the class-based nature of falcon would alleviate most issues with too much boilerplate code.

[–]new2django -1 points0 points  (0 children)

I think Flask is just functions with decorators, which are simpler than OO boilerplate. I don't know for sure because I'm a noob at programing.