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:26 | FromDiscord | <elamandeep> sent a code paste, see https://play.nim-lang.org/#ix=4z6F |
03:18:56 | FromDiscord | <elamandeep> (edit) "https://play.nim-lang.org/#ix=4z6F" => "https://play.nim-lang.org/#ix=4z6G" |
03:19:23 | FromDiscord | <elamandeep> (edit) "https://play.nim-lang.org/#ix=4z6G" => "https://play.nim-lang.org/#ix=4z6H" |
03:19:25 | FromDiscord | <Elegantbeef> `import strutils` pulls in all exported procedures |
03:19:38 | FromDiscord | <Elegantbeef> Nim is not python regardless of their similar syntax |
03:25:40 | FromDiscord | <elamandeep> In reply to @Elegantbeef "`import strutils` pulls in": then it guess it's using wildcard import `from module_name import ` |
03:25:49 | FromDiscord | <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:52 | FromDiscord | <Elegantbeef> It's like that yes but Nim is not python |
03:26:02 | FromDiscord | <Elegantbeef> Nim imports all exported procedures internally |
03:26:13 | FromDiscord | <Elegantbeef> It doesnt use anything under the hood |
03:26:17 | FromDiscord | <Elegantbeef> It's Nim not python |
03:35:23 | FromDiscord | <elamandeep> ok |
03:59:43 | FromDiscord | <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:57 | FromDiscord | <exelotl> Here's an article about it: https://narimiran.github.io/2019/07/01/nim-import.html |
04:00:21 | FromDiscord | <exelotl> (edit) removed "this" |
04:10:09 | FromDiscord | <JJ> how the hell does git nim work π₯΄ |
04:10:25 | FromDiscord | <Elegantbeef> You install it then you have it |
04:10:53 | FromDiscord | <JJ> like, i'm reading the install instructions, and they seem to skip over how you get the statically linked nim binary?? |
04:10:58 | FromDiscord | <JJ> am i going insane https://github.com/nim-works/gitnim#installation |
04:11:08 | FromDiscord | <Elegantbeef> it's in the bin folder on git |
04:11:44 | FromDiscord | <Elegantbeef> https://github.com/nim-works/gitnim/tree/1.9.3/bin |
04:11:45 | FromDiscord | <Elegantbeef> Believe it or not you can statically link and ship the stataically linked code π |
04:11:55 | FromDiscord | <JJ> ...oh |
04:12:02 | FromDiscord | <JJ> oh, i see where i messed up |
04:12:25 | FromDiscord | <JJ> `git clone ... somewhere` not `mkdir somewhere && cd somewhere && git clone ...` |
04:14:01 | FromDiscord | <JJ> <== nimpleton |
04:14:13 | FromDiscord | <Elegantbeef> I thought i could smell something |
04:33:56 | * | flouer_ quit (Ping timeout: 240 seconds) |
04:50:34 | FromDiscord | <JJ> bluh, got nimph set up too. that was a lot of compatibility issues hoo boy |
04:51:48 | FromDiscord | <JJ> somehow messing around with `git nim devel` reverted the `dist` back a commit? i don't know how that even happened |
04:52:41 | FromDiscord | <JJ> all tags but `devel` appear to be missing with `git nim` too. going to debug in the morning... |
04:59:08 | termer | How would I go about copying a string to a cstring? |
04:59:26 | termer | I tried copyMem but I don't think I'm understanding it right |
04:59:45 | termer | I'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:34 | FromDiscord | <JJ> also, are best-practices surrounding errors/exceptions/etc documented somewhere? |
05:02:49 | termer | Try the Status style guide |
05:02:59 | termer | they have the best resources for standards basically |
05:05:32 | FromDiscord | <JJ> ooh thanks |
05:05:58 | FromDiscord | <JJ> well, they say "just use Result π" |
05:06:04 | FromDiscord | <JJ> which i would normally but this is a bit of a special case |
05:06:51 | termer | lol well that's not much help |
05:07:05 | termer | as exceptions, disruptek has a best practices thing that covers it |
05:07:32 | termer | https://github.com/disruptek/disruptek/blob/master/style.md |
05:09:03 | FromDiscord | <JJ> ahaha, well, he also says "just use Result" |
05:09:31 | termer | That's not what he says |
05:09:33 | FromDiscord | <JJ> i suppose what i have is fine though. just a bunch of types inheriting from CatchableError |
05:09:35 | termer | he says not to use them for control flow |
05:10:50 | termer | Most 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:02 | termer | so it isn't surprising most advocate for Result |
05:11:26 | FromDiscord | <JJ> yeah, i also advocate for result, i'm just writing some somewhat golfed code |
05:15:30 | FromDiscord | <_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:12 | FromDiscord | <_gumbercules> And they should definitely not be used for control flow |
05:18:55 | FromDiscord | <_gumbercules> some people treat errors as I descrdibed and exceptions as i'm describing errors |
05:19:27 | FromDiscord | <_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:56 | FromDiscord | <_gumbercules> https://en.wikipedia.org/wiki/Exception_handling#Criticism |
05:27:02 | FromDiscord | <elamandeep> is there any package like bubbletea in nim? https://github.com/charmbracelet/bubbletea |
05:27:25 | FromDiscord | <odexine> Nothing based on the elm architecture |
05:28:53 | * | rockcavera quit (Remote host closed the connection) |
05:29:03 | FromDiscord | <elamandeep> In reply to @odexine "Nothing based on the": can i use elm in nim? |
05:29:22 | FromDiscord | <odexine> What do you mean? |
05:30:58 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> How do I access the registry using nim |
05:34:27 | termer | there might be a proc for that in the winim library |
05:34:32 | termer | https://github.com/khchen/winim |
05:40:53 | FromDiscord | <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:29 | FromDiscord | <odexine> There is this |
05:41:31 | FromDiscord | <odexine> https://github.com/johnnovak/illwill |
05:42:35 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> Also, how can I ask for admin using nimlang? |
05:42:43 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> like elevate my program's privilages |
05:43:58 | FromDiscord | <odexine> It is probably also possible using the library termer linked |
05:44:04 | FromDiscord | <odexine> @ divine |
05:46:36 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> In reply to @odexine "It is probably also": idk where the docs for that are |
05:48:48 | FromDiscord | <odexine> https://github.com/khchen/winim#docs |
05:48:56 | FromDiscord | <odexine> + windows API documentation |
05:49:38 | FromDiscord | <heysokam> is there a way to define a `string` of a specific size in its type? |
05:50:01 | FromDiscord | <odexine> No, strings are similar to sequences |
05:50:08 | FromDiscord | <odexine> They are always variable size |
05:50:14 | FromDiscord | <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:30 | FromDiscord | <odexine> You can allocate a string to be a certain size |
05:50:40 | FromDiscord | <odexine> But it will still be modifiable to be a different size |
05:50:46 | FromDiscord | <heysokam> yeah idm |
05:50:59 | FromDiscord | <heysokam> is there an easy way to get an array of chars into a string? |
05:51:09 | FromDiscord | <heysokam> join("") maybe? π€ |
05:51:13 | FromDiscord | <odexine> Copy mem |
05:51:20 | FromDiscord | <heysokam> other than copymem i mean |
05:51:32 | FromDiscord | <odexine> You can use join but it will likely be slower than copy |
05:51:36 | FromDiscord | <heysokam> i dont consider copymem easy to use π |
05:51:57 | FromDiscord | <odexine> You know you can abstract this into a function |
05:52:03 | FromDiscord | <odexine> So you only need to write copy once |
05:52:08 | FromDiscord | <odexine> And then just use that function |
05:52:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4z78 |
05:52:17 | FromDiscord | <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:31 | FromDiscord | <heysokam> its literally 3chars |
05:52:37 | FromDiscord | <odexine> sent a code paste, see https://paste.rs/jZtYA |
05:52:49 | FromDiscord | <Elegantbeef> Assuming `myData` and `size` are the same length |
05:53:07 | FromDiscord | <heysokam> the array is a 0..num |
05:53:29 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> In reply to @odexine "https://github.com/khchen/winim#docs": nothing about admin anywhere in here |
05:53:31 | FromDiscord | <odexine> What beef wrote is good |
05:53:33 | FromDiscord | <heysokam> so should probably be myStr[0..num] too i imagine |
05:53:42 | FromDiscord | <Elegantbeef> `^1` is the same |
05:53:46 | FromDiscord | <Elegantbeef> Less inane |
05:54:01 | FromDiscord | <heysokam> true |
05:54:02 | FromDiscord | <odexine> In reply to @18e6f629727bb519d37210eaa4da0e19 "nothing about admin anywhere": https://learn.microsoft.com/en-us/windows/win32/secbp/running-with-administrator-privileges |
05:54:20 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> that has no code of any sort inside of it |
05:54:35 | FromDiscord | <odexine> I will not help you further if you are not willing to read |
05:54:42 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> I just saw |
05:55:09 | FromDiscord | <heysokam> wait, can that be done when they are cchar, and converting to string? π€ |
05:55:22 | FromDiscord | <odexine> probably not for that type no |
05:55:26 | FromDiscord | <heysokam> achFormatHint :array[0..3, cchar] |
05:55:29 | FromDiscord | <odexine> Maybe need to convert first |
05:55:31 | FromDiscord | <heysokam> (edit) "achFormatHint" => "`achFormatHint" | "cchar]" => "cchar]`" |
05:55:51 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> sent a long message, see http://ix.io/4z7a |
05:55:56 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> I need to use this, but how the fuck do I use it with nim? |
05:55:58 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> its in C++ |
05:56:06 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> from https://learn.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-creduipromptforcredentialsa |
05:56:58 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z7b |
05:57:17 | FromDiscord | <heysokam> is there any point in newstring with the loop? |
05:57:43 | FromDiscord | <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:29 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> ok |
05:58:32 | FromDiscord | <heysokam> In reply to @18e6f629727bb519d37210eaa4da0e19 "CREDUIAPI DWORD CredUIPromptForCredentialsA( ": that function should be mapped in the library somewhere. need to find it |
05:58:37 | FromDiscord | <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:47 | FromDiscord | <heysokam> assuming it is wrapped, of course |
05:59:44 | FromDiscord | <heysokam> functions are mapped with `importc: "theFunctionOriginalName"`, so the original name must be there somewhere |
06:00:11 | FromDiscord | <heysokam> (edit) "In reply to @18e6f629727bb519d37210eaa4da0e19 "CREDUIAPI DWORD CredUIPromptForCredentialsA( ": that function should be mapped in the ... library" added "nim" |
06:02:11 | FromDiscord | <k0ts> https://github.com/khchen/winim/blob/c3f1428153250b4591df71addd57a7921eb0077c/winim/inc/wincred.nim#L209 |
06:02:45 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> bro how am I supposed to read that |
06:02:47 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> its just a block of ext |
06:02:50 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> text |
06:03:23 | FromDiscord | <Zoom> If you care only about speed and ASCII, store them with a \\0 and cast to cstring.β΅(@heysokam) |
06:05:09 | FromDiscord | <heysokam> In reply to @Zoom "If you care only": i only care about ease of use, tbh. they are 3 chars π€·ββοΈ |
06:05:56 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> sent a code paste, see https://play.nim-lang.org/#ix=4z7d |
06:05:58 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> C:\Users\Jennifer\Desktop\testing.nim(6, 13) Error: type mismatch: got 'typeof(nil)' for 'nil' but expected 'HWND = int' |
06:06:03 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> ion even know |
06:06:09 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> how do I not have a HWID |
06:08:36 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> I figured out how to elevate proccesses |
06:14:45 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> hre's the code that worked for me |
06:14:45 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> sent a code paste, see https://play.nim-lang.org/#ix=4z7e |
06:15:01 | FromDiscord | <18e6f629727bb519d37210eaa4da0e19> (edit) "hre's" => "here's" |
06:19:19 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z7f |
06:19:49 | FromDiscord | <heysokam> would nim behave well if I mapped that to a cstring, instead of a sized array of cchar? |
06:22:27 | FromDiscord | <odexine> cstring is basically ptr char |
06:22:34 | FromDiscord | <odexine> Up to you |
06:22:44 | FromDiscord | <odexine> It would interop better yes |
06:22:46 | FromDiscord | <heysokam> but can a ptr char map to a char [size] ? |
06:23:04 | FromDiscord | <odexine> You will lose the size information |
06:23:08 | FromDiscord | <heysokam> i know it works for char, but wonder if it also does for sized arrays |
06:23:34 | FromDiscord | <heysokam> In reply to @odexine "You will lose the": is the size not implied by the cstring `\0`? |
06:23:43 | FromDiscord | <odexine> It would be yes |
06:23:51 | FromDiscord | <odexine> I mean that you will lose the array size info |
06:23:51 | FromDiscord | <heysokam> kk ty |
06:24:07 | FromDiscord | <odexine> You can get buffer overflows |
06:24:08 | FromDiscord | <heysokam> its just meant to store a string in the end |
06:24:30 | FromDiscord | <heysokam> In reply to @odexine "You can get buffer": how so? wdym? |
06:27:11 | FromDiscord | <odexine> Missing the null byte you will overflow |
06:27:52 | FromDiscord | <heysokam> you mean if the original array is not null terminated? |
06:29:34 | FromDiscord | <odexine> Yes |
06:32:49 | FromDiscord | <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:03 | NimEventer | New 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:59 | FromDiscord | <elamandeep> hey is there any list of beginner to advance level project for new developer |
07:29:02 | FromDiscord | <elamandeep> (edit) "developer" => "developer?" |
07:29:51 | FromDiscord | <elamandeep> (edit) "project" => "projects" | "developer?" => "developers?" |
07:32:22 | FromDiscord | <mratsim> In reply to @elamandeep "hey is there any": do something that scratch your own itch or you'll give up midway |
07:32:42 | FromDiscord | <mratsim> you can start with playing with some AdventOfCode to get familiar with syntax |
07:32:53 | FromDiscord | <elamandeep> In reply to @mratsim "you can start with": ok |
07:39:10 | FromDiscord | <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:03 | FromDiscord | <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:22 | FromDiscord | <voidwalker> and learn new syntax patterns you might not have been aware of |
07:43:13 | FromDiscord | <elamandeep> In reply to @voidwalker "I liked these: https://exercism.org/tracks/nim": Thanks |
07:53:58 | * | PMunch quit (Quit: leaving) |
08:01:55 | FromDiscord | <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:12 | FromDiscord | <heysokam> is there an existing iterator for all existing fields/values of an `enum`? π€ |
08:04:21 | FromDiscord | <heysokam> (edit) "existing" => "valid" |
08:04:58 | FromDiscord | <heysokam> or is an enum iterable by itself? |
08:05:39 | FromDiscord | <heysokam> !eval type Test = enum one, two, three; for t in Test: echo $t |
08:05:41 | NimBot | Compile failed: /usercode/in.nim(1, 33) Error: identifier expected, but got ';' |
08:06:43 | FromDiscord | <heysokam> oh it is iterable. nvm π |
08:06:54 | FromDiscord | <heysokam> (edit) "oh it is iterable. ... nvm" added "sry for the noise," |
08:07:16 | FromDiscord | <Zoom> there was the fields iterator somewhere |
08:20:04 | FromDiscord | <sigmasd> sent a code paste, see https://play.nim-lang.org/#ix=4z7A |
08:20:13 | FromDiscord | <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:24 | FromDiscord | <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:56 | FromDiscord | <heysokam> or i guess, in other words, are tuples expanded when given as function arguments that don't take tuples? |
10:09:29 | FromDiscord | <Andreas> In reply to @heysokam "or i guess, in": nope, but i think there are macros that can do the expansion.. |
10:12:49 | NimEventer | New thread by takekikuchi: Signalfd leaks in addProcess(), see https://forum.nim-lang.org/t/10302 |
10:31:41 | FromDiscord | <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:05 | FromDiscord | <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:15 | FromDiscord | <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:26 | FromDiscord | <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:42 | FromDiscord | <heysokam> (edit) "input" => "as an argument..." |
10:43:49 | FromDiscord | <heysokam> (edit) removed "as" |
10:47:22 | FromDiscord | <nnsee> well what are you trying to solve |
11:05:12 | * | eery joined #nim |
11:07:25 | FromDiscord | <shockfox> Okay, possibly dumb question -- why does e.g. `seq[string]` generate floating-point instructions for adding entries? |
11:14:53 | FromDiscord | <odexine> Do you have a Godbolt link to show it? |
11:18:07 | FromDiscord | <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:01 | FromDiscord | <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:14 | FromDiscord | <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:56 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z88 |
11:59:52 | FromDiscord | <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:44 | FromDiscord | <jeancareau> sent a long message, see http://ix.io/4z8a |
12:00:56 | FromDiscord | <jeancareau> sent a long message, see http://ix.io/4z8c |
12:02:23 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z8d |
12:02:35 | FromDiscord | <jeancareau> Ah, thank you |
12:02:44 | FromDiscord | <jeancareau> I was doing it wrong |
12:03:45 | FromDiscord | <jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4z8e |
12:04:22 | FromDiscord | <jeancareau> sent a code paste, see https://play.nim-lang.org/#ix=4z8f |
12:09:04 | FromDiscord | <jeancareau> I am using nim 1.6.12 |
12:12:39 | FromDiscord | <odexine> In reply to @shockfox "Well, it fixes it": Strange Iβd say |
12:43:21 | FromDiscord | <Chronos [She/Her]> I really want to do something with WASM but not sure what tbh |
12:43:32 | FromDiscord | <Chronos [She/Her]> Nothing to actually do with the web lmao, but |
12:49:48 | FromDiscord | <michaelb.eth> but why? |
12:54:15 | FromDiscord | <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:19 | FromDiscord | <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:15 | FromDiscord | <miragearchitect> sent a long message, see http://ix.io/4z8x |
13:31:59 | FromDiscord | <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:16 | FromDiscord | <Chronos [She/Her]> In reply to @michaelb.eth "but why?": Because it's fun and I'm obsessed with it |
15:05:27 | FromDiscord | <Andreas> In reply to @yu.vitaqua.fer.chronos "Because it's fun and": pls make a WASM/WASI-plugin the LapCE-Editor π |
15:08:04 | FromDiscord | <Chronos [She/Her]> LapCE-Editor? |
15:08:17 | FromDiscord | <Chronos [She/Her]> Also I don't use that myself so probably wouldn't use it aha |
15:09:12 | FromDiscord | <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:23 | FromDiscord | <Chronos [She/Her]> Aah https://github.com/lapce/lapce |
15:10:36 | FromDiscord | <Andreas> In reply to @yu.vitaqua.fer.chronos "Aah https://github.com/lapce/lapce": https://lapce.dev/ |
15:11:12 | FromDiscord | <Chronos [She/Her]> Interesting...but I'm not touching Rust xD |
15:11:26 | FromDiscord | <Chronos [She/Her]> Though wasmtime is written in Rust, could likely use that |
15:12:07 | FromDiscord | <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:10 | FromDiscord | <Chronos [She/Her]> Meh, I don't use the editor so I still see no use for myself aha |
15:13:41 | FromDiscord | <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:28 | FromDiscord | <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:43 | FromDiscord | <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:05 | FromDiscord | <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:28 | FromDiscord | <Chronos [She/Her]> Compiling Clang to WASM isn't really feasible on my phone tho xD |
15:27:18 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9s |
15:37:37 | FromDiscord | <Chronos [She/Her]> Perhaps it's a define flag or something? |
15:37:53 | FromDiscord | <heysokam> it was the stupidest thing possible |
15:37:54 | FromDiscord | <heysokam> lol |
15:39:38 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9u |
15:40:46 | FromDiscord | <heysokam> oh no, nvm, im back to square 1 |
15:41:04 | FromDiscord | <heysokam> must be a cyclic dependency |
15:51:26 | FromDiscord | <Chronos [She/Her]> It's #[]# not ##[]## |
15:51:43 | FromDiscord | <Chronos [She/Her]> Wait lemme test actually |
15:52:33 | FromDiscord | <Chronos [She/Her]> Nvm no difference |
15:52:37 | FromDiscord | <Chronos [She/Her]> Weird |
15:53:30 | FromDiscord | <odexine> ##[]## is a doc comment |
15:53:36 | FromDiscord | <odexine> #[]# is a regular comment |
15:55:58 | FromDiscord | <Chronos [She/Her]> Didn't realise ##[]## actually worked lol |
15:59:12 | FromDiscord | <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:44 | FromDiscord | <Chronos [She/Her]> Fair |
16:01:31 | * | azimut joined #nim |
16:07:09 | FromDiscord | <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:51 | FromDiscord | <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:31 | FromDiscord | <heysokam> In reply to @deech4592 "The compiler should tell": its coming from a C redefine |
16:21:15 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4z9A |
17:44:39 | FromDiscord | <heysokam> How does one track C codegen issues? |
17:45:04 | FromDiscord | <heysokam> I have no clue how to approach this C redefine bug π |
17:45:18 | FromDiscord | <heysokam> (edit) "π" => "πβ΅How does one track C codegen issues?" |
18:37:21 | FromDiscord | <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:02 | FromDiscord | <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:21 | FromDiscord | <huantian> yeah that's one of the weird quirks of the language that does need good errors |
18:40:52 | FromDiscord | <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:52 | FromDiscord | <Chronos [She/Her]> Pain |
19:19:37 | * | nnumeral joined #nim |
19:19:42 | nnumeral | yo |
19:19:45 | nnumeral | wassup |
19:20:43 | termer | yo |
19:21:57 | nnumeral | lol @ no admin or op's in here. |
19:23:59 | nnumeral | [] [] of a channel, without the need of a bot. Channel takeovers are |
19:23:59 | nnumeral | Β [] normal users the ability to maintain control |
19:24:00 | nnumeral | [] [] virtually impossible when a channel is registered with. |
19:24:02 | nnumeral | Hckr |
19:24:06 | nnumeral | ; |
19:24:08 | nnumeral | ;) |
19:37:48 | Amun-Ra | there are ops in here |
19:38:04 | Amun-Ra | they do not have their status active |
19:38:37 | nnumeral | hm...Β It doesn't look like it. |
19:38:50 | nnumeral | dom96, PMunch, Yardanico, federico3? |
19:39:15 | Amun-Ra | I don't know the complete list, but yes |
19:39:29 | nnumeral | That's maybe the list |
19:41:50 | * | mad_toothbrush quit (Remote host closed the connection) |
20:10:45 | NimEventer | New 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:19 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> you did that by doing `untyped` |
21:03:47 | FromDiscord | <michaelb.eth> not working |
21:04:05 | FromDiscord | <Elegantbeef> Elaborate |
21:04:11 | * | _________ quit (Ping timeout: 264 seconds) |
21:04:11 | FromDiscord | <michaelb.eth> unless all the members of the array/seq literal are the same type |
21:05:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/CXIxC |
21:05:23 | FromDiscord | <Elegantbeef> To quote everyone's favourite meme "why you always lying" |
21:06:06 | FromDiscord | <Elegantbeef> Are you attempting to overload a macro with a untyped variation that causes the above to fail on dispatch? |
21:06:34 | FromDiscord | <Elegantbeef> You cannot overload a symbol with untyped it's a limitation |
21:06:58 | FromDiscord | <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:07 | FromDiscord | <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:13 | FromDiscord | <michaelb.eth> I want to transform the calls |
21:07:33 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> It doesnt matter |
21:07:50 | FromDiscord | <Elegantbeef> untyped is not semantically checked |
21:08:09 | FromDiscord | <Elegantbeef> You get the unexpanded calls |
21:08:16 | FromDiscord | <Elegantbeef> you probably want `macro foo(children: varargs[typed])` |
21:08:33 | FromDiscord | <michaelb.eth> no, I definitely want untyped |
21:08:40 | FromDiscord | <Elegantbeef> then you can do `foo 10, "hello", "meh", 300, 500, 600` |
21:08:41 | FromDiscord | <michaelb.eth> I'm building (trying to build) a dsl |
21:08:51 | FromDiscord | <michaelb.eth> that's tree-shaped |
21:09:05 | FromDiscord | <Elegantbeef> Meh do not need a dsl for that just use tuples π |
21:09:25 | FromDiscord | <Elegantbeef> I sorta kid, but am also sorta serious |
21:09:45 | FromDiscord | <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:59 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4zaE |
21:11:53 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> whoops |
21:13:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/trJIW |
21:13:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/2ZO3v |
21:14:12 | FromDiscord | <Elegantbeef> Not that it really matters it should be fine assuming it's untyped |
21:14:27 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4zaJ |
21:14:56 | FromDiscord | <Elegantbeef> do you have a overloaded `statechart`? |
21:15:58 | FromDiscord | <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:19 | FromDiscord | <michaelb.eth> I guess I am still dealing with an overload problem, will just keep reducing it |
21:16:26 | FromDiscord | <Elegantbeef> Well if you have an overload of `statechart` it'll causue it |
21:16:45 | FromDiscord | <Elegantbeef> It's literally just "is this symbol overloaded, if so you likely cannot use untyped this way" |
21:16:47 | FromDiscord | <michaelb.eth> same is true for templates? |
21:16:54 | FromDiscord | <Elegantbeef> Of course |
21:17:00 | FromDiscord | <michaelb.eth> okay, damn |
21:17:16 | FromDiscord | <Elegantbeef> They're both the same mechanism of dispatch |
21:17:21 | FromDiscord | <Elegantbeef> You may want to make an intermediate macro/template that reasons which to call |
21:17:27 | FromDiscord | <michaelb.eth> tried that too |
21:17:33 | FromDiscord | <michaelb.eth> and it works! |
21:17:43 | FromDiscord | <michaelb.eth> but only so long as I don't try to mix-and-match stuff |
21:18:07 | FromDiscord | <Elegantbeef> the laziest method is just using `when compiles` π |
21:18:54 | FromDiscord | <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:39 | FromDiscord | <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:56 | FromDiscord | <michaelb.eth> "never getting called" -- again, depends what I put in the array/seq literal |
21:20:30 | FromDiscord | <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:44 | FromDiscord | <michaelb.eth> get rid of untyped? |
21:21:02 | FromDiscord | <Elegantbeef> He wants `typed` AST only which if something fails to semantically get checked it remains untyped |
21:21:14 | FromDiscord | <Elegantbeef> This way you do not have to do so many hacks to get basic things to work |
21:21:21 | FromDiscord | <michaelb.eth> I see, sounds nice |
21:21:25 | FromDiscord | <michaelb.eth> maybe we'll have it in 2033 |
21:21:58 | FromDiscord | <Elegantbeef> Lol |
21:22:02 | FromDiscord | <Elegantbeef> Probably won't even have IC then |
21:22:42 | FromDiscord | <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:23 | FromDiscord | <Elegantbeef> To play devils advocate that's on you |
21:23:23 | FromDiscord | <Elegantbeef> You overloaded `statechart` |
21:23:32 | FromDiscord | <michaelb.eth> sure, I agree |
21:24:15 | FromDiscord | <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:43 | FromDiscord | <voidwalker> uint8 to seq[int] representing its bits, anything like that in std ? |
22:19:13 | FromDiscord | <voidwalker> also, possible to iterate over this without repeating twice ? `for i in BitsRange[uint8].low..BitsRange[uint8].high:` |
22:19:42 | FromDiscord | <Zoom> Hm, why doesn't `--warning:BareExcept:off` work for me (stable, W)? Does it propagate to used modules? |
22:19:52 | FromDiscord | <that_dude.> Do you want something like `seq[byte]`? |
22:20:05 | FromDiscord | <that_dude.> Because `byte` is a valid type |
22:20:12 | FromDiscord | <that_dude.> (edit) "a valid" => "an existing" |
22:20:13 | FromDiscord | <Zoom> `--warning[BareExcept]:off` doesn't work either |
22:20:49 | FromDiscord | <voidwalker> byte, uint, int, whatever, i just need an 8bit integers to seq[whateverInteger], representing its bits |
22:21:00 | FromDiscord | <voidwalker> (edit) "integers" => "integer" |
22:22:53 | FromDiscord | <that_dude.> iirc you can do `for i in uint8.low .. uint8.high` |
22:23:11 | FromDiscord | <that_dude.> Sorry I'm not to used to bit stuff |
22:23:25 | FromDiscord | <voidwalker> that's 0 to 255, I want 0 to 7 |
22:24:00 | FromDiscord | <that_dude.> Why not hard code it/create an iterator? |
22:24:22 | FromDiscord | <voidwalker> because it is more expressive where those values come from that way. They are compile time evaluated anyway |
22:25:29 | FromDiscord | <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:44 | FromDiscord | <voidwalker> has to be from std, I am doing exercism problems : P |
22:26:41 | FromDiscord | <michaelb.eth> I see |
22:30:09 | FromDiscord | <voidwalker> how do you turn a range type into a seq? |
22:32:49 | FromDiscord | <Zoom> It is when you're on stable \:D |
22:32:49 | FromDiscord | <Zoom> I thought it still going to be a thing, just not `on` by default? |
22:32:53 | FromDiscord | <Elegantbeef> Bug in stable, can only say don't worry cause it's no longer a thing zoom |
22:32:54 | FromDiscord | <Elegantbeef> Not in the next stable release |
22:32:54 | FromDiscord | <Elegantbeef> Right, devel also has a bug fix for warnings and the like iirc |
22:33:07 | FromDiscord | <Elegantbeef> What does that even mean? |
22:33:24 | FromDiscord | <voidwalker> `BitsRange[uint8].toSeq` doesnt'work |
22:34:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/HBmy3 |
22:35:23 | FromDiscord | <voidwalker> not possible then ? |
22:35:42 | FromDiscord | <Elegantbeef> There is no `items` declared for `range` types |
22:35:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/u57iF |
22:36:10 | FromDiscord | <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:13 | FromDiscord | <that_dude.> Yeah I just looked. Kinda wild that items isn't defined |
22:36:15 | FromDiscord | <Elegantbeef> Odd |
22:36:29 | FromDiscord | <that_dude.> Wouldn't that just make sense? |
22:36:32 | FromDiscord | <Elegantbeef> Not that wild items isnt defined for integers either π |
22:36:36 | FromDiscord | <voidwalker> In reply to @Elegantbeef "There is no `items`": There should be, don't you think so ? |
22:36:38 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4zb7 |
22:37:02 | FromDiscord | <Elegantbeef> There could be |
22:37:03 | FromDiscord | <Elegantbeef> Luckily it's 2 lines of code |
22:37:06 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=4zb7" => "https://play.nim-lang.org/#ix=4zb8" |
22:37:28 | FromDiscord | <voidwalker> @Andreas was looking for some std defined proc, I am looking to oneline it |
22:37:47 | FromDiscord | <Andreas> In reply to @voidwalker "<@754284517316886598> was looking for": good, keep me posted π |
22:37:58 | FromDiscord | <Elegantbeef> andreas you don't know void presetly, it's one line or nothing for them |
22:38:00 | FromDiscord | <Elegantbeef> They're an odd duck |
22:38:05 | FromDiscord | <Elegantbeef> presently\ |
22:38:10 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zb9 |
22:38:22 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4zba |
22:38:31 | FromDiscord | <voidwalker> I think the for one is faster though |
22:38:31 | FromDiscord | <Elegantbeef> Jesus this is horrid |
22:38:46 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4zbb |
22:38:47 | FromDiscord | <voidwalker> infinity |
22:38:48 | FromDiscord | <that_dude.> I mean at that point just make it one line lol |
22:39:26 | FromDiscord | <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:55 | FromDiscord | <Andreas> why not try a RegEx ? |
22:40:19 | FromDiscord | <Elegantbeef> Isnt that good enough |
22:40:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/WQxcF |
22:40:24 | FromDiscord | <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:00 | FromDiscord | <voidwalker> so 0..7 is not the same as range[0..7] ? |
22:41:10 | FromDiscord | <Elegantbeef> of course |
22:41:10 | FromDiscord | <Elegantbeef> `items` is implicitly called |
22:41:20 | FromDiscord | <Elegantbeef> `0..7` is a slice |
22:41:36 | FromDiscord | <Elegantbeef> `0..7` in type areas is a range |
22:41:50 | FromDiscord | <Elegantbeef> `type A = 0..7` is a range but `var a = 0..7` is a slice |
22:42:01 | FromDiscord | <voidwalker> ohhh it's a slice, ok. I still haven't read my slices lesson : P |
22:42:23 | FromDiscord | <Elegantbeef> Well `for x in a..b` is actually an iterator |
22:42:54 | FromDiscord | <Elegantbeef> Nim has a lot of capabilities for overloading π |
22:43:00 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> Nope |
22:43:11 | FromDiscord | <Elegantbeef> `..` is an iterator |
22:43:12 | FromDiscord | <voidwalker> what is `T(1)` though? |
22:43:24 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/system.html#...i%2CT%2CT |
22:43:28 | FromDiscord | <Elegantbeef> A conversion? |
22:43:44 | FromDiscord | <voidwalker> to what ? |
22:43:56 | FromDiscord | <Elegantbeef> `T` where `T` is the integer range you want to get the bits of |
22:43:58 | FromDiscord | <voidwalker> ohh ok |
22:44:27 | FromDiscord | <Elegantbeef> Apparently `for x in 0..<8` is too hard π |
22:44:27 | FromDiscord | <Elegantbeef> I don't know you were using a generic type for some reason |
22:45:17 | FromDiscord | <voidwalker> well, I randomly found it in bitops, and I thought it looks cool |
22:45:31 | FromDiscord | <Elegantbeef> lol |
22:45:46 | FromDiscord | <voidwalker> As in, more expressive to the origin of the values |
22:49:37 | FromDiscord | <voidwalker> have you done any exercism exercises Beef ? |
23:03:15 | * | m5zs7k_ joined #nim |
23:03:46 | FromDiscord | <Elegantbeef> A couple |
23:04:08 | * | m5zs7k quit (Quit: m5zs7k) |
23:08:37 | FromDiscord | <Zoom> It's infuriating. |
23:08:41 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=4zbf |
23:09:24 | FromDiscord | <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:32 | NimEventer | New Nimble package! emailparser - Email parser to JsonNode based on Cyrus JMAP parser, see https://github.com/mildred/emailparser.nim |