Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    M

    Molecular Matters

    blog.molecular-matters.com · Personal blog · on HN since 2015

    Stefan Reinalter writes about C++ game engine programming, covering lock-free work stealing, custom allocators and data-oriented design.

    Visit blogHN submissions
    Systems & PerformanceGamesProgramming
    What HN says

    Commenters recommend it as a "goldmine" for no-nonsense software design, with posts on task schedulers and memory allocators.

    Stats for nerds
    15HN people shared it
    13linked in comments
    178story points
    Sep 2024last shared
    2015people per year2024

    Top posts on HN

    1. 1
      Adventures in data-oriented design – Part 3b: Internal References
      1 person · 73 points · first shared 2021 · 2 comments on HN
    2. 2
      Lock-Free Work Stealing, Part 1: Basics
      2 people · 49 points · first shared 2015 · 5 comments on HN
    3. 3
      Lock-Free Work Stealing, Part 4: Parallel_for
      1 person · 37 points · first shared 2015 · Discussion on HN
    4. 4
      Lock-Free Work Stealing, Part 2: A specialized allocator
      1 person · 4 points · first shared 2015 · Discussion on HN
    5. 5
      Getting the type of a template argument as string in C++ – without RTTI
      2 people · 3 points · first shared 2015 · Discussion on HN
    6. 6
      Using runtime-compiled C++ code as a scripting language
      1 person · 3 points · first shared 2016 · Discussion on HN
    7. 7
      A faster quaternion-vector multiplication
      1 person · 3 points · first shared 2020 · Discussion on HN
    8. 8
      Lock-Free Work Stealing, Part 3: Going Lock-Free
      1 person · 2 points · first shared 2015 · 1 comments on HN
    9. 9
      Lock-Free Work Stealing, Part 5: Dependencies
      1 person · 2 points · first shared 2016 · Discussion on HN
    10. 10
      Live++ 1.0.0 released
      1 person · 1 points · first shared 2018 · Discussion on HN

    What HN people wrote when they linked it

    • devbugApr 2016

      This unfortunately breaks down with (bad acting) NIFs. Thankfully you can mark 'em as the dirty evil little things that they are (with negligible overhead): ERL_NIF_DIRTY_JOB_CPU_BOUND. [1]

      I implore anyone interested in Erlang or its surrounding languages, to read its source code. [2] More specifically, the BEAM. I'll warn you that it's very 80's hackeresque, but in a good way. Incredibly pragmatic. The way they achieve their world-class scheduling? Tip: not via a perfect theoretical design cooked up in some comp-sci lab. [3] If you've been following game engine design within the last 9 years or so, you'll probably have a good idea of how they do it. [4][5]

      [1]: https://medium.com/@jlouis666/erlang-dirty-scheduler-overhead-6e1219dcc7#.sakhllz5r

      [2]: https://github.com/erlang/otp/tree/maint/erts/emulator/beam

      [3]: https://hamidreza-s.github.io/erlang/scheduling/real-time/preemptive/migration/2016/02/09/erlang-scheduler-details.html

      [4]: http://blog.molecular-matters.com/2012/04/05/building-a-load-balanced-task-scheduler-part-1-basics/

      [5]: There's a hell of a lot of depth to this problem domain. Charles Bloom's guiding principles for Oodle are spot, and well worth a look.

    • w4rh4wk5Sep 2024

      We've invested some time to improve this situation for the games we port, at least to some extent. Keyboard input is read as a combination of scan code + win32 virtual key information to determine the physical key pressed on your keyboard. This way the keybindings are (almost) independent of the keyboard layout.

      However, we also reflect your current key bindings with dynamic button prompts that tell you which key to press in game. For this we translate the determined physical key back through the selected keyboard layout to figure out what the corresponding label on your keyboard might be.

      Most of this is just win32 API shenanigans, but the following post provides a bit more detail on reading inputs this way.

      https://blog.molecular-matters.com/2011/09/05/properly-handling-keyboard-input/

    • tuxalinJun 2019

      Glad to hear that!

      I dont have anymore the exact numbers, usually when you have around 1000 commands/calls you won't really feel a difference, in that case even using std::sort is fast enough and there's no point in using radix sort, however when you go over 10k commands/calls you'll feel it (can be up to a msec on the dispatch side).

      You can check this great post that provides numbers (see part 4): https://blog.molecular-matters.com/2014/11/06/stateless-layered-multi-threaded-rendering-part-1/

      The performance should be very similar and it even goes further by adding thread local storage to reduce false sharing even more, which I didn't add but should be considered as it's easy to do.

    • metaobserverDec 2019

      If you are into no-nonsense software design, Molecular Musings [1] written by Stefan Reinalter is also a goldmine. As is anything written or said on topic by Mike Acton, whose ramblings de-facto brought DOD into the mainstream [2][3]. Regarding good old days, remember Flipcode? ;) [4]

      [1] https://blog.molecular-matters.com/
      [2] https://macton.smugmug.com/Other/2008-07-15-by-Eye-Fi/n-xmKDH#!i=593426709&k=ZX4pZ
      [3] https://www.youtube.com/watch?v=rX0ItVEVjHc
      [4] https://flipcode.com/archives/articles.shtml

    • SloopJonAug 2015

      The home page describes it as "the foundation for all our tools, with parts of the engine being available to licensees as stand-alone game engine bits."

      This post suggests that it is intended to compete with Unreal and CryEngine:

      http://blog.molecular-matters.com/2015/08/12/what-happened-to-the-molecule-engine/

      One of the posts about runtime-compiled C++ states that iOS is not a target platform.

    • RaugharrDec 2019

      https://www.redblobgames.com/ talks about map generation, A*, and algorithms for hex based grids.

      https://blog.molecular-matters.com/ talks about a task scheduler and several types of memory allocators.

      https://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php is an overview of behavior trees.

    Related

    Our Machineryourmachinery.com36 people

    Virtual Memory Tricks

    Our Machinery
    Company · last shared 2022
    Bitsquid Blogbitsquid.blogspot.com25 people

    Allocation Adventures: The Buddy Allocator

    Bitsquid Blog
    Company · last shared 2025
    1024cores1024cores.net36 people

    Lockfree Algorithms (2010)

    1024cores
    Personal · last shared 2025
    Probably Danceprobablydance.com74 people

    Fibonacci Hashing: The Optimization That the World Forgot

    Probably Dance
    Personal · last shared 2026
    Aras Pranckevičiusaras-p.info79 people

    I accidentally Blender VSE

    Aras Pranckevičius
    Personal · last shared 2026
    John Regehrblog.regehr.org401 people

    Teaching C

    John Regehr
    Personal · last shared 2026
    matkladmatklad.github.io237 people

    Architecture.md

    matklad
    Personal · last shared 2026
    Just Software Solutionsjustsoftwaresolutions.co.uk18 people

    Locks, Mutexes, and Semaphores: Types of Synchronization Objects (2014)

    Just Software Solutions
    Company · last shared 2023