comparison README.txt @ 0:0cfcc391201f

initial from svn dyncall-1745
author Daniel Adler
date Thu, 19 Mar 2015 22:26:28 +0100
parents
children 390380ef6362
comparison
equal deleted inserted replaced
-1:000000000000 0:0cfcc391201f
1 This document intends to layout a style to follow for language bindings,
2 depending on the nature of the language.
3
4
5 Naming
6 ------
7
8 If possible and no name clashes exist with other bindings, use the language's
9 shortest name or file suffix and append 'dc' or 'dyncall'. E.g.:
10 Ruby: rbdc
11 Go: godc
12 ...
13
14
15 Code style
16 ----------
17
18 * Imperative:
19
20 - Object oriented or prototype:
21
22 Create 2 objects, one as a handle to each external library (e.g. extlib), one as a handle to a callvm
23
24 - Without objects:
25
26 Wrap dyncall as close as direct
27
28 - Statically typed (and no direct way wrap types in a generic way and or RTTI):
29
30 Expose all dcArg, etc. calls
31 Expose formatted call ('...') if possible, but as ArgF (instead of CallF), b/c return type is statically typed
32
33 - with RTTI:
34
35 Write a single call function and let users pass arguments, directly - if needed for type-conversion, this
36 should be done via call signature
37
38
39
40 * Functional:
41
42 @@@ ToDo
43
44
45
46 * Other language features
47
48 - Namespaces/modules/packages
49
50 Use and name dyncall or dc (@@@ choose one)
51 Use casing depending on language requirements (e.g. 'Dyncall' for ruby as modules are const)
52
53 - Function overloading or default arguments
54
55 Use if available to define things like CallVM stack size; use independently named functions, otherwise
56