Skip to content

Commit

Permalink
start writing the blog
Browse files Browse the repository at this point in the history
  • Loading branch information
thma committed Sep 17, 2023
1 parent ba94efd commit f2d5220
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,4 +629,3 @@ Here are some ideas for possible future extensions and improvements.
(implicit parallelism for strict operations, and an explicit `P`-combinator)

## Todo
- testcases for bulkOptLog
2 changes: 1 addition & 1 deletion benchmark/BenchmarkSources.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ tak :: SourceCode
tak = [r|
expected = 4
tak = y(λf x y z -> (if (geq y x) z (f (f (sub1 x) y z) (f (sub1 y) z x) (f (sub1 z) x y ))))
main = tak 18 6 3
main = tak 7 4 2
|]
2 changes: 1 addition & 1 deletion benchmark/ReductionBenchmarks.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ benchmarks = do
, bench "tak HHI-Eta" $ nf reducerTest takEta
, bench "tak HHI-Bulk" $ nf reducerTest takBulk
, bench "tak HHI-Bulk-Log" $ nf reducerTestLog takBulk
, bench "tak Native" $ nf tak1 (18,6,3)
, bench "tak Native" $ nf tak1 (7,4,2)
]
return ()

Expand Down
20 changes: 20 additions & 0 deletions kiselyov.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Optimizing bracket abstraction for Combinator based interpreters

## Abstract


## Introduction

In previous blog posts i have shown how functional languages can be implemented using a small set of combinators. The first post, [Implementing a functional language with Graph Reduction](https://thma.github.io/posts/2021-12-27-Implementing-a-functional-language-with-Graph-Reduction.html) proceeded in three major steps to implement a functional language:

- A parser for a tiny functional language based on the untyped λ-calculus.

- A compiler from λ-calculus to a fixed set of combinatory logic combinators (S,K,I,B,C and Y (aka. SICKBY)).

- A graph-reduction engine which implements the combinator rewrite rules as an efficient graph reduction

The second post, [Evaluating SKI combinators as native Haskell functions](https://thma.github.io/posts/2022-02-05-Evaluating-SKI-combinators-as-native-Haskell-functions.html), demonstrated how



In this post i will show how to optimize the implementation of the lambda calculus using combinators. The optimization is based on the paper [Optimizing bracket abstraction](http://okmij.org/ftp/Computation/lambda-calc.html#bracket-opt) by Oleg Kiselyov.
Binary file added performance-stats.xlsx
Binary file not shown.
Binary file added ~$performance-stats.xlsx
Binary file not shown.

0 comments on commit f2d5220

Please sign in to comment.