| 00:01:31 | * | beholders_eye quit (Ping timeout: 264 seconds) |
| 00:19:19 | * | tanami quit (Ping timeout: 240 seconds) |
| 00:19:35 | * | mahlon joined #nim |
| 00:24:24 | FromDiscord | <_bluecapybara> In reply to @mjsdev "I want a back-end": What about using [dynamic libraries](https://nim-lang.org/docs/dynlib.html) ? If you build the responses of your backend as modules that are loaded dynamically, I believe you could manage to get what you want. Yes, the modules would need to be compiled, but you could load and unload them at runtime, without shutting down your backend |
| 00:52:50 | FromDiscord | <mjsdev> I mean, that seems like an OKish solution with a ton of overhead for dev setup and ops... I think the approach I'm taking is working pretty well, thus far, maybe I'll hit some giant roadblock, but I think I'm already over most of them. |
| 00:53:14 | FromDiscord | <mjsdev> And IMO, this just offers the most flexibility and improved developer experience. |
| 00:53:58 | FromDiscord | <mjsdev> particularly when the language itself is as simple as it is (and depending how close I can keep it to nim itself). |
| 00:57:02 | FromDiscord | <mjsdev> sent a code paste, see https://play.nim-lang.org/#pasty=pjWFFCnU |
| 01:06:15 | * | tanami joined #nim |
| 01:07:54 | FromDiscord | <_bluecapybara> In reply to @mjsdev "And I already got": Why not a [Lisp](https://en.wikipedia.org/wiki/Lisp_(programming_language)#:~:text=Full%20language%20available%20at%20load%20time%2C%20compile%20time%2C%20and%20run%20time) dialect then? |
| 01:09:59 | FromDiscord | <mjsdev> y tho? |
| 01:12:25 | FromDiscord | <_bluecapybara> In reply to @mjsdev "y tho?": Given that you are implementing a language to be interpreted at runtime. Lisp (and it's dialects) provide this feature, You can test it on software made in this language, like Emacs and Nyx (the browser) |
| 01:13:00 | FromDiscord | <mjsdev> Sure, are there simpler ways to interface with it and eval it in nim? |
| 01:13:18 | FromDiscord | <mjsdev> I mean, from what I've seen of lisp, it looks pretty terrible and unreadable. |
| 01:13:42 | FromDiscord | <mjsdev> And to be clear, I looked into nimpy, quickjs4nim, nimLUA, etc... |
| 01:13:56 | FromDiscord | <mjsdev> So it's not like I didn't research or try other options |
| 01:14:31 | FromDiscord | <_bluecapybara> In reply to @mjsdev "I mean, from what": Yeah, it's not the best, but I wanted to check if you already considered it as an alternative, given that Nim's metaprogramming works only at compile-time (for safety reasons, it's a feature) |
| 01:15:01 | FromDiscord | <mjsdev> this doesn't rely on nim's meta programming at runtime. |
| 01:15:31 | FromDiscord | <mjsdev> I'm writing a tokenizer/parser to eval the strings, the only meta programming relied upon is for compiling that tokenizer/parser. |
| 01:17:47 | FromDiscord | <_bluecapybara> In reply to @mjsdev "this doesn't rely on": But you want to extend your program at runtime, which requires some degree of metaprogramming, unless you stick to interpret another language, and for this there are other solutions too, like [JS](https://bellard.org/quickjs/) |
| 01:18:02 | FromDiscord | <mjsdev> I looked at JS |
| 01:18:19 | FromDiscord | <mjsdev> Found bellard, which looked better, though it still suggests a work in progress |
| 01:18:34 | FromDiscord | <mjsdev> also, it would offer far more language functionality than I want here |
| 01:18:49 | FromDiscord | <mjsdev> That's the quickjs4nim stuff |
| 01:20:44 | FromDiscord | <mjsdev> sent a code paste, see https://play.nim-lang.org/#pasty=bHrrRPvJ |
| 01:20:47 | FromDiscord | <mjsdev> buwhahaha |
| 01:21:29 | FromDiscord | <_bluecapybara> In reply to @mjsdev "also, it would offer": I understand. Good luck on the project then, it looks like it's about to be finished 👌 🔥 |
| 01:22:41 | FromDiscord | <mjsdev> Not sure about finished, but definitely going pretty quick right now. Few more node types to handle, some cleanup on the binary operators... implementing unary operators, then figuring out what I want it to mean when you multiply a string by an integer |
| 01:22:56 | FromDiscord | <mjsdev> I'm thinking it should return an array of that many size |
| 01:23:10 | FromDiscord | <mjsdev> "foo" 3 == ["foo", "foo", "foo"] |
| 01:23:31 | FromDiscord | <mjsdev> Whereas "foo" / 1 == ["f", "o", "o"] |
| 01:23:32 | FromDiscord | <mjsdev> 😛 |
| 01:25:31 | FromDiscord | <mjsdev> except if the string looks like a number of course |
| 01:25:33 | FromDiscord | <mjsdev> 😛 |
| 01:29:33 | FromDiscord | <mjsdev> If anyone is curious to see what the code for this looks like. The evaluation support is here: https://github.com/mattsah/mininim-core/blob/main/src/mininim/script.nim↵↵The dynamic stuff is here: https://github.com/mattsah/mininim-core/blob/main/src/mininim/dyn.nim |
| 01:39:21 | FromDiscord | <mjsdev> The way more difficult part is going to be figuring out how to enable function registration and calling. |
| 01:40:20 | FromDiscord | <Elegantbeef> You do the same any language does and add a field with the procedure then `a.procedure()` turns into `a.procedure(a)` |
| 01:42:19 | * | rockcavera joined #nim |
| 01:43:13 | FromDiscord | <Robyn [She/Her]> safety? it's nothing to do with safety, and all to do with the metaprogramming happening at comptime↵(@_bluecapybara) |
| 01:44:29 | FromDiscord | <Robyn [She/Her]> how about nimpk?↵(@mjsdev) |
| 01:44:37 | FromDiscord | <Robyn [She/Her]> binds to pocketlang |
| 01:48:04 | * | SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev) |
| 01:50:04 | * | SchweinDeBurg joined #nim |
| 01:51:02 | FromDiscord | <_bluecapybara> In reply to @Robyn "safety? it's nothing to": I mean, I believed that it was to avoid runtime errors produced by runtime modification of the code, and to enforce type safety on macros, but I understand if I was wrong about this, sorry |
| 01:53:04 | FromDiscord | <_bluecapybara> In reply to @Robyn "how about nimpk? (<@153300788976812032>)": He already provided [his project](https://github.com/mattsah/mininim), I believe is the best alternative given what he strives to achieve |
| 02:10:23 | * | syl_ joined #nim |
| 02:11:41 | * | void09_ joined #nim |
| 02:12:01 | * | redj_ joined #nim |
| 02:12:44 | * | Jhonny2x1 joined #nim |
| 02:17:23 | * | przmk quit (*.net *.split) |
| 02:17:23 | * | syl quit (*.net *.split) |
| 02:17:23 | * | cornfeedhobo quit (*.net *.split) |
| 02:17:23 | * | zero` quit (*.net *.split) |
| 02:17:23 | * | redj quit (*.net *.split) |
| 02:17:23 | * | johuck quit (*.net *.split) |
| 02:17:23 | * | tmpod quit (*.net *.split) |
| 02:17:23 | * | mronetwo quit (*.net *.split) |
| 02:17:23 | * | Freneticks quit (*.net *.split) |
| 02:17:23 | * | noeontheend quit (*.net *.split) |
| 02:17:24 | * | kasimir_ quit (*.net *.split) |
| 02:17:24 | * | Jhonny2x4 quit (*.net *.split) |
| 02:17:24 | * | void09 quit (*.net *.split) |
| 02:17:24 | * | nisstyre quit (*.net *.split) |
| 02:22:48 | * | cornfeedhobo joined #nim |
| 03:56:07 | * | void09_ is now known as void09 |
| 04:27:38 | FromDiscord | <mjsdev> In reply to @Robyn "how about nimpk? (<@153300788976812032>)": Closest I've seen, and did not come up in search although I still worry about embedding another comprehensive language as opposed to just something to handle simple expressions. |
| 05:01:53 | FromDiscord | <.somechump> Which channel is most appropriate for me to post in to get help learning Nim? 🙂 |
| 05:02:52 | FromDiscord | <leorize> you are already in it |
| 05:03:22 | FromDiscord | <.somechump> Sick. Ty. |
| 05:04:13 | FromDiscord | <.somechump> I just built a simple CLI calculator that works, but I want to incorporate functions or procs? I'm a little confused on that. |
| 05:39:43 | FromDiscord | <janakali> In reply to @.somechump "I just built a": `proc` is default, use `func` if you want more functional style (no mutating global state) |
| 05:40:18 | FromDiscord | <.somechump> I have been playing with proc and am getting it to work! 😄 I'm a noob, so I'm not sure when a mutating global state is. |
| 05:40:22 | FromDiscord | <.somechump> I may have to google that one. |
| 05:40:25 | FromDiscord | <.somechump> Thank you for the response./ |
| 05:44:11 | FromDiscord | <.somechump> I am declaring my variables at the very top of my code, directly below my import. Should I be declaring them inside my main proc at the top? |
| 05:47:16 | FromDiscord | <janakali> In reply to @.somechump "I have been playing": mutating = changing↵global state = variables outside of function, except if they're passed to function as arguments (in case of Nim) |
| 05:48:26 | FromDiscord | <janakali> In reply to @.somechump "I am declaring my": it depends, for simple one file scripts it's probably fine↵if you're writing something bigger, global variables are frowned upon |
| 05:49:02 | FromDiscord | <.somechump> Thanks, buddy! |
| 05:53:28 | FromDiscord | <.somechump> I guess sequences are just Nim's version of a list? |
| 05:56:47 | * | mronetwo joined #nim |
| 05:56:48 | * | tmpod joined #nim |
| 05:56:49 | * | noeontheend joined #nim |
| 06:27:29 | FromDiscord | <.somechump> sent a code paste, see https://play.nim-lang.org/#pasty=nnuzwKPg |
| 07:01:44 | * | tiorock joined #nim |
| 07:01:44 | * | tiorock quit (Changing host) |
| 07:01:44 | * | tiorock joined #nim |
| 07:01:44 | * | rockcavera is now known as Guest8118 |
| 07:01:44 | * | Guest8118 quit (Killed (zirconium.libera.chat (Nickname regained by services))) |
| 07:01:44 | * | tiorock is now known as rockcavera |
| 07:53:55 | FromDiscord | <kiloneie> Your indentation is obscene, and against the Nim's style guide. 2 spaces, not 5 or what you have. |
| 07:55:19 | * | hygo quit (Ping timeout: 240 seconds) |
| 08:16:39 | FromDiscord | <.somechump> In reply to @kiloneie "Your indentation is obscene,": Huh? |
| 08:16:58 | FromDiscord | <.somechump> I'm using VSCode's built-in indentation I think? |
| 08:17:46 | FromDiscord | <.somechump> It seems to be 4. |
| 08:19:44 | FromDiscord | <lainlaylie> if vscode defaults to 4 then vscode is wrong, the correct default indentation is 2 spaces |
| 08:20:05 | FromDiscord | <.somechump> Yeah, it was set to 4. |
| 08:23:29 | FromDiscord | <lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=UxZFURvX |
| 08:24:09 | FromDiscord | <Elegantbeef> @lainlaylieIncorect the correct is 1 |
| 08:24:21 | FromDiscord | <lainlaylie> crap ive been doing it wrong this whole time |
| 08:24:26 | FromDiscord | <lainlaylie> time to update all my code |
| 08:24:44 | FromDiscord | <Elegantbeef> Think of it as institutional security |
| 08:26:00 | FromDiscord | <.somechump> I'm trying to update my code with 2 spaces, but it's not nice to me. |
| 08:30:44 | FromDiscord | <.somechump> What are you guys using to code with? NeoVim? |
| 08:35:43 | FromDiscord | <Jack S.> Kakoune.↵(@.somechump) |
| 08:37:20 | FromDiscord | <.somechump> sent a code paste, see https://play.nim-lang.org/#pasty=hszWnIze |
| 08:38:17 | FromDiscord | <.somechump> In reply to @Jack S. "Kakoune. (<@247784691774652418>)": Would you suggest that for a beginner? |
| 08:43:35 | FromDiscord | <.somechump> sent a code paste, see https://play.nim-lang.org/#pasty=ULIjrPhH |
| 08:46:22 | FromDiscord | <lainlaylie> cpuChoice should probably be an enum |
| 08:49:18 | FromDiscord | <lainlaylie> there's a more succinct way to express the outcome logic than a repetitive if statement |
| 08:55:55 | FromDiscord | <.somechump> I don't know what enums are yet. |
| 08:57:23 | FromDiscord | <.somechump> You used camel case instead of snake case when replying. Is camel the way to go with Nim? |
| 09:00:35 | FromDiscord | <lainlaylie> some disagree but yes |
| 09:01:30 | FromDiscord | <.somechump> @lainlaylie https://youtu.be/TO-2DErkmus?si=uJvHlbnrhxHZ5FgO |
| 09:01:36 | FromDiscord | <lainlaylie> if you make a type Choice = enum you can use parseEnum to get the player input and also do `rand(Choice)` for cpuChoice |
| 09:03:06 | FromDiscord | <.somechump> In reply to @lainlaylie "if you make a": I don't understand this, but thank you for replying. |
| 09:09:57 | FromDiscord | <lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=JUeBAAuE |
| 09:16:57 | FromDiscord | <.somechump> sent a code paste, see https://play.nim-lang.org/#pasty=BKFOdTos |
| 10:27:53 | FromDiscord | <aethrvmn> I kneel |
| 10:29:54 | FromDiscord | <aethrvmn> sent a code paste, see https://play.nim-lang.org/#pasty=HySpVoff |
| 10:32:03 | FromDiscord | <aethrvmn> Btw, is there a way to stream the output from execCmd? Rn I have it↵let (output, exitCode) = execCmdEx(cmd)↵echo output↵Which just vomits the entire output at once after the command is done running |
| 10:32:19 | FromDiscord | <aethrvmn> sent a code paste, see https://play.nim-lang.org/#pasty=RGRxyxzj |
| 10:33:12 | FromDiscord | <lainlaylie> if you use startProcess you can get outputStream, errorStream, and inputStream from the returned Process |
| 10:34:13 | FromDiscord | <lainlaylie> startProcess along with execProcess are also the only APIs that let you safely pass arguments as an array... |
| 10:57:53 | FromDiscord | <aethrvmn> Ok perfect |
| 10:58:03 | FromDiscord | <aethrvmn> Thanks |
| 12:05:12 | FromDiscord | <tauruuuuuus> Does anyone know if slicing an array always allocates? |
| 12:41:50 | * | beholders_eye joined #nim |
| 12:43:56 | FromDiscord | <tauruuuuuus> I got the answer and it's yes lol |
| 12:44:42 | * | hygo joined #nim |
| 12:57:31 | FromDiscord | <lainlaylie> yes because slicing returns a seq |
| 12:57:52 | FromDiscord | <lainlaylie> you can sometimes use toOpenArray to get a non allocating view |
| 16:20:52 | Amun-Ra | LHS slices do not allocate |
| 16:41:42 | * | kasimir_ joined #nim |
| 16:41:50 | * | johuck joined #nim |
| 16:41:54 | * | Freneticks joined #nim |
| 16:41:56 | * | przmk joined #nim |
| 16:53:01 | * | zero` joined #nim |
| 16:56:38 | * | nisstyre joined #nim |
| 16:58:47 | * | derpydoo joined #nim |
| 17:21:43 | * | om3ga joined #nim |
| 17:51:01 | * | beholders_eye quit (Ping timeout: 246 seconds) |
| 17:53:05 | * | beholders_eye joined #nim |
| 17:58:36 | * | derpydoo quit (Quit: derpydoo) |
| 18:14:53 | FromDiscord | <tauruuuuuus> I was passing this to a proc, turns out to_open_array was exactly what I needed |
| 18:45:52 | * | ftajhii quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 18:56:59 | * | ftajhii joined #nim |
| 21:00:44 | FromDiscord | <thedev0398> https://discord.gg/k6HVqE5H |
| 21:08:12 | FromDiscord | <Robyn [She/Her]> In reply to @thedev0398 "https://discord.gg/k6HVqE5H": hey, self-advertisement ain't welcome here :p |
| 21:08:29 | FromDiscord | <Robyn [She/Her]> it wasn't relevant to the convo at all, so... |
| 21:09:49 | FromDiscord | <thedev0398> In reply to @battery.acid.bubblegum "hey, self-advertisement ain't welcome": Ok bro but it's a server for programming do you want to delete it ? |
| 21:33:00 | FromDiscord | <Robyn [She/Her]> In reply to @thedev0398 "Ok bro but it's": you should probably delete the message yeah, but I'm not a moderator 🤷♀️ |
| 21:33:46 | FromDiscord | <thedev0398> In reply to @battery.acid.bubblegum "you should probably delete": Ok thanks |
| 22:00:00 | * | beholders_eye quit (Quit: WeeChat 4.6.3) |
| 23:24:58 | * | beholders_eye joined #nim |