Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Oct 29, 2024
1 parent f839986 commit 3214c55
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions doc/basics/direct-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

## What is direct style?

Direct style is an approach to programming which leverages the built-in control flow constructs of the language as the
basic building blocks of effectful code.
Direct style is an approach to programming where the results of effectful computations are available directly, without
a "wrapper" type such as `Future`, `IO` or `Task`.

In direct style, I/O operations and thread synchronisations are executed as if they were blocking operations, that is
their result is available as the return value of the appropriate method call. However, specific direct style
implementations may contain special syntax that is needed to run such operations.
That way, direct-style programs can leverage the built-in control flow constructs of the language as the basic building
blocks of effectful code.

I/O operations and thread synchronisations are executed as if they were blocking operations, even if under the hood
they are run asynchronously, using continuations (which matter for throughput & performance).

The results of I/O operations are available "directly", as the return values of the appropriate method calls. Some
implementations may require using special syntax. In others, I/O calls are invoked as any other function or method
call, and there's no intermediate library-level runtime that is needed.

## Compiler/runtime support

Expand Down

0 comments on commit 3214c55

Please sign in to comment.