From cc1522760f27be4fb1d3d1037daeb91af9bb6125 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Wed, 25 Jun 2025 17:56:46 -0700 Subject: [PATCH] more todos, typo fix --- README.md | 2 +- build.bat | 2 +- src/symbol_set.h | 3 ++- todo.txt | 22 ++++++++++++---------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b8337e2..f02e2c7 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ And in a true C Scripting system, there are two more requirements. One it should } ``` -There's no way to achieve this in standard C. However with one non-standard trick we can get there in a fairly satisfying way. And I've tested out `clang` and `cl` for compilers, `clang` and `link` for linkers, and various combinations of optimizations and link time optimizations, and found that this non-standard trick continues to behave as expected across the board. I have yet to test this out on a Linux or Mac machine, or on an a machine with an architecture other than an ARM64, so the research on this technique isn't *finished* but it's looking *very good*. +There's no way to achieve this in standard C. However with one non-standard trick we can get there in a fairly satisfying way. And I've tested out `clang` and `cl` for compilers, `clang` and `link` for linkers, and various combinations of optimizations and link time optimizations, and found that this non-standard trick continues to behave as expected across the board. I have yet to test this out on a Linux or Mac machine, or on an a machine with an architecture other than an AMD64, so the research on this technique isn't *finished* but it's looking *very good*. **Data Sections** diff --git a/build.bat b/build.bat index 3af2d2c..3fe5f61 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,6 @@ @echo off -set opts=-FC -GR- -EHa- -nologo -Zi +set opts=-FC -GR- -EHa- -nologo -Zi -std:c11 -wd5105 set code=%cd% pushd build cl %opts% %code%\src\example1.c -Feexample1 -link -INCREMENTAL:NO diff --git a/src/symbol_set.h b/src/symbol_set.h index bebdef5..3b11ed7 100644 --- a/src/symbol_set.h +++ b/src/symbol_set.h @@ -37,7 +37,8 @@ // user interface -#define SymbolDeclare(E,N) SECTION(E##_section) extern SYMBOL__TYPE(E) SYMBOL__SYM(E,N) +#define SymbolDeclare(E,N) \ +SECTION(E##_section) extern SYMBOL__TYPE(E) SYMBOL__SYM(E,N) #define SymbolDefine(E,N) DO_NOT_ELIMINATE(SYMBOL__SYM(E,N)) SymbolDeclare(E,N) #define SymbolDefineNameless(E) SymbolDefine(E,GLUE(auto,__COUNTER__)) diff --git a/todo.txt b/todo.txt index b663d9e..f67d371 100644 --- a/todo.txt +++ b/todo.txt @@ -8,10 +8,13 @@ Example Writing: - Metaprogramming without needing input -Practical Use Tips: +Research and Provide Practical Use Tips: [ ] See the symbol set in the debugger [ ] Best ideas for solving serialization systems problem +[ ] Shader management +[ ] IDs for profiler blocks +[ ] How does this hold up when multiple DLLs or SOs are involved? Vetting: @@ -46,22 +49,21 @@ Development: [ ] Macho -Structure Research: +"Mark II": [ ] Object file editing for improved memory layout & symbol id references - [ ] Setup count and base pointer symbols - [ ] Learn how to put the symbol data into .data and relink everything - [ ] Setup id symbols & editing to give them values - [ ] Eliminate the "raw" version of symbols +[ ] Setup count and base pointer symbols +[ ] Learn how to put the symbol data into .data and relink everything +[ ] Setup id symbols & editing to give them values +[ ] Eliminate the "raw" version of symbols [ ] Do I want to maintain a pair of versions one with object file editing and one without? -[ ] Explore the tradeoff of using the hook for more complex data initialization - [ ] OpenGL Shaders? + +Other Upgrade Research: + [ ] Could Symbol Sets syntax be organized in such a way that it's just a data section and type wrapped in a macro? -[ ] How does this hold up when multiple DLLs or SOs are involved? -[ ] Try using this to generate the IDs for profiler blocks? Support Tools: