00:03
tmoore_ is now known as tmoore
00:03
<
crystal-gh >
[crystal] asterite closed pull request #400: Fix: leaking file descriptors on socket creation errors (master...close-sockets-on-errors)
http://git.io/bPMx
00:04
asterite has joined #crystal-lang
00:09
<
travis-ci >
manastech/crystal#1934 (master - 2384d92 : Ary Borenszweig): The build passed.
00:12
asterite has quit [Quit: asterite]
00:17
asterite has joined #crystal-lang
00:18
asterite has quit [Client Quit]
00:29
asterite has joined #crystal-lang
00:32
asterite has quit [Client Quit]
00:53
asterite has joined #crystal-lang
00:59
<
asterite >
If it’s crystal code then yes, it’s beautiful :)
01:00
<
asterite >
For a second I thought chrome would die, but it managed to render that
01:00
<
asterite >
and github colored it too! :)
01:02
<
asterite >
That’s it? That’s all you needed to do?
01:03
<
jhass >
yeah, the hardest part was the swapped at the end xD
01:04
<
jhass >
else it was passing instance (first arg) as first arg when invoking the Function
01:05
<
asterite >
Mm… but I thought our closures had the closure data as a first argument
01:05
<
asterite >
Oh, yes, swap sends it as first, non-swap sends it as las
01:06
<
asterite >
So the wrapper for closures in crystal is the shortest one? :)
01:06
<
asterite >
(for gobject closures)
01:06
<
jhass >
for the simple cases
01:06
<
jhass >
I have no idea how it holds up to more complex ones
01:06
<
jhass >
my GTK is rusty anyway
01:06
<
jhass >
I guess binding glade would be fun
01:08
<
asterite >
I hope you don’t mind I star and watch every crystal project in github :)
01:08
<
jhass >
nah, why would I
01:08
<
asterite >
It would be nice to see the user of the project in that list
01:09
<
jhass >
hehe, most stars were accumulated by the Ruby version though :P
01:09
<
asterite >
It seems you found out about &->Gtk.quit :)
01:10
<
asterite >
The hello world sample looks really clean
01:11
<
jhass >
didn't you give it away earlier?
01:11
<
asterite >
Oh, I forgot you could do ->.. and then use it together with &
01:11
<
asterite >
The &-> symbol looks cute :)
01:11
<
asterite >
I mean, I think I didn’t know that was even possible or that it parsed
01:12
<
asterite >
Could it work in mac?
01:13
waj has joined #crystal-lang
01:13
<
jhass >
good question
01:13
<
jhass >
Gtk works in windows, so I guess it works in Mac too, but no idea
01:14
<
jhass >
linking will probably fail, I basically guess it currently
01:16
<
asterite >
I also see that you used redefine_main. It seems it has its uses :)
01:17
<
jhass >
it's boilerplate every Gtk program needs, so why not
01:17
<
jhass >
gtk_main() spins up an event loop and then blocks
01:18
<
jhass >
after that everything happens on callbacks or in separate threads you need to spin up before that or in a callback
01:18
<
jhass >
wow, didn't expect that :D
01:19
<
asterite >
I really, really like it that I can download a project, install the dependencies and just do `crystal sample.cr` to make it work :)
01:22
<
asterite >
True, mine’s too colorful
01:22
<
asterite >
Parse: 00:00:00.0881180
01:23
<
asterite >
Type inference: 00:00:00.0865680
01:23
<
asterite >
I would have thought it would take more time for those huge bindings
01:23
<
asterite >
Computers are fast :)
01:24
<
waj >
nice!! good job!
01:28
<
asterite >
Changes the style?
01:28
<
jhass >
it's not over my browser
01:28
<
jhass >
do you have brodwayd on mac?
01:29
<
asterite >
Maybe… how can I try it?
01:29
<
jhass >
if so, do broadwayd -p 8080 &; GDK_BACKEND=broadway ../bin/crystal ...
01:29
<
jhass >
open localhost:8080 in your browser
01:30
<
jhass >
(Yes, GDK, not GTK)
01:31
<
asterite >
I think I don’t have broadwayd :(
01:31
<
jhass >
maybe just not in the $PATH?
01:31
<
jhass >
but maybe they didn't port it
01:32
<
asterite >
I can’t find the binary in my installation, so maybe it’s not available for mac
01:32
<
asterite >
Again, you generated those bindings with gobject introspection?
01:33
<
asterite >
Is that some kind of ffi-gen?
01:33
<
jhass >
is basically the entry point to that glory mess
01:34
<
jhass >
I never really looked at what ffi-gen does
01:34
<
asterite >
If you compile the hello world with —release, the resulting binary is about 17k :)
01:35
<
jhass >
all the heavy stuff is linked in^^
01:35
<
asterite >
It seems so :)
01:35
<
asterite >
Mmm… wait, you are generating the bindings with crystal?
01:36
<
asterite >
Where did you get your superpowers?
01:36
<
jhass >
I bound the necessary stuff by hand before generating itself with it
01:36
<
asterite >
I want to go there :-P
01:37
<
jhass >
everything that doesn't start with lib_ is hand-written atm
01:37
<
asterite >
Can that generate bindings for, say, libuv?
01:37
<
asterite >
libuv heavily uses macros… you can try with pcre
01:38
<
jhass >
I doubt it though
01:39
<
jhass >
what GI does is, it scans header files following the gobject conventions/using gobject
01:39
<
asterite >
Aaah… ok
01:39
<
jhass >
produces XML descriptions for them (.gir extension) and compiles those to a more efficient binary format (.typelib)
01:40
<
jhass >
those typelib files are then what you read with the library to get runtime objects describing the stuff
01:40
<
jhass >
(GIBaseInfo, GIStructInfo, GIFunctionInfo,...)
01:41
<
asterite >
And I thought once you finished DeBot you would get bored of Crystal…
01:41
<
asterite >
(not really :-P)
01:42
<
jhass >
that's what I have .typelib's available for on my system
01:42
<
asterite >
Your prompt is cool :)
01:48
<
asterite >
Thanks :)
02:09
asterite has quit [Quit: asterite]
02:10
<
crystal-gh >
crystal/master 624f006 Ary Borenszweig: Fixed: `can't reopen enum and add more constants to it` error didn't have a location
02:13
asterite has joined #crystal-lang
02:15
<
travis-ci >
manastech/crystal#1935 (master - 624f006 : Ary Borenszweig): The build passed.
02:29
waj has quit [Quit: Leaving.]
02:50
waj has joined #crystal-lang
02:52
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
03:05
<
crystal-gh >
crystal/master 1c80ced Ary Borenszweig: Use enums for socket type, protocol and family instead of constants
03:05
<
crystal-gh >
crystal/master 06fe838 Ary Borenszweig: Updated Changelog
03:09
<
travis-ci >
manastech/crystal#1936 (master - 06fe838 : Ary Borenszweig): The build passed.
03:22
waj has quit [Quit: Leaving.]
03:23
zamith__ has quit [Quit: Be back later ...]
03:29
asterite has quit [Quit: asterite]
03:29
asterite has joined #crystal-lang
03:47
<
crystal-gh >
crystal/master 80b3ea3 Ary Borenszweig: Fill argument types when passing a function pointer to a C function (like in `->foo` or `->Foo.bar`). Also, renamed `MacroType` to `TypeNode` because now its also used outside macros.
03:52
<
travis-ci >
manastech/crystal#1937 (master - 80b3ea3 : Ary Borenszweig): The build passed.
04:18
<
crystal-gh >
crystal/master 2450432 Ary Borenszweig: Removed some dead code
04:23
<
travis-ci >
manastech/crystal#1938 (master - 2450432 : Ary Borenszweig): The build passed.
05:27
bcardiff has quit [Quit: Leaving.]
05:30
bcardiff has joined #crystal-lang
05:33
bcardiff has quit [Client Quit]
05:42
r20 has quit [Ping timeout: 240 seconds]
05:46
drizz has quit [Remote host closed the connection]
05:47
drizz has joined #crystal-lang
11:10
bcardiff has joined #crystal-lang
11:25
bcardiff has quit [Quit: Leaving.]
13:42
waj has joined #crystal-lang
13:54
waj has quit [Quit: Leaving.]
13:56
waj has joined #crystal-lang
14:05
waj has quit [Quit: Leaving.]
14:07
waj has joined #crystal-lang
14:08
waj has quit [Client Quit]
14:09
<
jhass >
>> a = /a/; b = /#{a}/
14:09
<
DeBot >
jhass: //a//
14:09
waj has joined #crystal-lang
14:11
waj has quit [Client Quit]
14:24
waj has joined #crystal-lang
14:33
waj has quit [Quit: Leaving.]
14:34
DeBot has quit [Quit: Crystal]
14:34
DeBot has joined #crystal-lang
14:45
kgadek has quit [*.net *.split]
14:50
kgadek has joined #crystal-lang
15:07
asterite has joined #crystal-lang
15:07
asterite has quit [Remote host closed the connection]
15:07
asterite has joined #crystal-lang
15:08
<
asterite >
jhass: I didn't know that about interpolating a regex into another regex
15:09
<
asterite >
An easy solution is to have those literals use a RegexStringIO, which overload <<(Regex) and append the source
15:09
<
asterite >
What do you think?
15:09
<
jhass >
not sure, it's a bit more complex
15:09
<
jhass >
try a = /foo/i; /a#{a}a/ in ruby
15:10
<
jhass >
see the ?i-mx ?
15:10
<
jhass >
it caries over the flags just for that part
15:11
<
jhass >
not sure if pcre can even do that tbh
15:26
<
asterite >
Sure! Why is it failing?
15:29
<
jhass >
let's pretend I have nothing, all variants I tried fail differently
15:31
<
jhass >
if I heap allocate it (ptr = Pointer(LibGObject::Value).malloc(1)) it's at least not segfaulting
15:31
<
jhass >
but it also claims I never set a value
15:32
<
jhass >
or I didn't set a string for that matter
15:32
<
jhass >
GLib-GObject-CRITICAL **: g_value_set_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
15:34
<
jhass >
with strct :: LibGObject::Value
15:34
<
jhass >
ptr = pointerof(strct)
15:35
<
jhass >
I get gvalue.c:181: cannot initialize GValue with type 'guchar', the value has already been initialized as '(null)'
15:35
<
jhass >
and a segfault after that
15:35
<
jhass >
common code is LibGObject.value_init(ptr, Type::STRING)
15:35
<
jhass >
LibGObject.value_set_string ptr, value
15:35
<
jhass >
LibGObject.object_set_property object, property, ptr
15:41
<
asterite >
I'll try it here
15:42
<
jhass >
STRING = LibGObject.type_fundamental(16_u64)
15:42
<
asterite >
I get this: (<unknown>:48574): GLib-GObject-CRITICAL **: g_value_set_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
15:43
<
asterite >
So I think we are with the same code now :)
15:46
<
asterite >
Are you sure STRING is 16?
15:49
<
asterite >
If you try it in a C program it works?
15:50
<
jhass >
mmh,STRING = LibGObject.type_fundamental(16_u64) might actually be wrong
15:50
<
jhass >
hit the wrong macro
15:52
<
jhass >
dang, that's it
15:53
<
asterite >
Really? :)
15:53
<
asterite >
What was it?
15:53
<
jhass >
16.to_u64 << 2 is the correct value for STRING
15:54
<
jhass >
one thing I wonder though, why do I have to heap allocate it?
15:55
<
jhass >
isn't the example stack allocated?
16:15
<
asterite >
Yes, you can stack allocate it too
16:15
<
jhass >
it's segfaulting and throwing errors though
16:16
<
asterite >
LibGObject.value_init(out ptr, STRING) LibGObject.value_set_string pointerof(ptr), "hello" LibGObject.value_set_string pointerof(ptr), "hello"
16:16
<
jhass >
ah, out I didn't try
16:16
<
asterite >
But with :: it should work too
16:17
<
jhass >
it doesn't for me
16:17
<
asterite >
althought both :: and out don't zero-initialize it, and maybe gtk requires it to be zero
16:17
<
asterite >
Pointer.malloc zeroes
16:17
<
asterite >
And new also zeros
16:17
<
jhass >
maybe you just had luck to hit a bunch of zeros on your system
16:17
<
asterite >
ptr = LibGObject::Value.new LibGObject.value_init(pointerof(ptr), STRING)
16:18
<
jhass >
see, I really think :: and out should zero ;)
16:18
<
jhass >
what's that last one, a trick to zero it?
16:18
<
asterite >
Struct.new zeroes
16:18
<
jhass >
ah, missing ;
16:19
<
asterite >
But, yes, probably :: and out should zero too
16:19
<
jhass >
it bit me several times now, I think it's no question
16:25
asterite has quit [Ping timeout: 246 seconds]
17:03
asterite has joined #crystal-lang
17:17
asterite has quit [Quit: Page closed]
18:32
<
crystal-gh >
crystal/master 13de017 Julien Portalier: Added: String#rjust and String#ljust
18:32
<
crystal-gh >
crystal/master b7c4c1f Julien Portalier: Added: IO.pipe(&block)
18:32
<
crystal-gh >
crystal/master b19c350 Julien Portalier: Added: match expectation
18:37
<
travis-ci >
manastech/crystal#1941 (master - d39d9c7 : Ary Borenszweig): The build passed.
19:13
DeBot has quit [Ping timeout: 252 seconds]
19:18
<
jhass >
>> String.class.name
19:18
<
jhass >
eh, where's the bot
19:20
<
crystal-gh >
crystal/master 0c58dd6 Ary Borenszweig: Some fixes to docs generation
19:20
<
crystal-gh >
crystal/master 8af8e7b Ary Borenszweig: Some changes and docs for Logger
19:21
DeBot has joined #crystal-lang
19:21
<
jhass >
>> String.class.name
19:21
<
DeBot >
jhass: Error in line 3: undefined method 'name' for Class
19:26
<
travis-ci >
manastech/crystal#1942 (master - 8af8e7b : Ary Borenszweig): The build passed.
19:26
DeBot has quit [Quit: Crystal]
19:26
DeBot has joined #crystal-lang
20:08
<
jhass >
>> class B < A; end; class A; end;
20:08
<
DeBot >
jhass: Error in line 3: undefined constant A
20:18
<
crystal-gh >
crystal/master 73b0b68 Ary Borenszweig: Small typo in Changelog
20:18
<
crystal-gh >
crystal/master ae8212c Ary Borenszweig: Crystal 0.5.9
20:23
<
travis-ci >
manastech/crystal#1943 (master - ae8212c : Ary Borenszweig): The build passed.
20:28
<
jhass >
haha, expected 0.6 on that one :P
20:34
waj has joined #crystal-lang
20:46
<
jhass >
waj: update topic? ;)
20:56
<
waj >
0.5.9!! yay! :D
21:08
<
jhass >
waj: why still bugfix bump btw? certainly new features there :P
21:09
<
waj >
we should ask asterite ;)
21:09
<
jhass >
totally expected 0.6 ;)
21:13
asterite has joined #crystal-lang
21:13
<
asterite >
jhass: I don't like even numbers ( ? )
21:14
<
jhass >
you know SemVer though? :P
21:18
<
asterite >
Yes, but...
21:18
<
asterite >
In 0.x anything is allowed XD
21:22
asterite has quit [Quit: Page closed]
21:27
DeBot has quit [Ping timeout: 252 seconds]
21:31
DeBot has joined #crystal-lang
21:52
waj has quit [Quit: Leaving.]
22:07
waj has joined #crystal-lang
22:07
r20 has joined #crystal-lang
22:29
the_asterite has joined #crystal-lang
22:30
<
the_asterite >
jhass: my bad, I think 0.6 makes more sense
22:31
<
the_asterite >
I just fear reaching 0.9, feels almost like 1.0 (I know it's not)
22:35
<
jhass >
we can jump from 0.8 to 0.10 :P
22:35
<
jhass >
and you sure you don't want an account on my bouncer? ;D
22:40
<
jhass >
btw. no I'd like to do reference constants defined in the same file before they're defined outside libs (inside a module) too :P
22:49
filer__ has joined #crystal-lang
22:50
endou_______ has joined #crystal-lang
22:50
drizz has quit [Ping timeout: 245 seconds]
22:50
endou______ has quit [Ping timeout: 245 seconds]
22:50
filer has quit [Ping timeout: 245 seconds]
22:50
drizz has joined #crystal-lang
22:51
<
the_asterite >
why?
22:51
<
jhass >
>> class B < A; end; class A; end;
22:51
<
DeBot >
jhass: Error in line 3: undefined constant A
22:52
<
jhass >
essentially, but in a module
22:52
<
the_asterite >
are you generating that with a tool?
22:52
<
the_asterite >
Even in Ruby that doesn't work
22:59
<
jhass >
yeah same thing as in the libs really
23:00
<
jhass >
toying with generating the wrapper classes
23:00
<
jhass >
I probably could put every one in its own file and generate the require for the parent, but meh
23:00
<
jhass >
also Ruby has .const_missing and Module.new :P
23:01
drizz has quit [Ping timeout: 245 seconds]
23:02
drizz has joined #crystal-lang
23:08
<
the_asterite >
Hehe, right
23:08
<
the_asterite >
I'm not sure about this last thing, though
23:11
the_asterite has quit [Quit: qicr for android: faster and better]
23:24
ryanf has quit [Ping timeout: 252 seconds]
23:24
drizz has quit [Ping timeout: 240 seconds]
23:24
ryanf has joined #crystal-lang
23:25
drizz has joined #crystal-lang
23:33
drizz has quit [Ping timeout: 245 seconds]
23:33
drizz has joined #crystal-lang