00:00
deverly has quit [Remote host closed the connection]
00:06
Oliphaunte has joined #crystal-lang
00:10
Philpax has joined #crystal-lang
00:12
deverly has joined #crystal-lang
00:28
deverly has quit []
00:28
ob_ has joined #crystal-lang
00:34
Dreamer3 has quit [Quit: Leaving...]
01:22
soveran has joined #crystal-lang
01:27
soveran has quit [Ping timeout: 260 seconds]
01:33
ob_ has quit [Remote host closed the connection]
01:55
snsei has joined #crystal-lang
01:55
snsei has quit [Remote host closed the connection]
01:56
snsei has joined #crystal-lang
02:42
Oliphaunte has quit [Remote host closed the connection]
02:45
Oliphaunte has joined #crystal-lang
02:55
Oliphaunte has quit [Remote host closed the connection]
02:57
snsei_ has joined #crystal-lang
03:00
snsei has quit [Ping timeout: 264 seconds]
03:04
Oliphaunte has joined #crystal-lang
03:14
Oliphaunte has quit []
03:24
soveran has joined #crystal-lang
03:29
soveran has quit [Ping timeout: 276 seconds]
04:00
snsei has joined #crystal-lang
04:01
snsei_ has quit [Ping timeout: 264 seconds]
04:22
pawnbox has quit [Read error: No route to host]
04:25
soveran has joined #crystal-lang
04:31
soveran has quit [Ping timeout: 276 seconds]
05:01
pawnbox has joined #crystal-lang
05:04
snsei has quit [Ping timeout: 264 seconds]
05:35
pawnbox has quit [Ping timeout: 258 seconds]
05:37
pawnbox has joined #crystal-lang
05:42
pawnbox has quit [Remote host closed the connection]
05:42
pawnbox has joined #crystal-lang
06:06
soveran has joined #crystal-lang
06:18
jsaak has quit [Ping timeout: 244 seconds]
06:41
jsaak has joined #crystal-lang
06:46
soveran has quit [Remote host closed the connection]
06:47
mark_661 has joined #crystal-lang
06:48
jsaak has quit [Ping timeout: 246 seconds]
06:54
jsaak has joined #crystal-lang
07:03
soveran has joined #crystal-lang
07:06
jsaak has quit [Ping timeout: 244 seconds]
07:14
jsaak has joined #crystal-lang
07:20
jsaak has quit [Ping timeout: 272 seconds]
07:20
jsaak has joined #crystal-lang
07:24
jsaak has quit [Ping timeout: 246 seconds]
07:31
jsaak has joined #crystal-lang
07:36
pawnbox has quit [Remote host closed the connection]
07:36
jsaak has quit [Ping timeout: 276 seconds]
07:36
akwiatkowski has joined #crystal-lang
07:41
pawnbox has joined #crystal-lang
07:42
pawnbox has quit [Remote host closed the connection]
07:44
pawnbox has joined #crystal-lang
07:54
jsaak has joined #crystal-lang
08:06
jsaak has quit [Ping timeout: 244 seconds]
08:06
jsaak has joined #crystal-lang
08:30
soveran has quit [Remote host closed the connection]
08:40
soveran has joined #crystal-lang
08:40
soveran has quit [Changing host]
08:40
soveran has joined #crystal-lang
08:47
soveran has quit [Ping timeout: 260 seconds]
08:50
jsaak has quit [Ping timeout: 272 seconds]
08:55
pawnbox has quit [Remote host closed the connection]
08:56
jsaak has joined #crystal-lang
09:16
jsaak has quit [Ping timeout: 252 seconds]
09:22
jsaak has joined #crystal-lang
09:30
jsaak has quit [Ping timeout: 250 seconds]
09:31
soveran has joined #crystal-lang
09:31
soveran has quit [Changing host]
09:31
soveran has joined #crystal-lang
09:36
jsaak has joined #crystal-lang
09:51
jsaak has quit [Ping timeout: 250 seconds]
09:51
jsaak has joined #crystal-lang
09:54
pawnbox has joined #crystal-lang
09:55
jsaak has quit [Ping timeout: 240 seconds]
09:56
pawnbox has quit [Remote host closed the connection]
09:56
pawnbox has joined #crystal-lang
10:01
jsaak has joined #crystal-lang
10:06
jsaak has quit [Ping timeout: 252 seconds]
10:06
jsaak has joined #crystal-lang
10:12
jsaak has quit [Ping timeout: 240 seconds]
10:17
jsaak has joined #crystal-lang
10:20
trapped has joined #crystal-lang
10:31
<
BlaXpirit >
sdogruyol, to still be able to build crystal on old distros, of course
10:31
<
BlaXpirit >
travis pls - ubuntu 12.04
10:31
<
FromGitter >
<sdogruyol> oh 12.04 is pretty old lol
10:34
<
jhass >
well we use docker containers on travis
10:34
<
FromGitter >
<sdogruyol> i wonder how Rust handles this?
10:34
<
jhass >
I think they build against 3.6 already anyway
10:35
<
jhass >
probably massive, own, CI setup
10:35
<
FromGitter >
<sdogruyol> since Rust has much more OS and platform to support
10:35
<
jhass >
mozilla has pretty big CI infra
10:35
<
jhass >
for FF alone
10:35
<
FromGitter >
<sdogruyol> oh i see, makes sense
10:35
<
FromGitter >
<sdogruyol> you're right
10:36
<
FromGitter >
<sdogruyol> damn, it's all about money isn't it :P
10:40
akwiatkowski has quit [Ping timeout: 244 seconds]
10:40
<
BlaXpirit >
damn, this is too difficult
10:41
<
BlaXpirit >
so let's say a C++ function returns a std::string - how do I wrap it into C and into Crystal so that I get a function which calls that and returns a String
10:42
<
jhass >
char* cpp_func() { return cpp.func().c_str(); } iirc
10:43
Raimondi has quit [Quit: All hail WeeChat 1.5-dev!]
10:44
<
BlaXpirit >
jhass, unfortunately that string is deleted when the function returns, and the pointer is invalid
10:47
<
jhass >
uh, guess you need to strcopy then?
10:48
<
BlaXpirit >
maybe I do but then the problem is disposing of it
10:49
<
jhass >
yes you have to use GC_malloc or LibC.free by hand
10:50
<
BlaXpirit >
that would make assumptions that crystal and c use the same LibC
10:50
<
BlaXpirit >
i found an interesting solution - using a static variable in C++ so it's not deleted
10:50
<
BlaXpirit >
not thread safe but it's something
10:54
<
FromGitter >
<sdogruyol> hope you like it :P
10:58
jsaak has quit [Ping timeout: 240 seconds]
10:58
soveran has quit [Remote host closed the connection]
11:09
jsaak has joined #crystal-lang
11:15
jsaak has quit [Ping timeout: 276 seconds]
11:21
jsaak has joined #crystal-lang
11:28
Raimondi has joined #crystal-lang
11:37
soveran has joined #crystal-lang
11:46
<
RX14 >
crystal -d actually works
11:47
<
RX14 >
i've never got source annotations working before
12:13
snsei has joined #crystal-lang
12:47
akwiatkowski has joined #crystal-lang
12:55
pawnbox has quit [Remote host closed the connection]
13:10
pawnbox has joined #crystal-lang
13:12
pawnbox has quit [Remote host closed the connection]
13:12
pawnbox has joined #crystal-lang
13:16
snsei has quit [Ping timeout: 252 seconds]
13:31
Ven has joined #crystal-lang
13:32
jsaak has quit [Ping timeout: 250 seconds]
13:51
paulcsmith_ has joined #crystal-lang
13:52
ome has joined #crystal-lang
13:52
paulcsmith_ has quit [Client Quit]
13:54
paulcsmith_ has joined #crystal-lang
14:51
mark_661 has quit [Quit: Leaving.]
14:57
Philpax has quit [Ping timeout: 252 seconds]
15:11
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:12
paulcsmith_ has joined #crystal-lang
15:13
Raimondi has quit [Ping timeout: 240 seconds]
15:15
Oliphaunte has joined #crystal-lang
15:37
jsaak has joined #crystal-lang
15:41
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:42
jsaak has quit [Ping timeout: 276 seconds]
15:56
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:59
ome has quit [Quit: Connection closed for inactivity]
16:03
paulcsmith_ has joined #crystal-lang
16:04
Ven has joined #crystal-lang
16:04
Ven has quit [Client Quit]
16:13
Redfoxmoon has quit [Ping timeout: 244 seconds]
16:22
jsaak has joined #crystal-lang
16:31
Raimondii has joined #crystal-lang
16:38
Redfoxmoon has joined #crystal-lang
16:38
Raimondii is now known as Raimondi
16:48
<
crystal-gh >
[crystal] asterite closed pull request #1851: Added type restrictions to many collections methods. Fixes #1764 (master...collections_type_restrictions)
https://git.io/vKRP5
16:55
<
crystal-gh >
[crystal] asterite opened pull request #2996: Add restrictions to collection methods. Fixes #1764. Fixes #988 (master...feature/collections_restrictions)
https://git.io/vKR1v
16:57
Raimondii has joined #crystal-lang
17:00
Raimondi has quit [Ping timeout: 244 seconds]
17:05
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
17:08
Raimondii is now known as Raimondi
17:10
efi has joined #crystal-lang
17:12
<
efi >
I'm pretty new to crystal and have some basic questions... Is this the right place?
17:12
<
RX14 >
yes, of course
17:13
<
efi >
typeof([0,0,0,"Hello"]) gives me Array(Int32 | String)
17:14
<
efi >
I need to get the inner union type (Int32 | String) - how can I extract that from the Array(T) Type?
17:14
<
RX14 >
>> a = [0,0,0,"Hello"]; pp typeof(a), typeof(a.first)
17:14
paulcsmith_ has joined #crystal-lang
17:15
<
RX14 >
basicallt typeof(arry.first)
17:15
<
RX14 >
or any method that returns an item, but first makes more sense
17:15
<
efi >
Ah, "first" also has the broader type? Cool, thx!
17:15
<
RX14 >
yes, because the compiler cannot reason about the order of elements
17:16
<
RX14 >
so it has to assume that every element can be any type in the union
17:16
<
efi >
Thinking about it, that makes sense. :D
17:16
<
RX14 >
of course tuples do not follow that logic
17:17
<
efi >
Yes, because the compiler knows them "better". Thx for the quick help. I think I'll return soon with another question. ;-)
17:26
Oliphaunte has quit [Remote host closed the connection]
17:54
Oliphaunte has joined #crystal-lang
17:58
Oliphaunte has quit [Ping timeout: 250 seconds]
18:01
Redfoxmoon has quit [Ping timeout: 276 seconds]
18:04
Redfoxmoon has joined #crystal-lang
18:09
Redfoxmoon has quit [Ping timeout: 244 seconds]
18:10
<
txdv >
how doI turn a Pointer(UInt8) into a string?
18:10
<
txdv >
it is a null terminated string
18:11
Redfoxmoon has joined #crystal-lang
18:12
<
BlaXpirit >
txdv, String.new(that)
18:12
<
txdv >
nice, thanks
18:12
<
txdv >
this language is so awesome
18:13
<
txdv >
"I need to learn this language, why don't I write some bindings!"
18:13
<
txdv >
writing bindings is just so easy
18:13
<
FromGitter >
<sdogruyol> Yeah, Crystal is awesome :sparkles:
18:20
<
txdv >
is there something like a weak reference?
18:22
<
RX14 >
i just spent the afternoon trying to optimise header parsing and it ends up the same speed...
18:23
<
RX14 >
well it was fin i guess
18:23
<
FromGitter >
<sdogruyol> RX14 you mean HTTP::Headers ?
18:23
<
txdv >
jhass: if i associate a pointer with an object (the object is a wrapper around it) it kinda will stop it from finalizing
18:23
<
RX14 >
more like parse_headers_and_body and parse_header
18:23
<
FromGitter >
<sdogruyol> hmm
18:24
<
RX14 >
i was thinking I could remove a malloc and stop iterating the string twice
18:24
<
jhass >
txdv: you store a pointer to an object in the object itself? or you mean the pointer won't be free'd until the object is free'd?
18:24
<
RX14 >
but it ended up the same speed really
18:24
<
FromGitter >
<sdogruyol> hmm
18:24
Oliphaunte has joined #crystal-lang
18:35
soveran has quit [Remote host closed the connection]
18:51
<
txdv >
i think i found a bug
18:56
soveran has joined #crystal-lang
19:09
<
RX14 >
jokke, forgotten to merge my PR?
19:15
<
txdv >
jhass: i store the C pointer in the Crystal object
19:17
<
jhass >
I think I don't follow the issue
19:18
<
txdv >
wait, i'll post it
19:28
<
txdv >
this returns a new reference
19:29
<
txdv >
if I have repo, i can do repo.head.owner and it should be the same object
19:29
<
txdv >
but I create a new Repository for the same C pointer
19:29
<
txdv >
what is the best way to circumvent this?
19:30
<
jhass >
will either Reference or Repository ever be mutable, I mean will you wrapper have mutable state (additional instance variables)?
19:30
<
txdv >
no, but it has a finalize method
19:31
<
txdv >
i mean, if one of those objects frees the underlying c pointer, the others cant access it anymore
19:31
<
jhass >
mh, no reference counting?
19:33
<
BlaXpirit >
does any Crystal project use CMake? alternatively, I'm looking for some build system that can be helpful with both C++ and Crystal
19:34
<
RX14 >
i mean can't you just call whatever build system for C++ from crystal
19:34
<
jhass >
txdv: reference_type / reference_free is not reference counting?
19:34
<
RX14 >
it doesn't have to be the same build system for crystal and C++ BlaXpirit
19:34
<
BlaXpirit >
RX14, I don't want a crazy complicated sandwich. would prefer one build system
19:34
<
RX14 >
its not that difficult
19:35
<
RX14 >
is this for a shard?
19:35
<
BlaXpirit >
believe me, with C++ it is difficult
19:35
<
RX14 >
well the C++ doesn't depend on crystal code right?
19:35
<
txdv >
you mean if the C _free functions have reference counting/
19:35
<
BlaXpirit >
RX14, i'm making a library that consists of C++ -> C binding and C -> Crystal binding
19:36
<
RX14 >
just use make
19:36
<
RX14 >
its not using multiple build systems
19:36
<
RX14 >
because crystal doesn't need a build system
19:36
<
BlaXpirit >
i really can't drop the cmake part, people will get grief when building a shared library otherwise
19:36
<
BlaXpirit >
besides, one day Windows will come, what will i do
19:36
<
RX14 >
doesn't cmake just use make anyway
19:36
<
RX14 >
i thought it just generated makefiles
19:36
<
BlaXpirit >
RX14, it has tons of backends letting it run on windows
19:37
<
RX14 >
well crystal used to call the c compiler from macros
19:38
<
RX14 >
i really don't get why you need a build system more then compile all C++ targets then call crystal build
19:38
<
txdv >
jhass: i guess i can do the reference counting myself
19:38
<
txdv >
but then the repo object wrappers are != to each other
19:38
<
jhass >
that's easily fixable, just compare the internal pointers
19:39
<
jhass >
but reference counting requires global state either way, so could just dedup
19:39
<
jhass >
either is a bit meh
19:40
<
RX14 >
BlaXpirit, if it's a shard just use postinstall hooks in shards
19:40
<
jhass >
INSTANCES = Hash(Pointer, Repository).new
19:42
<
jhass >
txdv: might be easier to reimplement these tbh
19:43
<
jhass >
def owner; @owner || Repository.new(LibGit2.reference_owner(@ref)); end
19:46
<
txdv >
but if i have INSTANCES around
19:46
<
txdv >
the objects in INSTACES will never be freed
19:47
<
jhass >
how does rugged solve this?
19:49
<
RX14 >
it seems like it doesn't
19:52
<
jhass >
yeah, just doesn't implement owner
19:52
<
RX14 >
well it doesnt seem to implement much
19:53
pawnbox_ has joined #crystal-lang
19:54
<
txdv >
libgit2sharp just passes the object reference
19:54
<
RX14 >
yeah thats what I would do
19:54
<
jhass >
you could pass a flag whether you "own" the reference
19:54
<
jhass >
def finalize; ...free(@ref) if @owned; end
19:55
pawnbox has quit [Ping timeout: 276 seconds]
19:55
<
RX14 >
but i think just passing the owner into the child is easier
19:55
<
RX14 >
when it's instantiated
19:55
<
txdv >
repo is a god object
19:57
<
RX14 >
thats how rugged does it
19:58
<
crystal-gh >
crystal/master f6874e1 Ary Borenszweig: String: always compute codepoints size when ascii optimization is available...
20:31
efi has quit [Ping timeout: 250 seconds]
20:42
pawnbox_ has quit [Remote host closed the connection]
20:43
pawnbox has joined #crystal-lang
20:48
Raimondii has joined #crystal-lang
20:51
Raimondi^1 has joined #crystal-lang
20:51
Raimondi has quit [Ping timeout: 240 seconds]
20:53
<
RX14 >
webui says its still going lol
20:54
Raimondii has quit [Ping timeout: 240 seconds]
20:54
<
crystal-gh >
[crystal] asterite closed pull request #2973: Add IO::Delimited (master...feature/delimited-io)
https://git.io/vKsjK
20:58
Raimondi^1 is now known as Raimondi
20:58
Raimondi is now known as Raimondii
21:02
<
jhass >
RX14: ary probably restarted it
21:08
Raimondii is now known as Raimondi
21:09
<
FromGitter >
<sdogruyol> RX14 isnt mime pr already complete?
21:09
<
RX14 >
i havent added formdata helpers
21:09
<
FromGitter >
<sdogruyol> what's missing
21:09
<
RX14 >
which i'm working on right now
21:09
<
FromGitter >
<sdogruyol> i see
21:10
<
FromGitter >
<sdogruyol> tbh i can't wait for it :P
21:10
<
RX14 >
its been hanging around for so long i've almost gotten bored of working on this PR
21:11
<
FromGitter >
<sdogruyol> well, yeah that's definitely a bummer
21:13
<
FromGitter >
<sdogruyol> i also wonder how's that paralellism stuff is going on
21:16
<
jhass >
RFC1341 seems to list only multipart/mixed, multipart/alternative, multipart/digest and multipart/parallel
21:16
<
RX14 >
jhass, yes because multipart/formdata is a seperate rfc
21:17
<
jhass >
but if I pass foobar to it it's invalid
21:17
<
RX14 >
see the section on extension types
21:18
<
jhass >
eh, meh yeah
21:18
<
jhass >
is there no registry for this? :/
21:19
<
RX14 >
there's the generic mime registry
21:20
<
RX14 >
i'm not hardcoding that into crystal though :P
21:21
<
jhass >
maybe reject known not-working?
21:21
<
RX14 >
why not just let people use whatever subtype they want!
21:22
<
jhass >
I thought some might actually influence the general format
21:23
<
RX14 >
it says in the rfc
21:23
<
RX14 >
All present and future subtypes of the "multipart" type must use an
21:23
<
RX14 >
identical syntax. Subtypes may differ in their semantics, and may
21:23
<
RX14 >
impose additional restrictions on syntax, but must conform to the
21:23
<
RX14 >
required syntax for the "multipart" type.
21:33
willl has joined #crystal-lang
21:46
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:15
Oliphaunte has quit [Remote host closed the connection]
22:19
Ven has joined #crystal-lang
22:30
<
RX14 >
is there any sort of preexisting way to "unquote" strings from http headers
22:34
<
FromGitter >
<aurelien-ldp> Hello ! I just want to convert a Int32 to Float64, any ideas ?
22:35
<
jhass >
call to_f64 ;)
22:35
<
BlaXpirit >
>> 5.to_f64
22:36
Ven has quit [Read error: Connection reset by peer]
22:36
Ven has joined #crystal-lang
22:37
<
FromGitter >
<aurelien-ldp> Of course to_f like ruby, thanks a lot :)
22:39
Ven has quit [Client Quit]
22:43
Philpax has joined #crystal-lang
22:49
akwiatkowski has quit [Ping timeout: 244 seconds]
22:54
soveran has quit [Remote host closed the connection]
23:06
soveran has joined #crystal-lang
23:16
Philpax has quit [Ping timeout: 252 seconds]
23:30
soveran has quit [Remote host closed the connection]
23:41
Philpax has joined #crystal-lang
23:55
jsaak has quit [Ping timeout: 240 seconds]