Automatic code transformation with state transformer monads
First Claim
Patent Images
1. A computer-readable memory device having computer-executable components stored thereon, the computer-executable components, comprising:
- a component configured to receive inherently stateful code specified in an imperative programming language; and
a transform component configured to convert the stateful code into stateless code by transforming a form of a state associated with the stateful code into an argument explicitly representing the state in the stateless code, wherein the transform component is further configured to facilitate threading the argument explicitly representing the state through a sequence of stateless code operations with a same serialization infrastructure employed for both argument and result values, and wherein a first of the stateless code operations in the sequence is configured to accept a received state as an additional argument and return a modified state as an additional result to a second of the stateless code operations in the sequence.
2 Assignments
0 Petitions
Accused Products
Abstract
Stateful computations are transformed into stateless computations automatically to facilitate scalability. Programmers can write code in a traditional imperative stateful style, which is subsequently transformed automatically into a stateless, state transformer monadic style. After the transformation, state is passed as an additional argument in a call and returns as a new state as an additional result.
30 Citations
20 Claims
-
1. A computer-readable memory device having computer-executable components stored thereon, the computer-executable components, comprising:
-
a component configured to receive inherently stateful code specified in an imperative programming language; and a transform component configured to convert the stateful code into stateless code by transforming a form of a state associated with the stateful code into an argument explicitly representing the state in the stateless code, wherein the transform component is further configured to facilitate threading the argument explicitly representing the state through a sequence of stateless code operations with a same serialization infrastructure employed for both argument and result values, and wherein a first of the stateless code operations in the sequence is configured to accept a received state as an additional argument and return a modified state as an additional result to a second of the stateless code operations in the sequence. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 20)
-
-
10. A code transformation method, comprising:
employing a processor to execute computer executable instructions stored on a computer readable storage medium to implement the following acts; identifying a stateful computation in an imperative programming language; and converting the stateful code into stateless code by transforming a form of a state associated with the stateful computation into an argument explicitly representing the state in the stateless code, wherein the argument explicitly representing the state is passed through a sequence of stateless code operations, wherein a first of the stateless code operations in the sequence is configured to accept a received state as an additional argument and return a modified state as an additional result to a second of the stateless code operations in the sequence, and wherein the state is threaded between code segments with a same serialization infrastructure employed for both argument and result values. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
19. A computer-readable memory device having computer-executable instructions for causing a computer to perform steps comprising:
-
acquiring an inherently stateful single tier computer application specified in an imperative language; automatically generating distributed code from the single tier application; and automatically converting the stateful code into stateless code by transforming a form of a state associated with a stateful portion of the distributed code into an argument explicitly representing the state in the stateless code to produce a scalable distributed application, wherein the argument explicitly representing the state is passed through a sequence of stateless code operations, wherein a first of the stateless code operations in the sequence is configured to accept a received state as an additional argument and return a modified state as an additional result to a second of the stateless code operations in the sequence, and wherein the state is threaded between code segments with a same serialization infrastructure employed for both argument and result values.
-
Specification