RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.25.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
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
qard has joined #crystal-lang
qard has quit [Remote host closed the connection]
hightower2 has joined #crystal-lang
hightower3 has quit [Ping timeout: 264 seconds]
hightower3 has joined #crystal-lang
hightower2 has quit [Ping timeout: 260 seconds]
<FromGitter> <eliasjpr> @CaDs anything in Crystal is fast enough
zachk has quit [Quit: Leaving]
<FromGitter> <faustinoaq> @eliasjpr it depends πŸ˜… whenever is well implemented πŸ˜‰
<FromGitter> <faustinoaq> because you can create slow code in crystal as well, like any other programming language
<FromGitter> <eliasjpr> i guess what I am trying to say is that just by using crystal is fast enough
johndescs_ has joined #crystal-lang
johndescs has quit [Ping timeout: 264 seconds]
johndescs_ is now known as johndescs
snsei has joined #crystal-lang
<FromGitter> <faustinoaq> @eliasjpr Oh ok, I got it πŸ‘ πŸ˜„
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
rocx has joined #crystal-lang
<FromGitter> <S-YOU> I am expecting crystal binaries to optimize more with that.
<FromGitter> <faustinoaq> @S-YOU Wow, interesting πŸ‘
Excureo has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
That_Guy_Anon1 has joined #crystal-lang
snsei has joined #crystal-lang
That_Guy_Anon has quit [Ping timeout: 255 seconds]
<FromGitter> <mjago> @aemadrid FFMPEG has silence detect ability (see https://stackoverflow.com/questions/36074224/how-to-split-video-or-audio-by-silent-parts). Alternatively you could pipe through iconv to wav format and do `silence detect' in a fiber in near real-time.
<FromGitter> <mjago> @aemadrid In the latter case I have a shard for working with wav files (https://github.com/mjago/soundfile).
fbu has joined #crystal-lang
fbu has quit [Client Quit]
fbu has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <mjago> @aemadrid Sorry I meant avconv ~ aconv is something else πŸ˜•
hightower3 has quit [Ping timeout: 240 seconds]
hightower2 has quit [Ping timeout: 245 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
beizhia has joined #crystal-lang
<FromGitter> <aisrael> @ysbaddaden No `ysbaddaden/crystal-alpine:0.25.0` yet?
<FromGitter> <megatux> Hi again, sorry if this was answered before. Is kemal v 0.23 compatible with Crystal 0.24.2 ? I have a compiler error and had to set v0.22.0 explicitly
akaiiro has quit [Ping timeout: 256 seconds]
<FromGitter> <aisrael> (The good news is I was able to build Crystal 0.25.0 from within `ysbaddaden/crystal-alpine:0.24.2` :) )
bmcginty has quit [Ping timeout: 260 seconds]
akaiiro has joined #crystal-lang
ua has quit [Ping timeout: 264 seconds]
bmcginty has joined #crystal-lang
Liothen has quit [Ping timeout: 260 seconds]
kosmonaut has quit [Ping timeout: 256 seconds]
akaiiro has quit [Ping timeout: 256 seconds]
akaiiro has joined #crystal-lang
snsei has joined #crystal-lang
That_Guy_Anon1 has quit [Quit: Leaving]
<beizhia> codenoid: what sort of setup are you using? That sounds specific to whatever gui toolkit you choose
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
duane has quit [Ping timeout: 255 seconds]
duane has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondi has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 245 seconds]
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <icyleaf> a
<FromGitter> <icyleaf> Is anyone happens this exception during complie crystal on macOS 10.13.5: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b49d614ee5a10f974f4ad]
ua has joined #crystal-lang
akaiiro has quit [Ping timeout: 256 seconds]
baweaver has quit [Excess Flood]
baweaver has joined #crystal-lang
baweaver has quit [Changing host]
baweaver has joined #crystal-lang
<FromGitter> <S-YOU> Try with llvm5 `brew install llvm@5`?
<FromGitter> <icyleaf> yeah, i was installed llvm@4, llvm@5, llvm6, and it was throwed error when uninstall llvm 6 (use llvm@5), it still not found x86_64. it happened since crystal 0.25.0.
beizhia has quit [Quit: ERC (IRC client for Emacs 26.1)]
<FromGitter> <aisrael> @icyleaf Yeah I couldn't compile 0.25.0 on my Mac either, but had other things to do
<FromGitter> <bcardiff> @icyleaf llvm 6.0.0 has a bug fixed in 6.0.1 https://github.com/crystal-lang/crystal/issues/5556#issuecomment-373054783
<FromGitter> <bcardiff> nb: I use llvm 5.
<FromGitter> <icyleaf> @bcardiff it still broken: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b5648cbb5941bbf1386f5]
<FromGitter> <bcardiff> does `$ make clean deps` works?
<FromGitter> <icyleaf> πŸ‘ it works! thanks
<FromGitter> <bcardiff> :-) changing the llvm in the middle left an unusable llvm_ext.o which is linked later.
<FromGitter> <bcardiff> for succcesive compilation from a clean crystal compilatio of the compiler you can use `$ make clean_crystal crystal` that way the deps are not rebuilt, but you not use the compiled compiler to build a new compiler.
<FromGitter> <faustinoaq> Hi, I'm getting this error on macos: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Has somebody seen this before? sweat_smile [https://gitter.im/crystal-lang/crystal?at=5b2b5899148056028598ef94]
<FromGitter> <faustinoaq> Looks like a openssl issue, but I'm already using latest version available, see: https://github.com/amberframework/amber/blob/5ecebf30b218606d40233c69a848a70e36264401/.travis.yml#L36
<FromGitter> <bcardiff> I am not sure @faustinoaq but maybe the binary is not picking the expected openssl lib, I had used `--link-flags -L/usr/local/opt/openssl/lib` in some apps for that.
<FromGitter> <faustinoaq> @bcardiff Oh ok, so should I create/replace the link manually?
<FromGitter> <bcardiff> since you are installing an openssl from brew that might be the case.
<FromGitter> <faustinoaq> Ok, I'll try, Thank you!
<crystal-gh> [crystal] icyleaf opened pull request #6230: update manas link in README (master...update-manas-link-in-readme) https://git.io/fCxqQ
<FromGitter> <bcardiff> I use that option in a `crystal build` command.
<FromGitter> <codenoid> this is silly bug
<FromGitter> <codenoid> i have JSON::Any with ⏎ ⏎ ```a = {"fwa" => [{"fwa"=>42}]}``` ⏎ ⏎ and i can't access ["fwa"].each [https://gitter.im/crystal-lang/crystal?at=5b2b5df3d2abe466887bdcee]
<FromGitter> <codenoid> crystal 0.24
<FromGitter> <j8r> `as_h`?
<FromGitter> <codenoid> same
<FromGitter> <codenoid> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b5e95fc606203806e8a99]
<FromGitter> <faustinoaq> @bcardiff Oh I see: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Ref: https://github.com/Homebrew/homebrew-core/blob/master/Formula/openssl.rb#L21 [https://gitter.im/crystal-lang/crystal?at=5b2b5ebd6ceffe4eba245bb1]
<crystal-gh> [crystal] bcardiff closed pull request #6214: Remove :nodoc: from Time::Format (master...jm/fix/6206) https://git.io/vjuUk
<FromGitter> <faustinoaq> Would this be an issue for osx users in general? πŸ˜…
<FromGitter> <j8r> is it an array? so `data.as_a.each`?
<FromGitter> <icyleaf> @codenoid it works in crystal 0.24.2 https://play.crystal-lang.org/#/r/4cbk
<FromGitter> <codenoid> as JSON
<FromGitter> <codenoid> ```data = JSON.parse res.body # (http res) ⏎ data = data["fwa"] # fine ⏎ puts data[0] # error``` [https://gitter.im/crystal-lang/crystal?at=5b2b5f35467bd7268c263d30]
pwned has joined #crystal-lang
<FromGitter> <icyleaf> also works https://play.crystal-lang.org/#/r/4cbo
<FromGitter> <codenoid> but it's work
<FromGitter> <codenoid> ``` body = JSON.parse get.body ⏎ pp body["aaData"][0]["key"]``` [https://gitter.im/crystal-lang/crystal?at=5b2b5f8f59799e7017345f03]
<7ITAAGKAL> [crystal] bcardiff closed pull request #6229: Update changelog to include breaking change removing `JSON::Type` (master...bugfix/changelog-json-type) https://git.io/fc43g
<07IAC83T6> [crystal] bcardiff pushed 1 new commit to master: https://git.io/fWRaZ
<07IAC83T6> crystal/master ee71f88 Chris Hobbs: Update changelog to include breaking change removing `JSON::Type` (#6229)
<DeBot> https://github.com/crystal-lang/crystal/pull/6229 (Update changelog to include breaking change removing `JSON::Type`)
<DeBot> https://github.com/crystal-lang/crystal/pull/6229 (Update changelog to include breaking change removing `JSON::Type`)
<FromGitter> <j8r> cast it to an array, the implementation has changed
<FromGitter> <j8r> you can also do https://play.crystal-lang.org/#/r/4cbt
<FromGitter> <j8r> the good side is now you can use `as_*` multiple times :-)
<FromGitter> <icyleaf> i suggest compatibility to 0.25.0 ASAP
<FromGitter> <icyleaf> @codenoid recommend my http request library: https://github.com/icyleaf/halite, you could use v0.3.1 with crystal 0.24.x. πŸ˜„
<FromGitter> <umutuluer> hi guys
<FromGitter> <bararchy> hi @umutuluer
<travis-ci> crystal-lang/crystal#99be354 (master - Remove :nodoc: from Time::Format (#6214)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/394907188
<DeBot> https://github.com/crystal-lang/crystal/pull/6214 (Remove :nodoc: from Time::Format)
<FromGitter> <umutuluer> im using granite with mysql
<FromGitter> <umutuluer> have any your idea?
<travis-ci> crystal-lang/crystal#ee71f88 (master - Update changelog to include breaking change removing `JSON::Type` (#6229)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/394908240
<DeBot> https://github.com/crystal-lang/crystal/pull/6229 (Update changelog to include breaking change removing `JSON::Type`)
<crystal-gh> [crystal] ysbaddaden closed pull request #6182: Fix: integer kind deduction (master...master) https://git.io/vhwEF
<FromGitter> <aisrael> What version of Crystal are you using?
<oprypin> umutuluer, it's obviously some mismatch between the version of crystal (backwards incompatible change) and the version of the library (possibly not even updated yet)
<FromGitter> <umutuluer> @aisrael Crystal 0.24.2 (2018-03-10)
<crystal-gh> [crystal] bcardiff closed pull request #6152: Use Char instead of String at escape sequences (master...improvements) https://git.io/vhWVr
Raimondii has joined #crystal-lang
<FromGitter> <umutuluer> i tried 20 days ago but i have no problem
<FromGitter> <bcardiff> @faustinoaq I think so. I use only one app that is affected by that, unless I built it and run in in docker, that line is mandatory.
<FromGitter> <aisrael> @umutuluer Yeah. I'm guessing you just ran `shards update` and managed to pick up mysql 0.5.0 which I believe has been updated for Crystal 0.25.0
<FromGitter> <umutuluer> im trying in crystal play, i cant access Time::Location
<FromGitter> <umutuluer> @aisrael ok, i will upgrade crystal and mysql package
<FromGitter> <bcardiff> @umutuluer if you want to stay in 0.24.2 then you need to stay in crystal-mysql 0.4.0.
<FromGitter> <bcardiff> crystal-mysql v0.5.0 requires crystal 0.25.0
<FromGitter> <faustinoaq> @bcardiff Oh ok, How can I use `--link-flags` with `crystal spec`? πŸ˜…
Raimondi has quit [Ping timeout: 256 seconds]
Raimondii is now known as Raimondi
<FromGitter> <bcardiff> I think you should
<FromGitter> <bcardiff> all the build options are forwarded in spec cli
<FromGitter> <bendietze_twitter> @icyleaf nice game with Halite πŸ‘Œ Maybe i can use it for server development without need of browser or curl? Mean: Halite.get... directly before kemal get "/" do ... so without the need for client browser? This would be terribly fast for development in many cases πŸ˜„ I just have to output both sides, change parameters or whatever and run snippets again πŸ˜„ should be possible?
<FromGitter> <umutuluer> @bcardiff thanks, i upgraded crystal to 0.25, problem was fixed
<FromGitter> <aisrael> (Except that crystal 0.25.0 comes with its own set of new problems... :D )
<FromGitter> <faustinoaq> @bcardiff I'm getting this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b6b0f0168e70c08dfe762]
<FromGitter> <faustinoaq> I tried on linux and I get a similar message: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b6b8a6ceffe4eba247e0a]
<crystal-gh> [crystal] bcardiff closed pull request #6230: update manas link in README (master...update-manas-link-in-readme) https://git.io/fCxqQ
rohitpaulk has quit [Ping timeout: 276 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <bendietze_twitter> @icyleaf i mean, this would be crazy for test of cookies, sql, userdata ... Surely just must be done via fiber with some waittime.. But that should be possible... Is it possible to output raw response without parsing before?
<FromGitter> <icyleaf> @bendietze_twitter i got it, generally i test with this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b6e166c7cdb4945adee22]
<FromGitter> <bendietze_twitter> @icyleaf great game!! πŸ’ͺπŸŽ‰
<FromGitter> <bendietze_twitter> This is pretty pretty cool xD
<FromGitter> <bendietze_twitter> Don't know it before but love it already πŸ˜„
<oprypin> which game
<FromGitter> <icyleaf> @bendietze_twitter and also apply it in specs code: https://github.com/icyleaf/halite/blob/master/spec/halite_spec.cr
<FromGitter> <bendietze_twitter> I would need to things @icyleaf first is get the raw response (to be sure) and multipart/form-data including input multiple tag were nice :)
<FromGitter> <bendietze_twitter> Wow! This is nice :) πŸ‘
<FromGitter> <bcardiff> @faustinoaq `$ crystal spec --link-flags -L/usr/local/opt/openssl/lib`
<travis-ci> crystal-lang/crystal#0e4a62a (master - Fix: integer kind deduction (#6182)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/394919598
<DeBot> https://github.com/crystal-lang/crystal/pull/6182 (Fix: integer kind deduction)
<FromGitter> <faustinoaq> @bcardiff Yeah, I used that command and I got: `Unhandled exception: Invalid option: --link-flags (OptionParser::InvalidOption)` ⏎ ⏎ Can you reproduce this? πŸ˜…
<FromGitter> <bendietze_twitter> @icyleaf i am not at home so not possible for me to check things out but nice to talk about :)
<FromGitter> <bcardiff> @faustinoaq as a workaround if it does not work for you, you can build the specs with build and then run them.
<FromGitter> <bendietze_twitter> @icyleaf maybe output is raw - i just have seen Halite possibilities - must try at home these days :)
<FromGitter> <faustinoaq> @bcardiff Yeah, I'll try that, BTW, looks like `crystal spec` is using `setup_simple_compiler_options`, so, it doesn't support all flags πŸ˜…
<FromGitter> <bendietze_twitter> @icyleaf next possibility could be easy running 1000 concurrent fibers with random data without many typing and such things - coool πŸ˜„
<FromGitter> <bcardiff> @faustinoaq ooops . I guess the specs of the project I am mock the ssl connections.
<FromGitter> <bendietze_twitter> @icyleaf and - as you done - cumulated test specs or fibers to run everything at least with one click - just for test after big changes - great :)
<FromGitter> <bendietze_twitter> You could fork to HaliteX with capabilities for this πŸ˜„
<FromGitter> <aisrael> Oooh... in `alpine:edge` you can just `apk add crystal` and get 0.25.0. Neat!
<FromGitter> <icyleaf> @bendietze_twitter welcome any issues :) ⏎ @aisrael awesome!
<FromGitter> <bendietze_twitter> I will go and check out these days :)
<FromGitter> <faustinoaq> @bcardiff I just opened https://github.com/crystal-lang/crystal/issues/6231
<FromGitter> <faustinoaq> @aisrael Wow, very nice πŸ˜„ πŸ‘
rohitpaulk has quit [Ping timeout: 268 seconds]
<travis-ci> crystal-lang/crystal#430fea3 (master - doc: update manas link (#6230)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/394926206
<DeBot> https://github.com/crystal-lang/crystal/pull/6230 (update manas link in README)
<FromGitter> <bendietze_twitter> @icyleaf sorry, in your spawn snippet above Halite should be spawned as the server must completely be loaded, but, don't want to discuss about, nice you try it for me πŸ‘ thx
<FromGitter> <faustinoaq> @bcardiff `crystal run --link-flags -L/usr/local/opt/openssl/lib spec/amber_spec.cr` did the trick, thanks you! πŸ˜„ πŸ‘
<FromGitter> <bendietze_twitter> @icyleaf but ... i am not sure πŸ˜„ i will try ... Thanks :)
<FromGitter> <Grabli66> Ohhh. Can't compile crystal on arch linux under virtual box with 8GB memory. Fork out of memory 😟
<FromGitter> <faustinoaq> @Grabli66 Do you have a swap partition on your VM?
<FromGitter> <faustinoaq> or a swap file?
<FromGitter> <Grabli66> no :)
<FromGitter> <Grabli66> I have only root partition and can't resize it πŸ˜„
<FromGitter> <faustinoaq> @Grabli66 Oh, I'm pretty sure you need a swap to compile any crystal program, try creating a swap file: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2b83e41480560285995f64]
<FromGitter> <Grabli66> Ok. I will try
<FromGitter> <bendietze_twitter> btw... I got very service oriented and customer friendly response from bountysource, but since i started last month everything there is hanging. If i would not talk to them via email, i would drop every support because its extrem laggy and mostly no good experience to start sponsoring Crystal 😟 this system is irritating
rocx has quit [Quit: "but first, you'll have to catch me!" rocx throws a smoke bomb at his feet. when the smoke dissipates, he's gone.]
<FromGitter> <bararchy> @faustinoaq no swap here and I'm all fine :)
<FromGitter> <faustinoaq> @bararchy Oh, ok, Can you compile crystal from source without swap as well?
<FromGitter> <bararchy> yeha, I do have 32Gb ram though
<FromGitter> <faustinoaq> Oh πŸ˜…
<FromGitter> <faustinoaq> How much RAM do circle-ci and travis have?
<FromGitter> <bendietze_twitter> Maybe they are scaled?
<FromGitter> <faustinoaq> I think the Crystal CI is able to compile and test crystal without too many RAM. right?
<FromGitter> <j8r> even with low ram, if you are root on a recent Linux system you can compress the RAM with zswap
<FromGitter> <aisrael> I don't get it. I keep getting ⏎ ⏎ ```Outdated shard.lock (cql requirements changed). Please run shards update instead.``` ⏎ ⏎ Even after `shards update` completes successfully. I've removed `shard.lock` and emptied `lib/` and I *still* get the error (Crystal 0.25.0, shards 0.8.0 in an `alpine:edge` Docker container) [https://gitter.im/crystal-lang/crystal?at=5b2b886c467bd7268c26ab4c]
<FromGitter> <aisrael> The same project builds successfully with no issues under macOS High Sierra
<FromGitter> <mamantoha> @aisrael try `rm -rf ~/.cache/shards/`
<FromGitter> <bararchy> @aisrael Latest shard is broken and have regression, you can update to 0.8.1 to fix it, or wait for Crystal 0.25.1 next week
rohitpaulk has joined #crystal-lang
<FromGitter> <aisrael> @mamantoha Thanks! Well, so now even in macOS I'm getting the `Outdated shard.lock` error so at least it's consistent :P
<FromGitter> <aisrael> Will have to see how I can get shards 0.8.1 on `alpine:edge` if I can...
<FromGitter> <j8r> that's simple: compile https://github.com/crystal-lang/shards
<FromGitter> <j8r> then copy it e.g. /usr/local/bin
<FromGitter> <faustinoaq> Hey, BTW, a quick question, Is RAM more important than CPU on a VPS?
<FromGitter> <bendietze_twitter> should depend on swap ;) the one is limited, the other slow xD
<crystal-gh> [crystal] MakeNowJust opened pull request #6232: Macro: add missing document for ArrayLiteral#push and #unshift (master...fix/macro/add-doc-for-array-mutational-methods) https://git.io/fWbrS
<FromGitter> <j8r> @faustinoaq depends on what you do
<FromGitter> <aisrael> I took the lazy way out and just used `crystal build --release src/main.cr`
<FromGitter> <j8r> if this is a personal VPS, maybe RAM is the most important to have the most apps possible
<FromGitter> <hmans> What is up, Crystal friends
<FromGitter> <bendietze_twitter> Has anyone experience or knowledge about connecting some cloudservers as a cluster via IP? What could be the best option? Via TCP only websocket i think (frame size is unreachable) or is there a better way to transfer data with minimal overhead between and fast response? I mean only written in Crystal itself :)
<FromGitter> <hmans> @bendietze_twitter I didn't get the context of your Bountysource topic... did you run into issues with them? Because I did, too (and ended up opening that issue about it on Github). It's frustrating, I want to put some money into Crystal, but I absolutely do not want to do it through Bountysource.
<FromGitter> <faustinoaq> @j8r Ok πŸ‘
<FromGitter> <bendietze_twitter> I just want to talk about because others could have left already
<FromGitter> <faustinoaq> @hmans Just send a twitter to https://twitter.com/bountysource, They will help you! πŸ˜‰
<FromGitter> <bendietze_twitter> @hmans gitter do not send my answer, its red? :)
<FromGitter> <bendietze_twitter> 1) times ;)
<FromGitter> <bendietze_twitter> They do the things manually for me but i must ask every time ;)
<FromGitter> <bendietze_twitter> I guess there is a paypal issue
<FromGitter> <bendietze_twitter> They answered function broken
<FromGitter> <bendietze_twitter> But month later nothing happens and i hsve to ask again
<FromGitter> <bendietze_twitter> But the supporter is a very friendly guy ;)
<oprypin> updated pre-generated downloadable documentation: https://pryp.in/crystal/
<crystal-gh> [crystal] MakeNowJust opened pull request #6233: doc: use `bind_tcp` in doc correctly (master...fix/use-bind-tcp-in-doc-correctly) https://git.io/fWbiJ
wuehlmaus has quit [Ping timeout: 256 seconds]
duane has quit [Ping timeout: 240 seconds]
<FromGitter> <MakeNowJust> @asterite Personal question related to https://github.com/crystal-lang/crystal/pull/6222#issuecomment-399082660: How do you think implementing the formatter without lexer running on formatting? Is this possible?
wuehlmaus has joined #crystal-lang
wuehlmaus is now known as Guest57596
<crystal-gh> [crystal] bcardiff opened pull request #6234: Handle File.extname edge case (master...fix/6215-file-extname) https://git.io/fl34N
<jokke> heya!
<jokke> wasn't there a macro for included and inherited? can't seem to find the docs
Guest57596 has quit [Ping timeout: 260 seconds]
<FromGitter> <asterite> @MakeNowJust Lexer running on formatting is good. I just meant there's a lot of duplicate code. When I started implementing rufo ( https://github.com/ruby-formatter/rufo ) I did it more nicely, reusing a lot of code, extracting functions, thinking more clearly (I also had experience from Crystal's formatter). But, yeah, it's about doing it in the same way but without so much code duplication and little flags
<FromGitter> <asterite> jokke: it's not documented, but it's just `macro included`, `macro extended`, etc.
<jokke> ah thanks
<jokke> asterite: i'm trying to add mass assignment to JSON.mapper enabled classes
<jokke> asterite: for some reason @type.instance_vars is empty though after having run JSON.mapping
<jokke> *JSON.mapping
<jokke> anyone?
<jokke> @asterite: is this a compiler bug or am i missing something here...?
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<FromGitter> <straight-shoota> @jokke `include` (and `included` macro) is evaluated before `JSON.mapping` is expanded.
<FromGitter> <straight-shoota> you could probably work around that using `finished`, but it's probably better to just move to `@JSON::Field` annotation-based mappings available in 0.25.0.
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<jokke> ooh
<jokke> what's that?
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<FromGitter> <drum445> Hi Guys, how would I get this to work in crystal
<jokke> @straight_shoota any docs regarding that?
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<FromGitter> <drum445> read up on the reflection docs but I can't see an equivalent to send in ruby or get_attr in python
<jokke> @straight-shoota thanks!
<FromGitter> <straight-shoota> @drum445 There aren't. Ruby and python are interpreted, but Crystal is compiled and doesn't have the required information available at runtime to do arbitrary method calls.
<FromGitter> <drum445> It's not a method call it's an attribute getter by name
<jokke> oooh thats very nice!
<FromGitter> <drum445> Go allows this with it's reflection package
<FromGitter> <straight-shoota> jokke, the main reason for this is to solve exactly such problems depending on order of execution as you've encountered. And it makes JSON properties easily expandable in subclasses.
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<jokke> yeah!
<jokke> it's awesome
<jokke> hm but still it seems that the included macro is executed first..
<jokke> looks like this now: https://p.jokke.space/6vZp/
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<jokke> @straight-shoota any ideas? :)
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
akaiiro has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
sz0 has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
<FromGitter> <asterite> jokke: instance vars info is only available inside methods, after the top-level is resolved
duane has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
<FromGitter> <asterite> Basically, there's no way to do what you want. Or maybe yes, you could always have `def initialize(**args)` and then inside that method traverse the instance vars... but I think it won't work.
<FromGitter> <asterite> And I don't think mass assignment is something good
<FromGitter> <asterite> I think Crystal should implement runtime reflection and drop compile-time reflection. Maybe also drop nil detection and go for the usual "null pointer exception". It will make the language both simpler and more powerful (null pointer exception is really not that terrible). But I don't know how would all of that look like in Crystal...
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<oprypin> k
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
kosmonaut has joined #crystal-lang
kosmonaut has quit [Client Quit]
kosmonaut has joined #crystal-lang
kosmonaut has quit [Client Quit]
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
<FromGitter> <asterite> I mean it. Runtime reflection is superior to compile-time reflection. Right now for every type you get a loooot of duplicated code to parse/serialize it from/to JSON. With runtime reflection it's just one method. Maybe a bit slower, but not significantly slower (or, people don't really care about that kind of performance when you put together a lot more things into your program). And then because values don't
<FromGitter> ... have a default value (zero for numbers, null for references) you can't instantiate instances generically. Well, you can, but then you would get horrible segfaults. So someone really has to prove the merits of compile-time reflection and strong nullability check.
kosmonaut has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
kosmonaut has quit [Client Quit]
kosmonaut has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
gewo has quit [Ping timeout: 265 seconds]
duane has quit [Read error: Connection reset by peer]
DTZUZO has quit [Ping timeout: 248 seconds]
<FromGitter> <bararchy> @asterite runtime nil exception is high in the reason list for why I left Ruby for Crystal
<FromGitter> <bararchy> Having this abominations shoved into Crystal is a very bad idea
DTZUZO has joined #crystal-lang
<crystal-gh> [crystal] bcardiff closed pull request #6233: doc: use `bind_tcp` in doc correctly (master...fix/use-bind-tcp-in-doc-correctly) https://git.io/fWbiJ
<FromGitter> <j8r> agree with @bararchy πŸ‘
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
snsei has quit [Remote host closed the connection]
<FromGitter> <S-YOU> With runtime reflection, you need type field for every types including numbers, and bool, right. I am not sure LLVM can optimized to plain value when type is not needed.
<92AADE06N> [crystal] bcardiff pushed 1 new commit to master: https://git.io/flFrM
<7JTAEMC0U> [crystal] bcardiff closed pull request #6218: Add missing JSON field to docs generator output for constants (master...jm/fix/6202) https://git.io/fJKws
<92AADE06N> crystal/master 666c192 Johannes MΓΌller: Add missing JSON field to docs generator output for constants (#6218)
<DeBot> https://github.com/crystal-lang/crystal/pull/6218 (Add missing JSON field to docs generator output for constants)
<DeBot> https://github.com/crystal-lang/crystal/pull/6218 (Add missing JSON field to docs generator output for constants)
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
<FromGitter> <asterite> I don't think it's optimized. The data is always there at runtime, ready to be queried
<FromGitter> <S-YOU> I see, I doubt that too. So, there may be little overhead.
Liothen has joined #crystal-lang
Liothen has quit [Changing host]
Liothen has joined #crystal-lang
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: this is not the client you are looking for]
duane has joined #crystal-lang
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/flFXO
<crystal-gh> crystal/master fd628c9 TSUYUSATO Kitsune: Macro: add missing document for ArrayLiteral#push and #unshift (#6232)
<travis-ci> crystal-lang/crystal#60cde01 (master - Use `bind_tcp` in doc correctly (#6233)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/395087040
<DeBot> https://github.com/crystal-lang/crystal/pull/6233 (doc: use `bind_tcp` in doc correctly)
<crystal-gh> [crystal] r00ster91 opened pull request #6237: Use more chars instead of strings (master...improvements) https://git.io/flFXn
snsei has joined #crystal-lang
wontruefree has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
marius has quit [Quit: Ping timeout (120 seconds)]
marius has joined #crystal-lang
wontruefree has quit [Quit: this is not the client you are looking for]
<travis-ci> crystal-lang/crystal#fd628c9 (master - Macro: add missing document for ArrayLiteral#push and #unshift (#6232)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/395106263
<DeBot> https://github.com/crystal-lang/crystal/pull/6232 (Macro: add missing document for ArrayLiteral#push and #unshift)
wontruefree has joined #crystal-lang
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
zachk has joined #crystal-lang
zachk has quit [Changing host]
zachk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
duane has quit [Ping timeout: 245 seconds]
snsei has quit [Remote host closed the connection]
duane has joined #crystal-lang
rocx has joined #crystal-lang
pwned has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<FromGitter> <BenDietze> @icyleaf hey, just trying at this moment - works perfectly as aspected - simply spawn halite with commandos at top of file - when server starts listening the scheduler runs halite πŸ‘ πŸ”₯ πŸ‘
<FromGitter> <BenDietze> benchmarks himself πŸ˜„
<FromGitter> <BenDietze> i can go sleep :)
<FromGitter> <BenDietze> oh, yes - and is already raw output πŸ‘
<FromGitter> <confact> Hi! the old Shoutcast server have their own headers of http status, instead of HTTP 200 they have `ICY 200 OK` - How can I let http client to accept these headers?
<RX14> well its not HTTP
<RX14> so you'll have to piece together the parts from the existing stdlib http implementation
<RX14> shouldnt be too hard
<RX14> @confact HTTP.parse_headers_and_body parses everything in a request apart from the initial status link
<RX14> HTTP 200 OK etc
<RX14> and replace the but about supported versions with `== "ICY"`
<FromGitter> <confact> Do I overwrite the method as I do in Ruby? Or does it work differently?
<oprypin> same
<FromGitter> <confact> great, thanks @RX14 and @oprypin
<RX14> what do you mean overwrite the method?
<RX14> please don't use overloading for this
<RX14> just copy and paste the whole method
<RX14> and put it in your library
<RX14> and modify it as-needed
<oprypin> confact, yes, I agree with RX14
<FromGitter> <fgimian> Hey guys, are there any Oracle bindings for Crystal at this time?
<FromGitter> <confact> How do I add a custom method to the HTTP::Client::Response then. I am just doing my first crystal app, a background job.
<FromGitter> <fgimian> (database bindings that is)
<oprypin> confact, you can add it but you are not supposed to, for best practices
<oprypin> fgimian, https://crystalshards.xyz/?filter=oracle -> none (also try other keywords)
<FromGitter> <confact> @oprypin what is best practice then, copy paste the method to my library won't fix my problem.
<FromGitter> <confact> https://gist.github.com/confact/4c0ad952f67fe844f46aeaf2fbeec752 is how I added support for ICY in my Net::HTTP in Ruby, not a nice way, but worked.
faustinoaq has joined #crystal-lang
snsei has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <fgimian> thanks @oprypin, yeah that's what I had searched previously, was just hoping maybe there was something i was unaware of
<RX14> @confact why won't copy and pasting fix your problem?
<RX14> you don't need to add a method to HTTP::Client::Response
<RX14> you just need to write a meethod that returns a HTTP::Client::Response
<RX14> it's constructor is public
<RX14> so you can put your custom constructor wherever you want
<wontruefree> why dose HTTP::Server have multiple transports now?
wontruefree has quit [Quit: bye]
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <codenoid> hi, i have a int with value 200, how i can split that into 2/* part of number, ex: ⏎ ⏎ ```[46,72,38,44] # from 200 ⏎ [83,117] # from 200``` [https://gitter.im/crystal-lang/crystal?at=5b2c35e6fc6062038070e7c0]
<FromGitter> <codenoid> ``` a = total/x_part ⏎ div = a/2 ⏎ min = div - Random.rand(1..6) ⏎ max = min + *``` [https://gitter.im/crystal-lang/crystal?at=5b2c36df7da8cd7c8c61f08e]
<FromGitter> <codenoid> there must be a number that 20% larger than the others
akaiiro has quit [Ping timeout: 256 seconds]