ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
duane has joined #crystal-lang
zachk has quit [Quit: Leaving]
duane has quit [Ping timeout: 256 seconds]
wontruefree has joined #crystal-lang
txdv has quit [Ping timeout: 240 seconds]
<FromGitter> <reiswindy> Is there a "standard" way of validating json structures in Crystal?
wontruefree has quit [Quit: bye]
<FromGitter> <aemadrid> anybody doing SQS in Crystal?
<FromGitter> <aemadrid> I can only find signers and S3 but no SQS library...
txdv has joined #crystal-lang
Philpax has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 264 seconds]
Raimondii is now known as Raimondi
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
akaiiro has quit [Ping timeout: 240 seconds]
akaiiro has joined #crystal-lang
woodruffw has joined #crystal-lang
woodruffw has quit [Changing host]
woodruffw has joined #crystal-lang
<FromGitter> <S-YOU> Looks like there is overhead for running inside docker on TFB tests. Or I am missing something.
<FromGitter> <bararchy> So, is it really taking us 5 days to manually sign 5 binary files???
Raimondii has joined #crystal-lang
<FromGitter> <bararchy> Its like max 30 min of work + uploading to github
<FromGitter> <bararchy> I think the next step is automate the sign process too so that we don't need to wait for it being done manually..
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<crystal-gh> [crystal] sdogruyol closed pull request #6145: Add Etag support in HTTP::StaticFileHandler (master...redo_static_file_handler) https://git.io/vhsyl
<FromGitter> <bararchy> Also maybe the signing keys should be available to the whole core team.
<FromGitter> <bararchy> So that RX14 or @sdogruyol can do it too
<FromGitter> <bararchy> No point in keeping it under Manas lock
<FromGitter> <S-YOU> Submitted h2o binding for plaintext requests to TFB, @faustinoaq, https://github.com/TechEmpower/FrameworkBenchmarks/pull/3861
<livcd> Ruby is popular outside of Japan but it's really tied to specific areas and locations
<livcd> python is kinda...omnipresent like JS
<travis-ci> crystal-lang/crystal#5d431c7 (master - Add Etag support in StaticFileHandler (#6145)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/392555918
<DeBot> https://github.com/crystal-lang/crystal/pull/6145 (Add Etag support in HTTP::StaticFileHandler)
rohitpaulk has joined #crystal-lang
<FromGitter> <codenoid> yeah agree
<FromGitter> <codenoid> $$LaTeX code$$
<FromGitter> <codenoid> ```<?php return "<?php echo '<?php echo 0; ?>'; ?>"; ?>```
woodruffw has quit [Ping timeout: 255 seconds]
woodruffw has joined #crystal-lang
woodruffw has joined #crystal-lang
<FromGitter> <bararchy> At lasttt
<FromGitter> <bararchy> 1) 25.0 bins are out
<FromGitter> <bararchy> Hell yeh
<FromGitter> <bararchy> Thanks team
zolbatar has joined #crystal-lang
<FromGitter> <epergo> 🎉 🎉 🎉 🎉 🎉 🎉 great job! 🎉 🎉 🎉 🎉
<FromGitter> <gdotdesign> Nice 🎉
a310x has joined #crystal-lang
<travis-ci> crystal-lang/crystal#e81b1c8 (ci/update-0.25.0 - Update CI to use 0.25.0): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/392591557
a310x has quit [Quit: Page closed]
<FromGitter> <yxhuvud> yay!
<FromGitter> <Grabli66> Awesome. Huge changelog. :)
<txdv> what huge changelog?
<FromGitter> <Grabli66> Changelog for 0.25
<FromGitter> <bcardiff> Docker images and linux packages are ready to go. There is a little hold back in homebrew formulas for OSX users. Binaries are available in github as usual.
<FromGitter> <S-YOU> Cheers!
<FromGitter> <gdotdesign> I'm converting Mint to 0.25 and when compiling I get: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and a bunch of `cc: error:` and then it fails with `Error: execution of command failed with code: 1: `cc "${@}" ...` [https://gitter.im/crystal-lang/crystal?at=5b237825e87f0c7bee8d7b28]
<FromGitter> <hmans> I love you, Brian J. Cardiff.
<FromGitter> <j8r> How i can to this in 0.25.0 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2379436b24803e845a3a59]
<FromGitter> <j8r> I have ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b23794be87f0c7bee8d7ca2]
<FromGitter> <j8r> Note that I need to do this because the I *can't* serialize the JSON - it has a *dynamic* mapping
<FromGitter> <bcardiff> `k[i].as_s`?
<FromGitter> <bcardiff> `k` is not an `Array(String)`. if it is you can convert it before all the navigation.
<FromGitter> <bcardiff> `k.as_a.map &.as_s` should do.
<FromGitter> <j8r> In reality `k` is an `Array(String)` like `config.local.port`. The idea is to modify the JSON path corresponding of this string
<FromGitter> <j8r> Even changing to `data.as_h"[k[0]"] = "val"` doesn't work :(
<FromGitter> <gdotdesign> is there a way to downgrade the Ubuntu package? it seems the only version is 0.25
<FromGitter> <straight-shoota> @gdotdesign no, the package repository only contains the latest release. But you can manually download and install an older release package from https://github.com/crystal-lang/crystal/releases
<FromGitter> <gdotdesign> ok, thanks :) should I create an issue about the compiler error I posted above?
<FromGitter> <straight-shoota> yes
alex`` has joined #crystal-lang
<FromGitter> <gdotdesign> 👍
<FromGitter> <bcardiff> @j8r oh, the problem is `v`. `... = JSON::Any.new(v)` then ?
<FromGitter> <j8r> This was this @bcardiff - thanks 😄
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
<FromGitter> <faustinoaq> @S-YOU Awesome! 🎉
<FromGitter> <Grabli66> What we will wait next? Windows or parallelism? 😄
<FromGitter> <faustinoaq> @Grabli66 I guess Windows support would come first 😅 thanks to RX14 ✨
<FromGitter> <faustinoaq> Parallelism is a bigger issue
<FromGitter> <faustinoaq> I have read https://engineering.universe.com/introduction-to-concurrency-models-with-ruby-part-i-550d0dbb970 ⏎ and looks like parallelism and concurrency are the biggest issue in every program language 😅
<FromGitter> <yxhuvud> @faustinoaq no, some languages have made tradeoffs to make it simple, like erlang. I don't think the tradeoffs are worth it, but it is certainly possible to make parallelism relatively easy
<FromGitter> <faustinoaq> Well, Even Go and Elixir/Erlang have common issues in their parallelism/concurrency models
<FromGitter> <faustinoaq> Although, those are known issues and are well documented 😉
<FromGitter> <faustinoaq> Hi, @bcardiff Do you know why Linux packages are heavier than macOS packages for crystal?
<FromGitter> <S-YOU> it is static binary ⏎ ⏎ ```# ldd /usr/bin/crystal ⏎ not a dynamic executable``` [https://gitter.im/crystal-lang/crystal?at=5b2386c482b1b355c95a0d7d]
<FromGitter> <faustinoaq> @S-YOU Oh ok 👍 😅
sheka has joined #crystal-lang
sheka has quit [Client Quit]
<FromGitter> <bcardiff> @faustinoaq the packaing used since 0.24.2 use llvm-4.0 build in alpine. before that we use a custom llvm build that was smaller. and we still use in osx (but is in 3.9.1 also).
<FromGitter> <faustinoaq> @bcardiff Yeah, no problem, thank you! 👍
<FromGitter> <bcardiff> we could switch back to a custom llvm build to reduce some space for sure. that was already done but we need to maintain the llvm build process aswell then.
<FromGitter> <vlazar> https://crystal-lang.org is still redirecting to 0.24.2 API docs
<FromGitter> <bcardiff> yes. on it :-) needed to left the airbnb in the middle :-)
<FromGitter> <vlazar> 🎉
<FromGitter> <S-YOU> space is last thing I would care , unless it is like 1G+
<FromGitter> <S-YOU> or application binary is like 50M+
<FromGitter> <vlazar> yeah, app binary may sometimes be important, compiler itself - who cares?
<FromGitter> <faustinoaq> Yeah, if you want you can try to create pretty small binaries in crystal 😉 https://github.com/kubo39/tinycr
<FromGitter> <S-YOU> nasm xD
<FromGitter> <S-YOU> most of them are from http://timelessname.com/elfbin/
<FromGitter> <vlazar> ha, cheating :)
<FromGitter> <faustinoaq> Also see https://github.com/dom96/binary_size :)
<FromGitter> <vlazar> I'm all for tiny usable binaries though. Thanks!
<FromGitter> <S-YOU> usable is the point :)
xiljin has joined #crystal-lang
<FromGitter> <codenoid> hi, how to check is my string contain // regex or not
That_Guy_Anon has joined #crystal-lang
<FromGitter> <codenoid> /^[a-z\d\-_\s]+$/i ===
<FromGitter> <codenoid> re.match?(str) not available
<FromGitter> <faustinoaq> @codenoid Are you sure? https://crystal-lang.org/api/master/Regex.html#match(str,pos=0,options=Regex::Options::None):MatchData?-instance-method
<FromGitter> <codenoid> https://carc.in/#/r/4amt
<FromGitter> <faustinoaq> @codenoid Try https://crystal-lang.org/api/master/Regex.html#=~(other:String)-instance-method
<FromGitter> <codenoid> not `match?`
<FromGitter> <codenoid> ok
<FromGitter> <faustinoaq> Yeah, try https://carc.in/#/r/4amw
<FromGitter> <fuegito> isn't match? a rubyism (since 2.5.x)?
<FromGitter> <faustinoaq> @codenoid Maybe we can implement that method to crystal as well 😅
<FromGitter> <j8r> @bcardiff You solution works for JSON, but I'm struggling with YAML - it doesn't behave like JSON ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b2392466b24803e845a74ac]
<FromGitter> <faustinoaq> Hey @S-YOU looks like libreactor is faster than h2o on plaintext 😅
<FromGitter> <j8r> as usual, i would like to do a ⏎ ⏎ ```yaml.as_h["string"] = val``` [https://gitter.im/crystal-lang/crystal?at=5b23927b1c7d4214379ab318]
<FromGitter> <faustinoaq> although, looks like libreactor is a very undocumented lib :/
<FromGitter> <faustinoaq> ^^ https://www.techempower.com/benchmarks/#section=test&runid=a7f29eb8-862b-49ce-9789-ff72a6410800&hw=ph&test=plaintext&l=hma7su
<FromGitter> <bcardiff> @j8r `yaml.as_h[YAML::Any.new("string")] = val`?
<FromGitter> <bcardiff> YAML and JSON Any are now a bit more terse wrappers. String is not a YAML::Any.
<crystal-gh> [crystal] bcardiff closed pull request #6174: Add specs for Time parser to raise when time zone is missing (master...jm/feature/time-format-emtpy-zone-spec) https://git.io/vhad2
<FromGitter> <Val> https://carc.in/#/r/4an3 works with 0.24.2 but got `Unhandled exception: Expected String, not 0.1 at line 2, column 10 (YAML::ParseException)` with 0.25.0 . Is it a way to force String cast in YAML mapping definition ?
<FromGitter> <j8r> @Val https://crystal-lang.org/api/master/YAML.html#mapping%28_properties_%2Cstrict%3Dfalse%29-macro ?
<faustinoaq> Oh, I just realize a Kemal/Amber/Lucky project with some shards dependencies can easily have more crystal lines than crystal compiler itself ;-)
<faustinoaq> Currently crystal compiler is almost 200K crystal lines
<FromGitter> <Val> @j8r : Ok if I want all defined mappings to be strict but what if I want only `version` to be forced as a String ? May be `converter` can be used for that purpose ?
<faustinoaq> Meanwhile an Kemal/Amber/Lucky project (not shards themselves, but generated projects) with database, session, and other shards, can be easily 500K lines :-D
<FromGitter> <vlazar> lol, https://www.openhub.net/p/crystal-lang says "... is mostly written in JavaScript"
<faustinoaq> So, compile time would be important after all ;-) ^^ @bcardiff
<faustinoaq> @vlazar Why?
<FromGitter> <vlazar> I guess it doesn't recognize Crystal
<faustinoaq> @vlazar Oh ok :)
<FromGitter> <Val> String::RawConverter does not implement `from_yaml` :-(
<FromGitter> <BenDietze> @vlazar and this: Over the past twelve months, 115 developers contributed new code to Crystal Language. This is one of the largest open-source teams in the world 😄
<FromGitter> <BenDietze> Yes, we are :)
<travis-ci> crystal-lang/crystal#8e5e4c7 (master - Add specs for Time parser to raise when time zone is missing (#6174)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/392654405
<DeBot> https://github.com/crystal-lang/crystal/pull/6174 (Add specs for Time parser to raise when time zone is missing)
<FromGitter> <vlazar> it still will be nice to see correct stats based on recognized Crystal source, not JavaScript ;)
alex`` has quit [Ping timeout: 240 seconds]
<FromGitter> <codenoid> how i can remove any html tag in string
<FromGitter> <bcardiff> are you trying to extract the text content of an html @codenoid ?
<FromGitter> <codenoid> `.gsub(/<\/?[^>]*>/, "")`
<FromGitter> <codenoid> yes, just text, without specified el
<FromGitter> <bcardiff> using regex is the "easy" path and works in lots of cases, but the right and longer path is to use xml/html parser and traverse the dom tree. that would allow you to strip some elements content like <style>.
<FromGitter> <j8r> also performance wise regex isn't the most efficient solution
<FromGitter> <yxhuvud> well, it is usually more performant than parsing xml
alex`` has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Ping timeout: 276 seconds]
<FromGitter> <Daggerron> I have a basic dockerfile to set my crystal environment, since the 0.25.0 update i get this error, am i the only one ? ```Error in src/matcha.cr:1: while requiring "kemal" ⏎ ⏎ require "kemal" ⏎ ^ ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5b23a871c277fb705dd084e6]
<FromGitter> <asterite> Don't expect all libraries to be already updated to 0.25.0... Kemal (and many others) need new releases
That_Guy_Anon has quit [Ping timeout: 248 seconds]
<FromGitter> <Daggerron> yeah i know that's why i tried "FROM crystallang/crystal:0.24.2" in my dockerfile but it still gives me the 0.25.0 version
That_Guy_Anon has joined #crystal-lang
<FromGitter> <bcardiff> ```code paste, see link``` ⏎ ⏎ @Daggerron ? [https://gitter.im/crystal-lang/crystal?at=5b23aa9f8864a936cc8a9ef5]
That_Guy_Anon has quit [Client Quit]
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
<FromGitter> <bcardiff> Oh, I think you are using kemal @ master or some version updated for 0.25 that drops 0.24 compatibility
<FromGitter> <Grabli66> I think it's need wait a month, better two. Then switch to 0.25 😄
alex`` has quit [Quit: WeeChat 2.1]
<FromGitter> <faustinoaq> @bcardiff I'm afraid we're using too much macros to have "clean" code and rendering templates like ECR, so I guess we need to write a bit more verbose code (avoid macros) and migrate to some alternatives like liquid.cr (https://github.com/TechMagister/liquid.cr) or make a interpreted version of ECR itself (https://github.com/crystal-lang/crystal/issues/4194) 😉
<FromGitter> <faustinoaq> So, We can pass a context like liquid already does 😅
<FromGitter> <faustinoaq> @bcardiff Well maybe macros aren't always slow 😅
<FromGitter> <faustinoaq> My amber projects still compile very fast 😄
<FromGitter> <Daggerron> @bcardiff it's working thx !
<FromGitter> <stronny> hello, I have a regression after 0.25 update
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b23b00a1ee2d149ecc4a071]
<FromGitter> <stronny> ```code paste, see link```
<FromGitter> <j8r> I've had a similar one, you'll need `JSON::Any.new(String.new)` or any type
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b23b06a1c7d4214379afc66]
<FromGitter> <stronny> but why doesn't it recognize that `this_level` is always a `Hash(String, JSON::Any::Type)`, not a union type?
<FromGitter> <j8r> e.g. `myjson["test"] = somevar` => `myjson["test"] = JSON::Any.new(somevar)`
<FromGitter> <stronny> My question is not really how to fix the problem, rather I don't understand what's happening =)
<FromGitter> <j8r> and this is `JSON::Any.new(Hash(String, JSON::Any).new)`
<FromGitter> <j8r> they have change the underlying implementation
<FromGitter> <stronny> I realize that, however the doc says: ```
<FromGitter> <stronny> I realize that, however the doc says: ``` ⏎ alias JSON::Any::Type ⏎ Alias Definition ⏎ Array(JSON::Any) | Bool | Float64 | Hash(String, JSON::Any) | Int64 | String | Nil ⏎ ... [https://gitter.im/crystal-lang/crystal?at=5b23b1b71c7d4214379afe8a]
<FromGitter> <stronny> (please forgive me for failing miserably with gitter's interface)
faustinoaq has quit [Quit: IRC client terminated!]
faustinoaq has joined #crystal-lang
<FromGitter> <j8r> that's correct
<FromGitter> <j8r> But you are doing a `#[]=` - this is for `Hash`.`as_h` is needed
<FromGitter> <stronny> ummm... `Hash.as_h`?
<FromGitter> <stronny> My reasoning is this: `this_level` has nothing to do with `JSON`, it's declared as a `Hash`
<FromGitter> <stronny> Why does crystal complain about a union type?
<FromGitter> <j8r> `as_h` to cast it to a `Hash` and use its methods
<FromGitter> <stronny> Cast what to a `Hash`? It's arleady a `Hash` ⏎ as for `next_level_key` it's a String: ⏎ ⏎ ``` next_level_key = keys[next_current]``` [https://gitter.im/crystal-lang/crystal?at=5b23b3e2fd5b835b2d5e33dc]
<FromGitter> <j8r> not its not
<FromGitter> <stronny> Please explain. I am declaring it explicitely as `this_level : Hash(String, JSON::Any::Type)`
<FromGitter> <j8r> https://crystal-lang.org/api/master/JSON/Any.html#%5B%5D%28index%3AInt%29%3AJSON%3A%3AAny-instance-method
<FromGitter> <j8r> `keys[next_current]` will returns a `JSON::Any`
<FromGitter> <stronny> Why? The definition is `*keys : String`
<FromGitter> <j8r> I don't see all you code. Can you please paste an example?
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b23b488cf3b245b2c00fefb]
<FromGitter> <stronny> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b23b49f37a2df7bed3f31e7]
<FromGitter> <stronny> it worked just before update with `s/JSON::Any::Type/JSON::Type`
<FromGitter> <j8r> `next_level` is a `JSON::Any` now.
<FromGitter> <j8r> you will likely need a `this_level.as_h[next_level_key]`
<FromGitter> <j8r> i guess
<FromGitter> <stronny> This has nothing to do with error though, crystal complains about the previous line
<FromGitter> <j8r> ho ok
<FromGitter> <j8r> Ha ok understood
<FromGitter> <j8r> you can't add a `Hash` to a `JSON::Any`
<FromGitter> <j8r> You have actually `{} of String => JSON::Any::Type`, or `Hash(String, JSON::Any::Type).new`
<FromGitter> <stronny> nowhere in my code I use `JSON::Any`
<FromGitter> <j8r> maybe that's the problem?
<FromGitter> <stronny> I beg to differ, I think this is a solution =)
<FromGitter> <j8r> Sorry I can't help you mch :|
<FromGitter> <stronny> no problem, thanks anyway!
<FromGitter> <stronny> are there devs in this chat?
<FromGitter> <j8r> Note `Hash(String, JSON::Type) ` as changed to `Hash(String, JSON::Any)`
<FromGitter> <stronny> Oh!
<FromGitter> <j8r> same with array
<FromGitter> <stronny> That's exactly right, thank you very much!
<FromGitter> <stronny> Didn't expect that at all
<FromGitter> <stronny> Was it reported already?
<FromGitter> <j8r> This is normal, the implementation changed
<FromGitter> <j8r> It was reported in the changelogs 😉
<FromGitter> <stronny> not specifically, found this: https://github.com/crystal-lang/crystal/issues/3158
<FromGitter> <fridgerator> so it looks like 0.25.0 is now an official release?
<RX14> yes it is
<FromGitter> <j8r> @stronny look at the 4th: https://github.com/crystal-lang/crystal/releases
<RX14> 0.25.0 has been released
<FromGitter> <fridgerator> 👍
<FromGitter> <j8r> I really hope we will be able to have it on Alpine 3.8 :D
<FromGitter> <stronny> @j8r fifth =) Yes, it doesn't mention `JSON::Type` so I've skipped it
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
<FromGitter> <RX14> @/all Crystal 0.25.0 has been released, see https://crystal-lang.org/2018/06/15/crystal-0.25.0-released.html for all the exciting new things :)
<FromGitter> <fridgerator> how soon will brew be updated?
<RX14> depends on the brew team
<FromGitter> <bcardiff> @fridgerator https://github.com/Homebrew/homebrew-core/pull/28930 ;-)
<FromGitter> <fridgerator> nice, thanks 👍
That_Guy_Anon has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter> <Grabli66> Is there a way to store generic block/proc in array?
xiljin has left #crystal-lang ["..."]
<FromGitter> <Grabli66> Thanks
<FromGitter> <Grabli66> But how to store type of callback? I want use it later for unboxing.
That_Guy_Anon1 has joined #crystal-lang
That_Guy_Anon1 has quit [Client Quit]
That_Guy_Anon has quit [Ping timeout: 264 seconds]
<FromGitter> <stronny> @j8r redid evrything to JSON::Any, works again now. Thank you so much!
<FromGitter> <j8r> no problem @stronny 😄
GoldenBear has quit [Ping timeout: 264 seconds]
GoldenBear has joined #crystal-lang
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter> <bcardiff> @Grabli66 you will need to deal with unions and pass a generic parameter in One. And rewrite de callback to make a cast. Somewhere you will need to fix the types you expect to use. Object is not an option.
<FromGitter> <bcardiff> I might be missing one piece, or two. but it wont be a nice pattern
<FromGitter> <megatux> Anyone knows if latest Lucky framework is Crystal v.0.25 ready?
<FromGitter> <asterite> bcardiff: wow, you are everywhere!! (both in Crystal repos and travelling :-P)
<FromGitter> <megatux> jaja, thx @bcardiff
<FromGitter> <bcardiff> I'm overflowing actually :-P
<FromGitter> <bcardiff> but the power of integers can't be checked and unchecked unless they are turned into primitives, so I took a break :-P
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
FromGitter has quit [Read error: Connection reset by peer]
FromGitter has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <faustinoaq> @fridgerator Crecto needs some fixes because v0.25.0 breaking-changes as well 😅 ⏎ ⏎ ^^ https://github.com/Crecto/crecto/search?q=JSON%3A%3AType&unscoped_q=JSON%3A%3AType
<FromGitter> <fridgerator> yep just started looking at it this morning
<FromGitter> <fridgerator> will probably spend time on it this weekend
<FromGitter> <fridgerator> thanks for the heads up @faustinoaq
<FromGitter> <faustinoaq> 👍
<FromGitter> <fridgerator> looks like crystal-pg needs some work too
<FromGitter> <straight-shoota> Most shards will probably need an update for Crystal 0.25.0 because of all the breaking changes with JSON/YAML, Time and heredoc
<RX14> i hope not many shards were using JSON/YAML::Any
<RX14> heredoc wasnt too bad a breaking change
<RX14> and Time... maybe
<FromGitter> <j8r> I experienced a break to one of my shard related to heredoc
<FromGitter> <straight-shoota> oh, and File::Info of course
<RX14> File::Info wasnt used too much
<RX14> HTTP server is probably one of the most breaking
<FromGitter> <straight-shoota> yeah, that as well
<FromGitter> <straight-shoota> According to Github search, there are a few uses of each of them
<RX14> going through my stuff right now
<FromGitter> <straight-shoota> have fun =)
Philpax has quit [Ping timeout: 268 seconds]
<FromGitter> <j8r> How can I have the file permission as an Int - `#permissions`only returns a string
<FromGitter> <j8r> I use this to manipulate permissions, like adding group read to the existing permission.
<FromGitter> <j8r> It might make sense to incorporate some how `File.chmod` in to `File::Permissions` - WDYT?
<FromGitter> <sam0x17> anyone know when the arch package will get updated to 0.25?
<FromGitter> <straight-shoota> @j8r `File::Info#permissions` returns a `Permissions`
<FromGitter> <j8r> yes but I can't have the ID
<FromGitter> <j8r> I can do a to_i i guess
<FromGitter> <j8r> Yes it works
<FromGitter> <straight-shoota> It's a flags enum, you can just modify it using opertors
<FromGitter> <j8r> Sorry I was wtfing about why it returns me a string by default instead of an int :)
<FromGitter> <straight-shoota> that's just the string representation of `Permissions`
<FromGitter> <bew> To get the raw value of it
<FromGitter> <j8r> I also works :)
wontruefree has joined #crystal-lang
<FromGitter> <j8r> why there is a `@[Flags]` https://github.com/crystal-lang/crystal/blob/7fb783f7afec0a199d6f22ef78aae0f45517068a/src/file/info.cr#L40 ? The number are set, this change nothing?
<FromGitter> <bcardiff> flag enums can be "or-ed"
<FromGitter> <j8r> I'm reading https://crystal-lang.org/docs/syntax_and_semantics/enum.html - this is for the `All` I guess
<FromGitter> <j8r> Really usefull in this case
wontruefree has quit [Quit: bye]
wontruefree has joined #crystal-lang
<FromGitter> <S-YOU> @faustinoaq , I noticed libreactor is faster than h2o, but it is less useful than h2o, imo.
alex`` has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
<wontruefree> I love the idea of an HTTP::Server being able to bind to multiple sockets but why does the one in the STD library use do that
<wontruefree> I mean what is the use case for it?
<wontruefree> Also why break the interface ?
<wontruefree> I love it but I am reading through the PR and I am not sure I get it
<FromGitter> <jwoertink> Can someone explain what the annotations are, and why someone would use them?
<RX14> @jwoertink just a way to attach data to instance variables which macros can use
<FromGitter> <jwoertink> aside from the data type, and the value of a variable, what other data would you want to access?
<RX14> well, look at the JSON::Serializable examples
<RX14> for uses
That_Guy_Anon has quit [Read error: Connection reset by peer]
<RX14> it's all in the blog post
<FromGitter> <jwoertink> ok, so I see this `@[JSON::Serializable::Options(emit_nulls: true)]`, but how would I know which instance variable that refers to?
<FromGitter> <jwoertink> or does this just blanket cover all of them?
<FromGitter> <fridgerator> It seems to me it only refers the next declaration following the annotation
<FromGitter> <jwoertink> ah. So if you wanted a different annotation for each one, then you'd define one for each declared ivar...
<RX14> "If languages like Haskell and Idris can have a repl, very basic languages like Crystal certainly can" lol HN
<FromGitter> <jwoertink> Speaking of repl, I've been working on fixing ICRs issues to make it closer to a real repl, and that shit is no joke.
<FromGitter> <jwoertink> I keep getting caught in this weird catch 22 with the types
<FromGitter> <jwoertink> My "proof-of-concept" for it was taking the return value, shoving it in to a cache like system, then on re-compilation, that return value would be returned in stead of re-calculating that value
<FromGitter> <jwoertink> my initial works was testing `Time.now` which was working great except that the return value was a string, and not a Time instance lol
rohitpaulk has joined #crystal-lang
<FromGitter> <vonKingsley> is it just me or is Time::Format missing from the docs https://crystal-lang.org/api/0.25.0/Time/Format.html
zachk has joined #crystal-lang
zachk has joined #crystal-lang
<FromGitter> <jwaldrip> hmmm. What do I do about this...
<FromGitter> <j8r> I'm building statically crystal in Alpine, and when I use it on GNU/Linux it told me ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b240d8a202c8f71f5052e2c]
That_Guy_Anon has joined #crystal-lang
<FromGitter> <j8r> @jwaldrip the implementation has changed, do a `as_a` or `as_h`
<FromGitter> <j8r> nvm I've finally compiled it directly on Arch,
<FromGitter> <j8r> still strange?
<FromGitter> <paulcsmith> I'm working on updating https://github.com/ysbaddaden/minitest.cr for v0.25 and get `undefined constant JSON::Type`
<FromGitter> <paulcsmith> I don't see it documented that that was removed but it seems to not exist anymore.
<FromGitter> <paulcsmith> The changelog even says that JSON.parse_raw returns a `JSON::Type` so I'm wondering what's up here
<FromGitter> <j8r> This is, with `JSON::Any`
<FromGitter> <paulcsmith> Oops wrong link https://github.com/ysbaddaden/selenium-webdriver-crystal
<FromGitter> <paulcsmith> Ok the changelog should probably also change to mention that
<FromGitter> <paulcsmith> I would do it but pretty busy getting Lucky working on v0.25 :)
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <paulcsmith> That seemed to do the trick. Thanks @j8r
<wontruefree> does anyone know of a web scrapper framework for crystal
duane has quit [Ping timeout: 240 seconds]
<wontruefree> something like mechinize
<wontruefree> like this https://pypi.org/project/mechanize/
<FromGitter> <j8r> @paulcsmith np. They haven't precised that `JSON::Type` isn't anymore
<FromGitter> <paulcsmith> @megatux Working on updating Lucky now :) A few of the dependencies need some updates and a couple guides changes. Hoping to have it ready by the end of the day :)
<FromGitter> <paulcsmith> Also, this is a pretty critical bug in shards: https://github.com/crystal-lang/shards/issues/211 If you don't read carefully about the new global cache you're unlikely to know what's wrong. I spent a couple hours wondering why my updated shards seemed to not work before realizing maybe the global cache was busted
<FromGitter> <paulcsmith> Maybe a hotfix can be released that disables the cache until it is working? Right now I think it'll cause a lot of issues I think
<FromGitter> <paulcsmith> Another suggestion is that releases go out on Monday (or ealier in the week) so if things break it's not over the weekend. Not a big deal, but just an idea
<FromGitter> <fridgerator> ^
<RX14> well we tried to release on monday... didnt work out
<FromGitter> <paulcsmith> That's fine. Maybe it could have been delayed a few more days till this Monday, but then again maybe some people prefer to update their projects over the weekend so it could just be me
<FromGitter> <paulcsmith> Either way that shard thing is a pretty big bug. Any change we could get a hotfix out for that @RX14?
<FromGitter> <paulcsmith> I've had to resort to `rm -rf` the cache before every shard install or update to make sure I'm getting the right dependencies
<FromGitter> <fridgerator> @paulcsmith where is the cache dir?
<FromGitter> <paulcsmith> rm -rf ~/.cache/shards
<FromGitter> <fridgerator> thanks 👍
<FromGitter> <paulcsmith> You're welcome!
<FromGitter> <fridgerator> just curious in case I have to do the same
<FromGitter> <j8r> @paulcsmith I see you doing also Elixir - how does it compare to Crystal?
<FromGitter> <j8r> Its functional style seems powerfull
<FromGitter> <paulcsmith> Yes I did a lot of Elixir and creted a few libs. I prefer Crystal in pretty much everyway
<FromGitter> <paulcsmith> That's kind of a subjective thing of course, but I prefer OO and I can still do functional with Crystal when that is a better way to express things
<FromGitter> <paulcsmith> I also still had plenty of runtime errors with Elixir. They have static analysis but it is very hard to use and interpret and doesn't catch that much
<FromGitter> <j8r> thanks for the feedback :)
<FromGitter> <paulcsmith> So for me the ease of use of Crystal, the nice compiler, and the speed make it much easier to write reliable apps. The macro system in Crystal is a bit less powerful but much more friendly. Elixir is stateless for the most part, but I didn't find that it made a big difference. It may have caught a few bugs here and there but most of the bugs are with `nil` or just using libs wrong in ways that Crystal can
<FromGitter> ... catch
<FromGitter> <paulcsmith> You're welcome :) I still like Elixir and use it at work on some projects. Definitely a great lang
<FromGitter> <j8r> Do you use also Crystal at work?
<FromGitter> <j8r> mostly Elixir I guess
<FromGitter> <paulcsmith> For client projects we use Ruby and Elixir mostly. Some Scala. We have side projects in Crystal and I'm working on some products that I hope to launch soon
<FromGitter> <paulcsmith> Lucky has taken most of my time though
<FromGitter> <asterite> Why is there a shards global cache? The times I used shards, it finishes in like 10~20 seconds, maybe. I have to run shards just once or a few times in the development cycle. Is it that bad not to have a global cache?
<FromGitter> <paulcsmith> I've never thought it was that bad. And the other changes to stop mirroring the whole repo have made it even faster, so globabl cache seems even less necessary
That_Guy_Anon has quit [Quit: Leaving]
<FromGitter> <paulcsmith> Especially since it is causing issues now. Maybe better to remove and revisit later on if projects start getting much bigger?
<FromGitter> <asterite> Also, since the beginning when we were thinking what shards would look like, and what we liked about bundler, is that you could install all your dependencies in a single project, no global stuff. You finish working with a project and delete it, all the deps are gone too. No leftovers in a global place. At least that was waj's idea... so having a global thingy goes against that. But I guess it's fine because we
<FromGitter> ... didn't end up developing shards :-P
duane has joined #crystal-lang
<FromGitter> <paulcsmith> I'd never heard that before, but I like the idea 👍 Especially because projects often have slightly different minor versions they're locked to which makes it less likely that you'll get a cache hit
<FromGitter> <asterite> Right, that too. That said, if there's a global cache and it works well, I guess that's good too :-)
duane has quit [Remote host closed the connection]
duane has joined #crystal-lang
wontruefree has quit [Quit: bye]
<FromGitter> <hugoabonizio> having a global cache is useful when you don't have internet connection, e.g. during travels
<FromGitter> <hugoabonizio> I think bundler works like this too
TCZ has joined #crystal-lang
<FromGitter> <hugoabonizio> even npm has this feature
<RX14> @asterite a cache is no problem as long as it works
<RX14> because the cache can be deleted at any time and existing projects will keep working
wontruefree has joined #crystal-lang
zolbatar has quit [Quit: zolbatar]
TCZ has quit [Quit: Leaving]
duane has quit [Ping timeout: 240 seconds]
wontruefree has quit [Quit: bye]
rohitpaulk has joined #crystal-lang
<FromGitter> <jwaldrip> What is up with the version resolver in shards?
<FromGitter> <jwaldrip> `Error resolving orion (1.4.2)`
<FromGitter> <jwaldrip> I have the project pushed and things tagged correctly...
<FromGitter> <jwaldrip> And my shard.yml looks to be right:
wontruefree has joined #crystal-lang
<FromGitter> <jwaldrip> What am I missing?
<FromGitter> <fridgerator> related to this? https://github.com/crystal-lang/shards/issues/211
<FromGitter> <jwaldrip> There it goes
rohitpaulk has quit [Ping timeout: 256 seconds]
<FromGitter> <paulcsmith> @bcardiff Just in case you didn't see https://github.com/crystal-lang/shards/issues/211 is maybe worth pushing out a hotfix for that removes globabl cache temporarily
<FromGitter> <paulcsmith> @hugoabonizio The way Shards worked before would also work offline. It stores the shards locally. If you start a new project even with the globabl cache you wouldn't be able to do it offline unless every single dependency you need happens to be in the globabl cache
<FromGitter> <paulcsmith> I think if it works it would of course be awesome though. I don't know what that'd involve
<FromGitter> <paulcsmith> I do know caching stuff is hard though :P
<FromGitter> <faustinoaq> Maybe we can add a warning like `Warning: using global shard cache, use "shards clean" to cleanup`, WDYT?
<wontruefree> haha
<FromGitter> <faustinoaq> :)
<FromGitter> <paulcsmith> A nice way to clean the global cache is definitely a good idea, but IMO it doesn't work even 5% of the time it is not worth the performance boost. You'd probably spend much more time wondering why your app isn't working :P
woodruffw has quit [Quit: And then he took off.]
<FromGitter> <faustinoaq> @paulcsmith Ok, no problem, BTW, I was the guy who suggested the global cache, my Internet connection is pretty slow 😅
<FromGitter> <paulcsmith> Haha no worries. I think once it works that would be awesome :)
<FromGitter> <paulcsmith> And sorry if I'm being pushy about it a hot fix. I just think people are gonna have a lot of issues with that and not know what to do in the meantime
<FromGitter> <paulcsmith> Maybe it is affecting just a few people though and I'm one of the unlucky ones :P
<FromGitter> <asterite> I see what you did there ;-)
<FromGitter> <paulcsmith> I'm glad it didn't go unnoticed :)
hightower3 has joined #crystal-lang
<hightower3> So Crystal 0.25.0 drops 'crystal deps' :(
<wontruefree> yeah it did
<wontruefree> I am kind of curious why they did not make it an alias of the other
<FromGitter> <faustinoaq> Encourage `shards` command usage? 😅
<hightower3> Instead of Time.new( ...spec... , kind: Time::Kind::Utc) I should now use Time.utc( ...spec... ) ?
<hightower3> Seems so, yes
<FromGitter> <asterite> Because when there's an error running `crystal deps` it says "maybe run 'shards something something'", so in the end what's the point of having an alias where you will end up invoking `shards` manually? It creates more confusion than a solution. Like Ruby adding `ruby deps` instead of just doing `gems`
<FromGitter> <faustinoaq> @asterite 👍
<wontruefree> that seems reasonable
<wontruefree> and you did not want to pull in a dependency management tool into the compiler ?
<FromGitter> <asterite> that was the original idea, but nobody had time to work on it, or knew how to implement it well
hightower2 has quit [Ping timeout: 260 seconds]
hightower2 has joined #crystal-lang
<FromGitter> <jwaldrip> Remind me again how I force a blocks return type?
<FromGitter> <bararchy> yield
wontruefree has quit [Quit: bye]
<FromGitter> <asterite> `def foo(&block : -> ReturnType)`
algun|home has joined #crystal-lang
<FromGitter> <faustinoaq> Hey, Does someone knows what technologies this ^^ page use?
<FromGitter> <faustinoaq> Works pretty fast, and looks like a PWA
<FromGitter> <faustinoaq> ^^ http://en.kremlin.ru/
<FromGitter> <Blacksmoke16> looks like wordpress
<FromGitter> <Blacksmoke16> are at least some things in the dom that are like `WPHeader`
<FromGitter> <faustinoaq> @Blacksmoke16 Oh, SPA on workpress?
<FromGitter> <Blacksmoke16> :shrug: maybe?
<FromGitter> <silasb> I'm working on a C binding for libssh2. One thing that I'm dealing with is a callback for keyboard interactivity. The callback has a signature of `->(name : UInt8*, name_len : UInt32, instruction : UInt8*, instruction_len : UInt32, num_prompts : UInt32, prompts : UInt8*, responses : UInt8*, data : Void**)` `responses ` is an array that maps to a structures. Not sure how to approach this. I've tried defining
<FromGitter> ... my own structure that is uninitialized but not sure how initialize that structure on that pointer. Not 100% sure if that makes sense or not.
<FromGitter> <faustinoaq> @Blacksmoke16 Oh, also seems there is a new wordpress written in Node.js 😅 https://github.com/Automattic/wp-calypso
<FromGitter> <Blacksmoke16> well there you go :P
alex`` has quit [Quit: WeeChat 2.1]
algun|home has quit [Quit: leaving]
Groogy has quit [Ping timeout: 264 seconds]
sauer2 has joined #crystal-lang