00:05:12FromDiscord<treeform> I know, but it's hard to explain
00:06:25FromDiscord<treeform> https://github.com/treeform/ws/blob/master/tests/chat.nim
00:06:42FromDiscord<treeform> See how it's done with websocket
00:06:55FromDiscord<treeform> You could replace that with regular socket
00:07:12FromDiscord<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:23jkenAnyone got a tldr on how to use system's offsetOf?
01:21:31jkenactually, 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:33disrupteki'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:37Zevvfix 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:33FromDiscord<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:24FromDiscord<demotomohiro> @IanIAnIAN My Nim code that write PNG image file using nimPNG:
10:09:30FromDiscord<demotomohiro> https://colab.research.google.com/drive/15w2dtk9QE8QDTsqMeRnWCzR7f2kSseoq
10:31:51FromGitter<mratsim> very nice
10:33:08*solitudesf quit (Ping timeout: 268 seconds)
10:33:25FromGitter<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:23FromDiscord<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:51Araqdisruptek, I think it's caused by something else, my version-patch affects .templateCall in procs which previously
11:40:53Araqoh wait
11:41:07Araqrebuild your nimsuggest
11:41:13Araqthen 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:14FromGitter<mratsim> what's the state of the language server, was it @PMunch?
13:02:50PMunchRunning in the background
13:03:03PMunchWell not really, I don't have my editor open
13:03:36PMunchJust 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:10clyybbersolitudesf: Have you tried nim-lsp with kak-lsp?
13:05:30solitudesfit works, but isnt stable
13:05:32FromGitter<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:53PMunchWhat do you mean isn't stable?
13:05:56PMunchWhen did you try it?
13:06:03clyybbersolitudesf: Because nim-lsp isn't stable or because kak-lsp isn't stable?
13:06:06solitudesfevery time i open nim file
13:06:14solitudesfthat one i dont know for sure
13:10:31clyybberleorize: Is nimsuggest stable by now?
13:14:17*fredrik92 joined #nim
13:17:53*livcd joined #nim
13:18:42Araqmratsim: 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:27FromGitter<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:42FromGitter<mratsim> they are pretty dumb when a block of code gets too big
13:24:26FromGitter<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:19FromGitter<mratsim> I'll put a feature request at low-priority and someone with time can measure
13:25:36clyybberGuddamnit, 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:49FromGitter<mratsim> check in reflog?
13:28:27clyybberI tried, but I can't figure out how to view a single commit from there without overwriting my current branch
13:29:12FromGitter<mratsim> cp -a myrepo{,2}
13:30:23clyybberyeah, 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:10AraqHint: passing ':env' to a sink parameter introduces an implicit copy; use 'move(:env)' to prevent it [Performance]
13:38:28Araqha ha ha, good one, I definitely cannot write 'move(:env)'
13:38:39Araqas 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:42:11clyybberMaybe we need a flag to make injectdestructors silence those warnings for some stuff generated in the earlier passes
13:48:08disruptekAraq: not fixed by rebuilding nimsuggest.
13:49:07leorizeclyybber: it's kinda stable
13:49:31leorizehowever if you try to use it against some modules like system.nim, you're in for a bad time
13:49:55Araqdisruptek, can you gist the log again please?
13:49:55leorizebut it might be that the highlight function is not well tested
13:50:20Araqclyybber, we need some frontend inling, the code bloat is rather bad otherwise
13:50:51disrupteki'm just seeing this in leorize's plugin. what incantation will generate a log you want?
13:51:10Araqwhat do you think about t.attachedOps[attachedDestructor] containing an AST pattern to inline?
13:51:34Araqthere is no need to make this always an nkProcDef that we later hope is optimized out
13:51:53leorizedisruptek: edit autoload/nim/suggest.vim, then add '--log' and '--debug' to the arg list
13:52:04disruptekcool, ty.
13:52:23leorizeyou will get a nimsuggest.log file in your home directory
13:52:29clyybberAraq: Yeah, I think thats a good idea. But I'd test if it makes any difference as opposed to just adding __inline
13:53:33disbot^ play at https://play.nim-lang.org/#ix=21hv 😏
13:53:43Araqclyybber, but I don't want to dig into the C code, I mean less C code is easier to read
13:53:43disrupteknow that's a bug.
13:54:04Zevvdisruptek: make your bot check if its nim before putting it into playground!
13:54:14disruptekit does. that's the bug.
13:54:43clyybberAraq: I wonder if it will cause any problems to inline in the frontend..
13:55:11Araqgeneral inlining is hard but the code patterns for 'ref' destructors are trivial to deal with
13:55:53clyybberAraq: 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:10clyybberBecause I think the code will be much less readable with inlined =destroys mixed in randomly
13:56:17clyybberinstead of just =destroy calls
13:56:26clyybber(If I understood you right)
13:58:58*jjido joined #nim
13:59:02Araqdisruptek, might be caused by nimsuggest's secrets
13:59:25disruptekneat. is there a secret decoder ring?
13:59:31Araqnimsuggest actually tries to type-check generics to some extend iirc
13:59:55Araqprobably a good idea to turn this off
14:00:55disruptekany 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:28Araqnever mind, I misremembered, no idea
14:05:49Araqbut if system.nim has an error it's failing rather early
14:07:23FromGitter<alehander92> whats up
14:07:24FromGitter<alehander92> these days
14:09:21disruptekit's something to do with my imports; i'll figure it out today.
14:30:09FromGitter<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:02Araqauxym: not really, you can assign to 'nil' for ref types
14:34:25FromGitter<auxym> makes sense, thanks
14:34:35*Hideki_ joined #nim
14:34:53FromDiscord<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:19Dvlv2Hello, could someone please tell me how to convert a json object to a string? j.to(string) is giving me a JsonKindError
14:38:10FromDiscord<Rika> used like "$j"
14:38:13*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:38:17FromDiscord<Rika> if you didnt understand
14:39:48Dvlv2Yay, thank you both!
14:40:10FromDiscord<Rika> you can use $ to convert most things to a string btw
14:40:25Dvlv2oh right, nice
14:43:10*Dvlv2 quit (Remote host closed the connection)
14:44:27clyybberAraq: How bad is it do add a hidden node to TNode?
14:44:57clyybberI have defaultfields implementation fully working now, in transf. But the code duplication (and computation duplication) is kinda bad
14:45:17Araqcode duplication --> extract into a common helper module
14:46:02Araqcomputation 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:17clyybberAraq: 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:06clyybberIts 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:11FromGitter<mratsim> I'm runnning out of names for helpers modules. You can only have 3 "tools", "utils" and "helpers"
14:56:38FromGitter<mratsim> oh "aux" works too
14:56:53FromGitter<mratsim> :mind_blown:
14:56:54disruptekmules, donkeys, asses...
14:57:40FromGitter<alehander92> <topic>_utils
14:57:44FromGitter<alehander92> toolkit
14:57:54FromGitter<alehander92> or just <topic>
15:03:11Araqutilities vs utils is great too
15:03:26clyybberAraq: 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:58Araqclyybber, how about changing the nkType to something else?
15:04:10Araqit's redundant anyway in a typed AST
15:04:13clyybberBut then that would break macros?
15:04:29AraqnkObjConstr(nkNewHere, ...)
15:04:38Araqit will work :P
15:05:00Araqmost macros don't look at son[0] for nkObjConstr
15:05:21clyybberAh cool. And if they do they will find "chosen branches" lol :p
15:09:47clyybberAraq: Should I maybe attach a nfInternal flag to the node then? So that it warns when accessed within a macro?
15:10:25clyybberAh, better not to, I guess.
15:10:43Araqthe flag is called nfSem and already exists
15:16:14clyybberAraq: Can it happen that a node will be semchecked twice?
15:16:18clyybberBecause of macros?
15:29:03*Hideki_ joined #nim
15:33:43*Hideki_ quit (Ping timeout: 265 seconds)
15:43:18FromGitter<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:29:30disruptekit'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:44FromDiscord<Avatarfighter> Hello everyone !
16:42:47FromDiscord<Avatarfighter> Long time no see
16:43:29FromGitter<mratsim> hello there
16:49:03*abm quit (Read error: Connection reset by peer)
17:04:11FromGitter<alehander92> <3
17:05:12FromGitter<alehander92> how are you
17:05:22FromGitter<alehander92> i am going to play with the kernel again now
17:05:26FromGitter<alehander92> maybe using twitch
17:13:04lqdev[m]Nim doesn't support multiple inheritance, does it?
17:14:57lqdev[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:03FromGitter<alehander92> https://www.twitch.tv/alehander42
17:37:34lqdev[m]is GC_ref/GC_unref available for all GCs, or only refc/markAndSweep?
18:02:24clyybberalehander92: Trying to debug the kernel with gdb?
18:02:51*lritter joined #nim
18:03:23clyybberalehander92: You crashed?
18:03:24*nsf quit (Quit: WeeChat 2.6)
18:09:05FromDiscord<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:20FromGitter<alehander92> i
18:18:27FromGitter<alehander92> my phone got no battery
18:18:30FromGitter<alehander92> and my internet is from it
18:18:32FromGitter<alehander92> :)
18:18:51FromGitter<alehander92> so this is more easy clyybber
18:19:07FromGitter<alehander92> i just debug my kernel, not the linux one :(
18:19:27FromGitter<alehander92> currently trying more to understand the interrupts thing and preemptive
18:39:58*filcuc joined #nim
18:40:49federico3only 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:07:10clyybberi hate bugs but i love bugs
19:07:26disrupteki know the feeling.
19:07:41disrupteki love bugs in my code; other code, not so much.
19:08:09clyybberdo you know the feeling that you get when the backend just ignores your nodes depending on where you get them from?
19:08:18clyybberbecause I do and its pure wtf
19:08:26*filcuc quit (Ping timeout: 240 seconds)
19:08:37disruptekwhere are you getting your nodes, you baddie?
19:09:13disruptekdo you know the feeling when you realize that nimble allows completely contradictory duplicate package requirements?
19:09:14clyybberi'm sneaking them from sem to transf
19:09:19disruptekbecause i do and it's pure wtf
19:09:20clyybberillegal smuggling
19:09:22clyybberso pssh
19:10:01clyybberdisruptek: I know the feeling of trying to use nimble to install glfw
19:10:20clyybber(glfw is ambiguous)
19:10:20disruptekyou poor soul.
19:10:31clyybbernot a poor soul anymore
19:10:34clyybberI have ascended
19:10:39clyybberto submodules
19:11:01clyybberI plan on becoming a submodule myself one day
19:11:06FromDiscord<Avatarfighter> lmao
19:12:51clyybberdisruptek: 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:13Araqasync compiles with --gc:destructors!
19:35:17*eys joined #nim
19:35:24clyybberAraq: Damn fine!
19:35:25Araqnow it only has to work without crashing :P
19:35:36clyybberThat was my next question :p
19:35:36Araqbut it does compile, no more wrong C code produced
19:35:49FromGitter<Willyboar> Congrats!
19:35:51Araqbut crashes are hard and it's weekend
19:36:00Araqso I'm gonna implement .cursor instead :P
19:37:51Araqwe should have valgrind tests for the CIs
19:38:15Araqnarimiran, please look into it
19:38:15clyybberUmm, regarding .cursor, why did we decide we don't need them again?
19:38:26Araqbecause of 'lent T'
19:38:39clyybberAh, and why do we need them now?
19:38:43clyybberWe have lent T?
19:38:43Araqbut 'lent ref T' would be another indirection
19:39:02Araqnot if we implement my lent optimization
19:39:10Araqbut then 'lent' still means 'immutable'
19:39:20clyybberAnd lent var can mean mutable
19:39:32clyybberOr var can imply lent var
19:39:55Araqwe need .cursor for 2 things:
19:40:05Araqfor local ref variables that are used as cursors.
19:40:14Araqfor back pointers so that they are not RC'ed.
19:40:33Araqwhich can also be seen as helper for navigation inside a data-structure aka 'cursor'
19:40:40Araqso the name fits perfectly
19:41:10clyybberdo you want to make it a pragma?
19:41:16clyybberor `cursor T`?
19:41:42clyybberWhy don't we just say lent T as a local variable is a {.cursor.}?
19:42:42Araqbecause then it would be an immutable view into the data
19:42:52Araqbut cursors are frequently used for updating a node
19:45:10clyybberSo {.cursor.} as a return type modifier is the same as var?
19:45:55disruptekone that doesn't count, sure.
19:46:14Araq.cursor is not a return type modifier
19:46:34clyybberAraq: Ok so, cursor is to local variables what var and lent are as return types?
19:46:57Araqthere is some overlap but 'var' is always a hidden pointer
19:47:07Araq'lent' is too currently, but doesn't have to be
19:47:36*ng0 quit (Ping timeout: 260 seconds)
19:47:38disruptekyou can't return a cursor but you can pragma a var as such?
19:47:40*eys quit (Quit: eys)
19:47:48FromDiscord<Avatarfighter> Stupid question, but is going to be an advantage of using -gc:destructors?
19:47:54FromDiscord<Avatarfighter> what is going to be*
19:48:33FromDiscord<Avatarfighter> Actually I have a new question, what is destructors lol
19:48:47disruptekcheck out the RFCs repo under /Nim
19:49:17FromDiscord<Avatarfighter> I'm doing that right now 😄
19:50:06*ng0 joined #nim
19:50:16FromDiscord<Avatarfighter> wait this is really cool
19:50:32Araqdisruptek, yes
19:51:16clyybberAraq: 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:18disruptekso they can't escape to a parent scope?
19:53:05Araqclyybber, but 'lent' is close to 'let' aka immutable and cursors aren't
19:53:41clyybberAraq: But why not make lent a modifier meaning exactly what it says: lent variable, and not influencing immutability
19:53:52clyybberor mutability
19:54:32Araqwhat's a 'lent' variable?
19:54:42Araqcurrently it's only valid for return types
19:54:47clyybberOne that is not owned by me.
19:54:56clyybberThat I'm only borrowing so to say.
19:55:07Araqvariables are always attached to a scope, pointer values can be borrowed
19:56:35AraqI don't see good alternative designs tbh
19:57:01clyybberBorrowning means that I wont destroy it.
19:57:04Araqin C++ 'var T' is & and 'lent T' is const& and C++ has no "cursors"
19:57:42Araqin 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:54disruptekcursor is a superset of lent, sounds-like.
19:58:34Araqand as mratsim figured out .cursor doesn't prevent a moving GC from working
19:58:51*thomz joined #nim
19:58:54clyybberAraq: But we can optimize that double indirection
19:59:10clyybberAnd after all lent T shouldnt be a pointer unless combined with var/needed
19:59:20Araqok, but then 'cursor' is the better name, so it should be 'cursor T'
19:59:38Araqproc foobar(): cursor string, gah...
19:59:48*thomz quit (Client Quit)
19:59:52clyybberBut lent tells me its lent/borrowed
20:00:02clyybbercursor also has an overloaded meaning
20:00:29*thomz joined #nim
20:00:44Araqbut we also have an RFC for borrowing
20:00:50Araqand 'lent' is affected
20:01:00clyybberDo you have a link?
20:01:05clyybberYou mean the view RFC?
20:01:48Araqso then we need to figure out a borrowing scheme that would still allow for cursors
20:02:02Araqhint: Rust cannot do it for back pointers
20:02:39Araqit's hard, easier if we don't conflate different things into one thing just to save a keyword
20:02:51*nsf joined #nim
20:03:31FromGitter<alehander92> so like for an example linked list should be checked
20:11:15FromGitter<alehander92> i remember having read ideas for somehow connecting a special backpointer concept to the forward pointer lifetime as in a pair
20:11:19FromGitter<alehander92> in rust
20:11:32clyybberOh, have a link?
20:12:08FromGitter<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:18FromGitter<alehander92> it was just random hn comments
20:13:33FromGitter<alehander92> https://news.ycombinator.com/item?id=20448326
20:14:21FromGitter<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:25FromGitter<alehander92> the same*
20:21:18clyybberthat is interesting.
20:23:31clyybberhis backpointer idea is similar to a notnil ptr
20:24:39clyybberThe 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:46clyybberwhich sounds easy to do
20:25:27clyybberAnd solves the linked list problem.
20:27:28clyybbermaybe not so easy after all
20:27:59clyybberyou have to statically prove that the backpointer only points back to one of his owners
20:28:41clyybberAnd 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:10AraqB/D uses a dynamic check for it
20:32:09disrupteki don't really understand why that would be hard.
20:34:36clyybberthink harder
20:35:02disruptekseems like you can deny more than one owner existing, for starters.
20:36:30clyybberit certainly is possible
20:36:45clyybberI think even with multiple owners
20:41:27Araqit's a hard problem and in the end my .cursor design wins :P
20:44:44Araqbecause 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:10FromGitter<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:19FromGitter<alehander92> because they might still point to some "valid" data
20:50:21FromGitter<alehander92> but outdated
20:50:33FromGitter<alehander92> outdated data is often worse than segfault
20:50:52FromGitter<alehander92> maybe misundestanding sorry
20:51:08Araqoutdated data is completely outside of "memory safety" though
20:51:28Araqyou're right that a segfault is better however a segfault is unreliable
20:51:30dchemWhen 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:11clyybberdchem: No, because with object variants those variables share the same memory
20:53:27clyybberBut it will be all zeroed out
20:53:40dchemOk, but the field names must be different, right?
20:53:52clyybberdchem: Yeah
20:54:09FromGitter<alehander92> Araq just the important thing is to not turn potential segfaults into potential leaving in old state
20:55:03dchemOk, 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:30FromGitter<alehander92> probably not the case here, just remembering i am thinking of an old special index vs pointer article
20:55:50dchemclyybber: thank you.
20:55:55Araqbut look, a "potential segfault" is also nearly always a type safety violation
20:56:34Araqbecause it can point to memory that has been reused for something else
20:57:15FromGitter<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:43FromGitter<alehander92> but probably this wouldnt be possible, just thought that this might happen in a not-well-designed schema
20:58:08FromGitter<alehander92> yeah, thats' true
20:59:42FromGitter<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:58FromDiscord<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:39Araqluka: the collections are available, times.nim, random.nim, math.nim
21:51:52Araqstrutils and strformat
21:53:53Araqasync 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:21FromDiscord<luka> Araq: thanks
22:07:12*Jesin quit (Quit: Leaving)
22:12:36FromGitter<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:05adeohluwachoosenim does not work on FreeBSD
22:14:30adeohluwanimble install jester does not work on freebsd either
22:17:40*nif quit (Quit: ...)
22:17:49*nif joined #nim
22:19:15Araqadeohluwa: what's the error message?
22:20:05adeohluwafor choosenim "freebsd_amd64 is not a supported os by choosenim"
22:20:26adeohluwaon both freebsd 10.4 & 12
22:20:52adeohluwaif i build from the source
22:21:21adeohluwa$ nimble install jester
22:21:32adeohluwa 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:11FromDiscord<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:11FromDiscord<luka> proc p() : void =
22:58:11FromDiscord<luka> var x : set[char] = {}
22:58:11FromDiscord<luka> for y in x:
22:58:12FromDiscord<luka> echo y
22:58:12FromDiscord<luka> echo "done printing"
22:58:13FromDiscord<luka> x.incl 'a'
22:58:15FromDiscord<luka> p()
22:58:16FromDiscord<luka> p()
22:58:18FromDiscord<luka> should I create a new issue?
22:58:58FromDiscord<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:42FromDiscord<luka> (ah I see it was already discovered: https://github.com/nim-lang/Nim/issues/11353)
23:01:45disbot^ Local set generates a global set on JS backend
23:01:45disbot^ snippet at https://play.nim-lang.org/#ix=21ld 😏
23:02:41*adeohluwa quit (Remote host closed the connection)
23:04:01clyybberVindaar: 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:52FromDiscord<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:16FromDiscord<Avatarfighter> nvm I'm just terrible at finding the docs