|
Scientist C codebase from multiple decades ago spelunking update:C code:
My advisor also said that the port (from 90s MinGW gcc to VS2013) has gotten him a 20x speedup (with the outputs still correct). I assumed better optimization, but that surprised me.
|
# ? Jun 25, 2015 18:56 |
|
|
# ? Apr 25, 2024 11:42 |
|
GrumpyDoctor posted:My advisor also said that the port (from 90s MinGW gcc to VS2013) has gotten him a 20x speedup (with the outputs still correct). I assumed better optimization, but that surprised me.
|
# ? Jun 25, 2015 19:53 |
|
GrumpyDoctor posted:Scientist C codebase from multiple decades ago spelunking update: That's a function definition and not just a declaration, so how the gently caress does that even work?
|
# ? Jun 25, 2015 20:59 |
|
mobby_6kl posted:That's a function definition and not just a declaration, so how the gently caress does that even work? https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html
|
# ? Jun 25, 2015 21:07 |
|
I've never seen the term "all hell breaks loose" in official, public documentation before.
|
# ? Jun 25, 2015 21:12 |
|
Isn't that pretty much just a lambda, though?
|
# ? Jun 25, 2015 22:26 |
|
The best bit is that when you're in the nested function, you can use a goto to jump to a label in the outer function
|
# ? Jun 25, 2015 23:18 |
|
NihilCredo posted:Isn't that pretty much just a lambda, though?
|
# ? Jun 25, 2015 23:23 |
|
Athas posted:There is nothing necessarily wrong with C++, as long as you have restraint and good taste. It is simply my experience that most physicists does not have the necessary software engineering experience to realise when they are using C++ to implement a simple and maintainable abstraction, and when they are conjuring some eldritch malevolent horror of the beyond. Using C++ to hackily emulate unit of measurement types is one good-intentioned cause that can easily go very wrong if one does not know when to stop. That sounds neat but have they considered just becoming Julia developers?
|
# ? Jun 25, 2015 23:54 |
|
QuarkJets posted:That sounds neat but have they considered just becoming Julia developers? People use python tho.
|
# ? Jun 26, 2015 00:36 |
|
fritz posted:People use python tho. Maybe you're a *neophyte* /insertmoreinsultingterms
|
# ? Jun 26, 2015 01:47 |
|
fritz posted:People use python tho. Yeah but this is aimed at people who don't already use Python, right? That's what the poster said. I mean between Python and Julia I personally prefer Python with the numba module for my supercomputing needs, but it sounds like Julia would be more up their alley
|
# ? Jun 26, 2015 05:48 |
|
Plorkyeran posted:The gross hacky part is that it can access upvalues from the containing scope without any sort of pointer to where that data is stored. A "normal" lamdba involves both a pointer to the function and some sort of attached state. By generating new functions at runtime and storing them on the executable stack, no less.
|
# ? Jun 26, 2015 06:03 |
|
QuarkJets posted:Yeah but this is aimed at people who don't already use Python, right? That's what the poster said. Python has more traction and Julia is younger. I agree Julia is better. I'm not a computational scientist myself (just a regular ol' computer scientist), but I enjoy watching the fray as a spectator.
|
# ? Jun 26, 2015 09:57 |
|
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 |
|
pre:25034 | 2015-06-25 | horrible_dev : changed font to arial scripts/js/dashboardJS.js | 509 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 10 files changed, 471 insertions(+), 72 deletions(-)
|
# ? Jun 26, 2015 19:26 |
|
IT BEGINS posted:
lol I can't check anything in in VS all of a sudden (a restart fixed it).
|
# ? Jun 26, 2015 19:39 |
|
feedmegin posted: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. Register allocation goes without saying coming off of x87. There are 8 stack locations that are only transferred to/from the integer registers one at a time. Compare that to a SSE4 gather op that can pull fp args from memory in a single macroinstruction. I'm starting to think 20x seems really slow, but granted that's with only machine intervention.
|
# ? Jun 26, 2015 20:00 |
|
Half of my coworkers still don't understand how to use rebase in mercurial. As a result, our repository log often looks like this:
|
# ? Jun 26, 2015 22:04 |
|
IT BEGINS posted:Half of my coworkers still don't understand how to use rebase in mercurial. As a result, our repository log often looks like this: I think it looks pretty
|
# ? Jun 26, 2015 22:09 |
|
IT BEGINS posted:Half of my coworkers still don't understand how to use rebase in mercurial. As a result, our repository log often looks like this: There's no reason to sperg about history.
|
# ? Jun 26, 2015 22:31 |
|
sarehu posted:There's no reason to sperg about history. What happens if you try to bisect on a tangled history like that? Serious question, I've never tried it, but it looks like it could get a bit weird.
|
# ? Jun 26, 2015 22:34 |
|
What would a "good" diagram look like?
|
# ? Jun 26, 2015 22:34 |
|
qntm posted:What would a "good" diagram look like? I think as long as there aren't dozens of 'Automated merge with upstream' in the history it's probably fine. I'm in favor of aggressively branching for features, but when you have multiple people adding one-line bugfixes every few minutes you often end up with a completely incomprehensible history.
|
# ? Jun 26, 2015 22:39 |
|
Soricidus posted:What happens if you try to bisect on a tangled history like that? Serious question, I've never tried it, but it looks like it could get a bit weird. It works great.
|
# ? Jun 26, 2015 22:44 |
|
IT BEGINS posted:Half of my coworkers still don't understand how to use rebase in mercurial. As a result, our repository log often looks like this: Maybe your coworkers know how to rebase and they just like to make pretty diagrams like this one
|
# ? Jun 26, 2015 23:18 |
|
I'm not sure what bisect does with that - linearly insert the merged changes into the history, or treat the merge as an atomic unit unless bisect lands on it? I actually write makefiles by hand. It keeps an upper-bound on the amount of complexity I'm willing to tolerate in my build system, because doing advanced things with make gets eyebleedingly painful really quickly. It's only a few dozen lines, and it handles building for two architectures in one checkout via per-arch build path. Then of course there's the classic X makefiles that were so complicated that it took a multi-year effort to make them parallelizable. Or the android make-based build system. How the gently caress did they make that so goddamned slow?
|
# ? Jun 28, 2015 21:19 |
|
Harik posted:I'm not sure what bisect does with that - linearly insert the merged changes into the history, or treat the merge as an atomic unit unless bisect lands on it? It treats it as the graph it is. The commit that broke things is in your "bad" commit's history and is not in any of your good commits' histories. git-bisect maintains a set of good commits and just one bad commit, and the next commit it picks is one that splits the set of commits that are in your bad commit's history and that are not in any of your good commits' histories into two appropriate parts.
|
# ? Jun 29, 2015 01:41 |
|
sarehu posted:It treats it as the graph it is. The commit that broke things is in your "bad" commit's history and is not in any of your good commits' histories. git-bisect maintains a set of good commits and just one bad commit, and the next commit it picks is one that splits the set of commits that are in your bad commit's history and that are not in any of your good commits' histories into two appropriate parts. That's a hell of a lot more straightforward than I thought it would be.
|
# ? Jun 30, 2015 01:19 |
|
AuxPriest posted:That's a hell of a lot more straightforward than I thought it would be. Well, so is the rest of git if you can find the right explanation. Git is (IMO) little more than a DAG of files and labels, at its core.
|
# ? Jun 30, 2015 02:07 |
|
I find it easier to think about git as a graph of changes, rather than a graph of files. For some reason that makes it more straightforward to reason about what merges will do, for example.
|
# ? Jun 30, 2015 02:18 |
|
Subjunctive posted:I find it easier to think about git as a graph of changes, rather than a graph of files. For some reason that makes it more straightforward to reason about what merges will do, for example. Git is a graph of repository state, not of repository changes. While its storage uses deltas, on a conceptual level git is not a graph of deltas, and this distinction is actually important precisely because it directly influences what merges will do. Git does snapshot version control while others (such as Mercurial) typically do changelog version control. Here's some links I dug up: http://stackoverflow.com/a/8198276 (concise, basically summarizes http://git-scm.com/book/en/v2/Getting-Started-Git-Basics#Snapshots,-Not-Differences, which it links to) http://stackoverflow.com/a/1599930 (see: Repository structure, storing revisions, ctrl-f changelog) https://github.com/schacon/git-presentations/blob/master/sor09/GitTalk-SOR09.pdf - some neat diagrams partway through this PDF
|
# ? Jun 30, 2015 04:56 |
|
Also relevant, to expand on how that conceptual difference affects merging: https://news.ycombinator.com/item?id=2456415 Git can do octopus merges, because the state is what matters, and delta compression just makes it smaller. Mercurial (for example) can't; merges can only have two parents, because the deltas matter.This means that git sacrifices the ability to resolve more complex merge scenarios. See: Understanding Darcs/Patch theory
|
# ? Jun 30, 2015 05:09 |
|
I actively look for places where an octopus merge would be useful just so I can say I did one, and I've never found one.
|
# ? Jun 30, 2015 05:41 |
|
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2cde51fbd0f3
|
# ? Jun 30, 2015 06:46 |
|
evensevenone posted:https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2cde51fbd0f3 http://marc.info/?l=linux-kernel&m=139033182525831
|
# ? Jun 30, 2015 06:49 |
|
The best line from that: Linus Torvalds posted:It's pulled, and it's fine, but there's clearly a balance between
|
# ? Jun 30, 2015 07:29 |
|
evensevenone posted:https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2cde51fbd0f3 The parents take more than one screen... For thread related content, I just remembered a make system horror I had to work with: https://rtime.felk.cvut.cz/omk/omk-manual.html It says that it is user friendly make alternative, which it kinda is, but the documentation is incomplete, it is a massive set of make macros and has quite a lot of implicit, undocumented behavior. On the other hand, compared to my experience with classic make/autotools, adding a new build target is absurdly easy and some of the implicit behavior really simplifies things.
|
# ? Jun 30, 2015 11:19 |
|
|
# ? Jun 30, 2015 21:05 |
|
|
# ? Apr 25, 2024 11:42 |
|
Here's the full article if you want more: http://www.gamasutra.com/view/feature/4111/dirty_coding_tricks.php
|
# ? Jun 30, 2015 21:22 |