Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon-compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
typon
typon-compiler
Commits
e548de56
Commit
e548de56
authored
Jul 11, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add README.md (WIP)
parents
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
README.md
README.md
+82
-0
No files found.
README.md
0 → 100644
View file @
e548de56
# (*Working Title*) Typon
> typon \ti.pɔ̃\ masculin
>
> (Imprimerie) Masque, feuille transparente, sur laquelle est imprimé un motif
> dans une encre opaque qui permet d'insoler, puis de graver la plaque qui
> servira à imprimer.
>
> (Électronique) Masque transparent sur lequel sont imprimées les pistes, dans
> une encre opaque aux ultraviolets, permettant de réaliser un circuit imprimé
> par photogravure soustractive.
Typon is a three-part project to bring practical GIL-free concurrency to Python:
1.
[ ] Write a C++ concurrency runtime
2.
[ ] Write a compiler from Python syntax into C++
3.
[ ] Add C++/Python bindings for interoperability with actual Python
Step 1 is currently in progress.
## (*in progress*) `typon/rt`, A Concurrency Runtime
A continuation-stealing concurrency runtime using cutting-edge C++20 coroutines,
featuring both
`fork`
/
`sync`
structured concurrency and
`future`
-based unbounded
concurrency.
### Status
-
[x] structured concurrency with
`fork`
/
`sync`
-
[x] systematic exception propagation from
`fork`
ed tasks
-
[x] unbounded concurrency with
`future`
-
[x] asynchronous waiting (
`Promise`
,
`future`
/
`Future`
)
-
[ ] channels (single producer, single consumer)
-
[ ] mutexes (with asynchronous blocking)
-
[ ] asynchronous I/O
-
[ ] builtin task cancellation
### `fork`/`sync`, Structured Concurrency
```
C++
using namespace typon;
Join<int> fibo(int n) {
if (n < 2) {
co_return n;
}
// Start two potentially concurrent tasks
Forked a = co_await fork(fibo(n - 1));
Forked b = co_await fork(fibo(n - 2));
// Wait until they both complete
co_await Sync();
// Access the results
co_return a.get() + b.get();
}
```
### `future`, Unbounded Concurrency
```
using namespace typon;
Task<int> fibo(int n) {
if (n < 2) {
co_return n;
}
// Start two potentially concurrent tasks
Future a = co_await future(fibo(n - 1));
Future b = co_await future(fibo(n - 2));
// Wait for each future and retrieve the results
co_return co_await a.get() + co_await b.get();
}
```
### References
-
https://en.wikipedia.org/wiki/Work_stealing#Child_stealing_vs._continuation_stealing
-
https://en.wikipedia.org/wiki/Futures_and_promises
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment