<< 08-08-2023 >>

00:00:06FromDiscord<nomad> (edit) "In reply to @ajusa "Yes? No non-Nim dependencies": so no ... dlls" added "extra"
00:03:17FromDiscord<ajusa> In reply to @nomad "so no extra dlls": Correct
00:04:02FromDiscord<Andreas> sent a long message, see https://paste.rs/233qu
00:04:29FromDiscord<Andreas> (edit) "http://ix.io/4COZ" => "http://ix.io/4COY"
00:06:17FromDiscord<dowylju> sent a code paste, see https://play.nim-lang.org/#ix=4CP0
00:07:35FromDiscord<dowylju> (edit) "https://play.nim-lang.org/#ix=4CP0" => "https://play.nim-lang.org/#ix=4CP1"
00:09:13FromDiscord<huantian> `var packedMsg2 = packMsg("addr", data, message)`
00:11:49FromDiscord<huantian> https://play.nim-lang.org/#ix=4COX
00:11:54FromDiscord<huantian> fixed a few other minor things
00:12:04FromDiscord<huantian> lemme know if any fix in particular you don't understand
00:13:52FromDiscord<dowylju> the "addr" and "data" in `message2` are supposed to be the first and second arguments
00:23:39FromDiscord<dowylju> sent a code paste, see https://play.nim-lang.org/#ix=4CP4
00:25:29FromDiscord<dowylju> sent a code paste, see https://play.nim-lang.org/#ix=4CP5
00:27:05*_0x00 joined #nim
00:31:42FromDiscord<huantian> ah
00:31:45FromDiscord<huantian> i'd do an overload
00:34:51FromDiscord<huantian> https://play.nim-lang.org/#ix=4CP7
00:35:29FromDiscord<huantian> probably not having a huge line 20 like I did but you get the idea
00:44:06FromDiscord<dowylju> is overload when the same proc is defined twice?
00:46:41FromDiscord<dowylju> also, what is the benefit of using .toOpenArray vs [2..^4]
01:01:36*_0x00 quit (Ping timeout: 260 seconds)
01:10:18FromDiscord<huantian> yep same proc name, different signature
01:10:23FromDiscord<huantian> which is how the compielr knows which one to use
01:10:35FromDiscord<dowylju> ah ok, thank you
01:11:35FromDiscord<dowylju> sent a code paste, see https://play.nim-lang.org/#ix=4CPb
01:12:09FromDiscord<dowylju> (edit) "https://play.nim-lang.org/#ix=4CPb" => "https://play.nim-lang.org/#ix=4CPc"
01:15:20NimEventerNew thread by walkr: Why is My Nim Code Faster when Doing This, see https://forum.nim-lang.org/t/10384
01:29:23*lucasta joined #nim
02:06:25FromDiscord<therealori> sent a long message, see http://ix.io/4CPn
02:17:30FromDiscord<bung8954> `stdin {.importc: "stdin", header: "<stdio.h>".}: File`
02:18:13FromDiscord<bung8954> it's in std/syncio module
02:19:27FromDiscord<therealori> Okay, so how would I import it in the code then? just `import std/syncio` and then I can use `stdin.readline()`?
02:20:12FromDiscord<therealori> (edit) "`stdin.readline()`?" => "`stdin.readline()`?↵↵~~I'm like VERY new to Nim so sorry for not really understanding what to do with what you have said~~"
02:20:13FromDiscord<bung8954> yes
02:20:16FromDiscord<therealori> Okay
02:20:23FromDiscord<therealori> I'll give it a try
02:21:45FromDiscord<therealori> It seems to have worked, Ty
02:21:47FromDiscord<bostonboston> you can also try `import std/rdstdin`
02:23:43FromDiscord<therealori> In reply to @bostonboston "you can also try": I saw it when looking/browsing around for answers and I thought about it. I'll look into how to use it another time, but for now Bung's answer is working and i'll use that for now as I explore Nim and use it more.
02:59:22*lucasta quit (Quit: Leaving)
04:32:06FromDiscord<rio> Friendly bot warning.
04:38:59FromDiscord<odexine> No sentient AIs allowed
04:59:30*advesperacit joined #nim
06:07:28*emery joined #nim
06:09:16*oprypin_ joined #nim
06:12:59*ehmry quit (*.net *.split)
06:13:02*oprypin quit (*.net *.split)
06:13:03*termer quit (*.net *.split)
06:13:03*euantorano_ quit (*.net *.split)
06:20:14*termer joined #nim
06:30:51FromDiscord<5starrss> nevermind
06:32:15*euantorano_ joined #nim
06:36:02*PMunch joined #nim
06:53:18*azimut quit (Ping timeout: 240 seconds)
06:59:27*rockcavera quit (Remote host closed the connection)
07:15:27NimEventerNew thread by Cnerd: How to prevent nim language server plugin from spawning multiple instances of nimsuggest, see https://forum.nim-lang.org/t/10386
07:23:34Amun-Raif I have type Foo = distinct uint32 (and define it's `a=`, `b=` etc.) can I define a custom init function that'll work like: Foo(a: 2, b: 3)?
07:29:06PMunchHmm, I don't think so. Closest you can get AFAIK is `Foo(a = 2, b = 3)`
07:29:58PMunchThat syntax is bare object creation, so nothing gets called when you do that
07:30:37Amun-Raright, I have an object (a color) with r, g, b and a members and I use special case for js target; I was wondering whether I could use single rgba*(T: typedesc[Color], r, g, b, a: byte): T = T(r: r, g: g, b: b, a: a)
07:31:15Amun-Rathanks
07:31:28FromDiscord<Elegantbeef> Whendef the constructors for JS
07:32:08PMunchWell, you could use bitfields for the C version
07:32:17*ntat joined #nim
07:32:26PMunchI assume you use `a=`, `b=` etc. to mask and bit shift into the right place?
07:33:51Amun-Raright now I have two init functions, as in https://play.nim-lang.org/#ix=4CQk
07:39:07FromDiscord<griffith1deadly> https://nim-lang.org/docs/coro.html will this module ever be stable?
07:39:54PMunchIs stale the same as stable?
07:40:35Amun-Ra;)
07:42:47FromDiscord<nomad> So ive been working with sql. I want to be able to interact with sqllite databases, and do things like add or extract data. Is there any way of "including" a dll in my compiled executable, so i dont need to send dll files along with my executable?
07:43:00FromDiscord<Elegantbeef> 5/6ths the way to stable
07:43:16FromDiscord<griffith1deadly> In reply to @Elegantbeef "5/6ths the way to": thanks
07:43:56FromDiscord<Elegantbeef> No problem I just made the same joke Pmunch did just worse
07:44:14PMunchElegantbeef, haha, I was starting to wonder if you where actually working on coro
07:44:33FromDiscord<Elegantbeef> We have CPS, just use trhat
07:44:36FromDiscord<Elegantbeef> that even
07:44:42PMunchnomad, you can read it into your program at compile-time, then write it out during runtime and then dynamically load it.
07:45:02PMunchBut you might run foul of some licensing terms..
07:45:04FromDiscord<griffith1deadly> In reply to @Elegantbeef "We have CPS, just": https://github.com/nim-works/cps you mean it?
07:45:17FromDiscord<Elegantbeef> Yes
07:45:27FromDiscord<nomad> In reply to @PMunch "<@1126976318379139172>, you can read": How would i be able to do that?
07:47:44FromDiscord<nomad> I would prefer not writing any files, any other way?
07:51:18PMunchNot really..
07:51:26FromDiscord<Phil> In reply to @nomad "How would i be": You can read in at compiletime using staticRead
07:51:30PMunchUnless of course you can just statically link
07:51:43FromDiscord<Phil> Static Linking is a possibility but also ho boy
07:52:13FromDiscord<Phil> That'd be statically linking essentially the sqlite lib into your binary, that seems a smidge like an ordeal
07:52:47FromDiscord<Phil> Is having some kind of install script/installation wizard a possibility?
07:52:57FromDiscord<nomad> Preferably not
07:53:12FromDiscord<griffith1deadly> https://github.com/khchen/memlib↵or use it for windows
07:53:26FromDiscord<nomad> Could you tell me more about static linking?
07:54:24FromDiscord<Phil> In reply to @griffith1deadly "https://github.com/khchen/memlib or use it": Wait so basically load in the compiled lib at compile-time, at runtime you barf that into memory and load that into your application?
07:54:39FromDiscord<Phil> Distributing complex programs can be wild
07:54:42FromDiscord<griffith1deadly> In reply to @isofruit "Wait so basically load": +
07:55:08FromDiscord<Phil> That seems like such a hack but also somehow maybe valid
07:56:40FromDiscord<Phil> In reply to @griffith1deadly "+": Thanks for the explainer, noticing these kinds of workaround is pretty interesting, even if I look at it from a webdev perspective
07:56:48FromDiscord<Phil> (edit) "explainer," => "explainer btw.,"
07:57:13FromDiscord<Phil> (edit) "explainer" => "confirmation"
07:58:16FromDiscord<nomad> In reply to @griffith1deadly "https://github.com/khchen/memlib or use it": Brooo thank you so much
07:58:28FromDiscord<nomad> You saved my day lol
07:58:32FromDiscord<toma400> sent a long message, see http://ix.io/4CQx
07:58:42FromDiscord<toma400> sent a long message, see http://ix.io/4CQx
07:59:18FromDiscord<toma400> (edit) "http://ix.io/4CQx" => "http://ix.io/4CQy"
07:59:46FromDiscord<toma400> (edit) "http://ix.io/4CQy" => "http://ix.io/4CQz"
08:00:01FromDiscord<toma400> (edit) "http://ix.io/4CQz" => "http://ix.io/4CQA"
08:00:40FromDiscord<griffith1deadly> In reply to @toma400 "Dang, Nim 2.0 releasing": the only thing that's really missing is perfect support like in other languages...
08:00:59FromDiscord<griffith1deadly> (edit) "In reply to @toma400 "Dang, Nim 2.0 releasing": the only thing that's really missing is perfect support ... like" added "ide"
08:03:02FromDiscord<toma400> In reply to @griffith1deadly "the only thing that's": PyCharm with Nim plugin is pretty good, but yeah
08:03:10FromDiscord<toma400> (edit) "yeah" => "yeah, I gotta agree"
08:05:16FromDiscord<griffith1deadly> In reply to @toma400 "PyCharm with Nim plugin": as i recall with idea it work's very bad
08:10:17FromDiscord<koili> intellij/jetbrains ides will have lsp support soon (might be out even now), so its just a matter of time until the support improves for all editors
08:13:33FromDiscord<odexine> SQLite license is apparently public domain,
08:13:36FromDiscord<odexine> ?
08:15:29FromDiscord<odexine> So no licensing problems from static linking
08:36:47FromDiscord<toma400> In reply to @griffith1deadly "as i recall with": Weird. Did you use recent version? I find it rather good quality-wise, with only small irritating part that AST doesn't update with macro libraries imported (so using `classes` for example doesn't give you any good syntax indication as it happens with native structs) and not all middle-clicking works correctly
08:36:56FromDiscord<toma400> (edit) "Weird. Did" => "Weird... did"
08:38:36FromDiscord<griffith1deadly> In reply to @toma400 "Weird... did you use": classes also bad work's on vscode
08:39:33FromDiscord<Elegantbeef> Well classes is untyped AST so it will not work well anywhere, the thing is though with nimsuggest based tooling you can go to symbols declared in that macro
08:42:01FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/KpEwm
08:42:32FromDiscord<Elegantbeef> Afaik jetbrains is completely blind in their implementation and it works only on the language's base semantics, no template or macro expansion
09:03:24FromDiscord<Andreas> In reply to @Elegantbeef "Afaik jetbrains is completely": yes, AFAIK it doesn't use `nimsuggest`, BUT its still decent and provides a usable symbol-view, which contains all of nim's `routine`-types (proc|func|template|macro|converter|iterator). From the free-IDEs i like it most..
09:03:29FromDiscord<odexine> It would be cool if macros had a mechanism to provide suggestions
09:05:33FromDiscord<Elegantbeef> Would be quite a complicated thing to do
09:06:20FromDiscord<odexine> Or to design
09:09:06FromDiscord<Andreas> In reply to @Elegantbeef "Afaik jetbrains is completely": missing features would be:↵- associate a forward-decl with its implementation↵- group-display type-bound-routines to their type-definition
09:09:54FromDiscord<Andreas> (edit) "be:↵-" => "be:↵1." | "implementation↵-" => "implementation↵2." | "type-definition" => "type-definition↵point-2 is smth. no IDE can provide AFAIK."
09:10:19FromDiscord<Elegantbeef> Impbox wrote some ctags for that iirc
09:10:35FromDiscord<Elegantbeef> Unless you mean hooks
09:10:44FromDiscord<Elegantbeef> I assume you mean the first parameter
09:11:14FromDiscord<Andreas> In reply to @Elegantbeef "Unless you mean hooks": is Impbox a user ? or a tool ?
09:12:25FromDiscord<jmgomez> Does someone has another use case for this? https://github.com/nim-lang/Nim/issues/22411
09:12:42FromDiscord<Andreas> In reply to @Elegantbeef "I assume you mean": yes, i mean the most typical way to have (proc,func,..) use a type as its firtst-param. Isn't that "type-bound-routine" ?
09:12:58FromDiscord<Andreas> (edit) "firtst-param." => "first-param."
09:13:08FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "I assume you mean": yes, i mean the most typical way to have (proc,func,..) use a type as its first-param. Isn't that ... "type-bound-routine"" added "called"
09:13:28FromDiscord<odexine> In reply to @Andreas "is Impbox a user": User
09:13:59FromDiscord<odexine> In reply to @Andreas "yes, i mean the": Not really no
09:14:03FromDiscord<System64 ~ Flandre Scarlet> Hi, do you know how I can calculate the lag between when the packet is sent and when the server receives the packet?↵Would embedding the result of epochTime() be useful?
09:14:17FromDiscord<odexine> Type bound usually means that when you get the type the thing that’s bound also comes with it
09:14:31FromDiscord<odexine> Like in Python the methods of a type come with it when you import just the type
09:14:55FromDiscord<Andreas> In reply to @odexine "Like in Python the": so what would be the common name for that ?
09:15:05FromDiscord<odexine> In Nim, procedures are not necessarily related only to the first parameter of their signature
09:15:17FromDiscord<odexine> In reply to @Andreas "so what would be": For what Nim does? Nothing really, they’re just procedures
09:15:30FromDiscord<jmgomez> There are a few cases in Nim where the proc is attached to the type though
09:15:37FromDiscord<odexine> It’s just common practice to have the first parameter related to a procedure
09:15:51FromDiscord<jmgomez> At least in the implementation
09:16:09FromDiscord<Andreas> ahhh, so commonly refered to as "routine is attached to a type(-definition)" ?
09:16:41FromDiscord<Andreas> (edit) "ahhh, so commonly refered to as "routine is attached to a type(-definition)" ? ... " added "or "routine is related to .." ?"
09:16:50FromDiscord<Andreas> (edit) "ahhh, so commonly refered to as "routine is attached to a type(-definition)" ? or "routine is related to .." ? ... " added "What does the manual say ?"
09:17:20FromDiscord<Andreas> (edit) "ahhh, so commonly refered to as "routine is attached to a type(-definition)" ? or "routine is related to .." ? What does the manual say ? ... " added "i'll have a look..."
09:29:25FromDiscord<nomad> In reply to @griffith1deadly "https://github.com/khchen/memlib or use it": What do you think about https://github.com/nim-lang/sdl2#static-linking-sdl2
09:52:25*tinystoat quit (*.net *.split)
09:52:27*madprops quit (*.net *.split)
10:04:21*tinystoat joined #nim
10:04:21*madprops joined #nim
10:07:20*def- quit (Quit: -)
10:09:51*def- joined #nim
10:40:11FromDiscord<enthus1ast> put it in a zip file, and call it a day↵(@nomad)
10:40:23FromDiscord<enthus1ast> or, if you feel fancy, build an installer with eg. nsis
10:41:38FromDiscord<Phil> The entire "Provide your environment libs yourself" just feels so dirty
10:42:06FromDiscord<Phil> Does windows not have an sqlite lib included by default?↵Or something else that you can rely on?↵Do they have a flatpak equivalent?
10:42:17FromDiscord<enthus1ast> but the thing is, it works, not so on linux (glibc mismatch, blaba, use appimage they say, use docker they say)
10:43:11FromDiscord<enthus1ast> then you might think "well i'll use musl" until you find out that it cannot load dlls \:)
10:43:26FromDiscord<enthus1ast> then you build appimage or use docker
10:43:36FromDiscord<Phil> Wait, you can use a binary that has statically compiled in musl on windows?
10:43:38FromDiscord<enthus1ast> its worse in linux than on windows in my opinion
10:43:46FromDiscord<Phil> Ah, you were still on linux
10:43:53FromDiscord<enthus1ast> no i was just venting a little \:)
10:43:57FromDiscord<enthus1ast> i have this issue currently
10:43:59FromDiscord<enthus1ast> ;)
10:44:20FromDiscord<Phil> hmm... I dunno, since I assume its not graphical, a snap?
10:44:32FromDiscord<enthus1ast> oh the evil workd
10:44:33PMunchenthus1ast, I very seldom run into dynamic library mismatches, and when I do it's very often as easy as updating a package
10:45:05PMunchI much prefer Linux' system over every program shipping all their dependencies Windows-style
10:45:18FromDiscord<enthus1ast> glibc makes linux binaries not cross system compatible
10:45:39FromDiscord<enthus1ast> thats the whole reason why snap/appimage exists
10:45:42FromDiscord<enthus1ast> because this is a pain
10:45:51FromDiscord<enthus1ast> (not only glibc issue of course)
10:46:27FromDiscord<enthus1ast> its also much easier to have multiple versions of the same application installed on windows
10:46:32FromDiscord<enthus1ast> just put them in different folders
10:46:48FromDiscord<leetnewb> appimage seems nice from a user perspective. haven't tried to package with it yet
10:47:01FromDiscord<enthus1ast> on linux you either can't or you must frickl with modulefiles
10:47:02FromDiscord<Phil> All I heard about the tooling is that it's meh
10:47:16FromDiscord<Phil> (edit) "All I heard about the tooling is that it's meh ... " added "(about appimages)"
10:47:25PMunchOnly slightly related, but writing an installer with NSIS is surprisingly tricky
10:47:42PMunchenthus1ast, well only if you install via your package manager
10:48:08PMunchYou're free to grab multiple copies of the same program and put them in different folders if that tickles your fancy
10:53:17FromDiscord<enthus1ast> The dependency issue is soo bad (with some old scientific software) that I stopped trying and just build docker containers, some need an ancient gcc, some an even older gfortran, some a slightly out of date tcl, it's a total mess
10:54:01FromDiscord<enthus1ast> Its much better on windows and even on macos it works just better
10:56:13FromDiscord<enthus1ast> On supercomputers they even introduced their own package manager (spack) in combination with environment module files\: https://modules.sourceforge.net/
11:00:17FromDiscord<ayex> from dev perspective, I would prefer docker or flatpak..↵(@leetnewb)
11:02:09FromDiscord<leetnewb> In reply to @ayex "from dev perspective, I": tooling?
11:04:06FromDiscord<leetnewb> I was watching some of the appimage discussions around static linking, but not sure where they ended up. I think the lead dev built a separate tool.
11:06:11PMunchHmm, I think you should be able to "fix" a lot of these dynamic library loading issues by just creating a folder, symlinking every dynamic library you need at the correct version into that library, and then starting your program with the LD_LIBRARY_PATH set to that directory
11:06:35PMunchinto that folder*
11:06:57PMunchOr of course copy them in if its some ancient version you don't really need to have available on your system in general
11:07:18FromDiscord<enthus1ast> mh i keep that in mind
11:07:28PMunchOf course some of these old dynamic libraries might be hard to even find
11:07:59FromDiscord<enthus1ast> but thats a good idea to build a start script and ship the libs
11:09:38FromDiscord<enthus1ast> i'm at the point of just throwing tech at the issue, because i already wasted weeks on such issues
11:10:15PMunchYeah, you could even set up a little script which calls ldd on your binary and sets up all the initial symlinks in a folder. Should make it easier to just swap out the symlinks you need
11:11:54FromDiscord<ayex> docker I assume you know, for flatpak one would build a recipe/manifest (json or yaml) to build the app container. both docker and flatpak container can be entered and inspected from inside. the tool create the flatpak container would be flatpak-builder\:↵https://docs.flatpak.org/en/latest/flatpak-builder.html↵(@leetnewb)
11:13:27FromDiscord<leetnewb> In reply to @ayex "docker I assume you": oh, I meant I was wondering why you prefer docker and flatpak over appimage
11:14:35FromDiscord<ayex> ah I see. well for flatpak and docker it was pretty straight forward from their documentation.
11:16:21FromDiscord<ayex> @leetnewb\: back then I was not able to figure it out via appimage docs, but at some point I read that libs would be isolated better inside flatpak, so I did not try harder there.
11:16:56FromDiscord<enthus1ast> btw\: i was exploring building debian packages lately, and i found for manpage creation (out of markdown readme's) pandoc works great
11:17:22FromDiscord<leetnewb> got it. flatpak seems to have won anyway, but that's interesting
11:28:09FromDiscord<heysokam> sent a code paste, see https://paste.rs/26rRR
11:28:24FromDiscord<System64 ~ Flandre Scarlet> When I do var AnObject in the proc, is the AnObject passed by copy or by reference? (the AnObject is an object btw, not a ref object) https://media.discordapp.net/attachments/371759389889003532/1138433527575232625/image.png
11:29:16FromDiscord<enthus1ast> afaik internally its a pointer
11:29:35FromDiscord<System64 ~ Flandre Scarlet> ah alright, thannks!
11:29:55FromDiscord<heysokam> nim passes by reference by default afaik
11:30:09FromDiscord<heysokam> unless you `{.bycopy.}` the object
11:30:32*def- quit (Quit: -)
11:30:49*def- joined #nim
11:30:57FromDiscord<heysokam> so you would `var AnObject` if you explicitely want to modify that object directly inside
11:30:58FromDiscord<System64 ~ Flandre Scarlet> Oh alright!↵But what is ref object for then?↵I know ref object of... is for inheritence
11:31:13FromDiscord<System64 ~ Flandre Scarlet> In reply to @heysokam "so you would `var": Aright so this is my intention
11:31:29FromDiscord<heysokam> In reply to @sys64 "Oh alright! But what": refs point to the same data, nonrefs are separate copies of the data
11:31:48FromDiscord<System64 ~ Flandre Scarlet> ah makes sense now
11:34:36FromDiscord<odexine> In reply to @heysokam "I'm trying to replicate": No you are right (in a sense) that the compiler will just error once it sees the pragma
11:44:19*def- quit (Quit: -)
11:47:32*def- joined #nim
11:48:00*ntat quit (Quit: leaving)
11:49:13FromDiscord<ieltan> In reply to @heysokam "I'm trying to replicate": Not sure but if this happens at compile time you can use `when` instead of `if`
11:49:43FromDiscord<ieltan> x and y needs to be static values for this to work
11:51:57*def- quit (Client Quit)
11:53:08*def- joined #nim
11:57:19*PMunch_ joined #nim
11:59:41*PMunch quit (Killed (NickServ (GHOST command used by PMunch_)))
11:59:44*PMunch_ is now known as PMunch
12:01:18FromDiscord<.matrixagent> is there a way to do bidirectional communication with nim and java
12:01:23FromDiscord<.matrixagent> using FFI
12:02:57FromDiscord<odexine> In reply to @odexine "No you are right": I don’t think this is possible because Nim doesn’t do any flow typing
12:04:29FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CRp
12:06:08FromDiscord<odexine> In reply to @odexine "I don’t think this": I mean it would probably be possible but it would involve a lot of work
12:13:38*azimut joined #nim
12:14:45FromDiscord<enthus1ast> what is the best way to react on unix signals on linux? ↵Basically i want to reload the config on SIGHUP.↵With the selectors module?
12:17:26FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/ts4ei
12:20:21FromDiscord<enthus1ast> enthus1ast\: https://github.com/ba0f3/signals.nim
12:21:07*xet7 quit (Remote host closed the connection)
12:34:37*xet7 joined #nim
12:40:48FromDiscord<ieltan> sent a code paste, see https://paste.rs/YLmvX
12:42:42FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "Not sure, are you": No, otherwise the compiler would say there is recursive imports
12:43:45FromDiscord<System64 ~ Flandre Scarlet> I think this is a bug or something, defining thoses in player works fine
12:48:30*jmdaemon quit (Ping timeout: 246 seconds)
12:59:48*lucasta joined #nim
13:00:38*lucasta quit (Remote host closed the connection)
13:01:02*lucasta joined #nim
13:35:49FromDiscord<terrygillis> ok, I have a massive misunderstanding of nim refs here. At first I thought ref types act like pointers but collected by ARC. However, this code prints out 2 different addresses for an instance of a ref type: https://play.nim-lang.org/#ix=4CRU
13:39:05FromDiscord<terrygillis> why is ref’s content copied and not just the ref itself is copied when ‘inner’ is defined and ‘ret’ returns ‘inner’?
13:41:13FromDiscord<Matt> Hey! I'm working on some code that currently works with binary files and eventually turns it into strings- I'm usually making my procs / signatures use `seq[byte]` and calling `cast[string](some_byte_seq)` where appropriate, but it's kinda hairy. Does anyone have suggestions for idiomatic ways (maybe by defining some kind of union type? a conversion macro / method?) to address this, so that I can use one type interchangeably and/or limit cas
13:41:45FromDiscord<Matt> Also, I have all notifications off- if anyone responds please @me
13:41:45FromDiscord<Phil> Huh, yeah every inner execution creates a copy of a
13:42:14NimEventerNew thread by Ward: How Can I Ensure Backward Compatibility with Destructors in Nim 2.0?, see https://forum.nim-lang.org/t/10387
13:45:23FromDiscord<terrygillis> idk why but the playground is loading yet keeps 502 when running code
13:45:31FromDiscord<Phil> sent a long message, see http://ix.io/4CS2
13:45:53FromDiscord<Phil> (edit) "http://ix.io/4CS2" => "http://ix.io/4CS3"
13:45:55PMunchterrygillis, sorry I'm fixing some bugs on it
13:46:05PMunchIt should be back to normal soon
13:46:24FromDiscord<Phil> In reply to @terrygillis "idk why but the": Essentially the playground is getting a bit of work on it done
13:46:36FromDiscord<terrygillis> so will it copy if i return ‘a’ directly instead of wrapping it around an inner proc and then return it?
13:47:33FromDiscord<Matt> sent a code paste, see https://play.nim-lang.org/#ix=4CS4
13:47:34FromDiscord<terrygillis> yeah it a bit baffling because literally 5 minutes ago things ran fine, and I thought I got temporarily blocked for sending too many requests 😄
13:47:36FromDiscord<Matt> sorry, formatting is busted
13:48:20FromDiscord<Matt> In reply to @isofruit "Can't say I'm having": meant to repy
13:48:21PMunchThere, it should be back now
13:48:41FromDiscord<Matt> (edit) "repy" => "reply"
13:49:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CS5
13:49:49FromDiscord<terrygillis> why is that the case? it’s really weird behavior
13:51:24FromDiscord<terrygillis> some kind of compiler optimization maybe?
13:51:36PMunchAmun-Ra, I was talking about something like this earlier today: https://play.nim-lang.org/#ix=4CS7
13:51:55PMunchThe playground was having issues, so I had to get those fixed before I could share the snippet :P
13:53:10FromDiscord<Phil> Yeah no clue, I'm too high level of a person to know. I'd say open a forum post?↵The folks that have that kind of knowledge appear to not be here atm, unless PMunch knows 😛
13:54:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CSa
13:55:01PMunchNope, no idea. Had a 10 second glance at it, looks like some optimisation or something
13:55:08*Guest87 joined #nim
13:55:27*Guest87 quit (Client Quit)
13:55:33FromDiscord<Phil> It would be idiomatic nim @Matt since what you want to do is convert a sequence of byte arrays into a string.↵That's pretty much exactly what the meaning of `$` is
13:56:15FromDiscord<Phil> In reply to @PMunch "Nope, no idea. Had": The fact it's apparently an "optimization" is the weird bit to me, because now the compiler has to allocate and assign 2 heap objects instead of 1
13:56:17FromDiscord<Phil> That's weird
13:56:29FromDiscord<Phil> (edit) "In reply to @PMunch "Nope, no idea. Had": The fact it's apparently an "optimization" is the weird bit to me, because now the compiler has to allocate and assign 2 heap objects instead of 1 ... " added "and copying some ref around"
13:57:07FromDiscord<Phil> (edit) "is" => "is: Convert any `thing` to `string`"
13:58:56*PMunch quit (Quit: Leaving)
14:01:17FromDiscord<System64 ~ Flandre Scarlet> Do you know how I can get rid of thoses "../" things please? https://media.discordapp.net/attachments/371759389889003532/1138471997022670929/image.png
14:02:25FromDiscord<terrygillis> In reply to @isofruit "That's weird": what’s stranger is the code, both yours and mine, would be prohibited from running in v1.6 as it warns: ‘Error: expression has no address; maybe use 'unsafeAddr'
14:02:27FromDiscord<Phil> In reply to @sys64 "Do you know how": Best I can tell you is structure your packages in a way so that they're next to one another
14:02:34Amun-Rafor example if you place in config.nims: switch "path", "src" you could import src/foo/bar.nim anywhere in src as import foo/bar
14:02:41FromDiscord<Phil> nim imports are relative by nature, I'm not aware of anything else
14:03:44FromDiscord<Phil> In reply to @terrygillis "what’s stranger is the": Eh, that one I'm aware of, there was some deprecation going on around addr/unsafeaddr
14:04:01FromDiscord<System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/4CSe
14:04:43FromDiscord<Phil> For nim 2.0 to unsafeaddr: https://media.discordapp.net/attachments/371759389889003532/1138472862269841509/image.png
14:06:51FromDiscord<Phil> In reply to @sys64 "and can I do": That sounds to me like you want absolute imports or imports relative to the project path rather than to the file itself I assume?
14:07:05FromDiscord<Phil> (edit) "or" => "aka"
14:07:21FromDiscord<System64 ~ Flandre Scarlet> well, having thoses ../../ is annoying
14:07:34FromDiscord<terrygillis> yeah i just tried the weird behavior seems consistent throughout all Nim version, so most probably a feature not a bug, for what reason I really want to know some day.
14:07:39Amun-RaI use relative imports to my root src dir
14:08:21FromDiscord<Phil> In reply to @terrygillis "yeah i just tried": As stated, forum post seems reasonable here
14:09:22FromDiscord<Phil> In reply to @Amun-Ra "I use relative imports": So basically by changing the config.nims switch "path" you achieve absolute imports rather than relative ones? Fair
14:09:30Amun-Rayes
14:10:24FromDiscord<System64 ~ Flandre Scarlet> I should do a Nimble init in my project
14:10:26FromDiscord<Phil> Hmm I'm personally on board with it being all relative paths all the time.↵It's a nice hint aka code-smell that you're not structuring your code in a manner where things that belong together are together.
14:10:44FromDiscord<Phil> (edit) "together." => "together when you have a lot of `../`."
14:11:45FromDiscord<Phil> In reply to @sys64 "I should do a": You should add a nimbledeps folder to your project so that you don't use your global .nimble folder for dependencies 😛
14:13:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @isofruit "You should add a": wdym by nimbledeps?↵I should do a nimble init first right?
14:13:19FromDiscord<Phil> Yah, was just ribbing ^^
14:13:51FromDiscord<System64 ~ Flandre Scarlet> Oh I already have a nimble thing
14:14:04FromDiscord<Phil> In reply to @sys64 "wdym by nimbledeps? I": Nimble has the implicit behaviour that if you have a nimbledeps folder on the same level as your <project>.nimble file, it will install all libs required to build your project into that folder instead of into your `~/.nimble/pkgs2` directory
14:14:17FromDiscord<Phil> Basically it's the equivalent of a node-modules folder
14:14:26FromDiscord<System64 ~ Flandre Scarlet> Oh nice!
14:15:11FromDiscord<System64 ~ Flandre Scarlet> This is my nimble↵Now the thing is in src, I have the client, common and server folders https://media.discordapp.net/attachments/371759389889003532/1138475495445508207/image.png
14:17:58FromDiscord<System64 ~ Flandre Scarlet> so I have the client project, and the server project
14:22:43NimEventerNew thread by terrygils: Why does ref object have this behaviour?, see https://forum.nim-lang.org/t/10388
14:41:42FromDiscord<heysokam> sent a long message, see https://paste.rs/PBkDv
14:42:53FromDiscord<Phil> @terrygillis turns out we're just not that smart 😄
14:43:56FromDiscord<Phil> More details on the forum post.↵Essentially one instance of `ob` gets created each `ret` call and it correctly copies the pointer over, not the whole instance
14:44:44FromDiscord<Phil> We were just looking at where the pointer to the variable itself is stored, not the pointer to the value or sth... I only partially understand @intellij_gamer there
14:46:47FromDiscord<terrygillis> Possibly because I got the auto-deref [] most of the time so I just forgot that the var itself is a pointer, no need for addr 😆
14:49:22FromDiscord<terrygillis> managing pointers in C is hell of a chore in comparison
14:59:00FromDiscord<.kanaxa> @pmunch - I've been reading some of your Nim articles, they're great!
14:59:05FromDiscord<.kanaxa> Been really helpful to my understanding
15:13:02NimEventerNew post on r/nim by qtless: Automatically Generated Documentation (Backend), see https://reddit.com/r/nim/comments/15lkxxl/automatically_generated_documentation_backend/
16:07:02*ntat joined #nim
16:13:50FromDiscord<inv2004> Hi. Can I ask to recheck and highlight the issue by someone? Because it looks like serious #showstopper for me: https://github.com/nim-lang/Nim/issues/22398
16:25:39FromDiscord<toma400> In reply to @sys64 "well, having thoses ../../": I'm wondering if there was a way to make some aesthetic-aimed macro for those
16:26:36FromDiscord<toma400> sent a code paste, see https://play.nim-lang.org/#ix=4CT7
16:28:01FromDiscord<toma400> (edit) "https://play.nim-lang.org/#ix=4CT7" => "https://play.nim-lang.org/#ix=4CT8"
16:28:16FromDiscord<toma400> (edit) "https://play.nim-lang.org/#ix=4CT8" => "https://play.nim-lang.org/#ix=4CT9"
16:29:13FromDiscord<jmgomez> In reply to @inv2004 "Hi. Can I ask": are you sure that isnt expected? Nim allocator's doesnt return the memory to the OS but it keep it for itself for future use. If you really need the memory back you could try to 'useMalloc'
16:33:41FromDiscord<Phil> In reply to @inv2004 "Hi. Can I ask": That seems like something to bring up with #internals , that'd be a more effective place to discuss compiler-related development
16:37:10FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4CTd
16:40:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CTe
16:54:04FromDiscord<inv2004> In reply to @jmgomez "are you sure that": It does not return it - I saw 2mb, 20mb, 40mb. I do not know the limit
16:54:24*lucasta quit (Remote host closed the connection)
16:54:31FromDiscord<inv2004> (edit) "limit" => "limit. I saw 12gb also"
16:54:56FromDiscord<pmunch> In reply to @.kanaxa "<@392962235737047041> - I've been": Thank you, glad you like them
16:59:12FromDiscord<Phil> I take that back, imports like `../someDir/myModule` look a bit more complex
16:59:15FromDiscord<Phil> But still, pretty doable
16:59:19FromDiscord<Phil> (edit) "But still, pretty doable ... " added "as a small project"
16:59:34FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4CTi
17:00:28FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4CTj
17:08:13*junaid_ joined #nim
17:08:22FromDiscord<jmgomez> In reply to @inv2004 "It does not return": did you repeated the test with `useMalloc`?
17:09:22FromDiscord<inv2004> Not yet. But I think that it is not ok even without useMalloc
17:10:41FromDiscord<.kanaxa> Slightly offtopic, but I thought this was interesting, it's hot out of the oven: https://stability.ai/blog/stablecode-llm-generative-ai-coding
17:11:10FromDiscord<.kanaxa> At least if anyone's here being using any Stability stuff before for code generation
17:11:15FromDiscord<.kanaxa> I don't think they trained it for Nim
17:30:04FromDiscord<Phil> I got to say
17:30:12FromDiscord<Phil> I'm kinda warming up to the collect syntax for for loops
17:30:42FromDiscord<Phil> Does anyone actually make use of that?
17:31:24FromDiscord<Yardanico> In reply to @.kanaxa "Slightly offtopic, but I": yeah those open models are only trained on a handful of languages usually
17:31:38FromDiscord<Yardanico> turbo and especially gpt-4 will understand nim much better, but even they are pretty bad due to its low popularity
17:32:25FromDiscord<Yardanico> it's a good thing nonetheless, don't get me wrong
17:32:48FromDiscord<Yardanico> it's just that I doubt it'll even be able to write a nim program to query some api with httpclient on the first try :P
17:34:59FromDiscord<ieltan> In reply to @.kanaxa "I don't think they": I've had this idea, maybe it would make sense to have a Lora/qLora focusing on a single programming language instead of just training on a giant terablob mixing everything together
17:35:24FromDiscord<toma400> In reply to @Andreas "hi <@656540400546480128> that is": I'm jumping between Atom, PyCharm and IntelliJ. However for Nim I'm mostly using PyCharm with dedicated plugin ^^↵Thank you for the answer!
17:35:32FromDiscord<toma400> In reply to @isofruit "Absolutely. This is what": Thanks for the answer ❤️
17:35:40FromDiscord<Yardanico> In reply to @ieltan "I've had this idea,": I don't think that'll work well enough, big enough models learn a lot of code from different languages so that they can "generalize" their knowledge
17:35:53FromDiscord<ieltan> When I used ChatGPT for Nim stuff I would have instances of it mixing python code with the output, with the Lora approach I don't think this would happen
17:36:08FromDiscord<Yardanico> In reply to @ieltan "When I used ChatGPT": that shouldn't happen with gpt-4, i've tried it a bit for Nim
17:36:13FromDiscord<Yardanico> it's of course bad but much better than turbo
17:36:25FromDiscord<ieltan> Well I don't have access to gpt-4 unfortunately
17:38:52FromDiscord<Yardanico> first try gpt-4 - two mistakes, it forgot to import sequtils for newSeqWith, and didn't specify the type for primeNumbers https://media.discordapp.net/attachments/371759389889003532/1138526755850813460/image.png
17:39:04FromDiscord<Yardanico> of course it'll fix that if you tell it, and this code does actually work https://media.discordapp.net/attachments/371759389889003532/1138526804852887573/image.png
17:41:10FromDiscord<Yardanico> and this is what I meant with generalization and stuff, it can translate the concepts between languages pretty well (although it might struggle with big examples) https://media.discordapp.net/attachments/371759389889003532/1138527334706729071/image.png
17:41:32FromDiscord<Yardanico> (and yes, it did forget to close httpclient as a lot of people do in Nim :P)
17:42:31FromDiscord<ieltan> sent a long message, see http://ix.io/4CTx
17:47:32FromDiscord<ieltan> In reply to @yardanico "and this is what": Still my uneducated mind speaking : Why not make it learn the concepts themselves, instead of relying on random data that the model then infer what they actually mean?↵If this is done and if it works, then translating to a language to another would just be a matter of switching the syntax and semantics
17:48:00FromDiscord<inv2004> In reply to @jmgomez "did you repeated the": Just checked: https://github.com/nim-lang/Nim/issues/22398#issuecomment-1670046698
17:48:20FromDiscord<ieltan> Also impressive demo btw
17:48:21FromDiscord<Yardanico> Because they can't learn in the traditional sense, and people don't actually understand how LLMs work the way they do, it's a black box
17:48:32FromDiscord<Yardanico> And it's more for #offtopic by now :)
17:48:42FromDiscord<ieltan> In reply to @yardanico "And it's more for": True, my bad
18:22:38*pbsds quit (Quit: The Lounge - https://thelounge.chat)
18:23:17*pbsds joined #nim
18:27:38*junaid_ quit (Remote host closed the connection)
18:54:39FromDiscord<.kanaxa> In reply to @isofruit "I'm kinda warming up": I was playing around with `collect` yesterday - I'd say that it grows you, even though it doesn't roll off the tongue as smoothly as list comprehensions,
18:55:09FromDiscord<.kanaxa> (edit) "comprehensions," => "comprehensions"
18:55:49FromDiscord<littlebulli> Hi there
18:55:56FromDiscord<.kanaxa> In reply to @.kanaxa "I was playing around": But it's quite readable so I'm pleased with it
18:56:05FromDiscord<.kanaxa> In reply to @littlebulli "Hi there": Hi! Welcome to the Nim discord
18:58:41FromDiscord<Phil> Cheers
18:59:27FromDiscord<Phil> In reply to @.kanaxa "I was playing around": Or as just stuff like `mapIt` etc. ^^
19:00:15FromDiscord<.kanaxa> What I find quite wonderful about Nim is the two-space indentation idiomm
19:00:18FromDiscord<.kanaxa> (edit) "idiomm" => "idiom"
19:00:37FromDiscord<.kanaxa> Coupled with the short line-lengths (because we tend to skip to the next line after an = sign)
19:00:58FromDiscord<.kanaxa> I don't get confused for Python at all, the syntax feels distinctly Nim
19:01:29FromDiscord<.kanaxa> Compared to when I'm reading Swift, until I see the code in detail, the shape and feel of the Code feels like C or even C#
19:01:45FromDiscord<.kanaxa> Nim's syntax after a while doesn't feel like Python at all
19:02:26FromDiscord<.kanaxa> (edit) "the Code feels" => "Swift code looks"
19:02:43FromDiscord<Andreas> In reply to @.kanaxa "Compared to when I'm": glad you enjoy it - how do you like the `import`-statement ? Anything you'd wanna add to it ?
19:03:30*rockcavera joined #nim
19:03:37FromDiscord<.kanaxa> At first I thought the namespacing idiom was a bit odd, but once the UFCS thing sank in, I thought it was amazing
19:03:46FromDiscord<.kanaxa> I see no reason to change it
19:04:08FromDiscord<aftalavera> Hi there
19:04:17FromDiscord<.kanaxa> I've a motor response with how I deal with relative/absolute imports in Python though, so I'm still learning Nim's own import idioms
19:04:23FromDiscord<aftalavera> How to zip file using nim?
19:04:54FromDiscord<Andreas> In reply to @.kanaxa "I see no reason": me neither - i just asked there had been some suggestions recently.
19:05:10FromDiscord<Andreas> (edit) "" => "cos'"
19:05:34FromDiscord<.kanaxa> In reply to @Andreas "me neither - i": Wait, is this Araq, Andreas Rumpf?
19:05:44FromDiscord<Andreas> In reply to @.kanaxa "Wait, is this Araq,": no no...
19:06:00FromDiscord<aftalavera> Uffff
19:06:11FromDiscord<aftalavera> https://tenor.com/view/spongebob-squarepants-patrick-star-scared-frightened-clenched-teeth-gif-26548890
19:06:20FromDiscord<aftalavera> :nim1:
19:06:45FromDiscord<Andreas> In reply to @aftalavera "https://tenor.com/view/spongebob-squarepants-patric": ARAQ takes a break and might be on vacation.. rumor has it
19:07:01FromDiscord<aftalavera> Nice
19:11:29FromDiscord<inv2004> In reply to @Andreas "ARAQ takes a break": ah, it exaplains why showstopper is not even commented
19:11:51FromDiscord<huantian> In reply to @aftalavera "How to zip file": https://github.com/guzba/zippy↵check out this lib
19:12:43FromDiscord<aftalavera> I did
19:13:12FromDiscord<aftalavera> Only see examples about extracting from files no sample about compressiong
19:13:22FromDiscord<aftalavera> And thanks
19:14:31FromDiscord<inv2004> In reply to @aftalavera "Only see examples about": it is just one function: https://guzba.github.io/zippy/#compress%2Cstring
19:15:23FromDiscord<huantian> https://github.com/guzba/zippy/blob/a3fd6f0458ffdd7cbbd416be99f2ca80a7852d82/src/zippy/ziparchives_v1.nim#L548
19:15:28FromDiscord<huantian> take a look here for an example
19:15:37FromDiscord<huantian> you can use this proc if you want to compress an entire directory
19:15:43FromDiscord<huantian> or you can use addDir and addFile yourself
19:16:59FromDiscord<aftalavera> Thanks again!
19:17:03FromDiscord<aftalavera> Is it this easy?
19:17:09FromDiscord<aftalavera> sent a long message, see http://ix.io/4CTV
19:41:15*jmdaemon joined #nim
19:43:47FromDiscord<aftalavera> In reply to @huantian "or you can use": Sorry dont understand addDir
19:45:14*cedb quit (Quit: WeeChat 4.0.2)
19:45:44FromDiscord<huantian> it takes a path to a directory, and adds all the files inside of it to the ziparchive
19:46:40FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4CU4
19:51:46FromDiscord<aftalavera> In reply to @huantian "in this case it'd": Thanks a lot
19:57:15FromDiscord<aftalavera> So freaking clean!
19:59:22*ntat quit (Quit: leaving)
20:17:24FromDiscord<System64 ~ Flandre Scarlet> Is it possible to have some kind of constructors? https://media.discordapp.net/attachments/371759389889003532/1138566655635640431/image.png
20:20:43FromDiscord<Elegantbeef> `proc initPalette(size: int)` or `proc init(_: typedesc[Pallette], size: int)`
20:21:11FromDiscord<System64 ~ Flandre Scarlet> so it's not possible to do Palette(16) for example?
20:21:27FromDiscord<System64 ~ Flandre Scarlet> or Palette(size: 16)?
20:21:35FromDiscord<Elegantbeef> Nope
20:21:50FromDiscord<System64 ~ Flandre Scarlet> Ah alright, thanks!
20:21:51FromDiscord<Elegantbeef> `Pallete` is a type you cannot overload type with a proc
20:22:21FromDiscord<System64 ~ Flandre Scarlet> what is this typedesc thing?
20:22:37FromDiscord<bostonboston> `var foo: Pallette = Pallette(size: 16)` isn't a thing?
20:22:37FromDiscord<Elegantbeef> It's a type
20:22:39FromDiscord<System64 ~ Flandre Scarlet> does it enforce stuff like Palette.init(16)?
20:22:41FromDiscord<demotomohiro> Nim doesn't have constructor. we use a proc like initFoo or newFoo instead of constructor.
20:23:12FromDiscord<Elegantbeef> Yes
20:23:42FromDiscord<System64 ~ Flandre Scarlet> Oh alright, so it's the equivalent of public static type myFunction() in OOP I guess
20:23:57FromDiscord<demotomohiro> Or `proc init(_: typedesc[Palette]): Palette =`
20:27:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "Or `proc init(_: typedesc[Palette]):": so I have to do var myPal = Palette.init(16) ?
20:27:51FromDiscord<demotomohiro> In reply to @sys64 "so I have to": Yes.
20:28:25FromDiscord<System64 ~ Flandre Scarlet> oh alright↵And if I do var myPalette: Palette, do I still need to do Palette.blablabla?
20:28:48FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CUf
20:29:53FromDiscord<System64 ~ Flandre Scarlet> This is beautiful https://media.discordapp.net/attachments/371759389889003532/1138569794212339742/image.png
20:29:53FromDiscord<demotomohiro> In reply to @sys64 "oh alright And if": Yes.
20:29:59FromDiscord<System64 ~ Flandre Scarlet> Oh alright
20:31:17FromDiscord<demotomohiro> In reply to @sys64 "or can I do": You can define `proc init(size: int): Palette =` but Nim doesn't have overloae based on return type.
20:31:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @demotomohiro "You can define `proc": I don't thing any language has it
20:31:49FromDiscord<System64 ~ Flandre Scarlet> but I can be wrong
20:33:29FromDiscord<nixfreak> sent a code paste, see https://play.nim-lang.org/#ix=4CUh
20:34:10FromDiscord<Elegantbeef> How can we say anything for certainty
20:34:37FromDiscord<nixfreak> Just estimating
20:35:16FromDiscord<Elegantbeef> Then no I wouldnt estimate that
20:38:36FromDiscord<nixfreak> ok so what I get with nim after stripping is 67k on a mac using gcc https://play.nim-lang.org/#ix=4CUj
20:38:53FromDiscord<nixfreak> I get 49k with C binary
20:39:07FromDiscord<nixfreak> is it possible to get a smaller size ?
20:41:49FromDiscord<nixfreak> possibly smaller if I don't use strformat I would think
20:42:39FromDiscord<nixfreak> I dunno asking the experts (:
20:45:04FromDiscord<Elegantbeef> I get 39k with Nim
20:45:27FromDiscord<Elegantbeef> using gcc on linux with `-d:danger -d:lto -d:strip` with nim 2.0
20:46:36FromDiscord<nixfreak> oh instresting , -d:lto and -d:stip in the command , hmmm ok so does strip with nim c work different then strip the program ?
20:47:10FromDiscord<nixfreak> ok so on the mac its 1.9.5
21:00:53*LuxuryMode joined #nim
21:07:05FromDiscord<nixfreak> sent a code paste, see https://paste.rs/Q2gfJ
21:10:12FromDiscord<Elegantbeef> `-d:release -d:lto -d:strip --opt:size` is 35k on Linux
21:10:13FromDiscord<Elegantbeef> Danger drops it to 31k
21:16:34FromDiscord<nixfreak> weird ?
21:17:47FromDiscord<Elegantbeef> Not really
21:24:47*advesperacit quit ()
21:26:25FromDiscord<nixfreak> ok , so I tried llvm and gcc using different compiler options can only get down to 49k
21:26:41FromDiscord<nixfreak> on a mac
21:27:10FromDiscord<nixfreak> I'm just curious why ?
21:27:39FromDiscord<Elegantbeef> Different OS have different APIs which may change the required imports/links
21:28:28FromDiscord<nixfreak> ok , that makes sense
21:41:29FromDiscord<intellij_gamer> In reply to @isofruit "We were just looking": Ah whoops, it was late writing that and I was afraid some of it wasn't written well 😅
21:52:52FromDiscord<ieltan> In reply to @sys64 "This is beautiful": You can do `let` instead of `var`
21:53:19FromDiscord<ieltan> Since `Palette` is ref, unless you want to change the ref later
21:54:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @ieltan "Since `Palette` is ref,": but if I do let, I can't change the values, can I?
21:54:22FromDiscord<ieltan> You can
21:54:37FromDiscord<ieltan> What you can't change is the ref that is pointing to the values
21:54:47FromDiscord<System64 ~ Flandre Scarlet> Oh alright!
21:55:07FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CUN
21:55:55FromDiscord<ieltan> Also with definite assignment analysis you should be able to declare the let and init it later (it'll prevent you from using the variable if you didn't init it)
21:57:06FromDiscord<System64 ~ Flandre Scarlet> let forces you to init directly
21:57:26FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4CUO
21:57:56FromDiscord<ieltan> In reply to @sys64 "let forces you to": Not in 2.0
21:58:16FromDiscord<System64 ~ Flandre Scarlet> Oh alright! I use 2.0 now
21:58:26FromDiscord<that_dude.> In reply to @sys64 "This is beautiful": `size =` is wild. I've never thought of that
21:58:42FromDiscord<that_dude.> (edit) "`size =`" => "``size =``"
21:58:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @that_dude. "``size =`` is wild.": as a C# user↵I love this
21:59:26FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-bitsize-pragma
22:00:21FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/nYopA
22:02:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @that_dude. "There is a Pragma": Like that?↵Oh alright, the set sounds like a nice idea https://media.discordapp.net/attachments/371759389889003532/1138593047744102560/image.png
22:02:42FromDiscord<System64 ~ Flandre Scarlet> but I think the bitfield uses less memory
22:03:11FromDiscord<aftalavera> How would you suggest to deal with uploading files to google drive using Nim?
22:04:52FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CUU
22:05:40FromDiscord<Elegantbeef> You want to apply the bitsize to the field not the enum
22:06:20FromDiscord<Elegantbeef> To be glorified search engine https://github.com/treeform/googleapi↵(@aftalavera)
22:08:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You want to apply": so I can use only 3 bits for the set? even if it is an array?
22:16:55FromDiscord<acomab> just a question, what's the deal with the webhook? is this some sort of interoperability between platforms?
22:17:10FromDiscord<acomab> i know it's not relevant to the channel but i'm curious
22:17:20FromDiscord<Elegantbeef> Yes I'm an aspiring matrix user
22:22:59FromDiscord<acomab> gotcha
22:42:40*ced1 joined #nim
22:47:02*ced1 is now known as cedb
23:06:32*cnx quit (Remote host closed the connection)
23:14:24FromDiscord<bostonboston> Is it safe to assume reading from a variable in one thread while writing to it in another is a bad idea
23:15:20FromDiscord<Elegantbeef> Race conditions are bad yes
23:15:40FromDiscord<rio> Well, "race condition" refers to an issue where two different processes are competing for one same shared resource, and the order in which they access it determines the outcome. It has racist implications as it evokes the conditioning of "races" (social constructs) where one group may have advantages over another due to their race, that is, competing groups (races, processes) vying for resources (which are shared).↵↵so alternative terms s
23:16:22FromDiscord<Elegantbeef> How about you do not copy pasta
23:16:48FromDiscord<rio> Fair enough, I just didn't think I'd get the chance to meme.
23:17:03FromDiscord<bostonboston> Life's a race, and you're the racist
23:17:40FromDiscord<Elegantbeef> Personally I hate the indie500
23:17:45FromDiscord<rio> I'm the fastest racist there ever was
23:18:34*cnx joined #nim
23:20:13FromDiscord<bostonboston> You can't be saying things like that beef
23:20:30FromDiscord<Elegantbeef> Anyway put a lock around your variable and use the guard annotation
23:20:47FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#guards-and-locks
23:20:54FromDiscord<Elegantbeef> Oh hell yea no longer experimental thanks Nim2.0!
23:30:27FromDiscord<dersnof> Realized although Nim is useless for finding job
23:30:34FromDiscord<dersnof> Excellent for personal projects
23:31:50FromDiscord<that_dude.> Im using it in a research thing rn. It makes excellent pseudo code
23:32:12FromDiscord<dersnof> I liked its simple syntax while it can be used for fast projects
23:32:18FromDiscord<dersnof> Python is scripting lang and slow
23:33:51FromDiscord<Elegantbeef> Ew python
23:58:01FromDiscord<bostonboston> Python is very icky
23:58:28FromDiscord<bostonboston> Also the trick is to get higher for your other skills then shoe horn Nim into your workplace. Worked for me