<< 28-05-2016 >>

00:00:09Araq_cheatfate: I have a fix.
00:00:18Araq_I don't understand the fix.
00:17:41Araq_cheatfate: hopefully this doesn't introduce new regressions
00:20:40*PMunch quit (Quit: leaving)
00:23:09*yglukhov joined #nim
00:27:32*yglukhov quit (Ping timeout: 244 seconds)
00:30:08*zodiak quit ()
01:02:16*arnetheduck joined #nim
01:14:28*gugugaga joined #nim
01:46:32*yglukhov joined #nim
01:46:38*zodiak joined #nim
01:51:02*yglukhov quit (Ping timeout: 258 seconds)
02:01:51*user2 joined #nim
02:05:12*user___ quit (Ping timeout: 276 seconds)
02:13:10*Demon_Fox quit (Quit: Leaving)
02:31:27*vendethiel joined #nim
02:38:04*zacts quit (Ping timeout: 260 seconds)
02:46:40*der-landgraf joined #nim
02:46:40*der-landgraf quit (Changing host)
02:46:40*der-landgraf joined #nim
02:55:15*zacts joined #nim
03:08:12*yglukhov joined #nim
03:13:27*yglukhov quit (Ping timeout: 276 seconds)
03:27:10*kseg joined #nim
03:31:36*kseg quit (Ping timeout: 246 seconds)
03:46:42*bjz joined #nim
03:51:29*vendethiel quit (Ping timeout: 250 seconds)
03:57:30*dhk quit (Quit: Leaving)
04:30:05*yglukhov joined #nim
04:36:00*yglukhov quit (Ping timeout: 260 seconds)
05:35:18*bjz_ joined #nim
05:36:40*bjz quit (Ping timeout: 260 seconds)
05:53:03*yglukhov joined #nim
05:55:20*bjz joined #nim
05:56:36*bjz_ quit (Ping timeout: 276 seconds)
05:57:19*yglukhov quit (Ping timeout: 244 seconds)
06:06:12*Arrrr joined #nim
06:06:12*Arrrr quit (Changing host)
06:06:12*Arrrr joined #nim
06:30:28*gugugaga quit (Remote host closed the connection)
06:43:30*GangstaCat quit (Quit: Leaving)
06:46:39*Ven joined #nim
06:49:05*gugugaga joined #nim
06:52:39*user2 quit (Quit: WeeChat 1.5)
07:02:19*bjz_ joined #nim
07:04:04*bjz quit (Ping timeout: 260 seconds)
07:27:26*GangstaCat joined #nim
07:27:37cheatfateAraq_, patch is nice, all works :)
07:30:41*Sembei joined #nim
07:33:22*Matthias247 joined #nim
07:34:26*fastrom joined #nim
07:39:08*fastrom quit (Client Quit)
07:41:11*Sembei quit (Ping timeout: 244 seconds)
07:46:04*Arrrr quit (Ping timeout: 260 seconds)
08:26:12*Trustable joined #nim
08:28:55*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:36:29*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:36:42*vendethiel joined #nim
08:45:19*rok joined #nim
08:45:29*rok is now known as rok_
08:46:13*gugugaga quit (Quit: Leaving)
08:56:05*TheLemonMan joined #nim
08:58:38*bjz joined #nim
08:59:23*lubos_cz joined #nim
09:09:53*rok_ quit (Quit: rok_)
09:10:17*rok joined #nim
09:10:27*rok is now known as rok_
09:10:50*rok_ quit (Client Quit)
09:13:09*Arrrr joined #nim
09:13:09*Arrrr quit (Changing host)
09:13:09*Arrrr joined #nim
09:13:24*rok joined #nim
09:13:34*rok is now known as rok_
09:20:41*lubos_cz quit (Ping timeout: 240 seconds)
09:24:19*lubos_cz joined #nim
09:29:26*kseg joined #nim
09:34:03*kseg quit (Ping timeout: 264 seconds)
09:37:35*vendethiel quit (Ping timeout: 260 seconds)
09:44:35*Ven joined #nim
09:46:25*Sembei joined #nim
09:54:29*PMunch joined #nim
10:25:01*nsf quit (Quit: WeeChat 1.4)
10:28:06*rok_ quit (Quit: rok_)
10:38:30*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:48:52*Matthias247 quit (Read error: Connection reset by peer)
10:51:52*user2 joined #nim
11:30:15*kseg joined #nim
11:35:15*kseg quit (Ping timeout: 276 seconds)
11:36:57*|meta joined #nim
11:57:22*dhk joined #nim
12:03:13*nsf joined #nim
12:09:13*dhk quit (Quit: Leaving)
12:12:42*bjz_ joined #nim
12:13:37*bjz quit (Ping timeout: 252 seconds)
12:38:37*lubos_cz quit (Ping timeout: 244 seconds)
12:42:02*lubos_cz joined #nim
12:58:20*IcyFoxy quit (Quit: ZNC - 1.6.0 - http://znc.in)
13:13:15*Demon_Fox joined #nim
13:18:48*feixingjun joined #nim
13:19:23*feixingjun quit (Client Quit)
13:48:58*Matthias247 joined #nim
13:49:58*lubos_cz quit (Ping timeout: 272 seconds)
14:42:53*space-wizard joined #nim
14:43:20*Matthias247 quit (Quit: Matthias247)
14:51:23*|meta quit (Quit: Connection closed for inactivity)
14:55:06*space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…)
14:55:47*Matthias247 joined #nim
15:09:38*lubos_cz joined #nim
15:09:53*Trustable quit (Remote host closed the connection)
15:11:30*yglukhov joined #nim
15:12:06*yglukhov quit (Remote host closed the connection)
15:12:21*yglukhov joined #nim
15:13:39*nsf quit (Quit: WeeChat 1.4)
15:15:52Araq_so ... warnings and hints are only emitted for the main package finally.
15:16:23Araq_you now can use nimble packages that produce warnings and it doesn't matter :-)
15:16:55TheLemonManyay
15:26:21dom96cool
15:31:41*kseg joined #nim
15:36:20*kseg quit (Ping timeout: 260 seconds)
15:47:52*PMunch quit (Ping timeout: 244 seconds)
15:58:43*libman joined #nim
16:00:21*lubos_cz quit (Ping timeout: 240 seconds)
16:01:15*vendethiel joined #nim
16:02:04*Ven joined #nim
16:06:48*dhk joined #nim
16:20:36*yglukhov quit (Remote host closed the connection)
16:30:31*Dd_ joined #nim
16:30:46*Dd_ quit (Client Quit)
16:32:02*fastrom joined #nim
16:36:52Araq_dom96: I like to merge https://github.com/nim-lang/Nim/pull/4135
16:37:09Araq_seems unfair to make him use more headings etc for that trivial patch
16:38:21TheLemonManwhen iterating over enum with holes the count{up,down} do not skip the invalid values, is that a design decision ?
16:47:02dom96Araq_: *shrug*
16:48:10Araq_TheLemonMan: yeah, enums with holes are your problem.
16:48:19Araq_we only provide them convenience with C interop.
16:49:27TheLemonManwell you could gracefully degrade the performance of countup/down by skipping the holes
16:50:16*arnetheduck quit (Ping timeout: 252 seconds)
16:51:03ArrrrHow can you tell if a value is valid/invalid? If possible
16:52:40TheLemonManat compile-time you know if the enum has holes
16:53:53ArrrrI mean, using countup for example
16:54:18TheLemonManit's parametrized by type
16:56:06ArrrrI mean, given your example. If you echo the value for the invalid ones you get "Invalid data!"
16:57:49TheLemonManbut that happens because the enum is casted down to an int and then incremented
16:58:32*vendethiel quit (Ping timeout: 252 seconds)
16:59:11ArrrrAnd i wonder if there is a way to test if the value actually belongs to the enum or not
17:14:14*elrood joined #nim
17:32:31*kseg joined #nim
17:36:59*kseg quit (Ping timeout: 260 seconds)
17:45:23*lubos_cz joined #nim
17:45:58TheLemonManyou just need a linear search
17:52:04*|meta joined #nim
17:53:43*nsf joined #nim
17:54:02*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
17:59:31*lubos_cz quit (Ping timeout: 250 seconds)
18:12:23*lubos_cz joined #nim
18:18:22*Ven quit (Read error: Connection reset by peer)
18:21:45*Ven joined #nim
18:25:25*gugugaga joined #nim
18:26:11*dhk left #nim ("Leaving")
18:39:15*filwit joined #nim
18:40:01filwithey #nim
18:40:42Araq_hi filwit.
18:41:20filwiti'm trying to figure out if there's any way to access the 'this' property of a Javascript function inside Nim with the JS backend
18:42:52filwitlet me make a gist real quick of what I'm trying to do, that would make it more clear I suppose
18:44:05Araq_proc jsthis(): RootObj {.importcpp: "this@".}
18:44:17Araq_# hacky, but works.
18:46:38filwitOh, awesome!
18:46:45filwitlet me try it out
18:50:05filwitis there any Nim JS project on Github I can browse for reference?
18:50:26filwitI saw one awhile ago, but can't remember what it was called now
18:54:06Araq_'nimx' is big and compiles to JS as well as to C
18:54:57filwitthanks!
18:58:23*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:01:02libmanFirst one that comes to mind is https://github.com/yglukhov/async_http_request/blob/master/async_http_request.nim
19:01:48filwitlibman: awesome, thanks
19:14:07*PMunch joined #nim
19:14:59libmanI have a directory where all nimble packages are extracted. I ran the below-mentioned shellfu to find more examples for filwit:
19:15:00libmanegrep '^import.*[^a-z]*dom' `find -type f -iname *.nim`
19:15:48Araq_filwit: does 'jsthis' work?
19:15:54Araq_I never tried it.
19:16:16libmanBut all it found outside of Nim itself was was NimYAML and nimx.
19:17:17libman(And in NimYAML it was just a test.)
19:17:30filwitAraq: i'm not sure.. i cahnged something around and I'm fixing a bug right now
19:17:49filwitAraq: I'm not sure it'll work though.. it shows up as 'this@()' in the JS
19:17:51Araq_anyway a simple var that's importc: "this" should do too.
19:18:13Araq_var jsthis {.importc: "this".}: SomeType
19:18:19dom96A simple example is this: https://github.com/nim-lang/Nim/blob/devel/web/nimblepkglist.nim
19:18:26libmanShame that more people aren't using Nim for client-side code. Why anyone would use something like TypeScript is beyond me...
19:18:33filwitAraq: oh.. duh. that's what I was looking for.. didn't think .importC. would work on var declarations
19:19:09filwitdom96: thanks, and hi
19:19:40dom96hello :)
19:19:54dom96I'm actually playing around with a little game thing using Nim's JS backend
19:22:42libmanI'm not making any of my Nim code public until I get less retarded. I haven't done any serious programming in a long time.
19:23:23filwitdom96: sounds cool :) same here
19:23:41filwitlibman: hehe, I know that feeling a bit
19:24:25filwitAraq: the `var jsthis {.importC:"this".}: Image` doesn't work cause it just outputs `var this = null` in the JS
19:24:48filwitAraq: is there any way to say.. `var jsthis = asm"this"`?
19:26:59Araq_.noinit pragma?
19:27:16Araq_strange that it generates this assignment though, I need to investigate.
19:27:25libmanFor the past few months, I've been stuck between Go, Nim, and "maybe I'll just lobotomize myself and embrace JavaScript Everywhere as my lord and master". Whenever I sit down and start coding in one of these languages, I start thinking about the relative merits of the others (or other options entirely)...
19:29:50Araq_do yourself a favour and play with a macro like 'scanp', 'scanf' from strscans. output the code these generate.
19:30:31Araq_once you did that, you cannot go back.
19:31:24*yglukhov joined #nim
19:32:00Araq_Nim is programming dope. Most things you can do in Nim, simply cannot be done at all in other languages.
19:32:16Araq_and yet there is always the "statically typed" safety net.
19:33:15tautologicoGo is okay if you're working in the domains the people who created the language use it for... otherwise it's just too difficult to define useful abstractions in it
19:33:33filwitAraq: what did you mean by ".noinit pragma?" do I put that on 'jsthis' var or proc?
19:33:53ArrrrAnd what was hybrid GC ?
19:34:02filwitAraq: I'm trying to get make a solution with .dirty templates + asm.. but no luck so far
19:35:04filwitAraq: ohh..i see what you mean by .noinit now (for the var).. i don't think there's a problem with the '= null' part.. it's that I'm trying to re-define 'this'
19:35:32filwit'var this; ' is invalid code i believe
19:35:53filwit(js code)
19:36:35Araq_.nodecl
19:36:47filwitah, that might do it
19:36:57Araq_but that should be implied by importc
19:37:04Araq_do you use nim devel?
19:37:36Araq_Arrrr: I think that's gc:v2 but tbh I cannot really remember
19:37:37filwitAwesome, that worked!
19:38:13filwitvar jsthis {.nodecl noinit importC:"this".}: Image
19:38:36filwiti guess the .noinit is pointless..
19:38:59filwitanyways, works like a charm and clean JS output
19:39:05filwitgreat, thanks!
19:42:58filwitAraq: sorry, missed you messages: Yes, I'm using Nim devel
19:43:55filwitAraq: and yeah, looks like .nodecl isn't implied for .importC on variables with the JS backend. I'll make a bug report
19:46:57Araq_ty
19:50:33*Sembei quit (Ping timeout: 276 seconds)
20:15:49filwitAraq: btw, why are global vars stored in Arrays in the JS backend?
20:16:31*user2 quit (Ping timeout: 252 seconds)
20:16:43filwitAraq: so you can use value semantics on them or something?
20:20:06*Arrrr quit (Quit: WeeChat 1.4)
20:22:55fowlMore likely reference semantics
20:25:11filwitobjects are passed by references samantics by default in JS
20:25:28fowlBut not everything is an object
20:25:45fowlArrays are
20:27:13filwiti don't understand your meaning
20:27:50fowlPass a number to a function that modifies the number, does the original value change?
20:28:26filwityes i know, but then why not just use arrays for those specific scenerios?
20:29:09filwitwas it just done that way to cover all cases? That's what I'm asking.. if there's some other reason that it outputs all global objects in arrays
20:29:31*libman quit (Quit: Leaving.)
20:31:09filwitthe only reason I ask is because every array lookup is expensive in JS.. so working with global vars in Nim's JS backend is inherently slower than it could be.. just wanted to know if there was a good reason for that decision, of or it's just an oversite/lack-of-man-power thing.
20:32:35filwitwell.. not "expensive".. just "more expensive than if it wasn't there.. and significantly more expensive than C"
20:33:02*Mat4 joined #nim
20:33:25Mat4hello
20:34:30Araq_filwit: it's really quite complex and the current way was done after lots of trial and error
20:34:57Araq_it's not an "oversight", usually things start simple and then the bugfixes arrive...
20:35:14filwitAraq: okay. I thought as much.
20:35:59Araq_but yeah, we should optimize it, though it's not obvious how much of it is eliminated by the current JTI engines
20:37:30filwitit really don't matter, if there are odd corner cases.. doing it that way is fine.. since really only WebAssembly can fix the performance problem of the web.. probably a better solution would to output to that in the future.
20:39:37filwitI've run a couple various JS benchmarks on the major browsers of the years, and they all have areas they optimize better for, and ways to easily kill performance.. often a performance win on one will be a slight loss on another... it's not worth trying to deal with that..
20:39:53filwitover**
20:41:40filwitdoesn't** can't type today..
20:41:46Araq_one day I will understand LuaJIT.
20:42:44filwithave you seen: http://ast.run/ ?
20:42:55Araq_still the most impressive code I've ever seen. "this implements the partial redundancy elimination pass in 200 lines of C code"
20:43:17filwiti was looking at that thinking.. hmm.. this looks an aweful lot like the existing macros.listRepr..
20:44:19filwiti have not metric for comparison as to how many lines of C code a redundancy elimination pass usually takes..
20:45:03*gokr quit (Ping timeout: 250 seconds)
20:51:35Araq_it was just an example, but the one in LLVM takes 3000 lines of C++, I think
20:54:01*fastrom quit (Quit: Leaving.)
20:54:46Araq_ast.run is really cool :-)
21:12:29*Trustable joined #nim
21:15:58Araq_it's safe to assume visual studio now knows about ATOMIC_RELAXED right?
21:29:49Mat4Araq_: LLVM is an academic project as I know, that explains the code base in my opinion
21:30:29Araq_really? it stopped being academic years ago and is "industry standard" by now.
21:31:02Araq_well I cannot argue about it since these words are all meaningless
21:33:38Mat4well, Apple ..
21:33:56*kseg joined #nim
21:35:57Mat4anyhow, I think there exist some documentation about the LuaJIT sources and it functionality. You fijd them searching the Lua mailing list
21:36:05Mat4^find
21:38:52*kseg quit (Ping timeout: 264 seconds)
21:40:43Araq_pretty sure I read everything on the Lua ML that there is to read about it
22:01:23*|meta quit (Quit: Connection closed for inactivity)
22:08:09*elrood quit (Quit: Leaving)
22:10:36*Matthias247 quit (Read error: Connection reset by peer)
22:23:27*der-landgraf quit (Quit: WeeChat 1.5)
22:25:27Mat4ciao
22:25:41*Mat4 quit (Quit: Leaving)
22:43:09*Trustable quit (Remote host closed the connection)
22:45:08*lubos_cz quit (Ping timeout: 272 seconds)
23:12:28*yglukhov quit (Remote host closed the connection)
23:34:50*kseg joined #nim
23:37:49*lubos_cz joined #nim
23:39:01*kseg quit (Ping timeout: 240 seconds)
23:55:17*zodiak quit (Ping timeout: 250 seconds)
23:55:31*lubos_cz quit (Remote host closed the connection)