Everything you need to know to start with D.

April 5, 2022 0 Comments

Find out why Facebook uses a lot of D to code some of its key features.

D is a new programming language that is an object-oriented, essential, multi-paradigm system programming language. It started out as a re-engineering C ++, although over the years it has been redesigned to include features of modern day programming languages ​​such as Java, Python, Ruby, and C #. So you have the same performance as C ++, less vocal and memory safe but it has the expressive power of the modern language mentioned above. Work on the D began in 1999 when Walter Bright began by developing C ++ which lacked some examples, such as OOP (object oriented programming) and metaprogramming, which is the mainstay of modern programming languages. A functional language was created in 2001. However, in 2005 Walter Bright met Andrei Alexandrescu, who was also working on his own programming language (Enki). Both languages ​​had significant upgrades and seemed to solve each other’s problems. So they started working together and by 2007 D1 or D version 1.0 was born. By this time the language had already become seeds in the community and they had some changes of their own to add to the mix.

Learn the tutorial

(LR) D Producers – Walter Bright and Andrei Alexandrescu

Forbes which was D’s official runtime and standard library was not well received and the community came up with Tango to replace it. Tango focuses more on OOP and modularity. The existence of two libraries that were not compatible with each other early in the developmental cycle of a programming language would have been destructive spells, but it was not. D2 was published six months after D1 and unites the community in what can and cannot go in the original language. At some point in 2012, Tango was ported to D2. Soon enough D1 was sent to the grave and D2 was what was left and now he is only called D. If anyone can point out how D came out, you can say that C ++ is OK. .

Programming on D1 felt like you were programming using a low-level-based Python. The analogy may seem strange but you have the speed and focus on the work at hand instead of fixing the language aspects. D2 brings more features but it also buys more complexity which is C ++. Concurrency is a built-in feature for D2 and this is what makes D2 more popular among programmers. It is still evolving and a lot of people are giving up their preferred language for D.

Why D?

Let’s take a look at the programming examples for D. These relate to the style or method of creating functions and programs.

1. Essential
This instance brings it into the same league as C. Functions, statements, data and expressions work the same way they do in C. The differences include the ‘foreach’ loop which allows to create a loop on a collection and the function has a nested function. Other functions are designed in such a way that the internal function can access the variables of the external function.

2. Material-based
Object-oriented programming in D uses a single succession sequence. It does not have multiple legacy support, but it uses a Java-influenced interface.

3. Metaprogramming
Metaprogramming is obtained by combining tipple, template, string mix and compile time function execution.

4. Effective
Function literals (the ability to use an alternative syntax to define a function), closures, repeatable-immutable objects (whose position cannot be changed in repetition), and higher-order functions are supported in D.

5. Concurrent
Concurrency is when multiple instances of the same calculation process can occur simultaneously.

6. Memory secure programming
Functions can be marked with @safe to be checked by the compiler during compile so that they are not using any feature that could cause memory loss.

Learn the tutorial

Significant

Everyone who is developing their programming language wants to do something that has never been done before. D is no different … or is it? Modern languages ​​allow you to either write code faster or write code faster. Bringing the two approaches together has been a difficult task. And this is exactly what D decided to deal with. So it is written for the simplicity of programming while maintaining high execution speed. Another thing that makes Andrei (one of the creators) proud is D’s modeling ability. In detail, this means that programmers can easily replicate real-world problems in D. So everything from high volume transaction problems to automated sensors and spark plugs can be replicated in D. So simplicity allows the programmer to focus on the problem. A problem is not at hand with all the limitations around approaching.

Original recipient

Facebook
Yes, Big Blue actually hires Andrei Alexandrescu. Andrei, along with a team of programmers created some programs behind the world’s largest social network using Hack (another programming language) with D. For example, the program that goes through Facebook’s code to find errors was created using D and goes for the same preprocessor that generates the original code.

Social
Sociomatic is an advertising agency that Tesco recently acquired for $ 200 million and their entire operation was created using D.

ABA Games
Many games released by them use D1 which has been declared obsolete since 2012.

Remedy game
They’re the guys behind Max Payne, Max Payne 2, Alan Wake, Alan Wake’s American Nightmare, and they have a huge codebase written in D.

Learn the tutorial

Gives Get coding

So here’s how a simple program looks like D’s. You can type this in any text editor and rename the file so that it has the extension ‘.d’.

import std.stdio;

void main() {


writeln(“Hello World!”);}

Save the program (let’s call it hello.d), then navigate to the folder in a command prompt window and type “dmd hello.d”. Your console should have a new line that says “Hello World!”.

Curious? Here’s where you can find more:

http://dlang.org/download.html
http://dlang.org/spec.html
http://www.tutorialspoint.com/d_programming/index.htm
http://www.dprogramming.com/tutorial.php

Visit here for tutorials on the other 15 hot programming languages.

Leave a Reply

Your email address will not be published.