Mike Gerwitz

Activist for User Freedom

Commit message (Collapse)AuthorAgeFilesLines
* symtable: Add @lparent to let lparam symbolsMike Gerwitz2017-12-111-6/+6
| | | | | * src/current/include/preproc/symtable.xsl (preproc:symtable)[c:let]: Add @lparam to symbol.
* Add c:sum/@dimMike Gerwitz2017-12-041-1/+4
| | | | | | | | | | | | | | | | | | This allows the result of a rate block to be a matrix; there was previously no way for a named value to be assigned a matrix unless it was a parameter. This is a bit of a kluge---the compiler won't discover the proper type information and won't perform the proper safeguards. * src/current/calc.xsd (sum)[@dim]: Add attribute. * src/current/compiler/js-calc.xsl: Add xs namespace. (compile-calc): Do not perform casting when @dim > 1. * src/current/include/preproc/expand.xsl (lv:rate-each): Include @dim in c:sum expansion. * src/current/include/preproc/macros.xsl: (c:*/@generates): Use @dim to determine symbol dimensions. * src/current/include/preproc/expand.xsl: Parse @dim aliases (e.g. "vector", "matrix").
* Remove @keep support from linkerMike Gerwitz2017-07-121-24/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And everything else. This is a big (important) change; it addresses one of the greatest pains of the system. Keeps were added during the DSL rewrite (to support symbols and such) to work around the issue that there was no symbol-driven map; it allowed symbols to persist disjoint from the `__yield' dependency graph so that they could be mapped back and used by external systems. The problem with that is that it's both messy (coupling the concept of external dependencies with the actual code) and difficult to work with. It had a huge performance impact on the linker for two reasons: - Checking whether a package had already been seen and importing the keeps on first visit was expensive because of tree searching and manipulation; and - _every_ keep was imported and processed by the linker, even if it wouldn't end up being used by a particular program. The later especially had huge performance impacts on the entire system. The entire dependency graph is now map-driven, with the exception of the implicit `__yield' (which will eventually be moved into the map as well and the magic `lv:yield' removed in favor of a template). Performance-wise: our largest program ("dwelling") has many thousands of symbols and the largest package imported the majority of them, many of them unneeded, as the result of @keep subgraphs. Compilation of the largest package within that (for the UI) took about a minute and a half and ate up ~6GiB of RAM, for what really is a trivial task of resolving externs, some basic symbol processing, a topological sort, and ordering code fragments. After this change, it takes ~15s and less than 2GiB of RAM. Still a lot---and more improvements can be made---but much, much better. @keep and friends was left in rater.xsd so that nothing breaks while code is cleaned up; it'll be removed in the future. * src/current/compiler/linker.xsl: Remove @keep support. * src/current/dot/attr-keep.xsl: Remove now-unneeded template. * src/current/dot/defnode.xsl: Remove @keep and related. * src/current/include/preproc/eligclass.xsl: Remove @keep and related. * src/current/include/preproc/expand.xsl: Remove @keep and related. * src/current/include/preproc/macros.xsl: Remove @keep and related. * src/current/include/preproc/symtable.xsl: Remove @keep and related. * src/current/rater.xsd: Add TODO to remove @keep and friends.
* Properly resolve paths of symbols of importsMike Gerwitz2017-07-121-27/+13
| | | | | | | | | | | | | | | | This solves a long-standing problem whereby relative paths are not properly resolved, leading to incorrect symbol conflicts when relative paths to the same package vary between two imports. See doc/notes/path-processing for an illustration. * src/current/include/preproc/path.xsl (preproc:resolve-relative-import): Add function. (preproc:resolv-path, preproc:resolve-path, preproc:get-path): Add functions to invoke existing templates. * src/current/include/preproc/symtable.xsl (preproc:symimport): Use `preproc:resolve-relative-import'. * doc/notes/path-processing: Add notes.
* Ignore externs in local polluting symbol processingMike Gerwitz2017-07-051-1/+3
| | | | | * src/current/include/preproc/symtable.xsl (preproc:symimport lv:import): Ignore symbols flagged as externs when processing local polluted symbols.
* Extracted param symbol generationMike Gerwitz2016-11-171-17/+1
| | | | | | | | | | | | | | The `preproc:param-dim' template must remain for now, as it is used by others. * src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:param]: Extracted template. * src/symtable/symbols.xsl (preproc:symtable)[lv:param]: Added template. * test/symtable/symbols.xsl (lv:param): Scenario added.
* Extracted meta symbol generationMike Gerwitz2016-11-171-8/+0
| | | | | | | | | | | * src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:meta]: Extracted template. * src/symtable/symbols.xsl (preproc:symtable)[lv:meta]: Added template. * test/symtable/symbols.xsl (lv:meta): Scenario added
* Extract template symbol generationMike Gerwitz2016-11-171-8/+0
| | | | | | | | | | * src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:template]: Extracted template. * src/symtable/symbols.xsl: (preproc:symtable)[lv:template]: Added template. test/symtable/symbols.xsl: Added test case.
* Add copyright headers to src/current/Mike Gerwitz2016-08-241-1/+18
* Liberate current implementation of "Calc DSL"Mike Gerwitz2016-08-241-0/+959
(Copyright headers will be added in the next commit; these are the original files, unaltered in any way.) The internal project name at LoVullo is simply "Calc DSL". This liberates the entire thing. If anything was missed, I'll be added later. To continue building at LoVullo with this move, symlinks are used for the transition; this is the exact code that is used in production. There is a lot here---over 25,000 lines. Much of it is in disarray from the environment surrounding its development, but it does work well for what it was intended to do. (LoVullo folks: fork point is 65723a0 in calcdsl.git.)