Release: Eve v0.3 Preview 3

394 views
Skip to first unread message

co...@kodowa.com

unread,
May 30, 2017, 5:26:44 PM5/30/17
to Eve talk

Hello everyone,

We’ve got a new preview of Eve v0.3 for you today, with two big enhancements. To download and run preview 3 yourself, follow the instructions on the Eve starter repository.

Let’s dive in and look at what’s new!

The Eve Syntax Returns

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:


import {Program} from "witheve";

let program
= new Program("program name");

program
.parseDoc(`some eve code`)

 

Where `some eve code` is a complete multiline Eve document (i.e. the contents of a *.eve file). A second method is to download eve-starter, 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.

We also updated the example Eve applications 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.

 Documentation Refresh

As part of this release, we’re also making available our [documentation refresh](http://docs.witheve.com/v0.3/). 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:

  •  A new quickstart – 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.
  •  A new syntax reference – 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.
  •  A library reference – 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.

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.

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 docs.witheve.com, you’ll currently see an option to select v0.2 or v0.3






co...@kodowa.com

unread,
May 30, 2017, 5:33:32 PM5/30/17
to Eve talk
Sorry, a little correction: the function to parse a program is

program.load(“some eve markdown”)

Corey

Felix George

unread,
May 30, 2017, 8:58:37 PM5/30/17
to Eve talk

Pumped for the return of the syntax!  Can you mix and match the syntax with the DSL?  Once the editor arrives, will that still be the case (mix and matching)?

Ravil Bayramgalin

unread,
May 31, 2017, 7:18:07 AM5/31/17
to Felix George, Eve talk
Thank you for updates!

I'd like to use v0.3, but I miss an error detection from the previous release (e.g. showing an error if there are unprovided variables).
I could work on PR to add it, but I'm guessing you already work in this direction?

--
You received this message because you are subscribed to the Google Groups "Eve talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eve-talk+unsubscribe@googlegroups.com.
To post to this group, send email to eve-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/eve-talk/3c2590a9-b505-4808-82e6-cc8ca48872ff%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Zubair Quraishi

unread,
May 31, 2017, 7:25:28 AM5/31/17
to Eve talk
I loved the new 5 minute intro, much easier to follow :) Is the hosted Eve at play.witheve going to be the same version as the download?

co...@kodowa.com

unread,
May 31, 2017, 3:35:00 PM5/31/17
to Eve talk

Felix,

Yes, you can mix and match syntax. The blocks from the Eve syntax and the JavaScript Syntax compile into the same program. This is a nice example of how Eve blocks from two different interfaces compose without any additional work on your part.

That said, we’re not sure the JavaScript Syntax will make it to the full release. It was a nice experiment, but the Eve syntax is a better experience overall. We did an experiment, and wrote the same program in both the Eve syntax and the JavaScript Syntax.


Here I’ve mapped a histogram of characters used in each program. You’ll see not only are there more characters typed in the JavaScript Syntax, but there’s a much wider variety of characters. 

In addition to just generally being harder to read and write, there are usability issues as well. For example, having to constantly import commonly used functions. Other slight differences between true JavaScript and our JavaScript syntax were more confusing than helpful. Code written in the JavaScript Syntax does not follow the principals of Eve.

Instead, we are thinking about allowing you to just write Eve code in strings like so:

program.block(`
search 
  [#hello] 
bind 
  [#world]`);
Enter code here...

The watcher and function API could remain the same, so we would still maintain interoperability with JavaScript. What do you think of this idea? Did you like the idea of using the Eve Syntax and DSL side by side?

 

Ravil,

Right now we are focusing on the getting started experience for v0.3. Once that’s squared away, Josh’s next task is to start working with error messages. If you’d like, you guys could coordinate something, just to make sure work isn’t duplicated.

 

Zubair,

Eventually this quick start will be able to run in the editor, so we can provide a similar experience to play.witheve.com.


Best,

Corey



On Tuesday, May 30, 2017 at 2:26:44 PM UTC-7, co...@kodowa.com wrote:

Felix George

unread,
May 31, 2017, 7:43:56 PM5/31/17
to Eve talk
Corey, at the end of the day, you nailed it that the DSL was, perhaps, out of place from a perspective of principles. But, I noticed that by fussing with JavaScript, I could do some things that Eve hasn't fleshed out in this early state of the language (i.e. working with mature mobile front-ends like ONSEN UI or WinJS).  With that said,  there are some "must-haves" from the DSL I personally would like to stay around, and you already mentioned a couple like functions and watchers.

1- The ability to watch for some records and push javascript code through whenever there is a trigger:

program.watch("watch for tasks", ({find, lookup, record}) => {
..........
let {name} = diff.adds[id];
   // testing1.innerHTML = `<p>root23</p>`
    mystuff.push({ tasktitle: name, text: "Gelato", picture: "/images/fruits/60Mint.png" });
2. Throwing eve elements on-screen in a super flexible way.  Having a front-end library host the page but having Eve manipulate one or more divs proved to be extremely useful.

htmlWatcher.addExternalRoot("my-root", someElement);
3.Appending and inputting EAV's.  This is probably the biggest one. I eventually got the hang of this and it was very useful.  Injecting records into Eve from the JavaScript side lead to some awesome use cases.  Inputting EAV's in this way allowed me to use EVE as a sort of in-memory database for web apps and was vastly superior to any SQL solution I could find.

appendAsEAVs(inputs2, newtask2);
program.inputEAVs(inputs2);


The program.bloc idea seems superior to what we have access to now on the javascript side since we learn and use only one syntax and it stays uniform no matter where we are trying to use it.

One last thought is that the idea of having a JavaScript side and Eve side working together became one of the more powerful ideas once I invested some time to brush up on Javascript.  I fought it initially but ultimately gave in and I'm glad that I did.  In any case, as long as there is interoperability so we can use any front end we'd like and there is an easy way to transfer data back and forth between Eve and JavaScript, it will be beneficial.  I personally would like to have maybe 95% of my Eve blocks written in a proper Eve editor while a small portion would be in my JavaScript files.  Nonetheless, I would want all the Eve blocks playing together nicely and working side by side with the JavaScript, running concurrently and gracefully, without any extra effort.

On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

co...@kodowa.com

unread,
Jun 1, 2017, 2:45:25 PM6/1/17
to Eve talk
Felix,

Everything you mention here we will be keeping for sure. What we're thinking of removing is the JavaScript Eve syntax. e.g.

program.bind("Demo row.", ({record}) => {
  let jeff = find("person", {name: "Jeff"});
 
return [
    record
("ui/text", {text: "Hi Jeff"})
 
];
});


Would be written

program.block(`
search
  jeff = [#person name: "Jeff"]
bind
  [#ui/text text: "Hi
Jeff"]
`
);


But you would still have access to the watcher and function APIs (although they could potentially change before release).

Corey

Zubair Quraishi

unread,
Jun 1, 2017, 4:52:22 PM6/1/17
to Eve talk
Yes , I like the idea of removing the JavaScript eve syntax and replacing it with the eve block directly :)

Felix George

unread,
Jun 2, 2017, 9:22:42 PM6/2/17
to Eve talk
"But you would still have access to the watcher and function APIs (although they could potentially change before release)."

Then, I'm all for it Corey.  Eve is shaping up to be quite the power house.  I appreciate all the work you guys are doing. 


On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

Felix George

unread,
Jun 9, 2017, 12:56:54 AM6/9/17
to Eve talk
Just to be clear, can we use "program.load("eve code") and the DSL features in the same file?  I haven't been able to get that to work.


On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

Brian Theado

unread,
Jun 9, 2017, 7:38:48 AM6/9/17
to Felix George, Eve talk
Felix,

On Fri, Jun 9, 2017 at 12:56 AM, Felix George <fgeo...@gmail.com> wrote:
> Just to be clear, can we use "program.load("eve code") and the DSL features
> in the same file? I haven't been able to get that to work.

I tested it out by adding the following block to
https://github.com/btheado/tweve/blob/master/src/plugins/btheado/tweve/eve-widget.js

this.prog.bind("Demo DSL", ({record}) => {
return [
record("ui/div", {text: "hello"})
];
});

I tried twice. One with the block before the this.prog.load call and
once after. It worked both ways.

Brian

Felix George

unread,
Jun 17, 2017, 2:52:54 PM6/17/17
to Eve talk
Adding program.load to my code causes all the Eve elements to fail:
import "witheve-watchers/html"
import { Program } from "witheve";
import { appendAsEAVs } from "witheve";
import "witheve-watchers/compiler"
import "witheve-watchers/ui"


let program = new Program("my program");
let htmlWatcher = program.attach("html");
let someElement = document.querySelector("#eve-wrapper");


program.load(
    '~~~search my_click = [#html/event/click] addtask = [#addtaskbutton] commit [#task name: addtask.value]~~~ ');
program.commit("add digs", ({ find, record }) => {

    return [
        record("dig", { name: evevar })
    ];
})

program.watch("watch for tasks", ({ find, lookup, record }) => {
        // search for records tagged task
        let student = find("task");
        // lookup attributes and values related to each task
        let { name } = student;
        return [
            // Add these attributes and values to the task, creating a diff to which we can react
            record({ name })
        ];
    })
    // React to each addition or removal
    .asObjects((diff) => {
        for (let id in diff.adds) {
            let { name } = diff.adds[id];
        
            stuff.push({ title: name, text: "Gelato"});

            // listView.ensureVisible(list.length - 1);

        }
        for (let [e, a, v] of diff.removes) {
            // ... do something ...
        }
    });



program.commit("render into #eve-wrapper", ({ find, record }) => {
    let my_root = find("my-root");
    return [
        my_root.add("children", [
            record("html/element", "addtaskbutton", { tagname: "input", value: "new task" }),
            record("html/element", { tagname: "button", text: "click me", class: "button" })
         
        ])
    ];
})
htmlWatcher.addExternalRoot("my-root", someElement);


On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

Felix George

unread,
Jun 17, 2017, 6:06:12 PM6/17/17
to Eve talk
Nevermind.  Got the fix via Slack Channel...


On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

Felix George

unread,
Jun 18, 2017, 12:52:31 AM6/18/17
to Eve talk
Just for clarity...the problem was caused by using single quotes ' instead of backtick `in the event that anyone new to JS runs into that problem also. 😅


On Tuesday, May 30, 2017 at 4:26:44 PM UTC-5, co...@kodowa.com wrote:

co...@kodowa.com

unread,
Jun 19, 2017, 1:38:08 PM6/19/17
to Eve talk
For others following along, a secondary issue was that whitespace matters in markdown, so a line return is needed after a code fence.
Reply all
Reply to author
Forward
0 new messages