Merge branch 'master' of git://factorcode.org/git/factor

release
Slava Pestov 2007-11-04 23:17:40 -05:00
commit 5666e7278a
24 changed files with 157 additions and 128 deletions
core/alien/c-types

View File

@ -29,7 +29,7 @@ TUPLE: no-c-type name ;
dup string? [ (c-type) ] when
] when ;
GENERIC: c-type ( name -- type )
GENERIC: c-type ( name -- type ) foldable
: resolve-pointer-type ( name -- name )
c-types get at dup string?

View File

@ -1,16 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-prettyprint? t }
{ strip-globals? t }
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Cellular Automata.app" }
}

View File

@ -1,13 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Boids.app" }
}

View File

@ -1,12 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? t }
{ deploy-ui? t }
{ deploy-io 3 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Bunny.app" }
}

View File

@ -0,0 +1,12 @@
USING: tools.deploy.config ;
V{
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "catalyst-talk.app" }
}

View File

@ -1,12 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ "bundle-name" "Color Picker.app" }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "color-picker.app" }
}

View File

@ -1,13 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? f }
{ strip-dictionary? t }
{ strip-debugger? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ strip-prettyprint? f }
{ deploy-io 1 }
{ deploy-reflection 3 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Gesture Logger.app" }
}

View File

@ -1,17 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-io? t }
{ strip-prettyprint? t }
{ strip-globals? t }
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Golden Section.app" }
}

View File

@ -1,16 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-prettyprint? t }
{ strip-globals? t }
{ strip-word-props? t }
{ strip-word-names? f }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 2 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Hello World.app" }
{ "bundle-name" "Hello world.app" }
}

View File

@ -1,15 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-prettyprint? t }
{ strip-globals? t }
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? f }
{ deploy-compiled? f }
{ deploy-io? f }
{ deploy-ui? f }
{ deploy-io 3 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? f }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Hello world (console).app" }
}

View File

@ -4,7 +4,7 @@
USING: kernel math sequences kernel.private namespaces arrays
io io.files splitting io.binary math.functions vectors
quotations combinators.private ;
IN: universal-machine
IN: icfp.2006
SYMBOL: regs
SYMBOL: arrays

View File

@ -1 +0,0 @@
lint refactor

View File

@ -1 +1 @@
L-system explorer
Lindenmayer system explorer

View File

@ -1,13 +1,13 @@
USING: tools.deploy ;
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ "bundle-name" "Lindenmayer Systems.app" }
{ deploy-io 1 }
{ deploy-reflection 2 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? t }
{ deploy-word-defs? t }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Lindenmayer System Explorer.app" }
}

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel math math.functions ;
IN: quadratic
IN: math.quadratic
: monic ( c b a -- c' b' ) tuck / >r / r> ;

View File

@ -1,13 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? f }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Maze.app" }
}

View File

@ -1,13 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ "bundle-name" "NeHe Demos.app" }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "NeHe OpenGL demos.app" }
}

View File

@ -1,13 +1,12 @@
USING: tools.deploy.config ;
V{
{ strip-word-props? t }
{ strip-word-names? t }
{ strip-dictionary? t }
{ strip-debugger? t }
{ strip-c-types? t }
{ deploy-math? t }
{ deploy-compiled? t }
{ deploy-io? f }
{ deploy-ui? t }
{ deploy-io 1 }
{ deploy-reflection 1 }
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-c-types? f }
{ "stop-after-last-window?" t }
{ "bundle-name" "Tetris.app" }
}

View File

@ -9,10 +9,11 @@ ARTICLE: "deploy-config" "Deployment configuration"
{ $subsection deploy-config }
{ $subsection set-deploy-config }
"A utility word is provided to load the configuration, change a flag, and store it back to disk:"
{ $subsection set-deploy-flag } ;
{ $subsection set-deploy-flag }
"The " { $link "ui.tools.deploy" } " provides a graphical way of editing the configuration." ;
ARTICLE: "deploy-flags" "Deployment flags"
"There are two types of flags. The first set controls the major subsystems which are to be included in the deployment image:"
"There are two sets of deployment flags. The first set controls the major subsystems which are to be included in the deployment image:"
{ $subsection deploy-math? }
{ $subsection deploy-compiler? }
{ $subsection deploy-ui? }
@ -34,10 +35,26 @@ HELP: deploy-word-props?
$nl
"Off by default. Enable this if the heuristics strip out required word properties." } ;
HELP: deploy-c-types?
{ $description "Deploy flag. If set, the deploy tool retains the " { $link c-types } " table."
HELP: deploy-word-defs?
{ $description "Deploy flag. If set, the deploy tool retains word definition quotations for words compiled with the optimizing compiler. Otherwise, word definitions are stripped from words compiled with the optimizing compiler."
$nl
"Off by default. Disable this if your program calls " { $link c-type } ", " { $link heap-size } ", " { $link <c-object> } ", " { $link <c-array> } ", " { $link malloc-object } ", or " { $link malloc-array } " with a C type name which is not a literal pushed directly at the call site. In this situation, the compiler is unable to fold away the C type lookup, and thus must use the global table at runtime." } ;
"Off by default. During normal execution, the word definition quotation of a word compiled with the optimizing compiler is not used, so disabling this flag can save space. However, some libraries introspect word definitions dynamically (for example, " { $link "inverse" } ") and so programs using these libraries must retain word definition quotations." } ;
HELP: deploy-c-types?
{ $description "Deploy flag. If set, the deploy tool retains the " { $link c-types } " table, otherwise this table is stripped out, saving space."
$nl
"Off by default."
$nl
"The optimizing compiler is able to fold away calls to various words which take a C type as an input if the C type is a literal string:"
{ $list
{ $link c-type }
{ $link heap-size }
{ $link <c-object> }
{ $link <c-array> }
{ $link malloc-object }
{ $link malloc-array }
}
"If your program looks up C types dynamically or from words which do not have a stack effect, you must enable this flag, because in these situations the C type lookup is not folded away and the global table must be consulted at runtime." } ;
HELP: deploy-math?
{ $description "Deploy flag. If set, the deployed image will contain support for " { $link ratio } " and " { $link complex } " types."
@ -45,7 +62,7 @@ $nl
"On by default. Often the programmer will use rationals without realizing it. A small amount of space can be saved by stripping these features out, but some code may require changes to work properly." } ;
HELP: deploy-compiler?
{ $description "Deploy flag. If set, words in the deployed image will be compiled when possible."
{ $description "Deploy flag. If set, words in the deployed image will be compiled with the optimizing compiler when possible."
$nl
"On by default. Most programs should be compiled, not only for performance but because features which depend on the C library interface only function after compilation." } ;
@ -55,10 +72,27 @@ $nl
"Off by default. Programs wishing to use the UI must be deployed with this flag on." } ;
HELP: deploy-io
{ $description "The level of I/O support required by the deployed image." } ;
{ $description "The level of I/O support required by the deployed image:"
{ $table
{ "Value" "Description" }
{ "1" "No input/output" }
{ "2" "Basic ANSI C streams" }
{ "3" "Non-blocking streams and networking" }
}
"The default value is 1, basic ANSI C streams. This enables basic console and file I/O, however more advanced features such are not available." } ;
HELP: deploy-reflection
{ $description "The level of reflection support required by the deployed image." } ;
{ $description "The level of reflection support required by the deployed image."
{ $table
{ "Value" "Description" }
{ "1" "No reflection" }
{ "2" "Retain word names" }
{ "3" "Prettyprinter" }
{ "4" "Debugger" }
{ "5" "Parser" }
{ "6" "Full environment" }
}
"The defalut value is 1, no reflection. Programs which use the above features will need to be deployed with a higher level of reflection support." } ;
HELP: default-config
{ $values { "assoc" assoc } }

View File

@ -40,6 +40,7 @@ SYMBOL: deploy-reflection
: strip-globals? deploy-reflection get 6 < ;
SYMBOL: deploy-word-props?
SYMBOL: deploy-word-defs?
SYMBOL: deploy-c-types?
SYMBOL: deploy-vm
@ -53,6 +54,7 @@ SYMBOL: deploy-image
{ deploy-compiler? t }
{ deploy-math? t }
{ deploy-word-props? f }
{ deploy-word-defs? f }
{ deploy-c-types? f }
! default value for deploy.app
{ "stop-after-last-window?" t }

View File

@ -16,6 +16,7 @@ IN: tools.deploy.shaker
: strip-init-hooks ( -- )
"Stripping startup hooks" show
"command-line" init-hooks get delete-at
"mallocs" init-hooks get delete-at
strip-io? [ "io.backend" init-hooks get delete-at ] when ;
: strip-debugger ( -- )
@ -75,9 +76,10 @@ IN: tools.deploy.shaker
: strip-words ( props -- )
[ word? ] instances
deploy-word-props? get [ nip ] [ tuck strip-word-props ] if
deploy-word-props? get [ 2dup strip-word-props ] unless
deploy-word-defs? get [ dup strip-word-defs ] unless
strip-word-names? [ dup strip-word-names ] when
strip-word-defs ;
2drop ;
: strip-environment ( retain-globals -- )
strip-globals? [

View File

@ -6,3 +6,5 @@ IN: libc
: free (free) ;
: realloc (realloc) ;
: calloc (calloc) ;

View File

@ -1,7 +1,8 @@
! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: ui.backend ui.gadgets ui.gadgets.theme ui.gadgets.worlds
ui.render opengl opengl.gl kernel namespaces tuples colors ;
USING: ui.backend ui.gadgets ui.gadgets.theme ui.gadgets.lib
ui.gadgets.worlds ui.render opengl opengl.gl kernel namespaces
tuples colors ;
IN: ui.gadgets.canvas
TUPLE: canvas dlist ;
@ -10,9 +11,6 @@ TUPLE: canvas dlist ;
canvas construct-gadget
dup black solid-interior ;
: find-gl-context ( gadget -- )
find-world world-handle select-gl-context ;
: delete-canvas-dlist ( canvas -- )
dup find-gl-context
dup canvas-dlist [ delete-dlist ] when*

View File

@ -35,6 +35,7 @@ TUPLE: deploy-gadget vocab settings ;
deploy-compiler? get "Use optimizing compiler" <checkbox> gadget,
deploy-math? get "Rational and complex number support" <checkbox> gadget,
deploy-word-props? get "Include word properties" <checkbox> gadget,
deploy-word-defs? get "Include word definitions" <checkbox> gadget,
deploy-c-types? get "Include C types" <checkbox> gadget, ;
: deploy-settings-theme