

Rails like framework for C++ with great speed - mariuz
http://www.treefrogframework.org/

======
mtkd
My first reaction to seeing Rails BITD was to think 'wow this would be so fast
done in C++'.

Then about 2 years later, when I began to really understand Ruby and some of
the community had shamed the C++isms out of me, it became clear why it was
impossible.

Ruby interpretation and introspection makes so much possible in an elegant way
- you can bruteforce Rails out of another language but you'll lose a lot of
what makes Rails so powerful in the process.

For backoffice webapp use I believe nothing can compete with Rails currently -
it's stable, well documented and has awesome library support.

However, highload client performance does not come out of the box, which is
part of the reason for the drift to Node or lighter Ruby frameworks.

I don't think you need to make Rails faster, you just need to use it for what
it does best (complex backoffice apps and APIs) and use something lighter for
the high performance requirements.

~~~
spartango
I'd agree with this, and append the suggestion that if particular parts of
your application have high performance demands, those should actually be
decoupled from the main app into API'd services. This tends to make the entire
application more elegant while using the appropriate technology for each task.

------
carsongross
I have misgivings about ruby, but for the majority of the sites I work on CPU-
burn isn't the issue.

The second I touch a network resource (typically the database) all the hand-
crafted assembler in the world ain't gonna save me.

A stronger argument for a rails rip off in a statically typed language would
be tool support, esp. consistent code completion.

~~~
wheels
We have two main stacks at my company. One is Rails-based, the other is a mix
of C++ and Java. The tasks that the C++ and Java side do is _significantly_
more complex (real-time graph-traversal and number crunching) than what Rails
is doing.

On similarly sized server instances our Rails stack can handle about 10
requests per second, whereas our C++ / Java stack can handle about 400.

In practice the only time that I've seen the database be the bottleneck in
Rails is when the database is accessed by people that pretend that
ActiveRecord is in-process data and just use it like it's not querying a
database (e.g. I've seen pageviews that require 30+ SQL queries). That or
their database is set up in stupid ways and doesn't have indexes in the right
places.

Rails is actually very slow. That said, I think a smarter approach than
recreating the framework in faster languages would be to allow C or C++ into
the main Rails project and to rewrite the hot parts in one of them. We sped up
ActiveResource by about 35x by reimplementing it in C++ (with no changes
required to our apps).

~~~
rbanffy
> our Rails stack can handle about 10 requests per second

Is this representative? I built JMeter testing into a series of Django apps I
built for the portal I worked for and the numbers were consistently higher. I
always assumed they were similar in performance.

~~~
rurounijones
Totally meaningless number since we have no idea what the Rails app is doing.

~~~
rbanffy
I think that if the app were doing something extraordinary, wheels would
mention it. The ones i built Jmeter testing do straightforward database
queries, HTML (sometimes image) rendering and queuing stuff for future
processing.

In any case, I haven't tried to optimize them (memcache and front-end caching
were kept minimal and implementation as simple as possible) before going live
(after, of course, making sure they were load-tested and would survive a
reasonable load) so we could watch what breaks under load, compensate with
extra iron, and correct it later. All those machines were heavily monitored.

------
Nicole060
I think wt is much better suited than a rails clone for the few kind of
webapps you'd write in C++. <http://www.webtoolkit.eu/wt/>

You can think of using it as a multiplatform GUI for a native app, that runs
locally but uses the web browser instead of something like Qt or WxWidgets. Or
you can use it for a webapp that pegs the CPU more than a database.

There's also a port to the JVM and ruby bindings.

------
mcguire
Google's cached copy:
[http://webcache.googleusercontent.com/search?q=cache:evgtf1a...](http://webcache.googleusercontent.com/search?q=cache:evgtf1adSyEJ:www.treefrogframework.org/&gl=us&prmd=imvns&strip=1)

------
dasil003
I really don't understand the Rails clone thing. When Rails did was take a lot
of best practices from all over the web and wrap it up in Ruby using the best
features of that language to maximum effect.

It seems to me if you want a good C++ web framework, you need to start from
first principles instead of trying to clone something designed from the ground
up in such a different language.

------
aw3c2
Website is dead. I hope it is not a web framework. edit: It is but the site is
Wordpress.

~~~
kintamanimatt
Why wouldn't they eat their own dog food and build their site on their own
framework? It reflects really badly in so many ways.

~~~
dllthomas
On the one hand, it's certainly reasonable to have a site up for the project
before the code's ready. On the other, I certainly hope they're building
_something_ meaningful with it, before they call it stable.

~~~
kintamanimatt
v1.0 (stable) was released July 16, 2012!

~~~
dllthomas
Then I hope they've done something meaningful with it. It doesn't necessarily
have to be reimplementing their working (although apparently it isn't...)
site, is what I was trying to convey.

~~~
kintamanimatt
I actually wonder what the market is like for a C++ web framework. In
principle I like the idea of a framework built using a compiled language, but
I imagine it'd be far easier to write a vulnerable application.

~~~
nakkiel
OkCupid use their own event-driven C++ web server framework for their website.
I don't remember to what extent but it at least powers specific features such
as Chat ans Search; I can't guarantee they use it for the pages of the website
but I'd say they do (there are a couple of presentation but I read them long
ago).

> <http://okws.org/>

~~~
Sidnicious
We do use okws for the whole website. It's more work to use than a framework
like, say, Rails but it's well-designed and has some great features.

For instance, it includes a templating language called Pub. A typical request
hits a handler in C++-land which collects the data the page'll need into a
top-level Pub object. Then it invokes a Pub template which renders the page.
All of this enforces separation between your back-end logic and the design of
a page.

It would be awesome to see more frameworks with fresh ideas in this area,
though.

------
ricardobeat
Was expecting a much larger gap in performance from standard frameworks, it's
not that faster after all. And how can PHP with it's per-request lifecycle be
faster?

Cache for the performance comparison:
[http://webcache.googleusercontent.com/search?q=cache:wSdyzM4...](http://webcache.googleusercontent.com/search?q=cache:wSdyzM49_DYJ:www.treefrogframework.org/documents/comparison-
of-performance&hl=en&prmd=imvns&strip=1)

------
nicholassmith
This is interesting, I'm a c++ developer by day and like Rails on the weekend
so it tickles my main interests.

Building a large app that needs performance? I could see a C++ web framework
being useful, but basing it around Rails is a weird choice. Rails is great for
what Rails is great at, try a whole new bag that works with the language
benefits and the expected use cases.

------
neya
It would be interesting to see how this framework's performance would compare
to something like the Play framework (Play for Scala 2.0)..I mean, do you
think a C++ framework like this one would be able to scale and/or handle much
better traffic/load than a framework like Play?? (Play for Scala 2.0 in
particular)...Anyone?

------
darkstalker
What about Wt?

<http://www.webtoolkit.eu/wt>

------
dsrguru
I find it ironic that the site isn't loading now.

------
trung_pham
It would be cool if someone make a rails like framework for GoLang. :)

~~~
aaronblohowiak
Goweb, Gongo, falcore, go-fastweb, go-start, mango, web, web.go, wfdr,
Tideland, Twister

<http://godashboard.appspot.com/project>

~~~
aaronblohowiak
Whoops, i forgot to mention <http://code.google.com/p/gorilla/>

~~~
trung_pham
Unlike Ruby, I'm stilling waiting for the one framework to stand out and
dominate others, like Rails.

As of now, there are too many little web frameworks in Go. Most of them are
inactive. People still have a hard time selecting which one to use for their
project and not regret their decision in the future.

Ruby has Rails, Python has Django, what does Go have? Just name one, not a
list.

------
arunagarwal
Link is dead!

------
thirsteh
Apparently not great stability :)

------
xmpir
the link seems down to me...

------
r1chelt
link dead

