<< 26-06-2023 >>

01:24:22*lucasta quit (Remote host closed the connection)
01:24:42*lucasta joined #nim
02:06:49*disso-peach joined #nim
02:28:32*rockcavera quit (Remote host closed the connection)
02:30:14*rockcavera joined #nim
03:18:26FromDiscord<elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4z6F
03:18:56FromDiscord<elamandeep> (edit) "https://play.nim-lang.org/#ix=4z6F" => "https://play.nim-lang.org/#ix=4z6G"
03:19:23FromDiscord<elamandeep> (edit) "https://play.nim-lang.org/#ix=4z6G" => "https://play.nim-lang.org/#ix=4z6H"
03:19:25FromDiscord<Elegantbeef> `import strutils` pulls in all exported procedures
03:19:38FromDiscord<Elegantbeef> Nim is not python regardless of their similar syntax
03:25:40FromDiscord<elamandeep> In reply to @Elegantbeef "`import strutils` pulls in": then it guess it's using wildcard import `from module_name import `
03:25:49FromDiscord<elamandeep> (edit) "In reply to @Elegantbeef "`import strutils` pulls in": then it guess it's using wildcard import `from module_name import ` ... " added "under the hood"
03:25:52FromDiscord<Elegantbeef> It's like that yes but Nim is not python
03:26:02FromDiscord<Elegantbeef> Nim imports all exported procedures internally
03:26:13FromDiscord<Elegantbeef> It doesnt use anything under the hood
03:26:17FromDiscord<Elegantbeef> It's Nim not python
03:35:23FromDiscord<elamandeep> ok
03:59:43FromDiscord<exelotl> In reply to @elamandeep "then it guess it's": because Nim is statically typed it can import all symbols into the top-level this while avoiding the pitfalls of `import ` in python.↡There can be 2 functions with the same name imported. One won't overwrite the other, the compiler will disambiguate based on the types of the arguments.
03:59:57FromDiscord<exelotl> Here's an article about it: https://narimiran.github.io/2019/07/01/nim-import.html
04:00:21FromDiscord<exelotl> (edit) removed "this"
04:10:09FromDiscord<JJ> how the hell does git nim work πŸ₯΄
04:10:25FromDiscord<Elegantbeef> You install it then you have it
04:10:53FromDiscord<JJ> like, i'm reading the install instructions, and they seem to skip over how you get the statically linked nim binary??
04:10:58FromDiscord<JJ> am i going insane https://github.com/nim-works/gitnim#installation
04:11:08FromDiscord<Elegantbeef> it's in the bin folder on git
04:11:44FromDiscord<Elegantbeef> https://github.com/nim-works/gitnim/tree/1.9.3/bin
04:11:45FromDiscord<Elegantbeef> Believe it or not you can statically link and ship the stataically linked code πŸ˜›
04:11:55FromDiscord<JJ> ...oh
04:12:02FromDiscord<JJ> oh, i see where i messed up
04:12:25FromDiscord<JJ> `git clone ... somewhere` not `mkdir somewhere && cd somewhere && git clone ...`
04:14:01FromDiscord<JJ> <== nimpleton
04:14:13FromDiscord<Elegantbeef> I thought i could smell something
04:33:56*flouer_ quit (Ping timeout: 240 seconds)
04:50:34FromDiscord<JJ> bluh, got nimph set up too. that was a lot of compatibility issues hoo boy
04:51:48FromDiscord<JJ> somehow messing around with `git nim devel` reverted the `dist` back a commit? i don't know how that even happened
04:52:41FromDiscord<JJ> all tags but `devel` appear to be missing with `git nim` too. going to debug in the morning...
04:59:08termerHow would I go about copying a string to a cstring?
04:59:26termerI tried copyMem but I don't think I'm understanding it right
04:59:45termerI'm interfacing with C code and I need to pass a cstring into it but I think it's getting collected when it's managed memory
05:02:34FromDiscord<JJ> also, are best-practices surrounding errors/exceptions/etc documented somewhere?
05:02:49termerTry the Status style guide
05:02:59termerthey have the best resources for standards basically
05:05:32FromDiscord<JJ> ooh thanks
05:05:58FromDiscord<JJ> well, they say "just use Result πŸ˜›"
05:06:04FromDiscord<JJ> which i would normally but this is a bit of a special case
05:06:51termerlol well that's not much help
05:07:05termeras exceptions, disruptek has a best practices thing that covers it
05:07:32termerhttps://github.com/disruptek/disruptek/blob/master/style.md
05:09:03FromDiscord<JJ> ahaha, well, he also says "just use Result"
05:09:31termerThat's not what he says
05:09:33FromDiscord<JJ> i suppose what i have is fine though. just a bunch of types inheriting from CatchableError
05:09:35termerhe says not to use them for control flow
05:10:50termerMost people who bother to write a style guide for Nim aren't typical Nim programmers and tend to be on the side of explicitness
05:11:02termerso it isn't surprising most advocate for Result
05:11:26FromDiscord<JJ> yeah, i also advocate for result, i'm just writing some somewhat golfed code
05:15:30FromDiscord<_gumbercules> Imo exceptions are reserved for exceptional cases which is when you cannot reasonably predict and handle the outcome of some procedure invocation - like a db or http request
05:16:12FromDiscord<_gumbercules> And they should definitely not be used for control flow
05:18:55FromDiscord<_gumbercules> some people treat errors as I descrdibed and exceptions as i'm describing errors
05:19:27FromDiscord<_gumbercules> but the important distinction is - one category of issue you can recover from and the other you cannot, and this is really the drawing line
05:20:56FromDiscord<_gumbercules> https://en.wikipedia.org/wiki/Exception_handling#Criticism
05:27:02FromDiscord<elamandeep> is there any package like bubbletea in nim? https://github.com/charmbracelet/bubbletea
05:27:25FromDiscord<odexine> Nothing based on the elm architecture
05:28:53*rockcavera quit (Remote host closed the connection)
05:29:03FromDiscord<elamandeep> In reply to @odexine "Nothing based on the": can i use elm in nim?
05:29:22FromDiscord<odexine> What do you mean?
05:30:58FromDiscord<18e6f629727bb519d37210eaa4da0e19> How do I access the registry using nim
05:34:27termerthere might be a proc for that in the winim library
05:34:32termerhttps://github.com/khchen/winim
05:40:53FromDiscord<elamandeep> In reply to @odexine "What do you mean?": sorry, I mean how can i create a beautiful command line tool using nim?
05:41:29FromDiscord<odexine> There is this
05:41:31FromDiscord<odexine> https://github.com/johnnovak/illwill
05:42:35FromDiscord<18e6f629727bb519d37210eaa4da0e19> Also, how can I ask for admin using nimlang?
05:42:43FromDiscord<18e6f629727bb519d37210eaa4da0e19> like elevate my program's privilages
05:43:58FromDiscord<odexine> It is probably also possible using the library termer linked
05:44:04FromDiscord<odexine> @ divine
05:46:36FromDiscord<18e6f629727bb519d37210eaa4da0e19> In reply to @odexine "It is probably also": idk where the docs for that are
05:48:48FromDiscord<odexine> https://github.com/khchen/winim#docs
05:48:56FromDiscord<odexine> + windows API documentation
05:49:38FromDiscord<heysokam> is there a way to define a `string` of a specific size in its type?
05:50:01FromDiscord<odexine> No, strings are similar to sequences
05:50:08FromDiscord<odexine> They are always variable size
05:50:14FromDiscord<heysokam> i know strings are growable, and there is `array[0..num, char]` but wonder if string can do that for known sizes
05:50:30FromDiscord<odexine> You can allocate a string to be a certain size
05:50:40FromDiscord<odexine> But it will still be modifiable to be a different size
05:50:46FromDiscord<heysokam> yeah idm
05:50:59FromDiscord<heysokam> is there an easy way to get an array of chars into a string?
05:51:09FromDiscord<heysokam> join("") maybe? πŸ€”
05:51:13FromDiscord<odexine> Copy mem
05:51:20FromDiscord<heysokam> other than copymem i mean
05:51:32FromDiscord<odexine> You can use join but it will likely be slower than copy
05:51:36FromDiscord<heysokam> i dont consider copymem easy to use πŸ™ˆ
05:51:57FromDiscord<odexine> You know you can abstract this into a function
05:52:03FromDiscord<odexine> So you only need to write copy once
05:52:08FromDiscord<odexine> And then just use that function
05:52:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4z78
05:52:17FromDiscord<heysokam> In reply to @odexine "You can use join": how many nanoseconds can i save when moving 3characters, compared to just joining them? πŸ™ˆβ†΅just kidding, but you see the point
05:52:31FromDiscord<heysokam> its literally 3chars
05:52:37FromDiscord<odexine> sent a code paste, see https://paste.rs/jZtYA
05:52:49FromDiscord<Elegantbeef> Assuming `myData` and `size` are the same length
05:53:07FromDiscord<heysokam> the array is a 0..num
05:53:29FromDiscord<18e6f629727bb519d37210eaa4da0e19> In reply to @odexine "https://github.com/khchen/winim#docs": nothing about admin anywhere in here
05:53:31FromDiscord<odexine> What beef wrote is good
05:53:33FromDiscord<heysokam> so should probably be myStr[0..num] too i imagine
05:53:42FromDiscord<Elegantbeef> `^1` is the same
05:53:46FromDiscord<Elegantbeef> Less inane
05:54:01FromDiscord<heysokam> true
05:54:02FromDiscord<odexine> In reply to @18e6f629727bb519d37210eaa4da0e19 "nothing about admin anywhere": https://learn.microsoft.com/en-us/windows/win32/secbp/running-with-administrator-privileges
05:54:20FromDiscord<18e6f629727bb519d37210eaa4da0e19> that has no code of any sort inside of it
05:54:35FromDiscord<odexine> I will not help you further if you are not willing to read
05:54:42FromDiscord<18e6f629727bb519d37210eaa4da0e19> I just saw
05:55:09FromDiscord<heysokam> wait, can that be done when they are cchar, and converting to string? πŸ€”
05:55:22FromDiscord<odexine> probably not for that type no
05:55:26FromDiscord<heysokam> achFormatHint :array[0..3, cchar]
05:55:29FromDiscord<odexine> Maybe need to convert first
05:55:31FromDiscord<heysokam> (edit) "achFormatHint" => "`achFormatHint" | "cchar]" => "cchar]`"
05:55:51FromDiscord<18e6f629727bb519d37210eaa4da0e19> sent a long message, see http://ix.io/4z7a
05:55:56FromDiscord<18e6f629727bb519d37210eaa4da0e19> I need to use this, but how the fuck do I use it with nim?
05:55:58FromDiscord<18e6f629727bb519d37210eaa4da0e19> its in C++
05:56:06FromDiscord<18e6f629727bb519d37210eaa4da0e19> from https://learn.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-creduipromptforcredentialsa
05:56:58FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z7b
05:57:17FromDiscord<heysokam> is there any point in newstring with the loop?
05:57:43FromDiscord<odexine> In reply to @18e6f629727bb519d37210eaa4da0e19 "I need to use": Okay now I literally can’t really help you, you’re gonna need to find a C++ doc on how to use it and then use it in Nim (the API should be the same or very very similar)
05:58:29FromDiscord<18e6f629727bb519d37210eaa4da0e19> ok
05:58:32FromDiscord<heysokam> In reply to @18e6f629727bb519d37210eaa4da0e19 "CREDUIAPI DWORD CredUIPromptForCredentialsA( ": that function should be mapped in the library somewhere. need to find it
05:58:37FromDiscord<heysokam> (edit) "In reply to @18e6f629727bb519d37210eaa4da0e19 "CREDUIAPI DWORD CredUIPromptForCredentialsA( ": that function should be mapped in the library somewhere. need to find it ... " added "there, and use their inputs"
05:58:47FromDiscord<heysokam> assuming it is wrapped, of course
05:59:44FromDiscord<heysokam> functions are mapped with `importc: "theFunctionOriginalName"`, so the original name must be there somewhere
06:00:11FromDiscord<heysokam> (edit) "In reply to @18e6f629727bb519d37210eaa4da0e19 "CREDUIAPI DWORD CredUIPromptForCredentialsA( ": that function should be mapped in the ... library" added "nim"
06:02:11FromDiscord<k0ts> https://github.com/khchen/winim/blob/c3f1428153250b4591df71addd57a7921eb0077c/winim/inc/wincred.nim#L209
06:02:45FromDiscord<18e6f629727bb519d37210eaa4da0e19> bro how am I supposed to read that
06:02:47FromDiscord<18e6f629727bb519d37210eaa4da0e19> its just a block of ext
06:02:50FromDiscord<18e6f629727bb519d37210eaa4da0e19> text
06:03:23FromDiscord<Zoom> If you care only about speed and ASCII, store them with a \\0 and cast to cstring.↡(@heysokam)
06:05:09FromDiscord<heysokam> In reply to @Zoom "If you care only": i only care about ease of use, tbh. they are 3 chars πŸ€·β€β™‚οΈ
06:05:56FromDiscord<18e6f629727bb519d37210eaa4da0e19> sent a code paste, see https://play.nim-lang.org/#ix=4z7d
06:05:58FromDiscord<18e6f629727bb519d37210eaa4da0e19> C:\Users\Jennifer\Desktop\testing.nim(6, 13) Error: type mismatch: got 'typeof(nil)' for 'nil' but expected 'HWND = int'
06:06:03FromDiscord<18e6f629727bb519d37210eaa4da0e19> ion even know
06:06:09FromDiscord<18e6f629727bb519d37210eaa4da0e19> how do I not have a HWID
06:08:36FromDiscord<18e6f629727bb519d37210eaa4da0e19> I figured out how to elevate proccesses
06:14:45FromDiscord<18e6f629727bb519d37210eaa4da0e19> hre's the code that worked for me
06:14:45FromDiscord<18e6f629727bb519d37210eaa4da0e19> sent a code paste, see https://play.nim-lang.org/#ix=4z7e
06:15:01FromDiscord<18e6f629727bb519d37210eaa4da0e19> (edit) "hre's" => "here's"
06:19:19FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z7f
06:19:49FromDiscord<heysokam> would nim behave well if I mapped that to a cstring, instead of a sized array of cchar?
06:22:27FromDiscord<odexine> cstring is basically ptr char
06:22:34FromDiscord<odexine> Up to you
06:22:44FromDiscord<odexine> It would interop better yes
06:22:46FromDiscord<heysokam> but can a ptr char map to a char [size] ?
06:23:04FromDiscord<odexine> You will lose the size information
06:23:08FromDiscord<heysokam> i know it works for char, but wonder if it also does for sized arrays
06:23:34FromDiscord<heysokam> In reply to @odexine "You will lose the": is the size not implied by the cstring `\0`?
06:23:43FromDiscord<odexine> It would be yes
06:23:51FromDiscord<odexine> I mean that you will lose the array size info
06:23:51FromDiscord<heysokam> kk ty
06:24:07FromDiscord<odexine> You can get buffer overflows
06:24:08FromDiscord<heysokam> its just meant to store a string in the end
06:24:30FromDiscord<heysokam> In reply to @odexine "You can get buffer": how so? wdym?
06:27:11FromDiscord<odexine> Missing the null byte you will overflow
06:27:52FromDiscord<heysokam> you mean if the original array is not null terminated?
06:29:34FromDiscord<odexine> Yes
06:32:49FromDiscord<heysokam> ah i see. shouldn't be an issue here, they just use the array as a string
06:35:46*ntat joined #nim
06:48:03NimEventerNew thread by Araq: Wishlist: Ideal UI library for Nim, see https://forum.nim-lang.org/t/10301
06:50:28*PMunch joined #nim
07:18:56*azimut quit (Ping timeout: 240 seconds)
07:28:59FromDiscord<elamandeep> hey is there any list of beginner to advance level project for new developer
07:29:02FromDiscord<elamandeep> (edit) "developer" => "developer?"
07:29:51FromDiscord<elamandeep> (edit) "project" => "projects" | "developer?" => "developers?"
07:32:22FromDiscord<mratsim> In reply to @elamandeep "hey is there any": do something that scratch your own itch or you'll give up midway
07:32:42FromDiscord<mratsim> you can start with playing with some AdventOfCode to get familiar with syntax
07:32:53FromDiscord<elamandeep> In reply to @mratsim "you can start with": ok
07:39:10FromDiscord<heysokam> In reply to @elamandeep "hey is there any": not that I know of. but you can just find any list online and implement the ideas in nim. ideas are language-agnostic anyway
07:40:03FromDiscord<voidwalker> I liked these: https://exercism.org/tracks/nim - you can see other's solutions, of all kinds. from code golf to squeezing the last bit of performance.
07:40:22FromDiscord<voidwalker> and learn new syntax patterns you might not have been aware of
07:43:13FromDiscord<elamandeep> In reply to @voidwalker "I liked these: https://exercism.org/tracks/nim": Thanks
07:53:58*PMunch quit (Quit: leaving)
08:01:55FromDiscord<Zoom> Implement something for https://github.com/TheAlgorithms/Nim If nothing else, you'll probably get a nice roast of your code.↡(@elamandeep)
08:04:12FromDiscord<heysokam> is there an existing iterator for all existing fields/values of an `enum`? πŸ€”
08:04:21FromDiscord<heysokam> (edit) "existing" => "valid"
08:04:58FromDiscord<heysokam> or is an enum iterable by itself?
08:05:39FromDiscord<heysokam> !eval type Test = enum one, two, three; for t in Test: echo $t
08:05:41NimBotCompile failed: /usercode/in.nim(1, 33) Error: identifier expected, but got ';'
08:06:43FromDiscord<heysokam> oh it is iterable. nvm πŸ™‚
08:06:54FromDiscord<heysokam> (edit) "oh it is iterable. ... nvm" added "sry for the noise,"
08:07:16FromDiscord<Zoom> there was the fields iterator somewhere
08:20:04FromDiscord<sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4z7A
08:20:13FromDiscord<IBot> sent a code paste, see https://play.nim-lang.org/#ix=1LUF
09:43:36*lucasta quit (Remote host closed the connection)
09:50:59*derpydoo quit (Ping timeout: 264 seconds)
10:08:24FromDiscord<heysokam> silly Q:↡if i have a function that takes 3 inputs, like `proc thing(one, two, three :int)`↡can i call for it with `let tupl = (1,2,3); thing( tupl )` πŸ€”
10:08:56FromDiscord<heysokam> or i guess, in other words, are tuples expanded when given as function arguments that don't take tuples?
10:09:29FromDiscord<Andreas> In reply to @heysokam "or i guess, in": nope, but i think there are macros that can do the expansion..
10:12:49NimEventerNew thread by takekikuchi: Signalfd leaks in addProcess(), see https://forum.nim-lang.org/t/10302
10:31:41FromDiscord<Andreas> In reply to @heysokam "silly Q: if i": maybe this is the one : https://stackoverflow.com/questions/48418386/tuple-to-function-arguments-in-nim
10:43:05FromDiscord<heysokam> yeah found that on googl, but seems hella overcomplicated, or even convoluted, to call for a function from a completely different function, giving the function as input instead of the function being called πŸ€·β€β™‚οΈ
10:43:15FromDiscord<heysokam> (edit) "yeah found that on googl, but seems hella overcomplicated, or even convoluted, to call for a function from a completely different function, giving the function as input instead of the function being called ... πŸ€·β€β™‚οΈ" added "itself"
10:43:26FromDiscord<heysokam> (edit) "yeah found that on googl, but seems hella overcomplicated, or even convoluted, to call for a function from a completely different function, giving the function as input instead of ... the" added "just calling for" | removed "being called"
10:43:42FromDiscord<heysokam> (edit) "input" => "as an argument..."
10:43:49FromDiscord<heysokam> (edit) removed "as"
10:47:22FromDiscord<nnsee> well what are you trying to solve
11:05:12*eery joined #nim
11:07:25FromDiscord<shockfox> Okay, possibly dumb question -- why does e.g. `seq[string]` generate floating-point instructions for adding entries?
11:14:53FromDiscord<odexine> Do you have a Godbolt link to show it?
11:18:07FromDiscord<shockfox> No, though I can try to replicate it there - I'm messing around with targeting bare metal, and I noticed that (at least) `seq` seems to want to generate FP code and link to C stdlib functions like `fabs`, and that it hangs whenever that code is reached, unless I compile with `-mgeneral-regs-only`, in which case everything works
11:19:01FromDiscord<shockfox> I assume I have to do something to enable the FPU on ARM, but mainly I'm curious why it might be using the FPU in the first place
11:42:14FromDiscord<shockfox> Well, it fixes it on 1.6, on the latest compiler it try to links `fabs`, apparently calling toFloat from an inlined `nimMulInt` call (on 1.6, no calls to `nimMulInt` are inlined)
11:50:56FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z88
11:59:52FromDiscord<jeancareau> I have this very simple program fetching amazon pages and saving the files using authenticated proxies. But I get the error: "Connection was closed before the full request has been made". How can I avoid that. Is this the same error as explained here: https://github.com/nim-lang/Nim/issues/16572 ? Here is the code
12:00:44FromDiscord<jeancareau> sent a long message, see http://ix.io/4z8a
12:00:56FromDiscord<jeancareau> sent a long message, see http://ix.io/4z8c
12:02:23FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z8d
12:02:35FromDiscord<jeancareau> Ah, thank you
12:02:44FromDiscord<jeancareau> I was doing it wrong
12:03:45FromDiscord<jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4z8e
12:04:22FromDiscord<jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4z8f
12:09:04FromDiscord<jeancareau> I am using nim 1.6.12
12:12:39FromDiscord<odexine> In reply to @shockfox "Well, it fixes it": Strange I’d say
12:43:21FromDiscord<Chronos [She/Her]> I really want to do something with WASM but not sure what tbh
12:43:32FromDiscord<Chronos [She/Her]> Nothing to actually do with the web lmao, but
12:49:48FromDiscord<michaelb.eth> but why?
12:54:15FromDiscord<shockfox> In reply to @odexine "Strange I’d say": Looks like it's a, er, bug (?) in the overflow checks, disabling them removes the toFloat calls
12:56:19FromDiscord<shockfox> given the overflow check code is identical between the two trees, I guess it's something deeper in codegen
13:00:50*flouer_ joined #nim
13:10:15FromDiscord<miragearchitect> sent a long message, see http://ix.io/4z8x
13:31:59FromDiscord<jmgomez> In reply to @miragearchitect "I want to embedded": you probably be good with this: https://github.com/beef331/nimscripter
13:52:52*ntat quit (Ping timeout: 240 seconds)
13:54:11*rockcavera joined #nim
14:07:15*euantorano_ quit (Server closed connection)
14:07:27*euantorano_ joined #nim
14:12:20*flouer_ quit (Ping timeout: 240 seconds)
14:20:23*flouer_ joined #nim
14:28:09*lucasta joined #nim
14:28:38*lucasta quit (Remote host closed the connection)
14:29:25*lucasta joined #nim
14:42:01*lucasta quit (Quit: Leaving)
14:57:43*mad_toothbrush joined #nim
15:00:15*eery quit (Remote host closed the connection)
15:04:16FromDiscord<Chronos [She/Her]> In reply to @michaelb.eth "but why?": Because it's fun and I'm obsessed with it
15:05:27FromDiscord<Andreas> In reply to @yu.vitaqua.fer.chronos "Because it's fun and": pls make a WASM/WASI-plugin the LapCE-Editor πŸ™‚
15:08:04FromDiscord<Chronos [She/Her]> LapCE-Editor?
15:08:17FromDiscord<Chronos [She/Her]> Also I don't use that myself so probably wouldn't use it aha
15:09:12FromDiscord<Andreas> In reply to @yu.vitaqua.fer.chronos "Also I don't use": yes, cos' its not usable with Nim, as long as theres no Plugin thats supports the language..
15:10:23FromDiscord<Chronos [She/Her]> Aah https://github.com/lapce/lapce
15:10:36FromDiscord<Andreas> In reply to @yu.vitaqua.fer.chronos "Aah https://github.com/lapce/lapce": https://lapce.dev/
15:11:12FromDiscord<Chronos [She/Her]> Interesting...but I'm not touching Rust xD
15:11:26FromDiscord<Chronos [She/Her]> Though wasmtime is written in Rust, could likely use that
15:12:07FromDiscord<Andreas> In reply to @yu.vitaqua.fer.chronos "Interesting...but I'm not touching": they have a python-integration - who wonders what - and it seems feasable..
15:13:10FromDiscord<Chronos [She/Her]> Meh, I don't use the editor so I still see no use for myself aha
15:13:41FromDiscord<Chronos [She/Her]> I wonder... The Nim compiler can be compiled to WASM iirc, wonder if compiling Nim and Clang to WASM could do some cursed stuff with portability
15:14:28FromDiscord<Andreas> In reply to @yu.vitaqua.fer.chronos "I wonder... The Nim": thats a challange to figure out.
15:23:43*disso-peach quit (Quit: Leaving)
15:25:43FromDiscord<Chronos [She/Her]> Clang can be compiled to WASM for sure, it's been done before, whether Nim will play nice with it is another challenge
15:26:05FromDiscord<Chronos [She/Her]> As well as figuring out how Nim would execute the compiler because WASM doesn't have a standard way to execute external programs
15:26:28FromDiscord<Chronos [She/Her]> Compiling Clang to WASM isn't really feasible on my phone tho xD
15:27:18FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9s
15:37:37FromDiscord<Chronos [She/Her]> Perhaps it's a define flag or something?
15:37:53FromDiscord<heysokam> it was the stupidest thing possible
15:37:54FromDiscord<heysokam> lol
15:39:38FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9u
15:40:46FromDiscord<heysokam> oh no, nvm, im back to square 1
15:41:04FromDiscord<heysokam> must be a cyclic dependency
15:51:26FromDiscord<Chronos [She/Her]> It's #[]# not ##[]##
15:51:43FromDiscord<Chronos [She/Her]> Wait lemme test actually
15:52:33FromDiscord<Chronos [She/Her]> Nvm no difference
15:52:37FromDiscord<Chronos [She/Her]> Weird
15:53:30FromDiscord<odexine> ##[]## is a doc comment
15:53:36FromDiscord<odexine> #[]# is a regular comment
15:55:58FromDiscord<Chronos [She/Her]> Didn't realise ##[]## actually worked lol
15:59:12FromDiscord<heysokam> In reply to @yu.vitaqua.fer.chronos "Didn't realise ##[]## actually": its really good for having code references temporarily, at least in my editor, since the contents don't lose the syntax hightlighting
16:00:44FromDiscord<Chronos [She/Her]> Fair
16:01:31*azimut joined #nim
16:07:09FromDiscord<heysokam> any tips of tracking a potential cyclic dependency?
16:08:17*rockcavera quit (Read error: Connection reset by peer)
16:10:36*rockcavera joined #nim
16:10:37*rockcavera quit (Changing host)
16:10:37*rockcavera joined #nim
16:12:37*ntat joined #nim
16:16:17*rockcavera quit (Read error: Connection reset by peer)
16:16:51FromDiscord<deech4592> The compiler should tell you in the error messgae?
16:18:38*rockcavera joined #nim
16:18:38*rockcavera quit (Changing host)
16:18:38*rockcavera joined #nim
16:20:31FromDiscord<heysokam> In reply to @deech4592 "The compiler should tell": its coming from a C redefine
16:21:15FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9A
17:44:39FromDiscord<heysokam> How does one track C codegen issues?
17:45:04FromDiscord<heysokam> I have no clue how to approach this C redefine bug πŸ˜”
17:45:18FromDiscord<heysokam> (edit) "πŸ˜”" => "πŸ˜”β†΅How does one track C codegen issues?"
18:37:21FromDiscord<gentk> ufff the colon [:T] needed for using generics with the method call syntax just lost me a half an hour. That's one place where a better error message could make all the difference.
18:38:02FromDiscord<gentk> have to say error messages seem to have gotten better overall compared to when I tried nim a few years ago, but this brought back some memories.
18:40:21FromDiscord<huantian> yeah that's one of the weird quirks of the language that does need good errors
18:40:52FromDiscord<Chronos [She/Her]> I am gonna try compiling a minimal LLVM build, wish me luck because this is gonna be painful
18:41:07*ntat quit (Quit: Leaving)
18:59:52FromDiscord<Chronos [She/Her]> Pain
19:19:37*nnumeral joined #nim
19:19:42nnumeralyo
19:19:45nnumeralwassup
19:20:43termeryo
19:21:57nnumerallol @ no admin or op's in here.
19:23:59nnumeral[] [] of a channel, without the need of a bot. Channel takeovers are
19:23:59nnumeralΒ [] normal users the ability to maintain control
19:24:00nnumeral[] [] virtually impossible when a channel is registered with.
19:24:02nnumeralHckr
19:24:06nnumeral;
19:24:08nnumeral;)
19:37:48Amun-Rathere are ops in here
19:38:04Amun-Rathey do not have their status active
19:38:37nnumeralhm...Β  It doesn't look like it.
19:38:50nnumeraldom96, PMunch, Yardanico, federico3?
19:39:15Amun-RaI don't know the complete list, but yes
19:39:29nnumeralThat's maybe the list
19:41:50*mad_toothbrush quit (Remote host closed the connection)
20:10:45NimEventerNew thread by przemyslawo: Is it possible to write Linux kernel modules in Nim without having to "hack" the Nim compiler?, see https://forum.nim-lang.org/t/10303
20:13:52*nnumeral quit (Quit: Client closed)
21:02:19FromDiscord<michaelb.eth> if I have a macro `foo(children: untyped)`, where children will be an array/seq literal, is it possible to tell the compiler to not analyze the types in `children` until after `foo` has transformed it?
21:03:23*__________ joined #nim
21:03:40FromDiscord<Elegantbeef> you did that by doing `untyped`
21:03:47FromDiscord<michaelb.eth> not working
21:04:05FromDiscord<Elegantbeef> Elaborate
21:04:11*_________ quit (Ping timeout: 264 seconds)
21:04:11FromDiscord<michaelb.eth> unless all the members of the array/seq literal are the same type
21:05:10FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/CXIxC
21:05:23FromDiscord<Elegantbeef> To quote everyone's favourite meme "why you always lying"
21:06:06FromDiscord<Elegantbeef> Are you attempting to overload a macro with a untyped variation that causes the above to fail on dispatch?
21:06:34FromDiscord<Elegantbeef> You cannot overload a symbol with untyped it's a limitation
21:06:58FromDiscord<Elegantbeef> The compiler attempts to dispatch goes "Ok i need to semantically check this to see which is more correct cause one of these is typed" then fails cause you gave it a malformed sequence
21:07:07FromDiscord<michaelb.eth> alright, mine is a bit more complex; some of the members are calls (any one of them be template, or macro, or proc)
21:07:13FromDiscord<michaelb.eth> I want to transform the calls
21:07:33FromDiscord<michaelb.eth> (edit) "alright, mine is a bit more complex; some of the members are calls (any one of them ... beproc" added "can" | "proc)" => "proc invocation)"
21:07:45FromDiscord<Elegantbeef> It doesnt matter
21:07:50FromDiscord<Elegantbeef> untyped is not semantically checked
21:08:09FromDiscord<Elegantbeef> You get the unexpanded calls
21:08:16FromDiscord<Elegantbeef> you probably want `macro foo(children: varargs[typed])`
21:08:33FromDiscord<michaelb.eth> no, I definitely want untyped
21:08:40FromDiscord<Elegantbeef> then you can do `foo 10, "hello", "meh", 300, 500, 600`
21:08:41FromDiscord<michaelb.eth> I'm building (trying to build) a dsl
21:08:51FromDiscord<michaelb.eth> that's tree-shaped
21:09:05FromDiscord<Elegantbeef> Meh do not need a dsl for that just use tuples πŸ˜„
21:09:25FromDiscord<Elegantbeef> I sorta kid, but am also sorta serious
21:09:45FromDiscord<Elegantbeef> It's not the most ergonomic but it's ok https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L306-L430
21:10:38*__________ is now known as _________
21:10:59FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4zaE
21:11:53FromDiscord<michaelb.eth> in the fixup pass in `macro statechart` I need to massage the calls of `state` to insert `States, Events, Data, Event` as the first 4 arguments
21:13:18FromDiscord<Elegantbeef> whoops
21:13:21FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/trJIW
21:13:32FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/2ZO3v
21:14:12FromDiscord<Elegantbeef> Not that it really matters it should be fine assuming it's untyped
21:14:27FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4zaJ
21:14:56FromDiscord<Elegantbeef> do you have a overloaded `statechart`?
21:15:58FromDiscord<michaelb.eth> well the thing was wild with overloads, but then I started chopping them away to try to boil down the problem
21:16:19FromDiscord<michaelb.eth> I guess I am still dealing with an overload problem, will just keep reducing it
21:16:26FromDiscord<Elegantbeef> Well if you have an overload of `statechart` it'll causue it
21:16:45FromDiscord<Elegantbeef> It's literally just "is this symbol overloaded, if so you likely cannot use untyped this way"
21:16:47FromDiscord<michaelb.eth> same is true for templates?
21:16:54FromDiscord<Elegantbeef> Of course
21:17:00FromDiscord<michaelb.eth> okay, damn
21:17:16FromDiscord<Elegantbeef> They're both the same mechanism of dispatch
21:17:21FromDiscord<Elegantbeef> You may want to make an intermediate macro/template that reasons which to call
21:17:27FromDiscord<michaelb.eth> tried that too
21:17:33FromDiscord<michaelb.eth> and it works!
21:17:43FromDiscord<michaelb.eth> but only so long as I don't try to mix-and-match stuff
21:18:07FromDiscord<Elegantbeef> the laziest method is just using `when compiles` πŸ˜„
21:18:54FromDiscord<michaelb.eth> yeah I'm using that too, so that if I fixup some call that doesn't need fixup, the `when compiles()` fails and in the `else` branch I drop back to the original nimnode
21:19:39FromDiscord<michaelb.eth> but I'm stuck on my macro never getting called in the first place, because the compiler insists on analyzing the children...... and like you said, that's probably resulting from some overload problem
21:19:56FromDiscord<michaelb.eth> "never getting called" -- again, depends what I put in the array/seq literal
21:20:30FromDiscord<Elegantbeef> It's a limitation of how untyped has to work, and is partially a reason araq wants to get rid of that
21:20:44FromDiscord<michaelb.eth> get rid of untyped?
21:21:02FromDiscord<Elegantbeef> He wants `typed` AST only which if something fails to semantically get checked it remains untyped
21:21:14FromDiscord<Elegantbeef> This way you do not have to do so many hacks to get basic things to work
21:21:21FromDiscord<michaelb.eth> I see, sounds nice
21:21:25FromDiscord<michaelb.eth> maybe we'll have it in 2033
21:21:58FromDiscord<Elegantbeef> Lol
21:22:02FromDiscord<Elegantbeef> Probably won't even have IC then
21:22:42FromDiscord<michaelb.eth> sorry, that was very pessimistic... just frustrated that I'm getting so close to the DSL being able to be able to express what I want, yet it blows up with anything interesting
21:23:23FromDiscord<Elegantbeef> To play devils advocate that's on you
21:23:23FromDiscord<Elegantbeef> You overloaded `statechart`
21:23:32FromDiscord<michaelb.eth> sure, I agree
21:24:15FromDiscord<Elegantbeef> Then again I'm fighting rewriting my ecs πŸ˜„
22:10:44*Arthur quit (Quit: The Lounge running.on.hess.the.br)
22:11:56*Arthur joined #nim
22:17:43FromDiscord<voidwalker> uint8 to seq[int] representing its bits, anything like that in std ?
22:19:13FromDiscord<voidwalker> also, possible to iterate over this without repeating twice ? `for i in BitsRange[uint8].low..BitsRange[uint8].high:`
22:19:42FromDiscord<Zoom> Hm, why doesn't `--warning:BareExcept:off` work for me (stable, W)? Does it propagate to used modules?
22:19:52FromDiscord<that_dude.> Do you want something like `seq[byte]`?
22:20:05FromDiscord<that_dude.> Because `byte` is a valid type
22:20:12FromDiscord<that_dude.> (edit) "a valid" => "an existing"
22:20:13FromDiscord<Zoom> `--warning[BareExcept]:off` doesn't work either
22:20:49FromDiscord<voidwalker> byte, uint, int, whatever, i just need an 8bit integers to seq[whateverInteger], representing its bits
22:21:00FromDiscord<voidwalker> (edit) "integers" => "integer"
22:22:53FromDiscord<that_dude.> iirc you can do `for i in uint8.low .. uint8.high`
22:23:11FromDiscord<that_dude.> Sorry I'm not to used to bit stuff
22:23:25FromDiscord<voidwalker> that's 0 to 255, I want 0 to 7
22:24:00FromDiscord<that_dude.> Why not hard code it/create an iterator?
22:24:22FromDiscord<voidwalker> because it is more expressive where those values come from that way. They are compile time evaluated anyway
22:25:29FromDiscord<michaelb.eth> @voidwalker I'm not sure it's got what you want, but maybe take a lookt at stew/bitops:↡https://github.com/status-im/nim-stew/blob/master/stew/bitseqs.nim
22:25:44FromDiscord<voidwalker> has to be from std, I am doing exercism problems : P
22:26:41FromDiscord<michaelb.eth> I see
22:30:09FromDiscord<voidwalker> how do you turn a range type into a seq?
22:32:49FromDiscord<Zoom> It is when you're on stable \:D
22:32:49FromDiscord<Zoom> I thought it still going to be a thing, just not `on` by default?
22:32:53FromDiscord<Elegantbeef> Bug in stable, can only say don't worry cause it's no longer a thing zoom
22:32:54FromDiscord<Elegantbeef> Not in the next stable release
22:32:54FromDiscord<Elegantbeef> Right, devel also has a bug fix for warnings and the like iirc
22:33:07FromDiscord<Elegantbeef> What does that even mean?
22:33:24FromDiscord<voidwalker> `BitsRange[uint8].toSeq` doesnt'work
22:34:13FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/HBmy3
22:35:23FromDiscord<voidwalker> not possible then ?
22:35:42FromDiscord<Elegantbeef> There is no `items` declared for `range` types
22:35:57FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/u57iF
22:36:10FromDiscord<Zoom> Well, I just tried the latest devel and I still get this warning even with the off switch right in the parameters.
22:36:13FromDiscord<that_dude.> Yeah I just looked. Kinda wild that items isn't defined
22:36:15FromDiscord<Elegantbeef> Odd
22:36:29FromDiscord<that_dude.> Wouldn't that just make sense?
22:36:32FromDiscord<Elegantbeef> Not that wild items isnt defined for integers either πŸ˜„
22:36:36FromDiscord<voidwalker> In reply to @Elegantbeef "There is no `items`": There should be, don't you think so ?
22:36:38FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4zb7
22:37:02FromDiscord<Elegantbeef> There could be
22:37:03FromDiscord<Elegantbeef> Luckily it's 2 lines of code
22:37:06FromDiscord<Andreas> (edit) "https://play.nim-lang.org/#ix=4zb7" => "https://play.nim-lang.org/#ix=4zb8"
22:37:28FromDiscord<voidwalker> @Andreas was looking for some std defined proc, I am looking to oneline it
22:37:47FromDiscord<Andreas> In reply to @voidwalker "<@754284517316886598> was looking for": good, keep me posted πŸ™‚
22:37:58FromDiscord<Elegantbeef> andreas you don't know void presetly, it's one line or nothing for them
22:38:00FromDiscord<Elegantbeef> They're an odd duck
22:38:05FromDiscord<Elegantbeef> presently\
22:38:10FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zb9
22:38:22FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zba
22:38:31FromDiscord<voidwalker> I think the for one is faster though
22:38:31FromDiscord<Elegantbeef> Jesus this is horrid
22:38:46FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4zbb
22:38:47FromDiscord<voidwalker> infinity
22:38:48FromDiscord<that_dude.> I mean at that point just make it one line lol
22:39:26FromDiscord<voidwalker> well, it still has to obey basic common sense, and a bit of readibility. return expression is too long to put on the same line with the proc def
22:39:55FromDiscord<Andreas> why not try a RegEx ?
22:40:19FromDiscord<Elegantbeef> Isnt that good enough
22:40:23FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/WQxcF
22:40:24FromDiscord<voidwalker> Beef, so if ranges had items defined, this `for i in BitsRange[uint8].low..BitsRange[uint8].high:` could be just `for i in BitsRange[uint8]` ?
22:41:00FromDiscord<voidwalker> so 0..7 is not the same as range[0..7] ?
22:41:10FromDiscord<Elegantbeef> of course
22:41:10FromDiscord<Elegantbeef> `items` is implicitly called
22:41:20FromDiscord<Elegantbeef> `0..7` is a slice
22:41:36FromDiscord<Elegantbeef> `0..7` in type areas is a range
22:41:50FromDiscord<Elegantbeef> `type A = 0..7` is a range but `var a = 0..7` is a slice
22:42:01FromDiscord<voidwalker> ohhh it's a slice, ok. I still haven't read my slices lesson : P
22:42:23FromDiscord<Elegantbeef> Well `for x in a..b` is actually an iterator
22:42:54FromDiscord<Elegantbeef> Nim has a lot of capabilities for overloading πŸ˜„
22:43:00FromDiscord<that_dude.> Well isn't that because in this context the for loop implicitly calls `items` on the slice to return an iterator object?
22:43:07FromDiscord<Elegantbeef> Nope
22:43:11FromDiscord<Elegantbeef> `..` is an iterator
22:43:12FromDiscord<voidwalker> what is `T(1)` though?
22:43:24FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#...i%2CT%2CT
22:43:28FromDiscord<Elegantbeef> A conversion?
22:43:44FromDiscord<voidwalker> to what ?
22:43:56FromDiscord<Elegantbeef> `T` where `T` is the integer range you want to get the bits of
22:43:58FromDiscord<voidwalker> ohh ok
22:44:27FromDiscord<Elegantbeef> Apparently `for x in 0..<8` is too hard πŸ˜„
22:44:27FromDiscord<Elegantbeef> I don't know you were using a generic type for some reason
22:45:17FromDiscord<voidwalker> well, I randomly found it in bitops, and I thought it looks cool
22:45:31FromDiscord<Elegantbeef> lol
22:45:46FromDiscord<voidwalker> As in, more expressive to the origin of the values
22:49:37FromDiscord<voidwalker> have you done any exercism exercises Beef ?
23:03:15*m5zs7k_ joined #nim
23:03:46FromDiscord<Elegantbeef> A couple
23:04:08*m5zs7k quit (Quit: m5zs7k)
23:08:37FromDiscord<Zoom> It's infuriating.
23:08:41FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=4zbf
23:09:24FromDiscord<Zoom> sent a code paste, see https://play.nim-lang.org/#ix=4zbg
23:12:51*m5zs7k_ is now known as m5zs7k
23:15:43*tiorock joined #nim
23:15:43*tiorock quit (Changing host)
23:15:43*tiorock joined #nim
23:15:43*rockcavera quit (Killed (tungsten.libera.chat (Nickname regained by services)))
23:15:43*tiorock is now known as rockcavera
23:37:35*disso-peach joined #nim
23:57:32NimEventerNew Nimble package! emailparser - Email parser to JsonNode based on Cyrus JMAP parser, see https://github.com/mildred/emailparser.nim