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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:36:59+00:00 2026-06-07T05:36:59+00:00

I wrote a program in C to generate fractals using a formula, but it

  • 0

I wrote a program in C to generate fractals using a formula, but it goes very slow. Basically you pass the rendering function a bunch of unsigned char numbers that indicate functions to push values on to a stack or pop them off and perform and arithmetic operation and push the result back on the stack (kind of like reverse polish notation). The problem is, the program is reading these functions numbers, going through an if…else if…else if…else if…elseif… to find the right operation to perform, and pushing and popping a bunch of values for every iteration in every pixel. Normally there would just be a formula (like the Mandelbrot) hard coded into the rendering function, but this program is a DLL I’m writing to be an all purpose fractal renderer. Is there any way I could write a little mini compiler that reads the formula before rendering begins and compiles a function on the fly which could then be efficiently re-used by the rendering routine? After all, the whole point of Von Neumann architecture after all is that a computer can modify its own code.

Thanks in advance!

  • 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-07T05:37:00+00:00Added an answer on June 7, 2026 at 5:37 am

    There is no notion of self-modifying code in C. Any attempt to pass control to a data block that is in the “data” memory, say, by casting a data pointer to a function pointer, is undefined behavior. This model is there to let you program in C for non vov-neuman computers.

    This said, you can probably optimize your RPN code to run much faster by replacing sequences of if-then-else statements with function pointers or a switch statement. You could also program the target function into a dynamic library, read it at runtime, and use it in rendering.

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

Sidebar

Related Questions

I wrote a program to generate large .SQL files for quickly populating very large
I wrote a program which can generate DFAs. But the DFAs are slightly incorrect.
I wrote a program for downloading an image from web using AsyncTask in service
I wrote a program to click on an application automatically at scheduled time using
I wrote a program in C++/OpenGL (using Dev-C++ compiler) for my calculus 2 class.
I wrote a program to generate monomials and polynomial and print monomials and polynomial.
I wrote a program which can generate regex like this a(b|)c . Actually, it
I'm trying to write a program in Java that uses osql to generate a
i wrote program to connect oracle database 11g for my android application to store
I wrote a program called Hello.py that looks like this: import pygame, sys from

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.