lua-users home
lua-l archive

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




On Mon, Aug 12, 2013 at 11:27 AM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On Mon, Aug 12, 2013 at 12:15 PM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Mon, Aug 12, 2013 at 5:58 PM, Javier Guerra Giraldez <javier@guerrag.com>
> wrote:
>>

at worst you get Python, where functions _have_ to have a name, and
lambdas are limited to a single _expression_, no middle ground
(two-liner? give it a name!)

how is it done in MS? you can choose between single-_expression_,
delimited and indented syntaxes?  that doesn't sound like a way to
simplify things...

It's probably just me that's not fond of intended indention - it's a bit harder to back-track
and not friendly to re-factor the code (move the code around for a moment to test sth and
organize them later)
 

>> - terseness at the cost of readability is ok for low level languages
>> (hey, I _like_ bit-twiddling in C), but for scripts it creates more
>> friction between coder and maintainer.
>
>
> Sometimes these are not different people, just the same person in different
> modes ;)   But why should this argument not also apply to low-level
> languages?  Also, the Modest Proposal involves a more informal & private use
> of a terse dialect - we do not _usually_ save our bash sessions to Github.

while reviewing low-level code you'e supposed to be paying attention
to every character, so terseness is not only tolerated but sometimes
preferred.

but you're totally right, there's no need to maintain one-off code
only used in a REPL


I am kind of in to one-liner style ever sine I read "the c programming language" and
found out there could be some tricks that made the program concise but also my
colleagues occasionally complains me about the readabilities (regardless of the
actual languages)
 
>> - local by default?... i'm skeptical that it could be done well.
>
> I share your skepticism on this one, especially for bigger systems.
>
>>
>> - predefined OOP:  i don't mind it as long as it's easy to use (and
>> extend) from real Lua.
>
>
> It isn't even necessary. I could define a perfectly adequate 'class' in
> Moonscript in under 30 lines of code, and I knew it would then interoperate
> with the style I'm accustomed to.  The built-in one basically establishes
> yet another OOP style that doesn't play so nice with other Lua OOP styles.

ok, it's unecessary, but if it's there, it will be used.  case in
point: i was seriously considering to use Lapis, because the generated
Lua code seems mostly sane.  but many of its structure is in the form
of MS classes.  if they're not easy to use in Lua, then it's useless
to me.


You are right, as soon as the gap between Lua and MoonScript is subtle or zero,
it would probably be fine. As CoffeeScript to JS, there were quite a few JS libraries 
that made JS OOP-friendly (i.e. jQuery, Prototype, to name a few), however, 
people seem to favor the baked-in support to OO, probably to be consistent of 
how things to be done and understood, and maintained.
 

--
Javier


~hao