00:13:34 | FromDiscord | <bostonboston> Would you settle for doing it in a config file |
00:15:55 | * | redj joined #nim |
00:16:00 | FromDiscord | <bostonboston> Or I suppose I should ask what you're trying to accomplish |
00:25:47 | NimEventer | New Nimble package! iniplus - An extended INI parser for Nim., see https://github.com/systemonia/iniplus |
00:29:08 | * | xet7 quit (Read error: Connection reset by peer) |
00:56:49 | PMunch | Huh, it's 2AM.. |
01:00:43 | FromDiscord | <Chronos [She/Her]> Actually it's 1 AM 😎 |
01:00:54 | FromDiscord | <Elegantbeef> Actually it's 6 pm |
01:00:54 | FromDiscord | <Chronos [She/Her]> [Gets kachowed by Lightning McQueen] |
01:01:09 | FromDiscord | <Chronos [She/Her]> I should sleep, adios |
01:01:35 | FromDiscord | <ieltan> In reply to @elegantbeef "Disabling entire user IO": there's been a wave of people seeking to fullfill questionable usecases lately....... |
01:02:14 | FromDiscord | <Chronos [She/Her]> Also considering that they asked about using Dimscord without a bot acc, if i remember correctly |
01:02:23 | FromDiscord | <Chronos [She/Her]> Sounds like they wanna use webhooks for something |
01:04:01 | FromDiscord | <ieltan> 🐲 |
01:54:56 | FromDiscord | <michaelb.eth> recently there seems to have been a series of kids (I'm guessing 11-13 years old, maybe just the same kid but different accounts) who are hopeful about learning enough Nim to cause mischief with it |
02:04:44 | * | Onionhammer joined #nim |
02:07:17 | FromDiscord | <bostonboston> Criminals |
02:21:36 | * | PMunch quit (Quit: leaving) |
02:22:29 | * | lucasta quit (Quit: Leaving) |
03:01:20 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4Ms6 |
03:01:32 | FromDiscord | <ravinder387> is it compulsory to write NimMain() during call nim in c |
03:01:34 | * | jay-tuckey joined #nim |
03:01:49 | FromDiscord | <ravinder387> I want to create shared library |
03:02:08 | FromDiscord | <ravinder387> So can i avoid NimMain() |
03:06:00 | FromDiscord | <Elegantbeef> If you want to intialise all top level variables and run any top level code |
03:08:00 | FromDiscord | <ravinder387> int fib(int a); int myfun(int x) { return fib(x) } |
03:08:11 | FromDiscord | <ravinder387> is it works |
03:10:41 | FromDiscord | <Elegantbeef> If you do not have any top level code or variables |
03:18:32 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4Msb |
03:18:55 | FromDiscord | <Elegantbeef> And you use orc/arc |
03:32:01 | * | jay-tuckey quit (Ping timeout: 276 seconds) |
03:38:16 | FromDiscord | <bostonboston> How would one go about making NimMain a constructor |
03:38:41 | FromDiscord | <Elegantbeef> Use codegendecl and call it inside your own |
03:42:12 | FromDiscord | <Elegantbeef> If you search for the attribute you might find me talking about it |
03:47:44 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4Msi |
03:48:01 | FromDiscord | <Elegantbeef> Yea |
03:48:48 | FromDiscord | <Elegantbeef> should be `importc, cdecl` iirc though |
03:50:41 | * | redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:50:50 | FromDiscord | <bostonboston> how would I verify functionality |
03:52:41 | * | redj joined #nim |
03:53:02 | FromDiscord | <Elegantbeef> write `echo "Hello"` |
03:53:18 | FromDiscord | <Elegantbeef> Compile into a lib, load library, if you see "Hello" it done worky |
04:07:42 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4Msj |
04:08:50 | FromDiscord | <Elegantbeef> Yep |
04:09:27 | FromDiscord | <bostonboston> wonderful |
05:07:14 | FromDiscord | <bostonboston> should --app:lib automatically delcare nimmain as constructor or why does the compilier not do that |
05:07:23 | FromDiscord | <bostonboston> (edit) "should --app:lib ... automatically" added "by defaul" |
05:08:14 | FromDiscord | <Elegantbeef> I do not know |
05:27:39 | * | rockcavera quit (Remote host closed the connection) |
05:31:41 | NimEventer | New thread by Boston: Delcare NimMain as constructor when --app:lib, see https://forum.nim-lang.org/t/10686 |
05:36:19 | NimEventer | New Nimble package! pathutils - Utilities for handling paths, see https://github.com/hmbemba/pathutils |
06:12:41 | NimEventer | New post on r/nim by Dovelus: Nim nimcrypto AES128, see https://reddit.com/r/nim/comments/18448sv/nim_nimcrypto_aes128/ |
06:27:19 | * | azimut quit (Ping timeout: 240 seconds) |
06:29:49 | FromDiscord | <ravinder387> NimMain() produce garbage collected code. if i convert nim code equivalent to python c api code.. i guess python GC free memory on behalf of me. how to embedded nim in other language? |
06:32:30 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4MsV |
06:32:39 | FromDiscord | <ravinder387> i try to call nim in R. but it didn't work |
06:33:49 | FromDiscord | <Elegantbeef> If you're using orc/arc it does not matter |
06:33:50 | FromDiscord | <Elegantbeef> It's GC'd in Nim |
06:33:51 | FromDiscord | <Elegantbeef> As long as you do not return resources across the bridge it'll be GC'd |
06:36:25 | FromDiscord | <ravinder387> In reply to @Elegantbeef "If you're using orc/arc": I'm using nim-2.0.0 -mm:orc by default |
06:36:38 | FromDiscord | <Elegantbeef> Right |
06:36:43 | FromDiscord | <Elegantbeef> Like i said it will free gc'd memory |
06:36:54 | FromDiscord | <Elegantbeef> Do not share GC'd resources across the dll barrirer |
06:36:55 | FromDiscord | <Elegantbeef> be happy |
06:40:26 | FromDiscord | <ravinder387> gc'd what does it mean? |
06:41:48 | FromDiscord | <Elegantbeef> Garbage collected |
06:48:44 | FromDiscord | <ravinder387> then why we don't write NimMain() when we are calling nim from javascript? |
06:49:18 | FromDiscord | <Elegantbeef> Cause Nim compiled to JS uses JS? |
06:50:33 | FromDiscord | <Elegantbeef> JS has top level code it does not need NimMain |
06:51:28 | FromDiscord | <ravinder387> JS has top level code? means |
06:51:45 | FromDiscord | <ravinder387> import statement you are talking about |
06:51:53 | FromDiscord | <Elegantbeef> That'svalid |
06:51:55 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4MsX |
06:53:27 | FromDiscord | <ravinder387> you mean function declare, function definition, function call in same file |
06:53:37 | FromDiscord | <ravinder387> that's top levelc code |
06:55:47 | FromDiscord | <Elegantbeef> Top level code is running code outside of a function |
06:56:39 | FromDiscord | <Elegantbeef> To do that with a DLL you make a function that has all your top level code in it |
06:56:46 | FromDiscord | <Elegantbeef> Ala NimMain |
07:00:59 | * | dtomato8 joined #nim |
07:01:10 | * | dtomato quit (Ping timeout: 264 seconds) |
07:01:11 | * | dtomato8 is now known as dtomato |
07:44:00 | FromDiscord | <ravinder387> undefined reference to `NimMain' errror when i compile by makevars |
07:44:32 | FromDiscord | <ravinder387> CFLAGS = -I../inst/include/fib_d -I../inst/include/lib ../inst/include/fib_d/.c |
07:46:03 | FromDiscord | <ravinder387> NimMain is only useful.. when call from C with main f(x) other wise I din't require it |
08:03:15 | FromDiscord | <Elegantbeef> You do not link the library |
08:07:01 | FromDiscord | <ravinder387> i compile with nim c --noMain --noLinking https://media.discordapp.net/attachments/371759389889003532/1178245509354373150/Screenshot_2023-11-26_133634.png?ex=657571a4&is=6562fca4&hm=ec985c6e935433b66f742d53d1e3fa1be8f29f5c2c01393410a5b93b7968fd38& |
08:07:23 | FromDiscord | <ravinder387> how to do with makefile |
08:11:18 | * | krux02 joined #nim |
08:11:34 | Amun-Ra | if your library has a function that must be call first, place NimMain there, if there's not such function, create one |
08:14:33 | Amun-Ra | called* |
08:15:32 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#ix=4Mti |
08:16:16 | FromDiscord | <ravinder387> By error i can say that makefile don't able to find fib and NimMain() things |
08:38:11 | * | om3ga quit (Ping timeout: 252 seconds) |
08:45:43 | FromDiscord | <xtrayambak> sent a code paste, see https://play.nim-lang.org/#ix=4Mtm |
08:45:55 | FromDiscord | <Elegantbeef> Destructors |
08:46:05 | FromDiscord | <xtrayambak> Yeah, those work too |
08:48:32 | * | xet7 joined #nim |
09:34:08 | * | krux02 quit (Remote host closed the connection) |
10:00:38 | FromDiscord | <dlesnoff> Does someone know where I can find the exact differences between Math.pow in JS and pow, powf functions in C++ ?↵I am not familiar with JS and would like to know special behavior that is proper to JS like 1^∞ = NaN |
10:10:47 | FromDiscord | <nnsee> In reply to @jiezron "Does someone know where": refer to https://262.ecma-international.org/#sec-numeric-types-number-exponentiate |
10:12:52 | FromDiscord | <nnsee> and something like https://en.cppreference.com/w/cpp/numeric/math/pow |
10:12:55 | FromDiscord | <dlesnoff> Thanks a lot! ❤️ this community who answers on Sunday 😮 |
10:13:06 | FromDiscord | <nnsee> or the cpp specification itself if you can get your hands on it haha |
10:20:33 | FromDiscord | <dlesnoff> In reply to @nnsee "and something like https://en.cppreference.com/w/cp": I already checked the C++ reference documentation, I have a PR currently for the stdlib: https://github.com/nim-lang/Nim/pull/20898↵I would like to go the C++/Julia/Rust way of doing things. I have to modify Math.pow output for each difference between specifications. Wish me luck 😂 |
10:34:47 | FromDiscord | <ebahie> sent a code paste, see https://play.nim-lang.org/#ix=4MtF |
10:42:12 | FromDiscord | <dlesnoff> > qui ce connecte↵qui se connecte↵(Glad to see other French devs programming in Nim btw) |
10:43:55 | FromDiscord | <ebahie> In reply to @jiezron "> qui ce connecte": oh yea lmao |
11:05:53 | FromDiscord | <dlesnoff> User-Agent value in the client.headers JSON spans multiple lines but you haven't used a """ (triple-quoted) string. Is this normal?↵You may need to ensure you get the string representation of self.token.↵For the position of the headers in the code, you may look at this SO post. I personally don't know as I have never done this kind of network thing:↵https://stackoverflow.com/questions/75069491/how-to-make-a-http-request-in-nim |
11:13:17 | FromDiscord | <ebahie> In reply to @jiezron "User-Agent value in the": the useragent is just one line, i think discord's codeblocks formatted it weirdly |
11:13:26 | FromDiscord | <ebahie> ill check out the post |
11:19:03 | FromDiscord | <intellij_gamer> Maybe pass the `Authorization` header into the request proc instead of setting it once for the client. Means it'll stay in sync with what `self.token` is |
11:20:34 | FromDiscord | <ebahie> In reply to @intellij_gamer "Maybe pass the `Authorization`": good idea ill try it out |
11:22:09 | FromDiscord | <ebahie> would making a template so i don't need to repeatedly write the headers work? |
12:02:48 | FromDiscord | <intellij_gamer> They get merged iirc so you should only need to write the auth header.↵Could probably just make that a template to access self.token, or make your own request function which just calls the normal request and adds the header |
12:21:07 | * | PMunch joined #nim |
12:47:34 | * | azimut joined #nim |
13:45:17 | FromDiscord | <Phil> Man, I need somebody smarter than me on owlkettle, my brain hurts |
13:49:09 | FromDiscord | <Phil> sent a long message, see http://ix.io/4Mum |
13:52:16 | PMunch | Hmm, it sounds like you're over-complicating things a bit.. |
13:54:32 | PMunch | Doesn't the Gtk callback mechanism support passing arbitrary data through a void pointer? |
13:55:11 | FromDiscord | <ravinder387> I want to compile nim into shared lib in such a way that I can call into c file |
13:55:39 | PMunch | @ravinder387, that's doable :) |
13:55:54 | FromDiscord | <ravinder387> how? |
13:56:41 | PMunch | Well the short answer is --app:lib --noMain |
13:56:51 | PMunch | Th long answer is https://peterme.net/dynamic-libraries-in-nim.html |
13:58:23 | * | jmdaemon quit (Ping timeout: 260 seconds) |
13:59:16 | PMunch | Note though that if you unload the DLL you might have some dangling memory: https://github.com/nim-lang/Nim/issues/21403 |
14:15:30 | FromDiscord | <dlesnoff> How do I check whether assertions are turned on? |
14:15:51 | Amun-Ra | dlclose leaving allocated memory is a common issue among some libraries, some GTK versions, X11 or XCB come to my mind |
14:15:59 | FromDiscord | <dlesnoff> Sorry found it |
14:18:42 | FromDiscord | <Phil> In reply to @PMunch "Doesn't the Gtk callback": The thing is that this is an owlkettle specific issue.↵Since owlkettle has its own DSL to represent widgets you run into issues when strictly speaking you need to define a widget "twice" in a sense.↵The DSL has no elegant solution for that and neither does the XML builder approach of GTK from what I can see (Which is kinda a DSL to define a widget tree but in very ugly format) |
14:19:44 | FromDiscord | <Phil> So I can't really fix it on the GTK side of things since I first need to express the construct (A single instance of a widget that is used by multiple other widgets, in this case the StackWidget used by a StackSwitcher widget and whatever other Widget you put it into) so that it can generate the necessary GTK-tree via the c-calls |
14:20:06 | FromDiscord | <Phil> (edit) "So I can't really fix it on the GTK side of things since I first need to express the construct (A single instance of a widget that is used by multiple other widgets, in this case the StackWidget used by a StackSwitcher widget and whatever other Widget you put it into) ... so" added "in owlkettle" |
14:44:39 | * | rockcavera joined #nim |
15:13:56 | * | def- quit (Quit: -) |
15:14:07 | * | azimut quit (Ping timeout: 240 seconds) |
15:14:32 | * | def- joined #nim |
15:15:52 | * | azimut joined #nim |
15:16:36 | FromDiscord | <michaelb.eth> iiuc, sounds similar to the complex relationship between the DOM and HTML |
15:19:20 | * | def- quit (Client Quit) |
15:27:45 | * | FromDiscord quit (Remote host closed the connection) |
15:28:05 | Amun-Ra | hmm, will `const foo {.booldefine.} = false or defined nimdoc` work? |
15:28:06 | * | FromDiscord joined #nim |
15:28:11 | * | FromDiscord quit (Remote host closed the connection) |
15:28:24 | * | NimEventer quit (Remote host closed the connection) |
15:28:29 | * | FromDiscord joined #nim |
15:28:32 | Amun-Ra | it does |
15:28:53 | * | NimEventer joined #nim |
15:29:01 | FromDiscord | <millymox> is happyx production ready? |
15:39:09 | * | def- joined #nim |
15:41:40 | * | lucasta joined #nim |
15:52:39 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4Mv7 |
15:56:51 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Mv9 |
16:05:35 | FromDiscord | <aintea> Still get an error |
16:05:43 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4Mve |
16:06:14 | FromDiscord | <aintea> sent a code paste, see https://paste.rs/52SGT |
16:06:19 | FromDiscord | <aintea> Still get an error and I have no idea why |
16:06:54 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4Mvf |
16:18:01 | FromDiscord | <demotomohiro> It is because `T` in `|>` was bind to float but `add_one` parameter is `int`.↵And |> is not a valid Nim identifier.↵So you need to enclose it with backtick when you call it as function. |
16:19:50 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4Mvm |
16:31:51 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4Mvo |
16:32:12 | FromDiscord | <aintea> sent a code paste, see https://play.nim-lang.org/#ix=4Mvp |
16:32:22 | FromDiscord | <aintea> Wait, it worked |
16:33:21 | FromDiscord | <aintea> Thanks, have no idea why it didn't worked before (except that `float` I'm pretty much sure it was correct) |
16:50:24 | FromDiscord | <Phil> In reply to @michaelb.eth "iiuc, sounds similar to": I mean, functionally they're the same thing.↵You have a textual representation of the gui-tree and sometimes that just needs complex interactions and connections that you can not represent that way |
16:51:49 | * | lucasta quit (Quit: Leaving) |
17:09:07 | * | Guest695 joined #nim |
17:09:17 | * | Guest695 left #nim (#nim) |
17:24:43 | * | systemonia joined #nim |
17:25:19 | * | azimut quit (Ping timeout: 240 seconds) |
17:26:02 | * | azimut joined #nim |
17:26:41 | * | systemonia quit (Client Quit) |
17:26:56 | * | systemonia joined #nim |
17:40:27 | * | systemonia quit (Quit: Konversation terminated!) |
17:48:41 | FromDiscord | <michaelb.eth> okay, so it's a retained mode scene graph:↵https://blog.gtk.org/2020/04/24/custom-widgets-in-gtk-4-drawing/ |
17:57:19 | * | azimut quit (Ping timeout: 240 seconds) |
18:01:29 | * | azimut joined #nim |
18:18:23 | FromDiscord | <eszetera> https://tenor.com/view/squid-clear-myself-gif-meme-gif-25725527 |
18:48:36 | * | krux02 joined #nim |
18:58:47 | FromDiscord | <Phil> In reply to @michaelb.eth "okay, so it's a": Isn't all of GTK retained mode? I was under the impression that's a paradigm that the entire framework/lib you work with operates under since it's stateful vs. stateless |
19:03:15 | NimEventer | New Nimble package! unroll - unroll for-loops (and map into seq/array) at compile-time in nim, see https://github.com/choltreppe/unroll |
19:13:16 | NimEventer | New Nimble package! sqids - Official Nim port of Sqids. Generate short YouTube-looking IDs from numbers., see https://github.com/sqids/sqids-nim |
19:53:32 | FromDiscord | <odexine> Oh cool |
20:04:21 | FromDiscord | <Phil> Man, we need Rxnim.↵Particularly, Rxnim not written by a dumbass like me |
20:11:36 | * | lucasta joined #nim |
20:33:40 | FromDiscord | <Chronos [She/Her]> I wonder if there's an idiomatic way to use the results library tbh |
20:35:59 | FromDiscord | <Chronos [She/Her]> Questionable just doesn't feel great to use imo |
20:42:27 | FromDiscord | <Chronos [She/Her]> Also out of curiosity: Is it better to reuse one singular AsyncHttpClient? |
20:43:49 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Questionable just doesn't feel": https://github.com/fabriciopashaj/yarolin |
20:44:07 | FromDiscord | <fabric.input_output> it's right there |
20:44:08 | FromDiscord | <Chronos [She/Her]> Or is there a better library for async HTTP requests since it seems like Nim has some issues with that |
20:45:17 | FromDiscord | <fabric.input_output> In reply to @fabric.input_output "https://github.com/fabriciopashaj/yarolin": that's why I made it, because questionable depended on something else for results and it failed |
20:45:37 | FromDiscord | <Chronos [She/Her]> Oh wow, that actually looks pretty nice |
20:47:10 | FromDiscord | <Chronos [She/Her]> In reply to @fabric.input_output "that's why I made": Thanks for this! |
20:47:25 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Thanks for this!": thank you for using it |
20:47:33 | FromDiscord | <fabric.input_output> if you do |
20:49:06 | FromDiscord | <ElegantBeef> Any moment now this bridge will spam messages from me |
20:49:08 | FromDiscord | <ElegantBeef> I believe |
20:49:16 | FromDiscord | <michaelb.eth> In reply to @fabric.input_output "that's why I made": “failed” as in the dependency didn’t resolve via nimble? |
20:49:28 | FromDiscord | <ElegantBeef> Those operators are horrific 😄 |
20:49:58 | FromDiscord | <Chronos [She/Her]> Huh this is weird... Can't use Yarolin in my code |
20:50:03 | FromDiscord | <fabric.input_output> In reply to @michaelb.eth "“failed” as in the": it was smth like a typo in the name of an import, like an extra or missing s somewhere |
20:50:19 | FromDiscord | <Chronos [She/Her]> Installed it via Nimble, but my code doesn't see it as valid |
20:50:19 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Huh this is weird...": what how why where |
20:50:34 | FromDiscord | <Chronos [She/Her]> `/home/chronos/test/main.nim(1, 8) Error: cannot open file: yarolin` |
20:50:38 | FromDiscord | <ElegantBeef> don't forget when |
20:50:43 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Mya |
20:50:48 | FromDiscord | <ElegantBeef> Did you add the requirement to your nimble file? |
20:50:52 | FromDiscord | <Chronos [She/Her]> (edit) "https://play.nim-lang.org/#ix=4Mya" => "https://play.nim-lang.org/#ix=4Myb" |
20:50:55 | FromDiscord | <Chronos [She/Her]> No nimble file here |
20:51:09 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4Myc |
20:51:11 | * | droidrage joined #nim |
20:51:18 | PMunch | @Phil, Rxnim? |
20:51:37 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Myd |
20:51:37 | FromDiscord | <Chronos [She/Her]> but everything else is nice |
20:51:42 | FromDiscord | <ElegantBeef> fabricio is there anything like the `success` and `error` templates here? https://play.nim-lang.org/#ix=4My8 |
20:51:47 | FromDiscord | <Chronos [She/Her]> In reply to @fabric.input_output "oh you have to": Aah, that should be put on the README :p |
20:51:59 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Aah, that should be": will do |
20:52:11 | FromDiscord | <Phil> An implementation of observables and subjects, reactive datastructures that execute callbacks when their values get updated, basically effortless syncing of values where one depends upon the other |
20:52:20 | FromDiscord | <ElegantBeef> Atleast the way I see it if you assign something to an error you generally want to return |
20:54:41 | FromDiscord | <michaelb.eth> sent a long message, see http://ix.io/4Myg |
20:54:53 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "fabricio is there anything": oh there is the `.try` macro |
20:55:05 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Myh |
20:55:26 | FromDiscord | <ElegantBeef> I mean that's not unpacking though |
20:55:46 | FromDiscord | <Chronos [She/Her]> `var a = Result[string, int] !+ "wah"` works fine, however |
20:55:49 | FromDiscord | <ElegantBeef> The template I shared returns inside a function when you write to the `result` variable |
20:56:17 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4Myi |
20:56:30 | FromDiscord | <ElegantBeef> Calling `doThing` will never echo |
20:56:39 | FromDiscord | <Chronos [She/Her]> I may just steal the template you have Beef :P |
20:56:47 | FromDiscord | <ElegantBeef> Well it's not ideal |
20:56:57 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Ah this code fails": because lhs of `!` is the errror, like in zig |
20:56:58 | FromDiscord | <ElegantBeef> It does not work inside of expressions and complicated for loops |
20:57:12 | FromDiscord | <Chronos [She/Her]> In reply to @fabric.input_output "because lhs of `!`": Aaaaah |
20:57:15 | * | qwestion joined #nim |
20:57:30 | FromDiscord | <ElegantBeef> Yea the operators are a bit of a joke 😄 |
20:57:36 | FromDiscord | <Chronos [She/Her]> Threw me off, even with reading the README :p |
20:57:50 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4Myj |
20:57:51 | FromDiscord | <Chronos [She/Her]> Welp, stealing your thing Beef :p |
20:57:58 | FromDiscord | <ElegantBeef> Cheers |
20:58:04 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Myk |
20:58:22 | FromDiscord | <Chronos [She/Her]> In reply to @elegantbeef "Cheers": You have a repo storing this stuff, right? Is it under a license or? |
20:58:41 | FromDiscord | <ElegantBeef> https://github.com/beef331/nimtrest/wiki/Code-snippets |
20:58:54 | FromDiscord | <ElegantBeef> I mean it's a wiki so uh.... |
20:59:06 | FromDiscord | <ElegantBeef> I do not have a lawyer so good luck getting sued |
20:59:10 | FromDiscord | <Chronos [She/Her]> Lol |
21:00:15 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "I mean that's not": I don't know why you would need that macro, I can implement it for you okay but I don't see the significance |
21:00:38 | FromDiscord | <ElegantBeef> In my view you should not have a procedure continuing to run after assigning the result |
21:00:56 | FromDiscord | <fabric.input_output> you have `returnVal` and `returnErr` |
21:01:05 | FromDiscord | <ElegantBeef> Atleast in these afformative result like environment |
21:01:08 | FromDiscord | <Elegantbeef> I'd personally suggest replacing those ugly operators with a `succeed` and `fail` template 😄 |
21:01:09 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4My8 something like this stuff here |
21:01:14 | FromDiscord | <ElegantBeef> Assigning result should mean the procedure is done |
21:01:20 | FromDiscord | <ElegantBeef> Ah there's the bastard |
21:01:53 | FromDiscord | <fabric.input_output> In reply to @Elegantbeef "I'd personally suggest replacing": yo it's the real beef I thought you had changed pfp |
21:02:18 | FromDiscord | <nnsee> beef on discord!? |
21:02:25 | FromDiscord | <ElegantBeef> ‽ |
21:02:37 | FromDiscord | <nnsee> what is this |
21:02:39 | FromDiscord | <ElegantBeef> The bridge is only one way right now |
21:02:45 | FromDiscord | <nnsee> not the interrobang |
21:02:46 | FromDiscord | <nnsee> oh |
21:02:47 | FromDiscord | <ElegantBeef> So all you lot should come use matrix |
21:02:53 | FromDiscord | <nnsee> fine by me |
21:02:59 | FromDiscord | <nnsee> ... if everyone else moved |
21:03:07 | FromDiscord | <ElegantBeef> That's what everyone says |
21:03:11 | FromDiscord | <nnsee> unfortunately I have too many people here |
21:03:17 | FromDiscord | <nnsee> yep, that's the irony of it |
21:03:19 | FromDiscord | <ElegantBeef> Jesus let the people go |
21:03:23 | FromDiscord | <ElegantBeef> Fucking hostage takers |
21:03:26 | PMunch | @Phil, maybe something like pararules would suit you? |
21:03:35 | FromDiscord | <Elegantbeef> Rumour of my death is greatly exaggerated |
21:04:03 | FromDiscord | <nnsee> In reply to @elegantbeef "Jesus let the people": never |
21:04:14 | FromDiscord | <nnsee> and my name is Rasmus, not Jesus |
21:04:26 | FromDiscord | <fabric.input_output> In reply to @fabric.input_output "you have `returnVal` and": do these do what you wanted @ElegantBeef |
21:04:41 | FromDiscord | <Chronos& [She/Her]> I exist |
21:04:41 | FromDiscord | <Elegantbeef> Ping |
21:04:41 | FromDiscord | <Chronos& [She/Her]> Wow this is really dead |
21:04:42 | FromDiscord | <Chronos& [She/Her]> Lol↵(@fabric.input_output) |
21:05:03 | FromDiscord | <nnsee> how hard is it really to write a functional bridge bot |
21:05:11 | FromDiscord | <ElegantBeef> It's just wrapping REST API |
21:05:17 | FromDiscord | <ElegantBeef> So have at it |
21:05:27 | FromDiscord | <fabric.input_output> In reply to @Elegantbeef "Ping": pong |
21:05:49 | FromDiscord | <ElegantBeef> I guess it's easier if you do not use Nim |
21:06:08 | FromDiscord | <ElegantBeef> But the nim matrix sdk is in a state of undeveloped hell, tandy's repo is the most developed, but still not that developed |
21:06:11 | FromDiscord | <ElegantBeef> They made a client using it iirc |
21:06:29 | FromDiscord | <ElegantBeef> In reply to @fabric.input_output "do these do what": Yea it's close enough |
21:06:41 | FromDiscord | <nnsee> I discovered an app the other day, Beeper, which basically combines a whole bunch of services into a single app. Nothing novel, these apps have come and gone, but what interested me was that they are using Matrix as the "home" server for the bridges for everything |
21:06:56 | FromDiscord | <ElegantBeef> Yea matrix has a shit load of puppet and normal bridges |
21:07:03 | FromDiscord | <Elegantbeef> Ping |
21:07:08 | FromDiscord | <Elegantbeef> Oh hey we're back |
21:07:39 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "Yea it's close enough": I tried to make it as feature complete as possible that's the reason for all the ridiculous operators like `!+` and `=!-` |
21:08:15 | FromDiscord | <fabric.input_output> do not hesitate to ping me if you want a feature or face an obstacle |
21:09:39 | FromDiscord | <Elegantbeef> Also why do you use so many macros that are just templates? |
21:09:43 | FromDiscord | <Elegantbeef> Like all of your macros with `genSym` then `quote do` are just templates |
21:09:49 | * | PMunch quit (Quit: leaving) |
21:10:29 | FromDiscord | <fabric.input_output> because I'm not that good with templates and macros are easier to get right for me |
21:10:42 | FromDiscord | <Elegantbeef> But they're literally identical 😄 |
21:11:17 | FromDiscord | <fabric.input_output> can you define variables of `genSym`ed idents in templates and use them? |
21:11:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Myn |
21:12:44 | FromDiscord | <ElegantBeef> God damn bridge |
21:12:54 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/1178443281508610098/image.png?ex=657629d4&is=6563b4d4&hm=b220c8acf7affa38cdcffe91068f511ac380ce97ff918da1c0b3a3d6a2a7dea2& |
21:12:56 | FromDiscord | <ElegantBeef> To beat the bridge |
21:13:29 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4Myo |
21:13:32 | FromDiscord | <Elegantbeef> Symbols are implicitly 'genSym'd\` inside templates |
21:13:32 | FromDiscord | <Elegantbeef> Templates are hygenic in Nim, which means any symbols that are introduced cannot be accessed unless they're marked `{.inject.}` or the template is marked `{.dirty.}` |
21:13:37 | FromDiscord | <ElegantBeef> For a simple example |
21:13:38 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4Myp |
21:14:18 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4Myq |
21:14:20 | FromDiscord | <ElegantBeef> Nope |
21:14:28 | FromDiscord | <ElegantBeef> The code is pasted where you call it directly just like macros |
21:14:44 | FromDiscord | <fabric.input_output> I thought they formed a separate scope |
21:14:47 | FromDiscord | <ElegantBeef> The only difference is that the macro is evaluated code on the VM, whereas a a template is a replacement |
21:14:48 | FromDiscord | <ElegantBeef> Nope |
21:14:59 | FromDiscord | <ElegantBeef> You might've thought that since they are hygenic and you cannot access the variables |
21:15:09 | FromDiscord | <ElegantBeef> If you want to make a scope inside a template you do `if true:` |
21:15:40 | FromDiscord | <fabric.input_output> I guess templates are faster than macros |
21:15:46 | FromDiscord | <fabric.input_output> I shall refactor |
21:16:24 | FromDiscord | <fabric.input_output> now I have some reason to do it |
21:19:04 | FromDiscord | <ElegantBeef> Your reliance on the `result` variable did make me realise that there can be a `error` overloaded template 😄 |
21:21:28 | FromDiscord | <sOkam! 🫐> Is it possible, by any chance, to send the output of `./build_all.sh` into a folder different than `./bin/` when initializing the compiler after doing `clone NimRepoURL`?↵Was thinking of something like doing `MYNEWPATH=/path/to/somewhere ./build_all.sh` or similar |
21:21:36 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4Myt |
21:21:48 | FromDiscord | <sOkam! 🫐> (edit) "`clone" => "`git clone" |
21:22:20 | FromDiscord | <ElegantBeef> I don't think so sokam |
21:22:38 | FromDiscord | <ElegantBeef> I might be wholly wrong |
21:23:01 | FromDiscord | <sOkam! 🫐> i didn't find any clues in the scripts themselves, the paths seemed hardcoded. but was asking in case I missed something |
21:23:53 | FromDiscord | <ElegantBeef> It should just use `--outDir` |
21:24:18 | FromDiscord | <sOkam! 🫐> in bash? |
21:24:33 | FromDiscord | <ElegantBeef> In the config file wherever it is |
21:26:13 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4Myx |
21:26:29 | FromDiscord | <ElegantBeef> Neither of those work in expressions |
21:27:10 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4Myy |
21:27:44 | * | lucasta quit (Remote host closed the connection) |
21:27:52 | FromDiscord | <ElegantBeef> Before you say "returnErr` works fine for that, you have more complicated expressions like case statements |
21:28:14 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4MyA |
21:28:50 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=4MyC |
21:29:07 | FromDiscord | <ElegantBeef> `return` does not work with expressions as such any exhaustive expression logic fails |
21:29:23 | FromDiscord | <ElegantBeef> Which means in the above code in the case of `B` the value is always an error on the result instead of a CTE on writing |
21:30:59 | FromDiscord | <ElegantBeef> Of course sadly this does not work for expression blocks outside of procedures and you do need to use `failure` and `success` in those cases |
21:31:41 | FromDiscord | <ElegantBeef> But it's fairly expressive inside of procedures methinks, I could be wrong and just bikeshedding ideas 😛 |
21:31:57 | FromDiscord | <fabric.input_output> sent a code paste, see https://play.nim-lang.org/#ix=4MyE |
21:32:11 | FromDiscord | <ElegantBeef> How does that stolve the procedure example? |
21:32:12 | FromDiscord | <fabric.input_output> (edit) "https://play.nim-lang.org/#ix=4MyE" => "https://play.nim-lang.org/#ix=4MyF" |
21:32:22 | FromDiscord | <ElegantBeef> (edit) "stolve" => "solve" |
21:32:31 | FromDiscord | <fabric.input_output> I was responding to the failure/success thing |
21:32:36 | FromDiscord | <ElegantBeef> Ah |
21:33:01 | FromDiscord | <ElegantBeef> `R.error("foo")` is a nice syntax aswell |
21:33:20 | FromDiscord | <sOkam! 🫐> does the compiler understand being sent options through any environment variable? 🤔 |
21:33:26 | FromDiscord | <ElegantBeef> Not that i know of |
21:33:44 | FromDiscord | <ElegantBeef> Could also take instances so you could do `result.error("foo")` and just do `typeof(result)` inside the `error` template |
21:33:49 | FromDiscord | <ElegantBeef> Or whatever you prefer |
21:33:57 | FromDiscord | <ElegantBeef> This way it's consistent across expressions |
21:34:44 | FromDiscord | <ElegantBeef> I'm very much bikeshedding though |
21:34:44 | FromDiscord | <fabric.input_output> ok but you have the operators which are shorter and should not clutter the code because you should not do those stuff heavily |
21:34:53 | FromDiscord | <ElegantBeef> Operators are awful |
21:34:58 | FromDiscord | <fabric.input_output> boo |
21:35:03 | FromDiscord | <ElegantBeef> `!+` not plus |
21:35:09 | FromDiscord | <ElegantBeef> `!-` not minus |
21:35:18 | FromDiscord | <fabric.input_output> you are just brainwashed |
21:35:36 | FromDiscord | <ElegantBeef> Yea the 5G does that to you |
21:35:47 | FromDiscord | <sOkam! 🫐> `a !+ b` better than `notPlus(a,b)` though |
21:35:56 | FromDiscord | <ElegantBeef> As if notPlus makes any senss |
21:36:06 | FromDiscord | <sOkam! 🫐> yeah i know, but it was your example lol |
21:36:23 | FromDiscord | <ElegantBeef> My issue is it's overloading operators for a nonsensical situation |
21:36:25 | FromDiscord | <fabric.input_output> I mean the `!` is for results and the `+` ro `-` determines if it is success or failure |
21:36:32 | FromDiscord | <sOkam! 🫐> this case is kinda easy for the fuctnion version, but for nested calls operators are hella useful |
21:36:37 | FromDiscord | <fabric.input_output> (edit) "ro" => "or" |
21:36:58 | FromDiscord | <ElegantBeef> Right I know what it's supposed to symbolise but it does not make it any more readable 😄 |
21:37:41 | FromDiscord | <ElegantBeef> It's a infix operator that just does not jive with what it's doing in my braine |
21:37:42 | FromDiscord | <ElegantBeef> (edit) "braine" => "brain" |
21:38:07 | FromDiscord | <fabric.input_output> I went the function way with the operators so instead of providing macros that do overloads for operators of the types I made macros like `mapIt` and `map2AB` |
21:38:32 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "It's a infix operator": you probably old |
21:38:40 | FromDiscord | <ElegantBeef> `R.error(...)` and `R.success(...)` although more wordy is more indictive, but we're so deep in the bike shed we're now thinking of what to name the screw on the outlet |
21:38:41 | FromDiscord | <fabric.input_output> lol |
21:38:44 | FromDiscord | <ElegantBeef> Is 24 old? |
21:38:49 | FromDiscord | <ElegantBeef> Am I over the hill already |
21:38:50 | FromDiscord | <ElegantBeef> Fuck |
21:38:59 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "Is 24 old?": older than me |
21:39:09 | FromDiscord | <ElegantBeef> Let me find a bus to jump in front of, be back in 10 |
21:39:24 | FromDiscord | <ElegantBeef> Oh wait I'm in bum fuck nowhere, what's public transit |
21:39:28 | FromDiscord | <sOkam! 🫐> could this affect the compiler bootstrapping process itself too, if I added a `nim.cfg` file somewhere? 🤔 https://media.discordapp.net/attachments/371759389889003532/1178449970370711695/image.png?ex=6576300f&is=6563bb0f&hm=67b3840b620e96f17b28775094c9b8e910f8d9e46d9c90b79c0e538ee69d51df& |
21:39:52 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "Oh wait I'm in": where do you live lol |
21:40:05 | FromDiscord | <ElegantBeef> Rural Canada is as much as I'll give |
21:40:44 | FromDiscord | <sOkam! 🫐> beef will be the first to call when the winter is coming |
21:40:57 | FromDiscord | <fabric.input_output> In reply to @elegantbeef "Rural Canada is as": cold there? |
21:41:13 | FromDiscord | <sOkam! 🫐> beef snow, if you get the reference 🙂 |
21:41:24 | FromDiscord | <ElegantBeef> Not right now, it's a rather tame year so far |
21:41:27 | FromDiscord | <ElegantBeef> only -6 atm |
21:41:40 | FromDiscord | <sOkam! 🫐> "only" 🥶 |
21:41:45 | FromDiscord | <ElegantBeef> Ask again in the depth of winter, might be in the -40s |
21:42:05 | FromDiscord | <fabric.input_output> it's 8 degrees here and feels cold af |
21:42:24 | FromDiscord | <sOkam! 🫐> In reply to @elegantbeef "Ask again in the": my goodness |
21:42:42 | FromDiscord | <ElegantBeef> Well that's with windchil if it's any consolation |
21:42:52 | FromDiscord | <ElegantBeef> So as long as you have a windbreaker it's only like -35 |
21:43:10 | FromDiscord | <fabric.input_output> you got a furnace |
21:43:26 | FromDiscord | <ElegantBeef> Of course how else do you stay warm in that temperature |
21:43:34 | FromDiscord | <ElegantBeef> Heat pumps stop working effectively at -20 |
21:43:56 | FromDiscord | <sOkam! 🫐> that's something i had no idea about. lol, that's insane |
21:44:20 | FromDiscord | <fabric.input_output> did you have a bountiful harvest this year |
21:44:27 | FromDiscord | <ElegantBeef> I mean I'm not that rural |
21:44:29 | FromDiscord | <fabric.input_output> to survive the harsh winter |
21:47:15 | FromDiscord | <ElegantBeef> Another silly thing you could do instead of `!+` is `as` `"Hello" as R"` |
21:47:42 | FromDiscord | <Chronos [She/Her]> Cursed |
21:47:53 | FromDiscord | <fabric.input_output> no no the operator is better |
21:48:01 | FromDiscord | <fabric.input_output> even makes more sense imo |
21:48:09 | FromDiscord | <ElegantBeef> To each their own |
21:48:10 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Cursed": you enjoying the lib? |
21:48:59 | FromDiscord | <ElegantBeef> There we go `"Hello" as -R` and `"Hello" as +R` 😛 |
21:49:31 | FromDiscord | <ElegantBeef> Value as positive R and value as negative R, it even reads better! |
21:50:21 | FromDiscord | <fabric.input_output> you can't do that with `string!string` in place of `R` without parens |
21:50:28 | FromDiscord | <ElegantBeef> Good |
21:50:45 | FromDiscord | <fabric.input_output> you can do it with mine `string!string !+ "Hello"` |
21:51:39 | FromDiscord | <sOkam! 🫐> to answer myself from before, the `./bin/nim` path is hardcoded in multiple places. not gonna work 😦 |
21:52:02 | FromDiscord | <ElegantBeef> Why does it even matter where it builds? |
21:53:24 | FromDiscord | <sOkam! 🫐> sent a long message, see http://ix.io/4MyR |
21:53:53 | FromDiscord | <sOkam! 🫐> haven't figured out a way to do that without copying the ./bin/ folder or similars |
21:54:50 | FromDiscord | <michaelb.eth> In reply to @heysokam "haven't figured out a": have you looked at nimbus-build-system and how it builds/manages Nim as a submodule? |
21:55:08 | FromDiscord | <sOkam! 🫐> In reply to @michaelb.eth "have you looked at": haven't. where could I find it? |
21:55:21 | FromDiscord | <sOkam! 🫐> also, nimbus is not the same as nimble, i assume? |
21:55:33 | FromDiscord | <michaelb.eth> https://github.com/status-im/nimbus-build-system |
21:55:42 | FromDiscord | <ElegantBeef> Nimbus is status' make wrapper practically |
21:56:55 | FromDiscord | <michaelb.eth> it can be used for any Nim project, but came about because Status wanted reproducible builds for nimbus and nimble wasn’t suitable |
21:58:09 | FromDiscord | <michaelb.eth> tbh, it can be kind of a PITA to work with at first, but once you get used to it it’s not terrible |
22:00:44 | FromDiscord | <sOkam! 🫐> In reply to @michaelb.eth "https://github.com/status-im/nimbus-build-system": https://github.com/status-im/nimbus-build-system/blob/master/scripts/build_nim.sh↵so this file is essentially what I want to avoid, lol |
22:00:57 | FromDiscord | <sOkam! 🫐> i don't want to reinvent the whell, not needed for my case |
22:01:05 | FromDiscord | <sOkam! 🫐> (edit) "whell," => "wheel," |
22:02:20 | FromDiscord | <sOkam! 🫐> the `add_submodule.sh` script has some great ideas, though. thx for recommending it |
22:02:29 | FromDiscord | <michaelb.eth> sure thing |
22:02:54 | FromDiscord | <Chronos [She/Her]> In reply to @fabric.input_output "you enjoying the lib?": Took a break from programming for the rest of the day, I think I'm burnt out |
22:05:11 | FromDiscord | <fabric.input_output> In reply to @chronos.vitaqua "Took a break from": I'm on the brink of headache here, overdid myself today. hopefully sleep will fix it |
22:05:51 | FromDiscord | <fabric.input_output> I despise headaches |
22:08:37 | * | jmdaemon joined #nim |
22:16:50 | * | rockcavera quit (Remote host closed the connection) |
22:29:40 | FromDiscord | <sOkam! 🫐> is the stable release branches format standarized for the nim repo?↵as in, if tomorrow 2.1 is released, will there be a new `version-2-1` branch created?↵I can only see 2 branches with that format, so wondering if that's because its the only two supported branches, or if its because the branch names are not standarized |
22:33:29 | FromDiscord | <Phil> In reply to @PMunch "<@180601887916163073>, maybe something like": Pararules looks like introducing an entirely new paradigm and thus a bit heavy on the conceptual side.↵Keep in mind that is still for owlkettle, I just want a mechanism for callbacks to fire whenever you update a reference value of sorts |
23:05:47 | FromDiscord | <Elegantbeef> Devel is always the next stable and is an odd number |
23:05:47 | FromDiscord | <Elegantbeef> version-x-y is for previous releases that are still 'supported' |
23:14:37 | * | targz77 joined #nim |
23:23:58 | FromDiscord | <Chronos [She/Her]> In reply to @fabric.input_output "I despise headaches": Fair |
23:36:25 | * | xet7 quit (Remote host closed the connection) |