Проверить доступность сайта

CURL-запрос выполнен без ошибок.
Время распознавания ДНС-имени: 0.044996
IP-адрес сервера: 162.217.114.56
Время соединения с сервером: 0.189685
Время установления SSL-соединения: 0.483356
Время перед началом ответа: 0.628394
Общее время выполнения запроса: 0.775278
Код HTTP-ответа сервера: 200 ( Ok )
Принято байт всего: 47631
Код HTTP-ответа среди заданных: Да
Цепочка сертификатов:
- доверие к цепочке: Да
- даты сертификатов валидны: Да
- имя сервера в сертификате: Да

HTTP/1.1 200 OK
Date: Sat, 07 Feb 2026 23:50:28 GMT
Server: Apache/2.4.46 (FreeBSD) OpenSSL/1.0.2u-freebsd PHP/7.3.29
Strict-Transport-Security: max-age=63072000; includeSubDomains
Last-Modified: Thu, 15 Jan 2026 22:48:15 GMT
ETag: "b8ad-6487505330c17"
Accept-Ranges: bytes
Content-Length: 47277
Vary: Accept-Encoding
Content-Type: text/html

<!DOCTYPE html>
<html lang="en-US">
<!--
    Copyright (c) 1999-2026 by the D Language Foundation
    All Rights Reserved.
    https://dlang.org/foundation_overview.html
  -->
<head>
<meta charset="utf-8">
<meta name="keywords" content="D programming language">
<meta name="description" content="D is a general-purpose programming language with static typing, systems-level access, and C-like syntax.">
<title>Home - D Programming Language</title>

<link rel="stylesheet" href="css/codemirror.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/print.css" media="print">
<link rel="shortcut icon" href="favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0">
<style>        .why-d-icon {
            padding-right: 0.2em;
        }
        .call_to_donate
        {
            padding: 40px 140px;
        }
        .call_to_donate h2
        {
            text-align: center;
            margin: 0 0 20px 0;
        }
        .call_to_donate p
        {
            font-size: 14px;
            max-width: 1000px;
            margin: 20px auto;
        }
        .call_to_donate .btn
        {
            font-size: 16px;
            padding: 0.6em 1em;
        }
        a.call_to_donate_btn
        {
            background-color: #B03931;
            border-color: #98312A;
            color: white;
        }
        a.call_to_donate_btn:hover
        {
            background-color: #742620;
            border-color: #98312A;
            color: white;
        }
        #front-testimonial
        {
            display: inline-block;
            padding-top: 15px;
        }
        #front-testimonial-quote
        {
            padding-bottom: 10px;
            font-size: 16px;
        }

        body#Home #content > .intro #your-code-here
        {
            padding-left: 1em;
            position: relative;
            width: 32em;
            max-width: 32em;
        }

        body#Home #content > .intro #your-code-here .tip
        {
            position: absolute;
            top: 0.1em;
            right: 0.3em;
            z-index: 1;
        }

        body#Home #content #tools,
        body#Home #content > .intro
        {
            background: #F5F5F5;
        }

        body#Home #content > h1
        {
            margin: 0;
        }

        body#Home #content > .intro
        {
            padding: 1em 0 1em;
            border-bottom: 1px solid #E6E6E6;
        }

        body#Home #content > .intro > div > div
        {
            display: table;
            width: 100%;
        }

        body#Home #content > .intro > div > div > *
        {
            display: table-cell;
        }

        body#Home #content > .intro .pitch
        {
            font-size: large;
            font-weight: 300;
            margin: auto;
            width: 22em;
        }

        body#Home #content > .intro .download
        {
            margin-top: 3em;
            text-align: center;
        }

        body#Home #content > .intro .download .btn
        {
            margin: 0 0.3em 0.3em 0.3em;
        }

        body#Home #content > .intro .download .btn.action
        {
            border-color: #98312A;
            background-color: #B03931;
            color: white;
        }

        body#Home #content > .intro .download .btn.action:hover
        {
            border-color: #943029;
            background-color: #742620;
            color: white;
        }

        body#Home #content > .intro #your-code-here pre
        {
            margin: 0;
        }

        body#Home div#news
        {
            float: right;
            width: 252px;
        }

        body#Home div#forum-summary
        {
            color: white;
            width: 100%;
            margin-right: 1em;
        }

        body#Home div#forum-summary > iframe
        {
            border: 0;
            width: 100%;
            height: 210px;
        }

        body#Home .more .boxes, body#Home .more .whyd
        {
            margin-right: 252px; /* prevent overlapping with #news */
            padding-right: 4em;
        }

        body#Home .boxes .item .big-icon
        {
            padding-right: 0.5em;
        }

        body#Home .whyd .section
        {
            margin-bottom: 1.5em;
            border-left: 5px solid #B03931;
            border-radius: 4px;
        }
        body#Home .whyd .section > div
        {
            border: 1px solid #E6E6E6;
            border-left: none;
            border-top-right-radius: 4px;
            border-bottom-right-radius: 4px;
            padding: 1.5em;
        }
        body#Home .whyd .section > div > *:first-child
        {
            margin-top: 0;
        }
        body#Home .whyd .section > div > *:last-child
        {
            margin-bottom: 0;
        }

        body#Home > .container
        {
            max-width: none;
            padding: 0;
        }

        .org_list_header h3
        {
            margin: 1em 0 .5em;
        }

        .org_list
        {
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px 0;

            display: flex;
            align-items: center;
            flex-direction: row;
            justify-content: space-evenly;
            flex-wrap: wrap;
        }

        .org_list a img
        {
            max-width: 150px;
            max-height: 60px;
        }

        .org_list_footer
        {
            margin-bottom: 3em;
        }

        .org_list_footer a
        {
            display: inline-block;
            padding: 0;
        }
        .org_list_footer a:not(:last-child)
        {
            padding-right: 10px;
        }

        body#Menu #content li.expand-container a::after
        {
            content: "";
        }

        body#Menu #content li.expand-container ul
        {
            display: block;
        }

        /* Narrow layout stage 2: forum/twitter widgets disappear from
        the home page, intro pitch and your-code-here layed out vertically */
        @media only screen and (max-width:54em)
        {
            body#Home #content > .intro > div > div
            {
                display: block;
                width: auto;
            }

            body#Home #content > .intro > div > div > *
            {
                display: block;
            }

            body#Home #content > .intro .pitch
            {
                max-width: 22em;
                width: auto;
            }

            body#Home #content > .intro #your-code-here
            {
                padding: 0;
                margin: auto;
                margin-top: 2em;
            }

            body#Home #news
            {
                display: none;
            }

            body#Home .more .boxes, body#Home .more .whyd
            {
                margin-right: 0;
                padding-right: 0;
            }

            .org_list a img
            {
                padding: 1em 2em;
            }

            .call_to_donate
            {
                padding: 40px 80px;
            }
        }

        /* Narrow layout stage 3: no more two column boxes */
        @media only screen and (max-width: 40em)
        {
            body#Home #content > .intro #your-code-here
            {
                /* change width to max-width */
                width: auto;
                max-width: 32em;
            }

            body#Home #content > .intro #your-code-here .tip {
                display: none;
            }

            #your-code-here-select-example select {
                width: 100%;
            }

            .call_to_donate
            {
                padding: 5px;
            }
            .call_to_donate .call_to_donate_btn
            {
                margin-bottom: 0.75em;
            }
        }

    </style>
    
    <meta property="og:title" content="Home - D Programming Language" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://dlang.org/" />
    <meta property="og:image" content="https://dlang.org/images/dlogo_opengraph.png" />
    <meta property="og:description" content="D is a general-purpose programming language with static typing, systems-level access, and C-like syntax." />
</head>
<body id='Home' class='doc'>
<script type="text/javascript">document.body.className += ' have-javascript'</script>
<div id="top"><div class="helper"><div class="helper expand-container">    <div class="logo"><a href="."><img id="logo" alt="D Logo" src="images/dlogo.svg"></a></div>
    <a href="menu.html" title="Menu" class="hamburger expand-toggle"><span>Menu</span></a>
    
<div id="cssmenu"><ul>    <li><a href='https://tour.dlang.org'><span>Learn</span></a></li>
    <li class='expand-container'><a class='expand-toggle' href='documentation.html'><span>Documentation</span></a>
      
<ul class='expand-content'>    <li><a href='spec/spec.html'>Language Reference</a></li>
    <li><a href='phobos/index.html'>Library Reference</a></li>
    <li><a href='dmd.html'>Command-line Reference</a></li>
    <li class="menu-divider"><a href='comparison.html'>Feature Overview</a></li>
    <li><a href='articles.html'>Articles</a></li>
 </ul></li>
    <li><a href='download.html'><span>Downloads</span></a></li>
    <li><a href='https://code.dlang.org'><span>Packages</span></a></li>
    <li class='expand-container'><a class='expand-toggle' href='community.html'><span>Community</span></a>
      
<ul class='expand-content'>    <li><a href='https://dlang.org/blog'>Blog</a></li>
    <li><a href='orgs-using-d.html'>Orgs using D</a></li>
    <li><a href='https://twitter.com/search?q=%23dlang'>Twitter</a></li>
    <li class="menu-divider"><a href='https://discord.gg/bMZk9Q4'>Discord (community-run)</a></li>
    <li><a href='https://forum.dlang.org'>Forums</a></li>
    <li><a href='irc://irc.libera.chat/d'>IRC</a></li>
    <li><a href='https://wiki.dlang.org'>Wiki</a></li>
    <li class="menu-divider"><a href='bugstats.html'>Issues</a></li>
    <li><a href='contributing.html'>Contributing</a></li>
    <li class="menu-divider"><a href='foundation/contributors.html'>Contributors</a></li>
    <li><a href='foundation/index.html'>Foundation</a></li>
    <li><a href='/security.html'>Security Team</a></li>
    <li class="menu-divider"><a href='https://store.dlang.org/'>Store</a></li>
    <li><a href='foundation/donate.html'>Donate</a></li>
    <li><a href='foundation/sponsors.html'>Sponsors</a></li>
 </ul></li>
    <li class='expand-container'><a class='expand-toggle' href='resources.html'><span>Resources</span></a>
      
<ul class='expand-content'>    <li><a href='https://tour.dlang.org'>Tour</a></li>
    <li><a href='https://wiki.dlang.org/Books'>Books</a></li>
    <li><a href='https://wiki.dlang.org/Tutorials'>Tutorials</a></li>
    <li class="menu-divider"><a href='https://wiki.dlang.org/Development_tools'>Tools</a></li>
    <li><a href='https://wiki.dlang.org/Editors'>Editors</a></li>
    <li><a href='https://wiki.dlang.org/IDEs'>IDEs</a></li>
    <li><a href='https://run.dlang.io'>run.dlang.io</a></li>
    <li><a href='http://rainers.github.io/visuald/visuald/StartPage.html'>Visual D</a></li>
    <li class="menu-divider"><a href='acknowledgements.html'>Acknowledgments</a></li>
    <li><a href='dstyle.html'>D Style</a></li>
    <li><a href='spec/glossary.html'>Glossary</a></li>
    <li><a href='sitemap.html'>Sitemap</a></li>
 </ul></li>
</ul></div>
    <div class="search-container expand-container">        <a href="search.html" class="expand-toggle" title="Search"><span>Search</span></a>
        
    <div id="search-box">        <form method="get" action="https://google.com/search">
            <input type="hidden" id="domains" name="domains" value="dlang.org">
            <input type="hidden" id="sourceid" name="sourceid" value="google-search">
            <span id="search-query"><input id="q" name="q" placeholder="Google Search"></span><span id="search-dropdown"><span class="helper">                <select id="sitesearch" name="sitesearch" size="1">
                    <option value="dlang.org">Entire Site</option>
                    <option  value="dlang.org/spec">Language</option>
                    <option  value="dlang.org/phobos">Library</option>
                    <option  value="forum.dlang.org">Forums</option>
                    
                </select>
            </span></span><span id="search-submit"><button type="submit"><i class="fa fa-search"></i><span>go</span></button></span>
        </form>
    </div>
    </div>
</div></div></div>

<div class="container">    
    <div class="hyphenate" id="content">        
<div id="tools"><div >	<div class="tip smallprint">		<a href="https://github.com/dlang/dlang.org/issues/new?title=%5BHome%5D%20&amp;label=Severity:Enhancement">Report a bug</a>
		<div >			If you spot a problem with this page, click here to create a Bugzilla issue.
		</div>
	</div>
	<div class="tip smallprint">		<a href="https://github.com/dlang/dlang.org/edit/master/index.dd">Improve this page</a>
		<div >			Quickly fork, edit online, and submit a pull request for this page.
			Requires a signed-in GitHub account. This works well for small changes.
			If you'd like to make larger changes you may want to consider using
			a local clone.
		</div>
	</div>
</div></div>
        
        
        


<h1></h1>
<div class="intro"><div ><div >    <div >        <p class="pitch"><b>D</b> is a general-purpose programming language with
        static typing, systems-level access, and C-like syntax.
        With the <b>D Programming Language</b>, write fast,
        read fast, and run fast.
        <br><br>Fast code, fast.</p>

        <br>

        <div class="download">            <div class="btn-group-vertical">              <a href="download.html" class="btn">Downloads</a>
              <span class="smallprint">Latest version: 2.112.0
                  &ndash; <a href="changelog/2.112.0.html">Changelog</a></span>
            </div>
        </div>
    </div>
    <div id="your-code-here">        <div class="fa-select" id="your-code-here-select-example"></div>
        <div class="tip">            <a href="https://forum.dlang.org/newpost/general?subject=%5Byour+code+here%5D">your code here</a>
            <div >                <p>Got a brief example illustrating D?</p>
                <p>Submit your code to the digitalmars.D forum specifying
                    "[your code here]" in the subject.</p>
                <p>Upon approval it will be showcased here on a random schedule.</p>
            </div>
        </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Compute average line length for stdin</div>
        <div class="runnable-examples">
<code class="runnable-examples-stdin">The D programming language
Modern convenience.
Modeling power.
Native efficiency.</code>
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.range, std.stdio;

    <span class="d_keyword">auto</span> sum = 0.0;
    <span class="d_keyword">auto</span> count = stdin
        <span class="d_comment">//Get an input range set up to read one line at a time
</span>        .byLine
        <span class="d_comment">//Perform a transparent operation (as in the shell command tee)
</span>        .tee!(l =&gt; sum += l.length)
        .walkLength;

    writeln(<span class="d_string">"Average line length: "</span>,
        count ? sum / count : 0);
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Round floating point numbers</div>
        <div class="runnable-examples">
<code class="runnable-examples-stdin">2.4 plus 2.4 equals 5 for sufficiently large values of 2.</code>
<pre class="d_code notranslate"><span class="d_keyword">import</span> std.algorithm, std.conv, std.functional,
    std.math, std.regex, std.stdio;

<span class="d_keyword">alias</span> round = pipe!(to!<span class="d_keyword">real</span>, std.math.round, to!string);
<span class="d_keyword">static</span> reFloatingPoint = ctRegex!<span class="d_string">`[0-9]+\.[0-9]+`</span>;

<span class="d_keyword">void</span> main()
{
    <span class="d_comment">// Replace anything that looks like a real
</span>    <span class="d_comment">// number with the rounded equivalent.
</span>    stdin
        .byLine
        .map!(l =&gt; l.replaceAll!(c =&gt; c.hit.round)
                                (reFloatingPoint))
        .each!writeln;
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Sort lines</div>
        <div class="runnable-examples">
<code class="runnable-examples-stdin">Mercury
Venus
Earth
Mars
Jupiter
Saturn
Uranus
Neptune</code>
<pre class="d_code notranslate"><span class="d_keyword">import</span> std.stdio, std.array, std.algorithm;

<span class="d_keyword">void</span> main()
{
    stdin
        .byLineCopy
        .array
        .sort!((a, b) =&gt; a &gt; b) <span class="d_comment">// descending order
</span>        .each!writeln;
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Sort an Array at Compile-Time</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.algorithm, std.stdio;

    <span class="d_string">"Starting program"</span>.writeln;

    <span class="d_keyword">enum</span> a = [ 3, 1, 2, 4, 0 ];
    <span class="d_comment">// Sort data at compile-time
</span>    <span class="d_keyword">static</span> <span class="d_keyword">immutable</span> b = sort(a);

    <span class="d_comment">// Print the result _during_ compilation
</span>    <span class="d_keyword">pragma</span>(msg, <span class="d_string">"Finished compilation: "</span>, b);
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Invoke external programs</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.exception, std.stdio, std.process;

    <span class="d_keyword">auto</span> result = [<span class="d_string">"whoami"</span>].execute;
    enforce(result.status == 0);
    result.output.write;
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Print hex dump</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.algorithm, std.stdio, std.file, std.range;
    <span class="d_keyword">enum</span> cols = 14;
    <span class="d_comment">// Split file into 14-byte chunks per row
</span>    thisExePath.File(<span class="d_string">"rb"</span>).byChunk(cols).take(20).each!(chunk =&gt;
        <span class="d_comment">// Use range formatting to format the
</span>        <span class="d_comment">// hexadecimal part and align the text part
</span>        writefln!<span class="d_string">"%(%02X %)%*s  %s"</span>(
            chunk,
            3 * (cols - chunk.length), <span class="d_string">""</span>, <span class="d_comment">// Padding
</span>            chunk.map!(c =&gt; <span class="d_comment">// Replace non-printable
</span>                c &lt; 0x20 || c &gt; 0x7E ? '.' : <span class="d_keyword">char</span>(c))));
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Start a minimal web server</div>
        <pre class="d_code notranslate">#!/usr/bin/env dub
<span class="d_comment">/+ dub.sdl:
dependency "vibe-d" version="~&gt;0.9.0"
+/</span>
<span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> vibe.d;
    listenHTTP(<span class="d_string">":8080"</span>, (req, res) {
        res.writeBody(<span class="d_string">"Hello, World: "</span> ~ req.path);
    });
    runApplication();
}
</pre>

    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Initialize an Array in parallel</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.datetime.stopwatch : benchmark;
    <span class="d_keyword">import</span> std.math, std.parallelism, std.stdio;

    <span class="d_keyword">auto</span> logs = <span class="d_keyword">new</span> <span class="d_keyword">double</span>[100_000];
    <span class="d_keyword">auto</span> bm = benchmark!({
        <span class="d_keyword">foreach</span> (i, <span class="d_keyword">ref</span> elem; logs)
            elem = log(1.0 + i);
    }, {
        <span class="d_keyword">foreach</span> (i, <span class="d_keyword">ref</span> elem; logs.parallel)
            elem = log(1.0 + i);
    })(100); <span class="d_comment">// number of executions of each tested function
</span>    writefln(<span class="d_string">"Linear init: %s msecs"</span>, bm[0].total!<span class="d_string">"msecs"</span>);
    writefln(<span class="d_string">"Parallel init: %s msecs"</span>, bm[1].total!<span class="d_string">"msecs"</span>);
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Sort in-place across multiple arrays</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.stdio : writefln;
    <span class="d_keyword">import</span> std.algorithm.sorting : sort;
    <span class="d_keyword">import</span> std.range : chain;

    <span class="d_keyword">int</span>[] arr1 = [4, 9, 7];
    <span class="d_keyword">int</span>[] arr2 = [5, 2, 1, 10];
    <span class="d_keyword">int</span>[] arr3 = [6, 8, 3];
    <span class="d_comment">// @nogc functions are guaranteed by the compiler
</span>    <span class="d_comment">// to be without any GC allocation
</span>    () @nogc {
        sort(chain(arr1, arr2, arr3));
    }();
    writefln(<span class="d_string">"%s\n%s\n%s\n"</span>, arr1, arr2, arr3);
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Count frequencies of character pairs</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.stdio : writefln;
    <span class="d_comment">// An associative array mapping pairs of characters to integers
</span>    <span class="d_keyword">int</span>[<span class="d_keyword">char</span>[2]] aa;
    <span class="d_keyword">auto</span> arr = <span class="d_string">"ABBBA"</span>;

    <span class="d_comment">// Iterate over all pairs in the string
</span>    <span class="d_comment">// ['A', 'B'], ['B', 'B'], ..., ['B', 'A']
</span>    <span class="d_keyword">foreach</span> (i; 0 .. arr.length - 1)
    {
        <span class="d_comment">// String slicing doesn't allocate a copy
</span>        <span class="d_keyword">char</span>[2] pair = arr[i .. i + 2];
        <span class="d_comment">// count occurrences
</span>        aa[pair]++;
    }
    <span class="d_keyword">foreach</span> (key, value; aa)
        writefln(<span class="d_string">"key: %s, value: %d"</span>, key, value);
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Tiny RPN calculator</div>
        <div class="runnable-examples">
<code class="runnable-examples-stdin">2 3 3 4 + * *</code>
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.stdio, std.string, std.algorithm, std.conv;

    <span class="d_comment">// arr is real[] and sym is the current symbol
</span>    readln.split.fold!((arr, sym)
    {
        <span class="d_keyword">static</span> <span class="d_keyword">foreach</span> (c; <span class="d_string">"+-*/"</span>)
            <span class="d_keyword">if</span> (sym == [c])
                <span class="d_comment">// replace the last 2 elements with the binary op
</span>                <span class="d_keyword">return</span> arr[0 .. $-2] ~
                    <span class="d_keyword">mixin</span>(<span class="d_string">"arr[&dollar;-2] "</span> ~ c ~ <span class="d_string">" arr[&dollar;-1]"</span>);

        <span class="d_comment">// sym must be a number
</span>        <span class="d_keyword">return</span> arr ~ sym.to!<span class="d_keyword">real</span>;
    })((<span class="d_keyword">real</span>[]).init).writeln;
}
</pre>

</div>
    </div>
<div class="your-code-here-extra" style="display:none">
        <div class="your-code-here-title">Subtyping with alias this</div>
        <div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">struct</span> Point
{
    <span class="d_keyword">private</span> <span class="d_keyword">double</span>[2] p;
    <span class="d_comment">// Forward all undefined symbols to p
</span>    <span class="d_keyword">alias</span> p <span class="d_keyword">this</span>;
    <span class="d_keyword">double</span> dot(Point rhs)
    {
        <span class="d_keyword">return</span> p[0] * rhs.p[0] + p[1] * rhs.p[1];
    }
}
<span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.stdio : writeln;
    <span class="d_comment">// Point behaves like a `double[2]` ...
</span>    Point p1, p2; p1 = [2, 1], p2 = [1, 1];
    <span class="d_keyword">assert</span>(p1[$ - 1] == 1);
    <span class="d_comment">// ... but with extended functionality
</span>    writeln(<span class="d_string">"p1 dot p2 = "</span>, p1.dot(p2));
}
</pre>

</div>
    </div>

</div> 
</div></div></div> 


<script type="text/javascript">    (function() {
    // randomly pick one example and bootstrap the runnable editor
    var examples = document.getElementsByClassName('your-code-here-extra');
    var rouletteIndex = Math.floor(Math.random() * examples.length);
    var rouletteChild = examples[rouletteIndex];
    rouletteChild.style.display = "block";

    // build a list of the titles of all examples and add an option chooser to
    // allow switching between them
    var titles = Array.prototype.map.call(examples, function(e) {
        return e.getElementsByClassName("your-code-here-title")[0].innerText;
    });
    var sel = document.createElement("select");
    Array.prototype.forEach.call(titles, function(title, i) {
        var el = document.createElement("option");
        el.value = i;
        el.innerText = title;
        sel.appendChild(el);
    });
    sel.selectedIndex = rouletteIndex;
    sel.addEventListener("change", function(e) {
        examples[rouletteIndex].style.display = "none";
        rouletteIndex = sel.selectedIndex;
        examples[rouletteIndex].style.display = "block";
    });
    var selEl = document.getElementById("your-code-here-select-example");
    selEl.appendChild(sel);
    })();
</script>

<div class="call_to_donate">    <h2>Support the D language</h2>
    <p class="center">D is made possible through the hard work and dedication of many volunteers,
        with the coordination and outreach of the D Language Foundation, a 501(c)(3) non-profit organization.
        You can help further the development of the D language and help grow our
        community by supporting the Foundation.
    </p>
    <p class="center">
        <a href="foundation/donate.html" class="btn call_to_donate_btn">Donate</a>
        <a href="foundation/index.html" class="btn subdued">Learn More About The Foundation</a>
        <br>
        <br>
        Lots of <i class="fa fa-heart why-d-icon"></i> to our <a href="foundation/sponsors.html">sponsors</a> and
        <a href="foundation/contributors.html">contributors</a>.
    </p>
</div>

<div class="org_list_header">    <h3 class="center">
        Industry Proven
    </h3>
</div>

<div class="org_list">    <a href="https://medium.com/@NetflixTechBlog/introducing-vectorflow-fe10d7f126b8"><img src="images/orgs-using-d/netflix_small.png" /></a>
    <a href="https://dlang.org/blog/2017/05/24/faster-command-line-tools-in-d/"><img src="images/orgs-using-d/ebay.jpg" /></a>
    <a href="https://dconf.org/2019/talks/beer.html"><img src="images/orgs-using-d/funkwerk.png" /></a>
    <a href="https://dconf.org/2019/talks/colvin.html"><img src="images/orgs-using-d/symmetry.png" /></a>
    <a href="https://dlang.org/blog/2016/07/07/project-highlight-auburn-sounds/"><img src="images/orgs-using-d/auburn.png" /></a>
    <a href="https://dconf.org/2016/talks/zvibel.html"><img src="images/orgs-using-d/weka.png" /></a>
</div>

<div class="org_list_footer">    <div class="center">
        <div id="front-testimonial">
            <div id="front-testimonial-quote">
                <i class="fa fa-quote-left" aria-hidden="true"></i> D shines from low-level control
                to high-level abstraction <i class="fa fa-quote-right" aria-hidden="true"></i> <br>
            </div>
            <i class="fa fa-heart" aria-hidden="true"></i> <a href="orgs-using-d.html">Success stories</a>
            <i class="fa fa-history" aria-hidden="true"></i> <a href="areas-of-d-usage.html">What is D used for?</a>
        </div>
    </div>
</div>

<div class="more">
<div id="news">    <div id="forum-summary">    <iframe src="https://forum.dlang.org/frame-announcements"></iframe>
    <iframe src="https://forum.dlang.org/frame-discussions"></iframe>
    </div>
</div>

<div class="boxes">
    <div class="row">        <div class="item"><h4><i class="fa fa-newspaper-o big-icon"></i>News</h4>            <p>Stay updated with the latest posts in the
                <a href="http://blog.dlang.org">                    <cite>Official D Blog</cite></a> from February 22, 2024:
                <a href="https://dlang.org/blog/2024/02/22/dmd-compiler-as-a-library-a-call-to-arms/">DMD Compiler as a Library: A Call to Arms</a> by
                Razvan Nitu.
            </p>
            <p>                From October 2, 2023:
                <a href="https://dlang.org/blog/2023/10/02/crafting-self-evident-code-with-d/">Crafting Self-Evident Code with D</a> by
                Walter Bright.
            </p>
        </div>
        <div class="item"><h4><i class="fa fa-graduation-cap big-icon"></i>Learn</h4>            <p>Take the <a href="https://tour.dlang.org">                Tour</a>, explore
                <a href="overview.html">major features</a> in D,
                browse the <a href="comparison.html">quick overview</a>,
                start with <a href="ctod.html">C</a> or
                <a href="cpptod.html">C++</a> background,
                and ask questions in the
                <a href="https://forum.dlang.org/group/digitalmars.D.learn">                    Learn forum</a>.
            </p>
            <p>For a deeper dive into D
                check out <a href="https://wiki.dlang.org/Books">books</a> or
                <a href="https://wiki.dlang.org/Videos">videos</a>
                such as Ali Çehreli's free book
                <a href="http://ddili.org/ders/d.en/index.html">                <cite>Programming in D</cite></a>.
            </p>
        </div>
    </div>
    <div class="row">        <div class="item"><h4><i class="fa fa-comments big-icon"></i>Community</h4>            <p>Discuss D on the <a href="https://forum.dlang.org/">forums</a>, join
                the <a href="irc://irc.libera.chat/d">IRC channel</a>, read our
                <a href="https://dlang.org/blog">official Blog</a>, or follow us
                on <a href="https://twitter.com/D_Programming">Twitter</a>.
                Browse the <a href="https://wiki.dlang.org/">wiki</a>, where among
                other things you can find the
                <a href="https://wiki.dlang.org/Vision/2018H1">high-level vision</a>
                of the <a href="foundation_overview.html">D Language Foundation</a>.
            </p>
        </div>
        <div class="item"><h4><i class="fa fa-book big-icon"></i>Documentation</h4>            <p>Refer to the
                <a href="spec/spec.html">language specification</a> and
                the documentation of
                <a href="phobos/index.html">Phobos</a>, D's standard
                library. The
                <a href="dmd.html">DMD manual</a> tells you how
                to use the compiler. Read
                <a href="articles.html">various articles</a> to deepen
                your understanding.
            </p>
        </div>
    </div>
    <div class="row">        <div class="item"><h4><i class="fa fa-code-fork big-icon"></i>Contribute</h4>            <p>Report any bugs you find to our <a href="bugstats.html">                bug tracker</a>. If you can fix an issue, make a pull request on
                <a href="https://github.com/dlang">GitHub</a>.
                There are <a href="https://wiki.dlang.org/Get_involved">many other ways</a>
                to help, too!
            </p>
        </div>
        <div class="item"><h4><i class="fa fa-cubes big-icon"></i>Packages</h4>            <p>DUB is the package manager for D.
                <a href="https://code.dlang.org/getting_started">                    Get started with DUB</a>, and check out the
                <a href="https://code.dlang.org/">available packages</a>.
            </p>
        </div>
    </div>
    <div class="row">        <div class="item"><h4><i class="fa fa-play big-icon"></i>Run</h4>            <p>Configure linting,
                formatting or
                completion for
                your favorite <a href="https://wiki.dlang.org/IDEs">IDE</a>,
                <a href="https://wiki.dlang.org/Editors">editor</a> or
                use <a href="https://run.dlang.io">run.dlang.io</a> to play and experiment
                with D code.
            </p>
        </div>
        <div class="item"><h4><i class="fa fa-forward big-icon"></i>Explore</h4>            <p>                Learn about <a href="https://qznc.github.io/d-tut">pragmatic D</a>,
                the <a href="dstyle.html">DStyle</a>,
                <a href="https://p0nce.github.io/d-idioms">common D idioms</a> and
                <a href="https://github.com/PhilippeSigaud/D-templates-tutorial">templates</a>,

                See what's coming upcoming with <a href="changelog/pending.html">next version</a>,
                explore <a href="https://github.com/dlang/DIPs">D Improvement Proposals</a>,
                and don't fear <a href="https://dlang.org/blog/the-gc-series">D's garbage collection</a>.

            </p>
        </div>
    </div>
</div>

<div class="whyd"><h2>Fast code, fast.</h2>
<div class="section"><div ><h3><i class="fa fa-magic why-d-icon"></i> Write Fast</h3>
<p>D allows writing large code fragments without redundantly specifying types,
like dynamic languages do. On the other hand, static inference deduces types and other
code properties, giving the best of both the static and the
dynamic worlds. <a id="a1-control" class="example-control"></a><div id="a1" class="example-box"><div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">void</span> main()
{
    <span class="d_comment">// Define an array of numbers, double[].
</span>    <span class="d_comment">// Compiler recognizes the common
</span>    <span class="d_comment">// type of all initializers.
</span>    <span class="d_keyword">auto</span> arr = [ 1, 2, 3.14, 5.1, 6 ];
    <span class="d_comment">// Dictionary that maps string to int,
</span>    <span class="d_comment">// type is spelled int[string]
</span>    <span class="d_keyword">auto</span> dictionary = [ <span class="d_string">"one"</span> : 1, <span class="d_string">"two"</span> : 2,
        <span class="d_string">"three"</span> : 3 ];
    <span class="d_comment">// Calls the min function defined below
</span>    <span class="d_keyword">auto</span> x = min(arr[0], dictionary[<span class="d_string">"two"</span>]);
}
<span class="d_comment">// Type deduction works for function results.
</span><span class="d_comment">// This is important for generic functions,
</span><span class="d_comment">// such as min below, which works correctly
</span><span class="d_comment">// for all comparable types.
</span><span class="d_keyword">auto</span> min(T1, T2)(T1 lhs, T2 rhs)
{
    <span class="d_keyword">return</span> rhs &lt; lhs ? rhs : lhs;
}
</pre>


</div></div></p>

<p>Automatic memory management makes for safe, simple, and robust code.
D also supports scoped resource management (aka the
<a href="https://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization">RAII</a> idiom)
and <a href="spec/statement.html#ScopeGuardStatement"><span class="d_inlinecode">scope</span> statements</a> for
deterministic transactional code that is easy to write and read. <a id="a2-control" class="example-control"></a><div id="a2" class="example-box"><div class="runnable-examples">

<pre class="d_code notranslate"><span class="d_keyword">import</span> std.stdio;

<span class="d_keyword">class</span> Widget { }

<span class="d_keyword">void</span> main()
{
    <span class="d_comment">// Automatically managed.
</span>    <span class="d_keyword">auto</span> w = <span class="d_keyword">new</span> Widget;
    <span class="d_comment">// Code is executed in any case upon scope exit.
</span>    <span class="d_keyword">scope</span>(exit) { writeln(<span class="d_string">"Exiting main."</span>); }
    <span class="d_comment">// File is closed deterministically at scope's end.
</span>    <span class="d_keyword">foreach</span> (line; File(<span class="d_keyword">__FILE_FULL_PATH__</span>).byLine())
    {
        writeln(line);
    }
    writeln();
}
</pre>

</div></div>
</p>

<p>Built-in linear and associative arrays, slices, and ranges make daily
programming simple and pleasant for tasks, both small and large. <a id="a3-control" class="example-control"></a><div id="a3" class="example-box"><div class="runnable-examples">
<code class="runnable-examples-stdin">The D programming language
Modern convenience.
Modeling power.
Native efficiency.</code>
<pre class="d_code notranslate"><span class="d_comment">// Compute average line length for stdin
</span><span class="d_keyword">void</span> main()
{
    <span class="d_keyword">import</span> std.range, std.stdio;

    <span class="d_keyword">auto</span> sum = 0.0;
    <span class="d_keyword">auto</span> count = stdin.byLine
        .tee!(l =&gt; sum += l.length).walkLength;

    writeln(<span class="d_string">"Average line length: "</span>,
        count ? sum / count : 0);
}
</pre>

</div></div></p>

</div></div>

<div class="section"><div ><h3><i class="fa fa-rocket why-d-icon"></i> Read Fast</h3>
<p>The best paradigm is to not impose something at the expense of others.
D offers classic polymorphism, value semantics, functional
style, generics, generative programming, contract programming,
and more&mdash;all harmoniously integrated. <a id="a4-control" class="example-control"></a><div id="a4" class="example-box"><div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_comment">// Interfaces and classes
</span><span class="d_keyword">interface</span> Printable
{
   <span class="d_keyword">void</span> print(<span class="d_keyword">uint</span> level)
   <span class="d_comment">// contract is part of the interface
</span>   <span class="d_keyword">in</span> { <span class="d_keyword">assert</span>(level &gt; 0); }
}

<span class="d_comment">// Interface implementation
</span><span class="d_keyword">class</span> Widget : Printable
{
   <span class="d_keyword">void</span> print(<span class="d_keyword">uint</span> level)
   <span class="d_keyword">in</span>{ }
   <span class="d_keyword">do</span>{ }
}

<span class="d_comment">// Single inheritance of state
</span><span class="d_keyword">class</span> ExtendedWidget : Widget
{
   <span class="d_keyword">override</span> <span class="d_keyword">void</span> print(<span class="d_keyword">uint</span> level)
   <span class="d_keyword">in</span> { <span class="d_comment">/* weakening precondition is okay */</span>  }
   <span class="d_keyword">do</span>
   {
       <span class="d_comment">//... level may be 0 here ...
</span>   }
}

<span class="d_comment">// Immutable data shared across threads
</span><span class="d_keyword">immutable</span> string programName = <span class="d_string">"demo"</span>;
<span class="d_comment">// Mutable data is thread-local
</span><span class="d_keyword">int</span> perThread = 42;
<span class="d_comment">// Explicitly shared data
</span><span class="d_keyword">shared</span> <span class="d_keyword">int</span> perApp = 5;

<span class="d_comment">// Structs have value semantics
</span><span class="d_keyword">struct</span> BigNum
{
    <span class="d_comment">// intercept copying
</span>    <span class="d_keyword">this</span>(<span class="d_keyword">this</span>) { }
    <span class="d_comment">// intercept destructor
</span>    ~<span class="d_keyword">this</span>() { }
}

<span class="d_keyword">void</span> main()
{
    <span class="d_comment">// ...
</span>}
</pre>

</div></div></p>

<p>D offers an innovative approach to concurrency, featuring true
immutable data, message passing, no sharing by default, and
controlled mutable sharing across threads. <a href="http://informit.com/articles/article.aspx?p=1609144">Read more</a>.</p>

<p>From simple scripts to large projects, D has the breadth
to scale with any application's needs: unit testing,
information hiding, refined modularity, fast compilation, precise
interfaces. <a href="http://drdobbs.com/high-performance-computing/217801225">Read more</a>.</p>

</div></div>

<div class="section"><div ><h3><i class="fa fa-bolt why-d-icon"></i> Run Fast</h3>
<p>D compiles naturally to efficient native code.</p>

<p>D is designed such that most "obvious" code is fast <i>and</i>
safe. On occasion a function might need to escape the confines of type
safety for ultimate speed and control. For such rare cases D offers
native pointers, type casts, access to any C function without any
intervening translation, manual memory management, custom allocators
and even inline assembly code. <a id="a5-control" class="example-control"></a><div id="a5" class="example-box"><div class="runnable-examples">
<pre class="d_code notranslate"><span class="d_keyword">import</span> core.stdc.stdlib;

<span class="d_keyword">void</span> livingDangerously()
{
    <span class="d_comment">// Access to C's malloc and free primitives
</span>    <span class="d_keyword">enum</span> bytes = <span class="d_keyword">float</span>.sizeof * 1024 * 1024;
    <span class="d_keyword">auto</span> buf = malloc(bytes);
    <span class="d_comment">// free automatically upon scope exit
</span>    <span class="d_keyword">scope</span>(exit) free(buf);
    <span class="d_comment">// Interprets memory as an array of floats
</span>    <span class="d_keyword">auto</span> floats = <span class="d_keyword">cast</span>(<span class="d_keyword">float</span>[]) buf[0 .. bytes];
    <span class="d_comment">// Even stack allocation is possible
</span>    <span class="d_keyword">auto</span> moreBuf = alloca(4096 * 100);
    <span class="d_comment">//...
</span>}

<span class="d_comment">// Using inline asm for extra speed on x86
</span><span class="d_keyword">uint</span> checked_multiply(<span class="d_keyword">uint</span> x, <span class="d_keyword">uint</span> y)
{
    <span class="d_keyword">uint</span> result;
    <span class="d_keyword">version</span> (D_InlineAsm_X86)
    {
        <span class="d_comment">// Inline assembler "sees" D variables and labels.
</span>        <span class="d_keyword">asm</span>
        {
            mov     EAX,x        ;
            mul     EAX,y        ;
            mov     result,EAX   ;
            jc      Loverflow    ;
        }
        <span class="d_keyword">return</span> result;
    }
    <span class="d_keyword">else</span>
    {
        result = x * y;
        <span class="d_keyword">if</span> (!y || x &lt;= <span class="d_keyword">uint</span>.max / y)
           <span class="d_keyword">return</span> result;
   }
Loverflow:
   <span class="d_keyword">throw</span> <span class="d_keyword">new</span> Exception(<span class="d_string">"multiply overflow"</span>);
}

<span class="d_keyword">void</span> main()
{
    <span class="d_comment">// ...
</span>}
</pre>

</div></div></p>

<p>The <span class="d_inlinecode">@safe</span>, <span class="d_inlinecode">@trusted</span>, and <span class="d_inlinecode">@system</span> function
attributes allow the programmer to best decide the safety-efficiency
tradeoffs of an application, and have the compiler check for
consistency. <a href="spec/memory-safe-d.html">Read more</a>.</p>

</div></div>

</div> 
</div> 
 
 


        <div class="smallprint" id="copyright">Copyright &copy; 1999-2026 by the <a href="foundation_overview.html">D Language Foundation</a> | Page generated by
<a href="spec/ddoc.html">Ddoc</a> on Thu Jan 15 22:48:15 2026
</div>
    </div>
</div>

    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">window.jQuery || document.write('\x3Cscript src="js/jquery-1.7.2.min.js">\x3C/script>');</script>
    <script type="text/javascript" src="js/dlang.js"></script>
    
    <script type="text/javascript" src="js/codemirror-compressed.js"></script>
    <script type="text/javascript" src="js/run.js"></script>


    <script type="text/javascript" src="js/platform-downloads.js" data-latest="2.112.0"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
</body>
</html>