3 This is a collection of TODO items and ideas in no particular order.
7 -> Test uffi-compat with more UFFI libraries.
8 -> Write more FOREIGN-GLOBALS.SET.* tests.
9 -> Finish tests/random-tester.lisp
10 -> Write benchmarks comparing CFFI vs. native FFIs and also demonstrating
11 performance of each platform.
12 -> Write more STRUCT.ALIGNMENT.* tests (namely involving the :LONG-LONG
13 and :UNSIGNED-LONG-LONG types) and test them in more ABIs.
14 -> Run tests with the different kinds of shared libraries available on
19 -> Finish GCL port, port to MCL.
20 -> Update Corman port. [2007-02-22 LO]
24 -> Implement a declarative interface for FOREIGN-FUNCALL-PTR, similar to
25 DEFCUN/FOREIGN-FUNCALL.
26 -> Figure out how to portably define types like: time_t, size_t, wchar_t,
27 etc... Likely to involve something like SB-GROVEL and possibly avoiding
28 this step on known platforms?
29 -> Implement the proposed interfaces (see doc/).
30 -> Implement CFFI-SYS:ERRNO-VALUE (name?).
31 -> Extend FOREIGN-SLOT-VALUE and make it accept multiple "indices" for
32 directly accessing structs inside structs, arrays inside structs, etc...
33 -> Implement EXPLAIN-FOREIGN-SLOT-VALUE.
34 -> Implement :in/:out/:in-out for DEFCFUN (and FOREIGN-FUNCALL?).
35 -> Add support for multiple memory allocation schemes (like CLISP), namely
36 support for allocating with malloc() (so that it can be freed on the C
38 -> Extend DEFCVAR's symbol macro in order to handle memory (de)allocation
39 automatically (see CLISP).
40 -> Implement byte swapping routines (see /usr/include/linux/byteorder)
41 -> [Lost Idea] Implement UB8-REF?
42 -> [Lost Idea] Something about MEM-READ-C-STRING returning multiple value?
43 -> Implement an array type? Useful when we're working with ranks >= 2?
44 -> External encodings for the :STRING type. See:
45 <http://article.gmane.org/gmane.lisp.cffi.devel/292>
46 -> Define a lisp type for pointers in the backends. Eg: for clisp:
47 (deftype pointer-type (or ffi:foreign-address null))
48 Useful for type declarations.
49 -> Warn about :void in places where it doesn't make sense.
51 ### Underspecified Semantics
53 -> (setf (mem-ref ptr <aggregate-type> offset) <value>)
54 -> Review the interface for coherence across Lisps with regard to
55 behaviour in "exceptional" situations. Eg: threads, dumping cores,
56 accessing foreign symbols that don't exist, etc...
57 -> On Lispworks a Lisp float is a double and therefore won't necessarily
58 fit in a C float. Figure out a way to handle this.
59 -> Allegro: callbacks' return values.
60 -> Lack of uniformity with regard to pointers. Allegro: 0 -> NULL.
61 CLISP/Lispworks: NIL -> NULL.
62 -> Some lisps will accept a lisp float being passed to :double
63 and a lisp double to :float. We should either coerce on lisps that
64 don't accept this or check-type on lisps that do. Probably the former
65 is better since on lispworks/x86 double == float.
66 -> What happens when the same library is loaded twice.
68 ### Possible Optimizations
70 -> More compiler macros on some of the CFFI-SYS implementations.
71 -> Optimize UFFI-COMPAT when the vector stuff is implemented.
72 -> Being able to declare that some C int will always fit in a Lisp
73 fixnum. Allegro has a :fixnum ftype and CMUCL/SBCL can use
74 (unsigned-byte 29) others could perhaps behave like :int?
75 -> An option for defcfun to expand into a compiler macro which would
76 allow the macroexpansion-time translators to look at the forms
77 passed to the functions.
81 -> CLISP FASL portability is broken. Fix this by placing LOAD-TIME-VALUE
82 forms in the right places and moving other calculations to load-time.
83 (eg: calculating struct size/alignment.) Ideally we'd only move them
84 to load-time when we actually care about fasl portability.
85 (defmacro maybe-load-time-value (form)
86 (if <we care about fasl portability>
87 `(load-time-value ,form)
89 -> cffi-tests.asd's :c-test-lib component is causing the whole testsuite
90 to be recompiled everytime. Figure that out.
91 -> The (if (constantp foo) (do-something-with (eval foo)) ...) pattern
92 used in many places throughout the code is apparently not 100% safe.
93 -> On ECL platforms without DFFI we need to build a non-linked version
95 -> LOAD-FOREIGN-LIBRARY should give better errors. On ECL with DFFI
96 it should show the error that %LOAD-FOREIGN-LIBRARY is signalling.
97 -> foreign-enum-keyword/value should have their own error condition?
98 <http://article.gmane.org/gmane.lisp.cffi.devel/975> [2007-02-22 LO]
102 -> Fill the missing sections in the CFFI User Manual.
103 -> Update the CFFI-SYS Specification.
104 -> have two versions of the manual on the website
108 -> Type-checking pointer interface.