<< 08-05-2023 >>

00:01:09NimEventerNew post on r/nim by AbbreviationsJust336: What do you think about Nim mainly used by blackhat hackers for "exotic malware"?, see https://reddit.com/r/nim/comments/13b7gy9/what_do_you_think_about_nim_mainly_used_by/
00:20:10FromDiscord<rchan> I see, I will give it a try↵Thank you very much
01:04:27*nanxiao joined #nim
01:36:01NimEventerNew post on r/nim by AbbreviationsJust336: Why is the Nim community so small?, see https://reddit.com/r/nim/comments/13b9rgh/why_is_the_nim_community_so_small/
01:44:04NimEventerNew post on r/nim by AbbreviationsJust336: 45 errors when asking chatgpt to program a simple tcp server is it because some of chatgpt info is outdated?, see https://reddit.com/r/nim/comments/13b9yl1/45_errors_when_asking_chatgpt_to_program_a_simple/
01:47:48FromDiscord<RandomVisitor> yep, free version of chatgpt isn't very good at writing Nim programs. Have been meaning to test some keywords like nimrod, and see how it goes with the old name. Sometimes you can tell it uses C / C++ / C# and has converted the language style, but kept some function names that don't exist in Nim.
01:55:24*lucasta quit (Remote host closed the connection)
01:58:21*nanxiao quit (Quit: Client closed)
02:29:08*nanxiao joined #nim
02:29:11FromDiscord<Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4vqY
02:43:34FromDiscord<Elegantbeef> What do you mean?
02:45:09FromDiscord<Dudugz> In reply to @Dudugz "Is it possible to": I'm talking about this
02:46:09FromDiscord<Dudugz> I was told to use foldl with or but that only works if the procs return void which is not the case, as said I will use the value returned by the proc
02:46:53FromDiscord<Dudugz> It's sad that Nim doesn't have a default stdlib implementation for this, JS has Promise.any and Promise.race
03:33:20*azimut quit (Ping timeout: 240 seconds)
04:18:31FromDiscord<Dudugz> Btw about my design issue I mentioned yesterday I managed to deconstruct the client and server ^^ now I don't need a cyclic import anymore with the current design.
04:26:27NimEventerNew post on r/nim by qtless: Hot code reloading with HappyX, see https://reddit.com/r/nim/comments/13bdrx5/hot_code_reloading_with_happyx/
04:34:25FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4vrb
04:35:09FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4vrb" => "https://play.nim-lang.org/#ix=4vrc"
04:36:06FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4vrc" => "https://paste.rs/s9z"
04:37:49FromDiscord<Dudugz> The idea is great but unfortunately I can't apply it, because then I would have to wait for all the procs to complete to proceed to the next step. Unfortunately this cannot happen.
04:38:15FromDiscord<Arathanis> why do you need to wait for them to complete to move onto the next step?
04:38:56FromDiscord<Dudugz> Hmm, wouldn't it need to complete all to leave asCompleted scope?
04:39:31FromDiscord<Arathanis> In reply to @Dudugz "Hmm, wouldn't it need": technically no
04:39:37FromDiscord<Dudugz> Actually your idea gave me a great idea though
04:39:38FromDiscord<Arathanis> other futures get a chance to run during that scope
04:40:04FromDiscord<Dudugz> Hmm
04:40:20FromDiscord<Arathanis> you (or I) can make it explicit
04:41:22*nanxiao quit (Quit: Client closed)
04:44:23FromDiscord<Arathanis> I did make it more explicit. there is a `asyncSleep(0)` in the template now
04:44:38FromDiscord<Arathanis> (edit) "a" => "an"
04:46:08FromDiscord<Arathanis> (edit) "`asyncSleep(0)`" => "`sleepAsync(0)`"
04:49:50FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4vrd
04:50:05FromDiscord<Arathanis> (edit) "https://play.nim-lang.org/#ix=4vrd" => "https://play.nim-lang.org/#ix=4vre"
04:51:22FromDiscord<Dudugz> Not what i meant, did you mean that asCompleted is a scope, wouldn't the code below it (scope) have to wait for all the promises to finish? It would be the same as using ``all``
04:51:53FromDiscord<Dudugz> (edit) "did you" => "i"
04:52:26FromDiscord<Arathanis> In reply to @Dudugz "Not what i meant,": well yeah the scope after `asCompleted` has to wait but in that case why not put that code in a different task and launch them together?
04:52:54FromDiscord<Dudugz> Might work
04:54:01FromDiscord<Arathanis> since the code below must not depend on the the results coming from the futures in `asCompleted` it must just be something else you can have running in the event loop, yeah? so just put it in a different async procedure and run them in parallel like in the main functoin in this example
05:10:20*nanxiao joined #nim
05:22:34FromDiscord<sOkam!> is there a way to restrict a float value to a be within a specific range?
05:22:56FromDiscord<Rika> Not with the type system
05:23:16FromDiscord<sOkam!> kk
05:38:36*advesperacit joined #nim
05:50:43termerthere's the range[] type but that's a compile time thing and I don't know if it works for floats
05:51:16termeryeah, you can do
05:51:33termervar floatVal: range[1.5..2.5]
05:51:35termeror similar
05:52:28termerOk yeah, you can use that actually
05:53:08termeran error will be thrown if you assign it a value outside of the range, though I'm not sure whether non-debug builds check that at runtime
05:53:37termers0kam!, see above
05:58:18FromDiscord<Rika> Huh I didn’t think that ranges would
05:58:32FromDiscord<Rika> Maybe it’s been too long of a while since I tried things in Nim
05:58:45FromDiscord<Rika> In reply to @termer "an error will be": If it ain’t danger
06:00:15termerranges work for all numeric types, including distinct ones
06:00:18termerthey also might work for enums
06:00:50termeryeah, they work for enums
06:01:10termerThe error message is ambiguous in that case but it does work
06:14:27*nanxiao quit (Quit: Client closed)
06:23:14FromDiscord<sOkam!> In reply to @termer "var floatVal: range[1.5..2.5]": how are ranges mapped for floats?
06:23:36FromDiscord<sOkam!> i thought they were only usable for ints, because floats have no "increment" or something. maybe im confusing terms with iterators?
06:33:53*nanxiao joined #nim
06:40:56*PMunch joined #nim
07:21:09FromDiscord<Rika> Ranges are not that yeah
07:21:17FromDiscord<Rika> Ranges are simply a start and an end
07:21:20FromDiscord<Rika> No steps
07:26:35*fredrikhr quit (Quit: Disconnecting...)
07:47:34*jmdaemon joined #nim
07:48:56*pbsds quit (Ping timeout: 268 seconds)
07:49:33*pbsds joined #nim
09:20:53*derpydoo quit (Quit: derpydoo)
09:22:12*Notxor joined #nim
09:55:38FromDiscord<cmc> sent a code paste, see https://paste.rs/2qK
09:59:05*nanxiao quit (Quit: Client closed)
10:00:35FromDiscord<cmc> Hm compiles(foo(int)) works
10:23:05*attah quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
10:27:03*attah joined #nim
11:18:18*beholders_eye joined #nim
11:47:55*azimut joined #nim
11:54:04FromDiscord<Ras> is choosenim licensed using BSD-3 or MIT? The license file is that of BSD, but at the bottom of the readme, it says the license is MIT
11:54:24FromDiscord<Ras> I know the two are more-or-less compatible, but since I'm working on a choosenim fork, I'd like to get any ambiguity out of the way
11:55:43PMunchHmm, good question. That is indeed confusing
11:56:23PMunchJust so you know, we are working on forking choosenim to the Nim organisation so we can continue to maintain it
11:56:36FromDiscord<Ras> ... oh.
11:57:04FromDiscord<Ras> that would've been great to know before i bought getnim.org and choosenim.org 😅
11:59:27PMunchOuch, sorry about that, we could probably have been more up front about our work on these infrastructure things
11:59:48FromDiscord<Ras> no, it's totally on me
11:59:53PMunchWas there anything in particular you wanted to add to choosenim by the way?
11:59:59PMunchOr did you just want to maintain it?
12:02:13FromDiscord<Ras> well what sparked my interest was the fact that i noticed the binaries were not statically compiled and depended on glibc, which meant that when building docker containers with nim preinstalled using choosenim, you can't select base images that ship with e.g. musl. For example, Alpine (even with the glibc compatibility package) won't work
12:02:45FromDiscord<Ras> when researching that, i noticed that choosenim seems to be generally unmaintained, so i thought i could do that as a side project
12:02:59*beholders_eye quit (Ping timeout: 260 seconds)
12:03:53PMunchAah I see
12:04:45PMunchHaving statically compiled, dependency free choosenim binaries would indeed be pretty neat. So if you have that work underways please PR it to the official version once it is up and running :)
12:05:21FromDiscord<Ras> sure, will do
12:19:28*ehmry quit (Ping timeout: 240 seconds)
12:26:15*ehmry joined #nim
12:40:26*nanxiao5 joined #nim
12:46:03*nanxiao5 quit (Quit: Client closed)
12:50:18*demetera joined #nim
12:52:53*xaltsc joined #nim
13:11:18*azimut quit (Remote host closed the connection)
13:12:14*azimut joined #nim
13:37:16FromDiscord<auxym> as an alternative to choosenim, I've been thinking (more realistically, hoping someone does it for me) of getting nim in https://tea.xyz/ (or something similar, but not a huge fan of asdf because it's based on bash so not great on ie windows)
13:37:38FromDiscord<auxym> so, er, wink wink nudge nudge
13:41:56FromDiscord<JeanCareau> sent a long message, see http://ix.io/4vsq
13:43:06PMunchauxym, maintaining all kinds of different package managers is tough. IMO we should try to get `choosenim` into package managers and then be able to manage the Nim install from `choosenim`
13:45:27FromDiscord<auxym> well, ideally, we wouldn't need to get nim into all kinds of different PMs, just one which is portable and widely available. But yeah, "one PM to rule them all" might be a tad utopic (also that xkcd on 14 competing standards) 🙂
13:49:34PMunchHaha, yeah that's exactly what I thought of
13:50:38PMunchTo put it like this, I already have a package manager, and I'm not really looking for another one
13:50:49PMunchI like to have all my packages installed through the package manager I already have
13:56:16FromDiscord<auxym> sent a long message, see http://ix.io/4vsu
13:56:41FromDiscord<auxym> But that situation probably isn't super mature atm. I'm using choosenim and probably will keep using it for a while too.
13:56:46FromDiscord<michaelb.eth> In reply to @PMunch "Having statically compiled, dependency": Any interest in bashisms being removed from the installer .sh?
13:57:13PMunchmichaelb.eth, anything to increase compatibility
13:57:16FromDiscord<auxym> (edit) "http://ix.io/4vsu" => "http://ix.io/4vsv"
13:57:18PMunchWithin reason of course
14:01:56*PMunch quit (Quit: Leaving)
14:05:40FromDiscord<Rika> cant you just put it thru shellcheck or smth
14:09:56*lucasta joined #nim
14:13:58NimEventerNew thread by StLa: Save return value using threads, see https://forum.nim-lang.org/t/10183
14:19:51FromDiscord<croxrox> Hello World! Just heard about nim is it true that nim has syntax like python & speed like c
14:21:18FromDiscord<JeanCareau> @croxroxYes, it is true
14:21:23*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
14:22:55*antranigv joined #nim
14:24:02FromDiscord<ringabout> Well, both Python and Nim use indentation, which is the only similar trait both languages share. And you can optimize your Nim code to the same level of C at most times.
14:25:16FromDiscord<croxrox> Is nim run on cross platform like python like for example you program on fedora and run on windows?
14:25:43FromDiscord<Nerve> In reply to @croxrox "Is nim run on": Nim compiles to C binaries, you must compile for an architecture and an OS
14:26:10FromDiscord<Nerve> You need to learn about the C compile toolchain to get the specifics but Nim handles most of it for you
14:27:09FromDiscord<Nerve> Also do not expect exactly Python, for example Nim is statically typed.
14:27:18FromDiscord<Nerve> It is very similar, but different in important ways
14:28:52FromDiscord<Nerve> https://learnxinyminutes.com/docs/nim/
14:29:42FromDiscord<emanresu3> There's also NimScript, for which you need a Nim installation
14:32:27FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4vsA
14:32:44FromDiscord<croxrox> So nim converts my nim code to c code. which I have to compile to executable
14:33:12FromDiscord<michaelb.eth> In reply to @croxrox "So nim converts my": Nim compiler automatically invokes C compiler and linker by default
14:34:11FromDiscord<croxrox> Just installed nim using choosenim
14:34:55FromDiscord<emanresu3> you can also compile to javascript and run it with a js runtime
14:36:19FromDiscord<croxrox> So can we write webapps with nim
14:37:29FromDiscord<croxrox> Thank You for your support. I'm gonna try to learn nim in 5 min 😂
14:40:39FromDiscord<croxrox> OK ran into my first error ↵Error: invalid module name: hello- world
14:41:14FromDiscord<michaelb.eth> use underscore in module name, not dash
14:41:33FromDiscord<michaelb.eth> hello_world.nim
14:41:49FromDiscord<croxrox> is folder name is also a module name?
14:42:27FromDiscord<michaelb.eth> folders can be used to group modules, but follow same naming rules
14:43:29FromDiscord<michaelb.eth> hello_world.nim↵hello_world/helpers.nim↵hello_world/impl.nim↵etc.
14:43:45FromDiscord<croxrox> Thanks, changing file name worked
14:45:05FromDiscord<michaelb.eth> Since your new, probably good to learn about: https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
14:47:19FromDiscord<michaelb.eth> foobar, foo_bar, and fooBar are the same identifier, but Foobar is different from foobar because it’s starts with capital F
14:47:29FromDiscord<michaelb.eth> (edit) "it’s" => "it"
15:05:44FromDiscord<mratsim> In reply to @croxrox "Thanks, changing file name": https://narimiran.github.io/nim-basics/
15:06:22*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
15:06:33FromDiscord<mratsim> and some exercises/full apps that you can write in Nim: https://xmonader.github.io/nimdays/book_intro.html
15:07:30*antranigv joined #nim
15:26:33FromDiscord<pysan> I know this was asked gazillion times but when would `v2.0.0` be released? Or could anyone provide me a ref where can I find something like a roadmap?
15:29:12FromDiscord<that_dude> https://github.com/nim-lang/RFCs/issues/503 ↵In theory when all of these are done iirc https://github.com/nim-lang/Nim/labels/Showstopper
15:29:27FromDiscord<that_dude> (edit) "iirc" => "iirc:"
15:29:36FromDiscord<that_dude> @pysan
15:38:47FromDiscord<pysan> Thanks!!
15:55:33NimEventerNew thread by exelotl: High stack usage when calling `reset` on an object with a destructor, see https://forum.nim-lang.org/t/10184
16:14:23*rockcavera joined #nim
16:39:32FromDiscord<arnetheduck> In reply to @PMunch "<@882793909246369864>, maintaining all kinds": the other way around: the PM can install the right version of nim, and packages specify which version of nim they require / are compatible with
16:39:46FromDiscord<arnetheduck> choosenim is mostly obsoleted that way
16:40:47FromDiscord<arnetheduck> from the point of view of an application or library, "nim" is just one more dependency like any other
16:40:54FromDiscord<arnetheduck> (edit) "from the point of view of an application or library, "nim" is just one more dependency like any other ... " added "library"
16:44:08FromDiscord<Dudugz> In reply to @PMunch "<@882793909246369864>, maintaining all kinds": Just my simple opinion: It was easier to combine choosenim with Nimble. In theory Nimble should be Nim's package manager so it should be able to install Nim and its updates as well as pip (python) and npm (node).
16:46:09FromDiscord<arnetheduck> as of https://github.com/nim-lang/nimble/pull/1017, nimble can download the right version of nim
16:47:34FromDiscord<arnetheduck> also, https://github.com/nim-lang/nimble/pull/1081 allows you to enter a nimble shell inside of which all commands are routed to that version of nim, so you can trivially have several side-by-side nim versions without polluting your global PATH with any particular nim
16:48:45FromDiscord<arnetheduck> in this sense, `choosenim` promotes an antipattern due to its reliance on a global installation
16:48:55FromDiscord<arnetheduck> (edit) "in this sense, `choosenim` promotes an antipattern ... due" added "in usage"
16:58:54FromDiscord<Dudugz> Although I prefer to have a single version for all my projects than having thousands of different versions to use in different projects. But it's useful to be able to install multiple versions when working with older or newer projects that you don't own.
17:06:30*PMunch joined #nim
18:09:06*PMunch quit (Quit: leaving)
18:37:49FromDiscord<Gumbercules> I'm trying to pass a list of typedescs into a macro and produce a comma separated list of them - so something like
18:38:43FromDiscord<Gumbercules> sent a code paste, see https://play.nim-lang.org/#ix=
18:39:47FromDiscord<Gumbercules> any ideas how to properly do this?
18:56:54*demetera quit (Remote host closed the connection)
18:58:12*demetera joined #nim
18:59:53FromDiscord<leorize> you have to unpack the varargs manually
19:00:01FromDiscord<leorize> I think there's macros.unpackVarargs for this
19:00:13FromDiscord<leorize> this is due to typed varargs having a pretty weird container
19:08:06FromDiscord<Gumbercules> In reply to @leorize "this is due to": thanks - this is what I ended up doing
19:09:12FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=4vtQ
19:10:58FromDiscord<leorize> beef you told me no one would write code like this
19:11:12FromDiscord<Elegantbeef> No one with a brain
19:11:28FromDiscord<leorize> sent a code paste, see https://play.nim-lang.org/#ix=4vtR
19:12:08FromDiscord<Elegantbeef> God that's an abomination
19:12:23FromDiscord<Elegantbeef> I assume that's me?
19:12:32FromDiscord<leorize> nope, that's compiler code
19:12:41FromDiscord<leorize> I haven't pulled the git blame out
19:12:43FromDiscord<leorize> I don't want to know
19:12:59FromDiscord<Elegantbeef> Whew it's not me
19:13:14FromDiscord<Elegantbeef> That's in objconstr, I have not touched it
19:13:19FromDiscord<Elegantbeef> But yea that's just awful code
19:14:05FromDiscord<leorize> it's pretty concerning that it's even valid
19:14:14FromDiscord<Elegantbeef> Meh
19:14:28FromDiscord<leorize> I mean, I read the compiler code so I knew why it was valid, but still
19:21:05FromDiscord<Elegantbeef> See i'm much simpler I think that `if a: b else: c` is equally as horrid
19:26:24FromDiscord<leorize> if it's that short I'd take it
19:27:25FromDiscord<Elegantbeef> I generally prefer all expressions to be multiple lines, but good thing i'm not the arbiter of people's code
19:28:45FromDiscord<Sim> Hey there, does anyone have any experience with nim\_sdl2? It seems like it doesn't recognize my controller input, despite correctly logging when I (dis)connect it.
19:29:48FromDiscord<Elegantbeef> Does your event loop handle controller input?
19:31:59FromDiscord<Sim> Actually I'm trying nico (https://github.com/ftsf/nico), and from what I understand, yes. It calls `pollEvent()` which should trigger on all events, but ignores the controller buttons/axes
19:33:18FromDiscord<Elegantbeef> https://github.com/ftsf/nico/blob/main/nico/backends/sdl2.nim#L1253-L1259 well it handles input for controllers
19:34:08FromDiscord<Elegantbeef> Are you sure your controller is properly mapped to what nico expects?
19:34:35FromDiscord<Elegantbeef> Give me a quick minute to make a test
19:35:30FromDiscord<Sim> I added an echo right below this line https://github.com/ftsf/nico/blob/main/nico/backends/sdl2.nim#LL1197C3, it's the base event that triggers on everything
19:36:20FromDiscord<Sim> Ok, apparently both my xbox controller have an issue with this. My ps4 controller works \:\|
19:36:41FromDiscord<Sim> Those controllers are fine everywhere else though, that's weird
19:37:04FromDiscord<Elegantbeef> Likely Nico expects a specific input layout especially since the name of the buttons are the playstation name
19:38:06FromDiscord<Elegantbeef> https://wiki.libsdl.org/SDL2/SDL_GameControllerAddMappingsFromFile seems like this is needed? No clue
19:41:08FromDiscord<Elegantbeef> Easy enough to test just throw that call somewhere before and see if it resolves it, if it does you have your (first?) PR to Nico 😄
19:46:31FromDiscord<Sim> it's already called, I added the gamecontrollerdb.txt in the assets folder, but no luck 🤔
19:46:47*advesperacit quit ()
19:46:51FromDiscord<Sim> though even the default mappings have xbox names (ABXY)
19:47:04FromDiscord<Elegantbeef> Are these first party xbox controllers?
19:47:08FromDiscord<Sim> yep
19:47:20FromDiscord<Elegantbeef> Where is that function called anywho, github isnt helping
19:48:28FromDiscord<Elegantbeef> Nevermind I forgot the namespace is removed in Nim
19:48:28FromDiscord<Sim> https://github.com/ftsf/nico/blob/main/nico/backends/sdl2.nim#L1786-L1787
19:48:53FromDiscord<Sim> I'll file an issue, at least to get some feedback and check if it happens only on my machine
19:49:10FromDiscord<Elegantbeef> Do you have a sample controller program?
19:49:31FromDiscord<Elegantbeef> A simple button tester like program seems pretty ideal 😄
19:50:19FromDiscord<Sim> do you want me to send an exe, or just the .nim?
19:50:20FromDiscord<Elegantbeef> The Nim, I'm not on windows
19:51:12FromDiscord<Sim> nico-test.zip https://media.discordapp.net/attachments/371759389889003532/1105220375056490597/nico-test.zip
19:51:25FromDiscord<Sim> You'll have to put sdl2 into the directory
19:51:29FromDiscord<Elegantbeef> No i dont
19:51:34FromDiscord<Elegantbeef> I'm on linux it's in my system path 😛
19:51:49FromDiscord<⚶ Zeno> In reply to @Sim "You'll have to put": do you really have to ?
19:51:51FromDiscord<Sim> the nico project also have a few examples that almost all use btnp(A)
19:52:18FromDiscord<⚶ Zeno> i have /bin/ registered in my path and since sdl exists in nim /bin/, i pretty much dont have to put sdl in my project manually
19:52:46FromDiscord<Elegantbeef> Works here with my steam controller being emulated as a xbox controller
19:52:56FromDiscord<Elegantbeef> Closest I can test with 😄
19:53:30FromDiscord<Elegantbeef> I mean windows users need either sdl2 installed in their path, or dropped next to the exe
19:53:37FromDiscord<Elegantbeef> It's a bit less error prone, but it's not like sdl2 is overly ABI breaking
19:53:42FromDiscord<Sim> those savages
19:56:29FromDiscord<Sim> Thanks for your help, I have to go \:) I'll keep you updated if it's solved ^^
19:57:03FromDiscord<Elegantbeef> Yea my analog stick also works
20:12:51*rockcavera quit (Remote host closed the connection)
20:39:38FromDiscord<ricky> can nim modify its own ast during runtime
20:39:46FromDiscord<ricky> perhaps becoming unbounded
20:42:07FromDiscord<Elegantbeef> Of course it cannot since it's compiled code and the AST no longer exists for that code
20:42:19FromDiscord<Elegantbeef> You can use the VM to evaluate macros at runtime though
20:49:55*rockcavera joined #nim
21:00:32*progranner joined #nim
21:06:55FromDiscord<decoded> Yall know of any nimlang obfuscators?
21:10:29FromDiscord<Dudugz> lol why would you need to obfuscate Nim? I mean, it's a compiled language, just reverse engineering it takes some work
21:11:00FromDiscord<Dudugz> Well if the target is Nim, you didn't specify what the obfuscator's target would be so I assumed it would be nim
21:11:49FromDiscord<that_dude> Cant you just compile with release?
21:18:53FromDiscord<Yepoleb> any obfuscator that works on compiled binary files should work
21:19:20FromDiscord<decoded> In reply to @Dudugz "Well if the target": Yeah it is
21:19:47FromDiscord<decoded> I just want to add a layer of security against retards that try to steal my code
21:21:28FromDiscord<huantian> ~~just make your program agpl~~
21:24:41*PMunch joined #nim
21:26:49FromDiscord<Dudugz> I mean, "your code" that can be reproduced by anyone else with the same knowledge and determination so..
21:26:55FromDiscord<jtv> So you want to make it impossible to get good debug info in the field?
21:27:05FromDiscord<Yepoleb> also nobody will steal your code lol
21:27:50FromDiscord<Yepoleb> i'm happy if someone even looks at the stuff i put up for free
21:27:55*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:28:07FromDiscord<jtv> Seriously, it takes a high enough bar of technical skill to reverse it that you're talking about very few people. And I've never seen obfuscation that protected anything significant from that community still cracking, or whatever.
21:28:29FromDiscord<jtv> It raises the bar, but in ways that aren't generally worth it
21:29:24FromDiscord<decoded> In reply to @jtv "Seriously, it takes a": all u need is 2 braincells to download pestudio and view the strings of the file
21:29:36FromDiscord<Yepoleb> and then?
21:32:04FromDiscord<decoded> Then you can edit them with another tool, and basically crack anything
21:32:13FromDiscord<decoded> You need string protection or obfuscation of some sort
21:33:02FromDiscord<Yepoleb> just use an exe packer
21:33:10FromDiscord<Yepoleb> but honestly it's just silly
21:33:30FromDiscord<jtv> I assure you that such things aren't done by many people in an absolute sense, and they're not people who were paying for anything anyway.
21:34:06FromDiscord<decoded> In reply to @jtv "I assure you that": Yes, they are
21:34:29FromDiscord<Yepoleb> what are you even writing that's worth protecting
21:34:37FromDiscord<jtv> I have seen this at large, large scale. In fact, most large games who are worried about piracy and cheating focus more on detecting based on observable traffic at the network level
21:34:51FromDiscord<decoded> In reply to @Yepoleb "what are you even": paid software
21:35:46FromDiscord<jtv> Essentially it's 100% counterproductive until you're very well tested and 100% sure it's going to be in the hands of millions, and even then, it tends not to be the way stuff is done anymore.
21:36:05FromDiscord<jtv> @Yepoleb For all of the common packers, there are auto-unpackers 🙂
21:36:36FromDiscord<decoded> In reply to @Yepoleb "just use an exe": Issue with this is that most free exe packers are used for malicious purposes, which will make my file flagged by every antivirus on the planet, deterring customers
21:37:03FromDiscord<decoded> In reply to @jtv "Essentially it's 100% counterproductive": most like hundreds
21:37:04FromDiscord<decoded> for me
21:37:10FromDiscord<decoded> (edit) "most" => "more"
21:37:17FromDiscord<Elegantbeef> If you're so worried about piracy you use DRM anyway
21:37:28FromDiscord<Elegantbeef> Obufscating strings in your binary does pretty much nothing
21:37:29FromDiscord<Yepoleb> In reply to @jtv "<@144300201857777664> For all of": doesn't matter, it's all for show anyway
21:37:35FromDiscord<jtv> They used to be commonly used by games, but now they're not... because it's a pretty crap approach all around
21:37:58FromDiscord<decoded> I just want to stop the average attacker that has more than 10 iq
21:38:11FromDiscord<decoded> Just simply viewing strings or opening it in dnspy or something similar shouldn't work
21:38:33FromDiscord<jtv> Then ship a binary, and you're fine. Legitimately, most people are fundamentally honest with any bar to jump at all
21:38:33FromDiscord<Yepoleb> the average attacker with more than 10 IQ won't waste time cracking your software
21:38:43FromDiscord<Elegantbeef> Indeed
21:38:44FromDiscord<decoded> In reply to @Yepoleb "the average attacker with": Depends how pissed off they are at me
21:39:01FromDiscord<decoded> In reply to @jtv "Then ship a binary,": Alright
21:39:06FromDiscord<Elegantbeef> The average user is not going to know what decompilation is
21:40:37FromDiscord<Yepoleb> are you writing network stressers for hackforums or something
21:40:59FromDiscord<willyboar> And most people who are not willing to pay for your product will use a free alternative
21:41:41FromDiscord<Elegantbeef> And then there are the people that wouldnt touch proprietary software unless
21:42:10FromDiscord<Yepoleb> this gives strong skids drama vibes
21:42:19FromDiscord<jtv> The number of people who massively overengineer based on anticipating problems WAY down the road from where they are still amazes me after 30 years 🙂
21:42:55FromDiscord<Yepoleb> wow are you like 40
21:43:14FromDiscord<jtv> No, almost 50
21:43:16FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "*And then there are": Unavoidable for most stuff hah
21:43:21FromDiscord<Elegantbeef> Jtv i've written the most advance DRM for everyone `if readFile("did you really buy this please be honest and buy this.txt") == "yes")`
21:43:22FromDiscord<jtv> 👴
21:43:36FromDiscord<jtv> That's good enough for me 🙂
21:43:49PMunch@Elegantbeef, ah the classic WinRAR approach
21:44:04FromDiscord<Elegantbeef> Unavoidable... aside from games and Discord I do not use proprietary software(Ok we all know about the microkernel on our motherboards)
21:44:09FromDiscord<Arathanis> In reply to @Elegantbeef "Jtv i've written the": Small code review: add something about "what would your mother think?" For extra guilt based protection
21:44:28FromDiscord<Elegantbeef> Thanks for the review
21:45:59FromDiscord<Yepoleb> i have a few proprietary apps on my phone, but not much on my pc
21:46:14FromDiscord<Elegantbeef> I have a lot on my PC due to games
21:46:35FromDiscord<Yepoleb> well games don't really count
21:47:20FromDiscord<Elegantbeef> You hear that @Anuke games do not need to be open source 😛
21:48:15FromDiscord<Elegantbeef> I really wish more games were open source though, did a PR eons ago to barony which inspired them to implement modding using json
21:49:00PMunchModding using JSON?
21:49:15FromDiscord<Elegantbeef> For context anuke developed mindustry which even has github releases, but is sold on steam
21:49:30FromDiscord<Yepoleb> i know mindustry the video game
21:49:44FromDiscord<Elegantbeef> Yea barony is an RPG so you can get a lot of flexibillity just by dynamically loading values
21:49:58PMunchOh yeah I've been meaning to try that
21:50:04FromDiscord<Yepoleb> i'm a gamer too
21:50:22PMunchFair enough, I was imagining some horrible JSON based programming language :P
21:50:47FromDiscord<Elegantbeef> The feature I added to barony was loading player characters from json to allow custom classes
21:51:07FromDiscord<Elegantbeef> It was denied of course since it'd allow bypassing monetisation
21:51:35FromDiscord<Elegantbeef> Since they sell expansions that add new classes
21:52:48PMunchAh
21:52:51PMunchOf course
21:52:59FromDiscord<Arathanis> In reply to @Elegantbeef "I really wish more": I love that game, that was you???
21:54:26*Notxor quit (Remote host closed the connection)
21:54:37FromDiscord<Elegantbeef> They even gave me a discord emote for my 6 hours of fighting C++ 😛
21:54:38FromDiscord<Elegantbeef> Yea I made a PR that kicked them in the pants to eventually add Json modding apparently
21:54:39PMunchTBH you could probably make your game open source, but not the build scripts :P Maybe not for Nim since you typically do a lot of classic build tasks in macros, but fuck trying to build a complex C++ project without any of the CMake/automake/make/whatever stuff
21:55:01FromDiscord<Elegantbeef> Make the entire code opensource and licensed with gpl3 or similar copyleft license
21:55:14FromDiscord<Elegantbeef> Then sell the assets with a built copy
21:55:17FromDiscord<Elegantbeef> That's what barony does
21:55:32PMunchHuh, I guess that's a pretty decent way of doing it
21:55:43PMunchLike good luck redrawing all the assets
21:56:01PMunchDoesn't stop illegal copies though
21:56:13PMunchJust ripping out all the assets
21:56:21FromDiscord<Arathanis> In reply to @Elegantbeef "They even gave me": We appreciate your sacrifice haha
21:56:21FromDiscord<Elegantbeef> Sure but if your game doesnt have DRM nothing does
21:56:28FromDiscord<Elegantbeef> And barony doesnt even use DRM iirc
21:56:57FromDiscord<Elegantbeef> There is a misconception that all games on Steam have a DRM but infact there are many games that are DRM free on steam
21:57:59FromDiscord<Arathanis> I have noticed that misconception too. People seem convinced it's DRM all the way down when in fact in a lot of cases you can just copy the install folder and it works just fine
21:58:04FromDiscord<Elegantbeef> @Arathanis well they took it much further than I had it, so I cannot take much credit for it
21:58:19FromDiscord<Arathanis> In reply to @Elegantbeef "<@136570191038513152> well they took": Getting the ball rolling is import too
21:58:26FromDiscord<Arathanis> (edit) "import" => "important"
21:59:11FromDiscord<Elegantbeef> Anywho barony's latest quality of death patch it fantastic if you havent played it
21:59:19FromDiscord<Elegantbeef> is fantastic\
21:59:20FromDiscord<Elegantbeef> Actual intuitive GUI
21:59:22FromDiscord<Arathanis> Especially when the ball is a giant boulder. C++ is sisyphean
21:59:39FromDiscord<Arathanis> How recent is this patch? Been a while
21:59:47FromDiscord<Arathanis> What kind of changes?
21:59:49FromDiscord<Yepoleb> In reply to @Arathanis "I have noticed that": it usually just fails because it's built with steam integration and depends on it
22:00:07FromDiscord<Elegantbeef> It's a big quality of life update before their switch release
22:00:23FromDiscord<Elegantbeef> So changes to mechanics, balancing, and an actual GUI
22:01:20FromDiscord<Elegantbeef> https://steamcommunity.com/games/371970/announcements/detail/3427829445173395981 the release page for the beta
22:01:24FromDiscord<Arathanis> Sounds awesome. Definitely going to revisit. It's Steam Deck verified right? They seem exactly like the kinds of devs to push for that
22:01:39FromDiscord<Elegantbeef> It's native linux so i'd hope so
22:02:13FromDiscord<Arathanis> Brilliant
22:02:37FromDiscord<Elegantbeef> Speaking of annoying build systems they use VS to build it on windows 😄
22:02:55FromDiscord<Arathanis> You are correct: https://www.protondb.com/app/371970
22:03:24FromDiscord<Elegantbeef> So I could(would really) not build it for my friends 😄
22:04:05FromDiscord<Anuke> In reply to @Elegantbeef "You hear that <@123539225919488000>": I feel like, for certain games, it makes sense to be closed source (or at least not "contributions open"), either because the game is linear/content-based or because you don't want to deal with making presentable/buildable code ("issue: how to build on [OS you do not use]?")
22:05:15FromDiscord<Elegantbeef> Perhaps but I'm biased, I want an easy path to tinker with games
22:06:30FromDiscord<Elegantbeef> I'm also apart of the group of people that would like dedicated servers for games, cause I'm tired of games as a service existing and dying
22:09:29FromDiscord<Yepoleb> a lot of people think making the source code open forces them to do all these community tasks but it does not really
22:10:41FromDiscord<Anuke> I remember someone complaining that I made my code open source because it didn't have any "how to start" documentation or usage guide - this was for some distant fork of a game framework I had↵↵Seemed to think that I should have just not made it open source instead
22:10:51FromDiscord<Anuke> Of course, hopefully not all people are like that, but it was annoying
22:11:23FromDiscord<Yepoleb> i wouldn't let entitled people change how i do things
22:11:38FromDiscord<Anuke> yeah...
22:18:56FromDiscord<ricky> In reply to @jtv "Seriously, it takes a": idk IDA pro makes it easy af these days
22:19:38FromDiscord<ricky> even Ghidra + locally trained LLM embeddings has made RE pretty much drag n drop
22:26:47FromDiscord<huantian> In reply to @Elegantbeef "There is a misconception": yeah with rd and adofai they intentionally made it to not use the basic steam drm so people don't have to launch it from steam if they didn't want to
22:39:43FromDiscord<sOkam!> is there any rough ETA for when nimls will stop being broken?
22:40:18FromDiscord<sOkam!> hasn't worked since forever, miss it a lot 😔
22:41:55FromDiscord<leorize> I think nimlangserver is the main implementation now
22:41:58PMunchnimls?
22:42:04PMunchOh, nimlsp
22:42:46PMunchWell nimlangserver broke nimsuggest, which in turn broke nimlsp.. And even though my fix is merged there hasn't been a tagged release since
22:43:30*lucasta quit (Remote host closed the connection)
22:43:43FromDiscord<sOkam!> ic
22:44:00FromDiscord<sOkam!> is there nimlangserver support for nvim?
22:44:18FromDiscord<leorize> I think they merged it recently
22:44:26PMunchI'm working on some improvements as well, trying to get it working with the latest nimsuggest v3 mode, but I don't think the nimlangserver maintainers bothered to make the nimsuggest-as-a-library part work
22:45:04PMunchSo I've got to reverse engineer what they did and figure out how it should work for nimsuggest-as-a-library
22:45:06FromDiscord<jmgomez> Nim Lang server at least on windows for vscode is kinda broken anyways.
22:45:22FromDiscord<jmgomez> In reply to @PMunch "Well nimlangserver broke nimsuggest,": How can it break nimsuggest?
22:45:32FromDiscord<jmgomez> Did they patch it or something?
22:45:34FromDiscord<Elegantbeef> Cause they added a new API for it but fucked up v2
22:45:35PMunchMake a PR with bad code to Nim?
22:46:00FromDiscord<jmgomez> And why it wasn’t rollback?
22:46:15PMunchBasically this: https://github.com/nim-lang/Nim/pull/21555
22:46:33PMunchWell it was merged and backported, but no new version has been tagged since then..
22:46:38PMunchSo the error persists
22:47:19PMunchI still use an old version and it works fine
22:47:23FromDiscord<jmgomez> gotcha, I thought the issue was still in devel
22:47:49FromDiscord<leorize> have you seen anything merged that was rolled back even if it broke things in Nim? \:p
22:48:56FromDiscord<jmgomez> not so long ago I was promised that some pr I dont gonna mention will be rollback if it wasnt fix before 2.0
22:49:33FromDiscord<jmgomez> but fortunately it did get fixed
22:50:37PMunchSure, the alternative here would be to release a 1.6.12b or something
22:50:50PMunchOr just immediately jump to 1.6.14
22:51:32FromDiscord<jmgomez> @PMunch you seem to have some exp with nimsuggest and the tooling, in your opinion does the promise of IC magically fixing nimsuggest holds?
22:52:16PMunchIt would probably fix some stuff, but nimsuggest is broken in other ways
22:52:27PMunchI believe IC would just mean nimsuggest is faster
22:52:35FromDiscord<leorize> IC will fix everything if it ever arrives
22:52:48PMunchYou will be able to fly once IC hits
22:53:15FromDiscord<leorize> the biggest perk is proper state serialization and a defined format for queries
22:53:33FromDiscord<jmgomez> I mean if the problem is that it "crashes often" it may have a change? But Im afraid that isnt the only problem
22:53:34FromDiscord<leorize> now here's the issue\: the last time I looked at it, it was on v8
22:53:38PMunchBut to be serious I don't think it would fix any of the bugs in nimsuggest, unless nimsuggest needs a full rewrite to support it :P
22:53:54FromDiscord<leorize> and still haven't made it
22:54:00FromDiscord<jmgomez> (edit) "change?" => "chance?"
22:54:49PMunchWell the reason it "crashes often" is one or more of those bugs I alluded to. Basically nimsuggest is trying to compile your entire Nim program and gather information and return errors instead of creating a binary
22:55:28FromDiscord<leorize> coming with IC is a brand new compiler intermediary storage format that enables some very exciting redesign of sem and related stages
22:55:42FromDiscord<jmgomez> is it just that nimsuggest.nim in the compiler?
22:56:23FromDiscord<leorize> nimsuggest.nim is just the interface, the remainders are in compiler/suggest and sem
22:57:28FromDiscord<sOkam!> why is compiling the entire project on each nimsuggest change a good idea?↵i never understood that choice, no matter how fast the compiler is 🤔
22:57:38FromDiscord<Elegantbeef> Cause it's required
22:57:50FromDiscord<leorize> because the compiler can't do anything else
22:57:51FromDiscord<sOkam!> is that how clangd works?
22:58:24FromDiscord<leorize> the roots of nimsuggest comes from `nim idetools`, which is a one-shot version of nimsuggest
22:58:34FromDiscord<Elegantbeef> I'd argue that IC would solve the entire suggest part of nimsuggest 😛
22:59:02FromDiscord<jmgomez> I have a side project of a side project of a side project inside NUE that parses Nim and makes the Nim code compatible with the VM in case that fails
22:59:14FromDiscord<Elegantbeef> With an IC cache you just iterate through the IC table for the module you're in and find the symbol that makes sense
22:59:18FromDiscord<leorize> process execution was considered the bottleneck then, and nimsuggest is born as the "server" version of `idetools`
22:59:38FromDiscord<leorize> `nimfind` implements that IC idea iirc
22:59:44FromDiscord<jmgomez> In reply to @Elegantbeef "With an IC cache": I was thinking something on those lines rather than fater recovery
23:00:39FromDiscord<jmgomez> .rod files are just a form of accesible symbols right? You can read them independently
23:00:58FromDiscord<jmgomez> (edit) "fater" => "faster"
23:01:00FromDiscord<leorize> it's even better\: it's the entire sem-ed AST tree
23:01:40FromDiscord<jmgomez> I mean, it need to have everything valuable there for the compiler otherwise a compilation would be required and they wont make sense
23:01:48FromDiscord<leorize> what does this gives you? compiled macros, you can produce tools that do whole-code transform with this
23:03:43FromDiscord<leorize> and if macros work for the entire thing, then simply scale it down and you get regular macros that can be remade as programs that transform selective parts of the tree
23:04:19FromDiscord<leorize> further more, you can even split codegen into a separate program that just crunch these trees, allowing for pluggable codegen
23:04:38FromDiscord<leorize> IC is genuinely exciting, shame that it probably won't arrive
23:05:07FromDiscord<jmgomez> indeed, what do you think it wont arrive?
23:05:31FromDiscord<Elegantbeef> Cause it's been 3+ years since it was promised
23:05:36FromDiscord<jmgomez> My understanding is that ARC/ORC was "more important" and that's why the development paused
23:06:18FromDiscord<ieltan> IC would be nice for repl
23:06:34FromDiscord<jmgomez> I dont think so
23:06:46FromDiscord<jmgomez> you still need to compile C/C++
23:06:48FromDiscord<ieltan> What would be nicer is if the repl is jitted...
23:06:57FromDiscord<ieltan> In reply to @jmgomez "you still need to": Ah
23:07:03FromDiscord<jmgomez> nice for a repl would be FFI NimScript
23:07:04FromDiscord<Elegantbeef> TCC exists
23:07:44FromDiscord<leorize> not really, it changed hands 3 times by now↵(@jmgomez)
23:08:01FromDiscord<ieltan> In reply to @Elegantbeef "TCC exists": What is tcc?
23:08:09FromDiscord<Elegantbeef> tiny c compiler
23:08:17FromDiscord<ieltan> Oh yeah
23:08:21FromDiscord<Elegantbeef> It's a fast C compiler that is made specifically for using C as a scripting language
23:08:45FromDiscord<jmgomez> In reply to @leorize "not really, it changed": can you elaborate more on it?
23:08:57FromDiscord<leorize> reimplemented 8 times and it really seems like the only way it'd ever made it is a rewrite of the compiler
23:09:26FromDiscord<leorize> changed hands 2 times, to be precise
23:09:39FromDiscord<leorize> Araq -\> disruptek -\> Araq
23:10:35FromDiscord<jmgomez> ahh didnt know that, thanks
23:10:52FromDiscord<jmgomez> I mean I got it working not so long ago for some modules
23:10:57FromDiscord<decoded> penis
23:11:15FromDiscord<leorize> it's always been flip-flopping
23:11:15FromDiscord<jmgomez> but it wasnt taht fast and I switched the approach to get NUE compiling faster
23:11:39FromDiscord<decoded> In reply to @leorize "it's always been flip-flopping": ok
23:12:21FromDiscord<jmgomez> which seems to me like is not that far away
23:12:22FromDiscord<leorize> the sem stages are not designed for it, so ordering issues are plenty
23:12:53FromDiscord<jmgomez> yeah, that was exactly the issue
23:13:12FromDiscord<jmgomez> in its current state it needs either to skip some modules or to patch the rod files..
23:13:50FromDiscord<jmgomez> so you think the whole sem stages needs to be refactor?
23:14:38FromDiscord<leorize> yep
23:15:21FromDiscord<Elegantbeef> Making the compiler not be designed for hardware in the 90s would be great 😛
23:15:28FromDiscord<leorize> it's happening, just not in nim
23:20:51*azimut quit (Remote host closed the connection)
23:21:21*azimut joined #nim
23:33:23*PMunch quit (Quit: leaving)
23:47:53FromDiscord<sOkam!> How do you -force- nimble to download a library with the latest devel version of a git repository, when that library also has a released numbered version?
23:48:21FromDiscord<Elegantbeef> `nimble install myPackage@#head`
23:48:59FromDiscord<sOkam!> nimble install vmath@#head↵ Error: Version range expected after '@'.
23:49:18FromDiscord<leorize> maybe you need to quote
23:50:08FromDiscord<sOkam!> good catch, ty
23:50:23FromDiscord<leorize> your shell might interpreted the # as a comment