Re: #include C headers in D code

2018-04-13 Thread Petar via Digitalmars-d-announce

On Friday, 13 April 2018 at 10:31:43 UTC, Atila Neves wrote:
On Wednesday, 11 April 2018 at 14:33:26 UTC, Jacob Carlborg 
wrote:

On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote:
Here's my blog post about my project that allows directly 
#including C headers in D*


I don't know the exact details of your project but can't you 
just:


1. Copy the includes
2. Paste them into a C file
3. Run DStep on the C file
4. Replace the includes in the first file with the result from 
DStep


This would require changing DStep to always return `false` 
here [1]. Or perhaps run the preprocessor to expand the 
includes and then run DStep.


[1] 
https://github.com/jacob-carlborg/dstep/blob/master/dstep/translator/Translator.d#L326


--
/Jacob Carlborg


That wouldn't have the same semantics as I want.

I tried using dstep as a library. It didn't work.


You also mentioned this in the reddit thread, though I'm still 
curious to understand what's difference in the semantics between 
the approach you have taken and the approach Jacob proposed.


Munich D Meetup April 2018

2018-04-13 Thread Dragos Carp via Digitalmars-d-announce

Our next gathering will be on April 18th.
Stefan will introduce "Vectorflow - Netflix's Neural Network 
library in Action". We will also have as special guest Benoit 
Rostykus, the author of the library, who will call-in and take 
questions.


Please RSVP on: 
https://www.meetup.com/de-DE/Munich-D-Programmers/events/249380201/


Thanks, Dragos



Re: #include C headers in D code

2018-04-13 Thread Jacob Carlborg via Digitalmars-d-announce

On 2018-04-13 12:33, Atila Neves wrote:

I'll have to take a look at Jacob's configure.d to find out where 
libclang is installed on Windows.


Unfortunately the configuration script is only for Posix.

--
/Jacob Carlborg


Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce

On Wednesday, 11 April 2018 at 14:57:51 UTC, rumbu wrote:

On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote:

[...]

Cannot manage to build it on Windows:

D:\git\dpp>dub build
WARNING: A deprecated branch based version specification is 
used for the dependency libclang. Please use numbered versions 
instead. Also note that you can still use the 
dub.selections.json file to override a certain dependency to 
use a branch instead.

Performing "debug" build using dmd for x86.
libclang ~master: target for configuration "library" is up to 
date.
dpp 0.0.1+commit.41.g60f98e4: building configuration 
"executable"...

Linking...
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 183: Extension not .RES : clang.lib
C:\Users\[]\AppData\Roaming\dub\packages\libclang-master\libclang\.dub\build\library-debug-windows-x86-dmd_2079-78261F5A299D700FEEC2C0E7B51191C1\libclang.lib(1)
 : Error 52: .DEF Syntax Error

[...]


I'll have to take a look at Jacob's configure.d to find out where 
libclang is installed on Windows.


It'll fail even if it builds though, since there won't be a 
`cpp.exe` on Windows for it to call. I don't even know what the 
equivalent would be with Visual Studio.


Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce

On Wednesday, 11 April 2018 at 14:26:04 UTC, Jacob Carlborg wrote:

On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote:
Here's my blog post about my project that allows directly 
#including C headers in D*


BTW, you can steal the config script [1] from DStep to help 
detect locations of LLVM/libclang. It also supports static 
linking. Supports manually specifying the path to LLVM if 
needed.


[1] 
https://github.com/jacob-carlborg/dstep/blob/master/configure.d


--
/Jacob Carlborg


Thanks!


Re: #include C headers in D code

2018-04-13 Thread Atila Neves via Digitalmars-d-announce

On Wednesday, 11 April 2018 at 14:33:26 UTC, Jacob Carlborg wrote:

On Monday, 9 April 2018 at 11:03:48 UTC, Atila Neves wrote:
Here's my blog post about my project that allows directly 
#including C headers in D*


I don't know the exact details of your project but can't you 
just:


1. Copy the includes
2. Paste them into a C file
3. Run DStep on the C file
4. Replace the includes in the first file with the result from 
DStep


This would require changing DStep to always return `false` here 
[1]. Or perhaps run the preprocessor to expand the includes and 
then run DStep.


[1] 
https://github.com/jacob-carlborg/dstep/blob/master/dstep/translator/Translator.d#L326


--
/Jacob Carlborg


That wouldn't have the same semantics as I want.

I tried using dstep as a library. It didn't work.




Re: [OT] gdc status

2018-04-13 Thread Johannes Pfau via Digitalmars-d-announce
Am Wed, 11 Apr 2018 16:44:32 +0300 schrieb drug:

> 11.04.2018 16:26, Uknown пишет:
>> On Wednesday, 11 April 2018 at 13:17:23 UTC, drug wrote:
>>> 11.04.2018 15:22, bachmeier пишет:
 On Wednesday, 11 April 2018 at 09:45:07 UTC, Jonathan M Davis wrote:
 ... Given that GDC has been added to GCC...
>>> Is it true? I don't see anything like that here
>>> https://gcc.gnu.org/gcc-8/changes.html
>> 
>> Here's relevant news from Phoronix:
>> 
>> https://www.phoronix.com/scan.php?page=news_item=D-Frontend-For-GCC
>> 
>> Here's the relevant announcement:
>> https://gcc.gnu.org/ml/gcc/2017-06/msg00111.html
> I've read it. Unfortunately it doesn't answer my question. I've heard
> there were some problems.

IIRC copyright stuff once again stalled further discussion and the 
relevant GCC guys are not responding:
https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg186124.html


-- 
Johannes