Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AS3 - evaluating at runtime - D.eval vs hurlant

I need to pass in a string that gets evaluated at runtime. So I can write this:

var foo =  someEvalMethod ( "dataObject.someValue" )

instead of:

if ( argIn == "dataObject.someValue")
   var foo = dataObject.someValue
}

Does anyone have an opinion on the following evaluate libraries, or better ones for AS3? Thanks:

AS3 eval by hurlant:

http://eval.hurlant.com/

D.eval by RIA 1:

http://www.riaone.com/products/deval/

like image 572
dt1000 Avatar asked Oct 09 '22 14:10

dt1000


1 Answers

As far as I know AS3 eval by hurlant is a "real" compiler. It parses code, generates bytecode and injects it to the Flash Player instance in use (through loadBytes() I guess).

D.eval has the same purpose but it does not generate bytecode, it parses expressions and execute them dynamically through its own API.

I see D.eval as a good candidate for what you are trying to achieve. It's not a full featured compiler, but it has enough APIs that cover many simple operations. Other than that it is a product that has a company behind, which is always a good guaranty.

Cheers!

like image 54
Joan Llenas Avatar answered Oct 13 '22 01:10

Joan Llenas