File: SPEC.md

package info (click to toggle)
acl2 8.0dfsg-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 226,956 kB
  • sloc: lisp: 2,678,900; ansic: 6,101; perl: 5,816; xml: 3,586; cpp: 2,624; ruby: 2,576; makefile: 2,443; sh: 2,312; python: 778; yacc: 764; ml: 763; awk: 260; csh: 186; php: 171; lex: 165; tcl: 44; java: 41; asm: 23; haskell: 17
file content (86 lines) | stat: -rw-r--r-- 2,342 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
TRIVIAL-FEATURES
================

This is a first *draft* of a description of what symbols should be
present in `CL:*FEATURES*` for various platforms.  A possible future
direction of this documentation might be a CDR document, if it turns
out to be a good idea.  (Making the language of this document much
more precise will be necessary then.)

We will start by limiting ourselves to OS, CPU and endianness features
on Windows and POSIX platforms.

There are various possible implementation strategies ranging from null
implementations (when the host Lisp already pushes the wanted feature)
to using FFI (e.g. calling uname() to grab system information.


Specification
-------------

### ENDIANNESS

Either `:LITTLE-ENDIAN` or `:BIG-ENDIAN` should present in
`\*FEATURES\*`.  For the time being, we will not concern ourselves
with other orderings, switchable endianness, etc.


### OPERATING SYSTEM

On Windows, `:WINDOWS` should be present in `*FEATURES*`.

On POSIX systems, the "sysname" information from uname(3) should be
used to push the appropriate symbol to `*FEATURES*` by upcasing that
string (or downcasing for the "modern" lisps) and interning it in the
keyword package.

Examples:

  - `:DARWIN`
  - `:LINUX`
  - `:NETBSD`
  - `:OPENBSD`
  - `:FREEBSD`

For convenience, `:UNIX` should be pushed when running on
POSIX/UNIX-like operating system (that doesn't include Windows) and
`:BSD` should be present when running on BSD-based systems (that
includes Darwin)

[add `:MACH` too?]


### CPU

These features should be mutually exclusive:

  - `:X86`
  - `:X86-64`
  - `:PPC`
  - `:PPC64`
  - `:MIPS`
  - `:ALPHA`
  - `:SPARC`
  - `:SPARC64`
  - `:HPPA`
  - `:HPPA64`

[add more ...]

[note: it's debatable whether `:X86` shouldn't also be exported on
x86-64, and `:PPC` on ppc64.  SBCL doesn't.  Other ways
to handle, for example, the x86/x86-64 case would be to export
something like `:PC386` in both cases or have an additional `:X86-32`. Or
finally, have just `:X86`, `:PPC`, etc, and add `:32-BIT-CPU` and
`:64-BIT-CPU` features.]


Unreferenced References
-----------------------

  * [CLHS: Variable \*FEATURES\*][1]
  * [Maintaining Portable Lisp Programs][2], by Christophe Rhodes


[1]: http://www.lispworks.com/documentation/HyperSpec/Body/v_featur.htm
[2]: http://www-jcsu.jesus.cam.ac.uk/~csr21/papers/features.pdf