Date   

Re: Choosing the right number of compute-intense actors

Florian Weimer
 

* Sean T. Allen:

You can get the number of scheduler threads via an FFI call and use that in
terms of starting up a set number of actors.

`ponyint_sched_cores` will return the number of cores available.
Thanks. Would it make sense to expose this in a more direct way?


Re: Why I can't write to an iso object's ref field?

Paul Liétar
 

Hi,
The closest thing to a "compile rule" I can point you to is the "Deny Capabilities for Safe, Fast Actors" paper (https://www.doc.ic.ac.uk/~scd/fast-cheap-AGERE.pdf), which formalises the capability system of Pony.

In particular, Table 3 defines a "safe-to-write" relation, which determines when you can write a value to a field.
As you can see, for k=iso and k'=ref this is not allowed.

Not that k' refers to the capability of the right hand side of the assignment, not the capability of the field.
So the rule isn't "ref field in iso can't be assigned", but more "Only iso objects can be assigned to a ref field in an iso".

This explains why Theo's earlier example works because because the right hand side, s.clone(), is an iso.

(As a disclaimer, the paper describes a simplified version of Pony, so in some other cases the rules implemented by the compiler might not exactly match (the compiler tends to be more permissive)).

Hope this makes sense,
Paul


Re: Why I can't write to an iso object's ref field?

 

I'm not sure what you mean by "compile rule", but if your looking for a more concrete definition for capability requirements I would suggest looking at "Viewpoint Adaptation" (https://tutorial.ponylang.io/capabilities/combining-capabilities.html).

A ref field in an iso object can be reassigned. The requirement is that the object being placed into the ref field of an iso object must be isolated. In viewpoint adaptation terms: iso->ref = iso.

Alternatively, if the field has the type String val, then then it could be updated with another String val, or iso->val = val.

I hope this helps. Let me know if this isn't what you're looking for.


Re: Why I can't write to an iso object's ref field?

nous.xiong@...
 

Hi, Theo, thx for your reply!

I totally understand what you showed in example, but I want to know which rule(or say, "complie rule") in ponyc used, maybe it's "ref field in iso can't be assigned" something like that. 

Anyway thanks again!


Re: Why I can't write to an iso object's ref field?

 
Edited

Hello,

This is unsafe because you are trying to assign an alias to a ref object to the field of an iso type. So, theoretically this could result in the iso object being sent to another actor while the local ref alias `s` still exists and could be mutated by the current actor. Your example would work if `s` was iso and placed into `e` with a consume expression, or if `FooIso.create` took a String iso argument.

Here's a working example:
https://playground.ponylang.io/?gist=3fad48120e1e1f2263970c96c4c36de2


Why I can't write to an iso object's ref field?

nous.xiong@...
 
Edited

The code: 

class FooIso
  var s: String ref
  new iso create(s': String) =>
    s = s'.clone()
...
let e = FooIso("hi")
let s = recover ref String end
e.s = s

The complie errors: 
 
not safe to write right side to left side
    e.s = s
        ^

I know this will break "iso" guarantee, but which rule on ponylang exactly deny this?

P.S. I'm new on ponylang, maybe this is dumb


Re: rmsbolt support added, see the assembly on the fly

 

That's awesome.


On Tue, Oct 2, 2018, 05:28 Reini Urban <reini.urban@...> wrote:

We have added pony support to the emacs rmsbolt mode. It's not yet on melpa (soon), see the pony branch here and the screencast.

https://gitlab.com/jgkamat/rmsbolt/tree/pony#Pony

It lets you inspect the generated assembly on the fly. It's mostly useful for the pony devs.


rmsbolt support added, see the assembly on the fly

Reini Urban
 

We have added pony support to the emacs rmsbolt mode. It's not yet on melpa (soon), see the pony branch here and the screencast.

https://gitlab.com/jgkamat/rmsbolt/tree/pony#Pony

It lets you inspect the generated assembly on the fly. It's mostly useful for the pony devs.


Re: Choosing the right number of compute-intense actors

 

You can get the number of scheduler threads via an FFI call and use that in terms of starting up a set number of actors.

`ponyint_sched_cores` will return the number of cores available.


On Mon, Oct 1, 2018 at 9:41 AM Florian Weimer <fw@...> wrote:
* Sean T. Allen:

> No. There is nothing in the standard library to achieve this.
> What's the use case you are imaging?

I'm writing something that processes input files and it is
compute-bound, not I/O-bound.  Creating more actors than which can
possibly execute in parallel is wasteful.  I need to bound their
number anyway because each actor needs an open file, and their number
is finite (as low as 1024 on many systems).


Re: Choosing the right number of compute-intense actors

Florian Weimer
 

* Sean T. Allen:

No. There is nothing in the standard library to achieve this.
What's the use case you are imaging?
I'm writing something that processes input files and it is
compute-bound, not I/O-bound. Creating more actors than which can
possibly execute in parallel is wasteful. I need to bound their
number anyway because each actor needs an open file, and their number
is finite (as low as 1024 on many systems).


Re: Choosing the right number of compute-intense actors

 

Hi Forian,

No. There is nothing in the standard library to achieve this.
What's the use case you are imaging?

-Sean-


On Mon, Oct 1, 2018 at 7:06 AM Florian Weimer <fw@...> wrote:
I assume that it is a good idea not to have too many more actively
computing actors than there are scheduler threads.

Is there something already in the standard library to achieve this?




Choosing the right number of compute-intense actors

Florian Weimer
 

I assume that it is a good idea not to have too many more actively
computing actors than there are scheduler threads.

Is there something already in the standard library to achieve this?


Re: Input from console

Reiner Wolf
 

Yes, you can take the readline sample on Github. It presents the same problem. I'm working on Windows 10, i've not tried on Linux. 

Cheers


Re: Input from console

 

Do you have a sample program that demonstrates the problem?


On Sat, Sep 29, 2018, 06:09 Reiner Wolf <rwspectral@...> wrote:
I return to the subject because I came across a strange behavior... if i press the caps key, or num lock, or ctrl key the program becomes unable to accept any other character...
Is this a bug?

Cheers.


Re: Input from console

Reiner Wolf
 

I return to the subject because I came across a strange behavior... if i press the caps key, or num lock, or ctrl key the program becomes unable to accept any other character...
Is this a bug?

Cheers.


Last Week in Pony - September 23, 2018

jhorwitz@...
 

https://www.ponylang.io/blog/2018/09/last-week-in-pony---september-23-2018/


Re: Domain change coming

 

Pony Patterns has been moved as well.

It's not at https://patterns.ponylang.io


Re: Domain change coming

 

Hi all,

tutorial.ponylang.io is now live.

There's a hacky redirect of tutorial.ponylang.org to tutorial.ponylang.io. It's not perfect but it should work.

More coming! Next up will be moving patterns.ponylang.org over to patterns.ponylang.io.

It will work the same as how tutorial now works.


Re: Domain change coming

 

stdlib.ponylang.org has been moved to stdlib.ponylang.io.

old stdlib.ponylang.org links should be redirecting to ponylang.io equivalents.


Re: Domain change coming

 

The website should be fully over from www.ponylang.org to www.ponylang.io

https should be working and everything should be redirecting. If you encounter any problems let me know.

Next up are the tutorial and patterns books. Those are going to be trickier.

121 - 140 of 1896