May 10, 2022

On Tuesday, 10 May 2022 at 15:00:06 UTC, Andrea Fontana wrote:

>

I work in the R&D and every single time I even have to write a small api or a simple html interface to control some strange machine I think "omg, I have to set nginx agaaaaaain".

Good point, there are more application areas than regular websites. Embedded remote applications could be another application area where you want something simple with HTTPS (monitoring webcams, sensors, solar panels, supervising farming houses or whatever).

May 10, 2022

On Tuesday, 10 May 2022 at 15:16:22 UTC, Ola Fosheim Grøstad wrote:

>

On Tuesday, 10 May 2022 at 15:00:06 UTC, Andrea Fontana wrote:

>

I work in the R&D and every single time I even have to write a small api or a simple html interface to control some strange machine I think "omg, I have to set nginx agaaaaaain".

Good point, there are more application areas than regular websites. Embedded remote applications could be another application area where you want something simple with HTTPS (monitoring webcams, sensors, solar panels, supervising farming houses or whatever).

Indeed the "-ino" suffix in "serverino" stands for "small" in italian. :)

Andrea

May 10, 2022

On Tuesday, 10 May 2022 at 15:27:48 UTC, Andrea Fontana wrote:

>

Indeed the "-ino" suffix in "serverino" stands for "small" in italian. :)

Bambino > bambinello? So, the embedded-version could be «serverinello»? :O)

May 10, 2022

On Tuesday, 10 May 2022 at 15:35:35 UTC, Ola Fosheim Grøstad wrote:

>

On Tuesday, 10 May 2022 at 15:27:48 UTC, Andrea Fontana wrote:

>

Indeed the "-ino" suffix in "serverino" stands for "small" in italian. :)

Bambino > bambinello? So, the embedded-version could be «serverinello»? :O)

Oh, italian is full of suffixes. -ello means a slightly different thing. It's small but sounds like a bit pejorative.

-ino in bambino is not (anymore) a suffix, anyway.

Andrea

May 10, 2022

On Tuesday, 10 May 2022 at 16:05:11 UTC, Andrea Fontana wrote:

>

Oh, italian is full of suffixes. -ello means a slightly different thing. It's small but sounds like a bit pejorative.

Oh, and I loved the sound of it… suggests immaturity, perhaps?

(I love the -ello and -ella endings. «Bambinella» is one of my favourite words, turns out it is a fruit too!)

May 10, 2022

On Tuesday, 10 May 2022 at 10:49:06 UTC, Andrea Fontana wrote:

>

On Tuesday, 10 May 2022 at 08:32:15 UTC, Sebastiaan Koppe wrote:

>

The difference is that with the route uda you can only map routes 1:1 exhaustively. With your approach it is up to the programmer to avoid errors. It is also hard to reason about the flow of requests through all those functions, and you have to look at the body of them to determine what will happen.

Sorry I don't follow you

It is simple, since all your handler are effectively chained, any error in any one of them can cause later ones to fail or misbehave. This decreases locality and increases the things you have to reason about.

There are other benefits to uda tagged endpoints too, for example they are easier to nest, or to programmatically generate them. In vibe-d I added the default option of generating OPTION handlers for every regular endpoint. This is required for CORS.

>

In any case if you want to use a different routing strategy it's quite easy. I really don't like libraries that force you to use their own style/way.

That is good.

May 10, 2022

On Tuesday, 10 May 2022 at 16:47:13 UTC, Ola Fosheim Grøstad wrote:

>

On Tuesday, 10 May 2022 at 16:05:11 UTC, Andrea Fontana wrote:

>

Oh, italian is full of suffixes. -ello means a slightly different thing. It's small but sounds like a bit pejorative.

Oh, and I loved the sound of it… suggests immaturity, perhaps?

(I love the -ello and -ella endings. «Bambinella» is one of my favourite words, turns out it is a fruit too!)

Maybe bambinetto is more about immaturity. Bambinuccio is cute. Bambinaccio is bad. Bambinone is big (an adult that behave like a child). -ello doesn't sound good with bambino, but it's very similar to -etto.

Good luck :)

May 10, 2022

On Tuesday, 10 May 2022 at 18:33:18 UTC, Sebastiaan Koppe wrote:

>

On Tuesday, 10 May 2022 at 10:49:06 UTC, Andrea Fontana wrote:

>

On Tuesday, 10 May 2022 at 08:32:15 UTC, Sebastiaan Koppe wrote:

>

The difference is that with the route uda you can only map routes 1:1 exhaustively. With your approach it is up to the programmer to avoid errors. It is also hard to reason about the flow of requests through all those functions, and you have to look at the body of them to determine what will happen.

Sorry I don't follow you

It is simple, since all your handler are effectively chained, any error in any one of them can cause later ones to fail or misbehave. This decreases locality and increases the things you have to reason about.

Not sure. What if your uda (regex) match is too permissive? Is that different?

My code evaluates workers in order, just like yours, no?

Maybe I can enable some log if set on config, to track what's happening. That could help you to debug if something goes wrong.

>

There are other benefits to uda tagged endpoints too, for example they are easier to nest, or to programmatically generate them. In vibe-d I added the default option of generating OPTION handlers for every regular endpoint. This is required for CORS.

@endpoint void func(...){
   if(req.method == Method.OPTION){
       // THIS RUN FOR EVERY ENDPOINT
   }
}
> >

In any case if you want to use a different routing strategy it's quite easy. I really don't like libraries that force you to use their own style/way.

That is good.

Andrea

May 10, 2022
On Tuesday, 10 May 2022 at 16:05:11 UTC, Andrea Fontana wrote:
> On Tuesday, 10 May 2022 at 15:35:35 UTC, Ola Fosheim Grøstad wrote:
>> On Tuesday, 10 May 2022 at 15:27:48 UTC, Andrea Fontana wrote:
>>> Indeed the "-ino" suffix in "serverino" stands for "small" in italian. :)
>>
>> Bambino > bambinello? So, the embedded-version could be «serverinello»? :O)
>
> Oh, italian is full of suffixes. -ello means a slightly different thing. It's small but sounds like a bit pejorative.
>
> -ino in bambino is not (anymore) a suffix, anyway.
>
>
> Andrea

Concordo ... (I agree!)

:-P
May 10, 2022
On Tuesday, 10 May 2022 at 19:50:08 UTC, Paolo Invernizzi wrote:
>
> Concordo ... (I agree!)
>
> :-P

Wait, you have always said you're not Italian. Have you changed your mind?

Andrea