HNHacker News
TopNewBestAskShowJobs

sclangdon

500 karma · joined June 11, 2012

submissionscomments
sclangdon··on How OpenGL works: software renderer in 500 lines of code
It turns out that Trenki implemented the OpenGL ES-CL 1.0 interface on top of his software renderer (link [1] above), which should serve as an even better example of how OpenGL (may) work.

http://www.trenki.net/content/view/39/48/

sclangdon··on How OpenGL works: software renderer in 500 lines of code
The struct vec takes a template parameter T, and it's constructor takes a different template parameter U. Therefore, you must specify both template directives when defining the constructor; one for the class type, and one for the constructor's argument.
sclangdon··on How OpenGL works: software renderer in 500 lines of code
This is great and so concise, but I'm surprised that the author didn't implement OpenGL's interface (obviously not all of it), if the goal is to show how OpenGL works.

Another good example of this is Trenki's software renderer for the GPX2[1], which implements a shader architecture if memory serves. I haven't looked at it for many years, but I remember it being a useful resource when learning this stuff.

Other useful resources are, of course, Michael Abrash's Graphics Programming Black Book[2] (despite it's age, is still a great read filled with useful information), and for a really deep dive into the graphic's pipeline, ryg's (of Farbrausch fame) A Trip Through the Graphics Pipeline[3].

[1] http://www.trenki.net/content/view/18/38/

[2] https://github.com/jagregory/abrash-black-book

[3] https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...

sclangdon··on Designing C# 7 [video]
I think he's talking about C++ templates.

https://en.wikipedia.org/wiki/Template_metaprogramming

sclangdon··on Ask HN: Do you find reading increasingly challenging?
I don't think it's because you're squeezed for time, but more that you're sense of time has changed.

You're probably used to extracting information you want in a very short period of time via sites like StackOverflow or Wikipedia or whatever. If you're like me, when you encounter something that isn't going to give you the gold quickly, you probably move on to something that will.

You're used to the quick turnaround, so when something takes longer it makes you feel like you're squeezed for time.

For example, I have plenty of physical programming books. A lot of the time I know that the answer I seek is in one of those books. Sometimes I even know which book and the location in that book. But guess what? I still go to StackOverflow first because it's quicker and someone will have already summarized the book. I'm so used to getting information quickly, that actually having to look for it is unthinkable. It _feels_ like I don't have enough time to read the book myself, but that's really not true at all.

sclangdon··on 2015 AIIDE Starcraft AI Competition – Report and Results
Slightly off-topic but I find the BWAPI more interesting than the AI aspects. Does anyone have any further reading regarding this kind of thing?
sclangdon··on Moving forward with work on the D language and foundation
It's location has meaning - it's right on the edge of the known lands.
sclangdon··on Who Says C is Simple? (2010)
> This points to a need for a new language that avoids these issues. I think Rust is the answer, but I would like to see more languages try to fill that gap--competition is healthy.

Programs written in C and C++ may have issues because the languages assume the programmer knows what they are doing. This assumption leads to some great solutions to hard problems because the programmer is essentially free to do what they want.

Of course, this assumption, as with most others, doesn't always hold true. This doesn't mean there is a problem with the language. The problem is with the programmer.

If you're going to write something like "return ({goto L; 0;}) && ({L: 5;});", no language is going to save you.

C and C++ are still used today, in part, because modern languages try to restrict the programmer. Rather than assume the programmer knows what they are doing, they assume the programmer is stupid and needs help to cross the road. By assuming stupidity, the restrictions modern languages put in place prohibit certain solutions and as such C and C++ will remain the go-to systems languages.

We do not need new languages. What we need is programmers who won't abuse the languages we already have.

sclangdon··on The Genetic Algorithm Explained
For those interested, here is Jori Liesenborgs' thesis, "Genetic algorithms for the non-parametric inversion of gravitational lenses".

http://research.edm.uhasselt.be/jori/phd/phdthesis_jori_web....

sclangdon··on How to get started with the LLVM C API
And as some of the comments on his blog point out, he uses C++ in a C style.

"If you insist on sticking to a conventional C style of C++ code, you’ll get conventional C-style problems" - Bjarne Stroustrup (http://www.informit.com/articles/article.aspx?p=2080042)

sclangdon··on Ask HN: A day in the life of a programmer?
My experience is very similar to that of Charles Bloom:

http://cbloomrants.blogspot.co.uk/2013/10/10-04-13-reality-o...

sclangdon··on A first-person engine in 265 lines of JS
And here is Farbrausch's repo, which includes the .kkrieger code along with a lot of other interesting stuff.

https://github.com/farbrausch/fr_public

sclangdon··on A Look at the Formula 1 Steering Wheel
And instead put touch-screen media centres, which aren't distracting at all...
sclangdon··on Linus on "acting professionally"
Making people do things against their will or fear punishment by death is not exactly the same thing is swearing at someone is it?

Anyone who works with Linus does so freely and can stop at any time they choose.

Furthermore, applying today's morale standards to civilizations thousands of years old doesn't strengthen your point as well as you think it does.

sclangdon··on The Vodafone repair process caught on video
I'm currently stuck with a Lumia 800 with a penchant for crashing thanks to Vodafone's "repair" service.

I explained in a written letter how the phone would crash at frequent intervals (especially when playing or recording video). Being a developer I even wrote the letter as I would write a bug report with steps on how to replicate the problem and what not.

They returned the phone to me with a standard letter saying how they fixed the phone by upgraded the OS to the latest version.

The OS was of course already updated to the latest version before I even sent it to them. They even tried ringing me on the broken phone I had sent them so I could explain what my problem was. I'm not sure how they thought I would answer it exactly...

I tried again and received the same response. Needless to say, my phone is still broken.

sclangdon··on If It Ain't Broke, Don't Fix It: Ancient Computers in Use Today
I used to work for EDS (now HP Enterprise Services) about 6 years ago sub-contracting for Xerox. Most of the systems they (Xerox) used for selling/maintenance (order processing, invoicing, etc) of printers were written in COBOL for the IBM System/360 mainframes (which I think were replaced by the System/Zs).
sclangdon··on Compile and Execute your favorite programming languages online
A good alternative for C++ is http://gcc.godbolt.org/ - especially if you're more interested in the assembly output of various compilers, rather than the output of the program.
sclangdon··on Dwarf Fortress: Ten hours with the most inscrutable video game of all time
Writing better mouse control isn't fun. If he were to start writing such things, I bet he'd either scrap them anyway or just get bored of writing DF all-together.

The "boring" tasks are purposefully programmed to the minimum requirement so he can spend more time on the interesting tasks, to ensure his motivation stays high.

Admittedly, he could just outsource the GUI stuff, but for better or worse, he clearly wants to keep the code close to his chest.

sclangdon··on The Beauty of Bresenham's Algorithm
Because while(1) evaluates to a constant, which can sometimes be a bug and thus, some compilers emit a warning.

http://msdn.microsoft.com/en-us/library/6t66728h%28v=vs.80%2...

http://stackoverflow.com/questions/3490823/why-msvc-generate...

← PreviousPage 4 of 4