Remix.run Logo
BiteCode_dev 3 months ago

It has lazy enumeration with generators, but:

    - string construction is a hot path, you don't want them to always be lazy, especially since any access is slow in python.

    - having it using a string syntax is just very clean and easy to read. It's explicit and can be supported by good editor highlighting.

    - it's easy to grep, analyse for, substitute, etc.

    - you get one single unified API instead of thousands of variations. Translations API, log API and escaping API can all look the same, arguments are in the same shapes.
psychoslave 3 months ago | parent [-]

Thanks for the detailed answer.

I understand that string generation can be a hotpath, though I wouldn't take it as a general certain fact.

From what I understand here the benefit in term of performance is mainly due to partial application automatically handled by the interpreter. It's hard to me to jauge actual pro/con compared to Ruby which can also leverage on freezed string, lambda, miscellaneous lazy evaluation facilities for example. I'm not aware of anything close in PHP, to stay in the realm of popular interpreted languages. I didn't make any Lua for a long time, so no idea how it evolved on that matter.