Wednesday, June 05, 2019

AssemblyScript: WebAssembly + TypeScript

WebAssembly.org

mbasso/awesome-wasm: 😎 Curated list of awesome things regarding WebAssembly (wasm) ecosystem @GitHub
Collection of awesome things regarding WebAssembly (wasm) ecosystem.

WebAssembly. Neither Web Nor Assembly, All Revolutionary @InfoQ

WebAssembly: Neither Web Nor Assembly, But Revolutionary PDF slides

WebAssembly is a stack machinea data structure with two operations: push and pop
stack machine: instructions on a stack
instead of AST, SSA, or register machine

1+2 => 1, 2, +

i32.const 1
i32.const 2
i32.add

int factorial(int n) {
  if (n == 0) { return 1; }
  else { return n * factorial(n - 1); }
}


(func $factorial (param $n i32) (result i32)
  get_local $n
  i32.const 0
  i32.eq
  if $if0
  i32.const 1
  return
  end $if0
  get_local $n
  i32.const 1
  i32.sub
  call $factorial
  get_local $n
  i32.mul
)



AssemblyScript

AssemblyScript/assemblyscript: Definitely not a TypeScript to WebAssembly compiler 🚀@GitHub

"AssemblyScript compiles strictly typed TypeScript (basically JavaScript with types) to WebAssembly using Binaryen. It generates lean and mean WebAssembly modules while being just an npm install away.

Try it out in WebAssembly Studio!"




React Formik

jaredpalmer/formik: Build forms in React, without the tears 😭 @GitHub


Formik · Build forms in React, without tears.

"forms are really verbose in React. To make matters worse, most form helpers do wayyyy too much magic and often have a significant performance cost associated with them. Formik is a small library that helps you with the 3 most annoying parts:
  • Getting values in and out of form state
  • Validation and error messages
  • Handling form submission

By colocating all of the above in one place, Formik will keep things organized--making testing, refactoring, and reasoning about your forms a breeze."