Slashdot Mirror


Node.js's npm Is Now The Largest Package Registry in the World (linux.com)

Linux.com highlights some interesting statistics about npm, the package manager for Node.js.
  • "At over 350,000 packages, the npm registry contains more than double the next most populated package registry (which is the Apache Maven repository). In fact, it is currently the largest package registry in the world."
  • In the preceding four weeks, users installed 18 billion packages.
  • This translates into 6 billion downloads, "because approximately 66 percent of the installs are now being served from the cache."
  • ping.npmjs.com "shows that the registry's services offer a 99.999 uptime."
  • Every week roughly 160 people publish their first package in the registry

But what about the incident last year where a developer suddenly pulled all their modules and broke thousands of dependent projects? npm's Ashley Williams "admitted that the left-pad debacle happened because of naive policies at npm. Since, the npm team have devised new policies, the main one being that you are only allowed to unpublish a package within 24 hours of publishing it." And their new dissociate and deprecate policy allows developers to mark packages as "unmaintained" without erasing them from the registry.


133 comments

  1. Packages still aren't signed by Anonymous Coward · · Score: 5, Interesting

    Packages on npm still aren't signed - something that Java repository servers have had since inception.

    Might as well just open up your firewalls and let the hackers inject whatever code they want.

    Broken by design!

    Captcha: "amateurs"

    1. Re:Packages still aren't signed by cryptizard · · Score: 1

      Doesn't the repo use TLS? What type of attack scenario are you referring to?

    2. Re:Packages still aren't signed by Desler · · Score: 1

      What does TLS have to do with code signing?

    3. Re:Packages still aren't signed by Anonymous Coward · · Score: 0

      The scenario is having a package tampered with by a malicious party. TLS is not gonna protect against that.

    4. Re:Packages still aren't signed by Desler · · Score: 2

      And if you want a real-world example as a scenario it would be here: https://forums.unrealircd.org/...

    5. Re: Packages still aren't signed by Anonymous Coward · · Score: 5, Funny

      They're both things that JavaScript programmers don't/can't comprehend.

    6. Re: Packages still aren't signed by MachineShedFred · · Score: 2

      So you can securely download a pre-compromised package. Wonderful.

      He's talking about cryptographic integrity checking of the package, not some kind of packet injection during the download. For example, the use of GPG signatures for apt repositories.

      --
      Slashdot still doesnâ(TM)t support Unicode after it was added to the HTML standard in 1997.
    7. Re:Packages still aren't signed by Anonymous Coward · · Score: 0

      Someone hijacking the left-pad repo to insert their malware into every nodejs server in existance.

    8. Re: Packages still aren't signed by cryptizard · · Score: 1

      I don't see how signing prevents that. NPM is not a bunch of third-party mirrors, it is one central repository. If someone hacks NPM then they would also presumably have access to the key they use to sign packages so it wouldn't matter. You either trust NPM, in which case TLS is enough, or you don't in which case why are you using their repo?

    9. Re:Packages still aren't signed by Anonymous Coward · · Score: 0

      Take it down a notch. Signing would be good, but you're slinging those insults at the single most successful package repo in the history of our species.

    10. Re: Packages still aren't signed by Anonymous Coward · · Score: 0

      No you let the developer sign the package, not the distributor. The distributor never has the dev key and so the distributor can't forge packages. They can sign their own, but that would be offline with respect to the distribution site.

      It's the same reason TLS Certificate Authorities don't use their web servers to sign the CSRs they get.

    11. Re: Packages still aren't signed by Anonymous Coward · · Score: 0

      I don't see how signing prevents that. NPM is not a bunch of third-party mirrors, it is one central repository. If someone hacks NPM then they would also presumably have access to the key they use to sign packages so it wouldn't matter. You either trust NPM, in which case TLS is enough, or you don't in which case why are you using their repo?

      npm delivers software which is created by other people. They could arrange it so that those other people had a way of signing the package that is downloaded from their servers. This can be done in several ways - having the other people create a package with an inbuilt signature (like an RPM or a DPKG) - having the authors create offline signatures of the package and upload them to the same directory - having a hardware signing system and giving the authors the right to sign their own package then recording who signed which package. Each of these, done right, would provide significant protection against later compromise of the npm servers.

  2. How many *useful* packages? by Anonymous Coward · · Score: 5, Insightful

    When you get such trivialities as left pad in the registry, why should anyone care that the raw number of packages is large?

    Quick everybody: how do you write "hello world" in javascript?

    npm install hello-world

    1. Re:How many *useful* packages? by Anonymous Coward · · Score: 3, Insightful

      That hello-world package will bring at least a dozen packages, such as Encyclopedia Britannica which is used to get the two words and some QT and XML libraries which are needed to dump the output string into stdout.

    2. Re:How many *useful* packages? by Anonymous Coward · · Score: 1

      I also love the fact when you install Hello World it installs the other 349,999 packages to make it work.

    3. Re:How many *useful* packages? by 0100010001010011 · · Score: 1

      Don't forget that it's somehow recursive. The Encyclopedia Britannica will call an old version of hello-world. Which will then call an older version of EB.

      Then you come back to your npm install and wonder why the directory is 50 GB.

    4. Re: How many *useful* packages? by Anonymous Coward · · Score: 0

      Npm stores packages locally. Maven stores packages globally (well to global to the user).

      So when I delete .m2//repository then run mvn clean install on a sufficiently large project, maven seems to download almost the same amount as npm

    5. Re:How many *useful* packages? by Anonymous Coward · · Score: 0

      A lot of people are complaining about this, but to me it's actually proven to be an incredibly useful "feature" of node and npm. It's like having a global library of functions and libraries available for any purpose you could ever need. I've been able to find almost anything I've ever needed, no matter how obscure. Sometimes it's been abandoned and/or is missing a function I need, but I can easily just fork it, modify, and republish, and then it's available for all my future projects. If I need eight separate dependencies for one thing I need, I just build a package that wraps those all together to simplify things.

      Is it the most efficient? Obviously not. But these day developer time is far more valuable than computer time, and most of this code is not stuff that is going to be run millions of time anyway.

    6. Re:How many *useful* packages? by Anonymous Coward · · Score: 0

      50GB? Yeah right. Next try. You need to run du *after* npm install finishes.

    7. Re: How many *useful* packages? by Anonymous Coward · · Score: 0

      It's like having a global library of functions and libraries available for any purpose you could ever need.

      Other programming languages have that. It's called a ''standardlibrary''.

      JaveScript needs NPM because it has a poopoo standard library that's missing a lot of useful stuff.

    8. Re:How many *useful* packages? by TheRaven64 · · Score: 1

      I agree that it's nice to have a large standard library that's decomposed in such a way that you can only pick the bits that you need, but a good standard library follows a common set of conventions and is designed in such a way that no individual parts conflict with others. NPM is not this: individual developers provide functionality using their own set of conventions and packages often conflict (made worse by JavaScript's lack of easy tools for encapsulation). As such, you may pick half a dozen useful functions, find them all in separate NPM packages, each with their own idea of what a sane parameter order or callback design is, and find that they all add a method on String with the same name and different semantics.

      --
      I am TheRaven on Soylent News
  3. left-pad by Anonymous Coward · · Score: 3, Insightful

    I think the debacle really just opened up a lot of eyes as to when it's appropriate to start npm installing a bunch of crap instead of writing your own code.

    There's a fetish for modules in the JavaScript world that defies reason.

    "What? Use the built-in keyword "function" for defining functions? Heavens no you fool, we install Sindre Sore-Ass's woopee-unicorn-function-creator package!

    It's cancer all the way down on NPM.

    1. Re: left-pad by Anonymous Coward · · Score: 0

      Declaring and assigning variables in 2017? Shittttttt I use the _,.^VaRiAbLe CreAtOr 2.o^.,_ written by Magus.

    2. Re:left-pad by allo · · Score: 1

      don't you dare to use "function foo()". You need to use "var foo=function()"!!!

    3. Re:left-pad by Anonymous Coward · · Score: 0

      Nope. All the cool kids would write it as "const foo = ( ) =>;

    4. Re:left-pad by leptons · · Score: 1

      Nope. All the cool kids would write it as "const foo = ( ) =>;

      Ugh, this is the worst part of "the new javascript", ES6. People don't even know what 'const' is for and they misuse it everywhere.

      That said, I love Javascript and have been working with it for 20 years, so I can say with confidence that the haters here are mostly ridiculous and lack understanding of javascript and why it works the way it does.

    5. Re:left-pad by allo · · Score: 1

      Javascript is usable and okay for client side scripting, but the "why it works the way it does" isn't reasonable in many many cases. You get used to it, you can work with it and it's not too hard to remember the WTFs, but they are there. Seems the WtfJS page is down, but there are many interesting things in js, like weird truth tables and so on. Somebody even proved, that you can convert any script in a series of special characters like [](); without any letter a-z to avoid detection when trying xss.

  4. Quality over Quantity by Anonymous Coward · · Score: 0

    I'll stick with Microsoft's Nuget Package Manager for all my development needs, thanks.

    1. Re:Quality over Quantity by Curunir_wolf · · Score: 1

      I'll stick with Microsoft's Nuget Package Manager for all my development needs, thanks.

      Yea, as much as I hated that whole idea when it was first introduced, I've become a convert myself.

      --
      "Somebody has to do something. It's just incredibly pathetic it has to be us."
      --- Jerry Garcia
  5. javascript is a client language by Anonymous Coward · · Score: 1, Insightful

    There's no choice on the client, but why do people put up with all of Javascript's many rough edges and missing features when there is a universe of more appropriate server-side languages?

    1. Re:javascript is a client language by Anonymous Coward · · Score: 0

      Because anyone and everyone can and has tried their hand at Javascript which ofcourse automatically makes them programmers and bestows upon them the wisdom of the great sages.

      TLDR; Cause Brogrammers.

    2. Re:javascript is a client language by klingens · · Score: 1

      Cause with Javascript, the user computes all the stuff and pays the electricity. Serverside drives up costs. Amazon wants payment for every single cycle they compute on your behalf.

    3. Re:javascript is a client language by Anonymous Coward · · Score: 0

      JavaScript is a socialist programming language! I don't wanna pay for your stinking commie CPU cycles!

      Make the Internet Great Again!

    4. Re:javascript is a client language by BarbaraHudson · · Score: 1

      Or you can just have the user download a compiled program and the client pays for the electricity for running it without the penalties involved with javascript. You know, like we used to do before everything had to be done on the server so as to serve you better (for any definition of "better" that includes ads and spying on everything you do).

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    5. Re:javascript is a client language by Anonymous Coward · · Score: 0

      This doesn't answer the question.

    6. Re: javascript is a client language by Anonymous Coward · · Score: 1

      Performance

      No other language has ever benefited from the chaotic race by browser vendors dropping hundreds of millions of dollars into optimization. Because of advanced tracing JITs and things like opportunistic compiling etc, JavaScript is by far the fastest language next to C and Assembler and often can crush C on things like memory access which can benefit greatly from being optimized for the local processor.

      With more and more compilers being written with JavaScript as the backend target, the excitement isn't about JavaScript as a development language but instead about JavaScript as an intermediate language.

      Look into stuff like Typescript which can give you a pretty good language with pretty good libraries and dump JavaScript and NPM. You can get the best of both worlds.

      Now if Microsoft would just dump their JavaScript compiler team and put them on .NET optimization, it will be insane.

    7. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Users don't like downloading programs just to view a webpage. Are you a moron?

    8. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Users don't like downloading programs just to view a webpage. Are you a moron?

      You don't own an Android phone or an iPhone do you?

    9. Re: javascript is a client language by nitehawk214 · · Score: 1

      And I don't want to download a potentially horribly insecure app to view content that is better and more securely viewed in a browser.

      And considering how insecure browsers can be, this is saying something profound

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
    10. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Only reason those crappy "apps" exist is that they provide easy way to monetize the user's data while their only legit functionality is to open a URL in the webview. Ever wondered why some news site "app" requires access to your emails, pictures, messages, contacts and browsing history?

    11. Re: javascript is a client language by BarbaraHudson · · Score: 1

      How many web sites also monitor your key strokes, mouse movements, and everywhere else you go? An ordinary application that doesn't require connection to the internet isn't going to spy on you and monetize you as aggressively - or if it does, it will be called malware or spyware, not Facebook.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    12. Re: javascript is a client language by epyT-R · · Score: 1

      Secure? Browser? hahaha, surely thou jest..

    13. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Performance

      Node's amazing performance is why so many of the top internet websites use it. Sites like... um...

    14. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Too much for a Poe, but nice attempt.

    15. Re: javascript is a client language by Anonymous Coward · · Score: 0

      Now if Microsoft would just dump their JavaScript compiler team and put them on .NET optimization, it will be insane.

      No need. With much of .NET now open-source, they have a community of people making improvements. For an example, look up pretty much anything Ben Adams has contributed.

    16. Re: javascript is a client language by Anonymous Coward · · Score: 0

      >> JavaScript is by far the fastest language next to C and Assembler and often can crush C on things like memory access which can benefit greatly from being optimized for the local processor.

      Pure and utter BS. There's plenty of languages faster than JS. JS is fast for a dynamic language, perhaps second only to LuaJIT. But statically compiled languages like Go, Rust, Crystal are a lot faster. JS is not in C's class of performance. It's not in Fortran's class of performance, or even Julia's. It's to be compared with Lua and Dart.

      You know why web assembly is being worked on? Because that makes for a more performant target than JS. The future of of other programming languages on the web is web assembly.

    17. Re: javascript is a client language by leptons · · Score: 1

      Performance

      Node's amazing performance is why so many of the top internet websites use it. Sites like... um...

      Walmart, E-bay, Paypal, Linkedin, Yahoo, Google, Netflix... yeah nobody big is using it /s

    18. Re: javascript is a client language by nitehawk214 · · Score: 1

      Oh I have never wondered why, I know exactly why. And it isn't their stated reason of "so you can share articles with your contacts". That lame reason is so transparent it isn't even funny.

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
  6. npm's Ashley Williams .. by thygate · · Score: 2

    Ash ? Guess jacksonville got boring after a while eh ..

  7. No other option when using JavaScript. by Anonymous Coward · · Score: 2, Insightful

    A huge problem with JavaScript, compared to other languages, is that its standard library is totally lacking, even after 20 years of existence.

    A lot of common library functionality that Java, C#, Perl, Ruby, Python, Tcl, Go and even C++ include by default just aren't present when using JavaScript. Or worse, if JavaScript does include some functionality it's often really shitty, sometimes to the point of being unusable.

    So if you're using JavaScript you pretty much have no choice but to start using external packages almost right away. That's why npm has become so widely used: it's because JavaScript itself is so goddamn lacking in the most basic of ways.

    Npm is basically a bandage that you have to apply to JavaScript to make it even barely usable. And you have to apply it for pretty much each and every project written in JavaScript.

    1. Re:No other option when using JavaScript. by Anonymous Coward · · Score: 1

      What nonsense. People programming in any language often use a ton of libraries that are not "standard". From XML parsers to game engines and GUI systems.

      Arguably, looking at the crap that is standardized in C/C++, Java, perhaps it's better JS does not have so much baked in.

    2. Re:No other option when using JavaScript. by Anonymous Coward · · Score: 1

      People programming in any language often use a ton of libraries that are not "standard".

      Obviously. Did you even read the GP comment? It doesn't claim that third party libraries don't exist for non-JS languages, or that they aren't used. Of course they exist and of course they're used. But they're typically not mandatory even for the smallest applications, unlike when using JS.

      From XML parsers to game engines and GUI systems.

      This is a good example of what the GP is talking about, and what you clearly did not understand. Languages like Java, C# and Python do include things like XML parsers and UI toolkits in their standard libraries. Users aren't immediately forced to look for some non-standard library in npm right away. They can use what the language provides them, and often it is more than enough. If it isn't, then they're still free to use some other library. But a lot of the time they just use what the language gives them.

      looking at the crap that is standardized in C

      C is perhaps the worst example you could provide. C has a remarkably small standard library. It's perhaps even smaller than JS's. In fact, C's small and lacking standard library is often one of the biggest gripes people have about it. They end up having to use glib or some other third party library, or write a lot of code on their own, to get basic functionality that other languages include.

      The point the GP was making, and that you clearly could not comprehend, is that other languages don't force you to look to third party libraries right away, because their standard libraries include the most common functionality. This is different from JS, where for even tiny apps you pretty much need to install a bunch of modules, which depend on other modules, which depend on other modules.

    3. Re: No other option when using JavaScript. by nitehawk214 · · Score: 1

      Most frameworks like Extjs and jQuery reimplement most of the js built-in functions. (Calling js a library would be too generous.) Either because runtimes implement them inconsistently (node, phantom and browsers) or because the functions themselves are shitty.

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
    4. Re:No other option when using JavaScript. by allo · · Score: 1

      There are a lot of "standard libraries". Decide for one. And then use it. From a single team. Reading their homepage, maybe watching the development, occasionally checking the implementations of things. But ONE BIG LIBRARY, not millions of tiny packages from a lot of different programmers you never heard of.

    5. Re:No other option when using JavaScript. by Disco+Hips · · Score: 1

      A huge problem with JavaScript, compared to other languages, is that its standard library is totally lacking, even after 20 years of existence.

      A lot of common library functionality that Java, C#, Perl, Ruby, Python, Tcl, Go and even C++ include by default just aren't present when using JavaScript. Or worse, if JavaScript does include some functionality it's often really shitty, sometimes to the point of being unusable.

      could you cite some examples? It would be interesting to know more on this.

      So if you're using JavaScript you pretty much have no choice but to start using external packages almost right away. That's why npm has become so widely used: it's because JavaScript itself is so goddamn lacking in the most basic of ways.

      I think it depends on the developer, to be fair. You could install Ruby gems like crazy if you were that way inclined. Also, you have to bear in mind that JavaScript developers don't have total control over their runtime (on the client), so you get a lot of polyfill type packages to, as you say, start right away.

      Npm is basically a bandage that you have to apply to JavaScript to make it even barely usable. And you have to apply it for pretty much each and every project written in JavaScript.

      OK, but, NPM is just a package manager. In other languages, you get the package manager as part of the language itself and then not think much more about it. You'd *have* to apply it for each JavaScript project, because you don't get anything by default.

    6. Re:No other option when using JavaScript. by Curunir_wolf · · Score: 2

      You mean like Angular 2?

      --
      "Somebody has to do something. It's just incredibly pathetic it has to be us."
      --- Jerry Garcia
    7. Re:No other option when using JavaScript. by allo · · Score: 1

      i don't really know angular, but mayit it is such a library? I heard its one of the trendy things nowadays. I am using more traditional frameworks as jquery and vanilla javascript & brain 1.0.

    8. Re:No other option when using JavaScript. by Anonymous Coward · · Score: 1

      GP meant for you to see this in the link:

      after an hour and a half of wrangling with Angular 2 and its plethora of dependencies

      To show that many of the newer "frameworks" for javascript are built using npm and a variety of coddled-together third party libraries.

      It's like we're all building sandcastles on the beach and showing them off to each other.

    9. Re:No other option when using JavaScript. by allo · · Score: 1

      Ah, okay.
      I mostly avoid server side js and write client side js with as little libraries as possible. And as little script as possible. Let's be honest, devs love javascript, but users hate it. They do not know, they hate it. They just hate bloated websites, not knowing the actual problem.

  8. Left justify by ubeatha · · Score: 1

    Yeah...

  9. Ignorance, mainly. by Anonymous Coward · · Score: 0

    I've worked with a lot of programmers (or pseudo-programmers) over the years, and the ones who like JavaScript tend to be the most ignorant of them all. I'm using the term "ignorant" in the sense of "they don't know that alternatives exist" or "they don't know how bad they have it".

    Not knowing that other languages exist, or having never used them if they are aware, these people pushing JavaScript really have no idea how bad they have it.

    I mean, if you've never used a real standard library like other major languages provide, you wouldn't know how awful JavaScript's is.

    If you've never used a language with a proper type system, you wouldn't know how awful JavaScript's is.

    If you've never used a language with good support for OO (sorry, prototypes are a shitty hack, which is why more recent versions of JavaScript have actually started hacking in the idea of classes), you wouldn't know how awful JavaScript's is.

    This is why good programmers, who have typically used a real programming language, can't stand JavaScript. They see how bad it so often is, and they want nothing to do with it.

    But those who have a limited awareness are blind to the flaws. They'll gladly use inferior technology because they just don't know any better. They don't know that they should expect better.

    1. Re:Ignorance, mainly. by AuMatar · · Score: 1

      It has to do with barriers to entry. In the old days, the most ignorant were the BASIC programmers. Because the compiler was cheap/free, it was the easiest one to start on. So you had more half trained people using that than anywhere else.

      In the web days, Javascript became even easier than BASIC- no tools needed but notepad and the browser. No need to compile your app, just hit refresh. And immediately you had a complicated GUI output, not just a console app. So that's where everyone started learning. So the percentage of JS programmers who are bad is several times that for other languages.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    2. Re:Ignorance, mainly. by lucm · · Score: 4, Interesting

      I've worked with a lot of programmers (or pseudo-programmers) over the years, and the ones who like JavaScript tend to be the most ignorant of them all.

      I have worked (not just for hobbies) with C, C++, Pascal, Java, C#, the whole Visual Basic family, Perl, Python, PHP and JavaScript. I even worked with RPG and COBOL. Plus a whole bunch of shell scripting languages, from csh to PowerShell and even (OMG) JCL. On all the possible platforms you can think of, from smartphones all the way to Z series.

      And guess what? I like JavaScript. I like how it started as a clunky way to make dynamic HTML menus to how it's now powering insanely high-volume websites. Is it the prettiest language? No. Does it handle dates properly? Jesus fucking christ no. Is it a marvel of software engineering? Is it a pure delight for the intellect like lisp, or an unbreakable workhorse like Ada? No. But IT WORKS. It does the job, quickly. In browsers, and even on mainframes (yes, Nodejs is supported on IBM mini and mainframes).

      And it can be a gateway drug. Especially on the Nodejs platform JavaScript forces you to think of functions as more than a subroutine and this can be a terrific way to open your mind to the world of lambdas and closures - something that people who don't have a strong computer science or math background often struggle with.

      True story. I had a coworker who just couldn't wrap his mind around callbacks and asynchronous execution. Which was a serious problem because at the time big data was becoming a thing and this meant map-reduce and all that. You know what finally made things "click" for him? jquery and ajax calls. Seriously. When he started to realize that he could pass a function as a parameter that would be executed after the ajax call came back, it blew its mind. Very quickly he jumped on the Nodejs bandwagon and he finally was able to work on data projects involving R and math-intensive Python code.

      So there you go. Piss on JavaScript all you like, but don't try to use the "real programmers don't like JavaScript" because I'm a real programmer and I LOVE it. Maybe not my absolute favorite but definitely in my top 3.

      --
      lucm, indeed.
    3. Re:Ignorance, mainly. by Santana · · Score: 0

      You have tried so many programming languages and you don't know JavaScript is severely broken? Shame on you.

      Let's look at your criteria for loving JavaScript:

      IT WORKS
      It does the job
      It does it quickly
      Works in browsers and mainframes.
      Potential gateway drug

      That's a very low demanding list of requirements.

      --
      The best way to predict the future is to invent it
    4. Re: Ignorance, mainly. by Anonymous Coward · · Score: 0

      You like JavaScript because it helped one of your bad developers? Are you a moron?

    5. Re:Ignorance, mainly. by Anonymous Coward · · Score: 0

      Thank you. I was trained on C, C++, and assembly along with some lisp and Java in university. I was top of my classes, tutored, TA'd, and had a job before I even finished school. Since then I've used plenty of other languages in a professional setting, from C# to Python to Perl. I've done 3D graphics programming, web programming, mobile apps, etc.

      I'm not the best programmer in the world by any means, but my point is that I wouldn't consider myself "ignorant" of other languages. I'm not sure why, but I love Node. Like you said, it's an ugly and dirty but pragmatic world of lambdas and closures. You can make it do almost anything you can imagine without resorting to too many weird tricks. There are an endless number of libraries available via NPM, and a lot of packages originally written for browsers work great too. You can actually write it in a variety of flavors and languages. I wonder if all the people ranting about how terrible it is have actually tried it and given it a fair chance or if they're just coming from a pretentious puritanical view.

    6. Re:Ignorance, mainly. by balajeerc · · Score: 1

      If you've never used a language with good support for OO (sorry, prototypes are a shitty hack, which is why more recent versions of JavaScript have actually started hacking in the idea of classes), you wouldn't know how awful JavaScript's is.

      All of OO is a shitty hack.

    7. Re:Ignorance, mainly. by Anonymous Coward · · Score: 0

      What nonsense. (It's you again)

      I have worked in dozens of languages over decades. From Algol to Java, from military/avionic embedded systems to desktop apps to server side. Guess what? JS does everything you need and it's performance is excellent.

      If you want to call me ignorant I'm going to poke a stick in your eye.

      Type systems are OK. But they slow down development for little gain. They are not as great at finding/preventing bugs as they are cracked up to be.

      OO is OK as well. It is not the be all and end all of programming. It has it's serious down sides as well.

      That is why this experienced programmer loves JS.

      Which is not to say it is suitable for every task. Horses for courses and all that.

    8. Re: Ignorance, mainly. by Anonymous Coward · · Score: 0

      JS does everything you need and it's performance is excellent.

        JS does everything you need and it's performance is excellent.
        JS does everything you need and it's performance is excellent.

      LOL, "performance is exellent"

      I'll let that sink in.

        JS does everything you need and it's performance is excellent.

      LOLOLOL I'm done now.

    9. Re:Ignorance, mainly. by ckatko · · Score: 1

      Translation:

      >What the fuck did you just fucking say about me, you little bitch? I’ll have you know I graduated top of my class in the Programmer Seals, and I’ve been involved in numerous secret raids on Al-Quaeda, and I have over 300 confirmed kills. I am trained in [Algol to Java] and I’m the top [programmer] in the entire US armed forces. You are nothing to me but just another target. I will wipe you the fuck out with precision the likes of which has never been seen before on this Earth, mark my fucking words. You think you can get away with saying that shit to me over the Internet? Think again, fucker. As we speak I am contacting my secret network of spies across the USA and your IP is being traced right now so you better prepare for the storm, maggot. The storm that wipes out the pathetic little thing you call your life. You’re fucking dead, kid. I can be anywhere, anytime, and I can kill you in over seven hundred ways, and that’s just with my bare hands. Not only am I extensively trained in unarmed combat, but I have access to the entire arsenal of the United States Marine Corps and I will use it to its full extent to wipe your miserable ass off the face of the continent, you little shit. If only you could have known what unholy retribution your little “clever” comment was about to bring down upon you, maybe you would have held your fucking tongue. But you couldn’t, you didn’t, and now you’re paying the price, you goddamn idiot. I will shit fury all over you and you will drown in it. You’re fucking dead, kiddo.

    10. Re:Ignorance, mainly. by Pseudonym · · Score: 1

      Is it a pure delight for the intellect like lisp, or an unbreakable workhorse like Ada?

      Pure it is not, but most don't know just how close JavaScript is to Scheme. We joke about:

      var f = function() { }

      because the syntax is clunky, but the semantics are extremely clean.

      I guess this is the thing that most people don't realise: Whatever your first programming language is, there's a bunch of stuff that you have to unlearn when it comes time to use your second. It would be wonderful if everyone started off with Haskell, but until that day comes, JavaScript is one of the best choices for a first language. Compared to 8-bit interpreted BASIC (like many old-schoolers, that's what I started on), PHP, or Python, JavaScript will teach you fewer bad habits. In that sense, it is a very good gateway drug. The transition from JavaScript to Scheme is much less painful than BASIC to C, or Python to anything else.

      I hated node.js when my employer forced me to use it. I still hate it. The more I use node.js the more I realise that I really want Erlang to do the kind of jobs that node.js does; if you're going to do event-based programming, at least do it right.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    11. Re:Ignorance, mainly. by Pseudonym · · Score: 1

      All of OO is a shitty hack.

      I know what you're saying, but I dissent ever so slightly. Simula's object model is a shitty hack, and it shows in any language which uses it (C++, Java, C#, Python, etc).

      There are a few nice object systems out there. See Smalltalk/Newspeak, O'Caml, Eiffel/Sather, and Haskell's type classes if you want to see what a principled object system looks like.

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
    12. Re:Ignorance, mainly. by balajeerc · · Score: 1

      I know what you're saying too, but most often, when people say OO, they mean "inheritance", and primarily just that. That is all I am railing against.

    13. Re:Ignorance, mainly. by Pseudonym · · Score: 1

      Yeah, when I say "OO", I usually have to follow it up with "Alan Kay coined the term, and he didn't mean what you mean".

      --
      sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  10. there is such a thing... by ooloorie · · Score: 2

    At over 350,000 packages, the npm registry contains more than double the next most populated package registry

    There is such a thing as "too big" for package repositories: at some point, the benefit of being able to find packages for obscure uses is outweighed by the cost of having to sift through endless lists of redundant packages, the incompatibilities arising from many people using incompatible frameworks, and the inability to tell easily whether a given package works well. In JavaScript, that's compounded by the extremely loose type system and error checking.

    1. Re:there is such a thing... by BarbaraHudson · · Score: 1

      And of course there's got to be some significant code duplication in all that mess ...

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    2. Re:there is such a thing... by ebrandsberg · · Score: 1

      The tyranny of choice. Even with Maven, trying to find the right package to use can be a pain. Want to find a generic serializer that works better than the built-in serializer? That will be half a day of searching, testing and validating (for anybody who cares, I chose fst). Fewer libraries of better quality make more sense. In Java, you have libs such as the Apache Commons and Google Guava libraries that cover a huge swath of functions, which I suspect in node.js is covered by tens of thousands of packages, often with duplicate functionality.

    3. Re:there is such a thing... by ooloorie · · Score: 1

      Fewer libraries of better quality make more sense.

      One way to achieve this is through stricter languages. Maybe limiting oneself to TypeScript modules is a good start?

  11. Latest shiny object by Anonymous Coward · · Score: 0

    And tomorow, it get replaced with the next 'greatest thing'... But back to the topic, how many useful items, and not dead end projects or simple crapola ?

  12. No it's not by lucm · · Score: 4, Interesting

    The amount of code needed to write a web application using Node.js is tiny compared to even PHP, which itself requires a lot less code than java or others. Performance is excellent, especially if you combine it with a web server for static content (like you would do with most web technologies).

    Even without using frameworks (like Express), Nodejs is a technology that is well-suited for web applications. There is a learning curve because of the asynchronous paradigm (which can be mitigated if one uses promises) but overall the language is decent and favors good practices, such as MVC or code reuse. In the age of the API this is a fantastic platform to quickly put together a REST architecture.

    Also, don't bash Nodejs for server-side code. Because of the self-contained nature of npm it can prove quite convenient for all kinds of applications and utilities, not just web applications. Whenever I need a quick script that involves database access or interacting with web services, I no longer use bash and tools like curl or wget, I get what I need a lot faster with Nodejs. There are so many excellent packages on npm it's just a no-brainer.

    --
    lucm, indeed.
    1. Re:No it's not by Anonymous Coward · · Score: 0

      Consider the audience. Even YC HN is at least bound to give you some points for budding hacker enthusiasm. Slashdot is one of the oldest stomping grounds on the Internet for techies.

      There's a lot of IT conservatism and push-back, false atavism, etc. Write a blazing fast server in ASM and you'll still have some morbidly obese beard offering his three essays on why you're shit and why the thing he did three decades ago is worthy or even relevant.

    2. Re:No it's not by Billly+Gates · · Score: 1

      Why can't you use nginx or something else to handle your async calls rather than write your own crappy one in JavaScript? I see no point of reinventing threading and other things when technology exists that do that for you so you can focus on other things.

    3. Re:No it's not by lucm · · Score: 1

      Why can't you use nginx or something else to handle your async calls rather than write your own crappy one in JavaScript? I see no point of reinventing threading and other things when technology exists that do that for you so you can focus on other things.

      nginx is a web server. How exactly would you use it to "handle async calls" in a script? And in what way is JavaScript reinventing threading - it's single-threaded!

      A typical JavaScript app is "async" in the sense that by using callbacks you escape from the rigid top-down execution of the lines of code, allowing you to build your workflow around events without having to interact with operating system level concepts like threads or processes. This is great because if two parts of your script must interact with external "slow" things like a database or the filesystem, you can run those time-consuming tasks in parallel instead of sequentially, and the end result is a faster script execution. But it's still in the same thread, you're just "cheating" to avoid being idle while you wait for that external thing to complete its part.

      Throwing an external process in the mix would just slow things down and cause all the well-known issues that existing multi-process solutions like CGI are known for. There's a reason why over the last 20 years people have tried to work around CGI clunkiness, leading to stuff like baking the script engine in the web server process (a la mod_perl or mod_php).
       

      --
      lucm, indeed.
    4. Re:No it's not by leptons · · Score: 1

      Slashdot is a laughing-stock and has been for quite some time. I just came here for the popcorn, and the expected salty commentary from the neckbeards about why Javascript is the worst programming language ever created. They are the ones that don't get it, and they are also the ones who are sliding into irrelevance.

  13. node by fluffernutter · · Score: 1

    I'm really confused about node.js. Can anyone give me an example of something that they used it for that would have been a lot harder or wouldn't work as well as a traditional web framework? I guess what I'm trying to ask is, if someone is already comfortable with a framework is there reason to experiment with node.js?

    --
    Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
    1. Re:node by slazzy · · Score: 2

      When developing for the front-end, you only have one option in the browser, JavaScript (besides languages which compile down to JavaScript). A lot of developers like using nodejs so they can use the same language on the backend as on the front. Personally I prefer Python on the backend, but I've started using nodejs as it makes things easier to only use one language.

      --
      Website Just Down For Me? Find out
    2. Re:node by fluffernutter · · Score: 1

      Are you talking technically easier or mentally easier? I do front end Javascript and back end Python, and I've found they can communicate quite well using get/post or json. But perhaps the communication is more efficient somehow with node.js, is there a method of passing data that presents it self without using those protocols? I develop Android/iOS as well so maybe I have just gotten used to thinking in different languages over the years and don't really notice it any more.

      --
      Laws are rules for the court, but merely a bottom bar to hit for life. Think beyond laws in your actions always.
    3. Re:node by Santana · · Score: 1

      I guess it is simpler for managers to hire and replace programmers.

      --
      The best way to predict the future is to invent it
    4. Re:node by Santana · · Score: 0

      I want to emphasize the existence of alternatives to JavaScript, as you mention, which means that JavaScript is not your only option.

      There's a very long list of languages that you can use instead. You can even use Smalltalk:

      https://github.com/jashkenas/c...

      --
      The best way to predict the future is to invent it
    5. Re: node by nitehawk214 · · Score: 1

      And there are lots more shitty JavaScript only "programmers" than real programmers that can program in the best language for the task.

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
    6. Re:node by Anonymous Coward · · Score: 0
  14. I didn't know they ... by CaptainDork · · Score: 1

    ... were even engaged.

    --
    It little behooves the best of us to comment on the rest of us.
  15. Most of them trivialities by Master5000 · · Score: 2, Insightful

    made by amateur 17 years olds....

  16. That's scary by Snotnose · · Score: 3, Interesting

    Scary so many people are using what is arguably one of the worst languages ever created.

  17. The better to HEAR you with, my dear! by jtara · · Score: 1

    Wow, the NSA has been busy writing code!

  18. 350k packages, so what? by Dracos · · Score: 1

    What would be telling (especially in light on left-pad) about npm, JS developers, and JS itself is how many of those packages are larger than a size that would be considered ridiculously small in another repository: 25 lines of code (which is being quite generous), measured the same way that left-pad becomes 11 lines.

  19. Not just left pad by sciengin · · Score: 3, Funny

    I cannot understand my fellow slashdoters that make fun of leftpad, node is useful for so many more things.
    For example just recently huge innovations were made within the node community and we are now proud to announce 1325 different variants of rightpad.
    Can C++ do this?
    Didn't think so!

  20. No .de by puddingebola · · Score: 1

    The no .de movement must end. Germans have as much right to a domain on the internet as any other country has.

  21. Lies, damn lies, and statistics by Anonymous Coward · · Score: 0

    The node ecosystem has made a conscious choice to split code into a huge amount of very small (tiny) packages that in many cases only provide a single function. Irrespective of whether you consider that to be a good idea or not: if you compare that to most other packaging ecosystems, where packages are typically larger because they bundle a lot more functionality (and packages that small are frowned upon), then of course there are going to be more packages in npm than anywhere else.

    It's like buying two identical cakes, giving one to Alice unsliced, slicing the other one into 12 pieces, accidentally dropping one on the floor, giving the other 11 to Bob, with Bob now claiming to have 10 pieces of cake more than Alice.

    1. Re:Lies, damn lies, and statistics by Anonymous Coward · · Score: 0

      What Bob doesn't know is that the cake is also made of wax because Charlie swapped it out during a MITM attack.

    2. Re: Lies, damn lies, and statistics by nitehawk214 · · Score: 1

      Ensures inconsistency across functions too.

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
  22. Oh yeah, the quality by campuscodi · · Score: 1

    Can you really call 10-line code snippets... packages?

    1. Re:Oh yeah, the quality by Anonymous Coward · · Score: 0

      No! JavaScript was meant by Netscape for little things in the Browser, to make things look nicer...

      Don't confuse it with a real programming language that is meant for real workloads. Interpreted languages don't belong there. How about just not using it? How about just letting it die, especially server side?

      Also, a webpage that doesn't work without JavaScript enabled it broken by Design.

  23. Wow! by Anonymous Coward · · Score: 0

    Not only is it larger than the next largest package registry, but it's also the largest package registry in the world! It would be amazing for a package registry to accomplish just one of these feats, but it managed to accomplish both!

  24. Now every trivial web app needs packages! by shess · · Score: 1

    The best thing about npm is that it can re-create the Ruby experience where the first step of running some trivial app is to install 230 packages! It's a real language!

    And god help you if you actually decide to use the app for the long term, because in twelve months half its dependencies will no longer be maintained, and the other half will require updates after you do an OS upgrade, so you'll be in there debugging errors yourself. This will help train you for a 21st century job!

    1. Re:Now every trivial web app needs packages! by NormalVisual · · Score: 1

      Yeah, having an update script install 40,000 new files every time it's run takes a bit of getting used to.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
  25. It's a matter of context by lucm · · Score: 1

    You like JavaScript because it helped one of your bad developers? Are you a moron?

    He's not a bad developer.

    A bad developer is not someone with an imperfect knowledge of some aspects of software development. A bad developer is someone who can't see the big picture and can't deliver code that is fit for purpose in the specific context where that code is needed. From corporate drones who write code for legacy Oracle Forms applications to Chinese engineers who design on-screen menus for low-end plasma TV, from Wall Street mathletes writing micro-trading platforms to people who crank out heaps of custom Wordpress theme for small businesses, it's a big world with amazingly different requirements for time-to-market, quality and solution resilience.

    I remember years ago we had this massive migration project with a brutal deadline. We had a "genius" on the team who went home to work on a perfect solution, using all the fancy languages and libraries. But he never finished; after a week the deadline was looming so while the genius was writing unit tests for his migration framework, as a Plan B an intern patched together a bunch of VBScripts crammed with "on error resume next" and hard-coded file paths that got the job done in a day. Who was the bad developer in that story?

    --
    lucm, indeed.
  26. Hosts nothing by Anonymous Coward · · Score: 0

    The largest package registry, which does not host a thing, it only uses github. It is just an awful hack. How about creating an efficient and properly namespaced registry? Even maven central is not so badly constructed.

  27. and wth just one dependency... by Anonymous Coward · · Score: 0

    you too can have all 350,000 packages installed in your node_modules/ folder!

    i love node, but even the smallest projects can end up with 30,000+ files (files, not modules) in that folder.

    scares me a little bit.

  28. Uh-huh... by EmeraldBot · · Score: 1

    "This just in! NPM's record on packages has been broken by an 'EmeraldBot' from Slashdot, who now hosts the largest number of packages in the world, at 550,050 and growing. Each one represents a single byte of the compiled program leftpad++, and is soon expected to double in number with the introduction of rightpad++."

    On a more serious note, NPM's claim is dubious at best because they split programs up into so many packages, some only providing a single function. A WHOLE PACKAGE FOR A FUNCTION. That view is largely dependant on what exactly you consider a package, and me personally, I need something more substantial than a literal copy and paste.

    --
    "Set a man a fire, he'll be warm for the rest of the night. Set a man afire, he'll be warm for the rest of his life."
    1. Re:Uh-huh... by MillionthMonkey · · Score: 1

      I don't bother importing those 10-20 line packages. I just copy the code chunk off the Github page, paste it into my stuff, and tell my boss that I wrote it.

  29. You mean node.js devs have small packages by raymorris · · Score: 1

    > When you get such trivialities as left pad in the registry, why should anyone care that the raw number of packages is large?

    So you're saying node.js developers have small packages?

  30. The one who accepted ten days for a maasive projec by raymorris · · Score: 1

    > I remember years ago we had this massive migration project ...
    > after a week the deadline was looming
    > Who was the bad developer in that story?

    The one who said "yes, we can do this massive migration in a week or so."

  31. Duplicates by Luthair · · Score: 1

    There are many different uploads of jquery and every other popular library.

  32. And that's a bad thing by allo · · Score: 3, Insightful

    Ever installed some nodejs stuff?
    You do "npm install" and watch an endless packagelist being downloaded. No, not to the central installation, but into the project. And they are like modules with 5 lines. See for example the "left-pad" thing. Yes, people include other programmers code for 5 lines of a function which you can create without even thinking about it. And they include such 5 line functions from hundereds of different people in their project. Not only one missing package can break millions of builds (see the left-pad example), but one malicious programmer can infect millions of production systems by issuing an update, which includes one malicious line, which loads some external script he will be able to change on demand. Because who re-reads the code of the modules, if he even read it the first place, when adding it because the name and short description seemed to match the requirements.
    The node.js ecosystem is fucked up. Working, but still a working mess.

    1. Re:And that's a bad thing by Tchaik · · Score: 1

      Use `yarn install`, it at least fixes the way things are installed locally by having a single copy of the packages in use and hard links in the projects.

    2. Re:And that's a bad thing by shutdown+-p+now · · Score: 1

      It's not just the modules themselves; npm is also horrible.

      For starters, npm is non-deterministic. Yep, you've read it right: you can install the same packages on two different machines, but if you do it in different order, you can end up with different dependency trees. And yes, despite what the npm maintainers say, it can result in different versions of packages being installed for the same set of version constraints.

      Then there are major bugs that have been open for over a year, and can be blocking (as in, no way to install a package) if you happen to be the unlucky one who is affected... but there's no fix. The bug still says "needs repro", despite 80+ comments and 24 upvotes on it, and one of npm developers saying that he "ran into this a few times".

    3. Re:And that's a bad thing by allo · · Score: 1

      I know, there are like tens of alternative package managers, trying to fix the mess. I guess each of them has its own flaws, which are of course fixed by the shiny new one created yesterday. It's still not convincing and the problem with thousands of tiny packages remains.

      And many "amateur" packages may not guarantee their function either. think of a left-pad, which pads with spaces. Now assume the original author may not wanted to pad it with the correct number of spaces, but pad it to reach a visible lineup. Now he might decide to use tab characters instead of matching spaces for his next release. You used it assuming it will always use a matching number of spaces. now your whole project is broken and you need to debug which package of the hundereds in your project did change the behaviour.
      A real standard library does not only have all methods matching, such they can be used together without any problems, but further tries to guarantee a well specified behaviour, which will not change between releases. A "that's what i need" package which is incidentlly adopted by many other projects may not intend to give such guarantees. And i do not have the impression, that people select their packages by checking if they give any promises about future compatiblity.

  33. a better langauge for webapps would be good by Anonymous Coward · · Score: 0

    Seriously, javascript was initially made in 10 days, by someone with not much expertise in programming language design, and it remains around. I wonder how much agony could have been saved if a decent programming language had been used instead.

    1. Re:a better langauge for webapps would be good by Anonymous Coward · · Score: 0

      In a way, JS is perfect for the way web dev often seems to work: just throw stuff together until it "works", no matter how ugly it is, until it's such a convoluted mess you have no option but to scrap it and start over.

  34. users installed 18 billion packages by Anonymous Coward · · Score: 0

    "In the preceding four weeks, users installed 18 billion packages."

    because of broken system of dependencies. npm is total shit when it comes to dependencies.

  35. Dead packages by Midnight+Thunder · · Score: 1

    One challenge I have with npm are the dead projects and the apparent inability to take over the dead project, even if your project has become the accepted source of truth in GitHub. The workaround is to create a new package, but that just adds to the confusion.

    It would be nice if there was a way for a project to either be flagged as possibly dead or require some other mechanism to red flag a project, either automated or via reporting.

    Maybe I am alone in this feeling?

    --
    Jumpstart the tartan drive.
    1. Re:Dead packages by Anonymous Coward · · Score: 0

      No

  36. Largest implies lower average quality. by God+of+Lemmings · · Score: 1

    You have to search through a ton of crap to find whats good.

    --
    Non sequitur: Your facts are uncoordinated.
  37. Re:Node.js is terrible by Billly+Gates · · Score: 1

    From the same guy who wrote the funny mongodb webscale argument is his take on Rockstar node.js arguments.

    So you see nothing wrong with blobs of callback after callback with making your own threading and scheduling from scratch?

    Wouldn't it make sense to use nginx for performance and let that and your OS do the threading instead?

  38. Re:Node.js is terrible by lucm · · Score: 1

    So you see nothing wrong with blobs of callback after callback with making your own threading and scheduling from scratch?

    Different problems are solved with different tools. If the problem to solve is answering as fast as possible a tsunami of lightweight requests (such as a typical web app), Nodejs is awesome. However if there are fewer, long-running requests that tap into heavier resources (such as crypto or image processing) then maybe it's best to consider alternatives.

    But even if a web app is based on Nodejs, does that mean I would use it alone? Not at all; while Nodejs can do SSL and static content, I prefer to offload that part to nginx or Apache. Which doesn't reflect badly on Nodejs because that's what I would also do for a java webapp running in Tomcat. At that point though we're no longer talking about handling multi-threading inside or outside the app server, we're talking about solution architecture which is a totally different matter.

    --
    lucm, indeed.
  39. Re:The one who accepted ten days for a maasive pro by lucm · · Score: 1

    The one who said "yes, we can do this massive migration in a week or so."

    That would be someone in management.

    That's the usual team work; the manager makes crazy promises and the underpaid techies deliver. And usually everyone is rewarded; the manager gets a fat bonus check, and the techies get free pizza and Red Bull for working all weekend. Win-win!

    --
    lucm, indeed.
  40. Re:Node.js is terrible by Pseudonym · · Score: 1

    So you see nothing wrong with blobs of callback after callback with making your own threading and scheduling from scratch?

    JavaScript has been accused of many things, but "threading" isn't one of them.

    I don't mind blobs of callback in principle. Continuation-passing style doesn't scare me at all (especially in a language like Scheme or Haskell). But I agree with you. The more I used Node.JS, the more I realised I really wanted Erlang.

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  41. Simulates (poorly) threading in one or two threads by raymorris · · Score: 1

    I'm not the person you replied to, but ...

    > And in what way is JavaScript reinventing threading - it's single-threaded!

    As you know, a generic single-core cpu is also single-threaded. (Max 16 threads with 8 core cpu and hyperthreading). The operating system simulates running many threads at once. It's actually only running one thread at a time, switching between the two, below that level it's actually single-threaded (or has just a few cpu threads).

    JavaScript / Emacscript does something similar - simulates running many tasks at once. In some implementations, it does so very poorly. In one particular implementation I had to use for several years, there were two underlying OS threads - one for network connections and UI interaction, one for everything else. That's possibly the stupidest possible division of labor - the part that should be fast, UI calls, had to wait for the slowest part (by far), the network connections. There is a reasonable argument that it would work a heck of a lot better if JavaScript exposed real threads, which have been implemented well by very smart people improving the implementations over many years. If Javascript exposed pthread_create() or some other interface to OS threads, "div.visibility = hidden" wouldn't have to wait for some unrelated, slow network connection to retry its DNS lookups.

    There are also advantages to Javascript model of callbacks with a single real thread, just as there are disadvantages. There are reasons most languages expose real threads rather than offering *only* their own built-in simulation of multiple concurrent tasks - most languages expose threads because there are benefits of doing so.

    The ideal may be a model where youb don't *need* to use real threads, a JavaScript-like model where the language wraps concurrent tasks in a pretty model, *and* clone() and fork() are available for the few times that you need them. Programming the Apache web server, writing Apache modules, is like that. It's callback-based and I don't recall offhand ever needing to create threads in an Apache module, I forked an external shared process for one module once. But that one time I needed to fork a process, I was able to.

  42. Re:Node.js is terrible by Billly+Gates · · Score: 1

    So you see nothing wrong with blobs of callback after callback with making your own threading and scheduling from scratch?

    JavaScript has been accused of many things, but "threading" isn't one of them.

    I don't mind blobs of callback in principle. Continuation-passing style doesn't scare me at all (especially in a language like Scheme or Haskell). But I agree with you. The more I used Node.JS, the more I realised I really wanted Erlang.

    Yeah man. Erlang is the real rockstar language

  43. Re:Simulates (poorly) threading in one or two thre by leptons · · Score: 1

    JScript.NET is basically Javascript, and it also works with strong typing, and threads. It's been around for more than a decade. Microsoft doesn't really support it, but JSC is a javascript compiler that can create .exe's and .dll's out of javascript, and it is still included with .NET and is on every windows computer with .NET installed.