<< 06-11-2021 >>

00:20:44FromDiscord<IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3E9I
00:22:42FromDiscord<Elegantbeef> You can cheat
00:23:00FromDiscord<Elegantbeef> `proc identity(_: typedesc[Matrix4Type]): Matrix4Type`
00:23:19FromDiscord<IsaacPaul> oh hmm..
00:23:37FromDiscord<Elegantbeef> You then Can do the exact syntax you want
00:24:04FromDiscord<IsaacPaul> are there any drawbacks to this cheat? or can I do with no repercussions? lol
00:24:13FromDiscord<Elegantbeef> There are no drawbacks
00:24:35FromDiscord<IsaacPaul> Alright sounds good to me haha
00:24:39FromDiscord<Elegantbeef> You can even do it with `init` and `new` to be more generic supporting
00:25:10FromDiscord<IsaacPaul> That's pretty cool
01:59:59*krux02 quit (Remote host closed the connection)
03:06:41*vicecea quit (Remote host closed the connection)
03:07:16*vicecea joined #nim
03:15:06*Onionhammer quit (Quit: Ping timeout (120 seconds))
03:15:24*Onionhammer joined #nim
03:40:06*arkurious quit (Quit: Leaving)
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:31*supakeen joined #nim
04:15:24nrds<Prestige99> Why was cuint deprecated btw, is it just cint now?
04:16:58FromDiscord<Elegantbeef> Who said it was deprecated?
04:18:00nrds<Prestige99> oh I meant cuchar
04:18:10nrds<Prestige99> build warnings I'm seeing with 1.6
04:18:29FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#cuchar
05:07:26FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3Eai
05:08:26FromDiscord<Elegantbeef> does `nodecl` help?
05:08:34FromDiscord<impbox [ftsf]> just about to test that
05:08:42FromDiscord<impbox [ftsf]> seems like it might be the thing
05:09:10FromDiscord<Elegantbeef> the cdecl might be the issue
05:09:17FromDiscord<impbox [ftsf]> for some reason i assumed importc would not generate C code for it since it presumably already exists in C
05:09:31FromDiscord<impbox [ftsf]> nah was the same without cdecl, except it was then nimcall
05:09:38FromDiscord<impbox [ftsf]> but it compiled with nodecl \o/
05:09:46FromDiscord<Elegantbeef> It shouldnt, so it's odd that it does
05:15:20FromDiscord<reilly> In reply to @Elegantbeef "https://nim-lang.org/docs/system.html#cuchar": Wow, deprecated twice, harsh
05:19:08*robertmeta quit (Ping timeout: 260 seconds)
05:19:44*ormiret quit (Ping timeout: 268 seconds)
05:20:35*robertmeta joined #nim
05:20:49*euantorano_ joined #nim
05:20:55*euantorano quit (Ping timeout: 260 seconds)
05:20:55*euantorano_ is now known as euantorano
05:21:48*ormiret joined #nim
05:38:10FromDiscord<huantian> but one is boldly deprecated
06:02:02FromDiscord<Rika> It’s so deprecated it had to be deprecated twice
06:31:37NimEventerNew thread by Cusaint: Indentation in Nim, see https://forum.nim-lang.org/t/8596
06:36:12FromDiscord<Rika> not again
06:38:53FromDiscord<Ricky Spanish> Pretty sure can just auto format the vast majority of the time not really seeing why this is a topic tbh
06:41:55FromDiscord<Ricky Spanish> Anyway, if I want to replicate a local nim environment to scale up a number of dev machines do I just need to copy my nim cache folder? I want that my locally compiled packages etc don't need recompiled if I basically create a new dev machine using terraform, I. E machine from scratch per build but with a cloned cache but I'm unsure if it's more complex than this from nims side
06:41:58FromDiscord<Elegantbeef> People like talking about two things Nim has
06:42:05FromDiscord<Elegantbeef> And neither are important
06:42:29FromDiscord<Elegantbeef> It's always "space indentation sucks" and "style insensitivity is scary"
06:44:03FromDiscord<Ricky Spanish> True, close third also has to be why does nim exist when there's rust
06:46:05FromDiscord<Rika> why does rust exist when theres spark/erlang/every other language
06:46:42FromDiscord<Ricky Spanish> Agreed, same for all languages, there's ada guys we don't need c
06:47:06FromDiscord<Rika> im gonna legitimately get pissed off again if i continue thinking about this
06:47:26FromDiscord<Elegantbeef> Except that ada statement is just true 😛
06:47:54FromDiscord<Rika> are you talking about me or ricky
06:48:22FromDiscord<Elegantbeef> Well only one of you mentioned ada
06:48:56FromDiscord<Rika> spark -> ada.spark
06:49:24FromDiscord<Rika> https://en.wikipedia.org/wiki/SPARK_(programming_language)
06:49:46FromDiscord<Rika> "if you want safety so bad why dont you use a formally proven language"
06:53:49FromDiscord<Ricky Spanish> Good point actually doesent come up much in those conversations you read just usually devolves into screaming about borrow checkers versus some once encountered edge case they discovered. Like a cult member talking about their life before and after they joined
06:54:55FromDiscord<Rika> yeah so best not to further discuss
06:56:06FromDiscord<Ricky Spanish> Agreed, so any advice on the nim cache problem? Can I just dump my cache on another machine?
06:56:27FromDiscord<Rika> i dont think
06:56:31FromDiscord<Rika> you can just do that
06:56:35FromDiscord<Rika> are they the same arch>
06:56:58FromDiscord<Ricky Spanish> Yeh same everything in basically spinning up an Ubuntu image with same arch and specs
06:57:01FromDiscord<Rika> i guess it doesnt hurt to try, see if you get errors and if you do wipe the c cache (keep the packages tho)
06:57:53FromDiscord<Ricky Spanish> OK will give it a go thanks
06:59:42FromDiscord<Rika> if theyre all the same like that then i assume its fine, but if OS or whatever differs that would deffo need recompile
06:59:55FromDiscord<Rika> because of conditional compilation
09:50:15FromDiscord<sealmove> IC already works on devel for default --gc?
10:01:49FromDiscord<ratapenado> One of the main Godot "advertiser" is looking for feedback about nim (and other languages) if someone is interested
10:02:22FromDiscord<sealmove> more concretely? what is he looking for?
10:18:27FromDiscord<ratapenado> In reply to @รєคɭ๓๏שє "more concretely? what is": Sorry I forgot the link to his tweet https://twitter.com/NathanGDQuest/status/1456743208071974916?t=3nG4t4vR430cM33xpDJpiQ&s=19
10:20:09FromDiscord<cuddlefish> sent a code paste, see https://play.nim-lang.org/#ix=3EaW
10:20:53FromDiscord<cuddlefish> I am getting errors. The node I am looking at is `Ident "moduleA"` but when I do `getImpl` I get this error: `Error: node is not a symbol`
10:25:04FromDiscord<Rika> Probably needs a typed macro and not an untyped one
10:25:46FromDiscord<cuddlefish> What would the type look like?
10:26:21FromDiscord<Rika> “typed” instead of “untyped”
10:27:16FromDiscord<cuddlefish> Ah, yes. I just did that but I'm still getting errors :thinkeyes: One second
10:29:01FromDiscord<cuddlefish> Hm so when I use `typed` then `getImpl` doesn't error, but it results in a `NilLit`
10:29:45FromDiscord<cuddlefish> which is weird, since the module is not empty. I guess it's not possible to get the implementation of modules then?
10:32:21FromDiscord<Rika> I think so yes
10:32:32FromDiscord<Rika> You usually get the implementation of functions in the module
10:33:14FromDiscord<cuddlefish> Darn, I wanted to have a macro that looks for certain patterns in proc names in modules and generate objects based on that
10:33:56FromDiscord<cuddlefish> so you don't have to write code for this in every module but just have one central macro that does it all. I guess I'll have to find a different way to do it :)
10:35:06FromDiscord<cuddlefish> Is there another way to look through the procs of a file without having to write all the code within a macro?
10:35:21FromDiscord<xflywind> https://github.com/nim-lang/Nim/pull/9560
10:35:23FromDiscord<xflywind> ^
10:38:02FromDiscord<cuddlefish> Using `parseStmt(readFile(..))` seems interesting, I'll try that one
11:12:46FromDiscord<dom96> In reply to @ratapenado "Sorry I forgot the": thank you for linking to this )
11:12:47FromDiscord<dom96> (edit) ")" => "🙂"
11:25:20*Vladar joined #nim
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:32*supakeen joined #nim
12:47:40*terminalpusher joined #nim
12:47:44terminalpusherdoes Nim depend on libc?
12:53:13terminalpusherIt compiles to C. Does it call the syscalls manually or does it depend on libc and do it with that?
13:19:43FromDiscord<Rika> yes
13:19:53FromDiscord<Rika> afaik
13:37:03FromDiscord<dom96> yeah, can confirm
13:37:28FromDiscord<exelotl> Unless you use --os:standalone
13:38:04FromDiscord<dom96> do we have any docs about --os:standalone vs. --os:any
13:38:08FromDiscord<dom96> still confused by these
13:49:27FromDiscord<exelotl> I think it's like, --os:any supports every language feature using only a few standard C functions. --os:standalone doesnt use the C stdlib at all, and you're on your own (in more ways than one, as it's pretty much unmaintained) e.g. exceptions don't work.
13:53:28FromDiscord<exelotl> As I see it, --os:standalone --gc:none is still necessary if you want to write a kernel or something else where you have 100% control over allocations
14:05:38*Amun-Ra quit (Ping timeout: 246 seconds)
14:33:08FromDiscord<tandy> what does the `(a, b)` part mean in the return value?↵`proc `==`(a, b: Position): bool = system.`==`(a, b) or (a.i == b.i)`
14:33:16FromDiscord<tandy> i have to have it there otherwise it errors out
14:34:16FromDiscord<tandy> is it to check if youre passing the same object as both a and b?
14:35:34FromDiscord<hotdog> In reply to @tandy "is it to check": Is position a ref or plain object?
14:35:54FromDiscord<Rika> tandy: where?
14:36:07FromDiscord<tandy> ref i think↵(@hotdog)
14:36:13FromDiscord<tandy> `==(a, b) or (a.i == b.i)`
14:36:19FromDiscord<Rika> wait im rewriting it
14:36:45FromDiscord<hotdog> Then the first part will check if the refs are equal. Like if they’re pointing to the same thing
14:36:52FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Ec3
14:37:25FromDiscord<Rika> the first part just uses `system`'s `==`
14:37:31FromDiscord<Rika> explicitly
14:37:59FromDiscord<hotdog> Yeah ^
14:38:13FromDiscord<tandy> yee okay so this
14:38:38FromDiscord<tandy> tyty
14:38:41FromDiscord<Rika> i guess
14:44:12FromDiscord<tandy> someting strange is happening
14:44:24FromDiscord<tandy> i have an if statement `if bestPosition.score < position.score:`
14:44:58FromDiscord<tandy> sometimes it goes thru even if `bestPosition.score = 0` and `position.score = 0`
14:45:04FromDiscord<tandy> how is that possible
14:45:52FromDiscord<tandy> same thing is happening when i use `>`
14:46:03FromDiscord<Rika> how are you debugging that
14:47:39FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3Ec5
14:47:55FromDiscord<tandy> just an echo with some stuff inbetween to print the object
14:48:33FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3Ec7
14:48:45FromDiscord<el__maco> could be a stupid question but shouldn't the echo be before you set bestPosition equal to position
14:49:18*Amun-Ra joined #nim
14:52:02FromDiscord<Rika> yeahhh
14:52:09FromDiscord<Rika> sorry i was doing something
15:27:45FromDiscord<sealmove> hello, can someone help me with travis?
15:34:36FromDiscord<sealmove> I have this .travis.yml https://termbin.com/okpk
15:39:03FromDiscord<sealmove> and an `install:` script which does this: https://termbin.com/nf9w
15:39:38FromDiscord<sealmove> the problem is that this takes some times to complete since it downloads and builds nim every time the job is run
15:39:59FromDiscord<sealmove> is it possible to use a prebuilt image that already has nim installed?
15:40:12*krux02 joined #nim
15:40:33FromDiscord<sealmove> and replace the `dist` in the yml files with it, instead of using `bionic`?
15:40:50FromDiscord<sealmove> or is there another solution?
15:46:25*arkurious joined #nim
16:36:35FromDiscord<dom96> Just realised the "Announcements" category on Nim forum is a pretty good way to see our community's amazing projects: https://forum.nim-lang.org/c/1
16:37:44FromDiscord<sealmove> what should I run instead of ./build_all to skip everything except the compiler (nimsuggest etc)
16:38:23FromDiscord<dom96> @sealmove I'd recommend both avoiding Travis and using choosenim
16:38:39FromDiscord<dom96> Here is a great script that does it for GH actions: https://github.com/iffy/install-nim
16:38:45FromDiscord<sealmove> dom I wish. The project I'm working on already uses Travis
16:42:01FromDiscord<dom96> well then maybe at least you can port that script to travis
16:42:49FromDiscord<sealmove> thanks dom
17:28:11FromDiscord<willyboar> In reply to @dom96 "Just realised the "Announcements"": It would be nice to create a separate show nim tag
17:28:18*terminalpusher quit (Remote host closed the connection)
17:28:40FromDiscord<dom96> agreed, I need to reorganise all the categories a bit.
17:28:57FromDiscord<dom96> (which requires DB access so I've been putting it off)
17:29:45FromDiscord<willyboar> or write an admin panel 😆
17:31:27FromDiscord<dom96> yeah, we have one, it just needs more features
17:45:44FromDiscord<salt rock lamp> why is nim telling me that stdin is not a declared identifier? this program compiled and ran just fine \~2 weeks ago, and i don't think i updated or changed anything in that time. is my nim installation corrupted somehow? i'm using choosenim, so it shouldn't be hard to reinstall, but i'd like to understand what is actually happening here. https://bpa.st/T3HQ
17:46:34FromDiscord<salt rock lamp> sent a code paste, see https://play.nim-lang.org/#ix=3Edq
17:53:06FromDiscord<dom96> the fact you're running it as a .nims file is suspicious
17:53:45FromDiscord<dom96> !eval echo(type(stdin))
17:53:47NimBotFile
17:54:10FromDiscord<dom96> when in doubt, try the simplest example and see if it compiles for you
17:54:24FromDiscord<sealmove> for testament, must the `discard """ ... """` thingy be at the first row?
17:54:34FromDiscord<dom96> (without the shebang)
18:13:31FromDiscord<salt rock lamp> @dom96\: i removing the shebang doesn't make a difference, nor does changing the file extension between `.nim` and `.nims`
18:13:32FromDiscord<salt rock lamp> @dom96\: removing the shebang doesn't make a difference, nor does changing the file extension between `.nim` and `.nims`
18:15:40FromDiscord<codic> So for some reason it fails to link it
18:15:42FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3Edy
18:15:57FromDiscord<codic> But the first line of my binding is `{.compile: "duktape.c".}`, and symbol is defined there
18:16:17FromDiscord<codic> Oh nvm
18:16:24FromDiscord<codic> that symbol is a macro
19:10:49*neurocyte0132889 joined #nim
19:10:49*neurocyte0132889 quit (Changing host)
19:10:49*neurocyte0132889 joined #nim
19:33:20FromDiscord<yyoncho> sent a long message, see http://ix.io/3Ee2
19:38:03FromDiscord<Rika> did you import chronos/asyncdispatch before including it?
19:38:10FromDiscord<Rika> also why are you including it?
19:40:48FromDiscord<yyoncho> @Rika I will try it. I want to use `asyncPipeInput` for async input stream processing.
19:41:14FromDiscord<Rika> i mean
19:41:20FromDiscord<Rika> why are you including instead of importing
19:42:14FromDiscord<yyoncho> I am importing it(I am new to nim terminology)
19:47:05FromDiscord<Recruit_main707> we have an `inlcude` keyword that is similar to import but its actually the same as coying and pasting the file contents in another file
19:48:03FromDiscord<Elegantbeef> include even
19:53:44FromDiscord<yyoncho> In reply to @Rika "did you import chronos/asyncdispatch": Not sure if I am reading this correctly. Am I supposed to import `chronos/asyncdispatch`? I was unable to find that. I tried importing asyncdispatch, but still I am getting the same error. This is what my code is limited to:↵↵> import asyncdispatch, faststreams/asynctools_adapters
19:55:42FromDiscord<Recruit_main707> yeah, when you said include Rika thought you were doing something else, thats it i think, if you had included and imported it you would have had some kind of error because you would be redefining stuff
19:55:43FromDiscord<dom96> seems like a bug in faststreams to me
20:21:35NimEventerNew thread by Gcao: Dynlib passing value back to main app causes SIGSEGV error, see https://forum.nim-lang.org/t/8598
21:02:41FromDiscord<JohnAD (John Dupuy)> So, if designing a new collection type (a ref object) that uses bracketed assignment (`[]=`), then that proc will need to be {.inline.} so that it can recursively pass by ref when being chained. So, if doing `a["foo"]["bar"] = "99"` then a simple proc with a `var` first param won't cut it because the ref won't be passed back properly. Sound correct?
21:04:20FromDiscord<Elegantbeef> I believe as long as you have a `[]` operator which returns `var` it should be fine
21:04:36FromDiscord<Elegantbeef> Based of the subject matter i assume this is in some reference to https://forum.nim-lang.org/t/8568 😀
21:07:47FromDiscord<JohnAD (John Dupuy)> I didn't know of that thread. I'll read through it. I'll also experiment with changing my `[]` operators. To honest, I don't fully understand the impact of `{.inline.}`, so I'm reluctant to use it. Does it essentially make the proc an ad-hoc template?
21:08:04FromDiscord<Elegantbeef> If the C compiler rules it should be yes
21:08:26FromDiscord<Elegantbeef> It's not a guarantee just basically saying to the C compiler "Hey if possible can we make this pasted"
21:08:55FromDiscord<Elegantbeef> So in the end if it cannot be inlined it's no big deal since there is no forced inline aside from templates in nim
21:10:16FromDiscord<JohnAD (John Dupuy)> Ah, so using `inline` could subtly kick me in the butt later in complex scenarios. I'll look at changing the getter `[]` ops instead.
21:10:56FromDiscord<Elegantbeef> I dont think so, since the C compiler will not inline code in such a away to change the overall logic
21:11:14FromDiscord<Elegantbeef> But it also does tend to inline small procedures afaik
21:11:35*xet7 quit (Ping timeout: 260 seconds)
21:11:41FromDiscord<JohnAD (John Dupuy)> Good to know. Thanks for the help!
21:11:42FromDiscord<Elegantbeef> Depends on your compiler flags for that though, obviously inline isnt done in the fast/debug builds
21:11:57FromDiscord<Elegantbeef> No problem
21:13:50NimEventerNew thread by Elcritch: Show Nim: Nephyr a Nim wrapper for Zephyr RTOS! , see https://forum.nim-lang.org/t/8599
21:23:25*xet7 joined #nim
21:33:22*skrzyp quit (Ping timeout: 260 seconds)
21:55:37*Vladar quit (Quit: Leaving)
21:57:29FromDiscord<cuddlefish> How can I add a compiler switch in my package? I want to download data via HTTPS in a library function, so I need `--d:ssl` but I don't know how to make it work in the `.nimble` file
21:57:46FromDiscord<cuddlefish> if I pass `--d:ssl` on the command line it works, but I'd like this to be hidden
21:57:59FromDiscord<enthus1ast> you can create a yourFile.nims file
21:58:17FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3EeP
21:59:27FromDiscord<enthus1ast> pardon
21:59:44FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3EeQ
22:00:41FromDiscord<cuddlefish> Hmm I tried putting that in `src/nimble.nim.cfg` (also `--d:ssl`) and it doesn't work in the nimble file either
22:00:55FromDiscord<cuddlefish> can I just slap a `.nims` file in my `src` and it will work magically?
22:01:10FromDiscord<cuddlefish> I have never worked with nims files before, I'm still pretty new to Nim in general
22:01:15FromDiscord<enthus1ast> sent a long message, see http://ix.io/3EeU
22:01:26FromDiscord<enthus1ast> then it is picked up automatically
22:02:11FromDiscord<cuddlefish> Hm it doesn't seem to work when I use `nimble test --verbose` at least, the flag doesn't show up
22:06:39FromDiscord<enthus1ast> i do not know how nimble test work, i use testament for testing
22:07:03FromDiscord<enthus1ast> but this enables ssl for normal compilation
22:07:38FromDiscord<cuddlefish> Ok thank you, I just added it to the test nims file for now and I'll test if it works in normal compilation too
22:57:23FromDiscord<that_dude> Is there a way I can "intercept" a proc call from another file/module? I want to be able to echo some debug information about it when it gets called
22:57:37FromDiscord<that_dude> The other proc is exported if that matters
23:02:02FromDiscord<impbox [ftsf]> Can you just edit the other module?
23:03:23FromDiscord<that_dude> No because I simplified my example here. There is functionality that I would be able to add to a proc that does not belong in the other module
23:05:00FromDiscord<impbox [ftsf]> I don't think you can do that, you could modify it for the current module with a template, but it won't help if it's used by other modules
23:06:25FromDiscord<that_dude> Yeah, its used internally in the module I don't want to change, but the main module needs to do some extra stuff when that proc gets called
23:06:36FromDiscord<that_dude> F
23:26:07FromDiscord<dom96> In reply to @cuddlefish "Hm it doesn't seem": for your tests: `echo "--d:ssl" > tests/nim.cfg` should work
23:26:19FromDiscord<dom96> (edit) ""--d:ssl"" => ""-d:ssl""
23:27:17FromDiscord<cuddlefish> In reply to @dom96 "for your tests: `echo": Yes I just added the switch to the tests cfg too, it works now, I just expected it to take it from the "main package" config
23:28:43FromDiscord<dom96> nim just looks for config files in the directory the file you are compiling is in
23:29:02FromDiscord<dom96> it doesn't check parent dirs and Nimble isn't aware of these config files at all
23:29:20FromDiscord<dom96> so yeah, no magic there
23:39:47FromDiscord<retkid> hey so i need to compile to JS But i cant find a good socket solution
23:40:41FromDiscord<dom96> what do you intend to use the sockets for?
23:42:00FromDiscord<retkid> sending and receiving
23:42:12FromDiscord<dom96> sending and receiving what?
23:42:54FromDiscord<retkid> strings?
23:43:17FromDiscord<retkid> data?
23:43:55FromDiscord<cuddlefish> In reply to @dom96 "nim just looks for": so if somebody depends on my package, they have to set this flag manually too? they don't "inherit" down package dependencies?
23:44:09FromDiscord<dom96> In reply to @cuddlefish "so if somebody depends": yep
23:44:14FromDiscord<cuddlefish> :/
23:44:46FromDiscord<cuddlefish> That's not that great, it means it's more work to use my package since a user also needs to modify another file then
23:44:54FromDiscord<cuddlefish> Well, if that's how it is there's not much I can do about it
23:47:06*vicecea quit (Remote host closed the connection)
23:47:38*vicecea joined #nim
23:59:22nrds<Prestige99> Is there a way I can do something like the following?: https://play.nim-lang.org/#ix=3Efh
23:59:36nrds<Prestige99> Essentially wanting this template to return a bool