Skip to content

Latest commit

 

History

History
57 lines (50 loc) · 2.47 KB

11-the-browser-and-the-brain.md

File metadata and controls

57 lines (50 loc) · 2.47 KB

The Browser and the Brain

Understanding

Programming Languages

  • Define vocabulary with patterns and syntax with grammars
  • Parsers read code and interpret with lexical and syntactic analysis by a lexer and a parser, respectively
  • HTML is not context free and so it can't be parsed by a regular parser
  • CSS is a context-free language
  • Both parsers generate a tree representing what they parsed

Natural Languages

  • Have a lexicon and syntax that cannot be described by a context-free grammar
  • Human language contains a lot of ambiguity
  • Steps
    1. Break the unbroken speech stream into words
    2. The minds match the sounds to words in the mental lexicon
    3. Once we have access to the word, we have access to its meaning and its syntactic and thematic roles
    4. Then we can parse the sentence, but it's unclear how that works...
      • Modular View: the phrases involved occur separately in different modules
      • Interactive View: all available information can be used at once in parsing the sentence
      • Does this happen in serial or parallel?
  • Humans are forgiving of syntax errors
  • Receptive language processing occurs in the dominant hemisphere of the brain, in Wernicke's area

Visualizing

How does the human visual system paint a picture of the world; how does the browser render pictures to the screen?

Humans

  1. Visible light goes into the eye via cornea and lens
  2. Retina turns light into neural signals using rods and cones
  3. Neural signals are sent to the brain
  4. They are combined in the optic chiasm
  5. Most signals are sent to the lateral geniculate nuclei
  6. Signals end up at the primary visual cortex
  7. Signals get sent to higher visual processing centers to perceive what is seen

Browsers

  1. Evaluate langage to get the trees
  2. DOM and CSSOM trees combined to form the render tree
  3. Browser traverses render tree, calculating location and size of all elements
  4. Browser traverses render tree, creating layers of bitmaps
  5. Bitmaps sent to the GPU for compositing
  6. Do it over and over, optimally 60 FPS

Task Management

Can the human mind and the browser multitask?

Humans

  • attention ... as a filter, as a spotlight, as control (blocking unwanted distractions and automated processes)
  • attention ... as threads?
  • Humans are bad at multitasking
    • inattentional blindness
    • dichotic listening task
    • shadowing

Browsers

  • JavaScript doesn't multitask; it's single threaded
  • Javascript can call out to APIs to effectively multitask