00:02:28 | FromDiscord | <Recruit_main707> this is everything i could find out, gtg now https://github.com/nim-lang/Nim/issues/16805 |
00:02:35 | disbot | ➥ Compiler 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:29 | saem | That one is a gem, the logic in semArrayIndex seems to be where things go awry. |
00:26:08 | * | NimBot joined #nim |
00:42:22 | FromDiscord | <carpal> why someone use those IRC bots to chat? |
00:42:37 | FromDiscord | <carpal> why not a normal account? |
00:43:12 | disruptek | why don't discord people use a normal account? |
00:43:49 | saem | ^^ |
00:56:59 | * | qwr quit (Ping timeout: 244 seconds) |
01:03:54 | asdflkj | ^ 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:03 | FromDiscord | <exelotl> could I use sink parameters to ensure that a ptr is not dereferenced after calling a certain procedure on it? |
01:41:56 | FromDiscord | <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:57 | FromDiscord | <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:18 | FromDiscord | <exelotl> maybe I'd have to implement an `=copy` routine for the type, which {.error.}'s |
01:44:34 | FromDiscord | <exelotl> thus allowing only moves |
01:45:01 | FromDiscord | <exelotl> I'm guessing this is all hypothetical because I'm using --gc:none right now |
01:45:42 | FromDiscord | <ElegantBeef> Ownership still can be enforced in that scenario, so idk |
01:46:02 | FromDiscord | <exelotl> if I switch to arc my game won't build due to too much static RAM usage. |
01:46:12 | FromDiscord | <exelotl> so I'm guessing ARC creates some junk :( |
01:46:50 | FromDiscord | <exelotl> > Ownership still can be enforced in that scenario↵oh that's good to know |
01:47:25 | FromDiscord | <ElegantBeef> My understanding is that ARC should be usable on embedded, again weird |
01:47:53 | FromDiscord | <exelotl> I've found that it is usable for simple programs, but my game is pretty big now |
01:47:56 | FromDiscord | <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:03 | FromDiscord | <ElegantBeef> I'm a numpty take what i say with a grain of salt |
01:56:14 | FromDiscord | <exelotl> ah I can't define copy for a ptr type 🤦 |
01:57:55 | FromDiscord | <exelotl> I really just wanna be able to say "please don't use this pointer after calling this destroy() proc on it" |
02:01:59 | FromDiscord | <ElegantBeef> Disruptek, i've checked the stdlib `json` and `flatty` both didnt support enum indexed arrays, do your libraries support it? 😄 |
02:02:21 | FromDiscord | <ElegantBeef> It's an easy fix, just curious |
02:08:45 | FromDiscord | <Clyybber> @exelotl =copy {.error.} is what you want, wrap your pointer in an object |
02:10:53 | FromDiscord | <Clyybber> Im curious what is taking up space with arc tho |
02:12:45 | FromDiscord | <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:27 | FromDiscord | <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:32 | FromDiscord | <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:45 | disruptek | beef: what do you think an enum-indexed array means at runtime? |
02:18:59 | FromDiscord | <ElegantBeef> What do you mean? |
02:19:15 | disruptek | what would you expect such an animal to render as? |
02:20:04 | FromDiscord | <ElegantBeef> The values in order the same as the array |
02:20:22 | FromDiscord | <ElegantBeef> I mean all it took to add it to json and flatty was to convert their index to the enum |
02:20:55 | disruptek | i guess i will add a test. |
02:20:56 | kinkinkijkin | what is the general accepted form of a nimble library's folder structure? under src |
02:21:05 | disruptek | please not under src. |
02:21:06 | FromDiscord | <ElegantBeef> Well they're in Nim's language features and i use them |
02:21:27 | disruptek | beef: there's no reason they shouldn't be supported, afaik. |
02:21:40 | FromDiscord | <ElegantBeef> `array[Enum,T]` throws an error in both libraries i tested since they both do `array[i]` with an integer |
02:21:44 | kinkinkijkin | src is the default so i assumed there wouldn't be an issue with that |
02:22:16 | disruptek | beef: 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:32 | disruptek | but we'll see soon enough. |
02:22:57 | FromDiscord | <ElegantBeef> Yea just thought i'd mention |
02:24:59 | disruptek | /home/adavidoff/git/jason/jason.nim(196, 14) Error: Expected a node of kind nnkInfix, got nnkSym |
02:25:08 | disruptek | neat, an honest-to-god bug. |
02:30:07 | kinkinkijkin | one 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:17 | disruptek | beef: you know what's tricky? |
03:36:38 | disruptek | i dunno how to implement array[foo..bar, ...] where foo/bar are members of an enum. |
03:38:07 | FromDiscord | <ElegantBeef> What're you trying atm? |
03:39:15 | disruptek | 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. |
03:39:31 | disruptek | i think it might actually be a compiler bug. |
03:40:02 | disruptek | either sigmatch or in typed macros or both. |
03:40:43 | FromDiscord | <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:08 | disruptek | well, flatty is not json; it's not the same problem. |
03:42:23 | disruptek | assume that you cannot copymem. |
03:43:06 | disruptek | i'll be very surprised if frosty has this bug. |
03:43:48 | FromDiscord | <ElegantBeef> I had to do the same for the stdlib's json aswell, so idk |
03:44:00 | FromDiscord | <ElegantBeef> although it's probably silly the way i did it using a `when` |
03:44:36 | FromDiscord | <ElegantBeef> Atleast this seems to work <https://github.com/nim-lang/Nim/pull/16807/files> |
03:44:37 | disbot | ➥ added enum indexed array support to json |
03:45:05 | FromDiscord | <ElegantBeef> I know your json library is different from the Nim one, but eh |
03:45:41 | disruptek | what does that have to do with the problem i surfaced? |
03:45:56 | FromDiscord | <ElegantBeef> I dont know what you're doing so i dont know what your issue is 😄 |
03:46:13 | disruptek | i explained it 6mins ago. |
03:46:13 | FromDiscord | <ElegantBeef> I mostly spew unhelpful shit 99% of the time, this shouldnt be news |
03:46:31 | FromDiscord | <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:53 | saem | Huh, 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:07 | disruptek | i don't know how to get the list. |
04:07:20 | saem | Of the enums? |
04:07:31 | disruptek | of symbols that cannot be getTyped. |
04:08:40 | disruptek | i only do var, let, param. |
04:09:07 | saem | Because 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:17 | disruptek | you're talking about gettype on a rando symbol kind? |
04:09:38 | disruptek | you can define a set of them. |
04:09:50 | saem | Oh my thing, is this nimsuggest issue: https://github.com/nim-lang/nimsuggest/issues/48 |
04:09:51 | disbot | ➥ Variables are suggested within type context |
04:09:54 | disruptek | and you can range[foo..bar]; foo and bar are symbols. |
04:11:15 | saem | I 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:04 | disruptek | i feel like a new man since my click-to-open-url-from-xterm started working again. |
04:13:08 | saem | Yup, those are consts, so I guess you get the type with static[myConstSet]? |
04:13:47 | disruptek | the const would be of type set[Enum], nothing less. |
04:13:52 | saem | I felt pretty great when I got nim check output parsing to allow click to open files |
04:14:07 | saem | That's unfortunate. |
04:14:16 | disruptek | but why? |
04:14:34 | saem | Because wanting to refine the type is a thing? |
04:14:44 | disruptek | use a range. |
04:14:58 | saem | Can you do a sparse range? |
04:15:02 | disruptek | no. |
04:15:08 | saem | yeah... |
04:15:13 | disruptek | so you want a type that is just a static set? |
04:15:54 | disruptek | i guess you could have a macro write it for you. |
04:15:55 | saem | No, I just want sum types, even if it's only a subset for one enum. |
04:17:21 | disruptek | so you want a type that is just a static set. |
04:17:48 | disruptek | or are you saying that you want the set to somehow vary? |
04:17:58 | disruptek | like, it's always four items but which four may vary? |
04:18:22 | saem | it's up four items, and only the specified four items |
04:19:00 | disruptek | yeah, i can see doing it with a macro or a concept if it's enough to simply have a typeclass. |
04:19:37 | disruptek | it's funny how similar it is to my bug. |
04:19:51 | saem | I mean, type class comes close. |
04:19:56 | disruptek | this is my test name: test "arrays with subset of enum indices": |
04:20:24 | disruptek | + type |
04:20:24 | disruptek | + E = enum one, two, three, four |
04:20:24 | disruptek | + A = array[two..four, string] |
04:20:25 | * | actuallybatman joined #nim |
04:20:25 | disruptek | + let x: A = [two: "b", three: "c", four: "d"] |
04:20:29 | disruptek | + check $jason(x) == """["b","c","d"]""" |
04:21:31 | saem | Yup, a sum type would be grand right there, even if they were very limited. |
04:23:24 | disruptek | and you want it to have set semantics? |
04:24:30 | saem | nope, I think those would be two orthogonal things. |
04:24:59 | saem | for 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:06 | saem | That could also be the type of a type parameter, etc... |
04:25:09 | disruptek | so it's an enum that can be converted to the root enum. |
04:25:29 | saem | Well, there is no ordering, so enum carries too much meaning. |
04:25:47 | disruptek | so how is set not correct? |
04:25:56 | disruptek | they aren't ordinals? |
04:26:02 | saem | Because a set allows both 1 and 2 to be in the set. |
04:26:08 | saem | A sum type can only be one of those types. |
04:26:16 | saem | Which is why I said the typeclass is really close. |
04:27:02 | saem | But IIRC, type class forces implicit generics and that blows out code gen, but maybe that's not how it works. |
04:30:24 | saem | Rereading 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:34 | disruptek | https://play.nim-lang.org/#ix=2N7x |
04:30:59 | disruptek | i think we had a similar question come up from someone who wanted -1|1 but we solved it differently. |
04:31:11 | disruptek | so there's more than one solution, at least. |
04:31:58 | saem | Yeah, that definitely the same request. |
04:32:08 | disruptek | i mean, if you search for those things in the irc logs you can find my last impl, whatever it was. |
04:37:21 | saem | That's something to add to the list, but first I wanna see the enum array thing. :D |
04:37:44 | disruptek | what? |
04:38:41 | saem | > 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:02 | disruptek | you want to see it fail? |
04:39:04 | saem | I was just seeing if you had a branch of that up in github |
04:39:12 | disruptek | oh, i can push it. |
04:39:14 | saem | yeah, I was checkin' your testes |
04:40:43 | disruptek | https://github.com/disruptek/jason/tree/enum_array |
04:45:51 | * | Gustavo6046 joined #nim |
04:46:08 | disruptek | the ast looks like `1 .. 3` but [](1) is unimpl'd for A. |
04:47:21 | disruptek | oh i'm dumb. |
04:47:28 | disruptek | i bet i need to bindsym it. |
04:47:34 | disruptek | i mean, mix it. whatever. |
04:49:01 | disruptek | hmm, i shouldn't have to, actually. |
04:52:00 | FromDiscord | <ElegantBeef> Saem you really really couldnt resist the pun on the PR could you? |
04:52:19 | saem | beef you'd be disappointed if I didn't. |
04:52:28 | saem | You'd be like... where's the beef? |
04:53:22 | saem | (narrator: Ironically, Mr Beef was in fact a strict vegan.) |
04:53:56 | disruptek | unlikely. |
04:54:15 | saem | why you gotta ruin the mystery? |
04:58:05 | saem | I 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:24 | disruptek | no. |
04:58:53 | disruptek | here, i will push a version that emits the error you want to see. |
04:59:05 | saem | I was just going off the master branch |
04:59:39 | disruptek | yeesh, if master doesn't build, you're fucked. |
05:00:06 | disruptek | i did push a better version. |
05:01:55 | saem | oh 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:26 | disruptek | it should. |
05:02:34 | saem | sadly no |
05:03:55 | saem | I know why... I should use nimph... I wonder why I hate installing things so much.? |
05:06:52 | disruptek | package managers are stupid. |
05:08:31 | saem | Wow, 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:53 | disruptek | with nimble, you can `mkdir nimbledeps` and it should use it. |
05:09:35 | saem | I can live with nimph globally, but don't want anything else. |
05:10:15 | disruptek | i'm removing my submodules and i'm gonna try to focus on dist. |
05:12:33 | disruptek | let me know how nimph works globally; i never run it that way. |
05:13:44 | saem | how do you typically do it? |
05:14:10 | disruptek | my .nimble has exec perm and that's it. |
05:14:46 | disruptek | i 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:17 | disruptek | it's basically a local nimbledir but it has git repos in it that i can fork or work on, etc. |
05:16:15 | saem | it makes sense and it'll get better, just unfortunate the amount of unwinding that one must remember. |
05:16:55 | disruptek | nimph is easier because you just setup the compiler properly and nimph makes the env match your config. |
05:18:36 | saem | aside: 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:17 | disruptek | all i can hear is heavy breathing. |
05:19:28 | disruptek | oh wait, that's coming from my side. |
05:19:43 | saem | it's coming from inside |
05:19:48 | saem | GET OUT! |
05:20:30 | disruptek | it's 2°F; i think i'll stay inside for now. |
05:20:39 | saem | yeah, good call |
05:20:50 | saem | cold af |
05:21:09 | disruptek | colorado was worse, but somehow no big deal. |
05:21:23 | saem | humitdity? |
05:21:32 | disruptek | much less, of course. |
05:21:48 | disruptek | though i was on a mountain top, it wasn't very windy. |
05:22:13 | * | hyiltiz joined #nim |
05:22:32 | disruptek | regularly -10, -20, and really pretty comfortable. |
05:22:51 | saem | I'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:07 | FromDiscord | <ElegantBeef> By state you mean nation state no? 😛 |
05:53:24 | saem | 😆 |
05:54:25 | FromDiscord | <ElegantBeef> It's almost -40 here right now |
05:54:36 | saem | you win? |
05:55:55 | FromDiscord | <ElegantBeef> Idk what i win |
05:57:12 | saem | cooler than being cool |
05:59:37 | * | Gustavo6046 quit (Ping timeout: 256 seconds) |
06:02:11 | disruptek | frostbite. |
06:02:25 | saem | ^^ |
06:05:17 | FromDiscord | <Rika> :w |
06:05:19 | FromDiscord | <Rika> ah fuck |
06:05:46 | FromDiscord | <Rika> classic "ah shit i didnt type that in vim" |
06:06:02 | disruptek | at least you're using vim. |
06:07:02 | FromDiscord | <ElegantBeef> Atleast you didnt try to install packages through discord, i've never done that |
06:07:05 | FromDiscord | <ElegantBeef> Totally never |
06:07:19 | saem | that's why I don't use discord |
06:07:27 | * | Gustavo6046 joined #nim |
06:07:28 | disruptek | poor package management? |
06:07:30 | FromDiscord | <Rika> i dont think thats the point |
06:07:34 | saem | the worst |
06:07:51 | saem | also... that AST is not friendly. |
06:09:12 | * | a_chou joined #nim |
06:09:42 | saem | OK, 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:08 | disruptek | should be pretty easy; just go down the list of symbol kinds. |
06:25:00 | saem | The 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:24 | saem | I 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:20 | FromDiscord | <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:34 | FromDiscord | <hamidb80> (edit) "sample" => "samples" |
06:51:52 | FromDiscord | <hamidb80> (edit) "statement for e.g:↵↵doAssert" => "statement:↵↵doAssert" |
06:52:26 | FromDiscord | <hamidb80> (edit) "document" => "documentation" |
06:52:55 | FromDiscord | <hamidb80> (edit) "(something ,...)" => "something == something_else" |
06:53:36 | FromDiscord | <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:23 | FromDiscord | <ElegantBeef> assertions are used to show the output without a compiler |
06:54:42 | FromDiscord | <ElegantBeef> in that case it's to show that something is equal to something else |
06:54:59 | FromDiscord | <ElegantBeef> It's very useful for showcasing expected behaviour for testing or explanation |
06:58:23 | FromDiscord | <hamidb80> I don't think it is supported in vscode |
06:58:39 | saem | which extension? |
06:59:09 | FromDiscord | <ElegantBeef> I mean it doesnt do anything in editor |
06:59:52 | FromDiscord | <hamidb80> what? |
07:00:03 | saem | good point, I assumed they meant it was showing errors or something. |
07:00:07 | FromDiscord | <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:28 | FromDiscord | <ElegantBeef> It's useful for unit testing and ensuring certain goals are met |
07:02:10 | FromDiscord | <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:55 | FromDiscord | <arun> sent a long message, see https://paste.rs/9Zp |
07:19:10 | * | habamax joined #nim |
07:19:17 | FromDiscord | <ElegantBeef> How do you transpile from python and get typing? |
07:19:30 | FromDiscord | <arun> Assumes python code is also statically typed |
07:19:40 | FromDiscord | <arun> There is some basic type inference code |
07:19:45 | FromDiscord | <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:35 | FromDiscord | <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:32 | FromDiscord | <flywind> Does the rst doc generator support something like https://support.typora.io/Markdown-Reference/#reference-links? |
09:39:00 | FromDiscord | <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:05 | FromDiscord | <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:31 | FromDiscord | <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:07 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/pull/12497#issuecomment-766325354 |
10:35:08 | disbot | ➥ introduce csize_t instead of fixing csize |
11:03:49 | FromDiscord | <mratsim> ptrdiff_t |
11:04:44 | FromDiscord | <mratsim> well cptrdiff_t and cssize_t i assume |
11:34:50 | FromDiscord | <carpal> is there a way to make the compiler do implicit conversion? |
11:35:12 | FromDiscord | <carpal> ex.:↵proc x(, MyType) |
11:35:36 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2Nai |
11:36:36 | FromDiscord | <Recruit_main707> https://nim-lang.org/docs/manual.html#converters |
11:37:02 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=2Nan |
11:37:14 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=2Nan" => "https://play.nim-lang.org/#ix=2Nao" |
11:37:16 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=2Nao" => "https://paste.rs/iGu" |
11:37:26 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=2Nar" => "https://play.nim-lang.org/#ix=2Naq" |
11:38:24 | FromDiscord | <Recruit_main707> check that url |
11:38:54 | FromDiscord | <carpal> yep done |
11:38:56 | FromDiscord | <carpal> thank you |
11:41:19 | FromDiscord | <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:43 | FromDiscord | <lqdev> disruptek: mind if i improve badresults.? a bit? |
11:51:32 | FromDiscord | <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:48 | FromDiscord | <lqdev> the case should succeed because both results have the same error type |
11:54:03 | FromDiscord | <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:54 | Zevv | you mean, like, `distinct int`? |
11:59:13 | Zevv | it 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:59 | FromDiscord | <konsumlamm> either a distinct type or no new type at all |
12:29:57 | FromDiscord | <lqdev> is there any way of marking a ref as "weak"? |
12:29:59 | ForumUpdaterBot | New thread by Zulu: How do you y'all deal with missing libs?, see https://forum.nim-lang.org/t/7421 |
12:30:53 | FromDiscord | <lqdev> what i mean by that is, say i store a bunch of refs in a seq |
12:31:18 | FromDiscord | <lqdev> and when i add them to the seq, i don't want their refcount to increment |
12:31:26 | FromDiscord | <lqdev> so that they can get freed |
12:31:41 | FromDiscord | <lqdev> but then i guess the problem is that the seq's elements have to be updated accordingly |
12:31:57 | FromDiscord | <lqdev> to nil or something like that |
12:35:00 | FromDiscord | <carpal> https://media.discordapp.net/attachments/371759389889003532/802879120144728074/unknown.png |
12:53:32 | * | tane joined #nim |
13:05:26 | FromDiscord | <konsumlamm> that doesnt answer my question |
13:14:54 | FromDiscord | <carpal> why should I use implicit converters? 😂 because those are more confortable than use `newObject` |
13:27:05 | FromDiscord | <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:13 | FromDiscord | <mratsim> (edit) "typed" => "type" |
13:36:19 | FromDiscord | <carpal> understood nothing |
13:37:42 | FromDiscord | <carpal> I wrote even a proc `as` for instances converion |
13:38:20 | FromDiscord | <carpal> for get the original type |
13:47:27 | FromDiscord | <carpal> this is how it works, and it works 😂 https://media.discordapp.net/attachments/371759389889003532/802897354754621510/unknown.png |
13:48:26 | FromDiscord | <carpal> I created this object for my vm |
13:48:31 | FromDiscord | <carpal> (edit) |
13:51:35 | * | William[m]1 joined #nim |
13:53:04 | FromDiscord | <hamidb80> I cant understand usage of low & high procs |
13:53:57 | FromDiscord | <hamidb80> from https://nim-by-example.github.io/arrays/ https://media.discordapp.net/attachments/371759389889003532/802898985500540948/Capture.PNG |
13:55:34 | FromDiscord | <Rika> a.low is the lowest index in a (the array) |
13:55:40 | FromDiscord | <Rika> high is the highest index |
13:55:57 | * | vicfred quit (Remote host closed the connection) |
13:58:10 | FromDiscord | <hamidb80> so why they don't use this instead?↵`for i in 0..<a.len:` |
13:58:56 | FromDiscord | <Rika> because a.high is not always equal to a.len-1 |
13:59:01 | FromDiscord | <Rika> same with a.low and 0 |
13:59:03 | FromDiscord | <Rika> it can change |
13:59:14 | FromDiscord | <Rika> arrays can have a negative index |
13:59:23 | FromDiscord | <lqdev> or they can start from 1 |
13:59:36 | FromDiscord | <Rika> ~~only heretics~~ |
13:59:46 | FromDiscord | <hamidb80> can you give me an example? |
13:59:48 | FromDiscord | <Rika> im joking about the heretics thing btw |
14:00:05 | FromDiscord | <lqdev> @hamidb80 `array[1..5, int]` |
14:00:10 | FromDiscord | <lqdev> also |
14:00:27 | FromDiscord | <lqdev> `const arr = [1: 3, 2: 5, 3: 10]` is an `array[1..3, int]` |
14:01:11 | FromDiscord | <lqdev> additionally, you may use enums as array indices |
14:01:30 | FromDiscord | <lqdev> like `array[YourEnumType, int]` or something |
14:01:43 | mipri | !eval echo {1: 3, 2: 5, 3: 10}.typeof # {} vs. [] |
14:01:45 | NimBot | array[0..2, (int, int)] |
14:02:00 | FromDiscord | <lqdev> mipri: note that i used [] not {} |
14:02:11 | FromDiscord | <lqdev> !eval echo [1: 3, 2: 5, 3: 10].typeof |
14:02:13 | NimBot | array[0..2, int] |
14:02:16 | mipri | Jesus Christ. |
14:02:18 | * | mipri left #nim (#nim) |
14:02:21 | FromDiscord | <lqdev> huh, that's 0..2 still |
14:02:30 | FromDiscord | <Rika> lol |
14:02:32 | FromDiscord | <lqdev> !eval echo [1: 3, 2: 5, 3: 10][1] |
14:02:35 | NimBot | 3 |
14:02:43 | FromDiscord | <Rika> ???? |
14:02:45 | FromDiscord | <lqdev> i guess typeof is weird then |
14:04:46 | FromDiscord | <hamidb80> !eval echo low [1: 3, 2: 5, 3: 10] |
14:04:48 | NimBot | 1 |
14:05:09 | FromDiscord | <hamidb80> !eval echo low {1: 3, 2: 5, 3: 10} |
14:05:12 | NimBot | 0 |
14:05:25 | FromDiscord | <lqdev> `{a: b}` is sugar for `[(a, b)]` |
14:06:07 | FromDiscord | <hamidb80> !eval echo {1: 3, 2: 5, 3: 10}[0] |
14:06:09 | NimBot | (1, 3) |
14:06:14 | FromDiscord | <hamidb80> yep |
14:08:03 | FromDiscord | <hamidb80> so is it wrong? |
14:08:12 | FromDiscord | <hamidb80> (edit) "it" => "that" |
14:08:52 | FromDiscord | <hamidb80> i guess it should be array[0..1, int] |
14:09:15 | FromDiscord | <Rika> it should be 1..3 |
14:10:42 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/802903202378678322/Capture.PNG |
14:10:48 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/802903226046218250/Capture2.PNG |
14:12:22 | FromDiscord | <hamidb80> I think it makes more sense if the Pragma applies for both mouseX & mouseY |
14:12:49 | FromDiscord | <hamidb80> not just mouseY |
14:13:20 | FromDiscord | <hamidb80> since uint data type applies for both |
14:13:28 | FromDiscord | <hamidb80> (edit) "uint" => "`uint`" |
14:13:34 | FromDiscord | <hamidb80> (edit) "mouseY" => "`mouseY`" |
14:13:37 | FromDiscord | <ngigsn> yay↵did someone tried to enforce size to norm string field to generate varchar(size) ? |
14:13:54 | FromDiscord | <hamidb80> (edit) "mouseX" => "`mouseX`" | "mouseY" => "`mouseY`" |
14:14:18 | FromDiscord | <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:28 | FromDiscord | <hamidb80> should I open an issue on github? |
14:30:59 | FromDiscord | <carpal> ok I fixed adding to the project nimble file `requires "stopwatch >= 3.5"` |
15:14:26 | ForumUpdaterBot | New 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:48 | disruptek | lqdev: please do improve badresults as much as you want. |
15:23:00 | disruptek | it'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:56 | disruptek | !repo badresults |
15:24:56 | disbot | https://github.com/disruptek/badresults -- 9badresults: 11a less fascist fork of nim-result 15 5⭐ 0🍴 |
15:29:22 | disruptek | send collab invite. |
15:29:25 | disruptek | er, sent |
15:36:35 | FromDiscord | <Zachary Carter> 😕 |
15:45:25 | Zevv | dude |
15:45:58 | Zevv | you even blackmailed zach?! |
15:46:36 | Zevv | and he's *also* more sexy then me |
15:46:46 | Zevv | that hurts man |
16:19:59 | disruptek | zachary carter: it says that when you sponsor someone, you become their bitch. |
16:20:35 | disruptek | Zevv: maybe if you shaved more than twice a year? |
16:34:10 | * | fputs quit (Quit: Leaving) |
16:34:21 | FromDiscord | <hotdog> Is nimph really that much better than nimble? What's the main draw? |
16:34:41 | disruptek | working software with support, i think. |
16:35:03 | FromDiscord | <hotdog> nimble is unsupported? It ships with Nim no? |
16:36:11 | disruptek | is that how you estimate support? |
16:36:40 | FromDiscord | <hotdog> No I just mean I'm surprised if it's no longer supported, I didn't realise |
16:37:30 | disruptek | well, you can draw your own conclusions from the contents of the issue tracker. |
16:37:38 | disruptek | and that of nimph, for that matter. |
16:38:23 | FromDiscord | <hotdog> Oh I see you are the author of nimph |
16:38:26 | FromDiscord | <hotdog> Didn't realise |
16:38:33 | disruptek | if you're satisfied with nimble, keep using it. |
16:38:44 | disruptek | if you're not, there are half a dozen other package managers to choose from. |
16:38:48 | FromDiscord | <hotdog> Amount of issues isn' |
16:38:54 | FromDiscord | <hotdog> t always the best way to judge |
16:39:03 | FromDiscord | <hotdog> If there is a very different amount of users |
16:39:30 | disruptek | i'd hoped you'd dig deeper in the issues than merely counting them. |
16:39:43 | FromDiscord | <hotdog> Oh |
16:39:59 | FromDiscord | <hotdog> You expect me to read 100+ issues to judge the state of both projects? |
16:40:02 | * | waleee-cl joined #nim |
16:40:13 | disruptek | you expect me to give an unbiased opinion? |
16:40:24 | FromDiscord | <hotdog> I was just asking peoples opinions of nimph as I hadn't used it |
16:40:33 | disruptek | my opinion is that it works well. |
16:40:33 | FromDiscord | <hotdog> Not necessarily yours bud |
16:41:17 | FromDiscord | <hotdog> Cool |
16:41:41 | disruptek | it needs a --rage option that, like, blows away anything that isn't represented in the environment correctly. |
16:41:54 | FromDiscord | <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:57 | disruptek | something that basically flushes your deps but is cheaper than `rm -rf deps` or whatever. |
16:42:50 | disruptek | the 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:27 | disruptek | it has working dependency analysis, which is kinda useful for a package manager. |
16:43:42 | disruptek | i mean, when you shop for a car, you shop for a vehicle that can get you from here to there. |
16:43:54 | disruptek | if it can't do that, it doesn't matter how loud the radio gets. |
16:44:24 | * | evbo joined #nim |
16:46:49 | FromDiscord | <hotdog> Uh ok |
16:46:54 | FromDiscord | <hotdog> I'll take a look |
16:47:55 | FromDiscord | <hotdog> Any idea what proportion of the Nim community are using it over nimble? |
16:48:31 | disruptek | very few people use nimph, afaik. |
16:49:03 | disruptek | it's kinda like nim that way. very few programmers actually have good taste. |
16:50:28 | Zevv | I do, I do |
16:50:46 | disruptek | Zevv: you're special. |
16:50:59 | Zevv | thank you |
16:51:15 | disruptek | zevv doesn't use nimph, either. 😁 |
16:51:40 | Zevv | I just don't do dependencies |
16:51:54 | disruptek | that's a solution. |
16:54:12 | FromDiscord | <hotdog> Fair enough |
16:55:40 | disruptek | honestly, 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:13 | disruptek | most of the serious nim programmers use make to manage their environment. |
16:56:42 | disruptek | the others are compiler developers. 😉 |
16:57:10 | krux02 | @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:29 | krux02 | using nimble just adds complexity to the task, it doesn't reduce complexity. |
16:57:52 | disruptek | krux02: long time no see; how are you doing? |
16:58:04 | krux02 | I am fine. |
16:58:09 | krux02 | thanks for the question. |
16:58:19 | krux02 | I had a long break from everything. |
16:58:27 | disruptek | were you sick? |
16:58:36 | FromDiscord | <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:54 | disruptek | hotdog: treasure your youth. |
16:58:54 | krux02 | No work no Nim, just doing nothing. Now I am back and finishing all my unfinished business. |
16:59:05 | FromDiscord | <exelotl> for my project I'm just using nimscript for build tasks & submodules for deps |
16:59:06 | disruptek | hah, nice. |
16:59:18 | Zevv | it's almost like disruptek, except for the "no nim" part |
16:59:31 | Zevv | pada *dumm* |
16:59:39 | krux02 | exelotl: that is almost what I do as well. Just no nimscript either. |
16:59:55 | disruptek | submodules 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:02 | krux02 | just submodules with all dependencies. |
17:00:23 | krux02 | at least submodules do their job. |
17:00:26 | disruptek | subtext: araq is afraid of them because he doesn't have experience with them. |
17:01:02 | krux02 | I don't like working with submodules either, but I prefer working with submodules over expecting nimble to work. |
17:01:34 | disruptek | they work really well with nimph; much faster than running nimscript. |
17:04:18 | disruptek | Zevv: i'm just gonna play video games until i get my mojo back. |
17:04:33 | krux02 | what is mojo? |
17:05:06 | disruptek | whatever you don't have when you're burnt out. |
17:05:07 | * | wasted_youth joined #nim |
17:05:41 | krux02 | yea I know exactly what you mean. |
17:05:56 | krux02 | When you are really burned out, you don't even enjoy video games anymore. |
17:06:27 | disruptek | i try not to let it get to that point. 😁 |
17:06:48 | krux02 | yea, that is a good plan. |
17:07:14 | krux02 | my recommendation is, play games with other people, not alone. |
17:07:16 | disruptek | i went like six weeks without a break and it's just too much. |
17:07:28 | krux02 | Too many games are just single player in my opinion. |
17:08:06 | disruptek | eh i need to game at my own pace. |
17:08:06 | krux02 | Here are some great coop games: Stardew Valley, Overcooked, Streets of Rage 4, Streets of Rogue, Unrailed |
17:08:40 | disruptek | to those i'd add monaco and trine. |
17:08:48 | krux02 | yea competetive multiplayer is not for everybody. I generally like RTS games, but competetive RTS? Exciting but exhausting. |
17:09:10 | disruptek | and maybe magicka. |
17:09:18 | krux02 | I played trine. I loved tha graphics and atmosphere. The gameplay was a bit too lightweight for me. |
17:09:25 | disruptek | agreed. |
17:09:28 | krux02 | yea magicka is great. |
17:09:42 | disruptek | trine is a good coop game to play with lightweight gamers. |
17:09:58 | krux02 | I liked "Lost Vikings" the game from Blizard that was before they were popular with Warcraft. |
17:10:12 | krux02 | that is like Trine, but with Vikings and coop and really interesting puzzles. |
17:10:18 | krux02 | but very old |
17:10:59 | disruptek | i'm thinking about writing a MUD again. |
17:11:06 | krux02 | and if you like Magicka, I recommend from the same developres, Helldivers: Coopmadness in a Starship Troopers/Warhammer 40k Universe |
17:11:52 | krux02 | I 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:52 | disruptek | i find magicka too fiddly, but i haven't given it a proper attempt. |
17:12:10 | krux02 | it is meant to be played with keyboard |
17:12:13 | krux02 | not gamepad |
17:12:29 | disruptek | ahh. |
17:12:31 | krux02 | and Helldivers is for gamepad |
17:13:15 | krux02 | magicka is great online coop, but not on the same computer where someone has to use the gamepad. It just doesn't work. |
17:13:29 | krux02 | and Helldivers is made for single screen. |
17:13:42 | krux02 | even online all players share the same screen |
17:14:10 | krux02 | I have the feeling we captured the entire chat to be about games :P |
17:14:30 | disruptek | no one else wants to contribute. |
17:14:34 | disruptek | it's because they are boring. |
17:15:03 | krux02 | yea, or they think we are boring, talking about games instead of Nim :P |
17:15:24 | disruptek | i am periodically impl'ing path of exile mechanics in nim. |
17:15:45 | disruptek | so i figure i will eventually have a pretty complete combat simulator. |
17:15:50 | disruptek | maybe base the mud upon that. |
17:16:04 | disruptek | it will have to be much slower, of course. |
17:16:30 | krux02 | I am always thinking about making good games in general. Game ideas that are not fully explored yet. |
17:17:05 | disruptek | gotta get zachary carter to impl my coop game idea: |
17:17:20 | krux02 | I 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:24 | disruptek | you are a ball and you can push other balls operated by your friends. |
17:17:49 | krux02 | It is about the simplicity and the fact that they are turn based and therefore not as stressful as RTS games. |
17:18:24 | krux02 | disruptek, that game already exists since 1984, it is called marble madness. |
17:18:43 | disruptek | it's not the same. |
17:19:04 | disruptek | this would be more cooperative obstacle-course gameplay. |
17:19:38 | disruptek | possibly with teams of like 6-8 players; figure 10-20 teams playing at once. |
17:19:46 | krux02 | Marble Madness is competetive obstacle course gameplay |
17:20:39 | krux02 | I am thinking about making an RTS that is not about who has the most clicks per minute. |
17:22:59 | disruptek | that's crazy talk. |
17:23:26 | krux02 | I think it is pretty easy to implement. |
17:23:48 | krux02 | Just limit the amout of commands a player can give per minute. |
17:24:30 | krux02 | the question is, to make the game still be fun with this limitation. |
17:24:57 | krux02 | Often players are very ignorant and when they can't give as many instructions as they want, they complain about it. |
17:25:20 | krux02 | so it needs to be reasonable in the game world. |
17:26:31 | krux02 | Something 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:43 | krux02 | This will prevent that the game is about micromanaging all units. |
17:26:58 | krux02 | which is something I never liked to do in Strategy games. |
17:27:32 | disruptek | i like the idea that communication has some agency and physicality to it. |
17:27:54 | disruptek | i had something similar in my mud, whereby messages could be delivered between units. |
17:29:08 | disruptek | literal couriers could be intercepted, betraying the messages and preventing maneuvers. |
17:29:21 | krux02 | yea I like the idea |
17:29:32 | krux02 | shoot down the birds :P |
17:29:39 | disruptek | yeah. |
17:30:03 | disruptek | the problem i never solved well was time compression. |
17:30:10 | krux02 | I also had the idea to make the RTS in VR, but the player is sitting in the throne room all the time. |
17:30:27 | krux02 | and there is a migical table that shows the kingdom. |
17:30:48 | saem | I'm all about slow place coop games |
17:30:55 | saem | I don't want to work when gaming |
17:31:25 | krux02 | And when there are intruders in your castle you can litterally hear them come closer and eventually they will murder you. |
17:31:40 | saem | I need to blow off steam with people, the social part is key. |
17:31:56 | krux02 | yea I totally agree on that one. |
17:31:58 | disruptek | what do you play that is social and slow? |
17:32:07 | FromDiscord | <ngigsn> `Person = ref object of Model↵ name {.size: 100.}: string` |
17:32:25 | FromDiscord | <ngigsn> (edit) "name" => "name" |
17:32:42 | saem | Hahaha, 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:53 | krux02 | disruptek: Stardew Valley |
17:32:56 | saem | Dwarves: deep rock galactic |
17:33:08 | krux02 | Minecraft |
17:33:10 | saem | Don't starve |
17:33:19 | saem | (lower difficulty) |
17:33:30 | disruptek | eh crafting and farming? |
17:33:46 | saem | Inquisitor 40k, if it wasn't a big piece of crap |
17:33:49 | FromDiscord | <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:13 | saem | I want inquisitor to work so bad, but ugh |
17:34:25 | saem | Grimdawn was a lot of fun |
17:34:33 | krux02 | saem: play Helldivers maybe you will like it :P |
17:34:38 | saem | Saint Row 4 |
17:35:02 | saem | krux02: haha, you mean starship troopers ;) |
17:35:11 | saem | Yeah, I've played it a bit |
17:35:34 | saem | For the king is okay, but need to tweak the scaling |
17:35:54 | saem | Risk of Rain and Vagante for rogues |
17:36:42 | saem | I used to play a lot of borderlands 2, but the company pissed me off. |
17:37:39 | saem | Oh, I forgot about Warframe, played a _lot_of that. |
17:38:08 | disruptek | vagante looks kinda interesting. |
17:39:02 | saem | krux02: 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:37 | saem | disruptek: I'm on steam on Linux and PS4 |
17:39:55 | krux02 | saem, So what did you read from me? |
17:39:57 | saem | Oh, divinity original sin, that was alright |
17:40:29 | krux02 | Linux, PS4 and Switch it is here |
17:40:42 | krux02 | but PS4 is pretty much unused since we have the Switch here. |
17:40:55 | saem | krux02: gdb Python script, trying to remember some sem related changes (little fuzzy there). |
17:41:41 | saem | krux02: I haven't turned mine on in ages, my partner played witcher 3 for like 200 hours that was fun to watch |
17:42:18 | saem | But yeah, that's it. It's been off for months unless it gets accidentally turned on |
17:43:23 | disruptek | i didn't finish witcher 3; got sidetracked and suffered from levelitis. |
17:43:47 | * | lf_ joined #nim |
17:43:52 | saem | krux02: 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:18 | saem | disruptek: I think that means you're playing it right. |
17:44:36 | saem | According to the girlfriend reviews episode. |
17:44:48 | disruptek | the wut |
17:45:00 | saem | Let me grab you the link |
17:45:16 | disruptek | i'm not about to get rickrolled two days in a row. |
17:45:32 | saem | Why not? |
17:45:35 | saem | https://youtu.be/8T_ztm42YoE |
17:52:12 | disruptek | funny. |
17:53:39 | saem | Besides, I've evolved to Rick Grohling: https://youtu.be/APmoU74ZsG4 |
17:53:58 | * | abm joined #nim |
17:55:19 | FromDiscord | <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:54 | FromDiscord | <ElegantBeef> `cast[ptr Foo](yourPtr)[]` |
17:56:34 | FromDiscord | <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:23 | krux02 | saem: 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:56 | krux02 | sorry I was afk for a moment, had to participate in the birthday celebration of my girlfriend |
17:58:09 | krux02 | she made a nice cake |
17:59:36 | krux02 | btw, 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:00 | krux02 | Currently we play unrailed, we didn't decide yet if it is a good game though. |
18:02:06 | * | cyraxjoe joined #nim |
18:04:45 | ForumUpdaterBot | New thread by Freeflow: A VBA library?, see https://forum.nim-lang.org/t/7423 |
18:05:15 | FromDiscord | <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:44 | FromDiscord | <VVX7> and then cast that ptr Foo to Foo... |
18:06:14 | FromDiscord | <ElegantBeef> well if you're just wanting to get the value at a pointer just do `yourPtr[]` |
18:10:26 | saem | krux02: 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:09 | krux02 | there is a test for the python pretty printer |
18:11:20 | saem | yup, I added a bunch of those. |
18:11:36 | krux02 | ok, can you give me a link? |
18:11:47 | saem | expanded the test cases a fair bit, got some more edge cases. |
18:12:40 | saem | krux02: here was the last PR I made: https://github.com/nim-lang/Nim/commit/84a7544988ffd8d26ff50c8a9417acbededf03fb#diff-3896713add36a758a42fab869d9bc51da482dee9b9b395f30686f10f6fce2260 |
18:12:48 | saem | last/only |
18:12:56 | * | natrys joined #nim |
18:13:10 | saem | A bit frustrated at the time, but the results are better |
18:13:28 | saem | sorry, that's the commit, PR is linked therein |
18:18:10 | saem | There 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:47 | ForumUpdaterBot | New thread by B3liever: How to toggle a class name in Karax, see https://forum.nim-lang.org/t/7424 |
18:29:45 | krux02 | saem: yea there are a lot of things that can be done in terms of better debugging. |
18:29:57 | krux02 | The problem I faced was mostly Araq. |
18:30:28 | krux02 | I 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:34 | saem | Yeah, 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:11 | disruptek | the community is already starving. |
18:32:17 | saem | I know |
18:32:22 | FromDiscord | <VVX7> thanks, I must be doing something else wrong. will open a post on the nim forums. |
18:32:23 | disruptek | for every new person that arrives, another leaves. |
18:36:58 | saem | I 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:14 | saem | oh 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:08 | saem | disruptek: you might be interested in it as well, but AFAICS, it's more about dancing around the compiler presently. |
18:48:22 | disruptek | we 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:55 | disruptek | i guess if i don't write it, it's unlikely someone else will. |
18:53:16 | saem | That 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:07 | disruptek | yes, this is basically what csp is. |
18:54:45 | Zevv | meh, it's just moving the stack to the heap |
18:54:59 | disruptek | csp, sunshine, not cps. |
18:55:26 | Zevv | ooh 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:35 | disruptek | lol |
18:55:38 | saem | I flip that around all the time |
18:55:54 | Zevv | yeah i know, just pulling legs here |
18:56:00 | disruptek | cps is just mechanical. csp is where things get interesting. |
18:56:10 | Zevv | when I started cps I made a typo in the repo name and called it csp. that was helpful |
18:56:48 | disruptek | yeah, i took the link out recently because i decided it was too confusing. |
18:57:51 | Zevv | yeah i'll kill the repo |
18:57:55 | Zevv | my task is done here |
18:58:52 | Zevv | "I understand the consequences, delete this repository" |
18:59:08 | Zevv | my time is better spent seeing how Ripley solves it this time |
18:59:50 | saem | I'll probably use them interchangeably because the distinction in broader PL spaces is all muddy so yeah |
19:00:18 | saem | Zevv: step one, make up a mystery you already know the answer to |
19:02:33 | Zevv | that's how it is done |
19:04:53 | ForumUpdaterBot | New thread by VVX7: FFI - how to use procs that return objects, see https://forum.nim-lang.org/t/7425 |
19:05:10 | FromDiscord | <VVX7> just added the question to the forum https://forum.nim-lang.org/t/7425#47057 |
19:06:13 | FromDiscord | <ElegantBeef> Your `returnFoo` doesnt return a pointer though |
19:12:18 | FromDiscord | <VVX7> sent a code paste, see https://play.nim-lang.org/#ix=2Ndo |
19:12:29 | FromDiscord | <VVX7> this gives me the same storage access error |
19:13:04 | FromDiscord | <ElegantBeef> You arent getting a function |
19:14:05 | FromDiscord | <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:28 | zidsal | Hi guys, the parseJson proc in the standard library is defined as a proc. What about this function causes side effects? |
19:34:19 | leorize[m] | it doesn't |
19:35:00 | leorize[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:01 | zidsal | ok 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:15 | FromDiscord | <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:39 | leorize[m] | eh, doing that defeats the purpose of func, so better just call parseJson outside of the func |
20:11:03 | Zevv | shouldn't we just fix parsejson |
20:11:54 | FromDiscord | <carpal> sorry |
20:11:58 | FromDiscord | <carpal> a thing |
20:13:28 | * | def- quit (Quit: -) |
20:13:45 | FromDiscord | <carpal> I'm trying to publish a package in nimble |
20:13:49 | * | def- joined #nim |
20:26:14 | Zevv | so, how does that work out for you |
20:28:02 | FromDiscord | <carpal> so now I have to wait? https://media.discordapp.net/attachments/371759389889003532/802998163962593290/unknown.png |
20:29:30 | Zevv | even longer, someone has to accept and merge your MR |
20:30:07 | FromDiscord | <carpal> ok, but on my repo there are only useless files |
20:30:18 | FromDiscord | <carpal> that nimble forked for me |
20:30:54 | Zevv | but https://github.com/Carpall/nobject 404's for me |
20:31:10 | FromDiscord | <carpal> https://github.com/Carpall/packages |
20:31:19 | FromDiscord | <carpal> (edit) "https://github.com/Carpall/packages" => "<https://github.com/Carpall/packages>" |
20:31:36 | Zevv | sure, but the nimble you are trying to register points to https://github.com/Carpall/nobject, right? |
20:32:27 | FromDiscord | <carpal> ok so I have to create a repo at carpall/nobject? |
20:32:40 | Zevv | ok, a few steps back |
20:33:04 | FromDiscord | <carpal> should it contains specific files? |
20:33:40 | Zevv | well, your nimble package |
20:33:57 | Zevv | so your project's nimble file and source files |
20:34:10 | FromDiscord | <carpal> just this? https://media.discordapp.net/attachments/371759389889003532/802999704220598302/unknown.png |
20:34:24 | Zevv | indeed |
20:34:26 | Zevv | that's your package |
20:34:39 | Zevv | putting it in nim packages is only a reference to your publish URL |
20:34:47 | Zevv | typically github, but can be anywhere, actually |
20:34:58 | FromDiscord | <carpal> ok now I'm going to create carpall/nobject |
20:35:31 | Zevv | right. Interesting to see that nimble let you publish it when it's not actually available on the configured url |
20:36:36 | FromDiscord | <carpal> ah okay |
20:36:44 | * | natrys quit (Quit: natrys) |
20:36:50 | FromDiscord | <carpal> so I could create the repo also from 1 year lol? |
20:38:57 | FromDiscord | <carpal> done |
20:41:12 | Zevv | ok, you should be good now. Now waiting until one of the admin approves and merges your MR |
20:41:29 | Zevv | In the mean time, people can also use your package using "nimble install https://github.com/Carpall/nobject" |
20:42:09 | FromDiscord | <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:10 | disbot | ➥ Add package nobject |
20:42:24 | FromDiscord | <carpal> (edit) "from↵https://github.com/nim-lang/packages/pull/1793/," => "from↵<https://github.com/nim-lang/packages/pull/1793/>," |
20:42:25 | disbot | ➥ Add package nobject |
20:42:57 | Zevv | technically, 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:29 | FromDiscord | <carpal> but `https://github.com/Carpall` is mandatory or I can write only `nimble install nobject`? |
20:43:46 | Zevv | when you are merged, it's the latter |
20:44:04 | FromDiscord | <carpal> ok thanks |
20:44:09 | FromDiscord | <carpal> I'll wait |
20:49:08 | FromDiscord | <konsumlamm> you realize that you just uploaded a dummy project? |
20:50:53 | Zevv | ha |
20:52:25 | FromDiscord | <carpal> what do you mean? |
20:53:40 | FromDiscord | <konsumlamm> https://github.com/Carpall/nobject/blob/main/src/nobject.nim |
20:54:03 | FromDiscord | <konsumlamm> this is the generated dummy project |
20:54:12 | FromDiscord | <Avatarfighter> yo yo everyone what's good |
20:54:42 | FromDiscord | <carpal> oh no fuck |
20:55:26 | FromDiscord | <carpal> nooooo |
20:55:31 | FromDiscord | <carpal> I deleted the local file |
20:55:34 | FromDiscord | <carpal> porco dio |
20:55:59 | FromDiscord | <carpal> I have to rewrite alll |
20:56:02 | FromDiscord | <carpal> (edit) "alll" => "all" |
20:58:49 | FromDiscord | <konsumlamm> also, isn't the equivalent of .NETs Object in Nim RootObj? |
20:59:53 | FromDiscord | <carpal> inspired |
21:03:48 | FromDiscord | <carpal> do you talk about nobject? |
21:08:16 | FromDiscord | <konsumlamm> ye |
21:10:20 | FromDiscord | <carpal> no, it is not the equivalent of the .net object |
21:10:30 | FromDiscord | <carpal> .net object is a managed type, it runs on a jit |
21:10:48 | FromDiscord | <carpal> it works so good for that |
21:11:00 | FromDiscord | <carpal> but I tried to simulate it |
21:11:59 | FromDiscord | <carpal> but I accidentally deleted the repo thinking I pushed the files on github, but I pushed the dummy project only |
21:12:04 | FromDiscord | <carpal> 😢 |
21:15:07 | FromDiscord | <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:10 | FromDiscord | <konsumlamm> what exactly do you want to use nobject for? |
21:21:12 | FromDiscord | <carpal> my vm |
21:21:32 | FromDiscord | <carpal> I need a safe object allocable on the stack |
21:21:45 | FromDiscord | <konsumlamm> a VM for a dynamically typed language? |
21:21:48 | FromDiscord | <carpal> I'm trying to allocate all the vm on the stack |
21:21:55 | FromDiscord | <carpal> yea |
21:22:18 | FromDiscord | <carpal> not a language, but only a vm |
21:24:39 | FromDiscord | <konsumlamm> whats the point of a VM without a language for it? |
21:24:49 | FromDiscord | <carpal> learning lol |
21:24:58 | FromDiscord | <konsumlamm> like, it has to have some language, no? even if it's some bytecode thing |
21:25:06 | FromDiscord | <konsumlamm> how else do you want to program it? |
21:25:08 | FromDiscord | <carpal> learning and havinh fun |
21:26:06 | * | zidsal87 joined #nim |
21:26:15 | FromDiscord | <carpal> but idk |
21:26:56 | FromDiscord | <carpal> I was writing a language |
21:27:09 | FromDiscord | <carpal> I already wrote the parser |
21:27:40 | FromDiscord | <carpal> it works very well, it is my first serious parser |
21:28:45 | * | zidsal quit (Ping timeout: 240 seconds) |
21:51:39 | FromDiscord | <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:05 | FromDiscord | <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:27 | FromDiscord | <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:34 | FromDiscord | <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:44 | FromDiscord | <carpal> or... I tried to implement it |
22:17:13 | FromDiscord | <carpal> but compiler says that only an Ordinal type can be passed as typedesc |
22:19:26 | FromDiscord | <ElegantBeef> Uncertain what you want but this apparently works https://play.nim-lang.org/#ix=2Nel |
22:21:53 | FromDiscord | <carpal> yes I was implementing it in this way https://media.discordapp.net/attachments/371759389889003532/803026816143065088/unknown.png |
22:22:54 | FromDiscord | <konsumlamm> what's the code that gives you an error and what's the error message? |
22:23:32 | FromDiscord | <ElegantBeef> There is no reason to pass a var there btw |
22:24:05 | FromDiscord | <ElegantBeef> Also you may want to use an object variant instead of this typedesc if this is for a VM |
22:27:27 | FromDiscord | <carpal> it was in the old module (I deleted opsss, so I'm rewriting it) |
22:27:44 | FromDiscord | <carpal> right |
22:28:09 | FromDiscord | <carpal> .. but I'm using a variant object |
22:28:14 | * | abm quit (Quit: Leaving) |
22:28:25 | FromDiscord | <ElegantBeef> I dont get why you're using typdesc's then |
22:28:54 | FromDiscord | <ElegantBeef> This is for dynamic typing isnt it? |
22:29:13 | FromDiscord | <carpal> for this https://media.discordapp.net/attachments/371759389889003532/803028661040054342/unknown.png |
22:37:51 | FromDiscord | <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:23 | FromDiscord | <ache of head> lmao |
22:49:27 | FromDiscord | <ache of head> oh darn |
22:49:39 | FromDiscord | <ache of head> i was supposed to stop writing that in chat |
22:49:43 | FromDiscord | <ache of head> i'm sorry |
22:53:16 | * | tane quit (Quit: Leaving) |
22:58:51 | FromDiscord | <carpal> ops ahha |
23:03:26 | * | abm joined #nim |
23:05:44 | FromDiscord | <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:57 | FromDiscord | <carpal> this is the definition https://media.discordapp.net/attachments/371759389889003532/803037903243968522/unknown.png |
23:06:10 | FromDiscord | <carpal> ok.... lol |
23:06:42 | FromDiscord | <carpal> I must use `int` instead of `int32` |
23:06:43 | FromDiscord | <carpal> why? |
23:06:54 | FromDiscord | <carpal> isn't `int` an alias for `int32`? |
23:08:06 | FromDiscord | <ElegantBeef> int is system dependant |
23:08:19 | FromDiscord | <ElegantBeef> If it's on a 32bit system it's an int32, 64 bit, int64 |
23:18:55 | FromDiscord | <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:28 | FromDiscord | <konsumlamm> honestly, i'd just make a `toObject` proc instead of defining converters |
23:40:24 | FromDiscord | <carpal> why? imho those are an amazing festure! |
23:45:41 | FromDiscord | <konsumlamm> it often makes things more confusing and it gets easier to introduce bugs |
23:47:30 | disruptek | i've met some amazing bugs here. |
23:47:36 | FromDiscord | <carpal> lol |
23:47:47 | FromDiscord | <carpal> I hope not with conveters 😂 |