00:16
alexherbo2 has quit [Ping timeout: 272 seconds]
00:23
alexherbo2 has joined #crystal-lang
00:53
HumanG33k has quit [Remote host closed the connection]
00:54
HumanG33k has joined #crystal-lang
02:04
deavmi has quit [Ping timeout: 260 seconds]
02:09
deavmi has joined #crystal-lang
02:52
_whitelogger has joined #crystal-lang
03:54
f1reflyylmao has joined #crystal-lang
03:55
f1refly has quit [Ping timeout: 264 seconds]
04:01
avane has joined #crystal-lang
04:04
ua has quit [Ping timeout: 256 seconds]
05:46
DTZUZU has quit [Read error: Connection reset by peer]
05:47
DTZUZU has joined #crystal-lang
05:55
<
FromGitter >
<HertzDevil> ruby used to yield 2 values too
05:55
<
FromGitter >
<HertzDevil> apparently they turned back to 2-element array for 3.0 preview
06:22
<
FromGitter >
<grkek> I wrote a dialect for HTML
06:22
<
FromGitter >
<grkek> hooked in the duktape js engine
06:23
<
FromGitter >
<grkek> and built it on top of gtk
06:23
<
FromGitter >
<grkek> and it looks like this
06:24
<
FromGitter >
<grkek> what do you guys think of it?
06:25
<
FromGitter >
<grkek> Waste of time and 3 days or nah?
06:27
<
FromGitter >
<grkek> it resides here if you guys want to check it out :p
06:44
<
FromGitter >
<grkek> Seems like I need to monkey patch the duktape library cuz I forgot to do so :p
07:24
deavmi has quit [Ping timeout: 268 seconds]
07:29
deavmi has joined #crystal-lang
08:00
Liothen has quit [Ping timeout: 260 seconds]
08:06
Liothen has joined #crystal-lang
08:34
<
FromGitter >
<grkek> How does one pass a clojure to C?
09:00
return0e[m] has quit [Quit: Idle for 30+ days]
09:13
ua has joined #crystal-lang
10:10
_whitelogger has joined #crystal-lang
10:11
<
FromGitter >
<grkek> I am kind of slow with C
10:11
<
FromGitter >
<grkek> could anyone help?
10:22
sorcus has quit [Quit: WeeChat 2.9]
10:27
sorcus has joined #crystal-lang
10:47
<
jhass >
well, as it says at the bottom, you found a bug in the compiler :)
10:47
<
jhass >
(or potentially LLVM)
11:03
<
FromGitter >
<grkek> Not with that :P I mean the gobject library
11:04
<
FromGitter >
<grkek> I want to access the window resize function from a javascript engine of the duktape global proc definition
11:04
<
FromGitter >
<grkek> Didn't word that right but you get what I mean
11:26
f1reflyylmao is now known as f1refly
12:46
deavmi has quit [Quit: Eish! Load shedding.]
12:48
deavmi has joined #crystal-lang
12:51
deavmi has quit [Read error: Connection reset by peer]
12:53
deavmi has joined #crystal-lang
13:04
alexherbo2 has joined #crystal-lang
13:46
<
FromGitter >
<j8r> @HertzDevil @wyhaines oprypin point me that it is because of the `Enumerable(Typle(K, V))` interface to implement
13:49
<
FromGitter >
<j8r> I don't know if changing `Enumerable(T)` to `Enumerable(*T)` can make it
14:15
ua has quit [Ping timeout: 264 seconds]
14:22
<
raz >
grkek: i love it! (layout) no idea if i'll ever find an excuse to actually use it, but declarative seems to be the way to go
15:02
ua has joined #crystal-lang
15:06
HumanG33k has quit [Ping timeout: 240 seconds]
15:13
HumanG33k has joined #crystal-lang
17:38
<
FromGitter >
<grkek> Thank you mate, I don't even know if Ill be able to finish it tho
18:26
<
FromGitter >
<grkek> When you pass a constant into a closure it doesn't panic and seems not to care at all
18:29
<
oprypin >
grkek, yea that's fine. and, well, it's not a closure at that point
18:29
<
FromGitter >
<grkek> Can you help me, mr magicman
18:30
<
oprypin >
a closure needs to be formed when the proc refers to a variable which doesn't have a fixed memory address (but constants have it)
18:30
<
FromGitter >
<grkek> ?
18:30
<
oprypin >
grkek, whats the problem
18:30
<
FromGitter >
<grkek> How does one do this?
18:31
<
FromGitter >
<grkek> It errors out saying that I can't pass a closure to c
18:31
<
oprypin >
i dont know anything about Duktape
18:31
<
FromGitter >
<grkek> here are those two functions which are used.
18:33
mps has left #crystal-lang [#crystal-lang]
18:37
<
oprypin >
grkek, duktape.cr could do a much better job i think
18:37
<
oprypin >
i currently have no understanding of the "stack" in duktape.cr
18:38
<
FromGitter >
<grkek> Let me try :)
18:42
<
oprypin >
i think `push_proc` could be something like `LibDUK.push_pointer(Box.box(block)); LibDUK.push_c_function(ctx, -> { |ctx| Box(typeof(block)).unbox(LibDUK.get_pointer).call(ctx) }, nargs)`
18:42
<
oprypin >
then it'd seamlessly support closures
18:42
<
oprypin >
i'm just really uncertain about the stack interaction, my usage of `get_pointer` is a pure guess
18:43
<
oprypin >
uh i mean @grkek
18:44
<
FromGitter >
<grkek> What does it want hmm
18:44
<
oprypin >
uh maybe the space is not allowed
18:45
<
oprypin >
lol no it says exactly what it wants
18:45
<
FromGitter >
<grkek> So what is the context
18:45
<
oprypin >
the syntax is `->(ctx) {`
18:46
<
oprypin >
i have no idea, totally not possible to trace it back the way this lib is organized
18:46
<
oprypin >
god i hate the standards that ruby has set
18:46
<
FromGitter >
<grkek> That is odd
18:46
<
FromGitter >
<grkek> the push pointer function has 1 args
18:47
<
oprypin >
push_pointer has 1; LibDUK.push_pointer has 2
18:47
<
FromGitter >
<grkek> What is the other one?
18:47
<
oprypin >
the last link i sent
18:48
<
FromGitter >
<grkek> Oh
18:51
<
FromGitter >
<grkek> I am still stuck
18:51
<
FromGitter >
<grkek> Where do I get the index from?
18:52
<
oprypin >
grkek, maybe it's -1
18:52
<
FromGitter >
<grkek> ill try
18:52
<
FromGitter >
<grkek> thank you :)
18:54
<
FromGitter >
<grkek> Well, at least we tried?
18:55
<
FromGitter >
<grkek> Here is my monkey patch
18:55
<
oprypin >
grkek, the answer is somewhere here. you just need to learn how duktape stack works
18:55
<
FromGitter >
<grkek> Oh lol
18:55
<
FromGitter >
<grkek> I changed -2 to -1
18:55
<
FromGitter >
<grkek> and it worked?
18:56
<
FromGitter >
<grkek> Well no
18:56
<
oprypin >
`.get_pointer(ctx, 4)` why 4
18:57
<
FromGitter >
<grkek> I don't really know
18:57
<
FromGitter >
<grkek> what should I use there?
18:57
<
FromGitter >
<grkek> Sorry that I am so slow with pointers
19:02
<
oprypin >
the main thing i see from here is that these values must never be positive for this purpose
19:02
<
oprypin >
not to mention that i directly said that "-1" should probably be the index
19:03
<
FromGitter >
<grkek> Again an error that I don't understand why
19:03
<
FromGitter >
<grkek> it is still defining the string at -2\
19:03
<
FromGitter >
<grkek> what is the problem hmmm...
19:03
<
oprypin >
i dont think `push_global_proc` should be changed
19:04
<
FromGitter >
<grkek> If I put both -1
19:04
<
FromGitter >
<grkek> i get a segfault
19:04
<
oprypin >
it's originally -2 so why do u put -1
19:13
<
FromGitter >
<grkek> Damn it I hate C
19:17
alexherbo20 has joined #crystal-lang
19:18
alexherbo2 has quit [Ping timeout: 258 seconds]
19:18
alexherbo20 is now known as alexherbo2
19:41
<
FromGitter >
<grkek> If i replace the push_costom_proc push_c_function proc details it works
19:41
<
FromGitter >
<grkek> if it has none of that proc = Box
19:41
<
FromGitter >
<grkek> it works but when I try this way it crashes
19:41
<
FromGitter >
<grkek> the get pointer function returns a pointer(void).null
22:09
teardown has quit [Ping timeout: 240 seconds]
22:50
yukai has joined #crystal-lang
22:57
teardown has joined #crystal-lang
22:59
alexherbo2 has quit [Read error: Connection reset by peer]
23:02
alexherbo2 has joined #crystal-lang