by tom_mellior · 10y ago · 0 comments
I wonder why people say/think that. The language uses sigils like @ and #. Sigils automatically make a language non-"human readable" since they have no "human meaning". And no, "you just have to learn the meaning of the language constructs and then you can read it" is not "human readable" in a useful sense. From what I gather, in Eve the @ sign refers to databases. That's fine, but "database foo" is human readable in a sense that "@foo" certainly isn't.
Or look at this example from http://play.witheve.com/#/examples/todomvc.eve
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
Why aren't these just all-checked = [#todo completed: true]
none-checked = [#todo completed: false]
? Is the triple negation relevant? What is #todo? Is there some sort of implicit iteration over the database where #todo is bound to successive entries? If so, how are the individual flags combined to really arrive at an "all checked" or "none checked" value?I know plenty of languages that are more "human readable" than this.
It might still be a nice language once you learned it. But this, too, won't be the holy grail of "programming for non-programmers".
all-checked = [#todo completed: true]
would match each of the records with both topic: 'todo' and completed: true. And the following commit block would once per matching record. But what is desired here is one value for all the matching records (an "aggregate" in Eve lingo).Personally I think we would be much better off with a dedicated aggregate function instead of using if/else here. And count (which is an aggregate function), should have a default value for when no records match. Then could get rid of the if/else there also, and have something like:
all-checked = all[#todo completed: true]
none-checked = none[#todo completed: true]
todo-count = count[given: [#todo completed: false], default: 0]
Disclaimer: I'm just an Eve user/contributor all-checked = all[in: [#todo], where: [completed: true] ]
none-checked = none[in: [#todo], where: [completed: true] ]
todo-count = count[in: [#todo], where: [completed: false], default: 0] all_checked = todo.select(&:completed?)
none_checked = todo.reject(&:completed?)
todo_count = todo.count(&:completed?) var allChecked = todos.All(todo -> todo.IsCompleted);
var noneChecked = todos.None(todo -> todo.IsCompleted);
var todoCount = todos.Count(todo -> todo.IsCompleted);Try Avail[1]:
allChecked = select element from todos list where [element is completed]
allNotChecked = select element from todos list where [element is not completed]
todoCount = count of element in todos list where [element is completed]
I'm cheating a tiny little bit: `todos list` would probably need to be defined above as a method (I don't remember if one can have variable names with a space inside the name in Avail) and `_is completed`/`_is not completed` would also need to be defined.Rebol or Red could be also interesting in this regard, also Forth and Factor. Still, Avail goes the farthest in terms of allowing you to write a truly human-readable code (EDIT: however, they support all of Unicode for names and such, so you can go nuts with sigils too, if you want).
(Possibly also Inform 7[2], but I don't know it, so can't really say much.)
As the person that initially mentioned sigils, I did not say that they are always evil. I just said that you cannot use them and at the same time claim that you have a human-centered fully intuitive programming language.
I'm very fine with using -> symbols for anonymous functions... In fact, I'm fine with other sigils as well, if they are explained properly.
> allChecked = select element from todos list where [element is completed]
To me, knowing nothing about this language, this reads like collecting the subset of the completed elements out of all the elements. But the original task was to compute whether all elements are completed, i.e., whether this subset is equal to the whole. So you're doing something else, or your language is misleading me.
Imo, literate programming should be solved by more expressive languages, not prose commentary layered on top.
Edit: found the source: [0] https://news.ycombinator.com/item?id=12819973