<< 24-06-2022 >>

00:19:13FromDiscord<Zectbumo> @ElegantBeef what engine are you using for your game?
00:24:23FromDiscord<Elegantbeef> My own framework
00:27:42*wallabra quit (Ping timeout: 272 seconds)
00:28:26FromDiscord<retkid> :|
00:28:46FromDiscord<retkid> How can i change prologue from html to plaintext
00:31:21FromDiscord<retkid> got it :)
00:39:18FromDiscord<Elegantbeef> It's here but not documented or setup for easy reproducible builds https://github.com/beef331/truss3d 😄↵(@Zectbumo)
00:48:04FromDiscord<m4ul3r> Is it possible to convert a string to an sql string to an SqlPrepared type?
00:48:16FromDiscord<m4ul3r> (edit) removed "sql string to an"
00:57:17FromDiscord<ripluke> Does nimlsp support formating
01:12:06FromDiscord<ynfle> In reply to @m4ul3r "Is it possible to": `sql"PUT STRING HERE"`
01:17:08FromDiscord<m4ul3r> In reply to @ynfle "`sql"PUT STRING HERE"`": I'm trying to make something purposely vulnerable, so there's a string the user controls, something like:↵`query = "SELECT FROM employees WHERE first_name LIKE '%" & userVal & "%'"`↵I can't concat the SqlPrepared to a string is the issue
01:31:04FromDiscord<huantian> good because that's how you get sql-injectioned
01:31:26FromDiscord<huantian> look at the examples https://media.discordapp.net/attachments/371759389889003532/989704269756260383/unknown.png
01:31:41FromDiscord<huantian> in this case the first question mark is replaced by the value "Jack"
01:34:00FromDiscord<m4ul3r> yes, I'm trying to create something vulnerable
01:44:10FromDiscord<m4ul3r> My solution has to just run python from my nim program. ↵+1 on nim for being so secure with it, can't figure out how to get sqli
01:46:14FromDiscord<exelotl> sent a code paste, see https://paste.rs/O5j
01:46:49FromDiscord<exelotl> tbh the `sql` template should only accept static strings, to prevent this :P
01:47:16FromDiscord<exelotl> it was probably made before static params were part of the language, I guess
01:47:25*wallabra joined #nim
01:52:00FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=40L9
01:55:17FromDiscord<ynfle> In reply to @m4ul3r "I'm trying to make": Don't do that!!!! That's a sql injection waiting to happen
01:55:47FromDiscord<huantian> it took me a few readings of the question but I think that's the point??
01:55:49FromDiscord<ynfle> In reply to @huantian "look at the examples": See this picture @m4ul3r
01:56:10FromDiscord<ynfle> Oh nice
01:56:12FromDiscord<huantian> like they want to make it vulnerable as an example or something
01:56:38FromDiscord<ynfle> Well you can write you own `&` for the type but Wrapping is after is also possible
02:38:31FromDiscord<Prestige> @ripluke https://github.com/PMunch/nimlsp#supported-protocol-features nope
02:39:11FromDiscord<ripluke> Rip
02:39:32FromDiscord<ripluke> I did some rigging with nimpretty and neovim so now I have format on save
03:15:49*arkurious quit (Quit: Leaving)
03:22:43FromDiscord<Prestige> good idea
03:31:49NimEventerNew thread by Elcritch: Setting compiler-style defines in normal code?, see https://forum.nim-lang.org/t/9260
04:56:48*kayabaNerve joined #nim
05:27:55FromDiscord<Prestige> @ripluke How did you configure nimpretty with neovim?
05:28:13FromDiscord<ripluke> Nulllsp
05:28:39FromDiscord<ripluke> https://github.com/jose-elias-alvarez/null-ls.nvim
05:29:00FromDiscord<ripluke> I can send you the Lua code that I used aswell
05:29:16FromDiscord<Prestige> eh all good
05:53:07FromDiscord<j-james> how can you configure imports to always be relative to the main `src/` directory?
05:53:31FromDiscord<Elegantbeef> You cant
05:53:56FromDiscord<Elegantbeef> You should be able to just import relative to your package regardless
05:54:46FromDiscord<Elegantbeef> For instance `import truss3D/[textures, shaders, inputs, models]` anywhere inside my `truss3D` path
05:56:13FromDiscord<j-james> ? weird
05:56:13FromDiscord<Elegantbeef> I should clarify i dont think you can i could be wrong
05:56:32FromDiscord<j-james> are you exporting modules in a `truss3D.nim` file?
05:56:40FromDiscord<Elegantbeef> No
05:57:07FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/guicomponents/uielements.nim
05:57:32FromDiscord<Elegantbeef> You can import relative to your source package's source just by using the package name
05:58:11FromDiscord<ripluke> Does Nim have an argparsing library that allows both -a -v and -av as the same thing
05:58:47FromDiscord<ambient> seems that rule is ambiguous. can't you just add "-av" manually?
05:59:24FromDiscord<Elegantbeef> many utilities do `-` grouped as single flag optionals
05:59:25FromDiscord<ripluke> I can but it's not very easy to scale
05:59:41FromDiscord<Elegantbeef> I cant say if i know that any do best is just to try it
05:59:51FromDiscord<ripluke> In reply to @Elegantbeef "many utilities do `-`": I tried ↵https://github.com/iffy/nim-argparse
05:59:58FromDiscord<ripluke> Doesn't support it lol
06:00:08FromDiscord<offbeat-stuff (offbeat-stuff)> has anyone been able to compile nim to wasm with clang --target=wasm32
06:00:14FromDiscord<offbeat-stuff (offbeat-stuff)> w/o emscripten
06:00:27FromDiscord<Elegantbeef> I've not tried it but i can give it a whirl
06:00:37FromDiscord<Elegantbeef> Would be nicer than emscripten 😄
06:01:14FromDiscord<offbeat-stuff (offbeat-stuff)> https://dassur.ma/things/c-to-webassembly/
06:01:34FromDiscord<offbeat-stuff (offbeat-stuff)> Here is where i saw it
06:01:55FromDiscord<offbeat-stuff (offbeat-stuff)> It shows a way with llvm and also with single command
06:06:08FromDiscord<Elegantbeef> Hmm having to call the linker manually seems like it'll be a pain, but i couldnt even get string.h to be found so that's a later thing for me to try
06:06:14FromDiscord<j-james> In reply to @Elegantbeef "https://github.com/beef331/truss3d/blob/master/src/": ah you have another truss3D folder i see
06:06:20FromDiscord<j-james> that's probably it
06:07:40FromDiscord<Elegantbeef> Yea
06:18:17FromDiscord<ripluke> i figured out how to have my computer not hate me for having discord open all day
06:19:28FromDiscord<ripluke> ripcord is very light
06:21:27FromDiscord<Rika> have fun with the broken webhooks then
06:23:44madpropslots of activity on nim this past month https://i.imgur.com/lACUOIR.jpg
06:24:18madpropsthere was another one i was looking for
06:24:21madpropsthat had nim in the name
06:24:26FromDiscord<ambient> man, would be nice to have an actual hyperlink instead of an image 😅
06:25:04madpropsi think there are actually more results
06:25:12madpropsbut search uses \b
06:32:08FromDiscord<Prestige> Wow worm has a lot of stars
06:32:15FromDiscord<Prestige> I need to advertise more
06:34:10FromDiscord<Elegantbeef> Worm is offered as a default WM for endeveourOS iirc
06:34:29FromDiscord<Prestige> Wow that's pretty cool
06:39:24FromDiscord<j-james> i've seen https://uploads.peterme.net/nimsafe.html linked a lot
06:39:56FromDiscord<j-james> PMunch: have you thought about updating/expanding on it for arc/orc?
06:44:42FromDiscord<Rika> In reply to @Elegantbeef "Worm is offered as": god damn
06:46:23*tanami joined #nim
06:48:44*rockcavera quit (Remote host closed the connection)
06:54:21FromDiscord<🐒🧠br4n_d0n> How do use a string that contains a variable in the quit proc?
06:54:32FromDiscord<🐒🧠br4n_d0n> (edit) "How do ... use" added "I"
06:55:13FromDiscord<🐒🧠br4n_d0n> I have it formatted like you would with the echo proc
06:56:01FromDiscord<Elegantbeef> `strformat` or `strutils.%`
07:05:15FromDiscord<🐒🧠br4n_d0n> Hmm, is the ``Error: ...`` message being thrown from my system or nim when I use ``quit``?
07:06:21FromDiscord<Rika> we wouldnt know unless you could tell us the whole story
07:07:21FromDiscord<🐒🧠br4n_d0n> I'm using quit with a custom string and then after that string is printed out I get a new line with an error message about the execution of a program failing
07:08:57*om3ga quit (Ping timeout: 260 seconds)
07:09:43FromDiscord<Rika> the error message is
07:09:52FromDiscord<offbeat-stuff (offbeat-stuff)> send the error message
07:11:00FromDiscord<🐒🧠br4n_d0n> I think it might be a system message, but it's late and I cannot think↵``Error: execution of an external program failed: '/Users/br4n_d0n/.cache/nim/match_d/match_321330EA7924B217793C95BBDF845EB2E61AF7F9 '``
07:13:40FromDiscord<offbeat-stuff (offbeat-stuff)> can you send the code of the quitProc
07:14:45FromDiscord<🐒🧠br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=40LC
07:18:20FromDiscord<🐒🧠br4n_d0n> I could always quit with a success response code to potentially suppress this additional method
07:18:31FromDiscord<🐒🧠br4n_d0n> (edit) "method" => "message"
07:18:43FromDiscord<🐒🧠br4n_d0n> (edit) "this" => "the"
07:22:47FromDiscord<Rika> In reply to @br4n_d0n "I think it might": is this the whole output
07:23:09FromDiscord<🐒🧠br4n_d0n> Yes
07:23:23FromDiscord<Rika> `quit &"Invalid syntax at {index}", QuitSuccess`
07:23:24FromDiscord<Rika> try
07:23:33FromDiscord<Rika> actually no
07:23:42FromDiscord<Rika> dont do that ofc, i forgot what the actuall issue was
07:23:49FromDiscord<Rika> are you running with `nim -r` or nimble
07:23:57FromDiscord<Rika> run the binary by itself
07:24:09FromDiscord<Rika> it will not have the extra error, which comes from nim
07:24:13FromDiscord<Rika> since its running the program
07:24:38FromDiscord<🐒🧠br4n_d0n> AH, I was using the run command
07:24:42FromDiscord<🐒🧠br4n_d0n> Good to know
07:25:09FromDiscord<🐒🧠br4n_d0n> That solved the issue
07:25:11FromDiscord<🐒🧠br4n_d0n> Thanks
07:25:40FromDiscord<Rika> i forgor 💀
07:44:19*xet7 joined #nim
08:10:28FromDiscord<ezquerra> That message confused me as well until I understand that it was simply indicating that the compiled program returned a non 0 error code
08:10:35FromDiscord<ezquerra> I think the message is a bit confusing
08:11:04FromDiscord<ezquerra> Perhaps it could say `Error: external program returned a non 0 error code:`
08:11:32FromDiscord<ezquerra> Or maybe even make that a Warning rather than an error (unless nim c -r returns the error code too?)
08:13:06FromDiscord<AmitSupremacy> In windows, nim 1.6.6 build is being detected as virus. In wsl everything is fine. Could you help me with it?
08:14:18FromDiscord<that_dude> One day it won't get flagged
08:14:35FromDiscord<Asbjørn F> Microsoft feels threatened, clearly
08:14:49FromDiscord<xflywind> Add an exclusion to Windows Security
08:14:50FromDiscord<that_dude> Tbh my solution was to disable the antivirus when installing it to get to to install properly
08:15:05FromDiscord<xflywind> https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26
08:15:09FromDiscord<Asbjørn F> when I install choosenim it isn't an issue
08:15:23FromDiscord<Asbjørn F> or instal via choosenim, rather
08:30:47*om3ga joined #nim
09:37:58*jmdaemon quit (Ping timeout: 240 seconds)
09:56:48*xet7 quit (Remote host closed the connection)
09:59:56*xet7 joined #nim
10:12:56*genpaku quit (Read error: Connection reset by peer)
10:16:41*genpaku joined #nim
10:20:18*xet7 quit (Remote host closed the connection)
10:21:31*xet7 joined #nim
10:30:20FromDiscord<exelotl> Also I'm able to install via scoop without getting flagged
10:46:11FromDiscord<AmitSupremacy> installed ignoring the warning 🙂
10:58:21NimEventerNew thread by Dee0xeed: Unexpected empty sequence, see https://forum.nim-lang.org/t/9261
11:09:16*xet7 quit (Remote host closed the connection)
11:10:22*xet7 joined #nim
11:10:34*xet7 quit (Remote host closed the connection)
11:11:43*xet7 joined #nim
11:13:33FromDiscord<Josef> How do you cast an integer to pointer to C function?
11:45:03FromDiscord<furtidev> Hi, does this work
11:45:08FromDiscord<furtidev> I suppose it does.
11:49:29FromDiscord<Rika> It does
11:51:25FromDiscord<enthus1ast> You can define the function header then cast the int to this function, or cast it to pointer but then you cannot exec the proc↵(@Josef)
11:52:11FromDiscord<enthus1ast> Must define it with the appropriate calling convention etc
12:03:20FromDiscord<Josef> In reply to @enthus1ast "Must define it with": What do you mean?
12:03:47FromDiscord<enthus1ast> you must know how the c function is implemented
12:04:07FromDiscord<enthus1ast> so eg for stdcall use the {.stdcall.} macro
12:05:42FromDiscord<Josef> You mean, if the c function to std, I need to use `.stdcall`?
12:05:47FromDiscord<Josef> (edit) "`.stdcall`?" => "`stdcall`?"
12:06:07FromDiscord<Josef> (edit) "to" => "uses"
12:06:24FromDiscord<enthus1ast> i mean this\: https://en.wikipedia.org/wiki/Calling_convention
12:07:48FromDiscord<enthus1ast> usually its stdcall these days, but eg the ntdll.dll uses fastcall
12:08:07FromDiscord<enthus1ast> so you either know it, you guess it, or you look in a debugger
12:08:29FromDiscord<Josef> Nim itself uses stdcall by default?
12:08:59FromDiscord<enthus1ast> idk what nimcall is
12:09:46FromDiscord<enthus1ast> "nimcall↵is the default convention used for a Nim proc. It is the same as fastcall, but only for C compilers that support fastcall."
12:10:01FromDiscord<enthus1ast> https://nim-lang.org/docs/manual.html#types-procedural-type
12:12:35*Guest17 joined #nim
12:29:57FromDiscord<Zoom> [planetis](https://matrix.to/#/@planetis:matrix.org)\: why did you close your PRs to threading?
13:17:33FromDiscord<planetis> Seeing that this is going nowhere, I will keep maintaining my own repo
13:18:54FromDiscord<planetis> but I do hope, one day everyone interested with multi threading will have a discussion or better a hacking marathon to build better threading primitives from scratch
13:21:08*ltriant quit (Ping timeout: 268 seconds)
13:23:57FromDiscord<gongongagaga> can i have a header file in nim or do i have to pack everything in 1 file
13:25:06FromDiscord<enthus1ast> you can import other modules
13:25:26FromDiscord<enthus1ast> you can also include oder nim code
13:26:15FromDiscord<enthus1ast> but include is quite uncommon and most code works by importing modules
13:44:38*arkurious joined #nim
14:03:32*xet7 quit (Remote host closed the connection)
14:04:35*xet7 joined #nim
14:04:50*xet7_ joined #nim
14:09:17FromDiscord<Forest> Heya, just wondering if it's possible to define a new compiler backend without modifying the source?
14:09:27FromDiscord<Forest> Since isn't it possible to do it from a separate project?
14:10:06*rockcavera joined #nim
14:10:06*rockcavera quit (Changing host)
14:10:06*rockcavera joined #nim
14:10:30FromDiscord<Forest> Found it
14:10:38FromDiscord<gongongagaga> how can i define an anonymous enum in nim
14:11:03FromDiscord<gongongagaga> sent a code paste, see https://play.nim-lang.org/#ix=40ML
14:11:13*ltriant joined #nim
14:13:45FromDiscord<Generic> you can use indvidual consts
14:14:12FromDiscord<gongongagaga> yea but wouldnt making a pointer to the const allocate space
14:14:14FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=40MN
14:14:57FromDiscord<Generic> no, consts which fit immediates are pretty much always inlined
14:15:04FromDiscord<gongongagaga> aight epic ty
14:20:22FromDiscord<gongongagaga> does applying a pragma to an object go after it or before the object
14:20:46FromDiscord<gongongagaga> for example should i do `PSR {.union.} = object` or `PSR = object {.union.}`
14:21:10*ltriant quit (Ping timeout: 272 seconds)
14:23:53FromDiscord<gongongagaga> sent a code paste, see https://paste.rs/zCF
14:25:22NimEventerNew thread by Moigagoo: Writing a shared lib for Android, see https://forum.nim-lang.org/t/9262
14:30:11FromDiscord<ynfle> In reply to @gongongagaga "how can i implement": Does it have to be anonymous?
14:30:16FromDiscord<gongongagaga> kind of yeah.
14:30:18FromDiscord<gongongagaga> (edit) "yeah." => "yeah"
14:30:21FromDiscord<ynfle> Y?
14:31:00FromDiscord<gongongagaga> wym why↵i have them as an anom struct in my C code and changing it to a named one breaks all sorts of stuff
14:31:06FromDiscord<gongongagaga> (edit) "anom" => "anon"
14:32:10FromDiscord<Rika> no nim does not have anonymous structs
14:32:57FromDiscord<ynfle> You can define the type in a header file and import it if you really want
14:33:04FromDiscord<Rika> or emit
14:33:53FromDiscord<gongongagaga> ok how would it be implemented without an anon struct
14:35:35FromDiscord<ynfle> Define a separate sruct
14:35:42FromDiscord<ynfle> ie. type
14:37:05FromDiscord<ynfle> In reply to @gongongagaga "ok how would it": https://nim-lang.org/docs/manual.html#foreign-function-interface-union-pragma once the type is declared
14:40:39FromDiscord<Generic> I use this macro in my emulator for exactly things like this: https://github.com/RSDuck/hocuspocube/blob/master/hocuspocube/util/bitstruct.nim
14:41:12FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=40MU
14:50:33FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40MZ
14:50:43FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=40MZ" => "https://play.nim-lang.org/#ix=40N0"
14:50:45FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=40N0" => "https://paste.rs/6Fd"
14:53:16FromDiscord<Generic> yeah I think the easiest thing would be to sort the deletion indices first
14:53:29FromDiscord<Generic> or to settle over to another data structure entirely
14:53:38FromDiscord<!Patitotective> In reply to @Generic "or to settle over": 🤨
14:53:53FromDiscord<Generic> the whole thing becomes pretty trivial on a hash table
14:54:34FromDiscord<!Patitotective> 🤔
14:54:46FromDiscord<Generic> thinking about it, it depends on where the indices came from
14:55:31FromDiscord<!Patitotective> i have a sequence of notes (title and text), you can select the notes to move them to trash
14:55:56FromDiscord<Generic> ah ok, then that's not possible
14:56:26FromDiscord<Generic> I'd then sort the deletion indices and then do something like
14:57:34*xet7_ quit (Quit: Leaving)
15:00:39FromDiscord<Generic> if you're more clever you can probably avoid creating a new sequence
15:00:40FromDiscord<Generic> sent a code paste, see https://paste.rs/nia
15:00:58*kayabaNerve quit (Remote host closed the connection)
15:01:18*kayabaNerve joined #nim
15:01:18FromDiscord<Generic> and move everything around inside the original list
15:02:02FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=40Nc" => "https://play.nim-lang.org/#ix=40Nb"
15:05:53FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Nd
15:05:58FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=40Nd" => "https://paste.rs/KyS"
15:05:58FromDiscord<Rika> why
15:06:01FromDiscord<Rika> whats this
15:06:14FromDiscord<!Patitotective> 🤨
15:06:25FromDiscord<!Patitotective> In reply to @Patitotective "if i have a": this
15:06:28FromDiscord<Rika> im readnig yes
15:07:03FromDiscord<Rika> im just thinking of better solns
15:07:28FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=40Ne
15:08:03FromDiscord<!Patitotective> In reply to @Generic "it lies within O(n^2)": huh, the app still runs at 60 FPS lamo
15:08:05FromDiscord<!Patitotective> (edit) "lamo" => "lmai"
15:08:06FromDiscord<!Patitotective> (edit) "lmai" => "lmao"
15:08:44FromDiscord<Generic> atm
15:09:27FromDiscord<Rika> O(n^2) does not mean "slow", it means "will become slow"
15:09:51FromDiscord<Rika> the n roughly means "element count"
15:10:15FromDiscord<Rika> it just means the time will increase like the square of how many elements you have
15:10:42FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Nf
15:10:49FromDiscord<Rika> so if you have 2 notes it will be 4 times slower than if you had 1 note pretty much
15:10:52FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=40Nh" => "https://play.nim-lang.org/#ix=40Ng"
15:11:16FromDiscord<!Patitotective> and whats your solution rika
15:11:20FromDiscord<Rika> big o notation is only sensible in relative comparisons, it says nothing about the base time
15:11:22FromDiscord<Rika> i dont have one
15:11:55FromDiscord<enthus1ast> array access is very very fast
15:12:08FromDiscord<enthus1ast> hash access can be slower than one think
15:12:26FromDiscord<enthus1ast> because of cpu reasons
15:12:30FromDiscord<enthus1ast> like cache invalidation
15:12:44FromDiscord<Generic> I guess something like this to delete multiple indices from a seq would kind of fit in the standard library
15:12:50FromDiscord<Generic> in sequtils or algoritm
15:13:37FromDiscord<!Patitotective> i guess "PRs welcome"
15:14:10FromDiscord<Generic> I mean additions to the standard library are more strict than ever
15:14:16FromDiscord<Generic> I honestly don't dare to make a PR
15:17:22*ltriant joined #nim
15:18:13FromDiscord<Generic> also I just looked up a few other programming languages and none of them seems to have such a utilty
15:22:21*derpydoo joined #nim
15:23:51*ltriant quit (Ping timeout: 268 seconds)
16:19:35*ltriant joined #nim
16:27:42*ltriant quit (Ping timeout: 264 seconds)
16:47:19*\u joined #nim
16:47:53*meowray quit (Ping timeout: 248 seconds)
17:00:14FromDiscord<Not Saucx> okay so
17:00:22FromDiscord<Not Saucx> imma start my first NIM project here
17:02:24FromDiscord<Not Saucx> can I efficiently read a file w/o eating my memory how it does in python?
17:09:06FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NJ
17:09:18FromDiscord<enthus1ast> nim is not on path
17:11:02FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=40NK
17:11:09FromDiscord<Torbatti> (edit)
17:19:52FromDiscord<konsumlamm> it's called Nim btw, not NIM (it's no abbreviation)
17:21:12FromDiscord<demotomohiro> Add nim's bin directory to PATH environment variable.
17:22:07FromDiscord<Phil> The comparisons in a switch are a compile-time construct? Huh, I was not aware
17:25:08FromDiscord<demotomohiro> What is the comparisons in a switch?
17:26:25FromDiscord<Not Saucx> In reply to @enthus1ast "nim is not on": okay but what does this mean?
17:26:25FromDiscord<Not Saucx> Hint: [Link]↵Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)↵26669 lines; 0.470s; 31.621MiB peakmem; proj: d:\Code\Nim Project\main.nim; out: d:\Code\Nim Project\main.exe [SuccessX]↵Hint: "d:\Code\Nim Project\main.exe" [Exec]
17:26:36FromDiscord<Not Saucx> i have restarted computer pressed F6
17:26:38FromDiscord<Phil> In reply to @demotomohiro "What is the comparisons": Basically compare the value you're switching on with a runtime value, e.g. like here: https://play.nim-lang.org/#ix=40NN
17:26:38FromDiscord<Not Saucx> and nothing
17:26:55FromDiscord<Not Saucx> I dont see no exe
17:26:59FromDiscord<Phil> In reply to @Not Saucx "and nothing": What was your compilation command?
17:27:07FromDiscord<Not Saucx> nim c -r "d:\Code\Nim Project\main.nim"
17:27:10FromDiscord<Phil> Also typically you generate a binary, not necessary an .exe
17:27:10FromDiscord<Not Saucx> i believe
17:27:13FromDiscord<Not Saucx> i just pressed F6
17:27:16FromDiscord<Not Saucx> on vscode
17:27:34FromDiscord<Phil> you should have a file only called "main" (unless nim behaves different on windows and compiles .exe's instead ?)
17:27:41FromDiscord<Phil> As in, only main, no file endings
17:28:01FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989945002790649907/unknown.png
17:28:03FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=
17:28:03FromDiscord<Phil> And no idea what F6 does on vscode
17:28:26FromDiscord<Not Saucx> https://youtu.be/5tVIsDYPClA?t=420
17:28:42FromDiscord<Not Saucx> and it deletes itself
17:28:43FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NO
17:29:17FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989945321494814740/unknown.png
17:29:31FromDiscord<Phil> So first, TIL that nim attaches ".exe" to the file name of the compiled file on windows
17:29:35FromDiscord<Torbatti> uh your firewall
17:30:04FromDiscord<Not Saucx> how could I run it thru VScode w/o opening the EXE everytime?
17:30:10FromDiscord<Not Saucx> kinda like python or C#
17:30:12FromDiscord<Phil> In reply to @Not Saucx "I saw the executable": It "deleting itself" has a high chance of your antivirus program incorrectly recognizing every piece of compiled nim code as a virus
17:30:28FromDiscord<Phil> (edit) "In reply to @Not Saucx "I saw the executable": It "deleting itself" has a high chance of ... your" added "it being"
17:30:35FromDiscord<demotomohiro> In reply to @Isofruit "Basically compare the value": If you use runtime value for case-of statement, it is executed at runtime.
17:30:48FromDiscord<Phil> In reply to @demotomohiro "If you use runtime": Yeh but shouldn't that case statement compile then?
17:31:34FromDiscord<Not Saucx> okay now i can see EXE
17:31:37FromDiscord<Not Saucx> but i cant open it
17:31:56FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=
17:32:02FromDiscord<Torbatti> try this
17:32:04FromDiscord<Phil> On Linux that normally would be just triggering the binary via shell
17:32:10FromDiscord<Phil> Ah, same on windows with powershell?
17:32:33FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NP
17:32:40FromDiscord<Torbatti> it calls and execute the program
17:32:45FromDiscord<Not Saucx> idk its just weird idk why icant just see in terminal 😭
17:33:11FromDiscord<Torbatti> In reply to @Not Saucx "idk its just weird": you need to execute it in your terminal
17:33:36FromDiscord<Not Saucx> In reply to @Torbatti "you need to execute": there isnt like a debugging feature?
17:33:45FromDiscord<Not Saucx> like to run it
17:33:55FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989946483858112512/unknown.png
17:34:48FromDiscord<Phil> I mean, you can set your station up so you compile and execute on save
17:35:06FromDiscord<enthus1ast> usually f6 is bound to execute in build in terminal
17:35:10FromDiscord<Phil> the -r option runs immediately after execution, so you can continuously compile and recompile, checking that it works
17:35:27FromDiscord<Phil> (edit) "execution," => "compilation,"
17:35:39FromDiscord<Phil> (edit) "compile" => "recompile" | "recompile," => "rerun,"
17:37:05FromDiscord<Phil> Nim compiles pretty fast (dev compiles of my web-project only take like 20 seconds and that's spanning over a hundred files easily) so it works well that way
17:39:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=40NU
17:39:46FromDiscord<demotomohiro> In reply to @Isofruit "Yeh but shouldn't that": https://wandbox.org/permlink/GMePlCcJ1mtsYgp7↵You can use runtime value to case of statement but values for `of` must be compile time value.
17:40:09FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948055556071455/unknown.png
17:40:11FromDiscord<Phil> In reply to @demotomohiro "https://wandbox.org/permlink/GMePlCcJ1mtsYgp7 You c": Yeh, that's what I meant, I was surprised that the of-values had to be static
17:40:12FromDiscord<Not Saucx> this make no sense
17:40:35FromDiscord<Torbatti> so youre calling f out of scope
17:40:40FromDiscord<Torbatti> you cant do that
17:40:47FromDiscord<Torbatti> you need to put for in your main scope
17:41:04FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948286100197456/unknown.png
17:41:05FromDiscord<Not Saucx> ?
17:41:13FromDiscord<Torbatti> yup
17:41:21FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948358271569940/unknown.png
17:41:41FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=40NW
17:42:03FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=40NW" => "https://play.nim-lang.org/#ix=40NX"
17:42:19FromDiscord<Torbatti> In reply to @Not Saucx "": let me turn my pc on
17:43:33FromDiscord<Torbatti> In reply to @Not Saucx "": and you need to replace : with =
17:43:41FromDiscord<Torbatti> proc main()=
17:44:04FromDiscord<Not Saucx> oh okay now 1 problem left
17:44:05FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989949046137430046/unknown.png
17:44:19FromDiscord<Not Saucx> fixed it
17:44:32FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40NY
17:44:42FromDiscord<Phil> In reply to @Not Saucx "oh okay now 1": proc declarations end with `=`
17:44:49FromDiscord<Phil> As in `proc main() =`
17:44:52FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=40NZ
17:45:11FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989949323087314944/unknown.png
17:45:13FromDiscord<Not Saucx> nice
17:45:50FromDiscord<Torbatti> ez pz
17:45:50FromDiscord<Phil> That was only the first line, right?
17:45:59FromDiscord<Not Saucx> first ever Nim program
17:45:59FromDiscord<Not Saucx> 😩
17:46:04FromDiscord<Not Saucx> now i gotta write to file
17:46:09FromDiscord<Not Saucx> this will get even harder
17:46:27FromDiscord<Torbatti> its one of the easier programming languages ive ever used
17:46:32FromDiscord<Phil> Eh, it's fine, have you taken a look at `std/io` ?
17:46:42FromDiscord<Not Saucx> In reply to @Isofruit "Eh, it's fine, have": not yet
17:46:46FromDiscord<Not Saucx> i wanna write to file
17:46:47FromDiscord<Torbatti> https://nim-lang.org/docs/io.html#open%2CFile%2CFileHandle%2CFileMode
17:46:48FromDiscord<Phil> There's a proc in there that'll do the job for you
17:46:57FromDiscord<Torbatti> (edit) "https://nim-lang.org/docs/io.html#open%2CFile%2CFileHandle%2CFileMode" => "https://nim-lang.org/docs/io.html"
17:47:20FromDiscord<Phil> It's also really nicely named, so should be easy to find 😉
17:47:25FromDiscord<Not Saucx> In reply to @Not Saucx "i wanna write to": where it would look at the first letter and makes a new file of all lines containing that first letter
17:47:49FromDiscord<Not Saucx> so anything starting with A would be in a seperate file than "B", etc, and same goes for number
17:48:15FromDiscord<Not Saucx> so 1 files would just be a file full of lines that start with A
17:48:25FromDiscord<Not Saucx> (edit) "A" => "A, then B, then C"
17:48:30FromDiscord<Not Saucx> (edit) "C" => "C, etc..."
17:48:43FromDiscord<Phil> Sure enough, are you familiar with hashmaps/tables/dictionaries (all words for the same concept) ?
17:49:00FromDiscord<Not Saucx> In reply to @Isofruit "Sure enough, are you": yeah im pretty familiar
17:53:50*ltriant joined #nim
17:53:54FromDiscord<Phil> sent a long message, see http://ix.io/40O5
17:54:18FromDiscord<Phil> (edit) "http://ix.io/40O5" => "http://ix.io/40O6"
17:54:37FromDiscord<Phil> There is procs for the stuff I mentioned in the std/io lib.↵It's not really big, so all of those are not that hard to find 😉
17:55:12FromDiscord<Not Saucx> In reply to @Isofruit "There is procs for": can we hop in general1?
17:55:15FromDiscord<Not Saucx> and u can guide me
17:55:18FromDiscord<Not Saucx> 😭
17:56:14FromDiscord<Phil> Given that I'm eating dinner and watching a series on the side while adjusting some config files, not quite 😄 ↵However! You want to learn the language and me essentially telling you what to code isn't quite going to help with learning.↵Try to get there one by one, once you encounter an issue, post it here, I'll throw responses in
17:56:39FromDiscord<enthus1ast> sure this is one option @Phil
17:56:48FromDiscord<Phil> Try to first encounter the problem so that you know that it's there, then take a bit to think on what you need to solve it.
17:56:50FromDiscord<enthus1ast> and might work for smaller files
17:57:09FromDiscord<Phil> In reply to @enthus1ast "sure this is one": Yeh, it's the first naive implementation, I think we're starting small here to start off ^^
17:58:13FromDiscord<enthus1ast> another option would be to just open a few filehandles (a-Z 0-9) etc, loop through the file with lines, get the first char and write the line to the file
17:58:20FromDiscord<enthus1ast> this way you do never store the whole file in mem
17:58:40FromDiscord<Not Saucx> In reply to @enthus1ast "this way you do": yes im writing it nim and not python cause of memory 😭
17:58:51FromDiscord<enthus1ast> how large is the file?
17:58:53FromDiscord<Phil> Is the file size measured in GB?
17:58:56FromDiscord<Not Saucx> 300GB
17:59:00FromDiscord<enthus1ast> ;)
17:59:03FromDiscord<Phil> Yeah never mind my approach will murder your PC
17:59:06FromDiscord<Not Saucx> lol
17:59:15*ltriant quit (Ping timeout: 268 seconds)
17:59:20FromDiscord<Not Saucx> (edit) "300GB ... " added "(smaller one)"
17:59:22FromDiscord<enthus1ast> use the approach with lines then
17:59:24FromDiscord<Phil> I was thinking something below 50mb or so
18:00:00FromDiscord<Phil> So first things first, take a look at std/io, which procs in there look helpful to you ?
18:00:06FromDiscord<Not Saucx> In reply to @Isofruit "So first things first,": alright
18:01:01FromDiscord<Phil> Erm, system/io, not std/io >_>
18:01:24FromDiscord<Not Saucx> fmWrite, readAll, and i think thats it?
18:01:25FromDiscord<Phil> Still the link posted above, I just fucked up that it's a core lib, not a standard lib one
18:02:11FromDiscord<Phil> readAll would read first read the entire file into your memory, unless you've got 300GB of RAM that would murder your PC I think ^^
18:02:18FromDiscord<Not Saucx> In reply to @Isofruit "readAll would read first": hmmmm
18:02:31FromDiscord<enthus1ast> are the hashes case sensitive?
18:02:32FromDiscord<Phil> Anything else looking promising to you in that regard?
18:02:38FromDiscord<Phil> In reply to @enthus1ast "are the hashes case": Should be, one sec
18:02:41FromDiscord<enthus1ast> so is 'a' or 'A' important?
18:02:49FromDiscord<Phil> Oh, you mean in the usecase
18:02:51FromDiscord<Not Saucx> In reply to @enthus1ast "so is 'a' or": no
18:02:56FromDiscord<enthus1ast> ok
18:03:00FromDiscord<Not Saucx> can be a,A in the samile
18:03:05FromDiscord<Not Saucx> (edit) "samile" => "same file"
18:03:24FromDiscord<Not Saucx> would readBuffer be good?
18:04:18FromDiscord<Phil> I was more trying to poke you towards readLine, which has the nice benefit of returning a boolean if you provide it with a var string to write the line into. That boolean tells you whether you reached the end of the file
18:04:28FromDiscord<Phil> So you can while loop with that proc through your file
18:04:58FromDiscord<Not Saucx> In reply to @Isofruit "I was more trying": oh okay, b/c readline in python would just eat memory for me
18:05:20FromDiscord<Not Saucx> also to figure out if something is equal would i put ``==``
18:05:20FromDiscord<Not Saucx> ?
18:05:29FromDiscord<Phil> Yeh
18:05:33FromDiscord<Not Saucx> so
18:05:36FromDiscord<Phil> !eval 5 == "5"
18:05:39NimBotCompile failed: /usercode/in.nim(1, 3) Error: type mismatch: got <int literal(5), string>
18:06:06FromDiscord<Phil> !eval 5 == 4
18:06:09NimBotCompile failed: /usercode/in.nim(1, 3) Error: expression 'false' is of type 'bool' and has to be used (or discarded)
18:06:22FromDiscord<Phil> I keep forgetting I need to echo this stuff
18:06:25FromDiscord<Phil> !eval echo 5 == 4
18:06:26NimBotCompile failed: Unable to open output log
18:06:36FromDiscord<Not Saucx> ?
18:06:38FromDiscord<Phil> Okay now this bot is just messing with me
18:06:40FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Ob
18:07:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=40Oc
18:07:23FromDiscord<Phil> so if line == ("a"):
18:07:30FromDiscord<Not Saucx> (edit) "https://play.nim-lang.org/#ix=40Ob" => "https://play.nim-lang.org/#ix=40Od"
18:07:31FromDiscord<Not Saucx> oopsie i forgot
18:07:32FromDiscord<Not Saucx> my fault
18:07:46FromDiscord<Torbatti> In reply to @NimBot "Compile failed: Unable to": kekew
18:07:58FromDiscord<enthus1ast> something like this ("untested")
18:08:09FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=40Oe
18:08:20FromDiscord<enthus1ast> would be faster if you preopen the files
18:08:35FromDiscord<enthus1ast> and the last two lines are maybe useless
18:08:49FromDiscord<Phil> In reply to @Not Saucx "oopsie i forgot": Second line == ("a") is going to be the same as `line == "a"`, which would mean you'd only get true if the line is the string "a"
18:09:12FromDiscord<Not Saucx> In reply to @Isofruit "Second line == ("a")": if the first letter of the line is "a"
18:09:58FromDiscord<Phil> To get that effect you'd need to extract the first character from your string or check if the string starts with "a"↵There is procs for this in std/strutils
18:10:14FromDiscord<Phil> https://nim-lang.org/docs/strutils.html
18:10:47FromDiscord<Phil> Or you can use enthus1ast's approach there, he grabs the first char via index on the string ` let first = line[0]`
18:11:54FromDiscord<!Patitotective> also `"a"` is of type string because it is double quoted↵with single quotes it is of type char `'a'`
18:12:11FromDiscord<!Patitotective> !eval let str = "abc"; assert str[0] == 'a'
18:12:15NimBot<no output>
18:12:41FromDiscord<Phil> no output in this case meaning the assert succeeded or otherwise the nimbot would've cried foul
18:25:58FromDiscord<Not Saucx> In reply to @Isofruit "no output in this": how would i open a file manager similar to easy gui of "fileopenbox"?
18:26:06*derpydoo quit (Quit: derpydoo)
18:27:15FromDiscord<Phil> When it comes to gui I'm pretty much out. What you want is a filepicker to visually select a file right?
18:27:21FromDiscord<Not Saucx> In reply to @Isofruit "When it comes to": mhm
18:27:31FromDiscord<enthus1ast> when on windows
18:27:39FromDiscord<Phil> I'd need to ask/scower the web for that myself. Maybe there's a lib for it?
18:27:42FromDiscord<enthus1ast> you could drag and drop the source file on to the exe
18:27:58FromDiscord<enthus1ast> then the path will be in the arguments
18:28:07FromDiscord<Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989960128386187315/unknown.png
18:28:11FromDiscord<Not Saucx> so i would leave this empty?
18:29:07FromDiscord<Phil> Nah you'd extract "kittens.txt" from a commandline argument passed to your binary, throw it into a variable and throw the variable in there
18:29:20FromDiscord<enthus1ast> this would then be paramStr(1)
18:30:25FromDiscord<Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=
18:30:30*cyraxjoe quit (Quit: I'm out!)
18:30:42FromDiscord<Torbatti> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=40Ok"
18:30:47FromDiscord<Torbatti> (edit) "https://play.nim-lang.org/#ix=40Ok" => "https://play.nim-lang.org/#ix=40Ol"
18:31:34FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Om
18:31:37FromDiscord<enthus1ast> os
18:31:39FromDiscord<Torbatti> import strformat
18:31:53FromDiscord<Torbatti> + os
18:31:56FromDiscord<enthus1ast> (i do not see the stuff you forwared lol)
18:32:10FromDiscord<enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/989961142753439774/image.png
18:32:12FromDiscord<enthus1ast> strange
18:32:28FromDiscord<enthus1ast> maybe an issue with the bridge
18:32:29FromDiscord<Torbatti> In reply to @enthus1ast "strange": kekew
18:32:29FromDiscord<Not Saucx> bbot?
18:33:45FromDiscord<Not Saucx> okay s
18:33:46FromDiscord<Not Saucx> so
18:33:46FromDiscord<Not Saucx> https://nim-lang.org/docs/strscans.html
18:33:49FromDiscord<Not Saucx> imma read this
18:34:04FromDiscord<Not Saucx> and lets say i want to read the first character after the second comma
18:34:20FromDiscord<enthus1ast> i can just recommend parseutils
18:34:55FromDiscord<enthus1ast> but you could also just do line.find(",", 1)
18:35:08FromDiscord<enthus1ast> (the one stops after the first comma)
18:35:20FromDiscord<enthus1ast> or 2 in your case
18:35:39*cyraxjoe joined #nim
18:36:00FromDiscord<enthus1ast> but strscans will also work i guess
18:36:49FromDiscord<Not Saucx> so if if the file i wanted to look at was structred like this
18:37:04FromDiscord<Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Op
18:37:14FromDiscord<Torbatti> its the 2nd one then
18:37:15FromDiscord<enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/989961836164157501): ~~but you could also just do line.find(",", 1)~~ (no it does not, ignore this ;))
18:37:41FromDiscord<enthus1ast> is this a csv?
18:37:55FromDiscord<Not Saucx> The whole line would be in seperate files according to their first char after the second comma
18:39:41FromDiscord<enthus1ast> if this is a csv you could also use https://nim-lang.org/docs/parsecsv.html
18:40:34*cyraxjoe quit (Ping timeout: 268 seconds)
18:40:48*cyraxjoe joined #nim
18:43:28FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=40Ow
18:43:41FromDiscord<enthus1ast> assuming all files are good, no error checking ;)
18:58:49FromDiscord<Phil> I have returned
18:59:20FromDiscord<ambient> does there exist a library for saving and restoring program environments between different processes that might be run in different times. transferring them through something like TCP/IP. marshalling them into binary data, or at worst; JSON?
18:59:38FromDiscord<ambient> basically i would like to have client/server for Nim environments
18:59:50FromDiscord<enthus1ast> @ambient\: sounds fancy
18:59:54FromDiscord<Phil> blinks↵... I don't think I've ever heard of the specific usecase of transferring virtual environments
19:00:13FromDiscord<ambient> by environment i mean the global namespace inside a Nim program
19:00:21FromDiscord<enthus1ast> i think you will run into lots of trouble, like file descriptors etc
19:00:27FromDiscord<ambient> and all the data, either with copy or shared memory
19:00:41FromDiscord<ambient> well i'm not going to handle all data, just most
19:00:53FromDiscord<ambient> i would be fine with mostly tensors etc
19:01:16FromDiscord<Phil> I believe I'll have to admit defeat there, this is already way more advanced than anything I've dealt with from the description alone.↵I'm not even sure if you can programmatically grab everything in a given nim namespace, let alone transfer it
19:01:57FromDiscord<enthus1ast> i think it will be much easier to just choose what you want, serialize and send it
19:02:17FromDiscord<enthus1ast> could be very much streamlined with some pragmas so that you do not have to write that much code
19:02:20NimEventerNew thread by Cmc: Init procedure naming convention for non-GC memory, see https://forum.nim-lang.org/t/9263
19:03:18FromDiscord<enthus1ast> custom pragmas such as `var mystuff: MyDataType {.ThisMustBeTransfered.}`
19:04:26FromDiscord<!Patitotective> In reply to @Not Saucx "how would i open": https://github.com/Patitotective/tinydialogs ;]
19:04:59FromDiscord<ambient> the end purpose is a jupyter notebook type of thing, but without having to actually use jupyter. just write small independent programs that have specified input and ouput, using a server on the background to serve the data
19:05:52FromDiscord<Phil> What was the "closer to an actual REPL than inim" thing? nimsecret or something?
19:07:22FromDiscord<ambient> the win here would also possibly easier convert to a functional command line tool or part of a program, depending on how the library is written
19:19:19FromDiscord<Schelz> how do I create a file on a certain folder, I tried to search it up but i couldnt create smth useful
19:19:37FromDiscord<Schelz> can someone snipe me some code ? pls
19:25:36*cyraxjoe quit (Quit: I'm out!)
19:26:56FromDiscord<demotomohiro> You can just do `open("/home/foo/myfolder/myfile.nim")`.
19:28:02*cyraxjoe joined #nim
19:33:11FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40OO
19:42:17FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OR
19:43:17FromDiscord<!Patitotective> In reply to @demotomohiro "https://play.nim-lang.org/#ix=40ON This one doesn't": 👀
19:43:21FromDiscord<!Patitotective> thanks
19:45:58FromDiscord<!Patitotective> In reply to @demotomohiro "https://play.nim-lang.org/#ix=40ON This one doesn't": making `delIndices` not var and using `sorted` wont affect time complexity
19:46:13FromDiscord<!Patitotective> (edit) "complexity" => "complexity, right?"
19:47:43FromDiscord<demotomohiro> In reply to @Patitotective "making `delIndices` not var": I think so.
19:48:40FromDiscord<golova> In reply to @ambient "well i'm not going": Just copy stack and .data lmao
19:49:10FromDiscord<golova> (edit) "In reply to @ambient "well i'm not going": Just copy stack and .data lmao ... " added "||Dont do this||"
19:50:26*cyraxjoe quit (Ping timeout: 246 seconds)
19:51:14*cyraxjoe joined #nim
19:54:41FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OV
19:55:31*ltriant joined #nim
19:56:20FromDiscord<enthus1ast> oh nice @!Patitotective
19:56:24FromDiscord<enthus1ast> clever \:)
19:56:44*Guest17 quit (Ping timeout: 252 seconds)
19:57:44FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OW
19:58:20FromDiscord<!Patitotective> In reply to @enthus1ast "oh nice <@762008715162419261>": ;]
20:00:18*ltriant quit (Ping timeout: 240 seconds)
20:07:30FromDiscord<demotomohiro> sent a long message, see http://ix.io/40P0
20:08:32FromDiscord<enthus1ast> another option is to create a new sequence
20:08:35FromDiscord<demotomohiro> `list.delete(i)` is O(n) where n is list.len.
20:10:07FromDiscord<demotomohiro> In reply to @Patitotective "isn't that identical to": @Generic code is also O(n).
20:10:07FromDiscord<d4rckh> Procs in nim can be called without parenthesis right?
20:10:23FromDiscord<d4rckh> But how does nim know if I'm supplying the value returned by the proc or the proc itself?
20:10:42FromDiscord<!Patitotective> In reply to @demotomohiro "<@249581140363575297> code is also": yea, now i understand
20:11:26FromDiscord<demotomohiro> In reply to @d4rckh "Procs in nim can": https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax
20:12:04FromDiscord<demotomohiro> When you call a proc without arguments, you needs parenthesis.
20:14:57FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40P2
20:15:30FromDiscord<ambient> in Rust in VScode, you can just press "test" button right next to the pertaining code. Is there something like that for Nim?
20:15:43FromDiscord<ambient> running tests just by clicking the test button next to the code
20:16:43FromDiscord<demotomohiro> In reply to @Patitotective "<@288750616510201856> isn't this code": If you don't need to preserving order and can use `del` instead of `delete`, that code can be O(n) where n is the number of elements to delete.
20:17:13FromDiscord<!Patitotective> i need to preserve the order :/
20:20:18FromDiscord<enthus1ast> just curious, if an elem is deleted from a seq, is the seq moved?
20:21:59FromDiscord<demotomohiro> In reply to @Patitotective "i just realized i": If you use @Generic's code or my `deleteIndices` proc, you can copy elements in deleteIndices to a new sequence and delete elements.
20:36:33FromDiscord<enthus1ast> yeah it is
20:43:22FromDiscord<Tuatarian> I imagine it should but I actually can't seem to confirm
20:43:40FromDiscord<Tuatarian> `let` allocates to stack and `var`to heap right??
20:46:01*euantorano quit (*.net *.split)
20:46:04*joshbaptiste1 quit (*.net *.split)
20:46:04*tk quit (*.net *.split)
20:46:04*redj quit (*.net *.split)
20:46:19FromDiscord<Elegantbeef> No
20:46:27FromDiscord<enthus1ast> i think it depends, new, ref and alloc allocates on the heap
20:46:28*tk joined #nim
20:46:28*joshbaptiste1 joined #nim
20:46:30*euantorano joined #nim
20:46:30FromDiscord<Elegantbeef> let/var do not control the memory allocation point
20:46:47*redj joined #nim
20:46:51FromDiscord<Elegantbeef> they are a type system component and not a runtime component
20:47:10FromDiscord<Elegantbeef> variables that allocate on the stack are `object` variables that are heap allocated are `ref object`
20:59:50FromDiscord<Andreas> In reply to @Elegantbeef "variables that allocate on": ic and what about `createShared` and `allocShared` ? Is that used to be explicit ?
21:00:55FromDiscord<Schelz> sent a code paste, see https://play.nim-lang.org/#ix=40Pe
21:02:06FromDiscord<Elegantbeef> Those are heap allocated yes↵(@Andreas)
21:02:20FromDiscord<Elegantbeef> I tend not to talk about the low level allocators as you should know! 😜
21:03:49FromDiscord<Andreas> In reply to @Elegantbeef "I tend not to": BTW: i'm looking for a 'type-preserving Pool-Allocator' - i've found a Heap-Allocator-Implementation on nimble - which is a bit older, but might work..
21:04:47FromDiscord<Elegantbeef> What's the api you're looking for?
21:07:29FromDiscord<Andreas> In reply to @Elegantbeef "What's the api you're": API, well i have small Cells 16-32-Bytes that i need to Heap-allocate/deallocate for some concurrent data-structures. so i need alloc/free and maybe smth like 'retire' = freed, but not immediatly reusable..
21:08:10FromDiscord<Andreas> (edit) "reusable.." => "reusable..↵I thought a growable-pool would be nice.."
21:08:40FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "What's the api you're": API, well i have small Cells 16-32-Bytes that i need to Heap-allocate/deallocate for some concurrent data-structures. so i need alloc/free and maybe smth like 'retire' = freed, but not immediatly reusable..↵I thought a growable-pool would be nice.. ... " added "maybe chainable-blocks, smth like that"
21:11:41FromDiscord<Elegantbeef> Though dont know what your requirement is
21:11:45FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/JPD
21:15:31FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Pg
21:15:33FromDiscord<Phil> Hmmm I'd been playing around with using the ` "--experimental:strictNotNil",` flag.↵Turns out I can't really use it as otherwise some of my libs blow up on me. Sad noises
21:15:43FromDiscord<Elegantbeef> You can use it iso
21:16:17FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40Ph
21:16:18FromDiscord<Phil> Yeh but I don't use that flag for the warnings, I'd want to go at it with "eradicate all the errors" and use `--warningAsError:strictNotNil` too
21:16:30FromDiscord<Elegantbeef> I cannot read
21:16:39FromDiscord<Elegantbeef> I read "strictFuncs"
21:17:02FromDiscord<Phil> Which reminds me I really fucking should rename my side-effect-less procs as funcs
21:17:27FromDiscord<Phil> But it's one of those "can I be bothered" type situations
21:18:06FromDiscord<Elegantbeef> Also i believe you can do `{.experimental: "strictNotNil".}` in the file you want to ensure there are no nils
21:18:31FromDiscord<Elegantbeef> And you can do `{.warningAsError[Proven].}` or w/e it is
21:20:24FromDiscord<Phil> Yeh, was more looking whether there was a very low effort sweeping improvement to be made on this. Annotating every time I call "fromJson" (as that is one of my common violations of "strictNotNil") is just way too much effort for too little gain.
21:20:29FromDiscord<Elegantbeef> Why does it return a seq but take a var seq?↵(@!Patitotective)
21:20:42FromDiscord<Elegantbeef> What?
21:22:36FromDiscord<Elegantbeef> Seems it doesnt work
21:22:39FromDiscord<Elegantbeef> Nevermind
21:31:23FromDiscord<!Patitotective> yea hehe↵parameters are a little wacky
21:57:06*ltriant joined #nim
22:00:58*xet7 quit (Ping timeout: 272 seconds)
22:01:13*noeontheend joined #nim
22:02:14*ltriant quit (Ping timeout: 272 seconds)
22:12:16*xet7 joined #nim
22:40:33*TakinOver joined #nim
22:49:06*xet7 quit (Ping timeout: 272 seconds)
23:01:29*xet7 joined #nim
23:07:13*xet7 quit (Quit: Leaving)
23:15:17*ltriant joined #nim
23:42:41*Network2501 joined #nim