Big changes in 0.36.0
It’s been a while since our last blog post. All this time, we were working hard on fixing bugs, creating new objects, and improving EO in general. And here it is - release 0.36.0, which contains many new features. So, this blog post is a summary that highlights the most significant changes.
Rho attribute
The first significant change is related to the special ρ
(rho) attribute. A few words about it:
- In general, the
ρ
attribute refers to the “parent” (or context) of the object. In Java, an analog ofρ
would be thethis
keyword. - Every object has a
ρ
attribute. - At the beginning, when an object is formed (just created for the first time), its
ρ
is void (referring to nothing). ρ
is immutable and may be set only once (the rules of setting will be described in a future blog post).
Vertex attribute
The second significant change is related to the ν
(vertex) attribute. We got rid of it and made our language simpler.
The purpose of the ν
attribute was to uniquely identify an object in the universe. Before the
release 0.36.0, every object had such a
unique numeric identifier, and EO guaranteed that. However, we decided that giving such badges to
objects is not really object-oriented. We don’t want and don’t need to interact with objects relying
on whether they have some unique ID. All we want from the object is its behavior, the functionality
it provides. So, it just does not matter if an object has some identifier or not; the way it behaves
with us is what really matters.
That’s why objects in EO don’t have the ν
attribute anymore.
Caching
We’ve changed the logic of object caching in EO.
some-object > cached!
Until now, this !
meant that if we take attributes from the object more than once, they will be
calculated only the first time and cached. Sounds good, but it didn’t work as we wanted.
Now, !
means that when a cached object is touched for the first time (for example, an attribute
is taken), it’s dataized, converted to bytes
, and starts to behave as the bytes
. All the next
manipulations with the cached object are transferred to the given bytes
.
Objects
We’ve done a lot of work to remove redundant objects, redesign some old ones, and introduce new ones.
- The object
while
was removed frombool
and became a separated object written in pure EO. Its logic is still declarative as it was before. - The object
if
also was removed frombool
and became a separated object. - The object
goto
was implemented in pure EO. - The object
dataized
was introduced. This object dataizes its argument, makes a new instance of thebytes
object, and behaves as it. - The objects
ram
andheap
were removed. - The object
malloc
was introduced. It’s a classic memory management object that can allocate a block in memory, write to it, read from it, and free it. - The object
memory
was redesigned and implemented in pure EO. It uses the objectsdataized
andmalloc
inside. - The object
cage
was redesigned. But it’s still a “bad” object, which does not belong to EO.
Grammar
We’ve made EO more strict by making changes in its grammar rules:
- Empty lines inside an abstract object body are prohibited. Only one line in front of an abstract object is allowed.
# Wrong.
[] > object
5 > five
10 > ten
[] > inner
# Right.
[] > object
5 > five
10 > ten
[] > inner
- A comment in front of a named abstract object is mandatory. A comment in front of an anonymous
(unnamed) abstract object is prohibited. The mandatory comment must start with a capital letter,
end with a dot, have a length >= 64 characters, and include only printable characters (
0x20-0x7f
). Comments in front of other top-level objects are optional.
# This is a good commentary in front of a named abstract object with a length >= 64 characters.
[] > object
# This comment is optional but has the same requirements as in front of an abstract object.
while > @
TRUE
# This commentary is prohibited and will lead to a parsing exception being thrown.
[i] (i > @)
- The
ν
(vertex) attribute is removed from the grammar.
# This code won't be parsed.
TRUE.< > vtx
- Explicit object copying via
'
is removed. Until now, the main purpose of explicit object copying was to create a new object with a newν
(vertex) attribute. But since we got rid of it, there’s no more sense to have such an operation in EO.
# This code won't be parsed.
TRUE' > copy
- Object caching via
!
is no longer a language feature but just syntax sugar for thedataized
object.
some-object > cached!
# The same as
(dataized some-object).as-bytes > cached
That’s it. This is what we were working on for the last 4 months. We’ll try not to make such huge breaks between blog posts in the future. So keep following us!