00:01:45 | FromDiscord | <Technisha> Alright then! |
00:01:49 | FromDiscord | <Technisha> Thanks! |
00:02:40 | FromDiscord | <Technisha> Idfk what project to do- |
00:07:49 | FromDiscord | <Technisha> How do i make it so GitHub Actions builds my Nim project and posts it to GitHub Releases- |
00:24:43 | FromDiscord | <Technisha> I wanna make a discord lib for Python, in Nim- |
00:24:59 | FromDiscord | <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:37 | FromDiscord | <Mustache Man> any ideas how to make this "all" function work with varargs?↵greaterThan |
03:31:44 | FromDiscord | <Mustache Man> (edit) "varargs?↵greaterThan" => "varargs?↵https://play.nim-lang.org/#ix=2Vbg" |
03:32:20 | FromDiscord | <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:01 | FromDiscord | <Mustache Man> without modifying the greaterThan function |
03:33:23 | * | spiderstew_ quit (Ping timeout: 250 seconds) |
03:34:00 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2Vbi |
03:34:19 | FromDiscord | <ElegantBeef> Fixed your greater than proc 😄 |
03:34:51 | FromDiscord | <Yardanico> In reply to @ElegantBeef "https://play.nim-lang.org/#ix=2Vbi": why the macros import though 🤔 |
03:35:10 | FromDiscord | <ElegantBeef> I thought it needed unpackvarargs for a second then forgot to delete it |
03:42:25 | FromDiscord | <Mustache Man> hmm i'll have to add a case for no varargs |
03:46:24 | FromDiscord | <Mustache Man> oh wait, i guess my intention was unclear |
03:46:42 | * | aeverr quit (Quit: Konversation terminated!) |
03:46:50 | FromDiscord | <Mustache Man> i wanted to support use of predicates having an arbitrary number of arguments |
03:48:14 | FromDiscord | <mlokis> where can i find NimNode doc? |
03:48:51 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/macros.html#the-ast-in-nim |
03:49:05 | FromDiscord | <mlokis> thx |
03:55:35 | FromDiscord | <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:45 | FromDiscord | <Mustache Man> (edit) "doesn't have" => "always has" | "always hasa length ... " added "of zero?" |
03:56:31 | FromDiscord | <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:47 | FromDiscord | <mlokis> how do i run and discard executable when testing modules? |
04:07:24 | FromDiscord | <mlokis> useless .exe is everywhere now |
04:07:33 | FromDiscord | <Yardanico> `nim r` |
04:12:51 | FromDiscord | <mlokis> thx |
04:13:49 | FromDiscord | <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:00 | FromDiscord | <Rika> And how it becomes an implicit generic |
04:14:31 | FromDiscord | <Rika> So no not a compiler issue |
04:15:14 | FromDiscord | <Mustache Man> oh, i was wondering if there was a better way of defining that parameter |
04:15:34 | FromDiscord | <Mustache Man> i'll have to look over the docs again |
04:16:15 | FromDiscord | <Rika> Separate out the function |
04:16:31 | FromDiscord | <Rika> One taking in a proc of one parameter and the other taking in a proc of two |
04:19:15 | FromDiscord | <Mustache Man> instructions unclear |
04:19:19 | FromDiscord | <Mustache Man> you mean like this? https://play.nim-lang.org/#ix=2Vbr |
04:32:40 | FromDiscord | <Rika> Pretty much yes |
04:32:58 | FromDiscord | <Rika> Why? It’s the same issue as why you can’t have many types inside a sequence, kinda |
04:33:17 | FromDiscord | <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:47 | ForumUpdaterBot | New 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:37 | FromDiscord | <mlokis> why is the nimlsp constantly crashing? |
09:39:02 | PMunch | Sorry about that |
09:39:20 | PMunch | It's probably nimsuggest that's actually crashing though |
09:39:27 | PMunch | What are you trying to do? |
09:44:52 | * | lritter joined #nim |
09:54:31 | FromDiscord | <Gennadiy> sent a long message, see http://ix.io/2VcO |
10:04:25 | FromDiscord | <Solitude> In reply to @Gennadiy "I am trying to": you have to add `require "bigints"` to .nimble file |
10:04:42 | FromDiscord | <Solitude> (edit) "`require" => "`requires" |
10:07:01 | * | haxscramper joined #nim |
10:09:40 | FromDiscord | <Gennadiy> Thanks @Solitude , that worked.↵I assumed that `nimble` would automatically add the dependency in the .nimble file. |
10:12:13 | FromDiscord | <Solitude> In reply to @Gennadiy "Thanks <@!104136074569211904> , that": `nimble install` installs packages globally |
10:13:44 | FromDiscord | <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:04 | FromDiscord | <Gennadiy> I couldn't find any reference to bigints. |
10:14:27 | FromDiscord | <Solitude> C:\Users\general-rishkin\.nimble\pkgs\bigints-version |
10:14:32 | FromDiscord | <Solitude> (edit) "C:\Users\general-rishkin\.nimble\pkgs\bigints-version" => "C:\Users\general-rishkin\\.nimble\pkgs\bigints-version" |
10:15:17 | FromDiscord | <Gennadiy> Got it. Many thanks @Solitude . |
10:30:51 | * | Tanger joined #nim |
10:39:52 | * | xet7 quit (Quit: Leaving) |
10:40:37 | PMunch | Is 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:53 | PMunch | Kinda hard to compare them without knowing how both of them work |
10:55:15 | * | Gustavo6046 joined #nim |
11:01:08 | ForumUpdaterBot | New Nimble package! static_server - A tiny static file web server., see https://github.com/bung87/nimhttpd |
11:04:35 | FromDiscord | <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:43 | PMunch | Really? |
11:09:11 | FromDiscord | <Technisha> Someone did it in Python |
11:09:17 | FromDiscord | <Technisha> So it's definitely possible in Nim |
11:10:41 | PMunch | Huh, how does that even work? |
11:11:02 | FromDiscord | <Technisha> No idea, lemme get the repo |
11:11:34 | FromDiscord | <Technisha> https://github.com/benbaptist/wrapper.py |
11:11:44 | FromDiscord | <Technisha> I think they're not devving it much though |
11:13:22 | FromDiscord | <Technisha> Though if they've done it in Python, it's definitely doable in Nim |
11:13:39 | FromDiscord | <Technisha> Especially as they didn't even use a lib to wrap around the Jar file |
11:16:38 | PMunch | https://github.com/benbaptist/wrapper.py/blob/master/wrapper/server/world/chunk.py#L38 |
11:16:39 | PMunch | Haha :P |
11:17:58 | PMunch | Ah, 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:59 | FromDiscord | <Technisha> Lmao |
11:18:07 | FromDiscord | <Technisha> Yeah |
11:18:24 | PMunch | So it's not like a full-on Java mod |
11:18:28 | FromDiscord | <Technisha> But I'm gonna try keeping most of the original functionality (like the console working 100%) |
11:19:01 | FromDiscord | <Technisha> And then just adding on more |
11:19:24 | FromDiscord | <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:29 | FromDiscord | <IDF(ardek66)> so we could mod noita using nim |
11:19:31 | FromDiscord | <Technisha> Noita? |
11:19:57 | PMunch | https://www.youtube.com/watch?v=0cDkmQ0F0Jw |
11:20:06 | FromDiscord | <Technisha> Oh nice |
11:20:17 | FromDiscord | <Technisha> Meh I'll just stick to MC |
11:21:11 | FromDiscord | <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:46 | FromDiscord | <Technisha> https://github.com/PaulBernier/castl |
11:22:10 | FromDiscord | <IDF(ardek66)> hmmm |
11:22:28 | FromDiscord | <Technisha> https://github.com/pkuleon/javascript-to-lua |
11:23:30 | PMunch | I mean Noita probably has a Lua API, so all we need is a Lua API <-> DLL wrapper |
11:23:42 | PMunch | And then we can compile arbitrary Nim DLLs that goes through the Lua bridge |
11:23:54 | FromDiscord | <IDF(ardek66)> i thought of that too |
11:25:10 | ForumUpdaterBot | New Nimble package! rn - minimal, performant mass file renamer, see https://github.com/xioren/rn |
11:25:11 | ForumUpdaterBot | New Nimble package! scorper - micro and elegant web framework, see https://github.com/bung87/scorper |
11:26:31 | FromDiscord | <Technisha> In reply to @PMunch "I mean Noita probably": Or just write a wrapper around that- |
11:26:52 | PMunch | Huh? |
11:28:38 | PMunch | Or we could use this: https://github.com/probable-basilisk/noita-ws-api |
11:28:46 | FromDiscord | <IDF(ardek66)> oohh |
11:29:13 | FromDiscord | <IDF(ardek66)> that would be interesting |
11:29:54 | FromDiscord | <Technisha> Oo |
11:37:11 | ForumUpdaterBot | New Nimble package! nery - A simple library to create queries in Nim., see https://github.com/David-Kunz/Nery |
11:45:40 | FromDiscord | <Technisha> Anyone know of a good nanorc file for Nim?- |
11:52:34 | FromDiscord | <nailuj29> ~~vscode~~ |
11:54:16 | FromDiscord | <IDF(ardek66)> emacs |
11:54:32 | FromDiscord | <Solitude> ed |
11:54:37 | FromDiscord | <IDF(ardek66)> who |
11:55:46 | FromDiscord | <Technisha> I can't use an IDE- |
11:55:53 | FromDiscord | <Technisha> Otherwise I'd use VSC- |
11:56:31 | PMunch | But why nano? |
11:56:45 | FromDiscord | <Technisha> Because i have access to a CLI |
11:56:48 | FromDiscord | <Technisha> But no GUI |
11:57:00 | PMunch | So? I'd still go for Emacs or Vim over Nano |
11:57:05 | FromDiscord | <Technisha> Also because nano == Y E S |
11:57:46 | FromDiscord | <IDF(ardek66)> nano is equal with Y? |
11:58:11 | liblq-dev | micro > nano |
12:00:10 | FromDiscord | <flywind> there is one https://github.com/Oples/nanorc-nim/blob/master/nim.nanorc |
12:00:41 | FromDiscord | <Technisha> Thanks! |
12:01:05 | FromDiscord | <Technisha> Also, does choosenim work on arm? |
12:14:21 | PMunch | Don't see why it wouldn't. As long as you have all the tools it uses |
12:14:37 | PMunch | Or wait, maybe it's downloading pre-built images.. |
12:21:04 | FromDiscord | <Technisha> I remember it didn't use to work on Arm for some reason |
12:24:39 | FromDiscord | <dom96> It doesn't |
12:24:49 | FromDiscord | <dom96> because we don't have binary builds for choosenim on arm |
12:27:51 | PMunch | Ah right |
12:30:11 | FromDiscord | <Technisha> Oof |
12:30:37 | FromDiscord | <Technisha> Any pre-built arm binaries i can download? |
12:35:01 | PMunch | Would be great for the RPi. Building stuff for my home-assistant takes forever |
12:35:30 | Oddmonger | can't we cross-compile from a PC ? |
12:36:25 | Oddmonger | i have just scratched the edge of compilation tool (nims, nimble, nake, nim itself… ) |
12:38:14 | PMunch | Certainly can |
12:39:56 | * | rockcavera joined #nim |
12:40:11 | Oddmonger | if i have a global variable in a module, can i access it from another module ? |
12:40:21 | PMunch | If it is exported, yes |
12:40:26 | Oddmonger | maybe with * access rihgt then |
12:40:42 | Oddmonger | ok i thought i didn't need that |
12:42:37 | Oddmonger | ok it works with a warning |
12:43:01 | PMunch | What warning? |
12:44:28 | Oddmonger | 'input' is not GC-safe as it accesses 'string_shared' which is a global using GC'ed memory [GcUnsafe2] |
12:44:45 | Oddmonger | (« input » is a method) |
12:45:52 | Oddmonger | strings are on the stack, and not on the heaps ? |
12:47:05 | * | waleee-cl joined #nim |
12:47:31 | Oddmonger | hum 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:45 | PMunch | Yeah, the method is marked as supposedly GC-safe, but it isn't since it's accessing global memory |
13:19:50 | PMunch | And strings are stored on the heap |
13:19:59 | PMunch | Well, 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:46 | FromDiscord | <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:11 | ForumUpdaterBot | New thread by Kaushalmodi: Help with constructing an npeg parser, see https://forum.nim-lang.org/t/7754 |
13:51:17 | FromDiscord | <Gary M> I'm far too caveman brained to be able to do that myself in any capacity |
13:54:16 | FromDiscord | <Technisha> No pre-built arm binaries anywhere? Compiling it is fucking hell |
13:55:39 | * | justsomeguy quit (Quit: WeeChat 3.0.1) |
13:57:14 | leorize | nim-lang/nightlies |
13:57:16 | leorize | you're welcome |
13:59:45 | FromDiscord | <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:31 | FromDiscord | <no name fits> Right now I'm going through the string char by char, so |
14:03:13 | FromDiscord | <Technisha> Thanks |
14:03:28 | FromDiscord | <Technisha> Also found this https://github.com/kobi2187/cs2nim |
14:03:32 | FromDiscord | <Technisha> It's interesting |
14:04:18 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2VdR |
14:05:07 | FromDiscord | <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:28 | FromDiscord | <no name fits> lemme just put it in the playground and i can tell you in a sec |
14:05:45 | FromDiscord | <haxscramper> And then you need to parse `result = 1 + 1`, but that's probably out of the scope for strscans |
14:05:54 | FromDiscord | <haxscramper> You can use them for tokenizer if you want |
14:06:26 | FromDiscord | <haxscramper> But if you have any level of complexity for expressions you need to use parser |
14:06:46 | PMunch | @no name fits, this might be interesting: https://narimiran.github.io/2021/01/11/nim-parsing.html |
14:07:01 | FromDiscord | <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:13 | FromDiscord | <haxscramper> And yes, ^ look into this article, it has some simpler solutions |
14:07:32 | FromDiscord | <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:27 | FromDiscord | <haxscramper> You want to have something like mustache templating, or a more complex one? |
14:08:47 | FromDiscord | <no name fits> Well I come from C# so I was just gonna add the same capabilities as Razor |
14:08:56 | FromDiscord | <no name fits> I'm sorry I don't know what mustache is :c |
14:09:25 | PMunch | https://mustache.github.io/ |
14:09:33 | FromDiscord | <no name fits> thanks |
14:09:38 | FromDiscord | <haxscramper> https://mustache.github.io/mustache.5.html |
14:09:43 | FromDiscord | <Rika> do people not spell it "moustache" anymore? |
14:10:35 | PMunch | I do |
14:10:44 | PMunch | Along with the commonwealth people I suspect |
14:11:06 | FromDiscord | <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:13 | FromDiscord | <haxscramper> With quite a lot of capabilities |
14:11:40 | FromDiscord | <no name fits> Yeah so I thought that'd force me to learn something |
14:12:04 | FromDiscord | <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:29 | FromDiscord | <no name fits> I guess I should dust off one of my CS books then |
14:12:32 | FromDiscord | <haxscramper> You want to write own templating interpreter or mix it with nim syntax? |
14:12:58 | FromDiscord | <haxscramper> In reply to @no name fits "I guess I should": https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6#examples |
14:13:18 | FromDiscord | <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:28 | FromDiscord | <no name fits> I'll add models and such later |
14:13:36 | FromDiscord | <haxscramper> https://nim-lang.org/docs/filters.html |
14:13:47 | FromDiscord | <haxscramper> Something like this? |
14:14:07 | FromDiscord | <haxscramper> As a starting point, and then expand to have more features |
14:14:30 | * | PMunch quit (Quit: leaving) |
14:15:10 | FromDiscord | <no name fits> Pretty much yeah, I'd have to look into it further. I read pretty slowly, sorry |
14:32:56 | FromGitter | <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:55 | FromGitter | <krux02> that looks like a bug |
15:15:33 | FromDiscord | <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:32 | leorize | do you have the compilation error message? |
15:17:00 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Veh |
15:17:26 | FromDiscord | <KnorrFG> ah btw, this is compiled with the latest github version of nim, currently 1.5.1 |
15:18:16 | leorize | are you dealing with C interop? |
15:18:39 | FromDiscord | <KnorrFG> Im using sdl2, but i havent written any c interop code myself |
15:19:01 | leorize | which wrapper are you using? |
15:19:09 | FromDiscord | <KnorrFG> the official one |
15:19:22 | FromDiscord | <KnorrFG> https://github.com/nim-lang/sdl2 |
15:21:07 | leorize | how many files do you need to reproduce the bug? |
15:21:20 | FromDiscord | <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:40 | leorize | this might be a cross-module issue so you might need atleast 2 files |
15:22:07 | FromDiscord | <KnorrFG> hmm, ok, ill try to distribute the code a little |
15:22:10 | FromDiscord | <KnorrFG> thanks |
15:26:21 | * | leorize quit (Ping timeout: 240 seconds) |
15:33:45 | * | leorize joined #nim |
16:12:29 | FromDiscord | <lantos> -d:nimWorkaround14447 👁️ 👄 👁️ |
16:13:01 | FromDiscord | <lantos> (edit) "-d:nimWorkaround14447 👁️ 👄 👁️ ... " added "what" |
16:13:37 | leorize | it usually doesn't work |
16:14:39 | leorize | are you trying to capture a mutable parameter or result in your closure? |
16:16:27 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=2Vex |
16:16:56 | FromDiscord | <lantos> (edit) "https://play.nim-lang.org/#ix=2Vex" => "https://play.nim-lang.org/#ix=2Vey" |
16:17:26 | leorize | yea, it's not well documented but you can't capture a `var` in an async proc |
16:21:00 | FromDiscord | <lantos> sent a code paste, see https://play.nim-lang.org/#ix=2VeB |
16:21:34 | leorize | yea, we use refs for mutation in async stuff most of the time |
16:21:45 | FromDiscord | <lantos> This pattern would result in many copies (I think) . Should use Refs then |
16:21:51 | FromDiscord | <lantos> ah okay thanks! |
16:59:44 | FromDiscord | <Technisha> Okay |
17:00:04 | FromDiscord | <Technisha> Would making a wrapper for Paper (the server software), with Nim |
17:00:23 | FromDiscord | <Technisha> Using JNim for java interaction |
17:00:28 | FromDiscord | <Technisha> Would it be practical |
17:02:24 | FromDiscord | <Technisha> Since I'd be hooking into the API a lot |
17:02:31 | FromDiscord | <Technisha> For making my own Nim plugins |
17:03:14 | FromDiscord | <Yardanico> Try it and see if it's practical |
17:04:15 | FromDiscord | <Technisha> Noice |
17:04:19 | FromDiscord | <Technisha> Just gotta learn everything- |
17:04:39 | m33[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:45 | FromDiscord | <Technisha> (MC's internals, ik Nim and Java-) |
17:07:33 | m33[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:23 | FromDiscord | <dom96> m33: https://nim-lang.org/docs/theindex.html and Ctrl+F is your friend 🙂 |
17:09:41 | Clonkk[m] | Use https://devdocs.io/nim/ |
17:09:48 | m33[m] | <FromDiscord "<dom96> m33: ">https://nim-lang.or"> if only I know what I am looking for ;) |
17:13:09 | m33[m] | <Clonkk[m] "Use ">https://devdocs.io/nim/"> Oh.... this is really nice ! and not only for nim. Thanks |
17:19:34 | m33[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:08 | FromDiscord | <Yardanico> btw, there's also -d:danger which disables all runtime checks. sometimes it can be useful too |
17:22:15 | FromDiscord | <Yardanico> (it also implies -d:release) |
17:25:11 | m33[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:56 | FromDiscord | <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:12 | FromDiscord | <no name fits> sent a code paste, see https://play.nim-lang.org/#ix=2VeT |
17:40:19 | * | vicfred quit (Client Quit) |
17:41:07 | FromDiscord | <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:53 | FromDiscord | <no name fits> I included the test in the link |
17:46:02 | FromDiscord | <no name fits> oh wait I think I might know |
17:46:08 | FromDiscord | <no name fits> I feel stupid now |
17:46:48 | FromDiscord | <dk> Use toSeq when you want to see the exact chars |
17:47:00 | * | Vladar joined #nim |
17:47:23 | FromDiscord | <no name fits> It was me putting the nul in front like a dummy |
17:49:26 | * | vicfred joined #nim |
17:50:28 | FromDiscord | <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:04 | FromDiscord | <no name fits> Right, I just set the default to "input[0]" instead |
17:58:50 | qwr | hugs was quite nice for scripting, unfortunately its libraries are now completly stale as in 2006 |
18:10:55 | FromDiscord | <Technisha> Using Jnim, how would i import a class? :P |
18:11:24 | FromDiscord | <Yardanico> check the readme https://github.com/yglukhov/jnim |
18:11:35 | FromDiscord | <Yardanico> you can't just "import" the whole class with 1 line, you have to import its methods |
18:13:12 | FromDiscord | <Technisha> Ah alright then |
18:19:40 | m33[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:09 | FromDiscord | <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:40 | FromDiscord | <Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf2 |
18:28:54 | FromDiscord | <Technisha> (edit) "https://play.nim-lang.org/#ix=2Vf2" => "https://play.nim-lang.org/#ix=2Vf3" |
18:29:18 | FromDiscord | <Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf4 |
18:30:55 | FromDiscord | <Technisha> Removing `{.prop.}` also doesn't work |
18:31:05 | FromDiscord | <Technisha> sent a code paste, see https://play.nim-lang.org/#ix=2Vf6 |
18:36:29 | FromDiscord | <Yardanico> why do you define it as a prop if it's a method? |
18:36:52 | FromDiscord | <Yardanico> and anyway, it's better to ask in the github issue for jnim, I haven't seen anyone here use it |
18:37:00 | FromDiscord | <Technisha> I wasn't thinking, which is why i removed .prop. :p |
18:37:03 | FromDiscord | <Technisha> Alright then |
18:37:34 | FromDiscord | <Technisha> Wait am i able to just import the class on it's own? |
18:37:50 | FromDiscord | <Technisha> So i can pass the functions |
18:38:02 | FromDiscord | <Technisha> (edit) "functions" => "class to the main function" |
18:44:11 | FromDiscord | <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:13 | FromDiscord | <Conifer> proc myProc(): int = ↵yeah. |
19:22:11 | FromDiscord | <Technisha> Thanks |
19:25:31 | qwr | m33[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:50 | qwr | (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:50 | FromGitter | <ynfle> @qwr, I think it's also related to the fact that rust is much slower to compile |
19:33:14 | qwr | yes, mainly this, but it's not so noticable when compiling only few source files you've just written by yourself |
19:34:28 | qwr | ocaml is more like nim, but imho nim compiles even faster than ocaml |
19:35:31 | qwr | (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:19 | FromDiscord | <Technisha> Are there any alternatives to JNim? |
20:01:40 | FromDiscord | <dom96> To be fair to Rust, I think there are far more transitive deps in any package that you might pick up |
20:02:34 | FromDiscord | <dom96> (edit) "To be fair to Rust, I think there are far more transitive deps in any ... package" added "Rust" |
20:02:37 | Clonkk[m] | <FromDiscord "<Technisha> Are there any altern"> The alternative is to not use Java |
20:03:17 | FromDiscord | <Technisha> Lmao |
20:03:31 | FromDiscord | <Technisha> I need to use it though :p |
20:04:33 | Clonkk[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:09 | FromDiscord | <Technisha> Lmaooooooo |
20:05:17 | Clonkk[m] | <FromDiscord "<Technisha> I need to use it tho"> Jokes, I don't know what exists beside JNim |
20:05:21 | FromDiscord | <Technisha> We wanna make a wrapper around Paper so- |
20:05:25 | FromDiscord | <Technisha> XD |
20:08:53 | FromDiscord | <Conifer> JNim? :thinkrev: Whats that now |
20:09:53 | FromDiscord | <Technisha> https://github.com/yglukhov/jnim |
20:11:17 | ForumUpdaterBot | New post on r/nim by LongCovSuperSpreader: [ERROR] Parsing XML, see https://reddit.com/r/nim/comments/mlkjgr/error_parsing_xml/ |
20:12:32 | FromDiscord | <Conifer> Damn.. |
20:12:34 | FromDiscord | <Conifer> Thats neat |
20:12:51 | FromDiscord | <Technisha> It's kinda hard to use though imo |
20:13:29 | FromDiscord | <Conifer> yeah, can imagine. |
20:13:33 | FromDiscord | <Conifer> What are you using it for? |
20:13:45 | FromDiscord | <Technisha> Tryna make a wrapper around Paper |
20:14:03 | FromDiscord | <Conifer> good luck <:CH_BossThumbsUp:785311541398077480> |
20:14:08 | FromDiscord | <Technisha> I wanna be able to make plugins in Nim aha |
20:14:10 | FromDiscord | <Technisha> Thanks! |
20:15:49 | * | jess is now known as j |
20:20:07 | FromDiscord | <haxscramper> There is a tree-sitter based java parser that might try to use to automatically generate bindings |
20:20:08 | FromDiscord | <haxscramper> https://haxscramper.github.io/htsparse/src/htsparse/java/java_wrapper.html |
20:20:27 | FromDiscord | <haxscramper> For exposed Java APi |
20:21:04 | FromDiscord | <Technisha> Oh neat |
20:21:17 | FromDiscord | <Technisha> Issue is that it'd be kinda hard to do with a MC server jar :p |
20:22:26 | FromDiscord | <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:36 | FromDiscord | <Technisha> Yeah :p |
20:37:05 | ForumUpdaterBot | New thread by Adnan: --gc:arc slowing down performance, see https://forum.nim-lang.org/t/7755 |
20:41:27 | ForumUpdaterBot | New 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:28 | cornfeedhobo | Am I understanding correctly that the arc garbage collector frees memory when all references are gone? |
20:58:34 | FromDiscord | <konsumlamm> ignoring reference cycles, yes |
20:58:42 | FromDiscord | <konsumlamm> it uses reference counting |
20:58:46 | FromDiscord | <Yardanico> @cornfeedhobo it's hardly a GC |
20:58:51 | FromDiscord | <Yardanico> it's just refcounting for references |
20:58:55 | FromDiscord | <Yardanico> with optimizations like move semantics |
20:58:56 | FromDiscord | <konsumlamm> it collects garbage |
20:59:09 | FromDiscord | <konsumlamm> i don't see why it wouldn't be a GC |
20:59:09 | FromDiscord | <Yardanico> In reply to @konsumlamm "it collects garbage": so when you collect garbage yourself it's manual GC? |
20:59:14 | FromDiscord | <Yardanico> why people don't call it a GC then? :) |
20:59:22 | FromDiscord | <konsumlamm> some do :P |
20:59:39 | FromDiscord | <konsumlamm> it automatically collects garbage |
20:59:55 | FromDiscord | <konsumlamm> would you agree that ORC is a GC tho? |
21:00:00 | FromDiscord | <Yardanico> of course |
21:00:54 | cornfeedhobo | since 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:59 | FromDiscord | <konsumlamm> rust determines it at compile time for the most part |
21:03:18 | cornfeedhobo | interesting |
21:03:19 | FromDiscord | <konsumlamm> if you wanna use reference counting in Rust, you have to explicitly denote that in the type |
21:04:15 | FromDiscord | <Yardanico> there are also https://nim-lang.github.io/fusion/src/fusion/smartptrs.html |
21:04:23 | FromDiscord | <Yardanico> they should become a part of stdlib https://github.com/nim-lang/Nim/pull/17333 |
21:04:28 | FromDiscord | <Yardanico> they offer a UniquePtr |
21:04:33 | FromDiscord | <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:17 | FromDiscord | <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:09 | FromDiscord | <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:56 | FromDiscord | <konsumlamm> In reply to @Yardanico "afaik C++ unique pointers": yep |
21:27:51 | FromDiscord | <ElegantBeef> ARC is best described as a scoped based memory management |
21:28:20 | FromDiscord | <konsumlamm> what does reference counting have to do with scopes? |
21:29:04 | FromDiscord | <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:35 | FromDiscord | <konsumlamm> the main part of ARC is reference counting though |
21:29:43 | ForumUpdaterBot | New 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:06 | FromDiscord | <clyybber> I would say the main part of ARC is move optimization/the move/copy/destroy hooks |
21:42:48 | FromDiscord | <clyybber> because that matters a lot for seq/string even though those dont refcount |
21:44:08 | FromDiscord | <clyybber> and scope vs end-of-proc destruction doesnt change the fundamentals of that |
21:44:29 | FromDiscord | <clyybber> we might go even further someday, e.g. destroy a variable asap |
21:50:05 | * | vsantana joined #nim |
21:53:04 | FromDiscord | <Mustache Man> sent a code paste, see https://paste.rs/Ynv |
21:53:33 | FromDiscord | <ElegantBeef> could put `{.inline.}` to enforce it to be inlined |
21:53:47 | FromDiscord | <ElegantBeef> But isnt there a `pop` in the stdlib |
21:54:09 | * | NimBot joined #nim |
21:55:07 | FromDiscord | <Mustache Man> how is pop nosideeffect? |
21:55:24 | FromDiscord | <ElegantBeef> the `s` is a `var` |
21:55:47 | FromDiscord | <ElegantBeef> No side effect means it cannot mutate anything that isnt given as a mutable |
21:55:57 | FromDiscord | <Yardanico> seq.delete is O(n) |
21:56:00 | FromDiscord | <Mustache Man> ah, okay, i thought it meant no side effects whatsoever. |
21:56:19 | FromDiscord | <Yardanico> @Mustache Man do you need to preserve order? |
21:56:23 | FromDiscord | <Mustache Man> yes |
21:56:33 | FromDiscord | <ElegantBeef> Then invert your stack |
21:56:36 | FromDiscord | <Yardanico> i mean, in your case you always delete the 0 |
21:56:38 | FromDiscord | <Yardanico> https://nim-lang.org/docs/system.html#del%2Cseq%5BT%5D%2CNatural |
21:56:41 | FromDiscord | <Yardanico> should work for you |
21:57:02 | FromDiscord | <Yardanico> ah no, it won't |
21:57:10 | FromDiscord | <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:19 | FromDiscord | <Yardanico> yeah, so you might look into reworking that |
21:57:30 | FromDiscord | <Yardanico> deleting at index 0 while preserving order is quite costly |
21:57:32 | FromDiscord | <Yardanico> why do you need that btw? |
21:58:15 | FromDiscord | <Mustache Man> it's a simulated data processing queue. data gets added, and then it's removed to be processed |
21:58:54 | FromDiscord | <Mustache Man> but many data could be added in the time it takes to process the next index |
21:59:08 | FromDiscord | <ElegantBeef> Might be able to use a heap queue for that then, as long as you stored priority in the object |
21:59:30 | FromDiscord | <Mustache Man> hmm that's an idea |
21:59:56 | FromDiscord | <ElegantBeef> Or make a linked list 😛 |
22:00:23 | FromDiscord | <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:40 | FromDiscord | <Mustache Man> batch delete |
22:00:48 | FromDiscord | <ElegantBeef> Ah there actually is the `lists` module |
22:01:52 | FromDiscord | <Mustache Man> okay i'll try a few things and see what performs best |
22:01:55 | FromDiscord | <Mustache Man> thank you |
22:05:26 | FromDiscord | <lpha3ch0> sent a long message, see http://ix.io/2VfZ |
22:08:46 | FromDiscord | <Solitude> `of` branches must be static expressions |
22:08:47 | FromDiscord | <Solitude> https://play.nim-lang.org/#ix=2Vg1 |
22:09:08 | FromDiscord | <Yardanico> In reply to @lpha3ch0 "I posted this on": as Solitude said, you should either use ranges or if statements |
22:09:25 | FromDiscord | <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:15 | FromDiscord | <lpha3ch0> Thanks |
22:34:08 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
22:35:44 | * | pbb joined #nim |
22:37:27 | ForumUpdaterBot | New thread by Xioren: Handle "-" and variations as valid input, see https://forum.nim-lang.org/t/7756 |
22:54:47 | FromDiscord | <ElegantBeef> Anyone know how to set a video to autoplay in karax? |
22:55:10 | FromDiscord | <ElegantBeef> Doesnt seem it has `autoplay` or `mute` properties |
23:01:18 | * | vsantana quit (Read error: Connection reset by peer) |
23:05:42 | leorize[m] | try `"autoplay"=""` |
23:06:23 | leorize[m] | asking on webdev is a better bet :p |
23:07:39 | FromDiscord | <ElegantBeef> That does the trick though, so thanks |
23:24:33 | FromDiscord | <Technisha> Could someone help me figure out JNim? T-T |
23:24:43 | FromDiscord | <Technisha> I'm tryna start the MC server rn via nim |
23:25:20 | FromDiscord | <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:28 | leorize | asking on the forums would give you better chances |
23:41:24 | FromDiscord | <Technisha> Oh okay! |
23:41:47 | FromDiscord | <Technisha> Aahhhh i need spoons |
23:41:51 | FromDiscord | <Technisha> ~forum |
23:41:56 | FromDiscord | <Technisha> Oof |
23:42:04 | FromDiscord | <Technisha> ~notes |
23:42:12 | FromDiscord | <Technisha> What happened to disbot? |
23:42:28 | leorize | disbot is gone, sadly |
23:42:50 | leorize | it got kicked alongside its creator |
23:43:20 | FromDiscord | <Technisha> Wait what? |
23:43:24 | FromDiscord | <Technisha> Disruptek too?? |
23:43:33 | FromDiscord | <Technisha> What tf happened??? |
23:44:28 | leorize | some insults flew around and he's gone is the shortest version |
23:44:56 | FromDiscord | <Technisha> Ah. |
23:45:01 | FromDiscord | <Technisha> That sucks. |
23:45:28 | FromDiscord | <Technisha> Is Araq still here? |
23:45:38 | leorize | yep, he's on discord now |
23:45:58 | FromDiscord | <Technisha> Ah alright |
23:46:02 | FromDiscord | <Technisha> That's good then |
23:58:32 | * | Vladar quit (Quit: Leaving) |