<< 09-08-2023 >>

00:02:15FromDiscord<Phil> In reply to @bostonboston "Also the trick is": You use your skills to get high?
00:03:34FromDiscord<Elegantbeef> I tried that once, but they knew I never smoked weed before
00:06:00FromDiscord<bostonboston> In reply to @isofruit "You use your skills": Yes of course
00:10:26FromDiscord<sirolaf> What is the preferred way to echo without a newline under nimscript? No stdout available for some reason
00:10:43FromDiscord<Elegantbeef> There isnt a preferred way that I know of
00:10:48FromDiscord<Elegantbeef> No stdout cause Nimscript cannot import c
00:11:31FromDiscord<01r> Meme answer: discard execShellCmd("echo -n 'without a newline'")
00:13:00FromDiscord<acomab> Using the json library, is there any way to define a custom key name when deserialising into a struct? For example, if I have a key named "fooBar" in my struct would it be possible to deserialise from a json object containing "foo_bar".
00:13:19FromDiscord<acomab> (edit) ""foo_bar"." => ""foo_bar"?"
00:13:33FromDiscord<Elegantbeef> Nope you need to use `jsonutils`
00:13:38FromDiscord<Elegantbeef> Really there needs to be a pragma added
00:13:45FromDiscord<acomab> In reply to @Elegantbeef "Really there needs to": agreed
00:13:48FromDiscord<acomab> thanks for the help
00:14:00FromDiscord<Elegantbeef> Someone needs to make it so generics do not lose pragma annotations
00:14:07FromDiscord<Elegantbeef> That way it can work across all types
00:14:23FromDiscord<acomab> i assume that jsonutils has a pragma?
00:14:32FromDiscord<Elegantbeef> Nope
00:14:39FromDiscord<Elegantbeef> But you can write your own serialisation hook
00:14:53FromDiscord<acomab> oh that's still somewhat useful to know
00:15:11FromDiscord<acomab> what im writing would be a lot easier with a deserialisation hook
00:15:32FromDiscord<Elegantbeef> jsonutils doesnt really have good docs, but you can refer to the hooks for tables and the like
00:15:37FromDiscord<Elegantbeef> Copy the signature for your type and call it a day
00:16:39FromDiscord<acomab> yeah it seems to be fairly straightforward lol
00:17:35FromDiscord<sirolaf> In reply to @Elegantbeef "No stdout cause Nimscript": Ansi escape code time it is then
00:24:43FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4CVp
00:37:21FromDiscord<bostonboston> In reply to @Elegantbeef "https://nim-lang.org/docs/manual.html#guards-and-lo": Just read some of this, happy to see that it is very easy to use like everything else in nim
01:32:53FromDiscord<Matt> Could someone take a peek at https://gist.github.com/MattAlp/11ff8e46cf1ecbb3da4c5f5da366799d and help me understand why this Nim code fails to compile on Nim 2.0?
01:33:24FromDiscord<Matt> sent a code paste, see https://play.nim-lang.org/#ix=4CVB
01:34:48FromDiscord<.matrixagent> Error logs would probably help
01:35:29FromDiscord<Elegantbeef> Compiler cgen bug
01:36:22FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4CVD
01:36:23FromDiscord<monark.chan> Does Nim have a library that makes interacting with graphql apis more concise?
01:36:48FromDiscord<Elegantbeef> Probably an issue with the `spawn` generator
01:37:01FromDiscord<Elegantbeef> Or `parallel`
01:39:57FromDiscord<Matt> Thanks for confirming. Any suggestions on how to do parallel merge sort otherwise? Is `parallel` a second class feature in Nim (for now)?
01:40:09FromDiscord<Elegantbeef> It's experimental
01:40:13FromDiscord<Elegantbeef> So if you want to call that second class sure 😄
01:40:18FromDiscord<Elegantbeef> use weave or taskpools
01:41:08FromDiscord<Matt> Got it
01:42:59FromDiscord<Matt> sent a long message, see http://ix.io/4CVE
01:43:20FromDiscord<Elegantbeef> Not really
01:43:25FromDiscord<Elegantbeef> The core language works
01:43:51FromDiscord<Matt> incl. concurrency?
01:44:02FromDiscord<Elegantbeef> `createThreads` works fine
01:44:22FromDiscord<Elegantbeef> It's not the best API, but it works, experimental features like `parallel` and `spawn` do not, but they're experimental
01:45:30FromDiscord<Matt> Gotcha
01:46:13*lucasta joined #nim
01:46:26FromDiscord<Matt> I spent more time than I wanted to today working on a peekable iterator- the inline vs closure iterator difference and other nimternals were more than I found myself comfortable with at the time
01:46:48FromDiscord<Matt> So it's not just concurrency/parallel & spawn that came to mind
01:47:50FromDiscord<Elegantbeef> Don't know what to say in response, it's a shame that closure/inline are seperated but it's not something I 'bump' into
01:48:14FromDiscord<Elegantbeef> I'd like to have first class performant iterators built into the langauge, but alas
01:49:40FromDiscord<Elegantbeef> It's not pretty but I do have some pretty good iterator utility stuff here https://github.com/beef331/slicerator/blob/master/tests/titermacros.nim
01:49:51FromDiscord<Elegantbeef> It had peeking, but I realised I was doing it 100% wrong, so I need to revisit it in the future
01:50:44FromDiscord<Matt> I'll take a look!
01:52:32FromDiscord<Matt> Is there also a place or even general recs on what the std++ libraries are for Nim? i.e. https://github.com/codex-storage/questionable seems like options++ down to the syntax, is there something like python's itertools etc etc?
01:53:14FromDiscord<Elegantbeef> No clue
01:53:28FromDiscord<Matt> 👍
01:53:32FromDiscord<Matt> +1
01:54:28FromDiscord<odexine> https://github.com/narimiran/itertools
01:55:35FromDiscord<Matt> Found https://nim-lang.org/docs/lib.html
01:55:53FromDiscord<Elegantbeef> That's just the stdlib 😄
02:42:35*pbsds quit (Quit: The Lounge - https://thelounge.chat)
02:43:15*pbsds joined #nim
03:35:41*xet7 quit (Ping timeout: 244 seconds)
03:43:19FromDiscord<ringabout> sent a code paste, see https://paste.rs/R3VgA
03:43:21FromDiscord<ringabout> Is it intended>
03:43:23FromDiscord<ringabout> (edit) "intended>" => "intended?"
03:44:03FromDiscord<Elegantbeef> That screams missed interaction to me
03:47:02FromDiscord<ringabout> yeah
04:02:04*emery quit (Ping timeout: 260 seconds)
04:15:57*lucasta quit (Quit: Leaving)
04:52:56*droidrage quit (Ping timeout: 245 seconds)
04:55:48*rockcavera quit (Remote host closed the connection)
05:31:08*advesperacit joined #nim
06:24:50*ntat joined #nim
06:45:43*PMunch joined #nim
06:49:38*azimut quit (Ping timeout: 240 seconds)
07:13:41NimEventerNew thread by grd: Command line options, see https://forum.nim-lang.org/t/10389
07:14:45FromDiscord<odexine> Oh boy
07:15:31FromDiscord<Elegantbeef> Time for some term rewriting macros 😄
07:16:37FromDiscord<odexine> Maybe it’s time to write a formatter/linter
07:16:37FromDiscord<Phil> In reply to @Elegantbeef "Time for some term": Clarification question, what is a "term rewriting macro" as opposed to just a "macro"?↵Like what specializes it that way?
07:16:56FromDiscord<odexine> In reply to @isofruit "Clarification question, what is": Term rewriting meaning it will match on a pattern in your code without you calling it
07:16:57FromDiscord<Elegantbeef> It matches an expression instead of a call
07:17:05FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/9739#64098 refer
07:17:09FromDiscord<odexine> Basically it’s the worst kind of magic for you
07:17:49FromDiscord<Elegantbeef> TRM cannot match on a command though afaik
07:18:05FromDiscord<Phil> Wait so basically no explicit "I am applying this macro here", it applies itself?
07:18:06FromDiscord<Elegantbeef> Since the compiler removes that to a call
07:18:14FromDiscord<odexine> In reply to @isofruit "Wait so basically no": Yes.
07:18:16FromDiscord<odexine> Lol
07:18:19FromDiscord<Elegantbeef> Correct you define a pattern for the macro to appl
07:18:27FromDiscord<Phil> The blood is leaving my face right now
07:18:28FromDiscord<odexine> Phil just unlocked a new kind of nightmare
07:18:51FromDiscord<Phil> Like, i can see the value for it if I ever wrap my head around the entire mock-generic-functions thing
07:18:52FromDiscord<odexine> Don’t worry it’s experimental
07:19:00FromDiscord<odexine> And likely to be removed some time iirc?
07:19:12FromDiscord<Phil> (edit) "thing" => "thing.↵But generally..."
07:19:17FromDiscord<Elegantbeef> No clue if removed or just replaced with a more sensible api
07:20:30FromDiscord<Elegantbeef> It does give us semantic linting, which is quite fantastic, but yea it's not sane.
07:21:15FromDiscord<Phil> Yeah for that as well as auto-applying certain macros/pragmas under very special circumstances (such as executing tests) I can see it
07:21:33FromDiscord<Phil> More than converters at least
07:21:41FromDiscord<Elegantbeef> I did have an idea to use it for HCR
07:21:55FromDiscord<Elegantbeef> Converters are more useful than TRMs in reality
07:21:56FromDiscord<Phil> But maybe I'll see their usecase once I actually deal with building DSLs myself if I ever do that
07:22:07FromDiscord<Elegantbeef> But that's cause Nim lacks weak distinct types
07:22:23FromDiscord<Phil> In reply to @Elegantbeef "I did have an": HCR?↵Home cooked recipes?
07:22:34FromDiscord<Elegantbeef> Hot code reloading
07:22:44FromDiscord<Phil> Ahhh check
07:23:09FromDiscord<Phil> Ohhh term rewriting because it rewrites what a term means with its own definition, that just made click
07:24:00FromDiscord<Elegantbeef> Well it does not rewrite what a term means it changes what a term does 😄
07:24:07FromDiscord<Elegantbeef> Term rewriting macros cannot change what something is, only how it gets there
07:24:14FromDiscord<Elegantbeef> The expression has to evaluate to the same type after the macro expands
07:24:22FromDiscord<Phil> Ah, check
07:24:36FromDiscord<Phil> Next question, what is this:↵`error("Expected a type.", x)`
07:24:46FromDiscord<Elegantbeef> A procedure call
07:25:01FromDiscord<Elegantbeef> Believe it or not you can call procedures in Nim a procedural language
07:25:07FromDiscord<Phil> Incredible
07:25:17FromDiscord<Phil> Well yeah but is that the error pragma in disguise?↵do we have an error proc somewhere?
07:25:19FromDiscord<Elegantbeef> Sass aside it calls the `error` proc which inside macros emits a error
07:25:40FromDiscord<Phil> So kind of like the error pragma for within macros
07:26:20FromDiscord<Elegantbeef> Yes it calls the `macros.error` which is the way to error inside macros when you want to give helpful errors
07:26:37FromDiscord<Elegantbeef> Sorta, but you can give a NimNode to take line information from
07:26:55FromDiscord<Elegantbeef> So in that above case it gives the exact line and information for the symbol of the variable
07:26:57FromDiscord<Phil> Wow bridge be slow
07:27:18FromDiscord<Elegantbeef> It's not that bad
07:27:21FromDiscord<Phil> In reply to @Elegantbeef "Sorta, but you can": Oh! that is pretty cool!
07:28:21FromDiscord<Elegantbeef> Basically if you write a macro and have invalid state and do not use error, I assume you like licking your shoes clean
07:28:56FromDiscord<Elegantbeef> There are of course `hint` and `warning` siblings to `error`
07:28:58FromDiscord<Phil> You underestimate my power, I would never write code that would even have the possibility of invalid state
07:29:06FromDiscord<Phil> Perfection and all that
07:31:51FromDiscord<Elegantbeef> Ah right enterprise code never enters invalid state, it enters yes state
07:38:31*cm_ joined #nim
07:38:31*cm quit (Ping timeout: 260 seconds)
07:38:51*cm_ is now known as cm
07:42:53FromDiscord<Phil> In reply to @Elegantbeef "Ah right enterprise code": It enters "Haha, this is a nightmare, why is there 20 years of legacy to deal with, help" state
07:43:23PMunchHmm, I think the --debugger:native mapping stuff is a bit borked..
07:43:47PMunchI'm getting this crash: http://ix.io/4oDz
07:43:53FromDiscord<Phil> Actually that's a curious question - Things like valgrind won't be able to deal with macros well, right?
07:43:56PMunchAnd it points to lines which don't exist..
07:44:16FromDiscord<Elegantbeef> Why wouldnt they deal with macros well
07:44:21FromDiscord<Elegantbeef> The generated code has line information
07:44:25FromDiscord<Phil> Because they only see the fully generated code, they'd need to know what macros etc. are to be able to route users to the file where a line of code gets called
07:44:32PMunch@Phil, well they won't see the macro in the code, but there are mapping statements which tell it where in the Nim code stuff comes from
07:44:44PMunchThat's how it shows where in the code it comes from
07:44:48FromDiscord<Phil> Ah and those mapping statements are language agnostic?
07:44:57FromDiscord<Phil> Like you can make one for any language for valgrind? Neat
07:45:17FromDiscord<Elegantbeef> It's just some text appended to the binary iirc
07:45:28FromDiscord<Elegantbeef> It does exist pmunch
07:45:41FromDiscord<Elegantbeef> Inside the include 😄
07:45:47PMunchYeah..
07:46:13PMunchBut I tried to calculate where in the include it came from, and that was just an imported int..
07:46:14FromDiscord<Elegantbeef> So odd that it did that, seems like it is a bug
07:47:11PMunchFun thing is, I don't use threads in this code..
07:47:29PMunchSo I'm skeptical of the "typedthreads" part entirely
07:47:48FromDiscord<Elegantbeef> Right then this is a bug
07:47:53PMunchI'm running it now without --debugger:native to see if I can just get the errors in the generated C code
08:04:27Amun-Rabtw, does nim use threads itself for some under the hood operations?
08:08:33PMunchNot as far as I know
08:13:56PMunchIt seems to come from popCurrentException which runs eqcopy from typedthreads trying to access currException.up which causes the SIGSEGV
08:14:42PMunchThis is of course a program which crashes after running for a couple days.. So it's kinda hard to debug..
08:18:47PMunchHmm, this seems a bit sketchy: https://play.nim-lang.org/#ix=4CWP
08:19:34PMunchCompared to with --threads:off https://play.nim-lang.org/#ix=4CWQ
08:20:00FromDiscord<Elegantbeef> The hell
08:20:11FromDiscord<Elegantbeef> That's a mild cockup
08:20:45FromDiscord<Elegantbeef> There isnt even a `=destroy` in threads is there
08:22:18PMunchThat's =copy isn't it?
08:22:39FromDiscord<Elegantbeef> Yea sorry brain fart
08:24:26FromDiscord<djazz> @pmunch https://github.com/PMunch/futhark/pull/78 i fixed it
08:24:55FromDiscord<djazz> Btw, trying to get nim check/nimsuggest to work well with futhark without using outputPath seems impossible
08:25:34FromDiscord<djazz> nim check disables staticExec and uses a different nimcache dir
08:26:22PMunchI think it works if you have compiled once before so that it detects the cache and simply falls through to the `include <cachefile>`
08:26:29PMunchAt least it used to work fine in NimLSP
08:27:01FromDiscord<djazz> Yeah, but then futhark dont autogenerate when it detects changes
08:27:18FromDiscord<djazz> (No hashing)
08:28:03PMunchYeah that's true
08:28:14PMunchOr wait..
08:28:42PMunchI was talking about not using any of the output options, and just letting it put it in cache
08:28:57PMunchAh, but nim check uses a different nimcache directory..
08:29:00PMunchThat's a shame
08:29:28PMunchMaybe there's a hack we could employ which finds the true cache?
08:29:52FromDiscord<Elegantbeef> `when defined(nimcheck)` and cry deeply
08:31:13FromDiscord<djazz> Yep <https://github.com/daniel-j/nim-picosdk/blob/master/src/picostdlib/lib/lwip.nim#L37>
08:31:46FromDiscord<djazz> Made a nimble task to generate futhark wrappers
08:31:51FromDiscord<Elegantbeef> Should that also have `nimsuggest` do not recall though
08:32:12FromDiscord<djazz> I think its just nimcheck define
08:34:15FromDiscord<djazz> This works great when developing on the module, but how to handle when another module depend on this lib?
08:34:41FromDiscord<djazz> Still trying to find the best way
08:35:37FromDiscord<djazz> (lwip c lib is highly dependent on an options file to specify what to include, so it cant be the same for everyone)
08:35:55PMunchHmm, so the generated code seems the same
08:36:20PMunchIt's just renamed to typedthreads and has a different line number
08:36:25FromDiscord<djazz> For littlefs, fatfs and some others I can generate the wrapper at package install time, since those dont depend on a config
08:37:46FromDiscord<jmgomez> is `nimcheck` defined though? Last time I checked it wasnt and I had to do `const nimcheck = querySetting(command) == "check"`
08:37:47PMunchMy best guess is that Nim auto-generates the =copy if it doesn't have one already, and when --threads:on the first time it encounters a copy from Exception to Exception is in that module. So it generates it there, and now every time it wants to copy an exception it just reuses the same =copy
08:38:10FromDiscord<djazz> In reply to @jmgomez "is `nimcheck` defined though?": It seems to work…
08:38:46PMunchIt confuses the shit out of the debugger though :P
08:39:17PMunchSo it's actually eqcopy which causes the SIGSEGV
08:39:21PMunchThat's not great
08:41:44PMunchIs it just me, or is the colontmp_ and its management here completely superfluous? http://ix.io/4CWT
08:53:20NimEventerNew thread by sls1005: Some ideas about nimrtl, see https://forum.nim-lang.org/t/10390
09:03:23NimEventerNew thread by drkameleon: Template being called twice with Nim 2.0, see https://forum.nim-lang.org/t/10391
09:07:18FromDiscord<4zv4l> how do I do comptime check ?↵for example to do a compile error if when compiling the target is not windows ?
09:07:37PMunch`when not defined(windows)`
09:07:55FromDiscord<4zv4l> I tried https://media.discordapp.net/attachments/371759389889003532/1138760560876470372/image.png
09:07:57FromDiscord<4zv4l> but it still compile it
09:08:04FromDiscord<4zv4l> it only shows the error when I run it
09:08:15PMunchOf course
09:08:28PMunchYou don't have any compile-time statements in your when block
09:08:36FromDiscord<4zv4l> In reply to @4zv4l "how do I do": so that's not comptime check 🥹
09:08:37PMunchThe when block simply selects what to add
09:08:55PMunchThe check is done at compile-time, and it insert the code for your runtime
09:09:34FromDiscord<4zv4l> so if I wanna do a comptime check, how do I do ?↵not generate the binary uselessly if the feature isn't available on linux for example ?
09:09:51PMunchWell you already do the compile-time check
09:10:00PMunchYou just need to do your work at compile-time as well: http://ix.io/4CWT
09:10:09PMunchOops, wrong link: https://play.nim-lang.org/#ix=4CX0
09:11:04PMunchYou could of course also use the error pragma: https://play.nim-lang.org/#ix=4CX1
09:11:57FromDiscord<4zv4l> In reply to @PMunch "You could of course": that's exactly what I was looking for !↵thanks !
09:16:58FromDiscord<4zv4l> there isn't a rename file function in the stdlib ?
09:17:58FromDiscord<4zv4l> `moveFile` ok cool xD
09:35:21*ehmry joined #nim
09:45:52*PMunch_ joined #nim
09:48:51*PMunch quit (Ping timeout: 246 seconds)
10:06:16*NimBot joined #nim
10:06:16*FromDiscord joined #nim
10:33:54FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=4CXe
10:47:45FromDiscord<roupi.rb> how i get the type of a variable ?
10:47:58FromDiscord<roupi.rb> (edit) "variable" => "obj"
10:48:45PMunch_`typeof(myvar)`
10:49:53FromDiscord<roupi.rb> hum how do i check if a variable type is Message
10:49:58FromDiscord<roupi.rb> for example
10:50:10FromDiscord<roupi.rb> idunno how generics works yet
10:58:10PMunch_`if myvar is Message`?
10:58:43*PMunch_ is now known as PMunch
11:10:34*NimBot joined #nim
11:10:44*FromDiscord joined #nim
11:11:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CXm
11:13:11*NimEventer quit (Ping timeout: 260 seconds)
11:13:32*NimEventer joined #nim
11:13:55FromDiscord<Phil> sent a long message, see http://ix.io/4CXn
11:14:46FromDiscord<Phil> (edit) "http://ix.io/4CXn" => "http://ix.io/4CXo"
11:15:15FromDiscord<Phil> (edit) "https://paste.rs/MEObh" => "https://paste.rs/Iap1Z"
11:42:35FromDiscord<roupi.rb> how would you make an interface like `Message.dump`
11:43:02FromDiscord<roupi.rb> (edit) "`Message.dump`" => "`Message.dump(message)` `Message.load(str)`"
11:43:49PMunch`proc dump(_: typedesc[Message], obj: Message)`
11:44:24PMunchBut of course, the `Message.` part is completely superfluous since `message` is already of type `Message`
11:44:42PMunchSo basically you're asking the programmer to specify the type twice
11:45:52PMunchUnless of course your `message` variable is in fact not a `Message` object, but perhaps a string representation and `dump` and `load` need to get the type to convert to/from
11:46:57FromDiscord<Phil> In reply to @roupi.rb "how would you make": Concepts. You might want to look into Traitor courtesy of ElegantBeef.↵It allows you to define arbitrary boundaries that any type must fulfill to count as "legitimate" to be used with a proc that uses the concept
11:47:15FromDiscord<Phil> (edit) "ElegantBeef.↵It" => "ElegantBeef as a helper package for using those.↵It"
11:47:21FromDiscord<Phil> (edit) "helper" => "helper/extension"
11:47:48FromDiscord<Phil> The boundary in your case would be that a `load` and `dump` proc must be defined for it.
11:48:13FromDiscord<roupi.rb> i just want to refactor this https://media.discordapp.net/attachments/371759389889003532/1138800898278162472/image.png
11:48:25FromDiscord<roupi.rb> using this long names doest feel to good
11:48:29FromDiscord<roupi.rb> (edit) removed "to"
11:48:47FromDiscord<Phil> In reply to @roupi.rb "i just want to": Are you open to using packages that deal with json-parsing for you or do you want to do that by hand?
11:49:19PMunchWell `messageToJsonString` should probably be split into a `%` for message and then just the default `$` proc for that json object.
11:50:02FromDiscord<roupi.rb> how do i define a % for message
11:50:09PMunchAnd jsonStringToMessage could simply be named `to` with a signature of `proc to(data: string, kind: typedesc[Message]): Message`
11:50:34PMunchYou just name it `%` in backticks
11:50:46PMunchNot sure how to send that in a way that's not bungled by the bridge..
11:51:09FromDiscord<odexine> it isnt
11:51:19FromDiscord<Phil> sent a code paste, see https://paste.rs/PnSbq
11:51:20PMunchhttp://ix.io/4CXx
11:52:13FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4CXz" => "https://paste.rs/4Q5I6"
11:52:31FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4CXy" => "https://play.nim-lang.org/#ix=4CXA"
11:52:35FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4CXC" => "https://play.nim-lang.org/#ix=4CXB"
11:52:44FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4CXB" => "https://play.nim-lang.org/#ix=4CXD"
11:53:41PMunchIt's interesting to see how the IRC bridge switches between playground links and other paste services when people edit their messages: https://irclogs.nim-lang.org/09-08-2023.html#11:52:13
11:54:40FromDiscord<Phil> Actually, why don't you hate me Pmunch?↵With my eternal edit habit and how not-nice that interacts with IRC I'd assume my messages would be a nightmare for you 😅
11:55:56FromDiscord<roupi.rb> sent a code paste, see https://paste.rs/wBRtm
11:57:05FromDiscord<Phil> std/json can do the same as PMunch pointed out, but it does so more slowly as that's something inherent to the way std/json approaches the problem of JSON with an intermediate representation that is JsonNodes
12:01:55PMunchPhil, well I tend to just assume it's a minor edit and not bother with anything but the first link
12:02:18PMunchIt's a bit of noise, but it's much better than before when the entire message got replayed every edit :P
12:02:49PMunchI do wish oneliner code snippets where just sent as text though..
12:03:03PMunchRef. the last message by roupi.rb
12:03:27PMunchAnd often people write some normal text first, followed by some code. And it all gets turned into a paste
12:05:19*tinystoat quit (*.net *.split)
12:05:20*madprops quit (*.net *.split)
12:05:38*tinystoat joined #nim
12:05:38*madprops joined #nim
12:18:58*NimBot joined #nim
12:19:01*FromDiscord joined #nim
12:34:21*lucasta joined #nim
12:41:32FromDiscord<Chronos [She/Her]> Genuinely wonder how hard it'd be to make a macro to generate code for encoding byte arrays into bases
12:41:48FromDiscord<Chronos [She/Her]> Mainly so I can implement a custom base32 algorithm
12:41:52FromDiscord<Chronos [She/Her]> Hm...
12:50:24*def- quit (Quit: -)
12:51:57PMunchShouldn't be too hard
12:52:40PMunchBut why not use toBin/toOct/toHex?
12:54:41FromDiscord<Chronos [She/Her]> I'm using it to see if it's possible for me to implement ULID parsing in Nim since currently not doable
13:02:32PMunchWhy do you say it's not doable?
13:12:42FromDiscord<chronos.vitaqua> In reply to @PMunch "Why do you say": No library for parsing crockford base32 aha
13:13:09PMunchAh, so it's possible, just not implemented :P
13:14:30*rockcavera joined #nim
13:14:49FromDiscord<chronos.vitaqua> Yeah, my choice of wording is poor aha
13:15:23PMunchLooks super easy to implement though, why do you need a macro for this?
13:16:05FromDiscord<chronos.vitaqua> In reply to @PMunch "Looks super easy to": Writing this I realised I didn't- Looking at how to implement base32 in pure Java from scratch looked terrifying from an answer I saw on StackOverflow-
13:21:47*NimBot joined #nim
13:27:57*FromDiscord quit (Remote host closed the connection)
13:42:49*def- joined #nim
13:46:36*FromDiscord joined #nim
14:05:02*PMunch quit (Quit: Leaving)
14:16:49*xet7 joined #nim
14:58:44FromDiscord<Phil> In reply to @yu.vitaqua.fer.chronos "Genuinely wonder how hard": Why macro and not template?
14:59:03FromDiscord<Phil> Actually never mind, I'm not even sure how I'd pull that off via templates
15:01:54FromDiscord<jaar23> hi, i'm trying to working nimlang openssl, i'm following this example. https://gist.github.com/benob/72d3a2fdefca3a586aa3dd6400892080↵After getting `SslHandle.SSL_get_peer_certificate()`, how can i save the `certificate` into pem file?
15:19:27FromDiscord<System64 ~ Flandre Scarlet> Is it possible to check for byte overflow without casting/conversion?
15:21:03FromDiscord<odexine> wdym for "byte overflow"
15:21:27*jmdaemon quit (Ping timeout: 244 seconds)
15:22:25FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4chi
15:22:43*lucasta quit (Quit: Leaving)
15:22:46FromDiscord<odexine> what types are the fields
15:23:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "what types are the": bytes
15:23:22FromDiscord<odexine> as in exactly `byte`
15:23:58FromDiscord<System64 ~ Flandre Scarlet> yeah the fields are bytes
15:26:45FromDiscord<odexine> you cant really test without doing stuff like `if c1.r < c2.r and c2.r - c1.r > byte.high div 2: #error` etc
15:28:16FromDiscord<System64 ~ Flandre Scarlet> Seems I'm forced to cast↵but it is possible to cap at 0 for subtraction
15:28:46FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CZ6
15:30:22Amun-RaSystem64: https://play.nim-lang.org/#ix=4CZ8
15:30:31Amun-Rayou'd have to use something like that
15:31:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "you'd have to use": Oh alright, and is that more performant than casting?
15:33:01Amun-Rathat depends
15:42:26FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CZc
15:45:44FromDiscord<System64 ~ Flandre Scarlet> shouldn't I check like↵if(MAX_R -r2 < r1) too?
15:48:13FromDiscord<chronos.vitaqua> Should my code use uint or int for base conversion related stuff
15:48:19Amun-RaSystem64: https://nim-lang.org/docs/system.html#clamp%2CT%2CT%2CT
15:48:47Amun-Rayou need either a clamp or saturated add
15:49:29FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "System64: https://nim-lang.org/docs/system.html#cla": Oh alright, so the algorithm you sent doesn't work?
15:49:59Amun-Rathe algorithm I sent works, you just don't need it
15:50:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "the algorithm I sent": Oh alright↵I'm finding the most efficient method, since it's for a graphics engine
15:51:27Amun-Ra→ benchmark
15:52:00Amun-Ratest a few options with https://github.com/treeform/benchy and pick the fastest one
15:54:06FromDiscord<System64 ~ Flandre Scarlet> Ooooh alright↵Sounds pretty nice
15:56:03FromDiscord<chronos.vitaqua> Hi, question: How would I reverse the functionality here?
15:56:13FromDiscord<chronos.vitaqua> sent a code paste, see https://play.nim-lang.org/#ix=4CZf
15:56:25FromDiscord<chronos.vitaqua> I want to make it so I can actually decode numbers into ints- but that's a bit hard rn
16:17:21*lucasta joined #nim
16:17:32*azimut joined #nim
16:24:30FromDiscord<eliot_c> hello, is it possible to check for files using file extensions? like fileExists or existsFile
16:26:20FromDiscord<Phil> As in you want to have a list of all files with a given extension in a dir?
16:27:05FromDiscord<eliot_c> it could be a list but for my case im just trying to find the nimble file of a project
16:27:29FromDiscord<eliot_c> so it'd just be one file usually
16:27:34FromDiscord<Phil> I mean fileExists does exist as a proc ↵https://nim-lang.org/docs/oscommon.html#fileExists,string
16:28:03FromDiscord<Phil> Or do mean you're searching for a while in directories and want that to happen in a recursive fashion?
16:28:11FromDiscord<Phil> (edit) "while" => "file"
16:28:23FromDiscord<System64 ~ Flandre Scarlet> Is it normal this new operator doesn't work? https://media.discordapp.net/attachments/371759389889003532/1138871406113849494/image.png
16:28:35FromDiscord<eliot_c> yea in a recursive fashion
16:29:05FromDiscord<odexine> In reply to @sys64 "Is it normal this": Stropping text will not result in an operator
16:29:27FromDiscord<odexine> Only the specified ones like and or etc
16:29:30FromDiscord<odexine> Will work
16:29:32FromDiscord<Phil> In reply to @eliot_c "yea in a recursive": In that case you'll want to look into `walkFiles`↵https://nim-lang.org/docs/osdirs.html#walkFiles.i,string
16:29:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Stropping text will not": Oh, so impossible to create my own operator?
16:30:14FromDiscord<odexine> Possible, just not alphanumeric
16:30:24FromDiscord<eliot_c> In reply to @isofruit "In that case you'll": oooh ok thank you
16:30:46FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Possible, just not alphanumeric": How to do that then?
16:31:27FromDiscord<odexine> Use a non-alphanumeric name? Like @@@ or something
16:31:51FromDiscord<System64 ~ Flandre Scarlet> Oh alright
16:33:28FromDiscord<System64 ~ Flandre Scarlet> and impossible to mix alphanumeric and non-alphanumeric I guess?↵Like I can't do %25?
16:34:53FromDiscord<odexine> No
16:34:59FromDiscord<odexine> You can’t
16:35:13FromDiscord<System64 ~ Flandre Scarlet> ah, I'll have to do a proc then
16:37:37FromDiscord<System64 ~ Flandre Scarlet> Because this looks pretty unclear https://media.discordapp.net/attachments/371759389889003532/1138873730618101930/image.png
16:40:54*lucasta quit (Quit: Leaving)
16:51:28FromDiscord<odexine> Honestly don’t know what you’re making with those mix procedures
16:51:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Honestly don’t know what": It's for mixing color together
16:52:22FromDiscord<odexine> Yes I get that but why are you adding the same thing twice in 25
16:53:14FromDiscord<odexine> What I’m saying is that your procedure names don’t explain sufficiently for me
16:53:32FromDiscord<chronos.vitaqua> ^^^^
16:53:37FromDiscord<chronos.vitaqua> Absolutely clueless
16:53:43FromDiscord<Phil> "sufficiently" is putting it lightly.↵`col1 %% col2` is like... what?
16:53:51FromDiscord<odexine> Not those
16:54:11FromDiscord<odexine> Even just “mix 25” doesn’t make sense to me
16:54:27FromDiscord<System64 ~ Flandre Scarlet> yeah that's the problem↵I try to create a new operator, but can't do proc \`mix25\`()
16:54:39FromDiscord<Phil> Adding a color to a pallette or subtracting one I can even wrap my head around
16:54:51FromDiscord<odexine> In reply to @sys64 "yeah that's the problem": That’s not what I mean
16:54:52FromDiscord<Phil> The operators for combining colors are leaving me completely clueless
16:55:00FromDiscord<odexine> I mean that even mix 25 makes 0 sense to me
16:55:06FromDiscord<odexine> What the hell does the 25 mean
16:56:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "I mean that even": like, you have 25% of one component, and the rest is 75% of this component
16:56:32FromDiscord<odexine> But your function body reads like it does 33%
16:56:35FromDiscord<Phil> So mixing colors in non equal measures
16:56:35FromDiscord<odexine> And not 25
16:57:06FromDiscord<odexine> And there’s gotta be a better way to do that than just putting the percentage in the name of the procedure
16:57:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "And there’s gotta be": any better idea?
16:58:53FromDiscord<odexine> Mix that takes in 2 more parameters, numerator and denominator? Or ratios would work too
17:00:02FromDiscord<System64 ~ Flandre Scarlet> so overloading / ?
17:00:20FromDiscord<odexine> I guess so yes?
17:00:43FromDiscord<odexine> And also the problem of the fact that there are many ways to mix, or rather blend, colours
17:00:50FromDiscord<odexine> Have you checked the chroma library
17:02:07FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4CZz
17:02:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Have you checked the": https://github.com/megamarc/Tilengine/blob/master/src/Tables.c#L73↵I'm taking inspiration from that
17:04:25FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4CZD
17:06:01FromDiscord<Chronos [She/Her]> In reply to @odexine "Limiting in what sense": For ULID I need to be able to cut the ints to specific bytes (so a 48 bit number and an 80 bit number)
17:06:24FromDiscord<Chronos [She/Her]> So I'd probably need some sort of argument for cutting off the bytes at a certain length but
17:07:05FromDiscord<odexine> I honestly have no idea what you just said
17:07:16FromDiscord<odexine> “Cutting off the bytes”
17:08:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/4qRKb
17:08:22FromDiscord<odexine> Yes, it is confusing
17:08:33FromDiscord<odexine> Rename first procedure to +=
17:08:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "Rename first procedure to": Oh, better!
17:08:45FromDiscord<Chronos [She/Her]> In reply to @odexine "“Cutting off the bytes”": A 48 bit number needs to be stored as a 64 bit number internally obviously but I need to be able to ignore the 2 empty bytes really
17:09:28FromDiscord<odexine> In reply to @chronos.vitaqua "A 48 bit number": I understand that much but I don’t see the issue
17:11:17FromDiscord<System64 ~ Flandre Scarlet> and for the `mod` operator? Seems I can't do mod=
17:14:52FromDiscord<odexine> You don’t implement it
17:14:57FromDiscord<odexine> Same with div
17:15:25FromDiscord<System64 ~ Flandre Scarlet> Oh alright↵So it won't be consistant, will it be?
17:17:25FromDiscord<odexine> It isn’t either in the standard library
17:17:29FromDiscord<odexine> If you haven’t noticed
17:18:06FromDiscord<System64 ~ Flandre Scarlet> Oh, I thought mod was a part of the stdlib
17:20:18*LuxuryMode quit (Quit: Connection closed for inactivity)
17:22:00*azimut_ joined #nim
17:22:11FromDiscord<System64 ~ Flandre Scarlet> Well, I think it's better to go with normal procs
17:24:00FromDiscord<Chronos [She/Her]> In reply to @odexine "I understand that much": I also need to store it as a fixed-length
17:24:26FromDiscord<Chronos [She/Her]> So it needs to always be stored as 48 bytes in the encoded sequence
17:24:38*azimut quit (Ping timeout: 240 seconds)
17:53:27FromDiscord<Phil> Hmm if I wanted to check if a NimNode is associated with a pragma I shouldn't be using stuff from `compiler/pragmas` right? That smells like a module whose use is intended only for compiler stuff
18:01:38*azimut_ quit (Ping timeout: 240 seconds)
18:09:56FromDiscord<aftalavera> sent a long message, see https://paste.rs/s5acE
18:10:14FromDiscord<aftalavera> need help zipping a 4gb file the machine has 4gb of memory
18:10:21FromDiscord<aftalavera> ddsffdsf
18:11:35FromDiscord<aftalavera> Need help zipping a 4gb file in a machine with 4gb og memory. How can I do it in chunks?
18:24:52FromDiscord<Phil> Time to chain seqUtils-calls in macros
18:24:59FromDiscord<Phil> (edit) "seqUtils-calls" => "sequtils-calls"
18:25:09FromDiscord<Phil> (edit) "Time" => "Beef is asleep, time"
18:43:01*def- quit (Quit: -)
18:43:14*def- joined #nim
19:01:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D0g
19:02:23FromDiscord<System64 ~ Flandre Scarlet> Is it possible to get the current UNIX time with microseconds and nanoseconds?
19:09:11FromDiscord<System64 ~ Flandre Scarlet> Oh, Monotime might help me
19:31:19FromDiscord<jos7388> I love nim
19:33:11FromDiscord<System64 ~ Flandre Scarlet> same
19:41:00FromDiscord<Phil> After I pretty much just rebuilt mapStruct and the entire concept is pretty simple (and now I just need to do tests, a Readme, github infrastructure and publishing):↵Very, very much same
19:41:54FromDiscord<Phil> (edit) "After I pretty much just rebuilt mapStruct ... and" added "(lib from another language)"
19:45:00*advesperacit quit ()
20:03:13FromDiscord<Elegantbeef> Reported↵(@Phil)
20:03:56FromDiscord<Phil> Extra allocations at compiletime are irrelevant allocations!
20:04:13FromDiscord<Elegantbeef> Except for it's a performance issue 😛
20:08:57FromDiscord<djazz> to set an alias for a proc, is it best to use template or const?
20:09:14FromDiscord<djazz> dont want to type all parameters twice
20:09:41FromDiscord<bung8954> template
20:10:09FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#ix=4D0t
20:10:14FromDiscord<djazz> to avoid the prefix
20:10:42FromDiscord<Elegantbeef> `proc setFunction(gpio: Gpio, fn: GpiFunction) {.importc: "gpio_set_function".}`
20:10:45FromDiscord<djazz> hmm `template setFunction = gpioSetFunction` would work?
20:11:11FromDiscord<djazz> yes but I want to stay compatible with the pico sdk functions
20:11:30FromDiscord<Elegantbeef> well then use the const I guess, but it's redundant
20:19:04FromDiscord<Chronos [She/Her]> Honestly I don't get how a base64 encoder (or any base) can encode and decode strings?
20:19:52FromDiscord<Elegantbeef> It stores the data as 0..63 characters
20:21:14FromDiscord<Elegantbeef> Each character is capable of storing 6bits of information
20:25:41FromDiscord<Elegantbeef> It's no different to encoding a string into hexadecimal, it's just a different base and different symbol
20:39:54FromDiscord<djazz> if i have a proc that is "pure" that it can be called bot with static and runtime parameter, how can i make it so it works with both? myvar: static[int] | int in parameter field?
20:40:00FromDiscord<djazz> compileTime
20:40:10FromDiscord<djazz> or do i have to duplicate the body
20:42:03*ntat quit (Quit: leaving)
20:43:11FromDiscord<djazz> or is nim smart enough to know its a constant expression through a normal proc?
20:43:20FromDiscord<djazz> hmm, i guess if output is stored to a const...
20:49:03FromDiscord<Elegantbeef> Nim folds constants and calls
20:49:27FromDiscord<Elegantbeef> So you technically do not even need `static int` if the proc has no side effect and does not rely on importc it should be called statically
20:55:27FromDiscord<Elegantbeef> I guess code folding isnt as good as it should be
20:59:10FromDiscord<Elegantbeef> So seems you need two variations one annotated `compiletime` and one not
21:00:02FromDiscord<0xrh0d4m1n> hey guys, you have any guide about debugging Nim? 🙂
21:00:02FromDiscord<exelotl> I think it got worse at some point, I have a template which can take a float and return an int, and I noticed the float appears in the generated C code now when I'm sure it didn't before
21:05:00FromDiscord<Elegantbeef> Actually it seems like only magic is constant folded
21:06:03FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/6ec1c80779831875b2552d6ba2d613503b53a012/compiler/semfold.nim#L642
21:06:07FromDiscord<Elegantbeef> Though there might be another branch
21:07:06FromDiscord<bostonboston> In reply to @0xrh0d4m1n "hey guys, you have": https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html
21:32:59FromDiscord<0xrh0d4m1n> Thank you again @bostonboston
21:39:11*Jjp137 quit (Quit: Leaving)
21:40:32*Jjp137 joined #nim
21:42:19FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "It stores the data": Yeah but how does it tell what character is one character?
21:43:36FromDiscord<Elegantbeef> each character is 6bits, bitmask and carry on
21:44:33FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/base64.nim#L82
21:45:02FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/base64.nim#L221
21:46:45FromDiscord<Elegantbeef> Since each character is 6bits you have to have groups of 4 bytes since it's the lowest multiple of 6 that is divisible by 8
21:54:12*azimut joined #nim
22:05:20*def- quit (Quit: -)
22:05:33*def- joined #nim
22:18:37*def- quit (Quit: -)
22:21:14FromDiscord<Festive> Is there a nimlang gui library that supports tables?
22:23:22FromDiscord<nixfreak> Is TCC not supported as a compiler anymore?
22:23:46FromDiscord<Elegantbeef> It still works, no clue if it's "supported"
22:24:26FromDiscord<Elegantbeef> `--threads:off` is all that's required
22:24:57FromDiscord<nixfreak> Ahh ok
22:25:09*def- joined #nim
22:26:42*jmdaemon joined #nim
22:28:26*def- quit (Client Quit)
22:32:29*def- joined #nim
22:36:30FromDiscord<juan_carlos> Any better way to generate a random float? than `int.high.rand.float` 🤔
22:39:33*def- quit (Quit: -)
22:40:21*def- joined #nim
22:42:08FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/dJ8uX
22:44:39FromDiscord<therealori> I have a bunch of strings that contain different languages (a lot of unicode characters), Is there a way to allow the use of unicode characters?↵↵The error I get is: `Error: invalid character constant`
22:45:39FromDiscord<therealori> (edit) "I have a bunch of strings that contain different languages (a lot of unicode characters), Is there a way to allow the use of unicode characters?↵↵The error I get is: `Error: invalid character constant` ... " added "when trying to compile the code."
22:46:33FromDiscord<Elegantbeef> Nim allows unicode identifiers, and unicode strings
22:46:50FromDiscord<Elegantbeef> So you're doing `'unicodechar'` you want to do `"unicodechar"`
22:47:09FromDiscord<jakraes> Got a little question, how do I set the output dir on the nim compiler?
22:47:43FromDiscord<Elegantbeef> `--outDir:`
22:47:44*def- quit (Quit: -)
22:47:59FromDiscord<jakraes> Thank you 🫡
22:48:18FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimc.html is even nicer than me
22:48:33FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Since each character is": Don't think I can understand this properly tbh- But oh well
22:48:46FromDiscord<Chronos [She/Her]> It flies over our head no matter how it's explained
22:51:03FromDiscord<␀ Array> whats new in nim 2?
22:51:07FromDiscord<Andreas> In reply to @Elegantbeef "It still works, no": by ARAQ, definitely not supported, but might work..
22:51:37FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "It still works, no": by ARAQ, definitely not supported, but might work.. ... " added "should be removed from the website.."
22:51:43FromDiscord<therealori> In reply to @Elegantbeef "So you're doing `'unicodechar'`": I'm not sure what you mean by this. Also all of the strings are within `""` and not `''`.
22:51:51FromDiscord<Andreas> (edit) "removed" => "removed/edited"
22:56:26FromDiscord<Elegantbeef> What's the code?
22:57:14FromDiscord<Elegantbeef> Ah you probably have a `\` in your string aswell
22:57:59FromDiscord<therealori> sent a code paste, see https://play.nim-lang.org/#ix=4D16
22:58:12FromDiscord<therealori> Like I said, a lot of lanaguages and unicode.
22:58:23FromDiscord<Elegantbeef> Where's the error?
22:58:29FromDiscord<Elegantbeef> inside `symbols`?
22:58:42FromDiscord<Elegantbeef> Ps in Nim `const` is how you define a constant
22:59:24FromDiscord<Elegantbeef> That code works, so uhh where's the bad code?
23:03:19FromDiscord<therealori> (thanks, still very very new to nim)↵Literally any unicode characters won't show correctly.
23:04:02FromDiscord<Elegantbeef> `nim -v`?
23:04:13FromDiscord<therealori> 2.0.0
23:04:29FromDiscord<Elegantbeef> Well the above code works, so I can only assume you left code out
23:05:07FromDiscord<therealori> `��ㆉ�ዉ�o���ä��������µ����u�����ኒ�ᮙ��E��፥��R�����፯��ᤋၶ�������چ�vᢥ�����ؓ��᭰������������ᕈٞ�����`↵This is my terminal output. When working with python, it shows everything just fine so it's not my terminal
23:05:16FromDiscord<therealori> hmm
23:05:21FromDiscord<Elegantbeef> Are you on windows?
23:05:33FromDiscord<therealori> No
23:06:51FromDiscord<therealori> I am using gcc as the compiler too if that's of any help
23:06:57FromDiscord<Elegantbeef> Well it compiles fine here
23:07:26FromDiscord<Elegantbeef> So provide the actual issue file 😄
23:09:25*xet7 quit (Ping timeout: 240 seconds)
23:10:45FromDiscord<therealori> In reply to @Elegantbeef "So provide the actual": https://media.discordapp.net/attachments/371759389889003532/1138972664711630848/nimgen.nim
23:11:35FromDiscord<therealori> ~~note, still very new to nim so keep in mind the code will not be good, etc.~~
23:12:22FromDiscord<Elegantbeef> I mean you're using regex it'll never be good
23:12:47FromDiscord<that_dude.> Don't you need to use runes when working with unicode?
23:12:50FromDiscord<that_dude.> Instead of char
23:13:02FromDiscord<that_dude.> https://nim-lang.org/docs/unicode.html
23:13:28FromDiscord<Elegantbeef> Yes you do
23:13:40FromDiscord<Elegantbeef> Nim strings are unicode unaware so `str[0]` gets the first byte
23:14:34FromDiscord<therealori> I don't know, I tried to read the docs there but it's not really understandable for me at the level I am at currently. It just looks like a mess of text that has no meaning for me yet.
23:14:57FromDiscord<therealori> Like, I could get better documentation from readme's on github
23:15:09FromDiscord<bostonboston> The docs aren't that bad
23:15:25FromDiscord<therealori> Sure, but they are pretty bad xD
23:15:39FromDiscord<therealori> well, for me anyways and I'm brand new to Nim
23:15:47FromDiscord<therealori> it'll take some time
23:15:49FromDiscord<that_dude.> Looks like you may be interested in https://nim-lang.org/docs/unicode.html#runeAt%2CopenArray%5Bchar%5D%2CNatural `runeAt` or `runAtPos`
23:17:07FromDiscord<that_dude.> Or probably even better, https://nim-lang.org/docs/unicode.html#toRunes%2Cstring
23:23:40FromDiscord<therealori> I'll try and take a look again, do you have any links to some examples?
23:24:24FromDiscord<therealori> (edit) "I'll try and take a look again, do you have any links to some ... examples?" added "more"
23:24:46*def- joined #nim
23:27:39*def- quit (Client Quit)
23:27:51*def- joined #nim
23:54:28FromDiscord<therealori> In reply to @that_dude. "Or probably even better,": I don't know if it even works yet but when compiling it stops me because `.splitWhitespace()` is to simmilar to `unicode.splitWhitespace`. And ideas on what to do?
23:54:59FromDiscord<therealori> (edit) "In reply to @that_dude. "Or probably even better,": I don't know if it even works yet but when compiling it stops me because `.splitWhitespace()` is to simmilar to `unicode.splitWhitespace`. And ideas on what to do?" => "sent a code paste, see https://paste.rs/JJnIs"
23:55:11FromDiscord<Elegantbeef> `import std/strutils except splitWhitespace`
23:55:20FromDiscord<Elegantbeef> or `unicode.splitWhiteSpace(str)`
23:55:25FromDiscord<therealori> thanks
23:55:32FromDiscord<that_dude.> I was going to sugest fully qualifying it lol
23:55:50FromDiscord<System64 ~ Flandre Scarlet> Is it possible to get a slice of a seq, and then append this slice to another seq?
23:56:00FromDiscord<therealori> (edit) "thanks" => "thanks, i'll give it a try"
23:56:04FromDiscord<that_dude.> Doesn't `add` work for that?
23:56:15FromDiscord<Elegantbeef> `mySeq.add myOtherSeq.toOpenArray(0, 3)`
23:56:50FromDiscord<that_dude.> tbh I would have assumed that you could do something like `mySeq[3..5]`
23:57:03FromDiscord<Elegantbeef> You can, but that copies
23:57:06*oprypin_ quit (Quit: No Ping reply in 180 seconds.)
23:57:08FromDiscord<Elegantbeef> I do no encourage needless copying
23:57:09FromDiscord<that_dude.> Ah
23:57:48FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You can, but that": It's for merging palettes for me
23:58:25*oprypin joined #nim