User Tools

Site Tools


technology:dsls_in_c_cpp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
technology:dsls_in_c_cpp [2025/09/09 00:31] – removed - external edit (Unknown date) 127.0.0.1technology:dsls_in_c_cpp [2025/09/09 00:31] (current) – ↷ Page name changed from technology:in_c_cpp to technology:dsls_in_c_cpp Taylor Robbins
Line 1: Line 1:
 +====== Making DSLs in C/C++ ======
 +
 +  * TODO: X-Macros
 +  * TODO: Embedded programming is mostly a matter of making a DSL to talk about hardware operations (usually single write or read instructions to a particular address)
 +  * TODO: ''Print_D'', ''PrintLine_D'', ''WriteLine_D'', ''WriteLine_E'', etc. naming conventions for an array of options. Readability and variable de-cluttering
 +  * TODO: ''VarArrayAdd(type, ...)'' etc. Use macros as a way to do loose type-checking on "templated" API functions and structs, Andrew Reece's talk about parameter packing  and register usage for XAR API
 +  * TODO: Downsides: Multiple evaluation, single statement assumption, parenthesis around parameters, etc.
 +  * TODO: Using macros to implement a crude form of function overloading?
 +  * TODO: Using macros to pass debug information about call-site with ''__FILE__'', ''__LINE__'' and ''__func__''
 +  * TODO: Infix-like syntax with: ''#define _(left, op, right) op(left, right)` -> `_(a, Add, _(b, Mul, c))''
 +  * TODO: X-Macros as a form of table-based code-gen
 +  * TODO: Scraping DSL's inside comments or ''#if 0'' blocks before compilation to do basic codegen
 +  * TODO: Generating code from ''.meta'' files approach in RAD Debugger, X-Macros comparison, scraping comparison
 +
 +