waj_ has quit [Read error: Connection reset by peer]
waj has joined #crystal-lang
fowlduck has joined #crystal-lang
<willl>
asterite: does --release change the llvm-ir? I figured it just got sent through as opt_level = release ? LLVM::CodeGenOptLevel::Aggressive : LLVM::CodeGenOptLevel::None
waj has quit [Remote host closed the connection]
trapped_ has joined #crystal-lang
<crystal-gh>
[crystal] will opened pull request #1401: Add Block Comment Syntax (master...block-comments) http://git.io/vZUS4
rossjones_ has joined #crystal-lang
thor77_ has joined #crystal-lang
tliff_ has joined #crystal-lang
thor77 has quit [*.net *.split]
trapped has quit [*.net *.split]
jokke has quit [*.net *.split]
rossjones has quit [*.net *.split]
tliff has quit [*.net *.split]
thor77_ is now known as thor77
jokke1 has joined #crystal-lang
tliff_ is now known as tliff
asie1 has joined #crystal-lang
_ has joined #crystal-lang
rvchangu- has joined #crystal-lang
_ is now known as Guest45342
[epitron] has joined #crystal-lang
asbradbu1y has joined #crystal-lang
rvchangue has quit [Ping timeout: 272 seconds]
asie has quit [Ping timeout: 272 seconds]
epitron has quit [Ping timeout: 272 seconds]
trapped_ has quit [Ping timeout: 272 seconds]
asbradbury has quit [Ping timeout: 272 seconds]
rvchangu- is now known as rvchangue
fowlduck_ has joined #crystal-lang
fowlduck has quit [*.net *.split]
lokulin has quit [Ping timeout: 265 seconds]
justinmcp_ has joined #crystal-lang
[epitron] has quit [Ping timeout: 265 seconds]
vegai has quit [Ping timeout: 265 seconds]
justinmcp has quit [Ping timeout: 265 seconds]
vegai has joined #crystal-lang
lokulin has joined #crystal-lang
waj has joined #crystal-lang
[epitron] has joined #crystal-lang
waj has quit [Remote host closed the connection]
fowlduck_ has quit [Remote host closed the connection]
trapped_ has joined #crystal-lang
fowlduck has joined #crystal-lang
Guest45342 has quit [Ping timeout: 244 seconds]
fowlduck has quit [Remote host closed the connection]
ylluminate has quit [Remote host closed the connection]
ylluminate has joined #crystal-lang
[epitron] is now known as epitron
epitron has joined #crystal-lang
epitron has quit [Changing host]
ylluminate has quit [Ping timeout: 268 seconds]
NeverDie has quit [Read error: Connection reset by peer]
NeverDie has joined #crystal-lang
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
ledestin has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
tatey_ has quit []
ylluminate has joined #crystal-lang
kyrylo has joined #crystal-lang
<crystal-gh>
[crystal] will opened pull request #1405: Benchmark ips formatting improvements (master...benchmark-ips-formatting) http://git.io/vZTuq
BlaXpirit has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
elia has joined #crystal-lang
elia has quit [Client Quit]
tatey_ has joined #crystal-lang
<nakilon>
$ crystal build --release 111.cr && time ./111
<nakilon>
real0m0.158s
<nakilon>
$ gcc 111.cpp -o ./111 && time ./111
<nakilon>
real0m0.602s
<nakilon>
_OO
BlaXpirit_ has joined #crystal-lang
<jhass>
well, you didn't enable optimizations for gcc tbf ;)
<nakilon>
gcc -O3 made 0.142s
Ven has joined #crystal-lang
BlaXpirit_ has quit [Quit: Konversation]
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 240 seconds]
leafybasil has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toydestroyer has joined #crystal-lang
DeBot has quit [Ping timeout: 246 seconds]
Ven has joined #crystal-lang
DeBot has joined #crystal-lang
wuehlmaus has quit [Quit: Lost terminal]
wuehlmaus has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
kyrylo has quit [Quit: Konversation terminated!]
kyrylo has joined #crystal-lang
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blassin has joined #crystal-lang
<blassin>
hey, I don't understand the File#read error I'm getting here http://carc.in/#/r/e1p
<jhass>
>> Float::INFINITY.times {|i| print i; break if i > 5 }
<DeBot>
jhass: Error in line 4: undefined constant Float::INFINITY - http://carc.in/#/r/e3q
<jhass>
>> Float32::INFINITY.times {|i| print i; break if i > 5 }
<DeBot>
jhass: Error in line 4: undefined method 'times' for Float32 - http://carc.in/#/r/e3r
<jhass>
:(
<blassin>
I don't do times
<BlaXpirit>
no no, this is very bad
<BlaXpirit>
you add 1.0 every time
<BlaXpirit>
basically
<jhass>
actually not
<BlaXpirit>
and that can go into an infinite loop under crazy circumstances
<jhass>
it's Range(B,E)
<BlaXpirit>
hmmmm maybe you're right
<jhass>
so it goes into Int#succ
<jhass>
and any_int < FloatXX::INFINITY
<blassin>
BlaXpirit: still think it's a very bad replacement?
<BlaXpirit>
nice
<blassin>
it's ok, right?
<blassin>
right? :D
<BlaXpirit>
just bad, not very :p
<blassin>
I don't see why, kindly explain?
<jhass>
you could probably (f.size/@chunk_size).ceil.times do |i| or so
<BlaXpirit>
actually .fdiv :(
<jhass>
ah, right
havenwood has quit [Ping timeout: 240 seconds]
<BlaXpirit>
this is one of the worst things about crystal
<BlaXpirit>
for me, anyway
<blassin>
what, fdiv ?
<BlaXpirit>
the fact that division acts differently in different situation
<BlaXpirit>
not fdiv, but the need for fdiv
<BlaXpirit>
python devs realized it was a mistake back in 2001
<BlaXpirit>
but this behavior is still the default in 2.x
<blassin>
BlaXpirit: yeah, the infinity thing is bad when you know the iterations...
<BlaXpirit>
blassin, no, it should just be a while loop
BitPuffin has joined #crystal-lang
<BlaXpirit>
and honestly what prevents you from wrapping this
<blassin>
I thought whiles were bad practice and loop do was the thing
<BlaXpirit>
>> def count; i = 0; while true; yield i; i += 1; end; end
<DeBot>
BlaXpirit: Error in line 4: can't declare def dynamically - http://carc.in/#/r/e3s
<BitPuffin>
hello does crystal come built in with manual memory management, I was checking the docs with the pointer class but the malloc there seems to still allocate GC memory
<BlaXpirit>
i have no idea where the error is
<jhass>
BlaXpirit: mmh, but given we don't autogrow integers it kinda feels more consistent that way too, no? having the lower level/more manual behavior in all cases
<BlaXpirit>
oh, jhass, that's a problem with this wrapping :o
<jhass>
BitPuffin: not really, there are some ways to disable GC and go manual, but the language is absolutely not designed for that, those avenues are rather for interfacing with C libraries
<jhass>
BitPuffin: using stdlib that way will probably quickly lead to leaks
<BitPuffin>
jhass: ah too bad, was hoping that the language would be a bit more full spectrum
<BitPuffin>
jhass: still it seems like a cool lang
<BlaXpirit>
though honestly, i think loop should yield the index
<jhass>
BitPuffin: thanks :)
<BlaXpirit>
unless it actually doesn't get optimised if unused
<blassin>
I think (f.size.to_f / @chunk_size).ceil.to_i.times do |i| in this case is better
<jhass>
it should, the block gets inlined thus it becomes a local var that's never read
<blassin>
since the loop has bounds
<jhass>
it's like the prime example for optimization
<blassin>
I also think #ceil should make it an Int
<BlaXpirit>
there are a lot of things that perhaps shouldn't blindly follow ruby
<BlaXpirit>
oh actually ruby returns an int
<BlaXpirit>
:|
rossjones_ is now known as rossjones
<BitPuffin>
jhass: do you think there will be more work on more low level stuff in the future, or will it mainly remain a pretty high level-only language. To me as a game developer I think it's attractive to be able to mix high level code and really really low level code in the same language
<BlaXpirit>
blassin, the problem is the int can be too big
<BlaXpirit>
in ruby it's not a problem because i think its numbers are unlimited
<blassin>
aww right
<blassin>
but wait, it could be a Int64
<BitPuffin>
BlaXpirit: woot ruby uses bignums by default?
<blassin>
when called on a Float64
<BlaXpirit>
blassin, int64 is much much smaller
<BlaXpirit>
float goes up to like 10^300
<BlaXpirit>
and int is just 10^18
<BlaXpirit>
(all approximate)
<BlaXpirit>
by int i mean uint64
<blassin>
how can floats in 64 bits be bigger than ints in 64 bits? unless Floats skip a lot of fractions...
<BlaXpirit>
blassin, precision is lost
<blassin>
I mean, UInt64 of course
<blassin>
BlaXpirit: I see, yeah that would be the only way
<BlaXpirit>
it stores it like 1.23456789012345 * 10^300
<jhass>
BitPuffin: I don't see changes to memory management, that's just affecting the language design too much. You can already embed assembler and we have quite beautiful C library interfacing
<BlaXpirit>
(oversimplified)
<blassin>
BitPuffin: I think Crystal has a bright future in gamedev
<blassin>
due to its performance and easy of writing
<jhass>
BitPuffin: Ruby autogrows Fixnum to BigNum on overflow
<blassin>
I mean, once the .... substantial wrinkles :D are ironed out
<BlaXpirit>
jhass, no but garbage collection can bite you
<blassin>
*ease of writing
<BlaXpirit>
if there is a way to manually invoke garbage collection when you want, then it's all good
<BlaXpirit>
otherwise you can't say there are no problems
<blassin>
I think *serious* gamedev keeps an eye on object allocation count
<blassin>
that kinda mitigates GC issues
<BlaXpirit>
then again a ton of games are written in c#
<BlaXpirit>
which is garbage collected
<BitPuffin>
blassin: maybe if you mix it with C or something then. But on its own probably not, though I guess it could work for the type of games where C# is sufficient, but for larger games probably not
<blassin>
I think a lot of big games are written in C#
<blassin>
maybe not FPSs
<blassin>
but for sure big codebases
<BlaXpirit>
oh FPSs too, why not
<BitPuffin>
most games written in C# are Unity games
<BlaXpirit>
yes
<BlaXpirit>
and their performance sucks usually
<BitPuffin>
yep
<blassin>
well, I see FPSs as hugely optimized ASM codebases :D
<BlaXpirit>
but you can't say it can't be done
<BitPuffin>
FPS has little to do with it
<BitPuffin>
or do you mean first person shooter
<BitPuffin>
:P
<blassin>
I think because a lot of Unity games use JS for component logic instead of C#
<BitPuffin>
You wouldn't write say The Witcher 3 in C#
<BlaXpirit>
blassin, what changes because of that?
<BlaXpirit>
JS is much slower btw
<blassin>
I see JS as more problematic (performance wise) than C#
<BlaXpirit>
ok
<blassin>
might give Unity games a bad rep
<BitPuffin>
the JS in unity is not even Javascript
<BlaXpirit>
oh yeah, thanks for reminding me why i avoid Unity at all costs
<blassin>
but OTOH there's a lot more code to learn from in JS
<BitPuffin>
it's pretty much as fast as C#, as it just becomes mostly equivalent CLR IR
<BitPuffin>
it's technically called "UnityScript"
<blassin>
I like tools like Unity
<blassin>
gives people power
<blassin>
POWER TO THE PEOPLE :D
<BitPuffin>
I use unity for my day job and it sucks :P
<blassin>
even if the frame rate sucks, they move on to bigger things
<BitPuffin>
it's relatiely ok for prototyping
<blassin>
BitPuffin: in absolutely terms, yeah maybe it sucks - but it's a great tool for n00bs
<BitPuffin>
yeah, and prototyping :P
<blassin>
and for quick protos
<blassin>
yeah
<BitPuffin>
but too many people choose the engine for quite ambitious projects
<BitPuffin>
I wouldn't have chosen this engine for the project I'm paid to work on
<blassin>
usually n00bs are ambitious :D
<BitPuffin>
yeah that's true
<blassin>
first project: pong, second: The Witcher IV with better graphis
<blassin>
*graphics
<BitPuffin>
Fairly accurate :P
<blassin>
I see that with the coders I coach for Rails work
<blassin>
first thing: a "blog"
<blassin>
second: Facebook with video chat
<BitPuffin>
hehe
<blassin>
(actually happened)
<BitPuffin>
yeah not doubting that
<blassin>
it's what you get when n00bs get instantly empowered
<blassin>
a fine line to thread on for educators :/
<BitPuffin>
that's why you give the noobs C xD
<blassin>
I kinda prefer coaching them on web basics first now
<blassin>
as to get them to understand "scope"
<BitPuffin>
let them leak all of the memory
<BitPuffin>
_all_ of it
<BitPuffin>
when you add * to a struct type you get a Pointer(StructType) ?
<jhass>
yes, Foo* is syntax sugar for Pointer(Foo)
<jhass>
regardless whether Foo is a struct, class or C struct
<jhass>
or enum even I guess
<BitPuffin>
if you call out to C malloc does the returned pointer then bypass the GC? so that I can free it manually with C free
<jhass>
the GC integration is not all that complicated
<BitPuffin>
I guess then you probably could call out to C a minimal amount and manage your own memory
<BitPuffin>
without the GC "trying" to gc it
<jhass>
yes, that's what I meant with there are ways around it. It just doesn't fit well into the language
<BitPuffin>
right
<jhass>
also keep in mind that struct (everything descending from Value in fact) is stack allocated
<BitPuffin>
you'd probably have to write sort of an alternative stdlib I guess if you want to for example stay entirely GC free
<BitPuffin>
Yeah I noticed that
<BitPuffin>
unless you use a Pointer(Value)
<BitPuffin>
well, allocate with that
<jhass>
yup
<BitPuffin>
you can get a pointer to a stack thingy
<BitPuffin>
I guess the problem then becomes that there's no way to really implement your own smart pointers for example if you want something close to GC but not entirely like GC, then again C doesn't let you do that either so not much lost :)
<BitPuffin>
was just thinking compared to other fairly low-level focused languages
<jhass>
dunno, maybe you actually could hook into the GC callbacks
<BitPuffin>
yeah but then you're still using the GC :D
<jhass>
no check my link to the null GC
<BitPuffin>
I guess I meant something somewhat concrete and predictable like oh this method is always called when you go out of scope etc
<BitPuffin>
oh! that was another GC? din't know it was "pluggable"
<jhass>
mmh, but yeah we actually don't have "out of scope" hooks
<jhass>
just allocation hook
<jhass>
s
<jhass>
but yes it's pluggable and essentially down to defining the functions you see at the top
<BitPuffin>
can you use different GC per object? :P
<jhass>
you could override it's new with and not call allocate I guess
<BitPuffin>
ah, so that's per type then, not per instance
<BitPuffin>
unless you make a constructor that takes a GC or something
<jhass>
yeah or different .new's
<jhass>
could monkeypatch those into Reference even I guess
<jhass>
(crystal has an open class model)
<BitPuffin>
well actually, couldn't you just have a generic method or something in the GC that will allocate the type in that specific GC?
<BitPuffin>
and call initialize for you
<jhass>
but yeah, .new boils down to def self.new(*args); obj = allocate; obj.initialize; obj; end;
<jhass>
and I guess allocate boils down to def self.allocate; __crystal_malloc(sizeof(self)) as self or something
Renich has joined #crystal-lang
<BitPuffin>
yeah, so if you instead say (don't know this language so excuse my pseudo-syntax) MyGC.create<Foo>()
<BitPuffin>
which does the allocate step for you, and calls Foo.initialize
<jhass>
problem with that is that it'll return a union of all types you call it for
<BitPuffin>
oh :P
<BitPuffin>
so it's not like templates then it's some weird single function thing
<jhass>
yeah there are no generic functions. Yet.
<jhass>
only generic classes (and structs)
<jhass>
mmh, or actually
havenwood has joined #crystal-lang
<BitPuffin>
ah so when you'd add generic functions the above would work?
<jhass>
BitPuffin: everywhere where something could either have type A or type B, the type inference creates a new type A|B which you can only call common methods on or need to resolve using .is_a? and similar. That's called a union
<BitPuffin>
yeah I know what unions are
<BitPuffin>
I was just confused why it would opt for unions rather than generating functions
<BitPuffin>
I guess in order to avoid code bloat or something?
<jhass>
well it looks like I was mistaken on that, sorry
<BitPuffin>
ah I guess this has more to do with error checking rather than code gen
<BlaXpirit>
uhh no
<BlaXpirit>
it can't branch off into entirely different functions every time there is a branch in code
<BlaXpirit>
and the types are often only known at runtime anyway
<BitPuffin>
well no not every time there's a branch in code
<BitPuffin>
but in the case of generic types you can
<BlaXpirit>
BitPuffin, do you know what generics are in other languages? (if so, name one you're familiar with)
<BitPuffin>
well I believe the difference between templates and generics are basically that generics don't generate code for each type instance
<BitPuffin>
but some languages have started doing that anyway and still call it generics
<BitPuffin>
I believe Nim's generics are actually more like templates for example, but they still call them generics.
<BitPuffin>
I guess in order to avoid the terror in people's hearts when they hear the word templates
<BlaXpirit>
BitPuffin, oh if you know Nim, then the situation in case of function arguments is the same here
<BitPuffin>
I haven't kept up with Nim, I used to use it a bit when it was still nimrod
<BlaXpirit>
you don't have to specify types in functions at all. every instantiation of a function will generate separate code
<jhass>
actually we do have fun's and it's especially not true for them :P
<BitPuffin>
I don't think Nim does RTTI, unless you create an ADT
<BlaXpirit>
:|
<jhass>
>> fun foo(a); a; end; foo(1); foo("foo"); typeof(foo(:foo))
<DeBot>
jhass: Syntax error in eval:4: expecting token ':', not ')' - http://carc.in/#/r/e5e
<jhass>
right and no type inference there either I guess
<BitPuffin>
they do have type inference
<jhass>
I mean funs
<BitPuffin>
ah
<BitPuffin>
:P
<BlaXpirit>
waaaaait a second
<BlaXpirit>
what is `fun` and why do i not know this
<BitPuffin>
but yeah so what I mean is that if I do something like this in nim: `proc foo[T](a T): T = ...`
<BitPuffin>
then each call to foo will generate a new function
<BitPuffin>
well
<BitPuffin>
not each call
<BitPuffin>
but each different type for a
<BlaXpirit>
def foo(a: T): T
<BlaXpirit>
i think this is equivalent crystal
<jhass>
BlaXpirit: it generates a function, very similar (I think the goal is to be compatible) with what a C function would generate
<BlaXpirit>
but u can also just write def foo(a)
<BitPuffin>
so if I call that foo(1) and foo("hello") it will not create a union?
<BlaXpirit>
hahahaaa this will happen once in a lifetime. i understand something better than jhass
<BitPuffin>
I think I'm both more confused and more informed than when we started :P
<jhass>
mmh, I guess I wrongly pictured that behavior as a union, handling it is the same anyway
<BlaXpirit>
BitPuffin, read the docs already :p
<BitPuffin>
I did read that thing :P
<BlaXpirit>
jhass, in this case 2 separate functions are generated
<BlaXpirit>
foo-for-int32 and foo-for-string
<jhass>
yeah, realized that now
daveshah has joined #crystal-lang
<BlaXpirit>
BitPuffin, don't worry about these unions. basically if we compare it to Nim, the situations in which unions appear wouldn't even be possible to achieve in Nim
<BitPuffin>
okay so, if you have a class with an instance variable, that will become a union for all the different types you initialize it with, and then each method that uses that variable and returns something which has little to do with the type of the instance variable itself but is a fairly concrete value that you can get from pretty much any version of the instance variable because that type has a method shared between all tho
<BitPuffin>
the same thing, then you'll get a generated method for each type of that instance variable?
<BlaXpirit>
because in most compiled languages you have to specify the type of a variable and it never changes (and unions are annoying to work with)
<BitPuffin>
but of course, if you retern the variable itself then I guess you'd need to get the union, because it could be many different things
<BitPuffin>
that was worded horribly :P but I hope it made sense?
<BlaXpirit>
BitPuffin, i think there will be only one method generated, only for the union
<BitPuffin>
hmm
<BitPuffin>
ah maybe
<BitPuffin>
but okay
<BitPuffin>
so say I have def foo(a)
<BitPuffin>
and foo uses the union'd instance variable
<BitPuffin>
I do get a different foo for each type of a I pass right?
<BitPuffin>
(codegen wise)
<BlaXpirit>
BitPuffin, there are compiletime types and runtime types
<BlaXpirit>
the type Int32|Int64 is a compile time type. it can hold runtime values of types Int32 or Int64
<BitPuffin>
but basically crystal seems to be doing implicit ADTs
<BlaXpirit>
but if you pass a value that has a compiletime type Int32|Int64 then that's the type that the function will be generated for
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BitPuffin>
oh what's the license of crystal btw
<jhass>
Apache 2
<BitPuffin>
hm
<BitPuffin>
okay
<BitPuffin>
I guess that works
<BitPuffin>
at least it ain't gpl :)
<jhass>
yeah, it doesn't infect any code you write or the binaries generated afaik
<BitPuffin>
no I believe it doesn't
<jhass>
basically MIT + patent waiver
<BitPuffin>
I wonder how it manages to be so long then
<BitPuffin>
anyway, I usually go CC0 because I'm a public domain freak
<jhass>
patent law sucks :P
<jhass>
even the full CC0 is quite long
<jhass>
since you can't legally give up your copyright (well, not the right term always but the best english has) in some countries
<BitPuffin>
Yeah, it is pretty long
<BitPuffin>
but it is possible to read it to the end without dying
<jhass>
just grant all usages
<BitPuffin>
ideally I'd like to just say "this software is public domain" or something short like that
<BitPuffin>
but then I'd be alienating some countries
<jhass>
if there's something like that forbidding military use I'd probably opt for that
kyrylo has quit [Ping timeout: 244 seconds]
<BitPuffin>
though sometimes I say something like "This software is public domain but if that's not sufficient you may use CC0 (see CC0.txt in project root)"
<BitPuffin>
that way I can be both an idealist and pragmatist all in one
Ven has joined #crystal-lang
<BitPuffin>
jhass: I don't see a reason to legally try to enforce what anyone can do with things I make public
<jhass>
you don't want to know how much OSS is in the US drones ...
<BitPuffin>
probably a hole ton
<BitPuffin>
but like
<BitPuffin>
otherwise they'd just put proprietary code in there :P
<BitPuffin>
and that they might contribute some bugfixes upstream to OSS as a result of using OSS is better than them writing their own proprietary code or something
<BitPuffin>
I dunno
<BitPuffin>
I'd rather have them not have the drones of course
<BitPuffin>
but I don't think preventing them from using your code will achieve that
<jhass>
sure, but why not make them burn as much money in the process as possible. No reason I should make it easier or more economic for them
<BitPuffin>
ehh, you don't really want to feed the mililitary industrial complex with even more reasons to raise their budget
<BitPuffin>
but yeah I see your reasoning a little bit, but I don't think that's the way to stop them
<jhass>
it's not about stopping them really
<BitPuffin>
it's about giving them the finger? :)
<jhass>
there's a huge ethical component to your code supporting murder
<BitPuffin>
not really, the responsibility is on the person using the code for killing
<jhass>
that's the old anit gun law logic
<BitPuffin>
you mean guns don't kill people people do?
<jhass>
yes
<jhass>
I don't fully agree with it
<BitPuffin>
well it's pretty true at least
<BitPuffin>
also guns are a much more direct way of killing someone
<BitPuffin>
than code
<jhass>
but there's no reason to make it as hard as possible
<jhass>
*not to make it
<jhass>
sigh
<BitPuffin>
sure there is, you're supporting copyright / patent law which is terrible
<BitPuffin>
and makes things complicated
<jhass>
copyright is a terrible term :/
<jhass>
german law has a nicer definition there, basically the "rights of the creator"
<jhass>
which you can't give up
daveshah has quit []
<jhass>
so as a German I'm only granting usage rights, one being the right to copy at all, I can't give up my "rights of the creator" though
<jhass>
and all I'm saying is that I don't want to give out those usage rights to military purposes
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vZLtm
<crystal-gh>
crystal/master 918b655 Ary Borenszweig: Added `ArrayLiteral#includes?(obj)` in macros
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
ponga has joined #crystal-lang
leafybasil has quit [Ping timeout: 240 seconds]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<BitPuffin>
jhass: Yeah I think sweden has a similar thing probably. Where you can grant usage rights and even waive copy rights probably but you can't remove yourself as the "author" sort of
BitPuffin has joined #crystal-lang
<jhass>
you broke my weechat oO
<BitPuffin>
jhass: Yeah I think sweden has a similar thing probably. Where you can grant usage rights and even waive copy rights probably but you can't remove yourself as the "author" sort of
<BitPuffin>
(sorry if I sent this 3 times before I'm having connectivity issues)
<BitPuffin>
jhass: anyway I sympathize with your aspirations to prevent military use but I think in the end it is probably harmful in other ways as it enables things that you might for example not want to exist and suddennly you're relying on evil to prevent evil
<BitPuffin>
and then you find yourself unable to remove an evil because that will enable the evil you wanted to prevent earlier
<BitPuffin>
that's what I think anyway
kulelu88 has joined #crystal-lang
<BitPuffin>
I guess sometimes using a lesser evil to prevent a greater evil is a valid compromise depending on how much of an idealist you are :)
<dyulax>
symbols does not respond to "object_id"... is it a bug or there is a reason for this?
<dyulax>
my issue is that a C function requires a UInt64... in a Ruby binding for this function, they use xxx.object_id and work with symbols everywhere... in Crystal symbol is not an object, so I guess I won't allow it
<BlaXpirit>
dyulax, please don't make this an XY problem :p
<dyulax>
what is a XY problem?
<jhass>
?xy
<DeBot>
jhass: Nothing known about xy.
<jhass>
aw
<jhass>
let me steel one
<jhass>
er, steal even
<BlaXpirit>
?xy=The XY problem is asking about your attempted solution rather than your actual problem.
<jhass>
?foo=it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<DeBot>
jhass: Set foo.
<jhass>
right, it's not my day
<jhass>
?xy=it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<BlaXpirit>
foo?
<DeBot>
jhass: Set xy.
<jhass>
I said it's not my day
<BlaXpirit>
i dunno, the other one is short and to the point
<dyulax>
So this is my problem: I have shapes that collide if they are in the same "layer"... so I assign them to a layer 1, 2, 3.. whatever.. and they only check for collision in the same layer. What I want to do is inform a symbol instead of a number (since they are more descriptive), but I can't convert a symbol into some kind of number.
<dyulax>
shape.layer = :background instead of shape.layer = 0
<dyulax>
under the hood it will call a C function that REQUIRES a number
<dyulax>
I am converting a Ruby gem into a Crystal :-) that's why I have this issue with Symbols... hehehe
<BlaXpirit>
trapped, no, this is not a case for an enum
<dyulax>
I want to keep the API as close as possible
<BlaXpirit>
honestly i would've preferred just numbers
<trapped>
that makes sense, dyulax
<dyulax>
the original accepts any object, but now I will limit to Symbols and use to_i
<BlaXpirit>
i can do whatever i want with numbers
<trapped>
jhass: i have seen that page
<dyulax>
thank you guys, sorry for asking stupid questions
<BlaXpirit>
but with symbols i cannot dynamically make layers
<jhass>
dyulax: no worries, you're welcome
<trapped>
at this point i don't see what .clone is actually doing
<thor77>
o.O there's a new api-page
<dyulax>
hmmm...
<BlaXpirit>
in ruby it's OK because you can make a symbol into a number
<BlaXpirit>
uh vice versa
<BlaXpirit>
if i want to name my layers, i make an enum or a constant
<trapped>
i mean, i probably am using subclasses of Object
<jhass>
trapped: Object#clone should probably be abstract too, yeah
<trapped>
it should rather be automatically generated for each class
<trapped>
i would've expected it to be somewhat like a memcpy of a struct
<trapped>
whereas .dup would be user defined
<jhass>
it's a bit tricky to do due to macro defs not inferring return type and having no "definition is final" point
<trapped>
can't it be generated at the latter codegen pass instead of the macro expansion pass?
<trapped>
i mean, i don't know how the crystal compiler actually works, but i would assume that when it starts spewing llvm ir it should already have inferred enough types
<jhass>
problem is that you don't want a mindless deep copy
<BitPuffin>
are builds of crystal provided?
<jhass>
you don't want to just copy file descriptors and stuff like that
<BitPuffin>
oh hmm
<jhass>
BitPuffin: sure, it's self hosted, you'd have no way to compile crystal otherwise ;)
<BitPuffin>
I don't have time to download llvm and compile that now, was hoping I could get a build and docs to toy with on the bus
<BitPuffin>
I'll save it for another day :D
<jhass>
well, get a VM?
<trapped>
jhass: why not? isn't it considered to be unsafe?
<BitPuffin>
well that's still too much setup for me to be able to toy with on the bus since I'm leaving now xD
<jhass>
trapped: say you copy a file instance and call close on one, the other continues to think it's still open
<jhass>
and that's just a simple example
<jhass>
BitPuffin: mmh, one should always have at least a linux VM :P
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vZL07
<crystal-gh>
crystal/master 1a08879 Ary Borenszweig: Fixed #1406: Wrong error message when overload is not found on a method that's an implementation of an abstract method
<BitPuffin>
jhass: true :P
<BitPuffin>
anyway g2g see you guys some other time
BitPuffin has quit [Ping timeout: 246 seconds]
<travis-ci>
manastech/crystal#1a08879 (master - Fixed #1406: Wrong error message when overload is not found on a method that's an implementation of an abstract method): The build passed. https://travis-ci.org/manastech/crystal/builds/79168748
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vZLg4
<crystal-gh>
crystal/master 705c951 Ary Borenszweig: Simpler code for previous commit
leafybasil has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
<ponga>
jhass: what linux distro are you on?
<jhass>
arch
<ponga>
cool, i wish i knew how to manage arch
<sardaukar>
has anyone tried to create a daemon in Crystal?
<sardaukar>
but for a language that can create binaries...?
<jhass>
all the external references in that blog post address things like your database, webserver and whatever, anything really
<jhass>
I'm looking forward to Gnome finally fully switching to full systemd user sessions so I can replace all the autostart madness with properly supervised processes
waterlink has joined #crystal-lang
<sardaukar>
well, there's no way to do setsid() in Crystal anyway :/
<sardaukar>
jhass: if I contributed a Daemon module to Crystal's stdlib, would it be rejected?
<jhass>
tbh I'd argue against it
<jhass>
but I'm not to decide ;)
<sardaukar>
I see
<sardaukar>
I find it appealing for ease of distribution and use
<sardaukar>
until supervisors get a standard or something, configuring a process under them is a pain
<jhass>
well, systemd kind of is getting a standard
<sardaukar>
the flamewars over that will never subside :D I doubt a standard behind it will gain any traction
<sardaukar>
and the definition DSL for systemd seems open for change a lot
<jhass>
mmh, no it actually doesn't change much, didn't notice a single change in fact. Just additions ;)
<sardaukar>
riiiight :D
<jhass>
they take some care in having what they add cover everything it should cover
<jhass>
and to arrive at some strong opinion on what it should cover, so changing it becomes less likely
<sardaukar>
I'm a fan of systemd, but it's a tough one
<sardaukar>
one of the reasons Linux thrives is because of its tinker-friendliness
<sardaukar>
systemd heralds a new era of more standardized systems
<sardaukar>
that some ppl are having a tough time accepting :/
<jhass>
sure, it's doing things differently than what people got used to
<jhass>
that'll always produce rejection, humans just work that way
<sardaukar>
being from the same guy as PulseAudio doesn't help, either
<jhass>
in its extremes that's where racism comes from
<ponga>
well, getting Asian langs to work on Linux is still a pain in an arse
<ponga>
;(
<sardaukar>
I can imagine
<ponga>
sardaukar: my case, is that, I'm trilingual who want my OS to funtion both Japanese and Korean, trouble is the best input system for each is usually different package, so its hard to switch around
<ponga>
Its a biggest reason i stick to OSX
<ponga>
standardised multilingualism
<sardaukar>
and I'm sure most open-source CJK fonts are not that good
<jhass>
well, I'm German but I just keep my systems set to English everywhere except timezone and keyboard
<sardaukar>
QWERTZ - so weird! :D
<jhass>
the translations just make 70% of all error messages meaningless or confusing
<sardaukar>
I'm Portuguese, same issue
<ponga>
jhass: true, but im mostly talking about input system here
<sardaukar>
but I like US keyboards - good for coding
<jhass>
I meant to learn Neo2 but it slows me down too much so I always switch back :/
<ponga>
good thing is that kor/jap keyboard layout is identical to US
<ponga>
thank god, if otherwise, i'd have hung myself a long time ago
<sardaukar>
that's good - PT is almost the same, but the ;: key is ç instead!
<sardaukar>
a whole key for such a rare character!! :D
<ponga>
as i always say, you euros and your roman alphabet clash
<ponga>
lol
n0xff has joined #crystal-lang
dyulax has quit [Quit: This computer has gone to sleep]
dyulax has joined #crystal-lang
<crystal-gh>
[crystal] jhass opened pull request #1407: Let loop yield the iteration count (master...loop_index) http://git.io/vZLS2
BlaXpirit has quit [Quit: Konversation]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vZLFz