tilts at the windmills of programming
blog logic puzzles piward coding
github profile
𝟘𝟡· I often pass keyword parameters to a subroutine unchanged, and ended up with alot of ‘keyword=keyword’ code in Python function calls. Reserving ‘=’ for the equality
𝕁 predicate (I just replace ‘=’ with ‘==’ when generating Python or C) I instead use ‘→’ to pass keyword parameters - ‘keyword→7’. I added a postfix operator ‘→←’ to
𝕒 pass the value of the variable as the keyword, so I can abbreviate ‘keyword→keyword’ ·as ‘keyword→←’.
𝕟
𝟘𝟠· I've been on a side trip to additional ‘rational’ code generation based on syntactic analysis rather than ad-hoc text manipulation. This next stage let me translate
operators (‘⊗’ and ‘⊙’ for cross and dot-product) into calls to generic functions, but there's more work to make it remotely robust.
𝟛𝟘· I've been bogged down by my bootstrapping shenanigans. I finally decided to re-execl the current build when cyclic dependencies could change generated code. Because
I'm building my tools in place, I use a “revert-bootstraps” routine often to deal with all-to-frequent breakage.
𝟚𝟠· More language infrastructure progress - I've got code generating from the ⟪Violet⟫ language layer that bridges between ⟪Cobalt⟫ (aka C) and ⟪Midnight⟫ (aka Python). I
generate code that uses Python's ‘ctypes’ module to call C from Python, making it easy to mix and match implementations.
𝟚𝟞· I took a small step toward sensible language handling by generating a full parse tree for a small input file. Starting life as a no-op, my evolving ‘zypp’
preprocessor converts ⟪Midnight⟫ and ⟪Cobalt⟫ to Python and C, respectively, in an entirely ad-hoc fashion. At least I know I can create an inviting bug hotel.
Eventually, each language layer I use will share a unified parser, but different intermediate code generators which will perform first level semantic checks. The
𝔻 intermiedate language will support high level primitives that can be lowered to target subsets which can be used to emit code. My ⟪Sapphire⟫ project has a good deal
𝕖 of infrastructure to cope with.
𝕔
𝕖 𝟚𝟚· I'm using ‘⊙‘ for dot product and ‘⊗’ for cross product. My preprocessor translates these from binary operators into calls to ‘dot’ and ‘cross’, which are native in
𝕞 GLSL and implemented in Python to work on number sequences of equal length (dot) or only 3-tuples of numbers (cross).
𝕓
𝕖 𝟚𝟚· While I use Unicode extensively and appreciate its near universal adoption and support, I object to any description of it as a "character set". It is a partial
𝕣 encoding for semantically based typesetting of all human-readable text that includes representations for historic character sets. Ideally, a "character set" provides
an abstract, finite set of symbols for computation and a visual representation that allows human beings to readily identify symbols in a sequence - a simple alphabet.
If we remove codepoints that are control values (modifiers and typesetting indicators) and, for groups of characters which are (subjectively) visually similar,
discard all but one, we are left with a workable character set. But it's a major bonus if human beings can naturally associate meaning with sequences to form a human
readable language. This character set requires knowledge of every alphabet included in Unicode and fluency in at least one language that uses each alphabet. I encode
formal languages and strings using my own (still evolving) ”Zy Logical Character Set" or "Zylch" (the "zy" is vestigial, but still makes for entertaining acronyms).
It's a single byte encoding starting with the digits 0⋯9, followed by the 26 uppercase then 26 lowercase letters of English. Then a bunch of symbols that change from
week to week...
𝟚𝟙· I updated my color text routines that I use in all my Python tools to proceess faster when read into Emacs. One day, I may create an IDE for my ‘neo-retro’
logic-puzzle computing environment, but Emacs is still the best tool for me.
1 𝟭 𝟙𝟘· For my symbolic logic projects, I'm organizing my code around a division between the abstract for logic and concrete programmer-centric domains.
𝟵 / 𝟙𝟘· The git ‘index’ is like a little mini-commit zone. I backup my bare git repositories regularly but by incrementally diffing and reviewing changes using the index
feels lighter weight than a commit, and not atrisk of being pushed or fetched by accident on my test machines.
𝟲 / 𝟙𝟠· I've been enjoying Python's tremendous flexibility but am converging, with support from a preprocessor, on a consistent style. Once things are stable enough to focus
on performance, I'll use my preprocessor to target a mix of C or C++ and a more performant runtime than the standard Python interpreter.