00:02:22 | FromDiscord | <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:28 | FromDiscord | <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:56 | FromDiscord | <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:45 | FromDiscord | <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:40 | FromDiscord | <dk> In reply to @ajusa "I'm trying to make": maybe `server.setSockOpt(OptReuseAddr, true)` would help |
00:08:33 | FromDiscord | <queersorceress> that sounds like a system resource error, not a language one, maybe you should look at how other implementations handle it? |
00:08:44 | FromDiscord | <ElegantBeef> In reply to @Unaimend "Yeah fidget does look": "Bare metal"...? it's opengl rendered as bare metal as you could want |
00:09:49 | FromDiscord | <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:51 | FromDiscord | <Unaimend> In reply to @ElegantBeef ""Bare metal"...? it's opengl": hmm I like that 🙂 |
00:10:31 | FromDiscord | <ajusa> In reply to @dk "maybe `server.setSockOpt(OptReuseAddr, true)` would": Just tried that, it didn't make a difference |
00:13:06 | FromDiscord | <queersorceress> In reply to @ajusa "It is a system": what about non-nim implementations? nmap, etc? |
00:18:17 | FromDiscord | <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:41 | FromDiscord | <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:09 | FromDiscord | <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:57 | xioren | is there any update on SciNim? Will it eventually be part if the stdlib? |
00:24:45 | FromDiscord | <queersorceress> sent a long message, see https://paste.rs/44B |
00:28:00 | FromDiscord | <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:52 | FromDiscord | <dk> why use threads instead of async? |
00:33:00 | FromDiscord | <queersorceress> it's just an abstraction, i'm just use to thinking of "threads" when i mean "work done somewhere else" |
00:34:50 | FromDiscord | <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:26 | j-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:43 | j-james[m] | Right now it lumps everything under a single FromDiscord bot like so |
00:40:17 | * | Vladar quit (Quit: Leaving) |
00:42:11 | FromDiscord | <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:57 | xioren | So 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:57 | xioren | Was wondering if its ready to be used in practice or if there is more work that needs to be done. |
01:06:38 | xioren | I 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:36 | FromDiscord | <InventorMatt> you'll need to ask @mratsim about that |
01:10:19 | FromDiscord | <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:42 | xioren | @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:43 | xioren | responds* |
01:48:01 | FromDiscord | <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:51 | FromDiscord | <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:07 | FromDiscord | <Yardanico> And to be that fast it has its own custom TCP/IP stack |
02:57:47 | FromDiscord | <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:10 | FromDiscord | <ElegantBeef> Diffing a macro's output with the dumptree of `repr` getting "The two files are identical" is not a nice feeling |
07:37:28 | FromDiscord | <ElegantBeef> Well i guess i found a compiler error, so yay? |
07:40:53 | FromDiscord | <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:37 | FromDiscord | <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:33 | FromDiscord | <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:08 | FromDiscord | <mratsim> AFAIK someone already used pHash but unsure if it was from Nim or not. |
08:37:19 | FromDiscord | <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:58 | FromDiscord | <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:51 | FromDiscord | <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:22 | ForumUpdaterBot | New 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:29 | FromDiscord | <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:39 | FromDiscord | <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:47 | FromDiscord | <Unaimend> ahh that looks nice, i was looking for soure trail support for nim the other day but not find anything |
13:24:33 | FromDiscord | <haxscramper> It is highly experimental, but right now I'm mostly in 'minor fixups' stage - major parts are working fine |
13:24:52 | FromDiscord | <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:33 | FromDiscord | <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:47 | FromDiscord | <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:19 | FromDiscord | <haxscramper> I've seen it only a handful of times, it is not mentioned in the manual of course |
13:47:26 | FromGitter | <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:22 | krux02 | @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:40 | FromDiscord | <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:49 | FromDiscord | <haxscramper> But it is hard to tell what is going on without code |
13:52:24 | FromDiscord | <flywind> `<//> ` will be removed when cource_v1 is introduced. |
13:52:36 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/pull/15307 |
13:52:50 | FromDiscord | <flywind> (edit) "cource_v1" => "csource_v1" |
13:54:11 | FromGitter | <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:21 | krux02 | @flywind: well you can hope. |
14:01:48 | FromDiscord | <Unaimend> @haxscramper So would you start inexing the compiler with haxdoc |
14:02:20 | FromDiscord | <haxscramper> Are you asking whether it is capable of doing this? |
14:02:34 | FromDiscord | <Unaimend> In reply to @haxscramper "Are you asking whether": nope |
14:03:04 | FromDiscord | <Unaimend> (edit) "nope" => "but maybe yes, but I presume it is" |
14:03:28 | FromDiscord | <Unaimend> (edit) "is" => "is. Since you answerded with haxdoc regarding my post on the compiler" |
14:03:38 | FromDiscord | <haxscramper> I'm indexing nim compiler as part of CI test |
14:03:47 | FromDiscord | <haxscramper> large old codebase with a lot of quirks |
14:03:56 | FromDiscord | <haxscramper> perfect for stress-testing |
14:06:21 | FromDiscord | <haxscramper> And it was absolutely invaluable when I started digging into compiler - better than anything else I've tried |
14:07:02 | FromDiscord | <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:02 | FromDiscord | <haxscramper> Clone compiler and then `haxdoc trail compiler/nim.nim --stdpath:lib` |
14:08:04 | FromDiscord | <haxscramper> https://github.com/haxscramper/haxdoc/blob/8901808edc6ded425b1ecb1fd636e2a1d10de249/.github/workflows/test.yaml#L15 |
14:08:24 | FromDiscord | <haxscramper> There is no GUI support yet |
14:08:45 | FromDiscord | <Unaimend> thx |
14:08:46 | FromDiscord | <haxscramper> But I will add it later |
14:08:59 | FromDiscord | <Unaimend> What do you mean by gui support? |
14:09:23 | FromDiscord | <Unaimend> So I mean why should this program have a gui? |
14:10:22 | FromDiscord | <haxscramper> I mean I can create custom sourcetrail wizards for new projects, like it has for C++ for example |
14:11:13 | FromDiscord | <Unaimend> Ahh I see, that makes sennse |
14:11:17 | FromDiscord | <Unaimend> (edit) "sennse" => "sense" |
14:35:31 | * | Vladar joined #nim |
14:35:53 | FromDiscord | <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:23 | FromDiscord | <haxscramper> unzip, fix `chmod +x haxdoc` (because github CI breaks file permissions) and use `./haxdoc trail compiler/nim.nim` |
14:37:09 | FromDiscord | <haxscramper> download artifacts from latest green CI run |
14:37:33 | FromDiscord | <haxscramper> IIRC everything is statically built, so no additional setup is necessary |
14:40:10 | FromDiscord | <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:13 | FromDiscord | <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:07 | FromDiscord | <Unaimend> I try it |
14:50:21 | FromDiscord | <Unaimend> So where do I find the build arifacts on git hub? |
14:50:26 | FromDiscord | <Unaimend> (edit) "arifacts" => "artifacts" |
14:50:26 | * | abm joined #nim |
14:54:47 | FromDiscord | <haxscramper> https://github.com/haxscramper/haxdoc/actions any last green run has "artifacts" |
14:58:21 | FromDiscord | <Unaimend> found it, thx |
14:58:35 | PMunch | Prestige, I see you've managed to fix the NimLSP issue :D |
14:59:54 | FromDiscord | <Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2S1x |
15:00:46 | FromDiscord | <Unaimend> (edit) "https://play.nim-lang.org/#ix=2S1x" => "https://play.nim-lang.org/#ix=2S1z" |
15:01:16 | FromDiscord | <haxscramper> oh, well, looks like I"m ad idiot after all |
15:01:30 | FromDiscord | <haxscramper> Just build it normally, with nimble install |
15:01:49 | FromDiscord | <haxscramper> (edit) "oh," => "Oh," | "I"m ad" => "I'm an" |
15:02:10 | FromDiscord | <Unaimend> sent a code paste, see https://play.nim-lang.org/#ix=2S1G |
15:02:20 | FromDiscord | <Unaimend> (edit) "https://play.nim-lang.org/#ix=2S1H" => "https://play.nim-lang.org/#ix=2S1G" |
15:14:58 | * | D_ joined #nim |
15:22:46 | FromDiscord | <haxscramper> @Unaimend forgot it is necessary to pass `-d:ssl` when building anything with nimble - pushed fix, should be working now |
15:22:50 | FromDiscord | <haxscramper> I hope |
15:23:04 | FromDiscord | <Unaimend> 😄 |
15:23:21 | FromDiscord | <haxscramper> I just have a severe case of "it works on my machine" |
15:23:25 | FromDiscord | <haxscramper> Sorry for the trouble |
15:23:25 | FromDiscord | <Unaimend> Ill be your tester |
15:23:43 | FromDiscord | <Unaimend> No problem, better find bugs now then later |
15:24:48 | FromDiscord | <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:06 | FromDiscord | <Unaimend> In reply to @haxscramper "<@!287576619718279178> forgot it is": Worked |
15:32:14 | FromDiscord | <Unaimend> In reply to @haxscramper "I just have a": `../haxdoc/bin/haxdoc trail compiler/nim.nim` But this one didnt |
15:33:19 | FromDiscord | <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:10 | FromDiscord | <Unaimend> So the .choosenim path does not exists on my machine |
15:38:42 | PMunch | Did you not install Nim via choosenim perchance? |
15:38:54 | FromDiscord | <Unaimend> yes |
15:39:29 | FromDiscord | <Unaimend> Build it myself with my bare hands |
15:39:51 | * | zedeus quit (Ping timeout: 246 seconds) |
15:41:45 | FromDiscord | <Unaimend> Installing choosenim fixed the problen |
15:42:16 | FromDiscord | <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:56 | FromDiscord | <Cerda> hey yo, is there a way to translate python code into nim? |
15:49:24 | PMunch | There is nimpy |
15:49:43 | PMunch | And 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:57 | FromDiscord | <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:03 | FromDiscord | <CAA> Is it possible to rewrite basic C keywords like printf or enum as nim code? |
17:05:41 | FromDiscord | <queersorceress> printf isn't a keyword, can you explain what you are trying to do? |
17:05:58 | FromDiscord | <naturalethic> sent a code paste, see https://play.nim-lang.org/#ix=2S2k |
17:06:18 | FromDiscord | <naturalethic> (edit) "https://paste.rs/mxG" => "https://play.nim-lang.org/#ix=2S2l" |
17:06:30 | FromDiscord | <CAA> I was just wondering if I could do stuff like printf or int [variable name] in nim. |
17:07:27 | FromDiscord | <queersorceress> you mean, call a function or declare a variable? |
17:07:34 | FromDiscord | <CAA> Yes. I think. |
17:07:58 | FromDiscord | <queersorceress> https://nim-lang.org/docs/tut1.html |
17:08:37 | FromDiscord | <CAA> What I'm asking is, is it possible to somehow declare a variable as int variable rather than variable: int? |
17:08:55 | FromDiscord | <queersorceress> you mean, change the language's syntax entirely? |
17:09:11 | FromDiscord | <CAA> No. Not entirely. |
17:11:36 | FromDiscord | <Unaimend> you want to give it the name int |
17:11:40 | FromDiscord | <Unaimend> like var int |
17:11:43 | FromDiscord | <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:56 | FromDiscord | <Unaimend> (edit) |
17:13:20 | FromDiscord | <naturalethic> Basically, how do I specify the type in a tuple literal |
17:13:32 | FromDiscord | <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:42 | ForumUpdaterBot | New thread by Vitreo12: Custom allocator with --gc:arc, see https://forum.nim-lang.org/t/7588 |
17:13:48 | FromDiscord | <queersorceress> In reply to @naturalethic "Basically, how do I": does it have to be a tuple, why not use an object definition? |
17:14:37 | FromDiscord | <queersorceress> that should make the initialization easier as an object type would have a default initializer you can use. |
17:15:20 | FromDiscord | <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:30 | FromDiscord | <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:54 | FromDiscord | <CAA> So technically I could make nim a tad bit more C like with macros? |
17:17:04 | PMunch | Ah you want to do `int x = 100;` in Nim? |
17:17:15 | FromDiscord | <CAA> Yes. That's basically what I want to do. |
17:17:21 | FromDiscord | <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:50 | FromDiscord | <queersorceress> frankly i'd just say use another language if it bothers you this much. |
17:18:06 | PMunch | Yeah 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:19 | PMunch | Or wait |
17:18:20 | * | ormiret joined #nim |
17:18:21 | * | robertmeta joined #nim |
17:18:25 | PMunch | With command syntax you might be able to |
17:18:44 | * | kwilczynski joined #nim |
17:19:18 | FromDiscord | <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:23 | FromDiscord | <naturalethic> sent a code paste, see https://play.nim-lang.org/#ix=2S2p |
17:20:24 | FromDiscord | <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:12 | FromDiscord | <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:28 | PMunch | Well changing the entire syntax isn't exactly minor |
17:21:33 | * | Benjamin[m]2 quit (Ping timeout: 246 seconds) |
17:21:42 | PMunch | I tried out the command syntax thing but can't really get it to work.. |
17:21:45 | FromDiscord | <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:50 | FromDiscord | <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:53 | FromDiscord | <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:41 | FromDiscord | <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:30 | FromDiscord | <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:07 | FromDiscord | <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:43 | FromDiscord | <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:12 | FromDiscord | <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:53 | FromDiscord | <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:29 | FromDiscord | <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:01 | FromDiscord | <queersorceress> In reply to @naturalethic "It won't export a": https://nim-lang.org/docs/manual.html#modules-module-names-in-imports |
17:28:04 | FromDiscord | <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:25 | FromGitter | <deech> haxscamper, https://github.com/nim-lang/fusion/issues/76 |
17:30:02 | FromGitter | <deech> haxscramper, https://github.com/nim-lang/fusion/issues/76 |
17:30:08 | FromDiscord | <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:48 | FromDiscord | <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:10 | FromDiscord | <queersorceress> well, if you import your `env.nim` as something that isn't `env` then it should work, no? |
17:31:17 | FromDiscord | <CAA> If I have more than one MINGW in my path, will nim know which is the proper one to use? |
17:31:23 | FromDiscord | <BasicBlock> Rust has better Godot bindings |
17:31:26 | FromDiscord | <queersorceress> as it should resolve the symbol without the names conflicting. |
17:31:55 | PMunch | @CAA, probably not |
17:32:02 | PMunch | Unless you have named them different things |
17:32:03 | FromDiscord | <naturalethic> In reply to @queersorceress "well, if you import": It does not |
17:32:03 | FromDiscord | <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:13 | PMunch | I mean you can manually specify |
17:32:15 | FromDiscord | <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:29 | FromDiscord | <CAA> Should I just rename or delete my other mingw32 that wans't downloaded? |
17:32:40 | FromDiscord | <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:30 | FromDiscord | <naturalethic> In reply to @konsumlamm "actually, this works, you": Wow embarrassing -- thanks |
17:34:11 | FromDiscord | <konsumlamm> it took me a while as well, i found it while trying to minimize your example |
17:37:00 | FromDiscord | <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:23 | FromDiscord | <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:05 | Prestige | krux02: why were you saying not to write a treesitter grammar? |
17:40:20 | Prestige | Woops, wrong chan |
17:40:38 | PMunch | Hi Prestige, good work on the NimLSP PR :) |
17:40:55 | Prestige | Thanks, had some help from saem |
17:41:59 | Prestige | Speaking 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:06 | FromDiscord | <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:29 | FromDiscord | <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:29 | krux02 | Prestige, 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:59 | krux02 | but I can be wrong. After all I think regular expression libraries are very useful for specific parsing tasks. |
17:55:11 | Prestige | Well I guess that's good news for me |
17:55:52 | * | gollark[m]1 joined #nim |
17:56:09 | * | MTRNord joined #nim |
17:56:18 | FromDiscord | <Unaimend> Do we have a parser combinator package, similar to haskells parsec/megaparsec? |
17:56:35 | PMunch | Prestige, that's a tricky one |
17:56:39 | FromDiscord | <Unaimend> With those writing parsers was actually really fun |
17:56:43 | PMunch | Because technically it's they who are doing something wrong.. |
17:57:19 | Prestige | Is it against the specification to send extra fields? |
17:57:23 | PMunch | Yup |
17:57:34 | PMunch | So I need to implement a hack to work around it |
17:57:41 | Prestige | Hmm w |
17:57:46 | Prestige | Weird |
17:58:21 | PMunch | The 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:34 | PMunch | But I think I know a way around it |
18:06:51 | * | BitPuffin joined #nim |
18:11:12 | saem | A 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:35 | FromDiscord | <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:19 | FromDiscord | <BasicBlock> you mean for the argument signature of a proc? |
18:34:34 | FromDiscord | <Recruit_main707> var object is implicitly a pointer |
18:34:50 | FromDiscord | <Recruit_main707> ref object is a managed pointer, which means its garbage collected |
18:35:08 | FromDiscord | <Recruit_main707> there is a thread that explains it very well |
18:35:38 | FromDiscord | <lumi> just in general for types! When should I simply use `object` and when should I use `ref object` |
18:35:56 | FromDiscord | <lumi> In reply to @Recruit_main707 "there is a thread": do you have a link? I'd love to read it |
18:36:28 | FromDiscord | <BasicBlock> default should be dont use ref |
18:36:34 | FromDiscord | <Recruit_main707> im looking for it |
18:37:15 | * | head quit (Quit: Leaving) |
18:45:27 | FromDiscord | <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:05 | FromDiscord | <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:02 | FromDiscord | <Recruit_main707> i forgot, ref is heap allocated |
18:49:03 | Prestige | PMunch: 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:05 | FromDiscord | <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:40 | FromDiscord | <lumi> sent a code paste, see https://play.nim-lang.org/#ix=2S2X |
18:56:58 | FromDiscord | <lumi> (edit) "https://play.nim-lang.org/#ix=2S2X" => "https://play.nim-lang.org/#ix=2S2Y" |
18:58:44 | * | vicfred joined #nim |
19:03:54 | FromDiscord | <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:26 | FromDiscord | <Recruit_main707> afaik |
19:09:11 | FromDiscord | <mratsim> In reply to @queersorceress "what i'm really after": yes always start with locks |
19:09:20 | FromDiscord | <mratsim> In reply to @queersorceress "<@!570268431522201601> hey are you": around now |
19:17:54 | * | Mister_Magister joined #nim |
19:18:08 | Mister_Magister | can u send ICMP echo-request aka ping from nim? |
19:19:34 | FromDiscord | <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:50 | FromDiscord | <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:26 | Mister_Magister | FromDiscord: how then |
19:20:30 | Mister_Magister | ah fuck |
19:20:36 | Mister_Magister | @mratsim how then |
19:24:57 | FromDiscord | <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:38 | FromDiscord | <mratsim> okay. So basic jargon: "spawn" creates a task. |
19:27:03 | FromDiscord | <mratsim> a FLowvar is like a future but we use Future already for async |
19:27:07 | FromDiscord | <mratsim> (edit) "FLowvar" => "Flowvar" |
19:27:17 | FromDiscord | <mratsim> so we needed to come up with another name to avoid name clash |
19:28:27 | FromDiscord | <mratsim> In nim `^` is the proc for awaiting a Flowvar and extract the result from it. |
19:29:18 | FromDiscord | <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:31 | PMunch | Prestige, that's pretty much what I was planning to do |
19:29:45 | PMunch | But I don't think he's correct with the statement that they can have extra fields |
19:29:55 | PMunch | I'm pretty sure I checked the spec for this at some point |
19:30:19 | FromDiscord | <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:14 | FromDiscord | <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:03 | FromDiscord | <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:27 | FromDiscord | <mratsim> Even the `async` tutorial from juancarlospaco was stuck :/ |
19:34:21 | FromDiscord | <mratsim> Basically send and recv: https://nim-lang.org/docs/channels.html#trySend%2CChannel%5BTMsg%5D%2CsinkTMsg |
19:36:20 | FromDiscord | <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:41 | FromDiscord | <mratsim> No it's not. |
19:36:52 | FromDiscord | <queersorceress> so why does it suck so much |
19:37:02 | FromDiscord | <mratsim> It's mostly a combination of lack of manpower + lack of itnerested parties + lack of knowledge. |
19:37:26 | FromDiscord | <mratsim> You need people invested enough in Nim to want to try to improve things. |
19:37:57 | FromDiscord | <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:29 | FromDiscord | <mratsim> so assuming you get people interested in Nim, you need them to have knowledge in multithreading. |
19:38:46 | FromDiscord | <mratsim> or you need people who know multithreading to learn Nim quirks. |
19:39:12 | FromDiscord | <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:42 | FromDiscord | <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:36 | FromDiscord | <mratsim> try using gc:arc? |
20:03:53 | FromDiscord | <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:00 | FromDiscord | <NickSeagull> sent a code paste, see https://paste.rs/Rzk |
20:05:04 | * | JustASlacker joined #nim |
20:10:43 | FromDiscord | <exelotl> @NickSeagull what options are you compiling with? |
20:12:22 | FromDiscord | <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:23 | FromDiscord | <NickSeagull> In reply to @exelotl "(also, there ought to": Sure, heres the log https://media.discordapp.net/attachments/371759389889003532/818216279626219601/message.txt |
20:20:09 | FromDiscord | <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:21 | FromDiscord | <NickSeagull> `soup_machine` is the name of the package |
20:23:42 | FromDiscord | <Yardanico> In reply to @NickSeagull "Regarding options, I literally": You also need a C compiler that can cross compile to arm |
20:24:50 | FromDiscord | <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:55 | FromDiscord | <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:00 | FromDiscord | <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:14 | FromDiscord | <Yardanico> gcc.cpp if you use the C++ backend of course |
20:27:34 | FromDiscord | <exelotl> yeah or that ^ |
20:27:41 | FromDiscord | <Yardanico> Because you have "nimble cpp" |
20:32:24 | FromDiscord | <NickSeagull> I see thanks, will try that |
20:36:14 | FromDiscord | <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:35 | FromDiscord | <~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:05 | FromDiscord | <Yardanico> Have you tried https://github.com/Vindaar/ggplotnim ? |
20:41:11 | FromDiscord | <zetashift> @~355/113 Man check for ggplotnim |
20:41:14 | FromDiscord | <zetashift> Ah yes |
20:49:57 | FromDiscord | <~355/113 Man> hmm still requires downloading a dll but I guess it'll work |
20:51:35 | FromGitter | <deech> Is `fusion` expected to work with `orc`/`arc`? |
20:52:24 | FromDiscord | <konsumlamm> why wouldn't it? |
20:53:06 | * | JustASlacker quit (Ping timeout: 246 seconds) |
20:53:30 | FromDiscord | <~355/113 Man> oi, and that dll is a bit of work to get too 😦 |
20:54:13 | FromDiscord | <Yardanico> It's not? |
20:54:18 | FromDiscord | <Yardanico> Just download it |
20:54:39 | FromDiscord | <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:54 | FromDiscord | <~355/113 Man> yea, but that says I have to build it |
20:55:08 | FromDiscord | <~355/113 Man> with something called MSYS2 |
20:55:11 | FromDiscord | <Yardanico> No |
20:55:17 | FromDiscord | <Yardanico> It says "binary releases" |
20:55:43 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/818225418792075294/Screenshot_20210307-235524704.jpg |
20:55:50 | FromDiscord | <~355/113 Man> i'm blind thanks |
21:00:20 | FromGitter | <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:35 | FromDiscord | <VinKer> Hi all, what is the Nim equivalent of left shift operator (<<) in C++ ? |
21:00:49 | Prestige | shl |
21:01:13 | FromDiscord | <VinKer> Thanks |
21:01:13 | Prestige | wait maybe not |
21:01:20 | FromDiscord | <VinKer> Oh okay |
21:01:48 | Prestige | https://nim-lang.org/docs/tut1.html#basic-types-integers I was correct actually |
21:04:13 | Prestige | !eval echo 300 shl 2 |
21:04:15 | NimBot | 1200 |
21:04:39 | FromDiscord | <~355/113 Man> out of curiosity is there a rotate? |
21:05:35 | Prestige | what kind of rotate do you mean? |
21:06:42 | FromDiscord | <VinKer> Thanks @Prestige[IRC] |
21:07:03 | FromDiscord | <~355/113 Man> `10010001` rotate left -> `00100011` |
21:07:22 | * | lritter joined #nim |
21:08:19 | Prestige | hm 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:01 | Prestige | other than that, I'm not seeing anything in the docs |
21:09:06 | FromDiscord | <~355/113 Man> I'm assuming ↵`10010001` shl -> `00100010` |
21:13:31 | FromDiscord | <~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:46 | FromDiscord | <~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:01 | FromDiscord | <~355/113 Man> ah, fixed it by 'requires "ggplotnim"` |
21:16:04 | FromDiscord | <~355/113 Man> (edit) "'requires" => "`requires" |
21:16:47 | FromDiscord | <NickSeagull> :q |
21:18:41 | Prestige | 355: https://play.nim-lang.org/#ix=2S4X |
21:21:05 | FromDiscord | <~355/113 Man> can ggplotnim plot to a window? (also call me pi) |
21:30:56 | FromDiscord | <~355/113 Man> does ggplotnim not have surface plotting? |
21:43:39 | leorize[m] | you might want to go over the science channel to get help on ggplotnim |
21:43:43 | leorize[m] | its author is there |
21:57:20 | FromDiscord | <~355/113 Man> is there a way to do something like `0..10` but with a specified step size? |
21:58:20 | FromDiscord | <InventorMatt> countup may be what you are looking for |
21:58:31 | * | Gennaro joined #nim |
21:59:19 | FromDiscord | <InventorMatt> sent a code paste, see https://paste.rs/eBh |
22:00:05 | FromDiscord | <~355/113 Man> thanks |
22:00:45 | * | Gennaro quit (Client Quit) |
22:01:32 | FromDiscord | <Ricky Spanish> how do you make a object parameter optional when doing a json to object conversion? |
22:01:46 | FromDiscord | <Ricky Spanish> field rather |
22:03:03 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5t |
22:03:15 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5u |
22:04:05 | FromDiscord | <InventorMatt> you'll have to convert it into a generator first |
22:04:06 | leorize[m] | @Ricky make the field use `options.Option[T]` |
22:04:42 | FromDiscord | <Ricky Spanish> ah great thats what i was looking for, thanks @leorize[Matrix] |
22:05:42 | FromDiscord | <InventorMatt> @~355/113 Man look at the closure iterator section in https://nim-by-example.github.io/for_iterators/ |
22:09:33 | FromDiscord | <Solitude> In reply to @~355/113 Man "hmm? ``` Error: attempting": sequtils.toSeq |
22:12:15 | FromDiscord | <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:52 | FromDiscord | <~355/113 Man> yea |
22:13:33 | FromDiscord | <~355/113 Man> `Positive` is only integers? |
22:13:49 | FromDiscord | <~355/113 Man> so I can't do `countup(0, 10, 0.1)`? |
22:16:19 | FromDiscord | <Hi02Hi> I think float error would not allow that |
22:17:23 | FromDiscord | <Solitude> In reply to @~355/113 Man "so I can't do": builtin countup/down is only for ordinal types |
22:18:13 | FromDiscord | <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:29 | FromDiscord | <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:27 | FromDiscord | <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:43 | FromDiscord | <Solitude> In reply to @NickSeagull "What's the best way": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma |
22:31:44 | FromDiscord | <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:13 | FromDiscord | <Araq> I use `.emit` for this |
22:33:19 | FromDiscord | <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:57 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5D |
22:36:25 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5E |
22:36:36 | FromDiscord | <~355/113 Man> (edit) "https://paste.rs/S1f" => "https://play.nim-lang.org/#ix=2S5F" |
22:38:07 | FromDiscord | <~355/113 Man> hold on let me try something, nope |
22:43:03 | FromDiscord | <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:02 | FromDiscord | <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:50 | FromDiscord | <~355/113 Man> sent a code paste, see https://play.nim-lang.org/#ix=2S5L |
22:47:45 | FromDiscord | <~355/113 Man> well "worked" |
22:48:53 | FromDiscord | <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:58 | FromDiscord | <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:33 | FromDiscord | <Unaimend> does nim-lsp support stuff like go to definition |
23:38:36 | FromDiscord | <Unaimend> go to usage etc |
23:38:49 | FromDiscord | <Unaimend> or are you guys all you using stuff like ctags |
23:41:22 | Prestige | It supports go to definition |
23:41:43 | Prestige | The github page has a list of its supported lsp features |
23:42:09 | Prestige | https://github.com/PMunch/nimlsp |
23:42:27 | * | dddddd quit (Ping timeout: 256 seconds) |
23:43:53 | FromDiscord | <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:38 | Prestige | What's your lsp setup with nvim? I use it with nim (and other languages) just fine |
23:49:31 | FromDiscord | <Unaimend> just copied the stuff from nimslp readme |
23:49:59 | FromDiscord | <Unaimend> I have never worked with lsps so maybe I am missing sth. really obvious here which I did not cofigure |
23:52:16 | Prestige | I 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:16 | leorize[m] | if you use nim.nvim, go-to-definition is bound to `gd` by default |
23:56:23 | leorize[m] | though it doesn't use LSP |
23:59:28 | Prestige | Lsp is sort of broken for coc right now anyway, I had to patch it locally |