1,135 karma · joined Mar 22, 2009 (17y ago) · 212 submissions
comment 15y ago · link · parent
Haskell is very hard, but even after 3 years of pretty intensive use, I never really felt productive with haskell in the same way that I've felt in other languages. Anything I did in haskell required a lot of thinking up-front and tinkering in the REPL to make sure the types all agreed and it was rather time-consuming to assemble a selection of data types and functions that mapped adequately onto the problem I was trying to solve. More often than not, the result was something of an unsightly jumble that would take a long time to convert into nicer-looking code or to make an API less terrible to use.
I built an underwater ROV control system in haskell in 2010 which went well enough, but I had to tinker with the RTS scheduling constantly to keep the more processor-hungry threads from starving out the other ones for CPU. The system worked, but I had no idea what horrors GHC was performing on my behalf.
Later I built the first prototype of my startup with haskell, but the sheer volume of things that I didn't know kept getting in the way of getting stuff done in a reasonable time frame. Then we started to incrementally phase out haskell in favor of node.
I write a lot of node.js now and it's really nice. The whole runtime system easily fits into my head all at once and the execution model is simple and predictable. I can also spend more time writing and testing software and less time learning obscure theories so that the libraries and abstractions I use make sense.
The point in the article about haskell being "too clever for this benchmark" sums up haskell generally in my experience.
comment 15y ago · link · parent
It's super nice having the dependencies specified by semvers in a package.json and installed locally in a project node_modules directory so that libraries can't step on each others toes.
The "Don’t use Bundler version X with RVM version Y" can be specified directly in the package.json and concurrent versions of module dependencies even work without incident in the same project.
comment 15y ago · link · parent
https://developer.palm.com/content/resources/intro_to_hp_web...
comment 15y ago · link · parent
I really don't understand why whenever somebody switches to node from python people pounce on them like this, as if people aren't allowed to find a particular syntax annoying?
127.
Heatmaps for node.js and the browser(substack.net ↗)
56 points · by substack · 15y ago · 3 comments
comment 15y ago · link · parent
comment 15y ago · link · parent
131.
Javascript AST trickery with burrito(substack.net ↗)
64 points · by substack · 15y ago · 6 comments
comment 15y ago · link · parent
I did exactly this for browserify, yet another node-based browser-side require() bundling system. Another benefit of this approach is that you can use modules made for node just by require()ing them in your browser-side javascript, so long as your static analysis bundling is recursive and the modules can be `require.resolve()`'d by node.
133.
Node.js: batteries not included(github.com ↗)
2 points · by substack · 15y ago · discuss
comment 15y ago · link · parent
138.
Browserify: browser-side require() for your node.js(substack.net ↗)
40 points · by substack · 15y ago · 9 comments
139.
Salvador Dali, spatial frequency, and Lincoln(scottmcd.net ↗)
2 points · by substack · 15y ago · discuss
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
comment 15y ago · link · parent
https://github.com/substack/dnode-protocol
It's written for continuation-passing style but it shouldn't be too hard to retrofit it for other call styles if you want to preserve explicit returns for instance.
comment 15y ago · link · parent
This is pretty neat and I like the emphasis on getting stuff going in as few lines as possible but I'm not convinced that return values and implicit result callbacks are the way to go for asynchronous requests, which is how I understand this project to work. Often when you want to make a remote call you'll be doing some I/O on the server side, which in node is asynchronous so you can't return right away. Passing along a callback from the client side works much better when the I/O actions have some values to call the client back with.
comment 15y ago · link · parent
(Edit: noticed that the article does it this way.)
How about just:
function insertCollection(collection, cb) {
if (collection.length === 0) cb(null);
else db.insert(collection[0], function (err) {
if (err) cb(err)
else insertCollection(collection.slice(1), cb)
}
}
That's hardly much more complex, and as a bonus won't lock up your whole program while db.insert() is working. You could use something like my own library Seq() too: var Seq = require('seq');
function insertCollection (collection, cb) {
Seq.ap(collection).seqEach(function () {
db.insert(c, this);
}).seq(cb).catch(cb)
}
That is, if you actually want the inserts to go sequentially. Usually you want them to go in parallel with say a maximum of 10 pending requests: var Seq = require('seq');
function insertCollection (collection, cb) {
Seq.ap(collection).parEach(10, function () {
db.insert(c, this);
}).seq(cb).catch(cb)
}
I don't see any "fundamental issue" with node here. It's just a very new ecosystem and the idioms and libraries are rapidly evolving.