Better HN
topnewbestaskshowjobs
Log inSign up

substack

1,135 karma · joined Mar 22, 2009 (17y ago) · 212 submissions

Whatever.
Submissions

comment 14y ago · link · parent

Thanks for posting this! I just updating my own silly shuffle module (https://github.com/substack/node-deck) to work using the last in-place algorithm for uniform shuffling and I saw a huge speedup.

comment 14y ago · link · parent

> "normals" have absolutely zero clue about what it is

I was surprised to hear my relatively non-technical father ask me back in December if SOPA was as bad as he had heard. Discussion of this legislation seems to be making it out into the mainstream press in bits and pieces. NPR has done several segments on it that I know of for instance.

comment 14y ago · link · parent

I discussed this with isaacs in one of the nodeup episodes and we concluded that a pagerank implementation for authors and projects that reads in the npm stars and dependency graph might work. It would also be useful to consider the github watchers, elapsed time since the last update, and the presence and status of tests, perhaps by ingesting data from travis-ci.

Edit: turns out what I have in mind nearly already exists at http://eirikb.github.com/nipster

comment 14y ago · link · parent

Perhaps you could just be more narrow in your searches with `npm search`? Perhaps instead of searching for "asset management" you could just search for a tool that does browser javascript bundling and then search for another tool that does css bundling. There are fewer of each of those and you can refine your search further by looking for specific things like bundlers that do node-style require()s versus AMD-style requires.

Plus, on http://search.npmjs.org you can see how many people have starred a project. You can star a project yourself with `npm star`. For a lot of projects you can click the home page or github links from the project page too. These are really useful to get a quick glance of what the API is like. If a project doesn't have either of these then it probably isn't worth using.

comment 14y ago · link · parent

Knowing how semver works is pretty useful if you're doing node development and writing down package dependencies in package.json. semver is also for negotiating protocol version ranges between network services.

comment 14y ago · link · parent

Nor should it. semver is just about versions. npm does know about tests with scripts.test in package.json and there are some projects in the works to run tests automatically from npm like CPANTS but it's still early.

comment 14y ago · link · parent

Node is catching up pretty fast, although its modules might not be as mature yet:

    102257  perl    http://www.cpan.org/
     33270  java    http://search.maven.org/#stats
     31921  ruby    https://rubygems.org/
     18068  python  http://pypi.python.org/pypi
      5732  node    http://search.npmjs.org/

comment 14y ago · link · parent

I could just as easily make up a story about how males are intrinsically attracted to pink and red, the color of animal flesh from a recent hunt and how females are attracted to blue waters since in many pre-agrarian societies women had to carry water back to camp.

Without empirical studies with solid controls these are just stories. Evolutionary psychology theories are especially guilty of these kinds of story-making explanations that aren't held up to evidence.

comment 14y ago · link · parent

I really love how this project copies how the node require resolution works. That is by far my favorite thing about node and it lets programmers do version management and reusability really well.

comment 14y ago · link · parent

> Let's go ahead and compare with Twisted, shall we?

Oh goodness, yes.

How about an echo server. This one is from the twisted home page, so I am not knocking down a strawman.

    from twisted.internet import protocol, reactor
    
    class Echo(protocol.Protocol):
        def dataReceived(self, data):
            self.transport.write(data)
    
    class EchoFactory(protocol.Factory):
        def buildProtocol(self, addr):
            return Echo()
    
    reactor.listenTCP(1234, EchoFactory())
    reactor.run()

Versus in node you can do:

    var net = require('net');
    net.createServer(function (stream) {
        stream.pipe(stream)
    }).listen(5000)
This is what I mean by limited surface area. I shouldn't need to define 2 classes to write an echo server. An Echo class AND an EchoFactory? And on top of that I need to mess with a reactor? How does that pass for good API design?

comment 14y ago · link · parent

The asynchronous aspects were a very small piece of the article for a reason. Node is doing a lot of very interesting, important, and novel things that aren't related to asynchronous events at all. Twisted in particular suffers from too much exposed surface area and having to manage the reactor yourself, which hurts reusability a lot.

comment 14y ago · link · parent

> But still, having dealt with library version issues sometimes, I think "concurrent library versioning" and "sophisticated package management" sound awfully nightmarishly black-magic to me. I guess I would be more on the "let's understand the most of what happens and not change what don't need to" kind.

Concurrent versioning lets you do the "not change what don't need to" part really, really, well. Versions of packages that have been proven to work well with one another can continue to do so because if you need a newer version of some library then both the old and the new version can live harmoniously in the same codebase. You don't need to be paranoid about upgrading modules anymore because node and npm are already paranoid on your behalf.

103.

The node.js aesthetic(substack.net ↗)

136 points · by substack · 14y ago · 76 comments

comment 15y ago · link · parent

Doing probability backwards like this is not useful and leads to fallacious conclusions and magical thinking. How is this any different from people running around misapplying quantum terminology for feel-good conclusions?

comment 15y ago · link · parent

The plan is to support other test styles like jasmine and qunit through npm modules: http://testling.com/docs/#using-npm

comment 15y ago · link · parent

Support for conflicting dependencies in npm is an amazingly great feature because once a piece of software works you can update little pieces of your application without worrying about whether upgrading a dependency will break some sub-dependency somewhere. If your dependency graph has upwards of 50 nodes in it as some of mine do, this is a very big deal.

comment 15y ago · link · parent

Hey thanks! The business of making the web a little less terrible and a little more reliable is a great space to be in.

comment 15y ago · link · parent

Testling is our newest product here at browserling, so we definitely know how to make tunnels work. We just wanted to get testling launched quickly is all; tunnels are coming soon.

comment 15y ago · link · parent

Right now, you do need a public IP for t.createWindow(). We have ssh tunnels in browserling already but they don't work with testling just yet. Stay tuned.

I think one of the biggest benefits of testling right now is that you don't have to install anything outside of curl to start using it.

comment 15y ago · link · parent

We pretty much have what you're describing already, except we use node.js-style require()s with browserify instead of AMD. You can write really simple unit tests and just execute them with a curl one-liner or you can write more integration-style tests for an existing app with t.createWindow() and t.submitForm().

comment 15y ago · link · parent

Yep you can use it both ways. To drive an existing page around you can use t.createWindow() and t.submitForm(), which give you a new window object and a jquery handle bound to that window object. http://testling.com/docs/#an-example-test

comment 15y ago · link · parent

I suspect that people who don't "get" pointers (#4 in the article) actually have a much harder time with the pointer declaration and manipulation syntax in C than actually understanding how pointers work and what they let you do.

For instance, in C the * character is used both to declare a pointer and to dereference one and they can be stacked to dereference nested structures. Then & references a variable memory location but is also used in method signatures to change the semantics of calling a function into pass-by-reference. To complicate & further, & is often seen alongside const declarations, which are a whole other thing that people have to keep in their heads.

On top of all of this, * and & have their own operator precedences and associativities that you have to memorize, which is a whole discussion about binary versus unary operators and precedence tables. And I didn't even mention [].

I really don't think that people fail to comprehend pointers because their mental models need updating nearly as often as they just haven't fully internalized all the hoops that C makes you jump through to mess with pointers.

comment 15y ago · link · parent

You have to roll this yourself right now with a connection pool of stream objects. I'll probably build this out as a separate module.

comment 15y ago · link · parent

It's handy if you want to map ports or host:port combos to subdomains so they all can share the same port on the same server.

comment 15y ago · link · parent

I guess what I was saying there isn't the whole story, since bouncy uses node's http parser directly to handle splitting up keep-alive requests. What I meant was more that bouncy sends data over a tcp stream instead of simply passing the request object through to an http client request.

comment 15y ago · link · parent

This software fills the same niche that something like HAProxy or apache virtual hosts fills right now. Bouncy is great for when you have services on your internal network or on different ports and you want to map them to subdomains.

117.

Bounce your http requests around with bouncy(substack.net ↗)

44 points · by substack · 15y ago · 18 comments

comment 15y ago · link · parent

As I just mentioned elsewhere this thread already, browserling is rolling out exactly this service really soon! Here's a sneak peak: http://browserling.com:9088/

comment 15y ago · link · parent

We at browserling will be releasing something perfect for that in a week or so! Sneak peak: http://browserling.com:9088/

comment 15y ago · link · parent

Haskell is great for pure algorithms like that.

As for jumping in too quickly? I was a pretty heavy haskell user for about 3 years.

12345
8