00:02:58 | FromDiscord | <root> does anyone now what documentation i would need to read to learn to make a rev shell in nim? ive been trying to figure it out a while and i just cant |
00:03:49 | FromDiscord | <Elegantbeef> Look up how to make a reverse shell then copy that reasoning to Nim |
00:04:50 | * | noeontheend quit (Ping timeout: 240 seconds) |
00:06:10 | FromDiscord | <root> Ok |
00:07:50 | * | xet7 quit (Ping timeout: 240 seconds) |
00:08:10 | FromDiscord | <spoon> does pixie have a function for getting the value of a single pixel/a column? or will i have to resort to using data? |
00:11:39 | FromDiscord | <!Patitotective> In reply to @spoon "does pixie have a": https://nimdocs.com/treeform/pixie/pixie/images.html#getColor%2CImage%2Cint%2Cint ? |
00:12:28 | FromDiscord | <spoon> ah ty |
00:17:10 | FromDiscord | <Elegantbeef> `[x, y]` gets you pixel |
00:19:46 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XXg |
00:19:52 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XXh |
00:20:02 | FromDiscord | <Elegantbeef> You're still copying pmunch's shitty example 😄 |
00:20:21 | FromDiscord | <!Patitotective> :[ is there another better example |
00:20:22 | FromDiscord | <!Patitotective> (edit) "example" => "example?" |
00:20:55 | FromDiscord | <Elegantbeef> if you have a dynamic library https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L33-L40 is pretty nice |
00:20:59 | * | xet7 joined #nim |
00:21:08 | FromDiscord | <Elegantbeef> Is this a C source library or a system library? |
00:21:56 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Is this a C": i thing source idk |
00:22:03 | FromDiscord | <Elegantbeef> Do you have a `.so`? |
00:22:08 | FromDiscord | <Elegantbeef> do you have a `.a` |
00:22:15 | FromDiscord | <Elegantbeef> Or do you have a `.h` |
00:22:23 | FromDiscord | <Elegantbeef> It seems to be a source library |
00:22:44 | FromDiscord | <Elegantbeef> So you'll want to use futhark then do `{.compile: "path/to/my/tinyfiledialog.h".}` probably |
00:25:15 | FromDiscord | <Elegantbeef> might be the `.c` dont recall |
00:27:18 | FromDiscord | <huantian> I thought there already was a wrapper for that, might be old tho |
00:27:48 | FromDiscord | <Elegantbeef> https://github.com/search?q=dialogs+language%3Anim |
00:28:42 | FromDiscord | <Elegantbeef> nim-native-dialogs might still work |
00:37:49 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XXk |
00:37:49 | FromDiscord | <Elegantbeef> Then fix it |
00:37:50 | FromDiscord | <Elegantbeef> Jesus |
00:38:08 | FromDiscord | <Elegantbeef> If you cant get TFD to work 😄 |
00:38:35 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Or do you have": h |
00:38:38 | FromDiscord | <!Patitotective> (edit) "h" => "yes" |
00:38:47 | FromDiscord | <Elegantbeef> I already told you what to do 😄 |
00:39:12 | FromDiscord | <!Patitotective> omg |
00:39:13 | FromDiscord | <!Patitotective> it does work |
00:39:22 | FromDiscord | <Elegantbeef> What does |
00:39:53 | FromDiscord | <!Patitotective> i just tried notify popup but now gonna test all of them |
00:40:03 | FromDiscord | <!Patitotective> TFD |
00:41:27 | FromDiscord | <!Patitotective> two things↵1. to "rename" the procs (nim friendly), do i need to create a new proc and call the ugly proc inside? |
00:42:40 | FromDiscord | <Elegantbeef> Or you can use the rename callback like i do in wasmedge |
00:42:45 | FromDiscord | <!Patitotective> 2. how do i convert this into a libary, like make it work without having to write futhark header |
00:43:10 | FromDiscord | <Elegantbeef> You take the generate futhark file and distribute taht |
00:43:18 | FromDiscord | <Elegantbeef> You take the generated futhark file and distribute that |
00:43:32 | FromDiscord | <Elegantbeef> It's in your `.cache/nim/d_yourProjectFile/` |
00:43:36 | * | Zectbumo joined #nim |
00:46:10 | FromDiscord | <Elegantbeef> And since it's ZLib licensed you can include the C file in that library |
00:46:51 | FromDiscord | <!Patitotective> the c and the header, right? |
00:47:01 | FromDiscord | <Elegantbeef> Of course |
00:48:05 | FromDiscord | <!Patitotective> btw, is `define TINYFD_IMPLEMENTATION` actually needed, you dont seem to use it 🤨 |
00:52:49 | FromDiscord | <Zectbumo> what is the real difference between a template and an inline proc? and is there a performance difference? |
00:53:06 | FromDiscord | <Elegantbeef> The real difference is one is up to the C compiler and the other is certainly inlined |
00:53:17 | FromDiscord | <Elegantbeef> You generally dont use templates for inlining you use them for other reasons |
00:53:41 | FromDiscord | <Elegantbeef> Compilers are smart and they will generally inline where they need |
00:53:45 | FromDiscord | <Zectbumo> so inline proc would be preferred over template? |
00:54:33 | FromDiscord | <Zectbumo> ... if templates weren't needed |
00:54:37 | FromDiscord | <Elegantbeef> You only really inline when you're using the procedures a lot and dont want that extra stack frame growth |
00:54:48 | FromDiscord | <Elegantbeef> Templates are not meant for a tool for inlining it's a side effect of how they work |
00:55:03 | FromDiscord | <Elegantbeef> Templates are macros-lite |
00:56:05 | FromDiscord | <Elegantbeef> Consider these https://github.com/beef331/wasmedge_playground/blob/master/src/wasmedge.nim#L112-L120 |
00:56:21 | FromDiscord | <Elegantbeef> Then look at the callsite below |
00:56:25 | FromDiscord | <arkt8> sent a long message, see http://ix.io/3XXn |
00:56:31 | FromDiscord | <Elegantbeef> It's much much cleaner than manually writing the same thing 10-20 times |
00:57:26 | FromDiscord | <Elegantbeef> Issue is you forgot calling conventions |
00:57:30 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3XXo |
00:57:49 | FromDiscord | <Elegantbeef> By default a procedure in a type definition is a `closure` |
00:58:08 | FromDiscord | <Elegantbeef> Whereas in this case it's actually a `cdecl` you want |
00:59:57 | FromDiscord | <Elegantbeef> The C compiler error isnt nice, but alas |
01:00:09 | FromDiscord | <arkt8> I'm still a bit confused when use or not {.cdec.}.↵↵I will focus on it... Thank you :) |
01:00:10 | FromDiscord | <Elegantbeef> Nim doesnt know you lied about the C code 😄 |
01:00:30 | FromDiscord | <Elegantbeef> It's the default calling convention for C code, so you generally use it on pointer procs coming from C |
01:01:54 | FromDiscord | <arkt8> Yes... Im writting some tests for c wrapping to understand how to translate correctly |
01:03:07 | FromDiscord | <Elegantbeef> To answer the question though, you can actually cast procs to different proc types but it'll create bugs if the calling conventions dont match 😄 |
01:03:22 | FromDiscord | <Elegantbeef> The only time you really cast to/from a proc is when you're doing a type erasure to a pointer |
01:08:34 | FromDiscord | <spoon> sent a code paste, see https://play.nim-lang.org/#ix=3XXq |
01:08:42 | FromDiscord | <Elegantbeef> `array[i, int]` |
01:08:47 | FromDiscord | <Elegantbeef> arrays are statically typed |
01:08:59 | FromDiscord | <Elegantbeef> `newSeq[int](i)` |
01:09:28 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "It's in your `.cache/nim/d_yourProjectFile/`": `futhark_9FB241AF935DCC8E.nim`? |
01:09:32 | FromDiscord | <spoon> does shuffle work on sequences? |
01:09:39 | FromDiscord | <Elegantbeef> Yes |
01:09:41 | FromDiscord | <spoon> i tried to shuffle a sequence earlier |
01:09:48 | FromDiscord | <Elegantbeef> it takes a openarray |
01:09:56 | FromDiscord | <Elegantbeef> It works on openarrays which are sequences and arrays |
01:10:49 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Chc |
01:12:21 | FromDiscord | <Elegantbeef> The funpart is even `a.toOpenArray(1, 2).shuffle` is valid |
01:12:31 | * | mjsir911 quit (Quit: Goodbye, World!) |
01:12:40 | FromDiscord | <spoon> ah, i wrote a whole iterator because i used `let` instead of `var` on accident |
01:12:53 | FromDiscord | <Elegantbeef> Time to read compiler messages |
01:13:17 | FromDiscord | <spoon> the first message said `but expression 's' is of type: seq[Image]` |
01:13:22 | FromDiscord | <Elegantbeef> `but expression 'a' is immutable, not 'var'` |
01:13:23 | FromDiscord | <spoon> threw me off |
01:14:10 | FromDiscord | <spoon> scrolling down is too hard, would rather write an iterator |
01:15:00 | FromDiscord | <spoon> but what are the restrictions on using arrays then? you have to use a seq in iterators/procedures? |
01:15:10 | FromDiscord | <Elegantbeef> what? |
01:15:19 | FromDiscord | <Elegantbeef> Arrays are statically typed that's the restriction |
01:16:10 | FromDiscord | <Elegantbeef> If the length is not known at compile time you cannot allocate on the stack |
01:16:18 | FromDiscord | <Elegantbeef> Rather should not |
01:16:44 | FromDiscord | <Elegantbeef> Arrays in Nim are both statically typed by their size and stack allocated |
01:16:49 | * | mjsir911 joined #nim |
01:16:57 | FromDiscord | <Elegantbeef> As such they are not used for dynamism |
01:17:47 | FromDiscord | <spoon> weird, specified length there |
01:17:55 | FromDiscord | <Elegantbeef> What? |
01:19:23 | FromDiscord | <Elegantbeef> if you mean `array[i, int]` yes you specified a length with is derived from a runtime value and as such is unknown |
01:19:44 | FromDiscord | <spoon> ah |
01:20:04 | FromDiscord | <Elegantbeef> It's a simple case of "How much memory should it allocate for this array" |
01:20:23 | FromDiscord | <Elegantbeef> And if you cannot answer that question statically it should not be stack allocated |
01:20:51 | FromDiscord | <Elegantbeef> As such you use a sequence |
01:21:33 | FromDiscord | <Zectbumo> !evail↵import std/[strformat, strutils]↵var s = &"boo".unindent |
01:21:52 | FromDiscord | <Zectbumo> (edit) "!evail↵import" => "!evail import" | "strutils]↵var" => "strutils]; var" |
01:22:08 | FromDiscord | <Zectbumo> !evail import std/[strformat, strutils]; var s = &"boo".unindent |
01:22:16 | FromDiscord | <Zectbumo> evail 🙂 |
01:22:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XXr |
01:22:52 | FromDiscord | <Elegantbeef> or |
01:24:22 | FromDiscord | <Zectbumo> it's a bummer that the formatter doesn't get preference |
01:24:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XXs |
01:24:37 | FromDiscord | <Elegantbeef> Well it binds to the statement |
01:24:55 | FromDiscord | <Elegantbeef> Consider `$some.complex.dot.statement` |
01:25:01 | FromDiscord | <Zectbumo> yeah \:( |
01:25:47 | FromDiscord | <Zectbumo> right, but this is a string{lit} macro. it should bind to the " not get bumped out |
01:25:48 | FromDiscord | <Elegantbeef> `fmt"boo".unindent` does work |
01:26:18 | FromDiscord | <Zectbumo> well, maybe & shouldn't require a string{lit} then |
01:26:18 | FromDiscord | <Elegantbeef> How can you know you wanted the macro and not another operator? |
01:26:40 | FromDiscord | <Zectbumo> because one is an error and the other isn't |
01:26:52 | FromDiscord | <Elegantbeef> You cannot have a compiler work based off which compiles |
01:26:58 | FromDiscord | <Zectbumo> (edit) "because one is ... an" added "always" |
01:27:02 | FromDiscord | <Elegantbeef> That's an unpredictable compiler with very shitty semantics |
01:27:25 | FromDiscord | <Zectbumo> or smart one 🙂 |
01:28:43 | FromDiscord | <Zectbumo> but, thanks, I'll use the command syntax one you gave me |
01:28:52 | FromDiscord | <Elegantbeef> It's not smart |
01:29:19 | FromDiscord | <Elegantbeef> "X compiles so we use it" is not a smart compiler it's unpredictable |
01:30:28 | FromDiscord | <Elegantbeef> consider `&a.b.c` where `c(&(a.b))` is valid but `&(a.b.c)` is invalid |
01:30:47 | FromDiscord | <Elegantbeef> Now to reason about what the compiler is doing you need to know what compiles in the statement |
01:31:30 | FromDiscord | <Elegantbeef> Versus going "Ah yes all unary operators bind tightly to the statement they are attached to" |
01:31:37 | FromDiscord | <!Patitotective> im having an issue, `tinyfd_inputBox` `aDefaultInput` parameter expects a cstring↵and depending supposedly, if it is `""`, it will create an inputBox but if it is `NULL`, it will create a passwordBox↵but, whether i pass `""` or `NULL` it creates a passwordBox |
01:31:50 | FromDiscord | <!Patitotective> (edit) "`tinyfd_inputBox` `aDefaultInput`" => "`tinyfd_inputBox(.., aDefaultInput=`" |
01:31:55 | FromDiscord | <!Patitotective> (edit) "aDefaultInput=`" => "aDefaultInput)`" |
01:32:13 | FromDiscord | <!Patitotective> (edit) "cstring↵and" => "cstring↵and, supposedly," | "supposedly," => "on" |
01:32:48 | FromDiscord | <Elegantbeef> How are you calling it? |
01:33:22 | FromDiscord | <!Patitotective> `inputBox("Name", "Please enter your name :]", " ")`? |
01:33:29 | FromDiscord | <!Patitotective> they are of course cstrings |
01:33:37 | FromDiscord | <Elegantbeef> sure |
01:33:45 | FromDiscord | <Elegantbeef> And for the password? |
01:34:19 | FromDiscord | <!Patitotective> `inputBox("Name", "Please enter your name :]", "")` or `nil`, gives the same result |
01:34:45 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "sure": yet it fills the input box with a space, which is a not nice |
01:35:05 | FromDiscord | <Elegantbeef> Well you did `" "` |
01:35:06 | FromDiscord | <Elegantbeef> So yea |
01:35:11 | FromDiscord | <Elegantbeef> That's what you get for passing a space |
01:35:25 | FromDiscord | <!Patitotective> but if i dont it will make it a passwor box :Ñ |
01:35:26 | FromDiscord | <!Patitotective> (edit) ":Ñ" => ":[" |
01:35:39 | FromDiscord | <Elegantbeef> "\\0" |
01:35:51 | FromDiscord | <Elegantbeef> Didnt you say it wasnt working? |
01:36:08 | FromDiscord | <Elegantbeef> Oh you heavily edited the message |
01:36:18 | FromDiscord | <!Patitotective> hehe |
01:36:21 | FromDiscord | <!Patitotective> In reply to @Elegantbeef ""\\0"": nope |
01:37:02 | FromDiscord | <!Patitotective> maybe its something about how c interprets `if (aDefaultInput)` (?) |
01:37:36 | FromDiscord | <Elegantbeef> It should be a check if it's null |
01:37:49 | FromDiscord | <Elegantbeef> non-zero is true 0 is false iirc |
01:37:52 | FromDiscord | <Elegantbeef> Might have that backwards |
01:39:01 | FromDiscord | <!Patitotective> well `\0` does not work? maybe settings cstrings length or something 🤷♂️ |
01:39:07 | FromDiscord | <!Patitotective> (edit) "work? maybe" => "work↵maybe" |
01:39:15 | FromDiscord | <Elegantbeef> "settings cstrings length" 😄 |
01:39:29 | FromDiscord | <!Patitotective> :[ |
01:39:32 | FromDiscord | <Elegantbeef> Cstrings dont have lengths |
01:40:26 | FromDiscord | <Elegantbeef> You can try `\1` or other non printable character |
01:40:38 | FromDiscord | <Elegantbeef> But that's not going to end well either |
01:40:42 | FromDiscord | <Elegantbeef> Seems like you get to fix C code |
01:40:56 | FromDiscord | <!Patitotective> lul https://media.discordapp.net/attachments/371759389889003532/975935922656915456/unknown.png |
01:41:07 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Seems like you get": 😨 |
01:41:14 | FromDiscord | <Elegantbeef> Right this if for guis |
01:41:31 | FromDiscord | <!Patitotective> what would i say instead of `if (aDefaultInput)`? |
01:41:59 | FromDiscord | <Elegantbeef> I dont have the fucking code now do i |
01:41:59 | FromDiscord | <!Patitotective> (edit) "say" => "write" |
01:42:34 | FromDiscord | <!Patitotective> ugh sourceforge is not-nice, too plain↵i cannot reference a line |
01:42:40 | FromDiscord | <!Patitotective> nvm i ca |
01:42:42 | FromDiscord | <!Patitotective> (edit) "ca" => "can" |
01:42:42 | FromDiscord | <!Patitotective> lol |
01:43:05 | FromDiscord | <!Patitotective> https://sourceforge.net/p/tinyfiledialogs/code/ci/master/tree/tinyfiledialogs.c#l1225 |
01:43:56 | FromDiscord | <Elegantbeef> That's the windows API |
01:46:31 | FromDiscord | <!Patitotective> https://sourceforge.net/p/tinyfiledialogs/code/ci/master/tree/tinyfiledialogs.c#l2905 |
01:46:42 | FromDiscord | <Elegantbeef> Or atleast that looks like windows code |
01:48:26 | FromDiscord | <Elegantbeef> Yep i dont know what to say fix the code |
01:48:26 | FromDiscord | <Elegantbeef> 😄 |
01:48:44 | FromDiscord | <Elegantbeef> Either fix nim-native-dialogs or tinyfiledialog |
01:49:18 | FromDiscord | <!Patitotective> tinyfiledialog has color chooser and notif popup so i guess ill try to fix it :] |
01:59:49 | FromDiscord | <!Patitotective> to fix it i should fork it, right? |
02:04:16 | FromDiscord | <!Patitotective> it seems like sourceforge doesnt have "that" |
02:05:19 | FromDiscord | <!Patitotective> omg im so stupid |
02:05:24 | FromDiscord | <!Patitotective> it was just ther |
02:08:08 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XXx |
02:08:12 | FromDiscord | <ambient> mainly wondering the pointer arithmetic. from C/asm point of view it's very simple |
02:09:09 | FromDiscord | <ambient> basically every iteration it just increments the next memory location by 2 x float64 |
02:13:55 | * | Zectbumo quit (Remote host closed the connection) |
02:18:59 | * | Zectbumo joined #nim |
02:40:26 | * | byanka quit (Quit: Leaving) |
02:40:31 | FromDiscord | <Elegantbeef> could do `for tq in countup(0, ls, 2)` |
02:43:27 | FromDiscord | <Elegantbeef> other than that dont know how to make it anymore expressive @ambient |
02:44:09 | * | Zectbumo left #nim (#nim) |
02:46:07 | FromDiscord | <Zectbumo> what is strutils.normalize used for? It just says what it's not used for↵https://nim-lang.org/docs/strutils.html#normalize%2Cstring |
02:50:41 | FromDiscord | <huantian> Ig it’s just for if you need to toAsciiLower and remove ‘_’ at the same time |
02:50:48 | FromDiscord | <huantian> No idea why you’d need that tho either |
02:51:29 | FromDiscord | <huantian> ig if you want osmething to be completely case and underscore insensitive |
02:51:47 | FromDiscord | <huantian> as opposed to nim idents which are case insensitive not for first char |
02:52:43 | FromDiscord | <treeform> In reply to @spoon "does pixie have a": Just `image[x, y]` or you can also use `image.unsafe[x, y]` for faster no-bounds checking. |
03:04:17 | FromDiscord | <Zectbumo> In reply to @huantian "No idea why you’d": yeah, I have not seen this sort of need and the closest thing would be nim identifiers and it doesn't even do that, so... |
03:05:48 | FromDiscord | <Zectbumo> https://nim-lang.org/docs/manual.html#modules-import-statement↵how would one know that import can use brackets to import a list? `import std/[a,b,c]` |
03:06:13 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#modules-collective-imports-from-a-directory |
03:06:22 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#modules-pseudo-importslashinclude-paths |
03:10:19 | FromDiscord | <Zectbumo> oh 🙂 I thought I had read it and then was confused how I knew this |
03:12:45 | FromDiscord | <Zectbumo> neat I want to try pkg |
03:15:00 | FromDiscord | <Zectbumo> aw I did `import pkg/pylib` and used it but I was hoping for an automatic nimble fetch when I did `nim r` |
03:15:24 | FromDiscord | <Elegantbeef> Nope you need the `requires` or it already installed |
03:15:37 | FromDiscord | <Zectbumo> oh! requires will do it? |
03:15:45 | FromDiscord | <Elegantbeef> Well if it's in your nimble file |
03:16:17 | FromDiscord | <Zectbumo> how do I use requires? |
03:17:07 | FromDiscord | <Elegantbeef> You make a nimble file |
03:17:47 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/nimble#creating-packages |
03:34:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XXF |
03:36:32 | FromDiscord | <Zectbumo> yeah I've been doing the brackets and was wondering why indention isn't just used like it is in a lot of places in the lang |
03:37:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XXH |
03:37:33 | FromDiscord | <Elegantbeef> The issue is that parsing |
03:38:09 | FromDiscord | <Zectbumo> yeah. and I guess it follows the punctuation at the end rule which then you can't do the second import on std/ |
03:38:14 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XXI |
03:38:20 | FromDiscord | <Elegantbeef> yep |
03:38:39 | FromDiscord | <Elegantbeef> `/` is an infix so std and re are parsed, but `strutils` cannot be parsed |
03:38:43 | FromDiscord | <Zectbumo> @ElegantBeef you mentioned in the other channel wrong way to suggest. I see now there is an #internals that talks about nim compiler but where do I start the discussion? |
03:39:13 | FromDiscord | <Elegantbeef> A well written RFC i think is the proper way to talk about this |
03:39:40 | FromDiscord | <Zectbumo> oh well, I don't want to write an entire RFC and then it be a "stupid idea" or "well, you can just do this" |
03:40:19 | * | noeontheend joined #nim |
03:40:21 | FromDiscord | <Zectbumo> I guess I chat in #main about it |
03:40:32 | * | nsyd joined #nim |
03:40:55 | FromDiscord | <Elegantbeef> Well then you dont want to propose your idea |
03:41:02 | FromDiscord | <Elegantbeef> Based off of what araq has said i'm fairly cetain he'd agree with your suggestion somewhat, but I could be 100% wrong |
03:41:44 | FromDiscord | <Zectbumo> oh I do. I can write the RFC for this. I'm talking about other ideas. If you think it's good I'll write one |
03:42:05 | FromDiscord | <Elegantbeef> I mean i was just saying where to properly address your suggestions |
03:42:15 | FromDiscord | <Elegantbeef> If you feel like spending the time writing an RFC for it then you do you |
03:44:02 | FromDiscord | <Zectbumo> where can I see the past suggested RFCs? |
03:48:02 | * | rockcavera quit (Remote host closed the connection) |
03:48:56 | FromDiscord | <Zectbumo> I found https://github.com/nim-lang/RFCs but this is talking about stuff that is accepted? where are the rejected ones? and milestones is empty :/ |
03:50:36 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/RFCs/issues?q=is%3Aissue+is%3Aclosed |
04:11:11 | * | slowButPresent quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)) |
04:11:18 | * | noeontheend quit (Ping timeout: 276 seconds) |
04:19:30 | FromDiscord | <Zectbumo> if I do `const myConst = someProc()` and someProc is never used outside of compiling, is it stripped away from the executable? |
04:19:47 | FromDiscord | <Elegantbeef> Only used code is included |
04:20:14 | FromDiscord | <Zectbumo> "used" in the runtime, I presume |
04:20:53 | FromDiscord | <Elegantbeef> Yes `const` is evaluated at compile time so the procedure is not included |
04:31:33 | FromDiscord | <Zectbumo> this language is so cool I can't get over it↵`Digits + Letters + "_-+.@".toSet` |
04:32:26 | FromDiscord | <Elegantbeef> You're welcome for that toset 😄 |
04:32:44 | FromDiscord | <Zectbumo> that was you? 👏 |
04:33:22 | FromDiscord | <Elegantbeef> you also could just you know `{'_', "-", "+', '.' , '@'}` 😄 |
04:33:55 | FromDiscord | <Zectbumo> yeah, I'm lazy 😛 |
04:33:55 | FromDiscord | <Elegantbeef> single quotes of course |
04:34:49 | FromDiscord | <Zectbumo> I'm just going to `const` it and it all gets stripped away anyway. 0 performance hit. this is why I'm just jaw dropped right now |
04:34:58 | FromDiscord | <Elegantbeef> Ah |
04:35:24 | FromDiscord | <Elegantbeef> Yea i have a toy wave function collapse implementation and using bitsets was quite a fun experience |
04:35:39 | FromDiscord | <Zectbumo> lazy and zero impact. I just love it |
04:36:34 | FromDiscord | <Zectbumo> that sounds cool. @ElegantBeef so what cool stuff are you doing with that wasmedge? |
04:36:56 | FromDiscord | <Elegantbeef> simplescreenrecorder-2022-05-16\_02.01.00.mp4 https://media.discordapp.net/attachments/371759389889003532/975980215530561536/simplescreenrecorder-2022-05-16_02.01.00.mp4 |
04:37:08 | FromDiscord | <Elegantbeef> This is the present toy project that i've started implementing for testing it |
04:37:28 | FromDiscord | <Zectbumo> aw fun |
04:37:46 | FromDiscord | <Elegantbeef> Premise is scripted AI compete against eachother |
05:06:07 | * | byanka joined #nim |
05:24:23 | FromDiscord | <Zectbumo> @ElegantBeef can wasmedge be used to run a local nim playground? |
05:25:00 | FromDiscord | <Elegantbeef> I mean it can be used for scripting and hot code reload-esque things |
05:26:39 | FromDiscord | <Zectbumo> oh I saw the other day there are hot reload flags in nim. I want to try that out |
05:26:51 | FromDiscord | <Elegantbeef> They dont work well afaik |
05:41:21 | FromDiscord | <0st guy on the list> In reply to @planetis "Fuck rust you should": i am afraid no |
05:53:36 | * | byanka quit (Read error: Connection reset by peer) |
06:18:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3XYa |
06:20:02 | FromDiscord | <demotomohiro> I think return type of your proc is `T`. |
06:20:25 | FromDiscord | <Phil> Still explodes |
06:22:54 | FromDiscord | <Rika> I haven't tried this |
06:22:57 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3XYb |
06:24:54 | FromDiscord | <huantian> https://play.nim-lang.org/#ix=3XYc |
06:25:22 | FromDiscord | <huantian> UFC generic moment |
06:25:40 | FromDiscord | <demotomohiro> Or `s.parseEnun[:T]()` |
06:26:36 | FromDiscord | <Phil> In reply to @Rika "I haven't tried this": Still explodes, same error |
06:27:17 | FromDiscord | <Phil> That.... works. Why the colon? |
06:27:22 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
06:27:23 | FromDiscord | <Phil> That's the first time I've seen it used like this |
06:28:44 | FromDiscord | <huantian> Yeah you either have to use colon or don’t write it with `.` |
06:35:44 | FromDiscord | <demotomohiro> https://wandbox.org/permlink/tspfZlOeb3V1XaQj |
06:36:10 | FromDiscord | <Rika> In reply to @demotomohiro "Or `s.parseEnun[:T]()`": I forgot about that lol |
06:41:47 | FromDiscord | <demotomohiro> Nim uses `[]` for both array/seq and for generic parameters that cause problem like this.↵ascii code has few parenthesis like charactor and programming languages have to reuse same charactor for different things. |
06:46:31 | FromDiscord | <demotomohiro> If Nim used parenthesis like charactors like 【】or「」 for generics parameter, you dont need to write `s.parseEnum[:T]()`. You can write `s.parseEnum【T】()`. |
06:48:57 | FromDiscord | <Zectbumo> In reply to @root "does anyone now what": you didn't get it going? |
06:52:09 | FromDiscord | <Phil> In reply to @demotomohiro "If Nim used parenthesis": ... I think I'll take the colon, special parenthesis characters sounds like absolute carnage |
06:52:29 | FromDiscord | <Rika> In reply to @demotomohiro "If Nim used parenthesis": It would be difficult for users of ANSI keyboards to type these |
06:56:19 | FromDiscord | <Phil> I kinda wish I had a need for some sort of really fast python module.↵I'm kinda itching to take nimpy for a spin, but I don't really have a usecase |
06:59:42 | FromDiscord | <demotomohiro> Making a keyboard that has '【' and '】' keys would make programming slightly easier. |
07:00:47 | FromDiscord | <Zectbumo> In reply to @Isofruit "I kinda wish I": make a game or demo scene |
07:01:59 | FromDiscord | <Phil> In reply to @Zectbumo "make a game or": Not a gamedev 😄 ↵Maybe once I've got my project out I'll ask a couple folks I know that program in python if they need an algorithm in something fast |
07:02:00 | FromDiscord | <Zectbumo> In reply to @demotomohiro "Making a keyboard that": what keys are those? 😅 |
07:02:16 | * | nsyd quit (Ping timeout: 272 seconds) |
07:03:35 | FromDiscord | <demotomohiro> They are keys to just type '【' and '】'. |
07:04:22 | FromDiscord | <Zectbumo> do you use that as operators? what do they do? |
07:04:51 | FromDiscord | <Zectbumo> oh, reading above |
07:06:49 | FromDiscord | <Zectbumo> I see now. some futuristic programming keyboard |
07:07:48 | FromDiscord | <Zectbumo> Neuralink will take over and keyboards obsolete by then. Elon's got you covered |
07:07:51 | FromDiscord | <Rika> In reply to @Isofruit "I kinda wish I": Why? |
07:08:21 | FromDiscord | <Rika> In reply to @Zectbumo "Neuralink will take over": Probably by then AI would code for us and we’d all be fucked from a job |
07:10:38 | FromDiscord | <Zectbumo> wouldn't it be a crazy world if us developers don't lose our jobs but actually we turned into mental therapists for the AI that took our jobs. |
07:12:12 | FromDiscord | <Zectbumo> AI: I totally messed this program up and I don't know why I did this. ↵Therapist Former Dev: Well, what thoughts did you have as a child (1 minute ago) |
07:14:24 | FromDiscord | <Phil> In reply to @Rika "Why?": It seems fun to write something in python with access to a billion and one pre-made module and then the one part where python is actually slow can be made fast by outsourcing it into nim |
07:16:48 | FromDiscord | <Zectbumo> so, python just because of the module base size |
07:18:56 | FromDiscord | <0st guy on the list> In reply to @demotomohiro "Making a keyboard that": https://tenor.com/view/talos-talosian-star-trem-star-trek-big-head-gif-12496470 |
07:22:16 | FromDiscord | <uinjei> how can I stop antivirus from deleting my application? |
07:30:02 | FromDiscord | <Rika> In reply to @uinjei "how can I stop": Report false positive to antivirus and disable it for now |
07:39:20 | * | ltriant quit (Ping timeout: 260 seconds) |
07:39:39 | * | xet7 quit (Ping timeout: 240 seconds) |
07:40:05 | FromDiscord | <0st guy on the list> bruh guys why is my compiler going mad!?!?! |
07:41:18 | FromDiscord | <0st guy on the list> sent a code paste, see https://paste.rs/QrO |
07:53:06 | * | xet7 joined #nim |
07:58:38 | FromDiscord | <0st guy on the list> this lib is kinda sus dude |
08:01:38 | FromDiscord | <jmgomez> Is the forum down? |
08:02:24 | FromDiscord | <jmgomez> it seems it's back now |
08:03:06 | FromDiscord | <jmgomez> can I send over via FFI a seq via an open array? |
08:07:22 | * | ehmry quit (Ping timeout: 250 seconds) |
08:12:31 | * | ehmry joined #nim |
08:18:52 | FromDiscord | <Elegantbeef> You can send it over as a address to the first value and a length(this is what an open array is) |
08:19:09 | FromDiscord | <Elegantbeef> Aslong as you ensure it stays alive |
08:19:27 | FromDiscord | <Elegantbeef> Arc/Orc are a bit more annoying to do this with than refc |
08:19:42 | FromDiscord | <Elegantbeef> Refc was capable of making seq/strings stay alive longer than their scope |
08:21:03 | FromDiscord | <everyone> can someone help me? |
08:22:27 | FromDiscord | <Phil> Could you post the compile command you executed? |
08:22:56 | FromDiscord | <everyone> sent a code paste, see https://play.nim-lang.org/#ix= |
08:23:19 | FromDiscord | <Phil> Can you write a minimal example that causes that behaviour? |
08:23:36 | FromDiscord | <everyone> In reply to @Isofruit "Can you write a": you mean the code? |
08:24:14 | FromDiscord | <Phil> Basically a stripped down version of the code, just enough to produce the above behaviour↵At a glance I can't really say what's exploding, but I'd assume some usage of a specific library is a culprit |
08:24:47 | FromDiscord | <everyone> In reply to @Isofruit "Basically a stripped down": well actually it's just the example code of drawing shapes i got from github |
08:24:59 | FromDiscord | <everyone> sent a code paste, see https://play.nim-lang.org/#ix=3XYj |
08:25:01 | FromDiscord | <everyone> T H I S |
08:25:51 | FromDiscord | <Phil> Huh... turns out that thing isn't in nimble, is it |
08:25:55 | FromDiscord | <Phil> (edit) "it" => "it?" |
08:26:03 | FromDiscord | <everyone> In reply to @Isofruit "Huh... turns out that": nooooouuu |
08:26:54 | FromDiscord | <Phil> Could you link the raylib package you're using? |
08:27:15 | FromDiscord | <everyone> https://nimble.directory/pkg/naylib |
08:27:27 | FromDiscord | <Phil> it's called naylib, ahhhh |
08:27:44 | FromDiscord | <everyone> In reply to @Isofruit "it's called naylib, ahhhh": lol |
08:28:50 | FromDiscord | <everyone> sooooooo what should i do? |
08:29:08 | FromDiscord | <Rika> It still says raylib isn’t found |
08:29:21 | FromDiscord | <Rika> So you probably have to make the C compiler aware of where you installed it |
08:29:31 | FromDiscord | <everyone> In reply to @Rika "So you probably have": hmmmm |
08:29:34 | FromDiscord | <everyone> how me do thet |
08:29:55 | FromDiscord | <Rika> I forgot 👁️ 👄 👁️ |
08:30:07 | FromDiscord | <Elegantbeef> Seems you're supposed to use `nayget` |
08:30:31 | FromDiscord | <everyone> In reply to @Rika "I forgot 👁️ 👄": 💀 |
08:30:44 | FromDiscord | <everyone> In reply to @Elegantbeef "Seems you're supposed to": now what on earth is this? |
08:31:08 | FromDiscord | <Elegantbeef> A binary installed when you installed naaylib |
08:31:27 | FromDiscord | <Elegantbeef> you should be able todo `nayget build` and it then might work |
08:31:37 | FromDiscord | <Elegantbeef> Idk planetis doesnt have informative docs |
08:31:41 | FromDiscord | <Elegantbeef> The only ones i've seen worse are mine |
08:31:48 | FromDiscord | <everyone> In reply to @Elegantbeef "The only ones i've": lol |
08:32:13 | FromDiscord | <everyone> nope i can't use `naylib` |
08:32:32 | FromDiscord | <Elegantbeef> no one said use `naylib` |
08:32:54 | FromDiscord | <Phil> sidenote, I did do a nimble install naylib |
08:33:06 | FromDiscord | <everyone> In reply to @Elegantbeef "no one said use": oops |
08:33:08 | FromDiscord | <everyone> sory |
08:33:08 | FromDiscord | <Phil> If I run `nayget` i just get command not found, so not sure |
08:33:10 | FromDiscord | <Elegantbeef> Shit arent you talented |
08:33:10 | FromDiscord | <everyone> hehhe |
08:33:16 | FromDiscord | <everyone> In reply to @Elegantbeef "Shit arent you talented": thenks |
08:33:35 | FromDiscord | <Elegantbeef> Seems planetis didnt setup the project properly |
08:33:39 | FromDiscord | <Phil> I accept all glory for being able to run `nimble install`, praise my intellect |
08:33:43 | FromDiscord | <Elegantbeef> Make an issue and carry on with your day or use raylib now |
08:33:47 | FromDiscord | <everyone> well `nayget` ain't working aswell |
08:34:38 | FromDiscord | <everyone> is this `planetis` guy on the server? |
08:34:48 | FromDiscord | <Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3XYG |
08:34:53 | FromDiscord | <Elegantbeef> Yes they are but come one github issues exist |
08:35:05 | FromDiscord | <Phil> In reply to @uncle jim "is this `planetis` guy": giiiiithuuuub iisssuuuueeees |
08:35:06 | FromDiscord | <Elegantbeef> Yep there you go zect |
08:35:33 | FromDiscord | <Elegantbeef> I mean like i said has is ambiguous |
08:35:48 | FromDiscord | <Zectbumo> (edit) "https://play.nim-lang.org/#ix=3XYG" => "https://play.nim-lang.org/#ix=3XYH" |
08:35:49 | FromDiscord | <Zectbumo> (edit) "https://play.nim-lang.org/#ix=3XYH" => "https://paste.rs/wwr" |
08:36:00 | FromDiscord | <Elegantbeef> It seems like something you expect in a `when has a.b` which is just syntax sugar for `compiles(a.b)` |
08:36:07 | FromDiscord | <Rika> In reply to @Zectbumo "I'm really liking `has`": If you prefer that sure it works |
08:36:28 | FromDiscord | <Elegantbeef> Fewer characters is not more opaque |
08:36:50 | FromDiscord | <Elegantbeef> Guess transparent is more correct for my point |
08:37:28 | FromDiscord | <planetis> @everyone\: you tried to compile it first? |
08:37:28 | FromDiscord | <Elegantbeef> We've summoned planetis |
08:37:38 | FromDiscord | <Rika> Lmao |
08:37:39 | FromDiscord | <Elegantbeef> Why dont you ship the binary planetis? |
08:37:54 | FromDiscord | <Elegantbeef> Like why do you make the user fetch the sources to run your `nayget` tool? |
08:38:47 | * | xet7 quit (Remote host closed the connection) |
08:38:59 | FromDiscord | <planetis> Wdym |
08:39:16 | FromDiscord | <Elegantbeef> Why does `nimble install naylib` not work |
08:39:16 | FromDiscord | <Rika> You can make nimble install binaries |
08:39:42 | FromDiscord | <Elegantbeef> Picostdlib, Nico, karax all install binaries to make this process seemless |
08:40:02 | FromDiscord | <planetis> I don't use nimble no idea how to make it work |
08:40:05 | FromDiscord | <everyone> In reply to @planetis "<@856412455507984404>\: you tried to": you mean to convert it into a exe? |
08:40:17 | FromDiscord | <Elegantbeef> Well refer to the three packages i suggested |
08:41:00 | FromDiscord | <planetis> There is a huge wall of text in the readme and nowhere what I am looking for |
08:41:14 | FromDiscord | <planetis> Like I can't overload task install |
08:41:22 | FromDiscord | <Elegantbeef> https://github.com/beef331/picostdlib/blob/master/picostdlib.nimble#L9 |
08:41:32 | FromDiscord | <jmgomez> In reply to @Elegantbeef "You can send it": okay, thanks. Will revisit it, I end up using std::vector since the target platform is cpp |
08:41:49 | FromDiscord | <everyone> but why the hell am i getting this cryptic stuff |
08:41:54 | * | xet7 joined #nim |
08:42:06 | FromDiscord | <Elegantbeef> Shitty terminal |
08:42:16 | FromDiscord | <everyone> https://media.discordapp.net/attachments/371759389889003532/976041952426467358/message.txt |
08:42:34 | FromDiscord | <everyone> In reply to @Elegantbeef "Shitty terminal": vscode |
08:42:43 | FromDiscord | <Elegantbeef> Shitty shell |
08:42:57 | FromDiscord | <everyone> In reply to @Elegantbeef "Shitty shell": pwsh |
08:43:06 | FromDiscord | <Elegantbeef> Did i stutter |
08:43:18 | FromDiscord | <planetis> I will pbl revert to nake again |
08:43:24 | FromDiscord | <planetis> Kinda workef |
08:43:25 | FromDiscord | <Elegantbeef> Why? |
08:43:31 | FromDiscord | <planetis> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/976042240617115678): Kinda worked |
08:43:52 | FromDiscord | <Elegantbeef> I mean i guess it's a bit better than maintaining your own build tool |
08:44:19 | FromDiscord | <planetis> Because I don't need to teach someone to compile it |
08:44:31 | FromDiscord | <Elegantbeef> I mean if you ship nayget you dont have to |
08:44:51 | FromDiscord | <Elegantbeef> you can do what impbox does for nico and have a `nayget init` which setups a project |
08:45:15 | FromDiscord | <planetis> Ok I will check nico |
08:45:37 | FromDiscord | <Elegantbeef> I mean it's up to you dont feel pressured to support a build tool |
08:45:40 | FromDiscord | <Elegantbeef> It's your software 😄 |
08:48:55 | FromDiscord | <planetis> no I want to fix this crap |
08:49:02 | FromDiscord | <planetis> once and for all |
08:50:28 | FromDiscord | <planetis> also is that windows? |
08:50:45 | FromDiscord | <Elegantbeef> Sounds like it |
08:50:58 | FromDiscord | <planetis> tough luck I haven't ported it to windows |
08:51:02 | FromDiscord | <planetis> I don't use it |
08:51:27 | FromDiscord | <Elegantbeef> So then yep looks like raylib now is your best bet |
08:51:50 | FromDiscord | <planetis> help needed: https://github.com/planetis-m/naylib/issues/1 |
08:56:46 | FromDiscord | <planetis> https://github.com/karaxnim/karax/blob/master/karax.nimble#L15 it's that freaking simple? |
08:56:59 | FromDiscord | <Elegantbeef> Yes |
08:57:07 | FromDiscord | <Elegantbeef> That plus the `installExt` |
08:57:15 | FromDiscord | <Elegantbeef> It then makes your package a hybrid nimble package |
09:04:44 | FromDiscord | <planetis> Is it too much to just clone the whole repo? Why all that bs |
09:06:27 | FromDiscord | <planetis> Anyway, my workflow is just git clone and I will keep supporting that |
09:07:47 | FromDiscord | <Elegantbeef> Just to be clear you submitted a package to the nimble repository that doesnt work if installed through a package manager? |
09:08:39 | FromDiscord | <planetis> haha, no it should work |
09:09:08 | FromDiscord | <planetis> And there are more package managers that use nim-lang/packages |
09:09:38 | FromDiscord | <planetis> like atlas and nymph |
09:09:47 | FromDiscord | <Elegantbeef> Afaik they still abide by `bin` |
09:11:00 | FromDiscord | <Elegantbeef> Anyway i'll go back to my troll hole |
09:11:06 | FromDiscord | <planetis> not atlas |
09:11:36 | FromDiscord | <planetis> I'll go get a troll haircut |
09:14:18 | FromDiscord | <planetis> thanks for the help beef |
09:30:59 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XYR |
09:31:30 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=3XYR" => "https://play.nim-lang.org/#ix=3XYS" |
09:32:04 | FromDiscord | <jmgomez> (My intention is to use delete on the cpp side of things later on) |
09:32:42 | FromDiscord | <Elegantbeef> One is a vector vector the other is just a vector |
09:34:00 | FromDiscord | <jmgomez> but where is that repetition coming from? |
09:35:20 | FromDiscord | <Elegantbeef> also `let v = ptrV[]` is going to copy the vector |
09:35:40 | FromDiscord | <Elegantbeef> No clue why it's duplicating |
09:36:56 | FromDiscord | <jmgomez> In reply to @Elegantbeef "also `let v =": ohh. Thanks, this better? (ptrV[]).add(x) |
09:39:17 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3XYW |
09:39:34 | FromDiscord | <jmgomez> notice it retuns poitner now instead of ptr StdVector[T] |
09:50:51 | FromDiscord | <eyecon> @KatrinaKitten would you be interested in a PR for the validate function we briefly discussed? |
09:53:36 | * | ltriant joined #nim |
09:56:12 | FromDiscord | <Clonkk> Anyobdy here uses "nim.projectMapping" with Saem's VSCode extension ? |
10:01:10 | FromDiscord | <tandy> you should make a cpp ffi library \:)↵(@jmgomez) |
10:05:32 | * | vicecea quit (Ping timeout: 260 seconds) |
10:13:38 | FromDiscord | <jmgomez> In reply to @tandy "you should make a": sorry, not following, what do you mean? |
10:13:54 | FromDiscord | <jmgomez> like exporting a cpp lib instead of ffi? |
10:14:22 | FromDiscord | <tandy> no i mean you should make a nimble package with useful things like that code snippet↵(@jmgomez) |
10:16:54 | FromDiscord | <jmgomez> In reply to @tandy "no i mean you": ohh, I was wondering why there isnt one already. I only exported that as temporary workaround for something else Im working on. But my spare nim "contribute back" time is all taken by unreal engine 5 bindings 😅 |
10:17:32 | FromDiscord | <jmgomez> having nim bindings for std I think it's a great idea |
10:18:31 | FromDiscord | <Recruit_main707> In reply to @tandy "you should make a": there is already one |
10:18:51 | FromDiscord | <Recruit_main707> with vectors, strings and smart pointers i think |
10:41:48 | FromDiscord | <demotomohiro> In reply to @tandy "you should make a": https://github.com/Clonkk/nim-cppstl |
10:49:15 | * | xet7 quit (Remote host closed the connection) |
11:03:05 | FromDiscord | <tandy> oh nice↵(@Recruit_main707) |
11:08:47 | FromDiscord | <planetis> uncle jim, I confirmed nimble install works now |
11:10:14 | FromDiscord | <planetis> but uncle someone needs to be kind enough to add a when defined(windows) branch in the top of raylib.nim with the correct passL command for windows. |
11:10:24 | FromDiscord | <planetis> I can do it but I have no way to test it |
11:12:54 | * | xet7 joined #nim |
11:22:51 | FromDiscord | <ambient> I wonder how much of stuff like this https://forum.nim-lang.org/t/6164 is just somewhere in Discord log |
11:28:45 | FromDiscord | <Rika> A good bit of it |
11:32:55 | FromDiscord | <ambient> because in many ways it's better than the official documentation 😢 |
11:35:01 | FromDiscord | <Gibbons> Hello, I have a certainly dumb question but I'm starting now to learn Nim so...↵As far as I understand there is no real constructor for objects, so my question is: how should I approach a situation where I want to validate a value during object creation?↵Say for example i have a GrownMan object with name and age, and I want to restrict by age... |
11:35:26 | * | rockcavera joined #nim |
11:35:26 | * | rockcavera quit (Changing host) |
11:35:26 | * | rockcavera joined #nim |
11:41:43 | FromDiscord | <Recruit_main707> even though constructors arent a thing as such the usual approach is to create a function that acts as one and use that |
11:42:41 | FromDiscord | <Recruit_main707> for example:↵`proc newDisplay(title: string; w, h: int32; ): ref RayDisplay =`↵` result.width = w`↵` result.height = h...` |
11:51:08 | FromDiscord | <Gibbons> @Recruit_main707 thanks... but wouldn't it still be possible to create the object such as var x = GrownMan(name: "bob", age: 20) without involving newDisplay()? |
11:54:31 | FromDiscord | <Recruit_main707> i think so, im not sure if you can avoid it |
11:54:53 | FromDiscord | <Recruit_main707> (edit) "i" => "~~i" | "so," => "so~~ yes," |
11:56:20 | FromDiscord | <Gibbons> It's ok... i'm afraid not, that's why I was asking if this situation has an approach I didn't know about in Nim... the point is that I am writing a small library that does things with IP addresses, and I followed the logic of Python's ipaddress module, where you can IPAddress('192.168.0.1') and if you pass stuff like '192.168.1.666' it will raise an exception |
11:58:12 | FromDiscord | <Gibbons> I wanted to keep that idea somehow... so my idea was, at this point, to let the fields of the object "private" and force to do something like: var myIP = IPAddress() and then try myIP.init('192.168.666.0') except ValueError bla bla bla |
11:58:51 | FromDiscord | <Gibbons> I just wanted to make sure I'm not going on a path that is far away from the Nim's way of designing stuff, if this makes any sense |
12:06:00 | FromDiscord | <Recruit_main707> yeah, its a normal question dont worry |
12:06:22 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XZn |
12:11:01 | * | noeontheend joined #nim |
12:17:07 | * | slowButPresent joined #nim |
12:17:18 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XZq |
12:28:46 | FromDiscord | <ambient> sent a code paste, see https://paste.rs/aBE |
12:29:40 | FromDiscord | <Rika> If is runtime |
12:29:44 | FromDiscord | <Rika> Types don’t exist runtime |
12:29:50 | FromDiscord | <Rika> You need to use when for compile time |
12:29:58 | FromDiscord | <ambient> oh i see |
12:53:47 | NimEventer | New thread by Ingo: To enum type and back, see https://forum.nim-lang.org/t/9160 |
12:58:08 | FromDiscord | <Clonkk> Have you checked https://github.com/SciNim/nimfftw3 if yo uwant to calculate FFT from Arraymancer Tensor ?↵(@ambient) |
13:03:26 | FromDiscord | <ambient> @Clonkk yeah my issue with C/C++ based libs is that how well I can reason about them and how easily they can be ported is a question mark |
13:03:57 | FromDiscord | <ambient> for example if I have some complex FPGA to Verilog transformer fftw3 doesn't work at all |
13:04:04 | FromDiscord | <ambient> I mean Nim -> Verilog |
13:04:35 | FromDiscord | <Clonkk> Ah okay, I do not know about the Verilog aspect of FFTW↵(@ambient) |
13:04:59 | FromDiscord | <ambient> Plus with -d:lto a very simple FFT in nim is already 50% of PocketFFT performance |
13:05:31 | FromDiscord | <ambient> @Clonkk it's just a generic example of how C/C++ lib is in essence a binary blob when it comes to adapting it to different situations |
13:06:49 | FromDiscord | <Clonkk> Very true, the main benefit of of using C / C++ lib is not having to re-implement stuff (especially when it comes to low level optimisation) that already works.↵(@ambient) |
13:07:06 | * | noeontheend quit (Ping timeout: 246 seconds) |
13:25:48 | FromDiscord | <eyecon> Considering I'm a beginner and I have no low-level stuff in my project (manually allocated or borrowed memory, directly accessed memory), should I explicitly select ARC/ORC or should I go with the defaults? |
13:31:59 | FromDiscord | <Clonkk> There's probably still more bug with arc\|orc than refc though |
13:32:00 | FromDiscord | <Clonkk> I would with arc\|orc since it will be the default in the future↵(@eyecon) |
13:48:15 | FromDiscord | <funnybyte> sent a code paste, see https://paste.rs/zsi |
13:49:19 | FromDiscord | <Rika> What are those atom types exactly? |
13:51:55 | FromDiscord | <funnybyte> sent a code paste, see https://play.nim-lang.org/#ix=3XZN |
13:56:56 | FromDiscord | <funnybyte> I looked at some example c++ code and they can just loop over the returned list. Like here https://cpp.hotexamples.com/examples/-/-/XGetWMProtocols/cpp-xgetwmprotocols-function-examples.html#0xee289a2fb4acd6380a0912e5e5b6a23329c2161c3f1548f35404c2703020caae-217,,246, |
14:04:42 | * | ltriant quit (Ping timeout: 260 seconds) |
14:17:08 | FromDiscord | <Rika> A double pointer is usually a returned list |
14:17:14 | FromDiscord | <Rika> The list is the first pointer |
14:17:21 | FromDiscord | <Rika> The second pointer is for returning a type |
14:17:56 | FromDiscord | <Rika> You can cast the pointer to atom into a “ptr UncheckedArray[Atom]” safely and use it like a list |
14:18:22 | FromDiscord | <Rika> (edit) "pointer to atom" => "PAtom" |
14:25:25 | FromDiscord | <Zoom> Do we have anything to simplify GraphQL querying? Too much effort to deal with paging by hand. |
14:35:33 | FromDiscord | <funnybyte> @Rika thanks, that worked |
14:36:02 | FromDiscord | <Rika> In reply to @Rika "You can cast the": sorry, "safely" its not really safe |
14:46:17 | FromDiscord | <d4rckh> is there any way i can save my cwd when running shell commands via `execCmdEx` and then restore it later? |
14:46:57 | FromDiscord | <d4rckh> i can use the `workingDir` parameter to specify a specific working dir, but what about saving it? |
15:13:38 | * | ltriant joined #nim |
15:14:48 | * | vicfred quit (Quit: Leaving) |
15:32:42 | FromDiscord | <KatrinaKitten> In reply to @eyecon "<@204718116020682753> would you be": I don't recall, feel free to send it in and I'll take a look. |
15:42:28 | * | hellstabber_ joined #nim |
15:44:46 | FromDiscord | <Zoom> What do you mean saving? You either get it by `getCurrentDir` or you change it manually.↵(@d4rckh) |
15:44:49 | * | joshbaptiste1 joined #nim |
15:45:10 | * | laintree joined #nim |
15:45:58 | FromDiscord | <d4rckh> well, was thinking they would be a way to edit my path by just running `cd <path>` via execCmd |
15:46:50 | FromDiscord | <konsumlamm> In reply to @Gibbons "<@386230567571554305> thanks... but wouldn't": not if the fields are private |
15:47:12 | FromDiscord | <d4rckh> (edit) "they" => "there" |
15:47:58 | FromDiscord | <Gibbons> In reply to @konsumlamm "not if the fields": Thanks for the answer... yes, in fact that's the thing I've done at this point |
15:48:29 | * | madprops_ joined #nim |
15:49:58 | * | hellstabber quit (*.net *.split) |
15:49:58 | * | fallback quit (*.net *.split) |
15:50:00 | * | lain quit (*.net *.split) |
15:50:00 | * | joshbaptiste quit (*.net *.split) |
15:50:00 | * | nisstyre quit (*.net *.split) |
15:50:01 | * | madprops quit (*.net *.split) |
15:50:01 | * | hellstabber_ is now known as hellstabber |
15:56:41 | * | nisstyre joined #nim |
16:02:07 | FromDiscord | <d4rckh> In reply to @d4rckh "well, was thinking there": i did it by checking if the command ran is `cd` and if it i just used setCurrentDir |
16:04:50 | * | fallback joined #nim |
16:39:19 | * | krux02 joined #nim |
17:42:44 | * | xet7 quit (Remote host closed the connection) |
17:43:02 | * | noeontheend joined #nim |
17:43:45 | * | xet7 joined #nim |
17:47:10 | * | noeontheend quit (Ping timeout: 250 seconds) |
17:57:59 | * | rockcavera quit (Remote host closed the connection) |
18:06:19 | * | rockcavera joined #nim |
18:06:19 | * | rockcavera quit (Changing host) |
18:06:19 | * | rockcavera joined #nim |
18:06:31 | * | Jjp137 quit (Quit: Leaving) |
18:09:51 | * | Jjp137 joined #nim |
18:18:43 | * | jmdaemon joined #nim |
18:33:34 | * | jmd_ joined #nim |
18:33:50 | * | jmdaemon quit (Ping timeout: 240 seconds) |
18:42:30 | FromDiscord | <ambient> sent a code paste, see https://play.nim-lang.org/#ix=3Y1j |
18:42:34 | FromDiscord | <ambient> according to that, i can only make a function that takes T, T -- not T, U |
18:42:48 | FromDiscord | <ambient> something I'm misunderstanding? |
19:11:00 | * | rockcavera quit (Remote host closed the connection) |
19:16:34 | * | pro joined #nim |
19:28:05 | * | pro quit (Quit: pro) |
19:35:51 | * | kenran joined #nim |
19:48:01 | * | GULPF joined #nim |
19:49:17 | * | GULPF quit (Client Quit) |
20:11:01 | * | firq quit (Read error: Connection reset by peer) |
20:11:34 | * | firq joined #nim |
20:45:07 | * | madprops_ is now known as madprops |
20:45:07 | * | madprops quit (Changing host) |
20:45:08 | * | madprops joined #nim |
20:48:19 | * | wallabra quit (Ping timeout: 240 seconds) |
20:48:54 | * | wallabra joined #nim |
20:58:53 | * | rockcavera joined #nim |
20:58:53 | * | rockcavera quit (Changing host) |
20:58:53 | * | rockcavera joined #nim |
21:07:07 | * | laintree is now known as lain |
21:22:40 | * | kenran quit (Quit: WeeChat info:version) |
21:32:28 | * | wallabra quit (Ping timeout: 272 seconds) |
21:32:53 | * | wallabra joined #nim |
21:46:37 | FromDiscord | <retkid> how do i access an index in a database |
21:46:57 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/976239424729927690/unknown.png |
21:47:06 | FromDiscord | <retkid> wikipedia uses this structure |
21:47:11 | FromDiscord | <Yardanico> you don't |
21:47:15 | FromDiscord | <retkid> 🥴 |
21:47:20 | FromDiscord | <Yardanico> do you mean the index as in actual index |
21:47:22 | FromDiscord | <Yardanico> or just a numbeR? |
21:47:24 | FromDiscord | <Yardanico> (edit) "numbeR?" => "number ID?" |
21:47:26 | FromDiscord | <retkid> as in page_Id |
21:47:30 | FromDiscord | <Yardanico> then just make a query with that id |
21:47:38 | FromDiscord | <Yardanico> it's not really a question for #main ,it's a basic SQL question |
21:47:47 | FromDiscord | <retkid> well |
21:48:04 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/976239704833916939/unknown.png |
21:48:16 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/976239755618578482/unknown.png |
21:48:19 | FromDiscord | <retkid> now it is |
21:48:24 | * | nsyd joined #nim |
21:48:43 | FromDiscord | <retkid> if you do page_id, there is no table |
21:48:47 | FromDiscord | <retkid> page.page_id either |
21:52:12 | FromDiscord | <retkid> im fucking stupid those are collums |
21:52:16 | FromDiscord | <retkid> (edit) "collums" => "columns" |
21:53:06 | FromDiscord | <retkid> how did i forget about that |
22:04:50 | * | vicfred joined #nim |
22:05:47 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y1X |
22:05:59 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=3Y1X" => "https://play.nim-lang.org/#ix=3Y1Y" |
22:06:35 | FromDiscord | <Elegantbeef> Then dont use multiline strings |
22:06:54 | FromDiscord | <!Patitotective> :[ but theyre nice |
22:06:56 | FromDiscord | <Elegantbeef> `proc foo: string = "hello\nim a multiline string\n"` |
22:07:16 | FromDiscord | <!Patitotective> its less legible |
22:07:24 | FromDiscord | <!Patitotective> and more for longer stirngs |
22:07:26 | FromDiscord | <!Patitotective> (edit) "stirngs" => "strings" |
22:07:29 | FromDiscord | <!Patitotective> (edit) "and ... more" added "even" |
22:10:00 | FromDiscord | <Andreas> In reply to @Patitotective "and even more for": right, btw: maybe please him for a macro - he knows these things 🙂 |
22:10:34 | FromDiscord | <!Patitotective> In reply to @Andreas "right, btw: maybe please": hahah ElegantMacro |
22:10:57 | FromDiscord | <Elegantbeef> you can make a compile time procedure that removes indents, but it wouldnt know where to start |
22:11:14 | FromDiscord | <Elegantbeef> It doesnt have current scope depth knowledge |
22:11:32 | FromDiscord | <spoon> can make a `multiline:` template or something that auto concats strings with a newline |
22:11:44 | FromDiscord | <!Patitotective> smart |
22:11:48 | * | termer quit (Read error: Connection reset by peer) |
22:12:01 | FromDiscord | <Elegantbeef> Why a template? |
22:12:21 | * | termer joined #nim |
22:12:23 | * | nsyd quit (Quit: WeeChat 3.5) |
22:12:31 | FromDiscord | <spoon> guess it would work with commas, too |
22:13:14 | FromDiscord | <judithbnks> I'll help 10 people on how to earn $20,000 within 72 hours but you will pay me 10% of your profit when you receive it.↵Note\: only interested people should apply, drop a message let's get started↵https://t.me/Tradewitholiver01 |
22:13:33 | FromDiscord | <!Patitotective> c-crypto? |
22:14:26 | FromDiscord | <Elegantbeef> We dondeded it |
22:14:30 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y20 |
22:15:23 | FromDiscord | <spoon> calling with `multiline:` so no parentheses would be my preference there, looks cleaner imo |
22:15:48 | FromDiscord | <Elegantbeef> Then go make a macro |
22:16:23 | FromDiscord | <spoon> ah, forgot for procs you have to use `do` syntax |
22:17:51 | FromDiscord | <!Patitotective> how do i make it so i can have a `string` as the return param of a macro, it seems like its a NimNode 🤨 |
22:18:43 | FromDiscord | <spoon> hmm, i know you have to use `static[string]` as an arg |
22:18:44 | FromDiscord | <Yardanico> you just make a NimNode of a string |
22:18:57 | FromDiscord | <resumin> Patitotective\:↵↵https://nim-lang.org/docs/strutils.html#dedent%2Cstring%2CNatural |
22:18:57 | FromDiscord | <Yardanico> and if you need static[string] - just make a compiletime proc instead of a macro? |
22:19:12 | FromDiscord | <!Patitotective> In reply to @resumin "Patitotective\: https://nim-lang.org/docs/strutils": no please |
22:19:14 | FromDiscord | <Yardanico> In reply to @resumin "Patitotective\: https://nim-lang.org/docs/strutils": yes, but this is not that efficient as it dedents in runtime |
22:19:27 | FromDiscord | <Yardanico> unless the C compiler is smart enough to optimize it of course |
22:20:20 | FromDiscord | <!Patitotective> In reply to @Yardanico "you just make a": `result = newStrLitNode("")`? |
22:20:29 | FromDiscord | <Yardanico> In reply to @Patitotective "`result = newStrLitNode("")`?": yes |
22:20:29 | FromDiscord | <!Patitotective> it seems like `result.strVal` is not `var` |
22:20:38 | FromDiscord | <Yardanico> In reply to @Patitotective "it seems like `result.strVal`": ? |
22:20:47 | FromDiscord | <!Patitotective> how do i add to that strlit node? |
22:21:10 | FromDiscord | <!Patitotective> `result.strVal.add "hello"` does not work since `strVal` is not var |
22:21:11 | FromDiscord | <Yardanico> just construct a normal string in the macro, and in the end make a newStrLitNode ? |
22:21:18 | FromDiscord | <!Patitotective> smart |
22:21:19 | FromDiscord | <!Patitotective> thanks |
22:25:25 | FromDiscord | <!Patitotective> how would i echo it? 🤨 ↵https://play.nim-lang.org/#ix=3Y23 |
22:27:38 | FromDiscord | <resumin> dedent works at compile time too |
22:29:04 | FromDiscord | <resumin> assign it to a const and return that value |
22:30:52 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y26 |
22:31:07 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=3Y26" => "https://play.nim-lang.org/#ix=3Y27" |
22:37:57 | FromDiscord | <spoon> maybe you could do it without quotes and make a macro to access the contents of all the indent nodes |
22:38:22 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Y29 |
22:38:52 | FromDiscord | <!Patitotective> In reply to @spoon "maybe you could do": it wouldnt look nice since reserved keywords would get highlighted and it ill be harder to manage `:` or for loops things |
22:38:55 | FromDiscord | <!Patitotective> (edit) "things" => "things, i guess" |
22:39:27 | FromDiscord | <spoon> or custom operator, but also you would have to append spaces so that would be worse than just using dedent |
22:39:41 | FromDiscord | <spoon> well not for a custom operator maybe |
23:02:35 | FromDiscord | <resumin> sent a long message, see http://ix.io/3Y2c |
23:02:59 | FromDiscord | <Elegantbeef> What bug? |
23:04:20 | * | noeontheend joined #nim |
23:06:02 | FromDiscord | <resumin> proc a =↵↵const b = dedent"bang" |
23:06:39 | FromDiscord | <resumin> pretend this intended \:)↵↵I'm using my tablet... |
23:07:16 | FromDiscord | <resumin> \indented |
23:08:02 | FromDiscord | <Elegantbeef> ah it's an issue with the optional |
23:08:13 | FromDiscord | <Elegantbeef> `const b = dedent("myStr", 0)` works |
23:08:35 | FromDiscord | <Elegantbeef> Probably an issue with the `s: string` not being `s: static` |
23:10:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Y2e |
23:12:42 | FromDiscord | <resumin> I'm not familiar with the compiler code that affects that. It still seems like a bug with just the temp symbol's prefix printed in the error message |
23:13:03 | * | jmd_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:15:44 | * | jmdaemon joined #nim |