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