noob. reading the docs, questions.

87 views
Skip to first unread message

asy...@gmail.com

unread,
May 1, 2017, 3:58:32 PM5/1/17
to Eve talk
Eve questions.

I find the Eve documentation too terse. It doesn't spell things out in enough detail. I have the following questions:

1.
Nowhere in the docs do I find what the at-sign @ means. Mostly it is used for database names, but in some places not:

[@"my party" date]
friend = [#friend busy-dates != date]
guest = if friend then friend
        if friend.spouse then friend.spouse

burgers = if guest = [@Arthur] then 3
          else if guest = [#hungry] then 2
          else if guest = [#vegetarian] then 0
          else 1

Is it a sigil for a global variable? 

2.
tags.

// These are equivalent
[#person]
[tag: "person"]

but what is this equivalent to?:
[#student #honor-roll]

attribute names are unique within a record, correct? so it can't be this:
[tag: "student", tag: "honor-roll"]

Question also comes up in the docs for +=:

search
  student = [#student gpa > 3.75]
  
bind
  student += #honor-student

student already has attribute "tag", so what is += doing? concatenating strings?
So, [#student #honor-student] is [tag:"personhonor-student"] ? 
That doesn't seem to make sense.

3. if-then

result = if record then value

What if the condition is false and there is no else? result has no value, or is nil (is there a nil value)? The block does nothing? There is an error?

3. It seems like all data flows through databases with global variable names? How do you structure a larger program? Can the database target for a search/bind/commit be the result of an expression?

4. What does merge <- do when there is the same attribute name on both sides? Overwrite with the value on the left with the value on the right? error?

Josh Cole

unread,
May 1, 2017, 5:13:02 PM5/1/17
to Eve talk
Hey Asynth.

All good questions, let's tackle them in order.

> 1. Nowhere in the docs do I find what the at-sign @ means....

In prerelease versions of Eve, the `@` was the "name" syntax, just like `#` is the "tag" syntax. `search @foo` meant to search in the database named foo, and `[@Arthur]` meant to match on a record with the name Arthur. We decided that explicit is better than implicit, so removed the ability to use @ in records. Now it really is only used for DB names. Any examples you come across that still use @ in other ways are outdated and need to be fixed.

> 2. tags.

Actually, your intuition is completely correct. `[tag: "student", tag: "honor-roll"]` works fine and is identical to `[#student #honor-roll]`. It will match a single record that has both values for its tag attribute. There's no requirement that attribute names be unique (and in fact, much of the language wouldn't work if you could only have a single value per attribute!). In general, Eve doesn't care whether you have 1, 2, or many matches. It will handle the block the just the same for each discrete match. In this case, since the thing you're looking for is a record with two tags, it'll give you each record with both those tags. You could instead query for:

```
person = [#person]
tag = person.tag
```

which would give you every tag on a person.

In that light, hopefully += makes more sense. It simply adds another value to the set of tags on the record.

> 3. if-then: What if the condition is false and there is no else? 

That just means the block doesn't match. Just like it isn't an error for the query:

```
search
  [#person name: "Fred" age: 47]
```

to fail, it's not an error for an if to fail -- it just means that it won't do anything into the pattern does match. It is pretty silly to use an if without another if or an else though -- it's the exact same as having no if at all!

> 3. It seems like all data flows through databases with global variable names? 

I'm not quite sure what you mean. If you're referring to all the facts in a database always being in scope, then yes! We do this intentionally. We've found that scope tends to hurt more than help. In Eve, you can limit the facts a block consumes simply by providing a more specific pattern. If something meets all the requirements of your pattern, that means it's meant to be consumed by the block. If it doesn't; no harm, no foul -- it just won't trigger the block.

If you're asking whether or not you can create and use dynamic databases, the answer is not really. There was internal support but it wasn't exposed in the syntax. We've also decided to do away with the notion of databases as a namespacing mechanism completely in 0.3. Instead, we're just using explicitly namespaced tags, so everything behaves consistently throughout the system.

> 4. What does merge  <- do when there is the same attribute name on both sides?

Yep! The right side overwrites the left. We're considering dropping or amending the merge operator in 0.3 as well, since it has caused some confusion.

co...@kodowa.com

unread,
May 1, 2017, 5:27:32 PM5/1/17
to Eve talk
Async,

I'm just curios where you picked up on the @ sigil in records. Was it in the docs or somewhere on the blog?

I'll also be incorporating your feedback into the revised docs for version v0.3.

Thanks,

Corey


On Monday, May 1, 2017 at 12:58:32 PM UTC-7, asy...@gmail.com wrote:

James McCartney

unread,
May 1, 2017, 6:22:16 PM5/1/17
to co...@kodowa.com, Eve talk
Thank you for the answers. The other uses of @ that I found were on the if-then doc page:  http://docs.witheve.com/handbook/if-then/


--
You received this message because you are subscribed to a topic in the Google Groups "Eve talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eve-talk/VeYrrow_Mds/unsubscribe.
To unsubscribe from this group and all its topics, 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/db64e28d-f45f-4f6b-a42b-10092d6a262b%40googlegroups.com.

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



--
--- james mccartney

co...@kodowa.com

unread,
May 1, 2017, 6:26:11 PM5/1/17
to Eve talk, co...@kodowa.com
Thanks James, I'll remove that from the docs.
To unsubscribe from this group and all its topics, send an email to eve-talk+u...@googlegroups.com.

To post to this group, send email to eve-...@googlegroups.com.



--
--- james mccartney

James McCartney

unread,
May 1, 2017, 7:33:32 PM5/1/17
to co...@kodowa.com, Eve talk
whoops, didn't reply-all.

On Mon, May 1, 2017 at 2:13 PM, Josh Cole <joshu...@gmail.com> wrote:
Hey Asynth.

> 2. tags.

Actually, your intuition is completely correct. `[tag: "student", tag: "honor-roll"]` works fine and is identical to `[#student #honor-roll]`. It will match a single record that has both values for its tag attribute. There's no requirement that attribute names be unique (and in fact, much of the language wouldn't work if you could only have a single value per attribute!). 
In general, Eve doesn't care whether you have 1, 2, or many matches. It will handle the block the just the same for each discrete match. In this case, since the thing you're looking for is a record with two tags, it'll give you each record with both those tags. You could instead query for:

```
person = [#person]
tag = person.tag
```

which would give you every tag on a person.

In that light, hopefully += makes more sense. It simply adds another value to the set of tags on the record.



OK I think I get it. So if you do this [#student #student #honor-roll] , is that legal? Or it is legal and the second #student get squashed since it is already present in the set. 

If you have [#a #b] and you match with [tag: z] what is the value of z? two matches with each "a" and "b"? only "a"?, indeterminate?  If I understand correctly, you are saying the first one: two matches.
 
 

> 3. if-then: What if the condition is false and there is no else? 

That just means the block doesn't match. Just like it isn't an error for the query:

OK, that makes the most sense. 
 

Was Eve influenced by either Linda / tuple spaces, or the programming language Icon?

To unsubscribe from this group and all its topics, send an email to eve-talk+unsubscribe@googlegroups.com.

To post to this group, send email to eve-...@googlegroups.com.

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



--
--- james mccartney

Josh Cole

unread,
May 1, 2017, 7:38:06 PM5/1/17
to James McCartney, co...@kodowa.com, Eve talk


So if you do this [#student #student #honor-roll] , is that legal? Or it is legal and the second #student get squashed since it is already present in the set. 

The latter. it's totally fine to do and does nothing beyond what `[#student #honor-roll]` does.

> If you have [#a #b] and you match with [tag: z] what is the value of z?

You understood correctly, there'll be two matches that flow through the block.

> Was Eve influenced by either Linda / tuple spaces, or the programming language Icon?

Yes, we discussed Linda during Eve's formative phase along with several other interesting languages. I haven't heard of Icon, I'll have to check it out. :)




--
--- james mccartney

--
You received this message because you are subscribed to a topic in the Google Groups "Eve talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/eve-talk/VeYrrow_Mds/unsubscribe.
To unsubscribe from this group and all its topics, send an email to eve-talk+u...@googlegroups.com.
To post to this group, send email to eve-...@googlegroups.com.

co...@kodowa.com

unread,
May 1, 2017, 7:39:26 PM5/1/17
to Eve talk, co...@kodowa.com
James,

> OK I think I get it. So if you do this [#student #student #honor-roll] , is that legal? Or it is legal and the second #student get squashed since it is already present in the set. 

The latter.

> If I understand correctly, you are saying the first one: two matches

Correct!

> Was Eve influenced by either Linda / tuple spaces, or the programming language Icon?

We've taken influence from a lot of different language, and Linda is something we've looked at in the past. I personally haven't heard of Icon, but maybe Chris has.

Corey



--
--- james mccartney

Jeff Bone

unread,
May 1, 2017, 8:08:52 PM5/1/17
to co...@kodowa.com, Eve talk


On May 1, 2017, at 18:39, co...@kodowa.com wrote:

James,

> OK I think I get it. So if you do this [#student #student #honor-roll] , is that legal? Or it is legal and the second #student get squashed since it is already present in the set. 

The latter.

> If I understand correctly, you are saying the first one: two matches

Correct!

> Was Eve influenced by either Linda / tuple spaces, or the programming language Icon?

We've taken influence from a lot of different language, and Linda is something we've looked at in the past. I personally haven't heard of Icon, but maybe Chris has.

Corey

Icon was a language developed by Ralph Griswold (highly under appreciated computer scientist!) as a successor to his earlier SNOBOL language.  Icon came out of U. of Arizona, SNOBOL from his time at Bell Labs.

Icon is notable for its unique evaluation model.  Expressions have a success or failure based on a kind of unification.  This leads to a concept they call generators (not quite what we expect today) wherein an expression can choose to neither succeed for fail immediately but rather evaluate to successive values before finally succeeding or failing.  These semantics lead to the following archetypal one-liner from Icon:

  while write(read())

This is effectively equivalent to Unix' cat(1).

The similarity with Eve becomes apparent when considering its style unification.

Ralph and students also wrote the first configurable zero-copy network protocol stack / toolkit, called x-kernel (no relationship to XWindows.)  The book about that effort remains one of the finest resources for protocol engineering.

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+u...@googlegroups.com.

To post to this group, send email to eve-...@googlegroups.com.

asy...@gmail.com

unread,
May 1, 2017, 8:28:06 PM5/1/17
to Eve talk, co...@kodowa.com


 
Was Eve influenced by either Linda / tuple spaces, or the programming language Icon?


Eve also reminds me of Piccola:  http://scg.unibe.ch/research/piccola

 

--
--- james mccartney

Ionuț G. Stan

unread,
May 2, 2017, 7:35:40 AM5/2/17
to Jeff Bone, co...@kodowa.com, Eve talk
On 02/05/2017 03:08, Jeff Bone wrote:
>
>
> On May 1, 2017, at 18:39, co...@kodowa.com <mailto:co...@kodowa.com> wrote:
>
>> James,
>>
>> > OK I think I get it. So if you do this [#student #student
>> #honor-roll] , is that legal? Or it is legal and the second #student
>> get squashed since it is already present in the set.
>>
>> The latter.
>>
>> > If I understand correctly, you are saying the first one: two matches
>>
>> Correct!
>>
>> > Was Eve influenced by either Linda / tuple spaces, or the
>> programming language Icon?
>>
>> We've taken influence from a lot of different language, and Linda is
>> something we've looked at in the past. I personally haven't heard of
>> Icon, but maybe Chris has.
>> *
>> *
>> Corey
>
> Icon was a language developed by Ralph Griswold (highly under
> appreciated computer scientist!) as a successor to his earlier SNOBOL
> language. Icon came out of U. of Arizona, SNOBOL from his time at Bell
> Labs.
>
> Icon is notable for its unique evaluation model. Expressions have a
> success or failure based on a kind of unification. This leads to a
> concept they call generators (not quite what we expect today) wherein an
> expression can choose to neither succeed for fail immediately but rather
> evaluate to successive values before finally succeeding or failing.
> These semantics lead to the following archetypal one-liner from Icon:
>
> while write(read())
>
> This is effectively equivalent to Unix' cat(1).
>
> The similarity with Eve becomes apparent when considering its style
> unification.
>
> Ralph and students also wrote the first configurable zero-copy network
> protocol stack / toolkit, called x-kernel (no relationship to XWindows.)
> The book about that effort remains one of the finest resources for
> protocol engineering.

What's the name of the book? I couldn't find it.

--
Ionuț G. Stan | http://igstan.ro | http://bucharestfp.ro

Reply all
Reply to author
Forward
0 new messages