6 ms·
Macros: the Plan for Scala 3
- netvl 8y agoThis post, as far as I can see, does not mention scala-meta-based macros (project called scalamacros I think) at all. What happened with this direction of macros development? Was it abandoned? Or is the new approach built on it?
- pale-hands 8y agoIt seems that scala-meta is alive (http://scalameta.org http://scalameta.org), but is now about developer tools (e.g. code formatting plugin used by IntelliJ). The macro part of scala-meta was spun off to https://github.com/scalacenter/macros https://github.com/scalacenter/macros, which is archived and points to Dotty macros as the way forward. I'll be watching Dotty macros with keen interest, as I have found the current scala macro system very useful despite it remaining experimental. One thing I couldn't do with current macros was provide any kind of generic wrapper around macro methods in the same library, due to the separate compilation pass requirement. I hope this is what staging will address.
- eugene_burmako 8y agoPrompted by a similar question on Reddit, I have written a comment on the history, the scope and the status of Scalameta: https://www.reddit.com/r/scala/comments/8g359q/macros_the_plan_for_scala_3/dy92t9v/ https://www.reddit.com/r/scala/comments/8g359q/macros_the_pl....
- Xuper 8y agoHopefully this will simplify Scala for newcomers and especially speed up onboarding when handing over codebases written by expert developers.
- jrq 8y agoDisclaimer : I'm just some moron on the Internet Unpopular opinion: I hate meta programming. We have composition, why do you need to mess with the nature of things? A long time ago, I was freelancing Rails. I can't accurately describe the deflating feeling of tracing your problem back to some class that one person (a ruby guru warrior, no doubt) wrote, with a few dozen dynamic deeds or to_methods. It's the most demotivating thing I've come across in real life code. It's worse somehow than complicated numeric code, because with the numbers, at least I know this shit works by the end of it. If I start writing good var names, I'll probably even figure out how it works in an hour or two That being said, I'm tentatively excited about Tasty. What a witty name by the way! Having the extra type information should allow for much smarter transforms at the language level and I hope macros in scala 3 aren't so much a mess. Also, let's just get rid of implicits, whaddaya say? ;-) Anyways, proud of the scala 3 team this far. Even though they haven't killed sbt yet, they're putting their work in admirably to a difficult problem. I'd love to have that much meaning and purpose in my own work. I didn't have time to actually read spec, will do later, so if I said something inaccurate, let me know gently Edit: macros will conform to black box and be constrained to their types, runs after type checking. That's awesome
- papaf 8y agoI hate meta programming. We have composition, why do you need to mess with the nature of things? Maybe you just hate bad metaprogramming? In theory metaprogramming makes a language more powerful, leads to less boilerplate code, and can deliver big performance improvements. Scala gives programmers plenty of power which comes with the tradeoffs that there is plenty of opportunity to shoot yourself in the foot or produce unmaintainable code. Scala makes different tradeoffs to Go. Personally, I think that ignoring metaprogramming means missing out on one of the most powerful techniques available to programmers.
- cbzbc 8y agoMaybe you just hate bad metaprogramming Metaprogramming is hard to get right - often harder than writing good libraries, and the number of programmers who can do it well is correspondingly smaller. So of the metaprogramming that's out there in the wild, a correspondingly greater proportion of it is bad.
- hardlianotion 8y agoLi Haoyi shared his alternative to sbt here a little while ago. Looks good to me. http://www.lihaoyi.com/mill/ http://www.lihaoyi.com/mill/
- jrq 8y agoI've seen it a while ago too, but without lightbend blessing it's next to useless, in practical usage. I can't deliver that to a client
- walkingolof 8y agoThere is more to it, sbt has a very rich echo system of plugins, it will take time for any alternative to gain traction.
- jrq 8y ago