HNHacker News
TopNewBestAskShowJobs

timothycrosley

770 karma · joined March 21, 2013

Creator of hug, isort, portray and many other Python tools and libraries.

timothycrosley.com

submissionscomments
timothycrosley··on New Python REST API and CLI micro-framework
https://github.com/timothycrosley/hug/blob/develop/examples/...
timothycrosley··on New Python REST API and CLI micro-framework
They really aren't compatible concepts. It's sort of like the difference between werkzeug and Flask, those projects wouldn't and shouldn't ever be merged. Falcon is like a much faster werkzeug with a great maintainer, we've discussed the projects together and both agree that they both should remain separate and both are mutually beneficial.
timothycrosley··on New Python REST API and CLI micro-framework
Hug contains the features flask contains. I haven't and I don't think you will in this entire thread see a single example of someone actually pointing a feature missing in hug that is relevant for APIs (not HTML websites like Jinja)
timothycrosley··on New Python REST API and CLI micro-framework
You can see the performance difference bench-marked by a competing framework non the less, here: http://pycnic.nullism.com/ These are done running a standard uwsgi setup for all frameworks (even playing ground).

> These aren't new, though the approach to them seems quite clean.

This is really the crux of it, nothing is new. That is before Flask etc you could do everything you can do with Flask now, but the approach was bad and not clean. Required a lot of duplication of work. Flask helped fix that. You can do the hug enables through flask now, but the approach isn't clean, they require a lot of duplication of work. Hug fixes that.

The same reasons people started using Flask are the same reasons they should start using hug. It provides a cleaner, faster, and better base for the APIs of the future - just like Flask did when it came along.

timothycrosley··on New Python REST API and CLI micro-framework
There's a bunch of reasons, but they really come down to a focus on memory efficiency and knowledge of how certain things perform on Python (using hasattr instead of isinstance where applicable, using __slots__, only processing things when it's clear they need to be processed). And then for extra measure: Cython compilation. You can see a competing frameworks benchmarks showing the result of all this work here: http://pycnic.nullism.com/
timothycrosley··on New Python REST API and CLI micro-framework
Author here: I encourage anyone that is curious about the reason for this framework as opposed to X to read the project's architecture document https://github.com/timothycrosley/hug/blob/develop/ARCHITECT.... Some highlights: it allows some of the most concise Python code, produces automatic documentation, supports annotation based validation and argument transformation, automatically enables version management, and is way faster then Flask / Django at handling requests. Also, I'm free to answer any questions you may have :)
timothycrosley··on New Python REST API and CLI micro-framework
Gimp ;) (I know this doesn't answer your question, but it's the only answer I have O:-))
timothycrosley··on New Python REST API and CLI micro-framework
It has a way simpler programming interface then Falcon while retaining the speed benefits: and is really a way more powerful concept as explained here: https://github.com/timothycrosley/hug/blob/develop/ARCHITECT...

The real question should be, why take the time to write Falcon when you can get the same performance and more code-reuse using hug?

timothycrosley··on New Python REST API and CLI micro-framework
author: Hug actually does make it super easy to write a CLI app, you can see an example here: https://github.com/timothycrosley/hug/blob/develop/examples/... and a full explanation of the concept here: https://github.com/timothycrosley/hug/blob/develop/ARCHITECT...
timothycrosley··on New Python REST API and CLI micro-framework
author here: This is way more then Flask/Bottle, I understand what would make you reach that conclusion, but if you look here https://github.com/timothycrosley/hug/blob/develop/ARCHITECT... You can see just how much it adds that really are core concepts that can't be done with simple decorators on-top of Flask.

Highlights:

- Automatic documentation - Type annotation based validation and transformation of input fields - Directives to inject more data (like request data) into existing functions in a safe and reusable way - It's easily twice as fast at handling requests as Flask, making Flask a rather horrible base for any competitor

timothycrosley··on [dead]
http://viliconsalley.com/2015/09/26/silicon-valley/10-things... I'd say yes
timothycrosley··on In Defence of Monoliths
It depends how you do micro services. There are middle grounds. One big gain of micro-services is that it guarantees things are separate and can be handled by separate teams if the need arises. That doesn't mean you need to start out that way. For instance in Python I use hug to create my microservices https://github.com/timothycrosley/hug, then I can just install them to create a "monolithic" services that consumes all the microservices, the great thing is that hug allows you to expose both as a webservices, and as a Python library so I can consume as a Python library with no overhead, until the need to split is evident, and then can split up the services with very little work. Of course the need may never arrive, but the modularity that is forced when using micro-services pays dividends quickly regardless
timothycrosley··on A “Hello World” Server in Prolog
For comparison:

Here's the same thing in modern Python: https://news.ycombinator.com/item?id=10221707

timothycrosley··on A “Hello World” Server in Python
https://github.com/timothycrosley/hug/blob/develop/examples/...

and

https://github.com/timothycrosley/hug

timothycrosley··on Hello, declarative world
I think the best way to move away from the way computers think, is just to build higher level functions and utilities. For example: https://github.com/timothycrosley/hug
timothycrosley··on Python Decorators in 12 Steps (2012)
See: https://github.com/timothycrosley/hug for an interesting (IMHO) use of decorators. Might help expand your understanding
timothycrosley··on RAML – RESTful API modeling language
It would take less time, and you would get more documentation by using something like hug: https://github.com/timothycrosley/hug

while actually allowing you to build RESTful APIs

timothycrosley··on Imba – A new programming language for the web
Reminds me a little bit of the Python -> Javascript two way compiler I wrote: https://github.com/timothycrosley/jiphy
timothycrosley··on Ask HN: Do you have a side project you want to sell?
http://www.honeydo.es - A social todo list. I use it everyday personally, but simply don't have the bandwith to get it to the point I believe it needs to be at and work full time / create and maintain my open source projects.
← PreviousPage 6 of 6