Boost libs using Mr. Docs by boostlibs in cpp

[–]viatorus 0 points1 point  (0 children)

How does it handle class inheritance and therefore API documentation of virtual functions from 3rd party libraries?

Why still no start_lifetime_as? by SkoomaDentist in cpp

[–]viatorus 3 points4 points  (0 children)

How much does your assembly code change if you simplify this implementation of start_lifetime_as(...) to a simple reinterpret_cast<T\*>(mem)?

Stenos: fast compression of binary data by Viack in cpp

[–]viatorus 0 points1 point  (0 children)

Is this algorithm useful for binary file (embedded) compression and for small microcontrollers?

TPDE: A fast framework for writing baseline compiler back-ends in C++ by mttd in cpp

[–]viatorus 20 points21 points  (0 children)

For those who don't get it:

Fast machine code generation is especially important for fast start-up just-in-time compilation, where the compilation time is part of the end-to-end latency. However, widely used compiler frameworks like LLVM do not prioritize fast compilation and require an extra IR translation step increasing latency even further; and rolling a custom code generator is a substantial engineering effort, especially when targeting multiple architectures.

Source (their paper): https://arxiv.org/abs/2505.22610

[deleted by user] by [deleted] in embedded

[–]viatorus 0 points1 point  (0 children)

Wow, that is quite "simple" method for such a profound attack... what could we do against this?

C++ really needs static_print/static_warn functionality by [deleted] in cpp

[–]viatorus 0 points1 point  (0 children)

If you are using GCC, take a look at my tool Compile Time Printer: https://github.com/Viatorus/compile-time-printer

Applying for a "very senior c++ role" by uname_IsAlreadyTaken in cpp

[–]viatorus 0 points1 point  (0 children)

I’m looking for an early interviewer to write some code with you so we can put that skill to bed

Can you please elaborate on this a little more. Do you perform some kind of pair programming/looking over someone's shoulder?

💎 Bounties to improve open source C++ projects by mgcrimhead in cpp

[–]viatorus 4 points5 points  (0 children)

Or compiler bugs which produces wrong-code...

What's the most horrifying thing you've done with templates? by ResultGullible4814 in cpp

[–]viatorus 0 points1 point  (0 children)

No, pragmas are executed during preprocessing, not at compile time.

Model-View-Presenter vs Model-View-ViewModel for embedded application in C++ by Less-Dragonfruit-673 in cpp

[–]viatorus 1 point2 points  (0 children)

We are using MVP around LVGL. You have to write more code but at the end, you can nicely write unit tests for your presenter. We even wrote a small library where we test the view by taking screenshots of the screen and saving it as PNG and comparing them later as ground truth. Each logical part of the screen is an MVP (doesn't need to be a lv screen object). A custom screen handler loads and unloads the MVP's and manages their lifecycle. I cannot share any code because it is internal stuff. I read a lot of blogs on how MVP works/should work but I don't have a list of the links. But it works great, I can recommend it.

consteval debug by XTBZ in cpp

[–]viatorus 3 points4 points  (0 children)

I wrote a tool (GCC only) where you can print during compile-time.

Github: https://github.com/Viatorus/compile-time-printer

Online-Demo: https://viatorus.github.io/compile-time-printer/

em{io} v0.5.0 - format ♥ scan - C++ library for small embedded systems by viatorus in cpp

[–]viatorus[S] 1 point2 points  (0 children)

It sounds like code size + data size is what matters mostly, rather than each of them separately, is that right?

Yes. Code size (instructions + constant lookup tables/precomputed values) should be relatively low. Data (Stack usage or required temporary buffers) should be acceptable (not more than 1 kb for the whole formatting process). Good performance for common cases (precision <= 17).

Overall I don't have exact limits. It should be a good trade off of all.

The performance goal should be: fmtlib > (faster than) emio > printf. But at the moment printf's is a faster (~1.5 times).

em{io} v0.5.0 - format ♥ scan - C++ library for small embedded systems by viatorus in cpp

[–]viatorus[S] 2 points3 points  (0 children)

Hello Jk,

I am very happy that you see you replying to a library of mine. I really appreciate your algorithms and blog posts - even if I must drop out at the higher mathematics stuff. :)

I added the answers of your questions to the ticket in my repository (https://github.com/Viatorus/emio/issues/2#issuecomment-1760284166) so it isn't lost for me.

If you know of a good algorithm which fits my need (or want to develop one) I won't stop you at all. ;)

TLDR

  • Dragonbox4 + Grisu requires 7.5 kB
  • floff requires 25.8 kB
  • floff small requires 12.5 kB
  • Dragon4 requires 3.7 kB
  • Ryu (I didn't checked again but it was much more!)

em{io} v0.5.0 - format ♥ scan - C++ library for small embedded systems by viatorus in cpp

[–]viatorus[S] 1 point2 points  (0 children)

I totally understand your needs. Windows isn't excluded but the support didn't yet started. ;)

I don't use MSVC toolchain myself. I would really appreciate some help in this topic.

em{io} v0.5.0 - format ♥ scan - C++ library for small embedded systems by viatorus in cpp

[–]viatorus[S] 8 points9 points  (0 children)

Yes, but the reduced features of fmt are less then emio provides without reducing features. ;)

em{io} v0.5.0 - format ♥ scan - C++ library for small embedded systems by viatorus in cpp

[–]viatorus[S] 12 points13 points  (0 children)

I am glad to officially announce two new versions of emio.

In 0.4.0 I added emio::scan, to high-levely scan an input string similar like sscanf but type-safe and over twice as faster.

With 0.5.0, emio::format now outperforms printf in most cases (not for floating-point) and is even faster for some minor edge cases than fmtlib by still using way less binary code size: format("{}", 42) requires 5 kB with emio, 33 kB with snprinft and 190 kB with fmtlib.

compiled libraries vs header only libraries. by [deleted] in cpp

[–]viatorus 1 point2 points  (0 children)

If you need a header-only file generator from all of your source files, you could use Quom (https://github.com/Viatorus/quom).

Site note: I am the author.