These are chat archives for ThoughtWorksInc/Binding.scala

14th
Dec 2016
Carlos A. Rueda
@carueda
Dec 14 2016 00:12
https://blog.jetbrains.com/scala/2016/11/11/intellij-idea-2016-3-rc-scala-js-scala-meta-and-more/ seems to indicate that the expansion of the meta annotations (like @dom) should now be supported, but I haven't been able to make it work. Any suggestion from people here also using IntelliJ would be welcome. (BTW, Binding.scala is amazing!)
杨博 (Yang Bo)
@Atry
Dec 14 2016 00:36
I guess the blog means IntelliJ IDEA support macro annotations written with scala.meta. However, @dom is an old macro annotation not using scala.meta
Carlos A. Rueda
@carueda
Dec 14 2016 00:38
Ah, that makes sense! Thanks for the quick reply and clarification. So, the question becomes, when will Binding.scala provide a scala.meta based implementation?
杨博 (Yang Bo)
@Atry
Dec 14 2016 00:40
scala.meta is not powerful enough to replace type-level monadic translation provided by scala-reflect
Carlos A. Rueda
@carueda
Dec 14 2016 00:41
I see ... ok, not that is critical at all, just wondering as it seems scala.meta is intended to eventually supersede the old style macros. Thanks again.
杨博 (Yang Bo)
@Atry
Dec 14 2016 00:42
The monadic translation is implemented in Each/SDE, which is a critical dependency of Binding.scala
However, maybe @dom itself could be implemented in scala.meta, as @dom is barely a syntax sugar, forwarding .bind magic to macros in Each/SDE.
Carlos A. Rueda
@carueda
Dec 14 2016 00:45
that sounds intriguing.
杨博 (Yang Bo)
@Atry
Dec 14 2016 00:48

There are two step to compile a @dom method.

  1. @dom translate your XHTML literal and bind magic to some SDE instructrions
  2. The SDE macro perform monadic translation.

FYI: SDE(Specific Domain Extension) is the name of core library shared by both Binding.scala and Each.

You can invastigate if it is possible to implement a scala.meta version of @dom. The current implemention is merely 431 lines of code. https://github.com/ThoughtWorksInc/Binding.scala/blob/10.0.x/dom/src/main/scala/com/thoughtworks/binding/dom.scala
Carlos A. Rueda
@carueda
Dec 14 2016 00:52
I might give it a try as I Iearn more about scala.meta (unfortunately something not very high in my todo list : /)
Your work and suggestions are really appreciated!
杨博 (Yang Bo)
@Atry
Dec 14 2016 00:54
Never mind. Feel free to create an issue about porting @dom to scala.meta.
Carlos A. Rueda
@carueda
Dec 14 2016 01:01
ThoughtWorksInc/Binding.scala#31
杨博 (Yang Bo)
@Atry
Dec 14 2016 01:09
:+1: