These are chat archives for jdubray/sam

8th
Dec 2016
Jean-Jacques Dubray
@jdubray
Dec 08 2016 05:18

Svelte

You write your components using HTML, CSS and JavaScript (plus a few extra bits you can learn in under 5 minutes), and during your build process Svelte compiles them into tiny standalone JavaScript modules. By statically analysing the component template, we can make sure that the browser does as little work as possible.

Edward Mulraney
@edmulraney
Dec 08 2016 08:40
yeah i saw svelte the other day. its has similarities to what im making but is far too verbose and requires a pretty good understanding of the "framework"
what do you think about it?
Edward Mulraney
@edmulraney
Dec 08 2016 09:53
@jdubray can you show me an example of a TLA action (not your interpretation of one)? Also where does Dr. Lamport define "action" - i can't find it.
the closest thing ive found to a definition of an action is this:
Page 2
Formula X: An X step is one that increments x
Formulas X (and Y) are called actions. An action is true or false on a step, which is a pair of states--an old state, described by unprimed variables, and a new state, described by primed variables.
Edward Mulraney
@edmulraney
Dec 08 2016 10:01
So by this definition, an action is a step where the step increments x
Edward Mulraney
@edmulraney
Dec 08 2016 10:08
also he says an action is a pair of states: old state with unprimed variables -> new state with primed variables
i.e.
Edward Mulraney
@edmulraney
Dec 08 2016 10:15
abstract:
function action(oldState, unprimedVariables) {
  const primedVariables = doSomethingWith(unprimedVariables)
  const newState = oldState + primedVariables
  return newState
}
Edward Mulraney
@edmulraney
Dec 08 2016 10:20
specific:
function incrementCounterAction(oldState, unprimedVariables) {
  const primedVariables = {newValue: oldState.counter + unprimedVariables.incrementBy}
  const newState = {counter: primedVariables.newValue}
  return newState
}

const initialState = {counter: 0}
const unprimedVariables = {incrementBy: 2} 
incrementCounterAction(initialState, unprimedVariables) //  -> {counter: 2}
Edward Mulraney
@edmulraney
Dec 08 2016 11:20
@jdubray thoughts?