Skip to content

Instantly share code, notes, and snippets.

View aripiprazole's full-sized avatar
🎯
Focusing

Gabrielle Guimarães de Oliveira aripiprazole

🎯
Focusing
View GitHub Profile
@Hirrolot
Hirrolot / CoC.ml
Last active May 24, 2024 23:57
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)
@p4bl0-
p4bl0- / 00_readme.md
Last active October 12, 2023 09:09
A complete compiler for a simple language (in less than 150 LoC)

This project is a tiny compiler for a very simple language consisting of boolean expression.

The language has two constants: 1 for true and 0 for false, and 4 logic gates: ! (not), & (and), | (or), and ^ (xor).

It can also use parentheses to manage priorities.

Here is its grammar in BNF format:

expr ::= "0" | "1"

@aripiprazole
aripiprazole / .vimrc
Created July 16, 2020 06:33
Neovim configuration, also usable in vim.
"
"
" Vim/Nvim configuration
"
" https://github.com/tpope/vim-fugitive
" https://github.com/udalov/kotlin-vim
" https://github.com/junegunn/vim-plug
" https://github.com/puremourning/vimspector
"
@aunetx
aunetx / open-kitty.py
Last active May 29, 2022 17:18
A nautilus extension to open kitty in the current directory, instead of gnome-terminal.
# placed in ~/.local/share/nautilus-python/extensions/open-kitty.py
# you will need the package nautilus-python on fedora, or python-nautilus on ubuntu...
# french version
# translate and enjoy
import os
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote

In this tutorial we're going to build a set of parser combinators.

What is a parser combinator?

We'll answer the above question in 2 steps.

  1. What is a parser?
  2. and, what is a parser combinator?

So first question: What is parser?

@tylerneylon
tylerneylon / json.lua
Last active May 15, 2024 12:57
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.