jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.17.4 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
onec has joined #crystal-lang
onec has quit [Remote host closed the connection]
<shadowshell> any other suggestions on getting this shard ported to 0.17.x? https://github.com/jeromegn/docker.cr/compare/master...bramswenson:update_crystal_and_shards
<shadowshell> all specs pass again on 0.17.3
<shadowshell> i'll be looking into what is going on with those monkey patches and try to submit them to core
<shadowshell> looks like OpenSSL binding needs some work eh?
<shadowshell> :)
<shadowshell> big lib
triangles has joined #crystal-lang
<shadowshell> jeromegn: any thoughts? just noticed you are in here. i assume you are one and the same as the owner of that repo
<jeromegn> Ah yes that's me
<shadowshell> cool, i'll submit a pr
<shadowshell> just new to cr
<jeromegn> Sounds good!
<shadowshell> wanted to make sure it wasn't missing something obvious (to someone except me)
triangles3 has quit [Ping timeout: 252 seconds]
<shadowshell> pr submitted
<shadowshell> example works too
<jeromegn> looks simple enough :)
<shadowshell> yeah, it was fun
<shadowshell> i'll look at adding some more features to that thing soon
<jeromegn> the shard doesn't do much yet
<shadowshell> using a lot of docker in my projects
<jeromegn> merged, thanks!
<shadowshell> cool, no problem
<shadowshell> woot, first crystal related PR
<shadowshell> next...
Philpax has joined #crystal-lang
ozra_ has quit [Ping timeout: 250 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
onec has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
onec has quit [Remote host closed the connection]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
onec has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
onec has quit [Ping timeout: 258 seconds]
paulcsmith_ has joined #crystal-lang
sp4rrow has joined #crystal-lang
onec has joined #crystal-lang
onec has quit [Client Quit]
mgarciaisaia has quit [Read error: No route to host]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Remote host closed the connection]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] keplersj opened pull request #2776: Add Bytes alias (master...feature/bytes-alias) https://git.io/vot89
<crystal-gh> [crystal] keplersj closed pull request #2740: Introduce Byte, Bytes, and Chars aliases (master...feature/slice-alias) https://git.io/vovoq
tubbo has quit [Ping timeout: 244 seconds]
ryanw-se has quit [Quit: Leaving...]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
tubbo has joined #crystal-lang
<crystal-gh> [crystal] keplersj opened pull request #2777: [WIP] JSON Output for Documentation Data (master...feature/json-docs) https://git.io/votE7
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has quit [Remote host closed the connection]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
crack08 has joined #crystal-lang
pawnbox_ has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
matp has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
bjz has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #2776: Add Bytes alias (master...feature/bytes-alias) https://git.io/vot89
matp has joined #crystal-lang
mark_66 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#7c7b8b6 (master - Add Bytes alias (#2776)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/136075231
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
rolha has joined #crystal-lang
bjz has quit [Ping timeout: 276 seconds]
bjz_ has joined #crystal-lang
TheLemonMan has joined #crystal-lang
ton31337 has joined #crystal-lang
<ton31337> hey, does crystal already have threading?
<jhass> ton31337: nothing really usable, no. It does have usable concurrency though
trapped has joined #crystal-lang
<jhass> yes
<ton31337> thanks, let's read it
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 244 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voqep
<crystal-gh> crystal/master 1ac06a5 Ary Borenszweig: Move Enumerable::EmptyError to enumerable.cr
<travis-ci> crystal-lang/crystal#1ac06a5 (master - Move Enumerable::EmptyError to enumerable.cr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/136113551
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
icezimm has joined #crystal-lang
icezimm has quit [Quit: Leaving.]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Tuxified has joined #crystal-lang
onec has joined #crystal-lang
triangles has quit [Ping timeout: 252 seconds]
ponga has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
g3funk is now known as braidn
paulcsmith_ has joined #crystal-lang
<crystal-gh> [crystal] asterite opened pull request #2778: Implement auto-tuple unpacking in block arguments (master...feature/block_auto_unpack) https://git.io/voqRJ
<asterite> jhass: ^ I'd like to know your opinion :-)
<jhass> yeah, reading and thinking still
<jhass> saw where my thoughts went yesterday?
<asterite> Yes, but read the whole PR's text to understand why that isn't very good
<jhass> asterite: not sure I found the argument against :)
<jhass> anyway, this is a very double edged sword
<asterite> jhass: imagine you want to add a new method to Enumerable
<jhass> and I'm not yet sure that the wrong edge isn't the sharper one
<asterite> you have to use that trick, checking T, etc.
<asterite> with auto unpacking you just write the code and it works, for tuples and non-tuples
<jhass> especially the second case is entirely non-obvious I think
<asterite> I mean, there's nothing really dangerous with this
<asterite> Really? I'll reply to kostya now
<jhass> many Rubyists don't like autounpacking too much already, as it is just too unobvious
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<jhass> I have to think more about it, if we can keep the noise low for handling T, some kind of direction as I was going, I don't have the feeling its bad having to do it
pawnbox has joined #crystal-lang
onec has quit []
mgarciaisaia has joined #crystal-lang
<asterite> The solutions I see are: 1. do autounpacking or 2. leave Enumerable like that and not make Hash be an Enumerable
mgarciaisaia has left #crystal-lang [#crystal-lang]
<asterite> I definitely wouldn't like to modify Enumerable to consider two cases for T, everywhere, and also forcing that on users wanting to extend Enumerable
<jhass> mh
<jhass> what if (we add syntax to) Foo(*T) with a single argument doesn't make T a tuple?
<jhass> and *T with T not being a tuple would simply be T
ponga has quit []
<asterite> But when if you do {% for type in T %} that will only work if T is a tuple, right?
<jhass> well yes
<jhass> I'm just brainstorming...
<asterite> Of course, we all are :-)
paulcsmith_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<asterite> I though a lot about the problem, and now I understand why auto-unpacking exists in Ruby... maybe it's for this case. I can imagine Matz and others thinking about this same problem too
<jhass> yeah
<jhass> I think the second rule bothers me the most, I see how it's useful from the consumer API perspective
<jhass> but it's an insane special case from the yielders perspective
<asterite> why?
<asterite> why only apply the rule for just one argumen?
<asterite> I don't think the yielder has to worry about this
<asterite> unpacking is chosen in the block side
<asterite> In fact, with this, Enumerable just yields the object and index, in each_with_index. Then when writing the block I can choose to unpack it, either explicitly or implicitly
<jhass> say I want to verify how many arguments something yields, because I suspect a bug, like some coding taking too many block parameters and I suspect a nil coming from there
<asterite> or just yields the object in `select`, without having to know if it's a tuple or not... and it doesn't need to do `yield *args` nor `do |*elem|`
<jhass> I look at the implementation and see yield a, b
<jhass> I might think it's two arguments
<jhass> but I actually can no longer easily tell in which block argument b will end up in
<asterite> yes, you can: in the last one
<asterite> if there's more than one block argument, that is
<asterite> if there's one, it's a
<asterite> if there's two, it's a an b
<asterite> if there's more than two...
<jhass> if there's three I have to know whether a is a tuple or not
<asterite> if there's three, a is a tuple
<jhass> if there's four and a is a two element tuple, I have to synthesize an invisible arg as nil
<asterite> otherwise the caller wouldn't have used three arguments
<asterite> I mean, I can see auto tuple unpacking being used explicitly
<jhass> no that's not true, my initial scenario was that the caller might have made a mistake I'm trying to debug
<asterite> it's kind of strange, but if I provide more block arguments than the number of yielded objects, it's because I expect a tuple to be yielded, and I usually know how many elements in the tuple to expect
<asterite> doesn't that also happens with just `yield a`, where a is an array, and auto-unpacking happens in Ruby?
<jhass> yes, one of the reasons a bunch of rubyists wish it wasn't a thing
<asterite> :-)
<asterite> do you use this feature in Ruby?
<jhass> on the block side, I can't remember doing it on the yield side
<jhass> that is writing yield a instead of a, b = a; yield a, b
<asterite> mmm... what's "on the yield side"?
<jhass> I mean I don't yield an array with the intention of the consumer relying on autosplat to consume it
<jhass> if I yield an array its for the consumer to work with it as an array
<jhass> else I unpack the array already before yielding it
<jhass> btw I don't mind at all the occasional each_with_index do |(k, v), i| in ruby
<jhass> I think I wouldn't even mind a hash.map {|(k, v)| } in crystal
<asterite> what about hash.each { |(k, v)| .. .}
<jhass> would be consequent
<asterite> we could do that... i think it would be a bit annoying, maybe
<asterite> but it would be the simplest thing to do. Then it would just be an Enumerable({K, V}) and it will work, but you'll always have to explicitly unpack key and value
<jhass> yes
<jhass> mmh, I don't know
<asterite> I actually never had issues with auto-unpacking (what's the official term for this?) in Ruby
<pabs> asterite: splatting
<asterite> and I used it a bunch of times, mostly when iterating arrays of arrays of known size
<jhass> what I know is that autosplat is one of the more confusing regular topics in #ruby for newcomers
<jhass> I see autosplat most commonly used
<pabs> ^
<jhass> so making its behavior even more complicated to explain in crystal frightens me a bit
<asterite> I see it like this: if we change hash to do yield({key, value}), then one has to use do |(key, value)|. It's explicit, there's no magic, and we can include Enumerable
<asterite> then if I know autosplatting, I can use it too. The problem is someone looking at that code and doesn't know I wanted autosplatting
<asterite> it's explicit for the one that writes the code, but implicit for the one that reads it
<jhass> another brainstorm: what if autosplatting happens only if requested by the yielder? That means yield *a with a being a tuple would get the tuple for do |a| and the elements for do |a, b| (and the element for do |a| with a single element tuple)
<jhass> then make Array.each do yield *e
<jhass> yield *a with a not being a tuple would just yield the value normally
<jhass> yield a would never autosplat, do |a, b| would make b always nil
<asterite> Maybe. The problem is that someone wanting to include Enumerable in their type would have to do `yield *a` too
<jhass> if they want to keep their each consistent with Enumerable, yeah
<asterite> with explicit splat or autosplat they don't have to worry about that, it just works
<jhass> my bigger issue is that Array({A}).each would yield A's instead of {A}'s
<asterite> the explicit splat route isn't bad either
Raimondii has joined #crystal-lang
<jhass> we probably should poll the community about it, I can't decide
paulcsmith_ has joined #crystal-lang
<jhass> btw autounpack is probably the better name
Raimondi has quit [Ping timeout: 240 seconds]
<asterite> yes, it's a hard decision
<asterite> I'm tempted to do the autounpacking... it looks nicer to the eye and there's less typing... but I understand the reasons not to do it
<asterite> I was against it before, but mostly because it seems too hard to implement :-P
soveran has quit [Remote host closed the connection]
Raimondii has quit [Ping timeout: 240 seconds]
<asterite> Some guys at Manas also like the explicit unpacking approach
<asterite> jhass: do you have some links about confusing around autounpacking? It's hard to search on Google
<jhass> no, as said most of my experience about it comes from talk in #ruby
Raimondii has joined #crystal-lang
P_raimondii has joined #crystal-lang
P_raimondii is now known as Raimondi
Raimondii has quit [Ping timeout: 240 seconds]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
<Davy_CC> +1 vote for not auto-splatting, I think programmers can decide when to splat it and we can check if the argument is Enumerable or not in compile-time
<Davy_CC> and programmers can choice `yield *a` or `do |*a|` for splatting is good
<jhass> Davy_CC: please vote the corresponding entries on https://github.com/crystal-lang/crystal/pull/2778
<Davy_CC> got it
Tuxified has quit [Ping timeout: 272 seconds]
Philpax has quit [Ping timeout: 252 seconds]
triangles has joined #crystal-lang
<asterite> maybe we should ask Matz what he thinks about auto-unpack... does he like it or regret it
<asterite> I'll try to ask on twitter
<jhass> :)
Raimondi has quit [Ping timeout: 240 seconds]
crack08 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] jhass opened pull request #2779: Return zero exit status for explicitly requested help displays (master...zero_exit_help) https://git.io/voq7P
<jhass> asterite: so... maybe?
<jhass> :P
soveran has joined #crystal-lang
<asterite> hahaha, I don't know either
soveran has quit [Changing host]
soveran has joined #crystal-lang
<asterite> but blocks in ruby are big beasts... in crystal they are (still) more innocent
soveran has quit [Ping timeout: 258 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
rolha has quit [Ping timeout: 264 seconds]
<crystal-gh> [crystal] paulcsmith opened pull request #2780: Include `HTTP::` in docs for server handlers (master...patch-1) https://git.io/voqpm
<crystal-gh> [crystal] jhass pushed 2 new commits to master: https://git.io/voqpW
<crystal-gh> crystal/master 936837f Paul Smith: Include `HTTP::` in docs for server handlers...
<crystal-gh> crystal/master a390424 Jonne Haß: Merge pull request #2780 from paulcsmith/patch-1...
mark_66 has quit [Remote host closed the connection]
Raimondi has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
Ven has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#a390424 (master - Merge pull request #2780 from paulcsmith/patch-1): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/136204648
<crystal-gh> [crystal] asterite opened pull request #2781: Make Hash (and others) yield tuples in each (master...feature/hash_tuple) https://git.io/vomIQ
Nik736 has joined #crystal-lang
Raimondi has joined #crystal-lang
A124 has quit [Ping timeout: 250 seconds]
<rkeene> I haven't checked in in a while -- has there been any work on making Crystal a better cross-compiler ?
A124 has joined #crystal-lang
soveran has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
soveran has quit [Remote host closed the connection]
<rkeene> Last time I looked it only accepted two pieces of information about the target -- the OS name and the CPU architecture... which is not enough information
<jhass> not sure, I don't think so. What else do you need?
soveran has joined #crystal-lang
ton31337 has left #crystal-lang [#crystal-lang]
<rkeene> The complete platform identifier, usually something like linux-unknown-x86_64-gnu or linux-unknown-arm-musl
<rkeene> Oops, I have that backwards
jmg_ has joined #crystal-lang
<rkeene> arm-android9-linux-androideabi, arm-slackware-linux-gnueabi, hppa64-hp-hpux11.11, i386-pc-solaris2.10, sparc-sun-solaris2.10, sparc-sun-solaris2.8, x86_64-slackware-linux, x86_64-unknown-freebsd8, x86_64-unknown-netbsd5, x86_64-unknown-linux-musl, powerpc-ibm-aix5.3.0.0
<rkeene> And some of those are multilib, so they support for example 32-bit and 64-bit code, so you have to specify additionally which one. Also popular is thumb/non-thumb.
<rkeene> A lot of platforms encode the ABI information into the OS name by including the OS version, e.g. hpux11.11 and hpux12.00 have different ABIs
<jmg_> Was just looking over the PR that introduces the `as` method... Made me curious if there has been any talk regarding syntax sugar to unwrap optionals
<jhass> rkeene: isn't that what --cross-compile took all along?
<rkeene> jhass, No, it just takes an OS name and CPU arch.
<jhass> ah there's --target which takes an LLVM target triple
<jhass> jmg_: for example?
<jmg_> While it wouldn't work with current grammar, just curious if there's been talk about shorthand to go from String? -> String. Similar to Swift's `!`
<jhass> ah yeah I remember some, the consensus was that the verbosity of .not_nil! is good since it's potentially unsafe (that is can cause runtime errors)
<jhass> the safe way already is just if foo
<jhass> or .try &.cool
<jhass> and .not_nil! is also a bit abstracted away already in getter! / property!
<jhass> so I don't think we have an actual strong need here and the verbosity encourages you to avoid nilable vars in the first place :)
<rkeene> jhass, Right, I think this hasn't changed -- you need to specify --cross-compile "Linux x86_64", which is redundant to --target and Crystal actually uses Linux and x86_64 in places where it should use the target
<jhass> rkeene: contributions welcome, cross compilation is nothing any regular contributor is doing on a daily basis ;)
<rkeene> Atleast this is how it used to be.. it made things confusing when cross-compiling from "Linux x86_64" to "Linux x86_64"
<rkeene> jhass, My Linux distribution is always cross-compiled -- I can't run the executables it compiles even though they are for Linux/x86_64 and my laptop is Linux/x86_64
<rkeene> If I compile my Linux distribution on Windows (./configure && make there too) it produces the same output (the installer ISO image is the first target in my Makefile) with the same constraints -- I can't run the code it compiles
<jmg_> jhass: Awesome, I just wanted to read the discussion about it. `not_nil!` led me to https://github.com/crystal-lang/crystal/issues/406... It's just practically impossible to search for `?` and `!` via Github Issues
<jhass> :)
sp4rrow has joined #crystal-lang
<sp4rrow> I will fix it but where is the repo that generates this
<sp4rrow> sorry I think my client lagged
<sp4rrow> I think this doc is out of date
<jhass> sp4rrow: how so?
<sp4rrow> oh sorry
<sp4rrow> it still says build
<sp4rrow> was it changed to compile?
<sp4rrow> sweet never mind then
<sp4rrow> thanks
<jhass> <3
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sp4rrow> cool that is interesting
<sp4rrow> I have never dived down into that piece of tooling
Raimondi has quit [Read error: No route to host]
Raimondi has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<jmg_> jhass: Regarding the `not_nil!` method, in the following case is there a way to inform the compiler that `#types` is never going to be `Array(String)?` because of the previous `reject` method?
<jhass> jmg_: no, but simply do https://play.crystal-lang.org/#/r/112f
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<jmg_> jhass: Hah, didn't think of that... Thanks :D
Ven has joined #crystal-lang
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
jmg_ has quit [Ping timeout: 272 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
jmg_ has joined #crystal-lang
snsei has joined #crystal-lang
jmg_ has quit [Quit: leaving]
sp4rrow has joined #crystal-lang
bcardiff has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 250 seconds]
Raimondii is now known as Raimondi
snsei_ has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
soveran has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
snsei_ has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
sp4rrow has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
snsei has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
sp4rrow has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
vikaton has joined #crystal-lang