00:00:09 | Araq_ | cheatfate: I have a fix. |
00:00:18 | Araq_ | I don't understand the fix. |
00:17:41 | Araq_ | 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:37 | cheatfate | Araq_, 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:52 | Araq_ | so ... warnings and hints are only emitted for the main package finally. |
15:16:23 | Araq_ | you now can use nimble packages that produce warnings and it doesn't matter :-) |
15:16:55 | TheLemonMan | yay |
15:26:21 | dom96 | cool |
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:52 | Araq_ | dom96: I like to merge https://github.com/nim-lang/Nim/pull/4135 |
16:37:09 | Araq_ | seems unfair to make him use more headings etc for that trivial patch |
16:38:21 | TheLemonMan | when iterating over enum with holes the count{up,down} do not skip the invalid values, is that a design decision ? |
16:47:02 | dom96 | Araq_: *shrug* |
16:48:10 | Araq_ | TheLemonMan: yeah, enums with holes are your problem. |
16:48:19 | Araq_ | we only provide them convenience with C interop. |
16:49:27 | TheLemonMan | well you could gracefully degrade the performance of countup/down by skipping the holes |
16:50:16 | * | arnetheduck quit (Ping timeout: 252 seconds) |
16:51:03 | Arrrr | How can you tell if a value is valid/invalid? If possible |
16:52:40 | TheLemonMan | at compile-time you know if the enum has holes |
16:53:53 | Arrrr | I mean, using countup for example |
16:54:18 | TheLemonMan | it's parametrized by type |
16:56:06 | Arrrr | I mean, given your example. If you echo the value for the invalid ones you get "Invalid data!" |
16:57:49 | TheLemonMan | but 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:11 | Arrrr | And 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:58 | TheLemonMan | you 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:01 | filwit | hey #nim |
18:40:42 | Araq_ | hi filwit. |
18:41:20 | filwit | i'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:52 | filwit | let me make a gist real quick of what I'm trying to do, that would make it more clear I suppose |
18:44:05 | Araq_ | proc jsthis(): RootObj {.importcpp: "this@".} |
18:44:17 | Araq_ | # hacky, but works. |
18:46:38 | filwit | Oh, awesome! |
18:46:45 | filwit | let me try it out |
18:50:05 | filwit | is there any Nim JS project on Github I can browse for reference? |
18:50:26 | filwit | I saw one awhile ago, but can't remember what it was called now |
18:54:06 | Araq_ | 'nimx' is big and compiles to JS as well as to C |
18:54:57 | filwit | thanks! |
18:58:23 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:01:02 | libman | First one that comes to mind is https://github.com/yglukhov/async_http_request/blob/master/async_http_request.nim |
19:01:48 | filwit | libman: awesome, thanks |
19:14:07 | * | PMunch joined #nim |
19:14:59 | libman | I have a directory where all nimble packages are extracted. I ran the below-mentioned shellfu to find more examples for filwit: |
19:15:00 | libman | egrep '^import.*[^a-z]*dom' `find -type f -iname *.nim` |
19:15:48 | Araq_ | filwit: does 'jsthis' work? |
19:15:54 | Araq_ | I never tried it. |
19:16:16 | libman | But all it found outside of Nim itself was was NimYAML and nimx. |
19:17:17 | libman | (And in NimYAML it was just a test.) |
19:17:30 | filwit | Araq: i'm not sure.. i cahnged something around and I'm fixing a bug right now |
19:17:49 | filwit | Araq: I'm not sure it'll work though.. it shows up as 'this@()' in the JS |
19:17:51 | Araq_ | anyway a simple var that's importc: "this" should do too. |
19:18:13 | Araq_ | var jsthis {.importc: "this".}: SomeType |
19:18:19 | dom96 | A simple example is this: https://github.com/nim-lang/Nim/blob/devel/web/nimblepkglist.nim |
19:18:26 | libman | Shame that more people aren't using Nim for client-side code. Why anyone would use something like TypeScript is beyond me... |
19:18:33 | filwit | Araq: oh.. duh. that's what I was looking for.. didn't think .importC. would work on var declarations |
19:19:09 | filwit | dom96: thanks, and hi |
19:19:40 | dom96 | hello :) |
19:19:54 | dom96 | I'm actually playing around with a little game thing using Nim's JS backend |
19:22:42 | libman | I'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:23 | filwit | dom96: sounds cool :) same here |
19:23:41 | filwit | libman: hehe, I know that feeling a bit |
19:24:25 | filwit | Araq: the `var jsthis {.importC:"this".}: Image` doesn't work cause it just outputs `var this = null` in the JS |
19:24:48 | filwit | Araq: is there any way to say.. `var jsthis = asm"this"`? |
19:26:59 | Araq_ | .noinit pragma? |
19:27:16 | Araq_ | strange that it generates this assignment though, I need to investigate. |
19:27:25 | libman | For 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:50 | Araq_ | do yourself a favour and play with a macro like 'scanp', 'scanf' from strscans. output the code these generate. |
19:30:31 | Araq_ | once you did that, you cannot go back. |
19:31:24 | * | yglukhov joined #nim |
19:32:00 | Araq_ | Nim is programming dope. Most things you can do in Nim, simply cannot be done at all in other languages. |
19:32:16 | Araq_ | and yet there is always the "statically typed" safety net. |
19:33:15 | tautologico | Go 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:33 | filwit | Araq: what did you mean by ".noinit pragma?" do I put that on 'jsthis' var or proc? |
19:33:53 | Arrrr | And what was hybrid GC ? |
19:34:02 | filwit | Araq: I'm trying to get make a solution with .dirty templates + asm.. but no luck so far |
19:35:04 | filwit | Araq: 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:32 | filwit | 'var this; ' is invalid code i believe |
19:35:53 | filwit | (js code) |
19:36:35 | Araq_ | .nodecl |
19:36:47 | filwit | ah, that might do it |
19:36:57 | Araq_ | but that should be implied by importc |
19:37:04 | Araq_ | do you use nim devel? |
19:37:36 | Araq_ | Arrrr: I think that's gc:v2 but tbh I cannot really remember |
19:37:37 | filwit | Awesome, that worked! |
19:38:13 | filwit | var jsthis {.nodecl noinit importC:"this".}: Image |
19:38:36 | filwit | i guess the .noinit is pointless.. |
19:38:59 | filwit | anyways, works like a charm and clean JS output |
19:39:05 | filwit | great, thanks! |
19:42:58 | filwit | Araq: sorry, missed you messages: Yes, I'm using Nim devel |
19:43:55 | filwit | Araq: and yeah, looks like .nodecl isn't implied for .importC on variables with the JS backend. I'll make a bug report |
19:46:57 | Araq_ | ty |
19:50:33 | * | Sembei quit (Ping timeout: 276 seconds) |
20:15:49 | filwit | Araq: btw, why are global vars stored in Arrays in the JS backend? |
20:16:31 | * | user2 quit (Ping timeout: 252 seconds) |
20:16:43 | filwit | Araq: so you can use value semantics on them or something? |
20:20:06 | * | Arrrr quit (Quit: WeeChat 1.4) |
20:22:55 | fowl | More likely reference semantics |
20:25:11 | filwit | objects are passed by references samantics by default in JS |
20:25:28 | fowl | But not everything is an object |
20:25:45 | fowl | Arrays are |
20:27:13 | filwit | i don't understand your meaning |
20:27:50 | fowl | Pass a number to a function that modifies the number, does the original value change? |
20:28:26 | filwit | yes i know, but then why not just use arrays for those specific scenerios? |
20:29:09 | filwit | was 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:09 | filwit | the 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:35 | filwit | well.. 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:25 | Mat4 | hello |
20:34:30 | Araq_ | filwit: it's really quite complex and the current way was done after lots of trial and error |
20:34:57 | Araq_ | it's not an "oversight", usually things start simple and then the bugfixes arrive... |
20:35:14 | filwit | Araq: okay. I thought as much. |
20:35:59 | Araq_ | but yeah, we should optimize it, though it's not obvious how much of it is eliminated by the current JTI engines |
20:37:30 | filwit | it 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:37 | filwit | I'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:53 | filwit | over** |
20:41:40 | filwit | doesn't** can't type today.. |
20:41:46 | Araq_ | one day I will understand LuaJIT. |
20:42:44 | filwit | have you seen: http://ast.run/ ? |
20:42:55 | Araq_ | still the most impressive code I've ever seen. "this implements the partial redundancy elimination pass in 200 lines of C code" |
20:43:17 | filwit | i was looking at that thinking.. hmm.. this looks an aweful lot like the existing macros.listRepr.. |
20:44:19 | filwit | i 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:35 | Araq_ | 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:46 | Araq_ | ast.run is really cool :-) |
21:12:29 | * | Trustable joined #nim |
21:15:58 | Araq_ | it's safe to assume visual studio now knows about ATOMIC_RELAXED right? |
21:29:49 | Mat4 | Araq_: LLVM is an academic project as I know, that explains the code base in my opinion |
21:30:29 | Araq_ | really? it stopped being academic years ago and is "industry standard" by now. |
21:31:02 | Araq_ | well I cannot argue about it since these words are all meaningless |
21:33:38 | Mat4 | well, Apple .. |
21:33:56 | * | kseg joined #nim |
21:35:57 | Mat4 | anyhow, I think there exist some documentation about the LuaJIT sources and it functionality. You fijd them searching the Lua mailing list |
21:36:05 | Mat4 | ^find |
21:38:52 | * | kseg quit (Ping timeout: 264 seconds) |
21:40:43 | Araq_ | 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:27 | Mat4 | ciao |
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) |