
Raphters: A web framework for C - l0gicpath
http://thechangelog.com/raphters-a-web-framework-for-c/
======
danpalmer
This seems to be quite well written. However, this is a really bad idea for
anything other than learning/hobby work. Writing a web application in C is
just asking for security trouble.

Writing in C introduces whole families of vulnerability that aren't a problem
in most other languages. Format string vulnerabilities and buffer overflows
are the two that immediately come to mind, and these will be added to the
normal host of web application security considerations like SQLI, CSRF, XSS,
etc.

~~~
DanWaterworth
Author here. I completely agree. I wrote this just because I could and because
I was going through a phase of writing everything in C. I wouldn't recommend
anyone actually try to use it.

~~~
sramsay
Just out of curiosity . . .

What followed the phase in which you were writing everything in C?

~~~
DanWaterworth
I got my first job. There's nothing like a dose of the real world to break you
out of such phases. However, I still hadn't reached maturity, I just had a
complete reversal and started writing everything in Haskell instead.

It's only been recently that I have started sitting down with projects and
thinking, which language makes sense here?

~~~
exDM69
> However, I still hadn't reached maturity, I just had a complete reversal and
> started writing everything in Haskell instead.

I've been through these phases too. But they keep on recurring time after
time. I've been writing everything in C, then C++, then Haskell, then back to
C and this has been going on for years.

Well at least both Haskell and C have good educational value, so even if it is
a bit odd, you're still learning valuable skills.

~~~
sramsay
_I 've been through these phases too. But they keep on recurring time after
time._

Me too. As I get older, though (I'm well past "maturity" ;), I find myself
going back to C more and more. I'm not exactly sure why.

I do think, though, that while our discussions of programming languages nearly
always revolve around this or that feature making things easier, or more
efficient, or more fault-tolerant, or whatever, there's also an element of
"intellectual fun" (or something like that).

I won't say I never get aggravated writing C, but I often enjoy the puzzles
that emerge. Trying to figure out how to do something in C, trying to
visualize what's going on with the memory, creating clever little pointer-
machines -- it's just as fun as doing analogous things with Lisp or Haskell
(during one's obligatory Lisp and Haskell phases).

------
AlexanderDhoore
Seems like a good option for hardware devices like routers, firewall
appliances, ... This won't be the next agile, ninja hacker, 1337 web
development platform. But it could have it's own niche of the market.

~~~
10098
> his won't be the next agile, ninja hacker, 1337

I remember words like "hacker" and "1337" being used to refer to people who
did reverse engineering, participated in the demoscene or just defaced
websites for fun. My, how the tables have turned.

~~~
AlexanderDhoore
I'm just using random hipster words to show how I feel about those web
frameworks. It's a miracle I didn't tag it #YoloSwag

------
jnbiche
This is a cool project, but if you're looking for something that is safer and
yet runs at similar speeds and requires similarly low memory levels, I suggest
vibe.d -- D's primary web framework[0]. It's progressing very quickly.

0\. [http://vibed.org/](http://vibed.org/)

Edit: Added "safer", which was my original point here that I forgot to
include.

~~~
maqr
Just clicked your link to check it out, 500 with a stack trace :/

~~~
jnbiche
Back up now. I'm very surprised that HN gave them any problems, even on an
underpowered machine.

------
vezzy-fnord
This is two years old. Another web application framework in C is Klone:
[http://www.koanlogic.com/klone/index.html](http://www.koanlogic.com/klone/index.html)

~~~
lneves
You can also add Duda.IO to the list: [http://duda.io/](http://duda.io/)

~~~
X4
Oh yeah. Duda.IO totally rocks! Used it, love it!

Psst: There are very nice improvements coming to that project …

------
pjmlp
"If you’re a C developer looking for speed (and security) you might give
Raphters a look for your next web project."

I had a laugh, mixing C and security on the same sentence.

~~~
DanWaterworth
Author here. Yes, I can only look back and cringe.

------
emmelaich
Obligatary on-topic comment: seems like a lot of code for a not a lot of
result; I would like to see templates (with optional template parms) used to
provide the 'usual' values. (yes I know templates aren't C, but you can use
them minimalistically since they're orthogonal to the rest of C++.)

Digression comment: Has anyone used GWAN? It looks awesome, but the website
hints at some eccentricity. [http://gwan.com/](http://gwan.com/)

~~~
fat0wl
ahahah "eccentricity" best adjective craftsmanship ever...

looks like a cool idea but i feel like hardware-optimization stuff will be
wrapped into server OS eventually if its meant to be (I'm sure it already is
in some ways). If you want to be cutting edge tho give it a shot?

eheh so impressed with "eccentric" tho. it's funny i love Clojure & i feel
like its a bunch of "eccentric" vibing trying to tame itself into something
that looks like trendy web sites (Rails community kinda pages, though in Rails
it seems there is a flashy site for practically every popular gem whereas in
Clojure the biggest thought they're willing to formulate is some real minimal
framework)

------
marshally
I wouldn't say I've been missing it, Bob

------
msutherl
Ah, RAPHT is so much clearer than MVC:
[https://github.com/DanielWaterworth/Raphters/blob/master/RAP...](https://github.com/DanielWaterworth/Raphters/blob/master/RAPHT).
I would love to see more projects adopt this architecture.

~~~
velis_vel
Is it? It's not really clear what a 'transformation of data' entails, or why
handlers and actions are separated.

~~~
msutherl
"Transformation of data" makes a lot of sense if you're accustomed to "pipes
and filters" architectures. It's anything your program might actually _do_
with data that passes through it. Doesn't matter what it is – it's a black
box!

Why should handlers and actions be separated? Because they're different
things! This is already standard in web architectures: the router is a
collection of handlers and the functions that the router calls out to are
actions. I like that actions are separated out from the monolithic
"controller".

------
leokun
How do the templates work? I've only ever used ClearSilver templates with C.

~~~
iwwr
This is the only instruction on how to run the examples:

"The examples are deployable via fastcgi."

A more hand-holdey approach may be appreciated.

------
phaed
A masochists' best friend. All joking aside, good job.

