00:02:47 | * | mids joined #nim |
00:36:22 | * | smitop joined #nim |
00:37:37 | FromDiscord | <treeform> @disruptek So what want a deserializer that works like packedjson? Where it keeps the values pointing back at the string that was passed in? |
00:38:44 | disruptek | i will probably write something that just unboxes, but it will primarily be stream-based. |
00:38:59 | FromDiscord | <treeform> why stream based? |
00:39:19 | disruptek | because fragments are more typical of my workloads. |
00:39:45 | FromDiscord | <treeform> Like reading from network over TCP? |
00:40:42 | disruptek | or a file. |
00:41:00 | disruptek | y'know, a stream. 😉 |
00:41:23 | disruptek | i don't want to tear down my serializer and rebuild it constantly. |
00:41:32 | disruptek | i just want a window that moves along over the stream. |
00:42:09 | disruptek | i will have cps fetching into the queue... that sort of thing. |
01:03:22 | FromDiscord | <treeform> I am not longer fan of streams, as they incur 10-40% speed penalty over regular strings. |
01:04:56 | * | adnan449 joined #nim |
01:05:46 | adnan449 | Hello, is there any way I can automatically format all of my nim project from the project root directory? My VS Code is not formatting nim files on save |
01:06:13 | * | Jesin quit (*.net *.split) |
01:06:14 | * | synthmeat quit (*.net *.split) |
01:06:14 | * | WilhelmVonWeiner quit (*.net *.split) |
01:06:14 | * | notchris quit (*.net *.split) |
01:06:14 | * | screens_ quit (*.net *.split) |
01:06:14 | * | dgb quit (*.net *.split) |
01:06:14 | * | sepples quit (*.net *.split) |
01:06:14 | * | yumaikas quit (*.net *.split) |
01:06:14 | * | kaliy quit (*.net *.split) |
01:06:14 | * | disruptek quit (*.net *.split) |
01:07:20 | FromDiscord | <treeform> I made a tool for that called more pretty |
01:07:38 | FromDiscord | <treeform> it does some extra things I wanted: https://github.com/treeform/morepretty |
01:07:51 | FromDiscord | <treeform> just run that in your root directly it will walk and format all of the files. |
01:08:05 | FromDiscord | <treeform> make sure they are git-commited first |
01:09:33 | * | Jesin joined #nim |
01:09:33 | * | synthmeat joined #nim |
01:09:33 | * | WilhelmVonWeiner joined #nim |
01:09:33 | * | notchris joined #nim |
01:09:33 | * | sepples joined #nim |
01:09:33 | * | disruptek joined #nim |
01:09:33 | * | screens_ joined #nim |
01:09:33 | * | kaliy joined #nim |
01:09:33 | * | dgb joined #nim |
01:09:33 | * | yumaikas joined #nim |
01:10:10 | * | notchris quit (Ping timeout: 285 seconds) |
01:11:37 | * | dgb quit (Ping timeout: 264 seconds) |
01:11:45 | * | dgb joined #nim |
01:14:17 | * | notchris joined #nim |
01:26:47 | saem | adnan449: which vscode extension are you using? |
01:27:49 | adnan449 | saem, https://marketplace.visualstudio.com/items?itemName=kosz78.nim |
01:29:29 | saem | ah, the og ts one. nevermind don't maintain that one |
01:31:07 | FromDiscord | <Clyybber> saem btw timothee fixed the config order issue |
01:31:22 | saem | yay! |
01:33:45 | saem | Now just need a compiler param where you can pass in a per run config which can be located anywhere on the files system so tools can coordinate/reuse auto generated cfgs :D |
01:33:58 | saem | But that's later |
01:37:52 | saem | adnan449: for nimpretty that's going to be some command line work over each file or hook into git perhaps. In terms of the extension, give this one a shot to see if it works for you: https://github.com/saem/vscode-nim |
01:38:22 | FromDiscord | <shadow.> https://github.com/adafruit/Adafruit_BNO055/blob/master/examples/read_all_data/read_all_data.ino↵would this be ffi-able? never worked with ffi before. i know arduino is based on c++ but im not sure if i could ffi this api currently |
01:38:58 | FromDiscord | <ElegantBeef> You have seen the nim arduino bindings? |
01:39:29 | adnan449 | @treeform, organizing imports are really nice, if I am not mistaken, this is not in nimble repository. Why is that? |
01:40:44 | adnan449 | saem, ok this is actually working. Thank you. |
01:41:34 | saem | adnan449: lol, I wasn't quite sure if nimpretty integration broke or not, I don't use it as much as I perhaps should -- extension code is ugly |
01:41:46 | * | tsujp joined #nim |
01:41:57 | FromDiscord | <shadow.> i have not |
01:43:45 | FromDiscord | <ElegantBeef> Well here if you still havent https://github.com/zevv/nim-arduino |
01:43:50 | saem | @treeform that's pretty cool, if it was easily installed (eg: nimble or whatever) it could probably be a simple command in the extension. |
01:44:39 | FromDiscord | <ElegantBeef> it is easily installed |
01:44:55 | FromDiscord | <ElegantBeef> `nimble install https://github.com/treeform/morepretty` |
01:45:45 | saem | fair enough :thinking |
01:53:59 | FromDiscord | <shadow.> thanks beef |
01:54:51 | FromDiscord | <has1> hi |
01:55:01 | FromDiscord | <has1> is it possible to load c# class librarys with nim? |
01:55:54 | FromDiscord | <ElegantBeef> Nope, there is a project to convert C# to Nim in progress but not very usable atm, https://github.com/kobi2187/cs2nim |
02:06:18 | * | adnan449 quit (Remote host closed the connection) |
02:11:35 | * | mids quit (Quit: Connection closed for inactivity) |
02:14:34 | * | adnan338 joined #nim |
02:14:37 | * | adnan338 quit (Remote host closed the connection) |
02:14:41 | saem | fun, now to git bisect the compiler |
02:14:48 | * | adnan338 joined #nim |
02:15:30 | saem | well nimsuggest |
02:17:41 | * | abm quit (Quit: Leaving) |
02:33:21 | FromDiscord | <CodeHz> Use winim/clr |
02:33:50 | FromDiscord | <CodeHz> !repo winim |
02:33:51 | disbot | https://github.com/khchen/winim -- 9winim: 11Nim's Windows API and COM Library 15 198⭐ 14🍴 7& 1 more... |
02:34:22 | FromDiscord | <CodeHz> (edit) "winim/clr" => "[winim/clr](https://khchen.github.io/winim/clr.html)" |
02:35:14 | * | junland_ joined #nim |
02:36:11 | FromDiscord | <has1> oh wow |
02:36:13 | * | def-- joined #nim |
02:36:22 | FromDiscord | <has1> so i can use .net framework stuff via nim? |
02:36:28 | FromDiscord | <has1> this language is so impressive |
02:36:41 | * | screens__ joined #nim |
02:37:21 | FromDiscord | <flywind> see https://forum.nim-lang.org/t/7265#45978 |
02:37:24 | * | sknebel_ joined #nim |
02:37:44 | * | antranigv_ joined #nim |
02:39:01 | * | oculuxe joined #nim |
02:39:13 | * | WilhelmV1nWeiner joined #nim |
02:39:46 | * | kali_ joined #nim |
02:40:36 | FromDiscord | <has1> can you explain what i am looking at? |
02:42:50 | FromDiscord | <has1> https://khchen.github.io/winim/clr.html |
02:42:57 | FromDiscord | <has1> wait what, i can compile stuff and execute it? |
02:43:00 | * | sepples_ joined #nim |
02:43:16 | * | tsujp1 joined #nim |
02:43:18 | FromDiscord | <has1> so why cant i just load a c# dll this way? |
02:43:40 | * | literal_ joined #nim |
02:43:52 | * | Zevv quit (*.net *.split) |
02:43:52 | * | junland quit (*.net *.split) |
02:43:52 | * | def- quit (*.net *.split) |
02:43:52 | * | oculux quit (*.net *.split) |
02:43:52 | * | antranigv quit (*.net *.split) |
02:43:52 | * | so quit (*.net *.split) |
02:43:52 | * | literal quit (*.net *.split) |
02:43:52 | * | sknebel quit (*.net *.split) |
02:43:53 | * | tsujp quit (*.net *.split) |
02:43:53 | * | Jesin quit (*.net *.split) |
02:43:53 | * | synthmeat quit (*.net *.split) |
02:43:53 | * | WilhelmVonWeiner quit (*.net *.split) |
02:43:53 | * | screens_ quit (*.net *.split) |
02:43:53 | * | sepples quit (*.net *.split) |
02:43:53 | * | yumaikas quit (*.net *.split) |
02:43:53 | * | kaliy quit (*.net *.split) |
02:43:53 | * | disruptek quit (*.net *.split) |
02:43:53 | * | Zevv_ joined #nim |
02:43:54 | * | def-- is now known as def- |
02:44:02 | * | disrupteq joined #nim |
02:44:24 | * | synthmeat joined #nim |
02:44:36 | * | disrupteq is now known as disruptek |
02:51:06 | * | yumaikas joined #nim |
02:52:43 | FromDiscord | <has1> @flywind |
02:55:51 | FromDiscord | <has1> i installed nim by running "finish.exe" |
02:55:58 | FromDiscord | <has1> but still, nim help returns binary not found |
02:56:11 | FromDiscord | <has1> do i need to restart my pc for it to work? |
02:56:28 | FromDiscord | <has1> opening a new cmd did not work |
02:56:58 | FromDiscord | <flywind> What's your OS? |
02:57:28 | FromDiscord | <flywind> Maybe you should check whether bin/nim in your env. |
02:57:51 | FromDiscord | <has1> windows |
02:58:19 | FromDiscord | <has1> yes its in my path |
02:58:38 | FromDiscord | <flywind> maybe restart your computer? |
02:58:41 | FromDiscord | <has1> :/ |
02:59:33 | * | so joined #nim |
03:10:22 | FromDiscord | <has1> alright, so it works after the restart |
03:10:23 | FromDiscord | <has1> weird |
03:10:43 | FromDiscord | <ElegantBeef> Windows doesnt like updating path until restarts |
03:12:46 | FromDiscord | <has1> https://khchen.github.io/winim/clr.html |
03:12:50 | FromDiscord | <has1> i looked at those examples |
03:12:54 | FromDiscord | <has1> but there are no imports |
03:13:06 | FromDiscord | <has1> why didnt they include the imports needed to run this example? |
03:17:01 | disruptek | that would be too easy. |
03:20:40 | FromDiscord | <has1> i suppose, yes |
03:20:45 | FromDiscord | <has1> i didnt know its just↵import winim/clr |
03:20:59 | FromDiscord | <has1> I hate it when people dont make their examples work |
03:22:22 | FromDiscord | <has1> it was also pretty confusing because i tried to autocomplete the import to winim/clr but typing c didnt autocomplete to clr, it suggested other names, but not that one |
03:22:29 | FromDiscord | <has1> so i thought i couldnt import that |
03:25:24 | saem | hmm, guess I won't be bisecting nimsuggest. |
03:35:12 | * | Gustavo6046 quit (Ping timeout: 260 seconds) |
03:37:03 | * | Gustavo6046 joined #nim |
03:41:23 | * | leorize quit (Ping timeout: 240 seconds) |
03:43:41 | * | leorize joined #nim |
03:44:01 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
03:48:45 | * | Gustavo6046 joined #nim |
03:49:19 | * | muffindrake quit (Ping timeout: 272 seconds) |
03:51:17 | * | muffindrake joined #nim |
03:51:36 | FromDiscord | <CodeHz> nope, it should refresh after you restart cmd from shell(explorer) |
03:56:58 | FromDiscord | <Cohjellah> That's the idea with websites then hey. No need for dependencies, just plug in the URL - but do you actually need to download QT to open a nimQML program? Seems silly |
04:00:06 | * | leorize quit (Remote host closed the connection) |
04:00:39 | * | leorize joined #nim |
04:05:25 | * | smitop quit (Quit: Connection closed for inactivity) |
04:10:34 | * | adnan338 quit (Quit: adnan338) |
04:29:19 | FromDiscord | <Avatarfighter> @Cohjellah if you need an example that uses nimQML status is working on their desktop client in nimQML iirc |
04:29:44 | FromDiscord | <Avatarfighter> https://github.com/status-im/nim-status-client |
04:29:59 | * | adnan338 joined #nim |
04:30:07 | * | adnan338 quit (Client Quit) |
04:30:17 | * | adnan338 joined #nim |
04:30:45 | FromDiscord | <Avatarfighter> no idea what the context of the conversation was but this was cool lol |
04:33:41 | * | adnan338 quit (Remote host closed the connection) |
04:33:42 | * | Jesin joined #nim |
04:33:59 | * | spiderstew joined #nim |
04:35:01 | * | spiderstew_ quit (Ping timeout: 268 seconds) |
04:38:34 | FromDiscord | <treeform> @saem, i should add it to nimble, I probably just forgot. |
04:42:25 | saem | It's a handy format all/format project. Easy enough to detect it on the path and expose a command. |
04:46:29 | FromDiscord | <has1> @ElegantBeef why did you say its not possible? |
04:46:47 | FromDiscord | <ElegantBeef> Cause i dont touch windows so didnt expect windows to support it |
04:46:50 | * | Cadey quit (Ping timeout: 264 seconds) |
04:46:57 | FromDiscord | <has1> it does work |
04:47:04 | FromDiscord | <ElegantBeef> Ok sorry |
04:47:05 | FromDiscord | <has1> you can do it with the winim lib |
04:47:55 | FromDiscord | <has1> if a noob that never touched nim can figure it out in 3 hours, maybe dont jump in too quickly and say its impossible xd |
04:47:57 | * | disruptek ponders winning benchmarks. |
04:48:00 | disruptek | it's pretty pointless. |
04:48:32 | FromDiscord | <has1> i am very impressed by nim, this language is something special |
04:48:40 | FromDiscord | <ElegantBeef> > This module add Windows Common Language Runtime (CLR) support to Winim. So that we can use Nim to interact with Windows .NET frameworks.↵Windows .Net, so no doesnt work here |
04:49:16 | FromDiscord | <has1> my question was if i can load a dll file in nim |
04:49:18 | FromDiscord | <has1> and you can |
04:49:25 | FromDiscord | <ElegantBeef> Ok |
04:49:31 | FromDiscord | <ElegantBeef> No reason to be so hostile for no reason |
04:49:37 | FromDiscord | <has1> how am i being hostile? |
04:49:49 | FromDiscord | <ElegantBeef> > if a noob that never touched nim can figure it out in 3 hours, maybe dont jump in too quickly and say its impossible xd↵Read as hostile to me |
04:50:28 | FromDiscord | <has1> its not hostile at all. I was just suggesting that you should probably not jump in and say stuff with absolute certainty if you dont know for sure |
04:50:56 | disruptek | i will make a faster string freeze/thaw but i don't think i will change my stream r/w. |
04:51:48 | disruptek | i don't think streaming data a little faster will help any of my code. |
04:52:16 | FromDiscord | <Avatarfighter> @has1 we just try and share our knowledge, elegantbeef thought it was certainly not possible |
04:54:05 | FromDiscord | <Rika> it may not be hostile but you cant tell me that's supposed to be friendly |
04:54:14 | * | a_chou joined #nim |
04:54:15 | disruptek | it's funny that we've somehow curve-fit to our respective benchmarks. |
04:54:34 | FromDiscord | <Avatarfighter> disruptek: i have no idea what you're saying rn what is the context |
04:54:42 | FromDiscord | <Avatarfighter> what are you benchmarking |
04:54:48 | FromDiscord | <Avatarfighter> your massive testes ? |
04:54:54 | FromDiscord | <Avatarfighter> (edit) "your massive ... testes" added "library, " |
04:55:47 | FromDiscord | <has1> lets just say we were all surprised by nims capabilities |
04:59:42 | FromDiscord | <Avatarfighter> disruptek: treeform im guessing based off of the benchmarking |
05:09:20 | disruptek | flatty has feature parity to frosty so now we are competing on speed. |
05:11:53 | disruptek | i need to break frosty anyway, so it's a good time to update it. |
05:13:48 | disruptek | yeah. |
05:14:34 | disruptek | also, he found a bug. |
05:14:57 | disruptek | not sure i'll bother fixing it, but maybe while i'm in there... |
05:15:19 | disruptek | it's like, why should i support "freeze(x).thaw(y)"? |
05:27:38 | * | Gustavo6046 quit (Ping timeout: 264 seconds) |
05:29:30 | FromDiscord | <has1> what is the recommended ide for nim? |
05:29:43 | FromDiscord | <has1> the vs code plugin doesnt seem very helpful |
05:30:00 | FromDiscord | <Rika> vscode or neovim |
05:31:42 | FromDiscord | <has1> definitely not going for vim |
05:39:13 | * | a_chou quit (Quit: a_chou) |
05:39:16 | FromDiscord | <Rika> the neovim plugin is better than the vscode one 🙂 |
05:39:29 | FromDiscord | <Rika> anyway yeah those are the ones i know most people use |
05:39:34 | FromDiscord | <Rika> i hear theres an emacs one |
05:41:13 | FromDiscord | <has1> is there nothing from jetbrains? |
05:41:31 | FromDiscord | <has1> oh i think there does seem to be |
05:41:36 | FromDiscord | <Rika> its in its infancy |
05:41:46 | FromDiscord | <Rika> right now i think its worse than the vs code one |
05:44:15 | * | xet7 joined #nim |
05:50:31 | disruptek | rude. |
05:54:11 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:57:40 | * | NimBot joined #nim |
06:00:21 | FromDiscord | <ElegantBeef> Saem's is improving it quite a bit, but yea some issues |
06:05:45 | disruptek | it's so funny, frosty's writes are always slower and my reads are always faster. |
06:26:05 | * | Xe joined #nim |
06:32:17 | disruptek | lqdev: what kinda endian shit do you want frosty to do for you? |
06:38:04 | * | Xe quit (Quit: WeeChat 2.9) |
06:40:33 | * | Xe joined #nim |
06:44:53 | * | Xe is now known as Cadey |
07:20:08 | saem | @Prestige you might be referring to this one as the "good" one, I mean I've updated it more so that's a form of good? https://github.com/saem/vscode-nim (relevant links to marketplace and ovsx therein) |
07:31:05 | Prestige | Might be, I don't use vscode but I've heard there was a "good" nim plugin |
07:32:48 | Prestige | I'm using neovim with nimlsp, but it doesn't seem to detect changes in other files |
07:33:52 | saem | Yeah, it depends if the LSP launches with refresh or not, can't remember. Also if there isn't a watcher sending mod events it won't work out well. |
07:34:57 | * | Zevv_ is now known as Zevv |
07:35:13 | * | Zevv quit (Changing host) |
07:35:14 | * | Zevv joined #nim |
07:36:23 | * | leorize quit (Ping timeout: 240 seconds) |
07:39:13 | FromDiscord | <has1> hi, i dont really understand the nim docs |
07:39:23 | FromDiscord | <has1> how would i make a http request and include headers in the request? |
07:39:30 | FromDiscord | <has1> https://nim-lang.org/docs/httpclient.html |
07:40:05 | FromDiscord | <has1> do i just run client.request ? |
07:40:09 | FromDiscord | <has1> and pass in all data there? |
07:40:14 | FromDiscord | <ElegantBeef> The last one here shows how to use headers https://nim-lang.org/docs/httpclient.html#using-http-post |
07:40:23 | * | leorize joined #nim |
07:40:55 | FromDiscord | <has1> oh, true. I searched for headers and for some reason ended up at the end of the docs |
07:40:59 | FromDiscord | <has1> at the request proc |
07:41:30 | FromDiscord | <has1> it actually does not sound that bad to have 1 method that does everything |
07:41:35 | FromDiscord | <has1> because you can pass in arguments by name |
07:43:23 | disruptek | proc assignParam*(p: BProc, s: PSym; ret: PType) = ## i have nothing good to say about this proc |
07:43:33 | disruptek | hehe |
07:43:43 | saem | LoL |
07:44:13 | saem | Oh man, symbol lookup works, I'm so happy |
07:44:36 | FromDiscord | <has1> man, the ide support really sucks |
07:44:54 | saem | If found that in an instant -- sorry little wins, it's been way easier navigating thanks to it, but it totally farts up in sem* because includes. |
07:47:29 | Prestige | what are you using has1? |
07:48:08 | FromDiscord | <has1> vs code |
07:48:16 | FromDiscord | <Rika> What plug-in |
07:48:22 | FromDiscord | <Rika> There are 3 I think |
07:48:28 | FromDiscord | <has1> the most popular one |
07:48:41 | FromDiscord | <ElegantBeef> Well i suggest saem's with tabnine |
07:48:42 | FromDiscord | <has1> by Konstantin Zaitsev |
07:49:25 | FromDiscord | <has1> by nimsaem? |
07:49:28 | FromDiscord | <ElegantBeef> Yea |
07:49:31 | FromDiscord | <has1> the one with 500 downloads? |
07:49:40 | FromDiscord | <ElegantBeef> Yes |
07:50:13 | FromDiscord | <has1> i mean, cant be worse than what i have |
07:50:42 | FromDiscord | <has1> what is the type of a normal array in nim? |
07:50:46 | FromDiscord | <ElegantBeef> array |
07:50:50 | FromDiscord | <has1> openArray[T] ? |
07:50:53 | FromDiscord | <ElegantBeef> Nope |
07:50:54 | FromDiscord | <ElegantBeef> Array |
07:50:59 | FromDiscord | <ElegantBeef> `array[size,T]` |
07:51:20 | FromDiscord | <ElegantBeef> `seq[T]` is a dynamically allocated/sized array |
07:51:30 | FromDiscord | <has1> i have json |
07:51:40 | FromDiscord | <has1> with an array of items |
07:51:42 | FromDiscord | <ElegantBeef> openArray is an abstraction of both of those, and it's a view type |
07:51:45 | FromDiscord | <has1> how would i declare that? |
07:51:47 | FromDiscord | <ElegantBeef> That'd be a Jarray |
07:51:59 | FromDiscord | <Rika> JsonNode with a kind of JArray |
07:52:01 | FromDiscord | <ElegantBeef> So it'd be a `JsonNode(kind: JArray)` |
07:52:06 | FromDiscord | <has1> wat |
07:52:10 | FromDiscord | <has1> as the type definition? |
07:52:12 | FromDiscord | <ElegantBeef> Object variant |
07:52:14 | FromDiscord | <Rika> No |
07:52:16 | FromDiscord | <has1> I want to parse it into my object |
07:52:17 | FromDiscord | <ElegantBeef> So it's a JsonNode |
07:52:18 | FromDiscord | <Rika> That’s the declaration |
07:52:30 | FromDiscord | <Rika> Type is just JsonNode |
07:52:36 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/json.html#JsonNode |
07:52:41 | * | Manny8888 joined #nim |
07:52:42 | FromDiscord | <has1> can you just tell me the type i need to use |
07:52:49 | FromDiscord | <ElegantBeef> We did |
07:52:52 | FromDiscord | <has1> to parse it into my json object |
07:53:04 | FromDiscord | <Rika> JsonNode |
07:53:14 | FromDiscord | <Rika> Or what do you mean |
07:53:22 | FromDiscord | <Rika> We don’t understand you |
07:53:28 | FromDiscord | <ElegantBeef> Showing us what you want is better than dancing around |
07:53:56 | FromDiscord | <has1> sent a long message, see http://ix.io/2KGC |
07:54:11 | FromDiscord | <ElegantBeef> No |
07:54:28 | FromDiscord | <ElegantBeef> What're you trying to do |
07:54:49 | FromDiscord | <has1> let userResponse = to(userJson, Response ) |
07:55:00 | FromDiscord | <has1> i just have an array of users |
07:55:01 | FromDiscord | <ElegantBeef> What is `userjson` |
07:55:09 | FromDiscord | <has1> its json |
07:55:11 | FromDiscord | <has1> from the server |
07:55:18 | FromDiscord | <has1> i have an array |
07:55:19 | FromDiscord | <has1> of users |
07:55:20 | FromDiscord | <has1> dude |
07:55:22 | FromDiscord | <Rika> How do you parse it |
07:55:28 | FromDiscord | <Rika> How is it declared |
07:55:39 | FromDiscord | <ElegantBeef> So then it'd be a `seq[User]` |
07:55:44 | FromDiscord | <has1> this doesnt work? |
07:55:46 | FromDiscord | <has1> sent a long message, see http://ix.io/2KGD |
07:55:46 | FromDiscord | <Rika> Declared |
07:55:46 | FromDiscord | <has1> the array? |
07:55:48 | FromDiscord | <Rika> No |
07:55:50 | FromDiscord | <Rika> Wait |
07:55:51 | FromDiscord | <Rika> No |
07:55:57 | FromDiscord | <Rika> You use a seq for that |
07:55:59 | FromDiscord | <has1> ok what is the array type |
07:56:03 | FromDiscord | <has1> seq? |
07:56:03 | FromDiscord | <has1> ok |
07:56:04 | FromDiscord | <Rika> Constant size |
07:56:04 | FromDiscord | <ElegantBeef> A static array |
07:56:10 | FromDiscord | <ElegantBeef> Compile time sized arrays |
07:56:15 | FromDiscord | <ElegantBeef> Stack allocated |
07:56:42 | FromDiscord | <has1> no generic type param allowed |
07:56:49 | FromDiscord | <has1> so not ↵seq[User] either |
07:57:03 | FromDiscord | <Rika> What? |
07:57:10 | FromDiscord | <Rika> Give us the full error message |
07:57:13 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2KGE |
07:57:15 | FromDiscord | <ElegantBeef> It clearly works |
07:57:15 | FromDiscord | <Rika> You might be misunderstanding it |
07:57:25 | FromDiscord | <ElegantBeef> Without the json data we cannot help you with a solution, we dont know how it's aligned |
07:58:21 | FromDiscord | <has1> do i need to import something |
07:58:24 | FromDiscord | <has1> to use seq? |
07:58:28 | FromDiscord | <ElegantBeef> I just proved you didnt |
07:58:33 | FromDiscord | <Rika> No |
07:58:37 | FromDiscord | <Rika> You do not |
07:59:21 | FromDiscord | <ElegantBeef> Give us the json and we can show you how to parse it and explain what you need to do |
08:00:07 | saem | has1: Is this what you want? https://play.nim-lang.org/ |
08:00:16 | FromDiscord | <ElegantBeef> nice link 😄 |
08:00:22 | saem | whoops, sorry |
08:00:27 | saem | https://play.nim-lang.org/#ix=2KGF |
08:00:46 | FromDiscord | <has1> yes |
08:01:13 | saem | has1 great... try starting with a playground next time it's easier to answer questions. |
08:03:06 | FromDiscord | <has1> well, i did post the exact same code there, those 4 lines above |
08:03:36 | FromDiscord | <ElegantBeef> You never showed the json data so we were left to assuming what you were attempting to parse from |
08:03:46 | saem | This is the example in the manual in regards to unmarshalling in general: https://nim-lang.org/docs/json.html#overview-unmarshalling |
08:04:31 | FromDiscord | <has1> sent a code paste, see https://play.nim-lang.org/#ix=2KGH |
08:05:12 | FromDiscord | <has1> i am looking at the docs and it returns a Future AsyncResponse |
08:05:24 | FromDiscord | <has1> and that should have a body: string |
08:06:53 | saem | I don't know the async stuff all that well. :( |
08:06:54 | FromDiscord | <ElegantBeef> Your compiler provides an error message |
08:07:40 | FromDiscord | <has1> the error message was very unclear to me |
08:07:50 | * | narimiran joined #nim |
08:07:59 | FromDiscord | <Rika> Response body is a sync |
08:08:02 | FromDiscord | <Rika> Async |
08:08:04 | FromDiscord | <has1> So i have to await it too? |
08:08:05 | FromDiscord | <Rika> You have to await it |
08:08:07 | FromDiscord | <Rika> Yes |
08:08:11 | FromDiscord | <has1> where does it say that it is async? |
08:08:20 | FromDiscord | <Rika> If the type is a Future |
08:08:23 | FromDiscord | <has1> Shouldnt it be body: Future<string>? |
08:08:29 | FromDiscord | <Rika> It is |
08:08:31 | FromDiscord | <has1> but i am already awaiting the response |
08:08:32 | FromDiscord | <Rika> Is it not? |
08:08:34 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/httpclient.html#body%2CAsyncResponse |
08:08:44 | FromDiscord | <has1> https://nim-lang.org/docs/httpclient.html#AsyncResponse |
08:08:46 | FromDiscord | <has1> that is so confusing |
08:08:54 | FromDiscord | <ElegantBeef> If you notice the `body` in the AsyncResponse doesnt have an export marker |
08:08:54 | FromDiscord | <has1> i was looking at the AsyncResponse |
08:08:54 | FromDiscord | <has1> with body: string |
08:08:59 | FromDiscord | <ElegantBeef> Yes and that's not exported |
08:09:07 | FromDiscord | <ElegantBeef> the proc is exported |
08:09:10 | FromDiscord | <Rika> Why do we show that.... |
08:09:15 | Prestige | ^ |
08:09:20 | FromDiscord | <has1> means exported? |
08:09:23 | FromDiscord | <ElegantBeef> Yes |
08:09:23 | FromDiscord | <Rika> If it isn’t exported why is it shown |
08:09:24 | FromDiscord | <Rika> Yes |
08:09:34 | FromDiscord | <has1> So i am actually calling a body proc? |
08:09:37 | FromDiscord | <Rika> Yes |
08:09:38 | FromDiscord | <ElegantBeef> Yes |
08:09:41 | FromDiscord | <has1> well damn |
08:09:45 | FromDiscord | <has1> see |
08:09:46 | FromDiscord | <Rika> But it’s the fault of the docs IMO |
08:09:47 | FromDiscord | <has1> if i had an ide |
08:09:49 | FromDiscord | <ElegantBeef> Which your compiler would've told you about |
08:09:51 | FromDiscord | <has1> this might be clearer |
08:09:59 | FromDiscord | <ElegantBeef> I mean your compiler said as much |
08:10:03 | FromDiscord | <Rika> The compiler should be telling you about it |
08:10:10 | FromDiscord | <has1> my compiler had like 20 lines |
08:10:14 | FromDiscord | <ElegantBeef> `type mismatch got <Future[string]>: expected` |
08:10:15 | FromDiscord | <ElegantBeef> Yes |
08:10:16 | FromDiscord | <has1> and it was definitely about a future |
08:10:16 | FromDiscord | <has1> but |
08:10:17 | FromDiscord | <Rika> An IDE would likely depend on the compiler |
08:10:18 | FromDiscord | <ElegantBeef> Type mismatch |
08:10:27 | FromDiscord | <ElegantBeef> I mean i dont disagree type mismatch is a shitty message |
08:10:30 | FromDiscord | <Rika> So there wouldn’t be much difference |
08:10:31 | FromDiscord | <ElegantBeef> I have a PR in waiting to resolve it |
08:10:44 | FromDiscord | <has1> I did get such a message. But when looking at the docs i just saw body: string.↵↵So you can see how that was confusing |
08:10:47 | disruptek | shit it's late. |
08:10:48 | disruptek | zevv: get to work. |
08:11:15 | FromDiscord | <ElegantBeef> Whenever this gets merged it'll make type mismatches so much less obnoxious https://media.discordapp.net/attachments/371759389889003532/795202600478703626/102961120-c5dd4180-44a0-11eb-97eb-f0054176aee6.png |
08:12:14 | FromDiscord | <Rika> I still think it looks awful |
08:12:19 | FromDiscord | <ElegantBeef> But eitherway most of the time the error messages produced by the compiler are helpful and point to the issue, although unreadable as hell |
08:12:23 | FromDiscord | <ElegantBeef> Why does it look awful? |
08:12:27 | FromDiscord | <Rika> Especially that I don’t exactly look at colored items more |
08:12:38 | FromDiscord | <Rika> Too many procs shown |
08:12:41 | FromDiscord | <ElegantBeef> My next thing will be adding `\n` after each mismatch |
08:12:48 | FromDiscord | <ElegantBeef> so then there is less of a block message |
08:12:51 | FromDiscord | <ElegantBeef> But that's in a another PR |
08:13:21 | FromDiscord | <Rika> The error message is too far to the right |
08:13:24 | FromDiscord | <ElegantBeef> Well it shows all mismatches and only hides them after X number, which i believe can be configured |
08:13:56 | FromDiscord | <ElegantBeef> I mean help me work on the error messages then 😄 |
08:14:04 | FromGitter | <gogolxdong> Is there anyone working on Gossip pub/sub library? |
08:14:50 | FromDiscord | <Rika> I’ll consider it |
08:15:02 | FromDiscord | <Rika> I mean that to beef by the way irc people |
08:16:34 | FromDiscord | <ElegantBeef> The biggest issue to new people are the error messages are rather hard to read/undescript, like someone had an issue with an immutable seq and it wasnt very clear that it was due to that immutable until you look at that large mismatch error |
08:17:00 | FromDiscord | <ElegantBeef> A nice "At least one of the mismatches is due to an immutable" on a single line would save brain cells |
08:19:06 | FromDiscord | <has1> does nim support the language server protocol? |
08:19:10 | FromDiscord | <ElegantBeef> Yep |
08:19:18 | FromDiscord | <ElegantBeef> `nimble install nimlsp` |
08:19:21 | FromDiscord | <has1> why is the edit support still so bad then though? |
08:19:24 | FromDiscord | <ElegantBeef> There is also a vscode extension that uses it |
08:20:10 | FromDiscord | <has1> i really like nim, but not having good IDE support is really a bad experience |
08:20:10 | FromDiscord | <ElegantBeef> Cause tooling hasnt been the prime target for development |
08:20:30 | FromDiscord | <ElegantBeef> But it seems like 2021 that's going to become a target |
08:21:17 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/RFCs/issues/300 |
08:21:18 | disbot | ➥ Developer tooling |
08:22:01 | FromDiscord | <19> i dont think it's that bad. i mean sure it can be better but all you need saem's vscode extension and hook it with lldb / gdb debugger. |
08:22:44 | FromDiscord | <19> at least thats what works for me 🤷♂️ |
08:23:06 | FromDiscord | <ElegantBeef> Yea saem's making good strides in making a better extension |
08:24:19 | FromDiscord | <ElegantBeef> They already know things like highlight needs to be worked on aswell, `a.field.int.float` should be highlighted based off the sym types and not just the regex expression captures 😄 |
08:24:23 | FromDiscord | <19> yes and most of the time u dont even need a debugger. you just need to get used to the red squiglies messages |
08:24:33 | FromDiscord | <ElegantBeef> The compiler is the best debugger 😛 |
08:25:08 | FromDiscord | <ElegantBeef> When talking about compilation errors, for actual debugging i rarely need a breakpoint debugger |
08:27:30 | FromDiscord | <19> yeah i only need debugger if im doing some stupid "shoot yourself in the foot" pointer manipulation |
08:28:12 | FromDiscord | <19> otherwise, compiler errors and stack traces are all you really care about |
08:29:18 | FromDiscord | <19> i wonder if hot code reloading + arc/orc compatibility is fixed. i had some crashes with HCR and Arc/Orc |
08:31:16 | kinkinkijkin | anyone here know OOP well? i need to know the name of an OO memory concept i just added to my game engine |
08:33:09 | FromDiscord | <ElegantBeef> Best to just describe it 😛 |
08:34:15 | kinkinkijkin | there's two trees of types in my type heirarchy: one called "Extensions" and the other called "Extensibles". the "Extensions" are classes that can be arbitrarily added to any "Extensible" which add extra functionality without going linearly through a type tree and needing to duplicate types to get needed features through |
08:35:59 | FromDiscord | <ElegantBeef> So composition |
08:36:33 | FromDiscord | <ElegantBeef> Sounds similar to the Unity entity component system where all logic is inside components and all entities are a list of components |
08:37:27 | kinkinkijkin | every "Extensible" has at least one optional reference to an "Extension", and every "Extension" and kind of "Extension" has standard methods to be activated arbitrarily (without knowing the specific type), along with unique methods to be used knowing the type |
08:37:35 | kinkinkijkin | sounds familiar |
08:38:00 | FromDiscord | <ElegantBeef> Also sounds similar to interfaces |
08:38:29 | FromDiscord | <ElegantBeef> But overall it's composition based OOP, which is the proper way to do OOP imo 😄 |
08:38:48 | kinkinkijkin | there's also a majour type of "Extension" called "ExtWithPass", which is just an extension with an additional standard method that provides the parent "Extensible"'s member items |
08:39:24 | kinkinkijkin | okay, good, i don't know OOP very well and was hoping i didn't just make something |
08:43:10 | saem | I mean if you need that level of dynamism sure. Most things are pushed into runtime so it's harder to reason about but that might be necessary. |
08:47:07 | kinkinkijkin | the idea is that my engine is made to be data-efficient, and make data-efficient programming easy to write, and this is just part of my overall plan for how to implement modular, data efficient code in a way that's more intuitive than purely linear trees |
08:48:29 | kinkinkijkin | next is writing in avenues of using this easily, then after that ways of using it to extend the engine in an extremely easy manner |
08:49:15 | FromDiscord | <ElegantBeef> Game engine? Have you looked into ECS? |
08:50:29 | kinkinkijkin | yeah, this is kinda mixing that with the more traditional inheritance that i know well |
08:51:02 | FromDiscord | <ElegantBeef> Really if you're doing OOP based you cannot do much better than the Godot/Unity EC way |
08:51:28 | kinkinkijkin | I've worked with godot, it's quite different from unity... |
08:51:36 | FromDiscord | <ElegantBeef> It's the same |
08:51:41 | FromDiscord | <ElegantBeef> Nodes would be components |
08:51:55 | FromDiscord | <ElegantBeef> It's just done in a better manner |
08:51:59 | kinkinkijkin | I'm coming from extremely basic OOP in C# and primarily functional stuff in audio |
08:52:16 | FromDiscord | <ElegantBeef> Aiming for a 3D or 2D engine? |
08:52:49 | FromDiscord | <ElegantBeef> Also no clue if you know but #nim-gamedev exists 😄 |
08:52:52 | kinkinkijkin | both |
08:52:53 | kinkinkijkin | i do know |
08:53:08 | FromDiscord | <ElegantBeef> Oh cool, you have my intrigue |
08:53:17 | FromDiscord | <ElegantBeef> Source code open? |
08:53:25 | kinkinkijkin | yep |
08:53:28 | kinkinkijkin | MIT |
08:53:42 | kinkinkijkin | being written as a library |
08:54:05 | FromDiscord | <ElegantBeef> Are you going for a framework, or a full on editor + engine? |
08:54:21 | FromDiscord | <ElegantBeef> Anywho link? |
08:54:33 | kinkinkijkin | the render side is really, really naively done since im trying to juggle 3 graphics apis while keeping from being hard-on-pure 3d or 2d |
08:54:45 | kinkinkijkin | lemme push my new changes then ill link |
08:55:18 | FromDiscord | <ElegantBeef> Manually using metal,vk, and dx, seems like bgfx would save you a few headaches |
08:56:35 | kinkinkijkin | im using gles2, gles3, and gl2.1 lol |
08:57:05 | FromDiscord | <ElegantBeef> Oh |
08:57:14 | kinkinkijkin | https://github.com/kinkinkijkin/brutelyEngine |
08:57:42 | kinkinkijkin | the issue is that i've just started writing this and didn't have access to gles3-capable hardware for a while, after already writing it all in gles3 |
08:59:37 | FromDiscord | <ElegantBeef> Didnt answer if you were aiming for an editor + engine or just more frameworky |
09:00:10 | kinkinkijkin | just frameworky |
09:00:23 | FromDiscord | <ElegantBeef> Want some code critique? 😄 |
09:00:30 | kinkinkijkin | oh |
09:01:11 | kinkinkijkin | go ahead |
09:01:29 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2KGW |
09:01:31 | FromDiscord | <ElegantBeef> I see a lot of `var`s 😄 |
09:01:47 | kinkinkijkin | it's a jumble from me finding some stuff on OOP code quality suddenly after writing most of what's there so far |
09:02:11 | kinkinkijkin | im aware of this |
09:03:56 | FromDiscord | <ElegantBeef> Also your objloader file is just a mess of bad formatting 😄 |
09:04:35 | kinkinkijkin | yep |
09:04:42 | kinkinkijkin | i wrote that a while ago |
09:04:46 | kinkinkijkin | a whiiiiile ago |
09:04:51 | FromDiscord | <ElegantBeef> Ah |
09:05:03 | kinkinkijkin | just copied it over, been meaning to get rid of it completely, the ply loader is meant to replace it |
09:05:24 | kinkinkijkin | but the ply loader isn't functional yet |
09:05:31 | FromDiscord | <has1> wait |
09:05:36 | FromDiscord | <has1> why is there just body: string |
09:05:45 | FromDiscord | <has1> shouldnt there also be a "byte" version? |
09:05:55 | FromDiscord | <ElegantBeef> Strings are byte sequences |
09:06:21 | kinkinkijkin | if you're talking about the shader compilation |
09:06:30 | kinkinkijkin | look at datahelpers.nim |
09:06:40 | kinkinkijkin | look at what the CSARRAY procs do |
09:06:58 | FromDiscord | <ElegantBeef> I was responding has1's question |
09:07:04 | kinkinkijkin | (it's very gross and i hate that it had to be done like that but gles3 is grody) |
09:07:06 | kinkinkijkin | i was too |
09:07:24 | FromDiscord | <ElegantBeef> They're talking about asyncresponse |
09:07:28 | kinkinkijkin | oooooooh |
09:07:33 | FromDiscord | <ElegantBeef> Lol |
09:07:33 | kinkinkijkin | okay i shut up |
09:07:47 | FromDiscord | <ElegantBeef> That code is old aswell i take iit |
09:07:52 | kinkinkijkin | yes |
09:07:59 | FromDiscord | <ElegantBeef> Seeing `inseq.len - 1` instead of `inseq.high` |
09:08:08 | kinkinkijkin | ... .high is a thing? |
09:08:11 | FromDiscord | <ElegantBeef> yep |
09:08:25 | FromDiscord | <ElegantBeef> we also have `for i, x in inseq` where i would be index and x is element |
09:08:34 | kinkinkijkin | ive been writing nim since 0.12 ish btw, on and off |
09:08:44 | FromDiscord | <ElegantBeef> so you body would be `outUCA[i] = x` |
09:08:52 | FromDiscord | <ElegantBeef> Ah |
09:09:06 | FromDiscord | <ElegantBeef> Sorry if i'm redundant then 😄 |
09:09:35 | kinkinkijkin | nono, ive had my programming learning stunted by starting out with turing and processing |
09:09:45 | kinkinkijkin | and then moving to c# and pure ARM asm |
09:09:47 | FromDiscord | <has1> So how do i conver it |
09:09:53 | FromDiscord | <has1> (edit) "conver" => "convert" |
09:09:58 | FromDiscord | <has1> from string to byte |
09:11:27 | FromDiscord | <ElegantBeef> What do you need to convert it for? |
09:12:08 | FromDiscord | <ElegantBeef> Either way this is the easiest way https://play.nim-lang.org/#ix=2KGZ |
09:12:49 | FromDiscord | <ElegantBeef> But if you're just going to be saving it, leaving it as a string is identical in the end result |
09:13:17 | FromDiscord | <has1> i am trying to do this |
09:13:19 | FromDiscord | <has1> sent a code paste, see https://play.nim-lang.org/#ix=2KH0 |
09:13:29 | FromDiscord | <has1> writeallbytes expects bytes |
09:13:49 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/io.html#writeFile%2Cstring%2Cstring |
09:14:26 | FromDiscord | <has1> no, i am trying to use c# for it |
09:14:28 | FromDiscord | <ElegantBeef> Idk why you'd use C# for that |
09:14:33 | FromDiscord | <has1> and pass the bytes to c# |
09:14:55 | FromDiscord | <ElegantBeef> Anywho |
09:15:13 | FromDiscord | <ElegantBeef> Well kin happy to see your work 😄 |
09:15:20 | FromDiscord | <has1> i will probably need to create a new c# byte object or something? |
09:15:36 | * | Ekho quit (Ping timeout: 268 seconds) |
09:15:40 | FromDiscord | <ElegantBeef> I dont know how the interop is done |
09:15:54 | FromDiscord | <has1> https://khchen.github.io/winim/clr.html |
09:16:04 | FromDiscord | <has1> the examples show it just passing strings directly into the functions |
09:16:09 | FromDiscord | <has1> but maybe that is just strings |
09:16:18 | FromDiscord | <has1> and other types dont work this way? |
09:16:25 | FromDiscord | <ElegantBeef> I mean use the C# WriteAll instead |
09:16:40 | FromDiscord | <ElegantBeef> No reason to convert to a byteseq really |
09:17:08 | FromDiscord | <ElegantBeef> Ah sorry `WriteAllTExt` |
09:18:11 | FromDiscord | <has1> Need to pass byte.↵↵There is a bunch of stuff like toCLRvariant etc |
09:18:13 | FromDiscord | <ElegantBeef> Kin is it up to the point a numpty like me could toy with some 3D renderering |
09:18:17 | FromDiscord | <has1> ill take a look at those |
09:23:19 | FromDiscord | <has1> sent a code paste, see https://play.nim-lang.org/#ix=2KH2 |
09:23:31 | FromDiscord | <has1> i am having a bit of trouble understanding the docs |
09:24:09 | FromDiscord | <has1> sent a code paste, see https://play.nim-lang.org/#ix=2KH3 |
09:24:41 | FromDiscord | <ElegantBeef> It's a generic proc yes |
09:24:55 | FromDiscord | <has1> and do i need to pass the type into the function when using it? ↵↵like ↵toCLRVariant<T>(x) |
09:25:00 | FromDiscord | <has1> or can i just call with |
09:25:02 | FromDiscord | <has1> toCLRVariant(x) |
09:25:13 | FromDiscord | <has1> (edit) "↵toCLRVariant<T>(x)" => "↵toCLRVariant[T](x)" |
09:25:18 | FromDiscord | <ElegantBeef> Did the compiler error? |
09:25:32 | FromDiscord | <has1> it didnt error, the execution failed though |
09:25:42 | FromDiscord | <ElegantBeef> So then it's not the issue |
09:26:31 | FromDiscord | <has1> but my byte seq is of type openArray[T], or is it? |
09:26:49 | FromDiscord | <has1> is it using the first proc, or does it overload to the second proc? |
09:27:01 | FromDiscord | <ElegantBeef> It's' of `seq[byte]` |
09:27:13 | FromDiscord | <has1> does openArray not implement that? |
09:27:13 | FromDiscord | <ElegantBeef> which falls under an `openArray` abstraction |
09:27:27 | FromDiscord | <has1> right, but isnt seq a type of openArray? |
09:27:31 | FromDiscord | <ElegantBeef> it is |
09:27:36 | FromDiscord | <ElegantBeef> So it uses the most specific proc |
09:27:46 | FromDiscord | <ElegantBeef> the one of `openArray[T]` |
09:29:20 | FromDiscord | <has1> how do i find the VarEnum? |
09:29:25 | FromDiscord | <has1> https://khchen.github.io/winim/objbase.html#VARENUM |
09:29:29 | FromDiscord | <has1> this gives me a 404 |
09:29:47 | FromDiscord | <ElegantBeef> Winims source code is on your computer |
09:32:18 | * | Ekho joined #nim |
09:33:45 | FromDiscord | <has1> where is it? |
09:35:06 | FromDiscord | <ElegantBeef> your nimble directory |
09:35:34 | FromDiscord | <has1> where specifically? |
09:35:44 | FromDiscord | <ElegantBeef> nimble/pkgs/winims |
09:36:10 | FromDiscord | <has1> where is the nimble directory? |
09:36:16 | FromDiscord | <ElegantBeef> idk on windows |
09:36:29 | FromDiscord | <ElegantBeef> it's `~/.nimble` on linux |
09:38:02 | saem | Do a nim --dump --dump.format:json yournimfile.nim |
09:38:32 | saem | That should output basically everything you could possibly want to know including your nimble directory |
09:45:23 | FromDiscord | <has1> i found it 🙂 |
09:45:31 | FromDiscord | <has1> not very helpful though |
09:46:16 | FromDiscord | <has1> https://play.nim-lang.org/#ix=2KHb |
09:46:19 | FromDiscord | <has1> these are my options |
09:47:26 | FromDiscord | <has1> i tried VT_SAFEARRAY and VT_BSTR |
10:00:00 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:05:40 | FromDiscord | <has1> anyone has any suggestions here? |
10:05:49 | FromDiscord | <has1> i am still stuck :X |
10:06:05 | * | Vladar joined #nim |
10:09:48 | * | PMunch joined #nim |
10:10:06 | * | mids joined #nim |
10:22:36 | FromDiscord | <j-james> out of curiosity, why can't identifiers include a dash? |
10:23:17 | mipri | I doubt there's a deep reason for it. It's just a basic decision to make about a language. |
10:24:08 | PMunch | Because a dash is a minus |
10:24:47 | PMunch | How would you tell the difference between "one-two" meaning variable `one` minus variable `two`, and one variable `one-two` |
10:26:42 | FromDiscord | <j-james> got it, that makes sense |
10:28:24 | * | opal quit (Remote host closed the connection) |
10:51:49 | FromDiscord | <has1> pls |
10:51:50 | FromDiscord | <has1> guys |
10:55:40 | Oddmonger | is it possible to cast a pointer to a seq ? |
10:55:50 | FromDiscord | <Rika> i dont know, has1, sorry |
10:56:14 | FromDiscord | <Rika> you can try doing that oddmonger but it has to match the memory structure |
10:56:23 | Oddmonger | so i've alloc buffer, and did: var myseq = cast[seq[char]](myalloc) |
10:56:30 | Oddmonger | and got an « out of memory » |
10:56:53 | FromDiscord | <Rika> uh a seq is not just a simple buffer |
10:57:29 | FromDiscord | <Rika> if you want a simple buffer use `cast[ptr UncheckedArray[T]]` of course with T being the real type |
10:58:18 | Oddmonger | ok |
10:58:46 | Oddmonger | hard to load seqs (from a file) which are not (u)int8 |
10:58:53 | FromDiscord | <has1> how do i declare an openArray type? |
10:59:03 | FromDiscord | <has1> proc readBytes(f: File; a: var openArray[int8 | uint8]; start, len: Natural): |
10:59:06 | FromDiscord | <Rika> openArray[T]? |
10:59:09 | FromDiscord | <Rika> what? |
10:59:23 | FromDiscord | <Rika> wdym? |
10:59:29 | FromDiscord | <has1> i need ↵↵var oo openArray[T] |
10:59:42 | FromDiscord | <Rika> i do not understand what youre trying to do |
10:59:46 | Oddmonger | openArray is seq or array , at your convenience |
11:00:07 | FromDiscord | <has1> readBytes (inside io) wants an openArray |
11:00:18 | FromDiscord | <has1> i need to pass that into the function |
11:00:30 | FromDiscord | <Rika> you can use a seq instead |
11:00:31 | Oddmonger | just allocate a seq with the filesize |
11:00:36 | FromDiscord | <has1> but how |
11:00:37 | FromDiscord | <has1> var oo seq[T] |
11:00:45 | FromDiscord | <Rika> var oo: seq[T] |
11:01:02 | FromDiscord | <Rika> i dont understand whats wrong |
11:01:34 | Oddmonger | var mybuffer = newSeq[uint8](filesize) |
11:01:56 | Oddmonger | if you want uint8 (readBytes) |
11:02:27 | Oddmonger | be careful if it's text, you will have to convert it before display (otherwise you'll get values, not chars) |
11:02:35 | FromDiscord | <Rika> bridge butchered that, its `var mybuffer = newSeq[uint8]()` |
11:03:34 | FromDiscord | <has1> it doesnt work for me |
11:03:34 | FromDiscord | <has1> https://play.nim-lang.org/#ix=2KHF |
11:03:48 | FromDiscord | <has1> i used int8 here |
11:04:31 | FromDiscord | <has1> undeclared identifier: 'newSequint8' |
11:04:39 | FromDiscord | <Rika> read this has1 |
11:04:54 | Oddmonger | oo must be allocated |
11:05:17 | FromDiscord | <has1> oh, |
11:05:18 | FromDiscord | <has1> Error: unhandled exception: index out of bounds, the container is empty |
11:05:22 | Oddmonger | put filesize as argument |
11:05:34 | Oddmonger | (gotta go, good luck) |
11:06:18 | FromDiscord | <has1> put it where? |
11:06:45 | FromDiscord | <has1> oh in the newSec? |
11:06:52 | FromDiscord | <Rika> yes |
11:06:59 | FromDiscord | <has1> still doesnt work |
11:07:00 | FromDiscord | <has1> Error: unhandled exception: unable to invoke specified member: WriteAllBytes (0x80131512) [CLRError] |
11:07:12 | FromDiscord | <Rika> then thats a winim issue now |
11:07:36 | FromDiscord | <has1> yes, i just want to convert my byte seq to a c# byte array... |
11:07:40 | FromDiscord | <has1> so i can invoke writeallbytes |
11:07:53 | FromDiscord | <has1> can no one help me with this? |
11:08:10 | FromDiscord | <Rika> i cant help you with winim |
11:08:11 | FromDiscord | <has1> the docs for toCLRVariant are here:↵↵https://khchen.github.io/winim/clr.html#toCLRVariant%2CT |
11:09:34 | FromDiscord | <has1> am i supposed to call it with the VARENUM param? |
11:11:15 | FromDiscord | <has1> i just noticed i am also using the return value from readBytes (which is the read count) instead of the buffer value |
11:11:25 | FromDiscord | <has1> but even with that fixed it still doesnt work |
11:18:48 | FromDiscord | <has1> seriously.. with text it works fine |
11:19:15 | FromDiscord | <has1> i just need to convert it to bytes |
11:19:31 | FromDiscord | <Rika> convert the seq[int8] to a seq[char] maybe |
11:19:52 | FromDiscord | <has1> by casting it? |
11:19:57 | FromDiscord | <Rika> you can probably cast the seq[int8] to a string even |
11:20:22 | FromDiscord | <has1> but i need to call the function and pass bytes to it |
11:20:40 | FromDiscord | <Rika> if text works then it works with a string |
11:20:42 | FromDiscord | <has1> ill try with seq[char] |
11:20:50 | FromDiscord | <has1> yes it works with a string |
11:20:59 | FromDiscord | <Rika> then what is wrong with casting it into a string |
11:21:03 | FromDiscord | <has1> @File.WriteAllText("""C:\Users\user\Desktop\test.dat""", "test") |
11:21:19 | FromDiscord | <has1> because that is not the function i am using. I am using a different function that only accepts bytes |
11:21:39 | FromDiscord | <has1> i am using writeallbytes as example |
11:21:39 | FromDiscord | <Rika> dude i have no idea what bytes are theres no bytes in nim unless you mean seq[byte] |
11:22:14 | FromDiscord | <has1> public static void WriteAllBytes(string path, byte[] bytes); |
11:22:19 | FromDiscord | <has1> its a csharp function. |
11:22:22 | FromDiscord | <Rika> i dont know c# |
11:22:34 | FromDiscord | <has1> you dont know what bytes are? |
11:22:38 | FromDiscord | <has1> or an array? |
11:22:41 | FromDiscord | <has1> its the same thing |
11:22:41 | FromDiscord | <Rika> i do, i dont know c# |
11:22:49 | FromDiscord | <Rika> man whatever you're on your own |
11:22:54 | FromDiscord | <has1> what does it have to do with it though? the API is in nim |
11:23:03 | * | FromGitter * yumaikas knows C# |
11:24:09 | FromGitter | <yumaikas> @has1 What are you trying to do? |
11:26:04 | FromDiscord | <has1> i am trying to call a c# function and pass an argument of type byte[] to it |
11:26:19 | FromDiscord | <Rika> try casting to seq[byte] then |
11:26:33 | FromGitter | <yumaikas> Do you have a paste of the code in question, on both sides? |
11:28:23 | FromDiscord | <has1> @Rika i already tried it all.↵↵pass the seq[uint8], pass the clr variant of that, pass the value directly, pass seq[byte] |
11:29:01 | FromDiscord | <has1> https://play.nim-lang.org/#ix=2KHM |
11:29:28 | FromDiscord | <has1> toCLRVariant is supposed to convert it to the CLR variant, this is where im unclear about |
11:30:22 | FromGitter | <yumaikas> Hrm... I'm going to guess that CLRVariant is of type Object, when it comes to dispatch? |
11:30:45 | FromDiscord | <Rika> no |
11:30:49 | FromDiscord | <has1> i am not sure about that. This is where i was hoping for some help |
11:30:49 | FromDiscord | <Rika> its a distinct ref object |
11:30:56 | FromDiscord | <has1> https://khchen.github.io/winim/clr.html#toCLRVariant%2CT |
11:30:58 | FromDiscord | <has1> here are the docs |
11:31:11 | FromDiscord | <Rika> clr variant is a distinct of this https://khchen.github.io/winim/com.html#variant |
11:31:29 | FromGitter | <yumaikas> No, I mean on the .NET side |
11:32:05 | FromDiscord | <Rika> dunno, i dont know a lick of C# |
11:32:07 | FromGitter | <yumaikas> Because from the sounds of it, it's the .NET side where you're running into trouble. |
11:32:15 | FromGitter | <yumaikas> I know a *lot* of C# |
11:32:34 | FromGitter | <yumaikas> (COM is one of my weaker parts of C# though) |
11:32:56 | FromGitter | <yumaikas> Why not use WriteAllText, rather than WriteAllBytes? |
11:32:58 | FromDiscord | <Rika> sounds like you can help them then |
11:33:31 | FromDiscord | <has1> because its an example for a function |
11:33:36 | FromDiscord | <has1> i need to pass bytes to it |
11:33:38 | FromDiscord | <has1> i cant use text |
11:34:04 | FromDiscord | <has1> trust me, i am lazy, if i could pass text to it i would do it xd |
11:35:01 | FromGitter | <yumaikas> What imports/nimble installs do I need to get your paste to compile? |
11:35:11 | FromDiscord | <has1> and the c# execution works great. I tried ↵↵@File.WriteAllText("""C:\Users\user\Desktop\aaa.dat""", "some text") |
11:35:14 | FromDiscord | <Rika> i think its just winim |
11:35:23 | FromDiscord | <has1> import winim/clr, asyncdispatch, httpclient, json |
11:35:31 | FromDiscord | <has1> winim/clr |
11:35:39 | FromDiscord | <Rika> oops i mean that for the installs |
11:37:04 | FromDiscord | <has1> (edit) "and the c# execution works great. I tried ↵↵@File.WriteAllText("""C:\Users\user\Desktop\aaa.dat""", "some text")" => "sent a long message, see http://ix.io/2KHP" |
11:39:47 | FromGitter | <yumaikas> Ok, so the first thing you're going to want to do is to figure out what types the CLR variants are resolving to |
11:41:28 | FromGitter | <yumaikas> Huh... So it complains "variant is not an object", which means I can't call GetType() on it.... |
11:42:12 | FromDiscord | <has1> i was hopeing calling toCLRVariant would take care of that |
11:43:09 | FromDiscord | <has1> i suppose you mean which nim type corresponds to the byte[] type in c# though? That is what you were saying ? |
11:44:22 | FromGitter | <yumaikas> Nah, on the C# side one needs to know what the type of your clrVar is. Right now, I don't know what it is. |
11:44:40 | FromGitter | <yumaikas> But I do know that a standard GetType() call on it fails |
11:49:02 | * | Vladar quit (Quit: Leaving) |
11:52:19 | FromGitter | <yumaikas> @has1: I think you'll have to new up a buffer, and then copy data into it byte by byte |
11:52:27 | FromGitter | <yumaikas> Just looking at how things work. |
11:52:37 | FromGitter | <yumaikas> I'll see if I can get a paste up once. |
11:52:42 | FromDiscord | <has1> how would i do that? |
11:53:05 | FromGitter | <yumaikas> Not using toObject, I can tell you that |
11:53:50 | FromDiscord | <has1> i just thought about something |
11:54:15 | FromDiscord | <has1> couldnt i base64 encode the bytes, call base64 decode via c# code and store the result in a variable |
11:54:20 | FromGitter | <yumaikas> You'd grab the `System.Byte[]` type, construct one of the appropriate length, and then either give it a pointer, or use whatever autogenerated indexing operators exist to assign into the ByteArray |
11:54:24 | FromDiscord | <has1> then call the function with the result of the decode |
11:54:29 | FromGitter | <yumaikas> @has1 Overkill, IMO |
11:54:40 | FromDiscord | <has1> i mean, i am desperate at this point |
11:54:54 | FromGitter | <yumaikas> @has1: Read the examples more, IMO |
11:55:04 | FromDiscord | <has1> which examples? There is no convert example |
11:57:19 | FromGitter | <yumaikas> https://github.com/khchen/winim/blob/master/examples/clr/misc_examples.nim#L44-L53 <- That takes bytes from C# and spits them to Nim, so it's a start |
11:58:35 | FromGitter | <yumaikas> What specific API do you need to call? |
11:58:47 | FromGitter | <yumaikas> (The WPF example is also worth a look) |
11:59:59 | FromDiscord | <has1> just↵File.WriteAllBytes |
12:00:08 | FromDiscord | <has1> if that works, ill be on my way |
12:00:19 | FromGitter | <yumaikas> Why that instead of WriteAllText ? |
12:02:07 | FromDiscord | <has1> because it uses bytes |
12:02:12 | FromDiscord | <has1> and i need to call a function with bytes |
12:02:20 | FromDiscord | <has1> i just noticed |
12:02:25 | FromDiscord | <has1> i can convert from string to bytes |
12:02:34 | FromDiscord | <has1> with Encoding.UTF8.GetBytes |
12:02:40 | FromDiscord | <has1> i tried Bytes.Parse before |
12:02:41 | FromGitter | <yumaikas> Yep |
12:02:42 | FromDiscord | <has1> but that didnt work |
12:03:27 | FromGitter | <yumaikas> You can also use MemoryStreams, IIRC with the right wrappers that lets you stream in things one byte at a time |
12:06:07 | FromDiscord | <has1> well fuck.. that doesnt work |
12:06:16 | FromDiscord | <has1> i am using the http client |
12:06:19 | FromDiscord | <has1> to get the "string" |
12:06:31 | FromDiscord | <has1> let response = await client.request(host, httpMethod = HttpGet)↵ let data = await response.body |
12:06:53 | FromDiscord | <has1> doing the string convert worked (i used hello world as string, and it wrote the result just fine) |
12:07:07 | FromDiscord | <has1> but using this data (which is of type string??) did not work |
12:08:18 | FromGitter | <yumaikas> So, C# strings are in UTF-16, so getting the UTF8-bytes will expect a UTF-16 string |
12:10:58 | FromDiscord | <has1> so what does that mean for me? |
12:11:17 | FromDiscord | <has1> do i need to cast the response.body into a different string type? Into char? Into cstring? |
12:11:53 | FromGitter | <yumaikas> I'm not sure, tbh, I'm still trying to get a byte array cast around |
12:13:18 | FromDiscord | <has1> var mscor = load("mscorlib")↵ var Encoding = mscor.GetType("System.Text.Encoding")↵ var bytes = @Encoding.UTF8.GetBytes("hello world") |
12:13:22 | FromDiscord | <has1> you can do that to get the bytes |
12:14:05 | FromDiscord | <has1> what type is the nim string? is that utf8? |
12:15:09 | PMunch | Well it's just a series of bytes |
12:15:17 | PMunch | But it can hold UTF-8 data |
12:15:29 | FromDiscord | <lqdev> disruptek: not much really, just wanna be sure the output always is either big endian or little endian |
12:15:32 | FromDiscord | <has1> but .net expects utf-16 |
12:15:35 | FromDiscord | <Rika> its not necessarily utf-8 either |
12:15:38 | PMunch | But myStr[10] for example will get the 10th character, not the 0th UTF8 rune |
12:15:40 | FromDiscord | <Rika> you can give it utf-16 |
12:15:49 | FromDiscord | <lqdev> would help with using frosty for networking and such |
12:15:51 | FromDiscord | <has1> how can i give it utf-16? |
12:15:54 | PMunch | But you have the unicode module for getting runes |
12:16:01 | FromDiscord | <Rika> just make a utf-16 sequence |
12:16:04 | FromDiscord | <has1> how? |
12:16:10 | FromDiscord | <Rika> no clue, never needed to |
12:18:47 | PMunch | You can use the encodings module: https://nim-lang.org/docs/encodings.html |
12:19:01 | FromDiscord | <haxscramper> https://nim-lang.org/docs/widestrs.html#Utf16Char |
12:19:30 | FromDiscord | <haxscramper> I haven't used it, just found out this module exists |
12:19:59 | * | FromGitter * yumaikas is tapping out for now |
12:20:13 | FromDiscord | <haxscramper> But `newWideCString` seems like exactly what you need |
12:21:10 | FromGitter | <yumaikas> @has1: Fwiw, C# has a very fully-featured HTTP Client if you're using newer versions, perhaps you can use compile() with the right .DLLs to use that. If you're going to experiment with C# code, I highly recommend LinqPad |
12:21:38 | FromDiscord | <has1> that was literally my "out" |
12:21:45 | FromDiscord | <has1> like my last ditch |
12:21:45 | PMunch | @has1: like this: https://play.nim-lang.org/#ix=2KI7 |
12:21:53 | FromDiscord | <has1> but then i would basically not use any nim anymore |
12:21:55 | FromDiscord | <has1> xDD |
12:22:22 | FromGitter | <yumaikas> @has1: There may not be any reason to use Nim, then |
12:23:03 | FromGitter | <yumaikas> The main thing that Nim has that C# doesn't is macros. Everything else C# has an answer for, or better. Except for C interop, that's a bit more awkward in C# |
12:23:23 | FromGitter | <yumaikas> But, like, async when from C# to Nim, more or less, not the other way around |
12:24:11 | FromGitter | <yumaikas> And COM-based interop is always a tricky process unless you happen to have pretty solid understanding of COM itself |
12:26:39 | FromGitter | <yumaikas> (If you have any C# questions, I'll be online for a while longer) |
12:29:02 | FromDiscord | <has1> ill try the encoding thing |
12:29:47 | * | mids quit (Quit: Connection closed for inactivity) |
12:31:07 | FromDiscord | <has1> lmao |
12:31:12 | FromDiscord | <has1> the encoded one was even worse |
12:31:44 | FromDiscord | <has1> MZ� |
12:31:57 | FromDiscord | <has1> thats the "raw" response.body |
12:32:28 | FromDiscord | <has1> this is the utf16 encoded one |
12:32:29 | FromDiscord | <has1> M |
12:33:25 | PMunch | Are you sure it expects utf16? |
12:33:53 | FromGitter | <yumaikas> winim/clr might do the necessary convertions |
12:34:09 | PMunch | What are you actually trying to do? |
12:34:14 | FromGitter | <yumaikas> Given how it converts other strings (at least string literals) just fine |
12:36:24 | FromDiscord | <has1> i am calling |
12:36:25 | FromDiscord | <has1> Encoding.UTF8.GetBytes |
12:36:31 | FromDiscord | <has1> so whatever that one expects |
12:36:59 | FromDiscord | <has1> my data comes from my server. which returns bytes |
12:37:20 | PMunch | Well that would expect UTF8 surely |
12:39:20 | FromGitter | <yumaikas> Encoding.UTF8.GetBytes takes a C# string, and turns it into UTF8 bytes |
12:39:31 | FromDiscord | <has1> yes |
12:39:35 | FromGitter | <yumaikas> I think Encoding.UTF8.FromBytes might be handy? |
12:39:55 | FromDiscord | <has1> wait wait |
12:40:04 | FromDiscord | <has1> that expects Byte[] |
12:40:13 | FromGitter | <yumaikas> Thought that would probably get you back to square 1, lol |
12:40:18 | FromDiscord | <has1> yes |
12:40:37 | FromGitter | <yumaikas> Did you look at the COM1DArray stuff? |
12:41:03 | FromDiscord | <has1> hmm, no |
12:41:12 | FromDiscord | <has1> what was that? |
12:42:18 | * | fputs joined #nim |
12:43:15 | FromGitter | <yumaikas> It's something I saw in the examples. |
12:45:28 | narimiran | Zevv: are you around maybe? |
12:50:23 | narimiran | Zevv: nvm, the bug was at my end :) |
12:51:33 | Zevv | yeah I'm around |
12:51:35 | Zevv | but nevermind |
12:51:37 | Zevv | the bug was on your end |
12:56:12 | FromDiscord | <has1> alright boys |
12:56:17 | FromDiscord | <has1> i found a solution |
12:56:59 | FromDiscord | <has1> sent a code paste, see https://play.nim-lang.org/#ix=2KIj |
12:57:13 | FromDiscord | <has1> i returned base64 from my server |
12:57:29 | PMunch | Hmm, anyone here familiar with https://github.com/clj/nim-esp8266-examples ? |
12:57:49 | PMunch | Trying to run some comparative benchmarks against C and MicroPython for my FOSDEM presentation |
13:00:53 | FromDiscord | <has1> but my solution sucks, lets be honest |
13:00:57 | FromDiscord | <has1> 33% increase in file size |
13:02:51 | PMunch | base64'll do that to ya |
13:03:39 | PMunch | Zevv, did you ever try Nim en an ESP8266? |
13:03:43 | PMunch | on* |
13:03:49 | PMunch | federico3, or maybe you did |
13:03:54 | FromDiscord | <has1> oh |
13:03:57 | FromDiscord | <has1> i improved my code |
13:04:04 | PMunch | Or @clj |
13:04:11 | PMunch | @has1, always a good idea |
13:04:31 | FromDiscord | <has1> now i am still returning bytes |
13:04:32 | FromDiscord | <has1> sent a long message, see http://ix.io/2KIq |
13:04:36 | FromDiscord | <has1> but encoding it in nim |
13:04:46 | FromDiscord | <has1> then decoding it using c# and the |
13:04:51 | FromDiscord | <has1> (edit) removed "and the" |
13:05:24 | FromDiscord | <has1> now the only cost is increased cpu usage to do the silly base64 game |
13:06:19 | PMunch | You shouldn't need to convert to base64 |
13:06:34 | PMunch | As long as you match their encodings |
13:07:41 | FromDiscord | <has1> its a file |
13:08:07 | PMunch | Ah, you're sending a file? |
13:08:36 | FromDiscord | <has1> yes |
13:10:18 | PMunch | And it doesn't work? |
13:10:47 | PMunch | Does the file have a BOM marker messing things up? |
13:11:01 | PMunch | Is it stored as UTF-16? |
13:11:08 | PMunch | What kind of file is it basically :P |
13:11:16 | PMunch | And do you read it into a string before sending it? |
13:11:24 | PMunch | Sender is C#, recipient is Nim right? |
13:11:33 | FromGitter | <yumaikas> Also, why do you need C# for this? Is there C# library, or a db connection or the like? |
13:14:39 | * | abm joined #nim |
13:36:28 | FromDiscord | <has1> i have some legacy code that uses byte that i want to keep using. Basically, use c# as plugin system for old code and nim for new code |
13:37:49 | FromDiscord | <has1> the file is just an arbitrary file (user supplied)↵and its sent as-is in byte form via a go http server |
13:46:05 | PMunch | Via a go HTTP server? |
13:46:11 | PMunch | And you ant to receive it in Nim? |
13:46:16 | PMunch | Or in C#? |
13:49:35 | * | PMunch quit (Quit: leaving) |
13:50:52 | * | PMunch joined #nim |
13:52:21 | FromDiscord | <Rika> i need some opinions on my new library https://github.com/de-odex/shama before i decide to do anything else substantial to it |
13:56:04 | * | lritter joined #nim |
14:13:01 | federico3 | PMunch: join us on #nim-embedded |
14:24:45 | * | Vladar joined #nim |
14:28:18 | * | lritter quit (Ping timeout: 256 seconds) |
14:31:41 | ForumUpdaterBot | New question by Victor Golovanenko: How to insert a character into a string in Nim, see https://stackoverflow.com/questions/65550953/how-to-insert-a-character-into-a-string-in-nim |
14:34:38 | FromDiscord | <zetashift> GTK & Nim is #1 on HN again |
14:34:54 | FromDiscord | <zetashift> I'm seeing Nim a lot on HN these days |
14:41:21 | PMunch | Link? |
14:41:24 | FromDiscord | <Rika> wow TOP |
14:41:30 | FromDiscord | <Rika> https://news.ycombinator.com/item?id=25621700 |
14:42:10 | PMunch | Wait, Gtk4? |
14:43:53 | Oddmonger | not so fast, i'm still using gtk2 |
14:44:26 | FromDiscord | <lqdev> boomer |
14:45:45 | Oddmonger | rather petrolcrisiser |
14:49:29 | FromDiscord | <Rika> i didnt even know gtk4 existed until now lmao |
15:04:43 | * | waleee-cl joined #nim |
15:07:56 | * | tane joined #nim |
15:12:24 | Oddmonger | seems i cannot dereference an UncheckedArray |
15:12:27 | Oddmonger | https://play.nim-lang.org/#ix=2KJl |
15:14:46 | FromDiscord | <lqdev> what do you mean "dereference an UncheckedArray"? |
15:14:54 | FromDiscord | <lqdev> you wanna take an element, use `myalloc_ptr[0]` |
15:15:22 | FromDiscord | <lqdev> UncheckedArray[T] does not have an $ because how do you know what's the length of the array |
15:16:21 | Oddmonger | i was expecting slice support… |
15:16:40 | Oddmonger | ok it's not boundchecked, but trust me, i know the bounds :) |
15:18:20 | FromDiscord | <lqdev> maybe turn it into an openArray with toOpenArray? |
15:21:26 | Oddmonger | seems i need an array to do this |
15:21:58 | Oddmonger | ah sorry ,read too fast |
15:22:13 | Oddmonger | proc toOpenArray[T](x: ptr UncheckedArray[T]; first, last: int): openArray[T] {...} , indeed |
15:23:08 | Oddmonger | it's ok with that, thank you |
15:23:54 | Oddmonger | but i wonder if for my need, it wouldn't be faster to concanete an array (the goal is too form a string from bytes) |
15:34:21 | FromDiscord | <CodeHz> I don't think openarray is equals to slice |
15:36:49 | FromDiscord | <Rika> it kinda is but not really no |
15:36:54 | FromDiscord | <CodeHz> (you cannot use openarray to create a slice of seq (only partial data, not whole) without breaking the gc |
15:37:11 | FromDiscord | <fwsgonzo> sent a code paste, see https://paste.rs/ZkC |
15:37:23 | FromDiscord | <fwsgonzo> bereq.append("") |
15:37:51 | FromDiscord | <CodeHz> Yes, but you need export it |
15:37:55 | FromDiscord | <fwsgonzo> yep, thanks 😄 |
15:38:25 | FromDiscord | <CodeHz> (edit) "it" => "it(if not in same module" |
15:38:55 | FromDiscord | <Rika> only few instances you cant use ufcs on |
15:39:04 | FromDiscord | <Rika> and all proc you can |
15:39:12 | FromDiscord | <Rika> only in macros or templates is it ever iffy |
15:39:17 | Oddmonger | can you tell me if you can execute this ? https://play.nim-lang.org/#ix=2KJo (for me, the circle of compilation-wait turns forever) |
15:40:18 | FromDiscord | <fwsgonzo> its blank for me |
15:40:24 | FromDiscord | <Rika> it compiles for me |
15:40:38 | Oddmonger | that's odd… thank you for trying |
15:40:57 | FromDiscord | <Rika> i tested on wsl |
15:41:02 | FromDiscord | <CodeHz> Why not use chr instead of char |
15:41:16 | FromDiscord | <Rika> might be an issue of playground rn |
15:41:55 | Oddmonger | hum, even with chr as suggested |
15:42:09 | Oddmonger | indeed , char(i) is not what i want anyway |
15:43:01 | Oddmonger | with inim, it's ok, but «str» is still blank after the loop |
15:43:21 | FromDiscord | <CodeHz> Because it is not visible character |
15:43:23 | Oddmonger | well, it has 26 values in it, but obviously not… ah wait |
15:43:30 | Oddmonger | i'm dumb , that's official |
15:44:35 | Oddmonger | chr('a'.int+i) will do |
15:45:01 | Oddmonger | with 0 starting slice, of course |
16:02:22 | * | leorize quit (Read error: Connection reset by peer) |
16:03:43 | FromDiscord | <fwsgonzo> how exactly do you interface with C using pointer-length? |
16:03:55 | FromDiscord | <fwsgonzo> seems to me that seq[uint8] is not compatible |
16:04:00 | FromDiscord | <fwsgonzo> and strings are useless |
16:04:08 | FromDiscord | <fwsgonzo> (edit) "and strings are useless ... " added "- Nim calls strlen" |
16:04:40 | FromDiscord | <fwsgonzo> in C++ we can use strings just fine, because nobody is calling strlen on it |
16:05:44 | FromDiscord | <lqdev> you pass yourSeq[0].unsafeAddr as the pointer and yourSeq.len as the length |
16:05:50 | * | zedeus quit (Ping timeout: 256 seconds) |
16:06:08 | FromDiscord | <fwsgonzo> and the other way? |
16:07:50 | FromDiscord | <exelotl> is there a nice way to fall back to another string if the first string is empty? |
16:07:52 | * | zedeus joined #nim |
16:08:43 | * | leorize joined #nim |
16:09:06 | FromDiscord | <exelotl> like `echo prop.attr("value") or prop.text` |
16:17:36 | FromDiscord | <haxscramper> There is `getOrDefault`, https://nim-lang.org/docs/tables.html#getOrDefault%2CTable%5BA%2CB%5D%2CA |
16:18:01 | FromDiscord | <haxscramper> Assuming `prop` is some kind of table |
16:18:09 | FromDiscord | <Rika> there isnt anything for just strings, otherwise |
16:18:18 | FromDiscord | <Rika> you can make an overload prolly |
16:18:34 | FromDiscord | <exelotl> it's an XmlNode :( |
16:18:44 | FromDiscord | <haxscramper> Xml node uses strtabs |
16:18:55 | FromDiscord | <haxscramper> so `getOrDefault` will work |
16:19:09 | FromDiscord | <haxscramper> https://nim-lang.org/docs/strtabs.html#getOrDefault%2CStringTableRef%2Cstring%2Cstring this one |
16:19:21 | FromDiscord | <fwsgonzo> how do you return a pointer, length pair back to C by returning? |
16:19:48 | FromDiscord | <fwsgonzo> usually this would be done by either returning a struct with 2 members (which fit in 2 integer registers - which the C calling convention allows) |
16:19:56 | FromDiscord | <fwsgonzo> or you take a pointer to the length as a function parameter |
16:21:06 | FromDiscord | <haxscramper> You want to declare nim proc that does this? I would use second approach most likely |
16:22:40 | FromDiscord | <haxscramper> Something like that in function signature: `tokens: ptr [ptr [CXToken]]; numTokens: ptr [cuint]` |
16:23:15 | FromDiscord | <fwsgonzo> yes - there is technically a third option too, as I can "stop the world" from a C function, so I could take the pointer, length pair as parameters to this special function, and then take it from there. the problem is that I have no idea what I would break in Nim if things just suddenly stop running (only to return by calling some other nim function later) |
16:23:39 | * | opal joined #nim |
16:23:45 | FromDiscord | <haxscramper> And this corresponds to `CXToken Tokens, unsigned NumTokens` |
16:24:03 | FromDiscord | <fwsgonzo> (edit) "later)" => "later)↵although, maybe I could mark it as noreturn" |
16:24:10 | FromDiscord | <haxscramper> I would recommend second option anyway |
16:24:17 | FromDiscord | <fwsgonzo> ok |
16:24:30 | FromDiscord | <haxscramper> You need to make it accessible from C, right? |
16:24:34 | FromDiscord | <fwsgonzo> yep |
16:25:22 | FromDiscord | <haxscramper> You can also try `tokens: var ptr CXToken, numTokens: var cuint` and see how it maps to generated C code |
16:25:36 | FromDiscord | <haxscramper> So you won't have to explicitly deal with pointers on nim side |
16:34:25 | * | Gustavo6046 joined #nim |
16:39:52 | * | leorize quit (Remote host closed the connection) |
16:40:18 | * | leorize joined #nim |
16:47:04 | FromDiscord | <fwsgonzo> thanks, I was thinking about this during dinner and now I think it won't work |
16:47:34 | FromDiscord | <fwsgonzo> keep in mind that I'm calling into Nim from <let's pretend it's C> and I'm returning back to C with a result that I don't want destroyed |
16:47:54 | FromDiscord | <fwsgonzo> i don't know if nim zeroes out the things that fall out of scope, but I can imagine that it will |
16:48:28 | FromDiscord | <fwsgonzo> so in my current example I call into Nim and then Nim gzips something, and I want to return the result back to C - how would you do that? |
16:48:44 | * | Arrrrrrrr joined #nim |
16:49:26 | leorize[m] | this implies that you want C to control the resulting memory? |
16:49:58 | FromDiscord | <fwsgonzo> yes, and it will in more ways than one - Nim is inside a VM and returning from that function call stops everything |
16:50:15 | * | Vladar quit (Remote host closed the connection) |
16:50:45 | FromDiscord | <fwsgonzo> that also means there's no real calling convention other than what I make up - but C is handy as everyone has some support for it |
16:50:47 | * | antranigv_ is now known as antranigv |
16:51:58 | FromDiscord | <fwsgonzo> I also have control over the heap btw 🙂 |
16:52:12 | leorize[m] | this is very hard then, as far as semantics go |
16:52:14 | FromDiscord | <fwsgonzo> (edit) "I also have control over the heap btw 🙂 ... " added "I can allocate for the guest VM and deallocate any pointer it gives back, if I have to" |
16:52:48 | FromDiscord | <haxscramper> IIRC object lifetimes are subject to regular rules - value types go out of scope of course, `ref` types are collected by GC or ARC (with latter one being comparatively similar to value types IIUC), and pointers' lifetimes is entirely in your control |
16:53:26 | FromDiscord | <fwsgonzo> one of my gotos is to make a function call immediately vmexit, and probably mark the function as noreturn, but I still need to present the right values in the right registers |
16:53:38 | leorize[m] | are you willing to require that C have to use Nim's API for freeing whatever nim returns? |
16:54:03 | FromDiscord | <fwsgonzo> I guess so, if its a generalizable? |
16:54:04 | leorize[m] | if not then your only chance is to allocate a buffer using malloc and copy the gzip-ed stuff over |
16:54:34 | * | Vladar joined #nim |
16:55:51 | * | abm quit (Quit: Leaving) |
16:56:20 | leorize[m] | that is hard then, since when destructors come into play you have to know the exact type you're dealing with from nim side... |
16:57:44 | leorize[m] | if you return `ref T` to C then when C send `ref T` for freeing the nim compiler must know what this `T` is, so not very generalizable... |
16:58:11 | FromDiscord | <fwsgonzo> i have an idea, actually: a callback |
16:58:35 | FromDiscord | <fwsgonzo> the callback is the return value |
16:58:46 | FromDiscord | <fwsgonzo> after the callback ends, I can resume the VM which then destroys the Nim stuff |
16:59:52 | FromDiscord | <fwsgonzo> so from Nim I would call something like myreturn(seq.pointer, seq.length) with everything still alive, and once that returns, Nim would just see everything unwind and destruct like normal |
17:02:26 | leorize[m] | sounds like CPS to me :P |
17:05:52 | FromDiscord | <Gibson> should a new httpclient be made for each request? |
17:06:14 | FromDiscord | <Gibson> if I try to reuse one after a delay from when it was first created, it errors with "Connection was closed before full request was made" |
17:06:23 | FromDiscord | <Gibson> but calling newHttpClient for each works fine |
17:07:24 | FromDiscord | <Rika> i just do that but i dont know if its right either |
17:07:35 | * | PMunch quit (Quit: leaving) |
17:13:49 | FromDiscord | <dom96> a http client for each async "thread" |
17:14:06 | FromDiscord | <dom96> just don't use the same http client while another async proc is using it and you should be fine |
17:15:37 | * | Arrrrrrrr quit (Quit: Arrrrrrrr) |
17:17:15 | FromDiscord | <Gibson> this is single threaded |
17:17:36 | FromDiscord | <Gibson> idk what the problem is, but doing this fixes it https://media.discordapp.net/attachments/371759389889003532/795340095901138944/unknown.png |
17:18:39 | FromDiscord | <Gibson> possibly due to keep-alive expiring and it tries to reuse a connection? |
17:19:29 | * | WilhelmV1nWeiner quit (Quit: leaving) |
17:19:38 | * | WilhelmVonWeiner joined #nim |
17:20:17 | FromDiscord | <Gibson> all the requests are to the same server, and this reliably happens when there is a long (several second) delay between requests |
17:24:11 | FromDiscord | <dom96> yes, httpclient will attempt to reuse the connection. I guess it fails to detect this case, can you file a bug report? |
17:24:20 | FromDiscord | <Gibson> 👍 |
17:46:20 | * | rominf joined #nim |
17:57:25 | disruptek | you're blowin' my mind right now. |
18:00:23 | disruptek | yes. |
18:00:31 | disruptek | httpclient isn't made to make multiple requests. |
18:01:21 | disruptek | httpclient isn't made to make multiple requests. |
18:02:25 | disruptek | make the title as follows: |
18:02:26 | disruptek | httpclient isn't made to make multiple requests. |
18:02:32 | disruptek | treeform: so i'm looking at frosty vs. flatty and it's going to be hard to to improve on copyMem. |
18:02:34 | disruptek | i'm going to have to take this to the next level somehow. |
18:03:46 | FromDiscord | <treeform> Well most objects don't go into copyMem. copyMem is only a big winner when doing arrays of simple objects. |
18:05:00 | disruptek | sure, but i'm only using it for copy-like serialization. |
18:05:19 | disruptek | ie. i/o on strings or whatever. |
18:06:01 | FromDiscord | <treeform> So in your tests we have same time because we just spend it all in copyMem? |
18:06:33 | disruptek | no, i dunno how my new code work yet because it doesn't compile. 😁 |
18:15:38 | FromDiscord | <juan_carlos> @haxscramper macro generates a lot of `DeclaredButNotUsed` (?), try `nim check tmatching.nim` |
18:20:08 | FromDiscord | <haxscramper> I don't see any - `nim check --hints:off --skipParentCfg --skipUserCfg --skipProjCfg tmatching.nim ` only shows one unused import |
18:20:18 | FromDiscord | <haxscramper> Checked on master branch, not even follow-up PR |
18:20:27 | FromDiscord | <juan_carlos> hints on |
18:20:44 | FromDiscord | <haxscramper> oh |
18:20:45 | FromDiscord | <haxscramper> shit |
18:20:53 | FromDiscord | <haxscramper> whoever designed this CLI |
18:21:40 | * | hnOsmium0001 joined #nim |
18:26:46 | disruptek | if you look on the bottom it says, `designed by timmy in california`. |
18:29:11 | FromDiscord | <haxscramper> the concept of CLI is garbage in general, tools need to be shipped as libraries |
18:29:15 | FromDiscord | <haxscramper> With something like cligen on top |
18:29:25 | planetis[m] | except my ecs game where everything is copymem'ed |
18:29:45 | FromDiscord | <haxscramper> And everyone should write own wrappers for everything |
18:29:53 | disruptek | scramper: i agree; everything should be a library. |
18:30:15 | FromDiscord | <haxscramper> The idea is even worse that what we have now, but at least I wont' have to search for correct `skipCfg` |
18:30:27 | planetis[m] | disruptek: i don't know if you noticed but, streams.writeData uses copymem internally, so changing your lib would be trivial really |
18:30:38 | FromDiscord | <haxscramper> worse in terms of time spent overall |
18:31:19 | disruptek | planetis[m]: yeah, that's why i don't care about changing it. 😉 |
18:31:36 | disruptek | only the public api matters to me, and it's only getting two changes: |
18:31:45 | disruptek | arg reorder and typedesc support for chaining. |
18:32:07 | planetis[m] | also what is 20% of 10ms? |
18:33:00 | * | rominf quit (Ping timeout: 245 seconds) |
18:33:14 | disruptek | so very many things... |
18:33:35 | disruptek | my old t1 latency, 😢 |
18:33:53 | disruptek | i would kill for a t right now. |
18:34:13 | disruptek | don't wave that shit in front of my face or you just might lose a limb. |
18:34:56 | saem | If my wifi could extend that far I would share. |
18:35:26 | FromDiscord | <Daniel> just boost it to 200mW, its probably limited to 50mW |
18:35:44 | saem | Anyone using ndi (Nim debug info) files for anything? |
18:35:45 | FromDiscord | <Daniel> (edit) "just boost it to 200mW, ... its" added "now" |
18:37:25 | saem | Daniel of likely have to do that, setup a directional, then setup a chain of them that's likely not only to raise the ire of two radio regulators but also run afoul of border regulations. |
18:37:54 | saem | I mean, nbd |
18:38:13 | disruptek | fcc is toothless when it comes to radio. |
18:39:34 | planetis[m] | disruptek: lol i was just making a point against "streams are bad" |
18:39:48 | disruptek | streams are good. |
18:41:17 | saem | Just ask twitch |
18:41:50 | disruptek | you can get a tech license in the US for radio; easier than an ops license and it will let you build a high-speed wan locally. |
18:41:56 | FromDiscord | <Filipe Duarte> Is anybody here from Brazil? |
18:42:14 | disruptek | but, no point where there is no decent peering avail. |
18:43:17 | * | PrvDragon joined #nim |
18:44:07 | planetis[m] | also that same unrealistic benchmark (which creates 100 level deep trees or something), measures the copy from string to stringstream (which can be fixed with a patch to stdlib) but whatever its "fast." |
18:44:44 | disruptek | right. |
18:45:09 | disruptek | i usually benchmark serializing my graphs instead; they represent real workload. |
18:52:50 | planetis[m] | Just venting off this whole discussion about who has the fastest lib really killed the fun for me, I find it more like negative competition than constructive talk. |
18:53:03 | planetis[m] | Can't find a channel without that bs going on |
18:53:06 | * | planetis[m] left #nim ("User left") |
18:53:16 | disruptek | it has been constructive. |
18:53:31 | disruptek | flatty got better and i fixed frosty's api. |
18:53:55 | disruptek | frosty wasn't an academic exercise. |
18:54:16 | disruptek | it was built to replace the sqlite serializer araq wrote for ic. |
19:00:13 | * | fputs quit (Ping timeout: 264 seconds) |
19:03:36 | FromDiscord | <haxscramper> fixed now |
19:04:22 | FromDiscord | <haxscramper> not absolutely everything, but `ok` and `wasSet` ones should not show up anymore |
19:04:42 | FromDiscord | <juan_carlos> Cool :D |
19:09:04 | FromDiscord | <Recruit_main707> shouldnt we add some higher level functions to endians? |
19:09:23 | FromDiscord | <Clyybber> @haxscramper Whats the problem with the CLI you had? |
19:09:25 | disruptek | see endians2. |
19:11:50 | FromDiscord | <haxscramper> If you disregard general whining about everything - it usually takes me several tries to figure out all `--skipCfg` I need, and things like `--hints:off` |
19:12:17 | FromDiscord | <haxscramper> But it is not the problem to be honest |
19:13:10 | FromDiscord | <haxscramper> Because skipping project cfg does not actually skip `config.nims`, but `skipCfg` makes tests uncompilable |
19:13:28 | FromDiscord | <haxscramper> Because path is set using `.nims` switch |
19:13:59 | disruptek | c'mon, you love it. |
19:14:05 | disruptek | just embrace the madness. |
19:14:59 | FromDiscord | <haxscramper> I wanted to write my own CLI generator |
19:15:21 | FromDiscord | <Clyybber> so its a bug? |
19:15:25 | FromDiscord | <haxscramper> no |
19:15:36 | FromDiscord | <haxscramper> Well, `skipCfg` skips all configuration |
19:16:19 | FromDiscord | <haxscramper> So it works the way it should, but considerint there is four different switches and for some reason warnings are controlled using `hints:off` |
19:17:04 | FromDiscord | <haxscramper> But again, "XDeclaredButNotUsed" but not be a warning technically, but it certainly is in my understanding, so it causes another confusion |
19:17:23 | FromDiscord | <haxscramper> And `--warning[XDeclaredButNotUsed]:off` being the thing doesn't help too |
19:17:43 | FromDiscord | <haxscramper> (edit) "is" => "are" |
19:22:07 | FromDiscord | <juan_carlos> @haxscramper https://github.com/nim-lang/fusion/runs/1640307695#step:8:245 |
19:23:00 | FromDiscord | <juan_carlos> I think that test chunk is too big. |
19:29:23 | FromDiscord | <haxscramper> Cant' reproduce it locally with 1.0.0 |
19:29:35 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
19:29:37 | FromDiscord | <haxscramper> Nor with 1.0.10 |
19:30:15 | FromDiscord | <haxscramper> And run you linked was two hours ago, are sure it is still relevant? |
19:31:51 | * | NimBot joined #nim |
19:34:05 | * | pbb joined #nim |
19:38:12 | FromDiscord | <no name fits> I might be stupid, but is there some suggested plug-ins for VSCode somewhere?↵if not, which ones are you guys using for Nim dev in VSCode? |
19:48:29 | FromDiscord | <no name fits> Also I don't quite get the difference between ``if`` and ``when``. I looked at the docs and it says it's the same except the root is ``nnkWhenStmt`` and I tried to look that up but I couldn't |
19:50:29 | FromDiscord | <haxscramper> `if` is for runtime checking `when` is for compile-time |
19:50:42 | FromDiscord | <haxscramper> `when` is closer to `#ifdef` basically |
19:51:10 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement |
19:51:38 | FromDiscord | <no name fits> Ooooh I see. Thanks so much |
19:51:53 | FromDiscord | <haxscramper> You probably looked in `std/macros` which does indeed say about `nnkWhen` |
19:51:58 | FromDiscord | <no name fits> Right |
19:52:16 | FromDiscord | <haxscramper> ~tutorial |
19:52:16 | disbot | tutorial: 11intro to sacred manuscripts: https://nim-lang.org/docs/tut1.html |
19:52:57 | FromDiscord | <no name fits> Oh I see! I was using the index page |
19:53:13 | FromDiscord | <no name fits> <https://nim-lang.org/docs/theindex.html> |
19:53:53 | FromDiscord | <haxscramper> ~learn |
19:53:53 | disbot | no footnotes for `learn`. 🙁 |
19:53:57 | FromDiscord | <Enimatek> is there some more deep information / article about the diff between proc, func and methode? i've been using proc all the time, but sometimes i see a method or func passing by, but it seems to do the same thing though, and the articles desribing the difference are also saying its (practically) the same, would really like to know the situations one or the other would make a difference |
19:54:02 | FromDiscord | <haxscramper> ~learn is https://nim-lang.org/learn.html |
19:54:02 | disbot | learn: 11https://nim-lang.org/learn.html |
19:54:21 | FromDiscord | <haxscramper> ~learn is contains links to lots of interesting articles and tutorials to get started with nim |
19:54:21 | disbot | learn: 11contains links to lots of interesting articles and tutorials to get started with nim |
19:55:00 | FromDiscord | <haxscramper> `func` has no side effects (can read/write files, access global vars etc), `proc` is just regular procedure |
19:55:12 | FromDiscord | <haxscramper> `method` is for dynamic dispatch for OOP |
19:55:48 | FromDiscord | <no name fits> As I understand it, ``func`` makes it easier to do functional programming |
19:55:51 | FromDiscord | <haxscramper> So yes, they are largely the same except for dispatching - `method` uses runtime, `proc`/`func` static |
19:56:25 | FromDiscord | <haxscramper> No, not really, it just checks that you have no side effects, Useful bonus, but nothing over regular `proc` |
19:56:42 | FromDiscord | <haxscramper> Actually `func` is just sytnax sugar for `proc {.noSideEffect.}` |
19:56:49 | FromDiscord | <no name fits> Oh I see |
19:58:08 | FromDiscord | <Enimatek> hm, so i do a lot of 'OO' in my code, or at least i always start with a type ref object and start making 'procs' for it, would methods be a better option in that case? though with procs i never had any issues till now |
19:59:47 | FromDiscord | <haxscramper> 1 `method` is necessary for implementation overriding for derived classes↵2 if you have `ref` object it is not an OOP actually, just means you allocate objecs on heap. To actually do OOP (be able to derive) you need to do `ref object of RootObj` or `ref object of SomeOtherParentObj` |
20:00:11 | FromDiscord | <haxscramper> So in your code you won't benefit from methods at all, since you don't seem to use runtime dispatch for anything |
20:01:46 | * | al1ranger joined #nim |
20:02:07 | * | al1ranger quit (Client Quit) |
20:02:32 | FromDiscord | <Enimatek> ok, thanks for the info, i will dive into these subjects, since most things you just mentioned are alien to me i guess, maybe because i never thought about the heap in the first place before using nim 🙂 |
20:03:03 | FromDiscord | <haxscramper> http://zevv.nl/nim-memory/#_two_ways_to_organize_memory |
20:03:37 | FromDiscord | <Enimatek> its probably also the reason why i dont 'get' the difference between proc/method etc. |
20:05:48 | FromDiscord | <no name fits> Thanks for being helpful btw ❤️ |
20:06:47 | FromDiscord | <Privacy_Dragon> How do I get the IUP stuff on my laptop? |
20:09:17 | FromDiscord | <juan_carlos> @haxscramper https://github.com/nim-lang/fusion/pull/64/checks?check_run_id=1640605058#step:8:67 |
20:09:17 | disbot | ➥ CI JS WIP |
20:09:33 | disruptek | scramper: footnotes aren't cumulative. |
20:09:40 | disruptek | ~learn is https://nim-lang.org/learn.html |
20:09:40 | disbot | learn: 11contains links to lots of interesting articles and tutorials to get started with nim |
20:09:41 | disbot | learn: 11https://nim-lang.org/learn.html |
20:12:19 | FromDiscord | <haxscramper> I cant reproduce this only on 1.4.0 but not on 1.4.2 |
20:13:29 | FromDiscord | <haxscramper> So it seems like the bug is not on my side, and it was old enough to be backported to even 1.0.10 |
20:18:02 | FromDiscord | <juan_carlos> I believe u 👍 |
20:19:02 | FromDiscord | <haxscramper> IIRC fusion must be backwards compabile with all LTS versions |
20:19:06 | FromDiscord | <haxscramper> Is that correct? |
20:19:15 | FromDiscord | <haxscramper> E.g. 1.0.10, 1.2.6 and 1.4.2 |
20:19:25 | FromDiscord | <Privacy_Dragon> please can anyone tell me how to get libiup.so? or where does Nim search for it? |
20:19:41 | FromDiscord | <haxscramper> Have you installed it with your package manager? |
20:19:47 | FromDiscord | <Privacy_Dragon> no |
20:19:53 | disruptek | i wouldn't worry too much about fusion; i expect it to be reworked soon. |
20:19:54 | FromDiscord | <Privacy_Dragon> I don't have root access |
20:20:27 | FromDiscord | <haxscramper> disruptek: well, I dont care about fusion in particular, just matching.nim |
20:21:02 | disruptek | what i mean is, i wouldn't worry too much about supporting early versions. |
20:21:10 | FromDiscord | <haxscramper> I personally |
20:21:27 | FromDiscord | <juan_carlos> @haxscramper I had to add that because says unused, can u check on your branch https://github.com/nim-lang/fusion/blob/5c7d630bc33d9468ed971d0ea9025901de25d1fc/src/fusion/matching.nim#L2157 |
20:22:01 | FromDiscord | <haxscramper> oh, I didnt' know about `.used.` |
20:22:27 | FromDiscord | <juan_carlos> :) |
20:22:32 | FromDiscord | <haxscramper> Yes, it has some very annoying conditions to determine if it is used or not, so I left it as-as, will fix now |
20:24:26 | FromDiscord | <juan_carlos> You can even make the macro add .used if it must. |
20:28:03 | FromDiscord | <haxscramper> no, I'd rather reduce codegen when possible, but in case of `pos` and several others there is no other option |
20:29:53 | FromDiscord | <Privacy_Dragon> !@#$%^& I have much problems with nimble... |
20:29:59 | disruptek | weird. |
20:31:28 | FromDiscord | <Privacy_Dragon> Error: Unable to find `nim` binary - add to $PATH or use `--nim` |
20:33:45 | FromDiscord | <Privacy_Dragon> oh, now got it working |
20:33:52 | FromDiscord | <Privacy_Dragon> but still don't get iup working |
20:34:06 | FromDiscord | <haxscramper> Pushed now - no warnings (though I turned `ConvFromXtoItselfNotNeeded` off because right now I can't come with proper non-synthetic example that doesn't trigger this warning) |
20:34:25 | FromDiscord | <juan_carlos> Makes sense. |
20:34:32 | FromDiscord | <haxscramper> Since it would require building at leas three levels of OOP inheritance |
20:35:17 | * | Gustavo6046 quit (Quit: ZNC 1.7.5 - https://znc.in) |
20:36:10 | Zevv | mratsim: how's life @64k |
20:36:12 | * | Gustavo6046 joined #nim |
20:41:27 | FromDiscord | <j-james> Are the official Nim logos okay to use on websites that are about Nim, but not officially afflicted? |
20:41:36 | disruptek | yes. |
20:41:53 | * | abm joined #nim |
20:47:40 | FromDiscord | <Avatarfighter> :disruptek: |
20:48:15 | * | PrvDragon quit (Quit: Konversation terminated!) |
20:48:31 | FromDiscord | <dom96> :nimble: |
20:48:45 | Zevv | :huh: |
20:48:53 | disruptek | :goatlicking: |
20:49:44 | disruptek | leorize: seems like maybe github's macos actions fail correctly now? |
20:50:47 | * | lritter joined #nim |
21:18:10 | * | Gustavo6046 quit (Quit: ZNC 1.7.5 - https://znc.in) |
21:18:34 | * | Gustavo6046 joined #nim |
21:23:16 | * | Vladar quit (Quit: Leaving) |
21:27:38 | * | narimiran quit (Ping timeout: 264 seconds) |
21:28:45 | * | xet7 quit (Quit: Leaving) |
21:37:48 | * | lritter quit (Quit: Leaving) |
21:38:18 | * | lritter joined #nim |
21:40:45 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2KLK |
21:40:53 | FromDiscord | <fwsgonzo> but: ffi.nim(36, 23) Error: expression has no address; maybe use 'unsafeAddr' |
21:41:46 | FromDiscord | <exelotl> yes, because resp is a `let` var, it's considered immutable so you can't use `addr` with it |
21:43:11 | FromDiscord | <exelotl> if you're planning to mutate it via the pointer, you should change it to var, otherwise you can use resp[0].unsafeAddr |
21:45:19 | FromDiscord | <fwsgonzo> ok thanks 🙂 |
21:56:02 | FromDiscord | <fwsgonzo> works fine, its just zippy erroring out with something |
21:57:22 | * | PMunch joined #nim |
22:10:07 | * | lritter quit (Quit: Leaving) |
22:11:01 | FromDiscord | <fwsgonzo> does Nim call something eq to abort_message when it throws? |
22:11:17 | FromDiscord | <fwsgonzo> fprintf(stderr into exit 1? |
23:16:03 | * | tane quit (Remote host closed the connection) |
23:26:45 | FromDiscord | <fwsgonzo> well i found the problem |
23:26:59 | FromDiscord | <fwsgonzo> apparently exceptions require a 262kb allocation |
23:27:05 | FromDiscord | <fwsgonzo> in my 64kb env 🙂 |
23:27:18 | PMunch | Are you also doing embedded stuff? |
23:27:42 | FromDiscord | <fwsgonzo> HTTP caches handle 20k clients concurrently |
23:28:29 | FromDiscord | <fwsgonzo> 64kb is 1.25 GB of workspace |
23:29:59 | FromDiscord | <fwsgonzo> its not a matter of having the memory either, its a matter of not trashing the caches for every single instruction |
23:33:04 | FromDiscord | <fwsgonzo> and while i dont expect regular code to throw, its important to be able to catch it so that we can see what went wrong |
23:33:25 | FromDiscord | <fwsgonzo> is it a worst-case type of single allocation? |
23:35:40 | disruptek | that sounds nuts. |
23:35:52 | disruptek | which gc are you using? |
23:36:01 | FromDiscord | <fwsgonzo> ORC |
23:36:16 | disruptek | why not arc? |
23:36:18 | FromDiscord | <fwsgonzo> it might be zippy that does the allocation, I'm still trying to figure things out |
23:38:43 | disruptek | clyybber: do we care about arc being bug-free on clang? |
23:39:26 | disruptek | i just learned that skiplists fails on osx in 1.4 and 1.5. |
23:39:43 | FromDiscord | <fwsgonzo> https://github.com/guzba/zippy/issues/3↵that's what I get for not checking the issues |
23:39:47 | disbot | ➥ [bug] Compression failing when building on a 32-bit machine ; snippet at 12https://play.nim-lang.org/#ix=2KMb |
23:40:03 | FromDiscord | <fwsgonzo> ill change to 64-bit VMs 🙂 |
23:45:33 | Zoom[m] | Hey, PMunch, do you run Nim on 8266? I almost started to dig into elcritch/nesper but then I found out the board I have is ESP8266, not ESP32 :P |
23:45:46 | PMunch | Indeed |
23:45:52 | PMunch | Or at least that's what I'm trying to do |
23:46:03 | PMunch | I have managed to get it working now, but exceptions are still missing |
23:46:33 | PMunch | But it might be that the ESP8266 Arduino libraries simply doesn't support them |
23:46:56 | Zoom[m] | There's a bunch of various SDKs and some half-finished wrappers for Nim. What do you use? |
23:47:08 | PMunch | Just custom stuff |
23:47:17 | PMunch | The idea is to standardise it |
23:47:23 | PMunch | But it's tricky |
23:48:01 | PMunch | This is what I have so far: http://ix.io/2KMc |
23:50:12 | PMunch | Oh woops |
23:50:15 | PMunch | Slight error in that |
23:51:13 | Zoom[m] | That's nice. I wouldn't know where to start |
23:51:17 | PMunch | There: http://ix.io/2KMh |
23:51:48 | PMunch | espmake is from makeEspArduino |
23:53:59 | Zoom[m] | Did you see some espressif repos where they mention they plan to converge on more or less unified SDK for EPS32 and 8266? |
23:58:24 | PMunch | Haven't seen that, but then I haven't been looking for that either |