I created a benchmark in C++ for testing and comparing TeaScript and its competitor ChaiScript by computing the Fibonacci number of 25 recursively. As a reference I did the same also in C++. The complete source code of the benchmark is available below. The result is pretty amazing, since with the used pre-release 0.8.0 of […]
Tag: C++
All about C++
TOP 5 most astounding C++20 Syntax
❆ Welcome 👋 to my 🎄🎅🎁 Christmas 🎄🎅🎁✨ Special✨ ❆☃! Today I present you my personal TOP 5 most astounding C++20 syntax constructs. Hope you will enjoy and maybe will see something new and/or interesting. Here it goes: No. 5: This line creates an empty lambda and directly executes it. Effectively, you can consider it […]
This post was viewed [wpstatistics stat=pagevisits time=total id=748] times. To use a classical union from C is almost always a bad idea in C++ and you should use std::variant instead. I show you why. And I also will show you in which big(!) trap I ran into myself with a union. We start with a […]
For rapid prototyping you don’t need to deal with cmake at all for can work in small groups or on different machines – the Visual Studio Property Sheets explained!
This post was viewed [wpstatistics stat=pagevisits time=total id=528] times. Following a list of my preferred and maybe (?) best Visual Studio settings for modern C++ programming based on my experience and evaluations. Each mentioned setting will be explained with some short sentences. I will cover “Release” Builds only – and I use Visual Studio 2022, […]
In this blog post you will not only learn about the repeat loop in TeaScript but also about what is a good and practical way to write UnitTests by increasing the difficulty of the tests in small steps. First let’s check how the repeat loop in TeaScript is defined:(I try to be close to this […]
C++ as a standalone script?
Since my early days as a C++ developer I wanted to use C++ code snippets as a standalone script file. Like just type the following C++20 code snippet (see my previous blog post) in a file and then execute it: But how can this be made possible?? Develop an interpreter which supports the complete set […]
Design by Introspection (C++20)
Some time ago I stumbled upon a very interesting (and for me new) technique named “Design by Introspection”, which is easily possible with the concept feature of C++20. This technique can be illustrated by the following small code snippet: First the parameter of the function value is of type auto, so it will be set […]