Skip to content

Commit f0bf52a

Browse files
committed
Update whatsnew and add walkthrough
1 parent 42ffaf3 commit f0bf52a

File tree

3 files changed

+115
-9
lines changed

3 files changed

+115
-9
lines changed

support/vscode/koka.language-koka/package.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"images/",
1919
"dist/extension.js",
2020
"koka-configuration.json",
21-
"README.md"
21+
"README.md",
22+
"walkthroughs/samples.md"
2223
],
2324
"keywords": [
2425
"koka",
@@ -41,10 +42,25 @@
4142
],
4243
"main": "./dist/extension.js",
4344
"activationEvents": [
44-
"workspaceContains:**/*.kk",
45-
"onStartupFinished"
45+
"workspaceContains:**/*.kk"
4646
],
4747
"contributes": {
48+
"walkthroughs": [
49+
{
50+
"id": "getting-started",
51+
"title": "Getting Started with Koka",
52+
"description": "A walkthrough of the samples",
53+
"steps": [
54+
{
55+
"id": "open-samples",
56+
"title": "Open samples",
57+
"description": "[Open samples](command:koka.openSamples)",
58+
"media": { "markdown": "walkthroughs/samples.md" },
59+
"completionEvents": ["onCommand:koka.openSamples"]
60+
}
61+
]
62+
}
63+
],
4864
"languages": [
4965
{
5066
"id": "koka",
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Welcome to Koka
2+
3+
Koka is a strongly typed functional-style language with effect types and handlers --
4+
generating direct C code without needing a runtime system.
5+
6+
# Samples Overview
7+
The Koka compiler (which should automatically prompt for install) comes with a set of samples to walk you through the language.
8+
9+
If you need help installing see [these instructions](https://koka-lang.github.io/koka/doc/book.html#install).
10+
11+
## Just Learning
12+
Start by opening the [samples](command:koka.openSamples).
13+
14+
To start learning about Koka's features we recommend going through the `learn` folder in the following order:
15+
16+
1. basic
17+
2. qualifiers
18+
3. implicits
19+
4. with
20+
5. handler
21+
6. fip
22+
7. contexts
23+
8. lazycons (new!)
24+
25+
Read through and run the samples using the code actions.
26+
27+
Feel free to edit the samples to try out things.
28+
However, note that new extension / compiler versions will install new samples, and you will lose your work.
29+
30+
## Next Steps
31+
32+
If wanting to see more algorithmic examples open the basic folder.
33+
34+
If you want to learn more about Koka's effect handlers go to the handlers folder next.
35+
36+
Recommended ordering for handlers samples:
37+
38+
1. yield
39+
2. basic
40+
3. ambient
41+
4. scoped / parser
42+
5. nim
43+
6. unix
44+
7. vec
45+
46+
Then to get even more advanced, look at the samples for named handlers in `handlers/named` in the following order:
47+
48+
1. file
49+
2. file-scoped
50+
3. ask
51+
4. ask-poly
52+
5. heap
53+
6. unify
54+
55+
56+
For a more thorough reference see the [book](https://koka-lang.github.io/koka/doc/book.html), or library [docs](https://koka-lang.github.io/koka/doc/toc.html)
57+

whatsnew.md

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,55 @@ generating direct C code without needing a runtime system. To learn more:
1111

1212
* Read the [Koka book][kokabook] for a tour of the Koka language and its specification.
1313

14+
* See the new [VSCode walkthrough](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22koka.language-koka%23getting-started%22%7D) for recommended learning paths.
15+
16+
* Execute the [`Koka: Open Samples`][samples] command in VSCode to open the samples.
17+
1418
### v3.1.3, 2025-01-22
1519

16-
- Fix optimized compilation from VS Code (which defaulted to lower optimization before)
20+
**New features:**
1721

18-
- Add applier syntax `.()` where `x.f.(42)` is sugar for `(x.f)(42)` which
22+
- Allow passing named arguments anywhere in the argument list (i.e. `f(name = "Tim") fn() ...` now works!) [#491](https://github.com/koka-lang/koka/pull/491)
23+
- New applier syntax `.()` where `x.f.(42)` is sugar for `(x.f)(42)` which
1924
can be convenient when calling functions selected from a `struct`.
25+
- Added lazy constructors! See the new `learn/lazycons.kk` sample, thanks @anfelor.
26+
- Functions that take optional parameters are eta-expanded when resolving implicits
27+
- Operators are now allowed as field names.
28+
- Named handlers now have the type `ev<named-eff>` rather than just plain `named-eff`.
29+
- Local variables are now automatically masked in more cases.
2030

21-
- Improve Windows installation, check clang version and Windows build tools.
31+
**Syntax Updates:**
2232

2333
- Declare reference types as `reference type` (instead of `ref type`).
2434
All types are by default reference types except for enumerations (all singleton) or
2535
isomorphic types (single constructor with one field, i.e. a `newtype`).
26-
2736
- Declare divergent types as `div type/effect` (instead of `rec type/effect`).
2837

29-
- Various bug fixes.
38+
**Std Library:**
39+
40+
- New type `core/types/pad` for usage in fbip algorithms
41+
- New parser combinators `sep-by` and `sep-by1` thanks @toh995 [#681](https://github.com/koka-lang/koka/pull/681)
42+
- Added module information to the `core/maybe/unjust` function and an `core/maybe/expect` function that takes an error. Similarly for `maybe2` [$658](https://github.com/koka-lang/koka/pull/658).
43+
- `core/debug/impossible` lets you throw an uncatchable exception (abort) when in an unreachable match case.
44+
45+
**Fixes:**
46+
47+
- Fixed `take` and `extend` on empty slices
48+
- Fixed issues with duplicate effects in rows [#511](https://github.com/koka-lang/koka/issue/511)
49+
- Fixed issues with masking effects [#509](https://github.com/koka-lang/koka/issue/509)
50+
- Fixed issues with finally [#360](https://github.com/koka-lang/koka/issue/360)
51+
- Fixed name lookup with import renaming
52+
- Fix optimized compilation from VS Code (which defaulted to lower optimization before)
53+
- Improve Windows installation, check clang version and Windows build tools.
54+
- Various other bug and documentation fixes, including many fixes to the JS backend, improvements to the installation process, and better type errors. Thanks @gsuuon [#562](https://github.com/koka-lang/koka/pull/562), @oconnor0 [#569](https://github.com/koka-lang/koka/pull/569), @kyepskee [#575](https://github.com/koka-lang/koka/pull/575)[#671](https://github.com/koka-lang/koka/pull/671), @arvidjonasson [#580](https://github.com/koka-lang/koka/pull/580), @Guest0x0 [#595](https://github.com/koka-lang/koka/pull/595), @osa1 [#604](https://github.com/koka-lang/koka/pull/604), @syaiful6 [#672](https://github.com/koka-lang/koka/pull/672), @timbertson [#677](https://github.com/koka-lang/koka/pull/677)[#692](https://github.com/koka-lang/koka/pull/692)[#712](https://github.com/koka-lang/koka/pull/712), @toh995 [#681](https://github.com/koka-lang/koka/pull/681), @ov7a [#740](https://github.com/koka-lang/koka/pull/740), @TimWhiting [#640](https://github.com/koka-lang/koka/pull/640)[#647](https://github.com/koka-lang/koka/pull/647)[#661](https://github.com/koka-lang/koka/pull/661)[#637](https://github.com/koka-lang/koka/pull/637)[#689](https://github.com/koka-lang/koka/pull/689)[#682](https://github.com/koka-lang/koka/pull/682)[#690](https://github.com/koka-lang/koka/pull/690)[#735](https://github.com/koka-lang/koka/pull/735)[#737](https://github.com/koka-lang/koka/pull/737)...
55+
- Many other issues fixed.
56+
57+
**Extension Updates:**
58+
59+
- The extension now allows you to generate various functions based on the datatype [#622](https://github.com/koka-lang/koka/pull/622).
60+
- You can more easily compile for different backends using the command `Koka: Set compilation target`.
61+
- Added automatic release update notifications and compiler version management. Use the command `Koka: Download and install a specific version of the compiler` to download a specific version of the compiler.
62+
- The VSCode extension now only activates in folders with `.kk`, or when a command is run.
3063

3164
### v3.1.2, 2024-05-30
3265

@@ -120,7 +153,7 @@ Enjoy!
120153

121154
[fip]: https://www.microsoft.com/en-us/research/uploads/prod/2023/05/fbip.pdf
122155
[fccontext]: https://www.microsoft.com/en-us/research/uploads/prod/2023/07/fiptree-tr-v4.pdf
123-
156+
[samples]: command:koka.openSamples
124157

125158
## Previous Releases
126159

0 commit comments

Comments
 (0)