|
That doesn't answer my question
|
# ? Feb 14, 2017 00:39 |
|
|
# ? May 28, 2024 16:03 |
|
canis minor posted:You can write goto in anything, even in JS! Also this got me searching. I was unaware that javascript has labeled breaks and continues for loops.
|
# ? Feb 14, 2017 00:55 |
|
Because literally nobody uses them. They are one of the more braindead additions and that's saying a lot.
|
# ? Feb 14, 2017 01:02 |
|
Hammerite posted:after two hours trying to work out why icons aren't appearing in a dropdown list: lol, gently caress MFC What are you doing that requires MFC? I hope it's legacy, and not new.
|
# ? Feb 14, 2017 01:23 |
|
Beef posted:Calm down, I'm not saying that for dick-waving purposes. Beef posted:I honestly have no idea what CRSB/RRSB is, no. Beef posted:In the context of this reply to Sahero's post: rjmccall posted:We compiler folk know about it, but we are a willsome and belligerent people, best avoided.
|
# ? Feb 14, 2017 01:44 |
|
All you bare-metal motherfuckers both fascinate and terrify me.
|
# ? Feb 14, 2017 04:45 |
|
JawnV6 posted:Who even cares about PIC anyway. Just put the code at the same place. Libraries are a disease on the soul. If you want something done right, you should do it yourself. DaTroof posted:All you bare-metal motherfuckers both fascinate and terrify me. Are you calling me a node.js programmer????!!!
|
# ? Feb 14, 2017 06:37 |
|
DaTroof posted:All you bare-metal motherfuckers both fascinate and terrify me. Writing your own kernel from the ground up is an incredibly enlightening journey. Holy gently caress the x86 architecture is a mess.
|
# ? Feb 14, 2017 06:43 |
|
DaTroof posted:All you bare-metal motherfuckers both fascinate and terrify me. Play with an ARM processor. Buy one of the m0 arduinos or something. Then go look at the equivalent stuff in x86 in awe. It's amazing x86 continues to get faster instead of being some forgotten dinosaur of the 80s. The "micro architecture" level is dark magic.
|
# ? Feb 14, 2017 06:48 |
|
A friend of mine made this: https://github.com/monodop/jInquery
|
# ? Feb 14, 2017 07:21 |
|
rjmccall posted:
We need a word for one of those laughs where you're both really amused and terrified of the possible reality. That's me right now.
|
# ? Feb 14, 2017 07:38 |
|
JawnV6 posted:You, apparently, were a huge stickler for proper nomenclature in the very post I quoted and this is some quick backpedaling on a very specific term. Not backpedaling, I quite literally work on micro-architectures: performance modeling and simulation, reporting to the hardware engineers and system designers. I'm still a software guy, but not a system programmer. Why are you so passionate about calling me out? Beef fucked around with this message at 09:56 on Feb 14, 2017 |
# ? Feb 14, 2017 09:03 |
|
JawnV6 posted:It's the only way on x86 to retrieve the current PC architecturally. Yeah I'm actually aware of all of that except why it's happening enough to require optimizing. I think the only place I've seen it is in bootloaders and code that does some 'tricky' stuff. Actually I guess I can't remember how it works but I assumed there was some reasonable way that it would reset at some cost. I mean, does a call 0, pop rax just get turned into reading right from rip? dougdrums fucked around with this message at 09:51 on Feb 14, 2017 |
# ? Feb 14, 2017 09:35 |
|
Beef posted:Yeah, programming has nothing to do with computer science, nice. I have a master in computer science, and even though recursive functions and recursive datastructures was only a part of one course during the first semester, I have to say that I have never come across your definition. Neither during my education nor the 5 years I have been working as a developer. Jarl fucked around with this message at 10:15 on Feb 14, 2017 |
# ? Feb 14, 2017 10:07 |
|
Beef posted:I think you're confusing things here. Only tail-recursive functions can be rewritten to not have recursion. Try writing a BFS/DFS without using a queue or stack. Here you go, a parallel BFS that runs in space linear to the input size: https://github.com/HIPERFIT/futhark-benchmarks/blob/master/rodinia/bfs/bfs_parallel_segmented.fut No recursion, although you could write the convergence loop as a tail-recursive function I guess.
|
# ? Feb 14, 2017 10:36 |
|
Beef posted:Goto discussion and no one mentioned Linus? quote:If I compile with -Wall (enable all warnings), neither GCC 4.8.2 or Clang 3.3 from Xcode make a peep about the dead code. That's surprising to me. A better warning could have stopped this but perhaps the false positive rate is too high over real codebases? (Thanks to Peter Nelson for pointing out the Clang does have -Wunreachable-code to warn about this, but it's not in -Wall.) Sounds like they need to take a leaf out of PHP's book and add a -Wactually-all, haha
|
# ? Feb 14, 2017 10:39 |
|
Pixelboy posted:What are you doing that requires MFC? I hope it's legacy, and not new. We are adding new functionality to an existing application which is implemented entirely in C++ using MFC
|
# ? Feb 14, 2017 10:40 |
|
Jarl posted:I have a master in computer science, and even though recursive functions and recursive datastructures was only a part of one course during the first semester, I have to say that I have never come across your definition. Holy poo poo this keeps dragging on and I keep getting sucked in. What textbook did that course use? I was a TA for few years for such a first-year course, we were using the SICP book which has been quoted a few times now. Programming in Scheme, students are made painfully aware what the difference is between a recursive process vs. recursion in syntax. As a second year course on language runtime implementation, we used both a stack- and register- based interpreter implementations, where the difference is very obvious. The register-based implementation follows the C-stack, using recursive eval/apply (setjmp/longjmp call/cc, loving nightmare). The stack-based implementation was a while(true) loop with explicit stack management (super-easy call/cc). For the latter case, I cannot understand why you would say "Well, there are no self-referential functions here, so it's not recursive".
|
# ? Feb 14, 2017 10:44 |
|
Hammerite posted:Sounds like they need to take a leaf out of PHP's book and add a -Wactually-all, haha It's called -Weverything
|
# ? Feb 14, 2017 10:45 |
|
Beef posted:Holy poo poo this keeps dragging on and I keep getting sucked in. Since I studied CS and not computer engineering I only had one course on the hardware level about assembler, microcode and how the CPU actually works. Might explain why we weren't taught about the term "recursive process", and how it differentiate from when we normally do recursion. I have heard about recursion versus iteration; not recursion A vs recursion B: https://en.wikipedia.org/wiki/Recursion_(computer_science)#Recursion_versus_iteration Jarl fucked around with this message at 12:23 on Feb 14, 2017 |
# ? Feb 14, 2017 10:59 |
|
Hammerite posted:We are adding new functionality to an existing application which is implemented entirely in C++ using MFC lol there is a division at our company that has a legacy c++ client and they totally gave up on actually writing new C++ and just write all the new UI in javascript, host it in strategically placed web browser controls.... and run a motherfucking web server locally on the client machine for communication between the new code and the old code (as opposed to like, using connection sink for interop)
|
# ? Feb 14, 2017 11:10 |
|
Hammerite posted:Sounds like they need to take a leaf out of PHP's book and add a -Wactually-all, haha PHP had an E_ALL error-reporting level which did not actually report all of the errors. However, PHP eventually fixed that.
|
# ? Feb 14, 2017 11:12 |
|
Athas posted:Here you go, a parallel BFS that runs in space linear to the input size: https://github.com/HIPERFIT/futhark-benchmarks/blob/master/rodinia/bfs/bfs_parallel_segmented.fut I haven't heard of the language, it looks interesting. Is it a coincidence that it looks like SISAL? From what I can gather, it uses a map/mask of visited notes that it updates between each step. Instead of pushing your to-visit children on a queue, you are allocating a full array of all nodes to track the same thing. How is this suddenly not a recursive process anymore: - check work to do, finish if none left - process work, push new work (or mark, in above example) - do the same thing again It's just like the doubly-linked list example from earlier, you are trading off dynamic space for static space.
|
# ? Feb 14, 2017 11:18 |
|
Beef posted:I haven't heard of the language, it looks interesting. Is it a coincidence that it looks like SISAL? Kind of; it looks like an SML/Haskell hybrid, which hail back to SASL. I think SISAL does the same. Beef posted:From what I can gather, it uses a map/mask of visited notes that it updates between each step. Instead of pushing your to-visit children on a queue, you are allocating a full array of all nodes to track the same thing. How is this suddenly not a recursive process anymore: Recursion is a general enough concept to model just about anything. In the program above, the operational behaviour is not much like recursion (up-front allocation and linear space), and recursion is also not a good way to explain how the program behaves. It can be seen as a bunch of parallel recursive processes that are each (simultaneously) advanced by one evaluation step for every iteration of the outer loop. But really, is that a useful explanation? I don't think so - there are simpler ones (like the one you give). I would definitely explain this as an iterative algorithm. The convergence criterion is also a global property, which means that the usual definition of recursion as splitting a problem into smaller subproblems doesn't apply, as we repeatedly need a global view of the entire state of the computation.
|
# ? Feb 14, 2017 11:32 |
|
Beef posted:- you are still allocating/using memory linear to the call depth, That non-tail recursive functions remain recursive is not news to me. And that an explicit auxiliary stack doesn't change anything since every "frame" in the stack match a call. Although, the term "procedure recursive" was new. But how is working over a FIFO queue with an algorithm like an iterative-BFS recursive? Jarl fucked around with this message at 12:39 on Feb 14, 2017 |
# ? Feb 14, 2017 12:34 |
|
Jarl posted:That non-tail recursive functions remain recursive is not news to me. And that an explicit auxiliary stack doesn't change anything since every "frame" in the stack match a call. Although, the term "procedure recursive" was new. Good, that was how this discussion started. I hope we can get back to comedy coding horrors now. Jarl posted:But how is working over a FIFO queue with an algorithm like an iterative-BFS recursive? If it holds for DFS, why would it not hold for BFS by simply changing the stack into a queue?
|
# ? Feb 14, 2017 13:47 |
|
Captain Capacitor posted:We need a word for one of those laughs where you're both really amused and terrified of the possible reality. That's me right now. is close
|
# ? Feb 14, 2017 13:59 |
|
Beef posted:Good, that was how this discussion started. I hope we can get back to comedy coding horrors now. That's on me. I didn't read carefully enough. But I think what threw me off to begin with was that iterative-BFS was recursive. Beef posted:If it holds for DFS, why would it not hold for BFS by simply changing the stack into a queue? Well, you are not unwinding/popping your stack but taking elements from the other end. Also, every call can create multiple elements. To me (and I must admit I've never even considered this before) for something to be recursive in nature (not syntactical) it must create element for every "call" being build upon the last one. The only way the previous element can affect the new element is at creation, and any next element can only affect this new element are when they are done (there can be multiple "next" elements with each their own "next" elements). The fact you are allocating/using memory linear to the call depth does not seem enough to me, and I'm pretty sure I would confuse most people using the word recursive when this alone is the case.
|
# ? Feb 14, 2017 14:12 |
|
Bruegels Fuckbooks posted:lol there is a division at our company that has a legacy c++ client and they totally gave up on actually writing new C++ and just write all the new UI in javascript, host it in strategically placed web browser controls.... and run a motherfucking web server locally on the client machine for communication between the new code and the old code (as opposed to like, using connection sink for interop) MFC can be a pain in the rear end sometimes but that seems like quite some lengths to go to avoid it. We develop new applications in .NET, but we have a handful of older stuff that's C++ that we support and occasionally extend (for our sins).
|
# ? Feb 14, 2017 14:53 |
|
Jarl posted:To me (and I must admit I've never even considered this before) for something to be recursive in nature (not syntactical) it must create element for every "call" being build upon the last one. The only way the previous element can affect the new element is at creation, and any next element can only affect this new element are when they are done (there can be multiple "next" elements with each their own "next" elements). Absolutely, you have the best words Just looking at memory use is indeed not sufficient to call something recursion, it is rather a consequence of recursion.
|
# ? Feb 14, 2017 16:08 |
|
Some of you really get off on correcting people
|
# ? Feb 14, 2017 16:12 |
|
And here I thought Beef was talking about primitive recursive functions or μ-recursive or something like that.
|
# ? Feb 14, 2017 16:40 |
|
Recursive is when you try to remember all the stuff you were taught in the first grade about handwriting.
|
# ? Feb 14, 2017 16:51 |
|
Beef posted:Not backpedaling, I quite literally work on micro-architectures: performance modeling and simulation, reporting to the hardware engineers and system designers. I'm still a software guy, but not a system programmer. So when you try to make sweeping proclamations like this hot garbage: Beef posted:Your computer is not aware of any stacks, heaps or function calls, this is a convention used by compiler/runtimes. Also, there is just as much stack available as there is heap, they grow towards eachother: stack grows down, heap grows up. Also, last time we talked your heap had 100% overhead. So there isn't "just as much" stack. dougdrums posted:Yeah I'm actually aware of all of that except why it's happening enough to require optimizing. I think the only place I've seen it is in bootloaders and code that does some 'tricky' stuff. It isn't actually "turned into reading right from rip" because an interrupt could still hit right after the call retires. If an assembly programmer could sit there and see that interrupts were oddly blocked out between those two instructions, it would violate the abstraction. Also memory is changed, if the chip got too clever and tried to skip that bit it would cause other issues. Now that I say that, I'm not really sure if you can get an interrupt in the middle of a macro-fused pair of instructions. Gosh, if only there were a micro-architect around to help!
|
# ? Feb 14, 2017 20:09 |
|
To determine the version of the code deployed on any application environment, you need to look at the source, and examine the filename of the bundle. The bundle will contain a 7 character git hash, which corresponds to a component version.
|
# ? Feb 14, 2017 20:16 |
|
JawnV6 posted:Now that I say that, I'm not really sure if you can get an interrupt in the middle of a macro-fused pair of instructions. Gosh, if only there were a micro-architect around to help! I just skimmed through the simulator, and as near as I can tell, the Core microarchitecture never interrupts in between macro-fused ops. External interrupts are not guaranteed to arrive at the end of any particular instruction, just at the end of some instruction (or at a few other points, e.g. sync points within rep movs), so an external interrupt is simply deferred to the end of the pair. There are a few architecturally-visible interrupts (in/out instructions, disabling/enabling interrupts, hardware breakpoints) that could in theory happen on the first macro-op of a pair, but we take care to simply not fuse ops that are vulnerable to those. Signed, a microarchitect.
|
# ? Feb 14, 2017 21:16 |
|
ShoulderDaemon posted:I just skimmed through the simulator, and as near as I can tell, the Core microarchitecture never interrupts in between macro-fused ops. External interrupts are not guaranteed to arrive at the end of any particular instruction, just at the end of some instruction (or at a few other points, e.g. sync points within rep movs), so an external interrupt is simply deferred to the end of the pair. There are a few architecturally-visible interrupts (in/out instructions, disabling/enabling interrupts, hardware breakpoints) that could in theory happen on the first macro-op of a pair, but we take care to simply not fuse ops that are vulnerable to those. There's no good way to fuse up a zero-length call though. The STA/STD pair required for the call's implicit push getting fused and not offering an instruction boundary between them, if the implicit stack location had to be paged in just to be marked dirty, etc. Too much going on there.
|
# ? Feb 14, 2017 21:40 |
|
ROFLburger posted:Some of you really get off on correcting people To be fair, this thread is basically one giant "Look at this jerk, doing it wrong!" Just, usually we don't get pointed at each other.
|
# ? Feb 14, 2017 21:49 |
|
TooMuchAbstraction posted:To be fair, this thread is basically one giant "Look at this jerk, doing it wrong!" Just, usually we don't get pointed at each other. I'm treating this thread as a learning exercise. Also, as a gentle consolation, that even if I'm doing something wrong, I'm doing it wrong to a lesser extent than some examples shown.
|
# ? Feb 14, 2017 21:56 |
|
|
# ? May 28, 2024 16:03 |
|
JawnV6 posted:There's no good way to fuse up a zero-length call though. The STA/STD pair required for the call's implicit push getting fused and not offering an instruction boundary between them, if the implicit stack location had to be paged in just to be marked dirty, etc. Too much going on there. There's no need to actually fuse the ops, you only need the call to not affect the return-address predictor, which is simple enough to do without actually emitting the operations together. Honestly, you could probably do that without even considering the following instruction — zero-offset calls never happen in real code, and who gives a poo poo if someone manages to find a contrived use for one and it has terrible performance? You also want to forward the store, but that doesn't need fusion to work either.
|
# ? Feb 14, 2017 21:56 |