ome has quit [Quit: Connection closed for inactivity]
<crystal-gh>
[crystal] marceloboeira opened pull request #2911: Add temporary directory file creation on Dir class (master...feature/mktmpdir) https://git.io/vo9kZ
pawnbox has joined #crystal-lang
snsei has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 244 seconds]
snsei has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
snsei has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
sandelius has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
Redfoxmoon has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 264 seconds]
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
<sandelius>
if I compile my code on osx will I be able ru run it on linux or do I need to compile it there aswell?
<RX14>
you need to recompile
<RX14>
i think it's technically possible to cross-compile though, if a little complex
A124 has quit [Read error: No route to host]
<jhass>
you can cross compile but you need to link on the target host or a compatible chroot
<RX14>
yup
<RX14>
rust has a really nice tool for automating this
<RX14>
i imagine crystal could get one too but it's not really worth it yet
<RX14>
it's not particularly high on the agenda at least
<BlaXpirit>
RX14, assert($~[0] == "oo") causes that
<RX14>
hmmn
<RX14>
it recursively calls get_ast on the reciever and args
<RX14>
call assert($~[0])
<RX14>
i wonder if just assert($~) breaks
<BlaXpirit>
RX14, yes, breaks
<RX14>
which one?
<BlaXpirit>
both
<RX14>
hmmn
<RX14>
interesting
<RX14>
which mens $~ is a Call in the ast
<BlaXpirit>
traceback looks the same in all cases
<RX14>
which is weird
<RX14>
because $~ is not a call to me
<BlaXpirit>
RX14, well it's a very special thing, it's not actually a global. something like a threadlocal probably i dunno
<BlaXpirit>
or just a local even
<RX14>
well it seems to have a recursive AST
<RX14>
whatever it is
<jhass>
I think I would call it stack or fiber local
soveran has joined #crystal-lang
<RX14>
but what is it in the AST?
<jhass>
it's essentially a secondary return value or implicit block parameter, depending on context
<jhass>
no idea
<RX14>
thats
<RX14>
oh
<RX14>
well
<RX14>
jhass, do you know a testable closable IO?
<jhass>
MemoryIO?
<RX14>
it's closable?
<jhass>
I think so
<RX14>
oh dear
<RX14>
it was just me
<RX14>
referencing the wrong varaible
<RX14>
ok specs pass for IO::Sized
<jhass>
<3
soveran has quit [Remote host closed the connection]
<RX14>
i should have written docs
<RX14>
oh well i'll go back and do that later
<sandelius>
is crystal used in production that you guys know of?
<RX14>
yes but we don't reccomend it
<sandelius>
what's the catch with crystal? with parallelism this would be the most ultimate tool I ever seen.
<sandelius>
and I read that that will come before stable realse
<RX14>
well
<RX14>
it doesn't run on windows yet
<RX14>
but that shoukd be fixed soon too
<RX14>
and parelelism is being worked on right now I think
<sandelius>
even the stdlib is great atm
<BlaXpirit>
i wouldn't hope for windows soon
<RX14>
BlaXpirit, i would
<BlaXpirit>
what evidence?
<BlaXpirit>
nobody's doing it
<sandelius>
windows in not a big issue for me tho, I'm gonna build and run on unix systems
<RX14>
BlaXpirit, ary half-implied he would look at it after doing parellelism
<sandelius>
how are you guys planning to implement parellelism?
<jhass>
sandelius: the biggest catch probably is that each non patch release (and sometimes even those) break half the ecosystem and needs to be updated
<RX14>
sandelius, thread pool
<jhass>
that runs fibers
<RX14>
yep
<RX14>
what about IO though i'm still cofnfused
<sandelius>
jhass well the the status say: "The project is in alpha stage: we are still tweaking the language and standard library." so that is something one would expect at this stage
<jhass>
sure, it might just make it hard to argue for a production app
<sandelius>
jhass yeah that's true
<jhass>
the other catch is that some things are simply not possible yet since the generic type system needs some more work still
<sandelius>
jhass like using a type Class :)
<jhass>
you can find workarounds for most of it, but it's not as elegant as it could be
<sandelius>
jhass Hash(Symbol, Class)
<jhass>
yes
<BlaXpirit>
well it's not possible in other languages and nobody's complaining
<RX14>
BlaXpirit, using an array of generic pointers is possible in most langauges
<RX14>
as in
<jhass>
the Class is just the special case of a more general issue
<RX14>
array of object
<RX14>
no
<RX14>
reference
<jhass>
RX14: you mean parallel reads?
<jhass>
or writes?
<RX14>
jhass, i thought evented IO/distributing the IO load evenly was an issue
<sandelius>
RX14 ohh that's why I got that error. now it makes more sense :) I got no match for named tuple
<RX14>
sandelius, i would reccomend reevaluating your use of a hash though
<sandelius>
RX14 well the schema is a class that contains a hash called attributes
<RX14>
this looks like ruby but it's best practices are very different
<sandelius>
RX14 well I'm coming from ruby so :)
<RX14>
sandelius, that's a description of what it is but why do you need to use a hash?
<jhass>
to map schemas crystal developed the mapping idiom
<RX14>
why can't it be a custom dsl or something
<sandelius>
RX14 I build it like that when I'm merging several schemas
<sandelius>
so "hashes" with the : syntax is named tuples and => are hashes?
<RX14>
why can't it be a tree of classes/structs
<jhass>
sandelius: yes
<RX14>
if you know the keys
<sandelius>
RX14 it can, I'm just exploring
soveran has joined #crystal-lang
<RX14>
jhass, is getting 0 back from IO#read always the end of the stream?
<BlaXpirit>
RX14, assuming it's a blocking function, yes
<RX14>
it could be ANY io
<BlaXpirit>
RX14, lol it's so funny, whenever you use $~ it seems to be expanded to $~.not_nil! in the AST? no idea
<RX14>
uhh
<RX14>
the hell
<jhass>
RX14: I think so, yes
<jhass>
given all our IO should block from the caller perspective
<RX14>
jhass, same if it doesn't return slice.size bytes?
<jhass>
mh, I'm not sure but I hope so
<BlaXpirit>
if I write `assert $~` , the expression ends up as '$~.not_nil!.not_nil!', if I write `assert $~[0] == "oo"`, the expression ends up as '$~.not_nil!.not_nil!.not_nil!.not_nil!'
<RX14>
this
<RX14>
is very very very very weird
soveran has quit [Read error: Connection reset by peer]
<BlaXpirit>
and obviously if you try to remove one level from it and receive the caller or whatever, the result is the same exact expression because it also adds another layer of .not_nil!
<BlaXpirit>
it's a bug of crystal probably
soveran has joined #crystal-lang
<BlaXpirit>
gotta try to separate if from power_assert
ponga has quit []
<BlaXpirit>
it*
<RX14>
BlaXpirit, make an issue for it
<RX14>
say it's basically impossible for macros to deal with it
<RX14>
and now there's a helicopter hovering right over my house
<RX14>
great
<jhass>
haha, guy got arrested in berlin the other day for bringing one down with a laser pointer
<RX14>
what an idiot
<jhass>
it's too comical
<RX14>
like, he brought one down completely?
<RX14>
crashed it?
<jhass>
it was a police one at night while they were evicting an occupied house
<jhass>
guy was 60+ and annoyed by the noise
<jhass>
so he managed to burn the pilots eye and the copilot had to land
<RX14>
oh
<jhass>
the situation is so bizarre
<RX14>
well thats not as bad as i was expecting
<jhass>
I mean it wasn't even the antifa being evicted there, but some guy who probably was happy to seem them removed from his neighbourhood otherwise
<jhass>
*that was being
<RX14>
yeah
<RX14>
why is there no slice#copy_top)Slice)
<RX14>
why is there no slice#copy_to(Slice) *
<RX14>
just copies x bytes to another slice, filling it up, and returning amount copied
<jhass>
mh, isn't there an issue for that somewhere?
<jhass>
why you need it though?
<RX14>
copy from the delimiter buffer to the reading slice in IO::Delimited
<jhass>
huh
<jhass>
reading slice == the one you get?
<RX14>
yes
<jhass>
I thought we'd stop before the delimiter?
<RX14>
when i encounter the first byte of the delimiter, I read the rest into a small buffer
<jhass>
ah
<RX14>
then i'm trying to handle the case where the stream ends before the buffer fills up
<sandelius>
what's the technical differens between a hash and a named tuple?
<RX14>
and then the buffer doesn't fill up AND the remaining needs to be copied to the reader slice
<jhass>
wouldn't it be easier to just keep an index into the delimiter and a flag?
<jhass>
ah wait, nvm
<RX14>
it's harder that way
<RX14>
well of course
<RX14>
you don't want the delimiter bytes in the output
<jhass>
eh, I guess just add it ;P
<jhass>
should be as simple as a few boundary checks and a memcpy
<BlaXpirit>
1) types are probably important 2) is_a? and other such things should probably be specialcased
soveran has quit [Remote host closed the connection]
<RX14>
and we should resugar some things?
<RX14>
especially array accessors
<RX14>
BlaXpirit, what's the compile times for the testcases before and after?
<BlaXpirit>
no idea. well this is a small thing, difference probably negligible?
<BlaXpirit>
and indeed it seems to be negligible
<crystal-gh>
[crystal] MakeNowJust opened pull request #2913: Introduce Order as a return of `<=>` instead of Int32 (master...feature/order) https://git.io/vo9cK
<RX14>
BlaXpirit, yeah real test is the whole stdlib tests though
<BlaXpirit>
well that's already a small risk if we decide to go through with it and get rejected
<RX14>
yeah
<BlaXpirit>
regex probably can't do it, need something like the formatter. or manual work, ugh :s
<RX14>
nah we can do it i'm sure
<RX14>
as in the formatter
<RX14>
also regex could get 90% i bet
<RX14>
s/^(.*?).should eq(.*?)$/assert \1 == \2/
<RX14>
i wish we could define user-defined annotations as macros
<BlaXpirit>
would probably want a good tool, to apply to any code, not just stdlib with manual verification
<RX14>
BlaXpirit, yep
<BlaXpirit>
RX14, maybe comments could serve that role, if they were included in ast
<RX14>
but how would you trigger a macro then?
<BlaXpirit>
oh you're looking at something else like @[ ]
<RX14>
yes
<BlaXpirit>
it could be pretty convincing to allow to use macros there
<BlaXpirit>
especially because all existing things are @[Uppercase]
<BlaXpirit>
@[lowercase] could be equivalent to lowercase( ... )
<BlaXpirit>
i dunno
<RX14>
mmm
<BlaXpirit>
but it's difficult to write macros that utilize this!
<RX14>
yep
trapped has quit [Read error: Connection reset by peer]
buggs2 has joined #crystal-lang
dhk has joined #crystal-lang
joshcarter_ has joined #crystal-lang
emmanueloga_ has joined #crystal-lang
pabs_ has joined #crystal-lang
<BlaXpirit>
welp, the formatter is huge, didn't expect that
<BlaXpirit>
I kinda did expect but hoped it reused more code
maxpowa_ has joined #crystal-lang
jokke1 has joined #crystal-lang
emmanueloga has quit [Ping timeout: 258 seconds]
buggs1 has quit [Ping timeout: 258 seconds]
aemadrid has quit [Ping timeout: 258 seconds]
tubbo has quit [Ping timeout: 258 seconds]
matp has quit [Ping timeout: 258 seconds]
steenuil has quit [Ping timeout: 258 seconds]
pabs has quit [Ping timeout: 258 seconds]
jokke has quit [Ping timeout: 258 seconds]
avdi has quit [Ping timeout: 258 seconds]
Arahael has quit [Ping timeout: 258 seconds]
joshcarter has quit [Ping timeout: 258 seconds]
maxpowa has quit [Ping timeout: 258 seconds]
aemadrid has joined #crystal-lang
maxpowa_ is now known as maxpowa
joshcarter_ is now known as joshcarter
aemadrid has joined #crystal-lang
aemadrid has quit [Changing host]
tubbo has joined #crystal-lang
matp has joined #crystal-lang
emmanueloga_ is now known as emmanueloga
avdi has joined #crystal-lang
Arahael has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 264 seconds]
<RX14>
jhass, I have copy_from(src) just call src.copy_to(self), should I duplicate the specs?
<jhass>
I'm afraid yes
<RX14>
nah i don't mind a bit of copying
<RX14>
in specs especially copying isn't the worst thing ever
<RX14>
vim certainly makes it easy ;)
<jhass>
yeah, agreed
<jhass>
and who knows, it's better it's there in case somebody wants to change/extend the semantics for one but the other
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
snsei has quit [Remote host closed the connection]
qard has joined #crystal-lang
<FromGitter>
<sdogruyol> Good job :+1:
soveran has joined #crystal-lang
<jhass>
RX14: just for fun https://p.jhass.eu/3d.cr didn't turn out all that more readable, I'm still curious how much slower it is though, might benchmark tomorrow
<RX14>
jhass, line 121 confuses me
<RX14>
oh
<RX14>
derp
<RX14>
jhass, i think it's more readable
<jhass>
just always copies each byte twice
<jhass>
so I expect yours to be faster
<RX14>
but lines 121/122 confuse me
<RX14>
actually
<jhass>
I use the ring there as a sliding window onto the stream, each iteration advances the window one further, so we don't need the oldest byte in the window anymore and also know it won't be part of the delimiter, so at that point we give it to the caller
<RX14>
ohh
<RX14>
shit yes
<jhass>
eh, *normalize I/we
<RX14>
i get it
<RX14>
your one is WAY more readable imo
<RX14>
i like it
<RX14>
jhass, the comment on line 120 confused more then helped me
<jhass>
ok
<RX14>
i would say "copy the oldest value in the ring"