lua-users home
lua-l archive

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


On Jun 3, 2014, at 3:06 AM, steve donovan <steve.j.donovan@gmail.com> wrote:

> On Mon, Jun 2, 2014 at 10:24 PM, Elias Barrionovo
> <elias.tandel@gmail.com> wrote:
>> Well, it's a bit OT and nitpicking, but in Python when you do this:
>> 
>> def foo(a, b):
>>  return a, b
>> 
>> you are actually returning only one value, (a, b), which is an
>> instance of tuple [1]  (parenthesis is optional for tuple literals).
> 
> And that's the point - it's more expensive than it looks.  True
> multiple returns in Lua and Go are cheap.  (In both languages, often
> used for distinct error returns)
> 
> That's why I prefer Lua to Python - there is less 'convenience magic' happening.
> 
> As for Swift - it's fashionable for big companies to have their own
> new programming language. A well-known advertising agency [1] has
> spawned at least two recently. Despite its oddities, Swift seems a lot
> more readable than Objective-C, which always made my eyes bleed.
> 
> [1] Google (Go and Dart)
> 

Agreed .. compared to Obj-C it seems a step forward. Overall it’s not too bad, though I detect a distant echo of Pascal in there somewhere (variable declaration syntax for example). I would place it ahead of C++ and Java to be honest (damned with faint praise??). I’ve never enjoyed coding in C++, I can see myself being ok with Swift, though it will never be as elegant as Lua. At least it has a clean set of integer types (i always disliked the mess called stdint.h).

It’s interesting to see how some of the features reflect characteristics of LLVM (the use of “let” constants for example to help the code generator with optimizations).

—Tim