3 ms·
What causes the overhead? Is there a way to get the sugar without the calories?
by quadhome 14y ago
What causes the overhead? Is there a way to get the sugar without the calories?
- hearth 14y agoA trivial example: $len = mb_strlen("wtf"); # call function mb_strlen $len = s("wtf")->len(); # call function s # allocate string object # instantiate string object # call string ctor # set property # call method len # get property # call function mb_strlen # destroy object There's no way to use a syntax like this without either massive overhead, or massive changes in the engine. There is a somewhat similar experimental project - https://github.com/nikic/scalar_objects https://github.com/nikic/scalar_objects - but that's not meant for real world use either. Personally I think the language, despite its flaws, does its job fine. I don't think it needs turning into Javascript-with-sigils.