C# Span versus aux::slice

The Span<T> has landed in .NET Standard today. According to the article (Span<T> is) at the heart of most performance-related improvements in .NET Core 2.1. Since it allows managing buffers in a more efficient way, it can help in reducing allocations and copying. We consider Span to be a very fundamental type as it requires…

#include source “foo.c”, why not?

If we would have #include source construct that includes compilation units into final assembly (rather than just headers in-place) any library can be included to a project as plain .c file:

Sciter UI, basic principles. Calling code behind UI from worker threads.

I’ve updated the SDK with new sample: /sdk/demos/ui-framework . This sample demonstrates principles outlined in “Sciter UI, application architecture” article. In particular it demonstrates definition of native function (view.execTask() -> window::exec_task()) and call of UI methods (callbacks in this sample) from worker threads. I’ve explained idea of calling UI code from worker threads in this…

Comments in source code considered harmful

In the file ResourceFontFileLoader.h (offical Windows SDK samples) you can see variable declared as: static IDWriteFontFileLoader* instance_; As you see it is a raw pointer here. And in the file ResourceFontFileLoader.cpp it is initialized with this: // Smart pointer to singleton instance of the font file loader. IDWriteFontFileLoader* ResourceFontFileLoader::instance_( new(std::nothrow) ResourceFontFileLoader() ); Note the comment….

Sciter UI, application architecture

Architecture of applications that use Sciter based UI can be visualized as this: Typically such applications contain two distinct layers: UI layer that uses Sciter window with loaded HTML/CSS and scripts (code behind UI); Application logic layer, most of the time that is native code implementing logic of the application. Ideally these two layers shall…

boost.coroutine vs my $generator.

Today I saw discussion about boost.coroutine on gmane: Generators and coroutines are conceptually the same feature and I have implementation of $generator thing that can be used to implement coroutines. My implementation is of 15 lines of code and does not require any threads/fibers and so context switches – pure C++ with macro magic, pretty…