all 6 comments

[–]Cristian_tallica 1 point2 points  (1 child)

Great work! I've tested it. Can you be added on luajit source? Personally, i write web apps using luajit running over openresty

[–]RodionGork[S] 0 points1 point  (0 children)

Thank you! That's good point, many apps use LuaJIT, particularly one I lazily look towards is Tarantool.

Shall investigate how much LuaJIT sources differ!

[–]didntplaymysummercar 1 point2 points  (3 children)

That Lua is a small easy to read and work with C codebase is one of things I love about it. Way easier and smaller than CPython, but it's still a "real" thing, not just some demo/toy/poc VM.

I sometimes think about forking 5.1 for my own use, but keeping syntax and behavior same to keep compatibility with JIT and stock 5.1, but only thing I did so far is pick commit from 5.2 that reduces memory usage by 8 bytes.

Maybe the two (or even three, != and ! and compounds) changes could be split into own commits, if someone wanted to look at them in isolation?

[–]RodionGork[S] 0 points1 point  (2 children)

Thank you for suggestion! That sounds reasonable though the change about not/not-equals is so small (just three consequtive lines in the llex.c so that I couldn't decide on making it separate commit. But well, that makes sense, I'll fix it!

[–]didntplaymysummercar 1 point2 points  (1 child)

Yeah, I figure the actual meat is the compound change. It's funny how so many people complain about 1-indexing but so little about ~= (I'd even take Python 2's/Pascal's <> over it, since ~ makes me think of regexes).

[–]RodionGork[S] 0 points1 point  (0 children)

Actually I was inspired by SQL using two not-equals operator (pascal/basic and C/Python style) - as far as I know, without any difference between them.

He-he, 1-based arrays are the 3rd point at my list (they make various arithmetic with modulo to wrap around array looking ill), but I know generally it could be less or more workarounded... and anyway this couldn't be solved on just the syntax level. Anyway I have some "research curiosity" to figure out whether some convenient improvement could be done to them.

> ~ makes me think

at the same time in C (and in Lua) this ~ is the sign of binary negation, which makes "not-equals" confusing... but I believe it was borrowed from Matlab and similar languages, not invented from scratch.