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
jjpx has left #ponylang ["Leaving"]
Praetonus has quit [Quit: Leaving]
jemc has quit [Ping timeout: 260 seconds]
vaninwagen has joined #ponylang
jemc has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9]
jemc has quit [Ping timeout: 248 seconds]
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
vaninwagen has quit [Quit: Ex-Chat]
vaninwagen has joined #ponylang
samuell has quit [Quit: Leaving]
ShalokShalom_ has joined #ponylang
ShalokShalom has quit [Ping timeout: 240 seconds]
ShalokShalom_ is now known as ShalokShalom
muhajir has joined #ponylang
<muhajir> Hi.. I am curious, what's the meaning of '?' in ponylang?
<muhajir> For example this code fun factorial(x: I32): I32 ? => if x < 0 then error end if x == 0 then 1 else x * factorial(x - 1)? end
<muhajir> Oops, I don't know has to format it irc. I took the code from https://tutorial.ponylang.org/expressions/methods.html
samuell has joined #ponylang
<muhajir> *I don't know how to format it in irc
samuell has quit [Client Quit]
samuell has joined #ponylang
<muhajir> Anybody online?
<plietar> muhajir: The ? means partial
<plietar> In a signature it means the function may end with an error
<plietar> For instance in this case when x < 0
<plietar> Calling a partial function requires a ? in the call
<plietar> ie "factorial(x - 1)?"
<muhajir> Hmm, so that's the purpose. Thanks for explaining. I'll try to read about 'error' in tutorial book.
vaninwagen has quit [Ping timeout: 240 seconds]
_andre has joined #ponylang
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 240 seconds]
acarrico has joined #ponylang
<muhajir> Thanks @SeanTAllen, I am a little bit partial function. How is differ from regular function?
<muhajir> *I am a little bit confused
<SeanTAllen> a partial function may or may not compute a valid result
<SeanTAllen> a regular function always returns with its return type
<SeanTAllen> a partial function might raise an error because there is no computable result
<muhajir> Thanks, I have found the documentation about it
<muhajir> Btw is pony http server usable right now?
bitcrusher has quit [Read error: Connection reset by peer]
yggdr has quit [Ping timeout: 240 seconds]
yggdr has joined #ponylang
srenatus[m] has quit [Ping timeout: 240 seconds]
irx[m] has quit [Ping timeout: 264 seconds]
dtz has quit [Ping timeout: 264 seconds]
ada[m] has quit [Ping timeout: 246 seconds]
mindB has quit [Ping timeout: 246 seconds]
M-hrjet has quit [Ping timeout: 246 seconds]
jemc has joined #ponylang
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
irx[m] has joined #ponylang
acarrico has quit [Ping timeout: 240 seconds]
M-hrjet has joined #ponylang
dtz has joined #ponylang
ada[m] has joined #ponylang
mindB has joined #ponylang
srenatus[m] has joined #ponylang
acarrico has joined #ponylang
pduncan has quit [Ping timeout: 252 seconds]
muhajir has quit [Ping timeout: 260 seconds]
<SeanTAllen> what is your definition of usable muhajir? there is a serviceable http server. its not written for performance.
Matthias247 has joined #ponylang
nicolai86 has quit [Quit: ZNC - http://znc.in]
nicolai86 has joined #ponylang
endformationage has joined #ponylang
<endformationage> I wish there was a way to hold onto a partially applied constructor/fun/be such that one could use it to build up the call's arguments out of order (for example from behaviors supplying an arg).
<endformationage> In a sense to use the resulting object literal as temporary storage of the args until all are received.
<SeanTAllen> endformationage: how does this differ from the existing partial application support?
<endformationage> Specifically, I have in mind the supply chain pattern.
<jemc> does partial application support named arguments? I'm not sure because I've never used it that way
<jemc> if it does, then it would support the "out of order" requirement you're talking about
<SeanTAllen> ah
<SeanTAllen> that is what "out of order" meant there
<endformationage> I think it does, but the issue is holding onto the resulting new partial application which is of a different type
<endformationage> Yes, out of order args is supported.
<endformationage> Even in the tutorial :)
<jemc> yeah, just tested it :)
<jemc> endformationage: not sure how you could work around the "different type" issue in any strongly-typed system
<jemc> seems like a fundamental aspect of the situation to me
<endformationage> Yeah. I was wondering if somehow the resulting obj literal could be traited somehow, that way a resulting partial apply could re-trait itself? Perhaps I'm just making stuff up at this point.
<endformationage> In the same way you can type an obj literal: `object is FooBuilder` ...
<jemc> the signature is going to be different, though - especially if you're relying on named arguments
<endformationage> right
<jemc> I'm interested to know more about the problem you're solving, if you want to share
<endformationage> But could it not be an empty trait?
<jemc> I may have another idea
<jemc> endformationage: what does an empty trait do for you? you can't call anything on it because it has no methods
<endformationage> Could it allow you to hold onto object literals traited as such, but where each has different apply arity.
<endformationage> var: foo_builder: FooBuilder = Foo~create()
<endformationage> foo_builder = foo_builder~apply(where x = 42)
<endformationage> ...
<endformationage> foo_builder()
<jemc> no, I don't think it's possible to design a `FooBuilder` trait that works that way in a strongly typed system
<jemc> have you thought about just using an object with public `var fields`? :)
<jemc> `let foo: Foo`
<endformationage> This is what I've done. Basically keep a field for each parameter of the obj I'm building
<jemc> `foo.x = 42``
<jemc> `...`
<endformationage> Well, these are more complexe objects that require some building from other actors, and I wished not to type them (ComplexObj | None)
<endformationage> .. while they may fail building.
<endformationage> Like I said, the supply chain patterns
user10032 has joined #ponylang
<jemc> the hurdle you have to design around is that the type system has to know everything necessary to do the method call (or partial application)
<jemc> anything that tries to hide that info away from the type system is doomed to impossibility I think
<endformationage> OK. Probably not worth it, given it really only makes things a bit less verbose I suppose.
<endformationage> Thanks for the consideration
<jemc> you can hide details that aren't necessary using traits and interfaces, but if you're calling a method on a type, the type system has to have all the info it needs about that method call's signature
<jemc> endformationage: no problem
samuell has quit [Quit: Leaving]
<endformationage> Also, unrelated, for the second time I designed code with promises that ended up attempting to fulfill iso object. It reminded me of:
<endformationage> .. they were originally val fulfillments, but I ended up having to change them to be iso.
<endformationage> I just mean to mention a situation where a common promise interface would be useful, where the code design uses Promises, and the fulfilled objects refcap needs to change to iso for 'reasons' :P
<endformationage> .. That way one could still use promises.
<SeanTAllen> i love the "reasons"
<SeanTAllen> most things should use "reasons" as the explanation
<endformationage> SeanTAllen: I know, sorry not very helpful/useful :)
<SeanTAllen> no no
<SeanTAllen> i really do like "reasons"
<SeanTAllen> i say that all the time
<SeanTAllen> usually i saw, "because.... reasons"
<endformationage> Hah, I probably got it from you then.
<endformationage> I guess my main 'reason' is.. "I'm doing this to try and make it work."
<endformationage> Do it enough times and it actually does work. Until you need something else to work. :)
<jemc> I'd like to see somebody come up with a good way for `iso` and `val` promises to interoperate
<wuehlmaus> is there a pony repl other than playground.ponylang.org? i want something which i can invoke from the shell.
samuell has joined #ponylang
<SeanTAllen> wuehlmaus: nope
<wuehlmaus> SeanTAllen: thanks for telling me.
<SeanTAllen> you're welcome wuehlmaus. i never considered playground to be a REPL so you could probably get something like that working locally
<wuehlmaus> yeah, it's not a REPL, it's just something that is a bit similar to what i want.
<jemc> wuehlmaus: I may be missing something, but if you want something like the pony playpen that you can invoke from the shell, wouldn't that just be: `cd myproject && ponyc --debug && ./myproject`?
<wuehlmaus> agreed, perhaps even use watch
vaninwagen has joined #ponylang
<wuehlmaus> well, repeatedly use compilation is probably not what i want so 'watch' is probably a little much :)
<jemc> I usually work by setting up a `run.sh` in every project directory, and configure my text editor to have a hotkey to run that script
<jemc> and I modify that script over time as I work to do whatever repetitive task I'm currently working on
<jemc> when working on a pony project, the contents of the script is usually something like the command I gave above
<jemc> though sometimes I throw a `Makefile` into the mix to help with that too
<wuehlmaus> i found hsandbox a few years ago which is a nice python script to give me REPLs for almost every language i touch
<wuehlmaus> but it is easy in ponys case so probably not neeeded.
_andre has quit [Ping timeout: 240 seconds]
<endformationage> How can I destructively read an iso from a field that is a union of that iso with None? As in: `var field: (Foo iso | None) = None`
<endformationage> I want to consume it as an argument to a constructor.
vaninwagen has quit [Ping timeout: 240 seconds]
<jemc> endformationage: does this work for you? http://playground.ponylang.org/?gist=62b41d3a97e471886688d4a6853061e8
<endformationage> Hmm, no: It says the result is iso!, and that this would be possible if the subcap were more ephemeral
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
vaninwagen has joined #ponylang
* endformationage has to shutdown. Big thunderstorm inbound.
endformationage has quit [Quit: WeeChat 1.9]
samuell has quit [Quit: Leaving]
jemc has quit [Ping timeout: 264 seconds]
tscho_ has quit [Read error: Connection reset by peer]
tscho has joined #ponylang
vaninwagen has quit [Ping timeout: 248 seconds]
samuell has joined #ponylang
jemc has joined #ponylang
user10032 has quit [Quit: Leaving]
acarrico has quit [Ping timeout: 264 seconds]