Codea made in Codea???!!! MetaCodea? InceptiCodea?

I just found this:
https://codea.io/talk/discussion/660/codea-written-in-codea

this has so much interesting potential!! I tried it out and I got it to draw a circle but then it seems like it freezes once I type ‘end’ to close the draw function.

I have gotten very used to working in GLSL shader live coding environments (like the shader lab in Codea) and I find that writing graphics code on top of the graphic can be increadibly fast, no need to recompile, no need to wait to see what that change did.

Was there ever any advancement on this? Would be hard to find by searching “Codea” hah

@Simeon

Codea doesn’t compile Lua, it gets interpreted on the fly. That’s why, when you press the play button, your code starts instantly, you don’t have to wait for a build. I don’t think you could ask for a faster or more responsive environment in that sense. I agree that some kind of playground mode, where you see the results of the code next to the code itself would be nice.

@yojimbo2000 has there been any benchmark comparisons between the on the fly interpreter from the app and the result of compiling the same project into an app through xcode?

An interesting potential experimental solution I just thought of :`
if @John / @Simeon devmasters were to impliment iOS split screen abilities, which would be extremely useful in many ways, it could be possible to use aircode wtih a browser/codea split screen.

If you guys haven’t seen, check out the way GLSLsandbox.com does its thing, also recomend KodeLife, free app for OSX, and Shaderific for iOS (to whom I proposed this built in split screen JIT workflow a few months back, and after he added it, it sped up my flow tremendously.

I would like to make it clear that I do not in any way think Codea is sub-par in terms of worflow, only that I have recently logged a ton of direct experience in realtime JIT/GLSL workflow (including the Codea ShaderLab) and I find when I can get into a creative flow programming this JIT way, I am able to create exponentially faster, because there are no opportunities to get distracted.

Its like making music at that point, jamming out ideas in realtime.

Xcode doesn’t compile the Lua source code either. Lua is not a compiled language. There’s no need to do a benchmark comparison, because the Lua source is being ran in exactly the same way.

Lua doesn’t get compiled, but it gets converted. Here’s an example of some Lua code and the Bytecode it gets converted to. There’s more code that I don’t show which are the values (5,6,7,8) that’s at specific memory locations. You can do a search for Lua Bytecode for more information.

Lua code

    tab={5,6,7,8}
    for j,k in pairs(tab) do
        print(j,k)
    end

Bytecode

11  NEWTABLE    R(0) = {}   (size=4,0)
 1  LOADK       R(1) = Kst(1)
 1  LOADK       R(2) = Kst(2)
 1  LOADK       R(3) = Kst(3)
 1  LOADK       R(4) = Kst(4)
43  SETLIST     R(0)[(1-1) * FPF+i] = R(0+i) 1<=i<=4
 8  SETTABUP    UpValue[0][RK(-1)] = RK(0)
 6  GETTABUP    R(0) = UpValue[0][-6]
 6  GETTABUP    R(1) = UpValue[0][-1]
36  CALL        R(0) ... R(0+4-2)=R(0)(R(0+1)...;R(0+2-1))
30  JMP         pc += -4
 6  GETTABUP    R(5) = UpValue[0][-7]
 0  MOVE        R(6) = R(3)
 0  MOVE        R(7) = R(4)
36  CALL        R(5) ... R(5+1-2)=R(5)(R(5+1)...;R(5+3-1))
41  TFORCALL    R(0+3) ... R(0+2+2) = R(0)(R(0+1)R(+d+2))
42  TFORLOOP    if R(2+1) ~= nil then {R(2) = R(2+1); pc += 5}
38  RETURN      R(0) ... R(0+1-2)