00:19:07 | giaco | I'm trying to use valgrind to spot memory leak. I'm compiling with --gc:arc, --debuginfo, -d:useMalloc, --stacktrace:on, and I'm running with valgrind --xtree-leak=yes (that implies --leak-check=full and --show-leak-kinds=all), but result file in kcachegrind shows location = UnknownFile??? right where my leak is |
00:21:06 | saem | hmm, does debuginfo imply linedir and more importantly whether linedir will help at all in this case? Maybe give that a go if it's easy to try? |
00:23:41 | giaco | saem: thanks, trying now |
00:26:15 | giaco | still UnknownFile/UnknownFn |
00:30:58 | * | ^Q-Master^ quit (Read error: Connection reset by peer) |
00:31:04 | * | Q-Master joined #nim |
00:34:29 | * | antranigv joined #nim |
00:35:47 | saem | The official docs on profile nim are old but supposedly you shouldn't need debug, stacktrace, or linedir. |
00:38:00 | saem | giaco: are you using any native libraries as part of your project? |
00:39:06 | giaco | saem: yes, and I'm trying to spot the nearest point in nim bindings that causes the leak |
00:40:54 | saem | I bet you do need debug symbols for this, and I wonder if perhaps you don't have those for the native libs? |
00:48:17 | giaco | saem: I should have them, yeah, let me double check first |
00:48:35 | giaco | (using -dbg packages from apt) |
00:50:35 | * | Gustavo6046_ joined #nim |
00:51:28 | giaco | yeah, I do have dbg packages installed |
00:52:34 | * | Gustavo6046 quit (Ping timeout: 272 seconds) |
00:53:11 | saem | Not sure quite what else to try but finding working examples and then extrapolating from there, sorry. Hopefully someone who's more familiar with it comes by soon. |
00:54:02 | giaco | saem: not related to my question, but I had to uninstall your nim plugin for vscode and fallback to the one from Zaitsev as I've figure out that it slowsly causes memory to fill up by opening many nimsuggests processes until vscode is closed |
00:55:25 | giaco | all I have to reproduce the issue is write code and press F6 to run, many hours later I have 16GB memory filled up my nimsuggests processes |
00:55:27 | saem | giaco: they both have the same issue, IIRC. In both cases you need to setup a "nim.project" in your workspace or folder settings and specify the nim files |
00:56:17 | * | Gustavo6046 joined #nim |
00:56:18 | giaco | saem: the one from Zaitsev doesn't seem to have it, checking with htop |
00:56:44 | saem | Oh, I wonder if the issue with the run command then. |
00:57:01 | saem | I basically never use that, so perhaps its related |
00:57:03 | * | Gustavo6046_ quit (Ping timeout: 260 seconds) |
00:59:02 | giaco | I've installed vscode just to learn nim, never used before, actually don't know anything else about it :D |
01:00:47 | * | Tanger joined #nim |
01:01:19 | saem | If you do get a chance to replicate it and don't mind grabbing a listing of the nimsuggest processes with their command line arguments, that would quickly give me an indication of what's up. |
01:02:15 | saem | It's possible that it loses track of the processes somehow, also the indexing operation is _not_ cheap. |
01:03:46 | giaco | saem: I will do, if that helps |
01:03:53 | giaco | just reinstalled it |
01:04:52 | saem | Mostly it tells me if it's the same thing file over and over again and maybe an idea of how far apart, a clue as to whether it's something high or low frequency that's creating them. |
01:15:36 | saem | hmm, I bet I know where the bug is already. :D |
01:25:40 | giaco | so far it seems different files, but just 20 minutes run. Damn, each nimsuggests is 692MB resident memory :D |
01:26:36 | saem | yeah, that's where the project setting makes a big difference, both extensions will assume each nim file is a project |
01:26:57 | saem | And they do an at startup scan of all nim files to build a type and file index. |
01:27:47 | giaco | it makes sense, actually |
01:28:04 | giaco | I do have many independent nim "playground" files, to experiment and learn |
01:33:31 | saem | Those can each be added to the project array or you can use project mapping., which uses pattern matching. |
01:33:48 | saem | I haven't used that at all and it's rather convoluted to be honest. |
01:42:48 | * | krux02 quit (Remote host closed the connection) |
01:44:51 | saem | giaco: what's your github handle if you don't mind me asking? |
02:09:04 | giaco | saem: https://github.com/arkanoid87 |
02:10:50 | * | abm quit (Quit: Leaving) |
02:19:25 | * | oculux quit (Ping timeout: 264 seconds) |
02:19:25 | * | actuallybatman quit (Ping timeout: 264 seconds) |
02:19:42 | * | actuallybatman joined #nim |
02:20:18 | * | oculux joined #nim |
02:21:20 | * | rockcavera joined #nim |
02:41:39 | leorize | saem: nope, I haven't looked closely at sem interactions with the VM |
02:42:21 | leorize | disruptek: have you figured out the cps issue? |
02:45:44 | saem | giaco: new release will be out in a few minutes, let me know how it goes. |
02:46:06 | saem | I'll keep an eye on it on my end, as well. |
02:47:34 | giaco | saem: now I have 3 processes open on different nim files. Basically just by doing "Go To Definition" it spawns a new one and 700MB are gone |
02:47:40 | saem | leorize: np, I think the issue might be how sem is done while in the macro context and less about the eval there after. |
02:49:03 | saem | giaco: if they're different files and as long as those match your nim.project setting or that setting is empty, then that's as expected. If they're for the same file, then that's a leak. |
02:52:21 | giaco | They are on different files, so I think that's the expected behaviour. On the other hand it is sufficient to open a dozen of nim files while tracking a bug to fill whole system memory |
02:52:38 | leorize | saem: I think you should standardize your nim.project thingy into the compiler config or nimble config so other tools/editors can use it too |
02:52:54 | leorize | (and maybe that will also pave the ground for one nimsuggest doing everything) |
02:53:43 | giaco | btw I'm not using nim.project, I just clicked on install and started pressing F6 and right click "go to declaration" |
02:53:47 | saem | leorize: cfg isn't the right place, there needs to be a higher level concept. But I do agree that's where it should live. |
02:55:01 | leorize | once I look into adding "package" as a concept to the compiler we can discuss that in details I suppose |
02:55:28 | leorize | sometimes I hate that it seems easier to write an implementation then pitch for it than writing an RFC |
02:56:18 | saem | It's both backwards and not. |
03:00:43 | saem | Right now I'm _trying_ to focus on sem and suggest for macros in particular. |
03:06:13 | * | lritter quit (Ping timeout: 264 seconds) |
03:06:57 | * | lritter joined #nim |
03:10:39 | giaco | if I close the tabs with open files, processes are still alive even for closed files |
03:16:14 | * | muffindrake quit (Ping timeout: 264 seconds) |
03:17:36 | saem | There is code to close nimsuggest files when you don't have nim.project defined, but it's not good at handling errors, so I'm guessing it's flaking out. Good news is that every invocation of nimsuggest will result in it doing that check to clean things up, so eventually it succeeds. |
03:17:45 | * | muffindrake joined #nim |
03:17:52 | saem | s/nimsuggest files/nimsuggest processes |
03:18:23 | saem | "good news" |
03:18:38 | leorize | I actually skip that in nim.nvim and no one seems to care :P might be because people don't run nvim for a really long time |
03:18:53 | giaco | yeah I do confirm that they close after some minutes |
03:19:09 | giaco | so what's important is to keep small number of open tabs |
03:20:21 | saem | or use project, which is what I do for compiler personally and I have goto def and suggest working for that code base. |
03:21:27 | leorize | does your project thingy have a defined semantics? I can hook that into nim.nvim for interop if it does |
03:22:10 | * | Tlangir joined #nim |
03:22:16 | * | Tanger quit (Read error: Connection reset by peer) |
03:22:42 | saem | leorize: I'm using the vscode config stuff. |
03:23:04 | leorize | is it json or json with comments? |
03:23:20 | leorize | if its the former then I can read just fine |
03:23:21 | saem | That's an example: https://github.com/saem/vscode-nim/blob/main/.vscode/settings.json |
03:23:49 | saem | I believe it is json with comments, I think there is a schema for it too, but whatever. |
03:24:10 | leorize | I'm definitely not gonna implement a parser in vimscript |
03:24:18 | saem | LoL, yeah no |
03:32:21 | leorize | I did have to write one, regrettably |
03:32:28 | leorize | for parsing Nim in reverse :P |
03:32:44 | leorize | allows this stuff so it's pretty cool: https://asciinema.org/a/RXbwCTJXGRKEhMRiHIUEoDGd7 |
03:32:44 | ForumUpdaterBot | New thread by 0x100: Help with Nim concurrency – data not persisted, see https://forum.nim-lang.org/t/7397 |
03:36:10 | * | zedeus joined #nim |
04:06:29 | leorize | disruptek: so I pushed some walkarounds to test my eventqueue impl, but it seems to me that result lifting for cps has some issues: https://github.com/alaviss/nim-sys/runs/1719141572?check_suite_focus=true#step:7:13 |
04:12:30 | leorize | btw, how can I get the return value from a non-cps proc? |
04:12:39 | leorize | or do I need a cps entry point? |
04:17:52 | * | spiderstew_ joined #nim |
04:18:29 | * | spiderstew quit (Ping timeout: 246 seconds) |
04:32:14 | * | vicfred quit (Quit: Leaving) |
04:32:46 | * | rockcavera quit (Remote host closed the connection) |
05:02:24 | disruptek | we haven't figured out the syntax for passing results around, but it's blocked anyway. |
05:03:27 | saem | wump wump |
05:04:31 | disruptek | i guess i still don't really have internet. |
05:04:34 | * | disruptek sighs. |
05:06:04 | saem | :( |
05:07:13 | leorize | disruptek: that means I will have to settle with a var param? |
05:13:25 | disruptek | no, but you need to track the results outside of .cps. -- there's no shim for `let x = someCpsCall()` for inside a cps proc. |
05:14:55 | disruptek | we have a discussion for this but disbot doesn't know how to find discussions yet. |
05:15:01 | disruptek | disbot: will you ever learn? |
05:15:02 | disbot | you may rely on it. |
05:16:02 | leorize | out of curiousity I added a var param, and it still doesn't work: http://ix.io/2MpS |
05:16:06 | disruptek | leorize: look at zevv's iterator for example, in stash |
05:17:05 | leorize | so the result type has to be in the continuation object |
05:17:11 | leorize | that's annoying |
05:17:34 | disruptek | var params are a separate problem with a separate discussion and zevv doesn't think we'll support them. i think we will, but maybe only for stack types, which would suck. |
05:17:58 | leorize | would views enable support for them? |
05:18:27 | disruptek | results? results are just a syntax and type eraser problem. |
05:18:38 | leorize | var params I mean |
05:18:59 | disruptek | i don't see how. |
05:19:14 | * | letto quit (Quit: Konversation terminated!) |
05:19:59 | leorize | since `var T` will then be a type that can be placed in the Env object? |
05:20:01 | disruptek | i think clyybber has to weigh in on this, too, because right now i believe we are stripping the ast we'd need for var params anyway. |
05:20:36 | disruptek | well, it's just [T] that goes in the env, because otherwise you have no idea what the return type of the result is. |
05:20:48 | disruptek | at least, this is how i implemented it by hand. |
05:20:59 | * | letto joined #nim |
05:21:20 | disruptek | look at my generic continuations concept in experiments/chain.nim to get a taste. |
05:21:46 | leorize | so you still has some of asyncdispatch problems in regards to signatures |
05:22:15 | disruptek | you mean, like `void`? |
05:22:47 | leorize | I want var params to work, that is |
05:23:00 | leorize | if they don't work then I only have pointers or ref T |
05:24:16 | disruptek | i mean, it's not a small ask. |
05:24:28 | disruptek | think about what it means. |
05:25:16 | disruptek | where exactly do we store your var params and how? |
05:25:53 | leorize | you can store it in Env and views get you free analysis |
05:26:05 | * | idf quit (Ping timeout: 240 seconds) |
05:27:01 | leorize | I can make do with pointers, they are just annoying when you want the experience between async and sync to be the same |
05:29:11 | disruptek | are you saying that even if you had results, you'd still need to use your own ptrs? |
05:29:47 | leorize | yes, see my `read()` proc, I read into a pre-allocated buffer and return how much I've read |
05:30:17 | disruptek | yeah, that's going to be pretty hard to do without views at least. |
05:30:56 | ForumUpdaterBot | New thread by Drkameleon: Portable binaries with Nim - what works?, see https://forum.nim-lang.org/t/7398 |
05:35:08 | leorize | I can probably walkaround by creating a `proc read(c: Cont, f: AsyncFile, b: var openArray[byte], read: var int): Cont` that calls the `proc read(f: AsyncFile, buf: pointer, size: int, read: ptr int) {.cps: Cont.}` behind the scene |
05:35:20 | leorize | there will be no escape analysis so safety is literally zero |
05:35:41 | disruptek | well yeah, because it escapes. |
05:36:06 | disruptek | i mean, if you pass a mutable buffer to me, i won't have a view on it by the end of the proc. |
05:36:22 | leorize | but given that it has to be called from cps, assuming the user have a buffer on the "stack", it will be safe 60% of the time :P |
05:36:33 | disruptek | so there's no way for cps to make control flow against it, since all control flow has to goto. |
05:39:07 | disruptek | maybe we're overthinking this. |
05:40:34 | disruptek | you invoke read() with a var param and we simply ignore it; don't add it to the env. |
05:41:14 | disruptek | then when the file is ready and we reach the ultimate cpsMagic call, we issue it with the var param. |
05:41:19 | disruptek | why doesn't that work? |
05:44:45 | leorize | mainly because I can't imagine it xd |
05:45:02 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:45:06 | leorize | can you describe it in a bit more details? |
05:46:26 | disruptek | well, your magic is a closure over the buffer. |
05:48:25 | leorize | but my magic is a wait() and it doesn't take a buffer? |
05:49:03 | disruptek | no, i mean the read itself. |
05:53:20 | leorize | still can't imagine it, sorry |
05:56:19 | saem | Why can't the env close over the var param? |
05:57:13 | disruptek | i think the magic invocations can but the continuations themselves are nimcalls. |
05:57:39 | saem | nimcalls you generate by morphing the existing AST? |
05:57:48 | disruptek | yeah. |
05:59:00 | saem | Let me noodle, it feels like it shouldnt' be a problem. |
05:59:25 | leorize | note that Nim's closure can't capture var params because of poor escape analysis |
06:01:57 | * | vicfred joined #nim |
06:03:45 | * | idf joined #nim |
06:04:29 | disruptek | imagine this code: cpsCall immutableInput: body for magic which is a closure we run to yield the result... |
06:04:38 | FromDiscord | <JSONBash> any tips on how to convert an object with a datetime to a string? the date field can be a string. example code: https://play.nim-lang.org/#ix=2MpZ |
06:15:24 | * | blueberrypie quit (Quit: leaving) |
06:16:10 | * | blueberrypie joined #nim |
06:22:58 | saem | The lack of escape analysis really butts it up. :D |
06:32:55 | saem | Ugh, i got a terrible idea and disruptek is going to hate it. But could var T captured by the continuation be given a colour wherein it becomes CpsWrappedVar[var T] and you use that to break type compatibility with it getting passed across an FFI boundary or something else nasty? |
07:12:13 | * | habamax joined #nim |
07:34:38 | FromDiscord | <pietroppeter> JsonBash: https://play.nim-lang.org/#ix=2Mqc |
07:35:26 | FromDiscord | <pietroppeter> (Object have a $ already defined, if you want a JSON you need to define % for DateTime) |
07:42:46 | FromGitter | <AllenDang> @pmutua Do you know how to convert a wxString to string? I've tried all the way I know but still doesn't work. I'm using ` var name = nameCtrl.getValue().cStr().asCString()` but it reports error `error: cannot initialize a variable of type 'NCSTRING' (aka 'char *') with an rvalue of type 'const char *'` |
07:44:47 | * | habamax_ joined #nim |
07:47:32 | * | habamax quit (Ping timeout: 256 seconds) |
07:50:18 | * | krux02 joined #nim |
07:50:24 | * | narimiran joined #nim |
07:53:30 | * | hoijui joined #nim |
08:03:11 | * | hoijui quit (Ping timeout: 246 seconds) |
08:12:08 | * | habamax_ quit (Quit: leaving) |
08:12:21 | * | PMunch joined #nim |
08:12:28 | * | habamax joined #nim |
08:51:42 | Araq | saem, we have "escape analysis" or rather "borrow checking" via the - er - unfinished view types feature |
08:51:54 | saem | Araq: debugging twithin_macro & twithin_macro_prefix (after the 1st call). twithin_macro_prefix works once, by way of processmodule:180 to processTopLevelStmts:73 & does the sem pass + suggestExprNoCheck. After it goes processmodule:189 & closes the pass, like twithin_macro. It's trying to sug on the unforgiving AST (not sugExprNoCheck)? A fix: note AST ranges as from macros and redo those, is that possible, alternatives? |
08:51:59 | saem | Haha, was writing that all along |
08:52:08 | PMunch | Hmm, this triggers a C compiler error: http://ix.io/2Mqq |
08:52:29 | PMunch | http://ix.io/2Mqr |
08:53:22 | saem | Probably could also hack some approximations with tags for a few narrow cases. |
08:55:19 | PMunch | It works if it is a ref object.. |
08:56:06 | saem | Just to explain the twithin_macro issues, seems like after the first eval of the macros in the prefix variety it falls back to the non-prefix version. Where the prefix version works is that the first time it does in fact do the sem pass for the partially written proc def inside the macro at 25:10. But the non-prefix one never goes to sem during sug, only happens during the initial compile for nimsuggest startup. |
09:00:16 | * | leorize[m]1 quit (Quit: Idle for 30+ days) |
09:00:21 | * | watzon quit (Quit: Idle for 30+ days) |
09:00:23 | * | xicheng[m] quit (Quit: Idle for 30+ days) |
09:00:24 | * | wontruefree[m] quit (Quit: Idle for 30+ days) |
09:01:30 | saem | Well, that's not entirely true, it does go into semStmt -> semExprNoType, but it doesn't seem to hit the sugExpr path. |
09:02:18 | Araq | saem, well you're now in the postion where you know more than me |
09:02:26 | saem | D'oh! |
09:02:29 | saem | :D |
09:02:36 | Araq | esp since my brain is doing something else |
09:04:42 | saem | Fair point. |
09:06:11 | PMunch | Araq, something like this doesn't work with the default GC because Foo is copied (and it shares strings and such across threads which isn't a great idea) http://ix.io/2Mqv |
09:06:33 | PMunch | But with --gc:arc it works fine, but is it safe to do things like that with ARC= |
09:06:58 | * | Vladar joined #nim |
09:13:46 | Araq | PMunch, looks ok to me |
09:14:11 | PMunch | So sharing strings like that in a globally shared table is fine under ARC? |
09:14:56 | Araq | pretty much, yeah, that's why we have ARC |
09:15:07 | PMunch | Holy shit, that's amazing! |
09:16:12 | PMunch | I've just been stoked for ARC because it's faster and I knew it would help multi-threading. But I didn't know it was that good! |
09:16:46 | PMunch | Will this work with ORC as well? |
09:16:51 | saem | OK, I think this is going to be a rest of the week problem. Apologies, if a rather significant PR shows up because of this, the solutions I'm thinking of right now aren't small -- hopefully I see something better in the next few days. |
09:17:40 | * | Tlangir quit (Quit: Leaving) |
09:28:03 | FromGitter | <AllenDang> Anyone know how to convert a wxString to string? I've tried all the way I know but still doesn't work. I'm using var name = nameCtrl.getValue().cStr().asCString() but it reports error error: cannot initialize a variable of type 'NCSTRING' (aka 'char *') with an rvalue of type 'const char *' |
09:28:47 | FromGitter | <AllenDang> I tried `var name = $nameCtrl.getValue().cStr().asCString()`, same error. |
09:29:01 | FromGitter | <AllenDang> And `let name = nameCtrl.getValue().cStr().asCString()`, same error. |
09:29:42 | FromGitter | <AllenDang> I'm trying to use wxnim to create GUI desktop app and stuck at string conversion now. |
09:31:02 | FromDiscord | <ElegantBeef> Pmunch might know |
09:31:36 | PMunch | Haha, I was actually just looking at that forum thread and I'm trying to remember how I did this |
09:32:00 | FromGitter | <AllenDang> @Pmunch thank god you sees this... |
09:32:17 | PMunch | There is an example that tried to echo out some text from a text-box, but it doesn't work any longer. I remember that I fixed it, but I must've forgotten to push that fix.. |
09:32:51 | FromGitter | <AllenDang> wxnim is the most beautiful wrapper for wxWidget, I'm eager to use it. |
09:40:59 | Araq | PMunch, for strings, yes, for cyclic data, no |
09:41:23 | PMunch | Aha, so don't share cyclic data across threads |
09:41:51 | Araq | don't say "share", say "send" |
09:42:20 | FromDiscord | <ElegantBeef> Also araq i showed my friend `scanTuple` and his first reaction was "why isnt i an option" 😄 |
09:42:22 | PMunch | Ah right |
09:42:25 | FromDiscord | <ElegantBeef> (edit) "i" => "it" |
09:42:28 | Araq | our non-atomic refcounts don't support sharing, only sending data around... :-) |
09:42:41 | FromDiscord | <ElegantBeef> So to option or not to 😛 |
09:42:52 | PMunch | I see, and sending a cyclic data structure causes weirdness? |
09:43:34 | Araq | no, that works too once some API was added |
09:44:29 | Araq | we need to ensure the cycle collector doesn't have registered roots, call GC_runOrc before sending |
09:44:59 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:45:01 | Araq | well, the API exists |
09:45:14 | PMunch | Ah, so it's not a fundamental issue |
09:45:31 | Araq | but in an ideal world the channel's send operation calls GC_runOrc for you |
09:53:14 | * | lritter quit (Quit: Leaving) |
09:57:15 | PMunch | Hmm, @AllenDang, I have found something that works now |
09:57:41 | FromGitter | <AllenDang> @PMunch Can't wait to know it! |
09:57:47 | PMunch | I'm using a TextCtrl for my testing |
09:58:53 | PMunch | And `echo myTextCtrl.getLineText(0).cStr.asCstring` doesn't work, but `var myStr = myTextCtrl.getLineText(0); echo myStr.cStr.asCstring` works just fine |
10:03:17 | FromGitter | <AllenDang> var name = nameCtrl.getValue() |
10:03:17 | FromGitter | <AllenDang> echo name.cStr().asCString() |
10:03:51 | FromGitter | <AllenDang> I got same error 'error: cannot initialize a variable of type 'NCSTRING' (aka 'char *') with an rvalue of type 'const char *' |
10:04:11 | * | jkiesian joined #nim |
10:04:17 | Araq | you need to tell your C++ compiler to be less picky |
10:04:25 | PMunch | Hmm, not sure why your rvalue things are `const char *`.. |
10:04:43 | PMunch | @AllenDang, do you have a minimal example? And what C++ compiler do you use? |
10:05:38 | FromGitter | <AllenDang> Error: execution of an external compiler program 'clang++ -c -std=gnu++14 -funsigned-char `wx-config --cppflags` -I/usr/local/Cellar/nim/1.4.2/nim/lib -I/Users/allendang/Desktop/nimtest -o /Users/allendang/.cache/nim/test_d/@mtest.nim.cpp.o /Users/allendang/. |
10:06:47 | FromGitter | <AllenDang> Compile with `nim cpp -r test.nim` |
10:07:10 | PMunch | Do you have test.nim? |
10:07:11 | FromGitter | <AllenDang> I'm using MacOS v11.1 |
10:07:46 | FromGitter | <AllenDang> http://ix.io/2MqJ |
10:08:12 | * | Tanger joined #nim |
10:08:25 | FromGitter | <AllenDang> Pleaes remove the `` in beginning and ending of the test code |
10:08:39 | PMunch | @AllenDang, that compiles and runs just fine for me.. |
10:08:53 | PMunch | So it is a C++ compiler strictness thing as Araq said |
10:09:06 | FromGitter | <AllenDang> Enter some text in name, and click button |
10:09:15 | PMunch | By the way you don't have to put the imports in string literals |
10:09:26 | PMunch | It outputs that name to the terminal |
10:09:31 | FromGitter | <AllenDang> I got () in terminal as echo's result... |
10:10:04 | Araq | you can usually tweak these things with more casting inside .importcpp pattersn though |
10:10:05 | PMunch | That's the same issue I got before I assigned it to a variable first |
10:10:33 | FromGitter | <AllenDang> http://ix.io/2MqK |
10:11:04 | FromGitter | <AllenDang> Should I create a nim.config and write something there? |
10:12:33 | Oddmonger | do you know a gui lib which could be integrated in my own SDL rendering ? I mean, i have already defined window and renderer, and don't want to use a context defined by the UI lib (so, no gtk UI, for example) |
10:15:20 | Oddmonger | i tried and installed imgui, but even the sample provided on README.md wasn't working |
10:21:49 | PMunch | @AllenDang, not quite sure how to fix this TBH |
10:22:22 | PMunch | The issue is that GCC is a bit more relaxed than clang when it comes to const char * -> char * conversions |
10:24:13 | FromGitter | <AllenDang> @PMunch I should try to use GCC instead of clang as compiler. |
10:24:32 | PMunch | That would definitely work as it is what I'm doing |
10:24:46 | PMunch | But it's unfortunate that this doesn't work with clang.. |
10:25:49 | Araq | Oddmonger, iirc 'nimx' uses SDL as the backend too so it would be a natural fit |
10:27:54 | FromGitter | <AllenDang> http://ix.io/2MqP |
10:28:18 | FromGitter | <AllenDang> I created a nim.cfg and set `cc = gcc`, seems it compiles with g++, but error remains. |
10:31:12 | Oddmonger | thank you Araq , it seems to fit to what i want |
10:32:47 | PMunch | @AllenDang, could you run `which gcc`? |
10:32:58 | PMunch | It might just be symlinked to clang on your system |
10:33:08 | PMunch | Or rather `which g++` |
10:33:16 | FromGitter | <AllenDang> http://ix.io/2MqU |
10:33:57 | FromGitter | <AllenDang> You got it. It is symlinked to clang. |
10:40:03 | * | abm joined #nim |
10:40:16 | FromDiscord | <apollo> oh wow the creator was here! |
10:40:32 | * | gangstacat quit (Quit: Ĝis!) |
10:40:38 | FromDiscord | <Rika> theyre often here |
10:40:50 | FromDiscord | <apollo> thats kl |
10:41:59 | FromGitter | <AllenDang> http://ix.io/2MqW |
10:42:15 | FromGitter | <AllenDang> I can confirm that gcc-10 is used, but error remains... |
10:43:09 | * | vicfred quit (Quit: Leaving) |
10:43:12 | PMunch | It uses `g++` though, not `gcc` |
10:43:17 | PMunch | Is that alias also updated? |
10:44:36 | FromGitter | <AllenDang> I will try now. |
10:45:32 | Araq | Rika: I'm still a single person, male, and not schizo |
10:45:51 | Araq | if you think "they" is the least offensive pronoun to pick... no. it's not. |
10:46:01 | FromGitter | <AllenDang> @PMunch ❯ which g++ |
10:46:01 | FromGitter | <AllenDang> g++: aliased to g++-10 |
10:46:01 | FromGitter | <AllenDang> ❯ g++ version |
10:46:01 | FromGitter | <AllenDang> g++-10: error: version: No such file or directory |
10:46:03 | FromGitter | <AllenDang> g++-10: fatal error: no input files |
10:46:06 | Araq | just fyi, I won't bring it up again |
10:46:06 | FromGitter | <AllenDang> compilation terminated. |
10:46:46 | FromGitter | <AllenDang> http://ix.io/2MqZ |
10:46:49 | PMunch | @AllenDang, `g++ --version` |
10:47:00 | FromGitter | <AllenDang> g++ is aliased to g++-10 |
10:47:10 | PMunch | Hmm, and it still doesn't work? |
10:47:15 | PMunch | That is strange |
10:47:22 | FromGitter | <AllenDang> Error remains |
10:47:39 | PMunch | I'm also using GCC 10.2 |
10:48:07 | PMunch | Wait, which WxWidgets version are you using |
10:48:23 | PMunch | `wx-config --version` |
10:49:15 | FromGitter | <AllenDang> 1) 1.4 |
10:49:48 | PMunch | Huh? |
10:53:25 | FromGitter | <AllenDang> Am i using a wrong version? |
10:53:43 | PMunch | Are you using version 1.4 of WxWidgets? |
10:54:20 | FromGitter | <AllenDang> brew tap andantissimo/wxmac |
10:54:25 | FromGitter | <AllenDang> brew install [email protected] --with-static |
10:54:31 | FromGitter | <AllenDang> This is how i install wxwidget |
10:54:46 | PMunch | Ah okay, so version 3.1 which is fairly new |
10:54:55 | PMunch | 1.4 would be from about 1997 :P |
10:54:56 | FromGitter | <AllenDang> Im using version 3.1.4 of wxwidgets |
10:55:03 | PMunch | Right :P |
10:55:24 | PMunch | I'm using 3.0.5, so it might be that it doesn't work on the 3.1 branch |
10:55:49 | FromDiscord | <Rika> araq force of habit my dude |
10:57:05 | FromGitter | <AllenDang> One solution comes in my mind is to create a cpp file which invoke strdup and returns a char * to do the conversion. |
10:57:18 | FromGitter | <AllenDang> But im not sure this is the right way to do. |
10:57:53 | PMunch | Oh there's definitely some hacks like that you can use |
10:58:08 | PMunch | I saw some references to strchr as well when I was looking around for a solution |
10:59:19 | FromGitter | <AllenDang> Thanks very much for your effort. Waiting for something comes from your side now. I'm new to nim. |
11:09:34 | PMunch | Did you try wxWidgets 3.0.5? That might be what's causing the bug to begin with.. |
11:16:34 | FromGitter | <AllenDang> Sure, I will try it now. |
11:18:36 | FromGitter | <AllenDang> http://ix.io/2Mrb |
11:18:43 | FromGitter | <AllenDang> No luck... Error remains. |
11:21:17 | PMunch | Hmm, then I'm out of ideas :( |
11:32:48 | FromDiscord | <dom96> > I'm still a single person, male, and not schizo |
11:33:05 | FromDiscord | <dom96> What does being “schizo” have to do with anything? |
11:33:22 | PMunch | Multiple personality disorder |
11:34:59 | FromDiscord | <ache of head> he's assuring you that he doesn't have any more descriptions like this. |
11:35:04 | FromDiscord | <dom96> Is schizophrenia a super set of multiple personality disorder? |
11:35:57 | * | gangstacat joined #nim |
11:36:41 | PMunch | No idea, but it is commonly associated with it |
11:50:32 | Zevv | nah, Ive seen schizoprhenia from very nearby in two good friends, and its nothing MPD related (in these cases anyway) |
11:51:05 | Zevv | it's hearing&seeing things, losing sense with reality and tons of paranoia and distrust of others |
11:54:20 | * | hoijui joined #nim |
11:58:41 | FromDiscord | <mratsim> @leorize, can you go over my proposal https://github.com/weavers-guild/weave-io/blob/master/design/design_2_continuations.md↵and my branch and check if having nim-sys CPS aware proc be suspend or coroutines is enough to have CPS support: https://github.com/disruptek/cps/tree/mratsim-public-api-proposal/mratsim↵↵This is a "high-level" API proposal for continuations. |
11:59:03 | * | hmmm joined #nim |
11:59:28 | Tanger | Heya folks, anyone know if there's a way to create a standard PEG file from the npeg library? |
12:00:49 | Tanger | ie with the standard grammar syntax and not the macrofied nim version. Just for documentation |
12:11:50 | PMunch | @Tanger, I'm not sure, don't think so. You can generate railway diagrams for documentation though. |
12:12:18 | PMunch | Try asking Zevv. But I think the issue is that NPEG isn't 100% compatible with normal PEG (but I might be wrong) |
12:12:24 | Tanger | @PMunch, railway diagrams are the ones like "command o────┬─[stdlib]" yeah? |
12:12:31 | PMunch | Yes |
12:13:03 | Tanger | Ah, I dig |
12:13:16 | Tanger | Well I got the railway and a dotfile from it, so that should be fine |
12:29:49 | Zevv | PMunch: there is no such thing as normal PEG |
12:32:38 | PMunch | Oh, I thought that was a specification of some kind |
12:32:47 | Tanger | @Zevv, So the PEG syntax definitions are just a general way of how to implement it? |
12:33:59 | Zevv | There was an initial implementation by Bryan Ford, but generally it's a "way" of doin things |
12:34:22 | Zevv | Ford used Packrat parsing, which is pretty classical and relies on memoization the whole input string |
12:34:30 | Zevv | it's pretty effective CPU wise, but eats a lot of memory |
12:34:57 | Zevv | NPEG is build on the ideas of Roberto Ierusalimschy (Author of Lua), but better |
12:35:17 | Zevv | The original Lua LPEG uses a VM, while NPEG actually compiles this VM into Nim code |
12:36:24 | Tanger | Wow, super cool |
12:37:23 | hmmm | dudes how do you validate a string date? I wrote an horrible 20 line kludge to do that but it strikes me there must be a simpler way :| |
12:38:10 | FromDiscord | <lqdev> Zevv: so the VM compiles to efficient machine code, almost as if i wrote a parser by hand? |
12:42:26 | hmmm | horrible kludge -> https://play.nim-lang.org/#ix=2Mry |
12:43:06 | ForumUpdaterBot | New question by Alex Craft: Nim template where early binding is not possible?, see https://stackoverflow.com/questions/65774708/nim-template-where-early-binding-is-not-possible |
12:43:31 | Zevv | lqdev: nope, if you think performance matters, write by hand |
12:43:45 | Zevv | NPeg used to be faster then stock Nim json parser, but it is no longer |
12:43:59 | Zevv | but it *is* pretty fast. |
12:44:05 | Zevv | check -d:npegExpand to see what is generated |
12:44:16 | FromDiscord | <lqdev> k, was just curious |
12:44:27 | * | jkiesian quit (Ping timeout: 256 seconds) |
12:46:55 | * | literal quit (Remote host closed the connection) |
12:47:03 | * | literal joined #nim |
12:49:14 | FromDiscord | <exelotl> what's the deal with packedsets, is it a rewrite of intsets? What changed? just better performance? |
12:49:37 | PMunch | Zevv, did the JSON parser get faster, or did NPEG get slower? |
12:50:30 | FromDiscord | <exelotl> ah I found the answer https://github.com/nim-lang/Nim/pull/15564 |
12:50:31 | disbot | ➥ Make IntSet a generic ordinal set PackedSet[A] + new module packedsets |
12:51:16 | Zevv | json got faster |
12:51:26 | FromDiscord | <mratsim> json plural |
12:51:31 | * | jkiesian joined #nim |
12:52:00 | FromDiscord | <mratsim> somehow 4 json implementations popped out in the past 2 months |
12:52:03 | FromDiscord | <mratsim> or was it 5? |
12:56:29 | * | hoijui quit (*.net *.split) |
12:56:30 | * | Gustavo6046 quit (*.net *.split) |
12:56:30 | * | crem quit (*.net *.split) |
12:56:30 | * | pbb quit (*.net *.split) |
12:56:30 | * | npgm quit (*.net *.split) |
12:56:30 | * | Jesin quit (*.net *.split) |
12:56:30 | * | Zoom[m] quit (*.net *.split) |
12:56:31 | * | sknebel quit (*.net *.split) |
12:56:31 | * | mahlon quit (*.net *.split) |
12:57:06 | * | tsujp1 quit (Ping timeout: 272 seconds) |
12:59:01 | * | dom96 quit (Ping timeout: 246 seconds) |
12:59:11 | * | hoijui joined #nim |
12:59:11 | * | Gustavo6046 joined #nim |
12:59:11 | * | crem joined #nim |
12:59:11 | * | pbb joined #nim |
12:59:11 | * | npgm joined #nim |
12:59:11 | * | Jesin joined #nim |
12:59:11 | * | Zoom[m] joined #nim |
12:59:11 | * | sknebel joined #nim |
12:59:11 | * | mahlon joined #nim |
12:59:45 | * | tsujp1 joined #nim |
13:01:13 | * | cvoxel joined #nim |
13:01:19 | * | Torro joined #nim |
13:01:22 | * | dom96 joined #nim |
13:01:23 | * | dom96 quit (Changing host) |
13:01:23 | * | dom96 joined #nim |
13:01:51 | * | rockcavera joined #nim |
13:02:41 | * | cadmium[m] quit (Ping timeout: 244 seconds) |
13:02:41 | * | Avatarfighter[m] quit (Ping timeout: 244 seconds) |
13:02:53 | * | dilawar_uchiha[m quit (Ping timeout: 258 seconds) |
13:02:56 | * | cmc[m] quit (Ping timeout: 240 seconds) |
13:02:58 | * | Avahe[m] quit (Ping timeout: 240 seconds) |
13:03:06 | * | Juno[m] quit (Ping timeout: 240 seconds) |
13:03:06 | * | Clonkk[m] quit (Ping timeout: 240 seconds) |
13:03:06 | * | k0mpjut0r quit (Ping timeout: 240 seconds) |
13:03:06 | * | VijayMarupudi[m] quit (Ping timeout: 240 seconds) |
13:03:08 | * | matthias[m] quit (Ping timeout: 240 seconds) |
13:03:08 | * | GitterIntegratio quit (Ping timeout: 240 seconds) |
13:03:09 | * | Zoom[m] quit (Ping timeout: 246 seconds) |
13:03:12 | * | stisa[m] quit (Ping timeout: 244 seconds) |
13:03:12 | * | planetis[m] quit (Ping timeout: 244 seconds) |
13:03:12 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
13:03:13 | * | j-james[m] quit (Ping timeout: 244 seconds) |
13:03:13 | * | vindaar[m] quit (Ping timeout: 244 seconds) |
13:03:14 | * | leorize[m] quit (Ping timeout: 244 seconds) |
13:03:14 | * | BitPuffin quit (Ping timeout: 244 seconds) |
13:03:17 | * | codic quit (Ping timeout: 258 seconds) |
13:03:17 | * | xigoi[m] quit (Ping timeout: 258 seconds) |
13:03:18 | * | lytedev[m] quit (Ping timeout: 258 seconds) |
13:03:18 | * | unclechu quit (Ping timeout: 258 seconds) |
13:03:25 | * | Kurre[m] quit (Ping timeout: 240 seconds) |
13:03:38 | * | silvernode[m] quit (Ping timeout: 264 seconds) |
13:03:39 | * | BauxnaMatrix[m] quit (Ping timeout: 258 seconds) |
13:03:39 | * | juanfra__ quit (Ping timeout: 258 seconds) |
13:03:43 | * | jaens[m] quit (Ping timeout: 244 seconds) |
13:03:45 | * | himup[m] quit (Ping timeout: 268 seconds) |
13:03:45 | * | MTRNord quit (Ping timeout: 268 seconds) |
13:05:29 | * | hmmm quit (Quit: WeeChat 2.8) |
13:07:06 | * | reversem3 quit (Ping timeout: 258 seconds) |
13:17:04 | * | cvoxel quit (Quit: back to work) |
13:19:18 | * | BitPuffin joined #nim |
13:20:09 | * | lnxw37d4 joined #nim |
13:20:10 | * | cvoxel joined #nim |
13:21:36 | * | xigoi[m] joined #nim |
13:22:01 | * | juanfra__ joined #nim |
13:23:29 | * | himup[m] joined #nim |
13:23:40 | * | cvoxel quit (Client Quit) |
13:24:11 | * | k0mpjut0r joined #nim |
13:24:30 | * | VijayMarupudi[m] joined #nim |
13:24:42 | * | jaens[m] joined #nim |
13:24:42 | * | hmmm joined #nim |
13:25:39 | * | Clonkk[m] joined #nim |
13:25:42 | Tanger | I've had great success with the npeg library so far Zevv, outstanding stuff! |
13:25:50 | * | Juno[m] joined #nim |
13:28:16 | Zevv | nice, I'll send out the bill today |
13:34:25 | * | k0mpjut0r quit (Ping timeout: 240 seconds) |
13:34:26 | * | BitPuffin quit (Ping timeout: 240 seconds) |
13:34:39 | * | himup[m] quit (Ping timeout: 246 seconds) |
13:34:42 | * | lnxw37d4 quit (Ping timeout: 258 seconds) |
13:34:43 | * | xigoi[m] quit (Ping timeout: 244 seconds) |
13:34:55 | * | Juno[m] quit (Ping timeout: 240 seconds) |
13:34:59 | * | Clonkk[m] quit (Ping timeout: 246 seconds) |
13:35:00 | * | jaens[m] quit (Ping timeout: 246 seconds) |
13:35:04 | * | VijayMarupudi[m] quit (Ping timeout: 260 seconds) |
13:36:40 | Tanger | XD |
13:39:31 | Tanger | While I remember, do you have an idea of what npeg's performance is like on the JS backend Zevv? |
13:40:11 | * | juanfra__ quit (Ping timeout: 260 seconds) |
13:40:12 | Tanger | I can't imagine the js version is anywhere near as optimized as C backend |
13:50:03 | * | Avahe[m] joined #nim |
13:50:11 | * | Kurre[m] joined #nim |
13:50:12 | * | cmc[m] joined #nim |
13:51:39 | * | cadmium[m] joined #nim |
13:51:39 | * | vindaar[m] joined #nim |
13:51:39 | * | j-james[m] joined #nim |
13:51:46 | * | stisa[m] joined #nim |
13:51:48 | * | planetis[m] joined #nim |
13:51:49 | * | Avatarfighter[m] joined #nim |
13:51:51 | * | leorize[m] joined #nim |
13:52:34 | * | BauxnaMatrix[m] joined #nim |
13:52:35 | * | dilawar_uchiha[m joined #nim |
13:52:35 | * | codic joined #nim |
13:53:19 | * | silvernode[m] joined #nim |
13:53:20 | * | Zoom[m] joined #nim |
13:54:39 | * | unclechu joined #nim |
13:55:48 | * | nyaa8 quit (Quit: byeee~) |
13:56:16 | * | matthias[m] joined #nim |
13:56:28 | * | MTRNord joined #nim |
13:59:34 | * | reversem3 joined #nim |
14:03:35 | FromDiscord | <hassel> sent a code paste, see https://play.nim-lang.org/#ix=2Ms0 |
14:04:01 | * | lnxw37d4 joined #nim |
14:05:15 | * | lytedev[m] joined #nim |
14:05:39 | * | jaens[m] joined #nim |
14:05:46 | * | BitPuffin joined #nim |
14:06:50 | * | juanfra__ joined #nim |
14:08:09 | * | k0mpjut0r joined #nim |
14:10:19 | * | himup[m] joined #nim |
14:10:23 | * | oculux quit (Ping timeout: 260 seconds) |
14:10:53 | * | xigoi[m] joined #nim |
14:13:03 | * | Clonkk[m] joined #nim |
14:13:42 | * | Juno[m] joined #nim |
14:16:10 | * | VijayMarupudi[m] joined #nim |
14:16:12 | * | Tanger quit (Remote host closed the connection) |
14:57:19 | * | habamax quit (Ping timeout: 246 seconds) |
14:58:54 | giaco | sqlite3 docs says that threading mode can be selected at start-time or at run-time, do you know how to do that in nim? https://sqlite.org/threadsafe.html |
14:59:05 | giaco | or how to know current mode, too |
14:59:26 | giaco | it says that "The default mode is serialized." but I'd like to check |
14:59:55 | FromDiscord | <mratsim> @giaco, you need to check the signature of https://sqlite.org/c3ref/config.html |
15:05:33 | * | jkiesian quit (Ping timeout: 256 seconds) |
15:06:46 | FromDiscord | <whisperdev> Can someone help me figure out how to compile fswatch? |
15:08:56 | Zevv | Tanger: I don't know what to compare it to |
15:08:56 | leorize[m] | mratsim: I don't understand delimited vs undelimited continuations |
15:11:07 | leorize[m] | mratsim: as far as your description of "resumable" go, it seems comparable to how I'm using cps in nim-sys |
15:19:19 | * | hmmm quit (Quit: WeeChat 3.0) |
15:26:09 | * | PMunch quit (Quit: leaving) |
15:26:49 | leorize | mratsim: so here is something that I feel like I should remind you about: readiness is only one form of "non-blocking" I/O |
15:27:11 | qwr | leorize[m]: i think that in delimited continuation a limited scope is captured, which can be invoked again |
15:28:13 | qwr | leorize[m]: or maybe more accuratly, its execution can be continued... |
15:30:26 | leorize | mratsim: on Windows, and probably Linux's io_uring (haven't read too closely on that one), completion notification based async I/O requires that the buffer you hold be "borrowed" by the operating system, but you will still keep ownership of it and such it can not be freed until the I/O operation is completed |
15:31:17 | leorize | from a memory safety standpoint, a stack-based buffer doesn't work here and it has implications for cross-platform apis |
15:31:19 | FromDiscord | <Clyybber> @hassel afaik its not implemented |
15:31:23 | FromDiscord | <mratsim> undelimited continuation capture the whole program while delimited only some scope is resumable |
15:31:56 | FromDiscord | <mratsim> undelimited means making any Nim program suspendable which seems a bit overkill |
15:32:26 | leorize | qwr: thanks |
15:32:42 | leorize | so I believe the current CPS system is delimited? |
15:32:51 | FromDiscord | <mratsim> The buffer for completion Io is separate from continuation frame |
15:32:54 | FromDiscord | <mratsim> yes |
15:33:22 | FromDiscord | <mratsim> I don't think there is any reason to look into undelimited continuation. |
15:33:49 | leorize | I don't mind, I think the current system can support me well, if it compiles, that is |
15:34:40 | leorize | wdym separated from the continuation frame? |
15:34:45 | FromDiscord | <mratsim> i.e. libraries are free to put their buffers on the heap or stack |
15:34:59 | qwr | afaik delimited ones are more powerful due composibility (with undelimited continuations any control structures built on them can be broken by raw undelimited continuations) |
15:35:28 | FromDiscord | <mratsim> and similarly, any scheduler requires the continuation frame on the heap, but iterators that are created and consumed in the same scope can be put on the stack |
15:36:08 | giaco | mratsim, do you mean manually importing that proc from c? |
15:36:13 | FromDiscord | <mratsim> I think delimited continuations are also easier to implement and to maintain/verify |
15:36:43 | FromDiscord | <mratsim> @giaco, the sqlite doc mentions that single-threading or multithreading mode is managed by the sqlite_config proc |
15:38:03 | giaco | mratsim, yes, and that function is not present in nim sqlite api, that's what I'm asking |
15:38:34 | leorize | mratsim: there has to be a way to prevent the buffer from being freed during the operation |
15:40:03 | FromDiscord | <mratsim> @giaco: https://github.com/arnetheduck/nim-sqlite3-abi/blob/master/sqlite3_gen.nim#L4308 |
15:40:30 | FromDiscord | <mratsim> @leorize, if you're continuation hold a ref to the buffer it won't be freed. |
15:41:37 | leorize | sure, though it does mean that I will have to do away with my dreams of openArray[byte]-only API :P |
15:41:43 | FromDiscord | <mratsim> We don't have the same problem as Rust with the GC for completionb ased APi (see https://github.com/weavers-guild/weave-io/blob/master/research/async_await_cancellation_rust_matthias247.md#support-for-io-completion-based-operations) |
15:42:24 | FromDiscord | <mratsim> you might be able to use openarray in struct? |
15:42:30 | giaco | mratsim, interesting. I wonder why it didn't show up when I searched exactly that signature on github |
15:42:36 | giaco | thanks |
15:42:43 | FromDiscord | <mratsim> it's a custom wrapper that we used at Status |
15:42:45 | * | narimiran quit (Quit: leaving) |
15:43:16 | FromDiscord | <mratsim> the high level wrapper is here: https://github.com/status-im/nim-eth/blob/master/eth/db/kvstore_sqlite3.nim |
15:43:34 | * | narimiran joined #nim |
15:44:03 | FromDiscord | <mratsim> @leorize it's quite important for me as well that IO avoids ref at all cost, or at least push that in the schedulers as they can go nuts with allocation or deal with their own memory pool |
15:44:09 | * | abm quit (Read error: Connection reset by peer) |
15:44:18 | * | jkiesian joined #nim |
15:44:32 | leorize | I want to avoid ref too, openArray is just much more flexible |
15:44:43 | * | narimiran quit (Client Quit) |
15:44:46 | FromDiscord | <mratsim> because IO is used also in embedded or kernel drivers that shouldn't use the GC. And also for "Weave-IO" I'dl like tight control over memory |
15:45:06 | * | narimiran joined #nim |
15:45:07 | FromDiscord | <mratsim> which is why I didn't use Nim closures |
15:45:45 | leorize | I wouldn't say that they shouldn't use the GC |
15:45:56 | FromDiscord | <mratsim> but the forcing the user to hold the buffer might just be requiring a "var openarray". |
15:46:23 | leorize | most of the time the kernel itself provides a GC |
15:46:40 | leorize | mratsim: yes, if that works :P |
15:47:02 | FromDiscord | <mratsim> C++ and Rust will have the same issues with completion-based API as no-GC continuations |
15:47:25 | leorize | nim-sys cps branch currently break cps because I'm using, uh... everything that is untested by the current implementation |
15:50:03 | FromDiscord | <mratsim> sent a long message, see http://ix.io/2Mt0 |
15:50:31 | * | abm joined #nim |
15:51:03 | FromDiscord | <mratsim> This might be an inspiration, didn't look in the internals: https://github.com/spacejam/rio |
15:51:20 | * | narimiran quit (Quit: leaving) |
15:55:32 | * | narimiran joined #nim |
15:56:15 | leorize | I think if we can generate openArray entries for the current Env of CPS it should allow us to implement completion-IO, maybe |
16:01:56 | FromDiscord | <mratsim> what do you mean? |
16:04:00 | leorize | keeping the `var openArray` in the continuation environment then rely on the compiler's escape analysis to prove that the buffer outlives the continuation |
16:04:17 | giaco | would you help understand what is this project doing? https://github.com/arnetheduck/nbindgen why the output is a .h file? |
16:04:49 | giaco | what are "nim headers" in this context? |
16:06:54 | FromDiscord | <mratsim> @leorize, ah yes, I would be interested as well for weave |
16:07:32 | FromDiscord | <mratsim> if you have "var x = @[1, 2, 3]" |
16:07:48 | FromDiscord | <mratsim> right now you need to cast to ptr UncheckedArray to pass to Weave |
16:08:06 | FromDiscord | <mratsim> and some way to indicate that we want to capture as var openarray would be nice. |
16:09:35 | leorize | views are supposed to make this possible |
16:10:05 | leorize | but since Araq got his hands full with IC, I don't think we are getting fully functional views anytime soon |
16:10:50 | FromDiscord | <mratsim> we can make kludge that use casting to ptr UncheckedArray and then toopenArray(ptr, len) |
16:11:12 | FromDiscord | <mratsim> but we need trick to handle mutable seq so that they use var openarray instead |
16:12:04 | FromDiscord | <mratsim> Maybe we need a "closure RFC" |
16:13:06 | leorize | we can have tons of RFCs but we only have one Araq |
16:13:33 | * | Vladar quit (Remote host closed the connection) |
16:13:56 | leorize | compiler changes have the ultimate bottleneck that is one person |
16:14:14 | FromDiscord | <XxDiCaprioxX> Hey guys, can any one of you tell me how I can echo a string and int together in one line? somewhat similar to `echo "aaaaa" & someInt` |
16:14:26 | leorize | s/&/,/ |
16:14:54 | leorize | !eval echo "aaaaa", 42 |
16:14:59 | NimBot | aaaaa42 |
16:15:08 | FromDiscord | <XxDiCaprioxX> okay thanks |
16:15:28 | FromDiscord | <lqdev> @XxDiCaprioxX alternatively, `echo "aaaa" & $someInt` to turn someInt to a string |
16:15:38 | FromDiscord | <XxDiCaprioxX> also good idea thanks |
16:15:54 | giaco | nim project has a bus factor of 1 |
16:16:00 | leorize | and perform two allocations so may not be the best idea |
16:16:58 | FromDiscord | <mratsim> There are other people who know their way around the compiler, clyybber cooldome zahary krux02 |
16:17:09 | FromDiscord | <mratsim> It's the vision that has a bus factor of 1 |
16:17:15 | leorize | yes but how many of them are full time devs? |
16:20:00 | FromDiscord | <XxDiCaprioxX> is there a loop that only checks the condition after executing its content? |
16:20:04 | leorize | RFCs can get the "Accepted RFC" tag but Araq would still be the only person to implement them |
16:20:37 | leorize | XxDiCaprioxX: we don't have a do-while loop, but it's easy to do a `while true` with a `if cond: break` at the end |
16:21:04 | FromDiscord | <XxDiCaprioxX> okay and break exits the loop and moves on to the next line, correct? |
16:21:13 | leorize | yep |
16:21:16 | * | hmmm joined #nim |
16:21:18 | FromDiscord | <XxDiCaprioxX> aight thanks |
16:23:37 | * | jkiesian quit (Ping timeout: 264 seconds) |
16:23:51 | krux02 | leorize, I was full time dev until November 2019 |
16:25:10 | FromDiscord | <SirJosh> sent a code paste, see https://play.nim-lang.org/#ix=2Mta |
16:25:30 | FromDiscord | <SirJosh> as for "what i'm trying to achieve" i'm just currently prototyping with some random ideas and trying to model them 1:1 in a few target languages as best as possible |
16:25:48 | FromDiscord | <SirJosh> so no code horror that you need to worry about ending up in production or anything lol |
16:25:49 | leorize | remove the generic part and you're golden |
16:26:21 | leorize | the compiler prefers symbols that is more specific |
16:26:49 | leorize | so `add(seq[byte], byte)` will always be preferred over `add[T](seq[T], T)` |
16:27:11 | * | tane joined #nim |
16:27:38 | leorize | if you insist on keeping the `[T]`, then you can write `add[T: byte](seq[T], T)` for example |
16:27:46 | * | hmmm quit (Quit: WeeChat 2.8) |
16:27:57 | FromDiscord | <SirJosh> ah snap neat! |
16:28:13 | krux02 | alternatively, you can have a `when` branch in the generic implementation |
16:28:23 | krux02 | when T is int: ... |
16:28:48 | FromDiscord | <SirJosh> hmm good to know |
16:29:32 | leorize | krux02: iirc you and Araq disagrees a lot in terms of how compiler development should be done |
16:29:43 | krux02 | yes |
16:30:15 | FromGitter | <HJarausch_gitlab> How to declare an *external* (Nim) proc, i.e. ⏎ I'd like to declare a proc fct(...) : ... as external to the current module. How do I do that? |
16:30:43 | krux02 | you want to forward declare a funciton from another module? |
16:30:57 | krux02 | you can't do that, you can only forward declar module local |
16:31:36 | krux02 | generally you are supposed to arrange your modules in a way, so that a linear dependency graph can be created |
16:32:02 | leorize | we also have @zah, but he seems to have stopped working on the compiler, which I suppose is because of the workload he has on Nimbus |
16:32:36 | krux02 | when I started on Nim, zah was already inactive |
16:32:44 | krux02 | don't know if he did something recently. |
16:32:54 | krux02 | It was because of his contract with Status |
16:33:12 | krux02 | it was required that he works full time on status and stop commiting to the compiler. |
16:33:13 | FromGitter | <HJarausch_gitlab> But, I'd like to create a module which implements some optimization of a function *fct* without passing it to every function in that module as a parameter. |
16:33:45 | krux02 | well, that is a bit tough to do. |
16:34:01 | krux02 | you want to specialize |
16:34:04 | krux02 | ? |
16:34:04 | leorize | sounds like a thing concepts would solve, if it works, that is |
16:34:21 | krux02 | no doesn't sound like cocepts, sounds like template specialization. |
16:34:29 | krux02 | Nim does not have template specialization. |
16:34:34 | krux02 | C++ has. |
16:34:55 | krux02 | that feature was intentionally left out of the language. |
16:37:07 | FromDiscord | <mratsim> I don't think it's his Status contract, he did work on static because it was a blocker |
16:37:14 | krux02 | @HJarausch is it possible that you were a Professor at RWTH Aachen? |
16:37:32 | FromDiscord | <mratsim> it's more like, when you do something for work 8-10 hours a day, you might want to do something else on your evnings |
16:38:54 | leorize | the only other person that is active on complicated features in the compiler is clyybber afaict |
16:38:55 | disruptek | like what? |
16:40:07 | FromDiscord | <mratsim> making CPS great again :p |
16:40:19 | krux02 | No I had a chat with him. I think actually wanted to still contribute to the compiler. The people who payed him wanted that his primary focus is somewhere else. And I personally think that is a good. |
16:40:20 | FromDiscord | <mratsim> cooldome does stuff on destructors as well |
16:42:02 | * | a_b_m joined #nim |
16:42:27 | leorize | brand new features are still driven by Araq alone, though |
16:42:59 | FromDiscord | <mratsim> I do think we need a year of stability |
16:43:16 | * | blueberrypie6 joined #nim |
16:43:33 | FromDiscord | <mratsim> we have views, strictFunc, not nil that has been almost working for 18 months, plenty of generics and static crash still out there, the new arc/orc. |
16:43:50 | leorize | IC is supposed to help with all that given it's frontend simplification |
16:44:16 | FromDiscord | <mratsim> Fixing those and having more contributors coached into looking into those before introducing newer unstable features would be good for stability |
16:44:48 | * | Yardanico quit (Remote host closed the connection) |
16:44:48 | * | letto quit (Remote host closed the connection) |
16:45:09 | * | letto joined #nim |
16:45:18 | * | abm quit (Ping timeout: 256 seconds) |
16:45:18 | * | blueberrypie quit (Ping timeout: 256 seconds) |
16:45:18 | * | idf quit (Ping timeout: 256 seconds) |
16:45:18 | * | blueberrypie6 is now known as blueberrypie |
16:45:31 | FromDiscord | <mratsim> Though I think dynamic dispatch without ref (VTable) is very important to grow/fix the stdlib. |
16:45:37 | * | Yardanico joined #nim |
16:46:07 | FromDiscord | <mratsim> but maybe Yuriy interfaced (was it) is enough has a library solutiion |
16:46:28 | * | idf joined #nim |
16:47:37 | disruptek | leorize: did you fix the 1.4 archive? it was corrupted last night. all my CIs are red. |
16:48:35 | narimiran | "I do think we need a year of stability" -- that's roughly the plan for 2021 indeed |
16:48:43 | leorize | disruptek: try re-running them? |
16:49:35 | leorize | mratsim: new concepts are supposed to help fix that I believe |
16:50:04 | FromDiscord | <mratsim> I'm skeptical of new concepts in terms of applicability. |
16:50:06 | disruptek | leorize: i am doing that now. |
16:50:54 | leorize | mratsim: they look like interfaces to me, and statically bound at compile time |
16:51:09 | FromDiscord | <mratsim> So like Rust traits? |
16:51:28 | leorize | shouldn't be too hard for a macro to make runtime dispatching based on them either |
16:51:49 | leorize | looks like it, it's simply "checked" generics afaict |
16:52:07 | leorize | fairly limited compared to what we are having now, but should be expandable as time goes |
16:52:21 | leorize | the important feature it might bring is that it works |
16:52:34 | FromGitter | <HJarausch_gitlab> @krux02 Not a professor but a *Privatdozent* - but why does that matter? |
16:53:10 | krux02 | We worked together in teaching C++ to math students |
16:53:33 | disruptek | leorize: still broken. |
16:53:50 | leorize | disruptek: link to CI please? |
16:54:04 | disruptek | https://github.com/disruptek |
16:54:19 | FromDiscord | <mratsim> The current concepts do work. They are a pain to debug but with a bit of pixie dust they do work. |
16:54:23 | FromGitter | <HJarausch_gitlab> @krux02 and what are you doing now? |
16:54:31 | disruptek | no, the current concepts do not work. |
16:55:03 | FromDiscord | <mratsim> well they work for me then |
16:55:31 | krux02 | After I worked for a year full time for the Nim compiler I now am back at the University. |
16:56:06 | krux02 | Remotely from Home. |
16:56:24 | leorize | mratsim: if you need pixie dust to get them to work then I would not say that they work |
16:56:35 | FromGitter | <HJarausch_gitlab> @krux02 in what faculty and in which university? |
16:57:22 | krux02 | still RWTH institut für Textiltechnik Aachen. I am working on a ray tracer to simulate optical fibers. |
16:57:36 | krux02 | but it is temporary. I don't see my future there. |
16:58:13 | krux02 | Friends from university want me to join other companies, something with future. |
16:58:24 | FromGitter | <HJarausch_gitlab> @krux02 Good luck, then! |
16:58:44 | krux02 | And what are you doing after you are done with C++? |
16:58:56 | krux02 | learning some new programming languages? |
16:59:20 | * | waleee-cl joined #nim |
17:00:24 | leorize | disruptek: looks like the linux 64bit archive was broken, I replaced it |
17:00:28 | leorize | should work now |
17:01:55 | FromGitter | <HJarausch_gitlab> @krux02 I'm retired since 2015. And yes, I still like to learn new programming languages (having got in touch with more than a dozens of them) |
17:01:57 | disruptek | aight thanks. |
17:02:49 | FromDiscord | <dom96> > "I do think we need a year of stability" -- that's roughly the plan for 2021 indeed↵the blog post writes itself 🙂 |
17:02:49 | krux02 | I know you are retired. I was tutor in your last semester. |
17:03:11 | krux02 | Unfortunately it was also my last semester, so I can't tell you how it developed after your retirement. |
17:04:05 | krux02 | You certainly remember me. I am the very tall guy with long hair. |
17:05:08 | leorize | disruptek: have you figured out any viable fix for my `var openArray[T]` usage with cps? or do I have to settle with pointers? |
17:05:15 | krux02 | I certainly did not expect to see you again here. |
17:05:21 | krux02 | Nice to see you still active. |
17:08:41 | FromDiscord | <mratsim> @leorize the pixie dust is needed to understand why they don't match because the error message is a hard to get/reduce |
17:09:05 | FromGitter | <HJarausch_gitlab> @krux02 Yes, your image was familiar to me. Now, that you are a professional yourself, what do you think about the style of the C++ course (please an honest comment!) (The style of the C++ course has changed completely, more like most books in programming, while I preferred *learning by doing*. |
17:09:33 | leorize | mratsim: I get the mysterious matched in one line but not another |
17:10:13 | FromDiscord | <mratsim> I usually put "static: doAssert Foo is Bar" when i use concept now |
17:10:18 | leorize | `is` also get magically "not declared" for typedesc so my requirements in concepts no longer work |
17:10:34 | FromDiscord | <mratsim> just in case someone introduces regression that would affect me |
17:10:55 | disruptek | leorize: i need to merge a huge branch before i tackle generics, unfortunately, but afaict you don't need openarray in the env. |
17:11:11 | leorize | I may need it actually |
17:11:17 | leorize | I need the buffer to stay alive |
17:11:26 | * | Evolver quit () |
17:11:33 | krux02 | @HJarausch do you mean the course that we had together? |
17:12:02 | * | Evolver joined #nim |
17:12:09 | disruptek | i think the closure solution is almost as nice to use, and should work without any fresh bugs. |
17:12:50 | FromDiscord | <mratsim> but @leorize isn't it better to pass the buffer to 2 different proc? One that initiate the "transaction" and one that reads and drop the buffer? |
17:13:15 | disruptek | why does the first proc need the buffer? |
17:13:22 | FromDiscord | <mratsim> for the low-level at least |
17:13:28 | FromGitter | <HJarausch_gitlab> @krux02 Yes, but more the general concept |
17:13:28 | * | natrys joined #nim |
17:13:30 | FromDiscord | <mratsim> Completion based API requirement |
17:13:45 | krux02 | My honest opinion is, the course was very challenging to overwhelming for people who just started with programming. I completely agree that learning by doing is the right way to learn any programming langugae. But it should be something that is at least on the theoretical level already familiar or easy, so that the students can focus on getting along with the language instead of struggling with understanding the problem. |
17:13:48 | FromDiscord | <mratsim> for zero-copy, windows and Io uring need a buffer so they copy the input directly inside |
17:13:51 | * | Vladar joined #nim |
17:13:58 | disruptek | leorize: it seems like the 1.4 tarball is not working yet. i'm trying again. |
17:14:14 | leorize | mratsim: isn't in your design we end up copying anyway? |
17:14:17 | FromDiscord | <mratsim> instead of having a kernel buffer and then a userland buffer in epoll/readiness based API |
17:14:23 | disruptek | that doesn't answer my question. |
17:14:24 | FromDiscord | <mratsim> no |
17:14:31 | disruptek | you don't need the buffer until you need to write into it. |
17:14:42 | disruptek | ergo, only one proc needs it as an argument. |
17:14:44 | FromDiscord | <mratsim> you don't copy, you have the nim-sys end user providing the buffer |
17:14:59 | FromDiscord | <dom96> the kernel copies though, no? So how can you call it "zero-copy"? |
17:15:07 | FromDiscord | <mratsim> you need it when you initialize the transaction disruptek |
17:15:12 | disruptek | https://github.com/disruptek/balls/runs/1723038526?check_suite_focus=true |
17:15:14 | FromDiscord | <mratsim> i don't think you need it after though |
17:15:16 | leorize | I need the buffer even when I'm not writing into it, because the OS will be doing that until it say that it's done |
17:15:29 | disruptek | mratsim: one proc. |
17:15:48 | FromDiscord | <mratsim> @dom96 the kernel copies but it's zero copy overhead over the necessary "recv" |
17:16:30 | FromDiscord | <mratsim> so @leorize i think the issue of keeping the buffer alive is in the higher-level layer than nim-sys |
17:16:37 | FromDiscord | <mratsim> likely the IO scheduler. |
17:16:54 | FromDiscord | <mratsim> but maybe you can write pseudo code |
17:16:57 | krux02 | I think it was very good to give them real challenges, and it is impossible to provide something that evokes the interest of every student the same way, so I don't have a realy answer as well. |
17:17:00 | FromDiscord | <mratsim> so that we can have a look |
17:17:14 | disruptek | that's why i think the solution is a magic. |
17:17:29 | leorize | but nim-sys has to provide the IO scheduler |
17:17:58 | FromDiscord | <mratsim> why? |
17:18:10 | disruptek | mratsim: he already has a real impl; no pseudo-code. |
17:18:10 | leorize | I need to dispatch the completion call |
17:18:12 | FromDiscord | <mratsim> it's better to decouple low-level APi from the Io scheduler |
17:19:15 | FromDiscord | <mratsim> how would I use nim-sys from Weave-IO for example? |
17:19:28 | krux02 | @HJarausch: I think the best way to motivate students to do programming is, if they write something that is either fun to use or actually useful. |
17:19:46 | krux02 | Example here is the 4 in a row game that they implemented. I think that was a very good exercise for the students. |
17:19:50 | leorize | mratsim: you use the blocking APIs, that's the beauty of threads |
17:20:03 | * | Torro quit (Quit: bye) |
17:20:18 | krux02 | The exercise with encryption was very dry. |
17:20:27 | FromDiscord | <mratsim> If I want to optimize for latency I likely should use the non-blocking API |
17:20:44 | leorize | why? |
17:20:59 | krux02 | Also I would leave the usage of lib gmp for the advanced lecture, C++ is already surprising and challenging enough without it. |
17:21:13 | krux02 | keep it simple in the beginning. |
17:21:29 | leorize | you already got a thread, use the blocking API and the OS will keep it asleep until the operation is done |
17:21:49 | FromDiscord | <mratsim> Because an optimal scheduler is "as long as there is work to do, all threads are busy".↵The Cilk scheduler has proven that this "greedy scheduler" approach is at most 2x slower than the fastest scheduling possible. |
17:22:21 | leorize | you can also spin via repeated `poll()` if you must |
17:22:32 | FromDiscord | <mratsim> But I can't manage millions of sockets, files, pipes and what not at the same time this way |
17:22:44 | leorize | why are you using threads then? |
17:23:04 | leorize | at least that's my assumption when I heard about weave-io |
17:23:04 | FromDiscord | <mratsim> This is not either/or. |
17:23:22 | krux02 | Image processing was also nice. But C++ is a high performance language. Those written programs should have been interactive to see the performance of c++ better. |
17:23:27 | FromGitter | <HJarausch_gitlab> @krux02 It was always my intention to show some concepts of computer science, as well - since the students wouldn't hear about that elsewhere otherwise |
17:23:56 | FromDiscord | <mratsim> It's about having a multithreaded IO scheduler but it would be non-blocking as well. |
17:24:21 | krux02 | yea I get your intentions, and they are good intentions. But I think it was a bit too much at the same time for the students. |
17:24:36 | leorize | mratsim: the lowest level you can go is the OS interface itself |
17:24:40 | FromDiscord | <mratsim> so a threadpool, like Weave and a scheduler that optimize for latency on top. But I don't want one thread per socket. |
17:24:52 | krux02 | and yes it is sad that they wouldn't soo those CS concepts elsewhere. |
17:24:57 | leorize | I don't want to give out a selectors-like system, because IMO it's dumb |
17:25:30 | FromDiscord | <mratsim> sure. What I'm saying is that, ideally nim-sys or flywind ioselector are just thin wrapper over the OS interface, that just give me the OS interface in a consistent API. |
17:26:05 | FromDiscord | <mratsim> thin as is, openarray[byte] but don't do allocation or scheduling decision, leave them to higher-level schedulers so that they can tune them for their use cases. |
17:26:21 | leorize | that's a bit too thin |
17:26:29 | FromDiscord | <mratsim> obviously using continuation is fine. |
17:26:32 | leorize | my async ops needs to know how to schedule themselves |
17:26:49 | leorize | ie. the fd is not ready, I want to signal a wait |
17:27:07 | FromDiscord | <dom96> why do you think selectors-like system is dumb? |
17:27:22 | FromDiscord | <dom96> It mirrors the selectors APIs of POSIX-compatible systems |
17:27:41 | leorize | that is exactly why |
17:27:50 | leorize | selectors-like system assume a readiness-based scheme |
17:28:06 | FromDiscord | <dom96> yeah, because that's what most OS' implement |
17:28:11 | leorize | you try to fit iocp in and you become the buffer |
17:28:15 | leorize | they are moving out of it |
17:28:22 | FromDiscord | <mratsim> so that's one thing. Signal/condition-variable and locks are meeh. After fighting with Glibc condition variable bugs, i just want to use Futex. |
17:28:26 | FromDiscord | <dom96> iocp is out of the scope of selectors |
17:28:37 | leorize | io_uring is a completion-based system too |
17:28:47 | FromDiscord | <dom96> you build a completion base system on top and fit iocp into that |
17:28:51 | FromDiscord | <dom96> which is what asyncdispatch does |
17:28:59 | FromDiscord | <dom96> (edit) "base" => "based" |
17:29:04 | FromDiscord | <mratsim> but that brings a lot of extra allocations. |
17:29:10 | leorize | I want my async ops to be efficent, because that is what users use |
17:29:41 | disruptek | weird. |
17:31:32 | * | junland quit (Quit: %ZNC Disconnected%) |
17:32:44 | leorize | disruptek: should work now, I just tested it |
17:33:43 | FromDiscord | <dom96> My point is that selectors is a fundamental API of the operating system, you have to have this thin wrapper to support Linux/BSD |
17:33:55 | FromDiscord | <dom96> with io_uring it might be different now, but BSD is still stuck with this AFAIK |
17:34:18 | leorize | mratsim: my eventqueue implements the APIs that nim-sys will use to schedule itself |
17:34:36 | FromDiscord | <dom96> but yeah, it is funny that Windows got it right for such a long time |
17:34:56 | leorize | mrastim: if you want it can be an interface and you may plug your implementation in |
17:35:38 | FromDiscord | <mratsim> Yeah, it would be nice if the low-level proc can be used to implement alternate schedulers. |
17:36:02 | leorize | dom96: my point is that all this should be a part of a dispatcher for efficiency reasons |
17:36:12 | leorize | I'm just skipping the middleware that is selectors |
17:36:37 | FromDiscord | <mratsim> What difference do you make between a scheduler and dispatcher? |
17:37:29 | * | vicfred joined #nim |
17:37:30 | FromDiscord | <dom96> leorize: I don't really see your point. You still need to implement this API to support BSD at least, unless you are planning to drop support for that platform. |
17:37:41 | * | vicfred quit (Remote host closed the connection) |
17:38:32 | * | junland joined #nim |
17:38:33 | FromDiscord | <mratsim> Windows is 90% of home users, Linux is 99% of servers. Doesn't make sense to hold back their performance for 1% of the marketshare left. |
17:39:18 | FromDiscord | <dom96> Sure, if I was writing an async package today I would drop it too |
17:39:56 | FromDiscord | <mratsim> Leorize doesn't drop epoll/readiness-based API. But since 90% won't use them, the selector API is skipped. |
17:40:43 | * | vicfred joined #nim |
17:41:28 | FromDiscord | <mratsim> so low-level OS APi are stille wrapped. You still have a high-level abstraction. But there is nothing in-between, the OS/API differences are handled in the scheduler directly instead of in the selectors intermediate API |
17:42:03 | leorize | yep, that is how it's done right now in nim-sys |
17:42:31 | leorize | CPS enables all this to work really nice |
17:42:38 | leorize | once it works, that is |
17:42:44 | FromDiscord | <dom96> Maybe something changed in the selectors implementation since I last used it, but I don't see how that's different. You'll end up with the same implementation. |
17:43:21 | FromDiscord | <mratsim> The first thing i see when i look into selectors is that it's a ref object |
17:43:38 | FromDiscord | <mratsim> there is need for ref in a reainess API |
17:44:16 | FromDiscord | <mratsim> That's the whole zero-cost futures part of Rust |
17:44:41 | FromDiscord | <mratsim> using the fact that POSIX so far was readiness-based which allowed allocating the buffer only at the final use, and so no alloc. |
17:44:45 | leorize | dom96: I have more free reign in implementation and can apply the most suitable restrictions |
17:45:57 | FromDiscord | <mratsim> Because once you don't need heap alloc for futures, you can use Rust iterators/state-machine scheme to have very efficient future chaining. |
17:46:00 | FromDiscord | <dom96> Sure, that's fine. But calling `selectors` dumb is an over-simplification |
17:46:24 | FromDiscord | <dom96> In a stdlib it's a great abstractions which allows anyone to write a fast selectors-based server |
17:46:34 | FromDiscord | <dom96> (edit) "abstractions" => "abstraction" |
17:47:10 | FromDiscord | <mratsim> I don't call solutions dumb without having a 5k words README with lengthy analysis. |
17:47:30 | FromDiscord | <mratsim> so leorize you're on your own 😉 |
17:47:55 | leorize | it was more about how I won't implement a selectors in nim-sys :P |
17:48:29 | disruptek | leorize: it works, thanks. |
17:49:13 | FromDiscord | <mratsim> I planned to explore raw OS IO API as well for Weave IO but if you expose those in nim-sys that would be helpful |
17:49:28 | leorize | mainly because I found the abstractions provided by the dispatcher + cps to be more than enough to cover the grounds of nim-sys |
17:49:42 | FromDiscord | <dom96> @mratsim it's already exposed in the stdlib |
17:50:56 | FromDiscord | <dom96> also I'm curious why you think there is a need for ref in a readiness API |
17:50:58 | leorize | you can read this to see how a posix non-blocking read is done with cps: https://github.com/alaviss/nim-sys/blob/cps/src/sys/private/files_posix.nim#L46-L70 |
17:51:15 | FromDiscord | <mratsim> there is no need for ref in a readiness API |
17:51:18 | leorize | no windows-based version yet since I'm still experimenting |
17:51:20 | FromDiscord | <mratsim> selectors use ref |
17:51:36 | FromDiscord | <dom96> was that a typo above? |
17:51:47 | disruptek | yes. |
17:51:53 | FromDiscord | <mratsim> yes |
17:52:29 | FromDiscord | <mratsim> @leorize, can you have an error model/Result instead of exceptions? |
17:52:37 | leorize | no |
17:53:04 | disruptek | otherwise there'd be no motivation to upgrade your nim installation. |
17:54:42 | FromDiscord | <mratsim> Well, I'm also worried of try:except wrappng a suspension point. |
17:54:48 | leorize | dom96: with cps the dispatcher and the selector just blend together naturally, and remove the need for a separated selectors middleware imo |
17:54:58 | FromDiscord | <konsumlamm> does anyone happen to know what heapdumprepl is doing? |
17:55:03 | FromDiscord | <mratsim> those are broken in current closure iterators, Swift async and C++ coroutines also disallow them iirc. |
17:55:59 | leorize | IMO it's not that selectors is bad, but having it separated from the dispatcher is |
17:57:47 | FromDiscord | <dom96> Perhaps. Like I said, it was the right call for the stdlib as it allows anyone to skip asyncdispatch altogether and just use selectors directly. |
18:03:42 | leorize | mratsim: maybe you can copy what --exceptions:goto does? basically automated Result[T] for the most part |
18:04:25 | FromDiscord | <mratsim> I'll see, i'm too busy to look in-depth at IO low-level stuff right now |
18:04:58 | FromDiscord | <mratsim> I'm mostly interested to understand the ergonomics or technical blocker in CPS to enable smooth IO atm |
18:05:53 | * | hoijui quit (Ping timeout: 246 seconds) |
18:06:08 | FromDiscord | <mratsim> Also to understand if we really need to handle the raw low-level continuations beyond the public API I proposed |
18:06:27 | disruptek | well, the blocker is you, buddy. |
18:07:30 | leorize | mratsim: so you would like nim-sys' eventqueue to be replaceable by the end user to hook into their own scheduler? doesn't sound bad to me |
18:07:45 | disruptek | leorize: that's the beauty of cps. |
18:08:00 | FromDiscord | <mratsim> What blocker is me? |
18:08:31 | disruptek | waiting for you to PR type eraser into 0.0.16. |
18:08:38 | disruptek | you said you would not do so. 🤷 |
18:08:51 | leorize | disruptek: I know, that is why it is designed as it is right now :) |
18:08:53 | FromDiscord | <mratsim> Yes, and I would like the low-level API to not impose the allocation/exceptions things |
18:08:58 | leorize | I have to finalize the API first though |
18:09:14 | leorize | mratsim: get openArray to work first :) |
18:09:19 | FromDiscord | <mratsim> @disruptek, I said that it was more important to figure out the high level ergonomics. |
18:09:33 | FromDiscord | <mratsim> because we agreed on what to do for type erasing. |
18:09:55 | leorize | as for exceptions, I will keep using it just so you have a motivation to have Araq get rid of ref for exceptions :) |
18:10:01 | disruptek | well, i don't care what your excuse is. the fact is, we don't have the eraser and we agreed to use it. |
18:11:08 | leorize | exceptions goto already make exceptions perform similar to result codes (because it kinda is) |
18:11:25 | * | jkiesian joined #nim |
18:11:29 | FromDiscord | <mratsim> Well, I choose how to use my free time. I don't care what your demands are. |
18:11:40 | leorize | complain away if you don't want exceptions to be on the heap, it will help the ecosystem at large :) |
18:11:52 | disruptek | i demand nothing. |
18:12:22 | disruptek | also, i continue to diverge further from your work without regard to what pain it may cause you. |
18:12:40 | FromDiscord | <mratsim> You are always asking me to prove things to you. |
18:12:57 | disruptek | i agreed to your type eraser and even this is not enough for you. |
18:13:01 | disruptek | i dunno what to tell you, man. |
18:13:23 | disruptek | i agreed to splitting the code-base to stack-based and heap-based and this is not enough for you. |
18:13:50 | disruptek | just let me know what would motivate you to spend free time on cps and maybe if that scenario arises, i'll let you know. |
18:14:42 | FromDiscord | <mratsim> I don't spend all my time on CPS because I'm doing other stuff for Nim ecosystem, in particular related to science. |
18:14:51 | disruptek | noted. |
18:15:12 | FromDiscord | <mratsim> Unfortunately, I'm also a blocker here, so I want to remove myself from being a blocker here. |
18:15:45 | FromDiscord | <mratsim> because I can't keep up as a sole developer with all the things that are output by the various scientific communities. |
18:16:20 | FromDiscord | <mratsim> Also because automatted wrapper are still a pain, I took a week to wrap stuff manually and show how people can wrap what is meaningful to them. |
18:16:51 | FromDiscord | <mratsim> and before as mentioned I had internet issue. |
18:17:21 | FromDiscord | <mratsim> If people can triplicate me so I can do cryptography, science and CPS at the same time, sure. |
18:17:55 | disruptek | i already said i demand nothing and i don't care what your excuse is. relax. |
18:18:12 | disruptek | also, don't blame us for continuing to develop without you. |
18:18:14 | disruptek | that is all. |
18:18:17 | FromDiscord | <Clyybber> then stop calling it excuse maybe? |
18:18:24 | FromDiscord | <mratsim> Did i blame you? |
18:18:35 | disruptek | s/excuse/rationale/ |
18:18:46 | FromDiscord | <mratsim> Did I raise an issue about having to adapt to your changes? |
18:19:05 | disruptek | look, we don't even have to talk about this. |
18:19:19 | disruptek | i'm supposed to be renaming my balls again. |
18:19:20 | FromDiscord | <Daniel> 🍿 |
18:19:24 | FromDiscord | <mratsim> well it seems like we do since you mentionned that I am the blocker |
18:19:56 | disruptek | no; it's clear that you don't wish that role. |
18:21:54 | FromDiscord | <mratsim> Type-erasure isn't blocking CPS. That's purely internal and something that we can handle at our leisure. |
18:22:22 | FromDiscord | <mratsim> High-level API is something we want figured out so that leorize can plan around it |
18:22:36 | FromDiscord | <mratsim> or anyone who wants to rethink asyncstreams for example |
18:23:18 | FromDiscord | <mratsim> unless there are architectural change sthat you want to land? |
18:24:26 | disruptek | i need type erasure because i need to figure out how we do results. |
18:39:44 | * | jkiesian quit (Ping timeout: 272 seconds) |
18:43:43 | * | muffindrake quit (Quit: muffindrake) |
18:45:43 | FromDiscord | <mratsim> understood |
18:46:09 | ehmry | is there a way to get hide effects of a proc? |
18:46:18 | ehmry | *a way to hide effects |
18:47:57 | ehmry | I'm trying to implement a Stream object but the backend is async |
18:48:47 | giaco | I have a sqlite db with TEXT column that I use to store binary data from nim seq[byte] converted to string. It is correctly inserted as I can read correct bytes using external db manager, but selecting from nim "db.getValue(sql"SELECT data FROM mytable WHERE id=?", 50)" returns a string len 12 for any row no matter the original buffer size (that ranges from 200 to 1500 bytes) |
18:52:33 | FromDiscord | <Clyybber> ehmry: See https://github.com/nim-lang/RFCs/issues/258 |
18:52:34 | disbot | ➥ 'cast' as pragma |
18:52:52 | FromDiscord | <Clyybber> I think you want {.cast(tags: [Tag1, Tag2, ...]).}: ... |
18:54:46 | * | narimiran quit (Read error: Connection reset by peer) |
18:55:10 | * | narimiran joined #nim |
18:59:25 | ForumUpdaterBot | New thread by Jiyinyiyong: How to detect Chinese character with regex?, see https://forum.nim-lang.org/t/7399 |
19:01:11 | ehmry | on second thought I think I don't want Stream at all if there are futures going around |
19:05:51 | * | j-james joined #nim |
19:06:35 | * | j-james quit (Client Quit) |
19:07:56 | * | j-james joined #nim |
19:12:13 | * | Vladar quit (Quit: Leaving) |
19:15:25 | Araq | ehmry, you can also ask for the inferred infects via std / effecttraits |
19:17:03 | * | j-james quit (Quit: WeeChat 3.0) |
19:18:05 | * | Vladar joined #nim |
19:19:12 | ehmry | ok, that was what I was looking for a bit ago |
19:22:54 | ehmry | the only thing I remember liking about Go was the read/write interface thing, which I'm not if I miss it with Nim |
19:23:26 | ehmry | Stream seems like a nice idea but I keep trying to implement it with `await` and things get awkward |
19:23:38 | ehmry | er, `waitFor` |
19:24:05 | Araq | async streams are in devel now? not sure, PMunch worked on it and I told Miran to merge it |
19:24:23 | FromDiscord | <Clyybber> Araq: I think that were socket streams no? |
19:24:55 | Araq | hmm |
19:25:03 | ehmry | a FutureStream replacement? |
19:26:45 | FromDiscord | <dom96> Would be nice |
19:26:55 | * | jkiesian joined #nim |
19:28:05 | FromDiscord | <konsumlamm> hey Araq, do you remember what heapdumprepl is doing? |
19:28:29 | Araq | yeah ... no .. maybe |
19:28:34 | Araq | does it use Sqlite? |
19:29:05 | leorize | disruptek: please let me know once you got result working on cps |
19:29:17 | leorize | for now I'll continue using asyncdispatch |
19:29:24 | FromDiscord | <Clyybber> leorize: Is it blocking you? |
19:29:43 | leorize | yea, my read need to return how much was read |
19:30:12 | FromDiscord | <konsumlamm> heapdumprepl? no, it seems to render a graph of the heap or something |
19:30:18 | leorize | @Clyybber I can use ptr to walkaround `var openArray`, but I don't want ptr int for result |
19:30:32 | FromDiscord | <Clyybber> Heh, I was about to suggest ptr int |
19:30:51 | Araq | ah well |
19:31:01 | FromDiscord | <konsumlamm> looks pretty abandoned though and i couldn't find any references to it |
19:31:04 | Araq | just forget it, the graphs are enormous |
19:31:13 | Araq | I never saw anything in them |
19:32:33 | Araq | the code was written to debug the GCs |
19:34:02 | disruptek | leorize: i will; it may be a few days. |
19:34:43 | leorize | np, I need to write tests too |
19:34:47 | FromDiscord | <konsumlamm> (i'm currently trying to replace all occurrences of intsets with packedsets, that's how i stumpled upon heapdumprepl) |
19:35:10 | Araq | ugh |
19:35:54 | Araq | poor human beings who cannot keep up with these renamefests |
19:39:42 | leorize | Araq: how is not nil nowadays? |
19:40:16 | leorize | I noticed that you merged alehander `nil check` pr, but I don't know what exactly does it do |
19:40:32 | Araq | it's opt-in via .experimental: "strictNotNil" |
19:45:18 | leorize | doesn't seem to be documented in the change log though |
19:45:24 | * | ee7[m] joined #nim |
19:45:38 | leorize | ~notnil |
19:45:39 | disbot | no footnotes for `notnil`. 🙁 |
19:45:47 | leorize | ~notnil is https://nim-lang.github.io/Nim/manual_experimental.html#strict-not-nil-checking |
19:45:48 | disbot | notnil: 11https://nim-lang.github.io/Nim/manual_experimental.html#strict-not-nil-checking |
19:45:56 | Araq | haven't got into it, I merged it to avoid it from bitrotting, will clean it up before the next release |
19:50:21 | FromDiscord | <Recruit_main707> Araq, today @Clyybber talked about making --warning[GcMem] work with arc.↵(although my interest is to add them to regions), how feasible it is to do this, what kind of stuff needs to be done? |
19:51:09 | FromDiscord | <Clyybber> @Recruit_main707 It's really just checking for ref/string/seq usage. |
19:51:42 | FromDiscord | <Clyybber> I'm not sure it actually makes sense for strings because they aren't using a "gc" really, even with orc |
19:51:51 | FromDiscord | <Clyybber> Because strings cannot create cycles |
19:52:18 | FromDiscord | <Clyybber> And similar for other types consisting of seq/ref that cannot be cyclic |
19:52:53 | Araq | https://github.com/nim-lang/RFCs/issues/177#issuecomment-762230174 is what we should do |
19:52:55 | disbot | ➥ Unify Nim's GC/memory management options ; snippet at 12https://play.nim-lang.org/#ix=24Ua |
19:53:00 | FromDiscord | <Clyybber> Maybe a warning[HeapAlloc] makes more sense |
19:54:08 | * | Jesin quit (Quit: Leaving) |
19:54:28 | FromDiscord | <Clyybber> Since it could be for example that seqs will not be a compiler builtin anymore, but instead defined as a library |
19:54:38 | FromDiscord | <Clyybber> Araq: Yeah, that would be neat too |
19:55:10 | Araq | I don't like --gc:none nor its warnings, not even C compiler offer a --noMalloc switch |
19:56:04 | leorize | @Clyybber are you working on any features atm? |
19:58:43 | FromDiscord | <Recruit_main707> yeah, i also mentioned is kinda dumb you cant use refs of any kind, but having a warning for when you are not deallocating (or at least not allocating it in a MemRegion) something using gc:regions would make stuff easier |
20:01:33 | FromDiscord | <Clyybber> leorize: I'm working on #16195 atm |
20:01:39 | disbot | https://github.com/nim-lang/Nim/pull/16195 -- 6fix #16185 ; snippet at 12https://play.nim-lang.org/#ix=2Mu9 |
20:02:47 | leorize | are new concepts and fully functional views on the roadmap for the next release? |
20:03:24 | Araq | fully functional views need a new RFC, the old design had unfixable problems |
20:04:58 | Araq | concepts ... I don't know. |
20:05:15 | FromDiscord | <Clyybber> leorize: See the discussion Araq cooldome and I had on telegram |
20:05:26 | Araq | the current plan is that 1.6 is about IC |
20:07:15 | Prestige | Is there a particular plan for 2.0? Reserved for when we want potentially breaking changes? |
20:07:31 | leorize | looks like I can't wait for cps + openArray to be a thing then |
20:08:13 | FromDiscord | <Recruit_main707> Prestige: IC /afaik/ |
20:08:24 | Prestige | I thought that was 1.6 |
20:08:45 | Araq | plan for 2.0 is to remove features |
20:08:49 | leorize | 2.0 might do away with macros as they are right now |
20:08:50 | FromDiscord | <mratsim> we "only" need closure that capture seq/array as openarray |
20:09:37 | Prestige | Better macro system incoming? |
20:09:51 | * | Jesin joined #nim |
20:09:57 | Araq | in my ideal world 2.0 would *only* remove features and we added all the things we need to 1.x.0 |
20:10:23 | leorize | versioned nim modules when :P |
20:10:42 | Prestige | leorize: before 2.0 :P lol |
20:11:01 | * | jkiesian quit (Ping timeout: 264 seconds) |
20:14:01 | FromDiscord | <mratsim> 2.0 removes features and 2.2 adds more |
20:15:39 | FromDiscord | <dom96> Nim 2.0 is just macros |
20:16:09 | disruptek | leorize: i'm not convinced that cps + openArray makes sense for anyone. |
20:16:20 | leorize | there are no macros in nim 2.0, only compiler plugins :P |
20:16:33 | Araq | Prestige, better macro system ... yeah what leorize said |
20:16:48 | Prestige | Interesting |
20:16:52 | FromDiscord | <Clyybber> eh, macros are already compiler plugins. They just run in the VM |
20:17:00 | FromDiscord | <dom96> Yeah |
20:17:21 | leorize | packedast will allow macros to be run as actual compiled programs afaict |
20:17:22 | FromDiscord | <dom96> Just expose more through macros. Job done. 😄 |
20:17:24 | FromDiscord | <Clyybber> But of course compiler plugins could be extended to hook between certain passes |
20:17:41 | Araq | dom96: that's one way of phrasing it, yes |
20:17:47 | Prestige | I assume you can achieve the same work with it - I haven't seen a "compiler plugin" (aside from macros) |
20:17:51 | FromDiscord | <mratsim> @disruptek, closure being able to capture openarray would be helpful to update a seq in general. |
20:17:56 | FromDiscord | <mratsim> or a buffer |
20:18:16 | FromDiscord | <mratsim> this is the reason why I need to cast seqt to ptr UncheckedArray in Weave examples. |
20:18:52 | leorize | disruptek: it enables a safe interface to access a buffer |
20:19:13 | leorize | it can be a pointer, a string, a seq, or whatever, we have conversion utilities to turn them into openArray |
20:19:17 | FromDiscord | <mratsim> Nim 2.0: interfaces 😉 |
20:19:57 | FromDiscord | <Clyybber> There is no need for compiler magic for interfaces IMO |
20:20:33 | leorize | the responsibility of what type to choose and what kind of buffer to use will then be pushed to the caller as only they know what they want |
20:21:08 | FromDiscord | <Clyybber> Araq: Do we include seq/string indexing under the term array indexing ? |
20:21:28 | FromDiscord | <dom96> Nim 2.0 will just have interfaces in the stdlib. Implemented using macros 😄 |
20:21:35 | disruptek | leorize: all i'm saying is that continuations holding openArray fields is probably not a thing. |
20:22:30 | * | natrys quit (Quit: natrys) |
20:22:33 | leorize | disruptek: I don't care too much about the specifics, as long as you can keep the safety analysis and guarantees of openArray I will take it |
20:23:04 | disruptek | yes, i want this too. |
20:23:12 | * | hoijui joined #nim |
20:23:29 | FromDiscord | <Clyybber> then closures need to inherit the lifetimes of their captured variables first, thats a thing on my TODO :p |
20:24:56 | disruptek | right now i'm trying to figure out how jason gets "correctly" excluded from dist/1.[02]. |
20:25:38 | FromDiscord | <iWonderAboutTuatara> Would it be possible for contributions to Nim or opensource Nim projects/ecosystem to be marked as community service? |
20:26:01 | disruptek | dui, huh |
20:26:59 | leorize | openArray and var params working with cps would be the best thing |
20:27:30 | FromDiscord | <Clyybber> @iWonderAboutTuatara Is that a github feature? |
20:27:57 | narimiran | so you make a 5 PRs instead of going to prison? |
20:28:28 | disruptek | minor possession, huh |
20:30:17 | FromDiscord | <iWonderAboutTuatara> lmao |
20:30:19 | FromDiscord | <iWonderAboutTuatara> no for colleges |
20:30:26 | FromDiscord | <iWonderAboutTuatara> @Clyybber don't think so but would be nice |
20:30:50 | FromDiscord | <Clyybber> oh, I wasn't familiar with the term :D |
20:31:02 | FromDiscord | <iWonderAboutTuatara> wait which term? |
20:32:53 | FromDiscord | <Clyybber> community service |
20:33:25 | FromDiscord | <iWonderAboutTuatara> oh I see |
20:33:35 | FromDiscord | <iWonderAboutTuatara> it's a very vague term, doesn't mean too much |
20:35:38 | Zevv | https://github.com/edubart/minicoro |
20:37:12 | FromDiscord | <lqdev> why does getOccupiedMem() return 0 under ARC? |
20:38:33 | Zevv | lqdev: how's the parsing adventure going then |
20:38:58 | FromDiscord | <lqdev> Zevv: ah pretty good so far, just fixed a stupid memory corruption bug. lesson learned: never use copyMem with refs |
20:39:12 | Zevv | didn't yo mama tell ya |
20:39:18 | FromDiscord | <lqdev> just copy your values around in for loops like a good boy |
20:39:31 | Zevv | right |
20:40:08 | Zevv | is your code public? |
20:40:22 | FromDiscord | <lqdev> not yet, will need to do some testing before i can call it ready for publishing |
20:40:37 | Zevv | cool |
20:40:42 | FromDiscord | <lqdev> but it's almost complete |
20:41:02 | FromDiscord | <lqdev> my VM can compute factorials like a champ |
20:41:16 | Zevv | hooray \o/ |
20:47:10 | * | wasted_youth quit (Read error: Connection reset by peer) |
20:48:26 | * | tane quit (Quit: Leaving) |
20:48:55 | * | jkiesian joined #nim |
20:50:39 | giaco | nim on quantum computer, anyone? |
20:50:53 | disruptek | btdt |
20:50:59 | FromDiscord | <Clyybber> maybe |
20:51:05 | disruptek | uncertain. |
20:51:08 | FromDiscord | <Daniel> quantum computer only works with cats |
20:51:23 | disruptek | disbot: are you awake? |
20:51:24 | disbot | very doubtful. |
20:51:32 | Zevv | will never work, will trigger all possible compiler bugs at the same time |
20:52:07 | FromDiscord | <Clyybber> but will also find all compiling snippets at the same time |
20:52:18 | FromDiscord | <Clyybber> disbot: are you asleep? |
20:52:19 | disbot | without a doubt. |
20:52:29 | FromDiscord | <Clyybber> disbot: are you awake? |
20:52:30 | disbot | my sources say no. |
20:52:36 | FromDiscord | <Daniel> disbot: are you sentient? |
20:52:37 | disbot | better not tell you now. |
20:52:37 | FromDiscord | <Clyybber> incredible |
20:53:05 | FromDiscord | <Clyybber> disruptek: How is life as a mechanical turk? |
20:53:09 | FromDiscord | <Daniel> distbot: are you drunk? |
20:53:17 | FromDiscord | <Daniel> (edit) "distbot:" => "disbot:" |
20:53:18 | disruptek | answer cloudy; ask later. |
20:53:33 | * | awici[m] joined #nim |
20:53:34 | giaco | disruptek: what's the answer to the Ultimate Question of Life, the Universe, and Everything |
20:53:40 | giaco | I mean disbot |
20:53:41 | disruptek | 42 ofc |
20:53:42 | giaco | damn! |
20:54:20 | FromDiscord | <Daniel> regarding quantum computing, ....doesn't seem viable in near future, or maybe it will have to be reworked. |
20:55:33 | FromDiscord | <mratsim> https://en.wikipedia.org/wiki/Q_Sharp |
20:55:34 | FromDiscord | <Daniel> (edit) "reworked." => "reworked....probably wont have "quantum" in its name" |
21:00:23 | giaco | is it possible with dq_sqlite to extract a cell that contains a blob with null bytes? All I get is a truncated string. Tried with getRow and getValue |
21:03:28 | leorize | you don't use db_sqlite and instead use ndb |
21:04:36 | giaco | leorize: I'm actually using norm, that uses ndb, but there's a push request of 1 character waiting to be accepted for that https://github.com/xzfc/ndb.nim/pull/17 |
21:04:37 | disbot | ➥ Export "o" field of DbValue type. |
21:08:01 | * | narimiran quit (Ping timeout: 256 seconds) |
21:08:42 | * | hnOsmium0001 joined #nim |
21:18:02 | * | oculux joined #nim |
21:19:57 | * | jkiesian quit (Ping timeout: 272 seconds) |
21:24:47 | giaco | leorize: here's a small example that shows that ndb fails too https://play.nim-lang.org/#ix=2Muw |
21:27:13 | leorize | @mratsim: since you manage to figure out concepts, can you tell me how to fix this? https://github.com/alaviss/nim-sys/commit/bfd0e0bdbc63ac3e465ec4a3d75e2f074e49992d |
21:27:48 | leorize | you can see CI for the error messages |
21:28:00 | * | hmmm joined #nim |
21:29:06 | leorize | tconcept pass, even if it wasn't run on CI |
21:29:30 | FromDiscord | <mratsim> so the FD(fd) and T(fd) are conversion constraint? |
21:30:37 | * | hoijui quit (Ping timeout: 272 seconds) |
21:30:41 | leorize | yea, I just need them to be valid |
21:34:11 | * | jkiesian joined #nim |
21:37:06 | FromDiscord | <mratsim> I don't have time today, ping me tomorrow |
21:37:13 | leorize | sure, thanks |
21:39:17 | FromDiscord | <mratsim> it's very possible that concept only takes normal proc into account and type converter were missed though |
21:40:12 | disruptek | i doubt it; i believe concepts uses `compiles`, and this is part of the reason replacement is desired. |
21:40:26 | leorize | yea but tconcept, which contains `FD is AnyFD` and `SocketFD is AnyFD` tests, passes |
21:42:43 | disruptek | haxscramper: is your path code compatible with 1.0 and where do i find it? |
21:48:30 | * | NimBot joined #nim |
21:53:07 | FromDiscord | <haxscramper> https://haxscramper.github.io/hmisc/src/hmisc/other/oswrap.html |
21:53:20 | disruptek | rip |
21:53:22 | FromDiscord | <haxscramper> And I have no idea about 1.0 compatibility |
21:53:39 | disruptek | we bumped gram because hmisc doesn't support 1.2, so... |
21:53:47 | disruptek | seems unlikely that it will work for me. |
21:54:12 | FromDiscord | <lqdev> Zevv: done! https://github.com/liquidev/cflang |
21:55:01 | * | xet7 quit (Remote host closed the connection) |
21:56:08 | * | xet7 joined #nim |
21:58:47 | FromDiscord | <cji> sent a long message, see http://ix.io/2MuF |
22:00:55 | * | tane joined #nim |
22:02:17 | FromDiscord | <lqdev> that's the preferred way, yes |
22:02:34 | FromDiscord | <Clyybber> leorize: Can you check https://github.com/nim-lang/Nim/pull/16748/files since you use haiku yourself ? |
22:02:35 | disbot | ➥ [backport 1.0.x] fix config/nim.cfg: `@if not bsd or haiku:` was buggy |
22:02:56 | FromDiscord | <lqdev> from what i heard i think {.inject.} may also work but don't quote me on that |
22:03:39 | FromDiscord | <Clyybber> Yep, inject will work too |
22:04:02 | leorize[m] | @Clyybber it's fine, he just turn multiple ifs into if-elseif chains |
22:04:06 | * | leorize quit (Ping timeout: 268 seconds) |
22:05:18 | FromDiscord | <Clyybber> ah I see. So the bug was the not bsd or haiku not being not(bsd or haiku) |
22:08:15 | FromDiscord | <cji> @lqdev thanks! |
22:11:45 | * | lritter joined #nim |
22:19:03 | FromDiscord | <Clyybber> disruptek: damnit, you broke my build just when I fixed it |
22:19:11 | disruptek | what? |
22:21:45 | FromDiscord | <Clyybber> bump |
22:22:00 | disruptek | broke it how? |
22:22:25 | disruptek | !pulls author:disruptek |
22:22:28 | disbot | https://github.com/nim-lang/Nim/pull/16517 -- 3disable disruptek, add frosty, testes (disabled) |
22:22:28 | disbot | https://github.com/nim-lang/Nim/pull/16390 -- 5add jason to important packages |
22:22:28 | disbot | https://github.com/nim-lang/Nim/pull/16323 -- 5incremental compilation for the frontend 7& 27 more... |
22:22:49 | disruptek | why don't you merge 16517 so i don't have to worry about you, chucklehead? |
22:23:20 | FromDiscord | <Clyybber> bump/tests/tbump.nim(5, 8) Error: cannot open file: bump |
22:23:31 | FromDiscord | <Clyybber> its the switch to balls I presume |
22:23:35 | disruptek | of course. |
22:23:51 | FromDiscord | <Clyybber> ah issue on our end I guess |
22:23:54 | disruptek | of course. |
22:24:02 | disruptek | and one i've already patched and PR'd. |
22:24:40 | FromDiscord | <Clyybber> Does it need to be installed for the test to work? |
22:24:50 | disruptek | what kind of a question is that? |
22:25:11 | FromDiscord | <Clyybber> Sry, I should look myself |
22:25:17 | FromDiscord | <Clyybber> mobile laziness |
22:25:34 | disruptek | balls has to be compiled before it can be run, yes. |
22:25:59 | FromDiscord | <Clyybber> ah its somehow a path issue |
22:26:04 | disruptek | indeed. |
22:26:07 | disruptek | #16447 |
22:26:08 | disbot | https://github.com/nim-lang/Nim/issues/16447 -- 3testament fails for packages that require $NIMBLE_DIR/bin in PATH ; snippet at 12https://play.nim-lang.org/#ix=2LQ3 |
22:26:19 | FromDiscord | <Clyybber> your tbump expects bump to be installed as a package |
22:26:30 | FromDiscord | <Clyybber> no its not the binary issue here |
22:26:36 | disruptek | yes, it is. |
22:26:53 | FromDiscord | <Clyybber> but the line where it fails is "import bump" |
22:26:59 | disruptek | so what? |
22:27:02 | FromDiscord | <Clyybber> not "execute bump" |
22:27:05 | disruptek | you're not running my test runner. |
22:27:30 | FromDiscord | <Clyybber> I'm just saying that its a different issue I think |
22:27:45 | disruptek | well, you can think and say what you want, but i've explained the issue. |
22:28:01 | disruptek | tbump does not run bump. |
22:28:01 | FromDiscord | <Clyybber> please explain why the import fails |
22:28:09 | disruptek | because there's no path to bump.nim. |
22:28:14 | disruptek | balls adds it. |
22:28:17 | Araq | the issue is that my IC refactoring break your code |
22:28:20 | disruptek | tbump.nim.cfg was removed recently. |
22:28:37 | FromDiscord | <Clyybber> Araq: No its in my PR |
22:28:45 | FromDiscord | <Clyybber> the issue can be fixed |
22:28:47 | Araq | and I haven't yet looked why, but I did notice that the code never worked correctly anyway |
22:28:51 | FromDiscord | <Clyybber> I did it for cligen once |
22:29:21 | FromDiscord | <Clyybber> Its just a --path:. in importantpackages |
22:29:23 | Araq | btw tests\exception\t13115.nim fails on my machine |
22:29:56 | * | leorize joined #nim |
22:30:08 | Araq | maybe we need an AraqsMachine special case for testament |
22:30:27 | Araq | as I couldn't care less if my exception messages handle binary zero properly |
22:30:52 | Araq | sure, let's have binary data in human readable error messages, what could go wrong |
22:31:20 | FromDiscord | <Clyybber> lol |
22:31:22 | Araq | BUG! My teeth hurt when I eat stone. |
22:32:11 | FromDiscord | <Clyybber> disruptek: aah thats the issue |
22:32:17 | disruptek | yes. |
22:32:26 | FromDiscord | <Clyybber> Araq: Are you testing on windows? |
22:33:09 | disruptek | this glass tastes like blood. fix it! |
22:33:19 | Araq | I'm always on Windows, don't want to debug my OS when I debug my compiler. |
22:33:31 | * | disruptek sighs. |
22:33:40 | disruptek | malloc(): unsorted double linked list corrupted |
22:34:31 | Araq | tomorrow I'll be on OSX though, Apple said I'll get an M1 tomorrow |
22:34:48 | FromDiscord | <Clyybber> yeah I heard you got one thats why I wondered |
22:35:30 | FromDiscord | <Clyybber> disruptek: Inb4 are you going to do the same for sigv4? |
22:35:43 | FromDiscord | <Clyybber> Since thats another pkg we test from you |
22:35:48 | disruptek | of course. it's important to me that my software works. |
22:35:55 | FromDiscord | <Clyybber> And I can update it in advance then |
22:35:56 | FromDiscord | <Clyybber> Ok |
22:35:57 | disruptek | it's not so important to me that your compiler passes tests. |
22:36:03 | FromDiscord | <Clyybber> sure |
22:36:23 | disruptek | especially when, as i said, i already submitted a PR to disable all my shit in important_packages. |
22:36:29 | disruptek | nothing more i can do. |
22:36:52 | FromDiscord | <Clyybber> yeah, I'm not asking you to do anything |
22:37:16 | Araq | so ... it occured to me that my IC related backend changes could simply always be done |
22:37:31 | FromDiscord | <Clyybber> The DCE? |
22:37:33 | Araq | yeah |
22:37:37 | FromDiscord | <Clyybber> cool |
22:37:40 | Araq | it's much more elegant this way... |
22:38:25 | Araq | btw apparently we generate 5000 destructors for system.nim |
22:38:43 | Araq | that doesn't feel right... |
22:38:59 | disruptek | i like it; i feel lonely with less than 3500. |
22:39:38 | FromDiscord | <Clyybber> Araq: I mean everything uses something from system.nim no? |
22:39:49 | FromDiscord | <Clyybber> Or is that really system.nim alone? |
22:39:58 | Araq | system.nim alone |
22:40:03 | FromDiscord | <Clyybber> huh |
22:40:16 | * | grobe0ba quit (Ping timeout: 240 seconds) |
22:40:22 | Araq | well we have lots of trivial destructors I guess |
22:40:46 | Araq | but we always do it, even with --gc:refc etc |
22:41:42 | FromDiscord | <Clyybber> we dont need to generate the trivial destructors even with gc arc no? |
22:42:10 | FromDiscord | <Clyybber> eh nevermind |
22:42:39 | Araq | we don't need to, but we do |
22:42:42 | Araq | I think. |
22:43:25 | Araq | but there is a more interesting problem: *when* do we attach a non-trivial/trivial destructor to a type? |
22:43:57 | Araq | the spec says "when the type T is used in context X" |
22:45:07 | Araq | but this violates modularity, doesn't it? what if type T is not used in the module at all but exported and then some later module uses T? |
22:45:45 | FromDiscord | <Clyybber> Then we do it at definition instead? |
22:46:19 | Araq | can't work, you cannot even put the =destroy inside an object declaration |
22:47:00 | FromDiscord | <Clyybber> I dont understand |
22:47:14 | Araq | we need a rule like: at the end of a module =destroy for T is generated |
22:47:17 | FromDiscord | <Clyybber> Do you mean attach in the context of the compiler |
22:47:20 | FromDiscord | <Clyybber> ah |
22:48:10 | FromDiscord | <Clyybber> Because the destroy gets put into the rodfile? |
22:48:24 | Araq | of course |
22:50:51 | FromDiscord | <Clyybber> Must be careful with recursive imports I think |
22:52:12 | * | grobe0ba joined #nim |
22:52:19 | FromDiscord | <Clyybber> Araq: Does DCE mean that system.nim.c will need to be recompiled if a sym of it becomes unused? |
22:53:02 | FromDiscord | <Clyybber> If so, it might make sense to have a switch to disable it, at the cost of binary bloat |
22:53:09 | Araq | yes and there is no alternative. |
22:53:46 | Araq | you can argue that when you use symbol X from M that was previously unused we can generate M2.nim.c that only contains X. |
22:54:14 | Araq | But since no such solution exists for removing a symbol, there is no need to implement that solution |
22:54:53 | Araq | and I suspect it's rare that you change what you use from system.nim |
22:55:18 | FromDiscord | <Clyybber> What about just not removing it. People dont care if their binary size grows if they just want to build and debug fast |
22:55:54 | FromDiscord | <Clyybber> We could warn then once the bloat reaches a critical point |
22:57:25 | Araq | because then you need to recompile "just in case" when you care for size |
22:58:35 | Araq | I usually design for "no switch required, not yet another thing you need to keep in mind" |
22:58:56 | FromDiscord | <Clyybber> Yeah fair. We could do it behind the scenes |
22:59:14 | FromDiscord | <Clyybber> and only for --debug not release or danger |
22:59:39 | Araq | also, the better solution is to simply slim down system.nim |
23:00:10 | Araq | assert and io at least should have been their own imports |
23:01:34 | * | tane quit (Quit: Leaving) |
23:02:02 | * | a_b_m quit (Quit: Leaving) |
23:43:28 | FromDiscord | <juliuskiesian> i hope i'm not the only one who's running into this, but the vscode extension actually renames stuff in the std lib when i try to rename a var in my project. |
23:47:11 | * | Vladar quit (Quit: Leaving) |
23:47:41 | * | idf quit (Ping timeout: 256 seconds) |
23:47:42 | * | idf_ joined #nim |
23:48:36 | * | junland quit (Ping timeout: 256 seconds) |
23:48:51 | * | junland joined #nim |
23:50:03 | FromDiscord | <juliuskiesian> my `lib/core/macros.nim` got messed up twice in the past two weeks. |
23:50:37 | leorize | which extension are you using? |
23:50:40 | disruptek | which vscode extension are you using? |
23:50:45 | disruptek | heh |
23:50:49 | disruptek | ^ saem |
23:51:16 | FromDiscord | <juliuskiesian> kosz78.nim |
23:51:34 | saem | notit! |
23:51:45 | FromDiscord | <juliuskiesian> v0.6.6 |
23:51:46 | saem | Guaranteed mine has the same bug, though |
23:52:28 | disruptek | my entire day was spent on bullshit. |
23:52:46 | saem | I mean you can give my extension a shot and see if it poops the bed or not. |
23:53:09 | FromDiscord | <juliuskiesian> sure, which one is it? |
23:53:16 | saem | disruptek: we're having the same day |
23:53:39 | FromDiscord | <juliuskiesian> nimsaem, i assume? |
23:53:43 | saem | julius: the good one, obviously |
23:53:45 | saem | LoL |
23:53:47 | saem | Yeah |
23:53:57 | FromDiscord | <juliuskiesian> do i need to remove the old one, then? |
23:54:12 | saem | Yeah, I think you can just disable it |
23:54:31 | saem | Might have to remove, I don't use it for obvious reasons |
23:55:18 | saem | Can't say for sure. |
23:55:38 | disruptek | someone told me that a fork is the opposite of collaboration. |
23:55:53 | disruptek | if that's the case, perhaps it explains all the cutlery here: |
23:55:56 | disruptek | !repo nimble |
23:55:58 | disbot | https://github.com/nim-lang/nimble -- 9nimble: 11Package manager for the Nim programming language. 15 789⭐ 133🍴 7& 29 more... |
23:56:23 | Araq | cutlery? |
23:56:32 | disruptek | the knife cuts both ways. |
23:56:36 | saem | Anyhow, if the bug happens there please raise an issue or better yet give a fix a whirl. |
23:56:59 | Araq | never heard of such a bug before |
23:57:12 | FromDiscord | <juliuskiesian> saem, it happens there, too. |
23:57:16 | saem | Sweet |
23:57:19 | saem | I guess |
23:57:23 | Araq | what I noticed is that VScode can trunc files when your HD is full |
23:57:31 | Araq | which kinda makes sense I guess |
23:57:55 | disruptek | yeah, i never would have guessed that this isn't what the user wants. |
23:58:15 | saem | Imma say that FS full issues aren't something to prioritize rn. 😄 |
23:58:21 | disruptek | afaic, not using every bit of my hard-drive is a bug. |
23:58:27 | FromDiscord | <juliuskiesian> saem, both extensions seem to have something agains L550 in macros.nim. |
23:58:48 | FromDiscord | <juliuskiesian> they always find a way to mess up that line. |
23:59:12 | FromDiscord | <juliuskiesian> (edit) "agains" => "against" |