RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.26.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
baweaver_away is now known as baweaver
Tortice has quit [Read error: Connection reset by peer]
Tortice has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
non-aristotelian has quit [Quit: non-aristotelian]
druonysus has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
druonysus has joined #crystal-lang
rohitpaulk has joined #crystal-lang
francisl has joined #crystal-lang
francisl has quit [Quit: francisl]
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <proyb6> @S-YOU Thatโ€™s a nice code, saw your H2O.cr where Iโ€™m using H2O+MRuby on my site. What made you choose H2O binding for TechEmpower Benchmark?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
<FromGitter> <dscottboggs_gitlab> Does HTTP::Client support unix sockets?
DTZUZO has joined #crystal-lang
rohitpaulk has joined #crystal-lang
moei has quit [Read error: Connection reset by peer]
moei has joined #crystal-lang
dostoyevsky has quit [Ping timeout: 268 seconds]
dostoyevsky has joined #crystal-lang
<FromGitter> <HarrisonB> Does method resolution w.r.t. overloading get resolved at runtime or compile time?
<FromGitter> <fusillicode_twitter> @HarrisonB I think at compile time but I'm not quite sure about it ๐Ÿ˜…
<FromGitter> <bew> @dscottboggs_gitlab since last release, yes if i remember correctly
rohitpaulk has quit [Ping timeout: 246 seconds]
<FromGitter> <HarrisonB> Even with union types? e.g. https://play.crystal-lang.org/#/r/54yx
<FromGitter> <bew> yes, all at compile time
<FromGitter> <bew> ah
<FromGitter> <bew> indeed, there's a dynamic dispatch step in this case, but all methods are still checked at compile time
DTZUZO has quit [Ping timeout: 252 seconds]
<FromGitter> <JBreniac_twitter> Looking for a way to use (or easily implement) PHP's session feature (session_start() + $_SESSION["myvar"]). Any clue ?
<FromGitter> <JBreniac_twitter> I mean, without using a full blown framework like Kemal or Amber...
<FromGitter> <j8r> Kemal isn't the same bloat level as Amber...
<FromGitter> <JBreniac_twitter> Right now Crystal default library gave me anything I need, I just need to figure out how to implement a simple session system in Crystal for user login stuff and my app is finished
<FromGitter> <JBreniac_twitter> It's a small web site with low traffic, nothing life critical
<FromGitter> <JBreniac_twitter> So using Amber was overkill
<FromGitter> <JBreniac_twitter> And it was a way to learn Crystal in the process
<FromGitter> <j8r> You have to use a cookie
<FromGitter> <j8r> and store a token inside.
<FromGitter> <JBreniac_twitter> Ok got it :D
<FromGitter> <JBreniac_twitter> Tnx Julien
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> @JBreniac_twitter does the app you're making is for learning purposes only? or do you intend to actually use it ?
<FromGitter> <JBreniac_twitter> both actually
<FromGitter> <bararchy> The I woulnd't recommend you do re-implement things like Session handeling as those are security + functionality, instead better to use `Kemal-sessions` or something similar
<FromGitter> <JBreniac_twitter> it's a direct port of my PHP showcase website
<FromGitter> <JBreniac_twitter> there is not sensitive data in it
<FromGitter> <bararchy> ๐Ÿ‘
rohitpaulk has quit [Ping timeout: 260 seconds]
ashirase has quit [Ping timeout: 252 seconds]
ashirase has joined #crystal-lang
<FromGitter> <girng> @bararchy i saw your twitter
<FromGitter> <bararchy> you mean you saw my Twitter user? :)
<FromGitter> <girng> love teh facial scruff ;D
<FromGitter> <bararchy> ah! hahahaha
<FromGitter> <bararchy> lol thanks
<FromGitter> <girng> i got the same thing lolz
<FromGitter> <bararchy> ๐Ÿ’ช
<FromGitter> <bararchy> @girng => https://www.youtube.com/watch?v=RmFnarFSj_U
<FromGitter> <girng> ๐Ÿ˜†
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
ua_ has quit [Ping timeout: 246 seconds]
ua has joined #crystal-lang
lunarkitty has quit [Ping timeout: 252 seconds]
lunarkitty has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <fusillicode_twitter> Hi guys, here I am for my today problem :( โŽ I'm trying to work with this shard but unfortunately I'm getting this exception whenever I try to perform a `find` :( โŽ โŽ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bb35d821c100a4f291c39ec]
<FromGitter> <fusillicode_twitter> I've already skimmed though the issues but I wasn't able to find anything interesting
<FromGitter> <bararchy> @JBreniac_twitter Which `shard` ?
<FromGitter> <fusillicode_twitter> @JBreniac_twitter sorry for the missing link :(
<FromGitter> <bararchy> oh, not the same twitter user hahah @fusillicode_twitter
<FromGitter> <fusillicode_twitter> here you go: https://github.com/datanoise/mongo.cr
<FromGitter> <fusillicode_twitter> ?!
<FromGitter> <fusillicode_twitter> @bararchy what have I done? ๐Ÿ˜ฐ
<FromGitter> <bararchy> @fusillicode_twitter I would say `File not open for writing` means that either `mongo` isn't up, or, you have no permissions to write to the unix socket (though that would have raised a differnt error)
<FromGitter> <bararchy> @fusillicode_twitter You have done nothing wrong, I mistakenly tagged the wrong user when answering to you
<FromGitter> <bararchy> Giving it a sec more thought, I would guess that it tries to open a file and can't open it for writing, maybe it's missing or being deleted? can you give the actual code making this error ?
<FromGitter> <fusillicode_twitter> > @fusillicode_twitter You have done nothing wrong, I mistakenly tagged the wrong user fffiuuu I was already panicking...I feared I had broken some rules about asking about issues/problems ๐Ÿ˜…
<FromGitter> <fusillicode_twitter> @bararchy regarding the error you're right, but the mongo I'm connecting to is actually a remote instance & the broken code is running from a docker container run from the latest crystal image, i.e. 0.2.6
<FromGitter> <fusillicode_twitter> As far as I can guess it seems that the problem is somehow related to the logger ๐Ÿค”
<FromGitter> <bararchy> Yeha, my fear, Maybe the docker don't have permissions to open sockets? in Linux sockets are files, and this error might indicate it can't do that
<FromGitter> <bararchy> can you try the same code outside of the docker ?
<FromGitter> <fusillicode_twitter> You're totally right, let me check
<FromGitter> <fusillicode_twitter> Ok it seems that locally I don't get the error
<FromGitter> <fusillicode_twitter> The strange thing is that even without the errore I can't get any result from the query
<FromGitter> <bararchy> @fusillicode_twitter But maybe that's just a SQL error, maybe wrong syntax? try a `SELECT *` kind of query
<FromGitter> <fusillicode_twitter> well the `collection.find()` method doesn't seem to accept nothing more than a BSON object instance ๐Ÿค”
<FromGitter> <fusillicode_twitter> I think that I need to find another solution to my problem and put the interaction with a mongo aside for the moment
<FromGitter> <fusillicode_twitter> but that's really sad :(
<FromGitter> <fusillicode_twitter> anyway thanks a lot for the support @bararchy ๐Ÿ™‡
<FromGitter> <bararchy> ๐ŸŽ‰ you can use MySQL ;) or postgres
<FromGitter> <fusillicode_twitter> well yeah but unfortunately right now my options are a mongo or an s3 file XD
<FromGitter> <fusillicode_twitter> I just need to save a timestamp in case of the success of an little ETL task that will run at scheduled intervals
rohitpaulk has joined #crystal-lang
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
DTZUZO has quit [Ping timeout: 252 seconds]
<FromGitter> <dscottboggs_gitlab> @bew it looks like URI.parse handles unix sockets find but when I try initializing a new HTTP::Client with that URI it says `Unsupported scheme: unix`
<FromGitter> <dscottboggs_gitlab> :(
<FromGitter> <dscottboggs_gitlab> https://play.crystal-lang.org/#/r/5515
<FromGitter> <asterite> jokke: nice PR. But I don't have time anymore for Crystal. I suggest you suggest in that PR to move webmock to crystal-community and have the community maintain it
<jokke> asterite: sad to hear that :(
<FromGitter> <bararchy> jokke: Give it till next week, then he will be adding some super new feature that makes Crystal runs 100x faster
<FromGitter> <bararchy> :)
<FromGitter> <j8r> hopefully @asterite has still a bit of time to tell he hasn't time anymore :slight_smile:
<FromGitter> <Prutheus> @asterite why donโ€™t you have time anymore?
<FromGitter> <Prutheus> o.O
<FromGitter> <j8r> on other projects
<FromGitter> <proyb6> Interesting old benchmark Perlin Noise, who wants to make better noise in Crystal? โŽ https://github.com/nsf/pnoise โŽ โŽ Go 1.11 - 0:00.33 โŽ Crystal 0.26.1 - 0:00.55 [https://gitter.im/crystal-lang/crystal?at=5bb37b921c100a4f291d0bb8]
<FromGitter> <j8r> he is on Crystal since the debut, 5years or so, I completely understand him. Myself I haven't been on one more than 2 years
<FromGitter> <j8r> wow Crystal 0.7.1 ๐Ÿ˜ฎ
<FromGitter> <j8r> what is this version?! `Crystal 0.7.1 (ะŸะฝ ะผะฐะน 11 00:47:29 UTC 2015)`
<FromGitter> <Prutheus> I know, but without him โ€ฆ I donโ€™t want that crystal fails and will stop in development somewhen โ€ฆ :/ he is so useful here!
<FromGitter> <j8r> Russian compiled Crystal
<FromGitter> <j8r> @Prutheus I agree they need more people. @asterite and @RX14 (starts university) hasn't much time anymore, only @bcardiff is full time on the project
<FromGitter> <j8r> Since 2 weeks there are more and more PRs... :(
Tortice has quit [Remote host closed the connection]
<jokke> asterite: i wrote an issue
<FromGitter> <Prutheus> @j8r I started using crystal some months ago and before i was using ruby. I really like crystal, but some things and a lot of documentation is not very good yet, I hope it will continue with fast and good development here โ€ฆ i really like it
Tortice has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 252 seconds]
akaiiro has quit [Remote host closed the connection]
<FromGitter> <bararchy> Don't worry @Prutheus , Crystal community is strong and driving forward, we have more and more active contributors, people come and go all the time but the core is really stable , sometime it might be a month of silence but then next month 10 new features , it all evens out
akaiiro has joined #crystal-lang
<FromGitter> <bararchy> I've been here from 2013~ crystal is stronger then ever
akaiiro has quit [Remote host closed the connection]
<FromGitter> <j8r> yeah the problem isn't really community and contributors, but we need more core members }:-|
<FromGitter> <asterite> @Prutheus I'm a father now :-)
<FromGitter> <S-YOU> @proyb6 Simply because h2o C is already there at high rank, and easy to port C code to Crystal.
<FromGitter> <asterite> (well, since a bit more than two months)
<FromGitter> <S-YOU> Congrats!
<FromGitter> <j8r> I'll bet the name is Asty :P
<FromGitter> <j8r> Felicitation! And in 10 years we can hope having a new contributor haha ๐ŸŽ‰
<FromGitter> <S-YOU> Matz is father too (He wrote Ruby ใƒ‘ใƒ‘ on Twitter :D
<jokke> hmm is there something between #as and #unsafe_as which would allow casting for example hash values to specific types that would break at _runtime_ if they're not compatible
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
<jokke> i thought #as would do this but it seems it only works for nilable types (only unions of Nil and some other type)
<FromGitter> <bararchy> @asterite congratz !
<FromGitter> <Prutheus> @asterite congrats! Very fantastic! I hope you have fun with your child!
<FromGitter> <j8r> then @bcardiff , @RX14 and @sdogruyol will have children too ๐Ÿ˜ถ ... lol
<FromGitter> <Prutheus> oh ^^
<FromGitter> <Prutheus> so @asterite you need to stay here :D
<FromGitter> <j8r> It's understandable, time with family vs time in projects - I'll choose the first too.
<jokke> oh asterite congrats!
<jokke> any ides on my casting issue?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
<FromGitter> <fenicks> > I have this error on CentOS7 with libssl, the installed version is libssl.so.1.0.2 and crystal program are looking for 1.1 : `error while loading shared libraries: libssl.so.1.1` โŽ How can I specify the correct version ? Is that an issue with the detection macro for the ssl version โŽ โŽ To bypass this issue on CentOS7, I run run my program inside a crystal docker container wich is Debian or Ubuntu.
<FromGitter> <dscottboggs_gitlab> @fenicks oh good, you figured it out. That's how I figured you would have to do it, but that won't work for every use case. Unfortuanately that's the sort of thing you kinda have to expect from something that's still using a patched kernel 2.* haha
<FromGitter> <dscottboggs_gitlab> especially when trying to use soemthing so new
<FromGitter> <j8r> better to use reproducible environments, easily done with Docker. Then, compiling it statically to bypass this shared libraries issues across distributions
<FromGitter> <dscottboggs_gitlab> that's a good solution
<FromGitter> <fenicks> @dscottboggs_gitlab Yep, thanks for the tip
<FromGitter> <fenicks> @j8r Yep, most of the time static compilation is Ok but in this case it doesn't work because of the gap between linux distributions on LibSSL version and shared library naming
<FromGitter> <j8r> @fenicks for static compilation, I mean on the recommended system, Alpine Linux
<FromGitter> <j8r> Anyway the error is legit, we don't always wan't static linking
<FromGitter> <fenicks> @j8r Ah, ok. Agreed.
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
<FromGitter> <HarrisonB> i asked this last night, but i just wanted to clear this up
<FromGitter> <HarrisonB> does overloading use static or dynamic types? or does it depend? E.g. https://play.crystal-lang.org/#/r/553l
ua_ has joined #crystal-lang
<FromGitter> <HarrisonB> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5bb3a0241e23486b9379c360]
ua has quit [Ping timeout: 272 seconds]
<FromGitter> <HarrisonB> the output is always one of the first two methods
<FromGitter> <dscottboggs_gitlab> using `puts` inside a fiber doesn't do anything. any workaround? โŽ โŽ https://play.crystal-lang.org/#/r/553m
non-aristotelian has joined #crystal-lang
<FromGitter> <mverzilli> @HarrisonB when there's more than one plausible target for the call, it's performed at runtime
<FromGitter> <mverzilli> if there was only one valid implementation of `foo` that worked with `a`, it'd be static
<FromGitter> <HarrisonB> Even in cases of inheritance?
<FromGitter> <HarrisonB> Is this in the docs?
<FromGitter> <mverzilli> what do you mean with "in cases of inheritance"? would you adapt your example? other than some funkiness with generics I think it works as you'd expect
<FromGitter> <HarrisonB> I guess my main experience with static typing is from Java
<FromGitter> <HarrisonB> where method resolution (in cases of overloading) exclusively depends on the static type
<FromGitter> <HarrisonB> e.g. if you have a `Parent` and `Child` class, if there's are two methods, e.g. one taking a `Parent` param & one taking a `Child` param, the one matching the static type will get called, (even if the type at runtime is more specific)
<FromGitter> <straight-shoota> @markrjr I've been away for a few days, so I didn't get your mention. Not sure if somebody already provided an answer for you. If not, I'm back to help.
<FromGitter> <bajro17> with regex is it possible to move on next one instead use position to actually move on next match
francisl has joined #crystal-lang
<oprypin> probably possible, but i don't quite understand what you're saying
<FromGitter> <vladfaust> This should be memed too
<FromGitter> <j8r> I don't think so, a regex match a string, and may return match groups
<FromGitter> <j8r> You can split your string a match a regex for each element in the Array
<FromGitter> <j8r> Nvm, you can in Crystal https://crystal-lang.org/api/master/String.html#scan%28pattern%3ARegex%2C%26block%29-instance-method
<FromGitter> <bajro17> @j8r Thank you so much I will try it now
<FromGitter> <codenoid> <3
<FromGitter> <codenoid> 1) Do you consider yourself a programmer? โŽ 2) Do you consider yourself a software engineer? โŽ 3) Do you solve business problems with software? โŽ 4) What kind of problems do you solve? โŽ 5) What other languages have you used? ... [https://gitter.im/crystal-lang/crystal?at=5bb3bf14bbdc0b2505d7159e]
<FromGitter> <codenoid> 1) Do you consider yourself a programmer? โŽ 2) Do you consider yourself a software engineer? โŽ 3) Do you solve business problems with software? โŽ 4) What kind of problems do you solve? โŽ 5) What other languages have you used? ... [https://gitter.im/crystal-lang/crystal?at=5bb3bf34c08b8b3067c18c7f]
<FromGitter> <drosehn> Not sure what reaction you're looking for to that list of questions.
<FromGitter> <codenoid> i just playing :D, i need answer
DTZUZO has joined #crystal-lang
Tortice has quit [Remote host closed the connection]
DTZUZO has quit [Quit: WeeChat 2.0]
<FromGitter> <vladfaust> Look what we've got here https://github.com/vladfaust/params.cr
DTZUZO has joined #crystal-lang
<FromGitter> <codenoid> we need to fix broken pipe issue
francisl has quit [Quit: francisl]
francisl has joined #crystal-lang
<FromGitter> <drum445> What do you guys reckon of dotnet core and java?
francisl has quit [Quit: francisl]
faitswulff has joined #crystal-lang
<FromGitter> <girng> @codenoid rescue it!
<FromGitter> <girng> i get broken pipe issues every now n then when testing tcp server with my game, i just rescue it, and if it's caught, basically act like a disconnect
sevensidedmarble has joined #crystal-lang
Tortice has joined #crystal-lang
<FromGitter> <dscottboggs_gitlab> Is there any way to output from stdout from inside of a fiber?
<FromGitter> <codenoid> @girng rescue and retry (?)
DTZUZO has quit [Ping timeout: 252 seconds]
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #crystal-lang
<FromGitter> <ezrast> @dscottboggs_gitlab `Channel#receive?` blocks the fiber. You want `Channel#empty?`.
faitswulff has quit [Ping timeout: 260 seconds]
<FromGitter> <dscottboggs_gitlab> oh I see
<FromGitter> <dscottboggs_gitlab> thank you
faitswulff has joined #crystal-lang
faitswulff has quit [Remote host closed the connection]
<FromGitter> <dscottboggs_gitlab> @ezrast nope still no output https://play.crystal-lang.org/#/r/555o
faitswulff has joined #crystal-lang
<FromGitter> <geolessel> I feel like I'm getting *really* close to figuring this out, but can't get it done. I'm attempting to create a CLI app in Crystal that on a certain keypress takes you to your $EDITOR then returns back to the program. I've been able to use Process.exec to get vim (my $EDITOR) running but when I quit vim, it quits my crystal program. This makes sense since the docs say Process.exec *replaces* the current
<FromGitter> ... process. Is there any way to temporarily replace it and then go back to it?
<FromGitter> <dscottboggs_gitlab> Process.run
<FromGitter> <dscottboggs_gitlab> right?
<FromGitter> <geolessel> When I try that, vim doesn't take over the screen and seems to auto-exit
<FromGitter> <dscottboggs_gitlab> yeah, I just was looking at the docs and noticed something tricky about that
<FromGitter> <dscottboggs_gitlab> Process.run *without* a block gives the process `/dev/null` instead of the standard pipes. All the other versions (`#new`, `#exec`, and `#run` when run with a block) give the process the standard streams by default
<FromGitter> <dscottboggs_gitlab> try running it with `output: STDOUT` etc?
<FromGitter> <geolessel> oooh, getting closer
<FromGitter> <geolessel> I think that may do the trick. My CLI app uses ncurses and when the process returns to it from vim the screen is all sorts of messed up. That may just be a ncurses thing though.
<FromGitter> <dscottboggs_gitlab> nice
<FromGitter> <dscottboggs_gitlab> hate that when ncurses ruins your terminal haha
<FromGitter> <geolessel> agreeeeeeed! :-)
<FromGitter> <dscottboggs_gitlab> imagine if it was back in the days before X and you couldn't just close the window and open a new one....
<FromGitter> <geolessel> I'd rather not ;-)
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #crystal-lang
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #crystal-lang
<FromGitter> <geolessel> @dscottboggs_gitlab I got it working 90% of the way I'd like. Thanks for your help!
<FromGitter> <dscottboggs_gitlab> happy to!
faitswulff has quit [Ping timeout: 240 seconds]
moei has quit [Quit: Leaving...]
faitswulff has joined #crystal-lang
<FromGitter> <vladfaust> Do we have a lib to turn `8.kb` into `8192`?
faitswulff has quit [Ping timeout: 260 seconds]
faitswulff has joined #crystal-lang
<FromGitter> <ezrast> @dscottboggs_gitlab the condition on your `break` is backwards
<FromGitter> <dscottboggs_gitlab> oh
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #crystal-lang
faitswulff has quit [Ping timeout: 260 seconds]
francisl has joined #crystal-lang
faitswulff has joined #crystal-lang
faitswulff has quit [Ping timeout: 252 seconds]