Working on validating v1.0 functionality.
- flatten
turmite/lang/...intoturmite/... RuleConstantsshifts are awkward ; seeturmite/test.jsfor a starting point- debug initial hex scale bug ; also mobile
- refactor
glslshader.jsandglprogram.js- move linking to program;
program becomes
new GLProgram(gl, shader1, shader2, ...) - provide uniform / attrib introspection from shader;
shader become
new GLSLShader({name, type, source, uniformNames, attribNames})- with name extraction done at build time by
glsl-loader.jsusing the parser we added for minification
- with name extraction done at build time by
- move linking to program;
program becomes
hextiletree.jsrefactor to linear(-ish) form- either on a
Map<{key, mask}, tile>or onArray<tile>sorted byArray<{key, mask}> - probably a good time to move to maker form
- once there's only need for a single pool (no more nodes), flatten it into
hextile.js, droppingpool.js
- either on a
- revamp
coord.js- push conversions out to callers
- maybe drop the
typefield? - can we eliminate
CubePoint(it only has a couple of users)?
- switch classes out for maker pattern throughout; initial uplift pass above may do so when scope is small enough to be easily done in passing
- decompose
hexant.js- inline much of the specific integration/controller logic into
public/index.html - factor out a stats component for fps, sps, timing, etc
- factor out a keymap component, which can later be a basis for a help overlay
- inline much of the specific integration/controller logic into
- refactor
World.entsto be properly system oriented, rather than have the world model itself participate in per-ent concerns; rectify how views relate to all that jazz - separate tile rendering module
- separate turmite sim module
- use
constants.Turnto type extracted turn results out of aRulestable, rather than using rawnumbertypes - switch away from nearley to a custom recursive descent parser
- make
turmite.ruleHelpinteractive - feature to specify a fixed state rule
- e.g. to "lift" an ant
- e.g. to precede a simplified rule of the form
when-c => then-c, then-turn - idea:
state = 42: ant(...);state = 42: c => c + 1, turns(R L)- coidea:
color = 2*c: s => s + 1, L color = 2*c+1: s => s + 1, R color = 16*c+1: _ => F
- coidea:
- ternary expressions?
- what would that even mean in an LHS when match?
- .... probably can work actually, but will need a revamp of the solver/matcher
- most useful tho for the RHS... but what can it achieve that isn't possible with multiple rules?
- what would that even mean in an LHS when match?
- asyncify the gap between view and sim
- view can somehow subscribe to updates every N steps
- could also pair will with a viewport box, rather than always-global views
- move sim into a web worker
- a low level immediate mode context over DOM elements and events
- key processing
- text
- button
- input.text
- textarea
- a high level immediate mode context over request commands and response events
{prompt: string, help?: string}...{response: string}{status: string[]}
- should be feasible to write other low level layers eventually, e.g. one that would process an event stream and draw into a GL context ( or generate an intermediate buffer of GL commands... )
- NOTE: the
src/prompt.jsmodule is experimenting towards this
- port turmite sim to Go... shard and scale over goroutines
- maybe allow shard(s) to run locally in a background web worker
- make
ant(...)usable as a rule RHS to fix its whenState / thenState terms
- vercel build description isn't picking up the tag since v0.11.1
- simplified world/view surface down to just
reset()andredraw()- world now tracks visited bounding box, which view syncs to at top of
redraw, eliminating a potentially expensive and redundant call from
world.stepn(n)inner loop - simplified various aspects of bounding box logic around
OddQBoxexpansion, which now works correctly when starting from an empty box - simplified view color scheme palette build, to happen once at top of redraw, and simply sync to the number of colors / entities; no more entity add/remove/update/delete interface
- world now tracks visited bounding box, which view syncs to at top of
redraw, eliminating a potentially expensive and redundant call from
- this ended up fixing part of the initial view scale problem, since the viewport had previously been starting out empty, rather than containing the first entity-occupied cell
- expanded test coverage to include all sources
- expand type checking to tests and
index.jx - picked back up development
- ran
npm audit fix - ran
npm update- fixed new typescript complaint
- ran
- simplified RAF usage based motivated by typescript global error
- adapted build script to not fully nuke the build directory, allowing usage of
git-worktreeto track thegh-pagesbranch - changed keymap to watch click events than mouseup events to easily fix mobile touch event, without needing to care about them directly yet
- shipped as v0.11.0
- further generalized prompt so that it doesn't require a text box
- generalized keymaps into actions
- improving representation of shifted keys and space keys
- now supporting the escape key to cancel
- flattened
turmite/lang/...intoturmite/...now that there is only the nearley driven parser - refactored
analyze.transformto support deleting nodes - moved turmite code actions into the analyze package
- subsumed comments and @directives into turmite language module
- tried and failed to add comments/@directives to nearley grammar
- ...then spent some time trying to write a new parser module form scratch, abandoned for now due to frustration with variadic tuple types
- ...then circled back to the nearley grammar, and was able to add comments and @directives on a second try
- eliminated legacy
walk.dfsroutines:dfsPreandcollecthave already been replace byanalyze.transform()- flattened remainder into
toSpecStringand simplified into a recursive generator, no more string building stack ops
- reified compile scope management
- now there's a nestable
makeScope() => Scopeset-ish of symbols - used for block construction
- now there's a nestable
- added strict "all symbols must be defined" check to value compilation
- flattened spec node, allowing assigns to interleave rules, and setting up for
directives / comments next
- such interleaving enabled by scope rework, since assigns can happen anywhere more robustly now
- refactored language analysis module
- added suite of grammar node maker functions
- refactored analysis around generic node tree transformation that does not mutate the input tree
- evicted all application code into the compile module
- turn counting and symbol collision check now happen where they did before, but have no potential to mutate the parsed input tree
- tmp hoisting has been pushed down into a refactored
compileRuleunit that makes rule scope manipulation more coherent - commented out block about bare
turns()auto-color-indexing also left for future resurrection
- refactored language compile module
- reified
block()handling - made
wrap()andamend()more ergonomic - rule compilation more coherent, easier to re-use for
ant(...)
- reified
- implemented
ant(...)alternate rule form- compiles thru all the same rule paths as normal
{when, then}form by way of a newanalyze.antRule()transform
- compiles thru all the same rule paths as normal
- added explicitly null then rules
- this allows rules like
0, c % 32 => 1, _, _that only change the state field, pass on the color and turn fields
- this allows rules like
- let prompt
{help}be an iterable string body, naturalizing functions liketurmiteRuleHelp - ditched all WIP work towards a general interactive
/commandand help system in prompt, will experiment towards that again someday, currently planned for thev1.3language phase turmite/lang- now compiles directly to a
Builderfunction - erased the
_resulttemporary, inlining then-comments withing one multi-line bitwise or-shift construct
- now compiles directly to a
- improved turmite test tool
- added command to run a compiled module
- fixed rules dump, and elide runs of 0-result rules
- fixed mixed up
Worldmask constants... wasn't detected before because of the update loop hardcodes... - fixed
Turmite.TestSpecmask and shift constants - fixed symbolic solver to actually work for non-trivial matches like
16 * c - 1 - added a bi-modal ant text example
- finished out
@numColorsdirective
- finished out color halver test case and its collatz progeny
- added verbose value and code logging options to
isTurmite()test utility
- added verbose value and code logging options to
- started working on comment / directive syntax for specifying numColors broader than required for a turmite's turn sequence
- broke up turmite help routines ahead of making them more elaborate / interactive
- fixed
scripts/ed.js, wasn't including a final newline before, which led to eventual churn once re-added by $editor - switched rule then mode to
=by default, which is less surprising than|= - refactored test harness ahead of adding more involved turmite examples
- improved turmite rule compilation while trying to add a new "color halver" test, many small bug fixes, and the generated code is now much more readable / natural, including more spec-string fragment comments
- further work on prompt ux
- made prompt semantics be a clean start each round, no carry over state
- added explicit
{title}header support - added
{command}buttons - concatenate all
{help}outputs
- refactored
promptmodule over a newInteractor<T>type that is a generator of outputs given inputs; this allows basic responsive help now, and will allow more structural interaction later like action commands - improved prompt legibility
- don't let it take more than 50% of viewport height, make long errors scroll
- provider clearer ant parse errors that don't leak turmite grammar rules
- added conversion button for ant => turmites
- uplifted all tests and got them passing
- including
tests/hextiletree.jswhich has been broken since commit7885fe5removedOddQHexTile.prototype.grow6 years ago
- including
- added coverage testing, got
ciscript passing - wrote a basic turmite test module
- test ant parse/builder
- test turmite parse/builder vs equivalent ant
- TODO: more turmite test coverage, e.g. a multi-state turmite
- caught and fixed many bugs
- added easy access to turmite
string => ...linescompilation, useful today for testing/debugging, maybe usable tomorrow for ahead-of-time compilation for something like a canned/fixed demo - improved prompt usability when dealing with large parse / compile errors
- finished off minified build
- now using full html+css+js minification
- code generator now drops .min.js alternate forms of .glsl shaders, which then get used by the .min.js build bundle
- added asset inlining to
index.htmlbuild - added
importmap.jsonauto generation frompackage.json - added
index.htmlauto re-generation fromimportmap.json- added generation chain dependency support
- minor fixes in generate
- rollup command were broken
- scanLines was wrong at scale, if not yet
- improved command spawning to be closer to
clikit.system
- switched back to sparse development
- flattened
public/into toplevel - added
generate.jsdriven vendoring of common.js modules - using emerging browser https://wicg.github.io/import-maps support
- this means that hexant development may only be possible in Chrome currently
- flattened
- spent the rest of the day "researching" html inliners
- spent too much time toying with a token-stack based monad...
- started over and wrote a pragmatic
scripts/build.jsthat does line based editing configured bybuild.config.js
- dropped
pool.jsmodule ahead of schedule, since its surrounding use of static blocks conflicts with terser v5.13.1 not yet supporting that syntax - added terser-minifed rollup bundle
- a bit more work on
scripts/generate.js- handle per-file build errors better
- rename all shaders to
.vert.glsland.frag.glsl, helps editors - improved tmp file renaming and cleanup
- dropped explicit
'use strict'from all uplifted.jsfiles - split
index.jsout again, with sourcemaps, hardcoded to use the minified bundle for now
- finished of initial scope of
scripts/generate.js- config structured in a humane way
- ci check command wired up
- got rollup + http-server based dev server working
- got tsc-driven lint passing
- ignored shader imports for now, plan to revamp gl src / shader / program handling anyhow
- ignored the nearley dep
- tried
@types/nearleybut it got hung up on all of my destructuring post processors like([tick, tock]) => {type: "meme", tick, tock}due to post procs getting passed anany[]which may have fewer than N elements... - ... but if it did, that'd be a parser library bug, since the grammar production rule guarantees N elements, so nearley's type declarations are insufficient
- ... this will all be better once we replace nearley with a recursive decent parser that we own
- tried
- dropped unused leftover dependencies: global, domready, and rezult
- fully ripped out eslint, and integrated tsc as the lint script
- got vercel deployment working
- fixed
glsl-loaderto work under Node 14.x LTS... which is apparently the latest that vercel supports... - had to add
npm run grammar &&to build script, since postinstall hook was not running for some reason
- fixed
- started ripping out snowpack, since it's looking like abandonware
- added
go generateinspired approach: offline code generation, with committed artifacts:- driver is
genkit.jsas ran bynpm run generate; may move intoscripts/generate.js - configured by
gen-config.js - ported
glsl-loader.{cjs => js} - runs
nearleycfor now
- driver is
- added
- uplifted
turmite/test.js, which is actually more of a CLI testing vehicle than an automated test- also the only user of the hexer dependency; eliminated usage, dropped dependency
- much refactored around async line generators
- set
package.jsontype to modules to thatturmite/test.jscan be ESM without changing extension - bumped tsconfig module to es2022 so that
turmite/test.jscan use toplevel await - added
rezult.toPromise(Result) => Promise
- finished the git rebake from yesterday
- ripped out
noUncheckedIndexedAccessandnoPropertyAccessFromIndexSignaturefrom tsconfig, turned out to be more trouble than worth
- ripped out
- many minor changes all around ramifying from more type checking, some notes:
- added
rezult.catchErr()andrezult.bind()conveniences - hash binds now must provide a default and listener
- factored
domkit.mustQuery()out ofprompt.jsandhexant.js
- added
- fixed view tombstone pruning bug
- added fullscreen toggle on
Enter
- realized the need to refactor
rezultobjects to be pure data, dropping theclass Resultand exporting itstoValue()andtoCallback()methods directly as result functions- this started because error results really want to be
Result<never>notResult<null>, and I couldn't find a good way to let the class-based version useT=never - however it was already a good idea, since no longer carrying methods allows
result values to be spread extended like
return {...res, extra: stuff}if desired, without loss ofResult<T>covariance
- this started because error results really want to be
- started baking down git history into per-module uplift monoliths, eliminating
a lot of micro commit churn, and validating against the new stricter tsconfig
(re)starting point
- some misgivings about typescript inability to prove narrower array types
when using
noUncheckedIndexedAccesshave started to crop up; may unring that bell before shipping to main branch
- some misgivings about typescript inability to prove narrower array types
when using
- added better error handling to Hexant
- lockout play after a caught error
- log error with runtime stats and config dump
- fixed hashbind
- parse error handling so that it doesn't process a null value
- undefined value/default/parse handling
- ratcheted up tsconfig strictness and target
- started retconing tsconfig strict es2022 rules and re-staging commits one module at a time, building an rc branch that can merge into main, rather than have dev continue to diverge so long term
- fixed hashbind default loading: it had been writing
undefinedstrings back into the cache- since boolean value representation is "true if present, false otherwise" this was causing them to flip on by default
- fixed rle-builder: was getting initial counts and final flush wrong
- fixed removal of dirty tiles; was causing crash at higher step rates when dirty tiles get compacted
- chased down an ephemeral rebase-induced bug by auditing the ViewGL
typification commit line by line:
- bug presented as hex cells rendering extremely "sparsely", and seeming to be aligned to square grid positions...
- turned out to be a mere loss of
offset++inTileBufferer.flushTileBuffer - which caused each tile draw to merely (over)draw a single hex... revealing the emergent quad tree structure, which is centrally sparse, but dense toward the outer boundary... and dense around the origin
- refactored prompt module around an
async *interact()loop - simplified
hash.set()return type, no more callbacks - switched to a
$elementidiom when passing bound DOM nodes
- reorganized the TODO section above around version milestones
- fixed infinite recursion bug in
HexTileTreeNodecompaction - fixed the hashbind module
- lots of minor refactoring bugs
- make the user do call load, preferably after all bindings
- improve initialization / round tripping
- handling of default values when initial set parses to an error
- fixed
turmite/parse.jshandling of error results
- debugging dev
- fixed
GLPalette.setColorsRGBdata indexing - fixed world step logic: needed to add in cube space
- fixed
- started minimizing and erasing view object structure towards an eventual refactor to maker form
- restructured
ViewGL.redrawto clarify tile and entity phases - factored out
setNumbers()et al utilities to clarify data array builds
- debugging dev
- fixed
NaNturn bug in newly refactoredconstants.turnDirs - fixed invocation error for
performance.nowbound toworld.now
- fixed
- uplifted
turmite/index.js- broadened
Turmite.reset - factored out
constants.turnDirs(turn, dir) - factored out `world.udpateEnt()
- finishes the compiled form refactoring started in the
langmodules
- broadened
- uplifted
hexant.js- fixed missing
World.MaskResultColorconstant - finished All The Refactoring threads from prior modules
- fixed missing
- uplifted
turmite/lang/parse.js- moved evaluation to compile module, making return a typed result object
- fixed option default and return string type from yesterday's uplift
- flattened and simplified
parse.jsmodule, setting it up well to grow a custom recursive descent parser
- moved evaluation to compile module, making return a typed result object
- uplifted
turmite/parse.js- around new
Builder => Builttypes which will be merged withturmite/lang.Specduring parser unification
- around new
- added a new
fromconvenience torle-builder.js - added explicit
Rulestable type with docs; documentedRuleConstants
- uplifted
turmite/lang/compile.js- completely refactored over iterable-strings paradigm
- reworked nearly all
compileFoofunction boundaries - greatly clarified symbols in scope
- tightened down the grammar node field types
- refactored
toSpecStringinto the iterable-strings paradigm - preserved integer bases from parsing to code gen time
- continued uplifting
turmite/lang/compile.js... not done yet - noticed how the old grammar definition locks us into expressions over
mixtures of turns and primitive numbers everywhere
- made a parametric
Expr<Literal>type that makes this explicit for now, until we can rework the grammar to prevent turns where the context doesn't call for them
- made a parametric
- uplifted
turmite/lang/analyze.js- gnarly logic under `analyze() each() switch-case 'then'
- looks to be implictly indexing the then.turns name(s) by the first then.color symbol? wat?
- gnarly logic under `analyze() each() switch-case 'then'
- started reformatting code as I go, starting with the current
turmite/lang/...modules undef focus
- uplifted
turmite/lang/walk.js, standing up a new gramma type tree alongside the nearley parser, for future use by its recursive descent replacement - uplifted
turmite/lang/tostring.js- noted how it would be better without a "generic" DFS walker
- hardened its cases over the new types, rather than allowing invalid grammar tree node data
- subsumed
turmite/lang/solve.jsinto.../compile.js, resolving their circular relationship, and deduplicating an array declaration
- uplifted
turmite/rle-builder.js; greatly refactored it:- no more string accumulation, result is an array of term pairs
- returned surface is now
{consume([count, ]sym) => void, finish() => [[count, sym]]}, with sensible "prefixed count parsing" out of symbol strings
- updated turmite grammar definition
- subsumed
turmite/lang/build.jsmodule, just inline all those post-processing rules - fix build script
- switch to ESM output
- subsumed
- uplifted
world.js- that old entity "system" sure is 🥔🍐💀
- uplifted
view_gl.js- dropped obsolete `"'experimental-webgl"' rendering context branch, as typescript definitions don't acknowledge it
- refactored a lot of drawing code to be more coherent
- many small changes and fixes throughout
- ramified usage fix into
GLProgramwrt uniform and attr collections - ramified usage fix into
HexTileTreewrt tiles collection
- uplifted
turmite/constants.js- switched to
Map()s where it made sense
- switched to
- uplifted
pool.js- refactored to a
makePool(cons) => {alloc, free}for use in static blocks
- refactored to a
- uplifted
hextile.js - uplifted
hextiletree.js- lots of subtle changes, fixes, and improvements on the way around weak points revealed by type checking
- uplifted
prompt.js- the initial gutennacht pass was insufficient, type checking revealed typos, and other deficiences
- uplifted
rangelist.js - uplifted
sample.js - uplifted
tileglbuffer.js- subsumed
TileGLBuffer,LazyGLBuffer, andGLBufferout ofview_gl.js
- subsumed
- simplifed old cell width/height calc logic, a holdover from the times when we used to compute 6 vertices per cell
- uplifted
glpalette.jsthru type checking- minor change to data array fill to use
UInt8Array.filland.set - changed constructor to options pattern, made srgb option an enum
- minor change to data array fill to use
- uplifted
glprogram.jsthru type checking- eliminated shader load indirection, a problem for our future caller
- switched attr and uniform collections to
Map, droppedattrsarray, just useattr.values()
- uplifted
glslshader.jsthru type checking - fixed
glsl-loader.jsto generate ESMs with aliased imports, and to have better internal io semantics - added build-time minification to
glsl-loader.js - fixed done module denominator... oops
- refactored Hexant world stepping logic and reified its animation loop into while-await form
- uplifted
rezult.jsthru type checking - uplifted
colorgen.jsthru type checking- now only exports
parse(), string conversion is now implicit, and fortunately nothing was using the gens export
- now only exports
- surveyed remaining module status to sketch a better stream status picture
- uplifted
coord.jsthru type checking- elminated callable-constructor oddity
- further refactored hashbind to take over all codec concerns (base64) from hexant.js, obviating need for Base64 shim dependency
- inlined page integrated javascript into its html file
- added an uplifted copy of rezult, started using it in the
hexant.jsmodule - added a reworked copy of hashbind, and converted
hexant.jsto use it - fixed raf leftover from yesterday, and added a sprinkle of type hinting to assist
- opened back up for the first time in over 5 years, started sketching a plan
- renamed
masterbranch tomain - started npm uplift
- dropped old
html-inlinebased build, as it's not been maintained and has critical transitive vulnerabilities undernpm audit
- dropped old
- switched to snowpack, including a port of my glsl loader
- excised gutentag
- classified
PromptandHexantin passing - switching to simpler component wiring along the way
- classified