|
jesus christ c++ is the worst because of the people who use it & their discussions of it
|
# ? Nov 8, 2013 20:27 |
|
|
# ? Jun 11, 2024 06:14 |
|
shrughes posted:Oh Node.JS
|
# ? Nov 8, 2013 20:29 |
|
i don't understand why node.js exists. Was it born facilitate the people who cannot 'learn' anything but javascript?
|
# ? Nov 8, 2013 20:41 |
|
its for people who think javascript is good and don't understand why its not
|
# ? Nov 8, 2013 20:51 |
shaggar was right
|
|
# ? Nov 8, 2013 21:09 |
|
Notorious b.s.d. posted:What was the x11 experiment? no experiment, it was a product: NCD WinCenterPro. all information about it is quietly dropping off the internet, but there is this cool little paper I love, it's so straightforward. some interesting passages: Networking NT Applications Using X posted:The display screen is represented by a single surface object. Each off-screen pixmap is another surface. Because the screen is represented as a single surface, all windowing operations are hidden from the display driver. This is a simplification which is welcome most of the time, but does make it difficult to support multiple depths or "visuals" in the X sense you know, I knew this and I never put two and two together: you can't trivially redirect Windows windows to a remote X11 display, because windows are just regions of a single big surface - there is nothing "behind" a window: this is why, if you move a window above a nonresponding window, you will leave either a "track" or erase the underlying window to gray, respectively depending on whether the underlying window was configured to have a transparent fill or the default fill at least, this used to be true until Windows Vista, which introduced a composited desktop, skipping an evolution phase directly to mapping each window to a polygon in 3D space. Windows XP had already introduced a limited form of compositing in the form of "layered windows" that you could apply an alpha channel to, but the real deal came in Windows Vista few people know that Microsoft actually had the technology as early as 1999/2000, running on Windows 2000, as part of goofy UI experiment Task Gallery Networking NT Applications Using X posted:The only access to TCP/IP available in stock NT is via the WinSock API. This API does not meld well with the NT kernel I/O model and as such suffers badly in performance and functionality this was very true in Winsock 1: back then, sockets weren't even guaranteed to be file descriptors. been no longer true for more than a decade, but for a long time you had to code very defensively around sockets. the story of how Winsock 2 fixed this while retaining backwards compatibility is the usual mix of horror and fascination Notorious b.s.d. posted:And I *definitely* want the story on concurrent instances for rdp/ts I'm afraid it's not as interesting as I made it sound writeup later hackbunny fucked around with this message at 21:24 on Nov 8, 2013 |
# ? Nov 8, 2013 21:19 |
|
hackbunny posted:you know, I knew this and I never put two and two together: you can't trivially redirect Windows windows to a remote X11 display, because windows are just regions of a single big surface - there is nothing "behind" a window: this is why, if you move a window above a nonresponding window, you will leave either a "track" or erase the underlying window to gray, respectively depending on whether the underlying window was configured to have a transparent fill or the default fill x11 has no backing storage for windows either. drawing is done by an Expose event, similar to how windows has WM_PAINT. hackbunny posted:at least, this used to be true until Windows Vista, which introduced a composited desktop, skipping an evolution phase directly to mapping each window to a polygon in 3D space. Windows XP had already introduced a limited form of compositing in the form of "layered windows" that you could apply an alpha channel to, but the real deal came in Windows Vista layered windows were from windows 2000. even the start menu and menus had alpha fade ins.
|
# ? Nov 8, 2013 21:31 |
|
does anyone have any opinions about oreillys 21st century c? http://www.amazon.com/21st-Century-Tips-New-School/dp/1449327141 the idea is interesting, but it also sounds a lot like something an hn would say, so i thought it would be better to check. e. quote:This is a book about breaking tradition and keeping C punk rock. I don’t care to compare the code in this book to the original C specification in Kernighan & Ritchie’s 1978 book. My telephone has 512 megabytes of memory, so why are our C textbooks still spending pages upon pages covering techniques to shave kilobytes off of our executables? maybe this is not the book for me.
|
# ? Nov 8, 2013 21:50 |
|
MeruFM posted:i don't understand why node.js exists. I know, c and inetd are good enough for anybody.
|
# ? Nov 8, 2013 21:54 |
|
shrughes posted:C++ is bad because its destructors don't take parameters, which means that if object X's lifetime is naturally a sublifetime of object Y's, and if X needs Y to clean itself up, then you need to put a pointer to Y inside of X in order to do that cleanup. Things would be cleaner if the destructors took parameters -- you'd just pass in the pointer to Y to the destructor call, and it wouldn't be possible to exit scope without such a thing. In C you'd just call the cleanup function manually and this wouldn't be a problem. Go and D try to help with this problem a little by using defer statements or scope(exit) statements (except with D this is just another frilly language "feature") but in C++11 really destructors should take arguments and smart pointers could even take them with a C++11 variadic argument list. how would destruction of automatic objects on stack unwinding work if destructors could take parameters, i.e.: C++ code:
|
# ? Nov 8, 2013 22:41 |
|
Suspicious Dish posted:x11 has no backing storage for windows either. drawing is done by an Expose event, similar to how windows has WM_PAINT. X11 does and it is optional and unsurprisingly all the big apps assume and abuse it and thus make LTSP and X11 terminals paperweights for "real" work as they cram full documents into it and crash when your terminal runs out of memory displaying a facebook page full of megapixel selfies. http://tronche.com/gui/x/xlib/window/attributes/backing-store.html
|
# ? Nov 8, 2013 22:46 |
|
Yes, I know about the backing-store property. The X server is implementation is free to ignore it, and we removed the initial implementation for quite a long time until we rewrote it to be implemented on top of manual composite redirection (see composite spec).
|
# ? Nov 8, 2013 22:58 |
|
MeruFM posted:i don't understand why node.js exists. <dentist> that's why node.js exists: terror at the thought of having to learn another language (because JS is so full of pitfalls that they assume all languages are this bad)
|
# ? Nov 8, 2013 23:51 |
|
Zaxxon posted:I know, c and inetd are good enough for anybody. it's built on a language designed to manipulate html document elements sorry for your loss though
|
# ? Nov 9, 2013 00:04 |
|
MeruFM posted:i don't understand why node.js exists. it was born because it was possible v8 was a pre-existing javascript implementation that was a.) fast enough to serve content and b.) not dependent on any browser components it was natural that someone would attempt to bodge it together with a web framework
|
# ? Nov 9, 2013 00:04 |
|
hackbunny posted:no experiment, it was a product: NCD WinCenterPro. all information about it is quietly dropping off the internet, but there is this cool little paper I love, it's so straightforward. some interesting passages: is there anything keith packard HASN'T done with X11? he's written hundreds of papers, hacked on X11, xfree86, and X.org again, written his own X server several times (kdrive, xgl), apparently gone from embedded X11 to windows NT terminal servers, crikey i guess once you have a specialisation going...
|
# ? Nov 9, 2013 00:06 |
|
people really wanted to reuse the notoriously high-quality front-end javascript libraries into the back end.
|
# ? Nov 9, 2013 00:17 |
|
now keithp's working on present and dri3 which are cool. also xgl was dave reveman.
|
# ? Nov 9, 2013 00:20 |
|
same now I'm using vega to generate PNGs offline using node so along with my link to the web report i can show an actual mini thumbnail of what the user is about to see its beautiful. thanks d3. thanks vega. thanks node.
|
# ? Nov 9, 2013 00:22 |
|
Deus Rex posted:how would destruction of automatic objects on stack unwinding work if destructors could take parameters, i.e.: There, the code doesn't compile. I don't know what the syntax would be, let's say, for the case of local variables, it's some statement heres_how_you_destroy f(b); Then you'd have to write code:
By default the lack of a heres_how_you_destroy statement for a given variable is equivalent to having a statement heres_how_you_destroy v(); Or maybe you could come up with a better syntax, because that's probably not what you'd end up with after careful consideration. (Maybe when defining the class you could tell it how to map constructor arguments to destructor arguments, which would only be applicable in the case of creating/destroying local variables.) This would mostly be useful for resource-frugal situations, probably where you have objects allocated on the heap moreso than on the stack, so the stack based syntax is not that interesting to me. Edit: deus rex pointed out you'd have to put your heres_how_you_destroy statement before any function call that isn't noexcept. You should also be able to specify the destruction through some sort of bastardized finally block. shrughes fucked around with this message at 00:30 on Nov 9, 2013 |
# ? Nov 9, 2013 00:25 |
|
i really can't get over the fact that all javascript numbers are floating-point yes yes i know technically doubles have a 48-bit-ish mantissa so you can represent any 32-bit int precisely inside one but still that's just loving vile. everything's fine at smaller magnitudes but once your numbers get big enough they sort of just silently become mushy instead of having a well-defined overflow condition. though c is hardly better in that you can't portably catch or saturate overflows even though this is something you might want to do from time to time. node.js seems like a more fashionable and more restricted lisp. given the psychological tendencies of the sort of people who are attracted to lisp it probably explains a lot.
|
# ? Nov 9, 2013 00:26 |
|
didn't twitter run out of numbers so now some tweet ids are long strings and some are numbers and askjaskjlahklsjd
|
# ? Nov 9, 2013 00:27 |
|
Mr Dog posted:i really can't get over the fact that all javascript numbers are floating-point a language designed in 4 weeks in the mid 90s for dhtml dude Mr Dog posted:node.js seems like a more fashionable and more restricted lisp. given the psychological tendencies of the sort of people who are attracted to lisp it probably explains a lot. at this point, this should be bannable
|
# ? Nov 9, 2013 00:27 |
|
Notorious b.s.d. posted:at this point, this should be bannable the hell does that mean?
|
# ? Nov 9, 2013 00:30 |
|
git clone trooper posted:didn't twitter run out of numbers so now some tweet ids are long strings and some are numbers and askjaskjlahklsjd they have an id and an id_str field and if you use the id field for tweets with id greater than 2^32 wacky things will happen: code:
|
# ? Nov 9, 2013 00:30 |
|
Mr Dog posted:the hell does that mean? comparing lisp and js is laughable bullshit from HN, and it gets debunked and laughed at every 100 pages or so i'm too lazy to copy/paste the last such attempt
|
# ? Nov 9, 2013 00:53 |
|
Opinion Haver posted:
|
# ? Nov 9, 2013 00:59 |
|
MononcQc posted:people really wanted to reuse the notoriously high-quality front-end javascript libraries into the back end. the position of my cursor meant i somehow read this as "the notoriously high-fatality front-end javascript libraries"
|
# ? Nov 9, 2013 01:06 |
|
coffeetable posted:the position of my cursor meant i somehow read this as "the notoriously high-fatality front-end javascript libraries" and yet we do not regret kickstarting our nodejs CAN-Bus controller for "the ultimate driving machine" brave hacker soldiers pushing the limits of automotive disruption
|
# ? Nov 9, 2013 01:11 |
|
Opinion Haver posted:
code:
|
# ? Nov 9, 2013 01:22 |
|
shrughes posted:destructor arguments let me show you why none of this idiotic poo poo is necessary bc the compiler does an amazing optimization job that goes way beyond just removing the pointer to the lockable object in your previous example (and bc this destructor parameter idea is really loving retarded) i compiled this using clang: code:
code:
but here's the generated assembly (w/o some noisy stuff and exception handling stuff which is irrelevant here): code:
Zlodo fucked around with this message at 01:36 on Nov 9, 2013 |
# ? Nov 9, 2013 01:27 |
|
jfc you dragged out one of the least interesting and contentious aspects of C++ and dragged it out into a gigantic page long spergfest gj
|
# ? Nov 9, 2013 01:36 |
|
Mr Dog posted:jfc you dragged out one of the least interesting and contentious aspects of C++ and dragged it out into a gigantic page long spergfest yw
|
# ? Nov 9, 2013 01:36 |
|
Zlodo posted:let me show you why none of this idiotic poo poo is necessary bc the compiler does an amazing optimization job that goes way beyond just removing the pointer to the lockable object in your previous example (and bc this destructor parameter idea is really loving retarded)
|
# ? Nov 9, 2013 01:40 |
|
Scaevolus posted:The fact that everything got inlined and useless variables eliminated in your trivial example is not representative of actual code. Tiny benchmarks often run into this problem: most of what they do is useless, so a sufficiently smart compiler will remove it entirely. it did call mutex::lock and mutex::unlock so the locking did take place
|
# ? Nov 9, 2013 01:57 |
|
shrughes posted:(Maybe when defining the class you could tell it how to map constructor arguments to destructor arguments, which would only be applicable in the case of creating/destroying local variables.)
|
# ? Nov 9, 2013 01:59 |
|
Scaevolus posted:Of course === won't say a String and a Number are equivalent. i meant to type == x.id_str and didn't notice, whoops
|
# ? Nov 9, 2013 02:02 |
|
Mr Dog posted:i really can't get over the fact that all javascript numbers are floating-point use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays quote:yes yes i know technically doubles have a 48-bit-ish mantissa so you can represent any 32-bit int precisely inside one but still that's just loving vile. everything's fine at smaller magnitudes but once your numbers get big enough they sort of just silently become mushy instead of having a well-defined overflow condition. as in comparsion to how other languages handle numeric overflow. quote:node.js seems like a more fashionable and more restricted lisp. given the psychological tendencies of the sort of people who are attracted to lisp it probably explains a lot. lol, it's nothing like a lisp, no-one writes mini-languages and semantic extensions at the same rate as lisp, or even ruby.
|
# ? Nov 9, 2013 02:07 |
|
Mr Dog posted:jfc you dragged out one of the least interesting and contentious aspects of C++ and dragged it out into a gigantic page long spergfest this is how C++ users establish dominance and compete for mates
|
# ? Nov 9, 2013 02:15 |
|
|
# ? Jun 11, 2024 06:14 |
|
MeruFM posted:i don't understand why node.js exists. The premise is sound, you have to pre-validate user input on the client in JavaScript because the Internets is slow, and you have to validate everything on the server because you cannot trust the client. Implementing the same checks twice is duplicate effort and increased chance of defects.
|
# ? Nov 9, 2013 02:17 |