An indentation sensitive parser combinator language is one that helps you express
ideas like "this parse only succeeds if it's within the current indentation block".
The concept is somewhat small and elegant and is implemented in a few libraries. In
this writeup, I will use examples from indents
.
The direct goal will be to write the sameOrIndented
parser combinator with a type
#include <stdint.h> | |
/** | |
* Encode a code point using UTF-8 | |
* | |
* @author Ondřej Hruška <[email protected]> | |
* @license MIT | |
* | |
* @param out - output buffer (min 5 characters), will be 0-terminated | |
* @param utf - code point 0-0x10FFFF |
- Atom is transitioning to an entirely new way of defining grammars using
tree-sitter
. This will be enabled by default quite soon now. It is theoretically faster and more powerful than regex based grammars (the one described in this guide), but requires a steeper learning curve. My understanding is that regex based grammars will still be supported however (at least until version 2), so this guide can still be useful. To enable it yourself, go to Settings -> Core and checkUse Tree Sitter Parsers
Links for tree-sitter
help:
tree-sitter
: the main repotree-sitter-cli
: converts a JavaScript grammar to the required C/C++ filesnode-tree-sitter
: module to use Tree-sitter parsers in NodeJS- [My guide on starting a Tree-sitter grammar
Implementing Algebraic Effects in C “Monads for Free in C”
Microsoft Research Technical Report MSR-TR-2017-23 Daan Leijen Microsoft Research Updated by Kielan Lemons [email protected]
Abstract. We describe a full implementation of algebraic effects and handlers as a library in standard and portable C99, where effect operations can be used just like regular C functions. We use formal operational semantics to guide the C implementation at every step where an evaluation context corresponds directly to a particular C execution context. Finally we show a novel extension to the formal semantics to describe optimized tail resumptions and prove that the extension is sound. This gives two orders of magnitude improvement to the performance of tail resumptive operations (up to about 150 million operations per second on a Core [email protected])