Well must be a slow news day today so I'll say a few things about FuqIt for the high-minded HN crowd:
1. Don't run this at all in anyway that someone can access it. It's ultra hackable. Extra points if people can point out why.
2. I basically am just goofing off. The idea though is this thought: "What if PHP got it right?"
3. There's some little tricks in there you may not have seen before. Take a look at the code if you're new to Python.
4. If I get around to it I may write a web server for this using my various web-server-maker chops and put in some of the Lamson code and then make it talk to ZeroMQ off of a URL similar to how it's doing jinja and python so it can be a full service web+email+messaging system configured off just files in a directory and then probably I'll get bored and do something else.
I think this was submitted with a back-thought of possibly generating ridicule. It doesn't matter, anyone coding and playing with shit like this gets upvotes from me.
I also like web.py (the framework conceived and built by Aaron Swartz) for some of the same reasons -- simplicity and cleanliness. Start with something like "let's see how would a clean and simple web framework look like in Python." That's beautiful I think. Yeah I know it hasn't exactly taken off and flask and friends surpassed it but I still like it.
EDIT: corrected Aaraon Swartz's name (thanks bensw)
I've seen something similar done with the Mako templating library which allows mixing html and Python. We jokingly dubbed it PHPython, and it had grown into horrible spaghetti.
I think what happened was it started out as a quick and dirty thing that just grew and grew.
I'm going to assume the "ultra hackable" is thanks to requesting '../../phpmyadmin/config.php' or whatever.
Oddly enough, I can't easily see any way to load a random (system-level) python module, thanks to including the 'app' package explicitly in the load_module - IIRC you can't resolve imports outside a top-level package.
There's a niche for something that's as sloppy-easy-to-get-started as PHP, but with a more concise/consistent/powerful language. Perhaps, a "PYP" - Python with PHP characteristics.
Someone asked on stackoverflow why PHP is so easy to learn, so I wondered how much learning curve we could cut away. Drop .erb and .haml files in a dir. Done.
I feel like http://aspen.io/ sort of does something like this already. Written in Python and just uses the filesystem to generate content rather than a MVC.
I've been thinking along these lines for a while. For python-based, I think your toolkit is a good stake in the ground.
I think Lua-based is very interesting.
openresty is a great choice for replacing the simple glory of what Apache/PHP once was.
Although, Lapis (moonscript/Lua) adopts "Web-MVC", the way its coded is a toolkit of un-opinionated libs. You can skip the MVC stuff and just have a clean set of libs for throwing things in a directory and getting your bang for very few bucks.
The thing with internet celebs in the programming community is that they mostly are celebrities for a reason and not just because they are the pretty daughter of some billionaire.
Depending on how much you want to reduce it, you can dismiss almost anything having to do with a webserver this way. Some more powerful versions that dismiss any and all computer related ideas that have output:
- But isn't that just calling a bunch of syscalls?
- But isn't that just moving a bunch of bytes around?
Well, yes, but I picked CGI for a reason. Zed says in one of the other comments that the inspiration for this was "What if PHP got it right?" PHP came out of a long tradition of CGI apps, as a way to make templating dead-simple and still provide a bunch of programming language tools.
The brilliant idea behind CGI is that you set a directory as your cgi-bin, drop an executable file, and then the webserver will run that executable and pass in a bunch of data from the request as environment variables and on STDIN, and then send STDOUT back to the browser. It's an incredibly powerful idea with a really simple implementation. You can write your scripts in any language, they can do anything, they can present further abstractions and run other scripts, they can embed other languages like Python or PHP or Haskell, and they can embed other frameworks like Django or Rails. And all you have to do is drop a file in a directory and make it executable. All because of the power of plain text: CGI "speaks" a uniform interface that any computer language can understand.
When I saw FuqIt, I thought of CGI because the brilliant idea behind FuqIt seems to be "Drop a Python file or Jinja template in a directory, and we'll call it via a uniform interface". Kinda like CGI, huh, except it's restricted to Python? (Actually, there's another standard - WSGI - that's built around the same principles as CGI but restricted to Python.)
But you were downplaying the project because it is "basically CGI" (inaccurate already). In context I think you'll find you were being hostile about the matter.
Anyway, it is the start of an idea with a proclaimed possible direction (basic error handling, basic web server functionality). It doesn't do a lot right now (and maybe it never will) but it isn't just CGI.
That aside, I've always been interested in the, as you put it, "shit files into a directory" approach with a language that's not PHP. Now if only we could get ubiquitous hosting for it once you work out the security issues (which I do hope you'll do)...
I was intrigued by the reference to Meteor and after a bit of googling "oh yeah okay, those guys who did an unsecure NodeJS realtime framework (last time I used it, every client could call the mongodb database) just got 11M in funding".
There's a package called 'insecure' that is included by default to get the app up and running as quickly as possible. To remove, just do $ meteor remove insecure
Hope this helps!
P.S. docs.meteor.com is very helpful -- I highly recommend reading it. Also, DiscoverMeteor.com is a great textbook that will cover this material.
Didn't you know, any sufficiently complicated Python framework contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Ruby on Rails.
1. Don't run this at all in anyway that someone can access it. It's ultra hackable. Extra points if people can point out why.
2. I basically am just goofing off. The idea though is this thought: "What if PHP got it right?"
3. There's some little tricks in there you may not have seen before. Take a look at the code if you're new to Python.
4. If I get around to it I may write a web server for this using my various web-server-maker chops and put in some of the Lamson code and then make it talk to ZeroMQ off of a URL similar to how it's doing jinja and python so it can be a full service web+email+messaging system configured off just files in a directory and then probably I'll get bored and do something else.
Enjoy!