2 History and Overview of D programming language
2 History and Overview of D programming language
Group 16
C standard library ‘stdio.h’ provides basic functionalities like I/O operations, memory
management, and string manipulation while D standard library offers wide
functionalities including I/O operations (‘std.studio’), concurrency (‘core.thread’) and
more.
Additional libraries for C standard library for specific tasks need to be included
explicitly but D’s standard library is more extensive and modern providing higher-
level abstractions and utilities.
C programming language print statement ‘printf()’ function is used to output to the
console while in D programming language, ‘writefln()’ function is used for formatted
output.
Both C and D programming languages use third-party libraries for database connectivity
In C, third party libraries such as MySQL Connector/C, OBDC and PostgreSQL libpq are
used. For example using MySQL Connector/C, you can connect to a MySQL database by
establishing a connection with mysql_real_connect().
In D, Database connectivity is made easier with Vibe.d, which makes it easier to access
databases in your backend services. MongoDB and Redis support come directly with vibe.d.
Access to MongoDB is modelled around the class MongoClient. Implementation doesn’t
have external dependencies and is implemented using vibe.d’s asynchronous sockets.
D also supports MySQL and Postgresql
Compilers for D include:
DMD (Digital Mars D)
GDC (GNU D Compiler)
LDC (LLVM D compiler)
Compilers for C include:
Turbo C
Clang
GNU CCompiler
scanner.close();
}
}
while In D, input handling can be achieved using the ‘std.stdio’ module, which
provides functions like ‘readln’ for reading input from the console.
Example:
import std.stdio;
void main() {
write("Enter your name: ");
auto name = readln().chomp;
Print Statements
System.out.println(“This is a print statement in Java”);
COMMENTS
Comments in java can be single line or multi line
Database Connectivity
Java has its in-built database connectivity which is Java Database Connectivity
System.out.println("Hello,
" + name + "!");
scanner.close();
}
}
2.4 Dlang and C++
Input Statement:
In C++, reading input from the user typically involves using the cin object from the
<iostream> library and used with the extraction operator (>>)
Example:
#include <iostream>
#include <string>
Using namespace std;
Int main(){
string name
cin>>name;
return 0;
}
while In D, input handling can be achieved using the ‘std.stdio’ module, which
provides functions like ‘readln’ for reading input from the console.
Example:
import std.stdio;
void main() {
write("Enter your name: ");
auto name = readln().chomp;
int main() {
cout << "Hello, World!" << std::endl;
return 0;
}
Comments
Comments in C++ are used to explain code. There are single line comments and multi-line
comments which are like D.
Database Connectivity
Connecting a C++ program to a database involves using libraries that provide the necessary
functions to interact with the database. The most common libraries are MySQL and SQLite.
D C++
Input Statement:
Input statements can be used to get data from the user. There are two ways to handle input in
Visual Basic, the InputBox function and Input function for file input
Main Method:
In Visual Basic, the Main method is the entry point of a program. It is the starting point of an
application and can be used open databases and determine the form to load first. The main
method can be declared using the Sub Procedure or the Function Procedure.
Example
Module mainModule
Sub Main()
MsgBox(“Main Applicationn”)
End Sub
End Module
// main method
Imports System
void main() {
write("Enter your name: ");
auto name
Module = readln().chomp;
MainModule
Main Void main() Int main() Int main() Public Sub main()
Method static
void
main(Stri
ng[]
args)
Include import #include #include import import
Library
Print writeln("Hello, ", cout>>”Hello ” +
Statement name, "!"); printf("Wh name>>endl; System.o Console.Wr
} at is your ut.println iteLine($"W
name?"); ("Hello, elcome,
" + name {userName
+ "!"); }!")
Ataman, S. C., & Ataman, S. C. (2024, May 7). D Programming Language: a hidden gem |
https://www.codingandbeyond.com/2024/03/09/d-programming-language-a-hidden-
gem/#:~:text=The%20D%20programming%20language%20%28or%20sometimes
%20referred%20as,features%20from%20other%20languages%20like%20Java
%20and%20Python.
https://www.educative.io/answers/what-is-the-d-programming-language
manual.html
Itsourcecode. (2023, November 21). How to connect Access Database in VB.Net. Itsourcecode.com.
https://itsourcecode.com/tutorials/visual-basic-tutorial/connect-access-database-in-vb-net/
#google_vignette
Java Packages and How to import them? (n.d.).
https://www.programiz.com/java-programming/packages-import
https://en.cppreference.com/w/cpp/standard_library
KathleenDollard. (2021, September 15). Language reference - Visual basic. Microsoft Learn.
https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/