Professional Documents
Culture Documents
Workday's Transformation To A New Language Platform: Developing A Full-Fledged Programming Language With MPS
Workday's Transformation To A New Language Platform: Developing A Full-Fledged Programming Language With MPS
language platform
Developing a full-fledged programming language with MPS
Safe Harbor Statement
This presentation may contain forward-looking statements for which there are risks, uncertainties, and
assumptions. If the risks materialize or assumptions prove incorrect, Workday’s business results and directions
could differ materially from results implied by the forward-looking statements. Forward-looking statements
include any statements regarding strategies or plans for future operations; any statements concerning new
features, enhancements or upgrades to our existing applications or plans for future applications; and any
statements of belief. Further information on risks that could affect Workday’s results is included in our filings with
the Securities and Exchange Commission which are available on the Workday investor relations
webpage: www.workday.com/company/investor_relations.php
Workday assumes no obligation for and does not intend to update any forward-looking statements. Any
unreleased services, features, functionality or enhancements referenced in any Workday document, roadmap,
blog, our website, press release or public statement that are not currently available are subject to change at
Workday’s discretion and may not be delivered as planned or at all.
Customers who purchase Workday, Inc. services should make their purchase decisions upon services, features,
and functions that are currently available.
Bircan Copur Antonio Gliubich Alexey Yashin
Software Development Software Development Software Development
Engineer Engineer Engineer
Workday Confidential
Agenda
Handling translations in YP
Workday Confidential
Workday
● Established 2005
● Provides business apps:
● Human Capital Management, Payroll,
● Financial Management, Analytics,
● Student, Learning, Recruiting …
● SaaS, in the cloud
● multi-tenant-per server
● Lots of satisfied customers
● Airbnb, Adobe, Amazon, Siemens, Wal-Mart
Applications Development
What is it?
• YP is a new evaluation runtime for our XpressO language
• YP is a new compiler for our XpressO language.
• YP is a language and IDE for developers. (tYPe)
Introduction to YP
What is it?
Workday Confidential
Updating instances in an immutable world
Challenges
• YP assumes immutability!
‒ Expression based
‒ Local variables cannot be changed
‒ Functions are transparent, do not have side effects
‒ Can rearrange code for more efficient execution
Separating Procedures and Functions
Procedures
Functions
apply workerBuilder
• NO apply-ing whatsoever!
‒ YP separates update “instructions” from update “execution”
‒ Allow creating instructions for updates only
‒ Pass those instructions around in functions without any side
effects
‒ Whoever is invoking the function is responsible for applying
UI task, REST API, etc.
The New Way
Syntax
Token
• To create an entity:
‒ create workdogToken
• To delete an entity:
‒ delete workdogToken
(create workdogToken)
.then(set workdogToken.name = “Snoopy”)
.then(set workdogToken.snapshot = snapshotInstance)
update {
create workdogToken
set workdogToken.name = “Snoopy”
set workdogToken.snapshot = snapshotInstance
}
Binding Updates Together
Chain Update
update {
create breedToken
set breedToken.breedName = “Dalmatian”
}.chain((breed) => {
create workdogToken
set workdogToken.name = “Spots the ” +breed.name
})
Binding Updates Together
Update each
worker.hasWorkdog.updateEach((workdog) => {
let workdogToken = workdog.getToken()
set workdogToken.name = worker.name +”’s ” +workdog.name
})
Unit Testing YP Updates
Workday Confidential
Handling Translations in YP
Localization vs Translation
Localization
• Date, time, number formats
• Contact information
• Weights, measurements
• Translations
• …
Coding vs Spoken Languages
Translation Process
code +
code
translations
Translation Process with XO
master
WD UI WD UI WD UI
WD UI
XO XO XO
Metadata Translation
Metadata
(code + Metadata
metadata
translations)
Translations with YP - Prototypes
test Translations {
…
case german {
let result = person.getWelcomeMessage("Joe").translate()
assert result == "Hallo Joe!" :: result
} de_DE
}
Translation Process with Prototypes
• Tried to envision the overall Translation Process using those YP prototypes
tYPe tYPe
tYPe YP ver YP ver
control tYPe
YP control
YP AST YP AST
YP AST
(code + YP AST
translations) translations
Prototypes Evaluation
‒ Translators would have to use tYPe or we would need some import process to add
translations to the AST
‒ Larger AST
compiler loader
runtime
Translatable Text Definition in YP
code Translations
XpressO
external Tools
YP …
+
translatableText WLCM_MSG = "Hi [name]!"
Translations in YP
• Not included in the AST
• Just strings keyed by language code and definition
• Retrieved with a generic interface, from XO metadata, files, etc.
• Translations are retrieved and stored at deployment and available at runtime
code Translations XpressO
external Tools
YP …
+
WLCM_MSG, de_DE, "Hallo [name]!”
WLCM_MSG, it_IT, “Ciao [name]!”
MPS for YP Translations
• Prototyping
• Concepts to define and easily identify a translatable vs non-translatable text
• Human-readable identifier
• Parsing of text expressions
let t = translatableText WLCM_MSG = "Hi [name]!”
We wanted:
• to allow the application developers to create libraries of generic
algorithms (e.g. for collections) and to add type parameters in their
YP code.
• to make YP similar to Java or C# in terms of generics and object
oriented features which those have.
Solution Approach
And when the corresponding when concrete blocks get executed (and
the inequalities solving is done) we end up with something like:
{y26 -> number, t38 -> text}
Checking rule
Once the types are concrete we might want to show a custom error
message to the user if the types don’t match by checking them in a
checking rule.
if (!isSubtype(argType :<=: paramType)) error
Evaluation
• Generics in YP