lua-users home
lua-l archive

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


On Wednesday 25 January 2006 23:34, mnewberry wrote:
[...]
> The more familiar the Lua syntax is, the more widely accepted and more
> easily accepted Lua will be. Just making syntactic sugar for -- and !- or
> maybe {} for "then" seems to me to be the kinds of things that make Lua far
> more palatable without really changing the architecture and capabilities of
> the language.

Hmm.

The thing is, Lua is *not* C. It doesn't work like it. Trying to make it look 
like C is just going to make people expect it to work like C, which is going 
to lead to confusion and bad code.

I have a concrete example of this --- Javascript. Javascript is, semantically, 
extremely similar to Lua (I believe someone here has a project that will 
rewrite programs from one to the other). However, it has the word 'Java' in 
the name, and it's syntax looks like Java, and the number of confused people 
who show up in comp.lang.javascript wanting to know why the class statement 
doesn't work or why declaring variables with 'int i' doesn't work or how 
they've tried to declare this function static and odd stuff has happened, 
etc, etc simply has to be seen to be believed. Prototype-based inheritance is 
really hard to get your head around if your every instinct is leading you to 
expect class-based inheritance.

(I ran into this myself --- I thought the Array class was an actual 
associative array class. It's not. In Lua terms, it's a table with some 
helper methods attached to it. This means that if an Array member collides 
with the name of a helper method, you lose.)

FWIW, I grew up on C, and I have no trouble switching between Lua and C. The 
code and the style are simply too different to confuse. There's stuff I don't 
like about the Lua syntax, but nothing I can't live with.

-- 
+- David Given --McQ-+ "I smell a rat; I see him forming in the air &
|  dg@cowlark.com    | darkening the sky; but I'll nip him in the bud."
| (dg@tao-group.com) | --- Sir Boyle Roche
+- www.cowlark.com --+ 

Attachment: pgpJ3JRV1LQPW.pgp
Description: PGP signature