00:06:10 | * | Gustavo6046 joined #nim |
00:37:02 | * | krux02__ quit (Remote host closed the connection) |
00:53:05 | nixfreaknim[m] | in a nim proc what does after; represent or mean ? |
00:53:38 | nixfreaknim[m] | proc action(self: PIhandle, c: cint, after: cstring): cint {.cdecl.} =... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/6add77bbd05a3b40e268e8af5b218d8406410074) |
00:58:16 | nixfreaknim[m] | or where can I learn more about it ? |
00:58:24 | FromDiscord | <ynfle (ynfle)> The parameter `after` or `;`? |
00:59:15 | nixfreaknim[m] | after |
00:59:44 | FromDiscord | <ynfle (ynfle)> AFAIK it's not a keyword and doesn't have special meaning. Where does that proc come from |
01:00:31 | nixfreaknim[m] | https://github.com/dariolah/nim-iup-examples/blob/master/niup/text.nim |
01:03:07 | FromDiscord | <ynfle (ynfle)> I don't think it has any special meaning |
01:03:12 | FromDiscord | <ynfle (ynfle)> It's just a parameter |
01:03:35 | FromDiscord | <Rosen> As far as I can figure out, that seems to be the signature of a callback function that you can attach to a text box. It needs to exist to be the valid signature of the callback, but in this particular case it doesn't do anything |
01:03:59 | FromDiscord | <Rosen> Looks like you'd have to go looking in the IUP docs to find out what the "action" callback on a text object does |
01:05:07 | FromDiscord | <ynfle (ynfle)> What he said ☝ |
01:05:11 | FromDiscord | <ynfle (ynfle)> \they |
01:08:26 | nixfreaknim[m] | Ok thanks |
01:11:33 | FromDiscord | <Elegantbeef> It's not even a callback, it's just a cstring passed to the invoked proc |
01:14:06 | FromDiscord | <Elegantbeef> So in this case `after` is just the text in the text box |
01:14:21 | FromDiscord | <Elegantbeef> `after` is called `new_val` in the docs |
01:33:23 | nixfreaknim[m] | so after represents the text in the box? |
01:33:37 | FromDiscord | <Elegantbeef> I think so |
01:33:43 | FromDiscord | <Elegantbeef> I could be wrong |
01:33:55 | FromDiscord | <Elegantbeef> I'm not an infallible vat of knowledge sadly |
01:34:45 | nixfreaknim[m] | yeah I'm so disappointed lol |
01:35:19 | nixfreaknim[m] | so after must be a keyword word then , cause it doesn't come up anywhere else in the program |
01:37:09 | nixfreaknim[m] | <FromDiscord> "<Elegantbeef> `after` is called..." <- which docs ? the nim ones or iup ? |
01:37:18 | FromDiscord | <Elegantbeef> Iup |
01:37:54 | nixfreaknim[m] | you didnt get a time out look at the pages ? |
01:38:00 | nixfreaknim[m] | s/look/looking/ |
01:43:07 | FromDiscord | <Elegantbeef> I found the docs here https://metacpan.org/pod/IUP::Text |
01:43:21 | nixfreaknim[m] | type Action2Types* = Text_t | MultiLine_t... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/78aa89b28787eb702cec9f4683ec7b06103aeffa) |
01:43:36 | nixfreaknim[m] | from the source code |
01:43:40 | nixfreaknim[m] | so I think your right |
01:59:02 | arkanoid | is nim an academic language or a production one? |
01:59:28 | FromDiscord | <Elegantbeef> It's aimed as the latter |
02:20:41 | FromDiscord | <ynfle (ynfle)> Not very academic |
02:21:23 | FromDiscord | <JSONBash> how do I add different compilation flags into a config file? I have a vague memory of needing something in the `.nimble` file or something like `config.nims`. Maybe I am remembering wrong |
02:21:49 | FromDiscord | <Elegantbeef> config.nims is how you do it |
02:22:02 | FromDiscord | <JSONBash> is there a quick refernce sheet? |
02:22:04 | FromDiscord | <JSONBash> to see how |
02:22:27 | FromDiscord | <Elegantbeef> It's just `config.nims` then you can pass flags like you normall would |
02:22:34 | FromDiscord | <Elegantbeef> so for instance `-d:ssl` works |
02:23:04 | FromDiscord | <JSONBash> Thanks beef! |
02:31:57 | FromDiscord | <dizzyliam> Looks like the documentation for my library isn't displaying properly on `nimble.directory`, any ideas why? https://nimble.directory/docs/flower/flower.html |
02:32:07 | FromDiscord | <dizzyliam> They seem to build OK |
02:36:37 | FromDiscord | <Elegantbeef> Hmm never new nimble hosted docs |
02:37:00 | FromDiscord | <Elegantbeef> Do any of the hosted docs work? |
02:38:11 | FromDiscord | <JSONBash> @dizzyliam I can see a message hidden in the main content page that says 'Sorry, that file does not exists.' maybe thats a hint |
02:41:15 | FromDiscord | <dizzyliam> In reply to @Elegantbeef "Do any of the": Now that I'm checking, no... |
02:41:22 | FromDiscord | <dizzyliam> Not that I've found |
02:44:02 | FromDiscord | <dizzyliam> Guess I'll open an issue |
02:59:42 | FromDiscord | <evoalg> In reply to @Elegantbeef "so for instance `-d:ssl`": is it `-d:ssl` or `--d:ssl` ? |
03:00:37 | FromDiscord | <Elegantbeef> It might be `--define:ssl` I dont recall if there is a unary `-` macro |
03:01:08 | FromDiscord | <evoalg> ok I was just updating my notes and I had both examples lol |
03:01:45 | FromDiscord | <Elegantbeef> It's defined here https://nim-lang.org/docs/nimscript.html#--.t%2Cuntyped%2Cuntyped |
03:01:57 | FromDiscord | <Elegantbeef> That module is full of all the nimscript exported code and macros for config/nimble |
03:06:29 | * | arkurious quit (Quit: Leaving) |
04:05:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:22:49 | * | noeontheend joined #nim |
04:32:03 | * | jmd joined #nim |
04:35:00 | * | jmd quit (Client Quit) |
04:58:00 | * | rockcavera quit (Remote host closed the connection) |
05:03:26 | * | sagax joined #nim |
05:47:37 | * | noeontheend quit (Ping timeout: 240 seconds) |
06:35:11 | * | elph quit (Quit: Connection closed for inactivity) |
06:46:13 | FromDiscord | <panopticon> i’m trying to use this project https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/execute_powershell_bin.nim but when i set —app:gui to run it in the background i get Error: unhandled exception: errno: 9 `Bad file descriptor' [IOError] when the script ends |
06:46:29 | NimEventer | New question by How2: end parameter in echo for Nim?, see https://stackoverflow.com/questions/70431572/end-parameter-in-echo-for-nim |
06:46:37 | FromDiscord | <panopticon> (edit) "i’m trying to use this project https://github.com/byt3bl33d3r/OffensiveNim/blob/master/src/execute_powershell_bin.nim but when i set —app:gui to run it in the background i get Error: unhandled exception: errno: 9 `Bad file descriptor' [IOError] when the script ends ... " added "do any of u guys have any ideas why?" |
07:03:07 | FromDiscord | <Elegantbeef> @panopticon\: do you access anything from the running script when it could be done? |
07:07:52 | * | Lord_Nightmare quit (Ping timeout: 256 seconds) |
07:08:55 | * | Lord_Nightmare joined #nim |
07:53:05 | * | PMunch joined #nim |
07:59:05 | * | Gustavo6046 quit (Quit: Leaving) |
08:01:57 | FromDiscord | <cabboose> https://github.com/shayanhabibi/wrflock |
09:43:46 | * | neurocyte0132889 joined #nim |
09:43:46 | * | neurocyte0132889 quit (Changing host) |
09:43:46 | * | neurocyte0132889 joined #nim |
09:50:07 | * | geek_ joined #nim |
09:54:49 | * | elph joined #nim |
10:14:57 | * | geek_ quit (Ping timeout: 240 seconds) |
10:23:14 | * | geek_ joined #nim |
10:40:22 | * | geek_ quit (Ping timeout: 256 seconds) |
10:42:32 | * | arkanoid quit (Ping timeout: 252 seconds) |
10:46:12 | FromDiscord | <no name fits> Was Nim getting an official gui lib? |
10:47:21 | * | arkanoid joined #nim |
10:49:57 | FromDiscord | <konsumlamm> not that i know of |
10:58:02 | FromDiscord | <no name fits> Well what's the hottest in nim gui libs right now then? I wanna be hip |
11:21:24 | FromDiscord | <Solitude> gintro is a comprehensive gtk wrapper, nigui is simple crossplatform wrapper around windows gui and gtk, and fidget is upcoming saviour of nim gui. |
11:32:28 | FromDiscord | <valerga> What I wonder is if this would work for gui libraries https://github.com/PMunch/futhark |
11:39:48 | FromDiscord | <Rika> It would take a lot of work |
11:52:39 | PMunch | @valerga, don't see why it wouldn't |
11:53:26 | PMunch | And I take it you didn't get super far then @Rika if you think it would take a lot of work :( |
11:54:24 | FromDiscord | <Rika> I mean it’s not “nothing” but I feel it would be less than nimterop |
11:54:29 | FromDiscord | <Rika> Nonetheless a lot of work |
11:57:58 | PMunch | I think it would be pretty easy to wrap a UI library with Futhark |
11:58:04 | PMunch | Depends of course on the library |
11:58:11 | PMunch | But I had Sciter working |
12:00:32 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
12:01:25 | * | dtomato joined #nim |
12:01:53 | * | dtomato quit (Client Quit) |
12:02:16 | * | dtomato joined #nim |
12:02:34 | * | Vladar joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:13 | FromDiscord | <no name fits> I wish you could bookmark messages |
12:10:37 | PMunch | You can bookmark links like this: https://irclogs.nim-lang.org/21-12-2021.html#12:06:13 |
12:35:09 | FromDiscord | <no name fits> that's handy |
12:35:30 | FromDiscord | <no name fits> Discord should have that built-in, like a lot of other stuff |
12:36:22 | FromDiscord | <Phytolizer> you can save the message link, right click the message and "copy message link" |
12:36:53 | FromDiscord | <no name fits> In reply to @Phytolizer "you can save the": Well yeah, but I meant like you have bookmarks in the browser, you should have that for Discord |
12:36:58 | FromDiscord | <Phytolizer> true |
12:37:08 | FromDiscord | <qb> How about imgui. Nimgl has bindings |
12:37:28 | FromDiscord | <qb> https://github.com/qb-0/NimbleImGui |
12:37:50 | FromDiscord | <no name fits> I'll make a list and check it twice and try out some libs |
12:37:51 | FromDiscord | <hmmm> on windows I liked wnim a lot |
12:38:16 | FromDiscord | <hmmm> we still need something that is good with tabular like data, with columns and whatnot |
12:38:22 | FromDiscord | <Rika> ~~I’m making a wrapper for not curses right now, that’s technically a GUI right~~ |
12:39:27 | pippin | in that vein, my first experiment with nim is a wrapper for modern vector graphics the terminal way https://ctx.graphics/file/demos/nim/ctx2d.nim.html |
12:40:35 | FromDiscord | <hmmm> something like dephi stuff would be cool I guess |
12:41:18 | FromDiscord | <no name fits> sent a long message, see http://ix.io/3J25 |
12:41:46 | FromDiscord | <Rika> Futhark is not really a GUI, it’s to make wrappers for GUIs |
12:41:48 | FromDiscord | <hmmm> how about making a fake videogame UI with godot |
12:42:06 | FromDiscord | <hmmm> you can do 2d UI with godot |
12:42:08 | FromDiscord | <qb> guess raylib also has a gui library build in. Never used it but looks cool |
12:42:19 | FromDiscord | <qb> (edit) "build" => "built" |
12:42:23 | FromDiscord | <no name fits> Seems a little too intensive for my uses. It's just for a chat app |
12:43:00 | FromDiscord | <qb> https://github.com/raysan5/raygui |
12:43:11 | FromDiscord | <qb> Not sure if the nim bindings cover it |
12:44:57 | FromDiscord | <hmmm> honesty anything with bindings is boring to write and read. Ideally we should have something nim native that is easy to write but complete and not toylike. It's indeed a massive undertaking |
12:45:42 | FromDiscord | <hmmm> @treeform how is the status on fidget2 my bro |
12:47:23 | FromDiscord | <retkid> hey how can i make a table hat does not allow for redefinition |
12:47:31 | FromDiscord | <Rika> In reply to @hmmm "honesty anything with bindings": If the wrapper is done right then it would be transparent from a regular pure Nim library |
12:48:02 | FromDiscord | <retkid> ie |
12:48:16 | FromDiscord | <retkid> a["x"] = 1↵a["x"] = 2 |
12:48:20 | * | geek_ joined #nim |
12:48:35 | FromDiscord | <retkid> (edit) "a["x"] = 1↵a["x"] = 2" => "sent a code paste, see https://play.nim-lang.org/#ix=3J29" |
12:48:48 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=3J29" => "https://play.nim-lang.org/#ix=3J2a" |
12:49:51 | FromDiscord | <retkid> i could obviously test it if it already exists and if it does raise, but is there a pre-existing method for this |
12:52:24 | FromDiscord | <no name fits> Let or const? |
12:52:35 | FromDiscord | <retkid> const is weird in nim just use const |
12:52:39 | FromDiscord | <retkid> (edit) "const" => "lry" |
12:52:40 | FromDiscord | <retkid> (edit) "lry" => "let" |
12:52:52 | FromDiscord | <no name fits> No I'm suggesting it to you |
12:53:20 | FromDiscord | <no name fits> Also const works as expected for me |
12:54:16 | FromDiscord | <retkid> well adding to a table using let doesn't really happen? |
12:54:20 | * | rockcavera joined #nim |
12:54:20 | * | rockcavera quit (Changing host) |
12:54:20 | * | rockcavera joined #nim |
12:54:36 | FromDiscord | <retkid> because the table would then be immutable |
12:56:02 | FromDiscord | <no name fits> Yes. Then if you need a mutable table I'd just do `if not myTable.hasKey(myKey)` |
12:56:28 | FromDiscord | <retkid> well im aware of that but I wanted a smoother thing |
12:56:43 | FromDiscord | <retkid> I guess I can modify the [key] template |
13:07:02 | * | geek_ quit (Ping timeout: 240 seconds) |
13:45:29 | * | tiorock joined #nim |
13:45:29 | * | tiorock quit (Changing host) |
13:45:29 | * | tiorock joined #nim |
13:45:29 | * | rockcavera is now known as Guest2284 |
13:45:29 | * | Guest2284 quit (Killed (osmium.libera.chat (Nickname regained by services))) |
13:45:29 | * | tiorock is now known as rockcavera |
14:04:15 | * | rockcavera quit (Remote host closed the connection) |
14:27:15 | FromDiscord | <panopticon> In reply to @Elegantbeef "<@189039745647640576>\: do you access": i’m trying to run a powershell empire agent but with the app set to gui it crashes when i run a module and when the pc sleeps or when i run the kill command for the agent :/ |
15:02:25 | * | freevryheid joined #nim |
15:03:56 | * | freevryheid left #nim (WeeChat 3.4) |
15:06:06 | * | PMunch quit (Quit: Leaving) |
15:07:40 | * | neurocyte0132889 quit (Read error: Connection reset by peer) |
15:08:21 | * | neurocyte0132889 joined #nim |
15:08:21 | * | neurocyte0132889 quit (Changing host) |
15:08:21 | * | neurocyte0132889 joined #nim |
15:11:50 | * | freevryheid joined #nim |
15:16:06 | * | freevryheid left #nim (WeeChat 3.4) |
15:26:11 | * | freevryheid joined #nim |
15:53:31 | NimEventer | New Nimble package! prettyvec - Small library for working with vectors, see https://github.com/prettybauble/prettyvec |
16:07:50 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
16:48:26 | FromDiscord | <tbrekalo> what is a good practice for using `.raises.` pragma? |
16:54:19 | * | rockcavera joined #nim |
16:54:19 | * | rockcavera quit (Changing host) |
16:54:19 | * | rockcavera joined #nim |
16:57:29 | FromDiscord | <tbrekalo> Should I write `result.line = move(line)` here? https://media.discordapp.net/attachments/371759389889003532/922895561814851644/unknown.png |
17:02:12 | * | xet7 quit (Remote host closed the connection) |
17:03:03 | * | xet7 joined #nim |
17:27:40 | * | arkurious joined #nim |
17:27:56 | * | flynn quit (Quit: The Lounge - https://thelounge.chat) |
17:30:05 | * | flynn joined #nim |
17:34:22 | FromDiscord | <tbrekalo> Also; is something like this possible? https://media.discordapp.net/attachments/371759389889003532/922904840458350662/unknown.png |
17:47:20 | FromDiscord | <auxym> In reply to @tbrekalo "Also; is something like": See here: https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT types in Nim only exist at compile-time, at run time everything is just data, so if you're operating on types, you have to use `when` or other compile-time mechanics (template, macros, etc) |
17:47:57 | FromDiscord | <tbrekalo> thanks |
17:50:54 | FromDiscord | <auxym> About move, sink, etc: in all cases they are never required I believe, just an optimization for the GC you can optionally use. https://nim-lang.org/docs/destructors.html#move-semantics says `This property is computed by a static control flow analysis but can also be enforced by using system.move explicitly`. Whether you should enforce it here, not sure, I haven't used these much myself, just leave everything on auto. |
17:53:23 | FromDiscord | <auxym> In reply to @tbrekalo "thanks": Also, you can use `1'i32'`/`i'u32` or `int32(1)`/`uint32(1)` or `1.int32`/`1.uint32` for creating literal (u)int32s. Casts are unsafe so best avoided unless you really need them and know what you are doing (reinterpreting raw binary data). |
17:56:24 | FromDiscord | <tbrekalo> In reply to @auxym "Also, you can use": I am kinda annoyed by the fact that there's not parseUInt32 in std |
17:58:55 | FromDiscord | <auxym> agreed, though unless you are running this on an 8bit or 16bit micro, `parseUint(s).uint32` should be equivalent. Since your system `uint` will be either 32 or 64. |
18:00:39 | FromDiscord | <tbrekalo> @auxym , can you help me a bit with nim's move semantics?↵Should move be used when assigning the `sink` param to part of the result variable as in the example I posted above? |
18:01:16 | FromDiscord | <auxym> Yeah, really not familiar with that stuff, sorry. |
18:01:28 | FromDiscord | <tbrekalo> :/ |
18:01:42 | FromDiscord | <auxym> see my message above though? https://discord.com/channels/371759389889003530/371759389889003532/922909005158961242 |
18:03:03 | FromDiscord | <tbrekalo> In reply to @auxym "see my message above": didn't see it; sorry |
18:06:10 | FromDiscord | <tbrekalo> https://youtu.be/aUJcYTnPWCg?t=480 this answered my question |
18:18:43 | * | lumo_e joined #nim |
18:47:48 | * | Vladar quit (Quit: Leaving) |
18:59:45 | FromDiscord | <retkid> is there a prexisting function to split a string based on its length |
18:59:57 | FromDiscord | <retkid> you spit it into 10 equal characters |
19:00:06 | FromDiscord | <retkid> (edit) "characters" => "length bytes" |
19:00:14 | FromDiscord | <retkid> (edit) "you spit it into 10 equal length bytes ... " added "with a remainder" |
19:08:15 | FromDiscord | <TryAngle> what are good / most used UI libraries right now? |
19:08:22 | FromDiscord | <TryAngle> (cross platform support) |
19:08:30 | FromDiscord | <retkid> theres like 2 and they aren't really practical |
19:08:34 | FromDiscord | <retkid> probably go somewhere else for ui |
19:08:50 | FromDiscord | <TryAngle> ok guess I just use html then |
19:08:52 | FromDiscord | <TryAngle> unlucky |
19:08:54 | FromDiscord | <IsaacPaul> hmm |
19:08:59 | FromDiscord | <retkid> i mean |
19:09:05 | FromDiscord | <retkid> i didn't say dont tru |
19:09:08 | FromDiscord | <retkid> (edit) "tru" => "try" |
19:09:26 | FromDiscord | <retkid> does anyone have the gui library list |
19:09:28 | FromDiscord | <retkid> (edit) "list" => "list?" |
19:09:37 | FromDiscord | <retkid> i cant ind it |
19:09:40 | FromDiscord | <retkid> (edit) "ind" => "find" |
19:09:43 | FromDiscord | <ajusa> There's the libui bindings and WebView options I guess, those would be the most mature options? Along with Qt |
19:09:57 | FromDiscord | <retkid> https://github.com/xflywind/awesome-nim |
19:10:01 | FromDiscord | <IsaacPaul> There is a wrapper for QT I believe and Dear image gui |
19:10:04 | FromDiscord | <retkid> theres ui section here |
19:10:23 | FromDiscord | <retkid> @TryAngle |
19:12:23 | FromDiscord | <TryAngle> hmm nimx looks good I guess |
19:12:28 | FromDiscord | <TryAngle> did anybody here try it? |
19:12:37 | FromDiscord | <retkid> no i do everything in svelte |
19:13:26 | FromDiscord | <TryAngle> ah so u basically use frontend (web) + backend (nim) architecture for UI ? |
19:13:51 | FromDiscord | <retkid> I do backend in Nim and maybe C in the future |
19:13:59 | FromDiscord | <retkid> connects to uii via severs |
19:14:21 | FromDiscord | <retkid> I want to expand my system languages with Ocaml but uh |
19:14:29 | FromDiscord | <retkid> Ocaml is a bit hard to learn |
19:15:00 | FromDiscord | <TryAngle> svelte looks interesting |
19:15:32 | FromDiscord | <retkid> if you want it to work on mobile you're stuck with electorn, otherwise you can use NodeGui |
19:19:22 | FromDiscord | <TryAngle> hmm maybe ye I might make it a browser app 🤔 |
19:19:33 | FromDiscord | <TryAngle> but I really do not like electron 🤮 |
19:20:36 | FromDiscord | <retkid> well |
19:20:47 | FromDiscord | <retkid> electron is fine lol idk what you're on about |
19:30:04 | FromDiscord | <TryAngle> In reply to @retkid "electron is fine lol": the fault might not be in electron itself but maybe the projects that use electron but every "mainstream" electron app just takes so much memory and cpu and freezes for me sometimes idk. |
19:30:55 | FromDiscord | <retkid> well |
19:30:58 | FromDiscord | <retkid> thats why you use nodegui |
19:31:12 | FromDiscord | <retkid> otherwise you're developing 2 apps, 1 for the desktop and 1 for your phone |
19:31:16 | FromDiscord | <retkid> which you'd be doing anyway lol |
19:31:18 | FromDiscord | <retkid> so idk |
19:34:52 | FromDiscord | <auxym> In reply to @retkid "you spit it into": Not to my knowledge, but you can whip something up with countUp and map I think |
19:36:29 | FromDiscord | <IsaacPaul> imo there is no good cross platform UI library atm. You got QT, Election, or wrappers over system api which are just plain ugly. |
19:36:44 | FromDiscord | <auxym> for GUI there's https://github.com/PMunch/wxnim as well, wrapper for wxwidgets which is a pretty mature and complete gui toolkit. Has the advantage of using native widgets too. don't think it supports mobile then |
19:37:07 | FromDiscord | <auxym> (edit) "then" => "though" |
19:40:09 | FromDiscord | <auxym> and https://github.com/filcuc/nimqml for Qt QML |
19:43:21 | FromDiscord | <huantian> Is there a good way to download a file from a url which automatically gets the filename from the Content-Disposition? |
19:45:59 | FromDiscord | <huantian> ideally it would add `(someint)` to the end of the filename if it already exists, but I can do that seperately |
19:51:23 | FromDiscord | <huantian> also, is it possible to stream download files? does httpclient.downloadFIle already do that? |
20:13:49 | freevryheid | https://github.com/xflywind/awesome-nim#gui |
20:53:05 | FromDiscord | <pmunch> Not as far as I know, no↵(@auxym) |
20:53:26 | FromDiscord | <pmunch> But it supports raw X11, so that's nice |
21:00:00 | FromDiscord | <hmmm> I have a plan to solve all our GUI problems |
21:01:37 | FromDiscord | <hmmm> we invite Araq to discord main for christmas celebrations, we let him drink a couple of heavy beers and then when he is weak we ask him if he codes a GUI for us 😏 |
21:03:27 | FromDiscord | <evoalg> In reply to @retkid "is there a prexisting": not something like this? https://play.nim-lang.org/#ix=3J4o |
21:03:53 | FromDiscord | <retkid> i wrote the function |
21:03:58 | FromDiscord | <retkid> but now i dont need the function |
21:04:03 | FromDiscord | <retkid> so im upset i spent time writing |
21:04:03 | FromDiscord | <evoalg> lol |
21:04:04 | FromDiscord | <retkid> (edit) "so im upset i spent time writing ... " added "it" |
21:04:56 | * | krux02 joined #nim |
21:52:03 | FromDiscord | <retkid> In reply to @evoalg "not something like this?": ok i needed it again and you are a sugar god thank you |
21:52:09 | FromDiscord | <retkid> i should really learn the functional stuff there |
21:57:18 | FromDiscord | <Forest> What's a good library for Nim that has support for UDP and TCP sockets at the same time? I'd also wanna be able to use it asynchronously if possible |
21:57:49 | FromDiscord | <Forest> I'd preferably want a simple API to do it too |
21:58:04 | FromDiscord | <Forest> If this is too much to ask just lmk and maybe suggest anything else? Thanks in advance aha |
21:58:10 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/asyncnet.html ? |
21:59:04 | FromDiscord | <Forest> Oh i didn't realize nim had an async net module, i thought it was only synchronous lol, thanks |
21:59:25 | FromDiscord | <Elegantbeef> No problem |
22:02:21 | NimEventer | New post on r/nim by richardd08: Which dataframe library to use?, see https://reddit.com/r/nim/comments/rlpcdp/which_dataframe_library_to_use/ |
22:18:56 | FromDiscord | <Sabena Sema> does the stdlib expose alloca? |
22:19:59 | FromDiscord | <treeform> Hey, I finished a library to parse csv files and would like for some one to proof-read my readme: https://github.com/treeform/tabby and maybe get your other thoughts? |
22:21:14 | FromDiscord | <Sabena Sema> why must the `ParseContext` be a ref-object? |
22:21:27 | FromDiscord | <treeform> In reply to @tbrekalo "I've got a question": You can try my csv lib: https://github.com/treeform/tabby |
22:21:54 | FromDiscord | <treeform> In reply to @Sabena Sema "why must the": because it contains .data which is a big string |
22:22:04 | FromDiscord | <Sabena Sema> so? |
22:22:23 | FromDiscord | <treeform> if you pass a object with a big string it will get copied |
22:22:28 | FromDiscord | <treeform> making stuff really slow |
22:24:32 | FromDiscord | <treeform> I usually find ref objects to be faster, except in special cases. |
22:24:54 | FromDiscord | <Sabena Sema> but writing `ref object` prevents me from using it with value semantics. Idk, I generally think `ref object` is a mistake unless the object uses inheritance |
22:25:17 | FromDiscord | <treeform> Really I usually think object is a mistake? as I just see slowness. |
22:25:19 | FromDiscord | <Sabena Sema> like passing a value object to a function by both direct value and var won't copy it |
22:25:26 | FromDiscord | <Sabena Sema> it's only on assignments |
22:25:46 | FromDiscord | <treeform> Some times it will copy the object when passed by direct value |
22:26:06 | FromDiscord | <treeform> you need to do the {.bycopy.} or {.byref.} thing if you want to be sure |
22:26:08 | FromDiscord | <Sabena Sema> well, it _definately_ won't copy that string |
22:26:27 | FromDiscord | <Sabena Sema> and generally it'll only actually copy it if that would be faster |
22:26:39 | FromDiscord | <treeform> I disagree |
22:27:25 | FromDiscord | <treeform> object are generally slower because they love to copy things in surprising ways. |
22:27:51 | FromDiscord | <treeform> with reg object I am guaranteed to only copy a pointer |
22:27:56 | FromDiscord | <treeform> (edit) "reg" => "ref" |
22:28:39 | FromDiscord | <Sabena Sema> so, mark it bycopy |
22:28:41 | FromDiscord | <Sabena Sema> (edit) "bycopy" => "byref" |
22:28:53 | FromDiscord | <hmmm> treeformy can tabby handle the case of a csv with unspecified number of columns |
22:29:11 | FromDiscord | <hmmm> I mean different csv can have different col |
22:29:25 | FromDiscord | <treeform> In reply to @hmmm "treeformy can tabby handle": What do you mean? I think no. |
22:29:38 | FromDiscord | <treeform> Because you can't have a nim object with unspecified number of columns. |
22:29:42 | FromDiscord | <Sabena Sema> that way you always get the pointer but don't generate garbage each time you use the type completely inside one stack frame |
22:29:45 | FromDiscord | <hmmm> csv a has 3 columns and csv b has 5 columns |
22:30:44 | FromDiscord | <treeform> In reply to @Sabena Sema "that way you always": It's a single object, what garbage, 1 thing? Its with object you get copying in your stack frame for no reason. |
22:31:08 | FromDiscord | <treeform> In reply to @hmmm "csv a has 3": What are the fields of csv a and csv b? |
22:31:24 | FromDiscord | <treeform> (edit) "fields" => "columns" |
22:32:17 | FromDiscord | <Sabena Sema> it's not so bad for ParseContext but for like a container (like the ones in bitty) if you use them in a loop it can generate really quite a decent amount of garbage that needs to get cleaned up |
22:32:28 | FromDiscord | <hmmm> csv b has 1 date and 1 text col more than csv a that had id date and text |
22:33:44 | FromDiscord | <Sabena Sema> esp considering that ParseContext has so many other allocations hanging off anyways |
22:33:51 | FromDiscord | <hmmm> I mean I might create 2 objects but I wanted to know for the general case, but indeed we can't have objects with unspecified fields |
22:33:56 | FromDiscord | <treeform> In reply to @hmmm "csv b has 1": You would create an row that has all fields, then it will read the header and populate only the fields you have. |
22:34:05 | FromDiscord | <treeform> (edit) "have." => "have in the csv." |
22:35:37 | FromDiscord | <hmmm> well generally this case is better served with seqs that can grow and normal csv parsers that consume and produce seqs of seqs |
22:35:37 | FromDiscord | <treeform> In reply to @Sabena Sema "it's not so bad": So this is about bitty not tabby? Can write a benchmark where non ref bitty is faster than ref bitty? |
22:35:49 | FromDiscord | <Sabena Sema> yeah, I think I'll have to do that |
22:35:55 | FromDiscord | <Sabena Sema> it's about both |
22:36:06 | FromDiscord | <treeform> bitty is much simpler to benchmark though |
22:36:12 | FromDiscord | <Sabena Sema> yes |
22:36:22 | FromDiscord | <hmmm> anyway is there a reson because or std csvparse doesn't come equipped with facilities to write the csv back to file? |
22:36:38 | FromDiscord | <hmmm> reason |
22:36:45 | FromDiscord | <hmmm> our |
22:37:03 | FromDiscord | <hmmm> jeesus my english please put me down with a desert eagle .50 |
22:39:25 | FromDiscord | <Sabena Sema> For bitty I also kinda want the copying semantics that value types have, but perhaps that's just because I'm used to C and C++ |
22:40:26 | FromDiscord | <treeform> In reply to @hmmm "csv b has 1": Some thing like this: https://gist.github.com/treeform/fe05e8ffb24a22a7a3ca92c804521cfd |
22:41:23 | FromDiscord | <hmmm> woa it can? |
22:41:34 | FromDiscord | <treeform> In reply to @Sabena Sema "yeah, I think I'll": I am simple ... show me the numbers? |
22:41:47 | FromDiscord | <hmmm> wait the first csv has 5 column all of the a + date and text more |
22:42:03 | FromDiscord | <treeform> what 5 columns? |
22:42:06 | FromDiscord | <hmmm> hehe\ |
22:42:37 | FromDiscord | <hmmm> yes sorry I can't explain myself in english today apparently 😦 |
22:43:06 | FromDiscord | <hmmm> csv a is id date text and csb is id date text date text |
22:43:11 | FromDiscord | <Sabena Sema> In reply to @treeform "I am simple ...": yes, reasonable. I'll write a benchmark when I have time |
22:43:50 | FromDiscord | <treeform> In reply to @hmmm "wait the first csv": 5 columns: https://gist.github.com/treeform/fe05e8ffb24a22a7a3ca92c804521cfd |
22:44:16 | FromDiscord | <treeform> So csv b uses duplicate names? |
22:44:22 | FromDiscord | <treeform> ok |
22:44:25 | FromDiscord | <hmmm> this is pretty cool |
22:47:12 | FromDiscord | <treeform> Here is with duplicate names: https://gist.github.com/treeform/fe05e8ffb24a22a7a3ca92c804521cfd |
22:47:19 | FromDiscord | <treeform> @hmmm is this what you mean? |
22:47:43 | FromDiscord | <Sabena Sema> The other thing that types like BitArray2D do is generally use more cache, in a loop using BitArray2D you're going to load in the cache line containing the BitArray2D, then go and load the cache line containing `bits`, which is pretty likely to be a different cache line. I'll try and write a benchmark showing this, but it might look a bit contrived since I'll need to do "stuff" that evicts those lines later in the loop |
22:48:23 | FromDiscord | <hmmm> In reply to @treeform "<@!887269570765791243> is this what": yea, and if I pass the smaller csv it will work the same even without the missing fields right? |
22:48:39 | FromDiscord | <treeform> In reply to @Sabena Sema "The other thing that": We use 1d bit array in box, but again we only have 1 bit array for the duration of the whole program. So heap garbage is not an issue. |
22:48:46 | FromDiscord | <treeform> (edit) "box," => "boxy," |
22:48:58 | FromDiscord | <treeform> In reply to @hmmm "yea, and if I": yes |
22:49:04 | FromDiscord | <Sabena Sema> yeah, if there's only one in the whole program it's fine |
22:49:30 | FromDiscord | <hmmm> In reply to @treeform "yes": 💪 |
22:49:56 | FromDiscord | <Sabena Sema> but in a loop it's not, obviously in a simple loop you can just move the BitArray up before the loop starts, and replace it's content each iteration, but if the usage is in a function that gets called from somewhere in the loop things get more annoying |
22:50:39 | FromDiscord | <treeform> In reply to @hmmm "💪": See here: https://gist.github.com/treeform/fe05e8ffb24a22a7a3ca92c804521cfd |
22:51:54 | * | noeontheend joined #nim |
22:52:02 | FromDiscord | <hmmm> 1 object 2 csvs, looks gud, I'll install tabby and tell you if it works for me in this form |
22:52:22 | FromDiscord | <Sabena Sema> this is a bigger problem for like, vector/linalg libraries (and I see vmath does indeed use value types) |
22:52:31 | FromDiscord | <Sabena Sema> but still, I'll write a benchmark later |
22:52:37 | FromDiscord | <Sabena Sema> it'll be fun |
22:52:37 | FromDiscord | <hmmm> oh noes it's not on nimble 😦 |
22:55:41 | FromDiscord | <treeform> i'll add it to nimble soon |
22:55:48 | FromDiscord | <hmmm> 👍 |
22:57:11 | FromDiscord | <treeform> In reply to @Sabena Sema "this is a bigger": there are cases were objects make sense, like vmath is a prefect example. |
22:58:18 | FromDiscord | <treeform> But like here for example: https://github.com/nim-lang/Nim/blob/devel/lib/pure/parsesql.nim#L43 |
22:58:31 | FromDiscord | <treeform> I made everything run like 5x faster by switch to a ref object for token. |
22:59:19 | FromDiscord | <Sabena Sema> my kinda general problem with `ref object` is that unlike with normal object semantics I can't decide if I want reference or value semantics, if I want value I'm just outta luck and need to modify the source code |
22:59:21 | FromDiscord | <treeform> because plain object creates so many memory allocations. |
22:59:41 | FromDiscord | <treeform> In reply to @Sabena Sema "my kinda general problem": yeah but usually is a ref for a reason |
22:59:46 | FromDiscord | <treeform> because plain object is too slow |
23:00:19 | FromDiscord | <Sabena Sema> where were the copies in parsesql actually coming from? |
23:00:51 | FromDiscord | <treeform> i don't remember its been like a year ago |
23:00:58 | FromDiscord | <treeform> I have sense have written my own SQL parser. |
23:05:53 | FromDiscord | <TurtleP> Hm.. what is the best way to compare two file `stat` modification times? I have the code in place, but unlike python, I can't do `first.st_mtime > second.st_mtime` since there's both seconds and nanoseconds in `Time` objects |
23:07:30 | FromDiscord | <Elegantbeef> Do you know there is `getLastModificationTime` in os? |
23:07:57 | FromDiscord | <TurtleP> oh, there is? |
23:08:00 | FromDiscord | <Elegantbeef> With it you could do `first < second` |
23:08:11 | FromDiscord | <TurtleP> huh, ok, awesome |
23:08:20 | FromDiscord | <Elegantbeef> Or i guess `first > second` |
23:08:37 | FromDiscord | <Elegantbeef> Just `import std/[os, times]` and you're golden 🙂 |
23:08:51 | FromDiscord | <TurtleP> hmm this still returns a `Time` object |
23:09:02 | FromDiscord | <TurtleP> https://media.discordapp.net/attachments/371759389889003532/922989069372370994/unknown.png |
23:09:11 | FromDiscord | <Elegantbeef> what is `second` in your example? |
23:09:22 | FromDiscord | <TurtleP> they are both the last modification times for files |
23:09:37 | FromDiscord | <Elegantbeef> Dont you want to see if one was modified more recently? |
23:09:48 | FromDiscord | <TurtleP> yes |
23:10:02 | FromDiscord | <Elegantbeef> So then use that for both and then `first > second` will work |
23:10:13 | FromDiscord | <Elegantbeef> There is a `>` operator for that |
23:10:13 | FromDiscord | <TurtleP> https://media.discordapp.net/attachments/371759389889003532/922989362306752592/unknown.png |
23:10:29 | FromDiscord | <Elegantbeef> Do you have `times` imported? |
23:10:36 | FromDiscord | <TurtleP> hm, no |
23:10:44 | FromDiscord | <Elegantbeef> import it |
23:10:46 | FromDiscord | <TurtleP> ah that fixes it |
23:10:48 | FromDiscord | <Solitude> In reply to @treeform "I made everything run": im sure you could achieve the same speedup with {.byref.}, without changing copying semantics |
23:10:51 | FromDiscord | <TurtleP> kind of weird, but alright |
23:10:59 | FromDiscord | <Elegantbeef> Nim doesnt bring in all procedures with types since they're all freestanding |
23:11:08 | FromDiscord | <Elegantbeef> There is no way to say "Wherever you go you want this" |
23:11:39 | FromDiscord | <Elegantbeef> There is an RFC for "type bound operations" if i recall correctly, but it is what it is presently |
23:12:03 | FromDiscord | <Elegantbeef> I'm sure sabena will give a long winded reason why they should exist 😛 |
23:12:23 | FromDiscord | <Sabena Sema> In reply to @Solitude "im sure you could": I bet the problem was not actually in parameter passing, since var paramters are always byref and default "no address" parameters should not be copying the inner string no matter what |
23:12:26 | FromDiscord | <Sabena Sema> if they are it's kinda a bug |
23:12:28 | FromDiscord | <demotomohiro> There is `fileNewer` proc in os module.↵https://nim-lang.org/docs/os.html#fileNewer%2Cstring%2Cstring |
23:12:42 | FromDiscord | <Elegantbeef> Ah there you go dont even need times |
23:12:55 | FromDiscord | <Elegantbeef> Thanks demo for making me redundant |
23:16:22 | FromDiscord | <demotomohiro> Elegantbeef, you teached important Nim features! |
23:17:49 | FromDiscord | <Solitude> In reply to @Sabena Sema "I bet the problem": no, the problem is that small objects containing strings that dont qualify for implicit reference passing are copied fully, including new string allocation |
23:19:41 | FromDiscord | <Sabena Sema> that seems like a bug to me |
23:20:26 | FromDiscord | <Solitude> maybe, i bet araq would say that its by design |
23:21:04 | FromDiscord | <Sabena Sema> I mean it might make the internals simpler, since assignment and the parameter copy would be the same |
23:21:51 | FromDiscord | <Sabena Sema> oh |
23:22:35 | FromDiscord | <Sabena Sema> no |
23:22:40 | FromDiscord | <Sabena Sema> all the subobjects also have no address |
23:22:44 | * | Colt quit (Remote host closed the connection) |
23:23:10 | FromDiscord | <Sabena Sema> so you can't mutate the inner strings or take their address |
23:23:14 | * | Colt joined #nim |
23:23:16 | FromDiscord | <Sabena Sema> so why copy them ever? |
23:23:37 | FromDiscord | <Solitude> you should ask that in #internals |
23:25:07 | FromDiscord | <TurtleP> ah thank you both @demotomohiro and @ElegantBeef! |
23:27:35 | FromDiscord | <TryAngle> the std/xmltree module causes huge bloat of whitespaces... is there a way to stip them away? |
23:27:43 | FromDiscord | <TryAngle> (edit) "causes" => "has a" |
23:29:24 | * | Colt quit (Remote host closed the connection) |
23:29:50 | * | Colt joined #nim |
23:42:38 | FromDiscord | <treeform> In reply to @Solitude "im sure you could": Do you have benchmarks to prove that? |
23:44:10 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3J4Q |
23:44:29 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3J4Q" => "https://paste.rs/PoY" |
23:54:37 | * | lumo_e quit (Ping timeout: 240 seconds) |