mathjs utility [discussion]
Created by: MartinHN
Hi again, just a general question about scripting in o-s-c, this is mainly because of the script object that use the same resolveprop than every other parameter...
why using mathjs over plain old eval in context ? (that could also be filled with mathjs functions) using eval we could benefit a nicer js syntax.
if its for a performance reason (i think security may not be a major issue here) i see two problems :
-
accessing unwanted value, can put the app in a unstable state -> i think we could pass a reduced context to avoid that
-
speed : with some basic tests (attached below), my first impression is that mathjs is significantly slower than eval (~50x), even whith precompiled expression. although i'm very new to testing js code perfs
I know that modifying variables from script is not yet allowed (right?) but if it where to come object modification could be lot cleaner.
tstSpeed.zip unzip and npm i following archive to reproduce (keep devtools closed to avoid weird stalls)