|
Monkeyseesaw posted:We need a language where the only data type is a string and when you do non-string operations like arithmetic it converts it to some internal representation, does the bit shuffling, and returns the result as a string. All functions are simply extending the string type. SNOBOL was pretty much literally this. It's right there in the name, 'String Oriented Symbolic Language'.
|
# ¿ Nov 12, 2010 21:14 |
|
|
# ¿ Apr 28, 2024 01:41 |
|
Ryouga Inverse posted:This sounds great until you realize that it means you have to install Qt 3 and 4 side by side on any machine that you want to run Qt apps for an arbitrary amount of time, because there's always that one rear end in a top hat who wrote his poo poo for Qt 3 and then had the audacity to die or something. Qt is also good at not changing its API on a whim. Within a major version number, it remains forward compatible at a binary level (code compiled for Qt 4.2 will run with Qt 4.7). They only break things every few years with a new major version number. For open-source C++ libraries, that's pretty rare. I personally can't think of any Qt 3 apps still sitting around that I run, but I can imagine the scenario cropping up. That's life, basically, there's not a good alternative to having both sets of libraries sitting around.
|
# ¿ May 17, 2011 16:30 |
|
Null Pointer posted:IA-64 makes the compiler (or assembly programmer) responsible for almost everything, including instruction scheduling and data hazard resolution. The first Itanium chip was delayed for some years, in large part due to the fact that compilers turned out to be harder to write than the HP engineers thought. As far as I know the compilers still aren't very good. Not really. In theory the idea was that the Itanium chips could be very simple (and thus very highly clocked) because of this philosophy, but the instruction set architecture doesn't really reflect that. It's actually pretty complex, partly because it was a design by committee between Intel and HP (the latter wanting to provide good backwards compatibility with PA-RISC, their previous instruction set architecture). Bad compilers could have been forgiven a lot if the chips were like twice as fast as their competitors, but they weren't.
|
# ¿ Dec 22, 2011 18:36 |
|
dancavallaro posted:I'm going to have to go with troll. Even if you are operating under the misconception that objects are passed by reference, it still wouldn't be "arbitrary". No, I can see what he's saying, he's just explaining it badly. Basic types are passed by value. So are references to objects, but that means the object itself acts like it's pass by reference (the object isn't copied, the reference to it is). This is non-obvious in Java since pointers aren't explicit. It isn't arbitrary, of course, it's logical, but I think that's what he's getting at.
|
# ¿ Feb 15, 2012 17:41 |
|
haveblue posted:Yes, you can use the const keyword to make the compiler enforce that. But the function can use const_cast to make it modifiable again. It's basically silly to try and 'force' a C++ library not to do $thingyoudontlike like this. Trust the library not to do something you dislike, or write a new library.
|
# ¿ Feb 16, 2012 19:43 |
|
hobbesmaster posted:Sometimes its hard to tell if people are joking, but I've only ever seen XOR in my logic textbooks... it really doesn't matter but I have this twitch whenever I use ARM assembly. ARM is a British-designed ISA. We don't cotton to xtreme letterz as much as you lot
|
# ¿ Feb 19, 2012 17:55 |
|
Jabor posted:1's complement and sign-magnitude are the other two options. There were actual real computers using non-twos-complement maths around when C became a Thing - http://en.wikipedia.org/wiki/CDC_6000_series http://en.wikipedia.org/wiki/IBM_7090 for example. There might even be some still knocking around with modern C compilers, for all I know; it makes sense the C people wouldn't want to rule out the possibility.
|
# ¿ Feb 20, 2012 18:40 |
|
Optimus Prime Ribs posted:Everyone has their preferred way to write code. In the real world, whether open source or commercial, you'll generally be expected to conform to the existing style of any large body of code to which you contribute. Doing otherwise is aggressively antisocial. I suggest you get used to it.
|
# ¿ Mar 24, 2012 22:29 |
|
That Turkey Story posted:I think I still probably have some of the first code I've ever written on an old hard drive. I need to dig it up and post it at some point. I remember looking at it a couple of months after I'd written it and realizing how horrible and buggy and leaky it was. I can only imagine what I'd think of it now (over a decade later). Hard drive? My first code was on a zx spectrum's tape drive somewhere. Kids these days
|
# ¿ Jul 27, 2013 14:44 |
|
Freakus posted:Note that mysql's utf8 doesn't support 4 byte characters. If you want that you need to use utf8mb4. Hmm. How good are MySQL/other languages/environments with combining characters in Unicode? Turns out that some characters (for instance ancient Greek alpha with spiritus asper and acute accent) can't be represented in one Unicode codepoint at all ever. Seems like that'd trip some developers up
|
# ¿ Dec 27, 2013 21:16 |
|
TheFreshmanWIT posted:So here is an interesting defect that sorta plays into the UB discussion above. We write C++ code that runs on a few platforms, Win Desktop, WinRT, Android, and iOS. The result is we have a set of 'base' C++ code that compiles on every OS. One such component is an open source library that we've purchased a commerical (non GPL'ed) version of. Qt developer spotted?
|
# ¿ Feb 6, 2014 19:29 |
|
Dren posted:I thought they were on the stack. Generally speaking they're in a read-only section of the executable file (e.g. .rodata in ELF on Linux, .rdata in PE/COFF on Windows) that is mapped into the process's address space just like the executable code is. So definitely not on the stack, not technically on the heap either, guaranteed to stick around until the process/DLL is unloaded.
|
# ¿ Mar 13, 2014 19:07 |
|
Gazpacho posted:
For that to compile presumably there's a using namespace std; in there somewhere. Which is also horrible
|
# ¿ Mar 27, 2014 19:43 |
|
leper khan posted:if (!(foo > 0)) { Not sure I understand this one? (-1 is true in Calikes, remember, so this is 'do this if the value is 0 or negative', which seems fair enough)
|
# ¿ Mar 27, 2014 19:46 |
|
Zombywuf posted:Give it up, ADA is never going to be a thing outside the defence industry. Even there it's loosing ground: https://en.wikipedia.org/wiki/Lockheed_Martin_F-35_Lightning_II Ada is not an acronym...
|
# ¿ Apr 10, 2014 19:39 |
|
Munkeymon posted:Ada isn't the language that either compiles and runs or, if you have any error, says 'No' without any explanation, right? I'd really like to clear that up if I have it wrong. That's not a language thing, that's a 'my compiler is poo poo at reporting errors' thing. The language in no way mandates bad error reporting.
|
# ¿ Apr 10, 2014 20:18 |
|
QuarkJets posted:That's because the terminal that comes with OS X is garbage, whereas most Linux terminals are pretty good by default Aren't they all terminal emulators technically? A real terminal is, like, a VT220.
|
# ¿ May 11, 2014 14:57 |
|
Zopotantor posted:[1] Currently on 4.1 since we're still using RHEL 5. Our customers are very, very conservative and need serious arm-twisting to agree to OS updates. Feel lucky. We still have customers running RHEL 4. On a Pentium III.
|
# ¿ Jun 28, 2014 20:19 |
|
nielsm posted:Sorry, no. It's Japanese for "my way or the highway". Hence, you know, 'rails'. As in railroading. As in on a railway where you don't get to decide the direction you go in. It is sort of right there in the name.
|
# ¿ Aug 19, 2014 20:24 |
|
Dessert Rose posted:Fundamental to C-family languages. Well, except C. And, indeed, Java (to start with and the way they've shoehorned it in is pretty much an afterthought), Objective C, and even early C++.
|
# ¿ Aug 20, 2014 19:27 |
|
omeg posted:I've been looking over the leaked win2k (?) sources some time ago and the biggest horror is the GUI subsystem. It was literally COMPATIBILITY HACK one after another. And it didn't change much. win32k.sys (the kernel part of window/GUI manager) is still one of the most exploited Windows components. The fact that the window manager (and standard UI components, listboxes etc? I don't remember) is running in Ring 0 is a horror in itself. It's like if Unity and Gtk/Qt were kernel modules.
|
# ¿ Oct 2, 2014 19:05 |
|
JawnV6 posted:Can still invoke branching on some hardware. MSP430 sets it up as a case with fallthrough for anything between 1-7. For a variable it does an indirect jump. Edit: re-read the comment. I am a dumb. ICSC2_BDIV looks like a macro constant but presumably it's not (in which case it would have been a lot clearer if was something more like READ_ICSC2_BDIV() :/) feedmegin fucked around with this message at 18:47 on Oct 3, 2014 |
# ¿ Oct 3, 2014 18:45 |
|
Plorkyeran posted:Rust is the only one of those three that is a system language without GC. While ARC is a form of GC it is deterministic and predictable.
|
# ¿ Oct 5, 2014 15:33 |
|
b0lt posted:bzip2 is a decade old project that supports all sorts of awful platforms Even mainstream compilers have lacked 64-bit arithmetic in the not-super-distant past, which is why things like this exist - http://msdn.microsoft.com/en-gb/library/windows/desktop/aa383742(v=vs.85).aspx
|
# ¿ Oct 8, 2014 18:47 |
|
ctz posted:That struct was introduced in Windows 95 Service Release 2 (1996). I think that's distant past with respect to computing. Dude, the company I work for still supports our software on MicroVAXes. Don't underestimate how far legacy support can go.
|
# ¿ Oct 9, 2014 19:14 |
|
fritz posted:If the compiler puts debugging symbols in the binary, longer variable names will mean that it takes longer for the os to load the executable from disk and it adds to memory pressure Debug symbols go in separate sections of the executable (eg .debug_info) which are not loaded into RAM by the dynamic linker
|
# ¿ Oct 24, 2014 18:24 |
|
GrumpyDoctor posted:I guess I'm nervous about trusting not-required-by-standard C++ behavior that just happens to be implemented by all major compilers (which I didn't actually know, so that's cool). I imagine tail call elimination is only implemented with compiler optimisation turned on, and I'd be nervous about it always working in any case where it not working would suddenly blow up my stack. You are not guaranteed any particular optimisation that's not in the language standard after all.
|
# ¿ Nov 25, 2014 21:28 |
|
GrumpyDoctor posted:Right. But some languages do guarantee tail-call elimination; it's not an "optimization," it's the semantics of the language. Yes, which is why I phrased it the way I did. If you're doing Scheme, it's guaranteed by the language standard so you can rely on it. C++, not, so no.
|
# ¿ Nov 26, 2014 21:03 |
|
Blotto Skorzany posted:2-byte floats?! 16 bit floats are actually a common thing with GPUs, however.
|
# ¿ Dec 19, 2014 20:40 |
|
Uh, won't zeroing the stack until a page fault on a modern operating system basically just make the kernel allocate a poo poo-ton of RAM to the process until the stack hits the heap or the system runs out of RAM, whichever comes first? Generally there isn't a syscall or anything to extend the stack, it's something the kernel handles automagically. (And assuming a single-threaded process and 64 bits, the stack and the heap are likely to be a long way apart...)
|
# ¿ Dec 26, 2014 14:46 |
|
qntm posted:VERY CAREFULLY I assume everyone here has seen http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags by this point...
|
# ¿ Jan 6, 2015 19:46 |
|
TheresaJayne posted:NotOnMyOS (NOMOS)- this language will not run under any operating system as it classes them all as waste of space, uses hardware directly Otherwise known as embedded C?
|
# ¿ Jan 26, 2015 19:37 |
|
Suspicious Dish posted:Fortran? The language where everything is global and you can redefine a number literal with a SWAP procedure? Fortran, which doesn't traditionally have a pointer type, meaning you can assume that variable a isn't going to be modified by someone doing b = &a; *b = 42. For optimisation within a function this is way more important.
|
# ¿ Jan 27, 2015 19:44 |
|
LeftistMuslimObama posted:I guess what confuses me, though, is why there isn't a command that's just "Make a new process with this program/function and these arguments and then link it to me as a child". It seems like it would do the same thing as fork()+exec() with fewer lines of code, unless the lecturer for my class simply didn't explain the nuances well at all. There is, on some Unixen. Google posix_spawn.
|
# ¿ Feb 7, 2015 02:49 |
|
kitten smoothie posted:Older devices? Zawinski was blogging just a few months ago about lovely cheap Android "smart tv" boxes that all had the same MAC address burned into them. Seemed like a cheap way to run advertising on a TV screen except you can have only one Otherwise you need some kind of per unit step on the manufacturing floor to change the MAC and that costs money and you (the Chinese factory) can get away without it
|
# ¿ Mar 29, 2015 13:45 |
|
Volmarias posted:I can assure you that "refactoring" wouldn't have solved the issue, because despite looking simple on the surface, Kindle Reader is actually really complicated and has to deal with a bunch of older formats basically forever. He's not kidding, this is a code horror in itself. I wrote a Mobipocket (which is the format Kindle started out with) ereader for Android for fun, using Qt. Under the hood, Mobipocket is just one giant HTML 3.2 file (yes, that old) containing the text of the book, with GIFs the only allowable image type and that with a strict size restriction, stored in a series of LZ-encoded 4k buckets within an arcane archive format that originated on the Palm Pilot. There's some serious software archaeology in there. Kindle has a new totally different format that by all accounts is much better, but there are still zillions and zillions of books out there in the old format of course.
|
# ¿ Apr 13, 2015 18:52 |
|
Suspicious Dish posted:Wait, that means that if I attach a debugger to an existing process, the thread names won't be there? What the gently caress? I would assume you get a numeric thread ID.
|
# ¿ Apr 15, 2015 20:35 |
|
Suspicious Dish posted:For however bad X11 is, lmao at anybody thinking NeWS is any better. NeWS involved people writing custom PostScript scripts to shove inside a giant rear end display server, get access to the entire global namespace, even do filesystem and network operations. Not to mention that they added a way to load NeWS at runtime from an untrusted source. So you could just randomly pwn some machines on your network by sending them malicious PostScript scripts that were self-replicating and inserted them into your system at boot. That was a different time though, back in the mid-80s when telnet and rsh were considered just fine for example despite sending passwords in cleartext over the wire, everyone ran fingerd, etc, etc. Back in the days before ubiquitous internet access to everything people didn't generally worry so much about security.
|
# ¿ May 21, 2015 19:34 |
|
omeg posted:For those not familiar with winapi, it's basically initiating an asynchronous write (to a pipe) and then... just waiting for the completion. It can be replaced with a single synchronous WriteFile() call. Of course, the Linux/Unix-y way to do this is simply to call write() synchronously too, it's async i/o which would be weird and different
|
# ¿ Jun 9, 2015 14:35 |
|
|
# ¿ Apr 28, 2024 01:41 |
|
JawnV6 posted:I'd be curious to see what a peek at the disassembly revealed. Guessing the 90's gcc is using the x87 FP stack that a modern processor will dutifully execute much slower than an equivalent SSE-enabled flow. Probably better register allocation too - graph colouring was still under patent back then. And if he also went from 32 to 64 bit x86 then there's twice as many integer registers to play with as well, plus as mentioned SSE for floating point.
|
# ¿ Jun 26, 2015 13:15 |