<< 21-05-2023 >>

00:18:20FromDiscord<treeform> In reply to @apropos "i know treeform has": We plan to shut down nimdocs soon and instead just use github actions to generate docs. If you want docs for your project just copy our doc github action generation script from: https://github.com/treeform/nimtemplate
00:18:57FromDiscord<nu11pointer> sent a code paste, see https://play.nim-lang.org/#ix=4wix
00:19:09FromDiscord<nu11pointer> (edit) "https://play.nim-lang.org/#ix=4wix" => "https://play.nim-lang.org/#ix=4wiy"
00:19:19FromDiscord<nu11pointer> (edit) "https://play.nim-lang.org/#ix=4wiy" => "https://play.nim-lang.org/#ix=4wiz"
00:19:33FromDiscord<nu11pointer> (edit) "https://play.nim-lang.org/#ix=4wiz" => "https://play.nim-lang.org/#ix=4wiA"
00:19:34FromDiscord<michaelb.eth> In reply to @nu11pointer "hi there! I am": are you on Windows 10 or 11?
00:19:40FromDiscord<nu11pointer> In reply to @michaelb.eth "are you on Windows": 11
00:20:05FromDiscord<michaelb.eth> have you set the OS locale to UTF-8? I can provide instructions, just a sec
00:20:29FromDiscord<michaelb.eth> Language settings -> Administrative language settings -> Change system locale -> Beta: Use Unicode UTF-8 for worldwide language support
00:21:00FromDiscord<michaelb.eth> that may not solve the problem, but it might, so it's worth trying
00:25:35FromDiscord<nu11pointer> fixed, thanks
00:26:00FromDiscord<nu11pointer> but why would we do this? shouldn't it be possible to achieve this through the language?
00:26:48FromDiscord<michaelb.eth> what do you mean by "through the language"
00:26:52FromDiscord<michaelb.eth> (edit) "language"" => "language"?"
00:27:46FromDiscord<nu11pointer> this is an encoding issue, we should be able to convert this through a module
00:28:34FromDiscord<nu11pointer> the same way I'm able to use `echo "Slíte"` in command line, and get the result I want
00:28:43FromDiscord<nu11pointer> (edit) "the same way I'm able to use `echo "Slíte"` in ... command" added "the powershell"
00:29:12FromDiscord<nu11pointer> (edit) "line," => "line"
00:30:32FromDiscord<Elegantbeef> The issue i think is that windows returns a wide cstring
00:32:41FromDiscord<nu11pointer> utf-16?
00:33:00FromDiscord<Elegantbeef> Yea
00:33:39FromDiscord<JJ> In reply to @treeform "We plan to shut": for security reasons or? a unified site like docs.rs seems interesting
00:33:55FromDiscord<JJ> (the template also looks cool and is a great idea, i'm just curious)
00:35:00FromDiscord<nu11pointer> and isn't that fixable through nim, as it is on other scripting languages ?
00:36:20FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4wiB
00:36:59FromDiscord<michaelb.eth> (edit) "http://ix.io/4wiB" => "http://ix.io/4wiC"
00:37:37FromDiscord<treeform> In reply to @apropos "for security reasons or?": We just don't have the energy to run another site. Github actions just easier for us.
00:38:00FromDiscord<treeform> nim's doc generator can execute any code included in the repo
00:38:11FromDiscord<treeform> so its quite dangerous to run random peoples code
00:38:28FromDiscord<treeform> so its a much bigger problem to generate docs with nim
00:40:03FromDiscord<michaelb.eth> In reply to @michaelb.eth "The issue is that": eventually Microsoft has made some accommodations for UTF-8, but it's still not the system wide default, and that's why you ran into the problem, i.e. because Nim strings are multibyte strings and assume UTF-8 encoding
00:47:15FromDiscord<michaelb.eth> also note that Windows MSVCRT support for UTF-8 has some problems (MSVCRT is pretty old and creaky), so for best support for UTF-8 it's better to make use of UCRT
00:47:25FromDiscord<michaelb.eth> (edit) "also note that Windows MSVCRT support for UTF-8 has some problems (MSVCRT is pretty old and creaky), so for best support for UTF-8 it's better to make use of ... UCRT" added "Windows"
00:51:02FromDiscord<michaelb.eth> Windows-native executables built for/with MSYS2's UCRT64, CLANG64, CLANG32, and CLANGARM64 environments link against UCRT, so if full support for UTF-8 is critical, it's probably best to build Nim programs in those environments instead of using MINGW tools that link against MSVCRT
00:57:04FromDiscord<treeform> I have found that Microsoft clearly marks things taking utf16, so you need to convert nim strings to utf16 strings when sending them to those calls.
00:57:17FromDiscord<treeform> So when using Microsoft APIs its best to send it what it wants 🙂
00:57:29FromDiscord<michaelb.eth> yes, definitely
00:58:41FromDiscord<michaelb.eth> but the UTF-16 vs. UTF-8 problems can manifest in things like terminals when the OS-wide locale is not UTF-8
00:59:14FromDiscord<michaelb.eth> (edit) "but the UTF-16 vs. UTF-8 problems can manifest in things like terminals when the OS-wide ... locale" added "default"
00:59:41FromDiscord<treeform> Yeah its so annoying
01:00:30FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4wiH
01:00:31FromDiscord<treeform> What is even more annoying is MacOS, where the low level APIs are mostly UTF8 but if you want to talk to the GUI and GUI related APIs they are Objective C APIs and are generally UTF16... its so annoying.
01:01:44FromDiscord<treeform> JavaScript strangely enough is also UTF16 internally.
01:01:55FromDiscord<treeform> Even though most things on the web are UTF8.
01:02:42FromDiscord<treeform> The UTF8/UTF16 will continue to cause problems for the next 100 years!
01:05:21FromDiscord<Elegantbeef> Nah we just stop using any software that doesnt use utf8!
01:06:22FromDiscord<Yepoleb> i almost never have to think about utf16
01:06:26FromDiscord<michaelb.eth> sent a code paste, see https://paste.rs/73PzT
01:06:32FromDiscord<Arathanis> In reply to @michaelb.eth "sorry, not sure what": this will give you a function that loads the env var the way you want
01:07:03FromDiscord<Arathanis> i think nim's `getEnv` calls C's `getenv` under the hood which just doesn't handle this case
01:07:14FromDiscord<Arathanis> so we are making our own that calls `_wgetenv`
01:07:47FromDiscord<michaelb.eth> that might only work on Windows, because I think (and I may be wrong) that Nim's WideCString assumes UTF-16 encoding, whereas on non-Windows wide strings are generally UTF-32
01:08:27FromDiscord<Arathanis> you could check if it only works on windows or not.
01:08:46FromDiscord<michaelb.eth> fair point
01:08:50FromDiscord<Arathanis> and if it does, then you just need to find a unix alternative
01:08:56FromDiscord<Arathanis> and use some when clauses
01:09:07FromDiscord<Arathanis> but it DOES work on windows, so if nothing else its a start
01:09:08FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1109649040553029732/image.png
01:10:42FromDiscord<Yepoleb> the unix alternative is getEnv 😄
01:11:01FromDiscord<michaelb.eth> https://nim-lang.org/docs/widestrs.html#WideCString
01:11:39FromDiscord<michaelb.eth> the assumption is clearly UTF-16, which is Windows specific
01:12:02FromDiscord<Elegantbeef> Well in this case that's what is needed
01:12:17FromDiscord<Elegantbeef> Unix hardly ever uses anything but utf8
01:12:22FromDiscord<Yepoleb> there's just no need to use wide strings on unix
01:12:55FromDiscord<Yepoleb> you can use regular strings and it works
01:14:18FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4wiJ
01:15:04FromDiscord<Arathanis> make the cwGetEnv def conditional too
01:15:55FromDiscord<michaelb.eth> In reply to @Elegantbeef "Unix hardly ever uses": well it depends, if you're specifically using `wchar_t` on e.g. Linux or macOS, you're using UTF-32 effectively, but as @Yepoleb notes, it's not so common today for non-Windows stuff to use wchar / wide strings
01:17:50FromDiscord<michaelb.eth> in any case, the docs for system/widestrings should probably have a note at the top that as it works currently it's specifically for use on Windows and won't work as expected on other platforms
01:18:21FromDiscord<michaelb.eth> In reply to @Arathanis "<@383034029135364096> <@144300201857777664> is righ": sure, that's fine, but it's more of a bandaid for the larger issue
01:18:24FromDiscord<Yepoleb> even when dealing with utf32 it does not make sense to use wchar\_t. uint32\_t is better defined and will work on all platforms.
01:19:13FromDiscord<michaelb.eth> yes, I have no argument, it's just something to be aware of in relation to what Nim system/widestrings assumes and the reality on non-Windows platforms
01:19:51FromDiscord<michaelb.eth> (edit) "In reply to @Arathanis "<@383034029135364096> <@144300201857777664> is righ": sure, that's fine, but it's more of a bandaid for the larger issue ... " added "when working with UTF-8 on Windows"
01:23:05FromDiscord<treeform> need to handle UTF16 when working Windows/ObjC/JavaScript...
01:23:45FromDiscord<Elegantbeef> All places no one should run code!
01:27:31FromDiscord<Yepoleb> does JS expose the internal string encoding?
01:55:18*derpydoo joined #nim
02:10:10FromDiscord<warmfrost85> How to delete files and send them to the recycle bin? By default nim permanently deletes them.
02:16:30FromDiscord<Yepoleb> which OS? there's no standard way
02:21:50FromDiscord<Yepoleb> on windows you can use the FOFX\_RECYCLEONDELETE flag to move files to the recycle bin instead of permanently deleting them. on linux it makes more sense to use a command like `gio trash` than to implement it with system calls.
02:53:11FromDiscord<warmfrost85> Windows
03:31:13FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wj6
03:31:21FromDiscord<sOkam!> am i doing something wrong, or is this on futhark side?
03:32:53FromDiscord<sOkam!> also, dont you love it when you ask a question and you think you realized the answer right when you write it? man, programming sometimes 🙈 😄↵let me try to remove that opir bin at home....
03:33:24FromDiscord<Elegantbeef> Lol was going to say
03:34:15FromDiscord<sOkam!> > Success: futhark installed successfully.↵i hate my brain, fr fr 😄
03:34:27FromDiscord<sOkam!> (edit) "> Success: futhark installed successfully.↵i hate my brain, fr fr 😄 ... " added "haha"
03:41:07FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wj9
03:41:27FromDiscord<sOkam!> so much nicer than c2nim for wrapping auto
03:58:08*azimut quit (Ping timeout: 240 seconds)
05:08:34FromDiscord<sOkam!> @PMunch I appreciate the effort you put into making futhark. Really awesome software.↵I always kept it around in my mind, but I had not enough knowledge to understand its usefulness until today.↵Man, its such a good idea, and such an ergonomic interface. Ty so much for making this 🤘
05:31:04FromDiscord<JJ> [@Elegantbeef](https://matrix.to/#/%40elegantbeef%3Amatrix.org) the pattern matching rfc is fully done
05:31:11FromDiscord<JJ> nim-adts.md https://media.discordapp.net/attachments/371759389889003532/1109714990857990255/nim-adts.md
05:32:00FromDiscord<JJ> lmk what you think of it 👀
05:32:25FromDiscord<JJ> ping [@haxscramper](https://matrix.to/#/%40haxscramper%3Amatrix.org) as well if interested
05:32:55FromDiscord<JJ> bluh, the bridge broke my pfp
05:35:15FromDiscord<sOkam!> Is there a way to do prefix/suffix renaming with futhark, like you would do with c2nim?
05:35:34FromDiscord<sOkam!> (edit) "renaming" => "removing"
05:43:38FromDiscord<Elegantbeef> `renameCallback`
05:47:28FromDiscord<sOkam!> is that a per-symbol function?
05:47:32FromDiscord<sOkam!> or global?
05:48:18FromDiscord<Elegantbeef> I think you can rename symbols aswel
05:48:23FromDiscord<Elegantbeef> Do not recal check docs
05:49:00FromDiscord<sOkam!> is there more docs than the readme? i just read it full, but haven't gone past that
05:49:42FromDiscord<sOkam!> the readme doesn't mention how. it only says that you can have "deeper control" but not how
08:09:27*lucasta quit (Quit: Leaving)
08:22:07FromDiscord<Graveflo> If I were to define a template that has a const definition in it's body, lets say a string, will using this template in multiple places re-use a single shared table entry or is there a potential for the binary to be littered with string duplicates?
08:27:03FromDiscord<Elegantbeef> I think if the constants are from different places it'll duplicate, I do not know though, testing would be the easiest
08:27:09FromDiscord<jmgomez> In reply to @JJ "nim-adts.md": I like the idea. If accepted do you know how to fully implement it properly?
08:27:31FromDiscord<Elegantbeef> Oh right i was meaning to read that
08:30:46FromDiscord<JJ> In reply to @jmgomez "I like the idea.": nope!
08:32:24FromDiscord<Elegantbeef> Cmon JJ you lack symmetry in your design
08:32:44FromDiscord<JJ> i think i could reasonably implement `union`. the `case` extension would be significantly harder, and i'm also unfamiliar with compiler internals. i do have a considerable amount of spare time this summer, though...
08:32:51FromDiscord<Elegantbeef> On second thought `Square(x = side)` is a bit off never mind 😄
08:33:53FromDiscord<JJ> ah, for renaming, yeah: not thrilled with `Square(x: side)` but i don't care too strongly about it
08:34:20FromDiscord<JJ> (edit) "care" => "feel"
08:35:33FromDiscord<Elegantbeef> `side as x`
08:35:36FromDiscord<Elegantbeef> There we go
08:36:45FromDiscord<JJ> yea i put that in the notes section. i think i like `side: x` a little more, if it's overloaded in constructors it might as well be overloaded here
08:38:24FromDiscord<Elegantbeef> I don't see it mentioned but `of Point, Square(size)` should be explicitly disallowed
08:39:04*Notxor joined #nim
08:39:49FromDiscord<JJ> for parenthesis?
08:39:52*azimut joined #nim
08:39:53FromDiscord<JJ> `of Point(), Square(size)` is fine
08:40:05FromDiscord<Elegantbeef> No just matching on fields of an object and a type inside a single branch
08:40:14FromDiscord<Elegantbeef> No it's not fine
08:40:15FromDiscord<JJ> bindings are only accessible if bound in all
08:40:24FromDiscord<JJ> and in the correct position
08:40:27FromDiscord<Elegantbeef> Ah there we go
08:40:32FromDiscord<Elegantbeef> Why even allow binding them then?
08:40:54FromDiscord<JJ> because they're still accessible in `where` clauses
08:41:09FromDiscord<Elegantbeef> I see
08:41:11FromDiscord<JJ> ex. `of Point(), Square(size) where size == 4:`
08:41:46FromDiscord<JJ> i'm pretty happy with how the `where` clauses turned out especially around lists
08:42:16FromDiscord<voidwalker> https://play.nim-lang.org/#ix=4wjF - can anyone help me figure out how I would make a single generic type to replace the 3 distinct types defined in the first part of the code ? I am just curious how it's done, I can't figure it out. Beef help ? 🙂
08:42:29FromDiscord<JJ> there's only really one thing they can't do when compared to racket's match, and that's this weird arbitrary repetition of nested lists racket provides for matching on
08:44:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wjG
08:44:31FromDiscord<Elegantbeef> or elif i guess but i was feeling dumb
08:44:49FromDiscord<JJ> smh pull that `size` out beef
08:45:04FromDiscord<Elegantbeef> I copy pasted code, give me a break
08:45:33FromDiscord<Elegantbeef> You don't smh me you twice now gave me a `.md` file
08:45:40FromDiscord<voidwalker> You can have when inside object? I didn't know that
08:46:05FromDiscord<Elegantbeef> Imagine making someone pandoc your md to just get a pdf
08:47:24FromDiscord<JJ> oof
08:47:47FromDiscord<JJ> i did notice the line wrapping in the .md was unreadable on discord oop
08:48:04FromDiscord<Elegantbeef> Element doesnt embed file uploads
08:49:19FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wjI
08:49:23FromDiscord<Elegantbeef> `when`
08:50:08*Notxor quit (Ping timeout: 240 seconds)
08:51:45FromDiscord<Elegantbeef> Anywho JJ looks fine, though `where` and pattern matching are likely the more uphill battle, but given I wrote Fungus in a Macro it might be another case of "Just use wonderful macros"
08:52:47FromDiscord<Elegantbeef> Oh actually your list example is wrong
08:53:00FromDiscord<Elegantbeef> of`[[1, 2, 3], 2, 3]` is a incorrectly constructed array
08:53:15FromDiscord<Chronos [She/Her]> # Test↵Markdown should be available on most places on discord
08:53:20FromDiscord<Chronos [She/Her]> Nice, does work for me
08:53:32FromDiscord<Elegantbeef> That has to be `[@[1, 2, 3], @[2], @[3]]`
08:53:45FromDiscord<Elegantbeef> I mean they uploaded a file
08:53:48FromDiscord<Elegantbeef> Atleast here 😄
08:54:56FromDiscord<Elegantbeef> also `typeof(x) is openarray[int]`
08:56:32FromDiscord<JJ> In reply to @Elegantbeef "of`[[1, 2, 3], 2,": ah, good catch: it should be `[[1, 2, 3], [4, 5, 6], [7, 8, 9]]`
08:57:05FromDiscord<JJ> there isn't actually any `@`s in match expressions: since you aren't actually constructing anything
08:57:21FromDiscord<Elegantbeef> uhh
08:57:37FromDiscord<JJ> i think it'd be `[[1, 2, 3], [2], [3]]`
08:57:45FromDiscord<Elegantbeef> "Just rewrite Nim's array constructor to do something different"
08:58:15FromDiscord<Elegantbeef> How does that match then?
08:58:19FromDiscord<JJ> i mean `[[1, 2, 3], ..]` is new too
08:58:29FromDiscord<Elegantbeef> No it's no
08:58:51FromDiscord<Elegantbeef> `var a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]` compiles just fine
08:58:54FromDiscord<JJ> uhh, it'll construct either a sequence or an array depending on the type being matched
08:59:03FromDiscord<jmgomez> In reply to @Elegantbeef "Anywho JJ looks fine,": Yeah, that's why I asked if JJ knows how to implement it. I think it's hard enough to get it into the compiler if you know already how to make it perfect
08:59:07FromDiscord<JJ> In reply to @Elegantbeef "`var a = [[1,": no literally `..`
08:59:24FromDiscord<Elegantbeef> Ah tired me loses again
08:59:42FromDiscord<JJ> lmao
08:59:47FromDiscord<voidwalker> 30 minutes to bedtime Beef
08:59:50FromDiscord<JJ> gah i have work in six hours i should sleep
08:59:56FromDiscord<Elegantbeef> Thanks mom!
08:59:58FromDiscord<JJ> (edit) "six" => "seven"
09:00:09FromDiscord<Elegantbeef> It's sunday and half my entire province is burning down, it's a sick day
09:00:22FromDiscord<JJ> ayyy bc moment
09:00:27FromDiscord<Elegantbeef> Nope
09:00:33FromDiscord<Elegantbeef> AB
09:00:39FromDiscord<JJ> ah
09:00:45FromDiscord<Elegantbeef> You lucky bastards are on the east side of the country
09:00:52FromDiscord<Elegantbeef> West
09:00:59FromDiscord<Elegantbeef> East side of the ocean is what i wanted to say
09:01:07FromDiscord<Elegantbeef> No smoke flying over you for a long period
09:01:13FromDiscord<pinkdev> are you american?
09:01:24FromDiscord<Elegantbeef> Technically yes, but Canadian
09:01:57FromDiscord<pinkdev> am i allowed to call americans fat here? (im european)
09:02:03FromDiscord<JJ> i am not currently in bc but it's apparently noticeably bad, i don't think it's destroyed the air quality yet
09:02:06FromDiscord<JJ> rofl
09:02:22FromDiscord<voidwalker> just get a good airfilter, code indoors
09:02:30FromDiscord<Elegantbeef> As long as you call Europeans fat aswell
09:03:01FromDiscord<JJ> In reply to @Elegantbeef "also `typeof(x) is openarray[int]`": oh, also, is the `openarray` part the part that's not valid
09:03:11FromDiscord<pinkdev> 👍
09:03:13FromDiscord<Elegantbeef> It's the `==` for type comparison
09:03:22FromDiscord<pinkdev> is beef a ai? he has the bot thing
09:03:29FromDiscord<Elegantbeef> Types arent values they use `is`
09:03:30FromDiscord<JJ> i didn't actually test that just wrote it how i thought typeclasses work
09:03:37FromDiscord<JJ> ah oh good catch
09:03:38FromDiscord<voidwalker> yes, it's BeefGPT trained on nim
09:03:40FromDiscord<Elegantbeef> AI dont usually care about air quality
09:04:06FromDiscord<JJ> yeah, somebody threw a markov chain at ~5 years of irc logs and out came this thing
09:04:34FromDiscord<Elegantbeef> Jj here thinks he's witty but I couldnt tell you the difference between a markov chain or a dog chain
09:05:19FromDiscord<pinkdev> In reply to @voidwalker "yes, it's BeefGPT trained": cool!
09:05:41FromDiscord<Elegantbeef> Sadly I'm not an AI
09:05:42FromDiscord<Elegantbeef> It's just what the big AI wants you to think
09:05:59FromDiscord<pinkdev> ah
09:08:09FromDiscord<Elegantbeef> JJ want any pointers where to look for the implementation of union?
09:09:18FromDiscord<Elegantbeef> Would let you get acquainted to the mess that is the compiler 😄
09:10:02FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/5606702e6d9aa583141c975f45534d0f55d9acc9/compiler/semstmts.nim#LL1374C1-L1374C55↵Basically this is the main entry into semming that stuffs
09:10:02FromDiscord<JJ> i was basically going to just rip from fungus, haha
09:10:21FromDiscord<Elegantbeef> That will only slightly work
09:10:21FromDiscord<JJ> mmm thanks
09:10:29FromDiscord<Elegantbeef> Macros and compiler code is similar but much different
09:10:38FromDiscord<Elegantbeef> You'd get to do things less hacky 😄
09:11:20FromDiscord<Elegantbeef> There's also semobjconstr that you'd have to work on, quite a fun bit of things
09:11:34FromDiscord<Elegantbeef> But i'm going now
09:11:34FromDiscord<Elegantbeef> So buh bye
09:11:35FromDiscord<JJ> depending on how the rfc goes, i was also going to look into implementing it off of nimskull first also
09:11:45FromDiscord<JJ> since the project pitches itself as cleaning up the compiler
09:11:47FromDiscord<JJ> sleep tight
09:16:05*Notxor joined #nim
09:17:57NimEventerNew thread by jmgomez: C++ backend just got virtual, see https://forum.nim-lang.org/t/10209
09:24:51FromDiscord<JJ> sent a code paste, see https://play.nim-lang.org/#ix=4wjS
09:24:58FromDiscord<JJ> a full implementation of the simple lambda calculus
09:25:34FromDiscord<JJ> (typechecker and `Type` union omitted)
09:39:48*Jjp137 quit (Ping timeout: 240 seconds)
10:20:23FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wjZ
10:20:28FromDiscord<voidwalker> can someone figure out what is wrong with this code ?
10:20:38FromDiscord<voidwalker> (edit) "can someone figure out what is wrong with this code ? ... " added "I get `invalid type: 'BitVec3[array, system.uint8, 1]' for var`"
10:20:56FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=4wjZ" => "https://play.nim-lang.org/#ix=4wk0"
10:49:17FromDiscord<chmod222> I'm not sure `array` by itself is a type
10:49:42FromDiscord<chmod222> It becomes a type through `array[S, T]` but all by itself it's not a type
10:50:27FromDiscord<chmod222> This may be a step above generics and require templates or macros
10:59:33*derpydoo quit (Read error: Connection reset by peer)
11:00:14FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=4wk4
11:00:25FromDiscord<mratsim> Static is for values not types
11:00:49FromDiscord<voidwalker> indeed, but same error without 'static'
11:02:05FromDiscord<mratsim> Dunno what the error is but `array` is not a concrete type so you can't use BitVec3[array, uint8, 1]
11:02:59FromDiscord<mratsim> You don't have to use the same type for all backend
11:03:14FromDiscord<mratsim> Create separate types and proc generics to all backends
11:03:49FromDiscord<voidwalker> concrete as in non generic
11:03:53FromDiscord<mratsim> Alternatively, use a static enum
11:04:05FromDiscord<voidwalker> (edit) "concrete as in non generic ... " added " ?"
11:04:13FromDiscord<mratsim> And your `when` dispatches on the static enum
11:04:14FromDiscord<voidwalker> yeah I know, I am just "experimenting"
11:04:29FromDiscord<voidwalker> yeah I should do an enum, makes more sense
11:13:17FromDiscord<voidwalker> but when checks for type matching, how do I use it to dispatch on the enum ?
11:13:21FromDiscord<voidwalker> (edit) "when" => "`when`"
11:34:23FromDiscord<Rika> You can use when for static values as well I assume
12:26:53FromDiscord<voidwalker> sent a code paste, see https://paste.rs/AMWXf
12:26:55FromDiscord<voidwalker> ` Error: type expected`
12:27:05FromDiscord<voidwalker> (edit) "` Error: type expected` ... " added "at ` when arType is kArr:`"
12:27:16FromDiscord<Rika> Use == instead of is
12:27:48FromDiscord<voidwalker> ah yeah is is just for types
12:42:30*PMunch joined #nim
12:42:55*ntat joined #nim
12:54:07FromDiscord<voidwalker> well, the code above now works, but I still have an issue with it, I need to specify the S parameter no matter what enum/type I pick, even though it is only needed for kArr/array type
13:03:39FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4wkt
13:05:28FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=4wku
13:06:49FromDiscord<haxscramper> What are the intended diagnostics for the `lists` example btw? If `T` is `string`, can it will just fail on `==` or skip some of the branches for checking (just evaluate them to constant false)
13:09:10*lucasta joined #nim
13:10:05FromDiscord<haxscramper> There is also matching for things that implement `.contains()` and `[]` operators -- tables, json, etc., I've done it using `{}`. I've been told it was useful.
13:10:47FromDiscord<haxscramper> On if let and `Option` -- just treat it as `Some()` and `None()` ADT
13:12:03FromDiscord<haxscramper> Also, how would this integrate in the existing code and things like NimNode? NimNode is probably the most extensively used Variant type that is currently in the code
13:13:11FromDiscord<haxscramper> I've handled this by using `.kind` field or whatever. Also you can do `ProcDef[name, whatever, something else]`, but I guess this can be done easier with `of x where x.kind == nnkProcDef and <match the indices of the captured item>`
13:14:07FromDiscord<haxscramper> Also see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1371r2.pdf
13:14:43FromDiscord<haxscramper> and https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2392r1.pdf which is implemented in https://github.com/seanbaxter/circle/blob/master/pattern/README.md
13:14:47*disso-peach joined #nim
13:18:33NimEventerNew thread by mratsim: Nimble for Nim v2, see https://forum.nim-lang.org/t/10210
14:23:38*lucasta quit (Read error: Connection reset by peer)
14:24:11*lucasta joined #nim
15:07:07NimEventerNew thread by j-james: Algebraic data types and structural pattern matching RFC, see https://forum.nim-lang.org/t/10211
16:02:21FromDiscord<chmod222> Anyone use std/genasts before? I am dumbfounded because it keeps rejecting things with "illformed AST" and I've gone down reducing my testcase until I arrived here\: `Error: illformed AST: 1 + 1`
16:02:22FromDiscord<chmod222> sent a code paste, see https://play.nim-lang.org/#ix=
16:02:31FromDiscord<chmod222> sent a code paste, see https://paste.rs/fabsM
16:03:08FromDiscord<chmod222> It basically will not work for anything I throw at it
16:08:16FromDiscord<jmgomez> You don’t need do
16:11:31FromDiscord<chmod222> I know, it was another desperate thing I tried
16:11:38FromDiscord<chmod222> It'll not work without `do` as well
16:17:16FromDiscord<chmod222> It's something about where it was used, if I slap it into a mostly empty test.nim, it'll work just fine but within the Macro I'm trying to use in it breaks
16:17:18FromDiscord<chmod222> oh well, `quote do` duplication until I figure it out
16:23:44NimEventerNew thread by Cnerd: Replicate python code in nim, see https://forum.nim-lang.org/t/10212
16:25:57*Jjp137 joined #nim
17:13:49FromDiscord<wick3dr0se> Can an int type be converted to char?
17:15:24FromDiscord<Rika> yeah
17:15:29FromDiscord<Rika> `theInt.char`
17:15:34FromDiscord<Rika> or i htink chr also works
17:16:07FromDiscord<wick3dr0se> I can't get either to work. They throw Error: selector must be of an ordinal type, float or string
17:16:34FromDiscord<wick3dr0se> Even tried old cuchar
17:17:32FromDiscord<wick3dr0se> I'm just trying to make a proc accept an int argument that hands it to VTIME/VWIN which unfortunately accept char type integers
17:17:43FromDiscord<wick3dr0se> (edit) "I'm just trying to make a proc accept an int ... argument" added "type"
17:17:50FromDiscord<Rika> "char type integers"?
17:17:58FromDiscord<wick3dr0se> Exactly
17:18:02FromDiscord<Rika> windows CHAR != char
17:18:04FromDiscord<Rika> i assume
17:18:11FromDiscord<Rika> windows is always special with its apis
17:20:44FromDiscord<wick3dr0se> It's used to setting the terminal settings. VTIME tells it how long it should block input and VWIN tells it how many characters to read. Because it uses the c_cc array which store special characters
17:22:03FromDiscord<wick3dr0se> It confuses me that it can accept a timer/characters to be read argument but it has to be a numeric char type lol
17:25:13FromDiscord<Rika> do you know what the exact type is other than "char"
17:25:21FromDiscord<Rika> because i doubt its nim's char
17:28:58FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4wlx
17:29:09*xet7 quit (Remote host closed the connection)
17:29:56FromDiscord<wick3dr0se> Basically trying to make getch accept a specifiable amount of chars and removed the Windows API actually
17:31:28FromDiscord<wick3dr0se> You can see how I put single quotes around the 0 and it works as expected
17:35:35FromDiscord<auxym> > newMode.c_cc[VMIN] = count.char # error here↵I don't think `proc char(i: int) = char` exists in nim. You might want `$count[0]`, but that will only return the first character (ie if count is 24958574922948 you still only get `2`)
17:37:03FromDiscord<wick3dr0se> Then I get type mismatch of int literal
17:38:01FromDiscord<wick3dr0se> Seems like we need that proc lol
17:39:23FromDiscord<auxym> sorry, forgot parens: https://play.nim-lang.org/#ix=4wlA
17:41:46FromDiscord<wick3dr0se> Still throws the same error even if I declare it to a seperate var like you did
17:49:11FromDiscord<wick3dr0se> sent a code paste, see https://play.nim-lang.org/#ix=4wlE
17:52:44FromDiscord<JJ> whoops, middle-click pasted some garbage in the middle of my code example on the nim forum. can't change it until i get home, hope mratsim figures it out...
17:58:20NimEventerNew thread by xigoi: Support for Tree-sitter?, see https://forum.nim-lang.org/t/10214
18:22:02FromDiscord<Rika> In reply to @auxym "> newMode.c_cc[VMIN]": it does
18:22:23FromDiscord<Rika> ? https://media.discordapp.net/attachments/371759389889003532/1109909067696185555/image.png
18:23:28FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4wlO
18:33:15*krux02 joined #nim
19:14:28*disso-peach quit (Quit: Leaving)
19:23:38*lucasta quit (Read error: Connection reset by peer)
19:30:20FromDiscord<⚶ Zeno> How can i parse valid nim code string into nim nodes inside nim ?
19:33:47*ntat quit (Quit: Leaving)
19:42:57*luis_ joined #nim
19:43:03FromDiscord<auxym> In reply to @Rika "it does": oh yeah I'm dumb. I'm my defense I'm in bed with mono :/
19:44:08FromDiscord<Rika> I don’t know if mono heals but get well soon
19:45:01FromDiscord<auxym> yeah it does. just a shit time of being tired/fever/dizzy/headaches for... weeks
19:45:07FromDiscord<auxym> thanks
20:11:04luis_I'd like to test hotcode reloading, where libnimhcr.so is saved?
20:46:17*PMunch quit (Quit: leaving)
21:20:27*luis_ quit (Remote host closed the connection)
21:59:43*luis_ joined #nim
22:00:31luis_hey, how to install nim release candidate using choosenim?
22:01:16FromDiscord<Elegantbeef> I just use devel no clue how to get the rc
22:01:25luis_ok
22:01:36luis_I forgot the correct flag
22:01:40luis_thanks
22:05:59*lucasta joined #nim
22:33:57*Notxor quit (Remote host closed the connection)
22:34:29*luis_ quit (Quit: Leaving)
22:47:14*krux02 quit (Remote host closed the connection)
23:33:37FromDiscord<Ayy Lmao> What considerations need to be made when using `-d:useMalloc`?
23:35:26FromDiscord<Ayy Lmao> Will it work mostly the same way?
23:45:06FromDiscord<wick3dr0se> I wrote a small library I'm using for multiple projects but I don't want to include it in every project and require someone cURL it each time. Then I would feel obligated to write a script for that. Can I upload a tiny library as a nimble package?
23:48:05*azimut_ joined #nim
23:48:56*azimut quit (Ping timeout: 240 seconds)