<< 23-11-2022 >>

00:11:31FromDiscord<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:05FromDiscord<Elegantbeef> I dont even understand what it does
00:12:05FromDiscord<Elegantbeef> So your guess is as good as mine
00:12:37FromDiscord<ezquerra> In reply to @Elegantbeef "I dont even understand": Maybe @Araq can explain why it is so?
00:14:14FromDiscord<ezquerra> In reply to @Elegantbeef "I really should make": You really should!
00:15:25FromDiscord<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:07FromDiscord<ChocolettePalette> I can make a PR if you write the code and explain me how to make a PR
00:19:48FromDiscord<ChocolettePalette> In case it fails I'll just say "oopsie woopsie" and everything will be ok
00:41:10pbotfullertonI 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:20pbotfullertonAh I finally remembered why I thought the `lines` iterator was slow, it's because I'm reading process output on Windows
01:32:01pbotfullertonAnd 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:32pbotfullertonhttps://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:09NimEventerNew post on r/nim by mishokthearchitect: Telegram Bot in Nim, see https://reddit.com/r/nim/comments/z2gqdd/telegram_bot_in_nim/
06:31:27NimEventerNew 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:37NimEventerNew 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:37NimEventerNew 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:59FromDiscord<ShalokShalom> In reply to @arkanoid "Basically I'm taking existing": How does Nimpy help you with the port?
11:53:45FromDiscord<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:19FromDiscord<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:50NimEventerNew thread by sls1005: Is it allowed to use dealloc instead of free?, see https://forum.nim-lang.org/t/9644
14:36:31FromDiscord<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:29FromDiscord<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:04FromDiscord<Rika> not if you want to add procs on runtime
15:05:37*rockcavera quit (Remote host closed the connection)
15:34:13FromDiscord<demotomohiro> @Evissim You can embed nimscript to your program: https://github.com/beef331/nimscripter
15:35:00FromDiscord<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:55FromDiscord<vestel> Tbh its kinda hard to work with nimscript as embedded
15:50:06FromDiscord<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:19NimEventerNew post on r/nim by miran1: Nim 1.6.10 released, see https://reddit.com/r/nim/comments/z2st99/nim_1610_released/
16:13:17FromDiscord<ezquerra> @ElegantBeef, is there a way to use nimscripter to dynamically execute nimscript code? e.g. to implement a simple nimscripter REPL?
16:19:14FromDiscord<DarkSky> project ideas for beginners?
16:26:22FromDiscord<arkanoid> An operating system using COBOL as scripting language↵(@DarkSky)
16:26:27FromDiscord<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:40FromDiscord<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:43FromDiscord<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:46FromDiscord<DarkSky> In reply to @arkanoid "An operating system using": whut 😳
16:31:59*dnh joined #nim
17:15:48FromDiscord<Yepoleb> In reply to @DarkSky "project ideas for beginners?": Robot that kills babies
17:23:19FromDiscord<DarkSky> In reply to @Yepoleb "Robot that kills babies": hahahahaha
17:34:31FromDiscord<Horizon [She/Her]> In reply to @DarkSky "project ideas for beginners?": Maybe start with rock paper scissors?
17:35:10FromDiscord<Horizon [She/Her]> Then work on overengineering it the more you write it xD
17:35:20FromDiscord<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:26FromDiscord<ShalokShalom> Ai assisted rock, paper, scissors
18:17:31FromDiscord<ShalokShalom> In VR
18:20:43FromDiscord<Horizon [She/Her]> Does Nim support use of it without libc?
18:20:57FromDiscord<Horizon [She/Her]> If so, what limits are placed with the inability to use libc?
18:22:59Amun-Rano libc of any sort?
18:23:57FromDiscord<Horizon [She/Her]> Nope
18:24:22*dnh quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:24:59Amun-Rathere'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:01Amun-Rano libc not stdin/stdout/etc…
18:28:51FromDiscord<Horizon [She/Her]> I'd be fine with reimplementing some stuff like basic stdin and stdout, but that'd come later on
18:28:57FromDiscord<Horizon [She/Her]> I'm exposing my own API so
18:29:03FromDiscord<Horizon [She/Her]> Thanks!
18:29:39Amun-RaHorizon: check parts of https://hookrace.net/blog/nim-binary-size/
18:29:52Amun-Rait may not be up to spec anymore, ymmv
18:33:50pbotfullertonIs 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:38Amun-Rahave you looked at jsony?
18:34:49*Amun-Ra haven't used json with nim yet
18:39:15pbotfullertonjsony? Not yet but I will
18:43:14pbotfullertonMarking 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:33FromDiscord<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:55pbotfullertonYes, I just finished figuring out how to overload `%` and `initFromJson` for the custom variant
19:15:17FromDiscord<voidwalker> @DarkSky how beginner we are talking about ?
19:16:01FromDiscord<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:49FromDiscord<vestel> How do I call destructor explicitly?
20:19:19FromDiscord<planetis> `=destroy`(x)
20:19:38FromDiscord<planetis> (edit) "`=destroy`(x)" => "sent a code paste, see https://play.nim-lang.org/#ix="
20:19:50FromDiscord<planetis> (edit)
20:30:50*krux02_ joined #nim
20:32:10FromDiscord<DarkSky> In reply to @voidwalker "I'm trying to write": actually i might try doing that
20:32:35FromDiscord<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:43FromDiscord<voidwalker> it's a good project, uses a bit of everything, algorithms, data structures, network protocols, async sockets/io etc
20:32:55FromDiscord<DarkSky> yee
20:33:04FromDiscord<DarkSky> i kind of hate the way i have to learn Nim though
20:33:04FromDiscord<voidwalker> not too hard to be out of reach, not too simple to not be challenging
20:33:31FromDiscord<DarkSky> the structure of the docs is pretty bad IMO
20:33:43FromDiscord<DarkSky> and there's not that many other resources online
20:33:53FromDiscord<DarkSky> since its not that much of a popular language
20:34:05FromDiscord<voidwalker> It's not ideal, indeed. Could be better.
20:34:33FromDiscord<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:38FromDiscord<DarkSky> yed exactly
20:43:18madpropsdo params in commandLineParams get stripped? like " == " turned into "==" ?
20:59:07FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gGw
20:59:26FromDiscord<voidwalker> there is one extra space there for some reason, in the binary file path
20:59:54FromDiscord<voidwalker> using vscodium, any idea what's going on ?
21:01:09*xet7 quit (Remote host closed the connection)
21:01:43FromDiscord<Elegantbeef> Odd, are you certain you wrote it verbatim?
21:02:57FromDiscord<voidwalker> wrote what verbatim ? I just hit f6 to run
21:03:07FromDiscord<Elegantbeef> I mean what you wrote here
21:03:38FromDiscord<Elegantbeef> Oh wait you ran a single file
21:03:59FromDiscord<Elegantbeef> No clue why you get that message
21:04:08FromDiscord<Elegantbeef> are you supposed to supply a file to bencode?
21:04:31*xet7 joined #nim
21:04:51FromDiscord<Elegantbeef> https://github.com/z-------------/nim-bencode/blob/master/src/bencode.nim#L5-L32 yea you're
21:06:05FromDiscord<voidwalker> https://media.discordapp.net/attachments/371759389889003532/1045082836023128194/image.png
21:06:18FromDiscord<Elegantbeef> Yes that's the program
21:06:19FromDiscord<voidwalker> oh damn, silly me : D
21:06:29FromDiscord<voidwalker> I forgot it runs as a separate program.. I wanted to use it as a lib
21:06:41FromDiscord<voidwalker> (edit) "runs" => "can run"
21:09:18FromDiscord<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:46FromDiscord<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:48FromDiscord<Elegantbeef> Seems fine
21:28:52FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4gGE
21:29:07FromDiscord<voidwalker> so it encapsulates the string in bkStr type of BencodeObj
21:31:36*ehmry joined #nim
21:32:11FromDiscord<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:13FromDiscord<voidwalker> what do you think ?
21:32:41FromDiscord<Elegantbeef> If there is no reason to use BencodeObj use a string
21:34:33FromDiscord<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:29FromDiscord<Cheesy Brik> how can I loop over 2 sequences at once, essentially the zip func from python.
21:51:59FromDiscord<ali> sequtils has proc `zip[S, T](s1: openArray[S]; s2: openArray[T]): seq[(S, T)]`↵(@Cheesy Brik)
21:52:14FromDiscord<Cheesy Brik> Ok nice thx
21:53:03FromDiscord<Cheesy Brik> Man nim constantly makes itself feel like python without all the python fluff and slowdown
21:53:48FromDiscord<amadan> Wonder why it isn't an iterator though 🤔
21:54:26FromDiscord<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:51FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4gGJ
21:58:21FromDiscord<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:00FromDiscord<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:28FromDiscord<Phytolizer> I'm considering doing that yeah, I just made my first contribution to nim this week
22:01:01FromDiscord<Cheesy Brik> Nice, also thank god sequtils uses the ``seq.join(string)`` format instead of pythons awful ``string.join(seq)``
22:01:20FromDiscord<Phytolizer> Yes that makes zero sense in python lol
22:01:42FromDiscord<Phytolizer> And if you don't like it you can just write a template anyway :)
22:01:55FromDiscord<Cheesy Brik> (edit) "sequtils" => "strctutils"
22:02:20FromDiscord<Cheesy Brik> God nim really puts so much power in the programmers hands without making it over obtuse
22:03:26FromDiscord<Phytolizer> I'm spoiled by it lol, then I have to go maintain a bash script at work and I miss it
22:07:01FromDiscord<nixfreak> Trying to understand how this works in a proc `` so proc `` , trying to find more examples of this
22:07:14FromDiscord<Elegantbeef> What?
22:07:20FromDiscord<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:41FromDiscord<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:42FromDiscord<Phytolizer> Are you talking about a proc literally called ?
22:08:02FromDiscord<nixfreak> ahh no back ticks won't work
22:08:16FromDiscord<Elegantbeef> You have a `` operator
22:08:41FromDiscord<nixfreak> or any operator that uses back ticks , what is it called
22:08:46FromDiscord<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:50FromDiscord<Elegantbeef> That's called lexical stropping
22:09:46FromDiscord<nixfreak> sent a long message, see http://ix.io/4gGL
22:10:07FromDiscord<nixfreak> There we go
22:10:13FromDiscord<Phytolizer> In reply to @nixfreak "or any operator that": In general any combo of operator characters can be defined
22:10:14FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#syntax-precedence
22:11:54FromDiscord<nixfreak> Ok just trying to wrap my head around why you would and when you would use stooping in proc
22:12:11FromDiscord<Phytolizer> To define your own operators or overload existing ones
22:12:21FromDiscord<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:32FromDiscord<Elegantbeef> Code↵(@Cheesy Brik)
22:14:30FromDiscord<Cheesy Brik> sent a code paste, see https://play.nim-lang.org/#ix=4gGO
22:15:10FromDiscord<Elegantbeef> People write funny code
22:15:22FromDiscord<Cheesy Brik> I am aware, I do it a lot
22:15:32FromDiscord<Elegantbeef> `i.split("=")[1]` will not always work
22:15:49FromDiscord<Cheesy Brik> how so
22:16:04FromDiscord<Elegantbeef> if you have an empty line
22:17:14FromDiscord<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:46FromDiscord<Elegantbeef> Well where does it error
22:17:53FromDiscord<Elegantbeef> The stack trace will tell you exactly where
22:18:10FromDiscord<Cheesy Brik> Nvm, I just found a blank line at the end of the file, you were right thanks :)
22:18:44FromDiscord<Elegantbeef> Now do you want the secret to doing this cleaner?
22:20:14FromDiscord<Cheesy Brik> What is it
22:21:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4gGP
22:24:36FromDiscord<Cheesy Brik> whats the command to compile a production version of my nim file?
22:24:59FromDiscord<Elegantbeef> `-d:release`
22:53:01FromDiscord<Cheesy Brik> Anyone else use fyracode? I adore it.
22:53:15FromDiscord<Cheesy Brik> (edit) "fyracode?" => "firacode?"
22:53:20FromDiscord<Elegantbeef> I used to use firacode but now use isoevka
22:53:24FromDiscord<Elegantbeef> iosevka even
22:53:28FromDiscord<nixfreak> result = default(T) , does that mean T doesn't have any side effects?
22:53:47FromDiscord<Elegantbeef> What?
22:53:59FromDiscord<Elegantbeef> `default(T)` returns a 0'd form of `T` in stable
22:55:21FromDiscord<nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4gGX
22:56:33FromDiscord<nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4gGY
22:59:02*jmdaemon joined #nim
23:03:04FromDiscord<Cheesy Brik> how to check if a directory exists (and then loop through that directory)
23:16:23FromDiscord<ali> std/os has an iterator walkDir↵(@Cheesy Brik)
23:16:46FromDiscord<Cheesy Brik> so just check if walkDir isn't nil?
23:18:16FromDiscord<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:41FromDiscord<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:51FromDiscord<ali> Using threadpool, seems like sometimes threads never sync.
23:54:19FromDiscord<Cheesy Brik> Anyone else love to put on those like 5 hour long youtube videos and just code?
23:54:35FromDiscord<ali> Star Trek TNG for me
23:55:19FromDiscord<Cheesy Brik> Fair, I also like to just go mining in minecraft whenever I'm on my annual minecraft kick.