Questions tagged [ldc]

LDC is a compiler for the D programming language that uses the LLVM compiler infrastructure for the back end. The compiler front end is the same code as used in the DMD D compiler.

18 questions
6
votes
1 answer

ldc2 vs ldmd2 whats the difference?

I recently installed ldc through hombrew on my Mac and was testing out running a code as a script from the D wiki when I noticed that using ldmd2 to compile my program doesn't also run my program after. Whats the difference then since this is the…
Jem4687
  • 331
  • 1
  • 2
  • 17
5
votes
1 answer

How to pass object from D to C++?

I'm trying to make an interop with C++ and D. And the thing I've found today is really messing my mind: objects are not being passed correctly in my program. It's better to show an example. I have a C++ library, which I compile to an object file…
shybovycha
  • 11,556
  • 6
  • 52
  • 82
3
votes
1 answer

Ways to make a D program faster

I'm working on a very demanding project (actually an interpreter), exclusively written in D, and I'm wondering what type of optimizations would generally be recommended. The project makes heavy use of GC, classes, asssociative arrays, and pretty…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223
2
votes
1 answer

How does AVR support with LLVM work for different languages?

Apologies in advance since I am not too knowledgeable on the topic yet and still in the process of learning about the inner workings of compilers. I am currently investigating the possibility of using D in embedded systems and found an article…
dreanor
  • 45
  • 3
2
votes
1 answer

Where is D's `std.sumtype`?

I'm working on a project in the D language and I want to use a module from the standard library called std.sumtype. I'm on debian oldstable, and I've tried both GDC and LDC. DMD is unavailable, because I'm using a machine with an armhf architecture.…
VintiumDust
  • 95
  • 1
  • 6
2
votes
1 answer

d openssl aes encrypted byte array is not constant between executions

I am linking D to OpenSsl using the Deimos openssl headers for D and am using the ldc 1.8.0 compiler, to try to encrypt a string as a small test. The encrypted byte array isn't consistent with what I would expect. When I run the program and encrypt…
blipman17
  • 523
  • 3
  • 23
1
vote
1 answer

Arduino with adafruit RGBLCDShield Buttons weird behavior

I have the Arduino uno with rgb lcd shield. there is a very weird behavior with the buttons in one specific function. The function is called yes/no. It displays a message on the screen (working) the user can select answer yes/no with the buttons…
julian bechtold
  • 1,875
  • 2
  • 19
  • 49
1
vote
2 answers

Random segmentation fault in D lang on switch break

I was debugging a fairly simple program written in D, that seems to have a random chance to receive a SEGV signal. Upon further inspection I observed that using different compilers and build modes yielded different results. Results of my…
1
vote
1 answer

How do I use LDC (D Compiler) with Code::Blocks? Specifically, how do I use the linker?

I have been using CodeBlocks with the Digital Mars D compiler and the LLVM Clang compiler for some time without any problems. Now I need to use the LDC D compiler and am having problems with the linker invocation. I get the following…
V. V. Kozlov
  • 189
  • 2
  • 10
1
vote
2 answers

Do ldc and gdc support D language contracts?

This code with a contract: import std.stdio; int TestContract(int a) in { assert( a > 0); } do { return a + 1; } int main(string[] args) { auto a = 2; try { writeln(a," + 1 is ",TestContract(a)); a = -2; …
Scooter
  • 6,802
  • 8
  • 41
  • 64
1
vote
1 answer

How to not open a console when starting program written in D

I am writing an application in D. It's compiled with the ldc2 compiler, using dub configuration (target type: executable). The compiled program creates a console window, which I do not need since the application uses a GUI framework. I need a way to…
1
vote
4 answers

Dlang LLVM ERROR: Program used external function which could not be resolved

main.d import std.stdio; void main() { writeln("Hello World !!!"); } when i compile and execute it is work perfectly But when i try ldc2 -output-ll main.d lli main.ll LLVM ERROR: Program used external function '_d_throw_exception' which…
Barre_k
  • 23
  • 4
1
vote
1 answer

Which compiler to use when learning D?

I'm interested in learning D. However I'm a bit turned of by the DMD, because it is not fully opensource. This is why I am considering using the LDC, but I'm not sure what's it's status. In the debian package it says: Version: 1:0.14.0.dfsg-1 …
Stein
  • 3,179
  • 5
  • 27
  • 51
0
votes
1 answer

GCC, GDC, and LLVM and LDC compilers’ prefetch builtins - exact meaning of the locality parameter

In the description of the x86 prefetch instructions, I found the following explanation for the instructions’ hint number "Fetches the line of data from memory that contains the byte specified with the source operand to a location in the cache…
Cecil Ward
  • 597
  • 2
  • 13
0
votes
1 answer

how to properly build tilix?

I decided to build tilix by cloning the code from the repository. I understand that the compiler must be LDC, but I don’t know what exactly to change. dub build --build release But I stumbled upon the current…
1
2