More work on MSLUG talk
parent
109a4c9447
commit
03b912e5c9
|
@ -1,7 +1,11 @@
|
||||||
+ 0.87:
|
+ 0.87:
|
||||||
|
|
||||||
- live search operations need to hide the minibuffer
|
- list usability
|
||||||
- list gadget mouse over help
|
- presentation actions close the popup
|
||||||
|
- popup: -- close button
|
||||||
|
- popup: -- pin button
|
||||||
|
- modules: core/ libs/ apps/
|
||||||
|
- xml: "</a>" string>xml miscompiles
|
||||||
- top level window positioning on ms windows
|
- top level window positioning on ms windows
|
||||||
- scroll>rect broken if there are gadgets in between
|
- scroll>rect broken if there are gadgets in between
|
||||||
- completion is not ideal: eg, C+e "buttons"
|
- completion is not ideal: eg, C+e "buttons"
|
||||||
|
@ -12,6 +16,7 @@
|
||||||
- httpd crash
|
- httpd crash
|
||||||
- fep when closing window
|
- fep when closing window
|
||||||
- : foo \ each reload foo ; foo eventually crashes
|
- : foo \ each reload foo ; foo eventually crashes
|
||||||
|
- : foo "ppc" make-image stdio get duplex-stream-out pane-stream-pane pane-clear foo ; foo
|
||||||
- these things are "Too Slow":
|
- these things are "Too Slow":
|
||||||
- all-words
|
- all-words
|
||||||
- make-image
|
- make-image
|
||||||
|
@ -28,7 +33,6 @@
|
||||||
- auto-update browser and help when sources reload
|
- auto-update browser and help when sources reload
|
||||||
- mac intel: struct returns from objc methods
|
- mac intel: struct returns from objc methods
|
||||||
- new windows don't always have focus, eg focus follows mouse
|
- new windows don't always have focus, eg focus follows mouse
|
||||||
- listener commands from a menu should not include 'hide-glass' etc
|
|
||||||
- bogus compile errors?
|
- bogus compile errors?
|
||||||
- recompile get/set/>n/n>/ndrop if needed
|
- recompile get/set/>n/n>/ndrop if needed
|
||||||
- cross-word type inference
|
- cross-word type inference
|
||||||
|
|
|
@ -108,7 +108,7 @@ IN: mslug
|
||||||
{ $code "100 [ 4 mod 3 = ] subset ." }
|
{ $code "100 [ 4 mod 3 = ] subset ." }
|
||||||
{ $code "0 100 [ 1 + * ] reduce ." } }
|
{ $code "0 100 [ 1 + * ] reduce ." } }
|
||||||
}
|
}
|
||||||
{ $slide "Data types - hashtables, lazy lists"
|
{ $slide "Data types - hashtables"
|
||||||
"Hashtables: literal syntax, utility words, higher-order combinators..."
|
"Hashtables: literal syntax, utility words, higher-order combinators..."
|
||||||
{ $code
|
{ $code
|
||||||
"H{ { \"grass\" \"green\" } { \"chicken\" \"white\" } }"
|
"H{ { \"grass\" \"green\" } { \"chicken\" \"white\" } }"
|
||||||
|
@ -116,16 +116,10 @@ IN: mslug
|
||||||
"hash-union"
|
"hash-union"
|
||||||
}
|
}
|
||||||
"Prettyprinter -vs- inspector"
|
"Prettyprinter -vs- inspector"
|
||||||
{ "Lazy lists"
|
|
||||||
{ $code "\"contrib/lazy-lists\" require" "USE: lazy-lists" } }
|
|
||||||
{ $code
|
|
||||||
": squares naturals [ sq ] lmap ;"
|
|
||||||
": first-five-squares 5 squares ltake list>array ;"
|
|
||||||
}
|
|
||||||
"Option+h"
|
"Option+h"
|
||||||
}
|
}
|
||||||
{ $slide "Data types - others"
|
{ $slide "Data types - others"
|
||||||
"Queues, graphs, splay trees, double linked lists..."
|
"Queues, graphs, splay trees, double linked lists, lazy lists..."
|
||||||
}
|
}
|
||||||
{ $slide "Variables"
|
{ $slide "Variables"
|
||||||
"Dynamic scope - WHY?"
|
"Dynamic scope - WHY?"
|
||||||
|
@ -153,6 +147,8 @@ IN: mslug
|
||||||
}
|
}
|
||||||
{ $code "100 200 <rectangle>" }
|
{ $code "100 200 <rectangle>" }
|
||||||
{ $code "rectangle-w ." }
|
{ $code "rectangle-w ." }
|
||||||
|
}
|
||||||
|
{ $slide "Polymorphism"
|
||||||
{ "Generic words:"
|
{ "Generic words:"
|
||||||
{ $code
|
{ $code
|
||||||
"GENERIC: area ( shape -- n )"
|
"GENERIC: area ( shape -- n )"
|
||||||
|
@ -161,9 +157,10 @@ IN: mslug
|
||||||
"M: circle area circle-r sq pi * ;"
|
"M: circle area circle-r sq pi * ;"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{ "Philosophy: " { $link array } " -vs- " { $link nth } }
|
{ "Methods in classes -vs- methods in functions?" }
|
||||||
|
{ "Both: " { $link array } " -vs- " { $link nth } }
|
||||||
}
|
}
|
||||||
{ $slide "Polymorphism continued"
|
{ $slide "More polymorphism"
|
||||||
"Tuples can have custom constructor words"
|
"Tuples can have custom constructor words"
|
||||||
{ "Delegation instead of inheritance"
|
{ "Delegation instead of inheritance"
|
||||||
{ $code
|
{ $code
|
||||||
|
@ -175,23 +172,6 @@ IN: mslug
|
||||||
{ $code "100 200 <rectangle>" "{ 0.5 0.5 1 } <colored-shape>" "area ." }
|
{ $code "100 200 <rectangle>" "{ 0.5 0.5 1 } <colored-shape>" "area ." }
|
||||||
"Advanced features: predicate classes, union classes, method combination"
|
"Advanced features: predicate classes, union classes, method combination"
|
||||||
}
|
}
|
||||||
{ $slide "The compiler"
|
|
||||||
"Most code has a static stack effect"
|
|
||||||
{ "Combinators have a static stack effect if quotations are known:"
|
|
||||||
{ $code "[ sq ] map" } }
|
|
||||||
"First stage: construct dataflow graph"
|
|
||||||
"Second stage: optimize"
|
|
||||||
"Third stage: emit machine code"
|
|
||||||
"Compiled code saved in the image"
|
|
||||||
"Compiler invoked explicitly (not a ``JIT'')"
|
|
||||||
}
|
|
||||||
{ $slide "The compiler, continued"
|
|
||||||
"Rewrite rules"
|
|
||||||
"Identities"
|
|
||||||
"Intrinsics"
|
|
||||||
"Register allocation"
|
|
||||||
"Unboxing floats"
|
|
||||||
}
|
|
||||||
{ $slide "The Factor UI"
|
{ $slide "The Factor UI"
|
||||||
"Factor UI is totally implemented in Factor"
|
"Factor UI is totally implemented in Factor"
|
||||||
"OpenGL, FreeType, plus platform-specific code"
|
"OpenGL, FreeType, plus platform-specific code"
|
||||||
|
@ -206,10 +186,25 @@ IN: mslug
|
||||||
{ $slide "Models"
|
{ $slide "Models"
|
||||||
{ $code
|
{ $code
|
||||||
"USING: models gadgets-scrolling gadgets-text ;"
|
"USING: models gadgets-scrolling gadgets-text ;"
|
||||||
"<editor> dup <scroller> swap control-model"
|
}
|
||||||
|
"Create an editor, wrap it in a scroller:"
|
||||||
|
{ $code
|
||||||
|
"<editor>"
|
||||||
|
}
|
||||||
|
"Length filter:"
|
||||||
|
{ $code "dup control-model"
|
||||||
"[ concat length number>string ] <filter>"
|
"[ concat length number>string ] <filter>"
|
||||||
"<label-control>"
|
}
|
||||||
"2array make-pile"
|
}
|
||||||
|
{ $slide "Models continued"
|
||||||
|
"Layout:"
|
||||||
|
{ $code "{"
|
||||||
|
" { [ <label-control> ] f f @top }"
|
||||||
|
" { [ ] f f @center }"
|
||||||
|
"} make-frame"
|
||||||
|
}
|
||||||
|
"Window:"
|
||||||
|
{ $code
|
||||||
"\"Model test\" open-titled-window"
|
"\"Model test\" open-titled-window"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -220,6 +215,47 @@ IN: mslug
|
||||||
"Let's look at the source code:"
|
"Let's look at the source code:"
|
||||||
{ $module "examples/mslug-talk" }
|
{ $module "examples/mslug-talk" }
|
||||||
}
|
}
|
||||||
|
{ $slide "The compiler"
|
||||||
|
"Performance is a goal"
|
||||||
|
"Compromise: The compiler only compiles words with a static stack effect"
|
||||||
|
"Three stages"
|
||||||
|
{ "First stage transforms a quotation into the " { $emphasis "dataflow representation" } }
|
||||||
|
"Second stage: high-level optimizations"
|
||||||
|
"Third stage: register allocation, peephole optimization, code generation"
|
||||||
|
"Compiled code saved in the image"
|
||||||
|
"Compiler invoked explicitly (not a ``JIT'')"
|
||||||
|
}
|
||||||
|
{ $slide "High-level optimizer"
|
||||||
|
"Quotations <-> dataflow conversion is ``loss-less''"
|
||||||
|
"Really, just rewriting quotations"
|
||||||
|
"Type inference"
|
||||||
|
"Partial evaluation"
|
||||||
|
"Arithmetic identities"
|
||||||
|
"Optimistic specialization"
|
||||||
|
}
|
||||||
|
{ $slide "Low level optimizer"
|
||||||
|
"Caching stack in registers"
|
||||||
|
"Shuffling renames registers"
|
||||||
|
"Unboxing floats"
|
||||||
|
"Tail call optimization"
|
||||||
|
}
|
||||||
|
{ $slide "Assember DSL"
|
||||||
|
"The compiler emits machine code:"
|
||||||
|
{ $code
|
||||||
|
"char-reg PUSH"
|
||||||
|
"\"n\" operand 2 SHR"
|
||||||
|
"char-reg dup XOR"
|
||||||
|
"\"obj\" operand \"n\" operand ADD"
|
||||||
|
"char-reg-16 \"obj\" operand string-offset [+] MOV"
|
||||||
|
"char-reg tag-bits SHL"
|
||||||
|
"\"obj\" operand char-reg MOV"
|
||||||
|
"char-reg POP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ $slide "Assember DSL - continued"
|
||||||
|
{ "It's all done with " { $link make } }
|
||||||
|
{ $code "USE: assembler" "[ EAX ECX MOV ] { } make ." }
|
||||||
|
}
|
||||||
{ $slide "The end"
|
{ $slide "The end"
|
||||||
{ $url "http://factorcode.org" }
|
{ $url "http://factorcode.org" }
|
||||||
{ $url "http://factor-language.blogspot.com" }
|
{ $url "http://factor-language.blogspot.com" }
|
||||||
|
|
Loading…
Reference in New Issue