and modify • Allows extension in unforeseen ways • Can be easier to develop than comparable GUI Scripting alternatives: • Build a graphical interface • Customization via custom development
more suitable for simple or declarative languages • Existing programming language: ◦ if we need complex control flow, libraries, etc. • Off-the-shelf solutions: ◦ Template engines ◦ Markdown, rst, html
more suitable for simple or declarative languages • Existing programming language: ◦ if we need complex control flow, libraries, etc. • Off-the-shelf solutions: ◦ Template engines ◦ Markdown, rst, html
need error reporting • Parser generators and libraries ◦ The most common case. See “DSL in Python. How and why?” by Ivan Tsyganov • Hand-written parsers ◦ Only for very complex grammers and very custom error reporting
source code • Usually it’s our “driver” code + user code • Communicate with it via stdin/stdout • Optionally, allow desired I/O events Very bare-bones, only Python 2. Use if you REALLY need Python (large API, code sharing, etc.)
in the browser. Implementation: • PyV8: embedding V8 in Python (last commit in 2014, sits in google code archive) • V8 or SpiderMonkey in a separate process
datetime work • Line-oriented text protocol, using ast. literal_eval • User API: input via magic variable “field”, output via return. Extra features: fields ["name"], raise Skip.