00:01:43 | * | piron quit (Ping timeout: 246 seconds) |
00:04:24 | * | l1x quit (Quit: Connection closed for inactivity) |
00:12:26 | * | etothpiiminus1 joined #nim |
00:22:57 | disruptek | leorize: there are a couple major problems, but they might not bug you. |
00:23:24 | * | etothpiiminus1 quit (Remote host closed the connection) |
00:34:39 | * | piron joined #nim |
00:40:35 | * | xet7 quit (Quit: Leaving) |
00:43:22 | * | piron quit (Ping timeout: 246 seconds) |
01:12:29 | * | Tanger joined #nim |
01:16:56 | * | piron joined #nim |
01:21:52 | * | piron quit (Ping timeout: 256 seconds) |
01:28:20 | * | abm quit (Read error: Connection reset by peer) |
01:28:40 | FromDiscord | <Anonymous Poet> @dom96 https://pastebin.com/55enx11T↵Please help 😦 Same bad file descriptor error |
01:29:31 | FromDiscord | <Anonymous Poet> i dont know nearly enough about nim's async to fix it myself, but I feel like I also cant in good conscience use `discard` knowing that it _also_ discards the exception ... |
01:30:32 | mipri | https://nim-lang.org/docs/asyncdispatch.html#discarding-futures |
01:30:36 | FromDiscord | <Anonymous Poet> (also let me know if theres a better way of doing this than using cases, but the handler needed to be gcsafe, and the compiler was complaining about assigning to a global string var) |
01:31:45 | FromDiscord | <Anonymous Poet> mipri, any ideas? |
01:35:58 | mipri | no, I'm not paying attention. Just pointing out that asyncCheck is a discard that doesn't discard exceptions. |
01:40:25 | FromDiscord | <Anonymous Poet> ah, thanks. Sadly, the issue is that something is raising an exception, but I don't know what nor why. I have code that works if you run it once, but will raise an exception if you copy paste it (effectively running it twice). Seems like maybe a race condition or something, but I don't know enough about how nim works to try to address it :/ |
01:44:42 | adnan338 | Honestly, searching for flatpak documentation is the hardest thing imaginable, I would rather solve NP-Hard problems than shooting into the dark that is flatpak |
01:50:34 | * | piron joined #nim |
01:51:05 | leorize | adnan338: pretty sure this is not #flatpak :P but I do know a thing or two if you want some help :) |
01:55:07 | * | piron quit (Ping timeout: 246 seconds) |
01:59:51 | leorize | disruptek: what is the most up-to-date written docs that you have about CPS and it's APIs as well as ergonomics atm? |
02:10:38 | * | zahary quit (Quit: Connection closed for inactivity) |
02:29:38 | disruptek | the tests are very much up-to-date. |
02:30:24 | disruptek | it's pretty low-level right now, i'm afraid. |
02:47:30 | * | disruptek throbs. |
03:00:12 | FromDiscord | <shadow.> can cpp ffi handle functions that return cpp classes? how is that turned into nim? |
03:03:24 | leorize | disruptek: so as far as I can tell there is no "base" continuation type? |
03:03:37 | leorize | as in one provided by the library? |
03:13:43 | * | cgfuh quit (Quit: WeeChat 2.9) |
03:14:53 | * | lritter quit (Ping timeout: 260 seconds) |
03:15:13 | * | lritter joined #nim |
03:15:17 | disruptek | right; you can use anything with a fn ptr in it. |
03:17:04 | FromDiscord | <PizzaFox> what is the preferred way to run nim(ble) commands on github actions |
03:17:19 | FromDiscord | <PizzaFox> (edit) "preferred" => "recommended" |
03:17:38 | disruptek | i have many projects demo'ing this. |
03:19:35 | disruptek | leorize: you wanna see something hilarious? |
03:19:59 | disruptek | nimble in an infinite loop on my gitnim ci: |
03:20:01 | disruptek | -Here's a similar demo with `--define:danger` enabled to show the |
03:20:04 | disruptek | oops |
03:20:09 | disruptek | https://github.com/disruptek/gitnim/runs/1699392139?check_suite_focus=true |
03:20:42 | * | muffindrake quit (Ping timeout: 260 seconds) |
03:22:41 | * | muffindrake joined #nim |
03:24:16 | * | lritter quit (Ping timeout: 256 seconds) |
03:31:07 | * | lritter joined #nim |
03:40:02 | FromGitter | <deech> Is there a `case` like equivalent of `when`? |
03:44:07 | * | Kaivo quit (Quit: WeeChat 3.0) |
03:47:13 | saem | @deech feels like I've seen it before but also feels like my imagination. |
03:48:38 | saem | Let me see if I can retrace my more than likely imaginary steps |
04:13:12 | ForumUpdaterBot | New thread by Halloleo: Back on Nim: Understanding nimble, see https://forum.nim-lang.org/t/7383 |
04:20:12 | * | spiderstew_ joined #nim |
04:21:12 | ForumUpdaterBot | New thread by Halloleo: Silly scope shadowing question, see https://forum.nim-lang.org/t/7384 |
04:23:01 | * | spiderstew quit (Ping timeout: 264 seconds) |
04:23:26 | disruptek | !repo emmy |
04:23:27 | disbot | https://github.com/unicredit/emmy -- 9emmy: 11 15 30⭐ 1🍴 |
04:34:22 | adnan338 | Hello, 2 questions regarding installing nim from the source tarball. 1. the content generated bin |
04:35:04 | disruptek | huh? |
04:35:25 | adnan338 | 1. the generated bin folder is to be added to the path. Why is .nimble/bin required to be added to the path too? |
04:35:38 | disruptek | so that you can run shit that nimble installs. |
04:35:49 | adnan338 | 2. Does the compilation process set any environment variables? |
04:35:53 | disruptek | it's just there to disrupt your quaint notion of "security". |
04:36:16 | disruptek | adnan338: export them? not afaik. why do you want to compile from source? |
04:36:24 | disruptek | the nightlies are very reliable. |
04:36:29 | disruptek | ~gitnim |
04:36:30 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
04:37:49 | adnan338 | This is because I am trying to ship a Nim application through flatpak and I prefer stable point releases. Oh wow gitnim looks quite interesting thank you |
05:05:06 | * | adnan338_ joined #nim |
05:07:28 | * | lritter quit (Quit: Leaving) |
05:08:19 | * | adnan338 quit (Ping timeout: 246 seconds) |
05:08:19 | * | adnan338_ is now known as adnan338 |
05:22:07 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:26:00 | FromGitter | <offbeat-stuff> Hi How to build 32bit static libs |
05:27:13 | FromGitter | <offbeat-stuff> Im trying to get raylib with nim |
05:45:41 | FromGitter | <offbeat-stuff> Got it working with custom nim.cfg using emscripten |
06:00:40 | leorize | adnan338: are you adding an SDK to flatpak runtime? |
06:02:19 | leorize | disruptek: oh lol |
06:02:53 | leorize | https://forum.nim-lang.org/t/7383#46760 <- someone already asking for lockfiles :P |
06:03:11 | disruptek | it's a fair request. |
06:03:41 | disruptek | that doesn't really need lockfiles, though. |
06:04:52 | leorize | I think they want easy upgrades or smt like that |
06:05:24 | disruptek | the whole idea that "you run nimble to compile your code because who else but nimble can deliver the packages you need?" kinda falls down when nimble cannot do dependency analysis, differentiate between 10 and "10", or enters an infinite loop. |
06:06:00 | leorize | I'll have to get in this package manager game eventually |
06:06:05 | disruptek | right? |
06:06:11 | disruptek | it's super fun. |
06:06:37 | leorize | :P |
06:08:02 | leorize | I just realised that adding an API to your nimble package can be a breaking change, though it's very rare |
06:10:49 | leorize | you import A, B where A.Foo is a type you use. B grew a B.Foo and now your code won't compile |
06:10:58 | leorize | though probably this will never happen |
06:11:42 | disruptek | of course. any new symbol can break people. |
06:12:07 | disruptek | i had to break testes in 1.0. i wanted to do `check` differently. |
06:12:12 | leorize | can you try out the minimal version selection thingy in nimph? it looks good in theory but I'm still unsure if it would work for Nim |
06:12:30 | leorize | disruptek: well my code written for testes 0.7.1 still happily run with 1.1.9 |
06:12:41 | disruptek | of course. you can just run `nimph downgrade` and you get mvs. |
06:13:22 | disruptek | or do you want me to test the entire ecosystem at once? |
06:13:32 | leorize | yep |
06:13:36 | disruptek | oh. |
06:13:51 | leorize | rust people tried and they have to held of MVS because of people never updating the minimum requirements |
06:13:57 | leorize | held off* |
06:13:59 | disruptek | a lot of people don't even supply versions, so a lot of people will balk. |
06:14:34 | disruptek | hell, scramper just PR'd dot output to gram and didn't have a tag on his dependency. |
06:15:56 | leorize | you just need tooling to automate it for the most part |
06:16:09 | leorize | give people a migration path to a greater tool and they will happily follow |
06:16:12 | disruptek | i'm starting to realize that this is how dist works. |
06:16:18 | * | narimiran joined #nim |
06:16:33 | disruptek | we will slowly gate it with more and more regular requirements. |
06:17:37 | leorize | I will wait for the day that dist can just be a list of `requires` |
06:17:46 | disruptek | that day is here, if you want it. |
06:17:59 | disruptek | there's an open discussion just waiting for someone to show up with an opinion. |
06:18:01 | leorize | not with our current tooling |
06:18:05 | disruptek | why not? |
06:18:17 | leorize | you see how nimble loops like hell there |
06:18:38 | disruptek | so use nimph ffs. |
06:18:54 | disruptek | i don't even remember which project that was. |
06:18:56 | leorize | and your nimph has not been adopted by the user base afaict |
06:19:12 | disruptek | maybe all the users are satisfied. |
06:19:43 | leorize | status is still fooling around with their makefiles and submodules because they can't get nimble to work |
06:20:44 | disruptek | well, i don't understand that. i don't think i spent more than a couple days before i had something more useful than makefiles. |
06:22:41 | disruptek | i can almost understand why nimble might infinite loop. |
06:22:42 | disruptek | almost. |
06:22:50 | disruptek | but why does it keep downloading stuff, too? |
06:22:55 | disruptek | this is just insane. |
06:28:29 | disruptek | if the interwebs are slow for any of you, i apologize: it's nimble trying to run my nightly CIs. |
06:30:22 | leorize | nimble was written in old nim and it stayed there |
06:34:17 | disruptek | i wish it had. |
06:34:50 | leorize | I thought about your "directory as package" idea |
06:35:35 | leorize | still doesn't solve versioning and dependency though |
06:35:53 | disruptek | first things first. |
06:36:00 | disruptek | we have to agree on what the primitives are. |
06:38:30 | leorize | in my mind it's: package = versioned collection of modules |
06:39:21 | disruptek | okay, so .nimble files color new branches of the tree, right? |
06:40:09 | disruptek | so does this mean i can include any test with `include gram/tests/test` for example? |
06:41:29 | adnan338 | leorize: No, I am building nim and compiling my toy project with it |
06:42:36 | leorize | disruptek: sure, I don't think there's anything bad about that |
06:42:49 | disruptek | good. |
06:44:24 | adnan338 | I am trying to use local nimbledeps folder so I don't have to worry about downloading transient dependencies |
06:44:42 | disruptek | you sweet, summer child. |
06:45:18 | leorize | disruptek: just to be sure, I believe you meant: .nimble = every module in the tree is a part of the package, until you see another .nimble. correct? |
06:45:31 | disruptek | yes. |
06:45:50 | leorize | ok, I agree on that idea |
06:46:37 | disruptek | testes now knows how to test projects too simple to have tests. |
06:48:00 | disruptek | unfortunately, i cannot test ups using testes because testes depends upon ups and that just fuckin' blows nimbles mind. |
06:48:59 | leorize | we might just have to add the "dev deps" idea for the most part |
06:49:20 | leorize | or make "tasks" compatible with require but I don't see that happening |
06:49:24 | leorize | anyway, gotta go |
06:49:26 | leorize | bbl |
06:49:28 | disruptek | peace. |
06:50:17 | disruptek | i do `when not defined(release): require "... testes ..."` but that's meaningless to nimble, too, apparently. |
06:52:05 | * | adnan338 quit (Quit: adnan338) |
06:52:24 | * | adnan338 joined #nim |
07:02:06 | FromGitter | <StefanSalewski> nim c --threads:on --gc:arc appsink_src.nim |
07:02:15 | FromGitter | <StefanSalewski> for https://github.com/StefanSalewski/gintro/issues/108#issuecomment-759961654 |
07:02:17 | disbot | ➥ Gstreamer, appsink element new-sample signal seems missing ; snippet at 12https://play.nim-lang.org/#ix=2LW2 |
07:02:37 | FromGitter | <StefanSalewski> seems to fix it as leorize pointed out. |
07:03:02 | FromGitter | <StefanSalewski> So maybe we should have --threads:on --gc:arc as default? |
07:11:15 | FromGitter | <StefanSalewski> Logout |
07:14:36 | * | vicfred quit (Quit: Leaving) |
08:02:06 | * | piron joined #nim |
08:06:03 | * | habamax joined #nim |
08:21:10 | * | letto quit (Quit: Konversation terminated!) |
08:24:48 | * | letto joined #nim |
08:26:03 | * | letto quit (Client Quit) |
08:26:34 | * | letto joined #nim |
08:27:15 | * | Tanger quit (Remote host closed the connection) |
08:42:46 | FromDiscord | <Footmade> sent a long message, see http://ix.io/2LZ4 |
08:50:48 | FromDiscord | <ElegantBeef> Seems like something that'd be ok for the `community resources` section on the site, a searchable index of submitted urls |
08:55:23 | FromGitter | <gogolxdong> Is it possible to use a pattern matching expression as the key of a Table? |
08:56:46 | FromDiscord | <ElegantBeef> I imagine it's possible but it'd be but ugly |
08:58:23 | * | PMunch joined #nim |
08:58:59 | FromDiscord | <ElegantBeef> Although i'm uncertain what you mean, since an expression has a return value |
08:59:52 | FromGitter | <gogolxdong> a key like "something/*" |
09:00:30 | FromGitter | <gogolxdong> any key starts with "something/" matches. |
09:02:11 | FromGitter | <gogolxdong> otherwise have to iterate keys and check whether a new item starts with some key or not. |
09:04:16 | FromDiscord | <ElegantBeef> Well then your key would just be `"something/"` and you could make a distinct string hashing it to extract that pattern |
09:09:36 | * | NimBot joined #nim |
09:15:47 | FromDiscord | <Footmade> sent a long message, see https://paste.rs/3X4 |
09:16:04 | FromDiscord | <haxscramper> gogolxdong: no, default tables does not support operations like this, |
09:16:22 | FromDiscord | <haxscramper> You would have to use trie to do this efficiently, otherwise just iterate over all keys |
09:16:39 | FromDiscord | <haxscramper> Though there was a module for prefix trees IIRC |
09:17:14 | FromDiscord | <haxscramper> You can probably create new page on nim github wiki, as it would be easier for other people to contribute |
09:17:48 | FromDiscord | <ElegantBeef> Yea i was being dumb and forgot there were more complicated things then just getting a single key for path 😄 |
09:28:02 | FromDiscord | <Footmade> I'm actually arguing that maybe it's not the best that other people can contribute. I know a couple other discord servers that have resource-dedicated channels, and while the signal:noise ratio could be better it is still a quick, easy and accessible way to find user-added resources and people in other channels can refer to resources posted in that channel. |
09:28:54 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:29:32 | FromDiscord | <Footmade> The idea is to not decouple these things so much. So now there's an online chat space for Nim, there's the github wiki, and there's a community resources section, and they seem to be decoupled from each other. This space, for example, has no resource section. |
09:29:42 | FromDiscord | <Footmade> (edit) "contribute." => "contribute so easily." |
09:31:01 | FromDiscord | <Footmade> These are suggestions that I think are best left to be discussed by community veterans and decisions should be made by them at their discretion, in my opinion. I don't have much of a stake in this personally though 🙂 |
09:31:57 | FromDiscord | <ElegantBeef> Probably smart to make a forum post about it, i keep putting off making mine about "This month with Nim" a community showcase |
09:36:57 | * | abm joined #nim |
09:49:16 | * | Vladar joined #nim |
10:03:57 | ForumUpdaterBot | New thread by ElegantBeef: "This Month With Nim"- A Community Showcase, see https://forum.nim-lang.org/t/7385 |
10:08:33 | FromDiscord | <haxscramper> I mostly suggestion something in form of https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 . maybe https://github.com/nim-lang/Nim/wiki/Lesser-known-Nim-features |
10:08:43 | FromDiscord | <haxscramper> List of articles + short description |
10:09:08 | * | adnan338 quit (Remote host closed the connection) |
11:01:44 | Oddmonger | isn't «div» deprecated for entire divisions ? |
11:03:28 | Oddmonger | hum no it's still in the manual |
11:04:18 | Oddmonger | but i still don't know why i can use «div» and not the C++ comment line // |
11:04:54 | PMunch | template `//`(x, y: untyped): untyped = x div y |
11:05:29 | PMunch | And I guess the answer is that `div` is more obvious than `//` |
11:05:43 | Oddmonger | yes i rather like div |
11:05:52 | Oddmonger | but i prefer % to mod |
11:06:13 | Oddmonger | thank you && bon appétit :)’ |
11:07:15 | FromDiscord | <lqdev> % is a frickin' percentage sign, it doesn't signal modulo |
11:07:22 | FromDiscord | <lqdev> it signals percent |
11:18:13 | * | piron quit (Quit: leaving) |
11:19:31 | * | piron joined #nim |
11:43:04 | FromDiscord | <lqdev> any way i can pipe some output to `less` using nim? |
11:43:59 | PMunch | Yes |
11:44:28 | FromDiscord | <lqdev> namely, i want to use `terminal.styledWriteLine` to output some help text to `less` and use it as a pager |
11:44:42 | FromDiscord | <lqdev> so here's what i have so far |
11:44:52 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2LZQ |
11:45:23 | FromDiscord | <lqdev> problem is, i can't figure out how to make less output to the terminal but have its own stdin |
11:45:29 | FromDiscord | <lqdev> poParentStreams parents all stream |
11:45:31 | FromDiscord | <lqdev> (edit) "stream" => "streams" |
11:45:47 | PMunch | Ah, hmm that might be tricky |
11:47:27 | FromDiscord | <Rika> Where did % become modulus anyway and how did it become modulus |
11:51:10 | PMunch | @lqdev, I mean you can start the process Unix style |
11:51:23 | FromDiscord | <lqdev> wdym? |
11:51:43 | PMunch | I mean start it like you would from C |
11:52:29 | FromDiscord | <lqdev> question is, how would i start the process from C |
11:53:05 | PMunch | This might be helpful: https://stackoverflow.com/questions/51932881/calling-fzf-from-nim-doesnt-show-fzfs-tui |
11:54:50 | PMunch | Ah, he cheats a bit and bakes the input into the command.. |
11:55:08 | FromDiscord | <lqdev> yeah, that's something i'd like to avoid. |
11:55:29 | FromDiscord | <lqdev> oh well. |
11:55:35 | PMunch | I mean you can do `less /tmp/myfifo` and then write to /tmy/myfifo in your program |
11:56:08 | * | oculuxe quit (Ping timeout: 256 seconds) |
11:56:09 | PMunch | Maybe you'd have to pass a follow flag to less though, can't quite remember how it treats FIFOs.. |
11:56:48 | PMunch | Or `less < /tmp/myfifo` I guess might work better |
11:56:53 | FromDiscord | <lqdev> hmm |
11:57:08 | PMunch | Basically it creates a new pipe, then assigns that the stdin of less |
12:00:31 | FromDiscord | <lqdev> hm do i really need a fifo though |
12:00:43 | FromDiscord | <lqdev> i think i can just get it to read from a file |
12:01:35 | * | oculux joined #nim |
12:03:16 | FromDiscord | <lqdev> does Nim have a binding to mkstemp? |
12:03:58 | PMunch | Yup: https://nim-lang.org/docs/posix.html#mkstemp%2Ccstring |
12:04:38 | FromDiscord | <lqdev> huh. isn't mkstemp standard C? |
12:04:48 | FromDiscord | <lqdev> no |
12:04:52 | * | Torro joined #nim |
12:04:59 | FromDiscord | <lqdev> tmpfile is |
12:05:04 | FromDiscord | <lqdev> but i need the filename |
12:05:14 | FromDiscord | <lqdev> so it's a no-go |
12:05:25 | FromDiscord | <lqdev> i'll just disable pagination on windows then |
12:07:43 | PMunch | This is the solution with mkfifo by the way: http://ix.io/2LZX |
12:07:48 | PMunch | In case you're interested |
12:08:29 | FromDiscord | <lqdev> i don't like the jankiness of poEvalCommand |
12:08:34 | FromDiscord | <lqdev> i'll try with mkstemp |
12:11:32 | * | fanta1 joined #nim |
12:12:02 | PMunch | I think you can do it with freopen |
12:12:30 | FromDiscord | <lqdev> gah, almost got it |
12:12:41 | FromDiscord | <lqdev> it's just missing some lines for some reason |
12:14:03 | FromDiscord | <lqdev> huh, the file is broken |
12:14:55 | FromDiscord | <lqdev> ah i know why |
12:15:07 | FromDiscord | <lqdev> i was using echo in some places |
12:15:14 | FromDiscord | <lqdev> instead of file.styledWriteLine |
12:19:35 | FromDiscord | <lqdev> cool, it's working now. thanks for the help! |
12:21:54 | PMunch | How did you do it? |
12:24:56 | * | Torro quit (Quit: bye) |
12:29:08 | FromDiscord | <lqdev> mkstemp |
12:29:38 | FromDiscord | <lqdev> writing to the file, and then passing the filename to less |
12:30:07 | FromDiscord | <lqdev> i also needed to pass `-fR` because it was interpreting my file as binary and i also needed color |
12:31:32 | PMunch | Ah right |
12:45:45 | Araq | IC now fails because of the unimplemented patches! :D |
12:46:48 | Araq | the good news is that my --ic:stress switch works very well, it found many bugs already |
12:50:54 | * | fanta1 quit (Quit: fanta1) |
12:55:19 | * | hmmm joined #nim |
13:05:01 | * | xet7 joined #nim |
13:14:19 | ForumUpdaterBot | New thread by Halloleo: Any way to access the Documentation Comment of a procedure?, see https://forum.nim-lang.org/t/7386 |
13:17:40 | * | anthonyy joined #nim |
13:31:13 | FromDiscord | <mratsim> @Araq, try IC with Constantine and Emmy to stress test the concepts. |
13:31:32 | * | Kaivo joined #nim |
13:33:09 | PMunch | Hmm, this isn't quite right.. https://play.nim-lang.org/#ix=2M0h |
13:33:41 | PMunch | And even worse: https://play.nim-lang.org/#ix=2M0i< |
13:33:59 | PMunch | When using implicit return the getImpl body puts the doc-comment into the assignment.. |
13:35:00 | * | abm quit (Quit: Leaving) |
13:51:00 | * | Tanger joined #nim |
14:00:16 | * | oculux quit (Ping timeout: 240 seconds) |
14:08:51 | * | oculux joined #nim |
14:10:39 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2M0r |
14:10:47 | FromDiscord | <flywind> This works with `gc:arc`, is it intended? |
14:12:37 | FromDiscord | <flywind> Especially, why `chckObjAsgn` is disabled with `gc:arc`? |
14:12:43 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/blob/94430a2e6de6a9079662db6f5677f978a94e7fce/lib/system/assign.nim#L116 |
14:17:13 | * | fanta1 joined #nim |
14:18:09 | FromDiscord | <shadow.> https://hatebin.com/rspldffbvo↵i have a project here that is heavily using a library and the classes that go with it, as well as other cpp'ey stuff like <functional> and virtual methods and stuff. would it even be possible to do this in nim with ffi or a library for cpp interop, and how much of it would just be typing `importcpp` |
14:18:11 | FromDiscord | <shadow.> basically, does it make sense |
14:18:18 | FromDiscord | <shadow.> (edit) "https://hatebin.com/rspldffbvo↵i have a ... project" added "cpp" |
14:35:59 | * | fanta1 quit (Quit: fanta1) |
14:43:19 | * | PMunch quit (Quit: leaving) |
14:48:05 | * | oculux quit (Ping timeout: 240 seconds) |
14:49:08 | * | tane joined #nim |
14:51:25 | * | waleee-cl joined #nim |
14:55:56 | * | oculux joined #nim |
15:00:44 | * | Tanger quit (Quit: Leaving) |
15:01:36 | Oddmonger | i was sure there were a max() function in nim , in math module… |
15:02:07 | Oddmonger | of course, i can do it myself with a template, but if it exists already ? |
15:02:44 | * | hmmm quit (Quit: WeeChat 3.0) |
15:04:26 | FromDiscord | <Rika> it exists i beliee |
15:04:46 | FromDiscord | <Rika> but its in system |
15:05:50 | * | synshroud quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:06:39 | Oddmonger | yes in system, thank you |
15:07:55 | Oddmonger | but i was wrong, i was thinking of a saturation (max value to not go beyond) |
15:08:04 | Oddmonger | not the max value between two values |
15:08:35 | FromDiscord | <Rika> use min then lol |
15:08:51 | FromDiscord | <Rika> min(val, maxval) |
15:08:54 | Oddmonger | arf :) true :) |
15:09:05 | FromDiscord | <Rika> i am smort |
15:17:45 | * | habamax quit (Ping timeout: 240 seconds) |
15:18:37 | FromDiscord | <shadow.> or if you need both then use clamp |
15:25:05 | Oddmonger | clamp, i was searching this too |
15:41:43 | FromDiscord | <Rika> clamp exists in the stdlib? |
15:41:49 | FromDiscord | <Rika> well god damn |
15:43:24 | FromDiscord | <shadow.> yeah lol |
15:43:26 | FromDiscord | <shadow.> isnt it in system? |
15:50:03 | * | tane quit (Remote host closed the connection) |
15:50:26 | * | tane joined #nim |
15:51:10 | Oddmonger | yes |
15:58:36 | ForumUpdaterBot | New post on r/nim by tsojtsojtsoj: How to guarantee immutability of ref object passed into function, see https://www.reddit.com/r/nim/comments/kx8dgo/how_to_guarantee_immutability_of_ref_object/ |
16:02:01 | * | oculux quit (Ping timeout: 264 seconds) |
16:04:08 | * | hnOsmium0001 joined #nim |
16:09:12 | * | oculux joined #nim |
16:19:29 | disruptek | what a fucking prick. |
16:24:26 | FromDiscord | <Zachary Carter> who? |
16:24:54 | FromDiscord | <Zachary Carter> or were you complimenting someone? |
16:26:24 | oz | come on, be nice :) |
16:28:15 | leorize | disruptek: I got too many SIGSEGV with --incremental:on :/ |
16:28:44 | disruptek | yes, i removed it in 1.1.1 or thereabouts. |
16:29:07 | disruptek | and there's a 1.0.1 that removes it but keeps the breaking check change. |
16:29:13 | disruptek | whatfer cps reasons. |
16:30:01 | disruptek | zachary carter: fusion rfc. |
16:30:05 | disruptek | !rfc fusion |
16:30:07 | disbot | https://github.com/nim-lang/RFCs/issues/265 -- 3versioned docs for nim and fusion 7& 15 more... |
16:30:11 | disruptek | not that one. |
16:30:20 | disruptek | it's, what, 310? |
16:30:25 | disruptek | !rfc 310 |
16:30:26 | disbot | https://github.com/nim-lang/RFCs/issues/310 -- 5Fusion and stdlib evolution |
16:44:18 | leorize | Status folks really lives in their own bubble don't they |
16:44:31 | leorize | some of them, at least |
16:44:34 | leorize | hopefully small |
16:47:52 | oz | a crypto bubble |
16:48:20 | oz | now, I can't wait for std3 |
16:49:02 | FromDiscord | <haxscramper> `Desktop`/`New Folder`, `New Folder (2)`, `New Folder (3)` |
16:50:52 | leorize | disruptek: I upgraded testes and now it doesn't run my tests? |
16:55:34 | FromDiscord | <haxscramper> There was a PR for fixing variant object error message - I couldn't find, but I guess it hasn't been merged yet |
16:55:56 | FromDiscord | <haxscramper> discriminant value mismatch error message |
16:57:25 | FromDiscord | <haxscramper> Is it blocked by something - IIRC it was created in 2019, so there should be a reason |
16:57:36 | FromDiscord | <haxscramper> Or just nobody bothered& |
16:57:42 | FromDiscord | <haxscramper> (edit) "bothered&" => "bothered?" |
17:01:02 | FromDiscord | <haxscramper> Found it - https://github.com/nim-lang/Nim/pull/11955 |
17:01:04 | disbot | ➥ properly fix #10053 (more informative FieldError msg): report discriminant value + lineinfo; also improve for VM case ; snippet at 12https://play.nim-lang.org/#ix=2EBx |
17:01:57 | leorize | looks like it's a timotheecour PR |
17:02:10 | leorize | yep, it is |
17:02:51 | reversem3 | The proc proc indexSection*(ctx: Context, posts: seq[seq[string]]): VNode = |
17:02:51 | reversem3 | result = buildHtml(main(class = "content")): posts is a seq and use strings in the seq? |
17:03:12 | leorize | haxscamper: my guess would be that Araq still haven't look at it yet |
17:03:27 | leorize | haxscramper: ^ |
17:03:47 | FromDiscord | <haxscramper> sigh |
17:04:20 | leorize | can't really blame him tbh |
17:04:26 | FromDiscord | <haxscramper> yes, I know |
17:04:34 | leorize | he is like the only full time compiler dev afaict |
17:05:10 | FromDiscord | <haxscramper> No, I totally understand the reasoning, ist just these errors ... |
17:05:22 | FromDiscord | <haxscramper> it's |
17:05:38 | leorize | well ping @Clyybber |
17:07:10 | leorize | in terms of users who can review this I can only think of clyybber and cooldome and araq |
17:07:22 | leorize | so if you tag them there they might look into it |
17:07:49 | FromDiscord | <haxscramper> Well, you pinged Clybber on discord, so |
17:08:26 | FromDiscord | <haxscramper> Though I really just asked if there are any blockers or it is just that there are more important things |
17:10:18 | leorize | it's usually because timothee stuff is extremely dense so it takes time to review |
17:11:23 | * | anthonyy quit (Remote host closed the connection) |
17:14:02 | disruptek | leorize: which project? |
17:14:22 | leorize | nim-sys |
17:14:29 | leorize | I run testes and it does literally nothing |
17:14:38 | leorize | testes 1.1.11 if you're wondering |
17:14:53 | * | beatmox quit (Read error: Connection reset by peer) |
17:15:29 | disruptek | leorize: well, you don't have any t*.nim in tests/ |
17:15:44 | disruptek | am i supposed to recurse? i thought i fixed a bug. 🤣 |
17:16:00 | leorize | oh lol I was depending on that |
17:16:18 | * | beatmox joined #nim |
17:16:19 | disruptek | of course you were. |
17:16:26 | disruptek | bugs are api. 🙄 |
17:16:41 | disruptek | it's up to you. just let me know. |
17:17:04 | leorize | I like my categorized tests :P |
17:17:14 | disruptek | lemme see what nimble does. |
17:17:40 | disruptek | yeah, they don't run your stuff, either. |
17:17:53 | disruptek | let's recurse on tests/ and not ./ |
17:18:03 | leorize | I got the habit from using testament :P |
17:18:12 | disruptek | i mean, it's not wrong, right? |
17:18:23 | leorize | yea |
17:19:04 | leorize | recently someone did a commit to testament makes it only run if it's used in the compiler source tree, and is determined at compile time |
17:19:25 | leorize | so basically we now have a "tool for testing all nim projects, as long as its the compiler" |
17:22:59 | disruptek | leorize: 1.1.12 is what you want. |
17:23:13 | disruptek | that's amazing. |
17:23:36 | disruptek | and i guess we have no users in important_packages using the test tool we claim is superior to unittests. |
17:25:22 | FromDiscord | <Clyybber> leorize: That PR is not ready |
17:26:06 | leorize | then you should leave a review |
17:26:23 | FromDiscord | <Clyybber> it includes # PRTEMP |
17:27:42 | leorize | ugh, if there is any reason why I hate the "squashing" practice, it's that people never make PR that focus on one exact issue |
17:28:28 | leorize | so now you have this commit saying that it only fixes this one issue, then proceed to randomly touch unrelated lines |
17:30:34 | FromDiscord | <Clyybber> I don't think timothee thinks its ready for review |
17:31:18 | leorize | you can leave a ping there then |
17:31:29 | leorize | he wrote a comment saying "no one looked at it" |
17:36:01 | * | qwertfisch quit (Read error: Connection reset by peer) |
17:36:49 | leorize | disruptek: the change that caused that bug got through 1.4.0 and no one noticed it |
17:37:11 | leorize | I don't think anyone even used testament outside of the compiler |
17:37:17 | disruptek | testament is not an important package. |
17:37:26 | disruptek | but, flywind uses it afaik. |
17:38:12 | * | qwertfisch joined #nim |
17:41:18 | leorize | looks like they haven't noticed that `testament run` is completely broken if you run it outside of the compiler source |
17:42:09 | disruptek | maybe prologue doesn't support 1.4. |
17:45:23 | leorize | i doubt it, they might just be using `testament all`, which doesn't have the check |
17:46:13 | disruptek | seems like it runs tests on 1.4.0 but, infrequently. |
17:46:22 | * | haxscramper joined #nim |
17:46:31 | leorize | testament run is what you use when you're developing |
17:46:53 | leorize | to run a single test in the case of a big test suite |
17:46:58 | disruptek | yep. |
17:47:11 | haxscramper | Structure of `ProcDef` varies between compiler and macro ast - `PNode` one has eight elements, with last being `Sym result`. It is always present when procedure has return type? |
17:47:18 | haxscramper | Or some other edge cases exist |
17:47:27 | disruptek | it exists in typed macros. |
17:48:39 | leorize | it will also exist if you inspect procs from `bindSym` |
17:49:26 | disruptek | untyped? |
17:49:29 | FromDiscord | <Clyybber> leorize: Ok, left a review |
17:49:43 | leorize | disruptek: yea, because bindSym symbols are typed |
17:49:58 | leorize | so it doesn't matter if you call it from an untyped macro |
17:50:04 | disruptek | then they aren't untyped. 🥴 |
17:52:46 | leorize | @Clyybber: this destructor https://github.com/alaviss/nim-sys/blob/master/src/sys/files.nim#L89 will bind to this type https://github.com/alaviss/nim-sys/blob/master/src/sys/files.nim#L39, right? |
17:53:17 | FromDiscord | <Clyybber> yes |
17:54:00 | leorize | well it's not doing that right now |
17:54:23 | leorize | let's see if I can make a test sample |
17:55:47 | * | etothpiiminus1 joined #nim |
18:03:55 | * | etothpiiminus1 quit (Ping timeout: 246 seconds) |
18:19:08 | * | Jesin quit (Quit: Leaving) |
18:21:27 | * | Jesin joined #nim |
18:46:27 | * | lritter joined #nim |
18:53:28 | disruptek | leorize: ready for more nimble antics? |
18:53:39 | disruptek | https://github.com/disruptek/gitnim/runs/1704019388?check_suite_focus=true#step:4:31 |
18:53:56 | disruptek | nimble demanded that i use `bin = @["some binary"]` in gitnim. |
18:54:09 | disruptek | so i added `bin = @["git-nim"]` (what else?) |
18:55:02 | disruptek | so now nimble thinks that the source must be named `git-nim.nim` ??? and that's not a valid module name so 💩 |
19:00:53 | * | vicfred joined #nim |
19:49:04 | haxscramper | How I can disable hints with `ConfigRef`? There is a `.options` field, which I removed `optHints` from, but it seems like lexer prints hint unconditionally |
19:51:16 | * | hmmm joined #nim |
20:02:44 | haxscramper | Alright, I figured this out - I need to set `parser.lex.errorHandler` callback, though for some reason it is being called less frequently (only one hint actually) |
20:08:45 | * | Kaivo quit (Ping timeout: 240 seconds) |
20:12:43 | disruptek | no, see how i do it in nimph. it's simpler than this. |
20:13:16 | disruptek | see nimph/config.nim and excludeAllNotes, setDefaultsForConfig, etc. |
20:28:05 | * | haxscram` joined #nim |
20:30:13 | * | haxscramper quit (Ping timeout: 264 seconds) |
20:31:30 | * | haxscram` left #nim (#nim) |
20:31:41 | * | haxscram` joined #nim |
20:46:20 | FromDiscord | <rinfz> is there a function to encode a string to html entities in the stdlib? |
20:46:38 | haxscram` | https://nim-lang.org/docs/htmlgen.html |
20:47:19 | haxscram` | Or you mean something like escaping string for use in html? |
20:47:36 | FromDiscord | <rinfz> something like > converts to > |
20:47:59 | haxscram` | https://nim-lang.org/docs/xmltree.html#escape%2Cstring |
20:48:09 | FromDiscord | <rinfz> ideal cheers! |
20:52:25 | * | narimiran quit (Ping timeout: 264 seconds) |
20:52:34 | * | haxscram` quit (Remote host closed the connection) |
21:01:20 | disruptek | scramper: did that help? |
21:26:26 | FromDiscord | <19> has anyone been using these new hooks from https://nim-lang.org/docs/destructors.html |
21:27:21 | FromDiscord | <19> im a bit confused: do we implement the hooks and then the compiler knows when to call them implicitly? |
21:27:42 | FromDiscord | <ElegantBeef> Yes, they're for the logic that was developed along side ARC/ORC |
21:28:19 | FromDiscord | <19> ok so compile with --orc and let the compiler do the rest |
21:28:38 | FromDiscord | <19> but we could also call them explicitly right? |
21:28:42 | FromDiscord | <19> sorry im new to move semantics |
21:28:49 | FromDiscord | <ElegantBeef> Well they're procs so yes |
21:29:07 | FromDiscord | <19> thanks beef |
21:30:42 | * | dilawar_uchiha[m quit (Ping timeout: 260 seconds) |
21:30:43 | * | mids quit (Ping timeout: 260 seconds) |
21:31:03 | * | dilawar_uchiha[m joined #nim |
21:31:54 | * | mids joined #nim |
21:49:32 | FromDiscord | <apollo> did all of you here learn nim from the documentation? |
21:51:12 | FromDiscord | <lqdev> that and lurking on #main |
21:51:44 | FromDiscord | <ElegantBeef> The best way to learn something on the internet is to do it wrong and show people that know how to do it |
21:52:22 | FromDiscord | <apollo> agreed just the documentation aren't that simplified but then again nim isn't meant to be a simple language for new programmers |
21:53:13 | FromDiscord | <ElegantBeef> The tutorial is |
21:53:22 | leorize | nim can be plenty simple |
21:53:45 | FromDiscord | <ElegantBeef> Nim is one of the most simple system programming languages imo |
21:54:42 | FromDiscord | <lqdev> i wouldn't agree with that but i would definitely agree if someone said it's simpler than C++ |
21:55:02 | leorize | @19 note that those procs are not meant to be exported (ie. being called by someone else) |
21:55:30 | leorize | currently we have `reset()` == `=destroy` and `move()` == `=sink` |
21:56:10 | leorize | move optimization is mostly automated, though |
21:58:16 | FromDiscord | <apollo> which tutorial ? |
21:58:25 | FromDiscord | <apollo> https://nim-lang.org/docs/tut1.html |
21:58:27 | FromDiscord | <apollo> this one yes |
21:58:31 | FromDiscord | <ElegantBeef> Yes |
22:02:09 | FromDiscord | <himu> is there any example where a certain code written in nim exposes a C header API with appropriate Data Structures? |
22:02:18 | FromDiscord | <himu> (edit) "Structures?" => "Structures for a library?" |
22:04:33 | disruptek | !repo gittyup |
22:04:34 | disbot | https://github.com/disruptek/gittyup -- 9gittyup: 11higher-level libgit2 bindings that build upon nimgit2 15 6⭐ 1🍴 |
22:04:52 | FromDiscord | <himu> thansk |
22:05:02 | FromDiscord | <himu> (edit) "thansk" => "thanks" |
22:15:37 | leorize | @19 words of advice if you're using destructors. write your tests to check if they actually work |
22:19:22 | leorize | @Clyybber filed #16722 |
22:19:27 | disbot | https://github.com/nim-lang/Nim/issues/16722 -- 3`ref` of distinct object have destructor of base object bound instead of the distinct object's ; snippet at 12https://play.nim-lang.org/#ix=2M34 |
22:25:29 | FromDiscord | <lqdev> using std/threadpool, if my proc returns `void` how do i await until it finishes execution? because in this case `spawn` returns `void` |
22:25:40 | FromDiscord | <exelotl> The documentation was too overwhelming for me (especially in 2018 when it was less thorough and organised), so I learned Nim from Dom's book |
22:26:27 | leorize | lqdev: it doesn't return FlowVar[void]? |
22:26:37 | FromDiscord | <lqdev> no, it returns void |
22:26:42 | FromDiscord | <lqdev> for some reason |
22:26:52 | leorize | well this is the kind of time that you would want to switch to weave :P |
22:27:28 | FromDiscord | <lqdev> eh |
22:27:46 | FromDiscord | <lqdev> i don't really wanna pull in another dependency |
22:27:49 | FromDiscord | <lqdev> and weave is quite macro-heavy |
22:28:11 | FromDiscord | <lqdev> compilation is already slow and i don't want to slow it down even furthe |
22:28:12 | FromDiscord | <lqdev> (edit) "furthe" => "further" |
22:31:22 | FromDiscord | <shadow.> there are like two popular ffi packages im thinking of and |
22:31:25 | FromDiscord | <shadow.> one is nimterop |
22:31:28 | FromDiscord | <shadow.> i cant remember the other |
22:31:29 | FromDiscord | <ElegantBeef> c2nim? |
22:31:32 | FromDiscord | <shadow.> nope the other one |
22:31:33 | FromDiscord | <shadow.> lol |
22:31:45 | FromDiscord | <shadow.> well then 3 ig |
22:31:49 | FromDiscord | <shadow.> but ik nimterop and c2nim |
22:31:56 | FromDiscord | <shadow.> theres one other im thinking of but i cant remember ;-; |
22:32:30 | leorize | lqdev: it's not like the normal threadpool is any less macro heavy |
22:32:48 | FromDiscord | <lqdev> but it doesn't slow compilation to a crawl |
22:32:49 | leorize | depends on what you're doing using normal threads might be simpler |
22:33:38 | FromDiscord | <lqdev> i'd prefer using a threadpool because i'm spawning many short-lived jobs |
22:34:13 | leorize | then wouldn't weave be better? weave feature a much better scheduler |
22:34:55 | FromDiscord | <19> @apollo i found the “Nim in Action” book to be amazing. I couldn’t recommend it more. |
22:34:58 | FromDiscord | <shadow.> i'm trying to do cpp ffi, and i'm just wondering if there's a way to do stuff without a ton of importcpp calls everywhere |
22:35:20 | leorize | usually you use c2nim to generate all that for you |
22:35:23 | FromDiscord | <lqdev> leorize: i'll try stdlib threadpool first and then weave, ok? |
22:35:26 | FromDiscord | <ElegantBeef> That's... literally how FFI works in nim |
22:35:31 | FromDiscord | <shadow.> hmm |
22:35:38 | FromDiscord | <shadow.> for c++ classes wouldnt i needa |
22:35:39 | FromDiscord | <lqdev> these jobs take probably around 100ms each |
22:35:40 | FromDiscord | <shadow.> define all of them? |
22:35:46 | leorize | or you ping @haxscramper and ask him if his clang-based c++ binding generator finished |
22:35:50 | FromDiscord | <ElegantBeef> Everything that you need |
22:36:02 | FromDiscord | <shadow.> is in vanilla? |
22:36:20 | FromDiscord | <shadow.> would it be easier to show you what im tryna write in nim lol and you can lmk if it's viable to do with ffi? |
22:36:31 | leorize | @lqdev sure, just make them return a boolean :P |
22:36:48 | FromDiscord | <19> @leorize okay so these procs are automatically called. write once and forget. no manual moving stuff around. and yes, tests |
22:36:50 | FromDiscord | <ElegantBeef> Sure why not |
22:36:58 | FromDiscord | <lqdev> leorize: think i'll have to anyways as i wanna know whether the job succeeded or not |
22:37:04 | FromDiscord | <lqdev> it can fail, y'know. |
22:37:20 | FromDiscord | <shadow.> https://hastebin.com/umahirevuw.cpp |
22:37:24 | leorize | and make sure it won't throw |
22:37:34 | FromDiscord | <lqdev> ik |
22:37:35 | FromDiscord | <shadow.> im just not sure considering it uses stuff like virtual methods, heavy oop, etc |
22:37:51 | FromDiscord | <hugogranstrom> @shadow. are you thinking about the c++ bindings generator Manteliero posted on the forum? |
22:37:54 | FromDiscord | <lqdev> just {.push checks: off.} and everything should work :^) |
22:38:10 | FromDiscord | <shadow.> hmm |
22:38:12 | FromDiscord | <shadow.> i don't think so |
22:38:20 | FromDiscord | <shadow.> it was a fairly big library i think? |
22:38:43 | FromDiscord | <hugogranstrom> It was new and written in python and not very featureful yet |
22:38:48 | FromDiscord | <shadow.> yeah not that |
22:39:07 | FromDiscord | <hugogranstrom> Ok, then I'll hide in the corner again :) |
22:39:14 | FromDiscord | <shadow.> lol dw im being vague |
22:39:17 | FromDiscord | <shadow.> bad memory |
22:39:42 | FromDiscord | <hugogranstrom> Need a garbage collector for the brain? |
22:39:48 | FromDiscord | <shadow.> preciselky |
22:39:51 | FromDiscord | <shadow.> still on refc |
22:39:54 | FromDiscord | <shadow.> havent gotten around to arc yet |
22:40:07 | FromDiscord | <shadow.> @ElegantBeef only reason im not sure is bc of virtual methods, heavy oop, etc |
22:40:12 | FromDiscord | <shadow.> just not sure how that would be handled in nim |
22:40:49 | FromDiscord | <hugogranstrom> Haha lol, convinient to forget things right after your brain has proven you will never need to recall it again |
22:40:53 | FromDiscord | <shadow.> i basically wanna interface with that `#include "bakkesmod/plugin/bakkesmodplugin.h"` library in nim |
22:40:59 | FromDiscord | <shadow.> exactly lol |
22:43:31 | FromDiscord | <lqdev> sigh |
22:43:35 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2M3a |
22:43:49 | FromDiscord | <lqdev> leorize: any hints? |
22:45:02 | leorize | !repo threadpools |
22:45:02 | disbot | https://github.com/yglukhov/threadpools -- 9threadpools: 11 15 17⭐ 6🍴 |
22:45:20 | leorize | ^ either use that or copy stdlib threadpool into your library and fix it |
22:46:00 | FromDiscord | <dom96> @lqdev when in doubt, search for examples using the proc you're trying to use |
22:46:02 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/blob/662c5080755eb5a42df2c3acb84c044876571a46/doc/spawn.txt#L39 |
22:46:05 | FromDiscord | <lqdev> screw this i'm trying weave |
22:46:17 | FromDiscord | <shadow.> lolll |
22:46:41 | FromDiscord | <lqdev> @dom96 do i really have to make two seqs, one for awaiting whether the flowvar is ready, and another for getting its value? |
22:46:53 | FromDiscord | <dom96> actually, here is a test even https://github.com/nim-lang/Nim/blob/devel/tests/parallel/twaitany.nim |
22:47:17 | FromDiscord | <shadow.> @ElegantBeef sorry to pester, would that be possible to do in nim? |
22:47:29 | FromDiscord | <dom96> i think your seq just needs to be a seq[FlowVarBase] |
22:47:30 | FromDiscord | <ElegantBeef> I'm the wrong guy to ask i dont do FFI stuff |
22:47:58 | FromDiscord | <dom96> guessing the compiler will allow you to add `FlowVar[system.bool]` into it |
22:48:19 | FromDiscord | <shadow.> ah fair enough |
22:48:24 | FromDiscord | <shadow.> is there an ffi master around here lol |
22:48:42 | FromDiscord | <dom96> @shadow. just use c2nim 🙂 |
22:49:05 | FromDiscord | <ElegantBeef> Zachary does a lot of FFI stuff |
22:50:07 | FromDiscord | <shadow.> doesn't c2nim only do top level stuff? i tried it on a basic file using stuff like fopen() and printf() and obviously those weren't translated |
22:50:18 | FromDiscord | <shadow.> so if i wanna interface w a huge library how would that be possibly? |
22:50:22 | FromDiscord | <shadow.> (edit) "possibly?" => "possible?" |
22:51:41 | leorize | @shadow. your library is doable as long as you're not trying to implement a plugin in nim |
22:51:58 | FromDiscord | <dom96> libraries always expose their API "at the top level" |
22:52:17 | leorize | the biggest C++ library wrapped in nim is probably wxwidgets |
22:52:29 | leorize | https://github.com/PMunch/wxnim |
22:53:35 | FromDiscord | <shadow.> @leorize wdym by plugin in this context? |
22:54:35 | leorize | performing C++ inheritance and overloading virtual functions in Nim is a pretty stupid process |
22:54:41 | FromDiscord | <shadow.> well |
22:54:58 | FromDiscord | <shadow.> in order to make the (mod / plugin) for the game you needa pass a class that inherits from the plugin class |
22:55:11 | FromDiscord | <shadow.> thats why im not sure if it's viable to do this in nim |
22:55:50 | leorize | @Zachary has done something similar iirc |
22:55:51 | ForumUpdaterBot | New thread by Arnetheduck: Nlvm update 2020, see https://forum.nim-lang.org/t/7387 |
22:56:49 | FromDiscord | <shadow.> hmm |
22:56:55 | FromDiscord | <shadow.> eh im not sure it's worth the effort |
22:56:58 | leorize | you can do it by declaring the class in c++, then write the implementation in nim |
22:57:00 | FromDiscord | <shadow.> c++ isn't that bad |
22:57:07 | FromDiscord | <shadow.> hmm that makes sense |
22:57:10 | leorize | `{.emit.}` should work |
22:57:16 | FromDiscord | <shadow.> ah yeah |
22:59:42 | FromDiscord | <shadow.> anywhere i can read up on how ffi works? |
22:59:47 | FromDiscord | <shadow.> haven't found a very thorough resource |
22:59:47 | leorize | you emit the class and you use a macro to turn your virtual function overload into two pieces: one written in C++ that calls the actual Nim implementation (use emit for this), and another is the implementation itself |
22:59:51 | FromDiscord | <shadow.> (specifically for cppp) |
22:59:59 | FromDiscord | <shadow.> (edit) "cppp)" => "cpp)" |
23:00:12 | FromDiscord | <ElegantBeef> I mean FFI works by emitting code that calls the given unmangled names 😄 |
23:00:30 | FromDiscord | <shadow.> well |
23:00:35 | FromDiscord | <shadow.> i meant how to use it in nim lol |
23:01:13 | FromDiscord | <ElegantBeef> Did you already go to the manual? |
23:01:20 | leorize | hmm, with codegenDecl you might be able to write the overload completely in nim |
23:01:38 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma if not here |
23:02:49 | FromDiscord | <shadow.> lemme try that |
23:03:00 | FromDiscord | <lqdev> @mratsim is there any chance of having something like `blockUntilAny` in weave? i want to add nice progress reporting for finished jobs, but right now i need to iterate all of my jobs and call isReady |
23:03:07 | FromDiscord | <lqdev> which is um, less than efficient |
23:04:06 | FromDiscord | <shadow.> would i have to importcpp declare every method i wanna use of an object? |
23:04:12 | FromDiscord | <shadow.> bc that could get a bit tedious |
23:04:34 | FromDiscord | <ElegantBeef> You can see why c2nim and the like were made eh? |
23:05:26 | FromDiscord | <shadow.> yep |
23:05:47 | FromDiscord | <ElegantBeef> Cant you cdecl all the procs which just causes the compiler to write their name out properly? |
23:05:58 | FromDiscord | <ElegantBeef> So then you could use the generated code from Nim |
23:06:05 | FromDiscord | <shadow.> im just not sure if c2nim would work for what im doing? the module uses headers of its internal stuff and doesnt c2nim not follow headers |
23:06:41 | leorize | you just need a script to translate them |
23:06:47 | leorize | see wxnim that I linked above |
23:06:49 | FromDiscord | <shadow.> i see |
23:08:54 | leorize | ffi in nim via compiling to the target language is all about making nim generate the stuff that looks like what you would write yourself for the most part |
23:09:12 | FromDiscord | <shadow.> yeah |
23:09:23 | FromDiscord | <shadow.> i guess standard ffi is out of the question then since id have to importcpp basically everything |
23:09:27 | FromDiscord | <shadow.> so that leaves what, c2nim and nimterop? |
23:09:45 | FromDiscord | <lqdev> @mratsim also, any plans on releasing a new release of weave? i don't feel very confident having to use weave@#master |
23:10:58 | * | hmmm quit (Quit: WeeChat 3.0) |
23:12:49 | * | tane quit (Quit: Leaving) |
23:13:57 | FromDiscord | <Clyybber> leorize saw your issue, I think you should be able to work around it |
23:14:13 | FromDiscord | <Clyybber> by using a single field object instead of distinct |
23:14:55 | leorize | that's dumb |
23:15:51 | leorize | or I can add an `async: bool` in and drop asyncdispatch :P |
23:18:04 | leorize | jokes aside this bug prompted me to write more tests because I can't trust that the compiler will destroy my objects correctly |
23:20:33 | FromDiscord | <dom96> > or I can add an async: bool in and drop asyncdispatch 😛 |
23:20:39 | FromDiscord | <dom96> what, context plz |
23:21:29 | leorize | #16722 is what I rely on to destroy my AsyncFile objects |
23:21:30 | disbot | https://github.com/nim-lang/Nim/issues/16722 -- 3`ref` of distinct object have destructor of base object bound instead of the distinct object's ; snippet at 12https://play.nim-lang.org/#ix=2M34 |
23:21:55 | leorize | but I can also get rid of AsyncFile and go full CPS |
23:24:04 | leorize | I would have to write a dispatcher for it though, so maybe not yet |
23:27:45 | FromDiscord | <dom96> ooof https://media.discordapp.net/attachments/371759389889003532/799419512671830016/unknown.png |
23:30:26 | FromDiscord | <ElegantBeef> I'm disappointed as i have no context to that 😄 |
23:36:24 | * | wasted_youth joined #nim |
23:36:31 | * | wasted_youth left #nim ("Leaving") |
23:36:38 | * | wasted_youth joined #nim |
23:54:03 | FromDiscord | <shadow.> what's Status? |
23:54:08 | FromDiscord | <shadow.> is it a package manager lmao |
23:54:11 | FromDiscord | <shadow.> where's the repo |
23:54:12 | FromDiscord | <shadow.> !repo status |
23:54:13 | disbot | https://github.com/status-im/nimbus-launch -- 9nimbus-launch: 11Jumpstart your Nim project at Status 15 12⭐ 4🍴 7& 10 more... |
23:54:38 | FromDiscord | <shadow.> hm |
23:58:54 | * | Vladar quit (Quit: Leaving) |
23:58:55 | FromDiscord | <ElegantBeef> A company that actively uses Nim and donates to it |
23:59:19 | FromDiscord | <shadow.> ah yikes |
23:59:55 | FromDiscord | <shadow.> who wrote the text? |