[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Getting Started with Lua
- From: Jay Carlson <nop@...>
- Date: Wed, 24 Jul 2013 16:16:15 -0400
I think I've said this a few times.
Let's ignore call-with-current-continuation, mutable strings, and the particular structure-sharing hacks of cons-cell lists. Lua's computational model is substantially the same as SICP-era Scheme. Especially if a black box Lua syntax parser is provided as a module, students could go arbitrarily far on the SICP metacircular grand tour, eventually generating and interpreting Lua bytecode, first on the Lua substrate, then on the memory-like vector-of-numbers substrate.
The major thing missing from Lua 5.2 is a messy dynamic-typed numeric tower which confuses everyone, especially implementers. Lua 5.3 promises to fix this. :-)
To be fair, if your goal *is* to be able to build a SqueakVM- or Prescheme-like restricted Lua dialect which maps to C or machine instructions, getting "typical" bare metal ints into the language might help.
Jay
On Jul 24, 2013, at 1:47 PM, H. Conrad Cunningham wrote:
> My course is a graduate computer science course, but one of my goals is to explore Lua as a possible working language for a revision of our core undergraduate course on Programming Language Organization in 2014. Because my current course will have mostly MS in CS students, I can let them do quite a bit of work on their own. But I need to stay enough ahead of the students to organize the course reasonably and guide students away from any dead ends and perhaps toward my long-term goal.
>
> Because it is a graduate course, however, I do want it to explore deeply and widely in the Lua universe.
>
> My first program (after a bit of play in the REPL) during the past week is a Lua version of the interpreter from Chapter 1 of Sam Kamin's 1990 textbook Programming Languages: An Interpreter-Based Approach. I used LPEG to implement the parser for this toy language (a simple Lisp-like syntax with only "integer data) with capture functions to build the symbol table and an intermediate representation (which is essentially an abstract syntax tree for the input expression). Before the semester begins, I hope to be able to use this base to implement a couple other of Kamin's toy languages and thereby determine how I should restructure the base to be more generic and modular.
>
> - Conrad
>
>
> On Jul 24, 2013, at 11:44 AM, Ralph Hempel <rhempel@bmts.com> wrote:
>> You might want to tell the list what level of course you are planning to teach. If it's introductory computer science, stick with one language and stick to the bare core of Lua with no additional libraries except maybe luafilesystem and luasocket.
>>
>> Anything more will just confuse the students.
>>
>>> The PiL book and some of the other documents are good.
>>
>> I would argue Pil is "great", as in one of the best books since the C manual by K&P or the "Little Schemer".
>>
>> Contact me offlist if you're interested in a contact with another prof using Lua for introductory CS for non-CS majors...
>>
>> Ralph
>>
>
>