• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    Scheme
  • License
    MIT License
  • Created almost 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A binary interface let Chez Scheme use Python, Lua, Ruby etc's library

Darkart: Chez Scheme's Forign Library Interface

A binary interface let Chez Scheme use Python, Lua, Ruby etc's library

This project is inspired by the Julia language. The FFI interface provided by Chez is used to embed the interpreter or JIT compiler of other languages into the Scheme program (CPython, Luajit etc) or to link the compiled object code with the C binary interface. (OCaml, Golang etc).

This library can be ported to other Scheme implementations, with r6rs-pffi.

Priority: Python โœ… > Julia โœ… > Javascript > OCaml > lua โœ…

Ecosystem: NumPy โœ… SciPy ๐Ÿšง SymPy ๐Ÿšง Matplotlib โœ… Pandas ๐Ÿšง

Exemple

(define np (py-import 'numpy))
(define ndarray (py-get np 'ndarray))
(define pi (py-get np 'pi))
(define np-array (py-func np 'array))
(define np-sin (py-func np 'sin))
(define np-tolist (py-func ndarray 'tolist))

(define get-sin
  (lambda (lst)
    (plist->list
      (np-tolist
        (np-sin
          (py-div
            (py-mul pi 
              (np-array
                (list->plist lst)))
            (int 180)))))))

(get-sin '(1 2 3 4 5 6 7 8))

=>
(0.01745240643728351 0.03489949670250097 0.05233595624294383 0.0697564737441253 
0.08715574274765817 0.10452846326765346 0.12186934340514748 0.13917310096006544)

Manual

The ecosystem which base on Darkart:

https://guenchi.github.io/NumPy

https://guenchi.github.io/SciPy

https://guenchi.github.io/SymPy

https://guenchi.github.io/Matplotlib

https://guenchi.github.io/Pandas

(which is more python library binding exemples)

Sources:

https://github.com/JuliaPy/PyCall.jl/blob/master/src/PyCall.jl

https://docs.python.org/3.7/c-api/index.html

https://docs.python.org/2.5/ext/callingPython.html

http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.html

http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual033.html#htoc281

Deprecated attempt:

โ€  https://github.com/guenchi/Darkart/tree/deprecated

More Repositories

1

Raven

Raven is a Package Manager for Chez Scheme
Scheme
120
star
2

Igropyr

a async http server base on libuv for Chez Scheme
C
115
star
3

Schemacs

Emacs implementation on Chez Scheme
Scheme
62
star
4

CSUG

Chez Scheme Version 9 User's Guide - Zhcn
61
star
5

json

a portable, powerful and pure functional JSON library for Scheme
Scheme
48
star
6

Scheme

Scheme Related Papers
44
star
7

TSPL

The Scheme Programming Language - ZhCN
42
star
8

Catapult

a Web framework for Igropyr (Chez Scheme http-server)
Scheme
34
star
9

match

Pattern-Matching written by Dan Friedman, Erik Hilsdale and Kent Dybvig
Scheme
29
star
10

ChezJS

Compile JavaScript to Native Code
Scheme
28
star
11

Core

Scheme's commonly used small functions
Scheme
27
star
12

Matplotlib

Matplotlib for Chez Scheme
Scheme
26
star
13

Ballista

a Express style webframework for Igropyr (Chez Scheme http-server)
Scheme
22
star
14

NumPy

NumPy for Chez Scheme
Scheme
19
star
15

SWL

The Scheme Widget Library (SWL) is a windowing and graphics package for Chez Scheme
Scheme
19
star
16

setup-scheme

Github Actions CI / CD setup for Scheme
JavaScript
15
star
17

Quantum

A lambda calculus for quantum computation
Scheme
12
star
18

AISI

An Introduction to Scheme and its Implementation - Zhcn
12
star
19

Liber

Liber is a template parser for Scheme List to HTML
Scheme
11
star
20

Tensorflow

Scheme language bindings for TensorFlow
Scheme
10
star
21

jwt

Json Web Token for Chez Scheme
Scheme
9
star
22

SciPy

SciPy for Chez Scheme
9
star
23

ChezLispMachine

Lisp Machine base on Chez Scheme
Assembly
8
star
24

clos.js

CLOS JavaScript Implementation
JavaScript
8
star
25

Pandas

Pandas for Chez Scheme
8
star
26

SymPy

SymPy for Chez Scheme
7
star
27

TDCS

The Development of Chez Scheme - Zhcn
6
star
28

guenchi.github.io

5
star
29

Node.sc

Scheme to JavaScript Compiler with readable generated code
5
star
30

lisp.js

JavaScript
4
star
31

SDFF

Software Design For Flexibility - cn
4
star
32

conlang-nanopass-compiler

A compiler to help creating constructed language
3
star
33

glacier

Easy interface for AWS s3 glacier
Scheme
2
star
34

ThosePits

้‚ฃไบ›ๅนดๆˆ‘ไปฌ่ถŸ่ฟ‡็š„ๅ‘
2
star
35

fs-fatfs

FAT filesystem library in R6RS Scheme
Scheme
1
star
36

skill_tree_scheme

Python
1
star
37

neuro-lambda

Simulation of Natural Neural Structure
Scheme
1
star
38

language-creating

A demonstration of language creating
1
star