00:00:58 | voltist | @Vindaar All the points are between 0 and 100, and I didn't manually set the range, so it must just be doing it itself |
00:01:04 | voltist | I'll make an issue |
00:04:32 | mipri | https://play.nim-lang.org/#ix=2HD0 perhaps |
00:07:41 | mipri | very low confidence in that. Is the string's internal data also shared? no idea. |
00:07:58 | FromDiscord | <sealmove> guys, does nim differentiate signed and unsigned shift (for example java has `>>` and `>>>`)? |
00:08:24 | FromDiscord | <Vindaar> voltist: thanks, I already closed my laptop. I'll take a look at it tomorrow morning! |
00:11:33 | mipri | !eval echo (0x80.uint8 shr 1, cast[int8](0x80) shr 1) |
00:11:35 | NimBot | (64, -64) |
00:21:28 | * | Gustavo6046 quit (Quit: WeeChat 2.9) |
00:22:20 | * | Gustavo6046 joined #nim |
00:22:33 | FromDiscord | <sealmove> interesting, I got "Error: unhandled exception: errno: 0 `No error`" 😄 |
00:27:04 | FromDiscord | <Rika> lmao "errno 0 no error" is always fun |
00:28:02 | FromDiscord | <shadow.> almost as fun as attempt to read from nil? |
00:28:05 | FromDiscord | <shadow.> SIGSEGV |
00:28:07 | FromDiscord | <shadow.> lol |
00:28:22 | FromDiscord | <shadow.> has anyone seen disruptek today since like 10 hours ago |
00:28:41 | mipri | ~seen disruptek |
00:28:41 | disbot | no footnotes for `seen`. 🙁 |
00:28:51 | FromDiscord | <shadow.> !seen disruptek |
00:28:52 | disbot | disruptek spoke in 12#nim 19 hours ago 12https://irclogs.nim-lang.org/11-12-2020.html#05:08:46 |
00:28:55 | FromDiscord | <shadow.> rip |
00:29:36 | FromDiscord | <sealmove> is `addr someSeq` similar to `addr someArray`? I remember you had to do something extra for seqs |
00:29:39 | FromDiscord | <Rika> at least sigsegv tells you what happened |
00:29:55 | FromDiscord | <Rika> errno 0 is just "nothings fine but i say everything is fine" |
00:30:16 | FromDiscord | <shadow.> true |
00:31:20 | FromDiscord | <Rika> @sealmove addr someSeq[0]? |
00:34:04 | FromDiscord | <sealmove> yeah i thanks that's it |
00:44:39 | Beckingham | Holy shit, 19 hours without disruptek |
00:44:56 | Beckingham | Can we go a whole day without him making his testes known? |
00:45:44 | * | vicfred quit (Quit: Leaving) |
00:46:25 | FromDiscord | <Gibson> mipri: thanks, still getting crashes though (probably something else in my code) |
00:46:38 | FromDiscord | <Gibson> using threadpool seems to make the issue go away, so....... |
00:47:50 | FromDiscord | <Rika> yeah weve done that before |
00:48:11 | FromDiscord | <Rika> disruptek left for a while after that event with bdfl |
00:55:24 | PMunch | Oh boy |
00:55:28 | PMunch | Just finished the soldering |
00:55:47 | Beckingham | Melt any plastic housings? |
00:55:54 | PMunch | Nope |
00:56:02 | Beckingham | Congrats 🎉 |
00:56:19 | PMunch | Took me 5½ hours though.. |
01:00:36 | * | Tanger joined #nim |
01:00:52 | Beckingham | Was it worth it though |
01:03:31 | FromDiscord | <Rika> ofc |
01:03:37 | FromDiscord | <Rika> anything for the perfect keyboard |
01:04:11 | PMunch | I mean it looks pretty swanky https://photos.app.goo.gl/tSNs5USNkw4ii5Vo8 |
01:04:20 | PMunch | https://photos.app.goo.gl/4rjoQ6nsgW34GYS48 |
01:04:37 | PMunch | Much neater than the first one |
01:07:14 | Beckingham | That your first one on the left? |
01:07:30 | Beckingham | Very RTX Off/On |
01:07:49 | Prestige | nice PMunch |
01:08:01 | Beckingham | Or it might just be the angle making it look a bit wobblier 😂 |
01:08:37 | PMunch | Beckingham, yes it is indeed the first one |
01:08:42 | PMunch | And no, it is that wobbly :P |
01:09:09 | Beckingham | Everything you type with it comes out as Comic Sans |
01:09:18 | PMunch | https://photos.app.goo.gl/8N8h4pXooB7ywaPA8 |
01:09:37 | Beckingham | Factorio: 0 -> 200 hours of play |
01:10:09 | Beckingham | I mean your soldering is way better than mine, I might as well be welding when I do it |
01:11:28 | FromDiscord | <sealmove> is it possible to change the mode of an already opened file |
01:11:30 | FromDiscord | <sealmove> ? |
01:11:54 | PMunch | I mean I was so happy when I finished to first half, but now it just looks kinda shoddy.. |
01:12:04 | PMunch | sealmove, don't think so |
01:13:30 | FromDiscord | <sealmove> when writing to a bitstream you have to do reads on it too 😛 |
01:14:00 | FromDiscord | <sealmove> so `proc newFileBitStream(f: File): BitStream` won't work |
01:14:15 | PMunch | Wait what? |
01:14:29 | Beckingham | ? |
01:15:40 | FromDiscord | <sealmove> yeah... it's weird but basically there is a bit buffer and in some cases when writing, you have to fetch bytes from the underlying `Stream` |
01:16:05 | PMunch | Hmm |
01:16:09 | PMunch | Oh well, I'm off to bed |
01:16:15 | FromDiscord | <sealmove> gn! |
01:16:16 | * | PMunch quit (Quit: leaving) |
01:16:25 | Beckingham | Night PMunch |
01:19:27 | disruptek | beckingham: what's this about my testes? |
01:19:50 | Beckingham | Almost made it 24 hours, dang |
01:20:34 | FromDiscord | <sealmove> is there a way to get the mode of already opened file? |
01:20:51 | FromDiscord | <sealmove> `File` is defined as `ptr CFile` so... |
01:22:44 | hmmm | oh boy disruptek is back :o |
01:24:36 | mipri | if there is such an API for fds or C FILE*s I've never noticed it. |
01:25:13 | FromDiscord | <sealmove> this's annoying 😐 |
01:25:36 | FromDiscord | <ElegantBeef> Clearly just wrap all your read/write calls with `try` and when that fails re open the file in the way you want 😄 |
01:25:59 | mipri | if you're in a position of not knowing, it means you're either pushing File into an API and getting them back, or you have a data structure containing random Files |
01:26:04 | FromDiscord | <sealmove> i just want to disallow some modes |
01:26:19 | mipri | in the former case try a table of fds to information; in the latter case encode that information alongside the Files |
01:27:16 | FromDiscord | <sealmove> just wanted to make `proc newFileBitStream(f: File): BitStream` work, but if I can't even test the mode of `f`, then it won't. |
01:27:32 | mipri | ok, or in your third case, don't accept a bare File. Only accept something that includes the mode information |
01:27:40 | FromDiscord | <sealmove> yeah |
01:28:08 | mipri | or maybe something like a Stream object that supports the operations you want, without caring about modes |
01:29:13 | FromDiscord | <sealmove> i am wrapping `streams.Stream` |
01:29:31 | mipri | ... anyway, the information might actually be available. /proc/$$/fd has interesting-looking modes on its fake symlinks |
01:29:36 | FromDiscord | <sealmove> anyway, not allowing using an opened file is fine I guess |
01:31:00 | mipri | yeah I've just never noticed it |
01:31:48 | FromDiscord | <ElegantBeef> I'd argue that's for the best as there is really not much reason to support taking in a file |
01:31:48 | mipri | ok, yeah, fcntl can retrieve what you're looking for. |
01:32:01 | mipri | it can't give you all the flags that open() supports, but it can give you the ones you want |
01:32:36 | * | hmmm quit (Quit: catching zZz) |
01:33:37 | mipri | there's no Nim stdlib support for it though. You'll need to get the fileno of your File and then call some C FFI. |
01:37:10 | stefantalpalaru | I need to use "-d:noSignalHandler" in order to get core dumps on Linux? |
01:43:28 | Beckingham | Night folks |
01:43:30 | * | Beckingham quit (Quit: WeeChat 1.9.1) |
01:58:42 | * | vicfred joined #nim |
02:03:38 | disruptek | !last clyybber |
02:03:39 | disbot | clyybber spoke in 12#nim-gamedev 8 days ago |
02:13:28 | FromDiscord | <Rebel> Sad |
02:24:37 | FromDiscord | <Quibono> Why sad? |
02:28:09 | * | ^Q-Master^ joined #nim |
02:28:09 | * | Q-Master quit (Read error: Connection reset by peer) |
02:33:46 | * | mbomba quit (Quit: WeeChat 3.0) |
02:49:18 | FromGitter | <offbeat-stuff> nimlang how to execute terminal command with it's stdin stdout changed |
02:49:38 | disruptek | see the osproc module. |
02:50:19 | FromGitter | <offbeat-stuff> There is'nt much help in there |
02:50:33 | disruptek | what have you tried? |
02:50:47 | FromGitter | <offbeat-stuff> execCmd |
02:50:52 | FromGitter | <offbeat-stuff> execCmdEx |
02:51:10 | FromGitter | <offbeat-stuff> Can I do it by changing env in startProcess |
02:52:52 | FromDiscord | <Quibono> https://play.nim-lang.org/#ix=2HDA Any idea why myURL is reading as a Response type? |
02:53:07 | mipri | no, process environment has nothing to do with stdin and stdout |
02:53:42 | FromDiscord | <shadow.> disruptek is back |
02:53:53 | FromDiscord | <shadow.> https://github.com/nim-lang/Nim/pull/16318 |
02:53:54 | disbot | ➥ Add `rotateLeft` proc to deques.nim. |
02:53:56 | FromDiscord | <shadow.> how does pr look |
02:54:05 | FromDiscord | <shadow.> i added since notation, changelog entry, and the rotateRight template |
02:54:37 | disruptek | offbeat-stuff: you need a Process so you can fuck with the i/o. |
02:54:41 | FromGitter | <offbeat-stuff> So , I want to give my input that comes from either from keyboard shortcuts or my window manager |
02:55:11 | FromGitter | <offbeat-stuff> Okay so startProcess then how do access it's stdin |
02:55:29 | disruptek | shadow: changelog needs to mention rotateRight, now. |
02:55:41 | disruptek | the module name is `deques`, not `deques.nim`. |
02:55:49 | FromDiscord | <shadow.> fixing time |
02:55:54 | mipri | offbeat-stuff: the Process object has procs that return the relevant streams |
02:56:29 | disruptek | the comments should read more like, "moves last entry in the deque to become the first entry." |
02:56:47 | FromDiscord | <Daniel> @PMunch whats that you are soldering mate? |
02:56:50 | disruptek | people don't necessarily know what rotation means. |
02:56:51 | FromDiscord | <shadow.> ah ok |
02:56:54 | FromDiscord | <shadow.> fair enough |
02:56:58 | FromDiscord | <shadow.> > - Added `rotateLeft` and `rotateRight` procs to the `deques` module for rotating a Deque. |
02:57:00 | FromDiscord | <shadow.> is that ok for changelog |
02:57:02 | FromGitter | <offbeat-stuff> @mipri got it |
02:57:41 | FromDiscord | <Daniel> deques sounds french, what is it? |
02:57:43 | disruptek | you can explain it using "equivalent (but faster) than deq.pushFirst(deq.popLast)" or similar. |
02:57:47 | FromDiscord | <shadow.> double ended queue |
02:57:48 | disruptek | double-ended queues. |
02:57:59 | FromDiscord | <shadow.> O(1) prepend, append, pop first, and pop last |
02:58:04 | FromDiscord | <Quibono> Yeah it sounds french. |
02:58:06 | FromDiscord | <Daniel> ok, ok, ...thank you |
02:58:06 | FromDiscord | <shadow.> lmao |
02:58:09 | FromDiscord | <shadow.> it's pronounced deck |
02:58:26 | FromDiscord | <shadow.> but to take something off the end is pronounced dee-queue |
02:58:31 | FromDiscord | <shadow.> lol |
02:59:33 | disruptek | other than that, if it works, i don't care. 😀 |
03:00:02 | disruptek | Error: 'result' is of type <int> which cannot be captured as it would violate memory safety |
03:00:04 | * | disruptek sighs. |
03:02:05 | FromDiscord | <shadow.> kk i fixed changelog and the doc comments |
03:02:39 | FromDiscord | <shadow.> assuming i did everything you said (don't wanna make you look over it again) would that be good? |
03:02:47 | FromDiscord | <shadow.> at this point im guessing i should just wait for reviewers |
03:02:59 | disruptek | yeah, like i said, i'm happy with it. |
03:03:29 | FromDiscord | <shadow.> coming from you that's like winning a lottery, thanks |
03:04:06 | FromDiscord | <shadow.> lol |
03:04:15 | FromDiscord | <shadow.> its failing checks wtf- |
03:04:30 | FromDiscord | <shadow.> lovely |
03:04:48 | FromDiscord | <Revenant> hiya |
03:05:16 | FromDiscord | <shadow.> nvm fixed |
03:05:18 | FromDiscord | <shadow.> hi |
03:05:24 | FromDiscord | <Revenant> so what's the deal with Nim not being able to capture var types in closures (e.g. a var argument inside a proc)? is that some limitation that will never be lifted? |
03:06:20 | FromDiscord | <shadow.> maybe it doesn't want to |
03:06:52 | FromDiscord | <Revenant> talking about this error |
03:07:01 | FromDiscord | <Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2HDH |
03:07:47 | disruptek | most uses are solved by cps, but what's the code look like? |
03:07:58 | FromDiscord | <Revenant> cps? what's that? |
03:08:19 | disruptek | upcoming control-flow magic. |
03:08:22 | disruptek | !repo cps |
03:08:23 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 40⭐ 2🍴 |
03:08:42 | FromDiscord | <Quibono> Okay I'm losing my mind mildly. |
03:09:27 | FromDiscord | <Revenant> cheers, i'll check that out, although "upcoming" sounds too bad... i need it now 🙂 |
03:09:36 | FromDiscord | <Revenant> this is what the code is roughly doing |
03:09:48 | disruptek | can you paste it? |
03:09:49 | FromDiscord | <Revenant> sent a code paste, see https://play.nim-lang.org/#ix=2HDI |
03:09:50 | disruptek | ~paste |
03:09:50 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
03:11:10 | disruptek | well, yeah, that's unlikely to work any time soon. |
03:11:52 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:13:09 | disruptek | i assume you can't use closures and gcsafe and shit? |
03:13:12 | * | Cthalupa quit (Ping timeout: 260 seconds) |
03:14:04 | * | muffindrake joined #nim |
03:14:22 | * | Cthalupa joined #nim |
03:14:59 | FromDiscord | <Revenant> yeah i'm not that big of an expert on that stuff |
03:15:14 | FromDiscord | <Revenant> anyhow, in my case i just use a global in the callback wrapper closure |
03:15:43 | FromDiscord | <Revenant> in other cases i used another workaround, basically copied the var into a non-var inside the function |
03:15:58 | FromDiscord | <Revenant> but i was just wondering if this limitation is gonna stay or not, it's pretty annoying |
03:16:17 | FromDiscord | <Revenant> (edit) "anyhow, in my case i ... just" added "can" |
03:16:40 | disruptek | if you can change the signature, of course that's a solution. |
03:17:47 | FromDiscord | <Revenant> well sure i could, but that couples things too much. the closure solution is nice because then you can wrap the callback and do whatever you want. |
03:17:50 | FromDiscord | <Revenant> anyhow, thanks |
03:19:07 | FromDiscord | <Revenant> btw, this CPS thing reminds me of co-routines/green-threads, but at a quite low-level |
03:19:41 | disruptek | yeah, that's the idea. it's a set of primitives for building that stuff (and other stuff besides). |
03:19:45 | disruptek | so much stuff. |
03:19:51 | FromDiscord | <Revenant> 🙂 |
03:19:57 | FromDiscord | <Revenant> i'll keep an eye on it |
03:20:06 | disruptek | 👍 |
03:20:08 | FromDiscord | <Revenant> coroutines are the future (i think) |
03:24:23 | FromDiscord | <Revenant> wow this seems handy |
03:24:24 | FromDiscord | <Revenant> https://github.com/disruptek/testes |
03:27:28 | FromDiscord | <shadow.> his testes are beautiful |
03:32:23 | FromDiscord | <19> sent a code paste, see https://play.nim-lang.org/#ix=2HDP |
03:34:27 | FromDiscord | <shadow.> does that compile |
03:34:37 | FromDiscord | <shadow.> oh wait |
03:34:44 | FromDiscord | <shadow.> no those aren't the same |
03:35:06 | FromDiscord | <shadow.> ++ as postfix doesn't return successor |
03:35:28 | FromDiscord | <shadow.> and also, one modifies value the other doesn't |
03:35:35 | FromDiscord | <19> hm i think this is what's causing my bug |
03:35:51 | FromDiscord | <shadow.> are you porting from another language |
03:36:08 | FromDiscord | <shadow.> just do `var a = b; inc b` |
03:36:12 | FromDiscord | <19> sent a code paste, see https://play.nim-lang.org/#ix=2HDQ |
03:36:17 | FromDiscord | <19> yes from C |
03:36:24 | mipri | no, they're not the same |
03:36:38 | FromDiscord | <shadow.> just assign to RunningSampleIndex, then increment it later on |
03:38:18 | FromDiscord | <19> ok that fixed it thank you |
03:40:43 | FromDiscord | <19> @shadow. you mean assign it and then `inc` it? |
03:42:44 | mipri | var a = b; inc b |
03:42:54 | mipri | that's the equivalent of a=b++ |
03:43:05 | FromDiscord | <19> cool |
03:44:30 | FromDiscord | <19> `SampleOut++ = SampleValue;` i guess this has also the same idea? |
03:47:00 | mipri | it's similar in that you need to change the pointer after making the assignment, not before |
03:47:51 | FromDiscord | <19> how should i approach it if im using a seq instead |
03:48:25 | mipri | you make the assignment and then you change whatever you're using as a cursor |
03:48:38 | mipri | sampleOut[i] = sampleValue; inc i # for example |
03:50:19 | FromDiscord | <19> the i is immutable |
03:50:36 | FromDiscord | <19> in a for loop |
03:50:51 | mipri | I'm not talking about your i |
03:51:11 | mipri | whatever you have, make the assignment and then change your cursor. That's all the C is doing. |
03:56:16 | FromDiscord | <19> sorry, i dont understand, can you explain? https://play.nim-lang.org/#ix=2HDT |
03:57:37 | FromDiscord | <19> c stuff: https://play.nim-lang.org/#ix=2HDV |
03:59:03 | FromDiscord | <Quibono> Audio processing scary |
03:59:49 | FromDiscord | <19> very |
04:01:31 | FromDiscord | <19> C is scarier lol |
04:04:22 | FromDiscord | <Quibono> So you’re setting all the buffers to 600? |
04:04:37 | FromDiscord | <19> no its just a stupid example |
04:05:16 | FromDiscord | <19> my problem is with the something++ |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:06:52 | * | spiderstew_ joined #nim |
04:06:53 | FromDiscord | <19> i have a working c example im just trying to port it over. maybe i should go read some stuff |
04:07:02 | FromDiscord | <19> thanks anyway ❤️ |
04:07:25 | FromDiscord | <Quibono> Well someone besides me can definitely help, I haven’t had to use pointers yet. |
04:07:50 | FromDiscord | <Rika> I understand pointers but have trouble understanding the syntax for them in C |
04:08:21 | * | spiderstew quit (Ping timeout: 272 seconds) |
04:08:39 | FromDiscord | <19> its just incrementing the pointer and then dereferencing it |
04:10:14 | FromDiscord | <Rika> cast[ptr T](cast[int](something)+1)[] |
04:10:18 | FromDiscord | <Rika> replace T with the type |
04:12:51 | mipri | you'll probably be much better off just understanding the C and accomplishing the same task, vs. manually compiling it into Nim |
04:14:15 | FromDiscord | <19> alright, ill give it a shot |
04:15:13 | FromDiscord | <Quibono> What’s the real code do? |
04:15:25 | FromDiscord | <19> sends out a sin wave to the buffer |
04:16:10 | * | narimiran joined #nim |
04:18:46 | FromDiscord | <Rika> A wave full of sins |
04:19:00 | FromDiscord | <19> xD |
04:22:49 | FromDiscord | <iWonderAboutTuatara> hey, what's the equivalent of &ptr in c in nim? |
04:23:08 | FromDiscord | <iWonderAboutTuatara> for example, if I had variable a, what's the nim version of &a? |
04:23:11 | FromDiscord | <Rika> addr a |
04:23:13 | FromDiscord | <Rika> i assume |
04:23:23 | FromDiscord | <19> a.addr |
04:23:27 | FromDiscord | <Rika> same thing |
04:23:33 | FromDiscord | <19> yes |
04:23:46 | FromDiscord | <19> a[] dereferences the points |
04:23:51 | FromDiscord | <19> (edit) "points" => "pointer" |
04:24:42 | FromDiscord | <iWonderAboutTuatara> yeah addr does the job |
04:24:47 | FromDiscord | <iWonderAboutTuatara> actually unsafeaddr does the job |
04:24:58 | FromDiscord | <iWonderAboutTuatara> hopefully doesn't cause too many problems for me |
04:25:00 | FromDiscord | <iWonderAboutTuatara> addr gives an error |
04:25:45 | FromDiscord | <Rika> that means you're getting the pointer to an immutable |
04:26:02 | FromDiscord | <Rika> unsafeaddr doesnt care, because its unsafe |
04:26:02 | Prestige | How should I go about copying an object? I created a new var foo = bar, where bar is an object (not a ref object), but changes to foo seem to also change bar |
04:26:25 | FromDiscord | <Rika> prestige that makes no sense, got code? |
04:26:59 | FromDiscord | <Rika> changes to a ref object inside an object (a) will reflect in both objects (a and b) |
04:27:00 | Prestige | Well it's convoluted, just wanted to make sure I wasn't making an incorrect assumption. Thanks |
04:28:38 | FromDiscord | <InventorMatt> there is a deepcopy proc which may be what you want |
04:31:03 | Prestige | Thanks Matt, that did the trick |
04:31:59 | FromDiscord | <InventorMatt> no problem |
04:32:58 | Prestige | still confused about how = didn't handle this case |
04:34:13 | Prestige | Was attempting to make a copy of `defaultMonitorSettings` shown here at the bottom: https://i.imgur.com/MFrXZV4.png |
04:34:52 | Prestige | since nothing is a ref object, I thought var foo = defaultMonitorSettings, then making changes, would be fine |
04:52:36 | disruptek | assignment is a deep value copy by default, and that includes strings and seqs -- nominal "value types". |
05:08:13 | * | a_chou joined #nim |
05:09:39 | Prestige | ah, thanks disruptek. That exl |
05:09:49 | Prestige | that explains the table |
05:11:41 | Prestige | Well actually. What would happen in this case, should it just be an empty table? When I create a first copy, modify, then create a second and modify that, the first ends up with the same values as the second. |
05:17:32 | FromDiscord | <exelotl> > that means you're getting the pointer to an immutable↵now that `let foo {.importc.}` is a thing I wonder if I should be using that for ROM data in my GBA project |
05:18:13 | FromDiscord | <exelotl> It would make my code uglier though cause I'd have to use unsafeAddr in lots of places where I'm currently using addr |
05:28:09 | FromDiscord | <ElegantBeef> Is that really uglier? 😄 |
05:28:36 | * | thomasross quit (Ping timeout: 240 seconds) |
05:28:40 | FromDiscord | <ElegantBeef> Just use views, problem solved? |
05:30:55 | FromDiscord | <j-james> why doesn't `degToRad()` take ints? |
05:32:57 | FromDiscord | <j-james> just because `rationals` exists? |
05:34:10 | FromDiscord | <exelotl> The input type would be different to the output type which is rare for math functions I guess |
05:35:21 | FromDiscord | <exelotl> That's the main reason I can think of I guess |
05:36:19 | FromDiscord | <j-james> !eval import math; echo cos(degToRad(90.0)) |
05:36:21 | NimBot | 6.123233995736766e-17 |
05:36:34 | FromDiscord | <ElegantBeef> Yea you rarely are going to store degrees as floats |
05:36:37 | FromDiscord | <ElegantBeef> What's wrong? |
05:36:43 | FromDiscord | <ElegantBeef> cos(1) == 0 |
05:37:01 | FromDiscord | <Rika> !eval import math; echo cos(degToRad(90.0)) == 0 |
05:37:02 | FromDiscord | <j-james> !eval import math; echo sin(degToRad(0.0)) |
05:37:04 | NimBot | false |
05:37:05 | NimBot | 0.0 |
05:37:14 | FromDiscord | <j-james> no me gusta |
05:37:27 | FromDiscord | <Rika> false prolly because its the exact == and not the float epsilon == |
05:37:29 | FromDiscord | <Rika> anyway |
05:37:35 | FromDiscord | <Rika> you can make one |
05:37:47 | FromDiscord | <Rika> !eval import math;echo degToRad(90.0) |
05:37:50 | NimBot | 1.570796326794897 |
05:38:04 | FromDiscord | <Rika> i doubt using an int would make tihs more accurate. |
05:38:16 | FromDiscord | <ElegantBeef> `6.12 10 ^-17` is 0 |
05:38:27 | FromDiscord | <Rika> essentially 0 |
05:38:28 | FromDiscord | <exelotl> Yes, my code doesn't have any unsafeAddr currently, and I don't wanna have to type so much for it. I also just don't like the name unsafeAddr because addr is already unsafe xD |
05:38:39 | FromDiscord | <ElegantBeef> So then views? |
05:38:41 | FromDiscord | <Rika> addr isnt really unsafe is it |
05:39:01 | FromDiscord | <ElegantBeef> I mean it's an umanaged reference afaik, it's unsafe |
05:39:37 | FromDiscord | <exelotl> Oh trust me I can't wait to use views but I don't think they're stable enough yet |
05:39:43 | FromDiscord | <j-james> !eval import math; echo cos(PI/2) |
05:39:46 | NimBot | 6.123233995736766e-17 |
05:40:03 | FromDiscord | <Rika> dude you wont get any closer because you use ints |
05:40:15 | FromDiscord | <ElegantBeef> Unless you make a LUT that uses degrees in ints 😄 |
05:40:20 | FromDiscord | <Rika> have fun. |
05:40:47 | FromDiscord | <j-james> that's just a pain, though |
05:41:13 | FromDiscord | <Rika> well you're gonna see this everywhere |
05:41:22 | FromDiscord | <Rika> are you the python guy |
05:41:25 | FromDiscord | <ElegantBeef> in floats nothing is exact! |
05:41:32 | FromDiscord | <j-james> i am not the python guy |
05:41:34 | FromDiscord | <Rika> @ElegantBeef 0.2 is exact isnt it |
05:41:46 | FromDiscord | <Rika> 0 is exact as well |
05:42:00 | FromDiscord | <ElegantBeef> multiple things can be, but the point is you never pretend like it is |
05:42:17 | FromDiscord | <Rika> a good amount of integer values in floats are exact as well |
05:42:19 | FromDiscord | <ElegantBeef> you assume you never get the exact value and accept within a range |
05:42:23 | FromDiscord | <Rika> yeah |
05:42:31 | FromDiscord | <Rika> computations in floats are rarely exact |
05:42:54 | FromDiscord | <j-james> huh, interesting |
05:43:08 | FromDiscord | <Rika> programming languages that have exact computations are either using a slower decimal/rational implementation or hiding the fact from you |
05:43:41 | FromDiscord | <Rika> or maybe theyre just using float512s or whatever i dont fucking know |
05:44:03 | FromDiscord | <Rika> man, imagine 64 byte floats... |
05:51:09 | disruptek | addr is unsafe, yes. unsafeAddr is silly. |
06:01:06 | disruptek | zevv: so i'm finally looking at fixing the bugs blocking cps. |
06:02:31 | disruptek | what's really weird is, some of this code makes it to codegen without getting sem'd. |
06:09:15 | FromDiscord | <Rebel> should work on my bugs instead 😛 well I guess not even bugs just woes |
06:13:06 | * | a_chou quit (Remote host closed the connection) |
06:35:25 | * | abm quit (Read error: Connection reset by peer) |
06:41:58 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:39:44 | * | habamax joined #nim |
07:47:11 | * | letto quit (Quit: Konversation terminated!) |
07:47:52 | * | letto joined #nim |
07:50:24 | Zevv | http://zevv.nl/div/ferry.png |
07:50:49 | FromDiscord | <Rika> looks like a road system ngl |
07:52:09 | Zevv | disruptek: so who do you ask when digging into that stuff |
07:56:30 | narimiran | Zevv: help this sleepy brain: how to do this in one line? `var pos = new Point; pos[] = (0, 0)` (Point is a tuple) |
08:13:16 | * | letto quit (Quit: Konversation terminated!) |
08:14:59 | * | letto joined #nim |
08:16:20 | Zevv | don't tuple kids, it's baaad for you, mkaaay |
08:16:31 | narimiran | yeah yeah yeah |
08:16:38 | Zevv | field1: ? |
08:16:40 | Zevv | I don't know |
08:16:45 | Zevv | :) |
08:30:49 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
08:32:19 | * | ehmry joined #nim |
08:35:41 | FromDiscord | <ElegantBeef> Any thoughts on making the header of the nim modules in docs the import path? |
08:36:02 | FromDiscord | <ElegantBeef> so for instance `since` would say `std/private/since` at the very top of the page? |
08:36:20 | narimiran | maybe not as a title, but definitely should be there |
08:41:57 | FromDiscord | <ElegantBeef> Yea a subtitle would be fine aswell |
08:42:19 | FromDiscord | <ElegantBeef> Especially with modules that have to be imported with `std` |
08:48:58 | cmc[m] | <FromDiscord "<mratsim> so it could use FFMpeg"> Thanks!!! As is customary on IRC (whoops) I didn't state my requirements up front. Liberal license, small size (1 decoder), compilable to linux, windows, osx, ios, android and wasm. The only thing I found that fit the bill is a rough take on webm by @yglukhov, but I couldn't get that one to build. hence the AV1 wrapper idea. So what I'm wondering if anyone is working under the |
08:48:58 | cmc[m] | radar on anything |
08:49:32 | FromDiscord | <mratsim> I really hate getting typed AST in my untyped macro due to generics, ... so annoying. |
08:56:14 | ForumUpdaterBot | New thread by Timothee: How to make openbsd CI work on your nim fork?, see https://forum.nim-lang.org/t/7244 |
09:03:06 | FromDiscord | <kenran> sent a code paste, see https://play.nim-lang.org/#ix=2HFK |
09:03:17 | FromDiscord | <kenran> (edit) |
09:03:38 | * | kenran joined #nim |
09:04:25 | FromDiscord | <kenran> I don't really want to make the `x` a global to write a `Sighandler` using it. |
09:38:09 | * | spiderstew_ quit (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
09:38:24 | * | spiderstew joined #nim |
09:43:23 | Zevv | narimiran: I brought the lack of a "new" constructor up a few times. |
09:43:35 | Zevv | I always get a cryptic answer from people that does something like that, but not nice |
09:46:54 | Zevv | narimiran: https://play.nim-lang.org/#ix=2HFU |
09:47:06 | Zevv | Pleasy lobby for putting this new[] in the stdlib |
09:48:01 | FromDiscord | <ElegantBeef> I guess it's marginally better than `new Point((3, 4))` |
09:48:16 | FromDiscord | <ElegantBeef> or `new (3, 4).Point` 😄 |
09:48:50 | narimiran | Zevv: we'll get the same answer as always: "don't use tuples" |
09:49:15 | FromDiscord | <ElegantBeef> Let's be honest though tuples are throwaway object times |
09:49:25 | FromDiscord | <ElegantBeef> (edit) "times" => "types" |
09:50:31 | FromDiscord | <ElegantBeef> And by that i mean you should throw them away as soon as possible |
09:53:23 | Zevv | its not for tuples |
09:53:35 | Zevv | its a generic constructor for ref objects |
09:53:56 | Zevv | new Thing(foo: bar, this:that) |
09:54:32 | FromDiscord | <ElegantBeef> Yea i was dumb and didnt actually test what i said |
09:56:19 | ForumUpdaterBot | New thread by Spamsalty: A simple DB migration module for Nim, see https://forum.nim-lang.org/t/7245 |
10:06:55 | FromDiscord | <sealmove> Simple question: I have a unittest (nim module) that needs to open a file from the same folder, so I use a relative path for the file. When I run the test outside of the folder (`nim c -r tests/tester.nim`) the path is relative to current dir so the file doesn't open. What's a common solution? |
10:09:35 | mipri | switch("path", "$projectDir/../src") # in a config.nims file in the tests directory |
10:11:15 | mipri | ah, do you mean not a module, but a file you're reading? |
10:11:22 | mipri | I do that relative to the project dir |
10:11:56 | mipri | that means that tests would fail if run from within tests, but the project dir's the right working directory anyway. |
10:12:39 | FromDiscord | <sealmove> oh ok I see. so there is no neat way to make it work from any folder? |
10:13:11 | mipri | *shrug*, there might be |
10:13:46 | mipri | I have some extra tests that require files that aren't necessarily in the repo, so they run with a separate nimble task |
10:14:05 | mipri | that sort of thing requires the project dir as the working directory anyway |
10:15:38 | mipri | I don't know what the scenario is where this is a problem, but you can do things like ( cd ..; nimble test ) from the tests directory. the parens are part of the command there, it's spawning a subshell to change dirs and run the command |
10:20:02 | FromDiscord | <Vindaar> pretty ships: https://github.com/Vindaar/AdventOfCode2020/raw/master/day12/out/ship_movement_part2.png |
10:22:21 | ForumUpdaterBot | New thread by Mantielero: FFI - simplifying, see https://forum.nim-lang.org/t/7246 |
10:48:33 | * | Vladar joined #nim |
10:59:59 | FromDiscord | <sealmove> ehhh, unittest and files don't play well together |
11:00:58 | mipri | I don't have a problems using files with unittest, provided that the CWD is set. Which it has to be if you're running tests with nimble, since you have to be in the directory the .nimble file to do that. |
11:01:44 | FromDiscord | <sealmove> opening file works file, but for some reason now data are not written to a file |
11:02:00 | FromDiscord | <sealmove> i am opening it `setup` and have `close(file)` at teardown |
11:02:21 | FromDiscord | <sealmove> and writing data to it within a `test` |
11:02:33 | FromDiscord | <sealmove> if i put everything in `test` it works |
11:03:01 | mipri | yeah, that makes sense. |
11:03:04 | FromDiscord | <sealmove> what am I missing? |
11:04:14 | FromDiscord | <sealmove> oh wow lol, teardown runs after every test? |
11:04:31 | FromDiscord | <sealmove> my bad... |
11:04:35 | mipri | that the test harness breaks what you're trying to do. That might be a fixable feature, but e.g. Rust will try to run tests in parallel for speed, which is a nice thing to have that also would interfere with what you're trying to do. |
11:07:32 | mipri | another nice feature that would interfere might be running tests in a subprocess so that crashes won't prevent further testing. Right now the tests will stop with something like segfault |
11:07:50 | FromDiscord | <sealmove> yeah, I've made a small tool for this |
11:08:10 | FromDiscord | <sealmove> https://github.com/sealmove/testify |
11:09:21 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
11:22:22 | * | krux02 joined #nim |
11:34:14 | FromDiscord | <asie> i tried to grep through the Nim manual but was unsuccessful; what's the difference between the `var` and `out` type modifiers in procedure parameters, if any? |
11:36:14 | FromDiscord | <mratsim> `out` is new and i don't know how to use them :p |
11:36:33 | FromDiscord | <mratsim> I think it's related to being able to omit them and use those out of place |
11:37:46 | FromDiscord | <Rika> Out is also pretty underutilized I believe |
11:38:49 | FromDiscord | <mratsim> isn't it from 1.4? |
11:41:33 | FromDiscord | <haxscramper> The only place I've seen `out` mentioned is experimental manual for covariance - https://nim-lang.org/docs/manual_experimental.html#covariance |
11:41:51 | FromDiscord | <asie> experimenting with porting over a codebase from Pascal to Nim - by hand, as pas2nim doesn't seem to support with-statements and the codebase is pretty much made out of them; also seeking to give the language another go that way, last time was 0.18.x |
11:42:00 | FromDiscord | <asie> (edit) "them;" => "them (but it's not a big codebase);" |
11:42:29 | FromDiscord | <mratsim> I think the covariance out is different from function parameter out no? |
11:42:41 | FromDiscord | <mratsim> or maybe the function parameter out only lives in a RFC |
11:43:28 | FromDiscord | <haxscramper> Oh, yeah, I actually missed `out T` in manual, but it doesn't say much about the difference |
11:43:38 | FromDiscord | <haxscramper> difference between `var T` and `out T` |
11:45:10 | FromDiscord | <mratsim> I think I should use out T for my big int library |
11:45:16 | FromDiscord | <mratsim> no idea where it's documented though |
11:45:36 | FromDiscord | <sealmove> if I have an uint64, is there an easy way to operate on a specific byte? |
11:46:44 | FromDiscord | <sealmove> with some kind of casting and then index the byte? |
11:47:03 | FromDiscord | <sealmove> i am thinking casting to array[byte], is it possible? |
11:49:19 | FromDiscord | <asie> I assume there's no facility in Nim for fixed-maximum-length strings, and I'll have to handle the trimming side effects myself? |
11:50:07 | FromDiscord | <asie> to explain myself - porting a 1992 game engine whose community demands near-100% compatibility with the original DOS source code... including quirks like this |
11:51:41 | * | tane joined #nim |
11:55:59 | FromDiscord | <haxscramper> Do you know what `out T` does for procs? I searched manual but doesn't seem to find anything besides `"Overloading based on 'var T' / 'out T'"` section. And example from it just segfaults compiler |
11:57:54 | FromDiscord | <haxscramper> No, nothing that I know of. But it should be relatively simple (in theory) to do `type FixedString = distinct string` and implement length checking (if maximal size is a global) |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:09 | * | PMunch joined #nim |
12:06:35 | * | supakeen joined #nim |
12:07:31 | PMunch | Found some time to stream todays AoC |
12:07:41 | PMunch | So will go live shortly :) |
12:08:31 | FromDiscord | <mratsim> @haxscramper I think proc foo[T](a: T, result: out T) can be called as either "let r = foo(a)" or "foo(a, r)". |
12:10:29 | PMunch | Stream should be live now: https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=OiqJaXOrmb8 |
12:11:49 | FromDiscord | <haxscramper> Looks really useful for C wrappers maybe, though `proc hasOut(a: int, b: out int) = b = a` already crashes compiler, so no chances of testing if this is really how it works |
12:13:59 | * | natrys joined #nim |
12:19:31 | FromDiscord | <Recruit_main707> fuck, now i need to use this, it is perfect for my usecase |
12:21:02 | FromDiscord | <m0nsta> hi all. evening. i want a type to be an array of things. but i'd know the length later at run time. when it's made tho, its length would never change. how do i express this ? |
12:21:18 | mipri | seq[T] |
12:21:19 | FromDiscord | <m0nsta> one way is make it a seq and assign it to a let variable |
12:22:00 | FromDiscord | <m0nsta> mipri: say i know it'll be a seq[float] |
12:22:25 | FromDiscord | <m0nsta> but i want say, changeable lengths different times |
12:22:40 | FromDiscord | <m0nsta> i can newSeq[float](len) |
12:22:54 | FromDiscord | <m0nsta> but now i want that seq cant be added or popped from |
12:23:07 | mipri | that's what I'd do. You get length information too late to benefit much from it. At least with this you aren't wasting more space than seq overhead |
12:23:33 | FromDiscord | <m0nsta> sure, but how do i kind of lock it? |
12:23:45 | FromDiscord | <m0nsta> cant add more elements to it. cant remove elements from it |
12:24:10 | mipri | *shrug*, hide that it's a seq. |
12:24:27 | FromDiscord | <m0nsta> ~.^ |
12:24:27 | disbot | no footnotes for `.^`. 🙁 |
12:24:39 | FromDiscord | <m0nsta> badbot |
12:25:30 | FromDiscord | <m0nsta> making it let does the trick |
12:25:55 | FromDiscord | <m0nsta> was wondering if there's some other / more semantic way this is done ? |
12:26:19 | * | natrys quit (Ping timeout: 246 seconds) |
12:26:59 | mipri | 'let' is generally how you make something immutable. The other way is information hiding. |
12:27:12 | FromDiscord | <m0nsta> how do i do the latter ? |
12:27:22 | mipri | that's not a language feature, it's just something you do. |
12:27:35 | mipri | that's what I meant by "hide that it's a seq" |
12:27:38 | FromDiscord | <Recruit_main707> wasnt there a way to allocate something on the stack? was it alloca? |
12:27:39 | FromDiscord | <m0nsta> lol. gotcha |
12:27:49 | FromDiscord | <m0nsta> encapsulation and likes |
12:27:50 | mipri | 'distinct' is a language feature that might help |
12:28:15 | FromDiscord | <m0nsta> nah, i need to implement everything for the type after that |
12:28:23 | mipri | you don't though |
12:28:41 | mipri | in your code that actually modifies anything, you can have it as a seq |
12:29:30 | FromDiscord | <m0nsta> not sure i get it |
12:29:34 | narimiran | PMunch: north and south: y, not x |
12:29:36 | mipri | well I was thinking you'd only want `[]` or something. Yeah there are other procs you might want to borrow. |
12:29:58 | FromDiscord | <m0nsta> i cant even `$` it without telling it how |
12:30:29 | FromDiscord | <m0nsta> i guess let it is then for now ? |
12:31:03 | mipri | 'let' is how this is done. |
12:32:52 | mipri | is what you were wanting something like a .freeze and .thaw for containers, that would throw an exception on mutation when frozen? |
12:33:07 | FromDiscord | <lqdev> @m0nsta alternatively you can write your own non-resizable seq using alloc and dealloc |
12:33:42 | FromDiscord | <m0nsta> i see |
12:36:59 | * | natrys joined #nim |
12:41:15 | FromDiscord | <Recruit_main707> @m0nsta maybe this is what you need, but i am not 100% sure https://youtu.be/71BLZwRGUJE?t=958 |
12:41:33 | FromDiscord | <Recruit_main707> you can ignore the rest of the vid |
12:44:26 | * | kenran quit (Quit: leaving) |
12:48:55 | * | neutralsecond joined #nim |
12:54:07 | * | neutralsecond quit (Remote host closed the connection) |
12:57:55 | FromDiscord | <mratsim> @Recruit_main707 yes alloca, need to wrap it yourself: https://github.com/mratsim/weave/blob/master/weave/memory/allocs.nim#L90-L99 |
12:58:31 | FromDiscord | <Recruit_main707> i know, i have used it before, i just dont know if thats what he is asking for |
12:58:31 | FromDiscord | <mratsim> the template is very important or the alloca call will be collected when the proc exit :p |
12:58:49 | FromDiscord | <Recruit_main707> ah |
12:58:56 | FromDiscord | <Recruit_main707> good to know :) |
13:03:03 | * | muffindrake quit (Quit: muffindrake) |
13:06:08 | FromDiscord | <m0nsta> not quite, but it was nice to know that can be done |
13:10:13 | FromDiscord | <m0nsta> another noob Q |
13:10:25 | FromDiscord | <m0nsta> if i want a type that can only take values -1 or 1 |
13:10:39 | FromDiscord | <m0nsta> normally i do range[0..1] |
13:10:43 | * | rockcavera quit (Remote host closed the connection) |
13:10:46 | FromDiscord | <m0nsta> doesnt quite work out here |
13:11:18 | mipri | what do you mean, it doesn't quite work? what doesn't work about it? |
13:11:27 | FromDiscord | <m0nsta> it inclues 0 |
13:11:34 | mipri | it doesn't just include it, it's *only* that or 1 |
13:12:02 | FromDiscord | <m0nsta> sure, but i am looking now for -1 or 1 |
13:12:05 | mipri | if you meant range[-1..1], yeah you can't have gaps in it |
13:12:13 | FromDiscord | <m0nsta> yea, that |
13:12:47 | FromDiscord | <m0nsta> sent a code paste, see https://play.nim-lang.org/#ix=2HHa |
13:12:57 | FromDiscord | <m0nsta> but there's gotta be a better way for this |
13:13:20 | mipri | no, that's what I'd go with. |
13:13:47 | mipri | assuming that v1 and v2 are meaningful, and not just you needing names there |
13:14:03 | FromDiscord | <m0nsta> i could make them meaningful |
13:14:11 | FromDiscord | <m0nsta> but -1 or 1 work just fine |
13:15:51 | FromDiscord | <m0nsta> and id rather have numbers than do `ord(value)` |
13:16:15 | FromDiscord | <m0nsta> or `char(value)` |
13:16:38 | FromDiscord | <m0nsta> which ever one that is that gives me the enum value. i keep forgetting : P |
13:17:37 | mipri | Lol(-1) vs. v1.int |
13:17:46 | mipri | or v1.ord, indeed |
13:19:45 | PMunch | @m0nsta, sounds like an enum o me |
13:25:28 | FromDiscord | <m0nsta> PMunch: ? |
13:25:52 | PMunch | A value that can only be one of a set of discreet values, that is an enum |
13:26:19 | FromDiscord | <m0nsta> but i need them for their actual int values |
13:26:38 | FromDiscord | <m0nsta> they'll be matrix multiplied and stuff |
13:26:51 | PMunch | Well it's easy to assign custom values to an enum |
13:27:00 | FromDiscord | <m0nsta> sure |
13:27:00 | PMunch | And convert between them |
13:27:16 | FromDiscord | <m0nsta> ord and char right |
13:27:29 | mipri | just .typename is a safe option |
13:27:56 | FromDiscord | <m0nsta> not sure i understand mipri: |
13:28:11 | mipri | v1.int |
13:28:16 | mipri | 'int' is the name of the type you want |
13:28:48 | mipri | !eval echo 500.int8 |
13:28:50 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: 500 can't be converted to int8 |
13:29:02 | mipri | !eval echo cast[int8](500) |
13:29:05 | NimBot | -12 |
13:29:17 | PMunch | https://play.nim-lang.org/#ix=2HHe |
13:29:47 | mipri | to be clear, the error is a feature: it didn't let you make the bad version |
13:30:41 | mipri | PMunch: no error if you pass 0 though |
13:30:52 | PMunch | Really? |
13:31:03 | mipri | https://play.nim-lang.org/#ix=2HHf |
13:31:05 | PMunch | Huh.. |
13:31:06 | FromDiscord | <Recruit_main707> how can i get the current directory of a file (that is imported by the main file)? |
13:31:23 | PMunch | Well that's a shame.. |
13:34:28 | mipri | what it's sounding like I'd actually do, in the code m0nsta's wanting to write, is just: assert oneThing in [-1,1] |
13:34:44 | FromDiscord | <m0nsta> yea, came to say what mipri: said |
13:34:51 | FromDiscord | <m0nsta> doesnt error with 0 |
13:35:02 | FromDiscord | <m0nsta> isnt that a bug ? |
13:35:37 | FromDiscord | <sealmove> hey PMunch, PR is ready to merge 🙂 |
13:35:53 | PMunch | Yeah I saw you pushed that :) |
13:35:58 | PMunch | But I haven't had time to look at it yet |
13:37:30 | FromDiscord | <sealmove> np, one thing, do you mind if I put my name as co-author in the license (might help if I use binaryparse in my thesis) |
13:37:51 | FromDiscord | <sealmove> also I am writing proper test suites |
13:38:07 | PMunch | Oh, not at all! |
13:38:12 | PMunch | Go ahead :) |
13:38:15 | FromDiscord | <sealmove> oh nice thanks ❤️ |
13:38:52 | PMunch | I mean its MIT licensed anyways, so the name on the license doesn't really matter much |
13:39:23 | FromDiscord | <sealmove> I know, just for the looks, it will be nice if I use it in my thesis and it has my name on it |
13:40:29 | FromDiscord | <sealmove> now I am trying to make serialization work with reverse bit-endianness, it's hell >_< |
13:40:46 | FromDiscord | <sealmove> the algorithm is nowhere online |
13:42:10 | PMunch | Haha, and now you know why it didn't already support that :P |
13:42:16 | PMunch | What's your thesis about by the way? |
13:42:44 | FromDiscord | <sealmove> forensics |
13:45:07 | PMunch | Oh cool |
13:47:21 | FromDiscord | <sealmove> The reason I am motivated to work on DSLs for describing binary formats is that forensics professionals use ad-hoc tools. Each tool vary severely in quality, platform, performance |
13:47:52 | FromDiscord | <zetashift> that sounds really cool |
13:48:18 | PMunch | Yeah my initial reason for writing binaryparse was that I was parsing binary satellite data for work, and it was a massive pain |
13:48:44 | PMunch | Then I wrote the generation part of it so that I could generate mock data to test our systems |
13:49:11 | FromDiscord | <sealmove> In your case a parser did not even exist. My initial idea was to rewrite existing parser in a easier-to-maintain way. |
13:49:44 | PMunch | Haha, binaryparse definitely needs that :P |
13:50:28 | FromDiscord | <sealmove> i mean generate parsers instead of hand-writing them 😛 |
13:50:38 | PMunch | The great part about binaryparse vs. pretty much every other such format is that it's all just code. If you come across a part of the parsing that is tricky (e.g. when I recently came across the DNS "compression" scheme for names) you can just hook in a little piece of custom code and it all just works |
13:51:09 | FromDiscord | <sealmove> that's true, it's really a killer feature, you are right |
13:51:35 | FromDiscord | <sealmove> i am not sure if construct can do this |
13:51:39 | PMunch | This means that it can read pretty much whatever binary format you can think of, without having binaryparse being a huge complex behemoth |
13:52:00 | PMunch | That's partially why I've wanted the features you're adding to be pluggable as well |
13:52:20 | PMunch | It's easy to add the features you need right now, without thinking about all the other similar feature that someone else might want in the future |
13:52:37 | FromDiscord | <sealmove> yes you are right, good call |
13:53:35 | FromDiscord | <mratsim> I have a challenge for you then 😉 |
13:53:53 | PMunch | For me? |
13:54:55 | FromDiscord | <mratsim> https://github.com/ethereum/eth2.0-specs/blob/dev/ssz/simple-serialize.md |
13:55:11 | FromDiscord | <mratsim> The binary serialization format of Ethereum |
14:01:04 | PMunch | I mean, it should be doable looking at the spec |
14:01:19 | PMunch | But I don't really have the time to look into that, at least not right now |
14:01:25 | PMunch | Speaking of which, I'm off |
14:01:27 | * | PMunch quit (Quit: leaving) |
14:02:11 | * | lritter joined #nim |
14:19:46 | FromDiscord | <zetashift> `func getRows[R, _](g: Grid[R, _]): array[R, Cell] = discard` is this a smart thing to do to get the all the rows of a Grid that consists of array[R, array[C, T]] |
14:27:33 | * | beck joined #nim |
14:27:37 | beck | wagwan |
14:27:56 | * | waleee-cl joined #nim |
14:30:04 | FromDiscord | <zetashift> heya! |
14:57:14 | FromDiscord | <hesman> sent a long message, see http://ix.io/2HHG |
14:57:27 | FromDiscord | <hesman> (edit) "http://ix.io/2HHG" => "http://ix.io/2HHH" |
15:02:25 | * | ^Q-Master^ quit (Ping timeout: 240 seconds) |
15:06:34 | mipri | the .lines iterator doesn't give you the file, so you've nothing to read from. You have to either use something else entirely, like readFile(reg_file).strip.splitLines, or set variables within the loop that ensure what you want done happens later. |
15:11:06 | ForumUpdaterBot | New thread by Archnim: Create my own language in Nim, see https://forum.nim-lang.org/t/7247 |
15:13:42 | FromDiscord | <shadow.> hmm |
15:13:52 | FromDiscord | <shadow.> > (482, 3) Error: expression ' |
15:14:00 | FromDiscord | <shadow.> line 482 |
15:14:01 | FromDiscord | <shadow.> ` template rotateRight(deq: var Deque, n = 1): untyped =` |
15:14:05 | FromDiscord | <shadow.> line 481 |
15:14:05 | FromDiscord | <shadow.> `since: (1, 5, 1):` |
15:14:10 | FromDiscord | <shadow.> anything stand out that could be causing that? |
15:15:45 | FromDiscord | <shadow.> confused because there isn't an apostrophe in sight |
15:17:03 | mipri | since: (1, 5, 1): |
15:17:08 | mipri | line 481 |
15:17:24 | FromDiscord | <shadow.> what's the issue with it? |
15:17:58 | mipri | why do you think that's correct? |
15:18:10 | mipri | wouldn't a reason to think it's correct be, that you've looked at an example of it used elsewhere? |
15:18:18 | FromDiscord | <shadow.> reviewer on git said to do that to annotate the template |
15:18:21 | FromDiscord | <shadow.> since i couldn't use it as a pragma |
15:18:40 | FromDiscord | <shadow.> unless this doesnt mean what i think it means? https://media.discordapp.net/attachments/371759389889003532/787337630806704178/unknown.png |
15:18:41 | FromDiscord | <shadow.> im not sure |
15:18:52 | mipri | ah, right. nevermind that then |
15:19:24 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/787337814655107092/unknown.png |
15:19:26 | FromDiscord | <shadow.> there was no message |
15:19:36 | FromDiscord | <shadow.> so i wasn't sure if he was telling me to do that or |
15:19:36 | FromDiscord | <shadow.> idk |
15:20:08 | mipri | it's not a quote in your code that's being complained about though |
15:20:18 | mipri | it's the error that's quoting your code |
15:20:24 | FromDiscord | <shadow.> ahh i see |
15:20:46 | FromDiscord | <shadow.> hm |
15:20:52 | mipri | I still don't like that since: thing |
15:21:00 | mipri | the two colons are very weird |
15:21:04 | FromDiscord | <shadow.> yeah idk |
15:21:10 | FromDiscord | <shadow.> but you cant use the pragma on a template |
15:21:14 | FromDiscord | <shadow.> and he commented that |
15:21:20 | FromDiscord | <shadow.> so im assuming its correct |
15:22:12 | mipri | he commented that in IRC? |
15:22:26 | FromDiscord | <shadow.> on the pr |
15:22:27 | mipri | https://nim-lang.org/docs/manual.html#pragmas-line-pragma |
15:22:38 | mipri | there's an example there of a pragma that's used as a block |
15:23:09 | FromDiscord | <shadow.> ahh ok |
15:23:16 | FromDiscord | <shadow.> do you think that would work on a template? |
15:23:46 | mipri | that's already what you're attempting to do isn't it? |
15:23:49 | FromDiscord | <Rika> probably |
15:23:50 | FromDiscord | <shadow.> fair enough |
15:24:05 | FromDiscord | <shadow.> alr i pushed |
15:24:07 | FromDiscord | <Rika> no, its a different syntax, you're still missing the {..} arent you |
15:24:52 | FromDiscord | <shadow.> invalid pragma |
15:24:58 | FromDiscord | <shadow.> `{.since: (1, 5, 1).}:` |
15:25:00 | FromDiscord | <shadow.> i did that? |
15:25:51 | FromDiscord | <shadow.> odd |
15:25:55 | FromDiscord | <shadow.> ima just ask on the pr lol |
15:26:00 | mipri | ok, yeah that's wrong too |
15:26:06 | FromDiscord | <shadow.> since he suggested it there has to be at least some way to do it |
15:26:17 | mipri | there are examples in stdlib, just needed to find them |
15:26:22 | FromDiscord | <shadow.> ahh ok |
15:26:24 | beck | wtf, scanf, "$w$i" doesn't work with "F10". Am I missing something? |
15:26:37 | FromDiscord | <shadow.> code? |
15:26:42 | mipri | F10 is one whole $w |
15:26:48 | FromDiscord | <shadow.> oh true lol |
15:26:56 | beck | Ah fuck of course |
15:27:10 | mipri | https://github.com/nim-lang/Nim/blob/devel/lib/pure/times.nim#L872 <- there you go, valid since syntax |
15:27:13 | beck | Thanks I'll go back to RTFM'ing properly |
15:27:25 | FromDiscord | <shadow.> ahh ok |
15:27:34 | FromDiscord | <shadow.> and you think that would work on a template lmao? |
15:27:53 | mipri | yeah it definitely would |
15:28:04 | FromDiscord | <shadow.> kk |
15:28:22 | mipri | https://github.com/nim-lang/Nim/blob/devel/lib/std/private/since.nim <- this is how it's implemented after all |
15:29:15 | FromDiscord | <shadow.> fair enough |
15:29:20 | FromDiscord | <shadow.> kk pushed |
15:29:21 | FromDiscord | <shadow.> thanks |
15:29:46 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/787340428265521152/unknown.png |
15:29:47 | FromDiscord | <shadow.> lol |
15:30:04 | FromDiscord | <shadow.> local test worked so fingers crossed |
15:32:50 | FromDiscord | <tomck> hmm, are there queues in the stdlib? I see a `queues` module, but it doesn't seemt o be in the current version of nim? |
15:33:13 | FromDiscord | <lqdev> deques |
15:33:57 | FromDiscord | <tomck> ah |
15:34:05 | FromDiscord | <tomck> are these implemented as a ring-buffer? |
15:34:18 | Zevv | the implementation is based on seqs |
15:34:42 | FromDiscord | <tomck> yeah, but what does that mean |
15:34:49 | FromDiscord | <lqdev> who knows |
15:34:59 | Zevv | tomck: look in the source of deques.nim |
15:35:01 | Zevv | it's pretty trivial |
15:35:06 | FromDiscord | <lqdev> https://media.discordapp.net/attachments/371759389889003532/787341766680248330/unknown.png |
15:35:09 | FromDiscord | <lqdev> this is what they are. |
15:35:50 | FromDiscord | <tomck> ok cool, ty |
15:36:28 | Zevv | It's one block of memory, so realize that growing can cause underlying copying |
15:36:48 | FromDiscord | <shadow.> yeah |
15:36:52 | Zevv | so if you can, choose your initialSize wisely |
15:36:59 | FromDiscord | <shadow.> it has an internal seq that is >= the deque's size |
15:37:04 | FromDiscord | <shadow.> and it just has a head and tail index |
15:37:24 | FromDiscord | <shadow.> allows it to have O(1) head and tail push / pop |
15:37:57 | FromDiscord | <shadow.> mipri still invalid pragma somehow- |
15:38:13 | * | Q-Master joined #nim |
15:38:14 | FromDiscord | <shadow.> > deques.nim(481, 8) Error: invalid pragma: since: (1, 5, 1) |
15:38:25 | FromDiscord | <shadow.> nvm |
15:38:27 | mipri | you have to import it |
15:38:34 | FromDiscord | <shadow.> nah nvm it was like |
15:38:36 | FromDiscord | <shadow.> not loading the page |
15:38:42 | FromDiscord | <shadow.> checks r still undergoing |
15:38:46 | FromDiscord | <ajusa> how do I get the name of the logged in user? Does nim have anything for this or do I need to use the Win32 API? |
15:38:59 | FromDiscord | <shadow.> ask the machine politely |
15:39:35 | FromDiscord | <shadow.> i mean you can take a look in `winim` but there's probably another way to do it |
15:39:43 | FromDiscord | <shadow.> i'm going to assume you're talking about windows since yk you mentioned the api |
15:40:12 | FromDiscord | <ajusa> well I want to do it in a cross platform manner. wondering if nim already wrapped it or if I need to write the cross platform bit |
15:40:18 | FromDiscord | <shadow.> ohh i see |
15:40:37 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=2HI8 |
15:40:50 | FromDiscord | <shadow.> ~ninp |
15:40:51 | disbot | ninp: 11nim is not python!! |
15:41:10 | FromDiscord | <tomck> i'm 99% sure that won't be wrapped in nim, possibly implemented by a 3rd party library, but afaik that functionality is pretty niche |
15:41:21 | FromDiscord | <tomck> you're better off looking for a C wrapper & wrapping that |
15:41:38 | FromDiscord | <ajusa> alright, just wanted to check I wasn't missing anything. Thanks, I'll wrap something to get that! |
15:42:08 | FromDiscord | <shadow.> if you know how to do it on unix/mac then for windows im sure winapi has it |
15:42:53 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HIc |
15:42:54 | FromDiscord | <shadow.> should work |
15:45:33 | FromDiscord | <ajusa> https://github.com/tanpero/getUserName/blob/master/src/getUserName.cc↵I think I'll just rewrite this in Nim tbh, seems like it is pretty simple |
15:57:47 | * | kenran joined #nim |
15:57:55 | * | kenran quit (Client Quit) |
15:58:42 | * | kenran joined #nim |
16:00:15 | * | kenran quit (Client Quit) |
16:00:57 | * | kenran joined #nim |
16:12:04 | FromDiscord | <pietroppeter> I was using this workaround based on os.getHomeDir (which has separate linux/windows implementation) but the linked cpp seems more solid: `import os; echo getHomeDir().splitPath.head.splitPath.tail` |
16:12:54 | FromDiscord | <pietroppeter> !eval import os; echo getHomeDir().splitPath.head.splitPath.tail |
16:12:57 | NimBot | <no output> |
16:13:37 | FromDiscord | <pietroppeter> yeah, exactly... works on my local windows though and I kind of expect to work on a desktop linux |
16:17:01 | FromDiscord | <pietroppeter> python getpass.getuser https://docs.python.org/3/library/getpass.html : checks a few env variables, then tries to fall back to pwd module if supported, otherwise fails source: https://github.com/python/cpython/blob/3.9/Lib/getpass.py |
16:18:32 | FromDiscord | <pietroppeter> (pwd available only on Unix: https://docs.python.org/3/library/pwd.html) |
16:21:46 | * | astronavt quit (Quit: ...) |
16:23:20 | * | astronavt joined #nim |
16:25:09 | * | astronavt quit (Remote host closed the connection) |
16:25:41 | FromDiscord | <pietroppeter> this is taken from python.getPass.getUser in nim (with no pwd fallback and no raising error): https://play.nim-lang.org/#ix=2HIA |
16:25:49 | * | astronavt joined #nim |
16:25:53 | * | mika_ joined #nim |
16:25:58 | FromDiscord | <pietroppeter> I guess I like this better than the one I had |
16:29:06 | * | Q-Master quit (Ping timeout: 265 seconds) |
16:46:59 | * | mika_ quit (Ping timeout: 265 seconds) |
16:55:50 | * | hmmm joined #nim |
16:56:41 | * | Q-Master joined #nim |
16:58:36 | hmmm | my current project is refactoring nim tutorial (part I) in disruptesque |
16:58:37 | hmmm | :o |
17:05:32 | disruptek | say what |
17:09:19 | hmmm | wanna see a preview? |
17:09:29 | disruptek | is it NSFW? |
17:09:40 | hmmm | it's disruptesque |
17:09:41 | hmmm | so yes |
17:09:48 | disruptek | yes. |
17:10:51 | disruptek | do you wanna show a preview? |
17:10:58 | disruptek | or were you just teasing us? |
17:12:31 | * | mika_ joined #nim |
17:12:32 | hmmm | wait man I'm cleaning it up for pretty print |
17:12:43 | hmmm | disruptesque do not allow for petty grammar misstakes |
17:20:26 | hmmm | https://github.com/hmmm-the-nimion/A-tutorial-for-a-more-civilized-era/blob/main/README.md |
17:21:08 | FromDiscord | <Quibono> Disruptek I see you’ve got a style guide, any chance we can get a linter? |
17:21:16 | disruptek | "it's the gentle hand that stirs the dim candle" |
17:21:20 | disruptek | lol |
17:21:34 | hmmm | :D |
17:22:40 | disruptek | quibono: i will retype your code if you pay me money. |
17:23:14 | FromDiscord | <Quibono> Hrm, do you take BAT? |
17:23:34 | disruptek | wtf is bat? |
17:24:05 | * | habamax quit (Read error: No route to host) |
17:25:45 | FromDiscord | <Quibono> A weird cryptocurrency you get for watching ads on the Brave browser. |
17:26:12 | disruptek | can it be traded for cash? |
17:27:05 | FromDiscord | <Quibono> Uhh yes, 1 USD = 5 BAT |
17:27:43 | disruptek | then do that. USD is more useful around here. |
17:27:58 | FromDiscord | <Quibono> Lol |
17:28:06 | * | habamax joined #nim |
17:28:13 | FromDiscord | <Quibono> I don’t actually want to pay for code rewrites. I want a nice linter |
17:28:19 | * | habamax quit (Client Quit) |
17:28:37 | * | habamax joined #nim |
17:29:02 | disruptek | i don't think people want to read code written in my style. |
17:29:12 | disruptek | if they did, more code would be written in my style. |
17:29:25 | FromDiscord | <whisperdev> What is the easiest way to cross compile to a different architecture? Something with zig? |
17:30:23 | disruptek | zig was accidentally made harder to use with nim via a patch to make arbitrary compilers easier to use. |
17:30:52 | FromDiscord | <whisperdev> Excuse me sir I have actually no idea what you have just said |
17:31:10 | disruptek | truth is stranger than fiction. |
17:33:15 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2HJ0 |
17:34:05 | FromDiscord | <Quibono> Sooo, don’t expect anything beyond morepretty for a while? |
17:34:16 | disruptek | here's a shim i hacked up for using zig with nim. maybe it's helpful. http://ix.io/2HJ1/nim |
17:35:28 | disruptek | quibono: could be a good project for you. |
17:35:33 | FromDiscord | <haxscramper> I have `rfmt`'s algorithm for code layout, but without concrete syntax tree it is not possible to make good pretty-printer |
17:35:54 | FromDiscord | <Quibono> Honestly I’d try if I knew where to start. |
17:35:54 | FromDiscord | <haxscramper> Since you need to save comments, but comments are not a part of the nim AST |
17:36:02 | FromDiscord | <haxscramper> You can write tree-sitter grammar for nim |
17:36:22 | FromDiscord | <haxscramper> We have grammar in manual |
17:36:51 | FromDiscord | <haxscramper> Like, I've been thinking about this, but I just don't really have time |
17:37:59 | FromDiscord | <haxscramper> But if we have concrete syntax tree for nim code, with all punctuation, comments and so on, it should technically be straightforward process of mapping it to layout algorithm |
17:39:29 | FromDiscord | <lqdev> >disruptek is angry |
17:39:30 | FromDiscord | <lqdev> LOL |
17:40:23 | disruptek | needs more 😠🤬 |
17:40:57 | FromDiscord | <haxscramper> Just add russian swearing in error messages |
17:42:48 | disruptek | i like the idea of unicode curses. maybe we check your native language and pick one geographically foreign so it's unlikely to be comprehensible. |
17:43:50 | * | krux02 quit (Remote host closed the connection) |
17:44:53 | FromDiscord | <lqdev> i imagine something like |
17:45:03 | FromDiscord | <haxscramper> Eͮ̎̚R̍̃̂Rͦ͗ͤ҉̨O̍̃̚҉R̃̀̾ |
17:45:04 | FromDiscord | <lqdev> "look chucklehead. i'll give you `x.inc`" |
17:45:16 | FromDiscord | <lqdev> disfmt™ |
17:46:17 | FromDiscord | <haxscramper> code linter that attacks your errors |
17:46:53 | disruptek | eh, how about i just delete anything not written to spec. |
17:47:01 | disruptek | fuck those kids. |
17:47:23 | FromDiscord | <lqdev> yes |
17:47:43 | disruptek | the output of the linter is the number of tokens removed from your code. |
17:47:56 | FromDiscord | <lqdev> https://github.com/munificent/vigil |
17:47:57 | disruptek | the return code is zero when zero tokens were removed. |
17:49:57 | disruptek | Zevv: what is this ferry graph? |
17:50:54 | * | hnOsmium0001 joined #nim |
17:51:12 | beck | Wowwww Day 12 can get in the sea |
17:51:40 | beck | "Hey here's part 2, literally nothin you just wrote can be used again" |
17:53:53 | * | mika_ quit (Ping timeout: 260 seconds) |
17:54:31 | beck | And then I see Nari's solution and they've managed to reuse 90% of their code, goddamnit nari |
17:54:35 | beck | putting me to shame |
18:00:04 | disruptek | miran is a pain in my ass. |
18:01:00 | FromDiscord | <m0nsta> hey disruptek: how do i get a type that is just -1 or 1 in value ? |
18:01:20 | FromDiscord | <m0nsta> can't be 0 or in-between |
18:01:25 | disruptek | use an enum. |
18:02:42 | FromDiscord | <m0nsta> like this ? https://play.nim-lang.org/#ix=2HHe |
18:04:46 | disruptek | sure, but prefer ord and Ordinal for handling enums (over int). |
18:05:09 | FromDiscord | <m0nsta> try passing a 0 there |
18:05:14 | disruptek | ~disrupstyle |
18:05:14 | disbot | disrupstyle: 11tips for writing code that won't provoke 😠 rants 🤬 on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d -- disruptek |
18:05:53 | disruptek | it's a bug. |
18:06:40 | FromDiscord | <whisperdev> getEnv() returns taintedstring. How does one get an int from it? |
18:06:55 | disruptek | parseInt, what else? |
18:07:01 | disruptek | tainted.string |
18:07:46 | disruptek | whisperdev: is that still broken on devel? |
18:07:51 | disruptek | er, m0nsta |
18:08:01 | FromDiscord | <m0nsta> disruptek: thought so : | |
18:08:33 | FromDiscord | <m0nsta> uhm. i think i just tested on stable |
18:08:50 | disruptek | seems to still be broken. |
18:08:55 | disruptek | dumb. |
18:09:26 | FromDiscord | <m0nsta> that looks like a wide reaching bug |
18:10:12 | disruptek | one problem is that you can still instantiate types that are invalid due to holding 0 at instantiation as opposed to a .low value via default(). |
18:10:27 | disruptek | it's a thorny breaking bug to fix. |
18:11:18 | disruptek | you will need to add a little logic to solve this. i would use a case and not, say, iteration. |
18:14:17 | FromDiscord | <m0nsta> what's amusing is this going unnoticed till now |
18:14:30 | FromDiscord | <m0nsta> i was just trolling |
18:14:38 | FromDiscord | <m0nsta> around |
18:15:00 | disruptek | it's not unnoticed; it's just tricky to solve safely. |
18:15:07 | disruptek | holy enums are a pita. |
18:16:14 | FromDiscord | <lqdev> > Use isNil in preference to == nil because it's less error-prone with respect to ==[T](a, b: ref T): bool. |
18:16:15 | FromDiscord | <lqdev> YES |
18:16:44 | FromDiscord | <lqdev> using `x == nil` in my game literally prevents my game from compiling |
18:16:52 | FromDiscord | <lqdev> because some code that uses generics gets triggered or something |
18:17:25 | disruptek | it's a problem that usually crops up in tables. |
18:17:53 | hmmm | oh return and result! nice one diruptek |
18:18:12 | hmmm | wat |
18:18:22 | hmmm | why can't I use except with try |
18:18:33 | disruptek | try /expressions/ |
18:18:37 | hmmm | oh |
18:18:39 | hmmm | :3 |
18:21:30 | FromGitter | <deech> Is there an idiomatic way of creating an object which updates a single field of another object? Ideally the old object get `move`d into the new object. |
18:21:53 | disruptek | move it and then update the field? |
18:22:36 | FromGitter | <deech> How do I move it? Just assignment? |
18:22:46 | FromDiscord | <lqdev> yeah |
18:22:53 | FromDiscord | <lqdev> or `x = move y` if you want to be clear |
18:22:54 | FromGitter | <deech> Thanks! |
18:23:05 | FromGitter | <deech> Ah didn't know I could do that. Neat! |
18:23:31 | * | mika_ joined #nim |
18:29:27 | FromDiscord | <m0nsta> https://play.nim-lang.org/#ix=2HJj |
18:29:55 | FromDiscord | <m0nsta> ^ a little help here ? |
18:35:12 | FromDiscord | <zetashift> I know very little about concepts sorry 😦 |
18:35:59 | FromDiscord | <zetashift> Anybody know why I'm getting an SIGSEV: Illegal storage access error wth this code: https://play.nim-lang.org/#ix=2HJq |
18:38:42 | Zevv | new result |
18:38:55 | * | a_chou joined #nim |
18:39:28 | Zevv | https://play.nim-lang.org/#ix=2HJt |
18:40:25 | * | thomasross joined #nim |
18:40:58 | * | a_chou quit (Remote host closed the connection) |
18:41:06 | Zevv | zetashift ^ |
18:42:02 | disruptek | m0nsta: you can't base a concept upon a runtime value. |
18:42:43 | FromDiscord | <m0nsta> calling a fn with values in the same file is runtime ? |
18:43:30 | FromDiscord | <m0nsta> how would i go about it, if i were to use concepts? i remember seeing them in your bloom implementation |
18:43:47 | FromGitter | <deech> Oh neat! `dup` from `sugar` just totally automates this. |
18:43:56 | disruptek | bloom just uses them to check if the type you want to filter with is `hash`-able. |
18:44:18 | disruptek | i think you want to do something similar, but with a proc that accepts a static int. |
18:44:23 | FromDiscord | <haxscramper> There is a `x is range[-1 .. 1]`, but it fails compilation still, and I don't really know what is the problem |
18:44:42 | FromDiscord | <m0nsta> that includes 0 |
18:44:45 | FromDiscord | <m0nsta> no 0 |
18:45:27 | FromDiscord | <haxscramper> Oh, either -1 or 1 |
18:45:39 | FromDiscord | <m0nsta> disruptek: kinda? i just want to know if its 1 or -1, else give me a type / value error |
18:46:01 | FromDiscord | <haxscramper> I think there is no way to express constraints like this in nim type system. |
18:46:08 | disruptek | i wonder if you could use a -1, 0, 1 enum and the compiler was smart enough to recognize that default() == static[0]. |
18:46:15 | disruptek | that would be interesting. |
18:46:20 | disruptek | oh, i'm sure we can do it. |
18:46:43 | FromDiscord | <haxscramper> `not nil` and other flow-dependent-types might be close |
18:46:43 | FromDiscord | <m0nsta> lmao, im sure too, doesnt seem like too much of an ask : P |
18:47:11 | FromDiscord | <m0nsta> do we have ADT's in nim |
18:49:20 | disruptek | that's what concepts are. |
18:50:05 | FromDiscord | <m0nsta> they seem more than those actually |
18:50:16 | FromDiscord | <m0nsta> more like typeclasses in haskell |
18:50:40 | disruptek | well, we're trying to establish whether you can tighten the values statically. |
18:50:48 | FromDiscord | <haxscramper> Yes, you can do `type SomeThing = int | float | PHP` |
18:51:22 | FromDiscord | <m0nsta> i just want a is it 1 or is it a -1 or gtfo check |
18:51:27 | FromDiscord | <m0nsta> at type level |
18:52:08 | * | Q-Master quit (Ping timeout: 260 seconds) |
18:52:10 | disruptek | i bet i know a way to cheat. |
18:52:57 | FromDiscord | <m0nsta> its only cheating if you get caught ; ) |
18:53:04 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2HJB |
18:53:14 | FromDiscord | <haxscramper> (edit) |
18:53:38 | FromDiscord | <m0nsta> enums have the same bug here |
18:53:46 | FromDiscord | <m0nsta> pretty 0 happy |
18:54:05 | FromDiscord | <m0nsta> !eval echo "hi" |
18:54:07 | NimBot | hi |
18:54:16 | * | junland quit (Ping timeout: 240 seconds) |
18:54:17 | FromDiscord | <m0nsta> !eval type Lol = 1 | -1 |
18:54:19 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: type expected, but got: 1 |
18:54:24 | FromDiscord | <m0nsta> sure |
18:54:28 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2HJC |
18:54:33 | * | junland joined #nim |
18:54:43 | FromDiscord | <m0nsta> !eval type 1 = range[1..1] |
18:54:44 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: identifier expected, but got '1' |
18:54:51 | FromDiscord | <m0nsta> ofc |
18:54:53 | FromDiscord | <haxscramper> default-initialized to `enNegativeOne`, use `converter` to `int` to get custom value |
18:54:56 | FromDiscord | <haxscramper> Maybe |
18:55:41 | FromDiscord | <m0nsta> this @haxscramper ? |
18:56:27 | FromDiscord | <zetashift> @Zevv damn how could I overlook that thanks! |
18:58:14 | FromDiscord | <m0nsta> awright guys, its late over here |
18:58:22 | disruptek | holdon, i'm just testing it. |
18:58:34 | FromDiscord | <m0nsta> holding on |
18:59:04 | disruptek | it works. |
18:59:23 | disruptek | https://play.nim-lang.org/#ix=2HJI |
18:59:35 | disruptek | there might be one extra indirection in there that you can remove. |
18:59:42 | disruptek | i kinda took the thermonuclear approach. |
19:02:49 | FromDiscord | <m0nsta> can you tell me what do, concepts, as a concept, do ? |
19:03:14 | * | hmmm quit (Quit: zZz) |
19:03:15 | FromDiscord | <m0nsta> i think i am having the mixed up wrt how i understand them |
19:03:36 | disruptek | they are a filter for a generic that is matched according to whether the boolean statements are statically evaluated as true. |
19:03:49 | disruptek | user-defined type-classes. |
19:04:29 | disruptek | i think your syntax should work, btw. |
19:05:05 | disruptek | concepts are mostly rewritten, but they need a little more work. hopefully, 1.8 will have the rewrite. |
19:05:41 | disruptek | i offered to work on it after ic. |
19:06:36 | FromDiscord | <Anuke> Is there a 'safe' way to get a variable that points to an `object` in a `Table`, such that modifying the object will modify it in the table? Code: https://play.nim-lang.org/#ix=2HJR |
19:06:59 | disruptek | use a ref. |
19:07:13 | FromDiscord | <Anuke> `ref object`? |
19:07:16 | disruptek | yes. |
19:07:54 | disruptek | oh, i finally see your code. yeah, no. |
19:08:47 | FromDiscord | <Anuke> so it's either `addr` or `ref object`? it just seems strange to me that my code almost works, I just can't assign the result to a temporary variable |
19:10:04 | FromDiscord | <lqdev> if you know what you're doing and really want to avoid ref object for perf reasons then taking a temporary ptr to your object is acceptable i think |
19:10:24 | FromDiscord | <lqdev> or you can try using https://nim-lang.org/docs/with.html |
19:10:31 | disruptek | i can't tell if you don't understand the difference between objects, refs, and ptrs. |
19:11:01 | disruptek | refs are managed; you can't "cheat" the manager between nominal stack and heap domains. |
19:11:08 | FromDiscord | <lqdev> @Anuke https://zevv.nl/nim-memory/ |
19:12:07 | FromDiscord | <m0nsta> disruptek: i want something more like https://play.nim-lang.org/#ix=2HJW |
19:12:58 | FromDiscord | <m0nsta> also, concepts seems interesting to work on. if you do end up working on them, maybe we could pair do it together. |
19:14:53 | FromDiscord | <Recruit_main707> you need to imagine every expression of a concept as an assertion |
19:15:34 | FromDiscord | <m0nsta> yea, sure. |
19:15:36 | FromDiscord | <Anuke> "if you know what you're doing" well, I kinda don't↵I just wanted to avoid `ref object` because there isn't any other reason for my type to be a `ref object`, and the type/table in question is fairly important for performance. I don't know the real overhead of using `ref`, but I'd still like to do things the "right" way. |
19:15:42 | disruptek | yeah, i would love to do more pair programming. |
19:16:02 | * | narimiran quit (Ping timeout: 272 seconds) |
19:16:09 | FromDiscord | <m0nsta> sweet, i'll go crash now |
19:16:10 | disruptek | oh, i'd use ref. |
19:16:22 | FromDiscord | <m0nsta> night people. |
19:16:25 | disruptek | peace. |
19:25:23 | * | Q-Master joined #nim |
19:30:00 | FromDiscord | <zetashift> gnight |
19:41:05 | * | vesper quit (Ping timeout: 240 seconds) |
19:48:11 | * | vesper11 joined #nim |
19:51:19 | FromDiscord | <lqdev> @Anuke↵> the type/table in question is fairly important for performance↵if you tell us what the type is in a little bit more detail we may be able to help a bit better |
19:53:22 | FromDiscord | <Recruit_main707> why is there no `newLit` for `byte` in std/macros? |
19:54:25 | disruptek | what would such a creature look like? |
19:55:56 | FromDiscord | <lqdev> @Recruit_main707 i'll tell you a secret |
19:55:57 | FromDiscord | <lqdev> https://nim-lang.org/docs/system.html#byte |
19:56:23 | disruptek | don't tell him. |
19:56:25 | FromDiscord | <Recruit_main707> i know, but it is uglier to use uint8 |
19:56:32 | disruptek | what? |
19:56:44 | FromDiscord | <Recruit_main707> idk, i just dont like uint8 i guess |
19:56:59 | disruptek | PR a const, then. |
19:57:44 | disruptek | or, better yet, /don't/ PR it. 😁 |
19:57:52 | FromDiscord | <lqdev> mate |
19:57:57 | FromDiscord | <lqdev> byte is uint8 |
19:58:04 | FromDiscord | <lqdev> and there is a newLit for uint8 |
19:58:57 | disruptek | no, he wants a nnkType constant or something. |
19:59:05 | disruptek | er, nnkByte. |
19:59:24 | FromDiscord | <Recruit_main707> nono |
19:59:39 | FromDiscord | <Recruit_main707> its what iqdev said |
20:00:33 | FromDiscord | <Recruit_main707> i know its dumb, i have dumb wishes |
20:01:06 | * | habamax quit (Quit: leaving) |
20:01:27 | FromDiscord | <lqdev> i'm not iqdev i'm lqdev |
20:01:29 | FromDiscord | <lqdev> with an L |
20:02:37 | * | mika_ quit (Ping timeout: 264 seconds) |
20:04:24 | FromGitter | <deech> How does `arc` work with something like `proc p(f: sink proc () {.closure.})`? Does passing a closure also destroy it's environment after the call is completed? |
20:06:33 | FromDiscord | <Recruit_main707> pretty sure it does |
20:06:39 | FromDiscord | <Recruit_main707> @lqdev ok |
20:17:26 | Zevv | deech: -d:expandArc |
20:18:43 | FromGitter | <deech> Zevv, that just gives me `=destroy(f)`, can't find the implementation for that in lib code so I guess destroying a proc is a compiler built in. |
20:21:10 | Zevv | good poijnt |
20:21:26 | disruptek | it's generated for you. |
20:21:40 | Zevv | sure it is, but I kind of expected it to show up with expand |
20:22:13 | disruptek | what do you mean? you expected it to output the generated proc ast? |
20:24:04 | Zevv | I don't know what I expected, I played with expandArc one time and I saw some stuff getting expanded |
20:24:10 | Zevv | but not sure what is or is not there |
20:24:45 | disruptek | ah, it's just, like, annotations for when it acted and how. |
20:24:52 | Zevv | right |
20:25:01 | * | superbia joined #nim |
20:25:24 | disruptek | what do you make of this proc macro bug? |
20:26:11 | disruptek | what's annoying is, i got it to dump the ast and then i was able to run the macro for the first time. and it works, of course, which is fun. but i don't want to code it by hand every damned time. 😁 |
20:26:58 | Zevv | what bug is that |
20:27:43 | disruptek | i dumped the nodes at the crash in carnac and they weren't typed. |
20:27:44 | disruptek | in backend codegen. |
20:27:53 | disruptek | !repo carnac |
20:27:54 | disbot | https://github.com/disruptek/carnac -- 9carnac: 11magical function memoization across invocations 15 3⭐ 0🍴 |
20:28:09 | Zevv | ah yeah that is silly stuff |
20:28:13 | Zevv | what does arq say about that then |
20:28:37 | disruptek | he hasn't read my text yet. 🤪 |
20:28:50 | disruptek | he's probably avoiding me. |
20:29:16 | disruptek | i also asked him why i can't build nim with orc. that might not have gone over well. |
20:29:46 | Zevv | and he asked you why IC doesn't bootstrap |
20:29:51 | Zevv | great pair of friends we got there |
20:29:55 | disruptek | lol |
20:30:09 | disruptek | well, we know why it doesn't bootstrap. |
20:30:24 | disruptek | because his iterators are broken. 😢 |
20:30:40 | Zevv | ha |
20:31:52 | * | superbia quit (Quit: WeeChat 2.9) |
20:47:58 | kenran | https://play.nim-lang.org/#ix=2HKC is there any way I can create a sighandler as a closure? background: I am getting a pid at some point and want my handler to be a closure around that without having to put the pid into a global var. |
20:53:11 | * | NimBot joined #nim |
21:07:26 | * | Jesin quit (Quit: Leaving) |
21:09:14 | * | Jesin joined #nim |
21:24:31 | leorize[m] | kenran: you should use sigaction |
21:25:14 | * | jmiven quit (Quit: reboot) |
21:26:00 | * | jmiven joined #nim |
21:26:53 | leorize[m] | ah nvm, you can't store custom data in struct sigaction |
21:27:54 | leorize[m] | I wouldn't say that I recommend using a signal handler though, those stuff requires a lot of tinkering to ensure that they're safe |
21:28:58 | FromDiscord | <kenran> Yeah, I know way too little too, but my scenario is this: I start a child process, and I need the signal handler just to get some information about why the child process might have crashed, then crash the main process too. |
21:29:19 | FromDiscord | <kenran> (edit) "too," => "about this," |
21:29:44 | FromDiscord | <kenran> So it shouldn't be very unsafe in my case |
21:33:37 | beck | disruptek you around? |
21:35:01 | leorize[m] | but if you don't need async, then use sigprocmask() to block sigchld, then call sigsuspend() to wait until sigchld is received |
21:35:02 | leorize[m] | kenran: once you got sigchld you can use waitpid() to inspect the child process |
21:35:04 | leorize[m] | if it's alive then just call sigsuspend() again |
21:36:03 | leorize[m] | though you could've just use waitpid so this might not be the brightest idea :P |
21:36:10 | FromDiscord | <kenran> leorize: thanks, I was planning to use `waitpit()` in my handler too. didn't know about `sigsuspend()` yet |
21:36:16 | FromDiscord | <kenran> (edit) "`waitpit()`" => "`waitpid()`" |
21:37:29 | FromDiscord | <kenran> I was wondering mainly about the closure aspect. Doesn't seem to be possible, but I know way too little about nim yet. |
21:37:58 | FromDiscord | <kenran> I mean, not much harm in making the PID a global, but it's just annoying since I only use it in that one place one line further down 😄 |
21:42:09 | ForumUpdaterBot | New thread by Haydenb: Update on Nim snap packages, see https://forum.nim-lang.org/t/7248 |
21:42:39 | leorize[m] | it will only be possible if you can supply custom data into the signal handler :P |
21:49:41 | FromDiscord | <kenran> leorize: I tried making the PID a global variable, then I can write a handler that isn't a global. It's annoying but it works |
21:50:37 | FromDiscord | <trippleA> I'm confused how I'm supposed to compile a project that is split across multiple files. |
21:51:22 | disruptek | import one file from another. |
21:51:30 | leorize[m] | @trippleA compile the main file |
21:51:41 | FromDiscord | <trippleA> How do I know which one is the main file? |
21:52:18 | leorize[m] | kenran: if it's simple enough I'd say go for it |
21:52:55 | FromDiscord | <trippleA> Nevermind. I figured it out 🙂 |
21:53:40 | leorize[m] | kenran: just make sure you never touch the GC within the signal handler |
21:54:03 | FromDiscord | <kenran> what does "touching the gc" mean here? |
21:54:10 | disruptek | ewww |
21:54:21 | disruptek | it means you should wash your hands. |
21:55:05 | leorize[m] | kenran: don't use refs, don't even read from them, avoid strings, seqs at all costs |
21:57:44 | * | mika_ joined #nim |
22:00:00 | * | Vladar quit (Quit: Leaving) |
22:01:45 | * | leorize joined #nim |
22:02:04 | * | mika_ quit (Ping timeout: 246 seconds) |
22:03:31 | leorize[m] | in practice the safest way to use a signal handler is to not use it :P |
22:08:32 | disruptek | so rude. |
22:09:50 | FromDiscord | <Rebel> Disruptek are you ready to touch some threads later 😉 |
22:09:52 | FromDiscord | <Rebel> today is the day |
22:09:57 | FromDiscord | <Rebel> well maybe 2 am lol |
22:10:04 | FromDiscord | <Rebel> but sometime within the next 24 hours |
22:10:09 | FromDiscord | <Rebel> top 10 unsolved anime mysteries |
22:10:19 | disruptek | result = (unlikely) today == theDay |
22:10:34 | FromDiscord | <Rebel> ouch |
22:11:13 | FromDiscord | <Rebel> Have you ever done pipelining in Nim? |
22:11:19 | FromDiscord | <Rebel> something like luigi in Python |
22:11:21 | FromDiscord | <Rebel> closest I can think is weave |
22:11:32 | * | natrys quit (Quit: natrys) |
22:11:45 | FromDiscord | <raydan> First attempt at nim (advent of code day11)↵Roast me↵https://github.com/raydan4/adventofcode-2020/blob/master/day11/day11.nim |
22:13:02 | leorize | I'm scared by one-letter parameters |
22:13:55 | leorize | also please make use of the `result` variable |
22:14:06 | FromDiscord | <Rebel> is this disruptek's calling? 😛 |
22:15:13 | FromDiscord | <raydan> fair, one letter parameters are probably a bad idea for most of those |
22:15:56 | leorize | btw we have something similar to in_range, it's `x in a..b` |
22:16:39 | FromDiscord | <raydan> Truuue, I read that somewhere in the docs but didn't think to add it |
22:19:44 | beck | Anyone savvy with npeg got 2 seconds? |
22:21:26 | beck | ha nvm solved, massive PEBCAK |
22:26:34 | disruptek | ~disrupstyle |
22:26:35 | disbot | disrupstyle: 11tips for writing code that won't provoke 😠 rants 🤬 on irc: https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d -- disruptek |
22:27:49 | FromDiscord | <lqdev> leorize: why do you hate one letter params dude |
22:28:09 | FromDiscord | <lqdev> i'm not gonna type `codegen.chunk.emitOpcode(opcDiscard)` all the time |
22:28:51 | FromDiscord | <lqdev> now here comes disruptek roasting me for using parens for a call with one param |
22:29:55 | disruptek | DAMNIT |
22:30:00 | leorize | @lqdev std/with |
22:30:10 | disruptek | https://gist.github.com/disruptek/6d0cd6774d05adaa894db4deb646fc1d#super-dominating-conditionals |
22:31:27 | * | krux02 joined #nim |
22:33:41 | * | kenran quit (Quit: leaving) |
22:38:57 | FromGitter | <ynfle> How can I get a pointer to an element in a `seq`? `ref` & `ptr` won't work |
22:39:13 | disruptek | what have you tried? |
22:40:34 | FromDiscord | <lqdev> @ynfle x[0].addr |
22:40:49 | FromGitter | <ynfle> Didn't work for me |
22:40:49 | disruptek | teach a man to fish. |
22:41:01 | disruptek | it's a new feature. are you on head? |
22:41:24 | FromGitter | <ynfle> https://play.nim-lang.org/ |
22:41:35 | FromGitter | <ynfle> https://play.nim-lang.org/#ix=2HLo |
22:41:36 | FromGitter | <ynfle> No |
22:41:37 | FromGitter | <ynfle> Stable |
22:41:56 | FromDiscord | <lqdev> if it's a `let` you need to use `x[0].unsafeAddr` |
22:42:05 | FromDiscord | <lqdev> but be careful |
22:42:10 | FromDiscord | <lqdev> it's `unsafe` for a reason |
22:42:20 | FromGitter | <ynfle> Oh makes sense |
22:42:25 | leorize | it's not like the regular one is safe :P |
22:42:37 | FromGitter | <ynfle> What is the difference? |
22:42:56 | FromGitter | <ynfle> I'm stupid for thinking I could get a pointer if the data isn't supposed to change |
22:43:01 | leorize | unsafeAddr lets you take address of "immutable" variables |
22:43:02 | FromDiscord | <lqdev> unsafeAddr allows you to take the address of anything - including consts and lets |
22:43:14 | FromDiscord | <lqdev> and you can mutate them via the pointer |
22:43:23 | FromDiscord | <lqdev> which can cause undefined or unexpected behavior |
22:43:31 | FromDiscord | <exelotl> it doesn't let you take the address of consts |
22:43:32 | disruptek | yeah, great. |
22:43:52 | FromDiscord | <exelotl> you need uberUnsafeAddr for that |
22:44:03 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2HLp |
22:44:04 | FromGitter | <ynfle> What is meant by "unsafe"? |
22:44:24 | FromGitter | <ynfle> Like "I know it's a pointer but I promise I won't change it"? |
22:45:27 | FromDiscord | <Quibono> I'm trying to import from another folder down a directory, and the import statement is working fine, but VSCode doesn't seem to recognize my proc |
22:45:45 | FromDiscord | <lqdev> @ynfle yes |
22:46:28 | FromGitter | <ynfle> Thx @lqdc |
22:46:35 | FromGitter | <ynfle> *@lqdev |
22:46:43 | FromDiscord | <lqdev> np |
22:47:27 | * | stefantalpalaru quit (Ping timeout: 272 seconds) |
22:47:36 | FromDiscord | <Quibono> Anyone know why vscode/my nim plugin just refuses to recognize stuff from the imported module? |
22:49:27 | FromDiscord | <Quibono> nvm, seems to be a bug on my end |
22:50:45 | * | vesper11 quit (Ping timeout: 240 seconds) |
22:50:55 | FromDiscord | <raydan> Thanks all for suggestions |
22:52:22 | * | Lord_Nightmare quit (Remote host closed the connection) |
22:52:45 | * | Lord_Nightmare joined #nim |
22:56:17 | * | vesper11 joined #nim |
23:00:18 | * | stefantalpalaru joined #nim |
23:02:53 | * | lritter quit (Quit: Leaving) |
23:04:35 | beck | Say I had a huge HTML string and I wanted to scan for every link and redirect the href to like, poop.com |
23:04:44 | beck | What would be the best way to go about that? |
23:04:55 | disruptek | i have one for scat.com; will that work? |
23:05:21 | * | stefantalpalaru quit (Changing host) |
23:05:21 | * | stefantalpalaru joined #nim |
23:05:32 | beck | Not poop.com sorry, say it's poop.co.uk, then change to poop.com, but not just replace(.com, .co.uk) becasue I only want to do it inside the href attribute |
23:05:48 | FromDiscord | <Rebel> Whelp surely Nim has an equivalent to bs4 so just use that or fancy regex + asyncio for speed |
23:05:51 | disruptek | we have a parsehtml module you can use. |
23:06:01 | beck | aw lawdy |
23:06:13 | disruptek | i don't know of a bs4-analogue. |
23:06:20 | beck | bs4? |
23:06:30 | disruptek | beautifulSoup. |
23:06:40 | beck | Ah of course |
23:08:08 | FromDiscord | <Rebel> can't tell you're if being sarcastic but if you're ever done anything to do with web parsing and Python you know what that package is |
23:08:47 | disruptek | if you've ever done it without tearing your hair out, you mean. |
23:11:31 | * | pbb quit (Ping timeout: 272 seconds) |
23:11:47 | beck | I have used Python maybe twice in my life, but I am well aware of beautiful soup |
23:12:00 | * | pbb joined #nim |
23:12:12 | FromDiscord | <Quibono> Honest question, why does anyone use query strings in HTTP requests rather than sticking that in the body of the request? |
23:14:07 | beck | You can't put the query in the body of the request when you're click a link on a webpage |
23:14:15 | beck | Well, unless you start JS'ing around |
23:14:31 | FromDiscord | <juliuskiesian> how do require a local package in a .nimble file? |
23:14:34 | beck | Also bookmarking/URL history |
23:15:41 | FromDiscord | <Quibono> Okay, but for an API it's weird, right? |
23:15:50 | FromDiscord | <juliuskiesian> (edit) "how do ... require" added "you" |
23:17:27 | * | xet7_ joined #nim |
23:19:16 | beck | Quibono: Not entirely, REST is about describing your resources through URIs, and the body would be the details of state |
23:19:33 | * | xet7 quit (Ping timeout: 260 seconds) |
23:19:34 | beck | But it's flexible enough that people just do whatever they want 😂 |
23:19:37 | FromDiscord | <Quibono> Okay, so I'm just being pissy |
23:20:04 | FromDiscord | <Quibono> Writing a SDK for this library and keeping track of what needs to be what is annoying me. |
23:20:29 | beck | also most HTTP caches use the URI as the key |
23:20:43 | beck | Which is why GraphQL is such a bastard to implement effective caching for |
23:29:06 | FromDiscord | <ElegantBeef> @shadow. Ehhhh, it's now in devel 😄 https://nim-lang.github.io/Nim/strscans.html#scanTuple.m%2Cuntyped%2Cstatic%5Bstring%5D%2Cvarargs%5Buntyped%5D |
23:33:41 | beck | Alright so htmlParser is cool but it appends `<document>` tags to the string, I assume because it becomes an XmlNode? |
23:54:05 | * | tane quit (Quit: Leaving) |
23:55:35 | FromDiscord | <scott> is there a recommended way to use TLS with asynchttpserver |
23:55:37 | FromDiscord | <scott> (edit) "asynchttpserver" => "asynchttpserver?" |
23:56:57 | * | beck quit (Quit: WeeChat 1.9.1) |