{"size": 1698, "ext": "scrbl", "max_stars_repo_path": "algebraic/scribblings/algebraic-tutorial.scrbl", "max_stars_repo_name": "aqui18/racket-algebraic", "max_stars_repo_stars_event_min_datetime": "2019-03-01T17:40:44.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-18T10:19:13.000Z", "max_issues_repo_path": "algebraic/scribblings/algebraic-tutorial.scrbl", "max_issues_repo_name": "aqui18/racket-algebraic", "max_issues_repo_issues_event_min_datetime": "2018-08-07T18:39:35.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-20T00:37:39.000Z", "max_forks_repo_path": "algebraic/scribblings/algebraic-tutorial.scrbl", "max_forks_repo_name": "aqui18/racket-algebraic", "max_forks_repo_forks_event_min_datetime": "2019-03-31T22:50:06.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-24T00:27:29.000Z"}
{"max_stars_count": 75, "max_issues_count": 91, "max_forks_count": 6, "avg_line_length": 36.9130434783, "max_line_length": 84, "alphanum_fraction": 0.7073027091}
#lang scribble/manual

@title[#:tag "tut" #:style '(toc no-sidebar)]{Tutorial: From Models to Interpreters}

@require{./algebraic-includes.rkt}

@; #############################################################################

A core use case for @algebraic-mod is fast and cheap interpreter development.
With the right tooling, throw-away interpreters can be an easy way to explore
and validate language design choices quickly.

As it happens, Haskell is already pretty good at this. Algebraic data types
and functional destructuring syntax make interpreters easy to read and write,
and its type system keeps track of pervasive breaking changes for you.
@algebraic-mod addresses the untyped half of this equation---algebraic data
@emph{structures} (ADTs sans typing constraints) with destructuring syntax.

In this series, we will implement three interpreters based on the models
originally used to design @algebraic-mod itself:

@itemlist[
  #:style 'ordered

  @item{A @emph{core} model based on the untyped λ-calculus,}

  @item{An @emph{extended} syntax that compiles down to core constructs, and}

  @item{A @emph{hosted} variant that borrows additional constructs from the
  implementing platform.}

]

The tutorials are written in an informal style with code and discussion mixed
together. If you prefer source code, it can be read all in one place
@hyperlink["https://github.com/dedbox/racket-algebraic/tree/master/model"]{on
github}.

@table-of-contents[]

@; #############################################################################

@include-section{./algebraic-tutorial-core.scrbl}
@include-section{./algebraic-tutorial-ext.scrbl}
@include-section{./algebraic-tutorial-host.scrbl}
