]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorJoe Groff <arcata@gmail.com>
Tue, 16 Feb 2010 18:41:15 +0000 (10:41 -0800)
committerJoe Groff <arcata@gmail.com>
Tue, 16 Feb 2010 18:41:15 +0000 (10:41 -0800)
38 files changed:
Factor.app/Contents/Info.plist
GNUmakefile
basis/cocoa/tags.txt
basis/compiler/tree/escape-analysis/escape-analysis-tests.factor
basis/compiler/tree/escape-analysis/simple/simple.factor
basis/images/tags.txt
basis/inverse/inverse.factor
basis/math/points/points.factor [deleted file]
basis/math/vectors/simd/simd-docs.factor
basis/stack-checker/errors/errors-docs.factor
basis/tools/annotations/annotations.factor
basis/tools/deploy/deploy-docs.factor [changed mode: 0644->0755]
basis/tools/deploy/deploy-tests.factor
basis/tools/deploy/windows/ico/ico.factor [new file with mode: 0755]
basis/tools/deploy/windows/ico/tags.txt [new file with mode: 0644]
basis/tools/deploy/windows/windows.factor [changed mode: 0644->0755]
basis/vocabs/metadata/resources/resources-docs.factor
basis/windows/com/tags.txt
core/alien/tags.txt
core/assocs/assocs-docs.factor
core/combinators/combinators-docs.factor
core/sequences/sequences-docs.factor
core/sets/sets-docs.factor
core/vocabs/loader/loader-docs.factor [changed mode: 0644->0755]
extra/annotations/tags.txt
extra/benchmark/raytracer-simd/raytracer-simd.factor
extra/gpu/demos/bunny/tags.txt [new file with mode: 0644]
extra/gpu/demos/raytrace/icon.icns [new file with mode: 0644]
extra/gpu/demos/raytrace/icon.ico [new file with mode: 0644]
extra/gpu/demos/raytrace/tags.txt [new file with mode: 0644]
extra/math/points/points.factor [new file with mode: 0644]
extra/svg/tags.txt
extra/terrain/tags.txt [new file with mode: 0644]
extra/trees/splay/tags.txt
extra/trees/tags.txt
extra/tty-server/tags.txt
extra/webapps/fjsc/tags.txt
extra/websites/concatenative/concatenative.factor

index c87520d0fdf3ab76cbba2a98ed82c6902f08a4b2..1c07f95643962ceddad10d5515829684fa563c22 100644 (file)
        <string>Factor</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
+       <key>CFBundleVersion</key>
+       <string>0.93</string>
        <key>NSHumanReadableCopyright</key>
-       <string>Copyright © 2003-2009, Slava Pestov and friends</string>
+       <string>Copyright © 2003-2010 Factor developers</string>
        <key>NSServices</key>
        <array>
                <dict>
index c4796de63be6205e18b997a23b9c8d40060dfecf..eac1c696df5b5ecab92c5eb709d48b2c60f79bb7 100755 (executable)
@@ -4,7 +4,7 @@ ifdef CONFIG
        AR = ar
        LD = ld
 
-       VERSION = 0.92
+       VERSION = 0.93
 
        BUNDLE = Factor.app
        LIBPATH = -L/usr/X11R6/lib
index 2320bdd64800598d4f0633f3441065dc20e4018f..86dd9eeb911c05e4fb9ec4df73340bba66a0c33b 100644 (file)
@@ -1,2 +1,3 @@
 unportable
 bindings
+ffi
index 6c50347c3a82114d7ae61e227c6b57398fa57b4c..ca2f5ed19741ae10e08df6e9b105404a0980bfa9 100644 (file)
@@ -329,3 +329,18 @@ TUPLE: empty-tuple ;
     [ { vector } declare length>> ]
     count-unboxed-allocations
 ] unit-test
+
+! Bug found while tweaking benchmark.raytracer-simd
+
+TUPLE: point-2d { x read-only } { y read-only } ;
+TUPLE: point-3d < point-2d { z read-only } ;
+
+[ 0 ] [
+    [ { point-2d } declare dup point-3d? [ z>> ] [ x>> ] if ]
+    count-unboxed-allocations
+] unit-test
+
+[ 0 ] [
+    [ point-2d boa dup point-3d? [ z>> ] [ x>> ] if ]
+    count-unboxed-allocations
+] unit-test
index 5be206f2f8211f8557bdc5f5cf481775665a28a8..9634bdf2594431058ce5245a3c185813f45a8e28 100644 (file)
@@ -61,22 +61,28 @@ M: #push escape-analysis*
 
 : record-tuple-allocation ( #call -- )
     dup immutable-tuple-boa?
-    [ [ in-d>> but-last ] [ out-d>> first ] bi record-allocation ]
+    [ [ in-d>> but-last { } like ] [ out-d>> first ] bi record-allocation ]
     [ record-unknown-allocation ]
     if ;
 
 : slot-offset ( #call -- n/f )
-    dup in-d>>
-    [ second node-value-info literal>> ]
-    [ first node-value-info class>> ] 2bi
-    2dup [ fixnum? ] [ tuple class<= ] bi* and [
-        over 2 >= [ drop 2 - ] [ 2drop f ] if
+    dup in-d>> second node-value-info literal>> dup [ 2 - ] when ;
+
+: valid-slot-offset? ( slot# in -- ? )
+    over [
+        allocation dup [
+            dup array? [ bounds-check? ] [ 2drop f ] if
+        ] [ 2drop t ] if
     ] [ 2drop f ] if ;
 
+: unknown-slot-call ( out slot# in -- )
+    [ unknown-allocation ] [ drop ] [ add-escaping-value ] tri* ;
+
 : record-slot-call ( #call -- )
-    [ out-d>> first ] [ slot-offset ] [ in-d>> first ] tri over
+    [ out-d>> first ] [ slot-offset ] [ in-d>> first ] tri
+    2dup valid-slot-offset?
     [ [ record-slot-access ] [ copy-slot-value ] 3bi ]
-    [ [ unknown-allocation ] [ drop ] [ add-escaping-value ] tri* ]
+    [ unknown-slot-call ]
     if ;
 
 M: #call escape-analysis*
index 04b54a06f4a2b08e72a46e419c8855c6be492725..9347bd326b9ab51cf7c8d7217d3411c2a8613f12 100644 (file)
@@ -1 +1 @@
-bitmap graphics
+graphics
index d112e4e6ebd6e3b31374b0233c4ddfd3a4fa0fcd..3485b3efa709c75927485470ce37f66842fb6f0c 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2007, 2009 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel locals words summary slots quotations
-sequences assocs math arrays stack-checker effects
-continuations debugger classes.tuple namespaces make vectors
-bit-arrays byte-arrays strings sbufs math.functions macros
-sequences.private combinators mirrors splitting combinators.smart
+sequences assocs math arrays stack-checker effects continuations
+classes.tuple namespaces make vectors bit-arrays byte-arrays
+strings sbufs math.functions macros sequences.private
+combinators mirrors splitting combinators.smart
 combinators.short-circuit fry words.symbol generalizations
 classes ;
 IN: inverse
diff --git a/basis/math/points/points.factor b/basis/math/points/points.factor
deleted file mode 100644 (file)
index 107e81d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-USING: kernel arrays math.vectors sequences math ;
-
-IN: math.points
-
-<PRIVATE
-
-: X ( x -- point )      0   0 3array ;
-: Y ( y -- point ) 0 swap   0 3array ;
-: Z ( z -- point ) 0    0 rot 3array ;
-
-PRIVATE>
-
-: v+x ( seq x -- seq ) X v+ ;
-: v-x ( seq x -- seq ) X v- ;
-
-: v+y ( seq y -- seq ) Y v+ ;
-: v-y ( seq y -- seq ) Y v- ;
-
-: v+z ( seq z -- seq ) Z v+ ;
-: v-z ( seq z -- seq ) Z v- ;
-
-: rise ( pt2 pt1 -- n ) [ second ] bi@ - ;
-: run ( pt2 pt1 -- n ) [ first ] bi@ - ;
-: slope ( pt pt -- slope ) [ rise ] [ run ] 2bi / ;
-: midpoint ( point point -- point ) v+ 2 v/n ;
-: linear-solution ( pt pt -- x ) [ drop first2 ] [ slope ] 2bi / - ;
\ No newline at end of file
index 540838bdd5b1705b8970a64a4f84c1ad1b4cf731..bcc05564fc2745df386602df82ad7e0a09ee93e5 100644 (file)
@@ -8,7 +8,7 @@ ARTICLE: "math.vectors.simd.intro" "Introduction to SIMD support"
 $nl
 "SIMD support in the processor takes the form of instruction sets which operate on vector registers. By operating on multiple scalar values at the same time, code which operates on points, colors, and other vector data can be sped up."
 $nl
-"In Factor, SIMD support is exposed in the form of special-purpose SIMD " { $link "sequence-protocol" } " implementations. These are fixed-length, homogeneous sequences. They are referred to as vectors, but should not be confused with Factor's " { $link "vectors" } ", which can hold any type of object and can be resized.)."
+"In Factor, SIMD support is exposed in the form of special-purpose SIMD " { $link "sequence-protocol" } " implementations. These are fixed-length, homogeneous sequences. They are referred to as vectors, but should not be confused with Factor's " { $link "vectors" } ", which can hold any type of object and can be resized."
 $nl
 "The words in the " { $vocab-link "math.vectors" } " vocabulary, which can be used with any sequence of numbers, are special-cased by the compiler. If the compiler can prove that only SIMD vectors are used, it expands " { $link "math-vectors" } " into " { $link "math.vectors.simd.intrinsics" } ". While in the general case, SIMD intrinsics operate on heap-allocated SIMD vectors, that too can be optimized since in many cases the compiler unbox SIMD vectors, storing them directly in registers."
 $nl
@@ -36,7 +36,7 @@ $nl
 ARTICLE: "math.vectors.simd.types" "SIMD vector types"
 "Each SIMD vector type is named " { $snippet "scalar-count" } ", where " { $snippet "scalar" } " is a scalar C type and " { $snippet "count" } " is a vector dimension."
 $nl
-"The following vector types are available:"
+"The following 128-bit vector types are defined in the " { $vocab-link "math.vectors.simd" } " vocabulary:"
 { $code
     "char-16"
     "uchar-16"
@@ -48,6 +48,19 @@ $nl
     "ulonglong-2"
     "float-4"
     "double-2"
+}
+"Double-width 256-bit vector types are defined in the " { $vocab-link "math.vectors.simd.cords" } " vocabulary:"
+{ $code
+    "char-32"
+    "uchar-32"
+    "short-16"
+    "ushort-16"
+    "int-8"
+    "uint-8"
+    "longlong-4"
+    "ulonglong-4"
+    "float-8"
+    "double-4"
 } ;
 
 ARTICLE: "math.vectors.simd.words" "SIMD vector words"
@@ -142,7 +155,12 @@ M\\ actor advance optimized."""
 """USE: compiler.tree.debugger
 
 M\\ actor advance test-mr mr.""" }
-"An example of a high-performance algorithm that uses SIMD primitives can be found in the " { $vocab-link "benchmark.nbody-simd" } " vocabulary." ;
+"Example of a high-performance algorithms that use SIMD primitives can be found in the following vocabularies:"
+{ $list
+    { $vocab-link "benchmark.nbody-simd" }
+    { $vocab-link "benchmark.raytracer-simd" }
+    { $vocab-link "random.sfmt" }
+} ;
 
 ARTICLE: "math.vectors.simd.intrinsics" "Low-level SIMD primitives"
 "The words in the " { $vocab-link "math.vectors.simd.intrinsics" } " vocabulary are used to implement SIMD support. These words have three disadvantages compared to the higher-level " { $link "math-vectors" } " words:"
index 4b432e733f38cf5083c566c5938b33405b871040..9aa7ed0d14538fa2a9b440ab06a0c92186358b66 100644 (file)
@@ -134,10 +134,10 @@ HELP: inconsistent-recursive-call-error
 } ;
 
 ARTICLE: "inference-errors" "Stack checker errors"
-"These " { $link "inference" } " failure conditions are reported in one of two ways:"
+"Stack effect checking failure conditions are reported in one of two ways:"
 { $list
-    { { $link "tools.inference" } " throws them as errors" }
-    { "The " { $link "compiler" } " reports them via " { $link "tools.errors" } }
+    { { $link "tools.inference" } " report them when fed quotations interactively" }
+    { "The " { $link "compiler" } " reports them while compiling words, via the " { $link "tools.errors" } " mechanism" }
 }
 "Errors thrown when insufficient information is available to calculate the stack effect of a call to a combinator or macro (see " { $link "inference-combinators" } "):"
 { $subsections
index 5d4a9226ceb5b348eb4a6865c948cd853de4c6a5..c9dfc4a5625163b6586c5c45239e2eb89312f6ea 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2005, 2009 Slava Pestov.
+! Copyright (C) 2005, 2010 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors kernel math sorting words parser io summary
 quotations sequences prettyprint continuations effects
@@ -108,5 +108,5 @@ PRIVATE>
 
 : word-timing. ( -- )
     word-timing get
-    >alist [ 1000000 /f ] assoc-map sort-values
+    >alist [ 1,000,000,000 /f ] assoc-map sort-values
     simple-table. ;
old mode 100644 (file)
new mode 100755 (executable)
index 2cbb286..a552bd0
@@ -11,7 +11,9 @@ ARTICLE: "prepare-deploy" "Preparing to deploy an application"
 } ;
 
 ARTICLE: "deploy-resources" "Deployed resource files"
-"To include additional files in your deployed application, specify their names in a vocabulary's " { $snippet "resources.txt" } " file. The " { $snippet "resources.txt" } " file contains one glob pattern per line. These patterns are expanded relative to the vocabulary directory; files outside of the vocabulary directory cannot be referenced. If a file inside the vocabulary directory matches any of these patterns, it will be included in deployed applications that reference the vocabulary. If a subdirectory matches, its contents will be included recursively." ;
+"To include additional files in your deployed application, specify their names in a vocabulary's " { $snippet "resources.txt" } " file. The " { $snippet "resources.txt" } " file contains one glob pattern per line. These patterns are expanded relative to the vocabulary directory; files outside of the vocabulary directory cannot be referenced. If a file inside the vocabulary directory matches any of these patterns, it will be included in deployed applications that reference the vocabulary. If a subdirectory matches, its contents will be included recursively."
+$nl
+"If the deployed vocabulary includes an icon file for the current platform (" { $snippet "icon.ico" } " on Windows, or " { $snippet "icon.icns" } " on MacOS X), it will be embedded in the deployed application as its GUI icon." ;
 
 ARTICLE: "tools.deploy.usage" "Deploy tool usage"
 "Once the necessary deployment flags have been set, the application can be deployed:"
index 987b4aa8a1bcdc05b198070ad5cbf2f6cdc072a5..8e25afdcfebaaf7373eb6c22bd7d75c8140a6dba 100644 (file)
@@ -24,8 +24,12 @@ IN: tools.deploy.tests
 \r
 [ ] [ "terrain" shake-and-bake 1700000 small-enough? ] unit-test\r
 \r
+[ ] [ "gpu.demos.raytrace" shake-and-bake 2500000 small-enough? ] unit-test\r
+\r
 [ ] [ "bunny" shake-and-bake 2500000 small-enough? ] unit-test\r
 \r
+[ ] [ "gpu.demos.bunny" shake-and-bake 3500000 small-enough? ] unit-test\r
+\r
 os macosx? [\r
     [ ] [ "webkit-demo" shake-and-bake 500000 small-enough? ] unit-test\r
 ] when\r
diff --git a/basis/tools/deploy/windows/ico/ico.factor b/basis/tools/deploy/windows/ico/ico.factor
new file mode 100755 (executable)
index 0000000..8ea7af3
--- /dev/null
@@ -0,0 +1,72 @@
+USING: accessors alien alien.c-types arrays classes.struct combinators\r
+io.backend kernel locals math sequences specialized-arrays\r
+tools.deploy.windows windows.kernel32 windows.types ;\r
+IN: tools.deploy.windows.ico\r
+\r
+<PRIVATE\r
+\r
+STRUCT: ico-header\r
+    { Reserved WORD }\r
+    { Type WORD }\r
+    { ImageCount WORD } ;\r
+\r
+STRUCT: ico-directory-entry\r
+    { Width        BYTE  }\r
+    { Height       BYTE  }\r
+    { Colors       BYTE  }\r
+    { Reserved     BYTE  }\r
+    { Planes       WORD  }\r
+    { BitsPerPixel WORD  }\r
+    { ImageSize    DWORD }\r
+    { ImageOffset  DWORD } ;\r
+SPECIALIZED-ARRAY: ico-directory-entry\r
+\r
+STRUCT: group-directory-entry\r
+    { Width        BYTE  }\r
+    { Height       BYTE  }\r
+    { Colors       BYTE  }\r
+    { Reserved     BYTE  }\r
+    { Planes       WORD  }\r
+    { BitsPerPixel WORD  }\r
+    { ImageSize    DWORD }\r
+    { ImageResourceID WORD } ;\r
+\r
+: ico>group-directory-entry ( ico i -- group )\r
+    [ {\r
+        [ Width>> ] [ Height>> ] [ Colors>> ] [ Reserved>> ]\r
+        [ Planes>> ] [ BitsPerPixel>> ] [ ImageSize>> ]\r
+    } cleave ] [ 1 + ] bi* group-directory-entry <struct-boa> >c-ptr ; inline\r
+\r
+: ico-icon ( directory-entry bytes -- subbytes )\r
+    [ [ ImageOffset>> dup ] [ ImageSize>> + ] bi ] dip subseq ; inline\r
+\r
+:: ico-group-and-icons ( bytes -- group-bytes icon-bytes )\r
+    bytes ico-header memory>struct :> header\r
+\r
+    ico-header heap-size bytes <displaced-alien> \r
+    header ImageCount>> <direct-ico-directory-entry-array> :> directory\r
+\r
+    directory dup length iota [ ico>group-directory-entry ] { } 2map-as\r
+        :> group-directory\r
+    directory [ bytes ico-icon ] { } map-as :> icon-bytes\r
+\r
+    header clone >c-ptr group-directory concat append\r
+    icon-bytes ; inline\r
+\r
+PRIVATE>\r
+\r
+:: embed-icon-resource ( exe ico-bytes id -- )\r
+    exe normalize-path 1 BeginUpdateResource :> hUpdate\r
+    hUpdate [\r
+        ico-bytes ico-group-and-icons :> ( group icons )\r
+        hUpdate RT_GROUP_ICON id 0 group dup byte-length\r
+        UpdateResource drop\r
+\r
+        icons [| icon i |\r
+            hUpdate RT_ICON i 1 + MAKEINTRESOURCE 0 icon dup byte-length\r
+            UpdateResource drop\r
+        ] each-index\r
+\r
+        hUpdate 0 EndUpdateResource drop\r
+    ] when ;\r
+\r
diff --git a/basis/tools/deploy/windows/ico/tags.txt b/basis/tools/deploy/windows/ico/tags.txt
new file mode 100644 (file)
index 0000000..6bf6830
--- /dev/null
@@ -0,0 +1 @@
+unportable
old mode 100644 (file)
new mode 100755 (executable)
index 9df13a9..9f0b228
@@ -5,7 +5,7 @@ io.encodings.ascii kernel namespaces
 sequences locals system splitting tools.deploy.backend
 tools.deploy.config tools.deploy.config.editor assocs hashtables
 prettyprint combinators windows.kernel32 windows.shell32 windows.user32
-alien.c-types vocabs.metadata vocabs.loader ;
+alien.c-types vocabs.metadata vocabs.loader tools.deploy.windows.ico ;
 IN: tools.deploy.windows
 
 CONSTANT: app-icon-resource-id "APPICON"
@@ -22,17 +22,9 @@ CONSTANT: app-icon-resource-id "APPICON"
     dup copy-dll
     deploy-ui? get ".exe" ".com" ? copy-vm ;
 
-:: (embed-ico) ( vm ico-bytes -- )
-    vm 0 BeginUpdateResource :> hUpdate
-    hUpdate [
-        hUpdate RT_ICON app-icon-resource-id 0 ico-bytes dup byte-length
-        UpdateResource drop
-        hUpdate 0 EndUpdateResource drop
-    ] when ;
-
 : embed-ico ( vm vocab -- )
     dup vocab-windows-icon-path vocab-append-path dup exists?
-    [ binary file-contents (embed-ico) ]
+    [ binary file-contents app-icon-resource-id embed-icon-resource ]
     [ 2drop ] if ;
 
 M: winnt deploy*
index b4289ff388589c869df1762836f5e20deca9be3d..a20775e9370cf037d798feb34977dd70d28a7a29 100644 (file)
@@ -16,7 +16,7 @@ HELP: vocab-resource-files
 }
 { $description "Outputs a sequence containing the individual resource files and directories that match the patterns specified in " { $snippet "vocab" } "'s " { $snippet "resources.txt" } " file. Any matching directories will also have their contents recursively included in the output. The paths in the output will be relative to " { $snippet "vocab" } "'s directory." } ;
 
-ARTICLE: "vocabs.metadata.resources" "vocabs.metadata.resources"
+ARTICLE: "vocabs.metadata.resources" "Vocabulary resource metadata"
 "The " { $vocab-link "vocabs.metadata.resources" } " vocabulary contains words to retrieve the full list of files that match the patterns specified in a vocabulary's " { $snippet "resources.txt" } " file."
 { $subsections
     vocab-resource-files
index 2320bdd64800598d4f0633f3441065dc20e4018f..86dd9eeb911c05e4fb9ec4df73340bba66a0c33b 100755 (executable)
@@ -1,2 +1,3 @@
 unportable
 bindings
+ffi
index 86a7c8e637fced6690f944c4b275c3f714e48ee3..7ea420feed71f90939ba08f699c07dcaa3b3d6a5 100644 (file)
@@ -1 +1,2 @@
 compiler
+ffi
index ecbc2e6bc7e942812b7e21be51797bab7a537242..0d5a884832ce003eafa0d8e13ab79999a9b236d9 100644 (file)
@@ -1,7 +1,8 @@
 ! Copyright (C) 2007, 2009 Daniel Ehrenberg, Slava Pestov, and Doug Coleman
 ! See http://factorcode.org/license.txt for BSD license.
 USING: help.markup help.syntax kernel sequences
-sequences.private namespaces math quotations assocs.private ;
+sequences.private namespaces math quotations assocs.private
+sets ;
 IN: assocs
 
 ARTICLE: "alists" "Association lists"
@@ -90,6 +91,8 @@ ARTICLE: "assocs-values" "Transposed assoc operations"
 
 ARTICLE: "assocs-sets" "Set-theoretic operations on assocs"
 "It is often useful to use the keys of an associative mapping as a set, exploiting the constant or logarithmic lookup time of most implementations (" { $link "alists" } " being a notable exception)."
+$nl
+"Set-theoretic operations:"
 { $subsections
     assoc-subset?
     assoc-intersect
@@ -98,6 +101,11 @@ ARTICLE: "assocs-sets" "Set-theoretic operations on assocs"
     substitute
     extract-keys
 }
+"Adding elements to sets:"
+{ $subsections
+    conjoin
+    conjoin-at
+}
 "Destructive operations:"
 { $subsections
     assoc-union!
index 02114496f45303182d4852bdc7a31ac2d502191a..31183a629e2f2540ef455257f2664064c2bc089a 100644 (file)
@@ -176,15 +176,15 @@ ARTICLE: "conditionals" "Conditional combinators"
 { $subsections "conditionals-boolean-equivalence" }
 { $see-also "booleans" "bitwise-arithmetic" both? either? } ;
 
-ARTICLE: "dataflow-combinators" "Data flow combinators"
-"Data flow combinators express common dataflow patterns such as performing a operation while preserving its inputs, applying multiple operations to a single value, applying a set of operations to a set of values, or applying a single operation to multiple values."
+ARTICLE: "dataflow-combinators" "Dataflow combinators"
+"Dataflow combinators express common dataflow patterns such as performing a operation while preserving its inputs, applying multiple operations to a single value, applying a set of operations to a set of values, or applying a single operation to multiple values."
 { $subsections
     "dip-keep-combinators"
     "cleave-combinators"
     "spread-combinators"
     "apply-combinators"
 }
-"More intricate data flow can be constructed by composing " { $link "curried-dataflow" } "." ;
+"More intricate dataflow can be constructed by composing " { $link "curried-dataflow" } "." ;
 
 ARTICLE: "combinators-quot" "Quotation construction utilities"
 "Some words for creating quotations which can be useful for implementing method combinations and compiler transforms:"
index 819b5b2115057c4c9a2302b1c82d42fe5e02ca38..02dadb323cea8f1239c4aad05f09973235b2a1f0 100644 (file)
@@ -1416,9 +1416,7 @@ $nl
 ARTICLE: "sequences-integers" "Counted loops"
 "A virtual sequence is defined for iterating over integers from zero."
 { $subsection iota }
-"For example, calling " { $link iota } " on the integer 3 produces a sequence containing the elements 0, 1, and 2. This is very useful for performing counted loops."
-$nl
-"This means the " { $link each } " combinator, given an integer, simply calls a quotation that number of times, pushing a counter on each iteration that ranges from 0 up to that integer:"
+"For example, calling " { $link iota } " on the integer 3 produces a sequence containing the elements 0, 1, and 2. This is very useful for performing counted loops using words such as " { $link each } ":"
 { $example "3 iota [ . ] each" "0\n1\n2" }
 "A common idiom is to iterate over a sequence, while also maintaining a loop counter. This can be done using " { $link each-index } ", " { $link map-index } " and " { $link reduce-index } "."
 $nl
index 999e963f36d9fdb2eacf40ca4682f13c56066f25..d9b1271152b201c4b93938cd4cb26203fe0761e0 100644 (file)
@@ -29,8 +29,6 @@ $nl
 "Adding elements to sets:"
 { $subsections
     adjoin
-    conjoin
-    conjoin-at
 }
 { $see-also member? member-eq? any? all? "assocs-sets" } ;
 
old mode 100644 (file)
new mode 100755 (executable)
index 7db3cdd..ce4a319
@@ -52,6 +52,8 @@ $nl
     { { $snippet "foo/bar/summary.txt" } " - a one-line description." }
     { { $snippet "foo/bar/tags.txt" } " - a whitespace-separated list of tags which classify the vocabulary. Consult " { $link "vocab-tags" } " for a list of existing tags you can reuse." }
 }
+"An icon file representing the vocabulary can also be provided. A file named " { $snippet "icon.ico" } " will be used as the application icon when the application is deployed on Windows. A file named " { $snippet "icon.icns" } " will be used when the application is deployed on MacOS X."
+$nl
 "The " { $link POSTPONE: USE: } " and " { $link POSTPONE: USING: } " words load vocabularies which have not been loaded yet, as needed."
 $nl
 "Vocabularies can also be loaded at run time, without altering the vocabulary search path. This is done by calling a word which loads a vocabulary if it is not in the image, doing nothing if it is:"
index 278296de5e5292f818ef8d10875b1ec07eaccce9..ef1aab0d0e80e39c69ee151fac63f9fc11f1f70d 100644 (file)
@@ -1,2 +1 @@
-comments
-annotation
+tools
index dcdc911cbf676b08389f56a2b546c0b7935a159b..e90708c62d734e95f81ae4cb21174f6cb20998ac 100644 (file)
@@ -1,13 +1,14 @@
 ! Factor port of the raytracer benchmark from
-! http://www.ffconsultancy.com/free/ray_tracer/languages.html
+! http://www.ffconsultancy.com/languages/ray_tracer/index.html
 
 USING: arrays accessors io io.files io.files.temp
 io.encodings.binary kernel math math.constants math.functions
-math.vectors math.vectors.simd math.vectors.simd.cords math.parser
-make sequences sequences.private words hints classes.struct ;
-QUALIFIED-WITH: alien.c-types c
+math.vectors math.vectors.simd math.vectors.simd.cords
+math.parser make sequences words combinators ;
 IN: benchmark.raytracer-simd
 
+<< SYNTAX: no-compile word t "no-compile" set-word-prop ; >>
+
 ! parameters
 
 ! Normalized { -1 -3 2 }.
@@ -25,7 +26,7 @@ CONSTANT: levels 3
 
 CONSTANT: size 200
 
-: delta ( -- n ) epsilon sqrt ; inline
+: delta ( -- n ) epsilon sqrt ; inline no-compile
 
 TUPLE: ray { orig double-4 read-only } { dir double-4 read-only } ;
 
@@ -35,80 +36,69 @@ TUPLE: hit { normal double-4 read-only } { lambda float read-only } ;
 
 C: <hit> hit
 
-GENERIC: intersect-scene ( hit ray scene -- hit )
-
 TUPLE: sphere { center double-4 read-only } { radius float read-only } ;
 
 C: <sphere> sphere
 
-: sphere-v ( sphere ray -- v )
-    [ center>> ] [ orig>> ] bi* v- ; inline
+: sphere-v ( sphere ray -- v ) [ center>> ] [ orig>> ] bi* v- ; inline no-compile
 
-: sphere-b ( v ray -- b )
-    dir>> v. ; inline
+: sphere-b ( v ray -- b ) dir>> v. ; inline no-compile
 
-: sphere-d ( sphere b v -- d )
-    [ radius>> sq ] [ sq ] [ norm-sq ] tri* - + ; inline
+: sphere-d ( sphere b v -- d ) [ radius>> sq ] [ sq ] [ norm-sq ] tri* - + ; inline no-compile
 
-: -+ ( x y -- x-y x+y )
-    [ - ] [ + ] 2bi ; inline
+: -+ ( x y -- x-y x+y ) [ - ] [ + ] 2bi ; inline no-compile
 
 : sphere-t ( b d -- t )
     -+ dup 0.0 <
-    [ 2drop 1/0. ] [ [ [ 0.0 > ] keep ] dip ? ] if ; inline
+    [ 2drop 1/0. ] [ [ [ 0.0 > ] keep ] dip ? ] if ; inline no-compile
 
 : sphere-b&v ( sphere ray -- b v )
     [ sphere-v ] [ nip ] 2bi
-    [ sphere-b ] [ drop ] 2bi ; inline
+    [ sphere-b ] [ drop ] 2bi ; inline no-compile
 
 : ray-sphere ( sphere ray -- t )
     [ drop ] [ sphere-b&v ] 2bi
     [ drop ] [ sphere-d ] 3bi
-    dup 0.0 < [ 3drop 1/0. ] [ sqrt sphere-t nip ] if ; inline
+    dup 0.0 < [ 3drop 1/0. ] [ sqrt sphere-t nip ] if ; inline no-compile
 
-: if-ray-sphere ( hit ray sphere quot -- hit )
-    #! quot: hit ray sphere l -- hit
+: if-ray-sphere ( hit ray sphere quot: ( hit ray sphere l -- hit ) -- hit )
     [
         [ ] [ swap ray-sphere nip ] [ 2drop lambda>> ] 3tri
         [ drop ] [ < ] 2bi
-    ] dip [ 3drop ] if ; inline
+    ] dip [ 3drop ] if ; inline no-compile
 
 : sphere-n ( ray sphere l -- n )
     [ [ orig>> ] [ dir>> ] bi ] [ center>> ] [ ] tri*
-    swap [ v*n ] dip v- v+ ; inline
-
-M: sphere intersect-scene ( hit ray sphere -- hit )
-    [ [ sphere-n normalize ] keep <hit> nip ] if-ray-sphere ;
-
-HINTS: M\ sphere intersect-scene { hit ray sphere } ;
+    swap [ v*n ] dip v- v+ ; inline no-compile
 
 TUPLE: group < sphere { objs array read-only } ;
 
 : <group> ( objs bound -- group )
-    [ center>> ] [ radius>> ] bi rot group boa ; inline
+    swap [ [ center>> ] [ radius>> ] bi ] dip group boa ; inline no-compile
 
 : make-group ( bound quot -- )
-    swap [ { } make ] dip <group> ; inline
+    swap [ { } make ] dip <group> ; inline no-compile
 
-M: group intersect-scene ( hit ray group -- hit )
-    [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ;
-
-HINTS: M\ group intersect-scene { hit ray group } ;
+: intersect-scene ( hit ray scene -- hit )
+    {
+        { [ dup group? ] [ [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ] }
+        { [ dup sphere? ] [ [ [ sphere-n normalize ] keep <hit> nip ] if-ray-sphere ] }
+    } cond ; inline recursive no-compile
 
 CONSTANT: initial-hit T{ hit f double-4{ 0.0 0.0 0.0 0.0 } 1/0. }
 
 : initial-intersect ( ray scene -- hit )
-    [ initial-hit ] 2dip intersect-scene ; inline
+    [ initial-hit ] 2dip intersect-scene ; inline no-compile
 
 : ray-o ( ray hit -- o )
     [ [ orig>> ] [ normal>> delta v*n ] bi* ]
     [ [ dir>> ] [ lambda>> ] bi* v*n ]
-    2bi v+ v+ ; inline
+    2bi v+ v+ ; inline no-compile
 
 : sray-intersect ( ray scene hit -- ray )
-    swap [ ray-o light vneg <ray> ] dip initial-intersect ; inline
+    swap [ ray-o light vneg <ray> ] dip initial-intersect ; inline no-compile
 
-: ray-g ( hit -- g ) normal>> light v. ; inline
+: ray-g ( hit -- g ) normal>> light v. ; inline no-compile
 
 : cast-ray ( ray scene -- g )
     2dup initial-intersect dup lambda>> 1/0. = [
@@ -116,66 +106,61 @@ CONSTANT: initial-hit T{ hit f double-4{ 0.0 0.0 0.0 0.0 } 1/0. }
     ] [
         [ sray-intersect lambda>> 1/0. = ] keep swap
         [ ray-g neg ] [ drop 0.0 ] if
-    ] if ; inline
+    ] if ; inline no-compile
 
 : create-center ( c r d -- c2 )
-    [ 3.0 12.0 sqrt / * ] dip n*v v+ ; inline
+    [ 3.0 12.0 sqrt / * ] dip n*v v+ ; inline no-compile
 
 DEFER: create ( level c r -- scene )
 
 : create-step ( level c r d -- scene )
     over [ create-center ] dip 2.0 / [ 1 - ] 2dip create ;
 
-: create-offsets ( quot -- )
+CONSTANT: create-offsets
     {
         double-4{ -1.0 1.0 -1.0 0.0 }
         double-4{ 1.0 1.0 -1.0 0.0 }
         double-4{ -1.0 1.0 1.0 0.0 }
         double-4{ 1.0 1.0 1.0 0.0 }
-    } swap each ; inline
+    }
 
 : create-bound ( c r -- sphere ) 3.0 * <sphere> ;
 
 : create-group ( level c r -- scene )
     2dup create-bound [
         2dup <sphere> ,
-        [ [ 3dup ] dip create-step , ] create-offsets 3drop
+        create-offsets [ create-step , ] with with with each
     ] make-group ;
 
 : create ( level c r -- scene )
     pick 1 = [ <sphere> nip ] [ create-group ] if ;
 
 : ss-point ( dx dy -- point )
-    [ oversampling /f ] bi@ 0.0 0.0 double-4-boa ;
-
-: ss-grid ( -- ss-grid )
-    oversampling iota [ oversampling iota [ ss-point ] with map ] map ;
-
-: ray-grid ( point ss-grid -- ray-grid )
-    [
-        [ v+ normalize double-4{ 0.0 0.0 -4.0 0.0 } swap <ray> ] with map
-    ] with map ;
-
-: ray-pixel ( scene point -- n )
-    ss-grid ray-grid [ 0.0 ] 2dip
-    [ [ swap cast-ray + ] with each ] with each ;
-
-: pixel-grid ( -- grid )
-    size iota reverse [
+    [ oversampling /f ] bi@ 0.0 0.0 double-4-boa ; inline no-compile
+
+: ray-pixel ( scene point -- ray-grid )
+    [ 0.0 ] 2dip
+    oversampling iota [
+        oversampling iota [
+            ss-point v+ normalize
+            double-4{ 0.0 0.0 -4.0 0.0 } swap <ray>
+            swap cast-ray +
+        ] with with with each
+    ] with with each ; inline no-compile
+
+: ray-trace ( scene -- grid )
+    size iota <reversed> [
         size iota [
             [ size 0.5 * - ] bi@ swap size
-            0.0 double-4-boa
-        ] with map
-    ] map ;
+            0.0 double-4-boa ray-pixel
+        ] with with map
+    ] with map ;
 
 : pgm-header ( w h -- )
     "P5\n" % swap # " " % # "\n255\n" % ;
 
 : pgm-pixel ( n -- ) 255 * 0.5 + >fixnum , ;
 
-: ray-trace ( scene -- pixels )
-    pixel-grid [ [ ray-pixel ] with map ] with map ;
-
 : run ( -- string )
     levels double-4{ 0.0 -1.0 0.0 0.0 } 1.0 create ray-trace [
         size size pgm-header
diff --git a/extra/gpu/demos/bunny/tags.txt b/extra/gpu/demos/bunny/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
diff --git a/extra/gpu/demos/raytrace/icon.icns b/extra/gpu/demos/raytrace/icon.icns
new file mode 100644 (file)
index 0000000..3828803
Binary files /dev/null and b/extra/gpu/demos/raytrace/icon.icns differ
diff --git a/extra/gpu/demos/raytrace/icon.ico b/extra/gpu/demos/raytrace/icon.ico
new file mode 100644 (file)
index 0000000..806fe33
Binary files /dev/null and b/extra/gpu/demos/raytrace/icon.ico differ
diff --git a/extra/gpu/demos/raytrace/tags.txt b/extra/gpu/demos/raytrace/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
diff --git a/extra/math/points/points.factor b/extra/math/points/points.factor
new file mode 100644 (file)
index 0000000..107e81d
--- /dev/null
@@ -0,0 +1,26 @@
+USING: kernel arrays math.vectors sequences math ;
+
+IN: math.points
+
+<PRIVATE
+
+: X ( x -- point )      0   0 3array ;
+: Y ( y -- point ) 0 swap   0 3array ;
+: Z ( z -- point ) 0    0 rot 3array ;
+
+PRIVATE>
+
+: v+x ( seq x -- seq ) X v+ ;
+: v-x ( seq x -- seq ) X v- ;
+
+: v+y ( seq y -- seq ) Y v+ ;
+: v-y ( seq y -- seq ) Y v- ;
+
+: v+z ( seq z -- seq ) Z v+ ;
+: v-z ( seq z -- seq ) Z v- ;
+
+: rise ( pt2 pt1 -- n ) [ second ] bi@ - ;
+: run ( pt2 pt1 -- n ) [ first ] bi@ - ;
+: slope ( pt pt -- slope ) [ rise ] [ run ] 2bi / ;
+: midpoint ( point point -- point ) v+ 2 v/n ;
+: linear-solution ( pt pt -- x ) [ drop first2 ] [ slope ] 2bi / - ;
\ No newline at end of file
index 0cf061a2520ae13ffb4950a1bfbedc2eee8bb0bd..65e8f3eddbe7ed0e2caf2bdf5f81d89ff31b783f 100644 (file)
@@ -1,3 +1,2 @@
 xml
 graphics
-svg
diff --git a/extra/terrain/tags.txt b/extra/terrain/tags.txt
new file mode 100644 (file)
index 0000000..cb5fc20
--- /dev/null
@@ -0,0 +1 @@
+demos
index fb6cea7147a1e0cc87d314c576362caa3b76dbdc..42d711b32ba66957d114e76b2aedcc5a59c9c58a 100644 (file)
@@ -1,2 +1 @@
 collections
-trees
index fb6cea7147a1e0cc87d314c576362caa3b76dbdc..42d711b32ba66957d114e76b2aedcc5a59c9c58a 100644 (file)
@@ -1,2 +1 @@
 collections
-trees
index 587fb228f32e7bf4dab53905babfeeb79bd89d82..8dfb43b5786ab0a1ce52d0d84ce046990ee21fe4 100644 (file)
@@ -1,4 +1,4 @@
 tools
 applications
 demos
-networking
+network
index 1b93c9eb4dadb94c6c52fc88c7e22f5ed41ce8ad..14d6b62728d46b32878a2579320c8aca6747c5b9 100644 (file)
@@ -1 +1,2 @@
-webapp
+web
+examples
index fd4fb7515f306403b17ec700ba53045d0dd95da4..92a4942fe65563ff79476e20a288895dc71d353c 100644 (file)
@@ -98,7 +98,7 @@ SYMBOL: dh-file
         <login-config> <factor-boilerplate> test-db <alloy> "concatenative.org" add-responder
         <pastebin> <login-config> <factor-boilerplate> test-db <alloy> "paste.factorcode.org" add-responder
         <planet> <login-config> <factor-boilerplate> test-db <alloy> "planet.factorcode.org" add-responder
-        <mason-app> <login-config> "builds.factorcode.org" add-responder
+        <mason-app> <login-config> test-db <alloy> "builds.factorcode.org" add-responder
         home "docs" append-path <help-webapp> "docs.factorcode.org" add-responder
         home "cgi" append-path <gitweb> "gitweb.factorcode.org" add-responder
     main-responder set-global ;