diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..75a79d35 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,19 @@ +# Created by https://www.toptal.com/developers/gitignore/api/hugo +# Edit at https://www.toptal.com/developers/gitignore?templates=hugo + +### Hugo ### +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock + +# End of https://www.toptal.com/developers/gitignore/api/hugo \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml deleted file mode 100644 index 3cd5a24a..00000000 --- a/docs/_config.yml +++ /dev/null @@ -1,17 +0,0 @@ -title: PPS-22-direct-style -description: Documentation for the PPS project -baseurl: "/PPS-22-direct-style-experiments" -source: ./content - -# Rendering -markdown: kramdown -kramdown: - input: GFM # uses GH Flavored Markdown - hard_wrap: false # do not enter
automatically - syntax_highlighter: rouge # Uses Rouge for syntax highlighting - -# Theme and plugins -remote_theme: pages-themes/primer@v0.6.0 -plugins: - - jekyll-remote-theme - - jemoji diff --git a/docs/archetypes/default.md b/docs/archetypes/default.md new file mode 100644 index 00000000..c6f3fcef --- /dev/null +++ b/docs/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/docs/index.md b/docs/content/_index.md similarity index 75% rename from docs/index.md rename to docs/content/_index.md index b6dd9871..4b27f958 100644 --- a/docs/index.md +++ b/docs/content/_index.md @@ -1,15 +1,18 @@ -# Goals +# Direct style for Functional Reactive Programming: an analysis in Scala & Kotlin + +## Goals of the project > Develop a few examples (not too complex) using asynchronous constructs and try to implement these examples in the two variants: using the current implementation of futures based on monadic constructs and the style that adopts gears (direct style). -Analyze aspects such as: +Analyze aspects such as: +> > - ergonomicity of the two styles (which one results more thoughtful and/or verbose) > - which of the two approaches has a real advantage in adoption, and when > - Pros and cons of the two styles > - how and when to use one approach rather than the other > - any limitations and difficulties encountered in using them -# Content +## Roadmap -TBD +1. [Boundary and break](./docs/boundaries) -1. [Boundary and break](./content/boundaries.md) +TBD diff --git a/docs/content/boundaries.md b/docs/content/docs/boundaries.md similarity index 99% rename from docs/content/boundaries.md rename to docs/content/docs/boundaries.md index f32a1c22..daebb5da 100644 --- a/docs/content/boundaries.md +++ b/docs/content/docs/boundaries.md @@ -6,6 +6,7 @@ - `boundary:` is short for `boundary.apply:` with the indented code below it passed as the body - `block` is a context function that is called within boundary.apply to return the block of code shown in the example - Users don’t define `Label` instances themselves. Instead, this is done inside the implementation of `boundary.apply` to provide the capability of doing a non-local return. + ```scala /** Run `body` with freshly generated label as implicit argument. Catch any * breaks associated with that label and return their results instead of @@ -18,6 +19,7 @@ if ex.label eq local then ex.value else throw ex ``` + - we don’t want users to call break without an enclosing boundary. That’s why break requires an in-scope given instance of Label, which the implementation of boundary.apply creates before it calls the code block you provide. If your code block calls break, a given Label will be in-scope. - non-localbreaks are logically implemented as non-fatal exceptions and the implementation is optimized to suppress unnecessary stack trace generation. Stack traces are unnecessary because we are handling these exceptions, not barfing them on the user! - optimizations: Better performance is provided when a break occurs to the enclosing scope inside the same method (i.e., the same stack frame), where it can be rewritten to a jump call. diff --git a/docs/go.mod b/docs/go.mod new file mode 100644 index 00000000..5e1d5bae --- /dev/null +++ b/docs/go.mod @@ -0,0 +1,5 @@ +module github.com/tassiLuca/PPS-22-direct-style-experiments/docs + +go 1.21.5 + +require github.com/alex-shpak/hugo-book v0.0.0-20231204233341-118997fa920e // indirect diff --git a/docs/go.sum b/docs/go.sum new file mode 100644 index 00000000..b2d59ad5 --- /dev/null +++ b/docs/go.sum @@ -0,0 +1,2 @@ +github.com/alex-shpak/hugo-book v0.0.0-20231204233341-118997fa920e h1:vOzQO2BCcgZ+M5W5KkhRHWiryNX/4RuA0iJprMrMUH4= +github.com/alex-shpak/hugo-book v0.0.0-20231204233341-118997fa920e/go.mod h1:L4NMyzbn15fpLIpmmtDg9ZFFyTZzw87/lk7M2bMQ7ds= diff --git a/docs/hugo.toml b/docs/hugo.toml new file mode 100644 index 00000000..5c97bb9f --- /dev/null +++ b/docs/hugo.toml @@ -0,0 +1,18 @@ +baseURL = 'https://tassiluca.github.io/PPS-22-direct-style-experiments/' +languageCode = 'en-us' +title = 'PPS-22-direct-style-experiments' + +enableGitInfo = true # to enable 'Last Modified by' date and git author information on 'doc' type pages. + +[markup] + [markup.highlight] + style = 'catppuccin-latte' + +[module] + [[module.imports]] + path = 'github.com/alex-shpak/hugo-book' + +[params] + BookTheme = 'auto' + BookRepo = 'https://github.com/tassiLuca/PPS-22-direct-style-experiments' # used for 'Last Modified' and 'Edit this page' links + BookCommitPath = 'commit'