I'm looking to build my next web-app using the Brook Framework, but the documentation site is unreachable.
I'd like the official "Getting Started" documents to start reading up how to use it.
I have already installed the latest Brook framework (2018-May-09 version) using the Online Package Manager just a few minutes ago.
https://brookframework.org/doc/index.html
I can only find really old posts by Silvio Clécio in the forum.
Hi RedOctober,
I don't often use forums, but after found this topic via Google I reopen my forum account to answer (even late) your questions and explain regarding Brook framework.
Today, Brook is in beta version 5.0 (codename Tardigrade). It compiles in Delphi and Free Pascal and has been successfully tested on these OSes:
Windows [32/64]
Linux [32/64]
Raspbian [any]
Android [19+]
(this answer shows the systems which it has been tested constantly:
https://github.com/silvioprog/brookframework/issues/160#issuecomment-440375746)
Any previous version of Brook is Free Pascal-only, and the latest release for it with respective patches are available here:
https://github.com/silvioprog/brookframework/releases/tag/v4.0.0 .
Since Brook 5.0 was written from scratch, it is practically a new project (the reason for having a new major version), that don't depends on fcl-web (since it needs to run on Delphi too), so its documentation, examples and tests are being developed, and a new issue about that was opened here with a respective To-Do project: Issue:
https://github.com/silvioprog/brookframework/issues/162 / To-Do project:
https://github.com/silvioprog/brookframework/projects/1.
Some Q/A to make clear about Brook framework (and me) to avoid misunderstandings:
Q: Why Brook now uses a C library?
A: At least someone asking the reason why now it uses a C library! Brook needed to be high-performance without depending on external web servers (Apache, Nginx, IIS or kernel mode driver like http.sys etc.), and there is no any HTTP server in pure Pascal which reaches it:
https://github.com/risoflora/libsagui/tree/master/examples/benchmark . I've been developed business solutions for years, and it has been more productive to use a small (about 140 kB) C library instead of an entire third party web server, making easier the debugging at production stage, no configuration, low or no cost when required support.
Q: Who is the author(s) of the library used by Brook?
A: The GNU community and me.
Q: What features / license of the library?
A: Event-driven; One thread per request; Thread pool (very recommend for large demand of requests); High-performance path routing supporting compiled Regex using Just-in-time optimization (JIT); Entry-points matching using binary search; HTTPS support using GnuTLS (TLS 1.3); Basic authentication; Upload/download streaming by payload (JSON, XML transferring) and file (large data transferring like videos, images, binaries and so on); Fields, parameters, cookies, headers and any key-value list under hash table structure . The library is under LGPL 3.
Q: Did silvioprog abandon Pascal?
A: As I said recently on Twitter (which I rarely use), I never left Pascal!!!:
https://twitter.com/silvioprog/status/1061124155280711680 . I can't understand why people are thinking it about me, since I've constantly contributed to FPC/Lazarus by sending patches via Mantis.
Q: Was Brook framework abandoned?
A: Not by me! ;-) But, unfortunately, I have seen people that even don't know the project using social network to discourage Brook.
Q: Why few activity in Brook commits?
A:
(me): Because I'm working in other important parts that will be used in Brook 5.1, for example: RTTI.Invoke() assembly for System V ABI (Linux64):
https://github.com/silvioprog/rtti.invoke ; I joined to Pas2JS (which I would like to integrate to Brook 5+), so I'm working on it too:
https://bugs.freepascal.org/view.php?id=34524 (and several other patches I've sent to the Lazarus/FPC team); I'm studying real-time applications to support it in Brook. Some people send me e-mails / called me requesting training / paid support for dedicated time (I do complementar works like teaching development using Brook, 8-bit microcontrollers, embedded/electronic solutions etc.), and I spend long time answering / training them. And other things of any person spends time, like family, company etc.
(other maintainers): Currently, there is some people requesting help/documentation/features at issues page. For while, I'm the only maintainer working in the current version, but I believe that will have more people working on Brook as soon the version 5.0 is released and published in Delphi communities too (including its GetIt tool). I'll search partners for Brook too, maybe joining to some event like 'Delphi developers day' or a Lazarus one.
Q: Why new Brook was written from scratch?
A: Just to offer the same classes to compile in Delphi or Free Pascal.
Q: Does Brook 5 have a persistence layer?
A: Not yet. Maybe in Brook 5.1, using drivers directly or a single small C library.
Q: What is 5.0 & 5.1?
A: 5.0 = current version on trunk, just waiting documentation/tests to be released, but already massively tested in production in many customers of our company; 5.1 = next version after 5.0, supporting dynamic class routing and maybe real-time applications plus persistence.
Extra Q: Does Brook 5 have web-sockets support?
A: Not yet. Maybe in Brook 5.1, since it will support real-time applications.
I can't imagine a web application in the real world working without a database and/or any security layer. So, how the purely Pascal people that don't like (or hates) C libraries does, by rewriting the database low-level driver in pure Pascal from scratch? Or rewriting complex code for TLS in pure Pascal? No, of course. They uses C libraries and distribute them! Particularly, I'm not purist, so I don't have any resistance by using a C library or anything that help me to solve the complex problems day after day at company, the only restrictions I have using anything (a car, a bike, a motorcycle or a software...) depends as so good it is, if it has support and really solve the problem efficiently. For example, I don't like assembly so much, but I know it, so I used it to solve a problem in the FPC RTL:
https://github.com/silvioprog/rtti.invoke/blob/master/invoke_unix64.inc#L50 .
I'll stay not much active on forum, precisely because I'm working to contribute to FPC improving its RTL (specially the RTTI part), since many RTL features are present only on Delphi and I would like to use them on FPC too. Anyway, if you want to know what new features are present in Brook 5 and which are the advantages of using them, I'll be glad to answer via Brook community at
https://plus.google.com/u/0/communities/101133820055678331036 .