forked from dlang/dlang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
areas-of-d-usage.dd
330 lines (285 loc) · 13.5 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
327
328
329
330
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, industry, industry)
$(START_ICONS_ENTRY Systems 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 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 industry)
$(DIVC area-section2,
$(P
Companies usually have codebases that are considerably larger than most
hobbyist projects, thus an important goal is to write elegant code
that is easy to understand, and therefore maintain. In comparison to other languages,
D has many features that help keep a codebase clean and
boilerplate-free - thus increasing $(LINK2 $(ROOT_DIR)overview.html#productivity, productivity).
Some examples of simple and yet powerful D features are
$(LINK2 https://dlang.org/spec/template.html, templates)
and $(LINK2 https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax, Uniform
Function Call Syntax).
)
$(P $(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) aid in
shipping a bug-free product.
If at the end of the day $(LINK2 $(ROOT_DIR)overview.html#performance, performance)
matters $(MDASH) D has you covered!
You can tune your code with tools starting from
$(LINK2 https://dlang.org/spec/version.html, conditional compilation) over
$(LINK2 https://dlang.org/spec/simd.html, SIMD vector optimizations) to
$(LINK2 https://dlang.org/spec/iasm.html, inline assembler),
and $(LINK2 https://wiki.dlang.org/Development_tools#Profiling, many more).
)
$(P D has been used in numerous diverse domains. A short selection is presented below.
For a complete overview, see the list of
$(LINK2 $(ROOT_DIR)orgs-using-d.html, organizations using the D Language).
)
)
$(AREA_SECTION3 $(LNAME2 games, Games), $(ARTICLE_FA_ICON gamepad),
Binary compatibility with 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).
Many pure-D open source projects show the rising popularity
of D among game developers.
Examples are the cross-platform 3D game engine
$(HTTP dash.circularstudios.com, Dash) and 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.
The $(HTTPS github.com/rejectedsoftware/vibe.d, vibe.d) framework is D's
flagship solution for all needs pertaining to networking and asynchronous
event handling.
For an example success story, see the DConf presentation
$(HTTPS www.youtube.com/watch?v=qimgioXwLUo, 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.
Some examples are the Linux tiling terminal emulator
$(HTTP github.com/gnunn1/tilix, tilix),
the D development environment
$(HTTPS github.com/buggins/dlangide, DLangIDE), which is itself based
on the cross-platform D library $(HTTPS github.com/buggins/dlangui, dlangui).
Thanks to binary compatibility, all existing GUI libraries written in C, C++,
and other languages can 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 is used in the reference DMD compiler itself, Facebook's fast C/C++ preprocessor
$(HTTPS github.com/facebookarchive/warp, warp), the $(HTTPS github.com/higgsjs/Higgs,
Higgs JavaScript Virtual Machine), and more.
D's compile time function execution allows generating 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 is well suited for bare metal
or kernel development. It's easy to write an Operating System in D, and many
project have proven so. To name a few:
$(UL
$(LI $(HTTPS github.com/Vild/PowerNex, PowerNex) - A kernel written in D)
$(LI $(HTTPS github.com/xomboverlord/xomb/tree/unborn, XOmB) - Exokernel operating system)
$(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) (the LLVM D compiler)
enables targeting most popular CPU architectures,
starting from ARM and MIPS-based embedded systems and smartphones,
ranging to server systems based on POWER and Sparc, and up to the "big iron" z Systems.
))
$(SECTION2 $(LNAME2 cutting-edge, Cutting-edge research), $(SECTION_FA_ICON space-shuttle)
$(DIVC area-section2,
D is similar to popular scientific languages like Python in that it provides
the conveniences of a modern language with a friendly syntax, and is
garbage collected by default. Convenience features allow spending time on rapid prototyping,
rather than fighting memory issues that few scientific programmers need to worry about.
However, it is also a compiled, statically typed language that can produce code as fast as C,
allows easily parallelizing algorithms and pipelines,
and, as a system language, provides complete control (including manual memory management)
to get those last few extra cycles.
A few specific spotlights:
)
$(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 its compile-time introspection capabilities, D enables
further optimizations for superior performance. See Andrei's talk
$(HTTPS www.youtube.com/watch?v=AxnotgLql0k, Fastware) on this topic.
There is excellent support for multidimensional arrays with third-party libraries
such as $(HTTPS github.com/libmir/mir-algorithm, 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 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 execution 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 of data for
an analysis, and easily switch to the full set by enabling optimizations
for superior performance.
Read Adroll's testimonial
$(HTTP tech.adroll.com/blog/data/2014/11/17/d-is-for-data-science.html, "D is for Data Science")
on why D is a keystone language for their critical infrastructure.
eBay recently open-sourced their internal $(HTTPS github.com/eBay/tsv-utils, data processing utilities)
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 teaching in one language and gradually
explaining new features without needing to switch to a different language.
)
$(P At universities, interpreted languages are commonly taught because of their memory safety.
$(LINK2 $(ROOT_DIR)safed.html, SafeD), a memory-safe subset of D, provides
safety and ease of use comparable to interpreted and JIT-compiled languages
while retaining the efficiency of native code.
Beginners will also benefit from garbage collection, which helps
write simple code without requiring any knowledge of explicit memory management.
$(LINK2 $(ROOT_DIR)phobos/std_experimental_allocator.html, More sophisticated memory management) can be introduced in an advanced
learning stage.
)
$(P D's blazingly fast compilation allows it to be used as a high level,
productive scripting language, but with the
advantages of $(I static) type checking.
)
$(P Last but not least, there are $(LINK2 http://ddili.org/ders/d.en/index.html,
books) and $(LINK2 https://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 $+)
COLON=:
_= Single word inline CSS needs to be escaped _=
EXTRA_HEADERS=$(T style,
.start-icons {
text-align: center;
padding-bottom: 30px;
padding-top: 20px;
}
.start-icons-el > div {
hyphens: none;
margin: 0 -1em;
text-align: center;
}
.start-icons-el {
vertical-align: top;
display: inline-block;
padding-right: 5%;
padding-bottom: 20px;
font-size: 1.2em;
width: 100px;
}
.start-icons i {
font-size: 80px;
padding-bottom: 10px;
}
h2 {
padding-top: 1.0em;
}
h2 a$(COLON)hover$(COLON)$(COLON)after {
content: '' !important;
}
@media only screen and (min-width: 50em)
{
.area-section3, .area-section2 {
padding-left: 120px;
}
}
.fa.article-icon, .fa.section-icon {
float: left;
padding-right: 15px;
font-size: 80px;
width: 100px;
text-align: center;
padding-bottom: 15px;
}
@media only screen and (max-width: 50em)
{
.fa.article-icon, .fa-section-icon {
font-size: 60px;
width: 80px;
}
#dman {
height: 200px;
}
}
@media only screen and (max-width: 30em) {
.page-contents {
width: 80%;
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;
}
}
h2 {
text-align: center;
}
)