ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.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
<FromGitter> <bew> who knows
absolutejam has joined #crystal-lang
absolutejam1 has joined #crystal-lang
absolutejam has quit [Ping timeout: 268 seconds]
absolutejam1 has quit [Ping timeout: 240 seconds]
Nekka has quit [Ping timeout: 264 seconds]
<FromGitter> <Blacksmoke16> writing up *the best* pr atm :p
<FromGitter> <bew> on which repo?
<FromGitter> <Blacksmoke16> crystal
<FromGitter> <bew> ❤️
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 268 seconds]
<FromGitter> <Blacksmoke16> well found a bug, so make that tomorrow
return0e has quit [Remote host closed the connection]
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/pull/8344 💣
_whitelogger has joined #crystal-lang
Nekka has joined #crystal-lang
<FromGitter> <sdogruyol> For anyone interested in Crystal's Future, I gave a talk at crystal.tokyo meetup back in May 2019. The talk is in Japanese https://twitter.com/sdogruyol/status/1185052211971264512
_whitelogger has joined #crystal-lang
return0e has joined #crystal-lang
return0e has quit [Ping timeout: 268 seconds]
return0e has joined #crystal-lang
return0e has quit [Remote host closed the connection]
ht_ has joined #crystal-lang
Nekka has quit [Ping timeout: 268 seconds]
ht_ has quit [Remote host closed the connection]
Nekka has joined #crystal-lang
<livcd> no subs ?
return0e has joined #crystal-lang
absolutejam1 has joined #crystal-lang
return0e has quit [Ping timeout: 246 seconds]
absolutejam1 has quit [Ping timeout: 240 seconds]
DTZUZU has quit [Ping timeout: 268 seconds]
return0e has joined #crystal-lang
absolutejam2 has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 268 seconds]
absolutejam2 has joined #crystal-lang
alexherbo2 has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
Nekka has quit [Ping timeout: 240 seconds]
Nekka has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
travis-ci has joined #crystal-lang
<travis-ci> crystal-lang/crystal#16648 (master2013-09-04} - 8936918 : Ary Borenszweig): The build failed.
travis-ci has left #crystal-lang [#crystal-lang]
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
FromGitter has quit [Read error: Connection reset by peer]
FromGitter has joined #crystal-lang
<FromGitter> <straight-shoota> Why are messages from travis-ci posted to IRC?
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
Nekka has quit [Ping timeout: 268 seconds]
Nekka has joined #crystal-lang
<FromGitter> <mavu> @sdogruyol Wow, the auto-translate in the youtube video is comically useless.
<erdnaxeli> wow, indeed
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <firejox> hi, everyone
<FromGitter> <asterite> hi firejox \o
<alexherbo2> I'm looking for a project name, what do you think between "Krabby", "Krabboss", "Kraboss" and "Kiwi"?
<alexherbo2> Krabby and Krabboss are the french translation Krabby and Kingler https://www.pokepedia.fr/Krabby and https://www.pokepedia.fr/Krabboss
<erdnaxeli> what the project will do ?
<erdnaxeli> hmm, I think "krabby" is more fun, because a krabby typing on a keyboard is… well… funny ^^
<alexherbo2> I’ll change to Krabby
<alexherbo2> it is more cute than Krabboss too
<alexherbo2> go for Krabby :p
<erdnaxeli> btw I didn't know about kakoune, it looks cool, i will give it a try
<alexherbo2> erdnaxeli you think krabby is a good name overall?
<alexherbo2> or you chose because of the suggestions
<alexherbo2> I'm on the Rename button with krabby but I fear to regret after :p
<erdnaxeli> I choose from the suggestions, but I don't think it's a bad name
<erdnaxeli> ofc you will have to accept typing krabby on google returns a pokemon and not your project :p
<FromGitter> <tenebrousedge> or spongebob
Nekka has quit [Ping timeout: 265 seconds]
Nekka has joined #crystal-lang
<FromGitter> <tenebrousedge> I'd go with something that was more unique and targeted towards what the program does
<alexherbo2> erdnaxeli you think it's better to rename the project "chrome-configuration" → "krabby" or start a new project?
<alexherbo2> tenebrousedge I don't want spongebob XD
<repo> hm
<repo> Error: instance variable '@read_event' of ZMQ::Socket must be (Crystal::Event | Nil), not (Crystal::Event | Crystal::ThreadLocalValue(Crystal::Event) | Nil)
<repo> this is a 0.31.x issue i assume?
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> I'd really love to see that talk in English
<FromGitter> <absolutejam_gitlab> but I'm *really* enjoying the Google Translate
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
Human_G33k has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 240 seconds]
<FromGitter> <lbarasti> Hi folks, on the behaviour of `#send` on `#close`()
<FromGitter> <ilanpillemer> Krabby?
<alexherbo2> ?
<alexherbo2> I’ll go for Krabby yes
<FromGitter> <Blacksmoke16> Crabby
<FromGitter> <Blacksmoke16> *CR*abby
<FromGitter> <Blacksmoke16> *CR*abby
<alexherbo2> I still hesitate if I have to rename "chrome-configuration" → "krabby" or create a new "krabby" repo
<alexherbo2> lol
<FromGitter> <Blacksmoke16> short for `chrome` and `crystal` 😮
<alexherbo2> I like to think the "k" in Krabby refers to the k of kakoune
<FromGitter> <Blacksmoke16> ah fair enough
<alexherbo2> I can rename https://github.com/alexherbo2/chrome-shell Cr·abby though
<alexherbo2> what is better between renaming and start over a new repo?
<FromGitter> <tenebrousedge> renaming keeps history
<alexherbo2> fair
<alexherbo2> tenebrousedge I'm still waiting a good occasion to start the devil's backbone
Yxhuvud has quit [Remote host closed the connection]
<FromGitter> <tenebrousedge> it's coming up on Halloween/All Saint's Day
Yxhuvud has joined #crystal-lang
<FromGitter> <ilanpillemer> K is Kotlin
<FromGitter> <tenebrousedge> K is a derivative of APL
<FromGitter> <firejox> @lbarasti It should raise because it fails on send
absolutejam2 has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
absolutejam2 has joined #crystal-lang
ht__ has joined #crystal-lang
alexherbo24 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 245 seconds]
absolutejam2 has quit [Ping timeout: 268 seconds]
<FromGitter> <bajro17> @sdogruyol surprise me all time I dont know he talk that good Japanese :D
<FromGitter> <naqvis> just published brotli.cr (https://github.com/naqvis/brotli.cr) - Crystal bindings and wrapper around google `brotli` compression library.
DTZUZU has joined #crystal-lang
alexherbo24 has quit [Ping timeout: 240 seconds]
alexherbo24 has joined #crystal-lang
<FromGitter> <vlazar> ❤️
<FromGitter> <bbaragar> Is there a way to get a pointer to struct member ```p_data = &p_struct->DATA```
<FromGitter> <bbaragar> Is there a way to get a pointer to a Struct member. I tried pointerof and get an error? ⏎ I know it can be done in C ⏎ ```p_data = &p_struct->DATA```
<FromGitter> <Blacksmoke16> pointer to an ivar of a struct?
<FromGitter> <lbarasti> Sounds like the most natural behaviour to me, too @firejox. I'd like to make some time to document the behaviour with some tests over the weekend 🤞
<FromGitter> <Blacksmoke16> is a bit of a hack but you can do https://play.crystal-lang.org/#/r/7u53
<FromGitter> <Blacksmoke16> @bbaragar ^
<FromGitter> <bbaragar> yes a pointer to the ivar so a binded C func can modify it
<FromGitter> <bbaragar> The struct is defined by the C lib
<FromGitter> <bbaragar> @Blacksmoke16 ^
<FromGitter> <Blacksmoke16> so either can define a method that does `pointerof(@x)` or use the "secret hack" to do `pointerof(point.@x)`
<FromGitter> <bbaragar> @Blacksmoke16 That worked thanks
<FromGitter> <Blacksmoke16> np
<FromGitter> <asterite> haha, it's actually vaild. I needed to do that too for sigfault.cr
<FromGitter> <asterite> I don't see it as a hack, just very low-level
<FromGitter> <asterite> Some weeks ago I found at that Haskell, a language extremely type-safe and high-level, lets you use pointers too: https://www.stackage.org/haddock/lts-12.26/base-4.11.1.0/Foreign-Ptr.html#t:Ptr
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
alexherbo24 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
absolutejam2 has joined #crystal-lang
<FromGitter> <repromancer_gitlab> I just learned that you can write Proc type signatures like so: ⏎ ⏎ ```name : ArgOneType, ArgTwoType -> ReturnType ``` [https://gitter.im/crystal-lang/crystal?at=5daa16120fdc4b6507104132]
<FromGitter> <tenebrousedge> it's a thing
<FromGitter> <repromancer_gitlab> Ah, I found that it is documented in the Gitbook, I just missed it apparently. https://crystal-lang.org/reference/syntax_and_semantics/type_grammar.html
<FromGitter> <tenebrousedge> but I usually like ⏎ ⏎ ```alias MyCallback = ArgOneType, ArgTwoType -> ReturnType ⏎ def my_method(name: MyCallback)``` [https://gitter.im/crystal-lang/crystal?at=5daa16e40fdc4b65071045ae]
<FromGitter> <absolutejam_gitlab> I really like aliasing anything that's more than two or so types
<FromGitter> <repromancer_gitlab> Makes me happy. I thought I was restricted to `Proc(Arg,Arg,Return)` in Crystal, which I don't think is as clear to the uninitiated.
<FromGitter> <absolutejam_gitlab> feel like it makes it so much more succinct
<FromGitter> <repromancer_gitlab> @tenebrousedge @absolutejam_gitlab Right, in many cases that'd be preferable.
<FromGitter> <repromancer_gitlab> Oh, speaking of things that make me happy, I found that Crystal has a lazy `Array.each_product` in the standard library
<FromGitter> <tenebrousedge> :plus1:
<FromGitter> <didactic-drunk> Nada. Maybe he dittn't like the furry comment.
<FromGitter> <repromancer_gitlab> For my job, I needed to do a calculation which required (as the intuitive solution, at least) iterating over (3^19)*2 permutations, which is just over two-billion. Ruby standard library was not up to the task, and neither would I be able to write one from scratch without wasting a lot of company time. Was really great to find the exact thing I needed, already usable.
<FromGitter> <absolutejam_gitlab> Say I had a class with a bool property that can be set, eg. `Foo.consumed`
<FromGitter> <absolutejam_gitlab> What's the idiomatic way of approaching this? Really I'd want `Foo.consumed?` and would I keep `Foo.consumed=` as the setter?
<FromGitter> <tenebrousedge> use `getter?` ?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Object.html#property?(*names,&block)-macro
<FromGitter> <tenebrousedge> or property, yeah
<FromGitter> <absolutejam_gitlab> Oh, a property for a predicate method does that?
<FromGitter> <absolutejam_gitlab> TIL
<FromGitter> <tenebrousedge> ah
<FromGitter> <tenebrousedge> `property?` is different from `property`
<FromGitter> <absolutejam_gitlab> oh I didn't even see the `?`
<FromGitter> <absolutejam_gitlab> it's late
<FromGitter> <absolutejam_gitlab> I'm in braindead mode
<FromGitter> <tenebrousedge> s'okay
<FromGitter> <absolutejam_gitlab> But that's exactly what I was wondering
<FromGitter> <Blacksmoke16> what do you call a group of children?
<FromGitter> <absolutejam_gitlab> fodder?
<FromGitter> <tenebrousedge> a mob
<FromGitter> <Blacksmoke16> a migraine 😉
<FromGitter> <absolutejam_gitlab> I have a 2 year old and a 4 year old, I'd escalate that to an aneurysm
<FromGitter> <Blacksmoke16> xD
<FromGitter> <absolutejam_gitlab> I generally just use `property` for everything at the moment
<FromGitter> <absolutejam_gitlab> 'I don't believe in making things private' 😉
<FromGitter> <Blacksmoke16> which is fine if they're public and shot be able to be changed
<FromGitter> <Blacksmoke16> should not*
<FromGitter> <Blacksmoke16> guess my brain shortened that into a new word...
<FromGitter> <Blacksmoke16> should be able to be changed*
<FromGitter> <absolutejam_gitlab> haha
<FromGitter> <absolutejam_gitlab> I find new things every time I look at the docs
<FromGitter> <absolutejam_gitlab> I wrote my own semantic versioning methods
<FromGitter> <absolutejam_gitlab> 😦
<FromGitter> <Blacksmoke16> hehe
<FromGitter> <Blacksmoke16> you see my doc pr? :p
<FromGitter> <absolutejam_gitlab> yeah <3
<FromGitter> <Blacksmoke16> 🔥
<FromGitter> <Blacksmoke16> going to make an issue soon about exceptoins
<FromGitter> <Blacksmoke16> exceptions*
<FromGitter> <Blacksmoke16> i want something like https://docs.phpdoc.org/references/phpdoc/tags/throws.html
<FromGitter> <absolutejam_gitlab> This is what got me thinking about it
<FromGitter> <absolutejam_gitlab> Or Python's `raises`
<FromGitter> <Blacksmoke16> questions are like 1) can this be auto generated, 2) should it be, 3) how to display it otherwise
<FromGitter> <Blacksmoke16> was thinking like `RAISES: UserNotFoundError If a user with the given *id* could not be found`
<FromGitter> <absolutejam_gitlab> I wrote a method that performed a number of validations and raised a type of exception based on the failure if it didn't pass, but I didn't know how idiomatic that was
<FromGitter> <Blacksmoke16> in a section that would be added after a method desc, but before the `view source`
<FromGitter> <absolutejam_gitlab> or do I do the Elixir thing/Golang(ish) and return an error and value
<FromGitter> <absolutejam_gitlab> I love Elixir's pattern matching, and it's idiomatic to return something like `{:error, :not_found}` or something
<FromGitter> <absolutejam_gitlab> there's still exceptions obviously
<FromGitter> <absolutejam_gitlab> wasn't sure what the best way to approach it is, especially in the case that the user of a lib should handle it
<FromGitter> <Blacksmoke16> well i was more so thinking from a doc perspective, like if im using a lib i would like to see what the possible exceptions that could happen when using a given method
<FromGitter> <absolutejam_gitlab> oh yeah, I meant starting with that instantly makes it a favourable option
<FromGitter> <Blacksmoke16> w/o having to read the source
<FromGitter> <absolutejam_gitlab> but if I start raising 10 different exception types and expect the user to catch each one, it gets stupid
<FromGitter> <absolutejam_gitlab> especially if I have to manually update the docs or there are no set doc formats
<FromGitter> <Blacksmoke16> well the user could catch `ValidationError`
<FromGitter> <Blacksmoke16> where each specific type inherits from that
<FromGitter> <Blacksmoke16> gives them the option of catching specific ones first, or fallback on the catch all
<FromGitter> <absolutejam_gitlab> I think the original example I had was actually within the internals of a library that escaped based on the type of exception then returned a message to the end user
<FromGitter> <absolutejam_gitlab> and I wanted to catch each one explicitly
<FromGitter> <absolutejam_gitlab> granted, this could have been the worst way to approach it
<FromGitter> <Blacksmoke16> would be nice if you could use enum with string values
<FromGitter> <absolutejam_gitlab> I've quite liked treating errors as values in Go and Elixir
<FromGitter> <absolutejam_gitlab> for matching and handling purposes
<FromGitter> <tenebrousedge> > _< golang
<FromGitter> <absolutejam_gitlab> It's just interesting to see how other languages do it. I feel like small, distinct functions based on a pattern match or type def really works well for me
<FromGitter> <absolutejam_gitlab> Find myself trying to move away from case and towards functions more and more
<FromGitter> <tenebrousedge> I'mma post a writeup at some point, but I think that there's a good replacement for Ruby's ability to do `an_object.extend(SomeModule)`
<FromGitter> <tenebrousedge> i.e. adding methods to just a single instance of an object
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5daa24f2ea0d6159fd8ac4c6]
<FromGitter> <tenebrousedge> downside is not actually extending the type
<FromGitter> <tenebrousedge> I suppose that's a thing though?
<FromGitter> <tenebrousedge> not for structs I guess
ht__ has quit [Remote host closed the connection]
mps has joined #crystal-lang
<mps> shards build fails on specs (test) with crystal 0.31.1 on Alpine linux
<mps> 'Error: instance variable '@current_thread' of Fiber must be Atomic(Thread | Nil), not Nil'
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
alexherbo20 has joined #crystal-lang
alexherbo2 has quit [Read error: Connection reset by peer]
absolutejam2 has quit [Ping timeout: 240 seconds]
<FromGitter> <ilanpillemer> this was quite amusing….
<FromGitter> <ilanpillemer> I even put in sleeps so I slowly saw the screen decoding
<alexherbo20> when we say "Difference(s) with [something", "difference" is singular or plural?
<alexherbo20> I read https://www.wordhippo.com/what-is/the-plural-of/difference.html but it looks a bit odd for me to not have a 's' when there is more than one difference