<< 03-04-2022 >>

00:00:01FromDiscord<Elegantbeef> You'd probably use collect i guess
00:00:04FromDiscord<Tuatarian> need a sequence of all the files in the folder to use later
00:00:27FromDiscord<Tuatarian> I completely forgot collect() exists
00:00:28FromDiscord<Tuatarian> thanks!
00:01:03FromDiscord<Elegantbeef> No problem
00:01:22FromDiscord<Elegantbeef> Do you have an example of what you're wanting behaviour wise?↵(@salt)
00:01:26*lumo_e quit (Quit: Quit)
00:03:30FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3U8G
00:03:58FromDiscord<salt> (edit) "https://play.nim-lang.org/#ix=3U8G" => "https://play.nim-lang.org/#ix=3U8H"
00:04:33FromDiscord<salt> buttonbehavior would probably have it's own procs as well --- with multiple inheritance i can just add these to a vtable
00:04:44FromDiscord<Elegantbeef> Yea makes sense
00:05:06FromDiscord<Elegantbeef> Could get close using concepts and generically constrained procedures
00:05:54FromDiscord<salt> the inheritance tree is not that complicated, usually just a chain and no diamonds, but still need multiple inheritance i feel
00:06:15FromDiscord<Elegantbeef> Well eitherway prestige will be happy to see you working on this
00:06:32FromDiscord<Elegantbeef> I think you might be able to use generics to solve things like button but i could be wrong
00:06:38nrds<Prestige99> :)
00:07:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U8I
00:07:34FromDiscord<salt> i was looking into this, but i didn't know how to overwrite another method with it
00:07:51FromDiscord<salt> need some version of super().on_click
00:08:09FromDiscord<salt> ideally, for better widgets
00:08:24FromDiscord<Elegantbeef> use the macro to propogate up to the parent and call it's `onClick`
00:08:46FromDiscord<Elegantbeef> Like i said i could very well be wrong
00:09:18FromDiscord<Elegantbeef> If this can be reasoned statically I dont think i am, but you know better than I
00:09:37FromDiscord<salt> no idea, i'm like 2 weeks into nim
00:10:04FromDiscord<Elegantbeef> I mean Niim does have `procCall` which forces static dispatch
00:10:38FromDiscord<Elegantbeef> https://nimdocs.com/beef331/oopsie/oopsie.html#super.m%2CInherits and you can relatively easily write a `super` macro
00:10:58nrds<Prestige99> Beef, it seems createTarball with zippy will not include symlinks. You have any experience with this?
00:11:31FromDiscord<Elegantbeef> Guzba is probably a better person to ask
00:11:45FromDiscord<salt> the two oop libraries i looked at in nim didn't have multiple inheritance, but once you have an mro, `super` should be simple to look up
00:11:48nrds<Prestige99> not sure if I've ever seen him talk around here
00:11:59FromDiscord<Elegantbeef> He does
00:12:08FromDiscord<Elegantbeef> Might take a bit to get back to you but he's on discord
00:12:31nrds<Prestige99> ah yeah I see the issue
00:12:34FromDiscord<Elegantbeef> Can also make an issue
00:12:39nrds<Prestige99> maybe I'll just make a pr
00:12:51FromDiscord<Elegantbeef> Have fun
00:13:20FromDiscord<Elegantbeef> Yea salt my point was mainly i dont see if there is really any need for MI if you're just using it like rust traiits
00:14:18FromDiscord<Elegantbeef> I'm a simpleton so I could misunderstand what you're trying
00:16:21FromDiscord<salt> sent a code paste, see https://play.nim-lang.org/#ix=3U8J
00:17:05FromDiscord<Elegantbeef> I'm half asking if that can be encoded in type instead of forced upon the type i gues
00:17:39FromDiscord<Elegantbeef> Like what's a themeable widget if not a widget with a `theme: Theme` field
00:18:27FromDiscord<salt> and a `proc update_theme`
00:18:50FromDiscord<Elegantbeef> And what's a toggableButtong if not a type that implements `onClick`, `hover`, and a field `toggled: bool`
00:19:34FromDiscord<salt> yeah, most of these don't intersect, but some methods do -- a few methods need to be composable, like `on_click` and maybe a `render`
00:19:51FromDiscord<Elegantbeef> Perhaps use pointer procs for those then?
00:20:03FromDiscord<Elegantbeef> Or methods specifically for those types
00:22:33FromDiscord<Elegantbeef> I guess there is still the issue of downcasting to the proper type nicely, which nim doesnt provide aside from methods
00:22:38FromDiscord<Elegantbeef> So i suppose carry on and i'll shush
00:23:01FromDiscord<salt> maybe, the only other solution i imagined involved dumping a lot of behavior flags into the, say, `Widget` type, and dispatching based on those, but it seemed more complicated than just implementing multiple inheritance
00:24:00FromDiscord<salt> i feel like the macro system allows relatively easy implementation of this, i'm just unfamiliar so it's taking a fair amount of effort
00:24:40FromDiscord<Elegantbeef> Yea the macro system is lovely
00:25:21FromDiscord<salt> the syntax of nim is super enjoyable though
00:25:29FromDiscord<salt> easy sell
00:26:01FromDiscord<Elegantbeef> BuT iT hAs sIgNiFiCanT WhiteSpAcE 😛
00:26:13FromDiscord<salt> it's a feature
00:26:39FromDiscord<Elegantbeef> Eh i'm joking but it's a common complaint
00:27:01FromDiscord<salt> i'm coming from python, so i hear it there sometimes as well
00:27:06FromDiscord<Elegantbeef> My favourite is "my code should be able to be written on a single line" like that's' a feature
00:27:36FromDiscord<salt> sent a code paste, see https://paste.rs/fyH
00:27:50FromDiscord<Elegantbeef> `{}` is atleast better than begin end\`
00:27:56FromDiscord<salt> this is true
00:28:17FromDiscord<Elegantbeef> Rainbow indents and indention lines are the best answer imo
00:29:32FromDiscord<salt> i actually don't use either, my eye feels pretty comfortable judging scope even with 2 space indents
00:29:53FromDiscord<salt> i've spent years with pep 8 python 4 space indents though
00:30:25FromDiscord<Elegantbeef> Yea with monospace it's pretty easy to see indent
00:30:51FromDiscord<Elegantbeef> Trying to see spaces in element is PITA when it's not rendered as code
00:34:45*hellstabber quit (Quit: Textual IRC Client: www.textualapp.com)
00:37:55*pch quit (Quit: Leaving)
01:18:31*neurocyte86141 joined #nim
01:20:55*neurocyte8614 quit (Ping timeout: 260 seconds)
01:20:55*neurocyte86141 is now known as neurocyte8614
01:52:06FromDiscord<ajusa> man I just spent an hour trying to read an email from gmail, no dice. turns out gmail/other mail providers extend imap with oauth2 for login now
02:25:44FromDiscord<Patitotective> In reply to @Elegantbeef "`{}` is atleast better": `igBegin` `igEnd` 🥲 lol
02:26:12FromDiscord<Elegantbeef> QED
02:26:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U8Z
02:27:47FromDiscord<Patitotective> sent a code paste, see https://paste.rs/Qy6
02:27:49FromDiscord<Elegantbeef> Yes
02:28:13FromDiscord<Patitotective> i think you are underestimated
02:28:58*noeontheend joined #nim
02:29:02FromDiscord<Elegantbeef> What?
02:31:38FromDiscord<demotomohiro> What if there is break or return inside body?
02:32:04FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3U90
02:32:18FromDiscord<Elegantbeef> Make a modle called `utils.nim`
02:32:28FromDiscord<Elegantbeef> Fine demo you win
02:33:22FromDiscord<Patitotective> In reply to @Elegantbeef "Make a modle": do you mean? create it apart from `commons.nim` or rename `commons.nim` to `utils.nim`?
02:33:33FromDiscord<demotomohiro> Making an obect that calls `igEnd` in destractor mighit better. Or call `igEnd` in defer.
02:35:21FromDiscord<Elegantbeef> I dont name things as useless as `commons.nim`↵(@Patitotective)
02:35:33FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3U91
02:35:39FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3U91" => "https://paste.rs/YNJ"
02:36:10FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Ewz
02:36:11FromDiscord<Elegantbeef> Whichever you prefer
02:36:27FromDiscord<Elegantbeef> Flow control still can fuck this up though
02:36:45FromDiscord<Patitotective> hmm, let me test it
02:37:33FromDiscord<Elegantbeef> Guess i'm wrong about the flow control
02:37:57FromDiscord<Elegantbeef> you also might want to use `typed` instead
02:38:23FromDiscord<Patitotective> what is the difference? 🤨
02:38:34FromDiscord<Elegantbeef> Between `typed` and `untyped`?
02:38:56FromDiscord<Patitotective> yea lol
02:39:19FromDiscord<Elegantbeef> typed is semantically checked which means that errors will appear before the template is exapanded and will make more sense
02:40:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U92
02:41:16FromDiscord<Patitotective> and why should i use it? i looks more complex lol
02:41:34FromDiscord<Elegantbeef> It's virtually the same as the others
02:41:41FromDiscord<Elegantbeef> I was just giving it as a concrete example
02:43:31FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3U93
02:43:59FromDiscord<Elegantbeef> No you have to pass them
02:44:06FromDiscord<Patitotective> :C
02:44:11FromDiscord<Patitotective> its not that fun now lmao
02:44:34FromDiscord<Elegantbeef> You can always have defaults that are used and an `igWindow` that doesnt take any
02:45:24FromDiscord<Patitotective> wdym? like `template igWindow(name: cstring = ""; p_open: ptr bool = nil; flags: ImGuiWindowFlags = 0.ImGuiWindowFlags; body: typed) = `
02:45:25FromDiscord<Patitotective> (edit) "`" => "`?"
02:45:38FromDiscord<Elegantbeef> Yes that should work
02:49:36FromDiscord<Patitotective> and is there a way i could do this automatically? like search through all `imgui` procedures, filter the ones that start with `igBegin` and create a template with its args?
02:50:43FromDiscord<Elegantbeef> Nope you could make a macro that does it if you list the names manually though
02:51:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U94
02:52:09FromDiscord<Patitotective> i can't list the procedures from a compiled binary?
02:52:27FromDiscord<Elegantbeef> What?
02:52:42FromDiscord<Patitotective> like python's inspect https://docs.python.org/3/library/inspect.html
02:53:00FromDiscord<Patitotective> get all the procedures in a module
02:53:01FromDiscord<Elegantbeef> Did you ignore the macro thing
02:53:37FromDiscord<Elegantbeef> Nim doesnt have that presently
02:53:50FromDiscord<Patitotective> i mean, it would be too tiring to have to look at the docs and write the names manually for the macro
02:54:15FromDiscord<Patitotective> well, maybe in the future another patito will do this
02:54:36NimEventerNew thread by Thegrapevine: How setBlocking to false on newSocket?, see https://forum.nim-lang.org/t/9071
02:56:04FromDiscord<Elegantbeef> Ideally there'd be a `getSymbols` which you can then iterate all exposed symbols of a given kind
02:57:03*noeontheend quit (Ping timeout: 260 seconds)
03:03:01FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3U95
03:03:47*arkurious quit (Quit: Leaving)
03:05:03FromDiscord<Elegantbeef> you can do `flieExists` or `dirExists` but there is no way to tell if it's a file or path especially on unix
03:05:11FromDiscord<Elegantbeef> since `/home/Downloads/something` can be both
03:05:25FromDiscord<Patitotective> ok
03:21:52nrds<Prestige99> man zippy really needs docs
03:33:04FromDiscord<Elegantbeef> Time to make an issue 😛
03:33:16nrds<Prestige99> Someone did and it's actually really funny
03:33:32nrds<Prestige99> https://github.com/guzba/zippy/issues/13
03:33:43nrds<Prestige99> very meta
03:33:47FromDiscord<Elegantbeef> Lol
03:34:03FromDiscord<Elegantbeef> I have to applaud that joke
03:34:23nrds<Prestige99> Best thing I've seen all day
03:35:50FromDiscord<aph> lmfao
03:40:34FromDiscord<Patitotective> how can i export an png from a svg with nim?
03:40:38FromDiscord<Patitotective> (edit) "an" => "a"
03:40:43FromDiscord<Elegantbeef> `pixie`
03:42:21FromDiscord<Patitotective> treeform does a lot of cool stuff actually
03:43:08FromDiscord<aph> is there a ffmpeg wrapper in nim btw :)
03:43:34FromDiscord<Elegantbeef> https://github.com/momeemt/ffmpeg.nim
03:44:25FromDiscord<aph> oh ye, i forgor i can go to nimble.directory to search lol
03:44:27FromDiscord<aph> thanks anyways
04:04:09FromDiscord<aph> :(
04:04:12FromDiscord<aph> sent a code paste, see https://paste.rs/1R7
04:04:16FromDiscord<Elegantbeef> you're importing system
04:04:21FromDiscord<Elegantbeef> It's automatically imported you dont need to do that
04:04:24FromDiscord<aph> ohh
04:04:27FromDiscord<aph> thanks
04:17:55FromDiscord<Patitotective> is there something like this `format("hey, my name is {}", "beef")`?
04:18:10FromDiscord<Patitotective> so i can have a "string template" and i can just put the variables in
04:19:45FromDiscord<Patitotective> nvm https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D
04:31:56FromDiscord<abdu> How to free as equivalent in C or as doing `delete` in C++ (after a newSeqOfCap)
04:32:17FromDiscord<Elegantbeef> `= @[]`
04:33:34FromDiscord<abdu> that's not at all deallocate memory
04:34:16FromDiscord<Elegantbeef> You said after a newseqofcap
04:34:19FromDiscord<Elegantbeef> I have 0 idea the context so provide code
04:34:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U9g
04:34:48FromDiscord<demotomohiro> `seq`, `string` and `ref` types are freed when exit their scope
04:35:45FromDiscord<abdu> "after a newSeqOfCap"↵we believe it's simple clear
04:35:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U9h
04:36:26FromDiscord<abdu> has no scope here as newSeqOfCap is on topmost / global zone
04:36:52FromDiscord<Elegantbeef> It deallocates the original memory, you cannot deallocate GC'd memory, you can only `GcUnref`, `GcRef`, or `GcFullCollect`
04:37:13FromDiscord<demotomohiro> You can create scope with `block`.
04:37:15FromDiscord<Elegantbeef> The entire point of Gc'd memory is you dont manage it manually
04:37:22FromDiscord<abdu> (edit) "zone" => "zone↵and it's repeated so many by many template invocation"
04:37:53FromDiscord<Elegantbeef> I think araq says you're supposed to do `if true` but that's neither here nor there
04:38:58FromDiscord<abdu> and it's repeated so many by many template invocation ↵that's why ask above how Nim command equivalent C / C++ one available
04:39:23FromDiscord<Elegantbeef> You cannot manually deallocated GC'd memory without hacks
04:40:01FromDiscord<Elegantbeef> The best you can do is provide it a state that is cheap
04:40:20FromDiscord<Elegantbeef> So `a = newSeqOfCap[int](0)` in the above of `a = @[]`
04:40:27FromDiscord<demotomohiro> Why you cannot use `block` or procs to create scoope and need to explicitly deallocate memory?
04:40:44FromDiscord<Elegantbeef> Is that to me?
04:41:05FromDiscord<demotomohiro> it is to @abdu
04:41:13FromDiscord<Elegantbeef> Ah just making sure
04:41:18FromDiscord<abdu> I'll try in Nim Workshop (WS)
04:41:18*slowButPresent quit (Quit: leaving)
04:41:41FromDiscord<abdu> use block: to get around
04:42:28FromDiscord<Elegantbeef> "Nim Workshop"?
04:42:32FromDiscord<demotomohiro> I rarely explicitly dellocate memory of seq. They are freed when get out of scope.
04:42:47FromDiscord<Elegantbeef> Yea i mean that's the point
04:43:03FromDiscord<Elegantbeef> You dont really need to worry about memory more just ensure you dont dumbly allocate
04:47:20FromDiscord<Elegantbeef> I personally know i've done `setLen(0)` more than `= @[]`
04:47:42FromDiscord<demotomohiro> Maybe `a = default(seq[int])` or `a.reset` free heap.
04:48:34FromDiscord<Elegantbeef> It's hard to say without access to the \`capcity
04:48:47FromDiscord<demotomohiro> `setLen(0)` still keep internal heap, isn't it?
04:48:58FromDiscord<Elegantbeef> yes
04:49:04FromDiscord<Elegantbeef> The point is you dont want to reallocate but want to reset the data
04:49:18FromDiscord<demotomohiro> ok
04:50:41FromDiscord<Elegantbeef> `reset ` and `= @[]` turn it into a nil ptr
04:51:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U9m
04:51:18FromDiscord<Elegantbeef> So like i said `= @[]` deallocates
04:51:48FromDiscord<Elegantbeef> If you do want to see the internals of the seq it's just `(len, cap, data...)`
04:54:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U9n
05:16:47FromDiscord<demotomohiro> Internal data layout of `seq` is different in `--mm:arc` or `--mm:orc`.
05:16:49FromDiscord<demotomohiro> https://wandbox.org/permlink/ghvCMvgdY4GeViRq
05:19:57FromDiscord<Elegantbeef> Ah right len has moved to the heap
05:20:01FromDiscord<Elegantbeef> well data
05:34:44*zeus-supreme1 joined #nim
05:38:03*zeus-supreme quit (Ping timeout: 260 seconds)
06:05:03NimEventerNew thread by Thegrapevine: Net: recv/readLine: How receive more one line or not waiting for fill buffer size?, see https://forum.nim-lang.org/t/9072
06:25:52FromDiscord<morgan> is there a stdlib type for a filesystem path? std/uri only has examples for web urls
06:26:35FromDiscord<Elegantbeef> `std/os` has file system handling if you want a typesafe api there is a hidden one somewhere iirc
06:26:54FromDiscord<morgan> basically i want to store a path to a file but not store the file opened
06:27:11FromDiscord<morgan> i can store it as a string but im wondering if there's a path type
06:27:27FromDiscord<Elegantbeef> There is a hidden one but generally it's just `string`
06:27:31FromDiscord<morgan> ok
06:30:32FromDiscord<Elegantbeef> I think apart of Nim2.0 will be to have typesafe paths
06:30:54FromDiscord<morgan> good to know
06:39:45*jjido joined #nim
06:40:07*yoyojambo quit (Ping timeout: 260 seconds)
06:55:49*Gustavo6046 quit (Ping timeout: 240 seconds)
06:58:18FromDiscord<Rika> In reply to @Elegantbeef "There is a hidden": Where is the hidden one
07:01:39FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/pathutils.nim
07:02:48*Gustavo6046 joined #nim
07:04:37*Gustavo6046 quit (Remote host closed the connection)
07:05:04*Gustavo6046 joined #nim
07:07:01*jmdaemon quit (Ping timeout: 240 seconds)
07:09:57*vicecea quit (Remote host closed the connection)
07:10:56*vicecea joined #nim
07:15:56FromDiscord<Rika> Ah of course the compiler api
07:24:11FromDiscord<coldfussion> sent a code paste, see https://paste.rs/Tek
07:24:17FromDiscord<Elegantbeef> It's not
07:24:33FromDiscord<Elegantbeef> What's the issue?
07:24:54FromDiscord<Rika> ?
07:26:01FromDiscord<coldfussion> sent a code paste, see https://play.nim-lang.org/#ix=3U9N
07:26:05FromDiscord<Elegantbeef> Full code
07:27:25FromDiscord<coldfussion> sent a code paste, see https://play.nim-lang.org/#ix=3U9P
07:28:22FromDiscord<Elegantbeef> `nim -v`?
07:28:42FromDiscord<Rika> `f: untyped` conflicts with `var f`
07:28:53FromDiscord<Rika> whatever you put in that first argument
07:28:55FromDiscord<Elegantbeef> no that's name they're giving
07:29:06FromDiscord<Rika> okay, so how is he giving it
07:29:18FromDiscord<coldfussion> sent a code paste, see https://play.nim-lang.org/#ix=3U9S
07:29:39FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/SfP
07:29:50FromDiscord<Rika> thats not what i mean
07:29:53FromDiscord<Rika> how is he passing it
07:29:56FromDiscord<Elegantbeef> Upgrade to 1.6.4 regardless i cant reproduce
07:30:24FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/Fwe
07:30:58FromDiscord<coldfussion> Idk, it's literally the example from the Nim manual
07:31:08FromDiscord<Solitude> it works fine
07:31:09FromDiscord<Elegantbeef> Full code
07:31:33FromDiscord<Solitude> beef, whats your timezone?
07:31:42FromDiscord<Elegantbeef> -7
07:31:51FromDiscord<coldfussion> try raising exception in the block
07:31:52FromDiscord<Rika> can you give:↵full code↵fll error
07:32:19FromDiscord<Solitude> In reply to @coldfussion "try raising exception in": why would that prevent compilation
07:32:27FromDiscord<Solitude> it works with exception too
07:32:44FromDiscord<Rika> it compiles
07:32:51FromDiscord<Elegantbeef> The issue is your code, so if you provide it you'll get an explanation why
07:33:08FromDiscord<Rika> what error are you getting, in full, and code too because we have no lead otherwise
07:35:37FromDiscord<coldfussion> sent a code paste, see https://play.nim-lang.org/#ix=3U9V
07:36:10FromDiscord<coldfussion> so i passed a very long n to readRawString to trigger the exception
07:37:23FromDiscord<Rika> compiles for me
07:37:56FromDiscord<coldfussion> lol now it failed even with small strings
07:37:56FromDiscord<Rika> devel or 1.6.2 works for me, compiles as expected
07:38:07FromDiscord<Rika> can you give the actual error then
07:38:11FromDiscord<Elegantbeef> on the playground i do get an error
07:38:15FromDiscord<Rika> because this is clearly not where the error is
07:38:24FromDiscord<Solitude> `Error: expression 'close(f)' is of type 'string' and has to be used (or discarded); start of expression here: /home/solitude/test.nim(61, 3)` errors for me
07:38:34FromDiscord<Elegantbeef> Ah i found it
07:38:34FromDiscord<Rika> hmmmmm
07:38:37FromDiscord<Solitude> its because your body is expression
07:38:40FromDiscord<Elegantbeef> the issue is that `f.readRawString` returns an string
07:38:42FromDiscord<Solitude> but your finally iosnt
07:38:45FromDiscord<Rika> ah
07:38:52FromDiscord<Rika> ah i was echoing it yeah
07:39:01FromDiscord<Elegantbeef> `discard f.readRawString(4)` and problem solved
07:39:17FromDiscord<Elegantbeef> This is a compiler error though
07:39:17FromDiscord<Solitude> error message is retarded tho
07:39:22FromDiscord<Elegantbeef> So minimize it into a single file and make an issue
07:40:13FromDiscord<Elegantbeef> There you go
07:40:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3U9W
07:40:18FromDiscord<Rika> its not really an issue
07:40:19FromDiscord<Elegantbeef> `/usercode/in.nim(5, 5) Error: expression 'discard' is of type 'int literal(10)' and has to be used (or discarded); start of expression here: /usercode/in.nim(6, 1)`
07:40:28FromDiscord<Elegantbeef> It is
07:40:41FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3U9X
07:41:03FromDiscord<Rika> it doesnt
07:41:11FromDiscord<coldfussion> lol, the error messages of nim are so confusing 0\_0
07:41:17FromDiscord<Elegantbeef> This is a bug
07:41:24FromDiscord<Elegantbeef> This isnt all the error messages to be fair
07:41:31FromDiscord<Rika> its not a bug, its an issue
07:41:58FromDiscord<Rika> its "working as expected", but it was an oversight to a decision the devs made with the language
07:42:02FromDiscord<coldfussion> i get it supposed to point at `f.readRawString(4)` but it points at `f.close()` instead
07:42:09FromDiscord<Rika> this is not a bug, its really an issue
07:42:11FromDiscord<Elegantbeef> How is it not a bug a try finally inside a template incorrectly marks the wrong branch
07:42:35FromDiscord<Rika> oh
07:42:42FromDiscord<Rika> it does? i didnt realise'
07:42:44FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/PoY
07:42:45FromDiscord<Rika> okay
07:42:45FromDiscord<Elegantbeef> `/usercode/in.nim(3, 5) Error: expression '10' is of type 'int literal(10)' and has to be used (or discarded)`
07:43:00FromDiscord<Rika> yeah no its other bug no
07:43:01FromDiscord<Rika> okay
07:43:21FromDiscord<Rika> whatever then okay
07:43:39FromDiscord<Elegantbeef> I thought it was clear with the "discard is of type int literal 10" 😛
07:43:58FromDiscord<Rika> no, you still get that writing without the template
07:44:13FromDiscord<Rika> try it, i did
07:44:29*koltrast_ quit (Ping timeout: 256 seconds)
07:44:41FromDiscord<Elegantbeef> Oh it's not just template
07:44:43FromDiscord<Rika> xd
07:44:44FromDiscord<Rika> lol
07:44:56FromDiscord<Rika> its with try finally expressions i guess
07:45:05FromDiscord<Rika> to be fair those are rare though
07:45:09FromDiscord<Elegantbeef> It's just unhandled value in try finally does `[^1]` instead of figuring out where it is
07:45:27FromDiscord<Rika> should be simple for you then
07:45:58FromDiscord<coldfussion> sent a code paste, see https://play.nim-lang.org/#ix=3U9Y
07:46:09FromDiscord<Elegantbeef> Yea it's just iterate each branch and find the first expression that's a type and not void
07:46:24FromDiscord<Solitude> In reply to @coldfussion "lol, the error messages": you get used to it
07:46:28FromDiscord<Elegantbeef> Info is probably already there
07:48:20FromDiscord<Elegantbeef> Do make the issue though, I'll take a look sometime soon if no one else does
07:48:54FromDiscord<Elegantbeef> Given the frequency of try expressions it's probably never been seen
07:49:37FromDiscord<Elegantbeef> Hmm actually this should compile methinks
07:49:55FromDiscord<Elegantbeef> Eh i'm dumb
07:50:00FromDiscord<Elegantbeef> Been up too much today
07:59:52FromDiscord<aph> should i raise error if i found invalid header of file? or continue reading until it has a error?
08:00:04FromDiscord<aph> (edit) "error?" => "error reading it?"
08:00:33FromDiscord<Elegantbeef> Probably the former but depends on what you're doing
08:00:46FromDiscord<aph> hmm
08:01:29FromDiscord<aph> i'm parsing some mikumikudance files, most likely it will not have errors unless it's corrupted. there's no way a user can fix the corrupted files anyways
08:01:35FromDiscord<aph> so i'ma go for latter
08:01:37FromDiscord<aph> 😈
08:01:54FromDiscord<Elegantbeef> Thanks for asking
08:01:57FromDiscord<aph> lol true
08:03:56FromDiscord<Rika> raise a warning mayb
08:03:58FromDiscord<Rika> (edit) "mayb" => "maybe"
08:04:58FromDiscord<aph> ooh warnings
08:14:51*Gustavo6046 quit (Quit: Gustavo6046)
08:41:24*koltrast joined #nim
08:46:35*pro joined #nim
09:41:04FromDiscord<hmmm> broskis gud sunday to u. I have a dumb algo question: if I have 2 seqs, One has some ids, one has attributes. I ordered the attribute seq, and now I want in the same order for the ids seq. I did it with 2 nested for loops and my pc is having heart attacks from the effort lol, so what is the smart kid way of doin dis
09:46:19FromDiscord<Rika> Don’t have two sequences?
09:46:24FromDiscord<Rika> Have them in a tuple?
09:46:38FromDiscord<hmmm> 🤔
09:46:42FromDiscord<hmmm> rika you might be a genius
09:46:45FromDiscord<hmmm> I'll try that
09:47:10FromDiscord<Rika> Or you may just be new to problem thinking, it’s really fun once you get a hang of it though
09:47:19prosmall rant, once I found out tuples exist, tuples changed my life
09:47:29FromDiscord<Rika> You need to learn how to think more differently
09:47:56FromDiscord<Rika> In reply to @pro "small rant, once I": Lol don’t go too far though, know when to “raise” your tuple into an object
09:49:11prowhen I was reviewing some code my team wrote at uni, I was like, why the f are you not using touple here, here, here here and here, and they were, what are you talking about, you are insane, why would we need to reinvent the wheel
09:49:29pro(they had no idea what is a tuple)
09:49:47proand language was like python, which for sure had tuples :D
09:50:26FromDiscord<Rika> That for sure has tuples lol
10:01:56FromDiscord<aph> are strings in nim using utf8 encoding?
10:05:36FromDiscord<Rika> Strings in Nim are not forced an encoding
10:05:48FromDiscord<Rika> You can hold binary data in them if wanted
10:05:56FromDiscord<Rika> In general, they use that though
10:06:28FromDiscord<aph> hmm, ty, good to know
10:12:44FromDiscord<Rika> I completely missed the April fools thing for Nim lol
10:18:03FromDiscord<aph> is there one?
10:18:06FromDiscord<aph> 👀
10:18:08propls tell
10:19:16FromDiscord<Rika> Sorry didn’t realise, here
10:19:17FromDiscord<Rika> https://forum.nim-lang.org/t/9064
10:19:54FromDiscord<Rika> Sure wonder where the idea came from, other than the fact that I mentioned it a while ago
10:20:16FromDiscord<Rika> Or did I? I remember mentioning subleq to someone somewhere lol
10:20:19FromDiscord<Rika> Probably not here
10:20:47FromDiscord<Rika> It’s a cool instruction set though
10:20:58FromDiscord<Rika> Surely a toy one but still cool
10:21:16FromDiscord<aph> ~~too much effort for an april fools~~
10:22:11prostackoverflow was epic this year
10:28:36FromDiscord<Rika> Subleq is really fun to toy with and make an assembler for
10:28:53FromDiscord<Rika> Could be a first foray into assembler creation or whatever
10:43:15*toulene quit (Ping timeout: 260 seconds)
10:54:19FromDiscord<Rika> Do Nim destructors have similar limitations to C++ ones?
11:07:31*toulene joined #nim
11:32:40*xet7 quit (Remote host closed the connection)
11:34:00*xet7 joined #nim
11:43:50FromDiscord<hmmm> rika-sama we did it
11:44:37FromDiscord<hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3UaP
11:45:12FromDiscord<Rika> Congrats
11:45:16FromDiscord<hmmm> I wish I was able to do it without the byIt convenience proc but hmm, my skillz failed me. Still now it's work and it's fast
11:54:34FromDiscord<Phil> Can you actually construct a varargs type?
11:55:22FromDiscord<Phil> I'm aware how they're generally used, aka you plonk them as type into a proc and they just have a constant length fo however many arguments were thrown in there
11:55:39FromDiscord<Phil> (edit) "I'm aware how they're generally used, aka you plonk them as type into a proc ... and" added "parameter"
11:56:24FromDiscord<Rika> You can’t use it on a variable if you mean that
11:56:40FromDiscord<Rika> You can pass a seq to one and it’ll behave as you think
11:56:42FromDiscord<Solitude> In reply to @Isofruit "I'm aware how they're": no necessarily a constant
11:56:56FromDiscord<Phil> Hmmmm
12:00:18FromDiscord<Phil> sent a code paste, see https://paste.rs/Nw1
12:01:03FromDiscord<Phil> (edit) "https://paste.rs/QqM" => "https://play.nim-lang.org/#ix=3UaR"
12:01:53FromDiscord<Solitude> In reply to @Isofruit "I wonder why norm's": you sure you need the seq and not just explicit dbValue()?
12:02:15FromDiscord<Solitude> im sure its implicit varargs conversion that is breaking inside templates/generics
12:02:54FromDiscord<Solitude> i think i even have issue for that
12:03:28FromDiscord<Phil> sent a long message, see http://ix.io/3UaS
12:04:01FromDiscord<Solitude> zamn...
12:04:15*zeus-supreme joined #nim
12:04:30FromDiscord<Phil> I'm not even sure how I managed to break this this badly, but I'm glad I can just make a "queryParams" seq, that isn't even going to be thaaaaat ugly
12:05:13FromDiscord<Solitude> you, probably, can even make it an array
12:05:54FromDiscord<Phil> Actually, that's fair, I always know the exact amount of params at compile-time (though not the exact values)
12:06:11FromDiscord<Phil> Let me find the shorthand for instantiating an array with values
12:07:18FromDiscord<Phil> facepalm
12:07:19FromDiscord<Phil> Right
12:07:22FromDiscord<Rika> [values]
12:07:22FromDiscord<Phil> [1,2,4,5,]
12:07:48*zeus-supreme1 quit (Ping timeout: 260 seconds)
12:08:57FromDiscord<Phil> Array works as well
12:10:20FromDiscord<Phil> Now to swap my entire generic repository to dbvalue arrays to foolproof against future explosions
12:14:13FromDiscord<Phil> Yes this allows me to finally get rid of a couple procs without which the damn project wouldn't compile due to it instantiating a generic in an essential way somewhere
13:00:03*wyrd quit (Remote host closed the connection)
13:00:18*wyrd joined #nim
13:03:44FromDiscord<Phil> Anyway, posted that to SO so I can read it again later when inevitably I run into that issue again
13:26:15*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:35:41*jjido joined #nim
13:52:28FromDiscord<Anuke> Has anyone successfully debugged an Android nim application here? I'm attempting to fix a crash, but the error itself isn't showing up on logcat. I can see `echo` results through `d:androidNDK`, but that doesn't appear to apply to thrown errors. Is it possible to customize the way exceptions are logged?
13:59:57FromDiscord<Anuke> very useful https://media.discordapp.net/attachments/371759389889003532/960176834845245570/unknown.png
14:03:18*arkurious joined #nim
14:04:43*zeus-supreme quit (Quit: WeeChat 3.5)
14:30:10FromDiscord<auxym> panicoverride.nim maybe? I'm not sure if it's always used or only with `os:standalone` (which is also deprecated)
14:30:32FromDiscord<spoon> they walkin
14:31:21*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:37:01FromDiscord<Anuke> ...nevermind, I figured out a way to redirect stdout to logcat, and it was caused by randomize() failing to run: <https://github.com/nim-lang/Nim/blob/7c8ea490a2be36d171d362c43212195ea8ce489f/lib/pure/random.nim#L679>
14:37:29FromDiscord<Anuke> anyone know why it `quit`()s instead of raising an error or similar?
14:37:36FromDiscord<Zoom> If you desperately need to keep them separated and don't want to make a copy of all the data into a united seq of tuples, you can define a new seq-like type which will mirror all operations to its children and use some generic sorting algorithms on that new type. Or, copy a `sort` proc, make it take two seqs and just copy all moves inside a proc to move items in two seqs in parallel.↵(@hmmm)
14:38:18FromDiscord<Zoom> But you have to have reasons to do any of that.
14:39:57FromDiscord<hmmm> ty zoom, thanks to rika I made a tuple that packed the two seqs and then ordered it with sortByIt. It still needs fiddling because I need the reverse order but I'll find a way lol
14:42:25FromDiscord<gerwy> Hi, well is there a better way than using `case of` if i want to call a function with the same name as the string value?
14:44:38FromDiscord<Rika> Macro
14:45:05FromDiscord<Rika> Still involves listing all the procs you want to call
14:45:11FromDiscord<Rika> be able to call
14:45:20FromDiscord<gerwy> sent a code paste, see https://play.nim-lang.org/#ix=3Ubt
14:46:55FromDiscord<gerwy> In reply to @Rika "Macro": Hmm but will it be at runtime? ↵And yeah i can list them its not a problem, i just dont want to have like a suuuper long case block in code, but having a list of functions somewhere else is fine
14:47:14FromDiscord<Rika> If the proc changes parameters and return type, the string must be compile time
14:47:26FromDiscord<Rika> Otherwise you can make a macro to generate the case statement
14:47:57FromDiscord<gerwy> Hmm that might be a problem ://
14:48:24FromDiscord<gerwy> In C/C++ there is something called function pointers, i know you are not a fan of pointers buuuut maybee
14:48:38FromDiscord<gerwy> Having a table of those
14:48:42FromDiscord<Rika> Nim has function pointers
14:48:52FromDiscord<Rika> They require all functions to have the same signature
14:49:07FromDiscord<Rika> Otherwise you must use void pointer and know what type to cast the pointer back to
14:49:11FromDiscord<Rika> Good luck with that
14:51:52FromDiscord<gerwy> D:
14:52:25*pch joined #nim
14:52:37FromDiscord<gerwy> well i need to find good solution for this then↵because im making like a smol runtime for my language
14:53:59FromDiscord<Rika> Encapsulate your functions in a type that stores a pointer to it and the type of function it is (somehow, I don’t know)
14:54:07FromDiscord<Rika> And somehow cast using that
14:54:32FromDiscord<Rika> You’re gonna run into similar problems though since cast and types are compile time
14:56:43FromDiscord<Zoom> "tuple packing the two seqs" != "seq packing tupled data from two original seqs"
14:57:24FromDiscord<hmmm> yea it was the second lol 😃
14:57:52FromDiscord<gerwy> yeah :// but for runtime, i know all the parameters types (or they can be whatever for like templates or varargs) and i know what they will return, so its fine↵but i also will traverse over my AST which has some stuff and those stuff would be easily interpreted with functions, buuuut well↵im gonna go with case for that, for runtime i need to think how to do it
14:58:16FromDiscord<Zoom> Not better, but you can use a table of procs
14:59:27FromDiscord<gerwy> i will, think about it, maybe i will just have no runtime at all since the language is joke
14:59:40FromDiscord<Rika> It’s a good learning experience to do so
15:03:56FromDiscord<gerwy> yeah well, i only wanted to make it work
15:04:16FromDiscord<gerwy> and then maybe rewrite it in future (since i now know how to do it) make it much better than it is now and maybe do it in Zig
15:04:42FromDiscord<Rika> Okay
15:06:46FromDiscord<gerwy> but thanksies for help again
15:20:59FromDiscord<ynfle> Are there any good markdown nim libraries that don't give just a plain string HTML output?
15:30:00FromDiscord<Rika> What would you like instead? I don’t understand
15:33:19FromDiscord<exelotl> an AST maybe?
15:38:50*yoyojambo joined #nim
15:39:09FromDiscord<gerwy> why would you want an AST of HTML?
15:42:52FromDiscord<Solitude> markdown
15:42:59FromDiscord<Solitude> maybe to convert to something other than html?
15:43:14FromDiscord<ynfle> To manipulate it programmatically and write a markdown file
15:44:20FromDiscord<ynfle> write it to a markdown file
15:45:26FromDiscord<Patitotective> you can create your own 🙃
15:47:12FromDiscord<ynfle> True
15:47:24*Gustavo6046 joined #nim
15:48:27*Gustavo6046 quit (Remote host closed the connection)
15:48:52*Gustavo6046 joined #nim
15:49:11*yiggityswaps joined #nim
15:51:22FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3UbT
15:52:43*yoyojambo quit (Ping timeout: 256 seconds)
15:52:46FromDiscord<Patitotective> (edit) "https://play.nim-lang.org/#ix=3UbT" => "https://play.nim-lang.org/#ix=3UbV"
15:53:43FromDiscord<Patitotective> then you can use https://github.com/soasme/nim-markdown to export it
15:54:02FromDiscord<Patitotective> (edit) "then you can use https://github.com/soasme/nim-markdown to export it ... " added "to html"
15:57:50FromDiscord<Solitude> he wants to manipulate existing file
15:58:11FromDiscord<Solitude> also, delete that
15:58:15FromDiscord<Rika> Delete what
15:59:23FromDiscord<Patitotective> @ynfle do you want to append stuff to markdown file? modify the actual content (like change headers)? or create one from scratch?
16:03:49*jjido joined #nim
16:08:36*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:08:51*slowButPresent joined #nim
16:08:55*ehmry joined #nim
16:14:45*xet7 quit (Read error: Connection reset by peer)
16:16:34*xet7 joined #nim
16:34:14*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:37:34*via__ joined #nim
16:38:15*wyrd quit (Ping timeout: 240 seconds)
16:39:04via__is there a way to create a array literal with a specific type with the [] array constructor? e.g. var x = [0x01, 0x02, 0x03] where each is an int8
16:40:25*wyrd joined #nim
16:42:49*ehmry joined #nim
16:44:29*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
16:44:52FromDiscord<Rika> var x = [0x01.int8, 0x02, 0x03]
16:46:38via__it then subsequently complains about the next elements not matching the type (int literal(2))
16:47:12FromDiscord<Rika> It shouldn’t
16:47:34FromDiscord<Rika> Sounds like an issue, it might be filed in the tracker already though
16:50:23via__just so i'm not misunderstanding, i have: var encoding = [0x80.cuchar, 0x25, 0x00, 0x00, 0x00, 0x00, 0x08] right now, and i get:
16:50:37via__ Error: type mismatch: got 'int literal(37)' for '0x00000025' but expected 'cuchar = char'
16:51:15FromDiscord<Rika> Oh characters are different
16:51:41FromDiscord<Rika> You have to convert them all in that case, might be quicker to use a map function
16:51:51via__oh, bummer. i wanted this to be uint8 but, but the c function is insistent on cuchar
16:52:45FromDiscord<Generic> use cast hehe
16:53:16via__yeah i mean i have it working with each one casted, was hoping for a less noisy approach
16:53:54FromDiscord<Generic> no cast the pointer to the array before when calling the c function
16:54:49termerhas anyone worked with Jester here?
16:55:00termerI can't find any documentation on how it handles HTTP request bodies
16:55:42termerframeworks like Express in Node.js use middleware to read request bodies, but it looks like Jester reads them automatically, at least that's what it looks like from the readme
16:56:29termerif it does, I don't see any way to limit the size of bodies it reads, which means my server would be vulnerable since clients can fill up my memory by sending long request bodies
17:03:00FromDiscord<ynfle> In reply to @via__ "yeah i mean i": There is `mapLiterals`
17:03:07FromDiscord<ynfle> In reply to @Patitotective "<@!767093711112241162> do you want": Modify headers
17:17:45termerOk, body and formData are procs, not properties
17:18:48FromDiscord<Patitotective> In reply to @ynfle "Modify headers": i guess you can scan (tokenize) the file and modify the headers but you would need to make your own scanner or try to use `nim-markdown`↵(maybe doing it manually would be easier)
17:19:17FromDiscord<Patitotective> how do i get the system architecture with nim? `x86_64` and so
17:24:47FromDiscord<Solitude> In reply to @Patitotective "how do i get": https://nim-lang.org/docs/system.html#hostCPU
17:28:26FromDiscord<Goat> sent a code paste, see https://play.nim-lang.org/#ix=3UcP
17:29:47FromDiscord<Goat> Once I had an idea for a games engine that worked like a database. Pararules comes close to that idea
17:35:22*PMunch joined #nim
17:43:22FromDiscord<ynfle> In reply to @Patitotective "i guess you can": Yup
17:49:23*jmdaemon joined #nim
17:55:29*jjido joined #nim
18:00:04*vicfred quit (Quit: Leaving)
18:05:02*pro quit (Quit: pro)
18:05:38FromDiscord<Patitotective> how can i add resources to my binary package? so they're copied when i build it 🤨
18:09:51FromDiscord<Solitude> https://github.com/nim-lang/nimble#optional=
18:10:10FromDiscord<Solitude> then suffer when your directory layout changes between your repo and nimble installed package
18:10:50FromDiscord<Solitude> or you could just `slurp` them
18:15:24FromDiscord<Patitotective> is there any example of a package using `installDirs`?
18:15:53FromDiscord<Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3UcZ
18:20:58FromDiscord<Solitude> why would it copy with nimble build
18:22:17FromDiscord<Patitotective> lol thanks
19:21:44*dtomato joined #nim
19:21:44*dtomato quit (Remote host closed the connection)
19:21:59*dtomato joined #nim
19:21:59*dtomato quit (Remote host closed the connection)
19:22:16*dtomato joined #nim
19:22:16*dtomato quit (Read error: Connection reset by peer)
19:22:32*dtomato joined #nim
19:22:32*dtomato quit (Remote host closed the connection)
19:22:48*dtomato joined #nim
19:22:50*dtomato quit (Remote host closed the connection)
19:23:04*dtomato joined #nim
19:23:04*dtomato quit (Remote host closed the connection)
19:23:19*dtomato joined #nim
19:23:19*dtomato quit (Remote host closed the connection)
19:23:36*dtomato joined #nim
19:23:37*dtomato quit (Remote host closed the connection)
19:23:53*dtomato joined #nim
19:23:53*dtomato quit (Remote host closed the connection)
19:24:09*dtomato joined #nim
19:24:09*dtomato quit (Remote host closed the connection)
19:24:25*dtomato joined #nim
19:24:25*dtomato quit (Read error: Connection reset by peer)
19:24:41*dtomato joined #nim
19:24:41*dtomato quit (Read error: Connection reset by peer)
19:24:57*dtomato joined #nim
19:24:57*dtomato quit (Read error: Connection reset by peer)
19:25:29*dtomato joined #nim
19:25:30*dtomato quit (Remote host closed the connection)
19:25:46*dtomato joined #nim
19:25:46*dtomato quit (Read error: Connection reset by peer)
19:26:03*dtomato joined #nim
19:26:03*dtomato quit (Read error: Connection reset by peer)
19:26:19*dtomato joined #nim
19:26:19*dtomato quit (Read error: Connection reset by peer)
19:26:36*dtomato joined #nim
19:26:36*dtomato quit (Remote host closed the connection)
19:27:38*dtomato joined #nim
19:27:38*dtomato quit (Remote host closed the connection)
19:27:54*dtomato joined #nim
19:27:54*dtomato quit (Remote host closed the connection)
19:28:11*dtomato joined #nim
19:28:11*dtomato quit (Remote host closed the connection)
19:28:28*dtomato joined #nim
19:28:28*dtomato quit (Remote host closed the connection)
19:29:00*dtomato joined #nim
19:29:00*dtomato quit (Read error: Connection reset by peer)
19:29:32*dtomato joined #nim
19:29:32*dtomato quit (Read error: Connection reset by peer)
19:29:48*dtomato joined #nim
19:29:48*dtomato quit (Remote host closed the connection)
19:30:04*dtomato joined #nim
19:30:04*dtomato quit (Remote host closed the connection)
19:30:21*dtomato joined #nim
19:30:21*dtomato quit (Read error: Connection reset by peer)
19:30:37*dtomato joined #nim
19:30:37*dtomato quit (Remote host closed the connection)
19:30:54*dtomato joined #nim
19:30:54*dtomato quit (Read error: Connection reset by peer)
19:31:10*dtomato joined #nim
19:31:10*dtomato quit (Read error: Connection reset by peer)
19:31:27*dtomato joined #nim
19:31:28*dtomato quit (Remote host closed the connection)
19:31:59*dtomato joined #nim
19:32:00*dtomato quit (Remote host closed the connection)
19:32:16*dtomato joined #nim
19:32:16*dtomato quit (Remote host closed the connection)
19:32:32*dtomato joined #nim
19:32:32*dtomato quit (Read error: Connection reset by peer)
19:33:02*dtomato joined #nim
19:33:02*dtomato quit (Remote host closed the connection)
19:34:05*dtomato joined #nim
19:34:05*dtomato quit (Remote host closed the connection)
19:34:22*dtomato joined #nim
19:34:22*dtomato quit (Remote host closed the connection)
19:34:38*dtomato joined #nim
19:34:38*dtomato quit (Remote host closed the connection)
19:34:54*dtomato joined #nim
19:34:54*dtomato quit (Read error: Connection reset by peer)
19:35:56*dtomato joined #nim
19:35:56*dtomato quit (Remote host closed the connection)
19:36:12*dtomato joined #nim
19:36:12*dtomato quit (Read error: Connection reset by peer)
19:36:28*dtomato joined #nim
19:36:28*dtomato quit (Remote host closed the connection)
19:36:45*dtomato joined #nim
19:36:45*dtomato quit (Remote host closed the connection)
19:37:01*dtomato joined #nim
19:37:01*dtomato quit (Remote host closed the connection)
19:37:18*dtomato joined #nim
19:37:18*dtomato quit (Remote host closed the connection)
19:37:35*dtomato joined #nim
19:37:36*dtomato quit (Remote host closed the connection)
19:37:51*dtomato joined #nim
19:37:51*dtomato quit (Read error: Connection reset by peer)
19:38:21*dtomato joined #nim
19:38:21*dtomato quit (Remote host closed the connection)
19:38:37*dtomato joined #nim
19:40:09*xet7 quit (Remote host closed the connection)
19:52:21FromDiscord<Phil> Wait.... wait.... I could be making sqlite extensions right now
19:52:49PMunchWhy are you guys making sqlite extensions?
19:52:50FromDiscord<Phil> Well, I have my next project after my current one, never even considered that a possibility
19:53:41FromDiscord<Phil> Because sqlite is awesome and if I can get smart enough to contribute something useful I'd love to do it
19:53:58PMunchOh don't get me wrong, sqlite is pretty awesome
19:54:14PMunchI was just wondering what extensions to sqlite where for, never encountered them before
19:54:20FromDiscord<Phil> I'd need to brainstorm what I'd like there to be first though
19:54:30FromDiscord<Phil> Oh, there's at least one very useful one
19:54:37FromDiscord<Phil> That implements a bunch of more esoteric SQL syntax
19:54:48PMunchLike?
19:55:15FromDiscord<Phil> I think reverse was one, also a couple others, let me find the extension page
19:55:29PMunchI'm not sure SQLite needs more esoteric syntax :P I remember my students had enough trouble learning the default stuff :P
19:55:49PMunchI guess if you store custom data as blob types an extension to print them in a more sensible way would be nice
19:56:09PMunchI had a database with GUIDs in them and it would just print out the blob as ASCII characters...
19:56:16PMunchIncluding newlines and everything
19:56:29FromDiscord<Phil> Reverse() not existing was actually ahuge problem for me
19:56:37FromDiscord<Phil> That's why I recall that one in particular
19:56:45FromDiscord<Phil> But the sqlite extension page is as always such a massive pain to find
19:57:18FromDiscord<Phil> Oh, FTS5 apparently is an extension
19:57:33PMunchYou mean this one? https://www.sqlite.org/loadext.html
19:57:34FromDiscord<Phil> If you know of it, that thing can basically replace something like elasticsearch for you and provide you a pretty decent search algorithm
19:57:59FromDiscord<Phil> Nah, that wasn't the one
19:58:37*vicfred joined #nim
19:59:28FromDiscord<Phil> God fucking damnit sqlite people, you had the page, I know it exists, why is it so hard to find
20:00:15PMunchThis might be way to find it: https://www.sqlite.org/doclist.html
20:01:14PMunchOooh, this is interesting: https://github.com/nalgeon/sqlean
20:02:11PMunchDamn it, I should've known of this when I was doing that other project with GUIDs. It even has a UUID module!
20:04:40FromDiscord<Phil> Couldn't find their "shoutout" page for extensions again, what I found on their page was like half of what I know is there somewhere
20:04:52FromDiscord<Phil> https://rsqlite.r-dbi.org/reference/initextension↵Here is an example for a bunch of useful functions though as well
20:05:51FromDiscord<Phil> Wanting an SQL function to invert a string was actually what made me compile sqlite for the first time myself
20:06:38PMunchHmm, are you able to accidentally break the ACID properties with extensions?
20:06:52FromDiscord<Phil> That I have no idea of
20:07:16FromDiscord<Phil> Back in the days I was trying to keep a virtual FTS5 table that contained a copy of aggregated data from other tables in sync with said tables via triggers
20:07:48*yiggityswaps quit (Ping timeout: 240 seconds)
20:07:52FromDiscord<Phil> Because the FTS5 tables in sqlite can only find full matches and prefixes though I also had to store the copied/aggregated data in the FTS5 table twice, the second time inverted
20:08:00FromDiscord<Phil> (edit) "inverted" => "inverted. That way I could also find prefixes"
20:08:28FromDiscord<Phil> That was like a year ago, I've since moved to Django signals and their re-implementation in nimstoryfont
20:08:42FromDiscord<Phil> (edit) "Back in the days I was trying to keep a virtual FTS5 table that contained a copy of aggregated data from other tables in sync with said tables via ... triggers" added "database"
20:09:03*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
20:09:05FromDiscord<Phil> I can not express how insanely cool the FTS5 table feature is
20:09:34FromDiscord<Phil> (edit) "is" => "is. Literally a small search engine, bundled into your tiny database, I love it so much"
20:11:22*jmdaemon joined #nim
20:58:17FromDiscord<lord> anyone know how to create an array of size `k` thats passed in to a proc?
20:58:57FromDiscord<huantian> Array sizes can’t be dynamic, I’d assume the size k would have to be static
21:00:08FromDiscord<lord> uhh
21:00:42FromDiscord<lord> wut if im trying to read to stdin which is the length of the array siez that im trying to create?
21:00:48FromDiscord<lord> kinda stuckl
21:01:42FromDiscord<leorize> use `seq`
21:01:53FromDiscord<leorize> seq can have variable sizes
21:03:03FromDiscord<lord> fk me
21:03:03FromDiscord<lord> thanks
21:12:17*xet7 joined #nim
21:33:36FromDiscord<lord> sent a code paste, see https://play.nim-lang.org/#ix=3UdH
21:34:03FromDiscord<lord> (edit) "https://play.nim-lang.org/#ix=3UdH" => "https://play.nim-lang.org/#ix=3UdI"
21:42:55*wyrd quit (Ping timeout: 240 seconds)
21:49:54*wyrd joined #nim
21:51:16FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3UdM
21:54:44FromDiscord<spoon> okay so just importing nimscripter doesn't let my program compile
21:55:36FromDiscord<spoon> any other ways to implement nimscript?
21:55:49FromDiscord<spoon> for modding/extension purposes
21:59:17FromDiscord<huantian> In reply to @treeform "https://play.nim-lang.org/#ix=3UdL": Does enumerate work on `lines` or did you just use split on a string for purposes of playground
22:11:50*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:13:57PMunchWhy doesn't it compile @spoon?
22:14:08PMunchI've used it successfully in the past
22:21:08FromDiscord<treeform> In reply to @huantian "Does enumerate work on": I don't know, I can't read files in the playground.
22:21:21FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3UdW
22:22:18FromDiscord<Elegantbeef> You're using 1.4.8 compiler lib with a 1.6 compile
22:22:19FromDiscord<Elegantbeef> compiler\
22:22:26FromDiscord<spoon> how does that happen?
22:22:35FromDiscord<spoon> i went to scoop and deleted all the old versions
22:22:38FromDiscord<Elegantbeef> Old nimscripter
22:22:44*ltriant quit (Ping timeout: 272 seconds)
22:22:53FromDiscord<spoon> ah
22:22:53FromDiscord<Elegantbeef> Modern nimscripter doesnt rely on `compiler` in nimble so this doesnt happen
22:23:04FromDiscord<spoon> this is the version i pulled from nimble
22:23:08FromDiscord<spoon> hmm
22:23:26FromDiscord<Elegantbeef> check the version
22:23:35FromDiscord<spoon> 1.0.13
22:23:38FromDiscord<Elegantbeef> It's 1.0.13 right now
22:23:48FromDiscord<Elegantbeef> Youre installed one cannot be that
22:23:50FromDiscord<Elegantbeef> your\
22:23:58FromDiscord<spoon> https://media.discordapp.net/attachments/371759389889003532/960303676990316545/unknown.png
22:24:03FromDiscord<Elegantbeef> `nim -v`?
22:24:13FromDiscord<spoon> 1.6.4
22:24:40FromDiscord<Elegantbeef> Yea i dont know how you managed this, it's supposed to use the compiler in your path
22:24:45FromDiscord<Elegantbeef> `nimble uninstall compiler`
22:25:55FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3UdX
22:26:09FromDiscord<Elegantbeef> Yep that's good
22:26:19FromDiscord<Elegantbeef> make a config.nims with `--path"$nim"`
22:26:20FromDiscord<lord> is it me
22:26:33FromDiscord<lord> or languages with typings are a bitch to write
22:26:41FromDiscord<Elegantbeef> It's you
22:26:56FromDiscord<Elegantbeef> static typing is a godsend and i will not sit idly by as you insult it!
22:27:05FromDiscord<lord> but y though
22:27:11FromDiscord<Elegantbeef> Why what?
22:27:30FromDiscord<lord> like in python u can just write stuff but theres so much "compile" time exceptions when writing nim
22:27:56FromDiscord<Elegantbeef> And those would be runtime errors
22:28:16FromDiscord<lord> true lol
22:28:54FromDiscord<Elegantbeef> Run that in python and you occasionally get a runtime errror
22:28:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UdY
22:29:11FromDiscord<Elegantbeef> Port that to Nim and you cannot compile it cause you cannot add string to int
22:29:22FromDiscord<Recruit_main707> dynamic typing is all fun and games until you work on someone else´s code
22:29:36FromDiscord<Recruit_main707> on/with
22:29:37FromDiscord<Elegantbeef> It's all fun and games until you write code you want to work
22:29:40FromDiscord<lord> honestly yall on to something
22:29:59PMunch@lord, I'd rather have my program fail during the 3 second compile-time than after I have run my program for an hour right as its meant to save the output to a file
22:30:44FromDiscord<Elegantbeef> So spoon the reason your program had that error is you just had a `.nim` file and as such it could freely import the compiler apiii
22:31:00FromDiscord<Elegantbeef> That api was outdated and as such caused the issue
22:31:18FromDiscord<Elegantbeef> With a nimble file and restricted import paths that'd go away
22:31:52FromDiscord<Elegantbeef> `nimble build` \> `nim c` in ensuring your imports are portable
22:33:29FromDiscord<spoon> not familiar with setting flags in nimscript files though
22:33:39FromDiscord<Elegantbeef> What do you mean
22:33:48FromDiscord<Elegantbeef> `config.nims` with `--path:"$nim"`
22:33:48FromDiscord<lord> also whats the diff between `let` and `const` lol
22:33:53FromDiscord<spoon> In reply to @Elegantbeef "make a config.nims with": making a config.nims
22:33:56FromDiscord<Elegantbeef> let is runtime constant
22:33:59FromDiscord<Recruit_main707> its what you are used to, but specially once things start to get big static typing becomes very useful, if you ask people that have coded in Ada, they will tell you how good it is for large projects because of its numerous compile time checks that explain both to the compiler and the programmers what some piece of code may do and to ensure runtime safety.
22:34:01FromDiscord<Elegantbeef> `const` is compiletime constant
22:34:34FromDiscord<Elegantbeef> Spoon i dont get the issue
22:34:54FromDiscord<Elegantbeef> I guess i should steal pmunches code from nimslp
22:35:02FromDiscord<Elegantbeef> Though i personally dont like that solution
22:35:53FromDiscord<Recruit_main707> let is a variable that you arent allowed to change, for defining constant stuff at runtime, under the hood its the same as `var`, but its recommended to use let when something is not supposed to be edited↵const is the more traditional constant, it is determined at compile time
22:36:16FromDiscord<Elegantbeef> The tree of variable declaration is `const` \> `let` \> `var`
22:36:21FromDiscord<Elegantbeef> It's a simple bamboo shoot
22:36:51FromDiscord<lord> and for best practices is it better to do `var name: string = "john"` or `var name = "john"`
22:36:59FromDiscord<lord> In reply to @Elegantbeef "The tree of variable": thx for all the help btw
22:37:10FromDiscord<Elegantbeef> The latter
22:37:30FromDiscord<Elegantbeef> Type annotations are only needed when you want to be explicit which makes life more difficult
22:37:43FromDiscord<Elegantbeef> the only time i use variable type annotations is when using vars like `var myThing: T`
22:37:57FromDiscord<Elegantbeef> I want a 0'd value but i dont want to manually construct it
22:38:19FromDiscord<Recruit_main707> i do specify them sometimes
22:38:53FromDiscord<spoon> it's yelling at me but it works when it compiles, guess it's just the extension https://media.discordapp.net/attachments/371759389889003532/960307429625708564/unknown.png
22:39:02FromDiscord<Recruit_main707> yep
22:39:08FromDiscord<Recruit_main707> dont worry
22:39:21FromDiscord<Elegantbeef> Also i wasnt lying you can verbatim write `--path:"$nim"`
22:39:43FromDiscord<Elegantbeef> Config nimscript has an operator for `--`
22:39:47PMunch@lord, most people do `var name = "john"`, explicit type annotations are most often used when you don't set a value
22:40:11FromDiscord<spoon> In reply to @Elegantbeef "Also i wasnt lying": yeah, i tried that too and it also got mad at me
22:40:20FromDiscord<spoon> but if it works at compile time eh
22:40:39FromDiscord<Elegantbeef> There is a fix for this in devel, but that's beside the point
22:41:02FromDiscord<Recruit_main707> i also try to be a bit explicit with my variable names when not specifying the type manually, like:↵`let collisionNormal = this.findContactSurface() # a Vector3, i consider it specified with the "Normal" in the name`
22:41:07FromDiscord<Elegantbeef> The config works so it's fine!
22:41:24FromDiscord<Elegantbeef> Alternatively make distinc types
22:41:28FromDiscord<Elegantbeef> Problem solved 😛
22:42:02FromDiscord<spoon> is it a problem with `nim check`?
22:42:10FromDiscord<exelotl> In reply to @lord "and for best practices": I sometimes do `var name: string = someComplexExpressionThatIsNotClear()`
22:42:33FromDiscord<Elegantbeef> Nim check didnt init a VM environment to check `.nims` so errored
22:42:44FromDiscord<spoon> hm
22:42:55FromDiscord<Elegantbeef> Devel has a fix for it, but i'd just say dont worry about it
22:43:00FromDiscord<exelotl> especially if it's like a generated const array and I want to make sure it has correct length
22:43:28FromDiscord<Elegantbeef> Imagine not justu sing a distinct type for that exelotl
22:43:57FromDiscord<spoon> In reply to @exelotl "I sometimes do `var": i just go full on `var something = parseWhateversInside(Thing, expression(thing1, thing2).int32)` with no defined type
22:43:58FromDiscord<Elegantbeef> Jeez i think this keyboard is toast
22:44:09FromDiscord<Elegantbeef> between it writing "apiii" and delaying my spaces
22:44:17FromDiscord<spoon> resulting in beautiful code
22:44:36FromDiscord<Recruit_main707> beautifully confusing :P
22:45:58FromDiscord<Elegantbeef> Also recruit why wouldnt it be `getContactNormal`?
22:46:03FromDiscord<spoon> less lines = better
22:46:16FromDiscord<Elegantbeef> It returns a vector3 which is the normal of the contact, hardly a surface
22:46:23FromDiscord<Elegantbeef> Less horizontal space = better
22:46:28FromDiscord<exelotl> In reply to @Elegantbeef "Jeez i think this": your keyboard may be toast but my gamepad is bananas https://media.discordapp.net/attachments/371759389889003532/960309334481461319/unknown.png
22:46:36FromDiscord<Elegantbeef> I dont care how many lines something is aslong as it's written intelliigently
22:46:59FromDiscord<Elegantbeef> Go work on goodboy galaxy or something! 😛
22:47:29FromDiscord<exelotl> hahaha touché
22:47:41FromDiscord<huantian> In reply to @Elegantbeef "between it writing "apiii"": You should build a 1k usd custom keeb
22:49:24nrds<DarthOreo99> why 5 banananas when there 4 directions and 2 buttons...
22:50:28nrds<DarthOreo99> sorry put too much thought into that already XD
22:51:17FromDiscord<Elegantbeef> Damn you're right huan, you want to fund it?
22:51:17FromDiscord<Elegantbeef> Inb4 pmunch\: "Damn that sounds good, why didnt i do that"
22:51:24FromDiscord<Elegantbeef> It'll be the ultimate Nim keyboard
22:51:30FromDiscord<Elegantbeef> All the keys will be macros the backplate will be purple, the keys yellow and special keys slightly darker yellow
22:51:32FromDiscord<Elegantbeef> I only read keeb as kebab so uhh dont eat it
22:51:32FromDiscord<Elegantbeef> Huan i'm not making a keyboard
22:51:32FromDiscord<huantian> Purple and yellow keeb huh
22:51:33FromDiscord<huantian> I’ve seen some pretty nice looking GMK caps that are purple and yellow I think
22:51:35FromDiscord<huantian> ik it’s just fun to muse about it
22:52:00FromDiscord<Elegantbeef> You arent supposed to look int oit
22:52:04FromDiscord<Recruit_main707> In reply to @Elegantbeef "Also recruit why wouldnt": name is provisional yeah :p
22:52:09FromDiscord<Elegantbeef> I do like that a lurker's first message is about a joke response
22:52:27FromDiscord<Elegantbeef> And it should return a `Normal`
22:52:30FromDiscord<Elegantbeef> Then you have no problem
22:52:48FromDiscord<Elegantbeef> Recruit i bet you write `proc doThing(a: float) # a should be in range 0 and 1`
22:54:04FromDiscord<Recruit_main707> well, i specified why i dont do something just in case i forgot lol↵`proc findContactSurface(this: ref Env): Vec3 = #, bool) = dont need to check wether the collision happens or not, just return a cero vector in that case`
22:54:29FromDiscord<Elegantbeef> That's not what i jokingly suggested!
22:55:32FromDiscord<Recruit_main707> bold of you i didnt have that written already
22:55:38FromDiscord<Recruit_main707> to think
22:55:52FromDiscord<Elegantbeef> Lol
22:56:07FromDiscord<Elegantbeef> I was just saying you're the type to not do `proc doThing(a: 0.0 .. 1.0)`
22:56:20FromDiscord<Elegantbeef> or `0d..1d` if you prefer
22:56:42FromDiscord<Recruit_main707> does that even work?
22:57:03FromDiscord<Elegantbeef> Of course
22:57:12FromDiscord<Elegantbeef> Subrange types work for all numeric types
22:57:18FromDiscord<Recruit_main707> why didnt i know about this before
22:57:25FromDiscord<Recruit_main707> now ill use it everywhere
22:57:26FromDiscord<Elegantbeef> See
22:57:55FromDiscord<huantian> Wonder if I can get this to work for book
22:57:58FromDiscord<huantian> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/960312217557934091): Wonder if I can get this to work for books
22:57:59FromDiscord<Elegantbeef> Such a lovely life
22:58:02FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/KJZ
22:58:05FromDiscord<huantian> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/960312217557934091): Wonder if I can get this to work for bools
22:58:18FromDiscord<Recruit_main707> the more you know 🌠
22:58:18FromDiscord<Elegantbeef> Why not
22:58:39FromDiscord<huantian> That way it’d be more explicit if you can pass both true and false
22:58:42FromDiscord<Elegantbeef> Need a distinct for that though
22:58:44FromDiscord<Elegantbeef> Sadly
22:59:08FromDiscord<Elegantbeef> Bools dont work for all ordinal operations sadly like conventional enums
22:59:21*rawrrr joined #nim
22:59:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Ue3
23:00:50FromDiscord<huantian> Make a converter and it’s basically python!
23:00:59*PMunch quit (Quit: leaving)
23:01:05FromDiscord<Recruit_main707> lol
23:05:31*ltriant joined #nim
23:08:42*vicfred quit (Ping timeout: 260 seconds)
23:35:01FromDiscord<auxym> what am I reading
23:35:19FromDiscord<Elegantbeef> What do you mean?
23:35:38FromDiscord<auxym> you guys are joking right
23:35:54FromDiscord<Elegantbeef> What?
23:35:59FromDiscord<Elegantbeef> Subrange types exist in Nim
23:36:09FromDiscord<auxym> "That way it’d be more explicit if you can pass both true and false"
23:36:23FromDiscord<auxym> `bool` already makes that pretty explicit no?
23:36:48FromDiscord<Elegantbeef> I hope they were joking
23:37:00FromDiscord<auxym> yes 🙂
23:37:26FromDiscord<auxym> something something implement all bools with subleq
23:37:51FromDiscord<Elegantbeef> Either subrange types are wonderful and i despise more people dont use them
23:38:03FromDiscord<Elegantbeef> It's legitimately self documenting code
23:39:19FromDiscord<auxym> yes subranges are nice, and so are runtime overflow checks. I just heard nginx had a cve recently caused by integer overflow? this is 2022 why are people still doing this to themselves :/
23:39:52FromDiscord<Elegantbeef> Probably cause their typesystem doesnt do it itself
23:54:07FromDiscord<Alea> sent a code paste, see https://play.nim-lang.org/#ix=3Uea