We are proud to announce Buckaroo v2.0.0!
Buckaroo has been re-architected to accommodate the lessons learned from v1.x, incorporate your feedback and close more than 85 issues in the process.
We also removed 17k lines of Java code and replaced it with 8k of F#! 🙌
Here are the key points…
You can now treat Git branches & tags as versions too!
Thanks to our locking mechanism, we ensure that the installation is reproducible even if the branch or tag is updated. When you are ready to move to the next version, just do
Upgrade Bot and Patch…
Many people look at the Coroutines TS and wonder, what is all of the fuss about?
This article gives you one motivating example where lazy sequences enable you to seperate your concerns and maximize code reuse without increasing complexity.
Every Math student knows how to approximate the golden ratio via the Fibonacci series:
fib(n+1) / fib(n) -> φ = 1.6180…
Or using C++…
golden computes the golden ratio to a given approximation. On each iteration we get a little bit closer to the golden ratio, and the function returns once we are close enough.
This was straightforward…
Make is a conceptually simple build-system, and it is packaged with major Linux distributions. However, Make should rarely be your build-system of choice when starting a new C++ project.
That’s a bold claim, so here’s why…
The dependency graph of a C++ library is actually quite complex. It must be rebuilt every time a linked object-file changes… But an object-file should be rebuilt every time its translation-unit changes, or the compilation flags change, or if any of its included headers change, or if the compiler changes…
You can query this information using the compiler and encode all of this in…
C++ has evolved massively in recent years and yet it is still perceived by many as the language that it was back in the early 2000s. Let’s dispel some myths…
C++ is actually growing! Even as computers becomes faster, our demands of what we want to do with them are always increasing. C++ is one of the few languages that allows us to maximize the potential of our hardware.
Stroustrup’s talk from CPP Con shows C++ on a growth trajectory.
With the new
auto keyword and lambda syntax, C++ can be correct, fast and concise.
For example, compare these…
Lazy sequences are an idea that’s very popular in the functional-programming community, but less common in the C++ world.
Simply put, a lazy sequence is one where the elements are computed as they are requested, rather than in advance.
This can lead to big efficiency gains since you only perform the computation required. It also allows you to represent infinite sequences, which of course could never fit into a vector!
Let’s see how Conduit works with some simple examples…
Everyone is familiar with square…
An integral part of any build-system is to detect what has changed and what needs to be rebuilt.
There are two approaches common approaches to this:
Hash-based build-systems only rebuild an artefact if the hash of any of its input files have changed. …
Most people have a love-hate relationship with precompiled headers (PCH). On the one hand, they can dramatically accelerate your build-times from scratch (30% is not unheard of), but on the other hand, they can have devastating effects on your incremental build-times.
Once in use, precompiled headers must be updated every time an included header changes. Now, every translation-unit that uses the PCH will also need to be recompiled, which may be far more often than necessary. PCHs effectively make every translation-unit depend on every header file in the PCH.
However, with Buck you can have the best of both worlds…
Is your C++ build slow or unintelligible? We are currently looking for more case studies. If you are interested in improving your Linux-based build (commercial or open-source), please get in touch!
The C++ community is fragmented due to the variety of build-systems used. This fragmentation makes it difficult to:
For the C++ community this means:
In C++, nothing prevents the programmer from including a header-file multiple times. This can cause a duplication of definitions, which is an error. Since it is difficult to ensure that a header-file is only included once, a common strategy is to make only the first include count. This can be done using an “include guard”, a small piece of preprocessor logic that looks like this:
On the first include,
HEADER_HAS_BEEN_INCLUDED is not defined, so we define
foo. On subsequent includes,
HEADER_HAS_BEEN_INCLUDED has been defined, so we just skip the content.
For example, if we have this C++ file:
Use Buck to generate a single-include header file for your library. This provides your users with an option for rapid development, which can be optimized later. Take a look at a working example on GitHub.
A common pattern in C++ libraries is to provide a header file that includes all of the other header files in that library.
For example, suppose we have a library with these headers:
To use the library, we need to include each header file that we require:
Alternatively, the library designer can provide a single-include header that does all of this for us: