moved old instructions for external packages to top-level in preparation for nuking...
[CommonLispStat.git] / external / cffi.darcs / TODO
blobd64ad09df9304f48917ee50e296173a49d293ee2
1 -*- Text -*-
3 This is a collection of TODO items and ideas in no particular order.
5 ### Testing
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
15    MacOS X.
17 ### Ports
19 -> Finish GCL port, port to MCL.
20 -> Update Corman port. [2007-02-22 LO]
22 ### Features
24 -> Implement a declarative interface for FOREIGN-FUNCALL-PTR, similar to
25    DEFCUN/FOREIGN-FUNCALL.
26 -> Implement the proposed interfaces (see doc/).
27 -> Extend FOREIGN-SLOT-VALUE and make it accept multiple "indices" for
28    directly accessing structs inside structs, arrays inside structs, etc...
29 -> Implement EXPLAIN-FOREIGN-SLOT-VALUE.
30 -> Implement :in/:out/:in-out for DEFCFUN (and FOREIGN-FUNCALL?).
31 -> Add support for multiple memory allocation schemes (like CLISP), namely
32    support for allocating with malloc() (so that it can be freed on the C
33    side)>
34 -> Extend DEFCVAR's symbol macro in order to handle memory (de)allocation
35    automatically (see CLISP).
36 -> Implement byte swapping routines (see /usr/include/linux/byteorder)
37 -> [Lost Idea] Implement UB8-REF?
38 -> [Lost Idea] Something about MEM-READ-C-STRING returning multiple value?
39 -> Warn about :void in places where it doesn't make sense.
41 ### Underspecified Semantics
43 -> (setf (mem-ref ptr <aggregate-type> offset) <value>)
44 -> Review the interface for coherence across Lisps with regard to
45    behaviour in "exceptional" situations. Eg: threads, dumping cores,
46    accessing foreign symbols that don't exist, etc...
47 -> On Lispworks a Lisp float is a double and therefore won't necessarily
48    fit in a C float. Figure out a way to handle this.
49 -> Allegro: callbacks' return values.
50 -> Lack of uniformity with regard to pointers. Allegro: 0 -> NULL.
51    CLISP/Lispworks: NIL -> NULL.
52 -> Some lisps will accept a lisp float being passed to :double
53    and a lisp double to :float. We should either coerce on lisps that
54    don't accept this or check-type on lisps that do. Probably the former
55    is better since on lispworks/x86 double == float.
57 ### Possible Optimizations
59 -> More compiler macros on some of the CFFI-SYS implementations.
60 -> Optimize UFFI-COMPAT when the vector stuff is implemented.
61 -> Being able to declare that some C int will always fit in a Lisp
62    fixnum. Allegro has a :fixnum ftype and CMUCL/SBCL can use
63    (unsigned-byte 29) others could perhaps behave like :int?
64 -> An option for defcfun to expand into a compiler macro which would
65    allow the macroexpansion-time translators to look at the forms
66    passed to the functions.
68 ### Known Issues
70 -> CLISP FASL portability is broken. Fix this by placing LOAD-TIME-VALUE
71    forms in the right places and moving other calculations to load-time.
72    (eg: calculating struct size/alignment.) Ideally we'd only move them
73    to load-time when we actually care about fasl portability.
74      (defmacro maybe-load-time-value (form)
75        (if <we care about fasl portability>
76            `(load-time-value ,form)
77            form))
78 -> cffi-tests.asd's :c-test-lib component is causing the whole testsuite
79    to be recompiled everytime. Figure that out.
80 -> The (if (constantp foo) (do-something-with (eval foo)) ...) pattern
81    used in many places throughout the code is apparently not 100% safe.
82 -> On ECL platforms without DFFI we need to build a non-linked version
83    of libtest.
84 -> foreign-enum-keyword/value should have their own error condition?
85    <http://article.gmane.org/gmane.lisp.cffi.devel/975> [2007-02-22 LO]
87 ### Documentation
89 -> Fill the missing sections in the CFFI User Manual.
90 -> Update the CFFI-SYS Specification.
91 -> have two versions of the manual on the website
93 ### CFFI-Grovel
95 -> Look into making the C output more concise.
97 ### Other
99 -> Type-checking pointer interface.