3 ms·
I never got the point of generators until I saw Koa.js I always thought generators were merely a way of making convoluted iterators, but when I realized that y
by lhorie 13y ago
I never got the point of generators until I saw Koa.js
I always thought generators were merely a way of making convoluted iterators, but when I realized that you can put your application logic inside a generator, in my head, it immediately turned it into a "how did I ever code without this before" kind of feature.
I just hope other browsers (especially IE) follow suit in implementing this feature
- apaprocki 13y agoWe (Bloomberg) sponsored Andy Wingo (Igalia) to do the work implementing the new generators in both V8 & SM in parallel, so the world would essentially get them in Chrome (+ Node, Opera) and Firefox at roughly the same time. We don't use JSC here, so I couldn't make a good case for extending the work to cover Safari as well. Anyone wanting to help implement them in JSC has two good blueprints to work from. I reached out to the IE team back when Andy was still early in the implementation and let them know what we were doing and what the release timeframe was in the hopes that it would help prioritize generators on their side, but I have yet to hear a peep about IE support. Maybe all we need are some benchmarks? :) edit: typo
- kybernetikos 13y agotaskjs is also an excellent use for generators http://taskjs.org/ http://taskjs.org/ It's also quite fun that you can embed a simple prolog in languages with generators fairly easily too: http://yieldprolog.sourceforge.net/ http://yieldprolog.sourceforge.net/
- sdegutis 13y agoCan you give an small concrete example of the new beneficial code that you realized you could do with it?