<< 24-04-2023 >>

00:20:27*lucasta joined #nim
00:51:15*krux02 quit (Remote host closed the connection)
01:30:13FromDiscord<etra> does https://play.nim-lang.org loads for anyone?
01:30:34FromDiscord<etra> I'm getting Gateway time-out: Error 504
01:30:38FromDiscord<Yardanico> no, it's down again :9
01:30:39FromDiscord<Yardanico> (edit) ":9" => ":("
01:30:41FromDiscord<Elegantbeef> Pmunch really needs to get a server that's a bit more round than a potato, maybe a mango
01:30:49FromDiscord<Yardanico> i mean, it's not his server
01:30:54FromDiscord<Yardanico> it's whatever Nim gets for free from DO
01:31:00FromDiscord<Yardanico> iirc it has 1gb ram? but i might be totally wrong
01:31:05FromDiscord<Elegantbeef> Right, same difference 😛
01:31:16FromDiscord<Yardanico> @etra there are some alternatives though
01:31:30FromDiscord<Yardanico> e.g. https://wandbox.org/
01:31:36FromDiscord<etra> In reply to @Elegantbeef "Pmunch really needs to": if GlaDOS could survive on a potato...
01:31:47FromDiscord<Yardanico> seems like they removed nim devel though, but they do have latest stable
01:32:09FromDiscord<etra> I wanted to access an old play I did, is there a way?
01:32:16FromDiscord<Yardanico> yes, do you have a url?
01:32:20FromDiscord<etra> yes
01:32:21FromDiscord<Yardanico> nim playground just uses ix.io
01:32:28FromDiscord<Elegantbeef> it's stored on `ix.io` so just drop the ...
01:32:33FromDiscord<Yardanico> http://ix.io/yourid
01:32:56FromDiscord<Yardanico> the ID is what comes after `#ix=`
01:33:07FromDiscord<etra> oh, there it goes, thanks!
02:12:25FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1099880496596516924/image.png
02:12:32FromDiscord<Yardanico> finally, actual cool graphs
02:12:50FromDiscord<Yardanico> (it's not s
02:12:53FromDiscord<Yardanico> (edit) "s" => "seconds actually)"
02:14:31FromDiscord<Elegantbeef> It's years right?
02:14:37FromDiscord<Yardanico> its relative to the baseline :)
02:14:49FromDiscord<Yardanico> which is 1.1 seconds here (1 as a baseline)
02:33:14FromDiscord<Yardanico> with seconds, I use lowestValue 0.9 as the baseline https://media.discordapp.net/attachments/371759389889003532/1099885731675119796/image.png
02:41:43FromDiscord<ringabout> @Yardanico Nice work! Would be a great boost for Nim CI?
02:41:48FromDiscord<ringabout> (edit) "@Yardanico Nice work! Would ... be" added "it"
02:42:32FromDiscord<Yardanico> In reply to @ringabout "<@177365113899057152> Nice work! Would": I mean, PGO can be useful, but I fear it might trigger some hard-to-find bugs in Nim itself
02:42:44FromDiscord<Yardanico> also i haven't built -d:release pgo yet, which is what should be used for CI
02:42:53FromDiscord<Yardanico> and even then, it'll only speedup the nim part, not the C compilation
02:43:12FromDiscord<Yardanico> and then x2 for each new CI we'll have to build a new PGO'd compiler, and doing that takes quite a long time too
02:43:37FromDiscord<Yardanico> basically PGO'ing a compiler is useful when you'll be using the same binary a lot of times afterwards, but in CI you need to have the fresh compiler each run
02:46:11FromDiscord<ringabout> I see
02:46:44FromDiscord<Yardanico> honestly I feel like pgo compiler is most useful for actual end users, especially people who write/use libraries that have a lot of heavy macro code
02:47:06FromDiscord<Yardanico> nim-regex, polymorth, arraymancer, that's why I actually use those projects for profiling
02:47:24FromDiscord<Elegantbeef> Not using CPS programs?
02:47:42FromDiscord<Yardanico> ?
02:48:10FromDiscord<Elegantbeef> CPS is quite macro heavy aswell so it could also be a good candidate to PGO in/test
02:48:19FromDiscord<Yardanico> ohh you mean the lib, sure
02:48:28FromDiscord<Yardanico> if it compiles with devel with no issues it's just 1 more line in the const array
02:48:39FromDiscord<Yardanico> now, the hardest question: what colors do I pick for gcc and clang
02:48:41FromDiscord<Yardanico> in the graph
02:49:13FromDiscord<Elegantbeef> Brown for the gnu and silver for the dragon
02:50:10FromDiscord<Yardanico> you think? https://media.discordapp.net/attachments/371759389889003532/1099889996053356574/image.png
02:50:17FromDiscord<Elegantbeef> Yea
02:50:30FromDiscord<Yardanico> okay, but i'll make that brown a bit lighter
03:02:20NimEventerNew post on r/nim by RememberToBackupData: How do I do a nested sort on a seq of objects, some ascending and others descending?, see https://reddit.com/r/nim/comments/12x0peq/how_do_i_do_a_nested_sort_on_a_seq_of_objects/
03:40:49FromDiscord<Yardanico> uhh
03:40:56FromDiscord<Yardanico> i think my graphs are actually useless
03:41:06FromDiscord<Yardanico> they are all literally almost the same each time
03:41:14FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1099902845769232424/image.png https://media.discordapp.net/attachments/371759389889003532/1099902846025072700/image.png https://media.discordapp.net/attachments/371759389889003532/1099902846297702542/image.png
03:41:30FromDiscord<Yardanico> basically the different compiler binaries are faster by a constant x that doesn't actually get changed a lot depending on the project
03:55:04FromDiscord<Yardanico> i want to find some nim project that won't follow the same graphs aaa
04:11:06*ltriant joined #nim
04:12:25*ltriant_ quit (Ping timeout: 240 seconds)
04:34:25*azimut joined #nim
04:44:07NimEventerNew thread by Yardanico: Small experiment with compiling the Nim compiler with PGO, see https://forum.nim-lang.org/t/10128
05:24:03*advesperacit joined #nim
05:58:37*m5zs7k quit (Ping timeout: 255 seconds)
05:58:37*om3ga quit (Ping timeout: 255 seconds)
05:58:37*droidrage quit (Ping timeout: 255 seconds)
05:58:43*om3ga_ joined #nim
05:58:52*m5zs7k_ joined #nim
06:07:15FromDiscord<qb> Is this still the way to go or are there more elegant ways yet to run synchronous code in a async event loop? https://forum.nim-lang.org/t/6889#43141
06:07:54*m5zs7k_ is now known as m5zs7k
06:11:58FromDiscord<Dudugz> So what you want is to asyncify a sync proc?
06:12:21FromDiscord<Dudugz> I think if so then it seems like the only viable solution at the moment
06:14:07FromDiscord<Yardanico> In reply to @qb "Is this still the": Maybe https://github.com/yglukhov/asyncthreadpool , haven't tried
06:14:18FromDiscord<Yardanico> But that code in the forum post looks simple enough
06:15:06FromDiscord<Dudugz> The question is why?
06:15:29FromDiscord<Yardanico> ?
06:15:36FromDiscord<Dudugz> Wouldn't it be simpler to have an async function and call it and use await? The code will keep waiting anyway.
06:15:45FromDiscord<Yardanico> Uhh no
06:16:04FromDiscord<Yardanico> If you have synchronous code that takes a while to execute, it'll block the entire program
06:16:05FromDiscord<qb> Thanks 🙂
06:16:12FromDiscord<Yardanico> Async is single threaded
06:16:21FromDiscord<Yardanico> In Nim by default
06:16:29FromDiscord<Dudugz> In reply to @Yardanico "If you have synchronous": Yes, that makes sense, I'm talking about making the function async
06:16:36FromDiscord<Yardanico> but that won't change anything
06:16:45FromDiscord<Yardanico> If it has synchronous code
06:16:55FromDiscord<Dudugz> You can use await sleepAsync(0) to not block
06:16:58FromDiscord<Yardanico> You can only make IO stuff into async
06:17:03FromDiscord<Yardanico> In reply to @Dudugz "You can use await": Again, no
06:17:09FromDiscord<Dudugz> Hm
06:17:20FromDiscord<Yardanico> Even if you define it as an async function and it has sync blocking code, it'll block
06:17:29FromDiscord<Yardanico> In fact that's how async Nim code always works
06:17:45FromDiscord<Dudugz> well yes that makes sense
06:17:48FromDiscord<Elegantbeef> Async in Nim only is non blocking if the code has a place to return the cpu
06:17:52FromDiscord<Yardanico> At the singular point in time there's only one line running
06:18:12FromDiscord<Elegantbeef> But even then it's technically blocking if we want to be pedantic 😄
06:18:22FromDiscord<Yardanico> it just switches between async coroutines fast enough when they wait for IO
06:19:42FromDiscord<Dudugz> So if you want to avoid this is it better to use spawn?
06:20:16madpropscan github actions compile nim programs?
06:20:22FromDiscord<Yardanico> if you have blocking code that'll run for quite some time and you want async stuff to work, you use threads
06:20:27FromDiscord<Yardanico> In reply to @madprops "can github actions compile": Of course
06:20:36madpropswhoa. im just learning about this
06:20:40FromDiscord<Dudugz> In reply to @madprops "can github actions compile": I think so, I set up a workflow to run my tests
06:20:44FromDiscord<Yardanico> They're just CI
06:20:51FromDiscord<Yardanico> That run VMs
06:21:02FromDiscord<Dudugz> In reply to @Yardanico "if you have blocking": Ok thx
06:21:04FromDiscord<Yardanico> You can run anything on them really, and for Nim there's a ready to use template
06:21:11madpropsso github will compiled optimized binaries for free?
06:21:20madpropscompile*
06:21:33FromDiscord<Yardanico> it you don't go over limits, yes
06:21:34FromDiscord<Yardanico> https://github.com/marketplace/actions/setup-nim-environment
06:22:03FromDiscord<Yardanico> <https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits>
06:22:42FromDiscord<Dudugz> Hmm I wonder if it's possible to build in a private repository and publish the artifact in another repository which is public.
06:22:52FromDiscord<Yardanico> it is
06:23:11FromDiscord<Dudugz> well this will come in handy 😁
06:24:11FromDiscord<Dudugz> I have a project where the code is private for security reasons, but exposing the binaries is fine.
06:24:41FromDiscord<Elegantbeef> "code is private for security reasons"
06:24:55FromDiscord<Elegantbeef> Cmon obscurity is not security
06:25:12FromDiscord<Dudugz> Hm, it's not for the code itself, the code can be done by anyone
06:26:03FromDiscord<Dudugz> In reply to @Elegantbeef "Cmon obscurity is not": I know, but there are contributors, I'm not the only one on the project because I'm not able to fix all the edge-cases by myself.
06:26:17FromDiscord<Dudugz> (edit) "fix" => "fix/catch"
06:26:52FromDiscord<Dudugz> This is also why exposing the binaries is safe, anyone can reverse engineer the binaries.
06:27:29FromDiscord<Elegantbeef> I'm just too biased, I think any proprietary software is unsafe
06:27:30FromDiscord<Dudugz> But I'm also trying to change that, I'm going to talk to people to make the repository public.
06:27:54FromDiscord<Elegantbeef> closed source proprietary\
06:28:13FromDiscord<Dudugz> Hm, well, if you don't know what the software does then it makes sense. But sometimes I think people are too scared.
06:28:25FromDiscord<Elegantbeef> Looks at lastpass
06:29:25FromDiscord<Dudugz> Just to be ironic, the repository is private with an MIT license lol
06:29:41FromDiscord<Dudugz> I mean, anyone with access to the code can edit the code.
06:29:44FromDiscord<Elegantbeef> Doesnt that technically put you at risk
06:30:08FromDiscord<Elegantbeef> If the code is released accidentally you have no legal basis to quell it
06:30:54FromDiscord<Dudugz> In reply to @Elegantbeef "Doesnt that technically put": Yup, but there's no point in making the code private too, just tweaking a few things here and there.
06:31:54FromDiscord<Dudugz> About the license, I personally prefer that people have the freedom to do what they want with what I develop. I think it's the feeling of those who have participated in modding communities
06:32:52FromDiscord<Elegantbeef> So yea i sorta agree
06:32:55FromDiscord<Elegantbeef> I have the view that all software should be free and aside from paths to profit like games, it should be permissively licensed
06:35:09FromDiscord<Dudugz> Yea, but games I understand why they are private. Hackers would love to exploit any security holes they can identify.
06:35:38FromDiscord<Dudugz> and as you said there is the issue that they can be paid for, it makes no sense to pay for software you can get for free.
06:37:29FromDiscord<Elegantbeef> Hackers isnt an issue
06:37:35FromDiscord<Elegantbeef> Oh noes my single player game has hackers
06:37:49FromDiscord<Dudugz> Not for single player but for multi player
06:38:09FromDiscord<Dudugz> Nobody cares if a singleplayer game gets hacked lol it doesn't affect the game ecosystem.
06:38:32FromDiscord<Elegantbeef> Meh hackers still get by even anticheat so it's not like source would do anything but show issues faster
06:39:26FromDiscord<Dudugz> Maybe, Riot Games was fancy with Vanguard running at the kernel level and hackers are already managing to bypass it.
06:39:54FromDiscord<Elegantbeef> I mean fallguys is a prime example of a poorly designed game 😄
06:39:54madpropspasting that into the yml file didn't work https://i.imgur.com/Qbh8TCh.jpg
06:39:59madpropssays theer's an error in line 1
06:40:23FromDiscord<Elegantbeef> It's a networked physics game that had hackers and needed an anticheat, instead of just being designed with server authority and client interpolation
06:40:41FromDiscord<Dudugz> yea
06:41:16FromDiscord<Dudugz> In reply to @madprops "pasting that into the": Well because it does, YAML works with indentation and for me everything seems to be in the same column
06:41:28madpropsit says: Invalid workflow file
06:41:39madprops.github/workflows/github-action.yml
06:41:44madpropsi used a custom name
06:41:46FromDiscord<Dudugz> Oh, did you just paste this?
06:41:56madpropsyeah
06:42:15FromDiscord<Dudugz> It's not a matter of the name, it's a matter of not being correctly configured, it would be better to have created a workflow on Github itself
06:42:33madpropsoh
06:42:38FromDiscord<Dudugz> https://github.com/dark-mice/core/blob/master/.github/workflows/run_tests.yml
06:42:50FromDiscord<Dudugz> look at mine and you will see what i mean
06:43:10madpropsi see so it adds a bunch of other stuff
06:44:02*lucasta quit (Remote host closed the connection)
06:44:16FromDiscord<Dudugz> Yup, it was better to have created it on github to come with the default configuration and then just paste the steps there
06:44:39*lucasta joined #nim
06:44:49madpropsi deleted the dir
06:44:53madpropstrying again
06:46:01*lucasta quit (Client Quit)
06:47:36madpropsnot sure this helps https://docs.github.com/en/actions/quickstart
06:48:01FromDiscord<Dudugz> clicking on Actions in your repository you will see the New workflow button to create a default file. https://media.discordapp.net/attachments/371759389889003532/1099949852328198235/Screenshots_2023-04-24-02-47-17.png
06:48:55FromDiscord<Dudugz> In reply to @madprops "not sure this helps": Yeah that's what helped me understand GA lol, what I posted above was my first time creating a workflow on github
06:50:23madpropsso i have this now https://github.com/madprops/goldie/blob/main/.github/workflows/nim.yml
06:50:31madpropsnow add the thing i pasted there i guess
06:51:14FromDiscord<Dudugz> yup what you posted goes inside the steps
06:53:34FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u9o
06:53:49FromDiscord<Dudugz> Then ``nimble test`` compiles and runs the binary in the folder
06:54:09madpropsthink the playground is broken
06:54:28madpropsbut i got a green indicator on the build
06:54:28FromDiscord<Dudugz> I think they were saying earlier that it was off the air
06:54:37FromDiscord<Dudugz> (edit) removed "the air"
06:55:11madpropsi have the idea action builds are automatically available on my repo to anyone
06:55:19FromDiscord<Dudugz> Wait, what are you talking about exactly?
06:55:44madpropshttps://i.imgur.com/c826N0S.jpg
06:56:18FromDiscord<Dudugz> If you talk about the workflow you just installed Nim in the vm I think, you need to add commands to do what you want
06:56:29madpropsahh
06:56:50madpropsi'll check your repo again
06:56:51FromDiscord<Dudugz> Yes, this green mark indicates that the workflow ran successfully
06:58:13FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4u9p
06:58:41FromDiscord<Dudugz> (edit) "https://play.nim-lang.org/#ix=4u9p" => "https://play.nim-lang.org/#ix=4u9q"
06:58:46madpropsim running a CI job
06:58:49madpropsin progress
06:59:18*Notxor joined #nim
06:59:24madpropssorry i can't access those texts
07:01:07madpropsi'll try this later
07:01:11madpropsate too much pizza
07:36:33FromDiscord<ricky> In reply to @Dudugz "Maybe, Riot Games was": DMA gang
07:37:11FromDiscord<Dudugz> What is DMA?
07:40:31FromDiscord<Rika> direct memory access i assume>
07:40:34FromDiscord<Rika> (edit) "assume>" => "assume?"
07:41:18FromDiscord<Z3NTL3> sent a code paste, see https://play.nim-lang.org/#ix=4u9v
07:41:19FromDiscord<Z3NTL3> why does this not workj
07:41:29FromDiscord<Rika> openarray isnt a "concrete type"
07:41:29FromDiscord<Z3NTL3> openArray[T]↵..?
07:41:34FromDiscord<Z3NTL3> ooh
07:41:36FromDiscord<Rika> aka you cant use it as a variable type
07:41:42FromDiscord<Z3NTL3> but i need to
07:41:47FromDiscord<Rika> why
07:41:59FromDiscord<Z3NTL3> sent a code paste, see https://play.nim-lang.org/#ix=4u9w
07:41:59FromDiscord<Rika> seqs are openarrays
07:42:00FromDiscord<Z3NTL3> bcs i want to use this proc
07:42:03FromDiscord<Z3NTL3> In reply to @Rika "seqs are openarrays": AHH
07:42:06FromDiscord<Z3NTL3> oke ty
07:42:09FromDiscord<Rika> arrays are openarrays too
07:42:27FromDiscord<Z3NTL3> k
07:42:29FromDiscord<Z3NTL3> didnt know
07:42:48FromDiscord<Z3NTL3> so openarray is just the base ref for all kind of arrays
07:42:51FromDiscord<Z3NTL3> seqs, and normal arr
07:43:19FromDiscord<Rika> pretty much
07:43:28FromDiscord<Rika> its more complex than that but for now you can think of it that way
07:48:09FromDiscord<Z3NTL3> sent a code paste, see https://play.nim-lang.org/#ix=4u9y
07:48:10FromDiscord<Z3NTL3> i am trying something to test
07:48:16FromDiscord<Z3NTL3> but i cant grab the returned value from the thread
07:48:31FromDiscord<Z3NTL3> the dt in the for loop gives me an err
07:48:59FromDiscord<Z3NTL3> "message": "expected: ':', but got: 'keyword var'",
07:49:26FromDiscord<Z3NTL3> nvm works
07:49:32FromDiscord<Z3NTL3> sent a code paste, see https://play.nim-lang.org/#ix=4u9z
07:49:39FromDiscord<Z3NTL3> bruh i didnt see that i missed the semi colon on the .pairs()<>
08:09:03FromDiscord<ricky> In reply to @Rika "direct memory access i": yeh i'm on that life 😎
08:09:19FromDiscord<ricky> `ring -666` shit
08:38:49FromDiscord<Z3NTL3> when I do spawnX i get gcsafe call expression
08:38:57FromDiscord<Z3NTL3> spawnX(test())
08:39:00FromDiscord<Z3NTL3> whats wrong with this
08:48:55FromDiscord<Z3NTL3> fixed it by making it gc safe
09:06:12*kenran joined #nim
09:24:25*kenran quit (Ping timeout: 240 seconds)
09:24:29*Notxor quit (Remote host closed the connection)
09:26:30*Notxor joined #nim
09:30:29*fredrikhr92 is now known as fredrikhr
10:01:39FromDiscord<Chronos [She/Her]> I'm gonna be making a `DataProvider` type, but I want it so I don't need to know the exact type, how does the streams API do it?
10:07:58FromDiscord<Rika> Streams uses OOP
10:07:59FromDiscord<Rika> well
10:08:07FromDiscord<Rika> Some weird form of it IIRC
10:21:02*derpydoo quit (Quit: derpydoo)
10:23:29*om3ga_ is now known as om3ga
10:36:15FromDiscord<Chronos [She/Her]> Hm
10:49:35*droidrage joined #nim
13:04:40*Notxor quit (Remote host closed the connection)
13:06:19*Notxor joined #nim
13:07:48FromDiscord<Chronos [She/Her]> Okay... Not sure how to abstract the data provider?
13:08:27FromDiscord<Chronos [She/Her]> A data provider should be a simple abstraction layer over multiple types of data storage (Example: JSON, MongoDB, Sqlite3)
13:12:29FromDiscord<Rika> you need a standardised form of accessing this data from the provider by abstraction
13:12:39FromDiscord<Rika> think about the format you want to receive the data in
13:12:46FromDiscord<Rika> make these providers return this standard format
13:20:41FromDiscord<pysan> sent a code paste, see https://play.nim-lang.org/#ix=4uaK
13:21:28FromDiscord<pysan> I would like to somehow simplify the repetitive pattern. Is there a way to accomplish?
13:34:00*jmdaemon quit (Ping timeout: 260 seconds)
13:36:25FromDiscord<Chronos [She/Her]> Any up-to-date MongoDB drivers? :p
14:01:41FromDiscord<auxym> In reply to @pysan "I would like to": what exactly would you like to simply? One thing I see is you could define an enum type for your `t` field and set constants that can be reused for each case
14:01:47FromDiscord<auxym> (edit) "simply?" => "simplify?"
14:03:54FromDiscord<pysan> In reply to @auxym "what exactly would you": I would like to define in such way like
14:05:17FromDiscord<pysan> (edit) "In reply to @auxym "what exactly would you": I would like to define in such way like" => "sent a code paste, see https://play.nim-lang.org/#ix=4uaZ"
14:11:04FromDiscord<auxym> a macro could do that. I'm not aware of an existing lib to do exactly that though, so you'll have to write it yourself
14:17:23FromDiscord<pysan> Could you guide me how to implement that? I'm afraid I'm not very used to macros...
14:33:11FromDiscord<auxym> here's a good tutorial: https://dev.to/beef331/demystification-of-macros-in-nim-13n8
14:35:23FromDiscord<auxym> the idea is that macros allow AST manipulation. You have the desired "DSL" (the short code you posted second), you can use `dumpTree` to see what kind of AST that creates. Then you have the desired target AST, which is your original code above (also use dumptree on that). Your macro will be nim code that transforms the short code AST into the target "long" AST.
14:35:43*arkurious joined #nim
14:35:48*arkurious quit (Remote host closed the connection)
14:40:46FromDiscord<xTrayambak> Hello everyone, I have a small question -- How can I make a function that takes an int as an argument and if the int is 1, returns an int, if the int is 2, returns a string and if the int is 3, returns a bool? I tried the auto keyword but that doesn't seem to help.
14:43:40FromDiscord<demotomohiro> You probably can do that if an argument was static[int] and use `when` instead of if.
14:48:39FromDiscord<demotomohiro> If the argument was runtime value, you cannot change return time at runtime.↵https://internet-of-tomohiro.netlify.app/nim/faq.en.html#procedures-how-to-vary-a-return-type-of-procedure-at-runtimeqmark
14:49:28FromDiscord<demotomohiro> you cannot change return type at runtime.
15:03:21FromDiscord<Andreas> In reply to @xTrayambak "Hello everyone, I have": return a `JsonNode` with a `.value` -field that carries your `int/string/bool`.
15:04:56FromDiscord<xTrayambak> Alright, thank you both of you, for now I am going to just use seperate functions for seperate types, as that seems the easiest (and laziest) way out of it. I've been using Nim for around 1.5 years now (1 year if you minus the learning time) and it feels great to use!
15:07:38*fredrikhr quit (Quit: Disconnecting...)
15:20:23*progranner joined #nim
15:37:23*beholders_eye quit (Ping timeout: 264 seconds)
15:38:10*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
15:40:00*progranner joined #nim
15:50:59FromDiscord<Nerve> In Nim you cannot have multiple return types, only input types. To emulate multiple return types, you can either use an object variant or a JsonNode, and JsonNode is pretty easy to use.
15:51:06FromDiscord<Nerve> (edit) "input" => "parameter"
15:51:25FromDiscord<Nerve> That's just the nutshell of what Tray said
15:51:37FromDiscord<Nerve> (edit) "nutshell" => "why/how"
15:51:44FromDiscord<Nerve> (edit) "why/how" => "why part"
15:51:51FromDiscord<Nerve> Andreas
15:51:59FromDiscord<Nerve> (edit) "Tray" => "Andreas"
16:05:26NimEventerNew thread by alexeypetrushin: Why astToStr doesn't work inside template?, see https://forum.nim-lang.org/t/10130
16:09:45FromDiscord<michaelb.eth> I have a seq[X] whose length I can only know at runtime, and an imported C function that takes as an argument a C array (od type X) of undetermined size
16:10:28FromDiscord<michaelb.eth> how can I convert the seq[X], using UncheckedArray in some manner?
16:11:20FromDiscord<michaelb.eth> (edit) "seq[X]," => "seq[X] for calling the C function?"
16:11:32FromDiscord<michaelb.eth> (edit) "(od" => "(of"
16:15:19FromDiscord<Z3NTL3> when i use socket module and use sock stream iprototcp and after words when i do setSockOpt IPPROTO raw it says unsupported protocol..?
16:16:21FromDiscord<Z3NTL3> (edit) "words" => "wards"
16:16:28FromDiscord<demotomohiro> In reply to @michaelb.eth "I have a seq[X]": `if myseq.len != 0: cast[ptr UncheckedArray[X]](myseq[0].addr) else: nil`.
16:16:49FromDiscord<michaelb.eth> In reply to @demotomohiro "`if myseq.len != 0:": cool, thanks!
16:44:49NimEventerNew thread by Angluca: Can I quick get table last key value use like at(idx) function?, see https://forum.nim-lang.org/t/10131
16:57:44*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
16:59:30*rockcavera joined #nim
16:59:51*progranner joined #nim
17:04:36*beholders_eye joined #nim
17:05:45*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:06:26*progranner joined #nim
17:17:10*xet7_ joined #nim
17:17:27*xet7_ quit (Client Quit)
17:18:07*xet7_ joined #nim
17:20:05*xet7 quit (Ping timeout: 240 seconds)
17:22:01*xet7_ is now known as xet7
17:28:32*xet7 quit (Quit: Leaving)
17:28:58*xet7 joined #nim
17:32:50*xet7 quit (Remote host closed the connection)
17:35:28*xet7 joined #nim
17:45:50*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
17:46:14*lucasta joined #nim
17:48:36*xet7 quit (Remote host closed the connection)
17:49:27*Goodbye_Vincent quit (Read error: Connection reset by peer)
17:50:40*Goodbye_Vincent joined #nim
17:53:18*progranner joined #nim
17:54:05*rockcavera quit (Read error: Connection reset by peer)
17:54:51*xet7 joined #nim
17:55:05*rockcavera joined #nim
17:55:05*rockcavera quit (Changing host)
17:55:05*rockcavera joined #nim
18:10:06*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:12:45*progranner joined #nim
18:24:12*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:25:57*progranner joined #nim
18:26:53*Goodbye_Vincent quit (Remote host closed the connection)
18:27:38*Goodbye_Vincent joined #nim
18:31:54*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:32:46*progranner joined #nim
18:38:40*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
18:39:23*progranner joined #nim
18:41:15*beholders_eye quit (Quit: WeeChat 3.6)
18:43:31FromDiscord<Andreas> howto gracefully shutdown AsyncHttpServer ? A simple `server.close()` results in a error ? Is that possible when the server was started like so :↵`waitFor server.serve( Port( options.port ), cb )`
19:04:28*Goodbye_Vincent quit (Remote host closed the connection)
19:05:14*Goodbye_Vincent joined #nim
19:10:58*krux02 joined #nim
19:15:50FromDiscord<Require Support> TIL nim can be compiled for android, this is amazing
19:32:55FromDiscord<demotomohiro> Running Nim code on android using termux is easy.
19:37:52FromDiscord<ElegantBeef> oh boy is the bridge behind
19:39:40FromDiscord<Yardanico> In reply to @ElegantBeef "oh boy is the": discord specifically breaking the bridge so beef uses discord
19:39:48FromDiscord<ElegantBeef> Wouldnt doubt it
19:40:08FromDiscord<Yardanico> and right now I'm trying to figure out nimbus-eth2 with just a `nim` command, disregarding all the shell scripts
19:40:15FromDiscord<Elegantbeef> undefined
19:40:22FromDiscord<Yardanico> lol
19:40:29FromDiscord<Yardanico> did you actually send that or it's really freaking out
19:40:32FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1100144258377334834/image.png
19:40:33FromDiscord<Yardanico> like what is this
19:40:41FromDiscord<ElegantBeef> I deleted the message before the bridge sent it
19:40:48FromDiscord<ElegantBeef> Assuming it'd send nothing, but nope JS land probably
19:40:58FromDiscord<Yardanico> yeah
19:41:35FromDiscord<Q-Master> e.x. https://github.com/Q-Master/nimongo not so up-to-date, but anyways \:)
19:41:55FromDiscord<Elegantbeef> The matrix bridge is like 8 hours behind 😄
19:42:03*Goodbye_Vincent quit (Remote host closed the connection)
19:42:07FromDiscord<Elegantbeef> Oh there we go it's one way time is fast now
19:42:17FromDiscord<Yardanico> aaaaaaaa
19:42:19FromDiscord<Yardanico> 123
19:42:25FromDiscord<Yardanico> you should use irc as god intended
19:42:34FromDiscord<ElegantBeef> Nah we should just close discord and use matrix
19:42:49*Goodbye_Vincent joined #nim
19:42:54FromDiscord<Yardanico> i will use matrix once it has a good client comparable to tdesktop that's not based on electron :)
19:42:57FromDiscord<Yardanico> also hopefully voice
19:43:05FromDiscord<Yardanico> yes i know it has voice, but it's quite bad
19:43:13FromDiscord<ElegantBeef> It has 1:1 voip 😛
19:43:30FromDiscord<Yardanico> but does it have desktop streaming that can handle 1080p60fps :P
19:43:37FromDiscord<Yardanico> (telegram doesn't either though)
19:43:52FromDiscord<ElegantBeef> No clue I've actually never used voip on matrix
19:47:50FromDiscord<Yardanico> finally https://media.discordapp.net/attachments/371759389889003532/1100146099513212968/image.png
19:47:54FromDiscord<Yardanico> it is building
19:49:29FromDiscord<Yardanico> damn nimbus is indeed very rough with compile times
19:49:46FromDiscord<Yardanico> the nim step itself (no C compiler) takes 1 minute 6 seconds
19:50:03FromDiscord<Yardanico> surely PGO will speed it up at least 2x
19:50:20FromDiscord<Yardanico> although I will first just compile the pgo compiler from status' fork without using nimbus itself for profiling pgo
19:50:22FromDiscord<ElegantBeef> I'd guess something like a 30% speed up 😄
19:50:58FromDiscord<Yardanico> also not sure what version to build
19:51:04FromDiscord<Yardanico> do i do danger clang pgo or release clang, since that's more realistic
19:51:08FromDiscord<Yardanico> (edit) "clang," => "clang pgo,"
19:51:18FromDiscord<Yardanico> well let's do danger for now
19:51:59FromDiscord<Yardanico> ah right, and I'll not build with orc since it's useless for nimbus
19:52:33FromDiscord<Yardanico> ah lol
19:52:35FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1100147294533328966/image.png
19:52:39FromDiscord<Yardanico> since I have the status' nim in path
19:52:45FromDiscord<Yardanico> wait no
19:52:45FromDiscord<Yardanico> huh
19:52:55FromDiscord<Yardanico> ah right yeah It should use the status 'nim
19:54:50FromDiscord<Yardanico> oh, right, and the repos I'm using for profiling might not compile with 1.6.11 anymore, we'll see
19:57:36*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
19:58:45*krux02 quit (Remote host closed the connection)
19:59:04*krux02 joined #nim
20:01:03FromDiscord<Yardanico> noo https://media.discordapp.net/attachments/371759389889003532/1100149424916795463/image.png
20:01:14FromDiscord<Yardanico> ah makes sense, stupid me
20:01:27*progranner joined #nim
20:04:50FromDiscord<Yardanico> finally, nimium
20:04:52FromDiscord<Yardanico> /home/dian/Projects/NimExperiments/status/nim-status/bin/nim_pgo_clang
20:06:50FromDiscord<Yardanico> what
20:07:09FromDiscord<Yardanico> it took longer than without pgo lol 🤔 did i actually build a pgo compiler correctly?
20:07:34FromDiscord<ElegantBeef> Did you bench against the actual status Nim or the other Nim?
20:07:50FromDiscord<Yardanico> I compiled normal status nim and pgo'd status nim with clang with danger
20:07:52*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:07:58FromDiscord<Yardanico> but yeah, lemme try to do it again but also profile nimbus itself
20:08:31*krux02 quit (Quit: Leaving)
20:10:00FromDiscord<Yardanico> maybe it's ORC that magically gets much faster with PGO? 🤔
20:10:15FromDiscord<Yardanico> since status' nim fork uses refc
20:10:31FromDiscord<ElegantBeef> Perhaps
20:10:55FromDiscord<ElegantBeef> That actually would make some sense given it has a bit of overhead to insert destructors
20:11:46FromDiscord<Yardanico> but 1.7x?
20:12:13FromDiscord<Yardanico> but yeah I'm rebuilding with same profiling repos right now just to make sure I didn't make a mistake somewhere
20:14:25*progranner joined #nim
20:18:26*progranner quit (Client Quit)
20:18:51FromDiscord<Yardanico> yeah @ElegantBeef I think that orc is generally much better suited for PGO, not just because of overhead
20:19:11FromDiscord<Yardanico> for comparison, building the status' nim compiler (which is basically 1.6.12 with some stuff changed) takes 6 seconds with default-built -d:release nim compiler
20:19:14FromDiscord<Yardanico> and 5 with pgo'd clang
20:19:23FromDiscord<Yardanico> while for devel it takes around the same 6 seconds with default -d:release gcc and 3.5 with clang'd pgo
20:19:39*Goodbye_Vincent quit (Remote host closed the connection)
20:19:49FromDiscord<ElegantBeef> I mean that destructor insertion logic might be capable of being optimised better with PGO information
20:19:55FromDiscord<Yardanico> yeah that's what I think too
20:19:57FromDiscord<Yardanico> very good ;)
20:20:23*Goodbye_Vincent joined #nim
20:28:50*progranner joined #nim
21:00:39*Goodbye_Vincent quit (Remote host closed the connection)
21:01:24*Goodbye_Vincent joined #nim
21:16:16FromDiscord<Oscour> In reply to @sOkam! "i dont understand your": Ok, I know it's a bit late from when we had that conversion but I just understood what you meant and i'm completely going to discard the nammed tuple and go for an array with enums as keys
21:16:42FromDiscord<ElegantBeef> Using good features of the language, nice
21:18:07FromDiscord<Oscour> (edit) "keys" => "indexes"
21:18:37FromDiscord<sOkam!> In reply to @Oscour "Ok, I know it's": pretty much, yep. no worries↵coming from python (i had the same issue) where literally everything is a string, its a big mindshift to think in nim types instead
21:20:40FromDiscord<Oscour> Yeah but I actuallyu love it. Yesterday once I got going it was great. Just some issues with uint16, int16, int8, uint8 sometimes because I'm programming an MPU for a microcontroller and I must use both type...
21:22:05FromDiscord<Oscour> I have a question about enums, I have seen multiple time things like this for example:
21:22:29FromDiscord<sOkam!> i find it faster to write than python, simply because the compiler has you covered with plenty of error messages↵while in python everything silently works
21:22:30FromDiscord<Oscour> (edit) "I have" => "sent" | "question about enums, I have seen multiple time things like this for example:" => "code paste, see https://play.nim-lang.org/#ix=4ucz"
21:22:35FromDiscord<Oscour> And i don't understand what it means
21:22:47FromDiscord<ElegantBeef> You certainly did not see ` = 0` twice
21:22:58FromDiscord<ElegantBeef> You give the enum an ordinal value is all that means
21:22:59FromDiscord<sOkam!> yeah, 0 twice doesn't make sense
21:23:08FromDiscord<ElegantBeef> Imagining you mean `= 9`
21:23:16FromDiscord<ElegantBeef> `ord(Enum5) == 9`
21:23:19FromDiscord<ElegantBeef> Is all it really means
21:23:24FromDiscord<Oscour> In reply to @sOkam! "i find it faster": Yes and no. I am clearly not experienced enough but having a realtime linter like pylint is actually a huuge time saver
21:24:32FromDiscord<sOkam!> In reply to @Oscour "Yes and no. I": i used pyright in python. and while that is a big timesaver, it still doesn't stop you from shooting yourself in the foot with incorrect data types, unless you hardcode the types and even then it becomes more of a pain than a feature 😔
21:24:39FromDiscord<Oscour> I didn't see enums with multiple zero but I saw some with values, then no value, then another zero
21:24:51FromDiscord<huantian> In reply to @sOkam! "i used pyright in": pyright != pylint
21:24:51FromDiscord<ElegantBeef> Yea it just give them values
21:25:14*beholders_eye joined #nim
21:25:18FromDiscord<ElegantBeef> so it's 0, 1, 2, 3, 9
21:25:33FromDiscord<ElegantBeef> So internally your enum is actually `9` assuming you do `MyEnum = 9`
21:25:44FromDiscord<ElegantBeef> Then `ord(Enum6) == 10`
21:25:52FromDiscord<Oscour> In reply to @huantian "pyright != pylint": To be fair, Pylint isn't better in that regard sadly :/
21:26:11FromDiscord<huantian> yeah but you'd use both tools in conjunction
21:26:31FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4ucB
21:26:31FromDiscord<huantian> so while neither are perfect, and both together aren't perfect, it's unfair to compare only using one to using both
21:27:19FromDiscord<Oscour> In reply to @ElegantBeef "Yea it just give": Ok I Think I see what you mean. When I saw that I was confused because I couldn't get the value in the enum
21:27:35FromDiscord<Oscour> And it is not explained in the tutorials I watched
21:28:09FromDiscord<Oscour> Never used pyright, I will surely take a look at it!
21:28:19FromDiscord<Oscour> But sadly, I can't even install pylint at work lmao
21:30:11FromDiscord<Oscour> I'm stuck with jedi I believe. is there a way to have a realtime linter for Nim in vscode? I would guess no because it's a compile language...
21:30:25FromDiscord<ElegantBeef> Enable auto save and there you go
21:31:03FromDiscord<huantian> it's definitely possible but nobody has made an actual linter for nim iirc
21:31:14FromDiscord<ElegantBeef> Isnt nim check a linter
21:31:48FromDiscord<Oscour> In reply to @ElegantBeef "Enable auto save and": https://tenor.com/view/hacker-hackerman-kung-fury-gif-7953536
21:31:50FromDiscord<huantian> I thought nim check just checked if it compiles
21:31:55FromDiscord<Yardanico> In reply to @huantian "I thought nim check": it shows you all errors
21:31:56FromDiscord<ElegantBeef> Isnt that what a linter is for
21:31:57FromDiscord<Yardanico> and warnings and hints
21:32:22FromDiscord<ElegantBeef> > lint-like tools have also evolved to detect an even wider variety of suspicious constructs. These include "warnings about syntax errors, uses of undeclared variables, calls to deprecated functions, spacing and formatting conventions, misuse of scope, implicit fallthrough in switch statements, missing license headers, [and]...dangerous language features".[6]
21:32:31FromDiscord<ElegantBeef> So literally what Nim does out of the box
21:32:42FromDiscord<huantian> ig
21:32:52FromDiscord<Oscour> well, i'm just gonna enable autosave lmao
21:32:55FromDiscord<huantian> I usually expect a linter to have more than what is built into the nim compiler
21:33:05FromDiscord<ElegantBeef> I mean we already have the best linter thanks to term rewriting macros
21:33:11FromDiscord<ElegantBeef> And I will die on this hill
21:33:11FromDiscord<Yardanico> oh right @Beef Broccoli pgo'd compiler is also ~1.7x faster at nim check which makes sense
21:33:17FromDiscord<Yardanico> what
21:33:18FromDiscord<ElegantBeef> Semantic linting is wonderful
21:33:18FromDiscord<huantian> wrong beef
21:33:19FromDiscord<Yardanico> who is that
21:33:26FromDiscord<ElegantBeef> No clue but do not ping me on discord please
21:33:27FromDiscord<ElegantBeef> Thanks
21:33:30FromDiscord<Yardanico> okay
21:33:38FromDiscord<Yardanico> do you get pinged by @beef on matrix
21:33:41FromDiscord<huantian> In reply to @ElegantBeef "Semantic linting is wonderful": yeah I agree, it's just not being taken advantage of
21:33:48FromDiscord<ElegantBeef> `beef` or `elegantbeef` both work
21:33:54FromDiscord<Yardanico> In reply to @huantian "yeah I agree, it's": did you see the thing beef's referring to? :P
21:34:14FromDiscord<ElegantBeef> Fuuuck my Ps3's FTP server died after copying 1.3gb, i swear these servers are prograrmmed on a potato
21:34:29FromDiscord<ElegantBeef> Using TRM for linting is genious
21:34:33FromDiscord<ElegantBeef> genius even
21:35:01FromDiscord<ElegantBeef> https://forum.nim-lang.org/t/9739#64098 here's what yard considers cursed
21:35:17FromDiscord<Yardanico> it's not cursed, it's good ;)
21:36:13FromDiscord<huantian> but what I'm not talking about is exactly how it's done, but rather pointing out linting as another aspect of nim tooling not up to snuff
21:36:29FromDiscord<Beef Broccoli> In reply to @Yardanico "who is that": one of the hundreds on users in this discord.
21:36:36FromDiscord<Beef Broccoli> (edit) "on" => "of"
21:36:39FromDiscord<Yardanico> yeah, but you mean thousands
21:37:02FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1100173577367593192/image.png
21:37:11FromDiscord<huantian> like for example, there could be a lint rule to prevent manually setting enum values to powers of two
21:37:22FromDiscord<huantian> and instead recommends you to use sets
21:37:31FromDiscord<Yardanico> In reply to @huantian "like for example, there": but again, you can probably do that with what beef showed, no?
21:37:39FromDiscord<huantian> yeah I'm not saying you can't
21:37:48FromDiscord<huantian> I'm just pointing out nobody has done it
21:37:51FromDiscord<ElegantBeef> Well be the change you want to see
21:37:51FromDiscord<Yardanico> also regarding sets, we finally got https://github.com/nim-lang/Nim/pull/21659
21:38:02FromDiscord<Yardanico> which also fixed some cases where stdlib used big sets
21:38:06*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:38:38FromDiscord<huantian> ugh why the heck is my xdg desktop portal not using my default browser
21:39:22*ehmry joined #nim
21:40:16FromDiscord<huantian> In reply to @ElegantBeef "Well be the change": probably the correct course of action
21:41:33FromDiscord<ElegantBeef> Thanks to TRMs a linter really can be as simple as `nimble install linterProject` and include `--import:"linterproject"`
21:41:51FromDiscord<Yardanico> and you can of course just add that import to your global nim config
21:41:54*Goodbye_Vincent quit (Read error: Connection reset by peer)
21:42:21FromDiscord<huantian> and it shouldn't be too hard to make a config for the linter right
21:42:29FromDiscord<huantian> with categories and fun stuff
21:42:39*Goodbye_Vincent joined #nim
21:42:43FromDiscord<ElegantBeef> I'd just make each category a module
21:42:51FromDiscord<ElegantBeef> then you can just import that specific module
21:43:13FromDiscord<Yardanico> I mean, a linter with TRMs will still be limited
21:43:24FromDiscord<Yardanico> there are some things you won't be able to do with them for linting
21:43:30FromDiscord<huantian> In reply to @ElegantBeef "then you can just": well you'd still want to be able to disable specific lints too
21:43:53FromDiscord<ElegantBeef> Then you'd need to have a `when defined(linterNameLinterThing):...`
21:44:02FromDiscord<huantian> yeah you'd have to do that for each one hm
21:44:35FromDiscord<huantian> In reply to @Yardanico "there are some things": yeah it might be ideal to work on concrete syntax trees instead of ASTs
21:44:45FromDiscord<ElegantBeef> In reply to @Yardanico "there are some things": Well if you want to get real hacky you can always fetch the line information
21:44:53FromDiscord<Yardanico> just like nimib? :P
21:44:58FromDiscord<ElegantBeef> Yea
21:45:25FromDiscord<ElegantBeef> In reply to @huantian "yeah it might be": Bleh AST has more meaning in it
21:45:52FromDiscord<ElegantBeef> It's semantically checked code so you can much more easily lint semantics
21:46:12FromDiscord<huantian> perhaps you'd want to be able to use both then
21:46:21FromDiscord<huantian> because the ast doesn't include things like comments
21:46:39FromDiscord<ElegantBeef> Excuse me, why do comments matter
21:46:57FromDiscord<huantian> what if I uh want to make it so people can't write comments
21:47:06FromDiscord<huantian> because they're evil
21:47:07FromDiscord<Yardanico> yeah for normal comments that won't work
21:47:22FromDiscord<Yardanico> but that's a niche case
21:47:22FromDiscord<ElegantBeef> Lol
21:47:48FromDiscord<ElegantBeef> Yea I'm too unprofessional to care about stylistic linting
21:47:55FromDiscord<huantian> I wonder if you oculd use `{.push.}` and `{.pop.}` to temporarially disable rules
21:48:10FromDiscord<ElegantBeef> You can do `{.define` in code but there is no `{.undefine`
21:48:52FromDiscord<huantian> you can define it to true then false though
21:49:01FromDiscord<huantian> I'd assume?
21:49:11FromDiscord<Yardanico> but will you be able to fetch that information with TRMs?
21:49:19FromDiscord<huantian> yeah that I'm not sure
21:49:32FromDiscord<Yardanico> I mean it might work, but you'd have to emit a lot of code in a TRM macro
21:49:40FromDiscord<Yardanico> since you'd have to check for a lot of rules
21:51:34FromDiscord<ElegantBeef> Huh?
21:52:43FromDiscord<Yardanico> In reply to @ElegantBeef "Huh?": if you're using define you can't check then in the macro itself, you'd have to make the macro emit the checks for defines, right?
21:55:50FromDiscord<ElegantBeef> Yea probably
21:56:42FromDiscord<ElegantBeef> Likely just easier to disable user warnings for a bit
21:56:56FromDiscord<ElegantBeef> But that infects all other code aswell ofc
21:57:35FromDiscord<huantian> could you make a warning for each lint rule lol
21:57:48FromDiscord<huantian> and disable each individually
21:57:50FromDiscord<ElegantBeef> Nah the compiler only has a single warning type
21:57:56FromDiscord<huantian> oh really?
21:58:03FromDiscord<huantian> I never actually use warnings so I didn't know that
21:58:07FromDiscord<ElegantBeef> All `{.warning: ...}` emits `User`
21:58:25FromDiscord<ElegantBeef> As does `warning(string, NimNode)` from macros
21:58:50FromDiscord<ElegantBeef> We could just use the macro system to have like `lint("lintName", on)`
21:59:02FromDiscord<ElegantBeef> Which would add the key to a table
21:59:26FromDiscord<ElegantBeef> Then inside the trm you could fetch a specific key and check if it is on
21:59:36FromDiscord<Yardanico> oh right
22:00:22FromDiscord<ElegantBeef> The downside is there is no CLI way of doing it aside from parsing something like `--define:lintersOn:"bleh, blue, bloh, blag, blos"`
22:02:09FromDiscord<huantian> it might also be worth to add both a configurable warn level and an error level for lints
22:02:44FromDiscord<huantian> that would be fairly simple with the table
22:02:51FromDiscord<huantian> but makes cli usage more annoying
22:03:12*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
22:03:29FromDiscord<Yardanico> can't you just have another nim file as your linter config and import it in your project that'll set all options
22:03:42FromDiscord<ElegantBeef> You could indeed
22:04:03FromDiscord<huantian> that'd probably the general use case
22:04:48FromDiscord<huantian> but it would be nice to also have the cli config
22:05:18FromDiscord<ElegantBeef> The only important lints are performance ones 😛
22:05:23FromDiscord<Yardanico> have a program that generates that nim config file from CLI options
22:05:28FromDiscord<ElegantBeef> `for x in a[b..c]`
22:05:45FromDiscord<Yardanico> `gen_lint_config --noComments:true` just replaces the config in the current project or whatever
22:09:10*advesperacit quit ()
22:09:25FromDiscord<huantian> a rule for void returns on procs could be useful
22:09:41FromDiscord<Yardanico> or a rule for `var ref T`
22:09:50FromDiscord<Yardanico> sometimes people do that because they don't know ref is already mutable
22:09:53FromDiscord<Yardanico> double pointer indirection :((
22:10:06FromDiscord<Yardanico> <https://github.com/Yardanico/nim-snippets/blob/master/var_ref.diff>
22:10:07FromDiscord<ElegantBeef> In reply to @huantian "a rule for void": Sokam shudders
22:10:44FromDiscord<huantian> I already do that whenever I look at their code 🙃
22:11:07FromDiscord<huantian> hmm how hard would it be for the lint to suggest a fix
22:11:14FromDiscord<ElegantBeef> See this is why AST is nice 😄
22:11:30FromDiscord<ElegantBeef> You can look for all `var T` and check if the `T` is a ref and then emit a warning
22:11:36FromDiscord<Yardanico> yeah
22:13:01*Notxor quit (Remote host closed the connection)
22:16:26FromDiscord<Elegantbeef> I think you can also semantically catch `void` on a proc def
22:16:35FromDiscord<Elegantbeef> Hey we're back!
22:17:09FromDiscord<Elegantbeef> But yea anything semantically should be catchable assuming the compiler likes how you use the TRM
22:17:42FromDiscord<Yardanico> time to clone all nim packages again
22:17:52FromDiscord<Elegantbeef> You brave brave soul
22:18:01*progranner joined #nim
22:18:07FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/1100183921796317205/image.png
22:18:18FromDiscord<Elegantbeef> Are you not doing it async?
22:18:21FromDiscord<Elegantbeef> Or is that async
22:18:23*progranner quit (Client Quit)
22:18:27FromDiscord<Yardanico> i'm doing it with `execProcesses`
22:18:32FromDiscord<Yardanico> so it's doing 16 parallel git clones
22:18:37FromDiscord<Elegantbeef> Ah ok
22:19:04FromDiscord<Elegantbeef> Meanwhile me over here dumping 1 file at a time from a PS3 game cause the PS3 ftp server crashes if you even breath in the same room as the PS3
22:19:19FromDiscord<Elegantbeef> 12000 files and it stops/freezes every 300 or so files
22:19:39*Goodbye_Vincent quit (Remote host closed the connection)
22:20:25*Goodbye_Vincent joined #nim
22:20:43FromDiscord<Elegantbeef> It's only 4gb but it's going to take like 20 minutes on a local download with ethernet on both ends, it's not a good server
22:21:30FromDiscord<Elegantbeef> Does this mean you're going to get more statistics
22:21:53FromDiscord<Yardanico> too lazy to do the neo4j stuff, I can just run some code searches over all nimble repos
22:22:23*azimut quit (Ping timeout: 255 seconds)
22:23:54FromDiscord<Yardanico> someone has some big vendored packages https://media.discordapp.net/attachments/371759389889003532/1100185372689961080/image.png
22:24:02FromDiscord<Yardanico> i'm cloning with --recursive this time, since status uses it in nimbus
22:24:31FromDiscord<Elegantbeef> What are you going to be doing with all of these?
22:24:46FromDiscord<Elegantbeef> This isnt apart of a large test suite is it
22:24:49FromDiscord<Yardanico> search funny stuff
22:25:02FromDiscord<Yardanico> its all in <https://github.com/Yardanico/nim-snippets/tree/master/pkgraph>
22:25:09FromDiscord<Elegantbeef> Ah thought you were contemplating testing PGO on a large breadth of code 😄
22:25:18FromDiscord<Yardanico> the code here can just parse all nimble files into graphviz/cypher (neo4j)
22:25:22FromDiscord<Yardanico> with npeg
22:25:32FromDiscord<Elegantbeef> Right i remember the graphs
22:26:22FromDiscord<Yardanico> i think it's almost done - only cloning nimbus' submodules now
22:31:09FromDiscord<Nlits (Ping on reply)> Is there a good way to generate JavaScript from nim code run-time? I can run a command but then I would have to use templating or smth and I have no idea how
22:31:29FromDiscord<Yardanico> if you mean compile nim to js, you'd have to bundle the compiler, but you can do that, yes
22:31:38FromDiscord<Yardanico> if you want to compile nim to js at runtime
22:31:59FromDiscord<Yardanico> okay cloning done, had to kill one git clone because the submodule was stuck
22:32:08FromDiscord<Yardanico> its just 16GB
22:32:24*azimut joined #nim
22:32:25FromDiscord<Yardanico> 2083 folders
22:34:48FromDiscord<Yardanico> what did I just stumble upon https://media.discordapp.net/attachments/371759389889003532/1100188119950704730/image.png
22:35:09FromDiscord<Yardanico> ah, it's juan's contra
22:40:30FromDiscord<Nlits (Ping on reply)> In reply to @Yardanico "if you mean compile": how
22:40:39FromDiscord<Yardanico> In reply to @not logged in "how": by using the compiler as a library
22:41:12FromDiscord<Yardanico> there was a repo that simplified it a bit, forgot the name
22:41:45FromDiscord<Nlits (Ping on reply)> In reply to @Yardanico "there was a repo": great
22:46:54FromDiscord<Nlits (Ping on reply)> let me try to find it
22:47:18FromDiscord<Nlits (Ping on reply)> In reply to @Yardanico "there was a repo": wait, nimble package?
22:57:24*Goodbye_Vincent quit (Remote host closed the connection)
22:58:10*Goodbye_Vincent joined #nim
23:03:12FromDiscord<Chronos [She/Her]> In reply to @Yardanico "if you mean compile": Does Nim (the compiler) compile to the JS backend?
23:03:52FromDiscord<Yardanico> In reply to @Hourglass, When the Hour Strikes "Does Nim (the compiler)": no
23:04:02FromDiscord<Yardanico> you probably can make it in theory, but doing that with wasm will be much simpler
23:04:10FromDiscord<Chronos [She/Her]> Yeah makes sense
23:04:41*azimut quit (Ping timeout: 255 seconds)
23:07:24*lucasta quit (Remote host closed the connection)
23:15:30*jmdaemon joined #nim
23:36:12*beholders_eye quit (Quit: WeeChat 3.6)
23:43:54FromDiscord<Nlits (Ping on reply)> In reply to @not logged in "wait, nimble package?": is it a nimble pkg?
23:48:16*Goodbye_Vincent quit (Remote host closed the connection)
23:49:01*Goodbye_Vincent joined #nim