by miguelgrinberg
5 subcomments
- Always a nice surprise to find my stuff on the front page. If you have any questions about Microdot, I'm here to answer them!
by travisgriggs
2 subcomments
- Numerous comments on the “impossibly small” bit in the title. It makes me wonder if it was put there as a bit of tongue in cheek, less as a brag. E.g. The “it doesn’t have to be that big” Microdot web framework (which I honestly first thought had something to do with Microdot anti theft devices that they put on cars around me).
Elsewhere on HN right now is a post about a dermatologist vibecoding an app for skin stuff. I view the “need/use ai for coding” as an indictment against how complex software development has become. What I think we marvel at is the surprise that sometimes reall can be just that simple. 99% of the people who are using Django/flask/etc don’t really understand how they work under the hood all that well. And so it’s always an “is that all??” moment when we do these “back to the basics” exposé’s where we show that 80% of our needs are covered by something simple and understandable.
- All these years later, and I can't get over the fact that Flask began as an April fool's joke, making fun of Bottle and other microframeworks. I guess the joke failed completely.
- Sounds like this framework is comparable in size to the original Rails, which clocked in at under 1000 lines of code (microdot is 765 lines per the article).
I don't know if the original Rails would have run on mruby though (if it had existed at the time), and Rails certainly did a lot of things the author of microdot would have considered "dark magic".
- Microdot is apparently a Python web framework that runs on both CPython and MicroPython.
It is a single 765-line file with routing, JSON handling, cookies, streaming, and TLS. Created to provide a web server for IoT devices.
- The last large app I built in CFML (ColdFusion) was based on FW/1, which is a MVC framework in less than 1800 lines (including comments). No external dependencies, but to be fair, the CFML application server bakes in pretty much every dependency that most applications would ever need.
- I'm reminded of an MVC microframework I put together many years back in PHP: https://github.com/Two9A/BirSaat
Having pulled down a copy just now, the framework itself is 526 lines of PHP, and the sample site (a newsfeed that pulls from the BBC) is perhaps 300 lines in models and controllers. I use the framework to this day to serve out my blog and other small sites, seems to work well without getting in the way.
- It looks a lot like Bottle[1] but with MicroPython support.
[1] https://bottlepy.org/docs/dev/
by cryptoboy2283
2 subcomments
- https://github.com/miguelgrinberg/microdot
> Migrating to Microdot 2
You gotta be kidding...
- I would love to try this on my ESP32-C3 Super Mini, the small web framework on the small WiFi-capable microcontroller.
by curtisszmania
0 subcomment
- [dead]
by iLoveOncall
4 subcomments
- I'm not sure there's anything "impossible" about how small this is. You don't really need a lot of lines of code to support routes, request and response and nothing else. If anything, 765 lines of code for this is quite a lot.
It also uses libraries for most "extensions" that are available, defeating the purpose and bending the claim that it's 1,700 lines of code including the extensions. Just jinja, one of the dependencies, is 18,000 lines of code. If that counts my Nanodot server which calls flask.app.run() is one line...