What programming language features are well suited for developing a live coding framework?

前端 未结 8 2184
孤城傲影
孤城傲影 2021-02-07 17:39

I would like to build a \"live coding framework\".

I should explain what is meant by \"live coding framework\". I\'ll do so by comparing live coding to traditional codin

相关标签:
8条回答
  • 2021-02-07 18:16

    Smalltalk is probably the best bet for this. As unlike the others, it has a whole IDE for live coding, not just a REPL

    0 讨论(0)
  • 2021-02-07 18:16

    I'm working on a live coding feature for PyDev's Python editor. It was inspired by Bret Victor's Inventing on Principle talk, and I've implemented a program state display as well as turtle graphics. They both update as you type your Python code in Eclipse.

    The project is hosted on GitHub, and I've posted a demo video, as well as a tutorial.

    The main features of Python that I used were abstract syntax trees and dynamic code execution. I take the user's code, parse it into a tree, then instrument any assignment statements, loop iterations, and function calls. Once I've instrumented the tree, I execute it and display the report or draw the requested turtle graphics.

    I haven't implemented the swapping feature that other answers discuss. Instead, I always run the code to completion or a time out. I envision live coding as an enhancement to test-driven development, not as a way to hack on a live application. However, I will think more about what swapping out pieces of a live application would let me do.

    0 讨论(0)
提交回复
热议问题