This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Alpha version of macros

28 replies
Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.

Hey! A few days ago, on this Friday, we've merged a pull request to
scala/scala that represents significant progress with macros.

I'd love you to explore our current take on macros and, possibly, get
assistance from a walkthrough from my recent talk in Kyiv (http://
scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
very welcome - if something doesn't work out with your macro test-
drive, let me know, and I'll try to fix the troubles.

In the meanwhile, we'll be polishing the implementation and preparing
a beta version that will be accompanied by a SIP. See you soon!

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros
Hi Eugene,

thanks for your work!

One question: Earlier documents mentioned a hypothetical SIP-15 "Quasiquotations".
With the introduction of the "enhanced" string interpolation (SIP 11), SIP-15 isn't necessary anymore, right?

Bye,

Simon
Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros

This is true to some extent.

Indeed, string interpolation proposal provides an infrastructure to
build quasiquotes upon.

However, there are still some open questions worth specifying (in a
separate proposal or together with macros - not sure which will be
right). First of all, what should a quasiquoter do: just parse the
source string (i.e. emit parser trees) or go for typed trees (i.e.
infer types, resolve implicits and likes)? Also, should it be
implemented as a macro or as a normal function? Moreover, there are
some design decisions to make that regard typechecking of the splices.

On Jan 23, 4:18 am, Simon Ochsenreither
wrote:
> Hi Eugene,
>
> thanks for your work!
>
> One question: Earlier documents mentioned a hypothetical SIP-15
> "Quasiquotations".
> With the introduction of the "enhanced" string interpolation (SIP 11),
> SIP-15 isn't necessary anymore, right?
>
> Bye,
>
> Simon

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Alpha version of macros

On Sun, Jan 22, 2012 at 21:32, Eugene Burmako wrote:
> Hey! A few days ago, on this Friday, we've merged a pull request to
> scala/scala that represents significant progress with macros.
>
> I'd love you to explore our current take on macros and, possibly, get
> assistance from a walkthrough from my recent talk in Kyiv (http://
> scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> very welcome - if something doesn't work out with your macro test-
> drive, let me know, and I'll try to fix the troubles.
>
> In the meanwhile, we'll be polishing the implementation and preparing
> a beta version that will be accompanied by a SIP. See you soon!

Is separate compilation something we can expect to be present when
2.10.0 comes out, or do you plan to "fix" it so macros can be compiled
together with code that uses before that?

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros

I wouldn't count on that - current behaviour is more or less
satisfactory (and conventional, e.g. Nemerle macro system also has
this peculiarity), while we have several high-priority features to
implement before the release. Does separate compilation present a
significant inconvenience in your scenarios?

On Jan 23, 3:22 pm, Daniel Sobral wrote:
> On Sun, Jan 22, 2012 at 21:32, Eugene Burmako wrote:
> > Hey! A few days ago, on this Friday, we've merged a pull request to
> > scala/scala that represents significant progress with macros.
>
> > I'd love you to explore our current take on macros and, possibly, get
> > assistance from a walkthrough from my recent talk in Kyiv (http://
> > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> > very welcome - if something doesn't work out with your macro test-
> > drive, let me know, and I'll try to fix the troubles.
>
> > In the meanwhile, we'll be polishing the implementation and preparing
> > a beta version that will be accompanied by a SIP. See you soon!
>
> Is separate compilation something we can expect to be present when
> 2.10.0 comes out, or do you plan to "fix" it so macros can be compiled
> together with code that uses before that?
>
> --
> Daniel C. Sobral
>
> I travel to the future all the time.

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: Alpha version of macros

On Mon, Jan 23, 2012 at 12:29, Eugene Burmako wrote:
> I wouldn't count on that - current behaviour is more or less
> satisfactory (and conventional, e.g. Nemerle macro system also has
> this peculiarity), while we have several high-priority features to
> implement before the release. Does separate compilation present a
> significant inconvenience in your scenarios?

It means two things:

1. Files defining macros cannot use them.
2. Software that uses self-defined macros need to be built with two
compilation steps.

The easiest way I can think to achieve this is to segregate all macros
into "macro" packages, and introduce two-step-compilation in SBT where
source from directories named "macro" are compiled in the first step,
and then the second step puts the target directory from the first in
the classpath (not default, iirc) and compiles everything except stuff
inside directories named "macro". The package segregation can be
avoided if you ignore Java convention.

This is not trivial, or, at least, I don't see a trivial way of doing
it. Consider how you'll go about changing Scala's build so that it can
use its own macros, for instance.

Now, macros are not a must-have feature for every piece of software --
Scala has lived without them for a long time, after all. Having
libraries that define useful macros will be useful all on its own, and
having the possibility of using macros, even if makes builds more
complex, will be a big plus. So I'm tagging this as an inconvenient
requirement that can be handled latter, or not at all, if the tooling
makes it mostly painless. I could put all macros on a subproject, for
instance, and have the rest of the code depend on it.

This discussion brought another question to my mind, however: will I
be able to define a macro and then use it in a single REPL session, or
will I have to compile all my macros beforehand?

>
> On Jan 23, 3:22 pm, Daniel Sobral wrote:
>> On Sun, Jan 22, 2012 at 21:32, Eugene Burmako wrote:
>> > Hey! A few days ago, on this Friday, we've merged a pull request to
>> > scala/scala that represents significant progress with macros.
>>
>> > I'd love you to explore our current take on macros and, possibly, get
>> > assistance from a walkthrough from my recent talk in Kyiv (http://
>> > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
>> > very welcome - if something doesn't work out with your macro test-
>> > drive, let me know, and I'll try to fix the troubles.
>>
>> > In the meanwhile, we'll be polishing the implementation and preparing
>> > a beta version that will be accompanied by a SIP. See you soon!
>>
>> Is separate compilation something we can expect to be present when
>> 2.10.0 comes out, or do you plan to "fix" it so macros can be compiled
>> together with code that uses before that?
>>
>> --
>> Daniel C. Sobral
>>
>> I travel to the future all the time.

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros

Yeah, this is very valid and awaits a principled solution. With Scala
we have a luxury of multi-stage build already integrated into our
workflow, so we're more or less fine. But, of course, this doesn't
diminish the problem.

Speaking of REPL, I have a feeling that everything will be okay, since
my impression is that REPL compiles every line in a separate
compilation run. Anyways, I'm going to summon Paul (cc'd) to clarify
this situation.

On Jan 23, 3:43 pm, Daniel Sobral wrote:
> On Mon, Jan 23, 2012 at 12:29, Eugene Burmako wrote:
> > I wouldn't count on that - current behaviour is more or less
> > satisfactory (and conventional, e.g. Nemerle macro system also has
> > this peculiarity), while we have several high-priority features to
> > implement before the release. Does separate compilation present a
> > significant inconvenience in your scenarios?
>
> It means two things:
>
> 1. Files defining macros cannot use them.
> 2. Software that uses self-defined macros need to be built with two
> compilation steps.
>
> The easiest way I can think to achieve this is to segregate all macros
> into "macro" packages, and introduce two-step-compilation in SBT where
> source from directories named "macro" are compiled in the first step,
> and then the second step puts the target directory from the first in
> the classpath (not default, iirc) and compiles everything except stuff
> inside directories named "macro". The package segregation can be
> avoided if you ignore Java convention.
>
> This is not trivial, or, at least, I don't see a trivial way of doing
> it. Consider how you'll go about changing Scala's build so that it can
> use its own macros, for instance.
>
> Now, macros are not a must-have feature for every piece of software --
> Scala has lived without them for a long time, after all. Having
> libraries that define useful macros will be useful all on its own, and
> having the possibility of using macros, even if makes builds more
> complex, will be a big plus. So I'm tagging this as an inconvenient
> requirement that can be handled latter, or not at all, if the tooling
> makes it mostly painless. I could put all macros on a subproject, for
> instance, and have the rest of the code depend on it.
>
> This discussion brought another question to my mind, however: will I
> be able to define a macro and then use it in a single REPL session, or
> will I have to compile all my macros beforehand?
>
>
>
>
>
>
>
> > On Jan 23, 3:22 pm, Daniel Sobral wrote:
> >> On Sun, Jan 22, 2012 at 21:32, Eugene Burmako wrote:
> >> > Hey! A few days ago, on this Friday, we've merged a pull request to
> >> > scala/scala that represents significant progress with macros.
>
> >> > I'd love you to explore our current take on macros and, possibly, get
> >> > assistance from a walkthrough from my recent talk in Kyiv (http://
> >> > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> >> > very welcome - if something doesn't work out with your macro test-
> >> > drive, let me know, and I'll try to fix the troubles.
>
> >> > In the meanwhile, we'll be polishing the implementation and preparing
> >> > a beta version that will be accompanied by a SIP. See you soon!
>
> >> Is separate compilation something we can expect to be present when
> >> 2.10.0 comes out, or do you plan to "fix" it so macros can be compiled
> >> together with code that uses before that?
>
> >> --
> >> Daniel C. Sobral
>
> >> I travel to the future all the time.
>
> --
> Daniel C. Sobral
>
> I travel to the future all the time.

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: Re: Alpha version of macros
If I remember my AD&D correctly, then there's really only one kind of entity that gets summoned...
I've heard people say before that Paul codes like a daemon; but had no idea that it was meant so literally!


On 23 January 2012 14:59, Eugene Burmako <eugene [dot] burmako [at] epfl [dot] ch> wrote:
Yeah, this is very valid and awaits a principled solution. With Scala
we have a luxury of multi-stage build already integrated into our
workflow, so we're more or less fine. But, of course, this doesn't
diminish the problem.

Speaking of REPL, I have a feeling that everything will be okay, since
my impression is that REPL compiles every line in a separate
compilation run. Anyways, I'm going to summon Paul (cc'd) to clarify
this situation.

On Jan 23, 3:43 pm, Daniel Sobral <dcsob [dot] [dot] [dot] [at] gmail [dot] com> wrote:
> On Mon, Jan 23, 2012 at 12:29, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> > I wouldn't count on that - current behaviour is more or less
> > satisfactory (and conventional, e.g. Nemerle macro system also has
> > this peculiarity), while we have several high-priority features to
> > implement before the release. Does separate compilation present a
> > significant inconvenience in your scenarios?
>
> It means two things:
>
> 1. Files defining macros cannot use them.
> 2. Software that uses self-defined macros need to be built with two
> compilation steps.
>
> The easiest way I can think to achieve this is to segregate all macros
> into "macro" packages, and introduce two-step-compilation in SBT where
> source from directories named "macro" are compiled in the first step,
> and then the second step puts the target directory from the first in
> the classpath (not default, iirc) and compiles everything except stuff
> inside directories named "macro". The package segregation can be
> avoided if you ignore Java convention.
>
> This is not trivial, or, at least, I don't see a trivial way of doing
> it. Consider how you'll go about changing Scala's build so that it can
> use its own macros, for instance.
>
> Now, macros are not a must-have feature for every piece of software --
> Scala has lived without them for a long time, after all. Having
> libraries that define useful macros will be useful all on its own, and
> having the possibility of using macros, even if makes builds more
> complex, will be a big plus. So I'm tagging this as an inconvenient
> requirement that can be handled latter, or not at all, if the tooling
> makes it mostly painless. I could put all macros on a subproject, for
> instance, and have the rest of the code depend on it.
>
> This discussion brought another question to my mind, however: will I
> be able to define a macro and then use it in a single REPL session, or
> will I have to compile all my macros beforehand?
>
>
>
>
>
>
>
> > On Jan 23, 3:22 pm, Daniel Sobral <dcsob [dot] [dot] [dot] [at] gmail [dot] com> wrote:
> >> On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> >> > Hey! A few days ago, on this Friday, we've merged a pull request to
> >> > scala/scala that represents significant progress with macros.
>
> >> > I'd love you to explore our current take on macros and, possibly, get
> >> > assistance from a walkthrough from my recent talk in Kyiv (http://
> >> > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> >> > very welcome - if something doesn't work out with your macro test-
> >> > drive, let me know, and I'll try to fix the troubles.
>
> >> > In the meanwhile, we'll be polishing the implementation and preparing
> >> > a beta version that will be accompanied by a SIP. See you soon!
>
> >> Is separate compilation something we can expect to be present when
> >> 2.10.0 comes out, or do you plan to "fix" it so macros can be compiled
> >> together with code that uses before that?
>
> >> --
> >> Daniel C. Sobral
>
> >> I travel to the future all the time.
>
> --
> Daniel C. Sobral
>
> I travel to the future all the time.



milessabin
Joined: 2008-08-11,
User offline. Last seen 33 weeks 3 days ago.
Re: Re: Alpha version of macros

On Mon, Jan 23, 2012 at 2:59 PM, Eugene Burmako wrote:
> Yeah, this is very valid and awaits a principled solution. With Scala
> we have a luxury of multi-stage build already integrated into our
> workflow, so we're more or less fine. But, of course, this doesn't
> diminish the problem.

What's the story for Eclipse? Ie. the presentation and build compilers?

Cheers,

Miles

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros

Haven't looked into IDE support yet. However, this (along with
debugging) is what we will definitely address before the release.

On 23 Jan 2012, at 16:35, Miles Sabin wrote:

> On Mon, Jan 23, 2012 at 2:59 PM, Eugene Burmako wrote:
>> Yeah, this is very valid and awaits a principled solution. With Scala
>> we have a luxury of multi-stage build already integrated into our
>> workflow, so we're more or less fine. But, of course, this doesn't
>> diminish the problem.
>
> What's the story for Eclipse? Ie. the presentation and build compilers?
>
> Cheers,
>
>
> Miles
>
> --
> Miles Sabin
> tel: +44 7813 944 528
> gtalk: miles [at] milessabin [dot] com
> skype: milessabin
> g+: http://www.milessabin.com
> http://twitter.com/milessabin
> http://www.chuusai.com/

Paul Phillips
Joined: 2012-01-23,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros


On Mon, Jan 23, 2012 at 6:59 AM, Eugene Burmako <eugene [dot] burmako [at] epfl [dot] ch> wrote:
Speaking of REPL, I have a feeling that everything will be okay, since
my impression is that REPL compiles every line in a separate
compilation run. Anyways, I'm going to summon Paul (cc'd) to clarify
this situation.

Correct, the repl will have the easiest time of anything dealing with any staged compilation requirement, since it does so anyway.
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: Alpha version of macros

On Sun, Jan 22, 2012 at 21:32, Eugene Burmako wrote:
> Hey! A few days ago, on this Friday, we've merged a pull request to
> scala/scala that represents significant progress with macros.
>
> I'd love you to explore our current take on macros and, possibly, get
> assistance from a walkthrough from my recent talk in Kyiv (http://
> scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> very welcome - if something doesn't work out with your macro test-
> drive, let me know, and I'll try to fix the troubles.
>
> In the meanwhile, we'll be polishing the implementation and preparing
> a beta version that will be accompanied by a SIP. See you soon!

I was trying to use the alphakeplerdemo, but I'm getting this error:

dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros Rx.scala
Rx.scala:24: error: unbound wildcard type
def macro forAllMatches(pattern: String, f: _): Unit = {
^
one error found

Shouldn't it have worked?

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros
It would if you used the compiler from alphakeplerdemo: https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The underscore syntax hasn't yet reached the upstream.

On 23 January 2012 19:39, Daniel Sobral <dcsobral [at] gmail [dot] com> wrote:
On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <eugene [dot] burmako [at] epfl [dot] ch> wrote:
> Hey! A few days ago, on this Friday, we've merged a pull request to
> scala/scala that represents significant progress with macros.
>
> I'd love you to explore our current take on macros and, possibly, get
> assistance from a walkthrough from my recent talk in Kyiv (http://
> scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> very welcome - if something doesn't work out with your macro test-
> drive, let me know, and I'll try to fix the troubles.
>
> In the meanwhile, we'll be polishing the implementation and preparing
> a beta version that will be accompanied by a SIP. See you soon!

I was trying to use the alphakeplerdemo, but I'm getting this error:

dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros Rx.scala
Rx.scala:24: error: unbound wildcard type
 def macro forAllMatches(pattern: String, f: _): Unit = {
                                             ^
one error found


Shouldn't it have worked?
--
Daniel C. Sobral

I travel to the future all the time.

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

Hi Eugene,

am I missing something?

C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
anything.
(Java HotSpot(TM) Client VM, Java 1.6.0_30).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val two = scala"2"
:7: error: value scala is not a member of
scala.reflect.QuasiquoteLiter
al
val two = scala"2"
^

scala> val four = scala"$two + $two"
:7: error: not found: value two
val four = scala"$two + $two"
^

On 23 jan, 19:43, Eugene Burmako wrote:
> It would if you used the compiler from alphakeplerdemo:https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> underscore syntax hasn't yet reached the upstream.
>
> On 23 January 2012 19:39, Daniel Sobral wrote:
>
>
>
> > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako
> > wrote:
> > > Hey! A few days ago, on this Friday, we've merged a pull request to
> > > scala/scala that represents significant progress with macros.
>
> > > I'd love you to explore our current take on macros and, possibly, get
> > > assistance from a walkthrough from my recent talk in Kyiv (http://
> > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> > > very welcome - if something doesn't work out with your macro test-
> > > drive, let me know, and I'll try to fix the troubles.
>
> > > In the meanwhile, we'll be polishing the implementation and preparing
> > > a beta version that will be accompanied by a SIP. See you soon!
>
> > I was trying to use the alphakeplerdemo, but I'm getting this error:
>
> > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros Rx.scala
> > Rx.scala:24: error: unbound wildcard type
> >  def macro forAllMatches(pattern: String, f: _): Unit = {
> >                                              ^
> > one error found
>
> > Shouldn't it have worked?
> > --
> > Daniel C. Sobral
>
> > I travel to the future all the time.- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
Hello! 

Sorry, the slides have the interpolation id wrong. In this demo, you need to write c"..." to get the quasiquote. Thanks for catching this mistake - I've just updated the slides (http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
Cheers,Eugene
On 30 January 2012 14:09, Dave <dave [dot] mahabiersing [at] hotmail [dot] com> wrote:
Hi Eugene,

am I missing something?

C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
anything.
 (Java HotSpot(TM) Client VM, Java 1.6.0_30).
Type in expressions to have them evaluated.
Type :help for more information.

scala> val two = scala"2"
<console>:7: error: value scala is not a member of
scala.reflect.QuasiquoteLiter
al
      val two = scala"2"
                ^

scala> val four = scala"$two + $two"
<console>:7: error: not found: value two
      val four = scala"$two + $two"
                        ^





On 23 jan, 19:43, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> It would if you used the compiler from alphakeplerdemo:https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> underscore syntax hasn't yet reached the upstream.
>
> On 23 January 2012 19:39, Daniel Sobral <dcsob [dot] [dot] [dot] [at] gmail [dot] com> wrote:
>
>
>
> > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch>
> > wrote:
> > > Hey! A few days ago, on this Friday, we've merged a pull request to
> > > scala/scala that represents significant progress with macros.
>
> > > I'd love you to explore our current take on macros and, possibly, get
> > > assistance from a walkthrough from my recent talk in Kyiv (http://
> > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback is
> > > very welcome - if something doesn't work out with your macro test-
> > > drive, let me know, and I'll try to fix the troubles.
>
> > > In the meanwhile, we'll be polishing the implementation and preparing
> > > a beta version that will be accompanied by a SIP. See you soon!
>
> > I was trying to use the alphakeplerdemo, but I'm getting this error:
>
> > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros Rx.scala
> > Rx.scala:24: error: unbound wildcard type
> >  def macro forAllMatches(pattern: String, f: _): Unit = {
> >                                              ^
> > one error found
>
> > Shouldn't it have worked?
> > --
> > Daniel C. Sobral
>
> > I travel to the future all the time.- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

Okay, and where comes showRaw from?

scala> four match { case c"2 + $x" => println(showRaw(x)) }
:10: error: not found: value showRaw
four match { case c"2 + $x" => println(showRaw(x)) }
^

On 30 jan, 15:12, Eugene Burmako wrote:
> Hello!
>
> Sorry, the slides have the interpolation id wrong. In this demo, you need
> to write c"..." to get the quasiquote. Thanks for catching this mistake -
> I've just updated the slides (http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
>
> Cheers,
> Eugene
>
> On 30 January 2012 14:09, Dave wrote:
>
>
>
> > Hi Eugene,
>
> > am I missing something?
>
> > C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
> > Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
> > anything.
> >  (Java HotSpot(TM) Client VM, Java 1.6.0_30).
> > Type in expressions to have them evaluated.
> > Type :help for more information.
>
> > scala> val two = scala"2"
> > :7: error: value scala is not a member of
> > scala.reflect.QuasiquoteLiter
> > al
> >       val two = scala"2"
> >                 ^
>
> > scala> val four = scala"$two + $two"
> > :7: error: not found: value two
> >       val four = scala"$two + $two"
> >                         ^
>
> > On 23 jan, 19:43, Eugene Burmako wrote:
> > > It would if you used the compiler from alphakeplerdemo:
> >https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> > > underscore syntax hasn't yet reached the upstream.
>
> > > On 23 January 2012 19:39, Daniel Sobral wrote:
>
> > > > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako
> > > > wrote:
> > > > > Hey! A few days ago, on this Friday, we've merged a pull request to
> > > > > scala/scala that represents significant progress with macros.
>
> > > > > I'd love you to explore our current take on macros and, possibly, get
> > > > > assistance from a walkthrough from my recent talk in Kyiv (http://
> > > > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback
> > is
> > > > > very welcome - if something doesn't work out with your macro test-
> > > > > drive, let me know, and I'll try to fix the troubles.
>
> > > > > In the meanwhile, we'll be polishing the implementation and preparing
> > > > > a beta version that will be accompanied by a SIP. See you soon!
>
> > > > I was trying to use the alphakeplerdemo, but I'm getting this error:
>
> > > > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros
> > Rx.scala
> > > > Rx.scala:24: error: unbound wildcard type
> > > >  def macro forAllMatches(pattern: String, f: _): Unit = {
> > > >                                              ^
> > > > one error found
>
> > > > Shouldn't it have worked?
> > > > --
> > > > Daniel C. Sobral
>
> > > > I travel to the future all the time.- Tekst uit oorspronkelijk bericht
> > niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
import scala.reflect.mirror._

On 30 January 2012 16:04, Dave <dave [dot] mahabiersing [at] hotmail [dot] com> wrote:
Okay, and where comes showRaw from?

scala> four match { case c"2 + $x" => println(showRaw(x)) }
<console>:10: error: not found: value showRaw
             four match { case c"2 + $x" => println(showRaw(x)) }
                                                    ^


On 30 jan, 15:12, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> Hello!
>
> Sorry, the slides have the interpolation id wrong. In this demo, you need
> to write c"..." to get the quasiquote. Thanks for catching this mistake -
> I've just updated the slides (http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
>
> Cheers,
> Eugene
>
> On 30 January 2012 14:09, Dave <dave [dot] mahabiers [dot] [dot] [dot] [at] hotmail [dot] com> wrote:
>
>
>
> > Hi Eugene,
>
> > am I missing something?
>
> > C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
> > Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
> > anything.
> >  (Java HotSpot(TM) Client VM, Java 1.6.0_30).
> > Type in expressions to have them evaluated.
> > Type :help for more information.
>
> > scala> val two = scala"2"
> > <console>:7: error: value scala is not a member of
> > scala.reflect.QuasiquoteLiter
> > al
> >       val two = scala"2"
> >                 ^
>
> > scala> val four = scala"$two + $two"
> > <console>:7: error: not found: value two
> >       val four = scala"$two + $two"
> >                         ^
>
> > On 23 jan, 19:43, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> > > It would if you used the compiler from alphakeplerdemo:
> >https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> > > underscore syntax hasn't yet reached the upstream.
>
> > > On 23 January 2012 19:39, Daniel Sobral <dcsob [dot] [dot] [dot] [at] gmail [dot] com> wrote:
>
> > > > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch>
> > > > wrote:
> > > > > Hey! A few days ago, on this Friday, we've merged a pull request to
> > > > > scala/scala that represents significant progress with macros.
>
> > > > > I'd love you to explore our current take on macros and, possibly, get
> > > > > assistance from a walkthrough from my recent talk in Kyiv (http://
> > > > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your feedback
> > is
> > > > > very welcome - if something doesn't work out with your macro test-
> > > > > drive, let me know, and I'll try to fix the troubles.
>
> > > > > In the meanwhile, we'll be polishing the implementation and preparing
> > > > > a beta version that will be accompanied by a SIP. See you soon!
>
> > > > I was trying to use the alphakeplerdemo, but I'm getting this error:
>
> > > > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros
> > Rx.scala
> > > > Rx.scala:24: error: unbound wildcard type
> > > >  def macro forAllMatches(pattern: String, f: _): Unit = {
> > > >                                              ^
> > > > one error found
>
> > > > Shouldn't it have worked?
> > > > --
> > > > Daniel C. Sobral
>
> > > > I travel to the future all the time.- Tekst uit oorspronkelijk bericht
> > niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

I got this:

scala> four
res5: scala.reflect.Code[Int] = Code(tree = 2.$plus(2), manifest =
Int)

scala> four match { case c"2 + $x" => println(showRaw(x))
| case _ => println("something else")
| }
something else

Extracting quasi-quotations does not seem to work.
Is something changed in the syntax?

I have to add an extra line "case _ => println("something else")"
which is not mentioned in the pdf, because otherwise I get a non-
exhaustive error.

On 30 jan, 16:40, Eugene Burmako wrote:
> import scala.reflect.mirror._
>
> On 30 January 2012 16:04, Dave wrote:
>
>
>
> > Okay, and where comes showRaw from?
>
> > scala> four match { case c"2 + $x" => println(showRaw(x)) }
> > :10: error: not found: value showRaw
> >              four match { case c"2 + $x" => println(showRaw(x)) }
> >                                                     ^
>
> > On 30 jan, 15:12, Eugene Burmako wrote:
> > > Hello!
>
> > > Sorry, the slides have the interpolation id wrong. In this demo, you need
> > > to write c"..." to get the quasiquote. Thanks for catching this mistake -
> > > I've just updated the slides (
> >http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
>
> > > Cheers,
> > > Eugene
>
> > > On 30 January 2012 14:09, Dave wrote:
>
> > > > Hi Eugene,
>
> > > > am I missing something?
>
> > > > C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
> > > > Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
> > > > anything.
> > > >  (Java HotSpot(TM) Client VM, Java 1.6.0_30).
> > > > Type in expressions to have them evaluated.
> > > > Type :help for more information.
>
> > > > scala> val two = scala"2"
> > > > :7: error: value scala is not a member of
> > > > scala.reflect.QuasiquoteLiter
> > > > al
> > > >       val two = scala"2"
> > > >                 ^
>
> > > > scala> val four = scala"$two + $two"
> > > > :7: error: not found: value two
> > > >       val four = scala"$two + $two"
> > > >                         ^
>
> > > > On 23 jan, 19:43, Eugene Burmako wrote:
> > > > > It would if you used the compiler from alphakeplerdemo:
> > > >https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> > > > > underscore syntax hasn't yet reached the upstream.
>
> > > > > On 23 January 2012 19:39, Daniel Sobral wrote:
>
> > > > > > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <
> > eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch>
> > > > > > wrote:
> > > > > > > Hey! A few days ago, on this Friday, we've merged a pull request
> > to
> > > > > > > scala/scala that represents significant progress with macros.
>
> > > > > > > I'd love you to explore our current take on macros and,
> > possibly, get
> > > > > > > assistance from a walkthrough from my recent talk in Kyiv
> > (http://
> > > > > > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your
> > feedback
> > > > is
> > > > > > > very welcome - if something doesn't work out with your macro
> > test-
> > > > > > > drive, let me know, and I'll try to fix the troubles.
>
> > > > > > > In the meanwhile, we'll be polishing the implementation and
> > preparing
> > > > > > > a beta version that will be accompanied by a SIP. See you soon!
>
> > > > > > I was trying to use the alphakeplerdemo, but I'm getting this
> > error:
>
> > > > > > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros
> > > > Rx.scala
> > > > > > Rx.scala:24: error: unbound wildcard type
> > > > > >  def macro forAllMatches(pattern: String, f: _): Unit = {
> > > > > >                                              ^
> > > > > > one error found
>
> > > > > > Shouldn't it have worked?
> > > > > > --
> > > > > > Daniel C. Sobral
>
> > > > > > I travel to the future all the time.- Tekst uit oorspronkelijk
> > bericht
> > > > niet weergeven -
>
> > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit
> > oorspronkelijk bericht niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
All right, my mistake again. You should match code.tree, not code. Guide has been updated again, thanks.

On 30 January 2012 17:25, Dave <dave [dot] mahabiersing [at] hotmail [dot] com> wrote:
I got this:

scala> four
res5: scala.reflect.Code[Int] = Code(tree = 2.$plus(2), manifest =
Int)

scala> four match { case c"2 + $x" => println(showRaw(x))
    | case _ => println("something else")
    | }
something else

Extracting quasi-quotations does not seem to work.
Is something changed in the syntax?

I have to add an extra line "case _ => println("something else")"
which is not mentioned in the pdf, because otherwise I get a non-
exhaustive error.



On 30 jan, 16:40, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> import scala.reflect.mirror._
>
> On 30 January 2012 16:04, Dave <dave [dot] mahabiers [dot] [dot] [dot] [at] hotmail [dot] com> wrote:
>
>
>
> > Okay, and where comes showRaw from?
>
> > scala> four match { case c"2 + $x" => println(showRaw(x)) }
> > <console>:10: error: not found: value showRaw
> >              four match { case c"2 + $x" => println(showRaw(x)) }
> >                                                     ^
>
> > On 30 jan, 15:12, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> > > Hello!
>
> > > Sorry, the slides have the interpolation id wrong. In this demo, you need
> > > to write c"..." to get the quasiquote. Thanks for catching this mistake -
> > > I've just updated the slides (
> >http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
>
> > > Cheers,
> > > Eugene
>
> > > On 30 January 2012 14:09, Dave <dave [dot] mahabiers [dot] [dot] [dot] [at] hotmail [dot] com> wrote:
>
> > > > Hi Eugene,
>
> > > > am I missing something?
>
> > > > C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
> > > > Welcome to Scala version 2.10.0.fatal: No names found, cannot describe
> > > > anything.
> > > >  (Java HotSpot(TM) Client VM, Java 1.6.0_30).
> > > > Type in expressions to have them evaluated.
> > > > Type :help for more information.
>
> > > > scala> val two = scala"2"
> > > > <console>:7: error: value scala is not a member of
> > > > scala.reflect.QuasiquoteLiter
> > > > al
> > > >       val two = scala"2"
> > > >                 ^
>
> > > > scala> val four = scala"$two + $two"
> > > > <console>:7: error: not found: value two
> > > >       val four = scala"$two + $two"
> > > >                         ^
>
> > > > On 23 jan, 19:43, Eugene Burmako <eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch> wrote:
> > > > > It would if you used the compiler from alphakeplerdemo:
> > > >https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler. The
> > > > > underscore syntax hasn't yet reached the upstream.
>
> > > > > On 23 January 2012 19:39, Daniel Sobral <dcsob [dot] [dot] [dot] [at] gmail [dot] com> wrote:
>
> > > > > > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <
> > eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch>
> > > > > > wrote:
> > > > > > > Hey! A few days ago, on this Friday, we've merged a pull request
> > to
> > > > > > > scala/scala that represents significant progress with macros.
>
> > > > > > > I'd love you to explore our current take on macros and,
> > possibly, get
> > > > > > > assistance from a walkthrough from my recent talk in Kyiv
> > (http://
> > > > > > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your
> > feedback
> > > > is
> > > > > > > very welcome - if something doesn't work out with your macro
> > test-
> > > > > > > drive, let me know, and I'll try to fix the troubles.
>
> > > > > > > In the meanwhile, we'll be polishing the implementation and
> > preparing
> > > > > > > a beta version that will be accompanied by a SIP. See you soon!
>
> > > > > > I was trying to use the alphakeplerdemo, but I'm getting this
> > error:
>
> > > > > > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac -Xmacros
> > > > Rx.scala
> > > > > > Rx.scala:24: error: unbound wildcard type
> > > > > >  def macro forAllMatches(pattern: String, f: _): Unit = {
> > > > > >                                              ^
> > > > > > one error found
>
> > > > > > Shouldn't it have worked?
> > > > > > --
> > > > > > Daniel C. Sobral
>
> > > > > > I travel to the future all the time.- Tekst uit oorspronkelijk
> > bericht
> > > > niet weergeven -
>
> > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit
> > oorspronkelijk bericht niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

Yeah!

scala> four.tree match { case c"2 + $x" => println(showRaw(x))
| case _ => println("something else")
| }
Literal(Constant(2))

On Jan 30, 6:04 pm, Eugene Burmako wrote:
> All right, my mistake again. You should match code.tree, not code. Guide
> has been updated again, thanks.
>
> On 30 January 2012 17:25, Dave wrote:
>
>
>
> > I got this:
>
> > scala> four
> > res5: scala.reflect.Code[Int] = Code(tree = 2.$plus(2), manifest =
> > Int)
>
> > scala> four match { case c"2 + $x" => println(showRaw(x))
> >     | case _ => println("something else")
> >     | }
> > something else
>
> > Extracting quasi-quotations does not seem to work.
> > Is something changed in the syntax?
>
> > I have to add an extra line "case _ => println("something else")"
> > which is not mentioned in the pdf, because otherwise I get a non-
> > exhaustive error.
>
> > On 30 jan, 16:40, Eugene Burmako wrote:
> > > import scala.reflect.mirror._
>
> > > On 30 January 2012 16:04, Dave wrote:
>
> > > > Okay, and where comes showRaw from?
>
> > > > scala> four match { case c"2 + $x" => println(showRaw(x)) }
> > > > :10: error: not found: value showRaw
> > > >              four match { case c"2 + $x" => println(showRaw(x)) }
> > > >                                                     ^
>
> > > > On 30 jan, 15:12, Eugene Burmako wrote:
> > > > > Hello!
>
> > > > > Sorry, the slides have the interpolation id wrong. In this demo, you
> > need
> > > > > to write c"..." to get the quasiquote. Thanks for catching this
> > mistake -
> > > > > I've just updated the slides (
> > > >http://scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf) to fix it.
>
> > > > > Cheers,
> > > > > Eugene
>
> > > > > On 30 January 2012 14:09, Dave
> > wrote:
>
> > > > > > Hi Eugene,
>
> > > > > > am I missing something?
>
> > > > > > C:\Users\Dave\alphakeplerdemo>.\compiler\scala.bat -Xquasiquotes
> > > > > > Welcome to Scala version 2.10.0.fatal: No names found, cannot
> > describe
> > > > > > anything.
> > > > > >  (Java HotSpot(TM) Client VM, Java 1.6.0_30).
> > > > > > Type in expressions to have them evaluated.
> > > > > > Type :help for more information.
>
> > > > > > scala> val two = scala"2"
> > > > > > :7: error: value scala is not a member of
> > > > > > scala.reflect.QuasiquoteLiter
> > > > > > al
> > > > > >       val two = scala"2"
> > > > > >                 ^
>
> > > > > > scala> val four = scala"$two + $two"
> > > > > > :7: error: not found: value two
> > > > > >       val four = scala"$two + $two"
> > > > > >                         ^
>
> > > > > > On 23 jan, 19:43, Eugene Burmako wrote:
> > > > > > > It would if you used the compiler from alphakeplerdemo:
> > > > > >https://github.com/xeno-by/alphakeplerdemo/tree/skeleton/compiler.
> > The
> > > > > > > underscore syntax hasn't yet reached the upstream.
>
> > > > > > > On 23 January 2012 19:39, Daniel Sobral
> > wrote:
>
> > > > > > > > On Sun, Jan 22, 2012 at 21:32, Eugene Burmako <
> > > > eugene [dot] burm [dot] [dot] [dot] [at] epfl [dot] ch>
> > > > > > > > wrote:
> > > > > > > > > Hey! A few days ago, on this Friday, we've merged a pull
> > request
> > > > to
> > > > > > > > > scala/scala that represents significant progress with macros.
>
> > > > > > > > > I'd love you to explore our current take on macros and,
> > > > possibly, get
> > > > > > > > > assistance from a walkthrough from my recent talk in Kyiv
> > > > (http://
> > > > > > > > > scalamacros.org/talks/2012-01-14-EnAlphaKepler.pdf). Your
> > > > feedback
> > > > > > is
> > > > > > > > > very welcome - if something doesn't work out with your macro
> > > > test-
> > > > > > > > > drive, let me know, and I'll try to fix the troubles.
>
> > > > > > > > > In the meanwhile, we'll be polishing the implementation and
> > > > preparing
> > > > > > > > > a beta version that will be accompanied by a SIP. See you
> > soon!
>
> > > > > > > > I was trying to use the alphakeplerdemo, but I'm getting this
> > > > error:
>
> > > > > > > > dcs@ayanami:~/github/alphakeplerdemo (skeleton)$ scalac
> > -Xmacros
> > > > > > Rx.scala
> > > > > > > > Rx.scala:24: error: unbound wildcard type
> > > > > > > >  def macro forAllMatches(pattern: String, f: _): Unit = {
> > > > > > > >                                              ^
> > > > > > > > one error found
>
> > > > > > > > Shouldn't it have worked?
> > > > > > > > --
> > > > > > > > Daniel C. Sobral
>
> > > > > > > > I travel to the future all the time.- Tekst uit oorspronkelijk
> > > > bericht
> > > > > > niet weergeven -
>
> > > > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit
> > > > oorspronkelijk bericht niet weergeven -
>
> > > > > - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit
> > oorspronkelijk bericht niet weergeven -
>
> > > - Tekst uit oorspronkelijk bericht weergeven -- Hide quoted text -
>
> - Show quoted text -

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

Is it (already) possible to translate this idiomatic Nemerle code to
Scala?

[MacroUsage(MacroPhase.BeforeTypedMembers, MacroTargets.Class)]
macro Extensible(typeBuilder : TypeBuilder)
{
ExtensibleImpl.DoTransform(Macros.ImplicitCTX(), typeBuilder)
}

module ExtensibleImpl
{
public DoTransform(typer : Typer, typeBuilder : TypeBuilder) :
void
{
Macros.DefineCTX(typer);

//here goes the rest
}
}

And the use site of the macro e.g.:

[Extensible]
public abstract class Node {}

so in other words what is TypeBuilder, Typer and the macro attribute
[Extensible]
in Scala?

And is there an equivalent typeBuilder.Define(ast) in Scala?

e.g. in:

def defineMethod(ast : ClassMember) : void { typeBuilder.Define(ast) }

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: Alpha version of macros

Eugene, maybe you are in the best position to answer this question
below.

On 31 jan, 19:34, Dave wrote:
> Is it (already) possible to translate this idiomatic Nemerle code to
> Scala?
>
>   [MacroUsage(MacroPhase.BeforeTypedMembers, MacroTargets.Class)]
>   macro Extensible(typeBuilder : TypeBuilder)
>   {
>     ExtensibleImpl.DoTransform(Macros.ImplicitCTX(), typeBuilder)
>   }
>
>   module ExtensibleImpl
>   {
>     public DoTransform(typer : Typer, typeBuilder : TypeBuilder) :
> void
>     {
>       Macros.DefineCTX(typer);
>
>       //here goes the rest
>     }
>   }
>
> And the use site of the macro e.g.:
>
> [Extensible]
> public abstract class Node {}
>
> so in other words what is TypeBuilder, Typer and the macro attribute
> [Extensible]
> in Scala?
>
> And is there an equivalent typeBuilder.Define(ast) in Scala?
>
> e.g. in:
>
> def defineMethod(ast : ClassMember) : void { typeBuilder.Define(ast) }

Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros

Speaking of the typeBuilder question, inside a macro you have access
to compiler context via an implicit parameter that's generated into
macro signatures. This context represents a restricted subset of the
compiler API, and this subset currently doesn't include any facilities
to operate on classes/members.

For now making macro defs stable is our top priority. Codegen in the
large (macro types) is a next step, but it's hard to predict when it's
going to happen. Same for macro annotations. We kinds of like them,
but implementing them is not our priority now.

On Feb 2, 11:40 am, Dave wrote:
> Eugene, maybe you are in the best position to answer this question
> below.
>
> On 31 jan, 19:34, Dave wrote:
>
>
>
> > Is it (already) possible to translate this idiomatic Nemerle code to
> > Scala?
>
> >   [MacroUsage(MacroPhase.BeforeTypedMembers, MacroTargets.Class)]
> >   macro Extensible(typeBuilder : TypeBuilder)
> >   {
> >     ExtensibleImpl.DoTransform(Macros.ImplicitCTX(), typeBuilder)
> >   }
>
> >   module ExtensibleImpl
> >   {
> >     public DoTransform(typer : Typer, typeBuilder : TypeBuilder) :
> > void
> >     {
> >       Macros.DefineCTX(typer);
>
> >       //here goes the rest
> >     }
> >   }
>
> > And the use site of the macro e.g.:
>
> > [Extensible]
> > public abstract class Node {}
>
> > so in other words what is TypeBuilder, Typer and the macro attribute
> > [Extensible]
> > in Scala?
>
> > And is there an equivalent typeBuilder.Define(ast) in Scala?
>
> > e.g. in:
>
> > def defineMethod(ast : ClassMember) : void { typeBuilder.Define(ast) }

Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros
Hi Eugene,

So what are the plans regarding macros and 2.10? I'm a bit scared of the idea that Scala devs are again pushing out some (cool) feature _without_ any reasonable example/implementation on how to use it. (See scala.Dynamic, scala.DelayedInit, ...)

The 2.10 release seems to be one of the largest feature releases ever, even without macros. I assume Typesafe wants to release it before (or on) ScalaDays, so the time is running out fast for testing.

The meeting notes also stopped being publsihed months ago, so it is really hard to see in which direction Scala is moving. It is not your fault of course but I find the information coming from Typesafe/EPFL to be _very_ lacking.

Thanks!

Simon
Ismael Juma 2
Joined: 2011-01-22,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
On Thu, Feb 2, 2012 at 11:26 AM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
The 2.10 release seems to be one of the largest feature releases ever, even without macros. I assume Typesafe wants to release it before (or on) ScalaDays, so the time is running out fast for testing.

Why do you assume that?
Best,Ismael
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
Because they said[1] that Scala 2.10 is released in the beginning of 2012. And April is probably already a stretched term for "beginning".

[1]
http://www.slideshare.net/Odersky
http://it-republik.de/jaxenter/news/Martin-Odersky-gibt-Einblick-in-Scal...
http://www.slideshare.net/marakana/martin-odersky-whats-next-for-scala
Eugene Burmako
Joined: 2011-09-17,
User offline. Last seen 42 years 45 weeks ago.
Re: Alpha version of macros

Hi Simon,

I am currently preparing a SIP and it will depend on how that is
discussed whether and when the idea is accepted.

All the best,
Eugene

On Feb 2, 12:26 pm, Simon Ochsenreither
wrote:
> Hi Eugene,
>
> So what are the plans regarding macros and 2.10? I'm a bit scared of the
> idea that Scala devs are again pushing out some (cool) feature _without_
> any reasonable example/implementation on how to use it. (See scala.Dynamic,
> scala.DelayedInit, ...)
>
> The 2.10 release seems to be one of the largest feature releases ever, even
> without macros. I assume Typesafe wants to release it before (or on)
> ScalaDays, so the time is running out fast for testing.
>
> The meeting notes also stopped being publsihed months ago, so it is really
> hard to see in which direction Scala is moving. It is not your fault of
> course but I find the information coming from Typesafe/EPFL to be _very_
> lacking.
>
> Thanks!
>
> Simon

Ismael Juma 2
Joined: 2011-01-22,
User offline. Last seen 42 years 45 weeks ago.
Re: Re: Alpha version of macros
On Thu, Feb 2, 2012 at 11:58 AM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
Because they said[1] that Scala 2.10 is released in the beginning of 2012. And April is probably already a stretched term for "beginning".

Looks difficult to achieve given that we have only had a single milestone, features are still being developed and it's already February.
Best,Ismael
adriaanm
Joined: 2010-02-08,
User offline. Last seen 31 weeks 4 days ago.
Re: Re: Alpha version of macros
The meeting notes also stopped being publsihed months ago,
that's my fault -- I've been busy with the virtual pattern matcher implementation, scala-virtualized maintenance, a conference and of course the xmas break
I'm going to make a summary of the notes you have missed, but I'm confident that 90% of their contents has been covered by discussion on this very list.
adriaan

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland