00:00:15 | FromDiscord | <dilawar (Dilawar Singh)> indeed. I just assumed `import logging` would init a default logger that would write to stdout for me. |
00:00:47 | FromDiscord | <Elegantbeef> Ah |
00:01:07 | FromDiscord | <Elegantbeef> It does not since you dont always want a console logger |
00:01:35 | FromDiscord | <Nick.> With C# you've a command called BinaryReader. Which read binary data and can create a key, value out of the binary config. With python you can do it with struct. Is there something within nim to do that? I was looking at strutils. Hopefully I said it correctly. |
00:02:06 | FromDiscord | <Elegantbeef> `std/streams` |
00:02:36 | FromDiscord | <dilawar (Dilawar Singh)> If tests pass then no stdout is shown. stdout is only shown in case of test failure? If yes, Is there a way to force stdout display even if test passes? |
00:02:50 | FromDiscord | <Elegantbeef> https://ajusa.github.io/binarylang-fun/intro.html is also an option |
00:03:27 | FromDiscord | <Nick.> I was looking at streams as well but is there a parser like BinaryReader or do I have to parse it all? |
00:03:53 | FromDiscord | <Elegantbeef> I dont get why you'd want to force the stdout, but perhaps it's here https://nim-lang.org/docs/testament.html |
00:04:15 | FromDiscord | <Elegantbeef> What? |
00:04:23 | FromDiscord | <Elegantbeef> Streams is identical to the binaryreader api |
00:04:34 | FromDiscord | <Elegantbeef> You make a binary reader than read a specific type out of it |
00:04:58 | FromDiscord | <Elegantbeef> You can also use binarylang or look at frosty |
00:05:55 | FromDiscord | <Elegantbeef> Like this example https://docs.microsoft.com/en-us/dotnet/api/system.io.binaryreader?view=net-6.0 |
00:07:20 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/aH4 |
00:07:46 | FromDiscord | <Nick.> ok, interesting. and it can also be in a for loop |
00:07:58 | FromDiscord | <Elegantbeef> of course |
00:08:03 | FromDiscord | <Elegantbeef> `while not myFIle.atEnd` |
00:08:13 | FromDiscord | <Nick.> Interesting |
00:08:23 | FromDiscord | <Nick.> I'll give it a try! Thank you! |
00:08:28 | FromDiscord | <Elegantbeef> Like i said you can also use binarylang |
00:08:56 | FromDiscord | <Elegantbeef> You will run into issues if you attempt to serialize ref objects so things like `string` and `seq` might need their own `read` procedures specialized |
00:08:56 | FromDiscord | <Nick.> that's a module? |
00:09:04 | FromDiscord | <Elegantbeef> It's a package |
00:09:10 | FromDiscord | <Elegantbeef> https://github.com/sealmove/binarylang |
00:09:15 | FromDiscord | <Nick.> Right, I need to get use to the terms |
00:10:47 | FromDiscord | <Elegantbeef> There is also frosty if you want to easily go Nim \<-\> to binary. https://github.com/disruptek/frosty |
00:21:49 | * | Figworm joined #nim |
00:25:00 | * | jmdaemon joined #nim |
00:28:51 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:53:26 | * | Gustavo6046_ joined #nim |
00:53:37 | * | Gustavo6046_ quit (Client Quit) |
00:57:00 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
01:45:53 | * | krux02 quit (Remote host closed the connection) |
01:51:29 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:52:47 | * | jmdaemon joined #nim |
03:12:14 | * | jmdaemon quit (Ping timeout: 252 seconds) |
03:16:21 | * | Gustavo6046 joined #nim |
03:21:40 | * | jmdaemon joined #nim |
04:24:48 | * | acidsys quit (Excess Flood) |
04:25:21 | * | acidsys joined #nim |
04:36:23 | FromDiscord | <ripluke> Is there a way I can get Nim intellisese in nvim |
04:36:39 | FromDiscord | <ripluke> (edit) "Is there a way I can get Nim intellisese in nvim ... " added "(neovim)" |
04:36:49 | FromDiscord | <Rika> nim.nvim? |
04:37:08 | FromDiscord | <ripluke> That doesn't have autcomple iirc but I'll check, thx |
04:38:03 | * | arkurious quit (Quit: Leaving) |
04:38:56 | FromDiscord | <ripluke> In reply to @Rika "nim.nvim?": Thx I just noticed it has autcomplete as well |
04:39:29 | FromDiscord | <Rika> 👌 |
05:14:07 | * | tk quit (Quit: Well, this is unexpected.) |
05:15:31 | * | tk joined #nim |
05:18:34 | FromDiscord | <Bung> @ElegantBeef any plan fix https://github.com/beef331/nimscripter/issues/11 |
05:19:11 | FromDiscord | <Elegantbeef> I've looked into it, I need to make a PR for it to the compiler iirc |
05:19:20 | * | ormiret quit (Ping timeout: 250 seconds) |
05:19:49 | * | euantorano quit (Read error: Connection reset by peer) |
05:19:58 | * | euantorano joined #nim |
05:20:07 | * | oz quit (Quit: EOF) |
05:20:07 | * | notchris quit (Read error: Connection reset by peer) |
05:20:13 | * | ormiret joined #nim |
05:20:17 | * | notchris joined #nim |
05:20:30 | * | ox joined #nim |
05:25:26 | FromDiscord | <Bung> ah I thought just need pass new config when initialize nimscripter |
05:25:49 | FromDiscord | <Elegantbeef> Eh i fully forgot about the issue so i can try the passing a new config value |
05:25:56 | FromDiscord | <Elegantbeef> I think it's more complicated though |
05:26:32 | FromDiscord | <Bung> maybe, not sure |
05:31:20 | FromDiscord | <Elegantbeef> Oh seems it's simple |
05:36:51 | termer_ | Does anyone know of any library to run procs on a different thread? |
05:37:01 | termer_ | I wrote my own implementation but it looks like it's double calling procs |
05:37:09 | termer_ | pretty lost and would rather use something battle-tested |
05:37:33 | termer_ | basically I need to complete a future that was passed to a worker thread back on the origin thread of the future |
05:37:45 | * | slowButPresent quit (Quit: leaving) |
05:38:06 | FromDiscord | <Elegantbeef> Is this async related? |
05:38:15 | termer_ | Possibly |
05:38:23 | termer_ | Futures are being completed more than once |
05:38:46 | termer_ | this isn't a problem until I spawn thousands of futures in a matter of seconds and ask them to be completed |
05:39:03 | FromDiscord | <Elegantbeef> @Bung\: seems it was a simple config, so i guess I'm a lazy shithead |
05:39:05 | termer_ | at a certain point this is also causing a nil reference error in the GC that's crashing the application |
05:40:10 | FromDiscord | <Elegantbeef> Is your code thrown some where? |
05:40:42 | FromDiscord | <Elegantbeef> thrown up\ |
05:40:49 | termer_ | yes |
05:40:52 | termer_ | lemme get the link |
05:41:12 | termer_ | https://github.com/llstreamer/llstreamer-server/blob/main/src/llstreamer_server/private/threadutils.nim |
05:41:19 | termer_ | here's my local thread executor |
05:41:37 | termer_ | it's used here https://github.com/llstreamer/llstreamer-server/blob/main/src/llstreamer_server/private/crypto.nim |
05:41:44 | termer_ | as well as here https://github.com/llstreamer/llstreamer-server/blob/main/src/llstreamer_server/private/db/sqlite.nim |
05:42:12 | FromDiscord | <Elegantbeef> What GC are you using? |
05:42:13 | termer_ | Its purpose is to complete futures passed to a worker thread back on the thread where the future was created |
05:42:15 | termer_ | orc |
05:42:20 | termer_ | but this occurs on refc as well |
05:42:44 | FromDiscord | <Elegantbeef> Completing futures on other threads just seems like purposefully causing trouble |
05:43:10 | termer_ | well threadutils.nim facilitates completing futures on their original therad |
05:43:12 | termer_ | *thread |
05:43:24 | termer_ | my issue is that at some point, futures are being called more than once |
05:43:36 | FromDiscord | <Bung> nimscript not support get env? |
05:44:04 | FromDiscord | <Elegantbeef> No clue it's in the nimscript module |
05:44:08 | FromDiscord | <Elegantbeef> Consider a PR to VMops |
05:44:49 | FromDiscord | <Elegantbeef> I can only imagine something is causing the Future's `finished` to reset, so where do you pass the futures around? |
05:45:37 | termer_ | threadutils.nim:67 is the proc where futures are added to the queue |
05:46:01 | termer_ | they are then executed in startLocalThreadExecutor thread |
05:46:18 | termer_ | err |
05:46:21 | termer_ | that loop |
05:46:24 | termer_ | it's not a thread |
05:47:48 | termer_ | crypto.nim:143 is on location where a future completing job is being passed into the queue |
05:48:30 | FromDiscord | <Elegantbeef> So you're still passing futures across the thread barrier? |
05:48:47 | termer_ | A future is created on thread A |
05:49:00 | termer_ | it's put in a queue that's accessible to both thread A and B |
05:49:10 | termer_ | thread B picks up the job and future from the queue |
05:49:15 | FromDiscord | <Elegantbeef> Ok see that seems wrong to me, but i could be wrong |
05:49:38 | termer_ | it performs the task and passes a proc that completes the future into a queue for thread A to execute |
05:49:56 | FromDiscord | <Elegantbeef> Thread A should just queue jobs for thread B, thread B then should do those jobs, then add the result to a queue |
05:50:11 | termer_ | so the future was created on A, a job was passed to B, and then it schedules completion of the future in a job to be run on A |
05:50:17 | termer_ | so the future is always executed on A |
05:50:29 | FromDiscord | <Elegantbeef> I dont get why you're using futures |
05:50:49 | termer_ | because I'm awaiting a CPU intensive task |
05:50:54 | FromDiscord | <Elegantbeef> Just have a thread per operation then dispatch to those operations using async in there |
05:51:12 | termer_ | thread per operation would end up spawning a ton of threads |
05:51:25 | termer_ | in crypto.nim, I'm hashing passwords |
05:51:27 | FromDiscord | <Elegantbeef> Yea i probably should just shush i'm no expert in threading or async |
05:51:57 | termer_ | I'm not sure whether you're being sarcastic but if you are I'm not trying to shut you down, just stating my reasoning |
05:52:06 | termer_ | If I'm doing things wrong I'd be more than happy to be corrected |
05:52:48 | termer_ | that's why I'm here after all |
05:52:52 | termer_ | I screwed something up lol |
05:53:16 | FromDiscord | <Elegantbeef> I mean per unique operation type |
05:53:41 | termer_ | there's a thread for password hashing and a thread for I/O currently |
05:53:54 | termer_ | I/O thread is fully async |
05:54:07 | termer_ | hashing thread does CPU-intensive work |
05:55:23 | FromDiscord | <Elegantbeef> I'm not being sarcastic, i really am not an expert here, and as such dont hold any weight in my view |
05:56:13 | FromDiscord | <Elegantbeef> I'd have the thread for password hashing send the result in a channel, and have the IO thread also send the results in a channel, since i'm a simpleton |
05:56:18 | FromDiscord | <Elegantbeef> I dont know why a future is involved here |
05:56:42 | termer_ | how do channels work |
05:56:56 | * | termer_ is now known as termer |
05:56:59 | FromDiscord | <Elegantbeef> A queue of lock and data |
05:57:08 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/channels_builtin.html#example |
05:57:30 | FromDiscord | <Elegantbeef> You add elements to a channel and then can safely access from another thread, it's like a threadsafe sequence kinda |
05:58:43 | termer | that might be just what I'm looking for |
05:58:58 | termer | however does a thread need to be suspended to get a new channel message |
05:59:13 | FromDiscord | <Elegantbeef> There is `tryRecv` which is non blocking |
05:59:30 | termer | this might be EXACTLY what I'm looking for |
05:59:38 | FromDiscord | <Elegantbeef> Well there we go |
05:59:41 | termer | thank you so much |
05:59:44 | FromDiscord | <Elegantbeef> I assumed you knew it existed |
05:59:48 | termer | nope |
05:59:56 | termer | I'm still a relatively new nim user |
06:01:04 | FromDiscord | <Elegantbeef> There is also https://github.com/status-im/nim-taskpools |
06:02:02 | termer | this unfortunately isn't geared towards async |
06:02:12 | termer | but channels should do in any case |
06:02:30 | termer | This project needs to block as little as possible, and when it does block it needs to be off the I/O thread |
06:05:01 | FromDiscord | <Elegantbeef> Finally to give one more thing to consider https://nim-lang.org/docs/manual_experimental.html#parallel-amp-spawn-spawn-statement does exist |
06:05:10 | FromDiscord | <Elegantbeef> But i'm probably just spamming pointless things |
06:05:26 | FromDiscord | <Elegantbeef> Though a flowvar is kind alike a thread future |
06:13:53 | FromDiscord | <Bung> @ElegantBeef I found the problem is I put nimble pkgs to search pathes , then it try to compile all modules ? |
06:15:28 | FromDiscord | <Elegantbeef> Reproduction? |
06:17:41 | FromDiscord | <Bung> let me double check this |
06:17:45 | FromDiscord | <Elegantbeef> Cause i do test that it doesnt explode with the nimble path added https://github.com/beef331/nimscripter/blob/master/tests/tgeneral.nim#L145-L147 |
06:21:22 | FromDiscord | <Bung> sent a code paste, see https://paste.rs/Jf1 |
06:22:24 | FromDiscord | <Elegantbeef> Well i cant do anything but say "ensure your libraries work with nimscript" |
06:22:54 | FromDiscord | <Bung> I local modify vmops add getEnv returns empty string then I encounter this error, I dont know where it comes as I dont call docutils directly |
06:23:27 | FromDiscord | <Elegantbeef> No clue either, doesnt make any sense |
06:25:12 | FromDiscord | <Bung> can the script error trace to my src file , now it just from std to std .. |
06:26:49 | FromDiscord | <Elegantbeef> What? |
06:27:56 | FromDiscord | <Bung> I mean the script error stack trace does not locate to my local file |
06:28:26 | FromDiscord | <Elegantbeef> Invalid symbol errors dont show import order |
06:33:49 | FromDiscord | <Bung> okay |
06:34:40 | * | jmdaemon quit (Ping timeout: 272 seconds) |
08:05:18 | FromDiscord | <retkid> In reply to @Elegantbeef "There is also https://github.com/status-im/nim-task": this looks about as good as stock threading i dont like it |
08:06:06 | FromDiscord | <Elegantbeef> Cool |
08:11:57 | FromDiscord | <Phil> sent a long message, see http://ix.io/3S0z |
08:12:12 | * | krux02 joined #nim |
08:13:12 | FromDiscord | <Elegantbeef> That type looks tedious 😀 |
08:15:31 | FromDiscord | <Phil> And I couldn't just throw the data of all different types into a single table because holy shit that table would've contained a lot of columns |
08:16:02 | FromDiscord | <Phil> In terms of db model I went with one table per different article type even if they share some fields, because I didn't want to have the data of a single entry split across 2 tables |
08:16:07 | FromDiscord | <Phil> ... discord eating my messages now, I've been trying to send one that just is not getting sent whatsoever |
08:17:00 | FromDiscord | <Phil> Anyway, 12 different article model types, each responsible for a different db table, not really much of a choice if I want a "summary" type |
08:17:07 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S0B |
08:17:39 | FromDiscord | <Elegantbeef> I personally dont like the manual upkeep so i'd probably use a pragma instead of a typeclass but you do you i guess |
08:17:41 | FromDiscord | <Phil> Inheritance! hiss |
08:18:50 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S0D |
08:18:51 | FromDiscord | <Elegantbeef> Arent you already using inheritance? |
08:18:58 | FromDiscord | <Phil> Begrudgingly |
08:19:32 | FromDiscord | <Phil> I tend to avoid it wherever possible but it was either accept the inheritance that norm provides me or not using norm |
08:20:13 | FromDiscord | <Phil> ... though I'll admit a decent chunk of that is because I detest inheritance complexity that work-code throws at me |
08:20:39 | FromDiscord | <Phil> Which is java, so to be expected |
08:21:28 | FromDiscord | <Elegantbeef> That was easy |
08:21:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S0F |
08:22:11 | FromDiscord | <Elegantbeef> Eh i rarely use inheritance, prefer using concepts where i can |
08:23:23 | FromDiscord | <Phil> I'll contemplate that for a future refactor, for now I pretty much already have the types, I'm just trying to refactor them out of a specific module that one thing uses (my search part of the application which searches across all these articles) and put it into its own thing since the "recently updated article" part of the application will also access them |
08:23:57 | FromDiscord | <Phil> Thus the quest for a module name, as e.g. there's also an enum with the table names of all these types included that I also want to move out etc. |
08:24:08 | FromDiscord | <Elegantbeef> Well then `articles` sounds fine |
08:25:34 | FromDiscord | <Phil> Hmmm all this "|" stuff was called type aliasing IIRC |
08:26:17 | FromDiscord | <Phil> I'll need to squint heavily at article/s / articleAlias or so as names |
08:27:36 | FromDiscord | <Elegantbeef> "articleAlias" isnt a module it's a stupid type name |
08:28:00 | FromDiscord | <Elegantbeef> articles implements the types and procedures around said types 😛 |
08:28:05 | FromDiscord | <Elegantbeef> Smoke bomb with that dumb logic |
08:38:26 | FromDiscord | <Bung> @ElegantBeef any reason cause `Error: unhandled exception: 'renderArchive' was not found in the script. [VmProcNotFound]` am pretty sure I have `renderArchive` and my script file has import and export that |
08:38:39 | FromDiscord | <Elegantbeef> Do you have overloads |
08:39:10 | FromDiscord | <Bung> no , I have only one version renderArchive |
08:39:49 | * | krux02 quit (Remote host closed the connection) |
08:40:33 | FromDiscord | <Elegantbeef> It's in your top level module? |
08:41:32 | FromDiscord | <Elegantbeef> I've not tested exporting a procedure from an inner module, so that is probably the issue |
08:41:39 | FromDiscord | <Bung> the proc is in archive.nim https://media.discordapp.net/attachments/371759389889003532/952124201597288498/Screenshot_2022-03-12_at_4.41.18_PM.png |
08:42:41 | FromDiscord | <Elegantbeef> The issue is somewhere inside here https://github.com/nim-lang/Nim/blob/f0af4a36b932af3932b611c1f728ebfbfe3a2749/compiler/nimeval.nim#L30-L51 |
08:43:08 | FromDiscord | <Elegantbeef> What's the procedure definition? |
08:44:16 | FromDiscord | <Bung> https://github.com/bung87/crown_ui/tree/nimscripter see |
08:45:35 | FromDiscord | <Bung> it called serveral procs from theme.nim successfully until call renderArchive |
08:47:34 | FromDiscord | <Elegantbeef> I dont see why this is having issues with this logic |
08:50:19 | FromDiscord | <Elegantbeef> What's the nimscript look like? |
08:52:49 | FromDiscord | <Bung> https://github.com/bung87/crown_ui/blob/nimscripter/src/crown_ui/themes/default/theme.nim |
08:53:55 | FromDiscord | <Bung> https://github.com/bung87/crown_ui/blob/nimscripter/src/crown_ui/themes/default/archive.nim |
08:54:45 | FromDiscord | <Elegantbeef> Nothing stands out to me why the compiler says it doesnt exist so i guess it's'a compiler bug |
08:57:02 | FromDiscord | <Bung> weird , I commented generateArchive , other generation steps run well |
08:59:44 | * | jjido joined #nim |
09:34:48 | NimEventer | New thread by Jasonfi: Launched a web app using Nim on the back-end, see https://forum.nim-lang.org/t/9002 |
09:38:53 | FromDiscord | <xigoi> sent a code paste, see https://paste.rs/gXX |
09:46:25 | FromDiscord | <xigoi> It looks like I'm missing some dynamic library, but I have openssl installed, so no idea what it could be. |
09:47:46 | * | brocc joined #nim |
09:56:56 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix=3S15 |
09:57:22 | FromDiscord | <soda> this for loop 'for x in os.walk_dir(src):' is not entered when the recursion occurs |
10:07:06 | FromDiscord | <xigoi> I don't see any recursive call in the proc… |
10:09:28 | FromDiscord | <xigoi> Maybe you want walkDirRec, so that it would recurse automatically? |
10:09:50 | FromDiscord | <Elegantbeef> You also can use a case statement instead of elif statements |
10:11:24 | FromDiscord | <rakgew> is there way to use something like `var userInput = stdin.readLine()` inside inim? currently gives me `raise EOF` |
10:12:32 | FromDiscord | <Elegantbeef> I dont imagine so |
10:12:55 | FromDiscord | <rakgew> bummer.. |
10:14:12 | FromDiscord | <rakgew> that way I would not have to implement the repl features for my cli apps myself. |
10:14:45 | FromDiscord | <rakgew> I tried doing that with nim-prompt |
10:14:57 | FromDiscord | <rakgew> but there was no example code |
10:15:01 | FromDiscord | <Elegantbeef> You could make your stdin be a file, and then write to the file but that'd be odd |
10:15:11 | FromDiscord | <Schelz> Is nim able to import Julia functions ? |
10:15:19 | FromDiscord | <Elegantbeef> The best thing would probably use Nimscript to get a repl-ish environment |
10:15:20 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix=3S1c |
10:15:52 | FromDiscord | <Elegantbeef> Though i dont know what you're doing |
10:16:00 | FromDiscord | <rakgew> ah, I see - had not thought about that - thx!! |
10:16:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:16:16 | FromDiscord | <Elegantbeef> Are you trying to make it so your CLI app is modifyable? |
10:16:56 | FromDiscord | <rakgew> basically interactive input from user\: one example is asking for input where to put scanned files with which name.. |
10:16:56 | FromDiscord | <soda> In reply to @xigoi "Maybe you want walkDirRec,": Yes i will give it a try, but i would like to know why this fails. |
10:16:56 | FromDiscord | <Rika> In reply to @Schelz "Is nim able to": Not to my knowledge |
10:16:58 | FromDiscord | <Elegantbeef> Soda i'd certainly say just use walkdirrec |
10:17:17 | FromDiscord | <Elegantbeef> what does `x.path` return? |
10:17:25 | FromDiscord | <Bung> @ElegantBeef I rename module to a longer name now it works |
10:17:33 | FromDiscord | <soda> It corrects the correct path to the target dir that needs to be recursed into |
10:17:38 | FromDiscord | <soda> (edit) "corrects" => "returns" |
10:17:42 | FromDiscord | <Bung> archive.nim -> crown_ui_archive.nim |
10:17:59 | FromDiscord | <Elegantbeef> That maakes no sense Bung, perhaps a bad cached file |
10:18:15 | FromDiscord | <soda> The issue is that this line :↵ for x in os.walk_dir(src):↵is not executed on subsequent recursions. The check fails even though the path is correct and non-empty |
10:19:07 | FromDiscord | <Elegantbeef> Does https://nim-lang.org/docs/rdstdin.html#readLineFromStdin%2Cstring not work for you? |
10:19:13 | FromDiscord | <Elegantbeef> I'm confused why inim is involved |
10:19:22 | FromDiscord | <soda> (edit) "The issue is that this line :↵ for x in os.walk_dir(src):↵is not executed on subsequent recursions. The check fails even though the path is correct and non-empty ... " added "(like it would if the dir was empty, but it's not)" |
10:19:33 | FromDiscord | <Bung> In reply to @Elegantbeef "That maakes no sense": maybe I install too much packages it resolve to a nimble package like nimarchive ? |
10:19:34 | FromDiscord | <Elegantbeef> Is the "interactive" part a scriptable program? |
10:19:45 | FromDiscord | <Elegantbeef> No clue |
10:19:55 | FromDiscord | <Elegantbeef> It should default to relative before anywherelese |
10:20:07 | FromDiscord | <rakgew> ideally I would like autocomplete and thought I could get that from inim |
10:20:19 | FromDiscord | <rakgew> inim does not have to be in the mix though |
10:20:42 | FromDiscord | <Rika> Autocomplete for what? |
10:20:48 | FromDiscord | <rakgew> any other repl framework would do as well |
10:21:01 | FromDiscord | <Elegantbeef> I dont know i'd just implement this using illwill, this isnt a repl needed thing |
10:21:11 | FromDiscord | <rakgew> for the user input\: certain predefined topics, today's date, etc.. |
10:21:19 | FromDiscord | <Elegantbeef> Can you explain the entire program? |
10:21:46 | FromDiscord | <soda> sent a code paste, see https://play.nim-lang.org/#ix=3S1e |
10:22:04 | FromDiscord | <Elegantbeef> There's the issue you ported python 😛 |
10:22:15 | FromDiscord | <soda> I also have a working C++ version 😛 |
10:22:27 | FromDiscord | <Elegantbeef> That's equally as bad |
10:23:24 | FromDiscord | <Rika> Let’s not argue |
10:23:27 | FromDiscord | <Rika> What’s the issue again |
10:23:38 | FromDiscord | <Rika> It’s a bit mixed up above |
10:23:59 | FromDiscord | <soda> > The issue is that this line :↵> for x in os.walk_dir(src):↵> is not executed on subsequent recursions. The check fails even though the path is correct and non-empty (like it would if the dir was empty, but it's not) |
10:24:18 | FromDiscord | <soda> When going into recursion, the for loop is not entered as it should |
10:24:43 | FromDiscord | <rakgew> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: the example is a simple one\: check if the scanner is available, then ask the user for file name infos\: which path to put it to, the topic of scanned documents, the date of the documents (default/autocomplete today), then scan multiple pages, compress them (lzw) and move them to the defined directory. |
10:25:05 | FromDiscord | <rakgew> this could be done with simple stdin.readline |
10:25:20 | FromDiscord | <Elegantbeef> Ah and you want shell like completion |
10:25:22 | FromDiscord | <rakgew> but I would like to make it more generic, so I can reuse it |
10:25:31 | FromDiscord | <rakgew> exactly. |
10:25:37 | FromDiscord | <Elegantbeef> I feel like the thing to do is make procedures for this then |
10:26:09 | FromDiscord | <rakgew> yes - ideally I would have a proc for each command |
10:26:46 | FromDiscord | <rakgew> and these then ask for user input accordingly to types/tables to get user data input. |
10:26:57 | FromDiscord | <Bung> it will be problem if I wrongly pass it to searchPath https://media.discordapp.net/attachments/371759389889003532/952150702019457085/Screenshot_2022-03-12_at_6.22.41_PM.png |
10:27:53 | FromDiscord | <rakgew> I have written a few of these repl like apps in python, and thought they would be a great starting point for me in nim. |
10:28:20 | FromDiscord | <rakgew> there I user prompt\_toolkit, so I thought nim-prompt might be a good fit. |
10:28:22 | FromDiscord | <Rika> In reply to @soda "> The issue is": Is the path you get relative or not? I don’t remember what the path emitted is |
10:28:31 | FromDiscord | <soda> It is relative |
10:28:36 | FromDiscord | <rakgew> but I could not even instantiate the prompt |
10:28:39 | FromDiscord | <soda> I wonder if this might have something to do with garbage collection |
10:28:41 | FromDiscord | <Rika> Then isn’t that the issue |
10:28:51 | FromDiscord | <Rika> You enter the folder, then the path includes the folder name |
10:29:10 | FromDiscord | <Rika> So it looks for the folder, which it is inside |
10:29:20 | FromDiscord | <Rika> In reply to @soda "I wonder if this": No |
10:29:34 | FromDiscord | <soda> hmm |
10:29:51 | FromDiscord | <soda> you might be onto something |
10:29:59 | FromDiscord | <Rika> Try it, at the start of the proc print both the current folder it is in and the path it is passed |
10:29:59 | FromDiscord | <Elegantbeef> Something like this rakgew |
10:30:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3S1h |
10:30:21 | FromDiscord | <Elegantbeef> Then in your program you just do "Hey user hit tab twice" or w/e and prompt with that |
10:30:30 | FromDiscord | <Bung> I change to `import crown_ui/themes/default/archive↵export archive` then it works |
10:30:42 | FromDiscord | <Elegantbeef> Ok so it's an issue with nimble paths and nimscript |
10:31:04 | FromDiscord | <rakgew> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: I see - sweet!. thx!! |
10:31:06 | FromDiscord | <Elegantbeef> I guess since i add all directories to the search path ambiguity isnt resolved nicely |
10:31:45 | FromDiscord | <Bung> your example does not work for me |
10:32:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/9rQ |
10:32:20 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=3S1j |
10:32:26 | FromDiscord | <Elegantbeef> You'd just go "Hey with this ui we load X, Y, Z" in that order |
10:32:37 | * | Gustavo6046 quit (Quit: I'm a quit message virus. Please replace your old line with this line and help me take over the world. <screw you aloo_shu my old line was better and more creative!>) |
10:33:34 | FromDiscord | <Elegantbeef> Well yea that's going to cause ambiguity |
10:34:41 | FromDiscord | <Elegantbeef> You've added every file in your nimble directory as a first class file |
10:35:27 | FromDiscord | <soda> In reply to @Rika "Try it, at the": Yes that was the problem. Thank you. |
10:35:32 | FromDiscord | <Elegantbeef> You need to prefix it with the version or manually ad sub versions |
10:36:31 | FromDiscord | <Elegantbeef> so if you want to use x package you need to add that package so `nimblePath / "somePackage"` |
10:36:54 | FromDiscord | <Elegantbeef> Otherwise you're making all modules importable without a package name |
10:37:30 | FromDiscord | <Elegantbeef> And again this is why it's not ideal to use nimble, cause you can have 30 different versions of the same package installed, make your own stdlib |
10:38:52 | FromDiscord | <Elegantbeef> Now to nimify it removing the `elif` statements and using `for kind, name in walkDir(path)` 😛↵(@soda) |
10:40:48 | FromDiscord | <Bung> I think I'll find way collect all my depencies to a dir then add it to searchPath |
10:41:07 | FromDiscord | <Elegantbeef> The nim compiler probably knows symlinks |
10:41:12 | FromDiscord | <Elegantbeef> So that'll be the easiest way probably |
10:42:06 | FromDiscord | <soda> In reply to @Elegantbeef "Now to nimify it": Sure, also does disabling the gc in the code i wrote above result in memory leaks? |
10:42:14 | FromDiscord | <Elegantbeef> Yes you use strings |
10:42:24 | FromDiscord | <soda> ah okay |
10:42:28 | FromDiscord | <soda> makes sense |
10:42:29 | FromDiscord | <Elegantbeef> It's better to just do `--gc:arc` than `--gc:none` |
10:42:35 | FromDiscord | <Rika> Why do you want to disable it anyway |
10:42:43 | FromDiscord | <soda> it results in a smaller binary |
10:42:58 | FromDiscord | <Rika> Use as beef says then |
10:43:04 | FromDiscord | <soda> hmm ok |
10:43:11 | FromDiscord | <Elegantbeef> Then do `-d:lto -d:danger --gc:arc --opt:size` |
10:43:12 | FromDiscord | <Rika> Also opt:size |
10:43:17 | FromDiscord | <demotomohiro> `--gc:none` can result in a memory leak |
10:43:22 | FromDiscord | <Rika> I do not recommend danger |
10:43:28 | FromDiscord | <soda> i am used to it |
10:43:29 | FromDiscord | <Rika> Use release either way |
10:43:33 | FromDiscord | <soda> thanks to c / c++ |
10:43:42 | FromDiscord | <Elegantbeef> No shit sherlock 😛↵(@demotomohiro) |
10:43:54 | FromDiscord | <Rika> In reply to @Elegantbeef "No shit sherlock 😛": Not very obvious to most |
10:44:17 | FromDiscord | <Elegantbeef> Danger is smaller, if we're after size it's a good way to do it, shaves a few KB off↵(@Rika) |
10:44:27 | FromDiscord | <soda> now i just gotta learn how to manually deallocate strings :3 |
10:44:30 | FromDiscord | <Elegantbeef> Can also statically build using musl for even smalelr |
10:44:34 | FromDiscord | <Elegantbeef> smaller\ |
10:44:43 | FromDiscord | <Rika> In reply to @soda "now i just gotta": Just use ARC if you’re gonna do this anyway |
10:44:51 | FromDiscord | <Rika> In reply to @Elegantbeef "Danger is smaller, if": I still don’t recommend it |
10:44:53 | FromDiscord | <Elegantbeef> Nim doesnt really expose the internals of strings so you cant really manually dealloc, just use arc |
10:44:56 | FromDiscord | <soda> In reply to @Elegantbeef "Can also statically build": oh true, i do have musl somewhere lying around |
10:45:03 | FromDiscord | <soda> In reply to @Elegantbeef "Nim doesnt really expose": sad |
10:45:09 | FromDiscord | <soda> In reply to @Rika "I still don’t recommend": Well the idea is to learn. |
10:45:09 | FromDiscord | <Elegantbeef> Arc is going to be as performant as manual |
10:45:24 | FromDiscord | <Rika> In reply to @soda "Well the idea is": Learn from using danger instead of release? |
10:45:29 | FromDiscord | <soda> why not |
10:45:34 | FromDiscord | <Elegantbeef> ARC is deterministic GC, so it's not very big, but is very fast |
10:45:45 | FromDiscord | <soda> yea the binary is 30kb smaller |
10:45:47 | FromDiscord | <Elegantbeef> Danger doesnt give you any information, it's only really useful for speed/size |
10:45:58 | FromDiscord | <Rika> It’s not fast, it’s low latency |
10:46:12 | FromDiscord | <Rika> Use strip as well if you want |
10:46:26 | FromDiscord | <Elegantbeef> All the usual C size optimization tricks apply 😛 |
10:46:29 | FromDiscord | <soda> haha yes ofc i have done all of these things |
10:46:33 | FromDiscord | <soda> save for linking with musl |
10:46:45 | FromDiscord | <enthus1ast> can i test if a var is a const? In a macro? |
10:46:53 | FromDiscord | <soda> this is the make file i used |
10:46:58 | FromDiscord | <soda> sent a long message, see http://ix.io/3S1l |
10:47:42 | FromDiscord | <Rika> Why are you pursuing small binary sizes? Just wondering |
10:48:07 | FromDiscord | <soda> No real reason. I'm just playing around with nim and compare it to other languages i know |
10:48:14 | FromDiscord | <soda> to mentally profile it |
10:49:40 | FromDiscord | <soda> In reply to @Elegantbeef "Now to nimify it": This is very similar to go |
10:50:26 | FromDiscord | <Elegantbeef> `symKind` |
10:50:55 | FromDiscord | <enthus1ast> thanks [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) ! |
11:27:28 | * | syl_ is now known as syl |
11:39:15 | FromDiscord | <retkid> https://github.com/soasme/nim-schedules |
11:39:17 | FromDiscord | <retkid> i like this syntac |
11:39:18 | FromDiscord | <retkid> (edit) "syntac" => "syntax" |
11:39:20 | FromDiscord | <retkid> it make my brain happy |
11:46:03 | * | jmdaemon joined #nim |
11:48:26 | FromDiscord | <Rika> eh |
11:49:49 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/952171552617660416/unknown.png |
11:50:26 | FromDiscord | <retkid> it kinda upsets me that it isn't perfect but im going to assume thats the computation time of the difference proc |
11:50:38 | FromDiscord | <Rika> perfection is difficult |
11:50:52 | FromDiscord | <Rika> if you want perfection then you have a lot of work ahead of you |
11:51:03 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/952171862186672128/unknown.png |
11:51:13 | FromDiscord | <retkid> its better with -d:danger |
11:51:19 | FromDiscord | <retkid> so yea i think its near perfect |
12:08:12 | * | jmdaemon quit (Ping timeout: 240 seconds) |
12:25:41 | * | jjido joined #nim |
12:30:46 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:46:38 | FromDiscord | <Sense> In reply to @Amun-Ra "System64 - this is": damn |
12:55:52 | * | pro joined #nim |
13:04:20 | * | vicecea quit (Remote host closed the connection) |
13:04:48 | * | vicecea joined #nim |
13:26:50 | * | pro quit (Quit: pro) |
14:09:07 | FromDiscord | <Schelz> nim support esp32 ibeacon via ble ? |
14:40:16 | * | arkurious joined #nim |
14:53:09 | FromDiscord | <auxym> I mean, nim won't support that, but a library might. Have you checked nesper? Also, try asking in the embedded channel |
14:58:49 | * | toulene quit (Ping timeout: 272 seconds) |
15:01:38 | * | toulene joined #nim |
15:10:16 | FromDiscord | <Schelz> its the same thing just that on main peoples might answer faster its not a technical question its just a simple question |
15:10:23 | FromDiscord | <Schelz> In reply to @auxym "I mean, nim won't": its the same thing just that on main peoples might answer faster its not a technical question its just a simple question |
15:12:03 | FromDiscord | <auxym> i mean, sounds pretty technical tbh, you're asking about a very specific feature of a very specific embedded system. but main is pretty quiet this morning anyways 😄 |
15:12:26 | FromDiscord | <Schelz> huh lame |
15:13:16 | FromDiscord | <Schelz> bth thx for guessing an answer for my question |
15:14:21 | FromDiscord | <Schelz> (edit) removed "bth" |
15:14:51 | FromDiscord | <Schelz> (edit) "thx for guessing an answer for my question ... " added "😄" |
15:25:37 | FromDiscord | <soda> Is there an equivalent of C++'s fmt::format in nim? I know fmt exists, but is there a way i can have something like fmt("{}", 21) ? |
15:26:44 | FromDiscord | <Schelz> https://nim-lang.org/docs/strformat.html |
15:26:47 | FromDiscord | <Rika> strutils.% |
15:27:11 | FromDiscord | <soda> In reply to @Schelz "https://nim-lang.org/docs/strformat.html": i couldn't find what i was looking for there |
15:27:18 | FromDiscord | <soda> In reply to @Rika "strutils.%": oh okay i'll check it out |
15:27:53 | FromDiscord | <Schelz> oh |
15:27:55 | FromDiscord | <Rika> usage is like `"$# aaaa $#" % ["bbbb", "cccc"]` |
15:28:04 | FromDiscord | <Rika> i think |
15:28:05 | FromDiscord | <Rika> i forget |
15:28:09 | FromDiscord | <Rika> its on the docs nonetheless |
15:32:43 | FromDiscord | <soda> Cool it works well, but i have one more question. Is there a ternary operator i can use to branch the replacing? |
15:33:31 | FromDiscord | <soda> C++ equivalent would be: std::cout << "I am a " << (bool ? "if true" : "if false"); |
15:33:38 | FromDiscord | <auxym> In reply to @Rika "usage is like `"$#": https://nim-lang.org/docs/strutils.html#%25%2Cstring%2CopenArray%5Bstring%5D |
15:33:52 | FromDiscord | <Rika> yeah that |
15:34:12 | FromDiscord | <soda> Yeah it's that syntax, but doesn't seem to support ternary operator inside the [] |
15:34:16 | FromDiscord | <Rika> In reply to @soda "Cool it works well,": `(if aBool: "true" else: "false")` |
15:34:24 | FromDiscord | <soda> it wont work |
15:34:26 | FromDiscord | <Rika> thats a ternary |
15:34:28 | FromDiscord | <Rika> why not |
15:34:42 | FromDiscord | <soda> nvm im dum |
15:34:52 | FromDiscord | <Rika> !eval echo "$1" % [(if true: "true" else: "false")] |
15:34:54 | NimBot | Compile failed: /usercode/in.nim(1, 11) Error: undeclared identifier: '%' |
15:35:12 | FromDiscord | <soda> it actually works |
15:35:20 | FromDiscord | <soda> i had just missed something else |
15:35:21 | FromDiscord | <Rika> ok good |
16:00:28 | * | slowButPresent joined #nim |
17:00:43 | * | acidsys quit (Excess Flood) |
17:01:16 | * | acidsys joined #nim |
17:37:28 | * | def- quit (*.net *.split) |
17:37:28 | * | rb quit (*.net *.split) |
17:37:28 | * | ssiyad quit (*.net *.split) |
17:37:28 | * | tinystoat quit (*.net *.split) |
17:42:55 | * | def- joined #nim |
17:42:55 | * | rb joined #nim |
17:42:55 | * | ssiyad joined #nim |
17:42:55 | * | tinystoat joined #nim |
17:44:37 | FromDiscord | <Require Support> `myObj->myMember` in C is just `myObj.myMember` in nim ? if myObj is already a `ptr` type |
18:05:43 | FromDiscord | <huantian> Correct, it’s the same as `myObj[].myMember` |
18:11:50 | FromDiscord | <S3cur3Th1sSh1t> sent a long message, see http://ix.io/3S3o |
18:35:07 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3S3x |
18:38:43 | FromDiscord | <qb> I guess echoing isn't threadsafe. Multiple threads could echo to the same line at the same time. Locks would make sure you get every echo on a new line |
18:39:48 | FromDiscord | <huantian> Yep you don’t want one echo to happen in the middle of another and “interrupt” it |
18:40:46 | FromDiscord | <d4rckh> thanks! I know when I was doing threads in python they wouldn't actually be parallel but concurrent, this happened only on windows tho, is it the same case with nim too? |
18:43:23 | FromDiscord | <qb> If you're talking about the interpreter lock python has. No nim doesn't have that |
18:44:05 | * | jmdaemon joined #nim |
18:44:23 | FromDiscord | <qb> But pythons gil should be on every os |
18:46:43 | FromDiscord | <S3cur3Th1sSh1t> In reply to @S3cur3Th1sSh1t "Hey, can someone": Already found a solution, problem solved. |
18:49:34 | FromDiscord | <d4rckh> In reply to @qb "If you're talking about": cool |
19:12:05 | FromDiscord | <Ayy Lmao> Is there a way to get nimlsp in sublime text to be aware of changes to other files? For some reason when I do something like change a function definition in another file, I have to restart sublime text for other files to be aware of that change. |
19:22:52 | FromDiscord | <d4rckh> I am getting this error when compiling that code: `Error: cannot evaluate at compile time: nThreads`. why is that getting evaluated at compile time? https://media.discordapp.net/attachments/371759389889003532/952285564579749918/unknown.png |
19:26:09 | FromDiscord | <Phil> Type assignments are done at compile time |
19:26:22 | FromDiscord | <Phil> And so it tries to resolve nThreads and replace it with a 5 |
19:26:47 | FromDiscord | <Phil> But then notices that nThreads isn't known at compile time, only at runtime (because you use var. To have this be at compile time use const) |
19:27:26 | FromDiscord | <Phil> Keep in mind though that const values can basically be only magic numbers and magic strings, so essentially strings and numbers you hard code as you did nThreads |
19:27:33 | FromDiscord | <d4rckh> I see, but nThreads needs to be a var because it will be replaced with an command line argument later |
19:27:36 | FromDiscord | <Phil> (edit) "nThreads" => "nThreads. That or they have to be types/ stem from types" |
19:27:44 | FromDiscord | <d4rckh> (edit) "an" => "a" |
19:28:12 | FromDiscord | <Phil> in that case you migth want to make a const "threadCount" and then do "nThreads = threadCount" initially |
19:28:31 | FromDiscord | <Phil> or "initialThreadCount" if nThreads evolves over time |
19:28:43 | FromDiscord | <Phil> or "maxThreadCount" if the array is only ever supposed to contain 5 entries |
19:29:24 | FromDiscord | <d4rckh> wait, one second |
19:29:29 | FromDiscord | <d4rckh> https://media.discordapp.net/attachments/371759389889003532/952287232646082620/unknown.png |
19:29:32 | FromDiscord | <d4rckh> here |
19:30:06 | FromDiscord | <d4rckh> this is how it should be |
19:30:24 | FromDiscord | <Phil> First question, I assume parsedArgs.threadCount is still 5 |
19:30:30 | FromDiscord | <Phil> Will you never have more than 5 threads? |
19:30:51 | FromDiscord | <Phil> Or do you want your array to be able to handle more than 5 threads? |
19:30:53 | FromDiscord | <d4rckh> it a user provided value so it could be anything |
19:30:57 | FromDiscord | <d4rckh> (edit) "it" => "its" |
19:31:13 | FromDiscord | <d4rckh> 1, 2, 20, 100 |
19:31:24 | FromDiscord | <Phil> Then you can't use a straight up array here, for an array you must know at compile time how large it is allowed to be. You want to use a seq |
19:33:55 | FromDiscord | <d4rckh> oh, it works, thanks |
19:34:04 | FromDiscord | <Phil> with seq? |
19:34:12 | FromDiscord | <Kiwids> hi guys! I want to use deploy Jester with https. is there a way to achieve that? |
19:34:14 | FromDiscord | <Kiwids> thanks! alot |
19:34:23 | FromDiscord | <Kiwids> (edit) "use" => "" |
19:35:20 | FromDiscord | <Kiwids> like flask in python |
19:35:27 | FromDiscord | <Phil> No idea, never used jester, I use prologue. You might have also a chance by asking in the webdev channel |
19:35:34 | FromDiscord | <Kiwids> In reply to @Isofruit "No idea, never used": thanks! |
19:35:53 | FromDiscord | <d4rckh> In reply to @Isofruit "with seq?": yup |
19:36:13 | FromDiscord | <Phil> In reply to @Kiwids "thanks!": Though, either way, shouldn't you have your server behind an ngninx or an apache and they handle the HTTPS side of things? |
19:36:23 | FromDiscord | <Phil> (edit) "In reply to @Kiwids "thanks!": Though, either way, shouldn't you have your ... server" added " application" |
19:37:18 | FromDiscord | <Kiwids> haha yeah that would be the case. but I am just wondering if this is possible for a small env |
19:38:30 | FromDiscord | <Phil> In reply to @d4rckh "yup": Yeh, if you want what amounts to a resizeable array (the data type is typically called a list), then the tool to go is pretty much seq's.↵Arrays are useful when you know your data size ahead of time, e.g. that it must be 5 entries or sth. |
19:43:27 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3S3M |
19:43:40 | FromDiscord | <d4rckh> it throws this error `Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]` |
19:44:04 | FromDiscord | <Alea> is there still not better alternative to nimsaem's extension for vscode? it's really not working for me today |
19:44:09 | FromDiscord | <Alea> (edit) "not" => "no" |
19:44:11 | FromDiscord | <Phil> Well, it starts with 0 threads in it, you're just declaring the variable. Got to do a lot of thr.add calls first that add some threads |
19:44:36 | FromDiscord | <exelotl> is there a nim equivalent of `LINE` ? |
19:44:49 | FromDiscord | <d4rckh> so just empty elements to the sequence? |
19:44:55 | FromDiscord | <exelotl> I'm trying with `instantiationInfo` but it seems to only work in templates |
19:45:59 | FromDiscord | <Phil> In reply to @d4rckh "Wait, I don't think": strictly speaking it's just a declared variable with no content. ↵Under the hood nim does some initialization for you, so by just declaring it nim already builds an empty seq with those types for you, but I would never ever rely on that. |
19:46:29 | FromDiscord | <d4rckh> In reply to @Isofruit "*strictly speaking* it's just": oh, how can i initialize it myself then? |
19:50:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3S3N |
19:50:35 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=3S3N" => "https://play.nim-lang.org/#ix=3S3O" |
19:50:50 | FromDiscord | <Schelz> Does nim has bind for DEFINE_GUID ? |
19:51:02 | FromDiscord | <Schelz> (edit) "Does nim has bind for DEFINE_GUID ?" => "sent a code paste, see https://play.nim-lang.org/#ix=3S3Q" |
19:51:10 | FromDiscord | <Schelz> (edit) "sent a code paste, see https://play.nim-lang.org/#ix=3S3Q" => "Does nim has bind for DEFINE_GUID?" |
19:51:13 | FromDiscord | <Schelz> (edit) "DEFINE_GUID?" => "DEFINE_GUID ?" |
19:51:24 | FromDiscord | <Phil> In reply to @Alea "is there still no": There's really not a lot. Half the time I debug just on compiler errors alone which do an alright job |
19:52:29 | FromDiscord | <d4rckh> In reply to @Isofruit "There's like half a": oh yeah i was doing this too but i wasnt sure about the code to create a thread object haha |
19:52:51 | FromDiscord | <Phil> What package did you import to have the Thread type? |
19:53:10 | FromDiscord | <Phil> Typically that kind of package contains procs for building the type it provides |
19:53:15 | FromDiscord | <d4rckh> It's part of the system module, https://nim-lang.org/docs/threads.html |
19:53:38 | FromDiscord | <Phil> I'm spotting 2 "createThread" procs at first glance |
19:54:26 | FromDiscord | <Alea> In reply to @Isofruit "There's really not a": my problem is that it wont show func signatures while any errors exist :pain: |
19:54:59 | FromDiscord | <Phil> In reply to @Alea "my problem is that": Huh, that puts you further ahead than me, for me the intellisense takes so long I can type out the proc three times over before I get a suggestion |
19:55:49 | FromDiscord | <Phil> nimsaem's plugin is still pretty useful for underlining the areas where the compiler is complaining though, so I'll take what I can get |
19:56:20 | FromDiscord | <d4rckh> In reply to @Isofruit "I'm spotting 2 "createThread"": both return a proc 😢 https://media.discordapp.net/attachments/371759389889003532/952293989103583302/unknown.png |
19:57:17 | FromDiscord | <Phil> You'll find both return nothing 😛↵But they take procs as arguments, as in that proc will be executed by that thread and once the proc is finished that thread will kill itself |
19:57:46 | * | jjido joined #nim |
19:57:47 | FromDiscord | <Phil> `;` is identical to `,` within proc signatures |
19:57:54 | FromDiscord | <Phil> Don't ask me why, some people find that more visible |
19:58:37 | FromDiscord | <Phil> Actually there's some fine-grained differences, like you can't do "a; b: int" iirc, but I'm not a fan of that anyway so.... eh |
19:59:05 | FromDiscord | <d4rckh> Oh, so how can I get about creating a Thread object to add to that sequence then? |
19:59:37 | FromDiscord | <Phil> What task is the thread supposed to do? |
19:59:58 | FromDiscord | <d4rckh> It's supposed to do some web requests |
20:00:17 | FromDiscord | <d4rckh> actually it just calls another function |
20:00:26 | FromDiscord | <d4rckh> (edit) "function" => "function, that is doing some web requests" |
20:00:58 | FromDiscord | <Phil> define a proc that does exactly that (does the web request, receives a response and performs some action from that response) |
20:01:17 | FromDiscord | <Phil> And then use that proc as argument for creating the thread |
20:01:31 | FromDiscord | <Phil> (edit) "And then use that proc as ... argument" added "the "tp"" |
20:01:41 | FromDiscord | <d4rckh> yeah, i have a `threadFunc` as the example from threads docs |
20:08:54 | NimEventer | New thread by Seves: Handling of persistent connections in asynchttpserver, see https://forum.nim-lang.org/t/9003 |
20:10:43 | FromDiscord | <Phil> createThread(thr[i], yourProc, <however you instantiate a tuple I forgot>) should do it |
20:10:51 | FromDiscord | <Phil> (edit) "yourProc," => "threadFunc," |
20:11:24 | FromDiscord | <Phil> But you start at index 0 |
20:12:25 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/LtF |
20:12:30 | FromDiscord | <d4rckh> In reply to @d4rckh "Wait, I don't think": That's what im doing already |
20:22:29 | FromDiscord | <d4rckh> sent a code paste, see https://paste.rs/tPD |
20:31:24 | FromDiscord | <Phil> Welp, all examples insist on static numbers of threads, not a dynamic number of threads. I'd start experimenting with createThread procs and see how to get the initial Thread you need for them to work, otherwise I'd recommend contemplating whether dynamic thread amounts are desired or not. |
20:31:38 | FromDiscord | <Phil> I myself shall head off to sleep |
20:32:21 | FromDiscord | <d4rckh> the thread count must be dynamic |
20:32:30 | FromDiscord | <d4rckh> have a great sleep and thanks for helping me |
20:32:37 | * | Gustavo6046 joined #nim |
20:33:03 | FromDiscord | <d4rckh> maybe someone else can help me with having dynamic thread amounts? 😛 |
20:33:28 | FromDiscord | <Phil> You could always start experimenting with the procs yourself 😛 |
21:41:55 | * | wyrd quit (Ping timeout: 240 seconds) |
21:48:59 | * | wyrd joined #nim |
22:01:41 | FromDiscord | <Schelz> So i found that winim has bind for "DEFINE_GUID" but is there a bind for "DECLSPEC_UUID" ? |
22:01:52 | FromDiscord | <Schelz> i couldn't find any |
22:39:17 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:11:35 | * | acidsys quit (Excess Flood) |
23:12:08 | * | acidsys joined #nim |
23:23:39 | FromDiscord | <Ayy Lmao> Does anyone know how to get nimsuggest to work on the vscode extension? Whenever I check the `Use Nimsuggest Check` option I stop seeing errors. |
23:24:14 | FromDiscord | <Elegantbeef> Which extension are you using? |
23:24:34 | FromDiscord | <Ayy Lmao> the one from nimsaem |
23:25:02 | FromDiscord | <Elegantbeef> That setting uses `nimsuggest chk` instead of `nim check` for error reporting |
23:25:20 | FromDiscord | <Elegantbeef> Or vice versa, it doesnt really matter afaik |
23:26:03 | FromDiscord | <Ayy Lmao> I would like to use the `nimsuggest chk` setting because of this specific project that takes 5 seconds to compile. |
23:26:58 | FromDiscord | <Elegantbeef> Give me asecond to toy with it, to see if i can get it working |
23:27:57 | FromDiscord | <Ayy Lmao> In sublime text with nimlsp, it seems to show errors very quickly, but has this problem where changes in other files don't seem to be immediately visible and I have to restart the language server every time |
23:34:22 | FromDiscord | <Elegantbeef> add your file to your project settings 😛 |
23:34:32 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/952348902345023570/image.png |
23:34:35 | FromDiscord | <Elegantbeef> For instance |
23:34:39 | FromDiscord | <Elegantbeef> I think that's right... could be wrong |
23:35:22 | FromDiscord | <Elegantbeef> Hmm i cannot get nimsuggest check to play nice |
23:35:24 | nrds | <Prestige99> Compiling for wasm, anyone know how to enable linking? |
23:35:25 | FromDiscord | <Elegantbeef> II take it back |
23:35:30 | FromDiscord | <Elegantbeef> It's impossible to use |
23:35:49 | nrds | <Prestige99> "To use dlopen, you need to use Emscripten's linking support" |
23:36:13 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "It's impossible to use": hehe, have you messed around with sublime text at all? |
23:36:29 | FromDiscord | <Elegantbeef> Nope most recently i've been using kate |
23:37:40 | FromDiscord | <Ayy Lmao> I'll have to take a look at that one. I like the idea of using sublime text but the issue I'm having with nimsuggest with it is unusable. |
23:38:45 | FromDiscord | <Elegantbeef> Yea the issue with kate is the LSP has a bug with Nimlsp so no error reporting |
23:40:50 | FromDiscord | <Ayy Lmao> Well maybe when incremental compilation comes it will alleviate my issues. |
23:44:16 | FromDiscord | <Elegantbeef> Nimlsp is nimsuggest backed so what's the issue with sublime? |
23:45:18 | FromDiscord | <Ayy Lmao> If I change something in one file, it isn't reflected in other files' error messages unless I restart the language server or restart sublime text. |
23:45:36 | FromDiscord | <Elegantbeef> That means your project is dispatching mutliple LSPs |
23:46:07 | FromDiscord | <Elegantbeef> You need a config that sets up the LSP so it has a single entry into your project so only 1 server is running |
23:46:37 | FromDiscord | <Elegantbeef> Is this project public? |
23:47:43 | FromDiscord | <Ayy Lmao> I'm not sure how to do that. The project I'm working on isn't public but just imagine a source file on the top level that is using files that are in a folder next to it. |
23:48:19 | FromDiscord | <Ayy Lmao> If I change any of the files none of the other files are aware of the changes |
23:48:28 | FromDiscord | <Elegantbeef> It might just be a `config.nims` with a `--path:"myEntry.nim"` |
23:48:40 | FromDiscord | <Elegantbeef> Yes like i said multiple LSPs are running |
23:48:45 | FromDiscord | <Elegantbeef> So each file is getting it's own |
23:49:40 | FromDiscord | <Ayy Lmao> I'll try to do a config.nims and see what happens |
23:55:46 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "It might just be": It doesn't seem to work unfortunately. |
23:58:10 | FromDiscord | <Elegantbeef> Yea i dont know how to configure it properly, perhaps pmunch is on, doubtful though |
23:58:24 | FromDiscord | <Ayy Lmao> I wonder if there's some setting somewhere to set an entrypoint. I never configured anything like that or found something that was telling me to |