<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by David Sporn on Medium]]></title>
        <description><![CDATA[Stories by David Sporn on Medium]]></description>
        <link>https://medium.com/@sporniket.studio?source=rss-fbd4a08325f2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*F_8UTarr7bZWN_YI</url>
            <title>Stories by David Sporn on Medium</title>
            <link>https://medium.com/@sporniket.studio?source=rss-fbd4a08325f2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 19:00:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sporniket.studio/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[C++ development notes]]></title>
            <link>https://medium.com/@sporniket.studio/c-development-notes-408d711dc904?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/408d711dc904</guid>
            <category><![CDATA[methodology]]></category>
            <category><![CDATA[cpp-programming]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 21:36:54 GMT</pubDate>
            <atom:updated>2026-10-22T21:36:54.813Z</atom:updated>
            <content:encoded><![CDATA[<h4>Optimizing my workflow, Writing C++23/C++26 code on Debian trixie, Next step</h4><h3>Optimizing my workflow</h3><p>It took 4 monthes of hobby time between <a href="https://github.com/sporniket/monorepo-cpp-apps/tree/v0.0.1">v0.0.1</a> and <a href="https://github.com/sporniket/monorepo-cpp-apps/tree/v0.0.2">v0.0.2</a>. Just to manage the standard input to catch printable characters, special key strokes and cursor position reports.</p><p>Beyond the sluggishness induced by the heatwaves during most of the summer, what dragged the work was all the book-keeping between specification files, tasks files and code. The whole compounded with a tentative to get incremental outcomes, as I somehow tried the <a href="https://agilealliance.org/glossary/invest/">INVEST technique</a> (I got the incremental outcomes, and it was nice ; I also got a lot more book-keeping to do, cancelling the gains of the method).</p><p>By the time I finally reached my milestone, I started to devise and apply another strategy.</p><h4>Reducing and delaying friction</h4><p>“Friction” here means whatever prevents me to instantly materialize a new idea into code.</p><p>In my context, it essentially means writing and maintaining specs (in specs files as well as in documentation comments) and writing and maintaining build files to support new source files.</p><p>I have so little available time and energy, I MUST make the most of it. Especially to bootstrap a new idea.</p><p>So I would now start with delaying friction, by writing new code and its documentation in an already referenced translation unit that would need the new code, or that can be mutated into a test bed for that new code.</p><p>When the code has a good enough shape (compiles and works), I would start a refactoring process to get clean and covered code as well as good documentation.</p><p>As for reducing friction, I would not maintain a separate specification file anymore. The relevant documentation will be embedded in class documentation or as test runner comments. (That leaves the questions of specification of a whole application, I will have to tackle that at some point, but not now.)</p><h3>Writing C++23/C++26 code on Debian trixie</h3><p>Debian trixie is the current stable distribution (at the time of writing), and I discovered that I cannot use ranges, nor C++ modules.</p><p>I was told that clang 19 is available, so I keep that in mind.</p><p>But as I wish to use GCC, I am considering to compile it myself to get the latest features. More on that later, when I will do it.</p><h3>Next step</h3><p>The DataSource model was used to implement the retrieval of the escape sequences and of the printable characters from the standard input. I wrote a mock implementation to write tests, and an implementation using the read() function.</p><p>I realized that I need batch operation, and the “next()” seems ill-named. So at the next step, DataSource will have a single read operation “pull()”, and a batch read operation “fill(std::vector&lt;T&gt; bucket)”. The default implementation will use the template method pattern to call the single read operation.</p><p>The dumpkeys demo quickly implemented a way to emit escape sequences (an exemple of delaying friction) that hint at the counterpart of a DataSource : a DataSink. It will have a single write operation “push(T t)” and a batch write operation “drain(std::vector&lt;T&gt; bucket)”.</p><p>Finally, I will need to decode/encode UTF-8, to be able to store any text using char32_t.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=408d711dc904" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C++ development notes]]></title>
            <link>https://medium.com/@sporniket.studio/c-development-notes-b95dae779de2?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b95dae779de2</guid>
            <category><![CDATA[comment]]></category>
            <category><![CDATA[specs]]></category>
            <category><![CDATA[data-extraction]]></category>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[cpp]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 21:04:22 GMT</pubDate>
            <atom:updated>2026-10-05T21:04:22.049Z</atom:updated>
            <content:encoded><![CDATA[<h4>Cmake as project CLI, Embedding and extracting behaviour test specs</h4><h3>Cmake as project CLI</h3><p>When working on my C++ projects, I use Cmake for building, but also for other tasks, like pretty-printing and lauching tests.</p><p>In other words, I consider Cmake as my project CLI, and don’t feel the need to write a specialized CLI to maintain for that.</p><p>However, typing cmake --build build -- &lt;the tasks to launch&gt; is quite tedious, and makes the CLI aspect very clunky. The same for when I need to refresh the build directory, with cmake -B build .--fresh.</p><p>I recently realized that I could define some alias for bash, and now, I type e.g. cmm prettier verify to launch the prettier task followed by the verify task. And the refresh of the build directory is cmi .</p><p>Now it feels like a sleek CLI to use.</p><h3>Embedding and extracting behaviour test specs</h3><p>I’m a sucker for written specs, especially for written specs of behavioral tests.</p><p>At the same times, I can see how painful it is to maintain a specification file against the corresponding actual code.</p><p>As a first steps, I use a convention to copy the specification of the tests as special comment, and then a bash script would extract only thous lines, and the test name.</p><p>The final goal is to have a script that would extract the test descriptions, and copy them to the main doxygen page for the code under test.</p><p>See a test runner with the embedded comments here : <a href="https://github.com/sporniket/monorepo-cpp-apps/blob/main/cmnlib-term/src-tests/vt-input/TestRunner--VtInputFromCharacters.cpp">https://github.com/sporniket/monorepo-cpp-apps/blob/main/cmnlib-term/src-tests/vt-input/TestRunner--VtInputFromCharacters.cpp</a></p><p>See the extraction script : <a href="https://github.com/sporniket/monorepo-cpp-apps/blob/main/extract-doc-from-test-runner.sh">https://github.com/sporniket/monorepo-cpp-apps/blob/main/extract-doc-from-test-runner.sh</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b95dae779de2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[C++ development notes]]></title>
            <link>https://medium.com/@sporniket.studio/c-development-notes-0780ad2d40d2?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/0780ad2d40d2</guid>
            <category><![CDATA[modern-cpp]]></category>
            <category><![CDATA[cpp-programming]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 21:01:39 GMT</pubDate>
            <atom:updated>2026-09-20T21:01:39.859Z</atom:updated>
            <content:encoded><![CDATA[<h4>Dependencies injection and smart pointers</h4><h3>Dependencies injection and smart pointers</h3><p>As I slowly write some fundational classes for writing my TUI applications, I also refine my way of writing C++ code. My personal way of working is grounded on behaviour tests to validate the code (behaviour driven development).</p><p>When the class under test uses another class –or even an external function–, it can become difficult to implement a test, especially when said class or function is unavailable or unusable in the context of a test, or its behaviour cannot be influenced to test a specific case.</p><p>This is where writing code using dependencies injection principles come handy, and I will use dependencies injection through the constructor : the test will instanciate the class under test using some special version of its dependencies.</p><p>For instance, I have a converter that reads data from a “<em>DataSource</em>” that reads one <em>char8_t</em> at a time. The intended DataSource should read from the standard input, that will not be available in an automated test.</p><p>I thus changed the constructor of the class to test so that the DataSource is given to the constructor. Then I implemented a DataSource backed by a standard vector of <em>char8_t</em>, and provided it to the constructor. We can now implement tests specified like, e.g. “<strong><em>given</em></strong><em> a DataSource that will return the sequence of characters {‘a’, ‘b’, 0}, </em><strong><em>when</em></strong><em> calling next() 3 time, </em><strong><em>then</em></strong><em> the class under test will return the values char(‘a’), char(‘b’), and key(control+space), respectively</em>”.</p><h4>Using unique_ptr instead of a raw pointer has an unexpected consequence</h4><p>In order to safely manage the dependency, I decided to use a smart pointer, and after a little bit of thinking, I decided to go with a unique_ptr, as the class under test, in this case, will be the owner of the pointer.</p><p>That choice had an unexpected consequence (for a casual C++ dev like me) : the class becomes <em>Non Copiable</em>. It’s obvious after the fact, but it has to be noted.</p><p>I discovered that, not by trying to copy an instance of the class under test, but at compile time. It happens that my class was a subclass of an abstract base class (with virtual functions), thus I have a virtual destructor, and I had to redeclare copy and move constructors and operator so that the compiler use the default generated ones (“<em>rule of 5</em>”).</p><p>Thus, I had to delete the copy constructor and operator, e.g. by writing “<em>MyClass(const MyClass&amp;) = delete;</em>”</p><p>You can read the code here : <a href="https://github.com/sporniket/monorepo-cpp-apps/blob/6f23343f4eec17d00fb04b77b0ab0a93d0524b4d/cmnlib-term/include/cmspk/term/VtInputSource.hpp#L83-L102">https://github.com/sporniket/monorepo-cpp-apps/blob/6f23343f4eec17d00fb04b77b0ab0a93d0524b4d/cmnlib-term/include/cmspk/term/VtInputSource.hpp#L83-L102</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0780ad2d40d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slowly recovering from a busy life]]></title>
            <link>https://medium.com/@sporniket.studio/slowly-recovering-from-a-busy-life-ce93451f1629?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce93451f1629</guid>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Thu, 03 Sep 2026 19:57:53 GMT</pubDate>
            <atom:updated>2026-09-03T19:57:53.798Z</atom:updated>
            <content:encoded><![CDATA[<h4>It’s been almost about a year. I got a busier life (for an happy reason) and could not dedicate a lot of time to coding for myself.</h4><h3>Shai-Hulud worm</h3><p>As a blessing in disguise, my busier life prevented me to work on anything npm/python. I won’t resume my work with those tools before long.</p><h4>Writing my own IDE with C++</h4><p>I had planned to explore textual user interfaces (TUI), like vi/vim/neovim.</p><p>The Shai-Hulud worm and other attacks targetting also popular IDEs pushed me to explore this way earlier than expected, and with a twist : I will write it myself, with C++23/C++26, in order to refresh my knowledge.</p><p>I followed the tutorial written after a small text editor named `kilo`, so I have a starting point : <a href="https://viewsourcecode.org/snaptoken/kilo/">https://viewsourcecode.org/snaptoken/kilo/</a></p><p>Meanwhile, I use gnome text editor and plain geany (no extension) to work.</p><h3>No more github issues, wikis, etc…</h3><p>Issues, wiki, etc… are now stored as markdown files.</p><p>The goal is to only use github as a public git repositories for my projects. This will allow better reversibility (changing to another forge), as well as reduce the feature set required for an hypothetical self hosting, someday.</p><p>As a nice side effects, it’s also LLM-friendly.</p><h4>All the markdomn files have a frontend matter</h4><p>The frontend matter tells the creation date, copyright notice and licence. Additionnally, some other metadata as I see fit.</p><h4>The structure of a specification/task</h4><p>My way of working gives the first row seat to <strong>correctly</strong> specified automated tests. I decided to make this obvious by reordering the sections by decreasing order of importance :</p><ul><li>first comes the dependencies,</li><li>then the behaviours described as automated tests,</li><li>then technical details that should not be described in a test</li></ul><p>The first dependency is the specification guidelines, always.</p><p>As for what goes in the specifications of an automated test, and what goes in the technical details : as an example, a test specification will tell <em>“</em><strong><em>given </em></strong><em>the configuration parameter </em><strong><em>foo</em></strong><em> is valued to </em><strong><em>bar</em></strong><em>”</em>, while the technical details will tell how the configuration parameters are given/stored, e.g. by specifying a configuration file, or how it is saved in a database.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce93451f1629" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Pulsar, a community-led hackable text editor]]></title>
            <link>https://medium.com/@sporniket.studio/using-pulsar-a-community-led-hackable-text-editor-7945824214e6?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7945824214e6</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[hands-on]]></category>
            <category><![CDATA[pulsar]]></category>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[atom-text-editor]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Tue, 11 Nov 2025 07:58:24 GMT</pubDate>
            <atom:updated>2025-11-11T07:59:27.725Z</atom:updated>
            <content:encoded><![CDATA[<h4>Where I organize all my articles about the Pulsar text editor into a table of content</h4><p>I already wrote a bunch of articles about this editor, that I selected to become my daily driver for C/C++ development –mainly for embedded software development, but not only–.</p><p>This is a table of content of all those articles. This post will be updated when I write new posts about this text editor.</p><p><strong>The “<em>Taming Pulsar, the Community-led Hyper-Hackable Text Editor</em>” series :</strong></p><ul><li><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-1-dbc965426d69">part 1</a></li><li><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-2-b58228631b97">part 2</a></li><li><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-3-d6c33fec6000">part 3</a></li><li><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-4-aaf352b4ca09">part 4</a></li><li><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-interlude-1-d0fe0fd3b6cc">interlude 1</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7945824214e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I write C++ source libraries in 2025]]></title>
            <link>https://medium.com/@sporniket.studio/how-i-write-c-source-libraries-in-2025-b2614a760870?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2614a760870</guid>
            <category><![CDATA[libraries]]></category>
            <category><![CDATA[opinion]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[cpp-programming]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Sun, 07 Sep 2025 07:09:25 GMT</pubDate>
            <atom:updated>2025-09-07T07:09:25.653Z</atom:updated>
            <content:encoded><![CDATA[<h4>After realizing that PlatformIO was not designed for managing source library projects, I came up with my own solution.</h4><h3>How I came up the way it is today</h3><p>When I started using C++ again a few years ago, it was for writing embedded software for micro-controllers, as a new hobby. I was targetting an <a href="https://www.espressif.com/en/products/devkits/esp32-devkitc/overview">Espressif ESP32 devkitC</a>, and I discovered <a href="https://registry.platformio.org/">PlatformIO</a> and its VSCode integration around the same time, and the whole experience was nice.</p><p>However, I did not found a satisfying way to make a source library project with PlatformIO.</p><blockquote>Now that I am writing this article, I believe I could find a somewhat better way than what I was doing until last year : have a main project, and add a library under development as a github module. You can see that there : <a href="https://github.com/sporniket/esp32-idf-workspace-i2c">workspace I2C</a>, <a href="https://github.com/sporniket/esp32-idf-experiment-spi-st7789">experiment with SPI ST7789</a>.</blockquote><p>Then, I wanted to try writing embedded software for Raspberry Pi Pico using the CSDK.</p><h4>The PlatformIO/Raspberry Pi Pico CSDK catastrophe</h4><p>Long story short, I expected that support for the CSDK provided by Raspberry Pi Pico would eventually comes to PlatformIO, one way or another. However IT WILL NOT COME.</p><p>See <a href="https://github.com/platformio/platform-raspberrypi/pull/36#issuecomment-2257315929">that discussion on a related Github issue (direct comment for convenience to a relevant pair of comments)</a>.</p><p>The immediate effects were the following :</p><ul><li><strong>Freeze of any intended project with the Raspberry Pi Pico for years</strong>. I only started to install the CSDK and have a try with it. I mean, I only have limited free time, and a truckload of other projects to do.</li><li><strong>Immediate distrust for PlatformIO as a long term solution</strong>, as a major micro-controller framework would NOT have any reference. I mean, sure <a href="https://docs.platformio.org/en/latest/platforms/raspberrypi.html">the registry recognises the arduino core on Raspberry Pi Pico</a>, but it’s not the CSDK.</li></ul><p>Another effect, that took time to appear :</p><ul><li><strong>I realized that I became over-reliant on VSCode</strong>, a Microsoft product (but open-source). VSCode is very nice, costs nothing, and is open source. I have a good time with it and it is my go to IDE for anything other than Java. But this year, <a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-1-dbc965426d69">I decided to start moving away by using Pulsar, even if I had to also tinker with it</a>.</li></ul><p>So, I finally got a satisfying enough practice for C++ source library</p><h3>My best practices for my C++ source libraries</h3><p>See the result in action : <a href="https://github.com/sporniket/ucdevices">ucdevices</a>, <a href="https://github.com/sporniket/IoPins">IoPins</a>, <a href="https://github.com/sporniket/AnimatedValues">AnimatedValues</a></p><h4>File organisation</h4><p>Let’s start with the classical <em>include</em> and <em>src</em> folders to store the header files (with further organization) and the implementation code.</p><p>Less conventionnal is the storage of unit tests and external libraries :</p><ul><li>I implement the test suite in a folder named <em>src-tests</em>.</li><li>External libraries are to put in a <em>lib-ext</em> root folder, each library in its own folder.</li></ul><h4>Requirements on external source libraries</h4><p>Each library MUST have an <em>include</em> folder, and optionnally an <em>src</em> folder.</p><p>For now, the PREFERRED way of adding an external source library, is by adding a git submodule.</p><p>That way allow to maintain the external library (when it is one of mine) or to keep them easily up to date, and if appliable, to propose a pull request to the maintainers.</p><h4>cmake as the main Command Line Interface</h4><p>cmake is the tool of choice when using the CSDK, and I planned to use it more thoroughly anyway. I mean, I am not writing software for the Free Software Foundation, so I am not bounded to autotools.</p><p>Once I got comfortable with it, I added a collection of tasks to perform linting, pretty-printing, generating documentation and launching the test suite.</p><p>Of course, the usage is not as intuitive as an ad-hoc CLI, so I added a dedicated README as a cheatsheet.</p><h4>Other required tools</h4><p>The following tools are required to performs the tasks provided by the cmake script :</p><ul><li><a href="https://github.com/Sarcasm/compdb">compdb</a>, to generate the command.json file that will drive the clang <em>Language Server Protocole</em> service with atom. I need this for navigating the code with Pulsar.</li><li><a href="https://clang.llvm.org/docs/ClangFormat.html">clang-format</a>, to perform pretty-print the source.</li><li><a href="https://clang.llvm.org/extra/clang-tidy/">clang-tidy-19</a>, to perform linting.</li><li><a href="https://doxygen.nl/">doxygen</a>, to perform documentation generation.</li><li>The <a href="https://github.com/Snaipe/Criterion">criterion testing library</a>, to write unit test. The great feature, compared to <a href="https://github.com/ThrowTheSwitch/Unity">the Unity test framework</a> recommanded by PlatformIO, is the auto discoverability of the tests : <strong>it is not required to manually write the main function to manually register each test</strong>.</li></ul><h3>Remaining goals</h3><p>Those current practices give me enough satisfaction so far, as “a first step in the good direction”.</p><p>There are still a handful of topics to address to fully covers my bases</p><ul><li>For now, external source library dependencies will be managed by manually adding git submodules ; then upgrading the target library is simply done using a <em>git pull</em> or a <em>git checkout &lt;version_tag&gt;</em>. When I am a “pure consumer” of a library (with no intent to contribute back), I need to find a way to automate the initial retrieval and subsequent upgrade, and to select a few methods among what is usually done.</li><li>Conversely, I MAY want to package my libraries using an existing package repository and management tool, to provide interested consumers some convenience. For instance, even if I do not consider PlatformIO as a solution, I COULD publish some packages when it is suitable.</li><li>My ultimate goal is to write embedded software that targets multiple micro-controllers from multiple manufacturer (e.g. Espressif’s ESP32 and Raspberry Pi RP2040), so that the software architecture will clearly separate abstract models and hardware independant code, from hardware dependant code. I have <a href="https://github.com/sporniket/draft-firmware-seed">an ongoing experimentation</a>, and I will write about it later.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2614a760870" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A better testing framework — My journey with the Amaranth HDL]]></title>
            <link>https://medium.com/@sporniket.studio/a-better-testing-framework-my-journey-with-the-amaranth-hdl-61ff7a3c169e?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/61ff7a3c169e</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[formal-verification]]></category>
            <category><![CDATA[amaranth]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[digital-logic-design]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Sat, 21 Jun 2025 14:26:58 GMT</pubDate>
            <atom:updated>2025-06-23T05:17:29.664Z</atom:updated>
            <content:encoded><![CDATA[<h3>A better testing framework — My journey with the Amaranth HDL</h3><h4>Where I tell how I made my testing framework more trustworthy…</h4><p>[This is a part of <a href="https://medium.com/@sporniket.studio/my-journey-with-the-amaranth-hdl-226b38d0b023">my series about Amaranth HDL</a>.]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*91PkxCTS2MlNO0Vg.jpeg" /></figure><p>When I initially designed <a href="https://medium.com/@sporniket.studio/a-framework-to-write-test-inspired-by-how-it-is-expressed-in-javascript-node-js-f3c025baf617">my testing framework</a>, there was some weaknesses that I was dissatisfied with. It’s time to address them to make it better.</p><h3>What is wrong with the current testing framework</h3><p>I have two main points that I do not like with my current framework.</p><ul><li>I MUST write the testing code.</li><li>The framework relies on the developper to write a test verifying that the scenario is reachable first. Unsuspecting developper (including me) will usually be happy with just writing a single test, assuming that the expectations WILL be asserted no matter what.</li></ul><p>On the other hand, I already have some building blocks allowing me to do better, with just a bit of polishing here and there :</p><ul><li>The description of a test, using the concept of a <em>Story</em>.</li><li>Some helper functions to generate the appropriate tests using a Story.</li></ul><h3>How to do it better ?</h3><h4>An easier API for testing</h4><p>As a logic developper, <strong>I DO NOT WANT to write custom test code</strong>.</p><p>Otherwise, every time I will find a “better” way of writing test code, I will have to rewrite all existing tests. Most likely, I won’t have time for that, and one will see various styles in those test functions.</p><p>On the other hand, I cannot just provide the testing framework with an already instantiated module to be tested.</p><p>I thus derived the following interfaces :</p><pre># For a single test<br>TestRunner(<br>    deviceUnderTestFactory,<br>    participantsFactory,<br>    story:Story<br>).run()<br># For a collection of tests<br>TestSuiteRunner(<br>    deviceUnderTestFactory,<br>    participantsFactory,<br>    stories:list[Story]<br>).run()</pre><p>The two factories to be transmitted can be written as lambda, thus the call almost looks declarative.</p><p>The first lambda has no parameters, and returns the instantiated module to test, e.g. :</p><pre>lambda : MyModule(some,parameters,...)</pre><p>The second lambda has two parameters, and returns a map of signals (the designated “<em>participants</em>” of a story), to be used when writing conditions and assertions, based on a story. The first parameter will be the “device under test” (<em>dut</em>), the second parameter will be the <em>ClockDomain</em> — most likely to get the reset signal — . E.g. :</p><pre>lambda dut, clockDomain : {<br>  &quot;reset&quot;:clockDomain.reset,<br>  &quot;din&quot;:dut.dataIn,<br>  &quot;dout&quot;:dut.dataOut<br>}</pre><p>Finally, the Story is the same as previously described, with the addition of a <em>`given</em>` arguments in the constructor, a list that specifies wich participants are considered “given” for the test, thus parts of the condition to match in order to assert the expectations. All the others participants are part of the assertion built to verify the behaviour of the device.</p><h4>The framework in action</h4><p>Here is the actual test suite written for my shift register, with a single test:</p><pre>def test_ShiftRegisterSendLsbFirst():<br>    TestSuiteRunner(<br>        lambda: ShiftRegisterSendLsbFirst(Signal(unsigned(4), name=&quot;dataIn&quot;), 6),<br>        lambda dut, clockDomain: {<br>            &quot;rst&quot;: clockDomain.rst,<br>            &quot;load&quot;: dut.load,<br>            &quot;din&quot;: dut.dataIn,<br>            &quot;dout&quot;: dut.dataOut,<br>            &quot;doutinv&quot;: dut.dataOutInverted,<br>        },<br>        [<br>            Story(<br>                &quot;Phase should delay first load&quot;,<br>                {<br>                    &quot;rst&quot;: [1, 0, 0, 0] + [0, 0, 0, 0] + [0, 0, 0, 0] + [0],<br>                    &quot;din&quot;: [0, 0, 0, 0] + [0, 0, 0, 0] + [0b1011, 0, 0, 0] + [0],<br>                    &quot;load&quot;: [0, 0, 0, 0] + [0, 0, 0, 1] + [0, 0, 0, 1] + [0],<br>                    &quot;dout&quot;: [0, 0, 0, 0] + [0, 0, 0, 0] + [1, 1, 0, 1] + [0],<br>                },<br>                given=[&quot;rst&quot;, &quot;din&quot;],<br>            ),<br>        ],<br>    ).run()</pre><p>And here is another, more complex test suite, for my TMDS encoder : the suite is build by concatenating two list comprehension that create two families of stories. Especially, the second list use the same signal twice, for both input and verification.</p><pre>def test_DviTmdsEncoder():<br>    TestSuiteRunner(<br>        lambda: DviTmdsEncoder(<br>            Signal(8, name=&quot;dataIn&quot;),<br>            Signal(name=&quot;vde&quot;),<br>            Signal(name=&quot;ctl0&quot;),<br>            Signal(name=&quot;ctl1&quot;),<br>        ),<br>        lambda dut, clockDomain: {<br>            &quot;rst&quot;: clockDomain.rst,<br>            &quot;vde&quot;: dut.videoDisplayEnable,<br>            &quot;ctl0&quot;: dut.ctl0,<br>            &quot;ctl1&quot;: dut.ctl1,<br>            &quot;din&quot;: dut.dataIn,<br>            &quot;dout&quot;: dut.dataOut,<br>            &quot;cnt&quot;: dut.halfBalanceCounter,<br>            &quot;thenCnt&quot;: dut.halfBalanceCounter,<br>        },<br>        [<br>            Story(<br>                f&quot;When din is {test[0]} and cnt is {test[1]}&quot;,<br>                {<br>                    &quot;rst&quot;: [0, 0],<br>                    &quot;vde&quot;: [1],<br>                    &quot;din&quot;: [test[0]],<br>                    &quot;cnt&quot;: [test[1]],<br>                    &quot;dout&quot;: [test[2]],<br>                    &quot;thenCnt&quot;: [test[3]],<br>                },<br>                given=[&quot;rst&quot;, &quot;vde&quot;, &quot;din&quot;, &quot;cnt&quot;],<br>            )<br>            for test in [<br>                # data in , counter before, data out, counter after<br>                [0b11000000, 0, 0b0101000000, -3],<br>                [0b11000000, -3, 0b1110111111, 1],<br>                [0b11000000, 1, 0b0101000000, -2],<br>                [0b11110000, 0, 0b1000000101, -2],<br>                [0b11110000, -2, 0b0011111010, -1],<br>                [0b11110000, 2, 0b1000000101, 0],<br>                [0b00001111, 0, 0b0100000101, -2],<br>                [0b00001111, -2, 0b1111111010, 1],<br>                [0b00001111, 1, 0b0100000101, -1],<br>                [0b00111111, 0, 0b1001000000, -3],<br>                [0b00111111, -3, 0b0010111111, -1],<br>                [0b00111111, 2, 0b1001000000, -1],<br>                [0b01010101, 0, 0b0100110011, 0],<br>                [0b01010101, -2, 0b0100110011, -2],<br>                [0b01010101, 2, 0b0100110011, 2],<br>                [0b10101010, 0, 0b1000110011, 0],<br>                [0b10101010, -2, 0b1000110011, -2],<br>                [0b10101010, 2, 0b1000110011, 2],<br>            ]<br>        ]<br>        + [<br>            Story(<br>                f&quot;When VDE is negated, ctl0 = {test[0]}, ctl1 = {test[1]}&quot;,<br>                {<br>                    &quot;rst&quot;: [0, 0],<br>                    &quot;vde&quot;: [0],<br>                    &quot;ctl0&quot;: [test[0]],<br>                    &quot;ctl1&quot;: [test[1]],<br>                    &quot;dout&quot;: [test[2]],<br>                    &quot;thenCnt&quot;: [0],<br>                },<br>                given=[&quot;rst&quot;, &quot;vde&quot;, &quot;ctl0&quot;, &quot;ctl1&quot;],<br>            )<br>            for test in [<br>                # ctl 0, ctl 1, data out<br>                [0, 0, 0b0010101011],<br>                [0, 1, 0b1101010100],<br>                [1, 0, 0b0010101010],<br>                [1, 1, 0b1101010101],<br>            ]<br>        ],<br>    ).run()</pre><h4>No more code to write</h4><p>The testing framework will perform 2 formal verification :</p><ul><li>First, it will test the reachability of the test, by asserting a blatantly false assertion (some signal is equal to its complementary value) only when the conditions are met. If the formal verification passes, it is a failure.</li><li>Then, it will test the behaviour, by asserting the real expectations described by the Story. If the formal verification passes, it is a success.</li></ul><p>Now, false positive are prevented by the reachability test, and the developper can quite confidently assume that when the testing framework tells the truth when it passes.</p><p>Also, the actual behaviour of the device under test CAN be manually checked with gtkwave by loading the counter-example generated for the failed reachability test. (Now that I write this, I realize that this was a third flaw of the previous framework)</p><h3>Some points to keep in mind when writing tests</h3><h4>Readability</h4><p>For better readability of the story, write the list of values as a concatenation of small list of up to 4 values.</p><p>When troubleshooting long stories, that way of splitting the long list of values will help to spot the location that need editing. See e.g. <a href="https://github.com/sporniket/amaranth-stuff/blob/v0.0.6/tests/modules/test_shiftreg.py">https://github.com/sporniket/amaranth-stuff/blob/v0.0.6/tests/modules/test_shiftreg.py</a></p><h4>Time relation</h4><p>In a story, the values for a given participant are meant to be “<em>just before setting the leading clock edge</em>”. Conversely, the values given for an expected participant are meant to be “<em>just after the leading clock edge, after all signals have settled</em>”</p><p>The list of values in a story are given in chronological order. However, consider that all the lists are temporally aligned starting from the last value.</p><h4>Trick : using a signal for both condition and assertion</h4><p>If a test need to use the same signal to build the condition and make assertions, the Story MUST describe two distincts participants, and the participants factory MUST assign the same signal to the two participants names.</p><h3>See the code</h3><p><a href="https://github.com/sporniket/amaranth-stuff/tree/68aff1a6574b1242c2d56899a615c05a03b186ca">https://github.com/sporniket/amaranth-stuff/tree/68aff1a6574b1242c2d56899a615c05a03b186ca</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61ff7a3c169e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The blinky HDMI demo — My journey with the Amaranth HDL]]></title>
            <link>https://medium.com/@sporniket.studio/the-blinky-hdmi-demo-my-journey-with-the-amaranth-hdl-7867a194caf8?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/7867a194caf8</guid>
            <category><![CDATA[hdl]]></category>
            <category><![CDATA[fpga-design]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[amaranth]]></category>
            <category><![CDATA[hdmi]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Wed, 11 Jun 2025 07:14:35 GMT</pubDate>
            <atom:updated>2025-06-11T07:14:56.216Z</atom:updated>
            <content:encoded><![CDATA[<h3>The blinky DVI/HDMI demo — My journey with the Amaranth HDL</h3><h4>Where I paraphrase how I put all together…</h4><p>[This is a part of <a href="https://medium.com/@sporniket.studio/my-journey-with-the-amaranth-hdl-226b38d0b023">my series about Amaranth HDL</a>.]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VOWJczTSiOHb6BJr.jpeg" /></figure><p>Now that I have prepared all the building blocks to hopefully display something on an HDMI monitor, it’s time to actually connect all those elements together.</p><p>The <a href="https://github.com/sporniket/the-cradle-colorlight-i9-ecp5-amaranth-hdl">whole project is here</a>, and I write about code as it is <a href="https://github.com/sporniket/the-cradle-colorlight-i9-ecp5-amaranth-hdl/tree/83223d9cd1a9352fc21359173e2f0a87a81f1d16">at that commit</a>.</p><h3>Target screen modes</h3><p>I initially wanted to have a PAL screen (a surface of 720×576 pixels at a refresh rate of 50 Hz), but I also prepared myself to have a standard VGA screen (a surface of 640×480 pixels at 59.94 Hz)</p><h4>Global configuration</h4><p>The generation of a given video mode has a lot of parameters, thus I isolated the following settings in a configuration script (a bunch of variables with given names), to be included by the main script</p><ul><li>The parameters of the PLL instance, to generate the pixel clocks (and other clocks as well)</li><li>The PLL generates 4 clock signals, I mapped each of them to a logical name for easier reference</li><li>The horizontal and vertical breakouts describing a given video mode (front/back porch, blanking, display)</li></ul><p>See <a href="https://github.com/sporniket/the-cradle-colorlight-i9-ecp5-amaranth-hdl/blob/83223d9cd1a9352fc21359173e2f0a87a81f1d16/src/the_cradle/vid_settings_720x576_50Hz.py">an exemple here</a>.</p><h3>Organizing all the part</h3><p>The <a href="https://github.com/sporniket/the-cradle-colorlight-i9-ecp5-amaranth-hdl/blob/83223d9cd1a9352fc21359173e2f0a87a81f1d16/src/the_cradle/the_cradle.py">main design</a> creates and embed the following parts</p><ul><li>a “<em>blinky</em>” module, to make pulse the onboard led, to serve as witness that the core is doing something</li><li>for each PLL generated clock signals, I create an amaranth clock domain. The most important ones are “<em>dviLink</em>” and “<em>pixel</em>”</li><li>Using the “<em>pixel</em>” clock domain, I instanciate a sequencer for the horizontal scan line, and I derive an “<em>hsync</em>” clock domain, as well as the “<em>henable</em>” horizontal display enable signal.</li><li>Using the “<em>hsync</em>” clock domain, I instanciate a sequencer for the whole screen, and I derive a “<em>vsync</em>” clock domain, an “<em>hsyncActive</em>” clock domain to spot horizontal synchronization pulses that happens for the displayable area, as well as the “<em>venable</em>” vertical display enable signal</li><li>The “<em>vde</em>” Video Display Enable signal is obtained by combination of “<em>henable</em>” and “<em>venable</em>”</li><li>I create a 24-bits signal storing the current RGB pixels named “<em>videoSource</em>”, and break it into three 8-bits signals “<em>red</em>”, “<em>green</em>”, and “<em>blue</em>”. Then I create a vibrating signal that change every 50 frames (using “<em>vsync</em>”) to alternate between two RGB colors.</li><li>finally, I create the dvi link, by instanciating 3 TMDS encoder (one per color component). The encoder for the blue channel receives hsync and vsync as control signals, while the others have dummy “<em>0</em>” constant value. Each of the three encoders feeds a shift register for the three color channels, while the clock channel is generated with a shift registers plugged to a constant 10-bits value having 5 contiguous “<em>0</em>” followed by 5 contiguous “<em>1</em>”. Those four shift registers are then connected to the physical hdmi port.</li></ul><h3>Post-mortem</h3><h4>The good things</h4><ul><li>Obviously, it works. As a first attempt at doing HDL, that is just awesome for me.</li></ul><h4>The bad things</h4><ul><li>Looking at the timing report available build/top.tim, I am a bit disappointed on the max frequency it can cope with, as I wanted to try a screen mode requiring 399MHz (just under the maximum 400MHz that can generate the PLL) Info: Max frequency for clock &#39;$glbnet$channel0_dvilink_clk&#39;: 333 MHz (PASS at 250.00 MHz)</li><li>I tried to quickly go beyond a solid blinking screen, and utterly failed.</li><li>In retrospect, some of my modules, while working, are not written properly. I especially think about creating clock domain from regular signals, and some of the “SlowXxx” modules. I believe that I should use amaranth’s EnableInserter with some delay and pulse logic to obtain the same effect as forcing a regular signal to feed a clock network.</li></ul><p>I clearly need to rework some parts of the code.</p><h3>What to do after</h3><p>The act 2 of this series of articles is now finally done. There was quite a hiatus because, well, I lacked motivation for this, as well as wanting to work on other projects, and my free time is limited.</p><p>These days I feel that I could advance a little again, so my course of action will be do the following, at a leisurely pace :</p><ul><li>a better testing system.</li><li>catching up with amaranth evolution since all that time.</li><li>leverage amaranth’s EnableInserter and ResetInserter to simplify logic behaviour implementation.</li><li>displaying more than a solid color.</li></ul><p>Then, in the future, I would like to address those subjects, but other projects may be prioritized before :</p><ul><li>playing with memory blocks</li><li>playing with onboard SD-RAM</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7867a194caf8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taming Pulsar, the Community-led Hyper-Hackable Text Editor — interlude 1]]></title>
            <link>https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-interlude-1-d0fe0fd3b6cc?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0fe0fd3b6cc</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[pulsar]]></category>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[hands-on]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Fri, 28 Mar 2025 18:29:29 GMT</pubDate>
            <atom:updated>2025-03-28T18:31:31.312Z</atom:updated>
            <content:encoded><![CDATA[<h3>Taming Pulsar, the Community-led Hyper-Hackable Text Editor — interlude 1</h3><h4>Where I sum up the current status and a nice map of the installed plugins so far…</h4><p><em>(</em><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-4-aaf352b4ca09"><em>previous part</em></a><em>)</em></p><p>So, I recently decided to use the Pulsar editor for some of my projects, in order to mitigate my reliance over VSCode as well as going back to what was the Atom editor, that was my daily driver until it was stopped.</p><p>My main goal is to develop small to medium C/C++ projects for micro-controllers, and thus I would like to achieve a good enough level of user experience.</p><p>A secondary goal appeared, as I hacked some existing plugin to fix some bugs, and being in the process to write a new set of my own plugins : achieve about the same level of user experience for Javascript/Node.js projects.</p><p>Those goals will consists in</p><ul><li>Using existing plugins for the time being, occasionnally solving the blockers I could find.</li><li>Writing my own set of plugins, to implements a new user experience according to some ideas that emerged during that journey.</li></ul><h3>The status so far</h3><p>After learning the basis again, I achieved a basic integration of the cmake build system, and I can navigate through the C/C++ files using <em>CTRL+Left Click</em>.</p><h4>The bare minimum to know when installing the Pulsar editor</h4><ul><li><strong>On the first run, disable the welcome panels</strong> : it split the main editor panel at each startup.</li></ul><p>The 4 keyboard shortcuts to learn :</p><ul><li><strong>CTRL+P</strong> : Open a file of the workspace, type the name in the field to narrow down the choice</li><li><strong>CTRL+F</strong> : Shows and focusses into the find/replace panel.</li><li><strong>CTRL+SHIFT+P</strong> : The <em>command palette</em>, to find any available command.</li><li><strong>CTRL+SHIFT+F</strong> : Shows and focusses into the find/replace panel for multiple files</li></ul><h4>How to make available cmake targets</h4><p><em>First, I installed </em><a href="https://cmake.org/"><em>cmake</em></a><em> on my computer (well, it was already installed, but it’s worth mentionning this step, though).</em></p><p>I installed the following plugins :</p><ul><li><a href="https://web.pulsar-edit.dev/packages/build-cmake-for-pulsar-by-sporniket"><em>build-cmake-for-pulsar-by-sporniket</em></a> : a modified version (by myself, as the name implies) of the build-cmake extension, with fixes to watch the files using the correct API, and select the default generator for cmake</li><li><a href="https://web.pulsar-edit.dev/packages/buildium"><em>buildium</em></a></li><li><a href="https://web.pulsar-edit.dev/packages/busy-signal"><em>busy-signal</em></a></li></ul><h4>How to make C/C++ source files navigable using CTRL+Left click</h4><p><em>First, I installed </em><a href="https://clangd.llvm.org/"><em>clangd</em></a><em> and </em><a href="https://github.com/Sarcasm/compdb"><em>compdb</em></a><em> on my computer.</em></p><p>I installed the following plugins :</p><ul><li><a href="https://web.pulsar-edit.dev/packages/pulsar-ide-clangd"><em>pulsar-ide-clangd</em></a></li><li><a href="https://web.pulsar-edit.dev/packages/atom-ide-definitions"><em>atom-ide-definitions</em></a></li><li><a href="https://web.pulsar-edit.dev/packages/atom-ide-hyperclick"><em>atom-ide-hyperclick</em></a></li></ul><p>For now, the generation of the compile-commands.json should be done manually.</p><h3>The map of plugins</h3><p>Using <a href="https://mermaid.js.org/"><em>mermaid.js</em></a>, I generated a flow chart to show how the mentionned plugins collaborate through the services that each of them provides and/or consumes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5idcr4DsNWmlbixGzqKcA.png" /></figure><h3>So what now ?</h3><p>I will need to add some plugins to complete the user experience.</p><p>And also, I will need to do the same for Javascript/Nodejs projects.</p><p>But this is for another time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0fe0fd3b6cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Taming Pulsar, the Community-led Hyper-Hackable Text Editor — part 4]]></title>
            <link>https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-4-aaf352b4ca09?source=rss-fbd4a08325f2------2</link>
            <guid isPermaLink="false">https://medium.com/p/aaf352b4ca09</guid>
            <category><![CDATA[pulsar]]></category>
            <category><![CDATA[text-editor]]></category>
            <category><![CDATA[clangd]]></category>
            <category><![CDATA[hands-on]]></category>
            <dc:creator><![CDATA[David Sporn]]></dc:creator>
            <pubDate>Thu, 20 Mar 2025 19:17:19 GMT</pubDate>
            <atom:updated>2025-03-20T20:54:58.603Z</atom:updated>
            <content:encoded><![CDATA[<h3>Taming Pulsar, the Community-led Hyper-Hackable Text Editor — part 4</h3><h4>Where I add more plugins to navigate through C/C++ code…</h4><p><em>(</em><a href="https://medium.com/@sporniket.studio/taming-pulsar-the-community-led-hyper-hackable-text-editor-part-3-d6c33fec6000"><em>part 3</em></a><em>)</em></p><p>So I want to <em>navigate</em> through my code, usually meaning hovering my mouse with the CTRL key pressed, then clicking on a symbol, usually a variable or method name, and then landing on the <em>definition or the declaration</em> of said symbol.</p><p>To achieve this, my first researches let me conclude that I had to use <a href="https://clangd.llvm.org/"><em>clangd</em></a>, «a <em>language server</em> that can work with many editors via a plugin».</p><p>Package-wise, I found <a href="https://web.pulsar-edit.dev/packages/pulsar-ide-clangd"><em>pulsar-ide-clangd</em></a> ; for the «click to definition» feature, the plugin direct me to install <a href="https://web.pulsar-edit.dev/packages/atom-ide-definitions"><em>atom-ide-definitions</em></a> ; and finally, this plugin install its required plugin <a href="https://web.pulsar-edit.dev/packages/atom-ide-hyperclick"><em>atom-ide-hyperclick</em></a><em>.</em></p><p>Reading the README of pulsar-ide-clangd, I install clangd as well as <a href="https://github.com/Sarcasm/compdb"><em>compdb</em></a>.</p><p>To see how it goes, I generate the compilation database manually, with the following commands :</p><pre>$ cmake -B .local.clangd-build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON<br><br>#foreshadowing : the next command has a typo !<br>$ compdb -p .local.clangd-build/ list &gt; compile-commands.json</pre><p>And then my project should be ready :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rW4QiadHkMHgbysGa6KZxw.png" /><figcaption>In fact… no…</figcaption></figure><h3>Problems between the keyboard and the chair…</h3><ul><li>I had left some configuration for clangd in a forgotten file : ~/.config/clangd/config.yaml→ <strong>removed.</strong></li><li>The file is named compile_commands.json, with an underscore char _, not a hyphen - → <strong>renamed</strong>.</li></ul><h3>Achievement unlocked !</h3><p>Maintaining the CTRL key pressed, a symbol is clickable, and I jump to the definition of the symbol when I clic on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*1ilO40vnYW3_5qyMC40y9g.png" /><figcaption>Hovering then…</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*i61r9qGqCrF1SbpKcMx6Kw.png" /><figcaption>Clic !</figcaption></figure><p>I even could get to the standard library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*ZuQFbWpuqESby35OjHA74w.png" /></figure><p>So, what’s next ? Well, I have to automate the generation of the command database somehow. And also see whether I could change the name compile_commands.json to another name to not be mistakenly added to the git repository.</p><p>That’s a story for another time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aaf352b4ca09" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>