00:03:14 | * | jcara27 joined #nim |
00:03:46 | * | jcara27 quit (Remote host closed the connection) |
00:25:01 | * | ZoomZoomZoom quit (Ping timeout: 272 seconds) |
00:37:35 | * | gambpang17 joined #nim |
00:37:36 | * | gambpang17 quit (Remote host closed the connection) |
00:40:04 | * | xet7 quit (Remote host closed the connection) |
01:05:09 | * | xet7 joined #nim |
01:37:42 | * | arkurious quit (Quit: Leaving) |
02:02:16 | FromDiscord | <Rika> It is answered in the asynchronous dispatch module documentation |
02:02:45 | FromDiscord | <Rika> https://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures-handling-exceptions |
02:26:16 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3phH |
02:26:42 | FromDiscord | <brainproxy> (edit) "https://play.nim-lang.org/#ix=3phH" => "https://play.nim-lang.org/#ix=3phI" |
02:28:39 | FromDiscord | <Rika> You can check with treeRepr in the macros module |
02:29:37 | FromDiscord | <Rika> I mean dumpTree I think |
02:30:39 | FromDiscord | <Rika> PtrTyβ΅ BracketExprβ΅ Ident "Atomic"β΅ Ident "bool" |
02:34:36 | FromDiscord | <brainproxy> nice |
03:04:55 | * | clemens3 quit (Ping timeout: 268 seconds) |
03:13:16 | FromDiscord | <codic> does posix.onSignal use the double pipe thing? because heap allocations usually work but are "unsafe" so you shouldn't do them in a regular signal handler, instead you can use the double pipe trick |
03:13:24 | FromDiscord | <codic> I have no idea wtf handle_signal that it calls is, I can't find any docs on it |
03:24:06 | * | clemens3 joined #nim |
03:46:49 | * | spiderstew_ joined #nim |
03:49:35 | * | spiderstew quit (Ping timeout: 272 seconds) |
03:53:25 | FromGitter | <bung87> @haxscramper does hnimast can parse a module call the module proc ? |
03:58:57 | FromDiscord | <lamersc.com> Does nim support Apple M1? |
03:59:45 | FromDiscord | <ElegantBeef> I believe it does |
04:09:49 | FromDiscord | <Rainbow Asteroids> does the Apple M1 have a C compiler? |
04:15:05 | FromDiscord | <Rika> Clang? |
04:16:50 | * | johnwayne123[m|g joined #nim |
04:16:54 | * | johnwayne123[m|g quit (Remote host closed the connection) |
04:19:07 | FromDiscord | <flywind> In reply to @lamersc.com "Does nim support Apple": > Just like our devel branch, v1.4.8 is built using csources_v1, which means you can use it on Apple M1 chips. |
04:19:18 | FromDiscord | <flywind> https://forum.nim-lang.org/t/8031 |
04:20:24 | FromDiscord | <haxscramper> In reply to @bung87 "<@608382355454951435> does hnimast can": Not sure what doe you mean by that. `module.procName()`? |
04:23:00 | FromDiscord | <haxscramper> And in what context? (Object parsing, nimble configuration, or something else) |
04:26:45 | * | narimiran joined #nim |
04:29:54 | FromGitter | <bung87> @haxscramper I want use a module that module path is runtime determined , so am wonder how to call that module'proc |
04:31:35 | FromDiscord | <haxscramper> You can't use runtime module paths |
04:32:03 | FromDiscord | <haxscramper> Jim is statically typed, so at best you can embed nimscript compile generates string. |
04:32:12 | FromDiscord | <haxscramper> (edit) "Jim" => "Nim" |
04:32:15 | FromDiscord | <Rainbow Asteroids> what about a dynamic library, where you export to C ABI? |
04:32:17 | FromDiscord | <ElegantBeef> We all see the jim |
04:32:28 | FromDiscord | <haxscramper> Yeah, I'm on the phone right now |
04:32:35 | FromDiscord | <Rainbow Asteroids> you gotta add Nim to your autocorrect, lol |
04:33:01 | FromDiscord | <ElegantBeef> What about a dynamic library, module import path isnt runtime based |
04:34:43 | FromGitter | <bung87> ok, so I need collected all procs that need export and compile it to dynlib |
04:34:46 | FromDiscord | <Rika> In reply to @haxscramper "Nim is statically typed,": Jim |
04:34:49 | FromDiscord | <Rika> Hehe |
04:35:26 | FromDiscord | <Rainbow Asteroids> maybe i misintpereted the question. if the path of the module is determined at runtime, wouldn't you need a dynamic library? |
04:35:28 | FromDiscord | <haxscramper> In reply to @Rika "Jim": r/contagiouslaughter material |
04:35:59 | FromDiscord | <haxscramper> In reply to @Rainbow Asteroids "maybe i misintpereted the": No, module path is a part of syntax, do even dynamic library can't fix that |
04:36:16 | FromDiscord | <ElegantBeef> Yea modules do not exist at runtime, so there is no module path there |
04:36:58 | FromDiscord | <haxscramper> Dynamic library would allow you to substitute different implementation of the compiled C procedure for example, but when you write nim you would still have to import procs from somewhere. |
04:37:38 | FromGitter | <bung87> dyn lib is easy solution, I get it. |
04:54:12 | * | rockcavera quit (Ping timeout: 245 seconds) |
04:59:05 | * | ThoMe29 joined #nim |
04:59:15 | * | ThoMe29 quit (Remote host closed the connection) |
04:59:16 | FromGitter | <bung87> the proc I want export need any extro pragma that be visible in dynlib ? |
05:20:46 | * | IonutVan_28 joined #nim |
05:21:15 | * | IonutVan_28 quit (Remote host closed the connection) |
05:35:59 | FromGitter | <bung87> found in document. |
05:41:10 | * | pg_docbot10 joined #nim |
05:41:21 | * | pg_docbot10 quit (Remote host closed the connection) |
05:53:33 | * | bernard_f6bvp[m| joined #nim |
05:53:49 | * | bernard_f6bvp[m| quit (Remote host closed the connection) |
06:57:09 | * | anthis_ joined #nim |
06:57:35 | * | anthis_ quit (Remote host closed the connection) |
07:11:39 | * | PMunch joined #nim |
07:24:34 | * | sunwind joined #nim |
07:25:04 | * | sunwind quit (Remote host closed the connection) |
07:34:06 | * | threenp quit (Quit: Bridge terminating on SIGTERM) |
07:34:07 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
07:35:10 | * | threenp joined #nim |
07:35:10 | * | johnnynitwits joined #nim |
07:35:26 | * | smj joined #nim |
07:35:26 | * | smj quit (Read error: Connection reset by peer) |
08:23:23 | FromDiscord | <Varriount> Araq: I was reading this[0], and found the concept of canonicalization interesting. Does the Nim compiler do anything like that?β΅[0] https://www.npopov.com/2021/06/02/Design-issues-in-LLVM-IR.html |
08:39:10 | * | Vladar joined #nim |
08:55:05 | * | Guest25073 joined #nim |
08:55:15 | * | Guest25073 quit (Remote host closed the connection) |
09:00:13 | * | cheer[m] quit (Quit: Idle for 30+ days) |
09:10:08 | ozzz | PMunch: hello! I found your PCAP parser library. Could you please tell, can it reassemble tcp session? |
09:18:49 | PMunch | Well, not by itself |
09:18:58 | PMunch | It just parses the pcap format into Nim objects |
09:22:04 | * | juns joined #nim |
09:22:16 | * | juns quit (Remote host closed the connection) |
09:24:21 | ozzz | PMunch: gotcha, then I need to create reassembler by myself |
09:41:24 | planetis[m] | why the base64 decode https://play.nim-lang.org/#ix=3pjV doesn't compile when I changed string to openarray[char]? |
09:41:33 | planetis[m] | is it a template bug? |
09:43:38 | PMunch | Uhm, where do you define a? |
09:44:40 | planetis[m] | its defined inside the inputchar template |
09:44:55 | planetis[m] | but ouputchar uses it |
09:45:34 | planetis[m] | btw I did basic fuzzing tests on base64 https://github.com/planetis-m/libfuzzer/tree/master/examples/base64 |
09:45:43 | planetis[m] | and haven't found any bug |
09:45:49 | planetis[m] | so thats the good news |
09:48:01 | * | threenp quit (Quit: Bridge terminating on SIGTERM) |
09:48:02 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
09:49:15 | * | johnnynitwits joined #nim |
09:49:15 | * | threenp joined #nim |
09:50:52 | PMunch | Where in inputChar? I can't see it |
09:51:22 | planetis[m] | line 40 |
09:52:27 | planetis[m] | i moved it after inputindex bc i was getting undeclared identifier as well |
09:53:19 | PMunch | Ooh sorry, I read that wrong :P |
09:56:21 | PMunch | Hmm, that is really weird indeed |
10:05:10 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3pk3 |
10:05:16 | FromDiscord | <impbox [ftsf]> any idea what this means and how to handle it? |
10:05:40 | planetis[m] | nvm life is good, last few days I have found more bugs than wrote any code |
10:05:46 | FromDiscord | <impbox [ftsf]> first request works after starting the client, but often subsequent attempts trigger it |
10:09:53 | FromDiscord | <haxscramper> In reply to @Varriount "Araq: I was reading": On discord it is `@Araq`, colon version pings IRC user |
10:12:41 | PMunch | Both versions ping IRC users |
10:12:58 | PMunch | We get pinged as long as our names are mentioned |
10:13:27 | PMunch | planetis[m], did you figure it out? |
10:15:43 | PMunch | @impbox, are you trying to fix the Nim IRC bots? |
10:15:51 | PMunch | So we can move to Libera |
10:17:44 | planetis[m] | nope i have no idea how to rewrite it, in order to work |
10:18:11 | planetis[m] | i hope we move to matrix and dump irc altogether |
10:19:48 | FromDiscord | <impbox [ftsf]> nah, making a discord bot for my game's leaderboards |
10:19:58 | FromDiscord | <impbox [ftsf]> it works great but dies after getting that error a lot |
10:20:03 | FromDiscord | <impbox [ftsf]> usually when i'm not around |
10:20:10 | * | barm joined #nim |
10:20:26 | PMunch | planetis[m], I've wanted to use Matrix, but it's convoluted to join.. |
10:20:33 | PMunch | And I'd have to find a new client.. |
10:20:49 | * | barm quit (Remote host closed the connection) |
10:20:56 | PMunch | That's the thing I like about IRC, the extremely low bar of entry (don't even need to register anywhere) |
10:21:24 | PMunch | Aaah, that's cool @impox! |
10:21:54 | planetis[m] | then stay on top of it, so it behaves |
10:22:57 | planetis[m] | well how about all the spammers? they dont have to register either |
10:23:23 | PMunch | @impbox, have you seen this: https://github.com/nim-lang/Nim/issues/7316 |
10:23:39 | PMunch | planetis[m], better to have the occasional spammers than to not have any users |
10:24:21 | PMunch | IRC is really nice because you can just link to a web-chat and make it possible for anyone to ask for help even without registering |
10:24:41 | PMunch | That's how I started using it |
10:25:15 | PMunch | Installed a Linux distro and it had a "Get help" button which just launched an IRC client that auto-joined the distros IRC channel |
10:26:22 | FromDiscord | <impbox [ftsf]> @PMunch yeah, i saw that, but not much info on the cause or how to solve it |
10:26:34 | FromDiscord | <impbox [ftsf]> and i'm only dealing with a single connection |
10:26:47 | FromDiscord | <impbox [ftsf]> well very few connections |
10:27:21 | PMunch | I'm pretty sure it's just the socket that fails or some other network error. You might be fine catching it and just retrying or something |
10:31:11 | FromDiscord | <impbox [ftsf]> hmm it's happening in async land, i'm not sure where i can catch it except at top level |
10:31:44 | PMunch | Oh wait, it's inside async.. |
10:31:52 | PMunch | Yeah that might be tricky.. |
10:31:59 | FromDiscord | <impbox [ftsf]> actually... it's in httpclient |
10:32:18 | FromDiscord | <impbox [ftsf]> my bot makes an API request when it receives a command, maybe it's the API request failing |
10:35:47 | FromDiscord | <impbox [ftsf]> thanks for rubberducking |
10:36:16 | FromDiscord | <Rika> quack |
10:36:39 | PMunch | I actually have a silly little project I want to do re rubber ducks |
10:37:18 | PMunch | A small rubber duck that you can put in your cup of coffee and it notifies you when your cup is cold enough to drink |
10:38:15 | FromDiscord | <Rika> what if i dont drink coffee |
10:38:22 | * | martin_sto[m|gr] joined #nim |
10:38:34 | * | martin_sto[m|gr] quit (Remote host closed the connection) |
10:38:36 | PMunch | It can also measure tea |
10:38:49 | FromDiscord | <Rainbow Asteroids> maybe it warns if your cup of water becomes too warm π€ |
10:39:10 | PMunch | But realistically the Venn diagram of developers and non-coffee drinkers gotta be vanishingly small :P |
10:39:21 | PMunch | Hmm, it could |
10:39:46 | PMunch | Currently I'm investigating running it off-of the heat in the cup using a Peltier element though |
10:39:59 | PMunch | And that wouldn't work with cold water going warm |
10:40:12 | FromDiscord | <Rainbow Asteroids> In reply to @PMunch "But realistically the Venn": im special βΊοΈ |
10:40:35 | FromDiscord | <Rainbow Asteroids> is the heat difference that great? |
10:41:00 | FromDiscord | <Rika> i dont drink anything for the morning; i drink cola in the evening |
10:41:03 | PMunch | That's what I'm trying to gauge |
10:41:45 | PMunch | The problem is that the duck needs to stay water-tight, but it felt like adding Qi-charging, a battery pack, and all that jazz was a bit overkill :P |
10:42:01 | PMunch | @Rika, Cola is soo bad for you though.. |
10:42:11 | FromDiscord | <Rika> mhm and coffee isnt |
10:42:12 | FromDiscord | <Rainbow Asteroids> but it tastes soo cood |
10:42:16 | FromDiscord | <Rainbow Asteroids> (edit) "cood" => "good" |
10:42:28 | FromDiscord | <Rika> you've convinced me π |
10:43:40 | PMunch | Coffee at least doesn't have a huge amount of sugar and acids messing up your teeth and giving you a lot of empty calories |
10:44:24 | PMunch | Sure high doses of caffeine and cholesterol (depending on how you brew it, I do filter coffee so this isn't much of a concern) isn't great either |
10:45:25 | ormiret | can run little stirling engines off a mug of coffee, could possibly do something with one of them to get notification at a certain temp (or harvest the energy to run electronics to beep) https://smile.amazon.co.uk/Temperature-Stirling-Engine-Motor-Education/dp/B071G7SXVX |
10:47:32 | FromDiscord | <Rainbow Asteroids> if only we could run the world off those stirling engines that run off body heat |
10:49:49 | * | drmpeg joined #nim |
10:50:10 | * | drmpeg quit (Remote host closed the connection) |
10:54:08 | FromDiscord | <Rika> In reply to @PMunch "Coffee at least doesn't": that doesnt make it any better, in my opinion |
10:54:21 | FromDiscord | <Rika> coffee still stains your teeth |
10:54:56 | ForumUpdaterBot | New question by LemongrabThree: Nim: Proc Default Argument Has to Be Used (or Discarded); for a function call use (), see https://stackoverflow.com/questions/67902767/nim-proc-default-argument-has-to-be-used-or-discarded-for-a-function-call-us |
11:02:28 | PMunch | Eh, that doesn't bother me too much |
11:09:08 | * | Arrrrrrrr joined #nim |
11:10:47 | PMunch | Hmm, there are a couple of low-cost option to Qi that takes up much smaller space |
11:11:50 | PMunch | Like this thing: https://www.aliexpress.com/item/4000153676589.html |
11:13:01 | * | Vladar quit (Remote host closed the connection) |
11:19:28 | * | lritter joined #nim |
11:21:31 | * | richvdh[m]1 joined #nim |
11:22:05 | * | richvdh[m]1 quit (Remote host closed the connection) |
11:27:50 | * | Vladar joined #nim |
11:35:38 | * | ldlework quit (Quit: co'o ro do) |
11:37:38 | * | ldlework joined #nim |
11:43:26 | * | Exagone313 joined #nim |
11:44:19 | * | Exagone313 quit (Remote host closed the connection) |
12:07:22 | FromDiscord | <haxscramper> PR for nim 1.4.8 was merged to compiler explorer |
12:11:02 | planetis[m] | nice, does it support annotated assembly? |
12:15:05 | * | arkurious joined #nim |
12:24:13 | * | Vladar quit (Remote host closed the connection) |
12:29:44 | * | Vladar joined #nim |
12:44:19 | * | markmcclain joined #nim |
12:44:52 | * | markmcclain quit (Remote host closed the connection) |
12:47:50 | ForumUpdaterBot | New thread by Slangmgh: An simple nrpl for nim, see https://forum.nim-lang.org/t/8102 |
12:50:05 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
13:28:31 | * | Vladar quit (Remote host closed the connection) |
13:30:47 | * | LDerJim13 joined #nim |
13:31:14 | * | LDerJim13 quit (Remote host closed the connection) |
13:39:15 | * | rockcavera joined #nim |
13:40:55 | * | AkioKio-t25 joined #nim |
13:40:57 | * | AkioKio-t25 quit (Remote host closed the connection) |
13:44:02 | * | trly joined #nim |
13:44:26 | * | trly quit (Remote host closed the connection) |
14:02:23 | * | d10n quit (Quit: why all the #hashtags #lol #hackers #overheard) |
14:06:39 | * | d10n joined #nim |
14:06:39 | * | d10n quit (Changing host) |
14:06:39 | * | d10n joined #nim |
14:14:20 | * | PMunch quit (Quit: leaving) |
14:39:26 | * | Afootpluto4 joined #nim |
14:39:44 | * | Afootpluto4 quit (Remote host closed the connection) |
14:39:55 | * | tane joined #nim |
14:47:46 | * | Guest44391 joined #nim |
14:47:51 | * | Guest44391 quit (Remote host closed the connection) |
15:06:02 | * | Guest20474 joined #nim |
15:06:30 | * | Guest20474 quit (Remote host closed the connection) |
15:08:45 | * | takfarines12[m|g joined #nim |
15:09:22 | * | takfarines12[m|g quit (Remote host closed the connection) |
15:10:54 | FromDiscord | <dom96> In reply to @PMunch "But realistically the Venn": Another non-coffee drinker here, I bet the it's not as small as you think π |
15:12:26 | FromDiscord | <treeform> In reply to @dom96 "Another non-coffee drinker here,": I don't like coffee too. |
15:13:38 | FromDiscord | <dom96> yes! Non-coffee drinkers might just be the majority |
15:18:40 | * | fputs joined #nim |
15:20:11 | FromDiscord | <ajusa> > sample size of 3 |
15:21:38 | FromDiscord | <treeform> I doubt it, looking through stats on google (USA only I think) 75-80% of the people like coffee and like 60% drink it everyday. But many people like cream/milk flavored coffee rather then "coffee" itself. Nim community is bigger in EU, it looks like Scandinavia drinks way way more coffee then USA. If I where to put my finger on it I would guess that you will find ~5% don't like coffee and ~20% don't drink it often. |
15:22:17 | FromDiscord | <treeform> We should put that on our next Nim pool. |
15:22:25 | FromDiscord | <treeform> (edit) "pool." => "pole." |
15:26:52 | FromDiscord | <Gary M> Nim doesn't have pointer arithmetic outside of casting to ptr UncheckedArray[T] right |
15:27:27 | FromDiscord | <treeform> In reply to @Gary M "Nim doesn't have pointer": Not really but you can write one in like 10 lines of nim code. |
15:27:41 | FromDiscord | <Gary M> one what |
15:27:49 | FromDiscord | <treeform> pointer arithmetic |
15:27:57 | FromDiscord | <treeform> define + [] - for poitners |
15:28:03 | FromDiscord | <treeform> (edit) "poitners" => "pointers" |
15:28:03 | FromDiscord | <Gary M> ah right. |
15:28:18 | FromDiscord | <Gary M> The issue is I'm allocating multiple types within a single alloc0 right |
15:28:42 | FromDiscord | <Gary M> so I have to offset lenOfA then lenOfB etc for each array |
15:29:11 | FromDiscord | <Gary M> so the pointer arithmetic has to be a little more manual π |
15:29:44 | FromDiscord | <treeform> yeah so you allocate the block, cast the pointer to uint64 or some thing, do your math, cast it to the type you need? |
15:30:32 | FromDiscord | <treeform> I was doing that exact thing yesterday... it works. |
15:31:29 | FromDiscord | <Gary M> I'll figure it out π I was just hoping there was maybe some pointer arithmetic thing I was missing. |
15:32:45 | FromDiscord | <treeform> In first year of Nim defined + [] - for pointers, in second year of nim I mostly used UncheckedArray, now i just cast uint64 here and there... |
15:32:53 | FromDiscord | <treeform> (edit) "In first year of Nim ... defined" added "I" |
15:33:17 | FromDiscord | <Gary M> I'm not following the casting the uint64 bit |
15:33:24 | FromDiscord | <Gary M> (edit) "the" => "to" |
15:37:25 | FromDiscord | <treeform> In reply to @Gary M "I'm not following the": https://play.nim-lang.org/#ix=3pmu |
15:37:35 | FromGitter | <kaushalmodi> Gary M: Try `nimble install ptr_math` |
15:37:57 | FromGitter | <kaushalmodi> https://kaushalmodi.github.io/ptr_math/ |
15:39:17 | FromDiscord | <treeform> Yeah I had a similar thing: https://github.com/kaushalmodi/ptr_math/blob/main/src/ptr_math.nim I bet if you remove the comments, examples and tests its like 10 lines of code. |
15:39:43 | FromDiscord | <treeform> I just do `cast[uint64](dataPtr) + 4` now days |
15:40:02 | FromDiscord | <Gary M> the uint64 trick is pretty cool, I'll experiment more with that π |
15:41:10 | FromDiscord | <treeform> Maybe casting to int is better as its will support 32 bit platforms. |
15:41:28 | FromDiscord | <treeform> I don't have a good way tot test 32bit platforms though |
15:42:54 | FromDiscord | <Gary M> I can't think of any modern 32 bit targets π |
15:43:15 | FromDiscord | <treeform> WASM |
15:44:37 | FromDiscord | <Gary M> Fair. |
15:45:01 | FromDiscord | <Gary M> Pretty unfortunate that web games all but died with flash save for the occasional itch demo |
15:45:40 | FromDiscord | <Gary M> html5 and webgl is more than capable but the community isn't there at all like it was when sites like newgrounds and kongregate were at their peak |
15:46:19 | FromDiscord | <treeform> Many of the .io games have millions of players I would not dismiss that. |
15:46:36 | FromDiscord | <Gary M> another fair point π |
15:47:02 | FromDiscord | <Gary M> Just quite different than Flash, still. |
15:47:15 | FromDiscord | <treeform> I made a webgame but I had more luck getting my game out there on steam (I just used electron). |
15:47:30 | FromDiscord | <treeform> I will probably not make a webgame again. |
15:47:40 | FromDiscord | <Gary M> a lot of that style of free/freemium games moved to mobile |
15:48:00 | FromDiscord | <treeform> But still many people played the webgame part because they where in school or only had chromebooks. |
15:48:21 | FromDiscord | <treeform> (edit) "where" => "were" |
15:51:17 | * | NimBot joined #nim |
15:54:15 | FromDiscord | <treeform> kaushalmodi, I did not know about ByteAddress and +% that's cool. |
15:55:16 | FromDiscord | <Gary M> wait what is `+%` |
15:56:09 | FromDiscord | <Gary M> > Treats x and y as unsigned and adds them. |
15:56:12 | FromDiscord | <Gary M> well that's pretty cool |
15:58:12 | FromDiscord | <Gary M> the tricky part now will be making these tightly packed arrays resizable π |
15:58:55 | FromGitter | <kaushalmodi> treeform: Credit for that goes to https://forum.nim-lang.org/t/1188#7366 β β I just packaged that code and made it more ergonomic (templates -> proc) and beginner-friendly (examples and docs) |
15:59:30 | FromDiscord | <Gary M> however the constraint here is that each allocated array of types is the same length |
16:01:19 | FromDiscord | <treeform> In reply to @Gary M "I can't think of": Maybe this looks cleaner: https://play.nim-lang.org/#ix=3pmC |
16:02:07 | FromDiscord | <Gary M> Yeah, I'm using ByteAddress and +% now, seems more proper |
16:05:28 | FromGitter | <kaushalmodi> Gary M: Why not make your code generic and let `sizeof(T)` figure out your offset jumps |
16:05:33 | FromDiscord | <treeform> kaushalmodi, I like the way the original forum post kept it in a "danger" block sort of. |
16:05:37 | FromGitter | <kaushalmodi> I see that you are doing manual calcs in your code |
16:06:00 | FromGitter | <kaushalmodi> > kept it in a "danger" block sort of. β β I had it that way originally, until I realized that that block did nothing |
16:06:38 | FromDiscord | <treeform> I like that its for me to basically go here is the "crazy" section |
16:06:38 | FromGitter | <kaushalmodi> the templates defined inside that original `ptrMath` template got leaked out to the global namespace, until the internal templates got embedded inside `block:` |
16:06:51 | FromDiscord | <treeform> oh they would leak? |
16:07:11 | FromGitter | <kaushalmodi> it not "leak" technically.. it's how templates work |
16:07:34 | FromGitter | <kaushalmodi> stuff inside templates is equivalent to copy-pasting that stuff manually, like C macros |
16:07:55 | FromDiscord | <treeform> yeah |
16:08:00 | FromGitter | <kaushalmodi> you can contain that using `block:` but that prevented runnableExamples and docs to run within π |
16:08:24 | FromGitter | <kaushalmodi> I thought that I was anyways running the "leaked" version for a long time and nothing hurt, so I got rid of that template nesting |
16:09:10 | FromGitter | <kaushalmodi> I have documented the issues with nested template approach here: https://github.com/kaushalmodi/ptr_math/issues/1 |
16:09:46 | FromDiscord | <treeform> So some thing like this will not work? https://play.nim-lang.org/#ix=3pmM |
16:10:44 | FromGitter | <kaushalmodi> In your example, the ptr =, -, etc will now work outside the dragons: block too :D |
16:11:12 | * | rockcavera quit (Remote host closed the connection) |
16:12:35 | FromGitter | <kaushalmodi> the main thing that triggered me to remove that API was that I could not have ptrMath: block appear twice in the same scope. Because the first call, already defined the inner templates in the main scope |
16:12:37 | FromDiscord | <treeform> it appears not to work outside the dragon block: https://play.nim-lang.org/#ix=3pmO |
16:12:58 | FromGitter | <kaushalmodi> ah, because you have `block:` |
16:13:29 | FromDiscord | <treeform> yeah that fixes, but prevents locals from leaking |
16:13:36 | FromDiscord | <treeform> which one would like |
16:13:36 | FromGitter | <kaushalmodi> As I mentioned earlier, I disliked block: as I could not have runnableExamples in the inner templates (you know, I love docs quite too much) |
16:14:20 | FromGitter | <kaushalmodi> also I realized that have `+` etc in global scope did not hurt anything.. it was leaking in the outer scope for a while as I did not have block: originally |
16:15:22 | FromGitter | <kaushalmodi> If there's a real need for localized declarations of ptr math procs, I can always add those templates back. |
16:17:02 | * | Len[m]2 joined #nim |
16:17:18 | FromDiscord | <treeform> I see, yeah, I think your solution is probably best one, given the constraints. |
16:17:40 | FromDiscord | <treeform> I would change them to inline functions or back to templates to make them faster. |
16:17:55 | FromDiscord | <treeform> function overhead is slow, inline functions are slower them templates for some reason. |
16:18:06 | FromGitter | <kaushalmodi> > I would change them to inline functions β β I didn't even consider that. I will give that a try |
16:18:41 | FromDiscord | <treeform> Or back to templates, templates are faster then inline functions |
16:18:47 | FromGitter | <kaushalmodi> > function overhead is slow, inline functions are slower them templates for some reason. β β Oh really? I went through converting all templates to procs because I have been reading that you should read procs if possible |
16:19:00 | FromGitter | <kaushalmodi> *write procs |
16:19:12 | FromGitter | <kaushalmodi> heh, not sure how write got typoed as read |
16:19:16 | FromDiscord | <treeform> I think that is true, unless you benchmark it to not be the case |
16:19:23 | FromDiscord | <Gary M> I actually brought up that issue about template speed, I believe heh |
16:19:30 | FromDiscord | <Gary M> or rather, inlined proc speed |
16:19:37 | FromDiscord | <treeform> Do you have a ticket, i would watch |
16:19:50 | FromDiscord | <Gary M> even with opt:speed and danger builds, though it gets a lot closer |
16:19:54 | FromDiscord | <Gary M> No I don't. |
16:20:10 | FromDiscord | <Gary M> I figure I might also be incorrect with my reasoning somewhere. |
16:20:21 | FromDiscord | <treeform> To me its very strange that inline proc is slower them template, feel like its a bug/optimization nim compiler can make. |
16:20:23 | * | nixnet08 joined #nim |
16:21:35 | FromDiscord | <treeform> kaushalmodi, is there a reason you did not include `pointer` type? |
16:22:17 | FromDiscord | <Gary M> I'll have to run some benchmarks again to sure, but I know at the very least that debug builds without either opt:speed or lto, (can't remember which caused it to perform proper inlining) can give you such extremely abysmal performance even for debug builds because of it. |
16:22:28 | FromDiscord | <treeform> kaushalmodi, should adding p + 1 (move p by 4 byte) if p is ptr[uint32] ? |
16:22:45 | FromDiscord | <Gary M> Beef suggested it was an issue with my specific environment that the `--opt:speed` flag wasn't on by default |
16:22:56 | FromGitter | <kaushalmodi> treeform: β β > is there a reason you did not include pointer type? β β No, I didn't need it so far [https://gitter.im/nim-lang/Nim?at=60c0eae019b46c60b179f286] |
16:23:04 | FromDiscord | <treeform> I feel like p + 1 should move it by 1 byte, and p[1] should do the 4 byte thing? |
16:23:07 | FromDiscord | <treeform> thoughts? |
16:23:14 | * | nixnet08 quit (Client Quit) |
16:23:51 | FromGitter | <kaushalmodi> > I feel like p + 1 should move it by 1 byte, and p[1] should do the 4 byte thing? β β that would need one to remember to think which is which. The current is consistent |
16:24:02 | FromGitter | <kaushalmodi> You can do byte extraction by mask anding? |
16:25:05 | * | Len[m]2 left #nim (#nim) |
16:25:31 | FromGitter | <kaushalmodi> May be you can have p + 1 move by a byte by first casting to byte ptr type? |
16:25:33 | FromDiscord | <treeform> I feel like there are pros and cons here. The p + 1 moves by 1 byte makes pointers feel more C like, number like. While p + 1 moves by 4 makes it more consistent hmm... |
16:26:11 | FromDiscord | <Gary M> I thought C style pointer arith was `p + 1 = p + sizeof(T) + 1` |
16:26:23 | FromDiscord | <Gary M> not p + 1 byte |
16:26:37 | FromDiscord | <Gary M> (edit) "+" => "" |
16:26:58 | FromGitter | <kaushalmodi> treeform, Gary M: issues and PR's are welcome. I have started documenting on https://github.com/kaushalmodi/ptr_math/issues |
16:27:04 | FromGitter | <kaushalmodi> Need to sign off now, thanks |
16:27:11 | FromDiscord | <treeform> bye |
16:27:25 | FromDiscord | <Gary M> > Incrementing a pointer increases the stored address by the size of its type. |
16:27:38 | FromDiscord | <Gary M> so incrementing by a single byte would be non-standard if anything? |
16:29:25 | * | adbraun[m|gr] joined #nim |
16:30:01 | * | adbraun[m|gr] quit (Remote host closed the connection) |
16:31:12 | FromDiscord | <treeform> I think you are right. I just good too used to my uint64 thing π |
16:31:45 | FromDiscord | <treeform> I just tried ti with a C program and that's exactly how it works. when i=0, i + 1 makes i = 4. |
16:31:53 | FromDiscord | <Gary M> I've been dipping my toes into the macro stuff recently and I'm really liking some of the hacky things I can do with it haha |
16:36:12 | * | rockcavera joined #nim |
16:37:08 | * | AciD` joined #nim |
16:37:48 | * | AciD` quit (Remote host closed the connection) |
16:53:04 | * | sz0 joined #nim |
16:56:38 | planetis[m] | guys I need opinions, my in place init functions look like `initMyType`. Is it better if I shorten them to just `init`? The nep1 doc doesn't mention anything about it. |
16:56:46 | FromDiscord | <Rika> no |
16:56:50 | FromDiscord | <Rika> oh, in place? |
16:58:32 | FromDiscord | <Rika> i would |
16:58:50 | FromDiscord | <Rika> personally do what you said (`init`) |
17:12:04 | planetis[m] | ok thanks |
17:12:30 | * | ZoomZoomZoom joined #nim |
17:14:20 | FromDiscord | <Bung> I like initMyType or MyType.init |
17:29:04 | * | fredy12 joined #nim |
17:29:38 | * | fredy12 quit (Remote host closed the connection) |
17:29:44 | planetis[m] | i am used to initMyType being the one recomended (i think i read it in Nim in action) but in this case I think just `init` is better |
17:31:04 | planetis[m] | There is init in sets. `var s: HashSet; init s` |
17:32:34 | planetis[m] | however locks chose the long names `initLock L` and I am building on Locks... |
17:33:22 | planetis[m] | yeah I am totally nitpicking. I will leave it as is and do something better :) |
17:33:55 | * | Ozzyboshi234 joined #nim |
17:34:32 | * | Ozzyboshi234 quit (Remote host closed the connection) |
17:40:54 | FromDiscord | <Alea> does float != float64 by default? https://media.discordapp.net/attachments/371759389889003532/852240854276898876/unknown.png |
17:41:32 | FromDiscord | <codic> no |
17:41:37 | FromDiscord | <codic> the type of input is set to flot |
17:41:38 | FromDiscord | <codic> (edit) "flot" => "float" |
17:41:41 | FromDiscord | <codic> but you passed it an array |
17:41:47 | FromDiscord | <codic> (edit) "but you passed it an array ... " added "of floats, not a single float" |
17:43:42 | FromGitter | <kaushalmodi> Alea: See if this helps you (or confuses you) more :) I have done a similar analysis for int* types when I was understanding this: https://scripter.co/notes/nim/#int-types |
17:43:48 | FromGitter | <kaushalmodi> The same applies to float* types |
17:44:48 | FromGitter | <kaushalmodi> Relevant bit from there β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=60c0fe1002f6ee5b91e3130b] |
17:46:00 | * | narimiran quit (Ping timeout: 240 seconds) |
17:46:26 | FromDiscord | <Alea> In reply to @codic "but you passed it": so what should it be? |
17:46:32 | FromDiscord | <Alea> because the same syntax works for ints |
17:46:58 | FromDiscord | <Alea> wait nvm |
17:47:11 | * | SteveMarathon[m] joined #nim |
17:48:16 | FromGitter | <kaushalmodi> heh, nvm from me too.. I just looked at your "does float != float64" message |
17:48:32 | FromGitter | <kaushalmodi> turns out you were assigning an array to a float |
17:48:51 | FromDiscord | <Alea> I can't see a float equivalent to IntArray |
17:48:56 | FromDiscord | <Alea> so not sure how to define it |
17:49:30 | FromGitter | <kaushalmodi> > I can't see a float equivalent to IntArray β β What do you mean? What's an IntArray? |
17:49:57 | FromDiscord | <Alea> I was looking at this in the manual https://media.discordapp.net/attachments/371759389889003532/852243134067114014/unknown.png |
17:50:04 | FromDiscord | <Alea> but I just noticed that that's a custom type |
17:50:39 | FromDiscord | <Alea> so this should be it then |
17:50:42 | FromDiscord | <Alea> sent a code paste, see https://play.nim-lang.org/#ix= |
17:50:47 | FromGitter | <kaushalmodi> Nim has type inference, so you can just do β β ```let β input = [1.0, 2.0, 3.0]``` [https://gitter.im/nim-lang/Nim?at=60c0ff77ae78084ee73096e0] |
17:51:23 | FromGitter | <kaushalmodi> > sent a code paste β β That link doesn't show code to me |
17:52:37 | FromDiscord | <haxscramper> If you want to be super-explicit, you can also do `[1.float64, 2, 3]` I think |
17:52:47 | FromDiscord | <haxscramper> !eval echo typeof [1.float, 2, 3] |
17:52:49 | NimBot | array[0..2, float] |
17:52:58 | FromGitter | <kaushalmodi> Alea: See https://play.nim-lang.org/#ix=3pnx |
17:52:59 | FromDiscord | <haxscramper> !eval echo typeof [1.float64, 2, 3] |
17:53:01 | NimBot | array[0..2, float64] |
17:54:59 | FromDiscord | <Alea> alright a bit better grasp on this, thanks everyone |
17:57:35 | * | icey27 joined #nim |
17:57:35 | * | icey27 quit (Remote host closed the connection) |
17:57:41 | ForumUpdaterBot | New thread by Codic12: Safe signal handling, see https://forum.nim-lang.org/t/8103 |
17:58:19 | FromDiscord | <System64 ~ Flandre Scarlet> I still have problems with my GameMusicEmu lib, can someone help me please? |
18:00:06 | reversem3 | what should I be looking at <stdlib> if I want to search in thousands of files and compare them and pattern match to 1 file ? |
18:02:06 | * | wschlich joined #nim |
18:02:13 | * | wschlich quit (Remote host closed the connection) |
18:06:48 | ZoomZoomZoom | Hey, what does this line mean: "Only the release define (-d:release) cannot be set in NimScripts."? |
18:07:09 | ZoomZoomZoom | From https://nim-lang.org/docs/nims.html |
18:08:16 | ZoomZoomZoom | Just checked and setting release or danger defines works fine in config.nims, bot for `nimble build` and `nim c` |
18:09:19 | FromGitter | <kaushalmodi> > Just checked and setting release or danger defines works fine in config.nims, bot for nimble build and nim c β β That was fixed recently in devel |
18:10:32 | FromDiscord | <haxscramper> In reply to @reversem3 "what should I be": you want to compare files for equality and then pattern match (I assume by parsing content)? |
18:10:43 | FromGitter | <kaushalmodi> ZoomZoomZoom: https://github.com/nim-lang/Nim/commit/df429fa28772e077faa30dd6e3a701abf48c7669 |
18:12:14 | ZoomZoomZoom | Ah, great. Just stumbled upon this line and was afraid I'd recommended config.nims and said you can set any mode in it when it wasn't in fact so. So I'm in the clear :) |
18:12:47 | ZoomZoomZoom | Thanks @kaushalmodi |
18:12:59 | reversem3 | <FromDiscord "<haxscramper> In reply to @rever"> Correct in the end I want to be able to take a file and compare it to multiple files in a directory |
18:13:00 | FromGitter | <kaushalmodi> np, yay, 1 more config.nims fan :) |
18:16:02 | FromDiscord | <haxscramper> In reply to @reversem3 "<FromDiscord "<haxscramper> In reply": You can md5 hash a file using something like this, https://play.nim-lang.org/#ix=3pnH |
18:16:36 | FromDiscord | <haxscramper> The code is not mine - someone in the telegram chat asked a similar question, so I basically just copied relevant part |
18:17:12 | FromDiscord | <haxscramper> Though they mentioned this solution is slower compared to even python, so more optimized version (for example that does not read whole file at once via `readAll()`) can be used |
18:17:52 | FromDiscord | <haxscramper> There is also a https://nim-lang.org/docs/sha1.html#secureHashFile%2Cstring which might be better suited for computing file hashes |
18:17:57 | reversem3 | <FromDiscord "<haxscramper> In reply to @rever"> No I mean kind of what grep can do , by comparing the lines in a file to another file then writing out to screen. I want to take a file and compare the strings in the file and find a match in a directory of thousands of files. |
18:18:45 | reversem3 | does that make sense? |
18:19:15 | FromDiscord | <haxscramper> Just read file and compare lies to a pattern? `for file in walkDir(...): for line in lines(file): if line == pattern` |
18:19:47 | FromDiscord | <haxscramper> It would be slow as optimized versions like `rg/grep` use clever heuristics to speed things up |
18:19:49 | reversem3 | ok so os/walkDir is that it |
18:20:15 | reversem3 | yeah that is true |
18:40:44 | FromGitter | <kaushalmodi> treeform: Things become messy (readability goes out the window) when you deal with `pointer` instead of `ptr` :) β β Is this what you wanted? https://github.com/kaushalmodi/ptr_math/pull/5/files |
18:42:03 | FromDiscord | <treeform> Well usually when I deal with pointers its because my data is mixed types. |
18:42:20 | FromDiscord | <treeform> If its a flat array I just use UncheckedArray |
18:42:26 | FromDiscord | <treeform> (edit) "If its a flat array ... I" added "of a known" |
18:42:40 | FromDiscord | <treeform> (edit) "If its a flat array of a known ... I" added "type" |
18:43:02 | FromDiscord | <treeform> but yes your code appears to do what I wanted |
18:43:54 | * | dqi14 joined #nim |
18:44:26 | * | dqi14 quit (Remote host closed the connection) |
18:49:07 | * | tiorock joined #nim |
18:49:07 | * | tiorock quit (Changing host) |
18:49:07 | * | tiorock joined #nim |
18:49:07 | * | rockcavera is now known as Guest52282 |
18:49:08 | * | Guest52282 quit (Killed (datapacket.freenode.net (Nickname regained by services))) |
18:49:08 | * | tiorock is now known as rockcavera |
19:05:44 | * | mrpi29 joined #nim |
19:06:13 | * | mrpi29 quit (Remote host closed the connection) |
19:08:55 | FromGitter | <kaushalmodi> Cool, that PR is deployed now |
19:14:12 | FromDiscord | <treeform> I don't know though if the typed pointer functions are any better then using UncheckedArray? |
19:34:54 | * | pk004 joined #nim |
19:35:07 | * | pk004 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
19:38:48 | * | ZoomZoomZoom quit (Ping timeout: 240 seconds) |
19:41:30 | * | BrianKanhofer[m| joined #nim |
19:42:07 | * | BrianKanhofer[m| quit (Remote host closed the connection) |
19:46:49 | * | narimiran joined #nim |
19:57:02 | ForumUpdaterBot | New Nimble package! whois - A simple and free whois client, see https://gitea.com/Thisago/whois.nim |
20:06:11 | * | sz0 quit (Quit: Connection closed for inactivity) |
20:17:47 | FromDiscord | <Randall> sent a code paste, see https://play.nim-lang.org/#ix=3poi |
20:18:29 | FromDiscord | <ElegantBeef> Not premade, you could write a case statement macro to do it though |
20:20:49 | FromDiscord | <Randall> sent a code paste, see https://play.nim-lang.org/#ix=3pok |
20:22:00 | FromDiscord | <ElegantBeef> Assuming your rune is a single character yes, but then why are you even using rune |
20:23:38 | FromDiscord | <Randall> HTML5 parser. Tokenizer should handle codepoints, but most checks (e.g. is current char '<') are just single byte chars. |
20:24:37 | FromDiscord | <Randall> Is casting a rune to char the same as just taking the first byte of the rune? In that case this could be safe to do |
20:28:25 | FromDiscord | <ElegantBeef> No clue |
20:29:18 | * | tane quit (Quit: Leaving) |
20:32:47 | * | narimiran quit (Ping timeout: 272 seconds) |
20:57:03 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3poy |
20:57:15 | FromDiscord | <treeform> Rune is a uint32 so should be fast to check. |
21:27:52 | * | D_ quit (Ping timeout: 258 seconds) |
21:28:56 | * | letto quit (Read error: Connection reset by peer) |
21:29:29 | * | letto joined #nim |
21:29:42 | * | D_ joined #nim |
21:43:32 | * | Jjp137 quit (Read error: Connection reset by peer) |
21:44:24 | * | Jjp137 joined #nim |
21:48:31 | * | lritter quit (Quit: Leaving) |
21:58:47 | * | DerRaiden19 joined #nim |
21:59:16 | * | DerRaiden19 quit (Remote host closed the connection) |
22:16:51 | * | dgb quit (Quit: WeeChat 2.7.1) |
22:22:50 | * | ZoomZoomZoom joined #nim |
22:37:07 | * | D_ quit (Ping timeout: 245 seconds) |
22:38:30 | * | D_ joined #nim |
22:49:54 | * | nonara_ joined #nim |
22:50:30 | * | nonara_ quit (Remote host closed the connection) |
23:16:03 | * | e21fyk[m|gr] joined #nim |
23:16:19 | * | e21fyk[m|gr] quit (Remote host closed the connection) |
23:34:31 | * | wirew0rm1 joined #nim |
23:35:00 | * | wirew0rm1 quit (Remote host closed the connection) |
23:43:57 | FromDiscord | <ElegantBeef> Well i thought porting hottie to linux would've been relatively easy but it seems the rip it gives is not in the range of addresses so it never outputs a useful stack π |