Add support table

This commit is contained in:
Retropikzel 2024-11-09 15:10:55 +00:00
parent 6a3899e622
commit 4011656805
2 changed files with 33 additions and 45 deletions

View File

@ -32,74 +32,64 @@ For status of what tests pass on which implementations see
- That is no stubs, no C code generated by the library and so on - That is no stubs, no C code generated by the library and so on
- The pffi library itself may require compilation on installation - The pffi library itself may require compilation on installation
## Known issues that are worked on
- Passing struct does not work on Chicken
- For example [SDL2-ttf TTF_RenderUTF8_Solid](https://wiki.libsdl.org/SDL2_ttf/TTF_RenderUTF8_Solid)
wants the color to be passed as struct.
- Not a problem on Guile, Sagittarius or Racket
- Cyclone status unknown, assumed same as Chicken
## Status ## Status
Currently the interface of the library is in okay shape. It propably will not change much but no Currently the interface of the library is in okay shape. It propably will not change much but no
guarantees are being made just yet. guarantees are being made just yet.
### Usable ## Implementation table
- [Guile](https://www.gnu.org/software/guile/) | Procedure | Chibi | Chicken | Cyclone | Gambit | Gauche | Gerbil | Guile | Kawa | Mosh | Racket | Sagittarius | Skint | STklos | tr7 |
- [Sagittarius](https://bitbucket.org/ktakashi/sagittarius-scheme/wiki/Home) | ------------------------------- | ----- | ------- | ------- | ------- | ------ | ------ | ----- | ---- | ---- | ------ | ----------- | ----- | ------ | --- |
- [Chicken 5](https://www.call-cc.org/) | pffi-init | X | X | X | | | | X | X | X | X | X | | | |
| pffi-size-of | X | X | X | | | | X | X | X | X | X | | | |
| pffi-shared-object-auto-load | X | X | X | | | | X | X | X | X | X | | | |
| pffi-shared-object-load | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-null | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-null? | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-allocate | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer? | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-free | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-set! | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer-get | X | X | X | | | | X | X | X | X | X | | | |
| pffi-string->pointer | X | X | X | | | | X | X | X | X | X | | | |
| pffi-pointer->string | X | X | X | | | | X | X | X | X | X | | | |
| pffi-define | X | X | X | | | | X | X | X | X | X | | | |
| pffi-define-callback | | X | | | | | X | | X | X | X | | | |
| pffi-pointer-address | | X | | | | | X | | | X | X | | | |
| pffi-pointer-dereference | | | | | | | X | | | X | X | | | |
### Usage notes
- Chibi
- Install libffi-dev
- Build with:
- chibi-ffi retropikzel/r7rs-pffi/r7rs-pffi-chibi.stub
- ${CC} -o retropikzel/r7rs-pffi/r7rs-pffi-chibi.so -fPIC -shared retropikzel/r7rs-pffi/r7rs-pffi-chibi.c -lchibi-scheme -lffi
- Chicken 5
- Needs [r7rs egg](https://wiki.call-cc.org/eggref/5/r7rs) - Needs [r7rs egg](https://wiki.call-cc.org/eggref/5/r7rs)
- [Racket](https://racket-lang.org/) - Racket
- Needs [racket-r7rs](https://github.com/lexi-lambda/racket-r7rs) - Needs [racket-r7rs](https://github.com/lexi-lambda/racket-r7rs)
- Kawa
### Work in progress
- [Cyclone](https://justinethier.github.io/cyclone/)
- TODO
- pffi-define-callback
- pffi-pointer-address
- pffi-pointer-dereference
- [STKlos](https://stklos.net/)
- [Kawa](https://www.gnu.org/software/kawa/index.html)
- TODO
- pffi-define-callback
- pffi-pointer-address
- pffi-pointer-dereference
- [STKlos](https://stklos.net/)
- Needs at least java version 22 - Needs at least java version 22
- Needs jvm flags: - Needs jvm flags:
- --add-exports java.base/jdk.internal.foreign.abi=ALL-UNNAMED - --add-exports java.base/jdk.internal.foreign.abi=ALL-UNNAMED
- --add-exports java.base/jdk.internal.foreign.layout=ALL-UNNAMED - --add-exports java.base/jdk.internal.foreign.layout=ALL-UNNAMED
- --add-exports java.base/jdk.internal.foreign=ALL-UNNAMED - --add-exports java.base/jdk.internal.foreign=ALL-UNNAMED
- --enable-native-access=ALL-UNNAMED - --enable-native-access=ALL-UNNAMED
- [STKlos](https://stklos.net/)
- [Mosh](https://mosh.monaos.org)
- TODO
- pffi-pointer-address
- pffi-pointer-dereference
- [STKlos](https://stklos.net/)
### Design/exploration ### Design/exploration/waiting for implementation features
- [Gambit](https://gambitscheme.org)
- [LIPS](https://lips.js.org/) - [LIPS](https://lips.js.org/)
- Will work on nodejs by using some Javascript FFI - Will work on nodejs by using some Javascript FFI
- Javascript side needs design - Javascript side needs design
- [Biwascheme](https://www.biwascheme.org/) - [Biwascheme](https://www.biwascheme.org/)
- Will work on nodejs by using some Javascript FFI - Will work on nodejs by using some Javascript FFI
- Javascript side needs design - Javascript side needs design
- [Chibi](https://synthcode.com/scheme/chibi)
- [MIT-Scheme](https://www.gnu.org/software/mit-scheme/) - [MIT-Scheme](https://www.gnu.org/software/mit-scheme/)
- [tr7](https://gitlab.com/jobol/tr7)
- [Gauche](https://practical-scheme.net/gauche/)
- [s7](https://scheme.fail://ccrma.stanford.edu/software/snd/snd/s7.html) - [s7](https://scheme.fail://ccrma.stanford.edu/software/snd/snd/s7.html)
- [Gerbil](https://cons.io/)
- Should be possible as built on gambit, but makes sense to make gambit support first
- [Ypsilon](http://www.littlewingpinball.com/doc/en/ypsilon/) - [Ypsilon](http://www.littlewingpinball.com/doc/en/ypsilon/)
- [Larceny](https://larcenists.org/) - [Larceny](https://larcenists.org/)
- [Skint](https://github.com/false-schemers/skint)
- [Airship](https://gitlab.com/mbabich/airship-scheme) - [Airship](https://gitlab.com/mbabich/airship-scheme)
- [Other gambit targets](https://gambitscheme.org/) - [Other gambit targets](https://gambitscheme.org/)
- Gambit compiles to different targets other than C too, for example Javascript. It would be cool - Gambit compiles to different targets other than C too, for example Javascript. It would be cool

View File

@ -62,6 +62,7 @@
(assert equal? (number? size-int8) #t) (assert equal? (number? size-int8) #t)
(assert = size-int8 1) (assert = size-int8 1)
#|
(define size-uint8 (pffi-size-of 'uint8)) (define size-uint8 (pffi-size-of 'uint8))
(debug size-uint8) (debug size-uint8)
(assert equal? (number? size-uint8) #t) (assert equal? (number? size-uint8) #t)
@ -225,7 +226,6 @@
(pffi-pointer-free pointer-to-be-freed) (pffi-pointer-free pointer-to-be-freed)
(debug pointer-to-be-freed) (debug pointer-to-be-freed)
#|
;; pffi-pointer-set! and pffi-pointer-get 1/2 ;; pffi-pointer-set! and pffi-pointer-get 1/2
(print-header "pffi-pointer-set! and pffi-pointer-get 1/2") (print-header "pffi-pointer-set! and pffi-pointer-get 1/2")
@ -349,7 +349,6 @@
(pffi-pointer-set! set-pointer 'pointer offset (pffi-string->pointer string-to-be-set)) (pffi-pointer-set! set-pointer 'pointer offset (pffi-string->pointer string-to-be-set))
(assert string=? (pffi-pointer->string (pffi-pointer-get set-pointer 'pointer offset)) "FOOBAR") (assert string=? (pffi-pointer->string (pffi-pointer-get set-pointer 'pointer offset)) "FOOBAR")
|#
;; pffi-define ;; pffi-define
(print-header 'pffi-define) (print-header 'pffi-define)
@ -364,7 +363,6 @@
(pffi-define atoi libc-stdlib 'atoi 'int (list 'pointer)) (pffi-define atoi libc-stdlib 'atoi 'int (list 'pointer))
(assert = (atoi (pffi-string->pointer "100")) 100) (assert = (atoi (pffi-string->pointer "100")) 100)
#|
;; pffi-define-callback ;; pffi-define-callback
(print-header 'pffi-define-callback) (print-header 'pffi-define-callback)