<< 24-01-2021 >>

00:02:28FromDiscord<Recruit_main707> this is everything i could find out, gtg now https://github.com/nim-lang/Nim/issues/16805
00:02:35disbotCompiler crashses when generic value should be inferred from an array and its a default value for another argument (?) ; snippet at 12https://play.nim-lang.org/#ix=2N6g
00:04:29saemThat one is a gem, the logic in semArrayIndex seems to be where things go awry.
00:26:08*NimBot joined #nim
00:42:22FromDiscord<carpal> why someone use those IRC bots to chat?
00:42:37FromDiscord<carpal> why not a normal account?
00:43:12disruptekwhy don't discord people use a normal account?
00:43:49saem^^
00:56:59*qwr quit (Ping timeout: 244 seconds)
01:03:54asdflkj^ irc is the normal chat protocol until everyone merges into the [Matrix](https://matrix.org/) Galatic Singularity as portrayed in https://explainxkcd.com/wiki/index.php/1782:_Team_Chat
01:29:08*qwr joined #nim
01:29:22*qwr quit (Client Quit)
01:30:48*qwr joined #nim
01:36:11*asdflkj quit (Ping timeout: 272 seconds)
01:41:03FromDiscord<exelotl> could I use sink parameters to ensure that a ptr is not dereferenced after calling a certain procedure on it?
01:41:56FromDiscord<exelotl> "A location that is passed to a sink parameter should not be used afterward." this makes me think yes.↵"If it cannot be proven to be the last usage of the location, a copy is done instead and this copy is then passed to the sink parameter." but this makes me think no.
01:42:57FromDiscord<ElegantBeef> I'd imagine that if you pass a type to a proc that only has a sink parameter it will give up ownership and force you to not use it after that proc call
01:44:18FromDiscord<exelotl> maybe I'd have to implement an `=copy` routine for the type, which {.error.}'s
01:44:34FromDiscord<exelotl> thus allowing only moves
01:45:01FromDiscord<exelotl> I'm guessing this is all hypothetical because I'm using --gc:none right now
01:45:42FromDiscord<ElegantBeef> Ownership still can be enforced in that scenario, so idk
01:46:02FromDiscord<exelotl> if I switch to arc my game won't build due to too much static RAM usage.
01:46:12FromDiscord<exelotl> so I'm guessing ARC creates some junk :(
01:46:50FromDiscord<exelotl> > Ownership still can be enforced in that scenario↵oh that's good to know
01:47:25FromDiscord<ElegantBeef> My understanding is that ARC should be usable on embedded, again weird
01:47:53FromDiscord<exelotl> I've found that it is usable for simple programs, but my game is pretty big now
01:47:56FromDiscord<ElegantBeef> Well i imagine it should still be enforced, since it's just seeing if the variable is used after ownership is given up, but idk
01:48:03FromDiscord<ElegantBeef> I'm a numpty take what i say with a grain of salt
01:56:14FromDiscord<exelotl> ah I can't define copy for a ptr type 🤦
01:57:55FromDiscord<exelotl> I really just wanna be able to say "please don't use this pointer after calling this destroy() proc on it"
02:01:59FromDiscord<ElegantBeef> Disruptek, i've checked the stdlib `json` and `flatty` both didnt support enum indexed arrays, do your libraries support it? 😄
02:02:21FromDiscord<ElegantBeef> It's an easy fix, just curious
02:08:45FromDiscord<Clyybber> @exelotl =copy {.error.} is what you want, wrap your pointer in an object
02:10:53FromDiscord<Clyybber> Im curious what is taking up space with arc tho
02:12:45FromDiscord<ElegantBeef> I imagine you'd have a lot of heap allocated objects getting created then destroyed for it creating a much larger file
02:16:27FromDiscord<exelotl> my game doesn't use the heap at all so in theory there should be no difference between gc:none and gc:arc
02:18:32FromDiscord<exelotl> thanks that's good to know! Wrapping the pointer in an object will require some refactoring but I'll keep it in mind
02:18:45disruptekbeef: what do you think an enum-indexed array means at runtime?
02:18:59FromDiscord<ElegantBeef> What do you mean?
02:19:15disruptekwhat would you expect such an animal to render as?
02:20:04FromDiscord<ElegantBeef> The values in order the same as the array
02:20:22FromDiscord<ElegantBeef> I mean all it took to add it to json and flatty was to convert their index to the enum
02:20:55disrupteki guess i will add a test.
02:20:56kinkinkijkinwhat is the general accepted form of a nimble library's folder structure? under src
02:21:05disruptekplease not under src.
02:21:06FromDiscord<ElegantBeef> Well they're in Nim's language features and i use them
02:21:27disruptekbeef: there's no reason they shouldn't be supported, afaik.
02:21:40FromDiscord<ElegantBeef> `array[Enum,T]` throws an error in both libraries i tested since they both do `array[i]` with an integer
02:21:44kinkinkijkinsrc is the default so i assumed there wouldn't be an issue with that
02:22:16disruptekbeef: i don't do it that way, but i think i might throw a ct error if it's not a range type.
02:22:32disruptekbut we'll see soon enough.
02:22:57FromDiscord<ElegantBeef> Yea just thought i'd mention
02:24:59disruptek/home/adavidoff/git/jason/jason.nim(196, 14) Error: Expected a node of kind nnkInfix, got nnkSym
02:25:08disruptekneat, an honest-to-god bug.
02:30:07kinkinkijkinone thing i wasn't expecting in developing my game engine was that, after adding the gl2.1 renderer, the gles3 renderer would still work completely fine
03:09:44*muffindrake quit (Ping timeout: 265 seconds)
03:11:35*muffindrake joined #nim
03:36:17disruptekbeef: you know what's tricky?
03:36:38disrupteki dunno how to implement array[foo..bar, ...] where foo/bar are members of an enum.
03:38:07FromDiscord<ElegantBeef> What're you trying atm?
03:39:15disruptekwell, the ast doesn't seem to have the enum type in it and even though it desugars it for me, i cannot eg. arr[4] because the sigmatch fails.
03:39:31disrupteki think it might actually be a compiler bug.
03:40:02disruptekeither sigmatch or in typed macros or both.
03:40:43FromDiscord<ElegantBeef> I dont know, it was rather simple to solve for flatty/json <https://github.com/treeform/flatty/blob/045b39aadf5aaf969ffaf4c2a85e0ba466fd2728/src/flatty.nim#L216>
03:40:49*actuallybatman quit (Quit: Lost terminal)
03:42:08disruptekwell, flatty is not json; it's not the same problem.
03:42:23disruptekassume that you cannot copymem.
03:43:06disrupteki'll be very surprised if frosty has this bug.
03:43:48FromDiscord<ElegantBeef> I had to do the same for the stdlib's json aswell, so idk
03:44:00FromDiscord<ElegantBeef> although it's probably silly the way i did it using a `when`
03:44:36FromDiscord<ElegantBeef> Atleast this seems to work <https://github.com/nim-lang/Nim/pull/16807/files>
03:44:37disbotadded enum indexed array support to json
03:45:05FromDiscord<ElegantBeef> I know your json library is different from the Nim one, but eh
03:45:41disruptekwhat does that have to do with the problem i surfaced?
03:45:56FromDiscord<ElegantBeef> I dont know what you're doing so i dont know what your issue is 😄
03:46:13disrupteki explained it 6mins ago.
03:46:13FromDiscord<ElegantBeef> I mostly spew unhelpful shit 99% of the time, this shouldnt be news
03:46:31FromDiscord<ElegantBeef> I cannot read
03:58:56*wasted_youth quit (Read error: Connection reset by peer)
03:59:25*vicfred quit (Quit: Leaving)
03:59:44*vicfred joined #nim
04:00:45*NimBot joined #nim
04:04:36*Gustavo6046 quit (Ping timeout: 265 seconds)
04:05:53saemHuh, which kind of symbols shouldn't be suggested in a type context? Thought that'd be an easier question to answer than it actually is.
04:07:07disrupteki don't know how to get the list.
04:07:20saemOf the enums?
04:07:31disruptekof symbols that cannot be getTyped.
04:08:40disrupteki only do var, let, param.
04:09:07saemBecause each field of an enum isn't a type of it's own, IIRC... really wish that was a thing and the ability to define a sum of them.
04:09:17disruptekyou're talking about gettype on a rando symbol kind?
04:09:38disruptekyou can define a set of them.
04:09:50saemOh my thing, is this nimsuggest issue: https://github.com/nim-lang/nimsuggest/issues/48
04:09:51disbotVariables are suggested within type context
04:09:54disruptekand you can range[foo..bar]; foo and bar are symbols.
04:11:15saemI know about the ranges, I don't quite remember if the sets are types of consts (which are close, but not quite the same).
04:13:04disrupteki feel like a new man since my click-to-open-url-from-xterm started working again.
04:13:08saemYup, those are consts, so I guess you get the type with static[myConstSet]?
04:13:47disruptekthe const would be of type set[Enum], nothing less.
04:13:52saemI felt pretty great when I got nim check output parsing to allow click to open files
04:14:07saemThat's unfortunate.
04:14:16disruptekbut why?
04:14:34saemBecause wanting to refine the type is a thing?
04:14:44disruptekuse a range.
04:14:58saemCan you do a sparse range?
04:15:02disruptekno.
04:15:08saemyeah...
04:15:13disruptekso you want a type that is just a static set?
04:15:54disrupteki guess you could have a macro write it for you.
04:15:55saemNo, I just want sum types, even if it's only a subset for one enum.
04:17:21disruptekso you want a type that is just a static set.
04:17:48disruptekor are you saying that you want the set to somehow vary?
04:17:58disrupteklike, it's always four items but which four may vary?
04:18:22saemit's up four items, and only the specified four items
04:19:00disruptekyeah, i can see doing it with a macro or a concept if it's enough to simply have a typeclass.
04:19:37disruptekit's funny how similar it is to my bug.
04:19:51saemI mean, type class comes close.
04:19:56disruptekthis is my test name: test "arrays with subset of enum indices":
04:20:24disruptek+ type
04:20:24disruptek+ E = enum one, two, three, four
04:20:24disruptek+ A = array[two..four, string]
04:20:25*actuallybatman joined #nim
04:20:25disruptek+ let x: A = [two: "b", three: "c", four: "d"]
04:20:29disruptek+ check $jason(x) == """["b","c","d"]"""
04:21:31saemYup, a sum type would be grand right there, even if they were very limited.
04:23:24disruptekand you want it to have set semantics?
04:24:30saemnope, I think those would be two orthogonal things.
04:24:59saemfor example, in typescript one can do `let foo: 1 | 2 | 3 = ` and that's a variable that can only be the value 1 or 2 or 3, and everything else is a type error.
04:25:06saemThat could also be the type of a type parameter, etc...
04:25:09disruptekso it's an enum that can be converted to the root enum.
04:25:29saemWell, there is no ordering, so enum carries too much meaning.
04:25:47disruptekso how is set not correct?
04:25:56disruptekthey aren't ordinals?
04:26:02saemBecause a set allows both 1 and 2 to be in the set.
04:26:08saemA sum type can only be one of those types.
04:26:16saemWhich is why I said the typeclass is really close.
04:27:02saemBut IIRC, type class forces implicit generics and that blows out code gen, but maybe that's not how it works.
04:30:24saemRereading type classes, I think for the case I'm talking about it should be fine and I don't think it'll have any negative impact on codegen.
04:30:34disruptekhttps://play.nim-lang.org/#ix=2N7x
04:30:59disrupteki think we had a similar question come up from someone who wanted -1|1 but we solved it differently.
04:31:11disruptekso there's more than one solution, at least.
04:31:58saemYeah, that definitely the same request.
04:32:08disrupteki mean, if you search for those things in the irc logs you can find my last impl, whatever it was.
04:37:21saemThat's something to add to the list, but first I wanna see the enum array thing. :D
04:37:44disruptekwhat?
04:38:41saem> well, the ast doesn't seem to have the enum type in it and even though it desugars it for me, i cannot eg. arr[4] because the sigmatch fails
04:39:02disruptekyou want to see it fail?
04:39:04saemI was just seeing if you had a branch of that up in github
04:39:12disruptekoh, i can push it.
04:39:14saemyeah, I was checkin' your testes
04:40:43disruptekhttps://github.com/disruptek/jason/tree/enum_array
04:45:51*Gustavo6046 joined #nim
04:46:08disruptekthe ast looks like `1 .. 3` but [](1) is unimpl'd for A.
04:47:21disruptekoh i'm dumb.
04:47:28disrupteki bet i need to bindsym it.
04:47:34disrupteki mean, mix it. whatever.
04:49:01disruptekhmm, i shouldn't have to, actually.
04:52:00FromDiscord<ElegantBeef> Saem you really really couldnt resist the pun on the PR could you?
04:52:19saembeef you'd be disappointed if I didn't.
04:52:28saemYou'd be like... where's the beef?
04:53:22saem(narrator: Ironically, Mr Beef was in fact a strict vegan.)
04:53:56disruptekunlikely.
04:54:15saemwhy you gotta ruin the mystery?
04:58:05saemI was all, "Ok, enough of this browsing on gh business, time to pull down the code and build it..." Then of course it doesn't compile and I'm guessing it's because I have a broken version of the compiler presently.
04:58:24disruptekno.
04:58:53disruptekhere, i will push a version that emits the error you want to see.
04:59:05saemI was just going off the master branch
04:59:39disruptekyeesh, if master doesn't build, you're fucked.
05:00:06disrupteki did push a better version.
05:01:55saemoh I'm a jackass, of course I need to do a bunch of things differently, trying to use nimble test here like it's going to work.
05:02:26disruptekit should.
05:02:34saemsadly no
05:03:55saemI know why... I should use nimph... I wonder why I hate installing things so much.?
05:06:52disruptekpackage managers are stupid.
05:08:31saemWow, I've seriously blocked so much out, now how would I get a project local build of testes (not in the nimble dir and global path).
05:08:53disruptekwith nimble, you can `mkdir nimbledeps` and it should use it.
05:09:35saemI can live with nimph globally, but don't want anything else.
05:10:15disrupteki'm removing my submodules and i'm gonna try to focus on dist.
05:12:33disrupteklet me know how nimph works globally; i never run it that way.
05:13:44saemhow do you typically do it?
05:14:10disruptekmy .nimble has exec perm and that's it.
05:14:46disrupteki just use a deps directory that i add a --nimblePath= for. that's it. --clearNimblePath, like you see in the README screencast demo.
05:15:17disruptekit's basically a local nimbledir but it has git repos in it that i can fork or work on, etc.
05:16:15saemit makes sense and it'll get better, just unfortunate the amount of unwinding that one must remember.
05:16:55disrupteknimph is easier because you just setup the compiler properly and nimph makes the env match your config.
05:18:36saemaside: mumble is more CPU hungry than I thought it would be given that it's presently muted right now.
05:18:46*hyiltiz quit (Ping timeout: 246 seconds)
05:19:17disruptekall i can hear is heavy breathing.
05:19:28disruptekoh wait, that's coming from my side.
05:19:43saemit's coming from inside
05:19:48saemGET OUT!
05:20:30disruptekit's 2°F; i think i'll stay inside for now.
05:20:39saemyeah, good call
05:20:50saemcold af
05:21:09disruptekcolorado was worse, but somehow no big deal.
05:21:23saemhumitdity?
05:21:32disruptekmuch less, of course.
05:21:48disruptekthough i was on a mountain top, it wasn't very windy.
05:22:13*hyiltiz joined #nim
05:22:32disruptekregularly -10, -20, and really pretty comfortable.
05:22:51saemI'm in the wrong state, but my brain has decided to start playing Country Roads from Kingsman in my head.
05:35:28*Lord_Nightmare quit (Ping timeout: 265 seconds)
05:53:07FromDiscord<ElegantBeef> By state you mean nation state no? 😛
05:53:24saem😆
05:54:25FromDiscord<ElegantBeef> It's almost -40 here right now
05:54:36saemyou win?
05:55:55FromDiscord<ElegantBeef> Idk what i win
05:57:12saemcooler than being cool
05:59:37*Gustavo6046 quit (Ping timeout: 256 seconds)
06:02:11disruptekfrostbite.
06:02:25saem^^
06:05:17FromDiscord<Rika> :w
06:05:19FromDiscord<Rika> ah fuck
06:05:46FromDiscord<Rika> classic "ah shit i didnt type that in vim"
06:06:02disruptekat least you're using vim.
06:07:02FromDiscord<ElegantBeef> Atleast you didnt try to install packages through discord, i've never done that
06:07:05FromDiscord<ElegantBeef> Totally never
06:07:19saemthat's why I don't use discord
06:07:27*Gustavo6046 joined #nim
06:07:28disruptekpoor package management?
06:07:30FromDiscord<Rika> i dont think thats the point
06:07:34saemthe worst
06:07:51saemalso... that AST is not friendly.
06:09:12*a_chou joined #nim
06:09:42saemOK, back to trying to figure out what's reasonable in a type context. 🤔
06:14:42*a_chou quit (Remote host closed the connection)
06:15:08disruptekshould be pretty easy; just go down the list of symbol kinds.
06:25:00saemThe part you're referring to is easy, but that's not quite what I was referring to but that's OK, I'm going to skip solving that bigger problem for now.
06:25:24saemI just need to fix the prefix being ignored in this case.
06:31:36*fputs joined #nim
06:34:45*evbo quit (Ping timeout: 256 seconds)
06:35:56*clemens3 quit (Ping timeout: 256 seconds)
06:48:05*waleee-cl quit (Quit: Connection closed for inactivity)
06:51:20FromDiscord<hamidb80> I'm reading Nim document and I have no idea why sample have many of this statement for e.g:↵↵doAssert (something ,...)
06:51:34FromDiscord<hamidb80> (edit) "sample" => "samples"
06:51:52FromDiscord<hamidb80> (edit) "statement for e.g:↵↵doAssert" => "statement:↵↵doAssert"
06:52:26FromDiscord<hamidb80> (edit) "document" => "documentation"
06:52:55FromDiscord<hamidb80> (edit) "(something ,...)" => "something == something_else"
06:53:36FromDiscord<hamidb80> (edit) I'm reading Nim documentation and I have no idea why samples have so many of this statement:↵↵doAssert something == something_else
06:53:42*Lord_Nightmare joined #nim
06:54:23FromDiscord<ElegantBeef> assertions are used to show the output without a compiler
06:54:42FromDiscord<ElegantBeef> in that case it's to show that something is equal to something else
06:54:59FromDiscord<ElegantBeef> It's very useful for showcasing expected behaviour for testing or explanation
06:58:23FromDiscord<hamidb80> I don't think it is supported in vscode
06:58:39saemwhich extension?
06:59:09FromDiscord<ElegantBeef> I mean it doesnt do anything in editor
06:59:52FromDiscord<hamidb80> what?
07:00:03saemgood point, I assumed they meant it was showing errors or something.
07:00:07FromDiscord<ElegantBeef> if you see `doAssert a == 10` you know that the logic before it should result with a being 10, if it doesnt it's breaking logic
07:00:28FromDiscord<ElegantBeef> It's useful for unit testing and ensuring certain goals are met
07:02:10FromDiscord<ElegantBeef> It's also better for showing people code cause↵`let a = doSomething(); echo a` is obscure what A is, but `let a = doSomething(); assert a == "Hello"` means you dont even need an editor to know what doSomething returns, or atleast what's expected
07:04:05*clemens3 joined #nim
07:11:49*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
07:16:55FromDiscord<arun> sent a long message, see https://paste.rs/9Zp
07:19:10*habamax joined #nim
07:19:17FromDiscord<ElegantBeef> How do you transpile from python and get typing?
07:19:30FromDiscord<arun> Assumes python code is also statically typed
07:19:40FromDiscord<arun> There is some basic type inference code
07:19:45FromDiscord<arun> i = 0 # infer i is int
07:26:54*maier joined #nim
07:32:28*clemens3 quit (Ping timeout: 246 seconds)
07:33:15*letto quit (Quit: Konversation terminated!)
07:33:58*clemens3 joined #nim
07:35:01*letto joined #nim
08:01:35FromDiscord<Rika> Some people are maniacs and switch variable type though
08:18:37*Gustavo6046 joined #nim
08:44:38*maier quit (Ping timeout: 260 seconds)
08:47:49*maier joined #nim
09:24:29*Vladar joined #nim
09:29:31*Tanger joined #nim
09:38:32FromDiscord<flywind> Does the rst doc generator support something like https://support.typora.io/Markdown-Reference/#reference-links?
09:39:00FromDiscord<flywind> (edit) "Does the rst doc generator ... supporthttps://support.typora.io/Markdown-Reference/#reference-links" added "of Nim's" | "https://support.typora.io/Markdown-Reference/#reference-links?" => "https://support.typora.io/Markdown-Reference/#reference-links"
09:42:05FromDiscord<flywind> I see, it does support https://github.com/nim-lang/Nim/blob/8241e55023ee32c9ec0b5443723bbe91f4fe875f/tests/stdlib/trstgen.nim#L277
09:49:21*Tanger quit (Remote host closed the connection)
10:22:02*hnOsmium0001 quit (Quit: Connection closed for inactivity)
10:31:31FromDiscord<flywind> since `csize_t` in system.nim is `size_t`(unsigned), what should I name `ssize_t`(signed) (It isinconsistent with `cint` and `cuint`)?
10:35:07FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/12497#issuecomment-766325354
10:35:08disbotintroduce csize_t instead of fixing csize
11:03:49FromDiscord<mratsim> ptrdiff_t
11:04:44FromDiscord<mratsim> well cptrdiff_t and cssize_t i assume
11:34:50FromDiscord<carpal> is there a way to make the compiler do implicit conversion?
11:35:12FromDiscord<carpal> ex.:↵proc x(, MyType)
11:35:36FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2Nai
11:36:36FromDiscord<Recruit_main707> https://nim-lang.org/docs/manual.html#converters
11:37:02FromDiscord<carpal> sent a code paste, see https://play.nim-lang.org/#ix=2Nan
11:37:14FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=2Nan" => "https://play.nim-lang.org/#ix=2Nao"
11:37:16FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=2Nao" => "https://paste.rs/iGu"
11:37:26FromDiscord<carpal> (edit) "https://play.nim-lang.org/#ix=2Nar" => "https://play.nim-lang.org/#ix=2Naq"
11:38:24FromDiscord<Recruit_main707> check that url
11:38:54FromDiscord<carpal> yep done
11:38:56FromDiscord<carpal> thank you
11:41:19FromDiscord<carpal> amazing 💚
11:41:23*maier quit (Ping timeout: 256 seconds)
11:44:06*maier joined #nim
11:44:46*maier quit (Client Quit)
11:50:43FromDiscord<lqdev> disruptek: mind if i improve badresults.? a bit?
11:51:32FromDiscord<lqdev> the current version doesn't play well if the result you want to unwrap is Result[T, E] but the proc's return value is Result[U, E]
11:51:48FromDiscord<lqdev> the case should succeed because both results have the same error type
11:54:03FromDiscord<konsumlamm> why do you want implicit conversions there in the first place? what's the point of `MyType` if you implicitly convert `int`s to it? like, why kot just use ints?
11:56:54Zevvyou mean, like, `distinct int`?
11:59:13Zevvit allows you to leverage the type system to help your code make sense. For examply, you make distincty types for voltage, current and power. You can add voltages, so there's a `+` to add two voltages. You can multiply voltage and current, so you create a `*` that takes both and results in power. Your type system will not allow you to add voltage to current though, because that would not make sense.
12:14:59FromDiscord<konsumlamm> either a distinct type or no new type at all
12:29:57FromDiscord<lqdev> is there any way of marking a ref as "weak"?
12:29:59ForumUpdaterBotNew thread by Zulu: How do you y'all deal with missing libs?, see https://forum.nim-lang.org/t/7421
12:30:53FromDiscord<lqdev> what i mean by that is, say i store a bunch of refs in a seq
12:31:18FromDiscord<lqdev> and when i add them to the seq, i don't want their refcount to increment
12:31:26FromDiscord<lqdev> so that they can get freed
12:31:41FromDiscord<lqdev> but then i guess the problem is that the seq's elements have to be updated accordingly
12:31:57FromDiscord<lqdev> to nil or something like that
12:35:00FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/802879120144728074/unknown.png
12:53:32*tane joined #nim
13:05:26FromDiscord<konsumlamm> that doesnt answer my question
13:14:54FromDiscord<carpal> why should I use implicit converters? 😂 because those are more confortable than use `newObject`
13:27:05FromDiscord<mratsim> That comfort will be short-lived as soon as you will need to debug why you received one typed instead of the other or why string for int suddenly display your object.
13:27:13FromDiscord<mratsim> (edit) "typed" => "type"
13:36:19FromDiscord<carpal> understood nothing
13:37:42FromDiscord<carpal> I wrote even a proc `as` for instances converion
13:38:20FromDiscord<carpal> for get the original type
13:47:27FromDiscord<carpal> this is how it works, and it works 😂 https://media.discordapp.net/attachments/371759389889003532/802897354754621510/unknown.png
13:48:26FromDiscord<carpal> I created this object for my vm
13:48:31FromDiscord<carpal> (edit)
13:51:35*William[m]1 joined #nim
13:53:04FromDiscord<hamidb80> I cant understand usage of low & high procs
13:53:57FromDiscord<hamidb80> from https://nim-by-example.github.io/arrays/ https://media.discordapp.net/attachments/371759389889003532/802898985500540948/Capture.PNG
13:55:34FromDiscord<Rika> a.low is the lowest index in a (the array)
13:55:40FromDiscord<Rika> high is the highest index
13:55:57*vicfred quit (Remote host closed the connection)
13:58:10FromDiscord<hamidb80> so why they don't use this instead?↵`for i in 0..<a.len:`
13:58:56FromDiscord<Rika> because a.high is not always equal to a.len-1
13:59:01FromDiscord<Rika> same with a.low and 0
13:59:03FromDiscord<Rika> it can change
13:59:14FromDiscord<Rika> arrays can have a negative index
13:59:23FromDiscord<lqdev> or they can start from 1
13:59:36FromDiscord<Rika> ~~only heretics~~
13:59:46FromDiscord<hamidb80> can you give me an example?
13:59:48FromDiscord<Rika> im joking about the heretics thing btw
14:00:05FromDiscord<lqdev> @hamidb80 `array[1..5, int]`
14:00:10FromDiscord<lqdev> also
14:00:27FromDiscord<lqdev> `const arr = [1: 3, 2: 5, 3: 10]` is an `array[1..3, int]`
14:01:11FromDiscord<lqdev> additionally, you may use enums as array indices
14:01:30FromDiscord<lqdev> like `array[YourEnumType, int]` or something
14:01:43mipri!eval echo {1: 3, 2: 5, 3: 10}.typeof # {} vs. []
14:01:45NimBotarray[0..2, (int, int)]
14:02:00FromDiscord<lqdev> mipri: note that i used [] not {}
14:02:11FromDiscord<lqdev> !eval echo [1: 3, 2: 5, 3: 10].typeof
14:02:13NimBotarray[0..2, int]
14:02:16mipriJesus Christ.
14:02:18*mipri left #nim (#nim)
14:02:21FromDiscord<lqdev> huh, that's 0..2 still
14:02:30FromDiscord<Rika> lol
14:02:32FromDiscord<lqdev> !eval echo [1: 3, 2: 5, 3: 10][1]
14:02:35NimBot3
14:02:43FromDiscord<Rika> ????
14:02:45FromDiscord<lqdev> i guess typeof is weird then
14:04:46FromDiscord<hamidb80> !eval echo low [1: 3, 2: 5, 3: 10]
14:04:48NimBot1
14:05:09FromDiscord<hamidb80> !eval echo low {1: 3, 2: 5, 3: 10}
14:05:12NimBot0
14:05:25FromDiscord<lqdev> `{a: b}` is sugar for `[(a, b)]`
14:06:07FromDiscord<hamidb80> !eval echo {1: 3, 2: 5, 3: 10}[0]
14:06:09NimBot(1, 3)
14:06:14FromDiscord<hamidb80> yep
14:08:03FromDiscord<hamidb80> so is it wrong?
14:08:12FromDiscord<hamidb80> (edit) "it" => "that"
14:08:52FromDiscord<hamidb80> i guess it should be array[0..1, int]
14:09:15FromDiscord<Rika> it should be 1..3
14:10:42FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/802903202378678322/Capture.PNG
14:10:48FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/802903226046218250/Capture2.PNG
14:12:22FromDiscord<hamidb80> I think it makes more sense if the Pragma applies for both mouseX & mouseY
14:12:49FromDiscord<hamidb80> not just mouseY
14:13:20FromDiscord<hamidb80> since uint data type applies for both
14:13:28FromDiscord<hamidb80> (edit) "uint" => "`uint`"
14:13:34FromDiscord<hamidb80> (edit) "mouseY" => "`mouseY`"
14:13:37FromDiscord<ngigsn> yay↵did someone tried to enforce size to norm string field to generate varchar(size) ?
14:13:54FromDiscord<hamidb80> (edit) "mouseX" => "`mouseX`" | "mouseY" => "`mouseY`"
14:14:18FromDiscord<carpal> can I ask a thing (I'm sorry if I'm asking you a few things), I installed `stopwatch` with nimble, but if I import it in a module the compiler cannot open the file, to fix it I copied the lib into the nim-1.4.2/lib dir ... but this is a bad practice I think ..
14:14:28FromDiscord<hamidb80> should I open an issue on github?
14:30:59FromDiscord<carpal> ok I fixed adding to the project nimble file `requires "stopwatch >= 3.5"`
15:14:26ForumUpdaterBotNew thread by Sekao: Pararules - A rules engine for games, see https://forum.nim-lang.org/t/7422
15:18:12*krux02 joined #nim
15:20:48disrupteklqdev: please do improve badresults as much as you want.
15:23:00disruptekit's the same as status results except that i don't demand that every result type has a `$` impl'd which has no side-effects.
15:24:56disruptek!repo badresults
15:24:56disbothttps://github.com/disruptek/badresults -- 9badresults: 11a less fascist fork of nim-result 15 5⭐ 0🍴
15:29:22disrupteksend collab invite.
15:29:25disrupteker, sent
15:36:35FromDiscord<Zachary Carter> 😕
15:45:25Zevvdude
15:45:58Zevvyou even blackmailed zach?!
15:46:36Zevvand he's *also* more sexy then me
15:46:46Zevvthat hurts man
16:19:59disruptekzachary carter: it says that when you sponsor someone, you become their bitch.
16:20:35disruptekZevv: maybe if you shaved more than twice a year?
16:34:10*fputs quit (Quit: Leaving)
16:34:21FromDiscord<hotdog> Is nimph really that much better than nimble? What's the main draw?
16:34:41disruptekworking software with support, i think.
16:35:03FromDiscord<hotdog> nimble is unsupported? It ships with Nim no?
16:36:11disruptekis that how you estimate support?
16:36:40FromDiscord<hotdog> No I just mean I'm surprised if it's no longer supported, I didn't realise
16:37:30disruptekwell, you can draw your own conclusions from the contents of the issue tracker.
16:37:38disruptekand that of nimph, for that matter.
16:38:23FromDiscord<hotdog> Oh I see you are the author of nimph
16:38:26FromDiscord<hotdog> Didn't realise
16:38:33disruptekif you're satisfied with nimble, keep using it.
16:38:44disruptekif you're not, there are half a dozen other package managers to choose from.
16:38:48FromDiscord<hotdog> Amount of issues isn'
16:38:54FromDiscord<hotdog> t always the best way to judge
16:39:03FromDiscord<hotdog> If there is a very different amount of users
16:39:30disrupteki'd hoped you'd dig deeper in the issues than merely counting them.
16:39:43FromDiscord<hotdog> Oh
16:39:59FromDiscord<hotdog> You expect me to read 100+ issues to judge the state of both projects?
16:40:02*waleee-cl joined #nim
16:40:13disruptekyou expect me to give an unbiased opinion?
16:40:24FromDiscord<hotdog> I was just asking peoples opinions of nimph as I hadn't used it
16:40:33disruptekmy opinion is that it works well.
16:40:33FromDiscord<hotdog> Not necessarily yours bud
16:41:17FromDiscord<hotdog> Cool
16:41:41disruptekit needs a --rage option that, like, blows away anything that isn't represented in the environment correctly.
16:41:54FromDiscord<hotdog> What's the main thing you think it has over using nimble? More stable I guess if you think there are more issues with nimble?
16:41:57disrupteksomething that basically flushes your deps but is cheaper than `rm -rf deps` or whatever.
16:42:50disruptekthe main thing is that it solves the engineering problems that we have and not the engineering problems we don't; it leans heavily on the compiler and github to exploit already strong workflow there.
16:43:27disruptekit has working dependency analysis, which is kinda useful for a package manager.
16:43:42disrupteki mean, when you shop for a car, you shop for a vehicle that can get you from here to there.
16:43:54disruptekif it can't do that, it doesn't matter how loud the radio gets.
16:44:24*evbo joined #nim
16:46:49FromDiscord<hotdog> Uh ok
16:46:54FromDiscord<hotdog> I'll take a look
16:47:55FromDiscord<hotdog> Any idea what proportion of the Nim community are using it over nimble?
16:48:31disruptekvery few people use nimph, afaik.
16:49:03disruptekit's kinda like nim that way. very few programmers actually have good taste.
16:50:28ZevvI do, I do
16:50:46disruptekZevv: you're special.
16:50:59Zevvthank you
16:51:15disruptekzevv doesn't use nimph, either. 😁
16:51:40ZevvI just don't do dependencies
16:51:54disruptekthat's a solution.
16:54:12FromDiscord<hotdog> Fair enough
16:55:40disruptekhonestly, most people just don't give a shit. they don't write a lot of nim and it's not super important to them that the tools work.
16:56:13disruptekmost of the serious nim programmers use make to manage their environment.
16:56:42disruptekthe others are compiler developers. 😉
16:57:10krux02@hotdog: the experience for me with nimble is, issues aren't fixed. And whenever you actually want to do something that goes beyond the most trivial thing it doesn't work.
16:57:29krux02using nimble just adds complexity to the task, it doesn't reduce complexity.
16:57:52disruptekkrux02: long time no see; how are you doing?
16:58:04krux02I am fine.
16:58:09krux02thanks for the question.
16:58:19krux02I had a long break from everything.
16:58:27disruptekwere you sick?
16:58:36FromDiscord<hotdog> Admittedly I do not use a lot of 3rd party libs, so I don't have a lot of package management troubles
16:58:54disruptekhotdog: treasure your youth.
16:58:54krux02No work no Nim, just doing nothing. Now I am back and finishing all my unfinished business.
16:59:05FromDiscord<exelotl> for my project I'm just using nimscript for build tasks & submodules for deps
16:59:06disruptekhah, nice.
16:59:18Zevvit's almost like disruptek, except for the "no nim" part
16:59:31Zevvpada *dumm*
16:59:39krux02exelotl: that is almost what I do as well. Just no nimscript either.
16:59:55disrupteksubmodules worked great for me, but i'm trying to embrace the dist concept and i think submodules are too intimidating for public consumption.
17:00:02krux02just submodules with all dependencies.
17:00:23krux02at least submodules do their job.
17:00:26disrupteksubtext: araq is afraid of them because he doesn't have experience with them.
17:01:02krux02I don't like working with submodules either, but I prefer working with submodules over expecting nimble to work.
17:01:34disruptekthey work really well with nimph; much faster than running nimscript.
17:04:18disruptekZevv: i'm just gonna play video games until i get my mojo back.
17:04:33krux02what is mojo?
17:05:06disruptekwhatever you don't have when you're burnt out.
17:05:07*wasted_youth joined #nim
17:05:41krux02yea I know exactly what you mean.
17:05:56krux02When you are really burned out, you don't even enjoy video games anymore.
17:06:27disrupteki try not to let it get to that point. 😁
17:06:48krux02yea, that is a good plan.
17:07:14krux02my recommendation is, play games with other people, not alone.
17:07:16disrupteki went like six weeks without a break and it's just too much.
17:07:28krux02Too many games are just single player in my opinion.
17:08:06disruptekeh i need to game at my own pace.
17:08:06krux02Here are some great coop games: Stardew Valley, Overcooked, Streets of Rage 4, Streets of Rogue, Unrailed
17:08:40disruptekto those i'd add monaco and trine.
17:08:48krux02yea competetive multiplayer is not for everybody. I generally like RTS games, but competetive RTS? Exciting but exhausting.
17:09:10disruptekand maybe magicka.
17:09:18krux02I played trine. I loved tha graphics and atmosphere. The gameplay was a bit too lightweight for me.
17:09:25disruptekagreed.
17:09:28krux02yea magicka is great.
17:09:42disruptektrine is a good coop game to play with lightweight gamers.
17:09:58krux02I liked "Lost Vikings" the game from Blizard that was before they were popular with Warcraft.
17:10:12krux02that is like Trine, but with Vikings and coop and really interesting puzzles.
17:10:18krux02but very old
17:10:59disrupteki'm thinking about writing a MUD again.
17:11:06krux02and if you like Magicka, I recommend from the same developres, Helldivers: Coopmadness in a Starship Troopers/Warhammer 40k Universe
17:11:52krux02I know you mean Multi User Dungeon, but I always think about Mean Ugly Dirty Sports (MUDS) another game that has absolutely nothing to do with MUD
17:11:52disrupteki find magicka too fiddly, but i haven't given it a proper attempt.
17:12:10krux02it is meant to be played with keyboard
17:12:13krux02not gamepad
17:12:29disruptekahh.
17:12:31krux02and Helldivers is for gamepad
17:13:15krux02magicka is great online coop, but not on the same computer where someone has to use the gamepad. It just doesn't work.
17:13:29krux02and Helldivers is made for single screen.
17:13:42krux02even online all players share the same screen
17:14:10krux02I have the feeling we captured the entire chat to be about games :P
17:14:30disruptekno one else wants to contribute.
17:14:34disruptekit's because they are boring.
17:15:03krux02yea, or they think we are boring, talking about games instead of Nim :P
17:15:24disrupteki am periodically impl'ing path of exile mechanics in nim.
17:15:45disruptekso i figure i will eventually have a pretty complete combat simulator.
17:15:50disruptekmaybe base the mud upon that.
17:16:04disruptekit will have to be much slower, of course.
17:16:30krux02I am always thinking about making good games in general. Game ideas that are not fully explored yet.
17:17:05disruptekgotta get zachary carter to impl my coop game idea:
17:17:20krux02I recently played a lot of board games, and I really think that board games provide something that PC games don't provide that is beyond just the social aspect of the game.
17:17:24disruptekyou are a ball and you can push other balls operated by your friends.
17:17:49krux02It is about the simplicity and the fact that they are turn based and therefore not as stressful as RTS games.
17:18:24krux02disruptek, that game already exists since 1984, it is called marble madness.
17:18:43disruptekit's not the same.
17:19:04disruptekthis would be more cooperative obstacle-course gameplay.
17:19:38disruptekpossibly with teams of like 6-8 players; figure 10-20 teams playing at once.
17:19:46krux02Marble Madness is competetive obstacle course gameplay
17:20:39krux02I am thinking about making an RTS that is not about who has the most clicks per minute.
17:22:59disruptekthat's crazy talk.
17:23:26krux02I think it is pretty easy to implement.
17:23:48krux02Just limit the amout of commands a player can give per minute.
17:24:30krux02the question is, to make the game still be fun with this limitation.
17:24:57krux02Often players are very ignorant and when they can't give as many instructions as they want, they complain about it.
17:25:20krux02so it needs to be reasonable in the game world.
17:26:31krux02Something else that I think would be to add a delay for instructions. For example a chain of command and only when the command reaches the unit, the unit can follow the order.
17:26:43krux02This will prevent that the game is about micromanaging all units.
17:26:58krux02which is something I never liked to do in Strategy games.
17:27:32disrupteki like the idea that communication has some agency and physicality to it.
17:27:54disrupteki had something similar in my mud, whereby messages could be delivered between units.
17:29:08disruptekliteral couriers could be intercepted, betraying the messages and preventing maneuvers.
17:29:21krux02yea I like the idea
17:29:32krux02shoot down the birds :P
17:29:39disruptekyeah.
17:30:03disruptekthe problem i never solved well was time compression.
17:30:10krux02I also had the idea to make the RTS in VR, but the player is sitting in the throne room all the time.
17:30:27krux02and there is a migical table that shows the kingdom.
17:30:48saemI'm all about slow place coop games
17:30:55saemI don't want to work when gaming
17:31:25krux02And when there are intruders in your castle you can litterally hear them come closer and eventually they will murder you.
17:31:40saemI need to blow off steam with people, the social part is key.
17:31:56krux02yea I totally agree on that one.
17:31:58disruptekwhat do you play that is social and slow?
17:32:07FromDiscord<ngigsn> `Person = ref object of Model↵ name {.size: 100.}: string`
17:32:25FromDiscord<ngigsn> (edit) "name" => "name"
17:32:42saemHahaha, so I have all these nicknames for games with the people I play with it'll take me a few seconds to recall the name of each one
17:32:53krux02disruptek: Stardew Valley
17:32:56saemDwarves: deep rock galactic
17:33:08krux02Minecraft
17:33:10saemDon't starve
17:33:19saem(lower difficulty)
17:33:30disruptekeh crafting and farming?
17:33:46saemInquisitor 40k, if it wasn't a big piece of crap
17:33:49FromDiscord<Recruit_main707> since arc and orc will become the default, and they have a shared heap, will threads be allowed to have var, ref, etc arguments?
17:34:13saemI want inquisitor to work so bad, but ugh
17:34:25saemGrimdawn was a lot of fun
17:34:33krux02saem: play Helldivers maybe you will like it :P
17:34:38saemSaint Row 4
17:35:02saemkrux02: haha, you mean starship troopers ;)
17:35:11saemYeah, I've played it a bit
17:35:34saemFor the king is okay, but need to tweak the scaling
17:35:54saemRisk of Rain and Vagante for rogues
17:36:42saemI used to play a lot of borderlands 2, but the company pissed me off.
17:37:39saemOh, I forgot about Warframe, played a _lot_of that.
17:38:08disruptekvagante looks kinda interesting.
17:39:02saemkrux02: also glad to talk to you, I've met you through your past commits. If you ever want to talk compiler that'd be cool, no pressure though.
17:39:37saemdisruptek: I'm on steam on Linux and PS4
17:39:55krux02saem, So what did you read from me?
17:39:57saemOh, divinity original sin, that was alright
17:40:29krux02Linux, PS4 and Switch it is here
17:40:42krux02but PS4 is pretty much unused since we have the Switch here.
17:40:55saemkrux02: gdb Python script, trying to remember some sem related changes (little fuzzy there).
17:41:41saemkrux02: I haven't turned mine on in ages, my partner played witcher 3 for like 200 hours that was fun to watch
17:42:18saemBut yeah, that's it. It's been off for months unless it gets accidentally turned on
17:43:23disrupteki didn't finish witcher 3; got sidetracked and suffered from levelitis.
17:43:47*lf_ joined #nim
17:43:52saemkrux02: I'm coming into the compiler from the Nim suggest angle, but I mostly care about sem right now.
17:44:05*lf_ is now known as lf_araujo
17:44:18saemdisruptek: I think that means you're playing it right.
17:44:36saemAccording to the girlfriend reviews episode.
17:44:48disruptekthe wut
17:45:00saemLet me grab you the link
17:45:16disrupteki'm not about to get rickrolled two days in a row.
17:45:32saemWhy not?
17:45:35saemhttps://youtu.be/8T_ztm42YoE
17:52:12disruptekfunny.
17:53:39saemBesides, I've evolved to Rick Grohling: https://youtu.be/APmoU74ZsG4
17:53:58*abm joined #nim
17:55:19FromDiscord<VVX7> how can I cast a ptr to an object to an object? I tired something like `cast[Foo](myPtr)` but I get an illegal storage access error
17:55:54FromDiscord<ElegantBeef> `cast[ptr Foo](yourPtr)[]`
17:56:34FromDiscord<ElegantBeef> You'd have to dereference the pointer as you'll get a memory error if Foo is a different size than a pointer afaik
17:57:23krux02saem: If you are struggling with the python code, I can help you there, but yes I think the language might have gone through some changes that made the gdb python script a bit less useful.
17:57:56krux02sorry I was afk for a moment, had to participate in the birthday celebration of my girlfriend
17:58:09krux02she made a nice cake
17:59:36krux02btw, the coop games I play, I play with her generally. But she doesn't like violent games, that pretty muche excludes 90% of all games, and when you are then looking for coop games, then there are not a lot of options left.
18:00:00krux02Currently we play unrailed, we didn't decide yet if it is a good game though.
18:02:06*cyraxjoe joined #nim
18:04:45ForumUpdaterBotNew thread by Freeflow: A VBA library?, see https://forum.nim-lang.org/t/7423
18:05:15FromDiscord<VVX7> do you know if this works with FFI as well? Can I import a proc from a compiled Nim library that returns type Foo?
18:05:44FromDiscord<VVX7> and then cast that ptr Foo to Foo...
18:06:14FromDiscord<ElegantBeef> well if you're just wanting to get the value at a pointer just do `yourPtr[]`
18:10:26saemkrux02: cake sounds awesome! no need to apologise. ;) Python itself wasn't a struggle, i think it's now one of those things where it's more about design. I fixed up a bunch of issues that showed up due to bitrot. I was more thinking something casual about thoughts on the compiler, I'm a bit more community first.
18:11:09krux02there is a test for the python pretty printer
18:11:20saemyup, I added a bunch of those.
18:11:36krux02ok, can you give me a link?
18:11:47saemexpanded the test cases a fair bit, got some more edge cases.
18:12:40saemkrux02: here was the last PR I made: https://github.com/nim-lang/Nim/commit/84a7544988ffd8d26ff50c8a9417acbededf03fb#diff-3896713add36a758a42fab869d9bc51da482dee9b9b395f30686f10f6fce2260
18:12:48saemlast/only
18:12:56*natrys joined #nim
18:13:10saemA bit frustrated at the time, but the results are better
18:13:28saemsorry, that's the commit, PR is linked therein
18:18:10saemThere could easily be more improvements I think that should come from ndi files and other things that the compiler should generate, then this script can be straight up data driven and basically unchanging.
18:18:47ForumUpdaterBotNew thread by B3liever: How to toggle a class name in Karax, see https://forum.nim-lang.org/t/7424
18:29:45krux02saem: yea there are a lot of things that can be done in terms of better debugging.
18:29:57krux02The problem I faced was mostly Araq.
18:30:28krux02I did not believe in debugging at least back then, And it was very hard to convince him that it is important to have good debugging support.
18:31:34saemYeah, I know folks like that, heck I used to be like that and in some ways am. But if we want new people coming into complex code bases like the compiler which have tonnes of implicit stuff that depends upon the state of the callstack... it's a must or the community will starve
18:32:11disruptekthe community is already starving.
18:32:17saemI know
18:32:22FromDiscord<VVX7> thanks, I must be doing something else wrong. will open a post on the nim forums.
18:32:23disruptekfor every new person that arrives, another leaves.
18:36:58saemI think that's fixable, but it means looking at architecture of key Nim things very much from a Conway/community perspective. Just gotta get a few folks believing that and rowing in that direction. It doesn't have to be grandiose just consistent monotonic improvements. A better debugger for the compiler is one such thing, compiler code base where it's easy to glean the spec is another, CPS which is a "killer" use case, ...
18:41:14saemoh that reminds me, mratsim, have you looked at a-normal form, a buddy of mine who has a lot of PL interest/background mentioned it to me in regards to CPS. https://course.ccs.neu.edu/cs4410sp20/lec_anf_notes.html#%28part._.A-.Normal_.Form%29. It's at the intersection of CPS and SSA as facilities for transforms/optimization
18:41:22*lf_araujo quit (Quit: lf_araujo)
18:41:50*lf_araujo joined #nim
18:42:08saemdisruptek: you might be interested in it as well, but AFAICS, it's more about dancing around the compiler presently.
18:48:22disruptekwe need this stuff impl'd in the compiler and provided as simple macro predicates and other primitives so the cps code can be simpler and other such implementations are easier.
18:48:55disrupteki guess if i don't write it, it's unlikely someone else will.
18:53:16saemThat sounds pretty convincing, things like CPS should be operations in an algebra so you know you're guaranteed that you get APIs that compose (algebra not some fuzzy made up stuff) instead of having to have achieve some strictly out of band/poorly thought out consensus based approach.
18:54:07disruptekyes, this is basically what csp is.
18:54:45Zevvmeh, it's just moving the stack to the heap
18:54:59disruptekcsp, sunshine, not cps.
18:55:26Zevvooh he did it again. he looked into the egg. and now this thing is stuck to his face. every. stupid. time. will he ever learn.
18:55:35disrupteklol
18:55:38saemI flip that around all the time
18:55:54Zevvyeah i know, just pulling legs here
18:56:00disruptekcps is just mechanical. csp is where things get interesting.
18:56:10Zevvwhen I started cps I made a typo in the repo name and called it csp. that was helpful
18:56:48disruptekyeah, i took the link out recently because i decided it was too confusing.
18:57:51Zevvyeah i'll kill the repo
18:57:55Zevvmy task is done here
18:58:52Zevv"I understand the consequences, delete this repository"
18:59:08Zevvmy time is better spent seeing how Ripley solves it this time
18:59:50saemI'll probably use them interchangeably because the distinction in broader PL spaces is all muddy so yeah
19:00:18saemZevv: step one, make up a mystery you already know the answer to
19:02:33Zevvthat's how it is done
19:04:53ForumUpdaterBotNew thread by VVX7: FFI - how to use procs that return objects, see https://forum.nim-lang.org/t/7425
19:05:10FromDiscord<VVX7> just added the question to the forum https://forum.nim-lang.org/t/7425#47057
19:06:13FromDiscord<ElegantBeef> Your `returnFoo` doesnt return a pointer though
19:12:18FromDiscord<VVX7> sent a code paste, see https://play.nim-lang.org/#ix=2Ndo
19:12:29FromDiscord<VVX7> this gives me the same storage access error
19:13:04FromDiscord<ElegantBeef> You arent getting a function
19:14:05FromDiscord<ElegantBeef> It's nil i should say
19:20:50*zidsal joined #nim
19:20:51*zidsal quit (Changing host)
19:20:51*zidsal joined #nim
19:21:28zidsalHi guys, the parseJson proc in the standard library is defined as a proc. What about this function causes side effects?
19:34:19leorize[m]it doesn't
19:35:00leorize[m]well streams might cause side effects, fwiw
19:41:52*lf_ joined #nim
19:42:35*def- quit (Quit: -)
19:45:25*lf_araujo quit (Ping timeout: 240 seconds)
19:45:49*def- joined #nim
19:49:01zidsalok second question I have a function that takes a string as an argument internally calls parseJson and then does some computation. Currently I cannot make it a func as it complains about side effects, which I presume is because parseJson is a proc. Is there anyway to fix that?
19:59:48*def- quit (Quit: -)
20:01:41*habamax quit (Ping timeout: 256 seconds)
20:03:30*def- joined #nim
20:06:40*lf_ quit (Ping timeout: 265 seconds)
20:09:15FromDiscord<mratsim> if you want to fix, don't call parseJson inside, pass the result as a parameter to the function. If you want to workaround, you can pass the offending block to {.cast(noSideEffect).}: theCodeThatHasSideEffectAndIwantItToStopComplaining
20:10:39leorize[m]eh, doing that defeats the purpose of func, so better just call parseJson outside of the func
20:11:03Zevvshouldn't we just fix parsejson
20:11:54FromDiscord<carpal> sorry
20:11:58FromDiscord<carpal> a thing
20:13:28*def- quit (Quit: -)
20:13:45FromDiscord<carpal> I'm trying to publish a package in nimble
20:13:49*def- joined #nim
20:26:14Zevvso, how does that work out for you
20:28:02FromDiscord<carpal> so now I have to wait? https://media.discordapp.net/attachments/371759389889003532/802998163962593290/unknown.png
20:29:30Zevveven longer, someone has to accept and merge your MR
20:30:07FromDiscord<carpal> ok, but on my repo there are only useless files
20:30:18FromDiscord<carpal> that nimble forked for me
20:30:54Zevvbut https://github.com/Carpall/nobject 404's for me
20:31:10FromDiscord<carpal> https://github.com/Carpall/packages
20:31:19FromDiscord<carpal> (edit) "https://github.com/Carpall/packages" => "<https://github.com/Carpall/packages>"
20:31:36Zevvsure, but the nimble you are trying to register points to https://github.com/Carpall/nobject, right?
20:32:27FromDiscord<carpal> ok so I have to create a repo at carpall/nobject?
20:32:40Zevvok, a few steps back
20:33:04FromDiscord<carpal> should it contains specific files?
20:33:40Zevvwell, your nimble package
20:33:57Zevvso your project's nimble file and source files
20:34:10FromDiscord<carpal> just this? https://media.discordapp.net/attachments/371759389889003532/802999704220598302/unknown.png
20:34:24Zevvindeed
20:34:26Zevvthat's your package
20:34:39Zevvputting it in nim packages is only a reference to your publish URL
20:34:47Zevvtypically github, but can be anywhere, actually
20:34:58FromDiscord<carpal> ok now I'm going to create carpall/nobject
20:35:31Zevvright. Interesting to see that nimble let you publish it when it's not actually available on the configured url
20:36:36FromDiscord<carpal> ah okay
20:36:44*natrys quit (Quit: natrys)
20:36:50FromDiscord<carpal> so I could create the repo also from 1 year lol?
20:38:57FromDiscord<carpal> done
20:41:12Zevvok, you should be good now. Now waiting until one of the admin approves and merges your MR
20:41:29ZevvIn the mean time, people can also use your package using "nimble install https://github.com/Carpall/nobject"
20:42:09FromDiscord<carpal> ok so when I'll get some result from↵https://github.com/nim-lang/packages/pull/1793/, if a admin doesn't decide to close the pr I'll can do nimble install ..
20:42:10disbotAdd package nobject
20:42:24FromDiscord<carpal> (edit) "from↵https://github.com/nim-lang/packages/pull/1793/," => "from↵<https://github.com/nim-lang/packages/pull/1793/>,"
20:42:25disbotAdd package nobject
20:42:57Zevvtechnically, you do not *need* to register your package. People can just install it without. The only thing you gain is that you are in the seachable index
20:43:29FromDiscord<carpal> but `https://github.com/Carpall` is mandatory or I can write only `nimble install nobject`?
20:43:46Zevvwhen you are merged, it's the latter
20:44:04FromDiscord<carpal> ok thanks
20:44:09FromDiscord<carpal> I'll wait
20:49:08FromDiscord<konsumlamm> you realize that you just uploaded a dummy project?
20:50:53Zevvha
20:52:25FromDiscord<carpal> what do you mean?
20:53:40FromDiscord<konsumlamm> https://github.com/Carpall/nobject/blob/main/src/nobject.nim
20:54:03FromDiscord<konsumlamm> this is the generated dummy project
20:54:12FromDiscord<Avatarfighter> yo yo everyone what's good
20:54:42FromDiscord<carpal> oh no fuck
20:55:26FromDiscord<carpal> nooooo
20:55:31FromDiscord<carpal> I deleted the local file
20:55:34FromDiscord<carpal> porco dio
20:55:59FromDiscord<carpal> I have to rewrite alll
20:56:02FromDiscord<carpal> (edit) "alll" => "all"
20:58:49FromDiscord<konsumlamm> also, isn't the equivalent of .NETs Object in Nim RootObj?
20:59:53FromDiscord<carpal> inspired
21:03:48FromDiscord<carpal> do you talk about nobject?
21:08:16FromDiscord<konsumlamm> ye
21:10:20FromDiscord<carpal> no, it is not the equivalent of the .net object
21:10:30FromDiscord<carpal> .net object is a managed type, it runs on a jit
21:10:48FromDiscord<carpal> it works so good for that
21:11:00FromDiscord<carpal> but I tried to simulate it
21:11:59FromDiscord<carpal> but I accidentally deleted the repo thinking I pushed the files on github, but I pushed the dummy project only
21:12:04FromDiscord<carpal> 😢
21:15:07FromDiscord<carpal> now I'm waiting for listing of the repo in the deleted repos list https://media.discordapp.net/attachments/371759389889003532/803010013827563530/unknown.png
21:18:10FromDiscord<konsumlamm> what exactly do you want to use nobject for?
21:21:12FromDiscord<carpal> my vm
21:21:32FromDiscord<carpal> I need a safe object allocable on the stack
21:21:45FromDiscord<konsumlamm> a VM for a dynamically typed language?
21:21:48FromDiscord<carpal> I'm trying to allocate all the vm on the stack
21:21:55FromDiscord<carpal> yea
21:22:18FromDiscord<carpal> not a language, but only a vm
21:24:39FromDiscord<konsumlamm> whats the point of a VM without a language for it?
21:24:49FromDiscord<carpal> learning lol
21:24:58FromDiscord<konsumlamm> like, it has to have some language, no? even if it's some bytecode thing
21:25:06FromDiscord<konsumlamm> how else do you want to program it?
21:25:08FromDiscord<carpal> learning and havinh fun
21:26:06*zidsal87 joined #nim
21:26:15FromDiscord<carpal> but idk
21:26:56FromDiscord<carpal> I was writing a language
21:27:09FromDiscord<carpal> I already wrote the parser
21:27:40FromDiscord<carpal> it works very well, it is my first serious parser
21:28:45*zidsal quit (Ping timeout: 240 seconds)
21:51:39FromDiscord<ElegantBeef> @VVX7 are you certain that `newFoo` isnt a nilptr in your ffi stuff, when i tested it that was nil, the symbol couldnt be loaded?
21:53:05FromDiscord<ElegantBeef> Like using this it errors on line 14 due to not being able to get that symbol https://play.nim-lang.org/#ix=2Neb
21:53:27FromDiscord<ElegantBeef> I dont know much about dynlib and how to write code in Nim to be used like a library so cannot say what's wrong
22:05:40*hnOsmium0001 joined #nim
22:16:34FromDiscord<carpal> isn't there a way to implement the `as` operator for a type that takes the instance as first parameter and the typedesc as second?
22:16:44FromDiscord<carpal> or... I tried to implement it
22:17:13FromDiscord<carpal> but compiler says that only an Ordinal type can be passed as typedesc
22:19:26FromDiscord<ElegantBeef> Uncertain what you want but this apparently works https://play.nim-lang.org/#ix=2Nel
22:21:53FromDiscord<carpal> yes I was implementing it in this way https://media.discordapp.net/attachments/371759389889003532/803026816143065088/unknown.png
22:22:54FromDiscord<konsumlamm> what's the code that gives you an error and what's the error message?
22:23:32FromDiscord<ElegantBeef> There is no reason to pass a var there btw
22:24:05FromDiscord<ElegantBeef> Also you may want to use an object variant instead of this typedesc if this is for a VM
22:27:27FromDiscord<carpal> it was in the old module (I deleted opsss, so I'm rewriting it)
22:27:44FromDiscord<carpal> right
22:28:09FromDiscord<carpal> .. but I'm using a variant object
22:28:14*abm quit (Quit: Leaving)
22:28:25FromDiscord<ElegantBeef> I dont get why you're using typdesc's then
22:28:54FromDiscord<ElegantBeef> This is for dynamic typing isnt it?
22:29:13FromDiscord<carpal> for this https://media.discordapp.net/attachments/371759389889003532/803028661040054342/unknown.png
22:37:51FromDiscord<lqdev> ObectCode
22:38:40*krux02 quit (Remote host closed the connection)
22:44:42*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:46:25*pbb joined #nim
22:49:23FromDiscord<ache of head> lmao
22:49:27FromDiscord<ache of head> oh darn
22:49:39FromDiscord<ache of head> i was supposed to stop writing that in chat
22:49:43FromDiscord<ache of head> i'm sorry
22:53:16*tane quit (Quit: Leaving)
22:58:51FromDiscord<carpal> ops ahha
23:03:26*abm joined #nim
23:05:44FromDiscord<carpal> can someone help me to understand why all type converters work except for int? https://media.discordapp.net/attachments/371759389889003532/803037848642650132/unknown.png
23:05:57FromDiscord<carpal> this is the definition https://media.discordapp.net/attachments/371759389889003532/803037903243968522/unknown.png
23:06:10FromDiscord<carpal> ok.... lol
23:06:42FromDiscord<carpal> I must use `int` instead of `int32`
23:06:43FromDiscord<carpal> why?
23:06:54FromDiscord<carpal> isn't `int` an alias for `int32`?
23:08:06FromDiscord<ElegantBeef> int is system dependant
23:08:19FromDiscord<ElegantBeef> If it's on a 32bit system it's an int32, 64 bit, int64
23:18:55FromDiscord<carpal> clear! thank you, by the way I assumed it as option, but I was not sure
23:25:14*NimBot joined #nim
23:31:28FromDiscord<konsumlamm> honestly, i'd just make a `toObject` proc instead of defining converters
23:40:24FromDiscord<carpal> why? imho those are an amazing festure!
23:45:41FromDiscord<konsumlamm> it often makes things more confusing and it gets easier to introduce bugs
23:47:30disrupteki've met some amazing bugs here.
23:47:36FromDiscord<carpal> lol
23:47:47FromDiscord<carpal> I hope not with conveters 😂