Write DApps as continuous workflows
Progress Report January 2023
Uniswap example problem unsolved
commits of code this month
Write DApps as continuous workflows
Progress Report January 2023
Uniswap example problem unsolved
commits of code this month
Write DApps as continuous workflows
Progress Report December 2022
Uniswap example problem unsolved
Commits on Dec 27, 2022
This is a serie of reflections on the presentation of Runar Branson Specifically, in the 39:30 he mention side effects as one of the main causes of the lack of composability. Most of the time we need the effects arranged in a different way than the one that forces the composition. For the example that he mentions: choose coffe, pay, serve, we can sustitute the one whose effect we want to reorder (pay) by one non-effectful, (add-to-cart) so that we can make many selections and pay at the end. What we do is to keep in the cart state the items selected.
But there are other reasons why side effects can prevent composition: threading, blocking for wathever reasons: communications, semaphores, callbacks, concurrency, loops waiting for some conditions... These are considered as lost cases for composition and not even mentioned. But transient demonstrates that this is not the case, that it is possible t
This is a tutorial about how to handle the complete state of a computation so that it can be serialized, stored, translated, analyzed, restored his execution etc
This text summarizes my reseach with Transient in this aspect which is the least known. I want to make it public since I belive has useful contributions to real world computing problems in novel ways and may make a difference. The text is the result of a balance between didactic simplicity (my intention) and the terseness of my laziness.
I use a pseudocode similar to Haskell. This is a very first version which will have errors for sure. But it gives an idea. I will perfect the content from time to time to make it more informative. At first it will be a gist.
This is a tutorial intended to teach how to invoke any part of a Transient-universe program using HTTP requests. It is also very useful to understand the mechanism of serialization and remote execution of distributed transient programs.
This is not the REST API that is also included in transient-universe. This API is shown in examples like api.hs which Is undocumented but I hope, may be self-explaining.
Note this is the api.hs version for the "new" branch which is being detailed here.
Transient is a library for the language Haskell that allows high-level effects like parallelism, concurrency, asynchronicity, streaming and distributed computing and manage them without special constructions.
I was looking at the last article of Michael Snoyman about asynchronous exceptions. Proper handling of resources in long term programs such are servers demands very accurate management of resources. In transient where many threads are spawned and sometimes killed asynchronously, this is even more important.
So I first tried to create a version of bracket
for the transient monad:
bracket
--Based on https://gist.github.com/gelisam/be8ff8004cd701a084b6d64204a28bb6 | |
{-# LANGUAGE DataKinds, DeriveFunctor, FlexibleContexts, GADTs, LambdaCase, RankNTypes, ScopedTypeVariables, TypeApplications, TypeOperators #-} | |
module Main (main) where | |
import qualified TransientCont as T -- this file: https://gist.github.com/agocorona/2c9149c4d2035f21952fc1d1691b7bde | |
import Criterion (bench, bgroup, nf,whnfIO) | |
import Criterion.Main (defaultMain) |
forM [1..10] $ \i -> ... use: i <- threads 0 $ choose [1..10]
-- run in the current thread
-- like for i = 1 to 10...
react
:onCallback wathever mycallback use: event <- react (onCallback wathever) (return())
-- first attempt (not compiled) of an example simulation of petri net https://twitter.com/semanticbeeng/status/1120662696985268225 | |
-- assume that the input is stored by a process `receive` not detailed here which store the entries in two transactional variables | |
-- read from two typed channels A and B | |
-- return three responses of type C | |
import Control.Concurrent.STM.TVar | |
import Transient.Base |