Use Emacs to compile the D language program in Ubuntu

Source: Internet
Author: User
A very simple program, Hello, world1. download d-mode.elhttp: // prowiki.org/wiki4d/wiki.cgi? Put EditorSupport/EmacsDMode2. in your own directory, such as my/opt/emacs_plugins directory, and then in. configure the following in the emacs file: (load-file (expand-file-name "/opt/emacs_p

A very simple program, Hello, world

1. Download d-mode.el

Http://prowiki.org/wiki4d/wiki.cgi? EditorSupport/EmacsDMode

2. Put it in your own directory, such as my/opt/emacs_plugins directory,

Configure the following in the. emacs file:

(Load-file (expand-file-name "/opt/emacs_plugins/d-mode.el "))

Emacs needs to be restarted


3. Download the installation package under Ubuntu

Http://dlang.org/download.html

Double-click to install.


4. Create the hello. d file in emacs

The Code is as follows:

[Plain]

  1. Module hello;
  2. Import std. stdio;
  3. Void main ()
  4. {
  5. Writefln ("Hello, world! ");
  6. }
We can see that the advantages of the language after Java, such as module and import.

If the previous d-mode.el takes effect, you should be able to highlight and format the syntax.


5. Compile in shell

Dmd hello. d

Then run the generated hello program and output:

Hello, world!


My first D program was born.

No nonsense. It should look easy.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.