Git Product home page Git Product logo

Comments (11)

lihaoyi avatar lihaoyi commented on July 22, 2024 3

@KuceraMartin said he wanted to look into this, but if anyone else wants to try their hand at this feel free to do so

from scalasql.

vvidlearn avatar vvidlearn commented on July 22, 2024 2

hi @mrdziuban sorry for the late reply, I am just a macro beginner. So it was beyond me. glad you completed it.

from scalasql.

lihaoyi avatar lihaoyi commented on July 22, 2024 1

Hi this sounds like an interesting exercise. I am new to macros but consider this as an opportunity to learn them. So would like to work on it if its ok. Thank you.

Please go ahead! No need to ask me for permission

from scalasql.

ghik avatar ghik commented on July 22, 2024

Sounds like a fun thing to do

from scalasql.

ghik avatar ghik commented on July 22, 2024

I tried doing this and discovered scala/scala3#19480

from scalasql.

KuceraMartin avatar KuceraMartin commented on July 22, 2024

I discovered scala/scala3#19436 in #3. I also tried a different approach with mirrors and ran into another compiler crash scala/scala3#19493.

It seems there are many different ways to approach this. @ghik would you be interested in discussing our thoughts? Maybe together we could find another approach that doesn't break the compiler :D

from scalasql.

ghik avatar ghik commented on July 22, 2024

Sure, but I haven't even gotten to porting the macro itself. I just tried to compile tests on Scala 3...

from scalasql.

KuceraMartin avatar KuceraMartin commented on July 22, 2024

Actually I never tried compiling all the tests. Now that I did, I see I'm getting the same compiler crash as you.

I started by removing most tests and trying to write a macro that would generate something similar to what the Scala 2 TableMacros does, as per @lihaoyi's advice. You could try the same thing if you want. If you do so, you can cherry-pick this commit a96df75 which fixes some trivial Scala 3 incompatibilities outside of macros. Then, delete all tests except for e.g. Main.scala. Then, if you just replace TableMacros with

trait TableMacros:
   given metadata[V[_[_]]]: Table.Metadata[V] = ???

it will at least compile. Later on, you can start adding some tests back. I tried multiple and never ran into that compiler crash. For instance SqliteExample.scala should work.

If you're interested in discussing it further, let's connect on Discord (mine is martin.kucera)

from scalasql.

ghik avatar ghik commented on July 22, 2024

@KuceraMartin FYI scala/scala3#19480 already has a working fix on the way, I compiled the tests successfully with it

I'm going to take a break from this for now, but I'll be happy to discuss details if I come back to it.

from scalasql.

vvidlearn avatar vvidlearn commented on July 22, 2024

Hi this sounds like an interesting exercise. I am new to macros but consider this as an opportunity to learn them. So would like to work on it if its ok. If this will be too much of an effort for a macro newbie I am happy for someone else to work on this.Thank you.

from scalasql.

mrdziuban avatar mrdziuban commented on July 22, 2024

Hey @vvidlearn, are you still looking into this? I'm curious to look as well but don't want to step on your toes

from scalasql.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.