• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics in ~comp with the tag "ask.discussion". Back to normal view / Search all groups
    1. Node's "Single Threaded, Event Driven" programming model seems highly deceptive and farcical

      The more I think about it, the more I'm convinced of it. The biggest selling point of Node folks has been the "single threaded, event driven" model, right? Unlike JavaScript, other languages work...

      The more I think about it, the more I'm convinced of it.

      The biggest selling point of Node folks has been the "single threaded, event driven" model, right? Unlike JavaScript, other languages work on a "blocking" basis i.e. you run a statement or command and the program "waits" until the I/O is complete. For example, you issue open('xyz.txt', 'rb').read() in python and the program waits or blocks until the underlying driver is able to read that whole text file (which could take arguably long time if said file is too large in size).

      But with the Nodejs equivalent, you just issue the statement and then pass the "event handler" so that your program is never in the "waiting state". The whole premise of Node/JS event-callback is that "you don't call us, we will call you".

      This is all nice in theory but if this were indeed true then Nodejs scripts should be blazing fast compared to Python and even Java considering that most programs we write are I/O heavy and 99% of time, they're just waiting for an input from a File/URI/User? If this event callback model indeed worked as effectively as claimed, Node would have been the numero one and only language being used today?

      I think I'm starting to understand why that isn't the case. This whole "single threaded, event driven" thing is just a farce. You can also replicate the same thing that Node.js is doing in your Java or Python too by applying multi-threading (i.e. one thread just "waits" for the I/O in the background while the other keeps doing its job). All you've done here is just handed or delegated that complexity of multi-threading to Node.js?

      Realistically, it's impossible to wait or block an I/O request while at the same time also letting the other part of the code engage in other tasks, that's the very definition of multi-threading. Doing "async" is impossible without multiple threads in that sense. Node must have a thread pool of sorts where one of them is engaged in the wait/block while another is running your JS code further. When the wait is over, the control is then passed to the "event handler" function it was bound to in that other thread.

      What Node is selling as "single threaded" applies to application or business logic we are writing, node itself can't be single threaded. I feel it's better to just implement multi-threading in your own code (as needed) instead of using something convoluted and confusing like Node.js. What say you?

      8 votes
    2. Any BBS sysops here from back in the day?

      As a not quite "old man" I was wondering how many former BBS sysops are here? In the early-mid 90s, I used to run a single line PCBoard powered hobby BBS and dabble in making PPEs (PCBoards...

      As a not quite "old man" I was wondering how many former BBS sysops are here?

      In the early-mid 90s, I used to run a single line PCBoard powered hobby BBS and dabble in making PPEs (PCBoards programming language for plug ins/mods). I also help friends set up SpitFire, Searchlight, Synchronet, WWIV and Aftershock (total PITAs from what I remember)--basically anything free, crackable or unlimited trial.

      Since I was the only sysop that ran PCBoard I was invited to become an officer in our local User Group to run their whopping 3 line BBS and give classes (that was quite the technological achievement back then). That is something I truly do miss. I was, by far, the youngest member of the User Group (your average member probably had grandkids my age) but it was a meritocracy.

      People seemed eager to learn and share information as they found it. Before computers, 3d cards and the internet was ubiquitous, you were automatically accepted into a knowing crowd if you put in the effort/time to join a BBS, forum or (early) MMO. Exclusion brought inclusion, if that makes sense. If you torched your reputation by acting like a jackass it was difficult to move on like a locust to another area.

      So many stories. So many high jinks that would be deemed illegal today, lol.

      Everything that is old, is new again.

      I'm getting a lot of BBS vibes in the aftermath of Rexxit. The slower pace of Tildes reminds me so much of the BBS forums (while I know Tildes isn't new, it is growing in popularity in the aftermath.) Even the Fediverse harkens back to the days of early BBS synch nets.

      Now if only I could find a modern remake of Tradwars 2002.

      51 votes