This document discusses the Spoofax language workbench, which is a tool for building domain-specific languages (DSLs). It addresses key concerns in developing DSLs such as the tradeoffs between internal and external DSLs, textual vs graphical syntax, code generation vs interpretation, and static vs dynamic typing. The Spoofax workbench uses declarative syntax definitions and rewrite rules to provide features like syntax checking, error recovery, and incremental processing for integrated development environments.
UKOUG Tech14 - Getting Started With JSON in the DatabaseMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of, and explaining, the new JSON database functionality in the Oracle 12.1.0.2 database
MongoDB is opensource DB, CRUD with MongoDB is not as same with other DB using SQL statements it can be achieved using NoSQL json queries which i have try explained here.
UKOUG Tech14 - Getting Started With JSON in the DatabaseMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of, and explaining, the new JSON database functionality in the Oracle 12.1.0.2 database
MongoDB is opensource DB, CRUD with MongoDB is not as same with other DB using SQL statements it can be achieved using NoSQL json queries which i have try explained here.
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of the 12.1.0.2 In-Memory Column Store option with XMLType data type storage options common to the Oracle 12.1 database
How to Handle NoSQL with a Relational DatabaseDATAVERSITY
It can be difficult to scale out relational databases and provide more schema flexibility, thus the rise of NoSQL. However, you shouldn’t have to sacrifice data integrity and transactions in order to scale out on commodity hardware and support semi-structured data. By using an RDBMS with built-in sharding and JSON support, you don’t have to. You get the scalability and flexibility of a NoSQL database along with the consistency and reliability of a relational database – and the ability to mix and match relational and JSON data.
In this webinar, we’ll explain how MariaDB Platform can be deployed as a NoSQL database by using the Spider storage engine and built-in SQL functions for JSON. In addition, we’ll discuss how you can access relational data as JSON documents, and how to enforce data integrity if a relational data model is extended with JSON.
How do you write a GUI app in a functional programming language that prefers immutability? From Visual Basic on we have been taught how to compose interactive UIs using events and mutable properties. Is there any other way? The answer is, yes, indeed there is. Not only can you build UIs using functional concepts, but I will argue that the architecture of such an app is more modular and more robust than the standard architecture resulting from objects sending messages to each other. This talk is an introduction to the fringe world of functional programming using F# and will have information useful to both beginners and practitioners.
From SQL to NoSQL: Structured Querying for JSONKeshav Murthy
Can SQL be used to query JSON? SQL is the universally known structured query language, used for well defined, uniformly structured data; while JSON is the lingua franca of flexible data management, used to define complex, variably structured data objects.
Yes! SQL can most-definitely be used to query JSON with Couchbase's SQL query language for JSON called N1QL (verbalized as Nickel.)
In this session, we will explore how N1QL extends SQL to provide the flexibility and agility inherent in JSON while leveraging the universality of SQL as a query language.
We will discuss utilizing SQL to query complex JSON objects that include arrays, sets and nested objects.
You will learn about the powerful query expressiveness of N1QL, including the latest features that have been added to the language. We will cover how using N1QL can solve your real-world application challenges, based on the actual queries of Couchbase end-users.
UKOUG Tech14 - Using Database In-Memory Column Store with Complex DatatypesMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of the 12.1.0.2 In-Memory Column Store option with XMLType data type storage options common to the Oracle 12.1 database
How to Handle NoSQL with a Relational DatabaseDATAVERSITY
It can be difficult to scale out relational databases and provide more schema flexibility, thus the rise of NoSQL. However, you shouldn’t have to sacrifice data integrity and transactions in order to scale out on commodity hardware and support semi-structured data. By using an RDBMS with built-in sharding and JSON support, you don’t have to. You get the scalability and flexibility of a NoSQL database along with the consistency and reliability of a relational database – and the ability to mix and match relational and JSON data.
In this webinar, we’ll explain how MariaDB Platform can be deployed as a NoSQL database by using the Spider storage engine and built-in SQL functions for JSON. In addition, we’ll discuss how you can access relational data as JSON documents, and how to enforce data integrity if a relational data model is extended with JSON.
How do you write a GUI app in a functional programming language that prefers immutability? From Visual Basic on we have been taught how to compose interactive UIs using events and mutable properties. Is there any other way? The answer is, yes, indeed there is. Not only can you build UIs using functional concepts, but I will argue that the architecture of such an app is more modular and more robust than the standard architecture resulting from objects sending messages to each other. This talk is an introduction to the fringe world of functional programming using F# and will have information useful to both beginners and practitioners.
From SQL to NoSQL: Structured Querying for JSONKeshav Murthy
Can SQL be used to query JSON? SQL is the universally known structured query language, used for well defined, uniformly structured data; while JSON is the lingua franca of flexible data management, used to define complex, variably structured data objects.
Yes! SQL can most-definitely be used to query JSON with Couchbase's SQL query language for JSON called N1QL (verbalized as Nickel.)
In this session, we will explore how N1QL extends SQL to provide the flexibility and agility inherent in JSON while leveraging the universality of SQL as a query language.
We will discuss utilizing SQL to query complex JSON objects that include arrays, sets and nested objects.
You will learn about the powerful query expressiveness of N1QL, including the latest features that have been added to the language. We will cover how using N1QL can solve your real-world application challenges, based on the actual queries of Couchbase end-users.
The history of programming languages shows a progressive development from low-level programming languages close to the machine, to high-level languages close to the problems being solved with software. Domain-specific languages take this a step further than general purpose programming languages by making assumptions about the class of applications for which the language is intended. Complete applications typically require programs in multiple (technical) domains, which can be catered for by separate domain-specific languages. While such separation of concerns is beneficial for domain expressivity, it often leads to loose coupling and lack of static verification. Hence, the design of individual DSLs needs to be complemented with their linguistic integration.
In this talk, I illustrate these ideas with the design of WebDSL, a domain-specific language for data centric web applications. WebDSL linguistically integrates the definition of data models, user interfaces, actions, access control rules, data validation rules, styling rules, and workflow definitions. While maintaining separation between these concerns through specialized sub-languages, linguistic integration ensures static consistency checking and correct code generation. The language allows developers to concentrate on the essential design of web applications, abstracting from accidental complexity, such as the details of data persistence. The combination of high-level and low-level constructs ensures high expressivity, while supporting customization to application requirements.
These are the slides for the second lecture of the course "Model-Driven Software Development" taught at Delft University of Technology in the academic year 2009-2010.
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)lennartkats
Modern IDEs increase developer productivity by incorporating many different kinds of editor services. These can be purely syntactic, such as syntax highlighting, code folding, and an outline for navigation; or they can be based on the language semantics, such as in-line type error reporting and resolving identifier declarations. Building all these services from scratch requires both the extensive knowledge of the sometimes complicated and highly interdependent APIs and extension mechanisms of an IDE framework, and an in-depth understanding of the structure and semantics of the targeted language. This paper describes Spoofax/IMP, a meta-tooling suite that provides high-level domain-specific languages for describing editor services, relieving editor developers from much of the framework-specific programming. Editor services are defined as composable modules of rules coupled to a modular SDF grammar. The composability provided by the SGLR parser and the declaratively defined services allows embedded languages and language extensions to be easily formulated as additional rules extending an existing language definition. The service definitions are used to generate Eclipse editor plugins. We discuss two examples: an editor plugin for WebDSL, a domain-specific language for web applications, and the embedding of WebDSL in Stratego, used for expressing the (static) semantic rules of WebDSL.
"Technical Challenges behind Visual IDE for React Components" Tetiana MandziukFwdays
During this talk, you will get acquainted with a new product inside the Wix ecosystem — Wix Components Studio. It is a visual IDE for React Components that enables team members from all disciplines to easily access, validate and discuss their components on the same platform. We will review the building blocks needed to assemble a visual IDE and the technical challenges we are dealing with. Specifically, we will discuss pluggable architecture (and what that means), code analysis and generation, schema extraction, and mechanism for data synchronization in different environments. A short demo is also included!
The openCypher Project - An Open Graph Query LanguageNeo4j
We want to present the openCypher project, whose purpose is to make Cypher available to everyone – every data store, every tooling provider, every application developer. openCypher is a continual work in progress. Over the next few months, we will move more and more of the language artifacts over to GitHub to make it available for everyone.
openCypher is an open source project that delivers four key artifacts released under a permissive license: (i) the Cypher reference documentation, (ii) a Technology compatibility kit (TCK), (iii) Reference implementation (a fully functional implementation of key parts of the stack needed to support Cypher inside a data platform or tool) and (iv) the Cypher language specification.
We are also seeking to make the process of specifying and evolving the Cypher query language as open as possible, and are actively seeking comments and suggestions on how to improve the Cypher query language.
The purpose of this talk is to provide more details regarding the above-mentioned aspects.
We want to present the openCypher project, whose purpose is to make Cypher available to everyone – every data store, every tooling provider, every application developer. openCypher is a continual work in progress. Over the next few months, we will move more and more of the language artifacts over to GitHub to make it available for everyone.
openCypher is an open source project that delivers four key artifacts released under a permissive license: (i) the Cypher reference documentation, (ii) a Technology compatibility kit (TCK), (iii) Reference implementation (a fully functional implementation of key parts of the stack needed to support Cypher inside a data platform or tool) and (iv) the Cypher language specification.
We are also seeking to make the process of specifying and evolving the Cypher query language as open as possible, and are actively seeking comments and suggestions on how to improve the Cypher query language.
The purpose of this talk is to provide more details regarding the above-mentioned aspects.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Andrii Lashchenko
This presentation will cover the history of creation, implementation details and various challenges related to embedded documents querying in MongoDB, along with examples of how to properly create and utilize the extension on top of official MongoDB Scala Driver. This newly introduced extension allows to fully utilize Spray JSON and represents bidirectional serialization for case classes in BSON, as well as flexible DSL for MongoDB query operators, documents and collections.
Declarative Type System Specification with StatixEelco Visser
In this talk I present the design of Statix, a new constraint-based language for the executable specification of type systems. Statix specifications consist of predicates that define the well-formedness of language constructs in terms of built-in and user-defined constraints. Statix has a declarative semantics that defines whether a model satisfies a constraint. The operational semantics of Statix is defined as a sound constraint solving algorithm that searches for a solution for a constraint. The aim of the design is that Statix users can ignore the execution order of constraint solving and think in terms of the declarative semantics.
A distinctive feature of Statix is its use of scope graphs, a language parametric framework for the representation and querying of the name binding facts in programs. Since types depend on name resolution and name resolution may depend on types, it is typically not possible to construct the entire scope graph of a program before type constraint resolution. In (algorithmic) type system specifications this leads to explicit staging of the construction and querying of the type environment (class table, symbol table). Statix automatically stages the construction of the scope graph of a program such that queries are never executed when their answers may be affected by future scope graph extension. In the talk, I will explain the design of Statix by means of examples.
https://eelcovisser.org/post/309/declarative-type-system-specification-with-statix
Compiler Construction | Lecture 6 | Introduction to Static AnalysisEelco Visser
Lecture introducing the need for static analysis in addition to parsing, the complications caused by names, and an introduction to name resolution with scope graphs
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
The Metaverse and AI: how can decision-makers harness the Metaverse for their...Jen Stirrup
The Metaverse is popularized in science fiction, and now it is becoming closer to being a part of our daily lives through the use of social media and shopping companies. How can businesses survive in a world where Artificial Intelligence is becoming the present as well as the future of technology, and how does the Metaverse fit into business strategy when futurist ideas are developing into reality at accelerated rates? How do we do this when our data isn't up to scratch? How can we move towards success with our data so we are set up for the Metaverse when it arrives?
How can you help your company evolve, adapt, and succeed using Artificial Intelligence and the Metaverse to stay ahead of the competition? What are the potential issues, complications, and benefits that these technologies could bring to us and our organizations? In this session, Jen Stirrup will explain how to start thinking about these technologies as an organisation.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Enhancing Performance with Globus and the Science DMZGlobus
ESnet has led the way in helping national facilities—and many other institutions in the research community—configure Science DMZs and troubleshoot network issues to maximize data transfer performance. In this talk we will present a summary of approaches and tips for getting the most out of your network infrastructure using Globus Connect Server.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
Building DSLs with the Spoofax Language Workbench
1. Building DSLs with
The Spoofax Language Workbench
Eelco Visser
Delft University of Technology
http://eelcovisser.org
Joint work with Lennart Kats, Karl-Trygve Kalleberg, Maartje de Jonge, and many others
2. The Meta-Languages Wars
Internal DSLs vs External DSLs
Textual vs Graphical
Partial vs Complete Code Generation
Project-Specific vs Multi-Project DSLs
Code Generation vs Interpretation
Dynamically vs Statically Typed
3. The Meta-Languages Wars
Internal DSLs vs External DSLs
Textual vs Graphical
Partial vs Complete Code Generation
Project-Specific vs Multi-Project DSLs
Code Generation vs Interpretation
Dynamically vs Statically Typed
4. WebDSL
http://webdsl.org
separation of concerns & linguistic integration
Eelco Visser. WebDSL: A Case Study in Domain-Specific Language Engineering. GTTSE 2007: 291-373
10. Concerns in web applications
- Data model
- User interface templates
- Actions
- Access control rules
- Data validation
WebDSL
- Linguistic integration
- Cross concern, static consistency checking
17. Page Navigation
define tips() {
section{
header{"What Can You Do Here?"}
list{
listitem{ navigate(newauthor()){ "Add an author" } }
listitem{ navigate(newpublication()){ "Add a publication" } }
listitem{ navigate(search()){ "Search" } }
}
}
}
define page search() { ... }
18. HQL Embedding
extend entity Person {
publications -> List<Publication> :=
select p
from Publication as p, Author as a
where (a.person = ~this) and (p = a.publication)
}
20. Access Control
Danny M. Groenewegen, Eelco Visser. Declarative Access Control for WebDSL:
Combining Language Integration and Separation of Concerns. ICWE 2008: 175-188
23. Data Validation
Danny M. Groenewegen, Eelco Visser. Integration of Data Validation and
User Interface Concerns in a DSL for Web Applications. SLE 2009: 164-173
24. Data Validation: Form Input Validation
label("Acronym (without year)"){
input(acronym){
validate(!isEmptyString(acronym),
"Provide acronym")
validate(!(/[ ]/.find(acronym)),
"Acronym should not contain spaces")
validate(!(/[0-9][0-9][0-9][0-9]/.find(acronym)),
"Acronym should not contain year")
}
}
25. Data Validation: Data Invariants
entity Publication {
key :: String (id, index(25),
validate(isUniquePublication(this),
"that key is already in use"),
validate(isValidKeyForURL(key),
"Key should consist of letters, digits, : and -"))
...
}
26. Data Validation: Assertions
extend entity Person {
invitation -> Invitation (inverse=Invitation.invitee)
function invite(email : Email, invitation : WikiText) : Invitation {
validate(findUser(email) == null
&& findInvitationByEmail(email).length == 0,
"That email address is already in use.");
...
}
}
27. Concerns in web applications
- Data model
- User interface templates
- Actions
- Access control rules
- Data validation
WebDSL
- Linguistic integration
- Cross concern, static consistency checking
33. parse
Editor
AST
feedback
core
Integrated
Development
Environment
Code
34. Architectural Requirements for IDEs
Editor services are based on AST
★ services analyze structure, not text of source
Error recovery
★ continue services in presence of syntactic errors
Incremental processing
★ effort of applying analysis, transformation, generation should be
proportional to change in source
Separate compilation (analysis, transformation)
★ keep track of dependencies
35. Holy Grail of Software Language Definition
Automatically derive efficient,
scalable, incremental compiler +
usable IDE from high-level,
declarative language
definition
37. The Spoofax/IMP Language Workbench
Syntax definition: SDF
★ declarative, modular syntax definition
Transformation, analysis, generation: Stratego
★ rewrite rules, strategies, dynamic rules
Editor services
★ domain-specific languages for configuration
Based on IMP framework by IBM Research
46. Lexical Syntax: Identifiers & Literals
follow restriction: symbol may not reserved words
be followed by character from this class:
BlogEntry is one ID
80. Term Rewriting
Term rewrite rules
★ transform term to term
★ pattern matching
★ variable binding
★ substitution
Rewriting strategy
★ algorithm for applying rewrite rules
81. Term Rewrite Rule
left-hand side pattern
label/name
desugar :
Property(x, t) -> Property(x, t, [])
variable
right-hand side pattern
82. Rewrite Strategy
generic strategy
strategy definition
desugar-all = innermost(desugar)
strategy instantiation
apply transformation s exhaustively to all sub-
innermost(s)
terms of subject term in bottom-up order
83. Constant Folding
y := a + (3 * 5 + 2);
Assign(
Var("y")
, Plus(
Var("a")
, Plus(Times(IntLit("3"), IntLit("5")), IntLit("2"))
parse )
)
Assign(
Var("y")
, BinOp(Var("a"), "+", IntLit("17"))
desugar + eval )
y := (a + 17);
pretty-print
89. Consistency Checking
Syntax definition
★ what are well-formed sentences?
Static analysis
★ not all ‘well-formedness’ properties are context-free
★ consistency of compositions
★ consistency of expressions wrt declarations
Error reporting
★ indicate errors in editor
★ use sensible error message
90.
91.
92. Consistency Checking: Ingredients
Editor Interface
★ collecting and displaying errors, warnings
Error checking
★ checking static constraints and reporting errors
Type analysis
★ computing types of expressions
Name resolution
★ disambiguation of names
Reference resolving
★ linking identifiers to declarations
93. Consistency Checking: Generic Approach
Rename
★ make identifiers unique
Map
★ map identifiers to declarations
Project
★ compute properties of declarations, expressions
Check
★ check constraints
96. Error Checking Rules
check :
context -> (target, error)
where assumption
where require(constraint)
require(s) = not(s)
– Context: identifying points in the code to check
– Assumptions: only report an error if certain assumptions hold (validating the context and avoiding spurious errors)
– Constraints: checking for constraints at the context
– Formulating an error message
– Attribution of the error to a particular character range in the source text (usually, only part of the context
97. Error Checking: Binary Operators
check :
e@BinOp(e1, op, e2) ->
(e, $[operator [op] not defined for [<pp>t1] and [<pp>t2]])
where t1 := <type-of> e1
where t2 := <type-of> e2
where require(<type-of> e)
101. Type Analysis: Binary Operators
type-of :
BinOp(e1, op, e2) -> t
where t := <function-type>(op, [<type-of>e1, <type-of>e2])
function-type :
("+", [SimpleType("String"), SimpleType("String")]) -> SimpleType("String")
function-type :
("+", [SimpleType("Int"), SimpleType("Int")]) -> SimpleType("Int")
function-type :
("-", [SimpleType("Int"), SimpleType("Int")]) -> SimpleType("Int")
102. Type Analysis: What is Type of Variable?
define page root(x : Int) {
action exptest() {
for(y : Int in {1,2,x}) {
x := x + y;
}
}
type-of :
}
Var(x) -> t
where t := ???
Assign(
Var("x")
, BinOp(Var("x"), "+", Var("y"))
)
type of variable not part of variable use
103. Variables: Map
declare-all =
alltd(declare)
declare :
Param(x, t) -> Param(x, t)
with rules(
TypeOf : x -> t
)
type-of :
Var(x) -> t
where t := <TypeOf> x
104. Scope
define page root(x : Int) {
action exptest() {
for(x : Int in {1,2,x}) {
print(x);
}
}
}
multiple occurrences of same identifier corresponding to different declarations
105. Variables: Map + Rename
rename-all = alltd(rename)
rename :
Param(x, t) -> Param(y, t)
with y := <rename-var>(x, t)
unique annotation
rename-var :
(x, t) -> y
with y := x{<new>};
map variable to type
rules(
TypeOf : y -> t
RenameId : x -> y
)
rename occurrences
rename :
Var(x) -> Var(y) where y := <RenameId> x
type-of :
Var(x) -> t where t := <TypeOf> x
106. Term Annotations
t{t1,...,tn}
add additional information to term without affecting signature
107. Variables: Check
check :
e@Var(x) -> (e, $[Variable '[x]' not declared])
where require(<type-of>e)
108. Variable Binding Constructs
rename :
For(x, t, e1, stat1*) -> For(y, t, e2, stat2*)
with e2 := <rename-all> e1
with {| RenameId
: y := <rename-var>(x, t)
; stat2* := <rename-all> stat1*
|}
For defines local variable x in body stat1*’
110. Rename, Map, Project, Check
Rename
★ make local variables unique
Map
★ variables to their type
Project
★ compute type of expressions
Check
★ check constraints using types
116. Experience
Bootstrapped
★ SDF, Stratego, ATerm, PP
★ Editor service language
Spoofax
★ WebDSL
★ Mobl: mobile web applications
★ Acoda: migration of data models
★ Aster: attribute grammars
★ PIL: platform independent language
★ Student languages
SDF+Stratego
★ Java, AspectJ, XML, PHP, SQL, Jimple, Octave, Dot, ...
117. Future Work (in progress)
Higher-level definition of scope & type system
★ cover scope systems of real languages
Refactoring
★ layout preservation, generic refactoring strategies
Systematic language design
★ how do we decide that a language design is good?
Interaction design
★ higher-level specifications of interaction
Combining textual and visual
Textual IDE in the browser
118. - the end -
Lennart C. L. Kats, Eelco Visser. The Spoofax Language Workbench. Rules
for Declarative Specification of Languages and IDEs. OOPSLA 2010
http://spoofax.org
http://webdsl.org http://mobl.org
120. define page blog(b : Blog) {
Template Inlining header{output(b.name)}
list{
for(p : Post in b.posts) {
listitem{ outputPost(p) }
}
}
}
define outputPost(pst : Post) {
navigate post(pst) { output(pst.name) }
}
define list() { <ul> elements </ul> }
define listitem() { <li> elements </li> }
define header() { <h1> elements </h1> }
define page blog ( b : Blog ) {
<h1>
output(b.name)
</h1>
<ul>
for ( p : Post in b.posts ) {
<li>
navigate post(p) { output(p.name) }
</li>
}
</ul>
}
121. Context-sensitive Transformation
Local-to-local
★ replace term by another term
Local-to-global
★ local term influence terms in other parts of model
Global-to-local
★ global information influences transformation of local terms
122. define page blog(b : Blog) {
header{output(b.name)}
list{
for(p : Post in b.posts) {
listitem{ outputPost(p) }
}
}
Inlining is Global-to-Local }
define outputPost(pst : Post) {
navigate post(pst) { output(pst.name) }
}
define list() { <ul> elements </ul> }
define listitem() { <li> elements </li> }
define header() { <h1> elements </h1> }
define page blog ( b : Blog ) {
<h1>
output(b.name)
</h1>
<ul>
for ( p : Post in b.posts ) {
<li>
navigate post(p) { output(p.name) }
</li>
}
</ul>
}
123. Inlining as Rewrite Problem
outputPost(p) -> navigate post(p) { output(p.name) }
where define outputPost(pst : Post) {
navigate post(pst) { output(pst.name) }
}
(this is not a valid Stratego rewrite rule)
126. Rewrite in Context
Inline :
[def@TemplateDef(f,[],elem1*) | def1*] -> [def | def2*]
where def2* := <alltd((Call(f) -> Call("container", elem1*)))> def1*
local traversal bound in context
container needed to replace single call with multiple elements
131. Variables
{x, y : s}
★ term variable scope
?t
★ match term pattern t
!t
★ build term pattern t
t1 := t2
★ match term t2 to term (pattern) t1
<s> t
★ apply strategy s to term t
132. Rewrite Rules
l : t1 -> t2 where s
★ named, scoped rewrite rule
★ all variables in t1, t2, s are in scope of the rule
(t1 -> t2 where s)
★ unscoped rewrite rule
★ variables are in scope of enclosing scope
133. Rewrite in Context
Inline :
[def@TemplateDef(f,[],elem1*) | def1*] -> [def | def2*]
where def2* := <alltd((Call(f) -> Call("container", elem1*)))> def1*
bound in context
135. Strategy Definitions
f(x,y|a,b) = s
★ x, y are strategy parameters
★ a, b are term parameters
★ s uses all parameters
f(x) = s f = s
★ term parameters are optional
★ all parameters are optional
Examples
★ try(s) = s <+ id
★ repeat(s) = try(s; repeat(s))
136. Rules with Parameters
Transform all elements of a list
map(s) : [] -> []
map(s) : [x|xs] -> [<s>x | <map(s)> xs]
Invert order of elements of a list
inverse(|ys) : [] -> ys
inverse(|ys) : [x|xs] -> <inverse(|[x|ys])> xs
Pair elements of two lists
zip(s) : ([],[]) -> []
zip(s) : ([x|xs],[y|ys]) -> [<s>(x,y) | <zip(s)>(xs,ys)]
137. Traversal Combinators
all(s)
★ apply s to all direct sub-terms (children)
one(s)
★ apply s to exactly one sub-term
some(s)
★ apply s to at least one sub-term
138. Traversal Strategies
topdown(s) = s; all(topdown(s))
★ apply s to all sub-terms in top-down order
bottomup(s) = all(bottomup(s)); s
★ apply s to all sub-terms in bottom-up order
oncetd(s) = s <+ one(oncetd(s))
★ apply s to one sub-term
alltd(s) = s <+ all(alltd(s))
★ apply s to frontier
139. Rewrite in Context: Local Traversal
Inline :
[def@TemplateDef(f,[],elem1*) | def1*] -> [def | def2*]
where def2* := <alltd((Call(f) -> Call("container", elem1*)))> def1*
local traversal
141. Rewrite in Context: Not Optimal
Inline :
[def@TemplateDef(f,[],elem1*) | def1*] -> [def | def2*]
where def2* := <alltd((Call(f) -> Call("container", elem1*)))> def1*
requires def before use
local traversal for each declaration