lua-users home
lua-l archive

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

On Sep 20, 2006, at 11:02 AM, Sam Roberts wrote:

On Wed, Sep 20, 2006 at 10:23:25AM -0700, Chris Marrin wrote:
As it is, using 'and' rather than '&&', '~=' rather than '!=' and '--'
rather than '//' are just showstoppers.

You could do a search and replace to convert those tokens between
_javascript_ and lua, but the semantics are different.

And if syntax AND semantics are the same... then they are the same

There may be people to whom using // is so important that a language
that uses -- is a show stopper, but not very smart people.

But let's be fair. If someone is using _javascript_ in some other part of their job and they come to use some new technology which includes scripting, it's cumbersome to switch yourself to use a different syntax. And cumbersome means lowered productivity. So the "corporate" argument for a common language syntax is pretty reasonable IMHO.

You really think Apple would take a language with the same syntax as js,
but with different semantics? Or are js and lua really so close in
semantics? If so, maybe js could be "compiled" into lua, like Markus
Fleck-Graffe seems to be doing with Smalltalk. Wish I could have seen
the talk.

It depends on what you mean by semantics:

    // Let's do something
    if (a != b) { c += d; /* and then */ e = f ? g : h }


    -- Let's do something
    if a ~= b then
        c = c + d --[[ and then ]]
        if f then e = g else e = h end

are semantically equivalent but syntactically very different. It's only when you get into the more arcane semantics of constructors, prototypes and scope stacks that the semantics might give you trouble.

What would you have tried to say that would convince a company that
wants less languages, not more, that a different language with more
js-like syntax should be used in some places?

The argument that I have always wanted to try is: let's say there was a _javascript_-like language, which was a pure subset of _javascript_, but without things like exceptions and regular expressions, and with relaxed rules for prototyping, could we use it? Most of the things _javascript_ is used for: assignment, dereferencing, computation, conditionals, looping and function calls, are the same. Does that argument fly? Or are the corner cases of the semantics important? 

This is a real question, you have a unique view from the inside and I
may need to make similar arguments some day.  Frankly, it doesn't sound
to me like you had the faintest chance of convincing them!

In my case, I don't think I do. There are zealots on both sides of the issue :-)

Which is too bad, I use OS X, and I'd like to be able to script it with
lua. On the other hand, I'd rather learn js than applescript, so there
is some good news there.

And you can! I have a nicely compiled version of Lua on my Mac. I have even fiddled the loader to deal with 'require' in a more Mac-like way. It would not be hard to come up with xcodeproj files which created proper mac "bundles" for use with Lua. Lua is completely functional on Macs. I just can't convince my management to use it in some end-user oriented projects.

~Chris                       And now, an important message from Microsoft:  "Dear aunt, let's set so double the killer delete select all"