<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. :)
<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?
<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>
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.
<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"