www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - ASCII-ART mandelbrot running under newCTFE

reply Stefan Koch <uplink.coder googlemail.com> writes:
Hey Guys,
I just trans-compiled a brainfuck mandelbrot into ctfeable D.
newCTFE is able to execute it correctly (although it takes 3.5 
minutes to do so).

The code is here
https://gist.github.com/UplinkCoder/d4e4426e6adf9434e34529e8e1f8cb47

The gist it evaluates the function at runtime since the newCTFE 
version capable of running this, is not yet available as a 
preview release.

If you want a laugh you can compile the code with ldc and -Oz 
flag set.
LLVM will detect that the function is pure and will try to 
constant-fold it.
I do not know how long this takes though since my patience is 
limited.

Cheers,
Stefan
Aug 04
next sibling parent reply Johnson Jones <JJ Dynomite.com> writes:
On Friday, 4 August 2017 at 22:50:03 UTC, Stefan Koch wrote:
 Hey Guys,
 I just trans-compiled a brainfuck mandelbrot into ctfeable D.
 newCTFE is able to execute it correctly (although it takes 3.5 
 minutes to do so).

 The code is here
 https://gist.github.com/UplinkCoder/d4e4426e6adf9434e34529e8e1f8cb47

 The gist it evaluates the function at runtime since the newCTFE 
 version capable of running this, is not yet available as a 
 preview release.

 If you want a laugh you can compile the code with ldc and -Oz 
 flag set.
 LLVM will detect that the function is pure and will try to 
 constant-fold it.
 I do not know how long this takes though since my patience is 
 limited.

 Cheers,
 Stefan
Any screenshots? I don't wanna have to install something I won't use but once or twice but would be interested in seeing what is going on since I used to be a fractal freak ;)
Aug 04
next sibling parent Stefan Koch <uplink.coder googlemail.com> writes:
On Saturday, 5 August 2017 at 00:59:01 UTC, Johnson Jones wrote:
 On Friday, 4 August 2017 at 22:50:03 UTC, Stefan Koch wrote:
 [...]
Any screenshots? I don't wanna have to install something I won't use but once or twice but would be interested in seeing what is going on since I used to be a fractal freak ;)
all you need is dmd. almost any version will do. dmd mandelb.d ./mandelb
Aug 04
prev sibling parent Timon Gehr <timon.gehr gmx.ch> writes:
On 05.08.2017 02:59, Johnson Jones wrote:
 
 
 Any screenshots? I don't wanna have to install something I won't use but 
 once or twice but would be interested in seeing what is going on since I 
 used to be a fractal freak ;)
https://dpaste.dzfl.pl/d7791f4e2845
Aug 05
prev sibling next sibling parent reply 12345swordy <alexanderheistermann gmail.com> writes:
On Friday, 4 August 2017 at 22:50:03 UTC, Stefan Koch wrote:
 Hey Guys,
 I just trans-compiled a brainfuck mandelbrot into ctfeable D.
 newCTFE is able to execute it correctly (although it takes 3.5 
 minutes to do so).

 The code is here
 https://gist.github.com/UplinkCoder/d4e4426e6adf9434e34529e8e1f8cb47

 The gist it evaluates the function at runtime since the newCTFE 
 version capable of running this, is not yet available as a 
 preview release.

 If you want a laugh you can compile the code with ldc and -Oz 
 flag set.
 LLVM will detect that the function is pure and will try to 
 constant-fold it.
 I do not know how long this takes though since my patience is 
 limited.

 Cheers,
 Stefan
You planning to do the same thing with other languages?
Aug 04
parent Stefan Koch <uplink.coder googlemail.com> writes:
On Saturday, 5 August 2017 at 01:22:46 UTC, 12345swordy wrote:
 On Friday, 4 August 2017 at 22:50:03 UTC, Stefan Koch wrote:
 Hey Guys,
 I just trans-compiled a brainfuck mandelbrot into ctfeable D.
 newCTFE is able to execute it correctly (although it takes 3.5 
 minutes to do so).
You planning to do the same thing with other languages?
Other Domain-Specific-Langauges ? Sure that is a useful application. However if you are asking about translating non-trivial langauges like c++; Frankly, there is little point in doing so. Since non-trivial languages require non-trivial amounts of parsing and semantic-processing. This would more fittingly done in a separate application rather then doing it at ctfe.
Aug 04
prev sibling parent Igor Shirkalin <mathsoft inbox.ru> writes:
On Friday, 4 August 2017 at 22:50:03 UTC, Stefan Koch wrote:
 Hey Guys,
 I just trans-compiled a brainfuck mandelbrot into ctfeable D.
 newCTFE is able to execute it correctly (although it takes 3.5 
 minutes to do so).

 The code is here
 https://gist.github.com/UplinkCoder/d4e4426e6adf9434e34529e8e1f8cb47

 The gist it evaluates the function at runtime since the newCTFE 
 version capable of running this, is not yet available as a 
 preview release.

 If you want a laugh you can compile the code with ldc and -Oz 
 flag set.
 LLVM will detect that the function is pure and will try to 
 constant-fold it.
 I do not know how long this takes though since my patience is 
 limited.

 Cheers,
 Stefan
I have interest in mandelbtott. Some day, a long time ago, when turbo pascal was the part of the world and EGA monitors had 320x240x1 bytes per pixel... That time it was interesting to algorithm to go around the Mandelbrott set because of one theorem where every point of manfelbrott set has continious connection with any other point. If I have time I'd love to write it in D.
Aug 05