Show HN: Tofu -- (Yet another) C web framework
github.com
github.com
I've had to read or step through the code a few times. It wasn't too painful.
I like Mongoose. :)
What is almost always written as "a->b = c;" is written as "a -> b = c;" in the Tofu code.
I guess doing so makes sense if you also promote writing "a = b + c;" (which I do), but it was still novel-looking, to me. I guess you can treat -> as any other binary operator.
could someone elaborate on this?
Frameworks abstracts away the bare metal of the HTTP protocol, the database, and allows you to concentrate only on the content and logic. A framework is basically a semi-built application; Look at your past websites, what are the common things between all of them? If you abstract all of that into a 'library', you might have some sort of framework there.
Of course with PHP, a lot of that is already taken care of. One thing I remember from PHP was that you write your code in a .php file, and the name of the file becomes part of the URL the user must type into the browser. Well, a framework can abstract away that too, so you can write your own urls and redirect to the appropriate function/file to handle the 'visit'.
I might have overstated what a framework can do here, I rarely go without it so perhaps maybe running with only a server can still provide some of the above described functionality, especially with regards to connections and sockets.
- sinatra request per second 442 - tofu requests per second 5909
Note that it is not indicative of anything; just a simple quick test for curiosity on my vaio laptop with ubuntu 11.10.
Which other C web frameworks could you suggest? Which Sequel-like ORMs for MySQL could you suggest? I am especially curious on sinatra or rails-like frameworks with MVC or similar architectures.
Thanks for doing the benchmarking, though - that's fast!