lua-users home
lua-l archive

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

Hi folks!
I'm student, pythoneer, linux/oss enthusiast and C/C++ programmer.
I've got school project to implement compiler/interpreter for
language which was kind of subset of Lua and it caught my eye, so
when I read that the new edition of Programming in Lua came out I
bought it. I LOVE this book, I have a few notes on it and I want
authors (and anyone who is interested) to hear my feedback. So here
it is:

1) I like the way the book is written. There are interesting points,
there are pretty good examples of how to use Lua concepts in real
world programs. I like that the book doesn't stay on the surface but
it goes down, deeply below the surface. It describes mechanisms of how
are things in Lua implemented to give deeper understanding of them.

2) I like that there is chapter of how to embed Lua into C. It's
really useful and it's shame that this kind of information miss
from books about other scripting languages.

3) I'm still really puzzled about exercises. Don't get me wrong,
I like that they are there, but as a someone who is used to
"read chapter, do exercises at the end of it, continue with another
chapter" I found out that a lot of them are REAL challenges. It
pretty much reminds me of exercises from The Art of Computer
Programming. It had started with exercise 4.3 where I was really
unsure what was the point of that weird go-to code, continued with
5.4 - although I program for some time, I was unable to wrote that
recursive program using that description. From it I understand that
the code should have looked something like:

function combinations(tbl, n, m)
  if n < m then
    return nil
  else if m == 0 then
    return {}
    rsln = {}
    rsln[1] = tbl[1]
    combinations(rsln, n-1, m-1)
    table.delete(tbl, 1)
    combinations(rsln, n-1, m)
    return rsln

but it's weird and it doesn't work and it isn't
it and I'm pretty helpless (but I have made a couple of recursive
functions in my life!).
  But the shock comes with exercise 6.1. Either I'm missing
point or it's pretty non-trivial algorithm. In my language we have
two different "integrals": specific integral and non-specific integral.
Specific integral is something that is called "integral" in English:
area of the region in the xy-plane bounded by the graph f, x-axis and
the vertical lines x = a and x = b. I can solve this kind of integral
numerically (e. g. with Runge-Kutta methods), but you should have
range where you are solving it and in your assignment there is
nothing said about "range argument", so it seems that you
are asking to solve "non-specific" integral, something that is
also called "antiderivate" in English. And that is... that isn't
trivial. So, in exercises in chapter about functions you are
asking to write program that could do things Mathematica is
unable to do... or I am missing the whole point.
  Next "difficult" exercise is exercise no. 8.4, but I have
found some code (which I don't understand) on lua-users wiki.
  Exercise on chapter 9 is asking to rewrite program from
chapter 5, which I was unable to do, so I gave it up.
  I like that your exercises are challenges and I was happy many times
when I have done exercise that seemed hard to do, but as a someone who
is used to do all the exercises at the end of each chapter because they
are trivial programs, I am appalled. Next time, please, write warning
that it isn't necessary to do all the exercises, becase it really annoys
me - I don't consider chapter "done" until I have done all the exercises.

Or I am really stupid and exercises are trivial. If so, please, ignore
this complain :-).

4) I don't like the format of the book. Becase of how it is wide, the
frontpage and the backpage are bending whenever I want to put it into
my backpack and take it with me.

5) I like that it includes updated parts about Lua 5.2, but I hate
that even that Lua 5.2 is almost an year old, my Fedora 18 still
includes old Lua 5.1. Emacs lua-mode doesn't indent multi-line strings
well and Eclipse LDT, again, supports only Lua 5.1...

6) I have never saw so much use of a word "seldom" in my life :-).

Although it doesn't have to seem so, I very like PiL. I think that it
is one of the greatest books introducing programming language I have
ever read. And I like a lot of Lua concepts.

Thank you for reading this.