Giter Site home page Giter Site logo

factor / factor Goto Github PK

View Code? Open in Web Editor NEW
1.6K 73.0 202.0 310.27 MB

Factor programming language

Home Page: https://factorcode.org/

License: BSD 2-Clause "Simplified" License

Emacs Lisp 1.09% Makefile 0.04% Factor 94.91% CSS 0.08% HTML 0.35% Shell 0.13% C++ 2.69% C 0.15% Cuda 0.02% Game Maker Language 0.07% GLSL 0.05% Smalltalk 0.01% JavaScript 0.30% Ruby 0.01% Lua 0.02% Assembly 0.03% Objective-C++ 0.02% Batchfile 0.02% Nix 0.01% VBScript 0.01%
programming-language factor stack concatenative language

factor's Introduction

Factor

Build

Factor is a concatenative, stack-based programming language with high-level features including dynamic types, extensible syntax, macros, and garbage collection. On a practical side, Factor has a full-featured library, supports many different platforms, and has been extensively documented.

The implementation is fully compiled for performance, while still supporting interactive development. Factor applications are portable between all common platforms. Factor can deploy stand-alone applications on all platforms. Full source code for the Factor project is available under a BSD license.

Getting Started

Building Factor from source

If you have a build environment set up, then you can build Factor from git. These scripts will attempt to compile the Factor binary and bootstrap from a boot image stored on factorcode.org.

To check out Factor:

To build the latest complete Factor system from git, either use the build script:

  • Unix: ./build.sh update
  • Windows: build.cmd
  • M1 macOS: arch -x86_64 ./build.sh update

or download the correct boot image for your system from https://downloads.factorcode.org/images/master/, put it in the factor directory and run:

  • Unix: make and then ./factor -i=boot.unix-x86.64.image
  • Windows: nmake /f Nmakefile x86-64 and then factor.com -i=boot.windows-x86.64.image

Now you should have a complete Factor system ready to run.

Factor does not yet work on arm64 cpus. There is an arm64 assembler in cpu.arm.64.assembler and we are working on a port and also looking for contributors.

More information on building factor and system requirements.

To run a Factor binary:

You can download a Factor binary from the grid on https://factorcode.org. The nightly builds are usually a better experience than the point releases.

  • Windows: Double-click factor.exe, or run .\factor.com in a command prompt
  • Mac OS X: Double-click Factor.app or run open Factor.app in a Terminal
  • Unix: Run ./factor in a shell

Learning Factor

A tutorial is available that can be accessed from the Factor environment:

"first-program" help

Take a look at a guided tour of Factor:

"tour" help

Some demos that are included in the distribution to show off various features:

"demos" run

Some other simple things you can try in the listener:

"Hello, world" print

{ 4 8 15 16 23 42 } [ 2 * ] map .

1000 [1..b] sum .

4 <iota> [
    "Happy Birthday " write
    2 = "dear NAME" "to You" ? print
] each

For more tips, see Learning Factor.

Documentation

The Factor environment includes extensive reference documentation and a short "cookbook" to help you get started. The best way to read the documentation is in the UI; press F1 in the UI listener to open the help browser tool. You can also browse the documentation online.

Command Line Usage

Factor supports a number of command line switches:

Usage: factor [Factor arguments] [script] [script arguments]

Common arguments:
    -help            print this message and exit
    -i=<image>       load Factor image file <image> (default factor.image)
    -run=<vocab>     run the MAIN: entry point of <vocab>
        -run=listener    run terminal listener
        -run=ui.tools    run Factor development UI
    -e=<code>        evaluate <code>
    -no-user-init    suppress loading of .factor-rc
    -roots=<paths>   a list of path-delimited extra vocab roots

Enter
    "command-line" help
from within Factor for more information.

You can also write scripts that can be run from the terminal, by putting #!/path/to/factor at the top of your scripts and making them executable.

Source Organization

The Factor source tree is organized as follows:

  • vm/ - Factor VM source code (not present in binary packages)
  • core/ - Factor core library
  • basis/ - Factor basis library, compiler, tools
  • extra/ - more libraries and applications
  • misc/ - editor modes, icons, etc
  • unmaintained/ - now at factor-unmaintained

Source History

During Factor's lifetime, source code has lived in many repositories. Unfortunately, the first import in Git did not keep history. History has been partially recreated from what could be salvaged. Due to the nature of Git, it's only possible to add history without disturbing upstream work, by using replace objects. These need to be manually fetched, or need to be explicitly added to your git remote configuration.

Use: git fetch origin 'refs/replace/*:refs/replace/*'

or add the following line to your configuration file

[remote "origin"]
    url = ...
    fetch = +refs/heads/*:refs/remotes/origin/*
    ...
    fetch = +refs/replace/*:refs/replace/*

Then subsequent fetches will automatically update any replace objects.

Community

Factor developers are quite active in the Factor Discord server. Drop by if you want to discuss anything related to Factor or language design in general.

Have fun!

factor's People

Contributors

alex-ilin avatar bjourne avatar blei avatar bpollack avatar capital-ex avatar catb0t avatar dharmatech avatar doublec avatar elasticdog avatar erg avatar erikcharlebois avatar ex-rzr avatar gifti258 avatar jamesnvc avatar jaor avatar jckarter avatar jedahu avatar jonenst avatar keyholder avatar klazuka avatar mrjbq7 avatar nicolas-p avatar nomennescio avatar phildawes avatar razetime avatar samueltardieu avatar slavapestov avatar timor avatar tizoc avatar x6j8x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

factor's Issues

Linux doesn't bootstrap -- GError defined twice

The vocab "gdk.pixbuf.ffi" has a load error -- GError is defined in both: glib.ffi and gobject.ffi

I'm having a hard time figuring out exactly where it's defined twice though.

A temporary fix is to just do:
FROM: gobject.ffi => GError ;

Windows bootstrap is broken -- IStream::Clone-callback-1

You can use the first restart and bootstrap completes with 6 errors. (The other 5 is another bug report...)

Asset: IStream::Clone-callback-1

Stack effect declaration is wrong
inferred (( x x -- x x ))
declared (( x x -- x ))

( scratchpad ) \ IStream::Clone-callback-1 see
USING: alien alien.c-types alien.syntax generalizations
windows.com windows.com.wrapper.private windows.streams.private
windows.types ;
IN: windows.com.wrapper.callbacks
: IStream::Clone-callback-1 ( -- alien )
\ HRESULT
{ pointer: void pointer: pointer: IStream } \ stdcall
[ [ com-unwrap ] 1 ndip IStream-clone ] alien-callback ;

gir files loading message is indented and lowercase

Loading resource:extra/classes/struct/vectored/vectored.factor
Loading resource:extra/classes/tuple/change-tracking/change-tracking.factor
Loading resource:extra/clutter/clutter.factor
Loading resource:extra/clutter/ffi/ffi.factor
Loading resource:extra/clutter/cogl/ffi/ffi.factor
loading resource:extra/clutter/cogl/Cogl-1.0.gir
Loading resource:extra/clutter/json/ffi/ffi.factor
loading resource:extra/clutter/json/Json-1.0.gir
loading resource:extra/clutter/Clutter-1.0.gir
Loading resource:extra/clutter/cally/cally.factor
Loading resource:extra/clutter/cally/ffi/ffi.factor
loading resource:extra/clutter/cally/Cally-1.0.gir
Loading resource:extra/clutter/cogl/cogl.factor
Loading resource:extra/clutter/gtk/gtk.factor
Loading resource:extra/clutter/gtk/ffi/ffi.factor
loading resource:extra/clutter/gtk/GtkClutter-1.0.gir
Loading resource:extra/clutter/json/json.factor
Loading resource:extra/codebook/codebook.factor
Loading resource:extra/io/encodings/detect/detect.factor
Loading resource:extra/color-picker/color-picker.factor
Loading resource:extra/color-table/color-table.factor

factorcode.org http server crashes once a week or so

Crashes with an out of memory error. Adding a timer to run compact-gc once a day solves the problem. So some sequence of minor-gc/full-gc doesn't properly reclaim memory, or leaves the heap in a fragmented state so that it keeps growing without defragmentation.

More things to test:

  • Add a full-gc timer, see if the problem goes away
  • Run http load tester against http server
  • Add verbose logging for GC events to see when/why the heap is growing

http.server doesn't benchmark well

I can't seem to get apachebench to work properly with the Factor http.server.

( scratchpad ) USE: webapps.benchmark
( scratchpad ) run-benchmark

Then, in a shell try one request (works):

$ ab -n 1 http://localhost:8080/hello

Then, try multiple requests (fails):

$ ab -n 50 http://localhost:8080/hello
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)...apr_socket_recv: Connection reset by peer (54)

INSTANCE: doesn't work correctly in all cases

Currently loaded code:

USING: bit-sets hash-sets sequences sets.tests ;
IN: sets
MIXIN: set
INSTANCE: sequence set
INSTANCE: hash-set set
INSTANCE: bit-set set
INSTANCE: null-set set

T{ null-set } set? .
f

Sure enough, the set? word doesn't have a case for the null-set class. The code in question is in a -tests file, if that matters.

TUPLE: null-set ;
INSTANCE: null-set set
M: null-set members drop f ;

Recompiling sets doesn't seem to fix it.

Wiki edit links should be "nofollow"

Should we mark edit links as "nofollow" in the wiki?

diff --git a/extra/webapps/wiki/page-common.xml b/extra/webapps/wiki/page-common.xml
index 0d02994..e23b4fb 100644
--- a/extra/webapps/wiki/page-common.xml
+++ b/extra/webapps/wiki/page-common.xml
@@ -11,7 +11,7 @@
        <div class="navbar">
                <t:a t:href="$wiki/view" t:rest="title">Latest</t:a>
                | <t:a t:href="$wiki/revisions" t:rest="title">Revisions</t:a>
-               | <t:a t:href="$wiki/edit" t:rest="title">Edit</t:a>
+               | <t:a t:href="$wiki/edit" t:rest="title" rel="nofollow=">Edit</t:a>
                | <t:button t:action="$wiki/delete" t:for="title" class="link-button link">Delete</t:button>
        </div>

Finish parallel-copy branch

This branch implements correct SSA destruction semantics. The construction of "conventional SSA" really needs to insert parallel copies instead of a sequence of serial copies. However this branch doesn't work yet.

[patch] Table gadget performance improvements?

This doesn't seem like a correct fix, but inspired by this commit (klazuka@a5d94bb), I tried it out:

diff --git a/basis/ui/gadgets/tables/tables.factor b/basis/ui/gadgets/tables/tables.factor
index 77b9ec9..abd6d0e 100644
--- a/basis/ui/gadgets/tables/tables.factor
+++ b/basis/ui/gadgets/tables/tables.factor
@@ -250,7 +250,7 @@ PRIVATE>
     if ;
·
 : hide-mouse-help ( table -- )
-    f >>mouse-index [ hide-status ] [ relayout-1 ] bi ;
+    f >>mouse-index hide-status ;
·
 : ((select-row)) ( n table -- )
     [ selection-index>> set-model ]
@@ -301,7 +301,7 @@ M: table model-changed
 : (select-row) ( table n -- )
     [ scroll-to-row ]
     [ swap ((select-row)) ]
-    [ drop relayout-1 ]
+    [ 2drop ]
     2tri ;
·
 : mouse-row ( table -- n )
@@ -369,7 +369,7 @@ PRIVATE>
 : show-mouse-help ( table -- )
     [
         swap
-        [ >>mouse-index relayout-1 ]
+        [ >>mouse-index drop ]
         [ show-row-summary ]
         2bi
     ] [ hide-mouse-help ] if-mouse-row ;
@@ -387,9 +387,9 @@ PRIVATE>
         show-operations-menu
     ] [ drop ] if-mouse-row ;
·
-: focus-table ( table -- ) t >>focused? relayout-1 ;
+: focus-table ( table -- ) t >>focused? drop ;
·
-: unfocus-table ( table -- ) f >>focused? relayout-1 ;
+: unfocus-table ( table -- ) f >>focused? drop ;
·
 table "sundry" f {
     { mouse-enter show-mouse-help }

GTK image loader broken -- gdk_pixbuf_get_pixels returns integer instead of pointer

In the file basis/gdk/pixbuf/GdkPixbuf-2.0.gir

The problem line:

The potential problems are:

  1. guint8 should be guint8*
  2. guchar* is ignored, and guchar is used instead

Either way, the return type of this is a uchar instead of a uchar*.

This file is auto-generated, so editing it is the wrong solution.

Where is it generated? How should we fix this properly?

Examine branches for good stuff

How many of these branches contain work that should be merged (possibly with some finishing touches)? If they are stale, we should probably delete them.

  remotes/factorcode/abi-symbols
  remotes/factorcode/alien-cleanup
  remotes/factorcode/bitfields
  remotes/factorcode/c-type-words
  remotes/factorcode/categories
  remotes/factorcode/checksums
  remotes/factorcode/compaction
  remotes/factorcode/constant-propagation
  remotes/factorcode/constraints
  remotes/factorcode/cuda-changes
  remotes/factorcode/db2
  remotes/factorcode/db3
  remotes/factorcode/dcn
  remotes/factorcode/deploy-resources
  remotes/factorcode/eintr
  remotes/factorcode/eliminating_register_variables
  remotes/factorcode/fastcall-madness
  remotes/factorcode/faster_overflow_checks
  remotes/factorcode/ffi-7
  remotes/factorcode/ffi-dcn
  remotes/factorcode/global_optimization
  remotes/factorcode/gtk
  remotes/factorcode/haiku
  remotes/factorcode/hook
  remotes/factorcode/inline_caching
  remotes/factorcode/integer-simd
  remotes/factorcode/io.process
  remotes/factorcode/iota
  remotes/factorcode/lexer-parsing-word-errors
  remotes/factorcode/loop_conversion
  remotes/factorcode/mason-fix
  remotes/factorcode/mason-improvements
  remotes/factorcode/master
  remotes/factorcode/monotonic
  remotes/factorcode/more-simd
  remotes/factorcode/more-ssa-properties
  remotes/factorcode/msvc
  remotes/factorcode/nanos
  remotes/factorcode/native-image-loader
  remotes/factorcode/new-deopt
  remotes/factorcode/new-icons
  remotes/factorcode/new-math-parser
  remotes/factorcode/new-mixin-algebra
  remotes/factorcode/new_gc
  remotes/factorcode/new_heaps
  remotes/factorcode/new_httpd
  remotes/factorcode/new_io_files
  remotes/factorcode/new_launcher
  remotes/factorcode/new_monitors
  remotes/factorcode/new_ui
  remotes/factorcode/new_walker
  remotes/factorcode/newfxlol
  remotes/factorcode/no-c-type-string
  remotes/factorcode/no-ce
  remotes/factorcode/no_literal_table
  remotes/factorcode/oauth
  remotes/factorcode/os-env
  remotes/factorcode/out-params
  remotes/factorcode/parallel-copy-2
  remotes/factorcode/parser
  remotes/factorcode/ppc-float-compare
  remotes/factorcode/ppc-float-env
  remotes/factorcode/record1_strings
  remotes/factorcode/regexp
  remotes/factorcode/row-polymorphism
  remotes/factorcode/scheduling
  remotes/factorcode/sigaltstack
  remotes/factorcode/signal_cleanup
  remotes/factorcode/simd
  remotes/factorcode/simd-cleanup
  remotes/factorcode/singleton-changes
  remotes/factorcode/slots
  remotes/factorcode/smalltalk
  remotes/factorcode/smart_recompile
  remotes/factorcode/smarter_error_list
  remotes/factorcode/startup
  remotes/factorcode/struct-classes
  remotes/factorcode/struct-updates
  remotes/factorcode/symbolic-enums
  remotes/factorcode/test-clean
  remotes/factorcode/textured-windows
  remotes/factorcode/threaded-server
  remotes/factorcode/threaded-server2
  remotes/factorcode/trace_tool
  remotes/factorcode/uniscribe
  remotes/factorcode/untagged-fixnums
  remotes/factorcode/vm-threads
  remotes/factorcode/win32-contexts
  remotes/factorcode/win32-fail
  remotes/factorcode/win64-seh
  remotes/factorcode/x11_event_loop

Problem with cocoa methods defined in Factor -- undefined errors

A similar issue was reported on the mailing list, it's probably the same bug.

( scratchpad ) "cocoa" test
Loading resource:basis/cocoa/cocoa-tests.factor
Loading resource:basis/compiler/test/test.factor
Unit Test: { [ ] [ test-foo ] }
Unit Test: { [ 1.0 ] [ "x" get CGRect-x ] }
Unit Test: { [ 2.0 ] [ "x" get CGRect-y ] }
Unit Test: { [ 101.0 ] [ "x" get CGRect-w ] }
Unit Test: { [ 102.0 ] [ "x" get CGRect-h ] }
Unit Test: {
[ ]
[
Bar [
"alloc" send "init" send dup "bar" send "x" set
"release" send
] compile-call
]
}
The die word was called by the library. Unless you called it yourself,
you have triggered a bug in Factor. Please report.
Starting low level debugger...
Basic commands:
q -- continue executing Factor - NOT SAFE
im -- save image to fep.image
x -- exit Factor
Advanced commands:
d -- dump memory
u -- dump object at tagged
. -- print object at tagged
t -- toggle output trimming
s r -- dump data, retain stacks
.s .r .c -- print data, retain, call stacks
e -- dump environment
g -- dump generations
data -- data heap dump
words -- words dump
tuples -- tuples dump
refs -- find data heap references to object
push -- push object on data stack - NOT SAFE
code -- code heap dump
READY
.s
==== DATA STACK:
T{ words:undefined cocoa.tests:test-foo }
READY

Compiler or gc bug while loading graphviz on 32bit

Happens on linux32 and mac32 (only?)

Build report for linux/x86.32

Build machine: sheeple-desktop
Disk usage: 14 / 55 Gb used (26%)
Build directory: /home/sheeple/builds/2011-08-27-01-06
GIT ID: cf30259
Tests failed

Loading resource:extra/gpu/demos/bunny/bunny.factor
Loading resource:extra/gpu/demos/raytrace/raytrace.factor
Loading resource:extra/graphviz/graphviz.factor
Loading resource:extra/graphviz/attributes/attributes.factor
Loading resource:extra/graphviz/attributes/attributes-docs.factor
Loading resource:extra/graphviz/graphviz-docs.factor
Loading resource:extra/graphviz/builder/builder.factor
Loading resource:extra/graphviz/ffi/ffi.factor
You have triggered a bug in Factor. Please report.
error: 16
arg 1: #<type 5 @ ab63ffe5>
arg 2: f
Starting low level debugger...
Basic commands:
q -- continue executing Factor - NOT SAFE
im -- save image to fep.image
x -- exit Factor
Advanced commands:
d -- dump memory
u -- dump object at tagged
. -- print object at tagged
t -- toggle output trimming
s r -- dump data, retain stacks
.s .r .c -- print data, retain, call stacks
e -- dump environment
g -- dump generations
data -- data heap dump
words -- words dump
tuples -- tuples dump
refs -- find data heap references to object
push -- push object on data stack - NOT SAFE
code -- code heap dump
READY
==== DATA STACK:
T{ vocabs:vocab "graphviz.builder" T{ hashtables:hashtable 0 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+parsing+ f }
T{ vocabs:vocab "graphviz.builder" T{ hashtables:hashtable 0 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+parsing+ f }
{ "! Copyright (C) 2011 Alex Vondrak." "! See http://factorcode.org/license.txt for BSD license." "USING: accessors classes classes.tuple combinators kernel" "sequences strings summary words" "graphviz" "graphviz.attributes" "graphviz.ffi" ";" "IN: graphviz.builder" ""... }
T{ vectors:vector { 0 0 0 0 0 0 0 0 0 0... } 0 }
T{ vocabs:vocab "graphviz.ffi" T{ hashtables:hashtable 35 0 { "agopen" graphviz.ffi:agopen "" graphviz.ffi: "agclose" graphviz.ffi:agclose "agprotoedge" graphviz.ffi:agprotoedge "agnode" graphviz.ffi:agnode... } } f f vocabs:+parsing+ f }
T{ vocabs:vocab "graphviz.ffi" T{ hashtables:hashtable 35 0 { "agopen" graphviz.ffi:agopen "" graphviz.ffi: "agclose" graphviz.ffi:agclose "agprotoedge" graphviz.ffi:agprotoedge "agnode" graphviz.ffi:agnode... } } f f vocabs:+parsing+ f }
T{ io.encodings:decoder T{ io.ports:input-port syntax:t f T{ io.backend.unix:fd syntax:t f 19 } f T{ io.buffers:buffer 65536 #<type 6 @ ab360046> 0 0 syntax:t } } io.encodings.utf8:utf8 f }
"resource:extra/graphviz/ffi/ffi.factor"
destructors:dispose
alien:dll
T{ vectors:vector { alien:dll 0 } 1 }
T{ vectors:vector { alien:dll 0 } 1 }
==== RETAIN STACK:

<type 5 @ 9f140825>

{ T{ vocabs:vocab "alien" T{ hashtables:hashtable 46 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "alien" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "alien.strings" T{ hashtables:hashtable 11 0 { "native-string>alien" alien.strings:native-string>alien T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "invalid-c-string" alien.strings:invalid-c-string "string>symbol" alien.strings:string>symbol "string>symbol_" alien.strings:string>symbol_... } } f "c-strings" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "arrays" T{ hashtables:hashtable 11 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "" arrays: "2array" arrays:2array... } } f "arrays" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "assocs" T{ hashtables:hashtable 60 0 { "?at" assocs:?at "assoc?" assocs:assoc? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "assocs" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "bootstrap.layouts" T{ hashtables:hashtable 0 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "byte-arrays" T{ hashtables:hashtable 10 0 { "3byte-array" byte-arrays:3byte-array "2byte-array" byte-arrays:2byte-array "(byte-array)" byte-arrays:(byte-array) T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "byte-arrays" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "byte-vectors" T{ hashtables:hashtable 4 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "byte-vectors" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "checksums" T{ hashtables:hashtable 16 0 { "hex-string" checksums:hex-string T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "checksum-bytes" checksums:checksum-bytes... } } f "checksums" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "checksums.crc32" T{ hashtables:hashtable 7 0 { "(crc32)" checksums.crc32:(crc32) T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "crc32" checksums.crc32:crc32... } } f "checksums.crc32" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "classes" T{ hashtables:hashtable 22 0 { "class?" classes:class? "instance?" classes:instance? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "classes" vocabs:+done+ vocabs:+done+ }... }
2012
1295
f
";"
T{ vocabs.parser:manifest f T{ hashtables:hashtable 12 0 { "graphviz.attributes" "graphviz.attributes" T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graphviz" "graphviz" T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } T{ vectors:vector { T{ vocabs:vocab "graphviz.attributes" T{ hashtables:hashtable 9 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graph-attributes?" graphviz.attributes:graph-attributes? "edge-attributes?" graphviz.attributes:edge-attributes? "node-attributes?" graphviz.attributes:node-attributes? "" graphviz.attributes:... } } f "graphviz.attributes" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "graphviz" T{ hashtables:hashtable 22 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "subgraph" graphviz:subgraph T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graph?" graphviz:graph?... } } f "graphviz" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "classes.tuple" T{ hashtables:hashtable 21 0 { "all-slots" classes.tuple:all-slots "immutable-tuple-class" classes.tuple:immutable-tuple-class "tuple-class" classes.tuple:tuple-class "tuple-slots" classes.tuple:tuple-slots "bad-superclass" classes.tuple:bad-superclass... } } f "tuples" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "kernel" T{ hashtables:hashtable 107 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "or" kernel:or T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f f vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "strings" T{ hashtables:hashtable 6 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "resize-string" strings:resize-string ">string" strings:>string T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "strings" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "words" T{ hashtables:hashtable 56 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "subwords" words:subwords T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "remove-word-prop" words:remove-word-prop "undefined" words:undefined... } } f "words" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "accessors" T{ hashtables:hashtable 9805 0 { "change-subwindow_mode" accessors:change-subwindow_mode ">>override_redirect" accessors:>>override_redirect T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "change-reg" accessors:change-reg... } } f f f vocabs:+done+ } T{ vocabs:vocab "combinators" T{ hashtables:hashtable 25 0 { "case" combinators:case "execute-effect" combinators:execute-effect T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "combinators" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "sequences" T{ hashtables:hashtable 215 0 { "member-eq?" sequences:member-eq? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "append" sequences:append "assert-sequence=" sequences:assert-sequence= T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "sequences" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "syntax" T{ hashtables:hashtable 90 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "GENERIC:" syntax:GENERIC: "DEFER:" syntax:DEFER:... } } f "syntax" vocabs:+done+ vocabs:+done+ }... } 12 } T{ vectors:vector { } 0 } T{ vectors:vector { } 0 } }
"graphviz.ffi"
T{ vocabs.parser:manifest f T{ hashtables:hashtable 12 0 { "graphviz.attributes" "graphviz.attributes" T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graphviz" "graphviz" T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } T{ vectors:vector { T{ vocabs:vocab "graphviz.attributes" T{ hashtables:hashtable 9 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graph-attributes?" graphviz.attributes:graph-attributes? "edge-attributes?" graphviz.attributes:edge-attributes? "node-attributes?" graphviz.attributes:node-attributes? "" graphviz.attributes:... } } f "graphviz.attributes" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "graphviz" T{ hashtables:hashtable 22 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "subgraph" graphviz:subgraph T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "graph?" graphviz:graph?... } } f "graphviz" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "classes.tuple" T{ hashtables:hashtable 21 0 { "all-slots" classes.tuple:all-slots "immutable-tuple-class" classes.tuple:immutable-tuple-class "tuple-class" classes.tuple:tuple-class "tuple-slots" classes.tuple:tuple-slots "bad-superclass" classes.tuple:bad-superclass... } } f "tuples" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "kernel" T{ hashtables:hashtable 107 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "or" kernel:or T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f f vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "strings" T{ hashtables:hashtable 6 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "resize-string" strings:resize-string ">string" strings:>string T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "strings" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "words" T{ hashtables:hashtable 56 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "subwords" words:subwords T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "remove-word-prop" words:remove-word-prop "undefined" words:undefined... } } f "words" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "accessors" T{ hashtables:hashtable 9805 0 { "change-subwindow_mode" accessors:change-subwindow_mode ">>override_redirect" accessors:>>override_redirect T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "change-reg" accessors:change-reg... } } f f f vocabs:+done+ } T{ vocabs:vocab "combinators" T{ hashtables:hashtable 25 0 { "case" combinators:case "execute-effect" combinators:execute-effect T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "combinators" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "sequences" T{ hashtables:hashtable 215 0 { "member-eq?" sequences:member-eq? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "append" sequences:append "assert-sequence=" sequences:assert-sequence= T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "sequences" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "syntax" T{ hashtables:hashtable 90 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "GENERIC:" syntax:GENERIC: "DEFER:" syntax:DEFER:... } } f "syntax" vocabs:+done+ vocabs:+done+ }... } 12 } T{ vectors:vector { } 0 } T{ vectors:vector { } 0 } }
T{ source-files.errors:source-file-error T{ lexer:lexer-error 157 55 "CONSTANT: supported-engines $[ API_layout plugin-list ]" T{ vectors:vector { T{ lexer:lexer-parsing-word syntax:CONSTANT: 157 "CONSTANT: supported-engines $[ API_layout plugin-list ]" 9 } T{ lexer:lexer-parsing-word literals:$[ 157 "CONSTANT: supported-engines $[ API_layout plugin-list ]" 30 } 0 0 0 0 0 0 0 0... } 2 } { "kernel-error" 9 f f } } f "resource:extra/graphviz/ffi/ffi.factor" f }
{ destructors:dispose }
1
0
T{ hashtables:hashtable 3 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } alien:dll T{ generic.single:predicate-engine alien:dll T{ hashtables:hashtable 1 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } alien:dll dll=>dispose T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } words:word T{ generic.single:predicate-engine words:word T{ hashtables:hashtable 1 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } io.streams.null:null-stream null-stream=>dispose } } }... } }
T{ vectors:vector { } 0 }
{ { alien:dll T{ generic.single:predicate-engine alien:dll T{ hashtables:hashtable 1 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } alien:dll dll=>dispose T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } } } { words:word T{ generic.single:predicate-engine words:word T{ hashtables:hashtable 1 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } io.streams.null:null-stream null-stream=>dispose } } } } { kernel:tuple T{ generic.single:tuple-dispatch-engine T{ hashtables:hashtable 5 0 { 0 T{ generic.single:echelon-dispatch-engine 0 f } 1 T{ generic.single:echelon-dispatch-engine 1 T{ hashtables:hashtable 41 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } random.unix:unix-random T{ generic.single:predicate-engine random.unix:unix-random T{ ... ... ... ... } } io.streams.limited:limited-stream T{ generic.single:predicate-engine io.streams.limited:limited-stream T{ ... ... ... ... } } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } } 2 T{ generic.single:echelon-dispatch-engine 2 T{ hashtables:hashtable 31 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } cuda.gl:free-resource-destructor T{ generic.single:predicate-engine cuda.gl:free-resource-destructor T{ ... ... ... ... } } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } libc:free-destructor T{ generic.single:predicate-engine libc:free-destructor T{ ... ... ... ... } }... } } } 3 T{ generic.single:echelon-dispatch-engine 3 T{ hashtables:hashtable 14 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } gpu.textures:texture T{ generic.single:predicate-engine gpu.textures:texture T{ ... ... ... ... } } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } } } }
T{ vectors:vector { } 0 }
3
0
T{ vectors:vector { } 0 }
T{ generic.single:predicate-engine alien:dll T{ hashtables:hashtable 1 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } alien:dll dll=>dispose T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } }
{ { alien:dll dll=>dispose } { kernel:object object=>dispose } }
T{ vectors:vector { kernel:object 0 0 } 1 }
T{ vectors:vector { kernel:object 0 0 } 1 }
==== CALL STACK:
frame: b76c6fe4
executing: kernel.private:c-to-factor
factor: vm/gc.cpp:149: void factor::factor_vm::gc(factor::gc_op, factor::cell, bool): Assertion `!current_gc' failed.
scan:
Launcher error:
Process exited with error code T{ signal { n 6 } }

Launch descriptor:

T{ process
{ command { "./factor" "-run=mason.test" } }
{ environment H{ } }
{ environment-mode +append-environment+ }
{ stdin +closed+ }
{ stdout "../test-log" }
{ stderr +stdout+ }
{ timeout T{ duration { hour 4 } } }
{ status T{ signal { n 6 } } }
}

Repaint issues with image gadgets?

If you use the cap vocab to take a screenshot of the listener, the window that opens up with the screenshot doesn't paint properly (on Mac OS X, it stays gray until you force a repaint by dragging another window over sections of the screenshot window).

( scratchpad ) USE: cap
( scratchpad ) world get screenshot.

"basis" depends on "extra"

I've found a couple cases where vocabs in "basis" depend on vocabs in "extra":

  • furnace/furnace.factor:

    "webapps.user-admin" require

  • deploy/test/8/8.factor:

    USING: ... method-chains ... ;

compile errors after bootstrap on Mac OS X 10.5

==== resource:basis/images/cocoa/cocoa.factor

resource:basis/images/cocoa/cocoa.factor: 47

Asset: load-image-rep

Macro expansion of “(send)” threw an error

The error was:
No such method: bitmapImageRepByConvertingToColorSpace:renderingIntent:

[Traceback]

resource:basis/images/cocoa/cocoa.factor: 53

Asset: image-rep>image

Macro expansion of “(send)” threw an error

The error was:
No such method: size

GC bug on Mac OS X 32-bit tickled by mason doing load-all

Loading resource:extra/graphviz/builder/builder.factor
Loading resource:extra/graphviz/ffi/ffi.factor
Loading resource:extra/graphviz/ffi/ffi-docs.factor
Loading resource:extra/graphviz/builder/builder-docs.factor
Loading resource:extra/graphviz/notation/notation.factor
Loading resource:extra/graphviz/notation/notation-docs.factor
Loading resource:extra/graphviz/render/render.factor
Loading resource:extra/grid-meshes/grid-meshes.factor
You have triggered a bug in Factor. Please report.
critical_error: Invalid header in size: 191f3590
Starting low level debugger...
Basic commands:
q -- continue executing Factor - NOT SAFE
im -- save image to fep.image
x -- exit Factor
Advanced commands:
d -- dump memory
u -- dump object at tagged
. -- print object at tagged
t -- toggle output trimming
s r -- dump data, retain stacks
.s .r .c -- print data, retain, call stacks
e -- dump environment
g -- dump generations
data -- data heap dump
words -- words dump
tuples -- tuples dump
refs -- find data heap references to object
push -- push object on data stack - NOT SAFE
code -- code heap dump
READY
==== DATA STACK:
T{ vocabs:vocab "grid-meshes" T{ hashtables:hashtable 2 0 { "grid-mesh?" grid-meshes:grid-mesh? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "grid-mesh" grid-meshes:grid-mesh T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+parsing+ f }
T{ vocabs:vocab "grid-meshes" T{ hashtables:hashtable 2 0 { "grid-mesh?" grid-meshes:grid-mesh? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "grid-mesh" grid-meshes:grid-mesh T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+parsing+ f }
{ "! (c)2009 Joe Groff bsd license" "USING: accessors alien.data.map arrays destructors fry grouping" "kernel math math.ranges math.vectors.simd opengl opengl.gl sequences" "sequences.product specialized-arrays ;" "FROM: alien.c-types => float ;" "SPECIALIZED-ARRAY: float-4" "IN: grid-meshes" "" "TUPLE: grid-mesh dim buffer row-length ;" ""... }
T{ vectors:vector { 0 0 0 0 0 0 0 0 0 0... } 0 }
grid-meshes.private:vertex-array-row
T{ effects:effect { "range" "z0" "z1" } { "vertices" } f f f }
T{ vectors:vector { [ [ #<type 3 @ 192ab703> kernel:swap #<type 3 @ 192ab9f3> math.vectors.simd:float-4-boa ] kernel:bi-curry@ kernel:bi ] kernel:2curry { kernel:object } 0 0 0 0 0 0 0... } 3 }
"2]"
"2]"
==== RETAIN STACK:

<type 5 @ cdc0815>

{ T{ vocabs:vocab "alien" T{ hashtables:hashtable 46 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "alien" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "alien.strings" T{ hashtables:hashtable 11 0 { "native-string>alien" alien.strings:native-string>alien T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "invalid-c-string" alien.strings:invalid-c-string "string>symbol" alien.strings:string>symbol "string>symbol_" alien.strings:string>symbol_... } } f "c-strings" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "arrays" T{ hashtables:hashtable 11 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "" arrays: "2array" arrays:2array... } } f "arrays" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "assocs" T{ hashtables:hashtable 60 0 { "?at" assocs:?at "assoc?" assocs:assoc? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "assocs" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "bootstrap.layouts" T{ hashtables:hashtable 0 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } } } f f vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "byte-arrays" T{ hashtables:hashtable 10 0 { "3byte-array" byte-arrays:3byte-array "2byte-array" byte-arrays:2byte-array "(byte-array)" byte-arrays:(byte-array) T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "byte-arrays" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "byte-vectors" T{ hashtables:hashtable 4 0 { T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "byte-vectors" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "checksums" T{ hashtables:hashtable 16 0 { "hex-string" checksums:hex-string T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "checksum-bytes" checksums:checksum-bytes... } } f "checksums" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "checksums.crc32" T{ hashtables:hashtable 7 0 { "(crc32)" checksums.crc32:(crc32) T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } "crc32" checksums.crc32:crc32... } } f "checksums.crc32" vocabs:+done+ vocabs:+done+ } T{ vocabs:vocab "classes" T{ hashtables:hashtable 22 0 { "class?" classes:class? "instance?" classes:instance? T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f } T{ hashtables.private:tombstone f }... } } f "classes" vocabs:+done+ vocabs:+done+ }... }
2058
1338
f
syntax:;
{ "float-4[2]" }
{ 0 }
{ "float-4[2]" }
{ 0 }
1
0
{ 0 }
0
"float-4"
{ "2]" }
{ 0 }
{ "2]" }
{ 0 }
1
0
{ 0 }
0
1
==== CALL STACK:
frame: 280fe4
executing: kernel.private:c-to-factor
Assertion failed: (!current_gc), function gc, file vm/gc.cpp, line 149.
scan:

[patch] Lazy core-text rendering?

Inspired by this commit (klazuka@e98b362), I tried it out:

diff --git a/basis/core-text/core-text.factor b/basis/core-text/core-text.factor
index 014956a..d409bd9 100644
--- a/basis/core-text/core-text.factor
+++ b/basis/core-text/core-text.factor
@@ -47,7 +47,10 @@ ERROR: not-a-string object ;
         CTLineCreateWithAttributedString
     ] with-destructors ;

-TUPLE: line < disposable line metrics image loc dim ;
+TUPLE: line < disposable line metrics image loc dim render-info ;
+
+TUPLE: render-info font string loc dim ;
+C: <render-info> render-info

 : typographic-bounds ( line -- width ascent descent leading )
     { CGFloat CGFloat CGFloat }
@@ -126,22 +129,34 @@ TUPLE: line < disposable line metrics image loc dim ;

         line >>line

-        metrics >>metrics
+        font string loc dim <render-info> >>render-info

-        dim [
-            {
-                [ font dim fill-background ]
-                [ loc dim line string fill-selection-background ]
-                [ loc set-text-position ]
-                [ [ line ] dip CTLineDraw ]
-            } cleave
-        ] make-bitmap-image >>image
+        metrics >>metrics

         metrics loc dim line-loc >>loc

         metrics metrics>dim >>dim
     ] with-destructors ;

+:: render ( line -- line image )
+    line line>> :> ctline
+    line render-info>> string>> :> string
+    line render-info>> font>> :> font
+    line render-info>> loc>> :> loc
+    line render-info>> dim>> :> dim
+
+    line dim [
+        {
+            [ font dim fill-background ]
+            [ loc dim ctline string fill-selection-background ]
+            [ loc set-text-position ]
+            [ [ ctline ] dip CTLineDraw ]
+        } cleave
+    ] make-bitmap-image ;
+
+: line>image ( line -- image )
+    dup image>> [ render >>image ] unless image>> ;
+
 M: line dispose* line>> CFRelease ;

 SYMBOL: cached-lines
diff --git a/basis/ui/text/core-text/core-text.factor b/basis/ui/text/core-text/core-text.factor
index db8e43c..e864c82 100644
--- a/basis/ui/text/core-text/core-text.factor
+++ b/basis/ui/text/core-text/core-text.factor
@@ -18,7 +18,7 @@ M: core-text-renderer flush-layout-cache
     cached-lines get purge-cache ;

 M: core-text-renderer string>image ( font string -- image loc )
-    cached-line [ image>> ] [ loc>> ] bi ;
+    cached-line [ line>image ] [ loc>> ] bi ;

 M: core-text-renderer x>offset ( x font string -- n )
     [ 2drop 0 ] [
@@ -38,4 +38,4 @@ M: core-text-renderer line-metrics ( font string -- metrics )
     [ cached-line metrics>> ]
     if-empty ;

-core-text-renderer font-renderer set-global
\ No newline at end of file
+core-text-renderer font-renderer set-global

cpu.x86.x87 is broken

It generates bad code for certain FFI calls .x87 stack looks unbalanced, not sure why. Manifests as this error on startup:

$ ./factor
cairo-error
message "invalid value (typically too big) for the size of the input
(..."

Bug in PEGs

git diff master..smalltalk extra/smalltalk/parser

The smalltalk branch has a cleaned up smalltalk parser that should be equivalent. However, the generated code fails.

possible bug in zone::contains_p

I think this diff demonstrates that zone::contains_p can return the wrong answer when 'pointer' is less than 'start'. http://gist.github.com/217255

With the diff applied I get this failure when running ./factor on linux: "factor: vm/zone.hpp:15: bool factor::zone::contains_p(factor::object*): Assertion `(cell)pointer >= start' failed.
Aborted"

GDI+ words are broken after bootstrap on Windows

==== resource:basis/images/gdiplus/gdiplus.factor

resource:basis/images/gdiplus/gdiplus.factor: 23

Asset: stream>gdi+-bitmap

Macro expansion of ΓÇ£(simple-local-allot)ΓÇ¥ threw an error

The error was:
Generic word depends-on-c-type does not define a method for the word class.
Dispatching on object: GdipCreateBitmapFromStream

[Traceback]

resource:basis/images/gdiplus/gdiplus.factor: 28

Asset: gdi+-bitmap-width

Macro expansion of ΓÇ£(simple-local-allot)ΓÇ¥ threw an error

The error was:
Generic word depends-on-c-type does not define a method for the word class.
Dispatching on object: GdipGetImageWidth

[Traceback]

resource:basis/images/gdiplus/gdiplus.factor: 31

Asset: gdi+-bitmap-height

Macro expansion of ΓÇ£(simple-local-allot)ΓÇ¥ threw an error

The error was:
Generic word depends-on-c-type does not define a method for the word class.
Dispatching on object: GdipGetImageHeight

[Traceback]

resource:basis/images/gdiplus/gdiplus.factor: 34

Asset: gdi+-lock-bitmap

Macro expansion of ΓÇ£(simple-local-allot)ΓÇ¥ threw an error

The error was:
Generic word depends-on-c-type does not define a method for the word class.
Dispatching on object: GdipBitmapLockBits

[Traceback]

==== resource:basis/windows/gdiplus/gdiplus.factor

resource:basis/windows/gdiplus/gdiplus.factor: 1641

Asset: (start-gdi+)

Macro expansion of ΓÇ£(simple-local-allot)ΓÇ¥ threw an error

The error was:
Generic word depends-on-c-type does not define a method for the word class.
Dispatching on object: swapd

Compiler's update-existing? check is wrong

Noticed while debugging #66. The compiler's logic for figuring out whether or not a new word definition must scan the entire code heap and update references is wrong.

USING: compiler.units.private ;
SYNTAX: BOO [ ] with-nested-compilation-unit ; 
: xxx ( -- ) ; BOO

In the above, the code heap is always scanned, even if xxx is a new word, because the nested compilation unit calls notify-observers.

This tickles the same bug, but here we don't update the heap when we should:

USING: quotations ;
SYNTAX: BOO word [ 1quotation (( -- )) define-temp ] with-compilation-unit suffix! ; 
: xxx ( -- ) ; BOO

Faster set operations?

This version of union is about half the time of the current one for sets of varying sizes:

: adjoin-all ( seq set -- )
    [ adjoin ] curry each ;

: fast-union ( set1 set2 -- set )
    small/large [ members ] bi@ fast-set [ adjoin-all ] keep ;

: union ( set1 set2 -- set )
    [ fast-union ] keep set-like ;

This speeds up subset? when checking a larger set versus a smaller one:

<PRIVATE

: (subset?) ( set1 set2 -- ? )
    sequence/tester all? ; inline

PRIVATE>

M: set subset?
    2dup [ cardinality ] bi@ > [ 2drop f ] [ (subset?) ] if ;

M: set set=
    2dup [ cardinality ] bi@ eq? [ (subset?) ] [ 2drop f ] if ;

The subset? change requires fixing cardinality for sequences to return the "pruned" length (which arguably is the correct way to implement it for sequences):

 M: sequence cardinality
-    length ;
+    pruned length ;

epoll error on Linux x86.64

Saw this; a ENOENT return from epoll_ctl() means that the given file descriptor was not part of the epoll:

Error in thread 17 (I/O wait, [ quotation quotation while ]):

Unix system call failed:

No such file or directory (2)

(U) Quotation: set-namestack init-catchstack self quot>> call -> stop Quotation: [ [ call ] keep -> [ loop ] curry when ]
Word: loop
(U) Quotation: [ over [ call ] dip -> ]
Word: keep
(U) Quotation: [ uncompose [ call ] dip -> call ]
Method: M\ compose call
(O) Word: io-thread
(O) Word: handle-events
(O) Word: handle-event
(O) Word: io-error
(O) Word: (io-error)
(O) Word: unix-error
(O) Method: M\ object throw
(U) Quotation: [
63 special-object error-thread set-global
continuation -> error-continuation set-global
[ original-error set-global ] [ rethrow ] bi
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.