|
but mongo is web scale
|
# ? Oct 13, 2012 08:07 |
|
|
# ? May 9, 2024 16:15 |
|
OOGA-BOOGA MONGO WEB SCALE
|
# ? Oct 13, 2012 11:52 |
|
MononcQc posted:Which I guess is kind of okay, but annoying. poo poo can be locked up, I need to manually split everything in callbacks that will register themselves in order to know when things are done (something like resource.ready(callback)), I need to keep track of everything manually (is this parse for request 1, 2 or 73?). Jesus loving christ that's not hard to do at all. You don't keep some table of requests and ask which request the parse is for, this poo poo is called closures. MononcQc posted:blah blah blah threads Yeah and you pay the cost for context switching and overhead of threads or processes, which is why people still do event-based code to this day. MononcQc posted:Then at some point, I may gain parallelism on top of it Awesome, poo poo will go great, except maybe my writes, which will need to block to be sane. What I'll be able to do with my concurrent code (not callback-based) is: Why would your writes block to be sane? Get better at writing. Learn 2 code. MononcQc posted:
More like code:
code:
MononcQc posted:My code that was concurrent is now parallel by default, and I limit how much blocking I need to do (assuming the write is written to block correctly, either via transactions, safe queues, mutexes, locks or whatever). However, if I go back to my callback-based code and get parallel, what I get is still this: Put event loops on multiple threads, problem solved. MononcQc posted:
What are you talking about? In all event-based code the reads are going to happen in parallel. You don't schedule a read and then block anybody else from reading while you do your thing. Non-blocking IO is the thing one does with async code, LOL if you're using callbacks with blocking I/O. MononcQc posted:While the modern world of programming on servers has moved to concurrent and parallel methods a long while ago (mostly because they are objectively better), Javascript users with node.js came crashing through the door and said "we have a great new model! it's callbacks with non-blocking IO! it's loving great!". Because that's how Javascript loving works. That's how it works in the browser, that's what Javascript engines support. Have you tried to take javascript engines and run more than one inside a process? Have you tried making them run on top of green threads? Guess what: the fancypants C++ programmers didn't make them compatible with all such notions. MononcQc posted:Everyone who is not node.js knows what they propose is worse than what exists. It's like someone inventing PHP again, but for server-side platforms. Blah blah blah Ryan Dahl is an idiot. We know that. We don't need you to be an idiot too. shrughes fucked around with this message at 12:08 on Oct 13, 2012 |
# ? Oct 13, 2012 11:58 |
|
well on one hand, i respect MononcQc's opinions, and on the other hand, youre breaking anime rules this is a tough decision
|
# ? Oct 13, 2012 12:00 |
|
also youre defending node unironically
|
# ? Oct 13, 2012 12:01 |
|
In addition to the fact that single-threaded async callback systems can be fairly straightforwardly migrated to run on multiple threads: Async callback based systems can be fairly straightforwardly migrated to green thread systems that sit on top. It takes about 3 manweeks to set up your own green thread library, and then code can be migrated incrementally later. So it's not some design decision you're Stuck With. Async callback based systems never made sense for stuff doing lots of Disk I/O, except maybe for very expensive super-awesome SSD devices. For stuff doing lots of network I/O, with the state of a lot of connections to take care of, that's where they make sense. Guess what Node.JS is designed for. Which is better: nginx or Apache? If you want to run a Javascript webserver using v8 you simply can't have multiple threads. You can't have green threads. v8 does not work that way. Javascript code that can run both in-browser and in-process needs to be callback-based in both situations. If they did use a JS engine that could run on multiple OS threads, that would make things a lot more error prone for the users of Node.JS if they went that path. Just imagine that scenario, what a clusterfuck that would be for retarded javascript programmers who never had to deal with the concept of multi-threading. So Node.JS made the right choices when it comes to doing javascript on the web server. You can complain about drivers and filesystems being broken when doing async I/O to disk, but so what? The point of async I/O is not to super-parallelly talk to disk, you can't do enough concurrent I/O requests on most disks for anybody to care if you just spawn a pool of worker threads for that purpose.
|
# ? Oct 13, 2012 12:45 |
|
shrughes posted:Which is better: nginx or Apache? Apache.
|
# ? Oct 13, 2012 12:47 |
|
shrughes posted:So Node.JS made the right choices when it comes to doing javascript on the web server. node exists so no, they didn't.
|
# ? Oct 13, 2012 14:41 |
|
shrughes posted:If you want to run a Javascript webserver using v8 you simply can't have multiple threads. You can't have green threads. v8 does not work that way. Javascript code that can run both in-browser and in-process needs to be callback-based in both situations. I'm p sure v8 now supports threading. Why you'd want to build something substantial based upon that fact I do not know. FamDav fucked around with this message at 15:14 on Oct 13, 2012 |
# ? Oct 13, 2012 15:07 |
|
If I had any time left over from being angry about unicode, date times and memory usage I would be angry about floating point http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf
|
# ? Oct 13, 2012 16:12 |
|
shrughes posted:Jesus loving christ that's not hard to do at all. You don't keep some table of requests and ask which request the parse is for, this poo poo is called closures.
|
# ? Oct 13, 2012 16:23 |
|
it's nice to see threads vs events rather than tabs vs spaces
|
# ? Oct 13, 2012 16:37 |
|
ban 4 anime n aspergers
|
# ? Oct 13, 2012 16:43 |
|
tef posted:it's nice to see threads vs events rather than tabs vs spaces a mix of both
|
# ? Oct 13, 2012 16:56 |
|
shrughes posted:Jesus loving christ that's not hard to do at all. You don't keep some table of requests and ask which request the parse is for, this poo poo is called closures. Say for example, that I need to parse two files to proceed with further analysis. If I want to do the file reads in parallel, I can with both approaches. However, I'll need to be able to pass a callback to both operations, and that callback will need to have some explicit synchronization semantics to deal with the two following possibilities: code:
code:
Compare this, for example, with futures or promises, which will give you an implicit serialization point. Then you can just say "parse N files and when they're done do X" as a much, much cleaner sequence of code, with less room for error: code:
shrughes posted:Yeah and you pay the cost for context switching and overhead of threads or processes, which is why people still do event-based code to this day. If you want to drag the argument into 'poorer semantics yield better performance, so we gotta have poorer semantics', then sure, I guess. Use the LOL SPEED argument. I can't disagree with that in this case, although this is highly implementation-dependent. shrughes posted:Why would your writes block to be sane? Get better at writing. Learn 2 code. I wasn't clear there, but what I meant is that in this imaginary case, writing to the same record/entry/whatever will force your writes to never be parallel (they'll block each other). shrughes posted:More like In that particular case, possibly so. That's assuming you get the right circumstances, i.e. the writes won't be blocked by reads... otherwise you'll still get: code:
code:
shrughes posted:Put event loops on multiple threads, problem solved. shrughes posted:What are you talking about? In all event-based code the reads are going to happen in parallel. You don't schedule a read and then block anybody else from reading while you do your thing. Non-blocking IO is the thing one does with async code, LOL if you're using callbacks with blocking I/O. shrughes posted:Because that's how Javascript loving works. That's how it works in the browser, that's what Javascript engines support. Have you tried to take javascript engines and run more than one inside a process? Have you tried making them run on top of green threads? Guess what: the fancypants C++ programmers didn't make them compatible with all such notions. Yeah, that would help my point that Javascript on the server is the wrong tool for the job, and that using it is a poo poo idea. MononcQc fucked around with this message at 17:09 on Oct 13, 2012 |
# ? Oct 13, 2012 16:57 |
|
shrughes posted:In addition to the fact that single-threaded async callback systems can be fairly straightforwardly migrated to run on multiple threads: shrughes posted:Which is better: nginx or Apache? shrughes posted:If you want to run a Javascript webserver using v8 you simply can't have multiple threads. You can't have green threads. v8 does not work that way. Javascript code that can run both in-browser and in-process needs to be callback-based in both situations..
|
# ? Oct 13, 2012 17:07 |
|
use java, problem solved.
|
# ? Oct 13, 2012 17:48 |
|
Shaggar posted:use java, problem solved. https://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf
|
# ? Oct 13, 2012 17:51 |
|
math people will always complain about a language doing correct things for users instead of dumb poo poo for autists.
|
# ? Oct 13, 2012 18:38 |
|
Werthog posted:but mongo is web scale mongo is dead http://www.nytimes.com/2012/10/11/sports/football/alex-karras-nfl-lineman-and-actor-dies-at-77.html
|
# ? Oct 13, 2012 19:08 |
|
Shaggar posted:math people will always complain about a language doing correct things for users instead of dumb poo poo for autists. ah yes, having accurate floating point is bad for users, unsigned integers are for autists
|
# ? Oct 13, 2012 19:43 |
|
a real programmer uses floating point datatypes without knowing how they work every time I do something with floats I use floor/ceil to prevent rounding errors
|
# ? Oct 13, 2012 19:49 |
|
Otto Skorzeny posted:ah yes, having accurate floating point is bad for users, unsigned integers are for autists the autists got their strictfp keyword in December 1998, 7 months after that rant meanwhile everyone else just uses floats for money calculations to get the highest possible performance
|
# ? Oct 13, 2012 19:53 |
|
Win8 Hetro Experie posted:the autists got their strictfp keyword in December 1998, 7 months after that rant my favorite antipattern
|
# ? Oct 13, 2012 20:51 |
|
MononcQc posted:obviosities about how event-based programming is annaying, claims that you can't have concurrency primitives in event-based programming and general ignorance in general I'm still waiting for a recommendation of a better language for programming that wants to share code on the client side and server side. If you're writing a web based chess server, do you want to rewrite the rules of chess in both Scala and Javascript? You might notice the numerous efforts to solve or avoid that sort of problem. There's GWT, even NaCl is a way to solve it.
|
# ? Oct 14, 2012 03:26 |
|
man dunno why you are having problems with events perl + AnyEvent + Coro is almost a joy to work with.. must just be your programming language
|
# ? Oct 14, 2012 04:44 |
|
shrughes posted:I'm still waiting for a recommendation of a better language for programming that wants to share code on the client side and server side. If you're writing a web based chess server, do you want to rewrite the rules of chess in both Scala and Javascript? You might notice the numerous efforts to solve or avoid that sort of problem. There's GWT, even NaCl is a way to solve it. I'm not saying event-based code isn't concurrent, I'm saying it's a crappy type of concurrency compared to other, often more modern options. Compare it to comparing Java's type system to Haskell's or SML's if you want. Both are type systems, but one is objectively weaker than the other. Sure you can have event-based code coupled with other stuff, but it doesn't change its attributes on its own as not being a good option compared to other stuff available server-side. Regarding sharing code between the front and back end, I can't give a good alternative across the board. First because the front-end model of JS is not the best model for the back-end, second because the question is loaded because Js is pretty much your only frontend option. If you really want to, I guess you could look for languages that can compile to javascript, like ruby, python, java bytecode, lisps, Haskell, smalltalk, or go with Haxe or Opa. See altjs.org for different options that won't necessarily involve node.js. They may not be better, but I'm not convinced you need complete code duplication on the front-end and the back-end either. To put it another way, I welcome the idea of JavaScript as the main server language the way I enjoy Java applets in my browser.
|
# ? Oct 14, 2012 04:49 |
|
shrughes posted:I'm still waiting for a recommendation of a better language for programming that wants to share code on the client side and server side. If you're writing a web based chess server, do you want to rewrite the rules of chess in both Scala and Javascript? Java
|
# ? Oct 14, 2012 05:25 |
|
Man I sure love a system where the entire server and application crashes if one of the handlers raises an uncaught exception or where the other option is to register some generic handler that will let requests time out instead and leave the whole stack in an undefined state! Let me use dat node.js!
|
# ? Oct 14, 2012 05:36 |
|
What Ryan Dahl should have done is hacked v8 to run properly on green threads. As far as I'm concerned he can kiss my rear end. I made a commit to Node.JS and it get accepted (because they didn't know how to HTTP properly) and then maybe a month later they were all "lol I want you to give your copyright to me". So I do so and then they say I need to give my address. No, gently caress him.MononCqC posted:raises an uncaught exception Yeah, all sorts of lols can happen if you throw exceptions in event-based code. (Or at anything made by javascript programmers in general.) There are plenty of real problems with Node.JS, the whole thing being a pile of javascript code being one of them. Being in the space of event-based callback systems is not one of them.
|
# ? Oct 14, 2012 05:54 |
|
Event-based code on its own is not terrible and there are times when it's a decent tool. A platform offering only that for concurrency is lagging behind though; most languages with an event framework or component will at least allow other concurrency primitives, which in many scenarios will be more appropriate. Even better, these won't claim that event loops are revolutionary, and will have a saner overall architecture than node.js. MononcQc fucked around with this message at 06:07 on Oct 14, 2012 |
# ? Oct 14, 2012 06:02 |
|
It's not really a good idea to offer two ways of doing concurrency like that. Then you get libraries that want to do event-based stuff, and then you get libraries that want to do green-thread based stuff, and then you get libraries that want to do OS thread based stuff, and these don't interact well at all. (Green-thread and event-based can interact pretty well, but JS programmers aren't familiar with the issues of combining such systems.)
|
# ? Oct 14, 2012 06:12 |
|
green thread green thread green thread
|
# ? Oct 14, 2012 06:17 |
|
csp is the light
|
# ? Oct 14, 2012 06:23 |
|
salted hash browns posted:green thread green thread green thread
|
# ? Oct 14, 2012 06:33 |
|
Gazpacho posted:csp is the light Oh how I wish for a language that had read more than 2 chapters of CSP.
|
# ? Oct 14, 2012 13:12 |
|
shrughes posted:(Green-thread and event-based can interact pretty well, but JS programmers aren't familiar with the issues of combining such systems.)
|
# ? Oct 14, 2012 13:26 |
|
Lets not give the users something they don't understand, then they won't have to understand it!
|
# ? Oct 14, 2012 15:29 |
ZYNGA STOCK CRASHER posted:ban 4 anime n aspergers
|
|
# ? Oct 14, 2012 15:38 |
|
|
# ? May 9, 2024 16:15 |
|
Let's not give user's anything. gently caress users. If they can't write it themselves they don't deserve it.
|
# ? Oct 14, 2012 16:03 |