00:11:31 | FromDiscord | <ezquerra> In reply to @Elegantbeef "The readline implemented is": Is this something that can be changed? Or are there some backwards compatibility issues that make it impossible to change? |
00:12:05 | FromDiscord | <Elegantbeef> I dont even understand what it does |
00:12:05 | FromDiscord | <Elegantbeef> So your guess is as good as mine |
00:12:37 | FromDiscord | <ezquerra> In reply to @Elegantbeef "I dont even understand": Maybe @Araq can explain why it is so? |
00:14:14 | FromDiscord | <ezquerra> In reply to @Elegantbeef "I really should make": You really should! |
00:15:25 | FromDiscord | <Elegantbeef> Well the issue is I dont understand the mess that is the current `readLine` so I cannot make a PR that ensures compatibility, so a braver soul than I should |
00:19:07 | FromDiscord | <ChocolettePalette> I can make a PR if you write the code and explain me how to make a PR |
00:19:48 | FromDiscord | <ChocolettePalette> In case it fails I'll just say "oopsie woopsie" and everything will be ok |
00:41:10 | pbotfullerton | I mean, as long as readLine does what it says on the tin, how much compatibility could you lose if you keep the TTY-specific chunk of code? |
01:31:20 | pbotfullerton | Ah I finally remembered why I thought the `lines` iterator was slow, it's because I'm reading process output on Windows |
01:32:01 | pbotfullerton | And osproc implements its own FileHandleStream in this case which only implements the basic readData and writeData |
01:37:17 | * | lucerne quit (Read error: Connection reset by peer) |
01:44:36 | * | xet7 quit (Remote host closed the connection) |
01:46:25 | * | xet7 joined #nim |
02:09:02 | * | joast joined #nim |
03:29:10 | * | arkurious quit (Quit: Leaving) |
04:25:32 | pbotfullerton | https://play.nim-lang.org/#ix=4gC1 Wrote a lines iterator that uses BaseLexer for the underlying buffer management. Should work with any Stream but I've only tested it with osproc.OutputStream. |
05:30:37 | * | disso_peach joined #nim |
05:45:09 | NimEventer | New post on r/nim by mishokthearchitect: Telegram Bot in Nim, see https://reddit.com/r/nim/comments/z2gqdd/telegram_bot_in_nim/ |
06:31:27 | NimEventer | New post on r/nim by AetopiaMC: All `-d:` options for the Nim Compiler., see https://reddit.com/r/nim/comments/z2hmro/all_d_options_for_the_nim_compiler/ |
06:53:38 | * | tiorock joined #nim |
06:53:38 | * | tiorock quit (Changing host) |
06:53:38 | * | tiorock joined #nim |
06:53:38 | * | rockcavera is now known as Guest810 |
06:53:38 | * | Guest810 quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
06:53:38 | * | tiorock is now known as rockcavera |
07:24:14 | * | rockcavera quit (Remote host closed the connection) |
07:48:32 | * | PMunch joined #nim |
08:21:50 | * | Batzy_ joined #nim |
08:57:16 | * | Batzy_ is now known as Batzy |
09:40:35 | * | dza quit (Remote host closed the connection) |
10:01:21 | * | alice quit (Read error: Software caused connection abort) |
10:01:40 | * | alice joined #nim |
10:17:49 | * | crem quit (Read error: Software caused connection abort) |
10:18:08 | * | crem joined #nim |
10:41:37 | NimEventer | New thread by sls1005: What's the name for wchar?, see https://forum.nim-lang.org/t/9642 |
10:42:14 | * | dza joined #nim |
10:43:37 | NimEventer | New thread by miran: Nim 1.6.10 released, see https://forum.nim-lang.org/t/9643 |
11:00:28 | * | jjido joined #nim |
11:16:23 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
11:48:59 | FromDiscord | <ShalokShalom> In reply to @arkanoid "Basically I'm taking existing": How does Nimpy help you with the port? |
11:53:45 | FromDiscord | <arkanoid> Nimpy doesn't help with the port, nimpy just enables a very easy way to turn a nim module into a python module↵(@ShalokShalom) |
11:59:19 | FromDiscord | <ShalokShalom> Yeah. I read your comment the other way. |
12:13:46 | * | jjido joined #nim |
12:29:04 | * | jmdaemon quit (Ping timeout: 268 seconds) |
12:59:27 | * | pro joined #nim |
12:59:31 | * | pro left #nim (#nim) |
13:31:08 | * | derpydoo joined #nim |
14:00:29 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
14:31:18 | * | arkurious joined #nim |
14:34:50 | NimEventer | New thread by sls1005: Is it allowed to use dealloc instead of free?, see https://forum.nim-lang.org/t/9644 |
14:36:31 | FromDiscord | <ali> Nimpy looks sweet, am I right that you can write the same lib to be a python modile and a regular .so? |
14:37:22 | * | rockcavera joined #nim |
14:43:58 | * | PMunch quit (Quit: Leaving) |
15:02:29 | FromDiscord | <Evissim> Is there fancier way of calling a proc at runtime via a string matching it's name besides keeping them in a table? e.g. calling `abc()` from `"abc"` |
15:04:04 | FromDiscord | <Rika> not if you want to add procs on runtime |
15:05:37 | * | rockcavera quit (Remote host closed the connection) |
15:34:13 | FromDiscord | <demotomohiro> @Evissim You can embed nimscript to your program: https://github.com/beef331/nimscripter |
15:35:00 | FromDiscord | <Evissim> Oh that might be interesting, thanks! |
15:38:55 | * | ehmry quit (Ping timeout: 252 seconds) |
15:39:17 | * | ehmry joined #nim |
15:44:56 | * | ehmry quit (Ping timeout: 255 seconds) |
15:48:55 | FromDiscord | <vestel> Tbh its kinda hard to work with nimscript as embedded |
15:50:06 | FromDiscord | <vestel> I struggled with debugging scripts in the past because nimscripter adds some type and procs check (can't blame beef for that) so that messes up with line/col |
16:02:19 | NimEventer | New post on r/nim by miran1: Nim 1.6.10 released, see https://reddit.com/r/nim/comments/z2st99/nim_1610_released/ |
16:13:17 | FromDiscord | <ezquerra> @ElegantBeef, is there a way to use nimscripter to dynamically execute nimscript code? e.g. to implement a simple nimscripter REPL? |
16:19:14 | FromDiscord | <DarkSky> project ideas for beginners? |
16:26:22 | FromDiscord | <arkanoid> An operating system using COBOL as scripting language↵(@DarkSky) |
16:26:27 | FromDiscord | <tope> In reply to @DarkSky "project ideas for beginners?": note taking assistant? something that searches a directory tree (like `Notes`) for e.g. markdown files, maybe just search for some content/word as a first step -- but infinite possibilites exist in what direction to take that, with various degrees of effort: could eventually make it into something that can creates a website based on them, sort of like mdbook or similar, documentation-col |
16:28:40 | FromDiscord | <DarkSky> In reply to @tope "note taking assistant? something": Note taking assistant? I've done something simillar before. Maybe I'll try making a basic documentation template tool or something lol, thx |
16:28:43 | FromDiscord | <tope> but quick q: I have a ton of functions that are all generic over a static int & usually some type T e.g. `proc xxx[D: static[int], T, ..](...)`, is there a nice/idiomatic way to "abbreviate" that without the noise of [D: static[int], T] on every proc? |
16:28:46 | FromDiscord | <DarkSky> In reply to @arkanoid "An operating system using": whut 😳 |
16:31:59 | * | dnh joined #nim |
17:15:48 | FromDiscord | <Yepoleb> In reply to @DarkSky "project ideas for beginners?": Robot that kills babies |
17:23:19 | FromDiscord | <DarkSky> In reply to @Yepoleb "Robot that kills babies": hahahahaha |
17:34:31 | FromDiscord | <Horizon [She/Her]> In reply to @DarkSky "project ideas for beginners?": Maybe start with rock paper scissors? |
17:35:10 | FromDiscord | <Horizon [She/Her]> Then work on overengineering it the more you write it xD |
17:35:20 | FromDiscord | <Phytolizer> Enterprise RPS |
18:03:09 | * | ehmry joined #nim |
18:10:44 | * | ehmry quit (Ping timeout: 255 seconds) |
18:15:19 | * | derpydoo quit (Remote host closed the connection) |
18:17:26 | FromDiscord | <ShalokShalom> Ai assisted rock, paper, scissors |
18:17:31 | FromDiscord | <ShalokShalom> In VR |
18:20:43 | FromDiscord | <Horizon [She/Her]> Does Nim support use of it without libc? |
18:20:57 | FromDiscord | <Horizon [She/Her]> If so, what limits are placed with the inability to use libc? |
18:22:59 | Amun-Ra | no libc of any sort? |
18:23:57 | FromDiscord | <Horizon [She/Her]> Nope |
18:24:22 | * | dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:24:59 | Amun-Ra | there's --os=standalone and --passl=-nostdlib but that depends on what stuff from nim stdlib you need; some things you'd have to reimplement |
18:26:01 | Amun-Ra | no libc not stdin/stdout/etc… |
18:26:09 | Amun-Ra | s/not/no/ |
18:28:51 | FromDiscord | <Horizon [She/Her]> I'd be fine with reimplementing some stuff like basic stdin and stdout, but that'd come later on |
18:28:57 | FromDiscord | <Horizon [She/Her]> I'm exposing my own API so |
18:29:03 | FromDiscord | <Horizon [She/Her]> Thanks! |
18:29:39 | Amun-Ra | Horizon: check parts of https://hookrace.net/blog/nim-binary-size/ |
18:29:52 | Amun-Ra | it may not be up to spec anymore, ymmv |
18:33:50 | pbotfullerton | Is it possible to convert a JSON object with a field that may be either a string or an int to a Nim object? |
18:34:38 | Amun-Ra | have you looked at jsony? |
18:34:49 | * | Amun-Ra haven't used json with nim yet |
18:39:15 | pbotfullerton | jsony? Not yet but I will |
18:43:14 | pbotfullerton | Marking the field's type as a JsonNode works. If I can't figure out how to get the `to` macro to convert a node into a custom variant that only has int and string fields, at least I have a backup plan |
18:44:21 | * | jjido joined #nim |
18:51:21 | * | rockcavera joined #nim |
19:11:33 | FromDiscord | <jmgomez> In reply to @pbotfullerton "Marking the field's type": is your destiny type kwon? if so you could just add a hook to it |
19:12:31 | * | ehmry joined #nim |
19:14:55 | pbotfullerton | Yes, I just finished figuring out how to overload `%` and `initFromJson` for the custom variant |
19:15:17 | FromDiscord | <voidwalker> @DarkSky how beginner we are talking about ? |
19:16:01 | FromDiscord | <voidwalker> I'm trying to write a super basic torrent client as beginner project |
19:21:02 | * | dnh joined #nim |
19:58:14 | * | kenran joined #nim |
19:58:49 | * | kenran quit (Remote host closed the connection) |
20:05:49 | FromDiscord | <vestel> How do I call destructor explicitly? |
20:19:19 | FromDiscord | <planetis> `=destroy`(x) |
20:19:38 | FromDiscord | <planetis> (edit) "`=destroy`(x)" => "sent a code paste, see https://play.nim-lang.org/#ix=" |
20:19:50 | FromDiscord | <planetis> (edit) |
20:30:50 | * | krux02_ joined #nim |
20:32:10 | FromDiscord | <DarkSky> In reply to @voidwalker "I'm trying to write": actually i might try doing that |
20:32:35 | FromDiscord | <DarkSky> In reply to @voidwalker "<@827210734994718721> how beginner we": well i have done some things in C and Python. but im completely new with Nim |
20:32:43 | FromDiscord | <voidwalker> it's a good project, uses a bit of everything, algorithms, data structures, network protocols, async sockets/io etc |
20:32:55 | FromDiscord | <DarkSky> yee |
20:33:04 | FromDiscord | <DarkSky> i kind of hate the way i have to learn Nim though |
20:33:04 | FromDiscord | <voidwalker> not too hard to be out of reach, not too simple to not be challenging |
20:33:31 | FromDiscord | <DarkSky> the structure of the docs is pretty bad IMO |
20:33:43 | FromDiscord | <DarkSky> and there's not that many other resources online |
20:33:53 | FromDiscord | <DarkSky> since its not that much of a popular language |
20:34:05 | FromDiscord | <voidwalker> It's not ideal, indeed. Could be better. |
20:34:33 | FromDiscord | <voidwalker> Maybe good for advanced programmers in other languages. But for beginner coders, not ideal. |
20:35:05 | * | ehmry quit (Ping timeout: 260 seconds) |
20:35:38 | FromDiscord | <DarkSky> yed exactly |
20:43:18 | madprops | do params in commandLineParams get stripped? like " == " turned into "==" ? |
20:59:07 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gGw |
20:59:26 | FromDiscord | <voidwalker> there is one extra space there for some reason, in the binary file path |
20:59:54 | FromDiscord | <voidwalker> using vscodium, any idea what's going on ? |
21:01:09 | * | xet7 quit (Remote host closed the connection) |
21:01:43 | FromDiscord | <Elegantbeef> Odd, are you certain you wrote it verbatim? |
21:02:57 | FromDiscord | <voidwalker> wrote what verbatim ? I just hit f6 to run |
21:03:07 | FromDiscord | <Elegantbeef> I mean what you wrote here |
21:03:38 | FromDiscord | <Elegantbeef> Oh wait you ran a single file |
21:03:59 | FromDiscord | <Elegantbeef> No clue why you get that message |
21:04:08 | FromDiscord | <Elegantbeef> are you supposed to supply a file to bencode? |
21:04:31 | * | xet7 joined #nim |
21:04:51 | FromDiscord | <Elegantbeef> https://github.com/z-------------/nim-bencode/blob/master/src/bencode.nim#L5-L32 yea you're |
21:06:05 | FromDiscord | <voidwalker> https://media.discordapp.net/attachments/371759389889003532/1045082836023128194/image.png |
21:06:18 | FromDiscord | <Elegantbeef> Yes that's the program |
21:06:19 | FromDiscord | <voidwalker> oh damn, silly me : D |
21:06:29 | FromDiscord | <voidwalker> I forgot it runs as a separate program.. I wanted to use it as a lib |
21:06:41 | FromDiscord | <voidwalker> (edit) "runs" => "can run" |
21:09:18 | FromDiscord | <voidwalker> There's like 5 different bencode libraries. Most are not in nimble dir, some don't work properly, some are not implemented efficiently, one has ancient code, and so on :\ |
21:23:46 | FromDiscord | <voidwalker> Mind taking a look at this code and give review ? https://github.com/z-------------/nim-bencode/blob/master/src/bencodepkg/core.nim |
21:25:48 | FromDiscord | <Elegantbeef> Seems fine |
21:28:52 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gGE |
21:29:07 | FromDiscord | <voidwalker> so it encapsulates the string in bkStr type of BencodeObj |
21:31:36 | * | ehmry joined #nim |
21:32:11 | FromDiscord | <voidwalker> this kind of bugs me as unnecessary, a bit of overhead. also to acces a dict element I have to do `dict[Bencode("string")]` rather than just `dict["string"]` |
21:32:13 | FromDiscord | <voidwalker> what do you think ? |
21:32:41 | FromDiscord | <Elegantbeef> If there is no reason to use BencodeObj use a string |
21:34:33 | FromDiscord | <voidwalker> only benefit I can see is, it checks if the bencoded string actually has a string as key for the dict structure: ` assert k.kind == bkStr` |
21:48:36 | * | LuxuryMode joined #nim |
21:50:29 | FromDiscord | <Cheesy Brik> how can I loop over 2 sequences at once, essentially the zip func from python. |
21:51:59 | FromDiscord | <ali> sequtils has proc `zip[S, T](s1: openArray[S]; s2: openArray[T]): seq[(S, T)]`↵(@Cheesy Brik) |
21:52:14 | FromDiscord | <Cheesy Brik> Ok nice thx |
21:53:03 | FromDiscord | <Cheesy Brik> Man nim constantly makes itself feel like python without all the python fluff and slowdown |
21:53:48 | FromDiscord | <amadan> Wonder why it isn't an iterator though 🤔 |
21:54:26 | FromDiscord | <Cheesy Brik> In reply to @amadan "Wonder why it isn't": Probably a general purpose thing, you don't always use this type of function in a for loop. |
21:57:51 | FromDiscord | <amadan> sent a code paste, see https://play.nim-lang.org/#ix=4gGJ |
21:58:21 | FromDiscord | <Phytolizer> In reply to @Cheesy Brik "Probably a general purpose": It'd be neat if it was an option though since you have toSeq in the same module |
21:59:00 | FromDiscord | <Cheesy Brik> In reply to @Phytolizer "It'd be neat if": True, maybe suggest it or add it yourself? There's pros to an open source language :) |
21:59:28 | FromDiscord | <Phytolizer> I'm considering doing that yeah, I just made my first contribution to nim this week |
22:01:01 | FromDiscord | <Cheesy Brik> Nice, also thank god sequtils uses the ``seq.join(string)`` format instead of pythons awful ``string.join(seq)`` |
22:01:20 | FromDiscord | <Phytolizer> Yes that makes zero sense in python lol |
22:01:42 | FromDiscord | <Phytolizer> And if you don't like it you can just write a template anyway :) |
22:01:55 | FromDiscord | <Cheesy Brik> (edit) "sequtils" => "strctutils" |
22:02:20 | FromDiscord | <Cheesy Brik> God nim really puts so much power in the programmers hands without making it over obtuse |
22:03:26 | FromDiscord | <Phytolizer> I'm spoiled by it lol, then I have to go maintain a bash script at work and I miss it |
22:07:01 | FromDiscord | <nixfreak> Trying to understand how this works in a proc `` so proc `` , trying to find more examples of this |
22:07:14 | FromDiscord | <Elegantbeef> What? |
22:07:20 | FromDiscord | <nixfreak> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1045098170553729045): Trying to understand how this works in a proc "``" so proc "``" , trying to find more examples of this |
22:07:41 | FromDiscord | <nixfreak> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1045098170553729045): Trying to understand how this works in a proc `` so proc `` , trying to find more examples of this |
22:07:42 | FromDiscord | <Phytolizer> Are you talking about a proc literally called ? |
22:08:02 | FromDiscord | <nixfreak> ahh no back ticks won't work |
22:08:16 | FromDiscord | <Elegantbeef> You have a `` operator |
22:08:41 | FromDiscord | <nixfreak> or any operator that uses back ticks , what is it called |
22:08:46 | FromDiscord | <Elegantbeef> If it has one parameter it's a prefix `myArgument` if it has 2 arguments it's an infix so it's `arg1 arg2` |
22:08:50 | FromDiscord | <Elegantbeef> That's called lexical stropping |
22:09:46 | FromDiscord | <nixfreak> sent a long message, see http://ix.io/4gGL |
22:10:07 | FromDiscord | <nixfreak> There we go |
22:10:13 | FromDiscord | <Phytolizer> In reply to @nixfreak "or any operator that": In general any combo of operator characters can be defined |
22:10:14 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#syntax-precedence |
22:11:54 | FromDiscord | <nixfreak> Ok just trying to wrap my head around why you would and when you would use stooping in proc |
22:12:11 | FromDiscord | <Phytolizer> To define your own operators or overload existing ones |
22:12:21 | FromDiscord | <Cheesy Brik> I'm getting an index out of bounds when indexing a sequence, only problem is I can echo the index just fine I just can't assign it? |
22:12:32 | FromDiscord | <Elegantbeef> Code↵(@Cheesy Brik) |
22:14:30 | FromDiscord | <Cheesy Brik> sent a code paste, see https://play.nim-lang.org/#ix=4gGO |
22:15:10 | FromDiscord | <Elegantbeef> People write funny code |
22:15:22 | FromDiscord | <Cheesy Brik> I am aware, I do it a lot |
22:15:32 | FromDiscord | <Elegantbeef> `i.split("=")[1]` will not always work |
22:15:49 | FromDiscord | <Cheesy Brik> how so |
22:16:04 | FromDiscord | <Elegantbeef> if you have an empty line |
22:17:14 | FromDiscord | <Cheesy Brik> No it's not the evaluation itself, because again, when I echo the exact same thing, it works fine, but when doing anything else it throws an index out of bounds error |
22:17:46 | FromDiscord | <Elegantbeef> Well where does it error |
22:17:53 | FromDiscord | <Elegantbeef> The stack trace will tell you exactly where |
22:18:10 | FromDiscord | <Cheesy Brik> Nvm, I just found a blank line at the end of the file, you were right thanks :) |
22:18:44 | FromDiscord | <Elegantbeef> Now do you want the secret to doing this cleaner? |
22:20:14 | FromDiscord | <Cheesy Brik> What is it |
22:21:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gGP |
22:24:36 | FromDiscord | <Cheesy Brik> whats the command to compile a production version of my nim file? |
22:24:59 | FromDiscord | <Elegantbeef> `-d:release` |
22:53:01 | FromDiscord | <Cheesy Brik> Anyone else use fyracode? I adore it. |
22:53:15 | FromDiscord | <Cheesy Brik> (edit) "fyracode?" => "firacode?" |
22:53:20 | FromDiscord | <Elegantbeef> I used to use firacode but now use isoevka |
22:53:24 | FromDiscord | <Elegantbeef> iosevka even |
22:53:28 | FromDiscord | <nixfreak> result = default(T) , does that mean T doesn't have any side effects? |
22:53:47 | FromDiscord | <Elegantbeef> What? |
22:53:59 | FromDiscord | <Elegantbeef> `default(T)` returns a 0'd form of `T` in stable |
22:55:21 | FromDiscord | <nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4gGX |
22:56:33 | FromDiscord | <nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4gGY |
22:59:02 | * | jmdaemon joined #nim |
23:03:04 | FromDiscord | <Cheesy Brik> how to check if a directory exists (and then loop through that directory) |
23:16:23 | FromDiscord | <ali> std/os has an iterator walkDir↵(@Cheesy Brik) |
23:16:46 | FromDiscord | <Cheesy Brik> so just check if walkDir isn't nil? |
23:18:16 | FromDiscord | <ali> There's also dirExists, @Cheesy Brik but have a look at the docs I think there is a way to tell if it exists from walkDir |
23:18:41 | FromDiscord | <ali> Ah here we go, `iterator walkDir(dir: string; relative = false; checkDir = false): tuple[ kind: PathComponent, path: string] {.....}`↵If checkDir is true, OSError is raised when dir doesn't exist. |
23:51:51 | FromDiscord | <ali> Using threadpool, seems like sometimes threads never sync. |
23:54:19 | FromDiscord | <Cheesy Brik> Anyone else love to put on those like 5 hour long youtube videos and just code? |
23:54:35 | FromDiscord | <ali> Star Trek TNG for me |
23:55:19 | FromDiscord | <Cheesy Brik> Fair, I also like to just go mining in minecraft whenever I'm on my annual minecraft kick. |