| > If Dart VM can use "patch class" declarations then why this "@inline" should be considered as a bad? Annotation like that is not enough for intrinsics. You would still need to provide some way of detecting in the compilation pipeline and intrinsifier that method you are looking at is indeed `Integer_bitAndFromInteger`. In this particular case you could look at the name of the native, but that does not work with those intrinsified methods that have Dart bodies. In those cases it would have to be @intrinsic("name of the intrinsic"). Right now we can write C++ code like this: switch (recognized_kind()) {
case MethodRecognizer::kSmth:
case MethodRecognizer::kSmthElse:
break;
}
If we start to relying on strings - this code will become less readable (or alternatively you would have to map strings into C++ enumeration which would require a list quite list one of the above).To be honest aesthetically I like annotations, so I would like to use them to replace these lists, but that does not really solve anything or improve much. Even more: there is really no fundamental difference between having an annotation and a list like that, so I don't really understand what bothers you about these lists. > (dynamism is better, determine everything at runtime or from magic lists) Annotation would be no less magic (and not available to the user code anyways). |
This approach does not allow me to use annotations (or other way) for specifying that my own "native" methods in "native extension" are required some attention.
You use for such attention these lists.
Eg.
I have the following methods (via macro defs) in my "native extension":
=========================
=========================These methods are very fast (in C++) but in fact Dart VM executes them (native methods) very SLOOOOOOOOOOOWWWWWWWWWWWW...
See my question on stack overflow:
========================= Why native wrapped functions in Dart are such heavyweight in comparison with “DEFINE NATIVE ENTRY” functions that are very lightweight?
http://stackoverflow.com/questions/21363429/why-native-wrapp... =========================
- Dart developers does not like annotation
- Dart VM does not uses annotation
- Dart VM does not uses type annotation
- Dart VM executes custom "native (which in fact are very fast)" methods very slow
This is what is means for me that Dart VM is not a very well balanced for high performance.
P.S.
This is why "I bothers you about these lists".
Because they are in some cases the only way to improve performance.