annotate README.txt @ 17:739c40f35a6a

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