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
autodidaddict has quit [Ping timeout: 260 seconds]
amclain has quit [Quit: Leaving]
oldmanmike has joined #ponylang
oldmanmike has quit [Ping timeout: 268 seconds]
jemc has quit [Ping timeout: 260 seconds]
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Remote host closed the connection]
jemc has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
deep-book-gk_ has joined #ponylang
deep-book-gk_ has left #ponylang [#ponylang]
jemc has joined #ponylang
plietar has joined #ponylang
jemc has quit [Ping timeout: 240 seconds]
jemc has joined #ponylang
aceluck has joined #ponylang
endformationage has joined #ponylang
endformationage has quit [Quit: WeeChat 1.7]
jemc has quit [Ping timeout: 240 seconds]
aceluck has quit [Quit: Textual IRC Client: www.textualapp.com]
Matthias247 has joined #ponylang
vaninwagen has joined #ponylang
_whitelogger has joined #ponylang
_whitelogger_ has quit [Remote host closed the connection]
bimawa has quit [Ping timeout: 276 seconds]
bimawa1 has joined #ponylang
TheNet has joined #ponylang
TheNet has quit [Quit: Textual IRC Client: www.textualapp.com]
autodidaddict has joined #ponylang
_andre has joined #ponylang
plietar has quit [Remote host closed the connection]
plietar has joined #ponylang
plietar has quit [Ping timeout: 258 seconds]
plietar has joined #ponylang
vaninwagen has quit [Ping timeout: 240 seconds]
plietar has quit [Ping timeout: 255 seconds]
jemc has joined #ponylang
Praetonus has joined #ponylang
dougmacdoug has joined #ponylang
plietar has joined #ponylang
plietar has quit [Ping timeout: 255 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ponylang
autodidaddict has quit [Ping timeout: 260 seconds]
voldyman_ has joined #ponylang
voldyman_ is now known as voldyman
amclain has joined #ponylang
plietar has joined #ponylang
plietar has quit [Ping timeout: 240 seconds]
Matthias247 has joined #ponylang
<voldyman> can i build pony code as a static library?
plietar has joined #ponylang
<Praetonus> voldyman: It is possible with the `--library` compiler flag. It will generate a static library and a C header containing the declarations of your C-compatible types
<voldyman> awesome, just getting started with pony. getting this error w
<Praetonus> That functionnality is still very bare bones since not a lot of people are using it
<voldyman> couldn't locate this path
<voldyman> my target was to write a library and write a GUI in C++ or something
<Praetonus> Could you open an issue on GitHub with a minimal case and your build environment (OS, LLVM version, etc) for your error?
<voldyman> Praetonus: got it working (turns out ponyc takes a path not a file path :D), what you use for docs? the search on stdlib.ponylang.org is crap
<jemc> voldyman: for that information, `ponyc --help` is your best bet
aceluck has joined #ponylang
<SeanTAllen> voldyman: weclome. if you have concrete suggestions for improvement (and a willingness to pitch in thats even better) re docs etc that we'd welcome them. "crap" is not helpful. at best you are insulting work that someone did to get it to that state.
<SeanTAllen> pony is a volunteer project and everyone is moving it along out of a labor of love. whatever needs to be improved, we don't want to run down contributions that people made in the past.
<voldyman> i totally understand, what i meant was the search isn't very fast. i am actually looking up how to create a docset for Zeal or Dash
<voldyman> SeanTAllen: didn't want to insult anyone, sorry if it came out that way.
<SeanTAllen> i didn't take it that way but we do want to point out early on the types of interactions that we want to have.
<SeanTAllen> i dont have time to work on the stdlib site at this point but i do want to improve it
<SeanTAllen> if you want to bounce around ideas, need help getting something together etc, let me know
<SeanTAllen> i'm happy to pitch in some time here or there to move things along
<SeanTAllen> also voldyman, you apology is greatly appreciate. welcome to the community in general
<SeanTAllen> if you ever get stuck on something and need help, feel free to reach out to me personally and if i have time and the knowledge, i'll try to help you along.
<voldyman> sure, thanks a lot!
vak has joined #ponylang
<vak> hi all
<vak> is it possible to know for sure the sender of the message (i.e. the caller of the behaviour) ?
<vak> currently I am sending "this" explicitly as behaviour's argument, but this could be faked by any caller
<Praetonus> vak: No, there is no builtin way
<jemc> vak: if you need to be sure, your best bet is probably a "shared secret"
<jemc> that is, create an object (it can be an empty class), make sure both actors hold the object, and don't have them share it with unauthorized actors
<vak> Praetonus: is the info regarding the sender internally available in actor incoming mailbox?
<jemc> object identities are unforgeable (at least, without using FFI, and it's possible to limit which packages use FFI)
<SeanTAllen> vak: no
<Praetonus> vak: No. A message contains a vtable index, a memory allocation context, a message pointer used internally in the mailbox, and the behaviour arguments
<jemc> if you have a "shared secret" object, the actors can use a `tag` reference to it to compare the unforgeable identity of the object
<SeanTAllen> i like the shared secret idea jemc. its a bit like how capabilities work. this would be an interesting pattern.
<vak> jemc: in my case both the "right" and "wrong" senders (enquirers) are the actor instances of the same Actor, so the secret should be then a dynamic value... hm. Well, i'd skip it for now then it won't make the code easier for reading
<jemc> if I knew more about the "origin" of your requirement, I could probably give a better recommendation
<vak> jemc: if i manage to implement my little monster I'd be happy to share :)
<vak> guys, many thanks!
aceluck has quit [Remote host closed the connection]
aceluck has joined #ponylang
<SeanTAllen> i didn't really do anything but i'll say you're welcome anyway!
<SeanTAllen> i love a good you're welcome
aceluck has quit [Ping timeout: 260 seconds]
endformationage has joined #ponylang
plietar has quit [Remote host closed the connection]
TheNet has joined #ponylang
TheNet has quit [Client Quit]
TheNet has joined #ponylang
vaninwagen has joined #ponylang
vak has quit [Ping timeout: 260 seconds]
aceluck has joined #ponylang
aceluck has quit [Ping timeout: 246 seconds]
vaninwagen has quit [Ping timeout: 255 seconds]
_andre has quit [Quit: leaving]
aceluck has joined #ponylang
aceluck has quit [Ping timeout: 240 seconds]
krakers has joined #ponylang
<krakers> hey folks, how well is pony suited to embedded programming? thinking microcontroller, low level stuff, pherhaps bare-metal?
<SeanTAllen> krakers: at this time, the answer is probably no.
<SeanTAllen> pony has a runtime that depends on glibc (or musl) etc.
<SeanTAllen> with work it could be appropriate and its certainly something sylvan and i have talked about but its also something that someone from the community would need to drive forward.
<krakers> ok, i find the no-stop the world gc and some other points interesting for embedded stuff. i'm not all that informed about the runtime, is memory footprint an issue?
<Praetonus> krakers: The main issue is that it uses OS threads
<Praetonus> It should be possible to adapt the runtime to manually spin up threads for whatever microcontroller you're using
<SeanTAllen> there's enough gc controls that you should be able (in theory) to keep memory under control. the runtime itself uses a fairly low amount of memory but how constrained of a memory env are you talking about?
<krakers> Praetonus: Yes that is indeed a main issue.
<SeanTAllen> krakers: also Asio.
<SeanTAllen> the runtime is reliant on Epoll et al depending on the platform.
<SeanTAllen> the ASIO and threading code is nice and modular so replacing it should in theory be fairly straightforward.
<krakers> SeanTAllen: No concrete environment at this time, have anybode tried some particular rtos or similar in the past?
<SeanTAllen> darach: was doing something at one point i think, but i'm not positive. if anyone has, they haven't publicly talked about it.
<krakers> the language just seemed like it might be a good fit for tinkering stuff like arduino/raspberry pi (iot-craze)
<SeanTAllen> we used to do development on raspberry-pi iis
<SeanTAllen> we being sendence, the company i work at
<krakers> ok, interesting
dougmacdoug has quit [Quit: dougmacdoug]
<SeanTAllen> we don't however have CI for ARM so... there might be bugs or failures at this point
<SeanTAllen> the codebase has support for 32 bit ARM but we rely on the community for bug reports and verification that everything is working.
<SeanTAllen> we do our best to not break 32 bit ARM but again, no CI for it so its "best effort".
<krakers> SeanTAllen: Thank you for the information, as you say there is probably some community work (which im not competent to do) before it can be used in the embedded space, but i also take note that the language could be appropriate for this. Will be checking it out from time to time
<SeanTAllen> you're welcome krakers. if you ever get an itch to try, we'd be happy to help guide and lend a hand when you get stuck.
Matthias247 has quit [Read error: Connection reset by peer]
krakers has quit [Quit: Page closed]
autodidaddict has joined #ponylang
<autodidaddict> Is there a snippet somewhere that shows how to read a file into a string? I'm trying to figure out how to create a FilePath without passing the `env` variable down 30 levels into an actor hierarchy
<SeanTAllen> the "30 levels into the actor hierarchy" makes me wonder how you are doing intialization autodidaddict
<SeanTAllen> is there a connection between your question and the statement?
<autodidaddict> Just means I've got an actor a few levels removed from main
<SeanTAllen> it seems like you are asking how to do it without a FilePath, which you can't. you need to be given the capability of doing it.
<autodidaddict> ok, so I'll need to pass it from main down to about 3 actors.
<autodidaddict> ugly, but understood
<autodidaddict> is there a snippet to show how to read a file into a string using a FilePath?
<SeanTAllen> at Sendence, we generally do almost all our initialization "in Main", not really in Main but before the application "starts up"
<SeanTAllen> so that capabilities etc can be given
<SeanTAllen> its basically "by hand" dependency injection
<autodidaddict> so, create the filepath in main and then pass it to whoever needs it as a "root" ?
<SeanTAllen> this creates a FilePath:
<SeanTAllen> let path = FilePath(env.root as AmbientAuth, str)
<SeanTAllen> assuming you have AmbientAuth
<SeanTAllen> that could be used in "Main"
<autodidaddict> smooth
<SeanTAllen> the pass the path to where-ever
<SeanTAllen> we do that then
<SeanTAllen> pass the filepath to constructor of any actors that need it
aceluck has joined #ponylang
<SeanTAllen> like...
<SeanTAllen> In general, we aim to keep env purely in Main and create whatever capabilities etc are needed there and hand them off
<SeanTAllen> and then they can be further refined
<SeanTAllen> so perhaps an actor is given to the applicaiton directory and it can then narrow that down more for other actors etc
<autodidaddict> that makes sense
<SeanTAllen> I started us down the road of not using DI and after about 6 weeks we decided it was a very bad idea
<SeanTAllen> and that DI and creating everything needed for initialization was a much better diea
<SeanTAllen> failures inside actors create() method suck to deal with
<SeanTAllen> because now you have an actor that needs to tell the world it couldnt initialize itself
<autodidaddict> That's what the kernel panic is for
<autodidaddict> :D
<autodidaddict> unless I'm missing something, that paste doesn't show how to convert a file into a string
<SeanTAllen> o sorry
<SeanTAllen> right
<SeanTAllen> i was just showing it being passed along
<autodidaddict> ;) ok. Just double checking my own confusion
<SeanTAllen> _file.read(_msg_size)
<SeanTAllen> that returns an Array[U8] val
<SeanTAllen> full class definition
<SeanTAllen> you dont want to see the other far more complicated classes
<SeanTAllen> you can get a non mutable string from Array[U8] val with
<SeanTAllen> new val from_array(data: Array[U8] val) =>
<SeanTAllen> thats on String
<SeanTAllen> you could get a mutable one using:
<SeanTAllen> new iso from_iso_array(data: Array[U8] iso) =>
<SeanTAllen> if you had an iso Array[U8] (like you get from TCPConnection)
<autodidaddict> but that binary class you showed doesn't just produce an array, it produces an iterator of arrays
<SeanTAllen> or
<SeanTAllen> yes its an iterator
<SeanTAllen> btu you can call
<SeanTAllen> _file.read(some_size) to get an Array
<SeanTAllen> or _file.line to get a string for an entire line
<SeanTAllen> or
<SeanTAllen> ```
<SeanTAllen> thats also on File
<SeanTAllen> you can also call `lines()` that will get you a FileLines iterator
<SeanTAllen> check out `file.pony`
<SeanTAllen> there's a plethora of options once you have a FilePath