FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update - July 31

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Mon Jul 31, 2006 3:53 pm    Post subject: Update - July 31 Reply with quote

I've been working on the codegen (haven't had much time the last couple days - now I'm off tomorrow and wednesday, wee!). I was following the Lua compiler for the codegen, and realized that it was severely optimized and specialized and that it was next to impossible to extricate, duplicate, and expand upon, so I kind of reorganized it in a more sane (and a little easier to follow) manner. Now I've got an "expression stack," so I can push operands onto it, then pop them off in an operation, which will get the operands and code the instruction and whatnot.

One semantic change has been effected in the language spec as a result of the codegen - assignments (for local definitions as well) may only have one expression on the right-hand-side. If there are multiple targets, the RHS must be either a function call or vararg expression. So, the following which are legal in Lua (and used to be in MiniD):

Code:
local a, b, c = 1, 2, 3;
a, b, c = 4, 5, 6;


Are no longer. Why is this? It (1) simplifies the codegen a bit Wink and (2) it's very rare that you need to do "a, b, c = 1, 2, 3", and that looks confusing too. At least when you write "a, b, c = f()", it's obvious that you're getting multiple results from a function call.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group