00:28:34 | * | derpydoo joined #nim |
00:49:49 | * | xet7 quit (Read error: Connection reset by peer) |
01:01:01 | * | xet7 joined #nim |
01:08:36 | * | derpydoo quit (Quit: derpydoo) |
02:32:14 | * | beholders_eye quit (Ping timeout: 255 seconds) |
02:59:58 | FromDiscord | <Robyn [She/Her]> In reply to @xtrayambak "that's just stropping combined": not really, it's defined as an operator so you don't need a `.` |
03:00:14 | FromDiscord | <Robyn [She/Her]> In reply to @srmordred "importing `chronos` on my": tis the wonders of no IC |
03:12:38 | * | xet7 quit (Remote host closed the connection) |
04:00:41 | * | albe joined #nim |
04:01:10 | * | albe quit (Client Quit) |
04:01:31 | * | albe joined #nim |
05:45:11 | * | ntat joined #nim |
06:43:37 | FromDiscord | <zectbumo> Step 1, stop using steps↵Step 2, go back to step 1 |
08:25:47 | * | ntat quit (Quit: Leaving) |
08:26:41 | * | redj quit (Quit: No Ping reply in 180 seconds.) |
08:28:08 | * | redj joined #nim |
08:32:07 | * | ntat joined #nim |
09:10:49 | FromDiscord | <rakgew> ah I see via `.high` and `.low` - yes I like that even better \:-D↵(no sequtils import needed then) - thank you! |
09:23:09 | FromDiscord | <rakgew> sent a code paste, see https://play.nim-lang.org/#pasty=CmBrmwOK |
09:24:41 | Amun-Ra | you're playing a dangerous game ;) |
09:26:41 | FromDiscord | <rakgew> heheh, I never thought I would need stropping - but here we go \:-D |
09:27:10 | Amun-Ra | we need IOCCC for nim ;) |
09:27:23 | Amun-Ra | http://www.ioccc.org/ |
09:27:30 | Amun-Ra | "The International Obfuscated C Code Contest" |
09:28:03 | FromDiscord | <rakgew> heheh please noo.. ;-D |
09:30:46 | FromDiscord | <demotomohiro> I will submit this code: https://github.com/demotomohiro/invisinim |
09:31:22 | Amun-Ra | :D |
09:31:49 | FromDiscord | <rakgew> rofl - I do not want to peer review! ;-) |
09:32:23 | Amun-Ra | I had to hexdump that one ;) |
11:03:13 | FromDiscord | <spotlightkid> sent a code paste, see https://play.nim-lang.org/#pasty=YzfRVeBV |
11:06:24 | * | beholders_eye joined #nim |
11:43:35 | FromDiscord | <spotlightkid> sent a code paste, see https://play.nim-lang.org/#pasty=wgSCaOKn |
11:48:06 | FromDiscord | <spotlightkid> sent a code paste, see https://play.nim-lang.org/#pasty=DkAyBzOx |
11:53:45 | FromDiscord | <rakgew> sent a code paste, see https://play.nim-lang.org/#pasty=XeiWTVFs |
11:56:24 | FromDiscord | <rakgew> hm, now I spotted one error three lines below\:↵`outletNumber.int -4` should be↵`Outlet(outletNumber.int - 4)`↵but that does not solve the compile error above.. |
11:58:00 | FromDiscord | <demotomohiro> When you use `if` expression, all expressions on each branch must be the same type.↵And I think you want to use `toSeq`: https://nim-lang.org/docs/sequtils.html#toSeq.t%2Cuntyped |
11:59:44 | FromDiscord | <rakgew> thank you for answer and link @demotomohiro \:-D↵I thought all three branches of the conditional would be able to collect into a `seq[Outlet]`? |
12:01:08 | FromDiscord | <.kraptor> who should I contact if I cannot create an account in forum.nim-lang.org? It says "couldn't send email" everytime I try... |
12:08:01 | FromDiscord | <rakgew> hm, wrapped into `toSeq` gave me the ame error, but now with explicitely creating a `var outlets: seq[Outlet]` and adding to it it is the same type at each branch and compiles.. \\o/ |
12:11:03 | * | Guest63 joined #nim |
12:11:32 | * | Guest63 quit (Client Quit) |
12:28:02 | FromDiscord | <k0ts> sent a code paste, see https://play.nim-lang.org/#pasty=bdLjaAFd |
12:44:14 | FromDiscord | <arnetheduck> In reply to @alehander92 "<@449019668296892420> that's a hard": we'll happily accept a pr - broadly, for json to support case objects correctly, you need to do two passes over the json stream: one to pick out the type and a second to pick the right fields for that type, making sure that none are missing _and_ that you support any order of fields at the same time - there's some non-trivial logic and tradeoffs to do this correctly. |
12:46:52 | FromDiscord | <arnetheduck> when there is more than one "case" in the object, this becomes even more hairy .. fwiw, https://github.com/nim-lang/RFCs/issues/548 would help here because it keeps complexity down |
12:53:51 | * | ntat quit (Ping timeout: 252 seconds) |
13:09:01 | FromDiscord | <rakgew> true, looks a lot more succinct. thank you so much! \:-D↵(@k0ts) |
13:29:54 | FromDiscord | <spotlightkid> https://github.com/nim-lang/nimforum/issues/373↵(@.kraptor) |
13:49:18 | FromDiscord | <.kraptor> oh, I see... thanks |
14:05:07 | * | ryuukk quit (Remote host closed the connection) |
14:06:41 | * | ryuukk joined #nim |
14:11:00 | * | ryuukk quit (Ping timeout: 246 seconds) |
14:11:27 | * | ryuukk joined #nim |
14:13:25 | FromDiscord | <pmunch> In reply to @.kraptor "oh, I see... thanks": You could contact me |
14:25:31 | FromDiscord | <.bobbbob> was there some reason that its a bad idea to have code in the global scope instead of in a function and calling that function once in the global scope? Does code in when isMainModule still in the global scope? (global scope might not be the right word for it) |
14:26:34 | Amun-Ra | when does not change a scope |
14:27:05 | Amun-Ra | it works like compile-time switch |
14:27:28 | Amun-Ra | s/a scope/the scope/ |
14:28:03 | FromDiscord | <.bobbbob> so you should put code in some kind of main() function? |
14:28:19 | Amun-Ra | mhm |
14:29:20 | FromDiscord | <.bobbbob> okay, but I'm curious why if you don't mind |
14:29:20 | Amun-Ra | I always use sth like: https://play.nim-lang.org/#pasty=CfXMHxjT |
14:30:04 | Amun-Ra | tbh that depends on whether you need something to execute in compile-time ornot |
14:30:54 | Amun-Ra | I only have compiletime time code in global scope |
14:31:19 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=WcAAmSZY |
14:33:41 | Amun-Ra | list.incl int16 j |
14:34:02 | Amun-Ra | iirc there's no 16-bit integer range operator |
14:35:21 | * | def-- joined #nim |
14:35:31 | * | pbsds30 joined #nim |
14:35:49 | * | cnx_ joined #nim |
14:41:18 | * | def- quit (Ping timeout: 265 seconds) |
14:41:18 | * | pbsds3 quit (Ping timeout: 265 seconds) |
14:41:19 | * | FromDiscord quit (Ping timeout: 265 seconds) |
14:41:20 | * | cnx quit (Ping timeout: 265 seconds) |
14:41:20 | * | nisstyre quit (Ping timeout: 265 seconds) |
14:41:20 | * | def-- is now known as def- |
14:41:20 | * | pbsds30 is now known as pbsds3 |
14:41:21 | * | cnx_ is now known as cnx |
14:41:50 | * | FromDiscord joined #nim |
14:44:41 | FromDiscord | <kiloneie> Wait, why in the world is a HashSet[int] 120x slower than .add or index adding to a sequence, and even worse to a int16 set ? i didn't think the difference would be this insane... |
14:45:37 | Amun-Ra | I've never used it |
14:45:57 | Amun-Ra | seq does not need to compute the hash, tho |
14:51:31 | * | nisstyre joined #nim |
14:53:14 | FromDiscord | <demotomohiro> In reply to @kiloneie "Wait, why in the": When you access elements in `HashSet[int]`, input int value is hashed and that hash value is used to access the index in internal seq corresponding to the input int value.↵So accessing elements in `HashSet[int]` become random memory access that is slower than sequential memory access. |
14:56:50 | FromDiscord | <kiloneie> Hmm i should test this with already calculated hash |
14:57:33 | Amun-Ra | you can f.e. have a separate set[int] of keys as a cache |
14:58:01 | Amun-Ra | I don't not whether that's a good idea;) |
15:00:16 | FromDiscord | <odexine> set[int] is not possible |
15:00:38 | FromDiscord | <demotomohiro> In reply to @kiloneie "Hmm i should test": `HashSet` and `Table` might become faster in next Nim version as new faster hash function was added to stdlib: https://github.com/nim-lang/Nim/issues/23678 |
15:00:39 | FromDiscord | <odexine> too big of an entity |
15:03:18 | FromDiscord | <kiloneie> In reply to @demotomohiro "`HashSet` and `Table` might": What am i looking for ? i don't wanna read the entire thing D: |
15:07:11 | Amun-Ra | hmm |
15:17:01 | * | Guest13 joined #nim |
15:20:40 | * | Guest13 quit (Client Quit) |
15:44:58 | * | Guest13 joined #nim |
15:49:25 | FromDiscord | <.kraptor> @pmunch I did via DM... |
15:55:17 | * | Guest13 quit (Quit: Client closed) |
15:57:33 | * | ryuukk quit (Remote host closed the connection) |
15:59:26 | * | ryuukk joined #nim |
15:59:36 | * | coldfeet joined #nim |
16:02:44 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=UrVRwuwE |
16:03:22 | FromDiscord | <kiloneie> + the speed up demotomohiro is talking about. And they should be quite fast |
16:04:10 | FromDiscord | <kiloneie> in my case i think, i should if i am to spam objects of some sort, i should use a sequence, while everything else(in a game sense) could be a HashSet |
16:09:42 | FromDiscord | <kiloneie> So like, if one is to spam create a ton of HashSets, it could cause a problem, program freeze, but if the creation is on a much smaller case, it shouldn't be a problem. Now in a game sense, like having an enemy ship spam create Projectile type objects, it would be a problem, but in such a case, just use a sequence.↵↵Yes i know im rambling, done :P. |
16:10:32 | FromDiscord | <leorize> if it's a game, then you might want something other than HashSet if you use an integer identifier |
16:15:32 | FromDiscord | <kiloneie> What do you mean ? |
16:16:51 | FromDiscord | <leorize> see `PackedSet` |
16:17:11 | FromDiscord | <leorize> it's a lot more efficient when your storage is integer |
16:17:28 | FromDiscord | <leorize> since you don't incur hashing overhead |
16:21:03 | FromDiscord | <kiloneie> You mean an integer for the index instead of objects and such structures right ? Without even thinking i was gonna go there, though i did forget about PackedSet(theres too many changes and or modules in the stdlib for me to follow) |
16:21:55 | FromDiscord | <kiloneie> Wait, is packedSet a HashSet ? |
16:32:03 | FromDiscord | <sleeves> New to Nim, so I have a dumb question\: when making a program to be run interactively from a terminal emulator (as in continuous until exited), how do I handle closing the program? |
16:32:29 | FromDiscord | <sleeves> I tried to learn by example, but couldn't seem to find anything simple enough to be certain of how it works. |
16:34:37 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/system.html#quit%2Cint↵`quit` proc quits the program. |
16:35:58 | FromDiscord | <sleeves> I saw that before but assumed the warnings meant it wasn't ideal for most cases. Clearly I need to read more carefully, thanks \:-D |
16:36:32 | FromDiscord | <arm_3_d> sent a code paste, see https://play.nim-lang.org/#pasty=ZeErTtDA |
16:36:57 | FromDiscord | <arm_3_d> (edit) "https://play.nim-lang.org/#pasty=waxvIInV" => "https://play.nim-lang.org/#pasty=MpinCZxY" |
16:50:50 | * | rockcavera quit (Remote host closed the connection) |
17:02:11 | FromDiscord | <fabric.input_output> personally I would have done something like https://github.com/fabricio-p/nanobeam/blob/main/src/nanobeam/mutex.nim, made the object non-ref and putting it inside the `Mutex` at the place where I use it |
17:22:34 | FromDiscord | <arm_3_d> In reply to @fabric.input_output "personally I would have": looks interesting, thanks. that `with` procs are neat |
17:26:52 | FromDiscord | <kiloneie> In reply to @demotomohiro "`HashSet` and `Table` might": https://shorturl.at/4UtU6↵↵I assume X is bytes, vertical is ? Time in ms ? |
17:39:15 | * | derpydoo joined #nim |
17:55:19 | FromDiscord | <demotomohiro> In reply to @kiloneie "https://shorturl.at/4UtU6 I assume": I cannot access your URL. If you are talking about the graphs in the issue, X axis is input string size and Y axis is estimated cpu clock cycle if I remember correctly. |
18:07:50 | FromDiscord | <kiloneie> So the new Hashing function is called Farm(or more...) and is 3x smaller and faster ? |
18:10:02 | FromDiscord | <pmunch> In reply to @.kraptor "<@392962235737047041> I did via": So it seems! Not sure why but I never got a notification |
18:11:34 | FromDiscord | <dreadnought7600> Is it possible to have styled output at compile time? styledEcho says that it cannot evaluate stdout at comptime. But echo works fine. |
18:11:49 | FromDiscord | <kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=yijYIAii |
18:30:38 | * | xet7 joined #nim |
18:35:57 | * | derpydoo quit (Quit: derpydoo) |
19:09:42 | * | beholders_eye quit (Ping timeout: 252 seconds) |
19:38:01 | FromDiscord | <Phil> In reply to @.bobbbob "okay, but I'm curious": It has a bit to do with predictability.↵If you have 100 modules and all of them have some code that executes in global scope, you'll have a fun guess-time figuring out which code executes when.↵If you have a main-function, execution order is easier to follow, as at some point something within main will call a proc from the other module, meaning code-execution now happens over there etc. |
19:38:55 | FromDiscord | <Phil> (edit) "In reply to @.bobbbob "okay, but I'm curious": It has" => "sent" | "bit to do with predictability.↵If you have 100 modules and all of them have some code that executes in global scope, you'll have a fun guess-time figuring out which code executes when.↵If you have a main-function, execution order is easier to follow, as at some point something within main will call a proc from the other module, meaning code-execution now happe |
19:40:44 | FromDiscord | <Phil> Once module 64 at runtime may depend on something from module 85 stuff in global scope stuff gets super fun because now changing imports may brick stuff |
19:41:05 | FromDiscord | <Phil> (edit) "changing imports" => "just reorganizing import paths, like moving modules around in a specific way," |
19:41:24 | FromDiscord | <Phil> (edit) "64" => "64's global-scopee" |
19:46:10 | * | xet7 quit (Quit: Leaving) |
20:06:43 | FromDiscord | <melmass> Did anyone ever tried to use [Bazel](https://bazel.build) x Nim? |
20:28:58 | * | coldfeet quit (Quit: Lost terminal) |
20:36:41 | * | om3ga joined #nim |
20:54:28 | * | coldfeet joined #nim |
20:56:17 | * | coldfeet quit (Client Quit) |
21:16:53 | * | beholders_eye joined #nim |
21:28:48 | FromDiscord | <renegattoo> Hey guys. Is it possible to compile nim into just C? |
21:33:12 | FromDiscord | <Elegantbeef> What does that even mean? |
21:34:03 | FromDiscord | <renegattoo> It mean that the compilation result for the file x.nim would be file x.c. |
21:34:11 | FromDiscord | <renegattoo> (edit) "mean" => "means" |
21:34:52 | FromDiscord | <Elegantbeef> You can do `nim c -c --nimcache:/some/dir my.nim` and it'll output all the C files, but it's platform dependant C |
21:49:55 | * | lucasta joined #nim |
22:16:24 | FromDiscord | <xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=hpWLIGOK |
22:24:13 | FromDiscord | <Elegantbeef> There's not much you can automate here, the relations are not very opaque afaict |
22:48:34 | FromDiscord | <xkonti> Thanks for confirming that @ElegantBeef |