Let's go for a rollercodester ride
The objective of this challenge is to create a program that is run recursively through several languages of your choice. The output of the first iteration becomes the code for the second iteration, et. cetera.
- You choose the language sequence, but each unique language may be used only once. Unique languages will be determined using CGCC standards (different compiler flags => different languages!)
- Each step must be a complete program that terminates before the next step will be executed.
- The entire output of stdout (not including stderr) will be considered code for the next step.
- Other than executing and producing output, your programs can do whatever they want but every byte that your program reads contributes a byte to it's scored code length.
- Each step executes in a theoretically clean environment, no actions of prior steps can be accessed by the current step.
- Please score your submission as best as you can, I anticipate some difficulty validating submissions (no fancy scoring tool yet...).
Scoring
Thanks to ovs for creating a score calculator: TIO Link
- The curvature of any three consecutive steps in the submission is the difference of the difference of each step's code length.
- Any three consecutive steps in the submission earn score points equal to their absolute curvature divided by the total source length of all three steps.
- Each scored step will be rounded (x>=5e-7 becomes 1e-6, x<5e-7 becomes 0) to the nearest 1e-6, to make scoring exact.
- The goal is to achieve the highest score.
- In the unlikely event of a tie, the shortest initial (just the first step) submission in bytes wins (it's gotta have some sort of golf, right???).
To discuss scoring consistently we can call the first step "Step 1", and assign scored points to the last step that contributes to those points. The first two steps (1 and 2) are not scorable because there isn't enough data to calculate a score, then each step after that has a score calculated from itself and the two prior steps. i.e. in the working example below, step 3 scores .566038, step 4 scores .536082
Scoring example
- Step 1 (original submission) : 50 bytes
- Step 2: 25 bytes -25 change
- Step 3: 50 bytes +25 change +50 curvature / 50+25+50 bytes = 0.4 score
- Step 4: 40 bytes -10 change -35 curvature / 25+50+40 bytes = 0.304348 score
- Step 5: 30 bytes -10 change +0 curvature / 50+40+30 bytes = 0 score
total score: (0.4+0.304348+0) = 0.704348
Working example
Here's a working example, code is below the score. I can maximize my score by increasing the repeating parts of the Octave and Python 1 code, but can never get more than a score of 2 in any step.
4 steps:
- Python 3 - 107
- Octave - 166
- C (gcc) - 45
- Python 1 - 80
scoring:
step diff curve total_len score
107 - -
166 +59 -
45 -121 -180 318 0.566038
80 +35 +156 291 0.536082
total: 1.102120
Python 3, 107 bytes
print(f"""disp("main(){'{for(int i=0;i<10;i++)puts(""print 1"");}'}")
{'''
'''.join(['%commented']*10)}""")
Octave, 166 bytes
disp("main(){for(int i=0;i<10;i++)puts(""print 1"");}")
%commented
%commented
%commented
%commented
%commented
%commented
%commented
%commented
%commented
%commented
C (gcc), 45 bytes
main(){for(int i=0;i<10;i++)puts("print 1");}
Python 1, 80 bytes
print 1
print 1
print 1
print 1
print 1
print 1
print 1
print 1
print 1
print 1