<< 03-10-2021 >>

00:00:08Mister_Magisteri don't need timezones
00:00:11Mister_Magisteroh wait
00:00:17Mister_Magister@treeform TIS U
00:00:20Mister_Magisterwhoa
00:00:22Mister_Magisterman himself
00:02:38Mister_Magister@treeform only issue i was having was no obvious conversion of Uri to your Uri and i couldn't just slap parseUrl(req.url.query) and had to instead do parseUrl("?" & req.url.query) tho if i used parseUrl($req.url) it would probably work in hindisight, and also i couldn't just check if query contains parameter and instead was doing query["param"] != ""
00:26:02Mister_Magisterhttps://paste.opensuse.org/add00b12 what the hell
00:26:36Mister_Magisterhttps://github.com/Michal-Szczepaniak/prometheus-proxy-nim/blob/master/proxy.nim heres sauce
00:27:30Mister_Magistertypes match, what are you talking about
00:27:52Mister_Magistervar not let
00:27:57Mister_Magisterjesus christ
00:28:55*NeoCron quit (Quit: Leaving)
00:54:13FromDiscord<Jakes1403> NimGL is making me lose my mind↵Anybody have recommendations for a simple, supported 2D graphics library?↵My only requirement is to be able to display a monochrome buffer
00:54:45FromDiscord<Jakes1403> (edit) "monochrome" => "1-bit color"
00:55:19FromDiscord<Jakes1403> or to just be able to draw rectangles
00:56:16*vicfred joined #nim
00:57:31FromDiscord<amadan> https://github.com/treeform/pixie would this be what you're looking for?
00:57:34nrds<R2D299> itHub: 7"Full-featured 2d graphics library for Nim."
00:57:53Mister_Magistertreeform back at it again
01:02:02FromDiscord<ElegantBeef> In reply to @Jakes1403 "NimGL is making me": Nico, Drawim, Pixie are all pretty easy to use for drawing 2D
01:02:21FromDiscord<ElegantBeef> Matrix bridge really dieded 3 hours behind 😄
01:03:49FromDiscord<ElegantBeef> Or if you want a loose underdeveloped abstraction over opengl my truss framework exists <https://github.com/beef331/truss3d/blob/master/examples/shapes.nim>
01:30:28*neurocyte01326 joined #nim
01:31:47FromDiscord<retkid> is lisp worth learnig?
01:31:50FromDiscord<retkid> (edit) "learnig?" => "learning?"
01:31:53FromDiscord<retkid> whats your takes on it?
01:31:56FromDiscord<retkid> do you like it?
01:32:46*neurocyte0132 quit (Ping timeout: 252 seconds)
01:32:47*neurocyte01326 is now known as neurocyte0132
01:50:57FromDiscord<Professor Actual Factual> Hello all, ↵↵Does anyone know if threadpools send tasks to multiple processes or not? I am on a 4 core machine and the basic threadpool/spawn/sync code I wrote runs faster, but its printing the same PID. Whats up with that?
01:51:14FromDiscord<Professor Actual Factual> (edit) "processes" => "threads"
01:51:41FromDiscord<Professor Actual Factual> (edit) "PID." => "PID for each task."
01:54:18FromDiscord<Professor Actual Factual> Operating system is windows WSL2 if that helps
01:57:33FromDiscord<Professor Actual Factual> Nvm I found the answer, I was using `getPid` instead of `getThreadId`
02:08:18FromDiscord<Professor Actual Factual> Does anyone know if its possible to do multiprocessing in Nim akin to how the threadingpools implementation is made?↵↵Im trying to create a producer-consumer workflow where the producers create a stream of tasks that are distributed to a seperate process as opposed to a seperate thread
02:34:42FromDiscord<impbox [ftsf]> it's certainly possible, you'll just need to set up some form of interprocess communication like a FIFO pipe
02:38:20FromDiscord<Jakes1403> Is Nim considered a mature language to do production ready projects with?
02:39:18FromDiscord<Yardanico> yes
02:41:43FromDiscord<Rika> You can argue that rust isn’t mature enough
02:42:03FromDiscord<Rika> It depends on you
02:45:57FromDiscord<NullCode> i wonder if you can put an asset (eg. music file) and play it beside a nim exe
02:46:16FromDiscord<NullCode> or directly embedding the asset inside the exe
02:47:07FromDiscord<impbox [ftsf]> Yes, it's possible
02:47:54FromDiscord<impbox [ftsf]> Windows exes have "Resources" which go inside the exe file
02:49:40*pch_ is now known as kinkinkijkin
02:49:49FromDiscord<impbox [ftsf]> Is C mature enough for production?
02:50:01FromDiscord<NullCode> yeah obviously lmfao
02:50:39FromDiscord<impbox [ftsf]> Maturity and production readiness are not that related
02:51:30FromDiscord<exelotl> The less C in production the better 😅
03:02:13FromDiscord<Jakes1403> My question was more along the lines of↵"will I run into any bugs that stop my from being able to have a production ready project"
03:02:20FromDiscord<Jakes1403> (edit) "my" => "me"
03:03:19FromDiscord<Rika> again depends on what youre using
03:03:30FromDiscord<Rika> you could argue that rust's slow compilation is a bug xdddd
03:03:53FromDiscord<Rika> also depends on how much effort youre willing to put in
03:07:55FromDiscord<impbox [ftsf]> There are bugs, not many are showstoppers
03:07:56FromDiscord<impbox [ftsf]> If any
03:08:38FromDiscord<impbox [ftsf]> Also depends what your requirements are for production readiness and if you just mean the language or all the libraries
03:16:40FromDiscord<Jakes1403> similar to what would happen when you hit "undefined behavior" in C++
03:17:20FromDiscord<Jakes1403> will what I write do what I intended it to
03:17:34FromDiscord<Jakes1403> or will something weird happen'
03:17:37FromDiscord<Jakes1403> (edit) "happen'" => "happen"
03:17:41FromDiscord<Jakes1403> (edit) "will what I write do what I intended it to ... " added "every time"
03:18:41FromDiscord<Rika> many corners of nim has some sort of undefined behavior, but not because it was defined to be so (like it is in C++ sometimes)
03:43:31*arkurious quit (Quit: Leaving)
04:06:01*supakeen quit (Quit: WeeChat 3.3)
04:06:30*supakeen joined #nim
04:14:49*mahlon_ joined #nim
04:15:30*Lord_Nightmare2 joined #nim
04:16:34*systemds1cks joined #nim
04:16:36*mst joined #nim
04:16:52*supakeen_ joined #nim
04:17:28*ozzz_ joined #nim
04:19:07*kayabaNerve_ joined #nim
04:19:55*neurocyte01322 joined #nim
04:19:55*neurocyte01322 quit (Changing host)
04:19:55*neurocyte01322 joined #nim
04:20:20*supakeen quit (*.net *.split)
04:20:21*mst_ quit (*.net *.split)
04:20:21*FromDiscord quit (*.net *.split)
04:20:21*ozzz quit (*.net *.split)
04:20:21*Lord_Nightmare quit (*.net *.split)
04:20:21*mahlon quit (*.net *.split)
04:20:22*systemdsucks quit (*.net *.split)
04:20:22*pch_ joined #nim
04:20:28*vicfred_ joined #nim
04:20:46*Lord_Nightmare2 is now known as Lord_Nightmare
04:21:17*mahlon__ joined #nim
04:22:03*mahlon_ quit (Read error: Connection reset by peer)
04:22:03*kayabaNerve quit (Ping timeout: 252 seconds)
04:22:03*vicfred quit (Read error: Connection reset by peer)
04:22:03*neurocyte0132 quit (Read error: Connection reset by peer)
04:22:03*neurocyte01322 is now known as neurocyte0132
04:23:07*kinkinkijkin quit (Ping timeout: 252 seconds)
04:23:38*FromDiscord joined #nim
04:26:56*Gustavo6046_ joined #nim
04:28:24*Gustavo6046 quit (Ping timeout: 252 seconds)
04:29:13*Lord_Nightmare quit (Ping timeout: 252 seconds)
04:29:28*Lord_Nightmare joined #nim
04:29:41*Gustavo6046_ is now known as Gustavo6046
04:29:46*GreaseMonkey quit (Ping timeout: 252 seconds)
04:30:23*Freneticks quit (Ping timeout: 252 seconds)
04:30:45*greaser|q joined #nim
04:33:34*Freneticks joined #nim
04:35:22*pch__ joined #nim
04:35:30*vicfred__ joined #nim
04:37:13*pch_ quit (Read error: Connection reset by peer)
04:37:13*vicfred_ quit (Read error: Connection reset by peer)
04:37:13*FromDiscord quit (Read error: Connection reset by peer)
04:37:55*FromDiscord joined #nim
04:47:22*redj quit (Ping timeout: 252 seconds)
04:47:42*redj joined #nim
04:49:01*lain quit (Ping timeout: 252 seconds)
04:49:54*lain joined #nim
05:13:28FromDiscord<Jakes1403> sent a code paste, see https://play.nim-lang.org/#ix=3AE5
05:13:43FromDiscord<Jakes1403> What would the equivalent be in Nim?
05:13:43FromDiscord<cabboose> An object
05:14:42FromDiscord<Jakes1403> Can you have functions inside of objects?
05:15:06FromDiscord<cabboose> What
05:15:08FromDiscord<Elegantbeef> Nim functions are free standing
05:15:11FromDiscord<cabboose> Yeah in the fields
05:15:39FromDiscord<cabboose> Oh you mean like objective orientated programming
05:15:47FromDiscord<Elegantbeef> You can store a function as a field in an object
05:15:56FromDiscord<Jakes1403> Okay thanks! I have been reading Nim doesn't do oo
05:16:12FromDiscord<cabboose> It does 😕
05:16:18FromDiscord<cabboose> It’s just. Why would you
05:16:20FromDiscord<cabboose> Well
05:16:21FromDiscord<Elegantbeef> It does have OOP with single parent inheritance and overriding
05:16:24FromDiscord<cabboose> You “can”
05:17:02FromDiscord<impbox [ftsf]> it's even used within nim for exceptions!
05:18:14FromDiscord<Elegantbeef> The fun part is you can use the OOP mechanism to inherit fields and functions without any runtime dyanmism
05:21:09FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3AE7 for example
05:28:46NimEventerNew thread by Puruneko: Is there any default type of generic type [T], see https://forum.nim-lang.org/t/8474
05:52:20FromDiscord<Dylan> Okay thanks
06:26:07FromDiscord<Dylan> sent a code paste, see https://play.nim-lang.org/#ix=3AEi
06:27:05FromDiscord<Dylan> I attempted to look at the nim github issues and found this funny message as an answer.
06:27:11FromDiscord<Dylan> image.png https://media.discordapp.net/attachments/371759389889003532/894108302085087332/image.png
06:27:56FromDiscord<Elegantbeef> Well you can use https://play.nim-lang.org/ for the code you're attempting to compile
06:28:05*mahlon__ is now known as mahlon
06:28:13FromDiscord<Dylan> It's bigger than one file
06:29:59FromDiscord<Elegantbeef> have a repo?
06:30:17nrds<Prestige99> What a gem
06:30:35FromDiscord<Dylan> > https://github.com/dylhack/matrix-nim-sdk/blob/core/src/matrix/core/client/js.nim↵Yeah. Currently this is the file being constructed out of all of this and causing the issues.
06:31:07FromDiscord<Dylan> Would it be best to move this to another room? I kinda have all the details laid out here\: [#matrix-nim-sdk\:newcircuit.io](https://matrix.to/#/#matrix-nim-sdk:newcircuit.io)
06:31:17FromDiscord<Elegantbeef> I'll hop over there
06:31:27FromDiscord<Elegantbeef> I mean it's not best but if you dont want to pollute 😀
06:31:46FromDiscord<Dylan> yeah there's a lot of moving parts.
07:30:05*max22- joined #nim
07:46:43FromDiscord<Dylan> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/894109156049584148): > https://github.com/dylhack/matrix-nim-sdk/blob/core/src/matrix/core/client/js.nim↵Yeah. Currently this is the file causing the issue
08:35:46*supakeen_ is now known as supakeen
08:55:18FromDiscord<Archion> Hi
08:55:25nrds<Prestige99> heyllo
08:55:43FromDiscord<Archion> <Prestige> how are you
08:55:52nrds<Prestige99> Good, how are you?
08:56:07FromDiscord<Archion> Can be better
08:57:16nrds<Prestige99> code troubles?
08:57:21FromDiscord<Archion> No
08:57:28FromDiscord<Archion> Some user insulting me
08:58:05nrds<Prestige99> It's okay, their opinion probably doesn't matter :P just do your thing
08:58:42FromDiscord<Archion> They said i am a ||retard||
08:58:49FromDiscord<Archion> :c
09:06:47FromDiscord<dom96> shitty word to use to insult someone
09:10:13FromDiscord<Elegantbeef> Implying insults are supposed to be nice?
09:10:43FromDiscord<dom96> no?
09:10:50supakeenhttps://twitter.com/supakeen/status/1444208750542401537
09:10:54supakeensorry mistell
09:10:58FromDiscord<Elegantbeef> Sorry i forgot 😛
09:27:45*max22- quit (Remote host closed the connection)
09:28:40*max22- joined #nim
09:41:50FromDiscord<dom96> what'd you forget?
09:42:17FromDiscord<dom96> btw if anyone wants to give new choosenim a try before I properly release it: https://github.com/dom96/choosenim/releases/tag/v0.8.0
09:45:33FromDiscord<xflywind> In reply to @dom96 "btw if anyone wants": It works perfectly!
09:45:54FromDiscord<dom96> yay, thanks for testing. Which platform did you test on? 🙂
09:46:01FromDiscord<xflywind> windows
09:46:05FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894158350697254922/unknown.png
09:46:58FromDiscord<xflywind> It failed often because of anti-virus before
09:47:47FromDiscord<dom96> cool, can you test that it can build Nim too via `choosenim update devel --latest`?
09:48:43FromDiscord<xflywind> there is an issue which still exists
09:48:45FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894159026194112532/unknown.png
09:49:06FromDiscord<xflywind> Does this mean I need to clean cache somewhere?
09:49:14NimEventerNew thread by FP: Nimx question, see https://forum.nim-lang.org/t/8475
09:50:44FromDiscord<dom96> In reply to @flywind "Does this mean I": hm, can you try with `--debug` flag?
09:52:59FromDiscord<xflywind> In reply to @dom96 "hm, can you try": https://jpst.it/2DN3R
09:55:25FromDiscord<xflywind> In reply to @dom96 "cool, can you test": it doesn't work for me
09:55:42FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894160777303457822/unknown.png
09:55:58FromDiscord<dom96> hm, I should switch the analytics to use puppy I suppose
09:56:00FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894160850959618049/unknown.png
09:57:11FromDiscord<dom96> can you try running that `tar xf` command manually?
10:01:51FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894162321570693120/unknown.png
10:03:35FromDiscord<dom96> any ideas why that error might be happening for you?
10:05:49FromDiscord<xflywind> I have no idea
10:09:02FromDiscord<dom96> can you create the file it's trying to create manually?
10:11:38FromDiscord<xflywind> Well, if the path is `C:\\Users\\blue\\AppData\\Local\\Temp\\choosenim-extraction\\Nim-devel\\bin\\nim-gdb.bash`, I can create it.
10:11:55FromDiscord<xflywind> I'm not sure why there is \\\\?\
10:12:08FromDiscord<xflywind> (edit) "I'm not sure why there is \\\\?\ ... " added "prefix"
10:13:05FromDiscord<dom96> hmm https://answers.microsoft.com/en-us/windows/forum/all/tar-on-windows-fails-to-extract-archive-containing/0ee9a7ea-9b1f-4fef-86a9-5d9dc35cea2f
10:13:11FromDiscord<dom96> implies this is a symlink
10:14:17FromDiscord<dom96> Oh cool, I can reproduce this
10:18:42FromDiscord<amadan> In reply to @dom96 "btw if anyone wants": Works perfect, was able to update to latest devel with no issues (tested on linux)
10:18:49FromDiscord<dom96> thanks!
10:20:35FromDiscord<dom96> so it doesn't seem I can ask tar to ignore symlinks
10:46:50FromDiscord<xflywind> In reply to @dom96 "so it doesn't seem": I find a workaround, it seems to work: https://gitlab.kitware.com/cmake/cmake/-/issues/19102#note_558431
10:48:19*sagax joined #nim
10:56:59FromDiscord<xflywind> It now works
10:57:03FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/894176208034598912/unknown.png
10:58:10*max22- quit (Ping timeout: 252 seconds)
11:11:52*xet7 quit (Remote host closed the connection)
11:12:50*xet7 joined #nim
11:25:02FromDiscord<dom96> cool, can you add it here? https://github.com/dom96/choosenim/wiki/Frequently-Asked-Questions 🙂
11:27:19FromDiscord<xflywind> In reply to @dom96 "cool, can you add": yeah, and you need to allow users to edit wiki
11:28:49FromDiscord<dom96> done
11:28:55FromDiscord<dom96> surprised that's not allowed by default
11:35:33FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=3AFC
11:40:52FromDiscord<cabboose> Integers don’t have leading 0’s though
11:41:19FromDiscord<cabboose> What’s the use case
11:42:57FromDiscord<impbox [ftsf]> If you just want the string just use the string, you could test it to make sure it's a valid number
11:43:24FromDiscord<impbox [ftsf]> ints won't have whatever formatting the string did
11:49:58FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3AFT
11:50:15FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=3AFT" => "https://play.nim-lang.org/#ix=3AFU"
11:50:31FromDiscord<haxscramper> Otherwise you need to store a number of leading zeros separately
11:53:03FromDiscord<Goel> Ok thanks i'll check it
12:06:02*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
13:06:39*arkurious joined #nim
13:07:23*jjido joined #nim
13:15:57*max22- joined #nim
13:30:59*ozzz_ is now known as ozzz
14:38:51FromDiscord<NullCode> In reply to @flywind "": oh no what is that font
14:39:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:44:49*krux02 joined #nim
14:45:15NimEventerNew post on r/nim by thelolrus: DAY 2 LIVE Nim Opossum Game programming - Ludum Dare 49, see https://reddit.com/r/nim/comments/q0j4pe/day_2_live_nim_opossum_game_programming_ludum/
14:58:05Mister_Magisterhmmm programming raspberry pi gpios us nim
14:58:20Mister_Magisterdoable?
14:58:42FromDiscord<dom96> of course
14:58:52Mister_Magisterhttps://github.com/ThomasTJdev/nim_wiringPiNim
14:58:54nrds<R2D299> itHub: 7"Nim-lang wrapper for wiringPi for controlling a Raspberry Pi"
14:58:56Mister_Magisterneat
14:58:58Mister_Magisterimma try it
14:59:20FromDiscord<dom96> I'm programming an ESP32 using Nim, RPi is on a whole different level
14:59:32Mister_Magisteroh esp32 you say?
14:59:39Mister_Magisteri was talking about that with fren recently
15:12:44FromDiscord<dom96> so I think Nim might have some problems being statically linked with musl. I believe this was the source of these bugs: https://github.com/dom96/choosenim/issues/257
15:13:05FromDiscord<dom96> or maybe it was statically linked openssl
15:43:33FromDiscord<tandy> oh nice, are you gonna make a library for that?↵(@dom96)
15:43:50FromDiscord<tandy> i wanted to write some firmware for the AirGradient with Nim maybe
15:44:48FromDiscord<dom96> maybe eventually, my focus is on the project so the code I'm writing is quite specific to it
15:44:56FromDiscord<dom96> there is actually an esp library in Nim by someone else though
15:45:02FromDiscord<dom96> but I'm not using it
15:57:27FromDiscord<zentoad> Good day nimdev peeps
15:57:58FromDiscord<zentoad> Is there a build system in nim like CMake?
15:58:36krux02zentoad: CMake is horrible why do you want that?
15:58:37FromDiscord<zentoad> Or, more specifially, if I have a repo that needs to build C/C++ libraries and then run nim is that something available?
15:58:43FromDiscord<zentoad> exactly
15:58:45FromDiscord<zentoad> I don't XD\
15:59:09FromDiscord<Rika> In reply to @krux02 "<@459174286104461312>: CMake is horrible": i can attest to that lmfao
15:59:14krux02best thing is if you can use {.compile: "myfile.cpp".} for your dependencies
15:59:28FromDiscord<Rika> long time no see krux, unless ive been ootl?
15:59:37FromDiscord<zentoad> I'm loving nim but getting the other team members onboard means the git pull and build which I cannot figure out atm
15:59:39krux02no I was actually not here
15:59:50krux02I am not often here anymore
15:59:58FromDiscord<Rika> well that is unfortunate
16:00:08FromDiscord<zentoad> In reply to @krux02 "best thing is if": does that go in a nim-script file
16:00:40FromDiscord<dom96> you just put it in the module where you wrap the C/++ code
16:00:40krux02zentoad: no just in a normal Nim source file
16:00:57FromDiscord<tandy> oh neat↵(@dom96)
16:01:05FromDiscord<zentoad> Ahh, ok.
16:01:28FromDiscord<zentoad> I figures because it's a crazy windows lib/dll will tons of dependencies this would be tricky
16:01:37FromDiscord<zentoad> figured
16:02:06FromDiscord<dom96> might be easier to just load that dll in Nim then
16:02:35FromDiscord<haxscramper> sent a code paste, see https://paste.rs/ffQ
16:02:39FromDiscord<haxscramper> if you want to build nim app using cmake and supply things
16:02:46FromDiscord<zentoad> Although I hate CMake, so devs have Linux and some PC so it's always complicated
16:03:00FromDiscord<haxscramper> I did this
16:03:02FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3AHR
16:03:32FromDiscord<zentoad> Ahh that's great
16:03:38FromDiscord<haxscramper> https://github.com/haxscramper/hcparse/blob/master/src/hcparse/boost_wave/CMakeLists.txt#L44-L55
16:03:48FromDiscord<haxscramper> I had this for some time, right now I build nim externally
16:04:10*Zevv_ is now known as Zevv
16:04:24FromDiscord<haxscramper> in theory there is a better solution using cmake dependencies, and `add_custom_command`, but I wasnt able to figure it out correctly
16:04:42FromDiscord<haxscramper> nim generating C files is actually a huge problem, cmake has to know all it's inputs at the same time
16:04:44FromDiscord<haxscramper> there is a
16:05:29FromDiscord<Recruit_main707> nimble allows to compile c/c++ files afaik
16:05:31krux02cmake also has globbing
16:06:06krux02not sure how cmake works with generated source files
16:06:08FromDiscord<haxscramper> https://stackoverflow.com/questions/37703514/dynamically-generated-source-file-list-for-cmake
16:06:10FromDiscord<haxscramper> this
16:06:14krux02that is a thing in the C/C++ world as well
16:06:15FromDiscord<haxscramper> haha funnyu↵(@Recruit_main707)
16:06:32FromDiscord<haxscramper> it has to glob files that exist at configuration time
16:06:42FromDiscord<haxscramper> and nim generates file as a part of build process
16:07:10FromDiscord<zentoad> In reply to @haxscramper "haha funnyu (<@386230567571554305>)": This was my original problem, I downloaded nimgl but it didn't actually compile on windows. And I ended up down a rabbit hole
16:07:38krux02haxscramper, build once, glob, build again
16:07:52krux02the generates files don't magically disappear
16:08:13FromDiscord<haxscramper> this would require multistaged cmake etc.
16:08:20krux02yes
16:08:26FromDiscord<haxscramper> I wasn't that interested
16:08:32krux02as I said, I CMake is horrible
16:08:43FromDiscord<zentoad> In reply to @krux02 "as I said, I": exaclty
16:08:54FromDiscord<zentoad> I usually have a hand written .bat file
16:08:54FromDiscord<haxscramper> `add_custom_target` works fine in theory, you just have to delegate build to nim fully
16:09:01FromDiscord<haxscramper> which might be the right solution
16:09:09FromDiscord<zentoad> but for supporting different OS this isn't sustainable
16:09:10FromDiscord<haxscramper> since teaching cmake about nim is even worse
16:10:29*greyrat quit (Quit: Bye)
16:11:48FromDiscord<NullCode> In reply to @zentoad "I usually have a": same
16:11:57FromDiscord<NullCode> working well for my shitty experiments rn
16:12:05FromDiscord<NullCode> but i believe ill suffer soon™️
16:12:25FromDiscord<dom96> why write .bat when you can write nimscript? 🙂
16:12:55FromDiscord<NullCode> because i still havent learnt about it (yet) :)
16:12:55*greyrat joined #nim
16:13:39FromDiscord<dom96> here is a great example https://github.com/nim-lang/nimforum/blob/master/nimforum.nimble#L28-L64
16:14:46FromDiscord<NullCode> wait what
16:14:50FromDiscord<NullCode> thats really cool
16:15:08FromDiscord<NullCode> i can discard my .bat file then
16:25:41FromDiscord<zentoad> That’s what I was looking for
16:39:27FromDiscord<dom96> Choosenim 0.8.0 is here https://forum.nim-lang.org/t/8476 🙂
16:39:58NimEventerNew thread by Dom96: Choosenim 0.8.0 now available, see https://forum.nim-lang.org/t/8476
16:41:52NimEventerNew post on r/nim by dom96: Choosenim 0.8.0 is now available, see https://reddit.com/r/nim/comments/q0lgcq/choosenim_080_is_now_available/
16:47:31FromDiscord<Schelz> "noob here", how do I run a nim file ?
16:47:47FromDiscord<dom96> `nim c -r file.nim`
16:47:53FromDiscord<Schelz> thx
16:48:31FromDiscord<enthus1ast> this however compiles the nim file to an executable, and then runs this executable
16:49:10FromDiscord<enthus1ast> the nim compiler does not "run" the nim file like the python interpreter would do (in this case)
16:50:20FromDiscord<dom96> true
17:18:56FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3AIf
17:19:08FromDiscord<tandy> @dom96 i just did `choosenim update self` and updated devel and now iget this?
17:20:46FromDiscord<tandy> im going to make an isse
17:24:39FromDiscord<tandy> https://github.com/dom96/choosenim/issues/272
17:27:48FromDiscord<tandy> I managed to fix the error by running sudo chmod +x \~/.choosenim/toolchains/nim-#devel/bin/nim.
17:44:27FromDiscord<dom96> thanks for reporting
17:44:35FromDiscord<dom96> choosenim has some logic that sets +x
17:44:44FromDiscord<dom96> I guess it didn't run in that instance
17:49:19*pro joined #nim
17:49:22*beshr joined #nim
17:57:16*neurocyte0132 quit (Read error: Connection reset by peer)
17:57:45*neurocyte0132 joined #nim
17:57:45*neurocyte0132 quit (Changing host)
17:57:45*neurocyte0132 joined #nim
18:00:17*jjido joined #nim
18:00:53*neurocyte01328 joined #nim
18:00:53*neurocyte01328 quit (Changing host)
18:00:53*neurocyte01328 joined #nim
18:03:14*neurocyte0132 quit (Ping timeout: 245 seconds)
18:03:14*neurocyte01328 is now known as neurocyte0132
18:13:40*neurocyte0132 quit (Ping timeout: 252 seconds)
18:15:45*neurocyte01328 joined #nim
18:15:45*neurocyte01328 quit (Changing host)
18:15:45*neurocyte01328 joined #nim
18:24:15*vicfred__ quit (Quit: Leaving)
18:24:40*neurocyte013288 joined #nim
18:24:40*neurocyte013288 quit (Changing host)
18:24:40*neurocyte013288 joined #nim
18:26:49*neurocyte01328 quit (Ping timeout: 252 seconds)
18:26:49*neurocyte013288 is now known as neurocyte01328
18:31:29*max22- quit (Ping timeout: 250 seconds)
18:31:36*neurocyte01328 quit (Quit: The Lounge - https://thelounge.chat)
18:35:17*neurocyte013288 joined #nim
18:35:17*neurocyte013288 quit (Changing host)
18:35:17*neurocyte013288 joined #nim
18:51:06*max22- joined #nim
19:05:16FromDiscord<retkid> so i have a json file thats enclosed in an array
19:05:25FromDiscord<retkid> how do i get into that array level
19:05:27FromDiscord<retkid> ie
19:06:07FromDiscord<retkid> "{hits : hits{["field" : 32, "field2" : 11]}}"
19:06:28FromDiscord<retkid> dont blame me this is just he way its delivered to me
19:07:30FromDiscord<retkid> you cant do "json["hits"]["hits"]{"field"}
19:07:33FromDiscord<retkid> (edit) ""json["hits"]["hits"]{"field"}" => ""json["hits"]["hits"]{"field"}""
19:10:02FromDiscord<zidsal> Can you send us the actual json string as that's not valid json!
19:11:22FromDiscord<Yardanico> @retkid as zidsal said, this is not valid JSON
19:11:31FromDiscord<Yardanico> in JSON all keys are quoted
19:11:33FromDiscord<retkid> grabbing some valid jason
19:11:39FromDiscord<zidsal> Thanks ret
19:13:22FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3AKj
19:13:50FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=3AKj" => "https://play.nim-lang.org/#ix=3AKk"
19:14:09FromDiscord<Yardanico> `data["hits"]["hits"]`
19:14:10FromDiscord<Yardanico> will be your array
19:14:14FromDiscord<retkid> yea
19:14:22FromDiscord<Yardanico> so what's the issue?
19:14:28FromDiscord<retkid> but if i try to go to "total" it returns an assertion issue
19:14:36FromDiscord<Yardanico> because you should do data["hits"]
19:14:38FromDiscord<Yardanico> (edit) "because you should do data["hits"] ... " added "for total"
19:14:56FromDiscord<Yardanico> the JSON you sent is↵↵hits -> (total, max_score, hits -> [array of hits])
19:14:59FromDiscord<zidsal> Just to check are you using the inbuilt Json library or the other one that people use ( can't remember the name!)
19:15:04FromDiscord<Yardanico> no
19:15:08FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=3AKl
19:15:09FromDiscord<Yardanico> check the JSON you have again
19:15:12FromDiscord<Yardanico> "total" is inside the first "hits"
19:15:20FromDiscord<Yardanico> so you just do jsonObject["hits"]["total"]
19:15:26FromDiscord<Yardanico> .getInt()
19:15:30FromDiscord<retkid> it is
19:15:41FromDiscord<retkid> oh wait sorry, im looking for _score
19:15:43FromDiscord<retkid> i meant to say
19:16:01FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=
19:16:03FromDiscord<Yardanico> well to get the score of a _first_ hit you need jsonObj["hits"]["hits"][0]["_score"]
19:16:10FromDiscord<retkid> AHHH
19:16:11FromDiscord<retkid> ok
19:16:14FromDiscord<Yardanico> it's an array
19:16:17FromDiscord<Yardanico> you need to index into it
19:16:28FromDiscord<retkid> yea it returns an iterable array
19:16:32FromDiscord<retkid> cool
19:16:49FromDiscord<retkid> thank you <3
19:17:29FromDiscord<retkid> i thought it would return just a mush of strings and i would need a function to turn it into an array
19:17:43FromDiscord<Yardanico> it parses the _whole_ JSON object
19:17:46FromDiscord<Yardanico> not just some part of it
19:18:12FromDiscord<Yardanico> after you do parseJson you don't have the original json string data at all, you have a tree of `JsonNode`s
19:18:54FromDiscord<retkid> that is very useful to keep in mind
19:18:57FromDiscord<retkid> thank
19:18:58FromDiscord<retkid> (edit) "thank" => "thanks"
19:22:06FromDiscord<retkid> of all the trials and tribulations this is the thing i needed help with
19:22:07FromDiscord<retkid> lol
19:22:21FromDiscord<retkid> (edit) "of all the trials and tribulations ... this" added "I've been threw this week,"
19:33:15*pro quit (Quit: WeeChat 3.3)
19:36:06*rockcavera joined #nim
19:36:06*rockcavera quit (Changing host)
19:36:06*rockcavera joined #nim
19:37:53*Guest5452 joined #nim
19:40:52*Guest5452 quit (Client Quit)
19:57:49*rockcavera quit (Ping timeout: 245 seconds)
20:11:57*krux02 quit (Quit: Leaving)
20:13:05*krux02 joined #nim
20:16:53*kayabaNerve_ quit (Ping timeout: 264 seconds)
20:23:14*kayabaNerve joined #nim
20:32:30FromDiscord<el__maco> hello, I started flailing with nim today and I'm afraid I might have some very noobish questions if you don't mind. My first confusion is about passing arrays efficiently to a procedure by reference
20:33:34FromDiscord<el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3AKH
20:34:32FromDiscord<el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3AKI
20:35:05FromDiscord<el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3AKJ
20:35:29FromDiscord<el__maco> what would be the sane way to achieve this? I'm concerned about the "var" keyword there, I suspect I might be doing a deep copy here
20:35:59FromDiscord<el__maco> also I would like to get rid of that uint8 cast somehow, and replace it with the actual type from the template
20:37:06FromDiscord<dom96> 'var' won't make a deep copy
20:37:15FromDiscord<dom96> but you can check the generated C sources if you'd like to make sure
20:42:10*neurocyte013288 quit (Ping timeout: 252 seconds)
20:44:45FromDiscord<el__maco> is there an easy way to do that?
20:45:15FromDiscord<auxym> compile with `--nimcache:nimcache`, the generated C sources will be in ./nimcache
20:46:05FromDiscord<el__maco> I see
20:50:27FromDiscord<Yardanico> @elmaco but yeah, in your case it would never generate a deep copy since you're using `var`
20:50:48FromDiscord<Yardanico> `var Type` in argument list means that you want to pass the argument by reference so you can modify the original one
20:51:07FromDiscord<Yardanico> and about uint8 thing - first of all, in Nim that's a type-safe conversion and not a cast, and what do you mean "from the template"?
20:51:18FromDiscord<Yardanico> you want it to automatically convert to whatever type Canvas has?
20:51:27FromDiscord<el__maco> yes
20:54:37FromDiscord<auxym> Then you'll probably want to make `Noise` generic with a similar def as your `Canvas`
20:55:08FromDiscord<Yardanico> Noise is already generic
20:55:12FromDiscord<Yardanico> it's an implicit generic
20:55:47FromDiscord<auxym> But if you need to extract the `T` integer type, wouldn't you need to make it explicitly generic?
20:56:02FromDiscord<Yardanico> not neccesarily
20:56:03FromDiscord<Yardanico> watch this
20:56:23FromDiscord<Yardanico> :D
20:56:26FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3AKP
20:56:30FromDiscord<Yardanico> yes, that is a documented feature
20:56:49FromDiscord<auxym> neat, did not know this trick!
20:57:32FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/894327329935990854/unknown.png
20:57:37FromDiscord<Yardanico> in https://nim-lang.org/docs/manual.html#generics-implicit-generics
20:58:29FromDiscord<Yardanico> fwiw, it works with `Canvas.T` too (as in that example above):
20:58:30FromDiscord<el__maco> that seems to work 👍
20:58:35FromDiscord<auxym> Btw, proc params are never copied, whether they are `var` or not, right? Unless there's an assignment or something like that in the proc body, obviously
20:58:41FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3AKQ
20:59:05FromDiscord<el__maco> I'm looking at the C code for the Noise procedure, and I have to say it looks kinda scary
20:59:11FromDiscord<Yardanico> it's totally fine
20:59:19FromDiscord<Yardanico> also, the debug C code has a lot of cruft
20:59:24FromDiscord<Yardanico> try with -d:danger --gc:arc --panics:on
20:59:32FromDiscord<Yardanico> @auxym nim optimizes big projects to pass them by-reference but they will still act as value types
20:59:38FromDiscord<el__maco> there's lots of memsets and memcmp's in there
20:59:41FromDiscord<Yardanico> but generally value types are passed by value, so they are copied (if they're under 24 bytes)
20:59:59FromDiscord<auxym> In reply to @Yardanico "<@!882793909246369864> nim optimizes big": Yes that was my impression.
20:59:59FromDiscord<el__maco> (edit) "memcmp's" => "memcpy's"
21:00:09FromDiscord<Yardanico> if you pass an int to a proc, it'll get copied
21:00:13FromDiscord<auxym> I see!
21:00:13*Gustavo6046 quit (Quit: In exile.)
21:00:34FromDiscord<Yardanico> @elmaco well, it's better to measure performance by running the resulting binary, not by checking the C code :)
21:00:41FromDiscord<auxym> so generally nim "does the right thing"
21:00:52*krux02 quit (Ping timeout: 252 seconds)
21:01:16FromDiscord<Yardanico> @elmaco if you're on latest nim, it's generally better to use --gc:orc (that's the future default Nim GC)
21:01:36FromDiscord<Yardanico> --gc:arc is just refcounting with move semantics and stuff like destructors, ORC is arc + cycle collector
21:02:19FromDiscord<Yardanico> so generally you can just use --gc:orc if you don't know if your program has cycles or not, ORC has a very low overhead over ARC when you don't have cycle types at all
21:03:19FromDiscord<el__maco> I intend to run some kind of benchmark against my c++ codes, but only when I have at least a rudimentary idea of what I'm doing. So far I quite like the language, especially the clean syntax is nice and ``{.experimental: "codeReordering".}`` is something I've wanted for a long time
21:03:51FromDiscord<Yardanico> well, if we get lazy semchecking, then codeReordering will be history
21:04:05FromDiscord<Yardanico> and of course codeReordering doesn't help when you have mutually recursive procedures
21:04:27FromDiscord<el__maco> what does lazy semchecking mean. I hope you don
21:04:46FromDiscord<el__maco> (edit) "don" => "don't have to forward declare everything"
21:05:06FromDiscord<Yardanico> https://github.com/nim-lang/RFCs/issues/416
21:05:41FromDiscord<auxym> Yeah, lazy semcheck would be we could lose forward declares, and get circular imports
21:06:04FromDiscord<el__maco> that's good then
21:20:07*krux02 joined #nim
21:35:16*Gustavo6046 joined #nim
21:48:22*xet7 quit (Remote host closed the connection)
21:49:22*xet7 joined #nim
21:54:52*Gustavo6046 quit (Remote host closed the connection)
21:55:05*Gustavo6046 joined #nim
22:08:34*Guest36 joined #nim
22:09:14Guest36Is nim-Lang.org down for anyone? It’s not loading for me in California
22:09:46FromDiscord<dom96> works here
22:09:55Guest36forum.nim-Lang.org works though
22:09:55FromDiscord<dom96> (not in CA though)
22:11:27FromDiscord<Yardanico> @Guest36 what's the error you're getting?
22:11:36FromDiscord<Yardanico> if it's just not loading, then it's something to do with cloudflare in your region
22:11:47FromDiscord<Yardanico> because it the nim-lang backend was failing, cloudflare would show an error page
22:12:23Guest36Not sure, I’m on an iPhone. It just hangs forever when loading
22:12:37*Guest36 quit (Client Quit)
22:13:17*Guest36 joined #nim
22:13:38Guest36Never mind actually, just closed all of my Safari tabs and restarted Safari, and now it loads
22:13:40Guest36weird
22:31:23*Guest36 quit (Quit: Client closed)
22:52:57*algae joined #nim
22:53:20*xet7 quit (Remote host closed the connection)
22:54:21*xet7 joined #nim
23:12:25*max22- quit (Remote host closed the connection)
23:30:43FromDiscord<retkid> are there any packages with algorithms such as like Tversky index
23:31:27FromDiscord<retkid> i wanna try string indexs without programming each one
23:31:38FromDiscord<retkid> i suppose Harmmon would be good enought ho
23:31:53FromDiscord<retkid> (edit) "Harmmon" => "Harmming"
23:32:01FromDiscord<retkid> (edit) "Harmming" => "Ha\mming"
23:32:05FromDiscord<retkid> (edit) "Ha\mming" => "Hamming"
23:32:11FromDiscord<el__maco> by the way, I downloaded the latest? 64 bit version (1.4.8) for windows, extracted the files and one of the exes were immediately caught and quarantined by Windows Defender for being a virus. Probably known thing at this point, but I thought I'd mention anyways 🤷‍♂️
23:35:21*rockcavera joined #nim
23:35:21*rockcavera quit (Changing host)
23:35:21*rockcavera joined #nim
23:50:40*algae quit (Quit: WeeChat 3.3)