00:00:14 | cheatfate | dom96, because of your `comments` under my PRs |
00:00:42 | mahasamoot | newby question hear. 1) array length needs to be know at compile time? 2) How do declare an array (or seq) of seqs of type char? |
00:01:40 | * | gokr quit (Ping timeout: 264 seconds) |
00:04:41 | dom96 | cheatfate: I'm sorry if I came across in that way. I most certainly don't hate you, I just like to be frank in PRs and your PRs tend to change a lot of things. |
00:04:42 | renesac_ | mahasamoot: : (1) yes, if you need dynamic size use a seq |
00:05:22 | renesac_ | (2) normally |
00:06:08 | renesac_ | seq[seq[char]] |
00:06:14 | renesac_ | though you might want to use a string |
00:06:18 | * | Joey__ quit (Quit: Page closed) |
00:07:38 | mahasamoot | var chains = seq[seq[char]] |
00:07:57 | * | mcc joined #nim |
00:09:11 | renesac_ | var chains = newSeq[seq[char]]() |
00:10:06 | mahasamoot | thanks! |
00:13:14 | dom96 | good night |
00:21:24 | * | mahasamoot quit (Ping timeout: 276 seconds) |
00:22:21 | * | yglukhov joined #nim |
00:24:15 | * | deavmi_mobile joined #nim |
00:26:31 | * | yglukhov quit (Ping timeout: 240 seconds) |
00:31:32 | cheatfate | dom96, you made a great work on async core, but progress is based on changes, so you just need to accept it... |
00:38:27 | * | arnetheduck quit (Ping timeout: 246 seconds) |
00:39:26 | mcc | No reverse() for seqs/arrays in the nim standard library, right? |
00:58:04 | * | GangstaCat joined #nim |
01:01:19 | * | mahasamoot joined #nim |
01:16:11 | * | vegansk quit (Ping timeout: 240 seconds) |
01:25:59 | * | vegansk joined #nim |
01:27:30 | * | sdw quit (Ping timeout: 244 seconds) |
01:46:31 | mahasamoot | let states = set[var c: char for c in var s string for s in chains] |
01:46:53 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
01:47:55 | mahasamoot | ? |
01:48:05 | mahasamoot | what am I doing wrong? |
01:48:20 | * | bjz joined #nim |
01:49:27 | kier | mahasamoot: https://gist.github.com/kierdavis/bd0e7604f57db0e9166834ec7e4d7113 |
01:49:32 | kier | is that what you're attempting to do? |
01:50:23 | mahasamoot | yes |
01:50:55 | * | chemist69_ joined #nim |
01:51:22 | mahasamoot | that can't be done as a one liner? |
01:51:57 | * | akaisora_ joined #nim |
01:52:25 | kier | might be able to squish the loop onto one line, not sure if its valid to do that |
01:52:45 | kier | better to be explicit with that you're doing IMO |
01:54:12 | mahasamoot | kool, thanks! |
01:54:30 | * | chemist69 quit (Ping timeout: 272 seconds) |
01:54:41 | vktec | Is there any way to have types that contain themselves? I'd like to create a type that can contain another instance of that type, or nil if it's the end of the "tree" |
01:55:18 | vktec | Oh, hang on, fixed it :) |
01:55:47 | vktec | I was supposed to use seq[Type] anyway, and that worked without errors |
01:59:40 | vktec | Does Nim provide a way to pass around procs as values? |
01:59:52 | vktec | (ie. pass a proc to another proc) |
02:01:07 | mcc | vktec: yes, see "procedural type" in the manual |
02:01:32 | mcc | also, i think the reason it was not allowing you to have types that contain types is you should have been using "ref object" and not "object" |
02:02:37 | mcc | a self-referential object is like struct X { X x; } and a self-referential ref object is like struct X { X *x; }, if you're familiar with C. |
02:08:36 | * | akaisora_ quit (Remote host closed the connection) |
02:09:52 | * | mahasamoot quit (Ping timeout: 244 seconds) |
02:14:21 | Demos | struct X { X x } is gunna be a bad time |
02:18:05 | * | GangstaCat quit (Ping timeout: 260 seconds) |
02:23:30 | * | freezerburnV quit (Ping timeout: 250 seconds) |
02:25:19 | * | yglukhov joined #nim |
02:26:47 | * | branduardi_ joined #nim |
02:29:34 | * | yglukhov quit (Ping timeout: 250 seconds) |
02:29:47 | vktec | mcc: Thanks, procedural types should do exactly what I need |
02:29:59 | * | GangstaCat joined #nim |
02:30:33 | vktec | Another question: is there a way to use a keyword ("block" in this case) as a property name (is that what it's called?) for a type? |
02:31:04 | * | hendi quit (Ping timeout: 264 seconds) |
02:38:36 | Demos | backticks |
02:38:42 | Demos | `block` : int |
02:38:47 | Demos | or w/e |
02:39:16 | Demos | cheers |
02:40:45 | mcc | does nim have a specific piece of terminology for non-ref types |
02:40:51 | mcc | i keep saying "non-ref types" and it is awkward |
02:43:43 | Demos | I use value type |
02:43:48 | Demos | myself |
02:43:51 | Demos | or just type |
02:44:03 | Demos | we used to name types TThing for value types |
02:44:06 | Demos | and PThing for refs |
02:44:37 | Demos | I actually don't use ref types that often in my code (unless I'm making lots of trees I find I don't need them that often |
02:45:54 | mcc | ok |
02:46:34 | mcc | i'm finding myself using ref types because polymorphism has some issues with value types |
02:51:03 | * | Demos quit (Read error: Connection reset by peer) |
02:53:34 | * | Demos joined #nim |
03:10:10 | mcc | ...huh |
03:10:36 | mcc | does nim math not have a fabs/abs function? |
03:42:10 | * | bjz_ joined #nim |
03:43:26 | * | bjz quit (Ping timeout: 272 seconds) |
03:43:53 | * | francisl joined #nim |
03:58:06 | * | Demos quit (Read error: Connection reset by peer) |
04:02:44 | * | Demos joined #nim |
04:03:13 | Demos | yo mcc, I'm pretty sure there is an abs function |
04:03:17 | Demos | it my be in system though |
04:03:45 | Demos | (lots of things are in system, but they are slowly moving to their proper modules |
04:07:03 | * | GangstaCat quit (Quit: Leaving) |
04:17:54 | * | edub4rt quit (Ping timeout: 250 seconds) |
04:26:59 | * | Demon_Fox joined #nim |
04:27:30 | * | yglukhov joined #nim |
04:31:37 | * | yglukhov quit (Ping timeout: 244 seconds) |
04:57:33 | * | brson joined #nim |
05:04:10 | * | Demos quit (Read error: Connection reset by peer) |
05:04:13 | * | francisl quit (Quit: francisl) |
05:19:03 | * | brson quit (Ping timeout: 240 seconds) |
05:27:02 | * | brson joined #nim |
05:32:22 | * | chrisheller quit (Remote host closed the connection) |
05:34:16 | * | brson quit (Ping timeout: 272 seconds) |
05:46:39 | * | mcc quit (Quit: Connection closed for inactivity) |
05:57:31 | * | yglukhov joined #nim |
06:00:26 | * | endragor joined #nim |
06:01:51 | * | yglukhov quit (Ping timeout: 246 seconds) |
06:02:15 | * | Demon_Fox quit (Remote host closed the connection) |
06:06:27 | * | brson joined #nim |
06:09:54 | * | chrisheller joined #nim |
06:20:55 | * | s4 joined #nim |
06:26:08 | * | endragor_ joined #nim |
06:30:05 | * | endragor quit (Ping timeout: 260 seconds) |
06:32:42 | * | endragor_ quit (Remote host closed the connection) |
06:34:19 | * | vendethiel quit (Quit: q+) |
06:35:06 | * | endragor joined #nim |
06:55:44 | * | endragor quit (Remote host closed the connection) |
06:56:56 | * | tankfeeder joined #nim |
07:08:24 | * | endragor joined #nim |
07:09:16 | * | yglukhov joined #nim |
07:12:25 | * | chrisheller quit (Ping timeout: 252 seconds) |
07:14:19 | * | endragor quit (Remote host closed the connection) |
07:14:48 | * | endragor joined #nim |
07:17:55 | * | chrisheller joined #nim |
07:20:55 | skrzyp | Is CLang stable enough to use with Nim? |
07:22:01 | tankfeeder | clang itself or integration? |
07:22:17 | skrzyp | integration, mostly |
07:22:27 | skrzyp | but clang itself too, I have zero experience with llvm |
07:25:13 | * | endragor quit (Remote host closed the connection) |
07:26:08 | * | gokr joined #nim |
07:28:23 | tankfeeder | wrong question, are care about nonsense |
07:30:34 | * | chrisheller quit (Ping timeout: 252 seconds) |
07:33:09 | gokr | vktec: You solved it through other means but IIRC you can have cycles in types if they are in the same type section. |
07:38:19 | * | PMunch joined #nim |
07:40:04 | skrzyp | dom96: take a look at this |
07:40:06 | skrzyp | Error: execution of an external compiler program 'clang -c -w -pthread -O3 -I/home/skrzyp/src/lang/nim/nim/lib -o /tmp/nimble_85185/githubcom_ |
07:40:08 | skrzyp | nimlangAporia/nimcache/stdlib_system.o /tmp/nimble_85185/githubcom_nimlangAporia/nimcache/stdlib_system.c' failed with exit code: 256 |
07:40:10 | skrzyp | /tmp/nimble_85185/githubcom_nimlangAporia/nimcache/aporia_settings.c:185:1: error: unknown type name 'pthread_t' |
07:40:12 | skrzyp | the same issue as with GCC |
07:44:13 | tankfeeder | this is the different story, open issue then |
07:52:50 | * | deavmi_mobile quit (Ping timeout: 250 seconds) |
07:54:06 | * | endragor joined #nim |
08:02:44 | * | Demon_Fox joined #nim |
08:04:36 | * | Arrrr joined #nim |
08:05:56 | * | euant joined #nim |
08:21:01 | * | NhanH quit (Ping timeout: 244 seconds) |
08:21:08 | def- | skrzyp: sounds like you should compile with --threads:on |
08:21:20 | def- | skrzyp: which the nim compiler should tell you of course |
08:22:13 | * | Trustable joined #nim |
08:23:35 | * | NhanH joined #nim |
08:23:36 | * | federico3 quit (Ping timeout: 244 seconds) |
08:43:02 | * | NimBot joined #nim |
08:43:03 | * | M-Flox joined #nim |
08:43:04 | * | joebo quit (Ping timeout: 246 seconds) |
08:43:06 | * | cjh`_ quit (Remote host closed the connection) |
08:43:06 | * | cjh` joined #nim |
08:43:06 | * | skrzyp1 is now known as skrzyp |
08:43:08 | * | g00 joined #nim |
08:43:10 | * | Arrrr quit (Ping timeout: 252 seconds) |
08:43:10 | * | Amrykid2 quit (Ping timeout: 252 seconds) |
08:44:08 | * | joebo joined #nim |
08:51:03 | * | federico3 joined #nim |
08:53:34 | * | Arrrr joined #nim |
08:53:34 | * | Arrrr quit (Changing host) |
08:53:34 | * | Arrrr joined #nim |
08:56:42 | * | tankfeeder quit (Quit: Leaving) |
09:01:06 | * | abbat joined #nim |
09:07:43 | * | elrood joined #nim |
09:13:10 | * | tankfeeder joined #nim |
09:17:12 | foosball | pssst, our Araq has a birthday today! :) |
09:19:40 | * | nicanaca0 wishes Araq a happy birthday! |
09:20:03 | Arrrr | I read somewhere that nim tables are very efficient for a small key count. If this is true, around how many of them ? |
09:20:29 | Arrrr | (I believe it was in that benchmark repo) |
09:21:12 | * | PMunch starts singing happy birthday to Araq |
09:21:14 | cheatfate | Happy birthday Araq! |
09:23:50 | * | endragor quit (Read error: Connection reset by peer) |
09:23:50 | * | deavmi_mobile joined #nim |
09:24:00 | * | endragor_ joined #nim |
09:25:40 | M-Flox | birthday? today? Araq? is that true? |
09:28:03 | * | deavmi joined #nim |
09:28:16 | * | deavmi_mobile quit (Client Quit) |
09:29:56 | foosball | i don't lie, why should i?! |
09:30:01 | * | deavmi_mobile joined #nim |
09:31:21 | cheatfate | but Araq_ is still sleeping |
09:31:30 | deavmi | ello o// |
10:04:39 | * | abbat quit (Ping timeout: 260 seconds) |
10:06:30 | * | jjido joined #nim |
10:33:02 | Araq_ | hey guys, thanks. |
10:33:15 | Araq_ | yeah it's true, today is my birthday |
10:33:55 | PMunch | Congratulations! |
10:34:53 | flyx | congrats Araq_! |
10:35:22 | deavmi | Araq_: Happy birthday man! :) |
10:37:15 | Araq_ | Arrrr: they are also efficient when you have many many keys |
10:38:19 | Araq_ | thanks again :-) |
10:39:49 | * | Arrrr quit (Ping timeout: 244 seconds) |
10:42:15 | * | taotetek joined #nim |
10:45:54 | M-Flox | Happy Birtday Araq and all the best for the future! |
10:46:07 | vktec | Araq_: Happy birthday! |
10:47:53 | deavmi | Has anyone here compiled Nim successfully on OpenBSD? |
10:53:26 | euant | Happy birthday Araq_ |
10:53:49 | euant | @deavmi: I compiled 0.13.0 on OpenBSD a while back, but only Nim, not Nimble |
10:54:01 | euant | There was also quite a lot of discussion about it here yesterday |
10:54:26 | euant | The current HEAD from GitHub should compile fine |
10:56:40 | cheatfate | Araq_, is there any Travis CI problems? |
10:56:52 | cheatfate | there no more tests for my new PR |
10:57:18 | tankfeeder | i've checked nim tests on openbsd with all malloc guards. passed |
10:57:28 | cheatfate | or maybe because i named it like previous closed |
11:01:06 | cheatfate | Araq_, ping |
11:01:41 | elrood | happy birthday, Araq_ |
11:03:16 | deavmi | euant: Did everything go well? Can I use the script from nim-lang.org/download.html |
11:03:47 | deavmi | euant: *to build Nim on OpenBSD |
11:04:01 | euant | deavmi: It worked fine for me. I followed these instructions: https://github.com/nim-lang/nim#compiling |
11:06:13 | vktec | Can someone help me out with this? https://gist.github.com/vktec/be0b81ee909361d12430f6fb14cb1c9f |
11:07:24 | deavmi | euant: Thanks |
11:23:51 | * | deavmi_mobile quit (Ping timeout: 240 seconds) |
11:26:51 | vktec | So..... any ideas on my issue? |
11:28:40 | PMunch | Hmm, I'm not 100% sure but I don't think you can have a T without defining the type in the call |
11:29:06 | PMunch | I think you might want to look into: nim-lang.org/docs/manual.html#multi-methods |
11:29:24 | vktec | Thanks, I'll take a look |
11:30:05 | PMunch | An option is to return a pointer which you then need to get a value from depending on what type the object has |
11:30:47 | * | namnguyen quit (Ping timeout: 250 seconds) |
11:30:57 | vktec | The aim is to make this proc do that behind the scenes |
11:31:32 | PMunch | What is the end goal? |
11:31:55 | * | chrisheller joined #nim |
11:34:05 | M-Flox | afaik T needs to be passed as a parameter to the call |
11:34:26 | vktec | I'm writing a DSL-ish interpreter, and I need to be able to get the value of a variable from that in Nim, but it should (preferrably) be done through 1 Nim type and 1 method, without having to specify the desired type. |
11:34:39 | vktec | Y'know, now that I say that, it sounds kinda stupid XD |
11:35:09 | vktec | Hmmm... I came up with a better way |
11:35:16 | vktec | Lemme see if this'll work |
11:35:38 | M-Flox | you can probably also use a template for that |
11:36:25 | * | chrisheller quit (Ping timeout: 252 seconds) |
11:38:46 | vktec | I tried using a template... it didn't seem to work either :-/ |
11:40:31 | M-Flox | yea, just tried it |
11:43:18 | * | namnguyen joined #nim |
11:45:24 | * | edub4rt joined #nim |
11:47:05 | * | Arrrr joined #nim |
11:51:25 | * | abbat joined #nim |
11:51:48 | vktec | I'm defining a proc like this: proc value[T](foo: Bar): [T] = |
11:52:02 | vktec | I want to call it like this: value[str](foo) |
11:52:11 | vktec | How can I do that? |
11:52:51 | PMunch | A macro? |
11:53:29 | vktec | Okay.... Wierd though, I've seen that pattern in the standard library... |
11:53:47 | vktec | (https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/sets.nim#L346) |
11:53:47 | PMunch | Oh, then I might be wrong :P |
11:54:09 | vktec | Or at least, a very similar one |
12:01:07 | * | desophos quit (Read error: Connection reset by peer) |
12:04:34 | * | abbat_ joined #nim |
12:04:43 | * | abbat_ quit (Remote host closed the connection) |
12:04:59 | * | abbat_ joined #nim |
12:05:16 | * | abbat quit (Ping timeout: 264 seconds) |
12:05:30 | * | abbat_ quit (Client Quit) |
12:06:44 | * | abbat joined #nim |
12:16:32 | edub4rt | is there a function in nim that does the opposite of addr()? (e.g. takes an address, remove the pointer and cast its to a type) |
12:17:33 | renesac_ | foosball |
12:17:50 | def- | edub4rt: [] |
12:17:51 | renesac_ | oops,nothing |
12:17:58 | renesac_ | sorry |
12:20:47 | edub4rt | odd name, that's why I didn't find easily in the documentation, but worked, thanks |
12:21:09 | renesac_ | well, first, happy birthday Araq_ |
12:21:21 | * | filcuc joined #nim |
12:21:42 | renesac_ | I was looking at nim hash tables, and it seems there are at least 3 essentially identical implementations in the form of: |
12:22:01 | renesac_ | tables/sharedtables, sets and strtabs |
12:23:58 | renesac_ | the tableimpl only shares code with the first two, but could be of use for the other two as well |
12:25:08 | renesac_ | as for the strtabs, wouldn't a distinct type for those style insensitive strings solve the problem better? |
12:25:48 | * | themagician quit (Ping timeout: 246 seconds) |
12:26:29 | * | themagician joined #nim |
12:33:24 | * | themagician quit (Ping timeout: 260 seconds) |
12:36:27 | * | themagician joined #nim |
12:37:15 | * | aziz_ joined #nim |
12:37:29 | * | aziz_ quit (Client Quit) |
12:38:29 | edub4rt | dom96: I have seen in commit history that you worked most on the asyncdispatch, asyncnet module, as I am planning to use it heavily for networking and async tasks in general I wanted to know if there is a roadmap for it somewhere, to fill me in with the current state and future of async stuff in nim |
12:39:12 | edub4rt | cheatfate, maybe you have some thoughts on it too? |
12:40:40 | cheatfate | edub4rt, this is dom96 roadmap https://github.com/nim-lang/Nim/issues/4123 |
12:41:43 | cheatfate | edub4rt, and mine is here https://github.com/nim-lang/Nim/pull/4309 |
12:43:42 | cheatfate | also i think some kind of async pipes also needed |
12:43:55 | cheatfate | but this not from async core |
12:44:02 | edub4rt | cheatfate, that new async core is roughly working already? |
12:44:23 | cheatfate | edub4rt, its already old... |
12:44:34 | cheatfate | it is some patches behind... |
12:45:03 | cheatfate | and mostly it waits for Araq's and dom96 review |
12:46:13 | cheatfate | and I want to take a break from work on asyncdispatch |
12:46:41 | edub4rt | I see, that seems like a lot of rework, might take time than to review and merge then |
12:48:27 | edub4rt | cheatfate, nice job with the other PR that merged today, I'm using already |
12:52:18 | edub4rt | cheatfate, do you have any idea how many request per second can the asynchttpserver handle for a static page? I saw on https://github.com/nim-lang/Nim/issues/3909 that you did some benchmarks |
12:52:54 | cheatfate | edub4rt, all my benchmarks was made in VM |
12:53:03 | edub4rt | cause I want to have an idea of performance comparated to nodejs |
12:53:42 | cheatfate | so they like "synthetic"... i'm using them only for benchmark my improvements |
12:53:50 | cheatfate | new async core is faster like 20% |
12:54:05 | cheatfate | but old one is still fast enough |
12:54:06 | edub4rt | nim seams fast, but working async depends on the asyncdispatch/networking implementation, wich I currently don't know how performant it is |
12:55:30 | edub4rt | hmm, godo to know, but I want to test myself, does nim have any benchmark class? where are the code for your benchmarks? |
12:55:35 | edub4rt | good* |
12:56:57 | cheatfate | edub4rt, i have used wrk |
12:57:09 | cheatfate | https://github.com/wg/wrk |
12:57:13 | cheatfate | but you can use wrk2 |
12:57:34 | cheatfate | https://github.com/giltene/wrk2 |
13:02:43 | dom96 | Wish I had the time to benchmark async properly and optimise it as much as possible. |
13:02:48 | dom96 | Please let us know what you find edub4rt |
13:05:00 | * | tankfeeder quit (Quit: Leaving) |
13:08:23 | * | Demon_Fox quit (Quit: Leaving) |
13:12:03 | * | francisl joined #nim |
13:18:58 | edub4rt | dom96, cheatfate, https://gist.github.com/edubart/02d982eff30400ffa70a737851ed05bf |
13:19:16 | * | abruanese quit (Ping timeout: 252 seconds) |
13:19:52 | dom96 | edub4rt: cool |
13:20:28 | dom96 | edub4rt: now compare against Go :) |
13:20:34 | edub4rt | at first I was disappointed, but then I saw that I compiled nim in debug mode, in release mode nim is 3.2x faster, debug mode slower hehe |
13:21:28 | dom96 | heh yeah, debug vs release mode makes a huge difference |
13:22:13 | def- | edub4rt: i used to have fun with that exact same "Hello World": https://github.com/def-/nim-http-speedup |
13:22:54 | dom96 | oh yeah, forgot about def-'s benchmarks |
13:23:58 | dom96 | Some pretty graphs would help :P |
13:28:44 | edub4rt | def-: so from reading your benchmarks you have found out that with 1 thread, nim's asynchtpp was slower than go/cppsp/h2o |
13:29:04 | edub4rt | but that 1 year ago, from that date was made optimizations? |
13:29:19 | def- | edub4rt: some of my optimizations made it into nim |
13:29:36 | def- | edub4rt: and the plan is to allow multithreading for async from what I understand |
13:46:05 | * | mahasamoot joined #nim |
13:47:06 | * | nsf quit (Quit: WeeChat 1.4) |
13:50:54 | mahasamoot | I'm looking through the docs... In Python the docs will tell you all the methods for each data type. I'm not really seeing that for Nim. So for example in python, list.count(x), does seq.count(x) work in Nim? |
13:52:47 | Araq_ | http://nim-lang.org/docs/theindex.html#oun |
13:53:44 | * | freezerburnV joined #nim |
13:54:08 | Araq_ | so, apparently not. |
13:55:02 | Araq_ | not sure why sequtils is missing a count though. |
13:56:28 | mahasamoot | thanks |
13:56:39 | Araq_ | that said, I type foo <dot> and see what's available, no need to read docs. |
13:56:47 | dom96 | looks like the #anchors are wrong for the index |
13:57:17 | Araq_ | indeed |
13:57:42 | dom96 | We need Noogle ala hoogle (https://www.haskell.org/hoogle/) |
13:57:45 | mahasamoot | Araq_: What do you use? I set up vim to do that but it's not working. |
13:58:07 | * | freezerburnV quit (Ping timeout: 250 seconds) |
13:58:27 | Araq_ | mahasamoot: I've heard good things about VSCode |
13:59:47 | edub4rt | def-,dom96: I tested asynchttpserver vs go (with 1 thread), nim outperforms go, I managed to get 100k/s in nim while 55k/s in go, however go with all os threads (4 threads) goes up to 200k/s |
13:59:56 | Araq_ | dom96: better docs, hoogle, etc are all fine things, but we need to focus, and my focus is clearly on improving nimsuggest. |
14:00:10 | dom96 | edub4rt: wow, awesome |
14:00:19 | edub4rt | def-: I could not test asynchttpserver in parallel, seams like your asynchttpserver sample does not work anymore, there is no function serveParallel |
14:01:19 | def- | edub4rt: i hacked that in |
14:01:48 | mahasamoot | Araq_: thanks! It looks really nice. I'll give it a try. |
14:02:07 | edub4rt | I managed to get from 84k/s to 100k/s in nim by running with "nim -d:release c -r --passC:"-flto -O4" --gc:boehm hello.nim" |
14:02:35 | Araq_ | boehm does cheat though and does the marking step in parallel |
14:02:45 | edub4rt | gc boehm does make a difference, linking with flto a bit |
14:03:03 | def- | Araq_: nope, i tested and boehm is about same speed for this benchmark withough threads |
14:03:52 | edub4rt | is there any other optimization hack while compiling that I should know off? any flag? |
14:04:44 | * | Demon_Fox joined #nim |
14:05:56 | * | s4 quit (Quit: Konversation terminated!) |
14:08:12 | * | brson quit (Ping timeout: 276 seconds) |
14:12:31 | * | brson joined #nim |
14:12:44 | * | freezerburnV joined #nim |
14:19:16 | euant | I'd love to see search added to the docs. Google can be a little hit and miss |
14:19:33 | * | PMunch quit (Quit: leaving) |
14:20:06 | euant | I'd also like to see something like readthedocs for Nim too |
14:20:48 | * | pregressive joined #nim |
14:20:58 | euant | I started writing something like it, I might eventually finish |
14:21:28 | deavmi | euant: Mkdocs has static search |
14:21:47 | deavmi | euant: But i like the current nim docs. just add search and then it will be awesome |
14:22:14 | euant | Yeah, mkdocs looks nice |
14:22:32 | euant | I like the style of the current docs, could just do with some added consistency between modules |
14:22:42 | deavmi | euant: Obviously maybe theme it differently. Like |
14:23:04 | deavmi | euant: I like the somber colours of the Nim docs |
14:23:13 | euant | By readthedocs, I meant some kind of site where users can have docs generated for their modules automatically upon Git Push (using GitHub hook) |
14:28:56 | edub4rt | having nim docs into http://devdocs.io/ would be nice too, their search is really straightforward, and combining multiple frameworks/languages into one is a plus |
14:38:46 | lazypenguin1 | Only complaint I have about the docs is that the menu on the left is not in a seperate frame from the content on the right |
14:39:48 | lazypenguin1 | would prefer to scroll them independently |
14:43:05 | * | euant quit (Quit: Leaving) |
14:44:04 | lazypenguin1 | e.g. http://imgur.com/ubZp4gL but have the menu on the left scroll with the screen |
14:48:03 | * | renesac_ quit (Read error: Connection reset by peer) |
14:49:08 | cheatfate | def-, you dont need multithreaded asyncdispatch to make multithreaded web server :) |
14:49:55 | cheatfate | You need to run 1 thread with own pDispatcher for accepting connections and pass accepted sockets to worker threads which of course has own pDispatcher... |
15:08:16 | * | akaisora_ joined #nim |
15:15:24 | * | polypus74 joined #nim |
15:17:50 | polypus74 | hi all. i'm considering nim as a language for x-platform game dev (commercial), most important are ios, android, and linux. macos and windows would be a bonus. how are the sdl bindings? i see there is an official repo: https://github.com/nim-lang/sdl2 ? |
15:18:36 | polypus74 | any other workable solutions apart from sdl? |
15:20:33 | namnguyen | polypus74, Araq is working on a binding for some 3D engine that I forgot the name. |
15:23:59 | polypus74 | how is nim on android and ios these days in general? namguyen: ty |
15:24:40 | polypus74 | googling doesn't pick up much |
15:25:09 | * | polypus74 quit (Remote host closed the connection) |
15:25:53 | namnguyen | polypus74, afaik, you'll transpile to C/C++ files, compile them into a dynamic library, then do a thin wrapper with Obj-C/Java |
15:25:57 | * | polypus74 joined #nim |
15:26:02 | namnguyen | polypus74, afaik, you'll transpile to C/C++ files, compile them into a dynamic library, then do a thin wrapper with Obj-C/Java |
15:28:41 | polypus74 | that would be the ideal, but does it actually work? are there issues with the runtime etc? |
15:29:22 | namnguyen | well, once the Nim-C/C++ conversion is done, there's not much else wrt Nim |
15:29:51 | polypus74 | there's no latform specific runtime stuff? |
15:29:57 | polypus74 | *platform* |
15:30:30 | namnguyen | i have not known of any Android/iOS runtime stuff in Nim |
15:30:30 | polypus74 | ty btw |
15:31:54 | * | polypus joined #nim |
15:34:37 | * | deavmi_mobile joined #nim |
15:35:16 | endragor_ | both Android and iOS support apps developed on C++ |
15:38:35 | polypus74 | i'd rather use nim or even C. i'm also looking into scheme. just to be clear, i know you can compile and link to C on android and iOS, i'm just wondering if anybody has actually succesfully done so transpiling to C with nim |
15:39:00 | * | abbat left #nim ("Leaving") |
15:39:24 | endragor_ | Nim compiles to C or C++ |
15:39:41 | endragor_ | C is the default backend |
15:39:58 | Araq_ | polypus74: yglukhov at least does commercial game development with Nim |
15:40:19 | Araq_ | using the C, JS backends and more recently emscripten |
15:40:34 | Araq_ | not sure how they handle Android though |
15:40:36 | endragor_ | so do we, using Unreal Engine 4 |
15:40:41 | dom96 | polypus74: I was able to get Nim code running in an Android app. |
15:40:56 | yglukhov | Araq_: android is fine, as well as ios =) |
15:41:06 | dom96 | Also objective C integration works well, for example: https://github.com/dom96/notifications |
15:41:39 | polypus74 | very good to hear guys. ty |
15:42:12 | edub4rt | afaik where you can use C, you can use nim, if nim does not have the API you need but C does, you can bind the C functions you need with ease |
15:42:17 | yglukhov | Araq_: so i've found a way to do transparent emscripten-js bindings, so that you can basically define dom module to be emscripten-compatible. |
15:43:58 | yglukhov | Araq_: the way is kinda jnim-ish for emscripten. And it opens unseen possibilities to write emscripten frontends in nim. |
15:44:57 | Araq_ | btw https://www.stevefenton.co.uk/2012/11/compiling-vs-transpiling/ suggests that Nim *compiles* to C :P |
15:45:50 | Araq_ | C lacks exceptions, garbage collection, first class iterators and so Nim and C don't operate on a "similar" level of abstraction |
15:46:04 | Araq_ | so Nim is a compiler, not a transpiler. |
15:47:32 | * | jjido quit (Read error: Connection reset by peer) |
15:48:42 | elrood | otoh he considers c++ to c transpilation, so.. where's our troll when we need him? *fg |
15:48:45 | namnguyen | my definition of a transpiler is from a high-level language to yet another high-level language. |
15:49:03 | Araq_ | C is not a high level language :P |
15:49:17 | elrood | and c++ isn't either? ;P |
15:49:19 | polypus74 | if it's source to source i think it can reasonably be called a transpiler, regardless of level of abstraction. of course whenever you start talking about compilers/transpiler/interpreters the lines are fuzzy and people have different opinions. i don't think it's too important. maybe we should just call them all transformers |
15:49:34 | lazypenguin1 | I'm sure for the more seasoned programmers C is pretty high level :) |
15:49:36 | polypus74 | C used to be a high level language not too many years ago |
15:49:38 | namnguyen | Prime Optimus |
15:49:52 | Araq_ | actually I agree, but you cannot have it both ways. Either C is a superduper portable assembler |
15:50:04 | Araq_ | or it's high level. |
15:50:10 | namnguyen | a high level language is something natural-language-like |
15:50:46 | deavmi_mobile | I think high levelness over time switches |
15:50:56 | deavmi_mobile | from lang to lang. depends on what we are used to. |
15:50:59 | Araq_ | so yeah, C is a nice portable assembler (that's why GCC is 2 million lines of code or something, because it's so close to the hardware lol) |
15:50:59 | lazypenguin1 | Just because C is high level, doesn't mean you can't have higher languages |
15:51:21 | deavmi_mobile | maybe a language more easier than python will come out on a few years and will make python no longer high level. |
15:51:25 | Araq_ | and Nim is just a translator from Nim to C, quite easy to do and that's why it's 80K LOC ... |
15:51:28 | namnguyen | agreed. very high, super high, uber high, |
15:52:31 | lazypenguin1 | Don't think you can call it a translator if there is not a 1:1 mapping |
15:52:48 | lazypenguin1 | Nim introduces new abstractions which need to be compiled into C |
15:53:42 | elrood | Araq_, ah, come on, don't sell yourself short. nim is a great piece of work as it is, and it being just a translator is an intermediate solution - and a clever one |
15:54:09 | lazypenguin1 | By that logic a C compiler only translates C into machine language |
15:54:17 | lazypenguin1 | how easy |
15:54:30 | lazypenguin1 | /s |
15:54:55 | Araq_ | elrood: I'm not selling myself short, I'm trying to convince people the only term for it that makes sense is "compiler" |
15:55:31 | edub4rt | Araq_: why nim doesn't use a backend like LLVM/gcc instead of compiling to C and then compiling again to machine code? let's say if you started to develop nim today, would you do the same way or use some backend like LLVM/gcc? |
15:55:49 | elrood | to be frank, whether one prefers to call it compiler or transpiler or whatever is just nitpicking and an implementation detail |
15:55:59 | Araq_ | 1. an LLVM backend is being worked on. |
15:56:11 | Araq_ | (not by me though) |
15:56:26 | Araq_ | 2. I would likely target C again. |
15:56:38 | elrood | nim is more, docs, spec, tooling, and once more backends are in place and the ties to C(++) aren't as close as they are today that will become irrelevant |
15:57:11 | Araq_ | the advantages outweight the disadvantages |
15:57:34 | Araq_ | elrood: yes, but "transpiler" is such an ugly word IMO |
15:57:41 | namnguyen | elrood, why should it target a machine language? |
15:57:48 | namnguyen | serious question. |
15:57:58 | Araq_ | "translator", "interpreter", "compiler" all fine terms, but what the heck is a "transpiler"? |
15:58:10 | Araq_ | ;-) |
15:58:21 | polypus74 | a compiler w/ a sex change :) |
15:58:50 | namnguyen | Pride month, Pride month |
15:59:36 | namnguyen | elrood, targetting a machine language is fine and all, but you'll be on the hooks for all these peep-hole optimizations etc. |
15:59:54 | elrood | Araq_, agreed. but it's not mainly about wording but about expressing a viewpoint, semantics |
16:02:02 | elrood | namnguyen, yep, and now you're entirely dependent on a different compiler toolchain, and a different language. it's an assessment of dis- and advantages. for now using c as an intermediary target is a good, even great choice. might not be for the long run |
16:02:34 | namnguyen | elrood, on an entirely __popular__ toolchain |
16:02:48 | Araq_ | this weekend I will again attempt to compile Nim code for my RCX |
16:03:03 | Araq_ | I have a GCC 2.95 cross compiler that targets it. |
16:03:15 | namnguyen | i mean, i have not seen any CPU that doesn't have a C compiler built for it |
16:03:23 | polypus74 | C as a target is arguably always good to have for any language, unless it has the backing to be targetted to just about everything anyway, the way Go is going |
16:03:28 | elrood | namnguyen, sure, but still a completely detached toolchain |
16:03:38 | Araq_ | this thing is very outdated, you won't find an LLVM backend for it |
16:03:55 | Araq_ | compiling to C is a huge advantage. |
16:03:57 | namnguyen | elrood, which is exactly the same idea why we have frontend and backend in LLVM, GCC, etc. |
16:04:35 | Araq_ | you could perhaps try and re-enable the codegen for a newer GCC |
16:04:52 | elrood | namnguyen, i don't know what you are trying to convince me of. i am all for nim as it is now. i don't see it staying that way for all future, though |
16:05:29 | Araq_ | but GCC's internals changed much more than the C language, especially when the C is generated anyway |
16:05:34 | namnguyen | elrood, i'm trying to understand your reasoning for why Nim should have a machine-code backend. |
16:05:45 | polypus74 | no reason to loose the C target. haskell ghc has let it's c backend rot. that's why i'm here looking at nim |
16:05:50 | Araq_ | so yeah, generating C was a wise decision. |
16:06:05 | elrood | it's a great thing nim has a js backend, and even better that an llvm-based one is in the works. it will and does help keeping the compiler's design modular and extensible |
16:08:14 | * | brson quit (Ping timeout: 272 seconds) |
16:08:16 | polypus74 | namguyen: the more backends the better ;) |
16:08:31 | namnguyen | polypus74, the more stuffs need to be maintained too. |
16:09:11 | polypus74 | yes, but like i said if the language has the clout, like Go it's OK. i just wish google had picked up nimrod instead |
16:09:26 | elrood | namnguyen, if you read closely, that is not even my reasoning. i do see advantages in having nim not rely on a single independent toolchain, in modularity, etc. ultimately this means generating final code without too many intermediary steps, yes, but that's not the main point |
16:09:58 | elrood | anyways, afk for a while. party hard, Araq_ ;) |
16:11:15 | * | brson joined #nim |
16:13:03 | * | endragor_ quit (Ping timeout: 240 seconds) |
16:18:01 | * | yglukhov quit (Ping timeout: 252 seconds) |
16:22:10 | onionhammer | soo, how about Safe C? : ) |
16:22:14 | onionhammer | http://www.infoworld.com/article/3084424/open-source-tools/microsoft-open-sources-a-safer-version-of-c-language.html |
16:22:19 | onionhammer | as a back end |
16:22:29 | onionhammer | "Checked C" |
16:24:51 | * | deavmi_mobile quit (Quit: Cheers all. Be good and don't do drugs.) |
16:25:19 | * | filcuc quit (Read error: Connection reset by peer) |
16:29:40 | * | chrisheller joined #nim |
16:34:11 | * | endragor joined #nim |
16:34:13 | * | deavmi_mobile joined #nim |
16:34:58 | * | deavmi_mobile quit (Client Quit) |
16:36:04 | * | polypus74 quit (Read error: Connection reset by peer) |
16:36:14 | * | polypus74 joined #nim |
16:48:42 | * | yglukhov joined #nim |
16:51:16 | * | Matthias247 joined #nim |
16:53:05 | * | yglukhov quit (Ping timeout: 260 seconds) |
16:53:11 | * | Arrrr quit (Quit: WeeChat 1.4) |
16:57:44 | * | Demon_Fox quit (Quit: Leaving) |
16:58:01 | * | francisl quit (Quit: francisl) |
17:08:01 | * | jjido joined #nim |
17:11:03 | * | pregressive quit (Remote host closed the connection) |
17:11:36 | * | pregressive joined #nim |
17:15:47 | * | renesac joined #nim |
17:15:57 | * | pregressive quit (Ping timeout: 250 seconds) |
17:19:33 | * | yglukhov joined #nim |
17:20:55 | * | yglukhov quit (Remote host closed the connection) |
17:20:59 | * | aziz joined #nim |
17:28:56 | * | hoaxx joined #nim |
17:28:59 | * | g00 quit (Quit: ZNC - 1.6.0 - http://znc.in) |
17:29:32 | * | hoaxx quit (Client Quit) |
17:32:19 | * | shodan45 joined #nim |
17:32:47 | * | wh1t3r0s3 joined #nim |
17:33:08 | * | euantor joined #nim |
17:34:42 | * | wh1t3r0s3 quit (Client Quit) |
17:35:56 | * | wh1t3r0s3 joined #nim |
17:36:51 | * | jjido quit (Ping timeout: 276 seconds) |
17:39:49 | * | wh1t3r0s3 quit (Client Quit) |
17:40:01 | * | francisl joined #nim |
17:41:34 | * | wh1t3r0s3 joined #nim |
17:45:26 | * | yglukhov joined #nim |
17:48:39 | * | branduardi_ quit (Ping timeout: 250 seconds) |
17:48:56 | * | yglukhov quit (Remote host closed the connection) |
17:49:11 | * | yglukhov joined #nim |
17:52:39 | yglukhov | Araq_: is it hard to implement some thisProc(), returning ast of the proc, so that we could refer arguments by index? =) |
17:53:22 | yglukhov | and also get _PRETTY_FUNCTION_ stuff for logging, etc. |
17:53:42 | Araq_ | meh, seems easy but really horrible |
17:54:21 | Araq_ | the first thing people will do is write macros that only work in a particular invocation context |
17:54:22 | yglukhov | referring to args by index and _PRETTY_FUNCTION_ are good for metaprogramming |
17:54:48 | * | deavmi_mobile joined #nim |
17:54:48 | yglukhov | don't worry about that. it already is the case =) |
17:55:13 | Araq_ | how so? |
17:56:04 | yglukhov | well, it's easy if you don't validate macros input parameters, because pretty much anything could get there =) |
17:57:23 | Araq_ | it's a design pattern to not valid input parameters |
17:57:27 | Araq_ | *validate |
17:57:39 | Araq_ | but I need to write a book about it :P |
17:57:52 | yglukhov | yup =) |
17:58:10 | * | vqrs quit (Quit: ZNC 1.6.1 - http://znc.in) |
17:58:32 | Araq_ | I have a 'treegen' module in the works, that takes anything and turns it into a tree |
17:58:50 | Araq_ | works for any UI library and to produce DOMs |
17:59:02 | yglukhov | interesting... |
17:59:47 | Araq_ | yeah, it's cool. it requires the trees to have some 'add' operation |
18:00:03 | Araq_ | it doesn't check its input and so it's type agnostic |
18:00:12 | Araq_ | but I guess 'concept' would work too here. |
18:00:56 | Araq_ | but seriously. one design constraint in Nim is that macros cannot go "up" in the AST |
18:01:04 | Araq_ | so that when I read |
18:01:07 | Araq_ | foobar: |
18:01:11 | Araq_ | baz blah |
18:01:27 | Araq_ | I know at least not my entire proc is affected by the 'foobar' macro |
18:02:35 | yglukhov | i agree they probably should not modify it. but why not read? they already can do it to some extent with getImpl/getType. and as you have seen, we have a compile time nim->glsl codegen thanks to that. |
18:03:44 | yglukhov | and with args_referred_by_index i predict it would be a lot simpler to write automagic bridges to foreign languages. |
18:04:44 | yglukhov | that's not really THAT critical for bridges, because they also could be done with current macro system, like jnim. |
18:06:01 | yglukhov | maybe another way is to add more standard macro api to simplify work with ast. like collectArgNamesFromFunctionDefinition, collectArgTypesFromFunctionDefinition, applyFunctionCallToArgs, etc. |
18:06:30 | yglukhov | but _PRETTY_FUNCTION_ is still something i want ;) |
18:06:37 | * | Matthias247 quit (Read error: Connection reset by peer) |
18:07:15 | * | kingofoz quit (Ping timeout: 244 seconds) |
18:08:18 | * | kingofoz joined #nim |
18:09:26 | * | francisl quit (Read error: No route to host) |
18:10:24 | yglukhov | Araq_, and another question. What do you say if we introduce a smarter js bridging api to enable out-of-the-box emscripten compatibility. E.g. currently js functions are marked .ccpimport.. I can do a lib with .jsimport. macro that expands to .cppimport. for js target, and to something more interesting on emscripten target. |
18:10:48 | * | Demos joined #nim |
18:11:43 | * | francisl joined #nim |
18:11:49 | deavmi_mobile | do macros start with . |
18:11:52 | deavmi_mobile | in nim? |
18:12:41 | Demos | no |
18:12:49 | Demos | they work almost like any other procedure |
18:12:59 | Demos | except you can call them with a few special syntaxes |
18:13:17 | Demos | notably the {.macroName.} annotation and the macro: block syntax |
18:14:04 | yglukhov | deavmi_mobile, yeah, i was talking about the pseudo-pragma macro syntax. {.jsimport.} |
18:14:11 | * | euantor quit (Remote host closed the connection) |
18:14:21 | deavmi_mobile | are they also contained in {} |
18:14:22 | deavmi_mobile | ? |
18:14:44 | deavmi_mobile | I see |
18:14:51 | deavmi_mobile | I will check out macros soon |
18:15:16 | Demos | imo the macros are a very interesting feature of nim, but they are not what really draws me to the language |
18:15:55 | * | nsf joined #nim |
18:15:59 | yglukhov | pragmas are enclosed in {. and .} and you can use a macro name instead of a pragma name, so that it is evalueated with arg being ast of the definition being annotated =) |
18:16:51 | * | euantor joined #nim |
18:17:23 | * | philo joined #nim |
18:17:38 | yglukhov | Demos: true, nim has got a lot of outstanding traits besides macros. |
18:17:56 | Araq_ | yglukhov: sorry i am busy, will answer soon |
18:18:18 | Demos | tbh I got here just looking for C with modues |
18:18:20 | Demos | *modules |
18:18:47 | Demos | which like holy crap ISO WG14, it's getting pretty sad |
18:19:52 | * | euantor quit (Remote host closed the connection) |
18:23:24 | * | euantor joined #nim |
18:24:18 | * | brson quit (Ping timeout: 276 seconds) |
18:25:37 | dyce_ | did .14 have GC improvements? |
18:25:44 | dom96 | yep |
18:26:09 | dyce_ | dom96: so jester hello word shouldnt go above 1MB or so? |
18:26:23 | dyce_ | after answering many requests |
18:26:35 | dyce_ | for mem usage |
18:26:42 | dom96 | Dunno. How far above does it go? |
18:26:48 | dyce_ | 3MB |
18:26:56 | dyce_ | at least with .13 |
18:27:07 | Araq_ | cycle collector kicks in after 4MB |
18:27:27 | philo | Newbie question. http://pastebin.com/BUFjMsfV |
18:27:51 | philo | not sure how to say it in Nim |
18:28:32 | def- | philo: what are you trying to do? |
18:29:50 | philo | I'm to add new tuples into a seq |
18:30:28 | philo | type mismatch: got (seq[Transition], Array constructor[0..1, s33,15 |
18:30:54 | def- | what is transitions? |
18:30:56 | def- | it's undefined |
18:31:12 | philo | type |
18:31:12 | philo | Transition = tuple[trans: string, count: int] |
18:31:26 | def- | That's "Transition", not "transitions" |
18:31:58 | philo | sorry, it's seq[string] |
18:32:16 | def- | line 8: for c in transCounts.mitems: |
18:32:32 | def- | line 12: transCounts.add((t,1)) |
18:34:45 | philo | thanks! why do I need the .mitems? |
18:34:54 | * | vqrs joined #nim |
18:34:59 | def- | otherwise you get unmodifiable items in the loop, like when you define them with "let" |
18:35:17 | def- | the mitems iterator has a "var" return type |
18:35:30 | def- | so it yields values that you can modify directly |
18:35:42 | philo | oh, that makes sense. |
18:35:42 | def- | that's useful to specify whether your loop should modify anything and then the compiler checks it |
18:37:13 | * | Yousif joined #nim |
18:37:53 | Yousif | Why did you blocked me?! |
18:38:23 | Yousif | Ohh, sorry, I thought you stopped my message service. |
18:39:08 | Yousif | So, my question is, if I compile to C, can I use Qt GUI libraries? |
18:39:34 | dom96 | Hrm. You will need to compile to C++ then. |
18:39:36 | * | jjido joined #nim |
18:39:51 | Yousif | dom96: That is the problem. |
18:40:07 | Yousif | I don't want to compile to C++. |
18:41:33 | dom96 | Why? |
18:41:36 | Yousif | I want to use Qt instead of GTK+, So is there any chance at all? |
18:42:34 | Yousif | dom96: Because Qt is MUCH BETTER than GTK+, because the entire world is switching to Qt EVEN GNOME!. |
18:42:52 | dom96 | No, why do you not want to compile to C++? |
18:43:40 | Yousif | dom96: Nim to C is better than Nim to C++. |
18:44:03 | dom96 | Yousif: how so? |
18:44:28 | Yousif | dom96: I asked this to Mr. Araq. |
18:44:32 | Yousif | He recommends C. |
18:44:38 | dom96 | Yousif: I see. I see. |
18:45:25 | * | Yousif left #nim (#nim) |
18:45:42 | * | jjido quit (Read error: Connection reset by peer) |
18:46:34 | shodan45 | IIRC PyQt hooks into Qt via C, not C++, so it should be possible |
18:47:14 | shodan45 | oh he left |
18:47:54 | shodan45 | I'd also love to see NimQt (QtNim?), especially if it was idiomatic Nim |
18:48:15 | shodan45 | Qt is very nice, but it's also very C++ ;) |
18:48:23 | shodan45 | well, C++ + moc |
18:49:30 | philo | I'm sorry to be such a bother, but something's still wrong. code: http://pastebin.com/JaqCzjTP output: http://pastebin.com/p5a9TCgr |
18:49:33 | dyce_ | Araq_: that makes sense, i saw it cut off around 4MB. is there a way to adjust this for embedded devices with around 16mb ram? |
18:49:43 | philo | transCounts is empty |
18:50:00 | dyce_ | or i assume there is some overhead for cpu to have it any lower? |
18:50:43 | * | francisl quit (Quit: francisl) |
18:50:53 | * | jjido joined #nim |
18:51:11 | def- | philo: no problem at all, we're here to help. is transitions empty as well? What should I enter to test it? |
18:51:30 | def- | ah, you have something |
18:52:16 | def- | philo: that's because transCounts is empty from the start, so line 27 never iterates over anything |
18:52:18 | philo | yeah, transitions is working, then nil |
18:52:38 | def- | something looks wrong with your algorithm |
19:00:03 | Araq_ | dyce_: it's a constant in the GC, but currently not exposed in any way |
19:00:11 | Araq_ | PRs welcome |
19:00:49 | Demos | hey everybody |
19:00:53 | Demos | there is NimQML |
19:00:57 | Demos | which works pretty well |
19:02:48 | Araq_ | yglukhov: instantiationInfo will get "instantiated from proc" info |
19:03:00 | edub4rt | I have a question about the GC, lets suppose I have 1 million small different objects, each one with one ref in the GC, does that mean that the GC will have to do 1 million more iterations to complete a full cycle? I'm asking because I had many problems with that and lua, their gc would get a massive slowdown eating all CPU |
19:03:01 | Araq_ | and it'll be accessible from macros too |
19:03:06 | Araq_ | giving you the proc name |
19:03:42 | * | Eyman joined #nim |
19:04:12 | Araq_ | edub4rt: yes and no. it's RC+cycle collection |
19:04:16 | yglukhov | Araq_: instantiation info is tuple[filename: string, line: int], no? |
19:04:29 | Araq_ | cycle collection has the problem you're talking about |
19:04:46 | Araq_ | but the RC part doesn't and so you're quick a bit more flexible in this case |
19:04:52 | Araq_ | *quite |
19:05:28 | edub4rt | can the cycle part be disabled GC? |
19:05:33 | Araq_ | yup. |
19:05:50 | edub4rt | how? |
19:05:53 | * | Eyman quit (Client Quit) |
19:06:03 | Araq_ | GC_disableMarkAndSweep() |
19:06:27 | Araq_ | yglukhov: yes, currently. |
19:06:35 | yglukhov | ah, ok. |
19:07:01 | Demos | although better yet just don't create cycles |
19:07:05 | Demos | right? |
19:07:41 | Araq_ | right, but unfortunately the closures that Nim's "async" produces are full of cycles |
19:08:15 | Araq_ | maybe that's a hint that we're doing async wrong :P |
19:08:17 | Demos | what if there's nothing in the closure |
19:08:21 | Demos | maybe |
19:08:29 | Araq_ | there is always everything in the closure |
19:08:38 | Araq_ | since it's the continuation |
19:08:45 | Demos | true |
19:08:47 | Demos | darn |
19:08:53 | Demos | I've never used nim's async |
19:09:20 | Araq_ | we transfer the stack to the heap |
19:09:27 | cheatfate | Araq_, in async i think we can do this without closure(environments) |
19:09:48 | cheatfate | Araq_, but now, i forgot about iterator |
19:10:03 | cheatfate | Araq_, so currently we can't |
19:11:49 | Araq_ | cheatfate: once you understand macros better you can try a completely new approach |
19:12:06 | cheatfate | Araq_, you have an idea? |
19:12:27 | Araq_ | and do the sequential code -> state machine transformation directly in a macro, skipping Nim's closure iterators altogether |
19:13:50 | Araq_ | once you do that, you have more control over where the closures are allocated |
19:14:06 | edub4rt | what about coroutines? I came from C++ where I used boost.coroutine from working async, each coroutine is a "light thread" with its own stack, when wait is needed, it triggers a context_switch, at first when I saw nim's async mechanism I thought it might be something like that, but I found that, the continuation is always in a closure and futures everywhere |
19:14:59 | Araq_ | edub4rt: we have that too, but it's not production ready and in theory it's better to compute the continuation than to keep the stack around |
19:14:59 | * | miqlas-H joined #nim |
19:15:08 | miqlas-H | Hi Guys! |
19:15:14 | philo | I seeded transCounts and then I get an Error: seq modified while iterating over it. |
19:15:21 | miqlas-H | I'm trying to create a proper Nim recipe for Haiku. |
19:15:23 | edub4rt | that made me think, which implementation would be more performant, real coroutines with context switches or using callbacks and futures? |
19:15:24 | cheatfate | Araq_, for me its too complex theory, you must describe this on one of your conferences more completely and give me a video :) |
19:15:46 | def- | philo: oh right, you're not supposed to do that |
19:16:18 | def- | philo: you could make a copy of transCounts and overwrite it after the loop. Or make a new seq for the ones that you want to add |
19:16:18 | miqlas-H | I got it compiled already, but for reproducible build i'm creating a recipe (so the build process could automated in the future) |
19:16:49 | Araq_ | hi miqlas-H I ported Nim to Haiku years ago |
19:17:00 | Araq_ | does it finally have real thread local storage? :P |
19:17:07 | philo | def- thanks |
19:17:09 | * | MainNimDev joined #nim |
19:17:12 | cheatfate | edub4rt, if there no complex (long) calculations coroutines will be slower, but if there many complex calculations coroutines could be faster |
19:18:20 | * | MainNimDev quit (Excess Flood) |
19:18:21 | Araq_ | edub4rt: the other problem is that Nim's stack is C's stack so it's just one dumb blob of memory we have no pointer information about |
19:18:54 | Araq_ | whereas with the continuation approach we have precise knowledge over the pointers etc |
19:19:37 | Araq_ | but yeah, I guess it's one of those superior in theory, much worse in practice ideas |
19:20:19 | miqlas-H | Araq: i've seen the preliminary haiku supporting code here and there, but it doesn't work out of the box now. |
19:20:28 | * | TheLemonMan joined #nim |
19:20:40 | miqlas-H | I'll provide some patches for the bootstrapping process to get it compiled on Haiku. |
19:21:09 | miqlas-H | My question is: can we somehow define the install patf for nim and for the nim cache? |
19:21:51 | miqlas-H | As Haiku got packageFS, some path is ready-only, so we need to define a writeable portion of the file system for extra addons and so on. |
19:21:58 | def- | miqlas-H: if nim compiler runs twice at same time with same nim cache it will fail |
19:22:03 | miqlas-H | the question is: how can i do that? |
19:22:40 | miqlas-H | def: it is enough it if runs on Haiku, then i'll happy. |
19:22:48 | * | jjido quit (Read error: No route to host) |
19:23:54 | renesac | table.add - puts a new (key, value)-pair into t even if t[key] already exists. |
19:24:08 | renesac | so there can be multiple values with the same key in the table? |
19:25:03 | cheatfate | Araq_, if i get `string` type argument why i can't convert it to cstring using cast[cstring](addr(somestring[0]))? |
19:25:58 | * | edub4rt quit (Quit: Page closed) |
19:26:44 | vktec | What should I call a function that returns "first" for 1, "second" for 2, etc? |
19:26:55 | vktec | Or better yet, is there a pre-made one out there? |
19:27:33 | * | edub4rt joined #nim |
19:27:53 | * | mostworst joined #nim |
19:28:32 | Demos | humanize or smth |
19:28:51 | vktec | Okay |
19:28:54 | vktec | Thanks |
19:29:38 | renesac | vktec: I just made (and temporarily deleteed) this |
19:29:38 | renesac | https://github.com/nim-lang/Nim/pull/4344/commits/d6849b87c598b70e83acfee122143ebc2b67df45 |
19:29:51 | renesac | englishOrdinal |
19:30:15 | vktec | Thanks, I'll take a look |
19:30:26 | miqlas-H | So can you point me please, how can i set the install path for nim? |
19:31:20 | Araq_ | miqlas-H: nim read the location of its stdlib from its config |
19:31:33 | Araq_ | and the config is hardcoded to /etc/something on Unix |
19:32:02 | miqlas-H | Araq_: i already found it in the install script. |
19:32:27 | miqlas-H | Will nim somehow informed about, where it will found the supporting codes? |
19:32:57 | Araq_ | nim dump |
19:33:03 | renesac | Araq_: can you help me understand nim tables? |
19:33:14 | dom96 | miqlas-H: Is Haiku's file system Unix-like? Do you have /usr/bin etc? |
19:33:17 | Araq_ | renesac: the answer to your question is "yes". |
19:33:31 | renesac | thanks |
19:33:56 | renesac | and any parcitular reason why there is a separate implementation for sets and strtabs? |
19:34:43 | Araq_ | strtabs predates generics and only lives on because it support case insensitive lookups |
19:35:29 | renesac | wouldn't a distinct type for those style insensitive strings solve the problem better? |
19:35:32 | Araq_ | and I found no good way to do that with Nim's generics, I mean ok, you could create a 'distinct string' that has hash and equality made insensitive |
19:35:40 | renesac | ah |
19:36:40 | dom96 | Araq_: Perhaps it would be worthwhile to improve strtabs so that it supports String -> T maps? |
19:37:27 | Araq_ | perhaps, but then it needs to be made more consistent with tables.nim etc |
19:37:32 | renesac | well, just separate the equality check to a separate function, and put a "when" for use when included in the strtabs |
19:37:38 | Araq_ | right now it's in the nice "zombie" state |
19:37:43 | renesac | hum |
19:37:55 | Araq_ | everything else means work :P |
19:39:08 | miqlas-H | dom96: nope. |
19:39:29 | dom96 | miqlas-H: So where would you install packages? |
19:39:40 | dom96 | miqlas-H: Would it be more similar to Windows, where everything is in a single directory? |
19:40:43 | renesac | and the documentation for the tables module is not very friendly.. this is compounded by the disorganization of having "duplicate" functions for the different types of tables |
19:40:43 | Araq_ | yglukhov: " What do you say if we introduce a smarter js bridging api to enable out-of-the-box emscripten compatibility." |
19:41:02 | Araq_ | I don't really understand what you mean and have no experience with emscripten |
19:41:04 | miqlas-H | binaries should go into /system/bin, and the other data files (not executables should go into the /boot/system/data/nim or something like that. |
19:41:35 | renesac | I still dream of that dynamic documentation organization mockup |
19:42:06 | Araq_ | renesac: you can dream, you can do it, or you just write some introduction text that explains how tables work. |
19:42:15 | miqlas-H | i never ever installed nim, so i have no idea what kind of data files will it install and where. |
19:42:55 | renesac | right... there is no proc to return all the values with the same key in the table, right? |
19:42:56 | dom96 | miqlas-H: Then I suggest you install all of Nim's files into /boot/system/data/nim then symlink /boot/system/data/nim/bin/nim into /system/bin/nim |
19:43:15 | renesac | it always return the first one found? |
19:43:21 | vktec | I asked a while ago, but completely forgot, sorry: what is the module for key-value stores in Nim? |
19:43:34 | renesac | vktec: tables |
19:43:39 | vktec | Thanks |
19:44:20 | miqlas-H | nope, every executable should be in /system/bin or yet better $bindir |
19:47:50 | miqlas-H | ok, i made a temporary install into a scratch folder. |
19:48:41 | miqlas-H | I got it installed, i got a nim folder in my prefix, and it have some other folders: bin, compiler, config, doc, and lib |
19:48:52 | miqlas-H | can i set where they should go? |
19:50:27 | miqlas-H | i see it is controlled in install script. should i define there something like "case haiku" ? |
19:51:30 | Araq_ | miqlas-H: yes but keep in mind it's produced from a .tmpl file in tools/niminst |
19:52:45 | dom96 | miqlas-H: What about software which doesn't support the Haiku file system, where is it installed? |
19:53:03 | Araq_ | renesac: iterator allValues |
19:53:20 | dom96 | We already have enough problems because of into /usr/bin, /usr/lib, /etc. |
19:53:25 | dom96 | *of installation |
19:53:29 | renesac | oh, I was looking only at the procs |
19:54:00 | * | euantor quit () |
19:54:03 | * | shodan45 quit (Quit: Konversation terminated!) |
19:54:38 | miqlas-H | dom96: they have almost all the time some configure script. Our 'haikuporter' tool will provide them the correct folders trough --xxxdir (like bindir) options automatically. |
19:55:01 | * | yglukhov_ joined #nim |
19:56:20 | dom96 | miqlas-H: what if it's a closed-source application? For example, on Unix systems it would typically be installed in /opt/applicationName |
19:56:38 | philo | So I went looking around and found CountTable which does just what I need, but... http://pastebin.com/2RzEKMdd |
19:57:54 | * | yglukhov quit (Ping timeout: 276 seconds) |
19:58:34 | Demos | the unix filesystem is such a mess |
19:58:36 | renesac | philo: you probably want inc |
19:58:44 | renesac | there is no add for CountTable I think |
20:00:02 | philo | renesac, thanks! |
20:01:08 | philo | renesac: still type mismatch |
20:02:49 | * | francisl joined #nim |
20:03:56 | vktec | Should I use `var tbl = newTable[string, int]` or `var tbl: Table[string, int]` or something else? |
20:04:42 | renesac | proc initCountTable[A](initialSize = 64): CountTable[A] |
20:04:53 | renesac | you shoud use that proc |
20:05:18 | renesac | var tbl = initCountTable[string]() |
20:05:26 | vktec | Ah, thanks |
20:05:38 | vktec | Is the `()` necessary there? |
20:05:49 | renesac | probably |
20:05:59 | vktec | Okay, thanks |
20:06:50 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
20:08:54 | * | aziz quit (Quit: Ex-Chat) |
20:09:37 | philo | renesac: ?? |
20:10:17 | renesac | oops |
20:10:31 | renesac | I'm mixing up you two, philo and vktec |
20:11:22 | vktec | :) |
20:12:15 | philo | var transitions = CountTable[string]() seems to work... until I try is inc() or add() it, then typeMishMash |
20:13:32 | renesac | I get a SIGSEGV, no type mismatch |
20:13:35 | renesac | ^^' |
20:13:37 | dom96 | philo: you should use initCountTable |
20:13:45 | miqlas-H | dom96: the author could change the install folder in his sources. |
20:13:57 | renesac | and yeah, you should use what I said vktec to use |
20:14:26 | dom96 | miqlas-H: I'm sure there are times when that's not possible |
20:14:46 | renesac | it seems like one shouldn't call "inc" on non-existant keys... |
20:14:55 | miqlas-H | then we have a non-packaged directory structure |
20:15:54 | renesac | ok, I don't know how to use that |
20:16:31 | philo | dom96: initCountTable, still missmatch. I'm on ARMv7.. is that mucking this up? |
20:16:47 | dom96 | philo: paste your code again |
20:16:52 | renesac | philo: if you manage to discover how to use that countTable, pull requests are welcome |
20:17:20 | renesac | philo: post a complete code, with the "chains" for example |
20:17:56 | renesac | pull requests with example usage |
20:18:35 | philo | renesac: http://pastebin.com/bQcwL2r1 |
20:20:03 | renesac | your import is incomplete |
20:20:16 | renesac | you should import inc from tables too |
20:20:22 | Araq_ | philo: from tables import CountTable, initCountTable # just use import tables |
20:20:29 | renesac | yeah |
20:20:48 | Araq_ | Nim is not python, we use types, not scopes for protection |
20:21:17 | Araq_ | even though most people don't understand it and blame us for "polluting" the namespaces and all that nonsense |
20:22:03 | philo | bingo! |
20:22:58 | philo | Araq_ types for protection? Got a link for that? |
20:23:04 | renesac | Araq_: the major crictic that I saw is tht it is difficult to know where things came from w/o using a IDE |
20:23:13 | renesac | philo: basically, overloading |
20:24:08 | philo | renesac: yeah, the tutorial talked about that, it chooses the proc with the right data types |
20:24:09 | renesac | the language will know what proc to apply based on the type of its arguments |
20:24:19 | renesac | python don't have that |
20:25:31 | renesac | well, it has clases with methods |
20:25:35 | renesac | *classes |
20:31:00 | Araq_ | renesac: yes but it's always hard to navigate without an IDE, so the whole point is moot |
20:31:50 | Araq_ | and why would I *not* use an IDE? that's like not using shoes for walking. sure, I can do it, but most of the time I don't. |
20:36:28 | renesac | git hub |
20:36:33 | renesac | reading code on your tablet |
20:36:43 | renesac | editing remotely in a server |
20:36:58 | renesac | no nimsugest support on your favorite editor.. |
20:37:21 | renesac | reading code in a blog |
20:37:22 | renesac | etc |
20:38:32 | renesac | reading a tutorial/example |
20:38:33 | renesac | etc |
20:40:54 | edub4rt | Araq_: what is the "stack" gc? I was reading the code and found the option, I am benchmarking the asynchttpserver and used that gc, went from 80k from (refc) requests/s to 120k requests/s (stack) |
20:41:40 | edub4rt | nvm I found out, the mem keeped increasing upto 12GB, I think its just stacking the allocations |
20:43:13 | edub4rt | but outperformed the others gc, which is odd because its keep allocating more and more |
20:45:29 | deavmi_mobile | when should one use |
20:45:50 | deavmi_mobile | the discard keyword. is it for times when a value is returned but does not want to be used? |
20:48:27 | def- | deavmi_mobile: yes, among other uses |
20:48:40 | deavmi_mobile | okau |
20:48:43 | deavmi_mobile | thanks ;) |
20:48:44 | def- | deavmi_mobile: it's useful for procs returning an error code that you need to check |
20:50:06 | * | kingofoz quit (Read error: Connection reset by peer) |
20:50:38 | * | kingofoz joined #nim |
20:55:46 | edub4rt | dom96,def-: deep investigating asynchttpserver performance, you might find this interesting, I used kernel's perf to visualize where the process is using the most of the cpu, I've found out the major optimization issue too much allocation/desalocation while processing requests, as you can see in this screenshot http://storage6.static.itmages.com/i/16/0617/h_1466196551_6311064_60d86f27ae.png |
20:56:08 | Araq_ | edub4rt: that's hardly news here :-) |
20:56:16 | edub4rt | the screenshot was taken while a simple hello from asyncdispatcherhttp was processing 100k/s |
20:56:44 | edub4rt | asynchttpserver* |
20:57:26 | Araq_ | edub4rt: I think we can patch async to use --gc:stack |
20:57:32 | Araq_ | but I'm not sure |
20:57:32 | edub4rt | as you can see the first heavy method is rawalloc (which is from gc), third most is collectctbody (which is also from gc), then next ones rawdealloc, sweep etc |
20:57:55 | dom96 | edub4rt: 'perf' looks like a cool command, but yeah we already know that :) |
20:58:21 | dom96 | Unfortunately this is likely due to the allocation of Future's |
20:58:53 | edub4rt | most of CPU is spent allocating/deallocating and in gc, things could be optimized by minimizing usage of allocation/deallocating |
20:59:01 | Araq_ | allocate a region for every request, throw away the region after the request |
20:59:15 | Araq_ | that's what --gc:stack allows |
20:59:35 | dom96 | Araq_: so how do we get it to work? |
20:59:38 | Araq_ | simple, effective, doesn't have to redesign async's API to minimize allocations |
20:59:49 | Araq_ | but hey, what do I know. |
20:59:57 | edub4rt | dom96: perf is definitely a must have tool, you should try it, is simple to install and use "sudo apt-get install perf" then "perf top" |
21:00:04 | dom96 | is it just a simple allocRegion() and deallocRegion() in the code? :P |
21:00:13 | Araq_ | yes |
21:00:21 | dom96 | any docs? |
21:00:26 | Araq_ | no... |
21:00:34 | dom96 | there is your problem :P |
21:00:46 | Araq_ | "lack of time" is my problem. |
21:01:05 | dom96 | But seriously, are these allocRegion procs at least defined somewhere like system or something? |
21:02:32 | cheatfate | ioselectors.nim dont use alloc/dealloc :) |
21:03:21 | cheatfate | and generics usage resolves some alloc/dealloc in asyncdispatch |
21:03:31 | cheatfate | but not Future allocations |
21:03:56 | cheatfate | but we can make global futures storage... |
21:04:37 | cheatfate | but we need at least Future.close() method |
21:05:06 | Araq_ | caching futures is meh. |
21:05:18 | * | kingofoz quit (Read error: Connection reset by peer) |
21:06:04 | * | kingofoz joined #nim |
21:07:38 | dom96 | Araq_: why? |
21:08:04 | * | cheatfate thinks Araq wants to make his own async state machine :) |
21:08:35 | cheatfate | because i'm too ignorant (C) Varrioint |
21:08:47 | * | mahasamoot quit (Ping timeout: 244 seconds) |
21:08:55 | Araq_ | because you increase the lifetime of objects to infinite |
21:10:04 | * | philo quit (Ping timeout: 264 seconds) |
21:10:04 | Araq_ | which means the GC doesn't collect for you anymore. you're managing the memory on your own then |
21:10:15 | Araq_ | aka object pooling. |
21:10:18 | cheatfate | Araq_, yep, because we don't need GC |
21:10:48 | Araq_ | do that for everything and worse case memory bounds are much much worse than for any other kind of allocation scheme |
21:11:06 | Araq_ | *and the memory bounds are worse than ... |
21:11:48 | Araq_ | but ok, fine, try it. |
21:11:54 | dom96 | Meh, at this point parallelisation is more important. |
21:12:39 | Araq_ | here is what we have: |
21:13:21 | Araq_ | RC + M&S GC works great for games, but for async the RC part is essentially worthless and we're left with M&S doing the bulk of the work |
21:13:54 | Araq_ | what's the cost of M&S? the marking of what is alive |
21:14:11 | Araq_ | what do you do? you cache all objects, meaning much more things are alive |
21:15:23 | Araq_ | so you pessimize the cost of a GC run |
21:15:30 | Araq_ | but optimize the number of GC runs |
21:16:10 | Araq_ | --> somebody needs to measure it. |
21:16:11 | * | polypus74 quit (Remote host closed the connection) |
21:16:11 | * | polypus quit (Remote host closed the connection) |
21:19:11 | dom96 | I think it would make sense to write an efficient async http server on top of the `selectors` module. |
21:19:34 | dom96 | At the cost of some niceness like async procs it would result in ultimate performance. |
21:20:01 | cheatfate | dom96, you are trying to achieve speed using old engine... |
21:20:02 | * | saml quit (Quit: Leaving) |
21:20:38 | dom96 | cheatfate: Once I get time to properly review it, your ioselectors module will become the `selectors` module. Don't worry. |
21:21:43 | cheatfate | also we need this https://github.com/h2o/picohttpparser and more modern version https://www.google.com.ua/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=0ahUKEwj4r_D5_q_NAhUJEiwKHb7ACAAQFggnMAE&url=http%3A%2F%2Fblog.cloudflare.com%2Fimproving-picohttpparser-further-with-avx2%2F&usg=AFQjCNFzUOYYXsg8yHfZ8UTi8jw91GAcOA&sig2=_hCWvjDmZuiEcRwwoEQ9ug |
21:21:44 | * | Gonzih quit (Ping timeout: 272 seconds) |
21:23:38 | * | desophos joined #nim |
21:24:03 | dom96 | Sure optimisations like that are good, but I think it's more important to implement missing functionality first. |
21:24:33 | * | endragor quit (Ping timeout: 240 seconds) |
21:24:50 | dom96 | For example: asyncproc (asynchronous OS processes), fsmonitor (asynchronous monitoring of files/folders) |
21:25:00 | dom96 | Also HTTP2 support in the our server |
21:25:03 | dom96 | *in our |
21:25:33 | dom96 | oh, and as far as benchmarks are concerned: if someone could benchmark the only websocket library that we have then that would be brilliant. |
21:27:04 | * | lazypenguin1 quit (Quit: Leaving) |
21:37:34 | * | Demos quit (Ping timeout: 252 seconds) |
21:41:10 | * | deavmi_mobile quit (Quit: Cheers all. Be good and don't do drugs.) |
21:41:20 | * | deavmi_mobile joined #nim |
22:03:55 | miqlas-H | Bye Guys |
22:06:06 | * | miqlas-H quit (Quit: Vision[0.9.7-H-20140108]: i've been blurred!) |
22:07:40 | * | Matthias247 joined #nim |
22:08:01 | * | yglukhov_ quit (Remote host closed the connection) |
22:08:39 | * | Trustable quit (Remote host closed the connection) |
22:10:35 | * | yglukhov joined #nim |
22:11:34 | * | philo joined #nim |
22:11:35 | cheatfate | does anybody knows what is default calling convention for simple "extern int xxxxxx()" for gcc? |
22:12:05 | * | mahasamoot joined #nim |
22:12:32 | * | mostworst quit (Ping timeout: 250 seconds) |
22:13:11 | Araq_ | cheatfate: __cdecl |
22:13:31 | cheatfate | Araq_, it looks like somebody of us wrong at least for windows |
22:14:17 | cheatfate | for x64 platform it doesn't matter until your function is less than 4 arguments |
22:14:50 | cheatfate | i have constant SIGSEGV on calls to postgres.nim function in windows |
22:14:54 | cheatfate | with mingw |
22:15:01 | cheatfate | and vcc is works |
22:15:38 | Araq_ | well vcc might use stdcall |
22:16:02 | Araq_ | dunno, you need to check postgre's source code and see what's the correct calling convention |
22:18:44 | cheatfate | Araq_, for some reason they don't declare any conventions |
22:19:22 | Araq_ | really? |
22:19:42 | Araq_ | shouldn't they have some knowledge about these things? |
22:21:20 | Araq_ | whatever open the DLL in some editor and check the name mangling |
22:21:41 | Araq_ | the name mangling tells you the calling convention, I hope |
22:22:00 | cheatfate | name mangling is only used by C++ code |
22:22:52 | Araq_ | no, DLLs have it |
22:23:00 | Araq_ | _foobar@8 |
22:23:11 | Araq_ | means cdecl, 8 bytes on stack |
22:23:23 | Araq_ | foobar@8 means stdcall, 8 bytes on stack |
22:23:29 | Araq_ | or similar, check google |
22:26:21 | Araq_ | bbs |
22:26:30 | cheatfate | there no mangled names in libpq.dll |
22:32:18 | Araq_ | Production releases of PostgreSQL for Windows are generally built using MicroSoft's commercial compilers |
22:32:26 | Araq_ | from https://wiki.postgresql.org/wiki/Building_With_MinGW |
22:32:41 | cheatfate | Araq_, i have found a problem minute ago |
22:33:02 | cheatfate | There was problem with tracing file... for some reason it not working in windows |
22:33:15 | cheatfate | and causes SIGSEGV inside of PQSendQueryPArams |
22:33:28 | cheatfate | so i disabled tracing file and everything is goes fine |
22:33:44 | cheatfate | tracing file uses nim's `File` |
22:34:01 | cheatfate | so why it works properly with vcc and not gcc |
22:34:43 | cheatfate | my addRead and addWrite for windows works as expected |
22:45:16 | Araq_ | so ... I looked it up |
22:45:20 | Araq_ | _foo # cdecl |
22:45:30 | Araq_ | _foo@8 # stdcall |
22:45:41 | Araq_ | @foo@8 # fastcall |
22:51:34 | cheatfate | Araq_, its not a standard for DLL |
22:52:20 | cheatfate | libpq.dll as kernel32.dll dont have mangled names |
22:54:13 | * | Matthias247 quit (Read error: Connection reset by peer) |
23:01:32 | * | brson joined #nim |
23:03:16 | * | brson quit (Client Quit) |
23:03:22 | * | akaisora_ quit (Read error: Connection reset by peer) |
23:04:07 | * | sdw joined #nim |
23:10:07 | * | deavmi_mobile quit (Read error: Connection reset by peer) |
23:15:09 | * | deavmi_mobile joined #nim |
23:21:20 | * | ObjPas joined #nim |
23:21:21 | cheatfate | Araq_, i'm still don't understand genSym() |
23:22:03 | cheatfate | generates a fresh symbol that is guaranteed to be unique |
23:22:48 | cheatfate | what does it mean unique, unique in block? |
23:24:24 | * | ObjPas quit (Client Quit) |
23:27:18 | * | elrood quit (Quit: Leaving) |
23:38:03 | cheatfate | Araq_, is it possible to convert macro's argument of type like int, string to nimnode? |
23:39:36 | cheatfate | so i can use it value in generation |
23:39:37 | cheatfate | ? |
23:57:13 | Araq_ | cheatfate: it means unique. |
23:57:20 | Araq_ | in ev |
23:57:33 | Araq_ | *for any block |
23:59:26 | cheatfate | so var paramTypes = genSym(nskVar, "param") var paramValues = genSym(nskVar, "param") so paramTypes and paramValues will have unique names? |