00:05:27 | FromDiscord | <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:44 | FromDiscord | <Hourglass [She/Her]> (edit) "module" => "plugin" |
00:23:27 | FromDiscord | <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:27 | FromDiscord | <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:05 | NimEventer | New 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:12 | FromDiscord | <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:32 | FromDiscord | <Yepoleb> your plugin api will be shit if you don't know what code will interface with it |
00:50:45 | FromDiscord | <Yepoleb> and you don't know that because you have not written any |
00:55:03 | FromDiscord | <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:02 | FromDiscord | <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:08 | FromDiscord | <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:20 | FromDiscord | <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:43 | FromDiscord | <Yepoleb> and you will usually end up with generally better design |
01:09:38 | FromDiscord | <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:17 | FromDiscord | <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:20 | FromDiscord | <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:34 | FromDiscord | <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:40 | FromDiscord | <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:58 | FromDiscord | <Hourglass [She/Her]> I'm fine with that and that's a given, is it not? |
01:16:03 | FromDiscord | <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:59 | FromDiscord | <Yepoleb> Well it seems like multiple people think you're overdoing the planning and should do more restructure instead |
01:55:40 | FromDiscord | <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:47 | NimEventer | New Nimble package! lowdb - Low level db_sqlite and db_postgres forks with a proper typing, see https://github.com/PhilippMDoerner/lowdb |
03:01:01 | systemdsucks | that looks nice |
03:31:50 | FromDiscord | <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:46 | NimEventer | New 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:52 | FromDiscord | <auxym> yay nimeventer is back, thanks @Yardanico (and @Phil for bringing it up) |
04:10:50 | * | arkurious quit (Quit: Leaving) |
04:54:11 | NimEventer | New 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:40 | FromDiscord | <ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4opL |
07:13:50 | * | ltriant joined #nim |
07:13:58 | FromDiscord | <ringabout> which is not compatible with the proposed de-pipeline parsing => https://github.com/nim-lang/Nim/pull/21379 |
07:15:49 | FromDiscord | <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:26 | FromDiscord | <ringabout> if users need to override the settings temporarily |
07:19:05 | FromDiscord | <ringabout> Only backend checks are affected, which means checks at semantic phases might prolong its old behavior. |
07:23:13 | FromDiscord | <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:22 | FromDiscord | <Elegantbeef> What do you mean?↵(@ringabout) |
07:25:23 | FromDiscord | <firasuke> qualified imports mean that if I say `from x import y` only `y` will be imported from `x` nothing else? |
07:26:11 | FromDiscord | <Rika> In reply to @firasuke "qualified imports mean that": That isn’t qualified I believe |
07:26:20 | FromDiscord | <Rika> That’s just selective importing |
07:26:25 | FromDiscord | <Elegantbeef> That's not qualified correct |
07:27:22 | FromDiscord | <Phil> In reply to @firasuke "qualified imports mean that": Correct, only the symbol y will be made available. |
07:27:46 | FromDiscord | <firasuke> In reply to @Elegantbeef "That's not qualified correct": oh ok |
07:27:58 | FromDiscord | <firasuke> are they recommended over regular imports? |
07:28:10 | FromDiscord | <Elegantbeef> No |
07:28:17 | FromDiscord | <Rika> Recommendations are not made by the language for this case |
07:28:18 | FromDiscord | <Elegantbeef> Idiomatic nim does not do `from x import y` or `import x as y` |
07:28:37 | FromDiscord | <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:45 | FromDiscord | <Phil> Hmm I think you might break generics with selective imports like that |
07:28:45 | FromDiscord | <ringabout> (edit) "In reply to @Elegantbeef "What do you mean?": I mean, for ... `overflowChecks:off`" added "now" |
07:28:55 | FromDiscord | <Elegantbeef> no selective imports move symbols in |
07:28:59 | FromDiscord | <ringabout> (edit) "behave" => "behaves" |
07:29:01 | FromDiscord | <Elegantbeef> qualified imports do not |
07:29:22 | FromDiscord | <Phil> Ah, so they generics will bind their symbols before being imported? Alrighty |
07:29:27 | FromDiscord | <Phil> (edit) removed "they" |
07:30:12 | FromDiscord | <Elegantbeef> I believe you're confused phil |
07:30:20 | FromDiscord | <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:24 | FromDiscord | <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:25 | FromDiscord | <firasuke> In reply to @Elegantbeef "qualified imports do not": what's the diff between selective and qualified imports? |
07:30:42 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4opP |
07:32:42 | * | genpaku joined #nim |
07:34:56 | FromDiscord | <firasuke> I see |
07:36:21 | FromDiscord | <ringabout> For example, in https://github.com/nim-lang/Nim/pull/21390 for future's sake, I'm fixing this.↵(@ringabout) |
07:39:22 | FromDiscord | <ringabout> And it might be wrong. |
07:39:30 | FromDiscord | <ringabout> Misused. |
07:40:08 | FromDiscord | <Elegantbeef> I see |
07:40:42 | FromDiscord | <Elegantbeef> Wishes that inject destructors respected pragmas |
07:40:49 | * | PMunch joined #nim |
07:41:26 | FromDiscord | <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:32 | FromDiscord | <firasuke> sent a code paste, see https://play.nim-lang.org/#ix=4opX |
07:42:54 | FromDiscord | <firasuke> (edit) "https://play.nim-lang.org/#ix=4opX" => "https://play.nim-lang.org/#ix=4opY" |
07:43:49 | FromDiscord | <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:54 | FromDiscord | <Phil> And then you can use either as needed |
07:44:06 | FromDiscord | <Phil> Or if the first func is never needed you can just make it private |
07:45:07 | FromDiscord | <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:35 | FromDiscord | <firasuke> In reply to @Isofruit "Though if all your": oh cool |
07:45:49 | FromDiscord | <Phil> note that that proc is from sequtils |
07:45:58 | FromDiscord | <firasuke> was gonna ask xD thanks |
08:13:01 | FromDiscord | <0xRar> whats the proper way to take multiple user input and store it into an array? |
08:16:08 | PMunch | Hmm, 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:28 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#package-level-objects |
08:18:08 | FromDiscord | <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:34 | PMunch | niguss_101-_-, there's no such thing as a free lunch |
08:18:48 | PMunch | @Elegantbeef, thanks, that would almost work but not quite |
08:18:52 | FromDiscord | <Phil> AWS has a free tier. Never used it, just know it exists |
08:19:46 | PMunch | The 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:54 | PMunch | Guess I'll add it as a feature to Futhark |
08:21:30 | FromDiscord | <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:45 | FromDiscord | <0xRar> whats the proper way to take multiple user input and store it into an array? |
08:23:23 | FromDiscord | <Rika> Multiple in what way? |
08:23:50 | FromDiscord | <Phil> sent a long message, see http://ix.io/4oq2 |
08:23:51 | FromDiscord | <niguss_101-_-> Really bro have u tried it before?↵(@amadan) |
08:24:09 | FromDiscord | <amadan> yes |
08:24:30 | FromDiscord | <0xRar> In reply to @Rika "Multiple in what way?": for example ["test1", "test2"] , all from user input |
08:24:38 | FromDiscord | <Rika> Yes but how is it input |
08:24:47 | FromDiscord | <Rika> What does “multiple inputs” mean for you |
08:24:50 | FromDiscord | <Phil> Are there multiple separate requests or shall the user input a list of entries? |
08:25:27 | FromDiscord | <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:28 | FromDiscord | <Rika> In reply to @Isofruit "Are there multiple separate": Be careful of over complicating things and confusing the one asking |
08:26:01 | FromDiscord | <0xRar> example https://media.discordapp.net/attachments/371759389889003532/1076419303471067216/image.png |
08:27:47 | FromDiscord | <0xRar> so the user enters 3 names, and all of the names will be stored in the array |
08:28:06 | FromDiscord | <0xRar> sorry i know its confusing idk how to deliver the question |
08:28:37 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oq4 |
08:29:04 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4oq4" => "https://play.nim-lang.org/#ix=4oq5" |
08:29:15 | FromDiscord | <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:20 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4oq5" => "https://play.nim-lang.org/#ix=4oq6" |
08:29:24 | FromDiscord | <Rika> Or at least not as experienced, perhaps |
08:29:33 | FromDiscord | <0xRar> In reply to @Isofruit "What's stopping you from": not knowing everything about the language ? |
08:31:13 | FromDiscord | <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:36 | FromDiscord | <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:05 | FromDiscord | <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:11 | FromDiscord | <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:18 | FromDiscord | <Phil> (edit) "inclusive.↵So" => "inclusive in nim.↵So" |
08:33:38 | FromDiscord | <Phil> Dangit, too slow again! |
08:33:40 | FromDiscord | <amadan> ^ probably simpler explanation |
08:33:51 | FromDiscord | <niguss_101-_-> Have u ever launched a website to the internet hlbtw?↵(@Phil) |
08:34:00 | FromDiscord | <Phil> Multiple times, just not on AWS. |
08:34:43 | FromDiscord | <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:49 | FromDiscord | <0xRar> ty everyone |
08:37:33 | FromDiscord | <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:58 | FromDiscord | <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:20 | FromDiscord | <Phil> In reply to @firasuke "given the same example,": That is very much a style question.↵Functionally both work |
08:38:40 | FromDiscord | <Phil> The reason I prefer mapIt is because it "restricts" you in a sense |
08:38:47 | FromDiscord | <firasuke> In reply to @Isofruit "That is *very much*": Oh ok |
08:39:08 | FromDiscord | <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:09 | FromDiscord | <niguss_101-_-> By Paying?↵(@Phil) |
08:39:12 | FromDiscord | <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:50 | FromDiscord | <firasuke> In reply to @Isofruit "It is a more": a thing: mapIt↵all kinds of things: for |
08:40:26 | FromDiscord | <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:56 | FromDiscord | <Phil> (edit) "requests," => "requests or other wonky things," |
08:40:57 | FromDiscord | <firasuke> Awesome, thanks for clarifying! |
08:41:49 | FromDiscord | <Rika> In reply to @Isofruit "If you use mapIt": But you can do that though |
08:42:08 | FromDiscord | <Rika> You can do things unrelated to transformation inside map and friends, no? |
08:42:29 | FromDiscord | <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:37 | FromDiscord | <Rika> Sure |
08:46:28 | FromDiscord | <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:12 | FromDiscord | <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:18 | FromDiscord | <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:19 | FromDiscord | <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:37 | FromDiscord | <firasuke> In reply to @Isofruit "So if you want": got it |
08:49:13 | FromDiscord | <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:36 | FromDiscord | <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:52 | FromDiscord | <Phil> (edit) "http://ix.io/4oq8" => "http://ix.io/4oq9" |
08:51:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oqa |
08:51:32 | FromDiscord | <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:43 | FromDiscord | <Diogenes of Toronto> (edit) removed "And I" |
08:52:22 | FromDiscord | <Phil> I can't say I've used encore before, let me google that |
08:52:45 | FromDiscord | <Diogenes of Toronto> https://encore.dev/docs |
08:52:48 | FromDiscord | <Coachonko> Welcome |
08:52:55 | FromDiscord | <Coachonko> Also yeah thanks for the link, never heard Encore |
08:53:26 | FromDiscord | <firasuke> In reply to @Isofruit "Generally `for x in": thanks a lot for the explanation, things are much clearer now |
08:54:05 | FromDiscord | <Diogenes of Toronto> https://github.com/Diogenesoftoronto/nimdude this is my site currently |
08:54:13 | FromDiscord | <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:19 | FromDiscord | <Diogenes of Toronto> Literally boiler that's it just started an hour ago |
08:54:40 | FromDiscord | <Diogenes of Toronto> In reply to @Isofruit "That question is complex": I see. |
08:54:46 | FromDiscord | <Diogenes of Toronto> That makes sense |
08:55:39 | FromDiscord | <Phil> It might be easier if you tell me what prologue would need to do and I could give responses to that |
08:55:40 | FromDiscord | <firasuke> what's the preferred method for handling errors, currently I'm using `try`/`except` (parsing a file that doesn't exist..) |
08:56:44 | FromDiscord | <Diogenes of Toronto> In reply to @Isofruit "It might be easier": Basically it would need to use type safe rpc interfaces |
08:56:51 | FromDiscord | <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:13 | FromDiscord | <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:51 | FromDiscord | <Diogenes of Toronto> Nothing need to compile to js really |
08:57:56 | FromDiscord | <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:00 | FromDiscord | <Phil> In reply to @niguss_101-_- "By Paying? (<@180601887916163073>)": Yes |
08:58:37 | FromDiscord | <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:38 | FromDiscord | <Diogenes of Toronto> I just want a way to get client rpc interfaces generated from encore usable from the prologue server |
08:58:52 | FromDiscord | <firasuke> In reply to @Isofruit "In that caes try-except": ok cool |
08:59:10 | FromDiscord | <Diogenes of Toronto> https://encore.dev/docs/develop/client-generation |
08:59:41 | FromDiscord | <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:55 | FromDiscord | <Diogenes of Toronto> It's js or ts or go files |
09:00:18 | FromDiscord | <Diogenes of Toronto> They are functions |
09:00:30 | FromDiscord | <Diogenes of Toronto> To call encore procs |
09:01:31 | FromDiscord | <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:43 | FromDiscord | <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:11 | FromDiscord | <Diogenes of Toronto> Encore provides endpoints |
09:02:37 | FromDiscord | <Diogenes of Toronto> Client makes requests to encore |
09:03:55 | FromDiscord | <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:09 | FromDiscord | <Diogenes of Toronto> I think both... it's a function that handles a request from a specified route. |
09:05:35 | FromDiscord | <Phil> I think then I'm a bit lost because at that point I'm not sure what prologue is doing ^^' |
09:06:23 | FromDiscord | <Diogenes of Toronto> Maybe I'm explaining this wrong but prologue is calling those endpoints via these generated client functions. |
09:07:40 | FromDiscord | <Diogenes of Toronto> I can use encore with client generation. With just naked http calls |
09:07:50 | FromDiscord | <Diogenes of Toronto> (edit) "with" => "without" |
09:09:57 | FromDiscord | <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:12 | FromDiscord | <Diogenes of Toronto> Makes sense |
09:11:19 | FromDiscord | <Diogenes of Toronto> I still don't get encore |
09:11:28 | FromDiscord | <Phil> Me neither 😄 |
09:12:21 | FromDiscord | <Diogenes of Toronto> Tbh I am considering ditching prologue completely and trying to use karax exclusively |
09:13:15 | FromDiscord | <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:11 | FromDiscord | <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:42 | FromDiscord | <Phil> karax for generating HTML is nice though |
09:15:07 | FromDiscord | <Phil> (edit) "HTML" => "HTML/SPAs" |
09:15:27 | FromDiscord | <Diogenes of Toronto> Yeah that's what I want it for. |
09:16:08 | FromDiscord | <Diogenes of Toronto> But I have no idea how to have karax work with a go server |
09:16:36 | FromDiscord | <Diogenes of Toronto> So I'm using prologue as a internediary |
09:18:13 | FromDiscord | <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:25 | FromDiscord | <Diogenes of Toronto> Okay |
09:19:19 | FromDiscord | <Diogenes of Toronto> This community is awesome |
09:21:50 | FromDiscord | <Coachonko> Mostly Phil |
09:22:51 | PMunch | :( |
09:23:26 | PMunch | Karax is basically server agnostic AFAIK, so there shouldn't be any issue with using Karax and a non-Nim server |
09:25:39 | FromDiscord | <hotdog> In reply to @Isofruit "let me ping <@472459996068839424>": Hey 👋 |
09:26:00 | FromDiscord | <hotdog> @Diogenes of Toronto are you using Karax SSR or compiling it to js? |
09:26:49 | FromDiscord | <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:58 | FromDiscord | <Phil> And even then the pointers I give are the kind of stuff that the bing search bot could tell you 😛 |
09:28:40 | FromDiscord | <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:35 | PMunch | @Phil, haha imagine asking the Bing bot for something and getting "Ask @hotdog, they probably know" |
09:29:40 | FromDiscord | <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:48 | FromDiscord | <Diogenes of Toronto> Yes |
09:30:01 | FromDiscord | <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:20 | FromDiscord | <Diogenes of Toronto> func Generate404(ctx context.Context, name string) (Response, error) {↵ msg := Get404Image()↵ return &Response{Message: msg}, nil↵} |
09:33:33 | PMunch | What's the deal with pkgs2? |
09:34:27 | FromDiscord | <Phil> Like, why does it exist? |
09:34:34 | PMunch | The packages in pkgs seems to take precedence |
09:34:40 | FromDiscord | <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:47 | FromDiscord | <Phil> Hmmm I don't think it does for me |
09:34:51 | FromDiscord | <Phil> when I use devel that is |
09:35:12 | PMunch | I 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:21 | PMunch | Now when I try to use it my changes aren't working |
09:35:36 | PMunch | I'm also on devel.. |
09:35:40 | FromDiscord | <Phil> Okay so you are on nim devel? |
09:35:41 | FromDiscord | <Phil> Hm |
09:35:47 | FromDiscord | <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:22 | PMunch | Ah right, now I changed to stable and installed again and it works (because it installed into pkgs) |
09:36:24 | FromDiscord | <Diogenes of Toronto> Got it. Raw encore endpoints are not idea but not a huge hassle |
09:36:37 | FromDiscord | <Diogenes of Toronto> (edit) "idea" => "ideal" |
09:36:43 | FromDiscord | <Phil> Pmunch , your system is a mystery to me |
09:36:45 | FromDiscord | <Rika> It’s to do with nimble 0.13 and 0.14 no? |
09:36:52 | FromDiscord | <Rika> 0.14 was a very major refactor |
09:37:00 | FromDiscord | <hotdog> In reply to @PMunch "<@180601887916163073>, haha imagine asking": I love how sassy the bing bot is |
09:37:16 | FromDiscord | <Phil> Could be, actually |
09:37:34 | FromDiscord | <Phil> Yeah very likely has, choosenim also changes the nimble version |
09:37:39 | PMunch | Uhm, what? Error: type mismatch: got 'openArray[string]' for 'forwards' but expected 'seq[string]' |
09:37:49 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oqo |
09:37:52 | FromDiscord | <Rika> In reply to @PMunch "Uhm, what? Error: type": What do you mean what |
09:37:56 | PMunch | Yes I'm guessing this is the new lockfile support from nimble |
09:37:56 | FromDiscord | <Diogenes of Toronto> I signed up for all the bing stuff and they still haven't given access |
09:38:05 | PMunch | And Nim not properly choosing the version |
09:38:22 | FromDiscord | <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:24 | PMunch | @Phil, why is my system a mystery? |
09:38:56 | FromDiscord | <Phil> In reply to @PMunch "<@180601887916163073>, why is my": Because it prioritized a pkg package over pkgs2 while you were on devel 😛 |
09:39:11 | FromDiscord | <hotdog> In reply to @Diogenes of Toronto "I signed up for": Same |
09:39:30 | FromDiscord | <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:51 | PMunch | @Phil, oh :P I mean I just ran choosenim update devel, not my fault it's behaving strangely |
09:39:53 | FromDiscord | <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:04 | FromDiscord | <Phil> Erm... yeah I'm not that bold to wildly delete that kind of folder from the nimble dir |
09:40:23 | FromDiscord | <Diogenes of Toronto> :FeelsBadMan: |
09:42:30 | FromDiscord | <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:41 | FromDiscord | <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:58 | FromDiscord | <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:47 | FromDiscord | <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:43 | FromDiscord | <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:52 | FromDiscord | <hotdog> In reply to @Diogenes of Toronto "Yeah... I am gonna": Good plan |
09:46:19 | FromDiscord | <hotdog> In reply to @Diogenes of Toronto "Also side not I": In theory yes but I wouldn’t |
09:46:48 | FromDiscord | <Diogenes of Toronto> Got it |
09:47:21 | PMunch | @Phil, nah I didn't check because it failed because of an error that isn't present in the latest version |
09:47:26 | PMunch | So I knew it used an older version |
09:47:48 | FromDiscord | <Phil> So choosenim is the issue then because it didn't swap the nimble version when you went to devel? |
09:47:49 | PMunch | Nimble version was 0.14.0 |
09:47:59 | FromDiscord | <Phil> So it did choose the nimble version, hmmm |
09:48:08 | FromDiscord | <Phil> (edit) "choose" => "change" |
09:48:10 | * | jmdaemon quit (Ping timeout: 246 seconds) |
09:48:20 | FromDiscord | <Phil> Yeah no idea |
09:48:23 | PMunch | Of course, otherwise it wouldn't have installed into pkgs2 |
09:48:40 | PMunch | The package has a custom task to build which doesn't add in the nimble paths and such though |
09:49:01 | PMunch | So I'm guessing that `nimble build` would've worked, but just plain old `nim c` fails |
09:49:34 | FromDiscord | <Phil> That might explain why I would've never encountered this error in a million years |
09:49:49 | FromDiscord | <Phil> I don't ever run nim c, I will always have a nimble build task defined |
09:58:55 | FromDiscord | <Rika> Meanwhile I never use nimble for anything but package management |
09:59:41 | FromDiscord | <Diogenes of Toronto> Nimble is more than a package manager |
09:59:46 | FromDiscord | <Diogenes of Toronto> :poggies: |
10:00:05 | FromDiscord | <Phil> Nimble tasks are basically bash scripting in nim-script |
10:00:12 | FromDiscord | <Diogenes of Toronto> Ooo |
10:00:18 | FromDiscord | <Coachonko> In reply to @Isofruit "And even then the": Why would you use Bing |
10:00:27 | FromDiscord | <Phil> You can do also fairly complicated setups with config.nims files |
10:00:30 | FromDiscord | <Coachonko> But you and Rike alre always helping whenever I am around |
10:00:58 | FromDiscord | <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:05 | FromDiscord | <Phil> So I have nimble tasks everywhere |
10:01:10 | * | azimut joined #nim |
10:01:30 | FromDiscord | <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:22 | FromDiscord | <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:57 | FromDiscord | <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:43 | FromDiscord | <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:12 | FromDiscord | <Phil> (edit) "out" => "out, and better so than google arguably" |
10:04:54 | FromDiscord | <Coachonko> Is it powered by openai? |
10:05:20 | FromDiscord | <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:32 | FromDiscord | <Diogenes of Toronto> In reply to @Coachonko "I have been without": Introducing your copilot for the web: AI-powered Bing and Microsoft... |
10:06:52 | FromDiscord | <Diogenes of Toronto> https://youtu.be/rOeRWRJ16yY |
10:07:14 | FromDiscord | <Diogenes of Toronto> Watch that. Keeps you in the loop |
10:07:54 | FromDiscord | <Diogenes of Toronto> https://simonwillison.net/2023/Feb/15/bing/ |
10:08:02 | FromDiscord | <Diogenes of Toronto> Read this for some pitfalls |
10:11:39 | FromDiscord | <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:53 | FromDiscord | <Phil> Just RIP |
10:27:23 | PMunch | What do you call it in C when you are given a header file and write a program to match it? |
10:27:28 | PMunch | Implementing a header? |
10:30:49 | FromDiscord | <Yepoleb> Sounds good |
10:38:20 | FromDiscord | <Coachonko> In reply to @Isofruit "My man loses his": Are Bing results still very irrelevant though? |
10:38:33 | FromDiscord | <Coachonko> I never got what I needed from bing search results |
10:39:48 | FromDiscord | <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:30 | FromDiscord | <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:42 | FromDiscord | <Coachonko> I see |
10:40:53 | FromDiscord | <Phil> Like, you can tell it "I have a green waterbottle, does this store sell a tracksuit that matches that color?" |
10:41:06 | FromDiscord | <Coachonko> That's a very specific example ngl |
10:41:26 | FromDiscord | <Phil> Lifted it explicitly from the WAN-show from Linus-Tech-Tips where they talked about it at length |
10:42:22 | FromDiscord | <Coachonko> So you're saying you're not that stylish? |
10:42:58 | FromDiscord | <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:05 | FromDiscord | <Coachonko> Sadge |
10:43:14 | FromDiscord | <Phil> It's nice background noise |
10:44:21 | FromDiscord | <Phil> Either way, I find it a fairly enjoyable listen overall |
11:15:44 | * | ltriant joined #nim |
13:59:39 | FromDiscord | <turbo> What's the (C-quiv) type and size of `bool`? |
13:59:44 | FromDiscord | <turbo> (edit) "(C-quiv)" => "(C-equiv)" |
14:00:06 | FromDiscord | <auxym> it's implemented as uint8 |
14:04:48 | FromDiscord | <turbo> Is it safe to cast between them and assume that 1 = true, 0 = false? |
14:13:33 | Amun-Ra | yes |
14:13:57 | Amun-Ra | although != 0 is almost always preferred |
14:14:48 | Amun-Ra | …and I only hope you didn't mean C-style casts… |
14:22:34 | FromDiscord | <Rika> nim `cast[]()` is always assumed to be unsafe |
14:23:05 | Amun-Ra | someint.bool is a different thing |
14:26:38 | FromDiscord | <Zoom> no, use `ord`↵(@turbo) |
14:27:55 | Amun-Ra | uhm? |
14:29:09 | FromDiscord | <Zoom> sorry, didn't read the question right |
14:30:16 | FromDiscord | <ITR> What was the thing (pragma?) to tell the compiler to ignore that something had side effects inside a func? |
14:30:22 | FromDiscord | <Zoom> On the other hand I always assume underlying impl is subject to change unless said not to in the specs |
14:31:18 | FromDiscord | <Zoom> {.cast(noSideEffect).}↵(@ITR) |
14:31:34 | FromDiscord | <ITR> Thanks! |
14:50:13 | * | xet7 joined #nim |
15:00:06 | FromDiscord | <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:02 | NimEventer | New thread by bitstorm: Returning to Nim from Python and Rust, see https://forum.nim-lang.org/t/9906 |
15:30:31 | PMunch | Hmm, many people lately complaining about the debug capabilities in Nim |
15:34:23 | FromDiscord | <Rika> "lately" is an understatement innit |
15:34:56 | PMunch | Sure, people have mentioned it before, but it seems to have gotten much more prevalent lately |
15:35:54 | FromDiscord | <ITR> if I have a byte and want to write it to a textFile as that byte, what do I do? |
15:36:11 | PMunch | Call write on it? |
15:36:13 | FromDiscord | <Rika> byte as in the type byte? |
15:36:34 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osj |
15:36:54 | FromDiscord | <ITR> (edit) "https://play.nim-lang.org/#ix=4osj" => "https://play.nim-lang.org/#ix=4osk" |
15:37:55 | FromDiscord | <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:55 | FromDiscord | <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:16 | FromDiscord | <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:15 | FromDiscord | <Rika> In reply to @ITR "ah, nevermind, i never": `f.write(chr(myByte))` |
15:42:48 | FromDiscord | <Rika> ig `char()` works too |
15:43:37 | FromDiscord | <ITR> In reply to @Rika "`f.write(chr(myByte))`": that worked! thanks! |
15:43:45 | FromDiscord | <Rika> :ok` |
15:43:47 | FromDiscord | <Rika> (edit) ":ok`" => "👌" |
15:43:56 | FromDiscord | <Rika> fuck you irc people i didnt typo shut up |
15:44:26 | FromDiscord | <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:48 | PMunch | @Rika, we. see. everything. |
15:46:06 | FromDiscord | <Rika> dont look inside my mind pls |
15:50:52 | * | arkurious joined #nim |
15:53:01 | PMunch | Hmm, looking at how chronicles implements log scopes |
15:53:05 | PMunch | Pretty interesting hack |
16:00:43 | * | xet7 quit (Remote host closed the connection) |
16:04:38 | FromDiscord | <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:57 | PMunch | The debug discussion? |
16:05:11 | FromDiscord | <Phil> Yeah |
16:05:37 | PMunch | I think debugger:native and a demangling script is pretty much all you should need.. |
16:05:44 | PMunch | I've done that in gdb before |
16:05:48 | FromDiscord | <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:24 | FromDiscord | <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:11 | PMunch | There used to be a script shipped with Nim that did this |
16:19:31 | FromDiscord | <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:49 | PMunch | Correct |
16:20:40 | FromDiscord | <Hourglass [She/Her]> Good to know |
16:20:55 | FromDiscord | <Hourglass [She/Her]> Nimsuggest is really annoying me rip- |
16:21:45 | FromDiscord | <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:09 | FromDiscord | <Hourglass [She/Her]> Restarting Nimsuggest does nothing too so that's a bust |
16:23:41 | PMunch | Restarting it doesn't work? |
16:23:44 | PMunch | That's a bit suspect |
16:24:29 | FromDiscord | <Hourglass [She/Her]> Not when I do `Ctrl` + `Shift` + `P` and use the `>Nim: Restarts nimsuggest` command |
16:24:43 | FromDiscord | <Hourglass [She/Her]> Idk how else I'd restart it |
16:30:54 | PMunch | I have no idea which editor that is or what that shortcut does |
16:35:26 | FromDiscord | <Hourglass [She/Her]> I'm using Visual Studio Code, CtrlShiftP brings up the command editor |
16:38:49 | FromDiscord | <turbo> Restarting VSC itself usually fixes nimsuggest problems for me (kill nimsuggest -> restart VSC) |
16:41:00 | FromDiscord | <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:23 | FromDiscord | <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:31 | FromDiscord | <Hourglass [She/Her]> In reply to @jmgomez "I would recommend using": Good thing I'm a Linux user :P |
16:43:22 | PMunch | This reminds me, I have some stuff I want to get done in NimLSP.. |
16:44:08 | FromDiscord | <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:18 | PMunch | Well 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:26 | PMunch | There are some parts which are copied over though |
16:45:53 | PMunch | All LSP servers should be compatible with all LSP clients, that's kind of the entire point |
16:46:24 | FromDiscord | <Hourglass [She/Her]> Seems like the nimsaem extension is just kinda completely broken |
16:46:28 | FromDiscord | <Hourglass [She/Her]> Nimsuggest and nim lsp |
16:46:41 | * | xet7 joined #nim |
16:48:48 | FromDiscord | <Hourglass [She/Her]> Yeah, same issue as before |
16:49:15 | FromDiscord | <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:28 | FromDiscord | <Hourglass [She/Her]> Even tried pkill for nimsuggest, but nope |
16:50:08 | FromDiscord | <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:18 | FromDiscord | <Hourglass [She/Her]> ` raise newException(NimberitePacketParsingError,↵ fmt"Received byte with value of `{data}`, which is too big to be a boolean!")` |
16:51:43 | FromDiscord | <Hourglass [She/Her]> code to raise error:`type↵ NimberitePacketParsingError = ref object of CatchableError |
16:51:47 | FromDiscord | <Hourglass [She/Her]> (edit) "CatchableError" => "CatchableError`" |
16:51:56 | FromDiscord | <Hourglass [She/Her]> Pretty sure this is nimsuggest, right? |
16:52:09 | FromDiscord | <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:18 | FromDiscord | <Hourglass [She/Her]> (edit) "to raise error:`type↵ NimberitePacketParsingError = ref object of CatchableError`" => "paste, see https://play.nim-lang.org/#ix=4osM" |
16:57:51 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=4osN |
16:58:02 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osO |
17:02:31 | FromDiscord | <planetis> imo assign should be renamed to =copy so it works. |
17:03:58 | FromDiscord | <Hourglass [She/Her]> In reply to @planetis "no, its object of": I thought it was ref object huh... Welp |
17:04:27 | FromDiscord | <Hourglass [She/Her]> Still weird how the error disappeared whenever I edited exceptions.nim slightly |
17:04:49 | FromDiscord | <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:29 | FromDiscord | <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:01 | FromDiscord | <planetis> It's the same, I just tried with sanitizers but no error |
17:08:24 | FromDiscord | <planetis> Did you compile with v1.6 and refc? |
17:10:01 | FromDiscord | <Hourglass [She/Her]> How would I get a short from two bytes in Nim? Not super sure |
17:10:38 | FromDiscord | <demotomohiro> Short means 16bit int type? |
17:10:45 | FromDiscord | <Hourglass [She/Her]> Yep |
17:11:26 | FromDiscord | <demotomohiro> If so, `(a.int16 shl 8) or b.int16 |
17:11:51 | FromDiscord | <demotomohiro> `a` and `b` are int8. |
17:17:14 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=4osT |
17:17:35 | FromDiscord | <Hourglass [She/Her]> Shouldn't `127` as `a` and `b` give `32767`? I only get `32639` |
17:18:03 | FromDiscord | <Hourglass [She/Her]> Since `127` is the max value for `int8`s |
17:20:08 | FromDiscord | <demotomohiro> !eval echo import strutils; echo 127.toBin(8) |
17:21:08 | NimBot | Compile failed: <no output> |
17:21:31 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=4osV |
17:21:53 | FromDiscord | <Hourglass [She/Her]> In reply to @demotomohiro "!eval echo import strutils;": Aaah i realised my error I think |
17:21:56 | FromDiscord | <Hourglass [She/Her]> Two's complement? |
17:22:02 | FromDiscord | <planetis> except try to work around it by removing the globals and using a main |
17:22:12 | FromDiscord | <Hourglass [She/Her]> Flips the first bit to signify it's signed? |
17:22:23 | FromDiscord | <Hourglass [She/Her]> Well |
17:22:28 | FromDiscord | <Hourglass [She/Her]> I can't word stuff properly |
17:22:37 | FromDiscord | <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:46 | FromDiscord | <ITR> How do I upgrade to v2-rc? |
17:24:10 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4osW |
17:24:13 | FromDiscord | <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:42 | FromDiscord | <planetis> or that just the variable a is not deep copied? |
17:25:11 | FromDiscord | <ITR> No, I get that a is mutated inside the func |
17:25:50 | FromDiscord | <planetis> try to open an issue for that, it shouldn't happen |
17:26:07 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4osZ |
17:26:14 | FromDiscord | <ITR> sent a code paste, see https://play.nim-lang.org/#ix=4ot0 |
17:26:49 | FromDiscord | <planetis> yes ok I get what you mean, it shouldn't happen |
17:28:37 | FromDiscord | <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:28 | FromDiscord | <Hourglass [She/Her]> Oh god, I need to deal with endianness |
17:29:54 | FromDiscord | <Hourglass [She/Her]> Shouldn't be hard to check if the system it's running on is big endian or not |
17:30:01 | FromDiscord | <Hourglass [She/Her]> std/endians ftw |
17:30:25 | FromDiscord | <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:31 | FromDiscord | <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:54 | FromDiscord | <ITR> is there a preview of v2 I should test on before sending in a bug report? |
17:32:04 | FromDiscord | <ITR> in case it's already fixed on dev or something |
17:32:35 | FromDiscord | <planetis> I tried myself, it's not. open an issue if you have time, that would be appreciated |
17:33:25 | FromDiscord | <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:40 | FromDiscord | <ITR> 👍 |
17:41:37 | FromDiscord | <Hourglass [She/Her]> I can parse `int16`s now but, how about `uint32`? |
17:42:52 | FromDiscord | <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:01 | FromDiscord | <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:30 | FromDiscord | <Hourglass [She/Her]> In reply to @demotomohiro "<@909883978717204561> If these 2": Alright good to know, did that but wanted to check xD |
17:49:42 | FromDiscord | <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:34 | FromDiscord | <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:36 | FromDiscord | <ITR> So the way (and if) it mutates also varies based on how many elements is put in it, hence memory stuff |
17:54:09 | FromDiscord | <planetis> So it could be an internal seq reallocating and it points to the old one |
17:55:34 | FromDiscord | <planetis> lucky for us this kind of issues are fixed in v2 as long it's properly implemented with the destructor hooks |
17:56:53 | FromDiscord | <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:39 | FromDiscord | <ITR> nice |
17:58:08 | * | jkl quit (Quit: Gone.) |
18:03:13 | * | jkl joined #nim |
18:28:24 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4otd |
18:28:27 | FromDiscord | <Hourglass [She/Her]> Is this a sane way to do that? :p |
18:48:56 | FromDiscord | <Hourglass [She/Her]> Does `swapEndian32` work in place? So if I wanted to do `swapEndian32(addr result, addr result)`? |
18:52:12 | FromDiscord | <Hourglass [She/Her]> Seems to work |
18:53:57 | * | dropkick joined #nim |
19:04:06 | Amun-Ra | it won't work when useBuiltinSwap is not defined |
19:05:47 | Amun-Ra | it's highly implementation dependent, it may kick you in the a one day |
19:07:28 | * | derpydoo quit (Quit: derpydoo) |
19:10:54 | FromDiscord | <Hourglass [She/Her]> `useBuiltinSwap`? |
19:11:14 | FromDiscord | <Hourglass [She/Her]> In reply to @Amun-Ra "it's highly implementation dependent,": Implementation in the Nim compiler or C compiler? |
19:22:45 | Amun-Ra | Hourglass: both |
19:26:27 | FromDiscord | <Hourglass [She/Her]> So `swapEndian32(addr data, addr result)` is better then? |
19:41:56 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=4otM |
19:43:37 | FromDiscord | <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:57 | FromDiscord | <Hourglass [She/Her]> Yep it's BE |
19:44:08 | FromDiscord | <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:13 | FromDiscord | <Hourglass [She/Her]> In reply to @auxym "you just have the": Yeah since bit ops handle it and stuff |
19:44:28 | FromDiscord | <demotomohiro> Nim & GCC can optimize my swapEndian32 implementation:↵https://godbolt.org/z/6Mj6K5Tjs↵https://godbolt.org/z/fdG5ca47s |
19:44:48 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4otO |
19:45:08 | FromDiscord | <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:53 | FromDiscord | <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:55 | FromDiscord | <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:20 | FromDiscord | <Hourglass [She/Her]> Why would I do this besides sparing me from a lot of writing though, is the question :p |
20:15:52 | FromDiscord | <Hourglass [She/Her]> Wait the endian part is a bit trickier |
20:17:54 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ou0 |
20:19:36 | FromDiscord | <Hourglass [She/Her]> I forgot to remove broken code |
20:19:38 | FromDiscord | <Hourglass [She/Her]> Meh |
20:21:17 | FromDiscord | <Hourglass [She/Her]> I'm using the code |
20:26:20 | FromDiscord | <demotomohiro> system module has `SomeNumber` type class: https://nim-lang.org/docs/system.html#SomeNumber |
20:29:02 | FromDiscord | <Hourglass [She/Her]> Oh nice! |
20:29:47 | FromDiscord | <Hourglass [She/Her]> Is `[R: SomeNumber]` valid for generic procs? |
20:31:14 | FromDiscord | <Elegantbeef> Of course |
20:32:25 | FromDiscord | <Hourglass [She/Her]> Sweet |
20:32:32 | FromDiscord | <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:30 | FromDiscord | <djazz> @Phytolizer like this? https://github.com/PMunch/nimbleutils |
20:37:28 | FromDiscord | <djazz> hmm, not sure how `nimble dump` works for current package |
20:37:40 | FromDiscord | <Phytolizer> hm, that could work. does nimble not allow reading those values in tasks or something though |
20:37:42 | FromDiscord | <djazz> you probably have to just provide your app's package name |
20:37:57 | FromDiscord | <djazz> of course you can read them from tasks |
20:38:01 | FromDiscord | <Hourglass [She/Her]> Nimsuggest really isn't liking my code |
20:38:05 | FromDiscord | <djazz> i thoguht you meant from nim app |
20:38:18 | FromDiscord | <Phytolizer> nah, i just want to embed author/version as constants to be used by the program itself |
20:38:48 | FromDiscord | <Phytolizer> like `-d:AUTHOR:"My Name"` or something |
20:39:25 | FromDiscord | <djazz> that package simply parses `nimble dump` output |
20:39:27 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ou5 |
20:39:38 | FromDiscord | <djazz> should work in const/static mode |
20:39:39 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "like `-d:AUTHOR:"My Name"` or": There's string defines iir |
20:39:41 | FromDiscord | <Hourglass [She/Her]> iirc |
20:40:07 | FromDiscord | <Hourglass [She/Her]> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas |
20:40:47 | FromDiscord | <Phytolizer> yeah im just wondering if it's possible to hook up via nimble, without having to complicate the build too much |
20:41:07 | FromDiscord | <djazz> write a file from before build task? with the values xD |
20:41:21 | FromDiscord | <Phytolizer> maybe and staticRead, lol |
20:41:38 | FromDiscord | <djazz> staticExec nimble dump/ use the package |
20:44:26 | FromDiscord | <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:34 | FromDiscord | <Elegantbeef> https://github.com/juancarlospaco/nodejs |
20:48:34 | FromDiscord | <Elegantbeef> This should show you how |
20:52:00 | FromDiscord | <Phytolizer> i wonder if it'd be an amazingly silly hack to write a `nim.cfg` in the prebuild task lol |
20:54:21 | FromDiscord | <Phytolizer> oh i found this, i think it can help: https://github.com/nim-lang/nimble/issues/625 |
20:56:07 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouk |
20:57:49 | FromDiscord | <Hourglass [She/Her]> Nvm |
20:58:05 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oul |
20:58:28 | FromDiscord | <Phytolizer> i think that might be a syntax restriction with UFCS and generics, because i've hit that before too |
20:59:26 | FromDiscord | <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:57 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "i think that might": Ah |
21:01:02 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "yeah use `[:uint8]` instead": Thanks, will try! |
21:02:15 | FromDiscord | <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:08 | FromDiscord | <Phytolizer> ok that error is obvious from reading the nims docs :P |
21:05:46 | FromDiscord | <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:22 | FromDiscord | <Phytolizer> yeah i see a lot of copy, move, etc but no "write" proc |
21:06:27 | FromDiscord | <Phil> One sec |
21:06:35 | FromDiscord | <Hourglass [She/Her]> doesn't `writeFile` work? |
21:06:49 | FromDiscord | <Hourglass [She/Her]> Accepts a file name and a content string |
21:07:03 | FromDiscord | <Phytolizer> oh what |
21:07:05 | FromDiscord | <Phil> exec nets you any ability to write a file you'd need |
21:07:11 | FromDiscord | <Phytolizer> where is that defined lol, it wokred |
21:07:49 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oup |
21:07:51 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "where is that defined": system.nim lol |
21:07:55 | FromDiscord | <Phytolizer> damn of course |
21:08:07 | FromDiscord | <Hourglass [She/Her]> There's also `readFile`, which takes a file name and returns a string |
21:08:15 | FromDiscord | <Phil> TIL nimscript doesn't have `repr`, my day is ruined |
21:08:16 | FromDiscord | <Phytolizer> wonder why that never came up in my search... yeah i knew about readFile |
21:08:22 | FromDiscord | <Hourglass [She/Her]> Fair |
21:08:33 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "TIL nimscript doesn't have": F |
21:08:38 | FromDiscord | <Phytolizer> i also used staticRead for aoc last year |
21:08:58 | FromDiscord | <Phil> I'm semi certain that there is no difference between read and staticRead in nimscript |
21:09:04 | FromDiscord | <Phytolizer> prob not |
21:09:14 | FromDiscord | <Phytolizer> again the stdlib saves the day ❤️ <https://nim-lang.org/docs/strutils.html#dedent%2Cstring%2CNatural> |
21:10:49 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "I'm semi certain that": Most definitely not |
21:10:59 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "again the stdlib saves": Nim is great |
21:11:32 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouq |
21:12:37 | FromDiscord | <Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ous |
21:13:10 | FromDiscord | <Elegantbeef> I see my multiline idea needs to be in sugar |
21:13:23 | FromDiscord | <Phytolizer> what's the multiline idea? |
21:13:28 | FromDiscord | <Phil> Your what now? |
21:14:02 | FromDiscord | <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:14 | FromDiscord | <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:21 | FromDiscord | <Elegantbeef> Hmm is that less messy who knows |
21:16:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ouv |
21:16:32 | FromDiscord | <Elegantbeef> I just showed it |
21:16:48 | FromDiscord | <Phytolizer> that seems like a natural way to avoid the dedent call at least |
21:16:57 | FromDiscord | <Elegantbeef> matrix bridge moment |
21:17:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4ouw |
21:17:35 | FromDiscord | <Phil> And you're not doing anything with that return |
21:17:37 | FromDiscord | <Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4oux |
21:17:41 | FromDiscord | <Hourglass [She/Her]> ...oh my god i'm fucking stupid |
21:17:44 | FromDiscord | <Phil> The nim compliance cop has thus come to arrest you |
21:18:04 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=4ouw" => "https://play.nim-lang.org/#ix=4ouz" |
21:18:09 | FromDiscord | <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:28 | FromDiscord | <Phil> I only ever read compiler errors 😛 |
21:18:40 | FromDiscord | <Phytolizer> nimsuggest can be funny sometimes :) |
21:18:42 | FromDiscord | <Phil> I don't even think vscode gives me any errors on its own nowadays |
21:21:24 | FromDiscord | <Hourglass [She/Her]> We need something better for VSC Nim support- |
21:23:07 | FromDiscord | <Elegantbeef> Impatiently wait for IC like everyone else |
21:25:10 | FromDiscord | <Phytolizer> i'll wait patiently :) IC is a hard problem |
21:25:19 | FromDiscord | <Hourglass [She/Her]> `IC`? |
21:25:23 | FromDiscord | <Phytolizer> incremental compilations |
21:25:23 | FromDiscord | <Phytolizer> (edit) "compilations" => "compilation" |
21:25:26 | FromDiscord | <Hourglass [She/Her]> Ah |
21:25:43 | FromDiscord | <Elegantbeef> What Araq has been betting on for Nim tooling for years now |
21:28:38 | FromDiscord | <Hourglass [She/Her]> https://paste.ecorous.org/iwarulohuf.py i spent all day, to end up with this lmao |
21:28:45 | FromDiscord | <Hourglass [She/Her]> Idk whether to laugh or cry :p |
21:28:55 | * | ilikescaviar joined #nim |
21:30:57 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "What Araq has been": Welp |
21:31:16 | FromDiscord | <Hourglass [She/Her]> Tbf, incremental C compilation is doable with Zig, right? |
21:31:32 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> Incremental C compilation is doable with Zig, Clang, and GCC afaik |
21:32:07 | FromDiscord | <Hourglass [She/Her]> I mean most of the day was just me rewriting it in multiple ways |
21:32:14 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "Incremental C compilation is": Ah |
21:32:21 | FromDiscord | <Elegantbeef> But it hardly matters cause in many projects Nim is the longest time |
21:32:36 | FromDiscord | <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:52 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "But it hardly matters": And Nimskull improves that quite a bit, doesn't it? |
21:33:00 | FromDiscord | <Elegantbeef> The point that IC is good for is that it turns things like suggest me a symbol into a look up |
21:33:09 | FromDiscord | <Elegantbeef> No clue i do not use nimskull |
21:33:15 | FromDiscord | <Hourglass [She/Her]> Fair |
21:33:34 | FromDiscord | <Hourglass [She/Her]> I can't use it for this project anyway since no async stuff there rn lol |
21:33:38 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "any c (or c++": Fair |
21:33:47 | FromDiscord | <Phytolizer> nimskull is a hard fork no? |
21:33:54 | FromDiscord | <Elegantbeef> Yes |
21:33:58 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "nimskull is a hard": Yep |
21:34:28 | FromDiscord | <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:06 | FromDiscord | <Hourglass [She/Her]> My Nimpiler project was using it |
21:35:35 | FromDiscord | <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:21 | FromDiscord | <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:13 | FromDiscord | <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:17 | FromDiscord | <Hourglass [She/Her]> Also ADHD is a bitch :p |
21:40:35 | FromDiscord | <Phytolizer> oh that's much more reasonable lol |
21:44:07 | FromDiscord | <System64 ~ Flandre Scarlet> Hi, does someone knows how I can write a seq of bytes to a file please? |
21:53:39 | FromDiscord | <Hourglass [She/Her]> In reply to @Phytolizer "oh that's much more": Yeah xD |
21:54:13 | FromDiscord | <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:39 | FromDiscord | <System64 ~ Flandre Scarlet> I'll try this |
21:55:14 | FromDiscord | <Hourglass [She/Her]> 👍 |
21:55:38 | FromDiscord | <Hourglass [She/Her]> You just give the string to something as an argument |
21:55:40 | FromDiscord | <System64 ~ Flandre Scarlet> might be safer |
21:55:40 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ouH |
21:55:52 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouI |
21:59:20 | FromDiscord | <Phytolizer> In reply to @System64 "Hi, does someone knows": there's a proc for this apparently |
21:59:25 | FromDiscord | <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:46 | FromDiscord | <Phytolizer> since it's in io you don't need to even import it |
22:09:14 | FromDiscord | <Hourglass [She/Her]> Nim 2.0 will make it so you need to explicitly import `io` iirc |
22:09:34 | FromDiscord | <Phytolizer> oh interesting, i was just going off the current docs :P |
22:09:54 | FromDiscord | <Phytolizer> are they enforcing `std/` yet? |
22:10:12 | FromDiscord | <Phytolizer> that's breaking so ig it'll be 2.0 as well |
22:11:50 | FromDiscord | <tfp> qq |
22:12:09 | FromDiscord | <tfp> with the `compile` pragma, are symbols declared with `dllexport` statically linked to my nim proggy? |
22:16:19 | FromDiscord | <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:44 | FromDiscord | <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:47 | FromDiscord | <Elegantbeef> New modules require it yes↵(@Phytolizer) |
22:25:24 | FromDiscord | <Phytolizer> that's good news |
22:25:55 | FromDiscord | <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:18 | FromDiscord | <Hourglass [She/Her]> Hey Beef, is it possible to use macros to spit out Nim code? |
22:26:28 | FromDiscord | <Elegantbeef> Of course |
22:26:34 | FromDiscord | <Phytolizer> sure, that's the main use of macros :P |
22:26:42 | FromDiscord | <Hourglass [She/Her]> I mean in a textual way |
22:26:49 | FromDiscord | <Elegantbeef> Of course |
22:26:50 | FromDiscord | <Hourglass [She/Her]> To another file |
22:26:52 | FromDiscord | <Hourglass [She/Her]> Oh huh |
22:26:56 | FromDiscord | <Elegantbeef> you just do `myNimNode.repr` |
22:27:02 | FromDiscord | <Elegantbeef> That gives you a string |
22:27:07 | FromDiscord | <Hourglass [She/Her]> Oh sweet |
22:27:32 | FromDiscord | <Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ouQ |
22:27:34 | FromDiscord | <Hourglass [She/Her]> I'm wondering... Do I even need that for generating docs? |
22:27:52 | FromDiscord | <Hourglass [She/Her]> If macros can spit out Nim code, could I just insert doc strings? |
22:29:27 | FromDiscord | <Elegantbeef> Do i really need to answer this |
22:29:44 | FromDiscord | <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:07 | FromDiscord | <Hourglass [She/Her]> In reply to @Elegantbeef "*Do i really need": Probably not lmao |
22:31:18 | FromDiscord | <Hourglass [She/Her]> Welp, it's macro hell time |
22:31:55 | FromDiscord | <Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=4ouS |
22:31:59 | FromDiscord | <Elegantbeef> you say that while i've been using the compiler as a library 😄 |
22:32:09 | FromDiscord | <Elegantbeef> seeya practically works |
22:32:13 | FromDiscord | <Hourglass [She/Her]> I did that before too, and it went horribly :p |
22:32:41 | FromDiscord | <Phytolizer> the only painful part of writing macros ime is memorizing which child corresponds to what |
22:32:42 | FromDiscord | <Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ouT |
22:32:52 | FromDiscord | <Hourglass [She/Her]> There is also `do quote` tbf |
22:32:59 | FromDiscord | <Elegantbeef> Just contribute to micros 😄 |
22:33:07 | FromDiscord | <Phytolizer> yeah you can quote but there is a flexibility gain to writing the nodes by hand :P |
22:33:10 | FromDiscord | <Elegantbeef> genast \> quote do fite me |
22:33:20 | FromDiscord | <Elegantbeef> Never write nodes by hand unless it's the easiest part |
22:33:27 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> But yea i've got the compiler to make a C Header almost fine https://paste.ecorous.org/asaxafarec.cpp |
22:33:44 | FromDiscord | <Elegantbeef> Ensure `libpq.dll` is in your path |
22:33:49 | FromDiscord | <Elegantbeef> I do not know how to do that on windows |
22:34:01 | FromDiscord | <Phytolizer> windows and dll hell, name a more iconic duo |
22:34:05 | FromDiscord | <tfp> what the heck is this 🙂 |
22:34:06 | FromDiscord | <tfp> sent a code paste, see https://play.nim-lang.org/#ix=4ouU |
22:34:10 | FromDiscord | <tfp> is f not a closure function |
22:34:15 | FromDiscord | <Elegantbeef> It's not |
22:34:18 | FromDiscord | <Elegantbeef> It's a `nimCall` |
22:34:23 | FromDiscord | <Phytolizer> In reply to @tfp "is f not a": you could try annotating with {.closure.} |
22:34:30 | FromDiscord | <tfp> i copied that from the net tho |
22:34:30 | FromDiscord | <Yandall> In reply to @Elegantbeef "Ensure `libpq.dll` is in": postgres/lib is already in my PATH var |
22:34:32 | FromDiscord | <tfp> did something change |
22:34:32 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
22:34:36 | FromDiscord | <Elegantbeef> you literally just need to d o`let z = f` |
22:34:48 | * | Onionhammer joined #nim |
22:34:52 | FromDiscord | <Elegantbeef> Procedures are first class in Nim |
22:34:57 | FromDiscord | <tfp> oh i see |
22:35:01 | FromDiscord | <Phytolizer> In reply to @Elegantbeef "Never write nodes by": maybe im old fashiones 😆 |
22:35:03 | FromDiscord | <Phytolizer> (edit) "fashiones" => "fashioned" |
22:35:03 | FromDiscord | <Elegantbeef> You do not need to do anything but use the name to get their address |
22:35:04 | FromDiscord | <tfp> its also a top level function |
22:35:05 | FromDiscord | <Hourglass [She/Her]> What's a funny and creative name for a project that represents Minecraft packets :p |
22:35:19 | FromDiscord | <Elegantbeef> Making Nim AST by hand is just awful and unmaintainable |
22:35:25 | FromDiscord | <Elegantbeef> In some cases it's the best to do |
22:35:26 | FromDiscord | <tfp> ty |
22:35:29 | FromDiscord | <Elegantbeef> But in most cases iit's best not to |
22:36:14 | FromDiscord | <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:19 | FromDiscord | <Elegantbeef> This API is so readable you cannot beat it |
22:36:53 | FromDiscord | <tfp> looks like the dart metaprogramming api |
22:37:32 | FromDiscord | <Elegantbeef> Using distinct types and iterators creates a much more readable API that does not rely on knowing where AST nodes are |
22:37:47 | FromDiscord | <Phytolizer> yeah i need to mess more with genasts, i just don't write macros very often lol |
22:37:51 | FromDiscord | <Phytolizer> templates end up working for most of my uses |
22:38:20 | FromDiscord | <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:43 | FromDiscord | <Elegantbeef> But I much much prefer reading code that uses genast instead of complex `newX` chaining |
22:39:43 | FromDiscord | <huantian> In reply to @Hourglass, When the Hour Strikes "What's a funny and": Napkins |
22:40:43 | FromDiscord | <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:47 | FromDiscord | <Phytolizer> oof |
22:40:56 | FromDiscord | <Phytolizer> yeah that's where DLLs are stored if i remember right |
22:41:38 | FromDiscord | <Yandall> I got confused because there is a file with the same name in the lib folder 😅 |
22:41:51 | FromDiscord | <Phytolizer> it's a .lib tho right? |
22:41:54 | FromDiscord | <Yandall> yeah |
22:42:03 | FromDiscord | <Phytolizer> yeah that's different :P |
22:42:22 | FromDiscord | <Phytolizer> i wish windows didn't start hiding those all-important extensions by default |
22:42:27 | FromDiscord | <Yandall> not. my bad, its a .dll |
22:42:35 | FromDiscord | <Phytolizer> oh that's epic |
22:43:02 | FromDiscord | <Yandall> yeah, weird |
22:43:36 | FromDiscord | <Phytolizer> i think windows has a concept of "import library" or something |
22:43:41 | FromDiscord | <Phytolizer> and that might be what that dll is |
22:44:00 | om3ga | dlopen? |
22:44:23 | FromDiscord | <Hourglass [She/Her]> In reply to @huantian "Napkins": Perfect :) |
22:44:27 | FromDiscord | <Phytolizer> it's spelled `LoadLibrary` in win32 |
22:45:00 | FromDiscord | <Yandall> I didn't knew that |
22:45:11 | FromDiscord | <Phytolizer> yeah windows likes to complicate things lol |
22:45:18 | FromDiscord | <Phytolizer> the bindir dll is the right one to use though |
22:45:35 | om3ga | i don't like windows. it works very bad |
22:46:02 | FromDiscord | <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:18 | FromDiscord | <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:54 | FromDiscord | <Hourglass [She/Her]> Nimble packages really need to be checked every once in a while |
23:11:55 | FromDiscord | <Hourglass [She/Her]> Dead links are a pain |
23:12:06 | FromDiscord | <Elegantbeef> A nim string is utf8 encoded so it really doesnt matter |
23:12:16 | FromDiscord | <Hourglass [She/Her]> `mcevents` isn't on nimble any more so |
23:12:27 | FromDiscord | <Elegantbeef> If you have a proc that takes a `openArray[byte]` just use `toOpenArrayByte` |
23:12:32 | FromDiscord | <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:08 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "https://nim-lang.org/docs/io.html#readBytes%2CFile%": they are bound checked? |
23:14:45 | FromDiscord | <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:30 | FromDiscord | <tfp> any tips for binding a large cpp library |
23:20:43 | FromDiscord | <tfp> rn im adding a C api by hand |
23:20:46 | FromDiscord | <tfp> and then i plan on using c2nim |
23:20:53 | FromDiscord | <tfp> is there a faster way? it's a huge lib-- RmlUi |
23:21:02 | FromDiscord | <System64 ~ Flandre Scarlet> Futhark maybe? |
23:22:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Phytolizer "it'll return a lesser": okay it accepts seqs |
23:25:11 | FromDiscord | <tfp> In reply to @System64 "Futhark maybe?": interesting |
23:25:15 | FromDiscord | <tfp> it's a CPP lib though |
23:25:32 | FromDiscord | <tfp> maybe i can use swig to generate c bindings |
23:25:35 | FromDiscord | <tfp> and then use futhark? |
23:25:45 | FromDiscord | <tfp> are there any examples of cpp libs bound to nim? maybe bullet |
23:29:06 | FromDiscord | <System64 ~ Flandre Scarlet> No idea for CPP |
23:29:37 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4ouY |
23:33:14 | FromDiscord | <Phytolizer> In reply to @System64 "okay it accepts seqs": yeah openArray accepts seq, and a bunch of other array-likes |
23:33:55 | FromDiscord | <System64 ~ Flandre Scarlet> Oh interesting, but why do I have this error? |
23:35:09 | FromDiscord | <Rika> Read bytes overwrites contents, not adds, so you have to have contents in the sequence |
23:35:35 | FromDiscord | <System64 ~ Flandre Scarlet> I didn't understood |
23:37:39 | FromDiscord | <Rika> var data = newSeq[byte](1000000)↵....↵data.setLen(len) |
23:39:50 | FromDiscord | <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:59 | PMunch | @djazz, @Phytolizer, nimbleutils is written to explicitly support being run on compile-time |