You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parses a request from Podlang source. Requests contain a REQUEST block and imports, but no predicate definitions.
Having two dedicated functions for the different use-cases seems much cleaner than parsing a string and then inspecting the result to see if it contains a request or a batch (or both).
The import syntax has also changed: use batch is replaced by use module:
use my_module
test_pred(a) = AND(
my_module::foo(a)
)
I'm very open to changing how this works, and this definitely ought to be discussed before merging.
The "apply_predicate" code now belongs to the Module type. However, we may want to move this to be part of the builder, in a later PR.
The removal of batch splitting looks good to me!
Regarding the new module syntax I would like to share some thoughts:
Previously in a batch import we had to enumerate the list of predicates. Now we don't. I like this, because modules will easily contain tens of predicates.
Accessing module predicates by namespace with `module::predicate syntax. I also like this.
Not specifying the module hash in the code. I think I would prefer if the module hash appeared in the code because the module name is not universal (it's not used for cryptographic verification).
Now we have the use intro that uses a hash and use module that doesn't. I find this inconsistent
If we don't specify the module hash in podlang, we need to specify it somewhere else; but right now this somewhere else is a HashMap.
I think it would be nice to include the module hash in podlang code so that the podlang code pins the dependency of the module and removes any ambiguity.
I don't know what the syntax for this could be. Something like use module 0x123 as foo?
The removal of batch splitting looks good to me! Regarding the new module syntax I would like to share some thoughts:
Previously in a batch import we had to enumerate the list of predicates. Now we don't. I like this, because modules will easily contain tens of predicates.
Accessing module predicates by namespace with `module::predicate syntax. I also like this.
Not specifying the module hash in the code. I think I would prefer if the module hash appeared in the code because the module name is not universal (it's not used for cryptographic verification).
Now we have the use intro that uses a hash and use module that doesn't. I find this inconsistent
If we don't specify the module hash in podlang, we need to specify it somewhere else; but right now this somewhere else is a HashMap.
I think it would be nice to include the module hash in podlang code so that the podlang code pins the dependency of the module and removes any ambiguity.
I don't know what the syntax for this could be. Something like use module 0x123 as foo?
Ok, I think we can use the module hash instead of the name, with the name being a local alias.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the batch splitting system, as it is no longer necessary with the new larger batches.
It also tidies up some of the
langcrate APIs, simplifying them for common use-cases:Loads a module from Podlang source. Module files contain predicate definitions and imports, but no REQUEST block.
Parses a request from Podlang source. Requests contain a REQUEST block and imports, but no predicate definitions.
Having two dedicated functions for the different use-cases seems much cleaner than parsing a string and then inspecting the result to see if it contains a request or a batch (or both).
The import syntax has also changed:
use batchis replaced byuse module:I'm very open to changing how this works, and this definitely ought to be discussed before merging.
The "apply_predicate" code now belongs to the
Moduletype. However, we may want to move this to be part of the builder, in a later PR.