by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • May 31 23:54
    kubo closed #9257
  • May 31 23:51
    kubo closed #9392
  • May 31 23:40
    jhass reopened #3722
  • May 31 23:34
    madblobfish closed #3722
  • May 31 21:24
    jhass opened #9393
  • May 31 17:46
    straight-shoota labeled #9385
  • May 31 17:45
    straight-shoota milestoned #9383
  • May 31 17:45
    straight-shoota milestoned #9391
  • May 31 15:58
    RX14 closed #9385
  • May 31 13:59
    jhass labeled #9374
  • May 31 13:59
    jhass labeled #9374
  • May 31 13:59
    jhass labeled #9374
  • May 31 13:54
    jhass labeled #8823
  • May 31 13:54
    jhass labeled #8823
  • May 31 13:45
    jhass labeled #9390
  • May 31 13:37
    oprypin closed #9278
  • May 31 13:36
    oprypin synchronize #9278
  • May 31 13:04
    kubo edited #9392
  • May 31 12:54
    kubo opened #9392
  • May 31 11:59
    asterite synchronize #9383
Daniel Worrall
@Daniel-Worrall
how would I get the bytes read?
I don't see anything exposed on HTTP::Client
Ah, streaming
From IRC (bridge bot)
@FromIRC
<jhass> yeah, you'd need to do something like IO.copy does but exposing the progress
Daniel Worrall
@Daniel-Worrall
yeah, no, Idk
Chris Watson
@watzon
Is there a flag that says what the target platform is? I know you can use flag?(:linux) etc to check if the target is linux, but what if I want to actually get the target? Any option besides if flag?(:linux) ... elsif flag?(:windows) ...?
From IRC (bridge bot)
@FromIRC
<jhass> what is the target then?
<jhass> if linux is not a platform to you
Chris Watson
@watzon
No, I mean I want to return the target platform as a string value rather than just checking if the target platform is a specific value. Something like
{% puts flag(:target) %}
# => linux

{% puts flag(:arch) %}
# => x86_64
Does anything like that exist?
Julien Reichardt
@j8r
I think you can have the target triple
emanzx
@emanzx

<jhass> eh, ran into the struct pitfall, fixed: ehttps://play.crystal-lang.org/#/r/96re

wow. thanks so much.. I will look into that. a lot of things are new to me. thanks again

From IRC (bridge bot)
@FromIRC
<jhass> @watzon: Well, flags don't really have keys, so how would you reference them? You could parse Crystal::DESCRIPTION I guess...
<jhass> might be better to shell out to uname though
Chris Watson
@watzon
I was just thinking Crystal might have some way to expose the target triple seeing as those flags exist. It looks like the LLVM method just returns the default target triple, not the one the program was built with.
From IRC (bridge bot)
@FromIRC
<jhass> yeah, no I don't think that exists in any way
<jhass> I mean it's just a little macro if else for the platforms you care about though
From IRC (bridge bot)
@FromIRC
<oprypin> so i'm on windows and getting the compiler to crash. all information i get is Nil assertion failed (NilAssertionError) because stack traces are not implemented. what are my options to track this down?
<oprypin> oh shit i just had the brightest idea
From IRC (bridge bot)
@FromIRC
<oprypin> class Object; def not_nil!(file = __FILE__, line = __LINE__); p! file, line; previous_def(); end; end
From IRC (bridge bot)
@FromIRC
<jhass> Yeah let's do that
<oprypin> ah damn, the only problem is that those constructs don't work either 😂
<jhass> I think we even have some issue comment somewhere suggesting that
<jhass> (including that in the message)
<oprypin> BUG: "!#{file}:#{line}!" at c:\code\crystal\src\nil.cr:106:10 should have been expanded (Exception)
<oprypin> hmm? im not sure what you're pointing at; if you still think you have a solution
<oprypin> im stuck still
<jhass> nah, just talking about your idea. I think somebody somewhere suggested having that generally
From IRC (bridge bot)
@FromIRC
<jhass> I think I had the idea at some point that you could have a kind of macro that you could call on a type instance and it would have access to its receiver AST node
<jhass> that would be helpful now, could've just redefiend not_nil! as such a macro method then
<jhass> idk, can you stick it into a debugger and let it print a backtrace for you?
<oprypin> my idea was just to try to solve the prior issue, but it didn't work
<oprypin> jhass: debugger, eh. i haven't had the best of time with that on Windows
<oprypin> maybe it's time for it again
<jhass> 0.35 makes the debug info a lot better fwiw
From IRC (bridge bot)
@FromIRC
<oprypin> jhass: im running master but don't forget that this is Windows
<oprypin> the story about debug info there is completely separate
From IRC (bridge bot)
@FromIRC
<jhass> mmh
<jhass> you would expect LLVM to abstract it at least somewhat
From IRC (bridge bot)
@FromIRC
<oprypin> latest fun one: gawk -i inplace '{ gsub(".not_nil!", ".not_nil!(" NR ")"); print }' src/compiler/**/*.cr
From IRC (bridge bot)
@FromIRC
<oprypin> ok cool that just made it crash somehow
From IRC (bridge bot)
@FromIRC
<oprypin> ok finally did it
<oprypin> but it worked!
George Dietrich
@Blacksmoke16
prob could make the default line = __LINE__?
not stupid if it works :p
From IRC (bridge bot)
@FromIRC
<oprypin> didn't work on Windows
George Dietrich
@Blacksmoke16
ah, welp