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
<jemc> continuation passing would be an interesting addition to Pony, but it's a pretty significant feature to drop into a language, and a lot would need to be thought out about how it works
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
jemc has quit [Ping timeout: 246 seconds]
jemc has joined #ponylang
MaybeDragon has quit [Ping timeout: 258 seconds]
<ada[m]> Thanks jemc. Ya'll are so nice to newbies. It's refreshing. :)
tscho has quit [Quit: Page closed]
<SeanTAllen> ada[m]: thanks. we try.
plietar has joined #ponylang
<ada[m]> Hm. I don't think I understand why this won't compile: http://playground.ponylang.org/?gist=d46d293079184a8625c21e26a70d85a5
<SeanTAllen> it looks like repeat might not be working
<SeanTAllen> or those are bad examples in the tutorial
<ada[m]> If you declare stop outside of the repeat loop, it's fine. Just wondering if that's an intentional language design.
<SeanTAllen> i think so
<SeanTAllen> but the tutorial suggests otherwise
<SeanTAllen> im looking now
<SeanTAllen> i forgot repeat existed
<SeanTAllen> i think i used it once a couple years ago
<SeanTAllen> tutorial says it should work
<SeanTAllen> i think that is a bug. *think*
<SeanTAllen> i cant find any usage in the stdlib that matches that tutorial
<SeanTAllen> @ada[m] can you open an issue and reference that according to the tutorial that should work: https://tutorial.ponylang.org/expressions/control-structures.html
<SeanTAllen> im honestly not sure which is wrong
<SeanTAllen> the tutorial seems a little odd to me, but... ¯\_(ツ)_/¯
<ada[m]> Mm. If others are like you, might be worth removing repeat from the stdlib. Two methods of looping is plenty imo.
<SeanTAllen> i would not assume others are like me
<SeanTAllen> that seems dangerous in my mind
<SeanTAllen> my pony tends to be different from other folks because at sendence we are very performance obsessed
<SeanTAllen> ada[m]: you are non-Jedi on GH, yes?
<ada[m]> yep that's me
<SeanTAllen> nice change on structual equality
<SeanTAllen> small but i think its more clear now
<ada[m]> thanks :)
<SeanTAllen> Im opening that repeat issue.
<ada[m]> ah. ya. sorry about the delay
<SeanTAllen> it's ok
<SeanTAllen> worry not
mikeyhew has joined #ponylang
endformationage has joined #ponylang
auoe has joined #ponylang
endformationage has quit [Read error: Connection reset by peer]
mikeyhew has quit [Quit: Connection closed for inactivity]
auoe has quit [Quit: Page closed]
jemc has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ponylang
bb010g_ has joined #ponylang
_whitelogger has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
Matthias247 has joined #ponylang
MaybeDragon has joined #ponylang
bb010g_ has quit [Quit: Connection closed for inactivity]
bb010g_ has joined #ponylang
bb010g_ has quit [Client Quit]
Matthias247 has quit [Read error: Connection reset by peer]
feijoa has joined #ponylang
feijoa has quit [Client Quit]
_whitelogger has joined #ponylang
theodus has joined #ponylang
autodidaddict has quit [Quit: Connection closed for inactivity]
acarrico has joined #ponylang
_whitelogger has joined #ponylang
jemc has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
tscho has joined #ponylang
tscho has quit [Client Quit]
tscho has joined #ponylang
tscho_ has joined #ponylang
jemc has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang
theobutler has joined #ponylang
theodus has quit [Ping timeout: 246 seconds]
<tscho_> exit
endformationage has joined #ponylang
plietar has joined #ponylang
<SeanTAllen> enter!
horst has joined #ponylang
horst has left #ponylang [#ponylang]
tscho has quit [Quit: ZNC 1.6.5 - http://znc.in]
tscho_ has quit [Quit: ZNC 1.6.5 - http://znc.in]
http_GK1wmSU has joined #ponylang
http_GK1wmSU has left #ponylang [#ponylang]
<SeanTAllen> you around jemc?
<jemc> yeah
obadz has quit [Quit: WeeChat 1.8]
obadz has joined #ponylang
<jemc> SeanTAllen: ^
<SeanTAllen> Ya
<SeanTAllen> I got sylvan
<SeanTAllen> working on the gcc7 issue
<SeanTAllen> making sure i wasnt doing something "not right"
<jemc> got it
plietar has quit [Read error: Connection reset by peer]
plietar has joined #ponylang
Matthias247 has joined #ponylang
<jmiven> Hi! Regarding https://github.com/ponylang/ponyc/issues/2108 I'm now trying to build ponyc with gcc6, but it fails immediately: http://paste.awesom.eu/qYJj
<jmiven> should I modify the Makefile and if so, how? :-)
<jmiven> the gcc6 package does tell me that I should link with "-Wl,-rpath=/usr/local/lib/gcc6" but this seems to fail before any linker call
trapped has quit [Ping timeout: 246 seconds]
<jmiven> oh, features.h is a glibc thing
plietar has quit [Remote host closed the connection]
auoe has joined #ponylang
plietar has joined #ponylang
<auoe> Hi! I am trying to write a function that minifies JSON. I guess, it should take a String box as an input and return String iso. However, I am having trouble with capabilities. If I create String iso - I can't append. If String ref - don't know how to make String iso out of it. The short version is here: https://playground.ponylang.org/?gist=1423eb74de14d8914a753d8032938452.
<auoe> I could change input argument type to just String, but that would not work with String ref, I suppose.
<SeanTAllen> @jmiven this is 32 bit FreeBSD right?
<jmiven> SeanTAllen: right
theobutler has quit [Ping timeout: 276 seconds]
<SeanTAllen> let me walk you through the 2 fixes.
<SeanTAllen> 1) you need to consume an `iso` when you return it. consume means "i am giving up my alias to this iso".
<SeanTAllen> 2) you need to have your incoming string be a val. the error message you would get for that is quite poor unfortunately.
<SeanTAllen> definitely something we could fix
<auoe> OK, thanks! Two questions...
<SeanTAllen> jmiven: i dont know what is going on with that sadly. which version?
<SeanTAllen> fire away auoe! im making lunch so pardon me if im delayed in answering
<auoe> 1) It magically works without consume, if I comment out append. So I was not sure.
<auoe> 2) String val - seems limiting somehow... Why can't it work with String box?..
<SeanTAllen> the no consume is... interesting...
<SeanTAllen> jemc: did you add anything that would explain the not needing to consume the iso string?
<jmiven> SeanTAllen: gcc 6.3.0. Apparently the problem is that when gcc is used, atomics.h assume that the glibc is available. Which kind of makes sense, but isn't very useful to me right now :-)
<jmiven> I'm going to grab something to eat, I'll be back later
<SeanTAllen> jmiven: sorry which version of freebsd?
<jmiven> SeanTAllen: oh sorry, FreeBSD 11.1
<SeanTAllen> hmmm, auoe this is very odd looking at it
<SeanTAllen> sadly there are no freebsd 32 bit vagrant boxes available
theodus has joined #ponylang
kulibali_ has joined #ponylang
kulibali has quit [Ping timeout: 260 seconds]
kulibali_ is now known as kulibali
vaninwagen has joined #ponylang
<SeanTAllen> auoe: Paul who knows the type system much better than me just reminded me that it wold be unsafe to call "ref" methods on trn and iso unless all the parameters are sendable which is why you need a `String val`
<auoe> SeanTAllen: how would I pass mutable String into this function then?.. I was just looking at String implementation and most methods take String box. Which makes sense to me.
<SeanTAllen> auoe: https://playground.ponylang.org/?gist=d65e42cff25639bc0f056767e478f938 is correct I missed the lack of String iso ^ and it jsut being 'String iso'
<SeanTAllen> you can pass a mutable string but you would need to make an immutable clone before appending to the sb
<SeanTAllen> Sorry, it been a long day, I'm a little mentally slow right now.
<SeanTAllen> Hopefully i havent confused you horribly
endformationage has quit [Quit: WeeChat 1.9]
<auoe> SeanTAllen: A bit :) Hmm... sounds strange, if you think about - I want to create something by making a copy. Anyway, I need to read tutorial more. Still don't understand ^ and recover well. Thanks
<SeanTAllen> auoe "String iso" says return an iso
<SeanTAllen> but if you assign that iso to a new variable, thats a second alias which would be a String iso!
<SeanTAllen> which is probably too confusing right now
<SeanTAllen> regarding a bit...
<SeanTAllen> plietar: actually i really am too tired, can you explain the "that sounds strange" bit
<plietar> auoe: So about why `box` is not allowed, and you need to make an immutable copy of it. The compiler doesn't know what String's append method does with the argument, it only knows the signature
<plietar> The append method could very well store a reference to the argument
<plietar> (Imagine String was implemented as a linked list of string segments)
<plietar> If you weren't forced to make a copy, you would end up with an iso object (the outer string) which points to a inner string object, while someone else also has a mutable reference to that inner string
<plietar> And then you'd be able to send that outer string to an actor (it's an `iso`, so that's sendable), and now two actors reference the same object (the inner string), and at least one of them has a mutable reference
<plietar> And that could lead to a data race
<plietar> Is that clearer auoe ?
<auoe> plietar: Thanks for the explanation! I need to think about it more. The part of somebody referencing part of iso reference makes sense... Kind of
<plietar> It's quite an unfortunate limitation of the type system today, because in reality append doesn't do any such thing, so in this case it would be safe
<plietar> But we don't have a way of expressing that in append's signature, so the compiler has to assume the worse and not allow it
<SeanTAllen> Yes. This is one of the areas that the type system can be smarter (and eventually will!)
<plietar> Because an iso reference can be sent to other actors, anything which can be accessed through an iso cannot be modified through any other means
<plietar> It often helps to think of an iso as a "bubble" which contains all the objects accessible through that iso reference
<auoe> But if String had fun iso append_iso(s: String box, ...) - that would be possible?
auoe has quit [Quit: Page closed]
auoe_ has joined #ponylang
auoe_ is now known as auoe
<ada[m]> Wait. The json classes don't implement `eq`? Is that an oversight, or is there some technical reason for that?
<ada[m]> I guess it's not quite as simple as the one-liner I had originally pictured but still.
<ada[m]> Makes writing tests for json stuff very difficult
<SeanTAllen> ada[m]: those json classes aren't optimal. feel free to start your own implementation. we'll happily consider replacements once they have been fleshed out.
<jmiven> SeanTAllen: I was actually thinking of making the freebsd box available in the coming week
<jmiven> it's an homeserver with a DSL connection in Europe, so it's not optimal, but if it's helpful to someone more competent than me on the matter I'm glad to help
<SeanTAllen> jmiven: it could definitely help. we could see how the lag is.
auoe has quit [Quit: WeeChat 1.9]
<jmiven> SeanTAllen: OK great, it should be ready in the coming days. I just have some logistics to sort out. I'll keep you posted
theobutler has joined #ponylang
theodus has quit [Ping timeout: 246 seconds]
<vaninwagen> wow, you really upped your release game, nice 0.17.0 !!! :)
<jemc> > 12:10 <@SeanTAllen> jemc: did you add anything that would explain the not needing to consume the iso string?
<jemc> it's a long-standing feature of Pony that you don't need to use `consume` on the return value if it's a local reference that needs consuming - the compiler knows that it's passing out of its scope, so the `consume` is implied
<SeanTAllen> jemc: i never knew that. live and learn.
<SeanTAllen> i could have sworn that used to be an error.
<jemc> well, I'm pretty sure that it's been that way since before I started learning Pony
<SeanTAllen> i certainly wouldnt trust my memory on that
MaybeDragon has quit [Read error: Connection reset by peer]
<SeanTAllen> 0.17.0 has been released. GCC7 is now supported on Linux. https://www.ponylang.org/blog/2017/08/0.17.0-released/
d33pb00k-GK1wmSU has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
d33pb00k-GK1wmSU has left #ponylang [#ponylang]
<vaninwagen> hi, i have a problem using type params with capability sets on methods: http://playground.ponylang.org/?gist=a6da90ad802364645bf055330089c150
<vaninwagen> is this known and expected behaviour?
<vaninwagen> i have a fun bla[T: (Hashable #read & Equatable[T #read] #read)](t: T): Set[T] => ...
<vaninwagen> and it fails with "a capability set can only appear in a type constraint"
<SeanTAllen> Yeah, that's a known issue vaninwagen.
<vaninwagen> aight
<vaninwagen> just wanted to rule out my stupidity
<SeanTAllen> actually no
<SeanTAllen> well
<SeanTAllen> which I believe is yours
<SeanTAllen> same thing
<SeanTAllen> but there could be nuances that i am overlooking
<vaninwagen> hmmm... don't get it yet. This is working being a type param for Set: https://stdlib.ponylang.org/collections-Set/
<vaninwagen> but not for methods?
jemc has quit [Ping timeout: 240 seconds]
<SeanTAllen> correct, you cant do it on methods
<SeanTAllen> you can specialize the refcap on the method
<SeanTAllen> or maybe i am misunderstanding what you are doing
jemc has joined #ponylang
<jemc> vaninwagen: `Equatable[T #read] #read` should be `Equatable[T] #read`
<jemc> you can't use `#read` as a type *argument* to `Equatable`
<SeanTAllen> also, im not sure what this is.. Set(0)
<vaninwagen> i am trying to write a method to create a generator for a set of random values and it should accept whatever a set accepts as its values
<SeanTAllen> Set isn't a concrete type
<vaninwagen> it is a type alias
<SeanTAllen> what is the intent of: "Set(0).>set(t)"
<jemc> this is the version of your code that works: http://playground.ponylang.org/?gist=df9713ee56d24a6d625eaf3a41551698
<vaninwagen> Set[T](0).>set(t)
<jemc> or at least, I eliminated the errors and it compiles
<vaninwagen> this was just a minimal example of my typeparam problem
<vaninwagen> this is exactly what i needed
<vaninwagen> could have guessed it myself
<vaninwagen> sorry for the confusion
<SeanTAllen> its ok
<SeanTAllen> sorry that i misinterpreted what you were trying to do
<vaninwagen> SeanTAllen the intent was to create a set with 1 element
<SeanTAllen> i should stop trying to help people today
<vaninwagen> should have been ``Set[T](1).>set(t)``
<SeanTAllen> i fried my brain this morning and my "helping" is not so helpful
<jemc> generics are super confusing, even for veteran Pony programmers - don't worry about asking a lot of questions
<vaninwagen> and i thought java generics were tough :)
<jemc> well, Pony generics can be pretty easy if the capabilities are not generic (like, if you limit yourself to only `val` or only `ref`
<vaninwagen> jemc, the error you pointed out above: " you can't use `#read` as a type *argument* to `Equatable`"
<vaninwagen> is this only true for method type params?
<vaninwagen> because in Set is seems to work
<vaninwagen> ah no
<vaninwagen> the documentation seemed to add the additional ``#read``
<vaninwagen> this is the actual signature of Set
<vaninwagen> type Set[A: (Hashable #read & Equatable[A] #read)] is HashSet[A, HashEq[A]]
<jemc> ah, so it's a docgen bug...
<jemc> good catch
<jemc> docgen is rendering that extra `#read` there where it shouldn't be
<jemc> can you open an issue ticket for that bug?
<jemc> (gtg, bbl)
<SeanTAllen> i dont think that is docgen bug
jemc has quit [Quit: WeeChat 1.4]
<SeanTAllen> Docgen puts the expanded types
<vaninwagen> it's just an issue if you use it for copy-pasting
<vaninwagen> in this particular case
<vaninwagen> like i did shamelessly
<SeanTAllen> there are pros and cons to where docgen exists in the chain and that it uses what the expanded types are
<SeanTAllen> if i was less tired, i could maybe remember what they are. :(
<SeanTAllen> one nice part is that you dont have to go digging through different type aliases to see the expanded type
<SeanTAllen> but that #read is what is in the ast.
<SeanTAllen> its [A #read]
<SeanTAllen> so if that is considered a bug, then what docgen processes needs to be changed so it the textual form rather than expanded form.
<SeanTAllen> So for example:
<SeanTAllen> see
<SeanTAllen> parameters for print are: data: (String val | Array[U8 val] val)
<SeanTAllen> thats the expansion of ByteSeq
<SeanTAllen> what'd you want then to address that #read is to not use the expanded for
<SeanTAllen> so that would become
<SeanTAllen> data: ByteSeq
<SeanTAllen> I'm not sure what else the impact would be
<SeanTAllen> unless that A #read is a bug in the actual expanded form.
<SeanTAllen> Sylvan and I discussed textual or expanded a couple years ago. I think a new discussion is a reasonable thing to have.
<SeanTAllen> I hope all that made sense
<vaninwagen> sorry SeanTAllen to let you hang here. just wanted to finish this: https://github.com/mfelsche/ponycheck/pull/17/files
<vaninwagen> thanks for your help, not it compiles and stuff :)
<vaninwagen> *now
<SeanTAllen> no no its ok
<SeanTAllen> also NICE!
<vaninwagen> concerning the docgen stuff: what about printing the actual unexpanded type (which is of more use for pony-noobs like me) and have some way to also show the expanded type
<vaninwagen> maybe a simple hover
<SeanTAllen> that would require an extensive reworking
<SeanTAllen> when docgen runs
<vaninwagen> damn
<SeanTAllen> it works on expanded type
<SeanTAllen> there is something that you lose when you do textual type
<SeanTAllen> that i cant remember
<SeanTAllen> something really valuabel
theodus has joined #ponylang
<SeanTAllen> sadly i cant remember what
<vaninwagen> is there no way to have both?
<vaninwagen> the expanded and the textual?
<vaninwagen> maybe we create an issue for it and collect feedback, maybe someone remembers?
<SeanTAllen> sylvan would remember
<SeanTAllen> but docgen runs at a point in time
<SeanTAllen> by that point the textual is gone
<vaninwagen> ok
<SeanTAllen> so it would require a reworking
<SeanTAllen> im not saying it shouldnt be done
<SeanTAllen> just that its not trivial
<vaninwagen> maybe this is stuff for when pony is in pony
<SeanTAllen> i remember that was the conversation sylvan and i had when i put it down
* vaninwagen still wonders how a literal pony in a literal pony would look like
<SeanTAllen> ha
<SeanTAllen> like a russian nesting doll of ponies!
theobutler has quit [Ping timeout: 246 seconds]
<SeanTAllen> o right, so
<SeanTAllen> when its textual
<SeanTAllen> it doesnt know what the types are beyond text
<SeanTAllen> so the info it uses to build links to other classes, that isnt there before its expanded
<vaninwagen> yeah, so not an option
<SeanTAllen> sylvan and i left it at the point of "we want both, both is ideal, both is difficult right now"
<SeanTAllen> maybe pony in pony is far enough along that we could start looking at having both
<vaninwagen> keepin the textual repr around in the ast would also be nice for formatting (which is totally not important otherwise)
<vaninwagen> or at least pointers to src-code (file, start byte, end byte)
<vaninwagen> i will create an issue tomorrow
<SeanTAllen> sounds good
<SeanTAllen> heck, someone MIGHT have done that since then and I didnt notice. But I don't think they did.
vaninwagen has quit [Ping timeout: 240 seconds]