ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <cevarief> What is data type for property with type Hash(String, JSON::Type). I need to add to opening class. ⏎ ⏎ ```class SomeClass ⏎ property data: Hash(String, JSON)? ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=599a4356bc46472974a5b5e6]
<FromGitter> <cevarief> Nevermind, i should use JSON::Type to get it work not just JSON. Solved
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <codenoid> why , ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599a55f39acddb2407b11afc]
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> you can use `.not_nil!` also
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <r3bo0t> what is the better way to handle date type of mysql databases in crystal/mysql ⏎ given there is not Date type is crystal
Groogy_ has joined #crystal-lang
Groogy has quit [Disconnected by services]
Groogy_ is now known as Groogy
<Groogy> Morning!
Groogy2 has joined #crystal-lang
<FromGitter> <bararchy> Morning Groogy
<FromGitter> <bew> I'm back 😄
<FromGitter> <codenoid> :shipit:
<FromGitter> <bew> @r3bo0t there is Time, which handles time & date stuff in crystal
<FromGitter> <krypton97> Morning all
fenicks has quit [Ping timeout: 240 seconds]
<Groogy> back to work, sure it isn't Crystal but nice being back in the office ^^
<Groogy> now I can long to getting home to continue work
mark_66 has joined #crystal-lang
<FromGitter> <r3bo0t> @bew yes, if you can use `Time.now.date` or `Time.now.to_s(“%F")`
<FromGitter> <r3bo0t> but if in mysql type of the field is `DATE` the typecasting fails while saving record
<FromGitter> <crisward> That's because the Date type has been implemented in crystal mysql. I have an open pull request on time, as a timespan. I also added Datetime, but not date. It wouldn't be very hard to add.
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <crisward> @sdogruyol morning, how's things?
<Groogy> Morning sdogruyol! o/
<FromGitter> <sdogruyol> @crisward great, thank you! How about you
<FromGitter> <sdogruyol> Morning @Groogy how are you
<FromGitter> <sdogruyol> BTW this is the most informative issue https://github.com/crystal-lang/crystal/issues/4864 thanks @asterite
<FromGitter> <bew> yeah it's awesome
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <crisward> @sdogruyol Not too bad... got some SEO work to do on our site.. not the most enjoyable work 😟
<FromGitter> <sdogruyol> Ugh yea good luck @crisward
<FromGitter> <Qwerp-Derp> How does this (https://gist.github.com/Qwerp-Derp/01b27bff38fad760275a1d6dd4ebeb3e) look so far?
<FromGitter> <crisward> reg, #4864 does that mean using typed parameters speeds up compile times now, or is that something @asterite is proposing. I personally don't mind adding types as almost all of my methods only work with a single type anyway.
<DeBot> https://github.com/crystal-lang/crystal/issues/4864 (Why the compiler is slow and consumes a lot of memory)
<FromGitter> <Qwerp-Derp> `sample.cr` is part of the project that I'm trying to port over to my library
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <konovod> @crisward right now typed parameters just adds (a little) work to compiler, not helping anything. I like what he is proposing, but idea 1 seems questionable and idea 3 also looks like just adding syntax noise.
<FromGitter> <konovod> And according to gist i think generics adds even more methods and it can't be solved so easy. Generics bloat is partially "solved" in languages like C++ or pascal because they can compile programs file by file, but "crystal way" seems to use modules instead of files for encapsulation.
<FromGitter> <install-gentooo> Hey folks, I need a little help... I need to write a simple web server to simply list a bunch of files in a directory. Not sure how to do that in Crystal, is there any documentation that could useful?
<FromGitter> <Qwerp-Derp> Can anyone have a look at my Gist?
<FromGitter> <sdogruyol> @Qwerp-Derp just use http static file handler
<FromGitter> <Qwerp-Derp> @sdogruyol I think you tagged the wrong person :P
<FromGitter> <sdogruyol> really?
<FromGitter> <sdogruyol> sorry
<FromGitter> <install-gentooo> Thanks, I may be slightly retarded. There even was a section in the API page, https://crystal-lang.org/api/0.20.2/HTTP/StaticFileHandler/DirectoryListing.html
<FromGitter> <konovod> @Qwerp-Derp looks nice, i wanna gui and libui bindings seems to be easier way then waiting for qt. Will look at it closely later. The main thing libui imho lacks is a visual designer.
<FromGitter> <konovod> `UI.free_text` looks very error-prone
<FromGitter> <Qwerp-Derp> @konovod I don't know how to get rid of that call to `UI`, though
<FromGitter> <Qwerp-Derp> That function might be necessary, but I have no idea how to change it so I don't have to directly call the C binding
<FromGitter> <crisward> @konovod Thanks for the clarification
<FromGitter> <konovod> @Qwerp-Derp i think that once libui function returns string (UInt8*), it could be copied to crystal `String` and `free_text`ed immediately. Slightly ugly/overhead, but i don't see better way. After all, it's just a filename\similar short string, not a huge object.
rohitpaulk has joined #crystal-lang
<FromGitter> <Qwerp-Derp> @konovod Yeah, it works, but the function looks a little ugly :P
<FromGitter> <konovod> @Qwerp-Derp also, why do you ` @file_open.on_click(-> {` instead of ` @file_open.on_click do` ? The closure can be created inside an on_click. There is also idea to parse `def file_open_click` methods like in VCL, but this means macro magic and maybe questionable.
<FromGitter> <Qwerp-Derp> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599aabf69acddb2407b28225]
<FromGitter> <Qwerp-Derp> Like this?
<FromGitter> <Qwerp-Derp> I get a syntax error while doing this, do I have to change around my `classes.cr` to accommodate for this?
<FromGitter> <konovod> yes, change `classes.cr`. well, can't check right now, easiest way is to add ⏎ ⏎ ```def on_click(&block) ⏎ on_click( ->{ yield }) ⏎ end``` ⏎ ⏎ but possibly there is also better way (without boxing). [https://gitter.im/crystal-lang/crystal?at=599aae1676a757f808c9302f]
bmcginty has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> @konovod you about use yield inside a proc iirc
<FromGitter> <bew> @install-gentooo the api link you shared is outdated (it's for crystal 0.20.2)
<FromGitter> <konovod> @bew oh, yes. then ` ->{ block.call }`
<FromGitter> <Qwerp-Derp> Can't you just do ⏎ ⏎ ```def on_click(&block : ->) ⏎ on_click(block) ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=599ab7152723db8d5ec872fa]
<FromGitter> <konovod> looks working) so yes
<FromGitter> <Qwerp-Derp> I'm learning a bit of Elixir rn :D
livcd has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<livcd> Where can I check Crystal's roadmap ? if there's any ? :-)
<livcd> Thank you
<FromGitter> <bararchy> Feeling proud, My crystal project takes 5 min to compile in release mode
<FromGitter> <bararchy> hahah
<FromGitter> <crisward> @bararchy I've stopped using release mode for our websites, when you take into account network and database latency the difference isn't noticeable. But when you've just pushed a bug, and want to fix it, five minutes feels like an eternity. Will probably use it for high traffic sites in the future, but I'm not trusting Crystal with those quite yet.
<FromGitter> <bararchy> @crisward Well, I'm using Crystal for Machine learning and Data anlysis, for me the difference is really huge :)
fenicks has joined #crystal-lang
<Papierkorb> bararchy, crisward, Back when I wrote the torrent stuff, the CLI didn't keep up in debug mode when the transfer speed was about 10MiB/s hehe. Was actually quite relieved when I found out that the release build had no issues at all, using less much processing power than KTorrent for me. Though *that* project uses a ton of fibers and channels, which probably makes it worse.
<FromGitter> <crisward> @bararchy I can imagine...
<FromGitter> <bararchy> Papierkorb, Does your Crystal torrent program runs better then Transmition ?
<FromGitter> <bararchy> Also, does it support streaming to a video player ? (like VLC, etc..)
<Papierkorb> bararchy, never tried Transmission. It's a library, the provided cli acts as example. Barely tried it with less legal torrents though (Thanks to all the ubuntu image seeders), so there might be some not solved but actually important corner cases around in it.
<FromGitter> <bararchy> "legal" or "not legal" dont beat around the bushes, can it stream latest GOT from pirates bay or no ?
<FromGitter> <bararchy> HAHAHA
<FromGitter> <Qwerp-Derp> Argh I need to find a colour scheme with a certain colour for a string, but I don't know where to start :P
<FromGitter> <bararchy> `String#colorize(:green)` XD
<RX14> there we go that's my wall of text for this morning
<FromGitter> <sdogruyol> @RX14 isn't it awesome :)
<RX14> hmm?
<FromGitter> <Qwerp-Derp> Does anyone know the theme from the editor in this course? https://www.codeschool.com/courses/mixing-it-up-with-elixir
<FromGitter> <Qwerp-Derp> The theme looks really nice, but I can't seem to find it :(
<FromGitter> <bararchy> RX14, good points :) I too wont be happy to code java in Crystal , and be shakeled by layers of Types
<FromGitter> <bararchy> btw, when Multi-threading will get in, will that speed up compile times ?
<RX14> @barachy i don't know and probably not
<RX14> we already do the parallel part of compilation in multiple cores using fork()
<RX14> and there's no current concrete work on parallelism that i'm aware of
<FromGitter> <bararchy> RX14, is the compiler is using `fork` how come it always uses 1 CPU core ?
<RX14> it doesn't
<FromGitter> <bararchy> It never passes 100% CPU usage, which is a single core (my max is 800%)
<RX14> are you talking about release kode
<RX14> release mode*
<FromGitter> <bararchy> yeha
<FromGitter> <bararchy> --release
<RX14> ok then yeah
<RX14> it's not parelizable
<RX14> parallelizable*
<RX14> parallelizeable ?
<RX14> words
<FromGitter> <bararchy> I guess this is one of the reasons it's so slow
<RX14> no
<RX14> i don't think we should are about release build performance
<RX14> i really think we should eek every optimization from the code at expense to compile times in release mode
<RX14> and optimise non release to be as fast as possible while keeping the same semantics
<RX14> perhaps there's room for an in-between but to be honest release mode doesn't do much for your typical webapp
<RX14> you're better off deploying in non-release and getting better backtraces
<FromGitter> <bararchy> But RX14, you need to remmber that not all use cases are webapps , and we should beware of this mind set (at least I think so) , so that we don't stamp "yet another web backend languge" on Crystal
<RX14> for sure
<FromGitter> <bararchy> For me compiling in non release mode makes testing a living hell
<FromGitter> <bararchy> :\
<RX14> but i'm saying that I don't think spending effort on optimizing release build times is worth it
<RX14> @bararchy why so?
<FromGitter> <bararchy> Because training a Neural Network from scratch to a testable stage takes lots of resources and cumputation power and when using non release mode, the difference can be measured in hours
<RX14> well if your training takes hours anyway
<RX14> then what difference does release mode build times make?
<FromGitter> <bararchy> non release mode = 5 hours, release mode 2 hours, sometimes less
<FromGitter> <bararchy> it's a BIG difference
sz0 has joined #crystal-lang
<RX14> yes but if your training takes 2 hours
<RX14> and your release mode build takes 5 minutes to build
<RX14> which is s tupid long time
<RX14> building is still only like 5% of the time
<RX14> so optimizing release mode builds still doesn't help much
<Groogy> and also, you should probably work with test case/sample size which doesn't take 5 hours in debug
<RX14> ^
<Groogy> I understand it is easier said than done, but in the long run you will earn on it
<Groogy> so take the extra effort to find out what you can do to minimize the warmup time
<Groogy> to test a feature
<FromGitter> <bararchy> Usually I'll totally Agree, sadly without a fully trained network I can't really test if what I changed took effect, any way, I guess it's not really an issue when looking at how much time it saves :)
<Groogy> maybe look into what is taking 5 hours for it?
<FromGitter> <bararchy> btw, Is there a way to see\dump exactly what HTTP::Client is sending ? as in curl -vv style ?
<Groogy> is it in the neural network backend or is it in cleint code where you can help?
<FromGitter> <bararchy> Groogy, it takes time to run the data and adjust the wightes, "backend" kinda thing, so nothing I can do there, I try to optimize it using other tools, like better data normaliztion, etc ..
fenicks has quit [Quit: Leaving.]
bmcginty has joined #crystal-lang
<FromGitter> <bararchy> Found something interesting hahah https://github.com/crystal-lang/crystal/issues/4867
<FromGitter> <bararchy> Working with old\legacy servers is fun :)
<Papierkorb> bararchy, can you share the actual status line that your server responds with? I mean, that server sounds super broken
<FromGitter> <bararchy> I would love too, I'll maybe try to curl it , or something
<Papierkorb> That, or wireshark
<Papierkorb> If it's not TLS, which it probably won't if that server can't even get HTTP right
<FromGitter> <bararchy> Papierkorb: `["<!DOCTYPE", "HTML", "PUBLIC \"-//IETF//DTD HTML 2.0//EN\">"]` this is the line it expects to have a status code in
<FromGitter> <bararchy> Github is down ?
<FromGitter> <fridgerator> yep - https://status.github.com/
<FromGitter> <bararchy> Damn :\
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
fenicks has joined #crystal-lang
<Papierkorb> bararchy, that isn't even HTTP, that's just a dump of the source file. Is that server a `nc -l -p 80 < hello_world.html`?
<FromGitter> <bararchy> Nope, It's apache
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599af055578b44a046d223ac]
<Papierkorb> bararchy, please paste the complete response the server gives, as it appears on the wire
<FromGitter> <bararchy> Just did
<FromGitter> <bararchy> in the issue
<Papierkorb> bararchy, that doesn't look like the whole response, only its body.
<FromGitter> <bararchy> I know, this is most liklely why the HTTP::Client fails
<FromGitter> <bararchy> I'll fireup wireshark now and check
<Papierkorb> Please capture it using wireshark or tcpdump
fenicks has quit [Quit: Leaving.]
mark_66 has quit [Quit: Leaving.]
<FromGitter> <bararchy> Papierkorb, see issue :) full trace +
<FromGitter> <bararchy> It's getting interesting lol
<Papierkorb> That response is correctly formatted by the server
<Papierkorb> Is the client confused by the 100 Continue?
<FromGitter> <bararchy> Seems so
<FromGitter> <bararchy> it closes the connection and tries to parse the other data as ... not sure lol
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> TBH I was sure the issue was at my side
<Papierkorb> bararchy, That traffic dump looks normal, the client should function with that
<FromGitter> <dippersauce> So one of nim’s features is dependency free binaries. Do crystal binaries rely on anything?
<FromGitter> <dippersauce> Besides the obvious like OpenSSL and OS specific stuff.
<FromGitter> <sdogruyol> @dippersauce libgc
rohitpaulk has quit [Remote host closed the connection]
<RX14> @dippersauce what do you mean by "dependency free"?
<RX14> statically linked? libc only?
<RX14> because openssl is a dependency just like any other
<RX14> and it's more likely to be a painful dependency than any other
<RX14> if your have openssl as a dependency then you can't claim to be dependency-free
<RX14> because openssl is a pain in the arse
<FromGitter> <bararchy> Papierkorb Well, it doesn't :\ not sure what the issue is, but I can provide a reproducable example against the specific server
<RX14> well
<RX14> i'd hardly say the dump looks normal
<RX14> it 's a VERY weird sequence of http requests
<FromGitter> <bararchy> It is right ? And it's a standard HTTP 1.1 Apache server
<FromGitter> <bararchy> Just because I send the `Expect: 100-continue` header
<RX14> no like
<RX14> that HTTP request you're sending has about 500 ehaders
<RX14> why
<RX14> @bararchy I think what's happening is the HTTP request after the http 100
<RX14> it has a COntent-Length: 188
<RX14> and then immediately after the gzip-encoded 188 byte body
<RX14> it starts up with the DOCTYPE HTML PUBLIC
<RX14> so it's a bad response
<RX14> somehow you're recieving the gzipped body followed by the non-gzipped body
<FromGitter> <bararchy> RX14, I have all non-custom HTTP headers, it's not a mistake, part of my tests
<RX14> yes well i think you're stressing apache past it's breaking point
<FromGitter> <bararchy> Intresting
<RX14> yup
<RX14> it broke
<FromGitter> <bararchy> RX14, Do you think though that a better handeling of the Exception can be made ? which was my original point, so that it will be easier to understand what have gone wrong ? (maybe a print of the "status code" it tried to evaluate, or just print all the line or w\e)
<FromGitter> <bararchy> Because right now I get a can't cast something to i32 error, and only digging thourugh the Client lib I got to what the issue was
<FromGitter> <bararchy> Maybe an error with "Corrupted HTTP response"
<FromGitter> <bararchy> even
fenicks has joined #crystal-lang
fenicks has quit [Ping timeout: 255 seconds]
Relax has joined #crystal-lang
Relax has quit [Client Quit]
<FromGitter> <bararchy> On an unrelated note, Is there a way to "strace" a process via programatic bind (somthing like Process.bind(pid))
<FromGitter> <bararchy> Hm.. I guess I should bind ? https://github.com/haypo/python-ptrace/
<FromGitter> <bew> Why not use strace directly?
Relax has joined #crystal-lang
<FromGitter> <bew> But yes, ptrace is what is used by strace to monitor a process
fenicks has joined #crystal-lang
<FromGitter> <bararchy> Beacuse I want to create a service that monitors another process , and I want a deep down monitor
<FromGitter> <bararchy> I can call it from bash, but it sounds like half the fun
<FromGitter> <bararchy> XD
<FromGitter> <bararchy> It's also a single function lib ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599b285ec101bc4e3a409627]
<FromGitter> <bararchy> Or at least that's what in the ptrace.h
Relax has quit [Remote host closed the connection]
fenicks has left #crystal-lang [#crystal-lang]
brycek has quit [Ping timeout: 255 seconds]
big_num has joined #crystal-lang
brycek has joined #crystal-lang
big_num has quit [Quit: WeeChat 1.7]
dom96 has quit [Changing host]
dom96 has joined #crystal-lang
<FromGitter> <krypton97> What language is the compiler written in?
<FromGitter> <krypton97> C?
<FromGitter> <sdogruyol> no
<FromGitter> <sdogruyol> Crystal
<FromGitter> <krypton97> 100%?
<FromGitter> <krypton97> Anyway, that's not really the point. Any chances to reach the same compile speed as go does? :>
<FromGitter> <krypton97> With 1.0 release
<RX14> no we'll never be as fast as go
<RX14> not at compile speed
<RX14> but we'll beat them in runtime speed though
<RX14> not unless we ditch LLVM and perform magic on the type inference
<RX14> we also get more power and inference as a tradeoff for that time
<RX14> and when the difference for most projects is 50ms and 500ms
<RX14> who cares?
<RX14> it's when you get to >1s that optimization becomes worth it
<FromGitter> <crisward> My non-release compile times are 10-15 seconds.
Papierkorb has left #crystal-lang ["Konversation terminated!"]
Papierkorb has joined #crystal-lang
<FromGitter> <crisward> I think macros in the template engines make a big difference, though I've not specifically measured it.
<Papierkorb> jup, macros increase compile times considerably
<RX14> you can see run() macro execution times in --stats right?
<FromGitter> <crisward> just get this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599b503c76a757f808cc261e]
<RX14> 50% of the time there is in LLVM
<RX14> which is interesting
<FromGitter> <crisward> without the .o file reuse it slows down a lot ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599b50b6210ac26920a9c18b]
<RX14> wait why is the semantic (main) part slowing down?
<RX14> it was my impression that that was typechecking and is currently completely thrown away after every build
<FromGitter> <crisward> I've no idea... I really should spend a bit of time understanding the compile steps better.
<RX14> oh actually
<RX14> if you use templates
<RX14> then it might be that?
<RX14> hmm
<FromGitter> <sdogruyol> bc + obj is ..
<RX14> it makes sense that bc + obj takes longer
<RX14> but it's not much longer is is
<RX14> so i don't really understand it much
<FromGitter> <sdogruyol> it's mt first time seeing semantic that long
<FromGitter> <sdogruyol> macros to blame?
<RX14> that's what makes me think it's run()
<FromGitter> <crisward> I'm using slang
<RX14> which is used by ECR
<FromGitter> <sdogruyol> yeah uhmm
<RX14> that might be even slower
<RX14> well
<RX14> it will be slower
<FromGitter> <sdogruyol> slang uses macros and io a lot..
<RX14> i'm just not sure by how much
<RX14> slang uses 1 macro
<FromGitter> <sdogruyol> ECR.embed is way much faster than using `render` in kilt
<RX14> weird
<FromGitter> <sdogruyol> like 5x slower ..
<FromGitter> <crisward> To compile, or render?
<RX14> i'd question your testing methodology?
<FromGitter> <sdogruyol> never had the chance to take a look at it though
<FromGitter> <sdogruyol> @drujensen reported that crystal view rendering performed much faster than kemal
<FromGitter> <sdogruyol> and since kemal uses kilt
<RX14> so rendering
<FromGitter> <sdogruyol> Crystal uses just ECR.embed
<RX14> that makes more sense
<RX14> you don't write directly to the IO right?
<FromGitter> <sdogruyol> there are some intermediate io stuff going on
<RX14> doesn't render return a string
<FromGitter> <crisward> The app has 18 slang templates, I'm guessing all those lines are going to add up. I'll try removing some, see what effect it has on compile time.
<RX14> and you actually use Kilt.render?
<RX14> not Kilt.embed?
<RX14> that's another reason i've never used kemal, i can never get past the lack of design around performance
<FromGitter> <sdogruyol> lol
<FromGitter> <sdogruyol> I'm really focused on performance, I'd be happy to get your feedback / PRs @RX14
<FromGitter> <sdogruyol> I've never tried using slang and that's the issue
<RX14> i'd prefer to just use HTTP::Server
<RX14> it's like 5 lines to use radix and HTTP::Server
<RX14> and it makes me much happier
<RX14> not to say kemal is bad
<RX14> but it's not really my kind of framework
<FromGitter> <crisward> Api should always come before performance and Kemal does a good job there.
<FromGitter> <sdogruyol> fair enough, it's a matter of choice
<FromGitter> <sdogruyol> I try to make it as performant as possible while keeping things simple
<RX14> the stdlib should give an API good enough to stand on it's own
<RX14> and the only thing left to shards would be routing
<FromGitter> <sdogruyol> IMHO std is already pretty good at it
<FromGitter> <sdogruyol> especially after multipart
<RX14> not good enough :)
<FromGitter> <sdogruyol> definitely better than Ruby haha
<FromGitter> <sdogruyol> :D
<RX14> i've been meaning to finish my file sending stuff for like 3 weeks now
<FromGitter> <sdogruyol> what's that?
<FromGitter> <sdogruyol> just to remind you of crane too
<RX14> basically just a simple method which says "serve this file to the context canonically"
<RX14> i.e.
<FromGitter> <sdogruyol> i do not want to make you feel worse ofc :P
<RX14> it takes Range headers into account
<FromGitter> <crisward> Kemal give a very friendly face to crystal. You can demo a web server and router to other devs in 5 lines of code. Which is pretty nice.
<RX14> and perhaps caching
<FromGitter> <sdogruyol> yeah @crisward i agree
<RX14> Go does range and caching headers and mime type
<FromGitter> <sdogruyol> @RX14 all in std?
<RX14> yep
<FromGitter> <sdogruyol> I wonder if they had those at 1.0 or after
<RX14> and not much code
<RX14> you're welcome to blame it if you want
<FromGitter> <crisward> Are mime types not in Std yet?
<RX14> no
<FromGitter> <sdogruyol> Want to read the source of that Go code but gosh it bleeds my eyes..
<RX14> the way go does it is to read the system mime types list
<RX14> which is the right way to do it
<FromGitter> <sdogruyol> and where does that come from?
<oprypin> Windows tho?
<RX14> ahh windows sucks anyway
<RX14> who cares
<FromGitter> <crisward> I did a pull request on Kemal ages ago with them, thought about adding them to std but then couldn't be arsed with the relative hassle.
<FromGitter> <sdogruyol> lol @crisward :D
<FromGitter> <sdogruyol> brb
<oprypin> sdogruyol, /usr/share/file/misc/magic.mgc
<oprypin> libmagic / file in general
<RX14> i ended up shelling out to `file` lol
<oprypin> it's ok
<RX14> very easy to implement
<RX14> works well
<oprypin> annoying that you can't make it output just the component you want, need to cut off parts
<RX14> you can?
<RX14> -b and --mime-type
<RX14> does the trick
<RX14> but unportable and low-performance
<RX14> it's just better than all the existing crystal mime libraries I think
<RX14> which all seem to get their lists either from their ass or some JS project
<Papierkorb> libmagic's API is a bit whack too
<oprypin> RX14, -b --mime-type works on mac which is nice
<RX14> thats why you parse the list file
<RX14> does it?
<RX14> i on;y care about linux
<RX14> for that project
<RX14> i mean
<oprypin> RX14, btw libmagic's bundled mime types have different versions
<RX14> huh?
<RX14> the file format?
<oprypin> yes
<RX14> interesting
<oprypin> i was on some ancient freebsd and it had separate magic files for types and mime types. now they're unified
<oprypin> good news is it's probably safe to ignore those old versions
<oprypin> im pretty sure that bsds, linuxes and macs all use the same libmagic, and a recent enough version of it
<RX14> does the magic file have a version specifier though?
<FromGitter> <solisoft> Hi there I have an issue on centos7 & llvm 3.8
<FromGitter> <solisoft> my script run with `crystal run src/chat.cr`
<FromGitter> <solisoft> it build also .. but not in production mode
<FromGitter> <solisoft> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599b58fd614889d475722f34]
<FromGitter> <solisoft> any idea ?
<FromGitter> <solisoft> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=599b5926ee5c9a4c5fe60ced]
<oprypin> use --no-debug for workaround
<oprypin> known issue
<FromGitter> <solisoft> testing
<FromGitter> <solisoft> you saved my night ;)
<FromGitter> <solisoft> thanks
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZU has joined #crystal-lang