jemc changed the topic of #ponylang to: Welcome! Please check out our Code of Conduct => https://github.com/ponylang/ponyc/blob/master/CODE_OF_CONDUCT.md | Public IRC logs are available => http://irclog.whitequark.org/ponylang | Please consider participating in our mailing lists => https://pony.groups.io/g/pony
_whitelogger has joined #ponylang
g00s has joined #ponylang
amclain has quit [Quit: Leaving]
Praetonus has quit [Ping timeout: 268 seconds]
Praetonus has joined #ponylang
_whitelogger has joined #ponylang
jemc has quit [Ping timeout: 260 seconds]
_whitelogger_ has joined #ponylang
_whitelogger has quit [Remote host closed the connection]
jemc has joined #ponylang
TJ800X has joined #ponylang
<TJ800X> Hello. I'm happy to report I'm making progress with Pony.
<TJ800X> I'm stuck on one thing though..how to cast a U64 as a U128.
<TJ800X> let quadword2: U64 = (0b00<<62)+
<TJ800X> ((nanosecs and 0x7fffffff)<<32) +
<TJ800X> ((nanosecs and 0x7fffffff)<<32) +
<TJ800X> ahh....Ill simplify
<TJ800X> let quadword2: U64=100
<TJ800X> let timevic: U128 = quadword1.u128()
<TJ800X> I expected the quadword1.U128() to work.
<TJ800X> I should get used to gists.
<TJ800X> Here is the gist. I'm having problems around line 42. https://gist.github.com/tj800x/8e801c3470a5b87a296b06141ce77f91
<TJ800X> This is for a hybrid vector timestamp library I'm working on.
<jemc> TJ800X: `quadword1 val.U128()` is not valid syntax, in part because `val` is a reserved word
<jemc> you probably want `quadword1.u128()`
<TJ800X> Tried that several times.
<TJ800X> Let me try it again.
<TJ800X> let timevic: U128 = quadword1.U128() gives me couldn't find U128 in U64
<doublec> TJ800X: u128 not U128?
<TJ800X> Arggh. I swear I tried that twelve times.
<TJ800X> Working now.
<TJ800X> Thanks doublec.
<TJ800X> Sometimes hacking around makes me farther from the solution.
jemc has quit [Ping timeout: 268 seconds]
jemc has joined #ponylang
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
jemc has quit [Ping timeout: 246 seconds]
CcxWrk has quit [Ping timeout: 260 seconds]
CcxWrk has joined #ponylang
papey_la1 has joined #ponylang
papey_lap has quit [Ping timeout: 240 seconds]
amvtek has joined #ponylang
amvtek has quit [Quit: Page closed]
TJ800X has quit [Ping timeout: 260 seconds]
papey_la1 is now known as papey
vaninwagen has joined #ponylang
vaninwagen has quit [Ping timeout: 248 seconds]
vaninwagen has joined #ponylang
_andre has joined #ponylang
vaninwagen has quit [Ping timeout: 260 seconds]
vaninwagen has joined #ponylang
jemc has joined #ponylang
Praetonus has quit [Quit: Leaving]
vaninwagen has quit [Ping timeout: 248 seconds]
vaninwagen has joined #ponylang
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 240 seconds]
vaninwagen has quit [Ping timeout: 255 seconds]
vaninwagen has joined #ponylang
amclain has joined #ponylang
vaninwagen has quit [Ping timeout: 260 seconds]
TJ800X has joined #ponylang
<TJ800X> Is there anything in Pony like a static variable? I'm guessing not, and that I should create a context in my library and use that context for state. Does that sound correct?
<jemc> tj800x: yes, that sounds like the correct design pattern
<TJ800X> For a single value, should the context state be a simple variable, an instance of a class, or an actor?
<jemc> in the future, we're planning to have a separate construct for compile-time constant values (dependent types), but that doesn't exist yet
<jemc> tj800x: do you need to mutate the global state, or is it a constant/immutable value?
<TJ800X> Global immutable state.
<jemc> you probably want a `class val`
<TJ800X> Is Env a good thing to look at here. I'm sure it's much more complicated than I need.
<jemc> tj800x: you won't be able to add your own values to `Env`, since it's immutable and already fixed by the time you receive, it but it's a similar design pattern to what you probably want to do with your "Context"
<TJ800X> I was thinking it would be a good example to look at when building my own context.
<TJ800X> I found it and will try and learn from it.
<TJ800X> Pony is absolutely amazing. Very hard, but worth the effort.
<jemc> yes, I see it as being quite a steep learning curve to climb, but very rewarding
Praetonus has joined #ponylang
<dyreshark> hi! i'm running https://is.gd/7v13Np on my MacOS box, and it's (apparently) consistently taking 50% of a core. is that expected?
<jemc> dyreshark: yes, there's an ongoing issue ticket to investigate timer busywait on MacOS - https://github.com/ponylang/ponyc/issues/1787
<dyreshark> got it. thanks!
Matthias247 has joined #ponylang
papey has quit [Ping timeout: 240 seconds]
g00s has joined #ponylang
<TJ800X> If I am creating a context at the top of my main and then passing it around, does it make sense to create it as an iso? I will be mutating the context from down inside my library.
<Praetonus> tj800x: It should be iso if you intend to pass it to other actors. Otherwise, ref is fine
<jemc> tj800x: if your requirements are *sendable* (between actors) and *mutable*, then yes, it would need to start its life as an `iso`
<jemc> however, if you need to share it globally among many actors at once as you dsecribed earlier, you will need to step down from `iso` to `val` before it is *shareable*
<jemc> (obviously, at which point it is no longer *mutable*)
<TJ800X> Thanks for your patience.
<jemc> happy to help! :)
<TJ800X> I'm making all sorts of notes. It might make a good "Pony for Mere Mortals" type book.
<jemc> tj800x: if you haven't seen them yet, doublec has some great blog posts for getting oriented in Pony: https://bluishcoder.co.nz/tags/pony/index.html
<TJ800X> Will review.
<jemc> more resource links here, for the interested: https://www.ponylang.org/community/planet-pony/
g00s has quit [Quit: Textual IRC Client: www.textualapp.com]
Praetonus has quit [Quit: Leaving]
TJ800X has quit [Ping timeout: 260 seconds]
_andre has quit [Quit: leaving]
TJ800X has joined #ponylang
smoon has joined #ponylang
smoon has quit [Client Quit]
<TJ800X> Is there any way to print the reference capabilities of a variable? I'd like something like is_iso(refa) which would return tru if refa was an iso
<TJ800X> At this point to figure things out I'm having to purposely assign variables to tag and see what error message the compiler kicks out.
<jemc> tj800x: actually, that's not possible, because reference capabilities don't exist at runtime - they are purely a compile-time check - a zero-cost abstraction
<TJ800X> Yes, that makes sense.
<TJ800X> Any better way of doing it then trying to assign it to a tag?
<jemc> with regard to your approach of assigning to `tag` - that's probably not going to help you much because `tag` is a subtype of everything, thus you can assign any cap to it
<jemc> you could assign to an `iso`, which would succeed if the right hand side is `iso^` and fail for every other cap with a message telling you which cap it is
<TJ800X> Im just trying to create a simple table that tells me how to get from one capability to another. I don't think what I've been doing is structurally all that wrong, I just dont get it I guess.
<TJ800X> I've spent another six hours and am no closer to understanding this thing it seems.
<TJ800X> Some sort of compile-time stop that simply prints the capability type at a given point would certainly help.
<TJ800X> whatis(refa) . String iso <<COMPILER HALTED>> would be welcome.
<TJ800X> I've been assigning numbers to String iso and getting similar results I think.
<TJ800X> So far, here is what I understand. If I have an ISO, it is like two bands are around it blocking read and write from any other aliases in the world of Pony.
<TJ800X> Only the variable reference can mutate it or read it.
<TJ800X> Lets say I have a variable named refa_iso. If I do a refb = recover refa_iso end, it destructively reads the memory associated with refa_iso and essentially repoints that memory block to refb.
<TJ800X> Now, what is refb's capability. I assume it depends on how it was declared.
<jemc> close, but `consume` is the keyword to destroy a reference, not `recover`
<jemc> I've gotta run for a sec, but I'll be back soon to answer more questions
<TJ800X> Okay. consume. <<POUNDS HEAD HARD>>
<TJ800X> Consume is the one that isn't in the block.
<TJ800X> Is that because consume only works on simple variables?
smoon has joined #ponylang
<TJ800X> So, according to the "Chart" -- the one with ISO, VAL, and TAG on the diagonal....
<TJ800X> We can go down and to the right implicitly.
jemc has quit [Ping timeout: 260 seconds]
<TJ800X> Does that mean, single step down, or single-step right, or multiple-steps?
<TJ800X> The whole down-right implicit talk doesn't make sense to me. In order to do anything with an ISO you have to consume it.
<TJ800X> It seems to me like down-right is really implicitly converting "from below and from right"
smoon has quit [Quit: smoon]
smoon has joined #ponylang
jemc has joined #ponylang