Words and Buttons: programming

Interactive explanations of non-trivial programming ideas.

Why is it ok to divide by 0.0?

This explains why the division by zero in floating point numbers is ok.

Bi-whatever transformations

An interactive explanation of how polynomial transformations such as trilinear or biquadratic or even linear-cubic work, and how to craft your own that fits your particular task the best.

Error codes are not numbers. But they are. Can we exploit that?

An interactive explanation of how we can use floating-point NaNs as error code holders in C++.

Challenge your performance intuition with nanosecond sorting

And yet another interactive quiz where you get to estimate the performance difference between several variants of the same code.

SymPy makes math fun again

An introduction into symbolic computations in Python. Don't worry, it's much simpler than it sounds. It's about making Python do your math for you with very little investment in the technology.

Using logical operators for logical operations is good

This is the follow-up for the former “Challenge your intuition with C++ operators” piece. It shows that despite the occasional gains from a better compilation, using the proper operators is still beneficial in the long run.

Challenge your performance intuition with C++ operators

Another interactive quiz where you get to estimate the performance difference between several variants of the same code.

Fortran is still a thing

A short essay about Fortran in the modern world.

Why Erlang is among the few true computer languages

Usually, a language is something that is used for bilateral communication. For programming languages, this is often untrue. Erlang shows how this can be achieved still.

If I were to invent a programming language for the 21st century

A short essay about the evolution of programming languages.

Cheap trick to speed up recursion in C++

More often than not, recursion is not your performance problem, to begin with. But even if it is, you can often avoid recursion altogether. When for some reason you can't, this trick helps.

Logic programming in C++

This shows that there is an invisible Prolog in every C++ compiler. It's up to you what to do with it but it's there.

Estimating floating point error the easy way

An interactive explanation of how to measure computational error while working with floating point numbers and why.

APL deserves its renaissance too

APL tutorial explaining the meaning of life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}

Playing a game of chance with C++ inline keyword

It's about one particular aspect of C++ compilation that makes programming with the “inline” into a game of chance.

How much math can you do in 10 lines of Python

An interactive introduction into concise Python / basic linear algebra.

Outperforming everything with anything

A 100 lines of Python code that substitute the compiler front-end for a specific computation. This shows that you don't need a “fast” compiling language to write efficient code. In fact, a compilation is only one of the multiple ways to achieve speed.

Vastly outperforming LAPACK with C++ metaprogramming

Still not really about LAPACK. It's a second part of “outperforming” series explaining how the C++ metaprogramming can appear useful for efficient code generation.

Outperforming LAPACK with C metaprogramming

Ok, it's not really about LAPACK. You can consider it a clickbait if you wish. It's about how to tell a compiler to write the code you want with a limited arsenal of tools the C language provides.

Can you tell an assembly language when you see one?

Interactive quiz featuring several obscure high-level languages and assembly variants.

You don't have to learn assembly to read disassembly

This is a very concise introduction to x86 disassembly. It shows that you probably have all the skills to start reading disassembly right now even if you thought it was too complicated for you. It really isn't, see it for yourself.

Challenge your performance intuition with C++ magic squares

Interactive quiz where you get to estimate the performance difference between several variants of the same code.

So you think you know C?

It's a C test. If you think you know C, take this test. It only has 5 questions.

Learn you a Lisp in 0 minutes

A short quiz to reveal your hidden knowledge of Lisp.