00:05:12 | FromDiscord | <treeform> I know, but it's hard to explain |
00:06:25 | FromDiscord | <treeform> https://github.com/treeform/ws/blob/master/tests/chat.nim |
00:06:42 | FromDiscord | <treeform> See how it's done with websocket |
00:06:55 | FromDiscord | <treeform> You could replace that with regular socket |
00:07:12 | FromDiscord | <treeform> But you'll have to do your own frameing |
00:08:23 | * | krux02_ joined #nim |
00:11:28 | * | krux02 quit (Ping timeout: 264 seconds) |
00:15:19 | * | uu91 quit (Read error: Connection reset by peer) |
00:15:34 | * | uu91 joined #nim |
00:36:05 | * | uu91 quit (Read error: Connection reset by peer) |
00:36:23 | * | uu91 joined #nim |
00:58:05 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
01:20:23 | jken | Anyone got a tldr on how to use system's offsetOf? |
01:21:31 | jken | actually, turns out im just an idiot! |
01:57:37 | * | seni quit (Quit: Leaving) |
02:31:42 | * | uu91 quit (Read error: Connection reset by peer) |
02:32:05 | * | uu91 joined #nim |
02:45:33 | disruptek | i'm getting `template instantiation too nested` all over nimsuggest in today' devel. is this the "bugfix" that went in for `since`? |
02:46:56 | * | uu91 quit (Ping timeout: 268 seconds) |
02:47:53 | * | uu91 joined #nim |
02:55:01 | * | GordonBGood joined #nim |
02:58:27 | * | lritter quit (Ping timeout: 240 seconds) |
02:59:14 | * | lritter joined #nim |
04:31:06 | * | rockcavera quit (Remote host closed the connection) |
04:49:51 | * | chemist69 quit (Ping timeout: 264 seconds) |
04:50:47 | * | nif quit (Quit: ...) |
04:50:57 | * | nif joined #nim |
04:51:47 | * | chemist69 joined #nim |
04:58:38 | * | endragor joined #nim |
05:00:26 | * | theelous3 quit (Ping timeout: 240 seconds) |
05:02:07 | * | theelous3_ joined #nim |
05:30:20 | * | dddddd quit (Remote host closed the connection) |
05:56:34 | * | uu91 quit (Read error: Connection reset by peer) |
05:56:49 | * | uu91 joined #nim |
06:25:10 | * | uu91 quit (Read error: Connection reset by peer) |
06:25:24 | * | uu91 joined #nim |
06:40:25 | * | snowolf joined #nim |
06:54:17 | * | NimBot joined #nim |
07:05:44 | * | narimiran joined #nim |
07:23:49 | * | GordonBGood quit (Ping timeout: 268 seconds) |
07:43:47 | * | jwm2241 quit (Quit: WeeChat 2.7-dev) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:04:51 | * | gmpreussner joined #nim |
08:12:26 | * | lritter quit (Ping timeout: 240 seconds) |
08:20:37 | Zevv | fix one, get two for free! |
08:22:21 | * | tdc quit (Quit: Leaving) |
08:36:30 | * | endragor_ joined #nim |
08:38:50 | * | endragor quit (Ping timeout: 240 seconds) |
08:52:50 | * | solitudesf joined #nim |
08:58:33 | FromDiscord | <IanIAnIAN> @exelotl can you give an example |
09:13:42 | * | leorize quit (Remote host closed the connection) |
09:15:47 | * | leorize joined #nim |
09:35:52 | * | livcd quit (Quit: Lost terminal) |
09:45:16 | * | hoijui joined #nim |
10:09:24 | FromDiscord | <demotomohiro> @IanIAnIAN My Nim code that write PNG image file using nimPNG: |
10:09:30 | FromDiscord | <demotomohiro> https://colab.research.google.com/drive/15w2dtk9QE8QDTsqMeRnWCzR7f2kSseoq |
10:31:51 | FromGitter | <mratsim> very nice |
10:33:08 | * | solitudesf quit (Ping timeout: 268 seconds) |
10:33:25 | FromGitter | <mratsim> you should share it there @demotomohiro: https://forum.nim-lang.org/t/5480 |
10:42:56 | * | endragor_ quit (Remote host closed the connection) |
10:44:56 | * | kungtotte quit (Read error: Connection reset by peer) |
10:48:50 | * | jwm224 quit (Ping timeout: 276 seconds) |
10:49:29 | * | jwm224 joined #nim |
11:03:23 | FromDiscord | <demotomohiro> @mratsim thx! I posted there. |
11:23:05 | * | ponyrider quit (Ping timeout: 268 seconds) |
11:32:23 | * | theelous3_ quit (Ping timeout: 276 seconds) |
11:40:51 | Araq | disruptek, I think it's caused by something else, my version-patch affects .templateCall in procs which previously |
11:40:53 | Araq | oh wait |
11:41:07 | Araq | rebuild your nimsuggest |
11:41:13 | Araq | then it might work |
11:52:44 | * | endragor joined #nim |
12:14:00 | * | endragor quit (Remote host closed the connection) |
12:33:02 | * | PMunch joined #nim |
12:34:49 | * | Hideki_ joined #nim |
12:34:51 | * | kungtotte joined #nim |
12:36:00 | * | endragor joined #nim |
12:43:37 | * | vsantana joined #nim |
12:45:26 | * | nsf joined #nim |
12:48:06 | * | clyybber joined #nim |
13:00:43 | * | solitudesf joined #nim |
13:02:14 | FromGitter | <mratsim> what's the state of the language server, was it @PMunch? |
13:02:50 | PMunch | Running in the background |
13:03:03 | PMunch | Well not really, I don't have my editor open |
13:03:36 | PMunch | Just kidding, its working well. Updated it yesterday to be possible to run "nimble install nimlsp" and it "just works" |
13:04:16 | * | endragor quit (Remote host closed the connection) |
13:04:32 | * | endragor joined #nim |
13:05:10 | clyybber | solitudesf: Have you tried nim-lsp with kak-lsp? |
13:05:19 | solitudesf | yes |
13:05:30 | solitudesf | it works, but isnt stable |
13:05:32 | FromGitter | <mratsim> btw for generic collections @Araq, when we have multiple ptr objects does Nim generate a "pointer" collection or does it generate multiple identical proc except the name (monomorphization) |
13:05:53 | PMunch | What do you mean isn't stable? |
13:05:56 | PMunch | When did you try it? |
13:06:03 | clyybber | solitudesf: Because nim-lsp isn't stable or because kak-lsp isn't stable? |
13:06:06 | solitudesf | every time i open nim file |
13:06:14 | solitudesf | that one i dont know for sure |
13:10:31 | clyybber | leorize: Is nimsuggest stable by now? |
13:14:17 | * | fredrik92 joined #nim |
13:17:53 | * | livcd joined #nim |
13:18:42 | Araq | mratsim: it's silly and instantiates per ptr type. IMO this should be fixed on a lower level, proc body deduplication is trivial for an assembler |
13:23:27 | FromGitter | <mratsim> It might be fixed in C++ (http://www.stroustrup.com/SCARY.pdf) but I'm not sure C compilers will detect that. |
13:23:42 | FromGitter | <mratsim> they are pretty dumb when a block of code gets too big |
13:24:26 | FromGitter | <mratsim> like if you repeat something 243 times with just an index change they are able to transform that into a for loop, but at the 244 times they wont, or something like that |
13:25:19 | FromGitter | <mratsim> I'll put a feature request at low-priority and someone with time can measure |
13:25:36 | clyybber | Guddamnit, encountering the same bug with genArrayLen, but forgot how I fixed it. And I destroyed the commit history |
13:27:48 | * | rockcavera joined #nim |
13:27:49 | FromGitter | <mratsim> check in reflog? |
13:28:27 | clyybber | I tried, but I can't figure out how to view a single commit from there without overwriting my current branch |
13:29:12 | FromGitter | <mratsim> cp -a myrepo{,2} |
13:30:23 | clyybber | yeah, no way around it |
13:31:30 | * | couven92 quit (Disconnected by services) |
13:31:35 | * | fredrik92 is now known as couven92 |
13:31:59 | * | fredrik92 joined #nim |
13:32:08 | * | endragor quit (Remote host closed the connection) |
13:32:36 | * | PMunch quit (Remote host closed the connection) |
13:38:10 | Araq | Hint: passing ':env' to a sink parameter introduces an implicit copy; use 'move(:env)' to prevent it [Performance] |
13:38:28 | Araq | ha ha ha, good one, I definitely cannot write 'move(:env)' |
13:38:39 | Araq | as I didn't even write the :env part |
13:38:45 | * | stefantalpalaru quit (Ping timeout: 268 seconds) |
13:40:06 | * | hoijui quit (Quit: Leaving) |
13:40:52 | clyybber | heh; |
13:42:11 | clyybber | Maybe we need a flag to make injectdestructors silence those warnings for some stuff generated in the earlier passes |
13:48:08 | disruptek | Araq: not fixed by rebuilding nimsuggest. |
13:49:07 | leorize | clyybber: it's kinda stable |
13:49:31 | leorize | however if you try to use it against some modules like system.nim, you're in for a bad time |
13:49:55 | Araq | disruptek, can you gist the log again please? |
13:49:55 | leorize | but it might be that the highlight function is not well tested |
13:50:20 | Araq | clyybber, we need some frontend inling, the code bloat is rather bad otherwise |
13:50:51 | disruptek | i'm just seeing this in leorize's plugin. what incantation will generate a log you want? |
13:51:10 | Araq | what do you think about t.attachedOps[attachedDestructor] containing an AST pattern to inline? |
13:51:34 | Araq | there is no need to make this always an nkProcDef that we later hope is optimized out |
13:51:53 | leorize | disruptek: edit autoload/nim/suggest.vim, then add '--log' and '--debug' to the arg list |
13:52:04 | disruptek | cool, ty. |
13:52:23 | leorize | you will get a nimsuggest.log file in your home directory |
13:52:29 | clyybber | Araq: Yeah, I think thats a good idea. But I'd test if it makes any difference as opposed to just adding __inline |
13:52:53 | disruptek | neat. |
13:53:32 | disruptek | http://ix.io/21hv/+ |
13:53:33 | disbot | ^ play at https://play.nim-lang.org/#ix=21hv 😏 |
13:53:43 | Araq | clyybber, but I don't want to dig into the C code, I mean less C code is easier to read |
13:53:43 | disruptek | now that's a bug. |
13:54:04 | Zevv | disruptek: make your bot check if its nim before putting it into playground! |
13:54:14 | disruptek | it does. that's the bug. |
13:54:43 | clyybber | Araq: I wonder if it will cause any problems to inline in the frontend.. |
13:55:11 | Araq | general inlining is hard but the code patterns for 'ref' destructors are trivial to deal with |
13:55:53 | clyybber | Araq: Ah, yeah sure. But in general I don't think we should try to inline the destructors, better leave most of it to C. |
13:56:10 | clyybber | Because I think the code will be much less readable with inlined =destroys mixed in randomly |
13:56:17 | clyybber | instead of just =destroy calls |
13:56:26 | clyybber | (If I understood you right) |
13:58:58 | * | jjido joined #nim |
13:59:02 | Araq | disruptek, might be caused by nimsuggest's secrets |
13:59:25 | disruptek | neat. is there a secret decoder ring? |
13:59:31 | Araq | nimsuggest actually tries to type-check generics to some extend iirc |
13:59:55 | Araq | probably a good idea to turn this off |
14:00:55 | disruptek | any idea why i'm tripping it? |
14:02:00 | * | stefantalpalaru joined #nim |
14:03:00 | * | stefantalpalaru quit (Changing host) |
14:03:00 | * | stefantalpalaru joined #nim |
14:05:28 | Araq | never mind, I misremembered, no idea |
14:05:49 | Araq | but if system.nim has an error it's failing rather early |
14:07:23 | FromGitter | <alehander92> whats up |
14:07:24 | FromGitter | <alehander92> these days |
14:09:21 | disruptek | it's something to do with my imports; i'll figure it out today. |
14:30:09 | FromGitter | <auxym> google is failing me; does nim have something like python's `del` (ie, explicitly tell the GC we won't need something anymore)? |
14:30:31 | * | Dvlv2 joined #nim |
14:33:16 | * | Hideki_ quit (Remote host closed the connection) |
14:33:57 | * | dddddd joined #nim |
14:34:02 | Araq | auxym: not really, you can assign to 'nil' for ref types |
14:34:25 | FromGitter | <auxym> makes sense, thanks |
14:34:35 | * | Hideki_ joined #nim |
14:34:53 | FromDiscord | <Rika> you can make a template for it if you really want a del "keyword" |
14:36:49 | * | Hideki_ quit (Remote host closed the connection) |
14:37:01 | * | Hideki_ joined #nim |
14:37:19 | Dvlv2 | Hello, could someone please tell me how to convert a json object to a string? j.to(string) is giving me a JsonKindError |
14:37:30 | Araq | $ |
14:38:10 | FromDiscord | <Rika> used like "$j" |
14:38:13 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:38:17 | FromDiscord | <Rika> if you didnt understand |
14:39:48 | Dvlv2 | Yay, thank you both! |
14:40:10 | FromDiscord | <Rika> you can use $ to convert most things to a string btw |
14:40:25 | Dvlv2 | oh right, nice |
14:43:10 | * | Dvlv2 quit (Remote host closed the connection) |
14:44:27 | clyybber | Araq: How bad is it do add a hidden node to TNode? |
14:44:57 | clyybber | I have defaultfields implementation fully working now, in transf. But the code duplication (and computation duplication) is kinda bad |
14:45:17 | Araq | code duplication --> extract into a common helper module |
14:46:02 | Araq | computation duplication: we don't have good mechanisms for it, consider that I'm fighting the caching of transf already (bugfix in the works) |
14:46:17 | clyybber | Araq: Problem is I need stuff like considerQuotedIdent, and that requires a PContext arg, only for error handling though, which I don't need in transf. So I duplicated it and removed the error handling. |
14:47:33 | * | Hideki_ quit (Remote host closed the connection) |
14:48:08 | * | Hideki_ joined #nim |
14:49:06 | clyybber | Its hard to extract things like these into some common helper module |
14:51:58 | * | vsantana quit (Remote host closed the connection) |
14:52:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
14:52:53 | * | vsantana joined #nim |
14:56:11 | FromGitter | <mratsim> I'm runnning out of names for helpers modules. You can only have 3 "tools", "utils" and "helpers" |
14:56:38 | FromGitter | <mratsim> oh "aux" works too |
14:56:53 | FromGitter | <mratsim> :mind_blown: |
14:56:54 | disruptek | mules, donkeys, asses... |
14:57:40 | FromGitter | <alehander92> <topic>_utils |
14:57:44 | FromGitter | <alehander92> toolkit |
14:57:54 | FromGitter | <alehander92> or just <topic> |
15:03:11 | Araq | utilities vs utils is great too |
15:03:19 | Araq | 'common' |
15:03:26 | clyybber | Araq: Maybe I could store the information in the nkType node of the object constructor? I could add a new nodeflag that makes it hidden from macros |
15:03:31 | Araq | 'base' |
15:03:58 | Araq | clyybber, how about changing the nkType to something else? |
15:04:10 | Araq | it's redundant anyway in a typed AST |
15:04:13 | clyybber | But then that would break macros? |
15:04:15 | clyybber | Oh |
15:04:22 | clyybber | Yeah. |
15:04:29 | Araq | nkObjConstr(nkNewHere, ...) |
15:04:38 | Araq | it will work :P |
15:05:00 | Araq | most macros don't look at son[0] for nkObjConstr |
15:05:21 | clyybber | Ah cool. And if they do they will find "chosen branches" lol :p |
15:09:47 | clyybber | Araq: Should I maybe attach a nfInternal flag to the node then? So that it warns when accessed within a macro? |
15:10:25 | clyybber | Ah, better not to, I guess. |
15:10:43 | Araq | the flag is called nfSem and already exists |
15:11:22 | clyybber | oh |
15:16:14 | clyybber | Araq: Can it happen that a node will be semchecked twice? |
15:16:18 | clyybber | Because of macros? |
15:29:03 | * | Hideki_ joined #nim |
15:33:43 | * | Hideki_ quit (Ping timeout: 265 seconds) |
15:43:18 | FromGitter | <deech> Are the download links for pre-built nim binaries more or less stable? Currently it's set to https://nim-lang.org/download/nim-1.0.2-linux_x32.tar.xz and I'd like to be able to bake that into a script without it breaking too much for future versions. |
16:03:25 | * | Hideki_ joined #nim |
16:23:06 | * | vsantana quit (Remote host closed the connection) |
16:26:26 | * | theelous3 joined #nim |
16:26:54 | Araq | stable |
16:29:30 | disruptek | it's cool that you can dispatch on mutability. i'm starting to get it... |
16:34:45 | * | ng0 joined #nim |
16:34:51 | * | Hideki_ quit (Ping timeout: 250 seconds) |
16:41:34 | * | abm joined #nim |
16:42:44 | FromDiscord | <Avatarfighter> Hello everyone ! |
16:42:47 | FromDiscord | <Avatarfighter> Long time no see |
16:43:29 | FromGitter | <mratsim> hello there |
16:49:03 | * | abm quit (Read error: Connection reset by peer) |
17:03:44 | clyybber | Hi |
17:04:11 | FromGitter | <alehander92> <3 |
17:05:12 | FromGitter | <alehander92> how are you |
17:05:22 | FromGitter | <alehander92> i am going to play with the kernel again now |
17:05:26 | FromGitter | <alehander92> maybe using twitch |
17:13:04 | lqdev[m] | Nim doesn't support multiple inheritance, does it? |
17:13:30 | clyybber | Nope |
17:14:13 | lqdev[m] | good. |
17:14:57 | lqdev[m] | I need to know that because I'm doing some type equality checking, and I don't know if I should assume an object can inherit from more than one object. |
17:23:03 | FromGitter | <alehander92> https://www.twitch.tv/alehander42 |
17:37:34 | lqdev[m] | is GC_ref/GC_unref available for all GCs, or only refc/markAndSweep? |
18:02:24 | clyybber | alehander92: Trying to debug the kernel with gdb? |
18:02:51 | * | lritter joined #nim |
18:03:23 | clyybber | alehander92: You crashed? |
18:03:24 | * | nsf quit (Quit: WeeChat 2.6) |
18:09:05 | FromDiscord | <krab4t> offline 🙂 |
18:12:06 | * | rockcavera quit (Remote host closed the connection) |
18:13:21 | * | GordonBGood joined #nim |
18:17:59 | * | GordonBGood quit (Ping timeout: 276 seconds) |
18:18:20 | FromGitter | <alehander92> i |
18:18:27 | FromGitter | <alehander92> my phone got no battery |
18:18:30 | FromGitter | <alehander92> and my internet is from it |
18:18:32 | FromGitter | <alehander92> :) |
18:18:51 | FromGitter | <alehander92> so this is more easy clyybber |
18:19:07 | FromGitter | <alehander92> i just debug my kernel, not the linux one :( |
18:19:27 | FromGitter | <alehander92> currently trying more to understand the interrupts thing and preemptive |
18:39:58 | * | filcuc joined #nim |
18:40:49 | federico3 | only a LTE uplink and no backup? |
18:42:30 | * | Hideki_ joined #nim |
18:46:56 | * | Hideki_ quit (Ping timeout: 246 seconds) |
19:00:11 | * | snwmzr quit (Remote host closed the connection) |
19:00:16 | * | hashbjorn quit (Quit: ZNC - http://znc.in) |
19:06:53 | clyybber | ugh |
19:07:10 | clyybber | i hate bugs but i love bugs |
19:07:26 | disruptek | i know the feeling. |
19:07:41 | disruptek | i love bugs in my code; other code, not so much. |
19:08:09 | clyybber | do you know the feeling that you get when the backend just ignores your nodes depending on where you get them from? |
19:08:18 | clyybber | because I do and its pure wtf |
19:08:26 | * | filcuc quit (Ping timeout: 240 seconds) |
19:08:37 | disruptek | where are you getting your nodes, you baddie? |
19:09:13 | disruptek | do you know the feeling when you realize that nimble allows completely contradictory duplicate package requirements? |
19:09:14 | clyybber | i'm sneaking them from sem to transf |
19:09:19 | disruptek | because i do and it's pure wtf |
19:09:20 | clyybber | illegal smuggling |
19:09:22 | clyybber | so pssh |
19:10:01 | clyybber | disruptek: I know the feeling of trying to use nimble to install glfw |
19:10:20 | clyybber | (glfw is ambiguous) |
19:10:20 | disruptek | you poor soul. |
19:10:31 | clyybber | not a poor soul anymore |
19:10:34 | clyybber | I have ascended |
19:10:39 | clyybber | to submodules |
19:11:01 | clyybber | I plan on becoming a submodule myself one day |
19:11:06 | FromDiscord | <Avatarfighter> lmao |
19:12:51 | clyybber | disruptek: And now I know the feeling of talking bullshit and actually finding the bug in my own stupid code in the form of a missing return statement.. |
19:17:47 | * | uu91 quit (Ping timeout: 276 seconds) |
19:20:14 | * | uu91 joined #nim |
19:35:13 | Araq | async compiles with --gc:destructors! |
19:35:17 | * | eys joined #nim |
19:35:24 | clyybber | Araq: Damn fine! |
19:35:25 | Araq | now it only has to work without crashing :P |
19:35:36 | clyybber | That was my next question :p |
19:35:36 | Araq | but it does compile, no more wrong C code produced |
19:35:49 | FromGitter | <Willyboar> Congrats! |
19:35:51 | Araq | but crashes are hard and it's weekend |
19:36:00 | Araq | so I'm gonna implement .cursor instead :P |
19:37:51 | Araq | we should have valgrind tests for the CIs |
19:37:56 | clyybber | Yep |
19:38:15 | Araq | narimiran, please look into it |
19:38:15 | clyybber | Umm, regarding .cursor, why did we decide we don't need them again? |
19:38:26 | Araq | because of 'lent T' |
19:38:39 | clyybber | Ah, and why do we need them now? |
19:38:43 | clyybber | We have lent T? |
19:38:43 | Araq | but 'lent ref T' would be another indirection |
19:38:51 | Araq | well |
19:39:02 | Araq | not if we implement my lent optimization |
19:39:10 | Araq | but then 'lent' still means 'immutable' |
19:39:20 | clyybber | And lent var can mean mutable |
19:39:31 | Araq | ugly |
19:39:32 | clyybber | Or var can imply lent var |
19:39:55 | Araq | we need .cursor for 2 things: |
19:40:05 | Araq | for local ref variables that are used as cursors. |
19:40:14 | Araq | for back pointers so that they are not RC'ed. |
19:40:33 | Araq | which can also be seen as helper for navigation inside a data-structure aka 'cursor' |
19:40:40 | Araq | so the name fits perfectly |
19:41:02 | clyybber | hmm |
19:41:10 | clyybber | do you want to make it a pragma? |
19:41:16 | clyybber | or `cursor T`? |
19:41:18 | Araq | yes |
19:41:42 | clyybber | Why don't we just say lent T as a local variable is a {.cursor.}? |
19:42:42 | Araq | because then it would be an immutable view into the data |
19:42:52 | Araq | but cursors are frequently used for updating a node |
19:44:17 | clyybber | hmm. |
19:45:10 | clyybber | So {.cursor.} as a return type modifier is the same as var? |
19:45:55 | disruptek | one that doesn't count, sure. |
19:46:14 | Araq | .cursor is not a return type modifier |
19:46:34 | clyybber | Araq: Ok so, cursor is to local variables what var and lent are as return types? |
19:46:57 | Araq | there is some overlap but 'var' is always a hidden pointer |
19:47:07 | Araq | 'lent' is too currently, but doesn't have to be |
19:47:36 | * | ng0 quit (Ping timeout: 260 seconds) |
19:47:38 | disruptek | you can't return a cursor but you can pragma a var as such? |
19:47:40 | * | eys quit (Quit: eys) |
19:47:48 | FromDiscord | <Avatarfighter> Stupid question, but is going to be an advantage of using -gc:destructors? |
19:47:54 | FromDiscord | <Avatarfighter> what is going to be* |
19:48:33 | FromDiscord | <Avatarfighter> Actually I have a new question, what is destructors lol |
19:48:47 | disruptek | check out the RFCs repo under /Nim |
19:49:17 | FromDiscord | <Avatarfighter> I'm doing that right now 😄 |
19:50:06 | * | ng0 joined #nim |
19:50:16 | FromDiscord | <Avatarfighter> wait this is really cool |
19:50:32 | Araq | disruptek, yes |
19:51:16 | clyybber | Araq: I think we should call it {.lent.} instead of cursor then. I think both names are fine, but since they basically denote the same concept we should name them the same IMO |
19:51:18 | disruptek | so they can't escape to a parent scope? |
19:53:05 | Araq | clyybber, but 'lent' is close to 'let' aka immutable and cursors aren't |
19:53:41 | clyybber | Araq: But why not make lent a modifier meaning exactly what it says: lent variable, and not influencing immutability |
19:53:52 | clyybber | or mutability |
19:54:32 | Araq | what's a 'lent' variable? |
19:54:42 | Araq | currently it's only valid for return types |
19:54:47 | clyybber | One that is not owned by me. |
19:54:56 | clyybber | That I'm only borrowing so to say. |
19:55:07 | Araq | variables are always attached to a scope, pointer values can be borrowed |
19:56:35 | Araq | I don't see good alternative designs tbh |
19:57:01 | clyybber | Borrowning means that I wont destroy it. |
19:57:04 | Araq | in C++ 'var T' is & and 'lent T' is const& and C++ has no "cursors" |
19:57:42 | Araq | in C++ I'm left with raw pointers to with references to shared_ptr which is the double indirection that I seek to avoid |
19:57:54 | disruptek | cursor is a superset of lent, sounds-like. |
19:58:34 | Araq | and as mratsim figured out .cursor doesn't prevent a moving GC from working |
19:58:51 | * | thomz joined #nim |
19:58:54 | clyybber | Araq: But we can optimize that double indirection |
19:59:10 | clyybber | And after all lent T shouldnt be a pointer unless combined with var/needed |
19:59:13 | clyybber | IMO |
19:59:20 | Araq | ok, but then 'cursor' is the better name, so it should be 'cursor T' |
19:59:38 | Araq | proc foobar(): cursor string, gah... |
19:59:48 | * | thomz quit (Client Quit) |
19:59:52 | clyybber | But lent tells me its lent/borrowed |
20:00:02 | clyybber | cursor also has an overloaded meaning |
20:00:29 | * | thomz joined #nim |
20:00:44 | Araq | but we also have an RFC for borrowing |
20:00:50 | Araq | and 'lent' is affected |
20:01:00 | clyybber | Do you have a link? |
20:01:05 | clyybber | You mean the view RFC? |
20:01:14 | Araq | https://github.com/nim-lang/RFCs/issues/178 |
20:01:48 | Araq | so then we need to figure out a borrowing scheme that would still allow for cursors |
20:02:02 | Araq | hint: Rust cannot do it for back pointers |
20:02:39 | Araq | it's hard, easier if we don't conflate different things into one thing just to save a keyword |
20:02:42 | Araq | bbl |
20:02:51 | * | nsf joined #nim |
20:03:31 | FromGitter | <alehander92> so like for an example linked list should be checked |
20:11:15 | FromGitter | <alehander92> i remember having read ideas for somehow connecting a special backpointer concept to the forward pointer lifetime as in a pair |
20:11:19 | FromGitter | <alehander92> in rust |
20:11:32 | clyybber | Oh, have a link? |
20:12:08 | FromGitter | <alehander92> basically it makes sense in some cases: if a links to b and b links to a, and a stops linking to b, thats when b should stop linking to a (e.g. parent child?) |
20:12:18 | FromGitter | <alehander92> it was just random hn comments |
20:13:33 | FromGitter | <alehander92> https://news.ycombinator.com/item?id=20448326 |
20:14:21 | FromGitter | <alehander92> all the other comments i found are by the some guy i think, so it seems he is somebody who really digs the backpointer special handling idea |
20:14:25 | FromGitter | <alehander92> the same* |
20:20:46 | clyybber | hmm |
20:21:18 | clyybber | that is interesting. |
20:23:31 | clyybber | his backpointer idea is similar to a notnil ptr |
20:24:39 | clyybber | The compiler will guarantee that upon destruction of an object that has a ref to an object with such a backpointer the backpointer will not be pointing into the dark |
20:24:46 | clyybber | which sounds easy to do |
20:25:27 | clyybber | And solves the linked list problem. |
20:27:23 | clyybber | hmm |
20:27:28 | clyybber | maybe not so easy after all |
20:27:59 | clyybber | you have to statically prove that the backpointer only points back to one of his owners |
20:28:41 | clyybber | And proving that for an delete list element operation for example seems non trivial |
20:31:02 | * | thomz quit (Quit: Going offline, see ya! (www.adiirc.com)) |
20:31:10 | Araq | B/D uses a dynamic check for it |
20:32:09 | disruptek | i don't really understand why that would be hard. |
20:34:36 | clyybber | think harder |
20:35:02 | disruptek | seems like you can deny more than one owner existing, for starters. |
20:36:23 | clyybber | hmm |
20:36:30 | clyybber | it certainly is possible |
20:36:45 | clyybber | I think even with multiple owners |
20:41:27 | Araq | it's a hard problem and in the end my .cursor design wins :P |
20:44:44 | Araq | because you don't have to prove your data-structures correct via a general purpose type system, just annotate it so that the silly RC'ing can work out |
20:49:12 | * | leorize quit (Ping timeout: 260 seconds) |
20:49:13 | * | thomz joined #nim |
20:50:02 | * | leorize joined #nim |
20:50:10 | FromGitter | <alehander92> but i thought the idea is to make sure backpointers dont point to old stuff as well |
20:50:12 | * | dchem joined #nim |
20:50:19 | FromGitter | <alehander92> because they might still point to some "valid" data |
20:50:21 | FromGitter | <alehander92> but outdated |
20:50:33 | FromGitter | <alehander92> outdated data is often worse than segfault |
20:50:52 | FromGitter | <alehander92> maybe misundestanding sorry |
20:51:08 | Araq | outdated data is completely outside of "memory safety" though |
20:51:28 | Araq | you're right that a segfault is better however a segfault is unreliable |
20:51:30 | dchem | When I create a variant object using case statement, does a newly created object of object variant initialize the struct variables not defined for that variant? |
20:53:11 | clyybber | dchem: No, because with object variants those variables share the same memory |
20:53:27 | clyybber | But it will be all zeroed out |
20:53:40 | dchem | Ok, but the field names must be different, right? |
20:53:52 | clyybber | dchem: Yeah |
20:54:09 | FromGitter | <alehander92> Araq just the important thing is to not turn potential segfaults into potential leaving in old state |
20:55:03 | dchem | Ok, that makes sense. I tried to use msgpack library with object variant, but unpacking the message fails because of zero-initialized variables. Not nim's fault, but now I know why |
20:55:30 | FromGitter | <alehander92> probably not the case here, just remembering i am thinking of an old special index vs pointer article |
20:55:50 | dchem | clyybber: thank you. |
20:55:55 | Araq | but look, a "potential segfault" is also nearly always a type safety violation |
20:56:34 | Araq | because it can point to memory that has been reused for something else |
20:57:15 | FromGitter | <alehander92> well, for backpointers, what i iamgined was keeping an old back"target" alive just to make the backpointer still valid by mistake |
20:57:43 | FromGitter | <alehander92> but probably this wouldnt be possible, just thought that this might happen in a not-well-designed schema |
20:58:08 | FromGitter | <alehander92> yeah, thats' true |
20:59:42 | FromGitter | <alehander92> which reminds me of my kernel dilemma: if it would be enough to support "data structures" with refs but no ptrs to make my "processes without virtual mem" |
21:06:50 | * | Calinou quit (Ping timeout: 240 seconds) |
21:20:31 | * | narimiran quit (Quit: Leaving) |
21:25:58 | FromDiscord | <luka> Hi, is there some place where there are maintained information on which stdlib modules are available for JS backend? |
21:27:24 | * | thomz quit (Quit: Going offline, see ya! (www.adiirc.com)) |
21:27:38 | * | nsf quit (Quit: WeeChat 2.6) |
21:28:47 | * | adeohluwa joined #nim |
21:35:27 | * | adeohluwa quit (Remote host closed the connection) |
21:50:39 | Araq | luka: the collections are available, times.nim, random.nim, math.nim |
21:51:52 | Araq | strutils and strformat |
21:53:53 | Araq | async too, that's pretty much it, I think, simply to try to import what you need |
21:55:55 | * | Hideki_ joined #nim |
21:58:53 | * | thomz joined #nim |
21:59:13 | * | thomz quit (Client Quit) |
22:00:43 | * | Hideki_ quit (Ping timeout: 268 seconds) |
22:03:21 | FromDiscord | <luka> Araq: thanks |
22:07:12 | * | Jesin quit (Quit: Leaving) |
22:12:36 | FromGitter | <Vindaar> the investigation from yesterday lives here now: https://github.com/Vindaar/ggplotnim/blob/weirdFastSlow/understandFastSlowWeird.org and it received a second part (little more than half way down). ⏎ Managed to fix the problem, although still don't exactly understand why the code was running fast in one case. Short version: I wasn't thinking and called `strip` on each csv entry... |
22:13:32 | * | adeohluwa joined #nim |
22:13:55 | * | solitudesf quit (Ping timeout: 265 seconds) |
22:14:05 | adeohluwa | choosenim does not work on FreeBSD |
22:14:30 | adeohluwa | nimble install jester does not work on freebsd either |
22:17:40 | * | nif quit (Quit: ...) |
22:17:49 | * | nif joined #nim |
22:19:15 | Araq | adeohluwa: what's the error message? |
22:20:05 | adeohluwa | for choosenim "freebsd_amd64 is not a supported os by choosenim" |
22:20:26 | adeohluwa | on both freebsd 10.4 & 12 |
22:20:52 | adeohluwa | if i build from the source |
22:21:21 | adeohluwa | $ nimble install jester |
22:21:32 | adeohluwa | Tip: 2 messages have been suppressed, use --verbose to show them. Error: Could not read package info file in /tmp/nimble_22473/githubcom_dom96jester/jester.nimble; ... Reading as ini file failed with: ... Invalid section: . ... Evaluating as NimScript file failed with: ... jester_22473.nims(1, 1) Error: cannot generate VM code for import system except getCommand, setCommand, switch, `--`, packageName, |
22:22:37 | * | fanta1 joined #nim |
22:22:54 | * | Jesin joined #nim |
22:49:15 | * | dchem quit (Quit: WeeChat 2.4) |
22:57:30 | * | adeohluwa quit (Remote host closed the connection) |
22:58:00 | * | ng0 quit (Ping timeout: 260 seconds) |
22:58:11 | FromDiscord | <luka> I think I've found a bug (which caused me 4 hours of debugging 😦 ), this code will print 'a' in the second call of p() (only JS target): |
22:58:11 | FromDiscord | <luka> |
22:58:11 | FromDiscord | <luka> proc p() : void = |
22:58:11 | FromDiscord | <luka> var x : set[char] = {} |
22:58:11 | FromDiscord | <luka> for y in x: |
22:58:12 | FromDiscord | <luka> echo y |
22:58:12 | FromDiscord | <luka> echo "done printing" |
22:58:13 | FromDiscord | <luka> x.incl 'a' |
22:58:13 | FromDiscord | <luka> |
22:58:15 | FromDiscord | <luka> p() |
22:58:16 | FromDiscord | <luka> p() |
22:58:17 | FromDiscord | <luka> |
22:58:18 | FromDiscord | <luka> should I create a new issue? |
22:58:58 | FromDiscord | <luka> (looking at the JS code, it seems that the same "constant set" is reused, however JS objects are not deep copied) |
23:00:22 | * | adeohluwa joined #nim |
23:01:42 | FromDiscord | <luka> (ah I see it was already discovered: https://github.com/nim-lang/Nim/issues/11353) |
23:01:45 | disbot | ^ Local set generates a global set on JS backend |
23:01:45 | disbot | ^ snippet at https://play.nim-lang.org/#ix=21ld 😏 |
23:02:41 | * | adeohluwa quit (Remote host closed the connection) |
23:04:01 | clyybber | Vindaar: But you still don't know what the cause was? |
23:04:06 | * | adeohluwa joined #nim |
23:05:57 | * | adeohluwa quit (Remote host closed the connection) |
23:09:16 | * | adeohluwa joined #nim |
23:12:47 | * | adeohluwa quit (Remote host closed the connection) |
23:25:01 | * | clyybber quit (Quit: WeeChat 2.6) |
23:52:52 | FromDiscord | <Avatarfighter> Stupid question for you guys but I can't seem to find a good answer, is there a way to make a js promise using karax? I can't seem to figure that out. |
23:54:16 | FromDiscord | <Avatarfighter> nvm I'm just terrible at finding the docs |