Skip to content

Instantly share code, notes, and snippets.

View the-sofi-uwu's full-sized avatar

Sofia Rodrigues the-sofi-uwu

View GitHub Profile
@the-sofi-uwu
the-sofi-uwu / in.md
Created April 20, 2024 22:15
All IN Impls
  • YALE (1998): Paper / Impl
    • Type: Text
    • Language: ??
    • Description:
  • AMINE / MPINE (2000) Paper / Impl
    • Type: Text
    • Language: ??
    • Description: "In this evaluator, each variable in the calculus is represented as a node that has the same name as the variable, and the substitution operation for a variable requires a search to find the node which corresponds to the variables. To prevent searching those nodes deeply, annotated terms, that have name lists of terms as annotations, are introduced; however, processing these annotations consume a considerable amount of time during execution. MPINE was also proposed as a concurrent." (Design and implementation of a low-level language for interaction nets - Shinya Sato) computation version of AMINE.
  • in² (2002): Paper / Impl
@the-sofi-uwu
the-sofi-uwu / inet.rs
Created June 4, 2023 14:17
Interaction Net Reducer Algorithm based on Taelin's algorithm
// An address is just a pointer to some agent inside the interaction net.
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Address(usize);
/// A slot is part of an agent that can connect to other ports.
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Slot(usize);
impl Slot {
/// The main port is always zero
@the-sofi-uwu
the-sofi-uwu / tt.rs
Last active February 12, 2024 22:34
Dependent type checker with substitution for lambda calculus.
use std::{collections::HashSet, fmt::Display, rc::Rc};
/// The AST. This thing describes
/// the syntatic tree of the program.
#[derive(Debug)]
pub enum Syntax {
Lambda {
param: String,
body: Rc<Syntax>,
},
@the-sofi-uwu
the-sofi-uwu / ata.md
Last active October 10, 2022 15:02
Mudanças no Compiler

Mudanças e ideias para o Kind2

Algumas mudanças bem importantes na linguagem vão ocorrer pelos próximos dias e que vão influenciar bastante o modo que programamos Kind2. Primeiro eu gostaria de introduzir as ideias que a linguagem tenta usar e, após isso, os problemas que pensei que não vão deixar a linguagem ir tanto para frente quanto eu queria.

Ideais

A unidade de modularização da linguagem seriam as funções já que tudo em Kind é primordialmente uma função ou um construtor (você pode considerar os 2 a mesma coisa já que um construtor é uma função que não reduz) e isso molda varios aspectos da linguagem como:

@the-sofi-uwu
the-sofi-uwu / pipes.idr
Created December 8, 2021 00:45
Canos UwU
module Pipes
import Control.Monad.Trans
import Data.IORef
-- It's just https://github.com/QuentinDuval/IdrisPipes with one small change.
||| PipeT is a composable data type to describe streams of data that
||| can be generated and can flow upstream and downstream just like
||| javascript generators
@the-sofi-uwu
the-sofi-uwu / diversao.md
Last active October 14, 2021 18:22
Coisas divertidas da programação

Coisas que eu recomendo vcs usarem algum dia pq é divertido

DHALL - Linguagem de configuração incrivel

https://dhall-lang.org/

NIX - Package manager com gerações e que é reversivel e OS baseado nisso

https://nixos.org/

Unison - Language for distributed systems:

@the-sofi-uwu
the-sofi-uwu / serial.re
Created May 6, 2021 18:22
Simple code to read from serial port with termios in reasonML
open Unix;
let start = baud =>
try({
let fd = openfile("/dev/ttyUSB0", [O_RDWR], 0o640);
let tty = {
...tcgetattr(fd),
c_parenb: false,
c_cstopb: 1,
c_csize: 8,
c_icanon: false,
@the-sofi-uwu
the-sofi-uwu / simplifier.hs
Created March 31, 2021 21:54
Boolean equation simplifier in Haskell
module Main where
data Cuit
= Cuit :+: Cuit
| Cuit :*: Cuit
| Neg Cuit
| Var String
(-|) = Neg
@the-sofi-uwu
the-sofi-uwu / seqqbe.rs
Last active February 20, 2021 12:35
Algoritmo seqqbe do louco do Nosomy com unsafe por causa do maldito bound checking
// Nosomy's SEQQBE Algorithm implemented in rust by Chiyoku
use std::env;
use std::io::{self, Write};
use std::io::BufWriter;
fn out_vector(vector: &mut Vec<u8>,size: usize,stream: &mut std::io::BufWriter<std::io::StdoutLock>) -> u8{
let mut counter: u8 = 0xFF;
for pos in 0..size{
let y = unsafe { vector.get_unchecked_mut(pos) };
@the-sofi-uwu
the-sofi-uwu / problem.idr
Created February 19, 2021 12:23
The problem
module LexerTest
import Text.Lexer
import Data.List
data TokenKind =Sharp
Show TokenKind where
show Sharp = "#"