Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 03 2017 15:52
    @dom96 banned @Octopoda7
  • Feb 12 2017 23:57
    @dom96 banned @zzz125
  • Dec 23 2016 19:43
    @dom96 banned @Izrab
Alexander Ivanov
@alehander92
after all this blocking hm
see you after 9 :D
From IRC (bridge bot)
@FromIRC
<Zevv> ProfessorEevee: oh I think this channel is the only reason I hang out with the language
<Zevv> I don't program, but the people here are nice and spart
<FromDiscord> <ProfessorEevee> Yeah idk, it's kind of cool, though
<Zevv> sure is
<FromDiscord> <ProfessorEevee> because I come from Python and a little bit of both C++ and Rust
<FromDiscord> <ProfessorEevee> and this is just like the child of the aforementioned
<Zevv> the good thing of a small user base is that there's a clear sense of a community still
<FromDiscord> <ProfessorEevee> Yup, I can see that
<Zevv> there's dozens of us :⁠)
<Zevv> no clue where 10k stars on github come from though
<FromDiscord> <ProfessorEevee> I didn't even realize there was a repository
From IRC (bridge bot)
@FromIRC
<Zoom[m]> Does creating of a result var postponed until the end of the proc, unless I use it earlier in the body?
<Zoom[m]> I mean, I'd like to use a temporary variable insread of result and move it to result at the end
<Zoom[m]> But I don't want to do it if the result is already there
<Zoom[m]> I guess I should inspect C myself, but may be you can give me a quick answer
<Zoom[m]> Or, I guess I should comply and use result everywhere instead
<PMunch> It is created as the first thing that happens in the procedure
<PMunch> Why don't you want to use result?
From IRC (bridge bot)
@FromIRC
<Zoom[m]> I'm not used to :⁠)
<Zoom[m]> I don't like the sound of it. If it's created first, how can I replace the initialization with my own?
<Zoom[m]> For example, for arrays. Some types are filled with the default values, such as array. If the proc returns an array and has some user-defined initialization in the body, how can I avoid double init?
<Zoom[m]> * Some types are filled with the default values, such as an array. If the proc returns it and has some user-defined initialization in the body, how can I avoid double init?
Helmut Jarausch
@HJarausch_gitlab
it's me again, sorry. My first trivial macro failed. I want a macro 'd_echo' which expands to 'discard' if a compile time constant 'DEBUG' is true.
Otherwise it should generate an 'echo' statement. Here is what I tried
const DEBUG {.booldefine.} = false
import macros
macro d_echo(Msg:varargs[string]) =
when DEBUG :
let source = """
echo (Msg)
"""
result= parseStmt(source)
else :
result= parseStmt("discard")
This fails since Msg got lost in parseStmt. What am I missing?
From IRC (bridge bot)
@FromIRC
<Zoom[m]> Sorry, I'm probably speaking nonsense. My mental model is still shaky.
From IRC (bridge bot)
@FromIRC
<PMunch> Zoom[m], well Nim doesn't really have user-defined initialisation
<PMunch> It just inits everything to 0
<PMunch> But you can throw on {.noInit.} on the proc to avoid even that from happening
<PMunch> By the way, I'm streaming later if you didn't catch that earlier :⁠)
<Zoom[m]> But if it was lazy, and you could move to result then you could avoid double init
<Zoom[m]> Ahh, that's better
<Zoom[m]> Please, tell me If I'm concerned over stupid things
<PMunch> I think you are :⁠P
<PMunch> Well, the init takes a little bit of time, but it's so little so it only really matters if you reaaally need to optimise something
<Zoom[m]> You can tell me this every time it happens, I need to "world check" my ocd
<PMunch> Typically the safety of knowing that default values are all zeros is better than the very tiny delay in nulling out some memory
<PMunch> I mean it's a valid concern, but in reality it's not that big of an issue
From IRC (bridge bot)
@FromIRC
<Zoom[m]> It's really an OCD. If I know I'm going to iterate over a container and fill it anyway, it just leaves a nasty feeling if you know you're not its first
<PMunch> Well if it helps it isn't iterated over
<PMunch> It's just a single call to clear the memory
<PMunch> Like a memset(result.addr, 0, sizeof(result))
<Zoom[m]> You're right
<Zoom[m]> You're streaming in 15 minutes, right?
From IRC (bridge bot)
@FromIRC
<PMunch> That's the plan
<PMunch> https://youtu.be/i4pDnyxC6HM <- Not live yet, but I think that will work once it's up and running
<PMunch> Hmm, it says 72 minutes though..
<PMunch> That's a bug
<PMunch> I keep forgetting that Firefox forces UTC+0
<ForumUpdaterBot> New thread by Treeform: Is there some thing like newSeqNoInit?, see https://forum.nim-lang.org/t/7139