jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.8.0 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
Philpax_ has joined #crystal-lang
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
nakilon has quit [Ping timeout: 256 seconds]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo_ has joined #crystal-lang
rmosolgo has quit [Read error: Connection reset by peer]
rmosolgo_ has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Read error: Connection reset by peer]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Read error: Connection reset by peer]
<crystal-gh> [crystal] jreinert opened pull request #1603: add byte_format decoding support and specs (master...byte-format-decoding) http://git.io/vnxak
ozra has quit [Ping timeout: 246 seconds]
jeromegn has quit [Ping timeout: 250 seconds]
sfcgeorg_ has quit [Quit: Textual IRC Client: www.textualapp.com]
feifan has quit [Quit: Lingo: www.lingoirc.com]
willl has quit [Quit: Connection closed for inactivity]
rmosolgo has joined #crystal-lang
NeverDie has quit [Quit: http://radiux.io/]
NeverDie has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Ping timeout: 260 seconds]
NeverDie has quit [Quit: http://radiux.io/]
gamemanj has joined #crystal-lang
BlaXpirit has joined #crystal-lang
havenwood has joined #crystal-lang
sdogruyol has joined #crystal-lang
<sdogruyol> morning
sdogruyol has quit [Remote host closed the connection]
sdogruyo_ has joined #crystal-lang
sdogruyo_ has quit [Remote host closed the connection]
Philpax_ is now known as Philpax
ljfa has joined #crystal-lang
ljfa has quit [Client Quit]
sstarr has joined #crystal-lang
<Papierkorb> Any idea how to incorporate the Autobahn Test Suite for websockets?
sdogruyol has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
havenwood has quit [Ping timeout: 260 seconds]
apt-get has joined #crystal-lang
sdogruyol has quit [Remote host closed the connection]
sdogruyol has joined #crystal-lang
sfcgeorge has joined #crystal-lang
<Papierkorb> jhass: Opened a issue regarding a case-insensitive comparison function https://github.com/manastech/crystal/issues/1604
<Papierkorb> >> nil.to_s
<DeBot> Papierkorb: # => "" - http://carc.in/#/r/h2q
thor77 has left #crystal-lang ["Leaving"]
<Papierkorb> >> require 'json'; JSON.parse '{ "foo": 123 }'
<DeBot> Papierkorb: Syntax error in eval:20: unterminated char literal, use double quotes for strings - http://carc.in/#/r/h2r
<Papierkorb> >> require 'json'; JSON.parse "{ \"foo\": 123 }"
<DeBot> Papierkorb: Syntax error in eval:20: unterminated char literal, use double quotes for strings - http://carc.in/#/r/h2s
<gamemanj> >> require "json"; JSON.parse "{ \"foo\": 123 }"
<DeBot> gamemanj: in line 20: can't require dynamically - http://carc.in/#/r/h2v
<BlaXpirit> gamemanj, bot is broken because of changes in the language
<BlaXpirit> jhass, please investigate. you may just need to add requires to that list
<Papierkorb> Would anyone be unhappy if I'd reimplement websockets from scratch?
apt-get has quit [Ping timeout: 268 seconds]
<sdogruyol> :D
<sdogruyol> Papierkorb: no
<sdogruyol> Papierkorb: we'd be happy :P
sdogruyol has quit [Remote host closed the connection]
<sstarr> hello, I'm taking a look at crystal for the first time today and running through some tutorials but I've run into an issue
<sstarr> I'm using this guide to install crsfml - http://blaxpirit.github.io/crsfml/tutorials/crsfml-install.html
<Papierkorb> BlaXpirit: ^
<sstarr> I've got csfml installed and the C test program works
<sstarr> but when I create a Projectfile and run `crystal deps`, I get this error: could not locate shard.yml
trapped has joined #crystal-lang
grindhold_ has joined #crystal-lang
Philpax_ has joined #crystal-lang
ozra has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
<BlaXpirit> sstarr, yeaah... that needs updating
<BlaXpirit> because crystal 0.8.0 dropped this mechanism in favor of a new one
<Papierkorb> is there some primitive to convert Big-Endian to the host endianess?
<BlaXpirit> Papierkorb, something something https://github.com/manastech/crystal/search?q=htons
<BlaXpirit> which probably means that there is no such primitive :o
<BlaXpirit> because only the one for uint16 is defined
<sstarr> oic, so I need a shard.yml instead of a Projectfile?
<Papierkorb> Endian.to_big_endian(val : T) : T would be nice ..
<Papierkorb> and vice-versa
<BlaXpirit> sstarr, yeah.
<BlaXpirit> i haven't taken the time to learn this new system yet
<sstarr> ok, I'll have a go at getting it to work and open a pull request if I'm successful :)
<BlaXpirit> would be great, sstarr
sdogruyol has joined #crystal-lang
sdogruyol has quit [Client Quit]
<BlaXpirit> lol installing shards is such a PITA
<BlaXpirit> i could understand it if crystal repository provided it
<BlaXpirit> sstarr, i'm gonna update it myself
<BlaXpirit> for now, here is shard.yml https://bpaste.net/show/db82782f3f7c
grindhold_ has quit [Read error: Connection reset by peer]
apt-get has joined #crystal-lang
oleh has joined #crystal-lang
pawnbox has joined #crystal-lang
<oleh> hi all
<oleh> how to specify the llvm options when I compile program?
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
leafybasil has quit [Ping timeout: 264 seconds]
<sstarr> BlaXpirit: great, thanks :)
jeromegn has joined #crystal-lang
Doug_ has joined #crystal-lang
<Doug_> Is there a list of "magic" constants like __LINE__, __FILE__, etc?
jeromegn has quit [Ping timeout: 246 seconds]
<Doug_> cool thanks. __LINE__ __FILE__ __DIR__ i don't see anything like __METHOD__ or __MODULE__ is/could that be a thing?
greengriminal has joined #crystal-lang
sferik has joined #crystal-lang
willl has joined #crystal-lang
apt-get has quit [Ping timeout: 250 seconds]
ssvb has quit [Ping timeout: 246 seconds]
leafybasil has joined #crystal-lang
Philpax_ is now known as Philpax
<dzv> waj: when you changed from GC.malloc to mmap did you see a performance increase? you said malloc zeroes mem, but so does mmap.
kulelu88 has joined #crystal-lang
kulelu88 has quit [Read error: Connection reset by peer]
havenwood has joined #crystal-lang
<travis-ci> rhysd/crystal#5e9d813 (master - Fixed samples/2048.cr): The build passed. https://travis-ci.org/rhysd/crystal/builds/82289674
ssvb has joined #crystal-lang
<jokke> hey
<jokke> i'm having trouble with implementing SliceIO
<jokke> the specs at the top
<jokke> for some weird reason the latter works wheras the first doesnt
<jokke> weird because isn't the latter exactly what would happen if i use <<?
<jokke> io << "foo" => "foo".to_s(io) => io.write(Slice.new("foo".cstr, "foo".bytesize))
<BlaXpirit> what's the point
<jokke> point in what?
<BlaXpirit> in making a class that has a subset of functionality of what is in standard library
<jokke> oh SliceIO is already implemented?
<jokke> the issue is still open
nietzschette has joined #crystal-lang
<BlaXpirit> jokke, use StringIO if possible
<jokke> what?
<jokke> why would i do that?
<jokke> SliceIO has it's clear benefits over StringIO
<jokke> there are tons of use cases for SliceIO
<jokke> so you can't tell me what the problem might be here?
<jokke> BlaXpirit: as for your question about endianness look into io/byte_format.cr
<jokke> also #1603
<DeBot> https://github.com/manastech/crystal/pull/1603 (add byte_format decoding support and specs)
<crystal-gh> [crystal] rhysd opened pull request #1606: Add --no-color option to `crystal spec` subcommand (master...spec-no-color) http://git.io/vnhYL
<nietzschette> when I make from git clone, bash gives me: --cxxflags: command not found. I'm assuming llvm is not correctly set up?
<jokke> Papierkorb: you too
<Papierkorb> jokke: mh?
<dzv> how do you create a packed struct?
<jokke> #1603
<DeBot> https://github.com/manastech/crystal/pull/1603 (add byte_format decoding support and specs)
<jokke> dzv: what do you mean?
<jokke> dzv: i'd create a to_io method
<jokke> for that struct
<jokke> and a bytesize method maybe
<jokke> then use SliceIO.new(struct.bytesize).read_object(struct)
<jokke> but that won't work yet
<jokke> :>
<jokke> read_bytes would work though
<dzv> i'm using mmap so can't use io methods
<jokke> mmap?
<dzv> yes
<jokke> hmm yeah?
<jokke> i don't see the problem
<Papierkorb> Tbh, for me the discussion in the PR is a bit confusing. To me, read_bytes and read_object are fundamentally different things. The first reads bytes (Most likely into a Slice(UInt8)), where the latter does some kind of mapping from the object into (or from) the IO. Why not have both? Both make sense. And expecting the Object to respond to to_io and from_io sounds reasonable to me
<jokke> Papierkorb: yeah, that's why i'm pleading for read_object
<jokke> and write_object
<Papierkorb> So, with that, Slice(T) could also provide to_/from_io. In this case, both read_bytes and read_object (and the write_*) make sense: I could imagine the Slice to prepend its length into the IO, so I can easily read it read_object it later again
<Papierkorb> Both methods have their valid purpose to me
<jokke> mmh
<Papierkorb> So io.write_object some_slive # => [Int32][UInt8 data ...]
<Papierkorb> and io.write_bytes some_slice # => [UInt8 data ...]
<crystal-gh> [crystal] benoist opened pull request #1607: require http server to be initialized with host (master...master) http://git.io/vnh3I
pawnbox has quit [Remote host closed the connection]
<Papierkorb> jokke: Should I post that into the PR?
<dzv> the reason slices are used instead of array's is? the overhead different should be tiny
<jokke> dzv: why can't you write your struct to a slice io and then take the pointer of the slice and pass it to mmap
<jokke> Papierkorb: sure!
<Papierkorb> dzv: Slice is dynamic in length, where as a StaticArray is static in length
<dzv> because i'm going the other way. the data is coming from mmap and i need to put it in a struct
<Papierkorb> dzv: tbh on that note, a StaticSlice would be interesting :>
grindhold has joined #crystal-lang
<Papierkorb> dzv: though iirc StaticArray already does basically that in its #to_slice
<jokke> dzv: ok, so you have a pointer. make a slice out of it, pass it to slice io and read your struct
<dzv> when did slice length become dynamic?
<jokke> dzv: ah you don't know the lenght
<jokke> h
<BlaXpirit> Papierkorb, whaaaaaaaaaaaaaaat you're talking nonsense
<Papierkorb> Err i mean slice is runtime allocated?
<BlaXpirit> oh ok
<jokke> dzv: there's pointer_io too
<jokke> so any clues to my problem regarding the two specs?
<dzv> ok, so i can use PointerIO or slice.copy_from directly. that still doesn't solve my packing problem
nietzschette has quit [Quit: Nettalk6 - www.ntalk.de]
<jokke> dzv: is the struct a c struct, you're trying to read?
<dzv> yes
<jokke> ok
grindhold has quit [Ping timeout: 264 seconds]
<jokke> does it have any pointers?
<dzv> no
<jokke> ok that's fairly easy then. just read the values in the order of the definitions of the struct members
<jokke> iirc structs are stored that way
<dzv> i'm aiming for zero copy. that's why i mmaped the file
<jokke> hmm
<jokke> what about foo = (pointer as Pointer(Int32)).value
apt-get has joined #crystal-lang
<jokke> does that copy?
<jokke> probably does
<jokke> dunno if there's a possibility to claim a pointer by some object so that it's being managed by the GC
oleh has quit [Ping timeout: 240 seconds]
<BlaXpirit> i don't think it copies
apt-get has quit [Quit: Quit]
apt-get has joined #crystal-lang
apt-get_ has joined #crystal-lang
apt-get has quit [Ping timeout: 250 seconds]
grindhold has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
leafybas_ has joined #crystal-lang
leafybasil has quit [Ping timeout: 240 seconds]
leafybas_ has quit [Ping timeout: 246 seconds]
rmosolgo has joined #crystal-lang
NeverDie has joined #crystal-lang
greengriminal has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greengriminal has quit [Client Quit]
havenwood has quit [Ping timeout: 252 seconds]
sferik has joined #crystal-lang
pawnbox has joined #crystal-lang
oleh has joined #crystal-lang
oleh has quit [Client Quit]
<crystal-gh> [crystal] jreinert opened pull request #1608: add SliceIO Implementation with specs (master...slice-io) http://git.io/vnhED
<grindhold> how do i cast a string of which i am sure that it only contains digits to Int32
<grindhold> as does not worlk
<grindhold> *the keyword "as"
Philpax has quit [Ping timeout: 240 seconds]
havenwood has joined #crystal-lang
<jokke> (string.pointer as Pointer(Int32).value maybe
<jokke> if i understood you correctly
<jokke> if your string looks like this "123", then just use .to_i
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
leafybasil has joined #crystal-lang
<crystal-gh> [crystal] technorama opened pull request #1609: New class Mmap. (master...f/mmap) http://git.io/vnhaB
willl has quit [Quit: Connection closed for inactivity]
apt-get__ has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apt-get_ has quit [Ping timeout: 272 seconds]
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
<crystal-gh> [crystal] adlerhsieh opened pull request #1610: Add methods documentation to File class (master...master) http://git.io/vnhMv
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
<jokke> quiet here today2
<jokke> -2
rmosolgo has quit [Remote host closed the connection]
nietzschette has joined #crystal-lang
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
jeromegn has joined #crystal-lang
<crystal-gh> [crystal] kostya opened pull request #1611: add Enumerable#pmap (master...pmap) http://git.io/vnjee
rmosolgo has joined #crystal-lang
apt-get__ has quit [Quit: Quit]
apt-get has joined #crystal-lang
tomchapin has joined #crystal-lang
tomchapin has quit [Client Quit]
tomchapin has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_jungh4ns has quit [Read error: Connection reset by peer]
rmosolgo has quit [Remote host closed the connection]
<jhass> nietzschette: check you have llvm-config
<nietzschette> llvm-config command not found!
pragmatism has joined #crystal-lang
<jhass> you might need some llvm-devel package or whatever I guess
<jhass> BlaXpirit: it's raised before the macro is called :(
<jhass> asterite: http://carc.in/#/r/h31 my macro workaround fails at requires :/
<nietzschette> yeah, that's what I was thinking, jhass
<nietzschette> I've about had it with windows - I think i'm going back to linux here soon
rmosolgo has joined #crystal-lang
<jhass> uh, crystal is not supported on windows
<nietzschette> well, I'm trying to see how deep I can get with Msys
<nietzschette> not very
<nietzschette> it would seem
<jhass> ?windows
<DeBot> Windows support is currently developed at https://github.com/xwanderer/crystal/tree/win32/win32
<jhass> check the readme
<BlaXpirit> it's dead already :(
<nietzschette> ahh, phewey.
sferik has joined #crystal-lang
<nietzschette> new computer, also new to crystal and was hoping to try it out - but I'll just wait until I re-install with some *nix. If ya'll had a fresh OS to install, what would you recommend? Arch? Debian? mint?
<jhass> if you're familiar with Arch go with that :P
<BlaXpirit> for sure
<jokke> arch++
<jhass> Crystal is in community <3
<jhass> check Antergos for a graphical installer though
<jokke> jhass: O.o
<BlaXpirit> yeah, i didnt believe what i saw :p
<jokke> i'm shocked
rmosolgo has quit [Remote host closed the connection]
<jhass> Arch's install can be overwhelming
<jokke> naaah :>
<jhass> nothing wrong with getting something premade if you feel like it
<BlaXpirit> arch install is fine, the instructions are constantly being made worse
rmosolgo has joined #crystal-lang
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nietzschette has quit [Quit: Nettalk6 - www.ntalk.de]
<trapped> how can i get the raw bytes forming an Int64?
pragmatism has quit [Quit: Textual IRC Client: www.textualapp.com]
n0xff has quit [Ping timeout: 265 seconds]
gamemanj has quit [Ping timeout: 265 seconds]
rmosolgo has quit [Remote host closed the connection]
<pawnbox> Anyone up for helping me out?
<BlaXpirit> that's not how irc works
<pawnbox> BlaXpirit: Ya i kow. :)
<pawnbox> anyways i am having trouble writing specs for a fix.
apt-get has quit [Remote host closed the connection]
<trapped> BlaXpirit: knew about that but was looking for something more generic
apt-get has joined #crystal-lang
<BlaXpirit> trapped, http://carc.in/#/r/h3g
<trapped> hmm
<trapped> thanks
<BlaXpirit> trapped, can also do a cast through pointers but it byte order is architecture dependent
<BlaXpirit> -it
rmosolgo has joined #crystal-lang
<trapped> BlaXpirit: i couldn't get the cast through pointers to work but not because of endianness
<BlaXpirit> trapped, http://carc.in/#/r/h3k so hax :)
<BlaXpirit> should make this use staticarray, but i was unable to
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Read error: Connection reset by peer]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
<rmosolgo> just "finished" (ie, had enough of) my first crystal project
apt-get has quit [Remote host closed the connection]
<rmosolgo> Takeaways: CRYSTAL IS AWESOME <3
apt-get has joined #crystal-lang
<rmosolgo> thanks for making it :)
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
rmosolgo has quit [Remote host closed the connection]
rmosolgo has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
<adam12> rmosolgo: very neat.
pawnbox has quit [Remote host closed the connection]
<rmosolgo> thanks
<rmosolgo> it was great to really try it out, it looked sweet just from reading about it
apt-get has quit [Remote host closed the connection]
<rmosolgo> and it didn't disappoint!
apt-get has joined #crystal-lang
<adam12> I'm finding myself very productive in it. Will be releasing a simple library soon enough.
<adam12> A real joy to use, for sure.
sfcgeorg_ has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
sfcgeorge has quit [Ping timeout: 268 seconds]
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get_ has joined #crystal-lang
apt-get_ has quit [Remote host closed the connection]
apt-get_ has joined #crystal-lang
apt-get_ has quit [Remote host closed the connection]
apt-get_ has joined #crystal-lang
apt-get has quit [Ping timeout: 240 seconds]
apt-get_ has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
apt-get has quit [Remote host closed the connection]
apt-get has joined #crystal-lang
BlaXpirit has quit [Quit: Konversation]
apt-get has quit [Ping timeout: 250 seconds]
tomchapin has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Raimondii is now known as Raimondi