Is it possible to draw a fractal tree in Elixir?

Is it possible to draw a fractal tree in Elixir ?
https://rosettacode.org/wiki/Fractal_tree

I know it was done in other functional programming languages, like Haskell, Scheme, F#

1 Like

Yes, it is…

At the end it is just calculating some stuff…

All the number crunching is not a good fit for elixir (the BEAM in general) though.

Also, there is not much of support for “drawing” on screen currently, you’d either need to use scnenic or phoenix, or render on memory only and write the file to disk.

3 Likes

Thank you,
“there is not much of support for “drawing” on screen currently, you’d either need to use scnenic or phoenix” - that’s exactly my question! how can I create visual “desktop app”(not web app), without too much boilerplate code.
I’ll check Scnenic

There’s a pretty good talk about it: “Ju Liu – Live coding an Escher painting using Scenic” :+1:

5 Likes

I was curious about fractals as well this weekend. First I found the already mentioned talk (which is amazing), then https://github.com/milmazz/turtle/ - both use Scenic.

Later has a tree example as well: https://github.com/milmazz/turtle/blob/master/turtle_ui/examples/tree.ex

3 Likes

For note, the BEAM is not designed for desktop apps, it is designed for extremely long living server apps. That of course doesn’t mean it won’t work for desktop apps, things like the built-in wxWidgets an the library Scenic are still ways of doing that.

You could make this example purely on the BEAM though by rendering it via wxWidgets though, or to a web browser or an image file.

3 Likes

Thanks a lot !

Thank you !!!

Thank you!

1 Like