Hand coded assembly beats intrinsics in speed and simplicity
20 9 comments 15 Sep 2015 17:03 u/skeeto (..) in v/programmingbad robot: "There are a lot of silly people out there, and each and every one of them has written a program that would like to visit your server."
6 0 comments 04 Aug 2015 14:57 u/skeeto (..) in v/programmingComment on: the big list of programming and computing subverses
1 02 Aug 2015 21:30 u/skeeto in v/programmingComment on: If I want to be more of a defensive programmer where do I start?
That's a large, complex topic, but since this is /v/programming here are a couple tips from a coding perspective:
-
Even if you don't use it, pay attention to what the OpenBSD project is doing. New techniques are born there and are first used there before adoption by other operating systems (W^X, ASLR, reallocarray and friends, entropy system call). The only problem is that they frequently pick awful names!
-
Learn how to exploit common software vulnerabilities (return oriented programming, stack smashing, integer overflows, buffer overflows, etc.). You'll learn what sorts of things to watch for in your own code. Imagine what sorts of inputs would put your program in a bad state, and protect it against those inputs.
Jump Threading: a compiler optimization that turns conditional into unconditional branches on certain paths at the expense of code size
19 5 comments 28 Jul 2015 21:27 u/skeeto (..) in v/programmingComment on: A very basic lossless audio codec using C
I haven't used this myself for anything and I view it as an educational project. On that other website, the author said, "Similar to WavPack, though worse than FLAC (FLAC uses joint channel coding which I haven't implemented yet)."
A very basic lossless audio codec using C
20 8 comments 25 Jul 2015 17:31 u/skeeto (..) in v/programmingComment on: Computer Programming to be renamed Googling Stackoverflow
Couldn't agree more. If you're frequently getting useful information from Stackoverflow, you're only performing at a very basic student level since you probably lack the fundamentals. When you're working productively on something more niche and more advanced, you'll more frequently find Stackoverflow frustrating due to missing answers, incomplete answers, incorrect answers, and badly-researched questions.
Comment on: I want to learn C
I'm a fan of Modern C. It's free, extremely precise in its language, and covers all the latest language features.
Comment on: Let's Quickly Play TIS 100 (assembly programming game)
2 19 Jul 2015 22:08 u/skeeto in v/programmingLet's Quickly Play TIS 100 (assembly programming game)
20 7 comments 19 Jul 2015 04:07 u/skeeto (..) in v/programmingVolatile: Almost Useless for Multi-Threaded Programming
2 2 comments 14 Jul 2015 17:06 u/skeeto (..) in v/programmingComment on: pusher.exe: "I was curious how 60 maps fitted into such a tiny executable."
Yeah, .kkrieger is an amazing feat.
pusher.exe: "I was curious how 60 maps fitted into such a tiny executable."
18 8 comments 09 Jul 2015 20:48 u/skeeto (..) in v/programmingA proof by construction that the Intel MMU's fault handling mechanism is Turing complete.
6 1 comment 08 Jul 2015 20:12 u/skeeto (..) in v/programmingComment on: Why this sub sucked on Reddit and how to make it not suck here
I've avoided /r/programming for years because it can often be needlessly hostile, especially when presented with the controversial or unconventional. "Why would anyone want to do this?" or "You know you can do XYZ instead, right?" They'll pick at the slightest inaccuracy in a post and dismiss the whole thing. Instead I've stuck to smaller communities of the same topic, like /r/coding or the language-specific subreddits, and now /v/programming.
Personally I'd prefer a ban on obvious homework questions. Some subreddits get drowned in that noise (example: /r/matlab) and I end up unsubscribing to avoid it. But maybe that's not the right choice for a catch-all name like /v/programming.
Comment on: The Decline of StackOverflow
Seems to mirror reddit in some ways, particularly the authoritarian moderatorship.
Comment on: Fast as C: How to write really terrible Java
C++ is in a rather unique position that its abstractions tend to boil away to nothing by being fully realized at compile-time.
Comment on: Are idle games easy to code?
What do you mean by "idle games"? Turn based? Casual games?
The Spacing of Binary Floating-Point Numbers
5 0 comments 27 Jun 2015 20:27 u/skeeto (..) in v/programmingComment on: A GPU Approach to Conway's Game of Life
It's definitely wrong about requiring an RGBA buffer format. Just use the base format RED, unsigned integer, 8-bit so that only the first channel is used.
On WebGL this would make the framebuffer attachment incomplete and it wouldn't be allowed as a render target. That's where the "must be RGBA" comes from when implemented in WebGL.
A GPU Approach to Conway's Game of Life
11 3 comments 25 Jun 2015 14:27 u/skeeto (..) in v/programmingComment on: A GPU Approach to Path Finding
The difference is that the breadth-first horizon is searched in parallel, exploiting the GPU's architecture, rather than pushed out one square at a time as a CPU would normally do it.
What a C programmer should know about memory
27 11 comments 24 Jun 2015 19:50 u/skeeto (..) in v/programmingHandmade Hero: an ongoing project to create a complete, professional-quality game accompanied by videos that explain every single line of its source code.
15 1 comment 24 Jun 2015 19:49 u/skeeto (..) in v/programmingComment on: No Code of Conduct
What's your advice to open source developers being targeted by these people?
Comment on: Anybody own a Raspberry Pi? Care to share any cool projects you've done on it?
Mine is primarily a low-powered BitTorrent (transmission-daemon) server and network file server, but I occasionally also use it to test some of my code out on ARM.
Comment on: A GPU Approach to Path Finding
GPUs get their parallelism via SIMD: a single instruction operating on an array of many elements all at once. If a kernel/shader branches a lot, so that pieces of data must be acted upon individually, the GPU can't parallelize the work effectively. For example, Dijkstra's algorithm is queue oriented and isn't really amenable to parallel operation and a different approach must be taken to map the problem onto the target hardware.
making security sausage: "Security may be a process, not a product, but security patches are definitely a product."
3 0 comments 23 Jun 2015 02:45 u/skeeto (..) in v/programmingComparison of C/POSIX standard library implementations for Linux
21 5 comments 20 Jun 2015 17:22 u/skeeto (..) in v/programmingARM Processor - Sowing the Seeds of Success
1 0 comments 20 Jun 2015 17:21 u/skeeto (..) in v/programmingComment on: C Plus Equality (C+=), a feminist programming language
The project itself was banned from GitHub, where it was originally hosted.
Comment on: Nobody cares about your code
Hey, Mortoray came to Voat! It's nice to have familiar faces appearing around here.
Transparent Huge Pages and Alternative Memory Allocators: A Cautionary Tale
2 0 comments 15 Jun 2015 20:51 u/skeeto (..) in v/programmingComment on: Subversion Best Practices
Best practice today is to immediately begin migrating to a more recent generation of source control. Subversion is just an artifact of an intermediate learning stage.
Comment on: What do you think is the best programming style?
For C I stick to K&R but put function names on their own line apart from the return type.
Auditing GitHub users' SSH key quality
9 0 comments 02 Jun 2015 22:50 u/skeeto (..) in v/programmingComment on: Learning C with gdb
GDB has a massive number of features. Learning it all takes years. I only wish there was a really solid front-end GUI to GDB to make it easier to use in the general case. The existing ones don't really cut it yet, though Emacs gdb front-end isn't too bad.
Part of the difficulty is striking the balance between new user friendliness and power user friendliness. Both are important, the former for growing a community and bringing in new users, and the latter so that the program is useful for complex production tasks. These two goals are often at odds with each other.