Skip to content

Commit 3209714

Browse files
committed
Merge pull request #494 from alexrp/hacking
Add a HACKING file.
2 parents 1b6a1f4 + 46d5b55 commit 3209714

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

HACKING

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
DRuntime: Runtime Library for the D Programming Language
2+
========================================================
3+
4+
This is a collection of things that people hacking on
5+
DRuntime will want to know.
6+
7+
Code style
8+
----------
9+
10+
Please follow the D style guide when writing code for
11+
DRuntime: http://dlang.org/dstyle.html
12+
13+
The D style guide doesn't cover everything so when in
14+
doubt, use the code style already used in the module you
15+
are modifying, or whatever style you prefer if you're
16+
adding a new module.
17+
18+
Publicity of modules
19+
--------------------
20+
21+
In general, only modules in the 'core' package should be
22+
made public. The single exception is the 'object' module
23+
which is not in any package.
24+
25+
The convention is to put private modules in the 'rt' or
26+
'gc' packages depending on what they do and only put
27+
public modules in 'core'.
28+
29+
Also, always avoid importing private modules in public
30+
modules. If a public module consists of a header file
31+
and an implementation file (which are both maintained by
32+
hand) then it is OK to import private modules in the
33+
implementation file.
34+
35+
Adding new modules
36+
------------------
37+
38+
When adding a new module, remember to update all three
39+
makefiles as necessary:
40+
41+
* posix.mak
42+
* win32.mak
43+
* win64.mak
44+
45+
A number of shared utility makefiles also need to be
46+
updated:
47+
48+
* mak/COPY
49+
* mak/DOCS
50+
* mak/IMPORTS
51+
* mak/MANIFEST
52+
* mak/SRCS
53+
54+
Operating system bindings
55+
-------------------------
56+
57+
The 'core.sys' package provides bindings to most APIs
58+
provided by supported operating systems.
59+
60+
The convention is to have OS-specific stuff in a
61+
'core.sys.os' package where 'os' is the canonical name
62+
for the OS (e.g. 'linux', 'osx', 'windows').
63+
64+
There is also the 'core.sys.posix' package in which
65+
bindings to standardized POSIX APIs should be placed.
66+
In this package, the convention is to put declarations
67+
in sections based on the OS being compiled for. See
68+
src/core/sys/posix/pwd.d for an example of how these
69+
modules are arranged.
70+
71+
For all OS headers, it's a good idea to put a version
72+
attribute at the top of the file containing the OS
73+
the header is intended for. For example, in POSIX
74+
modules, this would be 'version (Posix):' while in
75+
Windows modules it would be 'version (Windows):' and
76+
so on.
77+
78+
The convention is to have a D module per C header.
79+
80+
C99 bindings
81+
------------
82+
83+
The 'core.stdc' package provides bindings to all C99
84+
library types, functions, and macros. Unlike the style
85+
in operating system bindings, bindings here should be
86+
kept system-agnostic whenever possible.
87+
88+
Deprecation process
89+
-------------------
90+
91+
Never remove a symbol without going through the proper
92+
deprecation process.
93+
94+
When, for whatever reason, a symbol is to be deprecated,
95+
annotate it as such using the 'deprecated' attribute. It
96+
is a good idea to also provide a message on the attribute
97+
so that the user can immediately see what symbol they
98+
should use instead.
99+
100+
After six months of having been deprecated, a symbol can
101+
be removed completely. It may also be kept around for
102+
backwards compatibility if deemed necessary.
103+
104+
ABI breakage
105+
------------
106+
107+
We're trying to get to a point where DRuntime's ABI is
108+
completely stable and different compiler versions can
109+
use different DRuntime versions. To this end, avoid
110+
making ABI-breaking changes unless you have a *very*
111+
good reason to do it.
112+
113+
Remember that renaming a symbol and leaving an alias
114+
behind for the old symbol name *is* an ABI break. The
115+
compiled name will be the new symbol, thus breaking old
116+
binaries.
117+
118+
Updating the change log
119+
-----------------------
120+
121+
It's a good idea to not update the change log in a pull
122+
request. It tends to create merge conflicts between
123+
pull requests more often than not.
124+
125+
That said, an occasional pull request to update the
126+
change log with recent changes (i.e. in a batch) is OK.

LICENSE

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
DRuntime: Runtime Library for the D Programming Language
2+
========================================================
3+
14
Boost Software License - Version 1.0 - August 17th, 2003
25

36
Permission is hereby granted, free of charge, to any person or organization

README

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Features
2323
The runtime library provides the following:
2424

2525
* The Object class, the root of the class hierarchy.
26+
* Implementations of array operations.
2627
* The associative array implementation.
2728
* Type information and RTTI.
2829
* Common threading and fiber infrastructure.
@@ -32,11 +33,14 @@ The runtime library provides the following:
3233
* Program startup and shutdown routines.
3334
* Low-level math intrinsics and support code.
3435
* Interfaces to standard C99 functions and types.
36+
* Interfaces to operating system APIs.
3537
* Atomic load/store and binary operations.
3638
* CPU detection/identification for x86.
3739
* System-independent time/duration functionality.
3840
* D ABI demangling helpers.
3941
* Low-level bit operations/intrinsics.
42+
* Unit test, coverage, and trace support code.
43+
* Low-level helpers for compiler-inserted calls.
4044

4145
Licensing
4246
---------

0 commit comments

Comments
 (0)