<avsej>
but anyway at this moment I successfully passed FFI border, and now I have network packet in for on Array[U8] and can parse it using buffered.Reader with pure pony
<doublec>
So iso ensures there are no aliases allowing us to recover it to anything we want if we consume it. We create an Array based on the pointer and call clone() on that, recovering to an Array val.
<avsej>
yes, it works also. thank you
<doublec>
No problem. That's a very interesting API example - worth working through.
<doublec>
This also means there's no cheating val involved
polypus74 has joined #ponylang
<avsej>
I see
<polypus74>
apropos yesterday's little ws chat. found this interesting little project, may be of interest: https://libwebsockets.org/
<doublec>
nice find!
<polypus74>
yeah it's C and it's maintained, a doozee
mvzink has quit [Quit: Lost terminal]
<jemc>
polypus74: did you already start work on a redis client? If not, I was thinking I might take a look at building one
<jemc>
I have an application that I may want to port to Pony soon, and it needs a redis client
<polypus74>
jemc: no have not. if you start be sure to point me at the repo. will do likewise
<avsej>
is there HTTP parser in stdlib? I see net/http, but I haven't managed to find usable parser from Array[U8] to some structured representation
<avsej>
in rust they have HTTP parser accessible without HTTP client
<SeanTAllen>
because all the HTTP stuff was proof of concept
<SeanTAllen>
in the scope of the proof of concept, that is purely private
montanonic has quit [Ping timeout: 276 seconds]
<jemc>
avsej: we want to see an entirely new design and implementation for the HTTP stuff, something robust, general, and beyond proof-of-concept - that's a big RFC that's waiting to be made by some brave soul
montanonic has joined #ponylang
jemc has quit [Ping timeout: 276 seconds]
montanonic has quit [Ping timeout: 240 seconds]
hakvroot_ has quit [Remote host closed the connection]
unbalanced has quit [Quit: WeeChat 1.5]
montanonic has joined #ponylang
mcguire has joined #ponylang
montanonic has quit [Ping timeout: 255 seconds]
polypus74 has quit [Ping timeout: 260 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 248 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 255 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 265 seconds]
jemc has joined #ponylang
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 264 seconds]
polypus74 has joined #ponylang
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 250 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 260 seconds]
montanonic has joined #ponylang
pyon has quit [Quit: Fix config.]
pyon has joined #ponylang
Praetonus has quit [Quit: Leaving]
montanonic has quit [Ping timeout: 250 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 272 seconds]
montanonic has joined #ponylang
mcguire has quit [Ping timeout: 265 seconds]
montanonic has quit [Ping timeout: 264 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 265 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 276 seconds]
montanonic has joined #ponylang
amclain has quit [Quit: Leaving]
mvzink has joined #ponylang
jemc has quit [Ping timeout: 265 seconds]
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
montanonic has quit [Ping timeout: 264 seconds]
hakvroot has joined #ponylang
montanonic has joined #ponylang
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
montanonic has quit [Ping timeout: 260 seconds]
montanonic has joined #ponylang
montanonic has quit [Ping timeout: 255 seconds]
mitnk has joined #ponylang
<avsej>
good http library could boost the language itself. like in go, which has poor features as a language (consider removing item from array)
montanonic has joined #ponylang
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ponylang
TonyLo has joined #ponylang
pyon has quit [Remote host closed the connection]
pyon has joined #ponylang
rurban has joined #ponylang
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
rosstuck has joined #ponylang
rurban has quit [Quit: Leaving.]
rurban has joined #ponylang
M-hrjet has quit [Remote host closed the connection]
srenatus[m] has quit [Read error: Connection reset by peer]
irx[m] has quit [Read error: Connection reset by peer]
M-Ingo has quit [Write error: Connection reset by peer]
mitnk has quit [Remote host closed the connection]
rurban has left #ponylang [#ponylang]
irx[m] has joined #ponylang
srenatus[m] has joined #ponylang
M-Ingo has joined #ponylang
M-hrjet has joined #ponylang
jkleiser has joined #ponylang
montanonic has quit [Ping timeout: 272 seconds]
<TonyLo>
Hi, a question on Actor GC: Am I correct in assuming that blocked actors will not be GC'ed if there are references to them other than cyclic references?
<SeanTAllen>
actors are only gc'd when they reach quiescence
<TonyLo>
ok, can you define quiescense please :)
<SeanTAllen>
"in a state of inactivity or dormancy"
<TonyLo>
so If I have a several million actors most of which are dormant most of the time will the dormant actors be GC'ed? where dormant = not receiving messages most of the time
<TonyLo>
I am trying to understand the difference between Pony actors and Akka.net actors which I am familiar with
<SeanTAllen>
if you are capable of receiving work, then no
<TonyLo>
great, thought this must be the case but wanted to check, thx
<SeanTAllen>
if there is any way to get an ASIO event and have it bubble down to an actor via messages, it wont be GC'd
<SeanTAllen>
so for example, you would shut down an echo server by closing its socket, which removes the ASIO event notification which leads to quiescence and actors being gc'd
<TonyLo>
that clarifies nicely, thx
TonyLo has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
TonyLo has joined #ponylang
rosstuck has quit [Ping timeout: 248 seconds]
jkleiser has quit [Remote host closed the connection]
k0nsl has quit [Ping timeout: 248 seconds]
k0nsl has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
jemc has joined #ponylang
<jemc>
polypus74: started work on a pony redis client last night, but haven't gotten it cleaned up and repo'd yet - will let you know when I do
amclain has joined #ponylang
<avsej>
what is equivalent of "0x04x" in pony formatting? I thought something like this would work, but it does not http://dpaste.com/1J095JX
lispmeister has joined #ponylang
<avsej>
is it possible to actually put 'filler' before base specifier? it seems like 0x, 0b, 0o counted into width and fill character goes in the beginning or end only
lispmeister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
runehog has quit [Remote host closed the connection]
<mvzink>
avsej: hm, that seems wrong. you could use the "bare" versions such as `FormatHexBare` and add the "0x" yourself
<avsej>
ah, okay then. thanks
mcguire has joined #ponylang
rurban has left #ponylang [#ponylang]
<avsej>
how to specify USize literal or any other integer literal without defining variable?
<jemc>
avsej: `USize(88)`
<avsej>
and 88 is Int?
<jemc>
88 is whatever number you want the USize to be
<mvzink>
i poked around some, but am i correct in believing there is no printf-style format-specification parser in the stdlib?
<jemc>
mvzink: correct, such a thing doesn't exist in stdlib (or in any third party libs that I'm aware of)
<jemc>
you may find you have trouble implementing one similar to C's printf due to Pony's lack of var-args
<mvzink>
lucky for me, i don't believe in varargs or printf :) i'm actually just implemented a parser for terminfo capability strings
<jemc>
however, you might have more luck with an approach more similar to Qt's interp
<mvzink>
hm, i'm not familiar with Qt. what's that look like?
<jemc>
something like Printf("foo: %1, bar: %2")(foo)(bar) could be nice
<jemc>
rather than accepting variable amount of args, accept one arg at a time via an apply function, and store the formatted-string-in-progress as internal state of the Printf object
<jemc>
note that the example I gave is not quite what Qt interpolation looks like - it's what I was imagining for a Pony syntax
<mvzink>
ahhh. i like it.
<polypus74>
what about type safety?
<polypus74>
would be nice if format specifiers were type safe. so you could say %d and only accept inetegers etc
<polypus74>
i think the rust guys use macros to do it at compile time
<polypus74>
jemc: yes please let me know about redis when it's up. also, did you get my message about alpine glibc the other day?
Matthias247 has joined #ponylang
<polypus74>
apropos formatter, could be runtime checked so apply is partial
<mvzink>
polypus74: i would even be okay with printing out some garbage like "(hey you tried to give a string to %d, that's silly)"
<mvzink>
but again, like i said, i don't really believe in printf
<jemc>
polypus74: yes, thank you for the email about alpine glibc - it worked for you?
<polypus74>
jemc: yea, well hello world does. haven't tried anything more, but should work
<SeanTAllen>
runtime check == slow
runehog has joined #ponylang
<jemc>
regarding type safety of the formatter, you could maybe use named specialized methods instead of apply: `Printf("foo: %1, bar: %2).i64(88).usize(99)`
runehog has quit [Remote host closed the connection]
<polypus74>
jemc: that's an idea
runehog has joined #ponylang
<polypus74>
hey when's they sync meeting, in an hour or now?
<jemc>
an hour from now
<polypus74>
cool ty
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
<TonyLo>
Hi, when compiling examples/readline on windows I get the following error: packages\signals\sig.pony:161:10: compile error: no SIGWINCH. Any ideas on how to resolve this?
<TonyLo>
will this example only run on unix/linux/osx?
<jemc>
TonyLo: probably, though I can't say for sure since I don't use windows
<TonyLo>
ok, thx
Praetonus has joined #ponylang
<TonyLo>
Are there other aspects of the libs that will not function on windows besides sig.pony (and the Term package) - it would be useful to know if there is a list of incompatibilities.
mvzink has joined #ponylang
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
montanonic has joined #ponylang
mvzink has joined #ponylang
<jemc>
TonyLo: I agree that would be useful to windows developers, though I don't know of such a list existing at the moment of which packages have feature gaps on windows
<jemc>
if you file an issue ticket, we can try to get folks to collaborate on putting together such a list
<TonyLo>
will do, thx
Praetonus has quit [Ping timeout: 244 seconds]
<SeanTAllen>
Windows doesn't have signals
<SeanTAllen>
So that definitely won't ever work
<TonyLo>
yes, I understand that - I was hoping that there was an OS dependent build option for an equivelant capability so that the term package would work
<SeanTAllen>
Someone would need to add that. Process package is also currently Unixen only
<TonyLo>
Ok, thx
<TonyLo>
Sorry for all the nube questions but I am trying to find where the rough edges are (especially on Windwos)
TonyLo has quit [Ping timeout: 255 seconds]
<jemc>
TonyLo: I think you'll find that the language itself has pretty full support for windows, but our standard library packages are contributed by the community, and we only have a few community members at any given time that develop on windows
<jemc>
particularly the process package that SeanTAllen is the main non-windows package that comes to my mind - it's waiting for someone on windows to implement it
rurban has joined #ponylang
rurban has left #ponylang [#ponylang]
Praetonus has joined #ponylang
<SeanTAllen>
Answering questions is a big reason we are here tonylo. No need to apologize
<mvzink>
i was looking at https://github.com/ponylang/ponyc/issues/1208 since it came up in the sync call. i'm having trouble wending my way through the ponyc build process, but why does ponyc link/depend on ncurses in the first place?
_andre has quit [Quit: leaving]
<mvzink>
aha, i'm gonna guess colors for tests :)
<lisael>
Hi! is there a documentation on compile time "macros" (like the one that tells the filename and line of a statement)
<lisael>
I guess i can find this one in log package
<lisael>
But is there a list somewhere of these beasts ?
<lisael>
Do they have a name in the first place =D
<lisael>
?
<jemc>
lisael: no, there's no list of them - __loc is kind of a special case, and we haven't added any more like that
<jemc>
I'd like to see a complete user-definable macro system, but I'm personally not interested in pursuing that work further until we have a pony-in-pony compiler (which is still a long way off, unfortunately)
<SeanTAllen>
:(
<lisael>
jemc: like elixir's, I suppose
<jemc>
lisael: yes, I'd love to have a macro system that lets you define macros as functions that take an AST as an argument and return a transformed AST
<SeanTAllen>
We've been discussing turning our product into a "compiler". Macros might also work so we might do something awful along those lines. Startup caveats apply.
<jemc>
where that AST is a "deep" in-pony data structure
<jemc>
I started some work in this direction in a repo called pony-ast
<jemc>
(one of the many yaks that need to be shaved)
<lisael>
I have a branch where libponyrt exposes ast structs that i use as cffi in pony
<lisael>
ast is too deep it was a mess
<lisael>
and it's subject to constant changes
<jemc>
yeah, the very tricky part is finding a structure that is easy to manipulate and traverse in type-safe pony
<lisael>
right
<jemc>
I was converging (in my brain) toward looking at a persistent immutable data structure
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
<jemc>
but that still doesn't solve the type-safety implications
<jemc>
that is, the internal data structure in ponyc is very free-form and dynamic, which happens to not fit very easily into an actual pony paradigm - you end up with code littered with try (ast as ASTFoo) /* ... */ end
<jemc>
also, it would be nice if ASTFoo was already type checked to contain the correct number of children for that type
<lisael>
is there another approach... like creating a pure pony AST mock, let the user do theyr changes and finally consume the object in a cffi function. The C compiler is then in charge of merging this ast in its own
<lisael>
the compiler evaluates the code, finds a ASTClass and know how to include it in this pacage
<jemc>
lisael: we'll have to talk more about it later - unfortunately I have to run
<lisael>
ok :)
<jemc>
what I would say is that I was picturing that you wouldn't have to build the structure by hand, as a caller of the macro's API
<jemc>
that is, I could define something like @my_macro as a macro, then the user could do something like @my_macro("Hello", ("foo", "U8"))
<lisael>
right, sounds more like a ... macro :)
jmiven has quit [Quit: co'o]
jmiven has joined #ponylang
jmiven has quit [Client Quit]
<lisael>
in any case, cffi is not enough it has to be a compilers feature, like compile-time expressions
jmiven has joined #ponylang
<jemc>
another interesting goal that would be far less ambitious would be implementing a source-level preprocessor
<jemc>
that is, a preprocessor program written in pony that controls the ponyc and does ast replacement of the ast before feeding it to ponyc
<jemc>
anyway, I do have to run - we'll talk more later
<lisael>
yes, but it has to be clever enough to avoid the mess of a CPP
jemc has quit [Ping timeout: 276 seconds]
TwoNotes has joined #ponylang
TwoNotes has left #ponylang [#ponylang]
TwoNotes has joined #ponylang
<TwoNotes>
How can I define a fun that takes a Map as a parameter, without specifying the key and value types? Do I need to use a Generic for that?
<doublec>
TwoNotes: yes
<doublec>
TwoNotes: fun dosomething[K,V](m: Map[K,V]) => ....
<TwoNotes>
I don't need to give attributes for K and V? What if I want to restrict them, for example, to (String | USize)?
<TwoNotes>
I get a lot of 'type argument is outside its constraint' messages
runehog_ has joined #ponylang
<doublec>
TwoNotes: you can constrain them by an interface: fun dosomething[K: Stringable, V: Fooable](...)
<doublec>
TwoNotes: have you read the generics section of the tutorial?
<TwoNotes>
yes
Matthias247 has quit [Read error: Connection reset by peer]
<doublec>
TwoNotes: ok. Constraints and rcaps make generics a bit tricky to use. You need to make sure that the code in the function is valid for the constraints given.
<TwoNotes>
That gets a syntax error, unterminated type. It points to the ampersand saying it expected a ] by then
<doublec>
I just copied it from the Map source code
<TwoNotes>
Ok, I got the parens wrong.
mvzink has joined #ponylang
<TwoNotes>
Is there a way to iterate through a Map? It says 'next' is not defined for HashMap
<doublec>
TwoNotes: values(), keys() and pairs()
<doublec>
TwoNotes: for (k,v) in mymap.pairs() do ... end
<TwoNotes>
Ah, that was it. tnx!
<doublec>
np
<TwoNotes>
I am writing something sort of like Erlang External Term format encode and decode
<doublec>
Nice
<TwoNotes>
I have uints and Strings and Array[U8] working. Now working on Map
<TwoNotes>
Sort of a binary format JSON
<TwoNotes>
This is for my other project, adding secondary index support to my LMDB database wrapper
amclain has quit [Read error: Connection reset by peer]
amclain has joined #ponylang
TwoNotes has quit [Quit: Leaving.]
runehog has joined #ponylang
montanonic has quit [Ping timeout: 272 seconds]
<Praetonus>
I don't think this talk is available from ponylang.org: https://www.youtube.com/watch?v=R6T8ytKV6dc SeanTAllen, with the website refactor in progress, should PRs for new links on the website be delayed or is it good now?
<SeanTAllen>
Add a note one the talks issue and I'll add it
<lisael>
right, I can start a project with a couple of benchmarks and deploy scripts targeting a container. If the result is cool enough I open an issue to find a host server and I give the project away to ponylang. sounds like a plan ?
mvzink has quit [Quit: A merry Christmas to all, and to all a good night!]
<SeanTAllen>
give it a go lisael. if you have success, i'd bring it up during a Sync call or on the dev mailing list to move it forward.
<polypus74>
i'm having some trouble imagining how callbacks from C-land interact with the pony scheduler. any insights?
<polypus74>
i.e. when you pass a pony object and method as a callback to a C library, as described in tut
<SeanTAllen>
what about it are you having a hard time with polypus74 ?
<lisael>
SeanTAllen: I work hard on https://github.com/lisael/pony-postgres at the moment, but I can work on the speed center on my spare-time at work, where I don't have enough time and focus to write proper pony
<SeanTAllen>
that's fine lisael. we all know what it is like to be working on the project in our spare time.
<polypus74>
SeanTAllen: i suppose i'm thinking of an asynchronous callback, and in what context it would be handled. really i'm a bit vague on what exactly is confusing me. i thihnk i need to just sit and think about it a bit.
<SeanTAllen>
ok so for an async callback, you mean something like ASIO aka async io?
<polypus74>
yeah
<SeanTAllen>
for that, you register an event
<SeanTAllen>
there's a thread dedicated to handling async io which will deliver the message to the correct actor
<SeanTAllen>
at that point, its scheduled normally
<SeanTAllen>
the only thing different than inter actor messaging is that ASIO has its own thread
mvzink has joined #ponylang
<SeanTAllen>
so if you do --ponythreads 4, there will actually be 5 threads, 4 scheduler threads and an ASIO thread
<SeanTAllen>
make sense?
<polypus74>
ok that's making sense. which package need i look into? ty btw
<SeanTAllen>
look in for?
<SeanTAllen>
how asio works?
<polypus74>
yeah
<polypus74>
api
<SeanTAllen>
you want to set up an event yes?
<polypus74>
yeah
<SeanTAllen>
check out how it works in tcp_connection.pony
<polypus74>
ok
<SeanTAllen>
in particular the @pony_asio FFI calls it uses
<SeanTAllen>
and also the _event_notify behavior
<polypus74>
so i'm assuming that the functionality is not TCP specific, just what you want me to look at as an example right
<SeanTAllen>
its not TCP specific
<SeanTAllen>
its applicable to any async io
<SeanTAllen>
process manager does the same things
<polypus74>
ok just found AsioEvent primitive. on the right track. thanks again