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

August 7th - wooo codegen is almost done

 
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 Aug 07, 2006 9:39 pm    Post subject: August 7th - wooo codegen is almost done Reply with quote

Okay, I've got everything working mostly. There are a few issues right now:

  • As it is, the 'logical not' operator does not properly invert comparisons. So writing "x != 4" is not the same as "!(x == 4)". The net result is the same, but the latter actually gets the boolean value from "x == 4" inverts it, and tests for truth, rather than just changing the comparison from == to !=. This should be an easy fix.

  • The op= operators are basically translated into their long form. This means that the LHS is effectively evaluated twice, which defeats the purpose of having them. Additionally, I'm not sure how the "opOpEq" metamethods will work, since there are no separate opcodes for them. Both problems could be solved by adding op= opcodes, but that's a lot of opcodes! The metamethods could also work by seeing if the dest and the 1st source are the same, and if so, calling the op= metamethod, but..

  • I looked at how Squirrel did its array constructors. It looked nice - just create an array with the right capacity, and cat all the new elements on. Since the array capacity would be big enough to hold them all, the cat (or cateq?) would not cause array reallocations. However, after I implemented this, I realized that Squirrel does not have any kind of multiple assignment, and as such, expressions like "[vararg]" do not work as expected - rather than the array being created with all the variadic arguments, it'll only be created with the first. Same goes for function calls. So I think I'll have to do a Lua-style list scheme. Sigh..


So, the agenda for tomorrow (if I have any free time, since I work again): one, get array constructors done right; two, invert jumps; and three, think about op= expressions. I really don't want to add 12 new opcodes. Though it's kind of tempting.
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