Topics /

Software Engineering

The most popular blog posts about software engineering on Hacker News. 1,274 posts.

2018
1115

Revisiting 'Monadic Parsing in Haskell'

‘Monadic Parsing in Haskell’ is a short paper that laid the groundwork for libraries like Parsec and Attoparsec. Although it was published in 1998 (almost 20 years ago!) it has aged gracefully and the code samples will run with almost no changes. However, the state of the art has advanced since then and I think the…

1119

How Old School C Programmers Process Arguments

Here’s a bit of code from Kernighan’s and Ritchie’s seminal text, The C Programming Language . I’m not sure I’d actually recommend coding this way (as written in the book, the entire program has only one comment), but it’s so darn clever and concise, I can’t help but post it. This snippet is part of a larger program…

1120

When the Compiler Bites

So far this year I’ve been bitten three times by compiler edge cases in GCC and Clang, each time catching me totally by surprise. Two were caused by historical artifacts, where an ambiguous specification lead to diverging implementations. The third was a compiler optimization being far more clever than I expected…

1123

Basics of Futexes

The futex (short for "Fast userspace mutex") mechanism was proposed by Linux contributors from IBM in 2002 [1] ; it was integrated into the kernel in late 2003. The main idea is to enable a more efficient way for userspace code to synchronize multiple threads, with minimal kernel involvement.

1126

A Basic Just-In-Time Compiler (2015)

Monday’s /r/dailyprogrammer challenge was to write a program to read a recurrence relation definition and, through interpretation, iterate it to some number of terms. It’s given an initial term ( u(0) ) and a sequence of operations, f , to apply to the previous term ( u(n + 1) = f(u(n)) ) to compute the next term…

1130

What is Software Engineering?

Nearly all of Go’s distinctive design decisions were aimed at making software engineering simpler and easier. We’ve said this often. The canonical reference is Rob Pike’s 2012 article, “ Go at Google: Language Design in the Service of Software Engineering .” But what is software engineering?

1134

Sum Types Are Coming (2015)

Just as all mainstream languages now have lambda functions, I predict sum types are the next construct to spread outward from the typed functional programming community to the mainstream. Sum types are very useful, and after living with them in Haskell for a while, I miss them deeply when using languages without them…

1136

The Value of Undefined Behavior

In several places, the C and C++ language specifications use a curious, and fairly controversial, phrase: undefined behavior . For certain program constructs, the specification prescribes no specific behavior, instead allowing anything to happen . Such constructs are considered erroneous, and so the result depends on…

1137

Rationale: Or why am I bothering to rewrite nanomsg?

I became involved in the nanomsg community back in 2014, when I wrote mangos as a pure Go implementation of the wire protocols behind nanomsg . I did that work because I was dissatisfied with the ZeroMQ licensing model and the C++ baggage that came with it. I also needed something that would work with Go on illumos …