00:03:49 | FromDiscord | <ambient> sent a code paste, see https://paste.rs/72V |
00:04:04 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jEh |
00:04:29 | FromDiscord | <Phil> In reply to @ambient "This seems marginally faster": Whats your benchy results? |
00:06:04 | FromDiscord | <ambient> I really should write those tests, the difference does seem very miniscule |
00:06:30 | FromDiscord | <Phil> In reply to @ambient "I really should write": its really not difficult, benchy makes it trivial! |
00:11:27 | FromDiscord | <System64 ~ Flandre Scarlet> Do you know how I can display the Open File window with Nim please? |
00:11:31 | FromDiscord | <ambient> I think the hash Table uses is already int and the hashing function for ints is just returning an int, so... |
00:11:51 | FromDiscord | <ambient> I guess there's not much improvement to be gained there |
00:19:04 | FromDiscord | <Phil> In reply to @System64 "Do you know how": I haven't really written any guis in nim so I wouldn't know, you'll have to wait for others to come online with more knowledge in that area |
00:20:17 | FromDiscord | <Elegantbeef> https://github.com/Patitotective/tinydialogs |
00:22:09 | * | ltriant quit (Ping timeout: 256 seconds) |
00:22:30 | * | ltriant joined #nim |
00:22:51 | FromDiscord | <System64 ~ Flandre Scarlet> Thanks, gotta try it |
00:25:50 | FromDiscord | <System64 ~ Flandre Scarlet> Seems I have problems https://media.discordapp.net/attachments/371759389889003532/1057091904589807696/message.txt |
00:27:42 | * | ltriant quit (Ping timeout: 265 seconds) |
00:29:05 | FromDiscord | <<She>Horizon</Her>> In reply to @Isofruit "*shrugs*, either way I": Fair enough, i never used Windows even as a kid and was convinced it was crap lmao, win 7 was the best |
00:29:51 | FromDiscord | <System64 ~ Flandre Scarlet> The worst is it's C compiler errors |
00:31:59 | NimEventer | New thread by archnim: Try-catch misbehavior, see https://forum.nim-lang.org/t/9765 |
00:33:11 | FromDiscord | <albassort> @dom96 🥺 merge the 2 prs for packages |
00:34:02 | FromDiscord | <albassort> (edit) "@dom96 🥺 ... mergepackages?" added "can you please" | "packages" => "packages? thanks ily <3" |
00:35:40 | * | genpaku quit (Read error: Connection reset by peer) |
00:36:41 | * | genpaku joined #nim |
00:44:08 | NimEventer | New post on r/nim by His_son: Nim pgp library, see https://reddit.com/r/nim/comments/zw1wei/nim_pgp_library/ |
00:50:22 | FromDiscord | <Elegantbeef> Actually it might not hash int keys but it still is a compressed format |
00:50:25 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/hashes.nim#L209-L211 ah it does! |
00:50:28 | FromDiscord | <Elegantbeef> It should be a `Table` still should hash int keys afaik↵(@ambient) |
00:50:49 | FromDiscord | <albassort> In reply to @System64 "The worst is it's": what did you even do |
00:52:23 | FromDiscord | <Elegantbeef> @Patitotective\: did you make sure your bindings worked on windows? |
00:53:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @albassort "what did you even": I just installed tinydialogs on nimble and imported it |
00:53:51 | FromDiscord | <albassort> 🤔 |
00:53:55 | FromDiscord | <albassort> file a bug report |
00:53:59 | FromDiscord | <albassort> or read the docs |
00:54:04 | FromDiscord | <albassort> make sure you read the docs |
01:00:36 | FromDiscord | <System64 ~ Flandre Scarlet> I find nothing about that in the docss |
01:07:20 | * | ltriant joined #nim |
01:12:17 | * | ltriant quit (Ping timeout: 246 seconds) |
01:15:22 | * | nick2 quit (Quit: WeeChat 3.7.1) |
01:21:22 | FromDiscord | <jvsg> hello room! Just got into learning nim. I've got 2 questions\:↵1. Can someone give me the to native build system of nim? (I think I saw that somewhere)↵2. What's .cfg file for? |
01:23:21 | FromDiscord | <jvsg> I think it is meant for being parsed by std/parsecfg. Not sure though. |
01:28:28 | FromDiscord | <Elegantbeef> config files are for configurating the program |
01:28:46 | FromDiscord | <Elegantbeef> Rather compilation |
01:29:21 | FromDiscord | <Elegantbeef> Nim doesnt really have a build system, Nimble is a package manager that has build tasks, but you generally just use configuration files ime |
01:32:22 | FromDiscord | <Elegantbeef> I guess there is nake? |
01:38:12 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1057110118296199188/image.png |
01:38:21 | FromDiscord | <albassort> this error is a certified hood classic |
01:38:36 | FromDiscord | <Elegantbeef> What version of Nim? |
01:39:14 | FromDiscord | <albassort> 1.9.1 |
01:39:27 | FromDiscord | <albassort> updating arch |
01:39:50 | FromDiscord | <Elegantbeef> Odd that you're missing libssl |
01:40:07 | FromDiscord | <sOkam!> sent a long message, see http://ix.io/4jEH |
01:41:56 | FromDiscord | <sOkam!> That said, if you have a huge project, with tons of build options, nimble can do the job but it takes some getting used to the differences↵I tried nake, and i liked the concept, but its super old and it feels awkward to work around the issues. And nimble does the same, just with a different mindset |
01:42:43 | FromDiscord | <sOkam!> (edit) "That said, if you have a huge project, with tons of build options, ... nimble" added "edge cases, multiple output files, etc," |
01:43:36 | * | ltriant joined #nim |
01:45:35 | FromDiscord | <jtv> Nim have any access to builtin_clz (available both in gcc and llvm, usually compiling down to just a clz instruction?). Not finding it in google searches |
01:45:56 | FromDiscord | <Elegantbeef> Probably not in the stdlib but you can import it |
01:46:42 | FromDiscord | <jtv> Makes sense, thanks |
01:53:35 | * | ltriant quit (Ping timeout: 246 seconds) |
01:54:27 | NimEventer | New Nimble package! bitables - bidirectional {maps, tables, dictionaries} in nim, see https://github.com/Retkid/bitables |
02:04:54 | * | ltriant joined #nim |
02:18:23 | * | ltriant quit (Ping timeout: 265 seconds) |
02:25:39 | FromDiscord | <albassort> nice |
02:41:23 | * | byanka quit (Ping timeout: 260 seconds) |
02:51:43 | * | ltriant joined #nim |
02:57:03 | * | ltriant quit (Ping timeout: 268 seconds) |
03:08:19 | * | ltriant joined #nim |
03:13:42 | * | ltriant quit (Ping timeout: 268 seconds) |
03:46:18 | * | ltriant joined #nim |
03:51:30 | * | ltriant quit (Ping timeout: 272 seconds) |
04:44:08 | * | nick3 joined #nim |
04:48:16 | * | arkurious quit (Quit: Leaving) |
04:59:58 | FromDiscord | <PunchCake> can someone whos running linux help me with testing a javafx jar app i made? |
05:35:36 | * | ltriant joined #nim |
05:46:18 | * | ltriant quit (Ping timeout: 260 seconds) |
06:04:16 | * | nick3 quit (Quit: WeeChat 3.7.1) |
06:18:36 | * | tiorock joined #nim |
06:18:36 | * | tiorock quit (Changing host) |
06:18:36 | * | tiorock joined #nim |
06:18:37 | * | rockcavera is now known as Guest8400 |
06:18:37 | * | tiorock is now known as rockcavera |
06:18:40 | NimEventer | New Nimble package! libpcap - A wrapper for the libpcap library, see https://github.com/praetoriannero/nim_libpcap |
06:21:20 | * | Guest8400 quit (Ping timeout: 246 seconds) |
07:05:29 | FromDiscord | <demotomohiro> @jtv builtin_clz is used in bitops module: https://github.com/nim-lang/Nim/search?q=builtin_clz&type= |
07:05:35 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jFp |
07:06:13 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4jFp" => "https://play.nim-lang.org/#ix=4jFq" |
07:17:21 | FromDiscord | <Elegantbeef> A bitset |
07:24:17 | FromDiscord | <sOkam!> can you give a very minimalistic example, so i can look for the idea on the manual? |
07:24:46 | FromDiscord | <sOkam!> trying to search them, but as usual I'm failing at navigating the docs 😔 |
07:25:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jFs |
07:27:17 | FromDiscord | <sOkam!> ty |
07:30:02 | FromDiscord | <Elegantbeef> In Nim whenever you'd use an integer bitflag you're always better to use a bitset |
07:30:20 | FromDiscord | <Elegantbeef> It's just more readable and easier |
07:31:27 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jFt |
07:31:33 | FromDiscord | <Elegantbeef> Yes |
07:31:51 | FromDiscord | <sOkam!> much more readable, definitely, yep |
07:42:24 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jFv |
07:43:37 | FromDiscord | <Elegantbeef> Not really |
07:50:45 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4jFx |
07:51:12 | FromDiscord | <Elegantbeef> I have 0 context here |
07:51:27 | FromDiscord | <sOkam!> (edit) "https://play.nim-lang.org/#ix=4jFx" => "https://play.nim-lang.org/#ix=4jFy" |
07:51:34 | FromDiscord | <sOkam!> In reply to @Elegantbeef "I have 0 context": its what you wrote, exact |
07:51:37 | FromDiscord | <Elegantbeef> Yes that's going to fail |
07:51:41 | FromDiscord | <Elegantbeef> No it's not |
07:51:49 | FromDiscord | <sOkam!> whats the diff? |
07:51:50 | FromDiscord | <Elegantbeef> I imported `std/setutils` and used `[]=` |
07:52:34 | FromDiscord | <sOkam!> oh! `signbits[it]` 🤦♂️ |
07:55:24 | * | ltriant joined #nim |
08:02:19 | * | ltriant quit (Ping timeout: 252 seconds) |
08:16:11 | * | ltriant joined #nim |
08:42:14 | * | ltriant quit (Ping timeout: 252 seconds) |
09:13:57 | * | kenran joined #nim |
09:15:11 | * | kenran quit (Remote host closed the connection) |
09:15:29 | * | kenran joined #nim |
09:16:01 | * | kenran quit (Remote host closed the connection) |
09:27:12 | * | ltriant joined #nim |
09:35:07 | * | ltriant quit (Ping timeout: 248 seconds) |
09:55:29 | * | ltriant joined #nim |
10:00:24 | * | ltriant quit (Ping timeout: 260 seconds) |
10:18:47 | FromDiscord | <Phil> I have awakened! |
10:25:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jG8 |
10:25:19 | FromDiscord | <Phil> The only thing that changed is I'm not in a loop |
10:25:26 | FromDiscord | <Phil> (edit) "not" => "now" |
10:26:57 | FromDiscord | <Phil> This issue is semi-fixable by making the filePath parameter `static string`, but then I need to figure out how to generate a `seq[static string]` to loop over via unrolling the-forloop as without that the strings become non-static and that's just way too much of a pain |
10:27:43 | FromDiscord | <Phil> I guess my main issue here is that sometimes filePath gets implicitly treated like a NimNode (when I call the macro directly) and sometimes like an actual string and that's just weird |
10:40:47 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jGd |
10:41:26 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4jGd" => "https://paste.rs/3yD" |
10:42:35 | FromDiscord | <leorize> because macros are not procs |
10:43:43 | FromDiscord | <Vindaar> In reply to @Isofruit "Beef or anyone here": `node laks field: strVal` means that the node you hand (in this case `fieldPath` is not a `nnkIdent` or `nnkSym` or literal string. Therefore it has no string field. It's because when handing stuff to a macro (e.g. argument is a string, it's not really a string). Print the node with `treeRepr` to see what it is |
10:43:53 | FromDiscord | <leorize> so, uh, all inputs to macros are the NimNode of the expression |
10:45:14 | FromDiscord | <Phil> But shouldn't that be fixed if I hand it `newLit(path)` ? That is a NimNode (should be string-literal NimNode afaiu) and playing around with it in inim, that also works with strval |
10:46:08 | FromDiscord | <leorize> you are actually handing it the actual AST of the call |
10:46:24 | FromDiscord | <Phil> Ohhhhhhh god damnit |
10:47:02 | FromDiscord | <leorize> now, a cheap trick to get it work the way you want is via abusing generics |
10:47:17 | FromDiscord | <leorize> aka `static[T]` parameters |
10:48:51 | FromDiscord | <leorize> btw, compile time procs are perfect for the case of helper macros if you need them |
10:49:26 | FromDiscord | <leorize> in your case you probably just want static string for the second parameter |
10:49:36 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jGf |
10:50:17 | FromDiscord | <Phil> In reply to @leorize "in your case you": That one runs into the problem that I have no idea how to properly instantiate a seq[static string], nor how to iterate over it in a way that keeps the strings as static strings without unrolling the sequence via macro |
10:50:29 | FromDiscord | <Phil> (edit) "In reply to @leorize "in your case you": That one runs into the problem that I have no idea how to properly instantiate a seq[static string], nor how to iterate over it in a way that keeps the strings as static strings without unrolling ... the" added " the loop over" |
10:51:00 | FromDiscord | <Phil> The "standard" ways have failed me: `let x: seq[static string] = @["lala", "lulu"] |
10:51:05 | FromDiscord | <Phil> (edit) ""lulu"]" => ""lulu"]`" |
10:51:16 | FromDiscord | <Phil> And I can't really throw the individual strings into static blocks |
10:51:21 | FromDiscord | <Phil> Making it a const doesn't change anything either |
10:52:25 | FromDiscord | <leorize> move the static out \:p |
10:52:26 | FromDiscord | <leorize> not a real type but rather a modifier |
10:52:26 | FromDiscord | <leorize> and... here's the unintuitive thing about `static[T]` |
10:52:27 | FromDiscord | <leorize> the only thing it meant is that the parameter must be computable at compile time |
10:52:27 | FromDiscord | <leorize> think var parameters |
10:52:47 | FromDiscord | <leorize> (except when it's not 🙃) |
10:54:41 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/WCV |
10:54:42 | FromDiscord | <leorize> alternatively, generate the AST that do the thing you want instead of reading the string within the macro |
10:55:23 | FromDiscord | <Phil> With this macro definition:↵`macro addMockPragma(projectPath: static string, filePath: string): untyped =` |
10:55:35 | FromDiscord | <leorize> filePath must be static |
10:56:26 | FromDiscord | <leorize> actually, what are you trying to do? |
10:56:57 | FromDiscord | <leorize> I have a hunch that your implementation might back you into a corner |
10:57:01 | FromDiscord | <Phil> I have a macro that reads in a module file (for the provided path), parses it into an AST, modifies the AST and writes the output back into the module-file, overwriting what was previously there. |
10:57:37 | FromDiscord | <Phil> I want to apply this to macro to a sequence of module-paths, basically expanding from "do this to 1 specific module" to "do this to all modules" |
10:57:43 | FromDiscord | <Phil> (edit) removed "to" |
10:57:47 | FromDiscord | <leorize> are you sure you don't want to write a compiler pass? \:p |
10:58:26 | FromDiscord | <Phil> I have baby macro knowledge and am trying to stay in the vague bizarro land that I've only barely started to become familiar with |
10:58:41 | FromDiscord | <vindaar> you can just write a helper proc `getStr` that takes the input and depending on the kind (ident, sym, hidden deref etc) return the correct string literal. That way at least you don't have to change much↵(@Phil) |
10:59:40 | FromDiscord | <leorize> the best way to get this done is to make that other macro of yours expose the API as a proc |
10:59:48 | FromDiscord | <Phil> In reply to @vindaar "you can just write": How do you actually extract the string value of... is that a SymNode in a HiddenDeref node? |
11:00:15 | FromDiscord | <Phil> slap a `$` before it and do `$filePath` if it's this construct of HiddenDeref Sym"path" ? |
11:00:33 | FromDiscord | <leorize> then you can work on it using a static block, and you can use a macro as a usermode wrapper |
11:01:30 | FromDiscord | <vindaar> no, by doing `n[0].strVal` because (as you can see from the `treeRepr` printing) the first child of `n` is an `nnkSym`↵(@Phil) |
11:01:32 | FromDiscord | <Phil> In reply to @leorize "the best way to": Other macro? There only is 1 macro:↵`macro addMockPragma(projectPath: static string, filePath: static string): untyped =`, everything else is a compile-time proc |
11:02:17 | FromDiscord | <vindaar> (no referring to your slapping a `$` before it) |
11:04:39 | FromDiscord | <leorize> have a version of that macro that's a regular proc is what I meant↵(@Phil) |
11:05:24 | FromDiscord | <leorize> a proc is infinitely easier to program with |
11:07:29 | FromDiscord | <leorize> so you want a macro when you want to emit NimNode that replaces the macro call |
11:07:34 | FromDiscord | <Phil> In reply to @vindaar "no, by doing `n[0].strVal`": Turns out that strVal on a symNode gets you the symbol-name as a string, not the value attached, hmmmmm |
11:08:21 | FromDiscord | <leorize> in your case you are just using the compiler facilities to do whole-file modifications, so you don't need macros here |
11:09:22 | FromDiscord | <vindaar> Ah, certainly. Sorry, I was under the wrong impression of what you actually want / need \:(↵(@Phil) |
11:10:01 | FromDiscord | <Phil> In reply to @leorize "in your case you": I'll....errr try and see how far I can get before no longer understanding how to solve my problems, one minute |
11:11:15 | FromDiscord | <Phil> Okay, so the proc version works! |
11:11:23 | FromDiscord | <Phil> For a single module |
11:11:31 | FromDiscord | <Phil> Now I still need to figure out the entire static seq string thing |
11:11:50 | FromDiscord | <leorize> it's a proc now |
11:11:58 | FromDiscord | <leorize> so just use it like a proc |
11:12:07 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jGq |
11:12:37 | FromDiscord | <leorize> just get rid of the statics |
11:12:50 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jGr |
11:13:03 | FromDiscord | <leorize> static is only required when it's a macro |
11:13:54 | FromDiscord | <leorize> static on macros is actually a hack using generics to give you the feel of passing actual data around instead of nodes |
11:14:33 | FromDiscord | <leorize> I'd avoid it unless you need it, it limits the flexibility of the API |
11:14:43 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/lfh |
11:14:53 | FromDiscord | <vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4jGt |
11:15:00 | FromDiscord | <vindaar> ah, I was too slow 😁 |
11:15:04 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4jGv" => "https://play.nim-lang.org/#ix=4jGu" |
11:15:17 | FromDiscord | <vindaar> might be a hack, but is very convenient sometimes 🤭 |
11:15:32 | FromDiscord | <Phil> Thanks you guys! |
11:15:54 | FromDiscord | <Phil> What's slightly funny is that the entire "read in module, modify ast, write module" completely destroys formatting |
11:16:20 | FromDiscord | <leorize> yea, the AST doesn't really care about the input |
11:16:26 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jGw |
11:36:16 | NimEventer | New thread by fzqdoo: Is there a traditional rounding function?, see https://forum.nim-lang.org/t/9766 |
11:38:08 | * | jmdaemon quit (Ping timeout: 268 seconds) |
11:41:09 | FromDiscord | <Prestige> I'm surprised to see out params being added |
11:56:11 | FromDiscord | <Prestige> Don't really understand why that's necessary |
12:16:39 | FromDiscord | <Phil> Out Params? |
12:19:23 | FromDiscord | <Phil> Ohhh parameters that explicitly mark that they're the place where the output will be written to |
12:19:51 | FromDiscord | <Phil> I think I like it just for the syntactic clarity of it |
12:45:16 | * | ltriant joined #nim |
12:50:11 | * | ltriant quit (Ping timeout: 252 seconds) |
12:55:05 | FromDiscord | <exelotl> It's for definite assignment analysis↵With a var param you tell the compiler this variable may be modified↵With an out param you tell the compiler this variable _will_ be fully initialized |
13:11:29 | * | PMunch joined #nim |
13:12:20 | * | ltriant joined #nim |
13:17:19 | * | ltriant quit (Ping timeout: 260 seconds) |
13:43:01 | * | rockcavera quit (Remote host closed the connection) |
14:11:17 | * | rockcavera joined #nim |
14:35:21 | PMunch | Is there a way to update all Nimble packages? |
14:36:49 | * | ltriant joined #nim |
14:39:45 | * | arkurious joined #nim |
14:41:56 | * | ltriant quit (Ping timeout: 252 seconds) |
15:06:07 | FromDiscord | <Phil> sent a long message, see http://ix.io/4jHv |
15:06:41 | FromDiscord | <Phil> (edit) "http://ix.io/4jHv" => "http://ix.io/4jHw" |
15:11:29 | PMunch | I haven't followed the discussion, so disregard what I'm saying if it's stupid or has already been discussed. But couldn't you in your test instead of importing modules do a `mockableImport mymodule` which reads the file for the module, transforms it into something you can mock, e.g. with the variable trick, stores the result in some temporary folder, and then imports that? |
15:12:36 | FromDiscord | <Phil> In reply to @PMunch "I haven't followed the": But that would just give me mock-symbols in my test, right?↵It wouldn't affect the place where `a()` calls `otherProc()` from OtherModule, because that import happens in `ModuleUnderTest.nim`, right? |
15:13:40 | PMunch | Well as long as the mock variable is changed before the invocation of the procedure it should work I believe |
15:15:50 | FromDiscord | <Phil> sent a long message, see https://paste.rs/C9m |
15:16:08 | PMunch | Something a bit like this: https://play.nim-lang.org/#ix=4jHy |
15:17:39 | PMunch | There the uncommented `mockImport` call would find `somemodule` and rewrite it to what's above the line in some temporary directory and then import that. |
15:19:33 | PMunch | I guess you might have to also replace relevant imports with mockImport in the imported module though if you want to mock deeper than one level |
15:19:39 | FromDiscord | <Phil> sent a long message, see http://ix.io/4jHA |
15:19:55 | FromDiscord | <Phil> (edit) "http://ix.io/4jHA" => "http://ix.io/4jHB" |
15:21:33 | FromDiscord | <Phil> What I'd need to do is have 2 special kinds of import:↵`ModuleUnderTestImport` and `MockImport`.↵`ModuleUnderTestImport` would read in said module, rewrite the import-statements to point to all things in `MockImport` and that'd be it |
15:22:02 | FromDiscord | <Phil> And then in your test you no longer test your actual source-code, but the modified version where you rewrote the import statements |
15:23:11 | FromDiscord | <Phil> That's a version I could see working, though it involves a bit more effort because `ModuleUnderTestImport`would need to be aware of all `MockImports` in order to rewrite the imports properly |
15:23:35 | FromDiscord | <Phil> (edit) "rewrite the imports properly" => "know which import statements in `ModuleUnderTest` need to be rewritten" |
16:19:34 | NimEventer | New thread by DougT: Parallel Fibonacci, see https://forum.nim-lang.org/t/9768 |
16:19:36 | FromDiscord | <Phil> sent a long message, see https://paste.rs/Sah |
16:20:32 | FromDiscord | <Phil> SOmetimes I just take ages to properly understand what people suggest when the field is just strange to me in general ^^' |
16:23:11 | FromDiscord | <tyrion> Hello, if I have a `ref` to an array, can I obtain a `ref` to the array containing its last 3 elements? |
16:24:32 | FromDiscord | <Phil> In reply to @tyrion "Hello, if I have": You mean a ref to a slice of an array? |
16:26:04 | FromDiscord | <tyrion> I guess ... can that be assigned to `ref array[T, float]` though?↵(@Phil) |
16:27:16 | FromDiscord | <Phil> Was that also your idea btw jmgomez? Make copies of the modules, modify the imports of the module under test to point to the copied mockable modules and work from there? |
16:27:57 | FromDiscord | <Phil> (edit) "modules," => "modules used by module-under-test so that their procs are mockable," | "module under test" => "module-under-test" |
16:28:28 | FromDiscord | <jmgomez> sent a long message, see https://paste.rs/E3u |
16:29:30 | FromDiscord | <jmgomez> In reply to @Isofruit "Was that also your": Nope, but that could work too |
16:31:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jHP |
16:31:47 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4jHP" => "https://play.nim-lang.org/#ix=4jHQ" |
16:32:02 | FromDiscord | <tyrion> That's why I am using a ref to an array instead of the array directly. So the copying is not a problem but I still need to find a way to shift that pointer as needed eheh↵(@Phil) |
16:33:30 | FromDiscord | <Phil> In that case my bad, I work with arrays so rarely, I couldn't even name you the syntax on how to get a ref for an array |
16:34:19 | FromDiscord | <Phil> In reply to @jmgomez "Hey Phil, what I": I think this may just go significantly beyond my current macro skill ceiling |
16:35:03 | FromDiscord | <Phil> What I'm getting is "read in the procs, modify them before usage to point to other procs, then execute" and that I definitely have not the faintest idea on how to do |
16:44:50 | PMunch | @Phil, if you limit the scope to only modules in the current package it would be feasible to simply copy the entire package tree and rewrite all the modules I guess. Then the relative paths would all be the same |
16:52:25 | FromDiscord | <BiffBaff64> Could I ask what IDEs or editors people are using for Nim? I want to get started asap. |
16:53:12 | PMunch | Many people use VSCode |
16:53:16 | PMunch | Personally I use Vim |
16:53:37 | PMunch | I think for VSCode you'd use saems extension and possibly also an LSP client |
16:54:11 | PMunch | In Vim I use zah/nim and LSP with NimLSP |
16:55:20 | FromDiscord | <Phil> In reply to @BiffBaff64 "Could I ask what": Intellij, imo it has better autocomplete, though intellij is a smidge slower and in other regards a chonkier IDE than vscode |
16:55:48 | FromDiscord | <Phil> Though it really doesn't matter which jetbrains IDE, nim-compatibility comes through a plugin and IIRC they work on all jetbrains IDEs |
16:57:18 | FromDiscord | <BiffBaff64> In reply to @Isofruit "Intellij, imo it has": I'm very glad you've said Intellij. Jetbrains IDEs are my favourite ones to use. Is there just one plugin, or can you recommend one? |
16:57:34 | FromDiscord | <Phil> just the one |
16:58:44 | FromDiscord | <Phil> In reply to @BiffBaff64 "I'm very glad you've": Just so you're aware of the scope:↵It's mostly autocomplete, following symbols to their place of definition by clicking on them (which doesn't always work) and syntax highlighting |
16:59:04 | FromDiscord | <Phil> For actual build-task stuff you'll still want to look into how nimble works and likely nimble tasks etc. |
16:59:26 | FromDiscord | <Phil> And you also won't be able to set stuff like the version of your nim compiler from within intellij like you can with java |
16:59:29 | FromDiscord | <BiffBaff64> In reply to @Isofruit "For actual build-task stuff": Right, thanks 👍 |
17:03:29 | FromDiscord | <Phil> In reply to @BiffBaff64 "Right, thanks 👍": That's the one you're looking for https://media.discordapp.net/attachments/371759389889003532/1057342968715022406/image.png |
17:09:14 | FromDiscord | <BiffBaff64> That's fantastic, many thanks for the help ! Much appreciated 👍 |
17:24:27 | FromDiscord | <albassort> sent a long message, see https://paste.rs/wtF |
17:25:49 | FromDiscord | <Phil> In reply to @albassort "Two things I want": See, I'm more modest, all I want is perfect proc mockability and maybe I'll get there in the next few weeks |
17:26:44 | FromDiscord | <tyrion> No worries! thanks anyway \:)↵(@Phil) |
17:27:02 | FromDiscord | <Phil> In reply to @tyrion "No worries! thanks anyway": PMunch may though, he does also do array stuff I think! |
17:27:13 | FromDiscord | <Phil> And that should've pinged him, the perfect setup |
17:27:15 | FromDiscord | <albassort> These are stretch goals, I doubt they'll be easy |
17:27:22 | FromDiscord | <tyrion> @Phil\: to obtain a reference to an array you have to create it with new, so what I do is `array[10, float].new()` |
17:27:30 | FromDiscord | <albassort> I want to get them done by the end the of year |
17:29:28 | * | arkanoid quit (Ping timeout: 265 seconds) |
17:31:20 | FromDiscord | <Phil> In reply to @tyrion "<@180601887916163073>\: to obtain a": With that ref I still get the same copy behaviour, so my assumption of "doesn't work" remains my current opinion |
17:31:36 | FromDiscord | <EchoPouet> In reply to @Isofruit "That's the one you're": The debugging support is good ? |
17:31:56 | FromDiscord | <Phil> Not using the debugging support, couldn't tell you.↵I debug by virtue of the compiler |
17:32:17 | FromDiscord | <EchoPouet> Ok |
17:32:20 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jI9 |
17:32:49 | FromDiscord | <tyrion> the thing is that now `y` is not a ref to an array |
17:33:07 | FromDiscord | <tyrion> not sure what is, but it's something else |
17:33:19 | FromDiscord | <Phil> Likely it is an actual array instead of a ref to one |
17:33:43 | FromDiscord | <Phil> In reply to @PotAuFeu "Ok": Also it's part of the professional versions aka you need to pay money, which I don't, I'm a cheap fuck |
17:34:08 | * | ltriant joined #nim |
17:34:32 | FromDiscord | <tyrion> @Phil\: `typeof y` shows `seq[int]` |
17:34:58 | FromDiscord | <EchoPouet> In reply to @Isofruit "Also it's part of": Arf 😞 |
17:35:17 | FromDiscord | <tyrion> so, I don't think slices are the correct way to do it |
17:35:25 | FromDiscord | <tyrion> probably I need some form of unsafe pointer |
17:35:49 | * | wallabra quit (Ping timeout: 252 seconds) |
17:35:50 | FromDiscord | <tyrion> let me see if chatgpt knows ahah |
17:37:15 | * | wallabra joined #nim |
17:37:24 | * | pro joined #nim |
17:38:28 | FromDiscord | <tyrion> umh, it just lies, too bad \:'( |
17:39:02 | * | ltriant quit (Ping timeout: 252 seconds) |
17:47:15 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I have this error while compiling to 64 bits? https://media.discordapp.net/attachments/371759389889003532/1057353983183835196/message.txt |
17:50:15 | FromDiscord | <auxym> @Phil @tyrion this works, but probably not the prettiest way to achieve whatever you are trying to achieve https://play.nim-lang.org/#ix=4jIe |
17:51:20 | FromDiscord | <Phil> In reply to @System64 "Is it normal I": @hotdog I have summoned you, somebody is running into jester compile problems |
17:51:34 | FromDiscord | <tyrion> @auxym\: thanks, this is what i am currently doing, now I would like `c` to be a ref to just a subset of the array though |
17:52:10 | FromDiscord | <tyrion> My understanding is that I have to resort to `unsafeAddr` and casts ... I will see if I manage to get something working |
17:52:13 | FromDiscord | <Phil> That looks like a recursive import issue based on just staring at `In file included from In file included from In file included from` |
17:52:38 | FromDiscord | <Phil> But I could be wrong. Are you doing a recursive import (module A imports module B which imports module A) ? |
17:53:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Isofruit "But I could be": I only have one module |
17:54:28 | FromDiscord | <System64 ~ Flandre Scarlet> Even more sus : it works on 32-bits |
17:54:29 | FromDiscord | <Phil> In that case posting that source-code may help |
17:54:32 | FromDiscord | <hotdog> In reply to @Isofruit "<@472459996068839424> I have": I'm unfamiliar with both Jester and compiling on Windows I'm afraid |
17:54:52 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4jIg |
17:55:33 | FromDiscord | <Phil> This.... works? Isn't that some code being used for a server while other code is used to be JS for a page? |
17:55:54 | FromDiscord | <hotdog> @System64 ~ Flandre Scarlet what compiler flags are set in your `compile.sh`? |
17:56:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @hotdog "<@380360389377916939> what compiler flags": ``nim compile -r --cpu:i386 --threads:on -d:nimDontSetUtf8CodePage --app:gui main.nim`` |
17:56:43 | FromDiscord | <System64 ~ Flandre Scarlet> wait a minute |
17:56:54 | FromDiscord | <Phil> Wait, this is an issue because neel uses jester, ahhh |
17:57:22 | FromDiscord | <System64 ~ Flandre Scarlet> No, the issue was CPU flag |
17:58:13 | FromDiscord | <Phil> Nah as in, I was wondering whether he hell the jester bits of the stacktrace came from |
17:59:00 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4jIj |
17:59:02 | FromDiscord | <auxym> or something like that |
17:59:36 | FromDiscord | <auxym> and create your own `[]`. `[]=`, toOpenArray, etc procs for the desired behavior |
18:00:10 | FromDiscord | <auxym> (edit) "https://paste.rs/ApI" => "https://paste.rs/r3x" |
18:03:50 | FromDiscord | <System64 ~ Flandre Scarlet> Okay I fixed all problems |
18:08:19 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Im getting `Invalid Type: openArray[Glob]`. What does this mean? |
18:12:25 | FromDiscord | <tyrion> I assume not..? |
18:12:27 | FromDiscord | <tyrion> @auxym\: the only thing that seems bad about using unsafe pointers is that, if I understood correctly they are not tracked by the garbage collector... so I could end up with a pointer pointing to nothing. Is there no way to start from a `ref array`, increment the pointer and cast it back to a `ref`? |
18:27:03 | FromDiscord | <tyrion> umh, I am digging a hole that is going deep very fast, https://nim-lang.org/docs/destructors.html |
18:28:42 | Amun-Ra | mhm |
18:28:53 | Amun-Ra | that's gc dependent |
18:29:19 | Amun-Ra | sometimes Nim destructors act just like Python ones |
18:30:54 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4jIq |
18:31:27 | FromDiscord | <@thatrandomperson5-6310e3b26da03> sent a code paste, see https://play.nim-lang.org/#ix=4jIr |
18:32:26 | FromDiscord | <System64 ~ Flandre Scarlet> ``C:\Users\USER\Downloads\palette.pal64`` Do you know how I can get the ".pal64" string from this string please? |
18:37:30 | Amun-Ra | too vague for me |
18:42:43 | termer | https://nim-lang.org/docs/os.html#splitFile%2Cstring |
18:42:45 | termer | Use this |
18:49:42 | FromDiscord | <System64 ~ Flandre Scarlet> Ah yeah, I used that, it works fine↵Thanks |
18:51:20 | FromDiscord | <auxym> In reply to @tyrion "<@882793909246369864>\: the only thing": No, refs in nim can only be created by creating a new allocation with (`new`) or assigning from an existing ref, you can't modify the underlying pointer. And yes, the main risk with raw pointers, in your case, is use-after-free (trying to use the pointer after the GC has destroyed the reference) |
18:53:31 | FromDiscord | <auxym> In reply to @@thatrandomperson5-6310e3b26da03 "> Im getting `Invalid": it sounds like maybe the Glob type isn't accessible in the scope that function is defined in? |
18:57:36 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Glob from here\: https://github.com/haltcase/glob/blob/64f71af2fa4572c2bdf8987a56a427c1d88fc34f/src/glob.nim#L152↵(@auxym) |
18:57:41 | FromDiscord | <@thatrandomperson5-6310e3b26da03> should be public |
18:58:51 | FromDiscord | <@thatrandomperson5-6310e3b26da03> And wouldn’t that be undeclared identifier not invalid type? |
19:01:32 | FromDiscord | <Phil> Do we have a convenience function that writes a file to a path come what may, essentially creating the directories if they aren't there? |
19:01:46 | FromDiscord | <Phil> Because `writeFile` isn't it |
19:02:30 | FromDiscord | <demotomohiro> I have never seen such a procedure in stdlib. |
19:02:53 | FromDiscord | <Phil> Basically if only `/tmp` exists and I want to write to `/tmp/potato/yehaw/bla.txt` then it just creates the necessary directories |
19:03:16 | FromDiscord | <Phil> Some bash commands do it, so I had faint hopes that nim maybe does as well |
19:04:05 | FromDiscord | <demotomohiro> iirc, os.mkdir creates all necessary directories. |
19:11:14 | FromDiscord | <demotomohiro> sent a long message, see https://paste.rs/VfJ |
19:12:56 | FromDiscord | <auxym> In reply to @@thatrandomperson5-6310e3b26da03 "should be public": yes, if you import it 🙂 |
19:13:50 | FromDiscord | <auxym> but you're right it might have been undeclared identifier, |
19:14:04 | FromDiscord | <auxym> no idea what it could be otherwise |
19:17:37 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > but you're right it might have been undeclared identifier,↵I found the issue, there was an openarray in a type def on a completely different line. So i guess the compiler was confused |
19:18:37 | FromDiscord | <Phil> In reply to @demotomohiro "I think you can": Sadly you can't use mkdir at compile time |
19:18:40 | FromDiscord | <Phil> Which is highly annyoing |
19:18:43 | FromDiscord | <Phil> (edit) "annyoing" => "annoying" |
19:19:02 | FromDiscord | <Phil> You can write files at compile time though, which is confusing |
19:22:12 | FromDiscord | <Phil> Okay, so I have to read in and parse code and that has to happen because parsing code into nodes must happen at compile time |
19:22:30 | FromDiscord | <Phil> But I also need to create directories in order to move files from one directory to another and that may not have set up subdirectories |
19:22:44 | FromDiscord | <Phil> (edit) "Okay, so I have to read in and parse code and that has to happen ... because" added "at compileTime" |
19:24:01 | FromDiscord | <Phil> sent a long message, see http://ix.io/4jII |
19:24:26 | FromDiscord | <Phil> (edit) "http://ix.io/4jII" => "https://paste.rs/AGB" |
19:25:07 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/nimscript.html#mkDir%2Cstring↵Did you try `mkdir` in nimscript module to create directory at compile time. |
19:25:08 | * | xet7 quit (Remote host closed the connection) |
19:25:56 | FromDiscord | <Phil> Actually fair point, I likely should be doing this in nimscript... Can you import procs defined in nimscript into normal nim files? |
19:27:09 | FromDiscord | <Phil> Actually nevermind, I think it makes more sense that if you have a nimble task for testing, that that task first triggers that nimscript, then triggers the test-suite |
19:31:41 | FromDiscord | <Phil> Can I make it so that a nimscript file my package defines can be executed by people importing my package? |
19:32:25 | FromDiscord | <Phil> The entire thing I defined above with copying files around and modifying them etc., I want to be able to write that for my users and they just need to execute the script |
19:38:49 | * | pro quit (Quit: pro) |
19:38:52 | FromDiscord | <@thatrandomperson5-6310e3b26da03> What lib should i use for async and can anyone recommend a tutorial |
19:43:53 | FromDiscord | <demotomohiro> Here is ayncnet tutorial↵https://xmonader.github.io/nimdays/day15_tcprouter.html |
19:51:44 | FromDiscord | <@thatrandomperson5-6310e3b26da03> > Here is ayncnet tutorial↵> https://xmonader.github.io/nimdays/day15_tcprouter.html↵It seems to be a tcprouter tutorial, not an asyncdispatch one |
20:16:37 | * | xet7 joined #nim |
20:25:03 | FromDiscord | <@thatrandomperson5-6310e3b26da03> What is the default config for the test task |
20:36:05 | * | wallabra_ joined #nim |
20:37:58 | * | wallabra quit (Ping timeout: 265 seconds) |
20:37:59 | * | wallabra_ is now known as wallabra |
20:40:35 | FromDiscord | <JeysonFlores> What's the difference between "echo" and "stdout.write/writeLine"? |
20:41:29 | Amun-Ra | echo always ends with end-of-line |
20:42:09 | FromDiscord | <JeysonFlores> But stdout.writeLine does the same thing isn't it? |
20:42:24 | Amun-Ra | I guess, I've never used it |
20:43:06 | Amun-Ra | I treat stdout.write as echo without \n and flush |
20:43:39 | FromDiscord | <geekrelief> In reply to @Isofruit "Sadly you can't use": I pushed a PR for createDir at compile time |
20:44:11 | Amun-Ra | createDir @ ct sounds weird at least |
20:44:27 | FromDiscord | <vindaar> `echo` is your generic "print to stdout" proc. `stdout.writeLine` explicitly takes a FD (in this case `stdout`, predefined for your convenience) and writes the argument with a `\n` at the end. `echo` further takes a variable number of arguments, which are all autoconverted to strings for you using their respective `$`. `writeLine` just accepts a string. |
20:47:09 | FromDiscord | <JeysonFlores> In reply to @vindaar "`echo` is your generic": Oh so basically echo is a convenience function around stout |
20:47:47 | FromDiscord | <JeysonFlores> (edit) "stout" => "stdut" |
20:47:50 | Amun-Ra | yes, echo accepts varags, write one arg - strin |
20:47:52 | Amun-Ra | g |
20:47:53 | FromDiscord | <JeysonFlores> (edit) "stdut" => "stdout" |
20:49:05 | FromDiscord | <guttural666> any way to print out or concat a regex to a string? https://media.discordapp.net/attachments/371759389889003532/1057399744919523388/image.png |
20:54:41 | FromDiscord | <Elegantbeef> @JeysonFlores\: also worth noting `echo` is threadsafe |
20:59:03 | FromDiscord | <Elegantbeef> Regex expressions are compiled dynamically, they're not compile time only |
20:59:21 | FromDiscord | <Elegantbeef> `std/re` and `std/nre` cannot be used at compile time as they're actually using PCRE |
20:59:43 | FromDiscord | <Elegantbeef> Afaik there is no way to get the pattern back from a regex |
21:00:16 | * | ltriant joined #nim |
21:02:07 | FromDiscord | <Phil> In reply to @geekrelief "I pushed a PR": Nice! Thanks! Looking forward to when its merged |
21:02:11 | FromDiscord | <Phil> Now, next question into the round |
21:03:27 | NimEventer | New post on r/nim by inv2004: ttop - System monitoring tool with TUI and historical data service, see https://reddit.com/r/nim/comments/zwq329/ttop_system_monitoring_tool_with_tui_and/ |
21:04:24 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4jJa |
21:04:44 | FromDiscord | <Elegantbeef> Welcome to the hell that is vmops defined inside `std/os` |
21:04:53 | FromDiscord | <Phil> Which is confusing to me, since std/os should be working in nimscript according to official docs:↵https://nim-lang.org/docs/nims.html https://media.discordapp.net/attachments/371759389889003532/1057403724584198266/image.png |
21:05:56 | FromDiscord | <Phil> But.... gosh darnit do I have to resort to a flipping python script to copy these flipping src files from one folder to another at compiletime? |
21:06:12 | FromDiscord | <Elegantbeef> Ugh python |
21:06:36 | FromDiscord | <Phil> I'd prefer nimscript too but apparently nothing is working |
21:06:36 | FromDiscord | <Elegantbeef> See there are multiple dialects of nimscript |
21:06:40 | FromDiscord | <Elegantbeef> There is the compile time nimscript, there is the standalone nimscript |
21:07:03 | FromDiscord | <Elegantbeef> standalone nimscript is supposed to use procedures inside the `nimscript` module |
21:07:15 | FromDiscord | <Phil> I need, within the same nimscript file, to read in a module-file, parse it into a nimnode, manipulate that nimnode and write that manipulated nimnode into a new module file into a different folder |
21:07:50 | FromDiscord | <Phil> And I want to preserve the subdirectory hierarchy and since I can't write to a file into a subdir when that subdir doesn't exist I first need to create all the subdirs if they aren't there |
21:08:52 | FromDiscord | <Phil> In reply to @Elegantbeef "There is the compile": I'll try out standalone nimscript then.↵I've seen the docs for the nimscript module, I assume I can just "import nimscript" there? |
21:09:21 | FromDiscord | <guttural666> In reply to @Elegantbeef "Afaik there is no": thanks for the info |
21:09:56 | FromDiscord | <Elegantbeef> You dont need to import nimscript module for standalone nimscript |
21:10:44 | FromDiscord | <Elegantbeef> guttural what are you searching for anywho? |
21:10:57 | FromDiscord | <Elegantbeef> I'm a bit daft when it comes to regex and always avoid it unless i actually need it |
21:34:56 | FromDiscord | <Phil> In reply to @Elegantbeef "You dont need to": Through the power of mkdir in the nimscript module it was made possible |
21:35:27 | FromDiscord | <auxym> In reply to @Isofruit "I'll try out standalone": it's automatically imported when running in the vm, like system |
21:35:59 | FromDiscord | <Phil> I still had to use some of std/os for recursive traversal of the src directory, but I could circumvent some of my issues at least |
21:36:02 | FromDiscord | <Elegantbeef> There you go |
21:36:45 | FromDiscord | <Elegantbeef> This is were i say "Well technically it's not, it's just the in the shipped VM" 😛↵(@auxym) |
21:37:01 | * | ltriant quit (Quit: leaving) |
21:37:12 | FromDiscord | <Elegantbeef> If you use the VM directly you do not get the nice imports automatically 😄 |
21:42:21 | FromDiscord | <JeysonFlores> Is it wise to buy the book of "Mastering Nim" right now? It seems that Nim 2 is gonna be available soon. |
21:43:31 | FromDiscord | <Elegantbeef> Nim 1 and 2 are very similar |
21:44:07 | FromDiscord | <Elegantbeef> They're actually not that different, there's pretty much just new features in 2 |
21:44:09 | FromDiscord | <Elegantbeef> I dont have the book so cannot say whether it's worth it |
21:47:42 | FromDiscord | <Phil> In reply to @JeysonFlores "Is it wise to": The changes aren't really on the syntactical front.↵Any important information in that book will carry over.↵The main difference is that any chapters talking about details around refc (if there are any) are unlikely to be that relevant to you anymore.↵You can still use refc for memory management, it's just no longer the default |
21:56:55 | FromDiscord | <@thatrandomperson5-6310e3b26da03> How do i set the return value of an async function |
22:00:46 | FromDiscord | <Phil> In reply to @Elegantbeef "There you go": So basically to use nimscript:↵Use whatever, and when you brush up on one of the evil procs in os just use whatever equivalent the nimscript module provides |
22:03:02 | FromDiscord | <@thatrandomperson5-6310e3b26da03> `return` and `result =` don’t seem to work |
22:03:13 | FromDiscord | <Elegantbeef> Correct phil |
22:03:31 | FromDiscord | <Elegantbeef> Sadly the VMops override `os` module instead of a `vmops` module |
22:03:53 | FromDiscord | <Elegantbeef> Which means you cannot use `os` when the target doesnt support it even if the host does |
22:05:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4jJl |
22:08:58 | * | ltriant joined #nim |
22:09:50 | * | nick2 joined #nim |
22:11:50 | FromDiscord | <@thatrandomperson5-6310e3b26da03> Thanks |
22:22:10 | PMunch | @Elegantbeef, that's such an annoying limitation.. |
22:26:12 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I have this compiling error? https://media.discordapp.net/attachments/371759389889003532/1057424185095372830/message.txt |
22:26:48 | FromDiscord | <Elegantbeef> I dont see any errors |
22:26:52 | FromDiscord | <Elegantbeef> Those are warnings so yes |
22:27:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "I dont see any": The very latest line |
22:27:29 | FromDiscord | <System64 ~ Flandre Scarlet> > C:\nim-1.6.4\lib\pure\asyncmacro.nim(200, 31) Error: 'handleFrontEndDataIter' is not GC-safe as it calls 'callProc' |
22:28:08 | FromDiscord | <Elegantbeef> Yes a procedure is supposed to be `gcSafe` |
22:29:04 | PMunch | How can I make a path relative to the current file? |
22:29:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Yes a procedure is": and how can I fix it? |
22:29:32 | PMunch | When I run `nimble test` it tries to look for a path used with readFile in the root directory and not the test directory |
22:29:42 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/lNr |
22:29:50 | FromDiscord | <Phil> In reply to @PMunch "How can I make": I'm not 100% what exactly you mean, but when it comes to relative paths you could use std/os ` relativePath`? |
22:30:16 | FromDiscord | <Phil> Which would still require you to figure out the current files filepath |
22:30:17 | FromDiscord | <Phil> hmmm |
22:30:59 | PMunch | I have a macro which reads a file, I call this macro in a test and give it the name of the file I want to read. But readFile tries to read that file relative from the current directory, which when run with `nimble test` is the root directory of the nimble project |
22:32:18 | Amun-Ra | and you know the diff |
22:37:05 | * | wallabra_ joined #nim |
22:38:19 | * | wallabra quit (Ping timeout: 265 seconds) |
22:38:20 | * | wallabra_ is now known as wallabra |
22:38:57 | FromDiscord | <guttural666> std/re standard expression manual says I should use raw strings (r"pls") instead of strings, but what is that type, how do I pass that to my function here https://media.discordapp.net/attachments/371759389889003532/1057427392307679382/image.png |
22:39:21 | FromDiscord | <guttural666> (edit) "here" => "here; or how do I convert a string to a raw string" |
22:39:29 | Amun-Ra | the type is string |
22:39:47 | Amun-Ra | it only differs in how it escapes |
22:40:06 | FromDiscord | <guttural666> having problems with providing a search term like "$search" |
22:40:29 | * | ltriant quit (Ping timeout: 260 seconds) |
22:41:33 | Amun-Ra | r"\$search"? |
22:41:55 | Amun-Ra | == "\\$search" |
22:42:02 | FromDiscord | <guttural666> yes, literally an item named $item1 |
22:42:34 | Amun-Ra | "[$]search" should also match |
22:43:01 | * | ltriant joined #nim |
22:43:06 | FromDiscord | <guttural666> I'm trying to replace all $ with \$ |
22:43:18 | FromDiscord | <guttural666> $ with backslash $ |
22:44:03 | FromDiscord | <guttural666> the user is only allowed wildcards with , everything else should be escaped, that's my issue |
22:45:05 | FromDiscord | <guttural666> what I'm working with rn https://media.discordapp.net/attachments/371759389889003532/1057428940232339597/image.png |
22:47:43 | FromDiscord | <System64 ~ Flandre Scarlet> ``C:\nim-1.6.4\lib\pure\asyncmacro.nim(200, 31) Error: 'handleFrontEndDataIter' is not GC-safe as it calls 'callProc'`` Wgy do I still have this while I disabled GC??? |
22:48:08 | PMunch | Damn it.. I tried creating a wrapper template that called `currentSourcePath`, but that still just gives me the imported module.. |
22:48:40 | FromDiscord | <guttural666> this does not work (invalid character constant?) https://media.discordapp.net/attachments/371759389889003532/1057429836177604658/image.png |
22:50:14 | * | ltriant quit (Ping timeout: 272 seconds) |
22:50:42 | FromDiscord | <Phil> In reply to @PMunch "Damn it.. I tried": Actually, should you find a solution, please ping enthus1ast, IIRC he's running into a slightly similar issue with nimja where a path needs to be adjusted based on whether it is part of the main package that is currently being compiled or whether nimja template stuff is being compiled as part of a library package |
22:50:49 | * | wallabra_ joined #nim |
22:51:48 | * | wallabra quit (Ping timeout: 252 seconds) |
22:51:49 | * | wallabra_ is now known as wallabra |
22:53:04 | PMunch | He should probably be made aware of the new `setLineInfo` anyways |
22:53:18 | PMunch | Useful for templates |
22:53:23 | FromDiscord | <Elegantbeef> `\$` is not a valid character |
22:53:25 | FromDiscord | <Elegantbeef> you likely want `\\$` |
22:57:51 | FromDiscord | <JeysonFlores> sent a long message, see https://paste.rs/gsg |
22:58:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Z3J |
22:58:45 | FromDiscord | <JeysonFlores> (edit) "http://ix.io/4jJy" => "https://paste.rs/uH1" |
22:59:09 | FromDiscord | <JeysonFlores> Seems legit. Thanks |
23:01:26 | FromDiscord | <Phil> In reply to @JeysonFlores "If I want to": Personally I rather like `return` as explicit statement of "I'm returning early" |
23:01:49 | FromDiscord | <guttural666> In reply to @Elegantbeef "you likely want `\\$`": interesting thanks, can you explain that? |
23:06:31 | * | jmdaemon joined #nim |
23:07:27 | * | ltriant joined #nim |
23:07:44 | FromDiscord | <JeysonFlores> sent a long message, see http://ix.io/4jJC |
23:08:06 | FromDiscord | <JeysonFlores> In reply to @JeysonFlores "Actually I think this": Producing unnecessary nesting |
23:13:14 | PMunch | This seems like something which should be easy.. |
23:13:27 | PMunch | I just want to get a file relative to the file I'm currently in.. |
23:13:47 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:14:18 | * | ltriant quit (Ping timeout: 272 seconds) |
23:16:30 | * | wallabra joined #nim |
23:16:49 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/os.html#relativePath%2Cstring%2Cstring |
23:18:40 | FromDiscord | <Elegantbeef> Oh wait you mean at compile time? |
23:18:42 | * | jkl quit (Quit: Gone.) |
23:19:34 | * | jkl joined #nim |
23:19:47 | FromDiscord | <enthus1ast> Will have a look↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
23:26:27 | * | ltriant joined #nim |
23:34:22 | PMunch | @Elegantbeef, well the problem is I have no way of getting the currently compiling unit from within a macro defined in another module.. |
23:38:24 | * | ltriant quit (Ping timeout: 268 seconds) |
23:50:54 | NimEventer | New thread by yister: Creating const in a macro fails in 1.9.1, see https://forum.nim-lang.org/t/9769 |
23:53:15 | PMunch | Hmm, apparently lineinfo is sometimes able to get me what I need |
23:55:34 | PMunch | Ah never mind, I was doing it wrong.. |