<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> 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>
<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>
<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>
<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 ?
<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
<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>
<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
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
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>
<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>
<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
<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>
<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
<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>
<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.