8 ms·
The FuqIt Web Framework
- hobs 13y agoGood use of lens flare.
- recuter 13y agoOh Zed.
- toyg 13y agoExcuse my French, but... if this hadn't been written by an internet celeb, nobody would have given two shits about it.
- zedshaw 13y agoPretty much. Oh, except, there's actually an interesting idea in there if you look really closely.
- nostrademons 13y agoIsn't the interesting idea basically CGI?
- zedshaw 13y agoIf you can abstract everything to be anything then nothing has meaning.
- GabrielMtn 13y agoLovely bit o' philosophy there. no sarcasm
- jamesaguilar 13y agoDepending 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?
- nostrademons 13y agoWell, 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.)
- nelmaven 13y agoThis is the best explanation of CGI I've encountered so far.
- invisible 13y agoBut 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.
- deleted 13y ago[deleted]
- pdevr 13y agoMore than one, probably? base, ext = os.path.splitext(name[1:])
- zedshaw 13y agoIf that code is an idea, then the idea is "HACK AWAY!"
- vph 13y agoI think you can run python modules installed in the system through this framework.
- zedshaw 13y agoYup, and expose any file on the file system.
- ch0wn 13y agoThe 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.
- oriste 13y agoZed is not the pretty daughter of a billionaire?!?!?!?!?!?!?!?
- pdevr 13y agohttps://github.com/zedshaw/fuqit/blob/master/app/files/index.py https://github.com/zedshaw/fuqit/blob/master/app/files/index... return "I Am KING!" https://github.com/zedshaw/fuqit/blob/master/app/files/test.html https://github.com/zedshaw/fuqit/blob/master/app/files/test.... I am a test Jinja! So, which one is it?
- deleted 13y ago[deleted]
- zedshaw 13y agoYep, works pretty well actually, but not secure yet. It's a hack to test out the idea.
- recuter 13y agoYou're my favorite. :) Didn't you do a lua microframework? I'm more intrigued by that one but whatever gets your creative juices flowing, godspeed.
- 616c 13y agoGithub lists his repos, you know. :-) But thanks for pointing this out. I am getting interested in Lua and was unaware of this. https://github.com/zedshaw/Tir https://github.com/zedshaw/Tir
- zedshaw 13y agoWell 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. Enjoy!
- zeroecco 13y agoSpend more time on LRTHW. I need more lessons to get better!! (kidding)
- hartror 13y agoI'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.
- rdtsc 13y agoHey Zed that's pretty cool. 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)
- benhsu 13y agohow the fuck is this the top link on HN right now?
- zedshaw 13y agoIt's almost like I'm famous and people are interested in what I do!
- deleted 13y ago[deleted]
- hayksaakian 13y agoI've never heard of you, but I liked the idea behind a PHP replacement.
- Demiurge 13y agoIn my experience with a new PHP developers, the first hurdle is explaining that urls have nothing to do with the filesystem.
- hayksaakian 13y ago(I don't do PHP) I had the same issue starting with using web APIs in java. It's understandable though as the early web was essentially serving a filesystem directly (almost ftp).
- merlincorey 13y agoStart here: http://zedshaw.com/#/start http://zedshaw.com/#/start
- andrewflnr 13y agoThat 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)...
- gojomo 13y agoThere'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. This is a little like that.
- zedshaw 13y agoYay! Someone gets it!
- jhancock 13y agoI'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. http://leafo.net/lapis/ http://leafo.net/lapis/ http://moonscript.org/ http://moonscript.org/ http://openresty.org/ http://openresty.org/
- mappu 13y agoSomething like Python Server Pages? Maybe check out Spyce or mod_python (or maybe set *.py to run as CGI)
- toyg 13y agoJust serve .py as CGI. Hardly the stuff of legend.
- gunn 13y agoI did one of these! The RHP Hypertext Preprocessor - https://github.com/gunn/RHP https://github.com/gunn/RHP 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.
- synparb 13y agoI feel like http://aspen.io/ 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.
- bobwaycott 13y agoThat mascot is fucking awesome.
- Demiurge 13y agoBrilliant. I am supercharging it with dilithium crystals and replacing all my production Django sites right this second.
- zokier 13y ago> FuqIt is Copyright (C) Zed A. Shaw All Rights Reserved. [emphasis mine] That's an interesting approach. I take that Zed doesn't want this to be actually used anywhere?
- dpe82 13y agoGood catch. Without an explicit license grant forking the repo is technically copyright infringement.
- jrockway 13y agoAnd a violation of Github's ToS. (Interesting reading: http://cr.yp.to/softwarelaw.html http://cr.yp.to/softwarelaw.html)
- zedshaw 13y agoYep, it's not safe to use, so nobody should use it. Edit: I should add, not yet anyway.
- dave84 13y agoThis is one of those things that becomes immediately "obvious" the moment I see it... but I'd never have thought of. 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?
- krapp 13y agoWhat would we need to get to that point? To be using PHP. (runs away)
- deleted 13y ago[deleted]
- zedshaw 13y agoThanks everybody, you made this joke possible: https://github.com/zedshaw/fuqit#investor-statement https://github.com/zedshaw/fuqit#investor-statement
- Jach 13y agoThis has too much functionality. Sometimes I just want to statically serve all the files in a directory and its subdirectories. cd not_my_porn_folder python -m SimpleHTTPServer
- revskill 13y agoThe first version now is minimalistic. But to be a second Ruby on Rails framework, your system will get more complicated soon. Good luck.
- zedshaw 13y agoYou obviously know nothing of my work.
- SkyMarshal 13y agoDidn't you know, any sufficiently complicated Python framework contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Ruby on Rails.
- deleted 13y ago[deleted]
- d0m 13y agoJust wanted to say a special mention to the knife_or_banana method: 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) [...]
- rman666 13y agoWould fans of FuqIt be "Fuqers"?
- Ygg2 13y agoYes.
- ricardobeat 13y agoOut of my own boredom, fuqit in node.js: https://github.com/ricardobeat/fuqit https://github.com/ricardobeat/fuqit
- zedshaw 13y agoNice. Here's a present for you https://github.com/ricardobeat/fuqit/issues/1 https://github.com/ricardobeat/fuqit/issues/1
- brooksbp 13y agoWhy is this front page? Because he is a celebrity? If Python is the drug of choice, Flask. K? Thx, now get off my news feed.
- brooksbp 13y agoWhy is this front page? Because he is a celebrity? If Python is the drug of choice, Flask. K? Thx, now get off my news feed.
- reebalazs 13y agoHi Zed, 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!
- hoodoof 13y agoAnything by Zed Shaw is interesting. One of the real software engineers. Or should I say "Programmers, Motherf..."
- abootstrapper 13y agoJuvenile. If this had any other name or was written by anyone else, no one would give a fuq.
- joshguthrie 13y agoI 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". When did our jobs become such a joke?
- qiqing 13y agoThere'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.
- NAFV_P 13y agoThat is a terrible name for a framework, you should have called it 'shdvg'.