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
faustinoaq has joined #crystal-lang
<FromGitter> <exts> How come this errors out? https://play.crystal-lang.org/#/r/33ya
<FromGitter> <exts> works fine if the parameter names aren't the same as the variable name
<FromGitter> <bew> it's just that assigning a var to itself is completely useless
faustinoaq has quit [Ping timeout: 255 seconds]
<FromGitter> <exts> that's a named parameter no?
<FromGitter> <bew> = is for assignation
<FromGitter> <exts> so how do name parameters work in crystal?
<FromGitter> <bew> did you see the fixed example from @elorest ?
<FromGitter> <bew> or simply, did you read the docs about it?
<FromGitter> <exts> ah I missed that link
<FromGitter> <exts> thanks
<FromGitter> <elorest> πŸ‘
<FromGitter> <exts> ah I know why I wrote it like that, was messing with nim earlier this week :)
<FromGitter> <exts> sorry about the confusion, sometimes my brain gets stuck in another language
faustinoaq has joined #crystal-lang
<FromGitter> <Qwerp-Derp> What does this mean? `GC Warning: Finalization cycle involving 0x106f8db80`
<FromGitter> <Qwerp-Derp> I'm pretty sure there's a problem with the garbage collection removing objects from the heap, but I have no idea what the object is so I can't get rid of the warning
oneness has joined #crystal-lang
oneness has quit [Client Quit]
cra-_ has joined #crystal-lang
<hightower4> What can I use for (1) an equivalent of Ruby's Process.pid/.gid, and (2) getpwuid/getpwnam?
Ven has joined #crystal-lang
Ven is now known as Guest76184
Guest76184 has quit [Ping timeout: 248 seconds]
cra-_ has quit [Remote host closed the connection]
<FromGitter> <Qwerp-Derp> @bew I'm still confused as to what it means, is it something like a circular reference?
<FromGitter> <bew> 'wont respond, I have no idea/knowledge in GCs unfortunatly
<FromGitter> <Qwerp-Derp> Ah, alright
<faustinoaq> Hi, <@sdogruyol> Can you contact to @f to redirect https://crystalshards.xyz to https://crystalshards.org ?, I think no need to keep paying two servers :)
<FromGitter> <Qwerp-Derp> @bew Never mind I know what the issue is, it was a circular reference in a class
<robacarp> would anyone be interested in doing some code review on a small library I wrote? https://github.com/robacarp/icmp.cr
<robacarp> I'm a little puzzled by how to test it, for one, but I'm also all ears for ways the code can be improved
Ven has joined #crystal-lang
badeball_ has quit [Remote host closed the connection]
Ven is now known as Guest5943
<faustinoaq> Hi, somebody knows if is possible to stprage a crystal struct on a file like C? https://stackoverflow.com/questions/16997141/writing-structs-to-a-file-in-c
<faustinoaq> s/stprage/storage/
<FromGitter> <bew> @faustinoaq I don't think it's a good idea to do that, you should serialize it and store that in the file
<faustinoaq> <@@bew>, yeah, I know, but I'm want to show some friend this is also possible using crystal :), Maybe using LibC.fwrite?
<faustinoaq> or Pointer#write_bytes?
<faustinoaq> Can I write a file using binary mode "b"? https://github.com/crystal-lang/crystal/blob/master/src/file.cr#L65
Guest5943 has quit [Ping timeout: 240 seconds]
<robacarp> you can
<faustinoaq> Yeah, I just found some examples in ruby :)
<faustinoaq> I like how ruby documentation works for crystal in some cases.
<faustinoaq> <@@bew> Oh, I found https://github.com/derekddecker/crystal-ruby-marshal :)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <Qwerp-Derp> Has anyone else received a `GC Warning: Finalization cycle involving XX` in their Crystal programs? I'm not sure what exactly my issue is, I can't seem to minimise it or track it down.
<FromGitter> <Qwerp-Derp> I'm fairly certain it's to do with a class with itself as a variable, but I'm not 100% sure.
rohitpaulk has quit [Ping timeout: 250 seconds]
<faustinoaq> Google is your friend XD
rohitpaulk has joined #crystal-lang
_whitelogger has joined #crystal-lang
faustinoaq has quit [Quit: Konversation terminated!]
rohitpaulk has quit [Ping timeout: 248 seconds]
faustinoaq has joined #crystal-lang
<faustinoaq> https://www.tiobe.com/tiobe-index/ Crystal is #24 on Tiobe Index, good_for_marketing :)
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
faustinoaq has quit [Quit: Konversation terminated!]
<Yxhuvud> also a good example why tiobe is pure BS.
<FromGitter> <bararchy> crystalshards is down ?
claudiuinberlin has joined #crystal-lang
faustinoaq has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <codenoid> @bararchy https://crystalshards.org/
Ven has joined #crystal-lang
Ven is now known as Guest51756
Groogy2 has joined #crystal-lang
Groogy has quit [Disconnected by services]
Groogy2 is now known as Groogy
<Groogy> Morning!
Groogy_ has joined #crystal-lang
Guest51756 is now known as Ven``
Ven`` has quit [Ping timeout: 255 seconds]
thews has quit [Ping timeout: 268 seconds]
thews has joined #crystal-lang
thews has quit [Changing host]
thews has joined #crystal-lang
<FromGitter> <extremety1989> hey all , does this method exist ? or it is been removed ?
<FromGitter> <extremety1989> undefined method 'to_hash' for DB::ExecResult
<FromGitter> <unreadable> morning, morning
<faustinoaq> >> [1058531, 24172].map(&.to_s(36)).join
<DeBot_> faustinoaq: # => "morning" - https://carc.in/#/r/341r
<FromGitter> <unreadable> has anyone tried wxwidgets? It seems to be full native look
<FromGitter> <unreadable> it's also free to use for production
<oprypin> @unreadable pls
<oprypin> how about you just use Qt and be happy
<FromGitter> <unreadable> it's so easy to give up, but I don't usually go that way
<FromGitter> <unreadable> I'll stop, got it
<oprypin> yes it's quite easy to give up trying to use a bad library and just use a good library
<faustinoaq> Would be interesting QtDesigner support for qt5.cr, or at least the support for loading QML πŸ‘πŸΌ
<faustinoaq> Oh, I just saw it on roadmap https://github.com/Papierkorb/qt5.cr/#future πŸ‘πŸ»
<oprypin> faustinoaq, what do you use to produce that emoji?
<faustinoaq> copy paste from Settings/Icons/Emoticons on KDE, but I think I can use replace text feature in konversation client, let me see :)
<faustinoaq> testing emoji +1 πŸ‘πŸ»
<oprypin> cuz what I see is πŸ‘ 🏻
<oprypin> and I know what it's supposed to be and I think that's not right
<faustinoaq> β€Žoprypinβ€Ž, Yep, replace text works, well I see all same, let me show you some pics...
<oprypin> i'd avoid the EMOJI MODIFIER FITZPATRICK TYPE-1-2
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vF95c
<crystal-gh> crystal/master 1b95a69 TSUYUSATO Kitsune: Doc: use string array delimiter as-is input on highlight (#5297)...
<Papierkorb> ... people don't know that?
<Papierkorb> They could be filtered out completely and chat would be better.
<oprypin> that's what i was thinking but it ain't happening
<oprypin> i mean filtering them out of the unicode standard would be nice but the opposit happened
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vF95r
<crystal-gh> crystal/master aaedc4e Sijawusz Pur Rahnama: Implement BigDecimal followup (#5255)...
<faustinoaq> <@oprypin> Yeah, I changed the emoji, πŸ‘
faustinoaq has quit [Changing host]
faustinoaq has joined #crystal-lang
<FromGitter> <extremety1989> does anyone worked with chat-app-demo repo ?
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
<FromGitter> <codenoid> have you tried this @extremety1989 https://github.com/sdogruyol/kemal-chat ?
<FromGitter> <extremety1989> @codenoid yes
<FromGitter> <extremety1989> it is yeasy
<FromGitter> <extremety1989> i wanted
<FromGitter> <extremety1989> this one
<FromGitter> <extremety1989> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a104329540c78242d1c3c4e]
faustinoaq has quit [Client Quit]
faustinoaq has joined #crystal-lang
<FromGitter> <extremety1989> i got this error undefined method 'to_hash' for DB::ExecResult
<FromGitter> <codenoid> https://github.com/will/crystal-pg/issues/65 @extremety1989
<FromGitter> <extremety1989> so i need just to chnage conn.query_one ?
<FromGitter> <extremety1989> without tranform function ?
<travis-ci> crystal-lang/crystal#1b95a69 (master - Doc: use string array delimiter as-is input on highlight (#5297)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/303978383
<DeBot_> https://github.com/crystal-lang/crystal/pull/5297 (Doc: use string array delimiter as-is input on highlight)
DTZUZU has joined #crystal-lang
DTZUZU2 has quit [Ping timeout: 248 seconds]
<faustinoaq> ignore this message, testing IRC emojis πŸ‘ πŸ™‚ πŸ™ πŸ‘† πŸ‘‡ πŸ‘ˆ πŸ‘‰ πŸ‘ 😎 πŸ’ͺ 😜 😍 βœ‹ πŸ€–
<travis-ci> crystal-lang/crystal#aaedc4e (master - Implement BigDecimal followup (#5255)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/303980891
<DeBot_> https://github.com/crystal-lang/crystal/pull/5255 (Implement BigDecimal followup)
<Papierkorb> I'm really on the edge to build a regex to simply remove all emojis in this channel.
<faustinoaq> XD
<faustinoaq> <@Papierkorb> What's the problem wit emojis?
<Papierkorb> Their blatant overuse
<faustinoaq> s/wit/with/
<Papierkorb> Adding absolutely nothing of worth to the message itself, making them spam
<Papierkorb> It's like the facebook "thumbs up": A meaningless thing on the screen no one asked for
<Papierkorb> Let me ask this: Have you ever read a message anywhere, and thought "Wow this emoji now really added to the message"?
claisne has joined #crystal-lang
<faustinoaq> Oh, I understand, no problem. I think emojis are popular so people overuse it, but hey sometimes emojis are funny πŸ€–
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
<livcd> Papierkorb: funny I have never used emojis nor know anyone who is using them
<FromGitter> <ylluminate> does crystal use the Hindley-Miller type system for inference at all?
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vF9xI
<crystal-gh> crystal/master 7f276fd Johannes MΓΌller: fix typo (#5300)
hightower2 has joined #crystal-lang
<oprypin> Papierkorb, let me ask this: you see 1000 thumbs up on a facebook message. if all those were comments saying "i like this" instead, would it improve the situation in any way?
<crystal-gh> [crystal] RX14 closed pull request #5261: Add Crystal::Environment module (master...feature/crystal-environment) https://git.io/vFEmo
<oprypin> maybe emojis themselves in a message are bad, but don't conflate them with those reaction things
<travis-ci> crystal-lang/crystal#7f276fd (master - fix typo (#5300)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/304011157
<DeBot_> https://github.com/crystal-lang/crystal/pull/5300 (Fix typo in MacroId docstring)
danielpclark has quit [Quit: Leaving]
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Quit: Konversation terminated!]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Client Quit]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Client Quit]
faustinoaq has joined #crystal-lang
faustinoaq has quit [Client Quit]
faustinoaq has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
badeball has joined #crystal-lang
badeball has quit [Client Quit]
badeball has joined #crystal-lang
badeball has quit [Client Quit]
badeball has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
sz0 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
<Papierkorb> oprypin: The system is fucked. People put way too much emphasis on a random number on their screen. Spamming "thanks" doesn't help for sure, but that system does no good psychologically either.
<crystal-gh> [crystal] RX14 closed pull request #5283: Fixes setting IO blocking on OpenBSD (master...fixes-stdio-redirections-on-openbsd) https://git.io/vFrYR
<Papierkorb> ylluminate, can ML resolve the type of `[ 123, "foo" ].sample`?
DTZUZU has quit [Quit: WeeChat 1.9]
DTZUZU has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
claisne has quit [Quit: WeeChat 1.9.1]
<travis-ci> crystal-lang/crystal#47f7e35 (master - Fixes setting IO blocking on OpenBSD (#5283)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/304039924
<DeBot_> https://github.com/crystal-lang/crystal/pull/5283 (Fixes setting IO blocking on OpenBSD)
<robacarp> I'm running into a weird situation where my crystal will not run in a docker container, but runs fine on my mac. I've simplified the code greatly in an effort to isolate the example here: https://github.com/robacarp/minimal_socket
<robacarp> the failure in docker is : failed to create socket:: Permission denied (Errno)
<robacarp> I'm first curious if this is a mac v ubuntu problem, because I believe the docker machine runs ubuntu on mac
<RX14> lol
<RX14> so you need to run it as root
<Papierkorb> `ping` has a capability allowing it to
<RX14> if you strace `ping` it does the same thing
<RX14> looks like ping is setuid basically
<Papierkorb> > /usr/bin/ping = cap_net_raw+ep
<Papierkorb> That capability is required for a non-root process to open raw IP packets, what is what robacarp is basically doing
<Papierkorb> robacarp: You'll want to give that capability to your docker container. There's something for it
<Papierkorb> No, the process doesn't need root
<Papierkorb> That's the point of capabilities
<RX14> yes you don't need to
<RX14> but i'm too lazy to give other advice
<robacarp> the socket isn't a raw socket, which does require root. it's dgram, so the program runs fine without root outside of docker
<Papierkorb> > Socket::Protocol::ICMP
<Papierkorb> May be a restricted type
<RX14> it is
<Papierkorb> docker has had an option to tune container capabilities for some time now, but I don't have docker here, so no idea how it goes
<RX14> well ping inside docker works
<Papierkorb> it has the capa there too
<RX14> so the container root gains the cap_net_raw cap
<RX14> yes
<RX14> you can just run as root or use setap on the binary
<RX14> setcap*
<robacarp> okay, I'm not familiar enough with setcap to know what you're saying yet, but I'll read up and see where it takes me. thanks
<Papierkorb> as I said, docker has options for that.
<robacarp> in that I need to set it for the running container? or for the binary within it?
<Papierkorb> the docker command.
<Papierkorb> I already said I don't have docker here.
<RX14> do people really not learn? https://github.com/luckyframework/support
<RX14> Papierkorb, my intuition would be that the docker container commandline cap grant would be to the root user in the container
<Papierkorb> `support` is surely a suboptimal name
<RX14> not globally
<RX14> though I may be wrong
<RX14> Papierkorb, it contains one thing and it's an inflector... so call it inflector
<Papierkorb> yes
<Papierkorb> Or rather, `english_infector` if it's not supposed to be broader than that
<RX14> I complain at people for recreating rails 100 times (and none of them have taken off) but this is much worse
<RX14> even rails people complain about AS
<RX14> and here we are
<Papierkorb> Rails helper "modularization" (the lack of it) is terrible and shouldn't be repeated.
<RX14> just don't monkeypatch everything to add misc methods
<RX14> if they can't be PRed into the stdlib, they clearly aren't a good idea
<Papierkorb> RX14: don't see any monkeypatches in there
<RX14> yeah but looking at the repo name...
<RX14> they're surely coming
<RX14> if it's a big enoguh method to make a shard then make it a shard, it doesn't belong in a misc collection of methods anyway
<Papierkorb> I'd actually like refinements (or a better solution if someone knows of one) lul
<Papierkorb> The ease of use of monkey patches, without messing everything up. keeps code clean and OOP-y.
<RX14> perhaps
<RX14> i wouldn't mind them
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
<FromGitter> <paulcsmith> @RX14 and @Papierkorb Just because it's called support doesn't mean it is ActiveSupport
<FromGitter> <paulcsmith> It does not monkey patch any classes
<RX14> yeah I saw
<FromGitter> <paulcsmith> It is an inflector now, but I'm planning to add a few more things to it, like NumberHelpers and TimeHelpers for doing things like number_to_currency
<FromGitter> <paulcsmith> I may split it up later
<RX14> hmm
<RX14> whats the downbside of just making those shards when the come up
<Papierkorb> temporary solutions are for eternity
<RX14> and then depending on them all
<RX14> Papierkorb, +1
<RX14> do it right as well as you can first try
<FromGitter> <paulcsmith> You two may like that, which is fine. I prefer splitting things up later. Those things often go together in tandem and I don't want to create a new shard for every helper Lucky ever needs
<FromGitter> <paulcsmith> Then it leads to node zone where you have tiny packages for everything
<FromGitter> <paulcsmith> LuckySupport will eventually have NumberHelpers, CurrencyHelpers, etc. I *might* split them up *if* people want those individual packages, but until then it would just add unnecessary overhead.
<RX14> I never really understood the downsides of tiny packages for everything
<FromGitter> <paulcsmith> It's not hard to split things up later. I've already done it with various parts of Lucky when they warranted it
<FromGitter> <paulcsmith> For me I just don't like that I have to hop between lots of different API docs, and it's also easier to maintain (sometimes)
<FromGitter> <paulcsmith> Depends on a lot of things though, and personal preference I think
<FromGitter> <paulcsmith> Basically I don't think one approach is clearly better/worse. I think it depends on personal preference, how one likes to manage projects, and whether people even want to use individual parts. Maybe that's just me
<Papierkorb> the issue to me isn't that the shard could get big. it's that it implies to be a dump for things that didn't fit somewhere else.
<Papierkorb> E.g., having a `helpers` and a `inflector` shard wouldn't create a billion shards (no one needs a leftpad.cr), but it would be a reasonable split of concerns
saadq has quit [Ping timeout: 240 seconds]
<FromGitter> <paulcsmith> Yeah that might be true. I could see inflector and helpers being separate
<FromGitter> <paulcsmith> That's probably a good idea
saadq has joined #crystal-lang
<RX14> I feel you about the API docs
<RX14> we have an official API doc tool
<RX14> I think we should have a mode which opens the API docs of literally everything that's in the require path
<Papierkorb> The server feature of yard, where it serves all api docs of all gems of a project is glorious
<RX14> basically that Papierkorb
<FromGitter> <paulcsmith> I do like the helpers/support split. I just didn't want to have time_helpers and number_helpers, and...etc.
<Papierkorb> Helper::Time.foo() sounds reasonable to me in terms of usage and programmer convenience
<FromGitter> <paulcsmith> And yeah that would be cool. It's on of the issues I had with Elixir/Phoenix. I often wouldn't know in which package a method was defined so it got to be frustrating
<RX14> but really
<RX14> it's an inflector
<RX14> thats really generic
<RX14> lots of people want an inflector that's not part of lucky
<RX14> or who wants to use all the other crap
<FromGitter> <paulcsmith> Yeah. I just renamed it
<Papierkorb> paulcsmith, is that thing to stay english-only?
<FromGitter> <paulcsmith> I agree on the helpers/inflector split
<Papierkorb> maybe EnglishInflector is better in that case
<FromGitter> <paulcsmith> @Papierkorb Right now yeah
<Papierkorb> I mean it's fine for it to be english-only, just that in the future, I may want to add a German inflector too, but don't want to stop using the english one
<Papierkorb> in a project I mean
<FromGitter> <paulcsmith> Ah I see what you mean. I'll have to think about that
saadq has quit [Ping timeout: 268 seconds]
<FromGitter> <paulcsmith> Well you can add additional inflectors at runtime so it already can support other languages. But yeah I'll have to think about that a bit more
saadq has joined #crystal-lang
<robacarp> bah, even disabling apparmor and seccomp I still get permission denied
astronavt has joined #crystal-lang
<FromGitter> <unreadable> is sdl2 better in terms of cpu usage than sdl2?
<FromGitter> <unreadable> than sfml***
DTZUZO has quit [Ping timeout: 248 seconds]
faustinoaq has quit [Quit: IRC client terminated!]
astronavt has quit [Quit: Leaving...]
faustinoaq has joined #crystal-lang
<FromGitter> <bew> no idea, iirc one is a C library (sdl2) the other is originally a C++ library (sfml)
claudiuinberlin has quit [Ping timeout: 248 seconds]
astronavt has joined #crystal-lang
DTZUZO has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/vFHZl
<crystal-gh> crystal/master 818c438 Will Richardson: Add reduce to ArrayLiteral for macros (#5294)
<FromGitter> <Qwerp-Derp> Should I update Homebrew to the pre-release version of Crystal (`0.24.0-2`)?
<FromGitter> <Qwerp-Derp> Or should I keep it at `0.23.1`?
<travis-ci> crystal-lang/crystal#818c438 (master - Add reduce to ArrayLiteral for macros (#5294)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/304122099
<DeBot_> https://github.com/crystal-lang/crystal/pull/5294 (Add reduce macromethod to TupleLiteral and ArrayLiteral)
sz0 has quit [Quit: Connection closed for inactivity]
aroaminggeek has joined #crystal-lang