lua-users home
lua-l archive

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

Peter Hill:
> However it's really more of an indulgent exploration than a suggestion for
> a final implementation. I hope writing it will give me a better feel for
> some of the problems faced implementing the language, and a better
> understanding of the internals. For example, writing the lexical analyser
> has already shown me a few lexical ambiguities in the current
> documentation.

Björn De Meyer
> Well, you're free to indulge in such an exploration, but getting to know
> the C code of Lua seems to me the best way of getting to know the true
> internals of Lua.

Viewing the way someone else has done something before trying it yourself
can inhibit understanding. Of course I wouldn't do this for a project that
was huge, but Lua is quite petite.

Since I've always had an interest in various programming languages, and
desire to write my own to include some features I feel are currently missing
from those on offer, it is extra enlightening.

Peter Hill:
> And VB is an environment where I can quickly whip up & debug a simulation.
> The lexical analyser only took about 2 hours to write. I expect the parser
> to take about 4.

Björn De Meyer:
> If you like quick programming, hµthen why not use the ideal language for
> that: Lua.

To be "quick" requires not just language power but also an excellent
debugging environment. I haven't yet found a Lua IDE that comes close to VB.

> Have you considered writing the Lua lexer and parser in Lua?

No, but it could be interesting. I'll try whipping one up.

I always feel a good language should be able to be neatly written in itself.
It's not as useful as writting C in C, though, since Lua doesn't compile to
machine code.

> I have a  half-finished Lua lexer written in Lua lying around, based on
> the C version.
> Not to mention that the Lua authors also have expressed interest in Lua in
> Lua.
> I'm willing to help you a little with Lua in Lua...

Ok, I've now written a lex-in-lua module (though not yet exhaustively
debugged it). Would you care to look at it and offer some commentary?

Peter Hill:
> That is the ultimate goal, I agree. I'd prefer a compiled DLL or OCX .
> However I've never tried creating any COM compliant DLL's, so I'm sort of
> puting it off. :-O

Björn De Meyer:
> Well, I have done this before, and basically, you need to write a good IDL
> file. Howerver, I must also admit that it's quite painful and arduous to
> do so. Activex is IMO not much fun. Maybe you could do a .NET component
> instead?

IDL? Alas, I know nothing of writting DLLs in C. And I only have VB6 so
don't have access .NET stuff.

> EH? When I sum up all the changes you have proposed up to now, I think
> there are at least a dozen, and some would really require for the parser
> to be thoughroughly modified.

I meant 'minor' in that they would not produce a significant change of
language operation, so I doubted people would be bothered trying them.

> The main reason why I ask for you to make these modifications in C is not
> only to see how it would change Lua, but also to see how you would
> implement some of these changes. Some of them are indeed rather trivial,
> but others are quite difficult to implement.

Ok. Well, that may take a while. I've printed the Lua5 source but it is not
strongly commented and may take a while to understand well enough to feel
safe modifying.

Peter Hill.