RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.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
<RX14> since you can just assign different types in both branches of an if
<RX14> and unions just happen
<jxv> thank you, RX14
<RX14> jxv, i hope that answers your questions
<RX14> although trying them out is probably a lot more informative
<jxv> yes :)
rohitpaulk has joined #crystal-lang
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 265 seconds]
davic has quit [Ping timeout: 252 seconds]
davic has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #5525: Define `new(JSON::PullParser)` on BigDecimal so it can be deserialized (master...json-parse-bigdecimal) https://git.io/vNe7X
cremes has quit [Quit: cremes]
jxv has quit [Quit: zzz…]
relyks has quit [Quit: relyks]
<travis-ci> crystal-lang/crystal#d8343a6 (master - Define `new(JSON::PullParser)` on BigDecimal so it can be deserialized (#5525)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/326620449
<DeBot> https://github.com/crystal-lang/crystal/pull/5525 (Define `new(JSON::PullParser)` on BigDecimal so it can be deserialized)
cremes has joined #crystal-lang
<FromGitter> <marksiemers> Is there an easy way to capture what would go to STDOUT in a Spec file?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
return0e has quit [Ping timeout: 256 seconds]
return0e has joined #crystal-lang
relyks has joined #crystal-lang
<crystal-gh> [crystal] chris-huxtable opened pull request #5558: OpenBSD Improvements (master...openbsd-improvements) https://git.io/vNtlx
woodruffw has quit [Ping timeout: 252 seconds]
woodruffw has joined #crystal-lang
woodruffw has quit [Changing host]
woodruffw has joined #crystal-lang
vikaton has joined #crystal-lang
relyks has quit [Quit: relyks]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
martinium has joined #crystal-lang
cremes has quit [Quit: cremes]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
illy_ has joined #crystal-lang
illy_ has quit [Client Quit]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <bajro17> hi I start to covert paypal ruby sdk to crystal
martinium has joined #crystal-lang
<FromGitter> <bajro17> but I have problem when I run check it just show error but no on what line error is
martinium has quit [Quit: Textual IRC Client: www.textualapp.com]
Renich_ has quit [Quit: leaving]
<FromGitter> <elorest> What would be the best way to detect when an TCPSocket is broken. i.e the server is closed or the network connection is broken?
<FromGitter> <elorest> I'm currently just catching the error on `#write` reconnecting and resending the message. Doesn't seem like the best way to do it though.
<FromGitter> <bajro17> I hope I will not be boring with this project
<FromGitter> <bajro17> I get error on start and I dont know what I need to fix it
<FromGitter> <bajro17> ```describe "Payouts", :integration => true do```
<FromGitter> <bajro17> Syntax Error: unexpected token: => at ./spec/payouts_examples_spec.cr:3:34
sz0 has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] chris-huxtable opened pull request #5560: Adds pledge() (master...openbsd-pledge) https://git.io/vNt2y
<FromGitter> <bararchy> ```describe "payouts" do ⏎ it "does something" do ⏎ # do stuff here ⏎ end ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5a545c0303838b2f2a8a154f]
<FromGitter> <bararchy> this is the usual syntax
<FromGitter> <bajro17> Thank you I will try it
<FromGitter> <bajro17> Syntax Error: expecting token ')', not '=>' at ./spec/core/api/rest_spec.cr:32:31
<FromGitter> <bajro17> ```api = create_api( :mode => "sandbox" )```
<FromGitter> <bararchy> Can you share all thee code ? Its hard to debug just looking at one line
<FromGitter> <bajro17> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a5463d56117191e61420a95]
alex`` has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<FromGitter> <marksiemers> `api.service_endpoint.should eq "https://api.sandbox.paypal.com"`
<FromGitter> <marksiemers> its not quite the same as rspec
<FromGitter> <marksiemers> @bajro17 - If you want to use keyword args, don't use the hash syntax, use: ⏎ ⏎ ```api = create_api( mode: "sandbox" )``` ⏎ ⏎ https://crystal-lang.org/docs/syntax_and_semantics/default_values_named_arguments_splats_tuples_and_overloading.html [https://gitter.im/crystal-lang/crystal?at=5a546a870505ad8b45d05d60]
<FromGitter> <marksiemers> If you want to use a hash, you can't omit the curly brackets: ⏎ ⏎ ```api = create_api( { :mode => "sandbox" } )``` [https://gitter.im/crystal-lang/crystal?at=5a546ab75a9ebe4f7563e18b]
<Groogy> Morning
<FromGitter> <bajro17> morning :)
<FromGitter> <bajro17> Thank you @marksiemers I will check it now
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
andrewzah has quit [Ping timeout: 240 seconds]
bazaar has joined #crystal-lang
hello has joined #crystal-lang
<hello> what does it means when something is for example returning an `UInt64?` instead of an `UInt64` ?
<FromGitter> <marksiemers> That means it is a nullable type
<FromGitter> <marksiemers> Same as `UInt64 | Nil`
<hello> and what can i do with it? I actually just want it to be a UInt64. Not a UInt64 | nil
<hello> when i try to_u64 then it gives me error
<FromGitter> <marksiemers> You'll need an if statement
<hello> huh uhm ok
<hello> and what should i check
<FromGitter> <marksiemers> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a54736d0505ad8b45d08adf]
<FromGitter> <marksiemers> `nil` will be falsey, any number will be truthy
<FromGitter> <marksiemers> Does that make sense?
<FromGitter> <marksiemers> In certain scenarios, you can shorthand it ⏎ ⏎ ```number + 1 if number``` [https://gitter.im/crystal-lang/crystal?at=5a5473e56117191e6142647f]
<hello> not really. whats the number and calculate_number ? is number the thing that returns the u64?
<FromGitter> <marksiemers> `calculate_number` is just a made-up method name - that would return a `UInt64?`
<FromGitter> <marksiemers> If you provide the code you are working with, that might be more helpful
<FromGitter> <marksiemers> than my madeup examples
<FromGitter> <marksiemers> `number` in the above example is just a local variable that holds the result of `calculate_number`
<FromGitter> <bajro17> This is git repo for PayPal SDK what I want make you can follow progress and help also :D I will appreciate it
<FromGitter> <LuckyChicken91_twitter> so its actually the same somehow?
<FromGitter> <LuckyChicken91_twitter> theres just one thing that returns u64?
<FromGitter> <LuckyChicken91_twitter> (im "hello")
<FromGitter> <bararchy> @bajro17 your crystal repo looks like a ruby repo :) Gemfile and rspec etc..
<FromGitter> <bararchy> I would suggest you restructure using
<Groogy> UInt64? is a shorthand/alias for writing UUInt64 | Nil, this is part of the crystal type system
<FromGitter> <bararchy> crystal init app paypal_crystal_SDK
<Groogy> and just like you do with other similar cases, if you test the variable you dequalify its type from being Nil, or False
<Groogy> and the type is removed within that scope
<FromGitter> <LuckyChicken91_twitter> at me its always UInt64 | Nil
<FromGitter> <LuckyChicken91_twitter> so i dont think i need the if query
<Groogy> eh... you still need to if you want to use the variable as an UInt64
<Groogy> any operation the Nil type doesn't support it will result in a compilation error
<FromGitter> <LuckyChicken91_twitter> but i dont understand whats calculate_number means
<Groogy> that was just his example of how he "got" the variable
<FromGitter> <LuckyChicken91_twitter> i just have one method that returns this uint64?
<Groogy> ignore it
<FromGitter> <bararchy> This will create an initialized got repo with your basic files (specs src readme etc..)
<FromGitter> <bararchy> This structure is what is expected by shards , so people can use your work
<FromGitter> <marksiemers> @LuckyChicken91_twitter - can you put a code sample in https://carc.in/
<FromGitter> <bararchy> Its also became the standard in the communit
<FromGitter> <marksiemers> then paste the link here?
<FromGitter> <LuckyChicken91_twitter> here: ⏎ im getting the uint64? with this code: ⏎ `guild_id = cache.resolve_channel(payload.channel_id).guild_id` ⏎ and in the docs it says: ⏎ `#guild_id : UInt64?` [https://gitter.im/crystal-lang/crystal?at=5a547668ba39a53f1af2e2a3]
<FromGitter> <marksiemers> What will you do with the `guild_id`?
<Groogy> yes so that variable now is both an UInt64 and a Nil
<Groogy> or well its type is
<FromGitter> <LuckyChicken91_twitter> this: ⏎ `client.create_guild_ban(guild_id, user_id)`
<Groogy> and I guess create_guild_ban does not expect a Nil value right?
<FromGitter> <LuckyChicken91_twitter> and the error says these two variables are `(UInt64 | Nil), UInt64` so its not the error of user_id
<FromGitter> <LuckyChicken91_twitter> yes
<FromGitter> <LuckyChicken91_twitter> wait i will look
<FromGitter> <marksiemers> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a5476e1290a1f456167bd28]
<Groogy> So you must remove the type Nil from the variable guild_id
<Groogy> read that section of the docs
<FromGitter> <LuckyChicken91_twitter> ok will do
<FromGitter> <marksiemers> The if statement is like saying "If this thing is not nil"
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] ysbaddaden closed pull request #5560: Adds OpenBSD's pledge() (master...openbsd-pledge) https://git.io/vNt2y
<FromGitter> <LuckyChicken91_twitter> it works thanks
<FromGitter> <marksiemers> np ⏎ get used to that pattern (or any conditional check) to take care of nilable types (e.g. `(String | Nil)`, `(Int | Nil)`, etc.)
flaviodesousa has joined #crystal-lang
andrewzah has joined #crystal-lang
<FromGitter> <bajro17> Its its Ruby repo copied and changed extensions I just work on it for now I want fix syntax than I will focus to make actual shard
claudiuinberlin has joined #crystal-lang
mark_66 has joined #crystal-lang
hello has quit [Quit: Page closed]
emgonam2 has joined #crystal-lang
<emgonam2> i got kemel compile errno
<emgonam2> my crystal version 0.25.2
<emgonam2> failed to convert json to bson stringify {} of Float => Float
alex`` has quit [Ping timeout: 265 seconds]
dhk has joined #crystal-lang
<FromGitter> <bajro17> what you try compile?
joe_-_ has joined #crystal-lang
joe_-_ has quit [Remote host closed the connection]
dhk has quit [Quit: Leaving]
dhk has joined #crystal-lang
rohitpaulk has joined #crystal-lang
cbass has joined #crystal-lang
dhk has quit [Quit: Leaving]
<FromGitter> <bew> @bajro17 I don't think it's a good idea to take an existing Ruby gem and manually convert the code to Crystal: they are different languages, and things doesn't always translate or things are not done the same way in Cr than on Rb. I would suggest you to forget this conversion repo, and create a brand new crystal project, and starting to document yourself about the official paypal's HTTP API, and make a Crystal
<FromGitter> ... shard based on this documentation. Of course you can take inspiration from the Ruby gem on the files, object hierarchy, and the final dev API exposed by the gem. But don't take good Ruby code, change the syntax and expect it to be good Crystal code.
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <bararchy> ^ @bew totally agree
rohitpaulk has joined #crystal-lang
<FromGitter> <bararchy> When I started playing with Crystal 2013? I automatically looked at Ruby and tried to "make it crystal" , now I know better and would usually just think about the task and do it purely Crystal from the start, doing a conversion would make you think Ruby instead of Crystal and would make you ignore misuse the wonderful things Crystal has to offer
<FromGitter> <bararchy> More then that, Crystal has made me a better Ruby dev :)
<FromGitter> <bajro17> :'( my dreams are ruined
<FromGitter> <bew> Hmm not your dreams I hope, but the way to accomplish one of them will need to change I think ;)
<FromGitter> <bajro17> I just joke I dont give up I will now check more how to do it in proper way
<FromGitter> <bew> We're here to help if needed (not 24/7 though ˆˆ)
<FromGitter> <bajro17> is there anything like on golang site tour for crystal
<FromGitter> <bajro17> it is so hard to find any guide or tutorial
<FromGitter> <bajro17> specialy video almost impossible
<FromGitter> <bew> Currently not, this is a current issue we're discussing. Yeah I agree it's quite difficult to start. I suggest to look at existing source code, learn by reading and understanding then doing. I suggest you to look at the code of another shard wrapping an http api, see how it handle it
<FromGitter> <bew> @bararchy do you know a good one?
<FromGitter> <bew> Or @oprypin @RX14 ?
<FromGitter> <bew> Or anyone ˆˆ
<emgonam2> me too
<FromGitter> <sdogruyol> Can we get some upvote please https://news.ycombinator.com/item?id=16104755 :)
emgonam2 has quit [Read error: Connection reset by peer]
emgonam2 has joined #crystal-lang
<FromGitter> <bew> the post is great!
<FromGitter> <sdogruyol> yeah, good job @marksiemers 👍
<crystal-gh> [crystal] splattael opened pull request #5561: Fix spec name for parsing BigDecimal from floats (master...patch-2) https://git.io/vNtQ5
<FromGitter> <bararchy> @bew @bajro17 a nice shard to look at is the aws API https://github.com/taylorfinnell/awscr-s3/blob/master/README.md , or even the Oauth from STD lib
<ua> i'm actually using ruby's pry for prototyping / plaing with stuff and then run (+ sometimes slight modifications) in crystal for faster execution
<ua> anyone uses it like that?
<FromGitter> <bararchy> Nope, look above for reasoning . also, you have crystal play and ICR
jnyw has quit [Quit: WeeChat 2.0.1]
<ua> dunny, feels better when i can move and change things around running program
<ua> in pry i can load data into class once and then modify and run code without recompiling/restarting
<ua> something like shorter feedback loop
<FromGitter> <bararchy> ua https://github.com/crystal-community/icr ?
<FromGitter> <bew> ua did you tried crystal play or icr? Your description seems to fit pretty well for these 2 tool (well it will recompile but you almost don't see it)
<ua> just crystal play
<ua> i havent seen icr, cool thanks
<ua> hmm i think ive used icr
<ua> long time ago but then went back to pry
<FromGitter> <bew> I like how they've added syntax highlighting in ocr lately
<FromGitter> <bew> icr*
<ua> thing is in icr i cant just load data into memory once and then monkeypatch and run code around it
<ua> basically no eval no real REPL
<FromGitter> <bararchy> ua working on Ruby and then saying "ill just change it to Crystal when it works" sounds like a lost of wasted work for me, but, if it works for you enjoy :)
<FromGitter> <bararchy> @bew would love your input on above issue
<ua> nah, not really, it just breaks very rarely in some places
<ua> stuff like having to use BigInt manually, did that yesterday
<ua> got orders of magnitude speed improvement, very happy about it
<ua> lol
<ua> ah my use case i guess is unusual, processing lots of data, so time difference in execution between ruby and crystal is really worth it to do slight code modifications
<ua> but then im really lazy
<FromGitter> <bew> @bararchy I'm not sure I could add anything, I'm still student, never did a GSoC myself and never mentored anyone ˆˆ
hightower has joined #crystal-lang
hightower3 has quit [Ping timeout: 248 seconds]
<FromGitter> <bew> @bararchy I don't know `cryatal-db` ˆˆ (typo in your gsoc issue)
<FromGitter> <bararchy> XD
<FromGitter> <bararchy> will fix
<FromGitter> <bararchy> Fixed also added links so it will be clearer for those not knowing about the projects
<RX14> why is that issue on crystak-lang/crystal?
<FromGitter> <bajro17> is there any method in array to compare 2 values
<FromGitter> <bew> Good idea, could you add links to gsoc event, what's needed etc?
<RX14> it doesn't even mention asking anyone to work on the compiler
<FromGitter> <bew> That would be good idea though
<RX14> @bajro17 what do you mean?
<RX14> to compare two values you use == but I don't see how that relates to array
<FromGitter> <bajro17> I little practive
<FromGitter> <bajro17> practice
<RX14> @bew @bararchy it's my understanding that if you submit "crystal" as a project to gsoc you should be working on... crystal
<FromGitter> <bajro17> and I have for example in array 1,2,3,3,4,5,6,6,6
<RX14> not shards
<FromGitter> <bew> Good point RX14
<FromGitter> <bararchy> > **<RX14>** why is that issue on crystak-lang/crystal? ⏎ Wait, what ?
<FromGitter> <bajro17> I want to replace same numbers is there any method to remove same
<RX14> @bararchy gsoc
<FromGitter> <bajro17> or need use [n] == [n+1]
<RX14> in my opinion there isn't any shards in crystal which could keep someone busy all summer working full-time
<RX14> which is what gsoc is
<RX14> it's like 3 months meant to be 40 hours a week
<RX14> iirc
<RX14> is there *that much* that needs to be done on kemal? i hope not
<RX14> on amber or another large framework? maybe
<RX14> on crystal? definitely
<FromGitter> <bararchy> RX14, It was suggested that maybe the compiler it a little to hard for a student to come and work on, if you think this isn't true (And i value your opinion as a compiler developer) please let me know
<RX14> crystal is not the compiler
<FromGitter> <bew> @bajro17 what are you trying to do? Remove duplicates? Why not use a Set (no duplicate by design)?
<RX14> i've been busy for 2 years and havent even touched the compiler properly @bajro17
<RX14> oops
<RX14> @bararchy
<FromGitter> <bajro17> thanks @bew :)
<FromGitter> <bararchy> I see, do you think it makes sense for a Crystal first timer to just hop on the Compiler and produce actual relevant code?
<RX14> @bararchy I didn't talk about the compiler...
<FromGitter> <bararchy> So STD?
<RX14> <RX14> i've been busy for 2 years and havent even touched the compiler properl
<RX14> meaning i've been busy working on the std since I joined
<FromGitter> <bararchy> yeha, I can't understand what you meant without you actually saying it :) , sure, the std makes much more sense
<FromGitter> <bararchy> I'll add it
<RX14> the std needs cleaning up
<RX14> just so much needs to be done
<RX14> it needs to get a rethink of every module from A to Z
<RX14> some modules will probably be untouched
<RX14> but there are a lot where ripping them out and starting again would be ideal
<FromGitter> <bararchy> can you give me a few pointers like ⏎ ⏎ those 3 modules need x ⏎ those 2 classes need y ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5a54b48303838b2f2a8bf912]
<RX14> although with array/enumerable/hash thats just impractical and stupid
<FromGitter> <bararchy> I know OpenSSL needs love
<FromGitter> <bararchy> @datanoise started working on those but gone missing in the middle
<FromGitter> <bararchy> Thanks, missed this one
<FromGitter> <bararchy> RX14, would you be fine in mentoring?
<RX14> well my opinion is mentoring is a risk
<FromGitter> <bararchy> how come?
<RX14> at the end of the day gsoc isn't about the amount of work done
<RX14> it's about helping students
<RX14> if you get an adept student then you can get more work out of the time taken to mentor the students
<RX14> but it's probably not uncommon that you'd get more work just doing the work yourself
<RX14> i'd rater not think of gsoc as "free work done by a volunteer"
DTZUZU has quit [Ping timeout: 248 seconds]
<FromGitter> <bararchy> ofc not, it's a great opurtunity to ⏎ 1) Put Crystal out there ⏎ 2) teach the next gen of Crystal devs
<RX14> well if you do treat it as such then you have to think that someone somewhere is giving up a significant amount of time they would be spending on crystal to mentor a student
<RX14> I have no idea if i'm going to be able to have time to even work on crystal myself over the summber as I have no job lined up
<Papierkorb> bararchy, you usually don't teach someone totally new. Google itself even tells GSOC students to hang out in the community first to get to know it
<RX14> the people at manas I wouldn't be surprised if they said "no we want to work on crystal ourselves"
<RX14> and I'm not sure the mentor would want to be anyone outsde the core team
<FromGitter> <sdogruyol> @RX14 that's the main reason why we initially not mentioned compiler / std in the issue itself
<RX14> then my original point stands:
<RX14> why is this issue open on the compiler/std repo
<FromGitter> <sdogruyol> that's where everyone looks at?
<FromGitter> <bararchy> you knwo why, because this is the main repo for anything Crystal, and it's something that is still considered (the work on std)
<RX14> ok, then we need to set up some forums
<RX14> because using github issues as a messageboard isn't ideal
<FromGitter> <bararchy> I know it "technically" should have been in the google groups, but we know it dosen't have the same broadcast the git have
<FromGitter> <bararchy> True^
<FromGitter> <sdogruyol> Yeah, that's another discussion to make
<crystal-gh> [crystal] RX14 closed pull request #5561: Fix spec name for parsing BigDecimal from floats (master...patch-2) https://git.io/vNtQ5
DTZUZO has joined #crystal-lang
<FromGitter> <bararchy> having some inputs from @asterite and @mgarciaisaia
<FromGitter> <bararchy> would be great
<FromGitter> <Svenskunganka> RX14 about not being able to work on Crystal, to me that's quite bad news, as I believe you are a key person at this stage to bring Crystal to 1.0 and further, but I've voiced my opinion of you over on Reddit so you know how I feel. Which leads to me question, how does manas spend the bountysource money? I haven't found much transparenty in that area.
DTZUZU has joined #crystal-lang
<FromGitter> <Svenskunganka> transparency*
<RX14> they spend it to fund the time of the manas people working on crystal
<FromGitter> <sdogruyol> @Svenskunganka we're working to improve transparency, meanwhile have you read https://crystal-lang.org/2017/12/19/this-is-not-a-new-years-resolution.html yet :)
<FromGitter> <Svenskunganka> Missed that post, I'll have a read!
<FromGitter> <sdogruyol> great!
<travis-ci> crystal-lang/crystal#77db65a (master - Fix spec name for parsing BigDecimal from floats (#5561)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/326795486
<DeBot> https://github.com/crystal-lang/crystal/pull/5561 (Fix spec name for parsing BigDecimal from floats)
<FromGitter> <Svenskunganka> Thanks for linking the article @sdogruyol, definitely clears up some questions!
<FromGitter> <Svenskunganka> Have you explored the possibility of a foundation, e.g Apache Incubator or something similar?
<FromGitter> <bajro17> I have question why my while loop inside loop dont run every time just first time
<FromGitter> <bajro17> line 24 until 39
alex`` has joined #crystal-lang
cremes has joined #crystal-lang
<FromGitter> <asterite> because o is never reset to 0
<FromGitter> <bararchy> lol ⏎ ⏎ ```SSL_accept: Success (Errno)``` [https://gitter.im/crystal-lang/crystal?at=5a54c51a83152df26d4cd983]
<FromGitter> <bararchy> "Error: all is good"
<FromGitter> <bararchy> hahaha
dhk has joined #crystal-lang
dhk has quit [Client Quit]
emgonam2 has quit [Ping timeout: 240 seconds]
rohitpaulk has quit [Ping timeout: 265 seconds]
<FromGitter> <bew> Nice one x)
rohitpaulk has joined #crystal-lang
sigsegv has joined #crystal-lang
sigsegv has left #crystal-lang [#crystal-lang]
alex`` has quit [Ping timeout: 246 seconds]
<FromGitter> <yxhuvud> OpenSSL? It is a marvel of good error messages.
<FromGitter> <bararchy> yeha OpenSSL
rohitpaulk has quit [Ping timeout: 248 seconds]
emgonam2 has joined #crystal-lang
<FromGitter> <imonmyown> SNAFU
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Ping timeout: 264 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <bararchy> Well, cool, we have 3 mentors and 1 student
<FromGitter> <bew> 1 student?
<FromGitter> <bararchy> @MakeNowJust
<FromGitter> <bararchy> he want's to join as Student under the GSOC and to be mentored by Ary
<FromGitter> <bew> Ah yes ok :p
<FromGitter> <bararchy> @straight-shoota what about you? Mentor?
<FromGitter> <bararchy> Maybe @marksiemers
emgonam2 has quit [Ping timeout: 260 seconds]
DTZUZO has quit [Ping timeout: 256 seconds]
DTZUZO has joined #crystal-lang
return0e has quit [Ping timeout: 256 seconds]
LastWhisper____ has joined #crystal-lang
alex`` has joined #crystal-lang
return0e has joined #crystal-lang
<RX14> hmm
<RX14> that makes me think
<RX14> i'm a student, can I be a gsoc student for crystal?
<RX14> is that breaking the system?
<FromGitter> <asterite> no, approved
<FromGitter> <asterite> :-P
<FromGitter> <bararchy> RX14 no issue :) you can TBH
<FromGitter> <bararchy> but you need a mentor
<FromGitter> <bararchy> and that is a good idea BTW, you will be paid to work on Crystal
<FromGitter> <bararchy> at least for the time of the project
<FromGitter> <bararchy> you just need ⏎ Mentor + Student card (certificate that shows you are corrently in a university or other similar instetuation)
rohitpaulk has quit [Ping timeout: 240 seconds]
<RX14> well unless someone else approaches me with a job i'll probably do that then...
<FromGitter> <sdogruyol> you mean a full time job?
<RX14> yeah
<RX14> if someone wants to pay me mroe to work on what *they* want to add to crystal then sure lol
mark_66 has quit [Remote host closed the connection]
<FromGitter> <bararchy> RX14 be careful what you wish for ;)
<FromGitter> <sdogruyol> haha
<FromGitter> <bararchy> anyway, this is another drive to get in GSOC, also I know Papairkorb is a student too
<FromGitter> <bararchy> he can also enjoy this
<RX14> looks like I can work on gsoc if i've been working on crystal before
<FromGitter> <bararchy> can or can't?
<RX14> can
<RX14> its in the FAQ
<FromGitter> <bararchy> awsome!
<FromGitter> <bararchy> so totally cool
<RX14> doesn't mean i'll get accepted though
<RX14> lol
<FromGitter> <bararchy> If Crystal will get accepted, you most likely will get accepted has you have former knowledge that can help your choise of project succed
<FromGitter> <bararchy> ie. you know Crystal and are part of core dev team XD
<RX14> ehh i'm not so sure about that
emgonam2 has joined #crystal-lang
alex`` has quit [Ping timeout: 246 seconds]
<FromGitter> <bararchy> well, the Org admin decides who is getting in, so, lets say I send the application and become the project org admin, I'll let you in ;)
<FromGitter> <bararchy> hahahha
<RX14> well
<RX14> google supplies the money
<RX14> so they definitely have some say in it
<FromGitter> <bararchy> Yeha, but once they accept an organization, the organization decides who is ok
<RX14> ...huh
<RX14> that sounds gameable
<FromGitter> <bararchy> it's in the organization admin
<FromGitter> <bararchy> guide
<RX14> well
<FromGitter> <bararchy> yes and no, if we fuck it up we wont be joining next year
<FromGitter> <bararchy> etc..
<FromGitter> <straight-shoota> too bad I'm not a student anymore...
<FromGitter> <bararchy> But you can Mentor
<RX14> i presume someone at manas should be the org admin
<RX14> the org admin != mentor right?
<FromGitter> <bararchy> No no
<FromGitter> <bararchy> Org admin just send application etc..
<RX14> yeah
<FromGitter> <straight-shoota> hehe, I can mentor RX14 :P
<FromGitter> <bararchy> @straight-shoota That could be cool
<FromGitter> <bararchy> as we need pairs
<FromGitter> <straight-shoota> But I don't know if he could learn anything from me...
<FromGitter> <bararchy> well, in hes case, you can try and mentor, and he can do his best to just "do what's needed"
<FromGitter> <bararchy> also, Ary can help , etc...
<FromGitter> <bararchy> I'm writing you down as Mentor
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a54eaffd0514c785b0cd864]
<FromGitter> <bararchy> so it is up to organizations to choose and accept students
<FromGitter> <marksiemers> @bararchy - I would want to read more details about it, but I may be willing to Mentor, though I'm not sure I can provide that much help if RX14 and Papierkorb are the students. If it hasn't become obvious already, I lean more toward product management than I do writing std-lib and compilers.
<FromGitter> <bararchy> @marksiemers they hopefully wont be the only students, and the projects range from Compiler to rewrite docs.. etc..
<FromGitter> <bararchy> read about it and tell me what you think
<RX14> if I had the choice i'd rather get paid to work on cryatal independently and then mentor new people to the community
<FromGitter> <marksiemers> What about `crystal-db` and `crystal-pg` - could those be worked on as well?
<FromGitter> <straight-shoota> sure why not?
<FromGitter> <marksiemers> Well, opportunity cost of working on std-lib or the compiler
<FromGitter> <bararchy> @marksiemers `crystal-db` is already in the issue
<FromGitter> <marksiemers> Oh, great. yeah, I'm reading through the issue now.
cremes has quit [Quit: cremes]
cremes has joined #crystal-lang
vikaton has quit [Quit: Connection closed for inactivity]
emgonam2 has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 248 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <bew> Maybe I could apply to gsoc too ;) I almost applied last year, but I wasn't really available durong summer, this year will be different, and it could be some Crystal, this is heaven!
emgonam2 has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
vivus has joined #crystal-lang
flaviodesousa has quit [Remote host closed the connection]
<FromGitter> <bararchy> @bew Do you study in a uni or collegue?
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> What's the difference? (Google trad' gives me the same)
cbass has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> No difference XD just meant to know if I can write you down as a student
<FromGitter> <bararchy> I'll rephrase, are you currently a student in any formal instetution ?
<FromGitter> <bew> Ah yes student!
<FromGitter> <bew> Ty
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> @bew Added you under students :)
emgonam2 has quit [Ping timeout: 256 seconds]
<FromGitter> <bararchy> Oh, @ArtLinkov , would you be cool with Mentoring someone if they want to work on SHAInet ?
<oprypin> i dont think external libs are applicable but not sure
<oprypin> also hopefully you understand that you shouldn't have any expectations for this because the chance is tiny
<FromGitter> <sdogruyol> tiny?
<oprypin> the chance for a small org to be accepted in GSoC
LastWhisper____ has joined #crystal-lang
<FromGitter> <sdogruyol> how do they measure an organization
<FromGitter> <sdogruyol> by member count?
<oprypin> they probably dont disclose what they actually do
<FromGitter> <bararchy> oprypin Lets not jump for conclusions, Rubinius got in
<oprypin> that's bigger than Crystal
DTZUZU has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> True, I know smaller projects got in too
<FromGitter> <bararchy> also, they say if you don't get in, you can join under an umbrella org
<FromGitter> <bararchy> if all fail we can still do that
<FromGitter> <bararchy> but, more importenly, oprypin are you mentoring ? ;)
<oprypin> i would consider it
<FromGitter> <bararchy> Maybe Groggy can gelp too
<oprypin> the hard part is finding "digestible" tasks
jxv has joined #crystal-lang
<FromGitter> <bararchy> well, look at the relevant issue, I think we found kinda lot of them
<FromGitter> <bararchy> both in stdlib and compiler
<FromGitter> <bararchy> also, more then one mentor who will help people get into the relevant code
<oprypin> telling a student "pls fix those issues" can't work. it has to be a self-contained big project, i think
<oprypin> polishing Windows support would be one
<FromGitter> <bararchy> ^ I'll add it
<oprypin> to where? link
<FromGitter> <bararchy> also, adding Thread support ?
<FromGitter> <bararchy> here
<oprypin> this is a project that's very unlikely to succeed so.
<FromGitter> <sdogruyol> let's try our best :)
<FromGitter> <sdogruyol> even if we fail at getting selected, it's great to see the community taking action for this
<FromGitter> <bararchy> well, we need to add "levels" , as in easy, hard, medimum etc..
<FromGitter> <bararchy> then students choose what to take
<oprypin> not really, it should just all be medium
<FromGitter> <bararchy> not according to the guides
<FromGitter> <bararchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a55052c83152df26d4e92a2]
<oprypin> Infrastructure/Automation could be a thing
<FromGitter> <bararchy> all of those are aligable
<FromGitter> <bararchy> working on CI\Specs?
<FromGitter> <bararchy> or build automation
<FromGitter> <bararchy> for releases
<FromGitter> <bararchy> are those needed? if so I can add to the list
pynix has joined #crystal-lang
<oprypin> those are definitely needed but i can't elaborate on what exactly is needed
cbass has joined #crystal-lang
<FromGitter> <bararchy> whos would know?, the more info we give of the task the more likely it will to succeded
<oprypin> well yes, you do need to lay out the information carefully
<FromGitter> <bew> There is #3721 about ci
<DeBot> https://github.com/crystal-lang/crystal/issues/3721 (Continuous Integration Infastructure)
<FromGitter> <bararchy> Oh, nice @bew
<FromGitter> <straight-shoota> RX14 has been working on infrastructure
<FromGitter> <bararchy> I added this issue
<FromGitter> <bararchy> as CI\Automation
<FromGitter> <bararchy> it's a good idea :) Thanks oprypin
<FromGitter> <straight-shoota> that would be really great
pynix has quit [Ping timeout: 260 seconds]
<FromGitter> <bararchy> when we get a full list of Mentors, we can start sorting who is going to help on what field
<oprypin> is there a detailed FAQ for organizations?
<RX14> oh
<RX14> well I kinda wanted to do the CI myself heh
<RX14> i guess I shouldn't hold up people just so I could NIH on the CI
DTZUZU has joined #crystal-lang
sagax has joined #crystal-lang
<oprypin> :p
<RX14> i have the greatest plans and no time
<FromGitter> <sdogruyol> IMHO you should focus on a single task at once :) (it's hard though)
<FromGitter> <bararchy> look at Org Admin at the left side
<FromGitter> <bararchy> it's all the relevant FAQ for Orgs
<oprypin> yeah thx
<FromGitter> <bararchy> 👍
<oprypin> it's not all though, there is a particular field in the organization creation page that i was wondering about
<FromGitter> <bararchy> which is it?
<oprypin> there's a field to specify other organizations or google employees that can vouch for the organization
<oprypin> (i'm not 100% sure on this though)
<FromGitter> <bararchy> well, I guess it's not really big deal for something as robust and known as Crystal, maybe if it was a 3 man project with 30 stars or something
<oprypin> anything helps
<FromGitter> <bararchy> Do we know people from Google? :)
<oprypin> i actually got excited about this, disregard what i said previously
<FromGitter> <bararchy> XD
<FromGitter> <bararchy> cool !
<FromGitter> <sdogruyol> I remember @bcardiff presenting Crystal at Google last year, maybe he has some contacts there?
<oprypin> lol
<FromGitter> <bararchy> hmmmm interesting ^
<oprypin> basically i'm the contact
<FromGitter> <bararchy> hahahah
<FromGitter> <bararchy> you're from Google?
<FromGitter> <sdogruyol> what?
<RX14> being a stalker, I already noticed oprypin was part of the google org
<FromGitter> <sdogruyol> https://github.com/oprypin
<FromGitter> <sdogruyol> lol
<FromGitter> <bararchy> OMG lol never noticed
<FromGitter> <sdogruyol> when did you join? I'm pretty sure haven't seen that before oprypin
<FromGitter> <bararchy> oprypin, you should give us credit !
<FromGitter> <bararchy> :)
<RX14> oprypin can help destroy go from the inside lol
<FromGitter> <bararchy> "Crystal is awsome, those guys can do anything"
<FromGitter> <bararchy> hahahaha
<FromGitter> <sdogruyol> roflmao
<FromGitter> <bararchy> maybe he is a Go spy ??
<FromGitter> <sdogruyol> double agent :O
<oprypin> no i think it's literally just a field to specify a name during the creation of the organization, just don't forget about it
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <bew> Lool x) love reading you guys
alex`` has joined #crystal-lang
<oprypin> that's all i wanted say in a public/logged chat
<FromGitter> <bararchy> XD noooo
<FromGitter> <bararchy> anyway, awsome!
<FromGitter> <bararchy> would you care to mentor though ?
<FromGitter> <bararchy> oprypin I also know people from DeepMind in Israel, so we can use them too
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <bcardiff> :-) this is fun. @oprypin next thing is that you've wen't to Herräng during July and there will be too much coincidence. ⏎ ⏎ When I presented at google, my contact was a former co-worker of Manas that started to worked in google nyc.
<oprypin> i didnt go to Herräng, what about it?
<FromGitter> <bararchy> @bcardiff would you care to Mentor for GSOC ?
<FromGitter> <sdogruyol> too many googlers alert :P
DTZUZO has joined #crystal-lang
emgonam2 has joined #crystal-lang
<FromGitter> <bcardiff> @bararchy I would happy to answere and offer guidance in the context of GSOC. I have some weeks where I will be mostly offline somewhere between May-Jul (not all of them!) But if there can be a channel where all teh GSOC communication can be tunneled so I give more priority that could work. I've never participate before so I am unsure about the expected work load.
<FromGitter> <bararchy> @bcardiff Cool, I'll add you up
<FromGitter> <bcardiff> @oprypin Herräng, a swing dance festival :-) lots of people (~1K) all around the globe go there during July. In the swing community people know about stockholm & herräng and nothing else about sweden :-P. They play a huge role in the modern history of the dance.
<oprypin> yeah with the first search result being about dancing, i figured. nah I don't dance. but cool!
<FromGitter> <codenoid> yeah. electro swing is cool
<FromGitter> <codenoid> my music from 3 years ago
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> good luck ✨
rohitpaulk has quit [Ping timeout: 276 seconds]
<oprypin> bararchy, i'm not sure if we should pre-enlist students xD
<oprypin> also i dont think people who happen to be studying cant be mentors
<FromGitter> <bararchy> applicant as students can't be mentors, not talking about studnets IRL who want to mentor
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Read error: Connection reset by peer]
<FromGitter> <bararchy> it's a good idea to see if there are strong people from the comuunity who would like to join as students, because it encourge all of us to work extra on this for them
<FromGitter> <bararchy> If I can help RX14 get paid for working on Crystal, that's a great drive for me
<FromGitter> <imonmyown> seeing all this discussion shows a healthy community spirit, which (in my opinion) is much more important than eventual contributions (if any should follow) during GSoC
<emgonam2> <3
<FromGitter> <bararchy> ^ 100% with you
<FromGitter> <codenoid> My wish for crystal this year is `fast compilation time`, just like interpreter 🐶
<FromGitter> <bararchy> well, debug is pretty fast, and release is faster if you use --thin-lto
<crystal-gh> [crystal] petoem opened pull request #5563: Fix Time::Span multiply and divide (master...fix-time_span-multiply-divide) https://git.io/vNq5n
<FromGitter> <bararchy> I want to have alias = Int32 | Int64 ⏎ But i want them both to be #.class, when calling my_alias.class it produces ⏎ (Int32 | Int64):class instead of (int32:class | Int64:class)
<FromGitter> <bararchy> is it a bug or am i missing something ?
DTZUZO has quit [Ping timeout: 256 seconds]
<FromGitter> <bararchy> I can ofc do my_alias_class = (Int32.class | Int64.class) , but I thought there is something easier
DTZUZO has joined #crystal-lang
<FromGitter> <asterite> `Int32 | Int64` is the union type
<FromGitter> <asterite> the other case is a union of types
<FromGitter> <asterite> mmm... pretty confusing
<FromGitter> <asterite> To be honest, I don't know (or remember) if I understand it :-P
DTZUZU has quit [Ping timeout: 248 seconds]
<FromGitter> <bararchy> If you don't know then I give up hahha, I'll use the `.class` trick
wontruefree has joined #crystal-lang
<FromGitter> <asterite> Oh, now I see
<FromGitter> <asterite> The .class trick gives you a different thing
<FromGitter> <asterite> it means it's either the Int32 type, or the Int64 type
<FromGitter> <asterite> the alias is about the type of instances
<FromGitter> <bararchy> as in ⏎ ⏎ ```alies_regular = Int64 | Int32 ⏎ alias_class = Int64.class | Int32.class``` [https://gitter.im/crystal-lang/crystal?at=5a551cb7b48e8c3566bdcb09]
<FromGitter> <bararchy> I was wondering if I can do the 2nd without doing `.class` on each
<FromGitter> <bararchy> like, .each {|i| i.class} or something XS
<FromGitter> <asterite> but are you using the `alias` keyword there?
<FromGitter> <bararchy> yeha ofc
wontruef_ has joined #crystal-lang
<FromGitter> <bararchy> just tried to simplfy the example
<FromGitter> <asterite> It depends on what you want to do
<FromGitter> <asterite> They are different things
claudiuinberlin has joined #crystal-lang
<FromGitter> <asterite> For example `1 || 1_i64` has the type `Int32 | Int64`
<FromGitter> <asterite> But `Int32 || Int64` has the type `Int32.class | Int64.class`
jxv has quit [Quit: zzz…]
DTZUZO has quit [Ping timeout: 252 seconds]
wontruefree has quit [Ping timeout: 252 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <asterite> Makes sense?
<FromGitter> <bararchy> @asterite yeha, it seems to work now :) thanks, I was using wrong syntax lol
alex`` has quit [Read error: No route to host]
emgonam2 has quit [Ping timeout: 268 seconds]
DTZUZO has quit [Ping timeout: 248 seconds]
DTZUZO has joined #crystal-lang
hightower3 has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
<FromGitter> <asterite> can IRC be down?
<FromGitter> <asterite> ( https://status.slack.com/ : Connectivity issues for all customers )
<Yxhuvud> IRC is not down.
wontruef_ has quit [Quit: The Internet needs a break and I need a cookie]
DTZUZO has joined #crystal-lang
<FromGitter> <asterite> I mean, can it be down? Is freenode down sometimes?
<FromGitter> <asterite> probably yes...
<FromGitter> <alehander42> slack had problems the last hour
<oprypin> IRC can be down, it's just some servers as usual
<FromGitter> <asterite> yeah, hehehe, I realized it was a silly question after I made it
DTZUZU has joined #crystal-lang
DTZUZU has quit [Ping timeout: 255 seconds]
p0p0pr37 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vNqA4
<crystal-gh> crystal/master 5f1440d Ary Borenszweig: Formatter: fix bug regarding backslash (#5194)
jxv has joined #crystal-lang
DTZUZO has joined #crystal-lang
<RX14> well IRC could be distributed
<RX14> it's not but it could be
DTZUZO has quit [Read error: Connection reset by peer]
<oprypin> RX14, it is actually kinda distributed, that's where netsplits come from
<RX14> yeah
<RX14> but like
<RX14> not enough
<RX14> it's federated not distributed
<RX14> i think
<oprypin> that's a nice way to put it
DTZUZO has joined #crystal-lang
<FromGitter> <bajro17> Hi people I really need help
<jhass> well freenode at least is quite well distributed into different DCs around the world, more as a side effect of the servers being donations though
<FromGitter> <bajro17> if someone use stripe atlas I need invitation
DTZUZO has quit [Ping timeout: 248 seconds]
DTZUZO has joined #crystal-lang
jxv has quit [Quit: zzz…]
DTZUZU has joined #crystal-lang
DTZUZU has quit [Ping timeout: 240 seconds]
cbass has quit [Ping timeout: 264 seconds]
wontruefree has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5f1440d (master - Formatter: fix bug regarding backslash (#5194)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/326975851
<DeBot> https://github.com/crystal-lang/crystal/pull/5194 (Formatter: fix bug regarding backslash)
jxv has joined #crystal-lang
rohitpaulk has joined #crystal-lang
DTZUZO has quit [Ping timeout: 256 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
DTZUZO has joined #crystal-lang
Ven`` has joined #crystal-lang
DTZUZU has joined #crystal-lang
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZO has quit [Ping timeout: 276 seconds]
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
DTZUZO has joined #crystal-lang
sz0_ has joined #crystal-lang
wontruefree has joined #crystal-lang
wontruefree has quit [Remote host closed the connection]
wontruefree has joined #crystal-lang
wontruefree has quit [Client Quit]
jnyw has joined #crystal-lang
<FromGitter> <bararchy> So, who is working on crystal play android edition ? :)
wontruefree has joined #crystal-lang
RX14 has quit [Quit: Fuck this shit, I'm out!]
Vexatos has quit [Quit: ZNC Quit]
<oprypin> i dont know how people can suggest splitting up the compiler with a straight face. thank goodness that @straight-shoota has put it diplomatically
<oprypin> bararchy, that might actually be a project because if it's not already working, it's quite close
jxv has quit [Quit: zzz…]
<FromGitter> <bararchy> I'll add to the list :)
<ua> erm
<ua> play.crystal-lang.org/#/r/3d1i
<ua> not a catholic but what did i do wrong
<ua> ahh okay see
<ua> sorry
RX14 has joined #crystal-lang
Vexatos has joined #crystal-lang
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jxv has joined #crystal-lang
jxv has quit [Client Quit]
wontruefree has quit [Quit: The Internet needs a break and I need a cookie]
<FromGitter> <straight-shoota> @oprypin You never know from what background people are looking at things... maybe they're used to the strategy of devide and conquer which can help solving many problems. Unfortunately a compiler rewrite doesn't seem to be one of them ;)
<FromGitter> <Dillybob1992> Hey guys just got done reading the removal of global variable thread. im following the TCPServer API and want to use a global `users` = [] of TCPServer to store players connections but can't seem to use the users array inside `handle_client`. as I get `undefined local variable or method 'users'`
jxv has joined #crystal-lang
<FromGitter> <Dillybob1992> btw, im very new to crystal (in fact, installed lubuntu just so i can dev with it). the syntax is awesome!
<FromGitter> <straight-shoota> Hey @Dillybob1992
<FromGitter> <straight-shoota> Could you show some more code?
jxv has quit [Client Quit]
<FromGitter> <Dillybob1992> hey :) should I paste it here, or use pastebin?
jxv has joined #crystal-lang
<FromGitter> <Dillybob1992> https://pastebin.com/raw/xyAGwZfY here ya go
<FromGitter> <straight-shoota> yeah `users` is variable in top level scope, you can't access that from a method
<FromGitter> <straight-shoota> either you inline the methods body directly at the call
<FromGitter> <HCLarsen> Newest Crystal blog post folks: ⏎ https://hclarsenblog.wordpress.com/2018/01/09/crystal-grep/
<FromGitter> <Dillybob1992> > inline the methods body directly at the call ⏎ like, pass by argument?
<FromGitter> <straight-shoota> yes, for example
<FromGitter> <straight-shoota> or you make `users`accessible e.g. by making it a class variable
<FromGitter> <Dillybob1992> So I can create something like class GameServer, then do @@users = [] of TCPSocket, and it'll be available everywhere in all my methods inside that GameServer?
<FromGitter> <straight-shoota> yes
<FromGitter> <Dillybob1992> Ohh, sweet 😄 i'll try that now
<FromGitter> <straight-shoota> but you can even access it from outside that class using an accessor like `class_getter users`
<FromGitter> <Dillybob1992> Wow, neat
<FromGitter> <straight-shoota> https://carc.in/#/r/3d1t
<FromGitter> <straight-shoota> (the error is just because the example can't run on carc.in but it should when you can open TCP ports)
<FromGitter> <Dillybob1992> oh wow, i see
<FromGitter> <straight-shoota> that's more like a hack though
<FromGitter> <elorest> While we're on the topic of TCPSocket.... What is the best way to detect if the TCPServer is down. I need to pass hundreds of values a second through, but need to detect if the server is no longer reachable, and reconnect.
<FromGitter> <straight-shoota> you mean connecting from crystal to a tcp server or checking if a crystal tcp server is running?
<FromGitter> <elorest> I was hoping that the method `#closed?` would be useful but it only seems to switch if I call `close_write` and `close_read` on the client first.
<FromGitter> <elorest> Both/Either. The client needs to do the detection so it shouldn't really matter what the server is written in...
<oprypin> elorest, if there's one thing you should know about sockets, asking one if it's closed is never helpful
<oprypin> the only thing you can do is ping it and give it some time before deciding that it's non-responsive
<FromGitter> <Dillybob1992> i'm going to try to write my own gameserver class @straight-shoota just bcz i spent a lot of time reading docs/challenge myself, if i can't get it, gonna use your module hack :D
<FromGitter> <elorest> By ping do you just mean send a message through and see if it responds?
FromGitter has quit [Remote host closed the connection]
oprypin has quit [Quit: Bye]
<RX14> yes
FromGitter has joined #crystal-lang
<RX14> @elorest but if reconenction is your goal, why not just set a read_timeout and write_timeout
<RX14> and then reconnect when read/write raise
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <elorest> <RX14> ⏎ This sort of works but takes too long before it errors. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a5550a4b48e8c3566bef7ba]
<RX14> so set write_timeout lower?
<FromGitter> <elorest> Would setting read and write timeouts to a really low number fix this?
justicefries has joined #crystal-lang
<RX14> like what
DTZUZO has joined #crystal-lang
justicefries has left #crystal-lang [#crystal-lang]
<RX14> 10s is as low as i'd go
<RX14> @elorest you don't even set timeouts in your sample
<FromGitter> <elorest> Why would going lower than 10 seconds be bad.
<RX14> you'll probably get spurious disconencts
<RX14> TCP queues are long
<FromGitter> <elorest> There are defaults though.
<FromGitter> <elorest> Currently it reconnects after one or two missed messages.
<FromGitter> <elorest> Apparently there isn't a way to catch it faster than that then?
<RX14> that's after setting a 10s timeout?
<FromGitter> <elorest> No before.
<FromGitter> <elorest> 10 seconds if far longer than it currently takes to reconnect.
<RX14> oh ok
<RX14> well then
<FromGitter> <elorest> So i'm not sure if setting it to 10 seconds would be useful or not.
<RX14> you're not going to get better than that
<FromGitter> <elorest> Ok. Thanks.
<RX14> 10s for a TCP reconnect?
<RX14> that's instant
wontruefree has joined #crystal-lang
oprypin has joined #crystal-lang
wontruefree has quit [Client Quit]
<FromGitter> <Dillybob1992> Ok! I finally got it I think: https://pastebin.com/raw/7fe4Me1F however, for some reason, still getting `undefined local variable or method 'users'` :(
<RX14> @Dillybob1992 you need to refer to users as @@users
<RX14> since that's how you defined it
<RX14> well, more accurately the syntax for class vars is @@
<FromGitter> <marksiemers> It isn't defined, there is just a class variable. Use that or create a method that returns the class variable
DTZUZU has joined #crystal-lang
<FromGitter> <Dillybob1992> I see, there is going to be alot of @@'s all over once i get done with this hahaha
<RX14> you shoulsn't use class vars very often
<FromGitter> <marksiemers> If you want to avoid that, just create: ⏎ ⏎ ```def users ⏎ @@users ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5a5555a4ba39a53f1af80d69]
<FromGitter> <Dillybob1992> lol, wut.. that's AWESOME
<RX14> or just class_getter users
<RX14> i mean
<RX14> class_getter users = [] of TCPSocket
jxv has quit [Quit: zzz…]
<RX14> plus do you really want a global variable? Why aren't you using an instance variable here?
<RX14> shouldn't the list of users be per-gameserver
<RX14> not between all gameservers?
<FromGitter> <straight-shoota> he started with a script without any types and couldn't use a top level variable in a method
<FromGitter> <straight-shoota> getting oop-ifyied step by step
<FromGitter> <straight-shoota> RX14 do you still have draft for 0.24.1 release notes?
<RX14> draft?
<RX14> why, they're released
<RX14> oh you mean the blog post?
<FromGitter> <straight-shoota> you mentioned in the website issue that you collected some ideas for a blog post
<RX14> I got less than 1 sentence into it
<FromGitter> <straight-shoota> okay then
<RX14> actually 1.5
<RX14> Crystal 0.14.1 has been released!
<RX14> Crystal 0.24.1 has bought a lot of new and cool features,
<RX14> then I stopped
<RX14> lol
<FromGitter> <straight-shoota> that's a great opener =)
<FromGitter> <Dillybob1992> well, im just trying to keep track of all the connected players in one master server for now. i am cming from nodejs and crystal has been the one that i can understand the most, been trying them all (elixir, c++, golang)
<RX14> @Dillybob1992 you use classes in nodejs?
<RX14> or not
<FromGitter> <Dillybob1992> nope, never haha
<RX14> hmm
<RX14> a bit of a learning curve then