Skip to content

Commit b89478a

Browse files
authored
Fix a few typos
1 parent 95e32aa commit b89478a

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/tapedfunction.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#=
2-
32
`TapedFunction` converts a Julia function to a friendly tape for user-specified interpreters.
4-
With this tape-like abstraction for functions, we gain some control over how the function is
3+
With this tape-like abstraction for functions, we gain some control over how a function is
54
executed, like capturing continuations, caching variables, injecting additional control flows
6-
(i.e. produce/consume) between instructions on the tape, etc.
5+
(i.e., produce/consume) between instructions on the tape, etc.
76
8-
Under the hood, we firstly used Julia's compiler API to get the IR code of the original function.
9-
We use the unoptimised typed code in a non-strict SSA form. Then we convert each IR instruction
7+
Under the hood, we first used Julia's compiler API to get the IR code of the original function.
8+
We use the unoptimized typed code in a non-strict SSA form. Then we convert each IR instruction
109
to a Julia data structure (an object of a subtype of AbstractInstruction). All the operands
1110
(i.e., the variables) these instructions use are stored in a data structure called `Bindings`.
1211
This conversion/binding process is performed at compile-time / tape-recording time and is only
@@ -17,9 +16,9 @@ In a nutshell, there are two types of instructions (or primitives) on a tape:
1716
- Control-flow instruction: GotoInstruction and CondGotoInstruction, ReturnInstruction
1817
1918
Once the tape is recorded, we can run the tape just like calling the original function.
20-
We first plugin the arguments, run each instruction on the tape, and stop after encountering
19+
We first plugin the arguments, run each instruction on the tape and stop after encountering
2120
a ReturnInstruction. We also provide a mechanism to add a callback after each instruction.
22-
This API allowed us to implement the `produce/consume` machanism in TapedTask. And exploiting
21+
This API allowed us to implement the `produce/consume` mechanism in TapedTask. And exploiting
2322
these features, we implemented a fork mechanism for TapedTask.
2423
2524
Some potentially sharp edges of this implementation:
@@ -29,9 +28,9 @@ Some potentially sharp edges of this implementation:
2928
So this works well. But, if you do something like `module A v=1 end; make tapedfunction; A.eval(:(v=2)); run tf;`,
3029
The assignment won't work.
3130
2. QuoteNode is also evaluated at the tape-recording time (compile-time). Primarily
32-
the result of evaluating a QuoteNode is a Symbol, which works well most of the time.
31+
the result of evaluating a QuoteNode is a Symbol, which usually works well.
3332
3. Each Instruction execution contains one unnecessary allocation at the moment.
34-
So writing a function with vectorised computation will be more performant,
33+
So writing a function with vectorized computation will be more performant,
3534
for example, using broadcasting instead of a loop.
3635
=#
3736

0 commit comments

Comments
 (0)