DerisiveLogic has quit [Ping timeout: 276 seconds]
<a5i>
hmm
<a5i>
>> x :: Int32; x.class
<DeBot>
a5i: Int32
<BlaXpirit>
i don't understand why some of Ruby's methods are missing, mainly in Array. maybe it's recently added ones?
<jhass>
BlaXpirit: because nobody had time to implement them yet, contributions welcome!
<BlaXpirit>
it takes me a long time to believe in myself enough to contribute code
<jhass>
heh, if I could do it... ;P
<BlaXpirit>
do what
<BlaXpirit>
oh
<jhass>
don't worry too much about forgetting an edge case, we can fix them as they're discovered
<BlaXpirit>
yeah but i'm also supposed to add tests
<ponga>
jhass: what happend with ruby's map.with_index replaced by single method of "map_with_index" in Array
<ponga>
cos it makes more sense?
<jhass>
ponga: cause we have no Enumerator yet
<ponga>
ok
<a5i>
we dont have alot of things
<a5i>
...yet...
<a5i>
heh
<jhass>
asterite's plan is to add Iterators which are tailored to the class they're used with, but I hope I could convince him to add a general Enumerator too
<jhass>
BlaXpirit: writing specs is easy
<BlaXpirit>
but i havent familiarized with them
<jhass>
you just call your method and expect the result to be something known
<BlaXpirit>
nor am i particularly interested in it for now
<BlaXpirit>
jhass, maybe it's because of crystal debug build?
<BlaXpirit>
no idea, but here it's definitely growing
<jhass>
drcrystal is just my alias for the head compiler
<BlaXpirit>
ok
<jhass>
maybe different libgc version?
<BlaXpirit>
maybe
<jhass>
7.4.2 here
<BlaXpirit>
wait.. what's libgc?
<BlaXpirit>
7.4.2
<jhass>
right, the package is just gc
<jhass>
so that's not it
<jhass>
there's a slight increase as the snake gets larger, but completely tolerable and I suppose its just because it has to draw more or something, raised to something like 28000 before I died ;)
wanderer_ has joined #crystal-lang
<BlaXpirit>
very strange, jhass.
<BlaXpirit>
here it raises until both snakes die
<jhass>
it starts at ~24 and then raises to a stable value, ~27200 for a release build, I suppose that's just the GC warming up
<jhass>
24000 of course
<BlaXpirit>
crystal build is release build?
<jhass>
crystal build --release
<jhass>
turns on LLVM optimizations
ponga has joined #crystal-lang
<BlaXpirit>
what the heck.. it stabilized at 108 MB
<BlaXpirit>
or wait.. it's probably cuz i lost
<BlaXpirit>
no, it definitely stabilized, now at 101
<jhass>
my sfml is 2.2 btw
<BlaXpirit>
yes
<BlaXpirit>
Private 90628 KB [heap]
<a5i>
is that good
<BlaXpirit>
omg, jhass, it definitely starts calling the finalizes only after it gets nearly 100MB of RAM
<BlaXpirit>
i played for a good minute, and only then i got debug output that finalize is called
<jhass>
what's your total free memory?
<BlaXpirit>
about 10 gig
<BlaXpirit>
actually 9 GiB free ram
<BlaXpirit>
and 16 swap
<jhass>
I only have about 3.7 free, maybe libgc inspects that?
* jhass
shrugs
ponga has quit [Remote host closed the connection]
<BlaXpirit>
thanks for trying this
<jhass>
iirc there are some variables to tune it
<a5i>
is that good memory usage from the program ?
<asterite>
Yes, C enum and regular enum are the same
<asterite>
Some time ago enums were only in libs, but we realized they are useful outside them too
<BlaXpirit>
so how to convert an integer to enum value?
<asterite>
Probably to_i makes sense too
<BlaXpirit>
>> enum Foo; A; B; C; end; Foo.new(2)
<DeBot>
BlaXpirit: C
<BlaXpirit>
ok, thanks.
<asterite>
Yes, that :)
<asterite>
Did you just answered yourself?
<BlaXpirit>
yes
<asterite>
Hahaha :)
<asterite>
Note that `new` doesn't check that it's valid, but you probably get that value from C anyway so it'll be valid
<asterite>
>> enum Foo; A; B; C; end; Foo.new(10)
<DeBot>
asterite: 10
<asterite>
BlaXpirit: crsfml is looking amazing. It's big and has lots of documentation! I also tried all the samples and they work great :)
<BlaXpirit>
thx
<BlaXpirit>
the worst thing right now is inability to add things to structs
<BlaXpirit>
also, something weird was happening to me with GC
<BlaXpirit>
we talked earlier
<asterite>
Yes, I still need to answer to reply in that issue. And I read the logs about the GC, the usage growing to 100 MB
<BlaXpirit>
i did spend like an hour wrapping the structs
<BlaXpirit>
then i remembered about union
<BlaXpirit>
and it was all crumbling apart even without it
<BlaXpirit>
so i went ahead and abandoned all that
<asterite>
What about the unions?
<BlaXpirit>
well i'd have to wrap that too
<asterite>
And I think you should. Unions are unsafe
<BlaXpirit>
nope nope nope
<asterite>
Ok :) . It's better if we continue discussing this in the issue about struct methods, so the conversation is not lost and others can comment too