Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actix-core does not use a server-side template for the fortunes test #4727

Closed
volyrique opened this issue May 5, 2019 · 7 comments · Fixed by #4729
Closed

actix-core does not use a server-side template for the fortunes test #4727

volyrique opened this issue May 5, 2019 · 7 comments · Fixed by #4729

Comments

@volyrique
Copy link
Contributor

The current implementation of the fortunes test in actix-core seems not to use a server-side template as mandated by point IX of the requirements - contrast that with the implementation in actix-pg. Instead, actix-core seems to be simply concatenating hardcoded strings.

Pinging @fafhrd91.

@volyrique
Copy link
Contributor Author

OK, so the same issue applies to aspcore as well.

Pinging @benaadams.

@benaadams
Copy link
Contributor

benaadams commented May 5, 2019

That particular aspcore implementation is marked as a Platform test

Classification

We classify frameworks as follows:

  • Full-stack, meaning a framework that provides wide feature coverage including server-side templates, database connectivity, form processing, and so on.
  • Micro, meaning a framework that provides request routing and some simple plumbing.
  • Platform, meaning a raw server (not actually a framework at all). Good luck! You're going to need it.

image

@volyrique
Copy link
Contributor Author

I don't think that classifying a framework as a platform means that one can avoid a very clear requirement. Another reading of what you mention is that platform frameworks simply can't be used for the fortunes test, which I don't agree with. In fact, historically there have been implementations based on platforms that still followed all requirements (for the fortunes test), e.g. Lwan in round 13.

Let's see what the TechEmpower team says.

@fafhrd91
Copy link
Contributor

fafhrd91 commented May 5, 2019

i am fine with using template engine, i dont think it will change much.

@benaadams
Copy link
Contributor

ASP.NET Core does have 3 distinct layers, each of which builds on the one before, but each one having a greater "opinion" on how things are done:

  • aspcore does what it has; it does do simple request routing (same code-base is used for all 6 test scenerios), database, XSS and even Json at this level of the stack. Very manual.
    This is the api level and is marked as Platform.
  • aspcore-mw has more complex request routing, more complex plumbing, form-processing, auth, ORMs etc, a lot more is automatically set up for you; some features you have to manually call but they are available to use.
    This is the features level and is marked as Micro.
    • This is also the layer most other alternative .NET stacks plug in e.g. carter and the F# stacks zebra and giraffe and the PHP stack peachpie as it has more features than just HTTP apis (and stuff the rest of the .NET stack itself provides).
  • aspcore-mvc has pages, data-binding, the Razor templating language and lots of other additional web features and everything is setup and resolved for you; so you generally don't have to configure any plumbing.
    This is the "concentrate on your business logic" level and is marked as Full-stack

Could make up a template format to parse and use .NET runtime code-gen; or compile time code-gen to output the exact same code that would perform the same as aspcore uses for Fortunes; however its not part of the provided stack so wouldn't necessarily be a good idiomatic representation of what you'd write for that classification of stack.

@bhauer
Copy link
Contributor

bhauer commented May 5, 2019

I apologize for the ambiguity in the requirements and will think about how to clarify them going forward.

The intended interpretation is:

  • The Fortunes requirement to use a templating system takes precedence and should be applied in all cases.
  • For frameworks (or permutations of frameworks) for which no template engine is provided, a suitable template engine should be used as a library supplementing the framework to implement the Fortunes test. For example, some of the Java frameworks do not specify a template engine so their Fortunes implementations use Mustache or similar.

The definition of "template engine" is obviously left undefined and is open to interpretation and debate. But we do want something that is more than string concatenation or an equivalent. I don't want to expressly require that a template should be a file on disk, but the traditional notion of a "template file" merged with a context object to yield output HTML illustrates what we have in mind when we speak of a template engine. We do want implementations of Fortunes to necessarily incur the performance impact of parsing a template and doing that merging to yield an output.

Mustache is cited in the requirements because it is available on many platforms and its small feature set seems a reasonable minimum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants