Coroutines with Higher Order Functions

12/19/2018
by   Dimitri Racordon, et al.
0

Coroutines are non-preemptive concurrent subroutines that, unlike preemptive threads, voluntarily transfer control between each others. Introduced in the 60s before loosing in popularity in the 80s, they have seen a regain of interest in recent years, thanks to how elegantly they can solve numerous algorithmic problems. Unfortunately, some mainstream languages still lack support for coroutines, hence requiring either the use of non-standard interpreter/compilers, or elaborate hacks in thrid-party libraries. In this short paper, we propose a very simple way to implement coroutine-like components on the top of any language that support or can emulate higher order functions. We accompany our explanations with a handful of examples in JavaScript.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/31/2016

Knowledge Representation Analysis of Graph Mining

Many problems, especially those with a composite structure, can naturall...
research
11/08/2021

Higher Order c-Differentials

EFRST20, the notion of c-differentials was introduced as a potential exp...
research
07/25/2019

Learning higher-order logic programs

A key feature of inductive logic programming (ILP) is its ability to lea...
research
08/14/2022

Who Finds the Short Proof? An Exploration of Variants of Boolos' Curious Inference using Higher-order Automated Theorem Provers

This paper reports on an exploration of variants of Boolos' curious infe...
research
06/20/2020

Dynamic Symbolic Execution of Higher-Order Functions

The effectiveness of concolic testing deteriorates as the size of progra...
research
04/05/2022

A simple algorithm for uniform sampling on the surface of a hypersphere

We propose a simple method for uniform sampling of points on the surface...

Please sign up or login with your details

Forgot password? Click here to reset