February 27, 2013 Re: D as a prototyping language (for C/C++ projects) | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | On Wednesday, 27 February 2013 at 08:30:18 UTC, monarch_dodra wrote:
> On Tuesday, 26 February 2013 at 23:46:52 UTC, Rob T wrote:
>> Once full shared library support comes about, we'll be able to integrate D libs directly into existing C/C++ code. This allows for a safe migration path away from legacy C/C++ to D.
>>
>> --rt
>
> Funny story, I'm doing it the other way around.
>
> I got my program fully working in D, and am porting it to C.
>
> The basic idea is that I'm going to port it "chunk by chunk" to C, while keeping my main in D. This allows me to "package" the finished parts in C, but still work on the rest in D. It also means the porting doesn't have to be done in its totality in a single pass.
I understand why your are doing this, but it must be a ton of work, and has a lot of potential for introducing bugs that do not exist in the D code base.
Someone proposed that we compile D to JVM bytecode, but maybe we should have D compile to C or C++ source code instead, at least that can work fully unlike with JVM bytecode, and it would save you guys a lot of work
--rt
|
February 27, 2013 Re: D as a prototyping language (for C/C++ projects) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 2013-02-27 11:07, Andrei Alexandrescu wrote: > Good idea. Should be in bugzilla as an enh, although it'll take a while > to get to that. I wonder how good the implementation will be if one just pass the line to rdmd and prints the result. -- /Jacob Carlborg |
February 27, 2013 Re: D as a prototyping language (for C/C++ projects) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Wednesday, 27 February 2013 at 19:55:41 UTC, Jacob Carlborg wrote: > On 2013-02-27 11:07, Andrei Alexandrescu wrote: > >> Good idea. Should be in bugzilla as an enh, although it'll take a while >> to get to that. > > I wonder how good the implementation will be if one just pass the line to rdmd and prints the result. I'm assuming you're talking about REPL. That won't cut it, as one wants to keep maintain a notion of state (variables in memory etc) and not reparse lines entered everytime (which could have IO side effects etc). I've played a bit with Oskar Linde's library for that and ported it to latest DMD release and it works quite well already, something solid to build upon (see post http://forum.dlang.org/thread/fpmpa6$2muq$1@digitalmars.com). |
February 27, 2013 Re: D as a prototyping language (for C/C++ projects) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 2/27/13 2:55 PM, Jacob Carlborg wrote:
> On 2013-02-27 11:07, Andrei Alexandrescu wrote:
>
>> Good idea. Should be in bugzilla as an enh, although it'll take a while
>> to get to that.
>
> I wonder how good the implementation will be if one just pass the line
> to rdmd and prints the result.
Try it, rdmd has --eval and --loop. It's useful but not as good as a real REPL.
Andrei
|
February 28, 2013 Re: D as a prototyping language (for C/C++ projects) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 2013-02-27 22:54, Andrei Alexandrescu wrote: > Try it, rdmd has --eval and --loop. It's useful but not as good as a > real REPL. I'll give that a try, thanks. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation