HN user

bp74

19 karma

Author of the StageXL for Dart library. https://github.com/bp74/StageXL

Posts0
Comments17
View on HN
No posts found.
[GET] "/api/user/bp74/stories?hitsPerPage=30&page=0": 500 Failed to fetch user stories

Yes absolutely! We started with a port of the AS3 runtime for DragonBones but were not happy with the code quality and the performance. Therefore we started the StageXL runtime for DrageonBones from scratch. The downside is that the new runtime does not support one or two of the features of the official runtimes. But animations like the one you showed in your example are completely covered. If you need something that is missing, just talk to us here: https://github.com/bp74/StageXL_DragonBones

Edit: Animation run at 60fps and look smooth because those animations are using bones and key frames. The runtime interpolates the motion of those bones between the keyframes.

Sorry i missed your second question. I would choose StageXL over PixiJS because auf the Dart language. I also use TypeScript for other project but i prefer Dart. The Dart-to-JavaScript compiler does an awesome job. It not only transpiles Dart code to JavaScript (like the TypeScript compiler does for TypeScript) but it's a real compiler with great optimization and minification. The optimizations include inlining, dead code removal, hoisting, etc. The resulting JavaScript code is not pretty to look at, but pretty damned fast at runtime.

hahaha, i totally agree - if it is 50x larger i would use a different tool too :) But as i said, if your source is 100KB it's not 50x larger, maybe it's 20% larger than hand written JS. Currently the footprint of the js-code is around 150KB. While dart2js is evolving this number is declining constantly. In the end when you add js-minification you will have a footprint of maybe 20-30KB i guess.

You are right that small programs compile to pretty big JS-files, but noone should really care. I can do my "hello world" apps in javascript without a problem, the point of Dart is to write big apps! For those apps the footprint of the compiled JS-code doesn't matter at all. And you can work with nice structured source code.

Well, you should see it from another point of view. You write and debug(!) your application in Dart, later you compile it to JavaScript. The dart2js team tries very hard to generate code that runs just like the Dart code does in the VM. Look at the JS-code like the binary code you get from a c++ compiler. There are hardly any people debuging the generated machine code in c++ right?

I have allready written tons of Dart code, and i have to admit there were a few issues with the JS-code regarding cross browser compatibilty (btw. it is easy to read the generated js-code). Those issues were problems in the dart2js compiler because it's a alpha-version right now. The dart2js team fixed all those bugs. As soon as the compiler will finally ship we will rely on the generated output - no need to debug "assembly language".

Thanks for sharing the link! I'm the author of the library and the demos. It's great to see some positive feedback. You can also check out some samples (i like the mask sample most):

Samples: http://www.dartflash.com

Source: https://github.com/bp74/dartflash/tree/master/samples

Some words about the Dart language. It's great to work with this new langauge and much more fun compared to javascript which is a pain when you come from the ActionScript/Java/C# world. In Dart you feel at home right from the start. Google is very much committed to the project and we will see pretty amazing things in the future. Of course the Chrome browser (Desktop and Android) will support the Dart VM in the future. The dart2js compiler allready works great and has improved a lot over the last weeks.