00:40:17 | * | ineptitude joined #nim |
00:47:51 | FromDiscord | <.maverk> is there any pdf version of the documentation ? |
00:56:42 | * | ineptitude quit (Quit: Leaving.) |
00:59:13 | * | ineptitude_ joined #nim |
01:05:31 | * | ineptitude_ quit (Quit: Leaving) |
01:07:35 | * | ineptitude joined #nim |
01:09:37 | FromDiscord | <Elegantbeef> Araq's answer is "print as pdf" |
01:14:13 | * | ineptitude quit (Quit: client terminated!) |
01:19:48 | * | rockcavera joined #nim |
01:30:00 | * | marcus quit (Remote host closed the connection) |
01:31:48 | * | marcus joined #nim |
01:37:37 | FromDiscord | <rainbowasteroids> sounds about right |
02:44:06 | FromDiscord | <sOkam! 🫐> is there a way to pass `attribute((someflag=val))` to the C side when exporting a function from Nim? |
02:45:50 | FromDiscord | <Elegantbeef> codegendecl |
02:47:15 | FromDiscord | <pk.kyle> do i use asyncnet for chronos or is there something inbuild in chronos? |
02:47:28 | FromDiscord | <Elegantbeef> Chronos has it's own http client |
02:47:35 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "codegendecl": that is SO useful for interop lol. ty! |
02:47:38 | FromDiscord | <pk.kyle> In reply to @Elegantbeef "Chronos has it's own": great! |
02:50:02 | FromDiscord | <Elegantbeef> It also uses bearssl so it's easy to ship |
03:00:16 | FromDiscord | <pk.kyle> how do i create a socket and send/recv messages? |
03:01:17 | FromDiscord | <Elegantbeef> Using? |
03:01:57 | FromDiscord | <pk.kyle> chronos |
03:05:09 | FromDiscord | <Elegantbeef> https://status-im.github.io/nim-chronos/docs/chronos/transports/datagram.html seems this module |
03:05:30 | FromDiscord | <pk.kyle> thx! |
03:05:38 | FromDiscord | <Elegantbeef> That's for udp atleast |
03:06:49 | FromDiscord | <pk.kyle> yeah udp is good for me |
03:26:57 | FromDiscord | <sOkam! 🫐> Is there a way to define the names for `import thing` programatically in some way, from a const earlier in the same file? |
03:26:58 | FromDiscord | <thedistantforest> sent a code paste, see https://play.nim-lang.org/#ix=4ESy |
03:27:27 | FromDiscord | <Elegantbeef> Use a macro to eat your code |
03:27:56 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ESz |
03:28:25 | FromDiscord | <sOkam! 🫐> i was thinking of something simpler than a macro, but i guess that could work 😔 |
03:28:30 | FromDiscord | <Elegantbeef> Since you looke to be writing an ECS some inspiration can be got from https://github.com/beef331/nimtrest/blob/master/yeacs.nim |
03:28:35 | FromDiscord | <Elegantbeef> I mean you want to generate code |
03:28:44 | FromDiscord | <Elegantbeef> To generate code with an input you have to use macros |
03:28:48 | FromDiscord | <thedistantforest> In reply to @Elegantbeef "Since you looke to": ok thanks! |
03:28:54 | FromDiscord | <sOkam! 🫐> yeah, can see that |
03:29:40 | FromDiscord | <Elegantbeef> It's \~500 loc, but it has a bunch ideas that can be taken, it does not use explicit ids for instance, but instead uses Nim's RTTI pointer to distinguish types |
03:29:50 | FromDiscord | <Elegantbeef> This means you can technically use any type you want |
03:30:04 | FromDiscord | <Elegantbeef> Be it an integer, float, bool, string, ... |
03:30:26 | FromDiscord | <Elegantbeef> Though this does mean it does not have persistent IDs |
03:31:43 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Chronos has it's own": I do? 😛 |
03:32:29 | FromDiscord | <Chronos [She/Her]> Hm... Why can't all libs that use asyncdispatch, work with chronos instead? Think someone talked about it |
03:33:11 | FromDiscord | <Elegantbeef> Cause the implementations are different and no one thought to make async procedures generics |
03:34:40 | FromDiscord | <Chronos [She/Her]> Ah rip |
03:34:57 | FromDiscord | <Elegantbeef> @thedistantforest You're planning on making a proper ECS and not a Unity style ECS right? |
03:35:27 | FromDiscord | <Chronos [She/Her]> Is that hard to do? |
03:35:46 | FromDiscord | <Elegantbeef> Is what hard to do? |
03:37:29 | FromDiscord | <thedistantforest> In reply to @Elegantbeef "<@262410914261762050> You're planning on": Yeap, well actually I'm trying to port an existing ecs solution that I'm quite comfortable with |
03:37:31 | FromDiscord | <thedistantforest> https://gitea.moonside.games/MoonsideGames/MoonTools.ECS |
03:38:14 | FromDiscord | <thedistantforest> When i was messing around with lua, it was pretty easy to port there, but was running into to performance issues (probably because I made a quick and dirty port) |
03:40:19 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Is what hard to": ...i actually don't know tbh, making async procedures generic ig? |
03:40:39 | FromDiscord | <thedistantforest> In reply to @thedistantforest "Yeap, well actually I'm": Actually what I was trying to do is the store the type of a component into a hash map like what he has there. But I had no idea how to do that in nim so I settled with using strings 😌 |
03:40:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ESA |
03:40:43 | FromDiscord | <Elegantbeef> Or just generating the id from the type name |
03:40:54 | FromDiscord | <Elegantbeef> You cannot store types at runtime in Nim |
03:41:03 | FromDiscord | <Elegantbeef> Well you kinda can, but you cannot really |
03:41:45 | FromDiscord | <thedistantforest> ok cool, so using string ids is probably an ok first pass solution.. |
03:42:10 | FromDiscord | <Elegantbeef> The lasiest is just using a `pointer` as it's automatically generated |
03:42:28 | FromDiscord | <Elegantbeef> `getTypeInfo` is already implemented and it's a guaranteed unique ID |
03:42:52 | FromDiscord | <thedistantforest> interesting, ok |
03:43:00 | FromDiscord | <thedistantforest> i |
03:43:01 | FromDiscord | <thedistantforest> i' |
03:43:06 | FromDiscord | <thedistantforest> i'll check it out |
03:43:23 | FromDiscord | <Elegantbeef> You also should not store ID on types as it increase the size of the object |
03:43:36 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "...i actually don't know": Would concepts be a useful thing here? |
03:43:43 | FromDiscord | <Elegantbeef> Probably |
03:44:07 | FromDiscord | <Chronos [She/Her]> Wonder why more effort isn't put into this then, oh well |
03:44:34 | FromDiscord | <Elegantbeef> It's a breaking change |
03:44:35 | FromDiscord | <thedistantforest> In reply to @Elegantbeef "You also should not": yeah makes sense |
03:45:18 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "It's a breaking change": True but it'd also lead to better QoL I'd imagine |
03:45:55 | FromDiscord | <Chronos [She/Her]> More libs available for either async impl |
03:46:34 | FromDiscord | <Elegantbeef> Ah the bigger issue now that I think about it is that async is a macro and cannot be used with a generic that way |
03:47:04 | FromDiscord | <Chronos [She/Her]> Ah |
03:47:15 | FromDiscord | <Chronos [She/Her]> I do not understand that at all 😎 |
03:47:27 | FromDiscord | <Elegantbeef> Macros evaluate at declaration not instantiation |
03:47:41 | FromDiscord | <Elegantbeef> As such you cannot have your specific async macro run that generates your specific code |
03:49:14 | FromDiscord | <Chronos [She/Her]> I still don't get it- |
03:49:43 | FromDiscord | <Elegantbeef> The async macro for each library is different, you need to use a different one when you use a different runtime |
03:50:00 | FromDiscord | <Chronos [She/Her]> Okay that makes sense, ty- |
03:50:49 | FromDiscord | <Chronos [She/Her]> Smooth-brain momennt |
04:52:03 | * | cedb quit (Ping timeout: 255 seconds) |
04:53:47 | * | ced1 joined #nim |
04:56:16 | * | ced1 is now known as cedb |
05:28:19 | FromDiscord | <m4ul3r> Is it possible to use `varargs[untyped]` in a proc? |
05:28:28 | FromDiscord | <Elegantbeef> Nope |
05:28:50 | FromDiscord | <m4ul3r> hmm, I' |
05:29:40 | FromDiscord | <m4ul3r> (edit) "I'" => "I'm trying to write one function that handles different amount of args and types, with the logic of handling it in the one func.↵I know I can overload the function, but I'd rather write one and handle what I'm passing in" |
05:30:18 | FromDiscord | <Elegantbeef> Make a macro that takes in varargs[typed] then do everything in there |
05:31:28 | FromDiscord | <m4ul3r> I'm not sure if I can do that since I'm using inline asm |
05:37:21 | FromDiscord | <Elegantbeef> Of course you can |
05:43:51 | FromDiscord | <m4ul3r> When I try, i get Error: cannot generate VM code for asm " |
05:44:01 | FromDiscord | <Elegantbeef> Well what are you doing |
05:44:20 | FromDiscord | <Elegantbeef> You need to return asm not write asm inside the macro |
05:45:49 | FromDiscord | <jviega> Hey beef, when trying to port stuff to Nim 2.0, I'm not comprehending what to do about this one: |
05:45:55 | FromDiscord | <m4ul3r> I'm passing the args and handling with asm |
05:45:57 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4EST |
05:46:10 | FromDiscord | <jviega> Errors on the MkSeq case |
05:46:15 | FromDiscord | <Elegantbeef> Well you're doing it wrong, if you provided what you're doing I could say more |
05:46:20 | FromDiscord | <jviega> `Users/viega/.choosenim/toolchains/nim-2.0.0/lib/system/comparisons.nim(309, 6) Error: '==' can have side effects` |
05:46:29 | FromDiscord | <jviega> I'm working on it 🙂 |
05:46:41 | FromDiscord | <odexine> In reply to @jviega "`Users/viega/.choosenim/toolchains/nim-2.0.0/lib/sy": Oh I hit this issue too some time ago I feel |
05:46:43 | FromDiscord | <jviega> It doesn't have side effects, I went and looked at the code in comparisons.nim |
05:46:44 | FromDiscord | <Elegantbeef> Talking to the other person there jvg |
05:46:55 | FromDiscord | <odexine> Someone naively swapped to func I feel |
05:47:15 | FromDiscord | <Elegantbeef> Yea there is a generic somewhere marked func I think |
05:47:16 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ESU |
05:47:28 | FromDiscord | <jviega> So what's the workaround? |
05:47:53 | FromDiscord | <odexine> I think it doesn’t happen on devel |
05:47:58 | FromDiscord | <Elegantbeef> Define your own `==` comparison for that type |
05:48:10 | FromDiscord | <m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4ESV |
05:48:17 | FromDiscord | <Elegantbeef> Exactly like i said |
05:48:19 | FromDiscord | <jviega> Chronos, that's just a matter of preference. I think people generally have an easier time with more explicit code. |
05:48:20 | FromDiscord | <Elegantbeef> You're not using a macro as a macro |
05:48:27 | FromDiscord | <Elegantbeef> Use the macro as a macro and problem solved |
05:48:46 | FromDiscord | <Chronos [She/Her]> In reply to @jviega "Chronos, that's just a": That's fair, tbf I'd do the same really |
05:48:58 | FromDiscord | <Elegantbeef> A macro has to return AST and does not have a existent function |
05:49:16 | FromDiscord | <jviega> It doesn't have any impact to speed, just to clarity |
05:49:31 | FromDiscord | <Chronos [She/Her]> Yeah I'm aware aha |
05:49:33 | FromDiscord | <Elegantbeef> You can do `proc doThing[T](arg: varargs[T])` if you do not need heterogenous values |
05:50:07 | FromDiscord | <m4ul3r> I had tried that, but my problem is heterogenous types |
05:50:33 | FromDiscord | <Elegantbeef> Well then like i said make a macro that does what your asm did |
05:51:04 | FromDiscord | <Elegantbeef> No you cannot just paste in your asm in a macro you need to construct a `nnkAsmStmt` with the coresponding code inside of it |
05:51:20 | FromDiscord | <m4ul3r> thanks for the advice, i'll have to figure out more about macros. They're pretty confusing to me |
05:52:12 | FromDiscord | <Elegantbeef> Ah yea so only some default `==`s have nosideeffect in 2.0 |
05:52:27 | FromDiscord | <Elegantbeef> `object` is not a func, nor is `openArray` |
05:52:39 | FromDiscord | <Elegantbeef> but `seq[T]` is so if there is a side effect inside an `==` it'll error |
05:53:08 | FromDiscord | <Elegantbeef> You might be able to wrap that body with `{.cast(noSideEffect).}:` albeit ugly it'd get around it |
05:54:07 | FromDiscord | <Elegantbeef> Don't have the error stack in front of me so uncertain where the error is actually bubbling from 😄 |
05:54:18 | FromDiscord | <jviega> I think that's on the list I tried, but I hadn't tried my on comparison |
05:54:24 | FromDiscord | <jviega> I'd tried comparing the pointers |
05:54:47 | FromDiscord | <jviega> Now I'm just recursively decomposing really. It's lame but ok |
05:55:18 | FromDiscord | <Elegantbeef> Nah you do not compare seq pointers |
05:55:18 | FromDiscord | <Elegantbeef> They're value types |
05:55:19 | FromDiscord | <Elegantbeef> Comparison is O(N) |
05:55:31 | FromDiscord | <Elegantbeef> This does matter since of course since you might hash this type, and if your `==` and `hash` do not align, you get incorrect behaviour |
05:56:02 | FromDiscord | <jviega> Well, it depended on the implementation |
05:56:08 | FromDiscord | <jviega> Right |
05:56:25 | FromDiscord | <Phil> In reply to @m4ul3r "thanks for the advice,": Maybe it helps you in terms of understanding as it was an aha moment for me:↵Every piece of Nim Syntax is a fixed pattern of nimnodes.↵All you need to do is figure out what Nim Syntax you want to replicate, look at its pattern e.g. with dumpastgen and have a macro return a nimnode containing the pattern of that syntax |
05:56:27 | FromDiscord | <jviega> I'm all good now, just manually comparing. Don't know why I didn't do that right away |
05:56:41 | FromDiscord | <Elegantbeef> Wait what was the fix? |
05:57:04 | FromDiscord | <Elegantbeef> Stop suggesting dumpastgen in the year 2023, thank |
05:57:07 | FromDiscord | <Elegantbeef> Use `treeRepr` or `dumpTree` |
05:57:17 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4ESY |
05:57:28 | FromDiscord | <Phil> I keep forgetting the tree version, also: nevaaa |
05:57:34 | FromDiscord | <Elegantbeef> Right but that's just `box1.c.s == box2.c.s` 😄 |
05:57:44 | FromDiscord | <jviega> Yeah but that statement fails |
05:57:51 | FromDiscord | <jviega> Because nim thinks it side-effects?? |
05:57:53 | FromDiscord | <Phil> It's imo way better for getting a grasp of the basics |
05:58:03 | FromDiscord | <Elegantbeef> Right and what is the type of `box1.c.s`? |
05:58:07 | FromDiscord | <jviega> seq[Box] |
05:58:24 | FromDiscord | <Elegantbeef> Right so force your proc to have no side effect |
05:58:36 | FromDiscord | <Elegantbeef> So you do not have to reimplement seq comparisons |
05:58:57 | FromDiscord | <jviega> I'll try again, one sec |
05:59:07 | FromDiscord | <Elegantbeef> alternatively do `box1.c.s.toOpenArray(0, box1.high) == box2.c.s.toOpenArray(0, box2.high)` |
05:59:16 | FromDiscord | <Elegantbeef> Since that is not a pure proc |
05:59:59 | FromDiscord | <Elegantbeef> Yea Phil I do not like mentioning it cause it inevitably ends with someone copying the code and using it instead of using `genast` or `quote do` |
06:00:06 | FromDiscord | <jviega> Where's the pragma go in that case? Before the colon I thought?? |
06:00:27 | FromDiscord | <Elegantbeef> If you're casting the body it's a body level pragma |
06:00:33 | FromDiscord | <Elegantbeef> If you're annotating the proc it's before the `=` |
06:01:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ET0 |
06:01:15 | FromDiscord | <Elegantbeef> If the latter doesnt work, the former will |
06:01:23 | FromDiscord | <Phil> I regard dumpastgen in macros like I regard vanilla ja: necessary to learn to get the fundamentals, before you it makes sense to use "higher level tooling" |
06:01:37 | FromDiscord | <Phil> (edit) "ja:" => "js:" |
06:01:47 | FromDiscord | <Elegantbeef> bleh learning to look at treerepr gets the same thing as astgenrepr ime, but meh |
06:01:54 | FromDiscord | <Phil> (edit) removed "you" |
06:01:59 | FromDiscord | <Elegantbeef> Not going to argue |
06:02:59 | FromDiscord | <jviega> The statement level one was the one I'd tried before, that doesn't work (doesn't complain about the bragma but still gives the error), but the later does, believe it or not. |
06:03:07 | FromDiscord | <jviega> So thanks again |
06:03:15 | FromDiscord | <Elegantbeef> Likely just an issue with Nim's func tracking |
06:03:25 | FromDiscord | <Elegantbeef> you can of course just declare it using the `func` keyword instead |
06:05:02 | FromDiscord | <jviega> If it seems to think the base comparison operator for seqs side effects, I'd have expected that to fail?? |
06:05:29 | FromDiscord | <jviega> Anyway, this is good enough, thanks very much |
06:05:38 | FromDiscord | <Elegantbeef> Ah actually It's a known issue with the effects |
06:05:57 | FromDiscord | <Elegantbeef> Since this `==` is recursive and `seq`s require no side effect, it does not mark it func |
06:06:16 | FromDiscord | <Elegantbeef> Cause it doesnt know it's func cause at the point of the seq invokation `==` it's not done analysing the procedure |
06:06:29 | FromDiscord | <Elegantbeef> It's explicitly needed due to the hidden recursion |
06:07:01 | FromDiscord | <Elegantbeef> That's also why the cast does not work |
06:07:11 | FromDiscord | <jviega> Got it |
06:07:33 | FromDiscord | <Elegantbeef> As you cast only the body, when the `seq[Box]`'s`==` is instantiated `Box`'s `==` is marked `proc` |
06:08:50 | FromDiscord | <Elegantbeef> In hindsight it's a pretty reasonable issue, albeit confusing to find |
06:09:48 | FromDiscord | <Elegantbeef> To make it less error prone generic instantiations could be delayed, but that means that all bodies that were not semantically checked would need to be checked after instantiation, and if those have instantiations, they'd have to be delayed..... |
06:10:22 | FromDiscord | <Elegantbeef> Very recursive solution vs. `func` 😛 |
06:20:42 | * | rockcavera quit (Remote host closed the connection) |
06:20:43 | * | ntat joined #nim |
06:32:08 | * | advesperacit joined #nim |
06:34:11 | FromDiscord | <tommy_plug> sent a long message, see http://ix.io/4ET3 |
06:42:48 | FromDiscord | <odexine> oh here too huh |
06:42:50 | FromDiscord | <odexine> <@&371760044473319454> |
06:42:52 | FromDiscord | <arathanis> @technorazor |
06:42:58 | FromDiscord | <arathanis> you beat me to it |
06:43:29 | FromDiscord | <arathanis> also i pinged the wrong person, sorry anosmicoder |
06:43:57 | FromDiscord | <pmunch> Hmm, strange, I had already deleted it on the Matrix side |
06:44:25 | FromDiscord | <odexine> In reply to @arathanis "also i pinged the": lol |
06:47:05 | FromDiscord | <Elegantbeef> Arath calls emergency services then goes "operator, operator I need... uhhh" |
06:47:32 | FromDiscord | <arathanis> > operator, operator, i'd like to order a pizza |
06:48:06 | FromDiscord | <arathanis> the tab complete failed me, i always forget discord keeps role mentions damn near the bottom of the list. it would really rather you ping an individual lol |
06:48:19 | FromDiscord | <arathanis> https://media.discordapp.net/attachments/371759389889003532/1146335572173017128/image.png |
06:55:49 | FromDiscord | <toma400> sent a code paste, see https://play.nim-lang.org/#ix=4ETa |
06:56:32 | FromDiscord | <toma400> (edit) "https://play.nim-lang.org/#ix=4ETa" => "https://play.nim-lang.org/#ix=4ETb" |
06:56:43 | FromDiscord | <Elegantbeef> try `[F, S](p: pair[F, S])` |
06:56:47 | FromDiscord | <toma400> (edit) "https://play.nim-lang.org/#ix=4ETb" => "https://play.nim-lang.org/#ix=4ETc" |
06:56:51 | FromDiscord | <enthus1ast> Elegantbeef\: whats so bad about dumpAstGen? It produces stuff i can copy and paste into a macro |
06:56:56 | FromDiscord | <Elegantbeef> Likely a bug with the implicit generic |
06:57:03 | FromDiscord | <Elegantbeef> It's unmaintainable |
06:57:23 | FromDiscord | <enthus1ast> whats the lazy ass alternative then? |
06:57:31 | FromDiscord | <Elegantbeef> `genast`/`quotedo` |
06:57:48 | FromDiscord | <Elegantbeef> use genast though |
06:59:37 | FromDiscord | <toma400> In reply to @Elegantbeef "Likely a bug with": Would you be so kind to explain shortly what this means in simpler terms?↵I just got into generics, so it fits that my use of it is silly/wrong 😅 |
06:59:54 | FromDiscord | <Elegantbeef> `pair` is an implicit generic |
07:01:01 | * | PMunch joined #nim |
07:01:13 | FromDiscord | <enthus1ast> it could be because i just woke up but i fail to understand beef or, how this is an alternative to "get the ast that produces this nim code in a copy pastable form" |
07:01:43 | FromDiscord | <Elegantbeef> It completely replaces that step |
07:02:35 | FromDiscord | <Elegantbeef> You do not need to have ast procedures in your code, you just have the genast in your macro |
07:18:16 | FromDiscord | <Elegantbeef> As an example https://github.com/beef331/micros/blob/6791af3cacfdf1c098dc404376b09865c1a1d2cc/src/micros/definitions/objectdefs.nim#L55-L68 this is much more readable than the astgenrepr version |
07:33:08 | * | ntat quit (Quit: leaving) |
07:38:10 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/mratsim/constantine/blob/1cb6c3d/constantine/math/arithmetic/assembly/limbs_asm_mul_x86_adx_bmi2.nim#L90-L111↵Nim supports some Assembly? |
08:19:22 | termer | you can inline assembly just like in C |
08:20:12 | termer | It looks like that code might be using macros to do it though |
09:05:49 | * | calebjohn quit (Ping timeout: 250 seconds) |
09:06:15 | * | calebjohn joined #nim |
10:03:42 | * | azimut quit (Ping timeout: 246 seconds) |
10:05:35 | * | azimut joined #nim |
10:16:40 | FromDiscord | <System64 ~ Flandre Scarlet> Wow, pretty powerful! |
10:17:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ETR |
11:34:07 | * | jmdaemon quit (Ping timeout: 245 seconds) |
11:36:21 | PMunch | Hmm, what's the best bignum library out there nowadays? |
11:36:54 | PMunch | I want to overhaul my calculator thing, and floats don't really cut it.. |
11:47:57 | PMunch | Hmm, can't really find anything with support for trig functions.. I guess I could convert to float for those |
11:49:49 | FromDiscord | <odexine> i believe its especially complex to implement those for bignums |
11:49:57 | FromDiscord | <odexine> or rather true-decimals |
11:50:21 | PMunch | I did find MAPM, which seems to be exactly what I need, but it seems to have died.. I pretty much only find archive.org links like this one: https://web.archive.org/web/20161218111256/http://www.tc.umn.edu/~ringx004/article-main.html |
11:51:12 | PMunch | Fair, I believe the trig functions are often table-lookup + interpolation anyways, so precision won't need to be great |
11:51:34 | FromDiscord | <odexine> are you looking for arbitrary precision or just better than floats? |
11:54:29 | PMunch | Well really just better than float. But since I'm doing a complete rewrite anyways I figured I could go all the way |
12:02:21 | FromDiscord | <t0ngub1n> sent a code paste, see https://play.nim-lang.org/#ix=4EUe |
12:12:44 | FromDiscord | <mratsim> In reply to @PMunch "Well really just better": mpdecimal. |
12:12:57 | FromDiscord | <mratsim> The state of bignum in Nim is pretty sad at the moment |
12:13:08 | FromDiscord | <mratsim> I know how to fix it but I have no time. |
12:14:25 | FromDiscord | <mratsim> Ah there is a full native conversion by JohnAD that is WIP |
12:14:34 | FromDiscord | <mratsim> But I was thinking of wrapping this: https://github.com/status-im/nim-decimal/blob/master/LICENSE-BSD-mpdecimal |
12:14:42 | FromDiscord | <mratsim> (edit) "https://github.com/status-im/nim-decimal/blob/master/LICENSE-BSD-mpdecimal" => "https://github.com/status-im/nim-decimal" |
12:15:18 | FromDiscord | <System64 ~ Flandre Scarlet> Where can I know there is a deep copy going on? https://media.discordapp.net/attachments/371759389889003532/1146417860156076102/message.txt |
12:16:14 | PMunch | Yeah I looked at mpdecimal, but it didn't have trig functions (which again isn't a big problem, but MAPM supports them) |
12:16:26 | PMunch | Playing around with MAPM through Futhark now, seems to work pretty well |
12:17:01 | PMunch | t0ngub1n, did you run finish.exe after installing Nim? |
12:17:04 | FromDiscord | <mratsim> In reply to @PMunch "Hmm, can't really find": You can search for Pade approximant or Rehmer (?) polynomials for approximating trigonometric function with arbitrary precision |
12:17:26 | PMunch | mratsim, sure but that's more work, and I risk getting it wrong |
12:17:35 | FromDiscord | <mratsim> All the SIMD libraries use that or table based interpolation |
12:18:28 | FromDiscord | <odexine> oh ive recently learned about pade approx |
12:18:29 | FromDiscord | <odexine> p cool |
12:34:39 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EUk |
12:34:50 | FromDiscord | <System64 ~ Flandre Scarlet> (PlayerORM are ref objects) |
12:37:46 | FromDiscord | <System64 ~ Flandre Scarlet> I'm afraid it leads to unexpected results, so bugs |
13:37:02 | * | cedb quit (Ping timeout: 245 seconds) |
13:39:07 | * | ced2 joined #nim |
13:45:10 | * | advesperacit quit () |
13:48:43 | FromDiscord | <t0ngub1n> In reply to @PMunch "<@789234515268599818>, did you run": yes |
13:49:09 | FromDiscord | <t0ngub1n> (edit) "yes" => "yes, i did" |
13:52:54 | PMunch | That should've installed all dependencies. Maybe your AV deleted some of them? |
13:53:36 | * | rockcavera joined #nim |
13:58:48 | FromDiscord | <t0ngub1n> no, it did not |
13:58:54 | FromDiscord | <t0ngub1n> the error is clearly in ld |
13:59:00 | FromDiscord | <t0ngub1n> or libraries |
13:59:16 | FromDiscord | <t0ngub1n> clang also says that "thread-local storage is not supported for the current target" |
14:00:00 | FromDiscord | <t0ngub1n> so maybe that |
14:00:27 | PMunch | Could you run gcc --version and clang --version? Just curious |
14:00:44 | PMunch | And does this happen with all Nim code? Even just a simple hello world program? |
14:00:46 | * | PMunch quit (Quit: Leaving) |
14:01:03 | FromDiscord | <t0ngub1n> yes, even with hello world |
14:02:17 | FromDiscord | <t0ngub1n> sent a code paste, see https://play.nim-lang.org/#ix=4EUI |
14:08:24 | FromDiscord | <t0ngub1n> has anyone encountered such a problem b4? |
14:22:44 | FromDiscord | <burnysc2> sent a code paste, see https://play.nim-lang.org/#ix=4EUS |
14:31:21 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EUV |
14:43:37 | * | ced2 is now known as cedb |
14:47:34 | FromDiscord | <Chronos [She/Her]> @burnysc2 I have a solution for ya, it uses generics! Let me send it rq |
14:48:30 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EV2 |
14:48:57 | FromDiscord | <burnysc2> In reply to @chronos.vitaqua "<@121948437796093952> I have a": Thanks but I've already solved it by replacing `proc step` with `method step`, that worked for me |
14:49:10 | FromDiscord | <burnysc2> Was a hard find in the manual |
14:49:12 | FromDiscord | <Chronos [She/Her]> By using generics, we don't lose the original type data, letting `step` from b.nim run, if that makes sense? |
14:49:35 | FromDiscord | <Chronos [She/Her]> Ah fair aha, if you wanna avoid dynamic dispatch this may help anyway, wish ya luck! |
14:50:33 | FromDiscord | <burnysc2> I think your solution may come in handy in the future for me, so thank you!↵Here `T` has be or inherits from the `type Bot` ? |
14:51:53 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EV4 |
15:04:36 | FromDiscord | <Chronos [She/Her]> In reply to @burnysc2 "I think your solution": Of course! Also T has to inherit from `Bot`, yeah |
15:06:37 | FromDiscord | <sOkam! 🫐> If I build from a host linux system, for a windows system with cross-compilation...↵does the value of `hostOS` change to windows? |
15:06:51 | FromDiscord | <sOkam! 🫐> (edit) "windows?" => "windows in the resulting binary?" |
15:08:41 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EVe |
15:11:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "except CatchableError as error:": https://media.discordapp.net/attachments/371759389889003532/1146462234625720381/image.png |
15:12:08 | FromDiscord | <griffith1deadly> echo error[] |
15:12:25 | FromDiscord | <burnysc2> sent a code paste, see https://play.nim-lang.org/#ix=4EVf |
15:12:57 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/jMcbM |
15:13:08 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4EVh |
15:13:27 | FromDiscord | <jviega> From where? |
15:13:33 | FromDiscord | <jviega> Depends a great deal |
15:13:41 | FromDiscord | <jviega> Because nimscript runs on rosetta |
15:13:48 | FromDiscord | <jviega> So it'll always answer amd64 |
15:13:52 | FromDiscord | <sOkam! 🫐> cross-compiling |
15:14:06 | FromDiscord | <sOkam! 🫐> (edit) "cross-compiling ... " added "a binary" |
15:14:11 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4EVi |
15:14:29 | FromDiscord | <jviega> Here's what I use in config.nims: |
15:14:35 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4EVj |
15:14:41 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EVk |
15:15:52 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4EVl |
15:16:28 | FromDiscord | <jviega> Correct, as far as nimscript is concerned, it's running on x86 any time it's on a mac as far as I can tell. It's getting the answer it gets from the machine because it's running in a Rosetta VM |
15:16:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "check your variables for": You mean my code string? |
15:16:58 | FromDiscord | <sOkam! 🫐> In reply to @jviega "Correct, as far as": that saves me a lot of hours of headaches, ty so much man ❤️ |
15:17:04 | FromDiscord | <jviega> My approach there always detects the underlying platform. It doesn't try to use the underlying compiler, since you'd always get the one in your VM |
15:17:11 | FromDiscord | <griffith1deadly> In reply to @sys64 "You mean my code": no, all variables for accessing db↵looks like someone get null |
15:17:27 | FromDiscord | <jviega> Yeah, no worries |
15:18:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "no, all variables for": I'm using a connection pool so it shouldn't be null |
15:18:17 | FromDiscord | <jviega> The targetStr there is as you would pass to the compiler/linker if you need to pass it for anything (usually linking 🙂 |
15:19:16 | FromDiscord | <jviega> From within your actual binaries, the testing you did above is right. |
15:19:30 | FromDiscord | <griffith1deadly> In reply to @sys64 "I'm using a connection": you get null in select statement |
15:19:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "no, all variables for": My GameORM object is not null |
15:20:32 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EVn |
15:22:23 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EVo |
15:23:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "try echo in withDbConn": So after con.select? |
15:23:22 | FromDiscord | <griffith1deadly> yes |
15:24:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "yes": Not displayed |
15:25:12 | FromDiscord | <griffith1deadly> try before |
15:26:10 | * | deadmarshal_ quit (Quit: IRCNow and Forever!) |
15:26:20 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "try before": displayed |
15:26:31 | FromDiscord | <griffith1deadly> In reply to @sys64 "displayed": not nil? |
15:26:41 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4EVq |
15:27:00 | FromDiscord | <sOkam! 🫐> I'm not compiling on mac, don't even have access to one, so I cannot afford to do that type of thing |
15:27:55 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "not nil?": Not nil |
15:29:39 | FromDiscord | <griffith1deadly> In reply to @sys64 "Not nil": then error in nil obj variables↵https://github.com/moigagoo/norm/blob/develop/src/norm/model.nim#L108 |
15:30:05 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://paste.rs/oBJtX |
15:30:26 | FromDiscord | <Chronos [She/Her]> In reply to @burnysc2 "I got your version": Ah that's not how you're supposed to use the generic step- |
15:30:40 | FromDiscord | <griffith1deadly> (edit) "variables↵https://github.com/moigagoo/norm/blob/develop/src/norm/model.nim#L108" => "variables↵https://github.com/moigagoo/norm/blob/develop/src/norm/model.nim#L106" |
15:31:04 | FromDiscord | <Chronos [She/Her]> The generic is supposed to call the underlying proc (so `proc step(bot: CustomBotVariant)`) |
15:31:16 | FromDiscord | <Prestige> Is there a way to have an object variant where a property exists for 2 different "kinds" but not all of them? |
15:31:32 | FromDiscord | <Chronos [She/Her]> The point of the generic is that it's not going to follow one specific code path- |
15:31:54 | FromDiscord | <terrygillis> Hi is there anyway to get a mutable reference from a seq? |
15:31:55 | FromDiscord | <Chronos [She/Her]> In reply to @burnysc2 "I got your version": The code I sent should replace `a.nim` completely aha- |
15:31:58 | FromDiscord | <terrygillis> By that I mean |
15:32:30 | FromDiscord | <terrygillis> a function for seq that returns a ‘var T’ for element in seq |
15:32:45 | FromDiscord | <terrygillis> [] returns a lent |
15:32:53 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EVs |
15:32:57 | FromDiscord | <terrygillis> which is not mutable |
15:33:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "then error in nil": FINALLY PROBLEM SOLVED !↵Child objects must not be nil |
15:33:53 | FromDiscord | <Chronos [She/Her]> In reply to @terrygillis "which is not mutable": Does `mitems` exist for sequences? |
15:34:16 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "Ah that's not how": @burnysc2 |
15:34:53 | FromDiscord | <burnysc2> In reply to @chronos.vitaqua "The code I sent": Ohh, I will try that in a sec |
15:35:38 | FromDiscord | <Chronos [She/Her]> Good luck ^^ |
15:36:13 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "What are you trying": allowing to compile for both mac.x86 and mac.arm |
15:38:10 | FromDiscord | <terrygillis> In reply to @chronos.vitaqua "Does `mitems` exist for": Btw can I get rich text for discord mobile, because currently I can’t put in new lines or code in the chat box on the mobile app. |
15:38:23 | FromDiscord | <Chronos [She/Her]> Ah wait... @terrygillis your issue is that the sequence itself does not seem to be mutable? |
15:38:27 | * | xet7 joined #nim |
15:39:27 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EVv |
15:39:36 | * | edr joined #nim |
15:40:11 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/McI2A |
15:40:17 | FromDiscord | <odexine> sent a code paste, see https://paste.rs/ZvjVW |
15:40:27 | FromDiscord | <Chronos [She/Her]> Oh did I misunderstand it? F |
15:40:58 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "allowing to compile for": What's the point of the command? |
15:45:04 | FromDiscord | <Prestige> Is there some way to do this? https://play.nim-lang.org/#ix=4EVw↵Note the duplicate `t` variable |
15:45:27 | FromDiscord | <jviega> @sOkam! 🫐 That command will exec a process, but Rosetta is a VM, so the command runs in the VM |
15:45:42 | FromDiscord | <jviega> And how it responds tells us what arch we're really on |
15:46:01 | FromDiscord | <jviega> It's the only easy way I know from within the VM to determine if you're in the VM or not. |
15:47:55 | FromDiscord | <enthus1ast> @Prestige\: no unfortunately not |
15:48:27 | FromDiscord | <enthus1ast> there are a few discussions about this though |
15:49:00 | * | deadmarshal_ joined #nim |
15:49:57 | FromDiscord | <sOkam! 🫐> In reply to @jviega "It's the only easy": but how do you do that from windows or linux? |
15:50:02 | FromDiscord | <sOkam! 🫐> i don't have a mac |
15:50:28 | FromDiscord | <jviega> huh? If you're compiling on windows for a mac?? |
15:50:37 | FromDiscord | <sOkam! 🫐> hardcoding `--cpu:arm64` forces the value of `hostCPU` afaik |
15:50:39 | FromDiscord | <jviega> If you're doing that, build two binaries |
15:50:54 | FromDiscord | <sOkam! 🫐> In reply to @jviega "huh? If you're": yeah, from linux for all system |
15:50:59 | FromDiscord | <sOkam! 🫐> (edit) "for" => "for/to" |
15:51:00 | FromDiscord | <enthus1ast> @Prestige\: here is one https://github.com/nim-lang/RFCs/issues/368 |
15:51:13 | FromDiscord | <jviega> Universal binaries on Mac are actually two binaries ZIP'd together basically. |
15:51:37 | FromDiscord | <sOkam! 🫐> yeah but i don't want to build two things and have to link them myself |
15:51:49 | FromDiscord | <sOkam! 🫐> this buildsystem has enough bs how it is |
15:51:54 | FromDiscord | <Prestige> Ty |
15:52:43 | FromDiscord | <jviega> Well then you have what you need for making it easy for people to build with the right libs and flags on a mac |
15:52:58 | FromDiscord | <jviega> hostOs and hostCPU should be good enough everywhere else |
15:53:17 | FromDiscord | <sOkam! 🫐> but im not telling mac people "hey, to play my game, first install nim and compile it and then figure out how to run it and everything" |
15:53:29 | FromDiscord | <jviega> Then you'd better build on a mac? |
15:53:37 | FromDiscord | <sOkam! 🫐> or just use zigcc? |
15:53:52 | FromDiscord | <sOkam! 🫐> zigcc builds for all systems, and it runs well. i tried it. but never gave support for arm |
15:53:57 | FromDiscord | <sOkam! 🫐> so i havent tested that part |
15:53:59 | qwr | if they compile, why not build for specific arch? i.e. not use the universal binary |
15:54:12 | FromDiscord | <sOkam! 🫐> In reply to @qwr "if they compile, why": yeah that's what im doing |
15:54:15 | FromDiscord | <jviega> You could cross-compile, but you're going to have linking issues everywhere if you don't statically link, so you need .a's for everything wherever you're compiling |
15:54:34 | FromDiscord | <sOkam! 🫐> (edit) "doing" => "doing↵the idea is finding which is running from the compiler so it can link the correct file/flags" |
15:54:36 | FromDiscord | <jviega> And cross-compiling is more likely to have issues |
15:55:14 | FromDiscord | <sOkam! 🫐> In reply to @jviega "You could cross-compile, but": is that true if im only depending on libc and that is figured out by zigcc? |
15:55:14 | FromDiscord | <jviega> So I don't know what you're still looking for. I gave you everything you need to know, and then it's just a matter of what's right for you in terms of where and how to build |
15:55:19 | FromDiscord | <sOkam! 🫐> the rest of my libs are all static |
15:55:39 | FromDiscord | <jviega> If they're static you need to link in the static versions for those platforms. |
15:55:47 | FromDiscord | <jviega> That's exactly what I'm saying |
15:55:56 | FromDiscord | <sOkam! 🫐> In reply to @jviega "So I don't know": i was just asking because what you sent is for building -from- a mac. and i don't have one. so was looking for alternative |
15:56:15 | FromDiscord | <sOkam! 🫐> In reply to @jviega "If they're static you": yeah i figure |
15:56:15 | FromDiscord | <jviega> For what??? |
15:56:21 | FromDiscord | <sOkam! 🫐> you bring agood point though |
15:56:31 | FromDiscord | <jviega> You have someone pass a flag to tell you what arch to build for if you're cross-compiling |
15:56:40 | FromDiscord | <jviega> I don't get why that requires anything special |
15:57:14 | FromDiscord | <sOkam! 🫐> i was asking because the snippet does `staticExec` and that relies on the buildsystem running on a mac mandatory |
15:57:46 | FromDiscord | <jviega> That's because the snippit detects the underlying OS even though nimscript always runs in the vm |
15:57:50 | FromDiscord | <enthus1ast> @sOkam! 🫐\: i would create nimble tasks for all the architectures you wanna support |
15:57:57 | FromDiscord | <jviega> That's what it sounded like you were asking |
15:57:59 | FromDiscord | <enthus1ast> then just call the correct compiler \:) |
15:58:09 | FromDiscord | <jviega> If you want to build on a mac and get the right architecture, that's how you do it |
15:58:16 | FromDiscord | <jviega> No matter who is building |
15:58:37 | FromDiscord | <jviega> If you want to cross-compile, cross-compile |
15:58:46 | FromDiscord | <jviega> That's what the --arch flag is for |
15:59:13 | FromDiscord | <sOkam! 🫐> In reply to @enthus1ast "<@186489007247589376>\: i would create": thats not the issue. the problem is understanding which system is being built from the file, so i can conditionally import each correct set of flags↵we are talking 60-70 variants... so manually writing nimble tasks for each is out of question fully |
15:59:48 | FromDiscord | <sOkam! 🫐> kk ty jtv |
15:59:53 | FromDiscord | <enthus1ast> i've done cross cross compilation like this\: https://github.com/enthus1ast/nimDownloadGrist/blob/master/nimGristDownload.nimble |
16:00:23 | FromDiscord | <sOkam! 🫐> In reply to @enthus1ast "i've done cross cross": does `--cpu` change the value of `hostCPU`? |
16:00:28 | FromDiscord | <sOkam! 🫐> because that was my original question |
16:00:45 | FromDiscord | <sOkam! 🫐> I reworded it because it seem to not be understood |
16:01:05 | FromDiscord | <sOkam! 🫐> or nobody knew, one of those |
16:01:48 | FromDiscord | <jviega> No |
16:01:54 | FromDiscord | <jviega> It doesn't |
16:02:10 | FromDiscord | <jviega> hostCPU is all about what's the environment you're running in right now |
16:02:18 | FromDiscord | <jviega> Whether that's nimscript or a binary |
16:04:05 | FromDiscord | <enthus1ast> i once got kicked and banned from a macos channel because i asked how to create a macos vm, since then i could care less about macos \:) |
16:05:02 | FromDiscord | <jviega> Oh that's prob because Mac doesn't license it to run on 3rd party hardware and they go after people who seem to support that kind of thing |
16:05:08 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4EVH |
16:07:09 | FromDiscord | <sOkam! 🫐> clientvk + clientgl + clientDL + server + servergame + clientgame + ui + vulkan.so + opengl.so 2x (debug,release) 4 (mac1, mac2, lnx, win)↵its.... just something else |
16:07:50 | FromDiscord | <jviega> That snippit doesn't work in a config.nims or a nimble file on a mac anyway |
16:08:03 | FromDiscord | <sOkam! 🫐> win,mac,lnx i can solve no issues. but the arm-vs-x86 is what is giving me the trouble |
16:08:11 | FromDiscord | <jviega> Like I said, use the code I gave you if you need to detect the platform when building on a mac |
16:08:15 | FromDiscord | <sOkam! 🫐> In reply to @jviega "That snippit doesn't work": yeah i know, that's why i asked in the first place |
16:08:29 | FromDiscord | <sOkam! 🫐> In reply to @jviega "Like I said, use": yeah, i understand jtv, but i don't build on a mac |
16:08:41 | FromDiscord | <enthus1ast> when you cannot test on a mac, i see no reason to actually build for a mac to be honest |
16:08:41 | FromDiscord | <jviega> Otherwise, accept a flag to tell you what platform to build from!!! |
16:08:52 | FromDiscord | <sOkam! 🫐> and im a solodev, and don't have the luxury of affording a mac, not even a cheap one |
16:08:56 | FromDiscord | <jviega> How is that part hard? |
16:09:19 | FromDiscord | <sOkam! 🫐> In reply to @enthus1ast "when you cannot test": i can test on an x86 mac, from a user/friend. but not on arm |
16:09:23 | FromDiscord | <jviega> sent a code paste, see https://play.nim-lang.org/#ix=4EVI |
16:09:45 | FromDiscord | <sOkam! 🫐> In reply to @jviega "There's an example of": i don't build on a mac, and the snipped relies on it |
16:09:46 | FromDiscord | <jviega> That will then accept -d:arch=whatever |
16:09:51 | FromDiscord | <jviega> No it doesn't |
16:09:56 | FromDiscord | <sOkam! 🫐> i was asking if i understood the snippet correctly or not |
16:10:14 | FromDiscord | <jviega> The flag setup assumes a native build OR you can override |
16:10:34 | FromDiscord | <jviega> It's set up in such a way that it's only possible to override on a mac, because I'm not a huge fan of cross-compiling |
16:10:51 | FromDiscord | <jviega> But it's got everything you need to know in there |
16:11:09 | FromDiscord | <sOkam! 🫐> well i asked "does this rely on being on a mac? because i don't have one"... and then the conversation turned into this silly debate on why or how or etc. i was asking from the start if I understood or not |
16:11:20 | FromDiscord | <sOkam! 🫐> im that obtuse, so im confident to accept when I misread things |
16:11:26 | FromDiscord | <sOkam! 🫐> hence why i started with that |
16:11:46 | FromDiscord | <jviega> It's not a debate, it's me trying to understand what you really meant, and then try to get you to understand what you need to do, depending on your requirements |
16:11:51 | FromDiscord | <jviega> I don't care what you do 🙂 |
16:12:07 | FromDiscord | <jviega> I don't even know what the debate would be there |
16:12:24 | FromDiscord | <sOkam! 🫐> In reply to @jviega "But it's got everything": kk. i saved the snipped in place, so will try to test it if I can lure anyone on macarm to try it out |
16:16:01 | FromDiscord | <terrygillis> In reply to @chronos.vitaqua "Ah wait... <@908363885667553300> your": nevermind I realize it’s technically impossible without touching unsafe code |
16:16:07 | FromDiscord | <enthus1ast> @sOkam! 🫐\: https://github.com/nim-lang/Nim/blob/2e4e2f8f5076b39e5976ba20f231f468b1b5052c/tests/compiler/tcmdlinecpuamd64.nim#L2 |
16:16:09 | FromDiscord | <enthus1ast> it seems hostCPU IS set by --cpu |
16:16:32 | FromDiscord | <sOkam! 🫐> In reply to @enthus1ast "it seems hostCPU IS": ty! that is -so- helpful to know ✍️ |
16:26:37 | FromDiscord | <jviega> Interesting, def good to know! |
16:31:29 | * | ntat joined #nim |
16:32:33 | * | azimut quit (Ping timeout: 246 seconds) |
16:35:46 | * | krux02 joined #nim |
16:52:26 | FromDiscord | <Chronos [She/Her]> In reply to @terrygillis "nevermind I realize it’s": Hm |
16:53:35 | FromDiscord | <Chronos [She/Her]> Unrelated, but should I make my event system library integrate with JS' event system stuff when compiled for the web? |
17:11:09 | FromDiscord | <Phil> sent a long message, see http://ix.io/4EW2 |
17:11:48 | FromDiscord | <Phil> (edit) "http://ix.io/4EW2" => "http://ix.io/4EW3" |
17:12:45 | * | advesperacit joined #nim |
17:16:50 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Argh I came back": Oh Phil, you exist! If you know by any chance, how would I store a sequence of bytes in a pg database? :P |
17:16:55 | FromDiscord | <Chronos [She/Her]> With Norm specifically |
17:17:09 | FromDiscord | <Chronos [She/Her]> Wanted to use it a while ago but there wasn't really a way for me to do that aha |
17:17:28 | FromDiscord | <Phil> Hmm note that you're limited by whatever variants dbType provides |
17:17:50 | FromDiscord | <Phil> Because it goes↵your type <--> dbType <--> Whatever the heck it is store in the Database as |
17:18:07 | FromDiscord | <Phil> If you can store that seq of bytes as a string or a list of numbers or whatever and convert it back, you're golden |
17:18:51 | FromDiscord | <Phil> Basically you need to act as if it's a custom datatype and then just do what is described here:↵https://norm.nim.town/customDatatypes.html |
17:18:56 | FromDiscord | <Phil> (edit) "store" => "stored" |
17:19:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EW5 |
17:20:12 | FromDiscord | <Phil> Simply regard seq[byte] as a custom type.↵If it helps with the abstraction, just alias `type MyBytes = seq[byte]` or something and define the procs accordingly |
17:20:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "Argh I came back": Ah yeah I can put default values |
17:22:05 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "If you can store": What if there's a null byte though hm... |
17:22:21 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Simply regard seq[byte] as": Gucci, thanks Phil! |
17:22:28 | FromDiscord | <Phil> In reply to @chronos.vitaqua "What if there's a": Are those allowed? |
17:22:36 | FromDiscord | <Phil> If so, you could do seq[Option[byte]] |
17:22:54 | FromDiscord | <Phil> If you need to check "does this exist", assuming that a null-byte means "does not exist" |
17:23:01 | FromDiscord | <Phil> (edit) ""does" => ""this byte does" |
17:23:58 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Are those allowed?": In Nim? Yeah |
17:24:07 | FromDiscord | <Chronos [She/Her]> Even in Nim strings, which iirc Postgres does not like |
17:24:20 | FromDiscord | <Phil> Assume I don't know what a null byte means for sure, i just assume all bits are value 0 and that expressed as an int just means 0 |
17:24:51 | FromDiscord | <Chronos [She/Her]> Yeah |
17:25:14 | FromDiscord | <Chronos [She/Her]> Since normally they're obviously used as string terminators but |
17:25:34 | FromDiscord | <Phil> How performance conscious are you about this? |
17:26:04 | FromDiscord | <Phil> Like every cycle matters or "Eh, it's okay if it works, postgres is fast enough and other parts of my algo will slow me down more"? |
17:26:08 | FromDiscord | <Chronos [She/Her]> Not too much? They're going to be used for lookup mostly though so |
17:26:36 | FromDiscord | <Phil> In that case your worst case fallback can always be to store a list of ints as text |
17:26:49 | FromDiscord | <Chronos [She/Her]> That sounds horrible lol |
17:26:58 | FromDiscord | <Chronos [She/Her]> But ig it's the best thing to do |
17:27:14 | FromDiscord | <Phil> Eh, it's inefficient sure but I would only bother looking for faster scenarios if it were performance critical |
17:27:27 | FromDiscord | <Phil> Or if I noticed it being a bottleneck |
17:27:38 | FromDiscord | <Chronos [She/Her]> Tbf my ID format is 128 bits long, if I could format it as a UUID somehow... If pg supports UUIDs |
17:27:56 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Eh, it's inefficient sure": Storage would be a pain over time considering nearly everything would have an ID |
17:28:04 | FromDiscord | <Chronos [She/Her]> Messages, users, events |
17:28:08 | FromDiscord | <Chronos [She/Her]> Channels, servers |
17:32:12 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Channels, servers": An alternative would be https://www.postgresql.org/docs/9.1/arrays.html↵But that one you would need to see whether you can squeeze that into norm, no promises there.↵That seems like db-specific syntax that norm doesn't support and hasn't had in mind so far, in part because I think the lower-level db it uses to deal with that (lowdb) might also not be capable of handling it. |
17:32:51 | FromDiscord | <Phil> But maybe it is, it's more of a "not tested" kind of thing than a "I know this doesn't work" and it's not terribly unlikely that this stuff can just get converted correctly |
17:32:53 | FromDiscord | <Chronos [She/Her]> Makes sense... Seems painful though |
17:33:09 | FromDiscord | <Chronos [She/Her]> I wonder if I'd be better off formatting my ID as a UUID |
17:33:36 | FromDiscord | <Phil> I mean, first things first, what is that seq[byte] actually that it's an id for you? |
17:33:37 | FromDiscord | <Chronos [She/Her]> UUIDs are supported in Postgres and Sqlite so |
17:35:16 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "I mean, first things": Contains a signed 48 bit timestamp, a unique 40 bit value, a 16 bit unique generator number, a 16 bit sequence (for the number of the ID that's been generated at the current time), and an 8 bit random value |
17:36:51 | FromDiscord | <Phil> What in the everloving... |
17:37:11 | FromDiscord | <Chronos [She/Her]> Aha |
17:37:12 | FromDiscord | <Phil> Okay is that because you want to do double duty in encoding data into the id or do you just want unguessable numbers? |
17:37:37 | FromDiscord | <Chronos [She/Her]> That's the type- |
17:37:37 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EW8 |
17:37:57 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Okay is that because": Double duty? |
17:38:32 | FromDiscord | <Chronos [She/Her]> And I'm doing this to prevent the numbers from ever conflicting (since the application may be ran by anyone, all parties not affiliated but the possibility of eachother's servers talking to eachother) |
17:38:52 | FromDiscord | <Chronos [She/Her]> It's for a federated chat application idea I have lol |
17:39:14 | FromDiscord | <Phil> Ids typically have 1 job:↵Uniquely identify a given record/row in a table.↵If you wish to encode data into them so that you can just fetch the id and just by the id alone know timestamp, systemUniqueValue etc. that means they now have 2 jobs:↵Identify a row and contain data |
17:39:32 | FromDiscord | <Phil> (edit) "Ids typically have 1 job:↵Uniquely identify a given record/row in a table.↵If you wish to encode data into them so that you can just fetch the id and just by the id alone know timestamp, systemUniqueValue etc. that means they now have 2 jobs:↵Identify a row and contain data ... " added "that you can parse out of them" |
17:40:50 | FromDiscord | <Chronos [She/Her]> Ah, yeah, it needs to be unique at all costs and contain the timestamp info |
17:41:07 | FromDiscord | <Phil> Okay so you must be able to parse the timestamp back out of it |
17:41:19 | FromDiscord | <Phil> Do you need to get the other things out of it as well? |
17:41:37 | FromDiscord | <odexine> if you wanted "unique at all costs" you'd prolly just ask for a kilobyte of random value |
17:42:00 | FromDiscord | <Phil> Actually you know what, make an extra timestamp column and generate a UUID based on the 5 numbers provided by you here |
17:42:20 | FromDiscord | <odexine> tbh 256 or 512 bytes of random value is also already stupid large |
17:42:49 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Okay so you must": Only the timestamp |
17:42:53 | FromDiscord | <odexine> people are "fine" with UUIDs and those are only 128 bytes minus a little overhead IIRC |
17:43:06 | FromDiscord | <odexine> oh bit |
17:43:10 | FromDiscord | <odexine> im forgetful |
17:43:27 | FromDiscord | <odexine> i've mangled my mind with a lot of embedded systems research today |
17:43:33 | FromDiscord | <Phil> double actually, you can just concat the numbers as strings to one another and try to store that as number or sth |
17:43:36 | FromDiscord | <odexine> lots of switching between bits and bytes |
17:44:07 | FromDiscord | <Chronos [She/Her]> I could probably do that tbf |
17:44:35 | FromDiscord | <Phil> Don't try to be clever and have your id-column also act as your storage for timestamp.↵Have whatever you want stored as individual columns and build your id together from your building blocks solely for the purposes of being an id |
17:45:07 | FromDiscord | <Phil> Having a dedicated timestamp column also means you're not screwed later when you want to sort stuff by timestamp or select stuff based on timestamp on your postgres |
17:46:59 | FromDiscord | <Chronos [She/Her]> Fair enough, but that still means I have to store 104 bits- |
17:47:14 | FromDiscord | <Chronos [She/Her]> (13 bytes) |
17:47:39 | FromDiscord | <Chronos [She/Her]> Which still doesn't solve the issue of not being able to store it in one type- Maybe as a string but |
17:48:04 | * | Figworm joined #nim |
17:48:06 | FromDiscord | <Phil> norm doesn't do string ids, another one of those "I don't get why" things |
17:48:14 | FromDiscord | <Chronos [She/Her]> Hm |
17:48:22 | FromDiscord | <Phil> Actually you could work around that |
17:48:35 | FromDiscord | <Phil> Let norm have its id field and just have an additional uuid: string field with a PK constraint |
17:48:38 | FromDiscord | <Chronos [She/Her]> If there was a UUID type built in to Norm, that'd be perfect |
17:48:49 | FromDiscord | <Chronos [She/Her]> Unless it does and I'm just blind |
17:48:54 | FromDiscord | <Phil> It doesn't |
17:49:19 | * | Figworm quit (Client Quit) |
17:50:40 | FromDiscord | <Chronos [She/Her]> Yeah thought so |
17:50:43 | FromDiscord | <Chronos [She/Her]> Sigh... |
17:51:21 | FromDiscord | <odexine> would norm allow it to be an array of 2 uint64s |
17:52:26 | FromDiscord | <Phil> Norm has hard-coded requirement for an id of int64.↵Or rather it has the hard-coded requirement that such a column must exist and that it be unique so norm can fetch records from the db based on that id |
17:53:04 | FromDiscord | <Phil> That doesn't mean you can't have your own UUID field and use raw-selects, it's fairly ugly though. Might still work well enough |
17:53:10 | FromDiscord | <Chronos [She/Her]> Does it allow for it to be an int128 instead...? |
17:53:19 | FromDiscord | <Chronos [She/Her]> If I could get that to work, that'd be nice |
17:54:08 | FromDiscord | <Phil> Nope.↵You inherit from Model, Model forces an int64 |
17:54:12 | FromDiscord | <Chronos [She/Her]> Damn it |
17:54:19 | FromDiscord | <Chronos [She/Her]> How about if I just, fork Norm |
17:54:32 | FromDiscord | <odexine> isnt it kinda recommended to have separate "db id" and "external id"s anyway |
17:54:39 | FromDiscord | <Chronos [She/Her]> Is it? |
17:55:05 | FromDiscord | <odexine> yes as a random pk id has database index performance implications |
17:55:07 | FromDiscord | <Phil> beats me. I haven't encountered that pattern yet, but I have not yet worked on a codebase with a db that uses techniques younger than 10 years old |
17:55:35 | FromDiscord | <Phil> At least not a relational db |
17:55:43 | FromDiscord | <odexine> iirc this is esp true for neosql dbs where theres a large distributed-capable focus |
17:55:55 | FromDiscord | <odexine> not sure tho |
17:56:00 | FromDiscord | <Phil> And my own work in my spare time never hits those usecases |
17:56:06 | FromDiscord | <odexine> yeah |
17:56:16 | FromDiscord | <odexine> its not required for us mini-scale programmers |
17:56:22 | FromDiscord | <odexine> but its a recommendation |
17:58:49 | FromDiscord | <Phil> I mean the only reason forces the id field is so that it can ensure that the field "id" exists |
17:59:00 | FromDiscord | <Phil> And concepts at the time were far less promoted afaik |
17:59:13 | FromDiscord | <Phil> (edit) "I mean the only reason ... forces" added "norm" |
17:59:41 | FromDiscord | <Phil> In reply to @chronos.vitaqua "How about if I": Actually you could still fork norm. Or rather work on a PR that removes the need for inheritance and just adds a `Model` Concept instead |
18:00:41 | FromDiscord | <Chronos [She/Her]> I could try that? But also I'm not confident enough on my Nim knowledge to do that lol, esp without an actual editor (I'm using nano on my phone) |
18:01:01 | FromDiscord | <Phil> Would likely need some tinkering so that `createTables` can know inherently what database-column-type to use |
18:01:35 | FromDiscord | <Phil> OOOOOOORRRRR models could have a pragma annotation in which the user must provide the name of the id-column |
18:01:57 | FromDiscord | <Phil> Or just have a pk pragma, even easier |
18:02:02 | FromDiscord | <Phil> (edit) "pragma," => "pragma on the specific field," |
18:03:57 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EWh |
18:04:54 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "OOOOOOORRRRR models could have": So a `normId` pragma? |
18:05:23 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EWj |
18:05:58 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EWk |
18:06:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Can you give a": No error, no stacktrace↵it justs quit |
18:06:11 | FromDiscord | <Phil> In reply to @chronos.vitaqua "So a `normId` pragma?": just pk should suffice.↵Supporting partial pk's though would be absolute hell |
18:06:18 | FromDiscord | <Phil> (edit) "partial" => "composite" |
18:06:19 | FromDiscord | <Chronos [She/Her]> Fair |
18:06:49 | FromDiscord | <Chronos [She/Her]> In reply to @sys64 "No error, no stacktrace": Hm... Not sure then |
18:07:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Hm... Not sure then": I can't even catch the error |
18:07:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EWl |
18:07:52 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4EWl" => "https://play.nim-lang.org/#ix=4EWm" |
18:08:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "type of instanceMan plx.": instance Man shouldn't be nil but will check after the dinner |
18:08:59 | FromDiscord | <Phil> In reply to @sys64 "instance Man shouldn't be": But the fields you access on it might |
18:09:53 | FromDiscord | <System64 ~ Flandre Scarlet> It crashes once I do instance List.del() |
18:12:26 | FromDiscord | <System64 ~ Flandre Scarlet> Is it related to multithreading? |
18:18:43 | FromDiscord | <Phil> one sec, how does that even work? I assume instanceList is a seq, right? |
18:18:59 | FromDiscord | <Phil> This is the kind of reason why I ask to see types, I hate guessing |
18:19:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "one sec, how does": It's a table |
18:19:10 | FromDiscord | <Phil> ... why call it list |
18:19:33 | FromDiscord | <System64 ~ Flandre Scarlet> With string as key, and GameInstance as value |
18:19:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "... why call it": No idea |
18:22:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EWo |
18:22:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "This shouldn't be possible": It's a ref type |
18:27:48 | FromDiscord | <Phil> In reply to @sys64 "No error, no stacktrace": I assume you know for 100% certain based on echo's that you never get past the line ` instanceMan.instanceList.del(code)`? |
18:29:18 | FromDiscord | <System64 ~ Flandre Scarlet> Yeah, I tried with echo, I don't get past this |
18:30:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EWp |
18:32:27 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EWq |
18:32:28 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/FlOoi |
18:32:29 | FromDiscord | <Phil> yes |
18:32:46 | FromDiscord | <Chronos [She/Her]> How hard would it be to make my own ORM hm... |
18:32:48 | FromDiscord | <System64 ~ Flandre Scarlet> GameInstance is a ref type |
18:34:43 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EWs |
18:38:52 | FromDiscord | <Phil> sent a long message, see http://ix.io/4EWx |
18:40:25 | FromDiscord | <Phil> (edit) "http://ix.io/4EWx" => "http://ix.io/4EWy" |
18:42:11 | FromDiscord | <System64 ~ Flandre Scarlet> ``instanceMan.instanceList[code] = nil`` doing that makes the software crashing even faster |
18:42:20 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "For the most part": Makes sense |
18:43:04 | FromDiscord | <Phil> In reply to @sys64 "``instanceMan.instanceList[code] = nil`` doing": I mean, that is you assigning nil to your table, that's on you at that point 😛 |
18:48:25 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @isofruit "I mean, that is": Now the problem is I don't have any stacktrace so the problem is hard to diagnose |
18:49:30 | FromDiscord | <Phil> With today having been exhausting and me not having any source code, I'll leave it at that, maybe beef can figure this one out ^^ |
18:49:54 | FromDiscord | <Phil> (edit) "any" => "half the" |
18:50:58 | FromDiscord | <System64 ~ Flandre Scarlet> This is the entire instangeManager https://media.discordapp.net/attachments/371759389889003532/1146517433318916266/instanceManager.nim |
18:52:37 | FromDiscord | <System64 ~ Flandre Scarlet> Humm is it possible to make a thread quit without quitting the entire software? |
18:56:36 | advesperacit | make the thread return, the quit() proc will end everything |
18:57:25 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EWG |
18:58:59 | advesperacit | yes, the defer wraps the rest of the code in a try with your defer clause being the finally section |
18:59:33 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵Well, it still crash :/ |
19:01:15 | FromDiscord | <odexine> sent a code paste, see https://paste.rs/G9c08 |
19:01:34 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4EWK |
19:01:58 | FromDiscord | <odexine> game.game.gameCode |
19:02:02 | FromDiscord | <odexine> add more games |
19:02:56 | FromDiscord | <sOkam! 🫐> Is there any difference between `nim c --mm:none thefile.nim` and `nim c --mm:none --noMain thefile.nim`?↵Is the nim's `NimMain()` function required for something other than the GC? 🤔 |
19:07:18 | * | ntat quit (Quit: leaving) |
19:08:56 | FromDiscord | <Phil> https://forum.nim-lang.org/t/10446 |
19:09:05 | FromDiscord | <Phil> For you sOkam! |
19:09:54 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @griffith1deadly "game.game ...": Well I should name my variables a better way lol |
19:10:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "why is the defer": I want to send a message to a channel so the GameInstance gets dereferenced from a list |
19:11:31 | FromDiscord | <sOkam! 🫐> In reply to @isofruit "https://forum.nim-lang.org/t/10446": your search skills are brilliant. better than mine. ty 🙏 |
19:11:49 | FromDiscord | <Phil> Nah, just knew the thread as I had read it earlier |
19:11:51 | FromDiscord | <sOkam! 🫐> that explains a lot |
19:11:54 | FromDiscord | <Phil> earlier being a couple days ago |
19:11:55 | FromDiscord | <sOkam! 🫐> i see |
19:12:47 | FromDiscord | <sOkam! 🫐> very very useful info, ngl. ty a lot |
19:16:10 | FromDiscord | <sOkam! 🫐> @pmunch do you know any tool where you can give it a C symbol name, like `glfwInit()`, a .c/.h file to find its implementation, and it can give you back a dependency graph of all other symbols/functions it depends on?↵↵Asking because you made futhark, and I know you used clang for it, but since futhark doesn't do this I wondered if you know how to do it |
19:18:00 | FromDiscord | <sOkam! 🫐> The idea is to have some sort of tool where I can slowly pull pieces of a huge C project, to start converting them into nim, but the project is gigantic so I would need to do it slowly to not break everything (and probably will always be a mixed project, never fully pure nim)↵Can you think of anything? |
19:18:43 | FromDiscord | <sOkam! 🫐> (edit) "The idea is to have ... some" added "(or create)" |
19:19:16 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @sys64 "I want to send": I think I will have to find another approach |
19:19:50 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "<@392962235737047041> do you know": I'd imagine clang would have a tool for this, no? Or someone using it to of made a tool at l |
19:19:53 | FromDiscord | <Chronos [She/Her]> Least |
19:46:36 | FromDiscord | <pmunch> In reply to @heysokam "<@392962235737047041> do you know": Hmm, not sure. The definition (.h) alone wouldn't tell it enough to know what else it needs, but you would be able to get the other imports from that file. Of course that is probably enough since including that .h file would pull in the other things as well. Opir sorta does this already. That being said why dont you just wrap the whole thing with Futhark and then you can replace |
19:46:59 | FromDiscord | <nnsee> In reply to @heysokam "<@392962235737047041> do you know": i remember doxygen being able to do that |
19:47:04 | FromDiscord | <nnsee> i think |
19:53:05 | FromDiscord | <sOkam! 🫐> In reply to @pmunch "Hmm, not sure. The": Don't know if you recall, but I asked about that "why dont you just ..." part like 3-4 different times in here, and I still have no single clue how to do it↵It's a beast of a project, its taking me 1+year to even be able to use it from nim at all↵I could wrap glfw no problem, and used futhark to provide an alternative raw version for the wgpu bindings↵But this project is just something |
19:56:20 | FromDiscord | <sOkam! 🫐> I need to reimplement the `main()` function for C, and that function is platform-dependent and calling some internal sdl implementation↵So to be able to call the engine code from Nim with futhark at all, first I need to reimplement that entire file and/or wrap it. Which is the root of that conversion process question, basically |
19:57:13 | FromDiscord | <pmunch> Well, if you wrap all the includes in your project with Futhark then rewriting the main should be pretty simple |
19:57:50 | FromDiscord | <sOkam! 🫐> what do you call with futhark to do that? none of the internal unix_main.c and win32_main.c functions are exported anywhere |
19:58:20 | FromDiscord | <sOkam! 🫐> they are all static functions only used in that file, which is the root of the problem to solve |
20:01:22 | FromDiscord | <System64 ~ Flandre Scarlet> Does generated C code use the preprocessor? |
20:14:57 | FromDiscord | <juan_carlos> In reply to @sys64 "Does generated C code": Ye |
20:15:32 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright, thanks |
20:15:46 | FromDiscord | <System64 ~ Flandre Scarlet> I still need to understand this step better for my school work |
20:19:49 | FromDiscord | <Chronos [She/Her]> Sigh, wish there was a barebones android app someone made to load a .so file |
20:20:07 | FromDiscord | <Chronos [She/Her]> So I could work on a small game with Raylib on my phone |
20:49:34 | FromDiscord | <Elegantbeef> can't termux do gui? |
20:49:54 | FromDiscord | <ahungry> sent a long message, see http://ix.io/4EX5 |
20:52:28 | FromDiscord | <ahungry> of course, drawing vs printing text...big diff 😆 |
20:53:46 | FromDiscord | <ahungry> https://github.com/raysan5/raylib/wiki/Working-for-Android-(on-Linux) - nevermind, solved space - neat - I should give raylib a try sometime |
20:57:42 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "can't termux do gui?": Not in a sane way- |
20:58:12 | FromDiscord | <Chronos [She/Her]> In reply to @ahungry "https://github.com/ahungry/janet-android/tree/maste": Ooh |
20:58:32 | FromDiscord | <Chronos [She/Her]> Hm but surely it wouldn't be hard to just, modify that to have an entrypoint for my custom so file to use? |
21:00:07 | FromDiscord | <jviega> Anyone know off the top of their head how to programatically find the nimble path from within config.nims / nimble file? |
21:07:01 | FromDiscord | <sOkam! 🫐> In reply to @chronos.vitaqua "Sigh, wish there was": that sounds like a hella useful project |
21:42:54 | * | Jjp137 quit (Quit: Leaving) |
21:46:52 | * | Jjp137 joined #nim |
21:57:26 | FromDiscord | <.maverk> https://media.discordapp.net/attachments/371759389889003532/1146564358718107658/ee.PNG |
21:57:30 | FromDiscord | <.maverk> what does this mean ? |
21:57:46 | FromDiscord | <.maverk> why moderated ? |
22:04:22 | FromDiscord | <Elegantbeef> Cause your account is new |
22:05:18 | FromDiscord | <.maverk> created 25 days ago |
22:05:48 | FromDiscord | <.maverk> wtf is this ????? https://media.discordapp.net/attachments/371759389889003532/1146566461805056080/31.PNG |
22:06:00 | FromDiscord | <Elegantbeef> It's floats |
22:06:01 | FromDiscord | <Elegantbeef> We went over this |
22:06:14 | FromDiscord | <.maverk> i thought it is fixed |
22:06:24 | FromDiscord | <Elegantbeef> You cannot fix it |
22:06:38 | FromDiscord | <Elegantbeef> There is no bug |
22:06:46 | FromDiscord | <.maverk> why ? because of IEEX |
22:06:52 | FromDiscord | <.maverk> (edit) "IEEX" => "IEEx" |
22:07:17 | FromDiscord | <Elegantbeef> Because of floating point |
22:07:59 | FromDiscord | <Elegantbeef> https://www.omnicalculator.com/other/floating-point |
22:08:07 | FromDiscord | <.maverk> nim doesn't have software for fixing this |
22:08:12 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1146567069572280470/image.png |
22:08:14 | FromDiscord | <Elegantbeef> There is no bug |
22:08:26 | FromDiscord | <Elegantbeef> This is what a float is |
22:08:49 | FromDiscord | <Elegantbeef> If you mean "I want to format a float to show X significant digits" yes there is formatting for that |
22:09:09 | FromDiscord | <Elegantbeef> But `$` is not a formatted string it is the stringified version of a value |
22:09:27 | FromDiscord | <jmgomez> sup beef, any idea of what I asked on #internals about how to run a file with multiple specs in testament locally? |
22:09:43 | FromDiscord | <Elegantbeef> Nope |
22:09:53 | * | def- quit (Quit: -) |
22:10:04 | * | def- joined #nim |
22:10:45 | FromDiscord | <.maverk> In reply to @Elegantbeef "image.png": so 32 bits are not enough to get the exact floating point ? |
22:10:51 | FromDiscord | <.maverk> because 64 works fine |
22:11:11 | FromDiscord | <Elegantbeef> Correct |
22:11:18 | FromDiscord | <jmgomez> In reply to @Elegantbeef "Nope": 😦 |
22:15:08 | * | advesperacit quit () |
22:17:35 | FromDiscord | <jmgomez> Crap, is flyx on GH on Discord? |
22:17:50 | FromDiscord | <Elegantbeef> Not that I know of |
22:18:40 | FromDiscord | <jmgomez> agh he just broke CI with an update to his package and my precious PR towards IC is gonna fail 😦 |
22:31:27 | * | genr8eofl__ joined #nim |
22:31:31 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4EXp |
22:33:48 | * | genr8eofl_ quit (Ping timeout: 246 seconds) |
23:02:23 | * | jmdaemon joined #nim |
23:10:41 | FromDiscord | <ahungry> sent a code paste, see https://play.nim-lang.org/#ix=4EXs |
23:39:07 | * | azimut joined #nim |