Mike Gerwitz

Activist for User Freedom

path: root/tamer
Commit message (Collapse)AuthorAgeFilesLines
* TAMER: sym::Interner::index_lookupMike Gerwitz2020-04-293-21/+106
| | | | | | | | | This was originally omitted because there wasn't a use case for it. Now that we're adding context to errors, however, an owned value is highly desirable. This adds almost no measurable overhead to the internment system in benchmarks (largely within the margin of error).
* TAMER: Update Cargo dependenciesMike Gerwitz2020-04-292-60/+60
* [DEV-7084] TAMER: AsgBuilder and IR lowering docsMike Gerwitz2020-04-283-0/+74
* [DEV-7084] TAMER: obj::xmlo: Private inner modulesMike Gerwitz2020-04-283-4/+4
* [DEV-7084] TAMER: AsgBuilderState::new: New constructorMike Gerwitz2020-04-282-24/+21
* [DEV-7084] TAMER: Finalize AsgBuilderMike Gerwitz2020-04-281-14/+600
* [DEV-7084] TAMER: impl PartialEq for XmloErrorMike Gerwitz2020-04-281-5/+39
| | | | | This cannot be dervied because XmlError does not implement PartialEq, which is quite the annoyance in tests.
* [DEV-7084] TAMER: AsgBuilderError: Introduce proper error variantsMike Gerwitz2020-04-283-22/+89
| | | | | | | | | This is a union (sum type) of three other errors types, plus errors specific to this builder. This commit does a good job demonstrating the boilerplate, as well as a need for additional context (in the case of `IdentKindError`), that we'll want to work on abstracting away.
* [DEV-7084] TAMER: Correct Ix trait bound for AsgErrorMike Gerwitz2020-04-281-15/+7
| | | | | | | | | | | | The `Debug` bound is inconvenient and requires propagation to any types that use it. Further, it's really awkward having `Display` depend on `Debug`; if we want to render a useful display here, we can write one. To be clear: IndexType implements Debug. For now, this is pretty-printed by another part of the code, which we don't want to implement in `Display` because it requires looking things up from the graph.
* [DEV-7084] TAMER: ir::asg::IdentKindError: Replace string with enumMike Gerwitz2020-04-282-12/+49
* [DEV-7084] TAMER: ir::asg::BaseAsg::new: New associated functionMike Gerwitz2020-04-282-43/+46
| | | | | Profiling showed that creating an initial capacity of 0 did not have a notable affect on performance.
* [DEV-7084] TAMER: xmlo::AsgBuilder: Accept XmloResult iteratorMike Gerwitz2020-04-283-20/+59
| | | | | | | This flips the API from using XmloWriter as the context to using Asg and consuming anything that can produce XmloResults. This not only makes more sense, but avoids having to create a trait for XmloReader, and simplifies the trait bounds we have to concern ourselves with.
* [DEV-7084] TAMER: Basic AsgBuilder cleanupMike Gerwitz2020-04-281-46/+31
| | | | | | | This just tidies things up a little bit before I get into some further refactoring. I wrote the original code when I was just learning Rust not too long ago, so it's interesting to see how my understanding has changed over that relatively short period of time.
* [DEV-7084] TAMER: Finish encapsulating petgraphMike Gerwitz2020-04-284-53/+28
| | | | | This will allow us to migrate away from Petgraph in the future should we choose to do so.
* [DEV-7084] TAMER: Simplify path canonicalizationMike Gerwitz2020-04-284-32/+81
| | | | | | | This abstracts away the canonicalizer and solves the problem whereby canonicalization was not being performed prior to recording whether a path has been visited. This ensures that multiple relative paths to the same file will be properly recognized as visited.
* [DEV-7084] TAMER: ld::poc: Remove unused fragments argMike Gerwitz2020-04-281-5/+2
* [DEV-7084] TAMER: ld::poc: Remove unnecessary initial path canonicalizationMike Gerwitz2020-04-281-3/+1
| | | | Less to refactor and test.
* [DEV-7084] TAMER: AsgBuilderStateMike Gerwitz2020-04-283-65/+39
| | | | | This completes the POC extraction for AsgBuilder, but is still POC code. The commits that follow will clean it up and provide tests.
* [DEV-7084] TAMER: AsgBuilder extracted from POCMike Gerwitz2020-04-283-106/+200
| | | | | This extracts the changes nearly verbatim before doing refactoring so that it's easier to observe what changes have been made.
* [DEV-7084] TAMER: fs: impl File for BufReaderMike Gerwitz2020-04-282-4/+24
| | | | This further simplifies the POC linker.
* [DEV-7084] TAMER: CanonicalFileMike Gerwitz2020-04-282-5/+26
| | | | | | This will be entirely replaced in an upcoming commit. See that for details. I don't feel like dealing with the conflicts for rearranging and squashing these commits.
* [DEV-7084] TAMER: fs: Basic filesystem abstractionMike Gerwitz2020-04-283-15/+190
| | | | | | | | | This also includes an implementation to visit paths only once. Note that it does not yet canonicalize the path before visiting, so relative paths to the same file can slip through, and relative paths to _different_ files could be erroneously considered to have been visited. This will be fixed in an upcoming commit.
* [DEV-7084] TAMER: From<B, &I> for XmloReaderMike Gerwitz2020-04-202-1/+11
| | | | | | This serves as a constructor for the time being, decoupling from POC. We may do something better once we have a better idea of how the various abstractions around this will evolve.
* [DEV-7147] Add "tamec" executableJoseph Frazer2020-04-092-0/+413
| | | | | | Add a stub executable that will eventually become a full-featured TAME compiler. The first implementation will only copy the source file to an intermediary file that will be compiled by the XSLT compiler.
* [DEV-7086] TAMER: Remove WIP linker warningMike Gerwitz2020-04-061-2/+0
| | | | | While it is true that this is still being finalized, the warnings originally existed because tameld was not feature complete. It is now.
* [DEV-7086] TAMER: ir::asg::base::test Add missing set_fragment failure testMike Gerwitz2020-04-061-1/+39
| | | | Results the last remaining BaseAsg test TODO.
* [DEV-7086] TAMER: ir::asg::TransitionError::BadFragmentDest tuple=>structMike Gerwitz2020-04-061-4/+4
| | | | Consistency.
* [DEV-7086] TAMER: Disallow IdentObject::resolve redeclarationsMike Gerwitz2020-04-061-24/+63
| | | | Except under well-defined circumstances.
* [DEV-7086] Proper handling of identifier overridesMike Gerwitz2020-04-062-107/+521
| | | | | | | | This is an awkward system that I'd like to remove at some point. It adds complexity. For the meantime, overrides have been arbitrarily restricted to a single override (no override-override). But it's needed being until we rework maps and can handle the illusion of overrides using the template system.
* [DEV-7086] TAMER: TransitionError::Incompatible: Remove unusedMike Gerwitz2020-04-012-13/+10
* [DEV-7086] TAMER: BaseAsg::set_fragment: Remove duplicate codeMike Gerwitz2020-03-311-29/+24
| | | | | | Benchmark performance for this method is still substantially slower. And oddly, this nearly doubled the speed of the other two calls (granted, at that speed, it doesn't matter).
* [DEV-7086] ASG benchmarksMike Gerwitz2020-03-312-3/+494
* TAMER: BaseAsg test: Remove fulfilled stub TODOMike Gerwitz2020-03-261-1/+0
* [DEV-7087] TAMER: Add Source to IdentObject::ExternMike Gerwitz2020-03-262-17/+42
| | | | | | | | All of these refactoring commits to arrive at this one final change: the ability to store the source location for externs so that we can report on what package is expecting an identifier to be defined. Phew. Goodnight.
* [DEV-7087] TAMER: Object{State,Data}: API representative of state transitionsMike Gerwitz2020-03-263-92/+80
| | | | | The API now enforces beginning at Missing and transitioning through states. Methods have been renamed to reflect this.
* [DEV-7087] TAMER: BaseAsg: Refactor duplicate declare{,_extern} codeMike Gerwitz2020-03-261-34/+40
* [DEV-7087] TAMER: Remote optional Source from ASG and ObjectMike Gerwitz2020-03-265-220/+163
| | | | | | | | | This undoes work I did earlier today...but now we'll be able to support a Source on an extern. There is duplicate code between `BaseAsg::declare{,_extern}` that will be resolved in an upcoming commit. Upcoming commits will also simplify terminology and clean up methods on ObjectState.
* [DEV-7087] TAMER: Asg: Reintroduce declare_externMike Gerwitz2020-03-264-20/+146
| | | | | | | There is some duplication here with `declare` that will be cleared up in a following commit. Reintroducing this method is necessary so that Source can be used to represent the source location of the extern itself; it's currently None to indicate an extern in `declare`.
* [DEV-7087] TAMER: ObjectState: Introduce extern transitionMike Gerwitz2020-03-262-37/+69
| | | | | | | | | | | This is the first step in a more incremental refactoring that previous commits to undo the optional Source in `ObjectState::ident`. This provides an explicit transition to an extern, with the intent of requiring an initial missing state. This will simplify logic on the ASG. Note that the Source provided to this new method is not yet used. That too will come in a following commit and will represent the source of the defined extern rather than the concrete identifier.
* [DEV-7087] TAMER: Type compatability check during extern resolutionMike Gerwitz2020-03-265-222/+304
| | | | | | | | | | This properly verifies extern types, and cleans up Asg's API a little so that externs aren't handled much differently than other declarations. With that said, after making src optional, I realized that we will indeed want source information for externs themselves so we can direct the user to what package is expecting that symbol (as the old linker does). So this approach will not work, and I'll have to undo some of those changes.
* [DEV-7087] TAMER: tameld: Format error outputMike Gerwitz2020-03-262-3/+11
| | | | We will want an option for verbose debug output in the future.
* [DEV-7087] Beginning of extern type verification and reportingMike Gerwitz2020-03-263-8/+157
| | | | | This only verifies when externs are defined _before_ they need to be resolved. See a future commit for the rest of this.
* [DEV-7087] TAMER: AsgError: Wrap TransitionErrorMike Gerwitz2020-03-263-28/+22
| | | | See next commit.
* [DEV-7133] Clearly show the cycles in the outputJoseph Frazer2020-03-262-6/+30
* [DEV-7133] Check for cyclic dependenciesJoseph Frazer2020-03-263-35/+568
| | | | | | | We want the linker to show an error when a cyclic dependency is encountered. Co-authored-by: Mike Gerwitz <mike.gerwitz@ryansg.com>
* [DEV-7133] Add AsgError::CycleJoseph Frazer2020-03-261-0/+5
| | | | We want a special error type when we detect cyclic dependencies.
* [DEV-7087] TAMER: symbol_dummy! macroMike Gerwitz2020-03-246-61/+70
* [DEV-7087] TAMER: {=>Ident}Object{,State,Data}Mike Gerwitz2020-03-249-296/+669
| | | | | | This is essential to clarify what exactly the different object types represent with the new generic abstractions. For example, we will have expressions as an object type.
* TAMER: Make Asg generic over objectMike Gerwitz2020-03-249-158/+311
| | | | | | | | | | | | | | | | | | | | | | | | There's a lot here to make the object stored on the `Asg` generic. This introduces `ObjectState` for state transitions and `ObjectData` for pure data retrieval. This will allow not only for mocking, but will be useful to enforce compile-time restrictions on the type of objects expected by the linker vs. the compiler (e.g. the linker will not have expressions). This commit intentionally leaves the corresponding tests in their original location to prove that the functionality has not changed; they'll be moved in a future commit. This also leaves the names as "Object" to reduce the number the cognative overhead of this commit. It will be renamed to something like "IdentObject" in the near future to clarify the intent of the current object type and to open the way for expressions and a type that marries both of them in the future. Once all of this is done, we'll finally be able to make changes to the compatibility logic in state transitions to implement extern compatibility checks during resolution. DEV-7087
* TAMER: Extract identifier transitions into ObjectMike Gerwitz2020-03-193-75/+183
| | | | | | | | | | | | | | | | The next commit will generalize this further. This moves logic out of BaseAsg so that we can implement more sophisticated transitions for compatability checks. The logic is still tested as part of BaseAsg; the next commit will change that as it's generalized further. * tamer/src/ir/asg/base.rs: Extract object transitions. * tamer/src/ir/asg/graph.rs (AsgError)[IncompatibleIdent]: New variant. (From<TransitionError> for AsgError): Basic type translation. * tamer/src/ir/asg/object.rs (TransitionResult): New type. (impl Object): Transition methods. (TransitionError): New enum.