Massively simplify and equalise primitive commands#150
Open
MattWindsor91 wants to merge 13 commits intomasterfrom
Open
Massively simplify and equalise primitive commands#150MattWindsor91 wants to merge 13 commits intomasterfrom
MattWindsor91 wants to merge 13 commits intomasterfrom
Conversation
8d0f36b to
e7a78f9
Compare
Collaborator
Author
|
@septract I've rebased this onto master now, so it should be ok to look at. Less priority than the last PRQ though. (Also, I wonder if Travis will work today…) |
We now instead check the arguments directly to see if an assignment is local or not. This is in preparation for eliminating intrinsic and symbolic PrimCommands.
Microcode can now contain stored commands, which are removed during processing. PrimCommands are now just a specialisation of Microcode to use StoredCommand as the stored command type.
This is to make sure the local command restrictions are not thwarted when I generalise atomics.
This fixes #147 and does a bit more, getting rid of some now-unnecessary stored commands.
This rather large refactor means that the only difference between assignments etc. in <| atomic brackets |> and outside them is scoping: atomic bracket commands can use shared variables. This also, in principle, means that CAS and ++/-- are available for use outside of atomic brackets. This has not been rigorously tested yet.
As seen in issue #147.
e7a78f9 to
cd686b2
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
NOTE: In typical me fashion, this is based on a previous pull request (#142), and shouldn't be merged (or really looked at in detail) until that one is up.
This is a fairly heavy PRQ (got a bit carried away with simplification, as usual) that does a lot of simplifying and expressivity-boosting changes to the primitive commands (assignment, postfix, assume, etc).
What does this do?
MicrocodeandPrimCommands have been merged (sort of): Microcode can now contain stored commands (atomic function calls), and does so until the point where we used to expand out PrimCommands.PrimCommandis now a type alias for a certain type ofMicrocode. This makesMicrocodethe only internal representation of Starling's command language.BCASandICASis gone, and the modeller models postfixes, assumes, and id-transitions directly as microcode.{| foo() |} local++ {| bar() |}are now possible.