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
ozra_ has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
Nik736 has quit [Quit: Textual IRC Client: www.textualapp.com]
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
fedruantine has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
Oliphaunte has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
no0p has quit [Quit: Leaving]
ozra_ has quit [Ping timeout: 246 seconds]
Oliphaunte has quit [Remote host closed the connection]
fedruantine has quit [Max SendQ exceeded]
paulcsmith_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
alanwillms93 has quit [Quit: This computer has gone to sleep]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snsei_ has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
soveran has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
paulcsmith_ has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
snsei has quit [Ping timeout: 272 seconds]
snsei has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
A124 has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
soveran has joined #crystal-lang
<crystal-gh> [crystal] fernandes opened pull request #2809: Array#uniq considers each element eql? method to check if exists (master...fix/array_uniq_two_classes) https://git.io/vonBA
soveran has quit [Ping timeout: 246 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
pawnbox has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
Philpax has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
soveran has joined #crystal-lang
A124 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
ryanw-se has quit [Quit: Leaving...]
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 252 seconds]
Philpax has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #2809: Array#uniq considers each element eql? method to check if exists (master...fix/array_uniq_two_classes) https://git.io/vonBA
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
yawniek has joined #crystal-lang
foca has joined #crystal-lang
<foca> have a question about cross compiling. When I run the cc command you get from crystal build, it complains about not finding -lrt, but I have no idea how to get librt. (I'm on OS X 10.11, trying to compile for linux x86_64)
<foca> I don't think it's the library path (running it with -v I get to that being .:/usr/local/lib:/usr/lib, and /Library/Frameworks:/System/Library/Frameworks)
hangyas has joined #crystal-lang
<foca> I found a `/usr/lib/system/libcompiler_rt.dylib`. Trying to link against that instead of rt gives me "ld: cannot link directly with /usr/lib/system/libcompiler_rt.dylib. Link against the umbrella framework 'System.framework' instead. for architecture x86_64"
<foca> but then I have no idea how I would go around doing that.
<foca> or if that is even the same librt
<foca> or why I don't have the "normal" (?) librt
<foca> (also did `xcode-select --switch /Library/Developer/CommandLineTools` which I found in a GitHub issue, but to no avail, I'm still missing librt)
<jhass> foca: you're supposed to link on the target host
<foca> ahhhhh, that makes sense
<foca> I was spoiled by golang to expect a magic cross compilation experience, but this makes more sense :)
hangyas has quit [Quit: hangyas]
<foca> thanks jhass
<jhass> yeah not sure how Go does that, I guess they link against no other libraries at all and implemented everything in Go? Not even libc?
<foca> I think they do, though I can't find anything about it
<foca> well, "In the procedure described above, cross compilation always rebuilds that standard library for the target every time."
<jhass> so we could do that too, given we have inline assembler we could built our own syscalls library and everything else on top
<jhass> but kinda would need 10-20x the manpower ;)
<foca> pffff, only that? :p
<jhass> minimum :P
<foca> I mean, if golang can do it… it's not like they have a huge corp behind it, right?
<jhass> you mean like google? no, not at all!
matp has quit [Quit: Textual IRC Client: www.textualapp.com]
donpdonp has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
Ven_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
snsei has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<BlaXpirit> lol Go is like the #1 language to be called out for having a corp behind it
<BlaXpirit> >> {0=>:a, 0.0=>:b, 1=>:c, 1.0=>:d}
<DeBot> BlaXpirit: # => {0 => :b, 1 => :c, 1.0 => :d} - https://carc.in/#/r/11dz
<BlaXpirit> yeaah... jhass, asterite
<BlaXpirit> that won't fly
<jhass> Float#hash and Int#hash ain't consistent yet
<BlaXpirit> yeah, I know, and I thought it was OK until I realized this edge case and possible hash collisions
<BlaXpirit> Ruby gives the exact same result, terrible
snsei has quit [Ping timeout: 240 seconds]
<BlaXpirit> i really should take up this task
<BlaXpirit> i always convince myself i don't have time
<jhass> mh, ruby keeps the 0.0 for me
<BlaXpirit> did i make a mistake
<BlaXpirit> yes, I did, sorry
Oliphaunte has joined #crystal-lang
<BlaXpirit> 0.eql? 0.0 - false
<crystal-gh> [crystal] jhass opened pull request #2811: Improve error messages for invalid values of Char (master...char_error) https://git.io/vonMR
<BlaXpirit> you added "Invalid char value #{dump}" - what's the dump?
<BlaXpirit> nevermind, just a method of char
<BlaXpirit> is it reasonable to establish a requirement that in standard library outwards-facing exceptions must never be just strings?
<jhass> yes
<jhass> someone should grep for all plain raise'es and get rid of them
<jhass> I'm still biased whether I'd like to see some better hierarchy, for example have raise and open rescue default to RuntimeError or such and not raise/rescue the root Exception class
<BlaXpirit> hm I can't agree with bare `rescue` not being catch-all
<jhass> both Python and Ruby does that
<jhass> all standard errors like ArgumentError and what not would subclass RuntimeError
<jhass> user exceptions usually too
<jhass> not subclassing RuntimeError would be for the more fatal stuff, like a potential SystemExit or so
<jhass> KeyboardInterrupt ;)
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<Davy_CC> the doc at Tuple and NamedTuple has a link `type` points to the wrong place
<jhass> Davy_CC: mh?
<BlaXpirit> the problem with replacing strings with exception types is that you have to keep coming up with those types all the time, and it's not something to be taken lightly
<jhass> BlaXpirit: dunno, I expect 80% to be ArgumentError :P
<Davy_CC> jhass: In type restrictions, generic type arguments and other places where a type is expected, you can use a shorter syntax, as explained in the type:
<Davy_CC> and the `type` has a link
<BlaXpirit> Davy_CC, yeah, nice find, you can make a pull request. probably need to add ../
<BlaXpirit> Davy_CC, jhass even pointed you to one of the files to be changed
<Davy_CC> ok, I will make a pull request for that, just modify the md file under _gitbook/, right?
<jhass> yup
<crystal-gh> [crystal] jhass pushed 2 new commits to master: https://git.io/vonyf
<crystal-gh> crystal/master e693ec4 Jonne Haß: Improve error messages for invalid values of Char
<crystal-gh> crystal/master 2d57f73 Jonne Haß: Merge pull request #2811 from jhass/char_error...
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vonyO
<crystal-gh> crystal/master 52fa0ce Ary Borenszweig: Allow string literals as external argument names (mostly for completeness and consistency, to match what named arguments allow)
<crystal-gh> crystal/master 6743131 Ary Borenszweig: Parser: simpler code for parsing named arguments with string literals, and better errors
<crystal-gh> crystal/master ebe4738 Ary Borenszweig: Allow sizeof in generic type arguments. Fixes #1718
Ven_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
matp has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] jhass closed pull request #2813: Update the links under Literals section (gh-pages...fix/docs/links_under_literals) https://git.io/vony3
<travis-ci> crystal-lang/crystal#2d57f73 (master - Merge pull request #2811 from jhass/char_error): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137072879
soveran has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<travis-ci> crystal-lang/crystal#ebe4738 (master - Allow sizeof in generic type arguments. Fixes #1718): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137073422
Philpax has quit [Ping timeout: 252 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
emancu has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<crystal-gh> [crystal] jhass opened pull request #2814: Improve error messages for InvalidByteSequenceError (master...better_utf8_errors) https://git.io/von90
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<crystal-gh> [crystal] Nax opened pull request #2815: Added Digest::SHA256 (master...sha256) https://git.io/vonH0
<crystal-gh> [crystal] asterite opened pull request #2816: Make `Int#chr` raise on out of range, and added `Int#unsafe_chr` (master...feature/unsafe_chr) https://git.io/vonHz
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vonQs
<crystal-gh> crystal/master 17f7165 Jonne Haß: Improve error messages for InvalidByteSequenceError
<crystal-gh> crystal/master 5626e12 Ary Borenszweig: Merge pull request #2814 from jhass/better_utf8_errors...
fedruantine has joined #crystal-lang
<travis-ci> crystal-lang/crystal#5626e12 (master - Merge pull request #2814 from jhass/better_utf8_errors): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137087723
<BlaXpirit> is it correct that almost all hashes work like 31*accum + new but this one just adds things up?? https://github.com/crystal-lang/crystal/blob/master/src/hash.cr#L764
<tilpner> BlaXpirit - I imagine that is because the iteration order of each is not consistent.
<BlaXpirit> tilpner, well actually it is consistent, but yeah that's almost correct, they just don't want order to matter
<tilpner> BlaXpirit - I.e. you can't have the order matter, because a "hash" should have the same hashcode, no matter the insertion order, or iteration order.
<BlaXpirit> thanks
<tilpner> BlaXpirit - Yes, "consistent" was not a good choice. "Defined" may be better, so even if there is an implementation-defined iteration order, that order is not guaranteed and you mostly likely don't want to rely on it.
<tilpner> *most
<BlaXpirit> tilpner, no, iteration order is defined to be insertion order, in ruby and here
<tilpner> Oh, nice. Never really used Ruby, and only played around with Crystal so far.
<tilpner> Of course, you still don't want insertion order to change the hash. ^^
<BlaXpirit> in Python it's not defined, and even randomized each launch
<BlaXpirit> (at least if strings are involved)
<BlaXpirit> (because strings' hashes are randomized)
<tilpner> Why and how are they randomized?
Oliphaunte has joined #crystal-lang
<BlaXpirit> tilpner, http://stackoverflow.com/a/27522708 - random seed each interpreter launch, but hashes are of course consistent within one run
<BlaXpirit> oh look, ruby also randomizes strings' hashes. yeah, many languages got concerned by this vulerability
<tilpner> Ah, interesting to solve it at startup.
<tilpner> Rust randomizes the seed for each *usage*, so a new HashMap gets its own seed, not per process.
<BlaXpirit> weird
* tilpner fails to quantify the weirdness of either approach.
<BlaXpirit> just extra work needed on rust side, with little advantage. but i guess global state is not something they wanted
Oliphaunte has quit [Ping timeout: 246 seconds]
<tilpner> I'm not sure. It can decrease abstraction leakage, depending on how you look at it. In Ruby, if you expose the hash of one string, the attacker could figure out the seed during the process' lifetime and use it on any hashmap in the application.
<tilpner> In Rust, because the seed (random state) is local to each HashMap, exposing hashes of an individual string (which is harder, because you don't have access to it), does not endanger other maps.
<BlaXpirit> so, "little advantage", not "no advantage"
<tilpner> I would have to measure the cost, but I assume a thread-local PRNG does not have prohibitively high cost, so I don't think it's a bad choice.
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/von5B
<crystal-gh> crystal/master b64fefd Ary Borenszweig: Merge pull request #2816 from crystal-lang/feature/unsafe_chr...
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/von5V
<crystal-gh> crystal/master 37f15db Ary Borenszweig: Always inline Char::Reader#decode_current_char (improves performance)
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
Raimondi has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
<travis-ci> crystal-lang/crystal#b64fefd (master - Merge pull request #2816 from crystal-lang/feature/unsafe_chr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137094546
bcardiff has joined #crystal-lang
<travis-ci> crystal-lang/crystal#37f15db (master - Always inline Char::Reader#decode_current_char (improves performance)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137094999
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
soveran has quit []
snsei has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
bcardiff has quit [Quit: bcardiff]
Oliphaunte has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
Raimondii has joined #crystal-lang
ozra_ has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
P_raimondii has joined #crystal-lang
Raimondii has quit [Ping timeout: 240 seconds]
P_raimondii is now known as Raimondi
Raimondi is now known as Raimondii
matp has quit [Ping timeout: 250 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
soveran has joined #crystal-lang
Raimondii is now known as Raimondi
Oliphaunte has quit [Remote host closed the connection]
emancu_ has joined #crystal-lang
matp has joined #crystal-lang
emancu has quit [Ping timeout: 264 seconds]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 3 new commits to master: https://git.io/vonA7
<crystal-gh> crystal/master 29e1973 Jonne Haß: --cross-compile no longer takes any flags, use --target and -D...
<crystal-gh> crystal/master 441d165 Jonne Haß: Improve error message on invalid target
<crystal-gh> crystal/master b353cc7 Jonne Haß: Merge pull request #2807 from jhass/remove_cross_compile_flags...
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
Raimondi has joined #crystal-lang
<travis-ci> crystal-lang/crystal#b353cc7 (master - Merge pull request #2807 from jhass/remove_cross_compile_flags): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/137110576
Renich has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
<crystal-gh> [crystal] jhass opened pull request #2820: Update cross compile docs, flags docs and use flag? instead of ifdef in the examples (gh-pages...cross_compile_flags_ifdef) https://git.io/vonpX
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<crystal-gh> [crystal] kostya opened pull request #2821: add enumerable#chunk (master...chunk) https://git.io/vonhZ
Renich has quit [Quit: leaving]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
A124 has quit [Quit: '']
soveran has quit [Remote host closed the connection]
A124 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
steenuil has quit [Quit: Textual IRC Client: www.textualapp.com]
Oliphaun_ has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
Raimondi has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang