Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment with async-await. #1

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c8c4165
Experiment with async-await.
cristianoc May 19, 2022
722bd77
Add example project `example-async`.
cristianoc May 19, 2022
9e9f6ad
Use @async attribute instead of an external.
cristianoc May 19, 2022
60d8fa4
Remove old support for async primitive.
cristianoc May 19, 2022
3a6a88a
Add recursive function to run all tests.
cristianoc May 19, 2022
fc565eb
Support for @await decorator.
cristianoc May 20, 2022
0300cfd
Support async callbacks.
cristianoc May 20, 2022
c3deada
tweak callback example
cristianoc May 20, 2022
b4cf03a
Add async list example.
cristianoc May 20, 2022
27e5da0
Clean up treatment of async attribute.
cristianoc May 20, 2022
40f8549
Work around funny pretty printer formatting of await.
cristianoc May 20, 2022
de1a94a
Clean up.
cristianoc May 20, 2022
a7108dc
clean up dump
cristianoc May 20, 2022
5b87456
format dump
cristianoc May 20, 2022
7bdf4eb
More cleanup.
cristianoc May 20, 2022
99dfce2
Give error when awaiting not in an async context.
cristianoc May 20, 2022
90427ed
Give error when async is applied to a curried function.
cristianoc May 20, 2022
45707c1
Less invasive change to the ppx.
cristianoc May 22, 2022
d6e762a
More ppx cleanup.
cristianoc May 22, 2022
1e9b7a8
Use dedicated ast functions.
cristianoc May 22, 2022
be4dd25
Add module Ast_await.
cristianoc May 22, 2022
83293bc
Lift restriction to uncurried functions.
cristianoc May 22, 2022
a493fb4
Braces are preserved by reformatting, but belong to the same function.
cristianoc May 22, 2022
430fc39
Unusual uncurried function with 2 arguments.
cristianoc May 22, 2022
ec45af5
Use .mjs in source dir.
cristianoc May 27, 2022
7d424df
Add example fetch using result type.
cristianoc May 27, 2022
776ce22
Add imaginary syntax.
cristianoc May 27, 2022
447f0dc
tweak imaginary syntax, free up "&&".
cristianoc May 27, 2022
d7a6e1d
"and" seems more idiomatic
cristianoc May 27, 2022
31d304d
Example with exception-annotated fetch.
cristianoc May 29, 2022
df9fcbc
tweak example
cristianoc May 31, 2022
d4ebe16
snapshot
cristianoc Jun 12, 2022
53b5950
Rebase on latest 10.0 alpha compiler.
cristianoc Jul 5, 2022
29d83b8
Begin preparing for source syntax.
cristianoc Jul 7, 2022
1299f6e
Pull in the surface syntax from the syntax submodule.
cristianoc Jul 7, 2022
c233a1f
Make sure the example still builds.
cristianoc Jul 7, 2022
87b9033
Example: switch to the new `res.*` attributes.
cristianoc Jul 7, 2022
d414bc5
Example: switch `async` to surface syntax.
cristianoc Jul 7, 2022
eb3dbaf
Switch over await's to surface syntax.
cristianoc Jul 7, 2022
f9a8eb4
Sync latest surface syntax.
cristianoc Jul 7, 2022
fd46313
Almost reformat.
cristianoc Jul 7, 2022
17b3dcd
One more syntax sync.
cristianoc Jul 7, 2022
baf8d45
Update .prettierignore
cristianoc Jul 7, 2022
0c8fb12
Rebase on latest compiler.
cristianoc Jul 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ lib/
vendor/
ninja/
syntax/
example-async/
ocaml-tree/
_opam
Changes.md
Expand Down
25 changes: 25 additions & 0 deletions example-async/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
*.exe
*.obj
*.out
*.compile
*.native
*.byte
*.cmo
*.annot
*.cmi
*.cmx
*.cmt
*.cmti
*.cma
*.a
*.cmxa
*.obj
*~
*.annot
*.cmj
*.bak
lib/bs
*.mlast
*.mliast
.vscode
.merlin
20 changes: 20 additions & 0 deletions example-async/bsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "example-async",
"reanalyze": {
"analysis": ["exception"]
},
"sources": [
{
"dir": "src",
"subdirs": true
}
],
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".mjs",
"bsc-flags": ["-w -33-44"],
"bs-dependencies": ["@rescript/react", "bs-fetch"],
"reason": { "react-jsx": 3 }
}
179 changes: 179 additions & 0 deletions example-async/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions example-async/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"scripts": {
"clean": "rescript clean -with-deps",
"build": "rescript build",
"watch": "rescript build -w"
},
"dependencies": {
"bs-fetch": "^0.6.2",
"rescript": "file:.."
},
"private": true,
"devDependencies": {
"@rescript/react": "^0.10.3"
}
}
Loading