According to the FrameworkBenchmark’s specification, the endpoint /fortunes should respond with a very specific response. For one, the head cannot have a meta tag. Also, the endpoint must send back Content-Length header. Hence my questions.
Question 1: How do I remove the meta tag that is automatically inserted by reply_html_page ?
I find that to be confusing. One of the points of the meta tag is to have the content type so that the specification of the page is known, think syntax checking or even at times type checking. reply_html_page/2 makes some knowledge of the content type.
So I am thinking that if there is no content type then reply_html_page/2 should not be used and something at a lower level from SWI-Prolog should be used in constructing the response.
The reason I state this is that in reading about html_set_options/1 with content_type(+ContentType) it seems that removing the meta tag for reply_html_page/2 is not something that should be done.
Welcome to SWI-Prolog (threaded, 64 bits, version 8.3.27)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org
For built-in help, use ?- help(Topic). or ?- apropos(Word).
ERROR: Unknown procedure: html_current_option/1 (DWIM could not correct goal)
Option = dialect(html5) ;
Option = doctype(html) ;
Option = content_type('text/html; charset=UTF-8').
Yes, the only thing coming from the DB are the rows. The rest is static.
To clarify, in FrameworkBenchmark there are plenty of submissions out there that are trying to squeeze every last drop of performance out of respective platforms with the sole goal of winning the benchmark. I think such submissions miss the point somewhat. The idea of the FrameworkBenchmark is not to produce the fastest code (i.e. just use rust/c++, why bother?) but to show the platform’s idiomatic way of solving a predefined set of test problems, and to weigh readability, elegance, structure, patterns etc. against performance penalty.
Prolog is homoiconic so by many in the Prolog community Prolog is also the database.
Is FrameworksBenchmarks requiring that another database be used? If so how much data is being stored? One can store a lot in Prolog without needing another SQL or NoSQL database. (ref)
If the data can be stored with SWI-Prolog using library(persistency) then I would personally consider that they are saddling Prolog with an artificial constraint and that any results for Prolog should not be considered valid. I do understand that there are times when the data is an external database and so Prolog needs to access it as such but if given the choice of using Prolog as the database and using Prolog with an another database I will choose using Prolog as the database.
I wouldn’t see it that way. This is a benchmark for web apps, and these days the web apps almost exclusively distributed, cloud based, with stateless web fronts and a managed database behind, acting as source of truth.
In fact, if you wish to suffer some philosophising on my side, I’d say emphasis on:
integration (with other managed services like DBs, cache fronts, cloud APIs, message queues)
is the best option for Prolog to see more adoption.
But this is a completely separate discussion I am not fully equipped to have right now.