> But that's not really accomplished by any OO language that I know of.
I'd recommend starting with learning more about existing programming languages before coming with a new one. For example IO does something similar (http://iolanguage.org/guide/guide.html).
You are not the first one to come up with a similar idea, to convince me you'd need to show that a) the idea has some practical benefits b) the language is the best way to implement it (you could do it as a library) and c) your implementation is better than others.
> objects are values
So if I will have an object holding references to other objects and I will send it, what will happen? How does that work with concurrency and parallelism?
> control can be yielded from one process to another
Explicitly (as coroutines do) or by runtime?
In Io, calling a method actually passes the message object as the argument, which is then evaluated as necessary by the receiver. In that way, you get messages as first class citizens and a way to apply special evaluation rules to method arguments without macros, for example to create for
loops as a function call rather than as a special case in syntax.
Neat!
It seems similar in spirit to Maude and Io.
Side note: The head
and tail
functions are counterintuitive to me. From their names, I'd expect the behavior shown below but what they really seem to do is access the operator and operands respectively.
> head(list(1, 2)) 1 > tail(list(1, 2)) list(2)
Went with a more obscure language today - here's my solution for part 2 in io:
file := File with("12-input.txt") lines := file readLines file close
dict := Map clone lines foreach(i, v, nums := v split(" <-> ") dict atPut(nums first, nums last split(", ")) )
start := "0" set := Map clone check := method(x, dict at(x) foreach(i, v, set hasKey(v) ifFalse( set atPut(v) check(v) ) ) )
groups := 0 dict keys foreach(i, v, set hasKey(v) ifFalse( groups = groups + 1 set atPut(v) check(v) ) )
groups println
Oh, huh, at first glance I thought this would be a browser implementation of the Io programming language. That would have been kind of neat. But perhaps Io's dead enough at this point that I shouldn't have made that assumption ...