• July 01, 2022, 12:48:42 AM

Author Topic:  Seeking Language/Library/IDE recommendation for simple navigable Mandlebrot  (Read 417 times)

0 Members and 1 Guest are viewing this topic.

Offline Anarchon

  • Fractal Freshman
  • *
  • Posts: 2
I'd like to create my own simple, navigable Mandelbrot fractal in Windows.  What language, libraries, and IDE would you folks recommend for me?  I'd like the sweet spot between high-level (for ease of coding) and performance (for speed in rendering frames).  Thanks for any feedback.

Linkback: https://fractalforums.org/index.php?topic=4256.0

Offline claude

  • 3f
  • ******
  • Posts: 2237
    • mathr.co.uk
I'll talk about 5 programs:

KF uses Win32 API for user interface, implemented in C++. Pro: no need to install complicated toolkits like Qt or GTK; C++ can be fast for inner loops. Con: dated look, Windows only.

ET uses GTK for GUI, implemented in Haskell. Pro: high level language makes coding easier; cross-platform. Con: slow for calculations, but binding to C for inner loops is easy; build system is resource intensive.

Perturbator uses GTK for GUI, implemented in C. Pro: native language of GTK is C so documentation applies directly; C inner loops are fast. Con: manual memory management is a pain.

Zoomasm uses Dear ImGUI in GLFW. Pro: simple interaction with OpenGL; cross-platform. Con: fiddly if your code is not structured around rendering frames.

Rodney uses OpenGL via SDL, which means that it can be compiled with Emscripten to run in web browsers.  This could be used with Dear ImGUI if you need widgets, or via Javascript foreign function interface to interact with a HTML page containing the Emscripten/SDL canvas.
« Last Edit: June 07, 2021, 06:58:32 PM by claude, Reason: web »

Offline 3DickUlus

  • Administrator
  • 3f
  • *******
  • Posts: 3006
Language: C++  :thumbs:
IDE: kdevelop  :thumbs:

Modern compilers for C++ can do a lot of optimizing for you, short of programming in assembler it is most likely to be faster than most.

IDE is a matter of testing and finding one that fits your needs, an oldie but a goodie, kdevelop can be setup for a number of languages and their toolchains, I use it because all of the features are hard coded into my fingers so I have difficulty with any other IDEs ;) oh, it's a mature product and 100% free, available for Linux ,Windows and MacOS

Offline pauldelbrot

  • 3f
  • ******
  • Posts: 3456
kdevelop ... hmm. Isn't that the one where I installed it during my brief but dubious flirtation with Linux, discovered that all of the documentation files were empty, and when I posted to their mailing list reporting this minor issue the suggestion I got back was to write it myself?

Mind you, that was back in something like the late 1990s. It may be that there has been some improvement since then. :)

Offline 3DickUlus

  • Administrator
  • 3f
  • *******
  • Posts: 3006
oh, forgot Library: I like Qt, it has both open source and commercial versions, it has almost everything you could possibly think of for making GUI programs, it's cross platform compatible.
But again this is a personal preference, you should checkout the ones you can find or have time for and use what suits your needs or the one that seems most comfortable.

@pauldelbrot documentation for kdevelop is a bit sketchy and always needs work, but, as a programming environment the features and functions are intuitive to a programmer and don't really require documentation... some tutorials would be nice.

there is a lot of info out there but bugging the devs via the mailing list will not get you anywhere unless you are contributing to the code base somehow.

these might be more helpful... https://www.kdevelop.org/search/node?keys=documentation and https://community.kde.org/KDevelop

edit: @pauldelbrot maybe try it again, you might be impressed at how far it has come ;)
« Last Edit: June 08, 2021, 02:32:19 AM by 3DickUlus »

Offline hobold

  • Fractal Frankfurter
  • *
  • Posts: 574
If you are new to programming, but have a strong mathematical background, then a functional language like Haskell might be worth a look.

GUI programming is something I always found difficult on any platform. I tend to get lost in programming technicalities, when I really should be worrying about user experience. I dabbled in Qt before, and a bit in Java; both were workable but didn't strike me as particularly good or bad.

For my own homebrew stuff, I usually skip the GUI. In lazy one-off projects I just recompile. Otherwise I write simple parsers for human readable configuration files. But this is not the kind of application that I could hand out to unsuspecting bystanders. I guess I am forever spoiled by my age, having started programming in much more primitive times. ^-^

Offline pauldelbrot

  • 3f
  • ******
  • Posts: 3456
If you are new to programming, but have a strong mathematical background, then a functional language like Haskell might be worth a look.

GUI programming is something I always found difficult on any platform. I tend to get lost in programming technicalities, when I really should be worrying about user experience. I dabbled in Qt before, and a bit in Java; both were workable but didn't strike me as particularly good or bad.

For my own homebrew stuff, I usually skip the GUI. In lazy one-off projects I just recompile. Otherwise I write simple parsers for human readable configuration files. But this is not the kind of application that I could hand out to unsuspecting bystanders. I guess I am forever spoiled by my age, having started programming in much more primitive times. ^-^

Lisps give you "functional" and also a command-line interface so you can skip the GUI without having to write a parser. It comes with one already.

Offline kosalos

  • Fractal Furball
  • ***
  • Posts: 205
Since you are targeting Windows, take a look at a simple app I posted to Github.
It demonstrates all the boiler plate code you need to use compute shaders on the GPU
to create 2D and 3D fractal images (Mandelbrot and Apollonian).
I provide the simplest of user interfaces, thinking you will want to design your own anyhow.
You can concentrate altering the DE() routine for 3D, and the Mandelbrot equation(s) for 2D,
and quickly see the results on screen.

I use the free Community version of Visual Studio 2019 (VS2019) for development:
https://visualstudio.microsoft.com/downloads/


the app:  https://github.com/Kosalos/BareBonesWindowsFractal
written in C++.  Everything you need is included in VS2019.

good luck

Offline shapeweaver

  • Fractal Fanatic
  • ***
  • Posts: 37
Could Kalles Fraktaler be used as an engine for which a custom program could be wrapped around? There are many UI features that would be nice to add.

Offline claude

  • 3f
  • ******
  • Posts: 2237
    • mathr.co.uk
Could Kalles Fraktaler be used as an engine for which a custom program could be wrapped around? There are many UI features that would be nice to add.

KF has a command line mode, so maybe possible for prototyping at least.  Turnaround / latency may be on the high side though.  If you use Win32API for your UI features it might be possible to integrate into KF at some point!  Otherwise re-implementing might not be so hard once you have it working nicely. 

Simply save your settings KFS (required if you want something other than 640x360), location KFR (required if you want anything other than unzoomed M-set), palette KFP (optional, overrides the stuff from the KFR) and invoke KF like
Code: [Select]
/path/to/kf.exe -s my.kfs -l my.kfr -c my.kfp -x my.exr and then you can load the EXR in your program via OpenEXR (C++) or other library.

For (re-)colouring existing EXR files containing raw iteration data, try
Code: [Select]
/path/to/kf.exe -s old.exr -l old.exr -o old.exr -c new-palette.kfp  -x new.exr  See KF's manual (near the end) for EXR channel documentation, for third-party software that handles EXR from KF look at zoomasm.

Saving as other formats is supported also: check kf.exe --help for details.

Offline Anarchon

  • Fractal Freshman
  • *
  • Posts: 2
This is outstanding help.  Thank you all so much for the input.  I have a lot to chew on here.