
Bash on Balls: an MVC web framework for Bash, powered by netcat - laughinghan
http://github.com/jayferd/balls
======
laughinghan
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.

------
chuhnk
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.

~~~
jayferd
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 :)

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

------
beaker
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.

~~~
windexh8er
A swing and a miss.

~~~
chopsueyar
I thought it was good.

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

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

------
lysol
What a great name.

~~~
dstein
"Bash with Balls" might've been better.

~~~
jackpirate
Then it loses the Ruby on Rails reference.

~~~
dstein
Why is that important?

~~~
gaustin
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.

------
Calamitous
But _can it scale?_

~~~
a-priori
Sure, if you have big enough Balls.

------
koenigdavidmj
Similar to <http://werc.cat-v.org/>

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

~~~
mrspeaker
I think it's best watched from a far.

~~~
mattdeboard
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.

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

~~~
laughinghan
Do it!

who wants to take up Awk on Awnings?

~~~
silentbicycle
GNU awk has some decent built-in networking functionality.

So: _gawk on goats_

------
nzoschke
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!

------
dolphenstein
I prefer <http://www.coboloncogs.org/>

~~~
pygy_
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._

------
endgame
Reminds me of nanoblogger: <http://nanoblogger.sourceforge.net/>

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

------
patrickgzill
Sounds painful to use.

------
BjornW
This is why I visit HN. Great hack!

------
tathagatadg
Think I found true love ...

------
sneak
assert(can != should)

