<< 18-02-2023 >>

00:05:27FromDiscord<Hourglass [She/Her]> What if... I did a "im on 10 different types of crack!" and made even the core networking stuff a module
00:06:44FromDiscord<Hourglass [She/Her]> (edit) "module" => "plugin"
00:23:27FromDiscord<auxym> i haven't all the discussion on plugins. But I'd say my experience with software that use the "tiny core and every functionality is a plugin" paradigm has not been super great. ie. jenkins comes to mind, and some other stuff I'm forgetting about. I can't think of great software I love to use that works like that.
00:25:27FromDiscord<auxym> I mean, I guess you can architect it that way "under the hood", but your users probably don't want to know about it
00:44:05NimEventerNew thread by takekikuchi: About NimMain when launching multiple Nim tasks on RTOS (FreeRTOS, Zephr, etc.), see https://forum.nim-lang.org/t/9901
00:49:12FromDiscord<Yepoleb> In reply to @Hourglass, When the Hour Strikes "What if... I did": you don't even need plugins at all at this stage
00:50:32FromDiscord<Yepoleb> your plugin api will be shit if you don't know what code will interface with it
00:50:45FromDiscord<Yepoleb> and you don't know that because you have not written any
00:55:03FromDiscord<Yepoleb> of course you could plan all the plugins and what interfaces they will need and what parameters and all their inner workings without writing any code but that's 100 times harder than doing it step by step the way you normally do it
01:06:02FromDiscord<Hourglass [She/Her]> In reply to @Yepoleb "your plugin api will": I don't get what you mean by this, wdym by the code that'll interface with it? Of course I don't know how it'll work completely but I definitely have some solid ideas that can be planned around + I've implemented the beginnings of the idea a long time ago, the issue with that attempt was nothing was planned and it was all so tightly linked yet.. 'abstracted'
01:07:08FromDiscord<Hourglass [She/Her]> In reply to @auxym "I mean, I guess": What do you mean by this exactly? I've never used Jenkins so I'm not really knowledgeable about it
01:08:20FromDiscord<Yepoleb> In reply to @Hourglass, When the Hour Strikes "I don't get what": defining a plugin api for code you have already written will be much easier than defining one for code you have not written
01:08:43FromDiscord<Yepoleb> and you will usually end up with generally better design
01:09:38FromDiscord<Hourglass [She/Her]> That's my issue though, I understand what you're saying but when I do that I get a mess, unironically
01:10:17FromDiscord<Hourglass [She/Her]> Many of my repos on GitHub are proof of that, I don't have an idea for the structure and it all meshes into some uncomprehendable mess
01:11:20FromDiscord<Hourglass [She/Her]> It's why I've taken time to design the skeleton for the plugin API, it's not complete but I think the structure of it will be much easier to work with than if I tried to port work I've already done to it
01:13:34FromDiscord<Hourglass [She/Her]> Maybe splitting it all up into as many parts as possible is a bad idea, but defining a basic API to work with is a good idea imo
01:13:40FromDiscord<Yepoleb> having a lose idea of the structure in mind is great, but you're most likely still going to have to do big restructures and rewrites in the process
01:14:58FromDiscord<Hourglass [She/Her]> I'm fine with that and that's a given, is it not?
01:16:03FromDiscord<Hourglass [She/Her]> I'm not writing this to be the end all design, I wrote it so i have a more tangible idea to stare at and model around, but already aware that I'll likely change it multiple times before I'm happy/it works in a sane way
01:17:26*azimut quit (Ping timeout: 255 seconds)
01:27:59FromDiscord<Yepoleb> Well it seems like multiple people think you're overdoing the planning and should do more restructure instead
01:55:40FromDiscord<Hourglass [She/Her]> As in writing the plugins and stuff to get it all working? Yeah I'm doing that tomorrow/later today, I've been laying in bed for 2 hours now to rest lol
02:14:01*xet7 quit (Remote host closed the connection)
02:39:50*rockcavera quit (Remote host closed the connection)
02:59:47NimEventerNew Nimble package! lowdb - Low level db_sqlite and db_postgres forks with a proper typing, see https://github.com/PhilippMDoerner/lowdb
03:01:01systemdsucksthat looks nice
03:31:50FromDiscord<ringabout> https://github.com/nim-lang/db_connector/blob/e8bf89c30ead2b7fc9569469d5b572121909d13d/src/db_connector/db_sqlite.nim#L170 `{.experimental: "codeReordering".}` should be removed from the code.
03:36:46NimEventerNew thread by guzba: Nim in production: 350+ HTTP requests per second on a very modest VM, see https://forum.nim-lang.org/t/9902
03:38:52FromDiscord<auxym> yay nimeventer is back, thanks @Yardanico (and @Phil for bringing it up)
04:10:50*arkurious quit (Quit: Leaving)
04:54:11NimEventerNew post on r/nim by cell_me_C_twos: Async server connection interrupt when client disconnects., see https://reddit.com/r/nim/comments/11577kp/async_server_connection_interrupt_when_client/
04:57:28*ltriant joined #nim
05:02:13*ltriant quit (Ping timeout: 246 seconds)
05:15:45*jkl1337 is now known as jkl
05:25:47*rockcavera joined #nim
07:10:40FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4opL
07:13:50*ltriant joined #nim
07:13:58FromDiscord<ringabout> which is not compatible with the proposed de-pipeline parsing => https://github.com/nim-lang/Nim/pull/21379
07:15:49FromDiscord<ringabout> It works like `push pragmas` before without specification. I might drop support for this usage. It means only `push pragmas` will continue to work like before => https://github.com/nim-lang/Nim/pull/21388
07:16:26FromDiscord<ringabout> if users need to override the settings temporarily
07:19:05FromDiscord<ringabout> Only backend checks are affected, which means checks at semantic phases might prolong its old behavior.
07:23:13FromDiscord<ringabout> For instance, `{.warning[BareExcept]:on.}` might work in the future, but `{.overflowChecks: on.}` might not work anymore.
07:24:39*ltriant quit (Ping timeout: 255 seconds)
07:25:22FromDiscord<Elegantbeef> What do you mean?↵(@ringabout)
07:25:23FromDiscord<firasuke> qualified imports mean that if I say `from x import y` only `y` will be imported from `x` nothing else?
07:26:11FromDiscord<Rika> In reply to @firasuke "qualified imports mean that": That isn’t qualified I believe
07:26:20FromDiscord<Rika> That’s just selective importing
07:26:25FromDiscord<Elegantbeef> That's not qualified correct
07:27:22FromDiscord<Phil> In reply to @firasuke "qualified imports mean that": Correct, only the symbol y will be made available.
07:27:46FromDiscord<firasuke> In reply to @Elegantbeef "That's not qualified correct": oh ok
07:27:58FromDiscord<firasuke> are they recommended over regular imports?
07:28:10FromDiscord<Elegantbeef> No
07:28:17FromDiscord<Rika> Recommendations are not made by the language for this case
07:28:18FromDiscord<Elegantbeef> Idiomatic nim does not do `from x import y` or `import x as y`
07:28:37FromDiscord<ringabout> In reply to @Elegantbeef "What do you mean?": I mean, for `overflowChecks:off` behave like `{.push overflowChecks:off.}` for simple cases. In the future, this might change. The whole program will always use `overflowChecks:on` options instead of different checking options.
07:28:45FromDiscord<Phil> Hmm I think you might break generics with selective imports like that
07:28:45FromDiscord<ringabout> (edit) "In reply to @Elegantbeef "What do you mean?": I mean, for ... `overflowChecks:off`" added "now"
07:28:55FromDiscord<Elegantbeef> no selective imports move symbols in
07:28:59FromDiscord<ringabout> (edit) "behave" => "behaves"
07:29:01FromDiscord<Elegantbeef> qualified imports do not
07:29:22FromDiscord<Phil> Ah, so they generics will bind their symbols before being imported? Alrighty
07:29:27FromDiscord<Phil> (edit) removed "they"
07:30:12FromDiscord<Elegantbeef> I believe you're confused phil
07:30:20FromDiscord<ringabout> In reply to @ringabout "I mean, for now": You cannot override the settings temporarily using `{.overflowChecks: on.}`. The last one persists the whole module.
07:30:24FromDiscord<ringabout> (edit) "In reply to @ringabout "I mean, for now": You cannot override the settings temporarily using `{.overflowChecks: on.}`. The last one persists ... the" added "in"
07:30:25FromDiscord<firasuke> In reply to @Elegantbeef "qualified imports do not": what's the diff between selective and qualified imports?
07:30:42FromDiscord<Elegantbeef> `import x as nil` means all symbols need to be prefixed with `x.`
07:30:45*genpaku quit (Remote host closed the connection)
07:31:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4opP
07:32:42*genpaku joined #nim
07:34:56FromDiscord<firasuke> I see
07:36:21FromDiscord<ringabout> For example, in https://github.com/nim-lang/Nim/pull/21390 for future's sake, I'm fixing this.↵(@ringabout)
07:39:22FromDiscord<ringabout> And it might be wrong.
07:39:30FromDiscord<ringabout> Misused.
07:40:08FromDiscord<Elegantbeef> I see
07:40:42FromDiscord<Elegantbeef> Wishes that inject destructors respected pragmas
07:40:49*PMunch joined #nim
07:41:26FromDiscord<firasuke> Is it better to create a function that runs per argument in `remainingArgs` from parseopt, or just make that function accept a sequence of strings and loop over them inside it?
07:42:32FromDiscord<firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4opX
07:42:54FromDiscord<firasuke> (edit) "https://play.nim-lang.org/#ix=4opX" => "https://play.nim-lang.org/#ix=4opY"
07:43:49FromDiscord<Phil> Why not both?↵Write a func that can deal with one arg, write a second func that uses the first func to deal with all args
07:43:54FromDiscord<Phil> And then you can use either as needed
07:44:06FromDiscord<Phil> Or if the first func is never needed you can just make it private
07:45:07FromDiscord<Phil> Though if all your second func is doing is calling the first one in a loop that transforms the value into something else, then you might as well use `args.mapIt(it.someFunc())`
07:45:35FromDiscord<firasuke> In reply to @Isofruit "Though if all your": oh cool
07:45:49FromDiscord<Phil> note that that proc is from sequtils
07:45:58FromDiscord<firasuke> was gonna ask xD thanks
08:13:01FromDiscord<0xRar> whats the proper way to take multiple user input and store it into an array?
08:16:08PMunchHmm, there is no way to tell Nim that a type used in a procedure forward-declaration will be available for the actual implementation of said proc, but is unknown it the moment?
08:17:28FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#package-level-objects
08:18:08FromDiscord<niguss_101-_-> Hey guys does anybody knows how to launch your website into server or the internet for free b/c most of them makes you pay for hosting and stuffs also it's my first time if some one can guide me
08:18:34PMunchniguss_101-_-, there's no such thing as a free lunch
08:18:48PMunch@Elegantbeef, thanks, that would almost work but not quite
08:18:52FromDiscord<Phil> AWS has a free tier. Never used it, just know it exists
08:19:46PMunchThe problem I have is that I want to grab a C header with Futhark which outlines the procs I need to implement. So I want Futhark to create the correct forward declaration for me so the Nim compiler complains if I forgot one.
08:19:54PMunchGuess I'll add it as a feature to Futhark
08:21:30FromDiscord<amadan> fly.io also has a free tier that I've used and found works well↵You do need to add a card, but thats to prevent fraud
08:21:45FromDiscord<0xRar> whats the proper way to take multiple user input and store it into an array?
08:23:23FromDiscord<Rika> Multiple in what way?
08:23:50FromDiscord<Phil> sent a long message, see http://ix.io/4oq2
08:23:51FromDiscord<niguss_101-_-> Really bro have u tried it before?↵(@amadan)
08:24:09FromDiscord<amadan> yes
08:24:30FromDiscord<0xRar> In reply to @Rika "Multiple in what way?": for example ["test1", "test2"] , all from user input
08:24:38FromDiscord<Rika> Yes but how is it input
08:24:47FromDiscord<Rika> What does “multiple inputs” mean for you
08:24:50FromDiscord<Phil> Are there multiple separate requests or shall the user input a list of entries?
08:25:27FromDiscord<Phil> Like, are you asking the user 50 times something and want to store their answers together?↵Or are you asking the user once and they're supposed to give you 50 values?
08:25:28FromDiscord<Rika> In reply to @Isofruit "Are there multiple separate": Be careful of over complicating things and confusing the one asking
08:26:01FromDiscord<0xRar> example https://media.discordapp.net/attachments/371759389889003532/1076419303471067216/image.png
08:27:47FromDiscord<0xRar> so the user enters 3 names, and all of the names will be stored in the array
08:28:06FromDiscord<0xRar> sorry i know its confusing idk how to deliver the question
08:28:37FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oq4
08:29:04FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4oq4" => "https://play.nim-lang.org/#ix=4oq5"
08:29:15FromDiscord<Rika> In reply to @Isofruit "What's stopping you from": You should consider that it is likely that the person you’re helping is new to programming
08:29:20FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4oq5" => "https://play.nim-lang.org/#ix=4oq6"
08:29:24FromDiscord<Rika> Or at least not as experienced, perhaps
08:29:33FromDiscord<0xRar> In reply to @Isofruit "What's stopping you from": not knowing everything about the language ?
08:31:13FromDiscord<Phil> In that case there you go.↵You can create a list that you can modify with `var y: seq[string] = @[]`.↵You can then for every iteration you're doing add the output you receive for it by using the `add` proc.↵That way all your inputs will be stored in y and you can do whatever you need to with them later
08:31:36FromDiscord<Phil> Note that the `var` is essential here. `let` will forbid you modifying the list, so you won't be able to add anything to it.
08:33:05FromDiscord<amadan> In reply to @0xRar "example": If `num_keys` is 4 do you want the user to enter 4 names or 5?↵In Nim `0 .. num_keys` is inclusive e.g. this would loop `num_keys + 1` times↵`0 ..< num_keys` is exclusive e.g. this would loop `num_keys` times
08:33:11FromDiscord<Phil> Also in case you're coming from python, keep in mind that the range is inclusive.↵So if , say, num_keys is the number `3`, then this for loop will run 4 times, one time each for the values `0`, `1`, `2` and `3`
08:33:18FromDiscord<Phil> (edit) "inclusive.↵So" => "inclusive in nim.↵So"
08:33:38FromDiscord<Phil> Dangit, too slow again!
08:33:40FromDiscord<amadan> ^ probably simpler explanation
08:33:51FromDiscord<niguss_101-_-> Have u ever launched a website to the internet hlbtw?↵(@Phil)
08:34:00FromDiscord<Phil> Multiple times, just not on AWS.
08:34:43FromDiscord<amadan> the `..` and `..<` is lowkey a feature I love about Nim↵so much nicer than having to remember if a function bounds are inclusive or exclusive
08:36:49FromDiscord<0xRar> ty everyone
08:37:33FromDiscord<Phil> In reply to @Rika "You should consider that": Typically for any kind of problem there may be reasons why an existing solution could've been dismissed for reasons I may be overlooking, that's why I not seldom ask if the first solution I can think of has already been thought of or not.↵Often enough the answer to that one is "This doesn't work because of reason I couldn't infer earlier number X"
08:37:58FromDiscord<firasuke> In reply to @Isofruit "What's stopping you from": given the same example, what's a better way to loop over y? Is `for x in y` better than `y.mapIt` from sequtils?
08:38:20FromDiscord<Phil> In reply to @firasuke "given the same example,": That is very much a style question.↵Functionally both work
08:38:40FromDiscord<Phil> The reason I prefer mapIt is because it "restricts" you in a sense
08:38:47FromDiscord<firasuke> In reply to @Isofruit "That is *very much*": Oh ok
08:39:08FromDiscord<firasuke> for has a sense that you're going to do a lot per iteration, while mapIt is a one-liner kinda thing?
08:39:09FromDiscord<niguss_101-_-> By Paying?↵(@Phil)
08:39:12FromDiscord<Phil> It is a more specific declaration of intent.↵If you loop over a seq you're saying "I will do a thing for each element in the seq. What I'm doing can be all kinds of things"
08:39:50FromDiscord<firasuke> In reply to @Isofruit "It is a more": a thing: mapIt↵all kinds of things: for
08:40:26FromDiscord<Phil> If you use mapIt you are very specifically saying "I will transform each element in this seq into a different element. I will do nothing else. I won't fire unrelated HTTP requests, this function call is only about transforming value a to output b and creating a second sequence that contains all the transformed values"
08:40:56FromDiscord<Phil> (edit) "requests," => "requests or other wonky things,"
08:40:57FromDiscord<firasuke> Awesome, thanks for clarifying!
08:41:49FromDiscord<Rika> In reply to @Isofruit "If you use mapIt": But you can do that though
08:42:08FromDiscord<Rika> You can do things unrelated to transformation inside map and friends, no?
08:42:29FromDiscord<Phil> In reply to @Rika "But you can do": The fact that nim allows it and what they're intended for are 2 different pairs of shoes
08:42:37FromDiscord<Rika> Sure
08:46:28FromDiscord<Phil> In reply to @firasuke "Awesome, thanks for clarifying!": Anyway, what I've described is part of a paradigm called functional programming btw.↵As you learn more about the language you will keep stumbling over certain function names for dealing with lists/sequences/iterables, like map, filter, any, some, find, forEach and I feel like I forgot a fair amount but those are among the standard ones.↵Many languages will have these implemented
08:47:12FromDiscord<Phil> So if you want to get a gist on those you can look a bit more into that.↵Nim has mapIt, filterIt etc. so that you can do these kinds of things a bit more concisely
08:47:18FromDiscord<Phil> (edit) "So if you want to get a gist on those you can look a bit more into that.↵Nim has mapIt, filterIt etc. ... so" added "as a convenience"
08:47:19FromDiscord<firasuke> Oh cool, but what about Nim? what's the standard way of iterating over a sequence while doing a bunch of stuff per iteration?
08:47:37FromDiscord<firasuke> In reply to @Isofruit "So if you want": got it
08:49:13FromDiscord<Phil> Generally `for x in y` is slightly preferred, though if you're only doing a single thing (like only transforming a to b) then sequtils is also fine.↵The reasoning for that is that for every operation you do with mapIt/filterIt etc. you're creating a copy of the sequence, which means you're copying the sequence like 5 times if you do 5 operations on it.↵If you combine that all in a for-loop and store the result in a separate seq that only
08:49:36FromDiscord<Phil> (edit) "Generally `for x in y` is slightly preferred, though if you're only doing" => "sent" | "single thing (like only transforming a to b) then sequtils is also fine.↵The reasoning for that is that for every operation you do with mapIt/filterIt etc. you're creating a copy of the sequence, which means you're copying the sequence like 5 times if you do 5 operations on it.↵If you combine that all in a for-loop and store the result in a s
08:49:52FromDiscord<Phil> (edit) "http://ix.io/4oq8" => "http://ix.io/4oq9"
08:51:15FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oqa
08:51:32FromDiscord<Diogenes of Toronto> Hello 👋 I am a new cloud developer with experience mostly with Go. I have 0 experience with nim and I just started a project with it making a personal portfolio site with nim and prologue. I am wondering if there is a way to get client interfaces working with encore. It currently has no nim sdk but it does for js and typescript. And I
08:51:43FromDiscord<Diogenes of Toronto> (edit) removed "And I"
08:52:22FromDiscord<Phil> I can't say I've used encore before, let me google that
08:52:45FromDiscord<Diogenes of Toronto> https://encore.dev/docs
08:52:48FromDiscord<Coachonko> Welcome
08:52:55FromDiscord<Coachonko> Also yeah thanks for the link, never heard Encore
08:53:26FromDiscord<firasuke> In reply to @Isofruit "Generally `for x in": thanks a lot for the explanation, things are much clearer now
08:54:05FromDiscord<Diogenes of Toronto> https://github.com/Diogenesoftoronto/nimdude this is my site currently
08:54:13FromDiscord<Phil> That question is complex enough that I feel I'd need experience with encore to tell you what the correct response is
08:54:19FromDiscord<Diogenes of Toronto> Literally boiler that's it just started an hour ago
08:54:40FromDiscord<Diogenes of Toronto> In reply to @Isofruit "That question is complex": I see.
08:54:46FromDiscord<Diogenes of Toronto> That makes sense
08:55:39FromDiscord<Phil> It might be easier if you tell me what prologue would need to do and I could give responses to that
08:55:40FromDiscord<firasuke> what's the preferred method for handling errors, currently I'm using `try`/`except` (parsing a file that doesn't exist..)
08:56:44FromDiscord<Diogenes of Toronto> In reply to @Isofruit "It might be easier": Basically it would need to use type safe rpc interfaces
08:56:51FromDiscord<Phil> In reply to @firasuke "what's the preferred method": In what sense? If you want to handle a runtime-error, you can use try-except-(finally).
08:57:13FromDiscord<Phil> In reply to @Diogenes of Toronto "Basically it would need": And it would need to provide the httpserver and all of that would need to compile to JS?
08:57:51FromDiscord<Diogenes of Toronto> Nothing need to compile to js really
08:57:56FromDiscord<firasuke> In reply to @Isofruit "In what sense? If": user passes an argument, function tries to parse that argument, if it doesn't exist user gets "doesn't exist"
08:58:00FromDiscord<Phil> In reply to @niguss_101-_- "By Paying? (<@180601887916163073>)": Yes
08:58:37FromDiscord<Phil> In reply to @firasuke "user passes an argument,": In that caes try-except seems like the correct choice because you know what to do if a FileNotFound runtime-exception occurs.
08:58:38FromDiscord<Diogenes of Toronto> I just want a way to get client rpc interfaces generated from encore usable from the prologue server
08:58:52FromDiscord<firasuke> In reply to @Isofruit "In that caes try-except": ok cool
08:59:10FromDiscord<Diogenes of Toronto> https://encore.dev/docs/develop/client-generation
08:59:41FromDiscord<Phil> In reply to @Diogenes of Toronto "I just want a": The client that encore generates, is it HTML files? Is it a JS client-side-rendering program?
08:59:55FromDiscord<Diogenes of Toronto> It's js or ts or go files
09:00:18FromDiscord<Diogenes of Toronto> They are functions
09:00:30FromDiscord<Diogenes of Toronto> To call encore procs
09:01:31FromDiscord<Diogenes of Toronto> So it's more like using nim to parse js ts or go files and generate nim procs from that
09:01:43FromDiscord<Phil> So encore is generating the client, gotcha.↵How would prologue be interacting with encore?↵Do you just have to provide endpoints following a certain specification provided by encore?↵Do you have to bind to encore and it does request-handling for you?
09:02:11FromDiscord<Diogenes of Toronto> Encore provides endpoints
09:02:37FromDiscord<Diogenes of Toronto> Client makes requests to encore
09:03:55FromDiscord<Phil> by endpoints you mean functions that handle HTTP requests, or do you mean an entire route which would also include a mapping of route to said function?
09:05:09FromDiscord<Diogenes of Toronto> I think both... it's a function that handles a request from a specified route.
09:05:35FromDiscord<Phil> I think then I'm a bit lost because at that point I'm not sure what prologue is doing ^^'
09:06:23FromDiscord<Diogenes of Toronto> Maybe I'm explaining this wrong but prologue is calling those endpoints via these generated client functions.
09:07:40FromDiscord<Diogenes of Toronto> I can use encore with client generation. With just naked http calls
09:07:50FromDiscord<Diogenes of Toronto> (edit) "with" => "without"
09:09:57FromDiscord<Phil> I'm also reading the github, but I think I fundamentally don't see what building-blocks and responsibilities are where in it.↵I'll have to go with "I don know" because I'd really need experience with said framework to understand that.
09:11:12FromDiscord<Diogenes of Toronto> Makes sense
09:11:19FromDiscord<Diogenes of Toronto> I still don't get encore
09:11:28FromDiscord<Phil> Me neither 😄
09:12:21FromDiscord<Diogenes of Toronto> Tbh I am considering ditching prologue completely and trying to use karax exclusively
09:13:15FromDiscord<Phil> I mean, prologue is a web-framework when you provide the httpserver yourself and write your own route-handlers.↵I'm not sure how you would go about adding endpoints generated in go or ts/js to it
09:14:11FromDiscord<Phil> (edit) "I mean, prologue is a web-framework when you provide the httpserver yourself ... and" added "(as in, that server is part of prologue)"
09:14:42FromDiscord<Phil> karax for generating HTML is nice though
09:15:07FromDiscord<Phil> (edit) "HTML" => "HTML/SPAs"
09:15:27FromDiscord<Diogenes of Toronto> Yeah that's what I want it for.
09:16:08FromDiscord<Diogenes of Toronto> But I have no idea how to have karax work with a go server
09:16:36FromDiscord<Diogenes of Toronto> So I'm using prologue as a internediary
09:18:13FromDiscord<Phil> In reply to @Diogenes of Toronto "But I have no": let me ping @hotdog for you, he plays around more with karax than I do.↵I feel like it should be possible to just compile the karax bit into a JS program and then have that interact with encore, but he'll know if I'm talking out of my ass there or not.
09:18:25FromDiscord<Diogenes of Toronto> Okay
09:19:19FromDiscord<Diogenes of Toronto> This community is awesome
09:21:50FromDiscord<Coachonko> Mostly Phil
09:22:51PMunch:(
09:23:26PMunchKarax is basically server agnostic AFAIK, so there shouldn't be any issue with using Karax and a non-Nim server
09:25:39FromDiscord<hotdog> In reply to @Isofruit "let me ping <@472459996068839424>": Hey 👋
09:26:00FromDiscord<hotdog> @Diogenes of Toronto are you using Karax SSR or compiling it to js?
09:26:49FromDiscord<Phil> In reply to @Coachonko "Mostly Phil": I feel like that's doing a disservice to a lot of the folks here. I jump in here once every couple days for a few hours until I do my own stuff. Other folks are here a lot more consistently with support
09:27:58FromDiscord<Phil> And even then the pointers I give are the kind of stuff that the bing search bot could tell you 😛
09:28:40FromDiscord<Diogenes of Toronto> In reply to @hotdog "<@282559232325189634> are you using": I currently using it server side but I am considering compiling to js. Not sure which will be better for my use case atm
09:29:35PMunch@Phil, haha imagine asking the Bing bot for something and getting "Ask @hotdog, they probably know"
09:29:40FromDiscord<hotdog> In reply to @Diogenes of Toronto "I currently using it": Cool. Can you give an example of an encore api you want to call from the app?
09:29:48FromDiscord<Diogenes of Toronto> Yes
09:30:01FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, haha imagine asking": That would legit be hilarious and if I were hotdog in that scenario I'd be worried 😛
09:30:20FromDiscord<Diogenes of Toronto> func Generate404(ctx context.Context, name string) (Response, error) {↵ msg := Get404Image()↵ return &Response{Message: msg}, nil↵}
09:33:33PMunchWhat's the deal with pkgs2?
09:34:27FromDiscord<Phil> Like, why does it exist?
09:34:34PMunchThe packages in pkgs seems to take precedence
09:34:40FromDiscord<hotdog> In reply to @Diogenes of Toronto "func Generate404(ctx context.Context, name": I think if your backend is currently in go, it’s probably best to leave it in go and make a Karax spa that compiles to js. Create an api that Karax can call if there’s any things that need to be triggered from client side
09:34:47FromDiscord<Phil> Hmmm I don't think it does for me
09:34:51FromDiscord<Phil> when I use devel that is
09:35:12PMunchI have a bunch of Futhark versions in pkgs, and I just did some modifications and nimble install-ed Futhark, this but it into pkgs2
09:35:21PMunchNow when I try to use it my changes aren't working
09:35:36PMunchI'm also on devel..
09:35:40FromDiscord<Phil> Okay so you are on nim devel?
09:35:41FromDiscord<Phil> Hm
09:35:47FromDiscord<hotdog> If you want to do the whole thing in nim, you’ll need to find a way of generating nim client code for encore (or use the raw encore endpoints)
09:36:22PMunchAh right, now I changed to stable and installed again and it works (because it installed into pkgs)
09:36:24FromDiscord<Diogenes of Toronto> Got it. Raw encore endpoints are not idea but not a huge hassle
09:36:37FromDiscord<Diogenes of Toronto> (edit) "idea" => "ideal"
09:36:43FromDiscord<Phil> Pmunch , your system is a mystery to me
09:36:45FromDiscord<Rika> It’s to do with nimble 0.13 and 0.14 no?
09:36:52FromDiscord<Rika> 0.14 was a very major refactor
09:37:00FromDiscord<hotdog> In reply to @PMunch "<@180601887916163073>, haha imagine asking": I love how sassy the bing bot is
09:37:16FromDiscord<Phil> Could be, actually
09:37:34FromDiscord<Phil> Yeah very likely has, choosenim also changes the nimble version
09:37:39PMunchUhm, what? Error: type mismatch: got 'openArray[string]' for 'forwards' but expected 'seq[string]'
09:37:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oqo
09:37:52FromDiscord<Rika> In reply to @PMunch "Uhm, what? Error: type": What do you mean what
09:37:56PMunchYes I'm guessing this is the new lockfile support from nimble
09:37:56FromDiscord<Diogenes of Toronto> I signed up for all the bing stuff and they still haven't given access
09:38:05PMunchAnd Nim not properly choosing the version
09:38:22FromDiscord<hotdog> In reply to @Diogenes of Toronto "Got it. Raw encore": Nim is a nice language for making these things simpler. You could write some code that takes the api definition from encore and creates a type safe api client
09:38:24PMunch@Phil, why is my system a mystery?
09:38:56FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, why is my": Because it prioritized a pkg package over pkgs2 while you were on devel 😛
09:39:11FromDiscord<hotdog> In reply to @Diogenes of Toronto "I signed up for": Same
09:39:30FromDiscord<amadan> Think I just deleted the pkg directory so it would always use pkgs2↵That broke my binary packages I had installed though
09:39:51PMunch@Phil, oh :P I mean I just ran choosenim update devel, not my fault it's behaving strangely
09:39:53FromDiscord<Diogenes of Toronto> In reply to @hotdog "Nim is a nice": I do want to do something like this but I also wanted this done yesterday
09:40:04FromDiscord<Phil> Erm... yeah I'm not that bold to wildly delete that kind of folder from the nimble dir
09:40:23FromDiscord<Diogenes of Toronto> :FeelsBadMan:
09:42:30FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, oh :P I": But yeah, what are your respective nimble versions when that happens? Have you confirmed which it uses by throwing in random echo statements in each package?
09:42:41FromDiscord<hotdog> In reply to @Diogenes of Toronto "I do want to": I’m afraid if you want it done quickly and you want to use encore your best option is to use one of their main languages. Or just do the raw calls
09:42:58FromDiscord<Phil> (edit) "In reply to @PMunch "<@180601887916163073>, oh :P I": But yeah, what are your respective nimble versions when that happens? Have you confirmed which ... it" added "installed package"
09:43:47FromDiscord<Diogenes of Toronto> Yeah... I am gonna go with raw calls my app is small enough it ain't gonna matter and I can refactoring later maybe even create a library that helps encore nim devs
09:44:43FromDiscord<Diogenes of Toronto> Also side not I can compile karax to wasm right? Can I serve that to the browser instead and is that a stupid idea?
09:45:52FromDiscord<hotdog> In reply to @Diogenes of Toronto "Yeah... I am gonna": Good plan
09:46:19FromDiscord<hotdog> In reply to @Diogenes of Toronto "Also side not I": In theory yes but I wouldn’t
09:46:48FromDiscord<Diogenes of Toronto> Got it
09:47:21PMunch@Phil, nah I didn't check because it failed because of an error that isn't present in the latest version
09:47:26PMunchSo I knew it used an older version
09:47:48FromDiscord<Phil> So choosenim is the issue then because it didn't swap the nimble version when you went to devel?
09:47:49PMunchNimble version was 0.14.0
09:47:59FromDiscord<Phil> So it did choose the nimble version, hmmm
09:48:08FromDiscord<Phil> (edit) "choose" => "change"
09:48:10*jmdaemon quit (Ping timeout: 246 seconds)
09:48:20FromDiscord<Phil> Yeah no idea
09:48:23PMunchOf course, otherwise it wouldn't have installed into pkgs2
09:48:40PMunchThe package has a custom task to build which doesn't add in the nimble paths and such though
09:49:01PMunchSo I'm guessing that `nimble build` would've worked, but just plain old `nim c` fails
09:49:34FromDiscord<Phil> That might explain why I would've never encountered this error in a million years
09:49:49FromDiscord<Phil> I don't ever run nim c, I will always have a nimble build task defined
09:58:55FromDiscord<Rika> Meanwhile I never use nimble for anything but package management
09:59:41FromDiscord<Diogenes of Toronto> Nimble is more than a package manager
09:59:46FromDiscord<Diogenes of Toronto> :poggies:
10:00:05FromDiscord<Phil> Nimble tasks are basically bash scripting in nim-script
10:00:12FromDiscord<Diogenes of Toronto> Ooo
10:00:18FromDiscord<Coachonko> In reply to @Isofruit "And even then the": Why would you use Bing
10:00:27FromDiscord<Phil> You can do also fairly complicated setups with config.nims files
10:00:30FromDiscord<Coachonko> But you and Rike alre always helping whenever I am around
10:00:58FromDiscord<Phil> I just don't grok with the mental model of that, I want explicit tasks in one package and not stuff that applies to every task but may only be needed by some
10:01:05FromDiscord<Phil> So I have nimble tasks everywhere
10:01:10*azimut joined #nim
10:01:30FromDiscord<Phil> But that doesn't mean it isn't perfectly valid, some folks swear by it, ages long config.nims files attest to that
10:02:22FromDiscord<Phil> In reply to @Coachonko "Why would you use": The new bing bot is pretty damn good at what it does and is going to be faster at giving you responses
10:02:57FromDiscord<Phil> It also is more likely to find you docs that one of us might just not know about or have forgotten in the moment
10:03:43FromDiscord<Phil> It's not going to answer you really complex questions, but some of the more fundamental stuff it can surely answer or provide links to sources that'll allow you to figure it out
10:04:12FromDiscord<Phil> (edit) "out" => "out, and better so than google arguably"
10:04:54FromDiscord<Coachonko> Is it powered by openai?
10:05:20FromDiscord<Coachonko> I have been without my main pc for 1 month and it feels like something big happened with their ai and I am entirely out of the loop
10:06:32FromDiscord<Diogenes of Toronto> In reply to @Coachonko "I have been without": Introducing your copilot for the web: AI-powered Bing and Microsoft...
10:06:52FromDiscord<Diogenes of Toronto> https://youtu.be/rOeRWRJ16yY
10:07:14FromDiscord<Diogenes of Toronto> Watch that. Keeps you in the loop
10:07:54FromDiscord<Diogenes of Toronto> https://simonwillison.net/2023/Feb/15/bing/
10:08:02FromDiscord<Diogenes of Toronto> Read this for some pitfalls
10:11:39FromDiscord<Phil> My man loses his PC in the one month where bing starts to launch something that'd make it able to outcompete google
10:11:53FromDiscord<Phil> Just RIP
10:27:23PMunchWhat do you call it in C when you are given a header file and write a program to match it?
10:27:28PMunchImplementing a header?
10:30:49FromDiscord<Yepoleb> Sounds good
10:38:20FromDiscord<Coachonko> In reply to @Isofruit "My man loses his": Are Bing results still very irrelevant though?
10:38:33FromDiscord<Coachonko> I never got what I needed from bing search results
10:39:48FromDiscord<Phil> It's not the bing search engine, it's the bing chatbot that can search the internet for you, AFAICT analyze images for colors and logos on clothing for example, it very easily finds docs apparently (see ringabout posting about it in offtopic sometime over the last 24h)
10:40:30FromDiscord<Phil> (edit) "It's not the bing search engine, it's the bing chatbot that can search the internet for you, AFAICT analyze images for colors and logos on clothing for example, it very easily finds docs apparently (see ringabout posting about it in offtopic sometime over the last 24h) ... " added "and recites those docs as they're needed"
10:40:42FromDiscord<Coachonko> I see
10:40:53FromDiscord<Phil> Like, you can tell it "I have a green waterbottle, does this store sell a tracksuit that matches that color?"
10:41:06FromDiscord<Coachonko> That's a very specific example ngl
10:41:26FromDiscord<Phil> Lifted it explicitly from the WAN-show from Linus-Tech-Tips where they talked about it at length
10:42:22FromDiscord<Coachonko> So you're saying you're not that stylish?
10:42:58FromDiscord<Coachonko> Youtube recommends me the wan show all the time, but I haven't been able to watch anything longer than 10 minutes lately
10:43:05FromDiscord<Coachonko> Sadge
10:43:14FromDiscord<Phil> It's nice background noise
10:44:21FromDiscord<Phil> Either way, I find it a fairly enjoyable listen overall
11:15:44*ltriant joined #nim
13:59:39FromDiscord<turbo> What's the (C-quiv) type and size of `bool`?
13:59:44FromDiscord<turbo> (edit) "(C-quiv)" => "(C-equiv)"
14:00:06FromDiscord<auxym> it's implemented as uint8
14:04:48FromDiscord<turbo> Is it safe to cast between them and assume that 1 = true, 0 = false?
14:13:33Amun-Rayes
14:13:57Amun-Raalthough != 0 is almost always preferred
14:14:48Amun-Ra…and I only hope you didn't mean C-style casts…
14:22:34FromDiscord<Rika> nim `cast[]()` is always assumed to be unsafe
14:23:05Amun-Rasomeint.bool is a different thing
14:26:38FromDiscord<Zoom> no, use `ord`↵(@turbo)
14:27:55Amun-Rauhm?
14:29:09FromDiscord<Zoom> sorry, didn't read the question right
14:30:16FromDiscord<ITR> What was the thing (pragma?) to tell the compiler to ignore that something had side effects inside a func?
14:30:22FromDiscord<Zoom> On the other hand I always assume underlying impl is subject to change unless said not to in the specs
14:31:18FromDiscord<Zoom> {.cast(noSideEffect).}↵(@ITR)
14:31:34FromDiscord<ITR> Thanks!
14:50:13*xet7 joined #nim
15:00:06FromDiscord<ringabout> `{.experimental: "codeReordering".}` is beyond repair, I hope it can be removed from `db_connector/db_sqlite.nim` => https://github.com/nim-lang/db_connector/issues/16 Using forward declarations should suffice to fix it.
15:25:02NimEventerNew thread by bitstorm: Returning to Nim from Python and Rust, see https://forum.nim-lang.org/t/9906
15:30:31PMunchHmm, many people lately complaining about the debug capabilities in Nim
15:34:23FromDiscord<Rika> "lately" is an understatement innit
15:34:56PMunchSure, people have mentioned it before, but it seems to have gotten much more prevalent lately
15:35:54FromDiscord<ITR> if I have a byte and want to write it to a textFile as that byte, what do I do?
15:36:11PMunchCall write on it?
15:36:13FromDiscord<Rika> byte as in the type byte?
15:36:34FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osj
15:36:54FromDiscord<ITR> (edit) "https://play.nim-lang.org/#ix=4osj" => "https://play.nim-lang.org/#ix=4osk"
15:37:55FromDiscord<ITR> but it's currently writing it as an integer to the file. And I had it working, but changed something and managed to break it, lol
15:40:55FromDiscord<ITR> ah, nevermind, i never had it working. But yea, currently writes the number 6 as the ascii number 6 instead of the byte 06.
15:41:16FromDiscord<turbo> Is there a way Nim can retrieve the number of performance cores (on Apple Silicon primarily, but would be great if it would work with later Intel chips as well) rather than _all_ CPU threads?
15:42:15FromDiscord<Rika> In reply to @ITR "ah, nevermind, i never": `f.write(chr(myByte))`
15:42:48FromDiscord<Rika> ig `char()` works too
15:43:37FromDiscord<ITR> In reply to @Rika "`f.write(chr(myByte))`": that worked! thanks!
15:43:45FromDiscord<Rika> :ok`
15:43:47FromDiscord<Rika> (edit) ":ok`" => "👌"
15:43:56FromDiscord<Rika> fuck you irc people i didnt typo shut up
15:44:26FromDiscord<ITR> I completely forgot I wanted it as a char, I kept trying to google how to write an uint8 or byte to a file, lol. Ofc converting it to char was what was needed
15:45:48PMunch@Rika, we. see. everything.
15:46:06FromDiscord<Rika> dont look inside my mind pls
15:50:52*arkurious joined #nim
15:53:01PMunchHmm, looking at how chronicles implements log scopes
15:53:05PMunchPretty interesting hack
16:00:43*xet7 quit (Remote host closed the connection)
16:04:38FromDiscord<Phil> I would involve myself in that discussion but that seems so very much over my head that I think writing docs elsewhere just makes more sense
16:04:57PMunchThe debug discussion?
16:05:11FromDiscord<Phil> Yeah
16:05:37PMunchI think debugger:native and a demangling script is pretty much all you should need..
16:05:44PMunchI've done that in gdb before
16:05:48FromDiscord<Phil> That seems like you need to know about the compiler, how things insert into binaries, how to integrate all of that into vscode etc
16:08:24FromDiscord<Phil> In reply to @PMunch "I've done that in": Yeah but that thread was about how to make it easier, no?↵Or did the guy miss something?
16:16:11PMunchThere used to be a script shipped with Nim that did this
16:19:31FromDiscord<Hourglass [She/Her]> The danger flag compiles files without any sort of bounds checking stuff, right? So instead of catching a rangedefect for example, you have to check if it's in range before accessing it?
16:19:49PMunchCorrect
16:20:40FromDiscord<Hourglass [She/Her]> Good to know
16:20:55FromDiscord<Hourglass [She/Her]> Nimsuggest is really annoying me rip-
16:21:45FromDiscord<Hourglass [She/Her]> When making a change to file b and editing file a, where you've imported file b before, it gets messed up
16:22:09FromDiscord<Hourglass [She/Her]> Restarting Nimsuggest does nothing too so that's a bust
16:23:41PMunchRestarting it doesn't work?
16:23:44PMunchThat's a bit suspect
16:24:29FromDiscord<Hourglass [She/Her]> Not when I do `Ctrl` + `Shift` + `P` and use the `>Nim: Restarts nimsuggest` command
16:24:43FromDiscord<Hourglass [She/Her]> Idk how else I'd restart it
16:30:54PMunchI have no idea which editor that is or what that shortcut does
16:35:26FromDiscord<Hourglass [She/Her]> I'm using Visual Studio Code, CtrlShiftP brings up the command editor
16:38:49FromDiscord<turbo> Restarting VSC itself usually fixes nimsuggest problems for me (kill nimsuggest -> restart VSC)
16:41:00FromDiscord<jmgomez> I would recommend using the langserver, it has some issues on it like navigation doesnt work on win, but it's definitely better than raw nimsuggest
16:42:23FromDiscord<Hourglass [She/Her]> In reply to @turbo "Restarting VSC itself usually": That's annoying to restart it every time it mucks up rip
16:42:31FromDiscord<Hourglass [She/Her]> In reply to @jmgomez "I would recommend using": Good thing I'm a Linux user :P
16:43:22PMunchThis reminds me, I have some stuff I want to get done in NimLSP..
16:44:08FromDiscord<jmgomez> In reply to @PMunch "This reminds me, I": Never really got why they didnt merge the work with yours.. the "official" seems a bit abandoned. Is it yours compatible with vscode?
16:45:18PMunchWell they wanted it to work with the installed nimsuggest, I wanted to use nimsuggest as a library to avoid having to parse nimsuggest output. Difference design goals meant they had to make a new version
16:45:26PMunchThere are some parts which are copied over though
16:45:53PMunchAll LSP servers should be compatible with all LSP clients, that's kind of the entire point
16:46:24FromDiscord<Hourglass [She/Her]> Seems like the nimsaem extension is just kinda completely broken
16:46:28FromDiscord<Hourglass [She/Her]> Nimsuggest and nim lsp
16:46:41*xet7 joined #nim
16:48:48FromDiscord<Hourglass [She/Her]> Yeah, same issue as before
16:49:15FromDiscord<jmgomez> @ringabout talked about the possibility of creating a fork. When NimForUE is feature complete if there isnt any, I may create one from scratch.. but too much on my plate ATM
16:49:28FromDiscord<Hourglass [She/Her]> Even tried pkill for nimsuggest, but nope
16:50:08FromDiscord<Hourglass [She/Her]> Nimsuggest: `object constructor needs an object type [object declared in /home/horizon/Projects/Nim/Nimberite/src/nimberite/plugins/networking/n_1_19_3/exceptions.nim(2, 3)]`
16:50:18FromDiscord<Hourglass [She/Her]> ` raise newException(NimberitePacketParsingError,↵ fmt"Received byte with value of `{data}`, which is too big to be a boolean!")`
16:51:43FromDiscord<Hourglass [She/Her]> code to raise error:`type↵ NimberitePacketParsingError = ref object of CatchableError
16:51:47FromDiscord<Hourglass [She/Her]> (edit) "CatchableError" => "CatchableError`"
16:51:56FromDiscord<Hourglass [She/Her]> Pretty sure this is nimsuggest, right?
16:52:09FromDiscord<Hourglass [She/Her]> (edit) "` raise newException(NimberitePacketParsingError,↵ fmt"Received byte with value of `{data}`, which is too big to be" => "sent" | "boolean!")`" => "code paste, see https://play.nim-lang.org/#ix=4osL"
16:52:18FromDiscord<Hourglass [She/Her]> (edit) "to raise error:`type↵ NimberitePacketParsingError = ref object of CatchableError`" => "paste, see https://play.nim-lang.org/#ix=4osM"
16:57:51FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=4osN
16:58:02FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osO
17:02:31FromDiscord<planetis> imo assign should be renamed to =copy so it works.
17:03:58FromDiscord<Hourglass [She/Her]> In reply to @planetis "no, its object of": I thought it was ref object huh... Welp
17:04:27FromDiscord<Hourglass [She/Her]> Still weird how the error disappeared whenever I edited exceptions.nim slightly
17:04:49FromDiscord<planetis> In reply to @ITR "On packedsets: <https://nim-lang.org/docs/packedset": but even with a seq and latest compiler and -d:strictFuncs this compiles
17:06:29FromDiscord<ITR> In reply to @planetis "but even with a": What is the output for you? For me it outputs 2001 before and 1995 after, but it seems to vary a bit based on memory stuff
17:08:01FromDiscord<planetis> It's the same, I just tried with sanitizers but no error
17:08:24FromDiscord<planetis> Did you compile with v1.6 and refc?
17:10:01FromDiscord<Hourglass [She/Her]> How would I get a short from two bytes in Nim? Not super sure
17:10:38FromDiscord<demotomohiro> Short means 16bit int type?
17:10:45FromDiscord<Hourglass [She/Her]> Yep
17:11:26FromDiscord<demotomohiro> If so, `(a.int16 shl 8) or b.int16
17:11:51FromDiscord<demotomohiro> `a` and `b` are int8.
17:17:14FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osT
17:17:35FromDiscord<Hourglass [She/Her]> Shouldn't `127` as `a` and `b` give `32767`? I only get `32639`
17:18:03FromDiscord<Hourglass [She/Her]> Since `127` is the max value for `int8`s
17:20:08FromDiscord<demotomohiro> !eval echo import strutils; echo 127.toBin(8)
17:21:08NimBotCompile failed: <no output>
17:21:31FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=4osV
17:21:53FromDiscord<Hourglass [She/Her]> In reply to @demotomohiro "!eval echo import strutils;": Aaah i realised my error I think
17:21:56FromDiscord<Hourglass [She/Her]> Two's complement?
17:22:02FromDiscord<planetis> except try to work around it by removing the globals and using a main
17:22:12FromDiscord<Hourglass [She/Her]> Flips the first bit to signify it's signed?
17:22:23FromDiscord<Hourglass [She/Her]> Well
17:22:28FromDiscord<Hourglass [She/Her]> I can't word stuff properly
17:22:37FromDiscord<ITR> In reply to @planetis "except try to work": my current workaround is using .assign instead which does a deep copy, and that works
17:22:46FromDiscord<ITR> How do I upgrade to v2-rc?
17:24:10FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4osW
17:24:13FromDiscord<planetis> In reply to @ITR "my current workaround is": btw I just tried nimv1.6 and I get the same output across different runs, is that what you meant??
17:24:42FromDiscord<planetis> or that just the variable a is not deep copied?
17:25:11FromDiscord<ITR> No, I get that a is mutated inside the func
17:25:50FromDiscord<planetis> try to open an issue for that, it shouldn't happen
17:26:07FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4osZ
17:26:14FromDiscord<ITR> sent a code paste, see https://play.nim-lang.org/#ix=4ot0
17:26:49FromDiscord<planetis> yes ok I get what you mean, it shouldn't happen
17:28:37FromDiscord<planetis> but if the =copy operator is blank then there no way to detect this, right? That's where the 'bug fix' should be.
17:29:28FromDiscord<Hourglass [She/Her]> Oh god, I need to deal with endianness
17:29:54FromDiscord<Hourglass [She/Her]> Shouldn't be hard to check if the system it's running on is big endian or not
17:30:01FromDiscord<Hourglass [She/Her]> std/endians ftw
17:30:25FromDiscord<planetis> In reply to @planetis "but if the =copy": Again don't expect this to work for v1.6, it's v2 material
17:31:10*jmdaemon joined #nim
17:31:31FromDiscord<ITR> In reply to @planetis "Again don't expect this": yea, my workaround works great so no issues there, just figured I should report it if it's broken
17:31:54FromDiscord<ITR> is there a preview of v2 I should test on before sending in a bug report?
17:32:04FromDiscord<ITR> in case it's already fixed on dev or something
17:32:35FromDiscord<planetis> I tried myself, it's not. open an issue if you have time, that would be appreciated
17:33:25FromDiscord<planetis> but if you want to try yourself then there is https://github.com/nim-lang/nightlies/releases and https://nim-lang.org/blog/2022/12/21/version-20-rc.html
17:33:40FromDiscord<ITR> 👍
17:41:37FromDiscord<Hourglass [She/Her]> I can parse `int16`s now but, how about `uint32`?
17:42:52FromDiscord<Hourglass [She/Her]> In reply to @demotomohiro "If so, `(a.int16 shl": Also for this, for small endian machines (since i'm receiving bytes in the big endian format), I need to swap the endianness?
17:46:01FromDiscord<demotomohiro> @Hourglass [She/Her] If these 2 bytes are 16bit int in big endian and your machine is little endian, you need to swap.
17:46:30FromDiscord<Hourglass [She/Her]> In reply to @demotomohiro "<@909883978717204561> If these 2": Alright good to know, did that but wanted to check xD
17:49:42FromDiscord<planetis> In reply to @ITR "👍": btw what did you mean by "but it seems to vary a bit based on memory stuff" ? just curious
17:51:34FromDiscord<ITR> In reply to @planetis "btw what did you": if I do the code I sent last time then it activates around 35, but if I put in 40 elements it doesn't mutate. Only possible difference is garbage/where in memory stuff is stored
17:51:43*FromDiscord quit (Remote host closed the connection)
17:51:56*FromDiscord joined #nim
17:52:36FromDiscord<ITR> So the way (and if) it mutates also varies based on how many elements is put in it, hence memory stuff
17:54:09FromDiscord<planetis> So it could be an internal seq reallocating and it points to the old one
17:55:34FromDiscord<planetis> lucky for us this kind of issues are fixed in v2 as long it's properly implemented with the destructor hooks
17:56:53FromDiscord<planetis> refc that you are on has a well known bug where let a = b, does not trigger a copy, only if it's changed to var
17:57:39FromDiscord<ITR> nice
17:58:08*jkl quit (Quit: Gone.)
18:03:13*jkl joined #nim
18:28:24FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4otd
18:28:27FromDiscord<Hourglass [She/Her]> Is this a sane way to do that? :p
18:48:56FromDiscord<Hourglass [She/Her]> Does `swapEndian32` work in place? So if I wanted to do `swapEndian32(addr result, addr result)`?
18:52:12FromDiscord<Hourglass [She/Her]> Seems to work
18:53:57*dropkick joined #nim
19:04:06Amun-Rait won't work when useBuiltinSwap is not defined
19:05:47Amun-Rait's highly implementation dependent, it may kick you in the a one day
19:07:28*derpydoo quit (Quit: derpydoo)
19:10:54FromDiscord<Hourglass [She/Her]> `useBuiltinSwap`?
19:11:14FromDiscord<Hourglass [She/Her]> In reply to @Amun-Ra "it's highly implementation dependent,": Implementation in the Nim compiler or C compiler?
19:22:45Amun-RaHourglass: both
19:26:27FromDiscord<Hourglass [She/Her]> So `swapEndian32(addr data, addr result)` is better then?
19:41:56FromDiscord<auxym> sent a code paste, see https://play.nim-lang.org/#ix=4otM
19:43:37FromDiscord<auxym> you just have the know if the int that is coming in over the wire is BE or LE. the way you wrote it is BE. but it would work regardless of your CPU endianness.
19:43:57FromDiscord<Hourglass [She/Her]> Yep it's BE
19:44:08FromDiscord<auxym> is you use swaps, then you'll need to determine the CPU endianness, swap if LE CPU, dont swap if BE cpu
19:44:13FromDiscord<Hourglass [She/Her]> In reply to @auxym "you just have the": Yeah since bit ops handle it and stuff
19:44:28FromDiscord<demotomohiro> Nim & GCC can optimize my swapEndian32 implementation:↵https://godbolt.org/z/6Mj6K5Tjs↵https://godbolt.org/z/fdG5ca47s
19:44:48FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4otO
19:45:08FromDiscord<auxym> In reply to @demotomohiro "Nim & GCC can": see the linked justine.lol article, gcc also optimizes mask+shift+or to a byteswap
19:47:20*dropkick_ joined #nim
19:49:51*dropkick quit (Ping timeout: 248 seconds)
20:04:53*dropkick_ quit (Quit: Leaving)
20:05:19*dropkick joined #nim
20:10:53FromDiscord<Hourglass [She/Her]> Generics could be abused so much here lol
20:12:02*peterhil joined #nim
20:12:20*dropkick_ joined #nim
20:14:55FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4otY
20:15:03*dropkick quit (Ping timeout: 255 seconds)
20:15:20FromDiscord<Hourglass [She/Her]> Why would I do this besides sparing me from a lot of writing though, is the question :p
20:15:52FromDiscord<Hourglass [She/Her]> Wait the endian part is a bit trickier
20:17:54FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ou0
20:19:36FromDiscord<Hourglass [She/Her]> I forgot to remove broken code
20:19:38FromDiscord<Hourglass [She/Her]> Meh
20:21:17FromDiscord<Hourglass [She/Her]> I'm using the code
20:26:20FromDiscord<demotomohiro> system module has `SomeNumber` type class: https://nim-lang.org/docs/system.html#SomeNumber
20:29:02FromDiscord<Hourglass [She/Her]> Oh nice!
20:29:47FromDiscord<Hourglass [She/Her]> Is `[R: SomeNumber]` valid for generic procs?
20:31:14FromDiscord<Elegantbeef> Of course
20:32:25FromDiscord<Hourglass [She/Her]> Sweet
20:32:32FromDiscord<Phytolizer> hey all, writing my first "real" app in Nim, which means i want to pass some fields from the nimble package (author/version mainly) into the program. can someone advise me on how to read those fields and pass them in to the compiler?
20:35:17*dropkick_ quit (Remote host closed the connection)
20:35:30FromDiscord<djazz> @Phytolizer like this? https://github.com/PMunch/nimbleutils
20:37:28FromDiscord<djazz> hmm, not sure how `nimble dump` works for current package
20:37:40FromDiscord<Phytolizer> hm, that could work. does nimble not allow reading those values in tasks or something though
20:37:42FromDiscord<djazz> you probably have to just provide your app's package name
20:37:57FromDiscord<djazz> of course you can read them from tasks
20:38:01FromDiscord<Hourglass [She/Her]> Nimsuggest really isn't liking my code
20:38:05FromDiscord<djazz> i thoguht you meant from nim app
20:38:18FromDiscord<Phytolizer> nah, i just want to embed author/version as constants to be used by the program itself
20:38:48FromDiscord<Phytolizer> like `-d:AUTHOR:"My Name"` or something
20:39:25FromDiscord<djazz> that package simply parses `nimble dump` output
20:39:27FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ou5
20:39:38FromDiscord<djazz> should work in const/static mode
20:39:39FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "like `-d:AUTHOR:"My Name"` or": There's string defines iir
20:39:41FromDiscord<Hourglass [She/Her]> iirc
20:40:07FromDiscord<Hourglass [She/Her]> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
20:40:47FromDiscord<Phytolizer> yeah im just wondering if it's possible to hook up via nimble, without having to complicate the build too much
20:41:07FromDiscord<djazz> write a file from before build task? with the values xD
20:41:21FromDiscord<Phytolizer> maybe and staticRead, lol
20:41:38FromDiscord<djazz> staticExec nimble dump/ use the package
20:44:26FromDiscord<Gen> Hi. This is probably a stupid question, but is there a way to import npm packages into a nim program that targets javascript?
20:48:34FromDiscord<Elegantbeef> https://github.com/juancarlospaco/nodejs
20:48:34FromDiscord<Elegantbeef> This should show you how
20:52:00FromDiscord<Phytolizer> i wonder if it'd be an amazingly silly hack to write a `nim.cfg` in the prebuild task lol
20:54:21FromDiscord<Phytolizer> oh i found this, i think it can help: https://github.com/nim-lang/nimble/issues/625
20:56:07FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouk
20:57:49FromDiscord<Hourglass [She/Her]> Nvm
20:58:05FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oul
20:58:28FromDiscord<Phytolizer> i think that might be a syntax restriction with UFCS and generics, because i've hit that before too
20:59:26FromDiscord<Phytolizer> In reply to @Hourglass, When the Hour Strikes "Even when compiling, I": yeah use `[:uint8]` instead of `[uint8]` and i think it will work↵source: https://nim-lang.org/docs/manual.html#procedures-method-call-syntax
21:00:57FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "i think that might": Ah
21:01:02FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "yeah use `[:uint8]` instead": Thanks, will try!
21:02:15FromDiscord<Phytolizer> ok im still trying to shave my yak, how do you write a file in a nim script? i get `Error: cannot 'importc' variable at compile time; c_setvbuf` when trying to use `open`
21:04:08FromDiscord<Phytolizer> ok that error is obvious from reading the nims docs :P
21:05:46FromDiscord<Phil> In reply to @Phytolizer "ok that error is": Yeah, generally the os and osproc modules are likely to have procs that won't work for you.↵Typically nimscript provides in the default-module replacement procs for simple scripting though
21:06:22FromDiscord<Phytolizer> yeah i see a lot of copy, move, etc but no "write" proc
21:06:27FromDiscord<Phil> One sec
21:06:35FromDiscord<Hourglass [She/Her]> doesn't `writeFile` work?
21:06:49FromDiscord<Hourglass [She/Her]> Accepts a file name and a content string
21:07:03FromDiscord<Phytolizer> oh what
21:07:05FromDiscord<Phil> exec nets you any ability to write a file you'd need
21:07:11FromDiscord<Phytolizer> where is that defined lol, it wokred
21:07:49FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oup
21:07:51FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "where is that defined": system.nim lol
21:07:55FromDiscord<Phytolizer> damn of course
21:08:07FromDiscord<Hourglass [She/Her]> There's also `readFile`, which takes a file name and returns a string
21:08:15FromDiscord<Phil> TIL nimscript doesn't have `repr`, my day is ruined
21:08:16FromDiscord<Phytolizer> wonder why that never came up in my search... yeah i knew about readFile
21:08:22FromDiscord<Hourglass [She/Her]> Fair
21:08:33FromDiscord<Hourglass [She/Her]> In reply to @Isofruit "TIL nimscript doesn't have": F
21:08:38FromDiscord<Phytolizer> i also used staticRead for aoc last year
21:08:58FromDiscord<Phil> I'm semi certain that there is no difference between read and staticRead in nimscript
21:09:04FromDiscord<Phytolizer> prob not
21:09:14FromDiscord<Phytolizer> again the stdlib saves the day ❤️ <https://nim-lang.org/docs/strutils.html#dedent%2Cstring%2CNatural>
21:10:49FromDiscord<Hourglass [She/Her]> In reply to @Isofruit "I'm semi certain that": Most definitely not
21:10:59FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "again the stdlib saves": Nim is great
21:11:32FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouq
21:12:37FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ous
21:13:10FromDiscord<Elegantbeef> I see my multiline idea needs to be in sugar
21:13:23FromDiscord<Phytolizer> what's the multiline idea?
21:13:28FromDiscord<Phil> Your what now?
21:14:02FromDiscord<Hourglass [She/Her]> `expression 'read(cast[typeof(recvInto(s, addr data, 2, {SafeDisconn}))](internalTmpFuture`gensym50))' is of type 'int' and has to be used (or discarded); start of expression here: /home/horizon/Projects/Nim/Nimberite/src/nimberite/plugins/networking/n1_19_3/parsing.nim(100, 3)`
21:14:14FromDiscord<Hourglass [She/Her]> (edit) "`expression 'read(cast[typeof(recvInto(s, addr data, 2, {SafeDisconn}))](internalTmpFuture`gensym50))' is of type 'int' and has to be used (or discarded); start of expression here: /home/horizon/Projects/Nim/Nimberite/src/nimberite/plugins/networking/n1_19_3/parsing.nim(100, 3)`" => "sent a code paste, see https://play.nim-lang.org/#ix="
21:15:22*derpydoo joined #nim
21:16:21FromDiscord<Elegantbeef> Hmm is that less messy who knows
21:16:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ouv
21:16:32FromDiscord<Elegantbeef> I just showed it
21:16:48FromDiscord<Phytolizer> that seems like a natural way to avoid the dedent call at least
21:16:57FromDiscord<Elegantbeef> matrix bridge moment
21:17:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ouw
21:17:35FromDiscord<Phil> And you're not doing anything with that return
21:17:37FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4oux
21:17:41FromDiscord<Hourglass [She/Her]> ...oh my god i'm fucking stupid
21:17:44FromDiscord<Phil> The nim compliance cop has thus come to arrest you
21:18:04FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4ouw" => "https://play.nim-lang.org/#ix=4ouz"
21:18:09FromDiscord<Hourglass [She/Her]> In my defence, it's messy as hell to read and VSC isn't actually giving me a warning there
21:18:28FromDiscord<Phil> I only ever read compiler errors 😛
21:18:40FromDiscord<Phytolizer> nimsuggest can be funny sometimes :)
21:18:42FromDiscord<Phil> I don't even think vscode gives me any errors on its own nowadays
21:21:24FromDiscord<Hourglass [She/Her]> We need something better for VSC Nim support-
21:23:07FromDiscord<Elegantbeef> Impatiently wait for IC like everyone else
21:25:10FromDiscord<Phytolizer> i'll wait patiently :) IC is a hard problem
21:25:19FromDiscord<Hourglass [She/Her]> `IC`?
21:25:23FromDiscord<Phytolizer> incremental compilations
21:25:23FromDiscord<Phytolizer> (edit) "compilations" => "compilation"
21:25:26FromDiscord<Hourglass [She/Her]> Ah
21:25:43FromDiscord<Elegantbeef> What Araq has been betting on for Nim tooling for years now
21:28:38FromDiscord<Hourglass [She/Her]> https://paste.ecorous.org/iwarulohuf.py i spent all day, to end up with this lmao
21:28:45FromDiscord<Hourglass [She/Her]> Idk whether to laugh or cry :p
21:28:55*ilikescaviar joined #nim
21:30:57FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "What Araq has been": Welp
21:31:16FromDiscord<Hourglass [She/Her]> Tbf, incremental C compilation is doable with Zig, right?
21:31:32FromDiscord<Phytolizer> nah i spent a month writing a project to convert some json stuff at work to sqlite, just to delete it all and change my approach to working with the more "raw" json, time spent exploring the problem is not wasted time
21:32:00FromDiscord<Elegantbeef> Incremental C compilation is doable with Zig, Clang, and GCC afaik
21:32:07FromDiscord<Hourglass [She/Her]> I mean most of the day was just me rewriting it in multiple ways
21:32:14FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "Incremental C compilation is": Ah
21:32:21FromDiscord<Elegantbeef> But it hardly matters cause in many projects Nim is the longest time
21:32:36FromDiscord<Phytolizer> any c (or c++ for that matter) compiler has to be incremental to keep up with the cool kids these days lol
21:32:52FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "But it hardly matters": And Nimskull improves that quite a bit, doesn't it?
21:33:00FromDiscord<Elegantbeef> The point that IC is good for is that it turns things like suggest me a symbol into a look up
21:33:09FromDiscord<Elegantbeef> No clue i do not use nimskull
21:33:15FromDiscord<Hourglass [She/Her]> Fair
21:33:34FromDiscord<Hourglass [She/Her]> I can't use it for this project anyway since no async stuff there rn lol
21:33:38FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "any c (or c++": Fair
21:33:47FromDiscord<Phytolizer> nimskull is a hard fork no?
21:33:54FromDiscord<Elegantbeef> Yes
21:33:58FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "nimskull is a hard": Yep
21:34:28FromDiscord<Hourglass [She/Her]> They've done a ton of refactors, one goal is to make it a lot easier to maintain i think? Been a while
21:35:06FromDiscord<Hourglass [She/Her]> My Nimpiler project was using it
21:35:35FromDiscord<Hourglass [She/Her]> (JVM language backend was the main inspiration but I'm putting off for a long while because I'm burnt out + complicated aha)
21:36:21FromDiscord<Phytolizer> of all the languages to try writing a compiler for, nim seems pretty tough :P↵i have tried many times to write a c compiler but i never get very far (ADHD doesn't help)
21:40:13FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "of all the languages": I was gonna make Nim output JVM bytecode, not make a Nim compiler, I was using the compiler as library
21:40:17FromDiscord<Hourglass [She/Her]> Also ADHD is a bitch :p
21:40:35FromDiscord<Phytolizer> oh that's much more reasonable lol
21:44:07FromDiscord<System64 ~ Flandre Scarlet> Hi, does someone knows how I can write a seq of bytes to a file please?
21:53:39FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "oh that's much more": Yeah xD
21:54:13FromDiscord<Hourglass [She/Her]> In reply to @System64 "Hi, does someone knows": I think `cast[string](bytes)` should be fine? I don't know if it's the actual recommended/official way though
21:54:39FromDiscord<System64 ~ Flandre Scarlet> I'll try this
21:55:14FromDiscord<Hourglass [She/Her]> 👍
21:55:38FromDiscord<Hourglass [She/Her]> You just give the string to something as an argument
21:55:40FromDiscord<System64 ~ Flandre Scarlet> might be safer
21:55:40FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ouH
21:55:52FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouI
21:59:20FromDiscord<Phytolizer> In reply to @System64 "Hi, does someone knows": there's a proc for this apparently
21:59:25FromDiscord<Phytolizer> (edit) "In reply to @System64 "Hi, does someone knows": there's a proc for this apparently ... " added "https://nim-lang.org/docs/io.html#writeBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural"
21:59:46FromDiscord<Phytolizer> since it's in io you don't need to even import it
22:09:14FromDiscord<Hourglass [She/Her]> Nim 2.0 will make it so you need to explicitly import `io` iirc
22:09:34FromDiscord<Phytolizer> oh interesting, i was just going off the current docs :P
22:09:54FromDiscord<Phytolizer> are they enforcing `std/` yet?
22:10:12FromDiscord<Phytolizer> that's breaking so ig it'll be 2.0 as well
22:11:50FromDiscord<tfp> qq
22:12:09FromDiscord<tfp> with the `compile` pragma, are symbols declared with `dllexport` statically linked to my nim proggy?
22:16:19FromDiscord<Hourglass [She/Her]> In reply to @Phytolizer "are they enforcing `std/`": No idea, but I always do it anyway because it's clearer
22:20:44FromDiscord<tfp> In reply to @tfp "with the `compile` pragma,": ok yeah they seem to be linked by default, i was just forgetting to use `extern "C"` in cpp
22:24:47FromDiscord<Elegantbeef> New modules require it yes↵(@Phytolizer)
22:25:24FromDiscord<Phytolizer> that's good news
22:25:55FromDiscord<Hourglass [She/Her]> I need to parse this garbage to auto-generate the packet structures... Sigh <https://github.com/PrismarineJS/minecraft-data/blob/master/data/pc/1.19.3/protocol.json>
22:26:18FromDiscord<Hourglass [She/Her]> Hey Beef, is it possible to use macros to spit out Nim code?
22:26:28FromDiscord<Elegantbeef> Of course
22:26:34FromDiscord<Phytolizer> sure, that's the main use of macros :P
22:26:42FromDiscord<Hourglass [She/Her]> I mean in a textual way
22:26:49FromDiscord<Elegantbeef> Of course
22:26:50FromDiscord<Hourglass [She/Her]> To another file
22:26:52FromDiscord<Hourglass [She/Her]> Oh huh
22:26:56FromDiscord<Elegantbeef> you just do `myNimNode.repr`
22:27:02FromDiscord<Elegantbeef> That gives you a string
22:27:07FromDiscord<Hourglass [She/Her]> Oh sweet
22:27:32FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ouQ
22:27:34FromDiscord<Hourglass [She/Her]> I'm wondering... Do I even need that for generating docs?
22:27:52FromDiscord<Hourglass [She/Her]> If macros can spit out Nim code, could I just insert doc strings?
22:29:27FromDiscord<Elegantbeef> Do i really need to answer this
22:29:44FromDiscord<Phytolizer> In reply to @Hourglass, When the Hour Strikes "If macros can spit": of course.. there's even an AST node: https://nim-lang.org/docs/macros.html#callsslashexpressions-documentation-comments
22:31:07FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "*Do i really need": Probably not lmao
22:31:18FromDiscord<Hourglass [She/Her]> Welp, it's macro hell time
22:31:55FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ouS
22:31:59FromDiscord<Elegantbeef> you say that while i've been using the compiler as a library 😄
22:32:09FromDiscord<Elegantbeef> seeya practically works
22:32:13FromDiscord<Hourglass [She/Her]> I did that before too, and it went horribly :p
22:32:41FromDiscord<Phytolizer> the only painful part of writing macros ime is memorizing which child corresponds to what
22:32:42FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouT
22:32:52FromDiscord<Hourglass [She/Her]> There is also `do quote` tbf
22:32:59FromDiscord<Elegantbeef> Just contribute to micros 😄
22:33:07FromDiscord<Phytolizer> yeah you can quote but there is a flexibility gain to writing the nodes by hand :P
22:33:10FromDiscord<Elegantbeef> genast \> quote do fite me
22:33:20FromDiscord<Elegantbeef> Never write nodes by hand unless it's the easiest part
22:33:27FromDiscord<Yandall> Hi! I'm trying to open a connection to a local postgres db, but I'm getting this error `could not load: libpq.dll`. Any idea how to fix it? I'm on windows btw
22:33:35FromDiscord<Elegantbeef> But yea i've got the compiler to make a C Header almost fine https://paste.ecorous.org/asaxafarec.cpp
22:33:44FromDiscord<Elegantbeef> Ensure `libpq.dll` is in your path
22:33:49FromDiscord<Elegantbeef> I do not know how to do that on windows
22:34:01FromDiscord<Phytolizer> windows and dll hell, name a more iconic duo
22:34:05FromDiscord<tfp> what the heck is this 🙂
22:34:06FromDiscord<tfp> sent a code paste, see https://play.nim-lang.org/#ix=4ouU
22:34:10FromDiscord<tfp> is f not a closure function
22:34:15FromDiscord<Elegantbeef> It's not
22:34:18FromDiscord<Elegantbeef> It's a `nimCall`
22:34:23FromDiscord<Phytolizer> In reply to @tfp "is f not a": you could try annotating with {.closure.}
22:34:30FromDiscord<tfp> i copied that from the net tho
22:34:30FromDiscord<Yandall> In reply to @Elegantbeef "Ensure `libpq.dll` is in": postgres/lib is already in my PATH var
22:34:32FromDiscord<tfp> did something change
22:34:32*Onionhammer quit (Quit: Ping timeout (120 seconds))
22:34:36FromDiscord<Elegantbeef> you literally just need to d o`let z = f`
22:34:48*Onionhammer joined #nim
22:34:52FromDiscord<Elegantbeef> Procedures are first class in Nim
22:34:57FromDiscord<tfp> oh i see
22:35:01FromDiscord<Phytolizer> In reply to @Elegantbeef "Never write nodes by": maybe im old fashiones 😆
22:35:03FromDiscord<Phytolizer> (edit) "fashiones" => "fashioned"
22:35:03FromDiscord<Elegantbeef> You do not need to do anything but use the name to get their address
22:35:04FromDiscord<tfp> its also a top level function
22:35:05FromDiscord<Hourglass [She/Her]> What's a funny and creative name for a project that represents Minecraft packets :p
22:35:19FromDiscord<Elegantbeef> Making Nim AST by hand is just awful and unmaintainable
22:35:25FromDiscord<Elegantbeef> In some cases it's the best to do
22:35:26FromDiscord<tfp> ty
22:35:29FromDiscord<Elegantbeef> But in most cases iit's best not to
22:36:14FromDiscord<Elegantbeef> Anywho i do have to biasly say i think the path through macros is an adoption of https://github.com/beef331/micros/blob/master/tests/t_tsinspiredmacros.nim#L6-L24
22:36:19FromDiscord<Elegantbeef> This API is so readable you cannot beat it
22:36:53FromDiscord<tfp> looks like the dart metaprogramming api
22:37:32FromDiscord<Elegantbeef> Using distinct types and iterators creates a much more readable API that does not rely on knowing where AST nodes are
22:37:47FromDiscord<Phytolizer> yeah i need to mess more with genasts, i just don't write macros very often lol
22:37:51FromDiscord<Phytolizer> templates end up working for most of my uses
22:38:20FromDiscord<Elegantbeef> I will say for things like https://forum.nim-lang.org/t/9897#65308 it does make sense to manually use the AST
22:38:43FromDiscord<Elegantbeef> But I much much prefer reading code that uses genast instead of complex `newX` chaining
22:39:43FromDiscord<huantian> In reply to @Hourglass, When the Hour Strikes "What's a funny and": Napkins
22:40:43FromDiscord<Yandall> In reply to @Yandall "postgres/lib is already in": Fixed. I had to add postgres/bin to the PATH var, not postgres/lib
22:40:47FromDiscord<Phytolizer> oof
22:40:56FromDiscord<Phytolizer> yeah that's where DLLs are stored if i remember right
22:41:38FromDiscord<Yandall> I got confused because there is a file with the same name in the lib folder 😅
22:41:51FromDiscord<Phytolizer> it's a .lib tho right?
22:41:54FromDiscord<Yandall> yeah
22:42:03FromDiscord<Phytolizer> yeah that's different :P
22:42:22FromDiscord<Phytolizer> i wish windows didn't start hiding those all-important extensions by default
22:42:27FromDiscord<Yandall> not. my bad, its a .dll
22:42:35FromDiscord<Phytolizer> oh that's epic
22:43:02FromDiscord<Yandall> yeah, weird
22:43:36FromDiscord<Phytolizer> i think windows has a concept of "import library" or something
22:43:41FromDiscord<Phytolizer> and that might be what that dll is
22:44:00om3gadlopen?
22:44:23FromDiscord<Hourglass [She/Her]> In reply to @huantian "Napkins": Perfect :)
22:44:27FromDiscord<Phytolizer> it's spelled `LoadLibrary` in win32
22:45:00FromDiscord<Yandall> I didn't knew that
22:45:11FromDiscord<Phytolizer> yeah windows likes to complicate things lol
22:45:18FromDiscord<Phytolizer> the bindir dll is the right one to use though
22:45:35om3gai don't like windows. it works very bad
22:46:02FromDiscord<Phytolizer> nimsuggest being silly again... i have 2 versions of the same package (one from 2014, and my fork from today) https://media.discordapp.net/attachments/371759389889003532/1076635736117362788/image.png
22:54:21*ilikescaviar quit (Ping timeout: 255 seconds)
23:10:20*azimut quit (Remote host closed the connection)
23:10:48*azimut joined #nim
23:11:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @Phytolizer "there's a proc for": and is it possible to load file and return a seq of bytes?
23:11:54FromDiscord<Hourglass [She/Her]> Nimble packages really need to be checked every once in a while
23:11:55FromDiscord<Hourglass [She/Her]> Dead links are a pain
23:12:06FromDiscord<Elegantbeef> A nim string is utf8 encoded so it really doesnt matter
23:12:16FromDiscord<Hourglass [She/Her]> `mcevents` isn't on nimble any more so
23:12:27FromDiscord<Elegantbeef> If you have a proc that takes a `openArray[byte]` just use `toOpenArrayByte`
23:12:32FromDiscord<auxym> In reply to @System64 "and is it possible": https://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural
23:13:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "https://nim-lang.org/docs/io.html#readBytes%2CFile%": they are bound checked?
23:14:45FromDiscord<Phytolizer> In reply to @System64 "they are bound checked?": it'll return a lesser value if the file is too short, so you could give a big "max" value and read the return value to see how big it actually was. it won't do anything bad with memory if im reading it right
23:20:30FromDiscord<tfp> any tips for binding a large cpp library
23:20:43FromDiscord<tfp> rn im adding a C api by hand
23:20:46FromDiscord<tfp> and then i plan on using c2nim
23:20:53FromDiscord<tfp> is there a faster way? it's a huge lib-- RmlUi
23:21:02FromDiscord<System64 ~ Flandre Scarlet> Futhark maybe?
23:22:28FromDiscord<System64 ~ Flandre Scarlet> In reply to @Phytolizer "it'll return a lesser": okay it accepts seqs
23:25:11FromDiscord<tfp> In reply to @System64 "Futhark maybe?": interesting
23:25:15FromDiscord<tfp> it's a CPP lib though
23:25:32FromDiscord<tfp> maybe i can use swig to generate c bindings
23:25:35FromDiscord<tfp> and then use futhark?
23:25:45FromDiscord<tfp> are there any examples of cpp libs bound to nim? maybe bullet
23:29:06FromDiscord<System64 ~ Flandre Scarlet> No idea for CPP
23:29:37FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ouY
23:33:14FromDiscord<Phytolizer> In reply to @System64 "okay it accepts seqs": yeah openArray accepts seq, and a bunch of other array-likes
23:33:55FromDiscord<System64 ~ Flandre Scarlet> Oh interesting, but why do I have this error?
23:35:09FromDiscord<Rika> Read bytes overwrites contents, not adds, so you have to have contents in the sequence
23:35:35FromDiscord<System64 ~ Flandre Scarlet> I didn't understood
23:37:39FromDiscord<Rika> var data = newSeq[byte](1000000)↵....↵data.setLen(len)
23:39:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "var data = newSeq[byte](1000000)": wait, it didn't put anything inside the seq?
23:49:11*azimut quit (Remote host closed the connection)
23:49:39*ilikescaviar joined #nim
23:49:39*azimut joined #nim
23:59:59PMunch@djazz, @Phytolizer, nimbleutils is written to explicitly support being run on compile-time