dymmond / lilya

Yet another ASGI toolkit that delivers
https://lilya.dev
BSD 3-Clause "New" or "Revised" License
41 stars 4 forks source link

Difference with starlette #87

Closed paroxyste-0 closed 3 months ago

paroxyste-0 commented 3 months ago

Hi, I stumbled across your framework and while reading the documentation I noticed that Lilya was virtually identical to Starlette.

What are the differences between Lilya and Starlette? Is it a fork? Have you done any real-use benchmarks (not plain text) to see where Lilya stands?

Thanks for your reply.

tarsil commented 3 months ago

@paroxyste-0 you got it right. Initially Lilya was some sort of a fork from Starlette as we wanted to have more control over the API but then we realise that we could do a lot more with it like bringing a native client (for shell, project generators...), directives, permissions, encoders (literally this is what Esmerald inherits and allows some future proof concepts), and a different way of declaring handlers (endpoints) with Include as the biggest difference. So basically we brought some native Esmerald features and embed in Lilya make it more versatile and modular.

Although Lilya looks identical, that was also intentional as we didn't want people to think that would take ages to adopt Lilya if they wanted. It was not a coincidence. Starlette is a fantastic framework/toolkit and we needed a bit more on top of it that we knew that was not the purpose of Starlette. It is important to understand that its not a competition with Starlette, we personally love Starlette but we needed as mentioned before, some control over the API and some extras.

Regarding benchmarks we ran a few but not something officially from the big providers.

I hope this answers your questions?

P.S.: Lilya is now the base of Esmerald and we have already production deployed applications using it and people seem to enjoy it a lot.

paroxyste-0 commented 3 months ago

Thank you for your response !!

If Lilya became the foundation of Esmerald, what does Esmerald bring to the table? I get the impression that Lilya and Esmerald are like Starlette and FastAPI, with the difference that Esmerald is a mix between Starlette and Litestar.

In any case, both approaches seem very interesting to me. Have you been able to measure any performance differences between the two frameworks (Lilya and Esmerald), considering Esmerald comes with a lot more dependencies?

Best regards.

tarsil commented 3 months ago

Thank you for your response !!

If Lilya became the foundation of Esmerald, what does Esmerald bring to the table? I get the impression that Lilya and Esmerald are like Starlette and FastAPI, with the difference that Esmerald is a mix between Starlette and Litestar.

In any case, both approaches seem very interesting to me. Have you been able to measure any performance differences between the two frameworks (Lilya and Esmerald), considering Esmerald comes with a lot more dependencies?

Best regards.

The biggest problem I see is when there are comparisons of tools. Esmerald has nothing to do with Litestar neither does Lilya. If we were thinking like that then everything is like Django since it's the oldest 🤣. Well, Esmerald is a fully fledged web framework whereas Lilya it's not. Esmerald targets completely different markets and use cases.

Think like this, Lilya is the toolkit that allowed Esmerald to be built. The dependency system if Esmerald for instance is different from the one from Lilya, brings the OpenAPI documentation, interceptors, pluggables and a lot more things. Bare in mind one thing. Esmerald was initially built on top of Starlette and then moved to Lilya.

Lilya is the bare bones and Esmerald is something on top.

For those coming from Django, for example, Esmerald is a lot easy to get up to speed.

There is a lot of history behind the reasoning of Esmerald but in the end it's a developers choice and what you want to achieve. There are great frameworks out there 🙂

Esmerald was serving use cases that FastAPI was not targeting when it was created and still does.

I hope this was clear to you?

Best

paroxyste-0 commented 3 months ago

I understand better now. Please excuse me if my comparison was clumsy; it’s just that I had the impression they could be distinguished like Flask and Django, where one has a very minimalist approach and the other is much more comprehensive.

Thank you for all this information! It might also help others to better clarify the different projects!

Best of luck with everything!

tarsil commented 3 months ago

I understand better now. Please excuse me if my comparison was clumsy; it’s just that I had the impression they could be distinguished like Flask and Django, where one has a very minimalist approach and the other is much more comprehensive.

Thank you for all this information! It might also help others to better clarify the different projects!

Best of luck with everything!

Oh, no problem whatsoever. It wasn't clumsy at all and I'm more than happy to help clarifying.

You can always join our discord 🙂