<< 12-02-2022 >>

00:00:43FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=3PlB" => "https://play.nim-lang.org/#ix=3PlF"
00:01:00FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=3PlF" => "https://play.nim-lang.org/#ix=3PlG"
00:03:50FromDiscord<auxym> In reply to @sOkam! "Can I get that": `nim --version`?
00:04:50FromDiscord<huantian> In reply to @b4mbus "okay and here: https://github.com/nim-lang/Nim/issu": https://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5D
00:05:33FromDiscord<leorize> NimVersion is available in nimscript↵(@sOkam!)
00:05:43FromDiscord<b4mbus> In reply to @huantian "https://nim-lang.org/docs/sequtils.html#concat%2Cva": Oh it's me being stupid.. I forgot functions can be called without parens, and this calls concat and invokes flatten on it
00:05:45FromDiscord<b4mbus> Thanks
00:14:48FromDiscord<geekrelief> I'm getting a crash using weave for multithreading. I tried putting `--debugger:native` and `--stackTrace:on` in debug mode in my `nim.cfg`, but I'm either get a SIGSEV or nothing. Sometimes I do get a successful run, but most of the time it's a crash. Any advice on how I can debug it?
00:21:01FromDiscord<sOkam!> In reply to @auxym "`nim --version`?": I mean, it does give the version, but also a bunch of unnecessary stuff (for this usecase) 😔 https://media.discordapp.net/attachments/371759389889003532/941851350134820905/unknown.png
00:21:16FromDiscord<sOkam!> In reply to @leorize "NimVersion is available in": How do I use it?
00:22:39FromDiscord<auxym> In reply to @sOkam! "How do I use": you mention a script, are you using nimscript?
00:22:55FromDiscord<sOkam!> bash atm, never used nimscript yet
00:25:57FromDiscord<auxym> ok. then extract the version from `nim --version` using your favorite tool: awk, sed, cut, perl, grep... not really my thing tbh
00:27:48FromDiscord<sOkam!> In reply to @auxym "ok. then extract the": that ugly. i'd rather learn nimscript↵but the question was related to how to get the version in nimscript, since I don't see `NimVersion` with a browser search in the pages I'm reading (might be in the wrong place)
00:27:55FromDiscord<sOkam!> (edit) "that" => "thats"
00:28:37FromDiscord<sOkam!> specially since it can be used as a bash replacement, and I'm eagerly looking to get away from bash and its limitations
00:29:23FromDiscord<sOkam!> (edit) "specially since it can be used as a bash replacement, and I'm eagerly looking to get away from bash and its limitations ... " added "(tried python, but subprocess.run([thing])everyting is an absolute mess)"
00:29:30FromDiscord<auxym> just write `echo NimVersion` in a file named eg `hello.nims` then execute it with `nim e hello.nim`
00:29:36FromDiscord<auxym> (edit) "hello.nim`" => "hello.nims`"
00:31:04FromDiscord<leorize> NimVersion is defined in system.nim, which is used in nimscript as well
00:33:32*jmdaemon joined #nim
00:33:51FromDiscord<sOkam!> What are the limitations of NimScript I should be aware of?
00:34:28FromDiscord<sOkam!> To be hones, I f'ing love what I'm reading. So eager to get away from bash, if this is as cool as I'm imagining
00:34:36FromDiscord<leorize> you can't call anything requiring C
00:34:49FromDiscord<leorize> subprocess support is shit, and that's an understatement
00:35:14FromDiscord<sOkam!> In reply to @leorize "subprocess support is shit,": What's that?
00:35:25FromDiscord<leorize> calling another process
00:35:49FromDiscord<sOkam!> what does it mean in practical terms?
00:36:01FromDiscord<sOkam!> like some simple example
00:36:41FromDiscord<leorize> you can't redirect input/output to anything
00:37:01FromDiscord<leorize> there's no "jobs" support, so if you start a process you are forced to wait for it to complete
00:37:15FromDiscord<sOkam!> is that not the same in bash?
00:37:53FromDiscord<leorize> no, in bash you can selectively redirect input/output as needed, and you can run things in background
00:38:03FromDiscord<leorize> but if you don't need all that, then nimscript is fine
00:38:04FromDiscord<sOkam!> ah i see
00:38:42FromDiscord<leorize> the process call API basically take a shell string, so you need a lot of quoteShell to use it safely
00:38:51FromDiscord<sOkam!> nah, I just want bash with proper global variables and function support that doesn't end up looking like satanic instead of scripting 🙈
00:39:12FromDiscord<leorize> nimscript sounds fine in that case
00:39:37FromDiscord<sOkam!> code is still OS dependent, right?
00:39:43FromDiscord<leorize> yea
00:39:51FromDiscord<sOkam!> is it still calling os apps like bash?
00:40:07FromDiscord<leorize> that app is called nim \:p
00:40:49FromDiscord<sOkam!> yeah, but i mean... if I write `ls` i'm guessing it won't work on windows but would work on linux
00:41:00FromDiscord<leorize> yea
00:41:15FromDiscord<sOkam!> kk, so same ruleset, just good syntax
00:41:26FromDiscord<leorize> the only way you can call OS apps is via staticExec and/or gorgeEx
00:41:42FromDiscord<leorize> not exactly the best API, but if it works for you that's great
00:42:23FromDiscord<sOkam!> In reply to @leorize "the only way you": hmmm what do you mean. I can't do `./whateverBinary` to run from the script?
00:42:45FromDiscord<sOkam!> (edit) "In reply to @leorize "the only way you": hmmm what do you mean. I can't do `./whateverBinary` to run ... frominside" added "a binariy" | "a binariyfrom ... the" added "inside"
00:43:24FromDiscord<leorize> that'd still work, don't worry
00:43:24FromDiscord<auxym> probably gonna get some hate in the nim discord for this, but for such scripting tasks I just use python TBH, plus if you use stdlib stuff like `os.listdir` instead of `ls` you avoid subprocess and make the script portable across OS
00:44:02FromDiscord<leorize> walkDir does work in nimscript, though yes, I do use python for this work as well
00:44:08FromDiscord<sOkam!> In reply to @auxym "probably gonna get some": I tried learning it in python, but I couldn't find good replacements for the stuff I was doing 😔
00:44:27FromDiscord<sOkam!> Maybe I just didn't know where to look
00:44:29FromDiscord<auxym> and python is as standard as perl in all linux distros these days, so you can throw the script on any fresh VM or whatever and it just works
00:45:48FromDiscord<sOkam!> since you guys seem to know about it, thoughts on fully nim apps to replace bash-like stuff?
00:46:06FromDiscord<sOkam!> like that scripting you are mentioning with python, but with nim and libraries
00:46:30FromDiscord<leorize> if you don't need advanced process i/o, including piping, it works
00:47:34FromDiscord<sOkam!> you still using python for it, though. why is that? is it faster to develop or smth? or just confort?
00:48:05FromDiscord<leorize> because that feature doesn't exist in nim
00:48:15FromDiscord<leorize> nor any library
00:48:32FromDiscord<leorize> I started writing one but there's a lot of work ahead
00:49:01FromDiscord<auxym> In reply to @sOkam! "since you guys seem": yeah, faster to develop, larger library ecosystem, like I said it's a standard install on all distros. For small scripts, max couple 100 lines, you can mostly keep the whole thing in your head and avoid dynamic typing bugs
00:49:24FromDiscord<leorize> or just use mypy to lint your code \:p
00:49:26FromDiscord<sOkam!> can think of an example of what that could look like? that -advanced i/o- you mention. i still don't understand what you mean very well 😔
00:50:06FromDiscord<auxym> for anything more complex, nim's type system is a joy. Or if I want to send a single exe to colleagues or whatever and not have to walk them through installing python on their windows box
00:50:39FromDiscord<sOkam!> In reply to @auxym "for anything more complex,": makes sense
00:55:42FromDiscord<sOkam!> Still getting the hints messages for some reason. Typo somewhere or smth? 🤔 https://media.discordapp.net/attachments/371759389889003532/941860076434645044/unknown.png
00:56:22FromDiscord<auxym> that's normal, just informational output
00:57:13FromDiscord<sOkam!> nvm, figured it out. was calling with `nim` and was overriding the one on the inside
01:06:47FromDiscord<Ayy Lmao> In reply to @treeform "Probably emit pragma": I was actually able to figure out a solution using generics. For some reason it hadn't crossed my mind before.
01:14:53FromDiscord<treeform> cool, you just have N different versions?
01:19:29FromDiscord<sOkam!> Is there a specific way to call a nim command from inside nimscript? 🤔 https://media.discordapp.net/attachments/371759389889003532/941866064877355118/unknown.png
01:25:04*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
01:27:54FromDiscord<auxym> In reply to @sOkam! "Is there a specific": https://nim-lang.org/docs/nimscript.html#selfExec%2Cstring
01:28:44FromDiscord<auxym> example usage: https://github.com/auxym/nim-on-samd21/blob/e7e8c3b993fca3e2ca3ebe9ff430959c73075149/config.nims#L63
01:40:34*krux02 quit (Remote host closed the connection)
01:41:24*jmdaemon quit (Ping timeout: 256 seconds)
01:53:33FromDiscord<sOkam!> In reply to @auxym "example usage: https://github.com/auxym/nim-on-samd": Why the `&` right before the start of the syntax? 🤔
01:55:33FromDiscord<enthus1ast> this is from strformat https://nim-lang.org/docs/strformat.html#nimfmt-vsdot-nimamp↵(@sOkam!)
01:56:28FromDiscord<enthus1ast> https://nim-lang.org/docs/strformat.html#%26.m
01:57:06FromDiscord<enthus1ast> its 3am here, g8
02:03:09*arkurious quit (Quit: Leaving)
02:04:48*jmdaemon joined #nim
02:08:50FromDiscord<Ayy Lmao> In reply to @treeform "cool, you just have": Whoops, just saw this. Yeah I guess that's how it would work under the hood. It looks like `proc on[T](contract: BaseContract, event: cstring, listener: T): Contract {.discardable, importcpp: "#.on(@)".}` So I can just pass in whatever function to the listener argument and it seems to work.
02:08:55*neurocyte0917090 quit (Ping timeout: 256 seconds)
02:13:45FromDiscord<treeform> yep
02:23:27*jmdaemon quit (Read error: Connection reset by peer)
02:24:09*jmdaemon joined #nim
02:29:19*jmdaemon quit (Ping timeout: 256 seconds)
02:46:56FromDiscord<sOkam!> Anyone knows why `nimbase.h` is missing? 🤔 https://media.discordapp.net/attachments/371759389889003532/941888071815798815/unknown.png
03:22:08*jmdaemon joined #nim
03:26:13*rockcavera quit (Remote host closed the connection)
03:27:08FromDiscord<Rika> Broken install?
04:00:07FromDiscord<demotomohiro> `nimbase.h` should be in /path/to/nim/lib directory.
04:06:01*supakeen quit (Quit: WeeChat 3.4)
04:06:32*supakeen joined #nim
04:07:21FromDiscord<Elegantbeef> Prestige you about?
04:08:01nrds<Prestige99> Hello
04:08:07FromDiscord<sOkam!> can choosenim have something to do with it? 🤔
04:08:23FromDiscord<Elegantbeef> I hate you prestige, i've continued playing with the trait-like stuff
04:08:30nrds<Prestige99> :)
04:08:42FromDiscord<Elegantbeef> I now have it supporting N number of interface conversions
04:08:56nrds<Prestige99> How's the syntax?
04:09:03FromDiscord<Elegantbeef> https://github.com/beef331/nimterface/blob/master/test.nim ok
04:09:21FromDiscord<Elegantbeef> I could make a converter for every permutation a type implements
04:09:27FromDiscord<Elegantbeef> Which sounds like hell to do
04:09:47FromDiscord<sOkam!> In reply to @demotomohiro "`nimbase.h` should be in": is that the system binary?↵I installed with choosenim, dunno if that could change things
04:09:49FromDiscord<Elegantbeef> But right now one needs to do `toImpl(BoundObject, DuckObject)` or w/e the concepts are named
04:10:19FromDiscord<Elegantbeef> I say permutation but i think that'd be combination
04:10:32nrds<Prestige99> Hmm okay interesting
04:10:52nrds<Prestige99> my brain wants "type Foo implements Bar" but that's not bad
04:11:45FromDiscord<Elegantbeef> Ehh it can do `MyObject.implements BoundObject, DuckObject` when i clean it up
04:12:11FromDiscord<Elegantbeef> the `toImpl` is for conversion
04:12:21FromDiscord<Elegantbeef> Since this supports converting to an object with a vtable for dispatch
04:13:32FromDiscord<Elegantbeef> Ref is really kicking my ass though
04:16:17FromDiscord<demotomohiro> @sOkam! Dont you have `lib` directory in the directory where choosenim installed nim?↵Try `which nim` if you don't know where your nim is installed.
04:23:52FromDiscord<sOkam!> In reply to @demotomohiro "<@186489007247589376> Dont you have": Apparently not 🤔 https://media.discordapp.net/attachments/371759389889003532/941912464138850424/unknown.png
04:25:26FromDiscord<Rika> `ls ~/.choosenim/toolchains/nim-1.6.2/lib
04:25:26FromDiscord<huantian> I don't think I do either
04:25:27FromDiscord<Rika> (edit) "~/.choosenim/toolchains/nim-1.6.2/lib" => "~/.choosenim/toolchains/nim-1.6.2/lib`"
04:26:20FromDiscord<sOkam!> In reply to @Rika "`ls ~/.choosenim/toolchains/nim-1.6.2/lib`": https://media.discordapp.net/attachments/371759389889003532/941913085650813038/unknown.png
04:26:30FromDiscord<Rika> nimbase.h is there
04:27:07FromDiscord<Rika> gcc is modern?
04:27:26FromDiscord<sOkam!> im on archlinux and compile frequently, i'd assume so
04:27:36FromDiscord<sOkam!> dunno how to check
04:27:40FromDiscord<Rika> gcc --version
04:27:52FromDiscord<Rika> if its like v9 or v11 then its good
04:28:09FromDiscord<Rika> even older 7 8 should be fine but might be wonky
04:28:13FromDiscord<Rika> be worried if you read 4
04:28:18FromDiscord<sOkam!> In reply to @Rika "gcc --version": https://media.discordapp.net/attachments/371759389889003532/941913582893948968/unknown.png
04:28:24FromDiscord<Rika> strange then
04:28:30FromDiscord<Rika> nimbase.h is right there
04:28:40FromDiscord<Rika> and it has the proper `-I` switch
04:30:45FromDiscord<demotomohiro> If you have `nimbase.h` but gcc says no such file, I think that means path in `-I` is wrong.
04:31:06FromDiscord<Rika> In reply to @Rika "`ls ~/.choosenim/toolchains/nim-1.6.2/lib`": i wrote the path written in the `-I` option here.
04:31:21FromDiscord<Rika> In reply to @sOkam! "Anyone knows why `nimbase.h`": the image shows the gcc command used
04:31:51FromDiscord<sOkam!> In reply to @demotomohiro "If you have `nimbase.h`": checked with .4 just in case, but nope either https://media.discordapp.net/attachments/371759389889003532/941914474204495882/unknown.png
04:32:48FromDiscord<Rika> you cant copy the command and compile the same file with a different lib
04:32:50FromDiscord<demotomohiro> Maybe `~` in your command line doesn't expand to home directory?
04:32:53FromDiscord<Rika> you need to recompile with 4
04:33:11FromDiscord<sOkam!> In reply to @Rika "you cant copy the": I recompiled
04:34:20FromDiscord<sOkam!> In reply to @demotomohiro "Maybe `~` in your": plus gcc error says the directory is correct https://media.discordapp.net/attachments/371759389889003532/941915102549008414/unknown.png
04:35:44FromDiscord<noow> does nimbase.h have the right owner and read permissions
04:37:04FromDiscord<sOkam!> In reply to @noow "does nimbase.h have the": https://media.discordapp.net/attachments/371759389889003532/941915784437964910/unknown.png
04:38:00FromDiscord<noow> and you don't accidentally have selinux or apparmor or something putting extra restrictions on gcc right
04:38:14FromDiscord<sOkam!> nope
04:39:36FromDiscord<sOkam!> selinux is not installed. apparmor is installed but I never touch it
04:39:59FromDiscord<sOkam!> not sure how to check thought, never used that app
04:40:01FromDiscord<noow> neither would confine gcc by default, unless your distro ships with a profile
04:40:10FromDiscord<Rika> it probably doesnt
04:40:14FromDiscord<Rika> its arch he says
04:40:15FromDiscord<sOkam!> i doubt arch ships with any profile
04:40:19FromDiscord<noow> if you really wanna check sudo aa-status should display all profiles being used
04:40:32FromDiscord<noow> also, to enable apparmor you'd need to add a kernel boot flag manually
04:41:02FromDiscord<sOkam!> module says loaded, filesystem not mounted
04:41:27FromDiscord<noow> then it's not interfering
04:43:52FromDiscord<sOkam!> I don't have this package installed because it's an older version. dunno if that has something to do with it https://media.discordapp.net/attachments/371759389889003532/941917498641637466/unknown.png
04:45:03FromDiscord<noow> maybe try expanding the ~ manually
04:45:10FromDiscord<noow> to /home/sokam
04:45:19FromDiscord<demotomohiro> `echo -I~` doesn't expand to home directory on my termux.
04:45:59FromDiscord<demotomohiro> `echo ~` works.
04:46:42FromDiscord<sOkam!> Well, it has changed definitely https://media.discordapp.net/attachments/371759389889003532/941918211308417034/unknown.png
04:48:59FromDiscord<demotomohiro> So you need to pass full path to -I option.
04:49:03FromDiscord<sOkam!> dunno what the new error means though, that thing it complains about was pregenerated by the compiler
04:49:19FromDiscord<noow> does nimbase.h get copied to the cache
04:49:23FromDiscord<sOkam!> In reply to @demotomohiro "So you need to": it seems
04:49:42FromDiscord<noow> (edit) "does nimbase.h get copied to the cache ... " added "and others"
04:50:14FromDiscord<noow> maybe some header files are both in .choosenim/toolchains/nim-1.6.4/lib and .cache/nim/lib_d ?
04:50:58FromDiscord<noow> what happens if you exclude the latter
04:52:03termerIs there anything like JavaScript's setTimeout and clearTimeout in async Nim? There's asyncdispatch.addTimer, but there doesn't seem to be any way to cancel it. My use-case here is a authentication timeout on an asychronous server
04:52:51FromDiscord<sOkam!> In reply to @noow "maybe some header files": https://media.discordapp.net/attachments/371759389889003532/941919760164220998/unknown.png
04:53:41FromDiscord<noow> hmmm the lib.h is there, which the guide mentions as being essential
04:54:06FromDiscord<noow> (edit) "there," => "there (in the cache),"
04:54:34FromDiscord<sOkam!> In reply to @noow "hmmm the lib.h is": the nim compilation outputs to the cache essentially
04:56:40FromDiscord<noow> yeah sorry
04:56:47FromDiscord<noow> i read the guide, and the lib.h is generated by it
04:56:58FromDiscord<noow> i am out of ideas sorry
04:59:31FromDiscord<haolian9 (高浩亮)> while reading about `std/asyncfile`, i found `openAsync` would block the whole thread; what if the file to be opened by `openAsync` lives in a power off (spin down?) disk? or is there an async wrapper on `open(2)` in nim?
05:00:12FromDiscord<demotomohiro> That error message says multiple .c file defines same global variable or function. Maybe excluding one of .c file fix it.
05:01:09FromDiscord<noow> maybe clear the cache and recompile
05:01:09FromDiscord<sOkam!> In reply to @demotomohiro "That error message says": https://media.discordapp.net/attachments/371759389889003532/941921850643054612/unknown.png
05:01:27FromDiscord<noow> (edit) "maybe clear the cache and recompile ... " added "with nim"
05:01:35FromDiscord<sOkam!> In reply to @noow "maybe clear the cache": will try again, i think i wiped it only when i was getting errors only
05:01:42FromDiscord<sOkam!> (edit) removed "only"
05:02:55FromDiscord<sOkam!> oh, now it worked 🧩
05:04:17FromDiscord<sOkam!> Yup :nod: https://media.discordapp.net/attachments/371759389889003532/941922640656994405/unknown.png
05:28:08FromDiscord<sOkam!> So now, having this `lib.h` file...↵What files do I need to store inside the engine so the bytecode compiler knows what to do with it?↵Is `nimbase.h` self contained, or does it link to more things internally that would need to be copied over too?
05:30:30FromDiscord<Rika> afaik self contained
05:31:32FromDiscord<sOkam!> Does compilation require the stuff that's output to the cache too? (other than the lib.h file that is)
05:31:50FromDiscord<Rika> the c file is there
05:44:40*ldlework quit (Remote host closed the connection)
05:46:01*hexeme joined #nim
07:04:01*rockcavera joined #nim
07:04:01*rockcavera quit (Changing host)
07:04:01*rockcavera joined #nim
07:06:25*hexeme is now known as ldlework
08:21:39*rockcavera quit (Remote host closed the connection)
08:47:38NimEventerNew Nimble package! dnd - Drag and drop source / target, see https://github.com/adokitkat/dnd
09:12:42FromDiscord<xx_ns> In reply to @NimEventer "New Nimble package! dnd": kinda neat actually
09:15:52*jmdaemon quit (Ping timeout: 256 seconds)
09:16:56*jmdaemon joined #nim
09:31:36*oddish joined #nim
09:33:31*jmdaemon quit (Ping timeout: 256 seconds)
09:34:44*jmdaemon joined #nim
09:38:45*oddish quit (Quit: nyaa~)
09:39:00*oddish joined #nim
09:45:53*krux02 joined #nim
10:01:09NimEventerNew post on r/nim by mavavilj: What are parts of nim that are immature?, see https://reddit.com/r/nim/comments/sqo7r7/what_are_parts_of_nim_that_are_immature/
10:05:14*jjido joined #nim
10:29:44NimEventerNew Nimble package! w8crc - Full-featured CRC library for Nim., see https://github.com/sumatoshi/w8crc
10:32:40FromDiscord<Rika> Cool
11:23:35FromDiscord<adokitkat> In reply to @xx_ns "kinda neat actually": thanks 😄
11:23:52FromDiscord<adokitkat> I want to make a post on nim forum about it today
11:23:58FromDiscord<adokitkat> i just need to update something
11:24:29FromDiscord<adokitkat> and I have a question about nimble
11:25:15FromDiscord<adokitkat> how can I define a symbol before `nimble install` (used by `nimble build`) ?
11:26:31FromDiscord<enthus1ast> @adokitkat\: i do not understand whats the purpose of this is yet \:)
11:28:01FromDiscord<adokitkat> if you mean the program, i'll make a post about it - but here is a video explaining the original program which inspired me https://www.youtube.com/watch?v=cbegEIczdNQ
11:29:15FromDiscord<adokitkat> In reply to @enthus1ast "<@216745055770116106>\: i do not": do you know how to force a symbol definition used by `nimble build` when installing something via `nimble install xxx` ?
11:30:04FromDiscord<enthus1ast> ah ok got it
11:30:56FromDiscord<enthus1ast> you mean you want to pass build flags?
11:31:01FromDiscord<adokitkat> yes
11:31:29FromDiscord<adokitkat> i want to know if someone install the program via nimble or via makefile
11:32:40FromDiscord<adokitkat> if I could you `before install:` in `.nimble` file it would be the best
11:34:13FromDiscord<enthus1ast> "Nim flags provided to nimble install will be forwarded to the compiler when building any binaries. Such compiler flags can be made persistent by using Nim configuration files."
11:34:17FromDiscord<enthus1ast> maybe this helps
11:34:41FromDiscord<adokitkat> I need the `nimble install dnd` to use my custom `--define:SYMBOL:VAL` automatically
11:34:53FromDiscord<adokitkat> do I need to use .cfg file?
11:35:01FromDiscord<enthus1ast> or nims i guess
11:35:24FromDiscord<enthus1ast> let me try it mom
11:37:50*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:44:54FromDiscord<enthus1ast> ok
11:44:56FromDiscord<enthus1ast> got it
11:44:58FromDiscord<enthus1ast> so\:
11:45:38FromDiscord<enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/942023640642375720/image.png
11:46:11FromDiscord<enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/942023778349748244/image.png
11:46:25FromDiscord<enthus1ast> then on nimble build it defines ii=5
11:47:35NimEventerNew post on r/nim by HiPhish: Nim for dynamic libraries?, see https://reddit.com/r/nim/comments/sqpspb/nim_for_dynamic_libraries/
11:47:44*jjido joined #nim
11:49:33FromDiscord<enthus1ast> @adokitkat\: hope you see the pics above
11:50:27FromDiscord<adokitkat> thanks
11:50:57FromDiscord<adokitkat> in nimble file i'll do something like
11:51:13FromDiscord<adokitkat> sent a code paste, see https://play.nim-lang.org/#ix=3PnT
11:52:44FromDiscord<enthus1ast> might work
11:52:57FromDiscord<enthus1ast> but i would use nim to remove the file
11:56:45FromDiscord<adokitkat> it says in nimscript removeFile doesnt work
11:57:29FromDiscord<enthus1ast> try rmFile
11:57:37FromDiscord<enthus1ast> https://nim-lang.org/docs/nimscript.html#rmFile%2Cstring
12:01:23FromDiscord<adokitkat> why is this not unified... A time ago I also found another weird think like this
12:01:28FromDiscord<adokitkat> readLine(stdin) is in Nim
12:01:54FromDiscord<enthus1ast> i honestly don't know
12:01:56FromDiscord<adokitkat> and readLineFromStdin() is in NimScript
12:02:44FromDiscord<enthus1ast> i can imagine, it's easier to do it like this because they're callbacks into the vm
12:04:40FromDiscord<Rika> Probably something to do with how stdin would be represented in nim script
12:04:53FromDiscord<demotomohiro> I guess, NimScript cannot use some procedures in stdlib implemented with C functions because NimScript cannot use C functions.
12:04:57*krux02 quit (Quit: Leaving)
12:05:06FromDiscord<Rika> Yes it cannot
12:05:08FromDiscord<Rika> I forgot that
12:05:15FromDiscord<Rika> FFI isn’t possible as of now
12:06:01*supakeen quit (Quit: WeeChat 3.4)
12:06:31*supakeen joined #nim
12:07:07FromDiscord<abdu> Anyone know how sublime can change Nim comment color ?
12:07:50FromDiscord<Rika> That’s more of a question about sublime than Nim
12:09:34*pro joined #nim
12:10:19FromDiscord<abdu> So sorry.. start over again↵Anyone know how change Nim comment color in SublimeNim plugin configuration on Sublime 4?
12:11:30FromDiscord<Rika> Honestly still think it’s more about sublime than Nim
12:11:48FromDiscord<Rika> Open the plugin code and check what defines the comment colour
12:12:10FromDiscord<Rika> Who was it that used sublime again
12:18:40FromDiscord<demotomohiro> According to Nim survey result, not many people use sublime.
12:18:42FromDiscord<demotomohiro> https://nim-lang.org/blog/2022/01/14/community-survey-results-2021.html
12:19:16FromDiscord<demotomohiro> You might better ask it to NimForum or Sublime forum.
12:22:02FromDiscord<abdu> Great. Thanks.. trying..
12:25:23FromDiscord<adokitkat> why cannot I use `before uninstall` hook in `.nimble` file?
12:25:34FromDiscord<adokitkat> (edit) "uninstall`" => "uninstall:`"
12:38:56*arkurious joined #nim
12:41:48*[RMS] is now known as [R]
12:54:09*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:01:24FromDiscord<adokitkat> In reply to @enthus1ast "<@216745055770116106>\: i do not": https://forum.nim-lang.org/t/8903 here's a forum post 😄
13:05:24FromDiscord<haolian9 (高浩亮)> is there an api like `await writable(AsyncSocket)`? i found `asyncdispatch.addWrite`, but it's not that intuitive to use for me.
13:14:17FromDiscord<haolian9 (高浩亮)> i have learnt how to use addWrite inspired by asyncdispatch.send, so i can make my own `await writable`; just ignore me
13:31:40*Gustavo6046 joined #nim
14:05:21FromDiscord<sOkam!> Those this apply to standalone nimscript files?↵I want to do something like `nim myscript.nims --option1:"thing" --option2:otherThing`, but I'm not really sure if `switch()` is meant for this?↵Is that the correct way of having parameters in a nims file? https://media.discordapp.net/attachments/371759389889003532/942058797361410068/unknown.png
14:05:26*jmdaemon quit (Ping timeout: 256 seconds)
14:06:20FromDiscord<sOkam!> (edit) "Those this apply to standalone nimscript files?↵I want to do something like `nim myscript.nims --option1:"thing" --option2:otherThing`, but I'm not really sure if `switch()` is meant for this?↵Is that the correct way of having parameters in a nims ... file?" added "standalone"
14:07:49FromDiscord<sOkam!> _its probably a dummy question, but I'm kinda confused by the wording sry_ 😔
14:21:44FromDiscord<haolian9 (高浩亮)> @\_discord\_186489007247589376\:t2bot.io IMO `switch` is for compiler, in your case `os.commandLineParams`, .paramCount, .paramStr should be used
14:42:54FromDiscord<sOkam!> is it possible to have named parameters by default, or do I have to code a string search in the paramter list/seq?
14:43:06FromDiscord<Schelz> Does anyone know why "DirectNimrod" test examples gives "Error: cannot open file: windows"
14:44:40FromDiscord<Rika> In reply to @sOkam! "is it possible to": what do you mean?
14:44:58FromDiscord<Rika> ah you mean named options?
14:45:39FromDiscord<Rika> you need to do the latter i believe
15:03:21FromDiscord<sOkam!> Hmmm, is this not how `os.commandLineParams` is meant to be used? 🤔 https://media.discordapp.net/attachments/371759389889003532/942073396362117150/unknown.png
15:03:41FromDiscord<Rika> it is in `os`
15:03:44FromDiscord<Rika> import `os`
15:04:22FromDiscord<sOkam!> oh sry, I commented it out for some testing. sry dummy checking out :KEKW:
15:21:24*pro quit (Quit: pro)
15:24:27FromDiscord<sOkam!> how do I get the number of items in a seq?↵`sizeof` says it returns the size in bytes 🤔
15:28:01FromDiscord<pointystick> len
15:28:05FromDiscord<pointystick> https://nim-lang.org/docs/system.html#len%2Cseq%5BT%5D
16:02:55NimEventerNew post on r/nim by pmihaylov: todocheck now supports Nim, see https://reddit.com/r/nim/comments/squmwi/todocheck_now_supports_nim/
16:42:20*pro joined #nim
17:12:55FromDiscord<DevNugget> Does using the `cpp` command when compiling generate a cpp file or does it generate cpp code and make it an executable?↵↵`nim cpp output.nim`
17:25:34*rockcavera joined #nim
17:25:34*rockcavera quit (Changing host)
17:25:34*rockcavera joined #nim
17:30:16FromDiscord<Elegantbeef> It generates C++ code it then compiles, so both? 😀↵(@DevNugget)
17:49:47FromDiscord<sOkam!> Not sure if I get this...↵I want to search inside a `@[]` for a specific string, so I can designate that string as a parameter (given in any order by the user) that defines behavior in the app↵Such as: `nim myscript.nims --param1:thing` does things defined by param1, but not by paramX↵Its this correct? In theory it is, but i'm just really confused understanding it https://media.discordapp.net/attachments/371759389889003532/9421152824
17:51:47FromDiscord<sOkam!> The confusing part is: how does any give the current seq element to the procedure? 🤔
17:51:57FromDiscord<sOkam!> (edit) "any" => "any()"
17:52:08FromDiscord<Elegantbeef> It iterates over it calling `pred`
17:52:23FromDiscord<Elegantbeef> Personally i'd do `commandLineParams.anyit(it == arg)`
17:52:44FromDiscord<sOkam!> why anyIt and not any?
17:52:46FromDiscord<Elegantbeef> well `commadnLineParams().`
17:54:12FromDiscord<sOkam!> ah wait, anyIt allows for redefining what you check, vs being forced to use the iterator?
17:54:21FromDiscord<sOkam!> (edit) "anyIt" => "any()"
17:54:31FromDiscord<sOkam!> (edit) "iterator?" => "iterator like anyIt()?"
17:57:30FromDiscord<haxscramper> `anyIt` is not an iterator, it is a template that unfolds into `for` loop that does the checking
17:57:50FromDiscord<haxscramper> and for `seq[T]` and `T` there is an `in
17:58:00FromDiscord<haxscramper> !eval echo 1 in [2, 3, 5]
17:58:02NimBotfalse
17:58:09FromDiscord<haxscramper> !eval echo 1 in [1, 3]
17:58:11NimBottrue
17:58:25FromDiscord<Elegantbeef> Oh right they're just checking if the container contains arg
18:01:22FromDiscord<sOkam!> In reply to @haxscramper "and for `seq[T]` and": genius. ty
18:03:09FromDiscord<sOkam!> how do I return that specific seq item that matches `arg` after that?↵is `filter( ... )` a good choice, or is there a better method?
18:04:12FromDiscord<Elegantbeef> `commandLineParams().find(arg)`
18:04:23FromDiscord<Elegantbeef> returns -1 if it's not in the collection
18:09:33FromDiscord<haxscramper> `imports std/[macros, typetraits]`
18:09:36FromDiscord<haxscramper> start with that
18:10:33FromDiscord<sOkam!> why those exactly? they are quite big libs, not sure where to look
18:12:45FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3PpF
18:14:27FromDiscord<sOkam!> i understand that right now its not looking for param, but for the whole string with a hardcoded thing, not a wildcard thing. that's what I'm trying to figure out
18:14:32FromDiscord<haxscramper> or something like that
18:14:35FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3PpH
18:14:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PpI
18:15:19FromDiscord<haxscramper> or, if you need to find if param contains substring, you do
18:15:42FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3PpM
18:15:57FromDiscord<Elegantbeef> There's also the optparser
18:15:58FromDiscord<haxscramper> !eval import std/strutils; echo "--param" in "--param:test"
18:16:01NimBottrue
18:16:24FromDiscord<haxscramper> https://nim-lang.org/docs/parseopt.html#parsing yeah this as well
18:16:27FromDiscord<sOkam!> In reply to @haxscramper "!eval import std/strutils; echo": oh
18:18:29FromDiscord<sOkam!> In reply to @haxscramper "https://nim-lang.org/docs/parseopt.html#parsing ye": oh that's exactly what I needed. tysm 🍀
18:19:13FromDiscord<sOkam!> also ty beef. you guys always save my ass so much :shy:
18:25:50FromDiscord<sOkam!> Is there a simple way to store every element of a sequence into the same string?
18:26:11FromDiscord<sOkam!> like something in the libraries already that I'm missing. or do I do it manually?
18:26:12FromDiscord<Elegantbeef> `strutils.join`?
18:27:01FromDiscord<haxscramper> https://nim-lang.org/docs/parseopt.html#initOptParser%2Cseq%5Bstring%5D%2Cset%5Bchar%5D%2Cseq%5Bstring%5D use this overload
18:27:15FromDiscord<sOkam!> ah this seems to be https://media.discordapp.net/attachments/371759389889003532/942124706306326548/unknown.png
18:27:30FromDiscord<haxscramper> this sickening API that forces you to join cmdline arguments is not something you should adapt to
18:28:02FromDiscord<sOkam!> In reply to @haxscramper "https://nim-lang.org/docs/parseopt.html#initOptPars": missed that one
18:54:17NimEventerNew Nimble package! discord.nim - Powerful wrapper for Discord's API built in Nim, see https://github.com/nolanplatt/discord.nim
18:55:50FromDiscord<haxscramper> https://github.com/nolanplatt/discord.nim/blob/main/discord.nim/examples/basic.nim
18:56:02FromDiscord<Elegantbeef> Was going to say
18:56:43FromDiscord<Elegantbeef> Completely empty repo parking on the package name atm 😀
19:01:54FromDiscord<huantian> the hackathon it mentions goes from 11th-13th so perhaps its not done?
19:03:59FromDiscord<haxscramper> why publish empty package though
19:05:12FromDiscord<demotomohiro> You can register your project to nimble without implementation?
19:05:30FromDiscord<haxscramper> projects are not checked for anything
19:05:35FromDiscord<huantian> I think you just need the .nimble file
19:05:54FromDiscord<haxscramper> there are a few projects that were rewritten to go later on, 404s, missing packages
19:06:04FromDiscord<haxscramper> several with "propriatary" licensese
19:06:06FromDiscord<haxscramper> (edit) "licensese" => "license"
19:06:11FromDiscord<haxscramper> whatever that actually means
19:06:47FromDiscord<haxscramper> https://github.com/nim-lang/packages/pull/1954
19:06:55FromDiscord<Elegantbeef> Sure, why add it to the package registry?
19:08:08FromDiscord<Elegantbeef> I dont see why someone would go out of their way to add a package for an "empty" repo
19:09:06FromDiscord<Elegantbeef> Then again i have multiple packages i dont feel are useful to be published there so what do i know
19:09:16FromDiscord<Elegantbeef> It took me forever to get slicerator to the point I felt it made sense to add
19:11:13FromDiscord<haxscramper> I actually want to take down all of my packages
19:11:27FromDiscord<haxscramper> or at least quite a few of them
19:32:02*jmdaemon joined #nim
19:41:46*jjido joined #nim
20:10:41FromDiscord<dom96> haha, that mad lad with the `discord.nim` package name
20:23:35FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Pqj
20:24:19FromDiscord<Elegantbeef> no
20:24:45FromDiscord<Elegantbeef> `if condition == "t" or condition == "thing"`
20:25:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Pqk
20:25:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Pql
20:26:48FromDiscord<Elegantbeef> you could of course also do `if condition in ["t", "thing"]` there are 9000 different ways of doing it
20:26:58FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3Pqm
20:27:02FromDiscord<Elegantbeef> No
20:27:16FromDiscord<sOkam!> 😔
20:27:33FromDiscord<demotomohiro> !eval let v = "t"; echo t in ["t", "thing"]
20:27:34NimBotCompile failed: /usercode/in.nim(1, 19) Error: undeclared identifier: 't'
20:27:40FromDiscord<sOkam!> `in` it is, then
20:27:42FromDiscord<Elegantbeef> Well that doesnt make since you need to have an `else` branch for case
20:27:44FromDiscord<sOkam!> oh wait
20:28:05FromDiscord<Elegantbeef> case statements in Nim have to be exhaustive
20:28:41FromDiscord<demotomohiro> !eval let v = "t"; echo v in ["t", "thing"]
20:28:43NimBottrue
20:42:41*neurocyte0917090 joined #nim
20:44:07*pro quit (Quit: pro)
20:44:26FromDiscord<sOkam!> How can I read an input from the user from cli during nimscript runtime?↵something like `read -r thing` in bash
20:45:18FromDiscord<Elegantbeef> Dont think nimscript has readline
20:46:07FromDiscord<sOkam!> would need to be an exec maybe, in that case?
20:46:37FromDiscord<Elegantbeef> Probably
20:47:00FromDiscord<sOkam!> how would it be done if compiled?
20:47:25FromDiscord<Elegantbeef> `stdin.readLine` or `std/rdStdin`
20:47:46*neurocyte0917090 quit (Read error: Connection reset by peer)
20:48:33*neurocyte0917090 joined #nim
20:48:58FromDiscord<sOkam!> found this 🤔 https://media.discordapp.net/attachments/371759389889003532/942160376437551164/unknown.png
20:49:33*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
20:50:32FromDiscord<sOkam!> this one maybe? https://media.discordapp.net/attachments/371759389889003532/942160772744757319/unknown.png
20:51:07FromDiscord<Elegantbeef> `stdin.readLine` will work
20:54:14FromDiscord<sOkam!> any differences from `stdin.readLine` to `readLineFromStdin()` i should be mindful of?
20:56:14*jmdaemon joined #nim
21:00:30FromDiscord<demotomohiro> I tried `echo stdin.readLine` in nimscript, but Nim says `stdin` is undeclared identifier.
21:02:34FromDiscord<demotomohiro> `echo readLineFromStdin()` works in nimscript.
21:03:41*neurocyte0917090 quit (Ping timeout: 245 seconds)
21:09:43FromDiscord<demotomohiro> Here is why: https://github.com/nim-lang/Nim/issues/3983
21:13:59*neurocyte0917090 joined #nim
21:18:31FromDiscord<ynfle> @treeform is hottie supposed to work on Mac? You have a source file for it, but it's not mentioned in the readme
21:23:29*sagax quit (Quit: Konversation terminated!)
21:49:18*neurocyte0917090 quit (Ping timeout: 272 seconds)
22:06:44FromDiscord<sOkam!> man, nimscript is SO much better than bash for what I'm doing 😮↵I love it!! :nim1:
22:07:30*tiorock joined #nim
22:07:30*tiorock quit (Changing host)
22:07:30*tiorock joined #nim
22:07:30*rockcavera is now known as Guest6293
22:07:30*tiorock is now known as rockcavera
22:10:41FromDiscord<Evrensel Kişilik> soooooooooooooooooooooooooooo
22:10:45FromDiscord<Evrensel Kişilik> https://github.com/rohanrhu/gdb-frontend/releases/tag/v0.10.3-beta
22:10:47*Guest6293 quit (Ping timeout: 250 seconds)
22:10:51FromDiscord<Evrensel Kişilik> new version is available
22:15:25FromDiscord<sOkam!> In reply to @Evrensel Kişilik "https://github.com/rohanrhu/gdb-frontend/releases/t": holy crap, didn't know this existed. it looks amazing!
22:15:39FromDiscord<Evrensel Kişilik> In reply to @sOkam! "holy crap, didn't know": thank youuu
22:17:57FromDiscord<konsumlamm> is there something like `memmove` (from C) in the stdlib? or should i just copy elements one by one?
22:18:51FromDiscord<ynfle> In reply to @konsumlamm "is there something like": https://nim-lang.org/docs/system.html#moveMem%2Cpointer%2Cpointer%2CNatural
22:19:06FromDiscord<konsumlamm> ah, thanks
22:22:35*rockcavera quit (Remote host closed the connection)
22:24:37FromDiscord<Elegantbeef> Hottie requires some funky stuff to work on mac afaik↵(@ynfle)
22:25:15FromDiscord<ynfle> In reply to @Elegantbeef "Hottie requires some funky": Any idea what?
22:25:35FromDiscord<ynfle> By the way, https://github.com/mratsim/constantine/blob/master/metering it really good as well
22:26:09FromDiscord<Elegantbeef> Search for hottie in the discord logs it should pop up somewhere
22:26:14nrds<susan/freenode99> <rasengan> We have to drain this swamp
22:26:14nrds<susan/freenode99> <rasengan> Classic tried to go on for the sake of the community, but the community has made it loud and clear-they want freenode classic to end, today!
22:26:17nrds<susan/freenode99> <rasengan> #MFGA
22:27:56nrds<Prestige99> damn spammers
22:28:07FromDiscord<konsumlamm> what's the point even?
22:28:15nrds<Prestige99> Good question
22:28:18FromDiscord<konsumlamm> it's the same message over and over again
22:28:46FromDiscord<Elegantbeef> Hey if you cant swing your dick around in IRC where can you?!
22:29:05FromDiscord<konsumlamm> the community also wanted freenode classic to end, today, a few weeks ago
22:29:31nrds<Prestige99> It's old old news, people still coming onto other networks and spamming about it
22:29:34FromDiscord<ynfle> In reply to @Elegantbeef "Search for hottie in": I did, but only that it doesn't work
22:55:12FromDiscord<dom96> no spam on Libera it seems, maybe time to switch?
22:55:38*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
22:55:42FromDiscord<Elegantbeef> Says the guy on discord 😛
22:58:29*jmdaemon joined #nim
23:02:44FromDiscord<dom96> I've done my time on IRC
23:11:14madpropsinterestgin beef name
23:11:27madpropsbeefy repo
23:11:27FromDiscord<Elegantbeef> What?
23:11:38madpropshttps://github.com/beef331/traitor
23:11:50FromDiscord<Elegantbeef> Ah thank rika for that name
23:11:59madpropslol
23:12:12FromDiscord<Elegantbeef> I was using nimterface but rika suggested traitor and i liked it
23:12:41madpropswhy does it make sense?
23:12:55FromDiscord<Elegantbeef> cause it's a `trait` like system
23:13:11madpropsahhh
23:13:20madpropsclever
23:14:47FromDiscord<Elegantbeef> It has two parts it has the ensuring all types that implement a concept implements all the procedures and it also has the dynamic dispatch using a vtable like thijng
23:14:50FromDiscord<Elegantbeef> thing even
23:16:51FromDiscord<Elegantbeef> The only issue i have right now is trying to create the converters for a given type, there are a lot of permuations so i'm thinking about making a `x.implConv(BoundObject, DuckObject)` which emits all the permutations of that type so `Bound` `Duck` Bound, Duck\`
23:17:21FromDiscord<Elegantbeef> Again i fucked up permutation for combination i think
23:19:40FromDiscord<Elegantbeef> Cause this is just ugggggly https://github.com/beef331/traitor/blob/master/test.nim#L62-L66
23:20:01FromDiscord<Elegantbeef> perhaps `valA as [BoundObject, DuckObject]` is a nice API for the explicit method, idk
23:47:46FromDiscord<abdu> How do we convert array to boolean type
23:51:57FromDiscord<ynfle> Example?
23:52:25FromDiscord<ynfle> In reply to @abdu "How do we convert": What are you trying to do?
23:55:53*enyc joined #nim
23:59:48*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)