Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4099956
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:30:14+00:00 2026-05-20T20:30:14+00:00

Long-term C++ programmer (that’s me) exploring other languages and is wondering whether it is

  • 0

Long-term C++ programmer (that’s me) exploring other languages and is wondering whether it is worth learning much about D 2.0. (That is the clean slate re-write of D.) So far, I like what I see – many pragmatic, wise choices. Now, I want to learn a little more and want to know whether it is likely ever to be possible to do the following:

  1. Write some code in D 2.0. (Maybe it is a well-defined subset of D 2.0.)
  2. Compile the code from 1.
  3. Receive Javascript source code from the compiler.

In summary, I would like to have a D 2.0 compiler with a backend capable of generating Javascript.

So my question has two parts:

  1. Does such a compiler exist already?
  2. If such a compiler does not exist, and if I chose to implement one, where would be the best place to start?

For context, the reason that I would like the above is so that I could implement a bunch of business logic in D 2.0, and then use that business logic in a pure Javascript (that is no Flash/Silverlight/Java) Web Application.

Update

I have had three answers, two of which are on-topic, and one that is not and is therefore ignored.

@FeepingCreature reckons that it will never happen because “it’s too incongruous with D’s targeted environment”. I am interested to know what that means, and have asked.

@Nekuromento , in contrast, points out that it is already theoretically possible using LDC, followed by the LLVM Javascript backend. I checked out both links. LDC support for D 2.0 looks like a work in progress. But I would guess it will get there at some point. The LLVM Javascript is also not optimised or minified, but it looks from the demos that they work. So I think that is enough to be useful at the very least.

Update 2

OK – this seems to be the best solution to date.

  1. Invoke LDC. (@Nekuromento) LDC combines the Digital Mars front-end with an LLVM backend.
  2. Pipe the output from 1. through the LLVM Javscript backend. (@Nekuromento)
  3. Pipe the output from 2. though Closure (@BCS)

I will choose a best answer fairly soon, but I would like some more-informed opinion really.

Update 3

Some more information on why I want to do this.

Here is a concrete example of one project that I wish to implement. It will be a geometric modelling library, probably written by just me, taking several years to write, and ending up at about 100,000 lines of code. I would like it to contain as close to zero bugs as possible, and, therefore, I do not wish to implement it in Javascript. I would like it to run on the server, on the desktop, and in the browser too. (By in “in the browser” I mean without the assistance of any plugin such as Flash, Silverlight or Java.) The truth is that code in the browser running on Javascript is here to stay for a while. Projects will increasingly need a strategy to deal with that.

Update 4

I was hoping for some more answers, but didn’t get them. Ah well, never mind. Thanks for all the feedback, including @dsimicha ‘s stimulating comments. (I hope it is OK to disagree technically sometimes, while at the same time keeping things civil.) I have accepted @Nekuromento ‘s answer.

Update 5 2018-07-18

Seven years on, LDC v1.11 supports compiling and linking to WebAssembly.3

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:30:14+00:00Added an answer on May 20, 2026 at 8:30 pm

    Such a compiler currently does not exist, but there is some work on javascript LLVM-backend.

    As there is LDC. It uses DMD front-end and LLVM, so theoretically one can add javascript output to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering about the long term advantages (if any) of layering my web
I'm trying to set data in long-term storage in a GreaseMonkey script, except that
I need long-term working background agent in wp7. I know that default and maximum
I've inherited a long term maintenance code base that has two radically different iPhone
I'm about to start a long term windows application project but not sure which
It seems that Silverlight/WPF are the long term future for user interface development with
I've been working on a long-term project for over a year now and love
I am working on a long-term project for myself (for now!). I was thinking
Are there any good technical solutions for extremely long term archiving of data, for
I've got some long but simple loops in my Delphi program that may loop

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.