Contra – Asynchronous flow control with a functional taste to it
github.com
github.com
I almost can't believe that all of the other (current) comments are complaining about the use of the λ character. Unicode is hardly a new concept, and it is certainly not "hostile" (hyperbole much?).
In fact, as modern languages like Julia become popular, I think we will see increased use of unicode characters in coding. Julia is very unicode friendly, which aids scientists and mathematicians when translating formulas to code. For example, it supports the "element of" operator ('∈') for testing if an item is in a set. These unicode characters actually _improve_ readability in many contexts, while being less convenient to type if you're only accustomed to ASCII.
e.g. in Vim: Ctrl-V, U, 3bb <ret>
Which is OK for this one library... but if I had delta and epsilon libraries too I could see it getting to be a pain.
In terms of typing efficiency, 6 keystrokes, it's about the same as just typing "contra" except harder to remember.
(defun my-insert-lambda ()
(interactive)
(ucs-insert 955))
But there are many different options available in Emacs for inserting exotic characters, as listed here, for example: http://stackoverflow.com/questions/10192341/how-to-enter-gre... - I didn't have any need for them, as I only need lambda character when I'm programming in Racket (which understands this character natively, which is very nice!), but both abbrevs and input method ways of doing this look legit.https://en.wikipedia.org/wiki/Flow_control_(data) https://en.wikipedia.org/wiki/Control_flow
I expected a "please stop sending until I am ready to receive again" mechanism.
I don't understand this. Do you mean "so you don't need to use the λ character"?
[0] http://lostechies.com/derickbailey/2013/09/20/consistency-pr...
[1] http://thanpol.as/javascript/promises-a-performance-hits-you...
Inconsistency: If you're consistent in your promise library usage, then promises will always behave the same way. Wrap libraries as necessary.
Promises are incredibly easy to reason about - the code reads very synchronously. Until we have native concurrency primitives available at the language level, I'll settle for ".then". It's pretty much how I'd read it in my head anyways.
If promises are a hassle, you're probably not using them correctly.
Promises that implement Promises A+ are consistent. The fact that jQuery's implementation is broken has no relation to promises whatsoever (nobody seriously calls them promises anymore).
But I was talking about a different kind of consistency: consistency in your code. Errors not being swallowed, the same representation for all async values.
The performance post you linked to is almost a year old and is quite outdated. Since it was posted, Bluebird[1] was written and leveled up the game:
file time(ms) memory(MB)
promises-bluebird-generator.js 171 16.52
callbacks-baseline.js 197 20.68
promises-bluebird.js 280 26.64
promises-lvivski-davy.js 616 58.75
promises-dfilatov-vow.js 672 80.59
promises-cujojs-when.js 731 68.74
callbacks-caolan-async-waterfall.js 733 44.57
[1]: https://github.com/petkaantonov/bluebird/blob/master/benchma...