00:00:01 | * | junland_ quit (Quit: %ZNC Disconnected%) |
00:00:45 | * | junland joined #nim |
00:04:25 | Prestige | Anyone able to run the hcr example here? https://nim-lang.github.io/Nim/hcr.html |
00:04:47 | Prestige | It compiles, but I am missing libnimhcr.so it seems |
00:08:50 | Prestige | I followed the steps at the bottom to compile libnimhcr.so and libnimrtl.so, but still get the same error |
00:09:55 | * | luis joined #nim |
00:25:14 | voidpi | Prestige: didn't compile for me |
00:25:30 | voidpi | /tmp/logic.nim(52, 18) Error: object constructor needs an object type |
00:26:28 | * | luis quit (Read error: Connection reset by peer) |
00:27:51 | Prestige | yeah the Rect is a tuple now instead of an object voidpi |
00:29:50 | voidpi | so it's because my nim version? |
00:29:57 | voidpi | 1.2.6 |
00:30:08 | Prestige | nah sdl wrapper update |
00:30:28 | Prestige | just do var rect: Rect = (stuff here) |
00:30:42 | Prestige | instead of var rect = Rect(stuff) |
00:30:58 | FromDiscord | <Inam> oh interesting |
00:31:32 | FromDiscord | <Inam> how about `rect(stuff)`? |
00:31:56 | * | Prestige shrugs |
00:32:05 | Prestige | just need to declare it as a tuple |
00:32:12 | FromDiscord | <Inam> idk why I asked I can run it myself :p |
00:32:17 | Prestige | hehe |
00:32:18 | voidpi | ./mymain |
00:32:18 | voidpi | could not load: libnimhcr.so |
00:32:19 | voidpi | compile with -d:nimDebugDlOpen for more information |
00:32:38 | Prestige | Yep that's the issue I'm having |
00:32:55 | * | luis joined #nim |
00:32:56 | voidpi | well at least it's reproducible |
00:32:59 | Prestige | at the very bottom it tells you how to compile the .so files |
00:33:11 | Prestige | but I don't know how to use it |
00:33:33 | Prestige | maybe I need to symlink it to the dir with all my system's .so file |
00:33:36 | Prestige | files* |
00:34:41 | FromDiscord | <Inam> where is it right now? |
00:34:54 | Prestige | just in my current working directory |
00:35:00 | FromDiscord | <Inam> o |
00:35:16 | * | a_chou quit (Ping timeout: 256 seconds) |
00:35:58 | Prestige | it worked` |
00:36:00 | Prestige | ! |
00:36:05 | FromDiscord | <shashlick> On Linux you need to set ld_library_path |
00:36:44 | Prestige | @shashlick how, with a nim flag? |
00:37:15 | FromDiscord | <Inam> I think it's like your path |
00:37:21 | FromDiscord | <Rika> It's an env var |
00:37:30 | FromDiscord | <Rika> So you set it in shell |
00:37:30 | FromDiscord | <shashlick> https://unix.stackexchange.com/questions/168340/where-is-ld-library-path-how-do-i-set-the-ld-library-path-env-variable#168348 |
00:37:31 | FromDiscord | <Inam> ie like `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64` on bourne-shells |
00:37:38 | FromDiscord | <Inam> ye |
00:37:44 | Prestige | oh, cool |
00:38:26 | FromDiscord | <shashlick> Alternative is to set rpath at compile time but not sure how hcr is setup |
00:38:33 | FromDiscord | <Inam> I think you might also be able to do `LD_LIBRARY_PATH+={spot}` but I'm on fish |
00:39:37 | FromDiscord | <Rika> Fish is nice |
00:42:09 | * | a_chou joined #nim |
00:42:35 | * | a_chou quit (Client Quit) |
00:47:44 | * | a_b_m joined #nim |
00:50:38 | * | luis quit (Read error: Connection reset by peer) |
00:51:01 | * | abm quit (Ping timeout: 260 seconds) |
00:53:52 | astronavt | it did end up being a debian problem |
00:53:59 | astronavt | for anyone who saw my question above |
00:57:24 | FromDiscord | <dayl1ght> is it possible to import relative to the root directory (i.e. the one with the project's .nimble file)? |
01:00:24 | FromDiscord | <shashlick> Use thisDir() |
01:00:40 | FromDiscord | <shashlick> If in the nimble file |
01:01:40 | FromDiscord | <dayl1ght> I mean in a .nim file |
01:01:46 | * | luis joined #nim |
01:02:11 | FromDiscord | <dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2AlR |
01:02:39 | FromDiscord | <dayl1ght> is it possible to have something like `import a/file1.nim` in file2.nim? |
01:04:57 | FromDiscord | <dayl1ght> I missed a `src` directory there |
01:06:07 | * | vicfred quit (Quit: Leaving) |
01:08:17 | astronavt | are there any nice examples of command line programs built with nim that i can use as a reference while i'm writing mine? |
01:08:50 | astronavt | i found https://nim-lang.org/docs/parseopt.html which is nice, but im curious how people structure such programs |
01:09:40 | * | luis quit (Read error: Connection reset by peer) |
01:15:26 | FromDiscord | <Rebel> getopt? |
01:18:00 | astronavt | right, that's in the docs for parseopt |
01:18:35 | * | luis joined #nim |
01:19:04 | * | a_b_m quit (Quit: Leaving) |
01:20:27 | * | krux02 quit (Remote host closed the connection) |
01:22:11 | FromDiscord | <demotomohiro> !repo cligen |
01:22:11 | disbot | https://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs At 15 216⭐ 15🍴 7& 1 more... |
01:22:44 | astronavt | oooh |
01:22:46 | astronavt | that is very interesting |
01:23:11 | astronavt | it even supports subcommands |
01:25:23 | * | leorize quit (Ping timeout: 240 seconds) |
01:35:16 | * | luis quit (Quit: luis) |
01:35:28 | * | luis joined #nim |
01:37:47 | * | apahl quit (Ping timeout: 240 seconds) |
01:40:05 | * | apahl joined #nim |
01:42:18 | * | luis quit (Quit: luis) |
01:42:50 | * | leorize joined #nim |
01:47:46 | astronavt | is there a linter and/or auto-formatter for nim? i don't see one in the curated packages list |
01:50:59 | * | luis joined #nim |
01:59:23 | * | qeeg quit (Remote host closed the connection) |
02:00:25 | * | qeeg joined #nim |
02:01:18 | FromDiscord | <hobbledehoy> nimpretty maybe? |
02:07:02 | FromDiscord | <hobbledehoy> There is also style checking option when compiling iirc |
02:09:21 | astronavt | i see, thank you |
02:09:33 | * | luis quit (Ping timeout: 272 seconds) |
02:10:39 | astronavt | where is that documented? |
02:11:11 | astronavt | i only see it referenced here https://nim-lang.org/docs/tools.html and in a blog post |
02:16:49 | FromDiscord | <shashlick> @dayl1ght you can use relative paths with ".."/ etc |
02:17:08 | FromDiscord | <shashlick> Or you could add --path:.. |
02:17:24 | FromDiscord | <Winton> I think Nim could be a great language to create emulator server for games |
02:17:47 | FromDiscord | <Winton> one of those that are created in lua, java and c # |
02:33:35 | astronavt | is there any recommended or standard syntax for documentation comments? like how sphinx and doxygen support syntax to document each parameter, describe the return value, add examples, link to other entities, etc. |
02:34:20 | astronavt | (maybe i should ask this on the forum) |
02:45:12 | * | luis joined #nim |
02:46:55 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:48:38 | * | muffindrake joined #nim |
02:55:47 | * | luis quit (Ping timeout: 272 seconds) |
03:09:52 | FromDiscord | <exelotl> Yeah it would be a good forum post |
03:10:39 | FromDiscord | <exelotl> I tend to use rst's definition lists to document parameters |
03:29:02 | * | arecacea1 quit (Remote host closed the connection) |
03:29:28 | * | arecacea1 joined #nim |
04:00:39 | * | luis joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:32 | * | supakeen joined #nim |
04:07:40 | * | luis quit (Read error: Connection reset by peer) |
04:24:16 | * | astronavt quit (Ping timeout: 246 seconds) |
04:31:00 | * | luis joined #nim |
04:42:08 | * | luis quit (Quit: luis) |
04:42:16 | * | luis joined #nim |
04:43:47 | silvernode[m] | So today I learned that this exists: https://repl.it/site/multiplayer |
04:44:02 | silvernode[m] | It also has Nim support |
04:44:30 | FromDiscord | <Elegant Beef> Nice |
04:44:42 | FromDiscord | <Elegant Beef> Although Vscode has livesharing |
04:44:46 | silvernode[m] | A complete collab IDE with Version control and Github Login support. with a terminal to boot |
04:45:10 | FromDiscord | <Elegant Beef> You just described Vscode's live share feature 😛 |
04:45:57 | silvernode[m] | <FromDiscord "<Elegant Beef> You just describe"> yeah pretty much, but this could be an alternative for people on systems where liveshare doesn't work for some reason |
04:46:47 | silvernode[m] | Like Void Linux for example. It's a pain to setup compared to supported distros. |
04:47:37 | FromDiscord | <Elegant Beef> Who wants to wrap the js media recorder api? 😄 |
04:47:52 | silvernode[m] | Anyway, time for work, I just thought I should pop in here and share that link. I actually tried it out and told it to import my nim project from Github. Works like a charm and the experience is top notch. |
04:48:00 | FromDiscord | <Elegant Beef> Nice |
04:48:11 | silvernode[m] | later! |
04:48:18 | FromDiscord | <Elegant Beef> buh bye |
04:49:11 | * | sirn quit (Ping timeout: 240 seconds) |
04:52:02 | * | guelosk[m]1 joined #nim |
04:52:07 | * | matlock_ joined #nim |
04:52:55 | * | sirn joined #nim |
04:54:54 | * | matlock quit (Ping timeout: 240 seconds) |
04:54:54 | * | guelosk[m] quit (Ping timeout: 240 seconds) |
04:54:55 | * | alehander92 quit (Ping timeout: 240 seconds) |
04:54:56 | * | matlock_ is now known as matlock |
04:55:10 | * | alehander92_ joined #nim |
04:56:04 | * | planetis[m]1 joined #nim |
04:56:06 | * | planetis[m] quit (Ping timeout: 240 seconds) |
04:57:15 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:08:55 | FromDiscord | <anto> question, are there docs on outputting ansi color codes to stdout? or am i just unfathomably bad at this? |
05:10:01 | FromDiscord | <juan_carlos> terminal module on stdlib. |
05:10:58 | FromDiscord | <anto> it's not that, it's that im trying to use the ansi rgb colors, but it just refuses to play nice |
05:11:40 | FromDiscord | <anto> nv, |
05:11:42 | FromDiscord | <anto> (edit) 'nv,' => 'nvm' |
05:11:47 | FromDiscord | <anto> im just unfathomably bad at this |
05:12:00 | FromDiscord | <anto> i figured out what i got wrong |
05:18:56 | * | solitudesf joined #nim |
05:21:59 | * | luis quit (Read error: Connection reset by peer) |
05:22:12 | * | luis joined #nim |
06:12:36 | FromDiscord | <Yardanico> @anto terminal module supports ansi colour codes including true colour |
06:12:39 | FromDiscord | <Yardanico> See https://nim-lang.org/docs/terminal.html#setForegroundColor%2CFile%2CColor |
06:12:47 | FromDiscord | <Yardanico> And other procs in the module |
06:13:07 | FromDiscord | <anto> i know, ive been referencing those |
06:13:18 | FromDiscord | <anto> i just ran into a vs-code specific issue |
06:25:14 | * | luis quit (Quit: luis) |
06:25:29 | * | luis joined #nim |
06:26:56 | * | narimiran joined #nim |
06:34:12 | * | gmaggior joined #nim |
06:38:46 | * | luis quit (Read error: Connection reset by peer) |
06:45:11 | * | letto quit (Quit: Konversation terminated!) |
06:45:53 | * | letto joined #nim |
06:57:07 | * | Vladar joined #nim |
07:02:09 | FromDiscord | <lqdev> enableTrueColor() |
07:04:04 | * | luis joined #nim |
07:20:47 | * | luis quit (Read error: Connection reset by peer) |
07:20:57 | * | luis joined #nim |
07:29:28 | * | arecacea1 quit (Remote host closed the connection) |
07:30:53 | * | arecacea1 joined #nim |
07:31:45 | * | luis quit (Quit: luis) |
07:31:57 | * | luis joined #nim |
07:33:27 | * | lum joined #nim |
07:33:49 | lum | Hello |
07:33:52 | lum | test |
07:34:53 | * | lum test |
07:35:07 | * | lum slaps Nim around a bit with a large bamboo shark |
07:35:17 | FromDiscord | <Elegant Beef> I fall out |
07:35:17 | lum | hehe |
07:37:23 | lum | #offtopic |
07:41:33 | * | lritter joined #nim |
07:44:22 | FromDiscord | <Elegant Beef> Any suggestions on how to go around interfacing with https://w3c.github.io/mediacapture-record/#mediarecorder-api? |
07:44:24 | FromDiscord | <Elegant Beef> (edit) 'https://w3c.github.io/mediacapture-record/#mediarecorder-api?' => 'https://w3c.github.io/mediacapture-record/#mediarecorder-api ?' |
07:46:05 | * | ofelas quit (Remote host closed the connection) |
07:48:20 | * | natrys joined #nim |
07:49:55 | * | luis quit (Read error: Connection reset by peer) |
07:54:31 | * | ofelas joined #nim |
07:58:26 | * | luis joined #nim |
08:42:40 | * | luis quit (Read error: Connection reset by peer) |
08:43:17 | * | noonien joined #nim |
08:52:04 | * | noonien quit () |
09:06:19 | * | tdc joined #nim |
09:10:58 | * | luis joined #nim |
09:17:24 | * | luis quit (Quit: luis) |
09:20:04 | * | nature joined #nim |
09:24:55 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:27:38 | * | luis joined #nim |
09:33:24 | * | luis quit (Quit: luis) |
09:38:55 | * | natrys quit (Ping timeout: 246 seconds) |
09:42:40 | * | natrys joined #nim |
09:51:52 | * | natrys quit (Ping timeout: 246 seconds) |
10:01:07 | * | luis joined #nim |
10:06:48 | * | lritter quit (Remote host closed the connection) |
10:12:32 | * | luis quit (Quit: luis) |
10:24:12 | * | rokups joined #nim |
10:25:50 | * | luis joined #nim |
10:27:27 | * | lum_ joined #nim |
10:32:11 | lum_ | test |
10:32:18 | lum_ | he |
10:32:20 | lum_ | works |
10:32:43 | idf | cool |
10:32:46 | * | lum_ joined |
10:34:02 | FromDiscord | <PizzaFox> looking at some C code and c2nim rewrote this as an untyped template↵```c↵#define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b))))↵``` |
10:34:16 | FromDiscord | <PizzaFox> would it make more sense to use an inlined proc instead? |
10:35:56 | * | lum_ quit (Quit: leaving) |
10:45:00 | FromDiscord | <𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> No particular difference, but using less complicated construct is preferrable (in general) |
10:45:31 | FromDiscord | <𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> Or change `untyped` to `int` (or `SomeInteger`) in template types to get better type checking |
10:47:06 | FromDiscord | <PizzaFox> i disliked the idea of having such a simple piece of code being untyped |
10:47:28 | FromDiscord | <PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2Anq |
10:47:39 | * | luis quit (Quit: luis) |
10:50:38 | FromDiscord | <PizzaFox> now i want to know how to convert a string to a byte array |
10:50:53 | FromDiscord | <PizzaFox> (that isnt just iterating over each character by hand) |
10:56:43 | FromDiscord | <𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> Converting to byte array can be done by just casting `echo cast[seq[char]]("hello")`, and `rotl` can be rewritten as `func rotl(a, b: SomeInteger): auto {.inline.} = bitor (a shl b), (a shr (32 - (b)))` (`bitor` is from `std/bitops`) - AFAIK regular `or` is just for boolean values, not bitwise or |
10:58:42 | FromDiscord | <Rika> regular or is also bitwise https://nim-lang.org/docs/system.html#or%2Cint%2Cint |
10:59:32 | * | noonien joined #nim |
11:01:11 | FromDiscord | <PizzaFox> regarding the casts: casts go crazy ahaha↵regarding the typings: reasonable↵regarding the bitops: i think the only type it'll ever be is a uint32, does that change what i should use |
11:02:03 | FromDiscord | <Rika> use regular `or`, i dont know why `bitor` exists |
11:02:08 | FromDiscord | <PizzaFox> lel |
11:02:09 | FromDiscord | <Rika> probably a relic of older nim |
11:02:21 | FromDiscord | <lqdev> i don't think it's a relic |
11:02:33 | * | abm joined #nim |
11:02:34 | FromDiscord | <lqdev> rather it's a newer feature |
11:02:38 | FromDiscord | <lqdev> for increased readability |
11:02:39 | FromDiscord | <PizzaFox> ```nim↵proc bitor*[T: SomeInteger](x, y: T): T {.magic: "BitorI", noSideEffect.}↵``` |
11:02:41 | FromDiscord | <PizzaFox> What |
11:02:44 | FromDiscord | <PizzaFox> the magic |
11:02:51 | FromDiscord | <lqdev> `or` means either boolean OR or bitwise OR |
11:02:58 | FromDiscord | <lqdev> while `.bitor` always means bitwise OR |
11:03:20 | FromDiscord | <Rika> i dont like it |
11:03:32 | FromDiscord | <Rika> reminds me of python |
11:03:52 | FromDiscord | <PizzaFox> why are there more than 1 way to do this |
11:03:56 | FromDiscord | <PizzaFox> i am only slightly joking |
11:04:05 | FromDiscord | <PizzaFox> surely such a low level operation should have 1 method |
11:06:39 | FromDiscord | <Rika> the bitwise `or`s in system do the same thing as `bitor` |
11:06:43 | FromDiscord | <Rika> so choose whichever |
11:06:55 | FromDiscord | <Rika> one is "more readable" (to some) and one is "cleaner" (to some) |
11:07:08 | FromDiscord | <PizzaFox> oh yeah both use the same magic call |
11:07:13 | FromDiscord | <PizzaFox> why do they both exist then lmao |
11:08:07 | FromDiscord | <lqdev> as i said, bitor signals intent better |
11:08:25 | FromDiscord | <PizzaFox> hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm |
11:08:50 | FromDiscord | <PizzaFox> there is an alternative 3rd solution guys |
11:08:57 | FromDiscord | <PizzaFox> use the builtin rotl proc lo https://nim-lang.org/docs/bitops.html#rotateLeftBits%2Cuint32%2Crange%5B%5D |
11:09:04 | FromDiscord | <Clyybber> @PizzaFox your C code could use it in a manner that only untyped would support in nim |
11:09:19 | FromDiscord | <Clyybber> so to retain generality c2nim translates it to an template with untyped params |
11:10:36 | FromDiscord | <PizzaFox> i dont know enough (or any) C to understand why they went with putting that in the header |
11:11:12 | FromDiscord | <PizzaFox> if you're curious the code is from the sample they have for salsa20 encryption https://en.wikipedia.org/wiki/Salsa20#Structure |
11:11:44 | FromDiscord | <Clyybber> performance probably |
11:11:50 | FromDiscord | <Clyybber> not wanting to rely on the compiler to inline it |
11:12:01 | FromDiscord | <PizzaFox> i figured as much |
11:13:25 | * | luis joined #nim |
11:20:08 | * | narimiran quit (Ping timeout: 256 seconds) |
11:24:10 | * | TomDotTom joined #nim |
11:32:59 | * | happyhappy joined #nim |
11:34:22 | * | newUser joined #nim |
11:43:45 | newUser | Hi, I have installed WSL 2 for Windows 10, Ubuntu 20.04 and gcc 9.3 I have compiled the newest gcc 10.2 and want to get Nim compile with this version (only to play arround gcc 9.3 works), please can someone help? |
11:45:46 | newUser | gcc 10.2 is in /usr/local/gcc-10.2.0 |
11:46:26 | * | luis quit (Quit: luis) |
11:46:44 | * | luis joined #nim |
11:49:06 | * | happyhappy quit (Remote host closed the connection) |
11:50:13 | * | FromDiscord quit (Remote host closed the connection) |
11:50:30 | * | FromDiscord joined #nim |
11:50:46 | * | FromDiscord quit (Remote host closed the connection) |
11:51:04 | * | FromDiscord joined #nim |
12:00:07 | * | apahl quit (Ping timeout: 240 seconds) |
12:01:18 | * | apahl joined #nim |
12:04:19 | * | luis quit (Read error: Connection reset by peer) |
12:05:30 | FromGitter | <BeboBBM> What is the best target for nim? C or c++ |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:39 | * | supakeen joined #nim |
12:07:03 | FromDiscord | <Rika> Either is okay really; depends on use case |
12:07:15 | FromDiscord | <Rika> Both is worked on roughly equally |
12:10:37 | FromGitter | <BeboBBM> OK thank you :) |
12:11:44 | * | lritter joined #nim |
12:15:12 | * | astronavt joined #nim |
12:16:03 | * | Vladar quit (Remote host closed the connection) |
12:26:51 | nature | leorize[m]1: I meant that nimlsp/nimsuggest is giving me errors in my editor but the program compiles and works as expected, so I'd like to silence those errors |
12:27:25 | * | sealmove joined #nim |
12:27:48 | sealmove | hey, if you always qualify your enums, then does {.pure.} matter? |
12:33:04 | * | luis joined #nim |
12:36:43 | disruptek | c is the best target. |
12:36:47 | disruptek | sealmove: no. |
12:37:05 | disruptek | shashlick: speaking of, what do you make of those cpp errors in gittyup? |
12:37:58 | * | abm quit (Quit: Leaving) |
12:42:55 | * | TomDotTom quit (Ping timeout: 258 seconds) |
12:49:43 | * | luis quit (Quit: luis) |
12:50:00 | * | luis joined #nim |
13:01:23 | * | krux02 joined #nim |
13:07:35 | * | luis quit (Quit: luis) |
13:09:33 | * | Vladar joined #nim |
13:09:52 | * | newUser quit (Remote host closed the connection) |
13:15:34 | * | alehander92_ quit (Quit: Connection closed for inactivity) |
13:33:17 | * | luis joined #nim |
13:44:32 | * | luis quit (Quit: luis) |
13:44:42 | * | luis joined #nim |
13:48:11 | FromDiscord | <lqdev> when a C library has options to change the allocator functions, is it better to provide it with nim's allocator? |
13:53:49 | * | luis quit (Read error: Connection reset by peer) |
14:07:18 | FromDiscord | <haxscramper> When try to use `treesitter` wrappers on `cpp` target compilation fails with C++ codegen type errors (`cannot convert ‘TSParser*’ to ‘tyObject_TSParser__GPThLCHn1debVc7yRQDI2g*’ in assignment`). `c` target compiles but fails on link stage (`` undefined reference to `std::__cxx11::basic_string<w ``). I've installed it using `nimble install treesitter_c` and trying to compile example from `nimtreesitter/treesitter_cpp/tests/ttre |
14:07:52 | * | luis joined #nim |
14:08:11 | FromDiscord | <haxscramper> I need to do some additional configurations to compile or it supposed to run just after `nim c mytest.nim` where I just copy-pasted things in `mytest.nim`? |
14:12:59 | * | luis quit (Quit: luis) |
14:13:15 | * | luis joined #nim |
14:21:16 | FromGitter | <deech> In Emacs when I copy-paste a proc it messes up the indentation, is there a solution? |
14:25:46 | disruptek | lqdev: it's better to use arc and do nothing. else, i would let the lib and nim use their own allocators. |
14:29:57 | FromDiscord | <Inam> How does it mess up the indentation? I've been using Emacs and it seems to work fine? |
14:31:04 | * | idf04 joined #nim |
14:31:30 | * | idf04 is now known as idf-phoneposter |
14:34:48 | FromDiscord | <haxscramper> Must be some modification hook in nim buffer. Check what minor modes are enabled - I had similar problem due to some "auto-indent" hook (don't remember exact name) |
14:38:16 | * | Vladar quit (Quit: Leaving) |
14:38:50 | * | solitudesf1 quit (*.net *.split) |
14:38:50 | * | fowl quit (*.net *.split) |
14:38:52 | * | GitterIntegratio quit (*.net *.split) |
14:38:52 | * | unclechu quit (*.net *.split) |
14:38:52 | * | lnxw37d4 quit (*.net *.split) |
14:38:52 | * | stever quit (*.net *.split) |
14:38:52 | * | Jjp137 quit (*.net *.split) |
14:38:52 | * | hoek quit (*.net *.split) |
14:38:52 | * | JStoker quit (*.net *.split) |
14:38:52 | * | EastByte quit (*.net *.split) |
14:38:53 | * | OMGOMG quit (*.net *.split) |
14:39:12 | * | solitudesf1 joined #nim |
14:39:12 | * | unclechu joined #nim |
14:39:12 | * | lnxw37d4 joined #nim |
14:39:12 | * | GitterIntegratio joined #nim |
14:39:12 | * | fowl joined #nim |
14:39:12 | * | stever joined #nim |
14:39:12 | * | Jjp137 joined #nim |
14:39:12 | * | hoek joined #nim |
14:39:12 | * | JStoker joined #nim |
14:39:12 | * | EastByte joined #nim |
14:39:12 | * | OMGOMG joined #nim |
14:39:53 | * | waleee-cl joined #nim |
14:40:38 | FromDiscord | <lqdev> disruptek: but isn't nim's allocator faster than the standard C allocator? |
14:40:38 | * | solitudesf1 quit (Ping timeout: 244 seconds) |
14:40:39 | * | GitterIntegratio quit (Ping timeout: 244 seconds) |
14:40:39 | * | unclechu quit (Ping timeout: 244 seconds) |
14:40:39 | * | lnxw37d4 quit (Ping timeout: 244 seconds) |
14:43:28 | * | luis quit (Quit: luis) |
14:47:20 | * | solitudesf1 joined #nim |
14:53:52 | * | rokups quit (Quit: Connection closed for inactivity) |
14:54:16 | disruptek | lqdev: do you have a performance problem? |
14:54:41 | * | lnxw37d4 joined #nim |
14:54:48 | * | unclechu joined #nim |
14:57:54 | FromDiscord | <lqdev> disruptek: no, but i'm trying to provide the fastest solution out of the box |
14:58:16 | FromDiscord | <lqdev> i mean, syscalls are quite expensive. i'd rather avoid them in a hot game loop |
14:59:50 | disruptek | i'm more concerned with making things work. i have never swapped the allocators so i'd rather debug what i understand. |
15:05:19 | * | luis joined #nim |
15:07:38 | * | arecacea1 quit (Remote host closed the connection) |
15:08:12 | * | arecacea1 joined #nim |
15:10:09 | FromDiscord | <shashlick> @haxscramper you need to link with c++ |
15:10:21 | FromDiscord | <shashlick> Since it has c++ files |
15:10:42 | FromDiscord | <shashlick> See nimterop's toast.nims |
15:10:46 | leorize[m]1 | @lqdev if you wanna avoid allocation overhead then use a memory pool |
15:11:05 | FromDiscord | <lqdev> leorize: not so easy unfortunately |
15:11:12 | FromDiscord | <lqdev> why not just use the nim allocator? |
15:11:54 | FromDiscord | <shashlick> @disruptek no idea on the cpp failures |
15:12:05 | FromDiscord | <shashlick> Wonder why so much is failing in your ci |
15:12:21 | * | narimiran joined #nim |
15:12:58 | leorize[m]1 | @lqdev I'd say that Nim's allocator is predictable, not "fast" |
15:13:29 | FromDiscord | <lqdev> but it's still faster than having to go through a syscall? |
15:13:45 | FromDiscord | <lqdev> or should i just use malloc/free |
15:14:03 | leorize[m]1 | why do you think Nim's allocator don't use syscalls? |
15:14:14 | * | tdc quit (Quit: Leaving) |
15:14:23 | leorize[m]1 | you can't have the OS hand the memory to you without asking |
15:14:28 | FromDiscord | <lqdev> i'm not saying it doesn't use syscalls |
15:14:49 | FromDiscord | <lqdev> what i am saying is that it uses less of them because you're allocating from the same memory pool as the GC |
15:14:57 | FromDiscord | <lqdev> and the GC can reuse memory |
15:14:57 | leorize[m]1 | but what's the problem that you're trying to solve? |
15:15:16 | FromDiscord | <lqdev> i'm trying to avoid too many syscalls in my game loop |
15:15:32 | FromDiscord | <lqdev> though on the other hand, i don't really know how chipmunk handles memory allocations |
15:15:37 | FromDiscord | <lqdev> maybe it uses a pool anyways? |
15:15:58 | leorize[m]1 | note that the gc is not that good at memory reuse. You can see it in Araq's benchmark in ARC slides |
15:16:17 | FromDiscord | <lqdev> leorize: alright, so how would i go about writing my own memory pool? |
15:16:17 | leorize[m]1 | using a memory pool speeds things up considerably |
15:16:29 | FromDiscord | <lqdev> seems like chipmunk just uses raw calloc/free |
15:16:32 | leorize[m]1 | there's an implementation in fusion |
15:16:47 | leorize[m]1 | it's one file so you can just copy it over |
15:17:13 | FromDiscord | <lqdev> pools.nim? |
15:17:36 | leorize[m]1 | yea |
15:17:51 | FromDiscord | <lqdev> doesn't seem like the thing i need |
15:18:01 | FromDiscord | <lqdev> because i need a generic malloc, realloc, and free |
15:18:48 | leorize[m]1 | well memory pools are optimized for one type of objects |
15:18:54 | leorize[m]1 | that's why they're fast |
15:19:13 | FromDiscord | <flywind> Is `boundChecks` only disabled in `-d:danger` not in `-d:release`? |
15:19:41 | leorize[m]1 | I guess you should do benchmarks between the system allocator (check both Windows vs Linux) vs Nim's TSLF |
15:19:55 | FromDiscord | <lqdev> leorize: so should i just keep the default calloc/realloc/free for now? |
15:20:39 | leorize[m]1 | I don't know, you want the fastest, you gotta benchmark |
15:20:52 | FromDiscord | <lqdev> yea i guess it doesn't matter for now. |
15:21:05 | FromDiscord | <lqdev> i'll benchmark later on when i actually get to spawning lots of objects |
15:22:14 | FromDiscord | <lqdev> "premature optimization is the root of all evil", they say, yet i'm giving in anyways. -_- |
15:23:24 | astronavt | to whoever wrote the nim tutorials and docs: they are very good and easy to read. thank you! |
15:24:03 | astronavt | it might be because i already am very experienced with python, but i feel like im already comfortable with the language and can start building software without feeling lost. |
15:24:03 | narimiran | is this a reverse day? somebody is praising nim docs and tutorials!? |
15:24:23 | leorize[m]1 | \o/ |
15:24:29 | astronavt | have you seen the python docs? :P |
15:25:17 | FromDiscord | <lqdev> for me the python docs are quite hard to navigate as compared to other languages :p |
15:25:38 | FromDiscord | <lqdev> function names vs descriptions don't stand out well enough |
15:25:41 | astronavt | exactly. imagine trying to learn python, r, c, c++, or java from reading the docs... |
15:27:07 | disruptek | lqdev: make it work, make it correct, make it fast. |
15:27:22 | disruptek | lqdev: don't optimize what you don't understand. |
15:27:37 | FromDiscord | <lqdev> disruptek: i keep forgetting that. |
15:28:03 | disruptek | i understand that you don't think you can use pools, but my guess is that you can use pools. |
15:28:07 | astronavt | i will say that rust has nice docs, and go docs pages themselves are nice but they don't have such a friendly and comprehensive tutorial |
15:28:16 | disruptek | also, pools are an astronomical performance improvement. |
15:33:31 | disruptek | leorize[m]1: your ci stuff that i appropriated from your dns stamp project... is it creating a musl nim? |
15:34:07 | leorize[m]1 | no? |
15:34:26 | * | oculux quit (Ping timeout: 260 seconds) |
15:34:37 | disruptek | shashlick: do the tests pass for you locally? |
15:34:46 | leorize[m]1 | I made it for running tests, not making binaries |
15:34:56 | disruptek | yeah, i didn't think it was musl. |
15:35:06 | disruptek | just trying to figure out what's breaking nimgit2 so hard. |
15:35:23 | disruptek | seems like more than one issue. |
15:35:55 | * | oculux joined #nim |
15:36:39 | FromDiscord | <Yardanico> @flywind release mode has all runtime checks enabled nowadays |
15:36:50 | FromDiscord | <Yardanico> But danger disables everything |
15:37:39 | FromDiscord | <flywind> yea I found some errors in Nim doc |
15:38:36 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/blob/992952d86844805231bcc8a92063c122f721658d/lib/pure/collections/deques.nim#L15 |
15:38:46 | FromDiscord | <flywind> I'm making a pr |
15:43:38 | * | newUser joined #nim |
15:44:08 | FromDiscord | <Yardanico> Well it's there because -d:release was -d:danger before 0.20 :) |
15:44:53 | newUser | I'm trying to compile gintro gtk4 examples, but get: Error: cannot open file: gintro/gtk4, gtk3 examples works and I have installed gtk4, any hints? |
15:46:51 | FromDiscord | <Yardanico> try to reinstall gintro if you're sure that you have gtk4 packages |
15:46:59 | FromDiscord | <Yardanico> Maybe you installed gtk4 after you installed gintro |
15:47:21 | newUser | yes, ok I'll try it |
15:49:57 | newUser | no it works, thx. from top: First we try generating bindings for GTK4, this may fail when GTK4 is not properly installedon your computer. But don't worry, you can still use GTK3 |
15:50:20 | newUser | now it works. |
15:50:59 | * | luis quit (Ping timeout: 272 seconds) |
15:53:33 | * | luis joined #nim |
15:54:30 | * | newUser quit (Remote host closed the connection) |
16:11:36 | astronavt | is there a nim equivalent of tput? i'm mostly just looking for pretty colors in stdout, but also curious what other functionality is available. |
16:13:55 | astronavt | obviously i could also construct escape codes by hand, but thats no fun |
16:15:15 | leorize[m]1 | you should take a look at the terminal module |
16:16:15 | astronavt | thank you |
16:18:40 | astronavt | yeah this looks like what i need, `terminal` + `colors` |
16:19:08 | * | arecacea1 quit (Remote host closed the connection) |
16:19:37 | * | arecacea1 joined #nim |
16:21:45 | astronavt | im not 100% sure how to use this to set more than just the basic 16 colors |
16:22:52 | FromDiscord | <lqdev> `enableTrueColors()` |
16:23:18 | astronavt | e.g. for 256 color, i see that i have to call `enableTrueColors()`, and probably do something like `stdout.styledWrite(ansiForegroundColorCode(colAliceBlue), "this is 'alice blue' text")` |
16:23:28 | FromDiscord | <lqdev> then `stdout.setForegroundColor(colRed)` and `stdout.setBackgroundColor(colGreen)` |
16:23:35 | FromDiscord | <lqdev> https://nim-lang.org/docs/terminal.html#setForegroundColor%2CFile%2CColor |
16:23:46 | FromDiscord | <lqdev> 256 color is not supported |
16:24:17 | astronavt | hm |
16:24:20 | * | astronavt quit (Quit: Leaving) |
16:24:54 | * | astronavt joined #nim |
16:25:00 | astronavt | (sorry i disconnected, might have missed messages) |
16:25:20 | FromDiscord | <lqdev> you didn't miss anything |
16:25:39 | astronavt | ok. do i misunderstand the point of `enableTrueColors()` then? |
16:26:38 | astronavt | setForegroundColor looks like it supports Colors, right? |
16:26:58 | astronavt | are you just saying that styledWrite only supports 16 colors? again sorry for my confusion here |
16:29:31 | * | luis quit (Quit: luis) |
16:29:47 | * | NimBot joined #nim |
16:31:18 | FromDiscord | <Inam> sent a long message, see http://ix.io/2Ap4 |
16:31:19 | astronavt | i feel like any json extension that isn't yaml will have a tough time getting adopted. the benefit of json at this point is that pretty much every programming language has a parser for it |
16:32:05 | astronavt | @Inam true, i did start with that tour. but somehow i felt like the nim tutorial helped me get going faster. |
16:32:41 | FromDiscord | <Inam> Yeah possibly, I've had a lot more C experience than Python experience so we may just be coming at it from different angles :p |
16:33:12 | astronavt | likely! the other thing i like about the nim tutorial is that the whole "syllabus" is in the sidebar, so i can see what is up next and possibly skip around if i feel like it |
16:33:27 | leorize[m]1 | astronavt: "true colors" is only for when you want to use 24-bit colors in your app |
16:33:32 | astronavt | i know it's in the Go one too. but you're right it's probably just a matter of familiarity |
16:33:33 | sealmove | Well, my use-case is special, my project uses JsonNode which means it doesn't depend on text syntax, but it kinda needs a more human-friendly syntax to be usable |
16:33:46 | * | tane joined #nim |
16:33:54 | sealmove | And yaml is impossible to parse |
16:33:57 | FromDiscord | <Inam> Actually it's not in the Go one I don't think? That part is a pain, makes it hard to reference |
16:34:12 | astronavt | it's in the hamburger menu. definitely more hidden |
16:34:24 | leorize[m]1 | sealmove: I think any format trying to improve the "readability/human maintainability" of json is a lost cause |
16:34:52 | FromDiscord | <Inam> Oh yeah |
16:34:52 | FromDiscord | <Inam> You're right |
16:34:57 | sealmove | leorize why? |
16:35:07 | FromDiscord | <Inam> TOML? |
16:35:14 | sealmove | TOML is not good with nesting |
16:35:18 | leorize[m]1 | json was designed for serialization, it's never made for configuration and the syntax itself is terrible for it |
16:35:24 | FromDiscord | <Inam> that's true |
16:35:38 | astronavt | what is JsonNode? |
16:35:57 | leorize[m]1 | it's a type in Nim, representing a json value |
16:36:04 | leorize[m]1 | it's in the json module |
16:36:22 | sealmove | for example a Yaml parser would produce a json node |
16:36:29 | astronavt | oh interesting, i hadn't looked at the json module yet |
16:36:29 | sealmove | JsonNode* |
16:36:42 | astronavt | nim has quite an impressive set of "batteries" that it includes |
16:37:27 | astronavt | the one thing i really dont like about this json5 proposal is the embedded newlines |
16:37:33 | federico3 | astronavt: less than Python |
16:37:44 | sealmove | leorize: i don't need to improve readability of json, I just want any human friendly format that's good with nesting and can be converted to JsonNode at CT relatively easily. |
16:38:08 | sealmove | so I hear suggestions :P |
16:38:17 | astronavt | federico3, but python's are expired, corroded, and leaking ;) |
16:38:23 | leorize[m]1 | you can use that nested text thingy disruptek referenced earlier :P |
16:38:33 | leorize[m]1 | though it uses a much different paradigm from json |
16:38:48 | sealmove | that might actually be a good thing |
16:38:52 | sealmove | lemme check |
16:39:21 | leorize[m]1 | astronavt: I wouldn't say Nim's batteries are that good either :P |
16:39:37 | leorize[m]1 | anything that's not used frequently, well, you can tell by looking at the API |
16:41:06 | FromDiscord | <dom96> json is one example of a module in Nim's standard lib that is used very often, which does actually make it quite good |
16:41:07 | astronavt | fair enough. in fact i was surprised to see such a big std lib, considering that eventually all of this stuff will probably go out of fashion and out of date too |
16:41:14 | FromDiscord | <Inam> ~~Sure seems like a lot of batteries to me~~ |
16:41:29 | Zevv | getting there: http://zevv.nl/div/2020-10-11.18-38-43.mp4 |
16:41:33 | FromDiscord | <dom96> But yes, if a package manager existed before then the stdlib would have been much smaller |
16:41:39 | astronavt | ah, interesting |
16:41:49 | FromDiscord | <Inam> That makes sense I guess |
16:41:52 | astronavt | maybe in 2.0 or something all that stuff will be spun off into standalone packages or something? |
16:41:53 | sealmove | leorize: you don't remember name? can't find disruptek's msg |
16:42:02 | astronavt | there are some people in the python world who think python should aggressively downsize its stdlib and find 3rd party maintainers for all that junk |
16:42:14 | leorize[m]1 | it's literally called NestedText sealmove |
16:42:32 | sealmove | ah lol |
16:43:57 | * | lritter quit (Quit: Leaving) |
16:44:16 | leorize[m]1 | astronavt: a potential future for Nim is that the "stdlib" will be a collection of packages |
16:44:34 | leorize[m]1 | we are nowhere near that yet though |
16:45:04 | leorize[m]1 | Zevv: oooh is that an audio editor thingy? |
16:45:15 | leorize[m]1 | @lqdev is probably gonna be interested |
16:45:15 | astronavt | leorize[m]1, that sounds like a desirable future |
16:45:23 | * | luis quit (Read error: Connection reset by peer) |
16:45:23 | Zevv | no, mass scale event viewer |
16:45:32 | * | luis joined #nim |
16:45:38 | astronavt | i suppose now im looking for things to do with nim, now that the thing i was _going_ to build in nim turned out to already exist and in better form than what i was going to make |
16:46:35 | leorize[m]1 | Zevv: I don't understand what that is, but it looks cool and smooth :P |
16:46:37 | astronavt | i wrote a script in Go that prints colors to the console and i was going to port it to Nim, but im curious now if there's a way to emit 256 color to stdout now (assuming the terminal supports it) |
16:47:34 | FromDiscord | <exelotl> I really wanna make a mod tracker in nim someday (ideally one that can run on 3DS) |
16:47:37 | Zevv | leorize[m]1: It's to graph time based "stuff", where "stuff" can be all kinds of things. I use it to see what my software is actually doing, and measure things. |
16:48:15 | Zevv | like this one is some app I'm working on: http://zevv.nl/div/shot.png |
16:48:36 | FromDiscord | <exelotl> I tried hacking on the MilkyTracker source but it's just awful, horribly messy archaic C++ codebase |
16:48:47 | FromDiscord | <Avatarfighter> does anyone know who FedericoCeratto is in the irc |
16:48:51 | Zevv | I have problems getting insight in the dynamic behaviour, so I add some logging at trivial points, which you can explore and graph |
16:48:53 | FromDiscord | <Avatarfighter> the name keeps slipping from me |
16:49:02 | leorize[m]1 | @Avatarfighter federico3 |
16:49:10 | FromDiscord | <Avatarfighter> thanks leorize |
16:49:30 | FromDiscord | <Avatarfighter> federico3: I have questions about your tor-nim library >:) |
16:49:47 | leorize[m]1 | Zevv: sounds useful, is it foss? |
16:51:08 | federico3 | leorize[m]1: huh? |
16:51:33 | leorize[m]1 | federico3: @Avatarfighter wanna ask you something |
16:51:55 | FromDiscord | <Avatarfighter> federico3: yeah I was wondering how the `create_ephemeral_onion_service` bit of your tor-nim library worked |
16:52:07 | federico3 | I had to un-ignore FromDiscord |
16:52:13 | FromDiscord | <Avatarfighter> 😢 |
16:52:36 | FromDiscord | <Avatarfighter> federico3: I was wondering how the create_ephemeral_onion_service bit of your tor-nim library worked or if you had an example of a service running behind it |
16:52:38 | federico3 | it should work - it's in the demo |
16:52:53 | FromDiscord | <Avatarfighter> Do you have an example/demo of a service running behind it? |
16:53:13 | federico3 | https://github.com/FedericoCeratto/nim-tor/blob/master/tests/tor_demo.nim#L40 |
16:53:15 | federico3 | let me try |
16:54:29 | FromDiscord | <Avatarfighter> I was wondering if I could shove something like jester behind it and make a drug empire(kidding of course) but I'm curious to know what a live app would look like with your library |
16:58:33 | astronavt | another stupid noob question: is there a way to get an enumerated value by _name_ at runtime, e.g. turn "PeachPuff" into Color.colPeachPuff? or do i just have to write out a big table? |
17:00:02 | FromDiscord | <Rika> import strutils; parseEnum[EnumType](theString) == theEnumValue |
17:00:54 | astronavt | thank you |
17:05:20 | FromDiscord | <lqdev> astronavt: colors has parseColor btw https://nim-lang.org/docs/colors.html#parseColor%2Cstring |
17:05:25 | * | idf-phoneposter quit (Read error: Connection reset by peer) |
17:05:33 | FromDiscord | <lqdev> which also handles hex codes |
17:06:18 | astronavt | even better |
17:11:51 | FromDiscord | <shashlick> @disruptek gittyup passes tests on all but Linux |
17:11:54 | FromDiscord | <shashlick> https://travis-ci.org/github/genotrance/travister/builds/733774729 |
17:12:20 | * | Vladar joined #nim |
17:12:35 | FromDiscord | <shashlick> I'm running nimble test - https://github.com/genotrance/travister/blob/master/test.sh#L81 |
17:13:41 | Zevv | leorize[m]1: it's CC for now. I'm making it in my free time but using it for a customer, I don't want them to buy it from me |
17:16:20 | * | astronavt quit (Read error: Connection reset by peer) |
17:16:48 | * | astronavt joined #nim |
17:16:52 | * | astronavt quit (Remote host closed the connection) |
17:19:36 | federico3 | Avatarfighter: added a new demo |
17:28:01 | FromDiscord | <Avatarfighter> federico3: thanks 😄 |
17:35:05 | Zevv | What is the state of slices these days, does that understand string slices as well? |
17:35:15 | * | abm joined #nim |
17:37:47 | * | arecacea1 quit (Remote host closed the connection) |
17:38:25 | * | arecacea1 joined #nim |
17:46:57 | * | luis quit (Quit: luis) |
17:46:57 | * | astronavt joined #nim |
17:52:24 | federico3 | Avatarfighter: any interesting tool that you want to share? |
17:58:41 | FromDiscord | <Avatarfighter> federico3: What do you mean? Like what I'm working on? |
17:59:14 | * | hnOsmium0001 joined #nim |
17:59:51 | FromDiscord | <Avatarfighter> I've been working on a p2p messenger for a while and I wanted to allow anonymity because before I just had peer connect to each other directly |
17:59:52 | federico3 | yes, or anything else around Nim and Tor |
18:00:03 | federico3 | like Briar? |
18:00:19 | FromDiscord | <Avatarfighter> yeah somewhat like that |
18:00:43 | FromDiscord | <Avatarfighter> The original p2p e2ee version is just reliable udp connections between members of a swarm |
18:00:57 | FromDiscord | <Avatarfighter> ^ for what I'm working on |
18:01:21 | FromDiscord | <Avatarfighter> I am working on a way to stop rogue clients from joining a swarm atm ahah |
18:01:55 | FromDiscord | <Avatarfighter> Since you made the nim-tor library I am just working on moving my messenger to work better with tcp based connections |
18:01:59 | federico3 | something that can integrate with xmmp/IRC/activitypub/matrix would be very welcome |
18:02:31 | FromDiscord | <Avatarfighter> I don't see why you couldn't just plug your own protocol into my program tbh |
18:02:52 | FromDiscord | <Avatarfighter> Im building it so you can easily swap what type of data is being sent |
18:04:26 | * | Cthalupa quit (Ping timeout: 265 seconds) |
18:04:50 | FromDiscord | <Avatarfighter> I'm no cryptographer though so I try and keep what I'm doing with crypto relatively simple so I don't accidentally break the crypto |
18:05:11 | * | Cthalupa joined #nim |
18:06:32 | leorize[m]1 | if you're not good with crypto, just use others premade crypto and remember to make your program not dumpable |
18:07:08 | FromDiscord | <Rika> how do you make a program not dumpable? |
18:07:11 | federico3 | libsodium is your friend |
18:07:46 | federico3 | https://doc.libsodium.org/memory_management |
18:08:05 | federico3 | (FWIW) |
18:08:40 | FromDiscord | <Avatarfighter> leorize: I am using actual crypto not homemade 😮 |
18:09:55 | leorize[m]1 | federico3: allocators support in nim would be nice for that, unfortunately we don't have that yet :( |
18:10:37 | leorize[m]1 | it's not hard to make a `SecureString` out of it though :P |
18:12:11 | blackbeard420 | is there a way to 'await' a flowvar? |
18:15:42 | Yardanico | ^ |
18:15:45 | Yardanico | ^ operator |
18:15:55 | Yardanico | https://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D |
18:16:31 | Yardanico | blackbeard420: ^ |
18:16:55 | FromDiscord | <Avatarfighter> "^" |
18:16:59 | FromDiscord | <haxscramper> @shashlick nimtreesitter internally uses `nimgen` to wrap code generated by tree-sitter, correct? |
18:17:18 | FromDiscord | <kodkuce> is there a websocket lib that is not async, i am again starting to get those file descriptors bug and i dont want to fight that anymore |
18:18:39 | Yardanico | you'll have much more problems with sync websockets :) |
18:18:56 | Yardanico | since it'll require you to do threading, locks, etc |
18:20:00 | FromDiscord | <lqdev> i just cross-compiled my program to windows |
18:20:02 | * | luis joined #nim |
18:20:06 | FromDiscord | <lqdev> and i'm trying to run it with wine |
18:20:11 | Yardanico | soo? |
18:20:17 | FromDiscord | <lqdev> but i'm getting a strange error |
18:20:20 | FromDiscord | <lqdev> ```↵002b:err:module:import_dll Library libwinpthread-1.dll (which is needed by L"Z:\\home\\daknus\\Coding\\Nim\\rapid\\tests\\tchipmunk.exe") not found↵002b:err:module:LdrInitializeThunk Importing dlls for L"Z:\\home\\daknus\\Coding\\Nim\\rapid\\tests\\tchipmunk.exe" failed, status c0000135↵``` |
18:20:25 | Yardanico | you need that dll |
18:20:30 | FromDiscord | <lqdev> why is it looking for winpthreads when --threads:off? |
18:20:37 | Yardanico | ask mingw |
18:20:49 | Yardanico | maybe one of the libs you're using wants threads? |
18:20:58 | Yardanico | anyway you should have that dll in your system |
18:20:59 | FromDiscord | <lqdev> doubt it |
18:21:02 | Yardanico | linux system |
18:21:25 | Yardanico | search for libwinpthread-1.dll in /usr |
18:21:29 | FromDiscord | <lqdev> hm might be glfw |
18:21:34 | Yardanico | I have it in /usr/x86_64-w64-mingw32/bin/libwinpthread-1.dll and /usr/i686-w64-mingw32/bin/libwinpthread-1.dll |
18:32:52 | nature | Is there any lib to manipulate html documents ? I found a few to query it like nimquery and q.nim, but they don't seem to provide any way to manipulate it |
18:35:44 | * | arecacea1 quit (Read error: Connection reset by peer) |
18:36:20 | * | arecacea1 joined #nim |
18:36:21 | * | sealmove quit (Quit: WeeChat 2.9) |
18:43:47 | FromDiscord | <Avatarfighter> using xmltree + htmlparser should let you parse and modify html |
18:43:55 | FromDiscord | <Avatarfighter> https://nim-lang.org/docs/htmlparser.html |
18:46:58 | nature | Yes perfect, thank you |
18:47:03 | * | luis quit (Ping timeout: 272 seconds) |
18:48:18 | * | luis joined #nim |
18:48:25 | * | Cthalupa quit (Ping timeout: 240 seconds) |
18:49:44 | * | Cthalupa joined #nim |
18:51:36 | FromDiscord | <Avatarfighter> do note you can't go from child -> parent node without keeping track of the parent node yourself |
18:51:42 | FromDiscord | <Avatarfighter> but parent -> child is fine |
18:52:17 | FromDiscord | <lqdev> Yardanico: do you know of any way to link it statically? |
18:52:24 | FromDiscord | <lqdev> --passC:-static doesn't seem to help |
18:52:45 | FromDiscord | <shashlick> @haxscramper ya and nimgen calls c2nim |
18:52:53 | Yardanico | not really sure |
18:53:06 | FromDiscord | <lqdev> maybe i need to add the passC before i import glfw |
18:53:10 | FromDiscord | <lqdev> lemme track down which lib does this |
18:53:27 | astronavt | is it a bad idea to use `options` to try and replicate the python idiom of writing functions like `foo(x, val1=None, val2=None)`, where val1 for example could be a float or None? |
18:53:44 | FromDiscord | <shashlick> I need to change it up to use nimterop since it is a C api anyway |
18:53:56 | Yardanico | astronavt: well not really |
18:54:01 | Yardanico | it's okay |
18:54:08 | Yardanico | if you can't do it other way |
18:54:15 | astronavt | i just don't know other ways, i'm quite new to nim |
18:54:22 | Yardanico | well, trying to redesign your API :P |
18:54:54 | FromDiscord | <lqdev> hmm, librt.so.1 |
18:54:57 | FromDiscord | <lqdev> i wonder what it's for |
18:54:59 | FromDiscord | <kodkuce> @Yardanico i can learn threading locks, but cant fix this file descriptior bug |
18:55:12 | Yardanico | have you tried simplifying the failing example? |
18:55:21 | FromDiscord | <lqdev> librt, libposix4 - POSIX.1b Realtime Extensions library |
18:55:23 | Yardanico | first removing the dependency from ws module step by step |
18:55:36 | Yardanico | just make the simplest possible example reproducing the issue |
18:58:26 | * | abm quit (Read error: Connection reset by peer) |
18:59:29 | FromDiscord | <lqdev> the glfw wrapper seems to link to pthreads for some reason |
18:59:33 | FromDiscord | <lqdev> i don't really get why |
18:59:49 | FromDiscord | <lqdev> i'mma try cloning it and experimenting a bit |
19:00:05 | leorize[m]1 | astronavt: it really depends on what exactly you're trying to do |
19:00:15 | leorize[m]1 | @lqdev I guess glfw is thread-safe? |
19:00:22 | FromDiscord | <lqdev> i think so |
19:00:27 | FromDiscord | <lqdev> i don't see *why* it would need pthreads |
19:00:31 | leorize[m]1 | then it makes sense that it'd link to pthread, since it gotta use those locks |
19:00:56 | FromDiscord | <lqdev> guess i just gotta link pthread statically |
19:01:06 | FromDiscord | <lqdev> using a compiler flag |
19:01:19 | leorize[m]1 | what are you trying to do? |
19:01:33 | leorize[m]1 | and no, never link pthread statically without linking the whole C library |
19:02:41 | astronavt | Yardanico, @leorize[m]1: maybe i could get some api redesigning advice then :) what i want is a function that takes a string and the following optional parameters: a foreground color, a background color, and a set of text styles. then *if* a foreground color has been provided, change the foreground color, *if* a background color has been provided, change the background color, etc. |
19:03:03 | Yardanico | why do you use float for background/foreground? |
19:03:08 | astronavt | oh, not float in this case |
19:03:16 | FromDiscord | <lqdev> leorize: i'm having a bit of a windows problem here. |
19:03:19 | leorize[m]1 | have you looked at styledWrite? :) |
19:03:21 | astronavt | i'd like the fg and bg parameters to be Color enum items, but there is no "null" or "use current/default" color |
19:03:21 | Yardanico | astronavt: which data type then? |
19:03:29 | Yardanico | oh |
19:03:44 | FromDiscord | <lqdev> glfw needs pthread and on mingw that links to libwinpthread-1.dll |
19:03:49 | * | TomDotTom joined #nim |
19:03:54 | FromDiscord | <lqdev> but i want to have a dll-free executable |
19:04:03 | astronavt | yeah i saw it :) that's just too "loose" for my taste, i'd like an API with a bit more structure that i will reuse in several different places in my little toy app |
19:04:04 | leorize[m]1 | @lqdev dll-free and mingw don't mix |
19:04:10 | astronavt | (it == styledWrite) |
19:04:22 | leorize[m]1 | if you want dll-free, msvc is the best bet |
19:04:23 | FromDiscord | <lqdev> leorize: why? |
19:04:24 | FromDiscord | <lqdev> licensing? |
19:04:32 | FromDiscord | <lqdev> msvc needs a lot of bloat |
19:04:36 | FromDiscord | <lqdev> and isn't available on linux |
19:04:46 | leorize[m]1 | the bloat is in windows itself |
19:04:52 | leorize[m]1 | it's just the case of what's bundled by default |
19:04:58 | FromDiscord | <lqdev> yeah, visual studio comes preinstalled on windows. |
19:05:13 | Yardanico | @lqdev he means that msvc uses dlls preinstalled on windows |
19:05:49 | leorize[m]1 | though I think your problem here is that the build of glfw you're using uses pthread instead of Windows' native threading facility |
19:06:11 | leorize[m]1 | (I don't even know if glfw supports native windows threading) |
19:06:27 | FromDiscord | <lqdev> but oh hold on, why is it linking to pthread on windows anyways |
19:06:36 | FromDiscord | <lqdev> it does have it in the flags for linux |
19:06:39 | FromDiscord | <lqdev> but not for windows |
19:06:45 | FromDiscord | <lqdev> is there a mingw ldd? |
19:07:35 | leorize[m]1 | there are some explorer tools for windows I think |
19:07:58 | leorize[m]1 | what version of glfw are you using? |
19:08:05 | leorize[m]1 | I mean what build? |
19:08:32 | FromDiscord | <lqdev> build? |
19:08:33 | leorize[m]1 | because glfw does have native windows threading support: https://github.com/glfw/glfw/blob/0be4f3f75aebd9d24583ee86590a38e741db0904/deps/tinycthread.h |
19:08:45 | FromDiscord | <lqdev> i'm using https://github.com/nimgl/glfw which compiles glfw manually |
19:10:13 | * | luis quit (Remote host closed the connection) |
19:10:25 | * | Sembei joined #nim |
19:10:55 | leorize[m]1 | @lqdev http://dependencywalker.com/ |
19:13:43 | astronavt | @leorize[m]1, Yardanico - https://play.nim-lang.org/#ix=2ApV here's my naive translation from python, which obviously fails (by design, because "nil" is not equivalent to python's "None"). what i am wondering is, how to design a Nim-friendly API with similar semantics? |
19:14:21 | Yardanico | well you can (ab)use the fact that Color is "distinct int" |
19:14:29 | Yardanico | so you can for example have Color(-1) as the default value |
19:14:30 | astronavt | even better would be to create some kind of StyledText type with fgColor, bgColor, and styles attributes, which obey the same "maybe there is something here but maybe there isn't" semantics |
19:14:34 | Yardanico | and check for that in the proc |
19:15:45 | Yardanico | but you can also use options |
19:16:10 | Yardanico | also yeah, why didn't you like writeStyled ? |
19:16:34 | Yardanico | styledWrite * |
19:17:05 | astronavt | well again i'd like to iterate over a list of StyledText objects and print them |
19:17:17 | astronavt | so i'd like some way to carry around this "absence of color" |
19:17:33 | astronavt | Color(-1) resolves to #FFFFFF so that could conflict with user input |
19:17:43 | astronavt | not sure if there's some other sentinel value that might work here |
19:18:09 | FromDiscord | <InventorMatt> instead of having none as a default option for an input you could create two proc with different input signatures instead |
19:18:17 | Yardanico | well he has two optional arguments |
19:19:07 | astronavt | how un-idiomatic is it to have the user none(Color) when they want to keep the default color? |
19:19:12 | astronavt | *have the user write |
19:19:34 | leorize[m]1 | astronavt: well Option[T] defaulted to none(T) should be fine I suppose? |
19:20:47 | leorize[m]1 | I personally like styledWrite API though |
19:21:49 | FromDiscord | <lqdev> hmm https://media.discordapp.net/attachments/371759389889003532/764930773378662432/unknown.png |
19:21:54 | FromDiscord | <lqdev> doesn't seem like anything depends on it? |
19:22:00 | FromDiscord | <lqdev> it's just there |
19:22:29 | leorize[m]1 | the program itself requested it then |
19:22:42 | FromDiscord | <lqdev> i wonder where |
19:23:50 | astronavt | this is just clunky to me i guess: styledEcho(ansiForegroundColorCode(parseColor("peachpuff")), "Hello!") |
19:24:53 | nature | How would I do if I have a proc supposed to be returning an object and I want to return "null" ? |
19:25:18 | leorize[m]1 | nature: return an Option[T] |
19:25:33 | nature | Perfect thanks :) |
19:25:47 | leorize[m]1 | astronavt: You can implement a simple processor on top of styledEcho |
19:25:50 | nature | by the way leorize[m]1 regarding my question the other day |
19:26:41 | nature | About silencing errors reported by my editor (I am using nimlsp) |
19:26:58 | nature | is there any way to do that ? |
19:27:31 | astronavt | leorize[m]1, or maybe i just alias `fg = ansiForegroundColorCode` or something |
19:28:14 | leorize[m]1 | nature: it depends on your lsp client |
19:29:59 | nature | Oh so it's client dependant.. I checked the doc from mine and there was nothing about silencing errors (I am using nvim-diagnostics) |
19:30:33 | leorize[m]1 | I can imagine that most of them don't implement something like that |
19:31:01 | leorize[m]1 | if you have an error that only appears when you do `nim check` and/or only `nimsuggest` reports it, then it sounds like a bug |
19:32:04 | leorize[m]1 | astronavt: you do know that styledEcho can take Color, right? |
19:33:02 | * | luis joined #nim |
19:35:28 | leorize[m]1 | !eval import terminal, color; styledEcho parseColor("peachpuff"), "Hello!" |
19:35:30 | NimBot | Compile failed: /usercode/in.nim(1, 18) Error: cannot open file: color |
19:35:42 | leorize[m]1 | !eval import terminal, colors; styledEcho parseColor("peachpuff"), "Hello!" |
19:35:46 | NimBot | Hello! |
19:38:12 | * | abm joined #nim |
19:42:54 | FromDiscord | <Rebel> Are there any nim WinRM clients? Something like pywinrm. |
19:47:35 | FromDiscord | <mikebelanger> hey guys, any jester users here? I'm using https://github.com/pragmagic/vscode-nim, and for some reason - I can't get "Goto Definition" to work inside jester's routes block. ↵ maybe I'm doing something wrong? using latest VSCode, latest nim devel, on OSX, if that matters |
19:51:44 | leorize[m]1 | you're not doing anything wrong |
19:53:13 | leorize[m]1 | it's a bug in nimsuggest and/or jester |
19:54:43 | leorize[m]1 | the way jester copies the AST to construct a new tree somehow caused nimsuggest to not be aware of the additional AST nodes and map the corresponding line information to them |
19:55:13 | disruptek | when you newNimNode you can supply a node to copy the lineinfo from. |
19:55:17 | disruptek | else, you can set the line info. |
19:55:22 | disruptek | else, you have no info. |
19:56:02 | * | luis quit (Quit: luis) |
19:56:09 | * | luis joined #nim |
19:57:58 | FromDiscord | <mikebelanger> @leorize hmm ok, so I guess it's a matter of narrowing it down between jester and nimsuggest |
20:00:11 | * | TomDotTom quit (Ping timeout: 240 seconds) |
20:00:34 | FromDiscord | <UNIcodeX> > @leorize hmm ok, so I guess it's a matter of narrowing it down between jester and nimsuggest↵@mikebelanger I ended up switching to Prologue. Not just for nimsuggest and getting go-to-definition working. It seems to be more actively maintained. Has context management built in, and more. |
20:01:57 | leorize[m]1 | my walkaround is to just put everything in a template then put the said template in jester's routes :P |
20:02:18 | FromDiscord | <Avatarfighter> Prologue is the fastapi of nim imo |
20:02:20 | * | natrys joined #nim |
20:03:54 | FromDiscord | <mikebelanger> > else, you have no info.↵> @disruptek[IRC]#0000 <- is this in reference to debugging the routes macro? |
20:04:18 | FromDiscord | <mikebelanger> @UNIcodeX @Avatarfighter oh interesting - I haven't heard of that framework. thanks I'll check it out |
20:04:49 | FromDiscord | <mikebelanger> @leorize lol ah yeah that's one way of doing it |
20:05:38 | FromDiscord | <mikebelanger> I don't have anything against jester though - still a really user friendly framework. But having goto definition is so handy when you're exploring |
20:06:47 | disruptek | mikebelanger: it's in reference to debugging jester to fix gotodef in routes. |
20:07:58 | * | narimiran quit (Ping timeout: 258 seconds) |
20:08:26 | Zevv | disruptek: will you just look at this very cool stuff: http://zevv.nl/div/maui.png |
20:08:31 | Zevv | and when will we do cps again |
20:09:24 | Yardanico | Zevv: nicee |
20:09:30 | Yardanico | looks very kool |
20:09:43 | Zevv | I made colors, otherwise I can't impress disruptek |
20:09:45 | FromDiscord | <Avatarfighter> Zevv: that looks so cool |
20:09:53 | disruptek | Zevv: needs more emoji. |
20:10:02 | idf | nice stuff |
20:10:07 | disruptek | looks really slick. |
20:10:31 | disruptek | i've wanted to build something like apple's instruments. |
20:10:35 | FromDiscord | <Avatarfighter> Yardanico: voice your support for what vindaar put in the moderator only chat in discord please |
20:10:49 | FromDiscord | <Avatarfighter> i'll donate so you can buy a coffee |
20:10:51 | Yardanico | i think I know what it's about without looking |
20:10:56 | FromDiscord | <Avatarfighter> LOL |
20:10:59 | disruptek | cps... need to kick clyybber until he fixes the compiler. |
20:11:03 | idf | making me admin that is |
20:11:31 | disruptek | we are waiting for a couple patches that aren't going into 1.4 afaik and then there is one (maybe two) other issue(s). i think it may be one issue and two manifestations. |
20:11:31 | Yardanico | @Avatar well I'm not the server owner and just a usual nim guy so we need to wait for dom's vote :) |
20:11:45 | FromDiscord | <Avatarfighter> yes but you have the cool blue role |
20:12:00 | FromDiscord | <Avatarfighter> I'm about to make a change.org petition for the webdev channel 😠 |
20:12:30 | disruptek | and i am nominally focused on ic, though i have to come up with a solution for frosty recursion before i can use it in the compiler. that solution was supposed to be cps. |
20:12:37 | idf | i want to make a memory debugger in nim, kinda like scanmem or cheatengine |
20:15:23 | nature | Why does `loadHtml` from htmlparser lib does always add a root `<document>` tag ? |
20:15:30 | FromDiscord | <mikebelanger> @disruptek so I'd add this lineinfo in jester's source, in the routes def? sorry bear with me, I'm a macro newb 😛 |
20:15:47 | disruptek | yeah, that would likely solve your problem. |
20:16:02 | disruptek | but it might be tricky to find all the locations that need, uh, location info. |
20:16:59 | * | luis quit (Ping timeout: 272 seconds) |
20:17:35 | FromDiscord | <mikebelanger> like finding the line numbers of wherever the definitions are? |
20:17:53 | disruptek | no, the compiler does that for you. |
20:18:07 | disruptek | but when you create ast, if you don't provide the source line info, then it's lost. |
20:18:23 | disruptek | see the NimNode argument to newNimNode. |
20:18:49 | disruptek | there's also a setLineInfo and setLineInfoObj or something similar. i forget the names. |
20:19:02 | disruptek | they let you paint a node with existing line info. |
20:21:56 | FromDiscord | <dom96> people CC'ing Nim's twitter on a twitter thread between Carmack and Elon Musk. Guess that's where the new people are from? 🙂 |
20:22:23 | Yardanico | can you give a link? |
20:22:59 | FromDiscord | <dom96> just check nim_lang replies, I replied to one |
20:24:10 | FromDiscord | <shashlick> @lqdev how did you install mingw on windows |
20:24:29 | Yardanico | also yeah, people mistake nim's ARC for Swift's ARC but they're different in a very major way: |
20:24:36 | Yardanico | swift has atomic reference counting |
20:25:01 | nature | Is anybody familiar with the htmlparser lib ? |
20:25:33 | FromDiscord | <Avatarfighter> yeah i am somewhat nature |
20:26:29 | FromDiscord | <mikebelanger> @disruptek ok thanks I'll look at NimNode, and those others |
20:26:40 | nature | Do you know what I am doing wrong, when I use `loadHtml` or `parseHtml` I aways end up with a <document> tag as the root instead of the expected <html> |
20:26:57 | FromDiscord | <dom96> Yardanico: so in Nim's case it stands for Automatic Reference Counting? |
20:27:06 | Yardanico | it stands for that in both cases I think |
20:27:09 | FromDiscord | <mikebelanger> @disruptek I'll just move this to <#764946138109050893> as its jester related |
20:27:31 | disruptek | i dunno what that means but it sounds like i'm off the hook. 👍 |
20:27:40 | FromDiscord | <Elegant Beef> Was going to say, i could've sworn i've seen it referred to as atomic reference counting 😛 |
20:27:41 | FromDiscord | <dom96> oh yeah, it does |
20:27:42 | Yardanico | but swift actually uses atomic rc |
20:28:00 | FromDiscord | <Avatarfighter> I thought arc was 4raqs reference counting |
20:28:10 | FromDiscord | <dom96> what does that mean in practice though? |
20:28:14 | FromDiscord | <Avatarfighter> yes |
20:28:16 | FromDiscord | <Elegant Beef> Three |
20:28:19 | disruptek | nothing. it's scope-based mm. |
20:29:16 | disruptek | we don't need atomics for rc because the rc doesn't need to be threadsafe when you can move the whole graph between threads. |
20:30:53 | Yardanico | ~~restarting the bridge with new bridged channels~~ |
20:30:56 | * | FromDiscord quit (Remote host closed the connection) |
20:31:03 | supakeen | byte bridge |
20:31:05 | supakeen | bye |
20:31:13 | * | FromDiscord joined #nim |
20:31:27 | FromDiscord | <Yardanico> restarting done |
20:31:30 | FromDiscord | <dom96> i like how Discord strikes that through |
20:32:01 | FromDiscord | <Yardanico> because I did ~~ |
20:32:11 | FromDiscord | <Yardanico> 123 |
20:32:13 | supakeen | all the cool kids are on irc |
20:32:14 | FromDiscord | <Yardanico> weird |
20:32:15 | * | nixfreak joined #nim |
20:33:14 | FromDiscord | <dom96> speaking of ARC though, I hope that we will see more articles/docs about it |
20:33:28 | FromDiscord | <dom96> It would have been nice if I could share a link to something like that |
20:33:29 | Yardanico | well strictly speaking for most people orc will work just fine by default :P |
20:33:37 | nature | @Avatarfighter any idea ? |
20:33:45 | Yardanico | the biggest thing for *most* people would be the change of finalizers -> destructors |
20:33:54 | Yardanico | ofc finalizers work with arc/orc, but writing destructors explicitly is better |
20:34:11 | FromDiscord | <dom96> strictly speaking, getting people to get excited about something requires some marketing material |
20:34:20 | Yardanico | we have "update on arc" thread on the forum |
20:34:23 | Yardanico | can take the info from there |
20:34:35 | FromDiscord | <Avatarfighter> nature: I'm thinking rn lol |
20:34:41 | Yardanico | https://forum.nim-lang.org/t/6549 I mean |
20:35:43 | Yardanico | the only "Missing features" from there is shallowCopy which wouldn't really be fixed I think |
20:35:48 | Yardanico | well it works, but works differently than with refc |
20:36:20 | nature | @Avatarfighter okok thanks yeah, have you even noticed that behaviour before ? |
20:36:22 | FromDiscord | <dom96> > https://forum.nim-lang.org/t/6549 I mean↵@Yardanico yeah, not really a great marketing post IMO |
20:36:30 | Yardanico | well I didn't say that this is a marketing post |
20:36:36 | Yardanico | I meant to use this as a source and inspiration |
20:36:47 | Yardanico | "can take the info from there" |
20:37:05 | Yardanico | but yeah, 1.4 blog post must 100% have a dedicated section related to ARC/ORC |
20:37:10 | * | luis joined #nim |
20:37:51 | FromDiscord | <Avatarfighter> nature: I am looking at my code to see if i have that |
20:37:54 | FromDiscord | <Avatarfighter> that sounds like a bug tho |
20:39:27 | * | FromDiscord quit (Remote host closed the connection) |
20:39:36 | * | TomDotTom joined #nim |
20:39:40 | * | FromDiscord joined #nim |
20:40:57 | nature | @Avatarfighter https://github.com/nim-lang/Nim/blob/dc1c251a2c2779f3f12d7bf2255f01355bbb886d/lib/pure/htmlparser.nim#L2024 |
20:41:24 | FromDiscord | <Avatarfighter> dark mode 👌 https://media.discordapp.net/attachments/371759389889003532/764950802720227379/unknown.png |
20:42:31 | nature | 🔥🔥🔥 |
20:42:38 | FromDiscord | <Innokentiy Sokolov> that dark pallet is killing |
20:42:40 | FromDiscord | <Innokentiy Sokolov> my eyes |
20:42:55 | FromDiscord | <Yardanico> @Avatarfighter very outdated image |
20:42:56 | FromDiscord | <Yardanico> it was FIXED |
20:42:57 | FromDiscord | <Yardanico> already |
20:42:59 | FromDiscord | <Avatarfighter> no |
20:43:01 | FromDiscord | <Yardanico> at least 4 other people asked |
20:43:01 | FromDiscord | <Avatarfighter> that is from today |
20:43:02 | FromDiscord | <Yardanico> yes it was |
20:43:04 | FromDiscord | <Avatarfighter> no |
20:43:09 | FromDiscord | <Yardanico> it's fixed in devel |
20:43:12 | FromDiscord | <Avatarfighter> i took that image seconds ago |
20:43:12 | FromDiscord | <Yardanico> not in 1.2.6 |
20:43:18 | FromDiscord | <Yardanico> it's been fixed in devel for months |
20:43:24 | FromDiscord | <Yardanico> 🙂 |
20:43:27 | FromDiscord | <Avatarfighter> 😐 |
20:43:35 | FromDiscord | <Avatarfighter> make prod website devel smh |
20:43:40 | FromDiscord | <Yardanico> no |
20:43:59 | FromDiscord | <Yardanico> use http://nim-lang.github.io/Nim/lib.html if you want devel docs |
20:44:40 | FromDiscord | <Innokentiy Sokolov> light mode is on by default. Thanks! |
20:45:43 | FromDiscord | <Yardanico> it's just that most people are fine with light theme |
20:46:00 | FromDiscord | <Innokentiy Sokolov> > it's just that most people are fine with light theme↵@Yardanico naturally 🙂 |
20:46:03 | FromDiscord | <Yardanico> also I think nim docs remember the switch position (at least in devel) |
20:46:06 | * | opal quit (Remote host closed the connection) |
20:46:18 | FromDiscord | <Yardanico> @Innokentiy Sokolov well I prefer dark themes 🙂 |
20:46:35 | FromDiscord | <Innokentiy Sokolov> > @Innokentiy Sokolov well I prefer dark themes 🙂↵@Yardanico I bet you are in minority 🙂 |
20:46:46 | FromDiscord | <Yardanico> I'm not doubting that about the dark themes |
20:46:59 | FromDiscord | <Innokentiy Sokolov> I mean I prefer dark VS Code but docs - nah |
20:47:13 | * | opal joined #nim |
20:47:32 | idf | i prefer gruvbox dark |
20:47:49 | FromDiscord | <Yardanico> monokai vibrant (vscode theme) |
20:48:00 | FromDiscord | <Yardanico> really like it |
20:48:10 | nature | + for gruvbox |
20:48:59 | FromDiscord | <Innokentiy Sokolov> default dark one is OK too |
20:49:06 | FromDiscord | <Innokentiy Sokolov> ..boring I know but still |
20:49:26 | FromDiscord | <Yardanico> yes boring - exactly that's why I don't really like it 🙂 |
20:50:00 | Prestige | So many Emojis, this chat looks like a bowl of lucky charms |
20:50:12 | Yardanico | blame discord for automatically converting :) to an emoji |
20:50:19 | FromDiscord | <Innokentiy Sokolov> > yes boring - exactly that's why I don't really like it 🙂↵@Yardanico heh when you don't pay attention to colors and focus on code - it's a good theme 🙂 |
20:50:19 | Yardanico | I never insert emojis myself |
20:50:27 | Yardanico | really never |
20:50:28 | FromDiscord | <Innokentiy Sokolov> so boring is OK in this case 😉 |
20:50:33 | Yardanico | I mean not unicode ones |
20:50:44 | Yardanico | :) :P :D D: :O |
20:50:54 | FromDiscord | <Clyybber> you can turn that off |
20:50:57 | FromDiscord | <Clyybber> :) |
20:51:03 | Yardanico | shh |
20:51:06 | FromDiscord | <Innokentiy Sokolov> > you can turn that off↵@Clyybber woot? |
20:51:27 | FromDiscord | <Clyybber> under "text and images" |
20:51:52 | Yardanico | yeah |
20:52:14 | nature | @Avatarfighter I found out that the problems comes from the parsing adds "empty" nodes |
20:52:34 | FromDiscord | <Innokentiy Sokolov> :) |
20:52:43 | FromDiscord | <Innokentiy Sokolov> > under "text and images"↵@Clyybber thanks man! |
20:53:12 | FromDiscord | <Clyybber> np :) |
20:53:17 | nature | So `let html = parseHtml("<html></html>"); html.len == 2` |
20:57:56 | leorize[m]1 | @Clyybber say, I want to add a field to some object in the compiler to store a PSym for nimsuggest usage, where should I put it? |
20:58:18 | FromDiscord | <Clyybber> where do you need it? |
20:58:25 | FromDiscord | <Avatarfighter> i wonder if it adds a document tag for a specific reason nature |
20:58:51 | FromDiscord | <Clyybber> leorize: where do you need it/ |
20:59:36 | leorize[m]1 | https://github.com/nim-lang/Nim/blob/devel/compiler/suggest.nim#L466 |
21:00:21 | nature | @Avatarfighter I think it's since it need to return an XmlNode and not a seq[XmlNode] it needs to ensure a single root node |
21:00:32 | leorize[m]1 | I "might" be able to change that ConfigRef into a PContext |
21:01:04 | leorize[m]1 | so I would effectively have access to all structures |
21:01:10 | leorize[m]1 | which should I put my PSym in? |
21:01:22 | nature | also by the way using xmlparser instead of htmlparser works as expected, so really a bug with htmlparser... |
21:01:30 | nature | At least it seems like it |
21:02:42 | leorize[m]1 | @Clyybber so what I want to do is to cache the forward-declared symbol that I received in an earlier call |
21:03:25 | FromDiscord | <Clyybber> is the purpose to allow jump to implementation? |
21:03:55 | * | abm quit (Read error: Connection reset by peer) |
21:04:16 | leorize[m]1 | yea |
21:04:18 | * | abm joined #nim |
21:05:18 | FromDiscord | <Rebel> Is dynlib available within Nimscript? |
21:06:07 | Yardanico | no, there's no FFI really |
21:07:39 | * | tane quit (Quit: Leaving) |
21:07:47 | * | Vladar quit (Quit: Leaving) |
21:09:15 | FromDiscord | <Rebel> so the best way to do windows api or system calls in Linux within Nimscript would be to ...? |
21:09:31 | FromDiscord | <Clyybber> @leorize Hmm, why not store all definitions in the PSym itself? Like we do with `allUsages` |
21:12:32 | leorize[m]1 | assuming that allUsages works well enough, I can just use that |
21:12:34 | leorize[m]1 | it's slow though |
21:13:29 | leorize[m]1 | the way it's working right now is that findDefinition fish for the symbol being referenced at the position where you use `def` |
21:14:43 | leorize[m]1 | so it's pretty cheap, just a simple check to see if the position referencing the symbol is the same as where the user is requesting a `def` |
21:15:59 | * | luis quit (Read error: Connection reset by peer) |
21:17:02 | leorize[m]1 | allUsage is actually deprecated |
21:20:18 | leorize[m]1 | I think I know where to put this |
21:22:58 | * | gmaggior quit (Ping timeout: 272 seconds) |
21:28:46 | * | vicfred joined #nim |
21:31:06 | FromDiscord | <aooo> Is there a static code analysis code checker for nim? |
21:32:20 | leorize[m]1 | yes, it's the compiler :P |
21:32:34 | leorize[m]1 | if you want something better, we got drnim but it's still in development |
21:32:43 | Yardanico | @aooo "nim check" |
21:33:43 | * | luis joined #nim |
21:33:53 | FromDiscord | <aooo> How much should I rely on the compiler compared to third party programs like cppcheck for C or C++ (even though cppcheck doesn't support nim, I used it as an example) |
21:34:55 | * | gmaggior joined #nim |
21:34:57 | FromDiscord | <Recruit_main707> i dont know if there are any more tools tbh :P |
21:35:02 | Yardanico | @aooo wdym? |
21:35:06 | leorize[m]1 | the compiler can statically check a lot of coding issues, including out-of-bound errors |
21:35:06 | Yardanico | i don't really understand |
21:35:17 | Yardanico | of course it won't give you complex static analysis |
21:35:25 | Yardanico | (it would be possible when drnim gets more or less complete) |
21:35:28 | leorize[m]1 | also Nim doesn't have undefined behavior |
21:35:33 | leorize[m]1 | (I think) |
21:35:39 | Yardanico | i think it does with -d:danger |
21:36:04 | Yardanico | well also of course with unsafe features (cast/ptr/addr/unsafeAddr) |
21:37:15 | FromDiscord | <aooo> So the compiler is good enough checking that I won't have to worry about catastrophic bugs that can damage the operating system? |
21:37:37 | leorize[m]1 | mostly, yes |
21:37:55 | leorize[m]1 | for the bugs the compiler cannot catch, runtime checks will be used which will terminate your program upon error |
21:39:35 | leorize[m]1 | in the future drnim will allow for more complex analysis including proofs that your program functions as designed |
21:39:49 | leorize[m]1 | this future is a bit far so don't hold your breath :P |
21:43:03 | leorize[m]1 | @Clyybber will the compiler create a new symbol after successfully resolving a forward declaration? |
21:43:24 | * | luis quit (Read error: Connection reset by peer) |
21:43:25 | * | natrys quit (Ping timeout: 246 seconds) |
21:43:34 | * | luis joined #nim |
21:50:58 | * | TomDotTom quit (Ping timeout: 260 seconds) |
21:56:32 | * | agent0x00 joined #nim |
21:56:38 | * | natrys joined #nim |
22:14:20 | nature | noob question: sort for tuples is in "algorithm" library |
22:14:29 | nature | ? |
22:14:51 | disruptek | tuple comparison is in system, algorithm offers a sort for arbitrary types. |
22:20:08 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:24:43 | * | natrys quit (Ping timeout: 246 seconds) |
22:32:24 | nature | Is there something like a ternary operator in nim ? like `let x = if true: blah else: bluh` ? |
22:32:45 | disruptek | yes. |
22:33:40 | nature | Thanks :) |
22:33:42 | leorize[m]1 | nature: well you nailed the syntax |
22:34:35 | nature | and if I want to split it in multiple line, I put () around ? |
22:34:51 | disruptek | nah. |
22:35:40 | leorize[m]1 | nature: newline then indent |
22:36:11 | leorize[m]1 | basically similar to writing a function |
22:36:59 | nature | Thanks |
22:41:52 | FromDiscord | <Avatarfighter> I would just like to say that I am very happy that nim has an httpclient library because I would've probably cried if it was based off of curl |
22:42:34 | leorize[m]1 | why? curl is pretty cool |
22:42:58 | FromDiscord | <Avatarfighter> curl is cool |
22:43:16 | FromDiscord | <Avatarfighter> but I had issues with it so i am very happy there is an alternative |
22:50:17 | * | luis quit (Quit: luis) |
22:53:11 | * | shu22 joined #nim |
22:54:26 | * | shu22 quit (Remote host closed the connection) |
23:01:17 | FromDiscord | <anto> what should i be looking into if i want to stop an infinite loop in a child thread after doing something in the main thread? Is there a way to outright kill a thread? |
23:01:29 | FromDiscord | <anto> (edit) 'Is' => 'If not, is' |
23:02:43 | * | gmaggior quit (Quit: Leaving) |
23:05:13 | leorize[m]1 | disruptek: I did it: https://asciinema.org/a/wWPby1ueNwiaqo0bYnYPWNyLj |
23:05:59 | disruptek | you make it look so easy. |
23:06:16 | leorize[m]1 | @anto use a flag in the child thread and have the infinite loop break if the flag was set/unset |
23:06:54 | leorize[m]1 | disruptek: that's the magic of nimsuggest actually working |
23:09:28 | leorize[m]1 | @anto killing a thread is extremely dangerous, since you risk having resources dangling around |
23:10:14 | FromDiscord | <anto> Alright, ill look into flags |
23:14:08 | * | luis joined #nim |
23:25:12 | * | Cthalupa quit (Ping timeout: 272 seconds) |
23:27:36 | * | Cthalupa joined #nim |
23:34:33 | * | luis quit (Quit: luis) |
23:34:56 | FromDiscord | <Avatarfighter> leorize: idk what I'm watching but good job 😄 |
23:45:39 | * | TomDotTom joined #nim |
23:50:37 | * | nature quit (Ping timeout: 264 seconds) |
23:52:36 | FromDiscord | <anto> leorize: do you have any examples of setting and unsetting flags? i cant seem to dig any up |
23:53:14 | leorize[m]1 | @anto it depends on how your thread functions |
23:55:29 | FromDiscord | <anto> it pretty much immediately jumps into the loop |
23:56:42 | leorize[m]1 | then you'll need a sync point then |
23:57:28 | leorize[m]1 | so usually I'd do this by passing a variable over to the thread, then when I need the thread to stop I just change the content |
23:57:37 | leorize[m]1 | no locking needed since strict synchonization isn't required |
23:58:46 | leorize[m]1 | disruptek: oh you said you see a lot of red with the compiler source, right? try this: `touch compiler/nim.nims` |
23:59:40 | leorize[m]1 | I recently updated the project matching algorithm in nim.nvim to be stricter, and the compiler happen to not have any file signifying the entry point |