by

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
Kaushal Modi
@kaushalmodi
umm.. it's plain email
Arne Döring
@krux02
yea
I kno
Ghost
@ghost~5a1ecef8d73408ce4f80e118
TheLemonMan: if I download repeadetly from http://localhost:8080/blob/size/100000000 not at the same time it still increases ram by much; now I'm from 365mb at 925mb
From IRC (bridge bot)
@FromIRC
<TheLemonMan> I think that happens because the cycle checker threshold grows as the heap gets larger and you end up overallocating
Ghost
@ghost~5a1ecef8d73408ce4f80e118
so it's a bug?
on Python I never reach more than 80mb
why does it say: [GC] occupied memory: 704745664 isnt that cleaned before increasing size?
From IRC (bridge bot)
@FromIRC
<TheLemonMan> let Araq tell if it's a bug or not (a feature perhaps? :⁠)
Ghost
@ghost~5a1ecef8d73408ce4f80e118
I mean I understand that the gc increases total amount when it thinks it doesnt has enough free memory left, but afaik I shouldnt have any occupied mem and it tells me I have 700mb occupied
From IRC (bridge bot)
@FromIRC
<miran> hey all! i've (finally) started experimenting with macros. is there any tutorial about macros?
<miran> dumpAstGen is great, but i still have trouble connecting everything into a coherent macro
Vindaar
@Vindaar
@miran: dumpTree or from within a macro treeRepr as well as repr itself are really useful too. I don't know about any real tutorials though (besides what's in Nim in Action, but to me that was way too advanced when I first read it)
for me just playing around (sometimes with macros other people wrote) helped the most
I wanted to learn macros in the beginning, but looking back what held me back the most, was not realizing what might be possible with a macro and what isn't
From IRC (bridge bot)
@FromIRC
<miran> ok, i've manged to create a type declaration for a ref object, and a proc that receives an instance of that object and does something with it. now i need to create an instance and call the proc - i'm not sure how to do it
Kaushal Modi
@kaushalmodi
Sorry @Vindaar, I was supposed to get back to you after trying out Nim macros.. I am faced with some block that just prevents me from doing that.
some day ..
Vindaar
@Vindaar
@kaushalmodi haha, no worries at all! :) I get lost "getting back to things" all the time too
@miran: that sounds like you're already well under way
From IRC (bridge bot)
@FromIRC
<miran> @Vindaar: as i said, dumpAstGen is the real hero. i just copy-pasted stuff produced by it
Vindaar
@Vindaar
haha, ok. I've been surprised by how well that worked, too :D
If you have some code you want to produce from what kind of input, I
I'm happy to try to help
From IRC (bridge bot)
@FromIRC
<miran> ok, let me make an example, just a sec
<TheLemonMan> don't forget about "quote"
Vindaar
@Vindaar
good point, that's even more useful :)
From IRC (bridge bot)
@FromIRC
<miran> under the line is what i'm trying to do curently
<miran> TheLemonMan: i have seen quote do here and there, but haven't used/understood it yet
Vindaar
@Vindaar
quote do basically allows you to write normal Nim code and have that converted to the NimNode representation
From IRC (bridge bot)
@FromIRC
<TheLemonMan> yeah, but it allows you to plug various pieces (NimNodes) from the outer scope
Mamy Ratsimbazafy
@mratsim
think of it as interpolating compile-time with run-time
just like &”My fixed and {interpolated} string"
Vindaar
@Vindaar
hehe, I should let smarter people than me talk :D
miran: I assume that Shape and the kind enum would already be defined, yes?
From IRC (bridge bot)
@FromIRC
<miran> yes, they are defined, as is calcArea proc
From IRC (bridge bot)
@FromIRC
<miran> i did this in my macro: http://ix.io/1mpn and a is IntLit - don't know how to pass that to a proc which creates an instance of Shape, there is no IntLit type!?
Vindaar
@Vindaar
using quote do, something like what you did there and a lot of hardcoded things (:P), you can do something like this: http://ix.io/1mps/nim
From IRC (bridge bot)
@FromIRC
<miran> thanks @Vindaar! from a quick look, it seems like toNimIdent is what i need
<miran> and it seems this quote do is something i really need to start using :⁠)
Vindaar
@Vindaar
yes, it's really helpful
From IRC (bridge bot)
@FromIRC
<miran> OMG, this quote do is magic!!
<miran> sorry dumpAstGen, i now have a new best friend!
Kaushal Modi
@kaushalmodi
miran: Please enlighten with a blog post or something :)
I need to bookmark this conversation for now
From IRC (bridge bot)
@FromIRC
<miran> @kaushalmodi: once i get more familiar with it — i'll do it
Vindaar
@Vindaar
and it's good to keep in mind that you can just define compile time procs, which handle certain parts of the code you construct by having them work on NimNode. e.g. refactoring the above to: http://ix.io/1mpu/nim
From IRC (bridge bot)
@FromIRC
<miran> i'll post my coplete code when i finish it, so y'all can take a look (and give me advice what to change :⁠))
Vindaar
@Vindaar
:)
From IRC (bridge bot)
@FromIRC
<miran> i managed to do it!!! wooohooo!