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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T04:41:19+00:00 2026-05-20T04:41:19+00:00

I have an upcoming project in which a core requirement will be to mutate

  • 0

I have an upcoming project in which a core requirement will be to mutate the way a method works at runtime. Note that I’m not talking about a higher level OO concept like “shadow one method with another”, although the practical effect would be similar.

The key properties I’m after are:

  • I must be able to modify the method in such a way that I can add new expressions, remove existing expressions, or modify any of the expressions that take place in it.

  • After modifying the method, subsequent calls to that method would invoke the new sequence of operations. (Or, if the language binds methods rather than evaluating every single time, provide me a way to unbind/rebind the new method.)

  • Ideally, I would like to manipulate the atomic units of the language (e.g., “invoke method foo on object bar“) and not the assembly directly (e.g. “pop these three parameters onto the stack”). In other words, I’d like to be able to have high confidence that the operations I construct are semantically meaningful in the language. But I’ll take what I can get.

If you’re not sure if a candidate language meets these criteria, here’s a simple litmus test:

Can you write another method called clean which:

  • accepts a method m as input

  • returns another method m2 that performs the same operations as m

  • such that m2 is identical to m, but doesn’t contain any calls to the print-to-standard-out method in your language (puts, System.Console.WriteLn, println, etc.)?

I’d like to do some preliminary research now and figure out what the strongest candidates are. Having a large, active community is as important to me as the practicality of implementing what I want to do. I am aware that there may be some unforged territory here, since manipulating bytecode directly is not typically an operation that needs to be exposed.

What are the choices available to me? If possible, can you provide a toy example in one or more of the languages that you recommend, or point me to a recent example?


Update: The reason I’m after this is that I’d like to write a program which is capable of modifying itself at runtime in response to new information. This modification goes beyond mere parameters or configurable data, but full-fledged, evolved changes in behavior. (No, I’m not writing a virus. 😉 )

  • 1 1 Answer
  • 2 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-20T04:41:19+00:00Added an answer on May 20, 2026 at 4:41 am

    Well, you could always use .NET and the Expression libraries to build up expressions. That I think is really your best bet as you can build up representations of commands in memory and there is good library support for manipulating, traversing, etc.

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

Sidebar

Related Questions

Hey All, I have an upcoming project that will require the same assets (images,
I have an upcoming project where the core of it will be storing a
I have an upcoming project in a class that will allow me to work
I'm looking for a good ORM for an upcoming project. The database will have
I have an upcoming project that I would like to use the HTML5 canvas
We have an upcoming project to allow an old platform that's only extensible with
I have an upcoming project coming up in which I want to dedicate several
I have an upcoming project that requires me to make a custom layout. I
Greetings. I am studying the way mpeg layer-III encoding works for an upcoming project.
I am learning socket programming for use in an upcoming project, and I have

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.