Commit Graph

327 Commits (65c1b2d0836036323fccc1aec5d6489407d3a976)

Author SHA1 Message Date
Mike Gerwitz 32afebd631 Preprocess input map nodes
In particular, I want it to handle absolute import paths.  It does
this for the return map; I forgot to add it here.

* src/current/compiler/map.xsl (lvmc:compile) [lvm:program-map]:
  Preprocess nodes.
2017-07-13 09:42:20 -04:00
Mike Gerwitz dbb368ab34 macros.xsl: Remove unnused param boolean class generation
A classification used to be generated for each param for convenience;
this has been deprecated by the progui package generation (when `q:'
is used).

* src/current/include/preproc/macros.xsl: Remove template.
2017-07-12 15:58:39 -04:00
Mike Gerwitz 2af0daceb3 Remove @keep support from linker
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.
2017-07-12 15:58:37 -04:00
Mike Gerwitz 52c1bb5ebe Properly resolve paths of symbols of imports
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.
2017-07-12 14:32:33 -04:00
Mike Gerwitz 7472cb882c Return map symbol support
This is a backwards-incompatible change that, like the input map,
requires the use of symbols in the return map.  This will allow us to
forego the use of @keep and will have the return map be the authority
of what gets linked (all of its dependencies).

* src/current/compiler/map.xsl: Add symbol support to return-map.
2017-07-12 14:23:26 -04:00
Mike Gerwitz 5b9cfaec31 Allow ##any in return map
* src/current/map.xsd (return-map): Allow ##any.
2017-07-12 14:16:42 -04:00
Mike Gerwitz 7d9fb48e11 Strip `xsl' namespace prefix from path.xsl
This also sets the XSLT version to 2.0.

* src/current/include/preproc/path.xsl: Strip `xsl' namespace prefix.
2017-07-12 10:10:45 -04:00
Mike Gerwitz c156c10989 Provide symtable to all map compilation steps
* src/current/compiler/map.xsl: Pass symtable to all templates.
2017-07-11 08:59:17 -04:00
Mike Gerwitz 86ac6546dc linker.xsl: Strip xsl ns prefix
* src/current/compiler/linker.xsl: Strip xsl ns prefix.
2017-07-11 08:59:16 -04:00
Mike Gerwitz e237ab47f2 Recognize meta fields in map
* src/current/compiler/map.xsl (lvmc:validate-ui) [lvm:program-map]:
  Recognize "meta:"-prefixed meta field ids in map.
2017-07-07 15:18:20 -04:00
Mike Gerwitz 68dd0706a8 Simplify unknown source field map detection
Simple refactoring.  Code still is terrible.

* src/current/compiler/map.xsl (lvmc:validate-ui) [lvm:program-map]:
  Factor common expressions.
2017-07-07 15:18:20 -04:00
Mike Gerwitz 652465a0a0 tools/strip: Add utility 2017-07-05 13:52:06 -04:00
Mike Gerwitz b7596515b3 map compiler: Use symbol table
This allows for the proper importing of symbols into the package
generated by the map compiler, which in turn allows for processing
their default values.
2017-07-05 13:52:04 -04:00
Mike Gerwitz 8e5666f845 Ignore externs in local polluting symbol processing
* src/current/include/preproc/symtable.xsl (preproc:symimport lv:import):
  Ignore symbols flagged as externs when processing local polluted symbols.
2017-07-05 13:52:02 -04:00
Mike Gerwitz 353440ef31 Reorder static linked output
`set_defaults' wasn't in scope of maps.

* src/current/compiler/js.xsl (compiler:exit-rater lv:package):
  Remove static output.
* src/current/compiler/linker.xsl (l:link-deps lv:package):
  Link static after all other blocks, at highest scope within the
  compiled module.
2017-07-05 13:51:28 -04:00
Mike Gerwitz ec4c73f749 Correct syntax error in linked output for known class map
* src/current/compiler/js.xsl (lv:paclage compiler:exit-rater):
  Add missing semicolon
2017-07-05 13:51:28 -04:00
Mike Gerwitz f2821af5cb src/current/map.xsl: Permit from/@scalar 2017-07-05 13:51:28 -04:00
Mike Gerwitz 629aa9d342 c1map.xsd: Add schema
This just ignores everything for now.
2017-07-05 13:51:28 -04:00
Mike Gerwitz 12f3fa5b6e Add missing rater.xsd
This is of limited use now with template support.  But it is useful
documentation nonetheless.
2017-04-06 23:33:53 -04:00
Mike Gerwitz 1d3aaf3339 Extracted param symbol generation
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.
2016-11-17 23:55:23 -05:00
Mike Gerwitz f396858fb1 Extracted meta symbol generation
* 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
2016-11-17 23:55:23 -05:00
Mike Gerwitz c199f4739e Extract template symbol generation
* 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.
2016-11-17 23:55:23 -05:00
Mike Gerwitz 0c2ef00e51 lv:classify/@desc whitespace normalization during macropass
This allows for nice formatting with newlines (to avoid excessively long
lines) without affecting the output.

* src/current/include/preproc/expand.xsl
  (preproc:expand lv:classify/@desc): Normalize lv:classify/@desc whitespace
2016-10-25 11:40:08 -04:00
Mike Gerwitz 5a9fb0d142 lv:classify/@set stripped from macropass
This is no longer used.

* src/current/include/preproc/expand.xsl (lv:classify):
  Remove `@set' processing.
2016-10-25 11:37:46 -04:00
Mike Gerwitz ea3ae797b3 Version bump {0.0.1=>1.0.0} 2016-08-24 12:38:03 -04:00
Mike Gerwitz c0d95b4a05 Add copyright headers to src/current/ 2016-08-24 12:38:03 -04:00
Mike Gerwitz ff01f39c1e Liberate current implementation of "Calc DSL"
(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.)
2016-08-24 12:38:00 -04:00