00:05:04 | FromDiscord | <sOkam! π«> Is there any existing/up-to-date way to translate python to nim? |
00:05:08 | * | FromDiscord quit (Remote host closed the connection) |
00:05:21 | * | FromDiscord joined #nim |
00:05:53 | * | FromDiscord quit (Remote host closed the connection) |
00:06:06 | * | FromDiscord joined #nim |
00:06:49 | * | FromDiscord quit (Remote host closed the connection) |
00:07:02 | * | FromDiscord joined #nim |
00:07:43 | FromDiscord | <sOkam! π«> These two functions are all I need to translate, but last time I tried manually translating them it didn't go well πβ΅So wondering if there is any alternative to doing it manually https://media.discordapp.net/attachments/371759389889003532/1216175614726377642/og.py?ex=65ff6ece&is=65ecf9ce&hm=dd66308a69d989b801fae046073d7ede95c764ed3372a3cdb7e7f173c4f6ffc1& |
00:08:44 | FromDiscord | <sOkam! π«> @ElegantBeef is there anything like that `bisect_right` function already in nim? or can you think of a way to do that simply? |
00:11:34 | FromDiscord | <Elegantbeef> Just use a priority queue? |
00:11:49 | FromDiscord | <sOkam! π«> whats a priority queue π€ |
00:12:01 | FromDiscord | <Elegantbeef> A queue that is sorted by priority |
00:12:19 | FromDiscord | <sOkam! π«> im not following |
00:12:25 | FromDiscord | <Elegantbeef> One of the queue impls in the stdlib is a priority queue |
00:12:28 | FromDiscord | <sOkam! π«> how is that related to random.choices? |
00:12:41 | FromDiscord | <Elegantbeef> I mean the biset\_right inserts an element no? |
00:12:48 | FromDiscord | <sOkam! π«> ah you mean for bisect |
00:13:06 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "One of the queue": which module exactly? never seen queues in nim |
00:13:16 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/heapqueue.html |
00:13:19 | FromDiscord | <sOkam! π«> ty |
00:15:20 | FromDiscord | <sOkam! π«> goes all over my head big time. no clue how to recreate python random.choices() with this |
00:15:38 | FromDiscord | <sOkam! π«> i cannot even see the relationship with bisect_right π |
00:16:55 | FromDiscord | <Elegantbeef> Then just port the code over |
00:16:58 | FromDiscord | <Elegantbeef> I don't even know what this is doing |
00:18:12 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "I don't even know": its a classic `choices`, but it allows you to add a weight to each element of the array |
00:18:36 | arkanoid | Elegantbeef, I'm reading about mixins, as I never used them |
00:18:48 | arkanoid | also seems quite complicated to extract an example from this |
00:18:57 | arkanoid | I'l tryy |
00:19:07 | FromDiscord | <sOkam! π«> (edit) "array" => "arrayβ΅choices gives the same priority to every element, but this gives you a way to skew the result towards each element with a specific weight" |
00:19:13 | FromDiscord | <Elegantbeef> Put a `mixin procedureName` inside your generic procedures |
00:20:01 | arkanoid | this is the signature of the proc that should be imported, but it's not found in the generic proc "proc contains*(attr: H5Attributes, key: string): bool" |
00:20:19 | arkanoid | is it "mixin contains" ? |
00:20:25 | FromDiscord | <Elegantbeef> yes |
00:21:01 | arkanoid | same error |
00:21:03 | FromDiscord | <Elegantbeef> Right then I'd just say to port this verbatim sokam removing all the incessant `None` checking |
00:21:57 | FromDiscord | <Elegantbeef> You're holding it wrong |
00:38:30 | arkanoid | I've isolated the portion of code that goes compile error, error is no more there |
00:38:40 | arkanoid | this means that the nim compiler is giving the wrong compile error |
00:38:49 | arkanoid | this is impossible to debug |
00:38:59 | FromDiscord | <ElegantBeef> Bridge being funny |
00:39:18 | FromDiscord | <ElegantBeef> It's likely a generic binding issue are you using `not` or `notin`? |
00:39:45 | FromDiscord | <bosinski2023> , |
00:40:47 | arkanoid | the error is on a line with `in`: https://github.com/Vindaar/nimhdf5/blob/4dc50f90f02ba01d363d6701af38f7c048d0903c/src/nimhdf5/attributes.nim#L354 |
00:41:13 | FromDiscord | <ElegantBeef> You put a `mixin contains` inside that procedure? |
00:41:20 | arkanoid | All I can do is do a larger isolated test until I spot |
00:41:31 | arkanoid | I tried to add mixin contains just before that line |
00:41:49 | FromDiscord | <ElegantBeef> ok change that `h5attr.contains name` and see if it persists |
00:42:21 | arkanoid | this is the error I get https://play.nim-lang.org/#pasty=DQnuLtfUiPki |
00:42:47 | arkanoid | as you can see "proc contains*(attr: H5Attributes, key: string)" is not listed, but it really is https://github.com/Vindaar/nimhdf5/blob/4dc50f90f02ba01d363d6701af38f7c048d0903c/src/nimhdf5/attributes.nim#L399 |
00:42:50 | FromDiscord | <ElegantBeef> Yea it's not binding properly which makes me think the `in` template is causing it to not properly bind |
00:43:04 | FromDiscord | <ElegantBeef> You get the same thing with `items` in generics |
00:43:19 | FromDiscord | <ElegantBeef> If you do not use `items` or `pairs` directly you get generic issues |
00:44:07 | FromDiscord | <ElegantBeef> Wait that's declared after the procedure |
00:44:07 | arkanoid | changed into "let attr_exists = h5attr.contains(name)", same error |
00:44:13 | FromDiscord | <ElegantBeef> That'll never bind |
00:44:25 | FromDiscord | <ElegantBeef> Move contains before that procedure and even with `in` it'll likely work |
00:44:31 | FromDiscord | <ElegantBeef> Declaration order matters |
00:44:53 | FromDiscord | <ElegantBeef> A generic cannot bind a procedure that it does not know about |
00:45:16 | FromDiscord | <ElegantBeef> You won't need `mixin` or `bind` when you do that either |
00:45:20 | FromDiscord | <Elegantbeef> Ping |
00:45:34 | arkanoid | moved `proc contains` before `proc read_attribute` and now I get different compile error! |
00:45:39 | arkanoid | no mixin involved |
00:46:32 | arkanoid | thanks beef (as usual) |
00:46:47 | FromDiscord | <Elegantbeef> Let's be honest it's implied at this point |
00:51:57 | arkanoid | I actually touch about it, but I moved the proc 1 less slot ahead than needed |
00:52:05 | arkanoid | maybe I should do a PR |
00:53:28 | FromDiscord | <sOkam! π«> @ElegantBeef I just randomly found this searching for something else:β΅https://nim-lang.org/docs/random.html#sample%2CopenArray%5BT%5D%2CopenArray%5BU%5Dβ΅Do you know how this function works? Is it doing the same thing I was trying to do with the cumulative weights thing from python? π€ |
00:54:48 | FromDiscord | <Robyn [She/Her]> I wonder if system.nim can be written without making use of any magic |
00:54:48 | FromDiscord | <Elegantbeef> It's indirection all the way down https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/random.nim#L524-L525 |
00:54:54 | FromDiscord | <Robyn [She/Her]> Probably not |
00:55:13 | FromDiscord | <Elegantbeef> No cause there are no integers without magic |
00:55:19 | FromDiscord | <Elegantbeef> Or arrays |
00:55:43 | FromDiscord | <Elegantbeef> Without magic you get... `object` |
00:56:06 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "It's indirection all the": wdym? |
00:56:18 | FromDiscord | <Elegantbeef> It keeps calling procedures in small procedures |
00:56:25 | FromDiscord | <Elegantbeef> Code reuse and all that jazz |
00:56:40 | FromDiscord | <sOkam! π«> so answer is you don't know how it works? |
00:56:40 | FromDiscord | <Elegantbeef> It seems like it is similar |
00:56:43 | FromDiscord | <Elegantbeef> Whether it's the same I have no clue |
00:56:50 | FromDiscord | <sOkam! π«> i see, ty |
00:59:21 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "No cause there are": Couldn't you just wrap a C integer for the native backends? |
01:00:02 | * | nazgulsenpai quit (Quit: ZNC 1.8.2 - https://znc.in) |
01:00:44 | FromDiscord | <Elegantbeef> Those are defined as aliases to builtins |
01:04:36 | * | nazgulsenpai joined #nim |
01:08:52 | FromDiscord | <sOkam! π«> @ElegantBeef it did exactly the right thing! damn, wasted so much time not knowing this existed https://media.discordapp.net/attachments/371759389889003532/1216191002646155345/image.png?ex=65ff7d22&is=65ed0822&hm=a8299880fd6e7452c0ed78169b34028a7b169f817c1ba492cf5f02cb9a7bb9db& |
01:09:21 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=PnDpRSpKXCzk |
01:09:36 | FromDiscord | <sOkam! π«> (edit) "https://play.nim-lang.org/#pasty=dVtnAzLPHQwu" => "https://play.nim-lang.org/#pasty=ihtHffmAOtSt" |
01:10:49 | arkanoid | keep fighting in generic and concept context: "got: <typedesc[Meter], typedesc[DecaMeter], typedesc[Minute]> but expected: <D: Length, LD: Length, T: Time>" |
01:11:03 | arkanoid | damn you nim compiler, you are not helpful at all |
01:16:04 | FromDiscord | <Robyn [She/Her]> Oh I wonder how hard it'd be to compile Nim libraries into static libraries then only recompile the static libs once you do something like add a genetic so you can reduce the time Nim takes to build projects |
01:16:25 | FromDiscord | <Elegantbeef> Sounds like IC with more work |
01:16:28 | FromDiscord | <Robyn [She/Her]> Since it'd prefer the static lib to compile against instead of the Nim code |
01:16:41 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Sounds like IC with": Why would it be more work? |
01:16:53 | FromDiscord | <Robyn [She/Her]> Well |
01:17:01 | FromDiscord | <Elegantbeef> Cause you still need the IC cache but now also need to compile static libraries |
01:17:11 | FromDiscord | <Elegantbeef> Plus you have no compile time support |
01:17:24 | FromDiscord | <Robyn [She/Her]> Yeah okay :p |
01:17:29 | FromDiscord | <Robyn [She/Her]> Welp |
01:17:31 | FromDiscord | <Robyn [She/Her]> I tried |
01:18:55 | FromDiscord | <Elegantbeef> If there was an easy solution to IC it'd be done |
01:20:01 | FromDiscord | <Robyn [She/Her]> Fair |
01:20:23 | FromDiscord | <Robyn [She/Her]> This sucks though, compiling takes so long and I don't understand enough to help with IC |
01:22:07 | FromDiscord | <Robyn [She/Her]> Pong |
01:22:26 | FromDiscord | <Robyn [She/Her]> Testing bridge responsiveness |
01:23:36 | FromDiscord | <Robyn [She/Her]> Seems fine |
01:23:37 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=sPtcDXTnvRAR |
01:24:41 | FromDiscord | <Robyn [She/Her]> Do you mean initialising an array's value via index assignment in the constructor? |
01:24:55 | FromDiscord | <Robyn [She/Her]> I don't know C++ |
01:25:14 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=muNtteJOsmtz |
01:26:21 | FromDiscord | <sOkam! π«> In reply to @Robyn "I don't know C++": actually, that doesn't exist in C++, afaik its a C thing |
01:26:30 | FromDiscord | <sOkam! π«> at least for objects |
01:27:06 | FromDiscord | <Elegantbeef> There is not |
01:27:06 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/10037#66190 |
01:27:16 | FromDiscord | <Elegantbeef> `Left: 2, Right: 2, Up: 1, Down: 2` |
01:27:30 | FromDiscord | <Robyn [She/Her]> Ahβ΅(@sOkam! π«) |
01:29:32 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "`Left: 2, Right: 2,": how do you use this? |
01:30:43 | FromDiscord | <Robyn [She/Her]> Ah the bridge is lagging |
01:31:06 | FromDiscord | <Elegantbeef> Paste it inside `[]` |
01:31:12 | FromDiscord | <sOkam! π«> the slice thing is neat, but doesn't solve my problemβ΅the example I gave only has 4 options and its easy to read... but that won't be the case for the other cases. so doesn't serve the goal sadly π |
01:31:24 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "Paste it inside `[]`": then it does exist |
01:31:46 | FromDiscord | <sOkam! π«> that is essentially what designated initialization is |
01:34:20 | FromDiscord | <Elegantbeef> I'd argue it's not the same since it creates an array and all indices have to be written, I'm guessing C allows `int arr[7] = {[0] = 1, [4] = 15 }` but I could be wrong |
01:35:59 | arkanoid | I clearly cannot understand yet the different between proc foo[T](bar: T), and proc foo(bar: Z) where Z is a concept or a typeclass |
01:36:25 | FromDiscord | <Elegantbeef> What difference? |
01:36:51 | FromDiscord | <Elegantbeef> Unless you mean `proc foo [T: Z](bar: Z)` |
01:36:59 | FromDiscord | <Elegantbeef> i mean `bar: T` of course |
01:37:59 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "I'd argue it's not": C does support partial initialization, yeah. true that |
01:38:28 | FromDiscord | <sOkam! π«> nim's named syntax solves my problem though. I just wanted the numbers to be named, so that solves it |
01:39:18 | arkanoid | you mean concepts and typeclasses can't be used as type arguments? |
01:39:20 | FromDiscord | <bosinski2023> @beef is it possible to allocate smth. and then transfere ownership to ARC/ORC ? |
01:39:56 | arkanoid | bosinsky, create an object with a pointer and declare destructor of that object? |
01:40:04 | FromDiscord | <Elegantbeef> You can take ownership of anything if you write your own hooks |
01:40:09 | arkanoid | sorry, typo in your name |
01:40:40 | FromDiscord | <Elegantbeef> That's one of the perks of Arc it's indistinguishable from manual memory management |
01:40:45 | FromDiscord | <bosinski2023> In reply to @arkanoid "bosinsky, create an object": yes, this way, i want ARC/ORC to collect & dispose the thing |
01:41:14 | FromDiscord | <Elegantbeef> There is no automated solution you have to wrap it |
01:41:45 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "There is no automated": wrap it ? how and what ? |
01:42:20 | FromDiscord | <Elegantbeef> Make a new object with a field of the type you want to wrap or make the type a `distinct ptr YourType` |
01:42:28 | FromDiscord | <Elegantbeef> Then implement the move semantic hooks |
01:42:33 | FromDiscord | <bosinski2023> (edit) "In reply to @Elegantbeef "There is no automated": wrap it ? how and what ? ... " added "so have a outer type, a struct and then my allocated thing inside ?" |
01:42:34 | FromDiscord | <Elegantbeef> Then bob's your auntie |
01:43:01 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "Then bob's your auntie": wuhuu - i love bob.. |
01:43:17 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/destructors.html read this |
01:43:27 | FromDiscord | <Elegantbeef> The motivating example creates a sequence |
01:44:03 | FromDiscord | <bosinski2023> @beef would you know a sorting-algo thats done in nim and is single-threaded faster than the sort from `std/algorithm` |
01:44:17 | FromDiscord | <Elegantbeef> I don't sort things |
01:44:25 | FromDiscord | <Elegantbeef> Who am I to play god |
01:44:34 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "The motivating example creates": thx uncle beef π |
01:44:39 | arkanoid | haha |
01:44:47 | FromDiscord | <morgan> In reply to @morganalyssa "so i'm wrapping clap,": well i tried replacing the exported struct with some emit pragmas but i just keep running into issues |
01:45:13 | FromDiscord | <Elegantbeef> Did you use the `emit: """/TYPESECTION/ ..."""`? |
01:45:27 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "Who am I to": i tried smth. and i see around 10-X - i think i like it .. |
01:46:19 | FromDiscord | <Elegantbeef> I don't even know what that means |
01:46:53 | FromDiscord | <morgan> it's code that goes at the bottom in the example im following |
01:47:10 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "I don't even know": i mean - i have a algo that sort 1-million int32 in 1/tenth of the time std/sort takes.. |
01:47:20 | FromDiscord | <bosinski2023> (edit) "sort" => "sorts" |
01:47:27 | FromDiscord | <morgan> it's supposed to be the entry point for a dynamic library |
01:47:40 | FromDiscord | <Elegantbeef> Oh that meant 10\:1 |
01:48:23 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "Oh that meant 10\:1": roughly, on small arrays 4-5, surprisingly on larger up to 10x |
01:49:10 | FromDiscord | <bosinski2023> (edit) "In reply to @Elegantbeef "Oh that meant 10\:1": roughly, on small arrays 4-5, surprisingly on larger up to 10x ... " added "- its a vectorized quicksort - do you know what std/algorithms does ?" |
01:49:17 | FromDiscord | <morgan> In reply to @morganalyssa "it's supposed to be": https://github.com/free-audio/clap/blob/main/src/plugin-template.c#L447 |
01:49:55 | FromDiscord | <Elegantbeef> Why use emit? |
01:50:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=UavlenOZyNVx |
01:50:43 | FromDiscord | <morgan> i thought i tried a pragma for that |
01:50:47 | FromDiscord | <morgan> but ill try it again |
01:51:09 | FromDiscord | <Elegantbeef> If you didnt have `dynlib` it only exports it and does not prevent DCE |
01:53:22 | FromDiscord | <morgan> well clap validator can't seem to load it and i get like basically no info |
01:53:56 | FromDiscord | <morgan> maybe it's a compiler setting idk |
01:54:09 | FromDiscord | <Elegantbeef> Alternatively your types do not match |
01:54:55 | FromDiscord | <morgan> oh yea that could do it |
01:55:25 | FromDiscord | <Elegantbeef> https://github.com/Alkamist/clap/blob/main/clap/public.nim#L171 |
01:55:28 | FromDiscord | <morgan> ill have to look thru them again when i work on this again |
01:55:29 | FromDiscord | <Elegantbeef> This was working |
01:56:01 | FromDiscord | <morgan> oh someone already wrapped clap |
01:56:25 | FromDiscord | <morgan> huh |
02:08:11 | FromDiscord | <morgan> well i might actually try theirs and see if i can get a working thing with it and build off of that |
02:08:25 | FromDiscord | <morgan> i do wish i had seen it before |
02:11:54 | FromDiscord | <morgan> i do still have other stuff to do, like getting sokol rendering into a window created thru the clap api, and using the clap wrappers to make the other plugin formats |
02:12:04 | FromDiscord | <morgan> so having less to do here would be nice |
03:24:46 | arkanoid | are typeclasses allowed for types? like `type Foo[L: Length, T: Time]: distance: L clock: Time` I have a piece of code that works if I only omit typeclasses |
03:26:19 | arkanoid | sorry I mistyped my example. Fix: `type Foo[L: Length, T: Time]: distance: L clock: T` |
03:26:56 | arkanoid | If I use typeclasses in my types I get errors like: got: <typedesc[Meter], typedesc[DecaMeter], typedesc[Minute]> but expected: <D: Length, LD: Length, T: Time> |
03:58:57 | FromDiscord | <minihondaguy> @room I made a nim library called fuckNiggers want to try it |
03:59:10 | FromDiscord | <ElegantBeef> <@&371760044473319454> |
03:59:12 | FromDiscord | <minihondaguy> It let's you embed this video |
03:59:18 | FromDiscord | <minihondaguy> 1000000027.webm https://media.discordapp.net/attachments/371759389889003532/1216233896547455076/1000000027.webm?ex=65ffa515&is=65ed3015&hm=f70d29ef86e384a789155580f006a02f5deebff613cd57940008c49a35e4b5a8& |
03:59:25 | FromDiscord | <minihondaguy> It let's you ekbed the flame on video |
03:59:31 | FromDiscord | <minihondaguy> Its called fuckNiggers |
03:59:41 | FromDiscord | <minihondaguy> 1000000027.webm https://media.discordapp.net/attachments/371759389889003532/1216233993540997120/1000000027.webm?ex=65ffa52c&is=65ed302c&hm=c85db76c55829f3c236caf5b2f840bf0c8139505437fcfaa024af21aa3a963ab& |
04:19:22 | * | azimut quit (Ping timeout: 260 seconds) |
04:39:39 | * | azimut joined #nim |
04:45:14 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=zDXUbduwTdah |
04:51:26 | FromDiscord | <odexine> astToStr? |
05:16:38 | FromDiscord | <morgan> In reply to @morganalyssa "well i might actually": well i built it, there's no info for what to use as the build command, but it fails the validator in the same way so :| |
05:16:42 | * | xet7 joined #nim |
05:58:20 | FromDiscord | <grumblygibson> Exceptions. Any thoughts on best practices or workflows? If you put `{.raises: [].}` then do you put a unique `try/catch` around each line that can raise, or do you do something else? Especially curious about commercial Nim code. (realizing I should go read Status' projects code) |
05:59:32 | FromDiscord | <Elegantbeef> Put it around all code you want to not error as high or low as you want to do |
06:06:10 | NimEventer | New Nimble package! koi - Immediate mode UI for Nim, see https://github.com/johnnovak/koi |
06:06:12 | FromDiscord | <grumblygibson> π€ thanks, seems like a silly question now as that is the only answer that logically follows. |
06:06:47 | FromDiscord | <Elegantbeef> Of course, you can lazily try except at top level or lower down and handle it π |
06:06:51 | * | junaid_ joined #nim |
06:10:25 | FromDiscord | <grumblygibson> uh oh, we've opened Pandora's box of sage advice. |
06:55:42 | * | azimut quit (Ping timeout: 260 seconds) |
07:27:52 | FromDiscord | <bung8954> how to start a interactive shell instead of `execCmdEx` ? |
07:28:41 | FromDiscord | <bung8954> (edit) "how to start a interactive shell ... instead" added "with command" |
07:29:30 | FromDiscord | <bung8954> I got `Chocolatey detected you are not running from an elevated command shell` when `execCmdEx` with `{poUsePath, poParentStreams}` |
07:30:46 | FromDiscord | <demotomohiro> run `execProcess` or `startProcess` with `poParentStreams`. |
08:10:27 | FromDiscord | <nnsee> In reply to @NimEventer "New Nimble package! koi": this looks nice |
08:31:42 | FromDiscord | <bung8954> In reply to @demotomohiro "run `execProcess` or `startProcess`": in the end I get `let (output, exitCode) = execCmdEx(fmt"powershell.exe Start-Process -FilePath 'powershell' -Verb runAs -ArgumentList 'choco','install', '{$pkg}'", options = {poEchoCmd, poUsePath, poEvalCommand}, input="Y")` |
08:32:53 | * | advesperacit joined #nim |
08:54:04 | NimEventer | New thread by kragil: Is there a plan to make Nim a language for normal businesses?, see https://forum.nim-lang.org/t/11189 |
10:25:44 | * | xet7 quit (Remote host closed the connection) |
10:37:11 | * | ntat joined #nim |
11:06:33 | * | ntat quit (Quit: Leaving) |
12:39:32 | * | xet7 joined #nim |
13:13:25 | * | xet7 quit (Ping timeout: 246 seconds) |
13:14:31 | * | junaid_ quit (Remote host closed the connection) |
13:26:06 | * | xet7 joined #nim |
13:31:08 | * | xet7 quit (Remote host closed the connection) |
13:39:15 | * | xet7 joined #nim |
13:59:59 | * | KhazAkar quit (Ping timeout: 264 seconds) |
14:29:11 | * | KhazAkar joined #nim |
14:51:39 | * | emilknievel joined #nim |
14:57:42 | * | azimut joined #nim |
15:02:13 | FromDiscord | <xtrayambak> Is there a way to find out the UTF-8 length of a character? |
15:03:33 | FromDiscord | <Robyn [She/Her]> In reply to @xtrayambak "Is there a way": Does `std/unicode` work for you? |
15:04:02 | FromDiscord | <xtrayambak> I can't find a way to get the UTF-8 length of a character there -- there's no proc that takes in a character and outputs an integer |
15:04:47 | FromDiscord | <Robyn [She/Her]> What do you mean by utf-8 length? |
15:04:59 | FromDiscord | <Robyn [She/Her]> Like, the total bytes in a unicode character? |
15:05:02 | FromDiscord | <xtrayambak> Yeah |
15:05:10 | FromDiscord | <xtrayambak> There's `graphemeLen` but it's not exactly that |
15:05:25 | FromDiscord | <Robyn [She/Her]> You could do `$rune.len`? |
15:05:58 | FromDiscord | <xtrayambak> Isn't that converting it to a UTF-8 string and getting its length? |
15:06:00 | FromDiscord | <Robyn [She/Her]> It'd convert the unicode rune to a string which means you could get the length of the string for the amount of bytes |
15:06:11 | FromDiscord | <xtrayambak> Ah, I think `size()` is the correct proc |
15:06:20 | FromDiscord | <xtrayambak> https://media.discordapp.net/attachments/371759389889003532/1216401762299281469/image.png?ex=6600416b&is=65edcc6b&hm=c3e0e81cbeb325ffb17cdc5fbe08a6762c4cbf1bdd4225d5fc92b8643aceffe8& |
15:06:24 | FromDiscord | <Robyn [She/Her]> Ah ignore me then |
15:06:29 | FromDiscord | <Robyn [She/Her]> Good luck! |
15:07:44 | FromDiscord | <xtrayambak> good lord, now I need to find the UTF-16 length of that character |
15:08:11 | FromDiscord | <Robyn [She/Her]> Ah good luck with that! |
15:08:53 | FromDiscord | <xtrayambak> I think I'm gonna pull off this really neat trick known as "deviating from the standard" right here |
15:08:54 | FromDiscord | <xtrayambak> :P |
15:10:08 | FromDiscord | <Robyn [She/Her]> What are you doing, out of curiosity? |
15:17:53 | FromDiscord | <xtrayambak> I'm writing a CSS3 tokenizer and parser, lol |
15:19:00 | FromDiscord | <Robyn [She/Her]> Ah okay, fair :P |
15:28:33 | * | emilknievel left #nim (#nim) |
15:31:46 | * | libercv joined #nim |
15:31:48 | * | ntat joined #nim |
15:35:01 | FromDiscord | <odexine> In reply to @xtrayambak "good lord, now I": UTF-16 is not a variable length character encoding iirc |
15:35:21 | FromDiscord | <odexine> "The encoding is variable-length, as code points are encoded with one or two 16-bit code units" oh it is |
15:35:29 | FromDiscord | <odexine> prolly thinking of UTF-32 then |
15:38:22 | * | KhazAkar quit (Ping timeout: 264 seconds) |
15:43:51 | * | KhazAkar joined #nim |
15:47:29 | FromDiscord | <Robyn [She/Her]> Hm, out of curiosity, you can overload `()` on types, right? |
15:47:57 | FromDiscord | <Robyn [She/Her]> What if someone made an `int128` type that overloaded `()` so you could use it as if it was a typical int type |
15:49:01 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Hm, out of curiosity,": ive not heard of such |
15:49:20 | FromDiscord | <Robyn [She/Her]> Fair, I think it was experimental |
15:54:14 | * | azimut quit (Ping timeout: 260 seconds) |
16:10:23 | * | xet7 quit (Remote host closed the connection) |
16:19:11 | FromDiscord | <amaank404> wait |
16:19:19 | FromDiscord | <amaank404> isn't utf-8 variable encoding |
16:19:46 | FromDiscord | <amaank404> becuz utf-8 non-ascii characters have a larger size in memory |
16:25:28 | FromDiscord | <odexine> 8 and 16 are variable |
16:27:11 | Amun-Ra | not to be confused with ucs-2 |
16:32:15 | * | def- quit (Quit: -) |
16:32:28 | * | def- joined #nim |
16:34:11 | * | azimut joined #nim |
16:35:43 | * | junaid_ joined #nim |
16:38:11 | * | krux02 joined #nim |
16:42:19 | FromDiscord | <fosster> mh I'm having difficulties to find documentation for `checksums/sha2`, anyone can help? |
16:42:42 | FromDiscord | <fosster> I get 404 on the official documentation's link |
16:43:39 | Amun-Ra | https://github.com/nim-lang/checksums/blob/master/src/checksums/sha2.nim#L39-L46 |
16:45:32 | Amun-Ra | hmm, gh project's readme.md points to https://nim-lang.github.io/checksums/theindex.html |
16:45:47 | Amun-Ra | and https://nim-lang.github.io/checksums/src/checksums/sha2.html does work |
16:51:35 | FromDiscord | <fosster> thank you very much, that is exactly what I needed! |
16:51:56 | FromDiscord | <fosster> actually they should update the official documentation |
16:52:12 | Amun-Ra | yes |
16:52:19 | Amun-Ra | no worries :) |
16:52:28 | FromDiscord | <fosster> on https://nim-lang.org/docs/sha1.html they link to non-existing page |
16:57:24 | * | azimut quit (Remote host closed the connection) |
16:57:42 | * | azimut joined #nim |
17:02:45 | * | def- quit (Quit: -) |
17:02:57 | * | def- joined #nim |
17:26:57 | * | junaid_ quit (Remote host closed the connection) |
17:53:25 | * | Amun-Ra quit (Ping timeout: 268 seconds) |
17:59:29 | FromDiscord | <fosster> is https://github.com/cheatfate/nimcrypto the official nim cryptographic library? |
18:06:59 | * | junaid_ joined #nim |
18:11:34 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
18:11:59 | * | SchweinDeBurg joined #nim |
18:22:11 | * | Amun-Ra joined #nim |
18:24:02 | * | def- quit (Quit: -) |
18:26:14 | * | def- joined #nim |
18:30:29 | * | mal`` quit (Quit: Leaving) |
18:40:05 | FromDiscord | <Phil> There really is no "official" cryptographic lib |
18:40:14 | FromDiscord | <Phil> The closest you could assume would be the openssl wrapper |
18:45:57 | * | mal`` joined #nim |
19:32:25 | * | libercv left #nim (Leaving) |
20:05:39 | * | ntat quit (Remote host closed the connection) |
20:06:05 | * | ntat joined #nim |
20:58:17 | * | ntat quit (Quit: Leaving) |
21:10:54 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=XeBUYxIAztdw |
21:11:12 | FromDiscord | <user2m> (edit) "https://play.nim-lang.org/#pasty=vkkICVPUfPpt" => "https://play.nim-lang.org/#pasty=VoSUuuhcidWR" |
21:31:31 | * | junaid_ quit (Remote host closed the connection) |
21:35:40 | FromDiscord | <Elegantbeef> What are you trying to do exactly read from the output of the child process? |
21:37:23 | FromDiscord | <user2m> Yes and send input to it as well |
21:37:57 | FromDiscord | <Elegantbeef> then you should be able to just use the `inputstream` and `outputStream` |
21:49:24 | FromDiscord | <bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=blBrJtxfxGAs |
21:50:16 | FromDiscord | <Elegantbeef> Sure not that it's how I'd write it |
21:50:46 | FromDiscord | <bosinski2023> In reply to @Elegantbeef "Sure not that it's": ik, so how would you do it ? |
21:52:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=mWSRoKVwMJaq |
21:53:21 | FromDiscord | <bosinski2023> sent a code paste, see https://play.nim-lang.org/#pasty=mWepqiJCWVKn |
21:53:34 | FromDiscord | <Elegantbeef> Missing `()` in the `N` calc for the `div` |
22:11:45 | * | advesperacit quit () |
22:19:43 | * | xet7 joined #nim |
22:25:34 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=gHygxQNpwRjc |
23:27:51 | FromDiscord | <ccloud_> ccloud |
23:42:57 | * | lucasta joined #nim |