Skip to content

Commit 8f4e4b5

Browse files
committed
README and NEWS overhaul
1 parent b546f21 commit 8f4e4b5

File tree

2 files changed

+11
-95
lines changed

2 files changed

+11
-95
lines changed

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- From v0.6.0, Libtask is implemented by recording all the computing
2+
to a tape and copying that tape. Before that version, it is based on
3+
a tricky hack on the Julia internals. You can check the commit
4+
history of this repo to see the details.
5+
6+
- From version 0.9.0, the old `TArray` and `TRef` types are completely removed, where
7+
previously they were only deprecated. Additionally, the internals have been completely
8+
overhauled, and the public interface more precisely defined. See the docs for more info.

README.md

Lines changed: 3 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -2,100 +2,8 @@
22

33
[![Libtask Testing](https://github.com/TuringLang/Libtask.jl/workflows/Libtask%20Testing/badge.svg)](https://github.com/TuringLang/Libtask.jl/actions?branch=master)
44

5-
Tape based task copying in Turing
65

7-
## Getting Started
6+
Resumable and copyable functions in Julia, with optional dynamic scope.
7+
See the docs for example usage.
88

9-
Stack allocated objects are always deep copied:
10-
11-
```julia
12-
using Libtask
13-
14-
function f()
15-
t = 0
16-
for _ in 1:10
17-
produce(t)
18-
t = 1 + t
19-
end
20-
end
21-
22-
ttask = TapedTask(f)
23-
24-
@show consume(ttask) # 0
25-
@show consume(ttask) # 1
26-
27-
a = copy(ttask)
28-
@show consume(a) # 2
29-
@show consume(a) # 3
30-
31-
@show consume(ttask) # 2
32-
@show consume(ttask) # 3
33-
```
34-
35-
Heap-allocated Array and Ref objects are deep copied by default:
36-
37-
```julia
38-
using Libtask
39-
40-
function f()
41-
t = [0 1 2]
42-
for _ in 1:10
43-
produce(t[1])
44-
t[1] = 1 + t[1]
45-
end
46-
end
47-
48-
ttask = TapedTask(f)
49-
50-
@show consume(ttask) # 0
51-
@show consume(ttask) # 1
52-
53-
a = copy(ttask)
54-
@show consume(a) # 2
55-
@show consume(a) # 3
56-
57-
@show consume(ttask) # 2
58-
@show consume(ttask) # 3
59-
```
60-
61-
Other heap-allocated objects (e.g., `Dict`) are shallow copied, by default:
62-
63-
```julia
64-
using Libtask
65-
66-
function f()
67-
t = Dict(1=>10, 2=>20)
68-
while true
69-
produce(t[1])
70-
t[1] = 1 + t[1]
71-
end
72-
end
73-
74-
ttask = TapedTask(f)
75-
76-
@show consume(ttask) # 10
77-
@show consume(ttask) # 11
78-
79-
a = copy(ttask)
80-
@show consume(a) # 12
81-
@show consume(a) # 13
82-
83-
@show consume(ttask) # 14
84-
@show consume(ttask) # 15
85-
```
86-
87-
Notes:
88-
89-
- The [Turing](https://github.com/TuringLang/Turing.jl) probabilistic
90-
programming language uses this task copying feature in an efficient
91-
implementation of the [particle
92-
filtering](https://en.wikipedia.org/wiki/Particle_filter) sampling
93-
algorithm for arbitrary order [Markov
94-
processes](https://en.wikipedia.org/wiki/Markov_model#Hidden_Markov_model).
95-
96-
- From v0.6.0, Libtask is implemented by recording all the computing
97-
to a tape and copying that tape. Before that version, it is based on
98-
a tricky hack on the Julia internals. You can check the commit
99-
history of this repo to see the details.
100-
101-
- From version 0.9.0, the old `TArray` and `TRef` types are completely removed, where previously they were deprecated.
9+
Used in the [Turing](https://github.com/TuringLang/Turing.jl) probabilistic programming language to implement various particle-based inference methods, for example those in [AdvancedPS.jl](https://github.com/TuringLang/AdvancedPS.jl/).

0 commit comments

Comments
 (0)