00:07:07 | * | disso-peach joined #nim |
00:16:08 | * | lucasta quit (Remote host closed the connection) |
00:58:21 | FromDiscord | <gogolxdong> Does Nim http module support streaming output? |
01:00:56 | FromDiscord | <Graveflo> are you talking about httpclient and access to the socket as a stream? |
01:04:07 | FromDiscord | <gogolxdong> yes |
01:05:32 | FromDiscord | <Elegantbeef> `response` has a `bodyStream` |
01:08:43 | FromDiscord | <Graveflo> I'm not sure about sending a file, but I had to do something like this recently. The httpclient public interface is not very capable of covering more then basic situations but the modules code is written well and not difficult to understand. I was able to get it to do what I wanted by using `privateAccess(HttpClient)` and `import std/httpclient {. all .}`. If you cant get the public interface to do what you want consider calling the inte |
01:12:00 | FromDiscord | <Elegantbeef> Oh for uploading |
01:12:51 | FromDiscord | <Elegantbeef> `add` has an overload that has `useStream` |
01:12:56 | FromDiscord | <Graveflo> bodyStream was an issue for downloading too, in my case, because I needed to go through a www-authenticate (401) redirect sometimes |
01:13:23 | FromDiscord | <gogolxdong> like reading from stream word by word of openai chat api response |
01:14:30 | FromDiscord | <Graveflo> I'm just checking, but can you just use `response.body()` and then parse the string? or is something more complex going on? |
01:16:39 | FromDiscord | <gogolxdong> API responds word by word in stream and body returns all of them at one time. |
01:17:10 | FromDiscord | <Graveflo> oh so you want to update on the fly so the user isnt waiting on seemingly nothing for too long |
01:17:21 | FromDiscord | <gogolxdong> yes |
01:18:33 | FromDiscord | <Graveflo> ok bodyStream may not be what you want since IIRC it just wraps the fully recved text into a stringStream and thus will block until the end anyway. Lemme see |
01:18:47 | FromDiscord | <Elegantbeef> `asynchttpclient` 😄 |
01:19:58 | FromDiscord | <Elegantbeef> Actually same problem just doesnt block at the callsite |
01:20:14 | FromDiscord | <Graveflo> oh I ignored that code bc im not using async. Does it feed the bodyStream as pieces come in before the full content-len of bytes is recv? |
01:20:41 | FromDiscord | <Elegantbeef> I do not know, but it returns a `Future[string]` so doesnt seem it chuns |
01:20:47 | FromDiscord | <Elegantbeef> chunks\ |
01:20:55 | FromDiscord | <Elegantbeef> I do not do web stuff |
01:21:11 | FromDiscord | <Elegantbeef> Yea it calls `readAll` so it is not what they want |
01:21:54 | FromDiscord | <Elegantbeef> you'd need to get the `bodyStream` of the response and use async to read it |
01:22:08 | FromDiscord | <Elegantbeef> `bodyStream` of both are exposed |
01:25:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4wRM |
01:25:20 | FromDiscord | <Elegantbeef> Reading the first 10 lines from hackernews |
01:26:52 | FromDiscord | <Graveflo> You very well may be right, I'm still reading the code again, but the real test would be if the body is sent from the source in intervals. Does the bodyStream start feeding when data is available or only after the full body has been received? Also @gogolxdong are you using async or non-async or is either fine? |
01:27:23 | FromDiscord | <Elegantbeef> Nah it doesnt make any sense to download then stream the data |
01:27:36 | FromDiscord | <Graveflo> I'm pretty sure that |
01:27:48 | FromDiscord | <Graveflo> mb enter by mistake... im pretty sure thats how the non-async does it |
01:27:58 | FromDiscord | <Elegantbeef> Got a large file? 😄 |
01:31:42 | FromDiscord | <Elegantbeef> Preliminary testing shows you might be right |
01:32:18 | FromDiscord | <Graveflo> thats actually a decent place to start looking. bc if you look at `downloadFile` for non-async it just swaps the stream on the client object and sets the private `getBody` flag to change how `parseBody` will work a little bit |
01:32:30 | FromDiscord | <Elegantbeef> Takes 6 seconds to start reading a 100mb file |
01:32:40 | FromDiscord | <Elegantbeef> So yea it certainly does not do what we want |
01:33:27 | FromDiscord | <Graveflo> that could be changed with buffer sizes maybe? If it is doing that then it is performing better then the non-async version would. |
01:36:44 | FromDiscord | <Elegantbeef> No clue |
01:37:37 | FromDiscord | <Graveflo> yea I think the way to get fine-grained control from this would be to look at `downloadFileEx` and `downloadFile` prob going to have to use your own stream. I dont mess with the async stuff, so itll take me a while to figure that out. If I were doing it without async I would get `getBody` to false make the request and then access the stream directly just as `parseBody` does |
01:37:40 | FromDiscord | <Graveflo> but thats just me |
01:40:08 | FromDiscord | <Graveflo> @gogolxdong is there an example url / query that I could use to test it out. So I can get that delayed behavior that you are trying to work around over the socket? |
01:42:39 | FromDiscord | <gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1112194186930827294/gpt4.py |
01:43:05 | FromDiscord | <gogolxdong> this is how python sdk works |
01:43:54 | FromDiscord | <gogolxdong> (edit) "this is how python sdk works ... " added "when stream=True" |
01:47:46 | FromDiscord | <gogolxdong> no luck to have httpclient work so far |
01:50:36 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4wRS |
01:50:56 | FromDiscord | <gogolxdong> (edit) "https://play.nim-lang.org/#ix=4wRS" => "https://play.nim-lang.org/#ix=4wRT" |
01:52:13 | FromDiscord | <Graveflo> alright I had to touch grass for a second. I'll see if I can get something to work |
02:15:40 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wRX |
02:29:18 | FromDiscord | <Graveflo> yea I'm having an issue where the socket is blocking bc it seems unable to fill the requested size to recv... but there is no content length and typically socket apis will just return with less in this case. The code in httpclient seems to be made with this expectation as well so I'm not sure why its hanging |
02:47:05 | FromDiscord | <Graveflo> I'm having a difficult time finding an example url that doesnt use chunked encoding. Do you know if the url you want to use is chunked? |
02:56:11 | FromDiscord | <gogolxdong> https://api.openai.com/v1/chat/completions |
03:08:01 | FromDiscord | <Rika> accidental paste? |
03:12:48 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wS3 |
03:18:45 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4wS4 |
03:19:13 | FromDiscord | <gogolxdong> you can try this |
03:22:00 | FromDiscord | <Graveflo> yea I dont have an api key. but `response.body()` gets the error message fine. Is there an issue with `response.body()` for you? |
03:32:04 | FromDiscord | <gogolxdong> no? |
03:33:43 | FromDiscord | <gogolxdong> just have no idea how to show response word by word even with bodyStream |
03:34:23 | FromDiscord | <gogolxdong> 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 |
03:34:28 | FromDiscord | <gogolxdong> try this api-key |
03:34:45 | FromDiscord | <gogolxdong> It will be removed after testing |
03:35:06 | FromDiscord | <Graveflo> k i try 1 sec |
03:37:29 | FromDiscord | <Graveflo> ok I tried it out. Unfortunately, this uses chunked encoding (should have seen that one coming) so what I did will not work without annoying modifications. However there is a decent chance that what beef said will work just fine (go figure). switch to async. reading from the bodyStream concurrently may make data available at the time each chunk arrives |
03:40:20 | FromDiscord | <Elegantbeef> Some say I might know things, I still doubt it myself |
03:41:56 | FromDiscord | <Graveflo> I'll take a quick look at the code and see if I can tell whether async version will work. If it doesn't the only way I know how to do what you want is to try and re-use the httpclient's `parseChunks` proc, but if that doesn't play well then the only option would be to use the code that I posted and re-implement chunked encoding parsing. Not the end of the world but thats the best I can come up with |
03:44:22 | * | arkurious quit (Quit: Leaving) |
03:51:33 | FromDiscord | <Graveflo> so `recvFull` only reads up to a certain size and then it dumps the data into the output buffer. That is good news. I think this means that the non-async code will block until `parseChunks` is done but the async version will populate the output stream in chunks without blocking. You should be able to get each chunk as they come in by polling response.bodyStream concurrent to the `request` |
03:55:38 | FromDiscord | <Phil Wang> hey all, really enjoying learning Nim so far. was wondering what the community would recommend for building a medium sized website with the least amount of pain these days. I notice that jester is being used for the nim forums, but that prologue seems to be more actively maintained |
04:18:11 | FromDiscord | <that_dude> https://github.com/ringabout/awesome-nim#frameworks If you want a good list too look at check out this site. Unfortunately I don't know anything about them |
04:19:47 | FromDiscord | <gogolxdong> @Graveflo by polling response.bodyStream concurrent to the request what does this mean |
04:19:59 | FromDiscord | <gogolxdong> (edit) "by" => "`by" | "request" => "request`" |
04:23:13 | FromDiscord | <lucidrains> yup, gone through that list already and narrowed it down to prologue or jester, and keeping an eye on happyx↵(@that_dude) |
04:23:31 | FromDiscord | <Graveflo> I mean that the Future object that is returned by `request` will be ready about at the same time the body start being read. At this time the request's bodyStream will be set up and over the time that it has data being put in it from the async code that is reading the body you can try and read from the stream until it "completes". I'm trying to get basic async examples to compile and they are failing me. I'll keep trying |
04:24:12 | FromDiscord | <that_dude> Have you checked out the webdev channel? |
04:24:36 | FromDiscord | <lucidrains> oh no I haven't! |
04:27:10 | FromDiscord | <Elegantbeef> I do have to say sadly the matrix bridge does not propagate reactions |
04:27:34 | FromDiscord | <Elegantbeef> Those discord peasants cannot see your reactions and vice versa for us |
04:27:36 | FromDiscord | <lucidrains> Is it a webdev channel specific for Nim?↵(@that_dude) |
04:27:44 | FromDiscord | <Elegantbeef> There is one |
04:27:46 | FromDiscord | <Elegantbeef> It's in the Nim space |
04:28:11 | FromDiscord | <Elegantbeef> [#nim\:envs.net](https://matrix.to/#/#nim:envs.net) for the space |
04:33:08 | FromDiscord | <lucidrains> Oh darn, ok I'll stop using them |
04:33:09 | FromDiscord | <Elegantbeef> No continue, discourage them for using discord! |
04:33:11 | FromDiscord | <lucidrains> Thanks! |
04:34:09 | FromDiscord | <that_dude> You get to miss out on Super reactions! |
04:38:18 | FromDiscord | <that_dude> Does matrix show history/searching like discord does? |
04:38:29 | FromDiscord | <that_dude> show history or have searching |
04:38:57 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wSg |
04:44:21 | FromDiscord | <Rika> In reply to @Elegantbeef "No continue, discourage them": jokes on you we dont care |
04:44:21 | FromDiscord | <Rika> lol |
04:49:28 | FromDiscord | <Elegantbeef> Oh shucks I didnt think of that part |
05:30:32 | FromDiscord | <HitBlast> sent a code paste, see https://play.nim-lang.org/#ix=4wTq |
05:30:54 | FromDiscord | <HitBlast> (edit) "https://play.nim-lang.org/#ix=4wTq" => "https://play.nim-lang.org/#ix=4wTr" |
05:31:21 | FromDiscord | <HitBlast> (edit) "https://play.nim-lang.org/#ix=4wTr" => "https://play.nim-lang.org/#ix=4wTs" |
05:32:38 | FromDiscord | <Elegantbeef> `import std/sugar` use `collect` |
05:36:42 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4wTt |
05:37:24 | FromDiscord | <gogolxdong> @Graveflo thanks for your help! |
05:38:40 | FromDiscord | <HitBlast> sent a code paste, see https://paste.rs/S7HU3 |
05:38:48 | FromDiscord | <Elegantbeef> Did you test it? |
05:39:00 | FromDiscord | <HitBlast> Haven't yet, testing. |
05:39:11 | FromDiscord | <Elegantbeef> Don't ask if something works when you can just test it! |
05:41:26 | FromDiscord | <HitBlast> In reply to @Elegantbeef "Don't ask if something": It works, but is there a way to remove this repetition of code? I don't know if this is an optimal solution. https://media.discordapp.net/attachments/371759389889003532/1112254284545917039/Screenshot_2023-05-28_at_11.40.27_AM.png |
06:15:02 | * | Notxor joined #nim |
06:28:28 | FromDiscord | <Quantum> Are these two absolutely identical, or am I seeing things? 😁 ↵https://nim-lang.org/docs/random.html#initRand%2Cint64↵https://nim-lang.org/docs/random.html#initRand%2Cint64_2 |
06:30:26 | FromDiscord | <Rika> Looks like a bug in the doc gen |
06:33:59 | * | rockcavera quit (Remote host closed the connection) |
06:43:49 | * | ntat joined #nim |
07:56:11 | * | junaid_ joined #nim |
08:14:18 | FromDiscord | <sigmasd> Is something troubling you ? |
08:14:19 | FromDiscord | <sigmasd> We were discussing you -- not me. |
08:14:19 | FromDiscord | <sigmasd> You're not really talking about me -- are you ? |
08:14:19 | FromDiscord | <sigmasd> Is it because you are not really talking about I that you came to me ? |
08:14:19 | FromDiscord | <sigmasd> Does it please you to believe I am not really talking about you ? |
08:14:49 | FromDiscord | <that_dude> ? |
08:15:12 | FromDiscord | <that_dude> bridge lag or bot? |
08:16:43 | FromDiscord | <Elegantbeef> There are no other messages here |
08:20:00 | FromDiscord | <leorize> tree-sitter-nim showcase\: |
08:20:05 | FromDiscord | <leorize> image.png https://media.discordapp.net/attachments/371759389889003532/1112294207542013953/image.png |
08:20:33 | FromDiscord | <leorize> you can't get highlighting like this with nimsuggest 😄 |
08:23:17 | FromDiscord | <Elegantbeef> Semantic highlignting? |
08:24:46 | FromDiscord | <Elegantbeef> I'm a bit of a numpty cause I do not really see anything special in your highliting |
08:25:19 | FromDiscord | <HitBlast> sent a code paste, see https://play.nim-lang.org/#ix=4wTW |
08:25:42 | FromDiscord | <Elegantbeef> `validUtf8` |
08:25:45 | FromDiscord | <leorize> yea |
08:26:02 | FromDiscord | <leorize> context-aware, too |
08:26:43 | FromDiscord | <Elegantbeef> So `isCpsCall` is a field? |
08:27:05 | FromDiscord | <leorize> nope, but that's all you can infer from the syntax |
08:27:23 | FromDiscord | <Elegantbeef> I see |
08:27:28 | FromDiscord | <leorize> for even more bonkers I'd have to write the definition queries to let it support a pseudo-lsp experience |
08:27:48 | FromDiscord | <Elegantbeef> I'm a bit silly since I'm mostly fine with Kate's syntax highlighting for Nim |
08:28:12 | FromDiscord | <HitBlast> sent a code paste, see https://play.nim-lang.org/#ix=4wTY |
08:29:15 | FromDiscord | <Elegantbeef> Sure why not |
08:29:31 | FromDiscord | <HitBlast> (edit) "https://play.nim-lang.org/#ix=4wTY" => "https://play.nim-lang.org/#ix=4wTZ" |
08:29:38 | FromDiscord | <Elegantbeef> Anywho leo, good job 😄 |
08:29:48 | FromDiscord | <Elegantbeef> I know people like tree sitter grammars not that I use them |
08:30:22 | FromDiscord | <Elegantbeef> It's near the end of the month if you want a TMWN post 😛 |
08:32:14 | FromDiscord | <leorize> i'd say the killer feature is incremental selection\: https://asciinema.org/a/qO4GzAwYhm7tgLj1TbOdyfXw0 |
08:32:33 | FromDiscord | <leorize> still have some rough edges but works pretty well |
08:33:01 | FromDiscord | <Elegantbeef> Maybe one day I'll try to use nvim as my editor |
08:33:11 | FromDiscord | <Elegantbeef> that was a nice notification atleast, no clue what provided that 😄 |
08:33:30 | FromDiscord | <leorize> that's noice.nvim |
08:33:54 | FromDiscord | <leorize> the fun thing about tree-sitter is that it works with any editor that supports it |
08:34:11 | FromDiscord | <Elegantbeef> Yea but I generally do want to try nvim again |
08:34:13 | FromDiscord | <leorize> and that includes helix, atom, vscode(? not sure but I read about it somewhere) |
08:34:17 | FromDiscord | <Elegantbeef> Just need to set it up how i want |
08:34:30 | FromDiscord | <leorize> I used a base config this time around |
08:34:45 | FromDiscord | <Elegantbeef> Like I generally have a file explorer, then a docked terminal at the bottom |
08:34:49 | FromDiscord | <Elegantbeef> Basically like vscode/kate |
08:35:04 | FromDiscord | <Elegantbeef> Like a heathen |
08:35:05 | FromDiscord | <leorize> my config have that too, I just summon them as needed |
08:35:07 | FromDiscord | <Elegantbeef> Tmux i guess does the docked terminal |
08:35:35 | FromDiscord | <leorize> although I'd say that fuzzy file search rendered file explorer obsolete |
08:35:57 | FromDiscord | <Elegantbeef> The command palette i assume |
08:36:28 | FromDiscord | <leorize> nvim is pretty much an ide but not configured by default at this point |
08:36:52 | FromDiscord | <Elegantbeef> Oh trust me I know, I've tinkered with it, but never got it comfortable enough for me |
08:39:11 | FromDiscord | <leorize> premade configs are getting pretty good at getting out of the way |
08:39:15 | FromDiscord | <leorize> in case you want to try again |
08:39:35 | FromDiscord | <leorize> and ofc using lua instead of vimscript made life much easier |
08:59:04 | FromDiscord | <sOkam!> In reply to @Elegantbeef "Just need to set": try astro or lunarvim. they are both really good |
08:59:46 | FromDiscord | <sOkam!> i wanted my own custom config, because im a customization obsessed person... and i didn't even need to bother. those two just do it great, minus some tweaks for my own workflow |
09:09:02 | FromDiscord | <leorize> kickstart.nvim for super minimal, lazyvim for in-between, and astro/lunar for full distro |
09:23:03 | * | Notxor quit (Remote host closed the connection) |
09:36:51 | * | ntat quit (Quit: Leaving) |
09:50:27 | FromDiscord | <chmod222> If I have a `ptr T` to some `T` that has a `=destruct` and I want to manually invoke that destructor at the appropriate time, is calling `=destroy(myT[])` the way to go or are there any predefined functions just like `create` is a predefined wrapper over `alloc(sizeOf T)`= |
09:51:57 | FromDiscord | <chmod222> I know that `=destroy(myT[])` followed by `dealloc(myT)` properly destroys and frees my object, I'd just like to know if there's maybe an already provided function that does both of these so I wouldn't need to implement it myself |
10:07:34 | FromDiscord | <demotomohiro> That sounds like you are going to implment a smart pointer. |
10:07:54 | FromDiscord | <chmod222> Not really, I already have a smartpointer somewhere else that properly does this |
10:08:17 | FromDiscord | <chmod222> I just need to shove an object that has a destructor as a pointer over an FFI boundary and destroy it on the other side |
10:09:10 | FromDiscord | <chmod222> But the one I already have doesn't use nims memory manager so I wouldn't expect there to be a helper function for that |
10:17:02 | FromDiscord | <Rika> I switched from neovim to VSCode because I wanted a richer UI than what terminal UIs gave |
11:15:41 | madprops | using vim mode in vscode? |
11:39:02 | FromDiscord | <michaelb.eth> In reply to @Rika "I switched from neovim": any thoughts on how terminal UIs could improve? |
11:40:05 | FromDiscord | <Rika> In reply to @michaelb.eth "any thoughts on how": They are already good for most but I want “real”, at least that is what I am chasing |
11:40:29 | FromDiscord | <Rika> The character block granularity limitation makes it look dated for me |
11:40:59 | FromDiscord | <Rika> Especially for pop ups |
11:43:33 | FromDiscord | <伊弉冉の恵み> https://rosettacode.org/wiki/Factorial |
11:44:06 | FromDiscord | <Rika> ? |
11:44:11 | FromDiscord | <伊弉冉の恵み> the nim one is wrong |
11:44:13 | FromDiscord | <Rika> In reply to @madprops "using vim mode in": Yes |
11:44:41 | FromDiscord | <Rika> Can’t move away from Vim style editing (not generally modal, specifically Vim) |
11:44:53 | FromDiscord | <伊弉冉の恵み> In reply to @伊弉冉の恵み "the nim one is": the recursive one |
11:44:59 | FromDiscord | <伊弉冉の恵み> i cant edit my ip range is banned for some reason |
11:46:47 | FromDiscord | <Rika> Missing the : int no? |
11:46:50 | FromDiscord | <伊弉冉の恵み> yeah |
11:46:53 | FromDiscord | <伊弉冉の恵み> on x |
11:47:08 | FromDiscord | <伊弉冉の恵み> sent a long message, see http://ix.io/4wUr |
11:47:26 | FromDiscord | <伊弉冉の恵み> you can ommit the echo part that was me testing it |
11:49:23 | FromDiscord | <Rika> I can’t edit either, don’t know why |
11:49:36 | FromDiscord | <Rika> In reply to @伊弉冉の恵み "i cant edit my": If you’re using a VPN |
12:23:28 | FromDiscord | <ieltan> In reply to @michaelb.eth "any thoughts on how": People need to make things with `notcurses` |
12:24:15 | FromDiscord | <sigmasd> Where can I find the code that nim uses for matrix bridging |
12:25:45 | FromDiscord | <伊弉冉の恵み> In reply to @Rika "If you’re using a": ah true |
12:25:47 | FromDiscord | <伊弉冉の恵み> i forgot |
12:31:43 | FromDiscord | <voidwalker> what's the shortest way to find the index of the first digit char in a string ? |
12:32:46 | FromDiscord | <Andreas> In reply to @voidwalker "what's the shortest way": char is known or any digit 0..9 ? |
12:32:53 | FromDiscord | <voidwalker> 0..9 |
12:37:46 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4wUw |
12:39:19 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wUx |
12:39:25 | FromDiscord | <voidwalker> (edit) "https://play.nim-lang.org/#ix=4wUx" => "https://play.nim-lang.org/#ix=4wUy" |
12:42:48 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=4wUB |
12:42:50 | FromDiscord | <voidwalker> std/strutils |
13:19:02 | FromDiscord | <sOkam!> In reply to @Rika "I switched from neovim": know of Onivim2? abandoned project, but the state they left it in is really amazing if you ask me |
13:19:17 | FromDiscord | <Rika> In reply to @sOkam! "know of Onivim2? abandoned": I do |
13:20:25 | FromDiscord | <Rika> I don’t think I took it seriously because it’s currently lifeless |
13:21:27 | FromDiscord | <sOkam!> im sure there are rough edges missing, but for the most part is as close to RC as i can think of |
14:14:41 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wUW |
14:15:15 | FromDiscord | <voidwalker> (edit) "code paste," => "long message," | "https://play.nim-lang.org/#ix=4wUW" => "http://ix.io/4wUX" |
14:15:21 | FromDiscord | <voidwalker> (edit) "long message," => "code paste," | "http://ix.io/4wUX" => "https://play.nim-lang.org/#ix=4wUW" |
14:15:39 | FromDiscord | <voidwalker> how do you get an xmlnode's `.s[0]` ? |
14:16:48 | FromDiscord | <voidwalker> the s (seq[XmlNode]) is not public. child only returns the first child node with a given name, and this one doesn't appear to have a name |
14:17:28 | FromDiscord | <voidwalker> I need the text, but innerText gives me more than I need (`If n is xnElement, runs recursively on each child node and concatenates the results.↵Otherwise returns an empty string.`) |
14:17:33 | FromDiscord | <voidwalker> (edit) "results.↵Otherwise" => "results.Otherwise" |
14:17:51 | FromDiscord | <voidwalker> (edit) "results.Otherwise returns an empty string.`)" => "results.`)" |
14:23:02 | FromDiscord | <voidwalker> ah, I looked at child proc code, and there's `items(n)` |
14:31:54 | FromDiscord | <Rika> holy mother of indentation |
14:32:06 | FromDiscord | <Rika> how many levels of indentation is that |
14:38:10 | FromDiscord | <System64 ~ Flandre Scarlet> Hi, how can I put a string in the Clipboard please? |
14:46:00 | FromDiscord | <Graveflo> I don't think that function is in the standard library. It's a platform specific thing |
14:48:35 | FromDiscord | <Graveflo> can try this maybe: https://github.com/genotrance/nimclipboard |
14:51:13 | * | lucasta joined #nim |
14:52:03 | * | lucasta quit (Remote host closed the connection) |
14:52:28 | * | lucasta joined #nim |
14:54:36 | FromDiscord | <demetera> Hi guys, do somebody used NiGui extensively? |
15:07:29 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4wVm |
15:13:12 | FromDiscord | <chmod222> You could use strip from strutils |
15:17:18 | FromDiscord | <Chronos [She/Her]> In reply to @chmod222 "You could use strip": That'd break stuff like `00000102` |
15:19:01 | FromDiscord | <Graveflo> how would it break it? It would treat the 0s like strip normally treats white space right? so it would strip away `00000` and leave `102` |
15:19:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Graveflo "how would it break": But now there is a problem when the number is... 0 |
15:19:48 | FromDiscord | <Graveflo> you could make a special condition where the empty string is replaced with 0. I |
15:20:04 | FromDiscord | <Graveflo> m assuming that the empty string is what results from stripping 0 from all 0s |
15:22:25 | * | Notxor joined #nim |
15:27:27 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wVp |
15:28:06 | * | rockcavera joined #nim |
15:28:46 | FromDiscord | <Graveflo> I removed the code that makes negatives work correctly btw |
15:39:28 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wVr |
15:42:08 | FromDiscord | <Graveflo> scratch all that. I'm done. Its just wrong |
15:51:08 | FromDiscord | <demotomohiro> strformat provides more control to how to print hex rather than toHex: https://nim-lang.org/docs/strformat.html |
16:09:21 | FromDiscord | <Graveflo> yea `fmt"{some_int:x}"` is certainly the easiest way since you can omit the padding |
16:21:20 | FromDiscord | <michaelb.eth> In reply to @ieltan "People need to make": I'm working on making that possible with Nim |
16:21:58 | FromDiscord | <michaelb.eth> (edit) "Nim" => "Nim↵https://github.com/michaelsbradleyjr/nim-notcurses" |
16:24:18 | * | derpydoo joined #nim |
16:24:43 | FromDiscord | <voidwalker> I'm trying to parse some stuff including file names from an html, with std/htmlparser. Almost finished when I noticed I have some file name printed as `You\xe2�\x99�d` instead of `You’d` - that char is `U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark}` |
16:26:11 | FromDiscord | <voidwalker> so strings are only ascii and I need to use std/unicode ? |
16:30:20 | Amun-Ra | strings are more like unspecified binary |
16:30:50 | Amun-Ra | I mean ASCII characters and non ASCII octets |
16:34:04 | FromDiscord | <michaelb.eth> In reply to @voidwalker "I'm trying to parse": what OS are you using? |
16:34:11 | FromDiscord | <voidwalker> arch btw |
16:35:49 | FromDiscord | <michaelb.eth> In reply to @voidwalker "arch btw": what if you `export LANG=en_US.UTF-8`, does that change the printed output? |
16:36:58 | FromDiscord | <voidwalker> it's already en_US.UTF-8 |
16:39:09 | FromDiscord | <Graveflo> when I read html that has that unicode character in it I am able to parse it and print it without getting the encoding artifacts. is it the terminal? what proc are you using to extract the string? I had the data in an element so I used `innerText` |
16:39:11 | FromDiscord | <michaelb.eth> hmm, seeing `�` (replacement character: https://codepoints.net/U+FFFD) is usually a sign there's something wrong with the locale |
16:40:04 | FromDiscord | <voidwalker> I use `innerText` |
16:40:22 | FromDiscord | <Graveflo> try putting the unicode string in a file and `cat` it. See how the terminal responds |
16:40:59 | FromDiscord | <voidwalker> looks fine if I copy paste it from Kate and cat it in terminal |
16:41:08 | FromDiscord | <voidwalker> (edit) "from" => "" | "Kate ... and" added "(from .html file)" |
16:41:44 | * | pharonix71 quit (Ping timeout: 240 seconds) |
16:43:02 | FromDiscord | <sOkam!> Is there any way to restrict/limit the number of entries of an enum to some certain number? (compile time, ofc) |
16:43:18 | FromDiscord | <Graveflo> well I'm stumped. Have you confirmed where things start to go wrong. Like where is the string coming in from: a socket, a file, literal? Is it sanitary before it goes into `parseHtml` and only soured after you try and pull data out of the xmlNodes? |
16:43:57 | * | pharonix71 joined #nim |
16:44:23 | FromDiscord | <voidwalker> it's coming from a local .html file |
16:45:20 | FromDiscord | <Rika> when you read the file does the file content string already have the strange bytes |
16:46:17 | FromDiscord | <michaelb.eth> there's at std/unicode proc that validates utf8 bytes, I think↵maybe staticRead the file and check if the bytes are valid? |
16:46:25 | FromDiscord | <Graveflo> In reply to @sOkam! "Is there any way": arent enums supposed to be defined statically? Are you generating them with a macro or something? |
16:46:30 | FromDiscord | <guttural666> shouldn't this return statement work inside the template? it should exit out of the next_token proc? https://media.discordapp.net/attachments/371759389889003532/1112421653297758279/image.png |
16:47:19 | FromDiscord | <sOkam!> In reply to @Graveflo "arent enums supposed to": no, just want to mark it so that the enum max value allowed ever is coming from a predetermined const↵just to aid the compiler in case of human-side error |
16:47:24 | FromDiscord | <guttural666> (edit) "shouldn't this return statement work inside the template? it should exit out of the next_token proc? ... https://media.discordapp.net/attachments/371759389889003532/1112421653297758279/image.png" added "doesn't seem to want to do it" |
16:48:07 | FromDiscord | <sOkam!> the enum is used to map a hardware limitation, and that's a known const |
16:48:14 | FromDiscord | <Rika> In reply to @guttural666 "shouldn't this return statement": what does it do instead/ |
16:49:54 | FromDiscord | <voidwalker> Oh mistery solved. I was echo-ing with that print lib, I forgot : D looks fine with echo |
16:49:55 | FromDiscord | <guttural666> endless looping 😄 |
16:50:15 | FromDiscord | <voidwalker> (edit) "mistery" => "mystery" |
16:50:18 | * | ntat joined #nim |
16:51:22 | FromDiscord | <guttural666> if a return statement works in principle in a template and there shouldn't be a problem with it, I could have a problem elsewhere |
16:52:31 | FromDiscord | <Graveflo> I think there is a pragma to limit the bit size of an enum. Besides that you could try using something like high() at compile time and throw an error. Maybe someone with more knowledge knows a better way |
16:53:14 | FromDiscord | <guttural666> I have a problem elsewhere |
16:53:51 | FromDiscord | <Rika> In reply to @guttural666 "I have a problem": classic |
17:01:21 | * | lucasta quit (Ping timeout: 265 seconds) |
17:03:06 | * | arkurious joined #nim |
17:13:12 | FromDiscord | <Graveflo> sent a code paste, see https://play.nim-lang.org/#ix=4wVX |
17:15:15 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4wVY |
17:18:47 | FromDiscord | <Graveflo> no idea, but if you find a simpler way lmk. If there isn't a pragma for it one can be made (i think). The only other thing ive personally seen if stuff like this for c compat `{.size: sizeof(cint).}` but that is for byte size restrictions I think |
17:19:14 | FromDiscord | <sOkam!> yep, that's bytesize of the enum. been using that for interop |
17:33:10 | FromDiscord | <acornes> does anyone know of a good scripting language for android? |
17:33:26 | FromDiscord | <acornes> searching it on google doesn't give a clear result |
18:08:28 | * | junaid_ quit (Remote host closed the connection) |
18:13:52 | * | derpydoo quit (Ping timeout: 248 seconds) |
18:35:11 | * | rockcavera quit (Ping timeout: 240 seconds) |
18:53:34 | * | rockcavera joined #nim |
19:09:12 | FromDiscord | <ShalokShalom> How did the tooling support change within the last months? |
19:09:17 | NimEventer | New thread by Araq: Atlas shrugged..., see https://forum.nim-lang.org/t/10234 |
19:10:15 | FromDiscord | <ShalokShalom> Does nimsuggest still eat all the resources from time to time? |
19:14:05 | FromDiscord | <ShalokShalom> Elegant: Did IC help with nimsuggest, as you hoped it will be? |
19:16:50 | FromDiscord | <jmgomez> Nim 2.0 hasn't being released, which according to the roadmap would happen before the work on IC. So nope, nothing has changed regarding to tooling yet |
19:21:43 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> What is more correct to use when accessing Json data?↵.str or getStr()↵.bool or getBool()↵etc |
19:22:04 | FromDiscord | <H̲A̲C̲K̲K̲E̲R̲> (edit) "Json" => "JsonNode" |
19:23:09 | FromDiscord | <ShalokShalom> @jmgomez thanks |
19:23:20 | FromDiscord | <ShalokShalom> what delays the release of 2.0? |
19:23:31 | FromDiscord | <ShalokShalom> I thought this was supposed to happen months ago? |
19:25:44 | FromDiscord | <jmgomez> There is from time to time a stopper that appears. I think there is only one or two left now |
19:28:48 | FromDiscord | <chmod222> Good to know |
19:28:48 | FromDiscord | <chmod222> Ah, so it's not only me who has had nimsuggest murder their desktop?↵(@ShalokShalom) |
19:36:52 | FromDiscord | <JJ> yeah, it's a known bug. quite sucks |
19:38:10 | FromDiscord | <chmod222> Well, it's not that bad since it only happens every few weeks |
19:38:17 | FromDiscord | <chmod222> for me at least |
19:38:27 | FromDiscord | <chmod222> Usually I can pkill -9 nimsuggest fast enough |
19:41:19 | * | lucasta joined #nim |
19:48:09 | FromDiscord | <jmgomez> Wait until you have all the bindings, you will see ;P |
19:48:38 | FromDiscord | <jmgomez> I mean, Im used to it. But it makes people go away from NimForUE every other day |
19:54:25 | FromDiscord | <ShalokShalom> A language with version number 2.0 and no proper editor support is weird. |
19:55:13 | FromDiscord | <jmgomez> ask haskell 😛 |
19:55:17 | * | krux02 joined #nim |
20:06:16 | FromDiscord | <Elegantbeef> The funny thing is thinking 2.0 means anything |
20:06:17 | FromDiscord | <Elegantbeef> It's semver that's it |
20:07:01 | FromDiscord | <Elegantbeef> All 2.x means is that there are breaking changes to code that runs in 1.x |
20:30:09 | * | lucasta quit (Ping timeout: 265 seconds) |
20:33:23 | * | ntat quit (Quit: Leaving) |
21:08:15 | FromDiscord | <JJ> i mean it is proper editor support just buggy editor support |
21:14:56 | * | derpydoo joined #nim |
21:25:26 | * | Notxor_ joined #nim |
21:25:40 | * | Notxor quit (Read error: Connection reset by peer) |
21:48:57 | * | Notxor_ quit (Remote host closed the connection) |
22:03:32 | FromDiscord | <chmod222> The only editor support I have ever needed from a language was syntax highlighting and maybe some error squigglies |
22:03:32 | FromDiscord | <chmod222> All you need is a magnetic needle and a steady hand |
22:03:57 | FromDiscord | <chmod222> I don't think C or C++ have proper support for and from.. anything really |
22:04:04 | FromDiscord | <chmod222> Somehow they still ended up everywhere |
22:21:36 | FromDiscord | <Graveflo> If C(++) did it right there would be no reason to be here |
22:33:34 | * | derpydoo quit (Quit: derpydoo) |
22:34:54 | FromDiscord | <JJ> sure c/c++ editor support is atrocious, those definitely shouldn't be a benchmark |
22:37:49 | FromDiscord | <JJ> i think rust-analyzer is a good ideal to strive to: but even though currently the langserver is far from that, it can currently report compilation issues inline, provide autocomplete, provide type inference. the big problem is that it's buggy and will crash and/or create orphan processes |
22:40:13 | FromDiscord | <jmgomez> I actually find jetbrains's C++ support really good |
22:57:55 | FromDiscord | <chmod222> Which one is the premier Nim editor support tool these days? nimlsp, langserver or going raw nimsuggest? |
22:58:03 | FromDiscord | <chmod222> I'm not up to speed |
23:16:34 | FromDiscord | <michaelb.eth> In reply to @chmod222 "I'm not up to": 90% of the time nimlangserver + emacs works well for me, but I did have to figure some things out re: project "mapping" |
23:34:18 | * | LuxuryMode joined #nim |