00:00:42 | * | tane quit (Quit: Leaving) |
00:40:06 | FromDiscord | <juliuskiesian> what's nim's way of calling method of the super type? |
00:40:35 | FromDiscord | <ElegantBeef> `a.SuperType.method` i believe |
00:42:28 | FromDiscord | <ElegantBeef> Tested that and i was wrong |
00:48:27 | FromDiscord | <ElegantBeef> Ah it's `proccall` |
00:48:36 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2KmD |
00:48:40 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/manual.html#methods-inhibit-dynamic-method-resolution-via-proccall |
00:49:07 | * | l1x quit (Quit: Connection closed for inactivity) |
00:59:37 | * | Gustavo6046 quit (Ping timeout: 272 seconds) |
01:01:02 | * | Gustavo6046 joined #nim |
01:12:54 | * | vicfred quit (Quit: Leaving) |
01:13:38 | FromDiscord | <juliuskiesian> hm, the naming is a bit confusing. |
01:14:00 | FromDiscord | <juliuskiesian> one would expect methodCall. |
01:19:28 | * | azed joined #nim |
01:43:46 | Prestige | A method is just a special type of proc, and I don't think procCall is limited to methods |
01:46:04 | * | cyraxjoe quit (Quit: I'm out!) |
01:48:54 | * | cyraxjoe joined #nim |
01:51:54 | * | azed quit (Quit: WeeChat 3.0) |
02:02:27 | saem | A butts, can't fill in all the info for the big report on my phone. Hopefully I remember later. |
02:03:06 | * | cyraxjoe quit (Quit: I'm out!) |
02:05:53 | * | cyraxjoe joined #nim |
02:19:55 | * | jjido quit (Quit: Connection closed for inactivity) |
02:53:31 | * | Tanger joined #nim |
03:41:54 | * | rockcavera quit (Remote host closed the connection) |
03:50:32 | * | D_ quit (Ping timeout: 256 seconds) |
03:51:00 | * | D_ joined #nim |
03:52:50 | * | muffindrake quit (Ping timeout: 264 seconds) |
03:53:23 | * | leorize quit (Ping timeout: 240 seconds) |
03:54:43 | * | muffindrake joined #nim |
04:10:04 | * | leorize joined #nim |
04:15:00 | FromDiscord | <Rika> is there a sugar.dup for functions with two arguments that are modified in place? |
04:21:24 | * | rockcavera joined #nim |
04:35:38 | * | spiderstew_ joined #nim |
04:38:22 | * | spiderstew quit (Ping timeout: 256 seconds) |
04:45:25 | FromDiscord | <exelotl> aw man the compiler's segfaulting on me :( |
04:46:29 | FromDiscord | <Rika> the nim experience™️ |
04:46:29 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/RFN |
04:46:34 | FromDiscord | <Rika> yes |
04:46:38 | FromDiscord | <Rika> theyre the hints from 1.0 |
04:46:49 | FromDiscord | <exelotl> is there a way to get it to output the module name? |
04:46:51 | FromDiscord | <Rika> hint processing module etc |
04:46:53 | FromDiscord | <Rika> nope |
04:46:57 | FromDiscord | <Rika> no clue how |
04:47:53 | FromDiscord | <exelotl> dangit |
04:49:43 | FromDiscord | <exelotl> ah well I'll figure it out tomorrow |
04:49:55 | FromDiscord | <exelotl> if anyone knows the answer please ping me x) |
04:52:58 | FromDiscord | <Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2Knc |
04:54:12 | FromDiscord | <Rika> any issue? |
04:55:37 | FromDiscord | <Sorrow> Eh? |
04:57:35 | FromDiscord | <Rika> what are you asking |
04:57:43 | disruptek | how tall are you? |
04:58:52 | FromDiscord | <Sorrow> How to port it to Nim. |
04:59:34 | disruptek | ~manual |
04:59:35 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html -- disruptek |
04:59:35 | disbot | manual: 11just good to Ctrl+F in cases like this |
04:59:57 | disruptek | i'd be happy to port it for you at a very reasonable rate. |
05:00:44 | FromDiscord | <Rika> lol |
05:00:58 | FromDiscord | <Sorrow> 10 headpats? |
05:07:45 | * | Jesin quit (Read error: Connection reset by peer) |
05:08:04 | * | Jesin joined #nim |
05:22:03 | saem | issue submitted. |
05:27:08 | * | Jesin quit (Read error: Connection reset by peer) |
05:38:12 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:38:21 | * | njoseph joined #nim |
05:47:24 | ForumUpdaterBot | New thread by Chris3606: Error Using _kbhit with .importc, see https://forum.nim-lang.org/t/7317 |
06:27:19 | * | habamax joined #nim |
06:32:00 | * | Tanger quit (Remote host closed the connection) |
06:43:09 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
07:30:57 | disruptek | !repo testes |
07:30:58 | disbot | https://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 22⭐ 0🍴 7& 29 more... |
07:34:02 | * | opal quit (Remote host closed the connection) |
07:34:29 | * | opal joined #nim |
07:34:38 | * | narimiran joined #nim |
07:36:55 | FromDiscord | <CodeHz> can I create indirect recursive type? https://media.discordapp.net/attachments/371759389889003532/794106797023559720/unknown.png |
07:37:12 | FromDiscord | <CodeHz> (consider B is vtable for A |
07:39:26 | FromDiscord | <CodeHz> oh, can be done in same typesection |
07:41:53 | FromDiscord | <CodeHz> still not working... https://media.discordapp.net/attachments/371759389889003532/794108046405664768/unknown.png |
07:44:57 | FromGitter | <gogolxdong> Does Channel have any issue when working with async? |
07:44:59 | FromDiscord | <ElegantBeef> This works https://play.nim-lang.org/#ix=2Knx |
07:46:17 | * | kenran joined #nim |
07:59:37 | FromDiscord | <CodeHz> (edit) still not working... (updated: fixed, I just swap two typedef https://media.discordapp.net/attachments/371759389889003532/794108046405664768/unknown.png |
08:26:22 | * | letto quit (Quit: Konversation terminated!) |
08:29:46 | FromGitter | <gogolxdong> Will Nim be GC free after turing into CPS? |
08:29:53 | * | letto joined #nim |
08:33:40 | FromGitter | <gogolxdong> It seems that CPS's memory management is using stack |
08:35:13 | FromDiscord | <ElegantBeef> Well ARC isnt technically a GC, so it already can be |
08:36:50 | FromDiscord | <cybertim> trying to put my feet into the nim js waters, i noticed there is a asyncjs lib but using that one still gives me the "Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory" error which seems to be related to 'always set a Future' as return type? (following the docs) but i'm also using the asynchttpserver, that internally uses asyncdispatch instead of asyncjs, so.. is nim js ever goi |
08:37:41 | FromDiscord | <ElegantBeef> afaik the httpserver uses system calls or C ffi, so i dont think it'll ever work with js |
08:38:31 | FromDiscord | <cybertim> ok, so nim js really needs 'different' kind of codebase i presume, its not magic like just set the js tag and voila your nim program now runs on deno or node etc |
08:38:49 | saem | That's correct |
08:38:51 | FromDiscord | <ElegantBeef> Well pure nim code that doesnt rely on system libs or C should |
08:39:52 | FromDiscord | <ElegantBeef> https://github.com/juancarlospaco/nodejs is the nodejs stdlib bindings |
08:40:09 | saem | Nim supports the browser, but not node when it comes to JS. In that system APIs assuming an OS don't work. |
08:40:35 | FromDiscord | <ElegantBeef> Yep you can use Nim for node but you'd need to make bindings for the specific libraries you need |
08:40:41 | saem | You can output JS so with some glue, 3rd party or your own you can run that code in node |
08:40:57 | FromDiscord | <cybertim> yes but i thought (maybe) since asynchttpserver probably also has some internal difference between windows/linux etc these libraries were also written with an internal difference for the js ecosystem |
08:41:22 | FromDiscord | <ElegantBeef> Well they could be |
08:41:26 | FromDiscord | <ElegantBeef> But they currently are not |
08:41:31 | saem | The node js define is mostly there to allow for a few things to get out of your way, but doesn't do all the FS and other bits. |
08:41:51 | FromDiscord | <ElegantBeef> JS doesnt have a http request backend though so idk how you'd do it |
08:42:13 | FromDiscord | <ElegantBeef> Unless the browser request is the same as node's |
08:42:32 | FromDiscord | <ElegantBeef> If it's not you'd have to support every seperate js runtime manually |
08:43:49 | FromDiscord | <cybertim> yes that is true, im to focused on nodejs kind of services, but that wouldnt make sence anyway because these can be easily done within nim itself, i will try a different approach 🙂 |
08:44:20 | FromDiscord | <ElegantBeef> If you want to use JS get comfortable writting the bindings |
08:44:44 | saem | Unless you have particular needs just complied to the C backend for server side |
08:44:45 | FromDiscord | <ElegantBeef> It's not overly difficult, this is a quickly made example i've made https://github.com/beef331/mrapi/blob/master/src/mrapi.nim |
08:45:01 | FromDiscord | <ElegantBeef> Yep, no point using JS when you have C |
08:45:33 | saem | I've written a whole bunch of node and vs code API bindings, it was pretty easy and quick |
08:46:03 | FromDiscord | <ElegantBeef> Yep it's super easy, although unless you're forced to using JS, there is no point |
08:46:38 | FromDiscord | <ElegantBeef> The more annoying thing is if you want properly typed objects, i just half assed the WebRTC stuff for that api |
08:46:50 | saem | Although the node js api docs are awful |
08:46:52 | FromDiscord | <ElegantBeef> `JsObject` is a nice abstraction, although super unhelpful |
08:48:06 | saem | You only need JsObject at the edge of your system where it's squishy |
08:48:37 | saem | Any other time I used it wasn't worth while. |
08:48:50 | FromDiscord | <ElegantBeef> Yea, like in my example i couldnt be arsed to attempt to match the required type since it was super complicated |
08:49:04 | FromDiscord | <ElegantBeef> Nim objects in JS match a normal JS object right? |
08:49:14 | FromDiscord | <ElegantBeef> When inherited from jsobject |
08:49:53 | saem | Yes |
08:50:22 | saem | Even without, because that's all JS really gives you until you get to classes or records |
08:50:58 | saem | But even then that stuff works anyways, because JS |
08:51:10 | FromDiscord | <ElegantBeef> I really should revisit the JS nim binding generator at one poine |
08:51:23 | saem | So unless you're going back and forth it's fine |
08:51:34 | saem | You mean TS? |
08:51:40 | FromDiscord | <ElegantBeef> Nope js |
08:52:03 | saem | Look at JS code and generate bindings? |
08:52:06 | FromDiscord | <ElegantBeef> Some things are in just normal JS and it'd be nice to be able to auto generate them |
08:52:13 | FromDiscord | <ElegantBeef> Yea i toyed with it briefly |
08:52:25 | saem | That's quite the hill |
08:52:46 | saem | I mean so many of the pure js things have TS bindings |
08:53:14 | saem | And JS is a subset of TS so... |
08:53:22 | FromDiscord | <ElegantBeef> Yea i know |
08:53:47 | FromDiscord | <ElegantBeef> The biggest thing is that those dont work well either honestly, since you have to dick around with anywhere there is an interface atm |
08:53:50 | Prestige | With TS having types, could be quite handy |
08:53:52 | saem | Anyways there are two such projects for TS and only one is semi-active presently |
08:54:13 | saem | Last I checked |
08:54:37 | saem | When you get to interfaces I think you need to go concepts |
08:54:39 | FromDiscord | <ElegantBeef> Having `JsObject` instead of having to manually convert code is just easier to atleast test 😄 |
08:54:50 | saem | Yup |
08:55:49 | Prestige | Concepts are being reworked, right? Curious what will be changed |
08:56:12 | saem | Or I guess even with interfaces you could make no-op cast procs on top of distinct JSObjects or something |
08:56:30 | saem | Me too |
08:58:02 | saem | I partly wish we had rows as a lighter weight version but the utility might be too low. They'd be like light weight concepts. Similar to template and macro relationship. |
08:58:36 | Prestige | Rows? |
08:59:50 | saem | Row polymorphism, like typescript interfaces. All compile time, if it has field with the right name and type it fits. Basically marks anything that uses it implicitly generic |
09:00:25 | FromDiscord | <ElegantBeef> So Nim's concepts? 😄 |
09:00:47 | Prestige | Sounds like the same thing to me |
09:00:51 | saem | Yes, but lighter, as it doesn't cover as many things |
09:01:04 | saem | So structural |
09:01:21 | Prestige | What about proc definitions? |
09:01:28 | saem | Again, the narrowing might not be sufficient to lighten the implementation |
09:01:31 | saem | Not covered |
09:01:35 | Prestige | Ah okay |
09:01:53 | saem | Unless it's a field storing a function pointer |
09:02:21 | Prestige | Beef, did you ever do anything with that macro/template to import and export with a single line? |
09:02:54 | * | Gustavo6046 quit (Ping timeout: 268 seconds) |
09:03:18 | Prestige | Like make a lib or a PR |
09:03:40 | FromDiscord | <ElegantBeef> I think i made one forever ago, though i never kept it |
09:04:00 | FromDiscord | <ElegantBeef> Also i'm just realizing now Nim concepts are user defined duck typing 😄 |
09:05:19 | Prestige | Import and export together would be a nice language feature |
09:05:48 | FromDiscord | <ElegantBeef> Yea but unless it got brought into the system module would require manually modifying cfgs 😄 |
09:06:00 | Prestige | Also being able to import relative to the project root... There's probably already a way |
09:06:24 | FromDiscord | <ElegantBeef> Huh? |
09:06:36 | FromDiscord | <cybertim> lol https://github.com/pragmagic/karax this is what i had in mind, i see this has already been done, nice case study 🙂 |
09:06:56 | Prestige | Like, not having to import "../a" |
09:07:01 | FromDiscord | <ElegantBeef> Ah |
09:07:33 | FromDiscord | <ElegantBeef> Yea time to make `import-utils` |
09:08:41 | saem | Honestly what's the big deal about import/export in one line? |
09:08:56 | FromDiscord | <ElegantBeef> It's a nice feature |
09:09:12 | saem | ... is it? |
09:09:16 | Prestige | Yes |
09:09:23 | FromDiscord | <ElegantBeef> `word ./[moduleA, moduleB, moduleC]` |
09:09:29 | FromDiscord | <ElegantBeef> word being whatever i decide |
09:09:44 | FromDiscord | <ElegantBeef> guess `.` was redundant |
09:09:47 | saem | I mean, if anything I went in the opposite direction |
09:10:06 | FromDiscord | <ElegantBeef> What do you mean? |
09:10:13 | saem | I try to minimize my imports to specific types and imports |
09:10:19 | saem | To keep the surface area small |
09:10:34 | FromDiscord | <ElegantBeef> Eh that's one way |
09:10:39 | saem | And easy to reason about how strong/necessary the dependency is |
09:10:46 | Prestige | It gets tedious |
09:11:08 | FromDiscord | <ElegantBeef> Sure, it's tedious and an uphill battle if you're writing code from a blank canvas |
09:11:21 | saem | Expanding API surface and doing so easily seems like a bad idea. |
09:11:33 | FromDiscord | <ElegantBeef> It's the norm and it's' fine |
09:12:20 | * | NimBot joined #nim |
09:12:21 | saem | It really isn't |
09:12:33 | FromDiscord | <Rika> Don’t give them too many redundant choices |
09:12:36 | saem | Besides the option is there |
09:12:43 | saem | It's just not streamlined |
09:12:56 | FromDiscord | <ElegantBeef> It's tedious to work around imo |
09:13:01 | Prestige | Yep |
09:13:20 | FromDiscord | <ElegantBeef> Unless you need only a few features of a module, i dont see why you'd do it |
09:13:31 | saem | Yes, but it's generally bad so the tedium is a good signal to reconsider and a small price for what should be something that doesn't happen often. |
09:13:50 | saem | I mean the single line import export |
09:13:51 | FromDiscord | <Rika> What’s streamlined for you may not be for me, and the disadvantages of “polluting” for you is lesser than the disadvantages of people needing to work around your excessive “streamlining” |
09:13:58 | Prestige | Depends on the program/lib |
09:14:15 | FromDiscord | <ElegantBeef> What's' the issue with the `import export` single line? |
09:14:31 | * | ThatGuyFromThere joined #nim |
09:14:37 | Prestige | You'd need to work around not using a template? |
09:14:58 | ThatGuyFromThere | Yo, working cairo binding or do i need to fixem myself |
09:15:08 | FromDiscord | <ElegantBeef> Was that to me prestige? |
09:15:11 | FromDiscord | <Meowz> Are the devs of nimpy here? |
09:15:11 | FromDiscord | <Rika> What is Cairo |
09:15:17 | Prestige | To Rika |
09:15:27 | FromDiscord | <ElegantBeef> Cairo is a linux api rendering api iirc |
09:15:34 | ThatGuyFromThere | Rika: they are |
09:15:35 | ThatGuyFromThere | extra/cairo 1.17.4-3 (635.8 KiB 1.7 MiB) (Installed) 2D graphics library with support for multiple output devices |
09:15:38 | FromDiscord | <Rika> Prestige, I’m not sure what you mean, but I’ll just drop the argument if so |
09:15:56 | ThatGuyFromThere | rika basically p5.js on c++ |
09:15:57 | FromDiscord | <Rika> I’m a bit oxygen deprived from exercise |
09:16:08 | Prestige | You said something about people having to work around excessive streamlining, but we were just be adding a new template |
09:16:15 | FromDiscord | <Rika> I don’t know what p5.js is either |
09:16:21 | FromDiscord | <ElegantBeef> It's basic rendering |
09:16:39 | FromDiscord | <ElegantBeef> Rika wasnt talking against import/export on a single line but selective importing |
09:16:45 | Prestige | Ah |
09:16:50 | FromDiscord | <ElegantBeef> Atleast my reading seems to indicate that |
09:16:55 | FromDiscord | <Rika> Yeah |
09:16:56 | saem | ThatGuyFromThere: haven't seen one, but have you checked nimble already? |
09:17:35 | FromDiscord | <ElegantBeef> Yea we got multiple bindings for it |
09:17:38 | ThatGuyFromThere | nimble only had the main cairo I know the fixes so I'll try implement them basically not good dir structure |
09:17:51 | ThatGuyFromThere | Not okay imports too |
09:17:52 | Prestige | I think I'd just call it 'importAndExport' tbh |
09:18:00 | FromDiscord | <ElegantBeef> Pretty wordy |
09:18:36 | Prestige | Yeah, but at least it's descriptive. Maybe I'm not creative enough for this naming stuff thing lol |
09:19:23 | ThatGuyFromThere | Somebody had already fixed em but in 2018 |
09:22:17 | FromDiscord | <ElegantBeef> `impart` could work |
09:22:55 | FromDiscord | <cybertim> whats is the difference between string and cstring? |
09:23:01 | Prestige | I think it's too similar to import |
09:23:27 | FromDiscord | <ElegantBeef> Well i had `share` or `expose` as other ideas |
09:24:16 | FromDiscord | <Vindaar> Nim's cairo module works great, what are your issues with it? |
09:25:30 | ThatGuyFromThere | Vindaar: Not working |
09:25:32 | FromDiscord | <Vindaar> @Meowz not sure I'd call myself a dev of nimpy, but I've contributed several times. What's your issue? |
09:25:42 | FromDiscord | <Vindaar> what does "not working" mean? |
09:25:43 | ThatGuyFromThere | cannot import x |
09:25:59 | saem | Maybe an import pragma like "open", in terms of an open module, wherein a normal import (no export) is sealed. Still sounds like not a great call. 😉 |
09:26:05 | Prestige | Can you show a code sample? |
09:26:12 | Prestige | ThatGuyFromThere: |
09:27:13 | FromDiscord | <Meowz> No really an issue. I was just wondering if the future of `exporting Nim types/functions as Python classes/methods` is already under progress |
09:27:14 | Prestige | saem: sealed? How is that different from a normal import? |
09:28:35 | FromDiscord | <Meowz> I saw some `exportExperimentalPy` (?) pragma. Guess that could be it? |
09:29:02 | saem | It's not and they don't need it, would be implied. But before rushing down that route people might have bigger ideas around modules, like first class ones that are more worth exploring. |
09:29:25 | * | habamax quit (Ping timeout: 246 seconds) |
09:30:39 | Prestige | I'm not exactly following, but that's okay. If it's not added into the language I'll just make and use a package for it |
09:31:48 | ThatGuyFromThere | Prestige: in cairo there is freetypeh |
09:31:50 | ThatGuyFromThere | what is it |
09:32:13 | Prestige | freetype? Some lib for font rendering iirc |
09:32:26 | Prestige | Google would know more |
09:33:35 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:37:22 | FromDiscord | <Vindaar> @Meowz I just checked the code again: regarding objects, they are currently transformed into python dictionaries whereas Nim procs are handed as `PyCapsule`↵So I suppose the answer is "no". Where did you see that pragma?↵I'm not sure what would be required to hand Nim objects as Python objects (well obv. create a Python class of it, instantiate an element of it; but how one would best do that) |
09:40:05 | FromDiscord | <Meowz> It was `pyexportTypeExperimental`: https://github.com/yglukhov/nimpy/blob/master/nimpy.nim#L1213 |
09:42:01 | FromDiscord | <Vindaar> ahh, very interesting! |
09:42:56 | FromDiscord | <Meowz> Indeed. Just fails currently for most of my functions 😄 |
09:43:28 | FromDiscord | <Vindaar> so you want to call Nim from Python and use the Nim types as native Python types in Python? |
09:45:22 | * | tane joined #nim |
09:46:30 | FromDiscord | <Meowz> Guess thats how it should work some day. A simple vector object could be used like `vector.x` from python instead of the dict way `vector["x"]` |
09:47:06 | Oddmonger | how to have two codepaths, one for libc and one for javascript in nim sources ? |
09:47:22 | saem | When statement |
09:47:24 | Oddmonger | using « when: » ? |
09:47:27 | Oddmonger | ah ok |
09:47:50 | Oddmonger | when javascript: … |
09:47:51 | FromDiscord | <Vindaar> yes, sure. ↵I was just curious, because of course one also might want to call Python from Nim, but hand a native Nim type to a Python function, in which one wants to use that type as a native Python type |
09:50:15 | Oddmonger | can i test target with when ? (and how :) ) |
09:50:37 | FromDiscord | <Rika> target what? |
09:50:38 | FromDiscord | <Rika> os? |
09:50:41 | FromDiscord | <Rika> architecture? |
09:51:07 | * | Kaivo quit (Ping timeout: 246 seconds) |
09:51:34 | Oddmonger | js / other |
09:51:42 | Oddmonger | ah when defined(javascript): , maybe |
09:52:28 | Oddmonger | yes |
09:52:53 | FromDiscord | <ElegantBeef> i believe it's `when defined(js)` |
09:53:19 | Oddmonger | ah surely, thank you |
09:53:26 | * | Kaivo joined #nim |
09:53:35 | FromDiscord | <ElegantBeef> So prestige the absolute importing is going to be tricky |
09:54:03 | FromDiscord | <ElegantBeef> Hmm actually |
09:54:27 | FromDiscord | <ElegantBeef> Nope cannot figure out a way to get the module that called the macros path |
09:54:34 | Prestige | You'd just need the path to the current file from the project root |
09:54:42 | Prestige | Hmm |
09:55:25 | FromDiscord | <ElegantBeef> there is `getProjectPath` for project root, and `currentSourcePath` for the file that's compiling but it says "which returns the path of the source file containing that template call." and doesnt seem to work with macros |
09:55:34 | FromDiscord | <ElegantBeef> oh nvm i see what i means |
09:55:57 | * | ThatGuyFromThere quit (Quit: leaving) |
09:55:59 | ForumUpdaterBot | New question by Ridcully: nim - custom macro/pragma to get ast of complete module but get &quot;cannot attach a custom pragma&quot;, see https://stackoverflow.com/questions/65519270/nim-custom-macro-pragma-to-get-ast-of-complete-module-but-get-quotcannot-att |
09:56:51 | Zevv | Nim @HN fp |
09:56:59 | FromDiscord | <Rika> link? |
09:57:06 | Zevv | https://news.ycombinator.com/ : |
09:57:07 | Zevv | :) |
09:57:14 | FromDiscord | <Rika> smh |
09:57:25 | Zevv | it's the 2020 post |
09:57:37 | FromDiscord | <ElegantBeef> Must be a slow day for hackernews that this post gets fp 😄 |
09:57:45 | Prestige | https://news.ycombinator.com/item?id=25590962 |
09:57:52 | FromDiscord | <Rika> first comment and it compares with rust sigh |
09:58:04 | Prestige | Lmao |
09:58:08 | Zevv | I think it's moderated to the fp, there's only a handful of points yet |
09:58:42 | FromDiscord | <Rika> mods prolly thought it would generate nice discussion and not which language is better argument |
10:00:11 | Zevv | Rust clearly is better |
10:00:11 | Prestige | Silly mods |
10:00:16 | Zevv | Silly Nim |
10:03:12 | FromDiscord | <ElegantBeef> Nim has three letters and you know what else has 3 letters bad, rust has 4 letters and you know what has 4 letters good 😄 |
10:03:46 | * | narimiran quit (Ping timeout: 272 seconds) |
10:04:21 | * | narimiran joined #nim |
10:05:14 | * | Arrrrrrrr joined #nim |
10:09:26 | FromDiscord | <Rika> god also has 3 letters |
10:09:29 | FromDiscord | <Rika> shit has 4 letters |
10:09:33 | FromDiscord | <Rika> checkmate beef |
10:10:12 | Zevv | let's not go there people |
10:10:19 | FromDiscord | <ElegantBeef> Fuck you, there is 4 and 3 letters for you |
10:10:43 | FromDiscord | <ElegantBeef> Go where? |
10:10:45 | FromDiscord | <ElegantBeef> I cannot travel |
10:10:51 | FromDiscord | <Meowz> Like that: https://play.nim-lang.org/#ix=2Ko9 ? I'm already happy if I could use Nim types as Python Types on pythons end and pass them again to nim functions |
10:12:08 | FromDiscord | <ElegantBeef> To do that you'd have to have some form of interop |
10:12:15 | FromDiscord | <ElegantBeef> Like i do for nimscripter |
10:12:27 | FromDiscord | <ElegantBeef> My response is always, write nim not pythong |
10:12:29 | FromDiscord | <ElegantBeef> (edit) "pythong" => "python" |
10:13:12 | FromDiscord | <Meowz> We're writing nim. Which pythoners can use ;D |
10:13:31 | FromDiscord | <ElegantBeef> Nim doesnt store types the same as python, so you'd need to emit glue both ways which means you'd need to make a format which annotates the type for the python -> nim way |
10:13:37 | FromDiscord | <Rika> beef i want to ask you a question about the randgen lib im making; when you initialize an rng, would you mind if the seed is put through another rng to make the seed for the chosen rng? |
10:13:51 | FromDiscord | <ElegantBeef> I'd dislike that as it's multiple dependancies |
10:14:03 | FromDiscord | <Rika> all rngs are in the same library |
10:14:17 | FromDiscord | <ElegantBeef> I mean i dont see why you would |
10:14:23 | FromDiscord | <Rika> and are compat. with most arches/backends i believe |
10:14:38 | FromDiscord | <Rika> i dont know if anyone would consider this undesirable |
10:14:50 | FromDiscord | <Rika> i just want to know someone else's opinion as i only have my own |
10:15:03 | FromDiscord | <ElegantBeef> Well it'd suck for proc gen |
10:15:11 | FromDiscord | <Rika> proc gen? |
10:15:16 | FromDiscord | <ElegantBeef> Procedural generation |
10:15:26 | FromDiscord | <Rika> why? |
10:15:28 | FromDiscord | <ElegantBeef> If you're making the rng system seeded differently with the same seed that's useless |
10:15:37 | FromDiscord | <ElegantBeef> If it's seeded the same, then why take the second step |
10:15:40 | FromDiscord | <Rika> what? |
10:15:57 | FromDiscord | <Rika> ah |
10:15:58 | FromDiscord | <Rika> okay |
10:16:03 | FromDiscord | <Rika> okay |
10:16:06 | FromDiscord | <Rika> i see |
10:16:17 | FromDiscord | <Rika> basically "if youre given a seed why make another one"? |
10:16:21 | FromDiscord | <Rika> okay |
10:16:40 | FromDiscord | <Rika> then ill only generate a new one when the given and required seed sizes are different |
10:16:42 | FromDiscord | <ElegantBeef> If i understand what you were asking you take seed pass it through an intialized rng, the next time that first seed is ran you have to have the second rng set the same or you arent seedding |
10:16:43 | FromDiscord | <Rika> thanks |
10:16:50 | FromDiscord | <Rika> no no |
10:17:00 | FromDiscord | <Rika> see this pseudocode |
10:17:36 | FromDiscord | <Rika> proc initrng(seed): rng =↵ let seed2 = initotherrng(seed)↵ rng.state1 = seed2.next() |
10:17:42 | FromDiscord | <Rika> something like that |
10:17:50 | FromDiscord | <Rika> just for initializing |
10:18:27 | FromDiscord | <ElegantBeef> That doesnt seem to do anything overly special |
10:18:38 | FromDiscord | <ElegantBeef> Pretty redundant honestly |
10:18:50 | FromDiscord | <Rika> yeah so ill only do it when the state size != given seed size |
10:18:52 | FromDiscord | <Rika> thanks |
10:19:08 | FromDiscord | <ElegantBeef> Glad you could decide whilst i was rambling 😄 |
10:19:26 | FromDiscord | <Rika> ill make you my rubber duck in the future xd |
10:20:00 | FromDiscord | <ElegantBeef> Lol sounds like an occupation |
10:20:13 | FromDiscord | <ElegantBeef> Although i've rarely seen you coding 😉 |
10:20:22 | FromDiscord | <Rika> oof |
10:20:31 | FromDiscord | <Rika> i moved a few months ago let me recover |
10:20:38 | FromDiscord | <ElegantBeef> Well prestige here it is for now, gotta solve `absImport` https://github.com/beef331/import-utils |
10:29:46 | FromDiscord | <ElegantBeef> Yea even using a template that calls `currentSourcePath` fails to get the actual path wanted |
10:34:37 | FromDiscord | <ElegantBeef> Ah got it, had to copy the code in the macro 😄 |
10:34:45 | FromDiscord | <ElegantBeef> Rather the code in the template |
10:42:42 | FromDiscord | <Vindaar> @Meowz yeah, that's what I meant |
10:57:11 | * | habamax joined #nim |
11:41:54 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
11:49:44 | planetis[m] | nim is in the frontpage at hn |
11:53:27 | FromDiscord | <haxscramper> nim vs rust again |
11:54:21 | ForumUpdaterBot | New question by Alex Craft: Why same strings are not equal in Nim?, see https://stackoverflow.com/questions/65520523/why-same-strings-are-not-equal-in-nim |
11:54:24 | FromDiscord | <Rika> as expected |
11:54:34 | FromDiscord | <haxscramper> Is there anyone who is knowledgeable enough to make a rough outline for nim for rust programmers for wiki? I can write/research remaining parts from that point |
11:54:53 | FromDiscord | <haxscramper> But since I don't program a lot in rust it would be difficult to come up with main points |
11:55:03 | FromDiscord | <haxscramper> Except for MM of course and sAfEtY |
12:04:52 | FromDiscord | <cybertim> sent a long message, see https://paste.rs/azr |
12:08:13 | FromDiscord | <haxscramper> We already have very good nim vs python/typescript article on wiki. Comparing wrt. to language design quality is absolutely pointless, |
12:08:47 | FromDiscord | <haxscramper> (edit) "We already have very good nim vs python/typescript article on wiki. Comparing ... wrt.tolanguage" added "anything to go" | "to language" => "tolanguage" |
12:10:23 | * | waleee-cl joined #nim |
12:10:54 | FromDiscord | <cybertim> comparing all those languages is pointless anyway 🙂 |
12:11:57 | FromDiscord | <flywind> it is helpful for marketing |
12:12:09 | FromDiscord | <haxscramper> These articles are mostly needed as macros for answering common misconcepsions for people coming from different languages and showing how they need to adapt their code |
12:12:16 | FromDiscord | <haxscramper> adapt how they should write code |
12:13:09 | FromDiscord | <cybertim> end of the day people use what they use, marketing comes mainly from overhyped blogs of big new startups that used some language and tackled a gazillion issues etc. |
12:13:25 | FromDiscord | <haxscramper> E.g. showing feature substitues or minor details that are not important enough to discuss them at length in manual let's say, but can be a major blocker for someone coming from different languages |
12:13:49 | FromDiscord | <cybertim> but most projects can even be created in qbasic or maybe even a bash script 😛 if you try hard enough |
12:13:58 | FromDiscord | <haxscramper> Well, `X vs Y` is an absolute best of what you can get in terms of useless overhyped artilces |
12:15:16 | FromDiscord | <haxscramper> It's just that nim doesn't exactly have this "scream everywhere about my lang" community (especiall compared to go/rust/vlang several others) |
12:18:16 | FromDiscord | <Rika> It's nice, those kinds of people can get annoying |
12:18:49 | FromDiscord | <haxscramper> Though there is no "killer feature" that separates from other languages. Being "generally better in most ways" (in my opinion) is not something that you can easile market |
12:20:58 | FromDiscord | <flywind> though I hope someone can act as that annoying person for Nim 😜 |
12:21:08 | FromDiscord | <flywind> https://github.com/timotheecour/Nim/discussions/490#discussioncomment-246873 |
12:22:02 | * | Torro joined #nim |
12:24:35 | * | lritter joined #nim |
12:38:57 | * | Zevv is late to the party it seems. The compiler can be built with ARC and I didn't even know that. |
12:39:15 | Zevv | ah, not quite: SIGSEGV |
12:39:20 | * | letto_ joined #nim |
12:39:34 | * | letto quit (Ping timeout: 272 seconds) |
12:42:44 | FromDiscord | <Rika> boutta port all pcg generators to nim, this is daunting as fuck |
12:42:52 | FromDiscord | <Rika> list: https://www.pcg-random.org/using-pcg-c.html#low-level-api |
12:43:32 | FromDiscord | <Rika> no i do not know what lcg is |
12:49:15 | FromDiscord | <dom96> yay, front page of HN |
12:49:35 | FromDiscord | <Rika> yeah but it got them rust bois |
12:50:31 | FromDiscord | <dom96> Gotta love them rust bois |
12:51:17 | FromDiscord | <Rika> oh wow the dude talking about whitespace got downvoted to oblivion it sees |
12:51:19 | FromDiscord | <Rika> seems |
12:52:15 | * | tane quit (Quit: Leaving) |
12:55:09 | FromDiscord | <bark> isn't arc and metaprogramming killer features? |
12:56:44 | FromDiscord | <bark> and having a js backend as well and react bindings |
13:01:12 | FromDiscord | <haxscramper> Metaprogramming is a murky when you try to actually use it as "instantly solves all your problems, zero abstraction, no overhead PR marketing BS". For simple things like `fields`, `fieldPairs`, some enum features, `static`, and some pragmas, this really feels like a part of the language. Some well-written macros from standard library also fall into this category. |
13:01:42 | FromDiscord | <haxscramper> When you come intro more heavy-weight macros you get really powerful toolset |
13:02:20 | FromDiscord | <haxscramper> But it is hard to pin down like, this one-sentence motto for metaprogramming |
13:02:44 | FromDiscord | <haxscramper> Like "fearless concurrency" in rust |
13:02:57 | FromDiscord | <haxscramper> Regardless of how close to reality this is |
13:03:25 | FromDiscord | <haxscramper> It is "killer" feature alright |
13:03:26 | FromDiscord | <Rika> fearless concurrency after you get over your fears of lifetime annotations |
13:04:10 | FromDiscord | <haxscramper> Well yes, first of all there is like ten pages worth of footnotes that you need to add if you want to be fair |
13:04:32 | FromDiscord | <haxscramper> And metaprogramming is a "killer" feature alright, but it is just not really defined. |
13:05:09 | FromDiscord | <Rika> well defined |
13:05:11 | FromDiscord | <haxscramper> I can only get wow-effect if I show some code that does this "absolutely crazy insane thing in five lines" |
13:05:12 | FromDiscord | <Rika> not really well defined |
13:06:00 | FromDiscord | <haxscramper> yes |
13:08:47 | * | kungtotte quit (Read error: Connection reset by peer) |
13:09:50 | * | kungtotte joined #nim |
13:18:20 | FromDiscord | <Sorrow> I'm confused with how Nim deals with bytes. Still trying to search bytes in a file. |
13:22:07 | * | Gustavo6046 joined #nim |
13:22:58 | FromDiscord | <Rika> whats confusing maybe i can help |
13:23:08 | FromDiscord | <Sorrow> Everything, haha. |
13:24:01 | FromDiscord | <Sorrow> I basically wanna be able to read a file in chunks and search those chunks for bytes patterns. |
13:24:46 | FromDiscord | <Sorrow> In Py, you can just do .find(b'\x01\x02'). |
13:27:40 | FromDiscord | <Rika> nim string is more closely associated to python's byte string thingy |
13:34:23 | FromDiscord | <Sorrow> There's this, but it only takes a single int. https://nim-lang.github.io/Nim/algorithm.html#binarySearch%2CopenArray%5BT%5D%2CT |
13:34:41 | FromDiscord | <Rika> look into strutils |
13:34:57 | FromDiscord | <Rika> https://nim-lang.github.io/Nim/strutils.html |
13:37:37 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=2H9W |
13:38:37 | FromDiscord | <lqdev> sent a code paste, see https://paste.rs/Q3V |
13:38:39 | FromDiscord | <lantos> also always nice to see nim in top hacker news |
13:41:47 | FromDiscord | <lantos> sent a code paste, see https://paste.rs/gKl |
13:42:37 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=2KoX" => "https://play.nim-lang.org/#ix=2KoW" |
13:42:52 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=2KoW" => "https://paste.rs/8l8" |
13:48:53 | * | Vladar joined #nim |
13:58:30 | Zevv | how is introspection in rust? |
14:15:00 | FromDiscord | <Sorrow> sent a code paste, see https://play.nim-lang.org/#ix=2Kp8 |
14:16:37 | FromDiscord | <Rika> why an array instead of a string? |
14:16:44 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
14:20:41 | * | PMunch joined #nim |
14:26:17 | FromDiscord | <Sorrow> Got a code example? |
14:27:57 | FromDiscord | <haxscramper> `let file = readFile(r"G:\nim\file.bin"); let pos = file.find('\0x44' #[byte to find]#)` should work |
14:28:18 | FromDiscord | <Sorrow> It does, but what if It's more than one byte? |
14:28:59 | FromDiscord | <haxscramper> Nim strings are just bytes, so you should be able to use any string operations, such as `find("\0xFF\0xAA" |
14:29:03 | FromDiscord | <Rika> {byte, byte, byte} |
14:29:12 | FromDiscord | <haxscramper> (edit) "`find("\0xFF\0xAA"" => "`find("\0xFF\0xAA")`" |
14:29:22 | * | narimiran quit (Ping timeout: 246 seconds) |
14:29:28 | FromDiscord | <Rika> if you're looking for any of many bytes |
14:29:41 | FromDiscord | <Rika> if youre looking for a specific combination of bytes make them into a string |
14:29:53 | FromDiscord | <Sorrow> Yeah, thank you. |
14:30:24 | FromDiscord | <Sorrow> How should I change my buffer? |
14:31:24 | * | Torro quit (Read error: Connection reset by peer) |
14:31:44 | FromDiscord | <Rika> i'd just recommend using a filestream (defined in `streams`) if you need streaming instead of reading the whole file at one |
14:31:45 | FromDiscord | <Rika> once |
14:33:10 | * | abm joined #nim |
14:47:19 | * | hmmm joined #nim |
14:47:27 | hmmm | yo :3 |
14:52:23 | hmmm | / |
14:52:33 | hmmm | ops |
14:52:39 | hmmm | slipped |
14:53:05 | FromDiscord | <Rika> hello /hm+/ |
14:53:11 | hmmm | rika! |
14:53:16 | hmmm | my bro happy new year |
14:53:30 | FromDiscord | <Rika> hny, theres still 6 minutes for me |
14:54:42 | hmmm | waaat |
14:54:48 | hmmm | are you from australia or something |
14:55:14 | FromDiscord | <Rika> japan |
14:55:53 | hmmm | dude I went to japan last year for 2 weeks and it was super fun |
14:56:11 | hmmm | japan is megafun |
14:57:27 | FromDiscord | <Rika> im in kinda rural japan |
14:58:49 | * | gangstacat quit (Quit: Ĝis!) |
14:59:08 | FromDiscord | <Rika> so its kinda boring |
14:59:44 | hmmm | still a) the rural landscape is wonderful b) people are very kind and nice c) it's fkin japan so it's awesome |
15:00:50 | FromDiscord | <Rika> happy new year |
15:00:56 | hmmm | u2! |
15:02:05 | Oddmonger | ah yes, midnight in Tokyo |
15:02:26 | Oddmonger | happy new year (with 8 hours of advance for me) |
15:05:58 | FromDiscord | <Meowz> Is there a way to get all const variables from a module? I actually want all colors from colors.nim. To bad that `colorNames` isnt exported. |
15:06:30 | FromDiscord | <dom96> not anymore D: |
15:06:58 | FromDiscord | <dom96> So I managed to get a cool effect for my game to work in Firefox |
15:07:26 | FromDiscord | <dom96> in Chrome the background is "uninitialised", so Chrome just draws what's in the other tabs. Seems like I found a webkit bug D: |
15:12:16 | FromDiscord | <Rika> why do we have to keep on arguing about tabs spaces whitespace braces 2 4 vim emacs... man this is just so tiring |
15:13:44 | * | gangstacat joined #nim |
15:14:12 | FromDiscord | <KingDarBoja> Lua 3 spaces :D |
15:14:52 | FromDiscord | <Rika> man |
15:15:54 | oz | 7 non-breaking spaces is the best. |
15:16:55 | FromDiscord | <dom96> I personally like 3.14 spaces |
15:19:23 | * | Torro joined #nim |
15:25:24 | FromDiscord | <Sorrow> You're Japanese? Neat. |
15:31:16 | FromDiscord | <Rika> i am not, i am living in japan |
15:31:47 | FromDiscord | <Jarred Kenny> Is there a way to have a table whos values are arrays of different types without inheritance. Like `type Map = Table[string, MyTypeArray[SomeType]` where each table entry has a different `SomeType` |
15:31:49 | FromDiscord | <Sorrow> Ah. Been learning the lang for 4 years, but don't have the balls to visit. Sorry for off-topic talk. |
15:32:09 | FromDiscord | <Jarred Kenny> I know with inheritence, I would have all of SomeTypes extend a base type, but I am curious if there is a better way |
15:32:29 | FromDiscord | <Rika> object variants? |
15:36:40 | FromDiscord | <Jarred Kenny> On the MyTypeArray? |
15:42:31 | FromDiscord | <Jarred Kenny> Oh I see what you mean |
15:46:29 | * | superbia joined #nim |
15:46:37 | FromDiscord | <William_CTO> I came across this: `openArray[(string, string)]` which can be used like `{"foo": "bar"}` but this looks more like a table than an array. What exactly is this? I thought arrays were linear "lists." |
15:47:55 | FromDiscord | <William_CTO> All the examples of arrays in nim by example, the nim tutorial always show arrays as `[1,2,3]` |
15:48:15 | FromDiscord | <haxscramper> `{}` is just syntax sugar for `[("foo", "bar")]` |
15:48:54 | FromDiscord | <haxscramper> You just get an array of tuples, it is still linear, just contains `(string, string)`, instead of let's say `int` as in `[1,2,3]` |
15:49:31 | FromDiscord | <haxscramper> !eval echo typeof {"foo" : "bar"} |
15:49:33 | NimBot | array[0..0, (string, string)] |
15:49:46 | FromDiscord | <haxscramper> !eval echo typeof @{"foo" : "bar"} |
15:49:47 | FromDiscord | <William_CTO> oh, ok |
15:49:48 | NimBot | seq[(string, string)] |
15:49:58 | FromDiscord | <William_CTO> Wow, thanks a ton |
15:50:10 | FromDiscord | <William_CTO> I wish this were added to the docs |
15:51:10 | FromDiscord | <haxscramper> Which part of documentation in particular are you reading now? |
15:51:20 | * | superbia left #nim (#nim) |
15:51:57 | FromDiscord | <haxscramper> Or just somewhere in nim by example? |
15:52:04 | FromDiscord | <Jarred Kenny> Are seqs of a fixed length allocated linearly in memory? |
15:52:17 | FromDiscord | <William_CTO> I glanced at the nim manual section on arrays, but I found examples in the tutorial https://nim-lang.org/docs/tut1.html#advanced-types-arrays |
15:52:49 | FromDiscord | <haxscramper> you mean arrays? yes |
15:53:15 | FromDiscord | <Jarred Kenny> I mean whatever is created with newSeq[Type](length) |
15:54:27 | FromDiscord | <demotomohiro> Seq type always has continuous memory |
15:54:29 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-table-constructor actually it is just placed on manual |
15:55:03 | FromDiscord | <demotomohiro> excepts len == 0 |
15:55:10 | FromDiscord | <William_CTO> I'm very new to Nim and am re-learning how to read documentation lol |
15:55:12 | FromDiscord | <haxscramper> I didn't know you can also do `"key2", "key3": "value2"` |
15:55:19 | FromDiscord | <haxscramper> Nice |
15:55:46 | FromDiscord | <haxscramper> Another edge case for DSL though, will have to account for that one |
15:57:19 | FromDiscord | <Jarred Kenny> Makes sense when the length is fixed, but how does this work when seqs can grow? |
15:58:07 | FromDiscord | <haxscramper> all elements are reallocated in new, larger block of memory |
15:58:22 | FromDiscord | <juan_carlos> Theres no fixed len seq. |
15:58:31 | FromDiscord | <William_CTO> If I wanted to create an empty seq for this I'd use `var y: seq[(string,string)] = @[]` |
15:59:28 | FromDiscord | <haxscramper> Yes though `@[]` is not strictly necessary, Or you can use `newSeq[(string, string)]()` too |
15:59:48 | FromDiscord | <Jarred Kenny> Oh, I misunderstood seqs then. |
16:00:30 | * | aenesidemus joined #nim |
16:01:10 | FromDiscord | <William_CTO> Which method is more preferred? `y: seq...` or `y = newSeq...` |
16:01:18 | FromDiscord | <Rika> new seq is shorter |
16:01:18 | FromDiscord | <William_CTO> (edit) "preferred?" => "preferred or correct?" |
16:01:20 | FromDiscord | <Rika> either is ok |
16:01:45 | FromDiscord | <haxscramper> No particular preferences in style guide too, IIRC they are functionally equivalent |
16:02:22 | FromDiscord | <Jarred Kenny> sent a code paste, see https://play.nim-lang.org/#ix=2KpR |
16:02:41 | FromDiscord | <haxscramper> In earler versions `seq` could be `nil`, but now they have value semantics so implicit initialization is okay |
16:03:15 | FromDiscord | <Rika> for inheritance to work, the objects must be ref |
16:03:22 | FromDiscord | <haxscramper> No |
16:03:27 | FromDiscord | <haxscramper> Not necessarily |
16:03:32 | FromDiscord | <Rika> so sizeof(pointer) size will be allocated |
16:03:34 | FromDiscord | <Rika> ? |
16:03:35 | FromDiscord | <Rika> really? |
16:03:42 | FromDiscord | <Rika> i only ever saw them work with ref |
16:03:47 | FromDiscord | <Rika> work properly |
16:03:51 | disruptek | ^ |
16:04:24 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2KpS |
16:04:45 | disruptek | methods don't work w/o refs. |
16:05:22 | FromDiscord | <haxscramper> True, but inheritance /could/ be useful without methods too |
16:05:28 | FromDiscord | <haxscramper> Not very often though |
16:05:43 | FromDiscord | <Rika> not very useful either |
16:06:49 | FromDiscord | <haxscramper> In this particular case you get `sizeof(MyOtherObj2) 10`. IF you use refs (most likely that's what you wanted) it will be `sizeof(pointer) 10` |
16:08:40 | FromDiscord | <Jarred Kenny> The downside of using refs being that the objects being referenced won't be contiguous in memory right? |
16:08:51 | FromDiscord | <Rika> yes |
16:09:00 | FromDiscord | <Rika> but you will be able to properly use methods |
16:09:35 | FromDiscord | <Jarred Kenny> I am trying to build a system where all objects of a given type in my "manager" are stored together in memory, its for an entity component sytem |
16:09:37 | FromGitter | <HJarausch_gitlab> I need a helpful hand. ⏎ During compilation parsing and macro processing must be interwoven somehow. ⏎ Can anybody please give me some pointers where this process is documented? ⏎ Many thanks, Helmut [https://gitter.im/nim-lang/Nim?at=5fedf7c0ce40bd3cdb12cb5a] |
16:10:16 | FromGitter | <haxscramper> You can use https://nim-lang.org/docs/macros.html#parseStmt%2Cstring |
16:10:39 | FromDiscord | <Jarred Kenny> I am trying to implement this: https://austinmorlan.com/posts/entity_component_system/ |
16:10:47 | FromDiscord | <Jarred Kenny> ctrl-f "component manager" |
16:10:55 | FromGitter | <haxscramper> But this is a hack, and works only on strings that you generate elsewhere. Mixing parsing of main file and macro evaluation is not possible |
16:12:37 | FromDiscord | <haxscramper> You can just go with the same approach as C++ - OOP inheritance (if number of subtypes is not fixed), or use object variants if you only dealing with finite number of subtypes |
16:13:48 | FromDiscord | <haxscramper> Inheritance basically means you need to use `ref` in order for it to be useful. Object variants allow you to place all subtypes in single array |
16:13:55 | FromDiscord | <Sorrow> Got my issue sorted. Ended up using a fstream with readStr(). |
16:14:21 | FromDiscord | <haxscramper> And variants play better with generics |
16:14:29 | FromDiscord | <Jarred Kenny> I've steered away from subtypes because ideally I want to be able to register arbitrary objects as components at runtime |
16:14:43 | FromGitter | <HJarausch_gitlab> @haxscramper ⏎ I am especially interested in ⏎ ⏎ 1) when is a macro processed ⏎ 2) what if a macro calls another macro ... [https://gitter.im/nim-lang/Nim?at=5fedf8f363fe0344962cf72b] |
16:14:50 | FromDiscord | <Jarred Kenny> /s/subtypes/object varients/ |
16:15:15 | FromGitter | <jrfondren> it's annoying to always get "why not Rust" questions, but it's still worth answering. here's a go: https://nim-lang.moe/on-nim.html#vsrust |
16:15:22 | FromDiscord | <haxscramper> Then go with `ref object of MyObj` and `array[10, MyObj]` |
16:16:09 | FromDiscord | <Jarred Kenny> but then all of the objects won't be continuous in memory |
16:17:15 | FromDiscord | <haxscramper> I haven't read whole article top to bottom, but you can also use interface-like approach |
16:17:34 | FromDiscord | <haxscramper> If you only need to change behavior of the objects |
16:17:41 | * | Torro quit (Quit: bye) |
16:17:59 | FromDiscord | <Jarred Kenny> I guess I don't know enough about c++ interfaces to translate that to nim yet |
16:20:00 | FromDiscord | <William_CTO> `proc foo( query: Option[openArray[(string, string)]] = none(openArray[(string, string)]) )` doesn't work because `invalid type: 'openArray[(string, string)]' in this context`↵How can you make an optional openArray parameter with a default none? |
16:20:57 | FromGitter | <haxscramper> @HJarausch_gitlab `untyped` macro is processed before semcheck, everything else is processed and subject to overload resolution rules https://gist.github.com/haxscramper/8821819221b1d73866e4aed306147f0c |
16:21:10 | FromDiscord | <Jarred Kenny> What would the type layout for this look like? |
16:21:32 | FromGitter | <haxscramper> IIRC all symbols in AST are evaluated repeatedly, until there is nothing left to evaluate |
16:21:58 | FromGitter | <haxscramper> IIUC there is no functional difference between second and third point |
16:23:26 | FromDiscord | <haxscramper> If you have `implCb: proc() {.closure.} # some implementation proc` it's is comprised of pointer to C function and environment stored elsewhere |
16:23:53 | FromDiscord | <William_CTO> I decided to use an overload since I only have one optional arg/parameter |
16:24:32 | FromGitter | <HJarausch_gitlab> @haxscramper Many thanks, I'll have to digest this first. |
16:24:36 | FromDiscord | <haxscramper> Is is that important to have everything aligned in memory? |
16:25:11 | FromDiscord | <Jarred Kenny> in reality no, in theory yes, just trying to wrap my head around nim and ecs |
16:25:33 | FromDiscord | <haxscramper> `openarray` is a not a "type", not without view types, so yes, you can't exactly have `Option[openarray[_]]` now |
16:26:03 | mipri | William_CTO, I don't think it works to make an Option of an openArray at all. You can get a proc with https://play.nim-lang.org/#ix=2KpY , but you can't use it. |
16:26:16 | FromDiscord | <haxscramper> I would recommend just going with inheritance because it closer to what C++ uses and then changing to something else if this is needed |
16:26:29 | FromDiscord | <William_CTO> Thanks, so overloading is the correct way to go |
16:26:59 | FromDiscord | <haxscramper> Although you can just accept `seq[T]` |
16:27:13 | FromDiscord | <exelotl> ahh thank goodness, yesterdays compiler crash was just due to --experimental:views which I'm not actually using yet |
16:27:47 | FromDiscord | <haxscramper> E.g. `openarray` is not exactly necessary if you need `{}` syntax |
16:31:48 | FromDiscord | <demotomohiro> https://play.nim-lang.org/#ix=2Kq1↵This code might help to understand how seq grows |
16:32:42 | ForumUpdaterBot | New post on r/nim by RickyFX: [ADVICE] Is Nim worthy of time to master?, see https://www.reddit.com/r/nim/comments/knt1o7/advice_is_nim_worthy_of_time_to_master/ |
16:34:04 | FromDiscord | <Jarred Kenny> sent a code paste, see https://play.nim-lang.org/#ix=2Kq3 |
16:34:33 | * | PMunch quit (Quit: leaving) |
16:38:43 | FromDiscord | <demotomohiro> No↵Try create a such array and see sizeof(a) |
16:39:06 | FromDiscord | <haxscramper> You forgot `ref object of ...` |
16:44:44 | FromDiscord | <Rika> @jrfondren nim's runnableExamples doesnt count as inline testing? |
16:45:03 | FromDiscord | <Rika> in the blog post you made, it says there isnt any inline testing for nim |
16:46:36 | FromDiscord | <Sorrow> What would this be in Nim? prev = buf[-15 + 1:] |
16:46:52 | Zevv | I don't know what that means |
16:46:54 | FromDiscord | <Rika> prev = buf[-15+1..^1] |
16:47:10 | Zevv | Rika does, though |
16:47:12 | FromDiscord | <Rika> oh, negative |
16:47:13 | FromDiscord | <Rika> uh |
16:47:15 | FromDiscord | <Rika> well |
16:47:19 | FromDiscord | <Rika> you have an issue there |
16:47:25 | FromDiscord | <Sorrow> Fuckballs. |
16:47:27 | Zevv | it's not wrong, Nim arrays can index negative indices |
16:47:36 | FromDiscord | <Rika> i guess its more of buf[0..^14] i think |
16:47:53 | FromDiscord | <Rika> nim slice indexing can handle negatives? |
16:48:16 | Zevv | No, but arrays can have negative indices :) |
16:48:20 | FromDiscord | <Rika> Zevv: wdym does? im pointing out that runnableExamples should count as inline testing but he doesnt mention it |
16:48:33 | Zevv | https://play.nim-lang.org/#ix=2Kq7 |
16:48:33 | FromDiscord | <Rika> well python doesnt have negative indices |
16:48:41 | FromDiscord | <Rika> and thats what he's referencing, python code |
16:48:47 | Zevv | Ah, well, there you have it. |
16:48:50 | Zevv | You knew that, I didn't |
16:49:11 | mipri | see, asking a question based on Python was a waste of time. You should've asked how to get the last N members of an array |
16:49:58 | Zevv | Ah right. buf[^15..^1] is what you want |
16:50:24 | Zevv | might have an off-by-one error, because I'm full of those |
16:51:52 | * | jjido joined #nim |
16:54:33 | planetis[m] | look at that douche https://news.ycombinator.com/reply?id=25594323&goto=item%3Fid%3D25590962%2325594323 |
16:54:52 | * | hmmm quit (Read error: Connection reset by peer) |
16:55:05 | planetis[m] | people can't have an opinion these days |
16:55:22 | FromDiscord | <haxscramper> I remember that one who went full-on about hAtESpeAch AboUt FP In NiM |
16:55:54 | Zevv | Hehe these /are/ kind of douchebags comments tho :) |
16:56:23 | FromDiscord | <Rika> surprise a lot of people are like that |
16:56:28 | Zevv | Meh |
16:57:10 | * | abm quit (Quit: Leaving) |
16:58:24 | mipri | Facebook uses PHP. doteka's argument is invalid. |
16:59:46 | planetis[m] | wonder if he screenshots me and post to a certain platform |
17:03:41 | disruptek | i screenshot you, but just for my own special archive. |
17:04:35 | * | hmmm joined #nim |
17:04:38 | disruptek | holy shit. |
17:04:51 | hmmm | ~disruptesque |
17:04:52 | disbot | disruptesque: 11the art of telling it as it is |
17:04:57 | disruptek | zevv you are such a sweetheart. |
17:05:02 | disruptek | thank you, man. |
17:05:21 | Zevv | least I can do, right |
17:05:35 | disruptek | it's kinda huge, honestly. |
17:06:02 | Zevv | I figured I'm not spending anything on the studio anymore lately, so might as well spend it somewhere else |
17:06:18 | disruptek | why aren't you spending on the studio? |
17:06:26 | Zevv | all closed |
17:06:37 | disruptek | really? |
17:06:39 | Zevv | sure |
17:06:42 | disruptek | i thought you guys were open still. |
17:06:58 | Zevv | nah that's long past. Kids are stuck at home again, all shops closed xpt for supermarkets |
17:07:14 | Zevv | I'm just sitting in my room practicing my bowing |
17:07:15 | disruptek | this is your week off, right? |
17:07:26 | Zevv | 'off' |
17:07:34 | disruptek | did you fix tzevv? |
17:07:42 | Zevv | not yet, you told me to wait |
17:07:51 | disruptek | i did? |
17:08:02 | Zevv | anway, I got it to compile a bit, and most stuff fails with wrong number of invocations |
17:08:14 | disruptek | i think loops are broken. |
17:08:20 | Zevv | seems so |
17:08:26 | disruptek | which is kinda, y'know, bummerific. |
17:08:40 | Zevv | that's what you get from making 76 commits with tests broken |
17:08:54 | Zevv | does it make sense to go back to 0.0.13 and cherrypick what's relevant? |
17:08:56 | Zevv | or is it all? |
17:09:05 | disruptek | no way, we're making progress. |
17:09:55 | disruptek | https://github.com/disruptek/cps/issues/47 |
17:09:56 | disbot | ➥ mutable params and the developers who love them |
17:13:18 | Zevv | oi oi |
17:13:48 | Zevv | can't we just ignore that for now and not allow var args on cps procs? |
17:14:28 | Zevv | how can this even work. The original args might be long gone when things get resumed |
17:14:34 | disruptek | we need a pass that does the rewrite foo -> env(continuation).foo and the question is, where and when. |
17:15:26 | disruptek | but they might not be long gone. |
17:16:24 | Zevv | can we just do one thing at a time |
17:16:34 | Zevv | or do you think that if we skip this, it'll be impossible to put it in later? |
17:16:35 | disruptek | sure. |
17:16:41 | Zevv | because my hunch is to just copy or move stuff into the env |
17:16:44 | Zevv | and be done with it |
17:17:03 | disruptek | well, it's an issue. we have some old ones. |
17:17:10 | disruptek | look at the tock one. |
17:17:19 | Zevv | yeah |
17:17:54 | disruptek | my branch is broken at the moment but i had a lot of stuff working last night. |
17:18:23 | Zevv | do you and mratsim talk? |
17:18:38 | disruptek | he hasn't been around. |
17:18:47 | Zevv | he has worse internet then you until end of januari |
17:18:50 | Zevv | they cut his fiber |
17:19:00 | Zevv | that'll be a nice stretch of deep focus for him I guess |
17:19:09 | disruptek | i went a couple years on 4g; it's pretty rough. |
17:19:28 | Zevv | I went a couple of years on ISDN. That's 64k symmetric |
17:19:35 | disruptek | i need to do ssl bump on my tunnel. |
17:19:41 | FromDiscord | <William_CTO> Is there a way to pretty print an object to the console for debugging? |
17:19:50 | disruptek | i had a 56k frc back in the day. |
17:20:05 | Zevv | disruptek: mosh is a bliss |
17:20:09 | disruptek | isdn was an improvement, but the latency was worse. |
17:20:28 | Zevv | William_CTO: .repr |
17:20:35 | Zevv | echo this.repr, that.repr |
17:20:43 | Zevv | it's not "pretty-pretty" |
17:20:54 | Zevv | like, indenting and all |
17:21:02 | federico3 | 4g with good antennas can be very usable |
17:21:21 | disruptek | it's hard when you're constantly moving around. |
17:21:22 | FromDiscord | <haxscramper> @William_CTO !repo hpprint |
17:21:31 | FromDiscord | <William_CTO> !repo hpprint |
17:21:31 | disbot | https://github.com/haxscramper/hpprint -- 9hpprint: 11Generic configurable pretty-printer with partial auto-layout. Correctly handles unicode text and ANSI escape codes in text. 15 2⭐ 0🍴 |
17:21:42 | Zevv | federico3: problem is that most devices tend to fall back to an idle mode with huge latency, and only pop back up to proper 4G after a certain bandwidth limit is hit |
17:21:47 | Zevv | so for inteactive SSH it can be a PITA |
17:21:58 | FromDiscord | <haxscramper> Absolute abomination, but it should work on anything except for cyclic data structures |
17:22:02 | FromDiscord | <William_CTO> thanks hax |
17:22:02 | disruptek | i had three devices for three different telcos. pita. |
17:22:08 | FromDiscord | <haxscramper> I haven't added support for them yet |
17:22:34 | disruptek | my interactive ssh was better on 4g than it is now. |
17:22:59 | Zevv | I've been working at a company building industrial WWAN modems pretty much from scratch. I know more about these things then I'd like to. In 2020 the de facto interface protocol for all these 2G..5G modems is |
17:23:03 | Zevv | (guess what) |
17:23:09 | Zevv | The Hayes protocol |
17:23:13 | disruptek | lol |
17:23:36 | federico3 | anybody with dual uplink? I have a load-balancing tool for that |
17:24:30 | disruptek | i added a t1 to my frc but i never bothered to multihome it. |
17:25:01 | Zevv | ping @treeform |
17:25:15 | FromGitter | <eagledot> @vindaar you there? |
17:26:00 | FromDiscord | <Vindaar> @eagledot: yup, but only on my phone |
17:26:04 | disruptek | jrfondren: you use nimcr extensively? |
17:26:23 | FromGitter | <eagledot> @vindaar on arraymancer channel too? |
17:27:25 | disruptek | anyone here use nim as a compiled scripting language? i dunno if that even makes sense, but i have a feeling it might, to someone. |
17:27:49 | FromGitter | <jrfondren> dunno about extensively. I use it for some scripts and for some CGI. |
17:28:11 | FromDiscord | <treeform> @Zevv why did you summon me? |
17:28:12 | disruptek | you're on linux, right? |
17:28:20 | FromGitter | <jrfondren> nimcr has the limitation of requiring files ending in .nim but otherwise it's fine. On Linux, yes. |
17:28:32 | disruptek | have you seen this? |
17:28:35 | disruptek | !repo disruptek/dist |
17:28:36 | disbot | https://github.com/disruptek/dist -- 9dist: 11a nim distribution 👑 15 5⭐ 0🍴 |
17:29:01 | disruptek | you might be able to make some meaningful contributions. |
17:29:07 | disruptek | it's a wip. |
17:30:06 | FromDiscord | <treeform> @disruptek it looks like I already did? |
17:30:27 | disruptek | yeah, i'm showing it to jrfondren. 😁 |
17:30:49 | disruptek | i don't mean package contributions, though; i mean designing ways to integrate it. |
17:30:58 | disruptek | packages are easy to add. |
17:31:38 | FromDiscord | <treeform> why include both zip and zippy? |
17:31:47 | FromDiscord | <treeform> and untar |
17:31:58 | disruptek | because other packages require them. |
17:32:03 | FromDiscord | <treeform> zippy can do zip/untar faster then zip/untar can do them |
17:32:05 | FromDiscord | <treeform> ok |
17:32:13 | FromGitter | <jrfondren> eh, the only friction I have with Nim on Linux is that I have all these super old distros, so I need some shell work to make sure Nim sees a modern enough compiler. I'd prefer to bundle the cc into nim somehow. For libraries, nimble works. Or in the only case that it didn't (bad openssl lib), I would've had the same problem later. |
17:33:09 | disruptek | i wrote a shim for zig that is kinda handy for that, but tcc isn't supported well-enough in my experience. |
17:33:23 | disruptek | have you seen this? |
17:33:25 | disruptek | ~gitnim |
17:33:26 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
17:34:00 | disruptek | i mixed it with zig to get a static toolchain. |
17:34:16 | FromDiscord | <haxscramper> disruptek: for gitnim - why did you make a copy of source instead of making `git nim 1.4.2` just clone thing and build them when needed |
17:34:38 | FromDiscord | <haxscramper> I tried it recently because I wanted to use PR something to compiler |
17:34:51 | FromDiscord | <haxscramper> And I'm not sure why but I was expecting something like |
17:34:56 | FromDiscord | <treeform> @disruptek My packages mostly interoperate with each other... not sure how you want to interoperate everything though? |
17:34:59 | disruptek | because i want the artifacts to be the same ones published by nim. |
17:35:07 | disruptek | treeform: why not? |
17:35:28 | disruptek | i'm trying to achieve araq's "batteries included" ideal in a way that makes sense to me. |
17:35:30 | FromDiscord | <treeform> I don't know why, I mean how, what are the mechanics? |
17:35:54 | disruptek | the mechanics are that all the packages live in the same namespace and are "tuned" to the particular compiler version. |
17:35:58 | FromDiscord | <treeform> What does interoperate mean to you? |
17:36:06 | Zevv | treeform: yeah, I was fiddling with adding Oklab (see PR), but wondered what you want in there regarding tests et al |
17:36:08 | FromDiscord | <haxscramper> But if you check out the same commit as one used for building nim artifacts you would get the same results? |
17:36:32 | Zevv | Also I'd like to put the polar form in, but not sure about the nomenclature |
17:36:33 | disruptek | haxscramper: the artifacts are musl-based, and really, you don't get the same results. |
17:37:10 | disruptek | haxscramper: that said, you should fork gitnim and add that feature. |
17:37:15 | disruptek | it's only like 100 lines of code. |
17:37:26 | disruptek | it's /designed/ to be forked. |
17:37:38 | disruptek | i cannot stress that enough. |
17:37:45 | FromDiscord | <treeform> @Zevv okLab looks pretty simple, usually polar just add Polar to the name. |
17:37:58 | FromDiscord | <haxscramper> Just in my head it was something closer to github CLI with nim-specific commands |
17:38:13 | FromDiscord | <treeform> @Zevv ColorLUV -> ColorPolarLUV |
17:38:15 | disruptek | we will build distribution logic into gitnim and then everyone will be able to manage their own distributions trivially. |
17:38:17 | Zevv | k |
17:38:45 | Zevv | you should add a test that actually makes something I can /look/ at though :) |
17:38:48 | Zevv | (diner time) |
17:38:57 | FromDiscord | <treeform> @Zevv there just needs to be a color method on every color space to bring it back to RGBA. |
17:40:04 | FromDiscord | <treeform> @Zevv I would just ask for some thing like this: https://github.com/treeform/chroma/blob/4ae602c816e5b76d8364302f37095d3b0fda023f/tests/test_colors.nim#L179-L205 |
17:40:21 | FromDiscord | <treeform> To make sure colors can convert to and from. |
17:42:10 | FromDiscord | <treeform> @Zevv for polar form some times extra conversion function to take it to polar form and back are required. See: https://github.com/treeform/chroma/blob/4ae602c816e5b76d8364302f37095d3b0fda023f/src/chroma/transformations.nim#L476-L498 |
17:47:07 | FromDiscord | <haxscramper> disruptek: I thought about adding support for distribution-wide documentation generation |
17:47:30 | * | a_chou joined #nim |
17:47:36 | FromDiscord | <haxscramper> Shouldn't be that hard to implement, but will be really useful, at least in theory |
17:47:47 | disruptek | yeah, that's kinda what ndoc is about. |
17:47:50 | FromDiscord | <treeform> disruptek: I think you should add the `ws` web socket package. |
17:48:04 | FromDiscord | <haxscramper> !repo ndoc |
17:48:07 | disbot | https://github.com/nodeca/ndoc -- 9ndoc: 11js port of pdoc, with extentions 15 93⭐ 8🍴 7& 29 more... |
17:48:37 | disruptek | treeform: done! |
17:48:49 | disruptek | !repo disruptek/ndoc |
17:48:50 | disbot | https://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0⭐ 0🍴 |
17:48:51 | FromDiscord | <treeform> disruptek, you should get on discord and we should voice chat some times... |
17:49:11 | disruptek | i don't like to support closed platforms. 🙁 |
17:49:59 | FromDiscord | <treeform> I like to support closed platforms when they are good. 😦 |
17:50:13 | FromDiscord | <haxscramper> good, ndoc/pydoc seems quite close to what I have in mind |
17:50:26 | disruptek | ...if you aren't the customer, you are the product... |
17:51:09 | FromDiscord | <Sorrow> I had to take 1 off the first index to get the same results as my Py script. Was one too many bytes. |
17:51:33 | disruptek | haxscramper: my thinking is that i'll wait until ic is ready and then precompile all files; the result should be fast enough to index with frosty or just operate on directly. |
17:52:59 | FromDiscord | <treeform> disruptek: if you added ws, one would probably need an async db as well, I would add `pg` library. Most of my servers are just `ws`+`pg`. |
17:53:47 | FromDiscord | <haxscramper> I wanted to build on top of nimsuggest-like logic find all uses for particular symbols, precomplile a database and generate nice, searchable examples |
17:53:54 | FromDiscord | <haxscramper> in adddition |
17:53:56 | disruptek | treeform: done. |
17:54:03 | disruptek | would be nice if you'd tag it, though. |
17:54:14 | FromDiscord | <treeform> ok i'll tag it |
17:54:15 | FromDiscord | <haxscramper> to improving overall documentation apprearance, UX and so on |
17:54:16 | disruptek | haxscramper: yeah, let's do that thing. |
17:54:42 | disruptek | we should render the docs for the distribution with hugo or something. |
17:54:49 | disruptek | then we can include them as a submodule. |
17:54:55 | FromDiscord | <treeform> disruptek: looks like pg is tagged? |
17:55:05 | FromDiscord | <haxscramper> Though I decided to write parser for documentation again |
17:55:15 | disruptek | oh, you're right. |
17:55:19 | FromDiscord | <haxscramper> Because current one doesn't cut it in terms of supported features |
17:55:23 | disruptek | i'll point to one of these 0.1.0s. |
17:55:51 | FromDiscord | <treeform> pg is a pretty good lib, no fixes needed in 2 years 🙂 |
17:55:56 | FromDiscord | <haxscramper> Like, I want `@arg{someArg}` and other structured markup parts too that I can exploit for information too |
17:56:49 | FromDiscord | <treeform> @haxscramper have you seen https://github.com/treeform/mddoc ? |
17:57:11 | disruptek | nice, yeah, i like how most of my nim doesn't need rework. almost all my commits are for ci and packaging changes. |
17:57:12 | * | JustASlacker joined #nim |
17:57:15 | FromGitter | <bung87> which lib close to js Inquirer or yeoman or plop ? |
17:57:23 | disruptek | which is annoying as shit, don't get me wrong. |
17:57:31 | * | a_chou quit (Quit: a_chou) |
17:57:54 | FromDiscord | <treeform> Yeah I have a tons of update version, so that I can tag it, so that other lib can use it crap commits.... |
17:58:00 | JustASlacker | happy new year |
17:58:03 | FromDiscord | <haxscramper> No, but it looks relatively similar to what I have in mind |
17:58:06 | FromDiscord | <treeform> Its so hard to live in a web of packages |
17:58:12 | disruptek | it sucks. |
17:58:16 | disruptek | we can do better than this. |
17:58:21 | FromDiscord | <haxscramper> Though I decided to go one level deeper and get all of the information directly from sempass |
17:58:35 | FromDiscord | <haxscramper> Instead of `re`-parsing json files |
17:58:38 | FromGitter | <bung87> dont talk web.. |
17:58:39 | JustASlacker | Im trying to get a process via startProcess and write / read into the streams |
17:58:56 | JustASlacker | var input = inputstream(p) |
17:59:16 | FromDiscord | <haxscramper> And also support literate programming, org-mode style in documentation |
17:59:20 | FromDiscord | <treeform> Parsing json was the easiest thing I could do. |
17:59:44 | JustASlacker | input.write("foo") complains about tpye mismatch |
18:00:04 | disruptek | haxscramper: i wrote a source code filter for literate mode but it was rejected. |
18:00:04 | FromDiscord | <haxscramper> Because next time I have to write `assert "hello" = procThatPrintsHello()` to show output of the code I will jump out of the window |
18:00:44 | * | narimiran joined #nim |
18:01:18 | * | narimiran quit (Remote host closed the connection) |
18:01:21 | disruptek | it's only like 200 lines and it probably still merges green. |
18:01:33 | FromDiscord | <haxscramper> Well, that is part of the reason |
18:01:41 | FromDiscord | <haxscramper> for writing docgen from scratch |
18:01:54 | FromDiscord | <haxscramper> we can do craziest shit |
18:02:11 | disruptek | mostly i want the docgen to magically infer compatability. |
18:02:33 | FromGitter | <jrfondren> JustASlacker: https://forum.nim-lang.org/t/7249#45843 example of that |
18:02:47 | FromDiscord | <haxscramper> Well, if not for that generic caching bug I would've finished tree diffing |
18:03:01 | disruptek | which bug? |
18:03:28 | FromDiscord | <haxscramper> #16128 |
18:03:32 | disbot | https://github.com/nim-lang/Nim/issues/16128 -- 3Changing statement order in generics can cause type mismatches ; snippet at 12https://play.nim-lang.org/#ix=2Kqv |
18:03:37 | FromDiscord | <Beckingham> Anyone know if there's a nim package for converting audio formats? |
18:03:41 | FromDiscord | <haxscramper> We discussed it |
18:03:59 | FromDiscord | <haxscramper> Before I minimized it correctly and realized this is a bug |
18:04:18 | FromDiscord | <treeform> disruptek: what are your thoughts on adding https://github.com/treeform/urlly |
18:04:18 | disruptek | oh, right. |
18:04:20 | * | Arrrrrrrr joined #nim |
18:04:37 | FromDiscord | <haxscramper> Not a showstopper, but at that time I decided to just "scre this, I have other things to do" |
18:04:57 | disruptek | treeform: add whatever you want. you have push, right? i will add this one for you. |
18:05:22 | JustASlacker | jrfondren: thin I just forgot to import *stream* |
18:05:26 | JustASlacker | thx |
18:05:46 | FromDiscord | <haxscramper> And this one is for fuzzy tree diffing - e.g. autodoc for implementation changes. API differencing is even simpler AFAIC |
18:06:08 | disruptek | hmm, that bug is pretty gnarly. |
18:06:44 | disruptek | we have a workaround iirc. |
18:08:13 | * | tane joined #nim |
18:10:11 | disruptek | treeform: yeah, you have a pending invite to dist -- do you need me to resend it? |
18:11:00 | FromDiscord | <treeform> It says `This invitation has expired.` |
18:12:04 | disruptek | schrodinger's invite, i guess. |
18:12:16 | FromDiscord | <treeform> ok accepted |
18:12:36 | FromDiscord | <treeform> now i'll purge my competitors 🙂 |
18:12:44 | disruptek | lol |
18:13:12 | disruptek | i haven't added much from important_packages, but that should keep most dependencies in the namespace. |
18:14:27 | disruptek | i'm working on a gitnim extension that manages the distribution, too. pretty simple. |
18:15:03 | FromDiscord | <treeform> I have a tool to manage my "private" idea of distribution |
18:15:10 | FromDiscord | <treeform> you should have one too |
18:15:20 | disruptek | that's what this is. |
18:15:28 | disruptek | no reason to distinguish between private/public. |
18:36:00 | FromDiscord | <William_CTO> What are the most common licenses used by nim packages? |
18:37:25 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2KqB |
18:38:58 | FromDiscord | <haxscramper> Wrong regex |
18:39:18 | FromDiscord | <haxscramper> But MIT is still leading, then Apache |
18:39:30 | FromDiscord | <haxscramper> Only 73 GPL |
18:56:58 | * | prods joined #nim |
19:08:30 | FromDiscord | <William_CTO> Thank you. I'm trying to run my test with `nimble test` and I keep getting the SSL error. I've tried creating a `test1.nim.cfg` file with `-d:ssl` and I still get the same error. I've also tried putting a similar file in my src directory with the same results |
19:09:05 | FromDiscord | <haxscramper> Use `tests/nim.cfg` |
19:09:23 | FromDiscord | <haxscramper> E.g. `test1.` prefix is unnecessary |
19:09:32 | FromDiscord | <William_CTO> 🤦♂️ |
19:09:46 | disruptek | it's a good idea to name it test1.nim.cfg. |
19:10:04 | disruptek | convention is for package managers to feel free to overwrite nim.cfg wherever they may find it. |
19:11:57 | * | prods quit (Quit: Leaving) |
19:12:13 | FromDiscord | <William_CTO> That didn't work either. `nimble init` creates `config.nims` so I added `switch("d","ssl")` which works |
19:12:59 | FromDiscord | <William_CTO> Although vscode doesn't like the switch statement https://media.discordapp.net/attachments/371759389889003532/794281964617465876/unknown.png |
19:13:14 | disruptek | nimscript is for chumps. |
19:13:25 | FromDiscord | <William_CTO> why xD |
19:14:02 | FromDiscord | <Jarred Kenny> Is it possible to count the fields of an object? Say I have many objects that extend an object, and I want a count of the fields in the object without knowing which of the child types it is. |
19:16:00 | FromDiscord | <haxscramper> Runtime or compile-time& |
19:16:01 | FromDiscord | <haxscramper> ? |
19:17:50 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2KqO |
19:18:17 | * | hnOsmium0001 joined #nim |
19:18:48 | * | JustASlacker quit (Ping timeout: 265 seconds) |
19:18:51 | FromDiscord | <Jarred Kenny> I guess ideally compile time |
19:19:01 | FromDiscord | <Jarred Kenny> thanks |
19:19:01 | FromDiscord | <haxscramper> Then ^ should work |
19:19:12 | FromDiscord | <haxscramper> But this won't work with inheritance of course. But you can store this information when creating new derived object |
19:19:48 | FromDiscord | <Jarred Kenny> oh, okay. so that would only work with variant types? |
19:20:08 | FromDiscord | <haxscramper> no, it will work with any type, |
19:21:03 | FromDiscord | <haxscramper> But if `A` has three fields, and you add two more in `B`, `fields` iterator won't introspect your objects at runtime |
19:21:04 | * | Jesin joined #nim |
19:21:23 | FromDiscord | <juan_carlos> @haxscramper https://github.com/nim-lang/fusion/blob/master/src/fusion/matching.rst#use-example Gives `Error: selector must be of an ordinal type, float or string` |
19:23:04 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2KqQ |
19:24:40 | FromDiscord | <haxscramper> For now you still need to use `{.experimental: "caseStmtMacros".}` |
19:24:55 | FromDiscord | <haxscramper> Though I forgot to add this to documentation |
19:25:50 | FromDiscord | <juan_carlos> Works, but complain of discard'ing its results. :) |
19:26:12 | FromDiscord | <haxscramper> Well, this is a case expression |
19:26:35 | FromDiscord | <haxscramper> it works the same way without any matching |
19:27:48 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
19:28:25 | FromDiscord | <juan_carlos> Cool, yeah I imagined. |
19:28:31 | disruptek | william: because nimscript is 2nd-class citizen and doesn't work in orc, imposes significant performance penalty for evaluation, and the code itself misses critical functionality from proper nim code, creating dialects. |
19:29:01 | federico3 | can ./koch docs be used to convert only one rst file? |
19:29:55 | FromGitter | <iffy> I'm statically linking to libsodium with `passL:libsodium.a` and `dynlibOverride:libsodium` and it works fine when making an executable. But when I try `--app:staticlib` it complains about not being able to find some of the libsodium functions. Can `--app:staticlib` not include other static libs in it? |
19:36:39 | FromDiscord | <fwsgonzo> try --whole-archive it? |
19:37:37 | FromDiscord | <fwsgonzo> it would be done something like this: `passL:--whole-archive passL:libsodium.a passL:--no-whole-archive` |
19:38:01 | FromDiscord | <fwsgonzo> you can still prune unreffed stuff with LTO and (if you really have to) linker GC |
19:43:16 | FromDiscord | <fwsgonzo> most likely your linking order is wrong when you make your program a static lib, so just fixing the order should take care of the undefined references |
19:44:26 | FromDiscord | <haxscramper> @juan_carlos I updated documentation for this example and started follow-up PR draft |
19:44:38 | federico3 | iffy: why statically linking a cryptographic library tho? People might want to receive security fixes |
19:45:05 | FromDiscord | <haxscramper> And also - do you know when updated fusion will be available on playground and when fusion documentation index will be rebuilt? |
19:45:22 | * | not_lum joined #nim |
19:47:27 | * | beatmox quit (Ping timeout: 260 seconds) |
19:47:36 | * | hpyc9 quit (Quit: 420) |
19:47:37 | * | beatmox joined #nim |
19:47:46 | * | hpyc9 joined #nim |
19:48:37 | * | lum quit (Ping timeout: 260 seconds) |
19:49:36 | * | cyraxjoe quit (Ping timeout: 272 seconds) |
20:00:16 | FromDiscord | <juan_carlos> CI builds doc. |
20:04:21 | Zevv | treeform: I'm confused about RGB vs sRGB |
20:11:11 | FromDiscord | <Daniel> should be more colours in sRBG |
20:12:54 | FromDiscord | <juan_carlos> RGB uses colors, sRGB uses colours. |
20:14:00 | FromDiscord | <treeform> what are you confused about? |
20:14:50 | FromDiscord | <treeform> I guess in Chroma, Color is sRGB |
20:21:31 | FromDiscord | <Jarred Kenny> Does anyone know why i get "nvalid type: 'ComponentStore' in this context: 'proc (): Universe' for proc" here? https://play.nim-lang.org/#ix=2Kr4 |
20:23:26 | * | Torro joined #nim |
20:23:41 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2Kr6 you forgot to add generic types |
20:23:53 | FromDiscord | <haxscramper> This error message though |
20:24:49 | FromDiscord | <Jarred Kenny> but I want the ComponentStore table to hold a different type for each entry |
20:25:37 | FromDiscord | <haxscramper> Table only works for two types |
20:25:56 | FromDiscord | <haxscramper> And specializing generic parameters is mandatory |
20:26:30 | FromDiscord | <Jarred Kenny> I guess I need to rethink my approach |
20:27:02 | FromDiscord | <haxscramper> IIUC ECS Is basically almost always OOP |
20:27:45 | FromDiscord | <haxscramper> So I would advise to just go with it unless you have some really specific requirements |
20:29:21 | FromDiscord | <Jarred Kenny> I know, I am still just trying to understand some of the ECS concepts. ECS is defintely not OOP. It's the opposite. |
20:29:51 | FromDiscord | <nikki> ecs is not oop yeah 🤔 |
20:30:24 | FromDiscord | <Jarred Kenny> I am trying to find some datastructure that lets me store contigious arrays of objects of any given type |
20:30:57 | FromDiscord | <nikki> @Jarred Kenny you're kinda on the right track but you can't have a single World type that just has all of the component arrays type erased |
20:31:07 | disruptek | array[pointer] |
20:31:10 | FromDiscord | <nikki> unless you store sth similar to a void pointer and have extra runtime info that gives the tye |
20:31:18 | FromDiscord | <haxscramper> https://github.com/yglukhov/ecs/blob/master/ecs.nim |
20:31:51 | FromDiscord | <haxscramper> And yes, for some reason I was convinced that ECS is some heavyweight OOP concept, sorry |
20:32:00 | FromDiscord | <nikki> @Jarred Kenny entt is a good ecs impl imo that doesn't have the registry need to know all the types |
20:32:02 | FromDiscord | <haxscramper> design pattern |
20:33:31 | FromDiscord | <nikki> i think along ecs lines this is better thought of as one table per component type, with entries in each for entities that have them |
20:34:06 | FromDiscord | <Jarred Kenny> oh, that sounds logical, I just just have things nested backwards |
20:34:14 | FromDiscord | <William_CTO> What are "Exports"? |
20:34:42 | FromDiscord | <nikki> depends on the context probably @William_CTO |
20:34:46 | FromDiscord | <Jarred Kenny> but how do you write that table type :/ |
20:35:01 | FromDiscord | <nikki> Table[T] |
20:35:25 | FromDiscord | <William_CTO> Ok to be honest I'm not sure |
20:35:25 | FromDiscord | <nikki> you're gonna need to type erase it at some level though |
20:35:41 | FromDiscord | <nikki> @Jarred Kenny the entt impl in c++ is very instructive |
20:36:15 | FromDiscord | <nikki> tbh in nim, i would just use metaprogramming shenanigans to register all the types and just have the tables for each type be not type erased |
20:38:07 | FromDiscord | <Jarred Kenny> I'll check it out. Thanks. |
20:41:00 | FromDiscord | <William_CTO> What's the difference between a custom exception of type Exception as seen in https://nim-lang.org/docs/manual.html#exception-handling-custom-exceptions vs one of type CatchableException and when should I favor one over the other? |
20:46:12 | * | l1x joined #nim |
20:46:25 | FromDiscord | <Jarred Kenny> Can you elaborate on this? |
20:46:53 | disruptek | use catchable when you want to be able to catch it. else, use defect. |
20:48:06 | FromDiscord | <nikki> i'm hoping to eventually code this kinda idea myself. i'd wrapped entt in this fame i'm working on; but; it's a bottleneck on the compile time so i wanted to rewrite the ecs in nim 🤔 |
20:48:27 | FromDiscord | <nikki> @Jarred Kenny it's just an idea; i don't really have a detailed answer till i try coding it myself haha |
20:48:35 | FromDiscord | <Jarred Kenny> fair enough! |
20:48:53 | FromDiscord | <nikki> https://github.com/nikki93/ng-public/blob/public/src/types.nim |
20:49:08 | FromDiscord | <nikki> here's an example where i register some component types with the `comp` macro |
20:49:31 | FromDiscord | <nikki> all that stuff is in kernel.nim (just my fancy word for the ecs World) |
20:50:04 | FromDiscord | <nikki> since the types are registered, i could potentially just have a bunch of tables, one per type, and code statically just uses the right table |
20:50:05 | FromDiscord | <Jarred Kenny> What does comp do? |
20:50:35 | FromDiscord | <nikki> registers that type so that i can iterate over types statically whenever later |
20:51:01 | FromDiscord | <nikki> bottom of kernel.nim |
20:52:10 | FromDiscord | <Jarred Kenny> I have so much to learn, this is greek to me. |
20:53:37 | FromDiscord | <nikki> types.nim and then something like player.nim shows the actual use of the ecs |
21:05:06 | FromGitter | <iffy> @federico3 Can people update libsodium on iOS? (this is for iOS) |
21:05:24 | FromGitter | <iffy> I mean, can they install their own dylib to upgrade it? |
21:06:07 | * | Kaivo quit (Quit: WeeChat 2.9) |
21:26:41 | FromGitter | <iffy> I tried those various `passL` flags, but just ended up combining with `libtool` after the fact |
21:33:38 | FromDiscord | <William_CTO> Is it possible to do something like this `range[0..12, 14..20]`? I'd like a range with excluded numbers |
21:37:18 | FromDiscord | <haxscramper> No, it is not possible |
21:46:05 | * | habamax quit (Ping timeout: 240 seconds) |
21:58:06 | * | beatmox quit (Quit: ZNC 1.8.0 - https://znc.in) |
21:59:18 | FromDiscord | <Jarred Kenny> @nikki , not sure about my read from nil, but am I on to something here? https://play.nim-lang.org/#ix=2Krt |
21:59:57 | FromDiscord | <nikki> as soon as i see inheritance / virtual tables i'd say it's probably not really like an ecs impl 😐 |
21:59:59 | * | beatmox joined #nim |
22:00:23 | FromDiscord | <William_CTO> With the help of all of y'all I've made my own library: azure_translate. Do y'all mind looking at the code and providing suggestions? |
22:00:46 | FromDiscord | <nikki> but maybe it's good to keep going, get something working; then be ok with doing another version? @Jarred Kenny |
22:01:21 | FromDiscord | <Jarred Kenny> My thinking there was that components were stored in contigious seqs in a table still |
22:06:00 | * | Lord_Nightmare joined #nim |
22:10:01 | * | vicfred joined #nim |
22:41:28 | * | jjido quit (Quit: Connection closed for inactivity) |
22:44:06 | FromDiscord | <Filipe Duarte> Is it possible to send a message to my email during a scientific computation experiment? Every hour send a summary of my computations. |
22:45:32 | FromDiscord | <Filipe Duarte> (edit) "Is it possible to send a message to my email during a scientific computation experiment? Every hour send a summary of my computations. ... " added "Maybe send the step where the program is." |
22:47:32 | FromDiscord | <Filipe Duarte> I think the question is how to do that |
22:50:04 | FromDiscord | <Filipe Duarte> Maybe create a file and upload to a simple web page |
22:50:28 | FromDiscord | <Filipe Duarte> What's the simple and fast way to do this? |
22:56:07 | FromDiscord | <Filipe Duarte> (edit) Is it possible to send a message to my email during a scientific computation experiment in Nim? Every hour send a summary of my computations. Maybe send the step where the program is. |
23:13:59 | * | l1x quit (Quit: Connection closed for inactivity) |
23:14:02 | FromDiscord | <ElegantBeef> Might be able use the the imap api to do it |
23:15:05 | FromDiscord | <ElegantBeef> Ah my bad dont know email APIs imap cannot send 😄 |
23:15:26 | disruptek | you don't need to send, you just need to add a message. 😉 |
23:15:28 | * | smitop joined #nim |
23:15:33 | disruptek | but, we have native smtp support. |
23:15:43 | disruptek | though it's easier to just call sendmail. |
23:16:15 | FromDiscord | <ElegantBeef> Also nice to see the stdlib shipping things like that |
23:16:53 | disruptek | i would use something else, though. dbus or statds. |
23:16:58 | disruptek | statsd, too. |
23:17:01 | disruptek | !repo nim-metrics |
23:17:02 | disbot | https://github.com/status-im/nim-metrics -- 9nim-metrics: 11Nim metrics client library supporting the Prometheus monitoring toolkit, StatsD and Carbon 15 22⭐ 1🍴 |
23:17:05 | disruptek | !repo deebus |
23:17:06 | disbot | https://github.com/disruptek/deebus -- 9deebus: 11simple sugar over dbus 15 0⭐ 0🍴 |
23:19:43 | * | leorize quit (Ping timeout: 240 seconds) |
23:20:07 | FromDiscord | <ElegantBeef> Depends on what they want, but system notifications or a push notification to their phone is just a better impl |
23:20:39 | disruptek | stay off of my phone, beef. |
23:20:47 | FromDiscord | <Filipe Duarte> I want the fastest |
23:20:49 | FromDiscord | <ElegantBeef> Dude you'd love me on your phone |
23:21:01 | FromDiscord | <Filipe Duarte> kkk |
23:21:01 | FromDiscord | <ElegantBeef> Fastest, it's a notification system, speed isnt a concern |
23:21:15 | disruptek | metrics is faster than dbus. |
23:21:29 | disruptek | it runs in an adjacent thread and pushes udp. |
23:21:47 | FromDiscord | <Filipe Duarte> send to my phone? |
23:21:52 | disruptek | if you want to move complex data, you want dbus. if you just want stage info or whatever, you use metrics. |
23:22:26 | disruptek | i already have rika on my phone. no room for beef. |
23:22:29 | * | leorize joined #nim |
23:22:36 | FromDiscord | <Filipe Duarte> Only info, I'm not concern with saving data during the process |
23:22:49 | FromDiscord | <Filipe Duarte> so, metric |
23:22:52 | FromDiscord | <Filipe Duarte> (edit) "metric" => "metrics" |
23:23:20 | FromDiscord | <ElegantBeef> Well i dont know what you overall desire is, sounded like using emails for notifications |
23:23:50 | FromDiscord | <Filipe Duarte> Notification about the stage of the experiment |
23:27:01 | FromDiscord | <Filipe Duarte> which execution, algorithm iteration, dataset etc |
23:27:41 | FromDiscord | <ElegantBeef> `notify-send` goes brrr 😄 |
23:28:14 | FromDiscord | <Filipe Duarte> with metrics? |
23:28:45 | FromDiscord | <Filipe Duarte> oh it's a package |
23:30:33 | * | Vladar quit (Quit: Leaving) |
23:35:30 | * | JustASlacker joined #nim |
23:52:58 | Prestige | Looks like jester is not 1.0, are there any stable Nim web frameworks? |
23:53:48 | disruptek | nope. |
23:54:01 | Prestige | ah. |