00:07
<
FromGitter >
<watzon> Even this puppeteer port is a personal project. I started it like 2 years ago and dropped it because I didn't know enough back then.
00:07
<
FromGitter >
<watzon> But I'm back baby!
00:07
<
FromGitter >
<dscottboggs_gitlab> hell yeah... a lot you can learn in 2 years
00:10
<
FromGitter >
<Blacksmoke16> 2 years was a long time ago :P
00:11
<
FromGitter >
<watzon> And I've come a long way in that time
00:12
<
FromGitter >
<Blacksmoke16> i guess so :P
00:12
<
FromGitter >
<Blacksmoke16> 2 years ago i was still a sophmore
00:58
<
FromGitter >
<girng> AWWW
00:58
<
FromGitter >
<girng> hellooo
01:08
<
FromGitter >
<Blacksmoke16> o/
01:27
<
FromGitter >
<watzon> Weird
01:28
<
FromGitter >
<Blacksmoke16> setting the restriction on the method to `Base` seems to fix it
01:29
<
FromGitter >
<watzon> Ahh yeah I didn't catch that
01:29
<
FromGitter >
<watzon> I wonder if that could be called a bug though?
01:30
<
FromGitter >
<Blacksmoke16> dunno
02:46
laaron has joined #crystal-lang
02:55
<
FromGitter >
<girng> WTF
02:55
<
FromGitter >
<girng> grrrrrrrrrrrr
03:12
<
FromGitter >
<girng> Array reference is back
03:16
<
FromGitter >
<girng> wait, gonna reduce this
03:16
<
FromGitter >
<watzon> Please do, I'm confused as to what the problem is
03:18
<
FromGitter >
<girng> Sorry reduced
03:19
<
FromGitter >
<girng> Should be clearer now
03:22
<
FromGitter >
<girng> This damn matrix updated all of its array when I only modified 1
03:22
<
FromGitter >
<girng> LOOOOOOOOOOOOOOOOOOL
03:28
<
FromGitter >
<watzon> I feel like I'm missing something here
03:42
<
FromGitter >
<girng> interesting
03:44
<
FromGitter >
<girng> Constructor of Array.new might be generating arrays in the matrix as references maybe? Then, when an array in the matrix is changed, all of those are updated as well. Not sure if I'm making sense at this point. I just found this very weird
03:45
<
FromGitter >
<watzon> Wait
03:45
<
FromGitter >
<watzon> I've got it
03:46
<
FromGitter >
<watzon> there you go
03:47
<
FromGitter >
<watzon> Also, don't use a capital `I` for inventory unless it's going to be a constant
03:47
<
FromGitter >
<girng> wtf
04:08
Raimondi has quit [Ping timeout: 258 seconds]
04:18
DTZUZO has joined #crystal-lang
04:36
ht_ has joined #crystal-lang
04:40
Raimondi has joined #crystal-lang
05:12
ht_ has quit [Quit: ht_]
05:31
absolutejam has joined #crystal-lang
05:42
Raimondi has quit [Ping timeout: 258 seconds]
06:02
<
FromGitter >
<watzon> Has anyone tried to do a N-Body simulation with Crystal?
06:09
DTZUZO has quit [Ping timeout: 258 seconds]
06:16
DTZUZO has joined #crystal-lang
06:34
<
FromGitter >
<bew> Defi
06:34
<
FromGitter >
<bew> Definitely not me, i'm curious, what would you need this for?
06:35
<
FromGitter >
<watzon> It's just a benchmarking program really. I'd just love to see what a Crystal implementation would look like.
06:37
<
FromGitter >
<bew> It's mesmerizing to watch
06:37
<
FromGitter >
<watzon> Right?!
06:37
<
FromGitter >
<watzon> It's pretty awesome. I want to understand more of the math behind the simulation
06:37
absolutejam has quit [Ping timeout: 245 seconds]
06:38
<
FromGitter >
<watzon> But I'm dumb
06:38
<
FromGitter >
<watzon> Lol
06:41
<
FromGitter >
<bew> I've no idea how to make that happen either
06:42
<
FromGitter >
<bew> Maybe a little, but definitely not how to make it right and working^^
06:43
<
FromGitter >
<watzon> Me neither man, me neither
06:58
alex`` has joined #crystal-lang
07:19
absolutejam has joined #crystal-lang
07:38
Raimondi has joined #crystal-lang
08:08
absolutejam has quit [Ping timeout: 246 seconds]
08:09
<
livcd >
girng: what graal is doing so yes
08:10
<
livcd >
girng: oops sorry i was just looking at an old question of yours
08:12
Raimondi has quit [Ping timeout: 258 seconds]
08:46
<
FromGitter >
<girng> ;D
08:47
<
FromGitter >
<girng> "The search could not be completed because the search keywords were too short, too long, or too common."
08:47
<
FromGitter >
<girng> a search query is "too common" lmaoo okay
09:00
Raimondi has joined #crystal-lang
10:40
<
FromGitter >
<asterite> nbody benchmark already exists for Crystal, search for benchmarks from kostya
10:43
<
FromGitter >
<watzon> That's awesome! Thanks @asterite
10:50
<
FromGitter >
<asterite> (minus the graphical simulation :-))
11:07
laaron has quit [Remote host closed the connection]
11:10
laaron has joined #crystal-lang
11:34
alex`` has quit [Ping timeout: 268 seconds]
11:36
alex`` has joined #crystal-lang
11:40
absolutejam has joined #crystal-lang
12:05
absolutejam has quit [Ping timeout: 258 seconds]
12:11
<
FromGitter >
<girng> nice
12:15
<
FromGitter >
<DRVTiny> Hello, people ^) ⏎ Is there any conference about Crystal?
12:16
<
FromGitter >
<girng> like a presentation?
12:23
<
FromGitter >
<DRVTiny> I mean offline conferencion, like JuliaCon or PerlCon
12:23
<
FromGitter >
<girng> Aww, don't think so
12:26
absolutejam has joined #crystal-lang
13:03
absolutejam has quit [Ping timeout: 268 seconds]
13:33
lucasb has joined #crystal-lang
13:55
alex`` has quit [Quit: WeeChat 2.5]
14:39
Raimondi has quit [Ping timeout: 258 seconds]
14:39
greengriminal has joined #crystal-lang
14:51
return0e has quit [Ping timeout: 258 seconds]
14:59
return0e has joined #crystal-lang
15:02
ht_ has joined #crystal-lang
15:09
Raimondi has joined #crystal-lang
15:47
return0e has quit [Ping timeout: 248 seconds]
16:13
DTZUZO has quit [Ping timeout: 268 seconds]
16:25
moei has joined #crystal-lang
16:36
return0e has joined #crystal-lang
17:04
sorcus has quit [Ping timeout: 252 seconds]
17:59
greengriminal has quit [Quit: Leaving]
18:02
rohitpaulk has joined #crystal-lang
18:17
alex`` has joined #crystal-lang
18:22
laaron has joined #crystal-lang
19:32
rohitpaulk has quit [Ping timeout: 248 seconds]
19:46
absolutejam has joined #crystal-lang
20:04
<
FromGitter >
<Blacksmoke16> released our first piece of code using crystal at work today
20:04
<
FromGitter >
<watzon> @Blacksmoke16 what's that?
20:04
<
FromGitter >
<Blacksmoke16> brought runtime from ~40min to ~13min
20:05
<
FromGitter >
<Blacksmoke16> generating json/xml feeds for partners to consume
20:05
<
FromGitter >
<watzon> Damn that's a nice performance boost
20:07
<
FromGitter >
<Blacksmoke16> indeed, other python lib we were using just didnt cut it
20:07
<
FromGitter >
<Blacksmoke16> was ~6.5min doing only 1 feed in json, now there is 1 json and 2 xml, so ill take it :P
20:10
<
FromGitter >
<watzon> Well yeah, it's python
20:10
<
FromGitter >
<watzon> Lol
20:32
ht_ has quit [Remote host closed the connection]
20:33
<
FromGitter >
<Blacksmoke16> 😉
20:50
absolutejam2 has joined #crystal-lang
20:52
absolutejam has quit [Ping timeout: 244 seconds]
21:06
absolutejam3 has joined #crystal-lang
21:08
absolutejam2 has quit [Ping timeout: 245 seconds]
21:09
<
FromGitter >
<watzon> I don't get how `Process#output` and `Process#error` work
21:09
<
FromGitter >
<Blacksmoke16> when doing like `Process.run`?
21:10
<
FromGitter >
<watzon> They are always nil, even if I explicitly provide `output` and `error` arguments to Process.new
21:10
<
FromGitter >
<Blacksmoke16> well they're going to be nil unless the process you run has output/errors after you run it
21:10
<
FromGitter >
<Blacksmoke16> its like the results from the execution of the proces
21:11
<
FromGitter >
<watzon> Right, the process that I'm running does though
21:11
<
FromGitter >
<watzon> If I leave those arguments out, or just set them to a filedescriptor it prints the output to stdout
21:11
<
FromGitter >
<Blacksmoke16> `Process.new` doesnt actually
*run* the process just to be clear
21:11
<
FromGitter >
<watzon> It executes it
21:11
<
FromGitter >
<watzon> It just doesn't wait for it to finish
21:11
<
FromGitter >
<Blacksmoke16> ah right
21:12
<
FromGitter >
<Blacksmoke16> code some code to share?
21:12
<
FromGitter >
<watzon> Which is what I need
21:12
<
FromGitter >
<watzon> I'll try and minimize a sample
21:12
<
FromGitter >
<Blacksmoke16> then just do `Process.run` which executes and waits
21:12
<
FromGitter >
<Blacksmoke16> and returns a `Process::Status`
21:13
<
FromGitter >
<watzon> I don't want to wait for the process to complete though, because then that blocks me from doing other things
21:13
<
FromGitter >
<watzon> And I need to keep a record of the process so I can kill it
21:14
<
FromGitter >
<Blacksmoke16> hmm
21:15
<
FromGitter >
<watzon> Basically this is what I'm trying to do
21:15
<
FromGitter >
<watzon> But output and error are always nil
21:16
<
FromGitter >
<watzon> And even waiting for it to complete, nothing seems to get written to the io
21:16
<
FromGitter >
<watzon> Which might be because `Process.new` converts the IO to a FileDescriptor
21:16
<
FromGitter >
<Blacksmoke16> oh
21:17
<
FromGitter >
<Blacksmoke16> try just `puts output`
21:17
<
FromGitter >
<Blacksmoke16> dont have to access it via the process
21:18
<
FromGitter >
<Blacksmoke16> when waiting for it to finish at least
21:19
<
FromGitter >
<Blacksmoke16> prob just isnt anything there
21:19
<
FromGitter >
<watzon> Ahh ok
21:22
<
FromGitter >
<watzon> So I'm going to need to find a way to wait for the io to have something in it
21:22
<
FromGitter >
<watzon> Because I can't do `Process#wait`
21:22
<
FromGitter >
<watzon> But I need to get a value from the processes stderr
21:24
<
FromGitter >
<Blacksmoke16> sec
21:26
<
FromGitter >
<Blacksmoke16> something like that?
21:31
<
FromGitter >
<watzon> Not quite. Basically this is the scenario: I am launching a headless Chrome instance using `Process.new`, once that process has launched it will write to stderr `DevTools listening on ws://websocketaddress` which I need to parse so that I can retrieve the websocket address. In javascript this would be easy because I can just add an event listener, but it seems to be a little more difficult here
21:31
<
FromGitter >
<watzon> I'm wondering if `IO.pipe` will work though
21:34
<
FromGitter >
<Blacksmoke16> :shrug:
21:45
<
FromGitter >
<asterite> why can't you `Process#wait`?
21:46
<
FromGitter >
<watzon> Because I don't want to wait for the process to finish
21:48
<
FromGitter >
<watzon> I think I figured it out though
21:48
<
FromGitter >
<watzon> Feels kinda hacky, but just using a loop and reading the io as a string seems to work
21:48
<
FromGitter >
<asterite> @Blacksmoke16 It's great that you are using Crystal at work! And nice performance boost
21:49
<
FromGitter >
<watzon> @asterite but that closes the process
21:51
<
FromGitter >
<asterite> ah... it also works if you don't close the process
21:51
<
FromGitter >
<watzon> Ahh ok
21:52
<
FromGitter >
<asterite> I was just closing it to be polite :-)
21:52
<
FromGitter >
<asterite> Actually, it doesn't work
21:53
<
FromGitter >
<asterite> sorry
21:55
dwdv has joined #crystal-lang
22:04
<
FromGitter >
<asterite> Actually, it works! My example was bad because it did `gets_to_end` so it waited until the writer didn't have more data, and for that the writer must be closed, and for that the process must close
22:04
<
FromGitter >
<asterite> So I guess in your case you can `gets` some times until you get the ws line you need to parse
22:05
<
FromGitter >
<asterite> (I also tried it with a process that outputs numbers with `sleep 1` between each number, and it works fine)
22:05
<
FromGitter >
<watzon> I'll try that :)
22:05
<
FromGitter >
<watzon> Thanks
22:13
<
FromGitter >
<watzon> Hmm keeps timing out
22:13
<
FromGitter >
<watzon> And locally I'm getting a bad file descriptor for some reason
22:17
<
FromGitter >
<watzon> But the `sleep` feels hacky
22:17
<
rkeene >
I might go work for Amazon AWS
22:17
<
rkeene >
Got an offer
22:18
<
FromGitter >
<watzon> Oooh congrats
23:08
DTZUZO has joined #crystal-lang
23:23
absolutejam3 has quit [Ping timeout: 272 seconds]
23:35
alex`` has quit [Ping timeout: 245 seconds]
23:37
DTZUZO has quit [Ping timeout: 245 seconds]
23:50
<
FromGitter >
<jwoertink> Is there a way to do this?
23:51
<
FromGitter >
<jwoertink> Where I have a top level generic, but I need to call a constant within that namespace
23:52
<
FromGitter >
<jwoertink> That's pretty awesome @rkeene!
23:53
<
FromGitter >
<watzon> @jwoertink what is `name` in this case? A method?
23:54
<
FromGitter >
<watzon> Or are you trying to get the class name?
23:54
<
FromGitter >
<jwoertink> yeah, just the class name
23:54
<
FromGitter >
<watzon> `T.class`
23:54
<
FromGitter >
<jwoertink> oh, sorry, I have a typo
23:54
<
FromGitter >
<watzon> You might have to do `to_s`
23:54
<
FromGitter >
<watzon> Ahhh ok
23:55
<
FromGitter >
<jwoertink> I was hoping that was it lol
23:55
<
FromGitter >
<jwoertink> but this is a syntax error
23:56
<
FromGitter >
<jwoertink> oh, wait.. that's not how that would work
23:56
<
FromGitter >
<jwoertink> it was right the first time.... wasn't it?
23:57
<
FromGitter >
<jwoertink> ah, yeah that works
23:57
<
FromGitter >
<jwoertink> awesome
23:57
lucasb has quit [Quit: Connection closed for inactivity]
23:58
<
FromGitter >
<watzon> Idk why you can't do`Foo(String)::Bar.run` though
23:59
<
FromGitter >
<jwoertink> no clue. I assumed that's how it would work, but nope 😄
23:59
<
FromGitter >
<jwoertink> thanks for the help!
23:59
<
FromGitter >
<watzon> No problem