News for hackers. Stuff that matters.
Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @05:53AM (#9056242)
Author here. If you have questions or suggestions, please post them here.
Re:Silicon C++14 Web Framework Documentation by stas12 on Monday February 16, 2015 @07:20AM (#9056532)
I always missed a good web framework in C++. I tried Wt, but didn't like its 'desktop app philosophy', so I dreamed of creating one.

Why I didn't do that? Because web framework must be feature rich. Rendering templates and maintaining sessions is no longer fun; today people expect the frameworks to solve their countless high-level problems, such as Paypal integration, i18n, currency manipulations, etc. Needless to mention that the code must be rock solid and well documented.

What's my point? I appreciate your effort, but I'm afraid you need some greater powers to be involved in development of features. Keeping fingers crossed for this to happen!

Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @07:53AM (#9056664)
I agree with your point. We are still at a "prehistoric" age in the development of C++ web servers.

All those high level tasks where hard in C++98. But C++11 and C++14 really helps high level programming. Silicon demonstrates that web development is now as easy in C++14 than is javascript, php, ...

The community just need to realize it, and silicon proves it by building a core framework. It reaches the ease of programming of dynamic languages like javascript or php while keeping the advantages of C++: performance and compile time code verification.

Let's see how fast the community will adopt the framework and how the numer of middleware will grow...

Given all the money spend in optimizing dynamic languages like ruby, javascript, python, ... There is a lack of performance in common web application frameworks. Why not building from a high level language that is fast by design ? With C++14 and silicon, you can finally run you app without worrying about with VM/JIT will better optimize your program.

Re:Silicon C++14 Web Framework Documentation by plq on Monday February 16, 2015 @07:42AM (#9056625)
Fortunately, not everyone who programs for the web needs PayPal integration :) If it's easy enough for people to switch, it will get there.
Re:Silicon C++14 Web Framework Documentation by imoldfella on Monday February 16, 2015 @08:34AM (#9056811)
Did you consider libuv? If so why asio over libuv. I've never taken time to benchmark them, but I have built web servers on both. Libuv has broader api support like cross platform file aio. Asio has more convenient c++ bindings, but there are some third party bindings that I haven't tried.
Re:Silicon C++14 Web Framework Documentation by nly on Monday February 16, 2015 @09:13AM (#9056956)
Async filesystem I/O isn't a priority for modern webapps / HTTP API endpoints that primarily just slam a database.

That said, I somewhat agree wrt ASIO. I've not quite been able to get ASIO to put out the reqs/sec, and the API is iffy in some areas, even when using C++14. Imho it's tolerable with the coroutine integration, but then debugging becomes a nightmare (forget exceptions because basically every socket operation can and will throw if the client does anything iffy)

Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @04:17PM (#9059081)
I also think that with async/await probably coming with the next c++ standard, we will be able to write much simpler async code in plain C++, without Asio.
Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @08:50AM (#9056877)
libuv could be one of the futur backends yes. But with microhttpd silicon is able to handle more req/s that most other web frameworks. I am more focused on stabilizing the code base, documentation, and adding support for other databases.
Re:Silicon C++14 Web Framework Documentation by netheril96 on Monday February 16, 2015 @08:45AM (#9056853)
Does this framework include many routines for string manipulation, like splitting, joining, formatting and encoding conversion? These are essential to the web, but extremely lacking in C++.
Re:Silicon C++14 Web Framework Documentation by roel_v on Monday February 16, 2015 @09:59AM (#9057129)
Everything except encoding support is in boost. ICU has i10n support.
Re:Silicon C++14 Web Framework Documentation by axorb on Monday February 16, 2015 @07:44AM (#9056626)
I never used a C++ web framework, how does this compare to the (few) other existing ones like Wt or crow?
Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @08:14AM (#9056736)
Wt is more focused on providing Qt-like widget of building interfaces server side. Silicon does have any tool to build html pages. It lets the client do the rendering.

Crow is a more similar to silicon. But silicon has several advantages:

   - several backend (microhttpd, websockets)
   - sql middlewares and orm for sqlite and mysql
   - dependency injection
(ps: I have no experience with crow)
Re:Silicon C++14 Web Framework Documentation by cypres on Monday February 16, 2015 @09:34AM (#9057039)
Would be awesome to have silicon support libh2o as a backend; github.com/h2o/h2o

Although libmicrohttpd is a very solid first choice, I would love to see how a combination of silicon and libh2o with it's HTTP/2 engine performs.

Re:Silicon C++14 Web Framework Documentation by matt42 on Monday February 16, 2015 @10:07AM (#9057162)
Yes. I already started to read the examples. They are a bit hard to digest but I will definitely take the time to implement a libh2o backend with HTTP/2 support.
Re:Silicon C++14 Web Framework Documentation by eXpl0it3r on Monday February 16, 2015 @01:56PM (#9058495)
What's the reason for IOD still using Boost Regex?
Re:Silicon C++14 Web Framework Documentation by matt42 on Tuesday February 17, 2015 @05:43AM (#9061529)
This dependency will soon be removed. It was used by the previous compiler because boost::regex_replace handles different types of formatters:

http://www.boost.org/doc/libs/1_57_0/libs/regex/doc/html/boo...

http://en.cppreference.com/w/cpp/regex/regex_replace