make handles bold.

This commit is contained in:
ed committed 2026-08-25 16:26:52 -04:00
1 parent f577242432
commit 69b87777e5
728 files changed
+3291 -3087

No files matched your search

@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @AgileJebrim
**1/** **@AgileJebrim** ^1944947900104237129
@nicbarkeragain
**@nicbarkeragain**
The answer exists. It’s called ISPC.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @BigWhoopGames
**1/** **@BigWhoopGames** ^1945048842342219995
@nicbarkeragain
**@nicbarkeragain**
Reduced instruction sets. If we have op A and op B but B can be expressed as a series of As, just get rid of it. If all the parallel cores need to be running the same op at the same time, just optimize for the least instructions possible but more of them in a row.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @DanielJCollier
**1/** **@DanielJCollier** ^1945037474742591968
@nicbarkeragain
**@nicbarkeragain**
ISPC
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @DeepknowledgeU
**1/** **@DeepknowledgeU** ^1944996456974217322
@nicbarkeragain
**@nicbarkeragain**
Mojo lang has SIMD aware data types and makes it a first class citizen. Pretty interesting model
@@ -26,7 +26,7 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @Ed__dev
**1/** **@Ed__dev** ^1944930386984734925
My gamedev head just wants a sort of game mechanic lego for conveying a simd operation frame. We have carts to give the operation rail and we'll have it vend us the result in the storage bin. All these bins are slices. Everything inside the rail could behave like a shader's frame where you're only allowed to-do simd ops...
So far that I can tell if its in an iterator, the iterator is almost always going to be succeeded after this op occurs so it can be optionally incremented implicitly or manually.
@@ -34,7 +34,7 @@ This may have been done already I haven't done that much studies on this.
![](https://pbs.twimg.com/media/Gv3H3-IWkAAmiVO?format=png&name=orig)
**2/** @Ed__dev
**2/** **@Ed__dev** ^1944933144714457233
You could do more composition by having calls to procs, but it would be the async/await situation where now that proc must be a rail proc for the specific width.
All operations within the procs must end up being simd, but the slices from arbitrary pointers can come from any struct in memory.
@@ -45,13 +45,13 @@ All operations within the procs must end up being simd, but the slices from arbi
![](https://pbs.twimg.com/media/Gv3L4JqXAAA22Q4?format=png&name=orig)
**4/** @Ed__dev
**4/** **@Ed__dev** ^1944936495766294767
@nicbarkeragain
**@nicbarkeragain**
You could probably do mixin of different simd widths within one rail block but I don't know how that would start to get messy so maybe provide some sort of layout struct like the shaders to specify what the rail expects width wise for a set of bound vars.
**5/** @Ed__dev
**5/** **@Ed__dev** ^1944945740247392259
The nuance is that I know I want to feed these things a very specific width for a range of ops during hot-paths in a pipeline of an program. Its annoying to deal with this width and striding it. Shaders deal with this concept for you to a great degree. These array data layouts for operating on this array data should all be specificable at comp-time so you just need a way to triage that to compositional definitions. Specifying them constantly for every single var's access to their elements is annoying and add complexity to parsing what's going on visually.
@@ -60,15 +60,15 @@ This would make the block scope's math data arrays look like shader math, becaus
This is equivalent to what structs did for C on doing data offset math on single data instructions.
**6/** @Ed__dev
**6/** **@Ed__dev** ^1944947063931781184
@nicbarkeragain
**@nicbarkeragain**
Figuring it out for simd will probably lead to systems langs being able to triage shader compilation and loading of those SPOs to the gpu in in the same lang syntax and you'd just have specific rules for compute, vertex, and frag shader railing blocks.
**7/** @Ed__dev
**7/** **@Ed__dev** ^1944997289308655624
@nicbarkeragain
**@nicbarkeragain**
Last dumb example I'll muse about. Def would be fun to try prototyping something like this...
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @JakeLegendXIII
**1/** **@JakeLegendXIII** ^1944967041368129746
@nicbarkeragain
**@nicbarkeragain**
I have hope that this is true. But damn have we tried and nobody has had a good answer so far. Hoping some of the AI distraction doesn’t take too much away from people still doing other computer science to make progress on actual programming.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @JebsSteve0x1
**1/** **@JebsSteve0x1** ^1944937394127470633
@nicbarkeragain
**@nicbarkeragain**
FFmpeg thinks otherwise.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @SumErgoMonstro
**1/** **@SumErgoMonstro** ^1945143539224002588
@nicbarkeragain
**@nicbarkeragain**
Have you ever studied APL?
@@ -26,9 +26,9 @@ parent_post_id: "1944937375001666018"
## Branch
**1/** @TGodfather1984
**1/** **@TGodfather1984** ^1944994288305098754
@nicbarkeragain
**@nicbarkeragain**
128-bit seems to be pretty widespread, so it might be a good baseline? even in armv7 cores, not sure about risc-v and powerpc though. and then the compiler could just divide the number of iterations by 2 or 4, or am i missing something?
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @TheBuzzSaw
**1/** **@TheBuzzSaw** ^1944927781512733078
@nicbarkeragain
**@nicbarkeragain**
C# makes it fairly straightforward.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @VPCOMPRESSB
**1/** **@VPCOMPRESSB** ^1944933853707063570
@nicbarkeragain
**@nicbarkeragain**
Intel's ISPC
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @WorldGhostC2C
**1/** **@WorldGhostC2C** ^1944921404933120353
@nicbarkeragain
**@nicbarkeragain**
Llm baked into gcc who’s only job is making things simd where possible. Sinple
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @Zino2201_
**1/** **@Zino2201_** ^1945169506805952589
@nicbarkeragain
**@nicbarkeragain**
Perhaps something like ISPC / how we author shaders in GPU could help ?
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @_Felipe
**1/** **@_Felipe** ^1945156422716535136
@nicbarkeragain
**@nicbarkeragain**
Relational model + columnar data. SQL lands itself very well to vectorization and scatter+gather algorithms. We need a general purpose language that can express SQL semantics in some places.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @__morse
**1/** **@__morse** ^1945235507954295160
@nicbarkeragain
**@nicbarkeragain**
languages that have comptime also have wonderful support for SIMD: mojo and zig
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @agmethod75
**1/** **@agmethod75** ^1944929654340772147
@nicbarkeragain
**@nicbarkeragain**
Its called array programming. Fortran has been doing it since fortran90. Odin and D have it.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @andrew_v10209
**1/** **@andrew_v10209** ^1944934680404389997
@nicbarkeragain
**@nicbarkeragain**
Maybe Futhark, or array programming. There's an entire compiler that runs on the GPU written in Futhark (i.e. it does parsing, lexing, register allocation, etc on the GPU). It's called Pareas
@@ -26,21 +26,21 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @another_sentry
**1/** **@another_sentry** ^1944914198397624515
@nicbarkeragain
**@nicbarkeragain**
https://github.com/HigherOrderCO/Bend
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^1944915365009744092
@another_sentry
**@another_sentry**
I've been keeping an eye on this & the HVM work, there is some really interesting stuff happening there. My issue however is this doesn't feel like a general purpose language, more something that you would reach for if you already knew you had a massively parallel problem.
**3/** @AgileJebrim
**3/** **@AgileJebrim** ^1944948376086139203
@nicbarkeragain @another_sentry
**@nicbarkeragain** **@another_sentry**
Not even. Their performance is atrocious and their recursive programming model doesn’t map well to GPUs.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @asdhuqiwuhdais
**1/** **@asdhuqiwuhdais** ^1945222545709453526
@nicbarkeragain
**@nicbarkeragain**
It hasn't been stabilized yet but Rust's portable SIMD was pretty easy to work with https://doc.rust-lang.org/std/simd/index.html
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @dezren39
**1/** **@dezren39** ^1944982626667802713
@nicbarkeragain
**@nicbarkeragain**
more arrays
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @dodobyte
**1/** **@dodobyte** ^1945103550113054841
@nicbarkeragain
**@nicbarkeragain**
openmp does good enough job with compiler flags like march=avx2, i think the focus should be making compilers smarter, for the cases where parallelism is the primary concern one should use cuda
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @etscrivner
**1/** **@etscrivner** ^1944916196429848910
@nicbarkeragain
**@nicbarkeragain**
I think ISPC more or less solved this and in a C-compatible way.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @etzikun
**1/** **@etzikun** ^1944931271077249360
@nicbarkeragain
**@nicbarkeragain**
Might be an oversimplification but I think the focus might need to be aimed more at grouping data efficiently. Thinking more with association rather than just individual variables. There’s only so much optimisation a compiler can force. It’s (partially) a memory management issue.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @examachine
**1/** **@examachine** ^1944938026037338610
@nicbarkeragain
**@nicbarkeragain**
Possible. :)
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @groby
**1/** **@groby** ^1944979658778239333
@nicbarkeragain
**@nicbarkeragain**
So, FORTRAN?
@@ -26,9 +26,9 @@ parent_post_id: "1944937375001666018"
## Branch
**1/** @jon_roelofs
**1/** **@jon_roelofs** ^1944944456056365486
@nicbarkeragain
**@nicbarkeragain**
the industry is trying to do that with vector-length-agnostic architectures, like SVE, RVV, and others.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @jshurmer
**1/** **@jshurmer** ^1944928429071053201
@nicbarkeragain
**@nicbarkeragain**
I agree
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @meglio
**1/** **@meglio** ^1944957913279422515
@nicbarkeragain
**@nicbarkeragain**
The "average programmer" you mentioned uses OOP and other things that make their programs so slower and fatter that SIMD would make literally zero impact within that scale of inefficiency through bad programming practices. You are attacking the wrong problem.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @meoyawn
**1/** **@meoyawn** ^1945231466549363169
@nicbarkeragain @Modular
**@nicbarkeragain** **@Modular**
Mojo has a first class SIMD support AFAIK but I've never used it https://docs.modular.com/mojo/stdlib/builtin/simd/SIMD#implemented-traits
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @quentinoeoeoe
**1/** **@quentinoeoeoe** ^1944919638719987940
@nicbarkeragain
**@nicbarkeragain**
I agree, there is something weird with SIMD accessibility today, looks like there is room for innovation
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @salonen
**1/** **@salonen** ^1945116028540784694
@nicbarkeragain
**@nicbarkeragain**
I think we need a system visualizer where devs can view their implementation running through the processor/gpus/memory/network.
@@ -26,33 +26,33 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @sasuke___420
**1/** **@sasuke___420** ^1944916085217878130
@nicbarkeragain
**@nicbarkeragain**
have you spent time writing SIMD algorithms for general-purpose tasks? it does not seem possible to make this stuff accessible, because the set of available doodads and their costs influences your algorithm design
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^1944921468489621892
@sasuke___420
**@sasuke___420**
Yeah I have and I agree, it's clear that the way I've learned programming hasn't given me the correct "mental tools" to think about solving problems with a SIMD mindset. Maybe it's possible or maybe it isn't, but it feels like we don't have quite the right framing at the moment.
**3/** @kellabyte
**3/** **@kellabyte** ^1944925466600857981
@nicbarkeragain @sasuke___420
**@nicbarkeragain** **@sasuke___420**
Data flow oriented programming instead of “OOP” where objects play roles and interact. Think like data and memory and layer your business rules on top of data structures that are sympathetic to the hardware.
**4/** @sasuke___420
**4/** **@sasuke___420** ^1944927873233502533
@kellabyte @nicbarkeragain
**@kellabyte** **@nicbarkeragain**
yeah, a big thing in the proposed "do something like APL" solution is that they can have pretty complicated verbs that end up being implemented with operations that are normally exposed in libraries in normal languages
**5/** @pelavarre
**5/** **@pelavarre** ^1944929743717195989
@sasuke___420 @kellabyte @nicbarkeragain
**@sasuke___420** **@kellabyte** **@nicbarkeragain**
I think
@@ -62,9 +62,9 @@ b ) Practically nobody codes it that way
I wonder why not
**6/** @sasuke___420
**6/** **@sasuke___420** ^1944931502284005525
@pelavarre @kellabyte @nicbarkeragain
**@pelavarre** **@kellabyte** **@nicbarkeragain**
it's an esoteric hobby. and solving general-ish problems like for regex engines instead of hand-coding specific parsers is like a lifetime of work. the guy whose lifetime of work it is, geoff langdale, is on here if you want to ask him
@@ -26,15 +26,15 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @slendidev
**1/** **@slendidev** ^1944952001516716329
@nicbarkeragain
**@nicbarkeragain**
have you looked at Odin’s SIMD?
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^1944953755537117588
@xslendix
**@xslendix**
Yeah I really like the simplicity of the array programming in Odin, and there are a number of other languages that provide similar things. It could just be because my mindset is narrow, but that type of approach feels a bit specific and niche, I use it mostly for 3d math.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @sorek_UK
**1/** **@sorek_UK** ^1944943796006838648
@nicbarkeragain
**@nicbarkeragain**
Whats wrong with using inline ASM?
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @splizard
**1/** **@splizard** ^1945085884254105812
@nicbarkeragain
**@nicbarkeragain**
Just enable arithmetic operations on fixed sized arrays and optimise this to use SIMD where possible
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @thejoephase
**1/** **@thejoephase** ^1945065810763899008
@nicbarkeragain
**@nicbarkeragain**
Have you met the average programmer?
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @theogcb405
**1/** **@theogcb405** ^1945247807578759590
@nicbarkeragain
**@nicbarkeragain**
![](https://pbs.twimg.com/media/Gv7okrWWUAAPlGF?format=jpg&name=orig)
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @2BitSalute
**1/** **@2BitSalute** ^1945487552011722857
@nicbarkeragain
**@nicbarkeragain**
What popped into my head is languages like Uiua
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @farre_x
**1/** **@farre_x** ^1945597104895778866
@nicbarkeragain
**@nicbarkeragain**
But is it really that hard to use though? Or what scenario do you mean? If we are to make use of SIMD we will be doing operations on collections of numbers. That is fairly trivial with intrinsics
@@ -26,43 +26,43 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @geofflangdale
**1/** **@geofflangdale** ^1945401263774162962
@nicbarkeragain
**@nicbarkeragain**
Hmmn. I feel most of the PL design community - who have many folks I have the greatest admiration for, to be clear - is really fundamentally not that interested in the reality of the actual instructions on the machine.
If the choice is to have SIMD ...
**2/** @geofflangdale
**2/** **@geofflangdale** ^1945401680868335902
@nicbarkeragain
**@nicbarkeragain**
programming smothered in a bureaucratic pile of type theory or some intrusive, hard-to-understand "magical autovec" system, my response to their help is, like the proverbial French merchants, "Laissez-nous faire".
What I'd really like to see - a small but modest step - is a ...
**3/** @geofflangdale
**3/** **@geofflangdale** ^1945402059345551381
@nicbarkeragain
**@nicbarkeragain**
run-time that pads out the start and end of every region (stack, globals, heap) - *not* every data item - with 63 bytes of padding so that any SIMD access can be done without the weird risk that we're right next to a unmapped page or some device with weird semantics ("on ...
**4/** @joseph_h_garvin
**4/** **@joseph_h_garvin** ^1945557778514215240
@geofflangdale @nicbarkeragain
**@geofflangdale** **@nicbarkeragain**
I'm an aspiring PL+perf person that does care but I seem to be rare 😅 I think the situation is worse than this though...
**5/** @joseph_h_garvin
**5/** **@joseph_h_garvin** ^1945557912790655000
@geofflangdale @nicbarkeragain
**@geofflangdale** **@nicbarkeragain**
Even if your allocator/linker/etc guarantee there's always an extra 63 zero bytes the C(++)/Rust lang semantics still allow the optimizer to launch missiles when you go out of bounds. That's UB, so now it can do whatever it wants instead. So you need lang semantics to change too.
**6/** @geofflangdale
**6/** **@geofflangdale** ^1945608389754863630
@joseph_h_garvin @nicbarkeragain
**@joseph_h_garvin** **@nicbarkeragain**
Yes, I'd include this with the run-time changes. Personally, I think a good deal of UB (not all, of course) feels somewhat fatuous, but I don't really study the area closely enough to understand how much we could do without.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @rtharston
**1/** **@rtharston** ^1945604998022533294
@nicbarkeragain
**@nicbarkeragain**
I’ve been wondering about this for over twenty years, but never found anything I felt was truly accessible.
If I used SIMD more I’d probably try to come up with something to help.
@@ -26,9 +26,9 @@ parent_post_id: "1944913662499516737"
## Branch
**1/** @themovercell
**1/** **@themovercell** ^1945386815537459355
@nicbarkeragain
**@nicbarkeragain**
Honestly it will definitely be a random idea someone has at 3 am and everyone will just go "how did we not think about that earlier?" and then a revolution begins
@@ -25,17 +25,17 @@ in_reply_to: ""
## Thread
**1/** @nicbarkeragain
**1/** **@nicbarkeragain** ^1944913662499516737
I can't help but have this feeling that we're missing something in programming language design that will make SIMD much easier for the average programmer to use. And that it will likely seem simple in hindsight.
Branches: [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-another_sentry-https-github-com-higherorderco-bend]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-sasuke___420-have-you-spent-time-writing-simd-algorithms-for]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-etscrivner-i-think-ispc-more-or-less-solved-this-and-in-a-c]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-quentinoeoeoe-i-agree-there-is-something-weird-with-simd]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-WorldGhostC2C-llm-baked-into-gcc-whos-only-job-is-making-things]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-TheBuzzSaw-c-makes-it-fairly-straightforward]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-jshurmer-i-agree]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-agmethod75-its-called-array-programming-fortran-has-been]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-Ed__dev-my-gamedev-head-just-wants-a-sort-of-game]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-etzikun-might-be-an-oversimplification-but-i-think-the]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-VPCOMPRESSB-intels-ispc]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-andrew_v10209-maybe-futhark-or-array-programming-theres-an]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-JebsSteve0x1-ffmpeg-thinks-otherwise]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-examachine-possible]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-sorek_UK-whats-wrong-with-using-inline-asm]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-AgileJebrim-the-answer-exists-its-called-ispc]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-slendidev-have-you-looked-at-odins-simd]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-meglio-the-average-programmer-you-mentioned-uses-oop-and]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-JakeLegendXIII-i-have-hope-that-this-is-true-but-damn-have-we]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-groby-so-fortran]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-dezren39-more-arrays]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-DeepknowledgeU-mojo-lang-has-simd-aware-data-types-and-makes-it]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-DanielJCollier-ispc]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-BigWhoopGames-reduced-instruction-sets-if-we-have-op-a-and-op-b]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-thejoephase-have-you-met-the-average-programmer]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-splizard-just-enable-arithmetic-operations-on-fixed-sized]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-dodobyte-openmp-does-good-enough-job-with-compiler-flags]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-salonen-i-think-we-need-a-system-visualizer-where-devs]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-SumErgoMonstro-have-you-ever-studied-apl-it-has-the-best-array]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-_Felipe-relational-model-columnar-data-sql-lands-itself]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-Zino2201_-perhaps-something-like-ispc-how-we-author-shaders]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-asdhuqiwuhdais-it-hasnt-been-stabilized-yet-but-rusts-portable]], [[archive/threads/nicbarkeragain/2025-07-15-i-cant-help-but-have-this-feeling-that-were/2025-07-15-meoyawn-mojo-has-a-first-class-simd-support-afaik-but-ive]], [[archive/threLine truncated
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^1944913664466948292
It's easy to think of structured programming (i.e. text based, with conditionals like if / else, loops, local variables, etc) as a simple and obvious innovation over the top of assembly, but I suspect if you were programming in 1950 it might not have seemed so obvious.
**3/** @nicbarkeragain
**3/** **@nicbarkeragain** ^1944937375001666018
Ironically it might take settling on a standard width among hardware vendors for us to be able to make reasonable headway there. I have no idea whether there are physical limitations to how wide we could go, or whether this would constitute a "pause" on hardware progress...
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @BurnZeZ
**1/** **@BurnZeZ** ^2084148778316034483
@nicbarkeragain
**@nicbarkeragain**
I do and access it via 9p.
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @DjMolehill
**1/** **@DjMolehill** ^2084151008817553509
@nicbarkeragain
**@nicbarkeragain**
brb adding this to my codebase
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @Leonardo_Temp
**1/** **@Leonardo_Temp** ^2084214550358876592
@nicbarkeragain
**@nicbarkeragain**
You can also implicitly pass the source code location from creation so there's no need for explicit labeling a lot of the time. Odin makes this easy with "loc := #caller_location"
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @MikeyBally
**1/** **@MikeyBally** ^2084242087419969733
@nicbarkeragain
**@nicbarkeragain**
This is the way!
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @RazorSharpFang
**1/** **@RazorSharpFang** ^2084147756646670657
@nicbarkeragain
**@nicbarkeragain**
I don't suppose you could demonstrate this with a small code snippet/example that shows HOW one can label an allocation?
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @RealOtisCrune
**1/** **@RealOtisCrune** ^2084110760872128905
@nicbarkeragain
**@nicbarkeragain**
Isn't this just a Python-style docstring with extra steps?
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @_can1357
**1/** **@_can1357** ^2084128363652775945
@nicbarkeragain
**@nicbarkeragain**
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-exallocatepool2 🤘
@@ -26,9 +26,9 @@ parent_post_id: "2084072932293386379"
## Branch
**1/** @borrowck_novel
**1/** **@borrowck_novel** ^2084191310303399995
@nicbarkeragain
**@nicbarkeragain**
Can you post an example of how you would implement it?
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @exacoustics
**1/** **@exacoustics** ^2084099272300253636
@nicbarkeragain
**@nicbarkeragain**
IIRC sokol_gfx does this. It’s really nice. I’ve copied the pattern in my own graphics API
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @joseph_h_garvin
**1/** **@joseph_h_garvin** ^2084138515286081732
@nicbarkeragain
**@nicbarkeragain**
When I've seen this they usually require unique names and then you end up recapitulating the entire creation path in the string to make it unique but still readable, which I kinda hate. Do you not enforce uniqueness? Also a bunch of code to assemble those strings.
@@ -26,15 +26,15 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @onepopcorn
**1/** **@onepopcorn** ^2084163142041427988
@nicbarkeragain
**@nicbarkeragain**
That's actually a smart idea. Do you have an example of how you would implement that?
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^2084852229291516401
@onepopcorn
**@onepopcorn**
Here's an example I came across just now: https://x.com/nicbarkeragain/status/2084851804224004329?s=20
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @petey_fo_really
**1/** **@petey_fo_really** ^2084134337105314188
@nicbarkeragain
**@nicbarkeragain**
ya tagging allocations, and frames to actual assets in-game is absolutely necessary for development once your game stops being a small thing
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @Mallchad
**1/** **@Mallchad** ^2084546183922426362
@nicbarkeragain
**@nicbarkeragain**
I accidentally discovered this myself. It just makes everything so much easier, give every single thing a name and log errors instead of continuing silently.
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @Tomi_Tapio
**1/** **@Tomi_Tapio** ^2084605612764078535
@nicbarkeragain
**@nicbarkeragain**
function "draw string, for debug, in my game's 3d graphical space"
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @codeshaunted
**1/** **@codeshaunted** ^2084528811509719436
@nicbarkeragain
**@nicbarkeragain**
WebGPU has this and it’s a life saver for debugging
@@ -26,9 +26,9 @@ parent_post_id: "2084072929780998198"
## Branch
**1/** @Drainyard
**1/** **@Drainyard** ^2086199401907638656
@nicbarkeragain
**@nicbarkeragain**
This just saved me from hours of debugging.
@@ -25,13 +25,13 @@ in_reply_to: ""
## Thread
**1/** @nicbarkeragain
**1/** **@nicbarkeragain** ^2084072929780998198
IMO basically every "object creation API" you have should take a string label that is for internal use only. You can ifdef them out in release, but it will save you so much grief when debugging. UI elements, mem allocations, input actions, just tag them all with a label / name.
Branches: [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-exacoustics-iirc-sokol-gfx-does-this-its-really-nice-ive]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-RealOtisCrune-isnt-this-just-a-python-style-docstring-with]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-_can1357-https-learn-microsoft-com-en-us-windows-hardware]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-petey_fo_really-ya-tagging-allocations-and-frames-to-actual]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-joseph_h_garvin-when-ive-seen-this-they-usually-require-unique]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-RazorSharpFang-i-dont-suppose-you-could-demonstrate-this-with-a]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-BurnZeZ-i-do-and-access-it-via-9p]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-DjMolehill-brb-adding-this-to-my-codebase]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-onepopcorn-thats-actually-a-smart-idea-do-you-have-an]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-Leonardo_Temp-you-can-also-implicitly-pass-the-source-code]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-03-MikeyBally-this-is-the-way]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-codeshaunted-webgpu-has-this-and-its-a-life-saver-for-debugging]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-Mallchad-i-accidentally-discovered-this-myself-it-just]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-04-Tomi_Tapio-function-draw-string-for-debug-in-my-games-3d]], [[archive/threads/nicbarkeragain/2026-08-03-imo-basically-every-object-creation-api-you-have/2026-08-08-Drainyard-this-just-saved-me-from-hours-of-debugging]]
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^2084072932293386379
There's seriously nothing like going from "we have this memory leak every frame and don't know where tf it is" to "I paused the debugger and inspected the list of allocations, and there are 10,000 of them all labelled 'FormattedUnitName', so I grepped it in 5 seconds"
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @borrowck_novel
**1/** **@borrowck_novel** ^2084886942253007066
@nicbarkeragain
**@nicbarkeragain**
Thanks a lot for the example
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @choco_dolphin7
**1/** **@choco_dolphin7** ^2084879873491779719
@nicbarkeragain
**@nicbarkeragain**
1. Got into the habit of immediately writing free()/close()/etc before anything else 2. Leaks are not that common or scary 3. If it was malloc'd memory, clang catches it for me before I even review + commit it 4. Too much hassle and clutter assigning unique strings to everything
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @datgame
**1/** **@datgame** ^2084939273095073796
@nicbarkeragain
**@nicbarkeragain**
Ah, matching strings, just like xml 🙃
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @eta9499
**1/** **@eta9499** ^2085004503628071423
@nicbarkeragain
**@nicbarkeragain**
DeferLoop is super useful for this
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @hasen_95dx
**1/** **@hasen_95dx** ^2084868526515634252
@nicbarkeragain
**@nicbarkeragain**
this particular case though is easily solved with `defer` or even `closures`
@@ -36,23 +36,23 @@ this particular case though is easily solved with `defer` or even `closures`
// container is closed when this func exits
})
**2/** @nicbarkeragain
**2/** **@nicbarkeragain** ^2084876136631419246
@hasen_95dx
**@hasen_95dx**
Yes, I tend to use the "single iteration for loop" macro trick in C to do this exact thing with scope, but there are still a bunch of cases where you might want to have a direct API that you can use to call open / close:
![](https://pbs.twimg.com/media/HO73smTacAAYau2?format=jpg&name=orig)
**3/** @nicbarkeragain
**3/** **@nicbarkeragain** ^2084876247570813090
@hasen_95dx
**@hasen_95dx**
I've also found explicit open / close to be very useful in rendering tree views / arbitrary recursive hierarchy etc.
**4/** @hasen_95dx
**4/** **@hasen_95dx** ^2084883855505604792
@nicbarkeragain
**@nicbarkeragain**
Right. With the closure approach it would have to change.
@@ -26,7 +26,7 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @lionkimbro10x
**1/** **@lionkimbro10x** ^2084867619786785262
I love everything about this. And I agree, it's fine. We should do more health-checking within programs, and yes, it can be optimized out.
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @plasm_nl
**1/** **@plasm_nl** ^2084924945960759547
@nicbarkeragain
**@nicbarkeragain**
That's a great tip. I always used comments, but this is better.
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @rep_movsd
**1/** **@rep_movsd** ^2084983215874592848
@nicbarkeragain
**@nicbarkeragain**
Or you could use C++ with RAII and not have to tie yourself in knots
@@ -26,9 +26,9 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @windless_mill
**1/** **@windless_mill** ^2085033979053260826
@nicbarkeragain
**@nicbarkeragain**
tangently, this example illustates pretty good why I like syntax with `end` keyword and optional name of closee better than just `{ ... }` especially {} when they also used for structure literals -- finding unbalanced scopes becomes such a hassle sometimes
@@ -26,7 +26,7 @@ parent_post_id: "2084851804224004329"
## Branch
**1/** @real_philogy
**1/** **@real_philogy** ^2085401818083824080
Rust's ownership + RAII makes such patterns really easy and nice to encode statically, no debug strings needed if the compiler guarantees you can't open another object at the same level if the previous one wasn't closed.
@@ -25,7 +25,7 @@ in_reply_to: ""
## Thread
**1/** @nicbarkeragain
**1/** **@nicbarkeragain** ^2084851804224004329
An example of this - a classic way to construct a tree in code is with push / pop style calls. Forgetting to call pop() or close() can be annoying to debug, and you can make this much easier just enforcing matching string tags on open / close. Also enforces readability:
@@ -33,8 +33,8 @@ An example of this - a classic way to construct a tree in code is with push / po
Branches: [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-lionkimbro10x-i-love-everything-about-this-and-i-agree-its-fine]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-hasen_95dx-this-particular-case-though-is-easily-solved-with]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-choco_dolphin7-1-got-into-the-habit-of-immediately-writing-free]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-borrowck_novel-thanks-a-lot-for-the-example]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-plasm_nl-thats-a-great-tip-i-always-used-comments-but-this]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-datgame-ah-matching-strings-just-like-xml]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-rep_movsd-or-you-could-use-c-with-raii-and-not-have-to-tie]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-eta9499-deferloop-is-super-useful-for-this]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-05-windless_mill-tangently-this-example-illustates-pretty-good-why]], [[archive/threads/nicbarkeragain/2026-08-05-an-example-of-this-a-classic-way-to-construct-a/2026-08-06-real_philogy-rusts-ownership-raii-makes-such-patterns-really]]
**2/** @exacoustics
**2/** **@exacoustics** ^2084859876430536882
@nicbarkeragain
**@nicbarkeragain**
Stealing this idea