jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.2 | 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
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
Oliphaunte has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
ponga has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
soveran has quit [Ping timeout: 276 seconds]
ome has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
jsownz has joined #crystal-lang
mgarciaisaia has quit [Quit: Leaving.]
DeBot has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 264 seconds]
pawnbox has quit [Ping timeout: 250 seconds]
jsownz has quit [Ping timeout: 276 seconds]
<travis-ci> crystal-lang/crystal#bab00a9 (master - Added `Thread.current`, and store current fiber in Thread): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139342245
snsei has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
crack08 has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Raimondii has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 246 seconds]
BlaXpirit_ has joined #crystal-lang
wmoxam_ has joined #crystal-lang
havenn has joined #crystal-lang
havenn has quit [Changing host]
havenn has joined #crystal-lang
x0f_ has joined #crystal-lang
no0p_ has joined #crystal-lang
arahael1 has joined #crystal-lang
Raimondi has quit [*.net *.split]
no0p has quit [*.net *.split]
Arahael has quit [*.net *.split]
wmoxam has quit [*.net *.split]
havenwood has quit [*.net *.split]
BlaXpirit has quit [*.net *.split]
x0f has quit [*.net *.split]
havenn is now known as havenwood
Raimondii is now known as Raimondi
Philpax has quit [Ping timeout: 276 seconds]
no0p_ has quit [Ping timeout: 276 seconds]
BlaXpirit_ has quit [Quit: Bye]
BlaXpirit has joined #crystal-lang
Ven_ has joined #crystal-lang
snsei has joined #crystal-lang
BlaXpirit is now known as BlaXpirit_
BlaXpirit_ is now known as BlaXpirit
snsei has quit [Ping timeout: 246 seconds]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven_ has joined #crystal-lang
pawnbox_ has joined #crystal-lang
DeBot has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox_ has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 260 seconds]
grindhold_ has quit [Read error: Connection reset by peer]
grindhold has joined #crystal-lang
pawnbox has joined #crystal-lang
cloud-oak has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
cloud-oak has quit [Quit: cloud-oak]
cloud-oak has joined #crystal-lang
cloud-oak has quit [Client Quit]
cloud-oak has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arahael1 has quit [Quit: WeeChat 1.0.1]
Arahael has joined #crystal-lang
trapped has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.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
Oliphaunte has quit [Ping timeout: 244 seconds]
soveran has joined #crystal-lang
<jhass> asterite: mmh is github just confused or did you click release and then put it back to a draft?
A124 has quit [Quit: '']
A124 has joined #crystal-lang
FromGitter has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
sandelius has joined #crystal-lang
<sandelius> hey all
<sandelius> I'm trying out crystal and are wondering how one would specify a class constant as a hash value? "an't use Class in unions yet, use a more specific type"
<jhass> You have to use the specific metaclass of a base class
<jhass> got some example of what you're trying to do?
<sandelius> jhass some thing like @attributes = Hash(Symbol, Hash(Symbol, Array(Hash(Symbol, Class)))).new
<sandelius> it's a nested hash
<jhass> not "some like" please :/
<jhass> what's the specific values you want to store and why
<sandelius> jhass I'm trying to build a hash like this: https://gist.github.com/sandelius/3313bcfd46b7df06ecfabfb5367fc25b
<jhass> so do you have a common module or base class in all the valid rule_class'es?
<sandelius> jhass no that's the problem :)
<jhass> then you can't do it currently
<sandelius> well I will if I must
<sandelius> jhass, then I'll use an interface class for the rules
<sandelius> jhass thx
<jhass> and then your restriction is just Rule.class
<sandelius> wow crystal has overloading :D
<sandelius> I'm trying my best to NOT get over-excited about all this :)
bjz has joined #crystal-lang
<sandelius> is there a way to let a method argument to be optional but accept different types if it's used? def method(type = nil) but accept symbol or string
Ven_ has joined #crystal-lang
<BlaXpirit> sandelius, yes def method(a : Nil? = :adfg)
<BlaXpirit> sandelius, yes def method(a : Symbol? = :adfg)
<BlaXpirit> woops
<foca> def method(type : (Symbol | String)? = nil) maybe? not sure if you can do more complex type expressions like that
<sandelius> foca that's good enough, thx
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
muscleman has joined #crystal-lang
<muscleman> salutations
<jhass> hi
<muscleman> hello
<jhass> anything we can help you with? :)
<muscleman> maybe ! i am learning crystal !
<muscleman> very entousiast to discover it
<jhass> great
<muscleman> but it is the begining of my reading so i no have question for the moment
<muscleman> documentation is good
<muscleman> very concise
<muscleman> (globally)
<muscleman> it's look like cool
pawnbox has joined #crystal-lang
<muscleman> i am starting to learn it by the end of the documentation, is this a possible approach ?
tliff has quit [Ping timeout: 276 seconds]
<jhass> sure, should be fine
tliff has joined #crystal-lang
<muscleman> ok great so I will advance a little and go back when finished achievements
<muscleman> have a good day
bjz has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
ponga has quit []
Oliphaunte has quit [Ping timeout: 276 seconds]
cloud-oak has quit [Ping timeout: 260 seconds]
cloud-oak has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pochito has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
kfpratt has quit []
mgarciaisaia has quit [Quit: Leaving.]
kfpratt has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
muscleman has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Oliphaunte has joined #crystal-lang
mgarciaisaia has quit [Read error: Connection reset by peer]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
cloud-oak has quit [Quit: cloud-oak]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 250 seconds]
ome has quit [Quit: Connection closed for inactivity]
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Raimondii is now known as Raimondi
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
sandelius has quit [Quit: Textual IRC Client: www.textualapp.com]
crack08 has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voPtt
<crystal-gh> crystal/master 7b06993 Ary Borenszweig: Merge branch 'release/0.18'
tilpner has quit [Ping timeout: 244 seconds]
tilpner has joined #crystal-lang
Philpax has quit [Ping timeout: 272 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voPsM
<crystal-gh> crystal/master b987df1 Ary Borenszweig: Merge branch 'release/0.18'
<Davy_CC> why the compiler cannot infer the type when I typed this: `class Foo; def initialize(io : IO); @tty = io.tty?; end; end`
<jhass> because tty? is a method call
<Davy_CC> but it's declared to return a Bool ?
<jhass> doesn't matter
<BlaXpirit> well asterite says it's inconsistent to check for this >_>
<jhass> and I agree
<jhass> it's not visible on the call side whether it'll work or not
<Davy_CC> okay
<jhass> so it's confusing if it sometimes work and sometimes not
<Davy_CC> thanks
<travis-ci> crystal-lang/crystal#99b99a2 (release/0.18 - Zlib: check empty input. Fixes #2893): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139509185
pochito has quit [Ping timeout: 240 seconds]
kfpratt has quit []
<RX14> jhass, also the type isn't visible in the source in the class
<RX14> so it's sort of a style issue too
<jhass> mh, yeah
<RX14> time to work on that bounded IO
<RX14> maybe it should be a generic utility class, because an IO stream that reads untill a byte sequence sounds somewhat useful elsewhere
<travis-ci> crystal-lang/crystal#7b06993 (master - Merge branch 'release/0.18'): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139509298
<jhass> agreed
soveran has quit [Remote host closed the connection]
<RX14> now the hardest part
<RX14> naming it
<RX14> IO::Bounded?
<jhass> perhaps
<jhass> might be a bit general, could be seen as hard numbers too
<RX14> yeah
<RX14> IO::SequenceBounded and IO::LengthBounded?
<jhass> IO::StreamPart ?
<RX14> i know where length bounded IO is used in the HTTP parser
<RX14> jhass, that barely makes snese to me
<RX14> sense*
<jhass> ok :P
<jhass> oh btw it should take a Slice(UInt8) as boundary then
<RX14> yep
<RX14> isn't alias Bytes = Slice(UInt8) a thing now
trapped has quit [Read error: Connection reset by peer]
<BlaXpirit> >> Bytes
<jhass> it is
<DeBot> BlaXpirit: # => Slice(UInt8) - https://carc.in/#/r/12a2
<RX14> thought so :3
<RX14> IO::BytesBounded and IO::Length Bounded unless anyone has a better idea
<RX14> s/h B/hB/
<jhass> yeah I don't
<jhass> we use size over length in the stdlib terminology
<RX14> SizeBounded?
<RX14> but
<jhass> yes
<RX14> it's not the size
<RX14> length is simply more appropriate here
adam12 has quit [Ping timeout: 246 seconds]
<RX14> i feel like it is somehow
<BlaXpirit> well sure it is, in a lot of places
trapped has joined #crystal-lang
<BlaXpirit> string length, array length and especially this length would be a lot better
<BlaXpirit> alas
adam| has joined #crystal-lang
<jhass> I guess IO::Delimited would be an alternative to BytesBounded, but not that much better
<RX14> IO::Sized and IO::Delimited
<jhass> mh, not too bad actually
<RX14> naming really is the hardest thing in computer science
Oliphaunte has quit [Remote host closed the connection]
qard has joined #crystal-lang
tomchapin has joined #crystal-lang
adam| is now known as adam12
Oliphaunte has joined #crystal-lang
jsownz has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<travis-ci> crystal-lang/crystal#b987df1 (master - Merge branch 'release/0.18'): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139518677
coderobe has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
pochito has joined #crystal-lang
<RX14> jhass, any idea of additional methods to have on IO::Sized?
<jhass> mh, not for now
<jhass> perhaps a readonly, readwrite, writeonly mode, but making it just readonly for now is fine with me
<RX14> well
<RX14> that would be interesting because we would need different sizes on the different directions
<jhass> it should have the usual "close_sync" flag to toggle whether to forward close to the underlying IO
<RX14> i've nver seen that before honestly
<jhass> at least OpenSSL:SSL::Socket has it
<RX14> i need to revize my IO methods
<jhass> mh?
Yxhuvud has quit [Ping timeout: 260 seconds]
Yxhuvud has joined #crystal-lang
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
<RX14> jhass, should I do the new IO types as a seperate PR?
<jhass> separate commits would be good, but an overall PR motivates their usecase better
<RX14> well Sized already exposes a class in HTTP parser
<RX14> yeah I guess 1 PR is fine
<jhass> perhaps one for Sized and one for Delimited + multipart
<RX14> nah i'll do it all together
<jhass> cool
<RX14> hmmn
<RX14> hmmn
<RX14> FixedLengthCOntent already extands a class
<RX14> so I can't really replace it with a IO::Sized
trapped has quit [Read error: Connection reset by peer]
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
<RX14> jhass, if i'm adding a Sized IO should I implement writing as well just because?
<jhass> well if it isn't too much effort
<RX14> it shouldn't be
<jhass> and including IO::Sized in the child class should just shadow
<jhass> mmh, right do we want them as modules or not
<jhass> I guess given we want to make configurable structs would be better
<jhass> I think you can turn Content there into a module
<RX14> well
<RX14> yes the Sized IO is a wrapper
<RX14> not a mixin
<RX14> so struct seems to be the obvious choice
cloud-oak has joined #crystal-lang
sandelius has joined #crystal-lang
cloud-oak has quit [Remote host closed the connection]
<RX14> well
<RX14> regarding that
<RX14> i feel that the self there is ambiguous
<RX14> and should not be allowed
<jhass> well my Ruby roots say that class Foo < Bar is syntax sugar for Foo = Class.new(Bar)
<jhass> :P
<RX14> i never knew that
<RX14> i came from java/C# then to ruby them crystal
<jhass> (not in Crystal but in Ruby it pretty much is)
<RX14> and a whole load sof other langauges inbetween
|2321 has joined #crystal-lang
<Yxhuvud> one thing to remeber is that in ruby, the thing that is inherited from is an expression. you can totally write class Foo < [A, B].sample; end
<Yxhuvud> and I'm not arguing for that to be legal :)
kfpratt has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<miketheman> hello!
<RX14> jhass, how does the require "c/whatever" work in the stdlib? where's the lib defs?
<miketheman> I tried to build crystal today from source (i.e. from scratch) - it appears that the process now requires an existing bootstrap version of crystal?
<jhass> RX14: lib_c/arch and then we do some magic to add the right arch to the load path
<RX14> ahh
<miketheman> and I'm trying to figure out how to do it from scratch - i.e. as if crystal was never there
<jhass> miketheman: well about two years now?
<miketheman> jhass: sure, but there's no "start over, it'll take 4 hours, but it'll work" ?
<BlaXpirit> miketheman, crystal is written in crystal, no other way
<jhass> there's a ruby tag or so
<jhass> but there's a couple of commits that need partial application iirc
<RX14> which is disgusting
<jhass> that is Ary did some stuff locally and uploaded a new binary that works :P
<BlaXpirit> oh boy
<miketheman> hahhaa. ok, that's fair.
<RX14> should be a 2 part thing really somehow
<RX14> jhass, i presume a write bounded IO would just discard anything written past the size...
<jhass> mmmh
<jhass> not sure
<jhass> I think I'd prefer raising
<RX14> there's nothing else really to do
<jhass> just ignore the error if you want to
<RX14> well
<RX14> that seems to break the basic contract of an IO to me
<RX14> i dunno
<jhass> does it?
<RX14> maybe we should just make it readonly
<jhass> if you write and your disk gets full you get some Errno
<RX14> i guess
<jhass> already said I've no problem to start out with a readonly version ;)
<RX14> yeah
<RX14> I could make it so you could configure whether it throws or not
<jhass> meh, no, not too many options
<jhass> IMO it's a bug
<jhass> if you think otherwise ignore the error I give you
<RX14> what's a bug?
<jhass> if somebody gives more data to write than there's "space"
greengriminal has joined #crystal-lang
<jhass> write as much data as there's "space", raise if any is left afterwards
<RX14> well i doubt a write sized IO would be of much use so i'll leve it out
<jhass> <3
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<asterite> I was just needing a size-limited IO some minutes ago, I think something like that should be in the standard library. I wonder about the name, though...
<RX14> asterite, do you want me to PR it in by itself sooner then if you need one?
<asterite> no, there's no hurry :)
<Yxhuvud> one variant of writing past the io size would be to wrap around.
<jhass> asterite: well we're still open to name suggestions, I think so far out of IO::Sized, IO::LengthBounded, IO::SizeBounded, IO::Sized wins
<RX14> thats interesting
<RX14> all it needs is some docs
<jhass> supporting .rewind would be good
<RX14> and the name becomes obvious
<jhass> I think wrapping around would be malicious API design
<RX14> jhass, hrrm
<RX14> jhass, not by defauult
<RX14> my modes
<jhass> KISS
<RX14> add more
<jhass> add features as you have real world usecases
<jhass> not prematurely
<RX14> yes
<RX14> i agree
<RX14> I made the api be read_xxx so it's possible to add write_xxx methods later
<jhass> huh?
<RX14> read_size instead of size,
<jhass> you should only need to implement read(Slice) and write(Slice) (to raise for now) and include IO
<RX14> and pass close
<RX14> and sync close
<jhass> oh you mean the arguments in the constructor
<RX14> and getter for read-remaining
<Yxhuvud> why read_size instead of read(size) ?
<asterite> IO::Limited ?
<asterite> In Go it's called LimitedReader :-P
<jhass> asterite: we want to add one that's limited by size and one that's limited by a boundary byte sequence
<RX14> asterite, we were going to add a size bounded and content bounded reader
<RX14> IO::Sized and IO::BOunded
<jhass> so limited seems a bit ambiguous
<asterite> I think bounded seems ambiguous too
<jhass> I thought we were going for IO::Delimited there?
<RX14> oh
<RX14> we were
<RX14> i thought it sounded off
<asterite> mmm... how would you implement the bounded reader?
<jhass> you're just trapped in mime/multipart terminology atm :P
<asterite> read byte per byte until that byte is found? multipart is the use case?
<RX14> asterite, we discussed this
<RX14> last night
<jhass> asterite: byte by byte and relying on the underlying IO to be buffered so it's fast
<RX14> asterite, and yes multipart is the usecase
<asterite> multipart doesn't come with the size of each part?
<RX14> nope
<jhass> there's no real smart way around it, at least we found none
<RX14> if we know the underlying IO is buffered we could probably hack it around a bit
<RX14> but nah
<jhass> ^
<RX14> reading byte by byte should be fine
<RX14> plus thats internal
<RX14> if someone wants to have a crack
<RX14> they can optimise it
<jhass> yes, but for now KISS again
<RX14> exactly
<asterite> ugh, just saw the rfc... what were they thinking? :-)
<jhass> "nobody's going to still use this in the 90s, it's fine for now"
<RX14> asterite, it's not TOO bad
<RX14> easier than parsing IRC
<jhass> :D
<jhass> MODE, my nemesis
* RX14 cries inside
<RX14> and I didn't even write interpretation code
<RX14> i literally just write a parser
<RX14> it gives you the very raw parsing
<maxpowa> at least MODE has a standard syntax
<maxpowa> that pretty much all IRCds follow
<RX14> at least IRC has a RFC
<jhass> if it only weren't two commands actually
<jhass> RX14: that nobody really follows :P
<tilpner> And then people introduced CTCP quoting...
<maxpowa> oh god dont get me started on CTCP bullshit
<maxpowa> on another network there's a guy who thinks that everything can be solved with CTCP
<maxpowa> it makes me cry
<RX14> don't remind me lol
<BlaXpirit> lol I just regex the PRIVMSG and ignore the rest
<RX14> thats disgusting
<BlaXpirit> nah I lie, gotta also respect the PING
<RX14> regex for parsing :/
<jhass> ya not parsing HTML with regex, yo?
<RX14> or IRC
<BlaXpirit> happens sometimes
<RX14> I dislike using regex for parsing at all because I percieve it to be slow
<BlaXpirit> that's true, but for parsing each individual token regex is not bad otherwise
<RX14> jhass, see anything I missed? https://aww.moe/79uner.txt
<jhass> RX14: looks good. minor style thingy, I'd use {a, b}.min, but debatable
<jhass> specs and we should be good
<RX14> well
<RX14> how does {}.min optimize out?
<jhass> I would expect fully
<jhass> let me see
<BlaXpirit> jhass, you can see??? is there any info on that?
<BlaXpirit> if not, pls pls pls
willl has joined #crystal-lang
<jhass> so
<jhass> Enumerable#min does Enumerable#min_by
<jhass> does #each_with_index
<jhass> iterates through and just stores the minimum in a local
<jhass> #each_with_index just does #each with a counter
<jhass> Tuple#each inlines the block for each tuple item
<jhass> so you should end up with code like min = a; min = b if b < min; min = c if min < c
<jhass> and some boilerplate around that
<RX14> really?
<jhass> which LLVM should like
<RX14> benchmark time
schovi has joined #crystal-lang
pochito has quit [Ping timeout: 244 seconds]
<RX14> must compile to the same thing
<jhass> :)
<RX14> also, hacks because cba to create a file
<RX14> would be nice if crystal accepted "-" to be stdin
<jhass> mmh, does eval take --release?
<jhass> I think it should
<RX14> but multiline
<jhass> crystal eval <<EOF
<RX14> can't remmember how to multiline args
<RX14> wait
<RX14> eval takes stdin?
<jhass> crystal eval should read from stdin with no code arg, yeah
<RX14> NICE
<schovi> Hello. I am learning macros and play around with "run(file)". I am stuck for really long time on problem, how to pass macro argument value into "run" command. There is example https://gist.github.com/schovi/e38a02d91f83a84ba72f8a39f46e5c92 I hope it is self explained. Question: How to pass variable value into "run" command.
<RX14> jhass, looks like it doesn't take args at all
<jhass> :(
<BlaXpirit> schovi, you cannot pass a runtime value into a compile-time construct
<BlaXpirit> do you expect to go into the past and change the way the program was compiled because your variable changed?
<RX14> schovi, you
<RX14> 're essentially passing the string "variable" to the run program
<RX14> jhass, i still feel {}.min is weird
<jhass> I said debatable
<jhass> on the plus side Ruby 2.4 optimizes [].min
<RX14> this isn't ruby though
<jhass> yes but it's not just me liking the construct :P
<BlaXpirit> RX14, I don't like Math.min - what's so mathy about it?
<BlaXpirit> it's a collection of items and you take the smaller of them
<schovi> @BlaXpirit @RX14: Aha. Is there any way how to this? In my realcase i want to pass some filepath to load content of that file and save it inside some variable.
<asterite> Why {...}.min is weird?
<RX14> not what i'm used to
<RX14> is all
<RX14> which is a horrible reason
<schovi> That mean, path to that file is known and unchangable during compile time.
<asterite> ah, yes, in ruby [a, b].min is used all the time and I wasn't used to it at first
<jhass> asterite: shall we drop Math.min/max ? :P
<BlaXpirit> yes pls
<schovi> Maybe store that in constant?
<RX14> schovi, if you pass a constant into a macro you can get the value
<RX14> like
<jhass> call .resolve on it
<RX14> that works?
<jhass> yup
<RX14> how does it fail though?
<BlaXpirit> what fails
<RX14> resolve
<jhass> no method kind of error if it isn't a constant
<RX14> ok
<jhass> or Path rather
<BlaXpirit> >> macro test(a); p {{a.resolve}}; end; A=5; test(A)
<DeBot> BlaXpirit: 5 - more at https://carc.in/#/r/12aa
<schovi> @RX14 Can you explain more? If I change variable with CONSTANT = "double me". It is same result
<RX14> >> macro test(a); {{pp a.resolve}}; end; a=5; test(a)
<DeBot> RX14: undefined macro method 'Var#resolve' - https://carc.in/#/r/12ab
<BlaXpirit> schovi, also add .resolve as seen above
<RX14> >> macro test(a); {{pp a.resolve}}; end; a=5; test(5)
<DeBot> RX14: undefined macro method 'NumberLiteral#resolve' - https://carc.in/#/r/12ad
miketheman has quit [Quit: ZNC - http://znc.in]
<RX14> o
<schovi> ah sorry. I am not used on IRC :)
miketheman has joined #crystal-lang
<schovi> Sweet !
<schovi> Thanks guys
<jhass> welcome lad
<jhass> eh, lady
<BlaXpirit> ???
* jhass dislikes guys
<jhass> it's weird how it's fine to assume everybody male but causes irritation to assume somebody female
tomchapin has joined #crystal-lang
<BlaXpirit> jhass, snap out of it please. https://en.wiktionary.org/wiki/guys
<RX14> well lad is hardly lady
<RX14> also
<jhass> yeh I messed that one up and corrected
<RX14> "*jhass dislikes guys" could be horribly misinterpreted
<jhass> BlaXpirit: google "guys inclusive", you'll easily find a dozen or more articles explaining it to you
<BlaXpirit> i don't care. you're creating a problem out of nothing, and assuming that they assumed
schovi has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
<jhass> awareness doesn't happen through ignorance
schovi has joined #crystal-lang
pawnbox has joined #crystal-lang
<RX14> well whats the alternative to using guys anyway?
<maxpowa> "peeps"
<maxpowa> thats what i use at work jokingly because someone took offense to "guys"
<RX14> that's not in my vernacular
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
<maxpowa> "dawgs" is also a suitable alternative
<jhass> y'all, folks, people or just omit it
<maxpowa> "fellow humans"
<sandelius> I have a couple of questions. 1: does it matter in what order I require files/classes? 2: Is there a way to spawn workers to utilize multiple cores when using the web server?
<asterite> maybe use a language where gender doesn't appear in words
<BlaXpirit> sandelius, recently it started to seem to me like the order does not matter, it all ends up as if it was one big source file. and order does not matter within a source file either
<asterite> I don't know if such language exists, though...
<BlaXpirit> sandelius, spawn workers -- spawning processes would currently be the best bet
<BlaXpirit> threadpool coming soon
<schovi> It is little bit tricky, but I am able to resolve "relative" path (for example: git repository with library. path to file is same relative to repo root, but different relative to system root on different machines). it can be solved with load("../assets/file.png", __DIR__) which is macro with run call and then resolve path from these two arguments
<BlaXpirit> I don't comprehend
<jhass> asterite: English provides great workarounds without sounding too awkward actually :)
<jhass> like singular they
<jhass> german is a lot harder there :/
<jhass> I wonder whether Lojban has gender
<jhass> I wouldn't expect it to
pawnbox has quit [Remote host closed the connection]
<jhass> that's a lot more than I thought, the majority in fact
|2321 has quit [K-Lined]
schovi has quit [Quit: Leaving...]
<rkeene> Don't forget "yous guys"
<maxpowa> thats still "guys"
<asterite> my problem is when I write something about a user and the he or she does something... should "he" or "she" be used?
<maxpowa> they
<maxpowa> it
<maxpowa> hweh
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voXnM
<crystal-gh> crystal/master 2970e95 Ary Borenszweig: Merge branch 'release/0.18'
<asterite> Interesting!
<jhass> by now I sometimes use it even if I actually know
<jhass> it just became sort of a habit
<jhass> also I think https://en.wikipedia.org/wiki/Gender_neutrality_in_genderless_languages is my new favorite wikipedia article
<Yxhuvud> 'pig' always work.
<maxpowa> "You pigs in human clothing"
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> see I hate german. There's no pig, there's only "male pig" (Schwein) and "female pig" (Sau)
<Yxhuvud> heh. In swedish neither 'svin' or 'gris' are gendered. there are separate gendered words for them ('sugga' and 'galt').
<maxpowa> well english you have hog, sow for male and female pig respectively
<jhass> but you do have pig. no such thing in german
<maxpowa> s/hog/boar/
<maxpowa> i guess hog is genderless
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 244 seconds]
<willl> jhass: can you say saufleisch instead of schweinefleisch?
<jhass> it'd be quite uncommon (why would you care?) but "saufleisch" or I guess "sauenfleisch" a bit better would be understood
<jhass> interestingly "Saumagen" is a well defined dish, opposed to "schweinemagen"
<willl> yeah, interesting. thanks :)
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<jhass> mh "cow" is the generic but also the female cow specifically, right?
<maxpowa> eh not really
<maxpowa> it really needs the context
<maxpowa> but cattle have a bunch of names depending on their status
<maxpowa> like you have bulls and steers
<jhass> yes but I mean there's no general term like pig
<maxpowa> well bovine or cattle
<maxpowa> but singular not really
miketheman has quit [Quit: ZNC - http://znc.in]
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
miketheman has joined #crystal-lang
<RX14> jhass, why do I get Error while requiring "prelude": can't find file 'prelude' when trying to run the crystal specs on master
<jhass> RX14: use the makefile, make std_spec
<RX14> thats not what it says in the contribution guide
<jhass> huh?
<RX14> "To run the specs for the standard library, run bin/crystal spec/std_spec.cr."
<jhass> oh
<jhass> that doesn't work?
<RX14> no
<RX14> specs fail too
<jhass> >> Crystal::VERSION
<DeBot> jhass: # => "0.18.4" - https://carc.in/#/r/12ah
<RX14> specs fail because of me
<RX14> because I migrated the repo HDD from NTFS to btrfs and executable bits got lost
<RX14> jhass, I think I had this problem before, with the bin/crystal script being wrong
<jhass> currently compiling HEAD, will try afterwards
Oliphaunte has quit [Remote host closed the connection]
<RX14> CRYSTAL_DIR: "/data/programming/crystal/bin /data/programming/crystal"
<RX14> which is obviously invalid
<RX14> i solved this before but i just wiped the git
<jhass> that's from...?
<RX14> bin/crystal
<jhass> that looks oooold
<RX14> why?
<jhass> see my link?
<RX14> it's the realpath implementation which is screwy
<RX14> jhass, yes
<RX14> it's correct
<RX14> if CRYSTAL_ROOT is correct
<jhass> anyway, bin/crystal spec/std_spec.cr does work for me
<RX14> oh I know why
<RX14> no i don't
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
greengriminal has quit [Quit: This computer has gone to sleep]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<RX14> jhass, somehow my cd ouputs the directry it's going to cd to to stdout
<jhass> haha that sounds annoying
<RX14> i don;t understand what it's doing
<RX14> because
<jhass> which cd or command -v cd might give some insight
<RX14> it doesn't happen when i try and isolate it
<RX14> well rvm does some fuckery
<jhass> oh yes it does
<jhass> chruby < 3
<jhass> <3
<RX14> nah
<RX14> but it should be executing in bash :/
<RX14> i don;t understand it
<jhass> much saner approach
<havenwood> preexec_functions \o/
soveran has quit [Ping timeout: 244 seconds]
<jhass> havenwood: you have a highlight on rvm and chruby, don't you? :P
<havenwood> jhass: guilty
<RX14> well
<RX14> havenwood, why?
<havenwood> RX14: precmd_functions/preexec_functions/chpwd_functions and such are easy to reason about and work with
<RX14> no why do you have the highlight lol
<havenwood> it'd be nice if bash had better callback hooks
<RX14> it would be nice if bash wasn't bash
<havenwood> RX14: oh, hah, i'm on the rvm and chruby teams
<RX14> oh
Philpax has joined #crystal-lang
coderobe has quit [Ping timeout: 250 seconds]
dhk has joined #crystal-lang
Philpax has quit [Ping timeout: 272 seconds]
jsownz has quit []
<travis-ci> crystal-lang/crystal#2970e95 (master - Merge branch 'release/0.18'): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139605369
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<RX14> jhass, i'm getting a segfauly from my sized implementation somehow
<jhass> :o
<RX14> which is really weird
<RX14> because i'm not doing anything unsafe
<jhass> gdb or valgrind should give you a rough backtrace at least
<jhass> if you're lucky even linenumbers when compiled with --debug
jsaak has quit [Ping timeout: 240 seconds]
<RX14> i can't read this valgrind
<RX14> well
<RX14> not the stacktrace at least
<RX14> the tracktraces all seem to point inside crystal segfault handler
<jhass> post it?
<RX14> the segfault doesn't happen when I call the test code on a memoryio
<RX14> when i wrap it in a sized it breaks
<jhass> by 0x474900: *IO::Sized@IO#check_open:Nil (in /data/programming/crystal/sized_spec)
<jhass> wow
<jhass> feels like a codegen bug on first sight
<RX14> oh
<RX14> wow
<RX14> wait
<RX14> the bactraces are upside down?
<jhass> no
<RX14> why is there stuff above it then
<jhass> we just trap sigsegv and try to dump the callstack
<RX14> oh
<RX14> well
<RX14> it didn't really work
<jhass> well yes, if your memory layout is all messed up we can only try our best
<jhass> it's a fairly complex operation
<jhass> so good chances it'll recrash
<RX14> well ragardless
<RX14> regardless*
<RX14> i'm doing the approximate same as ssl/socket does
<jhass> can you show the code again please? it does very much feel like a codegen bug though
<RX14> wait a sec
<RX14> this DOESN't reproduce: https://aww.moe/58dbli.txt
<jhass> yeah there's nothing unsafe at all there
<jhass> so defo codegen bug
<RX14> commeinting out check_open fixes it
<RX14> nope
<RX14> derp
<jhass> do you have some callside code at hand? perhaps just pastebin your git diff so I can git apply it
<jhass> thanks
<RX14> jhass, with this -- i'm off to bed
<RX14> i have an day after tomorrow exam so i really should be sleeping earlier
<jhass> sleep well
<jhass> yup
<RX14> don't worry, it's an easy exam
soveran has joined #crystal-lang
<RX14> graph theory, just do a load of memorized alghorithms on paper
<RX14> and it's the last exam
<RX14> so~
<jhass> sounds fun :P
<jhass> good luck
<RX14> it's ok
<RX14> some sorting algorithms too
<RX14> quicksort on paper :/
<RX14> better than the other sorts on paper though
<jhass> haha
<RX14> at least it's quicker
<RX14> :P
<RX14> night
Raimondii has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
Raimondi has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#1932be8 (release/0.18 - Fixed #2675: correct error message when super method wasn't found on abstract class): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139605403
Raimondii is now known as Raimondi
dhk has quit [Quit: Leaving]