Hatchet News

Hey HackerNews! Just wanted to share something slapped together recently, looking for feedback.

Context: I worked in both research and enterprise and have built a lot of services in Python and Java, and they converge to using similar patterns, regardless of how different the architectures and domains are (web apps, ML research, distributed systems, etc.)

After writing a lot of Python, I was missing a framework that strongly supported some of these patterns formally, and find that this structure lets you make assumptions that can really boost dev experience on long term projects.

Microframeworks are great. They let you get started with a single file of a few lines, but (in my opinion) lack the structure you want on long term projects, working with teams, so you end up making that structure yourself anyway. In doing so, you get a small initial boost in productivity, but at the cost of your productivity in the future.

Mitsuki tries to both allow you to start quick and easy with a single file in a few lines, but also be more friendly to you and your team through time, by giving structure to your development process.

Thus, I made an early version of a framework heavily inspired by Spring Boot. The core idea is that you can do enterprise apps without the enterprise pain, in Python, with high performance.

- Want a simple REST API? app.py with a few lines.

- Want a decent starter with auto-implemented CRUD? mitsuki init to get a starter project with domain classes, services, controllers and repositories.

- Performance? Similar to Express and Spring Boot (in Docker, on an M1 MacBook Pro, 8GB of RAM), out of the box, no configuration needed.

Lightweight

Despite the "fancy sounding" terminology, Mitsuki itself is very lightweight, and only adds a very small overhead (10%) over the components that power it (namely, Starlette and Granian). I don't want to commit to ASGI only, and a future version will likely rewrite this core logic to leverage granian further.

There is a lot of ground left to cover, lots of docs to write, examples to explore, features to expand. I'm also planning to write a few tools that leverage the structure of the framework to increase DX within enterprise teams.

But before any of that, I'm looking for feedback. Yay or nay? :)

Benchmarks

P.S. On the topic of performance and benchmarks, there are a few remarks in the repo's /benchmarks directory. (Or here: https://github.com/DavidLandup0/mitsuki/tree/main/benchmarks)

Yes, most benchmarks are arbitrary, heavily gameable, and your bottleneck is likely going to be your business logic, not the framework, anyways.

Yes, Spring Boot and Elysia will likely have higher ceilings, so running on a stronger CPU will likely change the order of the benchmark.

Yes, there's a million variables that affect these.

Yes, granian is written in Rust, not Python.

The point of the benchmark is threefold:

- This is the sort of experience you get out of the box, on your device and where you'll deploy it (Dockerized on small instance such as through K8s)

- Python web apps can stand shoulder to shoulder with JS/Java performance-wise

- Despite the seeming complexity around dependency injection, state tracking, etc., Mitsuki is pretty lightweight.