lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


That's interesting, could you send me the link where it states that? I Want to read more about it. Regardless, I still think this is a bit illogical behavior, considering how it's written, but good to know.

Thanks.

On Fri, Apr 28, 2023 at 5:55 PM Gé Weijers <ge@weijers.org> wrote:


On Fri, Apr 28, 2023 at 1:49 AM Ziyao <ziyao@disroot.org> wrote:
> As far as I know, most languages do the expected output, such as c++,
> Java, Python, and even Luau now.
> Is there a specific reason for choosing this behavior?


There is nothing stopping a C or C++ compiler from reordering assignments and many other operations, this is very explicitly allowed in the standards, and helps produce faster code by avoiding pipeline stalls. 

 
--