7 ms·
"...but nothing beyond that. As long as Node.js exists in this world, I can't truly hate anything else." I found this hilarious. I am also rather underwhelmed
by gaigepr 13y ago
"...but nothing beyond that. As long as Node.js exists in this world, I can't truly hate anything else."
I found this hilarious. I am also rather underwhelmed (to be nice) with Nodejs and a little bothered at its wide adoption.
I have also been learning racket recently; my formal language and functional programming class uses it. I had some previous experience with common lisp but the raw nature of scheme still pleasantly surprised me a little bit.
EDIT: From what I remember, javascript was "inspired" by scheme. Obviously that when well...
- deleted 13y ago[deleted]
- MichaelGG 13y agoI keep flipping back and forth, thinking I don't get it, then thinking others don't get it. Single-threaded JS with callbacks. OK? What am I missing? The only thing Node has going for it is a lot of networking libraries. It's not fast, the async style leads to callback hell, JS is a terrible language, and their package management system is slow and bloated (or at least the packages are)[1]. Yet people think it's some new kind of thing that's just so awesome, despite MS doing server-side JS in the mid-90s. Sure, people can use whatever makes them happy. I'm just confused as to why anyone is particularly impressed with Node or JS. 1: Seriously, to automate builds, I ended up saving the node_modules directory then symlinking it in to the build environment. Otherwise a simple CSS/JS/etc. grunt build took 15 minutes instead of 1. And it seems every module pulls in its own copy of dependencies, so you end up with 300-character deep paths. There's no apparent reason it needs to be like this.
- mattgreenrocks 13y agoIt's popular because people think other people think it's popular. There's no accounting for taste, but, it won't last. :)
- nly 13y agoMy theories: 1. Using the same programming language on both sides of HTTP often appeals to a developers visceral sense of elegance, or tidiness, even though it this alone inherently solves no existing problems. 2. It's powered by Googles V8 engine, which means people already associate it with this "super fast JIT" thing that lives in their favourite browser. It must be efficient, right? 3. The crowned alternative is PHP which is slowly becoming Java and alienating, with no disrespect to anyone intended, the less experienced, the "let's just hack a script together" crowd.
- tel 13y ago1. There is a concrete advantage of shared code.
- vinceguidry 13y agoHow does one share server HTTP-serving code and client DOM-manipulating code?
- ebiester 13y agoThere's a library called browserify that does it. It's not useful for direct DOM manipulation, but there are other libraries for which it is nice.
- tel 13y agoMost likely by abstracting both into business concerns which appear in the client (manipulation for implementing a UI) and the server (manipulation for persistence and client-to-client communication).
- a8000 13y agoYou only share the data model between the server and the client.
- mbrock 13y agoFacebook's React lets you write DOM rendering code that can easily run on both client and server. The framework discourages DOM manipulation, instead promoting a near-declarative style of stateless rendering. Updates to the client DOM are then done by efficient tree diffing. It's very nice.
- pera 13y agoV8 vs Racket: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?test=all&lang=v8&lang2=racket&data=u64 http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
- Crito 13y agoYeah, but I've basically never seen anybody suggest that Racket is a great language for prod.
- zhemao 13y agoNaughty Dog has used Racket as a scripting language in several of their video games for the PS3.
- ANTSANTS 13y agoSlightly misleading, they don't actually run Racket on the PS3. IIRC, they created a DSL for game logic in Racket and wrote a special compiler for that DSL. That's still a good example of a "real" program written in Racket, but it doesn't prove that Racket is a good choice for programs that need all the resources they can get.
- zhemao 13y agoAh, I didn't realize that. Very interesting.
- zhemao 13y agoAlso, Hacker News is written in Arc, which runs on the Racket runtime. It handles quite a bit of traffic every day. It's an ugly-ass buggy website, but that is largely to do with the implementation and PG's propensity for live-modifying production sites in the REPL and not the runtime itself.
- minikomi 13y agoNot sure what you're saying with this? That they're fairly equivalent except when you need heavy regex jiggling?
- ludwigvan 13y agoStraight from the horse's mouth: "Node is popular because it allows normal people to do high concurrency servers. It's not the fastest or leanest or even very well put together - but it makes good trade offs in terms of cognitive overhead, simplicity of implementation, and performance. I have a lot of problems with Node myself - but the single event loop per process is not one of them. I think that is a good programming model for app developers. I love Go so much (SO MUCH), but I cannot get past the fact that goroutines share memory or that it's statically typed. I love Erlang but I cannot get the past the syntax. I do not like the JVM because it takes too long to startup and has a bad history of XML files and IDE integration - which give me a bad vibe. Maybe you don't care about Erlang's syntax or static typing but this is probably because you're looking at it from the perspective of an engineer trying to find a good way to implement your website today. This is the source of our misunderstanding - I am not an app programmer arguing what the best platform to use for my website--I'm a systems person attempting to make programming better. Syntax and overall vibe are important to me. I want programming computers to be like coloring with crayons and playing with duplo blocks. If my job was keeping Twitter up, of course I'd using a robust technology like the JVM. Node's problem is that some of its users want to use it for everything? So what? I have no interest in educating people to be well-rounded pragmatic server engineers, that's Tim O'Reilly's job (or maybe it's your job?). I just want to make computers suck less. Node has a large number of newbie programmers. I'm proud of that; I want to make things that lots of people use. The future of server programming does not have parallel access to shared memory. I am not concerned about serialization overhead for message passing between threads because I do not think it's the bottleneck for real programs." https://news.ycombinator.com/item?id=4310723 https://news.ycombinator.com/item?id=4310723
- rdtsc 13y ago> The future of server programming does not have parallel access to shared memory. Yeah but it could be IO parallelism. There could be two instances of callback chains of sequence C1->C2->C3 started such that the the second starts before the first one finished. As in C1->C2 ran then C1 gets called again. If in those callbacks you update a data structure (a database record?), you now accessed that data in parallel. So you have to protect against that with some kind of a lock/mutex. Yeah context switching doesn't potentially happen at every assembly instruction, the granularity is much higher, but it is still there.
- rdtsc 13y ago> I'm just confused as to why anyone is particularly impressed with Node or JS. Low barrier to entry means anyone who used to animate jumping monkeys on webpages and now write distributed back-end systems (all web-scale of course). Kids haven't seen anything else. Maybe took C++ or Java in college, then they see a kid with piercings and a messenger bag and tight pants talk about this awesome asynchronous callback-futures-based awesome frameworks. There is really nothing to compare it to. So they are impressed. Next level up, write a benchmark. Compute fibonacci, compare with Java, hey not too bad. Even faster than Ruby! Clearly this is the framework of the future. Maybe read some place about how threads are bad and callbacks are great. And so on. > so you end up with 300-character deep paths. Hehe, too funny. Actually it just needs to be 260 characters, so 'git checkout blows' up on your unfortunate colleague who happens to use Windows.
- rubiquity 13y ago=> Low barrier to entry means anyone who used to animate jumping monkeys on webpages and now write distributed back-end systems (all web-scale of course). There is nothing distributed about Node. It has IO concurrency, that is all.
- kazagistar 13y agoJavascript is fast enough to be usable on a server, Javascript has grown client-side, and you can share code across both. That adds up to something at least reasonably useful and unique.
- lucian1900 13y agoThe one good thing about the packaging system is that each dependency is its own version, so you can easily load different versions of the same package.
- MichaelGG 13y agoI'd have to check again, but I looked for specific versions of a JS file and found it repeated multiple times throughout the forest of node_modules. If side-by-side is desired, then just suffix the folder with a version name. foo.js-1.1 and foo.js-1.0 can be in the root and reused by every package that needs either. Maybe it does that and I didn't understand what I was looking at.
- lucian1900 13y agoIt's quite naive about it, so it will copy them over and over again. Supposedly there are tools that make everything in node_modules symlinks to the same files. It's not exactly an advanced and polished system, but it still has a feature that is hard to get with others.
- anotherevan 13y agoI wasn't going to bother reading the source article, up until I saw this excerpt in your comment. Now it is added to my reader. :-)
- linhmtran168 13y agoI also hate NodeJS for its package manager, NPM. I don't understand the way it manages dependencies and their folder. What the hell is 'node_modules/express/node_modules/connect/node_modules/multiparty/node_modules/readable-stream/node_modules/debuglog/'. As a result, when updating dependencies with npm, a same dependency is downloaded multiple times.
- ludwigvan 13y agoThat is a good thing when multiple libraries you depend on depend on different versions of some other library. See http://blog.izs.me/post/1675072029/10-cool-things-you-probably-didnt-realize-npm-could-do http://blog.izs.me/post/1675072029/10-cool-things-you-probab...
- ripter 13y agoIt solves the nasty versioning issues that plague the other package managers like pip and rubygems. Every package gets the correct versions for all of its dependancies at the cost of taking more hard drive space. Hard drive space is ridiculously cheap so it's a good trade off.
- deleted 13y ago[deleted]