4 ms·
Silicon C++14 Web Framework Documentation
- matt42 12y agoAuthor here. If you have questions or suggestions, please post them here.
- stas12 12y agoI 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!
- plq 12y agoFortunately, not everyone who programs for the web needs PayPal integration :) If it's easy enough for people to switch, it will get there.
- matt42 12y agoI 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.
- axorb 12y agoI never used a C++ web framework, how does this compare to the (few) other existing ones like Wt or crow?
- matt42 12y agoWt 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)
- imoldfella 12y agoDid 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.
- matt42 12y agolibuv 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.
- nly 12y agoAsync 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)
- matt42 12y agoI 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.
- netheril96 12y agoDoes 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++.
- roel_v 12y agoEverything except encoding support is in boost. ICU has i10n support.
- cypres 12y agoWould 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.
- matt42 12y agoYes. 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.
- eXpl0it3r 12y agoWhat's the reason for IOD still using Boost Regex?
- matt42 12y agoThis 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/boost_regex/ref/regex_replace.html http://www.boost.org/doc/libs/1_57_0/libs/regex/doc/html/boo... http://en.cppreference.com/w/cpp/regex/regex_replace http://en.cppreference.com/w/cpp/regex/regex_replace
- decasteve 12y agoNice approach. C++11/14 web frameworks are sorely needed. I was hoping to use one for an upcoming side project. If I go this route I'll let you know. I hope this catches on.
- matt42 12y agoThanks. I would be happy to hear your feedback: what was nice, what feature/documentation is missing, what should be improved, etc...
- amelius 12y agoCool, but imho to claim "high performance" it should also have support for HTTP 2.
- matt42 12y agoThere are already several C implementations of HTTP 2. And it should not take too long to wrap them in a silicon backend.
- sctb 12y agohttps://news.ycombinator.com/item?id=8911217 https://news.ycombinator.com/item?id=8911217
- matt42 12y agoMy previous post was a link to the github repository. This post is about the new documentation website which gives much information about the framework.
- matt42 12y agoCould we know why this post has been banned from the frontpage? Thanks, Matt