Re: AST Macros?

2012-06-06 Thread deadalnix

Le 05/06/2012 23:20, Jacob Carlborg a écrit :

On 2012-06-05 09:08, Don Clugston wrote:

On 04/06/12 20:46, Jacob Carlborg wrote:

On 2012-06-04 10:03, Don Clugston wrote:


AST macros were discussed informally on the day after the conference,
and it quickly became clear that the proposed ones were nowhere near
powerful enough. Since that time nobody has come up with another
proposal, as far as I know.


I think others have suggested doing something similar like Nemerle,
Scala or Nimrod.



Yes but only in very vague terms -- not in any more words than that.
When I look at the Nimrod docs, it basically seems to be nothing more
than "expose the compiler internal data structures". Which is extremely
easy to do but causes a heap of problems in the long term.


Yes, no formal proposition has been made.



I wanted to do one. I have may idea on the subject, but want to 
experiment with them. It is not as easy as it seems, and it is always 
harder to switch after release.


This is why I ended up massively hacking SDC.


Re: AST Macros?

2012-06-06 Thread deadalnix

Le 05/06/2012 11:02, foobar a écrit :

On Tuesday, 5 June 2012 at 07:08:19 UTC, Don Clugston wrote:

On 04/06/12 20:46, Jacob Carlborg wrote:

On 2012-06-04 10:03, Don Clugston wrote:


AST macros were discussed informally on the day after the conference,
and it quickly became clear that the proposed ones were nowhere near
powerful enough. Since that time nobody has come up with another
proposal, as far as I know.


I think others have suggested doing something similar like Nemerle,
Scala or Nimrod.



Yes but only in very vague terms -- not in any more words than that.
When I look at the Nimrod docs, it basically seems to be nothing more
than "expose the compiler internal data structures". Which is
extremely easy to do but causes a heap of problems in the long term.


This argument was raised before. That "heap of problems" is as vague as
the proposed AST system(s).
As far as I can tell, that heap of problems is mainly about making it
harder to make internal breaking changes since the compiler is no longer
a black box.

Now, I'd argue that having a stable API for those compiler internals in
needed anyway. Besides the obvious benefits of a more modular design
that better encapsulates the different layers of the compilation
process, it allows us to implement a compiler as a set of libraries
which benefits the tool ecosystem, IDEs, text-editors, lint tools, etc.
Thools which could reuse subsets of these libraries (e.g. think of
Clang's design and how it allowed for the vim auto-complete plugin).

Even _without_ the AST macros I think it's a worthy goal to pursuit, AST
macros simply make the outcome that much sweeter.


Indeed. I'm working toward this goal.


Re: AST Macros?

2012-06-06 Thread Jacob Carlborg

On 2012-06-06 01:06, Paul D. Anderson wrote:


Can we move this to a DIP?


Sure, you are free to add a DIP, or someone else.

--
/Jacob Carlborg


Re: AST Macros?

2012-06-05 Thread Paul D. Anderson

On Tuesday, 5 June 2012 at 21:20:43 UTC, Jacob Carlborg wrote:

On 2012-06-05 11:02, foobar wrote:

This argument was raised before. That "heap of problems" is as 
vague as

the proposed AST system(s).
As far as I can tell, that heap of problems is mainly about 
making it
harder to make internal breaking changes since the compiler is 
no longer

a black box.

Now, I'd argue that having a stable API for those compiler 
internals in
needed anyway. Besides the obvious benefits of a more modular 
design
that better encapsulates the different layers of the 
compilation
process, it allows us to implement a compiler as a set of 
libraries
which benefits the tool ecosystem, IDEs, text-editors, lint 
tools, etc.
Thools which could reuse subsets of these libraries (e.g. 
think of
Clang's design and how it allowed for the vim auto-complete 
plugin).


Even _without_ the AST macros I think it's a worthy goal to 
pursuit, AST

macros simply make the outcome that much sweeter.


I couldn't agree more.


Can we move this to a DIP?

Paul




Re: AST Macros?

2012-06-05 Thread Jacob Carlborg

On 2012-06-05 09:08, Don Clugston wrote:

On 04/06/12 20:46, Jacob Carlborg wrote:

On 2012-06-04 10:03, Don Clugston wrote:


AST macros were discussed informally on the day after the conference,
and it quickly became clear that the proposed ones were nowhere near
powerful enough. Since that time nobody has come up with another
proposal, as far as I know.


I think others have suggested doing something similar like Nemerle,
Scala or Nimrod.



Yes but only in very vague terms -- not in any more words than that.
When I look at the Nimrod docs, it basically seems to be nothing more
than "expose the compiler internal data structures". Which is extremely
easy to do but causes a heap of problems in the long term.


Yes, no formal proposition has been made.

--
/Jacob Carlborg


Re: AST Macros?

2012-06-05 Thread Jacob Carlborg

On 2012-06-05 11:02, foobar wrote:


This argument was raised before. That "heap of problems" is as vague as
the proposed AST system(s).
As far as I can tell, that heap of problems is mainly about making it
harder to make internal breaking changes since the compiler is no longer
a black box.

Now, I'd argue that having a stable API for those compiler internals in
needed anyway. Besides the obvious benefits of a more modular design
that better encapsulates the different layers of the compilation
process, it allows us to implement a compiler as a set of libraries
which benefits the tool ecosystem, IDEs, text-editors, lint tools, etc.
Thools which could reuse subsets of these libraries (e.g. think of
Clang's design and how it allowed for the vim auto-complete plugin).

Even _without_ the AST macros I think it's a worthy goal to pursuit, AST
macros simply make the outcome that much sweeter.


I couldn't agree more.

--
/Jacob Carlborg


Re: AST Macros?

2012-06-05 Thread foobar

On Tuesday, 5 June 2012 at 07:08:19 UTC, Don Clugston wrote:

On 04/06/12 20:46, Jacob Carlborg wrote:

On 2012-06-04 10:03, Don Clugston wrote:

AST macros were discussed informally on the day after the 
conference,
and it quickly became clear that the proposed ones were 
nowhere near
powerful enough. Since that time nobody has come up with 
another

proposal, as far as I know.


I think others have suggested doing something similar like 
Nemerle,

Scala or Nimrod.



Yes but only in very vague terms -- not in any more words than 
that. When I look at the Nimrod docs, it basically seems to be 
nothing more than "expose the compiler internal data 
structures". Which is extremely easy to do but causes a heap of 
problems in the long term.


This argument was raised before. That "heap of problems" is as 
vague as the proposed AST system(s).
As far as I can tell, that heap of problems is mainly about 
making it harder to make internal breaking changes since the 
compiler is no longer a black box.


Now, I'd argue that having a stable API for those compiler 
internals in needed anyway. Besides the obvious benefits of a 
more modular design that better encapsulates the different layers 
of the compilation process, it allows us to implement a compiler 
as a set of libraries which benefits the tool ecosystem, IDEs, 
text-editors, lint tools, etc. Thools which could reuse subsets 
of these libraries (e.g. think of Clang's design and how it 
allowed for the vim auto-complete plugin).


Even _without_ the AST macros I think it's a worthy goal to 
pursuit, AST macros simply make the outcome that much sweeter.


Re: AST Macros?

2012-06-05 Thread Don Clugston

On 04/06/12 20:46, Jacob Carlborg wrote:

On 2012-06-04 10:03, Don Clugston wrote:


AST macros were discussed informally on the day after the conference,
and it quickly became clear that the proposed ones were nowhere near
powerful enough. Since that time nobody has come up with another
proposal, as far as I know.


I think others have suggested doing something similar like Nemerle,
Scala or Nimrod.



Yes but only in very vague terms -- not in any more words than that. 
When I look at the Nimrod docs, it basically seems to be nothing more 
than "expose the compiler internal data structures". Which is extremely 
easy to do but causes a heap of problems in the long term.





Re: AST Macros?

2012-06-04 Thread Jacob Carlborg

On 2012-06-04 10:03, Don Clugston wrote:


AST macros were discussed informally on the day after the conference,
and it quickly became clear that the proposed ones were nowhere near
powerful enough. Since that time nobody has come up with another
proposal, as far as I know.


I think others have suggested doing something similar like Nemerle, 
Scala or Nimrod.


--
/Jacob Carlborg


Re: AST Macros?

2012-06-04 Thread deadalnix

Le 01/06/2012 21:37, Jacob Carlborg a écrit :

On 2012-06-01 17:47, Gor Gyolchanyan wrote:


Where can I read more about Bartosz's race-free type system and if there
are some specific ideas already, AST macros for D as well?


AST macros have been mentioned in the newsgroups several times. There
was a talk at the first D conference mentioning AST macros. This was
before D2.

http://d.puremagic.com/conference2007/speakers.html

It's the talk by Walter Bright and Andrei Alexandrescu. It's probably in
the second part.



I have seen the presentation's slides a long time ago, but didn't knew 
it was recorded on video ! Thank you very much !


Re: AST Macros?

2012-06-04 Thread Don Clugston

On 01/06/12 21:37, Jacob Carlborg wrote:

On 2012-06-01 17:47, Gor Gyolchanyan wrote:


Where can I read more about Bartosz's race-free type system and if there
are some specific ideas already, AST macros for D as well?


AST macros have been mentioned in the newsgroups several times. There
was a talk at the first D conference mentioning AST macros. This was
before D2.

http://d.puremagic.com/conference2007/speakers.html

It's the talk by Walter Bright and Andrei Alexandrescu. It's probably in
the second part.



AST macros were discussed informally on the day after the conference, 
and it quickly became clear that the proposed ones were nowhere near 
powerful enough. Since that time nobody has come up with another 
proposal, as far as I know.


Re: AST Macros?

2012-06-02 Thread dom96

On Friday, 1 June 2012 at 15:38:44 UTC, Jonathan M Davis wrote:

On Friday, June 01, 2012 17:57:51 d coder wrote:

Greetings

I know there is a plan for D to have AST macros eventually. I 
wanted to
know if it is a feature being worked upon at this point of 
time.
Approximately how long it would be before AST Macros see the 
light of the

day in D?

I know D is an opensource project and I am not trying to put 
any pressure
here. I am just curious because I think D is a great language 
for creating

DSL's and having AST Macros will make a big difference.


There was talk of doing AST macros quite while back, but it was 
decided not to
add them to D2. They may or may not ever be revisited. This 
page isn't

necessarily completely up-to-date (
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel ), but it 
specifically lists 2

things as deferred to D3.0:

* AST macros.
* Bartosz Milewski's race-free type system.

String mixins should be powerful enough in most, if not all, 
cases. It's been
shown that it's quite possible to create DSLs as strings with 
whatever syntax
you want and have them compiled to D code (Philippe Segaud put 
together a

really cool library for generating PEGs:
https://github.com/PhilippeSigaud/Pegged/wiki ).

We _may_ see AST macros added to the language in the distant 
future, but it's

not happening anytime soon.

- Jonathan M Davis
If you're interested in AST macros take a look at Nimrod 
(http://nimrod-code.org) its got AST macros.




Re: AST Macros?

2012-06-02 Thread Guillaume Chatelet
On 06/01/12 17:47, Gor Gyolchanyan wrote:
> Where can I read more about Bartosz's race-free type system and if there
> are some specific ideas already, AST macros for D as well?
> 
> -- 
> Bye,
> Gor Gyolchanyan.

You can check this YouTube's playlist of the last D's convention (2009)
http://www.youtube.com/user/braddr1

Bartosz's talks about "Software Transactional Memory in D"
http://youtu.be/2P3OUuBEBNc


Re: AST Macros?

2012-06-01 Thread Jacob Carlborg

On 2012-06-01 17:47, Gor Gyolchanyan wrote:


Where can I read more about Bartosz's race-free type system and if there
are some specific ideas already, AST macros for D as well?


AST macros have been mentioned in the newsgroups several times. There 
was a talk at the first D conference mentioning AST macros. This was 
before D2.


http://d.puremagic.com/conference2007/speakers.html

It's the talk by Walter Bright and Andrei Alexandrescu. It's probably in 
the second part.


--
/Jacob Carlborg


Re: AST Macros?

2012-06-01 Thread Gor Gyolchanyan
On Fri, Jun 1, 2012 at 8:56 PM, Philippe Sigaud
wrote:

> On Fri, Jun 1, 2012 at 6:49 PM, Jonathan M Davis 
> wrote:
> > On Friday, June 01, 2012 19:47:47 Gor Gyolchanyan wrote:
> >> Where can I read more about Bartosz's race-free type system and if there
> >> are some specific ideas already, AST macros for D as well?
> >
> > I'm sure that there's some discussion on them in the newsgroup archives,
> but
> > it may be 5 years back; I don't know. You'll have to search the
> archives. I'm
> > not aware of any other discussions of them being online anywhere.
>
> Discussion here, no indeed. But Bartosz had a bunch of blog posts that
> explained his ideas.
>
> It begins there:
>
> http://bartoszmilewski.com/2009/03/23/types-for-concurrency/
>
> And then for some months.
>

Thanks!

-- 
Bye,
Gor Gyolchanyan.


Re: AST Macros?

2012-06-01 Thread Philippe Sigaud
On Fri, Jun 1, 2012 at 6:49 PM, Jonathan M Davis  wrote:
> On Friday, June 01, 2012 19:47:47 Gor Gyolchanyan wrote:
>> Where can I read more about Bartosz's race-free type system and if there
>> are some specific ideas already, AST macros for D as well?
>
> I'm sure that there's some discussion on them in the newsgroup archives, but
> it may be 5 years back; I don't know. You'll have to search the archives. I'm
> not aware of any other discussions of them being online anywhere.

Discussion here, no indeed. But Bartosz had a bunch of blog posts that
explained his ideas.

It begins there:

http://bartoszmilewski.com/2009/03/23/types-for-concurrency/

And then for some months.


Re: AST Macros?

2012-06-01 Thread Jonathan M Davis
On Friday, June 01, 2012 19:47:47 Gor Gyolchanyan wrote:
> Where can I read more about Bartosz's race-free type system and if there
> are some specific ideas already, AST macros for D as well?

I'm sure that there's some discussion on them in the newsgroup archives, but 
it may be 5 years back; I don't know. You'll have to search the archives. I'm 
not aware of any other discussions of them being online anywhere.

- Jonathan M Davis


Re: AST Macros?

2012-06-01 Thread Gor Gyolchanyan
On Fri, Jun 1, 2012 at 7:38 PM, Jonathan M Davis wrote:

> On Friday, June 01, 2012 17:57:51 d coder wrote:
> > Greetings
> >
> > I know there is a plan for D to have AST macros eventually. I wanted to
> > know if it is a feature being worked upon at this point of time.
> > Approximately how long it would be before AST Macros see the light of the
> > day in D?
> >
> > I know D is an opensource project and I am not trying to put any pressure
> > here. I am just curious because I think D is a great language for
> creating
> > DSL's and having AST Macros will make a big difference.
>
> There was talk of doing AST macros quite while back, but it was decided
> not to
> add them to D2. They may or may not ever be revisited. This page isn't
> necessarily completely up-to-date (
> http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel ), but it specifically
> lists 2
> things as deferred to D3.0:
>
> * AST macros.
> * Bartosz Milewski's race-free type system.
>
> String mixins should be powerful enough in most, if not all, cases. It's
> been
> shown that it's quite possible to create DSLs as strings with whatever
> syntax
> you want and have them compiled to D code (Philippe Segaud put together a
> really cool library for generating PEGs:
> https://github.com/PhilippeSigaud/Pegged/wiki ).
>
> We _may_ see AST macros added to the language in the distant future, but
> it's
> not happening anytime soon.
>
> - Jonathan M Davis
>

Where can I read more about Bartosz's race-free type system and if there
are some specific ideas already, AST macros for D as well?

-- 
Bye,
Gor Gyolchanyan.


Re: AST Macros?

2012-06-01 Thread Jonathan M Davis
On Friday, June 01, 2012 17:57:51 d coder wrote:
> Greetings
> 
> I know there is a plan for D to have AST macros eventually. I wanted to
> know if it is a feature being worked upon at this point of time.
> Approximately how long it would be before AST Macros see the light of the
> day in D?
> 
> I know D is an opensource project and I am not trying to put any pressure
> here. I am just curious because I think D is a great language for creating
> DSL's and having AST Macros will make a big difference.

There was talk of doing AST macros quite while back, but it was decided not to 
add them to D2. They may or may not ever be revisited. This page isn't 
necessarily completely up-to-date ( 
http://prowiki.org/wiki4d/wiki.cgi?LanguageDevel ), but it specifically lists 2 
things as deferred to D3.0:

* AST macros.
* Bartosz Milewski's race-free type system.

String mixins should be powerful enough in most, if not all, cases. It's been 
shown that it's quite possible to create DSLs as strings with whatever syntax 
you want and have them compiled to D code (Philippe Segaud put together a 
really cool library for generating PEGs: 
https://github.com/PhilippeSigaud/Pegged/wiki ).

We _may_ see AST macros added to the language in the distant future, but it's 
not happening anytime soon.

- Jonathan M Davis