Re: [elixir-core:8302] Proposal: Comments in AST

2018-09-17 Thread José Valim
I don't think we ever stored them in meta. But even if we did, we would
probably have done it in the formatter, and we should likely move it
somewhere public.



*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R

On Mon, Sep 17, 2018 at 8:37 PM, Louis Pilfold 
wrote:

> Hey
>
> I'm a little out of touch with this area, but isn't this what we
> previously did? I remember comments being stored in meta during the
> creation of the formatter. Or did I make that up?
>
> Cheers,
> Louis
>
> On Mon, 17 Sep 2018 at 19:17 José Valim 
> wrote:
>
>> I like the metadata idea a lot, thanks. We still need someone to send a
>> detailed proposal, including what will happen with inline comments,
>> comments inside blocks and comments as the last line of a block with no
>> expression afterwards.
>>
>> We also need a discussion on what will happen with nodes that do not have
>> a metadata entry. Wrapping those in a block is likely enough (but it will
>> break semantics, for example, in keywords lists). So it would need to be an
>> opt-in feature only.
>>
>> Once all the details are ironed out, then somebody can go ahead and fully
>> implement it. :)
>> --
>>
>>
>> *José Valim*
>> www.plataformatec.com.br
>> Skype: jv.ptec
>> Founder and Director of R
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/elixir-lang-core/CAGnRm4J4%2BcTqcXH_ESJL2_o7rv5OJxkf_yJDpVAH%
>> 3DCjH2mmO7w%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/CABu8xFAk6UQJbbMcD2xkwJFLPM%
> 3DbASSnOqL6ihSdUQEMpuKNGg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LmVcoPq7fRkJY5ErJ4N93Bd8-9erEByNETt%2BLN5DZuYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8303] Proposal: Comments in AST

2018-09-17 Thread Steve Morin
Yes being part of the metadata would be great.  Need to look around/research 
and see what other people have done.  Just not losing the data would be great.

> On Sep 17, 2018, at 12:10, José Valim  wrote:
> 
> I don't think we ever stored them in meta. But even if we did, we would 
> probably have done it in the formatter, and we should likely move it 
> somewhere public.
> 
> 
> 
> José Valim
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R
> 
>> On Mon, Sep 17, 2018 at 8:37 PM, Louis Pilfold  
>> wrote:
>> Hey
>> 
>> I'm a little out of touch with this area, but isn't this what we previously 
>> did? I remember comments being stored in meta during the creation of the 
>> formatter. Or did I make that up?
>> 
>> Cheers,
>> Louis
>> 
>>> On Mon, 17 Sep 2018 at 19:17 José Valim  
>>> wrote:
>>> I like the metadata idea a lot, thanks. We still need someone to send a 
>>> detailed proposal, including what will happen with inline comments, 
>>> comments inside blocks and comments as the last line of a block with no 
>>> expression afterwards.
>>> 
>>> We also need a discussion on what will happen with nodes that do not have a 
>>> metadata entry. Wrapping those in a block is likely enough (but it will 
>>> break semantics, for example, in keywords lists). So it would need to be an 
>>> opt-in feature only.
>>> 
>>> Once all the details are ironed out, then somebody can go ahead and fully 
>>> implement it. :)
>>> -- 
>>> 
>>> 
>>> José Valim
>>> www.plataformatec.com.br
>>> Skype: jv.ptec
>>> Founder and Director of R
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to elixir-lang-core+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J4%2BcTqcXH_ESJL2_o7rv5OJxkf_yJDpVAH%3DCjH2mmO7w%40mail.gmail.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elixir-lang-core+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/CABu8xFAk6UQJbbMcD2xkwJFLPM%3DbASSnOqL6ihSdUQEMpuKNGg%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LmVcoPq7fRkJY5ErJ4N93Bd8-9erEByNETt%2BLN5DZuYA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/A72C2016-A449-43E5-8B85-6B5C37FD1818%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8300] Proposal: Comments in AST

2018-09-17 Thread OvermindDL1
In addition, clang and a few other compilers I've worked with also all 
'carry' comments in some form (either as their own syntactical node or as 
metadata on another node), so there is massive precedence.

On Monday, September 17, 2018 at 11:28:11 AM UTC-6, OvermindDL1 wrote:
>
> Comments are part of the syntax and should be parsed as such however.  
> Personally I'd opt for an OCaml-style handling of comments where the 
> comments get turned into a meta attribute on the related tag, which for 
> elixir could be as simple as wrapping the related comment part in something 
> like `{:__block__, [comment: "...", line: ..., ...]. [original]}` for any 
> potentially multiple lines worth of comments.  With this the comments get 
> directly 'assigned' to something (in OCaml it's the next following 
> expression), which might have meaning to some tools, say documentation or 
> some tests or so.
>
> On Sunday, September 16, 2018 at 11:35:50 AM UTC-6, José Valim wrote:
>>
>> This is really, really hard to do because it would overcomplicate the 
>> language grammar, as it would have to take comments into account at every 
>> step. I am not even sure if it is possible. If someone wants to try it out 
>> though. :)
>>
>> That's why most tools end-up handling comments on the side, separated 
>> from parsing.
>>
>> *José Valim*
>> www.plataformatec.com.br
>> Skype: jv.ptec
>> Founder and Director of R
>>
>> On Sun, Sep 16, 2018 at 6:59 PM, Steve Morin  wrote:
>>
>>> Wanted to see what peoples thoughts are about adding comments to the 
>>> AST.  
>>>
>>> One use-case is to be able to parse and manipulate Source files outside 
>>> of just macros but in that case you would want to be able to preserve 
>>> comments.  
>>>
>>> E.g. Read a source file, manipulate it, write that source file back to a 
>>> file.  
>>>
>>> This would allow people/tooling to use elixir to parse and manipulate 
>>> source files.
>>>
>>> If this might disturb existing consumers of the AST maybe this could be 
>>> added as a option to existing Macro functions so that I could be turned on 
>>> for people with this use-case. 
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "elixir-lang-core" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to elixir-lang-co...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/elixir-lang-core/955237D8-31DE-448C-9777-1104F1175DC7%40gmail.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/3ab7a871-9118-4922-b395-430c43c49f41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8301] Proposal: Comments in AST

2018-09-17 Thread Louis Pilfold
Hey

I'm a little out of touch with this area, but isn't this what we previously
did? I remember comments being stored in meta during the creation of the
formatter. Or did I make that up?

Cheers,
Louis

On Mon, 17 Sep 2018 at 19:17 José Valim 
wrote:

> I like the metadata idea a lot, thanks. We still need someone to send a
> detailed proposal, including what will happen with inline comments,
> comments inside blocks and comments as the last line of a block with no
> expression afterwards.
>
> We also need a discussion on what will happen with nodes that do not have
> a metadata entry. Wrapping those in a block is likely enough (but it will
> break semantics, for example, in keywords lists). So it would need to be an
> opt-in feature only.
>
> Once all the details are ironed out, then somebody can go ahead and fully
> implement it. :)
> --
>
>
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4J4%2BcTqcXH_ESJL2_o7rv5OJxkf_yJDpVAH%3DCjH2mmO7w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CABu8xFAk6UQJbbMcD2xkwJFLPM%3DbASSnOqL6ihSdUQEMpuKNGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8299] Proposal: Comments in AST

2018-09-17 Thread OvermindDL1
Comments are part of the syntax and should be parsed as such however.  
Personally I'd opt for an OCaml-style handling of comments where the 
comments get turned into a meta attribute on the related tag, which for 
elixir could be as simple as wrapping the related comment part in something 
like `{:__block__, [comment: "...", line: ..., ...]. [original]}` for any 
potentially multiple lines worth of comments.  With this the comments get 
directly 'assigned' to something (in OCaml it's the next following 
expression), which might have meaning to some tools, say documentation or 
some tests or so.

On Sunday, September 16, 2018 at 11:35:50 AM UTC-6, José Valim wrote:
>
> This is really, really hard to do because it would overcomplicate the 
> language grammar, as it would have to take comments into account at every 
> step. I am not even sure if it is possible. If someone wants to try it out 
> though. :)
>
> That's why most tools end-up handling comments on the side, separated from 
> parsing.
>
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R
>
> On Sun, Sep 16, 2018 at 6:59 PM, Steve Morin  > wrote:
>
>> Wanted to see what peoples thoughts are about adding comments to the 
>> AST.  
>>
>> One use-case is to be able to parse and manipulate Source files outside 
>> of just macros but in that case you would want to be able to preserve 
>> comments.  
>>
>> E.g. Read a source file, manipulate it, write that source file back to a 
>> file.  
>>
>> This would allow people/tooling to use elixir to parse and manipulate 
>> source files.
>>
>> If this might disturb existing consumers of the AST maybe this could be 
>> added as a option to existing Macro functions so that I could be turned on 
>> for people with this use-case. 
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to elixir-lang-co...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/955237D8-31DE-448C-9777-1104F1175DC7%40gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/89df003f-33a3-4913-9756-7b3c29f736d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elixir-core:8296] GenStage, Plug, Hooks, ...

2018-09-17 Thread Manuel Rubio
Hello,

I was thinking to create a system which let me to plug some functionalities
in future like ejabberd or MongooseIM does with hooks:

https://github.com/benoitc/hooks

The point is, if I have a dynamic pipeline created to process sequentially
data, let me to include in that pipeline new code without modify the
original code.

I thought in Plug but I'm not sure if, for a Plug created in other module I
can modify it to include the call of other functions.

Also thought about GenStage and Flow, but the same, I'm not sure if I can
deconstruct them to include extra processing in the same way.

Kind regards.
Manuel Rubio.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAC58Cc0Rxv1PV6VSHp9MxAnnzy_2Bn2hm7d2buJz0O85a3KVNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8297] GenStage, Plug, Hooks, ...

2018-09-17 Thread Andrea Leopardi
Hey Manuel,

the elixir-lang-core mailing list is reserved for discussions on the
language and on language features. For example, you would write here if you
had a proposal for a new feature to add to Elixir. This is outlined in this
page: https://elixir-lang.org/development.html.

I think your post might be a better fit for the Elixir Forum (
https://elixirforum.com), where discussions similar to this happen daily.

Andrea Leopardi
an.leopa...@gmail.com


On Mon, Sep 17, 2018 at 12:12 PM Manuel Rubio  wrote:

> Hello,
>
> I was thinking to create a system which let me to plug some
> functionalities in future like ejabberd or MongooseIM does with hooks:
>
> https://github.com/benoitc/hooks
>
> The point is, if I have a dynamic pipeline created to process sequentially
> data, let me to include in that pipeline new code without modify the
> original code.
>
> I thought in Plug but I'm not sure if, for a Plug created in other module
> I can modify it to include the call of other functions.
>
> Also thought about GenStage and Flow, but the same, I'm not sure if I can
> deconstruct them to include extra processing in the same way.
>
> Kind regards.
> Manuel Rubio.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAC58Cc0Rxv1PV6VSHp9MxAnnzy_2Bn2hm7d2buJz0O85a3KVNQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2BJrQBe94N4MZedHrPErZe5gyLtPSY5tSgyMjWrQBLUEJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.