fut icon indicating copy to clipboard operation
fut copied to clipboard

[Language request] Please add D programmimng language

Open Teashrock opened this issue 3 years ago • 9 comments

D programming language is a low-level C++ rework with very convenient syntax, very fast compilation results, and clearly understandable code. It has the main features of C++, but they work in their own, programmer-friendly way. One can read about it here: https://dlang.org image

Teashrock avatar Oct 13 '21 06:10 Teashrock

cito used to have a D backend created by @epi. I expect that restoring it would be straightforward now that we have a testsuite.

pfusik avatar Oct 13 '21 07:10 pfusik

I AGREE

smokeytube avatar Oct 13 '21 09:10 smokeytube

I think JVM languages are better then D @smokeytube

d1snin avatar Oct 13 '21 09:10 d1snin

@d1snin D is a C-like language. You have just said that JVM languages are better than C-family.

Teashrock avatar Oct 13 '21 15:10 Teashrock

@Teashrock yes

d1snin avatar Oct 13 '21 15:10 d1snin

Please stay on topic. This is a reasonable request for a new backend. We have the Java backend already.

I owe you an explanation why there's no D backend at the moment. A few years ago cito underwent a complete rewrite to address language changes and better error reporting. Every backend requires some work and I chose to postpone the D backend.

I'd be happy to accept a pull request with a well-written GenD.cs. I can offer help implementing that. If you have experience with D, you can start by looking at how the other backends are implemented.

pfusik avatar Oct 13 '21 16:10 pfusik

@pfusik Ok, I can try...

Teashrock avatar Oct 14 '21 05:10 Teashrock

Great!

Start the implementation with:

public class GenD : GenTyped
{
}

and

case "d": gen = new GenD(); break;

in CiTo.cs.

You'll get compilation errors for abstract methods. Implement them and you'll have your first version of the backend.

Then add the test-d target in Makefile. make test-d to run the tests.

pfusik avatar Oct 14 '21 06:10 pfusik

I think JVM languages are better then D @smokeytube

заткнись ты, монументальный идиот

smokeytube avatar Oct 14 '21 10:10 smokeytube