RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.3 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
miketheman is now known as miketheman_
miketheman_ is now known as miketheman
ruby_ has joined #crystal-lang
Philpax has joined #crystal-lang
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
soveran has joined #crystal-lang
ruby_ has quit [Ping timeout: 265 seconds]
soveran has quit [Ping timeout: 248 seconds]
ruby_ has joined #crystal-lang
ruby_ has quit [Client Quit]
kulelu88 has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
Philpax has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
eizua has joined #crystal-lang
eizua has quit [Remote host closed the connection]
eizua has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 272 seconds]
soveran has joined #crystal-lang
eizua has quit [Quit: Leaving]
soveran has quit [Ping timeout: 265 seconds]
Philpax has joined #crystal-lang
sandelius has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
bjz has joined #crystal-lang
soveran has joined #crystal-lang
mark_66 has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
onethirtyfive has joined #crystal-lang
<FromGitter> <piedoom> does anyone know how to do the cross origin header with kemal?
<FromGitter> <piedoom> I tried `env.response.headers["Access-Control-Allow-Origin"] = "*"` but it doesnt seem to work :(
<FromGitter> <sonic182> The creator of kemal is @sdogruyol maybe he knows why xD (there is a gitter of kemal Too)
<txdv> nnnnm
<FromGitter> <piedoom> Oh whoops, actually figured it out.
<BlaXpirit> better keep it secret now
<FromGitter> <piedoom> It was my fault, and not Kemal's :( that's why
<FromGitter> <piedoom> Must hide my shame.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Philpax has joined #crystal-lang
snsei has quit [Remote host closed the connection]
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 248 seconds]
bjz_ has joined #crystal-lang
soveran has quit [Remote host closed the connection]
CompanionCube has quit [Ping timeout: 250 seconds]
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
CompanionCube has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 264 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has quit [Quit: Textual IRC Client: www.textualapp.com]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
bjz has joined #crystal-lang
<FromGitter> <sdogruyol> @piedoom :D
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
<BlaXpirit> how can I use this in Crystal? http://llvm.org/docs/LangRef.html#llvm-ctlz-intrinsic
<BlaXpirit> looking at https://github.com/crystal-lang/crystal/blob/master/src/intrinsics.cr but what alarms me is the remark about 2nd argument being a constant
<BlaXpirit> oh well, i just ignored the part about the constant and it works fine
buggs has quit [Read error: Connection reset by peer]
havenwood has quit [Ping timeout: 248 seconds]
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
havenwood has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
matp has quit [Quit: Bye!]
matp has joined #crystal-lang
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
matp has quit [Read error: Connection reset by peer]
matp has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox_ has quit [Ping timeout: 248 seconds]
<asterite> BlaXpirit: maybe a bit late, but you can do pointerof(struct.@ivar)
<BlaXpirit> asterite, it's a lib struct, that didnt work
<BlaXpirit> and it turned out to be pointless anyway. i just can't tell the garbage collector that this particular pointer shouldn't keep a reference alive
ponga has joined #crystal-lang
<FromGitter> <sdogruyol> How would i start GC?
<FromGitter> <sdogruyol> GC.start?
<FromGitter> <sdogruyol> seems like GC.collect
<FromGitter> <sdogruyol> @RX14 i'm trying the multipart stuff with big file ~ 1GB
<RX14> yes
<FromGitter> <sdogruyol> and the memory just leaks
<FromGitter> <sdogruyol> even GC.collect doesnt work
<RX14> can you show me your code?
<RX14> oh
<RX14> yes
<FromGitter> <sdogruyol> sure
<RX14> i know why
<RX14> it's crystal's HTTP
<RX14> it buffers the whole request
<FromGitter> <sdogruyol> ugh
<RX14> doesn't support streaming
<FromGitter> <sdogruyol> that means it allocates for each request
<RX14> so there's this massive allocation for the whole file
<RX14> the whole 1GB
<FromGitter> <sdogruyol> ultimately leading to crash
<FromGitter> <sdogruyol> yeah
<RX14> that obviously gets reused by the GC
<RX14> so can't be freed
<RX14> if you upload again and again you should see the memory remain constant but large
<RX14> so not a leak just a large peak
<FromGitter> <sdogruyol> yeah it stay at around 5GB
<RX14> yeah wow thats a lot
<FromGitter> <sdogruyol> which makes me sad :/
<FromGitter> <sdogruyol> and i'm not even talking about without --release
<RX14> shouldn't make a difference
<FromGitter> <sdogruyol> so we need to rewrite Crystal HTTP for this?
<RX14> yes
<RX14> i started
<RX14> but never got far
<FromGitter> <sdogruyol> wow, that's cool
<FromGitter> <sdogruyol> so it's easy to DDOS for now
<FromGitter> <sdogruyol> :(
<RX14> yeah
Philpax has quit [Ping timeout: 272 seconds]
<BlaXpirit> the garbage collector is really getting on my nerves tho
<RX14> the garbage collecter doesn't deal well with big allocations, thats what the warnings are about
<RX14> the garbage collector's always been good to me
<BlaXpirit> i think this is a fatal flaw https://carc.in/#/r/1ba5 vs https://carc.in/#/r/1ba6
<BlaXpirit> easiest memory leaks ever
<asterite> BlaXpirit: only happens when there's a finalization cycle... remove the finalize, put the allocations in a loop and the objects are GCed
kulelu88 has joined #crystal-lang
<BlaXpirit> well what if I really want a finalizer?
<RX14> don't use them in looped objects
<BlaXpirit> but yeah, thanks for the pointer, this might apply in my case
<RX14> create a parent object which references the looped objects, and has a finalizer
<BlaXpirit> i've been calling this function in finalize https://github.com/slembcke/Chipmunk2D/blob/master/src/cpBody.c#L92
<BlaXpirit> yeah.. i can probably afford to drop that call :p
<FromGitter> <sdogruyol> shit, i just tried file upload stuff with Go STD and it constantly stay at 5MB with same benchmark
<FromGitter> <sdogruyol> i'm amazed
<RX14> well, if we rewrote HTTP we could probably get a similar result
<RX14> and not full rewrite
<RX14> split it into http/client and http/server with a http/common
<RX14> http::server::Response already streams out
<RX14> just not in
<RX14> there's a lot that can be reused
<asterite> When I didn't want to merge the multipart PR I mentioned that it doesn't make sense without a streaming http server...
<RX14> yes
<RX14> well, it doesn't make sense either
<asterite> I'll try to work on that next (besides threads, of course)
<RX14> any publicall-exposed crystal HTTP server can be brought down with a largew HTTP request
<RX14> I think thats a big problem
<asterite> BlaXpirit: maybe you can use WeakRef
<RX14> thats a massive problem, with an easy explot which means crystal absolutely *can* not be used in production
<BlaXpirit> asterite, yeah I know but it's a whole class
<BlaXpirit> i'm playing with fire here, I'm relying on the garbage collector to look at pointer which are in lib structs
<BlaXpirit> works quite well, other than these cycles
<BlaXpirit> but really, what can you do. a simulation contains a shape and a shape needs a way to access the simulation, so the cycle is natural. unfortunately, not all shapes work well without a finalizer
<BlaXpirit> polygon shape allocates a dynamic array of points and needs to free it
<BlaXpirit> and what about this?? https://carc.in/#/r/1ba8
<BlaXpirit> wait, sorry, ignore this
<BlaXpirit> i mean this https://carc.in/#/r/1ba9
<BlaXpirit> no finalization *cycle* now
<BlaXpirit> i have a finalizer only in 1 class now, but GC still says GC Warning: Finalization cycle involving 0x212cd20
<BlaXpirit> how can I diagnose this?
OmgBBQ has joined #crystal-lang
<OmgBBQ> Hey! Quick question for you guys. I have a date under this format "2016-10-04T15:15:07Z" that is being returned from a JSON response. The format is ISO 8601, using the %F flag in my "JSON.mapping" only retrieves the date. I'd like to also retrieve the time, I can't seem to figure out the correct time format for it to work. Any help?
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
Raimondii has joined #crystal-lang
pawnbox has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
<FromGitter> <johnjansen> @OmgBBQ check the specs 'spec/std/json/mapping_spec.cr' for hints ... I found this '''private class JSONWithTime ⏎ JSON.mapping({ ⏎ value: {type: Time, converter: Time::Format.new("%F %T")}, ⏎ }) ⏎ end''' [https://gitter.im/crystal-lang/crystal?at=57f3d336d45d7f0f5260ee8b]
<FromGitter> <johnjansen> private class JSONWithTime ⏎ JSON.mapping({ ⏎ value: {type: Time, converter: Time::Format.new("%F %T")}, ⏎ }) ⏎ end [https://gitter.im/crystal-lang/crystal?at=57f3d351f69c94ad098b3aae]
<FromGitter> <johnjansen> Sorry about the cruft I'm on my phone
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 252 seconds]
soveran has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 264 seconds]
dhk has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
LastWhisper____ has joined #crystal-lang
dhk has quit [Quit: Leaving]
soveran has quit [Remote host closed the connection]
daemonwrangler has quit [Ping timeout: 252 seconds]
soveran has joined #crystal-lang
<FromGitter> <johnjansen> @asterite is there some reason that XML::parse_html would not work in playground … it seems to be silently failing ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=57f400f391d6af11522c0a94]
<FromGitter> <johnjansen> @asterite compiled code seems to work
<FromGitter> <johnjansen> @asterite that results on Exit Status 11 in local playground on 0.19.3
soveran has quit [Remote host closed the connection]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
willl has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
bjz has quit [Quit: Textual IRC Client: www.textualapp.com]
ponga has quit [Quit: Connection closed for inactivity]
vifino- has quit [Quit: Who turned this off?! D:<]
vifino has joined #crystal-lang
OmgBBQ has quit [Quit: Page closed]
vifino has quit [Quit: Who turned this off?! D:<]
vifino has joined #crystal-lang
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]