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
theodus has joined #ponylang
<theodus> 0.5.0 has been released: https://pony.groups.io/g/user/topic/0_5_0_has_been_released/2873649?p=,,,20,0,0,0::RecentPostDate%2FSticky,,,20,2,0,2873649
theodus has quit [Quit: Page closed]
amclain has quit [Quit: Leaving]
TwoNotes has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
jemc has joined #ponylang
mvzink has joined #ponylang
calmclam has quit [Read error: Connection reset by peer]
TwoNotes has left #ponylang [#ponylang]
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
mvzink has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 248 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 240 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
kk_ has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
kk_ has quit [Client Quit]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 240 seconds]
jemc has quit [Ping timeout: 268 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
_whitelogger has joined #ponylang
dinfuehr has quit [*.net *.split]
kajstrom_ has quit [*.net *.split]
Candle has quit [*.net *.split]
sjums has quit [*.net *.split]
mcguire1 has quit [*.net *.split]
shepheb has quit [*.net *.split]
dom96 has quit [*.net *.split]
malthe has quit [*.net *.split]
srenatus[m] has quit [*.net *.split]
irx[m] has quit [*.net *.split]
ohir has quit [*.net *.split]
Corwin has quit [*.net *.split]
cquinn has quit [*.net *.split]
CcxCZ has quit [*.net *.split]
bodie_ has quit [*.net *.split]
Unit158 has quit [*.net *.split]
yggdr has quit [*.net *.split]
lisael has quit [*.net *.split]
Fuuzetsu has quit [*.net *.split]
k0nsl has quit [*.net *.split]
mvzink has quit [*.net *.split]
DarkFox has quit [*.net *.split]
hakvroot_ has quit [*.net *.split]
adamkittelson has quit [*.net *.split]
atk has quit [*.net *.split]
prettyvanilla has quit [*.net *.split]
xshuiniu has quit [*.net *.split]
puzza007 has quit [*.net *.split]
bbhoss has quit [*.net *.split]
mankyKitty has quit [*.net *.split]
emilbayes has quit [*.net *.split]
jonrh has quit [*.net *.split]
mitchellvanw has quit [*.net *.split]
avsej has quit [*.net *.split]
jeremyheiler has quit [*.net *.split]
unbalanced has quit [*.net *.split]
sylvanc has quit [*.net *.split]
jtfmumm has quit [*.net *.split]
gornikm has quit [*.net *.split]
kushalp has quit [*.net *.split]
otremblay has quit [*.net *.split]
doublec has quit [*.net *.split]
BweeZ has quit [*.net *.split]
Xe has quit [*.net *.split]
M-hrjet has quit [*.net *.split]
ericbmerritt has quit [*.net *.split]
jmiven has quit [*.net *.split]
M-Ingo has quit [*.net *.split]
strmpnk has quit [Ping timeout: 247 seconds]
bbhoss has joined #ponylang
ohir has joined #ponylang
DarkFox has joined #ponylang
jonrh has joined #ponylang
sylvanc has joined #ponylang
darach has quit [Ping timeout: 256 seconds]
mvzink has joined #ponylang
darach has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
miou has joined #ponylang
miou has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
titi has joined #ponylang
<titi> hello
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
trapped has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
<titi> i'm a beginner. are there examples to use sqlite or another db? is ffi the only option at the moment?
mvzink has joined #ponylang
_andre has joined #ponylang
mvzink has quit [Ping timeout: 240 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
<Candle> titi: I have yet to see any examples that use a DB. I have some *ideas* on how I'd do it, just nothing yet.
<Candle> nothing concrete*
<titi> my only idea is ffi, is there another way to persist data which is available at the moment?
<titi> my searching the web has not been useful
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
gfmio has joined #ponylang
gfmio has quit [Remote host closed the connection]
gfmio has joined #ponylang
<lisael> titi: hi
<lisael> I guess for sqlite, ffi is the way to go, I don't think it's a good idea to re-write sqlite in pony
<lisael> for other dbs, I am writing https://github.com/lisael/pony-postgres
gfmio has quit [Client Quit]
<lisael> it's not usable at the moment, ( I only support I32 fields :D )
<lisael> I'm still looking for the best achitecture and API
<lisael> but it's here and you're welcome to contribute :D
mvzink has joined #ponylang
<lisael> The internal architecture is sort-of stable, now, I guess I should document a bit.
<titi> Why don't you think it's a good idea to re-write sqlite in pony? I cannot make any promise about using/testing (contributing to) pony-postgres, but it could be an alternative to look into. if only i could understand your advice.
mvzink has quit [Ping timeout: 241 seconds]
<lisael> sqlite is a self-contained db lib. The lib is almost its own spec, it would be very hard to rewrite something that produces exactly the same db files and to port all evolutions and bug fixes in a re-implementation
<lisael> postgres is client-server, the only part we have to implement to be pg-compliant is the protocol which is well defined and well bound
<titi> thank you
<lisael> the only documentation I read to write pony-pg is this chapter : https://www.postgresql.org/docs/current/static/protocol.html
<titi> ok
<titi> bookmarked
<titi> it will do as well as sqlite for my needs
<lisael> BTW, I'm not aware of a ffi-wrapper for sqlite, if you don't find one and go that way, could you release it a a separate library, please, titi ?
mvzink has joined #ponylang
<lisael> (i think we should define a common API for all SQL drivers, but I have not even documented pony-pg API. I have no proposition at the moment)
<titi> i'll contribute as much as i can to this
<titi> thank you
dinfuehr_ has joined #ponylang
mvzink has quit [Ping timeout: 250 seconds]
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 268 seconds]
NhanH__ is now known as NhanH
mvzink has joined #ponylang
mvzink has quit [Ping timeout: 260 seconds]
<SeanTAllen> there are a couple of sqlite wrappers out there. someone mentioned doing an "Awesome Pony" repo to start collecting together links.
<titi> 'pony orm' is unfortunately misleading: it's a python thing
<titi> i cannot find anything else
<Candle> lisael: common api for sql, like jdbc? ¬_¬ ?
<SeanTAllen> TwoNotes worked on a couple but he isnt online right now
<Candle> (In terms of, a common api would be great!, but try to avoid the mistakes that jdbc made)
<lisael> Candle: something like that, but much much lighter
<lisael> Candle: something like Pyhton's DBAPI is enough, it defines a couple of class and a dozen of methods
mvzink has joined #ponylang
goircbot has joined #ponylang
<lisael> titi: looks like SeanTAllen's link is what you need. I think it's short in terms of data types and roughly exposes the low level C API, but it's a great start, for you
goircbot has quit [Max SendQ exceeded]
mvzink has quit [Ping timeout: 240 seconds]
<titi> yes, sorry for not reacting.
goircbot has joined #ponylang
<titi> i'm wondering about databases and the actor model now. is there something i can read about it?
goircbot has quit [Max SendQ exceeded]
<SeanTAllen> what is the "it" in that sentence titi?
<lisael> how does well known actor models do ? Elixir? Akka?
<lisael> (I think I'll give a look at pdtwonotes' LMDB and leveldb wrappers too :) )
<malthe> i think erlang at least has a different model because it'll actually block the actor (synchronous).
goircbot has joined #ponylang
<SeanTAllen> in general, you probably want to approach it similar to how pony does TCPConnection. You have an actor that manages a database connection and can receive notification of events as they happen. its a good first approach to try. cant guarantee it is the right approach but in general, its a good place to start from.
<titi> it stands for "dbs and the actor model", i suppose that it must be done differently (unless using ffi)
<lisael> in pony-pg, at the moment I use notifier pattern a lot
<titi> thanks
<SeanTAllen> its also quite possible that you want/need promises to really make it work.
mvzink has joined #ponylang
<SeanTAllen> as malthe says, other actor models might not provide much help if they are synchronous
<SeanTAllen> if you database isn't in any way event driven, you could implement it ala File as a synchronous class BUT that results in serious scheduler issues if you have long running queries so, you should probably rule that out
jemc has joined #ponylang
<malthe> I think promises is the way to go since it accurately mirrors how the protocol works, at least in the case of pg.
<malthe> you send a query and its success or failure.
<malthe> SeanTAllen: did you see my promises-related question on the mailing-list?
<SeanTAllen> malthe: from when?
<malthe> 4-5 days ago about
<lisael> being a tcp client, the the postgres connexion is mostly an actor (https://github.com/lisael/pony-postgres/blob/master/pg/connection/listener.pony)
<lisael> that listen to a tcp connection, concatenates the messages, parse them and sends them to a subprotocol hanlder (one in https://github.com/lisael/pony-postgres/blob/master/pg/connection/conversation.pony )
<lisael> that in turn notifies a user-facing notifier when there's a result to expose (a row in a result or any event). I added message batching to avoid scheduler storms
goircbot has quit [Remote host closed the connection]
<lisael> I doubt this is needed for sqlite BTW
<malthe> lisael: can you batch rows too?
<malthe> python's generators are neat but lack buffering/batching really.
<lisael> yes, i do it internally at the moment,
<malthe> you could start a promise for N rows.
<malthe> seems like the js community benefited a lot from everyone just using promises for most APIs.
<malthe> (when applicable)
goircbot has joined #ponylang
<lisael> malthe: you mean internally or for the user ?
<malthe> for the user actually.
<lisael> what would be the API in your idea?
<malthe> instead of you providing a callback, or a notifier, you post a sort of request (e.g. for N rows of a query result) and get back a promise.
<lisael> (I don't use promises a lot, I don't know them)
<lisael> and if the result has more rows ?
<lisael> you post a second request at any time ?
<malthe> you know because number of rows returned equalled your N that it may have more rows.
titi has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<malthe> that said, you probably should be using a completely declarative / stream-based approach to processing query results.
<lisael> malthe: intersting, really, I'm adding a promise API before I try to make something usefull with the lib
goircbot has quit [Remote host closed the connection]
goircbot has joined #ponylang
<malthe> I do think that Pony's non-deadlocking design changes how you'll want to write code.
goircbot has quit [Max SendQ exceeded]
goircbot has joined #ponylang
<lisael> yup, I come from Python/asyncio, go, and elixir background in terms of async programming, and every time I'm frustrated because I'd like a blocking call, I recall why blocking is bad, and why I like pony, I calm down and I find a new way to do it :)
goircbot has quit [Remote host closed the connection]
<malthe> it's been said some times on this channel that pony really is a functional language, and in the sense of not having (emulated) blocking calls, it's true.
Praetonus has joined #ponylang
goircbot has joined #ponylang
goircbot has quit [Remote host closed the connection]
<malthe> SeanTAllen: the context of my example is that i'm trying to implement asynchronous name resolving since currently pony makes a blocking call.
xshuiniu has joined #ponylang
<malthe> I thought I'd try and model it as an `IPEndpoint` that can resolve to an `IPAddress` which is already an IP4 or IP6 address plus a 16-bit port.
<malthe> If this was a success, then it might improve the API to TCP connector/listener so that it doesn't need multiple constructors.
amclain has joined #ponylang
<SeanTAllen> I'm doing a lot of work on the TCP code in our fork of Pony which is resulting in a number of RFCs that are either written or will be written and we are doing a serious rewrite that might eventually result in ideas for mainline Pony once we validate them in our product.
jemc has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
trapped has quit [Quit: int random { /* ensure randomness */ return 3; }]
<malthe> sounds interesting
<lisael> anyone has a piece of code that connects to a unix socket ?
<lisael> (is it possible in the first place)
<malthe> it's possible, but there is no support for it in the stdlib currently.
<jemc> lisael: should be possible, but you'll need to deal with FFI and with asio events
<jemc> one of my short term goals is to try to abstract the IO-handling parts of actors like TCPConnection and ProcessMonitor
<malthe> it should be possible to rework the tcp code so that it can support any data stream.
<jemc> (so that we can add more stdlib IO types, and users can easily create their own as well)
<lisael> :/ I've never even read the code in asio, I suppose it's time :)
<jemc> lisael: if you needed a solution quickly, I'd suggest copying `net/tcp_connection.pony` and reworking to use unix sockets
<lisael> I'm not in a hurry, it's for postgres. I have a lot to do before re-working on connections
<lisael> however, I've guessed that the solution would look like tcp, so I wrote code to easily switch
<lisael> a common abstraction is exactly what I need here.
<jemc> yep
titi has joined #ponylang
titi has quit [Client Quit]
titi has joined #ponylang
titi has quit [Client Quit]
titi has joined #ponylang
Matthias247 has joined #ponylang
_andre has quit [Quit: leaving]
titi has quit [Ping timeout: 240 seconds]
Matthias247 has quit [Ping timeout: 248 seconds]
Matthias247 has joined #ponylang
Praetonus has quit [Quit: Leaving]
irx[m] has joined #ponylang
M-Ingo has joined #ponylang
srenatus[m] has joined #ponylang
M-hrjet has joined #ponylang
SeanTAllen has quit [Ping timeout: 251 seconds]
SeanTAllen has joined #ponylang