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
<doublec> hmm, not according to the source
<TwoNotes> I think there is still a bug in gc. It is not checking for null in a place where null is possible. Perhaps Debug just uncovers it.
<jemc> mcguire: you're correct that Debug.out( <something expensive> ) will still execute/evaluate the argument - if you want to prevent that, you have to wrap your call in `ifdef debug then [...] end`
<jemc> since Debug.out is just a function call that will check `ifdef debug` internally
<mcguire> That's what I figured. Just something to be aware of when Im sprinkling "Debug" around.
<mcguire> Didn't know about ifdef debug, though. Thanks.
<jemc> mcguire: regarding your String.compare example - looks like that function might be plain broken - I notice that there are no unit tests for String.compare - if you like you could work on a PR to add some tests and fix the function
<jemc> or just file an issue and wait for someone else to do it
<mcguire> jemc: I think I see it.
<mcguire> String.compare_sub: if (j + n) > _size then...elseif (k + n) > that._size then...end
<doublec> mcguire: four > one because four has more characters. one > four because o > f.
<doublec> mcguire: from what I can tell how that function works
<mcguire> k = 0, n = this._size Comparing with that._size is weird.
<mcguire> doublec: Yeah, that's what I just spotted.
<hakvroot> TwoNotes: so I just found that Debug uncovers it because it calls msg.string() - which happily removes Debug out of the, err, equation :)
<doublec> mcguire: I'd be lazy and have that function do @strncmp :)
<doublec> I guess it can't because of all the offset/size options
<mcguire> there are an amazing number of options to that. :-)
<Praetonus> It can be fixed by modifying the compare_sub call in compare to compare_sub(that, _size.max(that._size))
<SeanTAllen> TwoNotes: your open ticket still is an issue on branch issue-629, correct?
<TwoNotes> have not had time to change anything. away from desk
<SeanTAllen> doublec: fix merged
<doublec> rr failed on pony due to an unimplemented system call in rr - get_mempolicy - I'll see what's involved in getting that done.
<doublec> SeanTAllen: great!
prettyvanilla has quit [Quit: Konversation terminated!]
<SeanTAllen> cool bug hakvroot TwoNotes. this is looking interesting. sucks you got hit by it... but... i'm having fun here.
prettyvanilla has joined #ponylang
<jemc> it's worth correcting my earlier statement that Debug.out checks ifdef debug internally - it doesn't, it logs regardless of `ifdef debug` status
<jemc> Debug.apply is the one that checks `ifdef debug`
<TwoNotes> All those Debug calls are destined to become log write calls anyway.
<TwoNotes> So, triggering a gc within an actor constructor is the trigger?
<hakvroot> TwoNotes: for as far as I could find it is that with the addition of passing another actor within a class val to that constructor and keeping a reference to it
prettyvanilla has quit [Read error: Connection reset by peer]
prettyvanilla has joined #ponylang
<TwoNotes> So my Config object is part of the pattern? wow this is obscure
<hakvroot> yeah, the Config with a ref to the SpeechOut actor passed to the SpeechIn actor's create function is about what remained after trimming :)
<hakvroot> I'm curious if there is even a simpler condition where it occurs... I wonder what SeanTAllen finds
<TwoNotes> I put in the Config object to reduce the size of the arglists I was passing around!
<hakvroot> well, nice find :)
<hakvroot> time for my 8hr retreat though
amclain has quit [Quit: Leaving]
<SeanTAllen> nice
<SeanTAllen> damn this is cool
<SeanTAllen> omg
<SeanTAllen> i cant believe that works
<TwoNotes> wot?
<SeanTAllen> man i cant wait til i find why this is the case
<SeanTAllen> let me check your gist first
<doublec> I'm surprised a GC is triggered in the constructor - I thought an actor constructor was a behaviour and so wouldn't gc.
TwoNotes has quit [Read error: Connection reset by peer]
<doublec> maybe that's the bug.
TwoNotes has joined #ponylang
<mcguire> Praetonus: not quite. Oy.
<Praetonus> Ah, yes, you're right
<Praetonus> At least commutativity is now correct, but yes, String.compare_sub doesn't respect the lexical order
<SeanTAllen> crappy OSX and not relocating memory is turning out to be handy
<mcguire> "abc" should be less than "bc"
TwoNotes1 has joined #ponylang
<TwoNotes1> SeanTAllen, which branch is it you wanted me to test against?
<SeanTAllen> TwoNotes1: it isnt fixed there
<SeanTAllen> But, I have a ton of info for Sylvanc. I emailed it all to him. I think it should be enough for him to know where the issue is. And hopefully I learn more about the GC in process.
<TwoNotes1> ok. But at least I have some ideas on how to avoid the GC bug in the meantime.
<SeanTAllen> its specifically the SpeechOut actor that causes issues when SpeechIn is tracing it (in the minimal examples)
<TwoNotes1> Hmm, SpeechOut though simple is kinda central to how the program works
<SeanTAllen> yeah i found a number of way to not trigger it that i dont fully understand
<TwoNotes1> But I am removing all the Debug calls
<TwoNotes1> And I pulled the latest ponyc, which seems to have your earlier gc.c fix
<SeanTAllen> it does
<SeanTAllen> ive been testing your issue against that.
c355e3b has quit [Quit: Connection closed for inactivity]
<TwoNotes1> I still get the segfault, so clearly I have not removed enough of the trigger stuff. Debug alone is not enough
<TwoNotes1> I guess it is the actor referenced passed though a val class to another actor that then keeps a copy
<TwoNotes1> In the Erlang version of this, I used registered process IDs for this
<SeanTAllen> i did a hack fix but i have no idea what else it might impact
<SeanTAllen> if you want to try TwoNotes1, all tests pass with this change, its definitely not the *right* fix but... no more crash while looking at it. i think it will have a negative impact on you... https://gist.github.com/SeanTAllen/bf51357e8a46afbfbfce
<SeanTAllen> swap that in to replace the existing one in gc.c
<TwoNotes1> I'll wait then. I am too tired right now and I might mess something up
<SeanTAllen> ok
<TwoNotes1> It occurs to me that StdStream is an actor too. And I pass that around the same way, for the log file output
<SeanTAllen> see y'all tomorrow
TwoNotes has quit [Remote host closed the connection]
TwoNotes1 has quit [Quit: Leaving.]
TwoNotes has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
Praetonus has quit [Quit: Leaving]
trapped has joined #ponylang
jemc has quit [Ping timeout: 260 seconds]
srenatus has joined #ponylang
lispmeister has joined #ponylang
c355e3b has joined #ponylang
mcguire has quit [Ping timeout: 240 seconds]
mcguire has joined #ponylang
copy` has joined #ponylang
<doublec> I've done a pull request for adding to the lambda documentation in the tutorial https://github.com/ponylang/pony-tutorial/pull/56
<doublec> Not sure it reads well so feedback welcomed.
_andre has joined #ponylang
<SeanTAllen> TwoNotes hakvroot your fix is pushed
TwoNotes1 has joined #ponylang
TwoNotes has quit [Disconnected by services]
TwoNotes1 is now known as TwoNotes
<TwoNotes> SeanTAllen verified issue 623 is fixed. w00t
<_andre> what's the best practice regarding thread-unsafe C functions with the FFI?
<_andre> i'm wrapping libmysqlclient and mysql_init() is not thread safe, so i started getting weird errors in units tests unless i run them with --sequential
<_andre> a static pthread mutex around mysql_init() seems to have fixed it but i wonder if there's a better option
aturley has joined #ponylang
<SeanTAllen> if its not thread safe, its not thread safe. so that seems reasonable
<SeanTAllen> you could also look at ponyint_ssl_multithreading in ssl.c although i dont think that is applicable in your case.
<TwoNotes> But once you call an FFI, it completes its work in a single thread, doesn't it?
<TwoNotes> No pre-emptive scheduling in Pony, right?
<shepheb> it should, but you need to exclude any other Pony threads from making the same call
<shepheb> like, say, the next unit test
<TwoNotes> Isn't mysql_init called only once, at startup?
<shepheb> > unit tests
<shepheb> in a single application with one call to it early, that's probably safe? some thread will make the call, it will return, and fine.
<shepheb> completely unrelated: I really wish I could have global val values
<shepheb> for the parsers.
<shepheb> there doesn't need to be multiple copies of the Whitespace parser - just one. it's val, so it's "safe" to make it a global.
<shepheb> this is the biggest ergonomic difference between my attempt at a parser combinator library and things like Haskell's parsec.
<shepheb> in Haskell, you have global values and functions that are immutable. so you can construct a parser once, and give it a name like "whitespace", and then easily use it in other parsers.
<shepheb> that's a major problem with the approach I'm taking here. I'm wondering about an alternative approach that doesn't use top-level combinators, but rather a hybrid approach that gives names to rules.
<shepheb> so you can refer to other parsers by name inside those rules.
<shepheb> where a "parser" here is essentially a function from an input stream to a modified stream and a result
<shepheb> so there can be exactly one object for the whitespace parser, that's referenced from many places.
felixonmars has quit [Ping timeout: 250 seconds]
<TwoNotes> Erlang had a thing called 'registered process IDs' that I made use of for a similar purpose.
<TwoNotes> For example, a centralized logger
<TwoNotes> But then, how do you find the ragistrar ?
<SeanTAllen> supply it to anything that needs it
<SeanTAllen> and you can have more than 1 if you want
<TwoNotes> I could also just pass the centralized logger process to every actor in the program. That is what I was trying to avoid.
<SeanTAllen> you could have a registrar per subsystem
<shepheb> it's a lot more scalable to pass around a single registrar than N individual services
<TwoNotes> that's true
<SeanTAllen> while maintaining testability of supplying your dependencies
felixonmars has joined #ponylang
<TwoNotes> Hmm, StdStream is an actor, so I could put the logger file in there too
<hakvroot> SeanTAllen: nice work!
Praetonus has joined #ponylang
<Praetonus> _andre: I'm not an expert of mysql, but I think you can call mysql_library_init in a primitive _init function, and then mysql_init will be safe to call from multiple actors, since _init functions in primitives run sequentially and before the Main actor is started
<SeanTAllen> hakvroot: well, i took your gists and found ways to fix and where it all went wrong and dug into it more then sent it off to Sylvan who fixed, so team effort.
<TwoNotes> So all you had to do was replace that function call?
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
<_andre> Praetonus: i didn't know about _init functions, i'll check it out
TwoNotes has quit [Quit: Leaving.]
amclain has joined #ponylang
aturley_ has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
TwoNotes has joined #ponylang
<TwoNotes> UDPSocket.write does not return a value, but the underlying C code returns the count of bytes sent.
Praetonus has quit [Quit: Leaving]
pulpfiction has joined #ponylang
<TwoNotes> I am doing a write on a UDP socket but Wireshark never sees it.
<jemc> TwoNotes: just to check, you've made sure that you don't have a firewall enabled that is blocking UDP?
<jemc> I only ask because that's the first thing I check whenever I'm doing something with UDP and it isn't working
<jemc> (my linux distro has a firewall that disables UDP by default)
jtfmumm- has joined #ponylang
<TwoNotes> jemc, actually this is all one one machine.
<TwoNotes> Oh you mean like iptables?
<TwoNotes> Wireshark can see the UDP messages sent out by my other computers in the house
<TwoNotes> Aha - if I force it to use 127.0.0.1, then that gets seen
<TwoNotes> But that would never get seen on other boxes on the LAN
<jemc> TwoNotes: sounds like you're sending on the wrong interface then?
<TwoNotes> If I send on 127.0.0.1 other boxes will not see it. If I send it on the WIFI link, then local programs will not see it hmm
<_andre> maybe you're capturing on the wrong interface?
<TwoNotes> I put wireshark to look on both interfaces
<TwoNotes> Timers have two time parameters. I thought the first one is interval to the first firing, and the second one is the interval to subsequent firings. That does not seem to be how it works
<TwoNotes> There is an 'expiration' and an 'interval'
<jemc> TwoNotes: from a glance at the docs I would make the same assumption about how they're supposed to work
<TwoNotes> It seems to go by the second 'interval' number only
<jemc> as in, from the docs I would assume the first firing is at `start_time + expiration`, the second is at `start_time + expiration + interval`, the third is at `start_time + expiration + 2 * interval`
aturley_ has quit [Ping timeout: 260 seconds]
<TwoNotes> It looks like it is start+expiration+(n*interval) with n starting at 1.
<TwoNotes> So even the first time uses both numbers
<TwoNotes> With both set at 15 secs, it was about 30 secs for the first firing, then each 15 sec
<jemc> TwoNotes: sounds like a bug if you wannted to push a fix
<jemc> ie make n start from 0 instead of 1
<TwoNotes> I will have to look at the Timers cheduling code to see if that is how it really works.
<TwoNotes> Still working on the UDP problem - I noticed the timer thing as that is what triggers my multicast messages
lispmeister has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
juanjoc has joined #ponylang
kajstrom_ has quit [Ping timeout: 250 seconds]
jonrh has quit [Ping timeout: 250 seconds]
sblessing has quit [Ping timeout: 250 seconds]
sblessing has joined #ponylang
jonrh has joined #ponylang
kajstrom has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
gornikm_ has joined #ponylang
tlockney___ has joined #ponylang
TwoNotes1 has joined #ponylang
jeremyheiler has quit [Ping timeout: 250 seconds]
tlockney__ has quit [Ping timeout: 250 seconds]
gornikm has quit [Ping timeout: 250 seconds]
TwoNotes has quit [Ping timeout: 250 seconds]
jtfmumm- has quit [Ping timeout: 250 seconds]
jeremyheiler has joined #ponylang
tlockney___ is now known as tlockney__
jeremyheiler has quit [Changing host]
jeremyheiler has joined #ponylang
gornikm_ is now known as gornikm
TwoNotes1 is now known as TwoNotes
Praetonus has joined #ponylang
<jeremyheiler> SeanTAllen: my internet has been in and out all day, so i have a service person coming at 4. i may be late, if i can make it, to the meeting, please don't wait up.
jtfmumm- has joined #ponylang
<SeanTAllen> ok
<SeanTAllen> will be recording so... that's something.
<SeanTAllen> TimeWarner jeremyheiler ?
<jeremyheiler> yup
<SeanTAllen> i need to call verizon now that Fios is available in my building
<jeremyheiler> do it. so worth it
<SeanTAllen> i am slow about doing things
<SeanTAllen> i still have "see allergist" on my to do list. that entry is 30 months old now.
<jeremyheiler> heh, that seems more important
<TwoNotes> Some people just have DSL :(
<TwoNotes> All around me have Comcast, but my street does not have enough houses on it for them to bother.
<jeremyheiler> :-(
<TwoNotes> All underground service, so it is expensive to install. They want to make their money back. A good bet in our case, because we would not buy their TV service at all - just internet
<TwoNotes> My uplink speed is about 450 KILO bits/sec
<darach> 250m down / 15m up here - I remember much discharging of nostrils at Comcast when I lived in the US!
<TwoNotes> This is with AT&T over copper wires.
Praetonus has quit [Ping timeout: 260 seconds]
<darach> Fibre to the kerb, Cable to the door here.
<jeremyheiler> SeanTAllen: i'm good, see you in 15
<jemc> I'm having issues with sounds - haven't used the zoom client before
<jemc> working on troubleshooting it
<SeanTAllen> there's a nic and speaker under audio in preferences.
<SeanTAllen> mic
Praetonus has joined #ponylang
chwahoo has quit [Quit: Connection closed for inactivity]
juanjoc has quit [Remote host closed the connection]
jtfmumm- has quit [Ping timeout: 250 seconds]
jtfmumm- has joined #ponylang
<sblessing> is the zoom client working on el captain?
emancu has joined #ponylang
_andre has quit [Quit: leaving]
Praetonus has quit [Ping timeout: 260 seconds]
<jemc> WIP PEG generator in pony: https://github.com/jemc/pony-pegasus
<jemc> so far it uses an Executor to "execute" the pattern object over the string
<jemc> but I've also thought about other execution models that are more streamlined
<jemc> in other PEG libraries I've written, this involved generating bytecode for the particular VM it was running on - not sure what it would look like in Pony
<jeremyheiler> awesome
<jemc> it's worth noting that the patterns are declared as expressions in Pony, rather than having some external format (which could also be supported if someone wanted it)
<jemc> this notion of using overloaded operators to denote PEG relations is something I borrowed from Lua's LPEG
<jeremyheiler> that's clever
<jeremyheiler> jemc: so, the only peg features we can't use are and and not predicates, in order to remain LL(1)?
<jeremyheiler> 'and' and 'not'
<jemc> well, I'd think that in the PEG pattern we can use whatever is most convenient for implementing the grammar, as long as the conceptual pony grammar remains LL(1) compatible
<jeremyheiler> right, i'm just speaking to what can be used for teh pony grammar
<jemc> for example, you might be able to express an idea more succinctly using lookahead, even if that idea could be expressed without lookahead
<jeremyheiler> oh i see
<jemc> TBH I'm not an expert on translating between LL(1) and PEG operations, so I'm not sure if there are other operations to avoid
<jeremyheiler> me either
<jeremyheiler> at first glance, everything else seems ok
<jemc> also, to be clear, right now the `and` operator doesn't do anything - `not` is negative lookahead and `not not` is positive lookahead :)
<jemc> since `and` is a binary operation, it doesn't work as well for lookahead
<jemc> it could work for concatenation, but I'm using `+` for that
<jeremyheiler> heh yeah
<jemc> I think the main tricky point in translating between LL and PEG ops is remembering that PEG choices are ordered and LL choices are not
<jeremyheiler> it's too bad we cannot make up new operators
<jeremyheiler> in pony
<TwoNotes> Algol68 had a syntax for that.
<jemc> so an LL choice must be "unambiguous", but PEG choices reach non-ambiguity by just picking the first one that works in the ordered list
<jeremyheiler> yeah
TwoNotes has quit [Quit: Leaving.]
mcguire has quit [Ping timeout: 240 seconds]
[CBR]Unspoken has quit [Ping timeout: 248 seconds]
mcguire has joined #ponylang
Praetonus has joined #ponylang
Praetonus has quit [Quit: Leaving]
srenatus has quit [Quit: Connection closed for inactivity]