3. Who is Synthesis?
• Synthesis is a software and strategy
consultancy
• Cambridge, MA
• 7 people
4. What is WattzOn?
End User Perspective
• WattzOn is a free online tool to quantify,
track, compare and understand the total
amount of energy needed to support all of
the facets of your lifestyle
6. What is WattzOn?
Developer Perspective
scala-orm
WattzOn
scala-utils
Holmz
swag
7. What is Holmz?
• Object oriented “spread-sheet”
• Hierarchies of objects with properties
• Some properties are computed from
formulas over other objects and properties
• Sophisticated formula language (DSL)
• Intended as back-end for other systems
8. Holmz Understands
Units
• Define a property as being “meters/second”
• Insert a value in “smoots/year”, and it will
auto convert
• (5 [gal] * 50[MJ/L] / 4[h]) @ [W]
9. Holmz DSL
Properties can be defined as simple algebraic
expressions over other properties within the
same object
mpg = miles / gallon
10. Holmz DSL
Properties can be defined as a reduction of
properties on other objects
stuff_watts =
for s in creator.worksheets.profile_stuff
select sum(s.watts)
default 0[W]
11. Holmz DSL
Formulas can contain extractor expressions for
decomposing other objects
component_rollup =
for [count, comp] in components
let [trans_watts, _*] =
item_to_country(comp, made_in)
select sum(count * (comp.watts + trans_watts)),
sum(count * comp.mass),
sum(count * comp.disposal_watts)
default 0[W], 0[kg], 0[W]
12. Parser Combinators
def cond = (or ~ opt(quot;?quot; ~> expr ~ (quot;:quot; ~> expr))) ^^ {
case c ~ None => c
case c ~ Some(t ~ e) => Conditional(c, t, e)
}
def or = chainl1(and, quot;||quot; ~> and,
success{(a:AST, b:AST)=>Or(a,b)})
def and = chainl1(rel, quot;&" ~> rel,
success{(a:AST, b:AST)=>And(a,b)})
13. Parser Combinators
• At first, appears to be line noise
• Terse
• Reasonably quick to write, once you
understand them
• Gets a bit hairy for complex grammars
• Error handling is difficult
• Performance is so-so