00:02:09 | vivus | who uses choosenim here? |
00:14:38 | FromDiscord | <emekoi> i use choosenim |
00:16:34 | * | xet7 quit (Quit: Leaving) |
00:33:13 | FromGitter | <kaushalmodi> @xmonader I'm going to go through it and understand the "graph theory" better. It's like a 'make' clone, right? |
00:33:46 | FromGitter | <kaushalmodi> Also, in the comments you mention possible future support of YAML. Have you considered TOML? :) |
00:33:57 | vivus | on linux? @emekoi |
00:34:51 | FromGitter | <kayabaNerve> vivus I do on Linux |
00:35:08 | FromGitter | <kaushalmodi> @PMunch and @data-man have worked on updating the Nim TOML parser (nimble package). |
00:35:39 | vivus | @kayabaNerve is the installation as simple as it sounds? just run the bash script? |
00:35:57 | FromGitter | <kayabaNerve> Yep |
00:37:22 | FromGitter | <xmonader> @kaushalmodi Yes, it's more like a very minimalistic version of how make works ⏎ ⏎ and for the yaml sugestion ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7b5ec138a12915e4d237a7] |
00:37:39 | FromGitter | <xmonader> it's just for describing the the tasks without worrying about special language |
00:37:44 | FromGitter | <xmonader> toml would work too |
00:41:36 | FromGitter | <retsyo> what a bad local internet connection I have. I can onyl download nim 0.17.2 < 10KB/s |
00:43:21 | * | vivus quit (Quit: Leaving) |
01:11:19 | * | Jesin quit (Quit: Leaving) |
01:14:44 | * | Jesin joined #nim |
01:50:28 | * | vivus joined #nim |
01:53:15 | FromGitter | <retsyo> nim 0.17.2 can compile wxnim's example without being stuck, although there are too many errors so that no exe can be produced. Nim Compiler Version 0.18.1 (I compiled from github's code at 2018-08-18) always be stuck. There is still a long time before I can transport my wxPython application to nim |
01:59:27 | * | cspar quit (Ping timeout: 240 seconds) |
02:07:21 | * | ftsf joined #nim |
02:43:50 | * | cspar joined #nim |
02:53:41 | shashlick_ | @retsyo: is it Araq's version or PMunch's fork |
02:53:44 | shashlick_ | https://github.com/PMunch/wxnim |
03:01:55 | * | dddddd quit (Remote host closed the connection) |
03:38:46 | * | hogeland joined #nim |
03:40:01 | FromGitter | <retsyo> PMunch's fork |
03:45:11 | * | endragor joined #nim |
04:12:51 | * | Vladar joined #nim |
04:26:55 | * | vivus quit (Remote host closed the connection) |
04:32:38 | * | ftsf_ joined #nim |
04:34:50 | * | ftsf quit (Ping timeout: 244 seconds) |
05:25:05 | * | nsf joined #nim |
05:55:19 | * | ftsf joined #nim |
05:58:32 | * | ftsf_ quit (Ping timeout: 244 seconds) |
06:03:38 | * | stefanos82 joined #nim |
06:07:43 | * | Trustable joined #nim |
06:56:51 | FromGitter | <timotheecour> how can i check if a symbol has a pragma? eg: `inline` (I see `hasPragma` in compiler/pragmas.nim, but that’s not available in libraries eg standard library) |
06:57:17 | * | dadabidet joined #nim |
07:03:30 | Araq | you can't. |
07:03:53 | FromGitter | <timotheecour> fundamental limitation or fixable? |
07:05:29 | Araq | we can add/patch macros.hasPragma but I'm not sure I want somebody's DSL to inspect my .inline annotations |
07:08:40 | FromGitter | <timotheecour> eg use case: I need a trait isInline so I can customize code depending on whether iterator is `inline` or `closure` |
07:09:47 | FromGitter | <xmonader> guys isere ssh library for nim or do i need to implement it :( ? |
07:15:08 | * | PMunch joined #nim |
07:17:25 | Araq | ok, sounds reasonable |
07:17:56 | Araq | xmonader: not sure |
07:21:49 | FromGitter | <xmonader> I see a great potential for nim if we have ssh library, we can basically overthrow ansible and all automation frameworks outthere with speed/macro systems what do you guys think? |
07:24:43 | Araq | I wrapped https://github.com/Araq/bearssl |
07:25:02 | Araq | but haven't used it for anything, be my guest and adopt it |
07:25:47 | FromGitter | <xmonader> @Araq this is great thansk a lot |
07:27:02 | * | Trustable quit (Remote host closed the connection) |
07:35:20 | * | norok2 quit (Quit: Gone hunting.) |
07:38:14 | livcd | xmonader: there's a wrapper for ssh afaik |
07:47:28 | * | norok2 joined #nim |
08:03:38 | * | gmpreussner joined #nim |
08:04:21 | FromGitter | <bung87> how to access object property using string key? |
08:04:54 | * | gmpreussner_ quit (Ping timeout: 272 seconds) |
08:05:32 | FromGitter | <timotheecour> use `fieldPairs` |
08:06:26 | * | Jesin quit (Ping timeout: 276 seconds) |
08:08:03 | FromGitter | <bung87> https://nim-lang.org/docs/system.html#fieldPairs.i,T this? |
08:08:11 | FromGitter | <timotheecour> yes |
08:08:26 | FromGitter | <bung87> ok,thanks ! let me try it |
08:11:18 | FromGitter | <bung87> https://github.com/nim-lang/Nim/pull/6987 I see this PR which in devel branch,it's more easy |
08:14:22 | FromGitter | <timotheecour> how is that related to `to access object property using string key` ? `fieldPairs` will be more general (will work with any existing object / tuple) |
08:16:48 | FromGitter | <bung87> the serializationKey does not for this? |
08:17:57 | * | Jesin joined #nim |
08:18:22 | FromGitter | <timotheecour> i don’t think so, i think that’s a custom thing; feel free to try with `type A=object (a:int)` |
08:22:22 | FromGitter | <bung87> proc `[]`(x: BMES,index:string): float = ⏎ result = MIN_FLOAT ⏎ for name, value in x.fieldPairs: ⏎ ⏎ ```when name == index: ⏎ return value``` ... [https://gitter.im/nim-lang/Nim?at=5b7bcbbd38a12915e4d497c3] |
08:23:02 | FromGitter | <bung87> cannot evaluate at compile time: index ⏎ ,what's wrong with the code? |
08:23:47 | FromGitter | <timotheecour> when expects CT input, index is RT |
08:24:15 | leorize | use if instead |
08:24:30 | FromGitter | <alehander42> and you dont need return result |
08:24:40 | FromGitter | <alehander42> result is returned by default |
08:25:49 | FromGitter | <timotheecour> if you’re trying to have polymorphic output (eg return int or float depending on field), this won’t work, for that you’d need basically what I implemented (which is like D’s `static foreach`) ; haven’t sent a PR for it yet |
08:26:54 | FromGitter | <bung87> hmm ,yesterday I write some code it's doest return by default,I know it will return as last time I wrote nim,I can't confirm now |
08:27:47 | FromGitter | <bung87> oh I 'll check what's the diffriences between CT and RT |
08:27:59 | FromGitter | <timotheecour> compile time vs run time |
08:28:45 | FromGitter | <alehander42> if you have a result variable and you haven't returned until the end of function, result will be returned |
08:29:30 | FromGitter | <bung87> thanks guys,learn a lot. |
08:30:11 | FromGitter | <timotheecour> Pleasure :) |
08:30:26 | FromGitter | <bung87> I'm porting a python package to nim,but it results 7 times slower than python,I may face more problems... |
08:31:39 | FromGitter | <timotheecour> if you can reduce your test case, feel free to post it in forum or even (if you’re quite sure it’s not normal) in github issues |
08:34:53 | FromGitter | <bung87> https://github.com/bung87/finalseg/blob/master/src/finalseg.nim ,yeah I pushed it to github in minutes ago,I'm now trying cast JsonNode to object |
08:35:31 | FromGitter | <tim-st> use `packedjson` instead of `json` |
08:37:13 | FromGitter | <mratsim> don’t declare var result and then return result |
08:37:29 | FromGitter | <mratsim> result is implicit, already available and returned automatically |
08:37:29 | FromGitter | <tim-st> also be careful with rune procs, e.g. `runeLen`is O(n) operation |
08:38:14 | FromGitter | <tim-st> instead often `fastRuneAt` works |
08:38:39 | * | krux02 joined #nim |
08:39:11 | FromGitter | <bung87> ok,I 'll check these things |
08:39:18 | FromGitter | <tim-st> did you compile in release mode? |
08:39:21 | FromGitter | <mratsim> you should us getOrDefault here: https://github.com/bung87/finalseg/blob/master/src/finalseg.nim#L47-L48 |
08:39:25 | * | Vladar quit (Remote host closed the connection) |
08:39:44 | FromGitter | <mratsim> same: https://github.com/bung87/finalseg/blob/master/src/finalseg.nim#L61 getOrDefault |
08:41:16 | FromGitter | <bung87> yes release mode,but didnot reduce much time than debug mode,in release mode it's about 7 seconds,but python results about 2 seconds |
08:41:44 | FromGitter | <mratsim> states and PrevStatus should be an enum: https://github.com/bung87/finalseg/blob/master/src/finalseg.nim#L43 |
08:42:18 | FromGitter | <mratsim> you allocate too much strings, Python GC will reuse those, but Nim just return and re-request memory from the system |
08:42:39 | FromGitter | <tim-st> ` if sentence.runeLen() == 0:` is only true if `sentence.len == 0` is true, too while last one is O(1) |
08:42:40 | FromGitter | <mratsim> unlike Python, Nim GC will not cache memory that can be reused |
08:43:26 | FromGitter | <mratsim> don’t allocate memory in tight loops: https://github.com/bung87/finalseg/blob/master/src/finalseg.nim#L53-L56, clear the table and reuse. |
08:44:00 | FromGitter | <mratsim> already said but states should be enum, not strings: https://github.com/bung87/finalseg/blob/master/src/finalseg.nim#L98 |
08:44:01 | FromGitter | <tim-st> also if you want "Han" use `\p{Han}` I think |
08:44:17 | FromGitter | <bung87> wow so many,let me check it one by one.... |
08:45:41 | FromGitter | <alehander42> also you do a lot of JsonNode getFloat in tight loops, I suspect it might be way faster to just parse the json files once into Nim objects/tables and directly use them |
08:46:01 | FromGitter | <bung87> I dont have confidence about `\p{Han}` whether contains tradition chinese or not,I 'll dig it later |
08:46:38 | FromGitter | <mratsim> Basically, there are 2 things you should be aware of to get the fastest speed: ⏎ ⏎ 1) use O(1) algorithms like tim-st said ⏎ 2) avoid allocating memory in loops: strings, tables, json, seq all allocates. Appending or updating an existing one is fine, but creating a new one is very costly. [https://gitter.im/nim-lang/Nim?at=5b7bd16e94f8164c177acfdf] |
08:47:33 | FromGitter | <tim-st> also: when you create new seq or new string, often you know nearly the capacity, though the python code doesnt do it too so it's not the bottleneck |
08:47:45 | FromGitter | <bung87> @alehander42 yes,you are right,I also have another branch which not complete,since it's not like dict in python. |
08:48:11 | FromGitter | <tim-st> so you can do `result = newStringOfCap(input.len div 3)` or similiar |
08:50:05 | FromGitter | <mratsim> now the last thing is that you probably need to add `{.noInit.}` to each proc that returns a string or a seq similar to this: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/init_cpu.nim#L49. ⏎ ⏎ Unfortunately Nim is a bit too conservative at the moment with seq/strings results and does a costly extra initialization pass even when you initialize the results in the proc body :/. |
08:50:14 | FromGitter | <bung87> `newStringOfCap` where to use it? |
08:50:48 | FromGitter | <tim-st> also if you care about peformance and you have such easy regex: iterate over runes and compare the rune Range manual using `rune.ord in 0xXXX .. 0xYYYY` |
08:51:00 | FromGitter | <tim-st> e.g. `var result = newSeqstring ()` |
08:51:11 | FromGitter | <tim-st> this has no capacity and uses cap = 8 |
08:51:43 | FromGitter | <tim-st> replacing regex by manual runes checking will make your program like 10 times faster than python |
08:52:29 | * | nedbat23 joined #nim |
08:54:02 | * | mappum joined #nim |
08:55:56 | FromGitter | <bung87> yeah ,there's also a cpp version of this package,It does use rune iterator,I dont know that parts have so much performance cares,thanks told me this. |
08:57:18 | * | mappum quit (Remote host closed the connection) |
08:57:18 | * | nedbat23 quit (Read error: Connection reset by peer) |
09:07:13 | * | fredrik92 is now known as couven92 |
09:08:53 | * | skelett joined #nim |
09:09:22 | FromGitter | <bung87> @mratsim if I use enum how do i using string key? |
09:15:24 | FromGitter | <tim-st> you use the chars of strings as states, so you can create `type State = enum of A,B,B` and then for state in State: let c = state.ord.char; but this wont change performance |
09:15:36 | FromGitter | <tim-st> 1) `A,B,C` |
09:16:16 | FromGitter | <mratsim> @bung87 why do you need string keys? |
09:17:50 | FromGitter | <mratsim> string are very slow. It’s a pointer (8-bytes) + length (8 bytes) + storing the string data (variable size). |
09:18:01 | FromGitter | <mratsim> an enum is just 1 byte and always on the stack |
09:18:34 | FromGitter | <mratsim> strings are on the heap meaning Nim has to ask the OS “Please give me some memory”, this is VERY slow. |
09:18:39 | FromGitter | <tim-st> I think he uses const string in the example |
09:19:15 | FromGitter | <mratsim> the left hand side is allocated at runtime |
09:19:29 | FromGitter | <mratsim> and even with const string there is pointer dereferencing to read the data. |
09:20:00 | FromGitter | <tim-st> ok |
09:20:42 | FromGitter | <tim-st> but I think the biggest performance impact will have handling runes correctly, replacing regex by rune checking, and replacing `json` by `packedjson` |
09:21:58 | FromGitter | <mratsim> I’m not specialist of that, but I’m pretty sure I could improve perf by 10x~20x with much better allocations and ading {.noInit.} |
09:22:04 | FromGitter | <bung87> I checked the getOrDefault it's return JsonNode,it has to cast to float. |
09:22:54 | FromGitter | <tim-st> On my lmdb nim can iterate over more than 300k k, v allocated strings by copy so allocating strings is maybe bad regarding performance, but wont have the impact in the example code compared to python I think |
09:23:14 | FromGitter | <tim-st> (300k per second) |
09:23:37 | FromGitter | <mratsim> for arraymancer, allocating seq is the biggest perf bottleneck |
09:24:11 | FromGitter | <tim-st> yes, I can imagine, but your code is already very optimized ;-) |
09:24:22 | FromGitter | <mratsim> especially when converting a tensor to string, that’s so slow :/ |
09:24:34 | FromGitter | <tim-st> once regex is involved, there are other bottlenecks |
09:24:41 | FromGitter | <mratsim> yeah I can imagine |
09:25:52 | FromGitter | <tim-st> btw I tried to cast a `UncheckedArray[char]` to string where I know startadress and len of chars, should this work (casting to native nim string)? |
09:26:57 | FromGitter | <tim-st> even in Python they can do zero copy from lmdb :\ |
09:27:26 | FromGitter | <bung87> I'm not familar with program language that have to care about allocating,I will check json and regex at first |
09:27:51 | FromGitter | <mratsim> @tim-st no it won't |
09:28:01 | FromGitter | <tim-st> why not? |
09:28:25 | FromGitter | <tim-st> I saw an example of casted seq in `system.nim` I copied the coded but read from nil it said |
09:28:34 | FromGitter | <mratsim> the memory is like this \[ length (8 bytes) | start of memory blob (length bytes)\] |
09:28:49 | FromGitter | <mratsim> you will be missing the length part |
09:29:30 | FromGitter | <tim-st> I copied this https://github.com/nim-lang/Nim/blob/b75808c7d992ea47f8d6abc656b881b2aa0f86de/lib/system.nim#L696 |
09:29:47 | FromGitter | <tim-st> The type `PGenericSeq` should do it, I thought |
09:29:58 | FromGitter | <mratsim> result is a seq |
09:30:13 | FromGitter | <mratsim> and you cannot just cast unmanaged memory to GC memory |
09:30:28 | FromGitter | <bung87> hmm I know that but it's still difficult for me to manually manage allocating,I usauly write js,ts and python codes. |
09:30:37 | FromGitter | <tim-st> @mratsim https://github.com/nim-lang/Nim/blob/b75808c7d992ea47f8d6abc656b881b2aa0f86de/lib/system.nim#L426 has the string definition |
09:30:58 | FromGitter | <tim-st> I thought about it as unsafe string; the memory is freed by lmdb after transaction is commited |
09:31:07 | FromGitter | <tim-st> this is how python does it too |
09:31:27 | FromGitter | <mratsim> @bung87 you don’t need to manually manage allocating memory, this is another discussion. But you should avoid creating strings, seq and tables in a tight loop. |
09:33:15 | FromGitter | <mratsim> @tim-st so I’m wrong, it’s \[length (8 bytes) | reserved memory (8 bytes) | data (length bytes) \] |
09:34:00 | FromGitter | <tim-st> So should it be possible to cast to the definition I linked, under the assumption that everything is freed by external library? |
09:34:03 | Araq | mratsim: please give me a snippet where .noInit is required |
09:34:42 | Araq | I don't want Nim programmers to write .noInit |
09:34:43 | FromGitter | <mratsim> @Araq, here you go: https://github.com/frol/completely-unscientific-benchmarks/pull/17 |
09:35:15 | Araq | that's a PR, not a snippet |
09:35:47 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b7bdcf3fd3c641b06eae1c9] |
09:36:27 | FromGitter | <mratsim> 2x speed improvement for `time main` when using noInit |
09:37:18 | FromGitter | <mratsim> only for the refcounting GC, the mark and sweep doesn’t have the same issue |
09:37:32 | Araq | that makes no sense, looking into it |
09:38:05 | FromGitter | <mratsim> it’s related to this fix: https://github.com/nim-lang/Nim/commit/88cf6573e04bd7ee8762aa336460b9748f0d4644 |
09:38:33 | PMunch | Anyone know what's the root of the issue here? https://stackoverflow.com/questions/51932881/calling-fzf-from-nim-doesnt-show-fzfs-tui/51938887#51938887 |
09:38:44 | FromGitter | <mratsim> resetLoc shouldn’t be used for seq/string/ref that are properly initialized within the proc body. |
09:38:58 | FromGitter | <mratsim> i.e. when the compiler can prove that they are not nil? |
09:41:18 | Araq | the only noInit that you need is here |
09:41:19 | Araq | proc splitBinary(orig: Node, value: int32): (Node, Node) {.noinit.} |
09:45:40 | FromGitter | <mratsim> right, confirmed on my machine. I have to check why I need to sprinkle it everywhere in arraymancer, I never return nil. |
09:46:35 | Araq | it's indeed genericReset |
09:46:53 | Araq | which is avoided for pure 'ref's but not much else... |
09:46:58 | FromGitter | <mratsim> or maybe it’s containers |
09:47:08 | FromGitter | <mratsim> I see, well seq are impacted badly |
09:56:38 | * | TheLemonMan joined #nim |
10:04:25 | endragor | ha - "[GC] cannot register global variable; too many global variables", and the limit is hardcoded... |
10:04:41 | FromGitter | <ZarsBranchkin> How big is the limit? |
10:05:22 | endragor | 3499 (interesting number btw). It's quite reachable, if you use `unittest` module in a large project. |
10:06:41 | endragor | 3500 in fact |
10:07:51 | FromGitter | <ZarsBranchkin> How exactly you hit it? All tests in one file or what |
10:12:21 | * | Vladar joined #nim |
10:12:29 | Araq | endragor: unittest should introduce helper procs but you can also do that |
10:12:33 | PMunch | Why is there a limit? |
10:13:23 | endragor | ZarsBranchkin: there is a main file which imports modules with test suites. The limit is not per-module, but per-project. |
10:13:38 | Araq | the GC cannot use 'seq' internally as seqs are GC'ed |
10:14:15 | endragor | Araq: could it use manually-managed dynamic array? |
10:14:46 | Araq | sure but the limit is fine, we need to fix unittest |
10:15:12 | FromGitter | <ZarsBranchkin> I don't see the limit bad as well, you don't really want to have packed global scope anyway |
10:15:40 | Araq | proc helper() {.gensym.} = testBody |
10:15:41 | FromGitter | <ZarsBranchkin> But that is annoying that unittest runs into such problem |
10:15:44 | Araq | helper() |
10:15:52 | Araq | somewhere in unittest.nim would do the job |
10:31:12 | * | SenasOzys__ quit (Ping timeout: 272 seconds) |
10:31:50 | * | SenasOzys quit (Ping timeout: 272 seconds) |
10:31:51 | * | SenasOzys__ joined #nim |
10:35:58 | * | SenasOzys joined #nim |
10:42:13 | * | Tux26 joined #nim |
10:42:45 | FromGitter | <gogolxdong> How to express a or b notin c? |
10:45:14 | * | Tux26 quit (Remote host closed the connection) |
10:46:13 | FromGitter | <gogolxdong> a notin c and b notin c? |
10:49:10 | Araq | c * {a, b} == {} |
10:52:14 | FromGitter | <gogolxdong> if a,b,c is string |
11:21:53 | TheLemonMan | data-man, I've just added a brief mode that's IMO nicer than tabulated output |
11:24:20 | * | Vladar quit (Remote host closed the connection) |
11:24:44 | * | Vladar joined #nim |
11:31:04 | FromGitter | <data-man> @TheLemonMan: Nice! But I dream about more formatters: markdown, rst, html, ... :) |
11:35:49 | TheLemonMan | data-man, the idea is to export everything to csv and have a karax+d3 based app to show pretty graphs :) |
11:38:19 | FromGitter | <data-man> Oh! I like libs without other depedencies :( |
11:41:31 | TheLemonMan | I'm more a "do one thing and do it well" guy heh |
11:43:25 | * | dadabidet quit (Quit: Leaving) |
11:44:19 | stefanos82 | TheLemonMan: the UNIX philosophy, hm? |
11:46:40 | FromGitter | <mratsim> @TheLemonMan, I’m thinking on creating a Vega library on top of Arraymancer, check Vega it seems great: https://vega.github.io/, and this video at 19:27 - https://youtu.be/GdoDLuPe-Wg?t=1167 |
11:55:42 | * | SenasOzys quit (Ping timeout: 260 seconds) |
11:56:12 | * | SenasOzys__ quit (Ping timeout: 268 seconds) |
12:04:01 | * | dddddd joined #nim |
12:07:23 | * | SenasOzys joined #nim |
12:07:36 | * | SenasOzys__ joined #nim |
12:29:18 | * | xet7 joined #nim |
12:32:25 | FromGitter | <mratsim> was there like +5 backers in the past month? https://github.com/nim-lang/Nim#backers |
12:32:45 | * | seni joined #nim |
12:35:06 | TheLemonMan | mratsim, that's nice, thanks for the link |
12:36:23 | FromGitter | <mratsim> polestar would be the equivalent to Tableau |
12:36:39 | FromGitter | <mratsim> (Tableau was codenamed Polaris in the early days apparently) |
12:37:47 | TheLemonMan | a ggplot-inspired library written in Nim would also be nice to have |
12:38:33 | dom96 | https://nim-lang.org/sponsors.html |
12:43:25 | euantor | I stopped sponsoring because I didn't want to support Bounty SOurce anymore and never knew there was an OpenColelctive. Guess I'll sign back up now :) |
12:46:47 | yglukhov[m] | Araq: what do you think about the `--experimental:forLoopMacros` problem? are you aware of it? cc @mratsim |
12:47:14 | FromGitter | <mratsim> @yglukhov, we discussed it in the Status slack ;) |
12:47:56 | yglukhov[m] | o rly. let me find it... |
12:48:43 | FromGitter | <mratsim> we will have the same issue if we depend on `—experimental:notnil`, report here: https://github.com/nim-lang/Nim/issues/8691 and https://github.com/nim-lang/Nim/issues/8676 |
12:49:34 | FromGitter | <mratsim> putting the flag in a nim.cfg contaminates building `koch` for csources during CI. |
12:49:59 | FromGitter | <mratsim> alternative is to always use `nimble test` and put the switch in the corresponding task |
12:50:25 | FromGitter | <mratsim> it makes developing a bit more annoying because you have to remember to have your own nim.cfg with the flag on |
12:50:27 | yglukhov[m] | imo, `nim.cfg` doesn't even have to be considered as a solution to this problem. merely a workaround. |
12:51:08 | FromGitter | <mratsim> the main issue is that {.experimental:Foo.} doesn’t work properly for macro with generics input |
12:52:05 | FromGitter | <mratsim> well, it’s not that it doesn’t work, but that it’s required at all places that call the macro or a generic proc that uses the macro |
12:52:42 | * | arlen joined #nim |
12:52:59 | FromGitter | <mratsim> see here and the next 2 replies: https://github.com/nim-lang/Nim/issues/8676#issuecomment-413989546 |
12:53:41 | PMunch | Hmm, given a series of consecutive IDs ranging from 1 to highestID. How can I create all unordered sets containing up to N items without repetition? |
12:53:46 | PMunch | Anyone got any clever ideas? |
12:54:32 | FromGitter | <mratsim> nCk? |
12:55:14 | FromGitter | <mratsim> https://en.wikipedia.org/wiki/Binomial_coefficient |
12:56:00 | FromGitter | <mratsim> I think Rust has a macro called cartesian_product that almost does what you need (it’s not up to N it consumes all values) |
12:56:03 | PMunch | Ah yes |
12:56:35 | FromGitter | <mratsim> Python also has itertools.product it seems |
12:56:50 | PMunch | Basically I want to iterate over all the possibilities, so I don't need to actually create a list of these |
12:57:27 | * | arlen quit (Remote host closed the connection) |
13:00:24 | PMunch | Python's product doesn't seem to be unordered |
13:00:50 | PMunch | ie. product('ABCD', repeat=2) would produce both AB and BA |
13:01:41 | PMunch | It also has combinations though, which seems to be what I want |
13:01:52 | PMunch | AB AC AD BC BD CD |
13:03:31 | PMunch | To generate up to N I could just run it with increasing numbers |
13:05:52 | * | noonien joined #nim |
13:10:16 | * | cryptocat1094 joined #nim |
13:12:48 | FromGitter | <mratsim> then look into the difference between cartesian combinations and permutations |
13:13:02 | FromGitter | <mratsim> nCk vs nPk or nCr vs nPr I don’t remember |
13:13:23 | PMunch | I think I found something I can use |
13:13:33 | PMunch | https://web.archive.org/web/20120213125655/http://www.merriampark.com/comb.htm |
13:17:42 | * | lucy_ joined #nim |
13:19:16 | FromGitter | <data-man> @PMunch ⏎ Something like this? ⏎ ⏎ ```import algorithm ⏎ echo product([@['A', 'B'], @['A', 'B']])``` [https://gitter.im/nim-lang/Nim?at=5b7c115338a12915e4d63c42] |
13:21:17 | PMunch | Not quite |
13:21:25 | PMunch | I need it without duplicates and without ordering |
13:21:37 | PMunch | The input AB only has one possibility AB |
13:21:47 | PMunch | ABC has AB, AC, and BC |
13:22:00 | PMunch | ABCD has AB AC AD BC BD CD |
13:22:26 | * | lucy_ quit (Remote host closed the connection) |
13:27:47 | * | endragor quit (Remote host closed the connection) |
13:29:24 | FromGitter | <data-man> https://bitbucket.org/nimcontrib/nimcombinatorics/src |
13:29:35 | FromGitter | <data-man> @PMunch ^ |
13:31:08 | FromGitter | <ephja> will non-ordinal type discriminators never be supported? I'm trying to implement zero-cost abstractions for interfacing with C again |
13:32:21 | FromGitter | <mratsim> you mean object variant? |
13:33:16 | PMunch | data-man: ah that's what I was looking for |
13:33:57 | PMunch | Or well, optimally it would return me a set |
13:34:07 | PMunch | But I can work with this :) |
13:36:19 | FromGitter | <ephja> @mratsim yes, but I think that acceptable workarounds exist |
13:38:02 | FromGitter | <mratsim> No I meant, what does a non-ordinal type discriminator look like, it it like an object variant (with the discriminator being say an enum with holes or that start with negative value) |
13:39:09 | TheLemonMan | data-man, #7867 is fixed, rejoice! :D |
13:42:01 | * | nsf quit (Quit: WeeChat 2.2) |
13:43:20 | FromGitter | <data-man> @TheLemonMan I love you! :-D |
13:44:54 | FromGitter | <ephja> @mratsim oh. yes, object variants with discriminators containing holes. The usual C business |
13:45:37 | * | endragor joined #nim |
13:49:34 | FromGitter | <mratsim> I’m pretty sure there was a regression open on that |
13:49:40 | * | PrimHelios joined #nim |
13:50:18 | * | endragor quit (Ping timeout: 260 seconds) |
13:53:09 | FromGitter | <mratsim> sorry I’m confusing with sets, see https://github.com/nim-lang/Nim/issues/8340, you can use a macro to fill holes: https://github.com/status-im/nimbus/blob/master/nimbus/vm/interpreter/utils/macros_gen_opcodes.nim#L25 @ephja |
13:54:19 | FromGitter | <mratsim> and see discussion here: https://github.com/nim-lang/Nim/pull/8264 |
13:55:33 | FromGitter | <ephja> right. that complicates the interface though and isn't feasible for large holes |
14:04:02 | FromGitter | <ephja> having separate type classes for distinguishing between enums and discriminators with and without holes at compile time seems like a good solution to this problem, but manpower remains a scarce resource ;) |
14:07:40 | Araq | enums with holes should be mapped to 'distinct int' or similar |
14:08:06 | Araq | Nim has enough features to model everything in a pretty precise way |
14:09:21 | * | Hijiri28 joined #nim |
14:10:42 | * | Hijiri28 quit (Remote host closed the connection) |
14:14:33 | FromGitter | <ephja> that is an improvement over plain integer constants, but a worse improvement than is theoretically possible :-P |
14:15:58 | FromGitter | <xmonader> Guys, are there any notes on day 11? something vague, or difficult? something can be better? I think the path calculation can be better using a stack instead of parentMap table .. |
14:16:52 | FromGitter | <ephja> but I'm going to have a go at some improvements involving metaprogramming (yes, really!). I think there are decent solutions |
14:21:06 | * | PMunch quit (Quit: Leaving) |
14:30:29 | FromDiscord | <awr> i've been thinking of trying to make bindings for apple's WebGPU |
14:30:34 | FromDiscord | <awr> for nim |
14:31:34 | * | salewski joined #nim |
14:32:42 | FromGitter | <ephja> Yep, a flag type still seems like a good idea. sure, you can have sets with large values (usually because of enums with holes), but the memory usage is going to explode |
14:33:24 | FromGitter | <mratsim> @awr, is it even used, the only project I know that uses it is a deep learning project: https://github.com/mil-tokyo/webdnn but only being able to run on Safari is a bit meh |
14:34:26 | * | salewski quit (Client Quit) |
14:52:45 | FromGitter | <Clyybber> Araq what makes https://github.com/nim-lang/Nim/issues/7816 so tough to fix? |
14:53:09 | FromGitter | <Clyybber> Or where does the problem stem from? |
14:54:50 | * | ftsf quit (Ping timeout: 244 seconds) |
14:54:55 | Araq | I don't remember, sorry :-) |
14:55:15 | FromGitter | <Clyybber> ok no problem |
15:02:39 | FromDiscord | <awr> @mratsim WebGPU is a draft proposal and is the only one with any (publicly available) implementation |
15:02:46 | FromDiscord | <awr> there's a few other ones |
15:04:52 | FromDiscord | <awr> IMO the Obsidian one looks better https://github.com/KhronosGroup/WebGLNext-Proposals/tree/master/Obsidian-Mozilla as it seems WebGPU is missing a few things (there doesn't appear to be a device object apparatus in WebGPU like VkDevice or ID3D12Device and if I'm not mistaken resembles the OpenGL way of going about things) |
15:05:25 | FromDiscord | <awr> but AFAIK there is no implementation of it |
15:06:12 | FromDiscord | <awr> https://github.com/KhronosGroup/WebGLNext-Proposals/tree/master/Obsidian-Mozilla#screen-clear this resembles Vulkan a lot |
15:07:05 | FromDiscord | <awr> plus i don't think WebGPU uses SPIR-V which is 😐 |
15:07:40 | FromGitter | <mratsim> I’m fine with Vulkan-like stuff, Apple has a very annoying tendency of not supporting standards it pushed in the long run: OpenCL, OpenGL, Webkit |
15:08:26 | Araq | can we please stop turning the browser into an OS. ugh. wasm, webGPU |
15:08:28 | FromGitter | <mratsim> I also remember the fight to get hardware accelerated h264 working on Mac on 3rd party applications ... |
15:08:56 | FromGitter | <mratsim> Tell that to Chromebooks and FirefoxOS ;) |
15:09:30 | Araq | these are all far worse than even Posix is. |
15:09:32 | FromGitter | <mratsim> oh, and Electron ugh |
15:09:40 | FromDiscord | <awr> @Araq have you seen this https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript |
15:09:55 | Araq | awr: yes. it's pretty old. |
15:12:49 | livcd | looks like an irreversible process |
15:19:18 | FromGitter | <ephja> run! |
15:29:06 | * | endragor joined #nim |
15:32:28 | * | endragor quit (Remote host closed the connection) |
15:41:58 | * | tiorock joined #nim |
15:42:00 | * | tiorock quit (Changing host) |
15:42:00 | * | tiorock joined #nim |
15:42:00 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
15:42:00 | * | tiorock is now known as rockcavera |
15:46:21 | * | CompanionCube26 joined #nim |
15:46:32 | * | shadowbane quit (Read error: Connection reset by peer) |
15:48:28 | * | CompanionCube26 quit (Remote host closed the connection) |
15:48:52 | * | shadowbane joined #nim |
15:57:17 | * | shadowbane quit (Quit: Konversation terminated!) |
15:57:36 | * | shadowbane joined #nim |
15:58:14 | * | shadowbane quit (Client Quit) |
15:58:33 | * | shadowbane joined #nim |
16:00:34 | FromGitter | <arnetheduck> in nim csources, there's both a `build.sh` and a `makefile` - why both (on unix) / why is `build.sh` preferred? technically, a makefile could for example be used to parallelize initial build |
16:03:42 | * | cspar quit (Ping timeout: 272 seconds) |
16:14:17 | dom96 | A long time ago the Nim c sources contained only a build.sh file |
16:14:31 | dom96 | Then somebody came along and said "I ran make and it failed, I'm so used to that, you should have a makefile!" |
16:14:45 | dom96 | So they created a PR and it was merged |
16:14:55 | FromGitter | <kaushalmodi> I think that just a Makefile should suffice |
16:15:03 | dom96 | Since then the presence of both files has confused many |
16:16:31 | FromGitter | <kaushalmodi> Btw seems like it's mostly me talking about Nim on Mastodon. Folks there should use the #nim tag for more visibility |
16:19:29 | dom96 | I guess I should set up a nim-lang mastodon account and somehow mirror Twitter there |
16:20:26 | FromGitter | <kaushalmodi> dom96: Yes |
16:21:08 | FromGitter | <kaushalmodi> mastodon.technology instance has a nice tech-focused crowd |
16:38:53 | * | SenasOzys quit (Ping timeout: 260 seconds) |
16:39:28 | * | SenasOzys__ quit (Ping timeout: 260 seconds) |
16:41:12 | * | druonysus joined #nim |
16:41:13 | * | druonysus quit (Changing host) |
16:41:13 | * | druonysus joined #nim |
16:43:40 | TheLemonMan | dom96, are you able to reproduce #8211? |
16:45:45 | dom96 | Nope, looks like it's fixed |
16:45:56 | dom96 | Wanna make a PR to add it as a test case? |
16:59:05 | shashlick_ | Use tissue |
17:01:25 | shashlick_ | Super easy to make an issue snippet into a test case |
17:03:35 | * | ng0 quit (Remote host closed the connection) |
17:04:11 | * | SenasOzys joined #nim |
17:04:24 | * | SenasOzys__ joined #nim |
17:06:12 | * | Taylor_ joined #nim |
17:09:46 | * | PrimHelios quit (Ping timeout: 260 seconds) |
17:10:22 | * | zachk joined #nim |
17:11:34 | * | zachk quit (Changing host) |
17:11:34 | * | zachk joined #nim |
17:19:04 | * | ng0 joined #nim |
17:29:20 | * | sz0 joined #nim |
17:31:36 | * | NimBot joined #nim |
17:40:55 | * | stefanos82 quit (Quit: Quitting for now...) |
17:44:14 | * | nsf joined #nim |
18:06:08 | * | vivus joined #nim |
18:21:31 | * | PMunch joined #nim |
18:23:47 | PMunch | Uhm why am I getting "Error: unhandled exception: n < 21 43 is too large to look up in the table [AssertionError]" when running fac? |
18:23:57 | PMunch | It appears to calculate things in math.nim |
18:26:57 | FromGitter | <mratsim> fac is recalculated up to 20 |
18:27:03 | FromGitter | <mratsim> precalculated |
18:27:08 | FromGitter | <mratsim> more will overflow |
18:28:47 | FromGitter | <mratsim> factorial 43 is 60415263063373835637355132068513997507264512000000000 |
18:28:55 | PMunch | Ah, that makes sense.. |
18:29:02 | FromGitter | <mratsim> ~6.10^52 |
18:30:58 | PMunch | I was trying to calculate factorial(43/(10*factorial(42 - 10)) |
18:31:06 | PMunch | No wait |
18:31:33 | PMunch | factorial(43)/(factorial(10)*factorial(42 - 10)) |
18:32:17 | FromGitter | <mratsim> https://github.com/numforge/number-theory/blob/master/src/combinatorics.nim#L4-L7 |
18:33:08 | FromGitter | <mratsim> binomialCoeff(43, 10) should give you the result |
18:34:11 | * | Jesin quit (Quit: Leaving) |
18:34:32 | Araq | yeah, don't use the primitive definition to compute binom() |
18:35:01 | PMunch | I copied that code from somewhere else |
18:35:21 | PMunch | And thanks for the procedure mratsim, it works wonders :) |
18:36:44 | PMunch | I think I might have to find a better way to compute this though :P |
18:37:32 | * | Connor[m]1 quit (*.net *.split) |
18:37:32 | * | endes[m] quit (*.net *.split) |
18:37:32 | * | Miguelngel[m] quit (*.net *.split) |
18:37:32 | * | opi quit (*.net *.split) |
18:37:32 | * | zahary_ quit (*.net *.split) |
18:37:33 | * | dashed quit (*.net *.split) |
18:37:33 | * | dvn quit (*.net *.split) |
18:37:33 | * | Elronnd quit (*.net *.split) |
18:37:33 | * | vqrs quit (*.net *.split) |
18:37:33 | FromGitter | <mratsim> what do you want to compute in the end? |
18:37:41 | * | zahary_ joined #nim |
18:37:48 | * | opi- joined #nim |
18:37:56 | * | dashed joined #nim |
18:38:20 | PMunch | The optimal list of N ingredients to make the most IBA cocktails |
18:38:35 | * | Miguelngel[m] joined #nim |
18:38:55 | PMunch | This is what I've got so far: http://ix.io/1kSw |
18:39:15 | * | Connor[m]1 joined #nim |
18:39:16 | * | endes[m] joined #nim |
18:39:21 | PMunch | drinks.toml: http://ix.io/1kSx |
18:39:34 | TheLemonMan | isn't this a knapsack problem? |
18:39:42 | PMunch | ingredients.toml: http://ix.io/1kSy |
18:39:57 | * | elronnd joined #nim |
18:40:16 | PMunch | Hmm, kinda |
18:40:36 | PMunch | But how do you weight the items? |
18:40:48 | * | elronnd is now known as Elronnd |
18:41:17 | federico3 | it's not knapsack |
18:42:02 | TheLemonMan | I don't know what IBA is but I assumed it has to do with the most alchool you can cram in a glass :) |
18:42:16 | * | TheManiac[m] quit (*.net *.split) |
18:42:16 | * | xomachine[m] quit (*.net *.split) |
18:42:16 | * | toofly[m] quit (*.net *.split) |
18:42:18 | federico3 | TheLemonMan: it's not |
18:42:39 | FromGitter | <dlutton> definitely not knapsack |
18:42:40 | PMunch | https://en.wikipedia.org/wiki/List_of_IBA_official_cocktails |
18:42:49 | PMunch | It's the International Bartenders Association |
18:43:12 | TheLemonMan | oh, I see |
18:43:41 | * | xomachine[m] joined #nim |
18:43:42 | * | TheManiac[m] joined #nim |
18:43:54 | * | toofly[m] joined #nim |
18:44:27 | * | d10n quit (Ping timeout: 240 seconds) |
18:46:08 | * | dvn joined #nim |
18:47:08 | * | vqrs joined #nim |
18:47:15 | * | d10n joined #nim |
18:47:25 | * | d10n quit (Changing host) |
18:47:25 | * | d10n joined #nim |
18:47:55 | TheLemonMan | so you want to compute the minimal set of ingredients that includes the most recipes (sets) as possible? |
18:48:33 | * | rockcavera quit (Remote host closed the connection) |
18:48:47 | FromGitter | <mratsim> @PMunch do you know if there is an optimal solution? Otherwise i would bruteforce my way through: https://github.com/Vindaar/nimnlopt |
18:49:48 | FromGitter | <mratsim> L-BFGS is a good algorithm to start with |
18:49:50 | PMunch | TheLemonMan, yes basically. I'm planning to add in things like ingredients you have, filtering out things like the "Miscellaneous" ingredients I have in my list, etc. |
18:50:10 | PMunch | mratsim, well what do you mean optimal? |
18:50:19 | PMunch | I guess there would be multiple equally good solutions.. |
18:50:46 | FromGitter | <mratsim> Or the go player in me would suggest Monte-Carlo Tree Search |
18:51:58 | PMunch | Hmm, so far it's 1% through the list of "Unforgettables" with 10 ingredients.. |
18:52:05 | FromGitter | <mratsim> optimal like, it’s a solved problem or can be considered solved (like the travelling salesman problem) |
18:52:27 | FromGitter | <mratsim> https://en.wikipedia.org/wiki/Travelling_salesman_problem |
18:52:50 | PMunch | Not sure TBH |
18:52:58 | PMunch | I haven't done a whole lot of research into the topic.. |
18:53:40 | FromGitter | <mratsim> I find your problem similar to N-Queens |
18:53:45 | TheLemonMan | you may gain some speed by parallelizing the checks |
18:54:09 | PMunch | TheLemonMan, oh yeah, for sure |
18:54:55 | TheLemonMan | but the search space is quite big, if you don't really need _the_ optimal solution you may try a random approach |
18:55:44 | TheLemonMan | maybe a genetic algorithm whose fitness function is based on the number of drinks that need a given ingredient |
18:57:57 | PMunch | Hmm, that could work.. |
18:57:59 | federico3 | PMunch: I'm pretty sure there are already lists like this for IBAs. Anyhow if you want a perfect solution you have to iterate over all possible N-out-of-M combinations |
18:58:35 | PMunch | federico3, oh yeah that's probably true. But really besides the point |
18:58:41 | PMunch | I want to have a general solution |
18:58:50 | PMunch | N-out-of-M is basically what I'm doing now |
18:59:23 | PMunch | I think with filtering random ingredients and running multi-threaded it won't be as bad |
18:59:28 | federico3 | otherwise you could sort the M possible ingredients based on how many cocktails you can make with them, then pick the first K, with N < K < M and do combinations only on those |
19:01:24 | PMunch | Yeah I thought about something like that |
19:04:36 | FromGitter | <mratsim> You should look into Monte-Carlo Tree Search. It will always give you the best solution given the time budget you give it, and it converges to the optimal solution. |
19:04:36 | * | Jesin joined #nim |
19:04:59 | PMunch | Hmm, that is interesting |
19:05:46 | FromGitter | <mratsim> Your problem looks very similar to Multi-Armed Bandit https://en.wikipedia.org/wiki/Multi-armed_bandit ⏎ ⏎ > In probability theory, the multi-armed bandit problem (sometimes called the K-[1] or N-armed bandit problem[2]) is a problem in which a fixed limited set of resources must be allocated between competing (alternative) choices in a way that maximizes their expected gain, when each choice's properties are only |
19:05:46 | FromGitter | ... partially known at the time of allocation, and may become better understood as time passes or by allocating resources to the choice. |
19:06:45 | FromGitter | <mratsim> (Go is a multi-armed bandit problem and Monte-Carlo Tree Search brought lots of improvement to it) |
19:07:40 | PMunch | Hmm |
19:08:27 | FromGitter | <ephja> yay convergence! |
19:08:38 | FromGitter | <mratsim> if you’re looking for implementations there are several for tic-tac-toe in Python that you can just lift. |
19:09:20 | TheLemonMan | there's also this nice site/book on the topic http://banditalgs.com/ |
19:13:03 | FromGitter | <mratsim> @TheLemonMan, nice! The exercises sound fun |
19:13:27 | * | elrood joined #nim |
19:17:59 | TheLemonMan | mratsim, I sent a patch for #8706, can you give it a spin when you have some time? |
19:19:48 | TheLemonMan | the silly empty node was also bothering me to no end |
19:20:31 | Araq | any ideas what to do with .experimental? |
19:21:09 | Araq | I can only think of bad internal compiler complexity |
19:21:18 | * | Jesin quit (Quit: Leaving) |
19:21:48 | FromGitter | <mratsim> what happened? |
19:23:02 | Araq | mratsim: well you want .experimental to work across generic instantiations |
19:23:57 | FromGitter | <timotheecour> @araq are you talking about https://github.com/nim-lang/Nim/issues/8676 ? |
19:24:20 | Araq | yes |
19:24:41 | FromGitter | <mratsim> for now we cope, nimbus and stint are all green. But we have to use nimble switches. Nim.cfg leaking during CI is annoying. |
19:25:00 | Araq | oh yglukhov already found a nice solution. hmm |
19:25:19 | Araq | but that would only work for forLoopMacros |
19:26:21 | FromGitter | <timotheecour> so u also want `caseStmtMacros` right? |
19:26:31 | FromGitter | <mratsim> experimental macros are tricky with generics and it’s fine if there is a solution that only affect macros |
19:26:44 | FromGitter | <mratsim> now what about experimental: “NotNil”? |
19:29:44 | * | Vladar quit (Remote host closed the connection) |
19:32:25 | * | Jesin joined #nim |
19:33:40 | Araq | what about it? |
19:33:59 | * | xomachine[m] quit (*.net *.split) |
19:33:59 | * | Connor[m]1 quit (*.net *.split) |
19:33:59 | * | zielmicha[m] quit (*.net *.split) |
19:34:00 | * | subsetpark quit (*.net *.split) |
19:34:01 | * | JStoker quit (*.net *.split) |
19:34:10 | zachk | what does the var do in this procedure type signature? : proc events(pressed: var seq[sdl.Keycode]): bool = |
19:34:34 | * | xomachine[m] joined #nim |
19:34:39 | FromGitter | <timotheecour> u can modify `pressed` |
19:34:52 | * | subsetpark joined #nim |
19:34:54 | * | zielmicha[m] joined #nim |
19:36:35 | * | JStoker joined #nim |
19:37:02 | * | Connor[m]1 joined #nim |
19:38:14 | FromGitter | <mratsim> @Araq, are there corner cases for experimental “NotNil" |
19:38:41 | * | macsek1911[m] quit (Ping timeout: 255 seconds) |
19:39:11 | * | federico3 quit (*.net *.split) |
19:39:12 | * | SunDwarf quit (*.net *.split) |
19:39:12 | * | ltr_ quit (*.net *.split) |
19:39:12 | * | Calinou quit (*.net *.split) |
19:39:22 | zachk | does it modify the variable passed into the procedure, so the changes to it are accessible once the procedure returns? |
19:39:34 | * | Calinou joined #nim |
19:39:34 | * | SunDwarf joined #nim |
19:40:37 | * | macsek1911[m] joined #nim |
19:43:48 | FromGitter | <Varriount> zachk: It allows the original location of the variable to be redefined. |
19:44:22 | FromGitter | <Varriount> If you are familier with C or C++, it's roughly equivalent of passing a pointer to the stack location of the variable. |
19:45:24 | * | rockcavera joined #nim |
19:46:26 | * | skelett1 joined #nim |
19:46:38 | * | federico3 joined #nim |
19:48:23 | * | sz0 quit (Quit: Connection closed for inactivity) |
19:48:26 | * | skelett quit (Ping timeout: 256 seconds) |
19:48:27 | * | cow_2001 quit (Ping timeout: 256 seconds) |
19:49:37 | * | ltr_ joined #nim |
19:56:44 | * | arecaceae quit (Remote host closed the connection) |
19:57:03 | * | arecaceae joined #nim |
20:01:17 | * | cow_2001 joined #nim |
20:02:27 | FromGitter | <ephja> @mratsim I dunno, do the bugs qualify? :p |
20:11:12 | Araq | mratsim: probably. the problem is that we don't know if we flag the declaration site or the usages with .experimental |
20:11:26 | * | jeff_ joined #nim |
20:11:53 | * | jeff_ is now known as Guest4113 |
20:14:37 | * | livcd_ joined #nim |
20:15:02 | * | Rush joined #nim |
20:17:10 | * | shodan45_ joined #nim |
20:18:23 | * | qwertfisch_ joined #nim |
20:19:27 | * | dddddd quit (*.net *.split) |
20:19:28 | * | qwertfisch quit (*.net *.split) |
20:19:28 | * | shodan45 quit (*.net *.split) |
20:19:28 | * | gangstacat quit (*.net *.split) |
20:19:29 | * | RushPL quit (*.net *.split) |
20:19:29 | * | livcd quit (*.net *.split) |
20:24:06 | * | dddddd joined #nim |
20:24:57 | * | gangstacat joined #nim |
20:45:08 | * | Guest4113 quit (Quit: Page closed) |
20:48:43 | * | qwertfisch_ left #nim (#nim) |
20:49:49 | * | krux02 quit (Remote host closed the connection) |
20:50:28 | cow_2001 | if you import everything into the global namespace, how do you know which name belongs to which module? |
20:53:04 | shashlick_ | That's not required |
20:53:15 | * | cryptocat1094 quit (Quit: WeeChat 2.2) |
20:53:23 | PMunch | cow_2001, in the future? IDE tools |
20:54:49 | FromGitter | <mratsim> works already in VS code |
20:55:11 | cow_2001 | can I import like they do in Python? |
20:55:15 | FromGitter | <mratsim> yes |
20:55:18 | cow_2001 | cool! |
20:55:23 | FromGitter | <mratsim> from foo import nil |
20:55:30 | FromGitter | <mratsim> and you must qualify everything |
20:55:38 | FromGitter | <mratsim> but it breaks uniform call syntax |
20:56:16 | FromGitter | <mratsim> or just `import foo` and qualify when you want |
20:59:57 | * | smt joined #nim |
21:01:02 | FromGitter | <data-man> @Araq: https://github.com/nim-lang/Nim/pull/8718 Excuse me for delay, please! |
21:01:36 | * | qwertfisch joined #nim |
21:08:07 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
21:08:48 | * | qwertfisch joined #nim |
21:12:52 | * | data-man joined #nim |
21:15:41 | * | data-man quit (Client Quit) |
21:15:58 | * | data-man joined #nim |
21:17:44 | * | data-man quit (Client Quit) |
21:18:16 | * | data-man joined #nim |
21:18:43 | * | druonysus quit (Read error: Connection reset by peer) |
21:19:06 | * | seni quit (Quit: Leaving) |
21:19:37 | * | data-man quit (Client Quit) |
21:19:59 | * | nsf quit (Quit: WeeChat 2.2) |
21:44:48 | * | rockcavera quit (Remote host closed the connection) |
21:48:29 | * | PMunch quit (Remote host closed the connection) |
21:49:23 | FromGitter | <arnetheduck> @dom96, any preference between shell and makefile? I guess shell script could simply call make, for compatibility.. can't imagine a unix with shell and gcc but without makefile, so it shouldn't bring any incompatibilities |
21:50:17 | dom96 | shell is a POSIX standard. Can the same be said for makefiles? |
21:50:50 | dom96 | or at least, can we be sure that the makefile will be compatible with the same or more platforms as shell? |
21:50:57 | copygirl | I want to write an event system in a game, where any object could be fired as an event. |
21:51:00 | dom96 | This includes exotic things like Haiku |
21:51:49 | copygirl | For example, simply defining a `type MouseDownEvent* = object; position*: Point; button*: MouseButton` |
21:53:05 | copygirl | I would like to have two generic functions, ideally called as `MouseDownEvent.subscribe(HandleMouseDown)` and similar for `unsubscribe`. |
21:54:40 | copygirl | I was wondering if I could set things up in such a way that each concrete implementation of the generic function would come with its own sequence of handlers. Or well.. each pair. |
21:55:13 | copygirl | I rememebr the `Type.` thing being possible, though I don't remember how exactly. |
21:55:44 | dom96 | proc subscribe(self: typedesc, prc: proc ()) |
21:56:13 | copygirl | And I'm somewhat certain Nim is also able to do static members in a generic proc..? |
21:56:30 | dom96 | But doing it this way is a little misleading because you're not saving the handler inside the type |
21:56:43 | dom96 | You need an object to save these handlers into |
21:57:48 | * | elrood quit (Quit: Leaving) |
21:57:57 | copygirl | Something like `proc subscribe[T](self: typedesc[T], prc: proc(T))` wouldn't work? How do I tell the handler it must accept an argument of type T? |
22:03:07 | * | SenasOzys quit (Read error: Connection reset by peer) |
22:03:30 | * | SenasOzys joined #nim |
22:03:37 | * | SenasOzys__ quit (Ping timeout: 268 seconds) |
22:03:54 | * | SenasOzys quit (Remote host closed the connection) |
22:04:20 | * | SenasOzys joined #nim |
22:08:38 | * | rockcavera joined #nim |
22:16:30 | * | xet7 quit (Quit: Leaving) |
22:17:33 | FromGitter | <arnetheduck> yeah, it's part of posix: http://pubs.opengroup.org/onlinepubs/9699919799/ |
22:22:53 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
22:38:12 | copygirl | I would welcome any pointers regarding my questions. Please highlight me. I will be off for now. Thank you! |
22:41:31 | copygirl | https://github.com/nim-lang/Nim/issues/6406 <- Actually I did find this, so that's awesome! But some hints about creating a per generic implementation static field would be nice. |
22:45:11 | * | druonysus joined #nim |
22:45:12 | * | druonysus quit (Changing host) |
22:45:12 | * | druonysus joined #nim |
22:57:00 | * | and joined #nim |
22:59:02 | * | and quit (Remote host closed the connection) |
23:11:12 | * | casdr12 joined #nim |
23:14:12 | * | casdr12 quit (Remote host closed the connection) |
23:20:17 | * | cspar joined #nim |
23:29:07 | FromGitter | <ephja> is semantic highlighting implemented in any editor other than vim? |
23:38:13 | * | ftsf_ joined #nim |
23:42:25 | FromGitter | <rayman22201> semantic highlighting? do you mean syntax highlighting? Vim, Emacs, and VSCode all have working syntax highlighting for Nim. |
23:45:25 | * | zachk quit (Quit: Leaving) |
23:54:38 | FromGitter | <ephja> semantic syntax highlighting to be exact (per-variable highlighting, per-symbol type highlighting and so on) |
23:55:16 | FromGitter | <ephja> probably with the help of nimsuggest, unless some mad genius has created a viable alternative by now 😛 |