Skip to content

Instantly share code, notes, and snippets.

View EduardoRFS's full-sized avatar
♥️
Laughing at the abysm

Eduardo Rafael EduardoRFS

♥️
Laughing at the abysm
View GitHub Profile
#!/bin/bash
cd /app
sudo apt-get -y install nodejs npm m4
curl -o- -L https://yarnpkg.com/install.sh | bash
source ~/.bashrc
export OPAMYES=true
opam switch create 4.06.1
FROM archlinux
ENV OPAMYES=true
RUN pacman -Sy --noconfirm base-devel awk m4 git unzip perl wget nodejs npm yarn
RUN curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh | sh
RUN useradd -m updatebs
USER updatebs

ocaml-platform

  • type based auto complete
  • semantic highlighting
  • let%ppx abc = "def"; syntax highlighting
  • autocomplete when backspace
  • autocomplete on f(g(~expr=here)) sucks
  • let.bind auto complete

esy

@EduardoRFS
EduardoRFS / val+ref.as
Last active September 20, 2020 03:53
/*
your obj pointer came in the first position of the stack
so you will load it on a register
*/
movl (%esp), %eax ;
/*
then you want to do obj.a += 6, if we suppose
that we're talking about records not dictionaries
import sharp from 'sharp';
import fs from 'fs-extra';
import _ from 'lodash/fp';
const parseImage = (path: string) =>
Promise.all([
sharp(path).metadata(),
sharp(path)
.grayscale()
.raw()

Recursion

This document should describe what should be the behavior when we have recursive dependencies.

Motivations

// TODO: Why is this useful. As seen in harfbuzz and freetype2 on runtime and for general recursion you can look at most compilers.

Runtime Recursion

  • remove caml_exn_Division_by_zero when it cannot happen, like a / (a * a)
  • perhaps generalize it to knowing that a number is positive not operating on it
  • do simple math inside of big functions
  • try to optimize x |> map() |> map()
  • search module String on https://ocaml.janestreet.com/ocaml-core/latest/doc/base/Base/
  • check to see if it inlines | x when is(x) and is is another pattern matching
  • typechecker should try to ensure value when dealing with records, there is no need to open a module for that
  • remove inner closures without any reference
  • let.some (_, _, name, received_value_type, index) =List.nth_opt(variable_table, table_index); no warning even if not used on index
/*
features:
- auto currying
- closures
- recursion
- basic branching
- ffi with JS
missing:
- tail call recursion

Pacman Pipeline

  • install while download
#! /bin/sh
## Requirements
## - esy
## - brew install nodejs
## - brew install coreutils
## Full Xcode installed
## look for /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
git clone https://github.com/EduardoRFS/reason-mobile.git