-
Notifications
You must be signed in to change notification settings - Fork 37
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
Advanced Sequence Compiler 0.1 #181
base: devel
Are you sure you want to change the base?
Conversation
…commands, and parsing all types into their BaseType values
Looks like this is failing to run some builds because I'm using a Python feature from 3.10, type subscripting. I will probably just include |
Just want to jump in and say this is super neat! Seems like a nice and extensible way to build on top of the existing python syntax parser. I wish I had the time to be more involved right now but hopefully as my life gets less crazy in the next few months I'll have time to play around with this. |
@zimri-leisher yes, if |
Spelling is failing because of:
Both of these are valid, so they need to be added to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python code looks nice. I don't see any major issues. Comments are a bit sparse, but otherwise this is nice!
@@ -61,6 +61,7 @@ fprime-cli = "fprime_gds.executables.fprime_cli:main" | |||
fprime-seqgen = "fprime_gds.common.tools.seqgen:main" | |||
fprime-dp-write = "fprime_gds.executables.data_product_writer:main" | |||
fprime-gds = "fprime_gds.executables.run_deployment:main" | |||
fprime-seq = "fprime_gds.common.sequence.compiler:main" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add fpy
to this name to distinguish it? The old fprime-seqgen
will lose to this in tab-complete and won't process correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good point. Sure, if you think that's the best idea, we can make a generic "fpy" cmdline tool whose default behavior can be compiling.
@@ -0,0 +1,86 @@ | |||
# FPy Advanced Sequencing Language Version 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we should put this with F´. We typically try to avoid directory-READMEs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to move it. Where/when should we move it?
Thanks! Any feedback you have would be super valuable. Yes, I just realized that any language I was going to make was going to be heavily inspired by Python. This is just skipping the middle man of having to write some EBNF grammar etc etc.
The code is really the first version of this that works. I'll spend some time this week cleaning it up so I would feel comfortable merging it. Either way, most of this will have to be rewritten as the language evolves, but it was a helpful learning experience and proof-of-concept. |
FPy Advanced Sequencing Language Version 0.1
The FPy advanced sequencing language is a combination of a high-level scripting language and a low-level bytecode language for running complex command sequences on spacecraft flight software. The initial version only duplicates already existing
CmdSequencer
andfprime-seqgen
functionality.FPy Syntax
Modules, components, channels, commands and types
You can imagine the FPy syntax as Python with the following mappings:
FPrime declaration:
FPy usage:
FPrime declaration:
FPy usage:
Sequence directives
FPy also has sequence directives, which are like commands that control the running sequence itself.
The most common sequence directives are absolute and relative sleep:
Due to the nature of the FPrime
CmdSequencer
, you can only have zero or onesleep
directives before each command.FPy Compiler Usage
The result is a sequence binary file that works with the FPrime
CmdSequencer
.Rationale
This is a good first step towards proving that FPrime dictionaries and Python syntax trees can be linked. It also provides a demonstration of part of the functionality of the end goal.
Testing/Review Recommendations
Try this on any sequences you have. If you translate the sequence from
.seq
to.fpy
, the binary output should be identical to that generated by fprime-seqgen.Future Work
Start working on custom bytecode. First step for the custom bytecode should again just be to duplicate existing functionality.