00:02:07 | FromDiscord | <elcritch> Yah, looks like infix operators with macro types aren't expanded |
00:03:19 | FromDiscord | <Elegantbeef> Well PR time for you! 😛 |
00:03:24 | FromDiscord | <huantian> In reply to @Reggie <3 "what up": Nim 😛 |
00:22:57 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4y6y |
00:31:13 | * | derpydoo joined #nim |
00:44:32 | * | azimut quit (Ping timeout: 240 seconds) |
00:51:00 | * | oldpcuser quit (Ping timeout: 250 seconds) |
00:51:02 | * | oldpcuser_ joined #nim |
01:04:13 | * | oldpcuser_ quit (Ping timeout: 255 seconds) |
01:30:12 | * | oldpcuser joined #nim |
01:40:58 | * | oldpcuser_ joined #nim |
01:41:44 | * | oldpcuser_ quit (Remote host closed the connection) |
01:43:05 | * | oldpcuser quit (Read error: Connection reset by peer) |
01:58:22 | * | oldpcuser joined #nim |
02:31:46 | * | systemdsucks quit (*.net *.split) |
02:31:46 | * | calebtj quit (*.net *.split) |
02:31:46 | * | om3ga quit (*.net *.split) |
02:31:47 | * | noeontheend quit (*.net *.split) |
02:31:47 | * | henrytill quit (*.net *.split) |
02:31:47 | * | casaca quit (*.net *.split) |
02:31:47 | * | mronetwo quit (*.net *.split) |
02:31:47 | * | oddish quit (*.net *.split) |
02:31:47 | * | Amun-Ra quit (*.net *.split) |
02:31:47 | * | ehmry quit (*.net *.split) |
02:31:57 | * | oddish joined #nim |
02:31:57 | * | mronetwo joined #nim |
02:32:30 | * | henrytill joined #nim |
02:33:01 | * | om3ga joined #nim |
02:33:51 | * | ehmry joined #nim |
02:33:54 | * | noeontheend joined #nim |
02:33:59 | * | casaca joined #nim |
02:35:12 | * | calebtj joined #nim |
02:35:31 | * | systemdsucks joined #nim |
02:39:42 | * | oldpcuser_ joined #nim |
02:42:30 | * | oldpcuser quit (Ping timeout: 260 seconds) |
02:43:57 | * | oldpcuser_ is now known as oldpcuser |
02:59:52 | * | oldpcuser quit (Read error: Connection reset by peer) |
03:00:33 | * | oldpcuser joined #nim |
03:02:41 | * | Amun-Ra joined #nim |
03:05:43 | * | oldpcuser_ joined #nim |
03:08:16 | * | oldpcuser quit (Ping timeout: 248 seconds) |
03:11:25 | * | oldpcuser_ quit (Quit: "mIRC sucks because is non-free software" Richard Stallman) |
03:11:48 | * | oldpcuser joined #nim |
03:21:05 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4y6R |
03:27:00 | FromDiscord | <yepoleb> In reply to @ripluke "im trying to generate": c2nim often has problems with ifdef, i always remove the non matching case |
03:27:27 | FromDiscord | <yepoleb> In this case i'd remove everything except line 89 |
03:27:38 | FromDiscord | <ringabout> What's wrong with git?↵`git checkout -q head` works on Windows but no Linux↵`git checkout -q #head` works on Linux but not Windows |
03:28:31 | FromDiscord | <ringabout> (edit) "no Linux↵`git checkout -q #head` works on" => "not" | removed "but not Windows" |
03:29:06 | FromDiscord | <graveflo> idk maybe there is a shell issue on win |
03:29:38 | FromDiscord | <graveflo> yea the `#` is a powershell comment. Idk if that will mess it up |
03:29:51 | FromDiscord | <graveflo> and I dont have a win vm to test it |
03:30:49 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4y6S |
03:31:10 | FromDiscord | <graveflo> it might have been made a special case for windows because people kept fing it up. idk though I'm just guessing |
03:31:47 | FromDiscord | <graveflo> does the `#head` work in powershell? |
03:32:15 | FromDiscord | <ringabout> Nope |
03:32:23 | FromDiscord | <ringabout> Seems to be a comment |
03:32:25 | FromDiscord | <graveflo> well thatd be my guess |
03:32:52 | FromDiscord | <graveflo> god i love windows |
03:34:20 | FromDiscord | <Invisible> How would I kill a process by process ID using nim? |
03:34:26 | FromDiscord | <Invisible> on win |
03:34:31 | FromDiscord | <ringabout> Guess `git checkout -q devel` should have the same effect. |
03:34:33 | FromDiscord | <graveflo> btw `"#head"` might work |
03:35:27 | FromDiscord | <graveflo> In reply to @Invisible "How would I kill": https://nim-lang.org/docs/osproc.html#kill%2CProcess |
03:35:36 | FromDiscord | <Invisible> Not by ID |
03:35:43 | FromDiscord | <Invisible> It only kills proccesses it started |
03:36:23 | FromDiscord | <graveflo> you can make a `Process` object that has the right handle |
03:36:52 | FromDiscord | <Invisible> I need to kill notepad.exe. my program didn't start t |
03:36:55 | FromDiscord | <Invisible> (edit) "t" => "it" |
03:38:19 | FromDiscord | <demotomohiro> In reply to @Invisible "How would I kill": If you want to kill arbitrary process with ID, you probably need to use windows API or find out Nim library that do so.↵I dont think there is a proc that can kill process with ID in Nim's stdlib. |
03:39:53 | FromDiscord | <graveflo> In reply to @Invisible "I need to kill": There are many different ways to do this but this is the way I have do it in the past↵winapi (psapi.EnumProcesses) - to get the process handles↵psapi.GetProcessImageFileNameW to get the "image name" of each |
03:40:20 | FromDiscord | <graveflo> then you can use the handle from the matching image name to make a nim `Process` object and then you can prob just use `kill` from std |
03:40:25 | FromDiscord | <Invisible> I've never used the winapi |
03:40:32 | FromDiscord | <graveflo> or use the winapi method which I think is `PostMessage` |
03:40:59 | FromDiscord | <Invisible> Can I pass the proccess object as a string? |
03:41:03 | FromDiscord | <Invisible> or no |
03:41:23 | FromDiscord | <Invisible> @graveflo |
03:41:39 | FromDiscord | <graveflo> tot he `kill` proc? no |
03:41:57 | FromDiscord | <Invisible> basically im just trying to have one nimlang program kill another one |
03:41:58 | FromDiscord | <graveflo> try this `nimble install winim` |
03:42:01 | FromDiscord | <graveflo> https://github.com/khchen/winim/blob/master/winim/inc/psapi.nim#L130 |
03:42:36 | FromDiscord | <graveflo> well if you are writing both nim programs you can use IPC to send a shutdown command. It'll prob be easier that way |
03:42:57 | FromDiscord | <Invisible> In reply to @graveflo "well if you are": Again, no clue what tihs s |
03:43:03 | FromDiscord | <Invisible> (edit) "tihs s" => "this is" |
03:43:20 | FromDiscord | <graveflo> inter-process communication. Simple way is using a loopback socket |
03:43:44 | FromDiscord | <Invisible> Is there a nim library for that? |
03:44:27 | FromDiscord | <demotomohiro> sent a long message, see https://paste.rs/vZeRY |
03:45:06 | FromDiscord | <Invisible> This is legit my second nim application coming from python I have no clue what this shit is |
03:45:16 | FromDiscord | <graveflo> there are sockets... but I think maybe youll need someone to help you with the threading tho bc I havent dont that... tbh I would just use `winim` and if this is really only going to be on windows |
03:45:20 | FromDiscord | <demotomohiro> sockets, or pipes are part of IPC and Nim's stdlib support them |
03:45:31 | FromDiscord | <!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4y6W |
03:45:43 | FromDiscord | <Invisible> In reply to @demotomohiro "sockets, or pipes are": Sometimes I get a piperror when abruptley stopping a file stream, is it that? |
03:47:27 | FromDiscord | <demotomohiro> In reply to @ripluke "does anyone know how": It seems nimscripter depends on modules in Nim's compiler but it directly import `/usr/compiler/nimeval`? |
03:48:39 | FromDiscord | <demotomohiro> Maybe, if you have Nim's compiler module, adding `--path:/path/to/Nim` might allows nimscripter to import compiler module. |
03:48:51 | FromDiscord | <!&luke> Oh |
03:49:31 | FromDiscord | <graveflo> In reply to @Invisible "This is legit my": if you bear with me I can try to get you on the right track but I dont have a win computer right now. You'll prob have to put some pieces together yourself |
03:49:51 | FromDiscord | <Invisible> I dont either im compiling thru a vm |
03:52:33 | FromDiscord | <!&luke> In reply to @demotomohiro "Maybe, if you have": It seems upgrade to 1.6.12 from 1.6.10 fixed it |
03:52:42 | FromDiscord | <!&luke> (edit) "upgrade" => "upgrading" |
03:55:21 | FromDiscord | <graveflo> In reply to @Invisible "I dont either im": something like this should get the process handles. This would be the first step: |
03:55:32 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4y6Y |
03:55:54 | FromDiscord | <Invisible> SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
03:55:56 | FromDiscord | <demotomohiro> You probably can find a C lang book for beginner in book store for learning C lang. Then, you can learn how to use windows APIs in microsoft web sites for developers. |
03:56:24 | FromDiscord | <Invisible> Im not reading a book on C just to learn how to kill a proccess dawg |
03:58:04 | FromDiscord | <demotomohiro> In reply to @Invisible "Im not reading a": But microsoft web sites for developers is mostly written for C developer, and you might fail to use windows api if you dont read their documents. |
03:58:05 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4y6Z |
03:58:45 | FromDiscord | <Invisible> sent a long message, see http://ix.io/4y70 |
03:58:46 | FromDiscord | <Invisible> 8,6 |
03:58:48 | FromDiscord | <graveflo> lat line `echo returned[]` sorry |
03:58:57 | FromDiscord | <graveflo> (edit) "lat" => "last" |
03:59:27 | FromDiscord | <Invisible> spat out "380" |
03:59:45 | FromDiscord | <graveflo> nice that means you have 380 processes running and it dumped them into the memory you allocated 🙂 |
03:59:55 | FromDiscord | <graveflo> thats a lot of procs actually LOL |
04:00:13 | FromDiscord | <graveflo> oh wait thats the size in bytes purhaps |
04:00:20 | FromDiscord | <Invisible> 4 apps 25 background |
04:00:25 | FromDiscord | <Invisible> 29 total |
04:03:32 | FromDiscord | <michaelb.eth> In reply to @Invisible "This is legit my": Glad you're here and trying Nim!↵↵Something to realize/know is that, in practice, in some situations, there can be a fairly thin layer of abstraction between the Nim code and some raw C API stuff it's wrapping. That can be frustrating/challening, but it's also an opportunity to learn more and understand better what's "under the hood". Nim is not a scripting language. |
04:04:05 | FromDiscord | <michaelb.eth> (edit) "In reply to @Invisible "This is legit my": Glad you're here and trying Nim!↵↵Something to realize/know is that, in practice, in some ... situations," added "(many?)" |
04:04:12 | FromDiscord | <graveflo> In reply to @Invisible "4 apps 25 background": I'll dm you so we arent fogging up this chat how about? |
04:04:19 | FromDiscord | <Invisible> alright ig |
04:04:22 | FromDiscord | <Elegantbeef> Ugh dming |
04:04:27 | FromDiscord | <demotomohiro> Using windows API without reading a official document about it is like driving a car without going to driving school.↵https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-enumprocesses↵> To determine how many processes were enumerated, divide the lpcbNeeded value by sizeof(DWORD). |
04:04:32 | FromDiscord | <Invisible> In reply to @Elegantbeef "Ugh dming": Ugh non-discord user |
04:04:43 | FromDiscord | <graveflo> In reply to @Elegantbeef "Ugh dming": I'll post it for you if you want beef |
04:04:49 | FromDiscord | <graveflo> I didn't know you were so invested |
04:05:04 | FromDiscord | <odexine> Lol |
04:05:41 | FromDiscord | <Elegantbeef> It's not that i'm so invested but people going into dms from a public forum is ripe for misinformation |
04:05:54 | FromDiscord | <Elegantbeef> I dislike it myself, you do you |
04:12:57 | FromDiscord | <demotomohiro> In reply to @Invisible "How would I kill": If you know the process ID you want to kill, calling OpenProcess and TerminateProcess might be enough.↵https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocess↵https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminateprocess |
04:13:19 | FromDiscord | <huantian> I 99% agree with you beef, but there are situations where a convo is being wack because too many people are trying to convince 1 person of something |
04:13:51 | FromDiscord | <Elegantbeef> I'm sorry huan you really should drink water |
04:14:01 | FromDiscord | <huantian> Which doesnt work in a live chat like discord because it just feels like dog piling and multiple people have separate intermeginglhing convos with one person |
04:14:05 | FromDiscord | <!&luke> How do you run shell commands in nimscript, specifically through nimscripter |
04:14:13 | FromDiscord | <michaelb.eth> discord threads? |
04:14:21 | FromDiscord | <huantian> In reply to @Elegantbeef "I'm sorry huan you": What does that mean lmao |
04:14:43 | FromDiscord | <Elegantbeef> > too many people are trying to convince 1 person of something |
04:14:44 | FromDiscord | <Elegantbeef> I was jokingly responding to that |
04:15:01 | FromDiscord | <Elegantbeef> Uhh you might need to get the vmops luke |
04:15:17 | FromDiscord | <Elegantbeef> I personally would probably suggest just exposing your own proc to handle it |
04:15:28 | FromDiscord | <huantian> In reply to @Elegantbeef "I was jokingly responding": Sorry I don’t get the joke haha |
04:16:04 | FromDiscord | <Elegantbeef> Trying to convince you to drink water |
04:16:14 | FromDiscord | <Elegantbeef> Implying you argued you don't need it |
04:16:23 | FromDiscord | <huantian> Huh |
04:16:24 | FromDiscord | <!&luke> In reply to @Elegantbeef "I personally would probably": I tried that but I get no output when running the binary |
04:17:39 | FromDiscord | <Elegantbeef> What? |
04:18:15 | FromDiscord | <Elegantbeef> What was your exposed procedure like |
04:22:09 | FromDiscord | <!&luke> Oh wait the exported procedure is evaluated as nimscript itself |
04:22:31 | FromDiscord | <!&luke> That would explain why it didn't work as it straight up just called execShellCmd |
04:28:06 | * | Lord_Nightmare quit (Ping timeout: 260 seconds) |
04:31:58 | * | Lord_Nightmare joined #nim |
04:36:35 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4y75 |
04:37:01 | FromDiscord | <graveflo> (edit) "https://play.nim-lang.org/#ix=4y75" => "https://play.nim-lang.org/#ix=4y76" |
04:52:07 | FromDiscord | <demotomohiro> In reply to @graveflo "well if you want": It seems there is another way to get a list of processes using CreateToolhelp32Snapshot↵https://learn.microsoft.com/en-us/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes↵https://learn.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot |
04:55:10 | FromDiscord | <graveflo> yep that sounds familiar. The win api is an arduous beast unless you have a lot of patience. Do you think that the tool help method is better then `OpenProcess` ? perhaps one is unnecessarily permissive |
04:55:45 | * | ntat joined #nim |
04:59:20 | FromDiscord | <demotomohiro> It seems you need to allocate large storage before calling `EnumProcesses` without knowing the number of currently running processes.↵`CreateToolhelp32Snapshot` doesn't requires large storage.↵Im not sure you need to care about these API to just kill a process. |
04:59:28 | FromDiscord | <graveflo> actually speaking of unnecessarily permissive I bet `PROCESS_TERMINATE` is all that is needed for my code snippet. I was looking at some code that I wrote a year ago for messing with another procs memory |
04:59:51 | * | krux02 quit (Remote host closed the connection) |
05:01:34 | FromDiscord | <graveflo> In reply to @demotomohiro "It seems you need": thats true the help seems to use a linked list. I had seen other people mess around wit the os process tracking and it was a linked list so perhaps that is the underlying data type. I think it's going to be as complicated as the above or walking the linked list unless someone has written the code for you. I didn't see anything in nim std or `winim` that managed these API calls on a higher |
05:02:10 | FromDiscord | <graveflo> (edit) "wit the os" => "with window" | "with windowprocess tracking and it was a linked list ... so" added "also," |
05:09:16 | * | oldpcuser quit (Remote host closed the connection) |
05:09:41 | * | oldpcuser joined #nim |
05:21:15 | FromDiscord | <Invisible> Whne using execCmdEx in app:gui mode, how can I prevent the CMD window from flashing for a breif moment? |
05:21:44 | FromDiscord | <Invisible> In reply to @graveflo "well if you want": Also I no longer need help with this, I found an alternative to what I was doing |
05:23:15 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4y7e |
05:33:24 | FromDiscord | <demotomohiro> In reply to @Invisible "Whne using execCmdEx in": `execProcess` or `startProcess` in osproc module without `poEvalCommand` option probably dont open cmd window. |
05:39:31 | * | calebtj quit (Quit: WeeChat 3.8) |
06:11:05 | * | calebtj joined #nim |
06:12:57 | * | Guest78 joined #nim |
06:13:39 | * | Guest78 quit (Quit: Client closed) |
06:21:54 | * | PMunch joined #nim |
07:42:40 | NimEventer | New thread by grd: Why is the posix package so "low level"?, see https://forum.nim-lang.org/t/10269 |
08:22:26 | * | a11e99z joined #nim |
08:30:14 | * | marcus quit (Remote host closed the connection) |
08:32:06 | * | marcus joined #nim |
10:18:13 | NimEventer | New thread by giga84: How doeas NIM differ from Mojo programming language?, see https://forum.nim-lang.org/t/10270 |
10:34:14 | * | azimut joined #nim |
10:45:58 | * | derpydoo quit (Quit: derpydoo) |
11:18:03 | * | beholders_eye joined #nim |
11:26:17 | FromDiscord | <tecknicalwarrior> how do I turn an Int to str |
11:26:45 | FromDiscord | <tecknicalwarrior> there is intToStr |
11:26:48 | FromDiscord | <tecknicalwarrior> why isnt there the inverse? |
11:26:51 | FromDiscord | <dissolved girl> `$` |
11:27:02 | FromDiscord | <tecknicalwarrior> In reply to @dissolved girl "`$`": ? |
11:27:42 | FromDiscord | <dissolved girl> In reply to @tecknicalwarrior "?": Check out https://nim-lang.org/docs/dollars.html |
11:28:46 | FromDiscord | <tecknicalwarrior> this confuses me |
11:29:33 | FromDiscord | <dissolved girl> Did you see the example? 😅 |
11:29:40 | FromDiscord | <tecknicalwarrior> yeah i dont |
11:29:45 | FromDiscord | <tecknicalwarrior> see any proc here that goes |
11:29:49 | FromDiscord | <tecknicalwarrior> inttostr |
11:30:54 | FromDiscord | <tecknicalwarrior> idk it didnt work initially |
11:30:55 | FromDiscord | <tecknicalwarrior> its working now |
11:31:39 | FromDiscord | <tecknicalwarrior> wait no it didnt |
11:31:41 | FromDiscord | <dissolved girl> https://play.nim-lang.org/#ix=4y8a |
11:31:42 | FromDiscord | <tecknicalwarrior> it gave me type of str |
11:31:44 | FromDiscord | <dissolved girl> Here's an example for you |
11:32:02 | FromDiscord | <tecknicalwarrior> In reply to @dissolved girl "Here's an example for": i want str to int |
11:32:05 | FromDiscord | <dissolved girl> I thought a string is what you wanted? You asked how to turn an int to string |
11:32:06 | FromDiscord | <tecknicalwarrior> not int to str |
11:32:18 | FromDiscord | <tecknicalwarrior> im |
11:32:24 | FromDiscord | <tecknicalwarrior> retartded |
11:32:27 | FromDiscord | <tecknicalwarrior> I want the inverse |
11:32:33 | FromDiscord | <dissolved girl> Oh, that's https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint |
11:32:34 | FromDiscord | <tecknicalwarrior> https://media.discordapp.net/attachments/371759389889003532/1118140852158603304/image.png |
11:32:42 | FromDiscord | <tecknicalwarrior> I was already doing this |
11:33:26 | FromDiscord | <dissolved girl> wait no, wrong link |
11:33:33 | FromDiscord | <tecknicalwarrior> yeah I got an error |
11:33:37 | FromDiscord | <tecknicalwarrior> for type mismatch of char |
11:33:58 | FromDiscord | <dissolved girl> https://nim-lang.org/docs/strutils.html#parseInt%2Cstring |
11:34:01 | FromDiscord | <dissolved girl> This one |
11:34:30 | FromDiscord | <tecknicalwarrior> I dont see the difference between these 2 |
11:34:34 | FromDiscord | <tecknicalwarrior> I still get the error |
11:35:08 | FromDiscord | <tecknicalwarrior> one is a fun but |
11:35:42 | FromDiscord | <dissolved girl> In reply to @tecknicalwarrior "I dont see the": The signatures are different |
11:35:47 | FromDiscord | <dissolved girl> What error are you getting? |
11:36:05 | FromDiscord | <tecknicalwarrior> sent a code paste, see https://paste.rs/Wi1A0 |
11:36:56 | FromDiscord | <dissolved girl> Well... yeah, the proc takes a string, not a char. The dollar would help you once again https://nim-lang.org/docs/dollars.html#%24%2Cchar |
11:37:13 | FromDiscord | <tecknicalwarrior> okay im very new to nim |
11:37:16 | FromDiscord | <tecknicalwarrior> i just |
11:37:21 | FromDiscord | <tecknicalwarrior> wanna turn a number |
11:37:26 | FromDiscord | <tecknicalwarrior> like "43" |
11:37:31 | FromDiscord | <tecknicalwarrior> to "fourty three" |
11:37:46 | FromDiscord | <tecknicalwarrior> so I figured id do something like index it against a table |
11:37:50 | FromDiscord | <dissolved girl> Oh, that's... entirely different to what I thought you meant by "int to string" |
11:37:57 | FromDiscord | <tecknicalwarrior> well yeah |
11:37:59 | FromDiscord | <tecknicalwarrior> im trying |
11:38:02 | FromDiscord | <tecknicalwarrior> index it against a table |
11:38:12 | FromDiscord | <tecknicalwarrior> but the table takes a int value |
11:38:45 | FromDiscord | <dissolved girl> Can you share your code on https://play.nim-lang.org/ |
11:39:03 | FromDiscord | <dissolved girl> The "share to ix" button on the bottom left of the editor |
11:39:09 | FromDiscord | <tecknicalwarrior> https://play.nim-lang.org/#ix=4y8c |
11:39:11 | FromDiscord | <graveflo> its `parseInt` right? |
11:39:37 | FromDiscord | <graveflo> https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint |
11:40:01 | FromDiscord | <tecknicalwarrior> In reply to @graveflo "its `parseInt` right?": yeah well i need char input not string |
11:40:02 | FromDiscord | <tecknicalwarrior> so char to int |
11:40:14 | FromDiscord | <graveflo> just `int` then |
11:40:18 | FromDiscord | <dissolved girl> In reply to @tecknicalwarrior "https://play.nim-lang.org/#ix=4y8c": So basically, I think you're over-engineering this |
11:40:27 | FromDiscord | <tecknicalwarrior> In reply to @dissolved girl "So basically, I think": yeah im kinda bad |
11:40:28 | FromDiscord | <tecknicalwarrior> at nim |
11:40:34 | FromDiscord | <tecknicalwarrior> my native program is python |
11:41:01 | FromDiscord | <tecknicalwarrior> this is the starter program i write to learn a language |
11:41:15 | FromDiscord | <dissolved girl> Are you new to typing? |
11:41:20 | FromDiscord | <dissolved girl> Just for context |
11:41:30 | FromDiscord | <tecknicalwarrior> seeing as my primary langs are python lua and js |
11:41:51 | FromDiscord | <tecknicalwarrior> i have done very little c/c++, little java, less c# |
11:43:51 | FromDiscord | <dissolved girl> Okay, well, for starters, I think making a table is a bit overkill - arrays, for example, are already accessed by their index, so you could just create an array `["zero", "one", "two"]` and so on. You could access what you need using `[]`, so `digits[1]` would get you `"one"`, for example |
11:44:17 | FromDiscord | <tecknicalwarrior> okay sure |
11:44:32 | FromDiscord | <tecknicalwarrior> that doesnt help me deconstruct this tho |
11:44:37 | FromDiscord | <dissolved girl> Logically speaking, what you want to do is: |
11:44:45 | FromDiscord | <tecknicalwarrior> I still need to get that 1 to be of type int |
11:45:03 | FromDiscord | <graveflo> yea and notice that its a `string` not a `char` |
11:47:59 | FromDiscord | <dissolved girl> sent a long message, see http://ix.io/4y8g |
11:48:08 | FromDiscord | <dissolved girl> or, `"fourty"`, i guess |
11:48:42 | FromDiscord | <tecknicalwarrior> i see |
11:48:43 | FromDiscord | <tecknicalwarrior> thanks |
11:52:04 | FromDiscord | <graveflo> could also be worth noting that if you have a char digit `int('5')-int('0')` will also give you 5 |
11:54:23 | FromDiscord | <dissolved girl> Yes, but that's kind of "magic" 😀 I would not do it like that |
11:56:45 | FromDiscord | <tecknicalwarrior> https://media.discordapp.net/attachments/371759389889003532/1118146939976949790/image.png |
11:56:47 | FromDiscord | <tecknicalwarrior> yay it works |
11:56:59 | FromDiscord | <dissolved girl> A few other pointers if you don't mind |
11:57:18 | FromDiscord | <tecknicalwarrior> okay so real quick, how can i strip the ending string of any whitespace? |
11:57:58 | FromDiscord | <dissolved girl> As in, remove all whitespace (anywhere in the string)? Or just leading or trailing whitespace? |
11:58:58 | FromDiscord | <graveflo> `string.strip(leading=false)` |
11:59:02 | FromDiscord | <tecknicalwarrior> In reply to @dissolved girl "As in, remove all": leading + trailing |
11:59:09 | FromDiscord | <tecknicalwarrior> In reply to @graveflo "`string.strip(leading=false)`": i see |
11:59:51 | FromDiscord | <dissolved girl> sent a code paste, see https://play.nim-lang.org/#ix=4y8k |
12:01:50 | FromDiscord | <dissolved girl> `num.len()-1` - this isn't required. You can do `num.high` to get the index of the last element, or just `^1` (as in - `num[^1]` would get the last element of `num`) |
12:02:27 | FromDiscord | <tecknicalwarrior> In reply to @dissolved girl "`num.len()-1` - this isn't": i see |
12:03:17 | FromDiscord | <dissolved girl> When importing from std, the leading `std/` isn't required. But you can use it if you want. You can also combine imports, so in your case `import std/[strutils, random, tables]` would work. If you feel like your imports are getting too long |
12:04:12 | FromDiscord | <tecknicalwarrior> how do I return multiple values? |
12:04:31 | FromDiscord | <dissolved girl> You can return a tuple |
12:05:03 | FromDiscord | <tecknicalwarrior> I see |
12:05:19 | FromDiscord | <dissolved girl> sent a code paste, see https://play.nim-lang.org/#ix=4y8m |
13:21:58 | * | xxgg joined #nim |
13:48:13 | * | krydos quit (Server closed connection) |
13:48:27 | * | krydos joined #nim |
14:10:32 | * | PMunch quit (Quit: Leaving) |
14:13:27 | FromDiscord | <System64 ~ Flandre Scarlet> Hi, In Nim, how is Sine calculated? With a precalculated table or with another method? |
14:13:49 | FromDiscord | <odexine> with whatever the math.h sine does? |
14:15:23 | FromDiscord | <voidwalker> Anyone have experience analysing program memory (with tools such as cheat engine etc) ? I need to extract some info, very clueless. |
14:16:48 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "with whatever the math.h": This is the only thing I see https://media.discordapp.net/attachments/371759389889003532/1118182186978398278/image.png |
14:20:16 | FromDiscord | <juan_carlos> In reply to @voidwalker "Anyone have experience analysing": scanmem |
14:20:42 | * | deadmarshal_ quit (Quit: IRCNow and Forever!) |
14:21:16 | NimEventer | New thread by noxnivi_: NimQML> How to pack resource files or gui files in compiled package, see https://forum.nim-lang.org/t/10271 |
14:30:06 | * | tk quit (Server closed connection) |
14:30:14 | * | tk joined #nim |
14:43:23 | FromDiscord | <voidwalker> @juan_carlos thanks but I already have a toold for analysing the memory (cheat engine looks much more complex than game conqueror). What I miss is the know how, methods to obtain a pattern that I can use to transpose in code |
14:44:41 | * | deadmarshal_ joined #nim |
14:49:43 | * | xet7 quit (Quit: Leaving) |
15:05:19 | * | xet7 joined #nim |
15:14:57 | * | xxgg quit (Quit: Client closed) |
15:16:11 | FromDiscord | <Invisible> In reply to @demotomohiro "`execProcess` or `startProcess` in": Would iet let me run a CMD command? |
15:18:58 | FromDiscord | <demotomohiro> They run executable files. You can run cmd.exe commands like `cmd foo`. But I don't know whether it open console window. |
15:23:02 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I can't do that? https://media.discordapp.net/attachments/371759389889003532/1118198850314833981/image.png |
15:23:44 | FromDiscord | <Elegantbeef> game is not mutable so yes |
15:23:55 | FromDiscord | <Elegantbeef> also why are you using method for a `object` |
15:24:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "also why are you": methods are for ref object only? |
15:25:30 | * | xet7_ joined #nim |
15:25:58 | FromDiscord | <ieltan> iirc, methods are only useful when you have `object of` |
15:27:41 | FromDiscord | <Elegantbeef> Methods are for dynamic dispatch |
15:27:47 | FromDiscord | <Elegantbeef> Only for inheritance |
15:28:26 | FromDiscord | <System64 ~ Flandre Scarlet> oh alright, so I only should use procs here? |
15:28:44 | * | xet7 quit (Ping timeout: 240 seconds) |
15:28:46 | FromDiscord | <Elegantbeef> Yes |
15:30:31 | * | xet7_ quit (Quit: Leaving) |
15:30:55 | * | xet7 joined #nim |
15:39:54 | madprops | how can i avoid optparser from treating "--thisString" as an argument? it's enclosed in quotes, it should treat it as a string |
15:40:01 | madprops | as a flag i mean |
15:40:06 | madprops | it's meant to be an argument |
15:44:31 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4y9E |
15:46:33 | FromDiscord | <juan_carlos> sent a code paste, see https://play.nim-lang.org/#ix=4y9G |
15:50:35 | FromDiscord | <System64 ~ Flandre Scarlet> Bruh I marked it as gcsafe https://media.discordapp.net/attachments/371759389889003532/1118205783042162838/image.png |
15:55:49 | FromDiscord | <System64 ~ Flandre Scarlet> So that means I have to turn every function into gcsafe? Not very practical https://media.discordapp.net/attachments/371759389889003532/1118207103119675574/image.png |
15:56:01 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "function" => "proc" |
16:03:02 | FromDiscord | <System64 ~ Flandre Scarlet> so I really need to turn every proc into gcsafe? |
16:03:05 | * | strogon14 joined #nim |
16:06:38 | FromDiscord | <krab4t> what special in nim 2? |
16:08:31 | FromDiscord | <Elegantbeef> They changed teh 1 to 2 |
16:10:27 | * | oldpcuser_ joined #nim |
16:11:11 | FromDiscord | <spotlightkid> nim 2, bekomme 1 gratis |
16:11:19 | * | oldpcuser quit (Killed (NickServ (GHOST command used by oldpcuser_))) |
16:11:21 | * | oldpcuser_ is now known as oldpcuser |
16:12:00 | FromDiscord | <juan_carlos> 2 Nim at the price of 1. |
16:12:34 | FromDiscord | <dissolved girl> The main character dies |
16:13:03 | FromDiscord | <spotlightkid> they already have nim 3 in the can |
16:13:04 | FromDiscord | <odexine> nim becomes 2 |
16:15:38 | FromDiscord | <dissolved girl> If you scroll down on this page, you'll see some changes and bug fixes https://nim-lang.org/blog/2022/12/21/version-20-rc.html |
16:19:39 | FromDiscord | <krab4t> so nothing really special just to remove "legacy" |
16:21:51 | FromDiscord | <Elegantbeef> Little know fact in semver breaking changes indicates a major release |
16:23:12 | FromDiscord | <dissolved girl> All of the changes in any of my codebase are breaking |
16:30:57 | FromDiscord | <juan_carlos> In reply to @krab4t "so nothing really special": Thats actually big, so it wont become cpp-ish. |
16:36:52 | FromDiscord | <_gumbercules> In reply to @sys64 "so I really need": why are you using `method` with an `object`? |
16:38:36 | FromDiscord | <_gumbercules> In reply to @sys64 "so I really need": do you have more code to share? screenshots showing snippets like this are the worst |
16:39:42 | FromDiscord | <_gumbercules> `gcsafe` means something - it is a satisfiable constraint. I'm not sure about the state of Nim's `threadpool` but based on the code you shared in those screenshots, no one can tell if you're doing anything unsafe in the procedures you are calling in the proc that is pased to `createThread` or `spawn` or whatever |
16:40:24 | FromDiscord | <_gumbercules> If you don't know what `gcsafe` means or does, wading into multithreading is going to most likely be a world of pain for you |
16:40:34 | FromDiscord | <_gumbercules> (edit) "know" => "understand" |
16:43:02 | * | a11e99z quit (Quit: Leaving) |
16:44:11 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4y9O |
16:45:35 | FromDiscord | <_gumbercules> `bootGameInstance` isn't `gcsafe` because it accesses globally scoped variables like `delta` which are not `threadvar` |
16:45:51 | FromDiscord | <_gumbercules> so the compiler is correct in complaining about the call to `spawn` |
16:46:17 | FromDiscord | <odexine> i think you intended to move them to the game instance fields? |
16:46:57 | FromDiscord | <_gumbercules> the real question is - what are you trying to do here and why are you trying to use threads to do it? |
16:47:06 | FromDiscord | <chmod222> What do you mean, forever being saddled with `std::vector<bool>` specializing into a bitfield because the C++ people wanted to demonstrate how specializing works is a great idea |
16:47:34 | FromDiscord | <odexine> In reply to @chmod222 "What do you mean,": oof |
16:48:47 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "i think you intended": yeah I'm refactoring that |
16:48:50 | FromDiscord | <_gumbercules> @System64 ~ Flandre Scarlet threadpools generally should be used for short lived tasks that are CPU bound |
16:48:57 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "the real question is": multi instance servers |
16:48:59 | FromDiscord | <_gumbercules> not initializing your game engine |
16:49:13 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "not initializing your game": This is my backend |
16:49:19 | FromDiscord | <odexine> i think having an OS thread per instance is a bad idea? |
16:49:20 | FromDiscord | <_gumbercules> well the backend of your game engine then |
16:49:26 | FromDiscord | <odexine> you'd run out of resources really quickly |
16:49:52 | FromDiscord | <_gumbercules> you probably want to have a threadpool to handle conncections to your backend with |
16:49:55 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @odexine "i think having an": Wdym by OS thread? |
16:50:20 | FromDiscord | <_gumbercules> but that can be tricky as well if the requests to your web server are long running / IO bound |
16:50:23 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "you probably want to": I can have multiple servers on the same machine |
16:50:26 | FromDiscord | <odexine> nim std threading uses raw OS threads which are pretty resource heavy |
16:50:34 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
16:50:41 | FromDiscord | <System64 ~ Flandre Scarlet> what to do then? |
16:50:42 | FromDiscord | <_gumbercules> In reply to @sys64 "I can have multiple": yes - but you don't do this with threads typically |
16:50:52 | FromDiscord | <hugop707> In reply to @odexine "nim std threading uses": go fast or go home 😎 |
16:50:53 | FromDiscord | <_gumbercules> you typically run several instances of your program and load balance them |
16:51:06 | FromDiscord | <odexine> In reply to @hugop707 "go fast or go": raw threads arent necessarily fast |
16:51:11 | FromDiscord | <_gumbercules> what to do is study how a production web server is written fi you want to write your own |
16:51:16 | FromDiscord | <hugop707> dont make me use the nerd emoju |
16:51:20 | FromDiscord | <Elegantbeef> Multi instance servers means spawning multiple processes |
16:51:22 | FromDiscord | <Elegantbeef> Even worse is that if one crashes they all crash |
16:51:23 | FromDiscord | <_gumbercules> or use an already existing web server that does whatever you're trying to do |
16:51:24 | FromDiscord | <Elegantbeef> Why wouldnt you just spawn a process per instance |
16:51:25 | FromDiscord | <Elegantbeef> You're using multi-threading to emulate a multi process OS on an multi process OS |
16:51:39 | * | antranigv quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:51:44 | FromDiscord | <_gumbercules> yeah if you want to run multiple instances of your web server |
16:51:48 | FromDiscord | <_gumbercules> just run multiple instances of your program |
16:51:53 | FromDiscord | <_gumbercules> and put nginx in front of them |
16:51:54 | FromDiscord | <_gumbercules> done |
16:52:03 | FromDiscord | <dissolved girl> In reply to @odexine "i think having an": Tell that to https://github.com/guzba/mummy |
16:52:14 | FromDiscord | <odexine> well |
16:52:17 | FromDiscord | <odexine> it depends on the use case |
16:52:24 | FromDiscord | <odexine> and how theyre used |
16:52:32 | FromDiscord | <_gumbercules> In reply to @dissolved girl "Tell that to https://github.com/guzba/mummy": how many mummy users are there in the world really? |
16:52:32 | FromDiscord | <odexine> using OS threads isnt bad inherently |
16:52:35 | * | rockcavera joined #nim |
16:52:42 | FromDiscord | <dissolved girl> In reply to @_gumbercules "how many mummy users": At least one! |
16:52:43 | FromDiscord | <_gumbercules> and what is their load like |
16:52:58 | FromDiscord | <dissolved girl> Well |
16:53:07 | FromDiscord | <dissolved girl> Negligible |
16:53:12 | FromDiscord | <_gumbercules> I just wouldn't point to a library that uses threads for concurrent IO and call the dilemma solved |
16:53:21 | FromDiscord | <dissolved girl> I was making a joke 😅 |
16:53:25 | FromDiscord | <_gumbercules> mummy I'm sure performs very poorly under certain workloads |
16:53:28 | FromDiscord | <_gumbercules> I gotcha |
16:53:45 | * | antranigv joined #nim |
16:54:22 | FromDiscord | <_gumbercules> @System64 ~ Flandre Scarlet you're definitely overcomplicating whatever you're trying to do - focus on a single instance of your game server for now and worry about multiple instances when you have the players to require it |
16:56:03 | FromDiscord | <odexine> In reply to @_gumbercules "mummy I'm sure performs": its all a use case thing really |
16:56:12 | FromDiscord | <odexine> whichever fits your situation the best |
16:57:12 | FromDiscord | <_gumbercules> yes but knowing what you are dealing with and what you need are often difficult questions to answer |
16:57:34 | FromDiscord | <_gumbercules> unless you've already built the thing, and then you're probably not asking these questions anyway because you now know 🙂 |
16:57:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @_gumbercules "<@380360389377916939> you're definitely overcomplic": Ah alright then |
16:58:07 | FromDiscord | <_gumbercules> If you haven't written a networked game server before, it'd be best to follow along with some tutorial and make something simple |
16:58:12 | FromDiscord | <_gumbercules> even if it's not in Nim |
16:58:19 | FromDiscord | <_gumbercules> the concepts will still apply |
16:59:18 | FromDiscord | <_gumbercules> There's a pretty great blog post series from the creator of the Construct game engine re: building a 2d multiplayer RTS: https://www.construct.net/en/blogs/ashleys-blog-2/im-going-game-1596 |
16:59:24 | FromDiscord | <_gumbercules> might be of interest to you |
16:59:53 | FromDiscord | <_gumbercules> there's also: https://gafferongames.com/categories/game-networking/ which is a ust read |
16:59:56 | FromDiscord | <_gumbercules> (edit) "ust" => "must" |
17:00:09 | FromDiscord | <_gumbercules> https://github.com/ThusSpokeNomad/GameNetworkingResources - has a bunch of links to good resources |
17:00:34 | FromDiscord | <System64 ~ Flandre Scarlet> Ah thanks for the resources! |
17:00:59 | FromDiscord | <anuke> Just to make sure, is the fastest way of appending characters to a string in a loop `newStringOfCap(...)` and `str &= 'c'`? I'd rather not have it do silly things like copy the entire string before appending each time. |
17:01:18 | FromDiscord | <_gumbercules> Of course and if you have specific questions there's probably a few of us in #gamedev who know the answer |
17:01:52 | FromDiscord | <Elegantbeef> `copyMem` is likely faster |
17:02:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/ZB2Ft |
17:02:30 | FromDiscord | <Chronos [She/Her]> Anyone know if redis compiles for Nim 2.0? |
17:02:37 | FromDiscord | <Chronos [She/Her]> `nim-lang/redis` |
17:03:23 | FromDiscord | <anuke> In this case I am filtering character-by-charactger, the source is not a buffer |
17:03:38 | FromDiscord | <anuke> I specifically need to build it up in a loop |
17:03:41 | FromDiscord | <anuke> (edit) "character-by-charactger," => "character-by-character," |
17:04:01 | FromDiscord | <Elegantbeef> If possible it's also likely quicker to do `newString(len)` then do `a[i] = c` if possible |
17:04:05 | FromDiscord | <Elegantbeef> Redundancy |
17:04:54 | FromDiscord | <Elegantbeef> `&=` will increment the length of course, whereas `a[i] = c` skips that |
17:04:57 | FromDiscord | <Elegantbeef> It's negligible of course, but you said fast! |
17:05:58 | FromDiscord | <anuke> right, as long as it doesn't do redundant copies |
17:07:00 | FromDiscord | <Elegantbeef> If you ever grow larger than the string's length you of course need to copy into a new allocation, otherwise no copies should be made |
17:28:36 | * | Jjp137 quit (Server closed connection) |
17:28:56 | * | Jjp137 joined #nim |
17:44:27 | * | beholders_eye quit (Ping timeout: 255 seconds) |
17:50:47 | * | rockcavera quit (Remote host closed the connection) |
18:15:03 | ntat | I make this pattern with 3 group delimited by brackets: let pattern = re"""(title=".+>)(.+)(</a>)""" and now found all text. How can I get only second group (.+)? |
18:15:57 | ntat | I use findAll(data, pattern) |
18:20:34 | FromDiscord | <Elegantbeef> use strscans is my response |
18:20:43 | FromDiscord | <Elegantbeef> Or parse the xml and extract it |
18:22:59 | NimEventer | New thread by mantielero: Procs: forward declaration, see https://forum.nim-lang.org/t/10272 |
18:26:20 | * | krux02 joined #nim |
18:27:46 | * | strogon14 left #nim (Und tschüss!) |
18:34:48 | * | Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...) |
18:36:59 | * | Amun-Ra joined #nim |
19:05:54 | FromDiscord | <System64 ~ Flandre Scarlet> So I can't do multithreading because I use a callback?? https://media.discordapp.net/attachments/371759389889003532/1118254938930282561/image.png |
19:18:48 | ntat | Elegantbeef, i try parseHtml from htmlparser and now I have xmlnode. How can I print xmlnode? |
19:29:18 | FromDiscord | <_gumbercules> In reply to @sys64 "So I can't do": https://bholley.net/blog/2015/must-be-this-tall-to-write-multi-threaded-code.html |
19:30:29 | FromDiscord | <_gumbercules> you're also still using `method` and we can't really infer much from a screenshot of five lines of code |
19:31:04 | FromDiscord | <_gumbercules> we don't even know what `callbacks` is |
19:31:56 | * | dza quit (Ping timeout: 246 seconds) |
19:32:44 | * | rockcavera joined #nim |
19:45:29 | FromDiscord | <michaelb.eth> in a macro that has a generic param `S`, can I get the name of the type I passed for `S`? |
19:48:56 | * | azimut quit (Remote host closed the connection) |
19:49:26 | * | azimut joined #nim |
20:05:12 | FromDiscord | <starkiller1493> How do you do pass formdata like files etc to Nim's HTTP client? (curl -F) |
20:47:02 | FromDiscord | <spotlightkid> https://nim-lang.org/docs/httpclient.html#using-http-post↵(@starkiller1493) |
21:09:42 | FromDiscord | <Saint> In reply to @sys64 "So I can't do": What editor is that btw? |
21:10:32 | FromDiscord | <graveflo> looks like vscode |
21:11:33 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Saint "What editor is that": Cursor |
21:13:56 | FromDiscord | <Saint> In reply to @sys64 "Cursor": Interesting, thank you! |
21:18:42 | FromDiscord | <System64 ~ Flandre Scarlet> You're welcome |
21:20:25 | FromDiscord | <taurusdaemon> speaking of IDEs, does anybody happen to know how the nim plugin for CLion is handled by the folks at Jetbrains? |
21:21:14 | FromDiscord | <taurusdaemon> I see that it has not received updates since January, it is not even compatible with the last couple IDE releases |
21:24:25 | FromDiscord | <graveflo> That was always totally broken for me. I think it is abandoned unfortunately |
21:26:22 | FromDiscord | <ieltan> Is it possible to have openArray default arguments? |
21:26:35 | FromDiscord | <ieltan> seems like i cant do it |
21:27:15 | FromDiscord | <graveflo> In reply to @taurusdaemon "speaking of IDEs, does": and as far as how things are "handled" over at jetbrains I'd say most of the time they simply aren't. There are regression bugs all over their products that have a lot of attention and have been broken for years. I think the plugin was just a small feature someone made and "support" isn't going to happen unless they whimsically decide to care about it. |
21:29:14 | FromDiscord | <graveflo> In reply to @ieltan "Is it possible to": I think `openArray` only really makes sense in relation to memory that has already been allocated. Like a `string` or `seq`. In this way a default parameter of this type doesn't make much sense |
21:29:59 | * | Jjp137 quit (Ping timeout: 240 seconds) |
21:31:29 | FromDiscord | <taurusdaemon> In reply to @graveflo "and as far as": That's unfortunate, I kinda like CLion, but vscodium+nim is not too bad |
21:33:17 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4yay |
21:33:37 | FromDiscord | <!&luke> In reply to @sys64 "Cursor": Can u send a link to where u got it, I can't find it |
21:33:48 | FromDiscord | <graveflo> In reply to @taurusdaemon "That's unfortunate, I kinda": It's not too bad. A little finicky but that's alright |
21:35:32 | FromDiscord | <taurusdaemon> What other alternatives are there for something non-terminal based? |
21:35:45 | FromDiscord | <graveflo> nada as far as I know |
21:37:07 | FromDiscord | <graveflo> I mean you can use a lang-server editor like kate but its basically going to be the same tooling |
22:00:50 | * | ntat quit (Quit: Leaving) |
22:05:38 | * | dza joined #nim |
22:28:29 | FromDiscord | <Elegantbeef> `$typeof(S)`↵(@michaelb.eth) |
22:28:47 | FromDiscord | <Elegantbeef> No they're not existent types make an overload without any↵(@ieltan) |
22:29:11 | FromDiscord | <Elegantbeef> Or just `$S` should work |
22:29:34 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "`$typeof(S)` (<@383034029135364096>)": yes, but, if my original type named `MyType` is `enum` then in the macro I end up with the string-name `enum` instead of `MyType` |
22:29:35 | FromDiscord | <Elegantbeef> ntat did you solve your xml woes? |
22:29:57 | FromDiscord | <Elegantbeef> Huh? |
22:30:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4yaG |
22:31:11 | FromDiscord | <Elegantbeef> Oh I didnt read macro |
22:32:59 | FromDiscord | <Elegantbeef> It's best to just supply them as a parameter really |
22:33:23 | FromDiscord | <Elegantbeef> Generic parameters do not really do what you want with macros |
22:33:23 | FromDiscord | <Elegantbeef> Passing in a typedesc achieves the same thing |
22:34:17 | FromDiscord | <michaelb.eth> that's what I went with, but in my case I also need the generic parameter because a parameter after the typedesc parameter needs to be of that type, which seems to work in procs but not in macro |
22:35:10 | FromDiscord | <elegantbeef> One day I won't have to swap to discord mid conversation |
22:35:14 | FromDiscord | <elegantbeef> What's the macro header? |
22:35:37 | FromDiscord | <huantian> i feel like the bridge is slowly getting worse rather than better lmao |
22:35:40 | FromDiscord | <Elegantbeef> What's the macro header? |
22:36:13 | FromDiscord | <elegantbeef> Losing pfps, delayed messages, dropped messages, it's really peak |
22:36:24 | FromDiscord | <elegantbeef> Ooh that was instant :d |
22:36:41 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4yaI |
22:36:42 | FromDiscord | <huantian> maybe we should try mautrix-discord |
22:37:06 | FromDiscord | <elegantbeef> That's a lot of typedescs |
22:37:08 | FromDiscord | <graveflo> whats wrong with regular discord? |
22:37:16 | FromDiscord | <elegantbeef> "regular discord"? |
22:37:27 | FromDiscord | <graveflo> ? |
22:37:32 | FromDiscord | <elegantbeef> I do not like proprietary software, I mostly only use discord cause my friends use it |
22:37:50 | FromDiscord | <graveflo> just run it in a browser. I doubt all the sites you go to are open source |
22:37:55 | FromDiscord | <huantian> In reply to @graveflo "whats wrong with regular": we're using matrix-appservice-discord rn |
22:38:02 | FromDiscord | <elegantbeef> How does that resolve anything |
22:38:07 | FromDiscord | <elegantbeef> Also I do not do webapps |
22:38:08 | FromDiscord | <elegantbeef> So... |
22:38:09 | FromDiscord | <huantian> (edit) "rn" => "rn, via t2bot i think" |
22:38:20 | FromDiscord | <elegantbeef> By that i mean I do not do in browser webapps |
22:38:29 | FromDiscord | <elegantbeef> Ok so to the real conversation |
22:38:50 | FromDiscord | <elegantbeef> You have a type constrained to 3 enum types eh? |
22:38:50 | FromDiscord | <huantian> (edit) "think" => "think↵I was suggesting to try mautrix-discord, a different discord matrix brdige" |
22:39:54 | FromDiscord | <elegantbeef> You do not use `S` anywhere so you can lose the `S: Enum` and just do `intial: enum` |
22:40:17 | FromDiscord | <elegantbeef> then inside the macro you should be able to do `initial.getTypeInst` |
22:40:25 | FromDiscord | <elegantbeef> So no more generic constraint there |
22:41:04 | FromDiscord | <elegantbeef> Since I'm crazy about tuples in generic programming, I'd suggest using a tuple instead of the three parameters, but that's just cause I'm off |
22:41:25 | FromDiscord | <elegantbeef> You write one ECS based on tuples, and a GUI based on tuples and then suddenly any generic seems like a tuple is better 😄 |
22:41:56 | FromDiscord | <elegantbeef> Huan is that bridge more recently updated? |
22:42:32 | FromDiscord | <elegantbeef> I still say I should work on the matrix API that tandy had, further develop it and make a bridge |
22:43:11 | FromDiscord | <elegantbeef> Fuck now discord's discord bridge has shit the bed, all these AI stopped talking to me |
22:45:29 | FromDiscord | <Invisible> Yeah I can't figure out how to run console commands in a app:gui without the cmd flickering |
22:46:11 | FromDiscord | <graveflo> is it flickering because the window is open for the command duration or does it become hidden while the subprocess is running? |
22:47:02 | FromDiscord | <Invisible> In reply to @graveflo "is it flickering because": Its open for the command's duration, im assuming. execCmdEx("whoami").output.strip() |
22:47:37 | FromDiscord | <Elegantbeef> use `osproc` and pass `poDaemon` |
22:47:42 | FromDiscord | <Elegantbeef> > poDaemon ## Windows\: The program creates no Window. |
22:47:43 | FromDiscord | <huantian> In reply to @elegantbeef "Huan is that bridge": I think so? not sure |
22:47:47 | FromDiscord | <huantian> In reply to @elegantbeef "I still say I": do it |
22:47:50 | FromDiscord | <Invisible> In reply to @Elegantbeef "use `osproc` and pass": as an option? |
22:47:52 | FromDiscord | <graveflo> yea so when you execute something in windows you have to give it startup flags to prevent a window from popping up. Usually the subprocess api has a way of controlling these flags |
22:48:01 | FromDiscord | <graveflo> what method are you using to call the subprocess? |
22:48:01 | FromDiscord | <Invisible> In reply to @graveflo "yea so when you": /c doesn't work |
22:48:10 | FromDiscord | <Invisible> In reply to @graveflo "what method are you": Im not using subproccesses |
22:48:11 | FromDiscord | <elegantbeef> Yes as option |
22:48:32 | FromDiscord | <elegantbeef> `execCmdEx("whoami", options = {poDaemon})` |
22:48:44 | FromDiscord | <graveflo> I'm not talking about the module a subprocess is a general concept |
22:48:46 | FromDiscord | <elegantbeef> probably also `poUsePath` or anything else you need |
22:49:11 | FromDiscord | <graveflo> and `cmd /c` just instructs cmd to open another /c and run the command |
22:49:22 | FromDiscord | <graveflo> (edit) "/c" => "cmd" |
22:49:38 | FromDiscord | <Invisible> In reply to @elegantbeef "`execCmdEx("whoami", options = {poDaemon})`": Thank you |
22:49:41 | FromDiscord | <Invisible> helped a ton 🙂 |
22:49:56 | FromDiscord | <Invisible> what does poDaemon do exactly? |
22:50:15 | FromDiscord | <Elegantbeef> Read the docs |
22:50:59 | FromDiscord | <Invisible> OK |
23:04:52 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4yaN |
23:30:40 | * | Jjp137 joined #nim |
23:35:07 | FromDiscord | <michaelb.eth> hmm, seems to be related to arc/orc vs. refc |
23:35:46 | FromDiscord | <michaelb.eth> with Nim devel, if I compile with `--mm:refc`, my code compiles as it did with Nim 1.6 |
23:36:41 | FromDiscord | <graveflo> I dont know for sure but Ive heard that `seq` underlying implementation can be different depending on `mm` setting and version. `NimSeqV2` clearly has some differences that broke your code |
23:36:57 | FromDiscord | <graveflo> the err msg says it has something to do with generics and casting |
23:37:32 | FromDiscord | <graveflo> like `ptr seq` |
23:38:27 | FromDiscord | <graveflo> or actually that might `ptr NimSeqV2` might be a regular `seq`... I don't like that detail but w/e |
23:38:57 | FromDiscord | <graveflo> (edit) "might" => "" |
23:40:39 | FromDiscord | <graveflo> to be clear I think this is just an issue of `refc` vs `arc/orc` compatibility |
23:41:45 | FromDiscord | <michaelb.eth> but what to do 😄 |
23:41:58 | FromDiscord | <graveflo> you didnt post enough info bud isk |
23:42:03 | FromDiscord | <graveflo> (edit) "isk" => "idk" |
23:43:01 | FromDiscord | <michaelb.eth> well I have a seq of object variant that involves generics, the approach works with refc, but if that's not possible with arc/orc then I'll have to change the way it works |
23:43:13 | FromDiscord | <michaelb.eth> maybe I needed a linked list instead of openArray / seq |
23:43:18 | FromDiscord | <michaelb.eth> (edit) "needed" => "need" |
23:44:20 | FromDiscord | <graveflo> what do you mean a seq object variant |
23:44:59 | * | jmdaemon joined #nim |
23:47:18 | FromDiscord | <michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4yaX |
23:48:00 | FromDiscord | <graveflo> and the actual line that is crashing? |
23:50:14 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4yaY |
23:54:04 | FromDiscord | <michaelb.eth> sent a code paste, see https://paste.rs/3Jcko |
23:55:00 | FromDiscord | <graveflo> yea thats probably what you are going to have to do |
23:56:49 | FromDiscord | <Invisible> Does Quit() in nimlang ignore try:except? |
23:56:58 | FromDiscord | <graveflo> the above works when you have the right enum. It just seems from your error that you are trying to cast / create (either implicitly or explicitly) a seq with a non-concrete type. There is a resolution problem. I've seen a rare bug in the resolution of generics like this but its prob a more obvious err |
23:58:01 | FromDiscord | <graveflo> In reply to @Invisible "Does Quit() in nimlang": except is only going to catch an exception. I am not sure if this proc raises a `CatchableError` but I doubt it |
23:58:14 | FromDiscord | <graveflo> try, finally on the other hand... maybe but you will just have to test it |
23:58:14 | FromDiscord | <Invisible> it says "quit with error" |
23:58:34 | FromDiscord | <graveflo> and error may be a return value. for example a program may exit with error code 1 to mean an error |
23:59:00 | FromDiscord | <graveflo> and error does not necessarily mean an exception and in nim not all exceptions are catchable even |