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
Zarutian has quit [Quit: Zarutian]
<Perelandric> I have a class 'Foo', which in its constructor creates an instance of 'Bar', which gets assigned to a field of Foo...
<Perelandric> If I try to pass 'this' to the Bar constructor (as an interface), it fails because it sees the Foo object as 'tag'...
<Perelandric> However, if I create the Bar without passing 'this', but then assign 'this' on the very next line, it succeeds.
<Perelandric> They are basically the same operation. Is there a reason why the former would fail?
<doublec> Perelandric: probably because Bar could do things with the Fooable and it's not fully constructed
<doublec> Perelandric: whereas in the one that works, Bar cannot use the Fooable until a method on it is called.
<doublec> Perelandric: can you do _b.dosomething() before the _x assignment?
<Perelandric> doublec: Oh, that makes sense.
<Perelandric> Bar can't actually use Foo in its ctor that way.
<Perelandric> I'll try a method call.
<doublec> Hah, it can
<doublec> and segfaults
<Perelandric> I don't get a segfault, but my method isn't doing anything.
<doublec> Oops, no my code was wrong
<Perelandric> But I can call a method of Bar from the Foo constructor, as well as a method of Foo from the Foo via the Bar object.
<Perelandric> I did find a different kind of segfault earlier today.
<Perelandric> The code was very stupid of course.
<doublec> Looks like USize initializes to zero
<doublec> This prints the value of x before it is assigned: http://pastebin.com/qbNj82jQ
<Perelandric> Yeah, I wonder if that's reliable.
<doublec> This segfaults: http://pastebin.com/sUSDy7J0
<Perelandric> Yep, sure does. So it looks like it shouldn't be allowing that assignment after all
<Perelandric> ...at least until all fields are initialized.
<doublec> right
<doublec> 'this' is not a Foo until the fields are initialized
<Perelandric> Is it not a 'Foo', or is it a 'Foo tag'?
<doublec> Right, Foo tag is fine
<doublec> Perelandric: do you want to raise an issue?
<Perelandric> Sure, I can do one in a little bit.
<Perelandric> Thanks for the help!
<doublec> Perelandric: np, good spotting to find the initial problem
jemc has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
Perelandric has quit [Ping timeout: 250 seconds]
Scramblejams has joined #ponylang
<Scramblejams> Just got ponyc: src/libponyc/ast/ast.c:425: ast_id: Assertion `ast != ((void *)0)' failed.
SilverKey has joined #ponylang
<Scramblejams> ponyc was freshly git-pulled, running on Debian 4.3.0-1-amd64
<Scramblejams> http://pastebin.com/ShdE2RbD the culprit is on line 12, the crash occurred when I added the "val" to the function signature
<Scramblejams> Without the val it doesn't compile :-) but it doesn't assert, either.
jemc has quit [Quit: WeeChat 1.4]
jemc has joined #ponylang
<Scramblejams> Got another one, "ponyc: src/libponyc/type/subtype.c:1033: is_nominal_sub_x: Assertion `0' failed." Pastebin: http://pastebin.com/0Andgq90 Appears to be adding the "val" to line 17
<Scramblejams> Off to bed...
SilverKey has quit [Quit: Halted.]
graaff has joined #ponylang
graaff has quit [Quit: Leaving]
jemc has quit [Ping timeout: 244 seconds]
srenatus has joined #ponylang
doublec_ has joined #ponylang
mitchellvanw_ has joined #ponylang
bodie__ has joined #ponylang
amclain has quit [Quit: Leaving]
bodie_ has quit [*.net *.split]
doublec has quit [*.net *.split]
mitchellvanw has quit [*.net *.split]
bodie__ is now known as bodie_
doublec_ is now known as doublec
trapped has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
mrkishi has joined #ponylang
jsaacmk has joined #ponylang
runehog_ has joined #ponylang
<jsaacmk> good morning, this program causes a segfault when compiling with the latest docker for ponyc http://pastebin.com/mmZxN4Ec
runehog has quit [Ping timeout: 252 seconds]
Perelandric has joined #ponylang
<SeanTAllen> jsaacmk: i believe there's an issue open for that
<SeanTAllen> hmmm i cant find it, might not be. can you open an issue jsaacmk ?
<jsaacmk> sure
_andre has joined #ponylang
<SeanTAllen> thank you
<SeanTAllen> i'm pretty sure the issue is the recursive nature of your type definition
<jsaacmk> I'm going off of what I see in String.read_int since the tutorial section for generics isn't finished yet. I'm writing up an RFC for numeric parsing and I'm making an implementation to play with
<jsaacmk> what does the error "not enough type arguments" generally mean?
<Perelandric> Scramblejams' first issue can be reduced to this...
<Perelandric> fun msg(s: String val = String) => lambda()(s) => None end
<Perelandric> And the second one is reduced to this...
hibnico has joined #ponylang
<Perelandric> lambda() => let foo: val = Array[String] end
<hibnico> jsaacmk: it means that the type you are using has some generics and you didn’t fuly specify it, like writting `Array` rather than `Array[U8]`
<jsaacmk> what would be missing from this function: fun from[A: ((Signed | Unsigned) & Integer[A] val)]() => None
<hibnico> are you sure the error is from that line, not another line where this function `from` is being used ?
<jsaacmk> looks to be a calling issue. the error goes away if I don't use the function
<Perelandric> What does it generally mean when a program compiles with the "release" build but causes a compiler assertion fail with the "debug" build?
jemc has joined #ponylang
<hibnico> it means some code in the compiler is wrong, either the assertion or the code which triggered that assertion
<hibnico> the core team will probably be glad if you open a bug report with a test case
<Perelandric> hibnico: Thanks, I'll track it down and file a report. I was just curious if there was a general reason why it wouldn't cause any issue with 'release'.
<Perelandric> Maybe that's too broad of an inquiry.
<jemc> Perelandric: in general, you should not be seeing assert fails in the compiler - when you see an assert fail, it's typically because you're compiling code with an edge case that the compiler doesn't account for - the program should either compile cleanly or the compiler should print a compiler error and exit cleanly
<jemc> so whenever you see an assert fail, it's an issue that needs to be fixed
<Perelandric> jemc: Thanks. I think I just naively assumed that I'd also see some side-effect of the problem when my program runs.
<Perelandric> ...from a release build.
<Perelandric> Anyhoo, was mostly just curious. Seems come up with testing.
<jsaacmk> is there a reason why with strings, String.apply takes a USize index and String.substring takes ISize indexes?
<hibnico> substring supports negative offset, via String.offset_to_index, to reference index from the end
<hibnico> String.apply doesn’t, probably because it is a kind of low level function, which may be used very often, so should do the minimum
<jsaacmk> I see, thank you
flutters1y has joined #ponylang
SilverKey has joined #ponylang
flutters1y has quit [Client Quit]
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
flutters1y has joined #ponylang
SilverKey has quit [Quit: Halted.]
SilverKey has joined #ponylang
<flutters1y> Hello, is it possible to retrieve the env.out object from other places other than the create method in main. I'm using UnitTest framework, and i want to log some benchmarking informations to the console. so I used the log method on the testhelper object. the problem is that log messages are only displayed when running the program with the --verbose option and when running with that option the program
<flutters1y> would spit unwanted information like assertions informations etc. is there another neat and easy way to do it.
<Perelandric> I discovered the "debug" package the other day.
<Perelandric> It lets you use "Debug.out(msg)", and it only shows up when you compile with 'ponyc -d'
<Perelandric> But the, I'm a noob, so others may have other options.
<Perelandric> But then*...
<jemc> Flutters1y: ponytest's TestHelper can give you direct access to the `Env` it was created with: https://github.com/ponylang/ponyc/blob/662183366eb2c4176318f174cf2de1f6ae86034d/packages/ponytest/helper.pony#L22
<jemc> just use h.env.out
amclain has joined #ponylang
<flutters1y> Perelandric: thank you that 's useful
<flutters1y> jemc: thanks forgive my noobness :p , i should learn how to search in the source code.
<jemc> no worries - it's not always obvious
flutters1y has quit [Quit: Lost terminal]
<lisael> about benchmarks, it would be handy to have a standard benchmark lib, with documented good practices
<lisael> should I propose a RFC?
<lisael> I mean, I see a lot of commits stating they optimize things. With reliable, standardized microbenchmarks we could prove these statments
runehog_ has quit [Remote host closed the connection]
trapped has quit [Read error: Connection reset by peer]
trapped has joined #ponylang
<SeanTAllen> Proof is a wonderful thing
SilverKey has quit [Quit: Halted.]
hibnico has quit [Quit: hibnico]
SilverKey has joined #ponylang
SilverKey has quit [Client Quit]
<jsaacmk> Is there a reason why I128.addc isn't available?
runehog has joined #ponylang
SilverKey has joined #ponylang
kulibali has joined #ponylang
SilverKey has quit [Quit: Halted.]
Zarutian has joined #ponylang
SilverKey has joined #ponylang
Applejack_ has joined #ponylang
copy` has joined #ponylang
trapped has quit [Read error: Connection reset by peer]
<Scramblejams> Perelandric: Thanks for your response. Should I assume the compiler should be printing reasonable error messages rather than failing asserts, though?
<Scramblejams> Answering my own question after reading the other replies in the channel: Yes. :-) I'll file a couple of issues.
Applejack_ has quit [Ping timeout: 260 seconds]
Applejack_ has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
Applejack_ has joined #ponylang
jemc has quit [Ping timeout: 244 seconds]
SilverKey has quit [Quit: Halted.]
Zarutian has quit [Quit: Zarutian]
jemc has joined #ponylang
Applejack_ has quit [Ping timeout: 244 seconds]
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has joined #ponylang
Matthias247 has joined #ponylang
SilverKey has joined #ponylang
SilverKey has quit [Quit: Halted.]
Applejack_ has quit [Ping timeout: 260 seconds]
SilverKey has joined #ponylang
mrkishi_ has joined #ponylang
mrkishi has quit [Ping timeout: 260 seconds]
<Perelandric> Scramblejams: Yep, I think the first one should be giving an error about assigning a 'ref' to a 'val'
<Perelandric> and the second one should be a message about using 'val' only as a type.
mrkishi_ is now known as mrkishi
srenatus has quit [Quit: Connection closed for inactivity]
jsaacmk has quit [Quit: Page closed]
jemc has quit [Ping timeout: 244 seconds]
_andre has quit [Quit: leaving]
Zarutian has joined #ponylang
runehog has quit [Remote host closed the connection]
hibnico has joined #ponylang
Applejack_ has joined #ponylang
hibnico has quit [Quit: hibnico]
runehog has joined #ponylang
mrkishi_ has joined #ponylang
mrkishi has quit [Ping timeout: 260 seconds]
mrkishi has joined #ponylang
mrkishi_ has quit [Ping timeout: 244 seconds]
Applejack_ has quit [Ping timeout: 252 seconds]
Matthias247 has quit [Read error: Connection reset by peer]
SilverKey has quit [Quit: Halted.]
Zarutian has quit [Quit: Zarutian]