<mollymorphic>
1) reple expects a pygments compatible lexer to do syntax coloring in the repl, I just patched reple to turn coloring off if there's no lexer available
<mollymorphic>
(can always go back and add that)
<mollymorphic>
2) reple makes assumptions about how things are compiled which are incompatible with ponyc (ie per file compliation vs package directories)
<mollymorphic>
so basically not doable atm without opening some PRs to make reple more flexible
<mollymorphic>
I can do that if theres interest
<mollymorphic>
or alternatively if there's something I'm missing let me know
<mollymorphic>
otherwise I'll consider it a fun exercise n call it a day
<mollymorphic>
n I just realized Im logged in from my laptop so I prolly won't see replies to this >.<
<mollymorphic>
but ya hit me up on twitter if you want me to finish
dx_ob has joined #ponylang
Nawab has quit [Quit: Leaving]
dx_ob has quit [Remote host closed the connection]
Nawab has joined #ponylang
_whitelogger has joined #ponylang
<vaninwagen>
mollymorphic: that would be a nice workaround for not having a real repl
<mollymorphic>
ya, it would be nice to have colouring I'll probably do that last
<mollymorphic>
can either wait for that to be merged or hack something together
<vaninwagen>
We would probably need to update it to the current state and ping the maintainers
<vaninwagen>
So you would be better off hacking sth
<mollymorphic>
ya none of the problems are particularly difficult it just depends on how the reple maintainer wants to handle things
<mollymorphic>
it dumps everything in the same temp directory and creates new files for each iteration
<mollymorphic>
so if you point ponyc at that tmp directory it obviously chokes
<vaninwagen>
In the same temp dir?
<vaninwagen>
Understood
<mollymorphic>
ya it creates a new file every time you add a line repl0, repl1 etc
<mollymorphic>
I'm not sure why, I just turned that off to get it to work
<vaninwagen>
Maybe to "cache" previous states
<mollymorphic>
ya presumably something like that
<vaninwagen>
Maybe a good change for pony would be to create a new dir everytime, call it repl1 etc and write a main.pony file to it
<mollymorphic>
yea it's basically just a bunch of little tweaks to make how reple works more configurable
<mollymorphic>
if the lexer is only for coloring you should be able to turn it off
<mollymorphic>
the ability to either turn off incremental filenames or put them in new directories
<mollymorphic>
I added a template variable {output_dir} which points to the tmp file it's working with, as it only gives you the name of the generated code file
<mollymorphic>
stuff like that
<mollymorphic>
I'll open a couple PRs and see what the maintainer said
<mollymorphic>
*says
<mollymorphic>
I could have sworn theres a couple other similar projects like this
<mollymorphic>
but I imagine they might have similar problems
_whitelogger has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ponylang
_whitelogger has joined #ponylang
mollymorphic has joined #ponylang
Foaly has joined #ponylang
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
mollymorphic has quit [Ping timeout: 250 seconds]
Foaly has joined #ponylang
Foaly has quit [Quit: eating]
Foaly has joined #ponylang
erip has joined #ponylang
<erip>
Ahoy, all.
<erip>
I have a ponycheck question -- does anyone here have some experience with it?
<erip>
I am trying to create a laws library for algebraic structures and would like to be able to test things generically. Seems like prop-based testing is the right way to do this.
<vaninwagen>
erip: ponycheck author here, ask me anything
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]
<erip>
I guess there are two unrelated questions. 1. Is there a `Generatable` train (or similar)?
<erip>
I didn't look deeply on the microsite, but didn't see it in the README (sorry for the lazy q)
<vaninwagen>
There is no such thing as a Generatable trait, you need to specify a generator explicitly or combine one from givrn ones, e.g. from the ponycheck.Generators primitive
<erip>
Ok, so basically if I have some class that I'd like to generate, I better be sure it's composite constructor arguments are generatable
<vaninwagen>
You'd need to build a generator for your class from whatnis given or you build your own custom generator from scratch
<vaninwagen>
With the two generators for your two somethings
<erip>
Ok, that looks good. I was looking for a `Property2`, but couldn't find one.
<erip>
zip2 looks good
<vaninwagen>
Yeah, there is no Property2, adding one would be awesome, but needs a lot of code duplication and refactoring...
<vaninwagen>
erip if you find something missing, hit me up here or create a ticket in the repo, i'll try to add it
<erip>
It looks neat. Just trying to wrap my mind around how all the pieces fit together. :)
<erip>
I have a property defined with a `gen()` that zips some number of generated elements together, check. Now I'd like to do something like `for all generated elements, check this property about them`
<vaninwagen>
The Ponycheck.for_all stuff is just a shorthand for creating an anonymous property within a unittest. So where your question marks are there should be the same assertion as in your property above
<vaninwagen>
Using for_alland creating your own Property1 explicitly is basically two flavors for doing the same thing
<erip>
My goal is to abstract this into monoidal combination laws. Not sure if it'll be possible since there's no way to enforce a Generatable constraint, but maybe there's a clever way to do that.
<erip>
i.e., without the constraint
endformationage has joined #ponylang
<svdvonde>
@SeanTAllen let me know if you have a moment to discuss my messages from earlier this week. If I'm not mistaken I can hang around here for a couple more hours today :-)
<svdvonde>
No worries if you're not here or if you don't have the time. What I will probably do is pop into irc occasionally to check if you're there coincidentally
<SeanTAllen>
hi svdvonde
<svdvonde>
oh hi
<SeanTAllen>
i cant remember what the question was
<svdvonde>
No worries, it was quite something
<svdvonde>
I'll recap
<SeanTAllen>
ive been doing html and css for the last day for updated pony tutorial site
<SeanTAllen>
its not something im good at
<SeanTAllen>
and ive forgotten everything except html, css, and my name
<svdvonde>
So at some point we were talking about code reuse for actors, and you said "There's no way to take something like TCPConnection and add additional functionality. More important, there's no way to take the notify class that specializes it and send it messages which is very limiting."
<svdvonde>
so some context as to where I'm coming from: I am looking into code reusability for actors and I'm searching for a convincing use case for the things I've come up with
<svdvonde>
and a tcp network stack seems pretty convincing enough
<svdvonde>
so I've been pondering about what you said about the TCPConnection actor and TCPConnectionNotify class, but I don't see what's so limiting by not being able to send messages to a TCPConnectionNotify instance
<erip>
If my tests have a dependency, is it better to create two bundle.json files -- one for the source and one for the test?
<svdvonde>
Perhaps this is something pony-specific, but if it's not, then I might be able to use something similar as a motivating example for what I'm doing
<SeanTAllen>
svdvonde: ok, so lets think about if you want to write a protocol.
<SeanTAllen>
actually thats not a good example
<SeanTAllen>
svdvonde: its basically the framework/library problem
<SeanTAllen>
as it currently stands TCPConnection is a framework
<SeanTAllen>
you can only do what it provides
<vaninwagen>
erip you can put the test deps in the normal bundle.json too, if they are not referenced from the release code, it is not included in the binary
<SeanTAllen>
let's say i have a bunch of that i'm connecting in an IRC type fashion
<SeanTAllen>
actually svdvonde, this is too hard to explain without writing a lot of code and seeing the problem in action
<SeanTAllen>
sorry
<erip>
Excellent. For some reason, I thought I'd need to do something like `use "..ponycheck"`, but it looks like it works fine as expected
<svdvonde>
Fair enough, it's a complex issue
<erip>
I have an interface with an abstract method and a method that calls that abstract method -- the compiler is telling me that abstact method's value is `None`. :-( Is this expected?
<erip>
"couldn't find 'foo' in 'None'"
<vaninwagen>
erip: can you share the code that exhibits this behaviour?
<erip>
let me try to come up with a simple repro. it's embedded in some lib tests now
<svdvonde>
SeanTAllen: Related but different question, is the fact that TCPConnectionNotify is an interface to be implemented by a class, which is called (synchronously) from TCPConnection part of the issue? If it was an actor there would be no way to "specialise" or "extend" it
<svdvonde>
because then I understand what you mean with layering a protocol on top of the tcp network stack; the protocol on top would have to reimplement the inner workings of TCPConnection
<svdvonde>
That is, of course, if you use actors - when using classes developers can use all of the standard stuff like inheritance and traits
<erip>
I'm sure there's more good info in the refcap errors, but I'm too new to 'get' them. :)
<erip>
FWIW, there are only unrelated ref cap errors in my real code
<vaninwagen>
The foo() method on StringBar needs a return type
<vaninwagen>
So the compiler assumes it is None
<erip>
Yeah, I tried `Foo[String]` and `FooString`; neither seemed to satisfy it
<SeanTAllen>
svdvonde: there's no inheritance in pony
<erip>
I can confirm that I omitted the return type in the real code, but like I said: a parameterized return type and a concrete return type don't satisfy the method
<svdvonde>
SeanTAllen Good point. I was thinking in general software engineering terms :-)
<erip>
just realized that my last message caused de Morgan to roll over in his grave
<vaninwagen>
erip: thisnis because StringFoo as a primitive has the default capability of val, while Foo[T] expects to be ref
<erip>
neither parameterized return types nor concrete return type...
rjframe has joined #ponylang
<erip>
so I suppose `Foo[T]` should be declared `trait val`?
<erip>
or `interface val`
<vaninwagen>
Those default refcaps are a common source of errors
<vaninwagen>
If you want it to be immutable, yes, that is the way
<erip>
heh - I'm learning!
<erip>
slowly, but surely.
<vaninwagen>
erip and by the way, there are so few people using ponycheck, you are basically shaping what is idiomatic, so go ahead
<vaninwagen>
erip dont give up
<vaninwagen>
You're getting there
theodus has quit [Quit: Page closed]
<erip>
@vaninwagen, one last ponycheck question for today... I am trying to use a method of an interface within the `Ponycheck.for_all` lambda, but it's telling me that the method cannot be captured. Seems like the lambdas can't close over `this` -- is that true?
<erip>
That might be a more general pony question than a ponycheck.
<vaninwagen>
you can assign this to another variable and use it under that name
<erip>
hmm
<vaninwagen>
But if you close over this your lambda becomes a capability of ref i think
<vaninwagen>
And it needs a val in for_all
<erip>
yeah, so my interface is constrained to val
<vaninwagen>
A val lambda is one that doesnt close over anything
<erip>
I'm trying to do `let this_obj = this`, but it's claiming that `this_obj` must be sendable, which I'd expect it to be
<vaninwagen>
But i am not 100% sure
<vaninwagen>
I would have to try it myself
<erip>
`interface val` should be sendable if I understand val correctly. :-)
<vaninwagen>
this most likely has a refcap of ref, which is not sendable
<vaninwagen>
Yes val is sendable
<vaninwagen>
But you might have a ref reference in your hands
<vaninwagen>
If you add a type to this_obj, you find out
<vaninwagen>
Being very explicit about types and refcaps is a good habit if you are starting to learn pony
<vaninwagen>
The sugar and shorthands are very useful if you like to type less, but can be confusing
svdvonde has quit [Quit: Page closed]
erip has quit [Ping timeout: 256 seconds]
<SeanTAllen>
vaninwagen: how's your html/css with relation to responsive stuff?
<vaninwagen>
non-existent :(
<vaninwagen>
I can google
<vaninwagen>
Thats all
<vaninwagen>
I can try to help, but i will only really be available for painful stuff like this start of january
acarrico has joined #ponylang
acarrico has quit [Ping timeout: 250 seconds]
rjframe has left #ponylang ["Leaving"]
acarrico has joined #ponylang
<SeanTAllen>
that's ok
Nawab has quit [Remote host closed the connection]
Nawab has joined #ponylang
Nawab has quit [Remote host closed the connection]
Nawab has joined #ponylang
acarrico has quit [Ping timeout: 268 seconds]
Foaly has joined #ponylang
mollymorphic has joined #ponylang
<mollymorphic>
so reple is kinda fun for testing little expressions and stuff, but gets a bit awkard around things like importing packages - you have to think a little about what it's doing behind the scenes
<mollymorphic>
I think it's good to have, but I wonder if you couldn't get some of the same benefits with something like ponyc --watch
Foaly has quit [Quit: Now 'mid shadows deep falls blessed sleep.]