From 9f59f6ee09e3af7bec33c2df335e7076c01f329b Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 26 Aug 2026 10:42:16 -0400 Subject: [PATCH] 1871638900554317934 --- ...n-focus-on-compile-speed-and-small-size.md | 49 ++++++++++++ ...-if-this-is-this-why-msvc-did-away-with.md | 43 ++++++++++ ...-few-compiler-people-and-they-also-hate.md | 37 +++++++++ ...s-of-dropping-simd-are-low-in-the-space.md | 41 ++++++++++ ...r-language-lets-you-run-code-at-compile.md | 43 ++++++++++ ...feel-like-you-sort-of-answered-your-own.md | 37 +++++++++ ...late-to-target-some-subset-of-c-for-the.md | 37 +++++++++ ...consider-the-data-communication-cost-of.md | 49 ++++++++++++ ...ics-apis-you-can-have-a-mapping-for-the.md | 37 +++++++++ ...k-you-should-keep-the-assembler-in-tree.md | 37 +++++++++ ...plan-in-the-long-term-is-to-be-off-llvm.md | 43 ++++++++++ ...-experience-writing-optimized-numerical.md | 37 +++++++++ ...have-two-practical-variable-length-simd.md | 79 +++++++++++++++++++ ...-prefer-a-cool-assembler-and-intrinsics.md | 37 +++++++++ ...dded-dev-working-with-arm-and-some-dsps.md | 39 +++++++++ ...ing-with-my-personal-language-with-some.md | 37 +++++++++ ...der-being-able-to-compile-to-c-then-you.md | 37 +++++++++ ...might-be-worth-looking-at-spirv-v-as-it.md | 39 +++++++++ ...mplete-knowledge-and-opinions-i-believe.md | 41 ++++++++++ ...-the-inevitable-path-down-to-creating-a.md | 41 ++++++++++ ...u-keep-the-tables-in-userspace-but-mark.md | 37 +++++++++ ...fmpeg-is-one-of-the-large-prolific-open.md | 45 +++++++++++ ...serious-work-on-compilers-was-a-project.md | 40 ++++++++++ ...ly-dont-see-a-reason-to-externalize-the.md | 37 +++++++++ ...sting-that-ive-seen-this-exact-issue-re.md | 49 ++++++++++++ ...-i-do-lots-of-asm-intrinsics-i-like-the.md | 37 +++++++++ ...ution-for-this-exact-dillema-in-my-lang.md | 39 +++++++++ ...opcount-and-simd-functions-be-implement.md | 61 ++++++++++++++ ...x512-seems-like-kind-of-a-waste-of-time.md | 49 ++++++++++++ ...er-looked-at-a-real-world-optimizer-are.md | 37 +++++++++ ...-aware-of-fasmg-its-an-assembler-engine.md | 37 +++++++++ ...es-what-you-want-you-just-need-to-learn.md | 51 ++++++++++++ ...o-admit-my-radical-opinion-here-i-think.md | 39 +++++++++ ...s-a-question-of-modularity-in-that-long.md | 39 +++++++++ ...our-metadata-tables-so-large-ryujit-the.md | 39 +++++++++ ...i-implement-simd-for-dlang-d-has-inline.md | 37 +++++++++ .../index.md | 76 ++++++++++++++++++ archive/threads/Jonathan_Blow/index.md | 2 +- 38 files changed, 1590 insertions(+), 1 deletion(-) create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-NOTimothyLottes-suggestion-focus-on-compile-speed-and-small-size.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-OlexGameDev-i-wonder-if-this-is-this-why-msvc-did-away-with.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-PhilAndrew61181-i-know-a-few-compiler-people-and-they-also-hate.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-RufeDotOrg-the-costs-of-dropping-simd-are-low-in-the-space.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-TylerGlaiel-iirc-your-language-lets-you-run-code-at-compile.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-binarybardo-i-feel-like-you-sort-of-answered-your-own.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-bottlecrow_-is-it-too-late-to-target-some-subset-of-c-for-the.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-drathier-please-consider-the-data-communication-cost-of.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-flaratt_ljos-for-graphics-apis-you-can-have-a-mapping-for-the.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-jitl-i-think-you-should-keep-the-assembler-in-tree.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-joe_sweeney-if-the-plan-in-the-long-term-is-to-be-off-llvm.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-ken__maples-in-my-experience-writing-optimized-numerical.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-lemire-we-have-two-practical-variable-length-simd.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-nullspector-i-would-prefer-a-cool-assembler-and-intrinsics.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-spartacosan-as-an-embedded-dev-working-with-arm-and-some-dsps.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-5ms7ltr2-im-working-with-my-personal-language-with-some.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-EskilSteenberg-id-consider-being-able-to-compile-to-c-then-you.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-JBrooksBSI-it-might-be-worth-looking-at-spirv-v-as-it.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-MrJayLC-with-incomplete-knowledge-and-opinions-i-believe.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-_dtx___-feels-like-the-inevitable-path-down-to-creating-a.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-bztree-could-you-keep-the-tables-in-userspace-but-mark.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-hasen_95dx-i-think-ffmpeg-is-one-of-the-large-prolific-open.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-jimrandomh-my-last-serious-work-on-compilers-was-a-project.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-mvandevander-i-definitely-dont-see-a-reason-to-externalize-the.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-nicbarkeragain-its-interesting-that-ive-seen-this-exact-issue-re.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-slimRAWapp-i-do-lots-of-asm-intrinsics-i-like-the.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-stainless_code-as-the-solution-for-this-exact-dillema-in-my-lang.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-strager-can-popcount-and-simd-functions-be-implement.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-Jonathan_Blow-yeah-avx512-seems-like-kind-of-a-waste-of-time.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-LubaRaphael-ive-never-looked-at-a-real-world-optimizer-are.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-akatatsu27-are-you-aware-of-fasmg-its-an-assembler-engine.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-clattner_llvm-llvm-does-what-you-want-you-just-need-to-learn.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-neo_ar218-im-going-to-admit-my-radical-opinion-here-i-think.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-prenex2-i-think-its-a-question-of-modularity-in-that-long.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-tannergooding-why-are-your-metadata-tables-so-large-ryujit-the.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-28-auburnsounds-fwiw-i-implement-simd-for-dlang-d-has-inline.md create mode 100644 archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/index.md diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-NOTimothyLottes-suggestion-focus-on-compile-speed-and-small-size.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-NOTimothyLottes-suggestion-focus-on-compile-speed-and-small-size.md new file mode 100644 index 0000000..a20b054 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-NOTimothyLottes-suggestion-focus-on-compile-speed-and-small-size.md @@ -0,0 +1,49 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Suggestion: focus on compile speed and small size, aka simple code generation (easy to maintain), but not necessarily runtime performance optimal." +type: archive +source: twitter +source_url: "https://x.com/NOTimothyLottes/status/1871645705070330266" +author: "NOTimothyLottes" +handle: NOTimothyLottes +post_id: "1871645705070330266" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Suggestion: focus on compile speed and small size, aka simple code generation (easy to maintain), but not necessarily runtime performance optimal." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/NOTimothyLottes/status/1871645705070330266 +- Author: NOTimothyLottes (@NOTimothyLottes) +- Posted: 2024-12-24 19:54:44 + +## Branch + +**1/** **@NOTimothyLottes** ^1871645705070330266 + +**@Jonathan_Blow** **@rflaherty71** + +Suggestion: focus on compile speed and small size, aka simple code generation (easy to maintain), but not necessarily runtime performance optimal. Then lean more on inline asm or intrinsic guided stuff for perf critical. + +**2/** **@NOTimothyLottes** ^1871646191253152078 + +**@Jonathan_Blow** **@rflaherty71** + +My last x86-64 compiler wasn't even byte aware in code generation. It used dummy prefix to pad out so all opcodes are 32-bit aligned. It was crazy fast to compile though, and dead simple to maintain. The runtime of compiler was still faster in my language than the same in C. + +**3/** **@o__boga** ^1871665809388683564 + +**@NOTimothyLottes** **@Jonathan_Blow** **@rflaherty71** + +Do you have the compiler source available anywhere? + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-OlexGameDev-i-wonder-if-this-is-this-why-msvc-did-away-with.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-OlexGameDev-i-wonder-if-this-is-this-why-msvc-did-away-with.md new file mode 100644 index 0000000..c7a1524 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-OlexGameDev-i-wonder-if-this-is-this-why-msvc-did-away-with.md @@ -0,0 +1,43 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I wonder if this is this why MSVC did away with inline assembly in favor of intrinsics? Just the hassle and maintenance effort involved with assembly generation?" +type: archive +source: twitter +source_url: "https://x.com/OlexGameDev/status/1871681540645957891" +author: "Olex (Solo gamedev Diablo-like) šŸ‡ŗšŸ‡øšŸ‡ŗšŸ‡¦" +handle: OlexGameDev +post_id: "1871681540645957891" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I wonder if this is this why MSVC did away with inline assembly in favor of intrinsics? Just the hassle and maintenance effort involved with assembly generation?" +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/OlexGameDev/status/1871681540645957891 +- Author: Olex (Solo gamedev Diablo-like) šŸ‡ŗšŸ‡øšŸ‡ŗšŸ‡¦ (@OlexGameDev) +- Posted: 2024-12-24 22:17:08 + +## Branch + +**1/** **@OlexGameDev** ^1871681540645957891 + +**@Jonathan_Blow** **@rflaherty71** + +I wonder if this is this why MSVC did away with inline assembly in favor of intrinsics? Just the hassle and maintenance effort involved with assembly generation? + +**2/** **@Jonathan_Blow** ^1871780257369657593 + +**@OlexGameDev** **@rflaherty71** + +Probably not because again they have to do instruction selection. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-PhilAndrew61181-i-know-a-few-compiler-people-and-they-also-hate.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-PhilAndrew61181-i-know-a-few-compiler-people-and-they-also-hate.md new file mode 100644 index 0000000..ad1f3a5 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-PhilAndrew61181-i-know-a-few-compiler-people-and-they-also-hate.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I know a few compiler people and they also hate dependencies, one told me he puts things into modules so the backend and frontend sees as little as possible." +type: archive +source: twitter +source_url: "https://x.com/PhilAndrew61181/status/1871640690092105852" +author: "Phil Andrews" +handle: PhilAndrew61181 +post_id: "1871640690092105852" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I know a few compiler people and they also hate dependencies, one told me he puts things into modules so the backend and frontend sees as little as possible." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/PhilAndrew61181/status/1871640690092105852 +- Author: Phil Andrews (@PhilAndrew61181) +- Posted: 2024-12-24 19:34:48 + +## Branch + +**1/** **@PhilAndrew61181** ^1871640690092105852 + +**@Jonathan_Blow** **@rflaherty71** + +I know a few compiler people and they also hate dependencies, one told me he puts things into modules so the backend and frontend sees as little as possible. Would having a new IR specifically for inline assembly be acceptable? It sounds like it'd reduce surface area + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-RufeDotOrg-the-costs-of-dropping-simd-are-low-in-the-space.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-RufeDotOrg-the-costs-of-dropping-simd-are-low-in-the-space.md new file mode 100644 index 0000000..e8d15d3 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-RufeDotOrg-the-costs-of-dropping-simd-are-low-in-the-space.md @@ -0,0 +1,41 @@ +--- +title: "The costs of dropping SIMD are low in the space of game development." +type: archive +source: twitter +source_url: "https://x.com/RufeDotOrg/status/1871656896412971487" +author: "Alan Newton | Rufe.org" +handle: RufeDotOrg +post_id: "1871656896412971487" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "The costs of dropping SIMD are low in the space of game development." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/RufeDotOrg/status/1871656896412971487 +- Author: Alan Newton | Rufe.org (@RufeDotOrg) +- Posted: 2024-12-24 20:39:12 + +## Branch + +**1/** **@RufeDotOrg** ^1871656896412971487 + +The costs of dropping SIMD are low in the space of game development. Preserving simplicity and having a broad target audience is the more future proof reboot that is required for the unknowns ahead. + +I bet if we did a hard analysis, SIMD benefits benchmarks. + +Games that do juice the hardware to perfection, cannot port to alternative hardware with that same experience. + +I do find uses for applications with SIMD. I think LLVM is a great way to provide a comparable for those that want A B comparison of with and without SIMD. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-TylerGlaiel-iirc-your-language-lets-you-run-code-at-compile.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-TylerGlaiel-iirc-your-language-lets-you-run-code-at-compile.md new file mode 100644 index 0000000..aa7f7c2 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-TylerGlaiel-iirc-your-language-lets-you-run-code-at-compile.md @@ -0,0 +1,43 @@ +--- +title: "IIRC your language lets you run code at compile time as part of the compiling process so why not have the assembler be at that level instead of in the compiler itself and let the compile time code gen be able to output machine code directly & let the assembly instructions be part of the standard library for each specific platform instead?" +type: archive +source: twitter +source_url: "https://x.com/TylerGlaiel/status/1871642886464516129" +author: "Tyler Glaiel" +handle: TylerGlaiel +post_id: "1871642886464516129" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "IIRC your language lets you run code at compile time as part of the compiling process so why not have the assembler be at that level instead of in the compiler itself and let the compile time code gen be able to output machine code directly & let the assembly instructions be part of the standard library for each specific platform instead?" +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/TylerGlaiel/status/1871642886464516129 +- Author: Tyler Glaiel (@TylerGlaiel) +- Posted: 2024-12-24 19:43:32 + +## Branch + +**1/** **@TylerGlaiel** ^1871642886464516129 + +IIRC your language lets you run code at compile time as part of the compiling process so why not have the assembler be at that level instead of in the compiler itself and let the compile time code gen be able to output machine code directly & let the assembly instructions be part of the standard library for each specific platform instead? + +fwiw while I've used intrinsics in C++ at least a little bit here and there, I can't remember the last time I actually needed inline asm, so a "this is a very optional thing that you bring in if you actually need it" seems like the most appropriate design to me + +**2/** **@Jonathan_Blow** ^1871643831869026346 + +**@TylerGlaiel** **@rflaherty71** + +That's what I am talking about at the beginning when I said "put the assembler in userspace" -- it would be code in the language itself rather than internally to the compiler. But we are not going to generate our *own* exe that way because it's slow and indirect. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-binarybardo-i-feel-like-you-sort-of-answered-your-own.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-binarybardo-i-feel-like-you-sort-of-answered-your-own.md new file mode 100644 index 0000000..e5e020d --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-binarybardo-i-feel-like-you-sort-of-answered-your-own.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I feel like you sort of answered your own question." +type: archive +source: twitter +source_url: "https://x.com/binarybardo/status/1871665460976222346" +author: "techboi" +handle: binarybardo +post_id: "1871665460976222346" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I feel like you sort of answered your own question." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/binarybardo/status/1871665460976222346 +- Author: techboi (@binarybardo) +- Posted: 2024-12-24 21:13:14 + +## Branch + +**1/** **@binarybardo** ^1871665460976222346 + +**@Jonathan_Blow** **@rflaherty71** + +I feel like you sort of answered your own question. Go with LLVM for now and slowly phase it out by building out the assembler/optimization/intrisincs as you see what GPU or CPU features win out e.g. SIMD or other + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-bottlecrow_-is-it-too-late-to-target-some-subset-of-c-for-the.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-bottlecrow_-is-it-too-late-to-target-some-subset-of-c-for-the.md new file mode 100644 index 0000000..6c686aa --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-bottlecrow_-is-it-too-late-to-target-some-subset-of-c-for-the.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Is it too late to target some subset of C for the IR and optionally let users pick their own toolchain to build the binary if they want to do something exotic?" +type: archive +source: twitter +source_url: "https://x.com/bottlecrow_/status/1871648603439325255" +author: "šŸ¾šŸ¦ā€ā¬›" +handle: bottlecrow_ +post_id: "1871648603439325255" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Is it too late to target some subset of C for the IR and optionally let users pick their own toolchain to build the binary if they want to do something exotic?" +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/bottlecrow_/status/1871648603439325255 +- Author: šŸ¾šŸ¦ā€ā¬› (@bottlecrow_) +- Posted: 2024-12-24 20:06:15 + +## Branch + +**1/** **@bottlecrow_** ^1871648603439325255 + +**@Jonathan_Blow** **@rflaherty71** + +Is it too late to target some subset of C for the IR and optionally let users pick their own toolchain to build the binary if they want to do something exotic? + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-drathier-please-consider-the-data-communication-cost-of.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-drathier-please-consider-the-data-communication-cost-of.md new file mode 100644 index 0000000..9559bce --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-drathier-please-consider-the-data-communication-cost-of.md @@ -0,0 +1,49 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Please consider the data communication cost of having more than one binary." +type: archive +source: twitter +source_url: "https://x.com/drathier/status/1871648171421729185" +author: "Drathier" +handle: drathier +post_id: "1871648171421729185" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Please consider the data communication cost of having more than one binary." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/drathier/status/1871648171421729185 +- Author: Drathier (@drathier) +- Posted: 2024-12-24 20:04:32 + +## Branch + +**1/** **@drathier** ^1871648171421729185 + +**@Jonathan_Blow** **@rflaherty71** + +Please consider the data communication cost of having more than one binary. Copying data across isn't free, and what data should/shouldn't be accessible to both binaries? + +**2/** **@Jonathan_Blow** ^1871648637299892649 + +**@drathier** **@rflaherty71** + +What binaries are you talking about?? + +**3/** **@drathier** ^1871649089282297947 + +**@Jonathan_Blow** **@rflaherty71** + +The compilers/plugins, not generated code + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-flaratt_ljos-for-graphics-apis-you-can-have-a-mapping-for-the.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-flaratt_ljos-for-graphics-apis-you-can-have-a-mapping-for-the.md new file mode 100644 index 0000000..8f11e58 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-flaratt_ljos-for-graphics-apis-you-can-have-a-mapping-for-the.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 For graphics APIs you can have a mapping for the lowest common denominator with virtually no overhead; is this similar to what you had in mind for intrinsics?" +type: archive +source: twitter +source_url: "https://x.com/flaratt_ljos/status/1871643258969051407" +author: "FlĆ”rĆ”tt" +handle: flaratt_ljos +post_id: "1871643258969051407" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 For graphics APIs you can have a mapping for the lowest common denominator with virtually no overhead; is this similar to what you had in mind for intrinsics?" +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/flaratt_ljos/status/1871643258969051407 +- Author: FlĆ”rĆ”tt (@flaratt_ljos) +- Posted: 2024-12-24 19:45:01 + +## Branch + +**1/** **@flaratt_ljos** ^1871643258969051407 + +**@Jonathan_Blow** **@rflaherty71** + +For graphics APIs you can have a mapping for the lowest common denominator with virtually no overhead; is this similar to what you had in mind for intrinsics? + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-jitl-i-think-you-should-keep-the-assembler-in-tree.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-jitl-i-think-you-should-keep-the-assembler-in-tree.md new file mode 100644 index 0000000..a84eda1 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-jitl-i-think-you-should-keep-the-assembler-in-tree.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I think you should keep the assembler in tree because you know you’re gonna need it for instruction selection." +type: archive +source: twitter +source_url: "https://x.com/jitl/status/1871655925955936459" +author: "Jake šŸŽ‰" +handle: jitl +post_id: "1871655925955936459" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I think you should keep the assembler in tree because you know you’re gonna need it for instruction selection." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/jitl/status/1871655925955936459 +- Author: Jake šŸŽ‰ (@jitl) +- Posted: 2024-12-24 20:35:21 + +## Branch + +**1/** **@jitl** ^1871655925955936459 + +**@Jonathan_Blow** **@rflaherty71** + +I think you should keep the assembler in tree because you know you’re gonna need it for instruction selection. For vectors zig is high level fixed size, user picks size zig makes it work on the platform https://ziglang.org/documentation/0.10.1/#Vectors + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-joe_sweeney-if-the-plan-in-the-long-term-is-to-be-off-llvm.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-joe_sweeney-if-the-plan-in-the-long-term-is-to-be-off-llvm.md new file mode 100644 index 0000000..33ec81f --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-joe_sweeney-if-the-plan-in-the-long-term-is-to-be-off-llvm.md @@ -0,0 +1,43 @@ +--- +title: "If the plan in the long term is to be off LLVM, you’ll need all that code anyway so that is fairly fixed." +type: archive +source: twitter +source_url: "https://x.com/joe_sweeney/status/1871663107753292020" +author: "Joe" +handle: joe_sweeney +post_id: "1871663107753292020" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "If the plan in the long term is to be off LLVM, you’ll need all that code anyway so that is fairly fixed." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/joe_sweeney/status/1871663107753292020 +- Author: Joe (@joe_sweeney) +- Posted: 2024-12-24 21:03:53 + +## Branch + +**1/** **@joe_sweeney** ^1871663107753292020 + +If the plan in the long term is to be off LLVM, you’ll need all that code anyway so that is fairly fixed. My naive impression is that if you want a good cohesive experience you probably need to control that backend no material what, which sucks because that complexity sucks. But you probably wouldn’t want to use someone else’s code gen even it existed. + +For SIMD, I don’t envy your position but my recent experience using ISPC (Intel’s SPMD language) that feels like the future approach for most people writing SIMD code. I also think that an SPMD system should live in userspace and just take in compile time directives and then output intrinsics to the compiler. So then you are just on the hook for providing the user with access to the different CPU instructions then leave the design choices to userland. + +People know which platforms they need to target so just give them the lowest level access so it is possible. Then they can use your other language features to make the cross platform SIMD code that makes sense for them (which seems like what real power users will do even if you provide another abstraction over SIMD). + +To me the compiler’s job would just be to output the best instructions possible, so I would think saving your complexity budget for your own optimizing backends. + +You can take this all with a grain of salt, just some thoughts. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-ken__maples-in-my-experience-writing-optimized-numerical.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-ken__maples-in-my-experience-writing-optimized-numerical.md new file mode 100644 index 0000000..8e63ffd --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-ken__maples-in-my-experience-writing-optimized-numerical.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 In my experience writing optimized numerical routines the \"generic builtins\" approach doesn't work well because the underlying data shape and algo is also influenced by the available instructions and bitwidths of the simd impl." +type: archive +source: twitter +source_url: "https://x.com/ken__maples/status/1871644807279661159" +author: "Ken Maples" +handle: ken__maples +post_id: "1871644807279661159" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 In my experience writing optimized numerical routines the \"generic builtins\" approach doesn't work well because the underlying data shape and algo is also influenced by the available instructions and bitwidths of the simd impl." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/ken__maples/status/1871644807279661159 +- Author: Ken Maples (@ken__maples) +- Posted: 2024-12-24 19:51:10 + +## Branch + +**1/** **@ken__maples** ^1871644807279661159 + +**@Jonathan_Blow** **@rflaherty71** + +In my experience writing optimized numerical routines the "generic builtins" approach doesn't work well because the underlying data shape and algo is also influenced by the available instructions and bitwidths of the simd impl. so you have separate routines per impl anyway + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-lemire-we-have-two-practical-variable-length-simd.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-lemire-we-have-two-practical-variable-length-simd.md new file mode 100644 index 0000000..f4e9744 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-lemire-we-have-two-practical-variable-length-simd.md @@ -0,0 +1,79 @@ +--- +title: "We have two practical variable-length SIMD instruction sets: SVE/SVE2 and RISC-V." +type: archive +source: twitter +source_url: "https://x.com/lemire/status/1871649811981639834" +author: "Daniel Lemire" +handle: lemire +post_id: "1871649811981639834" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "We have two practical variable-length SIMD instruction sets: SVE/SVE2 and RISC-V." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/lemire/status/1871649811981639834 +- Author: Daniel Lemire (@lemire) +- Posted: 2024-12-24 20:11:03 + +## Branch + +**1/** **@lemire** ^1871649811981639834 + +We have two practical variable-length SIMD instruction sets: SVE/SVE2 and RISC-V. + +I don’t know anyone doing useful mainstream work with SVE/SVE2. It runs on AWS/Graviton… but… anyone using it? There might be some niche HPC application. + +RISC-V might get more mileage in the coming years. Maybe. + +I think that the only mainstream software library to support both RISC-V and x64/ARM is the simdutf library (see GitHub). So you can see the intrinsics at play there. It works. + +This being said, there is no sign that variable-length is the future… + +There are downsides: + +1. You often design and test your software with specific registers in mind. What happens when you code is used on different register sizes? + +2. With fixed-length registers, you can have fixed-bit masks (e.g., result of a comparison) which maps nicely to and from general purpose registers. Not so with variable length. This makes algorithmic designs harder. + +Folks like @geofflangdale and @FUZxxl probably share my skepticism of variable-length designs. + +Now: don’t get me wrong… RISC-V is damn sexy. Maybe it is the future. Who knows? + +@pshufb may know more about RISC-V. + +**2/** **@Jonathan_Blow** ^1871653212622651509 + +This all makes sense but what about ā€œactually just do everything as scalars and we will schedule it however we schedule it,ā€ which I think is what won in GPUs? Is there a reason to believe that would not win eventually in CPUs? + +And for fixed length … people cannot even agree on the length right now … which makes it even more of a hassle. + +**3/** **@corsix** ^1871673285098062096 + +**@Jonathan_Blow** **@lemire** **@rflaherty71** + +ā€œactually just do everything as scalars and we will schedule it however we schedule itā€ — whilst true on some GPUs, not true on all GPU-adjacent things, and even where it _is_ true, if you’re really pushing performance, you need to care about it being scheduled as 32-wide SIMD + +**4/** **@Jonathan_Blow** ^1871977920534827033 + +**@corsix** **@lemire** **@rflaherty71** + +If someone writes a program using 4-wide intrinsics, is that really going to help very much at targeting 32-wide? I think the code just has to be written differently. + +**5/** **@Jonathan_Blow** ^1871978586389057974 + +**@corsix** **@lemire** **@rflaherty71** + +It’s a weird spot right now because as far as I know, AVX-512 is still kinda failed on Intel CPUs (??), so anyone who actually wants reliable improvement has to stay at 256 and below… is that going to help someone run much better on a tenstorrent chip? Seems dubious. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-nullspector-i-would-prefer-a-cool-assembler-and-intrinsics.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-nullspector-i-would-prefer-a-cool-assembler-and-intrinsics.md new file mode 100644 index 0000000..660239d --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-nullspector-i-would-prefer-a-cool-assembler-and-intrinsics.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I would prefer a cool assembler and \"intrinsics\" could be implemented with it in userspace." +type: archive +source: twitter +source_url: "https://x.com/nullspector/status/1871677466131280076" +author: "Michael Spector" +handle: nullspector +post_id: "1871677466131280076" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I would prefer a cool assembler and \"intrinsics\" could be implemented with it in userspace." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/nullspector/status/1871677466131280076 +- Author: Michael Spector (@nullspector) +- Posted: 2024-12-24 22:00:56 + +## Branch + +**1/** **@nullspector** ^1871677466131280076 + +**@Jonathan_Blow** **@rflaherty71** + +I would prefer a cool assembler and "intrinsics" could be implemented with it in userspace. I think that would give delightful control for hardcore guys and possibility of convenience for others? + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-spartacosan-as-an-embedded-dev-working-with-arm-and-some-dsps.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-spartacosan-as-an-embedded-dev-working-with-arm-and-some-dsps.md new file mode 100644 index 0000000..9e45d0d --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-spartacosan-as-an-embedded-dev-working-with-arm-and-some-dsps.md @@ -0,0 +1,39 @@ +--- +title: "As an embedded dev working with ARM and some DSPs, I vote for keeping the assembler inside the compiler but stripped down." +type: archive +source: twitter +source_url: "https://x.com/spartacosan/status/1871643969660293329" +author: "Mr. Spartaco" +handle: spartacosan +post_id: "1871643969660293329" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "As an embedded dev working with ARM and some DSPs, I vote for keeping the assembler inside the compiler but stripped down." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/spartacosan/status/1871643969660293329 +- Author: Mr. Spartaco (@spartacosan) +- Posted: 2024-12-24 19:47:50 + +## Branch + +**1/** **@spartacosan** ^1871643969660293329 + +As an embedded dev working with ARM and some DSPs, I vote for keeping the assembler inside the compiler but stripped down. My assembly use is small - interrupt vectors, context switches, and cache operations (mostly). + +SIMD abstraction through assembly or fixed intrinsics is a waste. Better to build a clean IR that expresses vector operations and let your backend pick the implementation. I've seen this work on products where you need to target both Cortex-M and DSP cores. + +These days I only drop to assembly for few hardware-specific bits. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-5ms7ltr2-im-working-with-my-personal-language-with-some.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-5ms7ltr2-im-working-with-my-personal-language-with-some.md new file mode 100644 index 0000000..f3c2a6c --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-5ms7ltr2-im-working-with-my-personal-language-with-some.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I'm working with my personal language with some similarities in philosophies." +type: archive +source: twitter +source_url: "https://x.com/5ms7ltr2/status/1871722647710818436" +author: "AgMenos47" +handle: 5ms7ltr2 +post_id: "1871722647710818436" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I'm working with my personal language with some similarities in philosophies." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/5ms7ltr2/status/1871722647710818436 +- Author: AgMenos47 (@5ms7ltr2) +- Posted: 2024-12-25 01:00:28 + +## Branch + +**1/** **@5ms7ltr2** ^1871722647710818436 + +**@Jonathan_Blow** **@rflaherty71** + +I'm working with my personal language with some similarities in philosophies. Has huge compile time code support. Tho I just sticked using it as x64 asm macro, such that it will always produce 1:1 equivalent,no optimization. For now i just rely to nasm as assembler. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-EskilSteenberg-id-consider-being-able-to-compile-to-c-then-you.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-EskilSteenberg-id-consider-being-able-to-compile-to-c-then-you.md new file mode 100644 index 0000000..0222754 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-EskilSteenberg-id-consider-being-able-to-compile-to-c-then-you.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Id consider being able to compile to C, then you are not dependent on any particular implementation and you are guaranteed to support all platforms." +type: archive +source: twitter +source_url: "https://x.com/EskilSteenberg/status/1871971796163146233" +author: "Eskil Steenberg" +handle: EskilSteenberg +post_id: "1871971796163146233" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Id consider being able to compile to C, then you are not dependent on any particular implementation and you are guaranteed to support all platforms." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/EskilSteenberg/status/1871971796163146233 +- Author: Eskil Steenberg (@EskilSteenberg) +- Posted: 2024-12-25 17:30:30 + +## Branch + +**1/** **@EskilSteenberg** ^1871971796163146233 + +**@Jonathan_Blow** **@rflaherty71** + +Id consider being able to compile to C, then you are not dependent on any particular implementation and you are guaranteed to support all platforms. Once you have that you can make any number of custom backends that are faster + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-JBrooksBSI-it-might-be-worth-looking-at-spirv-v-as-it.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-JBrooksBSI-it-might-be-worth-looking-at-spirv-v-as-it.md new file mode 100644 index 0000000..a8bcce4 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-JBrooksBSI-it-might-be-worth-looking-at-spirv-v-as-it.md @@ -0,0 +1,39 @@ +--- +title: "@Jonathan_Blow @rflaherty71 It might be worth looking at SPIRV-V as it provides cross-platform RTL that can be converted to platform-specific insns with a lightweight driver/converter." +type: archive +source: twitter +source_url: "https://x.com/JBrooksBSI/status/1871735511095894336" +author: "John Brooks" +handle: JBrooksBSI +post_id: "1871735511095894336" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 It might be worth looking at SPIRV-V as it provides cross-platform RTL that can be converted to platform-specific insns with a lightweight driver/converter." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/JBrooksBSI/status/1871735511095894336 +- Author: John Brooks (@JBrooksBSI) +- Posted: 2024-12-25 01:51:35 + +## Branch + +**1/** **@JBrooksBSI** ^1871735511095894336 + +**@Jonathan_Blow** **@rflaherty71** + +It might be worth looking at SPIRV-V as it provides cross-platform RTL that can be converted to platform-specific insns with a lightweight driver/converter. + +At least it looks to me like SPIR-V has dealt with at least some of the issues you describe. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-MrJayLC-with-incomplete-knowledge-and-opinions-i-believe.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-MrJayLC-with-incomplete-knowledge-and-opinions-i-believe.md new file mode 100644 index 0000000..de28523 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-MrJayLC-with-incomplete-knowledge-and-opinions-i-believe.md @@ -0,0 +1,41 @@ +--- +title: "@Jonathan_Blow @rflaherty71 With incomplete knowledge and opinions, I believe in the monolithic compiler." +type: archive +source: twitter +source_url: "https://x.com/MrJayLC/status/1872003048970875193" +author: "John" +handle: MrJayLC +post_id: "1872003048970875193" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 With incomplete knowledge and opinions, I believe in the monolithic compiler." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/MrJayLC/status/1872003048970875193 +- Author: John (@MrJayLC) +- Posted: 2024-12-25 19:34:41 + +## Branch + +**1/** **@MrJayLC** ^1872003048970875193 + +**@Jonathan_Blow** **@rflaherty71** + +With incomplete knowledge and opinions, I believe in the monolithic compiler. +Put the glue layer between OS and Architecture, have the compiler output directly to every supported variant. +Each pain-point will always be in the outputted code. + +No frontend, no backend. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-_dtx___-feels-like-the-inevitable-path-down-to-creating-a.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-_dtx___-feels-like-the-inevitable-path-down-to-creating-a.md new file mode 100644 index 0000000..8a3498a --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-_dtx___-feels-like-the-inevitable-path-down-to-creating-a.md @@ -0,0 +1,41 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Feels like the inevitable path down to creating a bespoke IL." +type: archive +source: twitter +source_url: "https://x.com/_dtx___/status/1872024399718805780" +author: "Jason" +handle: _dtx___ +post_id: "1872024399718805780" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Feels like the inevitable path down to creating a bespoke IL." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/_dtx___/status/1872024399718805780 +- Author: Jason (@_dtx___) +- Posted: 2024-12-25 20:59:32 + +## Branch + +**1/** **@_dtx___** ^1872024399718805780 + +**@Jonathan_Blow** **@rflaherty71** + +Feels like the inevitable path down to creating a bespoke IL. + +Jai -> JaIL -> native + +In terms of WebAssembly, I find AssemblyScript to be a pretty nice example of being low level and approachable. They have the luxury of only one target of course. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-bztree-could-you-keep-the-tables-in-userspace-but-mark.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-bztree-could-you-keep-the-tables-in-userspace-but-mark.md new file mode 100644 index 0000000..57d9d19 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-bztree-could-you-keep-the-tables-in-userspace-but-mark.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Could you keep the tables in userspace, but mark them with a compiler directive saying ā€œuse this table for codegenā€? The compiler would then parse it out in earlier phases for use in the backend." +type: archive +source: twitter +source_url: "https://x.com/bztree/status/1871716850289320025" +author: "Sasha Krassovsky" +handle: bztree +post_id: "1871716850289320025" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Could you keep the tables in userspace, but mark them with a compiler directive saying ā€œuse this table for codegenā€? The compiler would then parse it out in earlier phases for use in the backend." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/bztree/status/1871716850289320025 +- Author: Sasha Krassovsky (@bztree) +- Posted: 2024-12-25 00:37:26 + +## Branch + +**1/** **@bztree** ^1871716850289320025 + +**@Jonathan_Blow** **@rflaherty71** + +Could you keep the tables in userspace, but mark them with a compiler directive saying ā€œuse this table for codegenā€? The compiler would then parse it out in earlier phases for use in the backend. This would let people write custom assemblers while avoiding duplicating the table. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-hasen_95dx-i-think-ffmpeg-is-one-of-the-large-prolific-open.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-hasen_95dx-i-think-ffmpeg-is-one-of-the-large-prolific-open.md new file mode 100644 index 0000000..23620ac --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-hasen_95dx-i-think-ffmpeg-is-one-of-the-large-prolific-open.md @@ -0,0 +1,45 @@ +--- +title: "I think ffmpeg is one of the large & prolific open source projects that maintains huge segments of hand written assembly code, and they maintain separate assembly code for arm (aarch64) and x86." +type: archive +source: twitter +source_url: "https://x.com/hasen_95dx/status/1871744458913710329" +author: "ćƒć‚»ćƒ³ حسن" +handle: hasen_95dx +post_id: "1871744458913710329" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "I think ffmpeg is one of the large & prolific open source projects that maintains huge segments of hand written assembly code, and they maintain separate assembly code for arm (aarch64) and x86." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/hasen_95dx/status/1871744458913710329 +- Author: ćƒć‚»ćƒ³ حسن (@hasen_95dx) +- Posted: 2024-12-25 02:27:08 + +## Branch + +**1/** **@hasen_95dx** ^1871744458913710329 + +I think ffmpeg is one of the large & prolific open source projects that maintains huge segments of hand written assembly code, and they maintain separate assembly code for arm (aarch64) and x86. + +They are so serious about performance, they are willing to take the maintenance burden. + +Can there be, in principle, a high level variant of assembly that would satisfy their needs? Doubtful. + +How many such project are there? Maybe OS kernels and device drivers, but again, it's doubtful that they would want to use a high level assembly. + +There is probably a medium number of projects that would want to write a medium size amount of code in assembly for some critical bottle necks. + +For those people, what would serve them better? High level assembly, or builtin support for SIMD? + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-jimrandomh-my-last-serious-work-on-compilers-was-a-project.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-jimrandomh-my-last-serious-work-on-compilers-was-a-project.md new file mode 100644 index 0000000..24e2f58 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-jimrandomh-my-last-serious-work-on-compilers-was-a-project.md @@ -0,0 +1,40 @@ +--- +title: "(My last serious work on compilers was a project course way back in 2008, where we got as far as doing a few basic optimizations on SSA, allocating registers and doing instruction tiling for x86." +type: archive +source: twitter +source_url: "https://x.com/jimrandomh/status/1871747884145901610" +author: "Jim Babcock" +handle: jimrandomh +post_id: "1871747884145901610" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "(My last serious work on compilers was a project course way back in 2008, where we got as far as doing a few basic optimizations on SSA, allocating registers and doing instruction tiling for x86." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/jimrandomh/status/1871747884145901610 +- Author: Jim Babcock (@jimrandomh) +- Posted: 2024-12-25 02:40:45 + +## Branch + +**1/** **@jimrandomh** ^1871747884145901610 + +(My last serious work on compilers was a project course way back in 2008, where we got as far as doing a few basic optimizations on SSA, allocating registers and doing instruction tiling for x86. So, take this with a grain of salt.) +What I was taught at the time was that, if you want good instruction selection, you're pretty much forced into techniques where you take the available-instruction-set as data. +(In the version I was taught, you have a graph-like representation of each EBB, you have an ISA-specific set of available instruction tiles with cost annotations, you find a covering of your EBB with the tiles, and that's your instruction selection. This is the step where compilers squeeze their memory operations and load-immediates into addressing modes.) +Instruction tiles and instructions aren't exactly the same thing, but they're similar enough that they can probably share tables and a subset of table fields. And as development continues, you'll probably come across assembler-adjacent tasks that you might not have spotted yet. Eg: working with source maps; estimating the execution cost of assembly snippets; handling CPU feature flags. +You'll also have to deal with middle stages of the compiler wanting to know the answers to awkward questions about how much a function costs to call vs to inline, whether a particular loop is worth vectorizing, etc, where the true answer depends on a model of instruction cost. +All of that said... if I were the one writing this compiler, and I also wanted to ship software with it, I would *dream* of getting rid of LLVM, but *plan* on being stuck with it forever, at least for release builds. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-mvandevander-i-definitely-dont-see-a-reason-to-externalize-the.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-mvandevander-i-definitely-dont-see-a-reason-to-externalize-the.md new file mode 100644 index 0000000..86efc8b --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-mvandevander-i-definitely-dont-see-a-reason-to-externalize-the.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I definitely don't see a reason to externalize the assembler if you're going to need it to eventually replace the backend code generation." +type: archive +source: twitter +source_url: "https://x.com/mvandevander/status/1871740606516707446" +author: "Matthew VanDevander" +handle: mvandevander +post_id: "1871740606516707446" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I definitely don't see a reason to externalize the assembler if you're going to need it to eventually replace the backend code generation." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/mvandevander/status/1871740606516707446 +- Author: Matthew VanDevander (@mvandevander) +- Posted: 2024-12-25 02:11:50 + +## Branch + +**1/** **@mvandevander** ^1871740606516707446 + +**@Jonathan_Blow** **@rflaherty71** + +I definitely don't see a reason to externalize the assembler if you're going to need it to eventually replace the backend code generation. I can see the "ick factor" of having a bunch of assembler bloat in the compiler, but I think as end user I would just prefer it be one exe. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-nicbarkeragain-its-interesting-that-ive-seen-this-exact-issue-re.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-nicbarkeragain-its-interesting-that-ive-seen-this-exact-issue-re.md new file mode 100644 index 0000000..bea6cf8 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-nicbarkeragain-its-interesting-that-ive-seen-this-exact-issue-re.md @@ -0,0 +1,49 @@ +--- +title: "@Jonathan_Blow @rflaherty71 It’s interesting that I’ve seen this exact issue (re:llvm) come up in several domains - there is a monolithic solution that is really 10 pieces combined." +type: archive +source: twitter +source_url: "https://x.com/nicbarkeragain/status/1872004349968392462" +author: "Nic Barker" +handle: nicbarkeragain +post_id: "1872004349968392462" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 It’s interesting that I’ve seen this exact issue (re:llvm) come up in several domains - there is a monolithic solution that is really 10 pieces combined." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/nicbarkeragain/status/1872004349968392462 +- Author: Nic Barker (@nicbarkeragain) +- Posted: 2024-12-25 19:39:51 + +## Branch + +**1/** **@nicbarkeragain** ^1872004349968392462 + +**@Jonathan_Blow** **@rflaherty71** + +It’s interesting that I’ve seen this exact issue (re:llvm) come up in several domains - there is a monolithic solution that is really 10 pieces combined. You only need 1 of the pieces, but there are no high quality alternatives to that small part. Huge opportunity there I think. + +**2/** **@ForrestTheWoods** ^1872332567753765090 + +**@nicbarkeragain** **@Jonathan_Blow** **@rflaherty71** + +The amount of useful work LLVM has enabled is staggering. But it seems everyone eventually hates their stuck on LLVM. I don’t know enough to contribute. But agreed it feels like an opportunity. + +**3/** **@nicbarkeragain** ^1872346665841303707 + +**@ForrestTheWoods** **@Jonathan_Blow** **@rflaherty71** + +Absolutely, credit where it’s due they had a huge hand in kick starting the recent wave of new systems programming languages. Feels similar to typescript - awesome idea and functionality, but you become trapped with the poor performance implementation + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-slimRAWapp-i-do-lots-of-asm-intrinsics-i-like-the.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-slimRAWapp-i-do-lots-of-asm-intrinsics-i-like-the.md new file mode 100644 index 0000000..66fa5c0 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-slimRAWapp-i-do-lots-of-asm-intrinsics-i-like-the.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I do lots of asm/intrinsics." +type: archive +source: twitter +source_url: "https://x.com/slimRAWapp/status/1871885245748019616" +author: "slimRAW" +handle: slimRAWapp +post_id: "1871885245748019616" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I do lots of asm/intrinsics." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/slimRAWapp/status/1871885245748019616 +- Author: slimRAW (@slimRAWapp) +- Posted: 2024-12-25 11:46:35 + +## Branch + +**1/** **@slimRAWapp** ^1871885245748019616 + +**@Jonathan_Blow** **@rflaherty71** + +I do lots of asm/intrinsics. I like the convenience of inline asm, but huge perf gains do come from SIMD, which is almost universally now coded as (platform specific) intrinsics in C/C++ land, due to MSVC limitations and AT&T ugliness. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-stainless_code-as-the-solution-for-this-exact-dillema-in-my-lang.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-stainless_code-as-the-solution-for-this-exact-dillema-in-my-lang.md new file mode 100644 index 0000000..a2718ec --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-stainless_code-as-the-solution-for-this-exact-dillema-in-my-lang.md @@ -0,0 +1,39 @@ +--- +title: "@Jonathan_Blow @rflaherty71 As the solution for this exact dillema, in my lang I'm thinking about exposing inline IR to the user." +type: archive +source: twitter +source_url: "https://x.com/stainless_code/status/1871766078629753263" +author: "Yuriy Stets" +handle: stainless_code +post_id: "1871766078629753263" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 As the solution for this exact dillema, in my lang I'm thinking about exposing inline IR to the user." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/stainless_code/status/1871766078629753263 +- Author: Yuriy Stets (@stainless_code) +- Posted: 2024-12-25 03:53:03 + +## Branch + +**1/** **@stainless_code** ^1871766078629753263 + +**@Jonathan_Blow** **@rflaherty71** + +As the solution for this exact dillema, in my lang I'm thinking about exposing inline IR to the user. +Mainly to replace ugly ass intrinsics with concrete operations in msvc inline asm style. +Easy to maintain, arch independent, allows for full range of optimizations. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-strager-can-popcount-and-simd-functions-be-implement.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-strager-can-popcount-and-simd-functions-be-implement.md new file mode 100644 index 0000000..33833cf --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-strager-can-popcount-and-simd-functions-be-implement.md @@ -0,0 +1,61 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Can popcount and SIMD functions be implement using inline assembly? It sounds like they're built into the compiler right now rather than the standard library." +type: archive +source: twitter +source_url: "https://x.com/strager/status/1871740861048140288" +author: "strager" +handle: strager +post_id: "1871740861048140288" +date: 2024-12-25 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Can popcount and SIMD functions be implement using inline assembly? It sounds like they're built into the compiler right now rather than the standard library." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/strager/status/1871740861048140288 +- Author: strager (@strager) +- Posted: 2024-12-25 02:12:51 + +## Branch + +**1/** **@strager** ^1871740861048140288 + +**@Jonathan_Blow** **@rflaherty71** + +Can popcount and SIMD functions be implement using inline assembly? It sounds like they're built into the compiler right now rather than the standard library. + +**2/** **@Jonathan_Blow** ^1871779516584165382 + +**@strager** **@rflaherty71** + +They are currently implemented as inline assembly, but I don’t really like this, and especially don’t like the vision of how this looks when supporting many platforms. + +**3/** **@AgileJebrim** ^1871780076150550779 + +**@Jonathan_Blow** **@strager** **@rflaherty71** + +Have you considered using SPIR-V as an IR to target instead? It lacks the bloat of LLVM but one can conceivably design something with it to target various other SIMD backends. + +**4/** **@Jonathan_Blow** ^1872380932617105796 + +**@AgileJebrim** **@strager** **@rflaherty71** + +That is a pretty weird idea... + +**5/** **@AgileJebrim** ^1872386383861756205 + +**@Jonathan_Blow** **@strager** **@rflaherty71** + +You’d be able to run on GPUs too. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-Jonathan_Blow-yeah-avx512-seems-like-kind-of-a-waste-of-time.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-Jonathan_Blow-yeah-avx512-seems-like-kind-of-a-waste-of-time.md new file mode 100644 index 0000000..cff5124 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-Jonathan_Blow-yeah-avx512-seems-like-kind-of-a-waste-of-time.md @@ -0,0 +1,49 @@ +--- +title: "@sasuke___420 @corsix @lemire @rflaherty71 Yeah, AVX512 seems like kind of a waste of time right now unless one is targeting a specific machine for specific reasons." +type: archive +source: twitter +source_url: "https://x.com/Jonathan_Blow/status/1872123735949680754" +author: "Jonathan Blow" +handle: Jonathan_Blow +post_id: "1872123735949680754" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@sasuke___420 @corsix @lemire @rflaherty71 Yeah, AVX512 seems like kind of a waste of time right now unless one is targeting a specific machine for specific reasons." +in_reply_to: "" +parent_post_id: "1872035848436462007" +--- + +## Source + +- URL: https://x.com/Jonathan_Blow/status/1872123735949680754 +- Author: Jonathan Blow (@Jonathan_Blow) +- Posted: 2024-12-26 03:34:15 + +## Branch + +**1/** **@Jonathan_Blow** ^1872123735949680754 + +**@sasuke___420** **@corsix** **@lemire** **@rflaherty71** + +Yeah, AVX512 seems like kind of a waste of time right now unless one is targeting a specific machine for specific reasons. Especially considering it is slower on some machines. + +**2/** **@lemire** ^1872302642824700298 + +AMD either supported AVX-512 properly, or it did not support it. So they did the right thing. They also support it uniformly. + +I don't know what the PS6 will run on, but if it is an AMD processor, then it will have very good AVX-512. + +And good AVX-512 is very, very good. It is a very good ISA. Don't dismiss it. + +If I am given a console with modern AVX-512 (Zen 4 or better, VBMI2+) and you are not giving me access to AVX-512, then I'll consider you made a big mistake. + +Initially, it looked like .NET would not provide AVX-512 intrinsics, and I was also skeptical... I paid little attention to AVX-512 relatively speaking... But AMD Zen 4 changed all that. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-LubaRaphael-ive-never-looked-at-a-real-world-optimizer-are.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-LubaRaphael-ive-never-looked-at-a-real-world-optimizer-are.md new file mode 100644 index 0000000..ac876b8 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-LubaRaphael-ive-never-looked-at-a-real-world-optimizer-are.md @@ -0,0 +1,37 @@ +--- +title: "I’ve never looked at a real-world optimizer." +type: archive +source: twitter +source_url: "https://x.com/LubaRaphael/status/1872174154872475966" +author: "Raphael Luba" +handle: LubaRaphael +post_id: "1872174154872475966" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "I’ve never looked at a real-world optimizer." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/LubaRaphael/status/1872174154872475966 +- Author: Raphael Luba (@LubaRaphael) +- Posted: 2024-12-26 06:54:36 + +## Branch + +**1/** **@LubaRaphael** ^1872174154872475966 + +I’ve never looked at a real-world optimizer. Are they really table-driven so that they would use the same structure as our x64 assembler to figure out instructions and optimizations? +Or are they instead built from a basic operation-to-instruction mapping (like the current x64 backend) plus a thousand rules like "if I detect this kind of pattern, replace it with this instruction sequence"? +If it is the latter, they would use different structures anyways and we could factor out the assembler without impacting the optimizer very much. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-akatatsu27-are-you-aware-of-fasmg-its-an-assembler-engine.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-akatatsu27-are-you-aware-of-fasmg-its-an-assembler-engine.md new file mode 100644 index 0000000..6ea8487 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-akatatsu27-are-you-aware-of-fasmg-its-an-assembler-engine.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Are you aware of fasmg? It's an assembler engine, meaning that even the instruction sets are libraries (literally just include 'http://avx.inc')." +type: archive +source: twitter +source_url: "https://x.com/akatatsu27/status/1872264430530306523" +author: "akatatsu27" +handle: akatatsu27 +post_id: "1872264430530306523" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Are you aware of fasmg? It's an assembler engine, meaning that even the instruction sets are libraries (literally just include 'http://avx.inc')." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/akatatsu27/status/1872264430530306523 +- Author: akatatsu27 (@akatatsu27) +- Posted: 2024-12-26 12:53:19 + +## Branch + +**1/** **@akatatsu27** ^1872264430530306523 + +**@Jonathan_Blow** **@rflaherty71** + +Are you aware of fasmg? It's an assembler engine, meaning that even the instruction sets are libraries (literally just include 'http://avx.inc'). It has flexible code gen and syntax, and It's small and fast. https://flatassembler.net/docs.php?article=fasmg + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-clattner_llvm-llvm-does-what-you-want-you-just-need-to-learn.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-clattner_llvm-llvm-does-what-you-want-you-just-need-to-learn.md new file mode 100644 index 0000000..d35a5f2 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-clattner_llvm-llvm-does-what-you-want-you-just-need-to-learn.md @@ -0,0 +1,51 @@ +--- +title: "LLVM does what you want, you just need to learn what the MC layer is all about." +type: archive +source: twitter +source_url: "https://x.com/clattner_llvm/status/1872213611076276706" +author: "Chris Lattner" +handle: clattner_llvm +post_id: "1872213611076276706" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "LLVM does what you want, you just need to learn what the MC layer is all about." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/clattner_llvm/status/1872213611076276706 +- Author: Chris Lattner (@clattner_llvm) +- Posted: 2024-12-26 09:31:23 + +## Branch + +**1/** **@clattner_llvm** ^1872213611076276706 + +LLVM does what you want, you just need to learn what the MC layer is all about. Solved years ago for those in the know. + +LLVM’s mid-level optimizations are not great for many reasons (see mojo talks at the llvm dev meetings) but it’s codegen is unmatched, particularly when you get to the vagaries of SIMD, ai instructions and all the other things that unlock the flops on modern cpus. + +Lots of people observe (correctly) that llvm is annoying and imagine the fun part of building a code generator, only to forget the actually hard part. + +**2/** **@Jonathan_Blow** ^1872381307587592486 + +As I mentioned somewhere in that giant wall of text, we just can't take on LLVM as a core dependency because it is too big and cumbersome and slow at compiling. This is mostly not your fault, much of it happened more recently, but it is what it is. + +We already have a code generator for x86, it just doesn't do the hard part yet. Yay. + +**3/** **@lmcanavals** ^1872396117855650223 + +**@Jonathan_Blow** **@clattner_llvm** **@rflaherty71** + +Aw, man I got my hopes up for an epic cross over + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-neo_ar218-im-going-to-admit-my-radical-opinion-here-i-think.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-neo_ar218-im-going-to-admit-my-radical-opinion-here-i-think.md new file mode 100644 index 0000000..63fc000 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-neo_ar218-im-going-to-admit-my-radical-opinion-here-i-think.md @@ -0,0 +1,39 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I'm going to admit my radical opinion here, I think high level languages have been a mistake in general and that all you really want at all is a high level assembler." +type: archive +source: twitter +source_url: "https://x.com/neo_ar218/status/1872171172550553842" +author: "Neo Ar" +handle: neo_ar218 +post_id: "1872171172550553842" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I'm going to admit my radical opinion here, I think high level languages have been a mistake in general and that all you really want at all is a high level assembler." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/neo_ar218/status/1872171172550553842 +- Author: Neo Ar (@neo_ar218) +- Posted: 2024-12-26 06:42:45 + +## Branch + +**1/** **@neo_ar218** ^1872171172550553842 + +**@Jonathan_Blow** **@rflaherty71** + +I'm going to admit my radical opinion here, I think high level languages have been a mistake in general and that all you really want at all is a high level assembler. + +Of course you need that functionality in the compiler codebase proper and it will pay dividends in the long term + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-prenex2-i-think-its-a-question-of-modularity-in-that-long.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-prenex2-i-think-its-a-question-of-modularity-in-that-long.md new file mode 100644 index 0000000..67b79bb --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-prenex2-i-think-its-a-question-of-modularity-in-that-long.md @@ -0,0 +1,39 @@ +--- +title: "@Jonathan_Blow @rflaherty71 I think its a question of modularity in that long term plan sounds like totally replacing LLVM." +type: archive +source: twitter +source_url: "https://x.com/prenex2/status/1872098444472635499" +author: "prenex" +handle: prenex2 +post_id: "1872098444472635499" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 I think its a question of modularity in that long term plan sounds like totally replacing LLVM." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/prenex2/status/1872098444472635499 +- Author: prenex (@prenex2) +- Posted: 2024-12-26 01:53:45 + +## Branch + +**1/** **@prenex2** ^1872098444472635499 + +**@Jonathan_Blow** **@rflaherty71** + +I think its a question of modularity in that long term plan sounds like totally replacing LLVM. I find benefit in having a targetable backend also for other languages without that being LLVM so there would be probably interests for that anyways. + +Sounds like tables shoud go ther + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-tannergooding-why-are-your-metadata-tables-so-large-ryujit-the.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-tannergooding-why-are-your-metadata-tables-so-large-ryujit-the.md new file mode 100644 index 0000000..be031c1 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-tannergooding-why-are-your-metadata-tables-so-large-ryujit-the.md @@ -0,0 +1,39 @@ +--- +title: "@Jonathan_Blow @rflaherty71 Why are your metadata tables so large?" +type: archive +source: twitter +source_url: "https://x.com/tannergooding/status/1872360804093423891" +author: "Tanner Gooding" +handle: tannergooding +post_id: "1872360804093423891" +date: 2024-12-26 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 Why are your metadata tables so large?" +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/tannergooding/status/1872360804093423891 +- Author: Tanner Gooding (@tannergooding) +- Posted: 2024-12-26 19:16:17 + +## Branch + +**1/** **@tannergooding** ^1872360804093423891 + +**@Jonathan_Blow** **@rflaherty71** + +Why are your metadata tables so large? + +RyuJIT (the main backing compiler for .NET) supports hardware intrinsics for and emitting most instructions (general purpose or SIMD) on x64, Arm64, & is adding for others. The entirety of the tables and support for all these is far smaller + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-28-auburnsounds-fwiw-i-implement-simd-for-dlang-d-has-inline.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-28-auburnsounds-fwiw-i-implement-simd-for-dlang-d-has-inline.md new file mode 100644 index 0000000..52ee869 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-28-auburnsounds-fwiw-i-implement-simd-for-dlang-d-has-inline.md @@ -0,0 +1,37 @@ +--- +title: "@Jonathan_Blow @rflaherty71 FWIW I implement SIMD for Dlang." +type: archive +source: twitter +source_url: "https://x.com/auburnsounds/status/1873092710263079401" +author: "Auburn Sounds" +handle: auburnsounds +post_id: "1873092710263079401" +date: 2024-12-28 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "@Jonathan_Blow @rflaherty71 FWIW I implement SIMD for Dlang." +in_reply_to: "" +parent_post_id: "1871638900554317934" +--- + +## Source + +- URL: https://x.com/auburnsounds/status/1873092710263079401 +- Author: Auburn Sounds (@auburnsounds) +- Posted: 2024-12-28 19:44:37 + +## Branch + +**1/** **@auburnsounds** ^1873092710263079401 + +**@Jonathan_Blow** **@rflaherty71** + +FWIW I implement SIMD for Dlang. D has inline assembly, but minimal use. inline asm end up almost always slower than intrinsics. The exception to that is LLVM and GCC __asm that can inline in caller, and works in debug mode since no optimize needed. Else intrinsics win. + +## Related + +- Spine: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]] diff --git a/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/index.md b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/index.md new file mode 100644 index 0000000..f5b2b38 --- /dev/null +++ b/archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/index.md @@ -0,0 +1,76 @@ +--- +title: "I have a moral dilemma in the design of the programming language." +type: archive +source: twitter +source_url: "https://x.com/Jonathan_Blow/status/1871638900554317934" +author: "Jonathan Blow" +handle: Jonathan_Blow +post_id: "1871638900554317934" +date: 2024-12-24 +archived: 2026-08-26 +draft: false +tags: + - archive + - twitter + - Jonathan_Blow +description: "I have a moral dilemma in the design of the programming language." +in_reply_to: "" +--- + +## Source + +- URL: https://x.com/Jonathan_Blow/status/1871638900554317934 +- Author: Jonathan Blow (@Jonathan_Blow) +- Posted: 2024-12-24 19:27:41 + +## Thread + +**1/** **@Jonathan_Blow** ^1871638900554317934 + +I have a moral dilemma in the design of the programming language. + +We have an assembler built into the compiler, x86-only right now, written by @rflaherty71; it is high-level and nice to use if you program a lot in assembly, but, it is looking like that is a very rare use case. + +Because the x64 instruction format is such a nightmare, the assembler uses this big table-driven system to generate instructions. There are 20,000 lines of tables and then a few thousand lines of code for the actual assembler ... but all together this comprises about 25% of the source code of the entire compiler, just to do assembly language on one platform. + +And of course we want to do other CPUs -- at least ARM, certainly some other ones before too long. + +I had a plan I was excited about to externalize the assembler -- put it in userspace and provide a good convention by which arbitrary userspace assemblers could interoperate with the compiler. I started working on this yesterday and it's partially done. + +Then I realized, wait -- in the long term we don't want to depend on LLVM or any other backend to generate code, and in fact we would like to remove LLVM as soon as is feasible because it is such a horrifically cumbersome dependency. The main functionality we get out of LLVM right now is the ability to target various CPUs or WASM, and the ability to optimize very well. We have our own x64-only backend, but it doesn't optimize. + +And here's the thing. If we want to generate good output machine code, that involves good instruction selection, which means ... we would have something like that 20,000 lines of tables compiled in anyway (??), which removes most of the complexity-reduction benefit in externalizing the compiler. We still gain from letting people have freedom in terms of doing assembly stuff, but realistically this is still a very small percentage of the audience, even among the hardcore programmers that are our intended user base. + +But if I externalize the assembler then we are *doubling* the amount of complexity we maintain, because now there are all these tables compiled into the compiler, and then there's also a user-level module. + +So that seems like a bummer in the short-term where we are already limited in rate of progress by complexity of the compiler. + +One other motivation for externalizing the assemblers is that it would seemingly solve one of the problems we have currently, which is that we only let you do assembly for x86. Day one as soon as we turn this on, people could do assembly for ARM etc, even if it was some janky assembler they wrote, and this could be improved over time. + +But this is only true because we lean on LLVM to generate ARM code right now. As soon as we stop doing that, the compiler needs itself to generate ARM code with good instruction selection, and we are back to the problem I described before. If you imagine the long-term future of any compiler, it needs to be able to generate machine code for any platform you are targeting, so externalizing this ability is actually duplication of functionality in all cases. + +So maybe it's better to keep the assembler inside the compiler and not do a userspace one. But there's also a problem with that -- our assembly language, while high-level in a really nice way (example, it lets you use variable names and those get mapped to registers, so you don't have to sweat over exactly what register holds what all the time), anyway, while nice, it's also kind of opinionated in terms of syntax etc, which means if you have some assembly code from some reference that you would like to use, you basically have to rewrite it, you can't just paste it in. That is a downside. (And I imagine that for something like WASM you would really want to be able to paste it in? Or maybe WASM is so broken this doesn't make sense either. I haven't investigated.) + +Also it's unclear how similar the syntax would look for ARM, etc, and if you have to learn a totally different kinda-high-level syntax for every single target, that sucks too. + +I feel like there is a market out there for a compiler backend component that takes upon itself the job of machine code generation *only*. In principle LLVM does this but it's a tremendous headache, in part because LLVM is extremely non-reality-based in some of the ways it does things (you would not believe the huge hassle we have to go through just to tell LLVM about pointers in global data -- something that you need to do when outputting data for almost any programming language. It is a bunch of complicated and potentially slow code that has to run every time you compile, when it *should* be trivial for us just to give LLVM a flat array of pointer positions and be done with it, BECAUSE THAT IS WHAT EVERY OPERATING SYSTEM WANTS). + +If there were a useful long-term component we could integrate that solves some of these problems -- either a machine code generator or an assembler or both -- I would consider using it, if it does not cause us to fail at our long-term goals (LLVM cannot be a core component for this reason -- it is way too slow and would cause us to fail our performance goals). + +One more ingredient in all this is the changing role of assembly language. Back when we put an assembler into the compiler, I imagined that we would have almost no intrinsics, and if you want to do something very specific, even like SIMD or whatever, you would drop to the assembly language, and it would be nice enough to do a good job there. + +But as things have played out, I don't like how this manifests itself in the 'standard library' that we provide, even just for x86 so far. If we start adding other CPUs it will really bloat the code and make it a lot less readable, and this starts to ruin one of the things I feel we have been very successful at: providing a readable, understandable standard library that does not make you feel sick when you look at it. (C and C++ veterans will know what I am talking about here). That's very valuable to me and I don't want to wreck it. + +So I am starting to think about, okay, maybe we pivot back toward having intrinsics for stuff like vector instructions, and we try to provide a base set that can target multiple CPUs so you don't have to do anything platform-specific in most code. And then if you want the absolute best performance maybe you do assembly. + +But this also seems shortsighted, because x86-style vector instructions as we have them today seem like a very particular design that may not be what anyone wants in the future. (There are CPU designs where you do vectors of arbitrary length, and GPUs started with this assumption "we are going to do everything as 4-vectors" back in the early days, but as they got more sophisticated, as far as I know they completely devectorized and everything is scalars or is revectorized to particular sizes behind the scenes because this is how you actually make things fast. [But I am vaguely guessing here; this is not my area at all.] AI processors, I don't even know what they look like if you try to program them with general code, but it is probably not 4- or 8-wide SIMD.) + +(That 20,000 lines of tables that I mentioned above is *mostly* filled with all the poopy SIMD instructions that were introduced in the past N years. Without them the table would be much smaller and I wouldn't feel so icky about it. Maybe we can compress the table because we have one entry per size/etc ... to pick a random instruction, pcmpeq has 15 elements in this table, and by the time the necessary data gets all defined, for about 180 lines of the table's source code. Just for that one instruction.) + +But the point here is that if we pivot back toward intrinsics for SIMD and other stuff (popcount, bit seeks, etc), then we are getting much less use out of the assembler, which seems to imply we should choose a design where we invest less in it. But we still need to do good instruction selection, argh. + +I probably forgot to mention several significant factors of this question, but there you go. I am trying to do the most functional and excellent thing for the user, and it's not obvious what that is, given the opportunity cost of any implementation work we do. + +Comments welcome. + +Branches: [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-PhilAndrew61181-i-know-a-few-compiler-people-and-they-also-hate]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-TylerGlaiel-iirc-your-language-lets-you-run-code-at-compile]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-flaratt_ljos-for-graphics-apis-you-can-have-a-mapping-for-the]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-spartacosan-as-an-embedded-dev-working-with-arm-and-some-dsps]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-ken__maples-in-my-experience-writing-optimized-numerical]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-NOTimothyLottes-suggestion-focus-on-compile-speed-and-small-size]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-drathier-please-consider-the-data-communication-cost-of]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-bottlecrow_-is-it-too-late-to-target-some-subset-of-c-for-the]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-lemire-we-have-two-practical-variable-length-simd]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-jitl-i-think-you-should-keep-the-assembler-in-tree]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-RufeDotOrg-the-costs-of-dropping-simd-are-low-in-the-space]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-joe_sweeney-if-the-plan-in-the-long-term-is-to-be-off-llvm]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-binarybardo-i-feel-like-you-sort-of-answered-your-own]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-nullspector-i-would-prefer-a-cool-assembler-and-intrinsics]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-24-OlexGameDev-i-wonder-if-this-is-this-why-msvc-did-away-with]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-bztree-could-you-keep-the-tables-in-userspace-but-mark]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-5ms7ltr2-im-working-with-my-personal-language-with-some]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-JBrooksBSI-it-might-be-worth-looking-at-spirv-v-as-it]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-mvandevander-i-definitely-dont-see-a-reason-to-externalize-the]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-strager-can-popcount-and-simd-functions-be-implement]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-hasen_95dx-i-think-ffmpeg-is-one-of-the-large-prolific-open]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-jimrandomh-my-last-serious-work-on-compilers-was-a-project]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-stainless_code-as-the-solution-for-this-exact-dillema-in-my-lang]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-slimRAWapp-i-do-lots-of-asm-intrinsics-i-like-the]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-EskilSteenberg-id-consider-being-able-to-compile-to-c-then-you]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-MrJayLC-with-incomplete-knowledge-and-opinions-i-believe]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-nicbarkeragain-its-interesting-that-ive-seen-this-exact-issue-re]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-25-_dtx___-feels-like-the-inevitable-path-down-to-creating-a]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-prenex2-i-think-its-a-question-of-modularity-in-that-long]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-neo_ar218-im-going-to-admit-my-radical-opinion-here-i-think]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-LubaRaphael-ive-never-looked-at-a-real-world-optimizer-are]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-clattner_llvm-llvm-does-what-you-want-you-just-need-to-learn]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-akatatsu27-are-you-aware-of-fasmg-its-an-assembler-engine]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-tannergooding-why-are-your-metadata-tables-so-large-ryujit-the]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-28-auburnsounds-fwiw-i-implement-simd-for-dlang-d-has-inline]], [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the/2024-12-26-Jonathan_Blow-yeah-avx512-seems-like-kind-of-a-waste-of-time]] diff --git a/archive/threads/Jonathan_Blow/index.md b/archive/threads/Jonathan_Blow/index.md index 1a218aa..db576ff 100644 --- a/archive/threads/Jonathan_Blow/index.md +++ b/archive/threads/Jonathan_Blow/index.md @@ -9,4 +9,4 @@ tags: - Jonathan_Blow --- - +- [[archive/threads/Jonathan_Blow/2024-12-24-i-have-a-moral-dilemma-in-the-design-of-the]]