<< 06-04-2021 >>

00:01:45FromDiscord<Technisha> Alright then!
00:01:49FromDiscord<Technisha> Thanks!
00:02:40FromDiscord<Technisha> Idfk what project to do-
00:07:49FromDiscord<Technisha> How do i make it so GitHub Actions builds my Nim project and posts it to GitHub Releases-
00:24:43FromDiscord<Technisha> I wanna make a discord lib for Python, in Nim-
00:24:59FromDiscord<Technisha> Actually nvm can't be bothered-
00:58:44*vicfred joined #nim
00:59:37*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:59:58*njoseph joined #nim
01:15:17*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
01:15:32*Gustavo6046 joined #nim
01:41:48*Tanger joined #nim
01:55:09*teal quit (Quit: WeeChat 3.1)
02:11:51*shmorgle quit (Ping timeout: 260 seconds)
02:17:34*rockcavera quit (Remote host closed the connection)
02:46:45*leorize quit (Ping timeout: 240 seconds)
02:48:12*leorize joined #nim
02:59:14*NimBot joined #nim
03:08:39*sagax quit (Quit: Konversation terminated!)
03:12:27*shmorgle joined #nim
03:31:37FromDiscord<Mustache Man> any ideas how to make this "all" function work with varargs?↵greaterThan
03:31:44FromDiscord<Mustache Man> (edit) "varargs?↵greaterThan" => "varargs?↵https://play.nim-lang.org/#ix=2Vbg"
03:32:20FromDiscord<Mustache Man> (edit) "varargs?↵https://play.nim-lang.org/#ix=2Vbg" => "varargs?↵https://play.nim-lang.org/#ix=2Vbh"
03:32:38*spiderstew joined #nim
03:33:01FromDiscord<Mustache Man> without modifying the greaterThan function
03:33:23*spiderstew_ quit (Ping timeout: 250 seconds)
03:34:00FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Vbi
03:34:19FromDiscord<ElegantBeef> Fixed your greater than proc 😄
03:34:51FromDiscord<Yardanico> In reply to @ElegantBeef "https://play.nim-lang.org/#ix=2Vbi": why the macros import though 🤔
03:35:10FromDiscord<ElegantBeef> I thought it needed unpackvarargs for a second then forgot to delete it
03:42:25FromDiscord<Mustache Man> hmm i'll have to add a case for no varargs
03:46:24FromDiscord<Mustache Man> oh wait, i guess my intention was unclear
03:46:42*aeverr quit (Quit: Konversation terminated!)
03:46:50FromDiscord<Mustache Man> i wanted to support use of predicates having an arbitrary number of arguments
03:48:14FromDiscord<mlokis> where can i find NimNode doc?
03:48:51FromDiscord<ElegantBeef> https://nim-lang.org/docs/macros.html#the-ast-in-nim
03:49:05FromDiscord<mlokis> thx
03:55:35FromDiscord<Mustache Man> maybe this makes it more clear?↵https://play.nim-lang.org/#ix=2Vbk↵but i guess varargs doesn't have a length
03:55:45FromDiscord<Mustache Man> (edit) "doesn't have" => "always has" | "always hasa length ... " added "of zero?"
03:56:31FromDiscord<Mustache Man> (edit) "maybe this makes it more clear?↵https://play.nim-lang.org/#ix=2Vbk↵but i guess varargs always has a length of zero? ... " added "no.. that's not the case."
04:06:47FromDiscord<mlokis> how do i run and discard executable when testing modules?
04:07:24FromDiscord<mlokis> useless .exe is everywhere now
04:07:33FromDiscord<Yardanico> `nim r`
04:12:51FromDiscord<mlokis> thx
04:13:49FromDiscord<Rika> In reply to @Mustache Man "maybe this makes it": I believe it’s to do with how you are using the proc type
04:14:00FromDiscord<Rika> And how it becomes an implicit generic
04:14:31FromDiscord<Rika> So no not a compiler issue
04:15:14FromDiscord<Mustache Man> oh, i was wondering if there was a better way of defining that parameter
04:15:34FromDiscord<Mustache Man> i'll have to look over the docs again
04:16:15FromDiscord<Rika> Separate out the function
04:16:31FromDiscord<Rika> One taking in a proc of one parameter and the other taking in a proc of two
04:19:15FromDiscord<Mustache Man> instructions unclear
04:19:19FromDiscord<Mustache Man> you mean like this? https://play.nim-lang.org/#ix=2Vbr
04:32:40FromDiscord<Rika> Pretty much yes
04:32:58FromDiscord<Rika> Why? It’s the same issue as why you can’t have many types inside a sequence, kinda
04:33:17FromDiscord<Mustache Man> 👍 thank you. i think this can be improved with a macro, but i've got to learn those first
05:37:35*waleee-cl quit (Quit: Connection closed for inactivity)
05:52:16*narimiran joined #nim
05:55:53*haxscramper joined #nim
06:20:26*FlammableDuck[m] joined #nim
06:41:47ForumUpdaterBotNew thread by Stefan_Salewski: Array Difference, see https://forum.nim-lang.org/t/7753
07:02:21*leorize quit (Ping timeout: 240 seconds)
07:04:37*leorize joined #nim
07:32:31*PMunch joined #nim
08:00:52*haxscramper quit (Remote host closed the connection)
08:08:26*Tanger quit (Remote host closed the connection)
08:12:59*tane_ joined #nim
08:39:11*Gustavo6046 quit (Ping timeout: 260 seconds)
08:41:33*krux02 joined #nim
09:07:12*vicfred quit (Quit: Leaving)
09:17:32*tane_ is now known as tane
09:22:05*letto quit (Quit: Konversation terminated!)
09:24:04*letto joined #nim
09:36:37FromDiscord<mlokis> why is the nimlsp constantly crashing?
09:39:02PMunchSorry about that
09:39:20PMunchIt's probably nimsuggest that's actually crashing though
09:39:27PMunchWhat are you trying to do?
09:44:52*lritter joined #nim
09:54:31FromDiscord<Gennadiy> sent a long message, see http://ix.io/2VcO
10:04:25FromDiscord<Solitude> In reply to @Gennadiy "I am trying to": you have to add `require "bigints"` to .nimble file
10:04:42FromDiscord<Solitude> (edit) "`require" => "`requires"
10:07:01*haxscramper joined #nim
10:09:40FromDiscord<Gennadiy> Thanks @Solitude , that worked.↵I assumed that `nimble` would automatically add the dependency in the .nimble file.
10:12:13FromDiscord<Solitude> In reply to @Gennadiy "Thanks <@!104136074569211904> , that": `nimble install` installs packages globally
10:13:44FromDiscord<Gennadiy> Ah, ok. Where would the installed package be in my custom installation path: `C:\Users\general-rishkin\NIM\nim-1.4.4`?
10:14:04FromDiscord<Gennadiy> I couldn't find any reference to bigints.
10:14:27FromDiscord<Solitude> C:\Users\general-rishkin\.nimble\pkgs\bigints-version
10:14:32FromDiscord<Solitude> (edit) "C:\Users\general-rishkin\.nimble\pkgs\bigints-version" => "C:\Users\general-rishkin\\.nimble\pkgs\bigints-version"
10:15:17FromDiscord<Gennadiy> Got it. Many thanks @Solitude .
10:30:51*Tanger joined #nim
10:39:52*xet7 quit (Quit: Leaving)
10:40:37PMunchIs there a description of the default GC anywhere? Similar to the one for ARC from here: https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html
10:40:53PMunchKinda hard to compare them without knowing how both of them work
10:55:15*Gustavo6046 joined #nim
11:01:08ForumUpdaterBotNew Nimble package! static_server - A tiny static file web server., see https://github.com/bung87/nimhttpd
11:04:35FromDiscord<Technisha> I just figured out that it's possible for me to make a wrapper around the minecraft server jar so i can use Nim for making extensions-
11:08:43PMunchReally?
11:09:11FromDiscord<Technisha> Someone did it in Python
11:09:17FromDiscord<Technisha> So it's definitely possible in Nim
11:10:41PMunchHuh, how does that even work?
11:11:02FromDiscord<Technisha> No idea, lemme get the repo
11:11:34FromDiscord<Technisha> https://github.com/benbaptist/wrapper.py
11:11:44FromDiscord<Technisha> I think they're not devving it much though
11:13:22FromDiscord<Technisha> Though if they've done it in Python, it's definitely doable in Nim
11:13:39FromDiscord<Technisha> Especially as they didn't even use a lib to wrap around the Jar file
11:16:38PMunchhttps://github.com/benbaptist/wrapper.py/blob/master/wrapper/server/world/chunk.py#L38
11:16:39PMunchHaha :P
11:17:58PMunchAh, so it seems to read the files directly from the filesystem and interact with the server process to access the console of the server
11:17:59FromDiscord<Technisha> Lmao
11:18:07FromDiscord<Technisha> Yeah
11:18:24PMunchSo it's not like a full-on Java mod
11:18:28FromDiscord<Technisha> But I'm gonna try keeping most of the original functionality (like the console working 100%)
11:19:01FromDiscord<Technisha> And then just adding on more
11:19:24FromDiscord<IDF(ardek66)> this reminds me of the noita modding thing, an idea would be to write something that generates valid lua for the noita's luajit thing
11:19:29FromDiscord<IDF(ardek66)> so we could mod noita using nim
11:19:31FromDiscord<Technisha> Noita?
11:19:57PMunchhttps://www.youtube.com/watch?v=0cDkmQ0F0Jw
11:20:06FromDiscord<Technisha> Oh nice
11:20:17FromDiscord<Technisha> Meh I'll just stick to MC
11:21:11FromDiscord<IDF(ardek66)> i haven't found any way to do it other than dll hacking, but we could take off from the js generator and maybe it can be modified to generate lua?
11:21:46FromDiscord<Technisha> https://github.com/PaulBernier/castl
11:22:10FromDiscord<IDF(ardek66)> hmmm
11:22:28FromDiscord<Technisha> https://github.com/pkuleon/javascript-to-lua
11:23:30PMunchI mean Noita probably has a Lua API, so all we need is a Lua API <-> DLL wrapper
11:23:42PMunchAnd then we can compile arbitrary Nim DLLs that goes through the Lua bridge
11:23:54FromDiscord<IDF(ardek66)> i thought of that too
11:25:10ForumUpdaterBotNew Nimble package! rn - minimal, performant mass file renamer, see https://github.com/xioren/rn
11:25:11ForumUpdaterBotNew Nimble package! scorper - micro and elegant web framework, see https://github.com/bung87/scorper
11:26:31FromDiscord<Technisha> In reply to @PMunch "I mean Noita probably": Or just write a wrapper around that-
11:26:52PMunchHuh?
11:28:38PMunchOr we could use this: https://github.com/probable-basilisk/noita-ws-api
11:28:46FromDiscord<IDF(ardek66)> oohh
11:29:13FromDiscord<IDF(ardek66)> that would be interesting
11:29:54FromDiscord<Technisha> Oo
11:37:11ForumUpdaterBotNew Nimble package! nery - A simple library to create queries in Nim., see https://github.com/David-Kunz/Nery
11:45:40FromDiscord<Technisha> Anyone know of a good nanorc file for Nim?-
11:52:34FromDiscord<nailuj29> ~~vscode~~
11:54:16FromDiscord<IDF(ardek66)> emacs
11:54:32FromDiscord<Solitude> ed
11:54:37FromDiscord<IDF(ardek66)> who
11:55:46FromDiscord<Technisha> I can't use an IDE-
11:55:53FromDiscord<Technisha> Otherwise I'd use VSC-
11:56:31PMunchBut why nano?
11:56:45FromDiscord<Technisha> Because i have access to a CLI
11:56:48FromDiscord<Technisha> But no GUI
11:57:00PMunchSo? I'd still go for Emacs or Vim over Nano
11:57:05FromDiscord<Technisha> Also because nano == Y E S
11:57:46FromDiscord<IDF(ardek66)> nano is equal with Y?
11:58:11liblq-devmicro > nano
12:00:10FromDiscord<flywind> there is one https://github.com/Oples/nanorc-nim/blob/master/nim.nanorc
12:00:41FromDiscord<Technisha> Thanks!
12:01:05FromDiscord<Technisha> Also, does choosenim work on arm?
12:14:21PMunchDon't see why it wouldn't. As long as you have all the tools it uses
12:14:37PMunchOr wait, maybe it's downloading pre-built images..
12:21:04FromDiscord<Technisha> I remember it didn't use to work on Arm for some reason
12:24:39FromDiscord<dom96> It doesn't
12:24:49FromDiscord<dom96> because we don't have binary builds for choosenim on arm
12:27:51PMunchAh right
12:30:11FromDiscord<Technisha> Oof
12:30:37FromDiscord<Technisha> Any pre-built arm binaries i can download?
12:35:01PMunchWould be great for the RPi. Building stuff for my home-assistant takes forever
12:35:30Oddmongercan't we cross-compile from a PC ?
12:36:25Oddmongeri have just scratched the edge of compilation tool (nims, nimble, nake, nim itself… )
12:38:14PMunchCertainly can
12:39:56*rockcavera joined #nim
12:40:11Oddmongerif i have a global variable in a module, can i access it from another module ?
12:40:21PMunchIf it is exported, yes
12:40:26Oddmongermaybe with * access rihgt then
12:40:42Oddmongerok i thought i didn't need that
12:42:37Oddmongerok it works with a warning
12:43:01PMunchWhat warning?
12:44:28Oddmonger'input' is not GC-safe as it accesses 'string_shared' which is a global using GC'ed memory [GcUnsafe2]
12:44:45Oddmonger(« input » is a method)
12:45:52Oddmongerstrings are on the stack, and not on the heaps ?
12:47:05*waleee-cl joined #nim
12:47:31Oddmongerhum wait, that's not even a question of modules, as the warning is in the module where « string_shared » is declared, so it's just about method i think
12:49:35*teasea quit (Quit: teasea)
12:49:55*teasea joined #nim
12:51:14*teasea quit (Client Quit)
12:53:15*teasea joined #nim
13:15:31*Vladar joined #nim
13:19:45PMunchYeah, the method is marked as supposedly GC-safe, but it isn't since it's accessing global memory
13:19:50PMunchAnd strings are stored on the heap
13:19:59PMunchWell, the string data is stored on the heap
13:29:34*clemens3_ quit (Quit: WeeChat 2.7)
13:29:45*clemens3 joined #nim
13:35:53*xet7 joined #nim
13:50:46FromDiscord<Gary M> Now that I'm using C# again because of Unity and potential job opportunities, I wish there was a C# backend/transpiler for Nim lol
13:51:11ForumUpdaterBotNew thread by Kaushalmodi: Help with constructing an npeg parser, see https://forum.nim-lang.org/t/7754
13:51:17FromDiscord<Gary M> I'm far too caveman brained to be able to do that myself in any capacity
13:54:16FromDiscord<Technisha> No pre-built arm binaries anywhere? Compiling it is fucking hell
13:55:39*justsomeguy quit (Quit: WeeChat 3.0.1)
13:57:14leorizenim-lang/nightlies
13:57:16leorizeyou're welcome
13:59:45FromDiscord<no name fits> Is there a guide anywhere for <https://nim-lang.github.io/Nim/strscans.html> for dumb people like me? I'm trying to make a templating engine, so I just want to get the contents of any matching brackets to begin with, and put the Nim result of those brackets as the replacement. So if the brackets said {result = 1} it'd be the string representation of "1" or if it was something like {result = 1 + 1} it'd be the string representation of
14:00:31FromDiscord<no name fits> Right now I'm going through the string char by char, so
14:03:13FromDiscord<Technisha> Thanks
14:03:28FromDiscord<Technisha> Also found this https://github.com/kobi2187/cs2nim
14:03:32FromDiscord<Technisha> It's interesting
14:04:18FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VdR
14:05:07FromDiscord<haxscramper> `'{', (~'}' -> content.add $_), '}'` I'm not sure if that's exactly what you asked, for, but this returns content inside non-recursive curly braces
14:05:28FromDiscord<no name fits> lemme just put it in the playground and i can tell you in a sec
14:05:45FromDiscord<haxscramper> And then you need to parse `result = 1 + 1`, but that's probably out of the scope for strscans
14:05:54FromDiscord<haxscramper> You can use them for tokenizer if you want
14:06:26FromDiscord<haxscramper> But if you have any level of complexity for expressions you need to use parser
14:06:46PMunch@no name fits, this might be interesting: https://narimiran.github.io/2021/01/11/nim-parsing.html
14:07:01FromDiscord<no name fits> That's exactly what I wanted. So the '{' matches any { or only if it's the starting { of the string?
14:07:13FromDiscord<haxscramper> And yes, ^ look into this article, it has some simpler solutions
14:07:32FromDiscord<no name fits> In all fairness I have no idea what I'm doing. This is my first time making a templating engine and I'm still noob at Nim
14:08:27FromDiscord<haxscramper> You want to have something like mustache templating, or a more complex one?
14:08:47FromDiscord<no name fits> Well I come from C# so I was just gonna add the same capabilities as Razor
14:08:56FromDiscord<no name fits> I'm sorry I don't know what mustache is :c
14:09:25PMunchhttps://mustache.github.io/
14:09:33FromDiscord<no name fits> thanks
14:09:38FromDiscord<haxscramper> https://mustache.github.io/mustache.5.html
14:09:43FromDiscord<Rika> do people not spell it "moustache" anymore?
14:10:35PMunchI do
14:10:44PMunchAlong with the commonwealth people I suspect
14:11:06FromDiscord<haxscramper> In reply to @no name fits "Well I come from": https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-5.0 judging from this page it is a mix of code with templating metasyntax
14:11:13FromDiscord<haxscramper> With quite a lot of capabilities
14:11:40FromDiscord<no name fits> Yeah so I thought that'd force me to learn something
14:12:04FromDiscord<haxscramper> So if you want to get to this level of features you would probably end up needing lexer and parser (you can get away with `scanp`-based implementation, but that won't be pretty)
14:12:29FromDiscord<no name fits> I guess I should dust off one of my CS books then
14:12:32FromDiscord<haxscramper> You want to write own templating interpreter or mix it with nim syntax?
14:12:58FromDiscord<haxscramper> In reply to @no name fits "I guess I should": https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6#examples
14:13:18FromDiscord<no name fits> It was gonna be fairly simple. Just HTML (or any text really) and whenever you see a { ... } you evaluate it as Nim code and replace the result
14:13:28FromDiscord<no name fits> I'll add models and such later
14:13:36FromDiscord<haxscramper> https://nim-lang.org/docs/filters.html
14:13:47FromDiscord<haxscramper> Something like this?
14:14:07FromDiscord<haxscramper> As a starting point, and then expand to have more features
14:14:30*PMunch quit (Quit: leaving)
14:15:10FromDiscord<no name fits> Pretty much yeah, I'd have to look into it further. I read pretty slowly, sorry
14:32:56FromGitter<HJarausch_gitlab> What tries the following error message to tell me: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=606c711792a3431fd67aee8d]
14:50:41*Vladar quit (Ping timeout: 240 seconds)
14:55:42*xace_ quit (Ping timeout: 268 seconds)
14:57:03*xace joined #nim
15:00:55FromGitter<krux02> that looks like a bug
15:15:33FromDiscord<KnorrFG> One test for the library im writing does not compile,because the generated c code contains an error. I spent half a day copying everything relevant for that test case into a single file, because I hoped I could then reproduce the bug there, start removing code, and get a minimal sample code to reproduce the problem. However, when everything is in a single file, the test compiles and runs successful. Any Ideas how I can corner that error?
15:16:32leorizedo you have the compilation error message?
15:17:00FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Veh
15:17:26FromDiscord<KnorrFG> ah btw, this is compiled with the latest github version of nim, currently 1.5.1
15:18:16leorizeare you dealing with C interop?
15:18:39FromDiscord<KnorrFG> Im using sdl2, but i havent written any c interop code myself
15:19:01leorizewhich wrapper are you using?
15:19:09FromDiscord<KnorrFG> the official one
15:19:22FromDiscord<KnorrFG> https://github.com/nim-lang/sdl2
15:21:07leorizehow many files do you need to reproduce the bug?
15:21:20FromDiscord<KnorrFG> but this field 'ev' that is occuring in an error message, is not related to c interop, its a field of a type that i generate with a macro
15:21:40leorizethis might be a cross-module issue so you might need atleast 2 files
15:22:07FromDiscord<KnorrFG> hmm, ok, ill try to distribute the code a little
15:22:10FromDiscord<KnorrFG> thanks
15:26:21*leorize quit (Ping timeout: 240 seconds)
15:33:45*leorize joined #nim
16:12:29FromDiscord<lantos> -d:nimWorkaround14447 👁️ 👄 👁️
16:13:01FromDiscord<lantos> (edit) "-d:nimWorkaround14447 👁️ 👄 👁️ ... " added "what"
16:13:37leorizeit usually doesn't work
16:14:39leorizeare you trying to capture a mutable parameter or result in your closure?
16:16:27FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=2Vex
16:16:56FromDiscord<lantos> (edit) "https://play.nim-lang.org/#ix=2Vex" => "https://play.nim-lang.org/#ix=2Vey"
16:17:26leorizeyea, it's not well documented but you can't capture a `var` in an async proc
16:21:00FromDiscord<lantos> sent a code paste, see https://play.nim-lang.org/#ix=2VeB
16:21:34leorizeyea, we use refs for mutation in async stuff most of the time
16:21:45FromDiscord<lantos> This pattern would result in many copies (I think) . Should use Refs then
16:21:51FromDiscord<lantos> ah okay thanks!
16:59:44FromDiscord<Technisha> Okay
17:00:04FromDiscord<Technisha> Would making a wrapper for Paper (the server software), with Nim
17:00:23FromDiscord<Technisha> Using JNim for java interaction
17:00:28FromDiscord<Technisha> Would it be practical
17:02:24FromDiscord<Technisha> Since I'd be hooking into the API a lot
17:02:31FromDiscord<Technisha> For making my own Nim plugins
17:03:14FromDiscord<Yardanico> Try it and see if it's practical
17:04:15FromDiscord<Technisha> Noice
17:04:19FromDiscord<Technisha> Just gotta learn everything-
17:04:39m33[m]Well well well, nim-lang is actually quite enjoyable. I've been playing code.golf to learn it for two days now, I'm begining to like it.
17:04:45FromDiscord<Technisha> (MC's internals, ik Nim and Java-)
17:07:33m33[m]The official doc is a bit painfull to parse/search to discover valid methods for common types, common procs ... (https://nim-lang.org/docs). I guess I'm using it wrong, I always end up scrolling for ever down to look for something, then all the way up to get back to searches...
17:09:23FromDiscord<dom96> m33: https://nim-lang.org/docs/theindex.html and Ctrl+F is your friend 🙂
17:09:41Clonkk[m]Use https://devdocs.io/nim/
17:09:48m33[m]<FromDiscord "<dom96> m33: ">https://nim-lang.or"> if only I know what I am looking for ;)
17:13:09m33[m]<Clonkk[m] "Use ">https://devdocs.io/nim/"> Oh.... this is really nice ! and not only for nim. Thanks
17:19:34m33[m]I'm really impressed by the compilation speed, and the size of the exec (in particular with "release" flag). It makes trial and error snappy.
17:22:08FromDiscord<Yardanico> btw, there's also -d:danger which disables all runtime checks. sometimes it can be useful too
17:22:15FromDiscord<Yardanico> (it also implies -d:release)
17:25:11m33[m]I am evaluating nim & crystal right now, to replace most of my python and bash sluggish scripts. I must admit I love the coding style on crystal, but it seems to me that nim possibilities and toolchain would make me more efficient...
17:31:24*aenesidemus joined #nim
17:33:56FromDiscord<haxscramper> nim is great for scripting. Unless you start diving into complex logic it feels almost like a scripting language
17:35:34*vicfred joined #nim
17:40:12FromDiscord<no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2VeT
17:40:19*vicfred quit (Client Quit)
17:41:07FromDiscord<no name fits> The exercise is just "encoding" a string with a number in front of the char and how many times it repeats in a series, but I'm more interested in why it's failing
17:44:53FromDiscord<no name fits> I included the test in the link
17:46:02FromDiscord<no name fits> oh wait I think I might know
17:46:08FromDiscord<no name fits> I feel stupid now
17:46:48FromDiscord<dk> Use toSeq when you want to see the exact chars
17:47:00*Vladar joined #nim
17:47:23FromDiscord<no name fits> It was me putting the nul in front like a dummy
17:49:26*vicfred joined #nim
17:50:28FromDiscord<Yardanico> In reply to @no name fits "It was me putting": you can't access the null char in nim strings since a long time ago (as the last char), so don't compare to it
17:52:04FromDiscord<no name fits> Right, I just set the default to "input[0]" instead
17:58:50qwrhugs was quite nice for scripting, unfortunately its libraries are now completly stale as in 2006
18:10:55FromDiscord<Technisha> Using Jnim, how would i import a class? :P
18:11:24FromDiscord<Yardanico> check the readme https://github.com/yglukhov/jnim
18:11:35FromDiscord<Yardanico> you can't just "import" the whole class with 1 line, you have to import its methods
18:13:12FromDiscord<Technisha> Ah alright then
18:19:40m33[m]<qwr "hugs was quite nice for scriptin"> That looks unlikely with nim, it's been there for a while, and I guess my use case would most entirely fit on stdlib and core libs. At least for my professional activity. For my personal "work" I already see missing things, but at this point it won't discourage me to give nim a chance.
18:21:09FromDiscord<no name fits> So I finished the exercise, if anyone wants to code review me, that'd be greatly appreciated. I added the unit tests underneath my solution:↵<https://play.nim-lang.org/#ix=2Vf0>
18:28:40FromDiscord<Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf2
18:28:54FromDiscord<Technisha> (edit) "https://play.nim-lang.org/#ix=2Vf2" => "https://play.nim-lang.org/#ix=2Vf3"
18:29:18FromDiscord<Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf4
18:30:55FromDiscord<Technisha> Removing `{.prop.}` also doesn't work
18:31:05FromDiscord<Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf6
18:36:29FromDiscord<Yardanico> why do you define it as a prop if it's a method?
18:36:52FromDiscord<Yardanico> and anyway, it's better to ask in the github issue for jnim, I haven't seen anyone here use it
18:37:00FromDiscord<Technisha> I wasn't thinking, which is why i removed .prop. :p
18:37:03FromDiscord<Technisha> Alright then
18:37:34FromDiscord<Technisha> Wait am i able to just import the class on it's own?
18:37:50FromDiscord<Technisha> So i can pass the functions
18:38:02FromDiscord<Technisha> (edit) "functions" => "class to the main function"
18:44:11FromDiscord<Technisha> How do i define an integer for the return type of a proc? `proc myproc(): int`, right?
18:45:33*aenesidemus quit (Quit: Leaving)
19:19:13FromDiscord<Conifer> proc myProc(): int = ↵yeah.
19:22:11FromDiscord<Technisha> Thanks
19:25:31qwrm33[m]: nim has imho very nice nimble repository, which was also amazingly fast to use - only thing is that in practice you must compile your nim scripts (ignoring the limited nimscript) - not really script, but yes, the code is easy and clean
19:26:33*cgfuh joined #nim
19:29:50qwr(the nimble build speed is like night and day compared for example for rust, where on slower computer you add few dependencies, cargo downloads dozens indirect ones and then takes minutes to compile those)
19:30:50FromGitter<ynfle> @qwr, I think it's also related to the fact that rust is much slower to compile
19:33:14qwryes, mainly this, but it's not so noticable when compiling only few source files you've just written by yourself
19:34:28qwrocaml is more like nim, but imho nim compiles even faster than ocaml
19:35:31qwr(or has somehow smaller source code for libraries with similar functionality)
19:44:48*narimiran quit (Ping timeout: 265 seconds)
19:48:32*letto quit (Quit: Konversation terminated!)
19:50:41*lritter quit (Ping timeout: 240 seconds)
19:50:56*letto joined #nim
19:59:19FromDiscord<Technisha> Are there any alternatives to JNim?
20:01:40FromDiscord<dom96> To be fair to Rust, I think there are far more transitive deps in any package that you might pick up
20:02:34FromDiscord<dom96> (edit) "To be fair to Rust, I think there are far more transitive deps in any ... package" added "Rust"
20:02:37Clonkk[m]<FromDiscord "<Technisha> Are there any altern"> The alternative is to not use Java
20:03:17FromDiscord<Technisha> Lmao
20:03:31FromDiscord<Technisha> I need to use it though :p
20:04:33Clonkk[m]I hate Java with a burning passion. I have a dedicated rpi to make a JVM segfault continuously like the eternal hell of Sisyphe pushing its rock
20:05:09FromDiscord<Technisha> Lmaooooooo
20:05:17Clonkk[m]<FromDiscord "<Technisha> I need to use it tho"> Jokes, I don't know what exists beside JNim
20:05:21FromDiscord<Technisha> We wanna make a wrapper around Paper so-
20:05:25FromDiscord<Technisha> XD
20:08:53FromDiscord<Conifer> JNim? :thinkrev: Whats that now
20:09:53FromDiscord<Technisha> https://github.com/yglukhov/jnim
20:11:17ForumUpdaterBotNew post on r/nim by LongCovSuperSpreader: [ERROR] Parsing XML, see https://reddit.com/r/nim/comments/mlkjgr/error_parsing_xml/
20:12:32FromDiscord<Conifer> Damn..
20:12:34FromDiscord<Conifer> Thats neat
20:12:51FromDiscord<Technisha> It's kinda hard to use though imo
20:13:29FromDiscord<Conifer> yeah, can imagine.
20:13:33FromDiscord<Conifer> What are you using it for?
20:13:45FromDiscord<Technisha> Tryna make a wrapper around Paper
20:14:03FromDiscord<Conifer> good luck <:CH_BossThumbsUp:785311541398077480>
20:14:08FromDiscord<Technisha> I wanna be able to make plugins in Nim aha
20:14:10FromDiscord<Technisha> Thanks!
20:15:49*jess is now known as j
20:20:07FromDiscord<haxscramper> There is a tree-sitter based java parser that might try to use to automatically generate bindings
20:20:08FromDiscord<haxscramper> https://haxscramper.github.io/htsparse/src/htsparse/java/java_wrapper.html
20:20:27FromDiscord<haxscramper> For exposed Java APi
20:21:04FromDiscord<Technisha> Oh neat
20:21:17FromDiscord<Technisha> Issue is that it'd be kinda hard to do with a MC server jar :p
20:22:26FromDiscord<haxscramper> I'm not really familiar with how things work in java ecosystem, so. If you can't access to the sources themselves this parser is useless
20:23:36FromDiscord<Technisha> Yeah :p
20:37:05ForumUpdaterBotNew thread by Adnan: --gc:arc slowing down performance, see https://forum.nim-lang.org/t/7755
20:41:27ForumUpdaterBotNew post on r/nim by LongCovSuperSpreader: Parsing html, see https://reddit.com/r/nim/comments/mll6tq/parsing_html/
20:46:37*cornfeedhobo joined #nim
20:52:26*haxscramper quit (Remote host closed the connection)
20:56:28cornfeedhoboAm I understanding correctly that the arc garbage collector frees memory when all references are gone?
20:58:34FromDiscord<konsumlamm> ignoring reference cycles, yes
20:58:42FromDiscord<konsumlamm> it uses reference counting
20:58:46FromDiscord<Yardanico> @cornfeedhobo it's hardly a GC
20:58:51FromDiscord<Yardanico> it's just refcounting for references
20:58:55FromDiscord<Yardanico> with optimizations like move semantics
20:58:56FromDiscord<konsumlamm> it collects garbage
20:59:09FromDiscord<konsumlamm> i don't see why it wouldn't be a GC
20:59:09FromDiscord<Yardanico> In reply to @konsumlamm "it collects garbage": so when you collect garbage yourself it's manual GC?
20:59:14FromDiscord<Yardanico> why people don't call it a GC then? :)
20:59:22FromDiscord<konsumlamm> some do :P
20:59:39FromDiscord<konsumlamm> it automatically collects garbage
20:59:55FromDiscord<konsumlamm> would you agree that ORC is a GC tho?
21:00:00FromDiscord<Yardanico> of course
21:00:54cornfeedhobosince I am naive, how does this approach compare to something like rust's approach? i haven't dug into their's, but passing understanding is that they free memory after the last reference
21:02:59FromDiscord<konsumlamm> rust determines it at compile time for the most part
21:03:18cornfeedhobointeresting
21:03:19FromDiscord<konsumlamm> if you wanna use reference counting in Rust, you have to explicitly denote that in the type
21:04:15FromDiscord<Yardanico> there are also https://nim-lang.github.io/fusion/src/fusion/smartptrs.html
21:04:23FromDiscord<Yardanico> they should become a part of stdlib https://github.com/nim-lang/Nim/pull/17333
21:04:28FromDiscord<Yardanico> they offer a UniquePtr
21:04:33FromDiscord<konsumlamm> ofc Rust has some restrictions that allow it to determine when something should be freed, that wouldn't reliably be possible in the general case
21:06:17FromDiscord<Yardanico> In reply to @Yardanico "they offer a UniquePtr": afaik C++ unique pointers are similar to rust's boxes and similar to nim's uniqueptr from smartptrs
21:07:09FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/17333/files you can check that they're not that hard to implement with the move semantics
21:11:56FromDiscord<konsumlamm> In reply to @Yardanico "afaik C++ unique pointers": yep
21:27:51FromDiscord<ElegantBeef> ARC is best described as a scoped based memory management
21:28:20FromDiscord<konsumlamm> what does reference counting have to do with scopes?
21:29:04FromDiscord<ElegantBeef> Well the way that Nim's arc work is by inserting destructors in scopes at compile time, so it's mostly scope based
21:29:35FromDiscord<konsumlamm> the main part of ARC is reference counting though
21:29:43ForumUpdaterBotNew post on r/nim by subsonic68: Case error: cannot evaluate at compile time, see https://reddit.com/r/nim/comments/mlm7nh/case_error_cannot_evaluate_at_compile_time/
21:34:47*tane quit (Quit: Leaving)
21:42:06FromDiscord<clyybber> I would say the main part of ARC is move optimization/the move/copy/destroy hooks
21:42:48FromDiscord<clyybber> because that matters a lot for seq/string even though those dont refcount
21:44:08FromDiscord<clyybber> and scope vs end-of-proc destruction doesnt change the fundamentals of that
21:44:29FromDiscord<clyybber> we might go even further someday, e.g. destroy a variable asap
21:50:05*vsantana joined #nim
21:53:04FromDiscord<Mustache Man> sent a code paste, see https://paste.rs/Ynv
21:53:33FromDiscord<ElegantBeef> could put `{.inline.}` to enforce it to be inlined
21:53:47FromDiscord<ElegantBeef> But isnt there a `pop` in the stdlib
21:54:09*NimBot joined #nim
21:55:07FromDiscord<Mustache Man> how is pop nosideeffect?
21:55:24FromDiscord<ElegantBeef> the `s` is a `var`
21:55:47FromDiscord<ElegantBeef> No side effect means it cannot mutate anything that isnt given as a mutable
21:55:57FromDiscord<Yardanico> seq.delete is O(n)
21:56:00FromDiscord<Mustache Man> ah, okay, i thought it meant no side effects whatsoever.
21:56:19FromDiscord<Yardanico> @Mustache Man do you need to preserve order?
21:56:23FromDiscord<Mustache Man> yes
21:56:33FromDiscord<ElegantBeef> Then invert your stack
21:56:36FromDiscord<Yardanico> i mean, in your case you always delete the 0
21:56:38FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#del%2Cseq%5BT%5D%2CNatural
21:56:41FromDiscord<Yardanico> should work for you
21:57:02FromDiscord<Yardanico> ah no, it won't
21:57:10FromDiscord<ElegantBeef> Well if you add elements starting at the top to the bottom you can use pop and have a very efficient removal
21:57:19FromDiscord<Yardanico> yeah, so you might look into reworking that
21:57:30FromDiscord<Yardanico> deleting at index 0 while preserving order is quite costly
21:57:32FromDiscord<Yardanico> why do you need that btw?
21:58:15FromDiscord<Mustache Man> it's a simulated data processing queue. data gets added, and then it's removed to be processed
21:58:54FromDiscord<Mustache Man> but many data could be added in the time it takes to process the next index
21:59:08FromDiscord<ElegantBeef> Might be able to use a heap queue for that then, as long as you stored priority in the object
21:59:30FromDiscord<Mustache Man> hmm that's an idea
21:59:56FromDiscord<ElegantBeef> Or make a linked list 😛
22:00:23FromDiscord<Mustache Man> perhaps hacky but i could also use an incrementing index and then delete a bunch of stuff every once in awhile
22:00:40FromDiscord<Mustache Man> batch delete
22:00:48FromDiscord<ElegantBeef> Ah there actually is the `lists` module
22:01:52FromDiscord<Mustache Man> okay i'll try a few things and see what performs best
22:01:55FromDiscord<Mustache Man> thank you
22:05:26FromDiscord<lpha3ch0> sent a long message, see http://ix.io/2VfZ
22:08:46FromDiscord<Solitude> `of` branches must be static expressions
22:08:47FromDiscord<Solitude> https://play.nim-lang.org/#ix=2Vg1
22:09:08FromDiscord<Yardanico> In reply to @lpha3ch0 "I posted this on": as Solitude said, you should either use ranges or if statements
22:09:25FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement "Because case statements are checked for exhaustiveness during semantic analysis, the value in every of branch must be a constant expression. "
22:18:15FromDiscord<lpha3ch0> Thanks
22:34:08*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:35:44*pbb joined #nim
22:37:27ForumUpdaterBotNew thread by Xioren: Handle "-" and variations as valid input, see https://forum.nim-lang.org/t/7756
22:54:47FromDiscord<ElegantBeef> Anyone know how to set a video to autoplay in karax?
22:55:10FromDiscord<ElegantBeef> Doesnt seem it has `autoplay` or `mute` properties
23:01:18*vsantana quit (Read error: Connection reset by peer)
23:05:42leorize[m]try `"autoplay"=""`
23:06:23leorize[m]asking on webdev is a better bet :p
23:07:39FromDiscord<ElegantBeef> That does the trick though, so thanks
23:24:33FromDiscord<Technisha> Could someone help me figure out JNim? T-T
23:24:43FromDiscord<Technisha> I'm tryna start the MC server rn via nim
23:25:20FromDiscord<Technisha> I don't have the spoons to make a GitHub issue for it tho so-
23:30:21*gangstacat quit (Ping timeout: 246 seconds)
23:30:50*vicfred quit (Quit: Leaving)
23:35:40*gangstacat joined #nim
23:40:28leorizeasking on the forums would give you better chances
23:41:24FromDiscord<Technisha> Oh okay!
23:41:47FromDiscord<Technisha> Aahhhh i need spoons
23:41:51FromDiscord<Technisha> ~forum
23:41:56FromDiscord<Technisha> Oof
23:42:04FromDiscord<Technisha> ~notes
23:42:12FromDiscord<Technisha> What happened to disbot?
23:42:28leorizedisbot is gone, sadly
23:42:50leorizeit got kicked alongside its creator
23:43:20FromDiscord<Technisha> Wait what?
23:43:24FromDiscord<Technisha> Disruptek too??
23:43:33FromDiscord<Technisha> What tf happened???
23:44:28leorizesome insults flew around and he's gone is the shortest version
23:44:56FromDiscord<Technisha> Ah.
23:45:01FromDiscord<Technisha> That sucks.
23:45:28FromDiscord<Technisha> Is Araq still here?
23:45:38leorizeyep, he's on discord now
23:45:58FromDiscord<Technisha> Ah alright
23:46:02FromDiscord<Technisha> That's good then
23:58:32*Vladar quit (Quit: Leaving)