00:05
Philpax_ has joined #crystal-lang
00:06
rmosolgo has joined #crystal-lang
00:12
rmosolgo has quit [Remote host closed the connection]
00:13
nakilon has quit [Ping timeout: 256 seconds]
00:21
rmosolgo has joined #crystal-lang
00:22
rmosolgo has quit [Remote host closed the connection]
00:23
rmosolgo has joined #crystal-lang
00:27
rmosolgo_ has joined #crystal-lang
00:27
rmosolgo has quit [Read error: Connection reset by peer]
00:27
rmosolgo_ has quit [Remote host closed the connection]
00:28
rmosolgo has joined #crystal-lang
00:32
rmosolgo has quit [Read error: Connection reset by peer]
00:33
rmosolgo has joined #crystal-lang
00:33
rmosolgo has quit [Remote host closed the connection]
00:34
rmosolgo has joined #crystal-lang
00:36
rmosolgo has quit [Remote host closed the connection]
00:37
rmosolgo has joined #crystal-lang
00:39
rmosolgo has quit [Read error: Connection reset by peer]
01:05
<
crystal-gh >
[crystal] jreinert opened pull request #1603: add byte_format decoding support and specs (master...byte-format-decoding)
http://git.io/vnxak
01:29
ozra has quit [Ping timeout: 246 seconds]
02:01
jeromegn has quit [Ping timeout: 250 seconds]
02:39
willl has quit [Quit: Connection closed for inactivity]
02:49
rmosolgo has joined #crystal-lang
05:17
NeverDie has joined #crystal-lang
05:22
rmosolgo has quit [Remote host closed the connection]
05:25
rmosolgo has joined #crystal-lang
05:30
rmosolgo has quit [Ping timeout: 260 seconds]
07:26
gamemanj has joined #crystal-lang
07:57
BlaXpirit has joined #crystal-lang
08:01
havenwood has joined #crystal-lang
08:50
sdogruyol has joined #crystal-lang
08:51
<
sdogruyol >
morning
08:59
sdogruyol has quit [Remote host closed the connection]
09:01
sdogruyo_ has joined #crystal-lang
09:27
sdogruyo_ has quit [Remote host closed the connection]
09:37
Philpax_ is now known as Philpax
09:41
ljfa has joined #crystal-lang
09:41
ljfa has quit [Client Quit]
10:16
sstarr has joined #crystal-lang
10:22
<
Papierkorb >
Any idea how to incorporate the Autobahn Test Suite for websockets?
10:23
sdogruyol has joined #crystal-lang
10:25
leafybasil has quit [Remote host closed the connection]
10:25
leafybasil has joined #crystal-lang
10:39
havenwood has quit [Ping timeout: 260 seconds]
10:40
apt-get has joined #crystal-lang
10:48
sdogruyol has quit [Remote host closed the connection]
10:51
sdogruyol has joined #crystal-lang
10:52
sfcgeorge has joined #crystal-lang
10:55
<
Papierkorb >
>> nil.to_s
10:58
thor77 has left #crystal-lang ["Leaving"]
11:00
<
Papierkorb >
>> require 'json'; JSON.parse '{ "foo": 123 }'
11:01
<
Papierkorb >
>> require 'json'; JSON.parse "{ \"foo\": 123 }"
11:04
<
gamemanj >
>> require "json"; JSON.parse "{ \"foo\": 123 }"
11:07
<
BlaXpirit >
gamemanj, bot is broken because of changes in the language
11:07
<
BlaXpirit >
jhass, please investigate. you may just need to add requires to that list
11:15
<
Papierkorb >
Would anyone be unhappy if I'd reimplement websockets from scratch?
11:23
apt-get has quit [Ping timeout: 268 seconds]
11:32
<
sdogruyol >
Papierkorb: no
11:32
<
sdogruyol >
Papierkorb: we'd be happy :P
11:32
sdogruyol has quit [Remote host closed the connection]
11:34
<
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
11:35
<
Papierkorb >
BlaXpirit: ^
11:35
<
sstarr >
I've got csfml installed and the C test program works
11:36
<
sstarr >
but when I create a Projectfile and run `crystal deps`, I get this error: could not locate shard.yml
11:47
trapped has joined #crystal-lang
11:52
grindhold_ has joined #crystal-lang
12:06
Philpax_ has joined #crystal-lang
12:07
ozra has joined #crystal-lang
12:09
Philpax has quit [Ping timeout: 240 seconds]
12:26
<
BlaXpirit >
sstarr, yeaah... that needs updating
12:26
<
BlaXpirit >
because crystal 0.8.0 dropped this mechanism in favor of a new one
12:27
<
Papierkorb >
is there some primitive to convert Big-Endian to the host endianess?
12:30
<
BlaXpirit >
which probably means that there is no such primitive :o
12:30
<
BlaXpirit >
because only the one for uint16 is defined
12:30
<
sstarr >
oic, so I need a shard.yml instead of a Projectfile?
12:30
<
Papierkorb >
Endian.to_big_endian(val : T) : T would be nice ..
12:31
<
Papierkorb >
and vice-versa
12:31
<
BlaXpirit >
sstarr, yeah.
12:31
<
BlaXpirit >
i haven't taken the time to learn this new system yet
12:32
<
sstarr >
ok, I'll have a go at getting it to work and open a pull request if I'm successful :)
12:32
<
BlaXpirit >
would be great, sstarr
12:32
sdogruyol has joined #crystal-lang
12:33
sdogruyol has quit [Client Quit]
12:34
<
BlaXpirit >
lol installing shards is such a PITA
12:35
<
BlaXpirit >
i could understand it if crystal repository provided it
12:37
<
BlaXpirit >
sstarr, i'm gonna update it myself
12:43
grindhold_ has quit [Read error: Connection reset by peer]
12:44
apt-get has joined #crystal-lang
12:59
oleh has joined #crystal-lang
13:00
pawnbox has joined #crystal-lang
13:00
<
oleh >
how to specify the llvm options when I compile program?
13:08
leafybasil has quit [Remote host closed the connection]
13:09
leafybasil has joined #crystal-lang
13:13
leafybasil has quit [Ping timeout: 264 seconds]
13:16
<
sstarr >
BlaXpirit: great, thanks :)
13:17
jeromegn has joined #crystal-lang
13:23
Doug_ has joined #crystal-lang
13:27
<
Doug_ >
Is there a list of "magic" constants like __LINE__, __FILE__, etc?
13:29
jeromegn has quit [Ping timeout: 246 seconds]
13:38
<
Doug_ >
cool thanks.
__LINE__ __FILE__
__DIR__ i don't see anything like
__METHOD__ or
__MODULE__ is/could that be a thing?
13:42
greengriminal has joined #crystal-lang
13:44
sferik has joined #crystal-lang
13:52
willl has joined #crystal-lang
13:57
apt-get has quit [Ping timeout: 250 seconds]
14:05
ssvb has quit [Ping timeout: 246 seconds]
14:07
leafybasil has joined #crystal-lang
14:09
Philpax_ is now known as Philpax
14:17
<
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.
14:27
kulelu88 has joined #crystal-lang
14:28
kulelu88 has quit [Read error: Connection reset by peer]
14:29
havenwood has joined #crystal-lang
14:57
ssvb has joined #crystal-lang
14:58
<
jokke >
i'm having trouble with implementing SliceIO
14:59
<
jokke >
the specs at the top
14:59
<
jokke >
for some weird reason the latter works wheras the first doesnt
14:59
<
jokke >
weird because isn't the latter exactly what would happen if i use <<?
15:00
<
jokke >
io << "foo" => "foo".to_s(io) => io.write(Slice.new("foo".cstr, "foo".bytesize))
15:01
<
BlaXpirit >
what's the point
15:01
<
jokke >
point in what?
15:01
<
BlaXpirit >
in making a class that has a subset of functionality of what is in standard library
15:01
<
jokke >
oh SliceIO is already implemented?
15:02
<
jokke >
the issue is still open
15:02
nietzschette has joined #crystal-lang
15:03
<
BlaXpirit >
jokke, use StringIO if possible
15:03
<
jokke >
why would i do that?
15:04
<
jokke >
SliceIO has it's clear benefits over StringIO
15:04
<
jokke >
there are tons of use cases for SliceIO
15:05
<
jokke >
so you can't tell me what the problem might be here?
15:06
<
jokke >
BlaXpirit: as for your question about endianness look into io/byte_format.cr
15:07
<
crystal-gh >
[crystal] rhysd opened pull request #1606: Add --no-color option to `crystal spec` subcommand (master...spec-no-color)
http://git.io/vnhYL
15:07
<
nietzschette >
when I make from git clone, bash gives me: --cxxflags: command not found. I'm assuming llvm is not correctly set up?
15:09
<
jokke >
Papierkorb: you too
15:09
<
Papierkorb >
jokke: mh?
15:09
<
dzv >
how do you create a packed struct?
15:10
<
jokke >
dzv: what do you mean?
15:10
<
jokke >
dzv: i'd create a to_io method
15:10
<
jokke >
for that struct
15:12
<
jokke >
and a bytesize method maybe
15:13
<
jokke >
then use SliceIO.new(struct.bytesize).read_object(struct)
15:13
<
jokke >
but that won't work yet
15:13
<
jokke >
read_bytes would work though
15:13
<
dzv >
i'm using mmap so can't use io methods
15:16
<
jokke >
i don't see the problem
15:16
<
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
15:16
<
jokke >
Papierkorb: yeah, that's why i'm pleading for read_object
15:17
<
jokke >
and write_object
15:17
<
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
15:17
<
Papierkorb >
Both methods have their valid purpose to me
15:18
<
Papierkorb >
So io.write_object some_slive # => [Int32][UInt8 data ...]
15:18
<
Papierkorb >
and io.write_bytes some_slice # => [UInt8 data ...]
15:18
<
crystal-gh >
[crystal] benoist opened pull request #1607: require http server to be initialized with host (master...master)
http://git.io/vnh3I
15:19
pawnbox has quit [Remote host closed the connection]
15:19
<
Papierkorb >
jokke: Should I post that into the PR?
15:19
<
dzv >
the reason slices are used instead of array's is? the overhead different should be tiny
15:19
<
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
15:19
<
jokke >
Papierkorb: sure!
15:19
<
Papierkorb >
dzv: Slice is dynamic in length, where as a StaticArray is static in length
15:20
<
dzv >
because i'm going the other way. the data is coming from mmap and i need to put it in a struct
15:20
<
Papierkorb >
dzv: tbh on that note, a StaticSlice would be interesting :>
15:20
grindhold has joined #crystal-lang
15:20
<
Papierkorb >
dzv: though iirc StaticArray already does basically that in its #to_slice
15:20
<
jokke >
dzv: ok, so you have a pointer. make a slice out of it, pass it to slice io and read your struct
15:21
<
dzv >
when did slice length become dynamic?
15:21
<
jokke >
dzv: ah you don't know the lenght
15:21
<
BlaXpirit >
Papierkorb, whaaaaaaaaaaaaaaat you're talking nonsense
15:21
<
Papierkorb >
Err i mean slice is runtime allocated?
15:22
<
jokke >
dzv: there's pointer_io too
15:24
<
jokke >
so any clues to my problem regarding the two specs?
15:24
<
dzv >
ok, so i can use PointerIO or slice.copy_from directly. that still doesn't solve my packing problem
15:26
<
jokke >
dzv: is the struct a c struct, you're trying to read?
15:26
grindhold has quit [Ping timeout: 264 seconds]
15:26
<
jokke >
does it have any pointers?
15:27
<
jokke >
ok that's fairly easy then. just read the values in the order of the definitions of the struct members
15:27
<
jokke >
iirc structs are stored that way
15:27
<
dzv >
i'm aiming for zero copy. that's why i mmaped the file
15:29
<
jokke >
what about foo = (pointer as Pointer(Int32)).value
15:29
apt-get has joined #crystal-lang
15:29
<
jokke >
does that copy?
15:29
<
jokke >
probably does
15:30
<
jokke >
dunno if there's a possibility to claim a pointer by some object so that it's being managed by the GC
15:31
oleh has quit [Ping timeout: 240 seconds]
15:33
<
BlaXpirit >
i don't think it copies
15:34
apt-get has quit [Quit: Quit]
15:34
apt-get has joined #crystal-lang
15:59
apt-get_ has joined #crystal-lang
16:00
apt-get has quit [Ping timeout: 250 seconds]
16:01
grindhold has joined #crystal-lang
16:08
greengriminal has quit [Quit: This computer has gone to sleep]
16:12
leafybas_ has joined #crystal-lang
16:15
leafybasil has quit [Ping timeout: 240 seconds]
16:17
leafybas_ has quit [Ping timeout: 246 seconds]
16:18
rmosolgo has joined #crystal-lang
16:20
NeverDie has joined #crystal-lang
16:21
greengriminal has joined #crystal-lang
16:21
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:23
greengriminal has quit [Client Quit]
16:23
havenwood has quit [Ping timeout: 252 seconds]
16:25
sferik has joined #crystal-lang
16:26
pawnbox has joined #crystal-lang
16:28
oleh has joined #crystal-lang
16:29
oleh has quit [Client Quit]
16:33
<
crystal-gh >
[crystal] jreinert opened pull request #1608: add SliceIO Implementation with specs (master...slice-io)
http://git.io/vnhED
16:45
<
grindhold >
how do i cast a string of which i am sure that it only contains digits to Int32
16:45
<
grindhold >
as does not worlk
16:45
<
grindhold >
*the keyword "as"
16:47
Philpax has quit [Ping timeout: 240 seconds]
16:48
havenwood has joined #crystal-lang
16:48
<
jokke >
(string.pointer as Pointer(Int32).value maybe
16:49
<
jokke >
if i understood you correctly
16:49
<
jokke >
if your string looks like this "123", then just use .to_i
16:49
rmosolgo has quit [Remote host closed the connection]
16:52
rmosolgo has joined #crystal-lang
16:52
leafybasil has joined #crystal-lang
16:53
<
crystal-gh >
[crystal] technorama opened pull request #1609: New class Mmap. (master...f/mmap)
http://git.io/vnhaB
16:59
willl has quit [Quit: Connection closed for inactivity]
17:01
apt-get__ has joined #crystal-lang
17:01
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:04
apt-get_ has quit [Ping timeout: 272 seconds]
17:26
rmosolgo has quit [Remote host closed the connection]
17:29
rmosolgo has joined #crystal-lang
17:41
<
crystal-gh >
[crystal] adlerhsieh opened pull request #1610: Add methods documentation to File class (master...master)
http://git.io/vnhMv
17:56
rmosolgo has quit [Remote host closed the connection]
18:01
rmosolgo has joined #crystal-lang
18:07
<
jokke >
quiet here today2
18:08
rmosolgo has quit [Remote host closed the connection]
18:09
nietzschette has joined #crystal-lang
18:10
rmosolgo has joined #crystal-lang
18:11
rmosolgo has quit [Remote host closed the connection]
18:14
jeromegn has joined #crystal-lang
18:36
rmosolgo has joined #crystal-lang
18:43
apt-get__ has quit [Quit: Quit]
18:44
apt-get has joined #crystal-lang
18:44
tomchapin has joined #crystal-lang
18:44
tomchapin has quit [Client Quit]
18:46
tomchapin has joined #crystal-lang
18:51
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
19:16
_jungh4ns has quit [Read error: Connection reset by peer]
19:17
rmosolgo has quit [Remote host closed the connection]
19:19
<
jhass >
nietzschette: check you have llvm-config
19:21
<
nietzschette >
llvm-config command not found!
19:23
pragmatism has joined #crystal-lang
19:23
<
jhass >
you might need some llvm-devel package or whatever I guess
19:23
<
jhass >
BlaXpirit: it's raised before the macro is called :(
19:28
<
nietzschette >
yeah, that's what I was thinking, jhass
19:29
<
nietzschette >
I've about had it with windows - I think i'm going back to linux here soon
19:30
rmosolgo has joined #crystal-lang
19:30
<
jhass >
uh, crystal is not supported on windows
19:31
<
nietzschette >
well, I'm trying to see how deep I can get with Msys
19:32
<
nietzschette >
not very
19:32
<
nietzschette >
it would seem
19:35
<
jhass >
check the readme
19:38
<
BlaXpirit >
it's dead already :(
19:51
<
nietzschette >
ahh, phewey.
19:54
sferik has joined #crystal-lang
19:55
<
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?
19:56
<
jhass >
if you're familiar with Arch go with that :P
19:56
<
BlaXpirit >
for sure
19:56
<
jhass >
Crystal is in community <3
19:56
<
jhass >
check Antergos for a graphical installer though
19:56
<
BlaXpirit >
yeah, i didnt believe what i saw :p
19:57
<
jokke >
i'm shocked
19:57
rmosolgo has quit [Remote host closed the connection]
19:57
<
jhass >
Arch's install can be overwhelming
19:58
<
jhass >
nothing wrong with getting something premade if you feel like it
19:58
<
BlaXpirit >
arch install is fine, the instructions are constantly being made worse
20:02
rmosolgo has joined #crystal-lang
20:13
sferik has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:44
<
trapped >
how can i get the raw bytes forming an Int64?
20:59
n0xff has quit [Ping timeout: 265 seconds]
21:03
gamemanj has quit [Ping timeout: 265 seconds]
21:36
rmosolgo has quit [Remote host closed the connection]
21:42
<
pawnbox >
Anyone up for helping me out?
21:42
<
BlaXpirit >
that's not how irc works
21:42
<
pawnbox >
BlaXpirit: Ya i kow. :)
21:43
<
pawnbox >
anyways i am having trouble writing specs for a fix.
21:44
apt-get has quit [Remote host closed the connection]
21:45
<
trapped >
BlaXpirit: knew about that but was looking for something more generic
21:45
apt-get has joined #crystal-lang
21:47
<
BlaXpirit >
trapped, can also do a cast through pointers but it byte order is architecture dependent
21:47
rmosolgo has joined #crystal-lang
21:48
<
trapped >
BlaXpirit: i couldn't get the cast through pointers to work but not because of endianness
21:57
<
BlaXpirit >
should make this use staticarray, but i was unable to
21:58
apt-get has quit [Remote host closed the connection]
21:59
apt-get has joined #crystal-lang
21:59
apt-get has quit [Read error: Connection reset by peer]
21:59
apt-get has joined #crystal-lang
22:01
apt-get has quit [Remote host closed the connection]
22:01
apt-get has joined #crystal-lang
22:06
apt-get has quit [Remote host closed the connection]
22:07
apt-get has joined #crystal-lang
22:07
<
rmosolgo >
just "finished" (ie, had enough of) my first crystal project
22:07
apt-get has quit [Remote host closed the connection]
22:07
<
rmosolgo >
Takeaways: CRYSTAL IS AWESOME <3
22:07
apt-get has joined #crystal-lang
22:07
<
rmosolgo >
thanks for making it :)
22:08
rmosolgo has quit [Remote host closed the connection]
22:09
rmosolgo has joined #crystal-lang
22:10
rmosolgo has quit [Remote host closed the connection]
22:11
rmosolgo has joined #crystal-lang
22:13
apt-get has quit [Remote host closed the connection]
22:13
apt-get has joined #crystal-lang
22:14
<
adam12 >
rmosolgo: very neat.
22:17
pawnbox has quit [Remote host closed the connection]
22:17
<
rmosolgo >
it was great to really try it out, it looked sweet just from reading about it
22:17
apt-get has quit [Remote host closed the connection]
22:17
<
rmosolgo >
and it didn't disappoint!
22:18
apt-get has joined #crystal-lang
22:21
<
adam12 >
I'm finding myself very productive in it. Will be releasing a simple library soon enough.
22:21
<
adam12 >
A real joy to use, for sure.
22:24
sfcgeorg_ has joined #crystal-lang
22:27
apt-get has quit [Remote host closed the connection]
22:27
apt-get has joined #crystal-lang
22:28
sfcgeorge has quit [Ping timeout: 268 seconds]
22:32
apt-get has quit [Remote host closed the connection]
22:33
apt-get has joined #crystal-lang
22:33
apt-get has quit [Remote host closed the connection]
22:33
apt-get has joined #crystal-lang
22:35
apt-get has quit [Remote host closed the connection]
22:35
apt-get has joined #crystal-lang
22:40
apt-get_ has joined #crystal-lang
22:40
apt-get_ has quit [Remote host closed the connection]
22:40
apt-get_ has joined #crystal-lang
22:41
apt-get_ has quit [Remote host closed the connection]
22:41
apt-get_ has joined #crystal-lang
22:42
apt-get has quit [Ping timeout: 240 seconds]
22:56
apt-get_ has quit [Remote host closed the connection]
22:57
apt-get has joined #crystal-lang
22:59
apt-get has quit [Remote host closed the connection]
22:59
apt-get has joined #crystal-lang
23:02
apt-get has quit [Remote host closed the connection]
23:03
apt-get has joined #crystal-lang
23:09
BlaXpirit has quit [Quit: Konversation]
23:32
apt-get has quit [Ping timeout: 250 seconds]
23:33
tomchapin has joined #crystal-lang
23:37
trapped has quit [Read error: Connection reset by peer]
23:41
Raimondii has joined #crystal-lang
23:44
Raimondi has quit [Ping timeout: 244 seconds]
23:49
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:52
Raimondii is now known as Raimondi