00:02:33 | * | advesperacit quit () |
00:11:37 | FromDiscord | <Robyn [She/Her]> Fair |
00:25:22 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
00:28:19 | FromDiscord | <piman_discriminator_1010> is there no Table.empty?↵`path.len > 0` |
00:28:26 | FromDiscord | <piman_discriminator_1010> (edit) "Table.empty?↵`path.len" => "Seq.empty?↵`path.len" |
01:00:03 | * | nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:02:29 | * | nazgulsenpai joined #nim |
01:11:19 | * | azimut quit (Ping timeout: 240 seconds) |
02:27:43 | FromDiscord | <sOkam! 🫐> In reply to @user2m "yeah I'm just now": oh that's a function I wrote. yeah, that one is super bad, it needs proper windows support 🙈 |
02:29:47 | FromDiscord | <sOkam! 🫐> that function should have a check that runs the command in powershell or cmd, because `sh -c` is not supported on windows |
02:30:49 | FromDiscord | <sOkam! 🫐> I discovered the problem much later after I wrote that, and then I helped somebody here with some bindings, and seems like they took it verbatim without fixing the windows support problem |
02:31:59 | FromDiscord | <sOkam! 🫐> In reply to @piman_discriminator_1010 "is there no Seq.empty?": `Seq.len == 0` is what I use for that |
02:52:33 | * | xet7 quit (Remote host closed the connection) |
02:52:52 | * | xet7 joined #nim |
03:18:39 | FromDiscord | <leorize> btw Phil, you don't need the omit flags with --passL, in case you want to shorten it a little |
03:30:42 | FromDiscord | <piman_discriminator_1010> do enums need to be ordinals (can I put enums in enums?) |
03:32:33 | FromDiscord | <piman_discriminator_1010> I have data in the form of two numbers, the first number identifies the enum set, and the second number identifies the enum value within that enum set↵I want to know how I can represent this in code, maybe a table of lists? |
03:35:08 | FromDiscord | <Elegantbeef> Array of enum to data |
03:35:20 | FromDiscord | <Elegantbeef> `array[MyEnum, MyData]` |
03:36:17 | FromDiscord | <piman_discriminator_1010> I don't think the enum set IDs are packed (there's too many for me to actually check by hand) |
03:36:31 | FromDiscord | <piman_discriminator_1010> (edit) |
03:36:52 | FromDiscord | <Elegantbeef> If you use enums properly they'll always be contiguous! 😛 |
03:37:17 | FromDiscord | <piman_discriminator_1010> no no, these are not nim enums, they are enums from data I have |
03:37:43 | FromDiscord | <piman_discriminator_1010> I'm looking to try and figure out how to get them into nim |
03:38:01 | FromDiscord | <piman_discriminator_1010> right now I just have magic numbers |
03:38:12 | FromDiscord | <Elegantbeef> Make some enums |
03:38:13 | FromDiscord | <piman_discriminator_1010> (edit) "right now I just have ... magic" added "a pair of" |
03:38:40 | FromDiscord | <Elegantbeef> Given lack of useful information to operate on I can only say "use the type system to do it in a nice type safe way" 😄 |
03:38:51 | FromDiscord | <piman_discriminator_1010> In reply to @Elegantbeef "Make some enums": preferably I would like to make nested enums |
03:39:06 | FromDiscord | <Elegantbeef> A nested enum does not make any sense |
03:39:09 | FromDiscord | <piman_discriminator_1010> (edit) "enums" => "enums, but I'm not sure if that would actually work" |
03:39:09 | FromDiscord | <Elegantbeef> An enum is a ordinal value |
03:39:16 | FromDiscord | <Elegantbeef> How can a value be a nested value |
03:39:31 | FromDiscord | <piman_discriminator_1010> (some languages like Java enums are more like classes) |
03:39:45 | FromDiscord | <Elegantbeef> So emulate what they do 😛 |
03:40:11 | FromDiscord | <piman_discriminator_1010> a table of lists of strings? |
03:40:23 | FromDiscord | <Elegantbeef> Sure |
03:40:32 | FromDiscord | <piman_discriminator_1010> or I guess a table of lists of string/integer paris |
03:40:36 | FromDiscord | <piman_discriminator_1010> (edit) "paris" => "pairs" |
03:40:41 | FromDiscord | <Elegantbeef> Java enums are just a global values |
03:40:42 | FromDiscord | <cletus6872> sent a long message, see https://pasty.ee/FDtjONTXaKPL |
03:41:20 | FromDiscord | <piman_discriminator_1010> In reply to @piman_discriminator_1010 "or I guess a": can this be compile time instantiated? |
03:41:30 | FromDiscord | <piman_discriminator_1010> (I assume so) |
03:41:43 | FromDiscord | <cletus6872> (edit) "https://pasty.ee/YMFhbkAXzays" => "https://pasty.ee/upuUKDzMRIMl" |
03:42:04 | FromDiscord | <Elegantbeef> We have macros so of course |
03:42:11 | FromDiscord | <Elegantbeef> We also have static evaluation |
03:44:02 | FromDiscord | <piman_discriminator_1010> is there such thing as a pair type, or would that be a tuple? |
03:45:02 | FromDiscord | <leorize> that's a tuple indeed |
03:50:23 | FromDiscord | <piman_discriminator_1010> In reply to @piman_discriminator_1010 "or I guess a": wait, I think I can do something better maybe |
03:52:45 | FromDiscord | <piman_discriminator_1010> hmmmmm, maybe not |
03:53:12 | FromDiscord | <piman_discriminator_1010> I can't use `case of` in an enum definition can I |
03:53:30 | FromDiscord | <piman_discriminator_1010> essentially a union of enums |
03:54:34 | FromDiscord | <Elegantbeef> No enums are ordinals |
03:55:33 | FromDiscord | <piman_discriminator_1010> damn https://media.discordapp.net/attachments/371759389889003532/1198475949407227904/image.png?ex=65bf0ab4&is=65ac95b4&hm=c3a6053c3c573e1b64133929bdab6114836a6e5e4101c582d5c21e782af5ea0b& |
03:57:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ohQKdlZwlmjF |
03:58:03 | FromDiscord | <piman_discriminator_1010> I'm not sure what I'm looking at here |
03:58:32 | FromDiscord | <Elegantbeef> We've associated `Bleh` with a tuple of `(set[Bleh], set[Bleh])` |
03:58:46 | FromDiscord | <Elegantbeef> now you can do `vals[myEnumVal].process()` or w/e |
04:02:44 | FromDiscord | <odexine> if you want it more written out, `vals` is an `array[Bleh, (set[Bleh], set[Bleh])]` or a Bleh-indexable array of pairs of Bleh-combinations |
04:03:23 | FromDiscord | <odexine> what beef suggests is that now you can use the array as a mapping for what you want |
04:03:36 | FromDiscord | <piman_discriminator_1010> wait, I think I can change my enum holding object to use `case of` |
04:03:55 | FromDiscord | <odexine> perhaps |
04:06:52 | FromDiscord | <piman_discriminator_1010> ugh, can't use the same field name within different `of`a |
04:06:54 | FromDiscord | <piman_discriminator_1010> (edit) "`of`a" => "`of`s" |
04:07:43 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=MqVlFBSSoLxr |
04:07:50 | FromDiscord | <piman_discriminator_1010> (edit) "https://play.nim-lang.org/#pasty=BAvZfKbUAqmo" => "https://play.nim-lang.org/#pasty=XcVOaoTTowYG" |
04:08:03 | FromDiscord | <piman_discriminator_1010> (edit) "https://play.nim-lang.org/#pasty=RQHmPjYEvODG" => "https://play.nim-lang.org/#pasty=qPftihXNQgpj" |
04:08:08 | FromDiscord | <piman_discriminator_1010> (edit) "https://paste.rs/TsPeq" => "https://play.nim-lang.org/#pasty=samFuJlibiSM" |
04:08:15 | FromDiscord | <Elegantbeef> Right |
04:08:34 | FromDiscord | <piman_discriminator_1010> (edit) "https://paste.rs/KTkFq" => "https://paste.rs/RGOLB" |
04:08:47 | FromDiscord | <Elegantbeef> `fooVal` and `barVal` is the conventional solution |
04:09:04 | FromDiscord | <Elegantbeef> This is the downside of Nim's non type safe sum types |
04:09:17 | FromDiscord | <Elegantbeef> It will eventually get type safe sum type |
04:09:23 | FromDiscord | <piman_discriminator_1010> what's a sum type? |
04:09:32 | FromDiscord | <piman_discriminator_1010> basically a union? |
04:09:34 | FromDiscord | <Elegantbeef> A tagged union |
04:09:41 | FromDiscord | <odexine> "enums" in other languages are more accurately called sum types iirc |
04:09:43 | FromDiscord | <Elegantbeef> Not basically they're the same thing |
04:10:12 | FromDiscord | <Elegantbeef> A tagged union is a sum type |
04:10:20 | FromDiscord | <Elegantbeef> Though an untagged union is not a sumtype |
04:10:34 | FromDiscord | <leorize> there's nothing sum-ish about enums \:p |
04:11:10 | FromDiscord | <Elegantbeef> Don't let JJ hear you say that |
04:11:18 | FromDiscord | <piman_discriminator_1010> In reply to @Elegantbeef "`fooVal` and `barVal` is": does this mean code can try to call `fooVal` even when `set` is `BAR`? (even though this would be undefined behavior) |
04:11:19 | FromDiscord | <odexine> theyre only called sumtypes because some bongo thought "oh the or operator is just like addition and the and operator is just like multiplication" (i kid) |
04:11:56 | FromDiscord | <odexine> In reply to @piman_discriminator_1010 "does this mean code": yes, it would then be a runtime error |
04:12:26 | FromDiscord | <leorize> summing is an algebraic operation, which implies the ability to undo it |
04:12:51 | FromDiscord | <piman_discriminator_1010> hmm, could I make a macro or template so that calling `val` would prepend the appropriate name and get the adjusted field value then? |
04:13:08 | FromDiscord | <leorize> I've not seen any implementations outside of the application programming sphere that implements sum types true to it's name |
04:13:09 | FromDiscord | <piman_discriminator_1010> iirc I should be able to |
04:13:33 | FromDiscord | <leorize> it's always been this weird equivalence between them and pattern matching |
04:15:12 | FromDiscord | <odexine> In reply to @leorize "summing is an algebraic": i really was joking pls ;; |
04:16:24 | FromDiscord | <leorize> don't worry that's just a mini rant about how nim still doesn't understand sum types \:p |
04:39:16 | * | krux02 quit (Remote host closed the connection) |
04:59:25 | * | droidrage quit (Ping timeout: 276 seconds) |
04:59:38 | * | azimut joined #nim |
05:00:04 | * | qwestion quit (Ping timeout: 276 seconds) |
05:49:37 | * | jmdaemon joined #nim |
06:15:40 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=agsWjnZCrvOI |
06:17:31 | FromDiscord | <sOkam! 🫐> In reply to @user2m "just wrote a slightly": did you try that in the VM? |
06:17:50 | FromDiscord | <sOkam! 🫐> the reason to use `gorge` is because its running at compiletime, otherwise `execShellCmd` would be 10times better |
06:18:44 | FromDiscord | <user2m> In reply to @heysokam "did you try that": hmmm not exactly sure what you mean by the VM lol you mean with nimscript? |
06:19:10 | FromDiscord | <sOkam! 🫐> compiletime code is nimscript (ish), but its actually `when nimvm: ...` not `when defined(nimscript): ...` |
06:20:26 | NimEventer | New thread by yeti: TCC on ARM(el) backend problem, see https://forum.nim-lang.org/t/10894 |
06:21:21 | FromDiscord | <user2m> In reply to @heysokam "compiletime code is nimscript": oh cool! leaned something new. reading the docs now https://nim-lang.org/docs/manual.html#statements-and-expressions-when-nimvm-statement |
06:22:15 | FromDiscord | <sOkam! 🫐> yeah, that's why its using the `sh -c` hacky solution, and the windows solution wasnt tested. because its compile-time code that is meant to be printed back to the user in cli |
07:16:44 | * | derpydoo joined #nim |
07:44:12 | * | rockcavera quit (Remote host closed the connection) |
08:45:43 | * | azimut quit (Ping timeout: 240 seconds) |
09:46:34 | * | advesperacit joined #nim |
10:07:03 | * | jjido joined #nim |
10:22:53 | FromDiscord | <Robyn [She/Her]> Asyncdispatch has something for setting the dispatcher, and getting one, right? |
10:23:09 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Asyncdispatch has something for": Aye |
10:23:22 | FromDiscord | <Robyn [She/Her]> What if I just set the same dispatcher on all threads? :p |
10:23:32 | FromDiscord | <Phil> You typically shouldn't need to access it though. Unless you need to destroy it |
10:24:20 | FromDiscord | <Phil> In reply to @chronos.vitaqua "What if I just": Given it is designed around being a threadVar and thus separate per Thread:↵I assume mayhem, potential use-after-frees etc. |
10:24:30 | FromDiscord | <Phil> Keep in mind that none of these things are locked datastructures afaik |
10:24:47 | FromDiscord | <Phil> So could be you work on the same future twice at the same time, maybe you access a future after another thread freed it, who knows |
10:24:53 | FromDiscord | <Robyn [She/Her]> Yeah makes sense :p |
10:25:22 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "You typically shouldn't need": I remember that I did actually use this to make futures work across shared library boundaries |
10:25:36 | FromDiscord | <Robyn [She/Her]> My failure was forgetting nimrtl, but otherwise it would've worked :p |
10:26:00 | FromDiscord | <Phil> "And I would have succeeded to if it weren't for this meddling nim!" |
10:26:05 | FromDiscord | <Phil> (edit) "to" => "too" |
10:26:19 | FromDiscord | <Robyn [She/Her]> Yeah basically xD |
10:30:04 | madprops | i want to talk to beef |
10:32:24 | FromDiscord | <Phil> Likely gone for the day already, you best chance likely is in around 10h |
10:32:34 | FromDiscord | <Phil> your |
10:34:39 | FromDiscord | <odexine> well you could also just ask the question and see if someone else can answer you, if its a question |
10:36:29 | FromDiscord | <fosster> hi sweet nim community! |
10:36:36 | FromDiscord | <Phil> cheers |
10:36:57 | FromDiscord | <fosster> do you know a good html template engine (something like jinja) to be used with jester? |
10:37:41 | FromDiscord | <Phil> You can use karax (which has a SSR mode) or nimja, those at least are the projects I recall off the top of my head |
10:37:46 | FromDiscord | <fosster> it's the first time that I'm approaching to webdev in nim |
10:38:05 | FromDiscord | <fosster> thanks! |
10:38:07 | FromDiscord | <Phil> As a fallback you can look at source-code-filters which are kind of like a general templating engine you can use, though not necessarily the most readable |
10:42:57 | FromDiscord | <fosster> you know what I always say is that an huge thing that is holding nim down from taking off is its documentation |
10:43:24 | FromDiscord | <fosster> I never actually used the documentation tools provided, but it doesn't seem so intuitive |
10:44:08 | FromDiscord | <fosster> (in my opinion) if it had a simple and effective docs generator like, for instance, rust, it would be a big step up |
11:19:24 | FromDiscord | <Phil> In reply to @fosster "(in my opinion) if": Personally I can work with the docs generator that is there.↵Most certainly it could be better and trying to do something about that is on my list of potential projects, but it's not nonexistant |
11:19:36 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
11:21:59 | NimEventer | New thread by AntonioFS: About the Nim official documentation update., see https://forum.nim-lang.org/t/10895 |
11:54:34 | FromDiscord | <sOkam! 🫐> In reply to @fosster "do you know a": when it comes to generating just raw html with templates, `treeform/taggy`, `nim-html-dsl` are the ones that looked the most promising when i looked into it a couple of weeks ago↵then there is `karax` as recommended, but it tries to be a framework, not just templating↵so depends on what you need |
11:55:34 | FromDiscord | <sOkam! 🫐> might be worth looking into `happyx` too, since its similar but also works more like a framework |
11:55:44 | FromDiscord | <sOkam! 🫐> (edit) "might be worth looking into `happyx` too, since its similar but also works more like a ... framework" added "fullstack" |
12:00:54 | * | derpydoo quit (Quit: derpydoo) |
12:03:40 | FromDiscord | <Phil> In reply to @heysokam "when it comes to": How is taggy btw? |
12:06:56 | FromDiscord | <sOkam! 🫐> seems pretty decent from what I saw |
12:07:43 | FromDiscord | <sOkam! 🫐> I was looking for something more supportive of the tailwind workflow, so I didn't go with it in the end↵but if you use the standard html workflow then its pretty good |
12:12:59 | FromDiscord | <summarity> See also https://discord.com/channels/371759389889003530/764946138109050893/1191220597108256768 and preceding messages |
12:21:24 | FromDiscord | <sOkam! 🫐> ah yea, dekao is pretty cool too. I didn't remember the name so didn't mention, but its similar to taggy in spirit |
12:21:36 | FromDiscord | <sOkam! 🫐> (edit) "didn't" => "couldn't" |
12:31:17 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#pasty=bOxQdewvToIT |
12:38:35 | FromDiscord | <odexine> `collect`? sugar |
12:44:29 | arkanoid | is it just me, or the new vscode extension doesn't solve anything about nimlangserver leaving nimsuggests processes hanging around the system even when vscode is closed? I have nimlangserver processes spawned 3 days ago, not opened vscode since then |
12:46:33 | FromDiscord | <Robyn [She/Her]> In reply to @arkanoid "is it just me,": New vsc extension? |
12:46:42 | arkanoid | yes |
12:47:09 | FromDiscord | <Robyn [She/Her]> Huh haven't heard of it |
12:47:57 | arkanoid | NimLang.nimlang https://marketplace.visualstudio.com/items?itemName=NimLang.nimlang https://github.com/nim-lang/vscode-nim |
12:49:26 | FromDiscord | <sOkam! 🫐> In reply to @arkanoid "is it just me,": https://media.discordapp.net/attachments/371759389889003532/1198610303605276722/image.png?ex=65bf87d5&is=65ad12d5&hm=ff513ac52d9c6d1b03cd04d8cfc94fd67db3641877e72b46018d704dbea649cb& |
12:49:30 | FromDiscord | <sOkam! 🫐> That's the nutshell of what you mentioned |
12:50:10 | FromDiscord | <sOkam! 🫐> the problem is the server itself. whatever layers of helpfulness you lay on top won't change the underlying issues with how it works internally |
12:50:40 | FromDiscord | <sOkam! 🫐> that said, amazing work on that extension. looking really gud! I didn't hear about it until now. love it |
12:51:11 | arkanoid | I know it uses nimlangsever, but the process that calls it is the extension, and the extension knows when files/editor is closed, and it should be responsible of cleaning up child processes |
12:51:24 | arkanoid | nimlangserver doesn't know when editor is closed |
12:56:29 | FromDiscord | <Robyn [She/Her]> In reply to @arkanoid "NimLang.nimlang https://marketplace.visualstudio.co": Doesn't come up on the VSC extension thing in the app... Hm |
13:00:04 | FromDiscord | <sOkam! 🫐> In reply to @arkanoid "nimlangserver doesn't know when": apparently the problem is listed in the `tooling roadmap RFC` todo list, very close to the top of the list |
13:03:45 | FromDiscord | <Robyn [She/Her]> Trying to figure out how to make allographer let me set a required length for binary data :p |
13:12:00 | FromDiscord | <Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=ASXRBmeBKWgc |
13:15:36 | FromDiscord | <joshdougvidarr> What's a nice easy Linux terminal app I could make in Nim? I was thinking of a TUI Pacman client but that's too much. I've not coded anything in about 2yrs and I'm new to Nim - suggestions on a postcard please? |
13:17:37 | * | junaid_ joined #nim |
13:19:13 | FromDiscord | <Phil> Honestly you could look into contributing to atlas |
13:19:51 | FromDiscord | <Phil> The task (package management) is alright in scope and you're not on your own and it benefits the wider community significantly |
13:19:59 | FromDiscord | <Phil> And it's also CLI |
13:20:22 | FromDiscord | <joshdougvidarr> Good idea - thank you! I'll take a look. 🙂 |
13:24:11 | * | junaid_ quit (Remote host closed the connection) |
13:25:14 | * | systemdsucks quit (Remote host closed the connection) |
13:46:45 | * | rockcavera joined #nim |
13:49:52 | * | junaid_ joined #nim |
13:50:51 | * | rockcavera quit (Remote host closed the connection) |
13:51:13 | * | rockcavera joined #nim |
14:11:10 | * | junaid_ quit (Remote host closed the connection) |
14:15:49 | * | jmdaemon quit (Ping timeout: 276 seconds) |
14:45:28 | FromDiscord | <joshdougvidarr> sent a long message, see https://pasty.ee/GMMSYzzlbnkj |
15:01:42 | FromDiscord | <␀ Array 🇵🇸 🍉> sent a long message, see https://pasty.ee/eDYInKWDwHZw |
15:02:49 | FromDiscord | <Phil (he/him)> TBF the last is not quite equivalent.↵↵The last one is equivalent to `echo "Hel", "lo"` |
15:03:25 | FromDiscord | <Phil (he/him)> Comes out to the same but overall different way to phrase the operation as opposed to `echo "Hello"` vs. `"Hello".echo()` which are equivalent |
15:03:30 | FromDiscord | <Robyn [She/Her]> Also you can do `echo"Hello"` :P |
15:11:19 | FromDiscord | <␀ Array 🇵🇸 🍉> yes, i ment identical output the procedure is being called twice |
15:28:39 | * | azimut joined #nim |
15:45:18 | FromDiscord | <joshdougvidarr> It's the kind of wild schizophrenic genius that Nikola Tesla would use. I think if Tesla was alive today he'd use Nim to program the worlds first FTL drive. |
15:50:44 | FromDiscord | <joshdougvidarr> I don't mean to scare anyone but I've completed 3 katas of Nim on codewars.com. When can I apply to be the lead dev of the language? |
15:51:20 | Amun-Ra | do you have black belt in nim? |
15:51:56 | FromDiscord | <joshdougvidarr> After 3 kata? I'm still white belt. |
15:52:09 | FromDiscord | <Phil> In reply to @Amun-Ra "do you have black": More importantly does he have all the 8 nim-gym badges to compete in the nim-league? |
16:17:00 | * | azimut quit (Remote host closed the connection) |
16:17:28 | * | azimut joined #nim |
16:30:09 | * | krux02 joined #nim |
16:31:43 | * | azimut quit (Ping timeout: 240 seconds) |
16:32:50 | * | azimut joined #nim |
17:02:53 | * | azimut quit (Read error: Connection reset by peer) |
17:03:56 | * | azimut joined #nim |
17:32:55 | * | azimut quit (Ping timeout: 240 seconds) |
17:37:52 | * | azimut joined #nim |
17:40:28 | * | junaid_ joined #nim |
17:48:43 | * | azimut quit (Remote host closed the connection) |
17:49:04 | * | azimut joined #nim |
17:57:17 | FromDiscord | <Phil> I amaze myself, I do Exception handling slightly differently, BAM, memory leak |
17:58:11 | FromDiscord | <Phil> I don't even get what I could possibly be leaking here.↵This is a proc raising an exception, that being caught by an inner try-catch, which transforms the exception and re-raises it to be cought in an outer try-catch.↵What is there to leak? |
18:00:38 | FromDiscord | <Phil> ... apparently it's fixed by calling the destroy hook on the exception... manually? I.. what? |
18:06:22 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=ZEpxAQWDiuzV |
18:06:46 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#pasty=qRnciDPgZkZW" => "https://play.nim-lang.org/#pasty=npKUMjAuPNXf" |
18:35:31 | FromDiscord | <piman_discriminator_1010> ummmm, is there something faster than `.toTable` at compile time? |
18:38:28 | FromDiscord | <piman_discriminator_1010> I have a compile time table of tables numbering 50000 string elements, `.toTable` took over a minute to compile |
18:39:59 | FromDiscord | <Phil> ... Any chance you can just statically define that table in a JSON file? |
18:40:04 | FromDiscord | <Phil> Or is it being computed? |
18:40:15 | FromDiscord | <Phil> I'd assume reading that sucker from a JSON file would be faster |
18:40:16 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "... Any chance you": I can |
18:40:27 | FromDiscord | <Phil> You can use staticRead for that |
18:40:37 | FromDiscord | <piman_discriminator_1010> would have to rewrite my code gen again though |
18:40:45 | FromDiscord | <Phil> hmm |
18:41:10 | FromDiscord | <piman_discriminator_1010> In reply to @piman_discriminator_1010 "would have to rewrite": but this shouldn't be too bad tbh |
18:41:35 | FromDiscord | <Phil> You can just try it out first, dump it to a JSON file and write yourself a one-liner that does nothing else but read in that file at compiletime |
18:41:51 | FromDiscord | <Phil> See how quickly that compiles, should take less than a second |
18:43:43 | FromDiscord | <piman_discriminator_1010> can the keys be integers with a JSON? |
18:44:40 | FromDiscord | <piman_discriminator_1010> (edit) "can the keys be integers with ... a" added "importing" |
18:45:08 | FromDiscord | <Phil> Nope, hmm |
18:45:48 | FromDiscord | <Phil> You can dump them as strings and parse them back into ints and see if that's still faster than generating them |
18:46:11 | FromDiscord | <Phil> Other than that, you could see if you can get away with writing them into a custom format from which you parse at compileTime |
18:48:44 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "Other than that, you": I can do that? |
18:49:05 | FromDiscord | <piman_discriminator_1010> also with `.toTable`, yea...... cpu go brrrrrrrrrrrrrrr lol https://media.discordapp.net/attachments/371759389889003532/1198700814609416272/image.png?ex=65bfdc20&is=65ad6720&hm=f750bfe73c9ccf5a3c488851b02d9f95394ec85f19f03bfd94f0ae890dd91fe9& |
18:50:32 | FromDiscord | <Phil> In reply to @piman_discriminator_1010 "I can do that?": Sure. It's just representing a table as a string.↵You are the one that writes the file and reads from it, you can decide that format |
18:50:50 | FromDiscord | <piman_discriminator_1010> no I mean the parsing at compile time |
18:51:42 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=bIujcsddQXCj |
18:52:23 | FromDiscord | <Phil> There's also like 3 more ways to call a proc at compileTime, but the one above suffices |
18:53:09 | FromDiscord | <piman_discriminator_1010> though come to think of it, I would prefer to not need to parse because I need to code gen the table as enums too, wait, can I store the "file" as a string literal and parse that? |
18:53:52 | FromDiscord | <piman_discriminator_1010> (but at 50000 elements, that would be a lot of memory if it stays after parsing) |
18:54:30 | FromDiscord | <Phil> In reply to @piman_discriminator_1010 "though come to think": Pretty much what you'll have to do |
18:54:47 | FromDiscord | <Phil> A file is just a string that you can click on via your file manager |
18:54:54 | FromDiscord | <Phil> a txt file |
18:55:41 | FromDiscord | <Phil> And you have that memory consumption either way |
18:55:58 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "And you have that": well yes, but temporary vs permanent |
18:56:18 | FromDiscord | <piman_discriminator_1010> or well actually no, with a file you can stream |
18:56:25 | FromDiscord | <Phil> Wait, do you need the table only at compiletime for codegen? |
18:56:42 | FromDiscord | <piman_discriminator_1010> no, the codegen is to make the table |
18:56:47 | FromDiscord | <Phil> Ah check |
18:56:54 | FromDiscord | <piman_discriminator_1010> I need it at runtime to convert magic numbers |
18:56:59 | FromDiscord | <piman_discriminator_1010> (edit) "I need it at runtime to convert magic numbers ... " added "to readable text" |
18:57:36 | FromDiscord | <Phil> Could you just have a seq? |
18:57:42 | FromDiscord | <Phil> Or rather an array I guess |
18:57:51 | FromDiscord | <piman_discriminator_1010> (and then I need the enums to convert readable text to magic numbers) |
18:58:11 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "Could you just have": it's a sparse array, there are holes in the indexing |
18:58:17 | FromDiscord | <piman_discriminator_1010> (edit) "it's a" => "it would be" |
18:58:21 | FromDiscord | <piman_discriminator_1010> (edit) "In reply to @isofruit "Could you just have": it would be ... sparse" added "a" |
18:58:24 | FromDiscord | <Phil> Sure, but that shouldn't play a role right? |
18:58:49 | FromDiscord | <Phil> If necessary you can write yourself a proc for accessing the array and if a value is a sentinel value that indicates "empty" you can raise an exception |
18:58:50 | FromDiscord | <piman_discriminator_1010> the text i'm generating this from also isn't in order |
18:59:05 | FromDiscord | <piman_discriminator_1010> (edit) "the text i'm generating this from also isn't in order ... " added "(well it's in alphabetical order rather than numeric)" |
18:59:22 | FromDiscord | <Phil> Doesn't have to be.↵Pre-allocate an array of the size and then just assign to the indexes |
19:00:24 | FromDiscord | <Phil> Like, you can know the max-index at compiletime right?↵You could go `array[maxIndex, string]` or whatever the second value is and then follow that up with a massive amount of `thatArray[someIndex] = "lala"` |
19:00:43 | * | junaid_ quit (Quit: Lost terminal) |
19:01:00 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "Like, you can know": theoretically I would know, but I would have to write another program to actually find out lol |
19:01:19 | FromDiscord | <Phil> Is it a word-count? |
19:01:25 | FromDiscord | <Phil> If so, readFile.split(" ").len() |
19:01:39 | FromDiscord | <Phil> (edit) "readFile.split("" => "`<somereadfileproc>`.split("" |
19:01:43 | FromDiscord | <piman_discriminator_1010> also one of the subtables is 4000 elements, while most subtables are under 10 elements |
19:01:49 | FromDiscord | <piman_discriminator_1010> (edit) "4000" => "4000+" |
19:01:53 | FromDiscord | <Phil> Hmmmm |
19:01:54 | FromDiscord | <piman_discriminator_1010> (edit) "4000+" => "8000+" |
19:05:33 | FromDiscord | <piman_discriminator_1010> what's the lifetime of a string literal passed directly as an argument? |
19:05:38 | FromDiscord | <Phil> So basically my approaches boil down to:↵- Write the table to a file, read that in and parse it into a table, see if that's faster↵- Instead of using .toTable, generate a bunch of direct assignments, see if that's faster↵- Try to store it as a seq instead |
19:06:06 | FromDiscord | <piman_discriminator_1010> can I build a table that way at compile time? |
19:06:22 | FromDiscord | <piman_discriminator_1010> wait, parsing would have to do that too lol |
19:06:38 | FromDiscord | <piman_discriminator_1010> I could try direct assignments I guess |
19:07:04 | FromDiscord | <Phil> In reply to @piman_discriminator_1010 "wait, parsing would have": Yeah, just trying to circumvent the codegen there which I assume is also expensive |
19:08:01 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=GxGogRuwTeMJ |
19:08:47 | FromDiscord | <piman_discriminator_1010> In reply to @isofruit "Yeah, just trying to": my code gen runs in under a second |
19:09:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=jmguprqIcJNH |
19:09:16 | FromDiscord | <piman_discriminator_1010> which I find actually kind of impressive with all the fprintfs lol |
19:09:56 | FromDiscord | <Phil> The difference here is that you don't first have to allocate whatever set-like structure you first used to then punch that into a table |
19:10:03 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=sbZZyGzhNRZY |
19:10:08 | FromDiscord | <Phil> You just start with a table and punch things into it |
19:10:56 | FromDiscord | <Phil> Almost, initTable[int, string]() |
19:11:07 | FromDiscord | <piman_discriminator_1010> thanks, I will try this thn |
19:11:09 | FromDiscord | <piman_discriminator_1010> (edit) "thn" => "then" |
19:12:04 | * | lucasta joined #nim |
19:23:12 | FromDiscord | <piman_discriminator_1010> hmm, still taking a long time to compile |
19:26:03 | FromDiscord | <piman_discriminator_1010> actually seems to be taking longer |
19:31:19 | FromDiscord | <piman_discriminator_1010> hmm, and nimble doesn't seem to do incremental building? |
19:32:05 | FromDiscord | <Phil> I mean you can do incremental building typically, but that is more of a "per-file" operation and how it works in detail I couldn't tell you |
19:32:25 | FromDiscord | <Phil> You might get more detaild answers if you were to make a forum question about this or wait for elegantbeef or Pmunch to come around |
19:32:26 | FromDiscord | <piman_discriminator_1010> well, this table is in it's own file |
19:32:47 | FromDiscord | <Phil> detailed |
19:34:07 | FromDiscord | <leorize> nim doesn't do IC at the moment |
20:00:39 | FromDiscord | <piman_discriminator_1010> can `echo` accept extra arguments to `$`?↵if I define `$` with a default second argument can I call that from echo or do I need to call `$` directly still |
20:03:31 | FromDiscord | <leorize> sure |
20:03:39 | FromDiscord | <leorize> basically whenever you write `echo x` it's turned into `echo $x` |
20:03:43 | FromDiscord | <leorize> echo doesn't call `$`, it's a bit of a syntactic sugar |
20:13:58 | FromDiscord | <piman_discriminator_1010> ahh, cool |
20:21:47 | FromDiscord | <Robyn [She/Her]> Time to work on my macro for wrapping MC packets into Nim data types |
20:23:36 | FromDiscord | <Robyn [She/Her]> Nvm nope dopamine does not lay here |
20:25:04 | FromDiscord | <piman_discriminator_1010> is there a printf like function in nim, it's getting annoyting typing `&` and `"` all the time |
20:26:11 | FromDiscord | <Robyn [She/Her]> In reply to @piman_discriminator_1010 "is there a printf": https://nim-lang.org/docs/strutils.html#%25,string,openArray[string] |
20:26:29 | FromDiscord | <Robyn [She/Her]> And this: https://nim-lang.org/docs/strutils.html#format%2Cstring%2Cvarargs%5Bstring%2C%5D |
20:26:49 | FromDiscord | <Robyn [She/Her]> Though, you might like https://nim-lang.org/docs/strformat.html more |
20:27:17 | FromDiscord | <Robyn [She/Her]> it lets you do `echo &"Hello {name}! Nice to meet you!"` |
20:27:22 | FromDiscord | <Robyn [She/Her]> Like Python f-strings |
20:29:45 | Amun-Ra | but not as flexible |
20:30:21 | Amun-Ra | (no {} nesting) |
20:31:20 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "(no {} nesting)": Nesting? |
20:36:32 | FromDiscord | <Robyn [She/Her]> Anyone happen to know how to execute raw SQL with Allographer? |
20:37:19 | FromDiscord | <varriount> @zevv Saw your comment on Hacker News in that Pratt Parser submission. ;P |
20:37:54 | FromDiscord | <piman_discriminator_1010> In reply to @leorize "basically whenever you write": hmmm, this didn't work↵`echo property, true` |
20:37:55 | FromDiscord | <Robyn [She/Her]> Nvm found how to do it |
20:38:00 | FromDiscord | <piman_discriminator_1010> it just printed property, then true |
20:38:11 | FromDiscord | <piman_discriminator_1010> rather than printing property with argument true |
20:38:15 | FromDiscord | <Robyn [She/Her]> In reply to @piman_discriminator_1010 "it just printed property,": That works as intended then |
20:38:46 | FromDiscord | <Robyn [She/Her]> In reply to @piman_discriminator_1010 "hmmm, this didn't work": Do `echo property(true)`, right now, `true` is being passed to `echo`, not `property` |
20:39:02 | FromDiscord | <Robyn [She/Her]> `echo property, true` is the same as `echo(property, true)` |
20:40:30 | FromDiscord | <piman_discriminator_1010> this did the same thing `echo property(true)` |
20:44:16 | FromDiscord | <Robyn [She/Her]> In reply to @piman_discriminator_1010 "this did the same": Wdym? |
20:45:29 | FromDiscord | <piman_discriminator_1010> it echoed property followed by the literal true |
20:46:45 | FromDiscord | <Robyn [She/Her]> Did you compile the code again? |
20:50:08 | FromDiscord | <piman_discriminator_1010> let me try again (but it takes a while to compile) |
20:51:03 | FromDiscord | <piman_discriminator_1010> nope, nvm it errors↵`Error: attempting to call routine: 'property'` |
20:53:56 | FromDiscord | <piman_discriminator_1010> this is the only thing I have found to work↵`echo property.`$`(true)` |
20:54:05 | FromDiscord | <piman_discriminator_1010> (edit) "property.`$`(true)`" => "property.\`$\`(true)`" |
20:54:25 | FromDiscord | <piman_discriminator_1010> (edit) "this is the only thing I have found to work↵`echo property.\`$\`(true)`" => "sent a code paste, see https://play.nim-lang.org/#pasty=grsKkhwGMfRV" |
20:59:39 | FromDiscord | <Elegantbeef> @piman_discriminator_1010 What are you doing? |
20:59:53 | FromDiscord | <piman_discriminator_1010> just wanted to be able to print extra info with a flag |
21:00:37 | FromDiscord | <Elegantbeef> So then make a `toString` proc |
21:27:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=MFyLMmicFksu |
21:28:37 | FromDiscord | <Elegantbeef> That's not bonkers phil |
21:28:41 | FromDiscord | <Phil> But that shouldn't be a race imo, it only gets freed if one of them goes to 0... wait fuck |
21:28:46 | FromDiscord | <Phil> What if they write at the same time |
21:28:46 | FromDiscord | <Elegantbeef> In the first case `msg` lives until the end of loop |
21:28:59 | FromDiscord | <Elegantbeef> In the second case the message is scoped to the `while` loop |
21:29:23 | FromDiscord | <Phil> ... Can I change that lifetime to end at sendMessage in some way? |
21:29:35 | FromDiscord | <Phil> It's already a `sink`annotated parameter |
21:29:44 | FromDiscord | <Elegantbeef> `ensureMove` might work |
21:29:53 | FromDiscord | <Elegantbeef> But it's a ref so they do not abide by move semantics |
21:30:21 | FromDiscord | <Phil> Is that a thing? |
21:30:29 | FromDiscord | <Phil> Ah, it's a proc |
21:35:27 | FromDiscord | <Phil> Hmmm ensureMove does not play well with sink |
21:35:37 | FromDiscord | <Elegantbeef> It does play well with sink |
21:35:41 | FromDiscord | <Elegantbeef> Cause that's the entire point |
21:35:55 | FromDiscord | <Phil> Only in the sense that it causes compiler errors which talk about implicit copies |
21:36:10 | FromDiscord | <Elegantbeef> It also `move`s |
21:36:23 | FromDiscord | <Elegantbeef> So it does indeed play well with sink |
21:36:32 | FromDiscord | <Elegantbeef> But it does not solve your issue cause references are not sinkable |
21:36:39 | FromDiscord | <Phil> Hmmm |
21:37:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=nQxkgpopffHY |
21:37:29 | FromDiscord | <Phil> ... I really don't want to |
21:37:36 | FromDiscord | <Phil> I'm halfway on board if I can hide this from the user |
21:37:51 | FromDiscord | <Elegantbeef> `owned MyRef(....)` |
21:38:04 | FromDiscord | <Phil> If I can't my package becomes halfway pointless if it starts becoming that inconvenient to use that I need to force them to do manual message instantiations like this all the time |
21:38:39 | FromDiscord | <Elegantbeef> Nim is just not setup to properly handle refs with threads |
21:38:51 | FromDiscord | <leorize> have you tried `--mm:atomicArc`? \:p |
21:38:53 | FromDiscord | <Elegantbeef> You have to `Isolate` at instantiation level to actually get move semantics |
21:39:05 | FromDiscord | <Phil> Which is impossible semantics |
21:39:21 | FromDiscord | <Elegantbeef> Or you can make your own distinct that does not have the same restrictions 😄 |
21:40:36 | FromDiscord | <leorize> you can also use nimskull where arc won't race, just saying |
21:41:11 | FromDiscord | <Elegantbeef> Could also use Rust! |
21:42:03 | FromDiscord | <Phil> sent a long message, see https://pasty.ee/lXtQwFLftEbH |
21:42:48 | FromDiscord | <Phil> (edit) "https://pasty.ee/xxWIOGuAXTif" => "https://pasty.ee/hyeqKSAqByMb" |
21:42:58 | FromDiscord | <leorize> installing nimskull got like, 10x easier with this stuff\: https://github.com/nim-works/asdf-nimskull |
21:43:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=JLMnrIEfReOg |
21:45:16 | FromDiscord | <leorize> https://mise.jdx.dev/ \<- use this instead of asdf just because it's faster |
21:45:23 | FromDiscord | <leorize> and it's a drop-in replacement for asdf |
21:48:16 | * | tiorock joined #nim |
21:48:16 | * | rockcavera quit (Killed (iridium.libera.chat (Nickname regained by services))) |
21:48:16 | * | tiorock is now known as rockcavera |
21:50:32 | FromDiscord | <Elegantbeef> The readme is lying to me now leo.... 😛 |
21:50:59 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wZgWeJRwzkfb |
21:51:51 | FromDiscord | <leorize> \:p |
21:52:04 | FromDiscord | <leorize> use the one with the git repo in it xd |
21:52:11 | FromDiscord | <Elegantbeef> I did |
21:52:19 | * | lucasta quit (Remote host closed the connection) |
21:52:35 | FromDiscord | <Elegantbeef> mise must have a different UX here |
21:53:01 | FromDiscord | <Elegantbeef> Seems it thinks all words following `install` are packages |
21:53:50 | FromDiscord | <leorize> try `nimskull@latest` ig |
21:54:01 | FromDiscord | <Elegantbeef> Also makes another executable named `nim` so I'm not following through |
21:54:50 | FromDiscord | <leorize> too bad we haven't renamed nimskull compiler yet |
22:00:28 | FromDiscord | <Phil> I'm actually still not sure if my data-race is an actual problem |
22:00:50 | FromDiscord | <Phil> Because the counter is either 2 or 1 |
22:00:51 | FromDiscord | <Elegantbeef> It'll likely run into a double free if my assumption is right |
22:01:05 | FromDiscord | <Elegantbeef> Well then perhaps not 😄 |
22:01:27 | FromDiscord | <Phil> Like, the message will exist (in that sense) on the main thread and the other thread |
22:01:33 | FromDiscord | <Phil> One of them will see the count down from 2 to 1 |
22:01:35 | FromDiscord | <Phil> The other from 1 to 0 |
22:01:44 | FromDiscord | <leorize> are you sure? |
22:01:51 | FromDiscord | <Phil> I literally can not be |
22:02:07 | FromDiscord | <leorize> and that's not counting what happens first |
22:02:13 | FromDiscord | <leorize> zero happens first for free happens first? |
22:02:55 | FromDiscord | <leorize> s/for/or/ |
22:03:33 | FromDiscord | <piman_discriminator_1010> hmmmm, theres no proc for `''(string, int)`? |
22:14:31 | * | advesperacit quit () |
22:18:12 | FromDiscord | <domosokrat> There is `repeat(string, Natural)` in strutils↵(@piman_discriminator_1010) |
22:18:28 | FromDiscord | <piman_discriminator_1010> ah, thanks |
22:19:03 | FromDiscord | <piman_discriminator_1010> does it allow `0` as well? |
22:19:28 | FromDiscord | <piman_discriminator_1010> ex: `repeat("foo", 0)` returning an empty string |
22:20:03 | FromDiscord | <domosokrat> Don't know. Try it. |
22:21:25 | FromDiscord | <piman_discriminator_1010> seems to have probably worked |
22:21:47 | FromDiscord | <piman_discriminator_1010> didn't error (but it's also not printing right anyways, so idk if it's even being called) |
22:22:41 | FromDiscord | <piman_discriminator_1010> also takes a good 30 seconds or so to compile a single nim file :mood: |
22:22:46 | FromDiscord | <Phil> In reply to @leorize "are you sure?": From what I can tell, the race is when they check if they are the respective last reference.↵Naturally because of how compilers may fuck with ordering I can't guarantee anything.↵Damnit, this wouldn't be a problem if the counters were simply Atomics |
22:23:05 | FromDiscord | <Phil> (edit) "In reply to @leorize "are you sure?": From what I can tell, the race is when they check if they are the respective last reference.↵Naturally because of how compilers may fuck with ordering I can't guarantee anything.↵Damnit, this wouldn't be" => "sent" | "problem if the counters were simply Atomics" => "long message, see https://pasty.ee/WOpycZwLqKWz" |
22:23:44 | FromDiscord | <leorize> they also race trying to decrement them |
22:24:08 | FromDiscord | <Phil> Yeah which means worst case scenario data-leak because both decrement at the same time |
22:24:21 | FromDiscord | <Phil> Leading to only 1 decrement happening where 2 should be happening |
22:24:27 | FromDiscord | <leorize> yep |
22:24:37 | FromDiscord | <leorize> `--mm:atomicArc` and join the dark side |
22:25:05 | FromDiscord | <Phil> How the hell is that not the standard? That seems like the kind of thing without everything is fucked |
22:25:13 | FromDiscord | <Phil> Is the performance degradation that brutal? |
22:25:21 | FromDiscord | <Elegantbeef> On older hardware, yes |
22:26:16 | FromDiscord | <Phil> ... that is the kind of situation that just demotivates me, like... what are you supposed to do at that point.↵So either your program is slow or single threaded and thus also slow? |
22:26:34 | FromDiscord | <Elegantbeef> Single threaded code is not slow |
22:26:39 | FromDiscord | <leorize> it is said that a swift program spends 30% of its time doing atomic rc the last time I checked |
22:26:42 | FromDiscord | <Phil> Sure it isn't until you hit stutters |
22:27:10 | FromDiscord | <Phil> and frame-drops because a blocking operation makes the application non-responsive for a second |
22:27:53 | FromDiscord | <Elegantbeef> Just write simpler projects that allow you to temporally calculate things |
22:28:49 | FromDiscord | <Phil> I can't even move data that is behind a ref into pointer territory without copies I don't think, ugh |
22:28:58 | FromDiscord | <Elegantbeef> You can |
22:29:07 | FromDiscord | <Elegantbeef> A ref is just a pointer |
22:29:43 | FromDiscord | <Elegantbeef> `cast[ptr int](new int)` is legal assuming you do `GcRef` to keep the reference alive |
22:30:07 | FromDiscord | <leorize> disruptek packed his rc manipulation shenanigans into a neat module in insideout |
22:30:13 | FromDiscord | <Phil> Yeah but the idea is you give me e.g. a ref object to send through a channel, I turn it into a pointer and now I'm outside of nim's entire memory management system |
22:30:47 | FromDiscord | <Phil> And pump that pointer through the channel and transform it into a ref with a counter of 1 somehow that gets returned from a read proc |
22:30:59 | FromDiscord | <leorize> you should probably consult the two people who worked on that exact problem |
22:31:22 | FromDiscord | <leorize> because they broke several walls banging their heads on that one |
22:31:36 | FromDiscord | <Phil> I'll do that tomorrow, right now I'm feeling like 5% depressed and that's enough to kill coding enthusiasm for the day |
22:34:01 | NimEventer | New thread by sergio: Cannot open file: db_connector/db_sqlite, see https://forum.nim-lang.org/t/10896 |
22:34:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=AIjvhLcxncye |
22:36:38 | * | systemdsucks joined #nim |
23:03:50 | FromDiscord | <Elegantbeef> Well this is pretty nice https://github.com/beef331/traitor/blob/master/traitor/streams.nim#L80-L100 |
23:04:49 | FromDiscord | <Elegantbeef> Exact same api for the trait wrapped object as for the non trait wrapped object, it's totally something |
23:09:35 | FromDiscord | <Phil (he/him)> Ah, leorize - tsan works if you set ASLR to 28 bits for clang 16.0.6 |
23:09:50 | FromDiscord | <Phil (he/him)> There's a clang version from november that can go up to 30 bits, but at least arch doesn't have it |
23:10:31 | FromDiscord | <Phil (he/him)> Basically running `sudo sysctl vm.mmap_rnd_bits=28` should do the trick |
23:10:36 | FromDiscord | <Phil (he/him)> Neat ! |
23:14:27 | FromDiscord | <leorize> it hasn't stopped working for me, luckily |
23:14:40 | FromDiscord | <Phil (he/him)> What kernel are you on? |
23:14:45 | FromDiscord | <Phil (he/him)> 6.6.6 or higher? |
23:17:20 | FromDiscord | <Elegantbeef> I stay on the devils kernel |
23:22:55 | FromDiscord | <thepuzzleddev> Is there a way to use nim with value-based error handling like in go or rust rather than exceptions? |
23:24:21 | FromDiscord | <Elegantbeef> Yea you just do |
23:24:42 | FromDiscord | <Elegantbeef> There are multiple results packages and `std/options` in the stdlib |
23:24:45 | FromDiscord | <Elegantbeef> Plus it has tuples |
23:24:50 | FromDiscord | <Elegantbeef> So you can just write go code |
23:25:12 | FromDiscord | <thepuzzleddev> awesome thanks |
23:29:09 | FromDiscord | <leorize> 6.6.11 |
23:41:43 | FromDiscord | <piman_discriminator_1010> what's the typical naming convention for enums? |
23:42:41 | FromDiscord | <leorize> `CamelCase` pretty much |
23:45:11 | FromDiscord | <piman_discriminator_1010> ....... enums can't start with numbers can they :mood: ugh |
23:45:26 | FromDiscord | <piman_discriminator_1010> In reply to @leorize "`CamelCase` pretty much": for the enums or the enum class name? |
23:54:09 | FromDiscord | <piman_discriminator_1010> sent a code paste, see https://play.nim-lang.org/#pasty=IupsWVTLQjNK |
23:54:34 | FromDiscord | <piman_discriminator_1010> how do I sanatiz a literal dot :PepeHands: |
23:54:40 | FromDiscord | <piman_discriminator_1010> (edit) "sanatiz" => "sanitize" |
23:55:26 | FromDiscord | <michaelb.eth> In reply to @isofruit "I read Zevv's thread": was that a forum thread or gh isssue or …? |
23:55:52 | FromDiscord | <thepuzzleddev> In reply to @Elegantbeef "There are multiple results": My issue though is that the std library still uses exception, and there's nothing in the function signature indicating it can throw one |
23:56:52 | FromDiscord | <Elegantbeef> Yea there is |
23:57:09 | FromDiscord | <Elegantbeef> Annotate all your procedures with `{.raises: [].}` |
23:57:15 | FromDiscord | <Elegantbeef> you now have the rust assurance |
23:58:06 | FromDiscord | <thepuzzleddev> Yes, but in the std most of the functions have no indication they can throw https://media.discordapp.net/attachments/371759389889003532/1198778580214227004/2024-01-21_18-57.png?ex=65c0248d&is=65adaf8d&hm=300b8158d4fde1b031889ebfe8e15897f25906604c13116d9775ee420a2bb1b5& |
23:58:21 | FromDiscord | <Elegantbeef> They do |
23:58:29 | FromDiscord | <Elegantbeef> The compiler infers raises and annotates it in the doc gen |
23:59:59 | FromDiscord | <michaelb.eth> at the top of your module/s you can put `{.push raises: [].}`, then recompile and you should start getting compile-time errors about std this or that raising an unlisted Exception |