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 8446757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:00:20+00:00 2026-06-10T10:00:20+00:00

Some languages like Dart use mirror based reflection so, in simple terms, what is

  • 0

Some languages like Dart use mirror based reflection so, in simple terms, what is the difference between such implementation and traditional reflection as you see in C# or Java.

Update:
I found this excellent (and somewhat quirky) video by Gilad Bracha on Mirror based reflection in Newspeak.
http://www.hpi.uni-potsdam.de/hirschfeld/events/past/media/100105_Bracha_2010_LinguisticReflectionViaMirrors_HPI.mp4 (mirror stuff starts at 7:42)

  • 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-06-10T10:00:22+00:00Added an answer on June 10, 2026 at 10:00 am

    For many uses, I don’t think mirrors will be that different than Java reflection. The most important thing understand about mirrors is that they decouple the reflection API from the standard object API, so instead of obj.getClass() you use reflect(obj). It’s a seemingly small difference, but it gives you a few nice things:

    1. The object API isn’t polluted, and there’s no danger of breaking reflection by overriding a reflective method.
    2. You can potentially have different mirror systems. Say, one that doesn’t allow access to private methods. This could end up being very useful for tools.
    3. The mirror system doesn’t have to be included. For compiling to JS this can be important. If mirrors aren’t used then there’s no out-of-band to access code and pruning becomes viable.
    4. Mirrors can be made to work on remote code, not just local code, since you don’t need the reflected object to be in the same Isolate or VM as the mirror.

    Here’s how mirrors are different than reflection in Java and Javascript when used to get an object’s methods:

    Java:

    myObject.getClass().getMethods(); // returns an array
    

    Dart:

    reflect(myObject).type.methods; // returns a map
    

    Javascript:

    var methods = [];
    for (var m in myObject) {
      if (typeof m === 'function') {
        methods.push(m);
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some languages (e.g. C++) you can't use operators like == for string comparisons
Some programming languages (like haskell ) allow cyclic dependencies between modules. Since the compiler
I think that some newer languages like JS can do this natively, but I
In some languages, like php, you don't need to manually initialize each dimension of
In my application there is language detection. Languages have some identification code like en
I've been wondering why do some languages, such as Java run on Both Linux
I know that some other languages, such as PHP , support a concept of
Some popular languages like Python and Ruby have native, JVM and .Net CLR implementations.
I had some experience on programming languages like Java, C#, Scala as well as
I've seen this pretty funny screencast yesterday about some oddities in languages like Ruby

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.