00:03
zamith has joined #crystal-lang
00:09
zamith has quit [Ping timeout: 272 seconds]
00:16
zamith has joined #crystal-lang
00:22
zamith has quit [Ping timeout: 276 seconds]
01:18
zamith has joined #crystal-lang
01:22
zamith has quit [Ping timeout: 250 seconds]
01:43
mdz_ has joined #crystal-lang
01:45
havenwood has quit [Remote host closed the connection]
01:55
mdz_ has quit [Remote host closed the connection]
02:12
zamith has joined #crystal-lang
02:16
zamith has quit [Ping timeout: 245 seconds]
02:34
havenwood has joined #crystal-lang
02:56
mdz_ has joined #crystal-lang
03:01
mdz_ has quit [Ping timeout: 265 seconds]
03:06
zamith has joined #crystal-lang
03:16
zamith has quit [Ping timeout: 272 seconds]
03:24
DerisiveLogic has quit [Ping timeout: 265 seconds]
03:40
bcardiff has joined #crystal-lang
03:59
DerisiveLogic has joined #crystal-lang
04:01
zamith has joined #crystal-lang
04:06
zamith has quit [Ping timeout: 255 seconds]
04:08
bcardiff has quit [Quit: Leaving.]
04:09
mdz_ has joined #crystal-lang
04:12
JBat has joined #crystal-lang
04:13
mdz_ has quit [Ping timeout: 240 seconds]
04:19
mdz_ has joined #crystal-lang
04:28
mdz__ has joined #crystal-lang
04:28
mdz__ has quit [Remote host closed the connection]
04:31
mdz_ has quit [Ping timeout: 240 seconds]
04:41
bcardiff has joined #crystal-lang
04:54
ismaelga has joined #crystal-lang
04:54
bcardiff has quit [Quit: Leaving.]
04:55
zamith has joined #crystal-lang
04:58
ismaelga has quit [Remote host closed the connection]
05:00
ismaelga has joined #crystal-lang
05:00
zamith has quit [Ping timeout: 276 seconds]
05:29
mdz_ has joined #crystal-lang
05:33
mdz_ has quit [Ping timeout: 244 seconds]
05:37
datanoise has quit [Ping timeout: 272 seconds]
05:49
zamith has joined #crystal-lang
05:54
zamith has quit [Ping timeout: 265 seconds]
06:03
datanoise has joined #crystal-lang
06:09
JBat has quit [Ping timeout: 246 seconds]
06:38
datanoise has quit [Ping timeout: 256 seconds]
06:41
strcmp1 has quit [Ping timeout: 272 seconds]
06:43
zamith has joined #crystal-lang
06:48
zamith has quit [Ping timeout: 250 seconds]
07:11
DerisiveLogic has quit [Ping timeout: 244 seconds]
07:28
BlaXpirit has joined #crystal-lang
07:37
zamith has joined #crystal-lang
07:42
zamith has quit [Ping timeout: 272 seconds]
07:43
zamith has joined #crystal-lang
07:46
blAckEn3d has joined #crystal-lang
07:48
zamith has quit [Ping timeout: 252 seconds]
07:52
<
unshadow >
>> File.write("/tmp/testing1234.test"); a = File.exist?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
07:52
<
unshadow >
>> File.write("/tmp/testing1234.test", "test"); a = File.exist?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
07:52
<
unshadow >
>> File.write("/tmp/testing1234.test", "test"); a = File.exists?("/tmp/testing1234.test"); File.delete("/tmp.testing1234.test") if a
07:53
<
unshadow >
>> File.write("/tmp/testing1234.test", "test"); a = File.exists?("/tmp/testing1234.test"); File.delete("/tmp/testing1234.test") if a
07:53
<
unshadow >
>> path = "/tmp/testing1234.test"; File.write(path, "test"); a = File.exists?(path); File.delete(path) if a
07:54
strcmp1 has joined #crystal-lang
07:56
royaso has joined #crystal-lang
07:56
royaso has left #crystal-lang [#crystal-lang]
08:06
<
unshadow >
Is there a way to patch a lib on-the-fly ? I mean, if I have additions to a certain lib in the stdlibs , can I do something like class Thread < Thread and add what I want ?
08:10
<
jhass >
unshadow: just open it again, class Thread
08:11
<
unshadow >
Cool, thanks
08:14
<
unshadow >
lets say I have something like that:
http://carc.in/#/r/122 in my code, where will be good to put it ? as another file ? at the top of main file ?
08:16
<
unshadow >
what priority are the files loaded ? lets say my first call in my code is for the .alive? , do I need to make sure this part of the code is before ? is require always the first ?
08:23
datanoise has joined #crystal-lang
08:25
<
jhass >
currently I put it into lib/myproject/core_ext/thread.cr
08:26
<
jhass >
and require that explicitly before I need it
08:26
<
jhass >
(at the top of the file that needs it)
08:26
<
jhass >
pretty sure load order is FS order if you use things like ./*
08:30
datanoise has quit [Ping timeout: 256 seconds]
09:06
bcardiff has joined #crystal-lang
09:13
ismaelga has quit [Remote host closed the connection]
09:15
bcardiff has quit [Quit: Leaving.]
09:39
zamith has joined #crystal-lang
09:44
zamith has quit [Ping timeout: 252 seconds]
09:44
zamith has joined #crystal-lang
09:49
zamith has quit [Ping timeout: 246 seconds]
10:10
<
blAckEn3d >
is there any way to make the compiler dump the ast or any other way to expand macros?
10:11
<
jhass >
crystal hierarchy ?
10:11
Dreamer3 has quit [Ping timeout: 258 seconds]
10:12
<
jhass >
a "good" way to see what code a specific macro generated is to just add a syntax error to it
10:13
<
blAckEn3d >
crystal hierarchy doesn't seem to dump the methods in classes
10:13
<
jhass >
it's more intended for the types of the ivars
10:14
<
blAckEn3d >
yeah :)
10:14
<
jhass >
crystal doc should run after macro expansion too
10:14
<
blAckEn3d >
cool, I'll look into it
10:15
datanoise has joined #crystal-lang
10:20
datanoise has quit [Ping timeout: 256 seconds]
10:24
dhruv_ has quit [Ping timeout: 256 seconds]
10:28
ponga has joined #crystal-lang
10:40
<
blAckEn3d >
I get: in /usr/local/Cellar/crystal/0.7.2/src/llvm/builder.cr:19: tried to convert LLVM::Value to LibLLVM::ValueRef invoking to_unsafe, but can't deduce its type
10:40
Codcore has joined #crystal-lang
10:41
<
jhass >
mmh, you didn't touch LLVM::Value's definition though? or added subclasses or the like?
10:42
<
Codcore >
Is there a safe way to make "self.new" method of a class private without redefining it?
10:44
<
jhass >
at least for now, might want to open a suggestion for it
10:45
<
Codcore >
jhass, thanks it fits for me
10:46
<
jhass >
it expects a ValueRef though
10:47
<
blAckEn3d >
@jhass I had the same code in a non-visitor method and it worked
10:47
<
jhass >
okay, ValueRef is Void* so it should accept anything anyway
10:48
<
Codcore >
it might be a macros for it like's Ruby private_class_method ":mehod_name"
10:48
<
jhass >
blAckEn3d: what if you pass val.unwrap though?
10:48
<
blAckEn3d >
if I change the code to: @ctx.builder.ret(LLVM::Int32, 1) it works
10:49
<
blAckEn3d >
let's see
10:50
<
jhass >
*shrug*, I'd say hang around until asterite drops by (might be not before tomorrow though)
10:50
<
blAckEn3d >
thanks :)
10:50
<
blAckEn3d >
I'll be around
10:53
<
unshadow >
Why can't Socket.write handle a string ? why should I Slice it to UInt8 ?
10:54
<
blAckEn3d >
just FIY, this works: @ctx.builder.ret (val.unwrap as LibLLVM::ValueRef)
10:54
<
blAckEn3d >
must be a bug in the type inferencer
10:55
<
jhass >
unshadow: just use <<
10:56
<
unshadow >
Socket.write << "String" ?
10:56
<
unshadow >
>> puts << "test"
10:56
<
unshadow >
>> puts << "test".to_s
10:57
<
unshadow >
>> a = << "test"
10:57
zamith has joined #crystal-lang
10:58
<
unshadow >
how do I use the << thingy ?
11:00
<
unshadow >
Oh, so Socket << "String"
11:02
zamith has quit [Ping timeout: 255 seconds]
11:02
<
jhass >
io << "string", yeah
11:05
<
unshadow >
jhass: working, thanks :)
11:15
blAckEn3d has quit []
11:17
datanoise has joined #crystal-lang
11:22
datanoise has quit [Ping timeout: 265 seconds]
11:38
<
Codcore >
yeah, by nobody answered
11:39
<
jhass >
it's sunday, have some patience ;)
11:39
<
Codcore >
Oh, I forgot it
11:39
<
unshadow >
XD only jhass is here 24/7 not sleeping not eating.
11:40
<
Codcore >
He is crzy =)
11:40
<
unshadow >
Codcore: almost, he is german ;)
11:48
<
unshadow >
How can I tail (follow) a file using Crystal ? for example, I want to see if something new is added and then do with it something
11:53
<
Codcore >
unshadow, You need to watching at 'modified' metainformation of file, i think
11:55
<
unshadow >
I see file has mtime, is that modified time ?
11:55
<
Codcore >
=) I think it is
11:55
<
unshadow >
>> system("touch /tmp/testing1234"); File.mtime("/tmp/testing1234")
11:56
<
unshadow >
>> system("touch /tmp/testing1234"); File::Stat.mtime("/tmp/testing1234")
11:56
<
unshadow >
>> system("touch /tmp/testing1234"); f = File::Stat.new("/tmp/testing1234"); puts f.mtime
11:57
<
unshadow >
>> system("touch /tmp/testing1234"); f = File::Stat.new("/tmp/testing1234"); puts f.blksize
11:59
<
unshadow >
whats the difference between a Fiber and a Thread ?
12:00
<
unshadow >
nm, used google
12:09
<
unshadow >
>> STDOUT << "Testing"
12:13
<
unshadow >
jhass: What do you say about the Threads v.s Fibers thingy ? don't you think that using Fibers instead of Threads is like getting stuck under Ruby's GIL all over again ?
12:14
<
jhass >
once properly implemented you can stack fibers into threads and even cross thread boundaries
12:15
<
unshadow >
Oh, so it's lie using multiple MRI's each with it's own set of Fibers
12:16
<
jhass >
mh, no, you don't understand the GVL I think :P
12:16
<
unshadow >
Wht's GVL ?
12:16
<
jhass >
well, MRI is a VM since 1.9, not an interpreter, so a nitpick ;P
12:17
<
unshadow >
Global VM Lock hahah
12:17
leafybasil has quit [Remote host closed the connection]
12:18
<
unshadow >
As far as I know, the GIL (GVL) is an issue where because the VM is using a Single Thread and rubies threads are not real (as in virtual thread) then you cannot do more then 1 concurent execution of ruby code (not incl IO operations which are handeled differently)
12:20
sandelius has joined #crystal-lang
12:20
<
jhass >
A ruby thread is backed by a real pthread
12:20
<
jhass >
MRI just ensures that only one thread is active when executing Ruby code
12:21
<
jhass >
well, basically
12:22
<
unshadow >
Ok, so this means it's almost like Fibers, the mechanizem is different, but the end result is the same
12:24
<
jhass >
well, for now, the mid term plan is to have the fibers distributed to a thread pool
12:25
<
unshadow >
And who controls the thread pool ?
12:25
<
unshadow >
like, will you have a way to specify maximum Threads ?
12:26
<
jhass >
I think nobody has an idea yet
12:26
<
unshadow >
so this is a long term goal
12:27
<
jhass >
well, everybody defines their terms different I guess
13:07
datanoise has joined #crystal-lang
13:09
<
unshadow >
jhass: Thanks for the link, it was a good read (all 3 parts) I guess I really didn't understand how the GIL works
13:13
datanoise has quit [Ping timeout: 265 seconds]
13:37
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
13:39
BlaXpirit_ has joined #crystal-lang
13:39
BlaXpirit has quit [Killed (orwell.freenode.net (Nickname regained by services))]
13:52
sandelius has joined #crystal-lang
13:56
DerisiveLogic has joined #crystal-lang
14:00
DerisiveLogic has quit [Ping timeout: 256 seconds]
14:04
bcardiff has joined #crystal-lang
14:21
DerisiveLogic has joined #crystal-lang
14:25
datanoise has joined #crystal-lang
14:29
ismaelga has joined #crystal-lang
14:32
datanoise has quit [Ping timeout: 272 seconds]
14:47
<
vikaton >
is Crystal technically corporately backed?
14:48
havenwood has joined #crystal-lang
15:00
ismaelga has quit [Ping timeout: 250 seconds]
15:20
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
15:40
<
unshadow >
Looks like I'm the only one who ever used regex in gets... I was sure this was a regular thingy to do
15:41
sandelius has joined #crystal-lang
15:49
ismaelga has joined #crystal-lang
15:59
asterite has joined #crystal-lang
15:59
asterite has quit [Client Quit]
16:07
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
16:08
datanoise has joined #crystal-lang
16:22
sandelius has joined #crystal-lang
16:24
ismaelga has quit [Remote host closed the connection]
16:24
Dreamer3 has joined #crystal-lang
16:28
leafybasil has joined #crystal-lang
16:50
kulelu88 has joined #crystal-lang
16:54
datanoise has quit [Ping timeout: 252 seconds]
17:11
havenn has joined #crystal-lang
17:14
havenwood has quit [Ping timeout: 256 seconds]
17:14
havenn is now known as havenwood
17:37
datanoise has joined #crystal-lang
17:49
ismaelga has joined #crystal-lang
18:03
zamith has joined #crystal-lang
18:04
<
crystal-gh >
[crystal] veelenga opened pull request #719: Corrected build command name in crystal build usage (master...usage_desc_fix)
http://git.io/vkodx
18:11
ponga has quit [Quit: Leaving...]
18:22
ismaelga has quit [Remote host closed the connection]
18:31
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:35
sandelius has joined #crystal-lang
18:44
ismaelga has joined #crystal-lang
18:47
datanoise has quit [Ping timeout: 256 seconds]
18:47
flaviu has joined #crystal-lang
19:14
datanoise has joined #crystal-lang
19:18
ismaelga has quit [Remote host closed the connection]
19:35
mdz_ has joined #crystal-lang
19:35
datanoise has quit [Ping timeout: 240 seconds]
19:39
mdz_ has quit [Ping timeout: 272 seconds]
20:07
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
20:25
mdz_ has joined #crystal-lang
20:25
bcardiff has quit [Quit: Leaving.]
20:35
miah has joined #crystal-lang
20:37
bcardiff has joined #crystal-lang
20:45
<
BlaXpirit >
i made yet another partially working lib generator. yay.
20:45
zamith has quit [Quit: Be back later ...]
20:46
<
BlaXpirit >
well it's actually pretty complete, just gotta add constants and variables
20:54
<
jhass >
what approach? clang API?
20:59
<
BlaXpirit >
jhass, Python library that parses C :|
21:00
zamith has joined #crystal-lang
21:00
<
jhass >
ah, so the ruby-ffi thingy except in python :P
21:00
<
jhass >
only perl's left I guess!
21:01
<
BlaXpirit >
i dont know ruby-ffi, and the thing based on it is definitely incomplete
21:02
<
jhass >
recently found something nice in glib-2.0, typedef struct GTestCase GTestCase;
21:02
<
jhass >
wonder what you'd generate for that
21:03
<
BlaXpirit >
jhass, type GTestCase = Void*
21:03
<
jhass >
will have to update crystal-gobject to do that eventually
21:03
<
BlaXpirit >
and then i remove 1 pointer when it's used :>
21:03
<
jhass >
well, you can alias to Void too
21:04
<
BlaXpirit >
now i realized that the lib just uses preprocessor, so it ignores #define constants
21:05
<
BlaXpirit >
so i'm gonna make some dirty hacks :>
21:08
Codcore has quit [Quit: Page closed]
21:15
zamith has quit [Quit: Be back later ...]
21:20
datanoise has joined #crystal-lang
21:25
datanoise has quit [Ping timeout: 252 seconds]
21:32
ismaelga has joined #crystal-lang
21:34
<
BlaXpirit >
i need asterite or waj
21:35
<
BlaXpirit >
well not really
21:37
<
BlaXpirit >
cpp -dM ftw
21:49
strcmp1 has quit [Quit: Leaving]
21:54
<
BlaXpirit >
hmm I would like to make many requests to Crystal asking it "does this compile?"
22:06
kulelu88 has quit [Ping timeout: 264 seconds]
22:28
BlaXpirit has quit [Quit: Quit Konversation]
22:31
kulelu88 has joined #crystal-lang
22:50
ismaelga has quit [Remote host closed the connection]
22:50
ismaelga has joined #crystal-lang
23:10
datanoise has joined #crystal-lang
23:13
willl has quit [Quit: Connection closed for inactivity]
23:16
datanoise has quit [Ping timeout: 246 seconds]
23:37
ismaelga has quit [Remote host closed the connection]
23:43
ismaelga has joined #crystal-lang
23:44
datanoise has joined #crystal-lang
23:49
willl has joined #crystal-lang