<< 07-03-2021 >>

00:02:22FromDiscord<Unaimend> In reply to @ajusa "fidget is undergoing a": Yeah, I tried Qt sometime ago in C++ and did not like it all
00:03:28FromDiscord<Unaimend> In reply to @ajusa "fidget is undergoing a": Yeah fidget does look super cool, but I somehow have a feeling that it could be really slow and that you cannot get down to the bare metal if you have to
00:03:56FromDiscord<Unaimend> (edit) "In reply to @ajusa "fidget is undergoing a": Yeah fidget does look super cool, but I somehow have a feeling that it could be really slow and that you cannot get down to the bare metal if you have ... tocheckout" added "to. So I will probably have" | "to. So I will probably haveto ... " added "checkout NiGui"
00:05:45FromDiscord<ajusa> I'm trying to make a fast port scanner, anyone know what the best approach to that might be? Right now my code is erroring with `Exception message: Too many open files` since I create a new asyncsocket for each port that I want to check. Is there a way that I should be reusing sockets here somehow? Not too familiar with network programming.
00:07:40FromDiscord<dk> In reply to @ajusa "I'm trying to make": maybe `server.setSockOpt(OptReuseAddr, true)` would help
00:08:33FromDiscord<queersorceress> that sounds like a system resource error, not a language one, maybe you should look at how other implementations handle it?
00:08:44FromDiscord<ElegantBeef> In reply to @Unaimend "Yeah fidget does look": "Bare metal"...? it's opengl rendered as bare metal as you could want
00:09:49FromDiscord<ajusa> In reply to @queersorceress "that sounds like a": It is a system resource error, since it errors at 1024 sockets (I believe a unix limitation). If I want to check a port is open though, do I need to create a new socket for each port scan?↵I did take a look at nimscan (https://github.com/elddy/NimScan/blob/master/modules/scanner.nim) and they seem to create a new socket for each port that they scan
00:09:51FromDiscord<Unaimend> In reply to @ElegantBeef ""Bare metal"...? it's opengl": hmm I like that 🙂
00:10:31FromDiscord<ajusa> In reply to @dk "maybe `server.setSockOpt(OptReuseAddr, true)` would": Just tried that, it didn't make a difference
00:13:06FromDiscord<queersorceress> In reply to @ajusa "It is a system": what about non-nim implementations? nmap, etc?
00:18:17FromDiscord<queersorceress> you need an abstraction on your resource pool, rather than spawning them as you go, that would mean your implementation would be only as fast as your resource management code was efficient, but that isn't terribly unusual. i'm not sure the correct word used here for nim, but i believe you could use channels for this but you would have to write the management queue, as the stdlib doesn't provide something that convenient.
00:20:41FromDiscord<ajusa> Hm, if I understood you correctly I should do something like spawning one thread for each socket (1024 threads), have those threads check a channel for work, and then each thread should send stuff.
00:22:09FromDiscord<ajusa> (edit) "Hm, if I understood you correctly I should do something like spawning one thread for each socket (1024 threads), have those threads check a channel ... for" added "(https://nim-lang.org/docs/channels.html)"
00:22:42*xioren joined #nim
00:23:57xiorenis there any update on SciNim? Will it eventually be part if the stdlib?
00:24:45FromDiscord<queersorceress> sent a long message, see https://paste.rs/44B
00:28:00FromDiscord<queersorceress> only thing is, as far as i know, nim's stdlib doesn't provide a high-level queue like that for thread management, i'm borrowing the idea from a C library that handles the thread abstraction really well.
00:29:52FromDiscord<dk> why use threads instead of async?
00:33:00FromDiscord<queersorceress> it's just an abstraction, i'm just use to thinking of "threads" when i mean "work done somewhere else"
00:34:50FromDiscord<queersorceress> i'm a little fuzzy on how the details of nim's threading vs async code works so i'm probably messing up some of my words here -- but i hope you get the idea.
00:38:26j-james[m]Hey, is there any possibility of getting this channel's Discord ==> Matrix bridge updated?
00:39:41*j-james[m] uploaded an image: Screenshot_20210306-163854.png (218KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/BYptNpBitTiAUdBlxAAEufix/Screenshot_20210306-163854.png >
00:39:43j-james[m]Right now it lumps everything under a single FromDiscord bot like so
00:40:17*Vladar quit (Quit: Leaving)
00:42:11FromDiscord<Unaimend> In reply to @xioren "is there any update": Should it be? At the moment basically everyone can contribute packages to SciNim.
00:52:11*Jjp137 joined #nim
01:04:57xiorenSo I am looking at https://github.com/SciNim/impulse and the language used in the readme suggests that its a work in progress.
01:05:57xiorenWas wondering if its ready to be used in practice or if there is more work that needs to be done.
01:06:38xiorenI want to implement pHash in Nim
01:07:44*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:08:04*njoseph joined #nim
01:09:36FromDiscord<InventorMatt> you'll need to ask @mratsim about that
01:10:19FromDiscord<Unaimend> In reply to @xioren "So I am looking": If it provides your functionality just use it @mratsim is basically always online if you have questions
01:12:42xioren@Unaimend thanks, but thats the crux of my issue. I don't want to use something if its not ready. I opened an issue, see if he respondes.
01:13:43xiorenresponds*
01:48:01FromDiscord<gcao> ref obj
02:20:42*lritter quit (Ping timeout: 256 seconds)
02:21:02*lritter joined #nim
02:27:36*xioren quit (Quit: leaving)
02:38:15*xet7 joined #nim
02:41:36*krux02 quit (Remote host closed the connection)
02:42:02*purpleLizard joined #nim
02:56:51FromDiscord<Yardanico> In reply to @ajusa "I'm trying to make": The fastest port scanner that I know of is masscan and it's really fast
02:56:58*Evolver quit ()
02:57:07FromDiscord<Yardanico> And to be that fast it has its own custom TCP/IP stack
02:57:47FromDiscord<Yardanico> If you want to take a look - <https://github.com/robertdavidgraham/masscan>
03:11:55*D_ quit (Ping timeout: 240 seconds)
03:22:39*muffindrake quit (Ping timeout: 272 seconds)
03:23:51*muffindrake joined #nim
03:38:59*wasted_youth2 quit (Quit: Leaving)
04:21:18*spiderstew_ joined #nim
04:22:42*spiderstew quit (Ping timeout: 260 seconds)
05:39:04*abm quit (Quit: Leaving)
06:30:53*purpleLizard left #nim ("Konversation terminated!")
06:57:36*k0mpjut0r left #nim ("User left")
06:58:17*k0mpjut0r joined #nim
07:19:36*waleee-cl quit (Quit: Connection closed for inactivity)
07:20:21*lritter quit (Ping timeout: 264 seconds)
07:37:10FromDiscord<ElegantBeef> Diffing a macro's output with the dumptree of `repr` getting "The two files are identical" is not a nice feeling
07:37:28FromDiscord<ElegantBeef> Well i guess i found a compiler error, so yay?
07:40:53FromDiscord<ElegantBeef> the odd thing is if i get the `astGenRepr` and put it in a macro then compile it it doesnt error
08:35:21*shirty joined #nim
08:35:31*shirty quit (Client Quit)
08:35:37FromDiscord<mratsim> In reply to @queersorceress "is there an existing": Nim createThread gives you OS thread so you can use them just like in C. You can use Nim `threadpool` module as well.
08:36:33FromDiscord<mratsim> In reply to @xioren "So I am looking": `impulse` is just a shell at the moment, there is a FFT but I'm unsure of the API to provide yet, since I want it to be front-end agnostic so that any tensor or image library can use it.
08:37:08FromDiscord<mratsim> AFAIK someone already used pHash but unsure if it was from Nim or not.
08:37:19FromDiscord<mratsim> we can discuss pHash in science if you tell me what is needed for it.
09:38:35*vicfred quit (Quit: Leaving)
10:09:43*ShalokShalom[m] joined #nim
10:10:04*ShalokShalom[m] uploaded an image: IMG_20210307_110857.jpg (147KiB) < https://matrix.org/_matrix/media/r0/download/matrix.org/WHpQKJhgGPieqwrDCdTmvNSx/IMG_20210307_110857.jpg >
10:15:20*Vladar joined #nim
10:39:49*tane joined #nim
10:45:30*johannes_ joined #nim
10:46:52*johannes_ is now known as kenran
11:00:34*gpanders quit (Remote host closed the connection)
11:00:55*gpanders joined #nim
11:04:58FromDiscord<mratsim> @ShalokShalom: feel free to fix https://github.com/nim-lang/website/edit/master/jekyll/_posts/2021-02-26-multithreading-flavors.md
11:07:46*FromDiscord quit (Remote host closed the connection)
11:08:00*FromDiscord joined #nim
11:22:57*kenran quit (Ping timeout: 256 seconds)
11:39:51FromDiscord<Unaimend> So how would I start with nim compiler development? I have literally no idea what to read and stuff like that
11:55:06*gangstacat quit (Quit: Ĝis!)
11:59:17*gangstacat joined #nim
12:20:22ForumUpdaterBotNew thread by Jasonfi: How to structure a project with multiple components?, see https://forum.nim-lang.org/t/7587
12:23:03*gangstacat quit (Quit: Ĝis!)
13:00:22*krux02 joined #nim
13:12:29FromDiscord<Araq> there is https://nim-lang.org/docs/intern.html but it's outdated
13:15:30*xet7 quit (Remote host closed the connection)
13:16:23*xet7 joined #nim
13:21:05*johannes_ joined #nim
13:21:05*johannes_ is now known as kenran
13:22:39FromDiscord<haxscramper> In reply to @Unaimend "So how would I": You can try using https://github.com/haxscramper/haxdoc to quickly explore compiler implementation - calligraphs, relationships between each type (where defined, where used, where particular filed is used and so on). It test it against nim compiler on CI so it should handle everything quite well
13:23:47FromDiscord<Unaimend> ahh that looks nice, i was looking for soure trail support for nim the other day but not find anything
13:24:33FromDiscord<haxscramper> It is highly experimental, but right now I'm mostly in 'minor fixups' stage - major parts are working fine
13:24:52FromDiscord<haxscramper> Oh, actually I forgot to push some dependencies let me fix that
13:26:28*haxscramper joined #nim
13:31:25*gangstacat joined #nim
13:33:33FromDiscord<queersorceress> In reply to @mratsim "Nim createThread gives you": what i'm really after is a queue that does work on a separate thread. i've been struggling with finding something that does that. i've guessed that nim's concurrency model is diffrent enough, but, that's what i need as it's easier than trying to do this with locks.
13:41:47FromDiscord<haxscramper> What does `<//>` mean for type? https://github.com/nim-lang/fusion/blob/4f0de4c2c50c8c204fa18d6f46b3bc38f7ff873e/src/fusion/btreetables.nim#L851 . It is defined as ``template `<//>`(t: untyped): untyped = t`` so it looks like some pre-1.0.0 thing
13:42:19FromDiscord<haxscramper> I've seen it only a handful of times, it is not mentioned in the manual of course
13:47:26FromGitter<deech> haxscamper, I'm using your matching library and running into some issues destructuring `Option`. I have a variant with a discriminant `O1` with an optional field `f` and `case ...: of O(f:Some(@mything)): ...` generates the type path `f -> (decl: f, varKind: vkRegular, typePath: --- #.get, cnt: 1)`. I can't get it do the same in a minimal example, have you seen something like this?
13:49:35*Vladar quit (Quit: Leaving)
13:51:22krux02@haxscramper, that means `owned` but was introduced for bootstrapping so a compiler that doesn't know owned yet doesn't get in trouble
13:51:40FromDiscord<haxscramper> Can you at least give more or less reproducible example? Not necessarily minimal, but at least something that I can test. From what I can tell you are doing most of the things correcly,
13:51:49FromDiscord<haxscramper> But it is hard to tell what is going on without code
13:52:24FromDiscord<flywind> `<//> ` will be removed when cource_v1 is introduced.
13:52:36FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/15307
13:52:50FromDiscord<flywind> (edit) "cource_v1" => "csource_v1"
13:54:11FromGitter<deech> haxscamper, yeah I'm trying. There's just a lot of stuff going on in this codebase, I'm trying to retrofit `matching` into an existing project. :)
13:54:21krux02@flywind: well you can hope.
14:01:48FromDiscord<Unaimend> @haxscramper So would you start inexing the compiler with haxdoc
14:02:20FromDiscord<haxscramper> Are you asking whether it is capable of doing this?
14:02:34FromDiscord<Unaimend> In reply to @haxscramper "Are you asking whether": nope
14:03:04FromDiscord<Unaimend> (edit) "nope" => "but maybe yes, but I presume it is"
14:03:28FromDiscord<Unaimend> (edit) "is" => "is. Since you answerded with haxdoc regarding my post on the compiler"
14:03:38FromDiscord<haxscramper> I'm indexing nim compiler as part of CI test
14:03:47FromDiscord<haxscramper> large old codebase with a lot of quirks
14:03:56FromDiscord<haxscramper> perfect for stress-testing
14:06:21FromDiscord<haxscramper> And it was absolutely invaluable when I started digging into compiler - better than anything else I've tried
14:07:02FromDiscord<Unaimend> So what what file would I have to choose generate the compilation data base for the nim compiler i.e. ./haxdoc trail <?.nim>
14:08:02FromDiscord<haxscramper> Clone compiler and then `haxdoc trail compiler/nim.nim --stdpath:lib`
14:08:04FromDiscord<haxscramper> https://github.com/haxscramper/haxdoc/blob/8901808edc6ded425b1ecb1fd636e2a1d10de249/.github/workflows/test.yaml#L15
14:08:24FromDiscord<haxscramper> There is no GUI support yet
14:08:45FromDiscord<Unaimend> thx
14:08:46FromDiscord<haxscramper> But I will add it later
14:08:59FromDiscord<Unaimend> What do you mean by gui support?
14:09:23FromDiscord<Unaimend> So I mean why should this program have a gui?
14:10:22FromDiscord<haxscramper> I mean I can create custom sourcetrail wizards for new projects, like it has for C++ for example
14:11:13FromDiscord<Unaimend> Ahh I see, that makes sennse
14:11:17FromDiscord<Unaimend> (edit) "sennse" => "sense"
14:35:31*Vladar joined #nim
14:35:53FromDiscord<haxscramper> @Unaimend alright, now CI is green, and I added build artifact upload (I still haven't figured out how to properly do releases via CI), so you can just download artifacts
14:36:23FromDiscord<haxscramper> unzip, fix `chmod +x haxdoc` (because github CI breaks file permissions) and use `./haxdoc trail compiler/nim.nim`
14:37:09FromDiscord<haxscramper> download artifacts from latest green CI run
14:37:33FromDiscord<haxscramper> IIRC everything is statically built, so no additional setup is necessary
14:40:10FromDiscord<haxscramper> calls, field references, enum values, files and so on https://media.discordapp.net/attachments/371759389889003532/818130911005507604/unknown.png
14:42:37*PMunch joined #nim
14:45:13FromDiscord<haxscramper> Actually I think "highly experimental" was a bit too dramatic. It does have some unhandled edge cases and not really all that well-documented, but overall it works pretty good
14:48:07FromDiscord<Unaimend> I try it
14:50:21FromDiscord<Unaimend> So where do I find the build arifacts on git hub?
14:50:26FromDiscord<Unaimend> (edit) "arifacts" => "artifacts"
14:50:26*abm joined #nim
14:54:47FromDiscord<haxscramper> https://github.com/haxscramper/haxdoc/actions any last green run has "artifacts"
14:58:21FromDiscord<Unaimend> found it, thx
14:58:35PMunchPrestige, I see you've managed to fix the NimLSP issue :D
14:59:54FromDiscord<Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2S1x
15:00:46FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2S1x" => "https://play.nim-lang.org/#ix=2S1z"
15:01:16FromDiscord<haxscramper> oh, well, looks like I"m ad idiot after all
15:01:30FromDiscord<haxscramper> Just build it normally, with nimble install
15:01:49FromDiscord<haxscramper> (edit) "oh," => "Oh," | "I"m ad" => "I'm an"
15:02:10FromDiscord<Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2S1G
15:02:20FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2S1H" => "https://play.nim-lang.org/#ix=2S1G"
15:14:58*D_ joined #nim
15:22:46FromDiscord<haxscramper> @Unaimend forgot it is necessary to pass `-d:ssl` when building anything with nimble - pushed fix, should be working now
15:22:50FromDiscord<haxscramper> I hope
15:23:04FromDiscord<Unaimend> 😄
15:23:21FromDiscord<haxscramper> I just have a severe case of "it works on my machine"
15:23:25FromDiscord<haxscramper> Sorry for the trouble
15:23:25FromDiscord<Unaimend> Ill be your tester
15:23:43FromDiscord<Unaimend> No problem, better find bugs now then later
15:24:48FromDiscord<Unaimend> (edit) "Ill" => "I`ll" | "I`llbe your ... tester🙂" added "product" | "producttester ... " added "🙂"
15:26:19*Vladar quit (Remote host closed the connection)
15:31:06FromDiscord<Unaimend> In reply to @haxscramper "<@!287576619718279178> forgot it is": Worked
15:32:14FromDiscord<Unaimend> In reply to @haxscramper "I just have a": `../haxdoc/bin/haxdoc trail compiler/nim.nim` But this one didnt
15:33:19FromDiscord<Unaimend> In reply to @haxscramper "I just have a": sent a code paste, see https://play.nim-lang.org/#ix=2S1W
15:36:02*kenran quit (Ping timeout: 260 seconds)
15:38:10FromDiscord<Unaimend> So the .choosenim path does not exists on my machine
15:38:42PMunchDid you not install Nim via choosenim perchance?
15:38:54FromDiscord<Unaimend> yes
15:39:29FromDiscord<Unaimend> Build it myself with my bare hands
15:39:51*zedeus quit (Ping timeout: 246 seconds)
15:41:45FromDiscord<Unaimend> Installing choosenim fixed the problen
15:42:16FromDiscord<queersorceress> hmmm, i still seem to be having some difficulty wrapping my head around getting the threading api to perform the parallelism that i want. is there anyone around that would be able to help talk me through this?
15:47:08*johannes_ joined #nim
15:47:08*johannes_ is now known as kenran
15:47:56FromDiscord<Cerda> hey yo, is there a way to translate python code into nim?
15:49:24PMunchThere is nimpy
15:49:43PMunchAnd nimporter
15:56:05*dddddd quit (Ping timeout: 256 seconds)
15:56:37*jess quit (Quit: brb)
16:00:05*j joined #nim
16:09:03*dddddd joined #nim
16:19:57FromDiscord<BasicBlock> The docs say you shouldn't share for example ref variables across threads because of GC safety. Does this still apply if you turn --tlsEmulation:off?
16:28:00*kenran quit (Quit: leaving)
16:48:38*waleee-cl joined #nim
17:04:03FromDiscord<CAA> Is it possible to rewrite basic C keywords like printf or enum as nim code?
17:05:41FromDiscord<queersorceress> printf isn't a keyword, can you explain what you are trying to do?
17:05:58FromDiscord<naturalethic> sent a code paste, see https://play.nim-lang.org/#ix=2S2k
17:06:18FromDiscord<naturalethic> (edit) "https://paste.rs/mxG" => "https://play.nim-lang.org/#ix=2S2l"
17:06:30FromDiscord<CAA> I was just wondering if I could do stuff like printf or int [variable name] in nim.
17:07:27FromDiscord<queersorceress> you mean, call a function or declare a variable?
17:07:34FromDiscord<CAA> Yes. I think.
17:07:58FromDiscord<queersorceress> https://nim-lang.org/docs/tut1.html
17:08:37FromDiscord<CAA> What I'm asking is, is it possible to somehow declare a variable as int variable rather than variable: int?
17:08:55FromDiscord<queersorceress> you mean, change the language's syntax entirely?
17:09:11FromDiscord<CAA> No. Not entirely.
17:11:36FromDiscord<Unaimend> you want to give it the name int
17:11:40FromDiscord<Unaimend> like var int
17:11:43FromDiscord<queersorceress> okay then i'm not sure what you are asking. if you are looking at `var foo: int = 4` and want to change that to make it look like C, so something like `int foo = 4` then you are not going to be able to do that without doing something wild with macros to modify how valid AST gets generated, because you want to move your type annotation to replace the mutability indicator.
17:11:56FromDiscord<Unaimend> (edit)
17:13:20FromDiscord<naturalethic> Basically, how do I specify the type in a tuple literal
17:13:32FromDiscord<queersorceress> C has no concept of mutable vs immutable, nor does it have types beyond primitives. in declaring variables in nim you have both a type system and if it is allowed to be modified after it is created (mutability).
17:13:42ForumUpdaterBotNew thread by Vitreo12: Custom allocator with --gc:arc, see https://forum.nim-lang.org/t/7588
17:13:48FromDiscord<queersorceress> In reply to @naturalethic "Basically, how do I": does it have to be a tuple, why not use an object definition?
17:14:37FromDiscord<queersorceress> that should make the initialization easier as an object type would have a default initializer you can use.
17:15:20FromDiscord<queersorceress> you can assign a named type to a tuple, but the whole point is that they are not bound to the restrictions of the type system.
17:15:30FromDiscord<naturalethic> It could, but I'd have to manually export every field. There is no way to specify type on a tuple literal? Is the type simply used as an interface? ... hmm
17:15:54FromDiscord<CAA> So technically I could make nim a tad bit more C like with macros?
17:17:04PMunchAh you want to do `int x = 100;` in Nim?
17:17:15FromDiscord<CAA> Yes. That's basically what I want to do.
17:17:21FromDiscord<queersorceress> In reply to @CAA "So technically I could": theoretically, maybe, but if you want to use C, isn't not like Nim makes that even remotely difficult, so the point of doing this is to just make it look less like python? there is a lot of nuance in the syntax that you are going to lose by doing this.
17:17:42*gangstacat quit (*.net *.split)
17:17:43*robertmeta quit (*.net *.split)
17:17:43*Avatarfighter[m] quit (*.net *.split)
17:17:43*beatmox quit (*.net *.split)
17:17:43*Prestige quit (*.net *.split)
17:17:43*vqrs_ quit (*.net *.split)
17:17:43*ehmry quit (*.net *.split)
17:17:43*greaser|q quit (*.net *.split)
17:17:43*hpyc9 quit (*.net *.split)
17:17:43*kwilczynski quit (*.net *.split)
17:17:43*notchris quit (*.net *.split)
17:17:43*nikki93 quit (*.net *.split)
17:17:43*zielmicha__ quit (*.net *.split)
17:17:44*jholland__ quit (*.net *.split)
17:17:44*blitzworks quit (*.net *.split)
17:17:44*surma quit (*.net *.split)
17:17:44*ormiret quit (*.net *.split)
17:17:50FromDiscord<queersorceress> frankly i'd just say use another language if it bothers you this much.
17:18:06PMunchYeah I definitely won't recommend it, and I'm not sure if you could do it without wrapping everything in a macro..
17:18:13*gangstacat joined #nim
17:18:14*hpyc9 joined #nim
17:18:19PMunchOr wait
17:18:20*ormiret joined #nim
17:18:21*robertmeta joined #nim
17:18:25PMunchWith command syntax you might be able to
17:18:44*kwilczynski joined #nim
17:19:18FromDiscord<queersorceress> In reply to @naturalethic "It could, but I'd": you can make methods to access the relevant fields if you want to prevent exporting them, but this is a fundamental fact when dealing with OOP-y design vs more functional data transformations.
17:19:24*notchris joined #nim
17:19:24*nikki93 joined #nim
17:19:24*zielmicha__ joined #nim
17:19:24*greaser|q joined #nim
17:19:24*beatmox joined #nim
17:19:24*jholland__ joined #nim
17:19:24*surma joined #nim
17:19:34*ehmry joined #nim
17:19:52*vqrs joined #nim
17:20:18*Tuatarian quit (Ping timeout: 246 seconds)
17:20:23FromDiscord<naturalethic> sent a code paste, see https://play.nim-lang.org/#ix=2S2p
17:20:24FromDiscord<queersorceress> In reply to @PMunch "With command syntax you": it's possible but i don't understand why you would do this if the motivation is to run counter to the intent of the design. it's just going to make every single thing you do more difficult as you progress.
17:21:12FromDiscord<CAA> Look, there's a lot of things about nim I love. I just want to make a few minor adjustments is all.
17:21:28PMunchWell changing the entire syntax isn't exactly minor
17:21:33*Benjamin[m]2 quit (Ping timeout: 246 seconds)
17:21:42PMunchI tried out the command syntax thing but can't really get it to work..
17:21:45FromDiscord<queersorceress> In reply to @naturalethic "Ok, I'll forego using": you should check the manual's sections on `import`, i believe there are modifier keywords to rename symbols if there are conflicts. also this is why we have a type system, so it resolves the correct method or referenced object based on the type it has.
17:21:49*watzon quit (Ping timeout: 265 seconds)
17:21:50FromDiscord<CAA> I didn't realize at the time it wasn't minor
17:21:54*antholop[m] quit (Ping timeout: 246 seconds)
17:21:56*unclechu quit (Ping timeout: 240 seconds)
17:22:27*Stephen[m]2 quit (Ping timeout: 272 seconds)
17:22:53FromDiscord<queersorceress> @CAA i highly doubt you will find a statically typed language that can integrates better with C than Nim, i think you are likely out of luck if you want to find something better.
17:23:26*reversem3 quit (Ping timeout: 240 seconds)
17:23:41FromDiscord<konsumlamm> In reply to @naturalethic "How do I initialize": that might actually be a bug, looking at it, i think it should work
17:23:41*gollark[m]1 quit (Ping timeout: 268 seconds)
17:23:42*MTRNord quit (Ping timeout: 268 seconds)
17:23:53*BitPuffin quit (Ping timeout: 244 seconds)
17:24:24*vegai1 quit (Ping timeout: 244 seconds)
17:24:24*alex[m]28 quit (Ping timeout: 244 seconds)
17:24:26*ShalokShalom[m] quit (Ping timeout: 240 seconds)
17:24:26*liblq-dev quit (Ping timeout: 240 seconds)
17:24:30FromDiscord<CAA> Well I'll be damned. I think someone already made a package that lets you have some C like abilities in nim. https://github.com/ReneSac/c_alikes/blob/master/src/c_alikes.nim
17:24:43*stisa quit (Ping timeout: 265 seconds)
17:24:43*ee7[m] quit (Ping timeout: 265 seconds)
17:24:43*vindaar[m] quit (Ping timeout: 265 seconds)
17:24:43*leorize[m] quit (Ping timeout: 265 seconds)
17:24:55*vycb[m] quit (Ping timeout: 268 seconds)
17:24:55*drbixx[m] quit (Ping timeout: 244 seconds)
17:24:55*sekao[m] quit (Ping timeout: 244 seconds)
17:24:56*k0mpjut0r quit (Ping timeout: 240 seconds)
17:24:56*zazi[m] quit (Ping timeout: 240 seconds)
17:24:56*Clonkk[m] quit (Ping timeout: 240 seconds)
17:25:04*Yardanico[m] quit (Ping timeout: 258 seconds)
17:25:05*i_use_arch_btw[4 quit (Ping timeout: 258 seconds)
17:25:07FromDiscord<queersorceress> In reply to @naturalethic "Ok, I'll forego using": also, if you are wanting to be really specific, then i believe you can specify symbols based on their module name, so that example would be `echo env.env`, as that is the fully qualified name it has.
17:25:12*headache quit (Ping timeout: 265 seconds)
17:25:32*lnxw37d4 quit (Ping timeout: 268 seconds)
17:25:33*nxnl[m] quit (Ping timeout: 260 seconds)
17:25:43FromDiscord<queersorceress> the type system resolves that for you most of the time so it isn't necessary to hand-write that level of explicit detail.
17:26:12FromDiscord<naturalethic> In reply to @queersorceress "also, if you are": It won't export a variable with a name same as the module `echo env.env` errors
17:26:53FromDiscord<konsumlamm> In reply to @CAA "Look, there's a lot": if you only want to write Nim when it looks like C, i think you might be better off using another (C-like) language, for example D
17:27:29FromDiscord<CAA> The primary reason why I'm using nim because it's right now the best bindings for godot. I don't know how good the D bindings are for godot.
17:28:01FromDiscord<queersorceress> In reply to @naturalethic "It won't export a": https://nim-lang.org/docs/manual.html#modules-module-names-in-imports
17:28:04FromDiscord<naturalethic> When I was young I had the urge to twist languages to my style, its a fruitless and misguided urge. Better to accept the intent of the design and standardize on the common style
17:29:25FromGitter<deech> haxscamper, https://github.com/nim-lang/fusion/issues/76
17:30:02FromGitter<deech> haxscramper, https://github.com/nim-lang/fusion/issues/76
17:30:08FromDiscord<queersorceress> @CAA nobody is going to stop you, but you need to recognize that the whole point of using a language that isn't C, is that it isn't a heap of garbage and sharp edges - is that it isn't C. so there are loads of ways to perform unsafe memory operations, but you have to be aware of how those actions change how the rest of your code is handled.
17:30:28*Zoom[m] quit (Ping timeout: 268 seconds)
17:30:28*retroedgetech[m] quit (Ping timeout: 268 seconds)
17:30:28*j-james[m] quit (Ping timeout: 268 seconds)
17:30:28*Avahe[m] quit (Ping timeout: 268 seconds)
17:30:28*kaputse[m] quit (Ping timeout: 268 seconds)
17:30:48FromDiscord<naturalethic> In reply to @queersorceress "https://nim-lang.org/docs/manual.html#modules-modul": Yes I had read through this, it doesn't speak to this issue
17:31:10FromDiscord<queersorceress> well, if you import your `env.nim` as something that isn't `env` then it should work, no?
17:31:17FromDiscord<CAA> If I have more than one MINGW in my path, will nim know which is the proper one to use?
17:31:23FromDiscord<BasicBlock> Rust has better Godot bindings
17:31:26FromDiscord<queersorceress> as it should resolve the symbol without the names conflicting.
17:31:55PMunch@CAA, probably not
17:32:02PMunchUnless you have named them different things
17:32:03FromDiscord<naturalethic> In reply to @queersorceress "well, if you import": It does not
17:32:03FromDiscord<queersorceress> In reply to @CAA "If I have more": it would choose the one based on path ordering, like how all other executables would be
17:32:13PMunchI mean you can manually specify
17:32:15FromDiscord<konsumlamm> In reply to @naturalethic "How do I initialize": actually, this works, you just typo'd `databse` (instead of `database`) - that's the disadvantage of using tuples, you get less type safety
17:32:29FromDiscord<CAA> Should I just rename or delete my other mingw32 that wans't downloaded?
17:32:40FromDiscord<queersorceress> In reply to @naturalethic "It does not": huh! well, maybe you should get better at verbose naming 🙂
17:32:45*Avatarfighter[m] joined #nim
17:33:30FromDiscord<naturalethic> In reply to @konsumlamm "actually, this works, you": Wow embarrassing -- thanks
17:34:11FromDiscord<konsumlamm> it took me a while as well, i found it while trying to minimize your example
17:37:00FromDiscord<naturalethic> In reply to @queersorceress "huh! well, maybe you": Now that I understand `import foo` imports the package itself into scope, as well as all its exports (and not just the exports), I understand why this is illegal. Thanks for entertaining my boggle!
17:38:23FromDiscord<queersorceress> In reply to @naturalethic "Now that I understand": glad i was able to help somewhat! i learned something too!
17:39:43*Prestige joined #nim
17:40:05Prestigekrux02: why were you saying not to write a treesitter grammar?
17:40:20PrestigeWoops, wrong chan
17:40:38PMunchHi Prestige, good work on the NimLSP PR :)
17:40:55PrestigeThanks, had some help from saem
17:41:59PrestigeSpeaking of, that issue is back (no diagnostics) since we don't allow extra fields in the json - would like to chat to solve the issue when you can
17:42:06FromDiscord<naturalethic> The reason I was trying things this way (exporting a variable `env` in a package `env`) is that coming from JS, one can export a default structure. So this reveals that a module itself cannot be `typed`. To achieve using `env` this way, I have to manually export every field in the module, but the combination of those fields in the module cannot correspond to an overall type
17:43:29FromDiscord<queersorceress> @mratsim hey are you around? you seem like the person i should talk to about getting clearing up my confusion on nim's concurrency vs parallelism
17:44:01*watzon joined #nim
17:44:51*Benjamin[m]2 joined #nim
17:44:54*Stephen[m]2 joined #nim
17:45:15*unclechu joined #nim
17:45:23*reversem3 joined #nim
17:54:29krux02Prestige, I have no explicit experience with treesitter, but generally speaking, writing a parser is not hard. And the tools that I know about generelly get more in the way instead of actually helping the task.
17:54:59krux02but I can be wrong. After all I think regular expression libraries are very useful for specific parsing tasks.
17:55:11PrestigeWell I guess that's good news for me
17:55:52*gollark[m]1 joined #nim
17:56:09*MTRNord joined #nim
17:56:18FromDiscord<Unaimend> Do we have a parser combinator package, similar to haskells parsec/megaparsec?
17:56:35PMunchPrestige, that's a tricky one
17:56:39FromDiscord<Unaimend> With those writing parsers was actually really fun
17:56:43PMunchBecause technically it's they who are doing something wrong..
17:57:19PrestigeIs it against the specification to send extra fields?
17:57:23PMunchYup
17:57:34PMunchSo I need to implement a hack to work around it
17:57:41PrestigeHmm w
17:57:46PrestigeWeird
17:58:21PMunchThe problem is that the only difference between a request and a notification is that there is no `id` field for a notification. So with allowExtra it matches both..
17:58:34PMunchBut I think I know a way around it
18:06:51*BitPuffin joined #nim
18:11:12saemA notification cannot have an id field, but other additional fields are ok, for LSP/JSON-RPC
18:12:13*sixtyten joined #nim
18:13:42*antholop[m] joined #nim
18:13:57*sixtyten left #nim (#nim)
18:23:28*head joined #nim
18:24:42*vycb[m] joined #nim
18:24:51*stisa joined #nim
18:24:55*vindaar[m] joined #nim
18:24:58*alex[m]28 joined #nim
18:24:58*vegai1 joined #nim
18:24:59*ee7[m] joined #nim
18:25:03*leorize[m] joined #nim
18:27:03*ShalokShalom[m] joined #nim
18:27:16*liblq-dev joined #nim
18:27:51*sekao[m] joined #nim
18:27:52*drbixx[m] joined #nim
18:27:52*headache joined #nim
18:28:28*Yardanico[m] joined #nim
18:28:34*k0mpjut0r joined #nim
18:28:36*Clonkk[m] joined #nim
18:28:38*zazi[m] joined #nim
18:28:46*haxscramper quit (Remote host closed the connection)
18:28:57*nxnl[m] joined #nim
18:30:15*retroedgetech[m] joined #nim
18:31:35FromDiscord<lumi> when do you use a `ref object` instead of `object` with some `var T` in procedures? I'm not sure I understand that completely
18:34:19FromDiscord<BasicBlock> you mean for the argument signature of a proc?
18:34:34FromDiscord<Recruit_main707> var object is implicitly a pointer
18:34:50FromDiscord<Recruit_main707> ref object is a managed pointer, which means its garbage collected
18:35:08FromDiscord<Recruit_main707> there is a thread that explains it very well
18:35:38FromDiscord<lumi> just in general for types! When should I simply use `object` and when should I use `ref object`
18:35:56FromDiscord<lumi> In reply to @Recruit_main707 "there is a thread": do you have a link? I'd love to read it
18:36:28FromDiscord<BasicBlock> default should be dont use ref
18:36:34FromDiscord<Recruit_main707> im looking for it
18:37:15*head quit (Quit: Leaving)
18:45:27FromDiscord<Recruit_main707> took me a while but check this:↵passing something by reference:↵https://forum.nim-lang.org/t/1787#11158
18:45:52*lnxw37d4 joined #nim
18:47:05FromDiscord<Recruit_main707> basically, you use ref object instead of object when you are going to pass that object by reference, to avoid writing `ref object` every single time
18:49:01*kaputse[m] joined #nim
18:49:02FromDiscord<Recruit_main707> i forgot, ref is heap allocated
18:49:03PrestigePMunch: did you see saem's msg? Maybe it would simplify the solution
18:50:02*i_use_arch_btw[4 joined #nim
18:52:48*Zoom[m] joined #nim
18:53:05FromDiscord<lumi> In reply to @Recruit_main707 "took me a while": Ahh thanks a bunch, this was a great thread to read
18:53:43*teasea quit (Quit: teasea)
18:55:43*teasea joined #nim
18:55:59*Avahe[m] joined #nim
18:56:07*j-james[m] joined #nim
18:56:40FromDiscord<lumi> sent a code paste, see https://play.nim-lang.org/#ix=2S2X
18:56:58FromDiscord<lumi> (edit) "https://play.nim-lang.org/#ix=2S2X" => "https://play.nim-lang.org/#ix=2S2Y"
18:58:44*vicfred joined #nim
19:03:54FromDiscord<Recruit_main707> `var MyObject` is an implicit pointer to a stack allocated object (unless its a `ref object`), ref is a pointer to a heap allocated (managed by the garbage collector) object
19:04:26FromDiscord<Recruit_main707> afaik
19:09:11FromDiscord<mratsim> In reply to @queersorceress "what i'm really after": yes always start with locks
19:09:20FromDiscord<mratsim> In reply to @queersorceress "<@!570268431522201601> hey are you": around now
19:17:54*Mister_Magister joined #nim
19:18:08Mister_Magistercan u send ICMP echo-request aka ping from nim?
19:19:34FromDiscord<mratsim> did you check yglukhov simple threadpool @queersorceress https://github.com/yglukhov/threadpools/blob/master/threadpool_simple.nim? it might do what you need.
19:19:50FromDiscord<mratsim> In reply to @Mister_Magister "can u send ICMP": If you can do it in C you can do it in Nim
19:20:26Mister_MagisterFromDiscord: how then
19:20:30Mister_Magisterah fuck
19:20:36Mister_Magister@mratsim how then
19:24:57FromDiscord<queersorceress> In reply to @mratsim "did you check yglukhov": I have, but the part i'm getting stuck on is the jargon that gets used, so what i'm looking for might well be there but it's meaningless if it doesn't connect to something i understand. I just wrote a wrapper around the `threadproxy` module that i think should do what i want, but something is going wrong and it feels like i'm missing something obvious.
19:26:38FromDiscord<mratsim> okay. So basic jargon: "spawn" creates a task.
19:27:03FromDiscord<mratsim> a FLowvar is like a future but we use Future already for async
19:27:07FromDiscord<mratsim> (edit) "FLowvar" => "Flowvar"
19:27:17FromDiscord<mratsim> so we needed to come up with another name to avoid name clash
19:28:27FromDiscord<mratsim> In nim `^` is the proc for awaiting a Flowvar and extract the result from it.
19:29:18FromDiscord<mratsim> that + `newThreadpool` should cover Task Parallelism/multithreading basics.
19:29:22^Q-Master^It might be that threads without arc are separated from each other, so the memory is not shared between them.
19:29:31PMunchPrestige, that's pretty much what I was planning to do
19:29:45PMunchBut I don't think he's correct with the statement that they can have extra fields
19:29:55PMunchI'm pretty sure I checked the spec for this at some point
19:30:19FromDiscord<mratsim> In reply to @^Q-Master^ "It might be that": Yes that is true, but Yuriy's threadpool uses Nim channels as a base which should handle the thread-local heaps just fine.
19:30:46*j is now known as jess
19:32:14FromDiscord<queersorceress> i think that's key to my problem here, i have threads that i want to talk between, but it isn't clear to me at all how any of this is backed, like i want to just push blocks of work onto a queue where they get done in fifo; but literally nowhere does language like this get used to describe the fundamentals
19:32:24^Q-Master^@mratsim: I've stuck at that case (separated threads) while writing with mongodb pooling for multithreaded, so I'm writing obvious for me things. :)
19:33:03FromDiscord<mratsim> In reply to @queersorceress "i think that's key": Use Nim channels as the queue.
19:33:19^Q-Master^@queersorceress: without arc the memory sharing between threads is a trick
19:33:27FromDiscord<mratsim> Even the `async` tutorial from juancarlospaco was stuck :/
19:34:21FromDiscord<mratsim> Basically send and recv: https://nim-lang.org/docs/channels.html#trySend%2CChannel%5BTMsg%5D%2CsinkTMsg
19:36:20FromDiscord<queersorceress> In reply to @mratsim "Use Nim channels as": i think i have most of an implementation done now, but it's pretty awful that there is no high level api that does this at all. i mean, i get that the memory model is different from most languages but still, this isn't a unique or unusual thing to want, is it?
19:36:41FromDiscord<mratsim> No it's not.
19:36:52FromDiscord<queersorceress> so why does it suck so much
19:37:02FromDiscord<mratsim> It's mostly a combination of lack of manpower + lack of itnerested parties + lack of knowledge.
19:37:26FromDiscord<mratsim> You need people invested enough in Nim to want to try to improve things.
19:37:57FromDiscord<mratsim> And due to the thead local heaps, you couldn't just reuse your C/C++ knowledge (unless you used Boehm GC, since ARC didn't exist until recently).
19:38:29FromDiscord<mratsim> so assuming you get people interested in Nim, you need them to have knowledge in multithreading.
19:38:46FromDiscord<mratsim> or you need people who know multithreading to learn Nim quirks.
19:39:12FromDiscord<mratsim> And then you need them to scratch the itch of everyone instead of building a library to solve their problem in their corner, say Arraymancer 😉
19:41:42FromDiscord<queersorceress> unfortunately the lack of documentation seems to be the most foundational problem, like, this isn't difficult at all for me to do but the way the APIs work is so opaque that i am unsure i can implement this successfully. i'm using this library (https://github.com/jackhftang/threadproxy.nim) atm to wrap the inter-channel messaging as it makes callback and declaration a lot cleaner, but i seem to be having segfaults and memory issues
19:53:36FromDiscord<mratsim> try using gc:arc?
20:03:53FromDiscord<queersorceress> that helps, but i'm still getting segfaults from trying to access nil that i don't know where they are coming from.
20:05:00FromDiscord<NickSeagull> sent a code paste, see https://paste.rs/Rzk
20:05:04*JustASlacker joined #nim
20:10:43FromDiscord<exelotl> @NickSeagull what options are you compiling with?
20:12:22FromDiscord<exelotl> (also, there ought to be more to that error, which assertion failed? Size of pointer is not as expected?)
20:17:39*PMunch quit (Ping timeout: 260 seconds)
20:19:04^Q-Master^@mratsim: heh true, lack of people is a main problem. I'm awaiting for dom to review my PR to async code for already a month, seems he's too much busy and my patch is somehow hard to get into without investigations. :(
20:19:23FromDiscord<NickSeagull> In reply to @exelotl "(also, there ought to": Sure, heres the log https://media.discordapp.net/attachments/371759389889003532/818216279626219601/message.txt
20:20:09FromDiscord<NickSeagull> Regarding options, I literally initialized a nimble package and compiled with `nimble cpp --cpu:arm --os:linux src/soup_machine.nim --verbose`
20:20:21FromDiscord<NickSeagull> `soup_machine` is the name of the package
20:23:42FromDiscord<Yardanico> In reply to @NickSeagull "Regarding options, I literally": You also need a C compiler that can cross compile to arm
20:24:50FromDiscord<NickSeagull> In reply to @Yardanico "You also need a": I do, but for some reason I cannot tell Nim to use it instead of the typical gcc/g++/etc...
20:26:55FromDiscord<exelotl> you can make a `nim.cfg` file and fill out the values for `arm.linux.gcc.path` and such in there: https://nim-lang.org/docs/nimc.html#crossminuscompilation
20:27:00FromDiscord<Yardanico> In reply to @NickSeagull "I do, but for": If it's in path you simply need to provide --gcc.cpp.exe:"arm-linux-whatever" --gcc.cpp.linkerexe:"same"
20:27:14FromDiscord<Yardanico> gcc.cpp if you use the C++ backend of course
20:27:34FromDiscord<exelotl> yeah or that ^
20:27:41FromDiscord<Yardanico> Because you have "nimble cpp"
20:32:24FromDiscord<NickSeagull> I see thanks, will try that
20:36:14FromDiscord<queersorceress> @mratsim why does this (https://gist.github.com/samdmarshall/4689f3f08aea17c50616296d057a3a6d) segfault? i'm comparing this to the manual thread creation example here (https://github.com/jackhftang/threadproxy.nim#manually-create-thread) and i don't know what i'm missing here.
20:36:35FromDiscord<~355/113 Man> can anyone recomend a good plotting library? i've found plotly, but that seems to do browser stuff? also found another library that uses GR Framework, but I don't want to download a graphics framework just for a simple project
20:41:05FromDiscord<Yardanico> Have you tried https://github.com/Vindaar/ggplotnim ?
20:41:11FromDiscord<zetashift> @~355/113 Man check for ggplotnim
20:41:14FromDiscord<zetashift> Ah yes
20:49:57FromDiscord<~355/113 Man> hmm still requires downloading a dll but I guess it'll work
20:51:35FromGitter<deech> Is `fusion` expected to work with `orc`/`arc`?
20:52:24FromDiscord<konsumlamm> why wouldn't it?
20:53:06*JustASlacker quit (Ping timeout: 246 seconds)
20:53:30FromDiscord<~355/113 Man> oi, and that dll is a bit of work to get too 😦
20:54:13FromDiscord<Yardanico> It's not?
20:54:18FromDiscord<Yardanico> Just download it
20:54:39FromDiscord<Yardanico> "or to thank @preshing’s work and use his standalone single DLL for cairo on windows: https://github.com/preshing/cairo-windows"
20:54:54FromDiscord<~355/113 Man> yea, but that says I have to build it
20:55:08FromDiscord<~355/113 Man> with something called MSYS2
20:55:11FromDiscord<Yardanico> No
20:55:17FromDiscord<Yardanico> It says "binary releases"
20:55:43FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/818225418792075294/Screenshot_20210307-235524704.jpg
20:55:50FromDiscord<~355/113 Man> i'm blind thanks
21:00:20FromGitter<deech> I've found a couple of bits that don't. I just reported one but wanted to check if there was some understood policy.
21:00:35FromDiscord<VinKer> Hi all, what is the Nim equivalent of left shift operator (<<) in C++ ?
21:00:49Prestigeshl
21:01:13FromDiscord<VinKer> Thanks
21:01:13Prestigewait maybe not
21:01:20FromDiscord<VinKer> Oh okay
21:01:48Prestigehttps://nim-lang.org/docs/tut1.html#basic-types-integers I was correct actually
21:04:13Prestige!eval echo 300 shl 2
21:04:15NimBot1200
21:04:39FromDiscord<~355/113 Man> out of curiosity is there a rotate?
21:05:35Prestigewhat kind of rotate do you mean?
21:06:42FromDiscord<VinKer> Thanks @Prestige[IRC]
21:07:03FromDiscord<~355/113 Man> `10010001` rotate left -> `00100011`
21:07:22*lritter joined #nim
21:08:19Prestigehm so shl and shr treat the values as unsigned, and unsigned ops wrap around - not sure if that would work how you wanted it
21:09:01Prestigeother than that, I'm not seeing anything in the docs
21:09:06FromDiscord<~355/113 Man> I'm assuming ↵`10010001` shl -> `00100010`
21:13:31FromDiscord<~355/113 Man> hmmm, I did `nimble install ggplotnim` which succeeded, but I can't seem to import it, it says file not found
21:13:46FromDiscord<~355/113 Man> (edit) "hmmm, I did `nimble install ggplotnim` which succeeded, but I can't seem to import it, it says ... file" added "can't open" | removed "not found"
21:16:01FromDiscord<~355/113 Man> ah, fixed it by 'requires "ggplotnim"`
21:16:04FromDiscord<~355/113 Man> (edit) "'requires" => "`requires"
21:16:47FromDiscord<NickSeagull> :q
21:18:41Prestige355: https://play.nim-lang.org/#ix=2S4X
21:21:05FromDiscord<~355/113 Man> can ggplotnim plot to a window? (also call me pi)
21:30:56FromDiscord<~355/113 Man> does ggplotnim not have surface plotting?
21:43:39leorize[m]you might want to go over the science channel to get help on ggplotnim
21:43:43leorize[m]its author is there
21:57:20FromDiscord<~355/113 Man> is there a way to do something like `0..10` but with a specified step size?
21:58:20FromDiscord<InventorMatt> countup may be what you are looking for
21:58:31*Gennaro joined #nim
21:59:19FromDiscord<InventorMatt> sent a code paste, see https://paste.rs/eBh
22:00:05FromDiscord<~355/113 Man> thanks
22:00:45*Gennaro quit (Client Quit)
22:01:32FromDiscord<Ricky Spanish> how do you make a object parameter optional when doing a json to object conversion?
22:01:46FromDiscord<Ricky Spanish> field rather
22:03:03FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5t
22:03:15FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5u
22:04:05FromDiscord<InventorMatt> you'll have to convert it into a generator first
22:04:06leorize[m]@Ricky make the field use `options.Option[T]`
22:04:42FromDiscord<Ricky Spanish> ah great thats what i was looking for, thanks @leorize[Matrix]
22:05:42FromDiscord<InventorMatt> @~355/113 Man look at the closure iterator section in https://nim-by-example.github.io/for_iterators/
22:09:33FromDiscord<Solitude> In reply to @~355/113 Man "hmm? ``` Error: attempting": sequtils.toSeq
22:12:15FromDiscord<Hi02Hi> In reply to @~355/113 Man "out of curiosity is": Is this what you mean?↵https://nim-lang.org/docs/bitops.html#rotateLeftBits%2Cuint8%2Crange%5B%5D
22:12:52FromDiscord<~355/113 Man> yea
22:13:33FromDiscord<~355/113 Man> `Positive` is only integers?
22:13:49FromDiscord<~355/113 Man> so I can't do `countup(0, 10, 0.1)`?
22:16:19FromDiscord<Hi02Hi> I think float error would not allow that
22:17:23FromDiscord<Solitude> In reply to @~355/113 Man "so I can't do": builtin countup/down is only for ordinal types
22:18:13FromDiscord<Hi02Hi> from the docs↵↵Ordinal type includes integer, bool, character, and enumeration types, as well as their subtypes.
22:22:26*krux02 quit (Ping timeout: 240 seconds)
22:23:02*krux02 joined #nim
22:25:29FromDiscord<Araq> you can easily write your own `countup` that supports a floating point step. Seems like a bad idea as 0.1 cannot be represented as a float precisely but shrug
22:27:27FromDiscord<NickSeagull> What's the best way to interop with C++? I'm currently trying to use a cpp library that relies a lot on creating subclasses of come abstract class, but not sure how to map that to Nim. Tried `nimterop` to generate bindings, it fails a lot, currently trying to use `nimline`, but doesn't seem to support creating new classes
22:29:43FromDiscord<Solitude> In reply to @NickSeagull "What's the best way": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma
22:31:44FromDiscord<NickSeagull> In reply to @Solitude "https://nim-lang.org/docs/manual.html#implementatio": Yeah, read that, but for some reason I cannot seem to understand how can I create subclasses? with `.emit` ?
22:32:13FromDiscord<Araq> I use `.emit` for this
22:33:19FromDiscord<NickSeagull> In reply to @Araq "I use `.emit` ": But then how would one implement the code for the methods of that class in Nim? Passing callbacks?
22:35:57FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5D
22:36:25FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5E
22:36:36FromDiscord<~355/113 Man> (edit) "https://paste.rs/S1f" => "https://play.nim-lang.org/#ix=2S5F"
22:38:07FromDiscord<~355/113 Man> hold on let me try something, nope
22:43:03FromDiscord<NickSeagull> In reply to @NickSeagull "But then how would": I'm trying to implement the methods by using `.exportc`, but ofc, identifiers don't admit doing `Class:methodName`, so not sure how would I go with this 🤔
22:44:02FromDiscord<NickSeagull> If it matters, I'm trying to port this code to Nim: https://github1s.com/NickSeagull/cabl/blob/HEAD/examples/device-test/DeviceTest.cpp
22:44:10*tane quit (Quit: Leaving)
22:46:50FromDiscord<~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5L
22:47:45FromDiscord<~355/113 Man> well "worked"
22:48:53FromDiscord<queersorceress> can someone please explain to me why the code in `queues1.nim` is able to run successfully, but the code in `queues2.nim` segfaults due to accessing nil? https://gist.github.com/samdmarshall/d8fbe05e39ec385d70aa09a1683692ae
22:50:58FromDiscord<queersorceress> is there something magic about threads and channels where it matters which scope you create them and stuff? cuz that is the only reason i can think of that could cause this behavior i'm seeing.
23:38:33FromDiscord<Unaimend> does nim-lsp support stuff like go to definition
23:38:36FromDiscord<Unaimend> go to usage etc
23:38:49FromDiscord<Unaimend> or are you guys all you using stuff like ctags
23:41:22PrestigeIt supports go to definition
23:41:43PrestigeThe github page has a list of its supported lsp features
23:42:09Prestigehttps://github.com/PMunch/nimlsp
23:42:27*dddddd quit (Ping timeout: 256 seconds)
23:43:53FromDiscord<Unaimend> so I do not see what I have to do to use go to defintion in for example nvim
23:45:00*dddddd joined #nim
23:46:38PrestigeWhat's your lsp setup with nvim? I use it with nim (and other languages) just fine
23:49:31FromDiscord<Unaimend> just copied the stuff from nimslp readme
23:49:59FromDiscord<Unaimend> I have never worked with lsps so maybe I am missing sth. really obvious here which I did not cofigure
23:52:16PrestigeI haven't tried the steps on the nimlsp README, I just use CoC https://github.com/neoclide/coc.nvim and set up an lsp server for nim (guide on the coc github wiki)
23:56:16leorize[m]if you use nim.nvim, go-to-definition is bound to `gd` by default
23:56:23leorize[m]though it doesn't use LSP
23:59:28PrestigeLsp is sort of broken for coc right now anyway, I had to patch it locally