Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
bnjmn
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
bnjmn
11y ago
As one of the people intimately involved in this release, I completely agree with the "stuff that should be there from the beginning" part of what you said :)
62.
▲
by
bnjmn
11y ago
Custom-fabricated Teensyduino w/ accelerometer that can distinguish heel/toe impact, USB power (battery clips onto shoelaces), LEDs attach to shoes with velcro. Cycle through preprogrammed light patterns by cycling power. You may
63.
▲
Motion-triggered RGB LEDs you can attach to any pair of shoes
(blinky.shoes)
7 points
by
bnjmn
11y ago
|
1 comments
64.
▲
by
bnjmn
12y ago
Thanks for taking a swing at this rebuttal, but isn't "gentlemen" a touch, um, gendered?
65.
▲
by
bnjmn
13y ago
It means you can have generator functions that contain no yield statements, which is not as crazy as it sounds. I've had to do `if False: yield` before in Python to trick the language into treating a function as a generator. An unyield
66.
▲
by
bnjmn
13y ago
This is hand-wavy for sure, but I don't think Emitter.prototype.emit is called more than once per AST node, and the number of cases should be less than the number of calls to .emit, so there should be fewer cases than AST nodes (which
67.
▲
by
bnjmn
13y ago
You can pass a value to .next(), which provides most of the value of .send().
68.
▲
by
bnjmn
13y ago
Really agree with this. I've come to appreciate both the limitations and power of generators during the course of this project.
69.
▲
by
bnjmn
13y ago
Interesting suggestion. Although Traceur's generator support is arguably more limited, I have to admit their code is currently better tested than regenerator's, so I think I want to give this repo some time to mature before explor
70.
▲
by
bnjmn
13y ago
Thanks for the links! I hope regenerator can make those projects work in environments beyond node.js.
71.
▲
by
bnjmn
13y ago
I love Continuum, and I think it takes the right approach for implementing all of ES6, if that's what you want. I just didn't think I could pitch the idea of using a virtual virtual machine to my team, so I took the more conservat
72.
▲
by
bnjmn
13y ago
I might recommend against the additional complexity for most use cases, since the generated code is only 1.5x slower, but I fully expect/hope that Facebook will decide to bite that complexity bullet for the speed gains in newer browser
73.
▲
by
bnjmn
13y ago
Exactly, the `wrapGenerator` function provides a small runtime that (among other things) handles uncaught exceptions: https://github.com/facebook/regenerator/blob/master/runtime/...
74.
▲
by
bnjmn
13y ago
I'm hoping to do a more in-depth writeup about this soon, but the basic approach is to hoist all declarations up into the closure of an inner function, so that all variables in the scope of the function persist between .next calls, and
75.
▲
by
bnjmn
13y ago
Done! Thanks! https://github.com/facebook/regenerator/commit/fe42c74a486fb...
76.
▲
by
bnjmn
13y ago
Not just yet, but that's on the roadmap for sure: https://github.com/facebook/regenerator/issues/18
77.
▲
by
bnjmn
13y ago
Re: how hard, I've been working on it for... a while ;) https://twitter.com/benjamn/status/331923303767867392 Re: unforeseen edge cases, I'd love to see any failing pull requests for the test suite: htt
78.
▲
by
bnjmn
13y ago
Great idea. Issue filed: https://github.com/facebook/regenerator/issues/20
79.
▲
by
bnjmn
13y ago
Thanks! Please let me know if/how you end up using it!
80.
▲
by
bnjmn
13y ago
Primary author here. Ask me anything!