[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Desired Lua Features
- From: Sean Conner <sean@...>
- Date: Sun, 28 Jan 2018 22:02:14 -0500
It was thus said that the Great Paige DePol once stated:
> I can see parallels here with programming languages, when you come from a
> language with a robust syntax, think Perl, to one not as verbose, such as
> Lua, it can be difficult to adjust... I know it took me a while to stop
> trying to append my if statements on single expressions! However, once you
> get used to the limited syntax and use it for a long time it may be harder
> to think in terms of the constructs you haven't used for a long time.
The problem I have with Perl is that there are so many variations on
syntax  ("More than one way to do it!") that it becomes difficult to read
other people's code. And I know that I find it odd to think of an
expression negated by a conditional *afterwards!* The whole
do_this() if that;
just seems ... odd to me.  But I can see where you are coming from.
There were plenty of things I couldn't express in C that I could in
assembly. Things like anonymous variables:
push 100 ; we're doing something 100 times
; lots of code using all registers
dec [esp] ; are we there yet?
No need to name the variable. Then there was the ability to return multiple
values (still something I sorely miss in C). And it cuts both ways---after
programming in C for the past twenty years, there are things I now miss when
programming in Assembly , like not having to think about register
allocation, or mismanaging the stack .
> One thing I always enjoy is discovering the uncommon syntax used by other
> programming languages. It is always interesting to learn new ways I could
> potentially think in terms of coding!
One of the books that changed how I code  is _Thinking Forth_ by Leo
Brodie. Yes, it's geared for Forth, but it really got me thinking about
code in general and how I approach it.
> This desire to express my code with different structures is also what helps
> drive my patching of Lua. That and a desire to hack and learn what makes
> things work the way they do! :)
For a real mindblowing language, look up INRAC. It's a non-deterministic
language with the oddest flow control mechanism I've ever seen. And I know
of three commercial products written with INRAC .
 Understandable when one realizes that Perl was designed and written
by a linguist, who likes to use implicit pronouns.
 Then again, I never liked Perl to start with.
 For fun these days.
 Mismatched push/pop instructions, not stack overwriting.
 The other one is _Writing Solid Code_. Yes, it's published by
Microsoft and I get the irony. It's still a great book.
 Only two of which are programs!