Hi,
great work! I am looking forward very much to tryout version v0.20 :-)
Is it possible to provide a specific commit indicating the latest (most current) version of v0.10? Your tag https://github.com/fsantanna/ceu/commit/9ce60f87f847ddda0f7f641e18e6825781811c87 appears to be considerably outdated.
- removing organisms in favor of "code/await".
So good to see Céu is still alive and being developed! :)
I'm doing webdev these days (because work and necessity of being able to buy food) and I don't dabble in other languages as much on the side as I used to, but I'm still following the development of Céu
On Friday, 7 October 2016 04:10:00 UTC+2, Francisco Sant'Anna wrote:- removing organisms in favor of "code/await".So I've read the Birds examples and it looks pretty clean (btw, in examples seven to twelve you're defining PI twice - remove the top two lines to make it consistent with the examples before it).
I guess the key insight is:- one could combine the first-class concurrency of Céu with functions to easily write a functions that pause and resume reactively on their own- functions can have local variables, hence local state,- together this pretty much supersedes the need for objects, since you can just spawn reactive functionsDid I grok that correctly?
And does this mean that code/tight is basically for defining non-concurrent function?
(also this really shows how confusing labels like "functional programming" and "imperative programming" are, because this looks like a happy fusion of the two)
I'm liking the newly introduced notations a lot as well. At least I don't remember this one:
> loop i in [0->5[ doMy guess is "from 0 up to 5 (not including)", is that correct? If so, cool way of describing inclusive/exclusive ends! Never thought of using reversed brackets to represent open/closed ranges of math notation. The code/await syntax looks Maths-notation inspired (in a good way) as well.
Speaking of notation, is there a way around this amount of extra bookkeeping?var&? SDL_Rect rct1;event&? void col1;loop (rct1,col1) in birds do..endWouldn't the types of rct1 and col1 already be known to the compiler, because it's a pool of Birds?
Similarly, there's this:code/await Bird (var int y, var int speed)=> (var&? SDL_Rect rct, event&? void go_collided)=> voiddovar SDL_Rect rct_ = val SDL_Rect(20,y, 50,45);rct = &rct_;Which feels like the kind of type accounting that the computer should be able to automate away for you, maybe like so:code/await Bird (var int y, var int speed)=> (var&? SDL_Rect rct, event&? void go_collided)=> voiddorct = &val SDL_Rect(20,y, 50,45);This is of course ignoring that things like type inference being a lot of work to implement, and I totally understand that you have to prioritise.
How is overall performance (both size and speed wise) compared to v0.10?
Will there be Arduino builds soon?
Anyway, really excited about the release, I wish I could make time to just fool around with the language more :)
Thank you. Unfortunately, Github only marks contributions to the "master" branch.The development has been continuous since the beginning. I now have a stable situation in an University (unless the State breaks, which is not completely unlikely). :)
- Receiving back immediately an alias reference. This is tricky. I want a value that is created by the "code/await" and I need to interact with it safely, i.e., only while it exists.I have to write about this second one, it is the biggest change in the language.
I'll only give an example here from "ceu-libuv":
var& _uv_tcp_t tcp;
event& void ok_connected;
watching UV_TCP_Connect("127.0.0.1",80) => (tcp, ok_connected) do
await ok_connected;... // use "tcp" safely while connectedend
This is the example "tcp-06" and I consider it very readable:
https://github.com/fsantanna/ceu-libuv/blob/master/samples/tcp-06.ceuWe spawn a connection to localhost:80 ("UV_TCP_Connect" is a "code/await"): all connection process, disconnection, etc. is handled there.
I receive back a "tcp" handler and a local event from there immediately. They are "intermediate" return values and are alive while the call is alive.This handler must be created immediately in the outermost scope of "UV_TCP_Connect" and this is statically checked.Inside the "watching", I can safely use "tcp" and "ok_connected" although they are in the scope of the call.
If the connection is lost/etc, the code returns, the "watching" terminates, and "tcp" is unbound outside (this is also checked statically).
I'm using "code/tight" and "code/await" to avoid confusion with "function". I also like "routine" or "procedure"
Let's see if it works. People in my Lab had mixed feelings. ;)
One question. You never saw "]a,b[" to describe open ranges in programming languages or at all?Here, I think this notation is more common than "(a,b)" and Wikipedia also seems to prefer it:
https://en.wikipedia.org/wiki/Interval_(mathematics)
var&? SDL_Rect rct1;event&? void col1;loop (rct1,col1) in birds do..end
Inside the "loop", we have an "emit" which might awake something that kills the current bird being traversed.
The idea is to have safe loops that still allow using "emit", "spawn", and other yielding statements.This was disallowed in previous versions.
Yes, this could be automated. No problem with type inference though. It is only that the SDL_Rect needs real storage in "rct_" and "rct" is only an alias to something concrete (which could be anonymous).
How is overall performance (both size and speed wise) compared to v0.10?Much worse in size.Probably worse in speed.Now, I favored simplicity in the implementation.
I used to favor memory because of the proposed scientific contributions, i.e., my thesis was an alternative to C in sensor networks. The quantitative evaluation was very important.That said, this is mostly due to not checking what features the program uses and always compiling the complete runtime (i.e., no #ifdefs for the generated code).
I plan to start porting the examples soon to see the real damage of the new implementation in constrained platforms.
On Friday, 7 October 2016 15:13:35 UTC+2, Francisco Sant'Anna wrote:var& _uv_tcp_t tcp;
We spawn a connection to localhost:80 ("UV_TCP_Connect" is a "code/await"): all connection process, disconnection, etc. is handled there.I receive back a "tcp" handler and a local event from there immediately. They are "intermediate" return values and are alive while the call is alive.This handler must be created immediately in the outermost scope of "UV_TCP_Connect" and this is statically checked.Inside the "watching", I can safely use "tcp" and "ok_connected" although they are in the scope of the call.
If the connection is lost/etc, the code returns, the "watching" terminates, and "tcp" is unbound outside (this is also checked statically).Ah, I guess that explains the two arrows in code/await UV_TCP_Connect (var _char&& ip, var int port) => (var& _uv_tcp_t tcp, event& void ok) => int, which had confused me before?
One question. You never saw "]a,b[" to describe open ranges in programming languages or at all?Here, I think this notation is more common than "(a,b)" and Wikipedia also seems to prefer it:
https://en.wikipedia.org/wiki/Interval_(mathematics)Nope! Never seen it before! But this stackexchange answer leads me to think it's not that common in English-speaking countries (and the Netherlands is next to England, so follows most of its mathematical conventions) http://hsm.stackexchange.com/questions/142/why-is-american-and-french-notation-different-for-open-intervals-x-y-vs-x/193#193
var&? SDL_Rect rct1;event&? void col1;loop (rct1,col1) in birds do..endInside the "loop", we have an "emit" which might awake something that kills the current bird being traversed.The idea is to have safe loops that still allow using "emit", "spawn", and other yielding statements.This was disallowed in previous versions.I'm probably a bit slow, but I don't quite follow why that requires declaring rct1 and col1 outside of the scope of the loop?
How is overall performance (both size and speed wise) compared to v0.10?Much worse in size.Probably worse in speed.Now, I favored simplicity in the implementation.
So not "inescapably worse by design", just due to convenience for implementation/maintenance? I think that's a good approach, makes it easier to change things and develop the language; premature optimisation and all that.
How is overall performance (both size and speed wise) compared to v0.10? Will there be Arduino builds soon?