14 ms·
The Future of Programming in Node.js
- jenius 13y ago> Synchronous child process execution is being added, at long last. Thank the jesus. This will be nice to have, especially for some command line and filesystem operations.
- swang 13y agoYes, best part since the node module we are currently using does not work in v0.10 and the author is very adamant about not supporting it anymore.
- leetrout 13y ago> We are done making breaking changes at the Node.js layer. If your > program runs today, we're doing everything we can to make sure that it > will run next year, albeit faster and more reliably. I've yet to devote any significant amount of time to developing on Node but this is a big +1 for more serious consideration. My memory is fuzzy (this was well over a year ago) but I remember building an app in express and it being completely broken by updates a very short time later (along with a good number of other modules that hadn't been updated either). Anyone venture out a guess/opinion on how many things in userland will stabilize because of this? (Or perhaps things already have- I don't hear as many complaints about express' api changing lately).
- treeform 13y agoI remember that time too. Most of the modules I use are pretty stable now, which is nice.
- driverdan 13y agoUserland has become a lot more stable over the past year or two as projects have matured. A lot of popular projects (like express) went through rewrites with breaking changes.
- SimHacker 13y agoDidn't UserLand make Frontier? (It's a Dave Winer joke -- ha ha!)
- mattyod 13y agoWorking on a large scale & fluid Node project at the moment and we probably see at least a dozen dependency updates a week. Never caused a problem. The community as a whole is pretty strict in it's respect for versioning conventions.
- ilaksh 13y agoWell, I had an issue with Express going up a major version also to 3.0 but it was actually my fault because I didn't specify the major version in my package.json, i.e. 2.x. If I had done that the breaking changes would not have got me.
- jchrisa 13y agoNode's module system is hands down the best module system I've worked with. I wish other new languages would stop trying to innovate and instead just copy what they've done.
- nahname 13y agoReally? I think it is terrible when compared to other languages (C#, Java, Ruby, Python, etc...). I have only done a few applications on node, but my experience with including modules was painful to say the least.
- RKoutnik 13y agoCould you elaborate on that? What did you find difficult about `npm install $PACKAGE` and `var thing = require('thing')'`?
- regis 13y agoI personally found that some packages wouldn't install because they had dependencies that were broken in some way. This was about a year ago though, so I don't know how things have changed since then. Also, node packages seems to be small and specific so npm downloads many dependencies for each package. Again, I only played around with node for a little but I got a bit frustrated with all the packages and dependencies.
- nonchalance 13y agoI think the issue you are describing really stems from poor semantic versioning. People will peg to specific revisions that they happen to use rather than depending on the general major or minor revision level, so small fixes don't naturally propagate to second- or third-level dependencies. There's no good solution to the problem that doesn't lead to other sorts of hell (imagine asking users to manage the revisions for third-level dependencies)
- schuylerlarson 13y ago
- zekenie 13y agoThis is the kind of open-source leadership that made me move from PHP to Node. Node knows what it is.
- SimHacker 13y agoAt least we can trust the node developers not to check in untested code that breaks crypt.
- lelf 13y agoI hope that the future of Programming is not in Node.js
- AndyKelley 13y agoYou could make this comment useful and worth reading by explaining why.
- CmonDev 13y agoI think that's obvious: forces you to stick with one specific legacy dynamic weak-typed language.
- camus 13y ago> This is not a democracy. I agree 100%. But still, a lot of people are complaining about some of the Node.js API choices. They are complaining because it makes programming more difficult , and the truth is , async programming is hard when it relies on callbacks.
- hvs 13y agoWasn't that the original selling point of Node? That it used callbacks for async and that it was easier that way?
- wmf 13y agoNo, the original selling point was that Node forces all code to be async and Erlang is too weird.
- drderidder 13y agoNot the original point perhaps, but its come around to that. A couple years ago they settled on callbacks after a fairly active debate, as the least ambiguous option for continuation passing. As more people explore Node, callbacks are one level of abstraction too deep or just too tedious for some people. Fortunately there's a great selection of asynch modules to help them.
- AndyKelley 13y agoI really enjoy the callback paradigm. I love how powerful the abstraction of async code is. In procedural paradigm, there are some things that you want to accomplish that you simply cannot create an abstraction for, because the operation you want to do is time based. With the power of callbacks, you can abstract away complex things with a single function.
- jchrisa 13y agoI thought the original point was that it is JavaScript that can do stuff.
- kailuowang 13y ago> Callbacks will remain the de facto way to implement > asynchrony. Generators and Promises are interesting and > will remain a userland option. " I am seeking for a comparable alternative to node (or something on top of node) in which Promises are the de facto way to implement async. Any suggestions?
- halayli 13y agoCheckout C++11. It has lambda callbacks, promises/futures and async with threading.
- usea 13y agoI don't think C++11 is a comparable alternative to node, personally. Although I understand that's a subjective judgment on my part.
- CyruzDraxs 13y agoHave a look at node.native. It's just libuv and c++11, which behaves pretty much the same as node. But much lighter, and with no Javascript engine tacked on. Obviously not nearly as stable and supported, but it's an example of how c++11 can work very similarly.
- rmgraham 13y agoOr luvit (libuv + Lua)
- uniclaude 13y agoIs the fact that they use callbacks instead of Promises outside of userland a real problem for you (as an application developer)? You can totally write your node applications using only Promises using something like Q if you feel like it.
- bryanlarsen 13y agoIt probably would be fairly straightforward to write a generator that wrapped every function in a module with Q.nfcall.
- dpweb 13y agoSound good on all those. Completely dropped PHP for Node, no regrets.. Good because those breaking changes in Express v2-3 were annoying..
- CyruzDraxs 13y agoThat's what semantic versioning is for. Node modules should continue to move forward, and reinvent themselves to improve how we write our apps. Otherwise it'll just turn into another PHP.
- gkoberger 13y agoOnly tangentially related, but the "rant" by Ryan Dahl (node creator) when he left Node day-to-day is worth a read: https://gist.github.com/cookrn/4015437 https://gist.github.com/cookrn/4015437
- palvaro 13y agosorry, why did you say that was worth a read? it doesn't appear to have any content.
- lhnz 13y agoYou could possibly draw a connection between Ryan Dahl pleading for simplicity in that gist, and Isaac Schuetler claiming that they would not be adding extra complexity to Node.JS. By the way, your post comes off as unnecessarily rude.
- lmm 13y agoYour post comes off as unnecessarily passive-aggressive. If we're pointing these things out.
- arxpoetica 13y agoThere's a Confucius saying in here somewhere.
- SimHacker 13y agoI beg to differ. It was just necessarily passive-aggressive enough. On the dot.
- deleted 13y ago[deleted]
- javis 13y agoI thought it was good.
- avolcano 13y ago> There will be no changes to the module system. None. It's finished. It's been finished for over a year. Any proposed changes must come with a clear reproducible bug that cannot be worked around or addressed with documentation. This seems short-sighted, with ES6 modules now being used in production (through transpilers) and slowly making its way into SpiderMonkey and, more importantly, V8.
- jlongster 13y agoIt is a shame, but I just don't know how node would migrate to ES6 modules. I'm sure someone smarter than me could think up of a plan, but it seems like a huge amount of work. One of the strongest points about node is the amount of small reusable libraries available. They aren't about to ditch that.
- avolcano 13y agoSome thought has definitely been put into this problem: https://gist.github.com/domenic/4748675 https://gist.github.com/domenic/4748675 https://gist.github.com/wycats/51c96e3adcdb3a68cbc3#importing-a-node-module-by-processing-requires https://gist.github.com/wycats/51c96e3adcdb3a68cbc3#importin... (both of those are slightly out of date, syntax-wise, but are still conceptually current, IIRC)
- arxpoetica 13y agoGlad to hear it.
- callmeed 13y agoCan someone please explain Node.js's relationship with Joyent? I like what I've seen/done with Node but I've had less-than-stellar experiences with Joyent in the past. I'm hesitant to devote additional time to it if they are very tightly coupled. Is it similar to Go or Angular @ Google? One thing I love about Rails is that it exists quite separately from 37signals or any other company. I don't get that feeling with Node/Joyent, but maybe I'm wrong.
- CyruzDraxs 13y agoNode is not really tied to Joyent. Actually, a good amount of the core team is at StrongLoop. Joyent has basically got it as far as they needed it to get for their own uses. Now they are just sitting on it and keeping it stable while letting userland modules cover future expansion.
- IsaacSchlueter 13y agoJoyent owns the trademark and copyright on the IP related to Node.js. (Logo, "Node.js" mark, etc.) They also are involved with marketing, legal, etc. The active core committers over the last month, and their employers, in order of whether or not they're me: - Isaac Z. Schlueter (npm author/admin, lead gatekeeper, stream maintainer, javascripter), Joyent - Ben Noordhuis (issues list champion, most opinionated C++ developer, libuv unix guy), StrongLoop - TJ Fontaine (build owner, C shim author, tracing afficianado, Master of Robots), Joyent - Trevor Norris (performance perfectionist, master of dirty hacks), Mozilla - Fedor Indutny (russian ninja rockstar, TLS tamer), Voxer Also very important to the project are Bert Belder (Windows guy, libuv co-author) at StrongLoop, and Scott Blomquist (Windows bug-chaser, Microsoft liason) at Microsoft. Honorable Mention to Ryan Dahl (Node.js creator, BDFL) who is currently off being a professional hipster somewhere in NYC, and not involved with the project. When he did work on Node, he was paid by Joyent, and he got some money for selling the copyright to the company as well. The Node.js community experience would be much less pleasant if not for Nodejitsu's continued support of the public npm registry. (Nodejitsu acquired IrisCouch a few months ago.) Node would continue on even if Joyent bit the dust. (Depending on who assumed ownership of the mark, it may or may not have to change name/logo.) If you've had a bad experience in the past with Joyent, it probably has nothing to do with the experience you might have with Node.js. I am given free reign here to manage the project free of any overt Joyent influence. Joyent is a big Node user, and a lot of really smart people, so I do take it seriously if they have something to say. Especially considering that most of the time when Joyent engineers have a problem with Node, it's related to other users hosted on their platform (Walmart, Voxer, etc.)
- asaarinen 13y agoI applaud the Node developers for their effort. While recent "competitors" like Go are fascinating and in some ways even arguably better, the fact that every device on earth runs JavaScript makes me bet that Node will prevail. Computing will need to move fluently between the cloud and the terminal, and JavaScript is the only language which allows you to use a single codebase for both (in the foreseeable future). As developer time will stay the biggest expense when developing software, I am bullish on Node and JavaScript.
- tikhonj 13y agoThese days virtually every language can be compiled to JavaScript in a very usable manner. For example, I've had a lot of success with js_of_ocaml[1], not really running into any of the problems people like to harp about regarding compiled-to-JS languages. [1]: ocsigen.org/js_of_ocaml/ The argument for developer time--as well as decreased maintenance cost--is exactly why I went with OCaml over pure JavaScript. And so far it's certainly paid off!
- asaarinen 13y agoSure, but the language that _every_ developer will need to know is JavaScript, not OCaml or some other of the dozen alternatives that can be compiled to JS. Besides, the ability to compile to JS is not enough; you will need to read it in JS, debug it in JS and let other developers work on it in JS (because they don't know OCaml).
- ndesaulniers 13y agoDoes _every_ C or C++ developer know the ISA they're targeting? Also, source maps.
- rubyn00bie 13y agoI disagree with the idea that "[...] every device on earth runs JavaScript makes me bet that Node will prevail." Because Node does not strictly equal Javascript-- V8 is not Javascript, nor is spider monkey. Most node applications, without some modification, do not run in the browser. They are missing tons of libraries and cannot interact with the file system. I do appreciate the ability to have a single codebase, but over the past few years, I've pivoted and hope to someone's god that it is NOT javascript. Mostly because, in my experience, Javascript itself, even with a great focus from the beginning, is incredibly difficult to maintain. Even then, is having a codebase in one language the best idea? There are some things that are much better to write in Erlang than they are C, and vice versa. It depends on the problem you're trying to solve. The bigger the project, the less Javascript I want in it. I think ASM.js, or something similar, will be the death of writing Javascript. Then it won't matter what language it's written in, we can use source maps to debug and it'll be faster than we could've ever written by hand* *single one off functions don't count. Try writing a webapp in pure x-86 assembly.
- bfrog 13y agoSo callbacks are annoying enough that they have to mention its a non-fixable in the mailing list. Awesome.
- _random_ 13y ago"TypeScript and CoffeeScript will not be added to core." "As new language features are added to V8, they'll make their way into Node." Sigh... Let's leave this "future of programming" to the future then. I hope someone needs it.
- pcunite 13y agoI'm new to web programming but I got the impression that C++ for web work was silly ... use PHP, use Rails, use this, blah, blah, everyone said. Now it seems that Node.js is just C++ style programming in JavaScript, expect that you get "packages" that manage the HTTP headers (and other things of course) for you. It would be cool if someone makde a Node.C++. I would have less of a learning curve.
- ricardobeat 13y agoYou mean this https://github.com/d5/node.native https://github.com/d5/node.native? Godspeed.
- oscargrouch 13y agoi hit "casablanca" the other day from microsoft.. what impress me is that is open source and it also runs in linux. (not even in my wild dreams o would predict this to happen one day) anyway.. looking at the source its pretty decent, and go right to the point.. of course its focused in HTTP/REST.. theres a bultin IO scheduler and a concurrent task system.. from microsoft.. who would say so :)
- pcunite 13y agoWow ... thanks for the info!
- mark242 13y agoI still, still, still don't understand why Node hasn't done in-line server-side Javascript. Give it a snazzy name. Maybe.. "Livewire". http://www.datacraft.com/livewire.html http://www.datacraft.com/livewire.html
- jeffasinger 13y agoI think the reason for this is that the industry in general has moved more to a MVC approach than this. No one wants to mix their server side code with HTML anymore. In fact, more and more, people want to delay the rendering of HTML until it hits the browser. I don't think it would be very hard to to rewrite livewire as node module though, if you were really interested in it.
- ilaksh 13y agoOf course its not part of core but certainly there are a number of modules for that although that's not especially popular these days. https://github.com/visionmedia/ejs https://github.com/visionmedia/ejs
- ubershmekel 13y agoYou have PHP for that.
- DonGateley 13y agoMy, god. Could they have possibly created any more or any more inscrutable jargon? Must have had whole teams dedicated to doing just that. Keeps out the riff raff I suppose.