139 points · by superchink · 13y ago · 77 comments
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!
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)
That reason it still hasn't taken off is that Aaron is very like Zed; they are grasshoppers. They get bored easily from doing something.
:(
I think what happened was it started out as a quick and dirty thing that just grew and grew.
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.
This is a little like that.
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 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.
http://leafo.net/lapis/ http://moonscript.org/ http://openresty.org/
Oh, except, there's actually an interesting idea in there if you look really closely.
- But isn't that just calling a bunch of syscalls?
- But isn't that just moving a bunch of bytes around? def do_GET(self):
try:
self.knife_or_banana(self.path)
[...]
def knife_or_banana(self, path):
# THIS AIN'T THAT SECURE, BUT FUQIT
root, ext = os.path.splitext(path)
[...] cd not_my_porn_folder
python -m SimpleHTTPServer[emphasis mine]
That's an interesting approach. I take that Zed doesn't want this to be actually used anywhere?
(Interesting reading: http://cr.yp.to/softwarelaw.html)
return "I Am KING!"
https://github.com/zedshaw/fuqit/blob/master/app/files/test.... I am a test Jinja!
So, which one is it?If we could decrease the amount of understanding required (possibly a bad thing) to get python running on the server it would be great.
Why can't I just go "python app.py -port 80" and call it a day? What would we need to get to that point?
To be using PHP.
(runs away)
When did our jobs become such a joke?
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.
you nailed the name just right, but a single look at the mascot made me blind for an hour.
And it's already ported to NodeJS, congrats!