A visual DSL toolkit in Lua



Similar documents
How To Write A Web Server In Javascript

How To Analyze Big Data With Luajit And Luatjit

Source Code Translation

Client Overview. Engagement Situation. Key Requirements

Business Insight Report Authoring Getting Started Guide

<Insert Picture Here> Building a Complex Web Application Using ADF and Siebel

What's New in ActiveVOS 9.1

Tutorial: Building a Dojo Application using IBM Rational Application Developer Loan Payment Calculator

SAP HANA Core Data Services (CDS) Reference

PHP Code Design. The data structure of a relational database can be represented with a Data Model diagram, also called an Entity-Relation diagram.

WHITEPAPER. Managing Design Changes in Enterprise SBM Installations

How To Use Query Console

Getting Started with Telerik Data Access. Contents

IBM Rational Web Developer for WebSphere Software Version 6.0

Microsoft Outlook Quick Reference Sheet

QualysGuard WAS. Getting Started Guide Version 3.3. March 21, 2014

Managing Third Party Databases and Building Your Data Warehouse

Skills for Employment Investment Project (SEIP)

How To Build A Connector On A Website (For A Nonprogrammer)

Two new DB2 Web Query options expand Microsoft integration As printed in the September 2009 edition of the IBM Systems Magazine

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

Using the Query Analyzer

Manage Software Development in LabVIEW with Professional Tools

Introduction to XML Applications

14.1. bs^ir^qfkd=obcib`qflk= Ñçê=emI=rkfuI=~åÇ=léÉåsjp=eçëíë

Software Development Kit

Debugging JavaScript and CSS Using Firebug. Harman Goei CSCI 571 1/27/13

Beginning Web Development with Node.js

Chapter 12 Programming Concepts and Languages

StreamServe Persuasion SP5 Ad Hoc Correspondence and Correspondence Reviewer

Joomla! Actions Suite

Category: Business Process and Integration Solution for Small Business and the Enterprise

Desktop, Web and Mobile Testing Tutorials

MASTERTAG DEVELOPER GUIDE

Installing and Sending with DocuSign for NetSuite v2.2

Up and Running with LabVIEW Web Services

Working with Indicee Elements

How To Program In Javascript With Deitel And Deitle

Tutorial Build a simple IBM Rational Publishing Engine (RPE) template for IBM Rational DOORS

Portals and Hosted Files

Load testing with. WAPT Cloud. Quick Start Guide

HP LoadRunner. Software Version: Ajax TruClient Tips & Tricks

Terms and Definitions for CMS Administrators, Architects, and Developers

Authoring for System Center 2012 Operations Manager

Visualizing a Neo4j Graph Database with KeyLines

IBM DB2 XML support. How to Configure the IBM DB2 Support in oxygen

Siebel Business Process Framework: Workflow Guide. Siebel Innovation Pack 2013 Version 8.1/8.2 September 2013

HP LoadRunner. Software Version: LoadRunner Tutorial

Top 10 Oracle SQL Developer Tips and Tricks

Test Data Management Concepts

NewsletterAdmin 2.4 Setup Manual

YouTrack MPS case study

Subject knowledge requirements for entry into computer science teacher training. Expert group s recommendations

Logi Ad Hoc Reporting System Administration Guide

Advantage of Jquery: T his file is downloaded from

Create interactive web graphics out of your SAS or R datasets

CRM 2013 Workflows. Description

NASA Workflow Tool. User Guide. September 29, 2010

10CS73:Web Programming

What s new in TIBCO Spotfire 6.5

Building and Using Web Services With JDeveloper 11g

KS3 Computing Group 1 Programme of Study hours per week

Software quality improvement via pattern matching

Oracle Sales Cloud Reporting and Analytics Overview. Release 13.2 Part Number E January 2014

HP Systinet. Software Version: Windows and Linux Operating Systems. Concepts Guide

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

How To Use Titanium Studio

Design and Functional Specification

Information on Syslog For more information on syslog, see RFC Released: December 2006 Interoperability issues: None. Table 1: Syslog at a Glance

METADATA-DRIVEN QLIKVIEW APPLICATIONS AND POWERFUL DATA INTEGRATION WITH QLIKVIEW EXPRESSOR

2692 : Accelerate Delivery with DevOps with IBM Urbancode Deploy and IBM Pure Application System Lab Instructions

A Visualization is Worth a Thousand Tables: How IBM Business Analytics Lets Users See Big Data

Sisense. Product Highlights.

A Quick Chat about SOMF Capabilities Page1 Service-Oriented Modeling Framework (SOMF) Building Attribution Models

Hypercosm. Studio.

5.1 Features Denver CO 80202

Model-Driven Health Tools (MDHT) CDA Tools Overview.

Programming in Access VBA

NLUI Server User s Guide

Group Policy Objects: What are They and How Can They Help Your Firm?

Use Enterprise SSO as the Credential Server for Protected Sites

Vanguard Knowledge Automation System

NASSI-SCHNEIDERMAN DIAGRAM IN HTML BASED ON AML

Performance Testing for Ajax Applications

SQL Server 2005: Report Builder

A quick guide to... Setting Up Goals

Redpaper Axel Buecker Kenny Chow Jenny Wong

Ricardo Perdigao, Solutions Architect Edsel Garcia, Principal Software Engineer Jean Munro, Senior Systems Engineer Dan Mitchell, Principal Systems

ORACLE BUSINESS INTELLIGENCE WORKSHOP

Sitecore InDesign Connector 1.1

Implementação. Interfaces Pessoa Máquina 2010/ Salvador Abreu baseado em material Alan Dix. Thursday, June 2, 2011

A DIAGRAM APPROACH TO AUTOMATIC GENERATION OF JSP/SERVLET WEB APPLICATIONS

IE Class Web Design Curriculum

Xcode Project Management Guide. (Legacy)

Transcription:

A visual DSL toolkit in Lua Past, present and future Alexander Gladysh <ag@logiceditor.com> Lua Workshop 2013 Toulouse 1 / 44

Outline Introduction The Problem Classic third-party alternatives Past generations The present generation The future Questions? 2 / 44

Alexander Gladysh CTO, co-founder at LogicEditor In löve with Lua since 2005 3 / 44

LogicEditor Use Lua to develop: Visual DSL toolkit (subject of this talk) Big-data analytics Intensive-load web-services In-browser and mobile games 600+ KLOC of private Lua codebase Some contributions to open-source Lua projects 4 / 44

The Problem Business-logic is highly volatile. Programmers are not domain area specialists. Specialist Manager Programmer loop is slow. Specialist Programmer loop is expensive. Let specialists do the business-logic! 5 / 44

6 / 44

Non-programmers aren t programmers It is not enough to be able to compose an algorithm and even implement it with some simple programming language. For commercial programming you ll also need, at least: Technical background Debugging skills Team coding skills 7 / 44

Solution A tool that prevents technical mistakes While limiting creativity as little as possible And is within grasp of a non-programmer. 8 / 44

Ad-hoc implementations One-shot, very limited flexibility Full of crutches Hard to maintain 9 / 44

Classic third-party alternatives 10 / 44

MIT Scratch 11 / 44

Descent Freespace Editor Events 12 / 44

Lego NXT-G 13 / 44

Apple Automator 14 / 44

What is in common? A visual domain-specific language, that allows user to describe the control-flow. 15 / 44

A retrospective of ideas Screenshots shown here are from editors done by me and/or my colleagues for different companies we worked for, over time. Only an idea was re-used and improved between generations. 16 / 44

Video-adventure game editor (No screenshots available) Legacy, circa 2002 2004 Graph of in-game dialog remarks and answer choices Allowing to tie-in video-loop to remark No Lua. 17 / 44

Adventure game dialog editor, I, II Graph of in-game dialog remarks and answer choices With ability to add custom Lua code logic (in II) Generated data (in Lua) for a state machine (also in Lua) 18 / 44

Browser MMO quest editor, I, II 19 / 44

Browser MMO magic system editor 20 / 44

Analysis Some non-programmers prefer visual control-flow editors. Some textual representation. (Programmers hate to use both kinds.) All editors were very useful, some invaluable. But, in retrospective, some should have been replaced by dedicated coders. None of the past-generation editors were flexible enough to be used outside its immediate domain (but this never was an official goal for them). 21 / 44

The Visual Business Logic Editor Toolkit 22 / 44

Design goals Easy to create new editors. Easy to support existing editors. Easy to integrate with "any" other project on "any" technology. Easy enough to learn and use by end-users. 23 / 44

Editor use-cases For example: A dialog editor for a game scenario writer. A magic system editor for a game-designer. A mission logic editor for a game level-designer. A DB query editor for a data analyst (Hadoop, anyone?). An advertising campaign targeting editor for a marketer....and so on. 24 / 44

Technology The data is a tree corresponding to the control flow (or to anything tree-like, actually). The output is structured text (code or data). Editor code, UI and backend, is generated by Lua code in the Toolkit, from the data "schema". Editor UI is in JavaScript / HTML, backend is in Lua. 25 / 44

The Data Schema Embedded Lua DSL (see my talk on Lua WS 11). http://bit.ly/lua-dsl-talk Describes how to: check data validity, generate default data, render data to editor UI, change data in editor UI, render the conforming data to the output code (or data). Two layers: human-friendly and machine-friendly 26 / 44

Schema Example, I See also: http://bit.ly/le7-schema lang:root "lua.print-string" lang:value "lua.string.value" { data_type = "string"; default = "Hallo, world!"; render:js [[String Value]] { [[${1}]] }; render:lua { [[${1}]] }; } 27 / 44

Schema Example, II lang:func "lua.print-string" { "lua.string.value"; render:js [[Print string]] { [[Print: ${1}]]; }; render:lua { [[print(${1})]]; }; } 28 / 44

Default Data { } id = "lua.print-string"; { id = "lua.string.value"; "Hallo, world!"; } Renders to Lua as: print("hallo, world!") 29 / 44

UI for default data (simplified) <div id="lua.print-string"> Print: <span id="lua.string.value">hallo, world!</span> </div> NB: That <span> turns to edit-box on click. 30 / 44

Extending string type lang:type "lua.string" { init = "lua.string.value"; render:js [[String]] { menu = [[S]]; [[${1}]] }; render:lua { [[${1}]] }; } lang:func "lua.string.reverse" { type = "lua.string"; render:js [[Reverse string]] { [[Reverse: ${1}]] }; render:lua { [[(${1}):reverse()]] }; } 31 / 44

Print with multiple arguments lang:list "lua.print" { "lua.string"; render:js [[Print]] { empty = [[Print newline]]; before = [[Print values: <ul><li>]]; glue = [[</li><li>]]; after = [[</li></ul>]]; }; render:lua { before = [[print(]]; glue = [[,]]; after = [[)]]; }; } 32 / 44

Main primitives lang:const lang:value lang:enum lang:func lang:list lang:type 33 / 44

Machine-friendly schema node:literal node:variant node:record node:value node:list 34 / 44

Data-upgrade routines A set of hooks for data tree traversal. Transformations between two given data versions. In terms of node schema. Semi-automatic, template code is generated. 35 / 44

What else? Scopes in the schema. External and internal data-sources. 36 / 44

Several points of improvement Current generation does its job well, but we see several ways on how to make it better Several points to improve Better, modern HTML (at the cost of support of IE6). Lua in browser for a server-less integration option. Even more flexible and expressive Schema DSL. NB: We ll probably go for a control-flow diagram UI first, not text-based one (current text-based is cool enough). 37 / 44

Problems with the current DSL One language for three separate concepts: data tree structure, editor UI, final output. Data tree structure gets a bit synthetic and convoluted at times. Should be easier to add alternative editor UIs. 38 / 44

Solution Three separate sets of languages: data tree format, render to output (per output format), render to editor (per editor kind). CSS-like rules instead of pre-defined set of node types 39 / 44

Early examples http://bit.ly/le8-proto data:root "script" data:type "script" ("*", "action") data:type "action" "print-var" "var-name" to:text "script" :T [[ local _VARS = {} ${indent(concat(children))} ]] to:text "print-var" "var-name" :T [[print(_vars[${quote:lua(node)}])]] to:ui "print-var" "var-name" :T [[Print: ${child(1)})]] 40 / 44

An alternative approach to the Embedded DSLs in Lua foo:bar "baz" { "quo" } local proxy = foo proxy = proxy["bar"] proxy = proxy(foo, "baz") proxy = proxy({ "quo" }) 41 / 44

The FSM foo:bar "baz" { "quo" } If proxy is as a FSM, indexes and calls state transitions. INIT index "bar" -> foo.bar foo.bar call -> foo.bar.name foo.bar.name call -> foo.bar.name.param FINAL <- foo.bar.name.param Early working prototype: http://bit.ly/le-dsl-fsm. 42 / 44

Easier to code complex DSL constructs play:scene [[SCENE II]].location [[Another room in the castle.]] :enter "HAMLET" :remark "HAMLET" [[ Safely stowed. ]] :remark { "ROSENCRANTZ", "GILDERSTERN" }.cue [[within]] [[ Hamlet! Lord Hamlet! ]] :remark "HAMLET" [[ What noise? who calls on Hamlet? O, here they come. ]] 43 / 44

Questions? Alexander Gladysh, ag@logiceditor.com 44 / 44