<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

 <title>Incidental Complexity</title>
 <link href="http://incidentalcomplexity.com/atom.xml" rel="self"/>
  <link href="http://incidentalcomplexity.com"/>
 <updated>2017-12-14T09:55:56-08:00</updated>
 <id>http://incidentalcomplexity.com/</id>
 <author>
   <name>Kodowa, Inc.</name>
   <email>info@kodowa.com</email>
 </author>

 
 <entry>
   <title>Dev Diary (September 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/10/04/September/"/>
   <updated>2017-10-04T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/10/04/September/</id>
   <content type="html">&lt;h2 id=&quot;platform&quot;&gt;Platform&lt;/h2&gt;

&lt;p&gt;We spent the majority of last month prototyping a new graphical interface for Eve. We’re exploring new ways to interact with Eve that enable us to more quickly express the programs Eve is targeting. Such workflows should have the property that building a simple application (like the incrementer or bouncing balls examples) should require very little coding, and you should be able to build them within a few minutes. Here are some example videos that demonstrate the prototype interface at work:&lt;/p&gt;

&lt;p&gt;The incrementor example:&lt;/p&gt;

&lt;center&gt;
&lt;img src=&quot;/images/incrementer.gif&quot; /&gt;
&lt;/center&gt;

&lt;p&gt;The bouncing balls example (&lt;a href=&quot;https://www.youtube.com/watch?v=zenELksXotI&amp;amp;feature=youtu.be&quot;&gt;link&lt;/a&gt; for video):&lt;/p&gt;

&lt;center&gt;
&lt;a href=&quot;https://www.youtube.com/watch?v=zenELksXotI&amp;amp;feature=youtu.be&quot;&gt;&lt;img src=&quot;/images/bouncing.png&quot; /&gt;&lt;/a&gt;
&lt;/center&gt;

&lt;p&gt;We started a &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/tLgrw4zlc5U&quot;&gt;thread on the mailing list&lt;/a&gt; where we will be posting more of these videos as the interface becomes more robust. We’re going to hold this prototype back from release until the end of October, just to get it a little further along; but in the meantime, we’d like to hear any feedback you have!&lt;/p&gt;

&lt;p&gt;One of the things we’re trying to do with this prototype is to make sure the programs we want to build are easily expressible. Therefore, we are also mocking up how various programs might be built in this interface. We’ll be making our examples more complex over time, so we can be sure certain programs can be easily expressed in this interface. If you have any ideas about programs that might be hard to build in the prototype interface as demonstrated, let us know and we’ll mock-up a solution that will guide our development.&lt;/p&gt;

&lt;p&gt;If you’re interested in the reasons we’re currently moving in this direction, Chris goes into more detail in &lt;a href=&quot;https://groups.google.com/d/msg/eve-talk/tLgrw4zlc5U/VTF1jtEHAAAJ&quot;&gt;this&lt;/a&gt; post on the mailing list.&lt;/p&gt;

&lt;h2 id=&quot;community&quot;&gt;Community&lt;/h2&gt;

&lt;h3 id=&quot;eve-around-the-web&quot;&gt;Eve Around The Web&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;The Atlantic&lt;/em&gt; magazine published an article titled &lt;a href=&quot;https://www.theatlantic.com/technology/archive/2017/09/saving-the-world-from-code/540393/&quot;&gt;“The Coming Software Apocalypse”&lt;/a&gt; at the end of September, which features some thoughts from Chris on the future of programming. If you follow us, his words will likely be familiar to you, but the whole article focuses on more than just Eve, covering various projects attempting to shape the future of programming.&lt;/p&gt;

&lt;h3 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h3&gt;

&lt;p&gt;Coming up this month, Chris is giving a &lt;a href=&quot;https://2017.splashcon.org/event/splash-2017-keynotes-splash-2017-keynote-eve-tackling-a-giant-with-a-change-in-perspective&quot;&gt;keynote presentation&lt;/a&gt; at &lt;a href=&quot;https://2017.splashcon.org/home&quot;&gt;SPLASH 2017&lt;/a&gt; titled: “Eve: tackling a giant with a change in perspective”. If you’re attending SPLASH this year, his talk will be on October 25th at 08:45 AM. We look forward to meeting you there!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (July 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/08/14/July/"/>
   <updated>2017-08-14T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/08/14/July/</id>
   <content type="html">&lt;p&gt;We’ve had quite a busy July! Let’s get to it:&lt;/p&gt;

&lt;h2 id=&quot;v04-release-timeline&quot;&gt;v0.4 Release Timeline&lt;/h2&gt;

&lt;p&gt;When it became clear that despite our move to an incremental evaluation strategy, v0.3 wouldn’t be fast enough to run the database explorer, we started work on the Rust runtime in hopes that a lower-level host language would offer greater speed improvements. That bet paid off (as demonstrated by our bouncing ball program). Since the Rust runtime is here to stay, we will skip releasing v0.3 officially, and release v0.4 by the end of the summer. Right now the core runtime is feature complete, and we are working hard at making the product easy to use by fixing bugs and adding helpful tooling.&lt;/p&gt;

&lt;center&gt;
&lt;img src=&quot;/images/v0.4-performance.gif&quot; /&gt;
&lt;/center&gt;

&lt;h2 id=&quot;v04-milestones&quot;&gt;v0.4 Milestones&lt;/h2&gt;

&lt;p&gt;In July we started using v0.4 to build internal projects, in order to find bugs in the runtime and test the limits of its performance. If you’ve hit performance walls with the v0.3 runtime, you’ll be happy to know the Rust runtime is several orders of magnitude faster. Beyond the runtime itself, we’ve started fleshing out the tooling:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Server&lt;/strong&gt; - The sever works like it did in v0.2, hosting an Eve instance listening on a websocket. We also include a static file server that hosts the output of your program.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Browser Client&lt;/strong&gt; - The browser client connects to a remote Eve server to which it streams records like key presses and receives HTML records that are rendered on the screen. All the functionality from previous versions is still present – no matter where Eve is running, the watcher system lets it interact with your browser (or anything else running JS or Rust) as if it were local.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Persistance&lt;/strong&gt; - This is one of the features that has been missing since v0.2 and frequently requested. Persistence is implemented by writing to an append-only binary file at a user specified location. Right now this is a flag passed to the Eve executable, but this could be controlled from within Eve itself. Transactions are written to this log as they are executed in the runtime, and only those needed to reconstruct the state are persisted. We have no guarantees on durability/consistency yet, but that work will come when we start to tackle Eve in a distributed context.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Library&lt;/strong&gt; - The entire standard library will be re-implemented in Rust for a number of reasons:&lt;/p&gt;

    &lt;ol&gt;
      &lt;li&gt;Performance&lt;/li&gt;
      &lt;li&gt;JS functions require a browser context, and therefore cannot be run in the terminal.&lt;/li&gt;
    &lt;/ol&gt;

    &lt;p&gt;This is largely a matter of wrapping native Rust functions for use in Eve, but we want to hold off on that until we implement a custom number system we have planned (more on that in a future post). We’ve added old watchers like &lt;code class=&quot;highlighter-rouge&quot;&gt;file&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;console&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;compiler&lt;/code&gt;; as well as new watchers like &lt;code class=&quot;highlighter-rouge&quot;&gt;http&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;json&lt;/code&gt;. These newest additions allow you to parse JSON files into records, or send HTTP requests to API endpoints and parse the response.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;center&gt;
&lt;img src=&quot;/images/v0.4-error.png&quot; /&gt;
&lt;/center&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Errors&lt;/strong&gt; - We are reporting errors in the console, including line numbers and a helpful hint. We will also make these errors available through a request to the server, allowing 3rd party developer/editor extensions to integrate error reporting. That said, this work was mostly a matter of plumbing; providing good error messages is an ongoing process.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;More testing&lt;/strong&gt; - Rust has really nice testing facilities that make writing and running unit tests very easy. We’ve written a bunch of those that broadly cover the core functionality of the language. Testing in this context also means we just have to write a bunch of Eve applications to probe the runtime for weak spots.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;center&gt;
&lt;img src=&quot;/images/v0.4-packaging.png&quot; /&gt;
&lt;/center&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Packaging and Distribution&lt;/strong&gt; - To reach a wider audience, packaging and distribution will be a primary focus for this release. Packaging the Eve server is mostly handled for us by Rust, as it emits executables for all major platforms. The server can even host a native Eve editor. We’ve also experimented with embedding the Eve server in an Electron app. This solution allows us to present Eve as more of a native application, separate from the browser.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Editor Modes&lt;/strong&gt; - When we released v0.2, we included a built in editor that showcased many of Eve’s features like the inspector and literate programming. However, we recognize that many people enjoy their own editor, so we will be writing various editor modes that support Eve. So far we have Eve modes for &lt;a href=&quot;https://github.com/witheve/emacs-eve-mode&quot;&gt;Emacs&lt;/a&gt;, &lt;a href=&quot;https://github.com/witheve/vscode-eve-mode&quot;&gt;Visual Studio Code&lt;/a&gt;, and &lt;a href=&quot;https://github.com/witheve/codemirror-mode-eve&quot;&gt;CodeMirror&lt;/a&gt;. Right now these only provide syntax highlighting, but we intend to make the various services that power the v0.2 editor editor open for integration into mainstream editors as well.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;community&quot;&gt;Community&lt;/h2&gt;

&lt;h3 id=&quot;eve-around-the-web&quot;&gt;Eve Around the Web&lt;/h3&gt;

&lt;p&gt;One member of our community, Vincenzo Ferrari wrote a &lt;a href=&quot;https://www.ibuildings.it/it/blog/eve-una-piattaforma-il-web&quot;&gt;great article&lt;/a&gt; about Eve for the website &lt;a href=&quot;https://www.ibuildings.it/it/blog/eve-una-piattaforma-il-web&quot;&gt;ibuildings.it&lt;/a&gt;. It’s a great summary of the language, and we’re very happy to see Eve reaching a wider international audience. Here’s a quick link to an &lt;a href=&quot;https://translate.google.com/translate?sl=auto&amp;amp;tl=en&amp;amp;js=y&amp;amp;prev=_t&amp;amp;hl=en&amp;amp;ie=UTF-8&amp;amp;u=https%3A%2F%2Fwww.ibuildings.it%2Fit%2Fblog%2Feve-una-piattaforma-il-web&amp;amp;edit-text=&amp;amp;act=url&quot;&gt;English translation&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, Tuesday July 25&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We were very happy to see some new faces at our meetup in July! Thanks to everyone who stopped by, we always appreciate getting to talk about the bleeding edge of programming languages with people who are as interested in these topics as we are.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (June 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/07/06/June/"/>
   <updated>2017-07-06T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/07/06/June/</id>
   <content type="html">&lt;h2 id=&quot;preview-5-of-v03&quot;&gt;Preview 5 of v0.3&lt;/h2&gt;

&lt;p&gt;We released a new preview of v0.3 that includes several bug fixes and some new features. For a full changelog, please see the &lt;a href=&quot;http://incidentalcomplexity.com/2017/06/28/release-0.3p5/&quot;&gt;release notes&lt;/a&gt;. Two of the new features, the &lt;code class=&quot;highlighter-rouge&quot;&gt;console&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;file&lt;/code&gt; libraries, provide new options for using Eve.&lt;/p&gt;

&lt;p&gt;We’ve supported running Eve in headless mode (without hooks to the browser) for awhile now, but it wasn’t useful since most of our UI, debugging, and IO at the moment are done through the browser. The &lt;code class=&quot;highlighter-rouge&quot;&gt;console&lt;/code&gt; library allows you to write to &lt;code class=&quot;highlighter-rouge&quot;&gt;stdout&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;stderr&lt;/code&gt;, so you can now pipe values generated by Eve to other applications (we still need to add the ability to pipe values &lt;em&gt;into&lt;/em&gt; Eve, but that’s on our list).&lt;/p&gt;

&lt;p&gt;Speaking of getting data into Eve, the &lt;code class=&quot;highlighter-rouge&quot;&gt;file&lt;/code&gt; library allows you write and read files directly from the filesystem, opening up the ability to read larger datasets into Eve. We’ll be adding facilities shortly in Eve that parse common data formats into records, like JSON and CSV.&lt;/p&gt;

&lt;h2 id=&quot;progress-with-v04&quot;&gt;Progress with v0.4&lt;/h2&gt;

&lt;p&gt;Many of you have asked about the status of v0.4, and we’re pleased to say it’s coming along nicely. For those who don’t know, the v0.4 runtime is implemented in Rust, mainly for increased performance. It’s similar conceptually to the v0.3 runtime (based on the research of Frank McSherry in differential dataflow), but is designed with the lessons learned from v0.3. We’ll share more about performance when the runtime is feature-complete and ready for wider distribution.&lt;/p&gt;

&lt;h2 id=&quot;community&quot;&gt;Community&lt;/h2&gt;

&lt;h3 id=&quot;community-slack&quot;&gt;Community Slack&lt;/h3&gt;

&lt;p&gt;We opened a &lt;a href=&quot;https://slack-signup.witheve.com/&quot;&gt;community slack channel&lt;/a&gt;, so you can chat with and get help from us and fellow Eve developers. There’s usually at least one dev hanging around the channel during working hours (Pacific time), but in the future we’re planning explicit office hours where our sole purpose is to help you solve problems with your code. For now we’re keeping it casual, so drop by and we can talk about Eve.&lt;/p&gt;

&lt;h3 id=&quot;tweve&quot;&gt;Tweve&lt;/h3&gt;

&lt;p&gt;Brian Theado has been working on &lt;a href=&quot;https://btheado.github.io/tweve/&quot;&gt;Tweve&lt;/a&gt;, which marries Eve and Tiddlywiki. Tiddlywiki is a notebook-like environment that allows you to embed rich-content in your notes. Tweve is a plugin for Tiddlywiki that allows you to embed Eve code in your notebook. One of the more interesting parts of this project is that it allows you to embed multiple Eve programs in a single document, as well as multiple documents as a single program. We’re very interested to see how far Brian takes his project!&lt;/p&gt;

&lt;h3 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen, June 27&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Zubair Quraishi held yet another successful meetup in Copenhagen, and we’re definitely grateful for his continued evangelism across the pond! He’s posted some pictures and reactions on the &lt;a href=&quot;https://www.meetup.com/evecph/events/240055666/&quot;&gt;Meetup website&lt;/a&gt; and the &lt;a href=&quot;https://groups.google.com/d/msg/eve-talk/PwlgSIdppMQ/Xb9zI5niAAAJ&quot;&gt;mailing list&lt;/a&gt;. Thanks again Zubair!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, June 27&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks to everyone who came to our second meetup, in which we helped people install Eve and introduced the language to people who were new. We learned a lot by watching people go through the quickstart tutorial, which has caused us to re-evaluate the getting started process.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, Tuesday July 25&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’re having another meetup on July 25, at 7:00 PM at the Eve offices in downtown San Francisco (SOMA). Please &lt;a href=&quot;https://www.meetup.com/witheve/events/241433210/&quot;&gt;RSVP&lt;/a&gt; so we know how many pizzas to order :)&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Alpha v0.3 preview 5</title>
   <link href="http://incidentalcomplexity.com/2017/06/23/release-0.3p5/"/>
   <updated>2017-06-23T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/06/23/release-0.3p5/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We’re releasing Preview 5 of Eve v0.3 today. This isn’t a huge release, but it contains some critical bug fixes, so if you’re using Preview 4, you’ll want this right away.&lt;/p&gt;

&lt;h2 id=&quot;whats-new&quot;&gt;What’s New?&lt;/h2&gt;

&lt;h3 id=&quot;eve-starter&quot;&gt;Eve Starter&lt;/h3&gt;

&lt;p&gt;Since more people are using &lt;code class=&quot;highlighter-rouge&quot;&gt;eve-starter&lt;/code&gt;, we’ve implemented two development streams so we don’t break your work inadvertently.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/witheve/eve-starter/tree/release&quot;&gt;release&lt;/a&gt; - This branch will be in sync with the witheve npm module.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/witheve/eve-starter&quot;&gt;nightly&lt;/a&gt; - We will be actively pushing to &lt;code class=&quot;highlighter-rouge&quot;&gt;eve-starter/master&lt;/code&gt;, so if you want to work with the bleeding edge of Eve, work from this branch. We’ll warn of breaking changes on the community Slack, but more formal notice of breaking changes will only come when we package a release.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ve updated the &lt;a href=&quot;https://github.com/witheve/eve-starter&quot;&gt;readme&lt;/a&gt; with instructions on how to work with these branches.&lt;/p&gt;

&lt;p&gt;Due to changes in the way npm works, if you are updating a current installation of Eve v0.3 (preview 4 or earlier) and you have a &lt;code class=&quot;highlighter-rouge&quot;&gt;package-lock.json&lt;/code&gt; file in your &lt;code class=&quot;highlighter-rouge&quot;&gt;eve-starter&lt;/code&gt; directory, you will need to delete this file in order to upgrade:&lt;/p&gt;

&lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rm &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; node_modules
rm package-lock.json
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you don’t have this file, you are fine.&lt;/p&gt;

&lt;h3 id=&quot;new-libraries&quot;&gt;New Libraries&lt;/h3&gt;

&lt;p&gt;We’ve got three new libraries for you today: notify, file, and console.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;notify&lt;/strong&gt; - Provides a configurable notification banner for displaying info, alerts and errors.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;file&lt;/strong&gt; - Provides facilities for accessing the filesystem. This library can only be used when Eve is running in headless mode.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;console&lt;/strong&gt; - Allows you to write messages to console log, warn, and error.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;changelog&quot;&gt;Changelog&lt;/h2&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;We made a couple fixes to the Eve platform:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Action lookups in the syntax now support dynamic attributes - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/846&quot;&gt;849&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Fixed an issue with aggregates and grouping, which would cause blocks using them to fail - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/856&quot;&gt;856&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Fixed unterminated record/quote errors - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/848&quot;&gt;848&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Prevent exception from program which parses no code blocks - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/850&quot;&gt;850&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Fixed double-printing first line on error spans that start at the beginning of the block - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/848&quot;&gt;848&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Better error message for non-fixpoint - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/847&quot;&gt;847&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Add a custom error message for values without attributes in a record - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/845&quot;&gt;845&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Allow appendAsEAVs to also handle nested sub-records - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/861&quot;&gt;861&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Export all first party watcher classes - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/862&quot;&gt;862&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;renderer&quot;&gt;Renderer&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Enables using &lt;code class=&quot;highlighter-rouge&quot;&gt;html.addExternalRoot()&lt;/code&gt; to control SVG placement - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/846&quot;&gt;846&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;Enables mixing SVG into HTML documents - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/846&quot;&gt;846&lt;/a&gt;]&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;library&quot;&gt;Library&lt;/h3&gt;

&lt;p&gt;For the first time, the standard library now has a baseline of &lt;a href=&quot;http://docs.witheve.com/v0.3/handbook/libraries/stdlib/&quot;&gt;documentation&lt;/a&gt;. The documented libraries include aggregates, math, strings, HTML, canvas, UI, system, file, and console.&lt;/p&gt;

&lt;p&gt;We’ve also changed/added the following:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;added the &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/src/runtime/stdlib.ts#L191&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;math/pow[]&lt;/code&gt;&lt;/a&gt; function - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/856&quot;&gt;856&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;added the &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/src/runtime/stdlib.ts#L211&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;math/convert-base[]&lt;/code&gt;&lt;/a&gt; function - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/856&quot;&gt;856&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;added the &lt;code class=&quot;highlighter-rouge&quot;&gt;#notify&lt;/code&gt; library - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/859&quot;&gt;859&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;added the &lt;code class=&quot;highlighter-rouge&quot;&gt;#file&lt;/code&gt; library - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/858&quot;&gt;858&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;added the &lt;code class=&quot;highlighter-rouge&quot;&gt;#console&lt;/code&gt; library - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/858&quot;&gt;858&lt;/a&gt;]&lt;/li&gt;
  &lt;li&gt;(&lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/SF_ittD0nU8&quot;&gt;BREAKING&lt;/a&gt;) - adjusted the attributes on &lt;a href=&quot;http://docs-next.witheve.com/v0.3/handbook/libraries/stdlib/#system&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;#system/timer&lt;/code&gt;&lt;/a&gt;:
    &lt;ul&gt;
      &lt;li&gt;fixed &lt;code class=&quot;highlighter-rouge&quot;&gt;day&lt;/code&gt; attribute on timer to report the day of the month, not the day of the week - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/853&quot;&gt;853&lt;/a&gt;]&lt;/li&gt;
      &lt;li&gt;added &lt;code class=&quot;highlighter-rouge&quot;&gt;weekday&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;millisecond&lt;/code&gt; attributes - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/853&quot;&gt;853&lt;/a&gt;]&lt;/li&gt;
      &lt;li&gt;changed &lt;code class=&quot;highlighter-rouge&quot;&gt;frames&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;tick&lt;/code&gt; - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/855&quot;&gt;855&lt;/a&gt;]&lt;/li&gt;
      &lt;li&gt;changed &lt;code class=&quot;highlighter-rouge&quot;&gt;hours&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;minutes&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;seconds&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;hour&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;minute&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;second&lt;/code&gt; - [&lt;a href=&quot;https://github.com/witheve/Eve/pull/855&quot;&gt;855&lt;/a&gt;]&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;contributors&quot;&gt;Contributors&lt;/h2&gt;

&lt;p&gt;Thanks to everyone who contributed to this release!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/ThatOtherPerson&quot;&gt;@ThatOtherPerson&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/btheado&quot;&gt;@btheado&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Dev Diary (May 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/06/01/may/"/>
   <updated>2017-06-01T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/06/01/may/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In May we released Preview 3 of v0.3, published some new documentation, and had a meetup.&lt;/p&gt;

&lt;h2 id=&quot;preview-3-of-v03&quot;&gt;Preview 3 of v0.3&lt;/h2&gt;

&lt;h3 id=&quot;the-eve-syntax-returns&quot;&gt;The Eve Syntax Returns&lt;/h3&gt;

&lt;p&gt;The parser for the Eve syntax returns in Preview 3. While the parser is included again, there’s still no editor bundled, so parsing a program written in the Eve syntax can accomplished in JavaScript like so:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;witheve&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;program name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;some-eve-code&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Where &lt;code class=&quot;highlighter-rouge&quot;&gt;some eve code&lt;/code&gt; is a complete multiline Eve document (i.e. the contents of a *.eve file). A second method is to download &lt;a href=&quot;https://github.com/witheve/eve-starter&quot;&gt;eve-starter&lt;/a&gt;, and put your *.eve file in the “programs” directory. Then launch the program switcher (run npm start in the eve-start directory, then direct your browser to localhost:8000), and you will see your program listed in the left panel.&lt;/p&gt;

&lt;p&gt;We also updated the &lt;a href=&quot;https://github.com/witheve/eve-starter/tree/master/programs&quot;&gt;example Eve applications&lt;/a&gt; for v0.3. This entailed removing any references to databases, and updating records to use the new namespaced tags. We haven’t documented the various watchers yet (e.g. html, svg, events) so if you’re curious how to use these, you can use the example programs as a reference for now.&lt;/p&gt;

&lt;h3 id=&quot;documentation-for-v03&quot;&gt;Documentation for v0.3&lt;/h3&gt;

&lt;p&gt;As part of this release, we’re also making available our &lt;a href=&quot;http://docs.witheve.com/v0.3/&quot;&gt;documentation refresh&lt;/a&gt;. We’ve updated the layout to match the new Eve website, and we’ve added some summary documents to help new users get oriented in the language. These include:&lt;/p&gt;

&lt;p&gt;- A new &lt;a href=&quot;http://docs.witheve.com/v0.3/tutorials/quickstart/&quot;&gt;quickstart&lt;/a&gt; – We’ve got a new version of the quickstart that aims to be a 5 minute introduction to Eve. In 6 blocks we introduce blocks, records, and the difference between binding and committing records.&lt;/p&gt;

&lt;p&gt;- A new &lt;a href=&quot;http://docs.witheve.com/v0.3/syntaxreference/&quot;&gt;syntax reference&lt;/a&gt; – this is a 3 page document that acts as a reference for the Eve syntax. You can view it online, or print it out to keep handy on your desk.&lt;/p&gt;

&lt;p&gt;- A &lt;a href=&quot;http://docs.witheve.com/v0.3/handbook/libraries/stdlib/&quot;&gt;library reference&lt;/a&gt; – This page will act as an index to the standard library. For every function in the standard library, we list its arguments as well as an example demonstrating its usage.&lt;/p&gt;

&lt;p&gt;These documents represent the minimum viable documentation to the Eve language. We hope you’ll take a look, and let us know if anything need more clarity or if we’ve omitted any important details. As we update the current docs for v0.3, they’ll become available on the v0.3 docs site.&lt;/p&gt;

&lt;p&gt;One other note about documentation – from now on we’ll be maintaining documentation for the current and future versions of Eve. To that end, when you go to &lt;a href=&quot;http://docs.witheve.com&quot;&gt;docs.witheve.com&lt;/a&gt;, you’ll currently see an option to select v0.2 or v0.3&lt;/p&gt;

&lt;h2 id=&quot;community&quot;&gt;Community&lt;/h2&gt;

&lt;h3 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen, June TBD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just a reminder that Zubair is hosting a meetup in Copenhagen this June. We’ll let you know when a date has been finalized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, Wednesday May 31&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Last night we held our first official Eve meetup at our offices in downtown San Francisco. I’d like to thank everyone. Myself and the rest of the team enjoyed meeting everyone. We had an opportunity to finally meet some long-time users, as well as introduce ourselves to people finding Eve for the first time.&lt;/p&gt;

&lt;p&gt;Please, if you have any feedback or ideas for future meetups, send me an e-mail at &lt;a href=&quot;mailto:corey@kodowa.com&quot;&gt;corey@kodowa.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, Tuesday June 27&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you wanted to attend the meetup but couldn’t for some reason, don’t worry – we’ll be holding another one at the end of this month, again at the Kodowa office in downtown (SOMA) SF. Please see &lt;a href=&quot;https://www.meetup.com/witheve/events/240467367/&quot;&gt;this link&lt;/a&gt; to RSVP.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (April 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/05/15/april/"/>
   <updated>2017-05-15T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/05/15/april/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In April we continued our effort to release v0.3 of Eve. On April 18th we released a second preview of the v0.3 platform, which included several long-requested features. However, toward the end of the month we shifted focus to revamping documentation and making the “getting started” experience for Eve more accessible to new users. Let’s take a look at each of these.&lt;/p&gt;

&lt;h2 id=&quot;platform&quot;&gt;Platform&lt;/h2&gt;

&lt;p&gt;We released a second preview of the v0.3 runtime, featuring the ability to embed Eve-rendered elements into an application; and streamlined watchers with built in support for more DOM events and triggers in the HTML watcher. These are covered in detail in the release notes, but I’ll take a moment now to highlight how multiple parent roots work.&lt;/p&gt;

&lt;h3 id=&quot;embedding-eve-rendered-elements-in-your-application&quot;&gt;Embedding Eve-rendered Elements in Your Application&lt;/h3&gt;

&lt;p&gt;We’ve received some requests from people who would like to use Eve to render specific elements in an already existing project. To date, you could only attach Eve-rendered elements to the document root. With v0.3, you’ll be able to embed any piece of Eve-rendered UI into your application arbitrarily. First, you add a reference to the parent element into Eve:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;witheve&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my program&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;htmlWatcher&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;someElement&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;#eve-wrapper&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;htmlWatcher&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addExternalRoot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my-root&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;someElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From within Eve, you can search for that element and add children to it, as you would any other record:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  root = [#my-root]

bind
  root.children += [#ui/text text: &quot;Hello!&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Eve behaves as expected, updating the embedded element as records change. For new users, this is a nice way to introduce Eve to an existing project; instead of porting an application from scratch, you can dip your toes in the water and build a new component in Eve, then inject it into your project wherever you want. As you get more comfortable with Eve, you can use it in more of you application.&lt;/p&gt;

&lt;h3 id=&quot;eve-syntax-returns&quot;&gt;Eve Syntax Returns&lt;/h3&gt;

&lt;p&gt;When we initially released the v0.3 preview, it notably didn’t include a parser for the Eve syntax. We had planned on eventually adding the syntax back, but it wasn’t our main priority because the Javascript DSL served as an adequate replacement for the time being. However, because we received a number of requests to add it back in, we decided to bump adding the syntax higher up on the list. That work is generally completed, and you’ll see it in the next v0.3 preview.&lt;/p&gt;

&lt;p&gt;I’d like to say thanks to everyone who gave their input regarding the syntax. When we released it with v0.2, we didn’t know how it would be received, so we were happy to see that people liked it enough to request it return with v0.3. As always, we’re developing Eve in the open, so your feedback has a big impact on how we prioritize work.&lt;/p&gt;

&lt;h2 id=&quot;web-presence&quot;&gt;Web Presence&lt;/h2&gt;

&lt;p&gt;Before we can officially release v0.3, a lot of work needs to be done on the usability and documentation side of things. To this end, we revamped our website to make it more accessible to people unfamiliar but curious about Eve. A big part of this effort was actually coming up with a one-sentence pitch, describing Eve in a nutshell.&lt;/p&gt;

&lt;h3 id=&quot;a-new-pitch-for-eve&quot;&gt;A new pitch for Eve&lt;/h3&gt;

&lt;p&gt;Here’s our new one sentence pitch for Eve:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Eve is a modern relational language for writing data-driven programs without the boilerplate.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The intended audience for this pitch is generally the HackerNews crowd – developers who are curious about languages and likely to try something new to the scene. Eve has even deeper aspirations (such as being a language for non-programmers), but this pitch is directed more toward explaining what Eve is today. We wanted to pack as much information into this one sentence as possible, so you can get a general idea of the concepts important to Eve after reading it. This is actually easier said than done, so I’ll break down how we went about this.&lt;/p&gt;

&lt;p&gt;The first thing we did was look at how other languages described themselves. We picked about a half dozen languages and chose our favorite pitches between them. Some, like Python, had very nebulous pitches: “Python is a programming language that lets you work quickly and integrate systems more effectively.” I think for anyone whose used Python, this is an accurate description of the language, but it doesn’t really say how Python lets you work quickly. Others, like Haskell, were very specific: “An advanced, purely functional programming language”. That’s definitely Haskell in a nutshell.&lt;/p&gt;

&lt;p&gt;We wanted our pitch to tell the reader what Eve is, what makes it unique, and why one would use it over other languages. From the pitch, you can see we arrived at these traits&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modern&lt;/strong&gt; - It was important for us to note that Eve is a new take on programming, specifically on “relational languages”. On its own, relational may connote SQL, which is not what we want to do. By claiming that we are “modern” we hope to tell the reader that Eve is an updated approach to things they may have seen in the past.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Relational language&lt;/strong&gt; - there were several candidates to describe what &lt;em&gt;kind&lt;/em&gt; of language Eve is. Pattern matching, logic, declarative. We decided on “relational” because relations are a concept central to programming in Eve, and we wanted to highlight this fact upfront.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data-driven&lt;/strong&gt; - data is also a central concept to Eve, so having this word in our pitch was important to us. Of course, data is important in all programs, but claiming the language is “data-driven” gets across the idea that the language paradigm is not imperative.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without the boilerplate&lt;/strong&gt; - our central thesis in developing Eve is that current approaches to programming are hampered by incidental complexity. A lot of this complexity is driven by simple boilerplate - code that stands between you and the inherent complexity of your programming task. Boilerplate is a pain point for many developers, something we all understand is frustrating, but that we deal with nonetheless. If you’re not sure about a modern relational language for writing data-driven programs, hopefully you can understand the value of a  language without boilerplate.&lt;/p&gt;

&lt;h3 id=&quot;the-eve-homepage&quot;&gt;The Eve Homepage&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/newsite.png&quot; alt=&quot;New Homepage&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’re going to be revamping our various web properties (the website, blog, and docs) in the coming weeks. We started the process with the &lt;a href=&quot;http://witheve.com&quot;&gt;homepage&lt;/a&gt;, giving it a fresh coat of paint and some new content. The various links still relate back to v0.2 content, but we’ll be updating those to a consistent look with refreshed content in the coming weeks.&lt;/p&gt;

&lt;h2 id=&quot;community&quot;&gt;Community&lt;/h2&gt;

&lt;h3 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen, June&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Zubair Quraishi is again hosting an Eve meetup in Copenhagen, scheduled for sometime in June. We’ll post another update when he’s set a firm date.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, Wednesday May 31 7:00 PM&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’re going to be holding our first &lt;a href=&quot;https://www.meetup.com/witheve/&quot;&gt;official Eve meetup&lt;/a&gt; at the Eve office in downtown San Francisco on May 31 at 7:00 PM. If you are interested in attending &lt;a href=&quot;https://www.meetup.com/witheve/&quot;&gt;RSVP on meetup.com&lt;/a&gt;, or if you have any ideas of what you’d like to learn, drop me a line via &lt;a href=&quot;mailto:corey@kodowa.com&quot;&gt;e-mail&lt;/a&gt; or &lt;a href=&quot;https://twitter.com/with_eve&quot;&gt;Twitter&lt;/a&gt;.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Alpha v0.3 preview 2</title>
   <link href="http://incidentalcomplexity.com/2017/04/18/release-0.3p2/"/>
   <updated>2017-04-18T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/04/18/release-0.3p2/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we’ve got the v0.3 preview out the door, we’re ramping up to a more regular release schedule. In that spirit, today we’re releasing the second preview of Eve v0.3, which largely improves built in watchers, but contains some other goodies as well.&lt;/p&gt;

&lt;p&gt;If you want to try out this version, we have two routes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;If you’re new to Eve and want to start a new Eve application, you should follow the instructions at &lt;a href=&quot;https://github.com/witheve/eve-starter&quot;&gt;eve-starter&lt;/a&gt;. This repository contains everything you need to start an Eve project, and some small examples demonstrating the JavaScript DSL.&lt;/li&gt;
  &lt;li&gt;If you’d like to integrate Eve into an existing JavaScript project, download the npm package. You can find instructions &lt;a href=&quot;https://github.com/witheve/Eve#integrating-eve-into-an-existing-project&quot;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you’re used to running Eve, you may be looking for the editor and Eve syntax. We’re not finished working on those yet, so they are not included in this preview. If you’d like to use those, please stick with the v0.2.3 branch, and we’ll keep you updated as to when those make it into the main branch. There &lt;strong&gt;will&lt;/strong&gt; be breaking changes though, so any code you write now will have to be rewritten to a degree (for instance, some tags will be changing and databases are being removed from the language.)&lt;/p&gt;

&lt;h3 id=&quot;whats-new&quot;&gt;What’s new?&lt;/h3&gt;

&lt;p&gt;Let’s take a look at some of the bigger improvements.&lt;/p&gt;

&lt;h4 id=&quot;embedding-eve-elements-in-your-app&quot;&gt;Embedding Eve Elements in Your App&lt;/h4&gt;

&lt;p&gt;You can now embed Eve rendered elements into your non-Eve application. This is accomplished with the &lt;code class=&quot;highlighter-rouge&quot;&gt;addExternalRoot(tag:string, element:HTMLElement)&lt;/code&gt; function, which registers an arbitrary root element to serve as parents to Eve-rendered elements. This block creates a record tagged “my-root” in Eve:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;witheve&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my program&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;htmlWatcher&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;attach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;html&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;someElement&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;#eve-wrapper&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;htmlWatcher&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;addExternalRoot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my-root&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;someElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now you can access that element from within Eve, giving you the ability to use it as a parent for child elements rendered by Eve. This block searches for that record, and that adds a div with some text as a child:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;render into #eve-wrapper&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;my_root&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;my-root&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;my_root&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;children&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;html/element&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;tagname&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;text&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;hello, world!&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;])&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This scenario works well if you have an already existing application, and you’d like to use Eve to render certain elements.&lt;/p&gt;

&lt;h4 id=&quot;watchers&quot;&gt;Watchers&lt;/h4&gt;

&lt;p&gt;We’ve added and streamlined various watchers that interact with the browser. We’re now at the point where v0.3 is caught up to v0.2.x in terms of the available watchers. Additionally, we’ve added support for more DOM events and triggers in the HTML watcher:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;button&lt;/code&gt; attribute to all mouse events (values &lt;code class=&quot;highlighter-rouge&quot;&gt;left&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;right&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;middle&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;4&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;5&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;double-click&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;mouse-down&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;mouse-up&lt;/code&gt; events.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;html/listener/context-menu&lt;/code&gt; tag. If an element with this tag is right clicked, the default context menu will not be shown, allowing you to render your own. You can grab page-relative mouse position off of any of the mouse events as &lt;code class=&quot;highlighter-rouge&quot;&gt;page-x&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;page-y&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;key-press&lt;/code&gt; event, with support for printable characters and the following control keys: &lt;code class=&quot;highlighter-rouge&quot;&gt;tab&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;enter&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;shift&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;control&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;alt&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;escape&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;left&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;up&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;right&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;down&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;meta&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;focus&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;blur&lt;/code&gt; events.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;standard-library&quot;&gt;Standard Library&lt;/h4&gt;

&lt;p&gt;The first v0.3 preview revamped the function definition interface, but still had some limitations. Now you can create expressions with multiple outputs, so we are in a position to bring v0.3 back to parity with v0.2.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Add &lt;a href=&quot;https://github.com/witheve/Eve/pull/823/commits/58af002ec4c3807b0a91e3ee148e6f7a5359387a&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;string.codepoint_length(text:string)&lt;/code&gt;&lt;/a&gt; function.&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (March 2017) - v0.3 alpha pre-release</title>
   <link href="http://incidentalcomplexity.com/2017/04/06/march/"/>
   <updated>2017-04-06T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/04/06/march/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last month we updated you with some changes happening to the Eve runtime, including the addition of a Javascript DSL. Today we’re happy to announce a pre-release version of Eve v0.3 alpha. This “pre-release” is meant for members of the Eve community to preview the features of v0.3 before it’s ready for a broader audience (for example, docs, guides, and tools like the editor still need more work). We think you’ll appreciate some of the new features, so let’s take a look at what is new!&lt;/p&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;The big news today is that the runtime refactor we began earlier this year is capable of running full Eve programs. It still needs a lot of usability, documentation, and tooling work before it’s ready for an official release; nonetheless, this runtime already accomplishes many of the objectives identified earlier this year, like improving Eve’s extensibility. So we’re moving the runtime-refactor branch over to master, and making this version more accessible to the community. We’ll continue to work on this branch and release a more complete v0.3 later this year.&lt;/p&gt;

&lt;p&gt;To get the pre-release you have a couple of options:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Download the npm package with &lt;code class=&quot;highlighter-rouge&quot;&gt;npm install witheve@preview&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Clone the &lt;a href=&quot;https://github.com/witheve/eve-starter&quot;&gt;eve-starter repository&lt;/a&gt;:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone git@github.com:witheve/eve-starter.git
cd eve-starter
npm install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The eve-starter repository is new, and demonstrates how a project can use Eve as a dependency. Whereas the v0.2 example programs were bundled with the Eve runtime, these example programs have no special privilege. Feel free to use this as a starting point for your own Eve project.&lt;/p&gt;

&lt;p&gt;Here’s what’s new in the v0.3 pre-release.&lt;/p&gt;

&lt;h4 id=&quot;javascript-dsl&quot;&gt;Javascript DSL&lt;/h4&gt;

&lt;p&gt;We’ve talked a little about this before, but Eve now has a Javascript DSL. Right now, this is the only interface to the v0.3 runtime (the Eve syntax will be coming with the official release). The DSL has the same semantics as the Eve syntax, and even closely mirrors its form as well. Here is a translation guide between the Eve syntax and the DSL:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basics&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- find a record: find(&quot;person&quot;, {salary}) &amp;lt;-&amp;gt; search [#person salary]
- bind/commit:   return[record(&quot;person&quot;, {salary})] &amp;lt;-&amp;gt; bind [#person salary]
- functions:     lib.math.sin(number) &amp;lt;-&amp;gt; sin[degrees: number]
- aggregates:    gather(person).per(person.dept).count() &amp;lt;-&amp;gt; count[given: person, per: person.dept]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Sub-Blocks&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- not:    not(() =&amp;gt; person.salary) &amp;lt;-&amp;gt; not(person.salary)
- choose: choose(() =&amp;gt; { person.salary; return 1; }, () =&amp;gt; 0) &amp;lt;-&amp;gt; if person.salary then 1 else 0
- union:  union(() =&amp;gt; person.salary, () =&amp;gt; person.wage) &amp;lt;-&amp;gt; if person.salary then person.salary if person.wage then person.wage
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Update Operators&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;- Add a value:         person.add(&quot;salary&quot;, 10) &amp;lt;-&amp;gt; person.salary += 10
- Remove a value:      person.remove(&quot;salary, 10) &amp;lt;-&amp;gt; person.salary -= 10
- Set a value:         person.remove(&quot;salary&quot;).add(&quot;salary&quot;, 10) &amp;lt;-&amp;gt; person.salary := 10
- Remove an attribute: person.remove(&quot;salary&quot;) &amp;lt;-&amp;gt; person.salary := none
- Remove a record:     person.remove() &amp;lt;-&amp;gt; person := none
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Again, docs are sparse at the moment, but we’ve put together a &lt;a href=&quot;https://github.com/witheve/docs/blob/master/guides/dsl.md&quot;&gt;basic guide&lt;/a&gt; for the DSL, which should get you started.&lt;/p&gt;

&lt;h4 id=&quot;importingexporting-data&quot;&gt;Importing/Exporting Data&lt;/h4&gt;

&lt;p&gt;One of the most common requests after the v0.2 release of Eve was “How do I get my data into Eve?”. People wanted to use Eve to work with data they already had, but at the time Eve was intentionally siloed from the rest of the world. Now working with external data is much easier thanks to the DSL; if you can get your data into Javascript, you can get it into Eve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Importing Data into Eve&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Getting data into Eve is accomplished with the &lt;code class=&quot;highlighter-rouge&quot;&gt;inputEAVs()&lt;/code&gt; interface, which allows you to insert a raw entity, attribute, value triple into the Eve database. EAVs are the core dataype in Eve, and define everything from clicks to your application interface. Combined with the &lt;code class=&quot;highlighter-rouge&quot;&gt;appendAsEAVS()&lt;/code&gt; function, which turns an object into an array of EAVs, you can now turn regular Javascript objects into Eve records.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Exporting Data from Eve&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The opposite is true as well – you can turn Eve records into Javascript objects. This is accomplished through a watcher block. These operate as normal bind blocks, except they allow you to use a callback function to respond to changes in records (diffs). This allows you the opportunity to react to those changes using native Javascript functions and libraries. Here is an example watcher that calls out to a function external to Eve every time an &lt;code class=&quot;highlighter-rouge&quot;&gt;#email/send&lt;/code&gt; record is created.&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;watch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Send emails&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email/send&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;diff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;diff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;adds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sendAnEmail&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As part of our documentation efforts, we’re going to be posting a series of short, to-the-point examples demonstrating how to connect to common sources of data (csv, APIs maybe even a serial port), so users can get started working with their data. Please let us know on the &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/2TyfPDxcu08&quot;&gt;mailing list&lt;/a&gt; which data sources most interest you. Also, if you get any examples working yourself, be sure to let us know as well.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;h4 id=&quot;contributions&quot;&gt;Contributions&lt;/h4&gt;

&lt;p&gt;Thanks to everyone who contributed pull requests last month!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/wilk&quot;&gt;@wilk&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/shamrin&quot;&gt;@shamrin&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/christopherdumas&quot;&gt;@christopherdumas&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/thSoft&quot;&gt;@thSoft&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Berkeley, March 17&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Chris gave a talk at UC Berkeley’s &lt;a href=&quot;http://bid.berkeley.edu/&quot;&gt;BiD Lab&lt;/a&gt; about how programming language design could learn a thing or two from video games like Minecraft and Zelda: Breath of the Wild. Unfortunately, his talk wasn’t recorded, but we’ll release it in blog form later this month for anyone who couldn’t attend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, March 25&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Last month &lt;a href=&quot;https://twitter.com/anfedorov&quot;&gt;Andrey Fedorov&lt;/a&gt; of the &lt;a href=&quot;http://2020salon.blogspot.com/&quot;&gt;20/20 Salon&lt;/a&gt; was kind enough to invite me to their meetup to talk about and demo Eve. We had a great time talking about Loopy, AirTable, and various other projects related and not related to Eve. Hopefully we can do it again when we have more to show here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen, April 26&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Zubair Quraishi is again hosting an Eve meetup in Copenhagen, scheduled for April 26. You can view all the relevant details on the &lt;a href=&quot;https://www.meetup.com/evecph/events/238989298/&quot;&gt;meetup page&lt;/a&gt;, or join the &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/CXdWqgokhVI&quot;&gt;discussion&lt;/a&gt; on the mailing list.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco, May TBD&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We’re going to be holding our first official Eve meetup at the Eve office in downtown San Francisco in May. We don’t have any concrete details yet, but we wanted to let you know this is in the works. If you are interested in attending or have any ideas of what you’d like to learn, drop me a line via &lt;a href=&quot;mailto:corey@kodowa.com&quot;&gt;e-mail&lt;/a&gt; or &lt;a href=&quot;https://twitter.com/with_eve&quot;&gt;Twitter&lt;/a&gt;. We’ll let you know when plans are finalized.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Example 5 - Battle School</title>
   <link href="http://incidentalcomplexity.com/2017/03/21/5-battleschool/"/>
   <updated>2017-03-21T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/03/21/5-battleschool/</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/ex5.png&quot; alt=&quot;Example 5&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;what-is-this&quot;&gt;What is this?&lt;/h3&gt;

&lt;p&gt;This example demonstrates saving state across different pages, and advanced sorting using the &lt;code class=&quot;highlighter-rouge&quot;&gt;range[]&lt;/code&gt; function. On the “control” page, you can set a schedule of army matchups for the day. Click on an army and then click on the slot you want to place that army. This matchup is saved, and displayed on the “broadcast” page.&lt;/p&gt;

&lt;p&gt;You can play with this example in your browser &lt;a href=&quot;http://play.witheve.com/#gist:139ae7d8cff02032258ccdb87afbd01f-ex5-battleschool.eve&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;page-layout&quot;&gt;Page Layout&lt;/h3&gt;

&lt;h4 id=&quot;containers&quot;&gt;Containers&lt;/h4&gt;

&lt;p&gt;This one’s pretty simple; I want a nav bar at the top to let me manually go to the different pages, and an app window where those pages are rendered.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit @browser
  [#div class:&quot;nav-bar&quot;]
  [#div class:&quot;app-window&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;pages&quot;&gt;Pages&lt;/h4&gt;

&lt;p&gt;For every page I want, I make a record with an attribute of &lt;code class=&quot;highlighter-rouge&quot;&gt;target&lt;/code&gt; to specify which each page is called.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit
  [#page target:&quot;Broadcast&quot;]
  [#page target:&quot;Control&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;nav-bar-buttons&quot;&gt;Nav Bar Buttons&lt;/h4&gt;

&lt;p&gt;By abstracting this step out, I can define all the pages I want as in the block before, and then here find those pages and create a button on the nav bar for each of them.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  nav-bar = [#div class:&quot;nav-bar&quot;]
  [#page target]

bind @browser
  nav-bar &amp;lt;- [children: [#button target text:target]]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This partner block works with the nav buttons by simply setting the app window to whichever nav button is clicked.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser @event
  [#click element: [#button target]]
  window = [#app-window]

commit
  window.target := target
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;starting-page&quot;&gt;Starting Page&lt;/h4&gt;

&lt;p&gt;This commits a record called #&lt;code class=&quot;highlighter-rouge&quot;&gt;app-window&lt;/code&gt; whose attribute &lt;code class=&quot;highlighter-rouge&quot;&gt;target&lt;/code&gt; specifies which page gets rendered. In this case, when the app starts up, I want the landing view to be the Broadcast page.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit
  [#app-window target:&quot;Broadcast&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;sci-fi-font&quot;&gt;Sci-Fi Font&lt;/h4&gt;

&lt;p&gt;It’s not the future if there’s not futuristic-looking text.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit @browser
  [#link href:&quot;https://fonts.googleapis.com/css?family=Orbitron|Play&quot; rel:&quot;stylesheet&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;broadcast&quot;&gt;Broadcast&lt;/h3&gt;

&lt;h4 id=&quot;drawing-the-page&quot;&gt;Drawing the Page&lt;/h4&gt;

&lt;p&gt;The Broadcast page is meant to serve much like the departures or arrivals screen at an airport - it is purely an informative screen showing which armies have been scheduled in which rooms. There are 9 total battle rooms, so I use the &lt;code class=&quot;highlighter-rouge&quot;&gt;range&lt;/code&gt; function to generate 9 rooms, each of which has two sides labeled A and B. There’s also a #&lt;code class=&quot;highlighter-rouge&quot;&gt;versus&lt;/code&gt; block whose text will change based on whether or not there are armies scheduled to that room.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  [#app-window target:&quot;Broadcast&quot;]
  window = [#div class:&quot;app-window&quot;]
  i = range[from: 1, to: 9]

bind @browser
  window.class += &quot;broadcast&quot;
  window.children += [#div i class:&quot;battle-room&quot; children:
      [#div class:&quot;room-title&quot; text:&quot;&quot;]
      [#div class:&quot;matchup&quot; children:
        [#room class:&quot;teamA&quot; room:i side:&quot;A&quot;]
        [#versus room:i]
        [#room class:&quot;teamB&quot; room:i side:&quot;B&quot;]
      ]
    ]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;drawing-upcoming-battles&quot;&gt;Drawing Upcoming Battles&lt;/h4&gt;

&lt;p&gt;This block checks to see if there’s an army assigned to a room and will inject a card for that army into its room slot, but only if there’s another army that has been assigned to the opposing side in that room. Having only an A side or a B side will fail the search. If both sides are accounted for however, the search will pass for both of those armies, and so both cards will get injected.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  slot = [#room room side]
  army = [#army room side name color1 color2 color3 uniform]
  other-side = if side = &quot;A&quot; then &quot;B&quot;
               else if side = &quot;B&quot; then &quot;A&quot;
  [#army room side:other-side]
  versus = [#versus room]

bind @browser
  slot.class += (&quot;army-card&quot;)
  slot &amp;lt;- [#div name children:
    [#div class:&quot;army-name&quot; text:name]
    [#div class:&quot;ribbon&quot; children:
      [#div class:color1]
      [#div class:color2]
      [#div class:color3]]
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If a room has two armies assigned to it, one to each side, then the #&lt;code class=&quot;highlighter-rouge&quot;&gt;versus&lt;/code&gt; block becomes just the text “VS” between the two army cards.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  versus = [#versus room]
  [#army room side:&quot;A&quot;]
  [#army room side:&quot;B&quot;]

bind @browser
  versus &amp;lt;- [#div class:&quot;versus-text&quot; text:&quot;VS&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If a room is missing either an A or a B side, or both, I want a message to be displayed saying that a battle hasn’t been scheduled yet. Since this comprises a union in set theory, I need two blocks to explicity handle all my possibilities. This first one looks to see if both sides have yet to be assigned, and injects the message into the #&lt;code class=&quot;highlighter-rouge&quot;&gt;versus&lt;/code&gt; block if that happens to be the case.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  versus = [#versus room]
  not([#army room side:&quot;A&quot;])
  not([#army room side:&quot;B&quot;])

bind @browser
  versus &amp;lt;- [#div class:&quot;empty-room&quot; text:&quot;No battle scheduled&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This second block gives us the other half of the union by checking to see if either an A side or a B side has been assigned, but not its complement, and will inject the same message into the #&lt;code class=&quot;highlighter-rouge&quot;&gt;versus&lt;/code&gt; block.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  versus = [#versus room]
  army = [#army room side]
  other-side = if side = &quot;A&quot; then &quot;B&quot;
               else if side = &quot;B&quot; then &quot;A&quot;
  not([#army room side:other-side])

bind @browser
  versus &amp;lt;- [#div class:&quot;empty-room&quot; text:&quot;No battle scheduled&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;control&quot;&gt;Control&lt;/h3&gt;

&lt;h4 id=&quot;drawing-the-page-1&quot;&gt;Drawing the Page&lt;/h4&gt;

&lt;p&gt;The Control page is laid out to be displayed on a smaller device - perhaps a smart phone or a tablet - and is used to assign which armies will fight in which rooms. Again, for the nine rooms, the range function is used to identify and number them, and each room is given two sides. A list of all the available armies - that is, those which have not been assigned to a room - is also drawn.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  [#app-window target:&quot;Control&quot;]
  [#army name color1 color2 color3 uniform not(room)]
  i = range[from: 1, to: 9]
  window = [#div class:&quot;app-window&quot;]

bind @browser
  window.class += &quot;control&quot;
  window.children += ([#img class:&quot;logo&quot; src:&quot;http://vignette2.wikia.nocookie.net/ansible/images/6/69/InternationalFleetLogo.png&quot;],
    [#div class:&quot;control-lists&quot; children:
    [#div class:&quot;all-rooms&quot; children:
      [#div class:&quot;room&quot; i children:
        [#div class:&quot;title&quot; text:&quot;Battle Room &quot;]
        [#div room:i side:&quot;A&quot; class:&quot;battle-slot&quot;]
        [#div class:&quot;vs-line&quot; text:&quot;vs&quot;]
        [#div room:i side:&quot;B&quot; class:&quot;battle-slot&quot;]
      ]
    ],
    [#div class:&quot;all-armies&quot; children:
      [#div class:&quot;title&quot; text:&quot;Armies&quot;]
      [#div sort:name name class:(&quot;army-tab&quot;, uniform) text:name]
    ]
    ])
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As an addition to main drawing block for the Control page, this block checks to see if there are any armies assigned to a slot in a battle room. If it is, that army has its tab drawn in the corresponding slot in the browser.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  window = [#div class:&quot;battle-slot&quot; room side]
  [#army name uniform room side]

bind @browser
  window.children += [#div class:(&quot;army-tab&quot;, uniform) text:name]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;selecting&quot;&gt;Selecting&lt;/h4&gt;

&lt;p&gt;In order to be able to assign armies to slots, there needs to be a mechanism to select both elements. I’ve chosen to demonstrate selection in two different ways to cover some of the possibilities of how this might be achieved, and because armies each have a record stored in the session database, I used them to show selection by modifying a session record. The intended workflow here is to click an army to highlight it, then choose a slot to assign them to, or go the other way around and click a battle slot to highlight it, then choose an army to assign there. That means I only want to highlight an element if there’s nothing else already selected - otherwise, I’m probably trying to assign an army. This block searches for a click on an army tab and, as long as that army isn’t already highlighted, nor any battle slots, adds the #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt; tag to the record of the clicked army.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  [#click element: [#div class:&quot;army-tab&quot; name]]
  army = [#army name not(#highlighted)]
  not([#div #highlighted class:&quot;battle-slot&quot; room])

commit
  army += #highlighted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This block adds the #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt; tag to a record in browser instead of session. If a battle slot gets clicked and isn’t already highlighted and doesn’t have an army already assigned to it, then that battle slot becomes highlighted.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  battle-slot = [#div class:&quot;battle-slot&quot; room side]
  [#click element: battle-slot]
  not([#div #highlighted class:&quot;battle-slot&quot; room side])
  not([#click element:[#div class:&quot;army-tab&quot;]])
  not([#army #highlighted])

commit @browser
  battle-slot += #highlighted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;assigning&quot;&gt;Assigning&lt;/h4&gt;

&lt;p&gt;Once an army is #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt;, if a battle slot gets clicked, the highlighted army gets assigned to that particular slot, which corresponds to both a &lt;code class=&quot;highlighter-rouge&quot;&gt;room&lt;/code&gt; and a &lt;code class=&quot;highlighter-rouge&quot;&gt;side&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  army = [#army #highlighted]
  [#click element: [#div class:&quot;battle-slot&quot; room side]]

commit
  army.room := room
  army.side := side
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;On the flip side, if a battle slot is #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt; and an army gets clicked, the clicked army gets assigned to the highlighted slot.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  [#div #highlighted class:&quot;battle-slot&quot; room side]
  army = [#army name]
  [#click element: [#div class:&quot;army-tab&quot; name]]

commit
  army.room := room
  army.side := side
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;unselecting&quot;&gt;Unselecting&lt;/h4&gt;

&lt;p&gt;A click anywhere deselects anything. This works if you’re just clicking around the page and want to deselect something, or if you click to assign an army somewhere. The assigning workflow still occurs, but the final click deselects everything so that no residual highlights are left over.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  [#click]
  highlighted = [#highlighted]

commit @session @browser
  highlighted -= #highlighted
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;unassigning&quot;&gt;Unassigning&lt;/h4&gt;

&lt;p&gt;If there’s an army in a slot that’s clicked, this block removes that army from that slot.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @event @browser
  [#click element: [#div class:&quot;battle-slot&quot; room side]]
  in-slot = [#army room side]

commit
  in-slot.room := none
  in-slot.side := none
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;highlight-styling&quot;&gt;Highlight Styling&lt;/h4&gt;

&lt;p&gt;When either an army or a battle slot is #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt;, I want to add a class to it so I can use CSS to add a visual marker to it. Because I add the #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt; tag to armies and battle slots differently, I need two different blocks to handle those classes. In the case of a highlighted army, the army is highlighted but its corresponding army tab gets the new class apended.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  army-tab = [#div class:&quot;army-tab&quot; name]
  army = [#army #highlighted name]

bind @browser
  army-tab.class += &quot;highlighted&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the case of a highlighted battle slot, the #&lt;code class=&quot;highlighter-rouge&quot;&gt;highlighted&lt;/code&gt; tag is already on the #&lt;code class=&quot;highlighter-rouge&quot;&gt;div&lt;/code&gt; that needs the new class, which gets apended with this block.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @session @browser
  battle-slot = [#highlighted class:&quot;battle-slot&quot; room]

bind @browser
  battle-slot.class += &quot;highlighted&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;army-data&quot;&gt;Army Data&lt;/h3&gt;

&lt;p&gt;Each army is listed here with its name, its three colors, and a uniform color.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit
  [#army name:&quot;Manticore&quot; color1:&quot;gray&quot; color2:&quot;yellow&quot; color3:&quot;green&quot; uniform:&quot;yellow&quot;]
  [#army name:&quot;Asp&quot; color1:&quot;lightgreen&quot; color2:&quot;blue&quot; color3:&quot;green&quot; uniform:&quot;green&quot;]
  [#army name:&quot;Scorpion&quot; color1:&quot;purple&quot; color2:&quot;orange&quot; color3:&quot;red&quot; uniform:&quot;orange&quot;]
  [#army name:&quot;Flame&quot; color1:&quot;red&quot; color2:&quot;yellow&quot; color3:&quot;red&quot;  uniform:&quot;red&quot;]
  [#army name:&quot;Tide&quot; color1:&quot;blue&quot; color2:&quot;lightblue&quot; color3:&quot;blue&quot; uniform:&quot;lightblue&quot;]
  [#army name:&quot;Salamander&quot; color1:&quot;green&quot; color2:&quot;lightgreen&quot; color3:&quot;brown&quot; uniform:&quot;lightgreen&quot;]
  [#army name:&quot;Rat&quot; color1:&quot;black&quot; color2:&quot;brown&quot; color3:&quot;black&quot; uniform:&quot;brown&quot;]
  [#army name:&quot;Hound&quot; color1:&quot;blue&quot; color2:&quot;brown&quot; color3:&quot;purple&quot; uniform:&quot;brown&quot;]
  [#army name:&quot;Condor&quot; color1:&quot;black&quot; color2:&quot;white&quot; color3:&quot;black&quot; uniform:&quot;gray&quot;]
  [#army name:&quot;Squirrel&quot; color1:&quot;green&quot; color2:&quot;gray&quot; color3:&quot;blue&quot; uniform:&quot;gray&quot;]
  [#army name:&quot;Rabbit&quot; color1:&quot;white&quot; color2:&quot;gray&quot; color3:&quot;red&quot; uniform:&quot;red&quot;]
  [#army name:&quot;Leopard&quot; color1:&quot;orange&quot; color2:&quot;brown&quot; color3:&quot;orange&quot; uniform:&quot;brown&quot;]
  [#army name:&quot;Centipede&quot; color1:&quot;orange&quot; color2:&quot;blue&quot; color3:&quot;red&quot; uniform:&quot;blue&quot;]
  [#army name:&quot;Phoenix&quot; color1:&quot;yellow&quot; color2:&quot;orange&quot; color3:&quot;red&quot; uniform:&quot;yellow&quot;]
  [#army name:&quot;Dragon&quot; color1:&quot;gray&quot; color2:&quot;orange&quot; color3:&quot;gray&quot; uniform:&quot;orange&quot;]
  [#army name:&quot;Ferret&quot; color1:&quot;white&quot; color2:&quot;lightblue&quot; color3:&quot;black&quot; uniform:&quot;lightblue&quot;]
  [#army name:&quot;Badger&quot; color1:&quot;red&quot; color2:&quot;white&quot; color3:&quot;black&quot; uniform:&quot;red&quot;]
  [#army name:&quot;Griffin&quot; color1:&quot;yellow&quot; color2:&quot;brown&quot; color3:&quot;purple&quot; uniform:&quot;purple&quot;]
  [#army name:&quot;Tiger&quot; color1:&quot;orange&quot; color2:&quot;black&quot; color3:&quot;white&quot; uniform:&quot;orange&quot;]
  [#army name:&quot;Spider&quot; color1:&quot;green&quot; color2:&quot;black&quot; color3:&quot;purple&quot; uniform:&quot;purple&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;styles&quot;&gt;Styles&lt;/h3&gt;

&lt;p&gt;There’s a lot of CSS this time around because of a greater need for media queries on this example, so it’s been split up into the style sheets for each page&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;good&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;time,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;leave&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;here&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;broadcast-page&quot;&gt;Broadcast Page&lt;/h4&gt;
&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
&lt;span class=&quot;nc&quot;&gt;.program&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.broadcast&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#333&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;py&quot;&gt;user-select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;Play&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;justify-content&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room-title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#316282&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.matchup&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;Play&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;skew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-20deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#777&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.empty-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#222&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#222&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;skew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;20deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;box-sizing&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;border-box&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#222&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.red&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#EE0034&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.orange&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#FF7900&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.yellow&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#FCCC0A&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.green&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#00933C&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lightgreen&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#6CBE45&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.blue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#0039A6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lightblue&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#00A1DE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.purple&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#A626AA&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.black&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#000000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.white&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#ffffff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;black&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.gray&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#A7A9AC&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.brown&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#996633&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1279px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.broadcast&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;250px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;220px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#999&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;67px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room-title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.matchup&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;130px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.versus-text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.empty-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1280px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1499px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.broadcast&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;550px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;55px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room-title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;28px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.versus-text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.empty-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamA&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1500px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;and&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1679px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.broadcast&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;750px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room-title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;48px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;48px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;280px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.versus-text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.empty-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;22px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;90px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamA&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1680px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.broadcast&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;960px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;120px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room-title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;60px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#316282&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;320px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;Play&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;skew&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-20deg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#777&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.versus-text&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.empty-room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamA&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.teamB&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;


&lt;span class=&quot;nc&quot;&gt;.army-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ribbon&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;control-page&quot;&gt;Control Page&lt;/h4&gt;
&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.control&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#333&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;450px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;py&quot;&gt;user-select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.logo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;25px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.control-lists&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;400&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;Play&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;-10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.all-rooms&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-slot&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;26px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;162px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.vs-line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.all-armies&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-tab&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;160px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;4px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;Play&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;sans-serif&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.highlighted&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;box-shadow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#bbb&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-slot.highlighted&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#bbc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1279px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.battle-slot&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;22px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;82px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.logo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.title&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;70px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.control&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.control-lists&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.all-rooms&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.room&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.vs-line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.all-armies&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.army-tab&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Example 4 - Futurama</title>
   <link href="http://incidentalcomplexity.com/2017/03/14/4-futurama/"/>
   <updated>2017-03-14T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2017/03/14/4-futurama/</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/ex4.png&quot; alt=&quot;Example 3&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;what-is-this&quot;&gt;What is this?&lt;/h3&gt;

&lt;p&gt;This example demonstrates how to capture input from forms and create and explore records from that. It should also provide a look at some of the particular complications and pitfalls in dealing with forms. In the future it’ll most likely be useful to address a more complicated version of forms, but for now this is a good starting point to develop an intuition of the concepts. If anything seems oversimplified or susceptible to edge cases and user error, it’s most likely from the effort to avoid bugs and overly complicated layouts.&lt;/p&gt;

&lt;p&gt;You can play with this example in your browser &lt;a href=&quot;http://play.witheve.com/#gist:39cddae05752e66d88534454fd7fc0a3-ex4-futurama.eve&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;page-layout&quot;&gt;Page Layout&lt;/h3&gt;

&lt;h4 id=&quot;containers&quot;&gt;Containers&lt;/h4&gt;

&lt;p&gt;This one’s pretty simple; I want a nav bar at the top to let me manually go to the different pages, and an app window where those pages are rendered.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit @browser
  [#div class:&quot;nav-bar&quot;]
  [#div class:&quot;app-window&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;pages&quot;&gt;Pages&lt;/h4&gt;

&lt;p&gt;For every page I want, I make a record with an attribute of &lt;code class=&quot;highlighter-rouge&quot;&gt;target&lt;/code&gt; to specify which each page is called.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#page target:&quot;Start&quot;]
  [#page target:&quot;Register&quot;]
  [#page target:&quot;Summary&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;nav-bar-buttons&quot;&gt;Nav Bar Buttons&lt;/h4&gt;

&lt;p&gt;By abstracting this step out, I can define all the pages I want as in the block before, and then here find those pages and create a button on the nav bar for each of them.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  nav-bar = [#div class:&quot;nav-bar&quot;]
  [#page target]

bind @browser
  nav-bar &amp;lt;- [children: [#button target text:target]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This partner block works with the nav buttons by simply setting the app window to whichever nav button is clicked.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser @event
  [#click element: [#button target]]
  window = [#app-window]

commit
  window.target := target
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;starting-page&quot;&gt;Starting Page&lt;/h4&gt;

&lt;p&gt;This commits a record called &lt;code class=&quot;highlighter-rouge&quot;&gt;#app-window&lt;/code&gt; whose attribute &lt;code class=&quot;highlighter-rouge&quot;&gt;target&lt;/code&gt; specifies which page gets rendered. In this case, when the app starts up, I want the landing view to be the Start page.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#app-window target: &quot;Start&quot;]

&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;start-page&quot;&gt;Start Page&lt;/h3&gt;

&lt;p&gt;The starting page isn’t very complicated - it contains a thank you message for the civically engaged Earthicans, the flag of Earth, a button to start a new registration for another voter, and a subtle sponsorship message.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app-window target:&quot;Start&quot;]
  window = [#div class:&quot;app-window&quot;]

bind @browser
  window.class += &quot;home-screen&quot;
  window &amp;lt;- [children:
    [#div class:&quot;thank-you&quot; text:&quot;Thank you for registering to vote!&quot;]
    [#img class:&quot;old-freebie&quot; src:&quot;https://upload.wikimedia.org/wikipedia/commons/thumb/3/3a/Futurama_flag_of_Earth.svg/720px-Futurama_flag_of_Earth.svg.png&quot;]
    [#button target:&quot;Register&quot; class:&quot;begin-btn&quot; text:&quot;Begin a new registration&quot;]
    [#div class:&quot;sponsor&quot; text:&quot;This election sponsored with love by MomCorp&quot;]
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;voter-registration-page&quot;&gt;Voter Registration Page&lt;/h3&gt;

&lt;p&gt;The voter registration page starts with questions that determine the eligibility of a registrant to complete the form. A voter must be both a citizen, and not convicted of a felony. This block sets up the form, and posses those two questions.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app-window target:&quot;Register&quot;]
  window = [#div class:&quot;app-window&quot;]

bind @browser
  window.class += &quot;voter-registration&quot;
  window &amp;lt;- [children: 
  [#form name: &quot;Voter Registration&quot; sections: 
  
    [#section sort: 1 name: &quot;Qualifications&quot; fields: 
      [#field #required sort: 1 type: &quot;radio&quot; label: &quot;Are you a citizen?&quot; field: &quot;citizenship&quot; options:   
        [label: &quot;Yes&quot;]
        [label: &quot;No&quot;]]
      [#field #required sort: 2 type: &quot;radio&quot; label: &quot;Have you been convicted of a felony?&quot; field: &quot;felony&quot; options: 
        [label: &quot;Yes&quot;]
        [label: &quot;No&quot;]]]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If either of the qualifications are not met in the submission, then a message is displayed informing the registrant. We can access the from submission through a &lt;code class=&quot;highlighter-rouge&quot;&gt;#submission&lt;/code&gt; record. The attributes of the submission map to the field attribute in each of the &lt;code class=&quot;highlighter-rouge&quot;&gt;#field&lt;/code&gt; records of the form. Form submissions can be either &lt;code class=&quot;highlighter-rouge&quot;&gt;#valid&lt;/code&gt;, meaning the submission contains all of the required fields; or &lt;code class=&quot;highlighter-rouge&quot;&gt;#invalid&lt;/code&gt;, meaning the submission is missing some of the required fields. This gives you flexibility on how to handle form submissions.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  [#submission #valid form citizenship felony]
  form = [#form name: &quot;Voter Registration&quot;]
  not(form = [#qualified])
  
  disqualified = if citizenship != &quot;Yes&quot; then &quot;disqualified&quot;
                 else if felony != &quot;No&quot; then &quot;disqualified&quot;

  form-message = [#form-message form]
  
bind @browser
  form-message.children += [#div class: &quot;error-message&quot; text: &quot;Sorry, you are not qualified to register to vote&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The form is &lt;code class=&quot;highlighter-rouge&quot;&gt;#qualified&lt;/code&gt; if the qualifications are met.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  [#submission #valid form citizenship: &quot;Yes&quot; felony: &quot;No&quot;]
  form = [#form name: &quot;Voter Registration&quot;]

bind @browser
  form += #qualified
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When the registrant is deemed qualified, the rest of the voter registration form is revealed. This is done by attaching additional sections to the already exiting form, defined above.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app-window target: &quot;Register&quot;]
  window = [#div class:&quot;app-window&quot;]
  [#party party-name priority]
  [#gender gender-name order]
  registration-form = [#form #qualified name: &quot;Voter Registration&quot;]
  
bind @browser
  registration-form.sections += (
  [#section sort: 2 name: &quot;Personal Information&quot; fields:
    [#field #required sort: 1 type: &quot;input&quot; label: &quot;First Name&quot; field: &quot;first-name&quot;]
    [#field sort: 2 type: &quot;input&quot; label: &quot;Middle Name&quot; field: &quot;middle-name&quot;]
    [#field #required sort: 3 type: &quot;input&quot; label: &quot;Last Name&quot; field: &quot;last-name&quot;]
    [#field #required sort: 4 type: &quot;input&quot; label: &quot;Birthday&quot; field: &quot;birthday&quot; placeholder:&quot;MM-DD-YYYY&quot;]
    [#field #required sort: 5 type: &quot;radio&quot; label: &quot;Gender&quot; field: &quot;gender&quot; options: 
      [label: gender-name]]
    [#field sort: 6 type: &quot;input&quot; label:&quot;Phone Number&quot; field: &quot;phone&quot; placeholder:&quot;XXX-XXX-XXXX&quot;]
    [#field #required sort: 7 type: &quot;input&quot; label:&quot;Last 4 Digits of SSN&quot; field: &quot;ssn&quot; placeholder:&quot;XXXX&quot;]
  ]
  
  [#section sort: 3 name: &quot;Address&quot; fields: 
    [#field #required sort: 1 type: &quot;input&quot; label: &quot;Address Line 1&quot; field: &quot;address1&quot;]
    [#field sort: 2 type: &quot;input&quot; label: &quot;Address Line 2&quot; field: &quot;address2&quot;]
    [#field #required sort: 3 type: &quot;input&quot; label: &quot;City&quot; field: &quot;city&quot;]
    [#field #required sort: 4 type: &quot;input&quot; label: &quot;State&quot; field: &quot;state&quot;]
    [#field #required sort: 5 type: &quot;input&quot; label: &quot;Zip&quot; field: &quot;zip&quot;]
  ]

  [#section sort: 4 name: &quot;Political Affiliation&quot; fields: 
    [#field #required sort: 1 type: &quot;radio&quot; label: &quot;Of which party are you a member?&quot; field: &quot;party&quot; options:
    [label: party-name]]])
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This listens for a new submission on the registration form, and creates a new #voter record with the submitted information.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  form = [#form #qualified]
  submission = [#valid form first-name middle-name last-name birthday gender phone ssn address1 address2 city state zip party]
  window = [#app-window]

// Reset the form for a new submission
commit @browser
  form -= #qualified
  form += #reset

// Save the submission as a new voter record, and change the page to a submission summary page
commit @session
  window.target := &quot;Submission&quot;
  window.voter := voter
  voter = [#voter first-name middle-name last-name birthday ssn phone gender party address: [address1 address2 city state zip]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The registration summary page displays the voter’s new voter card, as and contains a button that redirects back to the starting page.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app-window target: &quot;Submission&quot; voter]
  window = [#div class: &quot;app-window&quot;]
  
bind @browser
  window.children += [#div children:
    [#h1 text: &quot;Registration Summary&quot;]
    [#voter-card voter]
    [#button target: &quot;Start&quot; class: &quot;submit-btn&quot; text: &quot;Finish&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;gender-options&quot;&gt;Gender options&lt;/h4&gt;

&lt;p&gt;Technically this question susses out both one’s gender and organic life versus robot status, and the end result is the need for a list of genders rather than a binary option. Instead of adding these manually in the voter registration page layout, I’ve made a list here, open to any additional genders that need to be added. Any gender on this list will get added to the voter registration page, which gets sorted by the &lt;code class=&quot;highlighter-rouge&quot;&gt;order&lt;/code&gt; attribute.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#gender gender-name:&quot;Male&quot; order:1]
  [#gender gender-name:&quot;Female&quot; order:2]
  [#gender gender-name:&quot;Manbot&quot; order:3]
  [#gender gender-name:&quot;Fembot&quot; order:4]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;political-party-options&quot;&gt;Political Party Options&lt;/h4&gt;

&lt;p&gt;While the Tastycrats and Fingerlicans are the primary parties, there are many third parties to choose from, and they all get listed here. Again, this makes it easy to add or remove political parties without having to mess around with the voter registration page.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#party party-name:&quot;Tastycrat Party&quot; priority:1]
  [#party party-name:&quot;Fingerlican Party&quot; priority:2]
  [#party party-name:&quot;One Cell, One Vote&quot; priority:3]
  [#party party-name:&quot;Green Party&quot; priority:4]
  [#party party-name:&quot;Brain Slug Party&quot; priority:5]
  [#party party-name:&quot;Dudes for the Legalization of Hemp&quot; priority:6]
  [#party party-name:&quot;Bull Space Moose Party&quot; priority:7]
  [#party party-name:&quot;National Ray-Gun Association&quot; priority:8]
  [#party party-name:&quot;People for the Ethical Treatment of Humans&quot; priority:9]
  [#party party-name:&quot;Voter Apathy Party&quot; priority:10]
  [#party party-name:&quot;Rainbow Whigs&quot; priority:11]
  [#party party-name:&quot;Antisocialists&quot; priority:12]
  [#party party-name:&quot;Reform Party&quot; priority:13]
  [#party party-name:&quot;No Party&quot; priority:14]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;summary-page&quot;&gt;Summary Page&lt;/h4&gt;

&lt;p&gt;This page gives an administrator an overview of all the Earthicans who have registered to vote, and drawing the contents is actually pretty easy. All we need is a &lt;code class=&quot;highlighter-rouge&quot;&gt;#voter-card&lt;/code&gt; for each &lt;code class=&quot;highlighter-rouge&quot;&gt;#voter&lt;/code&gt; record. The layout for what the &lt;code class=&quot;highlighter-rouge&quot;&gt;#voter-card&lt;/code&gt; looks like gets handled in the next block, and the brunt of the work for this section is actually the styling.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app-window target:&quot;Summary&quot;]
  window = [#div class:&quot;app-window&quot;]
  voter = [#voter]  
  
bind @browser
  window.children += [#voter-card voter]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;voter-cards&quot;&gt;Voter Cards&lt;/h4&gt;

&lt;p&gt;Each voter gets a &lt;code class=&quot;highlighter-rouge&quot;&gt;#voter-card&lt;/code&gt; in the browser, which displays the voter’s information.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  voter-card = [#voter-card voter]
  voter = [#voter first-name last-name birthday gender ssn party address]
  phone = if voter.phone then &quot;Phone: &quot; else &quot;&quot;
  address2 = if address.address2 then &quot;  &quot; else &quot; &quot;
  middle-name = if voter.middle-name then &quot;  &quot; else &quot; &quot;

bind @browser
  voter-card &amp;lt;- [#div class:&quot;voter-card&quot; children:
    [#div class:&quot;voter-name&quot; text: &quot;&quot;]
    [#div class:&quot;birth-info&quot; children:
      [#div class:&quot;voter-address&quot; text: &quot;  &quot;]
      [#div class:&quot;voter-birth&quot; text:&quot;Born: &quot;]
      [#div class:&quot;voter-sex&quot; text:&quot;Gender: &quot;]
      [#div class:&quot;voter-phone&quot; text:phone]
      [#div class:&quot;voter-ssn&quot; text:&quot;SSN: XXX-XX-&quot;]]
    [#div class:&quot;voter-party&quot; text:&quot;Affiliation: &quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;appendix&quot;&gt;Appendix&lt;/h3&gt;

&lt;h4 id=&quot;sample-data&quot;&gt;Sample Data&lt;/h4&gt;

&lt;p&gt;Here’s a few sample registered voters to help populate the Summary page.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#voter
   first-name: &quot;Philip&quot;
   middle-name: &quot;J.&quot;
   last-name: &quot;Fry&quot;
   birthday: &quot;08-14-1974&quot;
   gender: &quot;male&quot;
   ssn: &quot;0810&quot;
   party: &quot;Voter Apathy Party&quot;
   address: [address1: &quot;620 W 42nd St&quot; address2: &quot;Apt 00100100&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10036&quot;]]
  
  [#voter
    first-name: &quot;Hubert&quot;
    middle-name: &quot;J.&quot;
    last-name: &quot;Farnsworth&quot;
    birthday: &quot;04-09-2841&quot;
    gender: &quot;male&quot;
    phone: &quot;04-09-2841&quot;
    ssn: &quot;2458&quot;
    party: &quot;National Ray-Gun Association&quot;
    address: [address1: &quot;650 W 57th S.&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10036&quot;]]

  [#voter
    first-name: &quot;Turanga&quot; 
    last-name: &quot;Leela&quot;
    birthday: &quot;07-29-2975&quot;
    gender: &quot;Female&quot;
    phone: &quot;212-307-7760&quot;
    ssn: &quot;3001&quot;
    party: &quot;No party&quot;
    address: [address1: &quot;715 9th Ave&quot; address2: &quot;Apt 1I&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10036&quot;]]

  [#voter 
    first-name: &quot;Bender&quot;
    middle-name: &quot;Bending&quot;
    last-name: &quot;Rodriguez&quot;
    birthday: &quot;01-02-2996&quot;
    gender: &quot;Manbot&quot;
    party: &quot;No party&quot;
    ssn: &quot;BU22&quot;
    address: [address1: &quot;620 W 42nd St&quot; address2: &quot;Apt 00100100&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10036&quot;]]

  [#voter
    first-name: &quot;John&quot;
    middle-name: &quot;A.&quot;
    last-name: &quot;Zoidberg&quot;
    birthday: &quot;05-05-2914&quot;
    gender: &quot;Male&quot;
    ssn: &quot;DXC7&quot;
    party: &quot;People for the Ethical Treatment of Humans&quot;
    address: [address1: &quot;The dumpster behind 650 W 57th St&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10036&quot;]]
    
  [#voter
    first-name: &quot;Hermes&quot; 
    last-name: &quot;Conrad&quot;
    birthday: &quot;07-15-2959&quot;
    gender: &quot;Male&quot;
    ssn: &quot;6789&quot;
    party: &quot;Brain Slug Party&quot;
    address: [address1: &quot;105 Duane St&quot; address2: &quot;Apt 3007&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10007&quot;]]

  [#voter 
    first-name: &quot;Amy&quot;
    last-name: &quot;Wong&quot;
    birthday: &quot;05-04-2978&quot;
    gender: &quot;Female&quot;
    phone: &quot;212-995-8833&quot;
    ssn: &quot;5523&quot;
    party: &quot;Dudes for the Legalization of Hemp&quot;
    address: [address1: &quot;10 West St.&quot; city: &quot;New New York&quot; state: &quot;NY&quot; zip: &quot;10007&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;a-custom-form-element&quot;&gt;A Custom Form Element&lt;/h4&gt;

&lt;p&gt;Forms have a title and one or more sections. Each section has an optional name, and contains one or more fields. Each field additionally has the input type of that field (input, radio button, drop down list, etc.).&lt;/p&gt;

&lt;p&gt;A form starts as a &lt;code class=&quot;highlighter-rouge&quot;&gt;#form&lt;/code&gt; record.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form += #div
  form.sort := 0
  form.class := &quot;form&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display the form name&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form.children += [#div children:
    [#h1 class: &quot;form-name&quot; sort: 0 text: form.name]
    [#div #form-message form sort: 1 class: &quot;form-message&quot;]]

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display each section. To properly display sections, we need to add them to the children of the form.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form sections]
    
bind @browser
  form.children += [#div form section: sections class: &quot;form-section&quot; sort: sections.sort]
  sections.form := form
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If the section has a name, display it&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  section-display = [#div section]
  
bind @browser
  section-display.children += [#h2 class: &quot;section-name&quot; text: section.name, sort: 0]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display the fields in each section. As we did with sections, to display fields we need to move them over to the children of the section display.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  section-display = [#div section]
  field = section.fields
  
bind @browser
  field.form := section.form
  section-display.children += 
    [#div #field field sort: field.sort form: section.form sort: 1]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display a submit button at the end of the form&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form.children += [#button #submit form sort: 100 text: &quot;Submit&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Handle form submission&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the submit button is clicked, the form enters a #validating stage, where all form data are collected and compared against the field specifications. If any field does not match, then the submission is tagged #invalid and those fields are called out to the user to correct.&lt;/p&gt;

&lt;p&gt;If all fields are valid, then the submission is marked #valid and the data are stored in a new &lt;code class=&quot;highlighter-rouge&quot;&gt;#submission&lt;/code&gt; record stamped with the submission time.&lt;/p&gt;

&lt;p&gt;We start by saving the data in the submission record, and mark the submission as &lt;code class=&quot;highlighter-rouge&quot;&gt;#validating&lt;/code&gt;. Validation is covered in the next section.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @event @browser @session
  [#click element: [#submit form]]
  [#field form field]
  [#time timestamp: time]
  
  value = if field.value then field.value
          else &quot;&quot;
  
commit @browser
  submission = [#submission #validating form time]
  lookup[record: submission, attribute: field.field value]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Handle form validation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If a field is &lt;code class=&quot;highlighter-rouge&quot;&gt;#required&lt;/code&gt; and a submission&lt;code class=&quot;highlighter-rouge&quot;&gt; is &lt;/code&gt;#validating&lt;code class=&quot;highlighter-rouge&quot;&gt;, then we check that the field is actually filled. If any required fields are not filled, then we mark the submission as &lt;/code&gt;#invalid`.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  submission = [#submission #validating form]
  field = [#field #required form not(value)]
  
commit @browser
  submission -= #validating
  submission += #invalid
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Give invalid fields a custom class. Also display a message at the top if any fields are required but missing. The bind here allows the form to be corrected dynamically, unmarking previously invalid fields as soon as they are filled.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  [#submission #invalid form]
  field = [#field #required form not(value)]
  field-label = [#h3 field]
  form-message = [#form-message form]
  
bind @browser
  field-label.class += &quot;required-field&quot;
  form-message.children += [#div class: &quot;error-message&quot; text: &quot;Please fill out all required fields&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If all required fields are valid, then the submission is marked &lt;code class=&quot;highlighter-rouge&quot;&gt;#valid&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  submission = [#submission #validating form]
  not([#field #required form not(value)])

commit @browser
  submission -= #validating
  submission += #valid
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Reset the form&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Resetting currently has a bug that affects multiple form submissions in succession.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form #reset]
  submission = [#submission form]

commit @browser
  form -= #reset
  submission := none
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Custom Input Types&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Custom input types are implemented by taking the value of the input (whatever that may be) and assigning it to the value attribute of its corresponding &lt;code class=&quot;highlighter-rouge&quot;&gt;#field&lt;/code&gt; record. For example, the value of a text field is just &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt;. However, the value of a radio field is the &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; of the option that is checked, so some additional logic needs to be in place to work with these various components. However, the interface to access these data from Eve is to uniformly look at the &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; on the &lt;code class=&quot;highlighter-rouge&quot;&gt;#field&lt;/code&gt;. In this example, we implement both the radio and the input fields, but more can be implemented in this way.&lt;/p&gt;

&lt;p&gt;Render radio buttons&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  field-display = [#div #field field form]
  field.type = &quot;radio&quot;

bind @browser
  field-display.children += [#div #radio field children: 
    [#h3 field text: field.label]
    [#div option: field.options children: 
      [#div class: &quot;radio-label&quot; text: field.options.label]
      [#input class: &quot;radio-button&quot; field form type: &quot;radio&quot; name: field.field value: field.options.label]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Save radio value in its respective &lt;code class=&quot;highlighter-rouge&quot;&gt;#field&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  radio = [#input type: &quot;radio&quot; checked: true field value]
  field = [#field]
  
bind @browser
  field.value := value

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Render input fields&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  field-display = [#div #field field form]
  field.type = &quot;input&quot;
  placeholder = if field.placeholder then field.placeholder
                else &quot;&quot;

bind @browser
  field-display.children += [#div children: 
    [#h3 field text: field.label]
    [#input class: &quot;text-input&quot; type: &quot;input&quot; form field name: field.field placeholder]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Save input value to respective &lt;code class=&quot;highlighter-rouge&quot;&gt;#field&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;
search @browser @session
  input = [#input type: &quot;input&quot; field value]
  field = [#field]
  
bind @browser
  field.value := value
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Render password fields&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  password = [#password]
  
bind @browser
  password += #input
  password.type := &quot;password&quot;
  password.class := &quot;password&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Render custom button styles&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  button = [#button form]
  
bind @browser
  button.class += &quot;submit-btn&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;styles&quot;&gt;Styles&lt;/h4&gt;

&lt;p&gt;This app needs a good amount of CSS to style the layout of the registration form and the voter cards.&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;good&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;time,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;leave&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;here&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.radio-label&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;float&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;13px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.radio-button&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.text-input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;350px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.error-message&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; 	&lt;span class=&quot;m&quot;&gt;#FA8072&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.required-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;red&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;@font-face&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;futurama&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(&quot;https://witheve.github.io/assets/fonts/fr-bold.ttf&quot;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;format&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;&quot;truetype&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.nav-bar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;44px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.nav-bar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.app-window.home-screen&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;radial-gradient&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;circle&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;at&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#5ef5fc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#0b527a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;#012535&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1000px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.thank-you&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;&quot;futurama&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;48px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.begin-btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5vh&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.sponsor&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/sWkxxNU.png)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;60px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bottom&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.app-window&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#0b527a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#0b527a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.name-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.address-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;500px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.radio-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.gender-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.gender-field&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-card&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.submit-btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;60px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;60px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;white&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#0b527a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-address&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.birth-info&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.birth-info&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;2275px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.nav-bar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.nav-bar&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;button&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.app-window.home-screen&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;550px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.thank-you&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;26px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.old-freebie&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;80%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.begin-btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.sponsor&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;70px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.app-window&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; 
  
&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;192px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;   

&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.radio-field&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;  
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.name-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.birth-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.phone-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;  

&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.address-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;inline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.voter-registration&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.ssn-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.radio-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.submit-btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;25px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.political-party&lt;/span&gt; &lt;span class=&quot;nc&quot;&gt;.radio-field&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.political-party&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.voter-address&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.birth-info&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.birth-info&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;  
  
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (February 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/03/08/february/"/>
   <updated>2017-03-08T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2017/03/08/february/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In February, we continued our efforts to refactor the runtime, making progress to the point where we can run the Flappy Bird example in the new codebase. We’ve also invested a lot of time commenting the new codebase, explaining how Eve works internally. For instance, &lt;a href=&quot;https://github.com/witheve/Eve/blob/dbf9c52add5d3f018901a10ae2ef5c0ef2a1d5ea/src/runtime/runtime.ts#L442&quot;&gt;here&lt;/a&gt; is an explanation of how joins work in Eve. When the dust settles on this refactor, we hope that the increased documentation/commenting will lead to a better understanding of how Eve works for those interested.&lt;/p&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;The runtime refactor has three goals:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Create a better extensibility story for Eve&lt;/li&gt;
  &lt;li&gt;Allow easier incorporation of Eve into existing projects and with existing JS libraries and frameworks&lt;/li&gt;
  &lt;li&gt;Improve the performance of the Eve runtime&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s look at how the refactor is accomplishing those so far.&lt;/p&gt;

&lt;h4 id=&quot;watchers&quot;&gt;Watchers&lt;/h4&gt;

&lt;p&gt;Watchers are the primary interface to get data into and out of Eve. Let’s say you have an Eve program that produces records tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;#email/send&lt;/code&gt;. Currently there is no way to send e-mails from within Eve, but if you had those records in Javascript, you could use an existing library. This is where watchers come in. To access records in Eve from Javascript, you would write a watcher that searches for records of interest, and then handles them in a callback. For instance:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;program&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;watch&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Send emails&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;email/send&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;asObjects&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;((&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;diff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;of&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;diff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;adds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;email&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;sendAnEmail&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;to&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;subject&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;body&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This watcher finds records tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;#email/send&lt;/code&gt;, and makes them available as objects in Javascript. When a new record is created in Eve, this is reflected in &lt;code class=&quot;highlighter-rouge&quot;&gt;diff.adds&lt;/code&gt;, and processed in the supplied callback function. In this case, each element in &lt;code class=&quot;highlighter-rouge&quot;&gt;diff.adds&lt;/code&gt; goes through the hypothetical Javascript function &lt;code class=&quot;highlighter-rouge&quot;&gt;sendAnEmail()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Watchers also accomplish the related task of getting data into Eve, with a call to &lt;code class=&quot;highlighter-rouge&quot;&gt;this.program.inputEAVs(/* list of EAVs */)&lt;/code&gt;, where the argument is just a list of EAV triples.
Some examples of these interfaces at work are in the renderer, which turns Eve &lt;a href=&quot;https://github.com/witheve/Eve/blob/refactor-runtime/src/watchers/dom.ts&quot;&gt;records into DOM objects&lt;/a&gt;, and turns DOM events (like &lt;a href=&quot;https://github.com/witheve/Eve/blob/refactor-runtime/src/watchers/html.ts#L31&quot;&gt;click&lt;/a&gt;) into records.&lt;/p&gt;

&lt;h4 id=&quot;function-interface&quot;&gt;Function Interface&lt;/h4&gt;

&lt;p&gt;We’ve also simplified the function interface in Eve, making it easier for you to use foreign functions. This is a little more complicated in Eve than other languages, because Eve makes some assumptions about functions that Javascript does not guarantee:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Functions in Eve are referentially transparent, meaning for a given input, the function produces the same output.&lt;/li&gt;
  &lt;li&gt;Functions in Eve are monotonic, meaning more inputs cannot lead to fewer outputs.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For a function to fit into the Eve model, it must meet these qualifications. Therefore, to use Javascript functions in Eve, you must wrap the function and guarantee these two conditions yourself. Fortunately, as I stated above, this is much easier in the refactored runtime. Take the &lt;a href=&quot;https://github.com/witheve/Eve/blob/refactor-runtime/src/runtime/stdlib.ts#L66&quot;&gt;plus function&lt;/a&gt;, for instance:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;makeFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;math/+&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;returns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;apply&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;number&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As the function wrapper, you supply its name, arguments, returns, and then the function definition. What about a function like &lt;a href=&quot;https://github.com/witheve/Eve/blob/refactor-runtime/src/runtime/stdlib.ts#L197&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;random&lt;/code&gt;&lt;/a&gt;, which would seem to violate the conditions outlined above? This is an example where the function wrapper must take greater care to ensure the function behaves properly in Eve. By memoizing the input seed using the function’s internal &lt;code class=&quot;highlighter-rouge&quot;&gt;state&lt;/code&gt;, we can ensure that the &lt;code class=&quot;highlighter-rouge&quot;&gt;random&lt;/code&gt; function in Eve is referentially transparent:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;makeFunction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;random/number&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;any&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;returns&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;initialState&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{},&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;na&quot;&gt;apply&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;RawValue&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;kc&quot;&gt;undefined&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;state&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;Math&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;random&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This interface still needs some more work, to define functions that take a single input and produce multiple outputs. But where it stands, this interface opens the door to using Eve with existing Javascript libraries and functions.&lt;/p&gt;

&lt;h4 id=&quot;performance&quot;&gt;Performance&lt;/h4&gt;

&lt;p&gt;Performance concerns were a heavy motivating factor for undergoing the current refactor. The v0.2.x runtime executed blocks in batches, meaning that if a fact changed between ticks, the affected blocks would be entirely recomputed, even if the change did not impact the final output of the block. For instance:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  x = [#foo]
  foo.value &amp;gt; 10

bind @browser
  [#div text: foo.value]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If a &lt;code class=&quot;highlighter-rouge&quot;&gt;#foo&lt;/code&gt; is added with a value less than 10, this entire block will be recomputed, even though the output is not changed (since the added fact is filtered from the output).Obviously, this resulted in needless overhead, but with exponential time complexity, it also presented an upper-bound on how many facts Eve was able to handle. The new runtime executes incrementally, recomputing only those facts which have changed since the preceding tick. This execution model operates with linear time complexity, and so the upper limit on facts has increased drastically.&lt;/p&gt;

&lt;p&gt;As a comparison test, we streamed updates through a block that created an HTML record with text in it (like the block above). The old runtime would time-out at around 3k updates, which took ~70 seconds. Compare this with the new runtime, which can stream 10k updates in ~400 - 500 ms. We’ll measure performance more accurately when the runtime refactor work is complete, but this preliminary result shows great potential.&lt;/p&gt;

&lt;p&gt;The work to make the Eve runtime incremental we adapted heavily from the awesome research &lt;a href=&quot;https://github.com/frankmcsherry/&quot;&gt;Frank McSherry&lt;/a&gt; has done on &lt;a href=&quot;https://github.com/frankmcsherry/differential-dataflow&quot;&gt;Differential Dataflow&lt;/a&gt;. Translating those ideas to a runtime for Eve has led us to some interesting discoveries (maybe even some fundamental contributions!) that we’ll talk about once the dust settles.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;h4 id=&quot;eve-examples&quot;&gt;Eve Examples&lt;/h4&gt;

&lt;p&gt;Last month we posted several example applications, meant to distill common Eve patterns into small, self-contained applications.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#gist:0049b5b77a1e01b0124c96c820ff3374-crazy-mikes.eve&quot;&gt;Example 1 - Crazy Mike’s&lt;/a&gt; - Demonstrates how to set up a multi-page application.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#gist:8ba50b7bd48b338c85c0590c0cba1563-sandlot.eve&quot;&gt;Example 2 - The Sandlot&lt;/a&gt; - Demonstrates how to create and resuse a custom component.&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#gist:56fda335208ba82af8e327f95a0b9efc-ex3-jurassicpark.eve&quot;&gt;Example 3 - Jurassic Park&lt;/a&gt; - Demonstrates the creation and use of a form component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These examples (and more to come) are available in the eve-examples repository, located &lt;a href=&quot;https://github.com/witheve/eve-examples&quot;&gt;here&lt;/a&gt;. We’ll have Example 4 available on Monday, which will further make use of and extend the form component introduced in Example 3.&lt;/p&gt;

&lt;h4 id=&quot;contributions&quot;&gt;Contributions&lt;/h4&gt;

&lt;p&gt;We’d like to extend a thank you to everyone who contributed to Eve this month. With the codebase currently undergoing refactoring, we realize contributing can be difficult at this time, but we appreciate everyone who took the effort!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/JulianKniephoff&quot;&gt;@JulianKniephoff&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/shamrin&quot;&gt;@shamrin&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/wilk&quot;&gt;@wilk&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h4&gt;

&lt;p&gt;We’ve gotten word of two new meetups, one of which is happening early next month&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;New Orleans, March 7&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Tyler Tallman &lt;a href=&quot;https://www.meetup.com/no-fun/events/237247045/?_af=event&amp;amp;_af_eid=237247045&amp;amp;https=on&quot;&gt;give a talk&lt;/a&gt; on Eve as part of the New Orleans Functional Club, which happened last night. We’ll check in with them and see how it went.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;San Francisco Bay Area, TBD Early April&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/anfedorov&quot;&gt;Andrey Fedorov&lt;/a&gt; is planning a talk about Eve for the next &lt;a href=&quot;http://2020salon.blogspot.com/&quot;&gt;20/20 Salon&lt;/a&gt; meeting in the Bay Area next month. The date is tentatively set for early April, so we’ll keep you updated when a firm date becomes available. If you’d like to attend, they ask that you &lt;a href=&quot;http://2020salon.blogspot.com/&quot;&gt;RSVP&lt;/a&gt; so they can accommodate everyone.&lt;/p&gt;

&lt;p&gt;If you’d like to host your own meetup, &lt;a href=&quot;mailto:corey@kodowa.com&quot;&gt;let us know&lt;/a&gt;, and we’ll &lt;a href=&quot;https://twitter.com/Ruben__Sandwich/status/836927833716965376&quot;&gt;do what we can&lt;/a&gt; to support your event.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Example 3 - Jurassic Park</title>
   <link href="http://incidentalcomplexity.com/2017/03/01/ex3-jurassicpark/"/>
   <updated>2017-03-01T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2017/03/01/ex3-jurassicpark/</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/ex3.png&quot; alt=&quot;Example 3&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;what-is-this&quot;&gt;What is this?&lt;/h3&gt;

&lt;p&gt;This app demonstrates the use of a custom form component in a basic log in application. The app contains three views: a login form, a registration form, and a user profile form that displays the information entered during registration. These forms are built using a custom form component, which is defined at the end of the program. The form component allows for the concise definition of forms by defining common behavior like form submission and resetting.&lt;/p&gt;

&lt;p&gt;You can play with this example in your browser &lt;a href=&quot;http://play.witheve.com/#gist:56fda335208ba82af8e327f95a0b9efc-ex3-jurassicpark.eve&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;application-set-up&quot;&gt;Application Set Up&lt;/h3&gt;

&lt;p&gt;The app contains the current page, as well as the current user. Initially, though, there is no user, so we just need to specify the current page.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;bind @browser
  [#div #app class: &quot;app-wrapper&quot; page: &quot;login&quot; children: 
    [#div sort: 0 text: &quot;Jurassic Park System Security Interface&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;pages&quot;&gt;Pages&lt;/h3&gt;

&lt;h4 id=&quot;log-in-form&quot;&gt;Log In Form&lt;/h4&gt;

&lt;p&gt;The log in form contains two input boxes, one for the username and another for a password. We must explicitly sort the fields (using a &lt;code class=&quot;highlighter-rouge&quot;&gt;sort&lt;/code&gt; attribute) to display them in a specific order.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  app = [#app page: &quot;login&quot;]
  
bind @browser
  app.children +=
    [#div sort: 1 children:
      [#form name: &quot;Login&quot; sections: 
        [#section fields: 
          [#field sort: 2 type: &quot;password&quot; field: &quot;password&quot;]
          [#field sort: 1 type: &quot;input&quot; field: &quot;username&quot;]]]
      [#button #signup text: &quot;Sign Up&quot; ]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A successful login is one where the username and password entered in the login form match some user/password combination stored in the system. For simplicity, passwords are stored as plain text, so we just need to search for a &lt;code class=&quot;highlighter-rouge&quot;&gt;#user&lt;/code&gt; with a matching username and password. If one is found, we set it as the user attribute in the &lt;code class=&quot;highlighter-rouge&quot;&gt;#app&lt;/code&gt; record.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  [#form name: &quot;Login&quot; submission: [username password]]
  user = [#user username password]
  app = [#app]
    
commit @browser
  app.page := &quot;profile&quot;
  app.user := user
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If the user enters a login that does not match a user, then display a message indicating that the login failed.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session  
  form = [#form name: &quot;Login&quot; submission: [username password]]
  form-message = [#form-message form]
  
  not([#user username password])

commit @browser
  form-message.text := &quot;** Login Failed **&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clicking the sign up button changes the page to the sign up page&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event
  [#click element: [#signup]] 
  app = [#app]
  
commit @browser
  app.page := &quot;signup&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;sign-up-form&quot;&gt;Sign Up Form&lt;/h4&gt;

&lt;p&gt;The user registration page requests the name, department, a username and password.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  app = [#app page: &quot;signup&quot;]
  
bind @browser
  app.children +=
   [#div children:
    [#form name: &quot;Sign Up&quot; options: [reset: true] sections: 
      [#section name: &quot;User Info&quot; fields: 
        [#field sort: 1 type: &quot;input&quot; field: &quot;full-name&quot;]
        [#field sort: 2 type: &quot;input&quot; field: &quot;department&quot;]]
      [#section name: &quot;Account Info&quot; fields: 
        [#field sort: 1 type: &quot;input&quot; field: &quot;username&quot;]
        [#field sort: 2 type: &quot;password&quot; field: &quot;password&quot;]
        [#field sort: 3 type: &quot;password&quot; field: &quot;confirm-password&quot;]]]
    [#button #login text: &quot;Log In&quot; ]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We need to create a &lt;code class=&quot;highlighter-rouge&quot;&gt;#user&lt;/code&gt; from the submission of the registration form. This will only work if every field has an entry, and the two password fields match.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  [#form name: &quot;Sign Up&quot; submission: [username password confirm-password full-name department]]
  // The password and the confirmation must match
  password = confirm-password
  app = [#app]

commit @browser
  app.page := &quot;login&quot;
  
commit
  [#user username password name: full-name department]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clicking the login button changes the page back to the login screen&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event
  [#click element: [#login]] 
  app = [#app]
  
commit @browser
  app.page := &quot;login&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;profile-page&quot;&gt;Profile Page&lt;/h4&gt;

&lt;p&gt;The profile page displays information relating to the current user profile. It is accessed after a successful submission of the login form, which creates a user attribute in the #app.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  app = [#app page: &quot;profile&quot; user]
  
bind @browser
  app.children += 
  [#div class: &quot;profile&quot; children:
    [#div text: &quot;Welcome !&quot;]
    [#div text: &quot;Name: &quot;]
    [#div text: &quot;Department: &quot;]
    [#button #logout text: &quot;Log Out&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clicking logout returns to the login page, and removes the user from &lt;code class=&quot;highlighter-rouge&quot;&gt;#app&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event
  [#click element: [#logout]] 
  app = [#app]
  
commit @browser
  app.user := none
  app.page := &quot;login&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;an-easter-egg&quot;&gt;An easter egg&lt;/h4&gt;

&lt;p&gt;We can specify custom behavior by special casing search conditions and adding new side effects. In this block, we hijack the login process when the username is “dnedry”. Instead of displaying the typical “login failed” message, we give the user a surprise.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  app = [#app]
  
  [#form name: &quot;Login&quot; submission: [username password]]
  username = &quot;dnedry&quot;
  not([#user username password])
  
commit @browser
  app.children := none
  app.class -= &quot;app-wrapper&quot;
  app.class += &quot;uh-uh-uh&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clicking anywhere returns to the login screen&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session @event
  [#click]
  app = [#app class: &quot;uh-uh-uh&quot;]
  
commit @browser
  app.class += &quot;app-wrapper&quot;
  app.class -= &quot;uh-uh-uh&quot;
  app.children += [#div sort: 0 text: &quot;Jurassic Park System Security Interface&quot;]
  app.page := &quot;login&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;a-custom-form-element&quot;&gt;A Custom Form Element&lt;/h3&gt;

&lt;p&gt;Forms have a title and one or more sections. Each section has an optional name, and contains one or more fields. Each field additionally has the input type of that field (input, radio button, drop down list, etc.).&lt;/p&gt;

&lt;p&gt;A form starts as a &lt;code class=&quot;highlighter-rouge&quot;&gt;#form&lt;/code&gt; record.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form += #div
  form.sort := 0
  form.class := &quot;form&quot;
  form.submission := []
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display the form name&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form.children += [#div children:
    [#h1 class: &quot;form-name&quot; sort: 0 text: form.name]
    [#div #form-message form sort: 1 class: &quot;form-message&quot;]]

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display each section. To properly display sections, we need to add them to the children of the form.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form sections]
    
bind @browser
  form.children += [#div form section: sections class: &quot;form-section&quot; sort: 1]
  sections.form := form
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If the section has a name, display it&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  section-display = [#div section]
  
bind @browser
  section-display.children += [#h2 class: &quot;section-name&quot; text: section.name, sort: 0]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display the fields in each section. As we did with sections, to display fields we need to move them over to the children of the section display.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  section-display = [#div section]
  field = section.fields
  
bind @browser
  section-display.children += 
    [#div field sort: field.sort form: section.form sort: 1 children: 
      [tag: field.type, placeholder: field.field, class: field.type]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Display a submit button at the end of the form&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form]
  
bind @browser
  form.children += [#button #submit form sort: 100 text: &quot;Submit&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Forms can have an optional reset button, which clears the fields in the form&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  form = [#form options: [reset: true]]
  
bind @browser
  form.children += [#button #reset form sort: 101 text: &quot;Reset&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Clicking the reset button clears each field in the form&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @event @browser
  [#click element: [#reset]]
  field-container = [#div field form]
    
commit @browser
  field-container.children.value := none
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;save-input-to-records&quot;&gt;Save Input to Records&lt;/h4&gt;

&lt;p&gt;Form values are saved as a &lt;code class=&quot;highlighter-rouge&quot;&gt;#submission&lt;/code&gt; when the submit button is clicked. This submission has a lifetime equal to that of the &lt;code class=&quot;highlighter-rouge&quot;&gt;#click&lt;/code&gt;, so a submission must be committed to a record by the user. This allows the user to implement custom handling logic.&lt;/p&gt;

&lt;p&gt;One thing this form component does not handle is form validation. In a future example, we will demonstrate how certain fields can be required, while others are optional. This form will submit any fields that are filled, while omitting any that are not. If a form is handled expecting fields that aren’t submitted, then the submission will simply be ignored.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  click = [#click element: [#submit form]]
  form = [#form submission]
  field-container = [#div field form]
  value = field-container.children.value
  key = field.field
  [#time timestamp: time]
  
bind @browser
  // When used in a bind or commit. lookup[] creates a record with the give attribute and value. We use it here to create a record with the attribute as the field name. 
  //For example, a login form with &quot;username&quot; and &quot;password&quot; fields could be accessed as [#form name: &quot;Login&quot; submission: [username password]]
  lookup[record: submission, attribute: key, value]
  field-container.children.value := none
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;custom-input-types&quot;&gt;Custom Input Types&lt;/h4&gt;

&lt;p&gt;Render password fields&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  password = [#password]
  
bind @browser
  password += #input
  password.type := &quot;password&quot;
  password.class := &quot;password&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Render custom button styles&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser
  button = [#button]
  
bind @browser
  button.class += &quot;button&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;appendix&quot;&gt;Appendix&lt;/h3&gt;

&lt;h4 id=&quot;test-data&quot;&gt;Test Data&lt;/h4&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit
  [#user username: &quot;jhammond&quot; name: &quot;John Hammond&quot; department: &quot;Executive&quot; password: &quot;password&quot;]
  [#user username: &quot;dnedry&quot; name: &quot;Dennis Nedry&quot; department: &quot;Engineering&quot; password: &quot;Mr. Goodbytes&quot;]
  [#user username: &quot;hwu&quot; name: &quot;Henry Wu&quot; department: &quot;Genetics&quot; password: &quot;slartibartfast&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;styles&quot;&gt;Styles&lt;/h4&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;err&quot;&gt;there&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;is&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;currently&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;bug&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;that&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;causes&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;the&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;first&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;CSS&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;block&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;an&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;Eve&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;program&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;to&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;be&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;disregarded,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;so&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;good&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;time,&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;leave&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;this&lt;/span&gt; &lt;span class=&quot;err&quot;&gt;here&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.application-container&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;monospace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1800px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nc&quot;&gt;.app-wrapper&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/BBPkd29.gif)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;800&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;658px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;180px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;nl&quot;&gt;padding-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;130px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.profile&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.profile&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;div&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  
&lt;span class=&quot;nc&quot;&gt;.form-section&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.form&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.input&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;monospace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.password&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;font-family&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;monospace&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;outline&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.button&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#000&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.form-message&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;no&quot;&gt;green&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.form-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.section-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.uh-uh-uh&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;320px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;520px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
 &lt;span class=&quot;nl&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/yz53s4N.gif)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
 &lt;span class=&quot;nl&quot;&gt;background-color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#FFF&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Example 2 - The Sandlot</title>
   <link href="http://incidentalcomplexity.com/2017/02/21/ex2-sandlot/"/>
   <updated>2017-02-21T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2017/02/21/ex2-sandlot/</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/ex2.png&quot; alt=&quot;Example 2&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;what-is-this&quot;&gt;What is this?&lt;/h3&gt;

&lt;p&gt;This app demonstrates how to create a reusable component and how to inject it into the browser. This app displays a batting order for a baseball team using a &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; component. This component displays information relating to each player on a baseball team – picture, name, position, and handedness. A &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; can also be configured with additional functionality using optional tags. The app also shows some of the ways &lt;code class=&quot;highlighter-rouge&quot;&gt;sort&lt;/code&gt; can be used, and how to choose specific records out of a list of records.&lt;/p&gt;

&lt;p&gt;You can play with this example in your browser &lt;a href=&quot;http://play.witheve.com/#gist:8ba50b7bd48b338c85c0590c0cba1563-sandlot.eve&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;page-layout&quot;&gt;Page Layout&lt;/h3&gt;

&lt;h4 id=&quot;containers&quot;&gt;Containers&lt;/h4&gt;

&lt;p&gt;I want to break the page down into two sections: one for the active lineup and the bench players, and one for players on injured reserve.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit @browser
  [#div class:&quot;container&quot; children:
    [#div #active class:&quot;lineup&quot; text:&quot;Batting Order&quot;]
    [#div #inactive class:&quot;lineup&quot; text:&quot;Bench&quot;]]
  [#div #IR class:&quot;lineup IR&quot; text:&quot;Injured Reserve&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;active-lineup&quot;&gt;Active Lineup&lt;/h4&gt;

&lt;p&gt;The first column drawn should be the active batting order. While I could have specified all the text and contents of each player in this block, note that I used two tags, &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt;, whose contents and behavior get defined later. Since every player listed is going to have the same information, &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; lets me drop the tag in and define all the HTML and content later, which is done in the Player Cards section after this one.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  player = [#player not(#bench) not(#injured) lineup]
  active = [#active]

bind @browser
  active.children += [#div #lineup children: [#player-card #moveable player sort: lineup]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;bench-players&quot;&gt;Bench Players&lt;/h4&gt;

&lt;p&gt;These are the bench players. Note that &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; is used again, saving me the work of having to define all the same html and content that’s used in the active lineup. The big difference here is the ordering of the players. Whereas the players in the lineup have a deliberate and specific order (which makes sense for things like a batting order), I don’t need a specific order for the bench players. I do, however, want to know how many there are and make sure they render in the same order each time, so I sort by the &lt;code class=&quot;highlighter-rouge&quot;&gt;player&lt;/code&gt; variable to get an index, &lt;code class=&quot;highlighter-rouge&quot;&gt;n&lt;/code&gt;. Each player gets assigned an index, which is how I sort the bench players, and also set &lt;code class=&quot;highlighter-rouge&quot;&gt;player.lineup&lt;/code&gt; to that index so they get numbered 1, 2, 3, and so on.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  player = [#player #bench lineup]
  inactive = [#inactive]
  n = sort[value:player]

bind @session @browser
  player.lineup := n
  inactive.children += [#div #lineup children: [#player-card #benched sort:n player]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;injured-reserve&quot;&gt;Injured Reserve&lt;/h4&gt;

&lt;p&gt;These are the injured reserve players. This section is functionally identical to the bench player section, except it gets merged into the &lt;code class=&quot;highlighter-rouge&quot;&gt;#IR&lt;/code&gt; section on the page. There’s only one player on the IR and no functionality exists to move him elsewhere, because he is a jerk.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  player = [#player #injured not(#bench) lineup]
  IR = [#IR]
  n = sort[value:player]

bind @session @browser
  player.lineup := n
  IR.children += [#div #lineup children: [#player-card sort:n player]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;player-cards&quot;&gt;Player Cards&lt;/h3&gt;

&lt;p&gt;This is where the magic happens. Every time this finds &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; in the browser, it will make a &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; for each player and spit out a player card. It checks to see if the player has a nickname as well, and just leaves a space between the first and last names if there isn’t. It’s worth mentioning that because I want this to be as general a template as possible, a handful of architectural decisions were made to facilitate that. In the sections that draw each of the three lists, I use the search parameters there to select the specific players I want and inject those player cards. In the Roster Data, all the players have a &lt;code class=&quot;highlighter-rouge&quot;&gt;lineup&lt;/code&gt; attribute even though the bench and IR players have an empty string as the value. If you’re good at predicting which reusable parts you’ll need, you can implement these sorts of things from the outset, or you can figure out where they need to be as you go along and refactor them into your code as you work.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  container = [#player-card player]
  player = [#player firstname lastname position bats lineup photo]
  middle = if player.nickname then &quot; \&quot;\&quot; &quot;
           else &quot; &quot;

bind @browser
  container &amp;lt;- [#div player class: &quot;lineup-position&quot; children:
    [#div class: &quot;bat-number&quot; text: lineup]
    [#div class: &quot;player-info&quot; children:
      [#img class: &quot;player-photo&quot; src: photo]
      [#div class: &quot;player-text&quot; children:
        [#div class: &quot;name-line&quot; children:
          [#div class: &quot;position&quot; text: position]
          [#div class: &quot;first-name&quot; text: firstname]
          [#div class: &quot;middle-name&quot; text: middle]
          [#div class: &quot;last-name&quot; text: lastname]]
        [#div class:&quot;bat-hand&quot; text:&quot;Bats: &quot;]]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;buttons&quot;&gt;Buttons&lt;/h3&gt;

&lt;h4 id=&quot;move-up&quot;&gt;Move Up&lt;/h4&gt;

&lt;p&gt;The active roster also features a cool way to use tags. Since I want to be able to reorder my active lineup, each &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; there is also tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt;. This checks to see if a &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; is &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt; and adds a child &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; to it with a &lt;code class=&quot;highlighter-rouge&quot;&gt;#move-up-btn&lt;/code&gt;, unless that player is already at the top of roster and can’t move up any further.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  container = [#div #moveable player]
  not(player.lineup = 1)

bind @browser
  container.children += [#div #move-up-btn player class: &quot;ion-chevron-up&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It’s like hashtag inception. Just as the &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt; tag let Eve know to add a &lt;code class=&quot;highlighter-rouge&quot;&gt;#move-up-btn&lt;/code&gt;, this block adds another layer of functionality by giving that button some behavior. In this case, when a &lt;code class=&quot;highlighter-rouge&quot;&gt;#move-up-btn&lt;/code&gt; is clicked, Eve captures who the specific &lt;code class=&quot;highlighter-rouge&quot;&gt;clicked-player&lt;/code&gt; is, finds whoever is one space above them in the lineup, and switches their places.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  [#click element: [#move-up-btn player: clicked-player]]
  above-clicked = [#player lineup: clicked-player.lineup - 1]

commit
  clicked-player.lineup := clicked-player.lineup - 1
  above-clicked.lineup := above-clicked.lineup + 1
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;move-down&quot;&gt;Move Down&lt;/h4&gt;

&lt;p&gt;This block is the mirror of the move up buttons. If a &lt;code class=&quot;highlighter-rouge&quot;&gt;#player-card&lt;/code&gt; is &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt;, and not at the bottom of the lineup, which is what the &lt;code class=&quot;highlighter-rouge&quot;&gt;count&lt;/code&gt; is checking, then a child &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; gets added with a &lt;code class=&quot;highlighter-rouge&quot;&gt;#move-down-btn&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  container = [#div #moveable player]
  not(player.lineup: count[given: [#player not(#bench) not(#injured)]])

bind @browser
  container.children += [#div #move-down-btn player class: &quot;ion-chevron-down&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once again the reciprocal of the previous section, when a &lt;code class=&quot;highlighter-rouge&quot;&gt;#move-down-btn&lt;/code&gt; is clicked, Eve captures the specific &lt;code class=&quot;highlighter-rouge&quot;&gt;clicked-player&lt;/code&gt;, finds the player one space below them in the lineup, and switches their places.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  [#click element:[#move-down-btn player: clicked-player]]
  below-clicked = [#player lineup: clicked-player.lineup + 1]

commit
  clicked-player.lineup := clicked-player.lineup + 1
  below-clicked.lineup := below-clicked.lineup - 1
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;remove-from-lineup&quot;&gt;Remove from Lineup&lt;/h4&gt;

&lt;p&gt;If a player is &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt;, it means they’re in the active lineup and should be able to be removed from the active lineup and sent to the bench. This simply looks for any &lt;code class=&quot;highlighter-rouge&quot;&gt;#moveable&lt;/code&gt; players and adds a &lt;code class=&quot;highlighter-rouge&quot;&gt;#deactivate&lt;/code&gt; button to them.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  container = [#div #moveable player]

bind @browser
  container.children += [#div #deactivate player class: &quot;ion-log-out&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This gives &lt;code class=&quot;highlighter-rouge&quot;&gt;#deactivate&lt;/code&gt; its behavior. The &lt;code class=&quot;highlighter-rouge&quot;&gt;clicked-player&lt;/code&gt; is sent to the bench and is stripped of their lineup order. All the players who were below them on the lineup get moved up a spot so that there aren’t gaps in the numbering.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  [#click element: [#deactivate player: clicked-player]]
  players-below = [#player lineup &amp;gt; clicked-player.lineup]

commit
  clicked-player += #bench
  clicked-player.lineup := &quot;&quot;
  players-below.lineup := players-below.lineup - 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This block takes care of an edge case for &lt;code class=&quot;highlighter-rouge&quot;&gt;#deactivate&lt;/code&gt;. Because the previous block finds all the &lt;code class=&quot;highlighter-rouge&quot;&gt;players-below&lt;/code&gt; the &lt;code class=&quot;highlighter-rouge&quot;&gt;clicked-player&lt;/code&gt;, if the player is at the bottom of the lineup then there are no &lt;code class=&quot;highlighter-rouge&quot;&gt;players-below&lt;/code&gt; and the search block fails, preventing the button from doing anything. This makes sure you can move the ninth batter off the lineup onto the bench.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  [#click element: [#deactivate player: clicked-player]]

commit
  clicked-player += #bench
  clicked-player.lineup := &quot;&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;add-to-lineup&quot;&gt;Add to Lineup&lt;/h4&gt;

&lt;p&gt;This adds an &lt;code class=&quot;highlighter-rouge&quot;&gt;#activate&lt;/code&gt; button to the bench players so we can add them to the active lineup, but only if there are fewer than nine batters already in the lineup.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @session
  container = [#div #benched player]
  active-players = if c = count[given: [#player not(#bench) not(#injured)]] then c else 0
  active-players != 9

bind @browser
  container.children += [#div #activate player class:&quot;ion-log-in&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This gives &lt;code class=&quot;highlighter-rouge&quot;&gt;#activate&lt;/code&gt; its behavior. When an &lt;code class=&quot;highlighter-rouge&quot;&gt;#activate&lt;/code&gt; button is clicked, Eve finds out how many active players are in the lineup then adds the &lt;code class=&quot;highlighter-rouge&quot;&gt;clicked-player&lt;/code&gt; and assigns them the next number in the lineup.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @browser @event @session
  [#click element: [#activate player:clicked-player]]
  active-players = if c = count[given:[#player not(#bench) not(#injured)]] then c else 0
  active-players != 9

commit
  clicked-player -= #bench
  clicked-player.lineup := active-players + 1
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;roster-data&quot;&gt;Roster Data&lt;/h3&gt;

&lt;p&gt;Our sample roster data.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#player firstname:&quot;Kenny&quot; lastname:&quot;DeNunez&quot; position:&quot;P&quot; bats:&quot;R&quot; lineup:3 photo:&quot;http://i.imgur.com/kaRnA7R.png&quot;]
  [#player firstname:&quot;Hamilton&quot; lastname:&quot;Porter&quot; nickname:&quot;Ham&quot; position:&quot;C&quot; bats:&quot;R&quot; lineup:1 photo:&quot;http://i.imgur.com/7C678n2.jpg&quot;]
  [#player firstname:&quot;Timmy&quot; lastname:&quot;Timmons&quot; position:&quot;IF&quot; bats:&quot;R&quot; lineup:8 photo:&quot;http://i.imgur.com/JLHupGR.png&quot;]
  [#player firstname:&quot;Bertram&quot; lastname:&quot;Grover Weeks&quot; position:&quot;IF&quot; bats:&quot;R&quot; lineup:2 photo:&quot;http://i.imgur.com/mfIMIy6.png&quot;]
  [#player firstname:&quot;Alan&quot; lastname:&quot;McClennan&quot; nickname:&quot;Yeah-Yeah&quot; position:&quot;IF&quot; bats:&quot;R&quot; lineup:6 photo:&quot;http://i.imgur.com/ZyLzCDn.jpg&quot;]
  [#player firstname:&quot;Benny&quot; lastname:&quot;Rodriguez&quot; nickname:&quot;The Jet&quot; position:&quot;IF&quot; bats:&quot;S&quot; lineup:9 photo:&quot;http://i.imgur.com/UOywuNz.jpg&quot;]
  [#player firstname:&quot;Scott&quot; lastname:&quot;Smalls&quot; position:&quot;OF&quot; bats:&quot;R&quot; lineup:5 photo:&quot;http://i.imgur.com/eBZ2m17.jpg&quot;]
  [#player firstname:&quot;Michael&quot; lastname:&quot;Palledorous&quot; nickname:&quot;Squints&quot; position:&quot;OF&quot; bats:&quot;R&quot; lineup:4 photo:&quot;http://i.imgur.com/q8KKRz6.jpg&quot;]
  [#player firstname:&quot;Tommy&quot; lastname:&quot;Timmons&quot; nickname:&quot;Repeat&quot; position:&quot;OF&quot; bats:&quot;R&quot; lineup:7 photo:&quot;http://i.imgur.com/QPzSCGy.png&quot;]
  [#player #bench firstname:&quot;Thelonius&quot; lastname:&quot;Mertle&quot; position:&quot;IF&quot; bats:&quot;L&quot; lineup:&quot;&quot; photo:&quot;http://i.imgur.com/XDA0ftH.jpg&quot;]
  [#player #bench firstname:&quot;George Herman&quot; lastname:&quot;Ruth&quot; nickname:&quot;Babe&quot; position:&quot;P&quot; bats:&quot;L&quot; lineup:&quot;&quot; photo:&quot;http://i.imgur.com/kep7Unm.jpg&quot;]
  [#player #bench firstname:&quot;Hercules&quot; lastname:&quot;Mertle&quot; nickname:&quot;The Beast&quot; position:&quot;PR&quot; bats:&quot;S&quot; lineup:&quot;&quot; photo:&quot;http://i.imgur.com/WOwMn5c.jpg&quot;]
  [#player #injured firstname:&quot;&quot; lastname:&quot;Phillips&quot; position:&quot;IF&quot; bats:&quot;R&quot; lineup:&quot;&quot; photo:&quot;http://i.imgur.com/Qvxya5C.jpg&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;styles&quot;&gt;Styles&lt;/h3&gt;

&lt;p&gt;The app needs a good bit of CSS to organize the page sections and various buttons as well as stylize the player cards.&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;py&quot;&gt;user-select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1000px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.IR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;scroll&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup-position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;list-style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;relative&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-number&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;40px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#b4b4b4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-info&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;85px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;450px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#ffffff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-radius&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;order&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;hidden&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.name-line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.first-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.middle-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-weight&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;600&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;white-space&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pre&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.last-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;uppercase&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-photo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;85px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;85px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1px&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;solid&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#555&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-hand&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;14px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;left&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-up&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-down&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-out&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#e65b3c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-in&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;scaleX&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;-1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#009ee0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;24px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1848px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.IR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;415px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;415px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup-position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-number&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-info&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;45px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;400px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.name-line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.first-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.middle-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.last-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-photo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;45px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;45px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-hand&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-up&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-down&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-out&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-in&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;15px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;k&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;max-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1200px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.container&lt;/span&gt;  &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;border-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.IR&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;515px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;18px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;min-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.lineup-position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-number&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;30px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-info&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;55px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.name-line&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;2px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-wrap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;wrap&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.position&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin-right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.first-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.middle-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.last-name&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.player-photo&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;55px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;55px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.bat-hand&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;  &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-up&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;7px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-chevron-down&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;bottom&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;6px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-out&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.ion-log-in&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;right&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;8px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Example 1 - Crazy Mike's</title>
   <link href="http://incidentalcomplexity.com/2017/02/14/ex1-crazy-mike/"/>
   <updated>2017-02-14T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2017/02/14/ex1-crazy-mike/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;what-is-this&quot;&gt;What is this?&lt;/h3&gt;

&lt;p&gt;This small app is pretty straightforward, consisting of a simple webpage with four subpages. The purpose is to demonstrate some basic webpage structure, show how a navigation bar could be implemented, how it changes the view between the different subpages, and how to inject page contents into the page view as you navigate from one subpage to another.&lt;/p&gt;

&lt;p&gt;You can play with this example in your browser &lt;a href=&quot;http://play.witheve.com/#gist:0049b5b77a1e01b0124c96c820ff3374-crazy-mikes.eve&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;page-layout&quot;&gt;Page Layout&lt;/h3&gt;

&lt;h4 id=&quot;containers&quot;&gt;Containers&lt;/h4&gt;

&lt;p&gt;I want this app to have three containers: a hero image, a nav bar above the page container, and page contents which are going to change depending on the active section. I draw the basic page structure here and worry about details like drawing the individual tabs for the subpages later. The hero image and the nav bar also have their classes set here because their style never changes. The individual pages may require different styles, so their classes are bound later.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit @browser
  [#div class:&quot;app-wrapper&quot; children:
    [#div class:&quot;hero-image&quot;]
    [#div class:&quot;nav-bar&quot; #nav-bar]
    [#div #page-contents]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;subpages&quot;&gt;Subpages&lt;/h4&gt;

&lt;p&gt;Crazy Mike sells a modest selection of repossessed electronics. I can set all the pages the site is going to have right here, and because I separated this from the page containers above, if I want to add another page and have it appear as a tab on the navigation bar, I can simply add it to this list.&lt;/p&gt;

&lt;p&gt;Each page has a name, which is displayed as a label on the navigation button; and an order, which indicates its position in the nav bar.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;commit
  [#page name: &quot;Home&quot; order: 1]
  [#page name: &quot;Televisions&quot; order: 3]
  [#page name: &quot;Computers&quot; order: 2]
  [#page name: &quot;Stereos&quot; order: 4]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;initial-landing-site&quot;&gt;Initial Landing Site&lt;/h4&gt;

&lt;p&gt;The #&lt;code class=&quot;highlighter-rouge&quot;&gt;app&lt;/code&gt; record is where I’ve decided to keep track of which page is being viewed. I’ve also set &lt;code class=&quot;highlighter-rouge&quot;&gt;page&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;homepage&lt;/code&gt; to begin with so that new customers will land there when they visit the site.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;commit
  [#app page:&quot;Home&quot;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;the-navigation-bar&quot;&gt;The Navigation Bar&lt;/h3&gt;

&lt;h4 id=&quot;drawing-the-nav-bar&quot;&gt;Drawing the Nav Bar&lt;/h4&gt;

&lt;p&gt;While the hero image was easy, the nav bar gets its own section because it needs a little more love than a background. It needs to make a button for each page of the website, which were committed in the Subpages section, so I take all the #&lt;code class=&quot;highlighter-rouge&quot;&gt;page&lt;/code&gt; records and add a child #&lt;code class=&quot;highlighter-rouge&quot;&gt;div&lt;/code&gt; to the #&lt;code class=&quot;highlighter-rouge&quot;&gt;nav-bar&lt;/code&gt; for each of them.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  page = [#page]
  nav-bar = [#nav-bar]

bind @browser
  nav-bar.children += [#div sort: page.order, class:&quot;nav-btn&quot;, page text: page.name]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;navigation&quot;&gt;Navigation&lt;/h4&gt;

&lt;p&gt;We start on the home page, but when you click a button on the nav bar, we want to navigate to that page. This listens for a click on any nav button, whose record has a page attached to it, then sets the &lt;code class=&quot;highlighter-rouge&quot;&gt;page&lt;/code&gt; attribute of the #&lt;code class=&quot;highlighter-rouge&quot;&gt;app&lt;/code&gt; record to match the &lt;code class=&quot;highlighter-rouge&quot;&gt;page&lt;/code&gt; attribute of the button that was clicked.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search @browser @session @event
  click = [#click element:[#div page class:&quot;nav-btn&quot;]]
  view = [#app]

commit
  view.page := page.name
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;highlighting-the-active-page&quot;&gt;Highlighting the Active Page&lt;/h4&gt;

&lt;p&gt;Purely as a style issue, I want to change the background color of the nav bar button of whichever page we’re on. You could also use this block to bind a new class to &lt;code class=&quot;highlighter-rouge&quot;&gt;nav-btn&lt;/code&gt; and use CSS to set the new background color, but this is a little more terse without obfuscating the goal.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app page]
  nav-btn = [#div page class:&quot;nav-btn&quot;]

bind @browser
  nav-btn.style += [background:&quot;#606060&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;subpages-1&quot;&gt;Subpages&lt;/h3&gt;

&lt;h4 id=&quot;home-page&quot;&gt;Home Page&lt;/h4&gt;

&lt;p&gt;When the app specifies that we should be looking at the home page, the contents of this block are injected into the #&lt;code class=&quot;highlighter-rouge&quot;&gt;page-contents&lt;/code&gt; record that was bound to the browser at the start of the Page Layout section.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app page: &quot;Home&quot;]
  view = [#page-contents]

bind @browser
  view &amp;lt;- [class: &quot;main-page&quot; children:
    [#h1 text: &quot;Welcome to Crazy Mike's!&quot;]
      [#p text: &quot;Located on the scenic Pulaski Highway in East Baltimore, Crazy Mike's has the region's best selection of used electronics, and our prices are INSANE!&quot;]
    [#p text: &quot;Hours: Tue-Sat 2pm-4am&quot;]
    [#p text: &quot;Contact: (410) 768-7000, Ask for Mike&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;computers&quot;&gt;Computers&lt;/h4&gt;

&lt;p&gt;Much like the home page, when the app specifies that we want to navigate to the Computers tab, we want to inject this page into #&lt;code class=&quot;highlighter-rouge&quot;&gt;page-contents&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app page: &quot;Computers&quot;]
  view = [#page-contents]

bind @browser
  view &amp;lt;- [class: &quot;main-page&quot; children:
    [#p text: &quot;Need to compute things? We can help.&quot;]
    [#div class:(&quot;computer&quot;, &quot;pic&quot;)]
    [#p text: &quot;One of our many fine products, this War Operations Plan Response supercomputer was repossessed from the US Dept. of Defense in 1984. Comes with classic games such as chess, checkers, backgammon, poker, tic-tac-toe, and Global Thermonuclear War, though it has been known not to play. Open box, comes as-is. Strict no return policy.&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;televisions&quot;&gt;Televisions&lt;/h4&gt;

&lt;p&gt;Once more, when we navigate to the Televisions tab, it gets injected into #&lt;code class=&quot;highlighter-rouge&quot;&gt;page-contents&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app page: &quot;Televisions&quot;]
  view = [#page-contents]

bind @browser
  view &amp;lt;- [class:&quot;main-page&quot; children:
    [#p text: &quot;This is where the TVs live - get you one!&quot;]
    [#div class: &quot;tv pic&quot;]
    [#p text: &quot;Forget the internet, this baby is the real series of tubes. Perfect for your LaserDisc collection.&quot;]  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;stereos&quot;&gt;Stereos&lt;/h4&gt;

&lt;p&gt;When we navigate to the Stereos tab, it gets injected into #&lt;code class=&quot;highlighter-rouge&quot;&gt;page-contents&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search @session @browser
  [#app page: &quot;Stereos&quot;]
  view = [#page-contents]

bind @browser
  view &amp;lt;- [class: &quot;main-page&quot; children:
    [#p text: &quot;The hottest audio equipment in town!&quot;]
    [#div class: &quot;radio pic&quot;]
    [#p text: &quot;New stock arriving daily, priced to move.&quot;]
  ]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;styles&quot;&gt;Styles&lt;/h3&gt;

&lt;p&gt;A little CSS to clean things up and make the page more readable.&lt;/p&gt;

&lt;div class=&quot;language-css highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nc&quot;&gt;.app-wrapper&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;position&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;absolute&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-self&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;432px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;768px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;overflow-y&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;auto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#fff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.hero-image&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;300px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-image&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/L8suaDZ.jpg)&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cover&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.nav-bar&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;row&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;100%&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.nav-btn&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#404040&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;line-height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;50px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;color&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;#fff&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;py&quot;&gt;user-select&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;none&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;cursor&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;pointer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.main-page&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;display&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;flex&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;flex-direction&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;column&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;align-items&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;padding-top&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.main-page&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;h1&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;10px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;26px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.main-page&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;p&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;5px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;25px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;font-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;16px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;text-align&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.pic&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;margin&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;20px&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;0px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.computer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;150px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;320px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/2EbQYGA.jpg)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cover&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.tv&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;250px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;320px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/0kD08WU.jpg)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cover&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;nc&quot;&gt;.radio&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;250px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;m&quot;&gt;320px&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;sx&quot;&gt;url(http://i.imgur.com/rs1NW31.jpg)&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;center&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;no-repeat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;nl&quot;&gt;background-size&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cover&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (December 2016 - January 2017)</title>
   <link href="http://incidentalcomplexity.com/2017/02/05/december-january/"/>
   <updated>2017-02-05T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2017/02/05/december-january/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;After a long journey during the year, we closed out 2016 on a high note with the release of Eve Alpha v0.2.3, and some very exciting community engagement. We’re looking to keep the momentum going in 2017, so let’s take a look at what we’ve been doing the past couple months.
December was really a time of reflection, as we had to consider what to do with the feedback we received following the v0.2 release. Ultimately, it was pretty clear (particularly in &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/vR-4y2kJv4Q&quot;&gt;this thread&lt;/a&gt;) that general feedback aligned along three directions:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Database explorer/visualizer&lt;/li&gt;
  &lt;li&gt;Extensibility&lt;/li&gt;
  &lt;li&gt;Real-world examples&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ideally, we’d like to build a database explorer for Eve in Eve itself. Unfortunately, the v0.2.x version of Eve lacks some features that would make this possible (like the ability to introspect the compiler, treating code as records). This drove us to embark on an extensive refactor (happening on the &lt;a href=&quot;https://github.com/witheve/Eve/tree/refactor-runtime&quot;&gt;refactor-runtime brach&lt;/a&gt;), which will accomplish a couple of goals simultaneously:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Making the runtime incremental. The v0.2 runtime wastes a lot of time doing unnecessary computation. An incremental Eve runtime will be smarter about how it uses resources, computing values only when they need to be updated. This kind of optimization is already showing an order-of-magnitude improvement in performance, making Eve more practical for more resource-intensive programs.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Making the runtime extensible, meaning new ways to interface with Eve (see the Javascript DSL below, for example), and the ability to get data into and out of Eve. The Javascript DSL in particular means that you’ll be able to integrate Eve into an existing project seamlessly. From there, you can use as little or as much Eve as you want.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Making the runtime more approachable. We’re going to be re-structuring the directory layout, as well as extensively documenting each component. Furthermore, we’ll be building the runtime through pull requests, so we have a complete history of its development.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;dsl&quot;&gt;DSL&lt;/h4&gt;
&lt;p&gt;As part of the refactor, we’ve built a Javascript DSL to write Eve code. The following block is 
Javascript, but it describes an Eve block:&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;prog&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;Program&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;prog&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;block&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;simple block&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;person&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;find&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;person&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;kd&quot;&gt;let&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;    &lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;record&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;&lt;span class=&quot;na&quot;&gt;age1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;age2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;b&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;age&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;result&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;})&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt;   &lt;/span&gt; &lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;err&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;If you’re familiar with the Eve syntax, this is equivalent to:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  a = [#person]
  b = [#person]
  a.age &amp;gt; b.age
  result = a.age + b.age

commit
 [age1: a.age, age2: b.age, result]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can embed these blocks in any Javascript code, allowing you to seamlessly incorporate Eve into existing projects. Documentation is forthcoming, but in the meantime you can see more examples of the DSL in practice in the &lt;a href=&quot;https://github.com/witheve/Eve/tree/refactor-runtime/test&quot;&gt;tests folder&lt;/a&gt; of the refactor branch.&lt;/p&gt;

&lt;h4 id=&quot;eve-examples&quot;&gt;Eve Examples&lt;/h4&gt;

&lt;p&gt;While the runtime is being refactored, we will be releasing some larger-scale examples of Eve programs. We’ll start with some example mini-programs, each of which illustrate a component of a larger, more complete app. These smaller examples will be hosted on the &lt;a href=&quot;https://github.com/witheve/eve-examples&quot;&gt;witheve/eve-examples&lt;/a&gt; repository.&lt;/p&gt;

&lt;p&gt;Development of the first large-scale example is going on in the &lt;a href=&quot;https://github.com/witheve/mamarob&quot;&gt;witheve/mamarob&lt;/a&gt; repository. This example is a food truck management app, which allows a user to manage a food truck menu, take orders, accept payments, and integrate with social media. This app should cover everything you need to know in order to build your own complete Eve application. It’s not quite finished yet, but we’ll let you know when it’s complete!&lt;/p&gt;

&lt;p&gt;After that we have a couple more projects in mind, including a robot car and an operations management example. We’ll keep you updated as work on those commences.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;h4 id=&quot;eve-around-the-world&quot;&gt;Eve Around the World&lt;/h4&gt;

&lt;p&gt;We are very happy to see meetups being organized by members of the Eve community. In January we saw two meetups, one in Pittsburgh, PA and another in Copenhagen, Denmark.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pittsburgh, January 17&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ruben Niculcea organized a &lt;a href=&quot;https://www.meetup.com/Pittsburgh-Code-Supply/events/235492181/&quot;&gt;meetup&lt;/a&gt; in Pittsburgh Pennsylvania, hosted by Pittsburgh Code &amp;amp; Supply Co. The presentation was recorded, and you can view it below:&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/GRSFMLc_AfM&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Or, if you prefer you can view Ruben’s slides directly &lt;a href=&quot;https://docs.google.com/presentation/d/1honhRiF6TVWz9kGh90WG3hKWJmgRe9MhyRGoYrOFgFo/edit?usp=sharing&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can read some follow-up discussion, as well as view the results of the survey mentioned in the video &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/oBIq-KgAjSQ&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Copenhagen, January 25&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Eve meetup group in Copenhagen, founded by Zubair Quraishi, held its &lt;a href=&quot;https://www.meetup.com/evecph/events/237131433/&quot;&gt;second meetup&lt;/a&gt; in January. There was a &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/zAXkukWgEXM&quot;&gt;followup discussion&lt;/a&gt; on the mailing list as well.&lt;/p&gt;

&lt;p&gt;If you’d like to host an Eve meetup in your area, let us know how we can help. We’re very encouraged to see this kind of spontaneous engagement, so thanks again to Ruben and Zubair for making these meetups a success!&lt;/p&gt;

&lt;h4 id=&quot;eve-around-the-web&quot;&gt;Eve Around the Web&lt;/h4&gt;

&lt;p&gt;&lt;a href=&quot;https://twitter.com/liron&quot;&gt;Liron Shapira&lt;/a&gt;, finished his six-part series on Eve with a post titled &lt;a href=&quot;https://hackernoon.com/why-eve-will-be-perfect-for-realtime-apps-92b965b80ad#.sl1fmo2hv&quot;&gt;“Eve will be perfect for realtime apps”&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Finally, William Taysom wrapped up his &lt;a href=&quot;https://groups.google.com/forum/#!searchin/eve-talk/%22Puzzles$20$26$20Paradoxes%22%7Csort:date&quot;&gt;&lt;em&gt;Puzzles and Paradoxes&lt;/em&gt; series&lt;/a&gt; on the mailing list. In total, there are 24 puzzles, which highlight some of the surprising or interesting corners of the Eve language.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Alpha v0.2.3</title>
   <link href="http://incidentalcomplexity.com/2016/12/12/release-0.2.3/"/>
   <updated>2016-12-12T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2016/12/12/release-0.2.3/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;We released v0.2.2 just last week, and already we’re bumping the version number again, probably for the last time before we take a long-needed Holiday break. To recap, in v0.2.2 we added support for the Eve npm package, which adds the ability to use project workspaces, run stand-alone Eve apps, and run Eve in server execution mode. Read the &lt;a href=&quot;http://incidentalcomplexity.com/2016/12/06/november/&quot;&gt;November Dev Diary&lt;/a&gt; for a closer look at these recent changes.&lt;/p&gt;

&lt;h3 id=&quot;whats-new-in-eve-alpha-v023&quot;&gt;What’s new in Eve Alpha v0.2.3?&lt;/h3&gt;

&lt;p&gt;Eve Alpha v0.2.3 includes these changes, and &lt;a href=&quot;https://github.com/witheve/Eve/releases/tag/v0.2.3&quot;&gt;more&lt;/a&gt;. Let’s see what’s new:&lt;/p&gt;

&lt;h4 id=&quot;share-eve-programs-with-gist&quot;&gt;Share Eve Programs with Gist&lt;/h4&gt;

&lt;p&gt;You can now share and load Eve programs with a link. There are two new icons in the editor at the top of the navigation pane: “Save to Gist” on the left, and “Load from Gist”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/saveload.PNG&quot; alt=&quot;new editor buttons&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Clicking the “Save to Gist” button will upload your Eve program to a new &lt;a href=&quot;https://help.github.com/articles/about-gists/&quot;&gt;Gist&lt;/a&gt; and provide you with a link to it:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/savegist.gif&quot; alt=&quot;save to gist&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You can copy this link and send it to a friend, who can then load your program using the “Load from Gist” button. Clicking this button will reveal an input box, into which you can paste Gist links:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/loadgist.gif&quot; alt=&quot;load from gist&quot; /&gt;&lt;/p&gt;

&lt;p&gt;When you load a Gist, you get a local copy of the linked Eve program. Any edits to this program will be made locally, and saved in your project workspace.&lt;/p&gt;

&lt;p&gt;A nice feature here is that you can share Eve programs with friends new to Eve using &lt;a href=&quot;http://play.witheve.com&quot;&gt;play.witheve.com&lt;/a&gt;. Save your Eve program to Gist as normal, then load it at play.witheve.com. Now copy the address, and send it to anyone! Anyone with the link can load your program and run it in the browser, without any setup.&lt;/p&gt;

&lt;p&gt;Note, that saving to Gist saves a snapshot of you code at the time the link is generated. If you update your code, you’ll need to generate a new link to reflect the changes.&lt;/p&gt;

&lt;h4 id=&quot;embed-css-directly-in-eve-programs&quot;&gt;Embed CSS Directly in Eve Programs&lt;/h4&gt;

&lt;p&gt;With a big thanks to the work of &lt;a href=&quot;https://github.com/witheve/eve/pull/580&quot;&gt;dwsmorris&lt;/a&gt;, you can embed CSS blocks into Eve documents. In the editor, you can create CSS blocks with the WYSIWYG toolbar:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/embeddedcss.gif&quot; alt=&quot;css blocks&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In a text editor, you can specify a css block in the info string&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve-document&quot;&gt;# CSS blocks

Print a greeting

```
commit @browser
  [#div class: &quot;greeting&quot; text: &quot;Hello World&quot;]
```

style the greeting

```css
.greeting {
  color: #FF0000;  
}
```
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;standard-library&quot;&gt;Standard Library&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;Added &lt;a href=&quot;http://docs.witheve.com/handbook/math/fix/&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;fix[]&lt;/code&gt;&lt;/a&gt; function (thanks &lt;a href=&quot;https://github.com/Cormac-Williams&quot;&gt;@Cormac-Williams&lt;/a&gt;!)&lt;/li&gt;
  &lt;li&gt;Added &lt;a href=&quot;http://docs.witheve.com/handbook/strings/join/&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;join[]&lt;/code&gt;&lt;/a&gt; aggregate&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;contributors&quot;&gt;Contributors&lt;/h3&gt;

&lt;p&gt;Thanks to our contributors for this release!&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/asampal&quot;&gt;asampal&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/shamrin&quot;&gt;shamrin&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/bd82&quot;&gt;bd82&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/brainopia&quot;&gt;brainopia&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/Cormac-Williams&quot;&gt;Cormac-Williams&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/anfedorov&quot;&gt;anfedorov&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/dwsmorris&quot;&gt;dwsmorris&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/asolove&quot;&gt;asolove&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/frankier&quot;&gt;frankier&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/convolvatron&quot;&gt;convolvatron&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/pithub&quot;&gt;pithub&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/ericathegreat&quot;&gt;ericathegreat&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (November 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/12/06/november/"/>
   <updated>2016-12-06T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2016/12/06/november/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;With the launch of Eve v0.2 at the end of October, the early weeks of November were spent reacting and responding to feedback from new users to the ever-growing Eve community. Still, we managed to make some pretty big changes to Eve this month, so let’s get right to it!&lt;/p&gt;

&lt;h3 id=&quot;whats-new-in-eve-alpha-v022&quot;&gt;What’s new in Eve Alpha v0.2.2?&lt;/h3&gt;

&lt;p&gt;We’re starting to become more serious about version numbers and releases, but we don’t have a fixed release schedule yet. This release was triggered by the addition of the Eve npm package, which adds enough features to Eve that it’s worth highlighting them. For a full list of changes in v0.2.2, check out the [release notes][1.1]. We’ve got several highly requested features in there for you. Let’s take a look at those in detail.&lt;/p&gt;

&lt;h4 id=&quot;eve-npm-package&quot;&gt;Eve npm package&lt;/h4&gt;

&lt;p&gt;We published &lt;a href=&quot;https://www.npmjs.com/package/witheve&quot;&gt;a package&lt;/a&gt; for Eve on npm, so you can now install Eve like so:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;npm install -g witheve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will give you a global Eve installation that you can invoke with the command &lt;code class=&quot;highlighter-rouge&quot;&gt;eve&lt;/code&gt; from anywhere. Doing so will start an Eve server, in the same way &lt;code class=&quot;highlighter-rouge&quot;&gt;npm start&lt;/code&gt; currently does. (Note: be sure to install &lt;code class=&quot;highlighter-rouge&quot;&gt;witheve&lt;/code&gt;, as installing &lt;code class=&quot;highlighter-rouge&quot;&gt;eve&lt;/code&gt; will give you a different package)&lt;/p&gt;

&lt;h4 id=&quot;workspaces&quot;&gt;Workspaces&lt;/h4&gt;

&lt;p&gt;We’re introducing the ability to run Eve in a custom project workspace. To create a new Eve project workspace, create a folder with an empty file named &lt;code class=&quot;highlighter-rouge&quot;&gt;package.json&lt;/code&gt; then start Eve from within this folder. Eve recognizes that it’s starting in an Eve project, and will serve *.eve files from within this directory instead of the Eve examples folder. Furthermore, you can serve various assets, like images or CSS, by placing them in an “assets” sub-folder.&lt;/p&gt;

&lt;h4 id=&quot;server-mode&quot;&gt;Server Mode&lt;/h4&gt;

&lt;p&gt;Now, Eve can be started in server mode using the &lt;code class=&quot;highlighter-rouge&quot;&gt;--server&lt;/code&gt; flag:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;eve --server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without this flag, execution of Eve programs happens within the browser, with the Eve server acting as an intermediary between the browser and your local system. In server mode, Eve will instead execute your program on the server. Currently written programs will operate exactly as before, but this is a preliminary step in order to get networked Eve applications going (like a chat server or a multiplayer game). There is still work needed to be done there (currently &lt;a href=&quot;https://github.com/witheve/Eve/pull/620&quot;&gt;in review&lt;/a&gt;), so stay tuned for more!&lt;/p&gt;

&lt;h4 id=&quot;deploying-eve-apps&quot;&gt;Deploying Eve Apps&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/npm-eve.gif&quot; alt=&quot;Eve npm&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is one of the most requested features to date, so we’re happy to bring it to you! You can now run Eve applications without the editor, which should pave the way to deploying them on your own server. You can specify which Eve program you want to run after the Eve command:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;eve ~/myEveDir/myEveFile.eve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Now you can navigate to Eve in your browser to access the specified program. If you like, you can also recover the editor with a flag:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;eve ~/myEveDir/myEveFile.eve --editor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will run the supplied Eve program with the editor visible.&lt;/p&gt;

&lt;h4 id=&quot;standard-library&quot;&gt;Standard Library&lt;/h4&gt;

&lt;p&gt;The standard library still needs a lot of work, but thanks to our intrepid community we made some great progress on adding basic functionality.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Added support for the vast majority of HTML/SVG tags (thanks &lt;a href=&quot;https://github.com/frankier&quot;&gt;@frankier&lt;/a&gt;!)&lt;/li&gt;
  &lt;li&gt;Added &lt;code class=&quot;highlighter-rouge&quot;&gt;urlencode[]&lt;/code&gt; (thanks &lt;a href=&quot;https://github.com/renegr&quot;&gt;@renegr&lt;/a&gt;!)&lt;/li&gt;
  &lt;li&gt;Achieved parity with Javascript math library functions and constants (thank &lt;a href=&quot;https://github.com/Cormac-Williams&quot;&gt;@Cormac-Williams&lt;/a&gt;!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There’s still a lot of work to do here, so let us know if you’re missing some basic functions that could easily be added.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;p&gt;It’s been a month now since the launch of Eve, and we’ve been thrilled by the response so far. It seems like I say this with every new dev diary, but every day we receive more issues, pull requests, and especially Eve programs that are getting increasingly sophisticated.&lt;/p&gt;

&lt;p&gt;With a fast growing community though, it’s tough staying on top of everything, especially with a small team like ours (we’re only 4 developers here, if you didn’t know!). Thankfully, our great community has been picking up the slack, answering questions on the mailing list, tracking down issues, identifying and implementing improvements, reviewing pull requests… the list goes on. So a very special thanks goes out to our contributors this month:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/frankier&quot;&gt;frankier&lt;/a&gt;, 
&lt;a href=&quot;https://github.com/Cormac-Williams&quot;&gt;Cormac-Williams&lt;/a&gt;,
&lt;a href=&quot;https://github.com/renegr&quot;&gt;renegr&lt;/a&gt;,
&lt;a href=&quot;https://github.com/gamebox&quot;&gt;gamebox&lt;/a&gt;, 
&lt;a href=&quot;https://github.com/mpj&quot;&gt;mpj&lt;/a&gt;, 
&lt;a href=&quot;https://github.com/olafleur&quot;&gt;olafleur&lt;/a&gt;, 
&lt;a href=&quot;https://github.com/beliharz&quot;&gt;beliharz&lt;/a&gt;, 
&lt;a href=&quot;https://github.com/yshalabi&quot;&gt;yshalabi&lt;/a&gt;,
&lt;a href=&quot;https://github.com/jonnor&quot;&gt;jonnor&lt;/a&gt;,
&lt;a href=&quot;https://github.com/esoeylemez&quot;&gt;esoeylemez&lt;/a&gt;,
&lt;a href=&quot;https://github.com/claushellsing&quot;&gt;claushellsing&lt;/a&gt;,
&lt;a href=&quot;https://github.com/gilrosenthal&quot;&gt;gilrosenthal&lt;/a&gt;,
&lt;a href=&quot;https://github.com/matthiaslange&quot;&gt;matthiaslange&lt;/a&gt;,
&lt;a href=&quot;https://github.com/pragmatrix&quot;&gt;pragmatrix&lt;/a&gt;,
&lt;a href=&quot;https://github.com/eobrain&quot;&gt;eobrain&lt;/a&gt;,
&lt;a href=&quot;https://github.com/austinlyons&quot;&gt;austinlyons&lt;/a&gt;,
&lt;a href=&quot;https://github.com/shamrin&quot;&gt;shamrin&lt;/a&gt;,
&lt;a href=&quot;https://github.com/nmsmith&quot;&gt;nmsmith&lt;/a&gt;,
&lt;a href=&quot;https://github.com/Skinney&quot;&gt;Skinney&lt;/a&gt;,
&lt;a href=&quot;https://github.com/cgarvis&quot;&gt;cgarvis&lt;/a&gt;,
&lt;a href=&quot;https://github.com/vickychijwani&quot;&gt;vickychijwani&lt;/a&gt;, and
&lt;a href=&quot;https://github.com/thomaswrenn&quot;&gt;thomaswrenn&lt;/a&gt;.&lt;/p&gt;

&lt;h4 id=&quot;developing-with-the-community&quot;&gt;Developing with the Community&lt;/h4&gt;

&lt;p&gt;Surprisingly, one of the biggest changes to happen to Eve last month was our development process. For the past two years, we’ve been developing Eve in the open on GitHub, but many day-to-day details were sequestered in the Kodowa office. This was mainly for timeliness; discussing implementation or design details face-to-face is much faster than an asynchronous discussion on GitHub. But it also meant that the community really couldn’t participate in developing with us. With the release of v0.2, all that changes, as we are being much more deliberate about making the development of Eve transparent and open. Here are the ways we’re improving our community-focused development process.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;The main Eve repository can only be updated through pull requests. This applies to everyone in the office as well, which means every change to Eve is now based in a PR that gets reviewed and tested. Hopefully this leads to higher quality code and fewer broken builds, but it also means we’re creating a log of all the work done on Eve; the changelog above is just a listing of all the PRs since the last release.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Everything is tracked in issues. If a bug is found we immediately make an issue for it. If we discuss a feature that’s needed, we make an issue for it. This way, anyone looking to contribute to Eve can come into the repository and find ways to contribute. We’re starting to label and categorize these issues, so beginners can find an appropriate issue to start working on.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;We’ll be refactoring the Eve codebase to make it more beginner friendly. Speaking of issues, that process is already tracked: [&lt;a href=&quot;https://github.com/witheve/Eve/issues/632&quot;&gt;632&lt;/a&gt;], [&lt;a href=&quot;https://github.com/witheve/Eve/issues/609&quot;&gt;609&lt;/a&gt;], [&lt;a href=&quot;https://github.com/witheve/Eve/issues/609&quot;&gt;608&lt;/a&gt;], [&lt;a href=&quot;https://github.com/witheve/Eve/issues/510&quot;&gt;510&lt;/a&gt;].&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;top-feedback-for-eve&quot;&gt;Top Feedback for Eve&lt;/h4&gt;

&lt;p&gt;Now that Eve has been in general use for a month, we’d &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/vR-4y2kJv4Q&quot;&gt;like to hear&lt;/a&gt; your top 3 pieces of feedback for Eve. This feedback can relate to the language itself, the syntax, the editor, the community, or anything else really. What’s working for you, what’s not? What’s the biggest feature you’re missing? Which feature has been the best? What’s surprised you the most? You can &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/vR-4y2kJv4Q&quot;&gt;read feedback&lt;/a&gt; others have posted in the mailing list, and be sure to add your own!&lt;/p&gt;

&lt;h4 id=&quot;puzzles--paradoxes&quot;&gt;Puzzles &amp;amp; Paradoxes&lt;/h4&gt;

&lt;p&gt;One member of the community, &lt;a href=&quot;https://github.com/wtaysom&quot;&gt;William Taysom&lt;/a&gt;, has started writing a series of posts on the mailing list looking at some of the trickier corners of Eve. For example, how do you get the count of 0 records? What does the &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; attribute do in an aggregate? Every day William is posting a new puzzle, and a solution to the previous day’s puzzle. Here are the puzzles to date:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/m3dWMdJlrpo&quot;&gt;Puzzles &amp;amp; Paradoxes I: How do you count #nothing?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/n2-A8CW1Iyg&quot;&gt;Puzzles &amp;amp; Paradoxes II: What is the PERpose?&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/BP4CP4f-RRU&quot;&gt;Puzzles &amp;amp; Paradoxes III: Overcommitted&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/7lhPSjHU3kM&quot;&gt;Puzzles &amp;amp; Paradoxes IV: Overbound&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;They’re becoming increasingly complex, so these puzzles might end up becoming a tutorial on their own.&lt;/p&gt;

&lt;h4 id=&quot;eve-around-the-web&quot;&gt;Eve Around the Web&lt;/h4&gt;

&lt;p&gt;Another member of the community, &lt;a href=&quot;https://twitter.com/liron&quot;&gt;Liron Shapira&lt;/a&gt;, has been writing a series about Eve on the website Hackernoon. It’s a 6 part series, with parts 1-5 out now:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;a href=&quot;https://hackernoon.com/how-eve-unifies-your-entire-programming-stack-900ca80c58a7&quot;&gt;How Eve unifies your entire programming stack&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hackernoon.com/when-logic-programming-meets-cqrs-1137ab2a5f86&quot;&gt;When logic programming meets CQRS&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hackernoon.com/throwing-off-our-scope-chains-7567beb2d0b6&quot;&gt;Throwing off our scope chains&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hackernoon.com/smalltalk-and-protein-programming-4da245ac93e2&quot;&gt;Smalltalk and protein programming&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://hackernoon.com/the-rock-solid-foundation-for-eves-big-vision-225b80b91e11&quot;&gt;The rock-solid foundation for Eve’s big vision&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Part 6 should be coming soon! The first post in the series got a little attention on HN, so you can &lt;a href=&quot;https://news.ycombinator.com/item?id=13010396&quot;&gt;read the comments&lt;/a&gt; if you’re interested.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (October 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/11/18/october/"/>
   <updated>2016-11-18T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2016/11/18/october/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;http://play.witheve.com&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;http://incidentalcomplexity.com/2016/10/05/september/&quot;&gt;September&lt;/a&gt;, we were busy prepping for the launch of Eve. This work carried over into October, and we released Eve v0.2 on October 28. Thank you to everyone who gave Eve a try and sent us your comments and criticisms. We’ve read hundreds of comments on &lt;a href=&quot;https://news.ycombinator.com/item?id=12817468&quot;&gt;HN&lt;/a&gt;, Reddit, and the mailing list, so November is really focused on how to address these and what the right path forward for Eve is. But first let’s talk more about what we did in October!&lt;/p&gt;

&lt;h3 id=&quot;eve-alpha-v02&quot;&gt;Eve alpha v0.2&lt;/h3&gt;

&lt;p&gt;Again, the biggest news from October was the &lt;a href=&quot;https://github.com/witheve/Eve/releases/tag/v0.2.1&quot;&gt;release&lt;/a&gt; of Eve v0.2 (alpha) into the wild. We put up a lot of content on &lt;a href=&quot;http://programming.witheve.com&quot;&gt;programming.witheve.com&lt;/a&gt; explaining our vision, the major highlights of Eve, and some &lt;a href=&quot;http://programming.witheve.com/deepdives/lighttable.html&quot;&gt;discussion&lt;/a&gt; on how we got to where we are.
We also made a nice video, showing how we think Eve could be useful in a development context.&lt;/p&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/TWAMr72VaaU?rel=0&amp;amp;controls=0&amp;amp;showinfo=0&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;Key features demonstrated in this video are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;a href=&quot;http://programming.witheve.com/deepdives/literate.html&quot;&gt;literate programming&lt;/a&gt; environment for Eve - with the Table of Contents, document-like WYSIWYG editing experience, and live application view&lt;/li&gt;
  &lt;li&gt;The inspector -  a debugging tool that lets you introspect and debug your program as it runs. The inspector is discussed more below.&lt;/li&gt;
  &lt;li&gt;Views - allow you to visualize the result of a block below the actual block. So far you can view text and various charts and graphs. We’ll be adding more views in the future. More on this below.&lt;/li&gt;
  &lt;li&gt;State loading - save and load the state of a running Eve application. This is useful in a bug report/debugging scenario. If you encounter a bug, you can save the state of the program and send it to another developer, who will see exactly the state of the application that you see.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;As we teased last month, the Eve platform has moved over to a TypeScript codebase. This was really a tactical move more than anything else. One of the main motivating factors was that with TypeScript we could run Eve in the browser without any setup. Providing a zero friction programming experience is what we are trying to do, and there was a lot of friction with the C runtime. The TS runtime will act as a reference implementation, so Eve can be implemented in other languages and work as a cohesive system.&lt;/p&gt;

&lt;h4 id=&quot;roadmap&quot;&gt;Roadmap&lt;/h4&gt;

&lt;p&gt;Let’s take a look at the platform roadmap, which provides a general direction for where we are headed:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Milestone 1: Programming for humans (We are here)&lt;/strong&gt; - This milestone is about the language, semantics, syntax, and editor – the basis of Eve on which everything else will be built. Right now we’re focusing on fleshing out the langauge, building the standard library, defining what it means to work with Eve for a project, figuring out how Eve fits in with existing projects, connecting Eve to different data sources, deploying Eve programs, etc.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Milestone 2: The World Scale Computer&lt;/strong&gt; - Eve is a meant to be a distributed system by default. We’ve left those features out of the 0.2 release, but the next big release will be about how Eve programs scale and distribute to multiple machines.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Milestone 3: Computation for all&lt;/strong&gt; - This final milestone is the furthest out, requiring us to revisit our &lt;a href=&quot;https://github.com/witheve/eve-experiments&quot;&gt;experimental work&lt;/a&gt; in end-user computing, and turning that into a real product for non-programmers. We’ve explored many ideas here, some more promising than others, but we still don’t have the right answer for what this looks like. So, we’ll be doing a lot more research before we can complete this milestone. One thing to note here is that we’re not calling this milestone “programming for all”. That’s intentional, for two reasons:&lt;/p&gt;

    &lt;p&gt; 1. We don’t believe a product like this will resemble programming as it exists today. Will it be &lt;a href=&quot;http://incidentalcomplexity.com/2015/10/15/jul-sept/&quot;&gt;graphs&lt;/a&gt;? A &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/03/oct-nov/&quot;&gt;grid&lt;/a&gt;? A &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/10/jan-feb/&quot;&gt;wiki&lt;/a&gt;? We’re not sure, but it will be exciting to find out.&lt;/p&gt;

    &lt;p&gt; 2. Most people don’t actually want to program. We don’t anticipate that the general population will want to use Eve to write traditional applications. Instead, we think Eve will be appealing to them for its ability to aggregate, transform, and distribute data to answer questions. Today, these are tasks you have need an experienced developer to accomplish. We don’t think it has to be that way.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;editor&quot;&gt;Editor&lt;/h4&gt;
&lt;p&gt;The biggest changes to the platform were in the editor. We’ve already looked at the table of contents and the editing experience, which have been polished a little more since September. Let’s look at some other changes though:&lt;/p&gt;

&lt;h5 id=&quot;the-inspector&quot;&gt;The Inspector&lt;/h5&gt;

&lt;p&gt;The inspector is activated via the magic wand icon at the top of the editor. This toggles inspection mode, which allows you to click on any block in your program or element in your application, and get some info about it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://witheve.com/images/zoom.png&quot; alt=&quot;Eve Inspector&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The inspector tool is a sort of one-stop-shop for all your debugging needs. If an area of your program isn’t displaying, the inspector can tell you why. If you see too many elements (or too few), the inspector will tell you how they came to be. If your program is running slowly, the inspector will tell you which blocks are consuming the most processing time:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://witheve.com/images/slow.png&quot; alt=&quot;Performance&quot; /&gt;&lt;/p&gt;

&lt;h5 id=&quot;views&quot;&gt;Views&lt;/h5&gt;

&lt;p&gt;Up to this point we’ve been using &lt;code class=&quot;highlighter-rouge&quot;&gt;bind @browser [#div text]&lt;/code&gt; as a sort of &lt;code class=&quot;highlighter-rouge&quot;&gt;console.log()&lt;/code&gt; for Eve. This process is pretty antithetical to Eve, when you think about it. First, we’ve known for a long time now that drawing the result of a computation &lt;em&gt;spatially near&lt;/em&gt; the computation is very powerful for debugging. Second, many things you don’t want to visualize as text. You can’t &lt;code class=&quot;highlighter-rouge&quot;&gt;console.log()&lt;/code&gt; a bar-graph, for example.
Enter views. Views are a way to visualize a block’s output right under the block itself. By writing data into the &lt;code class=&quot;highlighter-rouge&quot;&gt;@view&lt;/code&gt; database, you can visualize it as chart, or even a time-series:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://witheve.com/images/memory.gif&quot; alt=&quot;data over time&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And of course we support plain text views:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://witheve.com/images/openhttp.png&quot; alt=&quot;Text view&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The nice thing about both the inspector and views is that they are implemented entirely in Eve! The following links open in the Eve editor:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#/examples/analyzer.eve&quot;&gt;The analyzer&lt;/a&gt; (drives the inspector)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#/examples/inspector.eve&quot;&gt;The inspector&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#/examples/view.eve&quot;&gt;Views&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://play.witheve.com/#/examples/editor.eve&quot;&gt;Editor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;p&gt;First, I’d like to say the response to Eve has been fantastic. The mailing list has seen a lot more activity and a 30% increase in membership since the launch, which is great. Beyond the volume though, we’ve also gotten some very detailed and thorough proposals, comments, pull requests, and bug reports. Hopefully we can keep up this momentum, so spread the word!&lt;/p&gt;

&lt;h4 id=&quot;handbook&quot;&gt;Handbook&lt;/h4&gt;

&lt;p&gt;The Eve handbook has been moved to &lt;a href=&quot;http://docs.witheve.com&quot;&gt;docs.witheve.com&lt;/a&gt;. The style now matches the Eve editor more closely, and you can now start to imagine how docs and Eve can work side by side. As always, there is an endless amount of work to do here, so keeping the docs up to date will be an ongoing process. If you find any docs that are missing, outdated, or insufficient, please let us know by submitting an issue here: https://github.com/witheve/docs/issues.&lt;/p&gt;

&lt;h4 id=&quot;eve-around-the-web&quot;&gt;Eve Around the Web&lt;/h4&gt;

&lt;p&gt;We made a little splash on the web that generated some discussions and stories. Here are the launch day discussion threads:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://news.ycombinator.com/item?id=12817468&quot;&gt;Hackernews&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/programming/comments/59vddn/eve_programming_designed_for_humans/&quot;&gt;/r/programming&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.reddit.com/r/compsci/comments/59x0b3/eve_programming_designed_for_humans/&quot;&gt;/r/compsci&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.producthunt.com/posts/eve-4&quot;&gt;ProductHunt&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And even better, some user-generated videos and blogs about Eve! These were fascinating to read and watch, so thanks everyone for taking the time to make these.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://medium.com/@arnia/modelling-domains-declaratively-with-eve-a1eb93b80942#.ulaiisb2b&quot;&gt;Joe Geldart&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=9nnmT3zf1yg&quot;&gt;Erik Hanchett&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.youtube.com/watch?v=aJpBYow99Ag&quot;&gt;Fun Fun Function&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://vickychijwani.me/eve/&quot;&gt;Vicky Chijwani&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
 </entry>
 
 <entry>
   <title>Dev Diary (September 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/10/05/september/"/>
   <updated>2016-10-05T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/10/05/september/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When we last left off in &lt;a href=&quot;http://incidentalcomplexity.com/2016/08/31/august/&quot;&gt;August&lt;/a&gt;, we were iterating on the just-released community preview. In September, we improved the editor, worked on documentation, made some adjustments to the language, and also put Eve up on the Web.&lt;/p&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;h4 id=&quot;editor&quot;&gt;Editor&lt;/h4&gt;

&lt;p&gt;A lot of work has gone into imagining the editing experience for Eve. Here is &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/examples/tic-tac-toe.eve&quot;&gt;Tic-Tac-Toe&lt;/a&gt; opened in the editor:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/editor.png&quot; alt=&quot;Eve editor&quot; /&gt;&lt;/p&gt;

&lt;p&gt;On the left we display the table of contents, in the center is the rendered program, and on the right is an area for comments. Let’s look at each one in turn:&lt;/p&gt;

&lt;h5 id=&quot;table-of-contents&quot;&gt;Table of Contents&lt;/h5&gt;

&lt;p&gt;The table of contents (TOC) is one of the more interesting features of the editor. The TOC is generated using the headers in the document, which allows you to bookmark key sections of the program. Clicking on an entry in the TOC moves the corresponding section into focus, so this is a nice way to navigate through a larger program.&lt;/p&gt;

&lt;p&gt;But we can go one step beyond this. One criticism of &lt;a href=&quot;https://witheve.github.io/docs/handbook/literate-programming/&quot;&gt;literate programs&lt;/a&gt; is that an ordering that makes narrative sense doesn’t necessarily make sense while editing a program. For example, in Tic-Tac-Toe, we talk about winning the game in two entirely different sections. That’s okay - instead of jumping around between sections, we can display only the sections we care about:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/markdown-elision.gif&quot; alt=&quot;Eve editor elision&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Now the editing experience is customized to the task at hand. This opens up some interesting possibilities, like being able to save and share these views, or generating customized views based on a query. For example, during a code review you might want to see all blocks modified by Steve in the last week. Something like that is further down the line, but it’s nonetheless an interesting possibility.&lt;/p&gt;

&lt;h5 id=&quot;document-editing&quot;&gt;Document Editing&lt;/h5&gt;

&lt;p&gt;We’ve improved the editing experience with in-browser WYSIWYG support. One of the slight drawbacks of being &lt;a href=&quot;http://incidentalcomplexity.com/2016/08/31/august/#eve-and-markdown&quot;&gt;CommonMark compatible&lt;/a&gt; is having to type code fences for every block of code. Not only is this sometimes tedious, but backticks and tildes are not even on some international keyboards. Fear not: if you write code in our editor (and we hope you will, but you don’t have to) you can create a code block with a nifty shortcut. Furthermore, since we render Markdown in the editor, the code fences don’t clutter your code.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/editor2.png&quot; alt=&quot;Eve editor&quot; /&gt;&lt;/p&gt;

&lt;h5 id=&quot;comments&quot;&gt;Comments&lt;/h5&gt;

&lt;p&gt;Finally, the editor has an area for comments. These aren’t code comments (although maybe they could be, we just don’t know how well that would work yet). Rather, you can think of this area as a place for collaborative comments from team members, similar to Google Docs. This area can also contain warnings and errors from the Eve compiler:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/comments.jpg&quot; alt=&quot;Eve editor comments&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, you can see a compiler error displayed next to the block that generates it. It’s not hooked up here, but we’ve shown previously how errors like this can be &lt;a href=&quot;http://incidentalcomplexity.com/2016/08/03/july/#error-handling&quot;&gt;fixed automatically&lt;/a&gt; with the click of a button. We’ll be incorporating more of those ideas in the next month.&lt;/p&gt;

&lt;h4 id=&quot;eve-on-the-web&quot;&gt;Eve on the Web&lt;/h4&gt;

&lt;p&gt;Another big development this month is a version of &lt;a href=&quot;https://github.com/witheve/Eve/tree/ts-merge&quot;&gt;Eve written in TypeScript&lt;/a&gt;. This has the notable advantage over the C/Lua version of being able to work on every platform, including Windows. Also, in this version we’ve started to add some debugging tools. Here’s an example of a performance report, which displays performance statistics for each block:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/perf.png&quot; alt=&quot;perf&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’ve also added some &lt;a href=&quot;https://github.com/witheve/Eve/tree/ts-merge/test&quot;&gt;testing facilities&lt;/a&gt; for language-level sanity checks:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/tests.png&quot; alt=&quot;testing&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’ll have a lot more to talk about on this front in a couple of weeks, so stay tuned.&lt;/p&gt;

&lt;h4 id=&quot;word-choice-adjustments&quot;&gt;Word Choice Adjustments&lt;/h4&gt;

&lt;p&gt;In August, we tentatively settled on the term “context” in place of “bag” to describe a collection of facts. After testing “context” for a couple weeks, we came to the conclusion that it just wasn’t the right word; it didn’t adequately describe the underlying concept, and thus it was misleading to some people. Instead, we’ve decided on “database”, which is a much more obvious and standard choice. We’ve found less confusion in using this word, so it seems like a win so far. Let us know what you think over at the &lt;a href=&quot;https://github.com/witheve/rfcs/issues/4&quot;&gt;syntax RFC&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;We also decided to rename &lt;code class=&quot;highlighter-rouge&quot;&gt;match&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;search&lt;/code&gt;. Match was supposed to evoke the idea of pattern matching against data. This wasn’t clear to some people, and we’ve found that search is more intuitive.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bag -&amp;gt; context -&amp;gt; database
match -&amp;gt; search
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;changing-the-meaning-of-&quot;&gt;Changing the meaning of &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt;&lt;/h4&gt;

&lt;p&gt;We’ve been using &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; as a shortcut for the name attribute on records. For example, instead of writing &lt;code class=&quot;highlighter-rouge&quot;&gt;[name: &quot;Corey&quot;]&lt;/code&gt; you could write &lt;code class=&quot;highlighter-rouge&quot;&gt;[@Corey]&lt;/code&gt;. However, we’ve decided to remove this shortcut for several reasons. First, after writing more applications in Eve, we’ve found that the name attribute isn’t actually commonly used, so a shortcut doesn’t save that many characters. Furthermore, the tag shortcut ( &lt;code class=&quot;highlighter-rouge&quot;&gt;#&lt;/code&gt; ) can be used instead with the same effect. Finally, the semantics of &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; in Eve are different from &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; in other contexts; whereas &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; resolves to a unique username on Twitter and Github, &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; in Eve could match against multiple records. After all, name is just an attribute like any other.&lt;/p&gt;

&lt;p&gt;Therefore, we’re removing that sugar, and instead we’ll be using &lt;code class=&quot;highlighter-rouge&quot;&gt;@&lt;/code&gt; exclusively to reference databases. If you recall, databases are containers of facts. You can perform actions, like searching or binding, on one or more databases. With the removal of the name shortcut, we can now treat databases as first-class citizens of the Eve language:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
  db = if [#foo] then @db1
       else @db2

bind db
  [#bar]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, we’re assigning a database to a variable based on a condition. If the condition is satisfied, &lt;code class=&quot;highlighter-rouge&quot;&gt;[#bar]&lt;/code&gt; is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;@db1&lt;/code&gt;. If the condition is not satisfied, &lt;code class=&quot;highlighter-rouge&quot;&gt;[#bar]&lt;/code&gt; is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;@db2&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;p&gt;We’ve been a little quiet on the blog, but community efforts are still abound! Most of the community-focused work in September went toward building out our documentation and guides.&lt;/p&gt;

&lt;h4 id=&quot;handbook&quot;&gt;Handbook&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/docs.png&quot; alt=&quot;Eve Docs&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We’ve put a lot of work into &lt;a href=&quot;https://github.com/witheve/docs&quot;&gt;witheve/docs&lt;/a&gt;. The handbook now has a lot more content, and can be &lt;a href=&quot;https://witheve.github.io/docs&quot;&gt;browsed on the web&lt;/a&gt;. In October, we’ll be making improvements with a focus on styling and completeness.&lt;/p&gt;

&lt;h4 id=&quot;quick-start-guide&quot;&gt;Quick Start Guide&lt;/h4&gt;

&lt;p&gt;The quick start guide is coming along nicely. It’s gone through a few iterations of user feedback, and we’d like to hear from a wider audience. The guide starts by showing you “Hello World!” in Eve, and from there slowly introduces language concepts until you have the tools to write a simple web app. We hope you’ll &lt;a href=&quot;https://witheve.github.io/docs/guides/quickstart/&quot;&gt;give it a read&lt;/a&gt; and let us know how it can be improved.&lt;/p&gt;

&lt;p&gt;That’s all for September. But as I said earlier, we have some exciting stuff in the pipeline for October. As always, we hope you give Eve a try and tell us what you think on the &lt;a href=&quot;https://groups.google.com/forum/#!forum/eve-talk&quot;&gt;mailing list&lt;/a&gt;!&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Dev Diary (August 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/08/31/august/"/>
   <updated>2016-08-31T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/08/31/august/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;This post has been updated. See the original &lt;a href=&quot;https://github.com/Kodowa/incidentalcomplexity/blob/6d461b59f7530ade2225a24f8bcc01b4eb1d8fc9/_posts/2016-08-31-august.md&quot;&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(Eve is a new programming language, and this is our development blog. If you’re new to Eve, &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;start here&lt;/a&gt;)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The majority of August was spent adding language features, fixing bugs, writing documentation, and listening/responding to community feedback. We did a lot this month, so this update is going to be a long one.&lt;/p&gt;

&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;The Eve platform saw rapid improvements over the last month as we quickly responded to user feedback. As is the case when all projects are set loose in the wild, we encountered stability, performance, and usability concerns almost immediately. Let’s take a look at all of the work put into the Eve platform first.&lt;/p&gt;

&lt;h4 id=&quot;word-choice-adjustments&quot;&gt;Word Choice Adjustments&lt;/h4&gt;

&lt;p&gt;Surprisingly, one of the most difficult aspects of developing a language is deciding on the words and verbiage used to describe Eve concepts. Choosing the wrong words can alienate users and make things more confusing than they need to be. Therefore, we’ve spent countless hours looking through thesauruses and dictionaries for the perfect words. In presenting the language to new users, we’ve learned some of the choices that made sense to us didn’t make sense to others. For instance, we used to talk about “freezing”, but community feedback suggested that word didn’t provide an intuition for how that command actually worked.&lt;/p&gt;

&lt;p&gt;For anyone following our development, but not following the &lt;a href=&quot;https://github.com/witheve/rfcs/issues/4&quot;&gt;Syntax RFC discussion&lt;/a&gt;, we’ve made the following adjustments to how we talk about Eve:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;freeze   -&amp;gt; commit
maintain -&amp;gt; bind
object   -&amp;gt; record
bag      -&amp;gt; database
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;new-function-syntax&quot;&gt;New Function Syntax&lt;/h4&gt;

&lt;p&gt;Whereas most languages use functions to accomplish code-reuse, Eve takes a different route; our records obviate the need for most functions. Therefore, we don’t fully support user defined functions at the moment. Nonetheless, functions are useful for primitive operations, like math or string manipulation. Thus, we adjusted our function syntax to look a little more like the record syntax.&lt;/p&gt;

&lt;p&gt;Let’s look at the sine function:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;y = sin[degrees: 90]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The first thing to notice are the square brackets. These are reminiscent of the record syntax, which also uses square brackets. That’s because a function call is really just sugar for:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[@sin #function degrees: 90 value]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;which is a record like any other. The new function syntax uses the &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; attribute as an 
implicit return, so functions can be inlined into expressions.&lt;/p&gt;

&lt;p&gt;The second thing to notice is that arguments are explicitly defined at the call site. This has several nice properties. First, it makes code more readable and self-documenting; any reader of the program unfamiliar with the function arguments can read them where the function is called, without having to look up documentation. Second, explicit arguments allow a nice mechanism to provide alternative arguments. For instance, we could use the sine function with a radian input:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;y = sin[radians: angle]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reader of this program doesn’t need to guess if the input is radians or degrees. One interesting thing you can do with this is add custom arguments to existing functions. In this example, we create a new coordinate system that takes angles in “fun-degrees”:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt; match
    return = sin[angle: value? / 2 + 30]
 bind
    sin[fun-degrees: value?, return]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And then we can use the new argument the same way we use the default arguments:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt; match
    answer = sin[fun-degrees: 40]
 bind
    [#div text: answer]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, this syntax allows for optional arguments. For instance, in the case of &lt;code class=&quot;highlighter-rouge&quot;&gt;count&lt;/code&gt;, the &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; argument is optional. So we can use count in the following ways:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;y = count[given: students]
y = count[given: students, per: grade]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;databases&quot;&gt;Databases&lt;/h4&gt;

&lt;p&gt;We’ve started thinking more about how modularity will work in Eve. For a while now, we’ve had a concept of “databases” (formerly bags), which are just containers of facts. So far, we’ve only exposed two databases: a default “session” database and a “global” database. The global database was exposed to users via &lt;code class=&quot;highlighter-rouge&quot;&gt;commit global&lt;/code&gt;, which directed committed records to a global database accessible by any session on the server.&lt;/p&gt;

&lt;p&gt;In the &lt;a href=&quot;https://github.com/witheve/Eve/tree/modularity&quot;&gt;modularity branch&lt;/a&gt;, we’ve opened up the ability to send facts to and select facts from specific databases. For instance, until now a committed &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; was implicitly directed to a special browser database. Now, if you want to render something in the browser you’ll have to tell Eve to put it there explicitly:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;commit @browser
  [#div text: &quot;some text&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Databases are specified after one of the three actions: &lt;code class=&quot;highlighter-rouge&quot;&gt;match&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;commit&lt;/code&gt;, or &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt;. If no database is specified, the database is implicitly a default session database. You can even work with multiple databases at once:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;match (@my-database, @your-database)
  [#person name]
bind
  [#div text: ]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This would select every &lt;code class=&quot;highlighter-rouge&quot;&gt;#person&lt;/code&gt; from two different databases, essentially merging two databases.&lt;/p&gt;

&lt;p&gt;With this mechanism in place, we can start to talk about how modularity and libraries will work in Eve. For instance, I could create a custom math library, and what I would distribute is a database. Then anyone who wants to use my custom math would do the following:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;match @custom-math-lib
  ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We still have a lot of work to do here, so this feature is not available on the master branch yet. Stay tuned for an RFC coming next month on modularity.&lt;/p&gt;

&lt;h4 id=&quot;talking-with-the-outside-world&quot;&gt;Talking with the outside world&lt;/h4&gt;

&lt;p&gt;Eve cannot thrive in isolation, so we need a way to communicate with the outside world. We’ve done some work on this front, adding the ability to read/write files, handle JSON (opening up the ability to interact with any JSON compatible API), and handle HTTP requests. This work is available in the &lt;a href=&quot;https://github.com/witheve/Eve/tree/process&quot;&gt;process branch&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What’s nice about our solution here is that interacting with the outside world doesn’t look or feel any different than interacting exclusively within Eve; you still match and modify records, except the facts in those records originate from external sources. If you’ve been using Eve, then you’re already interacting with the browser through changing the DOM and handling events like clicks and keypresses.&lt;/p&gt;

&lt;p&gt;Eric has been working on a little &lt;a href=&quot;https://github.com/witheve/Eve/blob/5b49dbbb0b6d02a305a1efeebc39923239627634/examples/http-server.eve&quot;&gt;HTTP file server&lt;/a&gt; written in Eve. It’s still a work in progress, but the functionality to accept requests and serve files is already in place. Take a look at how an HTTP request is handled:&lt;/p&gt;

&lt;p&gt;Start path resolution&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;  match
     r = [#http-request]
     split[text: r.request.url, token, index, by: &quot;/&quot;]
     fr = [#root]
  bind
     [#path index: 1, file: fr]
     [#path index token]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Resolve a path&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;match
    [#path index: pindex, file: pfile]
    f = pfile.child
    child = [#path index: (pindex + 1), token: f.name]
bind
    child.file := f
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After some more work to determine the requested file is available, then we can send a response:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-old-eve&quot;&gt;match
    r = [#request-object extension file connection]
    ct = [#content-type suffix: extension]
commit
  connection.response := [
      content: file.contents
      status: &quot;200&quot;
      reason: &quot;OK&quot;
      header: [Content-Type:ct.type]]
  r := none
bind 
  r.completed := true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You’ll see here that we are interacting with both an external &lt;code class=&quot;highlighter-rouge&quot;&gt;#http-request&lt;/code&gt;, and the file system through &lt;code class=&quot;highlighter-rouge&quot;&gt;#path&lt;/code&gt;. Again, what’s notable is that despite interacting with data external to Eve, the code is written as if you were working entirely within the boundaries of Eve. You can check out the &lt;a href=&quot;https://github.com/witheve/Eve/blob/5b49dbbb0b6d02a305a1efeebc39923239627634/examples/http-server.eve&quot;&gt;full program&lt;/a&gt; to see the rest of the implementation details.&lt;/p&gt;

&lt;h4 id=&quot;syntax-highlighting&quot;&gt;Syntax Highlighting&lt;/h4&gt;

&lt;p&gt;We added syntax highlighting to the built-in editor!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/syntax-highlighting.png&quot; alt=&quot;Eve Syntax Highlighting&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;eve-and-markdown&quot;&gt;Eve and Markdown&lt;/h4&gt;

&lt;p&gt;One key feature of the Eve programming model is that the order of statements doesn’t matter. A nice implication of this property is that we can write Eve code in an order that makes sense for a human, as opposed to writing code in an order that is imposed by the compiler or runtime. This idea is the basis for &lt;a href=&quot;https://en.wikipedia.org/wiki/Literate_programming&quot;&gt;literate programming&lt;/a&gt;, a practice for writing programs introduced by Donald Knuth in 1981. The idea behind literate programming is to treat a program as a document of prose written to a human audience, with code interspersed throughout. In writing this way, a programmer can use prose and formal methods to reinforce one another, leading to programs that are (in principle) easier to maintain. We talk about some of the benefits of literate programming &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#program-structure&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/EveMD.png&quot; alt=&quot;Eve Syntax Highlighting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Whereas other literate programming implementations require a “tangle” step to turn a literate program into a compilable program, Eve’s semantics mean a &lt;code class=&quot;highlighter-rouge&quot;&gt;*.eve&lt;/code&gt; file can be rendered as markdown or executed by Eve without any additional compilation steps. We accomplish this by being &lt;a href=&quot;http://commonmark.org/&quot;&gt;CommonMark&lt;/a&gt; compatible; Eve programs are written just as you would write any markdown document, but code blocks containing Eve code are actually executable.&lt;/p&gt;

&lt;p&gt;We’ve written a few literate programs this way. If you follow our blog, you’ve already seen some of them:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://incidentalcomplexity.com/2016/08/11/tic-tac-toe/&quot;&gt;Tic-Tac-Toe&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://incidentalcomplexity.com/2016/08/19/todoMVC/&quot;&gt;TodoMVC&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://incidentalcomplexity.com/2016/08/23/flappy-eve/&quot;&gt;FlappyBird&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each of these blog posts are executable Eve programs “as-is”; just send them through the Eve compiler and they’ll run. As Eve grows, we hope more people will join us in practicing literate programming, but there’s nothing about Eve that demands writing code this way; you can write programs with as little or as much prose as you prefer.&lt;/p&gt;

&lt;h4 id=&quot;views&quot;&gt;Views&lt;/h4&gt;

&lt;p&gt;We’ve been thinking a lot about what kind of graphical tools would be useful for working with the textual version of Eve. One thing currently missing from Eve is the ability to explore the contents of the Eve DB. Without this ability, Eve is as opaque as any other programming language. After all, the ability to inspect your program as it executes is one of the core features of our language.&lt;/p&gt;

&lt;p&gt;An idea we keep coming back to is the concept of “views”. Views are small graphical elements that represent records in the system. By default, they are just small squares, but a programmer can imbue them with properties (position, color, size, shape, etc.) to visualize the records they represent. For example, a graph can be constructed out of views by applying height and position properties to them, like in this example:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/pixels2.gif&quot; alt=&quot;Eve Syntax Highlighting&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, we use &lt;code class=&quot;highlighter-rouge&quot;&gt;#pixel&lt;/code&gt; (views used to be called pixels, so this would currently be accessed using &lt;code class=&quot;highlighter-rouge&quot;&gt;#view&lt;/code&gt;) to inspect some records. Three views are displayed, one for each &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt;. In this case, since we’re inspecting records, the views display the attributes and values for each of the records. Then, we change to a different mode and look at the history of a specific attribute on &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt;s, namely &lt;code class=&quot;highlighter-rouge&quot;&gt;x2&lt;/code&gt;. This results in three graphs illustrating how &lt;code class=&quot;highlighter-rouge&quot;&gt;x2&lt;/code&gt; changes for each &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt; over time.&lt;/p&gt;

&lt;p&gt;Obviously, this is just a concept at the moment, but the core idea we like about views is how flexible they are. We can package some default functionality, like the record inspector and history illustrated here. But even more importantly this functionality should be trivially extended by the programmer.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;p&gt;I’m especially excited by the engagement we’ve seen from the community so far. It’s hard to know exactly how many people are following our development and using Eve, but so far we’ve received comments and feedback from users in Sydney, Copenhagen, Moscow, Finland, Hong Kong, the UK, Germany, and many other places.&lt;/p&gt;

&lt;h4 id=&quot;issues--pull-requests&quot;&gt;Issues + Pull Requests&lt;/h4&gt;

&lt;p&gt;Thank you to everyone who submitted a PR or an issue report. Specifically, thank you to &lt;a href=&quot;https://github.com/btheado&quot;&gt;@btheado&lt;/a&gt;,  &lt;a href=&quot;https://github.com/bertrandrustle&quot;&gt;@bertrandrustle&lt;/a&gt;, &lt;a href=&quot;https://github.com/RubenSandwich&quot;&gt;@RubenSandwich&lt;/a&gt;, &lt;a href=&quot;https://github.com/frankier&quot;&gt;@frankier&lt;/a&gt;, &lt;a href=&quot;https://github.com/dram&quot;&gt;@dram&lt;/a&gt;, and &lt;a href=&quot;https://github.com/martinchooooooo&quot;&gt;@martinchooooooo&lt;/a&gt;. Let me know if I missed anyone!&lt;/p&gt;

&lt;h4 id=&quot;rfcs&quot;&gt;RFCs&lt;/h4&gt;

&lt;p&gt;The syntax RFC received a lot of &lt;a href=&quot;https://github.com/witheve/rfcs/issues/4&quot;&gt;activity&lt;/a&gt; this month, surpassing 100 comments from over a dozen users. Your comments have been well thought out, provocative, and very constructive, so thank you to everyone who has participated so far. Due to the feedback we received, we’ve already made several adjustments to the syntax, including changes to keywords and the general vocabulary of Eve (see above).&lt;/p&gt;

&lt;h4 id=&quot;documentation&quot;&gt;Documentation&lt;/h4&gt;

&lt;p&gt;Documentation is still in an early stage, but it’s improving daily.&lt;/p&gt;

&lt;h5 id=&quot;syntax-quick-reference&quot;&gt;Syntax Quick Reference&lt;/h5&gt;

&lt;p&gt;We put together a short &lt;a href=&quot;https://github.com/witheve/assets/blob/master/docs/SyntaxReference.pdf&quot;&gt;syntax reference&lt;/a&gt; with all the necessary details to help you write Eve programs.&lt;/p&gt;

&lt;h5 id=&quot;eve-handbook&quot;&gt;Eve Handbook&lt;/h5&gt;

&lt;p&gt;The &lt;a href=&quot;https://github.com/witheve/docs/blob/master/drafts/handbook/contents.md&quot;&gt;Eve Handbook&lt;/a&gt; has received some work this month, particularly in the area of documenting the standard library. If you’d like to contribute to the development of Eve, this is the easiest way to get started. You don’t even need to contribute any content; just pointing out the shortcomings of this document will help in its development. Major areas of improvement include:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Completeness - are there any missing gaps?&lt;/li&gt;
  &lt;li&gt;Accuracy - is the handbook true to Eve?&lt;/li&gt;
  &lt;li&gt;Exposition - is the document written in an order that helps people learn the language?&lt;/li&gt;
  &lt;li&gt;Examples - many examples are needed, especially for the standard library&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ll be improving the handbook and other documentation daily, so keep checking back.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Flappy Bird (in Eve)</title>
   <link href="http://incidentalcomplexity.com/2016/08/23/flappy-eve/"/>
   <updated>2016-08-23T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/08/23/flappy-eve/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Editor’s Note: Keep in mind as you’re reading, this post is an executable Eve program. &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;Try it&lt;/a&gt; yourself!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/flippy-flop.gif&quot; alt=&quot;Eve - Flappy Bird&quot; /&gt;&lt;/p&gt;

&lt;p&gt;When a player starts the game, we commit a &lt;code class=&quot;highlighter-rouge&quot;&gt;#world&lt;/code&gt;, a &lt;code class=&quot;highlighter-rouge&quot;&gt;#player&lt;/code&gt;, and some &lt;code class=&quot;highlighter-rouge&quot;&gt;#obstacles&lt;/code&gt;. These will keep all of the essential state of the game. All of this information could have been stored on the world, but for clarity we break the important bits of state into objects that they effect.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;#world&lt;/code&gt; tracks the distance the player has travelled, the current game screen, and the high score.&lt;/li&gt;
  &lt;li&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;#player&lt;/code&gt; stores his current y position and (vertical) velocity.&lt;/li&gt;
  &lt;li&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;obstacles&lt;/code&gt; have their (horizontal) offset and gap widths. We put distance on the world and only keep two obstacles; rather than moving the player through the world, we keep the player stationary and move the world past the player. When an obstacle goes off screen, we will wrap it around, update the placement of its gap, and continue on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Add a flappy eve and a world for it to flap in&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#session-connect]
commit
  [#player #self name: &quot;eve&quot; x: 25 y: 50 velocity: 0]
  [#world screen: &quot;menu&quot; frame: 0 distance: 0 best: 0 gravity: -0.061]
  [#obstacle gap: 35 offset: 0]
  [#obstacle gap: 35 offset: -1]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next we draw the backdrop of the world. The player and obstacle will be drawn later based on their current state. Throughout the app we use resources from &lt;a href=&quot;https://github.com/bhauman/flappy-bird-demo&quot;&gt;#bhauman’s flappy bird demo in clojure&lt;/a&gt;. Since none of these things change over time, we commit them once when the player starts the game.&lt;/p&gt;

&lt;p&gt;Draw the game world!&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#session-connect]
commit
  [#div style: [user-select: &quot;none&quot; -webkit-user-select: &quot;none&quot; -moz-user-select: &quot;none&quot;]  children:
    [#svg #game-window viewBox: &quot;10 0 80 100&quot;, width: 480 children:
    [#rect x: 0 y: 0 width: 100 height: 53 fill: &quot;rgb(112, 197, 206)&quot; sort: 0]
    [#image x: 0 y: 52 width: 100 height: 43 preserveAspectRatio: &quot;xMinYMin slice&quot; href: &quot;https://cdn.rawgit.com/bhauman/flappy-bird-demo/master/resources/public/imgs/background.png&quot; sort: 1]
    [#rect x: 0 y: 95 width: 100 height: 5 fill: &quot;rgb(222, 216, 149)&quot; sort: 0]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;screens&quot;&gt;Screens&lt;/h3&gt;

&lt;p&gt;These following blocks handle drawing the game’s other screens (such as the main menu and the game over scene).&lt;/p&gt;

&lt;p&gt;The main menu displays a message instructing the player how to start the game.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#world screen: &quot;menu&quot;]
  svg = [#game-window]
bind
  svg.children += [#text x: 50 y: 45 text-anchor: &quot;middle&quot; font-size: 6 text: &quot;Click the screen to begin!&quot; sort: 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The “game over” screen displays the final score of the last game, the high score of all games, and a message inviting the player to play the game again.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#world screen: &quot;game over&quot; score best]
  svg = [#game-window]
bind
  svg.children += [#text x: 50 y: 30 text-anchor: &quot;middle&quot; font-size: 6 text: &quot;Game Over :(&quot; sort: 10]
  svg.children += [#text x: 50 y: 55 text-anchor: &quot;middle&quot; font-size: 6 text: &quot;Score &quot; sort: 10]
  svg.children += [#text x: 50 y: 65 text-anchor: &quot;middle&quot; font-size: 6 text: &quot;Best &quot; sort: 10]
  svg.children += [#text x: 50 y: 85 text-anchor: &quot;middle&quot; font-size: 4 text: &quot;Click to play again!&quot; sort: 10]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We haven’t calculated the score yet, so let’s do that. We calculate the score as the &lt;code class=&quot;highlighter-rouge&quot;&gt;floor&lt;/code&gt; of the distance, meaning we just round the distance down to the nearest integer. If the distance between pipes is changed, this value can be scaled to search.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  world = [#world distance]
bind
  world.score := floor[value: distance]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When the game is on the “menu” or “game over” screens, a click anywhere in the application will (re)start the game. Additionally, if the current score is better than the current best, we’ll swap them out now. Along with starting the game, we make sure to reset the distance and player positions in the came of a restart.&lt;/p&gt;

&lt;p&gt;Start a new game&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#click #direct-target]
  world = if world = [#world screen: &quot;menu&quot;] then world
          else [#world screen: &quot;game over&quot;]
  new = if world = [#world score best] score &amp;gt; best then score
        else if world = [#world best] then best
  player = [#player]
commit
  world &amp;lt;- [screen: &quot;game&quot; distance: 0 best: new]
  player &amp;lt;- [x: 25 y: 50 velocity: 0]
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;run-the-game&quot;&gt;Run the game&lt;/h3&gt;

&lt;p&gt;Now we need some logic to actually play the game. We slide obstacles along proportional to the distance travelled, and wrap them around to the beginning once they’re entirely off screen. Additionally, we only show obstacles once their distance travelled is positive. This allows us to offset a pipe in the future, without the modulo operator wrapping it around to start off halfway through the screen.&lt;/p&gt;

&lt;p&gt;Every 2 distance a wild obstacle appears&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#world distance]
  obstacle = [#obstacle offset]
  obstacle-distance = distance + offset
  obstacle-distance &amp;gt;= 0
bind
  obstacle &amp;lt;- [x: 100 - (50 * mod[value: obstacle-distance, by: 2])]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When the obstacle is offscreen (&lt;code class=&quot;highlighter-rouge&quot;&gt;x &amp;gt; 90&lt;/code&gt;), we randomly adjust the height of its gap to ensure the game doesn’t play the same way twice. Eve’s current random implementation yields a single result per seed per evaluation, so you can ask for &lt;code class=&quot;highlighter-rouge&quot;&gt;random[seed: &quot;foo&quot;]&lt;/code&gt; in multiple queries and get the same result in that evaluation. In practice, this means that for every unique sample of randomness you care about in a program at a fixed time, you should use a unique seed. In this case, since we want one sample per obstacle, we just use the obstacle UUIDs as our seeds. The magic numbers in the equation just keep the gap from being at the very top of the screen or underground.&lt;/p&gt;

&lt;p&gt;Readjust the height of the gap every time the obstacle resets&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#world screen: &quot;game&quot;]
  obstacle = [#obstacle x &amp;gt; 90]
  height = random[seed: obstacle] * 30 + 5
commit
  obstacle.height := height
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next we draw the &lt;code class=&quot;highlighter-rouge&quot;&gt;#player&lt;/code&gt; at its (x,y) coordinates. Since the player is stationary in x, setting his x position here dynamically is just a formality, but it allows us to configure his position on the screen when we initialize. We create the sprite first, then set the x and y positions to let us reuse the same element regardless of where the player is.
Draw the player&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  svg = [#game-window]
  player = [#player x y]
  imgs = &quot;https://cdn.rawgit.com/bhauman/flappy-bird-demo/master/resources/public/imgs&quot;
bind
  sprite = [#image player width: 10 height: 10 href: &quot;http://i.imgur.com/sp68LtM.gif&quot; sort: 8]
  sprite.x := x - 5
  sprite.y := y - 5
  svg.children += sprite
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Drawing obstacles is much the same process as drawing the player, but we encapsulate the sprites into a nested SVG to group and move them as a unit.&lt;/p&gt;

&lt;p&gt;Draw the obstacles&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  svg = [#game-window]
  obstacle = [#obstacle x height gap]
  bottom-height = height + gap
  imgs = &quot;https://cdn.rawgit.com/bhauman/flappy-bird-demo/master/resources/public/imgs&quot;
bind
  sprite-group = [#svg #obs-spr obstacle sort: 2 overflow: &quot;visible&quot; children:
    [#image y: 0 width: 10 height, preserveAspectRatio: &quot;none&quot; href: &quot;/pillar-bkg.png&quot; sort: 1]
    [#image x: -1 y: height - 5 width: 12 height: 5 href: &quot;/lower-pillar-head.png&quot; sort: 2]
    [#image y: bottom-height width: 10 height: 90 - bottom-height, preserveAspectRatio: &quot;none&quot; href: &quot;/pillar-bkg.png&quot; sort: 1]
    [#image x: -1 y: bottom-height width: 12 height: 5 href: &quot;/lower-pillar-head.png&quot; sort: 2]]
  sprite-group.x := x
  svg.children += sprite-group
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When a player clicks during gameplay, we give the bird some lift by setting its velocity.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#click #direct-target]
  [#world screen: &quot;game&quot;]
  player = [#player #self]
commit
  player.velocity := 1.17
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, we scroll the world in time with frame updates. Eve is currently locked to 60fps updates here, but this will probably be configurable in the future. Importantly, we only want to update the world state once per frame, so to ensure that we note the offset of the frame we last computed in &lt;code class=&quot;highlighter-rouge&quot;&gt;world.frame&lt;/code&gt; and ensure we’re not recomputing for the same offset.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#time frames]
  world = [#world screen: &quot;game&quot; frame != frames gravity]
  player = [#player y velocity]
  not([#click])
commit
  world.frame := frames
  world.distance := world.distance + 1 / 60
  player &amp;lt;- [y: y - velocity, velocity: velocity + gravity]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Checking collision with the ground is very simple. Since we know the y height of the ground, we just check if the player’s bottom (determined by center + radius) is below that point.&lt;/p&gt;

&lt;p&gt;The game is lost if the player hits the ground.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  world = [#world screen: &quot;game&quot;]
  [#player y &amp;gt; 85] // ground height + player radius
commit
  world.screen := &quot;game over&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Collision with the pipes is only slightly harder. Since they come in pairs, we first determine if the player is horizontally in a slice that may contain pipes and if so, whether we’re above or below the gap. If neither, we’re in the clear, otherwise we’ve collided.&lt;/p&gt;

&lt;p&gt;The game is lost if the player hits an &lt;code class=&quot;highlighter-rouge&quot;&gt;#obstacle&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  world = [#world screen: &quot;game&quot;]
  [#player x y]
  [#obstacle x: obstacle-x height gap]
  ∂x = abs[value: obstacle-x + 5 - x] - 10 // distance between the edges of player and obstacle (offset of 1/2 obstacle width because origin is on the left)
  ∂x &amp;lt; 0
  collision = if y - 5 &amp;lt;= height then true
              else if y + 5 &amp;gt;= gap + height then true
commit
  world.screen := &quot;game over&quot;
&lt;/code&gt;&lt;/pre&gt;
</content>
 </entry>
 
 <entry>
   <title>TodoMVC - A Declarative Implementation in Eve</title>
   <link href="http://incidentalcomplexity.com/2016/08/19/todoMVC/"/>
   <updated>2016-08-19T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/08/19/todoMVC/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Editor’s Note: Eve practices &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#program-structure&quot;&gt;literate programming&lt;/a&gt;. Keep in mind as you’re reading, this post is an executable Eve program. &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;Try it&lt;/a&gt; yourself!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/evetodomvc.png&quot; alt=&quot;Eve - TODO MVC&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://todomvc.com/&quot;&gt;TodoMVC&lt;/a&gt; is a specification for a todo list web application. Its original purpose was to help developers evaluate the plethora of Javascript frameworks implementing the Model-View-Controller (MVC) design pattern. Today, it has evolved into a benchmark for programming languages and frameworks targeting the web, so TodoMVC apps don’t necessarily reflect the MVC design pattern. 
TodoMVC is a great example to demonstrate Eve’s capabilities, as our semantics naturally enable a concise implementation; without optimizing for line count, the program you’re reading only contains 63 lines of Eve code.&lt;/p&gt;

&lt;h3 id=&quot;todos&quot;&gt;Todos&lt;/h3&gt;

&lt;p&gt;Each todo is tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo&lt;/code&gt; and has a &lt;code class=&quot;highlighter-rouge&quot;&gt;body&lt;/code&gt;, which is the text of the todo entered by the user. Additionally, each todo has two flags. The first flag, &lt;code class=&quot;highlighter-rouge&quot;&gt;completed&lt;/code&gt;, affects how the todo is displayed, and allows the user to filter todos based on completed status; we can look at “completed” todos, “active” todos, or “all” todos. The second flag, &lt;code class=&quot;highlighter-rouge&quot;&gt;editing&lt;/code&gt;, toggles an editing mode on the todo. This is used later to allow the user to update the body text of the todo.&lt;/p&gt;

&lt;p&gt;These todos exist in the context of an &lt;code class=&quot;highlighter-rouge&quot;&gt;@app&lt;/code&gt;, which we use to hold global state information. We use it to place a filter on the todos. The filter can be one of “completed”, “active”, or “all”.&lt;/p&gt;

&lt;h3 id=&quot;the-application-view&quot;&gt;The Application View&lt;/h3&gt;

&lt;p&gt;We draw the interface for TodoMVC here. All styling is handled in a separate CSS file. The app consists of three parts:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Header&lt;/strong&gt; - Contains the &lt;code class=&quot;highlighter-rouge&quot;&gt;@toggle-all&lt;/code&gt; button as well as &lt;code class=&quot;highlighter-rouge&quot;&gt;@new-todo&lt;/code&gt;, which is an input box for entering new todos.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Body&lt;/strong&gt; - Contains &lt;code class=&quot;highlighter-rouge&quot;&gt;@todo-list&lt;/code&gt;, the list of todos. The work here is handled in the second block.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Footer&lt;/strong&gt; - Contains the count of todos, as well as control buttons for filtering, and clearing completed todos.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this block, we do a little work to determine todo-count, all-checked, and none-checked. Other than that, this block simply lays out the major control elements of TodoMVC. A key aspect of this block is the &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; keyword. This denotes the beginning of the action phase of the block, and tells Eve that to update records as data changes. This is the key component that enables Eve to react to user interaction and update the display.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
    [@app filter]
    all-checked = if not([#todo completed: false]) then true
                  else false
    none-checked = if [#todo completed: true] then false
                   else true
    todo-count = if c = count[given: [#todo completed: false]] then c 
                 else 0
bind
    [#link rel: &quot;stylesheet&quot; href: &quot;/examples/todomvc.css&quot;] // Links to an external stylesheet
    [#div class: &quot;todoapp&quot; children: [#header children: [#h1 text: &quot;todos&quot;]
      [#input @new-todo, class: &quot;new-todo&quot;, autofocus: true, placeholder: &quot;What needs to be done?&quot;]
      [#input @toggle-all, class: &quot;toggle-all&quot;, type: &quot;checkbox&quot;, checked: all-checked]]
    [#div class: &quot;main&quot; children:
      [#ul @todo-list, class: &quot;todo-list&quot;]]
    [#footer children:
      [#span @todo-count, class: &quot;todo-count&quot;, children: [#strong text: todo-count] [#span text: &quot; items left&quot;]]
      [#ul @filters, class: &quot;filters&quot;, children:
        [#li children: [#a href: &quot;#/all&quot; class: [selected: is(filter = &quot;all&quot;)] text: &quot;all&quot;]]
        [#li children: [#a href: &quot;#/active&quot; class: [selected: is(filter = &quot;active&quot;)] text: &quot;active&quot;]]
        [#li children: [#a href: &quot;#/completed&quot; class: [selected: is(filter = &quot;completed&quot;)] text: &quot;completed&quot;]]]
      [#span @clear-completed, class: [clear-completed: true, hidden: none-checked], text: &quot;Clear completed&quot;]]]
&lt;/code&gt;&lt;/pre&gt;

&lt;h4 id=&quot;drawing-the-todo-list&quot;&gt;Drawing the Todo List&lt;/h4&gt;

&lt;p&gt;Now we look at how the todos are actually displayed in the application. We attach it to &lt;code class=&quot;highlighter-rouge&quot;&gt;@todo-list&lt;/code&gt; using its &lt;code class=&quot;highlighter-rouge&quot;&gt;children&lt;/code&gt; attribute. Each todo display element consists of:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;a &lt;strong&gt;list item&lt;/strong&gt;, with a checkbox for toggling the completed status of the todo&lt;/li&gt;
  &lt;li&gt;a &lt;strong&gt;label&lt;/strong&gt; displaying the text of the todo&lt;/li&gt;
  &lt;li&gt;an &lt;strong&gt;input textbox&lt;/strong&gt; for editing the text of the todo&lt;/li&gt;
  &lt;li&gt;a &lt;strong&gt;button&lt;/strong&gt; for deleting the todo&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
    [@app filter]
    parent = [@todo-list]
    (todo, body, completed, editing) =
      if filter = &quot;completed&quot; then ([#todo, body, completed: true, editing], body, true, editing)
      else if filter = &quot;active&quot; then ([#todo, body, completed: false, editing], body, false, editing)
      else if filter = &quot;all&quot; then ([#todo, body, completed, editing], body, completed, editing)
bind
    parent.children += [#li, class: [todo: true, completed, editing], todo, children:
                       [#input #todo-checkbox, todo, class: [toggle: true, hidden: editing], type: &quot;checkbox&quot;, checked: completed]
                       [#label #todo-item, class: [hidden: editing], todo, text: body]
                       [#input #todo-editor, class: [edit: true, hidden: toggle[value: editing]], todo, value: body, autofocus: true]
                       [#button #remove-todo, class: [destroy: true, hidden: editing], todo]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Thanks to Eve’s set semantics, we don’t need any loops here; for every unique &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo&lt;/code&gt; in the database, Eve will do the work of adding another &lt;code class=&quot;highlighter-rouge&quot;&gt;#li&lt;/code&gt; as a child of &lt;code class=&quot;highlighter-rouge&quot;&gt;@todo-list&lt;/code&gt;.&lt;/p&gt;

&lt;h3 id=&quot;responding-to-user-events&quot;&gt;Responding to User Events&lt;/h3&gt;

&lt;h4 id=&quot;creating-a-new-todo&quot;&gt;Creating a New Todo&lt;/h4&gt;

&lt;p&gt;A user can interact with TodoMVC in several ways. First and foremost, the user can create new todos. When the &lt;code class=&quot;highlighter-rouge&quot;&gt;@new-todo&lt;/code&gt; input box is focused and the user presses enter, the value of the input is captured and a new todo is created.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
    element = [@new-todo value]
    kd = [#keydown element, key: &quot;enter&quot;]
commit
    [#todo body: value, editing: false, completed: false, kd]
    element.value := &quot;&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Of note here is the record &lt;code class=&quot;highlighter-rouge&quot;&gt;[#todo body: value, editing: false, completed: false, kd]&lt;/code&gt;. The inclusion of the &lt;code class=&quot;highlighter-rouge&quot;&gt;kd&lt;/code&gt; attribute might seem strange, but its purpose is to guarantee the uniqueness of the todo. Let’s say we want to add two todos with the same body. If &lt;code class=&quot;highlighter-rouge&quot;&gt;kd&lt;/code&gt; were not an attribute, then the two todos would be exactly the same and Eve’s set semantics would collapse them into a single todo. Therefore, we need some way to distinguish todos with identical bodies. Adding &lt;code class=&quot;highlighter-rouge&quot;&gt;kd&lt;/code&gt; allows for this.&lt;/p&gt;

&lt;h4 id=&quot;editing-todos&quot;&gt;Editing Todos&lt;/h4&gt;

&lt;p&gt;Here we handle all the ways we edit a todo. Editing includes changing the body as well as toggling the status of between complete and active.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;click &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo-checkbox&lt;/code&gt; - toggles the completed status of the checkbox.&lt;/li&gt;
  &lt;li&gt;click &lt;code class=&quot;highlighter-rouge&quot;&gt;@toggle-all&lt;/code&gt; - marks all todos as complete or incomplete, depending on the initial value. If all todos are marked incomplete, clicking &lt;code class=&quot;highlighter-rouge&quot;&gt;@toggle-all&lt;/code&gt; will mark them complete. If only some are marked complete, then clicking &lt;code class=&quot;highlighter-rouge&quot;&gt;@toggle-all&lt;/code&gt; will mark the rest complete. If all todos are marked as complete, then clicking &lt;code class=&quot;highlighter-rouge&quot;&gt;@toggle-all&lt;/code&gt; will mark them all as incomplete.&lt;/li&gt;
  &lt;li&gt;blur &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo-editor&lt;/code&gt; - blurring the &lt;code class=&quot;highlighter-rouge&quot;&gt;@todo-editor&lt;/code&gt; will cancel the edit&lt;/li&gt;
  &lt;li&gt;escape &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo-editor&lt;/code&gt; - this has the same effect as blurring&lt;/li&gt;
  &lt;li&gt;enter &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo-editor&lt;/code&gt; - commits the new text in &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo-editor&lt;/code&gt;, replacing the original body&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
    (todo, body, editing, completed) =
      if [#click element: [#todo-checkbox todo]] then (todo, todo.body, todo.editing, toggle[value: todo.completed])
      else if [#click element: [@toggle-all checked]] then ([#todo body], body, todo.editing, toggle[value: checked])
      else if [#double-click element: [#todo-item todo]] then (todo, todo.body, true, todo.completed)
      else if [#blur element: [#todo-editor todo value]] then (todo, value, false, todo.completed)
      else if [#keydown element: [#todo-editor todo] key: &quot;escape&quot;] then (todo, todo.body, false, todo.completed)
      else if [#keydown element: [#todo-editor todo value] key: &quot;enter&quot;] then (todo, value, false, todo.completed)
commit
    todo &amp;lt;- [body, completed, editing]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;deleting-todos&quot;&gt;Deleting Todos&lt;/h4&gt;

&lt;p&gt;Deleting a todo from the list is accomplished by removing the &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo&lt;/code&gt; tag from the todo’s record. Recall from the “Drawing the Todo List” section that we select todos by including &lt;code class=&quot;highlighter-rouge&quot;&gt;#todo&lt;/code&gt; in the record. Therefore, if we remove that tag from the todo, then that todo will no longer appear in the list, although it will still persist in the database.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
    todo = if [#click element: [#remove-todo todo]] then todo
           else if [#click element: [@clear-completed]] then [#todo completed: true]
commit
    todo -= #todo
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;filtering-todos-routing&quot;&gt;Filtering Todos (Routing)&lt;/h4&gt;

&lt;p&gt;The TodoMVC specification requires filtering via the URL. This is actually how the filter buttons work; if you look at their href attributes, they modify the URL with certain tags:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;all - displays all todos&lt;/li&gt;
  &lt;li&gt;active - displays active todos only&lt;/li&gt;
  &lt;li&gt;completed - displays completed todos only&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can extract this value using &lt;code class=&quot;highlighter-rouge&quot;&gt;#url&lt;/code&gt;, which has a hash-segment attribute that automatically parses the URL for us, returning the &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; (expected to be any one of the above). Any other value will fail to show any todos, but the application will not break.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;search
    value = if [#url hash-segment: [index: 1, value]] then value
            else &quot;all&quot;
bind
    [@app filter: value]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</content>
 </entry>
 
 <entry>
   <title>Breaking Down: Tic-Tac-Toe</title>
   <link href="http://incidentalcomplexity.com/2016/08/11/tic-tac-toe/"/>
   <updated>2016-08-11T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/08/11/tic-tac-toe/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;(Editor’s Note: Keep in mind as you’re reading, this post is an executable Eve program. See the raw text &lt;a href=&quot;https://raw.githubusercontent.com/Kodowa/incidentalcomplexity/gh-pages/_posts/2016-08-11-tic-tac-toe.md&quot;&gt;here&lt;/a&gt;. This is our first example of &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#program-structure&quot;&gt;literate programming&lt;/a&gt; in Eve, so let us know what you think!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/tic-tac-toe.gif&quot; alt=&quot;Tic-tac-toe in Eve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Last week on the mailing list, &lt;a href=&quot;https://github.com/rubensandwich&quot;&gt;RubenSandwich&lt;/a&gt; posted an interactive demo capable of &lt;a href=&quot;https://groups.google.com/forum/?utm_medium=email&amp;amp;utm_source=footer#!topic/eve-talk/UQkW7KDdz3M&quot;&gt;playing and scoring tic-tac-toe searches&lt;/a&gt;. He provided some great feedback about the issues he ran into along the way. Now that the language is becoming more stable, our first priority is seeing it used and addressing the problems that surface. To that end, his troubles became our guide to making Eve a little friendlier for writing interactive applications in general. Today we’ll look at a simplified version of tic-tac-toe that takes into account his feedback.&lt;/p&gt;

&lt;p&gt;This analysis (and future breakdowns) will be written inline in Eve to make the discussion flow more naturally. Since Eve is a superset of &lt;a href=&quot;https://guides.github.com/features/mastering-markdown/&quot;&gt;GitHub-Flavored Markdown&lt;/a&gt; which our blog is capable of rendering, we can provide a pleasant reading experience directly from the source code.&lt;/p&gt;

&lt;h3 id=&quot;game-logic&quot;&gt;Game logic&lt;/h3&gt;

&lt;p&gt;Tic-Tac-Toe is a classic game played by two players, “X” and “O”, who take turns marking their letter on a 3x3 grid. The first player to mark 3 adjacent cells in a line wins. The game can potentially result in a draw, where all grid cells are marked, but neither player has 3 adjacent cells. To build this game in Eve, we need several parts:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;A game board with cells&lt;/li&gt;
  &lt;li&gt;A way to mark a cell as “X” or “O”&lt;/li&gt;
  &lt;li&gt;A way to recognize that a player has won the game.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To begin, we initialize the board. We commit an object named &lt;code class=&quot;highlighter-rouge&quot;&gt;@board&lt;/code&gt; to hold our global state and create a set of &lt;code class=&quot;highlighter-rouge&quot;&gt;#cell&lt;/code&gt;s. These &lt;code class=&quot;highlighter-rouge&quot;&gt;#cell&lt;/code&gt;s will keep track of the moves players have made. Common connect-N games (a generalized tic-tac-toe for any NxN grid) are scored along 4 axes (horizontal, vertical, the diagonal, and the anti-diagonal). We group cells together along each axis up front to make scoring easier later. This process is made much cleaner by the addition of new math expressions like &lt;code class=&quot;highlighter-rouge&quot;&gt;range[from, to]&lt;/code&gt;. This is a small part of our effort to expand the standard library based on usage. If you’re interested in helping shape this, stop by our &lt;a href=&quot;https://github.com/witheve/rfcs/&quot;&gt;RFCs repository&lt;/a&gt; or jump right in on our discussion of &lt;a href=&quot;https://github.com/witheve/rfcs/issues/5&quot;&gt;standard string expressions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The game board is square, with a given &lt;code class=&quot;highlighter-rouge&quot;&gt;size&lt;/code&gt;. It contains &lt;code class=&quot;highlighter-rouge&quot;&gt;size ^ 2&lt;/code&gt; cells,
each with a row and column index.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#session-connect]

  // board constants
  size = 3
  starting-player = &quot;X&quot;

  // generate the cells
  i = range[from: 0, to: size]
  j = range[from: 0, to: size]

commit
  board = [@board size player: starting-player]
  [#cell board row: i column: j]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A subtlety here is the last line, &lt;code class=&quot;highlighter-rouge&quot;&gt;[#cell board row: i column: j]&lt;/code&gt;. Thanks to our relational semantics, this line actually generates all 9 cells. Since the sets of values computed in &lt;code class=&quot;highlighter-rouge&quot;&gt;i&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;j&lt;/code&gt; have no relation to each other, when we use them together we get the &lt;a href=&quot;https://en.wikipedia.org/wiki/Cartesian_product&quot;&gt;cartesian product&lt;/a&gt; of their values. This means that if &lt;code class=&quot;highlighter-rouge&quot;&gt;i = {0, 1, 2}&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;j = {0, 1, 2}&lt;/code&gt;, then &lt;code class=&quot;highlighter-rouge&quot;&gt;i x j = {(0, 0), (0, 1), ... (2, 1), (2, 2)}&lt;/code&gt;. These are exactly the indices we need for our grid!&lt;/p&gt;

&lt;p&gt;Now we tag some special cell groupings: diagonal and anti-diagonal cells. The diagonal cells are (0, 0), (1, 1), and (2, 2). Notice anything about them?&lt;/p&gt;

&lt;p&gt;Diagonal cells have a row index equal to its column index&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  cells = [#cell row column]
  row = column
bind
  cells += #diagonal
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Similarly, the anti-diagonal cells are (0, 2), (1, 1), and (2, 0).&lt;/p&gt;

&lt;p&gt;Anti-diagonal cells satisfy the equation &lt;code class=&quot;highlighter-rouge&quot;&gt;row + col = N - 1&lt;/code&gt;,
where N is the size of the board.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  cells = [#cell row column]
  [@board size: N]
  row + column = N - 1
bind
  cells += #anti-diagonal
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A game is won when a player marks N cells in a row, column, or diagonal.
The game can end in a tie, where no player has N in a row.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  board = [@board size: N, not(winner)]
                    // Check for a winning row
  (winner, cell) = if cell = [#cell row player]
                      N = count[given: cell, per: (row, player)] then (player, cell)
                    // Check for a winning column
                    else if cell = [#cell column player]
                      N = count[given: cell, per: (column, player)] then (player, cell)
                    // Check for a diagonal win
                    else if cell = [#diagonal row column player]
                      N = count[given: cell, per: player] then (player, cell)
                    // Check for an anti-diagonal win
                    else if cell = [#anti-diagonal row column player]
                      N = count[given: cell, per: player] then (player, cell)
                    // If all cells are filled but there are no winners
                    else if cell = [#cell player]
                      N * N = count[given: cell] then (&quot;nobody&quot;, cell)
commit
  board.winner := winner
  cell += #winner
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We use the &lt;code class=&quot;highlighter-rouge&quot;&gt;count&lt;/code&gt; aggregate in the above block. Count returns the number of discrete values (the cardinality) of the variables in &lt;code class=&quot;highlighter-rouge&quot;&gt;given&lt;/code&gt;. The optional &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; attribute allows you to specify groupings, which yield one result for each set of values in the group.&lt;/p&gt;

&lt;p&gt;For example, in &lt;code class=&quot;highlighter-rouge&quot;&gt;count[given: cell, per: player]&lt;/code&gt; we group by &lt;code class=&quot;highlighter-rouge&quot;&gt;player&lt;/code&gt;, which returns two values: the count of cells marked by player &lt;code class=&quot;highlighter-rouge&quot;&gt;X&lt;/code&gt; and those marked by &lt;code class=&quot;highlighter-rouge&quot;&gt;O&lt;/code&gt;. This can be read “count the cells per player”. In the scoring block, we group by &lt;code class=&quot;highlighter-rouge&quot;&gt;column&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;player&lt;/code&gt;. This will return the count of cells marked by a player in a particular column. Like wise with the row case. By equating this with N, we ensure the winning player is only returned when she has marked N cells in the given direction.&lt;/p&gt;

&lt;p&gt;This is how Eve works without looping. Rather than writing a nested &lt;code class=&quot;highlighter-rouge&quot;&gt;for&lt;/code&gt; loop and iterating over the cells, we can use Eve’s semantics to our advantage.&lt;/p&gt;

&lt;p&gt;We first search every row, then every column. Finally we check the diagonal and anti-diagonal. To do this, we leverage the &lt;code class=&quot;highlighter-rouge&quot;&gt;#diagonal&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;#anti-diagonal&lt;/code&gt; tags we created earlier; instead of selecting &lt;code class=&quot;highlighter-rouge&quot;&gt;[#cell]&lt;/code&gt;, we can select on &lt;code class=&quot;highlighter-rouge&quot;&gt;[#diagonal]&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;[#anti-diagonal]&lt;/code&gt; to select only a subset of cells.&lt;/p&gt;

&lt;h3 id=&quot;react-to-events&quot;&gt;React to Events&lt;/h3&gt;

&lt;p&gt;Next, we handle user input. Any time a cell is directly clicked, we:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Ensure the cell hasn’t already been played&lt;/li&gt;
  &lt;li&gt;Check for a winner&lt;/li&gt;
  &lt;li&gt;Switch to the next player&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then update the cell to reflect its new owner, and switch board’s &lt;code class=&quot;highlighter-rouge&quot;&gt;player&lt;/code&gt; to the next player.&lt;/p&gt;

&lt;p&gt;Click on a cell to make your move&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#click #direct-target element: [#div cell]]
  not(cell.player)                               // Ensures the cell hasn't been played
  board = [@board player: current, not(winner)]  // Ensures the game has not been won
  next_player = if current = &quot;X&quot; then &quot;O&quot;        // Switches to the next player
                else &quot;X&quot;
commit
  board.player := next_player
  cell.player := current
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since games of tic-tac-toe are often very short and extremely competitive, it’s imperative that it be quick and easy to begin a new search. When the game is over (the board has a &lt;code class=&quot;highlighter-rouge&quot;&gt;winner&lt;/code&gt; attribute), a click anywhere on the drawing area will reset the game for another round of play.&lt;/p&gt;

&lt;p&gt;A reset consists of:&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Clearing the board of a &lt;code class=&quot;highlighter-rouge&quot;&gt;winner&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;Clearing all of the cells&lt;/li&gt;
  &lt;li&gt;Removing the &lt;code class=&quot;highlighter-rouge&quot;&gt;#winner&lt;/code&gt; tag from the winning cell set&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search
  [#click #direct-target]
  board = [@board winner]
  cell = [#cell player]
commit
  board.winner -= winner
  cell.player -= player
  cell -= #winner
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;drawing-the-game-board&quot;&gt;Drawing the Game Board&lt;/h3&gt;

&lt;p&gt;We’ve implemented the game logic, but now we need to actually draw the board so players have something to see and interact with. Our general strategy will be that the game board is a &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; with one child &lt;code class=&quot;highlighter-rouge&quot;&gt;#div&lt;/code&gt; for each cell. Each cell will be drawn with an “X”, “O”, or empty string as text. We also add a &lt;code class=&quot;highlighter-rouge&quot;&gt;#status&lt;/code&gt; div, which we’ll write game state into later. Our cells have the CSS inlined, but you could just as easily link to an external file.&lt;/p&gt;

&lt;p&gt;Draw the board&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  search
    board = [@board]
    cell = [#cell board row column]
    contents = if cell.player then cell.player
              else &quot;&quot;
  bind
    [#div board @container style: [font-family: &quot;sans-serif&quot;], children:
      [#div #status board class: &quot;status&quot;, style: [text-align: &quot;center&quot;, width: 150, padding-bottom: 10]]
      [#div class: &quot;board&quot; style: [color: &quot;black&quot;] children:
        [#div class: &quot;row&quot; sort: row children:
          [#div #cell class: &quot;cell&quot; cell text: contents sort: column style:
            [display: &quot;inline-block&quot; width: &quot;50px&quot; height: &quot;50px&quot; border: &quot;1px solid black&quot; background: &quot;white&quot; font-size: &quot;2em&quot; line-height: &quot;50px&quot; text-align: &quot;center&quot;]]]]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Winning cells are drawn in a different color&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  search
    winning-cells = [#cell #winner]
    cell-elements = [#div cell: winning-cells, style]
  bind
    style.color := &quot;red&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, we fill the previously mentioned &lt;code class=&quot;highlighter-rouge&quot;&gt;#status&lt;/code&gt; div with our current game state. If no winner has been declared, we remind the competitors of whose turn it is, and once a winner is found we announce her newly-acquired bragging rights.&lt;/p&gt;

&lt;p&gt;Display the current player if the game isn’t won&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  search
    status = [#status board]
    not(board.winner)
  bind
    status.text += &quot;It's {{board.player}}'s turn!&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;When the game is won, display the winner&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  search
    status = [#status board]
    winner = board.winner
  bind
    status.text += &quot;{{winner}} wins! Click anywhere to restart!&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Along the way to making this demo, many new standard library expressions were added, the execution strategy for aggregates was overhauled, parser bugs were fixed, and dependency ordering glitches resolved. We even began to appreciate how literate programming will work in Eve (the post you are reading right now is an executable Eve program).&lt;/p&gt;

&lt;p&gt;The human-compiled version of tic-tac-toe was completed in only about half an hour, and required very few changes to get working once the platform caught up. The latest iteration of Eve is still very much in its infancy, but even now its showing a lot of promise for teasing out simple and general solutions to complicated problems. As one of its creators, I’m obviously a biased party when discussing Eve, so feedback such as RubenSandwich’s is invaluable in helping us make the language more robust. If you find the time to try Eve yourself, please don’t hesitate to share your experiences with us on the &lt;a href=&quot;https://groups.google.com/forum/?utm_medium=email&amp;amp;utm_source=footer#!forum/eve-talk&quot;&gt;mailing list&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (July 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/08/03/july/"/>
   <updated>2016-08-03T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/08/03/july/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;This post has been updated. See the original &lt;a href=&quot;https://github.com/Kodowa/incidentalcomplexity/blob/f44a2392e15d78f9e0047f25054863f7418165b5/_posts/2016-08-03-july.md&quot;&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3 id=&quot;eve-platform&quot;&gt;Eve Platform&lt;/h3&gt;

&lt;p&gt;Our biggest news this month is our community preview of Eve alpha. During May and June we were busy developing Eve in a secondary repository, trying to get it to a state that was more approachable and usable for outsiders. In July, we finally reached a point where we were happy to &lt;a href=&quot;https://groups.google.com/forum/#!topic/eve-talk/riE6yy7bBeo&quot;&gt;invite the community&lt;/a&gt;to play with the platform and provide usability feedback. So far we’ve received dozens of comments, issue reports, and suggestions. We’re thrilled with the response, and want to thank everyone who has provided valuable feedback. Thanks to you, Eve is in a much better place compared to two weeks ago.&lt;/p&gt;

&lt;p&gt;If you’d like to try Eve yourself, you can start at our main repository, &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;witheve/Eve&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;syntax&quot;&gt;Syntax&lt;/h4&gt;

&lt;p&gt;We introduced a new textual syntax this month that targets the first users of the Eve platform: developers. Right now, this syntax is the only interface to Eve, meaning we’re not supporting a graphical interface at the moment.&lt;/p&gt;

&lt;p&gt;Our mission from the beginning has been to bring the power of computation to everyone, and developers are as much a part of that as anyone else. While my Mother wouldn’t want to use this syntax to manage her small business, it does help developers, a very important class of early adopters, engage with the platform as we continue our research on end-user UIs. Chris wrote &lt;a href=&quot;http://www.chris-granger.com/2016/07/21/two-years-of-eve/&quot;&gt;a post&lt;/a&gt;that talks about this in a lot more detail, but the key idea is that the platform has a ton of value even without the UI. When we’re ready to present Eve to a wider, less technical audience, we’ll already know a lot about how people use Eve because of the developer syntax.&lt;/p&gt;

&lt;p&gt;That being said, we want our developer syntax to be approachable; ultimately, we imagine technical non-developers (e.g. scientists, engineers, etc.) will also prefer a textual syntax, so we want it to have certain properties in order to appeal to a wider audience than current languages:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;For Humans&lt;/strong&gt; - This syntax is designed for humans, so decisions regarding the ergonomics of the syntax are of primary concern.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Readable&lt;/strong&gt; - Since code is read more than written, we want the syntax to be eminently readable.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Consistent&lt;/strong&gt; - The syntax should be consistent with prior knowledge, so that users unfamiliar with Eve can read an Eve program and figure out what’s going on at a high level without explicitly knowing the syntax.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Distinct&lt;/strong&gt; - This one is purposefully in contention with goal (3); we want the syntax to be familiar but not &lt;em&gt;too&lt;/em&gt; familiar. If our syntax is too close to other languages (e.g. if we used c-style curly braces), we might project that our semantics are similar, when in fact they are very different.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Below is a sample of code written in the new syntax. This code draws a counter and two buttons that change its value:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve-document&quot;&gt;build the counter
```
  search
    counter = [#counter count]
  bind
    [#div counter class: &quot;counter-container&quot;, children:
      [#div #count-button class: &quot;button&quot;, sort: 0, text: &quot;-&quot;, diff: -1, counter]
      [#div class: &quot;count&quot;, sort: 1, text: count]
      [#div #count-button class: &quot;button&quot;, sort: 2, text: &quot;+&quot;, diff: 1, counter]]
```

increment the counter
```
  search
    [#click element: [#count-button diff counter]]
  commit
    counter.count := counter.count + diff
```

go!
```
  search
    [#session-connect]
  commit
    [#counter count: 0]
```
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Describing the syntax would probably take an entire blog post, but if you want to learn more &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md&quot;&gt;this is a good place to start&lt;/a&gt;. The basic idea is that an Eve program is divided into “blocks” (the counter program has three blocks), each of which works in two phases:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Phase 1: search - gather all the information you need from the Eve DB.&lt;/li&gt;
  &lt;li&gt;Phase 2: Action - change the state of the Eve DB.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In each of the phases, we are selecting “objects” (better name pending), which are just collections of attribute-value pairs associated with a unique ID.  In the search phase, the programmer searches objects in the Eve DB with patterns, which select objects from the Eve DB with the provided shape. In the action phase, the programmer mutates the Eve DB by setting, adding, or removing facts.      &lt;/p&gt;

&lt;p&gt;To get a better grasp on the syntax, you can check out our &lt;a href=&quot;http://incidentalcomplexity.com/2016/07/21/clock/&quot;&gt;previous post&lt;/a&gt;, which explains the implementation of a clock in Eve line by line.&lt;/p&gt;

&lt;h4 id=&quot;events-and-reactivity&quot;&gt;Events and Reactivity&lt;/h4&gt;

&lt;p&gt;One of the principal benefits of Eve is that it reacts and updates values automatically as new data becomes available. For example, when an event like a &lt;code class=&quot;highlighter-rouge&quot;&gt;click&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;keydown&lt;/code&gt; occurs, Eve records that event as a fact in the Eve DB. This fact exists for a single instant, a “tic” of compiler time. In that instant, any block selecting on that event can react to it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/dogeve.gif&quot; alt=&quot;Events in Eve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This login system (which demonstrates several events including &lt;code class=&quot;highlighter-rouge&quot;&gt;keydown&lt;/code&gt;,&lt;code class=&quot;highlighter-rouge&quot;&gt;click&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;onChange&lt;/code&gt;) was written entirely in Eve. Clicking on the login button in the top right triggers Eve to create a &lt;code class=&quot;highlighter-rouge&quot;&gt;#click&lt;/code&gt; fact that records the clicked element’s ID as well as the time it was clicked. This fact supports the login modal that appears at the bottom of the screen. When the user types the username into the textbox, the &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; attribute of that element changes on each &lt;code class=&quot;highlighter-rouge&quot;&gt;#keydown&lt;/code&gt; event. Finally, when the credentials are submitted, the values in the username/password &lt;code class=&quot;highlighter-rouge&quot;&gt;#textbox&lt;/code&gt; elements compared against stored username/passwords in the system.&lt;/p&gt;

&lt;p&gt;Below is an analogue &lt;a href=&quot;https://github.com/witheve/Eve/blob/c75727d86c0df367678eec6d7d1dd9a5d56c356b/examples/clock.eve&quot;&gt;clock in Eve&lt;/a&gt; that reacts to changes in &lt;code class=&quot;highlighter-rouge&quot;&gt;#time&lt;/code&gt;, which is an object in the system that represents the current time with &lt;code class=&quot;highlighter-rouge&quot;&gt;hours&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;minutes&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;seconds&lt;/code&gt;, attributes.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/eveclock.gif&quot; alt=&quot;A Clock in Eve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;#time&lt;/code&gt; object changes every second, which in turn causes a change in the &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hands&lt;/code&gt; objects, which finally causes the drawing to update.&lt;/p&gt;

&lt;p&gt;What’s nice about this interaction model is that it’s identical to interacting with any other object in Eve; a &lt;code class=&quot;highlighter-rouge&quot;&gt;click&lt;/code&gt; event occurring or the &lt;code class=&quot;highlighter-rouge&quot;&gt;time&lt;/code&gt; changing is exactly the same as, for instance, the &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; attribute on an object changing, or adding a tag to an object.&lt;/p&gt;

&lt;h4 id=&quot;error-handling&quot;&gt;Error Handling&lt;/h4&gt;

&lt;p&gt;If you’ve ever seen a &lt;a href=&quot;http://codegolf.stackexchange.com/questions/1956/generate-the-longest-error-message-in-c&quot;&gt;C++ template error&lt;/a&gt;, you’ve felt the pain of indecipherable error messages. As with our syntax, we recognize that error messages need to be distinctly designed for humans. Take this example:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/errorExample.gif&quot; alt=&quot;Error handling in Eve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, the user types &lt;code class=&quot;highlighter-rouge&quot;&gt;#cool&lt;/code&gt;, which is syntactically incorrect. The compiler returns an error message pointing out the line and character of the error, and the reason for the error. This is where most compilers call it a day. We go several steps further, providing a suggestion on how to correct the error, and in this case we can even offer a “Fix it for me” button that applies the fix automatically and re-evaluates the program.&lt;/p&gt;

&lt;p&gt;Obviously, this is a simple error, and not every mistake can be fixed automatically, but this exemplifies our general attitude toward error messages. Eve’s error messages should be:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;strong&gt;Understandable&lt;/strong&gt; - Error messages are for humans, so they should be readable and understandable by humans. Most compiler errors actually make perfect sense from the point of view of the compiler, but unfortunately the compiler and the programmer don’t always think the same way. Eve errors should be reported in full sentences, explaining exactly why the error occurred.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Relevant&lt;/strong&gt; - In many languages, sometimes an error message is not actually relevant to the cause of the error. Have you ever forgotten a trailing semicolon, and received a completely unrelated error message? Eve error messages should always point to the actual cause of the error.&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Actionable&lt;/strong&gt; - Where possible, error messages should indicate potential fixes to the error. In the example above, Eve notes that placing square brackets around &lt;code class=&quot;highlighter-rouge&quot;&gt;#cool&lt;/code&gt; might fix the problem. Further, errors should teach the programmer about why the error occurred and provide examples of how to avoid similar errors in the future. The Eve compiler should be a guide and friend.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4 id=&quot;eve--unicode&quot;&gt;Eve ♥ Unicode&lt;/h4&gt;

&lt;p&gt;Eve supports Unicode!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/unicode.jpg&quot; alt=&quot;Eve ♥ Unicode&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is a fun &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/examples/unicode.eve&quot;&gt;example&lt;/a&gt;, but Unicode can be important in certain domains where notation is standardized (e.g. the number π in math), but moreover it’s crucial for making Eve usable in languages other than English.&lt;/p&gt;

&lt;h3 id=&quot;community&quot;&gt;Community&lt;/h3&gt;

&lt;h4 id=&quot;request-for-comments&quot;&gt;Request for Comments&lt;/h4&gt;

&lt;p&gt;This month we introduced our &lt;a href=&quot;https://github.com/witheve/rfcs&quot;&gt;Request for Comments (RFC)&lt;/a&gt;process. RFCs have worked well for other languages as a way to engage with the community and move the language forward in a way that is collaborative. In our case, RFCs are meant to be an informal communication for starting a discussion on a particular feature, design, protocol, process, or anything else relating to Eve and the Eve community. Already, our RFC process is off to a good start, with our first two RFCs underway:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md&quot;&gt;Syntax&lt;/a&gt;-  &lt;a href=&quot;https://github.com/witheve/rfcs/issues/4&quot;&gt;Discussion&lt;/a&gt; This RFC is our formal proposal for the developer syntax described above. Already, this RFC has gotten many great comments, and we’re already integrating the feedback into the syntax. We’d like to publicly thank everyone who has participated so far, including &lt;a href=&quot;https://github.com/Eucalyptus2013&quot;&gt;@Eucalyptus2013&lt;/a&gt; &lt;a href=&quot;https://github.com/RubenSandwich&quot;&gt;@RubenSandwich&lt;/a&gt; &lt;a href=&quot;https://github.com/bertrandrustle&quot;&gt;@bertrandrustle&lt;/a&gt; &lt;a href=&quot;https://github.com/shamrin&quot;&gt;@shamrin&lt;/a&gt; &lt;a href=&quot;https://github.com/rainhead&quot;&gt;@rainhead&lt;/a&gt; &lt;a href=&quot;https://github.com/zubairq&quot;&gt;@zubairq&lt;/a&gt; and &lt;a href=&quot;https://github.com/benjyhirsch&quot;&gt;@benjyhirsch&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/strings.md&quot;&gt;Strings&lt;/a&gt;- &lt;a href=&quot;https://github.com/witheve/rfcs/issues/5&quot;&gt;Discussion&lt;/a&gt; This RFC was opened by &lt;a href=&quot;https://github.com/shamrin&quot;&gt;@shamrin&lt;/a&gt; to discuss string facilities in Eve. Again, we’ve taken this feedback and have begun implementing various string manipulation functions into Eve.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all, we’re very pleased with the RFC process so far!&lt;/p&gt;

&lt;h4 id=&quot;documentation&quot;&gt;Documentation&lt;/h4&gt;

&lt;p&gt;We started a new repository, &lt;a href=&quot;https://github.com/witheve/docs&quot;&gt;witheve/docs&lt;/a&gt; for documentation, tutorials, and guides. Right now, the Eve team will be contributing the majority of documentation, but we hope that the docs will be a community driven effort. For most open source projects, this is an area where even beginners to the community can contribute. Unfortunately, it’s also an area that is lacking in many projects. We’ll get the ball rolling on docs ourselves, but it would still be helpful to let us know what kind of docs, guides, or tutorials are missing/needed to make learning Eve easier. To propose anything, just open a pull request with some details on the proposed document.&lt;/p&gt;

&lt;p&gt;One series of guides we are planning is “Eve for …”, which will target specific domains and offer advice on how to get started with Eve. For example, we’ve already thought of “Eve for web developers”, “Eve for scientists”, etc. We hope that this series will be a starting point for anyone who is curious about Eve, but doesn’t know exactly what Eve is about and how it can benefit them. We’ll talk about Eve from the perspective of the potential user, and describe how it can fit into their workflow. Again, let us know if you have any ideas for this series.&lt;/p&gt;

&lt;h3 id=&quot;example-applications&quot;&gt;Example Applications&lt;/h3&gt;

&lt;p&gt;As part of testing our language, we’ve been busy writing more substantial applications than we have to date. Here is a sampling of the more notable ones:&lt;/p&gt;

&lt;h4 id=&quot;todomvc---code&quot;&gt;TodoMVC - &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/examples/todomvc.eve&quot;&gt;Code&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/evetodomvc.png&quot; alt=&quot;Eve - TODO MVC&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;tic-tac-toe---code&quot;&gt;Tic-Tac-Toe - &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/examples/todomvc.eve&quot;&gt;Code&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/tic-tac-toe.gif&quot; alt=&quot;Eve - Tic-Tac-Toe&quot; /&gt;&lt;/p&gt;

&lt;h4 id=&quot;flappy-bird---code&quot;&gt;Flappy Bird - &lt;a href=&quot;https://github.com/witheve/Eve/blob/master/examples/flappy.eve&quot;&gt;Code&lt;/a&gt;&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/flippy-flop.gif&quot; alt=&quot;Eve - Flappy Bird&quot; /&gt;&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>A Declarative Clock in Eve</title>
   <link href="http://incidentalcomplexity.com/2016/07/21/clock/"/>
   <updated>2016-07-21T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/07/21/clock/</id>
   <content type="html">&lt;p&gt;&lt;em&gt;This post has been updated. See the original &lt;a href=&quot;https://github.com/Kodowa/incidentalcomplexity/blob/5fbce96aecc7172166d130406e9e3c42bbbb27dc/_posts/2016-07-21-clock.md&quot;&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;An analog clock is an obligatory example for reactive programming languages. It’s got all the right pieces: an event stream that changes over time, and a way to present those changes visually. Here is our version:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/eveclock.gif&quot; alt=&quot;A Clock in Eve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This clock is written in the Eve developer syntax, which is proposed in our first &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md&quot;&gt;Request for Comments (RFC)&lt;/a&gt;. In this post, I’ll go through the code and explain how it works.&lt;/p&gt;

&lt;h3 id=&quot;eve-code&quot;&gt;Eve code&lt;/h3&gt;

&lt;p&gt;Eve code is written as a series of blocks, each of which can be thought of as operating in two phases:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;strong&gt;Phase 1: search&lt;/strong&gt; - select objects from the Eve DB by searching patterns&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;Phase 2: Action&lt;/strong&gt; - change the Eve DB by either adding, setting, removing, or merging objects.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The clock program consists of two blocks: the first generically defines a clock hand, while the second defines the drawing of the clock. Let’s focus on each block in turn.&lt;/p&gt;

&lt;h3 id=&quot;draw-a-clock-hand&quot;&gt;Draw a clock hand&lt;/h3&gt;

&lt;p&gt;First, we define how a clock hand is drawn. Although an analog clock has three hands, we can write code as if we’re drawing a single hand; Eve’s &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#set-semantics&quot;&gt;set semantics&lt;/a&gt; take care of drawing multiple hands, so no iterators like a &lt;code class=&quot;highlighter-rouge&quot;&gt;for&lt;/code&gt; statement are necessary.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search

    // Select #clock-hands with angle and length attributes
    hand = [#clock-hand angle length]

    // Calculate coordinates for drawing a hand
    x2 = 50 + (length * sin[angle])
    y2 = 50 - (length * cos[angle])

// Bind tells Eve to update objects as values change
bind

    // Merge line coordinates into hand, tag it as a #line
    hand &amp;lt;- [#line, x1: 50, y1: 50, x2, y2]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Blocks start with the &lt;code class=&quot;highlighter-rouge&quot;&gt;search&lt;/code&gt; phase, indicated by the &lt;code class=&quot;highlighter-rouge&quot;&gt;search&lt;/code&gt; fence. Within the &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#phase-1-search&quot;&gt;search&lt;/a&gt;, the programmer gathers all of the objects from the Eve DB needed to complete the block. Blocks only enter the &lt;code class=&quot;highlighter-rouge&quot;&gt;action&lt;/code&gt; phase if all supplied objects in the &lt;code class=&quot;highlighter-rouge&quot;&gt;search&lt;/code&gt; resolve against an object in the Eve DB.&lt;/p&gt;

&lt;p&gt;In the first line of the search, we encounter our first &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#objects&quot;&gt;object&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;hand = [#clock-hand angle length]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Objects are a set of attribute:value pairs enclosed in square brackets. They ask Eve to find all the entities that fit the supplied attribute shape. The &lt;code class=&quot;highlighter-rouge&quot;&gt;hand&lt;/code&gt; object seen here is asking Eve to find every object &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#tag-selector---&quot;&gt;tagged&lt;/a&gt; &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt; that also has the attributes &lt;code class=&quot;highlighter-rouge&quot;&gt;angle&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;length&lt;/code&gt;. We use the &lt;code class=&quot;highlighter-rouge&quot;&gt;angle&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;length&lt;/code&gt; attributes of this object to calculate two values, &lt;code class=&quot;highlighter-rouge&quot;&gt;x1&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;y2&lt;/code&gt;, which we will use as coordinates for the lines that draw the clock hands.&lt;/p&gt;

&lt;p&gt;Now we enter the &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#phase-2-action&quot;&gt;action phase&lt;/a&gt; of the query, indicated by the use of the &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; fence (one of two fences applicable to the &lt;code class=&quot;highlighter-rouge&quot;&gt;action&lt;/code&gt; phase). The &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; fence says that we are finished reading from the Eve DB, and now we are ready to write to it. The use of the &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; fence in particular says that as the objects in the &lt;code class=&quot;highlighter-rouge&quot;&gt;search&lt;/code&gt; change, Eve will keep their dependant objects up-to-date.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;hand &amp;lt;- [#line, x1: 50, y1: 50, x2, y2]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here, we use the merge operator &lt;code class=&quot;highlighter-rouge&quot;&gt;&amp;lt;-&lt;/code&gt;, one of four &lt;a href=&quot;https://github.com/witheve/rfcs/blob/master/proposed/syntax.md#action-operators&quot;&gt;action operators&lt;/a&gt;. The merge operator merges one object with another. In this case, we are merging the object &lt;code class=&quot;highlighter-rouge&quot;&gt;[#line, x1: 50, y1: 50, x2, y2]&lt;/code&gt; into the &lt;code class=&quot;highlighter-rouge&quot;&gt;hand&lt;/code&gt; object. This means that every &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt; with &lt;code class=&quot;highlighter-rouge&quot;&gt;angle&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;length&lt;/code&gt; attributes also has a &lt;code class=&quot;highlighter-rouge&quot;&gt;#line&lt;/code&gt; tag, as well as &lt;code class=&quot;highlighter-rouge&quot;&gt;x1&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;x2&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;y1&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;y2&lt;/code&gt; attributes.&lt;/p&gt;

&lt;p&gt;That’s all this block does: it selects every &lt;code class=&quot;highlighter-rouge&quot;&gt;[#clock-hand angle length]&lt;/code&gt;, and tags each one as a &lt;code class=&quot;highlighter-rouge&quot;&gt;#line&lt;/code&gt;, which Eve knows how to draw using &lt;code class=&quot;highlighter-rouge&quot;&gt;x1&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;x2&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;y1&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;y2&lt;/code&gt;. Let’s see how that’s done.&lt;/p&gt;

&lt;h3 id=&quot;draw-a-clock&quot;&gt;Draw a clock&lt;/h3&gt;

&lt;p&gt;In this block, we define the clock using a face drawn as a circle, and three &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hands&lt;/code&gt; drawn as lines.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;search

    // Select the current time
    [#time hours minutes seconds]

// Update the SVG as the time changes
bind

    // Add an SVG element to the root of the DOM       
    [#svg viewBox: &quot;0 0 100 100&quot;, width: &quot;300px&quot;, children:

        // Add a clock face at (50,50) with radius 45.
        [#circle cx: 50, cy: 50, r: 45, fill: &quot;#0B79CE&quot;]

        // Add the hours hand    
        [#clock-hand #hour-hand angle: 30 * hours, length: 30, stroke: &quot;#023963&quot;]

        // Add the minutes hand 
        [#clock-hand #minute-hand angle: 6 * minutes, length: 40, stroke: &quot;#023963&quot;]

        // Add the seconds hand 
        [#clock-hand #second-hand angle: 6 * seconds, length: 40, stroke: &quot;#ce0b46&quot;]]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This block (as with all blocks) follows the familiar search -&amp;gt; action pattern. For this block’s search, we select the current time, represented by the &lt;code class=&quot;highlighter-rouge&quot;&gt;#time&lt;/code&gt; object; and its attributes &lt;code class=&quot;highlighter-rouge&quot;&gt;hours&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;minutes&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;seconds&lt;/code&gt;. This object is just like any other, but under the covers Eve keeps it up to date as the system clock changes.&lt;/p&gt;

&lt;p&gt;Again we use the &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; fence, because we want Eve to update the clock drawing as the time changes. Behind the &lt;code class=&quot;highlighter-rouge&quot;&gt;bind&lt;/code&gt; fence, we add an SVG element:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;[#svg viewBox: &quot;0 0 100 100&quot;, width: &quot;300px&quot;, children: ... ]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Since no parent is specified, the SVG element will be rendered as a child of the DOM root. Next, we add the clock elements as children of the SVG element. We add the clock face (a blue circle with a center at (50, 50) with radius 45):&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;[#circle cx: 50, cy: 50, r: 45, fill: &quot;#0B79CE&quot;] 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and three hands:&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-eve&quot;&gt;[#clock-hand #hour-hand angle: 30 * hours, length: 30, stroke: &quot;#023963&quot;]
[#clock-hand #minute-hand angle: 6 * minutes, length: 40, stroke: &quot;#023963&quot;]
[#clock-hand #second-hand angle: 6 * seconds, length: 40, stroke: &quot;#ce0b46&quot;]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now we can see how this block ties back to the first one; the objects representing the hands of the clock are tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;#clock-hand&lt;/code&gt; and have &lt;code class=&quot;highlighter-rouge&quot;&gt;angle&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;length&lt;/code&gt; attributes. This is exactly the pattern we were searching against in the first block! Thus, the loop is completed, and the clock hands are drawn as lines based on the current time as an angle.&lt;/p&gt;

&lt;h3 id=&quot;try-it-yourself&quot;&gt;Try it yourself!&lt;/h3&gt;

&lt;p&gt;You can download Eve and try the clock yourself! The easiest way is to use our docker container:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker pull witheve/eve
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;You can also download the Eve source and build it yourself (Linux and OSX only for now):&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git clone https://github.com/witheve/Eve.git
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Instructions to build are available on the &lt;a href=&quot;https://github.com/witheve/Eve&quot;&gt;witheve/eve repository&lt;/a&gt;.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Community Spotlight: Eve on a PocketCHIP</title>
   <link href="http://incidentalcomplexity.com/2016/07/12/pocketchip/"/>
   <updated>2016-07-12T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/07/12/pocketchip/</id>
   <content type="html">&lt;p&gt;In our &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/30/apr/&quot;&gt;latest Dev Diary&lt;/a&gt;, we showed off the latest Eve REPL. Well, not too long after, &lt;a href=&quot;https://twitter.com/markrhacker1&quot;&gt;Mark R. Hacker&lt;/a&gt; managed to get Eve and the REPL running on his PocketCHIP.&lt;/p&gt;

&lt;blockquote class=&quot;twitter-tweet&quot; data-lang=&quot;en&quot;&gt;
  &lt;p lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;
    &lt;a href=&quot;https://twitter.com/nextthingco&quot;&gt;@nextthingco&lt;/a&gt;
    &lt;a href=&quot;https://twitter.com/hashtag/PocketCHIP?src=hash&quot;&gt;#PocketCHIP&lt;/a&gt;
    &lt;a href=&quot;https://twitter.com/ibdknox&quot;&gt;@ibdknox&lt;/a&gt;
    &lt;a href=&quot;https://twitter.com/with_eve&quot;&gt;@with_eve&lt;/a&gt;
    &lt;br /&gt;
    Eve running on my PocketChip. :-)
    &lt;a href=&quot;https://t.co/snLogzeRbS&quot;&gt;pic.twitter.com/snLogzeRbS&lt;/a&gt;
  &lt;/p&gt;
  &amp;mdash; Mark Robert Hacker (@MarkRHacker1)
  &lt;a href=&quot;https://twitter.com/MarkRHacker1/status/751147433997004800&quot;&gt;July 7, 2016&lt;/a&gt;
&lt;/blockquote&gt;
&lt;script async=&quot;&quot; src=&quot;//platform.twitter.com/widgets.js&quot; charset=&quot;utf-8&quot;&gt;
&lt;/script&gt;

&lt;p&gt;Check it out!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/pocketchip1.jpg&quot; alt=&quot;EvePocketChip&quot; /&gt;&lt;/p&gt;

&lt;p&gt;(image courtesy Mark R. Hacker)&lt;/p&gt;

&lt;p&gt;I wasn’t very familiar with this device before now, but apparently it’s an ultra-low-cost computer akin to the Raspberry Pi. The CHIP sports a 1GHz SOC, and 512 MB of RAM, so it’s not exactly an anemic machine. Still, it’s the weakest machine to ever run Eve, and to my knowledge, this represents the first time that Eve has been compiled to ARM. Mark reports that since the CHIP runs Debian, all he had to do was follow the standard build instructions to compile natively to ARM on the device. However, he noted that starting Eve actually took 10 minutes, so you need some patience. Despite this, Mark reports that the REPL runs fine in the Iceweasel browser.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/pocketchip3.jpg&quot; alt=&quot;EvePocketChip&quot; /&gt;&lt;/p&gt;

&lt;p&gt;(image courtesy Mark R. Hacker)&lt;/p&gt;

&lt;p&gt;Mark is currently working on getting the newest version of Eve working on his PocketCHIP, so we’ll check back with him later for an update on his progress.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (April 2016)</title>
   <link href="http://incidentalcomplexity.com/2016/06/30/apr/"/>
   <updated>2016-06-30T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/30/apr/</id>
   <content type="html">&lt;h3 id=&quot;ui&quot;&gt;UI&lt;/h3&gt;

&lt;p&gt;In March we revisited &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/03/oct-nov/&quot;&gt;GridEve&lt;/a&gt;, adapting it to fit more in line with the ethos of Eve; GridEve had a runtime based on data-flow, instead of the relational model we ultimately want. What we liked most about GridEve was the immediate usefulness of the grid model, so we decided to marry that with a relational engine in a new project: WikiGrid. In the last update, we looked at some interaction-level details of WikiGrid. Now, I’ll show some of our ideas about how the relational model can fit in a grid world.&lt;/p&gt;

&lt;h4 id=&quot;querying-with-grids&quot;&gt;Querying with Grids&lt;/h4&gt;

&lt;p&gt;One obvious possibility is just to have relational functions and to allow the user to write them in cells. But that doesn’t really take advantage of the relational nature of the Eve platform – you could do this in any language. Eventually, we stumbled upon a really simple yet absolutely cool idea: give semantic meaning to cell adjacency. Consider this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid2.png&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, the cell &lt;code class=&quot;highlighter-rouge&quot;&gt;person&lt;/code&gt; means “select all the entities tagged person”. The adjacent cell &lt;code class=&quot;highlighter-rouge&quot;&gt;age&lt;/code&gt; means “select the attribute age for the adjacent collection” i.e. &lt;code class=&quot;highlighter-rouge&quot;&gt;person.age&lt;/code&gt;, which returns the set of all ages of “person”s in the system.&lt;/p&gt;

&lt;p&gt;Building under that, we use a reserved word &lt;code class=&quot;highlighter-rouge&quot;&gt;without&lt;/code&gt;, an alias for the anti-join operator. The adjacent blocks &lt;code class=&quot;highlighter-rouge&quot;&gt;width&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;height&lt;/code&gt; mean &lt;code class=&quot;highlighter-rouge&quot;&gt;person.width&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;person.height&lt;/code&gt;. So the overall query will select all entities with a “person” tag and an attribute age, that do not have width or height attributes.&lt;/p&gt;

&lt;p&gt;In textual form, this would be written:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [age]
  (fact name :tag &quot;person&quot; :age)
  (not
    (fact name :tag &quot;person&quot; :width :height))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This was very exciting for us, because you could basically write out a complicated query with no syntax. This was by far our fastest way to write a query yet. Here’s what writing one of these looks like in WikiGrid:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid4.gif&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, we mark off a 5x4 area as a macro cell. Then we name the macro cell “test” and give it a “Formula Grid” type. If you look closely at the autocomplete that pops up, you’ll see the cell can take on many types: table, code, image, text, chart, drawing, etc. Most of these weren’t wired up yet, but it illustrated the idea that cells can contain anything.&lt;/p&gt;

&lt;p&gt;So let’s put it all together and see how it works when it’s hooked up to an evaluator. The runtime in this example was our new Clojure runtime from last month.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid5.gif&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We start out in a grid and name it “Chris” by adding an attribute cell. Each grid represents a single entity, so any attributes added to the grid are attached to that entity. Grids start out nameless, so giving it a name provides a handle to the grid. We then add two more attributes: an &lt;code class=&quot;highlighter-rouge&quot;&gt;age&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;tag&lt;/code&gt;. The &lt;code class=&quot;highlighter-rouge&quot;&gt;tag&lt;/code&gt; attribute is a convention used to group similar entities. By adding the tag “person”, we are now able to talk about collections of “person”s by joining on that tag.&lt;/p&gt;

&lt;p&gt;Next, we create a formula grid, and we query for &lt;code class=&quot;highlighter-rouge&quot;&gt;person.age&lt;/code&gt;. The result of the query shows up in the bottom half of the formula grid as we type. Chris is the only result, since he’s the only entity in the system, so let’s add some more.&lt;/p&gt;

&lt;p&gt;Chris has a friend named Rob, so we add him as a new entity under &lt;code class=&quot;highlighter-rouge&quot;&gt;chris.friend&lt;/code&gt;. We then navigate to Rob’s grid, which was automatically created when we added Rob as a friend of Chris. Now we just add &lt;code class=&quot;highlighter-rouge&quot;&gt;rob.age&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;rob.tag&lt;/code&gt; and he shows up in the formula grid. We can do the same thing for Chris’ other friend Bob, and we see he is added as well.&lt;/p&gt;

&lt;p&gt;This is a relatively simple example, but we can write arbitrarily complex queries this way:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid3.png&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This query draws the name and age of a person in HMTL. The name is in one div, styled red, while the age is in another div, styled blue.&lt;/p&gt;

&lt;h3 id=&quot;platform-work&quot;&gt;Platform Work&lt;/h3&gt;

&lt;h4 id=&quot;language&quot;&gt;Language&lt;/h4&gt;

&lt;p&gt;We added more language features to the runtime, including &lt;code class=&quot;highlighter-rouge&quot;&gt;choose&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;not&lt;/code&gt;, and various aggregates.&lt;/p&gt;

&lt;h5 id=&quot;choose&quot;&gt;Choose&lt;/h5&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;choose&lt;/code&gt; statement works kind of like an &lt;code class=&quot;highlighter-rouge&quot;&gt;if&lt;/code&gt; statement in other languages; it has multiple arms, one of which is evaluated based on a condition. For us, each arm is its own sub-query. The condition for evaluation is whether or not there are any results in the sub-query. The first arm of the &lt;code class=&quot;highlighter-rouge&quot;&gt;choose&lt;/code&gt; with a result is the one that gets evaluated, so this is one case where order does matter in Eve. Take a look at this example:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [grade score]
  (fact name :score)
  (choose [grade score]
    (query
      (&amp;gt;= score 90)
      (= grade &quot;A&quot;))
    (query
      (&amp;gt;= score 80)
      (= grade &quot;B&quot;))
    (query
      (&amp;gt;= score 70)
      (= grade &quot;C&quot;))
    (query
      (&amp;gt;= score 60)
      (= grade &quot;D&quot;))
    (query
      (&amp;gt; score 0)
      (= grade &quot;F&quot;))))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, we are assigning a letter grade given a numerical score. The &lt;code class=&quot;highlighter-rouge&quot;&gt;choose&lt;/code&gt; statement itself has its own &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/10/jan-feb/&quot;&gt;projection&lt;/a&gt;, so you can decide which variables internal to the &lt;code class=&quot;highlighter-rouge&quot;&gt;choose&lt;/code&gt; are accessible in the parent query.&lt;/p&gt;

&lt;h5 id=&quot;not&quot;&gt;Not&lt;/h5&gt;

&lt;p&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;not&lt;/code&gt; statement is an anti-join operator. Its body is a query, and any results within are excluded from the parent query. For instance:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [names]
  (fact names :tag &quot;person&quot;)
  (not
    (fact names :tag &quot;employee&quot;)))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;will return all of the entities tagged “person” that are not also tagged “employee”.&lt;/p&gt;

&lt;h5 id=&quot;aggregates&quot;&gt;Aggregates&lt;/h5&gt;

&lt;p&gt;We got some aggregates working for this version as well. Aggregates work just like regular functions, except they can change the cardinality of the output. So &lt;code class=&quot;highlighter-rouge&quot;&gt;sum&lt;/code&gt; takes in a set of cardinality N and returns a set of cardinality 1. You have to keep this in mind, or your results might not be what you expect (something we didn’t really like. We later found better semantics for aggregates, which I’ll talk about in a future post). Here is an example of &lt;code class=&quot;highlighter-rouge&quot;&gt;sum&lt;/code&gt; in practice:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [sum-result]
  (fact e :score)
  (= sum-result (sum score)))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will store the sum of all the scores in sum-result.&lt;/p&gt;

&lt;h4 id=&quot;repl-github&quot;&gt;REPL (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/e73b18d8111d5ddb73427bcb00f0501fdc9b8f2f&quot;&gt;github&lt;/a&gt;)&lt;/h4&gt;

&lt;p&gt;The REPL received a visual overhaul and several additional features. First, let’s take a look at the new layout.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl4.png&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;

&lt;p&gt;You can immediately see some new features here. First, we’ve changed the layout a little. We have a toolbar on the left, and the REPL “cards” on the right. We have a button to get another column of cards, which gives us a restricted grid layout.&lt;/p&gt;

&lt;p&gt;While the REPL is still written in Typescript, we’ve bootstrapped several elements. On the side, we have a space to see all the entities and tags in the system. If we click on an entity, we can see its attributes table. If we click on a tag, we can see a list of all entities with that tag (you can see an example of this in the GIF below).&lt;/p&gt;

&lt;p&gt;These are supported by two queries that listen for entities and tags:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// get all entities that are not system entities
(query [entities attributes values]
  (fact-btu entities attributes values)
    (not
      (fact entities :tag &quot;system&quot;)))
      
// get all tags that are not also system tags
(query [tag entity],
  (fact entity :tag tag)
    (not
      (fact entity :tag &quot;system&quot;)))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The client leaves these queries open, so it continuously receives updates as new entities and tags are added.&lt;/p&gt;

&lt;p&gt;We also added various views to the output. The view defaults to the results table, which displays the current state of the results. You can also see this History, which logs the incremental changes to the table. This is just a local history according to the client, but eventually this will be a history according to the server. This will allow features like the ability to see the state of the table at an arbitrary time.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl5.png&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The info tab displays information from the compiler about the query for debugging purposes. So far, we display the intermediate expansion of the query, as well as Eve bytecode.&lt;/p&gt;

&lt;p&gt;We also added a chat system. This required some notion of a user, so we added something quick and dirty. If you try to use the REPL yourself, the first thing you’ll see is a login screen. When you submit a username and password here (use eve/eve), we compare it against the users stored in the Eve DB (obviously this is not secure at all, it was just a proof of concept).&lt;/p&gt;

&lt;p&gt;Now that you’ve logged in, you can send and receive messages:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl1.gif&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This whole process is also supported by the Eve backend. When you send a message, we add a new fact into the database, containing the message text, as well as your user ID and the local machine timestamp:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query []
  (insert-fact! &quot;${uuid()}&quot; :tag &quot;system&quot;
                            :tag &quot;repl-chat&quot;
                            :message &quot;${message}&quot;
                            :user &quot;${repl.user.id}&quot;
                            :timestamp &quot;${t}&quot;))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Every other client is listening for new messages:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [id user message time]
  (fact id :tag &quot;repl-chat&quot;
           :message message
           :user user
           :timestamp time))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Right now we still have more work to do to draw UI, so the messages are displayed using Typescript. But soon we’ll be able to bootstrap this whole process (actually, if you want to see what a full chat component looks like in our latest sytanx, you can check it out &lt;a href=&quot;https://github.com/witheve/lueve/blob/master/examples/chat.eve&quot;&gt;here&lt;/a&gt;. This version even has the ability to support multiple channels.).&lt;/p&gt;

&lt;h5 id=&quot;build-instructions&quot;&gt;Build instructions:&lt;/h5&gt;

&lt;p&gt;If you’d like to try out the REPL yourself, it’s pretty easy to get running. We’ve tested this under Windows 10 and OSX El Capitan, but I don’t see any reason it shouldn’t run under Linux.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;First, you’ll need the following dependencies: Node.js, Clojure, &lt;a href=&quot;http://leiningen.org/&quot;&gt;Leinengen&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Next , clone the Eve repo from &lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/e73b18d8111d5ddb73427bcb00f0501fdc9b8f2f&quot;&gt;this commit&lt;/a&gt;.&lt;/li&gt;
  &lt;li&gt;Then cd into where you cloned Eve. Download node dependencies and compile the REPL:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; npm install
&amp;gt; npm run dev
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ol&gt;
  &lt;li&gt;When the REPL is finished building, you can kill that process and cd into the &lt;code class=&quot;highlighter-rouge&quot;&gt;/server&lt;/code&gt; directory. Then, all you need to do is:&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;gt; lein run
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This will compile and run the server. When it’s finished, you’ll have a REPL hosted at &lt;code class=&quot;highlighter-rouge&quot;&gt;http://localhost:8081/repl&lt;/code&gt;. The REPL was developed in Chrome, on Windows, but I’ve also verified it working on Firefox and Edge.&lt;/p&gt;

&lt;h4 id=&quot;ui-drawing&quot;&gt;UI Drawing&lt;/h4&gt;

&lt;p&gt;We also added the capability to specify UI with our syntax, obviating the need for HTML or CSS. We are interested in writing useful tools for ourselves in Eve, so we decided to write a little CI report generator.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(define-ui ci-run-result
  (fact test-run :tag &quot;testrun&quot; :number pr-number :branch :user :title :text description :additions :deletions)
  (fact test-result :tag &quot;testresult&quot; :run test-run :test :result)
  (fact-btu test-result &quot;result&quot; :tick)
  (= test-order (+ 100 (sort tick)))
  (= delta-text (str &quot;(+&quot; additions &quot; / -&quot; deletions &quot;)&quot;))
  (= pr (str &quot;#&quot; pr-number))
  (= url (str &quot;https://github.com/witheve/eve-experiments/pull/&quot; pr-number))
  (= branch-url (str &quot;https://github.com/witheve/eve-experiments/tree/&quot; branch))
  (= user-url (str &quot;https://github.com/&quot; user))
  (= test-class (str &quot;test &quot; result))

  (ui [title pr pr-number url user user-url delta-text branch branch-url description]
      (div :id run-tile :parent &quot;root&quot; :ix pr-number :class &quot;test-run&quot;)
      (h3 :id header :parent run-tile :ix 1)
        (div :parent header :ix 0 :class &quot;spacer&quot; :text title)
        (a :parent header :ix 1 :text pr :href url)
      (div :id user-tile :parent run-tile :ix 2 :class &quot;run-info&quot;)
        (div :parent user-tile :ix 0 :text delta-text)
        (div :parent user-tile :ix 1 :text &quot;in&quot;)
        (a :parent user-tile :ix 2 :text branch :href branch-url)
        (div :parent user-tile :ix 3 :text &quot;by&quot;)
        (a :parent user-tile :ix 4 :class &quot;user&quot; :text user :href user-url)
      (blockquote :parent run-tile :ix 3 :class &quot;description&quot; :text description))

  (ui [run-tile test test-class test-order]
      (div :id test-tile :parent run-tile :ix test-order :class test-class)
      (div :parent test-tile :ix 0 :text test)))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;It’s pretty simple when you break it down. You can think of the code in two phases. The first phase, we collect all the information necessary to render the cards:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;  // Get the test runs and their results. Joins via test-run
  (fact test-run :tag &quot;testrun&quot; :number pr-number :branch :user :title :text description :additions :deletions)
  (fact test-result :tag &quot;testresult&quot; :run test-run :test :result)

  // Sort results by tick order
  (fact-btu test-result &quot;result&quot; :tick)

  // Format some strings
  (= test-order (+ 100 (sort tick)))
  (= delta-text (str &quot;(+&quot; additions &quot; / -&quot; deletions &quot;)&quot;))
  (= pr (str &quot;#&quot; pr-number))
  (= url (str &quot;https://github.com/witheve/eve-experiments/pull/&quot; pr-number))
  (= branch-url (str &quot;https://github.com/witheve/eve-experiments/tree/&quot; branch))
  (= user-url (str &quot;https://github.com/&quot; user))
  (= test-class (str &quot;test &quot; result))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;In the second phase, we take the data and display them:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;// Draws a commit card. This card is repeated once for every commit
(ui [title pr pr-number url user user-url delta-text branch branch-url description]

    // Attaches the card to the DOM root
    (div :id run-tile :parent &quot;root&quot; :ix pr-number :class &quot;test-run&quot;)
    // Draws the header
    (h3 :id header :parent run-tile :ix 1)
      (div :parent header :ix 0 :class &quot;spacer&quot; :text title)
      (a :parent header :ix 1 :text pr :href url)

    // Draws the line &quot;(+{adds}/-{removes}) in {branch} by {user}&quot;
    (div :id user-tile :parent run-tile :ix 2 :class &quot;run-info&quot;)
      (div :parent user-tile :ix 0 :text delta-text)
      (div :parent user-tile :ix 1 :text &quot;in&quot;)
      (a :parent user-tile :ix 2 :text branch :href branch-url)
      (div :parent user-tile :ix 3 :text &quot;by&quot;)
      (a :parent user-tile :ix 4 :class &quot;user&quot; :text user :href user-url)
    // Draws the commit message
    (blockquote :parent run-tile :ix 3 :class &quot;description&quot; :text description))

// Draws the test results. This block is repeated once for every test
(ui [run-tile test test-class test-order]
    (div :id test-tile :parent run-tile :ix test-order :class test-class)
    (div :parent test-tile :ix 0 :text test)))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here is the result:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/evel-ci.png&quot; alt=&quot;Eve CI&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And we did all this in Eve without having to write separate HTML! The result is completely live, so any new commits are displayed as soon as the tests complete.&lt;/p&gt;

&lt;p&gt;The two-phase nature of this query (get some data -&amp;gt; do something with that data) is a general pattern we’ve found very useful for both reading and writing Eve programs. In newer versions of the Eve syntax, we make this pattern more explicit.&lt;/p&gt;

&lt;h3 id=&quot;moving-forward&quot;&gt;Moving Forward&lt;/h3&gt;

&lt;p&gt;This is the last post in our backlog of development diaries. Moving forward, we’ll keep a monthly cadence of dev diaries starting July. To cover our work in May and June, we have some special news, which we will be talking about shortly. As time goes by, and as Eve grows, I hope to keep the blog updated with more features like example Eve programs, community spotlights, tutorials, etc. So stay tuned!&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (March 2016 Part 2: Platform)</title>
   <link href="http://incidentalcomplexity.com/2016/06/22/mar2/"/>
   <updated>2016-06-22T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/22/mar2/</id>
   <content type="html">&lt;h3 id=&quot;platform&quot;&gt;Platform&lt;/h3&gt;

&lt;p&gt;For the platform, our main goal for March was to get a server running and everyone in the office connected to it and coding via a REPL. Over the course of a couple months we transitioned from a traditional row/tuple/table store model to storing &lt;code class=&quot;highlighter-rouge&quot;&gt;(Entity, Attribute, Value)&lt;/code&gt; triples called EAVs. To support additional features of the language, we expanded this triple to include additional parameters: Bag, Tick, and User. So the full specification for a fact is now &lt;code class=&quot;highlighter-rouge&quot;&gt;(Entity, Attribute, Value, Bag, Tick, User)&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;&lt;em&gt;Bag&lt;/em&gt; - This allows you to compose arbitrary datasets, and provides a mechanism to control visibility of facts. You might put all your facts about planets and astronomers into one bag, while your quarterly earnings report goes into a different bag. Bags will help us with features like version control and distribution. For example, the logic for a networked game like chess might be held in one bag. Then a specific instance of the game would include the game logic bag, as well as additional state facts. Then each player would have their own personal bags representing their local game state, which is coordinated to the other player through the instance bag.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;Tick&lt;/em&gt; - The time when the fact was created. This allows a partial ordering of the facts. I will have a lot more to say about this in a future post, but this enables some exciting features like time-travel debugging, what-if scenarios, and very low-cost, strong consistency.&lt;/li&gt;
  &lt;li&gt;&lt;em&gt;User&lt;/em&gt; - The ID of the user who created the fact. This would allow you to query or exclude all facts added to Eve by a particular user, for instance. Or it can be used to figure out who added a particular fact to the database. This will also help for things like permissions, where you can restrict access to edit/view certain facts. For example, you don’t want your employees to set their own salaries or see anyone else’s.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;server&quot;&gt;Server&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/2016/06/03/oct-nov/&quot;&gt;Cardwiki&lt;/a&gt; and &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/10/jan-feb/&quot;&gt;WikiEve&lt;/a&gt; used an old runtime written in TypeScript that relied on the client’s &lt;code class=&quot;highlighter-rouge&quot;&gt;localStorage&lt;/code&gt; to hold the database. Setup was easy for the user, but without a server we couldn’t easily support features like distribution, redundancy, or collaboration. Since Eric started in December, he had been working on a new runtime, (ClojEve, written in Clojure), as the rest of us worked on WikiEve. By April we were ready to migrate to this new environment, which means we needed a protocol. We landed on a JSON interface with four message types: query, error, result, and close.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;query:
{
    type: &quot;query&quot;
    id: id
    query: query
}

close
{
    type: &quot;close&quot;
    id: id
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The client can send two types of messages: a &lt;code class=&quot;highlighter-rouge&quot;&gt;query&lt;/code&gt; or a &lt;code class=&quot;highlighter-rouge&quot;&gt;close&lt;/code&gt;. Each query has a UUID. This is sent to the server along with a plain text query written in our query syntax (more on that in the next section). Any query sent to the server remains open indefinitely, until the client sends a &lt;code class=&quot;highlighter-rouge&quot;&gt;close&lt;/code&gt; message with the corresponding ID.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;result:
{
    type: &quot;result&quot;
    id: id
    adds: fact[]
    removes: fact[]
}

error:
{
    type: &quot;error&quot;
    id: id
    reason: reason
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;When the server first receives a query, it sends back a result message. This message is contains the ID of the associated query, along with any additions or removals from the results. The initial result will only have adds, since it is computed from scratch. But if the query remains open, adds and removes are sent incrementally as the database mutates.&lt;/p&gt;

&lt;h3 id=&quot;syntax-and-compiler&quot;&gt;Syntax and Compiler&lt;/h3&gt;

&lt;p&gt;Last month, we re-introduced a syntax for Eve for the first time since 2014. The syntax was an s-expression style syntax, intended for internal use only. In general, we were happy with this because it allowed us to easily translate tree-like structures to the syntax. For instance, this property made builing the NL interface easier. This month, we made some changes to the syntax to make it easier to write. We removed the &lt;code class=&quot;highlighter-rouge&quot;&gt;project!&lt;/code&gt; statement, replacing it with a bracket syntax. Further, we removed the &lt;code class=&quot;highlighter-rouge&quot;&gt;select&lt;/code&gt; statement, and replaced it with &lt;code class=&quot;highlighter-rouge&quot;&gt;fact&lt;/code&gt;, which can act like multiple &lt;code class=&quot;highlighter-rouge&quot;&gt;selects&lt;/code&gt; at once. For example, this&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
 (select &quot;eavs&quot; :entity &quot;apple&quot; :attribute &quot;color&quot; :value color)
 (select &quot;eavs&quot; :entity &quot;apple&quot; :attribute &quot;tag&quot; :value tag)
 (project! :color color :tag tag))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;becomes&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [color tag]
  (fact &quot;apple&quot; :color :tag))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is much simpler. This compiles using a two-stage process. We first parse the original input and translate that to an intermediate language (IL), which decomposes the query into a more primitive form. The above query compiles to the following IL:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query [color tag]
  (fact-btu :entity &quot;apple&quot; :attribute &quot;color&quot; :value color)
  (fact-btu :entity &quot;apple&quot; :attribute &quot;tag&quot; :value tag))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Here, the &lt;code class=&quot;highlighter-rouge&quot;&gt;fact&lt;/code&gt; statement has decomposed into two &lt;code class=&quot;highlighter-rouge&quot;&gt;fact-btu&lt;/code&gt; statements, which resemble the &lt;code class=&quot;highlighter-rouge&quot;&gt;select&lt;/code&gt; statement of the previous syntax. IL code then goes through another level of translation into Eve bytecode. The above IL code translates into the following bytecode:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;((bind
  main
   ((tuple [3] [0] [1] * nil) (send &quot;query2725||color,tag&quot; [3])))
 (bind
   &quot;query2725||color,tag&quot;
   ((scan [3] [])
    (delta-e [4] [3])
    (= [3] [4 0] &quot;apple&quot;)
    (filter [3]) (= [3] [4 1] &quot;color&quot;)
    (filter [3]) (scan [3] [])
    (delta-e [5] [3])
    (= [3] [5 0] &quot;apple&quot;)
    (filter [3])
    (= [3] [5 1] &quot;tag&quot;)
    (filter [3])
    (tuple [3] [0] [1] [2 2] nil [4 2] [5 2])
    (send &quot;query2725||color,tag-cont&quot; [3])))
 (bind
   &quot;query2725||color,tag-cont&quot;
   ((delta-c [4] [5])
    (tuple [3] [0] [1] [4] [5])
    (send out [3]))))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally, the above code is sent to the executor, which executes the code and returns a result. In the context of the client-server architecture, the result is packaged as an incremental add/remove message, which is sent to all clients listening to that query. If the executor encounters an error while running the query, an error message is created, indicating what the error was, and where in the source the error occurred.&lt;/p&gt;

&lt;p&gt;The IL and bytecode translations for each query are passed to the sender in an “info” message. This message contains metadata meant to enable interesting interactions for editors. For example, we can add the whole parse tree to this message, and then a client editor can use the tree to style code.&lt;/p&gt;

&lt;h3 id=&quot;repl-github&quot;&gt;REPL (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/90a6c6bc4597572a29c72119fc7bb964426f8107&quot;&gt;github&lt;/a&gt;)&lt;/h3&gt;

&lt;p&gt;Putting it all together, we started building a REPL. A basic REPL for Eve is actually very simple, given the protocol laid out above. When you start the REPL, it opens a websocket connection to an Eve server. Then you can type a query in a textbox and send it to the server. The REPL forms a message according to the query protocol and waits for a response from the server. When a response is received, the REPL displays it according to its type. Result messages are rendered as a table, while error messages are rendered as text.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl1.png&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In this example REPL session, the user added some new facts about apples in the first card. In the second card, the user asked for all EAV facts in the system, which are displayed in a table. The final query is malformed, so Eve returned an error message.&lt;/p&gt;

&lt;p&gt;But since this isn’t an ordinary REPL for an ordinary language, we have some nice behaviors. Queries are left open by default, so they continuously receive updates from the server as they become available. So if another Eve user adds a fact that affects any of your open queries, you’ll see that change immediately.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl2.png&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here, the user added new facts about lemons, which are added to the result table in the second query.&lt;/p&gt;

&lt;p&gt;Other features include the ability to save/load REPL workspaces to/from a file, automatic reconnect if the server dies, and the ability to export result tables as CSV files. And of course, dark mode!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/repl3.png&quot; alt=&quot;REPL&quot; /&gt;&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (March 2016 Part 1: UI)</title>
   <link href="http://incidentalcomplexity.com/2016/06/22/mar1/"/>
   <updated>2016-06-22T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/22/mar1/</id>
   <content type="html">&lt;p&gt;So it turns out we did a lot in March. I’m breaking the March Dev Diary into two parts. This part will focus on the UI, while Part 2 will focus on the platform work we did.&lt;/p&gt;

&lt;p&gt;In February we &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/10/jan-feb/&quot;&gt;released WikiEve&lt;/a&gt; to friends and family, hoping to get some good feedback on our new direction. Our ideas about the UI had evolved significantly since the release of V0, so we were excited to hear what people had to say.&lt;/p&gt;

&lt;h3 id=&quot;formulas&quot;&gt;Formulas&lt;/h3&gt;
&lt;p&gt;In March, we spent a lot of time looking at ways to improve the NL interface, &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/14/nlqp/&quot;&gt;due to feedback&lt;/a&gt; we received on WikiEve. We started by considering a controlled natural language interface, which would drastically simplify the NL problem while still being readable. However, we soon arrived at something that felt more akin to Excel formulas.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/formula1.png&quot; alt=&quot;Formula&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A user of the NL interface might have asked this as “What is the average number of moons per planet?”. The formula version is a little awkward to read, but an English reader without any coding experience could figure out what this sentence means.&lt;/p&gt;

&lt;p&gt;One issue with this introduces a scoping problem. The NL interface was designed to figure out the extent of functions like average and count. Is this &lt;code class=&quot;highlighter-rouge&quot;&gt;average(count(moons)) per plant&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;average(count(moons per planet))&lt;/code&gt;? This version makes that explicit&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/formula2.png&quot; alt=&quot;Formula&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Another thing the NL interface did was find relations between words that were not directly related. In a previous post we looked at the example &lt;code class=&quot;highlighter-rouge&quot;&gt;sum salary per department&lt;/code&gt;. Here, &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt; are only related through the employees. This version makes that explicit&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/formula3.png&quot; alt=&quot;Formula&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Even a version closer to Excel is still not that bad. Excel has proven that people are capable of writing formulas in this style, so with the right tools and guidance, they should be able to write something like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/formula4.png&quot; alt=&quot;Formula&quot; /&gt;&lt;/p&gt;

&lt;p&gt;We even started experimenting with how a user might write multi-step queries. In Excel, you would reference the result of another cell, using a cell address like &lt;code class=&quot;highlighter-rouge&quot;&gt;A3&lt;/code&gt;. Here, you can reference different steps of a calculation. This helps guide the user to break down complicated queries into smaller steps. If you read the queries from top to bottom, it’s pretty clear what’s going on here. The grammar is not true English, but it’s close enough to feel familiar.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/formula5.png&quot; alt=&quot;Formula&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In the end, we didn’t implement any of these formula concepts in a working system. After about a week of riffing on this concept, we arrived at a different take that was much more promising.&lt;/p&gt;

&lt;h3 id=&quot;grideve--wikieve--wikigrid&quot;&gt;GridEve + WikiEve = WikiGrid&lt;/h3&gt;

&lt;p&gt;In developing Eve, we often tend to circle around ideas. This is the case again, as we decided to revisit GridEve (for background on GridEve, see the this &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/03/oct-nov/&quot;&gt;Dev Diary&lt;/a&gt;). One key property we want Eve to have is the ability to be instantly useful. Even if you have no idea how to use Excel, you can at least type things into cells and use the grid to organize ideas. I’ve started many useful spreadsheets this way.
 Most versions of Eve so far have required some upfront work before the system became a useful tool e.g. requiring the user to import data or define a schema.
GridEve was one of the first versions that had the property of being immediately useful, so we wanted to explore that more. Also, our work on the formula language lead us to an interesting way to formulate queries using a grid. Let’s take a look at GridEve 2.0: WikiGrid.&lt;/p&gt;

&lt;h4 id=&quot;interface&quot;&gt;Interface&lt;/h4&gt;

&lt;p&gt;The UI is a combination of GridEve and WikiEve. The user is initially presented with a grid of cells. Each cell is square and fixed, in contrast to Excel, where they can be resized. Cells in WikiGrid can contain anything, such as text, tables, formulas, or even cards from WikiEve&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid1.png&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Even though the grid is fixed, you can select multiple cells and turn them into a “macro cell”, which offers some interesting interactions. Here, a user is navigating using a keyboard.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid1.gif&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And here, a user is selecting various cells. When any occupied cells (the large white ones) fall in the selection window, only those are selected. When only empty cells are in the selection window, they are selected.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid2.gif&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Finally, we see how sub-grids can be embedded in a cell. It’s grids all the way down. The ghosting cursor was an experiment to see if hiding gridlines made it look cleaner.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikigrid3.gif&quot; alt=&quot;WikiGrid&quot; /&gt;&lt;/p&gt;

&lt;p&gt;That’s it for the UI. In &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/22/mar2/&quot;&gt;Part 2&lt;/a&gt; we’ll take a look at how the platform changed in March.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Natural Language Querying</title>
   <link href="http://incidentalcomplexity.com/2016/06/14/nlqp/"/>
   <updated>2016-06-14T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/14/nlqp/</id>
   <content type="html">&lt;p&gt;As if Eve wasn’t enough work already, we decided to experiment with a natural language (NL) interface. While we recognized at the outset that natural language processing (NLP) is an unsolved problem, we couldn’t resist its siren song. I mean, what could be better for non-programmers than the ability to write a program in plain English (or their native language of choice)?&lt;/p&gt;

&lt;p&gt;Despite the technical challenge, we thought we had a sufficiently constrained version of the problem that perhaps we had a shot at solving it. Typical NLP tasks include machine translation, article summarization, &lt;a href=&quot;https://en.wikipedia.org/wiki/Sentiment_analysis&quot;&gt;sentiment analysis&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Part-of-speech_tagging&quot;&gt;part-of-speech tagging&lt;/a&gt;, &lt;a href=&quot;https://en.wikipedia.org/wiki/Coreference&quot;&gt;coreference&lt;/a&gt; resolution, and &lt;a href=&quot;https://en.wikipedia.org/wiki/Named-entity_recognition&quot;&gt;named entity recognition&lt;/a&gt;. Today’s best approaches train a classifier using a large corpus of annotated training text. Depending on the text and task, performance ranges from impressive (POS tagging, coreference resolution) to “needs work” (article summarization, sentiment analysis). This would be considered a statistics-based approach.&lt;/p&gt;

&lt;p&gt;Our NLP task was very specific: to turn a plain English query into a formal query recognized by Eve. Thus, we leveraged a number of assumptions that simplified the problem enough to make it tractable (or at least we hoped).&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;We only had to deal with a single class of text: questions no longer than a sentence. We didn’t have to deal with harder tasks like understanding a whole news article.&lt;/li&gt;
  &lt;li&gt;Users could only ask about entities in the Eve database, so named entity recognition was just a lookup in the Eve database.&lt;/li&gt;
  &lt;li&gt;People typically ask questions in a limited number of ways, often starting with keywords like who, what, when, and where.&lt;/li&gt;
  &lt;li&gt;Questions are usually of a similar construction, i.e. people don’t usually invert questions, unless they’re Yoda.&lt;/li&gt;
  &lt;li&gt;Again, since you can only ask questions about data in the database, any ambiguities could be enumerated and presented to the user.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thus, we hoped that even if we couldn’t answer every question, we could handle the vast majority with a set of simple heuristics, and then cover the very long tail of questions we can’t handle with case-specific rules (heuristics) that we build over time.&lt;/p&gt;

&lt;h3 id=&quot;method&quot;&gt;Method&lt;/h3&gt;

&lt;p&gt;Let’s take a look at an example query and its output. The English query &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;What is Corey's age?&quot;&lt;/code&gt; would be transformed into the following formal query:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
 (select &quot;eavs&quot; :entity &quot;corey&quot; :attribute &quot;age&quot; :value corey|age)
 (project! &quot;corey's age&quot; :age corey|age))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;How does this work? As mentioned before, we used a heuristic approach rather than a statistical machine learning approach. While learning approaches have proven to be very effective, they require a large amount of tagged and classified training data, which can be expensive to obtain. For our problem, these data would have been mappings from plain English queries to a formal queries. We just didn’t have these data, so a machine learning approach would require a large up-front cost to obtain them.&lt;/p&gt;

&lt;p&gt;An alternative route is to come up with a set of hand-coded rules, called heuristics, based on our expert knowledge of the English language; we use English enough to be able to recognize (and exploit) structure and patterns. While statistics based approaches predominant, heuristic approaches have their own advantages:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;A heuristic approach is lightweight and can easily be stored on the client. We don’t need training data, which also means we don’t have to host a model on a server or ship it to the client.&lt;/li&gt;
  &lt;li&gt;A heuristic approach can be improved simply by adding a new rule. Statistical approaches require re-training a new model with with new data to improve performance, which can take an inordinately long time. Then we would have to ship the new model to the client, which is another cost we don’t have to pay.&lt;/li&gt;
  &lt;li&gt;The heuristic approach is easy to reason about, since the rules are generated and encoded by humans. Statistical models use millions of automatically generated weights to arrive at decisions. It’s very hard to reason about how or why the classifier behaved the way it did beyond “Well, it made that decision because the weights told it to.”&lt;/li&gt;
  &lt;li&gt;Heuristic approaches are blazingly fast. Our parser did its job in ~1 ms in Chrome. The best performance we could get out of a comparable statistical parser was 20ms, and that wasn’t even in the browser.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s circle back to the original question: how did it work? Well if you &lt;em&gt;really&lt;/em&gt; want to know, then take a look at the source &lt;a href=&quot;https://github.com/witheve/eve-experiments/blob/c7878849e8a7c5991e4b78914e1220bc1330969a/src/NLQueryParser.ts&quot;&gt;here&lt;/a&gt;. I’ll go through the process step-by-step with the example query &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;What is the average salary per department?&quot;&lt;/code&gt;&lt;/p&gt;

&lt;h4 id=&quot;tokens&quot;&gt;Tokens&lt;/h4&gt;

&lt;p&gt;First we break the string at whitespace boundaries to create tokens. To facilitate matching, we normalize the words by depluralizing and lowercasing them. Then we tag each word with a part of speech, which is just referenced in a small dictionary. The POS of a word helps us determine how it relates to other words. Most words in a sentence will be glue, like determiners and prepositions. Nouns are usually entities. Plural nouns are usually collections. Adjectives are usually either attributes or the value of some attribute. With these &lt;em&gt;a priori&lt;/em&gt; classifications, we can start constructing the query graph before we even look up the word in the Eve database, which is the next step.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;------------------------------------
   WORD        | NORM WORD  | POS  |
------------------------------------
0: root        | root       | NOUN |
1: What        | what       | GLUE |
2: is          | is         | VERB |
3: the         | the        | GLUE |
4: average     | average    | NOUN |
5: salary      | salary     | NOUN |
6: per         | per        | GLUE |
7: department? | department | NOUN |
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;nodes&quot;&gt;Nodes&lt;/h4&gt;

&lt;p&gt;Next, we classify each token in the context of the Eve database. First we &lt;a href=&quot;https://en.wikipedia.org/wiki/N-gram&quot;&gt;n-gram&lt;/a&gt; the tokens and match each one against the database. This determines the class of a word, whether it’s an entity, attribute, value, collection, or function. In our example, &lt;code class=&quot;highlighter-rouge&quot;&gt;average&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; are functions, &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; is an attribute, and &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt; is a collection.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;--------------------------------------------------------
   WORD        | NORM WORD  | POS  | PROPERTIES
--------------------------------------------------------
0: root        | root       | NOUN | (IMPLICIT|ROOT)
1: What        | what       | GLUE |
2: is          | is         | VERB |
3: the         | the        | GLUE |
4: average     | average    | NOUN | (FUNCTION)
5: salary      | salary     | NOUN | (ATTRIBUTE)
6: per         | per        | GLUE | (GROUPING|FUNCTION)
7: department? | department | NOUN | (COLLECTION)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;tree&quot;&gt;Tree&lt;/h4&gt;

&lt;p&gt;Next, we form a tree with the tagged and classified tokens. If the tokens represent objects in the Eve database, the tree represents relationships between the objects. Unmatched glue words like “is” and “the” are omitted from the tree. Relationships between nouns are found through a truncated graph search; we store links between entities and collections in a special &lt;code class=&quot;highlighter-rouge&quot;&gt;links&lt;/code&gt; table in Eve, and then try to find a path between each word. For example, in this query we want to find the relationship between &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt;. When we look them up in the &lt;code class=&quot;highlighter-rouge&quot;&gt;links&lt;/code&gt; table, we find there is no direct link. So we try to find a 1-degree link, which is found through the &lt;code class=&quot;highlighter-rouge&quot;&gt;employee&lt;/code&gt; collection (employees have salaries and belong to a department).&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;|*0: root  (IMPLICIT|ROOT)
|* 6: per [group] (GROUPING|FUNCTION)
|*  0: root  (IMPLICIT|ROOT)
|*   4: average [average] (FUNCTION)
|*    0: average  (IMPLICIT|ARGUMENT|OUTPUT|OUTPUT)
|*     0: output0 [output0] (IMPLICIT|OUTPUT)
|*    0: value  (IMPLICIT|ARGUMENT|INPUT|ATTRIBUTE)
|*     5: salary [employee|salary] (ATTRIBUTE)
|*   0: department [department] (IMPLICIT|ATTRIBUTE)
|*  0: collection  (IMPLICIT|ARGUMENT|INPUT|COLLECTION|ATTRIBUTE)
|*   7: department [department] (COLLECTION)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Notice the implicit nodes in the tree. These come from functions, which are added to the tree as a subtree. For instance, the &lt;code class=&quot;highlighter-rouge&quot;&gt;average&lt;/code&gt; function takes two children: an input and an output. The &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; function takes two inputs as well: a body and a collection over which to group the body. By adding these subtrees, we can ensure that the query plan is fully specified before we try to turn it into a formal query.&lt;/p&gt;

&lt;h4 id=&quot;formal-query&quot;&gt;Formal Query&lt;/h4&gt;

&lt;p&gt;Once we have the fully formed tree, converting it to a formal query is straightforward, since the tree structure was designed to directly map to the formal query grammar. The formal query for our example is&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
 (select &quot;tags&quot; :entity department :collection &quot;department&quot;)
 (query
  (select &quot;eavs&quot; :entity employee :attribute &quot;salary&quot; :value employee|salary)
  (select &quot;eavs&quot; :entity employee :attribute &quot;department&quot; :value department)
  (select &quot;tags&quot; :entity employee :collection &quot;employee&quot;)
  (select &quot;tags&quot; :entity department :collection &quot;department&quot;)
  (select &quot;average&quot; :average output0 :value employee|salary))
 (project! :average output0 :department department))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which you can see is almost a direct translation of the tree. One major difference is that we inline the children of functions as arguments. Also, the grouping function &lt;code class=&quot;highlighter-rouge&quot;&gt;per&lt;/code&gt; is implicitly represented by the subquery.&lt;/p&gt;

&lt;p&gt;And that’s it. The client sends this code to the Eve server, and the server returns a result. In this case:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;--------------------------------
| AVERAGE SALARY | DEPARTMENT  |
--------------------------------
| 8.5            | engineering |     
| 10             | operations  |     
--------------------------------
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;results&quot;&gt;Results&lt;/h3&gt;

&lt;p&gt;This looked pretty great to us at the time. It appeared we had a system that could generate a relatively complex formal query from a simple English query. But how does this generalize? Well, again, we didn’t have any data on what kind of questions people would ask. The best we could do was try and grow the space of acceptable queries as large as we could, and then release to the public, updating the rules as we find queries that break the system.&lt;/p&gt;

&lt;p&gt;So we did exactly that; in February we released &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/10/jan-feb/&quot;&gt;WikiEve&lt;/a&gt; to the public and the queries started rolling in. Almost immediately people started breaking all the assumptions we made. Of course we knew things would break once we released WikiEve to the wild. Most of the problems seemed very fixable until two:&lt;/p&gt;

&lt;p&gt;First, some users had trouble formulating their query, even in English. This surprised us, because these same users have no problem formulating vague questions for Google searches. When it came to specific searches over their own data, some users expressed that they didn’t even know where to begin.&lt;/p&gt;

&lt;p&gt;Second, we encountered a query that really gave us pause: &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;Which planets are uninhabitable?&quot;&lt;/code&gt; On the surface, this seems okay. We had a database of planets, and only one of them was tagged &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;habitable&quot;&lt;/code&gt;. If the user had expressed his query as &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;Which planets are not habitable?&quot;&lt;/code&gt; then our system would have worked. But this alternative query is completely valid, so we should be able to support it. But look at the word “uninhabitable”? This word is nefarious. First consider just the prefix “in-“, which commonly negates the root word. “Insecure”, “inaccurate”, “inanimate”, “indifferent”, “incoherent”. But “inhabitable” does not mean “not habitable”. It still means “habitable”. If I were to write a general heuristic to handle “in-“ based on its common meaning, it would classify “inhabitable” as “not habitable”. Then “uninhabitable”, which contains a double negative prefix (i.e. “un-“, “in-“), would be classified as “habitable”. Oh my…&lt;/p&gt;

&lt;h3 id=&quot;lessons-learned&quot;&gt;Lessons Learned&lt;/h3&gt;

&lt;p&gt;So where do we go from here? The first problem might be okay; we intentionally didn’t explain how the system worked in the hope that users would figure it out on their own. But I think it pointed to a deeper issue, namely that the text interface needed to be augmented with another interface to guide the formulation of an English query. A key difference between Google and our brand of search is that Google is very fuzzy, well we… well, we had no fuzz. If a specific English query failed, we just returned no results. Certain users definitely displayed Google-like behavior, such as trying multiple variations on a query until one worked. But we didn’t offer any tooling which told the user &lt;em&gt;why&lt;/em&gt; the query was wrong and &lt;em&gt;how&lt;/em&gt; to fix it. Adding this tooling could certainly help the process.&lt;/p&gt;

&lt;p&gt;The second issue was pretty much a show stopper though. The best solutions we came up with to solve the problem in a general way involved statistics, machine learning, and training data. This put us back at square one, since we had no training data.&lt;/p&gt;

&lt;p&gt;In the end, we all agreed that we could spend an arbitrary amount of time developing a system that meets our requirements. But first of all, it looks like a NL interface might not be the UI panacea we thought it was. Second, we’re not a NLP/AI/ML company; we’re building a programming language, and the NL interface was only created to support that goal.&lt;/p&gt;

&lt;p&gt;So we decided to abandon the effort, at least for now. As the language stabilizes and the company grows, we will eventually find enough time/resources to revisit this problem. Or, in the near parsing text might be as easy as a Google API call. Either way, we still feel that a natural language interface has a place in Eve’s future.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Jan - Feb)</title>
   <link href="http://incidentalcomplexity.com/2016/06/10/jan-feb/"/>
   <updated>2016-06-10T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/10/jan-feb/</id>
   <content type="html">&lt;p&gt;At the start of 2016 we decided it was about time for another “release”. I say “release” since we are developing in the open (for now, that’s happening on our &lt;a href=&quot;http://www.github.com/witheve&quot;&gt;Github&lt;/a&gt;. In January, our cadence was still very research-focused, but it had been almost 6 months since we &lt;a href=&quot;http://www.chris-granger.com/2015/08/17/version-0/&quot;&gt;released V0&lt;/a&gt;). So we targeted February to showcase our next direction to the public.&lt;/p&gt;

&lt;h3 id=&quot;people&quot;&gt;People&lt;/h3&gt;

&lt;p&gt;In January, Eric Hoffman joined the team. Eric has an insanely interesting background, from working at the U.S. Naval Research Laboratory, to building super computers at Cray, to co-founding &lt;a href=&quot;http://www.clustrix.com/&quot;&gt;Clustrix&lt;/a&gt;. We are excited to bring his expertise to the team. Unfortunately, we lost Jamie to visa issues, but we wish him all the best! Thus we persist as a merry band of five.&lt;/p&gt;

&lt;h3 id=&quot;platform-work&quot;&gt;Platform Work&lt;/h3&gt;

&lt;p&gt;In October, Chris wrote a new runtime in &lt;a href=&quot;http://www.typescriptlang.org/&quot;&gt;TypeScript&lt;/a&gt; for his CardWiki experiment. Our V0 runtime was written in &lt;a href=&quot;https://www.rust-lang.org/&quot;&gt;Rust&lt;/a&gt;, which was fine except for the distribution part of the story; with TypeScript, we can ship the runtime to the client’s browser and have it do all the work. Contrast with Rust, where the user had to download and install Rust, compile the runtime, and then compile, host, and connect to a server. So we went ahead with the new Typescript runtime.&lt;/p&gt;

&lt;h3 id=&quot;syntax&quot;&gt;Syntax&lt;/h3&gt;

&lt;p&gt;Eve has been missing a syntax for a while. We used to have one, but we abandoned it early in 2015. You can check out the last syntax on &lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/syntax/&quot;&gt;github&lt;/a&gt;, or see it in action in a &lt;a href=&quot;http://incidentalcomplexity.com/2014/12/01/nov/&quot;&gt;previous post&lt;/a&gt;. Our theory at the time was that Eve is a language for non-programmers, therefore we should use it as our users would, i.e. without a syntax.&lt;/p&gt;

&lt;p&gt;Thus, as we developed the &lt;a href=&quot;http://incidentalcomplexity.com/2015/07/02/mar-jun/&quot;&gt;Foursquare clone&lt;/a&gt;, V0, and the &lt;a href=&quot;http://incidentalcomplexity.com/2015/10/15/jul-sept/&quot;&gt;madlibs editor&lt;/a&gt;, we had no formal syntax for Eve. As we learned, this was probably not a good idea for several reasons.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Testing - Writing tests for a GUI is hard, especially when both the GUI and the runtime are constantly changing. Thus, we had no way to verify that a change in the runtime wouldn’t break the client, or vice versa.&lt;/li&gt;
  &lt;li&gt;Sharing - Sharing graphical code is not impossible, but you first have to figure out what it is you’re sharing. For us, the form of graphical code was constantly in flux. Is the code a visual graph? A madlib? A card? Our definition of code was changing almost monthly, and we had no constant factor between incarnations. A syntax would have been that constant factor.&lt;/li&gt;
  &lt;li&gt;Bug reporting/reproducing - This is a combination of (1) and (2), but it’s sinister in its own right. If you find a bug in the client, you first have to reproduce it. For a GUI client, this is problematic due to issues as mundane as screen resolution and DPI, browser version, or the size of a window. Once you’ve reproduced the bug, now you have to share the steps with a team member. How? Do you make a video? Do you write a detailed list of instructions? With a syntax, you just copy and paste the code and you’re done.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So by January 2016, we decided to invest in a syntax, as it would pay dividends by ameliorating the above. Let’s take a look at how it works:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
 (select &quot;eavs&quot; :entity &quot;corey&quot; :attribute &quot;age&quot; :value corey|age)
 (project! &quot;corey's age&quot; :age corey|age))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here is an Eve program that returns an attribute &lt;code class=&quot;highlighter-rouge&quot;&gt;age&lt;/code&gt; for an entity &lt;code class=&quot;highlighter-rouge&quot;&gt;corey&lt;/code&gt;. Each statement in an Eve program is a symbolic expression (s-exp) that starts with the keyword &lt;code class=&quot;highlighter-rouge&quot;&gt;query&lt;/code&gt;. A &lt;code class=&quot;highlighter-rouge&quot;&gt;query&lt;/code&gt; can contain any number of s-exps, which can be a &lt;code class=&quot;highlighter-rouge&quot;&gt;select&lt;/code&gt;, a &lt;code class=&quot;highlighter-rouge&quot;&gt;project!&lt;/code&gt;, or another &lt;code class=&quot;highlighter-rouge&quot;&gt;query&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Select statements ask Eve to find all data in a table with the specified fields. Here, the table is &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;eavs&quot;&lt;/code&gt; and the fields are &lt;code class=&quot;highlighter-rouge&quot;&gt;entity&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;attribute&lt;/code&gt;, and &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt;. Fields may be bound or unbound. In this case &lt;code class=&quot;highlighter-rouge&quot;&gt;entity&lt;/code&gt; is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;corey&quot;&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;attribute&lt;/code&gt; is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;age&quot;&lt;/code&gt;. However, &lt;code class=&quot;highlighter-rouge&quot;&gt;value&lt;/code&gt; is left unbound, and is actually aliased as &lt;code class=&quot;highlighter-rouge&quot;&gt;corey|age&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Project (the verb, not the noun) statements insert data into a new table, in this case &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;corey's age&quot;&lt;/code&gt;. A new field is created called &lt;code class=&quot;highlighter-rouge&quot;&gt;age&lt;/code&gt;, which is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;corey|age&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Okay, that’s fine. Let’s look at something a little more complicated:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
 (select &quot;eavs&quot; :entity :attribute &quot;salary&quot; :value salary)
 (select &quot;sum&quot; :sum output0 :input salary)
 (project! :sum-of-salaries output0))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This program selects every salary in Eve, sums them together, and projects that value into a new table. The first thing to note is on line 2, where &lt;code class=&quot;highlighter-rouge&quot;&gt;entity&lt;/code&gt; is unbound. This select says “get all entities in the system that have an attribute salary”. Thus, we would expect the variable &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; to be a set of salaries in the system e.g. &lt;code class=&quot;highlighter-rouge&quot;&gt;{$10, $11, $15}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The only material difference between this program and the last is line 3. Here, “sum” is a special primitive table that’s really an aggregate (known as a fold or reduce in functional contexts). &lt;code class=&quot;highlighter-rouge&quot;&gt;Sum&lt;/code&gt; takes whatever is bound to &lt;code class=&quot;highlighter-rouge&quot;&gt;input&lt;/code&gt; and aggregates produces a single value e.g. &lt;code class=&quot;highlighter-rouge&quot;&gt;{$36}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;With this syntax, we had a basis for writing tests and sharing code, but ultimately we were unhappy with the language. It was very verbose:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(query
  (+ :result r :a 1 :b 2)
  (project! :+ r))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Three lines and three dozen characters just to add two numbers? Not good. Fortunately this syntax was not for external consumption, so for the time being it was fine.&lt;/p&gt;

&lt;h3 id=&quot;wikieve&quot;&gt;WikiEve&lt;/h3&gt;

&lt;p&gt;WikiEve started from Chris’ &lt;a href=&quot;http://incidentalcomplexity.com/2016/06/03/oct-nov/&quot;&gt;CardWiki experiment&lt;/a&gt;, which used a natural language (NL) query parser as the primary interface for Eve. WikiEve extended this concept to a full frontend UI. Really, WikiEve started out as something very different I will call MarkdownEve.&lt;/p&gt;

&lt;h4 id=&quot;markdowneve-github&quot;&gt;MarkdownEve (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/a82f3411f541cf99c223ecd30a5cd3e80ea3dd2f&quot;&gt;github&lt;/a&gt;)&lt;/h4&gt;

&lt;p&gt;In CardWiki, a card was just a piece of UI that represented an entity, collection, or query result. The cards themselves can be thought of as living wiki articles, that update in real-time as edits are made. Like wikis, these cards could contain plain text and formatting (Markdown in this case, hence the moniker) that had no specific semantic meaning to a program. Unlike a wiki, semantic meaning could be added in the form of inline queries. The existence of inline queries in a card provided the basis for computation in the system, much like this contemporary &lt;a href=&quot;https://s3.amazonaws.com/worrydream.com/ClimateChange/Video/06-autocomplete.mov&quot;&gt;demo&lt;/a&gt; by Bret Victor.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve1.gif&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here we are editing a card relating to the entity &lt;code class=&quot;highlighter-rouge&quot;&gt;Josh&lt;/code&gt;. The beginning of an inline query is indicated by typing &lt;code class=&quot;highlighter-rouge&quot;&gt;=&lt;/code&gt;. As in CardWiki, queries are stated using natural english and are parsed by a special &lt;a href=&quot;&quot;&gt;natural language query parser&lt;/a&gt;. This sentence adds two tags (&lt;code class=&quot;highlighter-rouge&quot;&gt;test data&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;employee&lt;/code&gt;) to Josh and then queries for his &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;We can create whole documents this way.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve2.gif&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;There’s a lot going on here, so I’ll break it down. This is a card for the entity &lt;code class=&quot;highlighter-rouge&quot;&gt;Chris&lt;/code&gt;. We see that he belongs to two collections, &lt;code class=&quot;highlighter-rouge&quot;&gt;test data&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;employee&lt;/code&gt;. He has two attributes, &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt;, whose values are respectively &lt;code class=&quot;highlighter-rouge&quot;&gt;engineering&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;10&lt;/code&gt;. At the bottom is a summary table of all the properties associate with this card.&lt;/p&gt;

&lt;p&gt;We then add a &lt;code class=&quot;highlighter-rouge&quot;&gt;related to&lt;/code&gt; attribute, whose value is another entity &lt;code class=&quot;highlighter-rouge&quot;&gt;ryan&lt;/code&gt;. We can actually edit Ryan’s card from Chris’ card by clicking on Ryan’s name. A modal card appears, which we can edit in placehttp://incidentalcomplexity.com Finally, we embed a list of all Chris’ employees in the card.&lt;/p&gt;

&lt;p&gt;What we had at this point was basically a live document editor, where each “card” was more like a word document. This UI might actually work as a product. Imagine a powerpoint or a word document backed by Eve, where it updates as your data updates. The quarterly presentation you did last month is all ready with this month’s data, as soon as its available. Imagine a scholarly article where a simulation is embedded in the actual document, and you can play with it and edit it right there. But could this work as a programming model? We tried ourselves first, but the answer was a resounding “No”. Some of us found the programming model very confusing. Others found the workflow very limiting.&lt;/p&gt;

&lt;p&gt;So we scrapped MarkdownEve before we showed it to anyone, and went back to the drawing board.&lt;/p&gt;

&lt;h4 id=&quot;pivot-to-wikieve-github&quot;&gt;Pivot to WikiEve (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/1fd5ac10bc00cfcf914e085262dac246532ca540&quot;&gt;github&lt;/a&gt;)&lt;/h4&gt;

&lt;p&gt;Okay, so now we’re back to talking about WikiEve. Through refactoring MarkdownEve, we moved closer to the card model Chris originally proposed in the CardWiki experiment. Take a look:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve3.png&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;This is the WikiEve workspace. What we see here are several cards lined up next to each other. This is actually a stack, where a card is a child to the one on the left. In this screen, we started with this Home card, then opened Moon, then Europa and so on. Instead of inlining data in text, attributes are housed in a grid. Each card has a default image and description attributes, which maintains the wiki-esque feel.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve4.png&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The key interaction model with this version, as with CardWiki and MediumEve, is the natural language interface. Here, we searched for &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;moons grouped by planet&quot;&lt;/code&gt; and got a list of exactly what I asked for. If I click on &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;The Moon&quot;&lt;/code&gt; I can open its card right there and edit it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve4.gif&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Adding new attributes to cards is achieved by clicking the &lt;code class=&quot;highlighter-rouge&quot;&gt;+&lt;/code&gt; in the top right of the card. This opens a panel with options of attributes to add to the card. The options are property (which I’ve been calling attribute), a list, a description, an image, or a document.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/wikieve5.gif&quot; alt=&quot;WikiEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In this example, we’re adding some &lt;a href=&quot;https://www.bart.gov/stations&quot;&gt;BART&lt;/a&gt; stops to the collection &lt;code class=&quot;highlighter-rouge&quot;&gt;station&lt;/code&gt;. An advanced feature that’s shown here is editing one of the entities we just added to the list, &lt;code class=&quot;highlighter-rouge&quot;&gt;colma&lt;/code&gt;. When we click on &lt;code class=&quot;highlighter-rouge&quot;&gt;colma&lt;/code&gt; in the list, a modal card appears for that entity that can be edited.&lt;/p&gt;

&lt;h3 id=&quot;results&quot;&gt;Results&lt;/h3&gt;

&lt;p&gt;We launched WikiEve to a limited audience of friends and family on February 24th. The results were mixed. On the positive side, users generally seemed to enjoy how simple it was. They liked how using it didn’t feel like programming. They appreciated the simple and approachable UI. Our in-person demos (where we were driving the product in front of a user), impressed the most; users were very enthusiastic about the magic and power of NL search when we showed it working as intended.&lt;/p&gt;

&lt;p&gt;We intentionally decided not to provide a tutorial as well; we were curious to see how well users could understand the interface without any instruction. How far could they get? Where did most users get stuck? Our hope was that most users would at least figure out the NL search interface. In fact, we couldn’t have been more wrong. Many users failed to even recognize the search box, so they were lost before they even got started. Still, users who did find the search box didn’t treat it as an advanced Google type search interface, but as a simple keyword match search interface. Finally, users who did treat it as an intelligent search box immediately broke our model by phrasing searches in ways we hadn’t anticipated. I talk about this more in &lt;a href=&quot;&quot;&gt;another post&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;lessons-learned&quot;&gt;Lessons Learned&lt;/h3&gt;

&lt;p&gt;With all this feedback, what could we learn?&lt;/p&gt;

&lt;p&gt;One lesson was the importance of minimizing onboarding friction for new users. The V0 release asked new users to download and install two programming languages, and compile and run a server. Getting users started this way was just too painful. We quickly recognized a hosted link or double-click downloadable installer needed to be our standard for releases from now on. So that’s one thing we got right.&lt;/p&gt;

&lt;p&gt;But our biggest realization was that we had to re-think our approach for the UI, which hinged on the NL search interface. While a pure NL interface sounds like a programming panacea, it doesn’t work well as a tool. Great tools are clear in their purpose and their usage. By contrast, the NL interface is completely opaque. You can’t discern its operational boundaries. You can’t figure out how to fix queries when the results are wrong. We thought the flexibility of the NL interface was its strength, but many users expressed a feeling of paralysis when presented with its open-ended nature.&lt;/p&gt;

&lt;p&gt;So we had some wins with the GUI and distribution strategy, but a loss with the NL interface. Improvements to this interface will be the subject of the next Dev Diary.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Oct - Nov)</title>
   <link href="http://incidentalcomplexity.com/2016/06/03/oct-nov/"/>
   <updated>2016-06-03T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2016/06/03/oct-nov/</id>
   <content type="html">&lt;p&gt;After we &lt;a href=&quot;http://www.chris-granger.com/2015/08/17/version-0/&quot;&gt;launched V0&lt;/a&gt; at the end of last Summer, we spent a lot of time figuring out where to go next. The graph model featured in V0 had a lot of strengths: immediate feedback on actions, no coding with a completely point and click interface, all possible options were displayed on the screen, and the universal search was great for discovery. But there were weaknesses too: aggregates never really fit into the picture, a lot of time was spent laying out the query graphs, some of the terminology (like chunk and ordinal) was unintuitive and confusing. That, and we still weren’t sure how the interface would scale to larger programs.&lt;/p&gt;

&lt;p&gt;Without a clear idea on where to go next, we did the next best thing: a breadth first search of the design space to explore potential new directions for Eve. We structured the next 30 days as a sort of bootcamp. Each of us chose a project with a clear goal to work on for the duration of the boot camp. The project had to have some relationship to Eve, but we had full discretion in choosing a direction to explore. Each week shared our progress as a group, but other than that we worked completely independently. At the end of the 30 days we held a “demo day”, where we showed-off our projects and talked about what we learned.&lt;/p&gt;

&lt;p&gt;Below, I’ll talk about each of our projects:&lt;/p&gt;

&lt;h3 id=&quot;copperfield-github&quot;&gt;Copperfield (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/af13f8d5f8a537d22c459f3e69e39b2736b16384/experimental/copperfield/ui&quot;&gt;github&lt;/a&gt;)&lt;/h3&gt;

&lt;p&gt;Josh built Copperfield to find the simplest expressive interface in Eve. Copperfield was to designed to feel immediately useful and eminently explorable like Wikipedia, with additional influences in Hypercard, and Urbit. The project was built around three central tenets:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Everything is an entity&lt;/li&gt;
  &lt;li&gt;Entities are not tied to any one appearance&lt;/li&gt;
  &lt;li&gt;Entities can be arbitrarily queried&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Entities served as the main objects of the system. They could be anything from queries to UI to a person. Each entity had a canonical form, but it could take on multiple forms as well. For example, a table entity had the canonical display as a 2D grid. But the same table could be embedded in another entity and have a different display, e.g. a graph. Copperfield also featured collections, which were a way to organize entities with similar properties into groups.&lt;/p&gt;

&lt;p&gt;Josh wrote up a full overview of Copperfield, which you can read &lt;a href=&quot;https://gist.github.com/cmontella/05029cb67b5216ee838f4cb0b1f4ab98&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;imp-github&quot;&gt;Imp (&lt;a href=&quot;https://github.com/jamii/imp/tree/master/src&quot;&gt;github&lt;/a&gt;)&lt;/h3&gt;

&lt;p&gt;Jamie built Imp, which he intended to be an Eve for people who build Eves (i.e. people who build compilers and languages). We’ve always wrestled with the question of what it would be like to build Eve in Eve. One barrier we forsee is performance; while Eve is a general purpose language, we are initially targeting users who might not care about how fast the language is – web devs, small busines owners, knowledge workers, etc. Thus, Imp was a test to see just how performant Jamie could make the system. Fortunately, Jamie kept a detailed account of his journey building Imp, which you can read about &lt;a href=&quot;https://github.com/jamii/imp/blob/master/diary.md&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h3 id=&quot;grideve-github&quot;&gt;GridEve (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/af13f8d5f8a537d22c459f3e69e39b2736b16384/experimental/grideve&quot;&gt;github&lt;/a&gt;)&lt;/h3&gt;

&lt;p&gt;I built GridEve, which was an evolution of Excel with Eve-like semantics. The idea was to explore what Eve would look like if we took a product that was proven to work, and extended it to make it more powerful. GridEve has two important innovations over vanilla Excel, which I felt made it much more flexible and useful:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;A cell can contain anything.&lt;/li&gt;
  &lt;li&gt;A thing can be displayed in multple ways&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So picture your user interface - it’s just a single cell. You can put anything in the cell - text, a number, a jpeg, a video, a person, even another cell. If we put multiple cells inside another cell, we arrive at a grid-like interface naturally. Further, the display of a cell depends on its contents. For example, if a cell contains the number 5, the display is just the number 5. But if the cell contains a person, the display of the cell might be the person’s name, or maybe a picture of that person. If a cell contains a video, the display might be the movie itself, or a poster for the movie. Let’s take a look at GridEve in action.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/grideve1.gif&quot; alt=&quot;GridEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here you can see the basic dataflow of the grid. Nodes are defined by typing formulas into a cell. Cells are left unevaluated until all variables are bound. In this example, &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;y&lt;/code&gt; are left unevaluated until &lt;code class=&quot;highlighter-rouge&quot;&gt;z&lt;/code&gt; is bound. When &lt;code class=&quot;highlighter-rouge&quot;&gt;z&lt;/code&gt; is eventually bound, &lt;code class=&quot;highlighter-rouge&quot;&gt;y&lt;/code&gt; is immediately and automatically evaluated, and finally &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt; is evaulated. The result of the evaluation is displayed in the purple cells adjacent to the formulas.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/grideve2.gif&quot; alt=&quot;GridEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;But Excel already does dataflow, this is nothing new. GridEve goes a step further and adds interactivity. In the above example, &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt; is bound to a set of numbers (a range from 1 to 20 in steps of 0.1.). Then the function &lt;code class=&quot;highlighter-rouge&quot;&gt;sin()&lt;/code&gt; is applied to the whole set, like in Matlab. Interaction is achieved by binding &lt;code class=&quot;highlighter-rouge&quot;&gt;t&lt;/code&gt; to a &lt;code class=&quot;highlighter-rouge&quot;&gt;counter()&lt;/code&gt;, which increments its value by 1 every 100 ms. Since &lt;code class=&quot;highlighter-rouge&quot;&gt;y&lt;/code&gt; depends on &lt;code class=&quot;highlighter-rouge&quot;&gt;t&lt;/code&gt;, it also updates every 100ms. Finally, I draw a graph of &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt; versus &lt;code class=&quot;highlighter-rouge&quot;&gt;y&lt;/code&gt;, which updates every time the counter increments. The last thing I do is edit the binding on &lt;code class=&quot;highlighter-rouge&quot;&gt;x&lt;/code&gt;, increasing the extent of the range from 20 to 35. The effect ripples through the defined computations and can be visualized in the graph cell.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/grideve3.gif&quot; alt=&quot;GridEve&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In this final example, I demonstrate how a form could be laid out in the grid. I type &lt;code class=&quot;highlighter-rouge&quot;&gt;textbox(&quot;Name&quot;)&lt;/code&gt;, which evaluates to a textbox UI element. By right-clicking on a cell, I toggle the visibility of the formula so only the UI element is showing. In this way, UI can be laid out on directly to the grid. The function of an element can easily be edited by right clicking on the element and editing its formula.&lt;/p&gt;

&lt;h3 id=&quot;cardwiki-github&quot;&gt;CardWiki (&lt;a href=&quot;https://github.com/witheve/eve-experiments/tree/af13f8d5f8a537d22c459f3e69e39b2736b16384/experimental/cardwiki&quot;&gt;github&lt;/a&gt;)&lt;/h3&gt;

&lt;p&gt;CardWiki was Chris’ project, and probably the most ambitious. It really started when Chris was watching Apple unveil the new version of the Apple TV in September 2015. In one of the demos, the presenter speaks into the remote control and commands “Show that Modern Family episode with Edward Norton”. Apple TV then navigates to the correct episode of Modern Family. Well, Eve should be able to do the same thing, right? Why not? Thus, CardWiki was born.&lt;/p&gt;

&lt;p&gt;The idea was basically a marriage between Wikipedia, Google, and the semantic web. Users would create entities in Eve, which were akin to wikipedia articles. Then the user could write plain-text queries (like the Edward Norton example) and get results. With the Eve engine and a little natural language processing (NLP), this was everything necessary to replicate the Apple TV demo. Here’s one even more complicated than that:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/cardwiki.png&quot; alt=&quot;Cardwiki&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The query is entered as plain text. The color of the text marks its class, one of entity (blue), collection (green), attribute (pink), or operation (orange). This class is determined by a little NLP magic, which I will detail in a future post. Relationships are then built between each of the identified tokens (according to the facts in the Eve database), and the whole thing is turned into a plan for execution by the Eve engine. This opens up some awesome possibilities.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/cardwiki2.png&quot; alt=&quot;Cardwiki&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Here’s an example of a pretty complex query. Here, the relevant tokens are the attribute &lt;code class=&quot;highlighter-rouge&quot;&gt;salaries&lt;/code&gt; and the collection &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt;. They have no direct association, except though the collection &lt;code class=&quot;highlighter-rouge&quot;&gt;employee&lt;/code&gt;, members of which have attributes &lt;code class=&quot;highlighter-rouge&quot;&gt;salary&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;department&lt;/code&gt;. The planner recognizes this, and finds a path between the two by pulling in &lt;code class=&quot;highlighter-rouge&quot;&gt;employees&lt;/code&gt; (Column 2).&lt;/p&gt;

&lt;p&gt;Another feature demonstrated here is the implication mechanism, which is a way to define functions. Here, we say that &lt;code class=&quot;highlighter-rouge&quot;&gt;departments&lt;/code&gt; have a attribute called &lt;code class=&quot;highlighter-rouge&quot;&gt;total cost&lt;/code&gt; which is equal to the &lt;code class=&quot;highlighter-rouge&quot;&gt;sum&lt;/code&gt; as expressed in the query. Now, we could say something like &lt;code class=&quot;highlighter-rouge&quot;&gt;&quot;total cost of the engineering department&quot;&lt;/code&gt; and we’ll get the result &lt;code class=&quot;highlighter-rouge&quot;&gt;7&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/cardwiki3.png&quot; alt=&quot;Cardwiki&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Several queries are laid out as “cards” in a workspace. The large purple cards in the middle show the wiki interface in action. Plain text can be annotated to have semantic meaning. In the top card, Vin Diesel is marked as a member of the classes “American” and “actor”, so any searchs for “American actors” will include him. Below him, Edward Norton’s age, haircolor, and salary are annotated as attributes, so they can be queried and used in calculations.&lt;/p&gt;

&lt;h3 id=&quot;results&quot;&gt;Results&lt;/h3&gt;

&lt;p&gt;So what did we learn from all of this? First, it surprised us how different our projects were. We had been working on Eve together for a while, yet we each had a different idea what Eve meant at an individual level. To me, it was a calculator/notebook with super powers. To Chris, it was a computation on crowd-sourced, world-scale data. For Jamie it was just getting more performance out of the engine so he could write compilers in Eve.&lt;/p&gt;

&lt;p&gt;Second, the differences in our projects were mostly cosmetic. At a functional level, they all had the same features: immediate feedback, few moving parts, a single defining abstraction, a simple interface. One feature we all included was the ability to represent something in multiple ways depending on context, so it’s pretty clear this needs to be a core feature in Eve.&lt;/p&gt;

&lt;p&gt;Finally, we found a new direction for development: WikiEve, which I’ll talk about in the next post.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Jul - Sep)</title>
   <link href="http://incidentalcomplexity.com/2015/10/15/jul-sept/"/>
   <updated>2015-10-15T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2015/10/15/jul-sept/</id>
   <content type="html">&lt;p&gt;Whoops, it’s October already. Time flies when you’re having fun.&lt;/p&gt;

&lt;p&gt;We released &lt;a href=&quot;https://github.com/Kodowa/Eve&quot;&gt;all of our work&lt;/a&gt; under the Apache 2.0 License. A ton of work went into the inevitable cross-platform woes - much thanks to everyone that &lt;a href=&quot;https://github.com/witheve/eve-experiments/issues&quot;&gt;reported bugs&lt;/a&gt; and &lt;a href=&quot;https://github.com/witheve/eve-experiments/graphs/contributors&quot;&gt;contributed fixes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With the release came an array of basic features that we had neglected so far, including saving/loading Eve programs and importing csv files.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;https://www.youtube.com/embed/iDyMZZZ2GU4&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;The AST and compiler have been significantly cleaned up. The &lt;a href=&quot;https://github.com/witheve/eve-experiments/blob/master/runtime/src/compiler.rs#L507-L1192&quot;&gt;new compiler&lt;/a&gt; is written using a crude pseudo-Eve as a step towards true bootstrapping. To better support live programming, the compiler can now handle broken or unfinished programs without losing runtime state - freezing any broken views while continuing to run any undamaged views.&lt;/p&gt;

&lt;p&gt;The language itself received some new features. Ordered union and difference allow easily expressing non-monotonic logic such as “all birds can fly, except penguins can’t, except Harry the Rocket Penguin can”. The addition of grouping operations and first-class bags has allowed aggregates to treated as normal primitives. Existing primitives have been extended to handle coercion between numeric and string types (hopefully a temporary measure, to stave off the inevitable type system).&lt;/p&gt;

&lt;p&gt;Error handling appeared too, or more accurately error ignoring. Reporting errors in a declarative query language is tricky because the programmer does not control the order of operations. Whether an error like division by zero actually occurs can depend on whether the query planner schedules the division earlier or later in the query. The zero in question might be filtered out by another constraint before the query finishes. Currently we treat primitive functions as true relations, so division by zero simply returns no rows, but we report such events in a separate table which can be queried for self-monitoring.&lt;/p&gt;

&lt;p&gt;Entering and editing data in a live relational program is surprisingly hard. Myriad corner cases challenge the UX, such as edits that cause the sort position of the edited row to change. The new editor handles these much more smoothly than the old Excel-lookalike.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;https://www.youtube.com/embed/0FbSIKXkl5Y&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;The default interface for queries is currently a drag-and-drop graph editor.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;https://www.youtube.com/embed/dz1iWKQQyDg&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;The preview box helps explore partial results within the query, to aid debugging.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/jas-preview.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/jas-preview.png&quot; alt=&quot;Preview box&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This interface is quickly grasped by everyone (with the exception of the grouping/sorting operation which is currently something of a dumping ground for everything that doesn’t fit neatly into relational algebra) but the information density is very low and laying out graphs is a legendarily underappreciated problem.&lt;/p&gt;

&lt;p&gt;We are also revisiting the old madlib ideas which allow fitting much more code onto the screen at once.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/jas-madlib.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/jas-madlib.png&quot; alt=&quot;Madlib queries&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/jas-madlib-entry.gif&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/jas-madlib-entry.gif&quot; alt=&quot;Madlib data entry&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This interface works particularly well on mobile, especially when voice entry is enabled.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/jas-chat.jpeg&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/jas-chat.jpeg&quot; alt=&quot;Madlib mobile repl&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have several more experiments in progress. More on those in the next post…&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Mar - Jun)</title>
   <link href="http://incidentalcomplexity.com/2015/07/02/mar-jun/"/>
   <updated>2015-07-02T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2015/07/02/mar-jun/</id>
   <content type="html">&lt;p&gt;It’s been a while.&lt;/p&gt;

&lt;p&gt;So far, the monthly posts have included detailed technical descriptions of our work. I keep delaying posts until I can figure out how to coherently explain the ideas in them. In future, I will be posting short status updates every month and saving the gory details for unscheduled design posts, like &lt;a href=&quot;http://incidentalcomplexity.com/2015/04/22/version-control/&quot;&gt;this one&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;March, April and May were all consumed by a single milestone. Previously we had only been building prototypes and demos - code that was thrown together to test ideas and not expected to live for long. Whenever we showed these to people the most common feedback we heard was “that’s interesting but I don’t see how it would scale to a real website”. With Chris’ keynote at the Joy of Coding coming up in May, we decided to make a push to have a clone of a real website running in Eve in time for the talk, as well as a provenance-based debugger and support for collaborative editing.&lt;/p&gt;

&lt;p&gt;We fell far short of that goal, for a number of reasons. Firstly, we responded to the time pressure by trying to do everything at once - a kind of big bang model of development where nothing runs until everything is finished. Secondly, we often let perfect be the enemy of the good, redesigning flawed components from scratch rather than tolerating them long enough to get a working system together.&lt;/p&gt;

&lt;p&gt;Despite our mistakes, we still managed to build a relational database, a programming language, an IDE and a UI editor from scratch in three months. In June we adopted a more incremental process - making changes via shims or feature gates to ensure we always have a stable platform to build on. At the time of writing we are able to implement much of &lt;a href=&quot;https://foursquare.com/&quot;&gt;Foursquare&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/mamj-foursquare.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/mamj-foursquare.png&quot; alt=&quot;Foursquare&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aggregation and sorting continue to be tricky to nail down, so they are currently banished to a separate view type. To reduce the overhead of having to create all these extra views we added workspaces which can contain multiple anonymous views.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/mamj-workspace.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/mamj-workspace.png&quot; alt=&quot;Workspace&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Previous versions of Eve were fairly keyboard-heavy. For this version we built an entirely mouse-driven interface for the query editor. This reduces the scope for error for non-technical users, but the code is still very difficult to read and understand. We have a much more promising idea in the works.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/mamj-table.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/mamj-table.png&quot; alt=&quot;Table editor&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The runtime now lives outside the browser, which means that for the first time we can handle multiple users in Eve applications. Currently, all computation happens on the server and clients just render html and pass on UI events (much like &lt;a href=&quot;http://nitrogenproject.com/learn&quot;&gt;Nitrogen&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/mamj-multiclient.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/mamj-multiclient.png&quot; alt=&quot;Multiple clients&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(The editor itself can still only handle one user since we need some form of version control to handle concurrent code changes.)&lt;/p&gt;

&lt;p&gt;The major new feature is a drag-and-drop UI editor which can bind data directly from Eve views.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/mamj-ui.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/mamj-ui.png&quot; alt=&quot;UI editor&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For July, our goals are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Improve the current version of Eve until we can clone FourSquare perfectly&lt;/li&gt;
  &lt;li&gt;Fix architectural mistakes and refactor rushed code&lt;/li&gt;
  &lt;li&gt;Add a shiny new query editor&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Version control, collaborative editing and undo</title>
   <link href="http://incidentalcomplexity.com/2015/04/22/version-control/"/>
   <updated>2015-04-22T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2015/04/22/version-control/</id>
   <content type="html">&lt;p&gt;Collaborative editing, undo/redo and version control are all instances of the same problem. They are also all legendarily hard to get right. With that in mind, I would like to have more eyes on the design I’m proposing for Eve.&lt;/p&gt;

&lt;h3 id=&quot;past&quot;&gt;Past&lt;/h3&gt;

&lt;p&gt;The standard solution to any hard problem is to find someone who solved it already and steal their answer. Let’s look at existing distributed version-control systems and collaborative editors.&lt;/p&gt;

&lt;p&gt;The hardest problem that a DVCS has to solve is figuring out how to take changes made in one context and apply them in another context. This is a hard problem because most of the important semantic information is missing - while the user is thinking about changes like ‘inline function foo into function bar’ the DVCS can only see changes like ‘add this text at line 71’.&lt;/p&gt;

&lt;p&gt;This difficulty is compounded by recording changes after the fact (by diffing) rather than as they are made. Detecting even simple operations like moving a function into another file has to rely on heuristics about textual similarity instead of just observing the cut and paste.&lt;/p&gt;

&lt;p&gt;With this kind of information the problem isn’t even well-defined. There is no guarantee that merging two good branches will result in a project that even parses, let alone compiles and passes tests. All the widely used tools settle for heuristics that try to balance reducing surprise with reducing manual effort. In practice, predictable merges are valued more than clever merges.&lt;/p&gt;

&lt;p&gt;In &lt;a href=&quot;https://www.kernel.org/pub/software/scm/git/docs/git-merge.html&quot;&gt;Git&lt;/a&gt; and &lt;a href=&quot;http://hgbook.red-bean.com/read/a-tour-of-mercurial-merging-work.html&quot;&gt;Mercurial&lt;/a&gt; the input to these heuristics is the two versions to be merged and their most recent common ancestor (if there are multiple candidates they can be recursively merged).&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikibooks.org/wiki/Understanding_Darcs/Patch_theory&quot;&gt;Darcs&lt;/a&gt; additionally considers the chain of patches that led to each version. It transforms individual patches one by one in order to be able to apply them in the context of the other branch. The upside of this bag of patches model is that it &lt;a href=&quot;http://darcs.net/manual/Introduction.html&quot;&gt;makes cherry-picking and rebasing easy&lt;/a&gt;. The downside is that it occasionally hits &lt;a href=&quot;http://darcs.net/FAQ/ConflictsDarcs1#darcs-is-really-slow-is-this-the-big-conflicts-bug-in-action&quot;&gt;dramatically slow cases&lt;/a&gt; and &lt;a href=&quot;http://markmail.org/message/vk3gf7ap5auxcxnb&quot;&gt;doesn’t track the project history&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Operational_transformation&quot;&gt;Operational Transform&lt;/a&gt; algorithms solve collaborative editing with a similar approach. Each editor broadcasts changes to the text as they happen and transforms incoming changes to apply to the current text. The editors do not track the merge history and it is &lt;a href=&quot;http://en.wikipedia.org/wiki/Operational_transformation#Critique_of_OT&quot;&gt;very hard to prove&lt;/a&gt; that every editor will eventually reach the same state. In fact, &lt;a href=&quot;http://arxiv.org/pdf/1302.3292.pdf&quot;&gt;Randolph et al&lt;/a&gt; found that every proposed algorithm in the academic literature can fail to converge and that guaranteeing convergence is not possible without additional information.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://hal.inria.fr/inria-00445975/document&quot;&gt;Treedoc&lt;/a&gt; and various other &lt;a href=&quot;http://en.wikipedia.org/wiki/Conflict-free_replicated_data_type&quot;&gt;CRDTs&lt;/a&gt; provide this additional information in the form of hidden identity tokens for each chunk of text. The change events refer to these tokens rather than to line and column numbers, which makes it easy to apply changes in any order. The proof of convergence is simple and, more importantly, the algorithm is obvious once you have seen the identity tokens. Practical implementations are tricky though since the tokens can massively inflate the memory required to store the document.&lt;/p&gt;

&lt;p&gt;So, things to think about when designing our solution:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Recording changes as they happen is easier than inferring them after the fact&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Preserving history - the context in which a change was made - is necessary for merging correctly&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Having stable identities reduces the amount of context needed to understand a change&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Being predictable is more important than being smart&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;present&quot;&gt;Present&lt;/h3&gt;

&lt;p&gt;Eve is a &lt;a href=&quot;http://shaffner.us/cs/papers/tarpit.pdf&quot;&gt;functional-relational&lt;/a&gt; language. Every input to an Eve program is stored in one of a few insert-only tables. The program itself consists of a series of views written in a relational query language. Some of these views represent internal state. Others represent IO that needs to be performed. Either way there is no hidden or forgotten state - the contents of these views can always be calculated from the input tables.&lt;/p&gt;

&lt;p&gt;The code for these views is stored similarly. Every change made in the editor is inserted into an input table. The compiler reads these inputs and emits query plans which will calculate the views.&lt;/p&gt;

&lt;p&gt;Eve is designed for live programming. As the user makes changes, the compiler is constantly re-compiling code and incrementally updating the views. The compiler is designed to be resilient and will compile and run as much of the code as possible in the face of errors. The structural editor restricts partially edited code to small sections, rather than rendering entire files unparseable. The pointer-free relational data model and the timeless views make it feasible to incrementally compute the state of the program, rather than starting from scratch on each edit.&lt;/p&gt;

&lt;p&gt;We arrived at this design to support live programming but these properties also help with collaborative editing. In particular:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;Tables are unordered, so inputs can be inserted in any order without affecting the results&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;The editor assigns unique ids to every editable object on creation, so changes require very little context&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Partial edits and merge conflicts only prevent the edited view from running, not the whole program&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Runtime errors only prevent data flow through that view, rather than exiting the program&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;If all users are editing on the same server they can share runtime state&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;future&quot;&gt;Future&lt;/h3&gt;

&lt;p&gt;As a thought experiment, let’s suppose we connect two editors by just unioning their input tables. What would go wrong?&lt;/p&gt;

&lt;p&gt;Firstly, the compiler crashes. While each independent editor respects the invariants that the compiler relies on, the union of their actions might not. For example, each editor might set a different human-readable name for some view, breaking the unique-key invariant on the human-readable-name table.&lt;/p&gt;

&lt;p&gt;As a first pass, we can resolve this with last-write-wins. Both users share a server and the server is authoritative. For online collaborative editing this is actually good enough - we are able to write programs with multiple editors without problems.&lt;/p&gt;

&lt;p&gt;To support offline editing, version control and undo/redo we need to be more careful about what we mean by ‘last write’. We can track the &lt;a href=&quot;http://scattered-thoughts.net/blog/2012/08/16/causal-ordering/&quot;&gt;causal history&lt;/a&gt; of each change. When two conflicting changes are causally ordered we pick the later change. If the changes are concurrent we tag it as a merge conflict and disable that view until the conflict is resolved.&lt;/p&gt;

&lt;p&gt;The difficult question is when do two changes conflict? There is no ‘correct’ answer to this question - merging is an under-defined problem. In any VCS you can make code changes that are individually valid, will be merged automatically and will break in the final program (a simple example in dynamic languages is defining two functions with the same name). Existing tools simply try to guarantee that the user is not surprised by the result and that no information is lost. We will add an extra constraint - the result will always compile (even if we have to emit warnings and disable some views).&lt;/p&gt;

&lt;p&gt;This last constraint gives us our answer - two changes conflict when applying them both would break an invariant and crash the compiler (this is remarkably similar to &lt;a href=&quot;http://www.vldb.org/pvldb/vol8/p185-bailis.pdf&quot;&gt;I-confluence&lt;/a&gt;). The invariants fall into a few categories:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Types&lt;/strong&gt;: Reject any ill-typed errors and warn the user.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Unique keys&lt;/strong&gt;: If one change is causally later than all other changes then it wins. If there multiple changes which are not ancestors of any other change, disable the view and warn the user.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Foreign keys&lt;/strong&gt;: Replace the missing value with a default value and warn the user.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;strong&gt;Ordering&lt;/strong&gt;: Instead of using consecutive integers use an ordered CRDT. Resolve ties arbitrarily but consistently (eg by comparing the items uuid).&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To summarise: most changes don’t conflict, some can be resolved by recording additional information, the remainder are flagged as conflicts and are not compiled until they are fixed.&lt;/p&gt;

&lt;p&gt;I glossed over the recording of causal history. This is a core difference in philosophy between darcs and git. In darcs, the history is a mutable bag of patches and is easily rearranged. This makes features like cherry-picking easy to use and implement. In git, the history is an immutable DAG of commits and is hard to change. This is useful for auditing and bisecting changes. The choice of how we record causal history has important ramifications for how we implement undo/redo.&lt;/p&gt;

&lt;p&gt;I really wanted undo to behave like &lt;a href=&quot;http://www.emacswiki.org/emacs/UndoTree&quot;&gt;undo-tree&lt;/a&gt;, where undo moves up the tree of changes, editing creates a branch and redo moves down the current branch. Unfortunately, I can’t reconcile this with collaborative editing, where undo should only undo operations made by the same user (imagine Alice is off working in a different section of the program and hits undo, undoing Bob’s last change in mid edit). To undo something that is not on the tip, git offers &lt;a href=&quot;http://git-scm.com/docs/git-revert&quot;&gt;revert&lt;/a&gt; and &lt;a href=&quot;http://git-scm.com/book/en/v2/Git-Branching-Rebasing&quot;&gt;rebase&lt;/a&gt;. Rebase creates an entirely new chain of commits which causes confusing merges if someone else is concurrently working on the same branch. Revert doesn’t allow for undo-tree -like behaviour.&lt;/p&gt;

&lt;p&gt;I’m considering an approach that gives us both the easy cherry-picking of darcs’ bag of patches model and the auditable history of git. It’s able to be simpler than both because we are solving an easier problem - the changes we are merging contain much more information about intent than raw text diffs.&lt;/p&gt;

&lt;p&gt;There are three kinds of data tracked by the system:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;a &lt;strong&gt;patch&lt;/strong&gt; has a unique id and a set of input tuples to be added&lt;/li&gt;
  &lt;li&gt;an &lt;strong&gt;insert&lt;/strong&gt; has a unique id, a set of parent commits and names a patch to be applied&lt;/li&gt;
  &lt;li&gt;a &lt;strong&gt;delete&lt;/strong&gt; has a unique id, a set of parent commits and names an &lt;em&gt;insert&lt;/em&gt; to be removed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The inserts and deletes form a causal history DAG. Collecting all the inserts and removes between the current tip and the root gives you an &lt;a href=&quot;https://github.com/aphyr/meangirls#or-set&quot;&gt;observed-removed set&lt;/a&gt; of patches. The union of these patches is passed to the compiler, which flags any merge conflicts.&lt;/p&gt;

&lt;h3 id=&quot;example&quot;&gt;Example&lt;/h3&gt;

&lt;p&gt;Suppose Alice and Bob are collaborating together on a web page. Alice sets the title of the page to ‘Bobs Sandwiches’. Bob sees this, sets the background to ‘burger.jpg’ and edits the title to read ‘Bobs Burgres’.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Alice: Patch{id=P0, inputs=[Title{text=&quot;Bobs Sandwiches&quot;}]}
Alice: Insert{id=I0, parents=[], patch=P0}
Bob: Patch{id=P1, inputs=[Background{src=&quot;burger.jpg&quot;}}
Bob: Insert{id=I1, parents=[I0], patch=P1}
Bob: Patch{id=P2, inputs=[Title{text=&quot;Bobs Burgres&quot;}]]}
Bob: Insert{id=I2, parents=[I1], patch=P2}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;There can only be one title. I0 is an ancestor of I2 so ‘Bobs Burgres’ wins the conflict.&lt;/p&gt;

&lt;p&gt;Now Alice and Bob both notice the typo in the title and try to fix it at the same time.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Alice: Patch{id=P3, inputs=[Title{text=&quot;Bobs Sandwiches and Burgers&quot;}]}
Alice: Insert{id=I3, parents=[I2], patch=P3}
Bob: Patch{id=P4, inputs=[Title{text=&quot;Bobs Burgers&quot;}]}
Bob: Insert{id=I4, parents=[I2], patch=P4}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;These inserts are concurrent - neither is an ancestor of the other - so the editor displays a merge conflict warning. Alice resolves the conflict with a compromise:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Alice: Patch{id=P5, inputs=[Title{text=&quot;Bobs Burgers (and Sandwiches)&quot;}]}
Alice: Insert{id=I5, parents=[I3, I4], patch=P5}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Every other insert is an ancestor of I5 so the new title wins all conflicts.&lt;/p&gt;

&lt;p&gt;Meanwhile, Bob is now tired of the whole thing and hits undo twice:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Bob: Remove{id=R0, parents=[I5], insert=I4}
Bob: Remove{id=R1, parents=[R0], insert=I2}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This removes P2 and P4 from the set of patches that the compiler sees. Removing P4 has no effect, because it has already been superseded by P5. Removing P2 removes the burger background.&lt;/p&gt;

&lt;h3 id=&quot;problems&quot;&gt;Problems?&lt;/h3&gt;

&lt;p&gt;Redo is still tricky. Suppose Bob liked the background so he panics and mashes redo.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Bob: Insert{id=I6, parents=[R1], patch=P2}
Bob: Redo{id=I7, parents=[I6], patch=P4}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This brings back the background, but also makes P4 the new winner of the title conflict. This is probably pretty surprising to Bob. One possible solution to this is when Bob hits undo it should skip P4, because P4 has lost a conflict and has no effect on the current state.&lt;/p&gt;

&lt;p&gt;Another potential problem is that we might automatically merge changes which are individually innocent but together cause some unexpected effect. This is possible in any VCS but we automatically merge a much higher percentage of changes. We may want to add a merge review which highlights sections that may need more attention.&lt;/p&gt;

&lt;p&gt;I haven’t yet figured out how to handle metadata such as branch pointers. If I make edits offline and then reconnect, should other users in the same session receive my changes or should I be booted into a new session? How do we undo changes to metadata (eg accidentally overwriting a branch)? I’m considering storing metadata in branch of its own so that changes are recorded and can be undone.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary: January - February: GUIs, time, joins and aggregates</title>
   <link href="http://incidentalcomplexity.com/2015/02/24/jan-feb/"/>
   <updated>2015-02-24T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2015/02/24/jan-feb/</id>
   <content type="html">&lt;p&gt;Better late than never.&lt;/p&gt;

&lt;h3 id=&quot;people&quot;&gt;People&lt;/h3&gt;

&lt;p&gt;Joshua Cole and Corey Montella joined us in the new year, bringing us up to a merry band of five.&lt;/p&gt;

&lt;h3 id=&quot;editor&quot;&gt;Editor&lt;/h3&gt;

&lt;p&gt;The goal for Eve is to have both textual and graphical code representations that stay in sync, so users can switch back and forth as they prefer. We’ve shown textual prototypes before - this is our first graphical prototype.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;https://www.youtube.com/embed/EfClpyk0jhQ&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;The core visual metaphor is tiles. Each tile represents a single chunk of code. Tiles for specialised domains like UI have their own specialised representations and editors. We intend to have grids of tiles for organising large projects - so a server project might have a network grid that contains tiles for some of the important views as well as UI tiles with graphs of network activity. This makes the editor almost into both a workspace and dashboard.&lt;/p&gt;

&lt;p&gt;The table editor is functionally complete - you can write any Eve program using it - but the UI for adding aggregates was designed for an older version of the language and can behave weirdly.&lt;/p&gt;

&lt;p&gt;The UI editor is still very experimental and has only been used to build simple forms. We still have to add support for dynamic contents (eg lists), styling and layout.&lt;/p&gt;

&lt;h3 id=&quot;aggregates&quot;&gt;Aggregates&lt;/h3&gt;

&lt;p&gt;Our current implementation of aggregates is very restricted. The aggregate functions can only return a single result and are limited to aggregating over the results of index lookups (eg ‘count the number of events which have id=”foo” and label=”click”’).&lt;/p&gt;

&lt;p&gt;We can fix these problems by adding first-class sets. We can restrict the usage of these sets so they never have to be fully materialised in the runtime - they only exist to make the semantics clear. They allows us to write complex aggregates using the same primitives we use for joins. They can also express negation, existentials and temporal queries like ‘find all consecutive events which are more than 5 minutes apart’.&lt;/p&gt;

&lt;p&gt;We are currently working through the details in an isolated implementation and intend to include it in the next iteration of the language. In the next post we will lay out the exact semantics and hopefully show some working examples.&lt;/p&gt;

&lt;h3 id=&quot;time&quot;&gt;Time&lt;/h3&gt;

&lt;p&gt;We experimented with first-class time intervals as described in &lt;a href=&quot;http://www.amazon.com/Time-Relational-Theory-Second-Management/dp/0128006315/ref=sr_1_1?ie=UTF8&amp;amp;qid=1424816894&amp;amp;sr=8-1&amp;amp;keywords=date+temporal+relational&quot;&gt;Time and Relational Algebra&lt;/a&gt;. Unfortunately this caused huge performance problems, partly due to the lack of incremental evaluation in the current runtime and partly because of the lack of custom value types in javascript.&lt;/p&gt;

&lt;p&gt;We also experimented with various different ways of representing time and change in Eve. Within the same program we can express timeless aggregates (like ‘x is the number of unique click events’) or more imperative updates (like ‘given a click at time t, the new x is the previous x plus 1’) without ever needing destructive change. It won’t be clear which patterns work best until the runtime is able to support much bigger programs.&lt;/p&gt;

&lt;h3 id=&quot;joins&quot;&gt;Joins&lt;/h3&gt;

&lt;p&gt;We implemented the &lt;a href=&quot;http://arxiv.org/abs/1404.0703&quot;&gt;Tetris algorithm&lt;/a&gt;. Along the way we came up with some nice tricks for packing bitwise tries efficiently (rather than one node per bit) and also found some optimisations for Tetris that avoid most of the overhead in the recursive search stage.&lt;/p&gt;

&lt;p&gt;Using dyadic gaps, as the paper suggests, is prohibitively expensive. The algorithm ends up generating thousands of gaps to join a dozen rows. The next experiment is to use arbitrarily sized gaps and treat resolution as a memoization problem inside the gap index rather than building it into the join algorithm itself.&lt;/p&gt;

&lt;p&gt;We &lt;em&gt;may&lt;/em&gt; also have a way to make Tetris work for arbitrary types (eg strings) as opposed to the fixed size bitstrings used in the paper.&lt;/p&gt;

&lt;p&gt;Tetris is still a good candidate for our join algorithm if we can work out these issues. Otherwise, some of the algorithms described in previous posts have produced reasonable results and are fine fallbacks.&lt;/p&gt;

&lt;h3 id=&quot;control&quot;&gt;Control&lt;/h3&gt;

&lt;p&gt;While running in the browser is a requirement for Eve, it’s always been clear that using javascript directly was not a long-term option. So many of our implementation problems come down to lack of control over data layout. For Eve we need to implement:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;New types (like intervals) - but there is a space overhead of 24 extra bytes per object&lt;/li&gt;
  &lt;li&gt;Polymorphic comparisons - but dispatching on typeof is slow&lt;/li&gt;
  &lt;li&gt;Cache-friendly indexes - but it’s hard to store multiple js objects sequentially in memory&lt;/li&gt;
  &lt;li&gt;Radix tries - but converting strings to bytes is slow&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also want to be able to distribute native code for mobile devices and use real threads on servers. Lastly, there is some benefit to using reference-counting for the indexes so that we can avoid copying nodes when we know we have sole access.&lt;/p&gt;

&lt;p&gt;We ruled out C++ and D on aesthetic grounds - we have a preference for small, simple languages that we can understand completely.  Rust wins points for safety and abstraction but the toolchain is not nearly as mature and there are issues that currently prevent compiling with Emscripten. C gives us less support in the language but is much more future-proof at the moment.&lt;/p&gt;

&lt;h3 id=&quot;roadmap&quot;&gt;Roadmap&lt;/h3&gt;

&lt;p&gt;Josh is continuing to work on improving the new editor. Corey is working out the details of the new aggregate implementations. Chris and Jamie are away at &lt;a href=&quot;http://hackerschool.com/&quot;&gt;Hacker School&lt;/a&gt; where they will experiment with porting chunks of Eve to both C and Rust.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Dev Diary (Dec): more zzjoin, communication, process spawning</title>
   <link href="http://incidentalcomplexity.com/2015/01/08/dec/"/>
   <updated>2015-01-08T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2015/01/08/dec/</id>
   <content type="html">&lt;p&gt;Yet more turkey was had. What did they ever do to us?&lt;/p&gt;

&lt;h3 id=&quot;indexes-and-joins&quot;&gt;Indexes and joins&lt;/h3&gt;

&lt;p&gt;We continued work on the zzjoin idea from the end of last month. The current version is competitive with pairwise hashjoins on many workloads but performs poorly on highly skewed inputs. In &lt;a href=&quot;http://arxiv.org/abs/1310.3314&quot;&gt;Skew Strikes Back&lt;/a&gt; the authors argue that pairwise join algorithms cannot be optimal on many problems and that their key weakness is an inability to deal with certain kinds of skew.&lt;/p&gt;

&lt;p&gt;For our current algorithm, a simple example is the query &lt;code class=&quot;highlighter-rouge&quot;&gt;select from A, B, C where A.y = B.y and B.z = C.z&lt;/code&gt; where A and B are large but C only has one row. The current version propagates whenever it can, so it will always choose to reduce the solution space to match the one row in C. If that row has a high skew (ie it joins with a large number of rows in B) then this can cause a lot of work, work that we might not have to do if we can easily determine that the join between A and B is empty. Traditional query compilers deal with this by estimating the size of the joins ahead of time and choosing an appropriate order to evaluate them in.&lt;/p&gt;

&lt;p&gt;In Skew Strikes Back the authors give a harder example: &lt;code class=&quot;highlighter-rouge&quot;&gt;select from A, B, C where A.y = B.y and B.z = C.z and C.x = A.x&lt;/code&gt; where each of A, B and C has some rows with high skew. Any pairwise join produces O(n^2) intermediate results but the query itself only has O(n) results. The only way to deal with this is to make use of all the tables at once and to use different join orders for different subsets of data to navigate around the high skew.&lt;/p&gt;

&lt;p&gt;The new version we are working on controls propagation much more carefully. At each step, it chooses one variable and propagates the next bit of that variable. The choice of variable is determined by some heuristic, the most obvious being the total number of index nodes needed to track the resulting space - a measure that is closely related to skew. Instead of performing cost estimation up front and picking a static join order, like tradition query compilers, we effectively perform cost estimation during execution and use that to decide which part of the join to explore next. This allows us to detect skew and to choose different join orders for different subsets of the data to compensate. It also greatly reduces the amount of constant time work we have to perform per step.&lt;/p&gt;

&lt;p&gt;A few days ago we came across &lt;a href=&quot;http://arxiv.org/abs/1404.0703&quot;&gt;Joins via Geometric Resolutions&lt;/a&gt; which develops a similar join algorithm called tetris and proves a number of beyond-worst-case results for it. Both tetris and zzjoin represent the solution space as an n-dimensional volume and attempt to tile the space with empty volumes from the indexes, represented as tuples of bitstrings. Where zzjoin uses a strict binary decomposition of the space and focuses on choosing a good decomposition, tetris uses a complex indexing and memoization scheme to exactly represent their tiling. While the similarity is encouraging, the authors argue that this memoization scheme is essential for achieving their strong theoretical guarantees. We need to do more work to figure out how that affects our ideas.&lt;/p&gt;

&lt;h3 id=&quot;communication&quot;&gt;Communication&lt;/h3&gt;

&lt;p&gt;Eve processes can now communicate with each other. Unlike &lt;a href=&quot;http://www.bloom-lang.net/&quot;&gt;Bloom&lt;/a&gt; we don’t have a special message table for communication. Instead, processes can dynamically subscribe to views in other processes, creating a local copy which is asynchronously updated. Compared to direct messaging, this allows &lt;a href=&quot;http://lambda-the-ultimate.org/node/2978&quot;&gt;observation without cooperation&lt;/a&gt; and enables easier composition of processes.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/chat.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/chat.png&quot; alt=&quot;Chat&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Under the hood, it’s still just plain old messaging and doesn’t attempt to hide the realities of distributed communication. The subscriber sends a subscription request and the remote process sends back timestamped diffs continuously until the connection is broken. It’s not yet clear exactly what consistency guarantees we will provide for eg multiple subscriptions to different views in the same process. We will have a better idea once we build more distributed programs and see what kind of patterns emerge.&lt;/p&gt;

&lt;h3 id=&quot;spawning&quot;&gt;Spawning&lt;/h3&gt;

&lt;p&gt;Eve processes can now spawn subprocesses and inject code into them. Together with the new communication API this allowed much of the IDE architecture to be lifted into Eve. When running in the browser only the UI manager lives on the main thread - the editor, the compiler and the user’s program all live in separate web-workers. The editor uses the process API to spawn both the compiler and the user’s program and then subscribes to the views it needs for the debugging interface. Both the editor and the user’s program send graphics data to the UI manager and receiving UI events in return.&lt;/p&gt;

</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Nov): experiments, performance, integrity constraints, zztrees</title>
   <link href="http://incidentalcomplexity.com/2014/12/01/nov/"/>
   <updated>2014-12-01T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2014/12/01/nov/</id>
   <content type="html">&lt;p&gt;We are all so very full of turkey.&lt;/p&gt;

&lt;h3 id=&quot;light-table&quot;&gt;Light Table&lt;/h3&gt;

&lt;p&gt;We released &lt;a href=&quot;https://github.com/LightTable/LightTable/blob/master/deploy/core/changelog.md&quot;&gt;Light Table 0.7.0&lt;/a&gt; and gained &lt;a href=&quot;https://github.com/orgs/LightTable/teams/committers&quot;&gt;three awesome committers&lt;/a&gt; who have decimated the bug count, moved all the infrastructure over to community control and changed to the MIT license.&lt;/p&gt;

&lt;p&gt;We also have an &lt;a href=&quot;https://github.com/LightTable/LightTable/tree/atom-shell&quot;&gt;experimental branch&lt;/a&gt; using atom-shell instead of node-webkit. This gives us smoother performance and useful new features like using iframes to isolate user code from the editor itself.&lt;/p&gt;

&lt;h3 id=&quot;more-experiments-with-eve&quot;&gt;More experiments with Eve&lt;/h3&gt;

&lt;p&gt;We built a Turing machine (just to be sure):&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/turing.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/turing.png&quot; alt=&quot;Turing machine&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And some simple animations running at 60 fps to stress the rendering library:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/clock.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/clock.png&quot; alt=&quot;Clock&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/sine.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/sine.png&quot; alt=&quot;Sine balls&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also bootstrapped part of the new editor, so the tables on the right hand side of the above screenshots are drawn by an Eve program. The tables don’t update at 60 fps yet - way too much overhead from all the silly table scans in the solver.&lt;/p&gt;

&lt;h3 id=&quot;stability-and-performance&quot;&gt;Stability and performance&lt;/h3&gt;

&lt;p&gt;The compiler, runtime and editor now all run in separate webworkers, so the editor doesn’t freeze if you put an infinite loop in your program.&lt;/p&gt;

&lt;p&gt;The rendering library got smarter: it now correctly handles incremental updates of ordered elements and can comfortably render 10k row tables in a few milliseconds.&lt;/p&gt;

&lt;p&gt;The runtime got some performance improvements in the form of faster unions for views and dirty tracking for propagators.&lt;/p&gt;

&lt;p&gt;We had some fun with benchmarking in chrome:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/chrome-pain.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/chrome-pain.png&quot; alt=&quot;Chrome pain&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The benchmark takes longer and longer until the memory usage reaches around 1.5gb, at which point it never returns. Not returning the results from the bench function fixes the problem. The same benchmark runs fine in Firefox and Safari - perhaps a difference in the way they store results in the console?&lt;/p&gt;

&lt;h3 id=&quot;integrity-constraints&quot;&gt;Integrity constraints&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Data_integrity#Types_of_integrity_constraints&quot;&gt;Integrity constraints&lt;/a&gt; specify invariants that transactions are not allowed to violate. In Eve, any view can be tagged as an integrity constraint. If that view ever produces output, the current transaction is aborted. This allows us to write column type constraints, foreign key constraints and other arbitrarily complex constraints by simply writing views that look for violations of the constraint.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;* columnTypeExample
 | employee name
 ? typeof(name) !== 'string'

* foreignKeyExample
  | employee name department
  | !department department

* disjointExample // an event is either a keyEvent, a mouseEvent or a networkEvent
  | event id
  &amp;gt; keyEvent id | k = count(id)
  &amp;gt; mouseEvent id | m = count(id)
  &amp;gt; networkEvent id | n = count(id)
  ? k + m + n !== 1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We could improve this by adding shortcuts for common constraint types and providing more readable syntax (LogicBlox has a &lt;a href=&quot;https://developer.logicblox.com/content/docs4/core-reference/webhelp/constraints-predicate-declarations.html&quot;&gt;reasonable syntax&lt;/a&gt; for constraints).&lt;/p&gt;

&lt;h3 id=&quot;zztrees&quot;&gt;ZZTrees&lt;/h3&gt;

&lt;p&gt;Consider a simple relational query:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;SELECT user.id
FROM user
JOIN login ON user.id = login.userId
JOIN banned ON login.ipAddress = banned.ipAddress
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The database has to choose what order to evaluate these joins in. It could first take all the users, lookup all the logins for each user and then check whether each login is in the banned list. Or it could start with the banned list, look up logins of banned ips and then lookup the corresponding users. If we have a million users and one banned ip, the second option will be much faster. If we have one user and a million banned ips, the first option will be faster. In general, determining a good ordering is an &lt;a href=&quot;http://wp.sigmod.org/?p=1075&quot;&gt;incredibly hard problem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The appeal of using a constraint solver is that we might not have to solve the problem at all. If each propagation does a small amount of work, if we schedule propagators fairly and if we are able to propagate freely between all variables, then each propagator gets a fair chance to prune the current branch before the other propagators do too much wasted work. This is strikingly similar to the problem of &lt;a href=&quot;http://scattered-thoughts.net/blog/2012/12/19/search-trees-and-core-dot-logic/&quot;&gt;fair conjunction&lt;/a&gt; in prolog-descended languages - we pay a constant overhead to avoid worst-case performance.&lt;/p&gt;

&lt;p&gt;The tricky part of this is building an index that can propagate in multiple directions. &lt;a href=&quot;http://arxiv.org/abs/1210.0481&quot;&gt;Triejoin&lt;/a&gt; uses a btree which means we have to choose what order to place the columns in. If we place login.ipAddress before login.userId then we must know exactly what ipAddress we are considering before we can get any bounds on the userId, and vice versa. We could build two indexes, one in each direction, but the cost of doing this increases exponentially as the number of columns in the join increases.&lt;/p&gt;

&lt;p&gt;We are currently working on a index based on the &lt;a href=&quot;http://globis.ethz.ch/person/moira-c-norrie/?pubdownload=699&quot;&gt;PH-Tree&lt;/a&gt; and the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hash_array_mapped_trie&quot;&gt;Hash Array Mapped Trie&lt;/a&gt;. We take each row that is to be inserted in the index, hash each value in the row, then interleave the bits of those hashes and then use the result as the trie key.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[userId=92, ipAddress=&quot;127.0.0.1&quot;]
=&amp;gt;
[1001..., 1110...]
=&amp;gt;
11010110...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The intuition behind this is that learning one bit of the hash reduces the entropy of the unknown variable by roughly one bit (with many caveats about collisions and repeated values). Interleaving the bits gives us a small amount of information about each value every time we descend in the tree. The propagator walks down the tree until it finds multiple branches that fit the currently known bits of the variables. Once each propagator has descended as far as it can, we split the solver by guessing an unknown bit. Rinse and repeat until we reach a solution or prune the current branch of the solver.&lt;/p&gt;

&lt;p&gt;The tree and the propagator are done but we haven’t yet written the solver to go with it. We get to end this month on a cliffhanger.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve Dev Diary (Oct): bootstrap editor, experiments, aggregates</title>
   <link href="http://incidentalcomplexity.com/2014/11/05/oct/"/>
   <updated>2014-11-05T00:00:00-08:00</updated>
   <id>http://incidentalcomplexity.com/2014/11/05/oct/</id>
   <content type="html">&lt;p&gt;We spent most of October working on the language design rather than the implementation. We wrote lots of simple programs and ended up reworking some features that were awkward in practice. We also built a text-based editor to use while we bootstrap the full IDE.&lt;/p&gt;

&lt;h3 id=&quot;bootstrap-editor&quot;&gt;Bootstrap editor&lt;/h3&gt;

&lt;p&gt;Up until now we were using a javascript dsl to write code in Eve. Feedback even in javascript is a little slow for our liking so we hooked up a simple editor that compiles and runs on every change. The total delay from key press to results is around 50ms, most of which is spent marshalling data to and from the webworker.&lt;/p&gt;

&lt;iframe width=&quot;600&quot; height=&quot;450&quot; src=&quot;//www.youtube.com/embed/m-acupIazWI&quot; frameborder=&quot;0&quot; allowfullscreen=&quot;&quot;&gt;&lt;/iframe&gt;

&lt;p&gt;This has improved our productivity a lot. The plan now is to build on this editor incrementally, so that we can use new features immediately rather than having to wait until the entire IDE is bootstrapped.&lt;/p&gt;

&lt;h3 id=&quot;experiments&quot;&gt;Experiments&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;http://todomvc.com/&quot;&gt;TodoMVC&lt;/a&gt; is an application that is simple to implement but makes use of all the features needed for complex client-side web applications. This makes it useful for comparing different approaches to client-side development.&lt;/p&gt;

&lt;p&gt;We came up with a similar set of simple programs that characterise what we expect to be common use-cases for Eve. For this month we picked five examples to focus on:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Recording, analysing and presenting data from a simple high-school physics experiment (data entry, calculation, presentation)&lt;/li&gt;
  &lt;li&gt;Tracking time and generating invoices (reactive UI, calculation, presentation)&lt;/li&gt;
  &lt;li&gt;Calculating compound interest over time (data entry, calculation, recursion)&lt;/li&gt;
  &lt;li&gt;Reminding the user to bring an umbrella to work if the forecast is rainy (scheduling, async IO, parsing)&lt;/li&gt;
  &lt;li&gt;Simulating a turing machine (completeness)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We ran through each of these and figured out how we as programmers would expect them to work. We then had Rob try to implement each program using our ‘mock UI’, which is just drawn by hand in real-time.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/cards.jpg&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/cards.jpg&quot; alt=&quot;UI on cards&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Actually trying to validate our design would require more formal testing with a wide range of users - this is just aimed at finding low-hanging mistakes or difficulties with little time investment. Rob doesn’t have Programmer Stockholm Syndrome yet and will flat out refuse to do things that seem to us like very reasonable workarounds.&lt;/p&gt;

&lt;p&gt;The main problems we found through our experiments were related to position, mutation, context and aggregates.&lt;/p&gt;

&lt;h3 id=&quot;position&quot;&gt;Position&lt;/h3&gt;

&lt;p&gt;The compound interest example is usually written in excel by starting with the columns &lt;code class=&quot;highlighter-rouge&quot;&gt;Year&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;Balance&lt;/code&gt;. The first row is filled in by hand, say with &lt;code class=&quot;highlighter-rouge&quot;&gt;2014&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;$5&lt;/code&gt;. Then the year row is dragged down to produce a list of consecutive years. The second balance entry is filled in with a formula that directly references cells in the row above - &lt;code class=&quot;highlighter-rouge&quot;&gt;= B0 * 1.01&lt;/code&gt;. Dragging down the balance column leads Excel to generalise this formula and apply it correctly for each cell.&lt;/p&gt;

&lt;p&gt;The first problem here is the part where the formula references ‘the row above’. The semantic intent of the formula is bound up in the layout of the program. Tables in Eve don’t have an intrinsic order so the concept of ‘the row above’ doesn’t have any meaning. Despite that, the fact that we have to choose some ordering to display it leads people to want to use that ordering.&lt;/p&gt;

&lt;p&gt;The proposed solution is to have operators that give the desired results but expand to existing primitives. So, for example, if the user is clicking on the row above and the table is currently sorted by Year, we could insert the formula &lt;code class=&quot;highlighter-rouge&quot;&gt;[Balance] for [Year] before [CurrentYear]&lt;/code&gt; which (in pidgin SQL) expands to &lt;code class=&quot;highlighter-rouge&quot;&gt;select Balance, Year from CompoundInterest where Year &amp;lt; CurrentYear sort by Year descending limit 1&lt;/code&gt;. This allows novice users to get the results they want while at the same time teaching them how to construct more complex queries.&lt;/p&gt;

&lt;h3 id=&quot;mutation&quot;&gt;Mutation&lt;/h3&gt;

&lt;p&gt;Where most languages express state as a series of changes (‘when I click this button add 1 to the counter’), Eve is built around views over input logs (‘the value of the counter is the number of button clicks in the log’). Thinking in terms of views makes the current language simple and powerful. It removes the need for explicit control flow, since views can be calculated in any order that is consistent with the dependency graph, and allows arbitrary composition of data without requiring the cooperation of the component that owns that data.&lt;/p&gt;

&lt;p&gt;Whenever we have tried to introduce explicit change we immediately run into problems with ordering and composing those changes and we lose the ability to directly explain the state of the program without reference to data that no longer exists.&lt;/p&gt;

&lt;p&gt;For some domains (eg accounting, analytics) thinking in terms of views seems to be easy and familiar for everyone we have talked to. For other domains, particularly UI, most people preferred to talk in terms of change to the current state. This leaves us with some open questions.&lt;/p&gt;

&lt;p&gt;Firstly, to what extent is this learnable/teachable? Is it possible to make an interface where the &lt;a href=&quot;http://english.stackexchange.com/questions/77535/what-does-falling-into-the-pit-of-success-mean&quot;&gt;Pit of Success&lt;/a&gt; naturally leads to seeing everything as views?&lt;/p&gt;

&lt;p&gt;Secondly, is it possible to exploit the duality between the two models and flip back and forth between them. For simple examples like counting button clicks this is easy. It’s not obvious how it might work in general though.&lt;/p&gt;

&lt;h3 id=&quot;context&quot;&gt;Context&lt;/h3&gt;

&lt;p&gt;We ran into a number of problems that boiled down to tracking context:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;In UI code it’s often useful to be able to refer to the current user or to some set of state associated with the current user.&lt;/li&gt;
  &lt;li&gt;In multi-page forms, the contents of the previous pages need to be stored and kept up-to-date as the user moves back and forth through the forms.&lt;/li&gt;
  &lt;li&gt;In the physics experiment example, it is useful to be able to treat experiment parameters as constants when recording and analysing the first experiment and then handle future experiments by editing copies of the first program.&lt;/li&gt;
  &lt;li&gt;When building UI components, to make the component reusable in multiple places the programmer needs to attach a component id of some sort to all of the state for the component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a traditional imperative language, this sort of context is provided by access to dynamic scoping (or global variables - the poor mans dynamic scope) or by function parameters. In purely functional languages it can only be provided by function parameters, which is a problem when a deeply buried function wants to access some high up data and it has to be manually threaded through the entire callstack.&lt;/p&gt;

&lt;p&gt;In each case, there is some context identifier that needs to be threaded through all the code running that context and this feels like something that could be automated. We could perhaps have a way to assign a context to a set of views, so that each of those views is parameterised by a context id and can treat that context as if it is the only one that exists. That allows us to have flat, global tables for easy composability and debugging but still be able to look at code in a local view that ignores the context columns.&lt;/p&gt;

&lt;h3 id=&quot;aggregates&quot;&gt;Aggregates&lt;/h3&gt;

&lt;p&gt;Classic datalog is often extended with query-level aggregates:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;department(&quot;engineering&quot;)
department(&quot;business&quot;)
department(&quot;marketing&quot;)

worksIn(&quot;jamie&quot;, &quot;engineering&quot;)
worksIn(&quot;chris&quot;, &quot;engineering&quot;)
worksIn(&quot;rob&quot;, &quot;business&quot;)

employeesPerDepartment(Department, count(Name)) :-
  department(Department)
  worksIn(Name, Department)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The body of &lt;code class=&quot;highlighter-rouge&quot;&gt;employeesPerDepartment&lt;/code&gt; produces three rows:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Department, Name
&quot;engineering&quot;, &quot;jamie&quot;
&quot;engineering&quot;, &quot;chris&quot;
&quot;business&quot;, &quot;rob&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then the results are grouped by the non-aggregated columns that are in the head (in this case just &lt;code class=&quot;highlighter-rouge&quot;&gt;Department&lt;/code&gt;) producing:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;employeesPerDepartment(&quot;engineering&quot;, 2)
employeesPerDepartment(&quot;business&quot;, 1)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We used the same model for Eve (although with more explicit control over grouping and support for sort/limit). The problem is that this code will not produce &lt;code class=&quot;highlighter-rouge&quot;&gt;employeesPerDepartment(&quot;marketing&quot;, 0)&lt;/code&gt; because there were no rows to aggregate over at all. There is no way to distinguish between an empty aggregate and no result at all. If you actually want &lt;code class=&quot;highlighter-rouge&quot;&gt;employeesPerDepartment(&quot;marketing&quot;, 0)&lt;/code&gt; you need to add another rule to handle empty departments:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;employeesPerDepartment(Department, 0) :-
  department(Department)
  NOT worksIn(Name, Department)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This results in lots of duplication of code to handle each case.&lt;/p&gt;

&lt;p&gt;SQL handles this by having left-joins insert nulls in rows which would otherwise be missing and by treating nulls specially in aggregates.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Department, Name
&quot;engineering&quot;, &quot;jamie&quot;
&quot;engineering&quot;, &quot;chris&quot;
&quot;business&quot;, &quot;rob&quot;
&quot;marketing&quot;, null

employeesPerDepartment(&quot;engineering&quot;, 2)
employeesPerDepartment(&quot;business&quot;, 1)
employeesPerDepartment(&quot;marketing&quot;, 0)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This adds complexity to the language and implementation and is &lt;a href=&quot;http://www09.sigmod.org/sigmod/record/issues/0809/p23.grant.pdf&quot;&gt;often regarded as a mistake&lt;/a&gt;. Instead, we replaced query-level aggregates with clause-level aggregates:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;employeesPerDepartment(Department, Count) :-
  department(Department)
  &amp;gt; worksIn(Department, _Name) | Count = count(Name)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The left-hand side of the clause returns all rows that match the specified variables and the right hand side reduces those rows into scalar values. The grouping on the left-hand side makes it explicit that we want to perform the aggregate per department. It’s easy to incrementally maintain these aggregates using map-reduce trees and they nicely handle temporal views such as:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;user(Id, CurrentName, CurrentAddress) :-
  registered(Id)
  &amp;gt; nameChanged(Id, _Name, _Time) | CurrentName = lastBy(Time, Name)
  &amp;gt; addressChanged(Id, _Address, _Time) | CurrentAddress = lastBy(Time, Address)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We still need to think more about how to handle multiple returns, argument passing and sort/limit with this strategy but the basic form is already working.&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Eve so far</title>
   <link href="http://incidentalcomplexity.com/2014/10/16/retrospective/"/>
   <updated>2014-10-16T00:00:00-07:00</updated>
   <id>http://incidentalcomplexity.com/2014/10/16/retrospective/</id>
   <content type="html">&lt;p&gt;This is the &lt;a href=&quot;http://www.chris-granger.com/2014/10/01/beyond-light-table/&quot;&gt;Eve&lt;/a&gt; development diary.&lt;/p&gt;

&lt;p&gt;The goal of Eve is to give everyone access to computing as a general purpose tool. Languages and tools aimed at programmers require an inordinate investment of time and effort to reach basic competence. Environments aimed at non-programmers impose a low ceiling on power and have not caught up to modern computing (support for real-time collaboration, sharing data between programs, building web applications etc). We aim to build a computing environment that supports beginners and experts equally.&lt;/p&gt;

&lt;p&gt;While Eve is constantly changing as we learn more, there are a number of design principles that we take as axiomatic:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grow with the user&lt;/strong&gt;. The way to introduce a complex skill is to teach it gradually. Beginners should be presented with a simple interface. More complex features should be unlocked as they are needed. This allows simple tasks to be easily learned without imposing a ceiling on power.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Belong to the user&lt;/strong&gt;. Advanced users should be able to understand and extend the environment itself. That means it must be open source, have a simple and well documented implementation and be designed for extending. We should encourage users to learn by reducing the number of steps it takes to go from having a question about a tool to opening the hood and poking around inside.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Be friendly and helpful&lt;/strong&gt;. There should always be an obvious path from encountering a new problem to finding answers. Exploration and experimentation should be encouraged by teaching the user that every action is safe and can be undone. Error messages should be accompanied by a full explanation and suggestions for how to proceed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ergonomics matter&lt;/strong&gt;. We should observe users and collect data to discover common actions and workflows. The environment should be optimised for the way that people use it, not the way that we think it should be used. Tools should communicate with each other instead of making the user perform the same actions manually e.g. consider the number of manual steps between seeing an error in production and reproducing it in a debugger - the ideal interaction is just clicking on the error in some dashboard and being dropped into a debugger with the same runtime state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Computing is the means, not the end&lt;/strong&gt;. Most end-users are not here to program for the sake of programming; they are trying to solve some problem in the real world. Every tool and feature must demonstrably and immediately save the user time and effort or they will ignore it. A simple tool that solves 80% of the users problems is often preferable to a complex tool that tries to do everything and requires a manual the size of a house.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Empiricism over ideology&lt;/strong&gt;. If something doesn’t work in practice, it doesn’t work at all. We shouldn’t make assumptions about what users will understand or how they ‘naturally’ think. We should be aware of our history - of what has and hasn’t worked in the past and the reasons why. The real world exists, it is a mess and it won’t go away if we close our eyes and ignore it.&lt;/p&gt;

&lt;p&gt;This diary will be updated once a month and will track our successes and, more importantly, our failures. We will start by retroactively filling in the months since the project began.&lt;/p&gt;

&lt;h3 id=&quot;the-beginning&quot;&gt;The Beginning&lt;/h3&gt;

&lt;p&gt;Eve began life as &lt;a href=&quot;https://www.youtube.com/watch?v=L6iUm_Cqx2s&quot;&gt;Aurora&lt;/a&gt;, a demo of a live environment for a clojure-like language that Chris cooked up on a flight to Strange Loop in September 2013. &lt;a href=&quot;http://www.lighttable.com/&quot;&gt;Light Table&lt;/a&gt; was reaching the limits of what it could do with traditional languages and Chris wanted to see how far he could push the same ideas in a language designed for the task.&lt;/p&gt;

&lt;h3 id=&quot;january-2014&quot;&gt;January 2014&lt;/h3&gt;

&lt;p&gt;In early January, Light Table was open-sourced and work began on turning the Aurora demo into a usable prototype. We were pretty certain that all that really needed to be done to make programming accessible was to make the data visible and directly manipulable. “It’ll be over by Christmas.”&lt;/p&gt;

&lt;p&gt;The initial language was a clojure-like pattern-matching functional language run in a simple interpreter. Outputs were updated live as input data changed, using traditional &lt;a href=&quot;http://www.umut-acar.org/self-adjusting-computation&quot;&gt;SAC&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/1.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/1.png&quot; alt=&quot;SAC and trees&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There was only a single global tree data-structure that was traversed and modified by the program. Every piece of state in the program had to live somewhere in this tree. Input was added into a special location in the data-structure and output was read from another. Functions could be passed ‘cursors’ that allowed them to mutate part of the tree, creating a kind of mutable variable. These cursors could not be stored in the tree itself so it was not possible to create cycles.&lt;/p&gt;

&lt;p&gt;The UI hadn’t changed much from the initial demo at Strange Loop. We showed a collapsible tree of functions alongside the input and output data for each function. There was always tension between whether we should display the control flow of an actual execution or the abstract control flow of the function itself.&lt;/p&gt;

&lt;p&gt;The good:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;All state was accessible and browsable from the root of the tree. The ease of debugging and understanding that we experienced led to the heretical idea that &lt;a href=&quot;http://scattered-thoughts.net/blog/2014/02/17/local-state-is-harmful/&quot;&gt;perhaps encapsulated state is actually harmful&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;Every function had a unique id. The names displayed on the screen were just documentation. There were no namespaces and renaming a function just required changing the name tag attached to the id.&lt;/li&gt;
  &lt;li&gt;The SAC-like model made it easy to immediately see the effects of changes to data or code. Tight feedback loops make for easy debugging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bad:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Hierarchical organisation of data complects the data itself with the common access paths. If any of us had lived through the years of network/xml/object databases we would have known this already. Paying attention to history would have saved us some time.&lt;/li&gt;
  &lt;li&gt;Passing cursors quickly became tedious when trying to change code. If a function suddenly needed access to IO the cursor had to be passed down through every function above it in the callstack. Manual, non-local propagation of changes is a sign of strong coupling. Seeing it show up in our state and IO models was a bad sign.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The ugly:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Excited, we presented our prototype to a small number of non-programmers and sat back to watch the magic. To our horror, not a single one of them could figure out what the simple example program did or how it worked, nor could they produce any useful programs themselves. The sticking points were lexical scope and data structures. Every single person we talked to just wanted to put data in an Excel-like grid and drag direct references. Abstraction via symbol binding was not an intuitive or well-liked idea.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Back to the drawing board.&lt;/p&gt;

&lt;h3 id=&quot;february-2014&quot;&gt;February 2014&lt;/h3&gt;

&lt;p&gt;The big sticking points that we identified were lexical scoping, data structures and hierarchical organisation.&lt;/p&gt;

&lt;p&gt;We experimented with different ways to display lexical scope and function application, including&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;drawing lines between declaration and use&lt;/li&gt;
  &lt;li&gt;highlighting each variable in a unique colour&lt;/li&gt;
  &lt;li&gt;using nesting to show lexical regions&lt;/li&gt;
  &lt;li&gt;allowing direct manipulation of data and inferring a list of plausible abstract operations&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Again, we presented each of these to a small number of non-programmers, demonstrated writing a program, let them play around with the UI, and then asked them to explain the flow of the data through the program. None of the experiments led to much success. Since most of our testees can quite happily build complex systems in Excel, we suspect the culprit is one of control flow, data structures or variable binding.&lt;/p&gt;

&lt;p&gt;We replaced all the clojure data-structures (vectors, maps, sets) with tables - indexed multi-sets that were displayed as an Excel-like grid. Setting columns as unique keys allowed imitating the semantics of vectors, maps, sets and multi-sets while still having the same interface. This interface was more familiar to non-programmers and unique keys were more easily understood than having the same operations behave differently on different data-structures.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/2.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/2.png&quot; alt=&quot;SAC and tables&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We also replaced the interpreter with a compiler, for reasons that are now unclear. Perhaps the editor was too slow when running user tests?&lt;/p&gt;

&lt;h3 id=&quot;march&quot;&gt;March&lt;/h3&gt;

&lt;p&gt;Our main data-structure was now a tree of tables. Rather than one big top-level function, we switched to a pipeline of functions. Each function pulled data out of the global store using a datalog query, ran some computation and wrote data back. Having less nesting reduced the impact of lexical scope and cursor passing. Using datalog allowed normalising the data store, avoiding all the issues that came from hierarchical models.&lt;/p&gt;

&lt;p&gt;At this point we realised we weren’t building a functional language anymore. Most of the programs were just datalog queries on normalised tables with a little scalar computation in the middle. We were familiar with &lt;a href=&quot;http://bloom-lang.net/&quot;&gt;Bloom&lt;/a&gt; and realised that it fit our needs much better than the functional pidgin we had built so far - no lexical scoping, no data-structures, no explicit ordering. In late March we began work on a Bloom interpreter.&lt;/p&gt;

&lt;h3 id=&quot;april&quot;&gt;April&lt;/h3&gt;

&lt;p&gt;At the beginning of April our fledgling Bloom interpreter managed to &lt;a href=&quot;https://twitter.com/jamiiecb/status/451095271301054464&quot;&gt;stratify it’s own stratifier&lt;/a&gt;. Chris started working on a new editor designed around queries. In the meantime we wrote test programs using a pile of clojure macros. We were hedging our bets with respect to normalisation so the interpreter allowed arbitrary clojure data-structures as values and supported pattern-matching and calling clojure functions.&lt;/p&gt;

&lt;p&gt;We added a simple UI library that watched the DOM table and rebuilt the entire UI on each tick and then began to build our first useful programs. I remember being surprised at how far we could get with a language that didn’t even support aggregation yet:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;dependency tracking, cycle detection and stratification ~ 50 loc, 13 rules&lt;/li&gt;
  &lt;li&gt;todomvc (minus routing) ~ 140 loc, 30 rules&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The editor developed enough that we could use it to build todomvc (which took around ten minutes to write) and live update todomvc as rules were edited. Rules were written in an If-This-Then-That style which went down somewhat better than the computation oriented interface we had before.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/5.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/5.png&quot; alt=&quot;Madlibs&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interestingly, since the rules read almost like English, we started getting complaints that they were ungrammatical. Rules like ‘if [time = T] do …’ were met with the objection that there is always a current time and it’s not a matter of ‘if’. I suspect many natural language interfaces run into the same uncanny valley problem.&lt;/p&gt;

&lt;p&gt;The interpreter was still painfully slow though. Complex interactions like autocomplete in the editor had delays on the order of seconds. We eked out some improvements by forking clojurescripts transient maps and removing all the features we didn’t use but it was clear that making the editor usable would require a much more sophisticated runtime.&lt;/p&gt;

&lt;h3 id=&quot;may&quot;&gt;May&lt;/h3&gt;

&lt;p&gt;Most databases use the model pioneered by &lt;a href=&quot;http://en.wikipedia.org/wiki/IBM_System_R&quot;&gt;System R&lt;/a&gt;. The query optimiser generates a variety of plans that could answer the query and chooses the plan with the lowest estimated cost. Each plan consist of a tree of operators (eg index lookup, hashjoin, mergesort). Each operator produces an iterable stream of results which is consumed by it’s parent in the tree. The leaves of the tree read from indexes or tables and the root of the tree produces the result of the query. This is a solid design and has been proven over and over. It’s also a mountain of work to implement. We weren’t feeling mountainous.&lt;/p&gt;

&lt;p&gt;Luckily, we stumbled across a paper that details a much easier option: &lt;a href=&quot;http://arxiv.org/pdf/1210.0481.pdf&quot;&gt;Leapfrog Triejoin: A Simple, Worst-Case Optimal Join
Algorithm&lt;/a&gt;. Triejoin is a simple and efficient algorithm that can compute an entire datalog query in one pass.&lt;/p&gt;

&lt;p&gt;Jamie got started on a btree implementation. Ironically, given our stated principles, the early effort was marred by a lack of observability and poor test coverage. After spending far too many days on debugging, the combination of a ascii-diagram printer and a series of  &lt;a href=&quot;https://github.com/cemerick/double-check&quot;&gt;double-check&lt;/a&gt; tests won through.&lt;/p&gt;

&lt;p&gt;Jamie and Chris then worked independently on separate implementations of triejoin to reduce the odds of missing an important optimisation. Again, initial flailing was countered by printing simple ascii diagrams of the join process and writing yet more double-check tests. If there was anything we learned from this month, it’s that &lt;a href=&quot;https://www.youtube.com/watch?v=zi0rHwfiX1Q&quot;&gt;property-based testing&lt;/a&gt; provides massive leverage when writing complex code.&lt;/p&gt;

&lt;h3 id=&quot;june&quot;&gt;June&lt;/h3&gt;

&lt;p&gt;We had a few problems with triejoin:
The paper mentioned that the choice of variable ordering was really important but put it off to a subsequent paper.
For tables with lots of columns we ended up building large numbers of indexes to cover all the different query orders. Updating those indexes was getting expensive.
The algorithm was &lt;a href=&quot;http://www.faqs.org/patents/app/20140089292&quot;&gt;patented&lt;/a&gt; (as was the &lt;a href=&quot;http://www.faqs.org/patents/app/20140181081&quot;&gt;incremental version&lt;/a&gt;) and we didn’t want to stand on a rug that might later be pulled out from underneath us.&lt;/p&gt;

&lt;p&gt;We went through several different implementations of triejoin and triejoin-like algorithms, exploring the design space, and eventually hit upon the sudden realisation that the fundamental idea in triejoin is just constraint propagation. Using constraint solvers to implement query langauges is &lt;a href=&quot;http://rd.springer.com/chapter/10.1007/3-540-62501-1_24&quot;&gt;not a new idea&lt;/a&gt; and we are not the first to notice that this &lt;a href=&quot;http://arxiv.org/abs/1307.4635&quot;&gt;applies to triejoin&lt;/a&gt; but the idea hasn’t received much attention thanks to the dominance of System R designs. We built a basic propagator-based constraint solver (based on &lt;a href=&quot;http://www.gecode.org/paper.html?id=Tack:PhD:2009&quot;&gt;gecode&lt;/a&gt;) which, like triejoin, can calculate an entire datalog query in one pass, is reasonably fast and is substantially easier to implement than a traditional query plan optimiser.&lt;/p&gt;

&lt;p&gt;All of our previous demos were rebuilt on top of the new system. TodoMVC and autocomplete were both reacting and re-rendering in sub-100ms. The editor was smooth enough to be usable. We even demoed to Andreessen Horowitz without anything breaking.&lt;/p&gt;

&lt;p&gt;We still didn’t have incremental evaluation though. Every new input caused the entire program to recalculate from scratch. We were doing that fast enough that we could get away with it for small demos but it was clearly going to be a problem.&lt;/p&gt;

&lt;h3 id=&quot;july&quot;&gt;July&lt;/h3&gt;

&lt;p&gt;We knew the problem we needed to solve: incremental evaluation of recursive datalog rules under addition and deletion of facts. We just couldn’t find a solution.&lt;/p&gt;

&lt;p&gt;Storing the entire &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.165.6994&amp;amp;rep=rep1&amp;amp;type=pdf&quot;&gt;provenance graph&lt;/a&gt; explicitly is too expensive. &lt;a href=&quot;http://ac.inf.elte.hu/Vol_015_1995/125.pdf&quot;&gt;Semi-naive evaluation&lt;/a&gt; doesn’t handle deletions. &lt;a href=&quot;http://dl.acm.org/citation.cfm?id=170066&quot;&gt;DRED&lt;/a&gt; is known to often be slower than non-incremental evaluation for recursive views. Many papers that claimed novel algorithms were just variations on DRED. &lt;a href=&quot;http://vldb.org/pvldb/vol5/p968_yanifahmad_vldb2012.pdf&quot;&gt;Higher-order delta processing&lt;/a&gt; ends up with exponentially many terms when a single transaction might change all views. &lt;a href=&quot;http://arxiv.org/abs/1303.5313&quot;&gt;Incremental triejoin&lt;/a&gt; is patented, and would also require solving our triejoin-related problems.&lt;/p&gt;

&lt;p&gt;We circled around the problem all month, reading papers and sketching out ideas. Other work got done but we knew this was a problem that could sink the entire approach and so we kept getting drawn back to it.&lt;/p&gt;

&lt;p&gt;Unlike the constraint solver, there was no sudden revelation. We got there by chipping away the problem space until we arrived at a more useful way of thinking about the problem. We had been locked into thinking that the only information available is the structure of the rule being evaluated and the sequence of decisions recorded from previous evaluations. Semi-naive evaluation uses the former to rule out cases where old inputs do not need to be considered. Incremental triejoin uses the latter to remember where it made decisions that may need to be changed.&lt;/p&gt;

&lt;p&gt;Just as we saw a constraint solver by looking at triejoin from the right angle, we spotted a different way of thinking about incremental triejoin. Rather than directly recording sequences of decisions and replaying them, as triejoin does, we changed the job of the constraint solver.&lt;/p&gt;

&lt;p&gt;The constraint solver operates by iteratively tightening the bounds on each variable in the query. Each tightening of the bounds rules out an entire volume in the solution space, effectively proving that none of the points in that volume can possible be solutions to the query. We now make the constraint solver responsible not just for finding solutions but for finding all of these proofs.&lt;/p&gt;

&lt;p&gt;The end result of running the constraint solver is then a data-structure that encodes both why-provenance and why-not-provenance i.e. for every point in the solution space it can either a) tell you that the point is a valid solution and give you a list of which facts the solution depends on or b) give you one or more proofs that this point is not a valid solution. When facts are added to or deleted from a table, some of the proofs made by the corresponding constraint may be invalidated. When the solver is rerun, the provenance constrains the solver to only consider areas which do not have a valid proof.&lt;/p&gt;

&lt;p&gt;From this point of view, semi-naive evaluation is similar to a provenance structure which doesn’t store any details of the proof and so has to invalidate if any matching table changes. The sensitivity index in incremental triejoin is effectively indexing the proofs by the changes which would invalidate them and then throwing away the original proof information. The examples in their patent show redundant sensitivity information being stored after facts are deleted - we should be able to avoid this because on deletion the new, simpler proof will overwrite the old detailed proofs.&lt;/p&gt;

&lt;p&gt;How to efficiently maintain and query the provenance is still an open question. The proof for an entire volume can be encoded simply as the index of the constraint which tightened that bound. Likely some form of space-dividing tree (eg a &lt;a href=&quot;http://en.wikipedia.org/wiki/K-D-B-tree&quot;&gt;k-d-b tree&lt;/a&gt;) could be used to store and query these volumes. (If we ordered variables like triejoin does then a single interval tree would suffice but then we would be back to having to choose efficient orderings). The usual concerns with overlapping volumes in high dimensional data-structures should be less of a problem here - we only need to cover the space so we can freely split volumes and throw away overlaps.&lt;/p&gt;

&lt;p&gt;Thinking of provenance this way gives us a lot of flexibility to trade off storage costs against future re-evaluation costs. That flexibility, and the fact that it can mimic other solutions, gives me confidence that it is a useful way of thinking about the problem even though we don’t yet have an efficient implementation.&lt;/p&gt;

&lt;h3 id=&quot;august&quot;&gt;August&lt;/h3&gt;

&lt;p&gt;Since we needed to rebuild the runtime from scratch to accommodate provenance we took the opportunity to start porting all our code from clojurescript to javascript. The core clojurescript libraries were all too slow and allocation-heavy to use in a language runtime. We were suffering from long compile times and poor error messages (“Cannot call method undefined of undefined”) without being able to take advantage of any the benefits of clojurescript. Moving to javascript made writing low-level code much easier.&lt;/p&gt;

&lt;p&gt;Implementing the provenance turned out to be really tricky. We went through various iterations, dealing with problems of representing proofs and reasoning about overlap between volumes and open/closed edges. We stored proofs in a single big array and focused on getting the logic right first.&lt;/p&gt;

&lt;p&gt;Property-based testing was again essential. We initally used &lt;a href=&quot;https://github.com/phadej/jsverify&quot;&gt;jsverify&lt;/a&gt; for testing but it had a tendency to fall over on large tests, like all the other javascript quickcheck ports. We ended up writing a library called bigcheck, which supports the basic quickcheck features but &lt;a href=&quot;https://github.com/graue/gentest/issues/11#issuecomment-55690732&quot;&gt;sacrifices bind for better performance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The constraint solver stores information about each variable in the query in the form of lower and upper bounds on its possible values. The first totally working version of provenance required changing the constraint solver to use inclusive lower bounds and exclusive higher bounds to ensure that the resulting proof volumes all tiled nicely. A few weeks later this caused problems with function constraints because we had no way to indicate that a variable was completely determined. We ended up having to go and switch everything back to inclusive bounds on both sides and store more complicated volumes in the provenance. We eventually got all the logic working and validated the idea, but the naive implementation was far too slow to be useful.&lt;/p&gt;

&lt;h3 id=&quot;september&quot;&gt;September&lt;/h3&gt;

&lt;p&gt;At this point we had spent more than two months on incremental evaluation and we didn’t yet have a practical, performant implementation. We decided to put it aside for now and focus on writing programs in Eve. We exposed a stable interface for the runtime and compiler to allow writing interesting-sized Eve programs without constant code churn. The complex data-structures for tables, indexes and provenance were replaced with simple dummy implementations using arrays and sequential scans to reduce the odds of running into runtime bugs whilst writing Eve programs. Any new language feature we needed was implemented in the simplest way possible with little consideration for performance.&lt;/p&gt;

&lt;p&gt;Surprisingly, the dummy runtime was still reasonably fast and we were able to bootstrap much of the editor and part of the compiler without performance problems. In hindsight, it’s not surprising that simple cache-friendly array scans outperform complex data-structures, given the small size of the demo programs we are working on and the divide-and-conquer nature of the solver.&lt;/p&gt;

&lt;p&gt;We also encountered the &lt;a href=&quot;http://db.cs.berkeley.edu/papers/vldb14-edelweiss.pdf&quot;&gt;Edelweiss&lt;/a&gt; model of time/change around this point and decided to run with it for a while. The main appeal is that it brings us back to the &lt;a href=&quot;http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.93.8928&quot;&gt;Out Of The Tarpit&lt;/a&gt; way of thinking, where the only real state is the input log and everything else is just a view over the inputs. Of course, storing every input forever is impractical. Rather than manually aggregating or forgetting inputs as Mosely suggests, Edelweiss uses static analysis of datalog code to figure out when an input can no longer affect the state and can be safely garbage collected.&lt;/p&gt;

&lt;p&gt;The editor moved from a fill-in-the-blanks textual representation to a more Excel-like representation. Showing the intermediate data and interacting with it directly seems to be easier for most people than dealing with variables. There is no loss of power compared to the previous editor but it is much less dense. It works for editing code but we will have to find some more compact representation for when users are browsing code.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://incidentalcomplexity.com/images/3.png&quot;&gt;&lt;img src=&quot;http://incidentalcomplexity.com/images/3.png&quot; alt=&quot;Spreadsheet&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;today&quot;&gt;Today&lt;/h3&gt;

&lt;p&gt;This brings us more or less to the present. Interface aside, the current language is essentially a classic datalog with stratified negation and aggregates. Table fields can contain any scalar js value and queries can call any pure js function.&lt;/p&gt;

&lt;p&gt;The state of the system is persistent and updates return a new system. Data is stored in individual tables which expose constraint propagators and equality/diff operations. Rules are connected by a pull-based dataflow with dirty tracking.&lt;/p&gt;

&lt;p&gt;Each rule is implemented by a constraint solver which supports table constraints, negation constraints, function constraints and constants. Provenance information is collected but currently ignored - solvers have to recalculate the whole space on each run.&lt;/p&gt;

&lt;p&gt;Aggregates are implemented as separate dataflow nodes. Like the solver, they have enough information to be implemented incrementally but currently they just recalculate on each run.&lt;/p&gt;

&lt;p&gt;The editor and small parts of the compiler are built with a javascript dsl that inserts data into code tables. Systems can recompile themselves on the fly when their code changes. There is space to support data migrations alongside code changes but we haven’t needed it yet.&lt;/p&gt;

&lt;p&gt;The UI library is similar to &lt;a href=&quot;http://facebook.github.io/react/&quot;&gt;React&lt;/a&gt;. Rules define UI elements by inserting data into the UI tables. An external watcher uses the table diffs to update the DOM after every transaction. UI callbacks simply insert data into input tables.&lt;/p&gt;

&lt;p&gt;The editor can show tables and edit rules, has basic debugging support and can compile itself. It is surprisingly fast given the simple implementation - 20-40ms to react and rerender in response to button clicks. However the lack of incremental evaluation and garbage collection causes it to fall over after a few minutes of text entry.&lt;/p&gt;

&lt;p&gt;Keeping the implementation small and simple is essential given the size of our team. So far we have around 3.5kloc of javascript, which breaks down as:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;runtime - 800 loc&lt;/li&gt;
  &lt;li&gt;compiler - 150 loc&lt;/li&gt;
  &lt;li&gt;js dsl - 300 loc&lt;/li&gt;
  &lt;li&gt;ui/io libs - 450 loc&lt;/li&gt;
  &lt;li&gt;ide - 1000 loc&lt;/li&gt;
  &lt;li&gt;bigcheck - 200 loc&lt;/li&gt;
  &lt;li&gt;tests and benchmarks - 500 loc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now that we have a passably fast and stable language to work with, the main focus over the next month or two will be on improving the programming experience.&lt;/p&gt;

</content>
 </entry>
 

</feed>
