|
Boost : |
Subject: [boost] [beast] Review
From: Gyorgy Szekely (hoditohod_at_[hidden])
Date: 2017-07-09 06:18:07
Hi,
Some background: this is my first Boost library review. I followed the
discussion on Beast and I'm probably not as experienced as others on this
topic. I started learning Beast along with Asio and it was a really good
experience. After understanding ASIO concepts, I could get an async
multi-threaded http server running in a few hours.
I leave it up to the review manager whether to take this a formal review or
just informal feedback (impressions of newbie :))
*** What is your evaluation of the design?
The library in my opinion is very well designed. I doesn't try to offer too
much. I understand the author's position: HTTP is vast and Beast is a
low-level library. Still, while using it I felt with a few additional bits
it would be more complete. What I was missing is parsers/serializers for
uri and cookies. I think Beast should provide these (even in a separate
namespace), as they are not higher level functionality than
parsing/serializing http headers.
(I implemented them in my application, and I'm sure my code is neither
correct regarding corner cases, nor standards compliant. I'm also sure that
I'm not alone with this, so there's a place for this in either Beast, or as
the author suggests a higher level lib.)
Though the library is heavily templated, as a user I'm not forced to write
templated code, implementing the most common use-cases is simple and
straightforward. That's a big plus.
I really like the symmetric client/server design. My application is
http/websocket server, being able to use the the same classes and functions
in unit tests made reasoning about the code and tests much easier.
Finally there's was a lot of debate whether being ASIO and stream concept
based is a good idea or not. For me (as a newcomer) seamless integration
with ASIO helped getting started really fast, though I didn't do awfully
complex stuff.
*** What is your evaluation of the implementation?
I did not review all the implementation. While using the library, I looked
into some of the files, and my impression was that the code is high
quality. The test coverage is also high, and issue fixes are accompanied
with rigorous tests.
The library is mostly composed of templates, which makes a bit harder to
understand its internals, but I didn't mind it at all given the benefits
(composablity, customization points).
*** What is your evaluation of the documentation?
The documentation is well structured and plenty. Sections from the Intro up
to the Reference are a good read by themselves. Design decisions and
library scope are clearly stated. There're lots of examples in form of code
snipets highlighting a particular use-case, as well as fully functional
programs demonstrating these in action.
I liked that the documentation is similar to ASIO's and I could use them
together.
*** What is your evaluation of the potential usefulness of the library?
It's super useful. Even with its (current) dependency on ASIO and some
other Boost libs Beast is small while providing both client and server side
foundations for Websocket and HTTP. NodeJS and Java makes it so simple to
create REST services, this should be hard in C++ either with standards
based (NetTS) solutions. Beast is a step in the right direction.
*** Did you try to use the library? With which compiler(s)? Did you have
any problems?
I'm actively using the library in the Http/Websocket <-> ZeroMQ gateway
since Oct 2016 on Ubuntu 16.04 with GCC5, C++14. We've run extensive
performance and stability tests on the HTTP interface and we're quite
satisfied with the results. I migrated our codebase to newer Beast versions
multiple times, and during this I reported a few minor issues or requested
new features. The library author was really responsive and
fixed/implemented them quickly.
*** How much effort did you put into your evaluation? A glance? A quick
reading? In-depth study?
A few hours this time, but I've read the documentation and the public API
reference multiple times in the last months. I didn't go through the
implementation, but peeked into it here and there to understand some of the
details.
*** Are you knowledgeable about the problem domain?
Not really. I've implemented some NodeJS and Java Spring REST services, but
that's all.
My conclusion: Beast should be ACCEPTED.
Regards,
Gyorgy Szekely
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk