zettel

LLVM

From this ELI5 https://www.reddit.com/r/learnprogramming/comments/t6y74/eli5_what_is_llvm_can_it_be_used_for_general/ Normally source code to assembly LLVM is a middleman VM that can make things easier on both ends (source code to LLVM, LLVM to assembly) You now only need two things (depending) creating new high level language: front end (source code to LLVM) creating new chip/instruction set: LLVM assembler (LLVM to assembly) Previous state of the world before LLVM: must be responsible from source code all the way to assembly PER language PER chip = massive headache.

Commit and Reveal scheme

Commitment schemes remind me of differential privacy, and the XOR trick learnt in competitive programming (XOR a set of numbers that all have a duplicate except one). Suppose you want to generate a random number that nobody can predict (AKA a random number).

Ethereum Virtual Machine

Virtual Machine - runtime environment “computer running on computer” e.g. JVM allows interoperability (cross-platform) has it’s own bytecode specifically for smart contracts

Solidity Ref

Language that targets the EVM. Basic template pragma solidity __version__ contract NameOfContract { // state variables // public makes accessible from other contracts (like a global variable on the chain) // event can react from a trigger // error provide info on why fail // functions // fallback function if anything is called } General constructor called at beginning msg is a global variable Can check whether msg.

Haskell Reference

lazy, atomic/stateless, strong typing, pure (no side effects) Some pros concurrency faster What are haskell bindings? What are monads? forcing side effects into haskell What is haskell better for?

Pytorch Reference

Near Field Communication (NFC)

What prevents them from being cloned? - Nothing. - Unique ID in ROM segment (ID cannot be changed then)

Assembly Ref

In computer org, data allocation happens on the stack (more limited, faster, more immediate actions) and heap (adaptable, slower, dynamic memory). data segment for variables, code segment also shellcode is asm instructions in hex code (architectures have shellcodes represent certain operations)

Buffer Overflow

Buffer overflow happens when an unsafe buffer that reads in inputs goes outside the bounds of it’s intended memory address It can be deadly because the stack can be overwritten Can return an overwritten memory address by manipulating the eip register, which is the instruction pointer (next instruction) It may be harder to overwrite local variables and less useful, since compiler optimization may not overwrite where you want it to.

Pyro Reference

Built with pytorch backend Usually involves specifying a generative process Usually either use Stochastic Variational Inference (SVI) optimization methods or Monte Carlo Markov Chain (MCMC) sampling methods For SVI Define a model and a guide (variational distribution) guides define where the parameters are to be learnt Example model and guide code