00:19:13 | FromDiscord | <Zectbumo> @ElegantBeef what engine are you using for your game? |
00:24:23 | FromDiscord | <Elegantbeef> My own framework |
00:27:42 | * | wallabra quit (Ping timeout: 272 seconds) |
00:28:26 | FromDiscord | <retkid> :| |
00:28:46 | FromDiscord | <retkid> How can i change prologue from html to plaintext |
00:31:21 | FromDiscord | <retkid> got it :) |
00:39:18 | FromDiscord | <Elegantbeef> It's here but not documented or setup for easy reproducible builds https://github.com/beef331/truss3d 😄↵(@Zectbumo) |
00:48:04 | FromDiscord | <m4ul3r> Is it possible to convert a string to an sql string to an SqlPrepared type? |
00:48:16 | FromDiscord | <m4ul3r> (edit) removed "sql string to an" |
00:57:17 | FromDiscord | <ripluke> Does nimlsp support formating |
01:12:06 | FromDiscord | <ynfle> In reply to @m4ul3r "Is it possible to": `sql"PUT STRING HERE"` |
01:17:08 | FromDiscord | <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:04 | FromDiscord | <huantian> good because that's how you get sql-injectioned |
01:31:26 | FromDiscord | <huantian> look at the examples https://media.discordapp.net/attachments/371759389889003532/989704269756260383/unknown.png |
01:31:41 | FromDiscord | <huantian> in this case the first question mark is replaced by the value "Jack" |
01:34:00 | FromDiscord | <m4ul3r> yes, I'm trying to create something vulnerable |
01:44:10 | FromDiscord | <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:14 | FromDiscord | <exelotl> sent a code paste, see https://paste.rs/O5j |
01:46:49 | FromDiscord | <exelotl> tbh the `sql` template should only accept static strings, to prevent this :P |
01:47:16 | FromDiscord | <exelotl> it was probably made before static params were part of the language, I guess |
01:47:25 | * | wallabra joined #nim |
01:52:00 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=40L9 |
01:55:17 | FromDiscord | <ynfle> In reply to @m4ul3r "I'm trying to make": Don't do that!!!! That's a sql injection waiting to happen |
01:55:47 | FromDiscord | <huantian> it took me a few readings of the question but I think that's the point?? |
01:55:49 | FromDiscord | <ynfle> In reply to @huantian "look at the examples": See this picture @m4ul3r |
01:56:10 | FromDiscord | <ynfle> Oh nice |
01:56:12 | FromDiscord | <huantian> like they want to make it vulnerable as an example or something |
01:56:38 | FromDiscord | <ynfle> Well you can write you own `&` for the type but Wrapping is after is also possible |
02:38:31 | FromDiscord | <Prestige> @ripluke https://github.com/PMunch/nimlsp#supported-protocol-features nope |
02:39:11 | FromDiscord | <ripluke> Rip |
02:39:32 | FromDiscord | <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:43 | FromDiscord | <Prestige> good idea |
03:31:49 | NimEventer | New 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:55 | FromDiscord | <Prestige> @ripluke How did you configure nimpretty with neovim? |
05:28:13 | FromDiscord | <ripluke> Nulllsp |
05:28:39 | FromDiscord | <ripluke> https://github.com/jose-elias-alvarez/null-ls.nvim |
05:29:00 | FromDiscord | <ripluke> I can send you the Lua code that I used aswell |
05:29:16 | FromDiscord | <Prestige> eh all good |
05:53:07 | FromDiscord | <j-james> how can you configure imports to always be relative to the main `src/` directory? |
05:53:31 | FromDiscord | <Elegantbeef> You cant |
05:53:56 | FromDiscord | <Elegantbeef> You should be able to just import relative to your package regardless |
05:54:46 | FromDiscord | <Elegantbeef> For instance `import truss3D/[textures, shaders, inputs, models]` anywhere inside my `truss3D` path |
05:56:13 | FromDiscord | <j-james> ? weird |
05:56:13 | FromDiscord | <Elegantbeef> I should clarify i dont think you can i could be wrong |
05:56:32 | FromDiscord | <j-james> are you exporting modules in a `truss3D.nim` file? |
05:56:40 | FromDiscord | <Elegantbeef> No |
05:57:07 | FromDiscord | <Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/guicomponents/uielements.nim |
05:57:32 | FromDiscord | <Elegantbeef> You can import relative to your source package's source just by using the package name |
05:58:11 | FromDiscord | <ripluke> Does Nim have an argparsing library that allows both -a -v and -av as the same thing |
05:58:47 | FromDiscord | <ambient> seems that rule is ambiguous. can't you just add "-av" manually? |
05:59:24 | FromDiscord | <Elegantbeef> many utilities do `-` grouped as single flag optionals |
05:59:25 | FromDiscord | <ripluke> I can but it's not very easy to scale |
05:59:41 | FromDiscord | <Elegantbeef> I cant say if i know that any do best is just to try it |
05:59:51 | FromDiscord | <ripluke> In reply to @Elegantbeef "many utilities do `-`": I tried ↵https://github.com/iffy/nim-argparse |
05:59:58 | FromDiscord | <ripluke> Doesn't support it lol |
06:00:08 | FromDiscord | <offbeat-stuff (offbeat-stuff)> has anyone been able to compile nim to wasm with clang --target=wasm32 |
06:00:14 | FromDiscord | <offbeat-stuff (offbeat-stuff)> w/o emscripten |
06:00:27 | FromDiscord | <Elegantbeef> I've not tried it but i can give it a whirl |
06:00:37 | FromDiscord | <Elegantbeef> Would be nicer than emscripten 😄 |
06:01:14 | FromDiscord | <offbeat-stuff (offbeat-stuff)> https://dassur.ma/things/c-to-webassembly/ |
06:01:34 | FromDiscord | <offbeat-stuff (offbeat-stuff)> Here is where i saw it |
06:01:55 | FromDiscord | <offbeat-stuff (offbeat-stuff)> It shows a way with llvm and also with single command |
06:06:08 | FromDiscord | <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:14 | FromDiscord | <j-james> In reply to @Elegantbeef "https://github.com/beef331/truss3d/blob/master/src/": ah you have another truss3D folder i see |
06:06:20 | FromDiscord | <j-james> that's probably it |
06:07:40 | FromDiscord | <Elegantbeef> Yea |
06:18:17 | FromDiscord | <ripluke> i figured out how to have my computer not hate me for having discord open all day |
06:19:28 | FromDiscord | <ripluke> ripcord is very light |
06:21:27 | FromDiscord | <Rika> have fun with the broken webhooks then |
06:23:44 | madprops | lots of activity on nim this past month https://i.imgur.com/lACUOIR.jpg |
06:24:18 | madprops | there was another one i was looking for |
06:24:21 | madprops | that had nim in the name |
06:24:26 | FromDiscord | <ambient> man, would be nice to have an actual hyperlink instead of an image 😅 |
06:24:47 | madprops | https://hn.algolia.com/?dateRange=pastMonth&page=0&prefix=false&query=nim&sort=byPopularity&type=story |
06:25:04 | madprops | i think there are actually more results |
06:25:12 | madprops | but search uses \b |
06:32:08 | FromDiscord | <Prestige> Wow worm has a lot of stars |
06:32:15 | FromDiscord | <Prestige> I need to advertise more |
06:34:10 | FromDiscord | <Elegantbeef> Worm is offered as a default WM for endeveourOS iirc |
06:34:29 | FromDiscord | <Prestige> Wow that's pretty cool |
06:39:24 | FromDiscord | <j-james> i've seen https://uploads.peterme.net/nimsafe.html linked a lot |
06:39:56 | FromDiscord | <j-james> PMunch: have you thought about updating/expanding on it for arc/orc? |
06:44:42 | FromDiscord | <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:21 | FromDiscord | <🐒🧠br4n_d0n> How do use a string that contains a variable in the quit proc? |
06:54:32 | FromDiscord | <🐒🧠br4n_d0n> (edit) "How do ... use" added "I" |
06:55:13 | FromDiscord | <🐒🧠br4n_d0n> I have it formatted like you would with the echo proc |
06:56:01 | FromDiscord | <Elegantbeef> `strformat` or `strutils.%` |
07:05:15 | FromDiscord | <🐒🧠br4n_d0n> Hmm, is the ``Error: ...`` message being thrown from my system or nim when I use ``quit``? |
07:06:21 | FromDiscord | <Rika> we wouldnt know unless you could tell us the whole story |
07:07:21 | FromDiscord | <🐒🧠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:43 | FromDiscord | <Rika> the error message is |
07:09:52 | FromDiscord | <offbeat-stuff (offbeat-stuff)> send the error message |
07:11:00 | FromDiscord | <🐒🧠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:40 | FromDiscord | <offbeat-stuff (offbeat-stuff)> can you send the code of the quitProc |
07:14:45 | FromDiscord | <🐒🧠br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=40LC |
07:18:20 | FromDiscord | <🐒🧠br4n_d0n> I could always quit with a success response code to potentially suppress this additional method |
07:18:31 | FromDiscord | <🐒🧠br4n_d0n> (edit) "method" => "message" |
07:18:43 | FromDiscord | <🐒🧠br4n_d0n> (edit) "this" => "the" |
07:22:47 | FromDiscord | <Rika> In reply to @br4n_d0n "I think it might": is this the whole output |
07:23:09 | FromDiscord | <🐒🧠br4n_d0n> Yes |
07:23:23 | FromDiscord | <Rika> `quit &"Invalid syntax at {index}", QuitSuccess` |
07:23:24 | FromDiscord | <Rika> try |
07:23:33 | FromDiscord | <Rika> actually no |
07:23:42 | FromDiscord | <Rika> dont do that ofc, i forgot what the actuall issue was |
07:23:49 | FromDiscord | <Rika> are you running with `nim -r` or nimble |
07:23:57 | FromDiscord | <Rika> run the binary by itself |
07:24:09 | FromDiscord | <Rika> it will not have the extra error, which comes from nim |
07:24:13 | FromDiscord | <Rika> since its running the program |
07:24:38 | FromDiscord | <🐒🧠br4n_d0n> AH, I was using the run command |
07:24:42 | FromDiscord | <🐒🧠br4n_d0n> Good to know |
07:25:09 | FromDiscord | <🐒🧠br4n_d0n> That solved the issue |
07:25:11 | FromDiscord | <🐒🧠br4n_d0n> Thanks |
07:25:40 | FromDiscord | <Rika> i forgor 💀 |
07:44:19 | * | xet7 joined #nim |
08:10:28 | FromDiscord | <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:35 | FromDiscord | <ezquerra> I think the message is a bit confusing |
08:11:04 | FromDiscord | <ezquerra> Perhaps it could say `Error: external program returned a non 0 error code:` |
08:11:32 | FromDiscord | <ezquerra> Or maybe even make that a Warning rather than an error (unless nim c -r returns the error code too?) |
08:13:06 | FromDiscord | <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:18 | FromDiscord | <that_dude> One day it won't get flagged |
08:14:35 | FromDiscord | <Asbjørn F> Microsoft feels threatened, clearly |
08:14:49 | FromDiscord | <xflywind> Add an exclusion to Windows Security |
08:14:50 | FromDiscord | <that_dude> Tbh my solution was to disable the antivirus when installing it to get to to install properly |
08:15:05 | FromDiscord | <xflywind> https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26 |
08:15:09 | FromDiscord | <Asbjørn F> when I install choosenim it isn't an issue |
08:15:23 | FromDiscord | <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:20 | FromDiscord | <exelotl> Also I'm able to install via scoop without getting flagged |
10:46:11 | FromDiscord | <AmitSupremacy> installed ignoring the warning 🙂 |
10:58:21 | NimEventer | New 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:33 | FromDiscord | <Josef> How do you cast an integer to pointer to C function? |
11:45:03 | FromDiscord | <furtidev> Hi, does this work |
11:45:08 | FromDiscord | <furtidev> I suppose it does. |
11:49:29 | FromDiscord | <Rika> It does |
11:51:25 | FromDiscord | <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:11 | FromDiscord | <enthus1ast> Must define it with the appropriate calling convention etc |
12:03:20 | FromDiscord | <Josef> In reply to @enthus1ast "Must define it with": What do you mean? |
12:03:47 | FromDiscord | <enthus1ast> you must know how the c function is implemented |
12:04:07 | FromDiscord | <enthus1ast> so eg for stdcall use the {.stdcall.} macro |
12:05:42 | FromDiscord | <Josef> You mean, if the c function to std, I need to use `.stdcall`? |
12:05:47 | FromDiscord | <Josef> (edit) "`.stdcall`?" => "`stdcall`?" |
12:06:07 | FromDiscord | <Josef> (edit) "to" => "uses" |
12:06:24 | FromDiscord | <enthus1ast> i mean this\: https://en.wikipedia.org/wiki/Calling_convention |
12:07:48 | FromDiscord | <enthus1ast> usually its stdcall these days, but eg the ntdll.dll uses fastcall |
12:08:07 | FromDiscord | <enthus1ast> so you either know it, you guess it, or you look in a debugger |
12:08:29 | FromDiscord | <Josef> Nim itself uses stdcall by default? |
12:08:59 | FromDiscord | <enthus1ast> idk what nimcall is |
12:09:46 | FromDiscord | <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:01 | FromDiscord | <enthus1ast> https://nim-lang.org/docs/manual.html#types-procedural-type |
12:12:35 | * | Guest17 joined #nim |
12:29:57 | FromDiscord | <Zoom> [planetis](https://matrix.to/#/@planetis:matrix.org)\: why did you close your PRs to threading? |
13:17:33 | FromDiscord | <planetis> Seeing that this is going nowhere, I will keep maintaining my own repo |
13:18:54 | FromDiscord | <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:57 | FromDiscord | <gongongagaga> can i have a header file in nim or do i have to pack everything in 1 file |
13:25:06 | FromDiscord | <enthus1ast> you can import other modules |
13:25:26 | FromDiscord | <enthus1ast> you can also include oder nim code |
13:26:15 | FromDiscord | <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:17 | FromDiscord | <Forest> Heya, just wondering if it's possible to define a new compiler backend without modifying the source? |
14:09:27 | FromDiscord | <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:30 | FromDiscord | <Forest> Found it |
14:10:38 | FromDiscord | <gongongagaga> how can i define an anonymous enum in nim |
14:11:03 | FromDiscord | <gongongagaga> sent a code paste, see https://play.nim-lang.org/#ix=40ML |
14:11:13 | * | ltriant joined #nim |
14:13:45 | FromDiscord | <Generic> you can use indvidual consts |
14:14:12 | FromDiscord | <gongongagaga> yea but wouldnt making a pointer to the const allocate space |
14:14:14 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=40MN |
14:14:57 | FromDiscord | <Generic> no, consts which fit immediates are pretty much always inlined |
14:15:04 | FromDiscord | <gongongagaga> aight epic ty |
14:20:22 | FromDiscord | <gongongagaga> does applying a pragma to an object go after it or before the object |
14:20:46 | FromDiscord | <gongongagaga> for example should i do `PSR {.union.} = object` or `PSR = object {.union.}` |
14:21:10 | * | ltriant quit (Ping timeout: 272 seconds) |
14:23:53 | FromDiscord | <gongongagaga> sent a code paste, see https://paste.rs/zCF |
14:25:22 | NimEventer | New thread by Moigagoo: Writing a shared lib for Android, see https://forum.nim-lang.org/t/9262 |
14:30:11 | FromDiscord | <ynfle> In reply to @gongongagaga "how can i implement": Does it have to be anonymous? |
14:30:16 | FromDiscord | <gongongagaga> kind of yeah. |
14:30:18 | FromDiscord | <gongongagaga> (edit) "yeah." => "yeah" |
14:30:21 | FromDiscord | <ynfle> Y? |
14:31:00 | FromDiscord | <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:06 | FromDiscord | <gongongagaga> (edit) "anom" => "anon" |
14:32:10 | FromDiscord | <Rika> no nim does not have anonymous structs |
14:32:57 | FromDiscord | <ynfle> You can define the type in a header file and import it if you really want |
14:33:04 | FromDiscord | <Rika> or emit |
14:33:53 | FromDiscord | <gongongagaga> ok how would it be implemented without an anon struct |
14:35:35 | FromDiscord | <ynfle> Define a separate sruct |
14:35:42 | FromDiscord | <ynfle> ie. type |
14:37:05 | FromDiscord | <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:39 | FromDiscord | <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:12 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=40MU |
14:50:33 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40MZ |
14:50:43 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=40MZ" => "https://play.nim-lang.org/#ix=40N0" |
14:50:45 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=40N0" => "https://paste.rs/6Fd" |
14:53:16 | FromDiscord | <Generic> yeah I think the easiest thing would be to sort the deletion indices first |
14:53:29 | FromDiscord | <Generic> or to settle over to another data structure entirely |
14:53:38 | FromDiscord | <!Patitotective> In reply to @Generic "or to settle over": 🤨 |
14:53:53 | FromDiscord | <Generic> the whole thing becomes pretty trivial on a hash table |
14:54:34 | FromDiscord | <!Patitotective> 🤔 |
14:54:46 | FromDiscord | <Generic> thinking about it, it depends on where the indices came from |
14:55:31 | FromDiscord | <!Patitotective> i have a sequence of notes (title and text), you can select the notes to move them to trash |
14:55:56 | FromDiscord | <Generic> ah ok, then that's not possible |
14:56:26 | FromDiscord | <Generic> I'd then sort the deletion indices and then do something like |
14:57:34 | * | xet7_ quit (Quit: Leaving) |
15:00:39 | FromDiscord | <Generic> if you're more clever you can probably avoid creating a new sequence |
15:00:40 | FromDiscord | <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:18 | FromDiscord | <Generic> and move everything around inside the original list |
15:02:02 | FromDiscord | <Generic> (edit) "https://play.nim-lang.org/#ix=40Nc" => "https://play.nim-lang.org/#ix=40Nb" |
15:05:53 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Nd |
15:05:58 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=40Nd" => "https://paste.rs/KyS" |
15:05:58 | FromDiscord | <Rika> why |
15:06:01 | FromDiscord | <Rika> whats this |
15:06:14 | FromDiscord | <!Patitotective> 🤨 |
15:06:25 | FromDiscord | <!Patitotective> In reply to @Patitotective "if i have a": this |
15:06:28 | FromDiscord | <Rika> im readnig yes |
15:07:03 | FromDiscord | <Rika> im just thinking of better solns |
15:07:28 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=40Ne |
15:08:03 | FromDiscord | <!Patitotective> In reply to @Generic "it lies within O(n^2)": huh, the app still runs at 60 FPS lamo |
15:08:05 | FromDiscord | <!Patitotective> (edit) "lamo" => "lmai" |
15:08:06 | FromDiscord | <!Patitotective> (edit) "lmai" => "lmao" |
15:08:44 | FromDiscord | <Generic> atm |
15:09:27 | FromDiscord | <Rika> O(n^2) does not mean "slow", it means "will become slow" |
15:09:51 | FromDiscord | <Rika> the n roughly means "element count" |
15:10:15 | FromDiscord | <Rika> it just means the time will increase like the square of how many elements you have |
15:10:42 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Nf |
15:10:49 | FromDiscord | <Rika> so if you have 2 notes it will be 4 times slower than if you had 1 note pretty much |
15:10:52 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=40Nh" => "https://play.nim-lang.org/#ix=40Ng" |
15:11:16 | FromDiscord | <!Patitotective> and whats your solution rika |
15:11:20 | FromDiscord | <Rika> big o notation is only sensible in relative comparisons, it says nothing about the base time |
15:11:22 | FromDiscord | <Rika> i dont have one |
15:11:55 | FromDiscord | <enthus1ast> array access is very very fast |
15:12:08 | FromDiscord | <enthus1ast> hash access can be slower than one think |
15:12:26 | FromDiscord | <enthus1ast> because of cpu reasons |
15:12:30 | FromDiscord | <enthus1ast> like cache invalidation |
15:12:44 | FromDiscord | <Generic> I guess something like this to delete multiple indices from a seq would kind of fit in the standard library |
15:12:50 | FromDiscord | <Generic> in sequtils or algoritm |
15:13:37 | FromDiscord | <!Patitotective> i guess "PRs welcome" |
15:14:10 | FromDiscord | <Generic> I mean additions to the standard library are more strict than ever |
15:14:16 | FromDiscord | <Generic> I honestly don't dare to make a PR |
15:17:22 | * | ltriant joined #nim |
15:18:13 | FromDiscord | <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:14 | FromDiscord | <Not Saucx> okay so |
17:00:22 | FromDiscord | <Not Saucx> imma start my first NIM project here |
17:02:24 | FromDiscord | <Not Saucx> can I efficiently read a file w/o eating my memory how it does in python? |
17:09:06 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NJ |
17:09:18 | FromDiscord | <enthus1ast> nim is not on path |
17:11:02 | FromDiscord | <Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=40NK |
17:11:09 | FromDiscord | <Torbatti> (edit) |
17:19:52 | FromDiscord | <konsumlamm> it's called Nim btw, not NIM (it's no abbreviation) |
17:21:12 | FromDiscord | <demotomohiro> Add nim's bin directory to PATH environment variable. |
17:22:07 | FromDiscord | <Phil> The comparisons in a switch are a compile-time construct? Huh, I was not aware |
17:25:08 | FromDiscord | <demotomohiro> What is the comparisons in a switch? |
17:26:25 | FromDiscord | <Not Saucx> In reply to @enthus1ast "nim is not on": okay but what does this mean? |
17:26:25 | FromDiscord | <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:36 | FromDiscord | <Not Saucx> i have restarted computer pressed F6 |
17:26:38 | FromDiscord | <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:38 | FromDiscord | <Not Saucx> and nothing |
17:26:55 | FromDiscord | <Not Saucx> I dont see no exe |
17:26:59 | FromDiscord | <Phil> In reply to @Not Saucx "and nothing": What was your compilation command? |
17:27:07 | FromDiscord | <Not Saucx> nim c -r "d:\Code\Nim Project\main.nim" |
17:27:10 | FromDiscord | <Phil> Also typically you generate a binary, not necessary an .exe |
17:27:10 | FromDiscord | <Not Saucx> i believe |
17:27:13 | FromDiscord | <Not Saucx> i just pressed F6 |
17:27:16 | FromDiscord | <Not Saucx> on vscode |
17:27:34 | FromDiscord | <Phil> you should have a file only called "main" (unless nim behaves different on windows and compiles .exe's instead ?) |
17:27:41 | FromDiscord | <Phil> As in, only main, no file endings |
17:28:01 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989945002790649907/unknown.png |
17:28:03 | FromDiscord | <Torbatti> sent a code paste, see https://play.nim-lang.org/#ix= |
17:28:03 | FromDiscord | <Phil> And no idea what F6 does on vscode |
17:28:26 | FromDiscord | <Not Saucx> https://youtu.be/5tVIsDYPClA?t=420 |
17:28:42 | FromDiscord | <Not Saucx> and it deletes itself |
17:28:43 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NO |
17:29:17 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989945321494814740/unknown.png |
17:29:31 | FromDiscord | <Phil> So first, TIL that nim attaches ".exe" to the file name of the compiled file on windows |
17:29:35 | FromDiscord | <Torbatti> uh your firewall |
17:30:04 | FromDiscord | <Not Saucx> how could I run it thru VScode w/o opening the EXE everytime? |
17:30:10 | FromDiscord | <Not Saucx> kinda like python or C# |
17:30:12 | FromDiscord | <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:28 | FromDiscord | <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:35 | FromDiscord | <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:48 | FromDiscord | <Phil> In reply to @demotomohiro "If you use runtime": Yeh but shouldn't that case statement compile then? |
17:31:34 | FromDiscord | <Not Saucx> okay now i can see EXE |
17:31:37 | FromDiscord | <Not Saucx> but i cant open it |
17:31:56 | FromDiscord | <Torbatti> sent a code paste, see https://play.nim-lang.org/#ix= |
17:32:02 | FromDiscord | <Torbatti> try this |
17:32:04 | FromDiscord | <Phil> On Linux that normally would be just triggering the binary via shell |
17:32:10 | FromDiscord | <Phil> Ah, same on windows with powershell? |
17:32:33 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40NP |
17:32:40 | FromDiscord | <Torbatti> it calls and execute the program |
17:32:45 | FromDiscord | <Not Saucx> idk its just weird idk why icant just see in terminal 😭 |
17:33:11 | FromDiscord | <Torbatti> In reply to @Not Saucx "idk its just weird": you need to execute it in your terminal |
17:33:36 | FromDiscord | <Not Saucx> In reply to @Torbatti "you need to execute": there isnt like a debugging feature? |
17:33:45 | FromDiscord | <Not Saucx> like to run it |
17:33:55 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989946483858112512/unknown.png |
17:34:48 | FromDiscord | <Phil> I mean, you can set your station up so you compile and execute on save |
17:35:06 | FromDiscord | <enthus1ast> usually f6 is bound to execute in build in terminal |
17:35:10 | FromDiscord | <Phil> the -r option runs immediately after execution, so you can continuously compile and recompile, checking that it works |
17:35:27 | FromDiscord | <Phil> (edit) "execution," => "compilation," |
17:35:39 | FromDiscord | <Phil> (edit) "compile" => "recompile" | "recompile," => "rerun," |
17:37:05 | FromDiscord | <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:43 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40NU |
17:39:46 | FromDiscord | <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:09 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948055556071455/unknown.png |
17:40:11 | FromDiscord | <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:12 | FromDiscord | <Not Saucx> this make no sense |
17:40:35 | FromDiscord | <Torbatti> so youre calling f out of scope |
17:40:40 | FromDiscord | <Torbatti> you cant do that |
17:40:47 | FromDiscord | <Torbatti> you need to put for in your main scope |
17:41:04 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948286100197456/unknown.png |
17:41:05 | FromDiscord | <Not Saucx> ? |
17:41:13 | FromDiscord | <Torbatti> yup |
17:41:21 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989948358271569940/unknown.png |
17:41:41 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40NW |
17:42:03 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=40NW" => "https://play.nim-lang.org/#ix=40NX" |
17:42:19 | FromDiscord | <Torbatti> In reply to @Not Saucx "": let me turn my pc on |
17:43:33 | FromDiscord | <Torbatti> In reply to @Not Saucx "": and you need to replace : with = |
17:43:41 | FromDiscord | <Torbatti> proc main()= |
17:44:04 | FromDiscord | <Not Saucx> oh okay now 1 problem left |
17:44:05 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989949046137430046/unknown.png |
17:44:19 | FromDiscord | <Not Saucx> fixed it |
17:44:32 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40NY |
17:44:42 | FromDiscord | <Phil> In reply to @Not Saucx "oh okay now 1": proc declarations end with `=` |
17:44:49 | FromDiscord | <Phil> As in `proc main() =` |
17:44:52 | FromDiscord | <Torbatti> sent a code paste, see https://play.nim-lang.org/#ix=40NZ |
17:45:11 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989949323087314944/unknown.png |
17:45:13 | FromDiscord | <Not Saucx> nice |
17:45:50 | FromDiscord | <Torbatti> ez pz |
17:45:50 | FromDiscord | <Phil> That was only the first line, right? |
17:45:59 | FromDiscord | <Not Saucx> first ever Nim program |
17:45:59 | FromDiscord | <Not Saucx> 😩 |
17:46:04 | FromDiscord | <Not Saucx> now i gotta write to file |
17:46:09 | FromDiscord | <Not Saucx> this will get even harder |
17:46:27 | FromDiscord | <Torbatti> its one of the easier programming languages ive ever used |
17:46:32 | FromDiscord | <Phil> Eh, it's fine, have you taken a look at `std/io` ? |
17:46:42 | FromDiscord | <Not Saucx> In reply to @Isofruit "Eh, it's fine, have": not yet |
17:46:46 | FromDiscord | <Not Saucx> i wanna write to file |
17:46:47 | FromDiscord | <Torbatti> https://nim-lang.org/docs/io.html#open%2CFile%2CFileHandle%2CFileMode |
17:46:48 | FromDiscord | <Phil> There's a proc in there that'll do the job for you |
17:46:57 | FromDiscord | <Torbatti> (edit) "https://nim-lang.org/docs/io.html#open%2CFile%2CFileHandle%2CFileMode" => "https://nim-lang.org/docs/io.html" |
17:47:20 | FromDiscord | <Phil> It's also really nicely named, so should be easy to find 😉 |
17:47:25 | FromDiscord | <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:49 | FromDiscord | <Not Saucx> so anything starting with A would be in a seperate file than "B", etc, and same goes for number |
17:48:15 | FromDiscord | <Not Saucx> so 1 files would just be a file full of lines that start with A |
17:48:25 | FromDiscord | <Not Saucx> (edit) "A" => "A, then B, then C" |
17:48:30 | FromDiscord | <Not Saucx> (edit) "C" => "C, etc..." |
17:48:43 | FromDiscord | <Phil> Sure enough, are you familiar with hashmaps/tables/dictionaries (all words for the same concept) ? |
17:49:00 | FromDiscord | <Not Saucx> In reply to @Isofruit "Sure enough, are you": yeah im pretty familiar |
17:53:50 | * | ltriant joined #nim |
17:53:54 | FromDiscord | <Phil> sent a long message, see http://ix.io/40O5 |
17:54:18 | FromDiscord | <Phil> (edit) "http://ix.io/40O5" => "http://ix.io/40O6" |
17:54:37 | FromDiscord | <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:12 | FromDiscord | <Not Saucx> In reply to @Isofruit "There is procs for": can we hop in general1? |
17:55:15 | FromDiscord | <Not Saucx> and u can guide me |
17:55:18 | FromDiscord | <Not Saucx> 😭 |
17:56:14 | FromDiscord | <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:39 | FromDiscord | <enthus1ast> sure this is one option @Phil |
17:56:48 | FromDiscord | <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:50 | FromDiscord | <enthus1ast> and might work for smaller files |
17:57:09 | FromDiscord | <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:13 | FromDiscord | <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:20 | FromDiscord | <enthus1ast> this way you do never store the whole file in mem |
17:58:40 | FromDiscord | <Not Saucx> In reply to @enthus1ast "this way you do": yes im writing it nim and not python cause of memory 😭 |
17:58:51 | FromDiscord | <enthus1ast> how large is the file? |
17:58:53 | FromDiscord | <Phil> Is the file size measured in GB? |
17:58:56 | FromDiscord | <Not Saucx> 300GB |
17:59:00 | FromDiscord | <enthus1ast> ;) |
17:59:03 | FromDiscord | <Phil> Yeah never mind my approach will murder your PC |
17:59:06 | FromDiscord | <Not Saucx> lol |
17:59:15 | * | ltriant quit (Ping timeout: 268 seconds) |
17:59:20 | FromDiscord | <Not Saucx> (edit) "300GB ... " added "(smaller one)" |
17:59:22 | FromDiscord | <enthus1ast> use the approach with lines then |
17:59:24 | FromDiscord | <Phil> I was thinking something below 50mb or so |
18:00:00 | FromDiscord | <Phil> So first things first, take a look at std/io, which procs in there look helpful to you ? |
18:00:06 | FromDiscord | <Not Saucx> In reply to @Isofruit "So first things first,": alright |
18:01:01 | FromDiscord | <Phil> Erm, system/io, not std/io >_> |
18:01:24 | FromDiscord | <Not Saucx> fmWrite, readAll, and i think thats it? |
18:01:25 | FromDiscord | <Phil> Still the link posted above, I just fucked up that it's a core lib, not a standard lib one |
18:02:11 | FromDiscord | <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:18 | FromDiscord | <Not Saucx> In reply to @Isofruit "readAll would read first": hmmmm |
18:02:31 | FromDiscord | <enthus1ast> are the hashes case sensitive? |
18:02:32 | FromDiscord | <Phil> Anything else looking promising to you in that regard? |
18:02:38 | FromDiscord | <Phil> In reply to @enthus1ast "are the hashes case": Should be, one sec |
18:02:41 | FromDiscord | <enthus1ast> so is 'a' or 'A' important? |
18:02:49 | FromDiscord | <Phil> Oh, you mean in the usecase |
18:02:51 | FromDiscord | <Not Saucx> In reply to @enthus1ast "so is 'a' or": no |
18:02:56 | FromDiscord | <enthus1ast> ok |
18:03:00 | FromDiscord | <Not Saucx> can be a,A in the samile |
18:03:05 | FromDiscord | <Not Saucx> (edit) "samile" => "same file" |
18:03:24 | FromDiscord | <Not Saucx> would readBuffer be good? |
18:04:18 | FromDiscord | <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:28 | FromDiscord | <Phil> So you can while loop with that proc through your file |
18:04:58 | FromDiscord | <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:20 | FromDiscord | <Not Saucx> also to figure out if something is equal would i put ``==`` |
18:05:20 | FromDiscord | <Not Saucx> ? |
18:05:29 | FromDiscord | <Phil> Yeh |
18:05:33 | FromDiscord | <Not Saucx> so |
18:05:36 | FromDiscord | <Phil> !eval 5 == "5" |
18:05:39 | NimBot | Compile failed: /usercode/in.nim(1, 3) Error: type mismatch: got <int literal(5), string> |
18:06:06 | FromDiscord | <Phil> !eval 5 == 4 |
18:06:09 | NimBot | Compile failed: /usercode/in.nim(1, 3) Error: expression 'false' is of type 'bool' and has to be used (or discarded) |
18:06:22 | FromDiscord | <Phil> I keep forgetting I need to echo this stuff |
18:06:25 | FromDiscord | <Phil> !eval echo 5 == 4 |
18:06:26 | NimBot | Compile failed: Unable to open output log |
18:06:36 | FromDiscord | <Not Saucx> ? |
18:06:38 | FromDiscord | <Phil> Okay now this bot is just messing with me |
18:06:40 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Ob |
18:07:19 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=40Oc |
18:07:23 | FromDiscord | <Phil> so if line == ("a"): |
18:07:30 | FromDiscord | <Not Saucx> (edit) "https://play.nim-lang.org/#ix=40Ob" => "https://play.nim-lang.org/#ix=40Od" |
18:07:31 | FromDiscord | <Not Saucx> oopsie i forgot |
18:07:32 | FromDiscord | <Not Saucx> my fault |
18:07:46 | FromDiscord | <Torbatti> In reply to @NimBot "Compile failed: Unable to": kekew |
18:07:58 | FromDiscord | <enthus1ast> something like this ("untested") |
18:08:09 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=40Oe |
18:08:20 | FromDiscord | <enthus1ast> would be faster if you preopen the files |
18:08:35 | FromDiscord | <enthus1ast> and the last two lines are maybe useless |
18:08:49 | FromDiscord | <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:12 | FromDiscord | <Not Saucx> In reply to @Isofruit "Second line == ("a")": if the first letter of the line is "a" |
18:09:58 | FromDiscord | <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:14 | FromDiscord | <Phil> https://nim-lang.org/docs/strutils.html |
18:10:47 | FromDiscord | <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:54 | FromDiscord | <!Patitotective> also `"a"` is of type string because it is double quoted↵with single quotes it is of type char `'a'` |
18:12:11 | FromDiscord | <!Patitotective> !eval let str = "abc"; assert str[0] == 'a' |
18:12:15 | NimBot | <no output> |
18:12:41 | FromDiscord | <Phil> no output in this case meaning the assert succeeded or otherwise the nimbot would've cried foul |
18:25:58 | FromDiscord | <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:15 | FromDiscord | <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:21 | FromDiscord | <Not Saucx> In reply to @Isofruit "When it comes to": mhm |
18:27:31 | FromDiscord | <enthus1ast> when on windows |
18:27:39 | FromDiscord | <Phil> I'd need to ask/scower the web for that myself. Maybe there's a lib for it? |
18:27:42 | FromDiscord | <enthus1ast> you could drag and drop the source file on to the exe |
18:27:58 | FromDiscord | <enthus1ast> then the path will be in the arguments |
18:28:07 | FromDiscord | <Not Saucx> https://media.discordapp.net/attachments/371759389889003532/989960128386187315/unknown.png |
18:28:11 | FromDiscord | <Not Saucx> so i would leave this empty? |
18:29:07 | FromDiscord | <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:20 | FromDiscord | <enthus1ast> this would then be paramStr(1) |
18:30:25 | FromDiscord | <Torbatti> sent a code paste, see https://play.nim-lang.org/#ix= |
18:30:30 | * | cyraxjoe quit (Quit: I'm out!) |
18:30:42 | FromDiscord | <Torbatti> (edit) "https://play.nim-lang.org/#ix=" => "https://play.nim-lang.org/#ix=40Ok" |
18:30:47 | FromDiscord | <Torbatti> (edit) "https://play.nim-lang.org/#ix=40Ok" => "https://play.nim-lang.org/#ix=40Ol" |
18:31:34 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Om |
18:31:37 | FromDiscord | <enthus1ast> os |
18:31:39 | FromDiscord | <Torbatti> import strformat |
18:31:53 | FromDiscord | <Torbatti> + os |
18:31:56 | FromDiscord | <enthus1ast> (i do not see the stuff you forwared lol) |
18:32:10 | FromDiscord | <enthus1ast> image.png https://media.discordapp.net/attachments/371759389889003532/989961142753439774/image.png |
18:32:12 | FromDiscord | <enthus1ast> strange |
18:32:28 | FromDiscord | <enthus1ast> maybe an issue with the bridge |
18:32:29 | FromDiscord | <Torbatti> In reply to @enthus1ast "strange": kekew |
18:32:29 | FromDiscord | <Not Saucx> bbot? |
18:33:45 | FromDiscord | <Not Saucx> okay s |
18:33:46 | FromDiscord | <Not Saucx> so |
18:33:46 | FromDiscord | <Not Saucx> https://nim-lang.org/docs/strscans.html |
18:33:49 | FromDiscord | <Not Saucx> imma read this |
18:34:04 | FromDiscord | <Not Saucx> and lets say i want to read the first character after the second comma |
18:34:20 | FromDiscord | <enthus1ast> i can just recommend parseutils |
18:34:55 | FromDiscord | <enthus1ast> but you could also just do line.find(",", 1) |
18:35:08 | FromDiscord | <enthus1ast> (the one stops after the first comma) |
18:35:20 | FromDiscord | <enthus1ast> or 2 in your case |
18:35:39 | * | cyraxjoe joined #nim |
18:36:00 | FromDiscord | <enthus1ast> but strscans will also work i guess |
18:36:49 | FromDiscord | <Not Saucx> so if if the file i wanted to look at was structred like this |
18:37:04 | FromDiscord | <Not Saucx> sent a code paste, see https://play.nim-lang.org/#ix=40Op |
18:37:14 | FromDiscord | <Torbatti> its the 2nd one then |
18:37:15 | FromDiscord | <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:41 | FromDiscord | <enthus1ast> is this a csv? |
18:37:55 | FromDiscord | <Not Saucx> The whole line would be in seperate files according to their first char after the second comma |
18:39:41 | FromDiscord | <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:28 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=40Ow |
18:43:41 | FromDiscord | <enthus1ast> assuming all files are good, no error checking ;) |
18:58:49 | FromDiscord | <Phil> I have returned |
18:59:20 | FromDiscord | <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:38 | FromDiscord | <ambient> basically i would like to have client/server for Nim environments |
18:59:50 | FromDiscord | <enthus1ast> @ambient\: sounds fancy |
18:59:54 | FromDiscord | <Phil> blinks↵... I don't think I've ever heard of the specific usecase of transferring virtual environments |
19:00:13 | FromDiscord | <ambient> by environment i mean the global namespace inside a Nim program |
19:00:21 | FromDiscord | <enthus1ast> i think you will run into lots of trouble, like file descriptors etc |
19:00:27 | FromDiscord | <ambient> and all the data, either with copy or shared memory |
19:00:41 | FromDiscord | <ambient> well i'm not going to handle all data, just most |
19:00:53 | FromDiscord | <ambient> i would be fine with mostly tensors etc |
19:01:16 | FromDiscord | <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:57 | FromDiscord | <enthus1ast> i think it will be much easier to just choose what you want, serialize and send it |
19:02:17 | FromDiscord | <enthus1ast> could be very much streamlined with some pragmas so that you do not have to write that much code |
19:02:20 | NimEventer | New thread by Cmc: Init procedure naming convention for non-GC memory, see https://forum.nim-lang.org/t/9263 |
19:03:18 | FromDiscord | <enthus1ast> custom pragmas such as `var mystuff: MyDataType {.ThisMustBeTransfered.}` |
19:04:26 | FromDiscord | <!Patitotective> In reply to @Not Saucx "how would i open": https://github.com/Patitotective/tinydialogs ;] |
19:04:59 | FromDiscord | <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:52 | FromDiscord | <Phil> What was the "closer to an actual REPL than inim" thing? nimsecret or something? |
19:07:22 | FromDiscord | <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:19 | FromDiscord | <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:37 | FromDiscord | <Schelz> can someone snipe me some code ? pls |
19:25:36 | * | cyraxjoe quit (Quit: I'm out!) |
19:26:56 | FromDiscord | <demotomohiro> You can just do `open("/home/foo/myfolder/myfile.nim")`. |
19:28:02 | * | cyraxjoe joined #nim |
19:33:11 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40OO |
19:42:17 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OR |
19:43:17 | FromDiscord | <!Patitotective> In reply to @demotomohiro "https://play.nim-lang.org/#ix=40ON This one doesn't": 👀 |
19:43:21 | FromDiscord | <!Patitotective> thanks |
19:45:58 | FromDiscord | <!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:13 | FromDiscord | <!Patitotective> (edit) "complexity" => "complexity, right?" |
19:47:43 | FromDiscord | <demotomohiro> In reply to @Patitotective "making `delIndices` not var": I think so. |
19:48:40 | FromDiscord | <golova> In reply to @ambient "well i'm not going": Just copy stack and .data lmao |
19:49:10 | FromDiscord | <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:41 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OV |
19:55:31 | * | ltriant joined #nim |
19:56:20 | FromDiscord | <enthus1ast> oh nice @!Patitotective |
19:56:24 | FromDiscord | <enthus1ast> clever \:) |
19:56:44 | * | Guest17 quit (Ping timeout: 252 seconds) |
19:57:44 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40OW |
19:58:20 | FromDiscord | <!Patitotective> In reply to @enthus1ast "oh nice <@762008715162419261>": ;] |
20:00:18 | * | ltriant quit (Ping timeout: 240 seconds) |
20:07:30 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/40P0 |
20:08:32 | FromDiscord | <enthus1ast> another option is to create a new sequence |
20:08:35 | FromDiscord | <demotomohiro> `list.delete(i)` is O(n) where n is list.len. |
20:10:07 | FromDiscord | <demotomohiro> In reply to @Patitotective "isn't that identical to": @Generic code is also O(n). |
20:10:07 | FromDiscord | <d4rckh> Procs in nim can be called without parenthesis right? |
20:10:23 | FromDiscord | <d4rckh> But how does nim know if I'm supplying the value returned by the proc or the proc itself? |
20:10:42 | FromDiscord | <!Patitotective> In reply to @demotomohiro "<@249581140363575297> code is also": yea, now i understand |
20:11:26 | FromDiscord | <demotomohiro> In reply to @d4rckh "Procs in nim can": https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax |
20:12:04 | FromDiscord | <demotomohiro> When you call a proc without arguments, you needs parenthesis. |
20:14:57 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40P2 |
20:15:30 | FromDiscord | <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:43 | FromDiscord | <ambient> running tests just by clicking the test button next to the code |
20:16:43 | FromDiscord | <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:13 | FromDiscord | <!Patitotective> i need to preserve the order :/ |
20:20:18 | FromDiscord | <enthus1ast> just curious, if an elem is deleted from a seq, is the seq moved? |
20:21:59 | FromDiscord | <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:33 | FromDiscord | <enthus1ast> yeah it is |
20:43:22 | FromDiscord | <Tuatarian> I imagine it should but I actually can't seem to confirm |
20:43:40 | FromDiscord | <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:19 | FromDiscord | <Elegantbeef> No |
20:46:27 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> let/var do not control the memory allocation point |
20:46:47 | * | redj joined #nim |
20:46:51 | FromDiscord | <Elegantbeef> they are a type system component and not a runtime component |
20:47:10 | FromDiscord | <Elegantbeef> variables that allocate on the stack are `object` variables that are heap allocated are `ref object` |
20:59:50 | FromDiscord | <Andreas> In reply to @Elegantbeef "variables that allocate on": ic and what about `createShared` and `allocShared` ? Is that used to be explicit ? |
21:00:55 | FromDiscord | <Schelz> sent a code paste, see https://play.nim-lang.org/#ix=40Pe |
21:02:06 | FromDiscord | <Elegantbeef> Those are heap allocated yes↵(@Andreas) |
21:02:20 | FromDiscord | <Elegantbeef> I tend not to talk about the low level allocators as you should know! 😜 |
21:03:49 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> What's the api you're looking for? |
21:07:29 | FromDiscord | <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:10 | FromDiscord | <Andreas> (edit) "reusable.." => "reusable..↵I thought a growable-pool would be nice.." |
21:08:40 | FromDiscord | <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:41 | FromDiscord | <Elegantbeef> Though dont know what your requirement is |
21:11:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/JPD |
21:15:31 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40Pg |
21:15:33 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> You can use it iso |
21:16:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40Ph |
21:16:18 | FromDiscord | <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:30 | FromDiscord | <Elegantbeef> I cannot read |
21:16:39 | FromDiscord | <Elegantbeef> I read "strictFuncs" |
21:17:02 | FromDiscord | <Phil> Which reminds me I really fucking should rename my side-effect-less procs as funcs |
21:17:27 | FromDiscord | <Phil> But it's one of those "can I be bothered" type situations |
21:18:06 | FromDiscord | <Elegantbeef> Also i believe you can do `{.experimental: "strictNotNil".}` in the file you want to ensure there are no nils |
21:18:31 | FromDiscord | <Elegantbeef> And you can do `{.warningAsError[Proven].}` or w/e it is |
21:20:24 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> Why does it return a seq but take a var seq?↵(@!Patitotective) |
21:20:42 | FromDiscord | <Elegantbeef> What? |
21:22:36 | FromDiscord | <Elegantbeef> Seems it doesnt work |
21:22:39 | FromDiscord | <Elegantbeef> Nevermind |
21:31:23 | FromDiscord | <!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 |