Live data from Hacker News

Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

kylecordes.com

21–30 of 61 posts

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#21

Earlier quoted context omitted.

> Am I just missing some information in this regard? A major, and non-negotiable, design goal of Lua is that it targets the ANSI C environment to maximise portability. ANSI C does not define Unicode support. Incidentally, those two libraries might be unchanged because they're stable. The rate of change in the main lua implementation is quite measured.

More specifically, Unicode is one of those things (like bignum support) where Lua's design for embedding assumes that if it's a priority, your project will already have settled on a library for it, so anything Lua came bundled with would just get in the way. The GMP library, for example, is almost four times larger than the whole Lua runtime . Besides, Lua strings are interned raw byte-arrays (like atoms in Erlang or…

I wouldn't have a problem with external unicode support if there was one "standard" recommended library that had a strong community behind it. My whole point is that that doesn't appear to exist.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#22

Earlier quoted context omitted.

ICU4Lua is a wrapper for an existing, stable library. Does (for example) the Python wrapper for sqlite get a lot of commits these days? And if not, does that make it dead and abandoned?

Why is it in beta? Why does the mailing list [ http://lists.luaforge.net/pipermail/icu-lua-users/ ] have no activity on it?

Unless something is a major standalone project, discussion usually happens on the main Lua mailing list instead. About the beta label - I don't know. gmail was in beta for a long time, too, though.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#23

I'd say lua is great, well good, it's just that it's entirely reasonable, which makes it kind of boring ;) It as been the least surprising language I've used.

There's deep stuff there (look into coroutines and metatables), but Lua has been carefully designed so that it doesn't get in the way. If all you want from Lua is a (JSON-like) format for data dumps or config files, you can safely ignore the rest of the language. It's like the opposite of C++ that way. :)

That is exactly how I introduced Lua in to one of our projects: as a very - little code way to handling a complex configuration situation. It grew in to full scriptability.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#24

Earlier quoted context omitted.

More specifically, Unicode is one of those things (like bignum support) where Lua's design for embedding assumes that if it's a priority, your project will already have settled on a library for it, so anything Lua came bundled with would just get in the way. The GMP library, for example, is almost four times larger than the whole Lua runtime . Besides, Lua strings are interned raw byte-arrays (like atoms in Erlang or…

I wouldn't have a problem with external unicode support if there was one "standard" recommended library that had a strong community behind it. My whole point is that that doesn't appear to exist.

Sure. This is a real issue for new Lua users, though in the long run it's not a showstopper.

For roughly half the people using Lua, library choices have already been decided by the big C++ (or whatever) project they're adding Lua to, so the question never arises in the first place. That's the primary use case for Lua. It's a really nice standalone language, too, but it was designed for embedding. Many of its strengths (such as the small, orthogonal, clean design) come from that focus, but so do some quirks. If you use Lua as a standalone language, you'll occasionally need to do some digging for libraries, particularly if you're not comfortable with C. The situation has been improving significantly over the last year or two, though.

I don't have a specific Unicode library recommendation, but would suggest checking the mailing list archives (http://lua-users.org/lists/lua-l/).

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#25
post #12
post #7

Earlier quoted context omitted.

The Lua philosophy is far different from the philosophy of other languages. That's why videos like these, that cover the advantages before the tradeoffs, are a good thing. Knowing the positive things about something really effects my perceptions of the tradeoffs. Also, Unicode is an odd thing to consider to be an essential part of a programming language. Usually when I hear it I think the person must think it's a par…

As a Finnish software dev I can say that in these days native support for Unicode is a must. We have a couple of special characters in the alphabet (åäö) and if you have to do a lot of manual work to use these, the programming language is pretty much unusable for real world stuff that involves any use of Finnish. The fact that Ruby took so long to get real Unicode support is due to Japanese resisting Unicode in favor…

The characters you listed are defined in latin-1. They really don't serve as a good example for the urgent need to use unicode.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#26
post #12

Earlier quoted context omitted.

As a Finnish software dev I can say that in these days native support for Unicode is a must. We have a couple of special characters in the alphabet (åäö) and if you have to do a lot of manual work to use these, the programming language is pretty much unusable for real world stuff that involves any use of Finnish. The fact that Ruby took so long to get real Unicode support is due to Japanese resisting Unicode in favor…

Is Unicode something that needs to be in the core of a language, or is it sufficient to leave it to libraries, if the language's design doesn't prevent it? On this computer (OpenBSD/i386), icu has over 1 MB of libraries and a 15 MB data file. The whole Lua distribution fits in one 200k library. Bloating the core language with that seems impractical.

In my opinion, it needs to be in the core.

Imagine you need to go through a library every time your string includes or might include the letter "s" or "v". Basically you'd need to use this library for all your strings. But then you lose compatibility with 'normal' string type and need to be constantly aware of the difference. You might want to use some other library that doesn't support this Unicode library at all, etc. It quickly becomes a very painful world to live in.

As you might imagine, just having support for Unicode baked in the language is very nice. Defaulting to Unicode for all text is even better.

I can understand why Lua in particular doesn't come with Unicode support out of the box, being so small. My comment was written in response to the more general claim that Unicode support is a strange thing to consider essential in a programming language.

(According to http://www.bckelk.ukfsn.org/words/etaoin.html, s/ä and v/ö are comparable in frequency.)

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#27
post #25
post #12

Earlier quoted context omitted.

As a Finnish software dev I can say that in these days native support for Unicode is a must. We have a couple of special characters in the alphabet (åäö) and if you have to do a lot of manual work to use these, the programming language is pretty much unusable for real world stuff that involves any use of Finnish. The fact that Ruby took so long to get real Unicode support is due to Japanese resisting Unicode in favor…

The characters you listed are defined in latin-1. They really don't serve as a good example for the urgent need to use unicode.

They are not in ASCII, and that is the problem. You wouldn't believe how many times I've tripped over Python 2.x's UnicodeDecodeError for example.

Moreover, I wasn't searching for the best example -- merely using something I have personal experience of.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#29

Earlier quoted context omitted.

http://luaforge.net/projects/ul-str/ Last updated June 21st 2010. Readme seems to indicate it supports all the important stuff like compare, concatenate, encode, lower upper, Regexp, url escaping. Says beta and I haven't tried it yet tho : /

Thanks, that's useful to hear. It isn't on the wiki page: http://lua-users.org/wiki/LuaUnicode (which hasn't been touched since Sep 2009).

http://luaforge.net luaforge seems to still be active and doing a pretty good job aggregating libraries. Check out the "luarocks" and "kepler" project pages for ideas. Or just grab some mysql bindings and start from scratch. Let HNers know if you build a lua blog\cms etc... it's been on my todo list but probably won't get to it until December.

Re: Lua Doesn't Suck – Strange Loop 2010 20-minute talk video

#30

Earlier quoted context omitted.

> Am I just missing some information in this regard? A major, and non-negotiable, design goal of Lua is that it targets the ANSI C environment to maximise portability. ANSI C does not define Unicode support. Incidentally, those two libraries might be unchanged because they're stable. The rate of change in the main lua implementation is quite measured.

(I'm the guy in the video.) I haven't had a need for Unicode in Lua, but when I stumbled across some information about it, the essential story was that there is nothing stopping you from writing code to manipulate Unicode data (obviously), but there is also nothing built in to help you. All the built in string stuff is ANSI/ASCII/whatever. However, the language Io (which often gets mentioned in the same breath as Lua…

Are you affiliated with Lambda Lounge in STL?
Post reply on HN