RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.27.0 | 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> <girng> its cool i will jut do DB.open for now thx
Renich has joined #crystal-lang
<FromGitter> <HarrisonB> just curious: what are the current crystal options for background jobs? I see sidekiq.cr and mosquito, which both have Redis stores as dependencies
<FromGitter> <HarrisonB> anything that works with a SQL db like Postgres?
Raimondi has joined #crystal-lang
<FromGitter> <Blacksmoke16> none atm
<FromGitter> <Blacksmoke16> could prob override it/add adatper for sql
<FromGitter> <anamba> @HarrisonB i'm using faktory
<FromGitter> <anamba> but only because i need it to work with crystal + other languages
<FromGitter> <kevinelliott> @anamba How do you like it? I’ve had the faktory page up for over a week now.
<FromGitter> <anamba> @kevinelliott A bit light on documentation, but working ok so far. factory.cr seems to be unmaintained, but it only needed a small tweak to work with 0.27.0.
<FromGitter> <kevinelliott> @anamba Did you submit a PR for the tweak?
<FromGitter> <anamba> not yet, still just trying to get everything working smoothly.
<FromGitter> <kevinelliott> Ahh gotcha. Be sure to submit a PR when you do though, as I’m planning to use it too. Would love it if you tagged/mentioned me (github: kevinelliott) for visibility if you do :)
<FromGitter> <anamba> @kevinelliott if it's not today there's no chance i'm gonna remember that :) subscribe to the repo maybe?
<FromGitter> <kevinelliott> All good...
laaron- has joined #crystal-lang
laaron has quit [Ping timeout: 256 seconds]
ua_ has joined #crystal-lang
ua has quit [Ping timeout: 258 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <HarrisonB> Thanks!
<FromGitter> <Sija> @girng `rescue` branch makes it nilable
spacemanspam has quit [Read error: Connection reset by peer]
spacemanspam has joined #crystal-lang
<FromGitter> <Blacksmoke16> heres an option parser question
<FromGitter> <Blacksmoke16> can it be made that a command can takes multiple args?
<FromGitter> <Blacksmoke16> like `./app --command test 123 abc
<FromGitter> <Blacksmoke16> like map `test` to name, which i have working now
<FromGitter> <Blacksmoke16> but rest to another var?
<FromGitter> <Blacksmoke16> or would that have to be done manually
<FromGitter> <girng> i removed rescue and just had DB.open, same thing
Renich has quit [Quit: Renich]
Raimondi has quit [Ping timeout: 240 seconds]
spacemanspam has quit [Read error: Connection reset by peer]
<FromGitter> <Sija> @girng try removing `~/.cache/crystal`
bmcginty has quit [Ping timeout: 264 seconds]
<FromGitter> <girng> i try tomorrow, bit raged don't want to go back to dat file
<FromGitter> <girng> https://github.com/alefragnani/vscode-bookmarks/issues/169 i swear, the weirdest bugs happen to me
shmibs_ has joined #crystal-lang
badeball1 has joined #crystal-lang
moei has quit [*.net *.split]
johndescs has quit [*.net *.split]
shmibs has quit [*.net *.split]
shmibs_ is now known as shmibs
johndescs has joined #crystal-lang
<FromGitter> <domgetter> @bew I got everything working using Box.
<FromGitter> <domgetter> For some things, I have to use `Box.box`, and for others I need to use `.as(Void*)` Is there any documentation on the difference between those two?
<FromGitter> <domgetter> Oh, does Box "add" a pointer layer, whereas `.as(Void*)` expects a pointer to begin with?
bmcginty has joined #crystal-lang
spacemanspam has joined #crystal-lang
bmcginty has quit [Ping timeout: 245 seconds]
spacemanspam has quit [Read error: Connection reset by peer]
bmcginty has joined #crystal-lang
marmotini_ has joined #crystal-lang
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
spacemanspam has joined #crystal-lang
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
<FromGitter> <bew> Box is used to go from some crystal type to void* and back, so you can pass any crystal object to a c method expecting void* (for exemple for c callback param like in the exemple code of Box)
<FromGitter> <bew> Oops the markdown engine kicked in ^^ it's `Void*` when I say `void`
<FromGitter> <bew> I don't understand what you say about some times you have to use x or y, can you show?
DTZUZO has quit [Ping timeout: 250 seconds]
<FromGitter> <girng> is it possible to increase a UInt16 with a float32? https://play.crystal-lang.org/#/r/5yeb
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
<FromGitter> <girng> i guess i should use float32, then just round the value on the game client. just diablo 2 / poe don't have floats for HP values. so i figured `health` would have to be an int
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #crystal-lang
ashirase has quit [Ping timeout: 272 seconds]
ashirase has joined #crystal-lang
<FromGitter> <j8r> seems like crystal-lang core members loves its non modular monorepo :(
<FromGitter> <j8r> it hurts because each time we want to work on a component we need to fork the *whole* language
spacemanspam has quit [Read error: Connection reset by peer]
<FromGitter> <j8r> I tried to make a custom formatter and playground, but the actual state make this a pain. I got 2 forks of the whole monorepo, and I've to rebase regularly to be up-to-date with the stdlib :(
<FromGitter> <j8r> and I end up with 3 crystal compilers that are the same but with different tools
<FromGitter> <ideasasylum> Newbie crystal programmer here with a probably-not-so-newbie question: How would I start debugging a problem with a macro?
<FromGitter> <ideasasylum> Specifically, I'm having a problem with mocks.cr and Crystal 0.27: https://github.com/waterlink/mocks.cr/issues/35
<FromGitter> <bew> @ideasasylum your error is `can't declare class dynamically`, meaning that you're probably calling `Mocks.create_mock Caddy do ... end` inside a method or a block. The thing is that `Mocks.create_mock` will declare a class, and class declaration can only happen in top level (not in a method/block/expression)
<FromGitter> <ideasasylum> ah! that is probably it
<FromGitter> <bew> @girng you could do `to_u16` on the result to get back a UInt16: `p.health = (p.health * p.health_regen * delta).to_u16`
<FromGitter> <ideasasylum> @bew that was it! Thank you so much. I was up til 2am trying to figure that out
badeball1 has quit [Quit: WeeChat 2.3]
badeball has joined #crystal-lang
badeball has quit [Quit: WeeChat 1.6]
badeball has joined #crystal-lang
<FromGitter> <bew> you're welcome ;)
<FromGitter> <straight-shoota> @j8r Whether it's developed in one repo or in separate ones, the formatter is deeply integrated with the compiler.
<FromGitter> <straight-shoota> I don't think your pain would pass simply by putting it in a separate repository.
<FromGitter> <j8r> I'm not talking technically, just on the principle
<FromGitter> <j8r> Node.js, Python (with Black), Rust can have separated formatters - and that's nice for customization
<FromGitter> <j8r> @straight-shoota that's the problem - it's tied to the compiler :/
<FromGitter> <bararchy> @straight-shoota regarding the SNI
<FromGitter> <bararchy> what I'm trying to achive is the full callback flow
<FromGitter> <straight-shoota> I believe you just patched the wrong class
<FromGitter> <bararchy> I did!
<FromGitter> <bararchy> fixed now
<FromGitter> <bararchy> good eyes
<FromGitter> <bararchy> in my testing env I just added it to ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c35eb16b81edc31f5d00143]
<FromGitter> <bararchy> but it makes much more sense to add to Server SSL socket
wmoxam has quit [Ping timeout: 250 seconds]
<FromGitter> <rishavs> has anyone here used cloudinary for serving image son their crystal server?
<FromGitter> <yxhuvud> No, I use it for ruby though.
<FromGitter> <rishavs> did you use the Ruby sdk or the plain api endpoint?
<FromGitter> <j8r> @bararchy you know you can just `getter bio, ssl` 😉
<FromGitter> <bararchy> @j8r I know :) I like the symbol look XD
<FromGitter> <bararchy> Oh how I hate OpenSSL
<FromGitter> <bararchy> ... let me rephrase, how I hate OpenSSL AND C Bindings
<FromGitter> <j8r> @bararchy depends of the lib, i like those: https://github.com/j8r/cride/blob/master/src/cride/terminal.cr#L18 :)
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
<FromGitter> <j8r> I agree, OpenSSL is a mess
<mps> j8r: agree, and someone of core devs told me he will work to add mbedtls to crystal, would be nice
<FromGitter> <j8r> thats @RX14
<mps> yes
<FromGitter> <j8r> at least, for once, he is for moving out the TLS/SSL stuff
<FromGitter> <greenbigfrog> Anyone able to spot why I'm getting this error? I've been trying to figure this out for a few days now... (It's not due to symbol to enum conversion. I've tried using the full enum values as well) ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ https://github.com/greenbigfrog/discordtipbot/blob/rewrite/src/discord/commands/rain.cr [https://gitter.im/crystal-lang/crystal?at=5c35f5a4aac7082e6ffa4abb]
<RX14> mps, unfortunately mbedtls isn't packaged well enough on older still-supported debian versions to drop openssl entirely :(
<RX14> i.e. for debian 8, mbedtls was only packaged in backports and the backports version even has CVEs outstanding
<RX14> and debian 8 is supported for another 1.5 years
<mps> hmm, it is used just for some packages on debian, not much
<RX14> yeah, debian 9 is an old mbedtls version but it's well-patched
<RX14> so in 1.5 years i'm sure it'll be fine to drop openssl support from core
<RX14> but until then it's eigher going to be openssl-only or mbed-preferred openssl-fallback
<mps> understand, but like to have nice dream :)
<mps> I know that there is no easy solutions to complicated stuff
<FromGitter> <petoem> @greenbigfrog assuming that the symbols correspond to enums, it could only be `to : Array(Int64)` you are trying to pass in `Array(UInt64)`.
<FromGitter> <greenbigfrog> wtf
<FromGitter> <greenbigfrog> how tf did I keep missing this...
<FromGitter> <yxhuvud> @rishavs We use the sdk
<FromGitter> <j8r> but that's won't be the problem of the language anymore RX14, in the future?
<FromGitter> <j8r> The goal will be to provide a stable API for external TLS libraries to implement them, no?
<FromGitter> <greenbigfrog> thanks @petoem
<RX14> @straight-shoota re: graceful shutdown of HTTP servers, I think the most reasonable solution for upgraded sockets is just to close the socket immediately.
<FromGitter> <bararchy> RX14, @straight-shoota can you guys help me for a sec? ⏎ why can't the CI find `SSL_set_tlsext_host_name` in the specs? what version of openssl do we use?
<RX14> you need to support 0.9.8 to 1.1.1
<FromGitter> <bararchy> ho god no 😱
<RX14> and honesylu we should drop support for 0.9
<RX14> just support 1.0 to 1.1.1
<FromGitter> <bararchy> https://www.openssl.org/news/changelog.html seems to indicate `SSL_set_tlsext_host_name` being avilable from 0.9.8 and I can see it in master
<FromGitter> <bararchy> yeha RX14 I'm with you, we should drop 0.9.8
<RX14> which ci is it failing on?
<RX14> macos
<RX14> ?
<FromGitter> <bararchy> all :(
<RX14> oh
<RX14> then thats a bigger problem
<FromGitter> <bararchy> `crystal/src/openssl/ssl/socket.cr:50: undefined reference to `SSL_set_tlsext_host_name'`
<RX14> no its not there on 1.0
<RX14> look at the manpages
<RX14> are you sure it's not just a macro?
<FromGitter> <bararchy> hm...... good question
<RX14> its a macro
<FromGitter> <bararchy> damn
<FromGitter> <bararchy> RX14, what should I do then?
<RX14> ... use SSL_ctrl
<FromGitter> <bararchy> omfg .... we already have this
<FromGitter> <bararchy> did I just wasted 4 hours on something we already have? ??? 😢
<RX14> probably
<RX14> where is it?
<FromGitter> <bararchy> 😢
<FromGitter> <bararchy> well, at least I added the one for the server side
<RX14> thats set
<RX14> there's no get
<FromGitter> <bararchy> RX14 client set, server get, so I added only the
<FromGitter> <bararchy> server side `get` and now after we merge this in I'll start working on callback
<FromGitter> <bararchy> So I'll need to follow this path: https://stackoverflow.com/a/5113466/1526733
<rkeene> RX14, For Tcl's TLS module I'm working on adding support for things other than OpenSSL. Over the years, I've liked NSS's implementation the best, but there's also small portable implementations.
<RX14> nss?
<RX14> not the libc nss?
<rkeene> Netscape Security Services
<RX14> ah
<rkeene> It does stuff like store CRLs (and everything) in a database (now SQLite, BDB before that) because they can be HUGE -- OpenSSL is much slower
go|dfish has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Quit: Leaving]
DTZUZO has joined #crystal-lang
<FromGitter> <tonobo> Hey, we're currently testing memory consumption with kemal and router.cr. Crystal is consuming a massive amount of memory, after a few concurrent calls. You could easily reproduce by creating just a single route and fireing a few requests against it. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c361574bd592b2e6e78e04a]
powerbit has quit [Remote host closed the connection]
<FromGitter> <girng> @bew thanks i wonder if that is less performant than just using a float32 in the game loop
Raimondi has joined #crystal-lang
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Renich has joined #crystal-lang
<FromGitter> <bew> basically: float are slow compared to integers, if you can avoid them the better (e.g in any time or accurate -sensitive context, like games)
<FromGitter> <bew> @girng ^
<FromGitter> <girng> yeah but in that code were are doing a conversion
<FromGitter> <yxhuvud> @bew say what? Traditionally, floats was always used since they was a lot faster
<FromGitter> <bew> @yxhuvud that doesn't make sense, maybe there are some path in modern processors that are optimized for floats, but overall, operations on integers are easier to do for the processor asaik
<rkeene> It's more like the CPU has more opcodes that operate on integers and more integer registers -- but it depends on what you're doing
<FromGitter> <girng> 1) `p.health += (p.health_regen * delta).to_u16` <-- p.health is a uint16 ⏎ ⏎ compared to: ⏎ ⏎ 1) `p.health += (p.health_regen * delta)` <-- p.health is a float32 ... [https://gitter.im/crystal-lang/crystal?at=5c361c4d82a6c30b90ad6608]
<FromGitter> <bew> @tonobo what is "massive amount of memory" ?
Renich has quit [Ping timeout: 250 seconds]
Renich has joined #crystal-lang
<FromGitter> <bew> @girng I'd say it's irrelevant and it doesn't matter really..
<FromGitter> <girng> im just gonna do all float32's then
<FromGitter> <girng> thanks
<rkeene> You could always time it on your own system :-D
<FromGitter> <j8r> @girng but it can be useful to be an Int32 instead of a float
<FromGitter> <j8r> depends of the usecase
<FromGitter> <girng> feels so wrong to use float32 though, for player health i guess it's fine. but on crit_multiplier or something.. that is gonna be 1.00 to 10.00 at most (anything above 10 is literally god mode)
<FromGitter> <j8r> It will be simpler to have higher integer numbers
<FromGitter> <girng> float32's max value is FAR MORE than 10.00
<FromGitter> <j8r> like 1000/1000 HP instead of 10.00/10.00 HP
<FromGitter> <j8r> it would be also more performant like @bew said
<FromGitter> <girng> why 10.00 HP? wouldn't it be 1000.00 HP?
<FromGitter> <j8r> You don't get it, I mean, for example, `1000_i32` instead of `10_f32` for max health
<FromGitter> <j8r> no more decimals
<FromGitter> <j8r> that's what most games do
<FromGitter> <girng> what about modifying that though with percentages? we have to to the conversion method bew posted?
<FromGitter> <girng> The 1000_i32
<FromGitter> <girng> btw, is there something lower than a float32? for example, see my crit_multiplier example above. why would i set a variable's type float32, when the max value it will receive can't go above 10.00?
<FromGitter> <girng> why does float32 force the developer to use more unneeded bytes? makes no sense
laaron has quit [Remote host closed the connection]
<FromGitter> <j8r> it would be better not to have conversions at all. If you have a Float, `to_i` it
<FromGitter> <bararchy> So, got my super PR to pass review, which means now I need to start working on callback
<FromGitter> <j8r> Even by using float you'll need to round
<FromGitter> <bararchy> I want to uses a block for the callback, let's hope I can manage it
<FromGitter> <j8r> Use big integers like in Dot&2 or LoL @girng :)
laaron has joined #crystal-lang
<FromGitter> <bararchy> @girng just keep it all as strings ;) then no need to think about types hahaha ⏎ ⏎ hp.to_s => "234432", then hp.to_i
<FromGitter> <bararchy> :trollface:
<FromGitter> <girng> 😆
<FromGitter> <j8r> you can use floor division, that are in master ⏎ ⏎ ```10/4=2,5 <----normal division ⏎ 10//4=2 <----floor division``` [https://gitter.im/crystal-lang/crystal?at=5c3622871948ad07e812e7c1]
<FromGitter> <j8r> No floats anymore :D
<FromGitter> <bararchy> https://github.com/crystal-lang/crystal/pull/7291 all green :) time to merge!
<FromGitter> <rishavs> I want to upload a file to a cloud provider using an api. How do I add a file to my http/client? Is this the correct way? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c3624744ed182787783de5b]
<FromGitter> <bararchy> ah.... upload via URL
<FromGitter> <bararchy> @rishavs take a look here: https://crystal-lang.org/api/0.27.0/HTTP/FormData.html
<FromGitter> <rishavs> yeah. working with files and io turned out to be far harder than I expected :(
<FromGitter> <bararchy> the above link has an example exatcly for uploading a file
<FromGitter> <rishavs> got it. thanks!
<FromGitter> <greenbigfrog> Why is it `String#bytesize`, and not `String#byte_size`? <https://crystal-lang.org/api/0.27.0/String.html#bytesize%3AInt32-instance-method>
go|dfish has joined #crystal-lang
<FromGitter> <girng> iuno can't find anything about that in regards to the English language. i found this though https://godoc.org/github.com/inhies/go-bytesize
<FromGitter> <tonobo> @bew 100MB and up. The same service writtin in go consumes about 15MB
<FromGitter> <tonobo> It should be pretty easy reproduce :D
<FromGitter> <tonobo> I rekcon, this dependes on the number of open connections, there might be a bunch of resources allocated for each one.
<FromGitter> <bararchy> @tonobo can you share the code of the app you're testing with? Maybe just an issue with resources not being freed
Raimondi has joined #crystal-lang
<FromGitter> <straight-shoota> OMG. I'm hunting a compiler bug
<FromGitter> <straight-shoota> It seems to be a ghost 😱
<FromGitter> <straight-shoota> Or maybe not...
<FromGitter> <straight-shoota> Nooooooooo 😢 It's an HCI failure.
<FromGitter> <straight-shoota> We should make `=+` "operator" a syntax error
<FromGitter> <jwoertink> anyone else here using the shard `clear`?
<FromGitter> <jwoertink> going from version 0.4 to 0.5 throws `BUG: `` at has no type (Exception)` when you have a file that only has `require "clear"`.
<FromGitter> <jwoertink> Not sure if that's a clear bug or crystal
<FromGitter> <jwoertink> it's this issue https://github.com/anykeyh/clear/issues/61
<FromGitter> <j8r> Can someone knows why strings are immutable in Crystal?
<FromGitter> <j8r> TIL Nim has mutable ones and no StringBuilder
spacemanspam has joined #crystal-lang
spacemanspam has quit [Read error: Connection reset by peer]
spacemanspam has joined #crystal-lang
<FromGitter> <bararchy> @straight-shoota HCI failure?
Renich has quit [Ping timeout: 246 seconds]
<FromGitter> <straight-shoota> human computer interaction
<FromGitter> <bararchy> Oh
Renich has joined #crystal-lang
<FromGitter> <bararchy> @straight-shoota applied your request regarding specs in https://github.com/crystal-lang/crystal/pull/7291
<FromGitter> <straight-shoota> great, I'll review
<FromGitter> <straight-shoota> @j8r Immutable strings are the only sane thing.
<FromGitter> <rishavs> Is there a simpler way to write this? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ It works but I dont understand it. Specially, the io.pipe, spawn and channels. Can I not just use the FormData builder and then the http client? [https://gitter.im/crystal-lang/crystal?at=5c3648b31d1c2c3f9ce98ce1]
<FromGitter> <bew> @rishavs there is some code missing after that i think, `channel` is not used outside the spawned fiber
<FromGitter> <rishavs> got it from here https://crystal-lang.org/api/0.27.0/HTTP/FormData.html
<FromGitter> <bajro17> Can someone help me make this work https://github.com/AlessandroMinali/gin.cr it give me so much errors :(
<FromGitter> <bew> What are you trying to do?
<FromGitter> <rishavs> upload an image file to cloudinary api
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> Ah ok i understand the example, it's the simplest way afaik
<FromGitter> <rishavs> thanks. guess i have some reading to do then :)
<FromGitter> <bew> I'm on my phone right now, but if you need help understand the code I may help later (or someone else can!)
<FromGitter> <bew> @bajro17 what is it supposed to do?
<FromGitter> <bajro17> Its just simple web router
<FromGitter> <bajro17> @bew but it throw so much errors I'm so bad in debugging crystal
<FromGitter> <bararchy> @bajro17 sending a gist with the errors might make it faster for you to get help, not everyone will be patient enough to clone the project and test it locally
<FromGitter> <bararchy> @straight-shoota so, approved ?
<FromGitter> <bajro17> @bararchy oh ok I'm so sorry I will do it now
<FromGitter> <bajro17> This is all I write
<FromGitter> <bajro17> and this is errors I get
<FromGitter> <bararchy> so.. ⏎ ⏎ ```undefined method 'resource=' for HTTP::Request ⏎ ⏎ req.resource = req.resource.lstrip($1)``` ⏎ ⏎ Basiclly it means `req` which is an `HTTP::Request` does not have a method which sets a new `resource` [https://gitter.im/crystal-lang/crystal?at=5c365053cc73f46a16defb73]
<FromGitter> <bararchy> you can `get` it (getter) but you can't `set` it (setter)
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/athena if you wanted to play around with my framework, should be easier to setup ;)
<FromGitter> <bajro17> @bararchy Thank you so much now it all work except parameters
<FromGitter> <bararchy> I would also use @Blacksmoke16 framework instead, or Kemal etc.. but, again, if you have an issue please try and provide more info, what do you mean by parameters?
<FromGitter> <Blacksmoke16> auto param conversion ftw, what's not to love? ha
<FromGitter> <bajro17> @bararchy Thank you so much I make it work with router.cr shard
<FromGitter> <bajro17> <3
<FromGitter> <Blacksmoke16> if you're just going to speed that is prob a good choice, id also checkout `amber-router` has some cool features i dont think the others have
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c36552e12db9607e7613087]
<FromGitter> <Blacksmoke16> however im not sure it would be possible...if anyone has some ideas/thoughts
<FromGitter> <bew> You could try to put your loop in a `finished` macro, inside the `Command` class declaration
return0e has quit [Remote host closed the connection]
<FromGitter> <Blacksmoke16> nope
<FromGitter> <Blacksmoke16> array is empty when doing ./binary -l`
<FromGitter> <Blacksmoke16> isnt the end of the world, just would have been nice since its going to be pretty much static data
<FromGitter> <Blacksmoke16> i also tried like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c365e798db70e46c4dedae7]
<FromGitter> <Blacksmoke16> `class variable '@@commands' of Registry must be Array(Command.class), not Array(C.class)` :(
<FromGitter> <Sija> how about using `inherited` macro hook?
<FromGitter> <Blacksmoke16> also tried that, empty array
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c365ed7ef78da1bced62693]
<FromGitter> <Blacksmoke16> with and without the \`\
<FromGitter> <Sija> you don't need the loop inside `inherited`
<FromGitter> <Blacksmoke16> how do you figure?
<FromGitter> <Blacksmoke16> oh
<FromGitter> <Sija> (it's a pain to write code on the mobile, so no example given)
<FromGitter> <Blacksmoke16> because its `self`
<FromGitter> <Blacksmoke16> er `{{@type}}`
<FromGitter> <Sija> yep
<FromGitter> <Sija> `Registry << self` should suffice
<FromGitter> <Blacksmoke16> still would register them all again every time you run the binary, but i think thats the best way to do it
<FromGitter> <Blacksmoke16> best way would be `class_getter commands : Array(Command.class) = {{Command.subclasses}}` as then you wouldnt *need* to register them, as it would already be set.
<FromGitter> <Blacksmoke16> but i remember reading that that isnt a bug :/
<FromGitter> <Sija> doesn't it work inside `finished`?
<FromGitter> <Blacksmoke16> from within the registry class?
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c36606f317e2407cd076814]
<FromGitter> <Sija> yep
<FromGitter> <Blacksmoke16> `class variable '@@commands' of Registry must be Array(Command.class), not Array(C.class)`
<FromGitter> <Sija> try adding `of Command.class`
<FromGitter> <Blacksmoke16> 😱
<FromGitter> <Blacksmoke16> wizard
<FromGitter> <Blacksmoke16> thanks!
<FromGitter> <Sija> /me puts on his robe wizard hat... ;)
<FromGitter> <Blacksmoke16> plus you got a sneak peak of new feature to come ;)
<FromGitter> <Blacksmoke16> to athena
<FromGitter> <bararchy> Trying to fix this shard https://github.com/randomstate/openssl_ext so that I can pull it to main repo, any one willing to help me figure the strange error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5c3664b8b81edc31f5d00347]
jokke has quit [Quit: WeeChat 2.3]
<FromGitter> <girng> hi oprypin
<FromGitter> <j8r> *oprypin leaves the room* 😂
<FromGitter> <girng> -_-
jokke has joined #crystal-lang
Raimondi has joined #crystal-lang
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> how do you guys deal with using modules as namespaces, but then you have long names
<FromGitter> <Blacksmoke16> just deal with it or?
<rkeene> Long names are best names
<FromGitter> <j8r> if you do it properly, you shouldn't have much huge names
<FromGitter> <Blacksmoke16> mostly when you have an enum in there it can get a bit longer :p
<FromGitter> <j8r> i.e Deep Some::Module::Inside::Another::Module
<FromGitter> <j8r> enums, yeah :/
Raimondi has quit [Ping timeout: 240 seconds]
<FromGitter> <j8r> do you need to declare them deep in the module tree?
<FromGitter> <Blacksmoke16> prob not
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5ype how does this make any sense
<FromGitter> <ezrast_gitlab> A struct is technically not a class
<FromGitter> <Blacksmoke16> same thing if you have it as a class
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5ypi
<FromGitter> <Blacksmoke16> works fine if you remove the `class_property`
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/5ypj `class_property` is borking something