<< 11-10-2020 >>

00:00:01*junland_ quit (Quit: %ZNC Disconnected%)
00:00:45*junland joined #nim
00:04:25PrestigeAnyone able to run the hcr example here? https://nim-lang.github.io/Nim/hcr.html
00:04:47PrestigeIt compiles, but I am missing libnimhcr.so it seems
00:08:50PrestigeI 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:14voidpiPrestige: didn't compile for me
00:25:30voidpi/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:51Prestigeyeah the Rect is a tuple now instead of an object voidpi
00:29:50voidpiso it's because my nim version?
00:29:57voidpi1.2.6
00:30:08Prestigenah sdl wrapper update
00:30:28Prestigejust do var rect: Rect = (stuff here)
00:30:42Prestigeinstead of var rect = Rect(stuff)
00:30:58FromDiscord<Inam> oh interesting
00:31:32FromDiscord<Inam> how about `rect(stuff)`?
00:31:56*Prestige shrugs
00:32:05Prestigejust need to declare it as a tuple
00:32:12FromDiscord<Inam> idk why I asked I can run it myself :p
00:32:17Prestigehehe
00:32:18voidpi./mymain
00:32:18voidpicould not load: libnimhcr.so
00:32:19voidpicompile with -d:nimDebugDlOpen for more information
00:32:38PrestigeYep that's the issue I'm having
00:32:55*luis joined #nim
00:32:56voidpiwell at least it's reproducible
00:32:59Prestigeat the very bottom it tells you how to compile the .so files
00:33:11Prestigebut I don't know how to use it
00:33:33Prestigemaybe I need to symlink it to the dir with all my system's .so file
00:33:36Prestigefiles*
00:34:41FromDiscord<Inam> where is it right now?
00:34:54Prestigejust in my current working directory
00:35:00FromDiscord<Inam> o
00:35:16*a_chou quit (Ping timeout: 256 seconds)
00:35:58Prestigeit worked`
00:36:00Prestige!
00:36:05FromDiscord<shashlick> On Linux you need to set ld_library_path
00:36:44Prestige@shashlick how, with a nim flag?
00:37:15FromDiscord<Inam> I think it's like your path
00:37:21FromDiscord<Rika> It's an env var
00:37:30FromDiscord<Rika> So you set it in shell
00:37:30FromDiscord<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:31FromDiscord<Inam> ie like `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib64` on bourne-shells
00:37:38FromDiscord<Inam> ye
00:37:44Prestigeoh, cool
00:38:26FromDiscord<shashlick> Alternative is to set rpath at compile time but not sure how hcr is setup
00:38:33FromDiscord<Inam> I think you might also be able to do `LD_LIBRARY_PATH+={spot}` but I'm on fish
00:39:37FromDiscord<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:52astronavtit did end up being a debian problem
00:53:59astronavtfor anyone who saw my question above
00:57:24FromDiscord<dayl1ght> is it possible to import relative to the root directory (i.e. the one with the project's .nimble file)?
01:00:24FromDiscord<shashlick> Use thisDir()
01:00:40FromDiscord<shashlick> If in the nimble file
01:01:40FromDiscord<dayl1ght> I mean in a .nim file
01:01:46*luis joined #nim
01:02:11FromDiscord<dayl1ght> sent a code paste, see https://play.nim-lang.org/#ix=2AlR
01:02:39FromDiscord<dayl1ght> is it possible to have something like `import a/file1.nim` in file2.nim?
01:04:57FromDiscord<dayl1ght> I missed a `src` directory there
01:06:07*vicfred quit (Quit: Leaving)
01:08:17astronavtare 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:50astronavti 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:26FromDiscord<Rebel> getopt?
01:18:00astronavtright, 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:11FromDiscord<demotomohiro> !repo cligen
01:22:11disbothttps://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:44astronavtoooh
01:22:46astronavtthat is very interesting
01:23:11astronavtit 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:46astronavtis 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:18FromDiscord<hobbledehoy> nimpretty maybe?
02:07:02FromDiscord<hobbledehoy> There is also style checking option when compiling iirc
02:09:21astronavti see, thank you
02:09:33*luis quit (Ping timeout: 272 seconds)
02:10:39astronavtwhere is that documented?
02:11:11astronavti only see it referenced here https://nim-lang.org/docs/tools.html and in a blog post
02:16:49FromDiscord<shashlick> @dayl1ght you can use relative paths with ".."/ etc
02:17:08FromDiscord<shashlick> Or you could add --path:..
02:17:24FromDiscord<Winton> I think Nim could be a great language to create emulator server for games
02:17:47FromDiscord<Winton> one of those that are created in lua, java and c #
02:33:35astronavtis 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:20astronavt(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:52FromDiscord<exelotl> Yeah it would be a good forum post
03:10:39FromDiscord<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:47silvernode[m]So today I learned that this exists: https://repl.it/site/multiplayer
04:44:02silvernode[m]It also has Nim support
04:44:30FromDiscord<Elegant Beef> Nice
04:44:42FromDiscord<Elegant Beef> Although Vscode has livesharing
04:44:46silvernode[m]A complete collab IDE with Version control and Github Login support. with a terminal to boot
04:45:10FromDiscord<Elegant Beef> You just described Vscode's live share feature 😛
04:45:57silvernode[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:47silvernode[m]Like Void Linux for example. It's a pain to setup compared to supported distros.
04:47:37FromDiscord<Elegant Beef> Who wants to wrap the js media recorder api? 😄
04:47:52silvernode[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:00FromDiscord<Elegant Beef> Nice
04:48:11silvernode[m]later!
04:48:18FromDiscord<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:55FromDiscord<anto> question, are there docs on outputting ansi color codes to stdout? or am i just unfathomably bad at this?
05:10:01FromDiscord<juan_carlos> terminal module on stdlib.
05:10:58FromDiscord<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:40FromDiscord<anto> nv,
05:11:42FromDiscord<anto> (edit) 'nv,' => 'nvm'
05:11:47FromDiscord<anto> im just unfathomably bad at this
05:12:00FromDiscord<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:36FromDiscord<Yardanico> @anto terminal module supports ansi colour codes including true colour
06:12:39FromDiscord<Yardanico> See https://nim-lang.org/docs/terminal.html#setForegroundColor%2CFile%2CColor
06:12:47FromDiscord<Yardanico> And other procs in the module
06:13:07FromDiscord<anto> i know, ive been referencing those
06:13:18FromDiscord<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:09FromDiscord<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:49lumHello
07:33:52lumtest
07:34:53*lum test
07:35:07*lum slaps Nim around a bit with a large bamboo shark
07:35:17FromDiscord<Elegant Beef> I fall out
07:35:17lumhehe
07:37:23lum#offtopic
07:41:33*lritter joined #nim
07:44:22FromDiscord<Elegant Beef> Any suggestions on how to go around interfacing with https://w3c.github.io/mediacapture-record/#mediarecorder-api?
07:44:24FromDiscord<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:11lum_test
10:32:18lum_he
10:32:20lum_works
10:32:43idfcool
10:32:46*lum_ joined
10:34:02FromDiscord<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:16FromDiscord<PizzaFox> would it make more sense to use an inlined proc instead?
10:35:56*lum_ quit (Quit: leaving)
10:45:00FromDiscord<𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> No particular difference, but using less complicated construct is preferrable (in general)
10:45:31FromDiscord<𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> Or change `untyped` to `int` (or `SomeInteger`) in template types to get better type checking
10:47:06FromDiscord<PizzaFox> i disliked the idea of having such a simple piece of code being untyped
10:47:28FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2Anq
10:47:39*luis quit (Quit: luis)
10:50:38FromDiscord<PizzaFox> now i want to know how to convert a string to a byte array
10:50:53FromDiscord<PizzaFox> (that isnt just iterating over each character by hand)
10:56:43FromDiscord<𝖍𝖆𝖝𝖘𝖈𝖗𝖆𝖒𝖕𝖊𝖗> 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:42FromDiscord<Rika> regular or is also bitwise https://nim-lang.org/docs/system.html#or%2Cint%2Cint
10:59:32*noonien joined #nim
11:01:11FromDiscord<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:03FromDiscord<Rika> use regular `or`, i dont know why `bitor` exists
11:02:08FromDiscord<PizzaFox> lel
11:02:09FromDiscord<Rika> probably a relic of older nim
11:02:21FromDiscord<lqdev> i don't think it's a relic
11:02:33*abm joined #nim
11:02:34FromDiscord<lqdev> rather it's a newer feature
11:02:38FromDiscord<lqdev> for increased readability
11:02:39FromDiscord<PizzaFox> ```nim↵proc bitor*[T: SomeInteger](x, y: T): T {.magic: "BitorI", noSideEffect.}↵```
11:02:41FromDiscord<PizzaFox> What
11:02:44FromDiscord<PizzaFox> the magic
11:02:51FromDiscord<lqdev> `or` means either boolean OR or bitwise OR
11:02:58FromDiscord<lqdev> while `.bitor` always means bitwise OR
11:03:20FromDiscord<Rika> i dont like it
11:03:32FromDiscord<Rika> reminds me of python
11:03:52FromDiscord<PizzaFox> why are there more than 1 way to do this
11:03:56FromDiscord<PizzaFox> i am only slightly joking
11:04:05FromDiscord<PizzaFox> surely such a low level operation should have 1 method
11:06:39FromDiscord<Rika> the bitwise `or`s in system do the same thing as `bitor`
11:06:43FromDiscord<Rika> so choose whichever
11:06:55FromDiscord<Rika> one is "more readable" (to some) and one is "cleaner" (to some)
11:07:08FromDiscord<PizzaFox> oh yeah both use the same magic call
11:07:13FromDiscord<PizzaFox> why do they both exist then lmao
11:08:07FromDiscord<lqdev> as i said, bitor signals intent better
11:08:25FromDiscord<PizzaFox> hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
11:08:50FromDiscord<PizzaFox> there is an alternative 3rd solution guys
11:08:57FromDiscord<PizzaFox> use the builtin rotl proc lo https://nim-lang.org/docs/bitops.html#rotateLeftBits%2Cuint32%2Crange%5B%5D
11:09:04FromDiscord<Clyybber> @PizzaFox your C code could use it in a manner that only untyped would support in nim
11:09:19FromDiscord<Clyybber> so to retain generality c2nim translates it to an template with untyped params
11:10:36FromDiscord<PizzaFox> i dont know enough (or any) C to understand why they went with putting that in the header
11:11:12FromDiscord<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:44FromDiscord<Clyybber> performance probably
11:11:50FromDiscord<Clyybber> not wanting to rely on the compiler to inline it
11:12:01FromDiscord<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:45newUserHi, 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:46newUsergcc 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:30FromGitter<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:03FromDiscord<Rika> Either is okay really; depends on use case
12:07:15FromDiscord<Rika> Both is worked on roughly equally
12:10:37FromGitter<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:51natureleorize[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:48sealmovehey, if you always qualify your enums, then does {.pure.} matter?
12:33:04*luis joined #nim
12:36:43disruptekc is the best target.
12:36:47disrupteksealmove: no.
12:37:05disruptekshashlick: 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:11FromDiscord<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:18FromDiscord<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:11FromDiscord<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:16FromGitter<deech> In Emacs when I copy-paste a proc it messes up the indentation, is there a solution?
14:25:46disrupteklqdev: it's better to use arc and do nothing. else, i would let the lib and nim use their own allocators.
14:29:57FromDiscord<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:48FromDiscord<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:38FromDiscord<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:16disrupteklqdev: do you have a performance problem?
14:54:41*lnxw37d4 joined #nim
14:54:48*unclechu joined #nim
14:57:54FromDiscord<lqdev> disruptek: no, but i'm trying to provide the fastest solution out of the box
14:58:16FromDiscord<lqdev> i mean, syscalls are quite expensive. i'd rather avoid them in a hot game loop
14:59:50disrupteki'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:09FromDiscord<shashlick> @haxscramper you need to link with c++
15:10:21FromDiscord<shashlick> Since it has c++ files
15:10:42FromDiscord<shashlick> See nimterop's toast.nims
15:10:46leorize[m]1@lqdev if you wanna avoid allocation overhead then use a memory pool
15:11:05FromDiscord<lqdev> leorize: not so easy unfortunately
15:11:12FromDiscord<lqdev> why not just use the nim allocator?
15:11:54FromDiscord<shashlick> @disruptek no idea on the cpp failures
15:12:05FromDiscord<shashlick> Wonder why so much is failing in your ci
15:12:21*narimiran joined #nim
15:12:58leorize[m]1@lqdev I'd say that Nim's allocator is predictable, not "fast"
15:13:29FromDiscord<lqdev> but it's still faster than having to go through a syscall?
15:13:45FromDiscord<lqdev> or should i just use malloc/free
15:14:03leorize[m]1why do you think Nim's allocator don't use syscalls?
15:14:14*tdc quit (Quit: Leaving)
15:14:23leorize[m]1you can't have the OS hand the memory to you without asking
15:14:28FromDiscord<lqdev> i'm not saying it doesn't use syscalls
15:14:49FromDiscord<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:57FromDiscord<lqdev> and the GC can reuse memory
15:14:57leorize[m]1but what's the problem that you're trying to solve?
15:15:16FromDiscord<lqdev> i'm trying to avoid too many syscalls in my game loop
15:15:32FromDiscord<lqdev> though on the other hand, i don't really know how chipmunk handles memory allocations
15:15:37FromDiscord<lqdev> maybe it uses a pool anyways?
15:15:58leorize[m]1note that the gc is not that good at memory reuse. You can see it in Araq's benchmark in ARC slides
15:16:17FromDiscord<lqdev> leorize: alright, so how would i go about writing my own memory pool?
15:16:17leorize[m]1using a memory pool speeds things up considerably
15:16:29FromDiscord<lqdev> seems like chipmunk just uses raw calloc/free
15:16:32leorize[m]1there's an implementation in fusion
15:16:47leorize[m]1it's one file so you can just copy it over
15:17:13FromDiscord<lqdev> pools.nim?
15:17:36leorize[m]1yea
15:17:51FromDiscord<lqdev> doesn't seem like the thing i need
15:18:01FromDiscord<lqdev> because i need a generic malloc, realloc, and free
15:18:48leorize[m]1well memory pools are optimized for one type of objects
15:18:54leorize[m]1that's why they're fast
15:19:13FromDiscord<flywind> Is `boundChecks` only disabled in `-d:danger` not in `-d:release`?
15:19:41leorize[m]1I guess you should do benchmarks between the system allocator (check both Windows vs Linux) vs Nim's TSLF
15:19:55FromDiscord<lqdev> leorize: so should i just keep the default calloc/realloc/free for now?
15:20:39leorize[m]1I don't know, you want the fastest, you gotta benchmark
15:20:52FromDiscord<lqdev> yea i guess it doesn't matter for now.
15:21:05FromDiscord<lqdev> i'll benchmark later on when i actually get to spawning lots of objects
15:22:14FromDiscord<lqdev> "premature optimization is the root of all evil", they say, yet i'm giving in anyways. -_-
15:23:24astronavtto whoever wrote the nim tutorials and docs: they are very good and easy to read. thank you!
15:24:03astronavtit 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:03narimiranis this a reverse day? somebody is praising nim docs and tutorials!?
15:24:23leorize[m]1\o/
15:24:29astronavthave you seen the python docs? :P
15:25:17FromDiscord<lqdev> for me the python docs are quite hard to navigate as compared to other languages :p
15:25:38FromDiscord<lqdev> function names vs descriptions don't stand out well enough
15:25:41astronavtexactly. imagine trying to learn python, r, c, c++, or java from reading the docs...
15:27:07disrupteklqdev: make it work, make it correct, make it fast.
15:27:22disrupteklqdev: don't optimize what you don't understand.
15:27:37FromDiscord<lqdev> disruptek: i keep forgetting that.
15:28:03disrupteki understand that you don't think you can use pools, but my guess is that you can use pools.
15:28:07astronavti 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:16disruptekalso, pools are an astronomical performance improvement.
15:33:31disruptekleorize[m]1: your ci stuff that i appropriated from your dns stamp project... is it creating a musl nim?
15:34:07leorize[m]1no?
15:34:26*oculux quit (Ping timeout: 260 seconds)
15:34:37disruptekshashlick: do the tests pass for you locally?
15:34:46leorize[m]1I made it for running tests, not making binaries
15:34:56disruptekyeah, i didn't think it was musl.
15:35:06disruptekjust trying to figure out what's breaking nimgit2 so hard.
15:35:23disruptekseems like more than one issue.
15:35:55*oculux joined #nim
15:36:39FromDiscord<Yardanico> @flywind release mode has all runtime checks enabled nowadays
15:36:50FromDiscord<Yardanico> But danger disables everything
15:37:39FromDiscord<flywind> yea I found some errors in Nim doc
15:38:36FromDiscord<flywind> https://github.com/nim-lang/Nim/blob/992952d86844805231bcc8a92063c122f721658d/lib/pure/collections/deques.nim#L15
15:38:46FromDiscord<flywind> I'm making a pr
15:43:38*newUser joined #nim
15:44:08FromDiscord<Yardanico> Well it's there because -d:release was -d:danger before 0.20 :)
15:44:53newUserI'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:51FromDiscord<Yardanico> try to reinstall gintro if you're sure that you have gtk4 packages
15:46:59FromDiscord<Yardanico> Maybe you installed gtk4 after you installed gintro
15:47:21newUseryes, ok I'll try it
15:49:57newUserno 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:20newUsernow 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:36astronavtis 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:55astronavtobviously i could also construct escape codes by hand, but thats no fun
16:15:15leorize[m]1you should take a look at the terminal module
16:16:15astronavtthank you
16:18:40astronavtyeah 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:45astronavtim not 100% sure how to use this to set more than just the basic 16 colors
16:22:52FromDiscord<lqdev> `enableTrueColors()`
16:23:18astronavte.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:28FromDiscord<lqdev> then `stdout.setForegroundColor(colRed)` and `stdout.setBackgroundColor(colGreen)`
16:23:35FromDiscord<lqdev> https://nim-lang.org/docs/terminal.html#setForegroundColor%2CFile%2CColor
16:23:46FromDiscord<lqdev> 256 color is not supported
16:24:17astronavthm
16:24:20*astronavt quit (Quit: Leaving)
16:24:54*astronavt joined #nim
16:25:00astronavt(sorry i disconnected, might have missed messages)
16:25:20FromDiscord<lqdev> you didn't miss anything
16:25:39astronavtok. do i misunderstand the point of `enableTrueColors()` then?
16:26:38astronavtsetForegroundColor looks like it supports Colors, right?
16:26:58astronavtare 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:18FromDiscord<Inam> sent a long message, see http://ix.io/2Ap4
16:31:19astronavti 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:05astronavt@Inam true, i did start with that tour. but somehow i felt like the nim tutorial helped me get going faster.
16:32:41FromDiscord<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:12astronavtlikely! 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:27leorize[m]1astronavt: "true colors" is only for when you want to use 24-bit colors in your app
16:33:32astronavti know it's in the Go one too. but you're right it's probably just a matter of familiarity
16:33:33sealmoveWell, 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:54sealmoveAnd yaml is impossible to parse
16:33:57FromDiscord<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:12astronavtit's in the hamburger menu. definitely more hidden
16:34:24leorize[m]1sealmove: I think any format trying to improve the "readability/human maintainability" of json is a lost cause
16:34:52FromDiscord<Inam> Oh yeah
16:34:52FromDiscord<Inam> You're right
16:34:57sealmoveleorize why?
16:35:07FromDiscord<Inam> TOML?
16:35:14sealmoveTOML is not good with nesting
16:35:18leorize[m]1json was designed for serialization, it's never made for configuration and the syntax itself is terrible for it
16:35:24FromDiscord<Inam> that's true
16:35:38astronavtwhat is JsonNode?
16:35:57leorize[m]1it's a type in Nim, representing a json value
16:36:04leorize[m]1it's in the json module
16:36:22sealmovefor example a Yaml parser would produce a json node
16:36:29astronavtoh interesting, i hadn't looked at the json module yet
16:36:29sealmoveJsonNode*
16:36:42astronavtnim has quite an impressive set of "batteries" that it includes
16:37:27astronavtthe one thing i really dont like about this json5 proposal is the embedded newlines
16:37:33federico3astronavt: less than Python
16:37:44sealmoveleorize: 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:08sealmoveso I hear suggestions :P
16:38:17astronavtfederico3, but python's are expired, corroded, and leaking ;)
16:38:23leorize[m]1you can use that nested text thingy disruptek referenced earlier :P
16:38:33leorize[m]1though it uses a much different paradigm from json
16:38:48sealmovethat might actually be a good thing
16:38:52sealmovelemme check
16:39:21leorize[m]1astronavt: I wouldn't say Nim's batteries are that good either :P
16:39:37leorize[m]1anything that's not used frequently, well, you can tell by looking at the API
16:41:06FromDiscord<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:07astronavtfair 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:14FromDiscord<Inam> ~~Sure seems like a lot of batteries to me~~
16:41:29Zevvgetting there: http://zevv.nl/div/2020-10-11.18-38-43.mp4
16:41:33FromDiscord<dom96> But yes, if a package manager existed before then the stdlib would have been much smaller
16:41:39astronavtah, interesting
16:41:49FromDiscord<Inam> That makes sense I guess
16:41:52astronavtmaybe in 2.0 or something all that stuff will be spun off into standalone packages or something?
16:41:53sealmoveleorize: you don't remember name? can't find disruptek's msg
16:42:02astronavtthere 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:14leorize[m]1it's literally called NestedText sealmove
16:42:32sealmoveah lol
16:43:57*lritter quit (Quit: Leaving)
16:44:16leorize[m]1astronavt: a potential future for Nim is that the "stdlib" will be a collection of packages
16:44:34leorize[m]1we are nowhere near that yet though
16:45:04leorize[m]1Zevv: oooh is that an audio editor thingy?
16:45:15leorize[m]1@lqdev is probably gonna be interested
16:45:15astronavtleorize[m]1, that sounds like a desirable future
16:45:23*luis quit (Read error: Connection reset by peer)
16:45:23Zevvno, mass scale event viewer
16:45:32*luis joined #nim
16:45:38astronavti 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:35leorize[m]1Zevv: I don't understand what that is, but it looks cool and smooth :P
16:46:37astronavti 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:34FromDiscord<exelotl> I really wanna make a mod tracker in nim someday (ideally one that can run on 3DS)
16:47:37Zevvleorize[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:15Zevvlike this one is some app I'm working on: http://zevv.nl/div/shot.png
16:48:36FromDiscord<exelotl> I tried hacking on the MilkyTracker source but it's just awful, horribly messy archaic C++ codebase
16:48:47FromDiscord<Avatarfighter> does anyone know who FedericoCeratto is in the irc
16:48:51ZevvI have problems getting insight in the dynamic behaviour, so I add some logging at trivial points, which you can explore and graph
16:48:53FromDiscord<Avatarfighter> the name keeps slipping from me
16:49:02leorize[m]1@Avatarfighter federico3
16:49:10FromDiscord<Avatarfighter> thanks leorize
16:49:30FromDiscord<Avatarfighter> federico3: I have questions about your tor-nim library >:)
16:49:47leorize[m]1Zevv: sounds useful, is it foss?
16:51:08federico3leorize[m]1: huh?
16:51:33leorize[m]1federico3: @Avatarfighter wanna ask you something
16:51:55FromDiscord<Avatarfighter> federico3: yeah I was wondering how the `create_ephemeral_onion_service` bit of your tor-nim library worked
16:52:07federico3I had to un-ignore FromDiscord
16:52:13FromDiscord<Avatarfighter> 😢
16:52:36FromDiscord<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:38federico3it should work - it's in the demo
16:52:53FromDiscord<Avatarfighter> Do you have an example/demo of a service running behind it?
16:53:13federico3https://github.com/FedericoCeratto/nim-tor/blob/master/tests/tor_demo.nim#L40
16:53:15federico3let me try
16:54:29FromDiscord<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:33astronavtanother 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:02FromDiscord<Rika> import strutils; parseEnum[EnumType](theString) == theEnumValue
17:00:54astronavtthank you
17:05:20FromDiscord<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:33FromDiscord<lqdev> which also handles hex codes
17:06:18astronavteven better
17:11:51FromDiscord<shashlick> @disruptek gittyup passes tests on all but Linux
17:11:54FromDiscord<shashlick> https://travis-ci.org/github/genotrance/travister/builds/733774729
17:12:20*Vladar joined #nim
17:12:35FromDiscord<shashlick> I'm running nimble test - https://github.com/genotrance/travister/blob/master/test.sh#L81
17:13:41Zevvleorize[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:36federico3Avatarfighter: added a new demo
17:28:01FromDiscord<Avatarfighter> federico3: thanks 😄
17:35:05ZevvWhat 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:24federico3Avatarfighter: any interesting tool that you want to share?
17:58:41FromDiscord<Avatarfighter> federico3: What do you mean? Like what I'm working on?
17:59:14*hnOsmium0001 joined #nim
17:59:51FromDiscord<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:52federico3yes, or anything else around Nim and Tor
18:00:03federico3like Briar?
18:00:19FromDiscord<Avatarfighter> yeah somewhat like that
18:00:43FromDiscord<Avatarfighter> The original p2p e2ee version is just reliable udp connections between members of a swarm
18:00:57FromDiscord<Avatarfighter> ^ for what I'm working on
18:01:21FromDiscord<Avatarfighter> I am working on a way to stop rogue clients from joining a swarm atm ahah
18:01:55FromDiscord<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:59federico3something that can integrate with xmmp/IRC/activitypub/matrix would be very welcome
18:02:31FromDiscord<Avatarfighter> I don't see why you couldn't just plug your own protocol into my program tbh
18:02:52FromDiscord<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:50FromDiscord<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:32leorize[m]1if you're not good with crypto, just use others premade crypto and remember to make your program not dumpable
18:07:08FromDiscord<Rika> how do you make a program not dumpable?
18:07:11federico3libsodium is your friend
18:07:46federico3https://doc.libsodium.org/memory_management
18:08:05federico3(FWIW)
18:08:40FromDiscord<Avatarfighter> leorize: I am using actual crypto not homemade 😮
18:09:55leorize[m]1federico3: allocators support in nim would be nice for that, unfortunately we don't have that yet :(
18:10:37leorize[m]1it's not hard to make a `SecureString` out of it though :P
18:12:11blackbeard420is there a way to 'await' a flowvar?
18:15:42Yardanico^
18:15:45Yardanico^ operator
18:15:55Yardanicohttps://nim-lang.org/docs/threadpool.html#%5E%2CFlowVar%5BT%5D
18:16:31Yardanicoblackbeard420: ^
18:16:55FromDiscord<Avatarfighter> "^"
18:16:59FromDiscord<haxscramper> @shashlick nimtreesitter internally uses `nimgen` to wrap code generated by tree-sitter, correct?
18:17:18FromDiscord<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:39Yardanicoyou'll have much more problems with sync websockets :)
18:18:56Yardanicosince it'll require you to do threading, locks, etc
18:20:00FromDiscord<lqdev> i just cross-compiled my program to windows
18:20:02*luis joined #nim
18:20:06FromDiscord<lqdev> and i'm trying to run it with wine
18:20:11Yardanicosoo?
18:20:17FromDiscord<lqdev> but i'm getting a strange error
18:20:20FromDiscord<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:25Yardanicoyou need that dll
18:20:30FromDiscord<lqdev> why is it looking for winpthreads when --threads:off?
18:20:37Yardanicoask mingw
18:20:49Yardanicomaybe one of the libs you're using wants threads?
18:20:58Yardanicoanyway you should have that dll in your system
18:20:59FromDiscord<lqdev> doubt it
18:21:02Yardanicolinux system
18:21:25Yardanicosearch for libwinpthread-1.dll in /usr
18:21:29FromDiscord<lqdev> hm might be glfw
18:21:34YardanicoI have it in /usr/x86_64-w64-mingw32/bin/libwinpthread-1.dll and /usr/i686-w64-mingw32/bin/libwinpthread-1.dll
18:32:52natureIs 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:47FromDiscord<Avatarfighter> using xmltree + htmlparser should let you parse and modify html
18:43:55FromDiscord<Avatarfighter> https://nim-lang.org/docs/htmlparser.html
18:46:58natureYes 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:36FromDiscord<Avatarfighter> do note you can't go from child -> parent node without keeping track of the parent node yourself
18:51:42FromDiscord<Avatarfighter> but parent -> child is fine
18:52:17FromDiscord<lqdev> Yardanico: do you know of any way to link it statically?
18:52:24FromDiscord<lqdev> --passC:-static doesn't seem to help
18:52:45FromDiscord<shashlick> @haxscramper ya and nimgen calls c2nim
18:52:53Yardaniconot really sure
18:53:06FromDiscord<lqdev> maybe i need to add the passC before i import glfw
18:53:10FromDiscord<lqdev> lemme track down which lib does this
18:53:27astronavtis 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:44FromDiscord<shashlick> I need to change it up to use nimterop since it is a C api anyway
18:53:56Yardanicoastronavt: well not really
18:54:01Yardanicoit's okay
18:54:08Yardanicoif you can't do it other way
18:54:15astronavti just don't know other ways, i'm quite new to nim
18:54:22Yardanicowell, trying to redesign your API :P
18:54:54FromDiscord<lqdev> hmm, librt.so.1
18:54:57FromDiscord<lqdev> i wonder what it's for
18:54:59FromDiscord<kodkuce> @Yardanico i can learn threading locks, but cant fix this file descriptior bug
18:55:12Yardanicohave you tried simplifying the failing example?
18:55:21FromDiscord<lqdev> librt, libposix4 - POSIX.1b Realtime Extensions library
18:55:23Yardanicofirst removing the dependency from ws module step by step
18:55:36Yardanicojust make the simplest possible example reproducing the issue
18:58:26*abm quit (Read error: Connection reset by peer)
18:59:29FromDiscord<lqdev> the glfw wrapper seems to link to pthreads for some reason
18:59:33FromDiscord<lqdev> i don't really get why
18:59:49FromDiscord<lqdev> i'mma try cloning it and experimenting a bit
19:00:05leorize[m]1astronavt: it really depends on what exactly you're trying to do
19:00:15leorize[m]1@lqdev I guess glfw is thread-safe?
19:00:22FromDiscord<lqdev> i think so
19:00:27FromDiscord<lqdev> i don't see *why* it would need pthreads
19:00:31leorize[m]1then it makes sense that it'd link to pthread, since it gotta use those locks
19:00:56FromDiscord<lqdev> guess i just gotta link pthread statically
19:01:06FromDiscord<lqdev> using a compiler flag
19:01:19leorize[m]1what are you trying to do?
19:01:33leorize[m]1and no, never link pthread statically without linking the whole C library
19:02:41astronavtYardanico, @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:03Yardanicowhy do you use float for background/foreground?
19:03:08astronavtoh, not float in this case
19:03:16FromDiscord<lqdev> leorize: i'm having a bit of a windows problem here.
19:03:19leorize[m]1have you looked at styledWrite? :)
19:03:21astronavti'd like the fg and bg parameters to be Color enum items, but there is no "null" or "use current/default" color
19:03:21Yardanicoastronavt: which data type then?
19:03:29Yardanicooh
19:03:44FromDiscord<lqdev> glfw needs pthread and on mingw that links to libwinpthread-1.dll
19:03:49*TomDotTom joined #nim
19:03:54FromDiscord<lqdev> but i want to have a dll-free executable
19:04:03astronavtyeah 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:04leorize[m]1@lqdev dll-free and mingw don't mix
19:04:10astronavt(it == styledWrite)
19:04:22leorize[m]1if you want dll-free, msvc is the best bet
19:04:23FromDiscord<lqdev> leorize: why?
19:04:24FromDiscord<lqdev> licensing?
19:04:32FromDiscord<lqdev> msvc needs a lot of bloat
19:04:36FromDiscord<lqdev> and isn't available on linux
19:04:46leorize[m]1the bloat is in windows itself
19:04:52leorize[m]1it's just the case of what's bundled by default
19:04:58FromDiscord<lqdev> yeah, visual studio comes preinstalled on windows.
19:05:13Yardanico@lqdev he means that msvc uses dlls preinstalled on windows
19:05:49leorize[m]1though I think your problem here is that the build of glfw you're using uses pthread instead of Windows' native threading facility
19:06:11leorize[m]1(I don't even know if glfw supports native windows threading)
19:06:27FromDiscord<lqdev> but oh hold on, why is it linking to pthread on windows anyways
19:06:36FromDiscord<lqdev> it does have it in the flags for linux
19:06:39FromDiscord<lqdev> but not for windows
19:06:45FromDiscord<lqdev> is there a mingw ldd?
19:07:35leorize[m]1there are some explorer tools for windows I think
19:07:58leorize[m]1what version of glfw are you using?
19:08:05leorize[m]1I mean what build?
19:08:32FromDiscord<lqdev> build?
19:08:33leorize[m]1because glfw does have native windows threading support: https://github.com/glfw/glfw/blob/0be4f3f75aebd9d24583ee86590a38e741db0904/deps/tinycthread.h
19:08:45FromDiscord<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:55leorize[m]1@lqdev http://dependencywalker.com/
19:13:43astronavt@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:21Yardanicowell you can (ab)use the fact that Color is "distinct int"
19:14:29Yardanicoso you can for example have Color(-1) as the default value
19:14:30astronavteven 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:34Yardanicoand check for that in the proc
19:15:45Yardanicobut you can also use options
19:16:10Yardanicoalso yeah, why didn't you like writeStyled ?
19:16:34YardanicostyledWrite *
19:17:05astronavtwell again i'd like to iterate over a list of StyledText objects and print them
19:17:17astronavtso i'd like some way to carry around this "absence of color"
19:17:33astronavtColor(-1) resolves to #FFFFFF so that could conflict with user input
19:17:43astronavtnot sure if there's some other sentinel value that might work here
19:18:09FromDiscord<InventorMatt> instead of having none as a default option for an input you could create two proc with different input signatures instead
19:18:17Yardanicowell he has two optional arguments
19:19:07astronavthow un-idiomatic is it to have the user none(Color) when they want to keep the default color?
19:19:12astronavt*have the user write
19:19:34leorize[m]1astronavt: well Option[T] defaulted to none(T) should be fine I suppose?
19:20:47leorize[m]1I personally like styledWrite API though
19:21:49FromDiscord<lqdev> hmm https://media.discordapp.net/attachments/371759389889003532/764930773378662432/unknown.png
19:21:54FromDiscord<lqdev> doesn't seem like anything depends on it?
19:22:00FromDiscord<lqdev> it's just there
19:22:29leorize[m]1the program itself requested it then
19:22:42FromDiscord<lqdev> i wonder where
19:23:50astronavtthis is just clunky to me i guess: styledEcho(ansiForegroundColorCode(parseColor("peachpuff")), "Hello!")
19:24:53natureHow would I do if I have a proc supposed to be returning an object and I want to return "null" ?
19:25:18leorize[m]1nature: return an Option[T]
19:25:33naturePerfect thanks :)
19:25:47leorize[m]1astronavt: You can implement a simple processor on top of styledEcho
19:25:50natureby the way leorize[m]1 regarding my question the other day
19:26:41natureAbout silencing errors reported by my editor (I am using nimlsp)
19:26:58natureis there any way to do that ?
19:27:31astronavtleorize[m]1, or maybe i just alias `fg = ansiForegroundColorCode` or something
19:28:14leorize[m]1nature: it depends on your lsp client
19:29:59natureOh 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:33leorize[m]1I can imagine that most of them don't implement something like that
19:31:01leorize[m]1if 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:04leorize[m]1astronavt: you do know that styledEcho can take Color, right?
19:33:02*luis joined #nim
19:35:28leorize[m]1!eval import terminal, color; styledEcho parseColor("peachpuff"), "Hello!"
19:35:30NimBotCompile failed: /usercode/in.nim(1, 18) Error: cannot open file: color
19:35:42leorize[m]1!eval import terminal, colors; styledEcho parseColor("peachpuff"), "Hello!"
19:35:46NimBotHello!
19:38:12*abm joined #nim
19:42:54FromDiscord<Rebel> Are there any nim WinRM clients? Something like pywinrm.
19:47:35FromDiscord<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:44leorize[m]1you're not doing anything wrong
19:53:13leorize[m]1it's a bug in nimsuggest and/or jester
19:54:43leorize[m]1the 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:13disruptekwhen you newNimNode you can supply a node to copy the lineinfo from.
19:55:17disruptekelse, you can set the line info.
19:55:22disruptekelse, you have no info.
19:56:02*luis quit (Quit: luis)
19:56:09*luis joined #nim
19:57:58FromDiscord<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:34FromDiscord<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:57leorize[m]1my walkaround is to just put everything in a template then put the said template in jester's routes :P
20:02:18FromDiscord<Avatarfighter> Prologue is the fastapi of nim imo
20:02:20*natrys joined #nim
20:03:54FromDiscord<mikebelanger> > else, you have no info.↵> @disruptek[IRC]#0000 <- is this in reference to debugging the routes macro?
20:04:18FromDiscord<mikebelanger> @UNIcodeX @Avatarfighter oh interesting - I haven't heard of that framework. thanks I'll check it out
20:04:49FromDiscord<mikebelanger> @leorize lol ah yeah that's one way of doing it
20:05:38FromDiscord<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:47disruptekmikebelanger: it's in reference to debugging jester to fix gotodef in routes.
20:07:58*narimiran quit (Ping timeout: 258 seconds)
20:08:26Zevvdisruptek: will you just look at this very cool stuff: http://zevv.nl/div/maui.png
20:08:31Zevvand when will we do cps again
20:09:24YardanicoZevv: nicee
20:09:30Yardanicolooks very kool
20:09:43ZevvI made colors, otherwise I can't impress disruptek
20:09:45FromDiscord<Avatarfighter> Zevv: that looks so cool
20:09:53disruptekZevv: needs more emoji.
20:10:02idfnice stuff
20:10:07disrupteklooks really slick.
20:10:31disrupteki've wanted to build something like apple's instruments.
20:10:35FromDiscord<Avatarfighter> Yardanico: voice your support for what vindaar put in the moderator only chat in discord please
20:10:49FromDiscord<Avatarfighter> i'll donate so you can buy a coffee
20:10:51Yardanicoi think I know what it's about without looking
20:10:56FromDiscord<Avatarfighter> LOL
20:10:59disruptekcps... need to kick clyybber until he fixes the compiler.
20:11:03idfmaking me admin that is
20:11:31disruptekwe 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:31Yardanico@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:45FromDiscord<Avatarfighter> yes but you have the cool blue role
20:12:00FromDiscord<Avatarfighter> I'm about to make a change.org petition for the webdev channel 😠
20:12:30disruptekand 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:37idfi want to make a memory debugger in nim, kinda like scanmem or cheatengine
20:15:23natureWhy does `loadHtml` from htmlparser lib does always add a root `<document>` tag ?
20:15:30FromDiscord<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:47disruptekyeah, that would likely solve your problem.
20:16:02disruptekbut 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:35FromDiscord<mikebelanger> like finding the line numbers of wherever the definitions are?
20:17:53disruptekno, the compiler does that for you.
20:18:07disruptekbut when you create ast, if you don't provide the source line info, then it's lost.
20:18:23disrupteksee the NimNode argument to newNimNode.
20:18:49disruptekthere's also a setLineInfo and setLineInfoObj or something similar. i forget the names.
20:19:02disruptekthey let you paint a node with existing line info.
20:21:56FromDiscord<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:23Yardanicocan you give a link?
20:22:59FromDiscord<dom96> just check nim_lang replies, I replied to one
20:24:10FromDiscord<shashlick> @lqdev how did you install mingw on windows
20:24:29Yardanicoalso yeah, people mistake nim's ARC for Swift's ARC but they're different in a very major way:
20:24:36Yardanicoswift has atomic reference counting
20:25:01natureIs anybody familiar with the htmlparser lib ?
20:25:33FromDiscord<Avatarfighter> yeah i am somewhat nature
20:26:29FromDiscord<mikebelanger> @disruptek ok thanks I'll look at NimNode, and those others
20:26:40natureDo 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:57FromDiscord<dom96> Yardanico: so in Nim's case it stands for Automatic Reference Counting?
20:27:06Yardanicoit stands for that in both cases I think
20:27:09FromDiscord<mikebelanger> @disruptek I'll just move this to <#764946138109050893> as its jester related
20:27:31disrupteki dunno what that means but it sounds like i'm off the hook. 👍
20:27:40FromDiscord<Elegant Beef> Was going to say, i could've sworn i've seen it referred to as atomic reference counting 😛
20:27:41FromDiscord<dom96> oh yeah, it does
20:27:42Yardanicobut swift actually uses atomic rc
20:28:00FromDiscord<Avatarfighter> I thought arc was 4raqs reference counting
20:28:10FromDiscord<dom96> what does that mean in practice though?
20:28:14FromDiscord<Avatarfighter> yes
20:28:16FromDiscord<Elegant Beef> Three
20:28:19disrupteknothing. it's scope-based mm.
20:29:16disruptekwe 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:53Yardanico~~restarting the bridge with new bridged channels~~
20:30:56*FromDiscord quit (Remote host closed the connection)
20:31:03supakeenbyte bridge
20:31:05supakeenbye
20:31:13*FromDiscord joined #nim
20:31:27FromDiscord<Yardanico> restarting done
20:31:30FromDiscord<dom96> i like how Discord strikes that through
20:32:01FromDiscord<Yardanico> because I did ~~
20:32:11FromDiscord<Yardanico> 123
20:32:13supakeenall the cool kids are on irc
20:32:14FromDiscord<Yardanico> weird
20:32:15*nixfreak joined #nim
20:33:14FromDiscord<dom96> speaking of ARC though, I hope that we will see more articles/docs about it
20:33:28FromDiscord<dom96> It would have been nice if I could share a link to something like that
20:33:29Yardanicowell strictly speaking for most people orc will work just fine by default :P
20:33:37nature@Avatarfighter any idea ?
20:33:45Yardanicothe biggest thing for *most* people would be the change of finalizers -> destructors
20:33:54Yardanicoofc finalizers work with arc/orc, but writing destructors explicitly is better
20:34:11FromDiscord<dom96> strictly speaking, getting people to get excited about something requires some marketing material
20:34:20Yardanicowe have "update on arc" thread on the forum
20:34:23Yardanicocan take the info from there
20:34:35FromDiscord<Avatarfighter> nature: I'm thinking rn lol
20:34:41Yardanicohttps://forum.nim-lang.org/t/6549 I mean
20:35:43Yardanicothe only "Missing features" from there is shallowCopy which wouldn't really be fixed I think
20:35:48Yardanicowell it works, but works differently than with refc
20:36:20nature@Avatarfighter okok thanks yeah, have you even noticed that behaviour before ?
20:36:22FromDiscord<dom96> > https://forum.nim-lang.org/t/6549 I mean↵@Yardanico yeah, not really a great marketing post IMO
20:36:30Yardanicowell I didn't say that this is a marketing post
20:36:36YardanicoI meant to use this as a source and inspiration
20:36:47Yardanico"can take the info from there"
20:37:05Yardanicobut yeah, 1.4 blog post must 100% have a dedicated section related to ARC/ORC
20:37:10*luis joined #nim
20:37:51FromDiscord<Avatarfighter> nature: I am looking at my code to see if i have that
20:37:54FromDiscord<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:57nature@Avatarfighter https://github.com/nim-lang/Nim/blob/dc1c251a2c2779f3f12d7bf2255f01355bbb886d/lib/pure/htmlparser.nim#L2024
20:41:24FromDiscord<Avatarfighter> dark mode 👌 https://media.discordapp.net/attachments/371759389889003532/764950802720227379/unknown.png
20:42:31nature🔥🔥🔥
20:42:38FromDiscord<Innokentiy Sokolov> that dark pallet is killing
20:42:40FromDiscord<Innokentiy Sokolov> my eyes
20:42:55FromDiscord<Yardanico> @Avatarfighter very outdated image
20:42:56FromDiscord<Yardanico> it was FIXED
20:42:57FromDiscord<Yardanico> already
20:42:59FromDiscord<Avatarfighter> no
20:43:01FromDiscord<Yardanico> at least 4 other people asked
20:43:01FromDiscord<Avatarfighter> that is from today
20:43:02FromDiscord<Yardanico> yes it was
20:43:04FromDiscord<Avatarfighter> no
20:43:09FromDiscord<Yardanico> it's fixed in devel
20:43:12FromDiscord<Avatarfighter> i took that image seconds ago
20:43:12FromDiscord<Yardanico> not in 1.2.6
20:43:18FromDiscord<Yardanico> it's been fixed in devel for months
20:43:24FromDiscord<Yardanico> 🙂
20:43:27FromDiscord<Avatarfighter> 😐
20:43:35FromDiscord<Avatarfighter> make prod website devel smh
20:43:40FromDiscord<Yardanico> no
20:43:59FromDiscord<Yardanico> use http://nim-lang.github.io/Nim/lib.html if you want devel docs
20:44:40FromDiscord<Innokentiy Sokolov> light mode is on by default. Thanks!
20:45:43FromDiscord<Yardanico> it's just that most people are fine with light theme
20:46:00FromDiscord<Innokentiy Sokolov> > it's just that most people are fine with light theme↵@Yardanico naturally 🙂
20:46:03FromDiscord<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:18FromDiscord<Yardanico> @Innokentiy Sokolov well I prefer dark themes 🙂
20:46:35FromDiscord<Innokentiy Sokolov> > @Innokentiy Sokolov well I prefer dark themes 🙂↵@Yardanico I bet you are in minority 🙂
20:46:46FromDiscord<Yardanico> I'm not doubting that about the dark themes
20:46:59FromDiscord<Innokentiy Sokolov> I mean I prefer dark VS Code but docs - nah
20:47:13*opal joined #nim
20:47:32idfi prefer gruvbox dark
20:47:49FromDiscord<Yardanico> monokai vibrant (vscode theme)
20:48:00FromDiscord<Yardanico> really like it
20:48:10nature+ for gruvbox
20:48:59FromDiscord<Innokentiy Sokolov> default dark one is OK too
20:49:06FromDiscord<Innokentiy Sokolov> ..boring I know but still
20:49:26FromDiscord<Yardanico> yes boring - exactly that's why I don't really like it 🙂
20:50:00PrestigeSo many Emojis, this chat looks like a bowl of lucky charms
20:50:12Yardanicoblame discord for automatically converting :) to an emoji
20:50:19FromDiscord<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:19YardanicoI never insert emojis myself
20:50:27Yardanicoreally never
20:50:28FromDiscord<Innokentiy Sokolov> so boring is OK in this case 😉
20:50:33YardanicoI mean not unicode ones
20:50:44Yardanico:) :P :D D: :O
20:50:54FromDiscord<Clyybber> you can turn that off
20:50:57FromDiscord<Clyybber> :)
20:51:03Yardanicoshh
20:51:06FromDiscord<Innokentiy Sokolov> > you can turn that off↵@Clyybber woot?
20:51:27FromDiscord<Clyybber> under "text and images"
20:51:52Yardanicoyeah
20:52:14nature@Avatarfighter I found out that the problems comes from the parsing adds "empty" nodes
20:52:34FromDiscord<Innokentiy Sokolov> :)
20:52:43FromDiscord<Innokentiy Sokolov> > under "text and images"↵@Clyybber thanks man!
20:53:12FromDiscord<Clyybber> np :)
20:53:17natureSo `let html = parseHtml("<html></html>"); html.len == 2`
20:57:56leorize[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:18FromDiscord<Clyybber> where do you need it?
20:58:25FromDiscord<Avatarfighter> i wonder if it adds a document tag for a specific reason nature
20:58:51FromDiscord<Clyybber> leorize: where do you need it/
20:59:36leorize[m]1https://github.com/nim-lang/Nim/blob/devel/compiler/suggest.nim#L466
21:00:21nature@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:32leorize[m]1I "might" be able to change that ConfigRef into a PContext
21:01:04leorize[m]1so I would effectively have access to all structures
21:01:10leorize[m]1which should I put my PSym in?
21:01:22naturealso by the way using xmlparser instead of htmlparser works as expected, so really a bug with htmlparser...
21:01:30natureAt least it seems like it
21:02:42leorize[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:25FromDiscord<Clyybber> is the purpose to allow jump to implementation?
21:03:55*abm quit (Read error: Connection reset by peer)
21:04:16leorize[m]1yea
21:04:18*abm joined #nim
21:05:18FromDiscord<Rebel> Is dynlib available within Nimscript?
21:06:07Yardanicono, there's no FFI really
21:07:39*tane quit (Quit: Leaving)
21:07:47*Vladar quit (Quit: Leaving)
21:09:15FromDiscord<Rebel> so the best way to do windows api or system calls in Linux within Nimscript would be to ...?
21:09:31FromDiscord<Clyybber> @leorize Hmm, why not store all definitions in the PSym itself? Like we do with `allUsages`
21:12:32leorize[m]1assuming that allUsages works well enough, I can just use that
21:12:34leorize[m]1it's slow though
21:13:29leorize[m]1the way it's working right now is that findDefinition fish for the symbol being referenced at the position where you use `def`
21:14:43leorize[m]1so 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:02leorize[m]1allUsage is actually deprecated
21:20:18leorize[m]1I think I know where to put this
21:22:58*gmaggior quit (Ping timeout: 272 seconds)
21:28:46*vicfred joined #nim
21:31:06FromDiscord<aooo> Is there a static code analysis code checker for nim?
21:32:20leorize[m]1yes, it's the compiler :P
21:32:34leorize[m]1if you want something better, we got drnim but it's still in development
21:32:43Yardanico@aooo "nim check"
21:33:43*luis joined #nim
21:33:53FromDiscord<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:57FromDiscord<Recruit_main707> i dont know if there are any more tools tbh :P
21:35:02Yardanico@aooo wdym?
21:35:06leorize[m]1the compiler can statically check a lot of coding issues, including out-of-bound errors
21:35:06Yardanicoi don't really understand
21:35:17Yardanicoof course it won't give you complex static analysis
21:35:25Yardanico(it would be possible when drnim gets more or less complete)
21:35:28leorize[m]1also Nim doesn't have undefined behavior
21:35:33leorize[m]1(I think)
21:35:39Yardanicoi think it does with -d:danger
21:36:04Yardanicowell also of course with unsafe features (cast/ptr/addr/unsafeAddr)
21:37:15FromDiscord<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:37leorize[m]1mostly, yes
21:37:55leorize[m]1for the bugs the compiler cannot catch, runtime checks will be used which will terminate your program upon error
21:39:35leorize[m]1in the future drnim will allow for more complex analysis including proofs that your program functions as designed
21:39:49leorize[m]1this future is a bit far so don't hold your breath :P
21:43:03leorize[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:20naturenoob question: sort for tuples is in "algorithm" library
22:14:29nature?
22:14:51disruptektuple 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:24natureIs there something like a ternary operator in nim ? like `let x = if true: blah else: bluh` ?
22:32:45disruptekyes.
22:33:40natureThanks :)
22:33:42leorize[m]1nature: well you nailed the syntax
22:34:35natureand if I want to split it in multiple line, I put () around ?
22:34:51disrupteknah.
22:35:40leorize[m]1nature: newline then indent
22:36:11leorize[m]1basically similar to writing a function
22:36:59natureThanks
22:41:52FromDiscord<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:34leorize[m]1why? curl is pretty cool
22:42:58FromDiscord<Avatarfighter> curl is cool
22:43:16FromDiscord<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:17FromDiscord<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:29FromDiscord<anto> (edit) 'Is' => 'If not, is'
23:02:43*gmaggior quit (Quit: Leaving)
23:05:13leorize[m]1disruptek: I did it: https://asciinema.org/a/wWPby1ueNwiaqo0bYnYPWNyLj
23:05:59disruptekyou make it look so easy.
23:06:16leorize[m]1@anto use a flag in the child thread and have the infinite loop break if the flag was set/unset
23:06:54leorize[m]1disruptek: that's the magic of nimsuggest actually working
23:09:28leorize[m]1@anto killing a thread is extremely dangerous, since you risk having resources dangling around
23:10:14FromDiscord<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:56FromDiscord<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:36FromDiscord<anto> leorize: do you have any examples of setting and unsetting flags? i cant seem to dig any up
23:53:14leorize[m]1@anto it depends on how your thread functions
23:55:29FromDiscord<anto> it pretty much immediately jumps into the loop
23:56:42leorize[m]1then you'll need a sync point then
23:57:28leorize[m]1so 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:37leorize[m]1no locking needed since strict synchonization isn't required
23:58:46leorize[m]1disruptek: oh you said you see a lot of red with the compiler source, right? try this: `touch compiler/nim.nims`
23:59:40leorize[m]1I 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