factor/library/cross-compiler.factor

405 lines
7.7 KiB
Factor
Raw Normal View History

2004-07-30 02:44:12 -04:00
! :folding=none:collapseFolds=1:
! $Id$
!
! Copyright (C) 2004 Slava Pestov.
!
! Redistribution and use in source and binary forms, with or without
! modification, are permitted provided that the following conditions are met:
!
! 1. Redistributions of source code must retain the above copyright notice,
! this list of conditions and the following disclaimer.
!
! 2. Redistributions in binary form must reproduce the above copyright notice,
! this list of conditions and the following disclaimer in the documentation
! and/or other materials provided with the distribution.
!
! THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
! INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
! FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
! DEVELOPERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
! PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
! OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
! WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
! OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
! ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
USE: combinators
2004-07-30 02:44:12 -04:00
USE: kernel
USE: lists
2004-08-26 22:21:17 -04:00
USE: math
USE: namespaces
2004-07-30 02:44:12 -04:00
USE: parser
USE: real-math
2004-07-30 02:44:12 -04:00
USE: stack
USE: stdio
USE: streams
USE: strings
USE: vectors
USE: vectors
USE: words
2004-09-18 18:15:01 -04:00
IN: alien
DEFER: dlopen
DEFER: dlsym
DEFER: dlsym-self
DEFER: dlclose
2004-09-19 17:39:28 -04:00
DEFER: <alien>
2004-09-21 22:58:54 -04:00
DEFER: <local-alien>
2004-09-19 17:39:28 -04:00
DEFER: alien-cell
DEFER: set-alien-cell
DEFER: alien-4
DEFER: set-alien-4
2004-09-20 21:02:48 -04:00
DEFER: alien-2
DEFER: set-alien-2
2004-09-19 17:39:28 -04:00
DEFER: alien-1
DEFER: set-alien-1
2004-09-18 18:15:01 -04:00
2004-09-06 02:32:04 -04:00
IN: compiler
DEFER: set-compiled-byte
DEFER: set-compiled-cell
DEFER: compiled-offset
DEFER: set-compiled-offset
DEFER: literal-top
DEFER: set-literal-top
2004-09-06 02:32:04 -04:00
2004-07-30 02:44:12 -04:00
IN: kernel
DEFER: getenv
DEFER: setenv
DEFER: save-image
DEFER: room
2004-07-30 16:22:20 -04:00
DEFER: os-env
2004-08-06 02:51:32 -04:00
DEFER: type-of
DEFER: size-of
DEFER: address-of
DEFER: dump
2004-09-21 12:41:57 -04:00
DEFER: heap-stats
2004-07-30 02:44:12 -04:00
IN: strings
DEFER: str=
DEFER: str-hashcode
2004-08-12 02:13:43 -04:00
DEFER: sbuf=
2004-08-25 20:51:19 -04:00
DEFER: sbuf-clone
2004-07-30 02:44:12 -04:00
IN: files
DEFER: stat
2004-08-30 20:24:19 -04:00
DEFER: (directory)
DEFER: cwd
DEFER: cd
2004-07-30 02:44:12 -04:00
IN: io-internals
DEFER: open-file
DEFER: client-socket
2004-07-30 02:44:12 -04:00
DEFER: server-socket
DEFER: close-port
DEFER: add-accept-io-task
2004-07-30 02:44:12 -04:00
DEFER: accept-fd
2004-08-15 21:50:44 -04:00
DEFER: can-read-line?
DEFER: add-read-line-io-task
2004-07-30 02:44:12 -04:00
DEFER: read-line-fd-8
2004-08-20 01:49:14 -04:00
DEFER: can-read-count?
DEFER: add-read-count-io-task
DEFER: read-count-fd-8
2004-08-15 21:50:44 -04:00
DEFER: can-write?
DEFER: add-write-io-task
2004-07-30 02:44:12 -04:00
DEFER: write-fd-8
DEFER: add-copy-io-task
2004-09-02 21:51:19 -04:00
DEFER: pending-io-error
2004-08-15 21:50:44 -04:00
DEFER: next-io-task
2004-07-30 02:44:12 -04:00
2004-08-26 22:21:17 -04:00
IN: math
2004-09-19 00:33:40 -04:00
DEFER: arithmetic-type
2004-09-18 22:29:29 -04:00
DEFER: >fraction
DEFER: fraction>
2004-09-19 00:33:40 -04:00
DEFER: fixnum=
DEFER: fixnum+
DEFER: fixnum-
DEFER: fixnum*
DEFER: fixnum/i
DEFER: fixnum/f
DEFER: fixnum-mod
DEFER: fixnum/mod
DEFER: fixnum-bitand
DEFER: fixnum-bitor
DEFER: fixnum-bitxor
DEFER: fixnum-bitnot
DEFER: fixnum-shift
DEFER: fixnum<
DEFER: fixnum<=
DEFER: fixnum>
DEFER: fixnum>=
DEFER: bignum=
DEFER: bignum+
DEFER: bignum-
DEFER: bignum*
DEFER: bignum/i
DEFER: bignum/f
DEFER: bignum-mod
DEFER: bignum/mod
DEFER: bignum-bitand
DEFER: bignum-bitor
DEFER: bignum-bitxor
DEFER: bignum-bitnot
DEFER: bignum-shift
DEFER: bignum<
DEFER: bignum<=
DEFER: bignum>
DEFER: bignum>=
DEFER: float=
DEFER: float+
DEFER: float-
DEFER: float*
DEFER: float/f
DEFER: float<
DEFER: float<=
DEFER: float>
DEFER: float>=
2004-08-26 22:21:17 -04:00
2004-08-05 17:33:02 -04:00
IN: parser
DEFER: str>float
2004-08-23 01:13:09 -04:00
IN: profiler
2004-08-29 03:20:19 -04:00
DEFER: call-profiling
2004-08-23 01:13:09 -04:00
DEFER: call-count
DEFER: set-call-count
2004-08-29 03:20:19 -04:00
DEFER: allot-profiling
DEFER: allot-count
DEFER: set-allot-count
2004-08-23 01:13:09 -04:00
IN: random
DEFER: init-random
DEFER: (random-int)
2004-07-30 02:44:12 -04:00
IN: words
DEFER: <word>
2004-08-29 04:03:16 -04:00
DEFER: word-hashcode
2004-09-06 02:32:04 -04:00
DEFER: word-xt
DEFER: set-word-xt
2004-07-30 02:44:12 -04:00
DEFER: word-primitive
DEFER: set-word-primitive
DEFER: word-parameter
DEFER: set-word-parameter
DEFER: word-plist
DEFER: set-word-plist
2004-08-05 17:33:02 -04:00
IN: unparser
DEFER: unparse-float
2004-09-11 15:26:24 -04:00
IN: image
2004-07-30 02:44:12 -04:00
: primitives, ( -- )
1 [
execute
call
ifte
cons
car
cdr
set-car
set-cdr
2004-07-30 02:44:12 -04:00
<vector>
vector-length
set-vector-length
vector-nth
set-vector-nth
str-length
str-nth
str-compare
str=
str-hashcode
index-of*
substring
str-reverse
2004-07-30 02:44:12 -04:00
<sbuf>
sbuf-length
set-sbuf-length
sbuf-nth
set-sbuf-nth
sbuf-append
sbuf>str
2004-08-25 20:51:19 -04:00
sbuf-reverse
sbuf-clone
2004-08-12 02:13:43 -04:00
sbuf=
2004-09-19 00:33:40 -04:00
arithmetic-type
number?
>fixnum
>bignum
2004-08-05 17:33:02 -04:00
>float
2004-08-04 22:43:58 -04:00
numerator
denominator
2004-09-18 22:29:29 -04:00
>fraction
fraction>
2004-08-05 17:33:02 -04:00
str>float
unparse-float
2004-08-06 02:51:32 -04:00
float>bits
2004-08-05 20:29:52 -04:00
real
imaginary
>rect
rect>
2004-09-19 00:33:40 -04:00
fixnum=
fixnum+
fixnum-
fixnum*
fixnum/i
fixnum/f
fixnum-mod
fixnum/mod
fixnum-bitand
fixnum-bitor
fixnum-bitxor
fixnum-bitnot
fixnum-shift
fixnum<
fixnum<=
fixnum>
fixnum>=
bignum=
bignum+
bignum-
bignum*
bignum/i
bignum/f
bignum-mod
bignum/mod
bignum-bitand
bignum-bitor
bignum-bitxor
bignum-bitnot
bignum-shift
bignum<
bignum<=
bignum>
bignum>=
float=
float+
float-
float*
float/f
float<
float<=
float>
float>=
facos
fasin
fatan
fatan2
fcos
fexp
fcosh
flog
fpow
fsin
fsinh
fsqrt
2004-07-30 02:44:12 -04:00
<word>
2004-08-29 04:03:16 -04:00
word-hashcode
2004-09-06 02:32:04 -04:00
word-xt
set-word-xt
2004-07-30 02:44:12 -04:00
word-primitive
set-word-primitive
word-parameter
set-word-parameter
word-plist
set-word-plist
drop
dup
swap
over
pick
nip
tuck
rot
>r
r>
eq?
getenv
setenv
open-file
stat
2004-08-30 20:24:19 -04:00
(directory)
2004-07-30 02:44:12 -04:00
garbage-collection
save-image
datastack
callstack
set-datastack
set-callstack
exit*
client-socket
2004-07-30 02:44:12 -04:00
server-socket
close-port
add-accept-io-task
2004-07-30 02:44:12 -04:00
accept-fd
2004-08-15 21:50:44 -04:00
can-read-line?
add-read-line-io-task
2004-07-30 02:44:12 -04:00
read-line-fd-8
2004-08-20 01:49:14 -04:00
can-read-count?
add-read-count-io-task
read-count-fd-8
2004-08-15 21:50:44 -04:00
can-write?
add-write-io-task
2004-07-30 02:44:12 -04:00
write-fd-8
add-copy-io-task
2004-09-02 21:51:19 -04:00
pending-io-error
2004-08-15 21:50:44 -04:00
next-io-task
2004-07-30 02:44:12 -04:00
room
2004-07-30 16:22:20 -04:00
os-env
2004-08-04 03:12:55 -04:00
millis
init-random
(random-int)
2004-08-06 02:51:32 -04:00
type-of
size-of
2004-08-29 03:20:19 -04:00
call-profiling
2004-08-23 01:13:09 -04:00
call-count
set-call-count
2004-08-29 03:20:19 -04:00
allot-profiling
allot-count
set-allot-count
dump
cwd
cd
compiled-offset
set-compiled-offset
2004-09-19 17:39:28 -04:00
set-compiled-cell
set-compiled-byte
literal-top
set-literal-top
address-of
2004-09-18 18:15:01 -04:00
dlopen
dlsym
dlsym-self
dlclose
2004-09-19 17:39:28 -04:00
<alien>
2004-09-21 22:58:54 -04:00
<local-alien>
2004-09-19 17:39:28 -04:00
alien-cell
set-alien-cell
alien-4
set-alien-4
2004-09-20 21:02:48 -04:00
alien-2
set-alien-2
2004-09-19 17:39:28 -04:00
alien-1
set-alien-1
2004-09-21 12:41:57 -04:00
heap-stats
2004-07-30 02:44:12 -04:00
] [
swap succ tuck primitive,
] each drop ;
: version, ( -- )
"version" [ "kernel" ] search version unit compound, ;
: make-image ( name -- )
2004-07-30 02:44:12 -04:00
#! Make an image for the C interpreter.
[
"/library/platform/native/boot.factor" run-resource
] with-image
swap write-image ;
: make-images ( -- )
"64-bits" off
"big-endian" off "boot.image.le32" make-image
"big-endian" on "boot.image.be32" make-image
"64-bits" on
"big-endian" off "boot.image.le64" make-image
"big-endian" on "boot.image.be64" make-image ;