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
Matthias247 has quit [Read error: Connection reset by peer]
aedigix- has quit [Ping timeout: 250 seconds]
aedigix has joined #ponylang
jemc has quit [Ping timeout: 265 seconds]
<MagusOTB> hey so I have a n00b question that I'm not sure how to ask. I'm trying to reimplement 'cat' (write a program that prints its stdin to stdout) and I'm not sure how go to about using Env.stdin
<MagusOTB> like, I get how env.stdout.write() happens async, but I'm not sure how to set up env.stdin.IDK to deal with input
<MagusOTB> (If it's useful I come from python/javascript/C, never done this 'actor' thing before other than a halfa**ed attempt at pony about 6 months ago that ended in life being too busy to continue)
TwoNotes has joined #ponylang
TwoNotes has left #ponylang [#ponylang]
c355e3b has quit [Quit: Connection closed for inactivity]
mcguire has quit [Ping timeout: 260 seconds]
mcguire has joined #ponylang
amclain has quit [Quit: Leaving]
jemc has joined #ponylang
jemc has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 250 seconds]
dinfuehr has joined #ponylang
dinfuehr has quit [Ping timeout: 244 seconds]
jemc has joined #ponylang
graaff has joined #ponylang
jemc has quit [Ping timeout: 252 seconds]
andreaa has joined #ponylang
Matthias247 has joined #ponylang
_whitelogger has joined #ponylang
<SeanTAllen> Hi MagusOTB: the readline example in examples/ should give a small amount of help.
<SeanTAllen> This is sadly not documented. When you get it all figured out, a PR with documentation with Stdin would be really appreciated
<SeanTAllen> So...
<SeanTAllen> If you look in stdin.pony, you will see a Stdin actor and StdinNotify
<SeanTAllen> you want to implement a class that implements StdinNotify which you use when setting up Stdin (see readline example)
<SeanTAllen> The apply method is what you are particularly interested in, as input comes in, that method on the Notify that you implemented will be called. You can then do whatever processing you want to with it.
<SeanTAllen> Again, once you figure it all out, an update to documentation would be appreciated. I prefer answering questions on the mailing list because there is a record of them for people in the future. IRC logs are harder to search if someone else is trying to find out the answer to this question again in the future. Let me know if you get stuck and I'll help as I
<SeanTAllen> can.
aochagavia has joined #ponylang
<aochagavia> hi there
<aochagavia> what is the status of Pony on Windows?
<aochagavia> is there a way to use it without having to compile LLVM myself?
<SeanTAllen> aochagavia: there are packages available. your mileage my vary.
mrkishi has quit [Ping timeout: 265 seconds]
c355e3b has joined #ponylang
<aochagavia> Thanks! I will try that and let you know how it went
<SeanTAllen> the windows SDK is the most important part. without it, you will be out of luck but you shouldnt have to build llvm.
<SeanTAllen> we are looking for someone who wants to become a committer and take on being "the windows person" to handle issues of making sure things work across a range of windows releases, improve documentation, tooling etc.
<aochagavia> I think I will just spin up a VM
aochagavia_ has joined #ponylang
aochagavia has quit [Ping timeout: 268 seconds]
aochagavia_ has quit [Quit: Leaving]
dinfuehr has joined #ponylang
andreaa has quit [Quit: Connection reset by beer.]
andreaa has joined #ponylang
<SeanTAllen> ok
<SeanTAllen> ¯\_(ツ)_/¯. did you encounter a problem with the release in bintray?
mrkishi has joined #ponylang
aochagavia has joined #ponylang
<aochagavia> I just wanted to say I downloaded the latest nightly for windows and it just worked
<aochagavia> so thank you!
<aochagavia> by the way, what should I do if I want to hack on the standard library?
<aochagavia> I see the ponyc repo has a packages dir
<aochagavia> can I just edit those files? How do I run the tests when I am done?
<aochagavia> I think I just found out thanks to the readme
<aochagavia> I just tried compiling the stdlib tests and I ran into the following link error
<aochagavia> LINK : fatal error LNK1104: cannot open file 'libcrypto-32.lib'
<aochagavia> seems to be solved by downloading binaries of OpenSSL
jemc has joined #ponylang
<aochagavia> pcre2-8.lib seems to be necessary as well
jemc has quit [Ping timeout: 256 seconds]
aochagavia has quit [Quit: Leaving]
graaff has quit [Quit: Leaving]
jemc has joined #ponylang
<MagusOTB> SeanTAllen: What does 'Implement a clas that impments stdinNotify" mean exactly? I tried: https://gist.github.com/anonymous/2bc604d75d224758823bd9f1e00096dc/revisions
<MagusOTB> but I'm still getting errors
<MagusOTB> the error I'm getting is EchoHandler iso! is not a subtype of StdinNotify iso: iso! is not a subtype of iso
<MagusOTB> which seems... odd... what does the '!' mean?
<MagusOTB> I think I still have some fundamental misunderstanding of how actors/functions/classes/behaviors compose
<jemc> MagusOTB: `!` means an aliasing of a reference - the tutorial addresses this topic here: https://tutorial.ponylang.org/capabilities/aliasing.html
<jemc> doublec also has an excellent blog post on this topic as well: https://bluishcoder.co.nz/2016/05/04/bang-hat-and-arrow-in-pony.html
<jemc> if you still have questions after looking through those, feel free to ask them here for more info
<MagusOTB> I mean
<MagusOTB> TBH it's pretty difficult for me to wrap my head around fancier language features when the most complex program I'm capaable of actually writing is somewhere between "hello world" and "cat -"
<MagusOTB> I can't experiment with anything at this point because _nothing_ I've tried to do other than copy-paste-from-the-tutorial has worked
<jemc> the short answer is that `iso!` represents aliasing an `iso`
<jemc> and to avoid aliasing, you want to `consume` the original reference
<MagusOTB> yeah, but why does that result in my program not working? I'm confused as to how I created an alias in the first place
<MagusOTB> it looks to me like there's only one copy of a reference to an iso here
<jemc> you want to pass the object referenced by `handler` to the `env.input.apply` method, but to do so, you have to explicitly drop your reference to it (which you call `handler`)
<MagusOTB> okay...
<MagusOTB> so the recover ... end is supoposed to be in the parameters list to apply?
<jemc> passing `consume handler` will make the `handler` reference unusable in the rest of your function, meaning you can't break isolation even if you try
<jemc> so `env.input.apply(consume handler)` will work, and `env.input.apply(recover ... end)` will also work since you aren't assigning a local reference at all
<MagusOTB> aaah okay
<MagusOTB> so the fact that I assigned it to handler and then in theory could have passed the same 'iso' to multiple behaviors was the problem
<MagusOTB> which violates the point if iso
<jemc> yes, exactly
<MagusOTB> so ... I'm not trying to be nasty or anything, but I think the tutorial could use more "programs that do things" before it dives into language theory
<MagusOTB> I'd be interested in writing such things
<MagusOTB> Would y'all be interested in that?
<jemc> I think having more content like that would be great and always appreciated
<jemc> sometimes after a discussion we decide to limit what goes in the actual tutorial though
<MagusOTB> Cause like, at some point it gets to pattern matching and generics before it gets to "read a file"
<jemc> I don't personally have a lot of strong opinions about the structure of the tutorial, but others do have more of a vision for what the tutorial "should be"
<MagusOTB> I mean, IDC where it actually ends up
<jemc> out of curiosity, have you looked at the `examples` subdir in the `ponyc` repo?
<MagusOTB> but I feel like there's a wealth of information on how the language works, but not so much on using the stdlib to accomplish concrete goals
<MagusOTB> Yeah, it's mostly just straight code AFAICT
<jemc> having more example programs with a significant tutorial-style explanation docstring at the top could be rather valuable
<MagusOTB> and it's not organized in a beginner->advanced tutorialish sort of way, so I don't really know where to start
<jemc> that is, you can put triple-quote docstrings at the top of a file to document the contents of that file
<MagusOTB> SeanTAllen pointed me at one of them earlier, which was helpful
<jemc> we could also use more content in the "pony patterns" book: https://github.com/ponylang/pony-patterns
<jemc> which is meant to be more in depth than the tutorial on various specific topics
<MagusOTB> I mean, my primary beef with it as it is is that I can't _do_ anything with what I'm learning, cause the only thing the tutorial tells me how to _do_ is env.out.print()
<MagusOTB> and even then, it just sort of assumes I'll know how to get the required context to do that to where I need it by explaining the type system
<MagusOTB> but yeah, I'll read through this and see if I can add anything useful to the examples, I'm not sure how much use I'll be to start out cause I'm totally ignorant at this point
<MagusOTB> but hey
<MagusOTB> "those who cannot do, teach"
<MagusOTB> oh hey, stdin defaults to raw mode
<MagusOTB> that's cool
jemc has quit [Ping timeout: 256 seconds]
<andreaa> MagusOTB, I feel the pain :) I've found helpful to grep a lot into the package dir, between the stdlib and its tests there're a lot of goodies in there. EG buffered/reader.pony has an example of using Stdin.
<andreaa> oh and examples/ as well as jemc mentioned
jemc has joined #ponylang
Matthias247 has quit [Read error: Connection reset by peer]
otremblay has quit [Ping timeout: 245 seconds]
MagusOTB has quit [Remote host closed the connection]
jemc has quit [Ping timeout: 268 seconds]
otremblay has joined #ponylang