Results 1 to 7 of 7

Thread: Dynamically Generated Compiled Code

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156

    Dynamically Generated Compiled Code

    Hi folks,

    Is there a way to dynamically generate compiled code? I am after what can be done with reflection but without the performance cost. It seems logical that a good way to accomplish the goal is to compile code at run-time.

    Thoughts? Successes? Ideas?

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Dynamically Generated Compiled Code

    Sounds like an interpreter... Performance cost will be present.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156

    Re: Dynamically Generated Compiled Code

    Using reflection is an interpreter and does come with a performance cost. What I am looking for is potentially a way to construct Java code on the fly and pass it to something that will translate it into byte-code for later use... or anything that comes close to that.

  4. #4
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: Dynamically Generated Compiled Code

    Isn't that the same thing that already happens, though?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156

    Re: Dynamically Generated Compiled Code

    You're right that does happen. The part that I failed to mention is that I would want to retain that compiled code and potentially execute it many times without having to reinterpret it. Hope that clarifies things a touch.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156

    Re: Dynamically Generated Compiled Code

    Found what I was looking for:

    http://java.sys-con.com/read/36843.htm

    Thanks.

  7. #7
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Dynamically Generated Compiled Code

    You can resolve the thread by clicking on the Thread Tools menu and selecting "Mark Thread Resolved".


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width