/
areas-of-d-usage.dd
326 lines (279 loc) · 13.7 KB
/
areas-of-d-usage.dd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
Ddoc
$(D_S $(TITLE),
$(DIVC page-contents quickindex,
$(DIVC page-contents-header,
$(H3 Contents)
)
$(OL
$(LI $(RELATIVE_LINK2 industry, Industry)) $(OL
$(LI $(RELATIVE_LINK2 games, Games))
$(LI $(RELATIVE_LINK2 web, Web applications))
$(LI $(RELATIVE_LINK2 gui, GUI applications))
)
$(LI $(RELATIVE_LINK2 system_programming, Systems programming)) $(OL
$(LI $(RELATIVE_LINK2 operating_systems, Operating systems))
$(LI $(RELATIVE_LINK2 compilers, Compilers))
$(LI $(RELATIVE_LINK2 embedded, Embedded applications))
)
$(LI $(RELATIVE_LINK2 cutting-edge, Cutting edge research)) $(OL
$(LI $(RELATIVE_LINK2 numerical, Numerical computing))
$(LI $(RELATIVE_LINK2 gpu, GPU programming))
$(LI $(RELATIVE_LINK2 data_science, Data science))
)
$(LI $(RELATIVE_LINK2 academia, Academia)) $(OL
$(LI $(RELATIVE_LINK2 teaching, Teaching))
)
)
)
$(DIVC start-icons,
$(START_ICONS_ENTRY Industry, building, industry)
$(START_ICONS_ENTRY System programming, gears, system-programming)
$(START_ICONS_ENTRY Research, flask, cutting-edge)
$(START_ICONS_ENTRY Academia, graduation-cap, academia)
)
$(DIV,
$(P This list highlights a selection of applications written in D from various areas.
For an overview of of D's differentiating features, have a look at the
$(LINK2 $(ROOT_DIR)overview.html, D Overview page).
)
)
$(DIV style="clear:both")
$(SECTION2 $(LNAME2 industry, Industry), $(SECTION_FA_ICON building)
$(DIVC area-section2,
$(P
Companies usually have codebases that are far larger than regular
hobby projects, hence one of their major aims is to write elegant code
that is easy to understand and hence to maintain. In comparison to other languages
like Java and C++, D has many features that help to keep a codebase clean and
boilerplate-free - thus allowing one to be $(LINK2 $(ROOT_DIR)overview.html#productivity, productive).
For example have a look at D's simple and yet powerful
$(LINK2 https://dlang.org/spec/template.html, templates)
or at D's $(LINK2 https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax, Uniform
Function Call Syntax) that allows any function to be called using the syntax
for method calls.
)
$(P Moreover $(LINK2 https://dlang.org/spec/function.html#pure-functions, pure functions),
the memory-safe subset $(LINK2 $(ROOT_DIR)safed.html, SafeD),
$(LINK2 $(ROOT_DIR)spec/unittest.html, special unittest blocks),
$(LINK2 $(ROOT_DIR)spec/contracts.html, contracts) and a sane approach to
$(LINK2 $(ROOT_DIR)spec/errors.html, error handling) help
shipping a bug-free program.
If at the end of the day $(LINK2 $(ROOT_DIR)overview.html#performance, performance)
matters $(MDASH) D has you covered!
You can tune your program with various tools starting from
$(LINK2 https://dlang.org/spec/version.html, conditional compilation) over
$(LINK2 https://dlang.org/spec/simd.html, SIMD vector optimizations) to
to $(LINK2 https://dlang.org/spec/iasm.html, Inline Assembler) and many more.
)
$(P D has been used in many, diverse domains. A short selection will be presented below.
For a full overview you can browse the list of reported
$(LINK2 $(ROOT_DIR)orgs-using-d.html, organizations which use the D Language).
)
)
$(AREA_SECTION3 $(LNAME2 games, Games), $(ARTICLE_FA_ICON gamepad),
Binary compatibility to existing libraries is important in large-scale
projects.
Remedy Entertainment has successfully shipped the first $(HTTP www.quantumbreak.com,
AAA game) to use D code for XBox One and Windows 10.
For more details see Ethan Watson's
$(HTTP dconf.org/2016/talks/watson.html, presentation).
There exist many pure D open source projects that show the rising popularity
of D among game developers.
For example have a look at the cross-platform 3D game engine
$(HTTP dash.circularstudios.com, Dash) or at the D game development toolkit
$(HTTPS github.com/d-gamedev-team/gfm, gfm).
)
$(AREA_SECTION3 $(LNAME2 web, Web applications), $(ARTICLE_FA_ICON cloud),
D's ability to combine low and high-level code in one language, asynchronous
features like Fibers and compile-time function execution makes it well suited
for high-performance asynchronous I/O, concurrency and web applications like
$(HTTPS github.com/rejectedsoftware/vibe.d, vibe.d).
As an example, have a look at this talk about a
$(HTTPS www.youtube.com/watch?v=_gCFpHxAJRc, mobile game server backend in D)
)
$(AREA_SECTION3 $(LNAME2 gui, GUI Applications), $(ARTICLE_FA_ICON desktop),
D's high productivity is also beneficial when creating GUI applications.
For example a popular application under Linux is the tiling terminal emulator
$(HTTP github.com/gnunn1/terminix, terminix),
another good example is the D development environment
$(HTTPS github.com/buggins/dlangide, DLangIDE) which is based
on the cross-platform D library $(HTTPS github.com/buggins/dlangui, dlangui).
Due to binary compatibility all existing GUI libraries can still be
$(HTTPS wiki.dlang.org/GUI_Libraries, easily accessed).
))
$(SECTION2 $(LNAME2 system-programming, Systems programming),
$(AREA_SECTION3 $(LNAME2 compilers, Compilers), $(ARTICLE_FA_ICON code),
$(P D has been used to write the D reference compiler dmd itself, Facebook's fast C/C++ preprocessor
$(HTTPS github.com/facebookarchive/warp, warp), the $(HTTPS github.com/higgsjs/Higgs,
Higgs Javascript Virtual Machine) and many more.
Moreover D's compile time function execution allows to generate custom grammar parsers
at compile time - see e.g. $(HTTPS github.com/PhilippeSigaud/Pegged, Pegged)
as an example.
)
)
$(AREA_SECTION3 $(LNAME2 operating_systems, Operating systems), $(ARTICLE_FA_ICON linux),
$(DIV,
D is a systems programming language and well suited for bare metal
or kernel development. It's easy to write an Operating System in D and many
project have proven so $(COMMA) to name a few:
$(UL
$(LI $(HTTPS github.com/xomboverlord/xomb/tree/unborn, XOmB) - Exokernel operating system)
$(LI $(HTTPS github.com/Vild/PowerNex, PowerNex) - A kernel written in D)
$(LI $(HTTPS github.com/Rikarin/Trinix, Trinix) - Hybrid operating system for x64 PC)
)
)
)
$(AREA_SECTION3 $(LNAME2 embedded, Embedded applications), $(ARTICLE_FA_ICON gears),
Using $(HTTPS github.com/ldc-developers/ldc, LDC) (with LLVM as backend)
enables one to target many CPU architectures,
ranging from ARM and MIPS-based embedded systems and smartphones
over server systems based on POWER and Sparc up to the "big iron" z System.
))
$(SECTION2 $(LNAME2 cutting-edge, Cutting-edge research), $(SECTION_FA_ICON space-shuttle)
$(DIVC area-section2,
D is similar to popular scientific languages like Python as it provides
the conveniences of a modern language with a friendly syntax and is
garbage collected by default, allowing you to worry about writing your program,
rather than handling memory issues that few scientific programmers need to worry about.
However it is is a compiled, statically typed language that can produce code as fast as C,
allows to easily parallelize your algorithm and pipelines,
and as a system language it gives complete control (including manual memory management)
if you need to squeeze the last few cycles out of your processor to make your program
even faster.
We now spotlight a few specific areas:
)
$(AREA_SECTION3 $(LNAME2 numerical, Numerical computing), $(ARTICLE_FA_ICON calculator),
Like NumPy, D is convenient and offers the ability to bind to existing C libraries.
Unlike NumPy, D does not become slow for computations not covered by preexisting libraries,
and does not force its user to escape into another language.
Additionally due to D's introspection at compile-time it enables
further optimizations for superior performance. See Andrei's talk
$(HTTPS www.youtube.com/watch?v=AxnotgLql0k, Fastware) on this topic.
D's standard library includes support for $(LINK2 $(ROOT_DIR)phobos/std_experimental_ndslice.html, multidimensional arrays)
with supplemental third-party libraries like $(HTTPS github.com/libmir/mir, mir).
)
$(AREA_SECTION3 $(LNAME2 gpu, GPU Programming), $(ARTICLE_FA_ICON flash),
For most programmers used to developing for a modern CPU,
working with GPUs for general purpose computation can appear daunting and laborious.
Even seasoned users will admit that the performance improvements are often not worth the extra effort.
Thanks to the power the power of D’s type system and static introspection,
$(HTTP dconf.org/2016/talks/colvin.html, GPU Programming) is
safer and easier to use than traditional APIs with no compromise in performance.
)
$(AREA_SECTION3 $(LNAME2 data_science, Data science), $(ARTICLE_FA_ICON area-chart),
D's high-level abstraction and fast runtime make it well-suited for scientific
analysis. For example $(LINK2 http://ddili.org/ders/d.en/ranges.html, D's ranges)
are a natural fit for pipes and data streams.
One can start from a small D script with a small subset to test
some analysis and easily switch to the full set by enabling optimizations
for superior performance.
Read Adroll's (Big data marketing company) testimonial
$(HTTP tech.adroll.com/blog/data/2014/11/17/d-is-for-data-science.html, "D is for Data Science")
which explains why D is a keystone language for their critical infrastructure.
eBay recently open-sourced their internal $(HTTPS github.com/eBay/tsv-utils-dlang, data processing utilities)
that are used in their large-scale data mining environment.
))
$(SECTION2 $(LNAME2 academia, Academia),
$(AREA_SECTION3 $(LNAME2 teaching, Teaching), $(ARTICLE_FA_ICON graduation-cap),
$(P D's multi-paradigm (imperative, structured, object oriented, generic, functional programming
purity, and even assembly) approach allows to teach in one language and gradually
explain new features without needing to switch to a different language.
)
$(P At universities Java is commonly taught because of its memory safety.
D has a memory-safe subset $(I $(LINK2 $(ROOT_DIR)/safed.html, SafeD))
which safety and ease of use is comparable to Java while still being efficient.
Beginners will also highly profit from the Garbage Collection in D which helps
them to write simple code without any memory management knowledge.
However more sophisticated memory management can easily be done in an advanced
learning stage.
)
$(P Moreover D's blazingly fast runtime allows it to be used as a high level,
productive scripting language - just like Python, but with the
advantage of getting $(I static) type checking.
This also means instead of using a toy language, students can use a real language
that provides all the advantages of multiple languages and enjoy playing with it.
)
$(P Last but not least there are $(LINK2 http://ddili.org/ders/d.en/index.html,
books) and $(LINK2 http://tour.dlang.org/, tutorials) freely available online
which can be used as resources.
)
))
)
Macros:
TITLE=Areas of D usage
ARTICLE_FA_ICON=<i class="fa fa-$1 article-icon" aria-hidden="true"></i>
SECTION_FA_ICON=<i class="fa fa-$1 section-icon" aria-hidden="true"></i>
START_ICONS_ENTRY=$(DIVC start-icons-el, $(LINK2 #$3, <i class="fa fa-$2" aria-hidden="true"></i>)$(DIV, $1))
AREA_SECTION_INLINE=$1 $(DIVC area-section3, $+)
AREA_SECTION3=$(TC h3, area-section3, $1) $(AREA_SECTION_INLINE $+)
_= Single word inline CSS needs to be escaped _=
C_A=$1:$2;
EXTRA_HEADERS=$(T style,
.start-icons {
text-align: center;
padding-bottom: 30px;
padding-top: 20px;
}
.start-icons-el {
vertical-align: top;
$(C_A display, inline-block)
padding-left: 10px;
padding-right: 5%;
padding-bottom: 20px;
font-size: 1.2em;
$(C_A width, 100px)
}
.start-icons i {
font-size: 80px;
padding-bottom: 10px;
}
h2 {
padding-top: 1.0em;
}
@media only screen and (min-width: 50em)
{
.area-section3, .area-section2 {
padding-left: 120px;
}
}
.fa.article-icon, .fa.section-icon {
$(C_A float, left)
padding-right: 15px;
font-size: 80px;
$(C_A width, 100px)
text-align: center;
padding-bottom: 15px;
}
@media only screen and (max-width: 50em)
{
.fa.article-icon, .fa-section-icon {
font-size: 60px;
$(C_A width, 80px)
}
#dman {
$(C_A height, 200px)
}
}
@media only screen and (max-width: 30em) {
.page-contents {
$(C_A width, 80%)
$(C_A margin, 0 auto)
margin-bottom: 1em;
}
}
@media only screen and (min-width: 30em) {
#dman {
margin-top: -80px;
}
}
@media only screen and (min-width: 45em) {
#dman {
margin-top: -200px;
}
}
@media only screen and (min-width: 66em) {
.start-icons {
text-align: right;
}
}
)