News for hackers. Stuff that matters.

nickfargo

The term is not merely a recent appropriation. Parametric polymorphism is a concept from functional programming and formal type theory, with application far beyond just JavaScript.
Re:Readable Clojure on Wednesday May 24, 2017 @08:06PM (#14414405)
That's interesting, because I find #() rather less easy to parse compared to (comp) or (partial) for otherwise equivalent expressions.

At a glance I know that (comp f g h) and its flat list of arguments expresses a simple function composition chain. Seeing a #(f (g (h %))) where (comp) will do makes me sift through more parens; more than that though, when (comp) is embraced as convention, a #() is an immediate cue that simple function composition is not what's being expressed, which draws me in necessarily to examine the particular structure of the #() body.

Re:Optimize your Node app by upgrading Node.js on Thursday March 30, 2017 @05:46PM (#13999164)
This is a different notion of polymorphism, yes.

Suggested reading: http://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.h...

Re:Use cases for ES6 proxies on Wednesday July 20, 2016 @12:50AM (#12126966)
> just use a closure!

Of course, but that means allocating a closure object per method per instance. When people say they want private variables, they mean they want them available in regular prototype-mounted methods. Proxies are one way ES6 lets you implement that. (Another is to use a WeakMap structure alongside a constructor, where each instance created by the constructor is mapped to a separate object that holds the "private" properties of that instance. Methods close over the WeakMap, but, crucially, are defined once on the constructor's prototype.)

Re:Io.js 1.0.0 on Tuesday January 13, 2015 @11:22PM (#8884283)

  ls -l /usr/local/bin/node
  lrwxr-xr-x  1 502  staff  4 Jan 13 20:10 /usr/local/bin/node -> iojs
Is this necessary?
Re:Swift Standard Library: Generators, Sequences and Collections on Tuesday December 30, 2014 @03:51PM (#8816672)
A generator is an iterator created and returned by a generator function.
Re:She's Her Own Twin on Monday June 09, 2014 @06:47PM (#7870946)
Re:Dear Github, can I go home now? on Friday March 14, 2014 @01:49PM (#7400531)
People whose opinions of you really matter know that the green boxes don't.
Re:An open question (rant) about Node.js on Friday March 14, 2014 @12:37PM (#7399995)
Referencing C10k implies yes. Threads cost.
Re:The pleasantness of Om on Friday February 28, 2014 @08:54PM (#7322738)
The "looks more pleasant?" test can be valid only between cljs/Om and the CoffeeScript from which the generated JS was compiled.

By presenting Coffee's not-quite-idiomatic JS output as the counterpoint, the otherwise well made argument for Om's pleasantness is weakened.

Re:CoffeeScript 1.7.0 on Wednesday January 29, 2014 @02:04PM (#7145981)
Pretty big rush to judgement. Slice off a copy of the arguments if you need them, but

  pall = -> console.log line for line in arguments; return
would have done just fine there.

One can be annoyed by `return` in tail position, or delighted by invocations-as-expressions. But not both. It's ok to choose the latter. :-)

Also, `console.log` is not a fit for map, forEach, et al. Check the parameters.

Re:CoffeeScript 1.7.0 on Tuesday January 28, 2014 @07:17PM (#7140827)
And moreover,

    describe 'syntax after upgrading', ->
      it 'should be even meatier', ->
        expect parentheses.required
          .toBe false
Very tidy.
Re:“Performant” is not a word on Monday May 20, 2013 @09:27PM (#5741358)
I have understood “performant” to suggest a soundness of design that causes something to be “fast”. In the context of algorithms, certainly the distinction is blurred, but in other, higher-level contexts, it can be meaningful.