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
atk has quit [Quit: Well this is unexpected.]
atk has joined #ponylang
jemc has quit [Ping timeout: 268 seconds]
acarrico has joined #ponylang
docstein has joined #ponylang
jemc has joined #ponylang
docstein has quit [Quit: Textual IRC Client: www.textualapp.com]
jemc has quit [Ping timeout: 260 seconds]
dipin has joined #ponylang
jemc has joined #ponylang
<emilbayes> Praetonus: ah ok, I guess I will have to use mangled symbol names for now. How about wrapping types from c++? I mostly just need to pass stuff around so will cpointer just work, or do I need to know the size of what I'm working with?
<Praetonus> emilbayes: If you're passing your objects by pointer then you can use `void*` (or a custom opaque type) on the C side and `Pointer` on the pony side. If you need to pass your objects by value then it unfortunately won't be possible as the FFI doesn't support it yet
<emilbayes> Praetonus: thank you! Sounds like the best way is to create a C wrapper that can also convert to pointers and dereference for me.
dipin has quit [Quit: dipin]
SenasOzys has joined #ponylang
Praetonus has quit [Quit: Leaving]
aturley has joined #ponylang
dipin has joined #ponylang
aturley has quit [Quit: aturley]
aturley has joined #ponylang
aturley has quit [Quit: aturley]
Pyrrh has quit [Read error: Connection reset by peer]
acarrico has quit [Ping timeout: 248 seconds]
jemc has quit [Ping timeout: 248 seconds]
jemc has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
endformationage has quit [Quit: WeeChat 1.9.1]
user10032 has joined #ponylang
vaninwagen has joined #ponylang
user10032 has quit [Remote host closed the connection]
jemc has quit [Ping timeout: 240 seconds]
samuell has joined #ponylang
cateigory has joined #ponylang
cateigory has left #ponylang [#ponylang]
codec1 has joined #ponylang
SenasOzys has quit [Ping timeout: 268 seconds]
dipin has quit [Quit: dipin]
SenasOzys has joined #ponylang
notsgnik has joined #ponylang
<notsgnik> hello ponylang aficionados , can everyone explain me why i get this error? "a question mark is required after this call"
samuell has quit [Ping timeout: 258 seconds]
<Candle> notsgnik: Because the function is partial (i.e. it can error) when you call it, you need to have a ? at the end to identify that it is that call within your function that can error.
<Candle> in "fun foo(...) ? => a(); b(); c()", which of a, b and c is the one that is causing "foo" to be partial? By having "fun foo(...) ? => a(); b()?; c()" you can see that it's b() that is the one that's causing "foo" to be partial.
<notsgnik> so how do i call it? Candle
<Candle> Just add a ? after the closing ).
<notsgnik> now it tells me "an actor constructor must handle any potential error"
<notsgnik> should i ad a "try ... else ... end" statement?
<notsgnik> *add
<vaninwagen> notsgnik, as actor constructors are asynchronous as actor behaviours, they are unable to signal errors to the caller.
<vaninwagen> there is a pattern for that: https://patterns.ponylang.org/creation/supply-chain.html
<vaninwagen> basically have a class wrappign and validating your arguments whose constructor is partial, then use this as parameter to your actor
<notsgnik> ok, i'll try this out :)
<notsgnik> the more i practice, the more i love this language
<notsgnik> i can't wait to really understand box,ref,iso stuff :D
<vaninwagen> notsgnik, i don't want to spoil you, but this is how it felt for me: https://media.giphy.com/media/w42xflWoSjDj2/giphy.gif
samuell has joined #ponylang
SirRolin has joined #ponylang
<SirRolin> where do I find the dump from "segmentation fault (core dumped)"?
<SirRolin> on ubuntu 14
<SirRolin> xubuntu 16*
<notsgnik> i just had a quick look at it but it seams to answer your question
<SirRolin> thx :)
<SirRolin> can still no tfind it
<vaninwagen> SirRolin what is ulimit -c giving you?
<vaninwagen> if it is 0, try setting it to unlimited
<SirRolin> which is -1 or "unlimited"?
<SirRolin> changed it to 100, and confirmed it has changed using ulimit -c
codec1 has quit [Ping timeout: 250 seconds]
<SirRolin> nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c 100 nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c 100 nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c unlimited bash: ulimit: core file size: cannot modify limit: Operation not permitted nyxia@nyxia-VirtualBox:~/Nyxia/project$ ps ux|awk 'project' nyxia@nyxia-VirtualBox:~/Nyxia/project$ $! 4749: command not found nyxia@nyxia-VirtualBox:~/Nyxia/project$ ps ux|awk 'project' nyxi
<SirRolin> well that iswithout linebreaks...
<SirRolin> nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c 100 nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c 100 nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c unlimited bash: ulimit: core file size: cannot modify limit: Operation not permitted nyxia@nyxia-VirtualBox:~/Nyxia/project$ ps ux|awk 'project' nyxia@nyxia-VirtualBox:~/Nyxia/project$ $! 4749: command not found nyxia@nyxia-VirtualBox:~/Nyxia/project$ ps ux|awk 'project' nyxi
<SirRolin> nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c 100
<SirRolin> nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c
<SirRolin> 100
<SirRolin> nyxia@nyxia-VirtualBox:~/Nyxia/project$ ulimit -c unlimited
<Candle> SirRolin: eeeeeek!
<SirRolin> dunno what to do
<SirRolin> I am sorry should prob had made a link to a pastebin or something
<SirRolin> instead
<SirRolin> found out what it where... *facepalm* (I didn't find the coredump but I outcommented allot of code) I referenced an actor to an actor that referenced that same actor
<notsgnik> SirRolin, still, they say on the page that if it compile it should never segfault
codec1 has joined #ponylang
<SirRolin> well it did seqfault
<notsgnik> i think that was what i've reed
<SirRolin> and it did compile
<notsgnik> write
<notsgnik> *right
<vaninwagen> this is definitely a glitch ion the matrix
<vaninwagen> *in
<notsgnik> vaninwagen, definitely :p
<vaninwagen> if you can reproduce it, please be so kind to create a github issue :)
<notsgnik> yes please
<notsgnik> otherwise using pony will be pointless
<SirRolin> yeah I will try and make a shortened version
<vaninwagen> SirRolin, thank you! :)
codec1 has quit [Quit: Leaving.]
samuell has quit [Ping timeout: 240 seconds]
samuell has joined #ponylang
<SirRolin> minimised it as much as possible (I think)
jtfmumm has quit [Read error: Connection reset by peer]
emilbayes has quit [Ping timeout: 264 seconds]
strmpnk has quit [Ping timeout: 264 seconds]
jtfmumm has joined #ponylang
voldyman has quit [Ping timeout: 240 seconds]
emilbayes has joined #ponylang
voldyman has joined #ponylang
samuell has quit [Remote host closed the connection]
strmpnk has joined #ponylang
codec1 has joined #ponylang
samuell has joined #ponylang
SirRolin has quit [Quit: Page closed]
SirRolin has joined #ponylang
SenasOzys has quit [Ping timeout: 248 seconds]
SenasOzys has joined #ponylang
acarrico has joined #ponylang
<notsgnik> can it be that we have 3 sub behavior? like 'dbe', 'gbe', 'sbe' keywords? so like in a switch case or a typed function call, it will decide ( regarding the context ) to run the code using the server behavior, the GPU behavior or the default behavior?
<vaninwagen> can you elaborate? what should those different behaviours be about?
<notsgnik> if you giove the program configuration info like an amazon cloud
<notsgnik> it will execute the sbe
<notsgnik> if you use the gpu flag it use the gbe
<notsgnik> if you use the 'be' keyword the program decide
<notsgnik> it will also be nice that he try runing diferrent behavious like sbe/gbe/dbe and select the best case for each for best performence
<vaninwagen> like an amazon cloud? what does this mean? and what does gpu mean in this context? you cannot just execute arbitrary behaviors on a GPU if that is what you mean. A GPU is a pretty restricted environment.
<notsgnik> or even have a neural net that selectem regarding the contexte ( like the number of connexion to an api or the load on calculs )
<notsgnik> what i mean is if the programer write his actor with those 3 beaviours dbe, sbe, gba
<notsgnik> the running program will have 3 way of doing 1 function
<notsgnik> regarding the context he may decide witch is the best to use
<notsgnik> and the context can be a variety of things like load etc...
<notsgnik> even neural net prediction that change on the fly the context beaviours
<notsgnik> if you add this , pony will be a really really nice language to compeate with :)
<notsgnik> for go and rust
<notsgnik> maybe amazon can be interested in sutch a thing
<notsgnik> what do you think?
_andre has quit [Ping timeout: 248 seconds]
_andre has joined #ponylang
alxs has joined #ponylang
alxs has quit [Client Quit]
<codec1> Hi
<notsgnik> hi
<notsgnik> maybe even a tbe for tpu's
alxs has joined #ponylang
<codec1> Does Pony standard libray have utility functions to read common numeric type (U8, I8, ..., F32, F64) from a chunk of bytes?
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
<Candle> codec1: Not that I've seen. My current project attempt is just using bit-wise operators.
<Candle> Entertainingly, it needs to do things like read an U32 from 1,2,3 or 4 bytes.
<codec1> mine too
<codec1> I think that will be a nice addition to the standard library
<codec1> Candle, does your code is open-source?
<codec1> Because I will like to grab those functions if you can share them
<Candle> I'm considering a PR for builtin to add U{8,16,32,...}.from_big_endian_bytes(bytes: Array[U8])
<Candle> codec1: I got bogged down in generics over the weekend, so not *yet*
alxs has joined #ponylang
<Candle> codec1: The signed 2's-complement ones will be more complicated. ( my generics testcase is http://playground.ponylang.org/?gist=d8e4286eec37ca4b70112af759663fac )
<codec1> acutally, I think it would be best to provide bigEndian and littleEndian plus one that use the current architecture one
<codec1> and If I may suggest it would be even nicer if it can read from a U8 array with an offset
alxs has quit [Client Quit]
<Candle> codec1: For what do you need this btw?
<codec1> SDL2 wrapper
<Candle> Ok, we're not doing the same thing then :p
<vaninwagen> codec1, you can try https://stdlib.ponylang.org/buffered-Reader to transform byte arrays into numerics
<codec1> basically, I have got struct that I read as an U8 array, and rebuild the meaningful data from the raw bytes
<codec1> vaninwagen, isn't for network data?
<Candle> vaninwagen: That looks like it will always eat 4 bytes for a U32 and 8 for a U64 (... etc)
<vaninwagen> codec1 yeah it basically represents 1 codec that is shared between Reader and Writer
<vaninwagen> would be nice to make this adaptable
<vaninwagen> Candle ^
<codec1> sorry, I didn't understand what you mean. Can you rephrase please?
<Candle> vaninwagen: I see your point, allow the 'u32_be' style functions to read 1,2,3 or 4 bytes into a U32.
<Candle> My concern with that is that it ends up as quite a complicated API.
<vaninwagen> Candle, basically delegating the actual serializing/deserializing function to a Codec class that contains the actually implementation and is provided in the constructor of both Reader and Writer
<vaninwagen> with the current behavior as the default
<Candle> My other concern is that it's a stream, so is harder to re-read arbitrary bits of the input.
<Candle> (Which is one of my reqirements)
<vaninwagen> codec1, the Reader wraps a bunch of byte arrays and allows it to extract numeric types, lines, booleans etc. from it
alxs has joined #ponylang
<vaninwagen> codec1, Writer does the other way - you write numerics, strings etc. to it and at the end you will get a bunch of byte arrays out when calling done()
<vaninwagen> this is basic serializing and deserializing - but with a fixed codec
<Candle> Currently peek_u16_be(offset) reads 2 bytes from the input starting at offset; it wouldn't be *too* hard to convert that to a peek_u16_be(offset: USize, len: USize = 2).
<codec1> I see, actually I was confused because there was 2 "codec" words in your previous sentence, and I thought the two were about me
<codec1> by the way if I have an Array[U8 val] ref can I use it without duplicating it to a Val one ?
<vaninwagen> codec1 maybe you can recover it to val
<codec1> since the append function only accept val I think I have to duplicate the whole thing to a read only capablities to feed it into the buffered reader
<codec1> well the array should be Ref I think because it is muted through an FFI call
<vaninwagen> codec1 but this works only if you have control over creation of the array. e.g. if you get a Array[U8] ref passed in as parameter, you cannot recover it
alxs has quit [Quit: Bye y'all!]
<vaninwagen> codec1, if you pass a ref Array to the reader, this can mess up the state of the reader quite badly
alxs has joined #ponylang
<codec1> indeed, actually the array size is fixed at creation time, but it's inner values can be mutated through FFI
alxs has quit [Client Quit]
<codec1> acutally, does an array can be val and its inner data mutated?
<codec1> I mean can
<vaninwagen> codec1, you can only see the array elements as val through an Array[X] val
<vaninwagen> so no mutation there
<codec1> that what I expected
<codec1> that is a bit unfortunate that the way buffered-Reader is written make it not usable for my use case
alxs has joined #ponylang
<codec1> I think I will try do to an RFC to change that, it shouldn't be too difficult
<Candle> I'll see if I can do an issue & PR to add the len parameter to the Reader functions, as it suits my use-case.
<codec1> Candle, I didn't understand why you need a varying length
<codec1> for example, if you want an U32 you need to read exactly 4 bytes right?
<Candle> Because the input can be something like 0x02 [type if data is U32] 0x03 [length of data is the next 3 bytes] 0x33 0xF4 0x42 [3 bytes of data - the top 8 bits of the U32 are all 0]
<codec1> vaninwagen, is the reader desctructive ? I mean does it gets rid of byte read to keep an array size as small as possible?
<vaninwagen> codec1, it can't as all it has are Array[U8 val] val which are read-only
<codec1> sorry, my question does not make any sense, the array is val so it cannot shrink it
<vaninwagen> codec1, aye
<vaninwagen> Candle, it might be a bit more twiddling but this can be done with Reader
<Candle> vaninwagen: Sure, read a U8, shift it by 16, then read a U16. Though it'll get really fiddly with the i{16,32,...} varients.
<vaninwagen> true
jemc has joined #ponylang
jemc has quit [Client Quit]
jemc has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
samuell has quit [Remote host closed the connection]
samuell has joined #ponylang
samuell has quit [Client Quit]
dipin has joined #ponylang
SirRolin has quit [Ping timeout: 260 seconds]
vaninwagen has quit [Ping timeout: 252 seconds]
alxs has joined #ponylang
alxs has quit [Client Quit]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Client Quit]
alxs has joined #ponylang
Pyrrh has joined #ponylang
samuell has joined #ponylang
codec2 has joined #ponylang
codec1 has quit [Read error: Connection reset by peer]
codec1 has joined #ponylang
codec2 has quit [Read error: Connection reset by peer]
codec1 has quit [Quit: Leaving.]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
codec1 has joined #ponylang
alxs has joined #ponylang
alxs has quit [Quit: Bye y'all!]
alxs has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
vaninwagen has joined #ponylang
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
alxs has joined #ponylang
alxs has quit [Client Quit]
alxs has joined #ponylang
user10032 has joined #ponylang
bimawa1 has joined #ponylang
bimawa has quit [Ping timeout: 268 seconds]
alxs has quit [Quit: Computer's gone to sleep. ZZZzzz…]
xllndr has joined #ponylang
jemc has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
SenasOzys has quit [Ping timeout: 264 seconds]
vaninwagen has quit [Ping timeout: 250 seconds]
xllndr has quit [Quit: Leaving]
user10032 has quit [Quit: Leaving]
codec1 has quit [Read error: Connection reset by peer]
samuell has quit [Quit: Leaving]