January 25, 2015
On 1/25/2015 1:36 PM, John Colvin wrote:
> On Sunday, 25 January 2015 at 20:45:26 UTC, Walter Bright wrote:
>>> Calypso registers itself as a "language plugin", and when parse.c encounters
>>
>> parse.c is not part of my project. Where is parse.c?
>
> here? https://github.com/D-Programming-Language/dmd/blob/master/src/parse.c

Not what I meant.

What does parse.c have to do with the user of Calypso?

How does the user use Calypso? Where is Calypso? How do I run Calypso?

A user of Calypso will be baffled when encountering user documentation of Calypso that explains it in terms of dmd internal source code.
January 25, 2015
On Sunday, 25 January 2015 at 22:45:31 UTC, Walter Bright wrote:
> Not what I meant.
>
> What does parse.c have to do with the user of Calypso?
>
> How does the user use Calypso? Where is Calypso? How do I run Calypso?
>
> A user of Calypso will be baffled when encountering user documentation of Calypso that explains it in terms of dmd internal source code.

Is the new README any better? Once I succeed making the nature of Calypso intelligible does the showcase example seem self-explaining enough to make the usage straightforward?
January 26, 2015
On 1/25/2015 3:07 PM, Elie Morisse wrote:
> On Sunday, 25 January 2015 at 22:45:31 UTC, Walter Bright wrote:
>> Not what I meant.
>>
>> What does parse.c have to do with the user of Calypso?
>>
>> How does the user use Calypso? Where is Calypso? How do I run Calypso?
>>
>> A user of Calypso will be baffled when encountering user documentation of
>> Calypso that explains it in terms of dmd internal source code.
>
> Is the new README any better?

No. It doesn't answer any of my questions.

> Once I succeed making the nature of Calypso
> intelligible does the showcase example seem self-explaining enough to make the
> usage straightforward?

I'm obviously terrible at communicating. Let me try again. Assume that I wrote Calypso, and I was explaining it to you:

-----------------------------------------

Given the C++ header file foo.h:

    void bar(unsigned *);

and the C++ source file foo.cpp:

    void bar(unsigned *p) { }

I want to call bar() from my D code in test.d:

    void main() {
      uint x;
      bar(&x);
    }

Here's how to do it with Calypso:

    calypso foo.h

which will generate the file foo.d. add an import to test.d:

    import foo;

    void main() {
      uint x;
      bar(&x);
    }

To compile and link:

    clang++ foo.cpp -c
    dmd test foo.o

Which generates the program 'test' which can be run.


January 26, 2015
On 1/25/15 4:37 PM, Walter Bright wrote:
> On 1/25/2015 3:07 PM, Elie Morisse wrote:
>> On Sunday, 25 January 2015 at 22:45:31 UTC, Walter Bright wrote:
>>> Not what I meant.
>>>
>>> What does parse.c have to do with the user of Calypso?
>>>
>>> How does the user use Calypso? Where is Calypso? How do I run Calypso?
>>>
>>> A user of Calypso will be baffled when encountering user
>>> documentation of
>>> Calypso that explains it in terms of dmd internal source code.
>>
>> Is the new README any better?
>
> No. It doesn't answer any of my questions.

Might be a great idea if a person who went through the steps of installing and using Calypso would issue a pull request for the README. -- Andrei

January 26, 2015
On 2015-01-26 01:37, Walter Bright wrote:

> I'm obviously terrible at communicating. Let me try again. Assume that I
> wrote Calypso, and I was explaining it to you:
>
> -----------------------------------------
>
> Given the C++ header file foo.h:
>
>      void bar(unsigned *);
>
> and the C++ source file foo.cpp:
>
>      void bar(unsigned *p) { }
>
> I want to call bar() from my D code in test.d:
>
>      void main() {
>        uint x;
>        bar(&x);
>      }
>
> Here's how to do it with Calypso:
>
>      calypso foo.h
>
> which will generate the file foo.d. add an import to test.d:
>
>      import foo;
>
>      void main() {
>        uint x;
>        bar(&x);
>      }
>
> To compile and link:
>
>      clang++ foo.cpp -c
>      dmd test foo.o
>
> Which generates the program 'test' which can be run.

It works something like this:

Given the C++ header file foo.h:

    void bar(unsigned *);

and the C++ source file foo.cpp:

    void bar(unsigned *p) { }

I want to call bar() from my D code in test.d:

    void main() {
      uint x;
      bar(&x);
    }

Here's how to do it with Calypso:

    module test;

    modmap (C++) "foo.h";
    import (C++) _ : bar;

    void main() {
      uint x;
      bar(&x);
    }

To compile and link:

    clang++ foo.cpp -c
    ldc test.d foo.o

Which generates the program 'test' which can be run.

Calypso is not a separate tool. It's a fork of LDC which allows you to directly import/include a C++ header files and use the declarations from within D. No bindings or intermediate files are necessary.

-- 
/Jacob Carlborg
January 26, 2015
On 1/26/2015 12:18 AM, Jacob Carlborg wrote:
> It works something like this:
>
> Given the C++ header file foo.h:
>
>      void bar(unsigned *);
>
> and the C++ source file foo.cpp:
>
>      void bar(unsigned *p) { }
>
> I want to call bar() from my D code in test.d:
>
>      void main() {
>        uint x;
>        bar(&x);
>      }
>
> Here's how to do it with Calypso:
>
>      module test;
>
>      modmap (C++) "foo.h";
>      import (C++) _ : bar;
>
>      void main() {
>        uint x;
>        bar(&x);
>      }
>
> To compile and link:
>
>      clang++ foo.cpp -c
>      ldc test.d foo.o
>
> Which generates the program 'test' which can be run.
>
> Calypso is not a separate tool. It's a fork of LDC which allows you to directly
> import/include a C++ header files and use the declarations from within D. No
> bindings or intermediate files are necessary.

Thank you. That really, really needs to go into the README.md, especially the last paragraph.

January 26, 2015
On Monday, 26 January 2015 at 08:59:34 UTC, Walter Bright wrote:
> On 1/26/2015 12:18 AM, Jacob Carlborg wrote:
>>
>> Calypso is not a separate tool. It's a fork of LDC which allows you to directly
>> import/include a C++ header files and use the declarations from within D. No
>> bindings or intermediate files are necessary.
>
> Thank you. That really, really needs to go into the README.md, especially the last paragraph.

Now I feel sorry for Elie. He contributed a great idea, put in a huge amount of work, still has miles to go, tried hard to be helpful and D's very own mastermind does not seem to care enough to read his announcement. His very first sentence reads

"I have the pleasure to announce to you all the existence of a modified LDC able to interface directly to C++ libraries, wiping out the need to write bindings:"

The idea is just brilliant. I for one am excited about the prospect. Lets please discuss how to get the plugin into D, sooner rather than later. No language is an island. (Apologies to Nick Hornby and everyone else offended.)
January 26, 2015
On 1/26/2015 1:58 AM, "Ulrich =?UTF-8?B?S8O8dHRsZXIi?= <kuettler@gmail.com>" wrote:
> The idea is just brilliant. I for one am excited about the prospect. Lets please
> discuss how to get the plugin into D, sooner rather than later. No language is
> an island. (Apologies to Nick Hornby and everyone else offended.)

I am pretty excited as well about Calypso and think it can be very effective in making D more usable.

Thank you, Elie!
January 26, 2015
On Monday, 26 January 2015 at 10:16:04 UTC, Walter Bright wrote:
> On 1/26/2015 1:58 AM, "Ulrich =?UTF-8?B?S8O8dHRsZXIi?= <kuettler@gmail.com>" wrote:
>> The idea is just brilliant. I for one am excited about the prospect. Lets please
>> discuss how to get the plugin into D, sooner rather than later. No language is
>> an island. (Apologies to Nick Hornby and everyone else offended.)
>
> I am pretty excited as well about Calypso and think it can be very effective in making D more usable.
>
> Thank you, Elie!

The modmap seems a little wonky to me, a pragma(calypso, ...) seems more appropriate.

Any chance that we can get a plugin system in dmd that allows us to register pragmas, so that calypso can be used?
January 26, 2015
On Monday, 26 January 2015 at 09:58:25 UTC, Ulrich Küttler wrote:
> On Monday, 26 January 2015 at 08:59:34 UTC, Walter Bright wrote:
>> On 1/26/2015 12:18 AM, Jacob Carlborg wrote:
>>>
>>> Calypso is not a separate tool. It's a fork of LDC which allows you to directly
>>> import/include a C++ header files and use the declarations from within D. No
>>> bindings or intermediate files are necessary.
>>
>> Thank you. That really, really needs to go into the README.md, especially the last paragraph.
>
> Now I feel sorry for Elie. He contributed a great idea, put in a huge amount of work, still has miles to go, tried hard to be helpful and D's very own mastermind does not seem to care enough to read his announcement. His very first sentence reads
>
> "I have the pleasure to announce to you all the existence of a modified LDC able to interface directly to C++ libraries, wiping out the need to write bindings:"
>
> The idea is just brilliant. I for one am excited about the prospect. Lets please discuss how to get the plugin into D, sooner rather than later. No language is an island. (Apologies to Nick Hornby and everyone else offended.)

A fast way to kill the language would be to add "great new features" that are not properly documented. Walter's comments were correct IMO. I was not at all clear about those things, but I wasn't going to say so.