Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1036327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:41:09+00:00 2026-05-16T14:41:09+00:00

I’ve seen several Scala questions recently (e.g. here , here , and here )

  • 0

I’ve seen several Scala questions recently (e.g. here, here, and here) that called for the use of proxies, and it’s come up more than once in my own work. The Scala library has a number of proxy traits (14, if I counted correctly).

Proxy classes/traits usually contain lots of boilerplate:

class FooProxy(val self: Foo) extends Foo {
   // added behavior
   def mymethod = ...

   // forwarding methods
   def method1 = self.method1
   def method2(arg: String) = self.method2(arg)
   ...
}

trait Foo {
   def method1: Unit
   def method2(arg: String): Unit
}

My first thought was to define a Proxy[T] trait that could be used as follows:

class FooProxy(val self: Foo) extends Proxy[Foo] {
   // added behavior
   def mymethod = ...
}

where trait Proxy[T] extends T. Of course, it’s not actually possible to define the Proxy trait without compiler magic.

My next thought was to look for a compiler plugin (such a capability clearly isn’t in the existing compiler, or the sources for those 14 proxy traits would be much smaller). Sure enough, I found Kevin Wright’s AutoProxy plugin. The plugin is intended to solve the proxy issue neatly, along with other use cases (including dynamic mixins):

class FooProxy(@proxy val self: Foo) { ... }

Unfortunately, it looks like work on it stalled in November (2009). So, my questions are

  1. Is there continuing work on the AutoProxy plugin?
  2. Will this find its way into the compiler?
  3. Are any other approaches being considered?
  4. Finally, does this point to a significant weakness in Scala? After all, wouldn’t it be possible to define a Proxy trait given lisp-style macros?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:41:10+00:00Added an answer on May 16, 2026 at 2:41 pm

    Four questions, four answers

    1. I am, though family has to come first! Plus others are involved in looking at the general issue with synthesizing methods in a compiler plugin.

    2. If so, it will most likely be in a different form, perhaps without using annotations.

    3. I don’t know of any equivalent plugins, although one of the Scala GSOC candidate projects was based partly on my autoproxy code. There is, however, one very clean solution that will work in most cases and doesn’t need a compiler plugin at all: You define an implicit conversion from FooProxy to Foo that simply returns the self member; this will get you most of the way there. The main issues with the approach are that it’ll make life harder if you need to use your code from Java, it may be less efficient in terms of speed/memory, and it’s another imlicit that you have to be aware of.

    4. The frustrating part is that almost all of the necessary logic is already available in the compiler, and it’s used for mixins, so there really should be an elegant way of handling the task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.