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
<dazedsheep> Why are underscores not allowed in names?
aturley has joined #ponylang
aturley has quit [Ping timeout: 264 seconds]
<SeanTAllen> underscores are allowed in names, 2+ in a row arent.
<SeanTAllen> so foo_bar is legal. foo__bar isn't.
dazedsheep has left #ponylang [#ponylang]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
runehog has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
juanjoc has quit [Quit: Leaving]
jemc has quit [Ping timeout: 260 seconds]
Corwin_ has quit [Ping timeout: 260 seconds]
Corwin_ has joined #ponylang
aturley has joined #ponylang
jemc has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
tlockney__ has quit [Ping timeout: 244 seconds]
tlockney__ has joined #ponylang
SilverKey has quit [Quit: Halted.]
graaff has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 276 seconds]
jemc has quit [Ping timeout: 244 seconds]
aturley has joined #ponylang
aturley has quit [Ping timeout: 264 seconds]
emancu has joined #ponylang
bb010g has quit [Ping timeout: 264 seconds]
bb010g has joined #ponylang
copy` has quit [Quit: Connection closed for inactivity]
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
emancu_ has joined #ponylang
mitchellvanw_ has joined #ponylang
emancu has quit [*.net *.split]
jeremyheiler has quit [*.net *.split]
mitchellvanw has quit [*.net *.split]
emancu has joined #ponylang
Arch-KT has joined #ponylang
jeremyheiler has joined #ponylang
mitchellvanw has joined #ponylang
felixonmars_ has joined #ponylang
mitchellvanw_ has quit [*.net *.split]
emancu_ has quit [*.net *.split]
Corwin_ has quit [*.net *.split]
DanC__ has quit [*.net *.split]
Arch-TK has quit [*.net *.split]
felixonmars has quit [*.net *.split]
malthe has quit [*.net *.split]
sylvanc has quit [*.net *.split]
felixonmars_ is now known as felixonmars
sylvanc has joined #ponylang
malthe has joined #ponylang
aturley has joined #ponylang
Corwin_ has joined #ponylang
aturley has quit [Ping timeout: 264 seconds]
DanC__ has joined #ponylang
Arch-KT is now known as Arch-TK
trapped has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
Guest78709 has quit [Ping timeout: 260 seconds]
bodie_ has quit [Ping timeout: 260 seconds]
Fuuzetsu has joined #ponylang
Fuuzetsu is now known as Guest7940
bodie_ has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
Candle has quit [Ping timeout: 244 seconds]
hakvroot has quit [Ping timeout: 244 seconds]
hakvroot has joined #ponylang
Scramblejams has quit [Ping timeout: 244 seconds]
Candle has joined #ponylang
Scramblejams has joined #ponylang
aturley has joined #ponylang
<yonkeltron> is there a preferred way to read lines from standard input?
<yonkeltron> FileLines only takes a File
<yonkeltron> and env.input is Stdin, which i don't understand *at all* so i must be missing something
aturley has quit [Ping timeout: 244 seconds]
<yonkeltron> ok so it looks like you can pass an actor to env.input and it'll receives Array[U8] which doesn't look like it'll help me.
<doublec> yonkeltron: there's an example in examples/readline
<yonkeltron> ok i'll check it out right now
<yonkeltron> thanks
<yonkeltron> oh my gosh this is a goldmine
<yonkeltron> this is a lot of effort...
<yonkeltron> but it's sort of...pretty at the same time
<doublec> Basically pass a Notify intance to env.input()
<yonkeltron> right
<doublec> It's apply method gets called with an Array[U8] when there is data
<yonkeltron> and it'll get data async
<doublec> yonkeltron: right
<doublec> yonkeltron: if you just want lines of data, do something like: https://github.com/doublec/imap-idler/blob/master/idle/main.pony#L109
<doublec> yonkeltron: ie. append to a buffer all data received. Check the buffer for a complete line and call something else when it gets it.
<yonkeltron> ok so maybe you just showed it to me and i missed it but the piece i'm missing is how to turn the Array[U8] into a string...
<yonkeltron> i don't know enough about conversions here in pony land
<doublec> The line() method of Buffer throws an error if there's no line, so it aborts if it only has partial data
<doublec> on the next async call it might have a full line, etc
<yonkeltron> is an empty array no data?
<doublec> I doubt it gets passed an empty array
<yonkeltron> because it'd have either EOF or a newline in it?
<doublec> right
<doublec> If there's no data the async method doesn't get called
<yonkeltron> ok. i think i get it.
<yonkeltron> but i don't like it.
<yonkeltron> is pony supposed to be that low-level?
<yonkeltron> where you can't even read a line of strings from stdin without a whole screen of code?
<yonkeltron> or is this just because it's early yet?
<doublec> yonkeltron: here's an example http://pastebin.com/JWXSGcjD
<doublec> yonkeltron: that just shows using stdio to get input
<doublec> yonkeltron: the verbiage is due to the async nature. It's possible to cut it down though depending on what you are doing.
<yonkeltron> well i'm working on my CSV code
<yonkeltron> just wondering about implementing a CsvStreamReader which takes in env.input
<doublec> yonkeltron: you'll notice that the apply method of the notifier gets called for each character entered in stdin - it doesn't wait for a line - which is why we need to accumulate the data
<yonkeltron> i notice it now. i think i see the wisdom.
<doublec> yonkeltron: you should maybe have a CsvStreamNotify instead
<doublec> yonkeltron: that in the apply method calls your Csv parsing
<doublec> yonkeltron: then that notifer would be passed to env.input()
<doublec> yonkeltron: or a tcpconnection, etc
<yonkeltron> it'd just be nice if it was also a File so you could hook it up to FileLines and read from it like any normal POSIX file, etc.
<doublec> yonkeltron: and would work in all thoses cases
<yonkeltron> i like the idea of that
<yonkeltron> and because of mailboxes, you don't need to worry about bytes arriving out of order
<doublec> If you don't mind doing everything in memory you could accumulate all data in a Buffer
<doublec> and on dispose() call your csv parser on it
<yonkeltron> i mind very much. some of these CSVs are many gigabytes.
<doublec> since dispose is called when the input stream is closed
<doublec> In that case a Csv notifier that does partial parsing is the way to go
<doublec> yonkeltron: something like http://pastebin.com/H7Jw1PPp
<doublec> yonkeltron: that would do it line by line and not read the entire file in memory
<yonkeltron> ok i'm trying to do what i want it to do without making a library for it
<yonkeltron> starting simple to get the job done
<yonkeltron> and then i'm going to see if i can't extract the pattern i'm looking for into a library
<yonkeltron> start simpler
<yonkeltron> doublec: the compiler errors i'm getting are crazy unintelligible. would you mind taking a look?
<yonkeltron> doublec: http://pastebin.com/1UiucU1m
* doublec looks
jemc has joined #ponylang
<yonkeltron> doublec: do i just need to throw some type documentation in there? can it not infer certain things?
<doublec> yonkeltron: the first error is due to reference capabilities needing to be added
<yonkeltron> ok
<yonkeltron> so let me check the docs and see what i need to give it
<doublec> yonkeltron: The "fun process" method defaults to box - but process passes 'file' to FileLines which needs a File ref
<doublec> yonkeltron: you can fix by changing to "fun ref process()"
<yonkeltron> why do i need to do that instead of
<yonkeltron> instead of making it let file: File ref
<doublec> If the method is a box method (the default) then 'this' is box
<doublec> So box as the origin, accessing a ref as the field gives a box
<doublec> And FileLines can't use a File box
<yonkeltron> it needs File refactor
<yonkeltron> sorry damn autocomplete
<yonkeltron> File ref
<doublec> Right
<yonkeltron> ok
<doublec> so changing "fun process" to "fun ref process" makes the origin a ref. Looking at the table you see an origin of ref accessing a ref field gives a ref.
<doublec> So it'll be a File ref which is what FileLines needs
<yonkeltron> ok
aturley has joined #ponylang
<doublec> The easiest way to think of it is methods default to read only access to fields
<yonkeltron> i think i understand that but i'll want to read more about it later to make sure i get it.
<doublec> So if a field is a ref it'll see it as a box.
<doublec> Since box is read only
<doublec> ie. the field is a ref, but within a read only method it sees it as if it was read only - a box
<yonkeltron> ok so wait a sec
<yonkeltron> if i get this right
<yonkeltron> a ref means i can read and write to it all i please but i can't share it with other actors
<doublec> right
<yonkeltron> so i guess it's good that my CsvReader is a class, then?
<yonkeltron> and not an actor...?
<doublec> yes
<doublec> I mean no
<doublec> sorry
<doublec> It can be an actor too since it only uses File internally
<yonkeltron> ok. i understand now.
<doublec> You're not passing it to any other actor
<yonkeltron> since i don't share it.
<doublec> right
<yonkeltron> i get it. ok i'm with you 100% now.
<yonkeltron> alright so i change that
<yonkeltron> and i'll edit my snippet
<yonkeltron> hang on
<doublec> This is probably the most common reference capability error to hit so if you learn to recognise that error you'll be able to resolve it
<yonkeltron> ok here we go: http://pastebin.com/1UiucU1m
<yonkeltron> i will try and internalize the cause and detail so that i can learn to see it
<yonkeltron> and btw that compiler error sucks
<doublec> So it's now saying that CsvLineHandler.create is expecting a val but you're passing it an iso
aturley has quit [Ping timeout: 268 seconds]
<yonkeltron> how did it become an iso?
<doublec> yonkeltron: it is probably defined as that by the return type of line.split
<yonkeltron> so if i change that to let split_line: Line val = line.split(delimiter)
<yonkeltron> i see. ok i'll need to read the docs more carefully
<yonkeltron> jemc: are you available for a design criticism?
<doublec> yonkeltron: fun split(delim: String = " \t\v\f\r\n", n: USize = 0): Array[String] iso^
<yonkeltron> i see it
<yonkeltron> ok
<yonkeltron> got it
<yonkeltron> so i convert it to val, which is allowed, and i'm good.
<doublec> yonkeltron: you can either change your function to accept an iso or use recover
<doublec> yonkeltron: s/recover/consume/
<yonkeltron> wait i converted it to val and now it compiles.
<yonkeltron> how can i get the object calling a behavior on an actor
<yonkeltron> origin?
<doublec> "this"
<yonkeltron> yeah but this is the current actor
<doublec> Or maybe I'm misunderstanding what you want
<doublec> You can't get the caller unless you pass it in
<yonkeltron> really?
<yonkeltron> i see...
<yonkeltron> ok
<yonkeltron> makes enough sense
<yonkeltron> this is not going well for me
<doublec> There's a learning curve for sure
<yonkeltron> yes. that is evident.
<yonkeltron> it just seems like when i add rcaps to things, it kicks off a cascade of compiler errors
<yonkeltron> i've reread through the rcaps sections of the tutorial twice now!
<doublec> yonkeltron: it will at first - when you get familiar with them it'll be easier
<yonkeltron> i just need to learn how it all fits together
<yonkeltron> precisely my thought
<yonkeltron> knowing the pieces isn't enough so i need more experience in order to see the larger picture
<doublec> When I was learning ATS, which has a type system that provides similar guarantees, I struggled to write even the simplest of programs
<doublec> It would take hours just to get a few lines to compile
<doublec> Then it clicked and I was productive
<doublec> It's the same with Pony
<yonkeltron> i'm not sure i can take a language with this high a learning curve to my team and be like "ok y'all! take this language which'll take weeks to learn and let's use it for big data"
<doublec> yonkeltron: What languages do you use at the moment?
<yonkeltron> we're pretty polyglot actually
<yonkeltron> Scala, Python, JavaScript, SQL, lots of shell scripting
<yonkeltron> i use some Ruby from time to time
<yonkeltron> i used to use Ruby loads more
<doublec> Node.js users will probably find the async nature of actors somewhat familiar
<doublec> Rust or C++11 users will find some of the reference capabilities stuff familiar
<yonkeltron> right so the other option i considered is Rust
<doublec> That too has a steep learning curve
<yonkeltron> also true
<doublec> It does have a lot more libraries and documentation though
<doublec> The concurrency story isn't as interesting in Rust
<yonkeltron> right, if the stdlib were a little more filled out, i think i might be a little bit more inclined to keep going with Pony
<yonkeltron> threads are a poor metaphor for concurrency
<yonkeltron> i really like a lot of what pony brings to the table
copy` has joined #ponylang
SilverKey has joined #ponylang
hakvroot has quit [Ping timeout: 250 seconds]
hakvroot has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 246 seconds]
Praetonus has joined #ponylang
SilverKey has quit [Quit: Halted.]
prettyvanilla has quit [Ping timeout: 244 seconds]
prettyvanilla has joined #ponylang
TwoNotes has joined #ponylang
TwoNotes has quit [Ping timeout: 276 seconds]
hakvroot_ has joined #ponylang
TwoNotes has joined #ponylang
Fuuzetsu has joined #ponylang
Fuuzetsu is now known as Guest52621
hakvroot has quit [*.net *.split]
Guest7940 has quit [*.net *.split]
<TwoNotes> How to obtain local instead of UTC time?
dazedsheep has joined #ponylang
dazedsheep has quit [Client Quit]
<jemc> I don't think that exists yet - best way forward would probably be to look at the ponyint_timegm C function and add a ponyint_timelocal C function to match
<jemc> TwoNotes: ^
<jemc> yonkeltron: I'm around now, if you have a question, though I'll be in and out as I take care of some other stuff today
aturley has joined #ponylang
aturley has quit [Ping timeout: 268 seconds]
Matthias247 has joined #ponylang
<TwoNotes> Apparantly, an actor can have funs called from other actors. (Ex: Registry)
prettyvanilla has quit [Ping timeout: 250 seconds]
prettyvanilla has joined #ponylang
aturley has joined #ponylang
<jemc> yeah, `fun tag`s can be
<TwoNotes> Am I right that the Registrar mechanism requires polling?
<jemc> useful for example if you have some kind of transformation to apply to make an argument sendable, but don't want to have to do it at the caller every time
<jemc> TwoNotes: not sure, I've not actually looked at the bureaucracy package in depth yet
aturley has quit [Ping timeout: 250 seconds]
<jemc> yeah, looks like it doesn't have any active notification mechanism (though such a feature would definitely be possible)
graaff has quit [Quit: Leaving]
jemc has quit [Ping timeout: 244 seconds]
<TwoNotes> I could not figure out how to use Promises anyway :) So I wrote my own registry that does do 'push' notifications.
<TwoNotes> You basically "subscribe" to a name, and it will call you back when a value becomes available or changes
<TwoNotes> All asynchronously
<TwoNotes> That could probably be generalized to a sub/pub event mechanism
Corwin_ has quit [Ping timeout: 260 seconds]
Corwin_ has joined #ponylang
Corwin_ has quit [*.net *.split]
Corwin_ has joined #ponylang
hakvroot_ has quit [Ping timeout: 250 seconds]
hakvroot has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]
Matthias247 has quit [Quit: Matthias247]
Matthias247_ has joined #ponylang
<SeanTAllen> I'm writing up Promises documentation soon. If you are looking for a "how to use", the use of Promises in the Logger test might be of help as well as http://patterns.ponylang.org/testing/output-only-actors.html
<SeanTAllen> TwoNotes: ^^
<TwoNotes> All I had to go on was the test module for Promises, and those are so cryptic it is hard to learn form them.
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
yonkeltron has quit [Ping timeout: 260 seconds]
yonkeltron has joined #ponylang
prettyvanilla_ has joined #ponylang
TwoNotes1 has joined #ponylang
TwoNotes1 has quit [Ping timeout: 244 seconds]
Matthias247 has joined #ponylang
Fuuzetsu has joined #ponylang
Fuuzetsu is now known as Guest66641
bodie__ has joined #ponylang
hakvroot_ has joined #ponylang
yonkeltron has quit [*.net *.split]
Matthias247_ has quit [*.net *.split]
hakvroot has quit [*.net *.split]
prettyvanilla has quit [*.net *.split]
Guest52621 has quit [*.net *.split]
TwoNotes has quit [*.net *.split]
Praetonus has quit [*.net *.split]
Scramblejams has quit [*.net *.split]
bodie_ has quit [*.net *.split]
bodie__ is now known as bodie_
SilverKey has joined #ponylang
aturley has joined #ponylang
aturley has quit [Ping timeout: 260 seconds]
<SeanTAllen> |jemc-bo1: you might enjoy this... https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527#.6oqbrji9q
SilverKey has quit [Quit: Halted.]
TwoNotes has joined #ponylang
TwoNotes has quit [Quit: Leaving.]
yonkeltron has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
Scramblejams has joined #ponylang
aturley has quit [Ping timeout: 250 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
aturley has joined #ponylang
aturley has quit [Ping timeout: 244 seconds]