00:02:56 | * | bamorim joined #nim |
00:13:55 | * | gokr quit (Quit: Leaving.) |
00:52:10 | * | chrisheller quit (Ping timeout: 252 seconds) |
00:53:29 | * | wuehlmaus quit (Quit: Lost terminal) |
01:05:39 | * | sarlalian quit (Ping timeout: 276 seconds) |
01:11:02 | Varriount | Araq: I have the joy of working with mmap today. |
01:11:32 | * | sarlalian joined #nim |
01:18:42 | * | desophos quit (Remote host closed the connection) |
01:20:06 | * | yuta joined #nim |
01:24:50 | yuta | Varriount: I realized that nimsuggest users might need to change --verbosity |
01:24:55 | yuta | option to --nim.verbosity in major restructure branch because IDEs or editors |
01:25:04 | yuta | set that option to prevent hint message for auto completion feature. |
01:25:46 | yuta | In that case, oldProcessCmdLine function might be meaningless? |
01:25:50 | * | vendethiel joined #nim |
01:26:22 | Varriount | yuta: oldProcessCmdLine handles all the cases in which a proper mode isn't detected. |
01:26:38 | Varriount | e.g. "nimsuggest nimsuggest.nim" |
01:27:55 | yuta | ok |
01:28:11 | Varriount | yuta: Since the old invokation style doesn't have the concept of a mode argument, this also happily works out. |
01:30:49 | yuta | Sorry, I was misunderstanding it from the help message. |
01:32:33 | yuta | I could use `nimsuggest --stdin --verbosity:0 xxx.nim` old style |
01:33:05 | Varriount | Yes. At least, you should be able to - if you can't, that's a bug. |
01:36:35 | * | desophos joined #nim |
01:46:47 | * | vendethiel quit (Ping timeout: 260 seconds) |
01:55:05 | * | francisl joined #nim |
01:55:52 | * | chrisheller joined #nim |
02:09:13 | * | bamorim quit (Ping timeout: 240 seconds) |
02:09:54 | * | toaoMgeorge quit (Read error: Connection reset by peer) |
02:16:41 | * | krux02 joined #nim |
02:22:55 | * | Demon_Fox quit (Quit: Leaving) |
02:35:45 | * | mwbrown joined #nim |
02:59:17 | * | kulelu88 joined #nim |
02:59:17 | * | kulelu88 quit (Changing host) |
02:59:17 | * | kulelu88 joined #nim |
03:00:30 | * | perturbation left #nim ("Leaving") |
03:00:39 | * | perturbation joined #nim |
03:00:47 | * | perturbation quit (Quit: Leaving) |
03:11:44 | * | brson quit (Quit: leaving) |
03:17:52 | * | brson joined #nim |
03:29:23 | * | endragor joined #nim |
03:29:26 | * | endragor quit (Remote host closed the connection) |
03:29:55 | * | endragor joined #nim |
03:30:35 | * | desophos_ joined #nim |
03:35:48 | * | desophos_ quit (Ping timeout: 276 seconds) |
03:40:29 | * | endragor_ joined #nim |
03:41:49 | * | endragor_ quit (Remote host closed the connection) |
03:43:27 | * | endragor quit (Ping timeout: 260 seconds) |
03:45:42 | * | endragor joined #nim |
04:05:10 | * | vendethiel joined #nim |
04:12:42 | * | brson quit (Quit: leaving) |
04:13:53 | * | kulelu88 quit (Quit: Leaving) |
04:20:18 | * | krux02 quit (Remote host closed the connection) |
04:25:01 | * | francisl quit (Ping timeout: 248 seconds) |
04:30:52 | * | yuta quit (Remote host closed the connection) |
05:09:33 | * | vendethiel quit (Ping timeout: 240 seconds) |
05:14:27 | * | vendethiel joined #nim |
05:25:23 | * | desophos quit (Read error: Connection reset by peer) |
05:35:37 | * | vendethiel quit (Ping timeout: 240 seconds) |
05:42:35 | * | mwbrown quit (Quit: Leaving) |
06:03:02 | * | yglukhov joined #nim |
06:09:57 | * | yglukhov quit (Remote host closed the connection) |
06:20:11 | * | endragor_ joined #nim |
06:24:00 | * | endragor quit (Ping timeout: 246 seconds) |
06:31:24 | * | endragor_ quit (Remote host closed the connection) |
06:31:53 | * | endragor joined #nim |
06:32:08 | * | vendethiel joined #nim |
06:46:24 | * | desophos joined #nim |
06:50:33 | * | desophos quit (Ping timeout: 240 seconds) |
06:54:51 | * | vendethiel quit (Ping timeout: 244 seconds) |
06:59:35 | * | wuehlmaus joined #nim |
08:08:43 | * | gokr joined #nim |
08:08:55 | * | gokr quit (Client Quit) |
08:08:59 | * | gokr1 joined #nim |
08:15:29 | * | yglukhov joined #nim |
08:32:30 | * | rkeene quit (Ping timeout: 244 seconds) |
08:33:54 | cheatfate | is there any reason that tables(tables.nim) has "hasKey()" and sharedtables(sharedtables.nim) dont have "hasKey()"? |
08:34:15 | * | rkeene joined #nim |
08:55:41 | * | dorei joined #nim |
08:59:40 | cheatfate | Araq, how can i detect "--threads:on" at compile time? and what is "useStdlibThreading" in selectors.nim? |
09:00:22 | Araq | cheatfate: sharedtables 'hasKey' encourages races |
09:00:45 | Araq | if hasKey(...): ... assume it has the key ... ooops, race condition |
09:01:14 | Araq | cheatfate: when compileOption("threads") iirc |
09:02:41 | cheatfate | so useStdlibThreading is not the same as compileOption("threads") |
09:06:10 | cheatfate | about sharedtables yeah i agree with you, but without hasKey you can't get information about key presence without exception |
09:07:11 | Araq | cheatfate: it needs a tryGetValue or something then |
09:09:32 | * | toaoMgeorge joined #nim |
09:09:45 | cheatfate | Araq, ok, what about "useStdlibThreading"? do you know what it mean? |
09:10:11 | Araq | yeah, I wrote it lol |
09:10:51 | Araq | -d:useStdlibThreading # use the multicore ready stdlib |
09:11:19 | Araq | that means asynchttpserver etc use threading under the hood for you |
09:11:24 | * | toaoMgeorge quit (Read error: Connection reset by peer) |
09:12:22 | vegansk | Araq, does it work in devel or only in crazy_concurrency branch? |
09:13:05 | Araq | crazy_concurrency |
09:13:22 | * | vendethiel joined #nim |
09:15:21 | cheatfate | Araq, but asynchttpserver.nim -> asyncdispatch.nim -> selectors.nim (which has hasKey()) so it seems thats "useStdlibThreading" defined for future? |
09:16:07 | cheatfate | because you can't compile selectors.nim with -d:useStdlibThreading... |
09:19:34 | Araq | cheatfate: yeah further development of this feature can be found in the crazy_concurrency branch |
09:46:38 | * | enthus1ast quit (Ping timeout: 250 seconds) |
09:48:37 | cheatfate | Araq, but is it possible to implement at least "proc len*[A, B](t: Table[A, B]): int ="? |
09:51:45 | Araq | sure it's possible, but it encourages races |
09:55:03 | * | vendethiel quit (Ping timeout: 240 seconds) |
10:05:00 | * | vendethiel joined #nim |
10:24:34 | * | miko__ joined #nim |
10:27:11 | * | vendethiel quit (Ping timeout: 268 seconds) |
10:27:33 | miko__ | Can anybody help me with indentation here? This is invalid, I don't know why. http://pastebin.ca/3409235 |
10:35:10 | flyx | miko__: no ":" at end of "case key", and don't indent "of" lines further |
10:37:46 | miko__ | Both is done here: https://nim-by-example.github.io/case/ This this wrong? |
10:41:28 | miko__ | Thanks, btw. |
10:41:42 | Araq | either use the colon and indentation |
10:41:48 | Araq | or none |
10:42:25 | Araq | and the colon plus indentation is misguided IMHO since 'case x:' isn't followed by a list of statements at all |
10:44:00 | miko__ | ok |
10:55:12 | * | Trustable joined #nim |
10:58:30 | * | rok joined #nim |
10:58:32 | * | rok is now known as rok_ |
10:59:42 | * | endragor quit (Read error: Connection reset by peer) |
10:59:48 | * | endragor_ joined #nim |
11:16:34 | vegansk | Araq, is it hard to fix? https://github.com/nim-lang/Nim/issues/3995 |
11:22:02 | Araq | vegansk: yes. |
11:23:42 | * | irrequietus joined #nim |
11:23:46 | * | Demon_Fox joined #nim |
11:30:58 | * | krux02 joined #nim |
11:43:12 | * | darkf quit (Quit: Leaving) |
11:43:35 | endragor_ | Given I have a name of declared type in a macro, is it possible to retrieve mangled name of the type? (including ref types and, ideally, instantiated generics, too) |
11:51:43 | * | Trustable quit (Remote host closed the connection) |
11:52:14 | * | rok joined #nim |
11:52:57 | * | fredrik92 joined #nim |
11:54:21 | * | rok_ quit (Ping timeout: 276 seconds) |
12:05:21 | * | Trustable joined #nim |
12:06:55 | Araq | codegen which does the name mangling comes afterwards, so no. |
12:23:25 | * | vonh quit (Ping timeout: 248 seconds) |
12:23:49 | * | vonh joined #nim |
12:27:41 | * | boopsiesisaway is now known as boopsies |
12:38:06 | * | vegansk is now known as veganskaway |
12:40:46 | * | rok quit (Quit: rok) |
12:42:37 | * | BitPuffin joined #nim |
12:54:43 | * | Arrrr joined #nim |
12:54:43 | * | Arrrr quit (Changing host) |
12:54:43 | * | Arrrr joined #nim |
13:02:48 | * | irrequietus quit () |
13:12:03 | * | vonh quit (Ping timeout: 244 seconds) |
13:12:25 | * | vonh joined #nim |
13:17:01 | * | gokr1 quit (Quit: Leaving.) |
13:18:42 | * | vendethiel joined #nim |
13:29:15 | * | zama quit (Ping timeout: 276 seconds) |
13:31:38 | * | zama joined #nim |
13:32:27 | * | rok joined #nim |
13:34:36 | krux02 | does anyone here use the emacs nim-mode? I try to get it running, but since I am new to emacs I am not sure if I did everything right |
13:41:20 | reactormonk | krux02, it's been a while. |
13:42:04 | krux02 | what are you using then? |
13:42:16 | reactormonk | It's been a while since I've used nim-mode :-) |
13:42:23 | reactormonk | but got ahead, shoot. |
13:43:33 | * | vendethiel quit (Ping timeout: 244 seconds) |
13:44:01 | krux02 | I get an error with internal--listify to be void |
13:45:11 | reactormonk | emacs version? |
13:45:20 | krux02 | nim-smie.el:114:1:Error: Symbol's value as variable is void: internal--listify |
13:45:47 | krux02 | GNU Emacs 24.5.1 |
13:46:06 | krux02 | on arch linux |
13:46:23 | * | vendethiel joined #nim |
13:48:41 | endragor_ | https://github.com/pragmagic/vscode-nim :-P |
13:52:00 | * | Trustable quit (Quit: Leaving) |
13:56:20 | krux02 | not sure if I am a fan of visual studio code |
14:01:29 | * | Trustable joined #nim |
14:01:31 | * | Trustable quit (Remote host closed the connection) |
14:07:52 | * | couven92 joined #nim |
14:08:34 | * | vendethiel quit (Ping timeout: 268 seconds) |
14:08:35 | * | Xe quit (Ping timeout: 250 seconds) |
14:09:01 | * | Riviera- quit (Ping timeout: 250 seconds) |
14:09:27 | * | JStoker quit (Ping timeout: 250 seconds) |
14:09:27 | * | pigmej quit (Ping timeout: 250 seconds) |
14:09:27 | * | flyx quit (Ping timeout: 250 seconds) |
14:10:45 | * | Gonzih quit (Ping timeout: 250 seconds) |
14:10:46 | * | apotheon quit (Ping timeout: 252 seconds) |
14:10:54 | * | fredrik92 quit (Ping timeout: 246 seconds) |
14:11:37 | * | lyro quit (Ping timeout: 250 seconds) |
14:12:55 | * | devn quit (Ping timeout: 250 seconds) |
14:13:21 | * | SirCmpwn quit (Ping timeout: 250 seconds) |
14:13:28 | * | sora joined #nim |
14:13:44 | * | devn joined #nim |
14:13:47 | * | thotypous quit (Ping timeout: 250 seconds) |
14:14:13 | * | oceanpollen quit (Ping timeout: 250 seconds) |
14:14:52 | * | JStoker joined #nim |
14:15:29 | reactormonk | got the newest nim-mode? |
14:15:41 | * | thotypous joined #nim |
14:15:53 | * | SirCmpwn joined #nim |
14:16:00 | * | couven92 quit (Quit: Leaving) |
14:16:34 | * | couven92 joined #nim |
14:16:45 | * | Gonzih joined #nim |
14:17:13 | * | Xe joined #nim |
14:18:35 | * | flyx|znc joined #nim |
14:18:35 | * | flyx|znc is now known as flyx |
14:18:40 | * | pigmej joined #nim |
14:21:00 | * | oceanpollen joined #nim |
14:21:32 | * | lyro joined #nim |
14:25:10 | * | gokr joined #nim |
14:32:12 | * | nmcp04 joined #nim |
14:37:43 | * | nmcp04 quit (Quit: Page closed) |
14:50:19 | cheatfate | https://gist.github.com/cheatfate/e1d3e929089db2811393 how i must define commented functions to avoid code duplication for every platform? |
14:57:17 | gokr | yglukhov: You are the main js hacker, right? I am curious how to make calls into js libraries, dynamically? |
14:58:15 | gokr | yglukhov: Reason I ask is because... my Ni interpreter (written in Nim) runs just fine as compiled to js (although slow, but doesn't matter). |
15:01:13 | yglukhov | gokr: dynamically? what do you mean by that? |
15:01:47 | gokr | I mean... my Ni interpreter wants to make calls into js - but unknown of course when I compile the interpreter. |
15:04:10 | yglukhov | ah... ok.. document["getElementById"]("MyId") ? |
15:04:37 | yglukhov | or... eval? =) |
15:04:50 | gokr | Yeah, I realize that eval() is probably what I am babbling about. |
15:05:25 | yglukhov | document["getElementById"]("MyId") seems like a cleaner solution to me. |
15:06:05 | yglukhov | but anyway you wont get away without some {.emits.} i guess... |
15:06:28 | yglukhov | eval is hostile to jit, afaik |
15:06:39 | gokr | I will try to experiment a bit. |
15:07:30 | gokr | Perhaps I can use eval to redefine some functions somehow etc. So that I don't do eval on "every call" of course. |
15:19:01 | * | mwbrown joined #nim |
15:28:42 | * | mwbrown quit (Quit: Leaving) |
15:32:08 | * | rok quit (Quit: rok) |
15:39:14 | * | gokr quit (Quit: Leaving.) |
15:56:37 | * | rok joined #nim |
15:56:48 | * | arnetheduck quit (Ping timeout: 276 seconds) |
15:59:33 | * | mwbrown joined #nim |
16:02:08 | * | sora quit (Read error: Connection reset by peer) |
16:06:51 | * | 7GHAALF9H joined #nim |
16:07:12 | * | yglukhov quit (Ping timeout: 276 seconds) |
16:13:05 | * | dorei quit (Quit: Page closed) |
16:19:52 | * | couven92 quit (Quit: shutting down . . .) |
16:27:21 | * | 7GHAALF9H quit (Remote host closed the connection) |
16:59:46 | * | desophos joined #nim |
17:04:31 | * | yglukhov joined #nim |
17:05:14 | * | vendethiel joined #nim |
17:08:45 | * | yglukhov quit (Ping timeout: 248 seconds) |
17:13:05 | * | Riviera- joined #nim |
17:13:22 | * | brson joined #nim |
17:16:03 | * | yglukhov joined #nim |
17:18:42 | * | endragor_ quit (Ping timeout: 276 seconds) |
17:22:25 | * | yglukhov quit (Remote host closed the connection) |
17:23:00 | * | gokr joined #nim |
17:26:16 | * | endragor joined #nim |
17:38:12 | * | desophos quit (Remote host closed the connection) |
17:46:17 | * | yglukhov joined #nim |
17:50:21 | federico3 | I'm happy to announce that Nim 0.13 is in Debian Unstable |
17:52:23 | * | desophos joined #nim |
17:54:59 | dom96 | federico3: yay |
17:55:48 | Arrrr | way to go |
17:56:12 | * | def- quit (Ping timeout: 244 seconds) |
17:57:33 | federico3 | I'd be happy to include nimble and nimsuggests if they were to be included in the release tarball |
17:58:16 | * | kori joined #nim |
17:59:48 | * | yglukhov quit (Remote host closed the connection) |
18:02:35 | * | def- joined #nim |
18:05:02 | * | desophos quit (Remote host closed the connection) |
18:07:54 | * | nchambers is now known as DeerGod |
18:12:23 | * | desophos joined #nim |
18:16:16 | * | irrequietus joined #nim |
18:21:53 | * | yglukhov joined #nim |
18:23:13 | * | brson quit (Ping timeout: 240 seconds) |
18:26:45 | * | brson joined #nim |
18:32:32 | * | jazzyy joined #nim |
18:32:44 | * | jazzyy left #nim (#nim) |
18:48:24 | * | mog quit (Ping timeout: 276 seconds) |
18:53:28 | * | mog joined #nim |
18:54:41 | * | desophos_ joined #nim |
18:55:27 | * | nsf quit (Ping timeout: 250 seconds) |
18:55:53 | * | desophos quit (Ping timeout: 250 seconds) |
18:55:53 | * | Learath2 quit (Ping timeout: 250 seconds) |
19:02:44 | * | Learath2 joined #nim |
19:09:07 | * | desophos_ quit (Remote host closed the connection) |
19:10:15 | * | DeerGod is now known as nchambers |
19:12:00 | * | nsf joined #nim |
19:12:41 | * | NhanH_ joined #nim |
19:15:04 | * | irrequietus quit () |
19:15:16 | * | desophos joined #nim |
19:15:54 | cheatfate | dom96, why you want this code https://github.com/nim-lang/Nim/pull/3994 in smtp.nim? |
19:17:19 | * | desophos quit (Remote host closed the connection) |
19:17:57 | * | desophos joined #nim |
19:19:43 | * | Arrrr_ joined #nim |
19:19:51 | * | StarBrilliant quit (Ping timeout: 250 seconds) |
19:19:52 | * | NhanH quit (Ping timeout: 250 seconds) |
19:21:13 | * | lyro quit (Ping timeout: 268 seconds) |
19:21:24 | * | StarBrilliant joined #nim |
19:21:27 | * | Arrrr_ quit (Client Quit) |
19:21:37 | * | pigmej quit (Ping timeout: 240 seconds) |
19:21:37 | * | alexsystemf_ quit (Ping timeout: 240 seconds) |
19:21:50 | * | Arrrr quit (Ping timeout: 268 seconds) |
19:22:16 | * | pigmej joined #nim |
19:22:16 | * | NhanH_ is now known as NhanH |
19:23:07 | cncl | oh, interesting. i can't go like foo.bar.baz = 5 in nim, apparently? |
19:23:10 | * | alexsystemf_ joined #nim |
19:26:46 | Araq | cncl: sure you can. but it depends on what foo and bar is. |
19:27:39 | cncl | hmm |
19:28:11 | * | brson quit (Ping timeout: 244 seconds) |
19:28:39 | cncl | https://gist.github.com/anonymous/dbb0b78e7535a4701944 |
19:28:55 | * | lyro joined #nim |
19:29:16 | cncl | oops one sec |
19:29:47 | cncl | i wasn't signed in and i copied the wrong error message |
19:30:14 | cheatfate | cncl, it looks like we dont see line 170 |
19:30:21 | cncl | yeah |
19:30:28 | cncl | https://gist.github.com/randrew/f7ed3b22136c69f3d1b4 |
19:30:30 | cncl | sorry |
19:30:43 | cncl | that one has the correct error message |
19:31:25 | cncl | i'm surprised mutating a type within another type hasn't come up in my code before |
19:31:38 | cncl | i looked back through the stuff i've already written and i never do it |
19:35:21 | cheatfate | but CardStats doesnt have healthMax |
19:36:23 | cncl | egads! |
19:36:33 | cncl | i have two different buffers of the same file open |
19:36:38 | cncl | you're right |
19:36:45 | cncl | i was building with the wrong file |
19:37:02 | cncl | thanks :) |
19:37:26 | cncl | it was not in a subobject in the other one |
19:38:04 | cncl | oh another question |
19:38:08 | cncl | when i'm using quote inside of a macro |
19:38:09 | * | yglukhov quit (Remote host closed the connection) |
19:38:22 | cncl | i can't seem to figure out how the symbol binding works |
19:38:47 | cncl | is there a description of how it works somewhere? |
19:39:03 | cheatfate | cncl, i cant figure macro too, so i cant help :( |
19:40:37 | * | endragor quit (Remote host closed the connection) |
19:42:21 | cncl | well i'm able to write macros just fine |
19:43:07 | cncl | but usually quote seems to resolve symbols in the lexical scope of the macro |
19:43:10 | cncl | which is not what i want |
19:47:14 | Araq | don't use quote |
19:47:25 | Araq | use a helper template that's dirty and getAst |
19:47:41 | Araq | quote doesn't have dirty vs clean. templates do. |
19:47:53 | Araq | I never use quote because of that. |
19:48:20 | cncl | ah ok |
19:48:26 | Araq | (plus of course, I didn't invent quote, so how good can it be? ;-) ) |
19:48:30 | cncl | haha |
19:49:00 | * | def- quit (Ping timeout: 246 seconds) |
19:49:06 | cncl | i didn't think of using a helper template, i'll try that next time |
19:50:48 | * | def- joined #nim |
19:51:16 | * | yglukhov joined #nim |
19:56:42 | * | filcuc joined #nim |
19:58:00 | filcuc | Araq: after the talk of yestarday evening i tried to give c2nim a try. However it seems like it cannot handle macros before a function |
19:58:33 | Araq | *shrug* I'm tired of this discussion. |
19:58:36 | filcuc | Araq: like MY_EXPORT void foo(); |
19:58:37 | Araq | read its manual. |
19:58:56 | filcuc | RTFM |
19:59:02 | Araq | I used it to translate ~500_000 lines of code. |
19:59:35 | Araq | #def MY_EXPORT |
20:00:43 | cncl | it works fine for macros before a function |
20:00:46 | cncl | it even has a feature for it |
20:00:53 | cncl | i used it the other day on 2 libraries just fine |
20:01:44 | cncl | you can try mangle, pp and def, depending on what ou want it to do |
20:02:06 | filcuc | Araq: read it, fine :D but really maybe it should be added somewhere or maybe as an option from the commandline |
20:02:18 | filcuc | Araq: if you complain that too many people bother you about it |
20:03:04 | filcuc | Araq: (and really i can understand your reason, we should read the manual) |
20:05:08 | cncl | if you are doing nontrivial stuff with c2nim, i find that it's better to do it with the statements in the .h file, that way you can more easily edit it and keep a record of what you did to get the output |
20:05:52 | cncl | it's also difficult to do stuff like use mangle on the command line because of the weird characters you need to use that command lines don't like without escaping |
20:06:03 | Araq | what cncl said. |
20:06:19 | Araq | also you can have all that directives in its own .c2nim file |
20:06:32 | Araq | and thus apply the rules for multiple headers easily |
20:07:03 | Araq | can you can also directly embed Nim code |
20:07:22 | Araq | so you can keep the original headers, some diffs and run c2nim again should the header files change |
20:07:25 | filcuc | cool, but again maybe mentioning in the help message can save people asking about it |
20:07:56 | filcuc | i'm not saying anything about the tool (and i do really think that it's awesome) |
20:08:20 | Araq | I used Swig and FPC's header conversion tool in the past. |
20:08:38 | Araq | In my opinion c2nim is superior. |
20:09:20 | * | irrequietus joined #nim |
20:09:49 | * | brson joined #nim |
20:10:05 | Araq | and it's telling that nothing ever came from the "Omg, just use clang as a library already" crowd :P |
20:10:27 | filcuc | lol |
20:11:47 | ldlework | cncl: you should write a c2nim guide |
20:11:51 | ldlework | for realsies. |
20:11:54 | ldlework | transfer that knowledge. |
20:12:31 | filcuc | Araq: i don't know to who are you talking to :D i mean if you're saying it to me, well i didn't say anything about its potential |
20:13:24 | Araq | nah, I'm talking about nobody in particular. |
20:14:39 | cncl | ldlework: it's not that hard. probably half of the guide would be spent on setting up mingw or msvc correctly and how linking works and stuff :P |
20:14:46 | filcuc | Araq: so just pouring out ;) |
20:14:46 | cncl | and calling conventions |
20:15:03 | ldlework | cncl 'its not that hard' is precisely why you should |
20:15:04 | * | ldlework shrugs. |
20:15:23 | cncl | yeah maybe |
20:16:11 | cheatfate | Varriount, is it possible with nimlime's nim check define symbols for nim? like -d:something |
20:25:24 | * | gokr quit (Ping timeout: 246 seconds) |
20:26:28 | * | gokr joined #nim |
20:27:52 | * | darkf joined #nim |
20:28:32 | filcuc | just for asking but...given that nim can import symbols from a cpp library does it mean that it knows the mengling of all cpp compilers? |
20:29:50 | cncl | no |
20:30:02 | cncl | you have to export the cpp symbols with extern c, like using cpp with c compilers |
20:30:20 | cncl | unless i am gravely mistaken |
20:31:34 | Araq | ha, you're both wrong. |
20:31:46 | Araq | importcpp means you compile to C++ |
20:32:00 | Araq | and so we leave the mangling to the C++ compiler. |
20:32:06 | cncl | oh, yes, if you're building with c++ |
20:32:56 | filcuc | [21:27] <cncl> you have to export the cpp symbols with extern c, like using cpp with c compilers |
20:33:10 | filcuc | i don't understand this one..should i use importc |
20:33:21 | cncl | it depends |
20:33:25 | filcuc | since the symbol is exported with c mangling? |
20:33:27 | cncl | is it a c++ library? |
20:33:49 | cncl | was the c++ library given an interface that works for c? |
20:33:49 | filcuc | if you mean that it has been compiled by a c++ compiler, yes |
20:34:09 | cncl | it's possible for c++ compilers to build objects that can be used by c compilers via extern c |
20:34:34 | cncl | if that's the case you can use importc and not have to build your nim code as c++ |
20:34:51 | cncl | if not, you will either need to make that interface yourself, or use importcpp and build your nim code as c++ |
20:34:51 | filcuc | Araq: so basically you're saying that nim should use the cpp compiler..correct? |
20:35:30 | cncl | does the .h file you are looking to make a nim file out of have 'extern c' anywhere in it? can you upload it and i'll look at it? |
20:35:56 | filcuc | cncl: what do you mean with interface? yes my cpp library has a .h with only extern c symbols |
20:36:01 | filcuc | declarations |
20:36:22 | cncl | then you don't need to build your nim as c++ |
20:36:24 | Araq | actually Nim supports partial C++ code generation |
20:36:31 | cncl | you can just use regular importc |
20:36:38 | Araq | so only the modules that importcpp end up in a .cpp file |
20:36:46 | Araq | the rest is compiled as C code. |
20:36:48 | cncl | ah i didn't know that |
20:37:13 | Araq | but it's rather fragile ... I don't really recommend it. |
20:37:46 | cncl | if you have a plain c interface you should definitely use that, though |
20:37:51 | filcuc | Araq: but do they get compiles separately (.c files with the c compiler and .cpp with the c++ compiler) or everything by the cpp compiler (in the case of mixed importc and importcpp) |
20:38:01 | cncl | he just said separately |
20:38:07 | filcuc | cncl: my header file is this one https://github.com/filcuc/DOtherSide/blob/ObjectFactories/lib/include/DOtherSide/DOtherSide.h |
20:38:08 | cncl | so i think that's what it does |
20:38:59 | cncl | yes you should use importc here |
20:39:19 | filcuc | cncl: plus types https://github.com/filcuc/DOtherSide/blob/ObjectFactories/lib/include/DOtherSide/DOtherSideTypes.h |
20:39:43 | cncl | you will also want to set it up to use a dylib/dll |
20:40:05 | cncl | so that your nim program will load the object file at runtime instead of trying to statically link something |
20:40:12 | filcuc | cncl: to be honest i experienced crashes with dynlib |
20:40:28 | filcuc | dunno way..but they didn't happen with static linking |
20:40:46 | filcuc | so right now i removed the dynlib functionality |
20:40:50 | filcuc | and used explicit linking |
20:40:55 | cncl | that's odd |
20:40:59 | filcuc | but that could be caused my Qt libraries |
20:41:25 | filcuc | or maybe by mixing C compiler for the nim program and cpp compiler (used for compiling the Qt libraries) |
20:41:32 | cncl | no that is fine |
20:41:34 | cncl | i do it all the time |
20:42:06 | cncl | a lot of software is written in c++, build as a shared library, and then exposed with a c interface |
20:42:13 | filcuc | yep i know...and i didn't mixed different compilers (clang and gcc) everything built from gcc |
20:42:26 | cncl | mixing compilers is also ok |
20:42:54 | filcuc | right now i'm finishing version 0.5.0 of my library..but i'm going to give dynlib a second try |
20:43:20 | cncl | well if you can only get it to work with static, that's fine, but it probably means something else is wrong |
20:43:37 | cncl | dynlib/dll is nice because you can rebuild and iterate faster, the linker doesn't run for as long |
20:43:55 | cncl | then if you want to build static for releasing to other people, you can do it |
20:46:49 | filcuc | wait with static i mean by linking to the actual library (static or dynamic) |
20:47:13 | filcuc | not by using LoadLibrary or such |
20:47:17 | cncl | yes |
20:47:28 | cncl | oh |
20:47:41 | cncl | wait, i don't understand what you mean |
20:48:09 | cncl | static linking means taking a .a (full of .o) or .o file and linking it directly into your program binary |
20:48:38 | cncl | dynamic linking means using a shared object file (.so, dynlib, .dll) and loading it at runtime, either explicitly in your application code or as handled by your language/compiler/runtime |
20:49:55 | filcuc | cncl: yep but in the second case if you use LoadLibrary your application doesn't explictly declare that it links the target .dll/so |
20:50:33 | filcuc | instead if you "gcc ... -lmyLib" (where libMyLib.so) it's dynamic linking but "explicit" |
20:51:29 | Araq | that's never a concern for any software written in Perl, Python, Ruby, Lua, ... though. |
20:51:34 | * | aziz joined #nim |
20:51:46 | filcuc | and i think that dynlib use the latter way |
20:51:53 | filcuc | so LoadLibrary or such |
20:52:13 | cncl | sorry i meant to type dylib |
20:52:15 | cncl | as in for mac |
20:52:17 | Araq | if you use --dynlibOverride you can do like for C. |
20:52:37 | Araq | and mess with -lfoo stuff, enjoy. |
20:52:46 | filcuc | what i've experienced are crashes when using LoadLibrary and not when expliclty linking (by using -lmyLib in gcc) |
20:52:54 | cncl | nim lets you use explicit or implicit dynamic linking |
20:53:08 | filcuc | yep i know that |
20:53:18 | cncl | i believe the opengl library for nim uses explicit dynamic linking to load extensions |
20:53:23 | Araq | but as I said, the LoadLibrary approach is not a problem for any scripting language out there |
20:53:28 | cncl | maybe you can see what that does? |
20:53:41 | filcuc | it's that i really loved the dynlib features but i still didn't get the crashes...but as i said it could not be caused by anthing nim does |
20:54:57 | * | BitPuffin quit (Ping timeout: 244 seconds) |
21:08:55 | * | vonh quit (Ping timeout: 244 seconds) |
21:10:35 | * | vonh joined #nim |
21:24:25 | * | brson quit (Ping timeout: 240 seconds) |
21:32:20 | * | Jesin quit (Remote host closed the connection) |
21:33:05 | * | brson joined #nim |
21:56:04 | * | brson quit (Ping timeout: 252 seconds) |
21:57:43 | cncl | is there a way to turn off XDeclaredButNotUsed, but only at the top level? |
22:01:09 | * | yglukhov quit (Remote host closed the connection) |
22:03:09 | * | brson joined #nim |
22:11:45 | * | rok quit (Quit: rok) |
22:20:41 | * | BitPuffin joined #nim |
22:22:41 | * | miko__ quit (Quit: Verlassend) |
22:23:31 | * | [CBR]Unspoken quit (Ping timeout: 248 seconds) |
22:27:31 | * | Jesin joined #nim |
22:28:03 | * | Jesin quit (Remote host closed the connection) |
22:30:25 | * | irrequietus quit (Ping timeout: 240 seconds) |
22:30:57 | * | irrequietus joined #nim |
22:31:55 | * | Jesin joined #nim |
22:34:12 | cheatfate | cncl, {.hint[XDeclaredButNotUsed]: off.} ? |
22:36:39 | * | mwbrown quit (Ping timeout: 260 seconds) |
22:40:23 | * | vendethiel quit (Ping timeout: 244 seconds) |
22:43:42 | * | vendethiel joined #nim |
23:02:48 | * | exebook joined #nim |
23:02:51 | * | gunn quit (Read error: Connection reset by peer) |
23:03:27 | * | gunn joined #nim |
23:04:49 | * | mnemonikk quit (Ping timeout: 240 seconds) |
23:05:55 | * | vendethiel quit (Ping timeout: 252 seconds) |
23:06:13 | * | BitPuffin|osx joined #nim |
23:06:51 | * | bamorim joined #nim |
23:08:13 | * | BitPuffin|osx quit (Remote host closed the connection) |
23:08:31 | * | BitPuffin|osx joined #nim |
23:08:33 | * | itPuffin|osxB joined #nim |
23:08:42 | * | itPuffin|osxB quit (Remote host closed the connection) |
23:08:42 | * | BitPuffin|osx quit (Remote host closed the connection) |
23:09:31 | * | BitPuffin|osx joined #nim |
23:11:08 | * | mnemonikk joined #nim |
23:11:08 | * | mnemonikk quit (Changing host) |
23:11:08 | * | mnemonikk joined #nim |
23:11:14 | * | BitPuffin quit (Ping timeout: 268 seconds) |
23:17:28 | * | irrequietus quit () |
23:18:39 | * | boopsies is now known as boopsiesisaway |
23:18:51 | * | brson quit (Quit: leaving) |
23:20:36 | * | filcuc quit (Quit: Konversation terminated!) |
23:20:56 | cncl | i'd have to do it for each entry. but that also doesn't seem to work at all unless i apply it to the whole file |
23:21:13 | cncl | and it's actually a very useful hint/warning in procedure bodies |
23:21:17 | cncl | since it's usually some mistake |
23:22:27 | * | brson joined #nim |
23:24:17 | cncl | hmm |
23:24:27 | cncl | where is `mod` for unsigned integers? i can't find it |
23:32:41 | cncl | i see that there's %%, which works on signed integers, but i have 2 uint64 that i need to use mod on (for a C API) |
23:34:36 | krux02 | how can I import osproc in a nimble file? I would like to create a task that executes some stuff for me |
23:37:12 | cncl | you probably want a .nims file, right? |
23:38:33 | cncl | i'm not sure if you can use osproc in nimscript, though |
23:39:17 | cncl | if i was doing something complicated enough to require async os processes, i probably would just do my own little build system for it instead of using only nimble |
23:42:39 | Araq | krux02: you can only use ospaths with nimscript |
23:42:54 | * | aziz quit (Remote host closed the connection) |
23:46:05 | krux02 | Araq: the thing is, I would like to write a nim wrapper for a c api, and I would like to download the dependency in the build process |
23:47:06 | Araq | that's not a good idea. |
23:47:40 | Araq | that's Nimble's business. and internet connections are fragile beasts. |
23:49:52 | krux02 | ok then I will look for examples of c wrappers |
23:50:24 | krux02 | if you can give me a one sentence guidance I would be happy |
23:50:28 | Araq | btw you can exec curl or something via nimscript |
23:51:17 | Araq | usually C wrappers don't have deps to C code, but to DLLs |
23:51:34 | Araq | and you need to distribute the DLLs somehow. |
23:52:33 | * | gokr quit (Ping timeout: 240 seconds) |
23:52:44 | Araq | but you MUST NOT put binary files in github repositories so instead you should put the generated assembler code in there. this way 'git diff' continues to work ... nah, just kidding. |
23:58:48 | * | brson quit (Quit: leaving) |
23:59:13 | * | brson joined #nim |