The domain of our language will be real-time programs that needs some sort of deadline enforced. For example, there could be a program that controls a mechanical arm that reacts to a sensor input. However, if for some reason the arm does not react fast enough, the safety of the system cannot be guaranteed and the arm needs to reset to a default position or shut down.
We will extend the 164 language to have a sense of execution time. We can encapsulate code into deadline objects which are essentially functions with timers in them. If a timer goes off before the function returns, then we throw an exception that the programmer must handle.
Implementation Ideas
- Create a deadline clause that includes the code needed to run within the deadline. These clauses will have associated "catch" that will execute if the deadline is not met.
- Frontend: We will parse and interpret our code using the Project 3 language parser and interpreter
- Core Language: We will be extending the function objects of the Project 3 language to allow for timers to run in parallel to the code that will ensure deadlines are kept track of. The deadline clauses will be sugar for argument-less, return-less functions and an immediate call.
- Internal Representation: This will be kept in byte code similiar to Project 3.
- Interpreter/Compiler: We will use the same tool chain as the 164 language we developed in Project 3. The new clause requires that we build it into the language and the 164 language is simple to modify since we already have a good understanding of how it works.
- Debugging: We will test the code using small programs and using infinite loops to test deadline functionality.
- Create a special deadline object that starts a timer and interrupts the control flow if the timer goes off. When it goes off, the object will call a function that it was built with.
- Frontend: We will parse and interpret our code using the Project 3 language parser and interpreter.
- Core Language: We will be extending the Project 3 language with new deadline objects. These objects will be similiar to coroutines in that they will be executed outside of the normal control flow and will return the control after it completes.
- Internal Representation: This will be kept in byte code similiar to Project 3.
- Interpreter/Compiler: We will use the same tool chain as the 164 language we developed in Project 3. The new internal objects require that we build it into the language and the 164 language is simple to modify since we already have a good understanding of how it works.
- Debugging: We will test the code using small programs and using infinite loops to test deadline functionality.
No comments:
Post a Comment