00:01:42 | * | BitPuffin|osx quit (Read error: Connection reset by peer) |
00:08:59 | * | Varriount-Laptop quit (Read error: Connection reset by peer) |
00:22:38 | * | Demon_Fox joined #nim |
00:53:30 | * | girvo joined #nim |
00:53:54 | girvo | hey all :) |
00:55:58 | girvo | quick q: what's the state of C++ interop in nim these days? Anything tricky i need to be aware of? |
00:58:21 | * | jaco60 quit (Ping timeout: 246 seconds) |
01:06:29 | * | makoLine quit (Ping timeout: 252 seconds) |
01:08:40 | Varriount | girvo: Well, there are pragma's to help wrap things, it's all detailed in the manual for the most part. |
01:09:12 | Varriount | C2Nim supports C++ code to a certain degree (C++ is a big, complex language) |
01:10:51 | Varriount | girvo: What's your opinion on Nim's strings? |
01:11:29 | Varriount | I mean, with regards toi the whole copy-on-assignment semantics |
01:20:00 | * | makoLine joined #nim |
01:25:46 | * | brson joined #nim |
01:27:17 | * | makoLine quit (Ping timeout: 250 seconds) |
01:35:26 | * | vqrs quit (Ping timeout: 272 seconds) |
01:36:21 | * | vqrs joined #nim |
01:44:09 | * | makoLine joined #nim |
01:52:38 | dtscode | nim strings are COW? |
02:08:53 | * | ephja quit (Ping timeout: 250 seconds) |
02:13:35 | * | vendethiel joined #nim |
02:20:39 | * | jakesyl quit (Ping timeout: 240 seconds) |
02:27:39 | * | makoLine quit (Read error: Connection reset by peer) |
02:28:19 | * | makoLine joined #nim |
02:33:54 | * | jakesyl joined #nim |
02:36:14 | * | vendethiel quit (Ping timeout: 272 seconds) |
02:44:13 | * | brson quit (Quit: leaving) |
03:04:07 | * | desophos_ joined #nim |
03:08:13 | * | desophos quit (Ping timeout: 265 seconds) |
03:18:24 | * | linkedinyou quit (Quit: linkedinyou) |
03:48:13 | * | zepolen quit (Remote host closed the connection) |
04:04:43 | * | darkf joined #nim |
04:25:28 | * | ulyssesdwolfe quit (Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]) |
04:31:09 | * | polde quit (Ping timeout: 246 seconds) |
04:35:09 | Varriount | dtscode: No, they are copy on assignment/move |
04:36:16 | Varriount | I'm writing up a proposal to introduce immutable strings into Nim, as they are far more efficient for non-string-manipulation tasks. |
04:38:00 | * | polde joined #nim |
04:43:42 | dtscode | Varriount: oh |
04:45:42 | Varriount | dtscode: What do you think? |
04:46:15 | dtscode | I haven't written nim in a while to know |
04:49:54 | makoLine | ''{ I think immutable strings are something everyone can agree with |
04:50:49 | Varriount | makoLine: I'm also trying to measure how much extra copying is currently done in various parts of the compiler/standard library due to string copying. |
05:26:29 | * | polde quit (Ping timeout: 250 seconds) |
06:03:31 | * | nande quit (Read error: Connection reset by peer) |
06:21:42 | * | xificurC quit (Ping timeout: 260 seconds) |
06:28:11 | * | desophos_ quit (Read error: Connection reset by peer) |
06:44:56 | * | strcmp1 quit (Remote host closed the connection) |
06:48:49 | * | Kingsquee joined #nim |
06:50:51 | * | cyraxjoe_ joined #nim |
06:54:01 | * | cyraxjoe quit (Ping timeout: 250 seconds) |
06:54:06 | * | cyraxjoe_ quit (Read error: Connection reset by peer) |
06:54:48 | * | cyraxjoe joined #nim |
06:56:40 | * | girvo quit (Quit: Lost terminal) |
07:00:34 | * | lyro quit (Read error: Connection reset by peer) |
07:15:14 | * | Matthias247 joined #nim |
07:24:47 | * | gour joined #nim |
07:25:09 | * | Matthias247 quit (Read error: Connection reset by peer) |
07:45:24 | * | strcmp1 joined #nim |
07:50:30 | * | strcmp1 quit (Ping timeout: 260 seconds) |
08:03:26 | * | vqrs quit (Ping timeout: 240 seconds) |
08:04:53 | * | vqrs joined #nim |
08:08:03 | * | yglukhov joined #nim |
08:11:05 | * | strcmp1 joined #nim |
08:14:06 | Araq | Varriount: good idea but keep these things in mind: |
08:14:47 | Araq | * we can introduce COW strings without affecting semantics except perhaps for super low level code |
08:15:21 | Araq | * patching Nim strings is far better than just introducing another string |
08:15:29 | * | antoniomo joined #nim |
08:16:43 | Araq | * 'shallow(mystr)' is under used and should have been named 'freeze' |
08:17:20 | Araq | if immutability is the default, it would be nice to introduce 'mutate(mystr)' so that I can get an old fashioned mutable string |
08:17:54 | Araq | so ... yeah, better fix the language rather than just introducing ImmutableString. |
08:19:10 | * | gokr joined #nim |
08:24:20 | * | amvtek joined #nim |
08:31:01 | * | Trustable joined #nim |
08:37:19 | * | vqrs quit (Ping timeout: 240 seconds) |
08:37:22 | * | jaco60 joined #nim |
08:38:20 | * | yglukhov quit (Remote host closed the connection) |
08:39:25 | * | yglukhov joined #nim |
08:41:24 | * | vqrs joined #nim |
08:42:58 | * | jaco60 quit (Ping timeout: 240 seconds) |
08:43:59 | * | yglukhov quit (Ping timeout: 264 seconds) |
08:55:06 | * | makoLine quit (Ping timeout: 240 seconds) |
08:57:29 | * | yglukhov joined #nim |
09:19:35 | * | zepolen joined #nim |
09:22:42 | * | zepolen quit (Remote host closed the connection) |
09:25:27 | * | mindriot101 joined #nim |
09:28:29 | * | zepolen joined #nim |
09:29:11 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
09:37:49 | * | yglukhov quit (Remote host closed the connection) |
09:42:57 | * | coffeepot joined #nim |
09:43:03 | * | zepolen quit (Remote host closed the connection) |
09:45:39 | * | zepolen joined #nim |
09:46:31 | * | zepolen quit (Remote host closed the connection) |
09:54:31 | * | zepolen joined #nim |
09:56:14 | * | zepolen quit (Remote host closed the connection) |
09:58:21 | * | yglukhov joined #nim |
10:02:26 | * | yglukhov quit (Ping timeout: 240 seconds) |
10:05:59 | * | vqrs quit (Ping timeout: 250 seconds) |
10:09:06 | * | vqrs joined #nim |
10:12:31 | * | yglukhov joined #nim |
10:13:20 | * | girvo joined #nim |
10:16:56 | * | yglukhov quit (Remote host closed the connection) |
10:17:49 | * | yglukhov joined #nim |
10:21:30 | * | M-max quit (Ping timeout: 246 seconds) |
10:28:36 | * | kulelu88 joined #nim |
10:29:30 | * | kulelu88 left #nim (#nim) |
10:37:29 | * | Kingsquee joined #nim |
10:39:39 | * | Kingsquee quit (Client Quit) |
10:54:31 | * | strcmp1 quit (Remote host closed the connection) |
10:55:06 | amvtek | Hello, newbie here seing lot of potential for nim lang. We have a question concerning streams module : what byteorder is used (bigendian, littleendian or host ?) |
10:56:30 | * | mindriot_ joined #nim |
10:56:36 | * | mindriot_ quit (Remote host closed the connection) |
10:59:22 | * | mindriot_ joined #nim |
11:00:22 | * | mindriot101 quit (Ping timeout: 272 seconds) |
11:01:31 | * | mindriot_ quit (Remote host closed the connection) |
11:06:24 | * | xificurC joined #nim |
11:10:47 | * | strcmp1 joined #nim |
11:13:13 | * | yglukhov quit (Remote host closed the connection) |
11:14:07 | * | yglukhov joined #nim |
11:26:23 | * | yglukhov quit (Remote host closed the connection) |
11:29:29 | * | yglukhov joined #nim |
11:42:46 | * | yglukhov quit (Remote host closed the connection) |
11:44:13 | * | matkuki joined #nim |
11:46:43 | * | xificurC quit (Ping timeout: 244 seconds) |
11:47:10 | * | matkuki quit (Client Quit) |
11:56:09 | * | elrood joined #nim |
11:56:17 | * | yglukhov joined #nim |
11:57:20 | * | yglukhov quit (Remote host closed the connection) |
12:01:59 | * | Demon_Fox quit (Read error: Connection reset by peer) |
12:02:13 | * | Demon_Fox joined #nim |
12:06:27 | * | zepolen joined #nim |
12:08:22 | * | yglukhov joined #nim |
12:09:42 | * | yglukhov quit (Remote host closed the connection) |
12:09:54 | * | yglukhov joined #nim |
12:10:30 | * | zepolen quit (Ping timeout: 240 seconds) |
12:10:51 | * | ephja joined #nim |
12:19:21 | * | polde joined #nim |
12:24:43 | * | Demon_Fox quit (Quit: Leaving) |
12:27:04 | * | mindriot101 joined #nim |
12:38:31 | * | lyro joined #nim |
12:57:12 | yglukhov | amvtek: native, but sould be easy to write the swapping counterparts on top of std ones. |
13:00:29 | amvtek | yglukhov: thank you for your help |
13:00:40 | yglukhov | anytime :) |
13:02:33 | * | yglukhov quit (Remote host closed the connection) |
13:02:49 | * | yglukhov joined #nim |
13:05:33 | * | yglukhov quit (Remote host closed the connection) |
13:18:32 | * | yglukhov joined #nim |
13:25:00 | * | gokr quit (Quit: Leaving.) |
13:25:13 | * | yglukhov quit (Remote host closed the connection) |
13:31:34 | * | BitPuffin joined #nim |
13:34:47 | * | yglukhov joined #nim |
13:36:06 | * | gokr_ joined #nim |
13:55:23 | * | lokulin quit (Ping timeout: 264 seconds) |
14:00:18 | * | zepolen joined #nim |
14:02:17 | * | zepolen quit (Remote host closed the connection) |
14:05:00 | * | zepolen joined #nim |
14:05:27 | * | zepolen quit (Remote host closed the connection) |
14:06:02 | * | zepolen joined #nim |
14:07:10 | * | yglukhov quit (Ping timeout: 240 seconds) |
14:12:47 | * | gokr joined #nim |
14:13:32 | * | lokulin joined #nim |
14:21:26 | * | antoniomo quit (Quit: WeeChat 1.3) |
14:25:00 | * | mindriot_ joined #nim |
14:25:37 | * | mindriot_ quit (Read error: Connection reset by peer) |
14:26:12 | * | mindriot_ joined #nim |
14:27:20 | * | mindriot_ quit (Remote host closed the connection) |
14:28:26 | * | mindriot101 quit (Ping timeout: 244 seconds) |
14:30:32 | * | drewsrem joined #nim |
14:43:56 | * | strcmp1 quit (Ping timeout: 272 seconds) |
14:53:32 | * | pregressive joined #nim |
14:53:45 | * | mindriot101 joined #nim |
14:53:49 | * | mindriot101 quit (Remote host closed the connection) |
14:57:12 | * | strcmp1 joined #nim |
15:00:22 | * | xificurC joined #nim |
15:20:28 | * | strcmp1 quit (Remote host closed the connection) |
15:29:53 | * | gokr quit (Read error: Connection reset by peer) |
15:30:21 | * | gokr joined #nim |
15:35:56 | * | amvtek quit (Quit: Page closed) |
15:40:19 | * | mindriot101 joined #nim |
15:44:39 | * | mindriot101 quit (Ping timeout: 252 seconds) |
15:46:11 | * | strcmp1 joined #nim |
15:46:40 | * | Sk1LLb0X joined #nim |
15:47:22 | * | Sk1LLb0X quit (Client Quit) |
15:58:15 | * | pregressive quit (Read error: Connection reset by peer) |
15:58:23 | * | pregressive joined #nim |
16:08:17 | * | mindriot101 joined #nim |
16:11:19 | * | strcmp1 quit (Remote host closed the connection) |
16:11:59 | * | strcmp1 joined #nim |
16:15:35 | * | strcmp1 quit (Remote host closed the connection) |
16:25:44 | * | strcmp1 joined #nim |
16:30:27 | * | darkf quit (Quit: Leaving) |
16:57:20 | * | gmpreussner|work joined #nim |
16:57:53 | * | bamorim joined #nim |
17:05:42 | * | brson joined #nim |
17:17:07 | * | barosl_ joined #nim |
17:18:57 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
17:20:29 | * | barosl quit (Ping timeout: 244 seconds) |
17:24:21 | * | secretlives joined #nim |
17:24:42 | * | strcmp1 quit (Remote host closed the connection) |
17:25:23 | * | secretlives quit (Client Quit) |
17:27:40 | * | strcmp1 joined #nim |
17:43:44 | * | strcmp2 joined #nim |
17:44:46 | * | brson quit (Ping timeout: 250 seconds) |
17:46:59 | * | strcmp1 quit (Ping timeout: 264 seconds) |
17:49:25 | * | gokr quit (Ping timeout: 244 seconds) |
17:52:33 | * | brson joined #nim |
17:58:50 | * | drewsrem quit (Quit: Leaving) |
18:01:35 | * | james joined #nim |
18:01:59 | * | james is now known as Guest22668 |
18:09:34 | * | Gonzih joined #nim |
18:22:26 | * | mindriot_ joined #nim |
18:25:30 | * | mindriot101 quit (Ping timeout: 240 seconds) |
18:25:55 | * | pregressive quit (Remote host closed the connection) |
18:27:30 | * | mindriot_ quit (Ping timeout: 272 seconds) |
18:30:06 | * | brson quit (Ping timeout: 240 seconds) |
18:31:44 | * | desophos joined #nim |
18:33:41 | * | brson joined #nim |
18:36:36 | * | Guest48911isaway is now known as Guest48911 |
18:36:44 | * | Guest48911 is now known as Guest48911isaway |
18:41:03 | * | bamorim quit (Ping timeout: 255 seconds) |
18:45:39 | * | matkuki joined #nim |
18:45:40 | * | jaco60 joined #nim |
18:53:57 | matkuki | dom96: I made quick observation. When compiling my program with "--threads:off" it uses 6-16% CPU, but the same program with "--threads:on" changes to 9-22% CPU usage. |
18:53:59 | matkuki | Is this a known thing? |
18:54:41 | * | vendethiel joined #nim |
18:55:13 | matkuki | The program doesn't use any threading, btw. |
19:00:19 | * | Matthias247 joined #nim |
19:09:01 | * | zepolen quit (Read error: Connection reset by peer) |
19:18:25 | Araq | hi matkuki |
19:18:45 | matkuki | Hey, Araq |
19:19:23 | matkuki | Did you see the question a couple of lines up? |
19:19:32 | Araq | yeah |
19:19:37 | * | pregressive joined #nim |
19:19:53 | Araq | I don't know your program though |
19:20:14 | * | zepolen joined #nim |
19:20:18 | Araq | there is nothing in Nim's runtime that uses more cores with --threads:on |
19:20:47 | Araq | but I bet 22% doesn't imply it uses more than one core |
19:21:06 | Araq | so you only measure the overhead of the thread local storage perhaps |
19:22:31 | * | pregressive quit (Remote host closed the connection) |
19:22:56 | matkuki | It doesn't bother me, but as it's a game I check CPU usage from time to time, it startled me when I finished the threaded build and the CPU usage jumped. |
19:22:58 | * | pregressive joined #nim |
19:25:28 | matkuki | Then I removed the threading and CPU usage stayed the same at 9-22%. Only when the thread flag was changed to '--thread:off' did the usage drop back down. |
19:25:49 | matkuki | sorry, '--threads:off' |
19:26:55 | * | pregressive quit (Ping timeout: 240 seconds) |
19:27:38 | * | brson quit (Ping timeout: 240 seconds) |
19:27:46 | * | yglukhov joined #nim |
19:38:05 | matkuki | Araq: Why would thread local storage cause a CPU overhead? |
19:44:13 | Araq | cause relative is more expensive than absolute addressing |
19:44:19 | * | askatasuna joined #nim |
19:44:39 | Araq | depends on your platform though |
19:44:41 | matkuki | thanks |
19:44:51 | Araq | what is your platform? |
19:44:54 | matkuki | I'm on wondows |
19:45:14 | matkuki | windows vista |
19:45:22 | Araq | ok, try --tlsEmulation:off |
19:45:42 | matkuki | ok, let me try... |
19:50:44 | matkuki | Araq: That's it! It's back down. |
19:50:50 | matkuki | What is the '--tlsEmulation' flag? |
19:51:56 | * | bamorim joined #nim |
19:52:03 | Araq | some bullshit we had to come up with as many plaforms don't support C's __thread keyword addition |
19:52:34 | Araq | on some OSes like Windows it's still the default |
19:52:48 | Araq | when you activate --threads |
19:53:11 | * | Araq looks at Haiku ... |
19:53:23 | * | Araq looks at Mac OS X |
19:53:30 | * | desophos quit (Remote host closed the connection) |
19:54:25 | Araq | so as its name says, it emulates thread local storage |
19:56:44 | * | gokr_ quit (Read error: Connection reset by peer) |
20:02:53 | * | yglukhov quit (Remote host closed the connection) |
20:03:50 | * | bamorim quit (Remote host closed the connection) |
20:03:58 | matkuki | Araq: btw, dom96 showed me how to use channels for passing objects between threads, but mentioned that channels are slow. Are there any alternatives? |
20:04:52 | * | desophos joined #nim |
20:05:37 | Araq | plenty, but you dont want to use them ;-) |
20:06:22 | Araq | if channels are too slow, I usually start with passing stuff by 'ptr' to the channel |
20:06:30 | * | desophos quit (Remote host closed the connection) |
20:06:55 | Araq | this way no deep copies are made and channels are actually quite fast |
20:07:33 | gour | i haven't arrived to channels (yet) in the docs, but are they resemble those in go? |
20:07:51 | Araq | if you only need parallelism and no concurrency I would use the parallel and spawn constructs |
20:07:58 | Araq | they are really nice to work with |
20:08:38 | Araq | gour: no, they are quite different beasts |
20:09:23 | gour | thnaks |
20:09:31 | Araq | differences: |
20:09:50 | ldlework | Are Nim threads interruptable? |
20:10:01 | Araq | * perform deep copies for safety, no races possible (unless you use 'ptr' but 'ptr' is unsafe to begin with so there) |
20:10:17 | * | xificurC quit (Read error: Connection reset by peer) |
20:10:18 | Araq | * need to 'close' them to free their resources |
20:10:49 | * | desophos joined #nim |
20:10:50 | Araq | * don't support anything like Go's select statement yet |
20:11:24 | Araq | * are unbounded queues, no need to give them a size and so are not prone to deadlocks |
20:11:48 | gour | cool, cool |
20:12:34 | Araq | ldlework: no. |
20:12:51 | ldlework | You can at least set them to daemon threads right? |
20:13:08 | gour | Araq: as i wrote the other, i hope you'll find in the future to write "The Nim Programming Language" ;) |
20:13:31 | gour | *the other day |
20:13:38 | Araq | yeah me too ... |
20:14:11 | Araq | ldlework: not sure what this implies. if the main thread dies, all the others die too. I think. |
20:14:21 | ldlework | Araq: not unless they are set as daemon threads against the OS |
20:14:33 | ldlework | maybe you're doing that by default |
20:14:48 | Araq | hrm I don't think so, but I'm quite sure about this behaviour |
20:14:52 | ldlework | Just went through this with Python |
20:15:00 | ldlework | and learned all about them |
20:15:08 | ephja | time to use channels again, while that sleepAsync bug remains |
20:15:34 | ephja | ldlework: have you done anything with libtcod yet? |
20:15:46 | ldlework | ephja: a little |
20:15:52 | ldlework | someone helped me get a nim wrapper going for it |
20:15:59 | ldlework | but I haven't looked in many months |
20:16:06 | * | brson joined #nim |
20:16:23 | Araq | ldlework: you can inject code that makes your thread interruptible via .injectStmt ... |
20:16:24 | ephja | that was me. I felt like changing my nick |
20:16:55 | gour | Araq: if you have to write gui app in nim, which bindings would you use: gtk2, gtk3 or wx? |
20:17:10 | ephja | to something less pronounceable |
20:17:21 | Araq | but I don't think that's particularly wise as that was designed as a debugging tool |
20:19:02 | Araq | ephja: you didn't succeed. I can spot some vowels in your nick. |
20:19:28 | * | Demon_Fox joined #nim |
20:19:32 | ldlework | I don't want to interrupt them I just want them to die when the main process dies without having to implement cooperation |
20:19:32 | ephja | oops |
20:20:35 | Araq | gour: that pretty much depends on what kind of widgets I need |
20:21:01 | ephja | ldlework: speaking of which, do you play any roguelikes? I've only played Tales Of Maj'Eyal. it's pretty good |
20:21:10 | Araq | and whether I need native look and feel on macs etc etc |
20:21:34 | ldlework | ephja: I've play dozens and the two I continue to go back to regularly are Dungeon Crawl Stone Soup and Catacylsm Dark Days Ahead |
20:21:44 | ldlework | the latter more than the former these days |
20:22:00 | ephja | ok |
20:22:09 | Araq | ah tomorrow is the day |
20:22:09 | gour | Araq: hmm...ok. are any of those bindings take advantage of nim's features or are mostly thin wrappers? |
20:23:23 | * | desophos quit (Remote host closed the connection) |
20:23:27 | gour | when do you fly? |
20:23:49 | Araq | wxnim uses Nim's c++ codegen which usually implies that memory management is easier |
20:24:16 | Araq | but I haven't looked at Nim's gtk3 wrapper which might offer some higher level stuff |
20:24:40 | Araq | I was underwhelmed by wx's API though... left a bad taste in my mouth |
20:25:19 | Araq | gour: I was referring to some game that is about to be released which I cannot name cause they don't pay me to name it |
20:25:19 | * | yglukhov joined #nim |
20:25:55 | Araq | ;-) |
20:25:58 | gour | Araq: np. thanks for the answer |
20:26:21 | * | desophos joined #nim |
20:26:46 | * | Araq thinks blizzard should pay him ... |
20:27:17 | ldlework | lol |
20:27:24 | ephja | sure |
20:27:54 | ldlework | ephja: I'm working on a roguelike, are you? |
20:27:58 | * | gokr joined #nim |
20:29:15 | desophos | are we talking about game programming in Nim??? |
20:29:18 | ephja | ldlework: no, just some compiler thingie and a chat server |
20:29:33 | ldlework | desophos: well I'm not using Nim |
20:29:46 | ldlework | Maybe I would if I understood how to use its JS backend with other JS libraries and the browser apis |
20:29:46 | desophos | oh :/ |
20:29:56 | desophos | ooh that would be neat |
20:29:57 | ldlework | Since I'm writing in JS |
20:30:01 | ephja | I'll probably start writing games again. not that I ever got far |
20:30:18 | ephja | I was thinking of maybe porting löve (lua framework) to nim |
20:30:26 | ldlework | It'd be cool to have a Nim graphics library that used SFML natively and Phaser in the web or something |
20:30:28 | desophos | wow, that would be quite a task |
20:30:51 | desophos | i'm writing a game in Nim |
20:30:56 | desophos | with just SDL2 :/ |
20:31:19 | desophos | i don't think i'm competent enough to write an actual engine |
20:31:28 | desophos | or a port of something existing |
20:33:02 | ephja | it's more boring than complicated |
20:34:18 | ephja | porting, of course |
20:36:51 | desophos | ldlework: you mean graphics abstractions that compile to different apis for different platforms? |
20:37:53 | desophos | a library abstraction that compiles to use different library apis |
20:38:00 | ldlework | desophos: yes |
20:38:13 | desophos | that would be interesting |
20:39:57 | ephja | no, I can't just use the socket in 2 threads. oh well |
20:40:09 | desophos | like many popular engines do, like cocos2d |
20:40:30 | * | BitPuffin quit (Ping timeout: 260 seconds) |
20:40:45 | ephja | I think löve runs in the browser, and I heard something about an android port |
20:46:36 | ephja | I have about 1 << 8 projects in the pipeline, so I just need to figure out what people want :-P |
20:46:52 | ephja | well, every other user seems to be interested in game development |
20:47:30 | * | gour is interested in just desktop apps |
20:49:03 | ldlework | Nim is awesome for game-development but I want to put my games on the web |
20:49:34 | * | makoLine joined #nim |
20:53:06 | Araq | ldlework: Nim's JS backend is quite stable these days |
20:53:36 | yglukhov | hey guys, i'm writing a game in Nim as well. the "engine" is in github/yglukhov/rod. the gui part is yglukhov/nimx. both designed to be compiled to js. so feel free to contribute ;) |
20:54:14 | * | pregressive joined #nim |
20:54:50 | ldlework | Araq: sure I just don't quite understand how to use it |
20:54:54 | ldlework | how do I call browser API's? |
20:55:20 | ephja | Araq: do exceptions work properly now? I found some JS app so I assume that's the case |
20:56:00 | ephja | raising an exception resulted in a type error before I think |
20:56:03 | Araq | I think so |
20:56:24 | Araq | ldlework: you importc them |
20:56:34 | ldlework | Araq: is there an example of that anywhere? |
20:56:40 | ldlework | Like using the canvas api or something |
20:56:57 | desophos | yglukhov: seems like several people are writing games in Nim but not collaborating :| |
20:58:21 | * | xet7 joined #nim |
21:07:56 | * | Ven_ joined #nim |
21:08:47 | * | Ven_ quit (Read error: Connection reset by peer) |
21:08:51 | * | Ven__ joined #nim |
21:11:43 | Araq | ldlework: not sure, but please just ask me |
21:20:05 | * | Ven__ quit (Read error: Connection reset by peer) |
21:21:29 | * | Ven_ joined #nim |
21:22:43 | * | yglukhov quit (Remote host closed the connection) |
21:27:11 | * | gour quit (Quit: WeeChat 1.3) |
21:40:29 | * | gokr quit (Ping timeout: 276 seconds) |
21:41:04 | * | gokr joined #nim |
21:49:25 | * | Ven_ quit (Read error: Connection reset by peer) |
21:51:42 | * | Ven_ joined #nim |
21:57:46 | * | Ven_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:07:41 | * | zepolen quit (Read error: Connection reset by peer) |
22:08:22 | * | Demon_Fox quit (Quit: Leaving) |
22:11:24 | * | zepolen joined #nim |
22:12:33 | * | girvo quit (Ping timeout: 255 seconds) |
22:16:04 | * | elrood quit (Quit: Leaving) |
22:16:37 | * | Demos joined #nim |
22:21:35 | * | Varriount-Laptop joined #nim |
22:21:55 | Varriount-Laptop | Araq: You here? |
22:23:05 | Araq | yes |
22:24:50 | * | Guest22668 is now known as coopernurse |
22:25:37 | Varriount-Laptop | Araq: Why would I be getting an 'identifier expected, but found len(s)' error when compiling this code: https://gist.github.com/Varriount/362603db9864d9deec05 |
22:25:55 | Varriount-Laptop | I thought templates accepted expressions, not just identifiers. |
22:27:17 | Araq | result.length = length# |
22:27:33 | Araq | length is also expanded in the 'result.length' |
22:27:47 | Araq | it's a gotcha, but it's also a feature I use all the time |
22:28:06 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:28:20 | * | coopernurse quit (Quit: WeeChat 1.1.1) |
22:28:38 | * | coopernurse joined #nim |
22:29:01 | * | desophos quit (Remote host closed the connection) |
22:30:01 | Varriount-Laptop | Araq: But that's what I want? It should expand to 'result.length = len(s)', shouldn't it? |
22:30:17 | Araq | no, it expands to |
22:30:25 | Araq | result.len(s) = len(s) |
22:30:32 | Araq | which is not valid Nim code |
22:30:41 | Varriount-Laptop | Ah. |
22:31:11 | * | desophos joined #nim |
22:31:16 | * | desophos quit (Remote host closed the connection) |
22:31:19 | Varriount-Laptop | It would be nice if the compiler could display the invalid line with the expanded code. |
22:31:32 | * | desophos joined #nim |
22:32:37 | * | strcmp2 quit (Remote host closed the connection) |
22:36:21 | * | desophos quit (Remote host closed the connection) |
22:37:35 | Araq | it does |
22:37:46 | Araq | it told you exactly what was wrong and where |
22:39:29 | Varriount-Laptop | Araq: Not quite. The compiler only points to the invocation site - "immstr.nim(32, 32) Error: identifier expected, but found 'len(s)'" |
22:40:08 | Varriount-Laptop | Which is odd, because I could have sworn that the compiler used to display the point in the template that the error occurred as well. |
22:40:27 | Araq | yeah, I recently changed this logic |
22:40:34 | Araq | for better nimsuggest support |
22:40:39 | Araq | I need to investigate |
22:40:47 | * | strcmp1 joined #nim |
22:43:45 | Varriount-Laptop | Araq: While it might make for better nimsuggest support, it greatly hampers manual usage of the compiler. |
22:44:43 | Araq | well fortunately 0.12.0 doesn't have this bug and it's easy to restore the old behaviour |
22:45:09 | Araq | but I wonder why you don't get an "instantiation from here" message. cause you should. |
22:45:17 | * | zepolen_ joined #nim |
22:45:22 | * | julian37 joined #nim |
22:45:26 | * | strcmp1 quit (Ping timeout: 240 seconds) |
22:45:34 | Araq | hi julian37 |
22:45:49 | Varriount-Laptop | Hey zepolen |
22:46:27 | julian37 | hi Araq :-) |
22:46:36 | Varriount-Laptop | Araq: If I create a new string via newString() then cast it to a type with an identical structure, are any of the garbage collectors going to complain? |
22:46:58 | * | zepolen quit (Ping timeout: 260 seconds) |
22:47:02 | Araq | no I don't think so |
22:47:58 | * | vendethiel quit (Ping timeout: 240 seconds) |
22:55:13 | * | strcmp1 joined #nim |
22:59:49 | * | solidsnack joined #nim |
23:03:24 | * | desophos joined #nim |
23:07:48 | * | desophos_ joined #nim |
23:07:58 | * | desophos quit (Ping timeout: 260 seconds) |
23:10:09 | * | Trustable quit (Ping timeout: 252 seconds) |
23:12:30 | * | desophos_ quit (Ping timeout: 260 seconds) |
23:13:30 | * | matkuki quit (Quit: ChatZilla 0.9.92 [Firefox 42.0/20151029151421]) |
23:19:03 | Varriount-Laptop | Oh yay, we have unsafeAddr now. |
23:19:17 | Varriount-Laptop | No more abusing casts for me! |
23:21:50 | * | askatasuna quit (Quit: WeeChat 1.3) |
23:23:22 | * | zepolen joined #nim |
23:26:25 | * | zepolen_ quit (Ping timeout: 276 seconds) |
23:34:25 | julian37 | hey I've made this: https://jscheid.github.io/nim-sandbox/index.html |
23:34:41 | julian37 | very first version... lots of little issues |
23:34:54 | Varriount-Laptop | julian37: Neat! |
23:35:01 | julian37 | code is here: https://github.com/jscheid/nim-sandbox |
23:35:14 | * | desophos_ joined #nim |
23:35:33 | Heartmender | is that seriously the nim compiler compiled to javascript? |
23:35:39 | julian37 | yup |
23:35:45 | Varriount-Laptop | O_o |
23:35:47 | Heartmender | lol |
23:35:51 | julian37 | :-) |
23:36:10 | * | dtscode is now known as nchambers |
23:36:21 | Varriount-Laptop | julian37: How did you get all the system-specific calls working? Patch the compiler" |
23:36:24 | Varriount-Laptop | *? |
23:38:16 | julian37 | I probably didn't |
23:38:20 | julian37 | but emscripten handles quite a few |
23:38:43 | julian37 | no patching whatsoever |
23:38:49 | julian37 | this is vanilla 0.12 |
23:38:59 | julian37 | (with a little wrapper around it) |
23:39:24 | julian37 | this here: https://github.com/jscheid/nim-sandbox/blob/master/emscripten_compiler.nim |
23:39:45 | Varriount-Laptop | Ah, the magic of emscripten. |
23:39:53 | Varriount-Laptop | Impressive nevertheless. |
23:39:57 | julian37 | which still needs some love... I'd like to get rid of resetAllModulesHard for speed |
23:40:14 | Varriount-Laptop | julian37: If you polish it up... we could host it on the Nim website. |
23:40:19 | julian37 | oh, I see... you thought it's self hosted. no, I didn't want to go there :-) |
23:40:41 | julian37 | yeah sure, that would be great |
23:41:04 | julian37 | so far it's just a weekend project so don't hold your breath re: polish... but would be nice to get it there of course |
23:41:16 | julian37 | I'll need some help with fixing the memory issues |
23:41:25 | julian37 | right now if you click "compile" a few times it'll break |
23:41:34 | julian37 | something's leaking... |
23:41:48 | julian37 | or the GC isn't working |
23:41:59 | julian37 | will GC_fullCollect collect after GC_disable? |
23:42:20 | julian37 | do I need to GC_enable;GC_fullCollect;GC_disable? |
23:42:37 | Varriount-Laptop | julian37: I think so. |
23:42:43 | julian37 | let me try that |
23:43:00 | Varriount-Laptop | julian37: Remember that the default GC is conservative, meaning that if a pointer to a GC'd object is in memory, it won't collect it. |
23:43:25 | Varriount-Laptop | Er, 'memory' in this case is the stack, I think. |
23:43:49 | Varriount-Laptop | It still uses refcounting to track references in the heap. |
23:44:07 | julian37 | but resetAllModulesHard would forget the data from previous compile runs, right? |
23:44:20 | julian37 | i.e. remove any references from the stack and heap? |
23:45:11 | Varriount-Laptop | julian37: Are there any comments associated with that procedure? |
23:45:51 | julian37 | not sure what you mean. my code is devoid of any comments so far, it's a quick weekend hack... if that's what you mean |
23:46:24 | julian37 | the recompilation logic is loosely based on compiler/service.nim |
23:46:33 | julian37 | and compiler/nim.nim |
23:47:11 | julian37 | plus a dusting of black magic ;-) |
23:48:19 | julian37 | Varriount-Laptop: hmm no, wrapping it in GC_enable/GC_disable doesn't help |
23:49:51 | julian37 | to phrase the problem coherently: I'd like to do efficient (re)compilation using the cache hinted at here: https://github.com/nim-lang/Nim/blob/60e5a2b2f53c0bfaa57a48f53b0b3dfcca1bef76/compiler/service.nim#L19 |
23:50:18 | julian37 | yet I don't want to keep stale cache entries around forever because memory is precious, especially with emscripten |
23:50:53 | * | zepolen_ joined #nim |
23:51:08 | julian37 | at first I tried resetAllModules(), but that seemed to accumulate script code rather than replacing it (e.g. compiling 'echo "foo"', then 'echo "bar"' would produce code that echoes both foo and bar) |
23:51:36 | julian37 | using resetAllModulesHard instead fixed that issue, but at the expense of some performance (I think) |
23:51:50 | * | zepolen quit (Ping timeout: 265 seconds) |
23:52:13 | julian37 | and it doesn't truly seem to flush the cache or it wouldn't run out of memory so quickly (assuming the GC works in this emscripten hack, generally, but I don't see why it wouldn't) |
23:52:34 | Varriount-Laptop | Araq might know. |
23:53:07 | Varriount-Laptop | In other news, I have a serviceable ImmutableString type. |
23:55:13 | * | gokr quit (Ping timeout: 244 seconds) |
23:56:52 | * | zepolen joined #nim |