<< 13-12-2022 >>

00:00:16*NimBot joined #nim
00:00:21*systemdsucks joined #nim
00:00:23*disso_peach joined #nim
00:01:05FromDiscord<Elegantbeef> Lent only doesnt copy if consumed directly
00:01:08*tiorock joined #nim
00:01:18*djanatyn joined #nim
00:01:34*tiorock quit (Changing host)
00:01:34*tiorock joined #nim
00:01:34*rockcavera is now known as Guest3976
00:01:34*Guest3976 quit (Killed (silver.libera.chat (Nickname regained by services)))
00:01:34*tiorock is now known as rockcavera
00:02:15*void09 joined #nim
00:02:31*ehmry joined #nim
00:02:41*dom96 joined #nim
00:02:44FromDiscord<Elegantbeef> If it cannot be consumed 😄
00:02:48*jkl joined #nim
00:02:50*tinystoat joined #nim
00:03:27FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4isU
00:03:50FromDiscord<Elegantbeef> Do to the constraint `lent` doesnt need to be passed by `ptr/ref/var`
00:05:20FromDiscord<arkanoid> sent a long message, see http://ix.io/4isW
00:05:23*madprog joined #nim
00:06:14FromDiscord<arkanoid> It feels like I am missing something really important here
00:07:38FromDiscord<Yepoleb> Is is at 100% cpu constantly or only when you type?
00:10:26FromDiscord<arkanoid> @Yepoleb\: only when I'm working on the project. If I leave it thinking for a while, it sets down.
00:10:54FromDiscord<arkanoid> But it takes so much effort it seems like doing cryptos lol
00:11:52FromDiscord<Elegantbeef> How many instances of nimsuggest do you have open when it happens
00:14:20FromDiscord<arkanoid> The amount if nimsuggest process instances seems to depend on the amount of "projects" I setup in the extension settings, which is 3 in my general context\: main lib, tests, python interface. This is needed to get hints and errors on all 3
00:14:46FromDiscord<Elegantbeef> Ok so sounds like you have it setup properly
00:14:52FromDiscord<Elegantbeef> Nimsuggest is just quite buggy sadly
00:14:59FromDiscord<arkanoid> I'm thinking about not running it on tests and python interface, but just main lib
00:16:56FromDiscord<arkanoid> Everytime this topic pops up in the forum, there's always blame on the user settings and on the extension by the main devs
00:18:02FromDiscord<arkanoid> I've read that JetzBrains developed their own official nim extension. I wonder if this is based on nimsuggests or not
00:18:18FromDiscord<Elegantbeef> it's not
00:18:24FromDiscord<Elegantbeef> it's also dumber
00:19:07FromDiscord<arkanoid> Ok. Makes sense. Easier problem to solve = less issues
00:20:33FromDiscord<arkanoid> I wonder if dropping a man in the middle like nimlsp would improve the situation
00:24:20FromDiscord<arkanoid> I know it is still based on nimsuggest, but here I'm not sure yet where the problem lives\:↵- is it me non configuring extension properly per project↵- is tue extension calling nimsuggest not in the vest way↵- is nimsuggest not dealing with the problem in the best way
00:34:30FromDiscord<Elegantbeef> Nimlangserver does just that
00:35:00FromDiscord<Elegantbeef> Araq is banking on IC to make tooling better
00:35:32FromDiscord<Elegantbeef> In otherwords if IC never comes nimsuggest will only get incrementally better 😄
00:53:31NimEventerNew Nimble package! waterpark - Thread-safe database connection pools, see https://github.com/guzba/waterpark
00:54:32FromDiscord<Yepoleb> @guzba congrats on releasing a new package!
01:11:55FromDiscord<b1rdf00d> great name
01:40:08NimEventerNew thread by snej: StrictNotNil and bogus “cannot prove” errors, see https://forum.nim-lang.org/t/9718
01:53:42FromDiscord<ShalokShalom> Does the Jetbrains plugin also use nimsuggest?
01:57:23*brettgilio joined #nim
02:13:16arkanoidShalokShalom, I asked same question a couple of hours ago, Elegantbeef says no, and it's dumber than nimsuggests. Just scroll up some lines
02:13:42FromDiscord<ShalokShalom> Ah, I see
02:13:48FromDiscord<ShalokShalom> Sorry for you
02:13:57FromDiscord<ShalokShalom> It just got a recent update
02:46:36arkanoidShalokShalom, what do you mean?
02:58:15arkanoidis this sufficient to test if {.packed.} pragma is doing it's job? cast[B](cast[A](objB))
03:00:54FromDiscord<Elegantbeef> `static: assert sizeof(A) == sizeof(B)` 😄
03:02:10FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4itx
03:02:42FromDiscord<Elegantbeef> `static: assert sizeof(A) == packedSize(A)` should work for non complex objects
03:05:58arkanoidthanks!
03:06:32arkanoidseems that all my cast are passing this tests no matter if I use {.packed.} pragma or not
03:06:50FromDiscord<Elegantbeef> Likely your struct is packed already
03:07:32arkanoidI've been trying to understand when this happens. It says that it should happens when you have large fields on top, small on bottom, but this is not my case
03:07:39arkanoidalso, I've found this https://github.com/nim-lang/Nim/commit/91a3cb67ec53f28c919316bf611bea07e8677d02
03:08:13arkanoidnot sure what it really means, but seems that the meaning of packed has been changed lately
03:08:34arkanoidwell, not really lately
03:27:24arkanoidactually, nimpy fails to {.exportpy.} a function that has a {.packed.} object as input argument
04:02:08FromDiscord<j-james> In reply to @arkanoid "Even if I have": arkanoid: this is a known problem with the vscode extension for some reason, other extensions like nimlime and native lsp don't have it
04:02:40FromDiscord<j-james> anecdotally i fixed it by switching to sublime + nimlsp, and then from nimlsp to nimlangserver
04:03:10FromDiscord<j-james> now all that happens are nimlangserver crashes, which are easy to restart and don't peg the cpu
04:03:42arkanoidj-james, please tell me more. These kind of stories are worth long posts on the forum, I feel a lot of users are sharing this problem
04:04:00arkanoidwait, but what is nimlangserver?
04:04:06arkanoidI know nimlsp
04:04:43FromDiscord<j-james> nimlsp is pmunch's project, nimlangserver is under the nim-lang organization and iirc has a paid developer working on it
04:04:49arkanoidhttps://github.com/nim-lang/langserver#related-projects
04:04:54arkanoidoh dear, I missed this
04:04:57arkanoidthanks!!
04:05:14FromDiscord<j-james> previous versions of nimlangserver were not great and i believe that's why pmunch wrote his thing, but it's now gotten better
04:05:40FromDiscord<j-james> they both kinda just wrap nimsuggest into a language server - i'm not quite sure of the details of how they work
04:06:35arkanoidI though pmunch nimlsp was the only man in the middle in the field
04:08:21FromDiscord<j-james> yeah nimlangserver definitely should be better advertised
04:08:36FromDiscord<j-james> version 3 of it is relatively new though
04:08:58FromDiscord<j-james> also re: vscode extension: here's the bug i filed a while ago https://github.com/saem/vscode-nim/issues/93
04:09:58FromDiscord<j-james> i didn't quite understand saem's explanation of why it can't kill stuck processes when seemingly native lsp support of nimlsp/nimlangserver works fine
04:11:15FromDiscord<Elegantbeef> To be fair until recently you couldnt use nimlangserver with stable
04:11:28arkanoidj-james I also feel like I am using vscode extension as required (proper nim.project section to run only the required process) but yet I face nimsuggest process eating 100% cpu
04:12:06FromDiscord<j-james> i felt the same way
04:12:23FromDiscord<j-james> using the vscode extension "properly" still causes it
04:13:18FromDiscord<Bung> it doesn't identify "stuck processes"
04:13:46FromDiscord<Gumbercules> is it even cpu usage? I thought it leaked memory
04:13:59FromDiscord<Gumbercules> or does it do both?
04:14:06arkanoidI also have been trying to teach nim to a friend of mine, including how to set settings.json for nim, but the first feedback I had from him after he started learning is .. problems with editor and its services, and cpu spinning
04:14:09FromDiscord<Bung> the route is run cmd then fails -\> kill the nimsuggest instance
04:14:11FromDiscord<Elegantbeef> It can do both
04:14:15FromDiscord<Gumbercules> gotcha
04:14:26FromDiscord<Elegantbeef> The biggest issue many face with Nim is tooling
04:14:27FromDiscord<j-james> which is weird? because i think saem's code is probably good, he's very aware of nim's internals
04:14:31FromDiscord<Elegantbeef> Then the compiler being buggy
04:14:35FromDiscord<j-james> so maybe it's a vscode limitation
04:14:39FromDiscord<Gumbercules> I mean this shits been an issue since I joined
04:14:44FromDiscord<Gumbercules> soooo 7 years running now
04:15:02FromDiscord<Elegantbeef> Yea presently it looks like the desire is that IC solves it
04:15:11FromDiscord<Elegantbeef> But that very much is likely optimistic
04:15:18FromDiscord<Bung> his explanation is about hard to do "per project per nimsuggest instance"
04:15:18FromDiscord<Gumbercules> Nim's tooling and docs always == Nim's biggest detractors
04:15:29FromDiscord<Gumbercules> it's all Nimble and this stupid project shit
04:15:39FromDiscord<Gumbercules> why do we need to have "projects"
04:15:49FromDiscord<Gumbercules> because Nimble forces it on us
04:16:11FromDiscord<sOkam!> otherwise you would have makefiles. i would rather have nimble, to be honest
04:16:12FromDiscord<Gumbercules> Nimbles whole structure your directories this way and build your solution around this concept of a project
04:16:15FromDiscord<Gumbercules> no
04:16:23FromDiscord<Gumbercules> you can have a dependency manager that just manages dependencies
04:16:25FromDiscord<Elegantbeef> Well the reason we need to have projects is cause we need to know the entry file for tooling
04:16:31FromDiscord<Gumbercules> a dependency manager should not be tightly coupled with a build system
04:16:51FromDiscord<Elegantbeef> When it comes to nimsuggest the project is literally just entry(ies)
04:16:53FromDiscord<Gumbercules> In reply to @Elegantbeef "Well the reason we": yeah we'd need to specify this somewhere
04:16:54FromDiscord<sOkam!> that would just be one extra step in the same process
04:16:59FromDiscord<Bung> yes, so the history is "nim package" used before "nimble" before nim package RFC
04:17:15FromDiscord<Gumbercules> In reply to @sOkam! "that would just be": single component single responsibility
04:17:30FromDiscord<Gumbercules> I don't need my dependency manager building my code
04:17:50FromDiscord<Gumbercules> they are two separate tasks and a dependency manager should manage dependencies well
04:17:58FromDiscord<Gumbercules> not concern itself with how my software is built
04:18:06FromDiscord<Gumbercules> I mean.... when did we get lockfiles finally for Nimble?
04:18:13FromDiscord<Gumbercules> two years ago?
04:18:32FromDiscord<Elegantbeef> We havent yet 😄
04:18:41FromDiscord<Elegantbeef> Nim2.0 will ship with nimble 0.14
04:18:47FromDiscord<Elegantbeef> Which will have lockfiles
04:19:00FromDiscord<Gumbercules> yeah so right now nimble does nothing really well
04:19:05FromDiscord<Gumbercules> besides annoy people
04:19:37FromDiscord<Gumbercules> for me - git submodules + a config.nims with tasks in it works better than Nimble ever did
04:19:41FromDiscord<j-james> meh i like nimble
04:19:46FromDiscord<Gumbercules> you haven't 'used it enough
04:19:50FromDiscord<Gumbercules> (edit) "'used" => "used"
04:19:52FromDiscord<j-james> git submodules on the other hand holy shit
04:19:54FromDiscord<j-james> bane of my life
04:21:13FromDiscord<Gumbercules> dependency managers should be relatively unopiniated
04:21:33FromDiscord<Gumbercules> they definitely shouldn't force some directory structure upon you in order for your project to work
04:22:09FromDiscord<Gumbercules> and they should enable reproducible builds
04:23:29FromDiscord<Gumbercules> nimble develop, now that's some holy shit territory
04:24:11FromDiscord<Gumbercules> I liked with Zig did with their build system
04:24:14FromDiscord<Elegantbeef> I personally quite enjoy nimble develop
04:24:31FromDiscord<Gumbercules> it's fine if you have been down that road before and know what you're doing - but it's so easy to fuck up
04:25:00FromDiscord<Bung> no, it should force some directory structure, I dont see any benefit randomly use project directory structure
04:25:05FromDiscord<Gumbercules> especially with multiple Nim versions installed on the same machine
04:25:31FromDiscord<j-james> In reply to @arkanoid "j-james, please tell me": anyway yeah i agree
04:25:48FromDiscord<j-james> i think some comprehensive best practices or tooling guide would be helpful
04:26:00FromDiscord<j-james> awesome-nim is perhaps the closest to that, which is weird
04:26:03FromDiscord<Gumbercules> status has a decent one
04:26:19FromDiscord<Elegantbeef> Eh status' guide is heavily opinionated
04:26:22FromDiscord<Gumbercules> at least regarding best practices
04:26:22FromDiscord<Gumbercules> sure
04:26:36FromDiscord<Gumbercules> but they're also writing commercial software with Nim
04:26:45FromDiscord<Gumbercules> and have multiple people working on the same codebase at once
04:27:13FromDiscord<Gumbercules> https://status-im.github.io/nim-style-guide/tooling.deps.html
04:27:23FromDiscord<Gumbercules> whoops
04:27:43FromDiscord<Gumbercules> meant to link to the root but
04:32:31FromDiscord<Gumbercules> https://ssalewski.de/nimprogramming.html#_nimble_package_manager might also be useful
04:32:33arkanoidI strongly agree with a pinned "tooling status" post on the forum, or a page on the website. It's not about making promises or complain about something, just share what are the best practices to make current tooling usable without asking the user to discover all the details and the workarounds on its own
04:33:22FromDiscord<Gumbercules> everyone has different preferences though around editors / IDEs / build systems etc
04:34:22FromDiscord<Gumbercules> wouldn't making it work be a better use of time?
04:34:55arkanoidGumercules, no, it's much cheaper to tell a story, than to invent a new one
04:35:06FromDiscord<Elegantbeef> I think the main point is that it's much easier to write a guide to make it 'work' than it is for developers to make it work
04:35:24FromDiscord<Gumbercules> I guess if we're just talking VSCode and Nimsuggest sure
04:36:33arkanoidconsidering that nimslp, nimlangserver, vscode extension and possibly all the others rely on nimsuggest, they all may be sharing same issues
04:36:53FromDiscord<Elegantbeef> Well yea nimsuggest needs to be fixed
04:37:11FromDiscord<Elegantbeef> But it's more and more looking like IC is the more likely path out of tooling hell
04:37:15FromDiscord<Gumbercules> yeah and I guess that's my point - documenting the workaround for all of these sounds very time consuming
04:37:30FromDiscord<Elegantbeef> Anyone can document it, only a compiler dev can fix it
04:37:40FromDiscord<Gumbercules> yeah I have no idea what the underlying issue is
04:37:43FromDiscord<Gumbercules> or issues are
04:38:52FromDiscord<Bung> take over projects use variant project directory structure, stop make compatible with one project and other.
04:38:53arkanoidI hope you share at least that the order of complexity is: IC >>> nimsuggest >> lsp/extension > guide
04:40:29FromDiscord<Gumbercules> I mean IC has been on the radar for years now
04:40:45FromDiscord<Gumbercules> I don't know when it will be a real thing
04:40:55FromDiscord<Gumbercules> I've also been out of the loop for several months
04:40:56FromDiscord<Elegantbeef> I havent looked much into nimsuggest issues but there are a few issues, one is that it's a neutered compiler so it does some cheats in the goal of speed. Which can result in bad behaviour. Another is that it recompiles code without a consistent cache so false errors are createed
04:41:12FromDiscord<Gumbercules> it's also using threads and channels
04:41:20FromDiscord<Elegantbeef> It's the next thing araq wants to focus on after 2.0, whether that's the case has yet to be seen
04:41:37FromDiscord<Gumbercules> yeah these things tend to change quite a bit
04:41:51FromDiscord<Gumbercules> since the roadmap is in his head
04:42:28FromDiscord<Elegantbeef> To be fair 'Refactorings of the compilation pipeline in anticipation of IC.' is a hard goal for 2.0
04:42:35FromDiscord<Gumbercules> gotcha
04:43:18FromDiscord<Gumbercules> I don't know if folks have done profiling / run sanitizers against it
04:43:27FromDiscord<Gumbercules> I assume so, but I have no clue
04:56:25arkanoidyes, I still believe that writing a long forum post about this is way way cheaper than looking into nim compiler / nimsuggest / ide extensions
04:56:50arkanoidbetter than a forum post would be a wiki page, or kinda like it
04:57:22arkanoidbut having the website on github would cover same requirements? just guessing
04:57:44FromDiscord<Elegantbeef> Sad part about wiki is inane modification spam
04:58:38FromDiscord<Bung> I think it can go nim wiki IDE part
05:00:53*arkurious quit (Quit: Leaving)
05:01:23FromDiscord<ringabout> https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim/_compare/9b20795%5E...9b20795 How could we know whether it is an add or not
05:02:04FromDiscord<ringabout> (edit) "add" => "ad"
05:04:03arkanoidringabout, should we care at this time? I don't think so. The more, the better. It's not like Nim is responsible for the tools or revenue created with it
05:06:08FromDiscord<ringabout> In reply to @arkanoid "<@658563905425244160>, should we care": It seems that according to https://forum.nim-lang.org/t/9647 they (the author of the commit) does want to rewrite their code into Nim.
05:06:14FromDiscord<ringabout> (edit) "into" => "in"
05:09:39arkanoidringabout, and?
05:09:47arkanoidsorry but I fear I am not following you
05:09:58arkanoidhow is the second part linked to the first one?
05:13:51FromDiscord<ringabout> In reply to @arkanoid "how is the second": Are you on the irc? I have deleted the first message before your first reply. I think they are likely to be true according to their post in the forum.
05:26:06*wallabra_ joined #nim
05:27:27*wallabra quit (Ping timeout: 268 seconds)
05:27:28*wallabra_ is now known as wallabra
06:13:40*tiorock joined #nim
06:13:40*tiorock quit (Changing host)
06:13:40*tiorock joined #nim
06:13:40*rockcavera is now known as Guest5354
06:13:40*tiorock is now known as rockcavera
06:16:45*Guest5354 quit (Ping timeout: 260 seconds)
06:33:19*kenran joined #nim
06:33:23*kenran quit (Remote host closed the connection)
06:53:35*Simon[m]12345 left #nim (#nim)
07:29:46FromDiscord<Gumbercules> ugh - first time using a `ref` type in a long time
07:30:16FromDiscord<Gumbercules> was using `std/json`'s `parseJson` and I kept getting some weird traceback - just realized it has to do with the whole default value thing
07:31:57FromDiscord<Gumbercules> I guess I don't need to worry about this for now since I can't supply a default value for `JsonNode`?
07:38:29*PMunch joined #nim
07:40:06*genpaku quit (Remote host closed the connection)
07:40:50*genpaku joined #nim
07:45:46*rockcavera quit (Remote host closed the connection)
07:49:12FromDiscord<Elegantbeef> Yea you cannot provide default values outside of a module's definition
07:49:40FromDiscord<Elegantbeef> `std/jsonutils` is better for general parsing
07:49:43FromDiscord<Elegantbeef> Since it supports hooks
08:13:03FromDiscord<Gumbercules> appreciate the protip
08:22:05FromDiscord<Gumbercules> @ElegantBeef if I need custom unmarshalling do I need to delve into userland? A few of the fields in the object I'd be using to represent the unmarshalled JSON need to have their values looked up based on the content of the corresponding JSON field
08:25:22FromDiscord<Elegantbeef> I think jsonutils works in that case
08:25:48FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/std/jsonutils.nim#L459
08:28:04FromDiscord<Elegantbeef> @Gumbercules what's the data you got?
08:29:26FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=4iuI
08:30:01FromDiscord<Gumbercules> so for instance, I need to convert language to an enum member
08:30:10FromDiscord<Gumbercules> actually in my case a distinct uint32
08:30:31FromDiscord<Gumbercules> I have a proc that I need to call that does this
08:30:54FromDiscord<Elegantbeef> Yea this is all fine you just need to manually handle it
08:31:02FromDiscord<Gumbercules> ah I see
08:31:08FromDiscord<Gumbercules> I need to define `jsonTo` I guess
08:31:28FromDiscord<Elegantbeef> `fromJsonHook` and `toJsonHook`
08:31:35FromDiscord<Gumbercules> oh okay
08:31:38FromDiscord<Elegantbeef> You can define it for your special types if you need
08:31:44FromDiscord<Gumbercules> gotcha - I see now, thanks
09:10:33FromDiscord<everyon> sent a code paste, see https://play.nim-lang.org/#ix=4iuR
09:10:50FromDiscord<luteva> Hi! Is there a key value store, like lmDB, rocksdb etc. that can operate directly on objects/complex types? The ones i was looking at, are all working on strings only, so i always have to marchal/unmarshal everything.
09:24:06FromDiscord<planetis> In reply to @everyon "hmm, I was just": an echo that has to grab a lock for the stdout, write to a buffer which is then flushed? also strformat quite possible allocates temporary strings which are appended, so pbl also a re-allocate.
09:24:18FromDiscord<planetis> (edit) removed "possible"
09:24:53FromDiscord<planetis> echo is debug only it shouldn't be used in loops
09:25:18FromDiscord<everyon> well, it outputs every 2 or so seconds, it's fine
09:26:07FromDiscord<everyon> (edit) "fine" => "fine↵and it's not included in measured time"
09:26:09FromDiscord<planetis> ...and I noticed that it's after the cpuTime, so maybe the C compiler reordering the statements
09:26:37FromDiscord<planetis> the C compilers do that all the time.
09:26:55FromDiscord<everyon> In reply to @planetis "an echo that has": but it's faster by 10% with echo, not slower
09:27:05FromDiscord<planetis> faster?
09:27:06FromDiscord<everyon> that's why I'm confused
09:27:35FromDiscord<planetis> Indeed makes no sense, I will try it.
09:27:51FromDiscord<planetis> if only I had the file...
09:27:59FromDiscord<everyon> yeah, I can send the code
09:28:02FromDiscord<planetis> nvm
09:33:21FromDiscord<everyon> yeah, I will, one sec, just playing around with some stuff
09:37:59FromDiscord<j-james> In reply to @everyon "hmm, I was just": what is the features library / file?
09:39:06FromDiscord<everyon> In reply to @apropos "what is the features": it defines the extractFeatures function, that calculates a bunch of metrics on a piece of text, I'll send the code↵it's a little bit messy rn, will clean it up later
09:39:23FromDiscord<everyon> In reply to @planetis "~~nvm.~~ Sry I typed": https://media.discordapp.net/attachments/371759389889003532/1052157778640244747/features.nim https://media.discordapp.net/attachments/371759389889003532/1052157778992574484/benchmark.nim
09:41:34FromDiscord<planetis> still missing the 5k.jsonl file
09:42:47FromDiscord<everyon> In reply to @planetis "still missing the 5k.jsonl": oh yeah, right
09:43:35FromDiscord<j-james> i'd toss it into something like https://godbolt.org/ to take a look at
09:43:47FromDiscord<j-james> preferably with a minimum reproducible example
09:43:50FromDiscord<everyon> In reply to @everyon "oh yeah, right": here it is https://media.discordapp.net/attachments/371759389889003532/1052158897999331359/5k.zip
09:44:00FromDiscord<planetis> thanks
09:45:21FromDiscord<everyon> by the way, I'm running that benchmark in WSL with Ubuntu 22.04↵compiling with↵`nim c -d:danger benchmark.nim`
09:45:39FromDiscord<planetis> nim -v?
09:46:38FromDiscord<everyon> In reply to @planetis "nim -v?": Nim Compiler Version 1.6.10 [Linux: amd64]↵Compiled at 2022-11-21
09:47:01FromDiscord<planetis> I am on devel, so I have --mm:orc --threads:on by default
09:47:21FromDiscord<everyon> In reply to @everyon "Nim Compiler Version 1.6.10": and gcc 11.3.0
09:51:41*pro joined #nim
09:52:36FromDiscord<everyon> I tried orc, and removing strformat made little to no difference
09:52:43FromDiscord<planetis> Took a chunk of it to make it faster
09:53:04FromDiscord<ShalokShalom> In reply to @arkanoid "<@208199869301522432>, what do you": The Jetbrains Plugin just got an update a week ago, maybe that solves some of the issues 🙂
09:53:06FromDiscord<everyon> In reply to @everyon "I tried orc, and": the performance was roughly the same with or without the echo
09:53:32FromDiscord<everyon> so I guess that's not compiler magic, but GC magic
09:53:56FromDiscord<everyon> I suspected that, but I've only tried refc and arc
09:54:06FromDiscord<ShalokShalom> In reply to @Elegantbeef "But it's more and": IC?
09:55:03FromDiscord<Elegantbeef> Incremental compilation
09:56:36FromDiscord<everyon> In reply to @everyon "I suspected that, but": with arc it's actually faster to have no echo every iteration, as you would expect
09:58:27FromDiscord<planetis> so its just the garbage collection triggering in the wrong place
10:02:04FromDiscord<everyon> I guess so 🤷
10:03:01FromDiscord<planetis> I can't tell a difference with 100 lines files, since the benchmark should run many times to produce reliable data
10:03:36FromDiscord<planetis> but maybe putting GC_fullCollect() next to the commented echo could help
10:03:50FromDiscord<planetis> (edit) "files," => "file,"
10:05:11FromDiscord<everyon> yeah, that does look like it, putting it there makes about the same difference as uncommenting that echo
10:05:25FromDiscord<planetis> but orc is indeed faster 3.7s vs 2.9
10:05:38FromDiscord<everyon> In reply to @everyon "yeah, that does look": so GC just does it's thing in the middle of the loop
10:05:47FromDiscord<everyon> (edit) "In reply to @everyon "yeah, that does look": so GC just does it's thing in the middle of the loop ... " added "and makes it slow down"
10:06:12FromDiscord<Elegantbeef> It is scope based MM
10:06:31FromDiscord<planetis> just compiled with AddressSanitizer and nothing bad popped up either
10:06:35FromDiscord<Elegantbeef> you can do `--expandArc:myProc` to see `arc` vs `orc`
10:07:36FromDiscord<planetis> doesn;t work with --mm:refc
10:08:03FromDiscord<Elegantbeef> Well with refc you can disable the GC then reenable it after
10:08:23FromDiscord<Elegantbeef> `GcDisable` and `GcEnable` respectively
10:09:04FromDiscord<planetis> Thats even better, but wonder how much the memory would grow
10:10:11*vicecea quit (Ping timeout: 246 seconds)
10:10:24FromDiscord<Elegantbeef> I mean if we're hunting the slowdown
10:12:20FromDiscord<planetis> good point, I am comparing refc with orc guess I've hidden agenda and shouldn't be involved 🙂
10:14:31FromDiscord<planetis> --exceptions:goto --mm:refc give me better times, can you try?
10:14:46FromDiscord<planetis> 3.2s vs 3.7
10:15:32FromDiscord<planetis> anyway gtg
10:16:21FromDiscord<ShalokShalom> @ElegantBeef#0000 thanks
10:17:28FromDiscord<jmgomez> In reply to @Elegantbeef "Incremental compilation": when I looked at it and got it partially working by cherry picking the modules, it seemed slower than actual nim compilation in a lot of cases..
10:18:12FromDiscord<jmgomez> it was generating files 700mb+
10:18:36FromDiscord<jmgomez> just loading them into memory took more time than the whole compilation
10:23:26FromDiscord<Elegantbeef> Make it work, then make it work fast
10:26:13FromDiscord<jmgomez> yeah, you are right. It was a task out of what I can handle though and I had alternative for NimForUE which is not mutually exclusive from IC
10:26:16FromDiscord<everyon> In reply to @planetis "--exceptions:goto --mm:refc give me": and a little bit worse for me↵interesting↵well, thanks for info, now I know a little bit more about GCs
10:27:05FromDiscord<jmgomez> I just wanted to tweak it in a way where I could pick the modules that got IC but again, once I did it, it was just slower than initially
10:39:20FromDiscord<ShalokShalom> In reply to @Elegantbeef "Make it work, then": You mean, its already stable
10:39:25FromDiscord<ShalokShalom> And just not efficient
10:40:22FromDiscord<jmgomez> In reply to @ShalokShalom "You mean, its already": no, there is a ordering issue that it's hard to fix
10:40:30FromDiscord<jmgomez> (edit) "a" => "an"
10:40:36FromDiscord<ShalokShalom> Ah, I see
10:40:49FromDiscord<jmgomez> what I did was to cherry pick the modules to get around it
10:41:00FromDiscord<ShalokShalom> Cause Elegant meant, IC seems to solve the issue of Nimsuggest crashing
10:41:22FromDiscord<ShalokShalom> I questioned, how this can be understood by now.
10:41:44FromDiscord<jmgomez> not sure why it crashes but probably beef is right, he usually is 😛
10:41:59FromDiscord<ShalokShalom> Yes
10:48:24*Guest93 joined #nim
10:48:44Guest93problem:
10:48:46Guest93type
10:48:47Guest93  Prototype0Obj[s: static int] = ref Prototype0[s]
10:48:47Guest93  Prototype0[s: static int] = object
10:48:48Guest93    v: array[s, float64]
10:48:50Guest93compiler says:
10:49:14Guest930.nim(38, 49) Error: type expected
10:50:07Guest93how to do that? I want a type for a reference on Prototype0 because I dont like copy
11:01:22Guest93ah got it by splitting it into two type declarations
11:05:15FromDiscord<CHANDAN KUMAR> Refresh it even if error occurs use VPN
11:18:41FromDiscord<Rika> what
11:19:58FromDiscord<everyon> In reply to @Rika "what": probably some message didn't get bridged here
11:22:04*Guest93 quit (Quit: Client closed)
11:59:28NimEventerNew thread by RodSteward: Status of exceptions with goto,setjmp with C++, see https://forum.nim-lang.org/t/9720
12:09:03FromDiscord<luteva> can anyone explain why to use a converter? The doc only says that:↵"A converter is similar to a proc."↵So what are the differnces? What is the reason to introduce the keyword if you could do the same using a proc?
12:11:50FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4ivk
12:12:02FromDiscord<amadan> (edit) "https://play.nim-lang.org/#ix=4ivk" => "https://play.nim-lang.org/#ix=4ivl"
12:13:44FromDiscord<luteva> ahhhh ok. so no proc call is needed, the conversion is done implicitly/automatically?
12:14:44FromDiscord<amadan> yup↵There are some limitations iirc, think it won't implicitly call a converter >= 1
12:14:48FromDiscord<amadan> (edit) ">=" => ">"
12:15:14FromDiscord<luteva> ok thx!
12:37:39*ltriant quit (Ping timeout: 260 seconds)
12:40:24*jmdaemon quit (Ping timeout: 256 seconds)
12:43:30*pro quit (Ping timeout: 265 seconds)
12:45:55FromDiscord<ShalokShalom> Just got this shared on the Telegram channel and found it worth sharing
12:45:56FromDiscord<ShalokShalom> https://ssalewski.de/nimprogramming.html
12:46:02FromDiscord<ShalokShalom> Looks really promising. 🙂
12:49:40FromDiscord<leetnewb> Have read that through a few times, but missed the changelog section.
12:50:28*pro joined #nim
13:11:30FromDiscord<luteva> how can i change the id/primary key in norm? it defaults to integer, but i want to use a form of UUID (or whatever unique string would be useful)
13:19:46*ltriant joined #nim
13:25:02*ltriant quit (Ping timeout: 272 seconds)
13:30:52*cp- quit (Ping timeout: 265 seconds)
13:33:30FromDiscord<luteva> is there a way to define a default value in a type declaration (instead of in the parameter definition of the new/init procedure)?
13:34:30FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=4ivH
13:42:27FromDiscord<amadan> In devel that code works
13:43:39FromDiscord<amadan> If you want something like that but for stable you can use beefs constructor package https://github.com/beef331/constructor#defaults
14:03:15*pro quit (Quit: pro)
14:06:48*Phytolizer joined #nim
14:09:35*moonlit joined #nim
14:10:44*moonlit quit (Client Quit)
14:11:03*moonlit joined #nim
14:23:28*rockcavera joined #nim
14:28:10FromDiscord<auxym> In reply to @luteva "is there a way": I believe nim v2.0 will have that, and should be released in the next few weeks (or you can use devel right now)
14:28:27FromDiscord<voidwalker> just a few weeks ? : o They're just doing it for the headlines then
14:29:57FromDiscord<ajusa> Oh are we not getting a 1.8 release?
14:30:22FromDiscord<ajusa> I thought IC was going to be one of the goals for 2.0, been a while since I read the document though
14:30:25FromDiscord<luteva> sent a long message, see http://ix.io/4ivO
14:31:10FromDiscord<luteva> (edit) "long message," => "code paste," | "http://ix.io/4ivO" => "https://play.nim-lang.org/#ix=4ivP"
14:33:58*Phytolizer quit (Remote host closed the connection)
14:34:24*Phytolizer joined #nim
14:40:52*moonlit quit (Remote host closed the connection)
14:41:12*moonlit joined #nim
14:43:51FromDiscord<auxym> In reply to @voidwalker "just a few weeks": I have no idea really, but during nimconf Araq mentioned that they planned "in 2022", but at this point I'm guessing that the release might slip a bit, hence my wild guess of "a few weeks"
14:44:53FromDiscord<auxym> IC is not a goal for 2.0 atm, from my understanding (unfortunately). it's still goal for "some later release"
15:13:00*PMunch quit (Quit: Leaving)
15:21:54FromDiscord<@thatrandomperson5-6310e3b26da03> How would i get the result of a macro in nim? Also, i tired echoing a nim node and it broke, how would i do this better?
15:27:41FromDiscord<vindaar> a macro produces code and not a value. can you say more about what you're trying to do?
15:30:50*Phytolizer quit (Remote host closed the connection)
15:31:11*Phytolizer joined #nim
15:35:05*ltriant joined #nim
15:38:19FromDiscord<@thatrandomperson5-6310e3b26da03> Ik, i want to get the code that it produces
15:42:16FromDiscord<Rika> as in print it? you can print the result with `treerepr` in macros module iirc
15:43:23FromDiscord<vindaar> or `repr` if you want to see the representation as "written code" and not the AST. but I'm not sure it's what they want
15:43:47*oprypin_ quit (Quit: Bye)
15:44:06*oprypin joined #nim
15:44:22*ltriant quit (Ping timeout: 272 seconds)
15:50:51*otisolsen70 joined #nim
15:51:23otisolsen70I am trying to write a program that shows an icon in systray. I understand that I can use the "gfx" module for this. However, this module does not seem to be available on my system. How do I get it?
15:52:03otisolsen70I have tried using nim as installed in debian 11. This is nim v0.19 which is quite old. I then tried using Nim installed on MacOS using brew. This is Nim v 1.6 which is quite new. But both could not find "gfx"
15:53:26FromDiscord<Rika> what gfx module?
15:57:07otisolsen70There isnt a gfx module in standard lib?
16:00:22FromDiscord<Rika> i am unaware of any.
16:02:28otisolsen70Haha. OK. I am trying to learn GUI programming with Nim. I then asked ChatGPT to show me an example of how to have my program put an icon in the systray. It produced a fine example in which it utilized modules gui and gfx. Which I now realize do not exsist.
16:09:38FromDiscord<ambient> ChatGPT is very good at generating very convincing nonsense
16:12:05FromDiscord<treeform> In reply to @otisolsen70 "Haha. OK. I am": windy has systray functionality
16:12:24FromDiscord<treeform> https://github.com/treeform/windy/blob/master/examples/tray.nim
16:12:50FromDiscord<treeform> but I think it's mostly windows only, very limited on mac and none on linux.
16:16:56otisolsen70OK. Thanks for the tip. Will look into that.
16:17:14otisolsen70Is there some package manager for external modules for nim? Like pip for python?
16:19:10otisolsen70ChatGPT is indeed good at generating convincing nonsense
16:19:16*pro joined #nim
16:20:58*Phytolizer quit (Ping timeout: 260 seconds)
16:21:28FromDiscord<Rika> nim has nimble for package management (but there are other package managers)
16:21:41FromDiscord<Rika> the most commonly used one is nimble, though
16:23:05arkanoidbeen testing nimlangserver + vscode-extension and the general feedback is much better than without nimlangserver. I'm talking about this: https://github.com/nim-lang/langserver#configuration-options
16:23:57*pro quit (Client Quit)
16:27:57otisolsen70What is a good IDE for nim?
16:31:48FromDiscord<voidwalker> nothing better than vscodium for me. or neovim if you're one of those people
16:33:38FromDiscord<arkanoid> I suggest vscode/codium win saem extensionBut you have to configure it properly how it runs nimsuggest under the hood, or you would face excessive cpu usage.↵I suggest you to read about nimsuggest first↵(<@709044657232936960_otisolsen70=5b=49=52=43=5d>)
16:34:58FromDiscord<arkanoid> I know how to work with threads as-is, but I'd like an higher interface similar to what I get with pythons "joblib". Do you have any suggestion?
16:35:21*Phytolizer joined #nim
16:50:40*Phytolizer quit (Remote host closed the connection)
16:51:00*Phytolizer joined #nim
16:52:05FromDiscord<ShalokShalom> In reply to @ambient "ChatGPT is very good": Haha, thats actually quite accurate ^^
16:52:33FromDiscord<ShalokShalom> In reply to @otisolsen70 "What is a good": The truth is, there is none.
16:57:08FromDiscord<ambient> vscode nimsaem is probably the best I've discovered so far
16:57:54FromDiscord<ShalokShalom> Yep
16:58:06FromDiscord<ShalokShalom> Its what most use, I think is fair to say
16:58:29FromDiscord<ShalokShalom> And when you compare that to other languages... 😦
16:59:10FromDiscord<ambient> Rustanalyzer is really nice, but then again I don't have to deal with Hello World taking 5 gigabytes of disk space to build
16:59:22FromDiscord<ambient> (when using Nim)
16:59:43FromDiscord<ambient> I mean Rust builds are huge
17:00:37FromDiscord<ambient> I'm also guessing Typescript and C# support is really good in vscode
17:00:54FromDiscord<Phil> What I don't get is what about rust code makes them so large
17:01:02FromDiscord<Phil> But that's for offtopic
17:02:26FromDiscord<ambient> I haven't really found any showstoppers in my Nim workflow with nimsaem, then again I very rarely do any breakpoints of debugging
17:02:45FromDiscord<ambient> (edit) "of" => "or/"
17:03:01FromDiscord<ambient> (edit) "or/" => "or"
17:03:25FromDiscord<ambient> i didn't know s/foo/bar worked in discord 🧐
17:03:39FromDiscord<ambient> (edit) "discord" => "Discord"
17:08:45FromDiscord<a weird programmer> In reply to @ambient "I'm also guessing Typescript": C# support is ass in vscode
17:11:26FromDiscord<ShalokShalom> In reply to @ambient "I haven't really found": Oh, its good as long as it works.
17:11:45FromDiscord<ShalokShalom> And nimsaem itself is not the problem
17:12:13FromDiscord<ambient> @ShalokShalom what kind of cases has it broken for you?
17:12:16FromDiscord<ShalokShalom> In reply to @ambient "i didn't know s/foo/bar": Did you know Ctrl + K
17:12:25FromDiscord<ShalokShalom> In reply to @ambient "<@208199869301522432> what kind of": It break occasionally
17:12:45FromDiscord<ShalokShalom> Nimsuggest, the underlying system
17:12:59FromDiscord<ShalokShalom> And almost all other alternatives use that too
17:13:18FromDiscord<ShalokShalom> (edit) "break" => "breaks"
17:13:47FromDiscord<ShalokShalom> Nim is luckily a language, that is cool with rather bare bones tooling
17:13:56FromDiscord<ShalokShalom> We dont need much 😄
17:29:46*pro joined #nim
17:36:36*pro quit (Quit: pro)
17:37:48FromDiscord<Phil> Question in terms of language:↵What is understood under "tagged enums"?↵The concept we name Object variants?
17:42:07FromDiscord<Phil> It is, isn't it? Tagged enum, Tagged union, discriminated union all describe the same thing, no?
17:42:20FromDiscord<Phil> (edit) "It is, isn't it? Tagged enum, Tagged union, discriminated ... union" added "union, disjoint"
17:48:53FromDiscord<ShalokShalom> Yes
17:49:02FromDiscord<ShalokShalom> I guess the implementation might be different
17:49:14FromDiscord<ShalokShalom> But in actual usage, it seems virtually the same
17:49:53FromDiscord<ShalokShalom> https://en.wikipedia.org/wiki/Tagged_union
17:50:33*greaser|q joined #nim
17:50:42*krydos5 joined #nim
17:51:54*Amun-Ra_ joined #nim
17:54:06*syl_ joined #nim
17:54:25*xaltsc_ joined #nim
17:54:47*oprypin_ joined #nim
17:55:28*GreaseMonkey quit (Ping timeout: 252 seconds)
17:55:28*krydos quit (Ping timeout: 252 seconds)
17:55:29*Amun-Ra quit (Ping timeout: 252 seconds)
17:55:30*xaltsc quit (Ping timeout: 252 seconds)
17:55:30*oprypin quit (Ping timeout: 252 seconds)
17:55:30*euantorano quit (Ping timeout: 252 seconds)
17:55:30*syl quit (Ping timeout: 252 seconds)
17:55:31*krydos5 is now known as krydos
17:55:33*euantorano_ joined #nim
17:59:54FromDiscord<ShalokShalom> @Phil I guess you mean, because of this post? ↵https://forum.nim-lang.org/t/9659
18:01:13FromDiscord<Phil> Pretty much
18:02:06FromDiscord<ShalokShalom> I like the abstraction, that patty gives 🙂
18:02:09FromDiscord<Phil> I mean, they're right, defining object variants is pretty annoyingly painful.↵I notice that instinctually because the second I have to define one I banish it into its own module together with whatever helper proc I need for it, just so I never have to accidentally look at that syntax
18:03:26FromDiscord<ShalokShalom> https://github.com/andreaferretti/patty#constructing-variant-objects
18:10:47*PMunch joined #nim
18:11:52*syl_ is now known as syl
19:10:32FromDiscord<ShalokShalom> Zig switched from C++ to WASM for its own compilation ↵↵https://ziglang.org/news/goodbye-cpp/
19:27:43FromDiscord<Phil> ... The more I read about compilers the more I get the feeling I need to be actually good at math for those debates
19:28:49FromDiscord<Phil> Not that I was ever terrible but I never really had classes on the actual fundamentals like the basic definition of what a set is, a bijection etc.
19:28:56FromDiscord<Phil> (edit) "Not that I was ever ... terrible" added "that"
19:29:25FromDiscord<Phil> (This stems from reading the newest posts on the nim style insensitivity, since it is nim related I'm like 40% sure it is not offtopic)
19:33:19FromDiscord<vindaar> I'm not sure Pietro's message there is super indicative of what's needed for compiler theory (but I say that as someone who's not a computer scientist and don't have lots of compiler knowledge either). In any case, learning maths gives you more tools and ways to think about problems. Learning about combinatorics, linear algebra, group theory, category theory etc. can be extremely useful for certain applications.
19:34:50FromDiscord<vindaar> in any case, many concepts in maths aren't particularly complicated. but language is often a real issue (similar to your earlier question up there about tagged unions, enums, variants etc), even just if you venture outside your area of expertise you might find people using different words for the same concept etc
19:35:48*Phytolizer quit (Remote host closed the connection)
19:36:09*Phytolizer joined #nim
19:40:52*adium quit (Ping timeout: 256 seconds)
19:40:57*ltriant joined #nim
19:43:17*adium joined #nim
19:46:23*ltriant quit (Ping timeout: 264 seconds)
19:49:14*pro joined #nim
19:50:22*arkurious joined #nim
19:56:16FromDiscord<ShalokShalom> @Phil I guess the serious math relation on the low level is responsibile for the common myth, that you need to be a math head to be a programmer
19:56:56*pro left #nim (#nim)
19:56:56FromDiscord<ShalokShalom> In reply to @vindaar "I'm not sure Pietro's": And yes. Compilers are ultimately pure function.↵↵One input maps to one output.
19:57:05FromDiscord<ShalokShalom> (edit) "function.↵↵One" => "functions.↵↵One"
19:58:05FromDiscord<ShalokShalom> So its just too obvious why functional concepts work splendid for compiler design
19:59:33FromDiscord<ShalokShalom> I imagine it's most pattern matching, though 🤔
19:59:40FromDiscord<ShalokShalom> (edit) "most" => "mostly"
20:04:20FromDiscord<juan_carlos> If Zig using LLVM, then still using C++...
20:05:55*greaser|q quit (Changing host)
20:05:55*greaser|q joined #nim
20:06:29*greaser|q is now known as GreaseMonkey
20:09:32FromDiscord<ShalokShalom> True 😅
20:09:41FromDiscord<ShalokShalom> But its still a difference
20:09:59FromDiscord<ShalokShalom> I mean eliminating such a significant chunk of code is quite something
20:11:04FromDiscord<Gumbercules> I thought Zig was self hosted
20:11:27FromDiscord<Gumbercules> I didn't read the blog post though... So I probably shouldn't comment
20:11:36FromDiscord<@thatrandomperson5-6310e3b26da03> What is the proper way to create typedef in a macro?
20:13:23FromDiscord<Michal Maršálek> Is it possible to use a proc that operates on `NimNode` at runtime? That is, can I override the implicit .compileTime pragma?
20:13:57FromDiscord<ShalokShalom> In reply to @Gumbercules "I thought Zig was": I thought that as well
20:14:08PMunchUhm, NimNode is a compile-time representation of Nim code. What would it be doing during runtime?
20:15:11FromDiscord<Michal Maršálek> Represent a Nim code. 😄
20:15:32PMunchBut you wouldn't be able to use that Nim code for anything..
20:15:38PMunchSince you're done compiling..
20:15:56FromDiscord<Michal Maršálek> I wouldn't be able to run it but why should I not be able to inspect the AST?
20:16:06PMunchFair..
20:16:19PMunchWell you could import the compilers definition of a Nim node
20:16:30PMunchBut why do you want to inspect a NimNode during runtime?
20:17:21FromDiscord<Michal Maršálek> I just wanted to use the `parseStmt` on todays aoc input instead of writing my own parser
20:17:58FromDiscord<Michal Maršálek> which works nicely, but I have to do it all at compile time
20:20:04FromDiscord<vindaar> in the end it shouldn't really matter that you do it all at compile time though (I may be missing something of course). The other alternative is importing the compiler API, which you can then use at runtime, but uhh, I'm pretty sure that's too much 😅
20:20:56FromDiscord<Michal Maršálek> oh, I didn't realise there's two versions of Nim node
20:25:40PMunchWhat you typically do is convert the AST into statements which will be valid on runtime
20:29:55PMunchHmm, is there a way to implement this in a better way: https://play.nim-lang.org/#ix=4ixp
20:30:02PMunchSpecifically the two methods
20:30:28PMunchCould I somehow write a proc/method which took just Base and return the same result?
20:32:18FromDiscord<Michal Maršálek> In reply to @PMunch "What you typically do": Are you talking about the usual way one uses the AST? Or are you giving me hints on how I can achieve what I wanted to?
20:32:28PMunchThe latter
20:33:25FromDiscord<Michal Maršálek> hmm
20:33:35FromDiscord<Michal Maršálek> I'm afraid I don't understand what you mean
20:36:07*pro joined #nim
20:36:16*pro left #nim (#nim)
20:36:51PMunch@Michal_Maršálek, hmm
20:38:01PMunchBasically you can take your AST, extract all the interesting bits, and then create a call to a procedure with those bits as arguments
20:38:38FromDiscord<Michal Maršálek> In reply to @PMunch "Basically you can take": Yes, but that's what I'm doing
20:39:21FromDiscord<Michal Maršálek> But Nim automatically puts the pragma there
20:39:50*kenran joined #nim
20:40:53PMunchWell that's because you're passing NimNodes, and not the interesting bits
20:41:03*kenran quit (Remote host closed the connection)
20:41:29FromDiscord<Michal Maršálek> That's the issue
20:41:50FromDiscord<Michal Maršálek> How do I get at those interesting bits at runtime
20:42:15PMunchYou don't, you get them at compile-time, and pass them over to the runtime
20:44:45FromDiscord<Michal Maršálek> I understand what you mean now. 🙂 Yeah, I knew how to do that from the beggining, my question was about being able to do it at runtime.
20:46:14*jmdaemon joined #nim
20:46:20FromDiscord<Michal Maršálek> Is there a `string -> PNode` function?
20:46:44PMunchNot if you don't import the compiler
20:47:10FromDiscord<Michal Maršálek> I mean in compiler/ast
20:48:24FromDiscord<Yepoleb> i want to wrap `ifreq`, which is a kernel struct with a giant union https://manpages.debian.org/bullseye/manpages/netdevice.7.en.html↵would the best way to approach this be to make a separate type for all possible unions?
20:48:32FromDiscord<Yepoleb> (or just the ones i need)
20:48:55PMunchYou could also make a Nim union of it
20:49:07PMunchOr just use Futhark *shrugs*
20:49:43PMunch(Futhark would create a Nim union out of it)
20:52:13*Phytolizer quit (Ping timeout: 260 seconds)
20:53:41FromDiscord<Yepoleb> i thought nim only had variants, thanks for the advice
20:54:30PMunchWell the {.union.} pragma is pretty much only to interact with C unions
20:55:05FromDiscord<Yepoleb> and futhark is too much to learn if i just need a single struct
20:56:22PMunchIt's not that hard to learn, and well worth it if you ever plan to wrap C code ever again
21:07:23*PMunch quit (Quit: leaving)
21:11:27FromDiscord<.tochka> In reply to @juan_carlos "If Zig using LLVM,": they're in process now of providing different generators
21:19:53otisolsen70FromDiscord, ok.
21:22:00*otisolsen70 quit (Quit: Leaving)
21:24:31FromDiscord<Yepoleb> is there a fancy way to convert a string to `array[16, char]` other than a per character for loop?
21:36:29FromDiscord<guzba> if you want a fancy way, you could turn that into array[17, char] ensure [16] is 0, then do $arr[0].cstring but i think youll get 👀
21:36:44FromDiscord<guzba> haha
21:38:02FromDiscord<guzba> (edit) "$arr[0].cstring" => "$cast[cstring](arr[0].addr)"
21:47:30FromDiscord<Yepoleb> i think that does the conversion the other way
21:47:43FromDiscord<Yepoleb> i want to write to the array
21:51:27arkanoidnimsuggest --v3 is eating 8GB ram, damn, this tool should be renamed nimGoogleSuggestChrome
21:51:54*ltriant joined #nim
22:02:59FromDiscord<Elegantbeef> @Gumbercules @ShalokShalom it's self hosted but it still targets the llvm
22:05:19FromDiscord<Gumbercules> In reply to @Elegantbeef "<@204328759715692544> <@208199869301522432> it's se": Gotcha
22:06:32FromDiscord<Elegantbeef> Eventually andrew does want to add more backends that are not llvm based
22:06:40FromDiscord<Elegantbeef> So C target and so forth
22:07:01FromDiscord<Yepoleb> PMunch\: this quickly escalated, i'm trying futhark now 😄
22:14:40FromDiscord<Recruit_main707> cant help but think about the programming language whenever i see futhark :P
22:20:55arkanoidfuthark == killer feature for nim
22:23:51FromDiscord<Elegantbeef> I know it's against pmunch's intent, but it'd be a lot cooler if it generated a human readable output
22:25:48*py_ joined #nim
22:28:24NimEventerNew thread by exelotl: Fine control over the ordering of linker args?, see https://forum.nim-lang.org/t/9722
22:33:16FromDiscord<Yepoleb> damn, this is magic
22:34:20FromDiscord<Yepoleb> but it can't deal with the macro insanity inside kernel headers
22:40:02moonlithi there, I have a rendering problem, and I'm making a directedPoint tuple: a point (x,y,z) and a direction (x,y,z) as tuples. Can I initialize the tuple with all its members at once? I've tried var cam: directedPoint = ( d: direction = ( x: 1, y: .... ), p: point = ( ... ) ) but it gives me a compilation error, is that not allowed?
22:42:08Amun-Ra_should work without direction = and point =
22:43:28moonlitNice!!! Thanks man! :D
22:43:41Amun-Ra_:>
22:46:29FromDiscord<Michal Maršálek> Often when I write `mySeq.map(someFunc)` I get an error and I have to write `mySeq.map(x => someFunc x)` or `mySeq.mapIt(someFunc it)` instead. How hard would it be to make that conversion automatic?
22:46:36*py_ quit (Ping timeout: 252 seconds)
22:48:26FromDiscord<Yepoleb> what's the benefit of specifying importc with types?
22:56:51*py_ joined #nim
22:58:57*py_ quit (Client Quit)
23:13:44FromDiscord<Elegantbeef> Depends on the error↵(@Michal Maršálek)
23:14:01FromDiscord<Elegantbeef> Allows you to provide Nim friendly names
23:14:08FromDiscord<Elegantbeef> And also the header they come from
23:21:38FromDiscord<Yepoleb> I am already defining the object and it works without importc, but not with, because now the names don't match
23:22:57FromDiscord<Elegantbeef> Code?
23:23:48FromDiscord<Yepoleb> i am not trying to fix it, i saw it works perfectly fine without importc, i am just wondering what the purpose of importc with objects is
23:25:06FromDiscord<Elegantbeef> It tells the compiler not to mangle the name for one
23:25:15FromDiscord<Yepoleb> the sdl2 module for example also doesn't use importc, but the posix module does and that's where i got the idea
23:25:17FromDiscord<Elegantbeef> But you can also do `importc: "myCName"`
23:25:47*Jjp137 quit (Quit: Leaving)
23:26:32FromDiscord<Yepoleb> so it seems to do the same as {.nodecl.} for structs
23:26:57FromDiscord<Elegantbeef> Without a new name yes it would
23:28:05FromDiscord<Yepoleb> i understand, thanks 😊
23:35:43FromDiscord<<She>Horizon</Her>> In reply to @Yepoleb "i am not trying": I thought it was exportc and cdecl?
23:36:09FromDiscord<<She>Horizon</Her>> And importc specifically for importing code from the host/target language
23:58:22FromDiscord<a weird programmer> is there a way to enforce types?
23:58:28FromDiscord<a weird programmer> for example
23:59:03FromDiscord<a weird programmer> sent a code paste, see https://play.nim-lang.org/#ix=4ixX
23:59:14FromDiscord<Elegantbeef> No there is no way to force type annotations