<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>
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>
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