lua-users home
lua-l archive

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


What do I miss in lua? [1]

1. Unicode. Deprecate _G.string, make _G.bytes and _G.text. Make them work the same in the bare ANSI build maybe, don't ship a non-char implementation maybe, but let Lua code express intent. Lua in ASCII will remain identical.

2. Unicode. At the very least, filters on io streams to blow up on invalid UTF-8 going in or out, and a memoized assert. The world has moved past DECwriters; one of the highest rated comments on the Reddit lua-wikipedia story was questioning the sanity of using the non-i18n Lua in a project with global cultural scale. Not even having a figleaf is a problem for adoption.

I don't care if there are N good add-ins. (I wrapped librecode.) I need to share a language with other programmers and we have to coordinate with each other on some aspects of how text is handled. (Imagine if everyone used their own flavor of tagged tables/ropes/etc for strings.) We have rough consensus for XML--if everything is ASCII. The language as spoken will balkanize.

I imagine it already has in non-byte locales. A Korean Lua program will not use libraries from a Greek one. Unless everybody is already using UTF-8--with no sanity checking.

ANSI C has wchar, so other people have noticed. A lot of madness can lie in this direction; tcl rewrote stdio in the version ~8 period, and it bloated enormously.

OK. How about an easy one?

3. perl -a -p -i

See man perlrun. I can build that, but I never get around to it. I retain knowledge of perl 20 years later because I use it in pipes; I forget details of string.* because I don't use it as often.

Back to coordination.

4. The smallest of libraries. I'm tired of shallow-copying tables. It was fun the first few times I wrote it. Finding where other people hid their Set{'a'} -> {a=true} in an app sucks but the alternatives are cut&paste or shipping noplib.lua whenever I touch code. And what do other people do about "for k,v in pairs(t) do print(k,v) end"? It's difficult to do *any* interactive work without it.

Another reason I'd like this is so bozos stop overriding tostring etc for the same effect.

I suppose I could go survey the Warhammer or WoW codebases to see what everybody agrees on.

Comparing everybody's init.lua might be interesting too. Not a good use of a mailing list though.

Jay

[1]: I have TF2 on the brain. I hear "meet the demoman" this time.