00:24:20 | * | jmdaemon quit (Ping timeout: 252 seconds) |
00:29:53 | * | jmdaemon joined #nim |
01:20:39 | FromDiscord | <rockcavera> sent a long message, see http://ix.io/3REr |
01:20:56 | * | ltriant quit (Ping timeout: 256 seconds) |
01:22:33 | FromDiscord | <rockcavera> It is also not necessary to open cmd with msvc paths, because vccexe.exe already searches and finds the compiler. |
01:58:35 | * | jmdaemon quit (Ping timeout: 256 seconds) |
01:58:50 | * | a12c58 joined #nim |
01:58:57 | a12c58 | hi |
01:59:23 | a12c58 | what language did you use before you used num? |
01:59:27 | FromDiscord | <Elegantbeef> Hello |
01:59:32 | FromDiscord | <michaelb> sent a code paste, see https://play.nim-lang.org/#ix=3REC |
01:59:34 | a12c58 | sorry *nim |
01:59:35 | FromDiscord | <Elegantbeef> I used C# before Nim |
01:59:43 | a12c58 | cool |
01:59:50 | * | krux02 quit (Remote host closed the connection) |
01:59:52 | a12c58 | i am learning python |
02:00:11 | a12c58 | can you use nim in place of it? |
02:00:44 | nrds | <Prestige99> I used typescript and java mostly |
02:00:48 | FromDiscord | <Elegantbeef> Depends on what you're doing, you can do a lot with Nim |
02:01:28 | FromDiscord | <michaelb> In reply to @a12c58 "what language did you": mostly a lot of dynamic langs: JavaScript, Clojure, Racket, some Perl and Python, R, ...↵Nim is the first statically typed compiled lang that I've spent a lot of time with |
02:01:43 | FromDiscord | <Elegantbeef> It's technically capable but depending on your application you may run into ecosystem issues |
02:02:28 | a12c58 | okay i understand |
02:02:50 | a12c58 | are most people from dev ops here? |
02:03:23 | FromDiscord | <Elegantbeef> I'm mostly a pretend gamedev |
02:04:40 | FromDiscord | <michaelb> not formally, but it's landed on me to do some "dev ops" stuff on various projects given my experience with sysadmin stuff, bash scripting, etc. |
02:06:16 | a12c58 | @Elegantbeef gamedev is really creative stuff, cool |
02:07:03 | a12c58 | @michaelb are you part of any open source group? |
02:07:37 | * | jmdaemon joined #nim |
02:13:09 | * | a12c58 quit (Quit: Leaving) |
02:17:15 | * | vicfred quit (Quit: Leaving) |
02:24:39 | * | mal`` quit (Quit: Leaving) |
02:24:52 | FromDiscord | <Girvo> Hi all 🙂 |
02:26:35 | FromDiscord | <gibson> In reply to @a12c58 "are most people from": Academics/Science |
02:26:54 | FromDiscord | <gibson> (edit) "In reply to @a12c58 "are most people from": Academics/Science ... " added "for myself" |
02:27:57 | FromDiscord | <Girvo> @aaa123rc Firmware/IoT service for me |
02:28:27 | FromDiscord | <Elegantbeef> Oh girvo's work is related to IoT guess no more help from me 😛 |
02:28:38 | FromDiscord | <Girvo> Hahaha nothing to do with consumers 😉 |
02:28:52 | FromDiscord | <Elegantbeef> Ah so no IOT gas ranges 😛 |
02:29:10 | FromDiscord | <Girvo> Haha definitely not 😂 |
02:29:31 | FromDiscord | <Girvo> Consumer IoT is basically always a "solution" in search of a problem! |
02:30:09 | FromDiscord | <Elegantbeef> As long as you dont want to put a wifi/bluetooth adapter in my dogs we're fine! |
02:30:15 | FromDiscord | <Girvo> We're building (well, have built) an end-to-end sensor platform for industrial/health applications. Being used by Dubai's health service to track COVID vaccine temperatures, for example |
02:30:19 | * | mal`` joined #nim |
02:30:53 | FromDiscord | <Elegantbeef> Yea i see a lot of it iot stuff as just dumbly designed stuff that encourages bad security practices, like having a oven with a wifi adapter |
02:31:00 | FromDiscord | <Girvo> Yepppppp |
02:31:03 | FromDiscord | <Girvo> Its horrid |
02:32:13 | FromDiscord | <Girvo> Though I'll tell you right now: most industrial/commerical IoT stuff is no better security wise... its one of our points of difference! I've implemented CPace key-exchange to allow us to do _real_ security on some seriously embedded platforms 🙂 |
02:33:13 | FromDiscord | <huantian> when will my covid shot have buzzwords like "zero knowledge" |
02:33:40 | FromDiscord | <Elegantbeef> I'm still waiting for my wifi connection to get better so probably never huantian |
02:33:40 | FromDiscord | <Girvo> Zero-knowledge 5G NFT-linked COVID shots, lets goooo |
02:49:00 | * | neurocyte0917090 quit (Ping timeout: 252 seconds) |
02:59:04 | NimEventer | New post on r/nim by SpookyFries: Is Nim right for me?, see https://reddit.com/r/nim/comments/t96tmn/is_nim_right_for_me/ |
03:05:16 | * | ltriant joined #nim |
03:25:08 | FromDiscord | <retkid> is there a phantom-JS like thing for nim |
03:29:46 | FromDiscord | <retkid> https://github.com/dom96/webdriver |
03:29:48 | FromDiscord | <retkid> i found this |
03:33:46 | FromDiscord | <retkid> alright I don't like this code, I'm going to fashion my own McGiver solution |
03:33:59 | FromDiscord | <retkid> (edit) "McGiver" => "MacGyver" |
03:52:53 | FromDiscord | <Rika> ? |
03:52:58 | FromDiscord | <Rika> What don’t you like here… |
03:55:37 | FromDiscord | <Elegantbeef> Yea what's wrong with the code? |
04:00:47 | FromDiscord | <sheldon> https://near.org/blog/near-announces-800-million-in-funding-initiatives-to-support-ecosystem-growth/ |
04:01:56 | FromDiscord | <sheldon> Good news, we can get through into NEAR core team, and have them allow and try develop in Nim. |
04:02:40 | FromDiscord | <Elegantbeef> ' it will be focusing on Decentralized Finance (DeFi) teams' so crypto bros |
04:03:20 | FromDiscord | <sheldon> Is there any concern? |
04:03:21 | FromDiscord | <Girvo> That webdriver looks pretty good to me: https://github.com/nim-lang/nimforum/blob/7d8417ff97adb646a35dbf93d5e81ae8eaaee148/tests/browsertests/scenario1.nim |
04:03:25 | * | arkurious quit (Quit: Leaving) |
04:04:40 | FromDiscord | <retkid> In reply to @Elegantbeef "' it will be": 😭 |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:13:09 | FromDiscord | <sheldon> Is Nim prohibited to dabble in cryptos? |
04:13:38 | FromDiscord | <michaelb> In reply to @a12c58 "<@383034029135364096> are you part": yes, https://github.com/status-im |
04:14:10 | FromDiscord | <michaelb> which... I guess makes me a crypto bro of sorts 😛 |
04:17:18 | FromDiscord | <Elegantbeef> People can use it for whatever they want↵(@sheldon) |
04:21:28 | FromDiscord | <sheldon> Great, I might need some community support to have them know and consider Nim. |
04:34:56 | FromDiscord | <sheldon> https://media.discordapp.net/attachments/371759389889003532/950612557184516116/unknown.png |
04:56:22 | * | icebattle quit (Remote host closed the connection) |
04:59:39 | FromDiscord | <michaelb.eth> In reply to @sheldon "Great, I might need": Status is a large-ish crypto org and has been using Nim for prototyping and production-quality software for several+ years:↵https://github.com/status-im↵The repos that have names starting with "nim-" are Nim projects (obviously) and there are a few others that aren't named like that but are Nim projects nonetheless |
05:26:44 | FromDiscord | <haoliang> is there a document about undefined behaviors? which i believe are related to nim compiler's runtime checks. |
05:30:15 | FromDiscord | <Elegantbeef> not that i know, but what's the issue?↵(@haoliang) |
05:32:43 | FromDiscord | <haoliang> In reply to @Elegantbeef "not that i know,": i recently found that with `--checks:off` nim compiler will not check bounds, `deque.popLast()` will always return 0 |
05:34:38 | FromDiscord | <Elegantbeef> Ah, perhaps a list needs to be mde |
05:34:43 | FromDiscord | <Elegantbeef> made\ |
05:35:08 | FromDiscord | <Elegantbeef> I mean it's to be expected that "incorrect" code behaves incorrectly |
05:36:19 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3REX |
05:37:15 | FromDiscord | <haoliang> i acutally tried this, it always causes a compiler error. |
05:37:23 | FromDiscord | <Elegantbeef> No it doesn |
05:37:42 | FromDiscord | <haoliang> i was thought that was related to `--rangeChecks` |
05:38:46 | FromDiscord | <Elegantbeef> Checks off disables all runtime checks |
05:38:59 | FromDiscord | <Elegantbeef> rangechecks falls under that |
05:39:26 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3REY |
05:39:52 | FromDiscord | <sheldon> https://gov.near.org/t/dapp-development-in-nim/16381 |
05:45:43 | * | rockcavera quit (Remote host closed the connection) |
05:47:32 | FromDiscord | <haoliang> sent a code paste, see https://play.nim-lang.org/#ix=3RF0 |
05:48:29 | FromDiscord | <Elegantbeef> Worked on mine, what nim version are you using? |
05:49:04 | * | slowButPresent quit (Quit: leaving) |
05:49:17 | FromDiscord | <haoliang> sent a code paste, see https://play.nim-lang.org/#ix=3RF1 |
05:49:36 | FromDiscord | <Elegantbeef> you're compiling with `--checks:off`? |
05:50:23 | FromDiscord | <haoliang> yes |
05:50:36 | FromDiscord | <Elegantbeef> Well it works here |
05:51:48 | FromDiscord | <haoliang> a quick screenshot https://media.discordapp.net/attachments/371759389889003532/950631904015699978/20220308_135057.jpg |
05:52:06 | FromDiscord | <Elegantbeef> You're doing `x = 10` |
05:52:11 | FromDiscord | <Elegantbeef> That's checked at compile time not runtime |
05:53:16 | FromDiscord | <Eshoe> sent a code paste, see https://paste.rs/bnu |
05:54:00 | FromDiscord | <Rika> looks right |
05:54:04 | FromDiscord | <haoliang> oh, i see, thank you! |
05:54:04 | FromDiscord | <Rika> ah no |
05:54:09 | FromDiscord | <Rika> `x: ptr UncheckedArray[cdouble]` |
05:55:42 | FromDiscord | <Eshoe> Alright, got it. Thanks. |
05:57:09 | FromDiscord | <Eshoe> It's a bit odd, because the function worked both as `x: ptr UncheckedArray[cdouble]` and as `x: UncheckedArray[cdouble]`. Can you tell me why? |
05:58:07 | FromDiscord | <Elegantbeef> Damn matrix bridge slowed again |
06:00:27 | FromDiscord | <Elegantbeef> An unchecked array is represented as `Type data[]` in C so if it was a stack allocated collection it'd work |
06:00:36 | * | toulene joined #nim |
06:00:48 | FromDiscord | <Elegantbeef> If it was heap allocated it probably would not look proper, though i could be wrong |
06:01:55 | FromDiscord | <Elegantbeef> I do also think you could use `var cint` and `var cdouble` to make it a bit more idiomatic inside Nim, could be wrong though |
06:02:26 | FromDiscord | <Elegantbeef> Assuming you dont want to nil them and just want to mutate the value they hold |
06:02:50 | FromDiscord | <Eshoe> All the arguments are pointers to memory locations for memory another (parent) process handles. |
06:03:00 | FromDiscord | <Eshoe> (edit) removed "for memory" |
06:03:28 | * | jmdaemon quit (Ping timeout: 272 seconds) |
06:03:42 | FromDiscord | <Elegantbeef> Yea i dont know why the unchecked array worked, the var stuff is still "accurate" though |
06:04:03 | FromDiscord | <Elegantbeef> If you just want a `cint` in a procedure that is mutable `var cint` should be 100% compatible but make the Nim side programming easier |
06:04:13 | FromDiscord | <Elegantbeef> Since a `var` parameter is just a Nim checked pointer |
06:04:55 | FromDiscord | <Eshoe> Interesting, I'll give it a go. Thanks. |
06:06:02 | FromDiscord | <Elegantbeef> Probably rambling, but that only holds if you want to set the data at the pointer and doesnt help if you want to check the pointer(for instance doing a nil check) |
06:06:35 | FromDiscord | <Eshoe> You can assume I do the checks at the parent process level. |
06:07:31 | FromDiscord | <Elegantbeef> Then yea seems like it'd make your life easier |
06:10:17 | * | toulene quit (Ping timeout: 240 seconds) |
06:12:31 | FromDiscord | <Elegantbeef> Also worth noting you should be able to do `for ind, val in x.toOpenArray(0, xLen):` |
06:12:44 | FromDiscord | <Elegantbeef> much cleaner than manually iterating and then indexing the value of the array |
06:13:52 | FromDiscord | <Eshoe> Cool. I'll add to my try list, thanks again! |
06:19:57 | * | ltriant quit (Ping timeout: 240 seconds) |
06:22:43 | NimEventer | New Nimble package! iterrr - iterate faster. functional style, lazy like, extensible iterator library, see https://github.com/hamidb80/steps |
06:26:01 | FromDiscord | <Elegantbeef> @Hamid_Bluri\: `list.filterIt(it mod 2 == 0).mapIt(it 2)` still generates two sequences though, right? |
06:27:27 | FromDiscord | <Elegantbeef> Ah nvm i'm dumb |
06:36:43 | FromDiscord | <Rika> `while being better at: extensibility`? |
06:36:45 | FromDiscord | <Rika> im not sold |
06:40:52 | FromDiscord | <Elegantbeef> Hey they made me quickly wrap my chain implementation |
06:41:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Gg6 |
06:41:35 | FromDiscord | <Elegantbeef> List comprehension eat your heart out! |
06:48:31 | * | koltrast quit (Quit: ZNC - http://znc.in) |
06:55:57 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3RF9 |
06:56:02 | FromDiscord | <Elegantbeef> Yea i got that |
06:56:11 | FromDiscord | <Elegantbeef> I realized you were just demonstrating the probably too late |
06:56:36 | FromDiscord | <Elegantbeef> I thought you had a magical way to filtering/mapping with macro calls |
06:56:45 | FromDiscord | <Hamid_Bluri> LOL |
06:57:31 | * | Zectbumo quit (Remote host closed the connection) |
06:58:38 | FromDiscord | <Hamid_Bluri> In reply to @Rika "`while being better at:": see `istrJoin` in `src/iterrr/reducers.nim` |
07:00:45 | FromDiscord | <fbpyr> so, here (https://yewtu.be/watch?v=4o_tmccinds) I learned, that when I compile a staticlib in nim, if I want to use it, the external caller needs to run `NimMain()` first. (still true?)↵if so, is there a way to have a different name for that entrypoint? I would need my entrypoint to be named `plugin_x64_init` (as this is called by the external application, this dll will be for) but still want to make sure, that the necessary nim machinery |
07:00:50 | FromDiscord | <Rika> i am still unconvinced |
07:01:12 | FromDiscord | <Elegantbeef> With orc/arc it's not required to call `NimMain` unless you have toplevel code |
07:01:42 | FromDiscord | <Hamid_Bluri> In reply to @Rika "i am still unconvinced": eventhough with custom idents? |
07:01:56 | FromDiscord | <fbpyr> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: ah thank you! so it would suffice to use `{.exportc: "plugin_x64_init".}` with the proc then? |
07:01:59 | FromDiscord | <Rika> why does it matter what the idents are called is my opinion? |
07:02:04 | FromDiscord | <Rika> thats barely any benefit |
07:02:11 | FromDiscord | <fbpyr> or would the name be mangled? |
07:02:16 | FromDiscord | <Hamid_Bluri> maybe you wanna iterate over a table |
07:02:26 | FromDiscord | <Elegantbeef> Assuming you compile with arc or orc, and dont need any top level statements you should be fine |
07:02:43 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://paste.rs/7nl |
07:02:43 | FromDiscord | <Elegantbeef> A proc annotated with `exportc` should export with the nim name |
07:03:09 | FromDiscord | <fbpyr> great, thank you! [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) |
07:03:14 | FromDiscord | <Elegantbeef> No problem |
07:03:18 | FromDiscord | <Hamid_Bluri> (edit) "https://play.nim-lang.org/#ix=3RFf" => "https://play.nim-lang.org/#ix=3RFe" |
07:03:20 | FromDiscord | <Elegantbeef> If it doesnt work you'll be able to shout at me |
07:03:24 | FromDiscord | <Rika> maybe i have no use for these |
07:03:26 | FromDiscord | <Rika> its whatever |
07:03:35 | FromDiscord | <Hamid_Bluri> 😄 |
07:03:56 | FromDiscord | <Elegantbeef> Eh i dont know i implemented filter, unpack and map to my chain macro cause i couldnt see a need for anything else operating on a single iterator |
07:04:50 | FromDiscord | <Elegantbeef> being able to do `for it in "hello".unpack(a, b).filter(a > 2).map(ord b): it` for instance |
07:05:03 | FromDiscord | <Rika> im not a functional diehard so prolly aint the target audience |
07:05:12 | FromDiscord | <Elegantbeef> Yea i'm not either |
07:05:33 | FromDiscord | <Elegantbeef> I looked at the library and found the syntax and prefixing with `i` tedious |
07:05:53 | FromDiscord | <Rika> yes |
07:06:16 | FromDiscord | <Elegantbeef> Why do you prefix with `i` anyway? |
07:07:14 | FromDiscord | <Elegantbeef> please dont say to disambiguate 😛 |
07:07:18 | * | ltriant joined #nim |
07:07:20 | FromDiscord | <Hamid_Bluri> to not be confusing with `std/sequtils`↵imap => [i]terrr map |
07:07:41 | FromDiscord | <Elegantbeef> Ok so for no reason |
07:07:51 | FromDiscord | <Hamid_Bluri> kinda 😄 |
07:08:04 | FromDiscord | <Elegantbeef> Nim has module capabilities to disambiguate do not do this in your code, Nim is not C |
07:08:14 | FromDiscord | <Elegantbeef> Atleast that's my view, YMMV |
07:08:38 | FromDiscord | <Hamid_Bluri> agreed |
07:10:02 | FromDiscord | <Elegantbeef> Still really know about using `><` super obscure and unclear |
07:10:22 | FromDiscord | <Elegantbeef> really dont know\ |
07:10:45 | FromDiscord | <Hamid_Bluri> it's really better than `-->` IMO |
07:10:59 | FromDiscord | <Rika> neither is good |
07:11:12 | FromDiscord | <Rika> the intent MIGHT be more clear for --> |
07:11:20 | FromDiscord | <Rika> i would not have understood >< at all |
07:11:44 | FromDiscord | <Elegantbeef> `"hello".pairs.iterWith filter(it[0] mod 2 == 0).map(ord it[1])` |
07:12:16 | FromDiscord | <Elegantbeef> I dont know operators are always weird when there isnt a clear intent |
07:13:14 | FromDiscord | <Hamid_Bluri> does slice `slicerator` have reducer? |
07:13:18 | FromDiscord | <Hamid_Bluri> (edit) "reducer?" => "reducers?" |
07:13:32 | FromDiscord | <Elegantbeef> What's a reducer? |
07:13:38 | FromDiscord | <Rika> probably a fold |
07:14:11 | FromDiscord | <Hamid_Bluri> like `imax` or `iStrJoin` |
07:14:38 | FromDiscord | <Elegantbeef> Well chain is the only thing I have that is really like this |
07:14:40 | FromDiscord | <Rika> so fold |
07:14:43 | FromDiscord | <Elegantbeef> And i only have 3 operations for it so far |
07:15:06 | * | ltriant quit (Ping timeout: 256 seconds) |
07:16:41 | FromDiscord | <Elegantbeef> I'm not much of a FP programmer so I generally use slicerator to empower imperative code |
07:18:00 | FromDiscord | <Elegantbeef> Like i mean i added the `colChain` macro just cause you made me realize i could add it relatively simply |
07:19:11 | FromDiscord | <Elegantbeef> My view is that a lot of the time in Nim when you're doing `filter` or `map` you're just going to operate it on afterwards |
07:19:28 | * | jmdaemon joined #nim |
07:20:06 | FromDiscord | <Hamid_Bluri> In reply to @Elegantbeef "My view is that": for example? |
07:20:22 | FromDiscord | <Hamid_Bluri> i get it |
07:20:35 | FromDiscord | <Hamid_Bluri> (edit) "get" => "got" |
07:20:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3RFk |
07:26:20 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3RFn |
07:26:27 | FromDiscord | <Elegantbeef> lol |
07:27:23 | * | jjido joined #nim |
07:31:44 | * | ltriant joined #nim |
07:36:17 | * | ltriant quit (Ping timeout: 240 seconds) |
07:42:54 | * | toulene joined #nim |
07:44:37 | FromDiscord | <Hamid_Bluri> I have doubt whether I should use `do` or `ido` 😄 |
07:55:48 | FromDiscord | <Rika> Do is a keyword |
07:55:53 | FromDiscord | <Rika> I believe |
07:56:36 | FromDiscord | <Rika> Actually I didn’t bother looking at the implementation of >< so for all I know it’s prolly an untyped macro |
07:56:38 | FromDiscord | <Rika> Whatever |
07:58:58 | * | ltriant joined #nim |
08:19:55 | * | PMunch joined #nim |
08:31:01 | FromDiscord | <Elegantbeef> fbpyr i'm scared of the message you're going to unleash upon us, i've seen you start and stop typing a message for like 40 minutes now |
08:32:07 | FromDiscord | <Rika> Incoming 2000 character essay |
08:32:11 | FromDiscord | <Rika> I’m joking ;; |
08:32:31 | FromDiscord | <fbpyr> sent a code paste, see https://paste.rs/VJ5 |
08:32:42 | FromDiscord | <fbpyr> heheh probably not quite 2000.. 😀 |
08:32:47 | FromDiscord | <Elegantbeef> And your message spawned confetti |
08:32:51 | FromDiscord | <Elegantbeef> 10/10 message |
08:34:27 | FromDiscord | <Elegantbeef> `var res = ucon.get_3d_file_name()` |
08:34:32 | FromDiscord | <Elegantbeef> the issue is that line |
08:35:13 | FromDiscord | <Elegantbeef> `ucon.get3dFileName` is `typedesc[ucon].get3dFileName()` |
08:35:13 | FromDiscord | <fbpyr> yes. somehow it seems to expect the UtilController in a different way.. |
08:35:28 | FromDiscord | <Elegantbeef> It expects an instantiated type |
08:35:36 | FromDiscord | <fbpyr> ah ok |
08:35:46 | FromDiscord | <fbpyr> makes sense! 😌 |
08:35:55 | FromDiscord | <Elegantbeef> It's not a different way, it's expecting a `ptr UtilController` but got a `typedesc[ucon]` |
08:36:20 | FromDiscord | <fbpyr> so I gave it the abstract class but not an instantiated one. |
08:37:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3RFz |
08:37:35 | FromDiscord | <fbpyr> cool! will try that - [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) thank you so much!! |
08:44:41 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=3RFA |
08:47:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:48:26 | FromDiscord | <Elegantbeef> I can see why you thanked me now, i've clearly encouraged the bad behaviour of "why not spend time writing a macro" |
08:49:27 | PMunch | I mean it is kind of addicting.. |
08:49:41 | FromDiscord | <Hamid_Bluri> yeah |
08:49:48 | FromDiscord | <Elegantbeef> hello pmunch |
08:49:51 | FromDiscord | <Hamid_Bluri> i found my self writing macro 50% of the time |
08:49:55 | PMunch | Hello |
08:50:10 | FromDiscord | <Elegantbeef> Speaking of macros, i need more things to add to micros |
08:50:41 | PMunch | A README perhaps? |
08:50:46 | FromDiscord | <Elegantbeef> lol |
08:51:01 | FromDiscord | <Hamid_Bluri> In reply to @Elegantbeef "I can see why": actually, that was kinda saying "thank you" elsewhere |
08:52:43 | FromDiscord | <Elegantbeef> only libraries that are supposed to be used get readmes pmunch |
08:53:01 | FromDiscord | <Elegantbeef> And then what they get is something unhelpful |
08:53:08 | PMunch | Haha :P |
08:53:14 | PMunch | micros looks useful though |
08:53:36 | PMunch | But I still don't get how you are able to create trees without a bunch of type errors.. |
08:54:01 | FromDiscord | <Elegantbeef> What do you mean? |
08:54:12 | PMunch | Well you use distinct types everywhere |
08:54:22 | FromDiscord | <Elegantbeef> Yes |
08:54:34 | PMunch | How can you get and set nodes without having to cast to NimNode everywhere? |
08:54:39 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/nimnodes.nim#L45 |
08:54:43 | FromDiscord | <Rika> I think you guys are insane |
08:54:57 | FromDiscord | <Elegantbeef> I do have to cast to NimNodes everytime |
08:54:58 | PMunch | Aaaah |
08:55:00 | FromDiscord | <Elegantbeef> But only internally |
08:55:07 | PMunch | Damn that's pretty clever actually |
08:55:20 | PMunch | You should add one for [] as well |
08:55:48 | FromDiscord | <Elegantbeef> Eh i should make it so you never need the raw macros api |
08:55:50 | FromDiscord | <Elegantbeef> or hardly ever need it |
08:56:02 | PMunch | Fair enough |
08:56:44 | PMunch | Are you hand-generating all your definitions? |
08:56:55 | FromDiscord | <Elegantbeef> How else would you do it? |
08:56:59 | PMunch | https://github.com/PMunch/macroutils/blob/master/src/macroutils.nim#L530 |
08:57:05 | PMunch | A macro of course :P |
08:57:24 | FromDiscord | <Elegantbeef> I dont see what that solves |
08:57:26 | FromDiscord | <Hamid_Bluri> wow |
08:57:44 | PMunch | Less typing *shrugs* |
08:57:58 | FromDiscord | <Elegantbeef> I need a constructor to a specific NimNode, i cant really do it wildly like that |
08:59:10 | FromDiscord | <Elegantbeef> I mean i'm not hand generating all the types https://github.com/beef331/micros/blob/master/src/micros/routines.nim#L16-L35 stuff like this is being done |
08:59:41 | FromDiscord | <aph> hi, random but: wats the difference between parseStmt and parseExpr |
09:00:25 | FromDiscord | <Elegantbeef> expr expects an expression |
09:00:31 | FromDiscord | <Elegantbeef> So something that has a value |
09:00:40 | FromDiscord | <aph> ooh |
09:00:41 | FromDiscord | <aph> thx! |
09:00:49 | FromDiscord | <aph> so i guess stmt stands for statement |
09:00:52 | FromDiscord | <aph> (edit) "statement" => "statement?" |
09:00:59 | FromDiscord | <Elegantbeef> yep |
09:01:04 | FromDiscord | <aph> :) |
09:02:54 | FromDiscord | <Elegantbeef> Obviously pmunch if I felt macros could solve a problem I'd use them 😛 |
09:05:21 | FromDiscord | <Elegantbeef> I should note I am making a higher level API mostly, so most things hopefully wont be similar to the Nim api |
09:06:03 | FromDiscord | <Elegantbeef> This stuff existing https://github.com/beef331/micros/blob/master/src/micros/identdefs.nim#L15-L17 kinda supersedes manual creation |
09:06:24 | FromDiscord | <Elegantbeef> Yes i need one that takes a NimName |
09:07:31 | FromDiscord | <Elegantbeef> Though I might make a DSL for making a nice `of` operator |
09:09:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3RFF |
09:24:22 | PMunch | Hmm, I see |
09:36:40 | * | toulene quit (Remote host closed the connection) |
09:37:00 | * | toulene joined #nim |
10:01:40 | * | toulene quit (Remote host closed the connection) |
10:01:59 | * | toulene joined #nim |
10:20:16 | * | toulene quit (Remote host closed the connection) |
10:20:28 | * | toulene joined #nim |
10:24:13 | * | jjido joined #nim |
10:24:54 | * | toulene quit (Remote host closed the connection) |
10:40:45 | FromDiscord | <sOkam!> Is there any real difference between result and return? |
10:54:36 | FromDiscord | <Rika> sometimes there is an optimisation that can be done with result but not return |
11:07:31 | FromDiscord | <sOkam!> any examples I should care about, or are they generally not very necessary? |
11:16:09 | FromDiscord | <Waldecir Santos> So I'd like to create an "query-builder" but I'd like to reuse/extend the NimNode object, my question is what is the "correct" way of extending NimNode adding new kinds ? for exemple I'll need new kinds like nnkCustomSelect and etc |
11:16:38 | FromDiscord | <Waldecir Santos> the end goal is to print an `SQL statement` as string. |
11:17:01 | PMunch | sOkam, for the most part you don't have to think about it |
11:17:27 | PMunch | But if you're building up an object just to return it at the end it's probably better to just assign to the result variable instead |
11:27:13 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:36:05 | * | Gustavo6046 quit (Quit: Leaving) |
11:45:41 | FromDiscord | <Phil> In reply to @sOkam! "any examples I should": Imagine you're building a string over time. Instead of returning a variable with that string you can just consistently do `result.add` , something often relevant e.g. for parsing stuff. |
11:45:51 | FromDiscord | <Phil> (edit) "time." => "multiple lines of code." |
11:46:04 | FromDiscord | <Phil> (edit) "," => " at the individual spots that add stuff to the string," |
11:47:44 | PMunch | Or even an object with multiple fields |
11:48:24 | PMunch | Strings you must remember might reallocate anyways, and the stack-allocated data is only a number and a pointer for ARC and just a pointer for the default GC |
11:49:38 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/WohlSoft/SDL-Mixer-X/blob/master/include/SDL_mixer.h↵I want to Futhark this, but it uses a ton of headers, will I have trouble? |
11:50:19 | PMunch | If you have a stack-allocated object (i.e. a non-ref object) however with a lot of fields assigning to those fields and building the object in a variable might cause the ending `return` to copy that entire object from the procedures stack frame over to the callers stack frame. But by assigning to result instead it can enable an optimisation where these field assignments would be assigning directly to the object in the callers stack frame. |
11:50:54 | PMunch | @System64_~_Flandre_Scarlet, nope shouldn't be a problem |
11:52:02 | PMunch | I assume all those headers live in the same folder (probably in the core SDL distribution). In that case simply pass that in with "path" and then tell Futhark to import "SDL_mixer.h" and it should pull in all the required stuff automatically :) |
11:52:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, nope shouldn't be": Ah alright, but the thing is the problem with paths, 'cause of Windows |
11:52:36 | PMunch | Ah yes.. |
11:54:50 | FromDiscord | <System64 ~ Flandre Scarlet> And it will be a ton of work if I have to do it manually |
11:55:02 | FromDiscord | <sOkam!> talking about that, do nim tools tested in linux work by default on windows?↵_(thinking of things like compiling and nimscript in general, since bash scripting is not fully transferable unless cygwin)_ |
11:56:33 | NimEventer | New question by congusbongus: How do I create a mutable reference to an object in another object?, see https://stackoverflow.com/questions/71394618/how-do-i-create-a-mutable-reference-to-an-object-in-another-object |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:06 | FromDiscord | <sOkam!> Can result be aliased to something else? |
12:06:55 | * | supakeen joined #nim |
12:08:36 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/BC3 |
12:10:27 | FromDiscord | <Rika> Remove the last return, using a return like that is not gonna return result |
12:10:46 | FromDiscord | <Rika> Otherwise technically yes, but use addr and not & then r[] = 123 |
12:11:07 | FromDiscord | <Rika> The usual “this is unsafe” warning by the way |
12:16:48 | PMunch | I mean you could do this: https://play.nim-lang.org/#ix=3RGf |
12:18:21 | FromDiscord | <Rika> i still think the return at the end doesnt return result, but im not so sure |
12:18:33 | PMunch | It does |
12:18:39 | FromDiscord | <Rika> really, why |
12:18:44 | FromDiscord | <sOkam!> according to the manual, it says that return is an alias for return result |
12:19:01 | FromDiscord | <Rika> i dont ever remember reading that, might be a new addition |
12:19:03 | PMunch | Since the proc has return type `int` then a `return` without an int argument will return `result` by default |
12:19:29 | FromDiscord | <Rika> i just thought it would return default(T) |
12:19:30 | PMunch | Been like that for quite a while IIRC |
12:20:14 | FromDiscord | <sOkam!> @Rika you were right in that specific example though, since the proc has no type 🤔 https://media.discordapp.net/attachments/371759389889003532/950729652270424134/unknown.png |
12:21:55 | FromDiscord | <Rika> result doesnt make sense without a type though |
12:29:04 | * | jjido joined #nim |
12:58:34 | PMunch | Huh, apparently we have LED-array fidget spinners as merch where I work |
12:58:45 | PMunch | So when you spin them they will show the company took |
12:59:00 | PMunch | Took one apart and there's an ARM Cortex-M3 inside |
13:08:44 | FromDiscord | <Rika> god DAMN that sounds overkill |
13:08:54 | PMunch | Yup :P |
13:09:00 | PMunch | I wonder if it's programmable |
13:11:35 | FromDiscord | <System64 ~ Flandre Scarlet> About Futhark again, is it possible to apply that to an header + C file? |
13:12:07 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/system64MC/Kurumi-fmcomposer/tree/master/src/fmengine |
13:22:24 | PMunch | Yes that is what I do in the example |
13:22:43 | PMunch | That static output and compile part is to compile against a C file |
13:22:59 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright↵But I'll have trouble with Windows paths again :/ |
13:23:16 | PMunch | Easier to just switch to Linux at this point :P |
13:23:32 | FromDiscord | <System64 ~ Flandre Scarlet> I can't leave Windows "cause of school |
13:23:48 | FromDiscord | <System64 ~ Flandre Scarlet> (Visual Studio) |
13:24:17 | FromDiscord | <System64 ~ Flandre Scarlet> But what I can eventually do is a Linux VM |
13:24:38 | FromDiscord | <System64 ~ Flandre Scarlet> or via WSL |
13:24:56 | FromDiscord | <System64 ~ Flandre Scarlet> and then take the binaries |
13:25:00 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "binaries" => "nim files" |
13:25:23 | PMunch | "I can't leave Windows "cause of school"" <- Not with that attitude |
13:25:31 | PMunch | I'm the only one at work who uses Linux |
13:25:40 | PMunch | And all the others use Visual Studio |
13:25:49 | PMunch | But I digress |
13:25:56 | PMunch | We should really fix the paths.. |
13:27:40 | FromDiscord | <System64 ~ Flandre Scarlet> But in fact I want to move to Linux |
13:55:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "We should really fix": Sadly I don't know how to fix thoses paths |
14:01:58 | * | jmdaemon quit (Ping timeout: 256 seconds) |
14:07:22 | * | neurocyte0917090 joined #nim |
14:21:22 | FromDiscord | <Bung> @ElegantBeef Script Error: /users/bung/.choosenim/toolchains/nim-1.6.4/lib/pure/os.nim:812:16 undeclared identifier: 'cmpic' , could you help me with this |
14:22:22 | FromDiscord | <xflywind> In reply to @Bung "<@!145405730571288577> Script Error: /users/bung/.c": It seems to be a known issue: https://github.com/nim-lang/Nim/issues/17051 |
14:22:36 | FromDiscord | <xflywind> and https://github.com/beef331/nimscripter/issues/11 |
14:22:37 | PMunch | @System64_~_Flandre_Scarlet, I think the main problem with these paths is just figuring out how you're supposed to set up paths on Windows with clang |
14:22:58 | PMunch | I could certainly look into it, but without a Windows machine to test it on it's a bit of a pain to figure out if I'm on the right track or not |
14:23:37 | PMunch | I could of course set up a Windows VM or something, but spending time on that means I can't spend my free-time on more interesting projects.. |
14:24:11 | FromDiscord | <Bung> In reply to @flywind "It seems to be": yeah, that's right cause |
14:25:42 | * | neurocyte0917090 quit (Ping timeout: 272 seconds) |
14:28:35 | * | arkurious joined #nim |
14:28:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, I think the": I think Clang is in a good path↵But I think the ``\`` disturbs Futhark, maybe you should escape the ``\`` by doing ``\\`` or something |
14:28:52 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:28:58 | FromDiscord | <System64 ~ Flandre Scarlet> same for spaces, they should be escaped |
14:30:10 | PMunch | Yeah I know what the core issue is, but testing whether a certain fix works or not would be super annoying |
14:30:26 | FromDiscord | <System64 ~ Flandre Scarlet> I understand |
14:30:41 | FromDiscord | <System64 ~ Flandre Scarlet> and can it work under WSL? And then I copy the files |
14:32:07 | PMunch | Well it can, but then clang will see it as a Linux machine, so if the codebase has any checks for which OS its on you will be generating the Linux version |
14:32:29 | PMunch | It's probably a super easy fix in the syspath and path branches here: https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L428 |
14:33:05 | PMunch | Basically those paths and -I parts (which is what is handed to opir and on to clang) should be investigated |
14:33:47 | PMunch | Hmm, I think this might fail on Linux as well if you throw spaces in there |
14:34:04 | PMunch | It's just that people on Linux tend to not use spaces in their paths so I've never run into this issue |
14:37:11 | FromDiscord | <System64 ~ Flandre Scarlet> The backslashes are more problematic |
14:44:47 | PMunch | Using strformat, is there a way to print out X characters of a cstring? |
14:46:36 | FromDiscord | <Rika> not that i know of |
14:56:52 | PMunch | Well this works: http://ix.io/3RGV/nim |
14:58:31 | FromDiscord | <Rika> oh huh i forgot custom stuff |
15:19:44 | * | nisstyre quit (Quit: WeeChat 3.2.1) |
15:41:44 | * | Onionhammer quit (Ping timeout: 250 seconds) |
15:47:56 | * | jkl quit (Quit: Gone.) |
15:49:17 | * | jkl joined #nim |
15:52:13 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3RHv |
15:52:56 | FromDiscord | <enthus1ast> echo time2 - time1 |
15:53:26 | FromDiscord | <d4rckh> i did that already but i get this very long string, i just want it in a shorter format https://media.discordapp.net/attachments/371759389889003532/950783308755796028/unknown.png |
15:53:45 | FromDiscord | <enthus1ast> then you have to format it accordingly |
15:55:18 | FromDiscord | <Rika> echo (time2 - time1).inMilliseconds, "ms" |
15:55:40 | FromDiscord | <d4rckh> thank you! |
15:55:42 | FromDiscord | <Rika> more work needed for autoscaling |
15:56:14 | FromDiscord | <d4rckh> i think i can figure that on my own 🙂 |
16:01:05 | * | nisstyre joined #nim |
16:17:55 | * | Onionhammer joined #nim |
16:37:59 | * | Zectbumo joined #nim |
16:39:24 | FromDiscord | <offray> sent a long message, see https://paste.rs/6LW |
16:46:25 | FromDiscord | <offray> Found it! It was a matter of using `replace` instead of `multiReplace` |
17:01:40 | * | nisstyre quit (Quit: WeeChat 3.4) |
17:02:01 | * | nisstyre joined #nim |
17:07:40 | * | toulene joined #nim |
17:12:00 | FromDiscord | <System64 ~ Flandre Scarlet> is there SDL Mixer bindings for Nim? |
17:12:18 | * | toulene_ joined #nim |
17:12:20 | * | toulene quit (Client Quit) |
17:13:55 | * | slowButPresent joined #nim |
17:14:48 | * | toulene_ quit (Remote host closed the connection) |
17:15:44 | * | toulene joined #nim |
17:15:45 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/nim-lang/sdl2/blob/master/src/sdl2/mixer.nim↵I find the thing |
17:18:12 | FromDiscord | <System64 ~ Flandre Scarlet> Mixer is included by default |
17:19:41 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/WohlSoft/SDL-Mixer-X↵Following the logic, I should be able to port this |
17:21:20 | * | rockcavera joined #nim |
17:21:20 | * | rockcavera quit (Changing host) |
17:21:20 | * | rockcavera joined #nim |
17:24:26 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
17:24:46 | FromDiscord | <Sense> Damn, I wish there was some guides about how to use Nim in creating demoscene stuff |
17:26:11 | * | Lord_Nightmare joined #nim |
17:44:57 | FromDiscord | <retkid> Does it make sense to differentiate different types of computing |
17:45:28 | FromDiscord | <retkid> im searching for a language to learn how to integrate opengl into my programming, I know i can probably do it in Nim but idk if i want to |
17:50:49 | * | toulene quit (Quit: Leaving) |
17:50:54 | FromDiscord | <Require Support> whats equivalent of C variable thats an ` unsigned char ` in nim |
17:51:30 | FromDiscord | <Rika> ptr cuchar |
17:52:19 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3RIb |
17:52:49 | FromDiscord | <enthus1ast> the varargs is the problem |
17:52:57 | FromDiscord | <enthus1ast> withouth varargs (and just one param it works) |
17:53:44 | FromDiscord | <Rika> you dont intend kind and name to also be varargs do you? im not sure |
17:53:54 | FromDiscord | <enthus1ast> nope |
17:53:54 | FromDiscord | <enthus1ast> oh |
17:53:57 | FromDiscord | <enthus1ast> \:) |
17:53:58 | FromDiscord | <Rika> 🙂 |
17:54:08 | FromDiscord | <enthus1ast> gonna fix something real quick |
17:54:47 | FromDiscord | <enthus1ast> thank you @Rika |
18:00:06 | FromDiscord | <enthus1ast> the error is gone, but it does not work as intended, the dyn template should just pass the param (any kind) to the proc from the lib |
18:00:48 | FromDiscord | <enthus1ast> must i write a macro for that? |
18:29:33 | * | krux02_ joined #nim |
18:46:37 | * | lumidify quit (Ping timeout: 240 seconds) |
18:46:53 | * | lumidify joined #nim |
18:48:11 | reversem3[m] | How can I read a binary file and get its size? |
18:48:59 | reversem3[m] | binary file is a compiled file by the way |
18:49:19 | reversem3[m] | sort of how stat works ? |
18:58:46 | * | ox is now known as oz |
19:09:05 | * | joast quit (Quit: Leaving.) |
19:18:14 | * | vicfred joined #nim |
19:22:44 | * | vicfred quit (Ping timeout: 250 seconds) |
19:29:57 | reversem3[m] | How would you find the last position in a binary file using stream |
19:30:33 | reversem3[m] | does it make more sense to calculate the length of binary in hex first? |
19:31:53 | Amun-Ra | reversem3[m]: .setPosition int.high; .getPosition |
19:33:08 | Amun-Ra | there's no (0, SEEK_END) equivalent; as for me - I pass file/whatever length along with the stream |
19:35:35 | reversem3[m] | `var pos = strm.setPosition(int.high.getPosition)` ? |
19:36:05 | Amun-Ra | s.setPosition int.high; let lastpos = s.getPosition |
19:37:06 | Amun-Ra | I haven't tested it tho |
19:41:29 | * | jjido joined #nim |
19:41:42 | reversem3[m] | https://play.nim-lang.org/#ix=3RIx |
19:42:49 | FromDiscord | <Waldecir Santos> Is it possible to extend NimNode with new kinds ? |
19:49:27 | FromDiscord | <ynfle> In reply to @Waldecir Santos "Is it possible to": No. You don't have control over the definition. It's someones code. Unless you add code to the compiler. |
19:49:33 | FromDiscord | <ynfle> What are you trying to do? |
19:50:37 | FromDiscord | <Waldecir Santos> I want to create a SQL/AST parcer, I was trying to reuse NimNode to avoid rebuilding the "same" functionality |
19:51:49 | Amun-Ra | reversem3[m]: https://play.nim-lang.org/#ix=3RIx (iirc s.set_position int.high will clamp position to min(last position, inthigh) |
19:52:38 | FromDiscord | <ynfle> In reply to @Waldecir Santos "I want to create": Well nim's parser won't really help you so much because much sql isn't valid nim syntax |
19:53:17 | FromDiscord | <Waldecir Santos> No I just want the "structure" to store the SQL statements, but yeah I'll need to create one, ty |
19:54:12 | reversem3[m] | yeah thats not working , I'm doing something wrong , var pos = strm.setPosition(line.high .. 5) ? |
19:54:53 | FromDiscord | <ynfle> In reply to @Waldecir Santos "No I just want": The object variant implmentation is probably as lot simpler than the parser |
20:00:19 | FromDiscord | <michaelb.eth> any way to have gorge/Ex show output as it goes along, i.e. instead of capturing it in a variable and displaying it after the cmd finishes? |
20:04:13 | FromDiscord | <auxym> not with gorge, but with any proc that takes `ProcessOption` in std/osproc, you can pass `poParentStreams` |
20:04:36 | FromDiscord | <auxym> it will redirect the subprocess stdio to your app's stdio |
20:05:17 | FromDiscord | <auxym> can't use osproc at compile time (or in nimscript) though |
20:20:56 | * | kayabaNerve joined #nim |
20:30:34 | reversem3[m] | https://play.nim-lang.org/#ix=3RIJ |
20:31:17 | reversem3[m] | Not understand how int.high works since the strm is a string. |
20:32:29 | FromDiscord | <michaelb.eth> In reply to @auxym "can't use osproc at": yeah, I need to do it at compile time 😦 |
20:33:11 | FromDiscord | <michaelb.eth> I guess I can live with a pause + displaying output after gorgeEx finishes |
20:37:12 | FromDiscord | <michaelb.eth> so when dev'ing with Nim on Windows, I like to work in an MSYS2 environment. That's been working really nicely for me for some time. But now that I'm using `gorgeEx` (i.e. compile-time shell command) , I'm having a problem. I think `gorgeEx` is launching cmd.exe, not sure, even though the context in which nimble / `nim c` is invoked is MSYS2 Bash.↵↵Is there a way to control how `gorgeEx` shells out? |
20:47:19 | * | neurocyte0917090 joined #nim |
20:49:57 | FromDiscord | <ripluke> Wait so Nim compiles to c, and then that c is compiled with a c compiler? |
20:51:47 | * | jmdaemon joined #nim |
20:56:13 | FromDiscord | <michaelb.eth> In reply to @ripluke "Wait so Nim compiles": yes, though there are other backends available as well, e.g. "nim compiles to c++" or "nim compiles to javascript" |
20:56:30 | FromDiscord | <michaelb.eth> see: https://nim-lang.org/docs/backends.html |
20:57:00 | * | jmdaemon quit (Ping timeout: 240 seconds) |
21:01:50 | FromDiscord | <auxym> In reply to @michaelb.eth "so when dev'ing with": don't think so, nim's compile-time subprocess facilities are unfortunately pretty limited |
21:06:12 | FromDiscord | <auxym> In reply to @reversem3 "Not understand how int.high": not sure I understand the question. `setPosition` sets the position of the "cursor" in the byte stream. Ie. if you set the position to 3, then the next byte that will be returned by `read` is the third byte, then the 4th, etc. |
21:15:14 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RIW |
21:15:26 | * | Gustavo6046 joined #nim |
21:16:10 | * | Gustavo6046 quit (Remote host closed the connection) |
21:16:31 | * | Gustavo6046 joined #nim |
21:17:36 | FromDiscord | <auxym> In reply to @Require Support "so i have a": you shouldn't need the cast, if `generateFunction` returns a proc that matches the signature of `abcType` then you should be able to do `let abcFunction = generateFunctio(...)` |
21:18:13 | FromDiscord | <auxym> or `let abcFunction: abcType = generateFunction(...)` |
21:20:53 | reversem3[m] | auxym basically I want to read the file convert to hex and only print out the signature which is the last 5 lines |
21:20:58 | FromDiscord | <Require Support> unfortunately i need the cast |
21:22:36 | FromDiscord | <auxym> In reply to @Require Support "unfortunately i need the": why? |
21:23:39 | FromDiscord | <auxym> c interop? |
21:23:44 | FromDiscord | <Require Support> yep |
21:24:46 | * | jmdaemon joined #nim |
21:26:16 | FromDiscord | <auxym> so `generateFunction` is a C function that you're importing? |
21:27:01 | FromDiscord | <auxym> in that case you need to annotate the proc type `abcType` with the correct calling convention, IIRC for C functions it's `cdecl` |
21:27:30 | FromDiscord | <auxym> so `type abcType = proc(letters: string): int {.cdecl.}` |
21:27:50 | FromDiscord | <auxym> but also if it's C then it's probably `cstring` and `cint` rather than the nim types |
21:29:28 | FromDiscord | <auxym> https://nim-lang.org/docs/manual.html#types-procedural-type |
21:30:06 | FromDiscord | <Require Support> but if im going to this process for multiple types and functions, is it possible to turn it into an object and create an array of these objects and just for loop to import the functions 🤔 |
21:32:14 | * | toulene joined #nim |
21:32:33 | FromDiscord | <auxym> I don't think I understand. Do you have an example with the actual for loop and the `importc` stuff? |
21:35:13 | FromDiscord | <hmmm> beefzor u still awake? 🤔 |
21:36:20 | FromDiscord | <auxym> In reply to @reversem3 "auxym basically I": there's many ways to do that, if the whole file fits into ram easily then the easiest way is probably to use `readLine` repeatedly and store all the lines into a seq. Then get the last 5 elements of that seq |
21:39:07 | FromDiscord | <Require Support> sent a code paste, see https://play.nim-lang.org/#ix=3RJ0 |
21:40:56 | FromDiscord | <auxym> I mean, then yeah, I'm not sure what's stopping you. Nim has first class proc types, you can pass them around like any other value |
21:41:00 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3RJ1 |
21:41:03 | FromDiscord | <auxym> @Require Support |
21:41:55 | * | wyrd quit (Ping timeout: 240 seconds) |
21:47:45 | FromDiscord | <morgan> so im working on a library for my own later use and i'd like a way to have a type that holds an array that can be like 1-8 dimensional and of variable size (but fixed size once declared). how should i go about that? |
21:48:50 | * | wyrd joined #nim |
21:49:31 | FromDiscord | <morgan> actually it would be probably be fine to have a different type for each dimensionality |
21:51:02 | FromDiscord | <morgan> so then my question is how to declare a type for an array that is fixed size once declared but can be declared at any size (tho very likely nothing past 64) |
22:05:54 | reversem3[m] | Ok so I put the whole binary file converted to hex into a seq but each line is separate though. Should I put this into a list instead ? |
22:11:00 | reversem3[m] | says I'm getting index out of range but it should be -1 .. 4 https://play.nim-lang.org/#ix=3RJ9 |
22:22:35 | FromDiscord | <Nick.> in nim is there a ror function? |
22:23:27 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:26:12 | FromDiscord | <konsumlamm> not everyone knows what ror means |
22:26:14 | FromDiscord | <konsumlamm> but yes: https://nim-lang.github.io/Nim/bitops.html#rotateRightBits%2CT%2Crange%5B%5D |
22:26:15 | FromDiscord | <auxym> whats ror? |
22:26:28 | FromDiscord | <konsumlamm> ^ see? it's "rotate right" |
22:26:29 | FromDiscord | <auxym> oh |
22:26:36 | FromDiscord | <Nick.> Ah, thanks. I was was looking for ror not for the complete sentence |
23:05:24 | * | jmdaemon quit (Ping timeout: 256 seconds) |
23:09:15 | * | joast joined #nim |
23:10:06 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3RJm |
23:10:44 | FromDiscord | <auxym> it keeps the original line break characters between each line |
23:12:38 | FromDiscord | <auxym> In reply to @MorganAlyssa "so im working on": is that for numerical stuff? did you check out arraymancer, it supports multi-dimensional arrays for number types |
23:15:17 | FromDiscord | <morgan> it's for generating multidimensional color palettes for future game use |
23:18:48 | FromDiscord | <morgan> i considered using nim-glm for colorspace stuff but ended up just writing my own of the math i needed so i could avoid the for loops it had |
23:20:35 | FromDiscord | <auxym> IIRC @mratsim had an implementation for simple strided arrays somewhere... |
23:21:35 | FromDiscord | <Elegantbeef> Well pmunch if interested i ditched the macro idea for checking nodes, and just am using a template now |
23:21:35 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/src/micros/utils.nim#L5-L23 seems swell so far |
23:22:51 | FromDiscord | <auxym> @morgan this https://github.com/SimonDanisch/julia-challenge/blob/b8ed3b6/nim/nim_sol_mratsim.nim#L7-L64 |
23:23:38 | FromDiscord | <morgan> ah cool |
23:23:50 | FromDiscord | <morgan> for now im just using seqs |
23:24:24 | FromDiscord | <morgan> ah so i see |
23:24:31 | FromDiscord | <auxym> nested seqs sounds painful for 8-D though 😄 |
23:24:40 | FromDiscord | <morgan> it's a seq that it turns into whatever dimension |
23:24:45 | FromDiscord | <morgan> yeah |
23:24:50 | FromDiscord | <morgan> i dunno if i'll do 8d |
23:24:55 | FromDiscord | <auxym> yeah, that's the "strided" part |
23:25:12 | FromDiscord | <morgan> yea i had guessed that |
23:25:39 | FromDiscord | <morgan> maybe if i come up with a palette generator concept that outputs that many dimensions i'll do an 8d one, for now just 4d |
23:26:15 | FromDiscord | <morgan> (edit) "4d" => "1-4d" |
23:40:18 | * | Gustavo6046 quit (Remote host closed the connection) |
23:40:36 | * | Gustavo6046 joined #nim |
23:42:09 | * | cyraxjoe quit (Quit: No Ping reply in 180 seconds.) |
23:43:24 | * | cyraxjoe joined #nim |
23:44:06 | * | crem quit (Ping timeout: 252 seconds) |
23:45:04 | * | crem joined #nim |