-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference Resolver Prototype #263
Conversation
@Pike, I'd like to share some progress on the reference resolver, and ask you for early feedback on the code. The core abstraction here is the All three existing implementations of the resolver employ a concept of a
I feel like this division has worked well for the clarity of the code, but I'm interested in your opinion. Thanks, and please let me know if you have any questions. |
I don't have the big picture here. What do we want to achieve for our existing implementations, and what for future implementations? How do we impact interpreting resolvers like fluent.js, or pre-evaluating ones like python, or compiling ones that we have in other parts? |
Good questions, thanks. The purpose of this reference implementation is to be able to build a suite of tests and fixtures and verify that the expectations encoded in them are reasonable and possible. I don't think this implementation should dictate the design for other implementations out there. I'd like to start with the test suite defining the conformance criteria for the implementations. I think the important question right now is what would we like to expect from the errors returned from the resolver. What kind of information is useful? I added a simple error class in 5b22e6e and a few sample tests in 21a82b7. We'll likely want to have better errors and better tests, but this is still just a draft. One thing that I notice right now is that it's not easy to decorate the error with the Do you have other things on the wishlist for errors? :) |
I've reached a point where this PR can serve as a good base for implementing the actual reference resolver and its test suite. I'll base the initial code on the runtime resolver from |
The code here was based on the second iteration of the |
Here's a prototype of the reference resolver I've been working on. It's based on the architecture of
Bundle
/Message
from projectfluent/fluent.js#365. It uses TypeScript to verify type soundness and the encapsulation of this approach. Right now, only very simple expressions are supported,VariableExpression
andSelectExpressions
with simple selectors.