Skip to content

Instantly share code, notes, and snippets.

View Charlynux's full-sized avatar

Charles Fourdrignier Charlynux

View GitHub Profile
@ghadishayban
ghadishayban / aproto3.ebnf
Last active August 7, 2020 04:00
instaparse is a super power
proto = <syntax> { import | package | option | message | enum | service | emptyStatement } <ws>
(* Header *)
syntax = ws "syntax" ws "=" ws ( "'proto3'" | '"proto3"' ) ws ";"
import = <ws "import" ws> [ "weak" | "public" ] <ws> strLit <ws ";">
package = <ws "package" ws> fullIdent <ws ";">
option = <ws "option" ws> optionName <ws "=" ws > constant <ws ";">
@rntz
rntz / Runtime.hs
Created February 14, 2019 21:38
A seminaïve, mildly optimizing compiler from modal Datafun to Haskell, in OCaml.
-- The Datafun runtime.
module Runtime where
import qualified Data.Set as Set
import Data.Set (Set)
class Eq a => Preord a where
(<:) :: a -> a -> Bool
class Preord a => Semilat a where