lua-users home
lua-l archive

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


(sigh, Tony caught me on my type inference blind spot again...)

On Wed, Jan 25, 2012 at 5:23 PM, Petite Abeille
<petite.abeille@gmail.com> wrote:

> On Jan 25, 2012, at 8:28 PM, Jay Carlson wrote:

>> Anyone
>> writing an ASCII 12 aka Form Feed is going to be unhappy when trying
>> to communicate it in XML.
>
> Bah... lets not get overly obsessive about this either...

I use it as one-character example in conversion between familiar
formats. This is an example where escaping *does not work*. Read the
Google templating examples to see messy examples that crop up in very
real systems; the authors for instance feel that "javascript:" should
not be representable in some link contexts. And that everybody writing
web pages should not have to carry that knowledge in every template.

> there is a point of negative return when the most trivial endeavor is turned into a recurrent CS101 ordeal...

I like to think of that as Patch Tuesday.

If I'm considering transferring full ASCII strings in XML from point A
to point B, I do what everybody else in this conversation probably
does:. ask if I really need to; ask what I actually lose if I drop the
non-printables; and finally base64-encode them if full fidelity with
teletypes is important. Assuming I control points A and B.

All of my talk about languages and context-sensitive interpolation etc
is not to make life harder. Life is already hard. Every second you
debug a system which mysteriously *half*-breaks in reports mentioning
somebody named O'Reilly isn't coming back.

The reason I'm talking about this on the Lua programming language list
is: are there existing language-level mechanisms that could make
implementing and especially debugging and reading today's stringy code
easier? Or new mechanisms? Or some combination of features lying
latent already? If I knew the answer I'd have written the code instead
of writing all this mail. Metalua's `Tags are a big help in some
programming styles.

> things still need to get done... even if done wrong... perhaps Little Bobby Tables' school would have been better off sticking to pen and paper...

Yeah. So if we spend endless amounts of time building magical
infrastructure we lose too. People are remarkably good at muddling
through.

Lua isn't Ada. It's not Tcl or VBA either. (ON ERROR RESUME NEXT
[sounds of laughter, sobbing, stabbing]) I think Lua aspires to be a
language correct programs can be written in, in which this does not
require extraordinary effort, and allowing varying levels of
sophistication in doing so. And a language where some kinds of
problems are just punted away because implementation complexity,
ergonomics, or reducing portability will cause more bugs. There are a
lot of Lua numbers where a==a+1 (etc) and my math intuition breaks,
but you don't see me complaining. I don't run into them much.

I run into Unicode a lot. And it seems like I run into problems with
string concatenation nearly every time I write Lua code. I mostly work
in systems where I interface with datasets I don't fully control or
understand. If I were shipping a console game and better controlled my
world this may happen a lot less. Some problems should be ignored; I
wonder which ones.

Jay

(Lua SQL still makes me very sad by lacking parameterized queries
though. Yes, it's better than nothing, Which backends can't support a
norrmalized form for the most common statements? I agree it doesn't
matter for small scale systems, just like perfect correctness of
personal shell scripts is not their utmost priority. The last perl
one-liner I wrote was a couple days ago and it ended up being about
350 characters long counting the pipes....ugh.)