Hacker News new | past | comments | ask | show | jobs | submit login
Bash on Balls: an MVC web framework for Bash, powered by netcat (github.com/jayferd)
157 points by laughinghan on July 19, 2011 | hide | past | favorite | 36 comments



It basically pipes a fifo into netcat, and pipes the output of netcat to an HTTP parsing script, which calls router and model "methods" (which use Bash's built-in "namespacing") which runs the Bash templating language esh and pipes the the HTTP response back into the fifo.


I have nothing but praise for this piece of insanity. I love bash and truly enjoy watch it being taken beyond is intended use cases.


Ha! Yeah, it's totally not done yet, but yes, certainly intended as a piece of insanity. With all seriousness, of course. The model layer still needs a good deal of work, and I think it might be fun to write up some tutorials or something :)


So, I guess I need to finish writing the blog for BoB in BoB now.


Just looked over the source. This package is unkempt and extremely hairy in some places. I'd advise using Occam's razor over the whole thing, or at least running trim and tidy on the main parts.


That is almost always a valid criticism. We certainly agree and plan to do so. =)


A swing and a miss.


I thought it was good.


I wrote a CGI webserver and microframework in bash awhile ago too: https://github.com/tlrobinson/wwwoosh/


Nice! Similar netcat trick, more Sinatra-y router. Way smaller, just one file. No templating language like esh, though.


What a great name.


"Bash with Balls" might've been better.


Then it loses the Ruby on Rails reference.


And bash can be a verb, too!


Why is that important?


It's funny on multiple levels. Physically abusing testicles and the Ruby on Rails reference being the two obvious ones.

If you change the name as you suggest, then it's significantly less funny. Funny is an important component of fun.


But can it scale?


Sure, if you have big enough Balls.


More importantly: is it webscale and does it run on the cloud?


Balls doesn't scale!



So how can we use that? Is there any tutorial or examples?


I think it's best watched from a far.


Reminds me of an old SNL skit:

http://en.wikipedia.org/wiki/Happy_Fun_Ball#Warnings

Do not taunt Bash on Balls. Bash on Balls may stick to certain types of skin.


I wonder what would sed's framework should be called? Sed on Sails?


Do it!

who wants to take up Awk on Awnings?


GNU awk has some decent built-in networking functionality.

So: gawk on goats


Wow.

Shell is my favorite programming language these days. For systems programming there's really no way to get terser or more accurate programs with a scripting language. Once they work, my shell scripts are essentially side effect free.

That said, I use it for true pipelines. An MVC framework sounds insane. But I already learned some new Bash tricks from reading the code so keep up the madness!



Don't forget DOS on Dope:

http://dod.codeplex.com/

This one is a real MVC framework with scaffolding, written almost exclusively in batch scripts (IIRC they had to cheat a bit for the server code). All user code is also batch files.

The site contains a few gems, like:

In DoD we embrace the NoSQL movement and jump straight to the data-store of the future: a CSV file.

or

Does it scale?

So far I haven't run into any performance problems. Whenever I've opened up a DoD website to several users, my hard drive tends to get wiped long before I discover performance issues.


Reminds me of nanoblogger: http://nanoblogger.sourceforge.net/


Very original. I could have never thought that bash could be put to such use.


Sounds painful to use.


This is why I visit HN. Great hack!


Think I found true love ...


assert(can != should)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: