00:02:15 | FromDiscord | <Phil> In reply to @bostonboston "Also the trick is": You use your skills to get high? |
00:03:34 | FromDiscord | <Elegantbeef> I tried that once, but they knew I never smoked weed before |
00:06:00 | FromDiscord | <bostonboston> In reply to @isofruit "You use your skills": Yes of course |
00:10:26 | FromDiscord | <sirolaf> What is the preferred way to echo without a newline under nimscript? No stdout available for some reason |
00:10:43 | FromDiscord | <Elegantbeef> There isnt a preferred way that I know of |
00:10:48 | FromDiscord | <Elegantbeef> No stdout cause Nimscript cannot import c |
00:11:31 | FromDiscord | <01r> Meme answer: discard execShellCmd("echo -n 'without a newline'") |
00:13:00 | FromDiscord | <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:19 | FromDiscord | <acomab> (edit) ""foo_bar"." => ""foo_bar"?" |
00:13:33 | FromDiscord | <Elegantbeef> Nope you need to use `jsonutils` |
00:13:38 | FromDiscord | <Elegantbeef> Really there needs to be a pragma added |
00:13:45 | FromDiscord | <acomab> In reply to @Elegantbeef "Really there needs to": agreed |
00:13:48 | FromDiscord | <acomab> thanks for the help |
00:14:00 | FromDiscord | <Elegantbeef> Someone needs to make it so generics do not lose pragma annotations |
00:14:07 | FromDiscord | <Elegantbeef> That way it can work across all types |
00:14:23 | FromDiscord | <acomab> i assume that jsonutils has a pragma? |
00:14:32 | FromDiscord | <Elegantbeef> Nope |
00:14:39 | FromDiscord | <Elegantbeef> But you can write your own serialisation hook |
00:14:53 | FromDiscord | <acomab> oh that's still somewhat useful to know |
00:15:11 | FromDiscord | <acomab> what im writing would be a lot easier with a deserialisation hook |
00:15:32 | FromDiscord | <Elegantbeef> jsonutils doesnt really have good docs, but you can refer to the hooks for tables and the like |
00:15:37 | FromDiscord | <Elegantbeef> Copy the signature for your type and call it a day |
00:16:39 | FromDiscord | <acomab> yeah it seems to be fairly straightforward lol |
00:17:35 | FromDiscord | <sirolaf> In reply to @Elegantbeef "No stdout cause Nimscript": Ansi escape code time it is then |
00:24:43 | FromDiscord | <sirolaf> sent a code paste, see https://play.nim-lang.org/#ix=4CVp |
00:37:21 | FromDiscord | <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:53 | FromDiscord | <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:24 | FromDiscord | <Matt> sent a code paste, see https://play.nim-lang.org/#ix=4CVB |
01:34:48 | FromDiscord | <.matrixagent> Error logs would probably help |
01:35:29 | FromDiscord | <Elegantbeef> Compiler cgen bug |
01:36:22 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4CVD |
01:36:23 | FromDiscord | <monark.chan> Does Nim have a library that makes interacting with graphql apis more concise? |
01:36:48 | FromDiscord | <Elegantbeef> Probably an issue with the `spawn` generator |
01:37:01 | FromDiscord | <Elegantbeef> Or `parallel` |
01:39:57 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> It's experimental |
01:40:13 | FromDiscord | <Elegantbeef> So if you want to call that second class sure 😄 |
01:40:18 | FromDiscord | <Elegantbeef> use weave or taskpools |
01:41:08 | FromDiscord | <Matt> Got it |
01:42:59 | FromDiscord | <Matt> sent a long message, see http://ix.io/4CVE |
01:43:20 | FromDiscord | <Elegantbeef> Not really |
01:43:25 | FromDiscord | <Elegantbeef> The core language works |
01:43:51 | FromDiscord | <Matt> incl. concurrency? |
01:44:02 | FromDiscord | <Elegantbeef> `createThreads` works fine |
01:44:22 | FromDiscord | <Elegantbeef> It's not the best API, but it works, experimental features like `parallel` and `spawn` do not, but they're experimental |
01:45:30 | FromDiscord | <Matt> Gotcha |
01:46:13 | * | lucasta joined #nim |
01:46:26 | FromDiscord | <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:48 | FromDiscord | <Matt> So it's not just concurrency/parallel & spawn that came to mind |
01:47:50 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> I'd like to have first class performant iterators built into the langauge, but alas |
01:49:40 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> It had peeking, but I realised I was doing it 100% wrong, so I need to revisit it in the future |
01:50:44 | FromDiscord | <Matt> I'll take a look! |
01:52:32 | FromDiscord | <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:14 | FromDiscord | <Elegantbeef> No clue |
01:53:28 | FromDiscord | <Matt> 👍 |
01:53:32 | FromDiscord | <Matt> +1 |
01:54:28 | FromDiscord | <odexine> https://github.com/narimiran/itertools |
01:55:35 | FromDiscord | <Matt> Found https://nim-lang.org/docs/lib.html |
01:55:53 | FromDiscord | <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:19 | FromDiscord | <ringabout> sent a code paste, see https://paste.rs/R3VgA |
03:43:21 | FromDiscord | <ringabout> Is it intended> |
03:43:23 | FromDiscord | <ringabout> (edit) "intended>" => "intended?" |
03:44:03 | FromDiscord | <Elegantbeef> That screams missed interaction to me |
03:47:02 | FromDiscord | <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:41 | NimEventer | New thread by grd: Command line options, see https://forum.nim-lang.org/t/10389 |
07:14:45 | FromDiscord | <odexine> Oh boy |
07:15:31 | FromDiscord | <Elegantbeef> Time for some term rewriting macros 😄 |
07:16:37 | FromDiscord | <odexine> Maybe it’s time to write a formatter/linter |
07:16:37 | FromDiscord | <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:56 | FromDiscord | <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:57 | FromDiscord | <Elegantbeef> It matches an expression instead of a call |
07:17:05 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9739#64098 refer |
07:17:09 | FromDiscord | <odexine> Basically it’s the worst kind of magic for you |
07:17:49 | FromDiscord | <Elegantbeef> TRM cannot match on a command though afaik |
07:18:05 | FromDiscord | <Phil> Wait so basically no explicit "I am applying this macro here", it applies itself? |
07:18:06 | FromDiscord | <Elegantbeef> Since the compiler removes that to a call |
07:18:14 | FromDiscord | <odexine> In reply to @isofruit "Wait so basically no": Yes. |
07:18:16 | FromDiscord | <odexine> Lol |
07:18:19 | FromDiscord | <Elegantbeef> Correct you define a pattern for the macro to appl |
07:18:27 | FromDiscord | <Phil> The blood is leaving my face right now |
07:18:28 | FromDiscord | <odexine> Phil just unlocked a new kind of nightmare |
07:18:51 | FromDiscord | <Phil> Like, i can see the value for it if I ever wrap my head around the entire mock-generic-functions thing |
07:18:52 | FromDiscord | <odexine> Don’t worry it’s experimental |
07:19:00 | FromDiscord | <odexine> And likely to be removed some time iirc? |
07:19:12 | FromDiscord | <Phil> (edit) "thing" => "thing.↵But generally..." |
07:19:17 | FromDiscord | <Elegantbeef> No clue if removed or just replaced with a more sensible api |
07:20:30 | FromDiscord | <Elegantbeef> It does give us semantic linting, which is quite fantastic, but yea it's not sane. |
07:21:15 | FromDiscord | <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:33 | FromDiscord | <Phil> More than converters at least |
07:21:41 | FromDiscord | <Elegantbeef> I did have an idea to use it for HCR |
07:21:55 | FromDiscord | <Elegantbeef> Converters are more useful than TRMs in reality |
07:21:56 | FromDiscord | <Phil> But maybe I'll see their usecase once I actually deal with building DSLs myself if I ever do that |
07:22:07 | FromDiscord | <Elegantbeef> But that's cause Nim lacks weak distinct types |
07:22:23 | FromDiscord | <Phil> In reply to @Elegantbeef "I did have an": HCR?↵Home cooked recipes? |
07:22:34 | FromDiscord | <Elegantbeef> Hot code reloading |
07:22:44 | FromDiscord | <Phil> Ahhh check |
07:23:09 | FromDiscord | <Phil> Ohhh term rewriting because it rewrites what a term means with its own definition, that just made click |
07:24:00 | FromDiscord | <Elegantbeef> Well it does not rewrite what a term means it changes what a term does 😄 |
07:24:07 | FromDiscord | <Elegantbeef> Term rewriting macros cannot change what something is, only how it gets there |
07:24:14 | FromDiscord | <Elegantbeef> The expression has to evaluate to the same type after the macro expands |
07:24:22 | FromDiscord | <Phil> Ah, check |
07:24:36 | FromDiscord | <Phil> Next question, what is this:↵`error("Expected a type.", x)` |
07:24:46 | FromDiscord | <Elegantbeef> A procedure call |
07:25:01 | FromDiscord | <Elegantbeef> Believe it or not you can call procedures in Nim a procedural language |
07:25:07 | FromDiscord | <Phil> Incredible |
07:25:17 | FromDiscord | <Phil> Well yeah but is that the error pragma in disguise?↵do we have an error proc somewhere? |
07:25:19 | FromDiscord | <Elegantbeef> Sass aside it calls the `error` proc which inside macros emits a error |
07:25:40 | FromDiscord | <Phil> So kind of like the error pragma for within macros |
07:26:20 | FromDiscord | <Elegantbeef> Yes it calls the `macros.error` which is the way to error inside macros when you want to give helpful errors |
07:26:37 | FromDiscord | <Elegantbeef> Sorta, but you can give a NimNode to take line information from |
07:26:55 | FromDiscord | <Elegantbeef> So in that above case it gives the exact line and information for the symbol of the variable |
07:26:57 | FromDiscord | <Phil> Wow bridge be slow |
07:27:18 | FromDiscord | <Elegantbeef> It's not that bad |
07:27:21 | FromDiscord | <Phil> In reply to @Elegantbeef "Sorta, but you can": Oh! that is pretty cool! |
07:28:21 | FromDiscord | <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:56 | FromDiscord | <Elegantbeef> There are of course `hint` and `warning` siblings to `error` |
07:28:58 | FromDiscord | <Phil> You underestimate my power, I would never write code that would even have the possibility of invalid state |
07:29:06 | FromDiscord | <Phil> Perfection and all that |
07:31:51 | FromDiscord | <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:53 | FromDiscord | <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:23 | PMunch | Hmm, I think the --debugger:native mapping stuff is a bit borked.. |
07:43:47 | PMunch | I'm getting this crash: http://ix.io/4oDz |
07:43:53 | FromDiscord | <Phil> Actually that's a curious question - Things like valgrind won't be able to deal with macros well, right? |
07:43:56 | PMunch | And it points to lines which don't exist.. |
07:44:16 | FromDiscord | <Elegantbeef> Why wouldnt they deal with macros well |
07:44:21 | FromDiscord | <Elegantbeef> The generated code has line information |
07:44:25 | FromDiscord | <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:32 | PMunch | @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:44 | PMunch | That's how it shows where in the code it comes from |
07:44:48 | FromDiscord | <Phil> Ah and those mapping statements are language agnostic? |
07:44:57 | FromDiscord | <Phil> Like you can make one for any language for valgrind? Neat |
07:45:17 | FromDiscord | <Elegantbeef> It's just some text appended to the binary iirc |
07:45:28 | FromDiscord | <Elegantbeef> It does exist pmunch |
07:45:41 | FromDiscord | <Elegantbeef> Inside the include 😄 |
07:45:47 | PMunch | Yeah.. |
07:46:13 | PMunch | But I tried to calculate where in the include it came from, and that was just an imported int.. |
07:46:14 | FromDiscord | <Elegantbeef> So odd that it did that, seems like it is a bug |
07:47:11 | PMunch | Fun thing is, I don't use threads in this code.. |
07:47:29 | PMunch | So I'm skeptical of the "typedthreads" part entirely |
07:47:48 | FromDiscord | <Elegantbeef> Right then this is a bug |
07:47:53 | PMunch | I'm running it now without --debugger:native to see if I can just get the errors in the generated C code |
08:04:27 | Amun-Ra | btw, does nim use threads itself for some under the hood operations? |
08:08:33 | PMunch | Not as far as I know |
08:13:56 | PMunch | It seems to come from popCurrentException which runs eqcopy from typedthreads trying to access currException.up which causes the SIGSEGV |
08:14:42 | PMunch | This is of course a program which crashes after running for a couple days.. So it's kinda hard to debug.. |
08:18:47 | PMunch | Hmm, this seems a bit sketchy: https://play.nim-lang.org/#ix=4CWP |
08:19:34 | PMunch | Compared to with --threads:off https://play.nim-lang.org/#ix=4CWQ |
08:20:00 | FromDiscord | <Elegantbeef> The hell |
08:20:11 | FromDiscord | <Elegantbeef> That's a mild cockup |
08:20:45 | FromDiscord | <Elegantbeef> There isnt even a `=destroy` in threads is there |
08:22:18 | PMunch | That's =copy isn't it? |
08:22:39 | FromDiscord | <Elegantbeef> Yea sorry brain fart |
08:24:26 | FromDiscord | <djazz> @pmunch https://github.com/PMunch/futhark/pull/78 i fixed it |
08:24:55 | FromDiscord | <djazz> Btw, trying to get nim check/nimsuggest to work well with futhark without using outputPath seems impossible |
08:25:34 | FromDiscord | <djazz> nim check disables staticExec and uses a different nimcache dir |
08:26:22 | PMunch | I 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:29 | PMunch | At least it used to work fine in NimLSP |
08:27:01 | FromDiscord | <djazz> Yeah, but then futhark dont autogenerate when it detects changes |
08:27:18 | FromDiscord | <djazz> (No hashing) |
08:28:03 | PMunch | Yeah that's true |
08:28:14 | PMunch | Or wait.. |
08:28:42 | PMunch | I was talking about not using any of the output options, and just letting it put it in cache |
08:28:57 | PMunch | Ah, but nim check uses a different nimcache directory.. |
08:29:00 | PMunch | That's a shame |
08:29:28 | PMunch | Maybe there's a hack we could employ which finds the true cache? |
08:29:52 | FromDiscord | <Elegantbeef> `when defined(nimcheck)` and cry deeply |
08:31:13 | FromDiscord | <djazz> Yep <https://github.com/daniel-j/nim-picosdk/blob/master/src/picostdlib/lib/lwip.nim#L37> |
08:31:46 | FromDiscord | <djazz> Made a nimble task to generate futhark wrappers |
08:31:51 | FromDiscord | <Elegantbeef> Should that also have `nimsuggest` do not recall though |
08:32:12 | FromDiscord | <djazz> I think its just nimcheck define |
08:34:15 | FromDiscord | <djazz> This works great when developing on the module, but how to handle when another module depend on this lib? |
08:34:41 | FromDiscord | <djazz> Still trying to find the best way |
08:35:37 | FromDiscord | <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:55 | PMunch | Hmm, so the generated code seems the same |
08:36:20 | PMunch | It's just renamed to typedthreads and has a different line number |
08:36:25 | FromDiscord | <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:46 | FromDiscord | <jmgomez> is `nimcheck` defined though? Last time I checked it wasnt and I had to do `const nimcheck = querySetting(command) == "check"` |
08:37:47 | PMunch | My 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:10 | FromDiscord | <djazz> In reply to @jmgomez "is `nimcheck` defined though?": It seems to work… |
08:38:46 | PMunch | It confuses the shit out of the debugger though :P |
08:39:17 | PMunch | So it's actually eqcopy which causes the SIGSEGV |
08:39:21 | PMunch | That's not great |
08:41:44 | PMunch | Is it just me, or is the colontmp_ and its management here completely superfluous? http://ix.io/4CWT |
08:53:20 | NimEventer | New thread by sls1005: Some ideas about nimrtl, see https://forum.nim-lang.org/t/10390 |
09:03:23 | NimEventer | New thread by drkameleon: Template being called twice with Nim 2.0, see https://forum.nim-lang.org/t/10391 |
09:07:18 | FromDiscord | <4zv4l> how do I do comptime check ?↵for example to do a compile error if when compiling the target is not windows ? |
09:07:37 | PMunch | `when not defined(windows)` |
09:07:55 | FromDiscord | <4zv4l> I tried https://media.discordapp.net/attachments/371759389889003532/1138760560876470372/image.png |
09:07:57 | FromDiscord | <4zv4l> but it still compile it |
09:08:04 | FromDiscord | <4zv4l> it only shows the error when I run it |
09:08:15 | PMunch | Of course |
09:08:28 | PMunch | You don't have any compile-time statements in your when block |
09:08:36 | FromDiscord | <4zv4l> In reply to @4zv4l "how do I do": so that's not comptime check 🥹 |
09:08:37 | PMunch | The when block simply selects what to add |
09:08:55 | PMunch | The check is done at compile-time, and it insert the code for your runtime |
09:09:34 | FromDiscord | <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:51 | PMunch | Well you already do the compile-time check |
09:10:00 | PMunch | You just need to do your work at compile-time as well: http://ix.io/4CWT |
09:10:09 | PMunch | Oops, wrong link: https://play.nim-lang.org/#ix=4CX0 |
09:11:04 | PMunch | You could of course also use the error pragma: https://play.nim-lang.org/#ix=4CX1 |
09:11:57 | FromDiscord | <4zv4l> In reply to @PMunch "You could of course": that's exactly what I was looking for !↵thanks ! |
09:16:58 | FromDiscord | <4zv4l> there isn't a rename file function in the stdlib ? |
09:17:58 | FromDiscord | <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:54 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=4CXe |
10:47:45 | FromDiscord | <roupi.rb> how i get the type of a variable ? |
10:47:58 | FromDiscord | <roupi.rb> (edit) "variable" => "obj" |
10:48:45 | PMunch_ | `typeof(myvar)` |
10:49:53 | FromDiscord | <roupi.rb> hum how do i check if a variable type is Message |
10:49:58 | FromDiscord | <roupi.rb> for example |
10:50:10 | FromDiscord | <roupi.rb> idunno how generics works yet |
10:58:10 | PMunch_ | `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:25 | FromDiscord | <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:55 | FromDiscord | <Phil> sent a long message, see http://ix.io/4CXn |
11:14:46 | FromDiscord | <Phil> (edit) "http://ix.io/4CXn" => "http://ix.io/4CXo" |
11:15:15 | FromDiscord | <Phil> (edit) "https://paste.rs/MEObh" => "https://paste.rs/Iap1Z" |
11:42:35 | FromDiscord | <roupi.rb> how would you make an interface like `Message.dump` |
11:43:02 | FromDiscord | <roupi.rb> (edit) "`Message.dump`" => "`Message.dump(message)` `Message.load(str)`" |
11:43:49 | PMunch | `proc dump(_: typedesc[Message], obj: Message)` |
11:44:24 | PMunch | But of course, the `Message.` part is completely superfluous since `message` is already of type `Message` |
11:44:42 | PMunch | So basically you're asking the programmer to specify the type twice |
11:45:52 | PMunch | Unless 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:57 | FromDiscord | <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:15 | FromDiscord | <Phil> (edit) "ElegantBeef.↵It" => "ElegantBeef as a helper package for using those.↵It" |
11:47:21 | FromDiscord | <Phil> (edit) "helper" => "helper/extension" |
11:47:48 | FromDiscord | <Phil> The boundary in your case would be that a `load` and `dump` proc must be defined for it. |
11:48:13 | FromDiscord | <roupi.rb> i just want to refactor this https://media.discordapp.net/attachments/371759389889003532/1138800898278162472/image.png |
11:48:25 | FromDiscord | <roupi.rb> using this long names doest feel to good |
11:48:29 | FromDiscord | <roupi.rb> (edit) removed "to" |
11:48:47 | FromDiscord | <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:19 | PMunch | Well `messageToJsonString` should probably be split into a `%` for message and then just the default `$` proc for that json object. |
11:50:02 | FromDiscord | <roupi.rb> how do i define a % for message |
11:50:09 | PMunch | And jsonStringToMessage could simply be named `to` with a signature of `proc to(data: string, kind: typedesc[Message]): Message` |
11:50:34 | PMunch | You just name it `%` in backticks |
11:50:46 | PMunch | Not sure how to send that in a way that's not bungled by the bridge.. |
11:51:09 | FromDiscord | <odexine> it isnt |
11:51:19 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/PnSbq |
11:51:20 | PMunch | http://ix.io/4CXx |
11:52:13 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4CXz" => "https://paste.rs/4Q5I6" |
11:52:31 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4CXy" => "https://play.nim-lang.org/#ix=4CXA" |
11:52:35 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4CXC" => "https://play.nim-lang.org/#ix=4CXB" |
11:52:44 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4CXB" => "https://play.nim-lang.org/#ix=4CXD" |
11:53:41 | PMunch | It'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:40 | FromDiscord | <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:56 | FromDiscord | <roupi.rb> sent a code paste, see https://paste.rs/wBRtm |
11:57:05 | FromDiscord | <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:55 | PMunch | Phil, well I tend to just assume it's a minor edit and not bother with anything but the first link |
12:02:18 | PMunch | It's a bit of noise, but it's much better than before when the entire message got replayed every edit :P |
12:02:49 | PMunch | I do wish oneliner code snippets where just sent as text though.. |
12:03:03 | PMunch | Ref. the last message by roupi.rb |
12:03:27 | PMunch | And 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:32 | FromDiscord | <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:48 | FromDiscord | <Chronos [She/Her]> Mainly so I can implement a custom base32 algorithm |
12:41:52 | FromDiscord | <Chronos [She/Her]> Hm... |
12:50:24 | * | def- quit (Quit: -) |
12:51:57 | PMunch | Shouldn't be too hard |
12:52:40 | PMunch | But why not use toBin/toOct/toHex? |
12:54:41 | FromDiscord | <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:32 | PMunch | Why do you say it's not doable? |
13:12:42 | FromDiscord | <chronos.vitaqua> In reply to @PMunch "Why do you say": No library for parsing crockford base32 aha |
13:13:09 | PMunch | Ah, so it's possible, just not implemented :P |
13:14:30 | * | rockcavera joined #nim |
13:14:49 | FromDiscord | <chronos.vitaqua> Yeah, my choice of wording is poor aha |
13:15:23 | PMunch | Looks super easy to implement though, why do you need a macro for this? |
13:16:05 | FromDiscord | <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:44 | FromDiscord | <Phil> In reply to @yu.vitaqua.fer.chronos "Genuinely wonder how hard": Why macro and not template? |
14:59:03 | FromDiscord | <Phil> Actually never mind, I'm not even sure how I'd pull that off via templates |
15:01:54 | FromDiscord | <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:27 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to check for byte overflow without casting/conversion? |
15:21:03 | FromDiscord | <odexine> wdym for "byte overflow" |
15:21:27 | * | jmdaemon quit (Ping timeout: 244 seconds) |
15:22:25 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4chi |
15:22:43 | * | lucasta quit (Quit: Leaving) |
15:22:46 | FromDiscord | <odexine> what types are the fields |
15:23:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "what types are the": bytes |
15:23:22 | FromDiscord | <odexine> as in exactly `byte` |
15:23:58 | FromDiscord | <System64 ~ Flandre Scarlet> yeah the fields are bytes |
15:26:45 | FromDiscord | <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:16 | FromDiscord | <System64 ~ Flandre Scarlet> Seems I'm forced to cast↵but it is possible to cap at 0 for subtraction |
15:28:46 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CZ6 |
15:30:22 | Amun-Ra | System64: https://play.nim-lang.org/#ix=4CZ8 |
15:30:31 | Amun-Ra | you'd have to use something like that |
15:31:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Amun-Ra "you'd have to use": Oh alright, and is that more performant than casting? |
15:33:01 | Amun-Ra | that depends |
15:42:26 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CZc |
15:45:44 | FromDiscord | <System64 ~ Flandre Scarlet> shouldn't I check like↵if(MAX_R -r2 < r1) too? |
15:48:13 | FromDiscord | <chronos.vitaqua> Should my code use uint or int for base conversion related stuff |
15:48:19 | Amun-Ra | System64: https://nim-lang.org/docs/system.html#clamp%2CT%2CT%2CT |
15:48:47 | Amun-Ra | you need either a clamp or saturated add |
15:49:29 | FromDiscord | <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:59 | Amun-Ra | the algorithm I sent works, you just don't need it |
15:50:28 | FromDiscord | <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:27 | Amun-Ra | → benchmark |
15:52:00 | Amun-Ra | test a few options with https://github.com/treeform/benchy and pick the fastest one |
15:54:06 | FromDiscord | <System64 ~ Flandre Scarlet> Ooooh alright↵Sounds pretty nice |
15:56:03 | FromDiscord | <chronos.vitaqua> Hi, question: How would I reverse the functionality here? |
15:56:13 | FromDiscord | <chronos.vitaqua> sent a code paste, see https://play.nim-lang.org/#ix=4CZf |
15:56:25 | FromDiscord | <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:30 | FromDiscord | <eliot_c> hello, is it possible to check for files using file extensions? like fileExists or existsFile |
16:26:20 | FromDiscord | <Phil> As in you want to have a list of all files with a given extension in a dir? |
16:27:05 | FromDiscord | <eliot_c> it could be a list but for my case im just trying to find the nimble file of a project |
16:27:29 | FromDiscord | <eliot_c> so it'd just be one file usually |
16:27:34 | FromDiscord | <Phil> I mean fileExists does exist as a proc ↵https://nim-lang.org/docs/oscommon.html#fileExists,string |
16:28:03 | FromDiscord | <Phil> Or do mean you're searching for a while in directories and want that to happen in a recursive fashion? |
16:28:11 | FromDiscord | <Phil> (edit) "while" => "file" |
16:28:23 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal this new operator doesn't work? https://media.discordapp.net/attachments/371759389889003532/1138871406113849494/image.png |
16:28:35 | FromDiscord | <eliot_c> yea in a recursive fashion |
16:29:05 | FromDiscord | <odexine> In reply to @sys64 "Is it normal this": Stropping text will not result in an operator |
16:29:27 | FromDiscord | <odexine> Only the specified ones like and or etc |
16:29:30 | FromDiscord | <odexine> Will work |
16:29:32 | FromDiscord | <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:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Stropping text will not": Oh, so impossible to create my own operator? |
16:30:14 | FromDiscord | <odexine> Possible, just not alphanumeric |
16:30:24 | FromDiscord | <eliot_c> In reply to @isofruit "In that case you'll": oooh ok thank you |
16:30:46 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Possible, just not alphanumeric": How to do that then? |
16:31:27 | FromDiscord | <odexine> Use a non-alphanumeric name? Like @@@ or something |
16:31:51 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
16:33:28 | FromDiscord | <System64 ~ Flandre Scarlet> and impossible to mix alphanumeric and non-alphanumeric I guess?↵Like I can't do %25? |
16:34:53 | FromDiscord | <odexine> No |
16:34:59 | FromDiscord | <odexine> You can’t |
16:35:13 | FromDiscord | <System64 ~ Flandre Scarlet> ah, I'll have to do a proc then |
16:37:37 | FromDiscord | <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:28 | FromDiscord | <odexine> Honestly don’t know what you’re making with those mix procedures |
16:51:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Honestly don’t know what": It's for mixing color together |
16:52:22 | FromDiscord | <odexine> Yes I get that but why are you adding the same thing twice in 25 |
16:53:14 | FromDiscord | <odexine> What I’m saying is that your procedure names don’t explain sufficiently for me |
16:53:32 | FromDiscord | <chronos.vitaqua> ^^^^ |
16:53:37 | FromDiscord | <chronos.vitaqua> Absolutely clueless |
16:53:43 | FromDiscord | <Phil> "sufficiently" is putting it lightly.↵`col1 %% col2` is like... what? |
16:53:51 | FromDiscord | <odexine> Not those |
16:54:11 | FromDiscord | <odexine> Even just “mix 25” doesn’t make sense to me |
16:54:27 | FromDiscord | <System64 ~ Flandre Scarlet> yeah that's the problem↵I try to create a new operator, but can't do proc \`mix25\`() |
16:54:39 | FromDiscord | <Phil> Adding a color to a pallette or subtracting one I can even wrap my head around |
16:54:51 | FromDiscord | <odexine> In reply to @sys64 "yeah that's the problem": That’s not what I mean |
16:54:52 | FromDiscord | <Phil> The operators for combining colors are leaving me completely clueless |
16:55:00 | FromDiscord | <odexine> I mean that even mix 25 makes 0 sense to me |
16:55:06 | FromDiscord | <odexine> What the hell does the 25 mean |
16:56:02 | FromDiscord | <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:32 | FromDiscord | <odexine> But your function body reads like it does 33% |
16:56:35 | FromDiscord | <Phil> So mixing colors in non equal measures |
16:56:35 | FromDiscord | <odexine> And not 25 |
16:57:06 | FromDiscord | <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:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "And there’s gotta be": any better idea? |
16:58:53 | FromDiscord | <odexine> Mix that takes in 2 more parameters, numerator and denominator? Or ratios would work too |
17:00:02 | FromDiscord | <System64 ~ Flandre Scarlet> so overloading / ? |
17:00:20 | FromDiscord | <odexine> I guess so yes? |
17:00:43 | FromDiscord | <odexine> And also the problem of the fact that there are many ways to mix, or rather blend, colours |
17:00:50 | FromDiscord | <odexine> Have you checked the chroma library |
17:02:07 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4CZz |
17:02:35 | FromDiscord | <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:25 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4CZD |
17:06:01 | FromDiscord | <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:24 | FromDiscord | <Chronos [She/Her]> So I'd probably need some sort of argument for cutting off the bytes at a certain length but |
17:07:05 | FromDiscord | <odexine> I honestly have no idea what you just said |
17:07:16 | FromDiscord | <odexine> “Cutting off the bytes” |
17:08:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/4qRKb |
17:08:22 | FromDiscord | <odexine> Yes, it is confusing |
17:08:33 | FromDiscord | <odexine> Rename first procedure to += |
17:08:43 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "Rename first procedure to": Oh, better! |
17:08:45 | FromDiscord | <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:28 | FromDiscord | <odexine> In reply to @chronos.vitaqua "A 48 bit number": I understand that much but I don’t see the issue |
17:11:17 | FromDiscord | <System64 ~ Flandre Scarlet> and for the `mod` operator? Seems I can't do mod= |
17:14:52 | FromDiscord | <odexine> You don’t implement it |
17:14:57 | FromDiscord | <odexine> Same with div |
17:15:25 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright↵So it won't be consistant, will it be? |
17:17:25 | FromDiscord | <odexine> It isn’t either in the standard library |
17:17:29 | FromDiscord | <odexine> If you haven’t noticed |
17:18:06 | FromDiscord | <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:11 | FromDiscord | <System64 ~ Flandre Scarlet> Well, I think it's better to go with normal procs |
17:24:00 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "I understand that much": I also need to store it as a fixed-length |
17:24:26 | FromDiscord | <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:27 | FromDiscord | <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:56 | FromDiscord | <aftalavera> sent a long message, see https://paste.rs/s5acE |
18:10:14 | FromDiscord | <aftalavera> need help zipping a 4gb file the machine has 4gb of memory |
18:10:21 | FromDiscord | <aftalavera> ddsffdsf |
18:11:35 | FromDiscord | <aftalavera> Need help zipping a 4gb file in a machine with 4gb og memory. How can I do it in chunks? |
18:24:52 | FromDiscord | <Phil> Time to chain seqUtils-calls in macros |
18:24:59 | FromDiscord | <Phil> (edit) "seqUtils-calls" => "sequtils-calls" |
18:25:09 | FromDiscord | <Phil> (edit) "Time" => "Beef is asleep, time" |
18:43:01 | * | def- quit (Quit: -) |
18:43:14 | * | def- joined #nim |
19:01:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4D0g |
19:02:23 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to get the current UNIX time with microseconds and nanoseconds? |
19:09:11 | FromDiscord | <System64 ~ Flandre Scarlet> Oh, Monotime might help me |
19:31:19 | FromDiscord | <jos7388> I love nim |
19:33:11 | FromDiscord | <System64 ~ Flandre Scarlet> same |
19:41:00 | FromDiscord | <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:54 | FromDiscord | <Phil> (edit) "After I pretty much just rebuilt mapStruct ... and" added "(lib from another language)" |
19:45:00 | * | advesperacit quit () |
20:03:13 | FromDiscord | <Elegantbeef> Reported↵(@Phil) |
20:03:56 | FromDiscord | <Phil> Extra allocations at compiletime are irrelevant allocations! |
20:04:13 | FromDiscord | <Elegantbeef> Except for it's a performance issue 😛 |
20:08:57 | FromDiscord | <djazz> to set an alias for a proc, is it best to use template or const? |
20:09:14 | FromDiscord | <djazz> dont want to type all parameters twice |
20:09:41 | FromDiscord | <bung8954> template |
20:10:09 | FromDiscord | <djazz> sent a code paste, see https://play.nim-lang.org/#ix=4D0t |
20:10:14 | FromDiscord | <djazz> to avoid the prefix |
20:10:42 | FromDiscord | <Elegantbeef> `proc setFunction(gpio: Gpio, fn: GpiFunction) {.importc: "gpio_set_function".}` |
20:10:45 | FromDiscord | <djazz> hmm `template setFunction = gpioSetFunction` would work? |
20:11:11 | FromDiscord | <djazz> yes but I want to stay compatible with the pico sdk functions |
20:11:30 | FromDiscord | <Elegantbeef> well then use the const I guess, but it's redundant |
20:19:04 | FromDiscord | <Chronos [She/Her]> Honestly I don't get how a base64 encoder (or any base) can encode and decode strings? |
20:19:52 | FromDiscord | <Elegantbeef> It stores the data as 0..63 characters |
20:21:14 | FromDiscord | <Elegantbeef> Each character is capable of storing 6bits of information |
20:25:41 | FromDiscord | <Elegantbeef> It's no different to encoding a string into hexadecimal, it's just a different base and different symbol |
20:39:54 | FromDiscord | <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:00 | FromDiscord | <djazz> compileTime |
20:40:10 | FromDiscord | <djazz> or do i have to duplicate the body |
20:42:03 | * | ntat quit (Quit: leaving) |
20:43:11 | FromDiscord | <djazz> or is nim smart enough to know its a constant expression through a normal proc? |
20:43:20 | FromDiscord | <djazz> hmm, i guess if output is stored to a const... |
20:49:03 | FromDiscord | <Elegantbeef> Nim folds constants and calls |
20:49:27 | FromDiscord | <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:27 | FromDiscord | <Elegantbeef> I guess code folding isnt as good as it should be |
20:59:10 | FromDiscord | <Elegantbeef> So seems you need two variations one annotated `compiletime` and one not |
21:00:02 | FromDiscord | <0xrh0d4m1n> hey guys, you have any guide about debugging Nim? 🙂 |
21:00:02 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> Actually it seems like only magic is constant folded |
21:06:03 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/6ec1c80779831875b2552d6ba2d613503b53a012/compiler/semfold.nim#L642 |
21:06:07 | FromDiscord | <Elegantbeef> Though there might be another branch |
21:07:06 | FromDiscord | <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:59 | FromDiscord | <0xrh0d4m1n> Thank you again @bostonboston |
21:39:11 | * | Jjp137 quit (Quit: Leaving) |
21:40:32 | * | Jjp137 joined #nim |
21:42:19 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "It stores the data": Yeah but how does it tell what character is one character? |
21:43:36 | FromDiscord | <Elegantbeef> each character is 6bits, bitmask and carry on |
21:44:33 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/base64.nim#L82 |
21:45:02 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/pure/base64.nim#L221 |
21:46:45 | FromDiscord | <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:14 | FromDiscord | <Festive> Is there a nimlang gui library that supports tables? |
22:23:22 | FromDiscord | <nixfreak> Is TCC not supported as a compiler anymore? |
22:23:46 | FromDiscord | <Elegantbeef> It still works, no clue if it's "supported" |
22:24:26 | FromDiscord | <Elegantbeef> `--threads:off` is all that's required |
22:24:57 | FromDiscord | <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:30 | FromDiscord | <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:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/dJ8uX |
22:44:39 | FromDiscord | <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:39 | FromDiscord | <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:33 | FromDiscord | <Elegantbeef> Nim allows unicode identifiers, and unicode strings |
22:46:50 | FromDiscord | <Elegantbeef> So you're doing `'unicodechar'` you want to do `"unicodechar"` |
22:47:09 | FromDiscord | <jakraes> Got a little question, how do I set the output dir on the nim compiler? |
22:47:43 | FromDiscord | <Elegantbeef> `--outDir:` |
22:47:44 | * | def- quit (Quit: -) |
22:47:59 | FromDiscord | <jakraes> Thank you 🫡 |
22:48:18 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html is even nicer than me |
22:48:33 | FromDiscord | <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:46 | FromDiscord | <Chronos [She/Her]> It flies over our head no matter how it's explained |
22:51:03 | FromDiscord | <␀ Array> whats new in nim 2? |
22:51:07 | FromDiscord | <Andreas> In reply to @Elegantbeef "It still works, no": by ARAQ, definitely not supported, but might work.. |
22:51:37 | FromDiscord | <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:43 | FromDiscord | <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:51 | FromDiscord | <Andreas> (edit) "removed" => "removed/edited" |
22:56:26 | FromDiscord | <Elegantbeef> What's the code? |
22:57:14 | FromDiscord | <Elegantbeef> Ah you probably have a `\` in your string aswell |
22:57:59 | FromDiscord | <therealori> sent a code paste, see https://play.nim-lang.org/#ix=4D16 |
22:58:12 | FromDiscord | <therealori> Like I said, a lot of lanaguages and unicode. |
22:58:23 | FromDiscord | <Elegantbeef> Where's the error? |
22:58:29 | FromDiscord | <Elegantbeef> inside `symbols`? |
22:58:42 | FromDiscord | <Elegantbeef> Ps in Nim `const` is how you define a constant |
22:59:24 | FromDiscord | <Elegantbeef> That code works, so uhh where's the bad code? |
23:03:19 | FromDiscord | <therealori> (thanks, still very very new to nim)↵Literally any unicode characters won't show correctly. |
23:04:02 | FromDiscord | <Elegantbeef> `nim -v`? |
23:04:13 | FromDiscord | <therealori> 2.0.0 |
23:04:29 | FromDiscord | <Elegantbeef> Well the above code works, so I can only assume you left code out |
23:05:07 | FromDiscord | <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:16 | FromDiscord | <therealori> hmm |
23:05:21 | FromDiscord | <Elegantbeef> Are you on windows? |
23:05:33 | FromDiscord | <therealori> No |
23:06:51 | FromDiscord | <therealori> I am using gcc as the compiler too if that's of any help |
23:06:57 | FromDiscord | <Elegantbeef> Well it compiles fine here |
23:07:26 | FromDiscord | <Elegantbeef> So provide the actual issue file 😄 |
23:09:25 | * | xet7 quit (Ping timeout: 240 seconds) |
23:10:45 | FromDiscord | <therealori> In reply to @Elegantbeef "So provide the actual": https://media.discordapp.net/attachments/371759389889003532/1138972664711630848/nimgen.nim |
23:11:35 | FromDiscord | <therealori> ~~note, still very new to nim so keep in mind the code will not be good, etc.~~ |
23:12:22 | FromDiscord | <Elegantbeef> I mean you're using regex it'll never be good |
23:12:47 | FromDiscord | <that_dude.> Don't you need to use runes when working with unicode? |
23:12:50 | FromDiscord | <that_dude.> Instead of char |
23:13:02 | FromDiscord | <that_dude.> https://nim-lang.org/docs/unicode.html |
23:13:28 | FromDiscord | <Elegantbeef> Yes you do |
23:13:40 | FromDiscord | <Elegantbeef> Nim strings are unicode unaware so `str[0]` gets the first byte |
23:14:34 | FromDiscord | <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:57 | FromDiscord | <therealori> Like, I could get better documentation from readme's on github |
23:15:09 | FromDiscord | <bostonboston> The docs aren't that bad |
23:15:25 | FromDiscord | <therealori> Sure, but they are pretty bad xD |
23:15:39 | FromDiscord | <therealori> well, for me anyways and I'm brand new to Nim |
23:15:47 | FromDiscord | <therealori> it'll take some time |
23:15:49 | FromDiscord | <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:07 | FromDiscord | <that_dude.> Or probably even better, https://nim-lang.org/docs/unicode.html#toRunes%2Cstring |
23:23:40 | FromDiscord | <therealori> I'll try and take a look again, do you have any links to some examples? |
23:24:24 | FromDiscord | <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:28 | FromDiscord | <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:59 | FromDiscord | <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:11 | FromDiscord | <Elegantbeef> `import std/strutils except splitWhitespace` |
23:55:20 | FromDiscord | <Elegantbeef> or `unicode.splitWhiteSpace(str)` |
23:55:25 | FromDiscord | <therealori> thanks |
23:55:32 | FromDiscord | <that_dude.> I was going to sugest fully qualifying it lol |
23:55:50 | FromDiscord | <System64 ~ Flandre Scarlet> Is it possible to get a slice of a seq, and then append this slice to another seq? |
23:56:00 | FromDiscord | <therealori> (edit) "thanks" => "thanks, i'll give it a try" |
23:56:04 | FromDiscord | <that_dude.> Doesn't `add` work for that? |
23:56:15 | FromDiscord | <Elegantbeef> `mySeq.add myOtherSeq.toOpenArray(0, 3)` |
23:56:50 | FromDiscord | <that_dude.> tbh I would have assumed that you could do something like `mySeq[3..5]` |
23:57:03 | FromDiscord | <Elegantbeef> You can, but that copies |
23:57:06 | * | oprypin_ quit (Quit: No Ping reply in 180 seconds.) |
23:57:08 | FromDiscord | <Elegantbeef> I do no encourage needless copying |
23:57:09 | FromDiscord | <that_dude.> Ah |
23:57:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You can, but that": It's for merging palettes for me |
23:58:25 | * | oprypin joined #nim |