00:07:49 | * | NimBot joined #nim |
00:11:06 | * | Guest61421 quit (Ping timeout: 256 seconds) |
00:15:39 | * | dadada joined #nim |
00:16:02 | * | dadada is now known as Guest5889 |
00:23:13 | FromDiscord | <Technisha Circuit> ~~Is there a brainfuck to nim interpreter?~~ |
00:23:23 | Yardanico | https://github.com/def-/nim-brainfuck |
00:23:25 | FromDiscord | <Technisha Circuit> (edit) 'brainfuck' => 'nim' | 'nim' => 'BrainFuck' |
00:23:34 | FromDiscord | <Technisha Circuit> I meant the other way rounf |
00:23:36 | FromDiscord | <Technisha Circuit> Round* |
00:23:45 | Yardanico | search for "c to brainfuck" |
00:23:49 | Yardanico | or "js to brainfuck" |
00:23:56 | Yardanico | if you find something - then you can maybe use it with nim |
00:30:47 | FromDiscord | <exelotl> C -> brainfuck -> Nim |
00:30:54 | FromDiscord | <exelotl> nimterop is solved |
00:30:54 | Yardanico | nah |
00:31:02 | Yardanico | what he wants is Nim -> C -> brainfuck :D |
00:32:56 | Yardanico | btw, is there a way to have doc comments for different branches of an object variant? |
00:41:48 | FromDiscord | <codic> how do I get an iterable object (seq or array) out of the contents of a directory? |
00:42:17 | FromDiscord | <codic> i'm trying to get all assets auto served for my jester site (if there's a better way, lemme know) |
00:45:03 | Yardanico | nginx |
00:45:13 | Yardanico | and make it understand the folder like "/public" |
00:51:17 | * | gangstacat quit (Quit: Ĝis!) |
00:53:55 | FromDiscord | <codic> nginx isn't nim.. |
00:54:29 | FromDiscord | <codic> ah. there's os.walkDir and walkDirRec |
00:54:51 | * | Guest5889 quit (Ping timeout: 265 seconds) |
00:55:01 | Yardanico | did some progress on my tl scheme definition -> nim types :P |
00:55:02 | Yardanico | https://gist.github.com/Yardanico/dd5f0d564fe371eab62ea59441d1d1ef |
00:55:13 | Yardanico | (that file has a few hand modifications but it actually works) |
00:56:22 | * | lritter quit (Ping timeout: 256 seconds) |
00:57:16 | * | lritter joined #nim |
00:57:25 | * | avatarfighter joined #nim |
00:58:45 | FromDiscord | <codic> aw, does anyone know why nim says get is undeclared inside the for block here? https://hatebin.com/gimqwsnnmj |
00:58:56 | * | muffindrake joined #nim |
00:59:13 | Yardanico | uhh that's not how it works really |
00:59:26 | Yardanico | jester transforms all routes at compiletime |
01:00:30 | FromDiscord | <codic> oh. welp :/ |
01:00:31 | * | dadada joined #nim |
01:00:49 | FromDiscord | <codic> so how would i do it instead? |
01:01:13 | * | dadada is now known as Guest14341 |
01:06:04 | bung_ | route your asset as pattern match |
01:06:39 | bung_ | no need recursivly loop your assets dir |
01:13:37 | bung_ | in production you just need nginx |
01:18:39 | * | gangstacat joined #nim |
01:22:07 | * | chemist69 quit (Ping timeout: 260 seconds) |
01:24:06 | * | chemist69 joined #nim |
01:24:14 | * | Guest14341 quit (Ping timeout: 240 seconds) |
01:30:41 | * | dadada__ joined #nim |
01:36:52 | FromDiscord | <codic> could you show an example? |
01:38:40 | FromDiscord | <codic> @FromIRC:bung_ |
01:39:37 | Yardanico | you don't need to ping him like that |
01:39:53 | Yardanico | on IRC highlights are client-side so you just need to have "bung_" somewhere in your message usually |
01:43:09 | * | endragor joined #nim |
01:43:17 | * | nphg joined #nim |
01:44:54 | FromDiscord | <codic> ah, alright. |
01:45:36 | * | nphg1 quit (Ping timeout: 265 seconds) |
01:47:16 | * | oz` joined #nim |
01:48:33 | * | oz quit (Quit: EOF) |
01:48:34 | * | oz` is now known as oz |
01:52:39 | bung_ | some example https://github.com/bung87/nginx_supervisor_tornado/blob/master/etc/nginx/nginx.conf |
01:54:46 | * | dadada__ quit (Ping timeout: 260 seconds) |
01:56:10 | bung_ | I checked the jester readme you can just using regex as route pattern |
01:56:25 | FromDiscord | <codic> > route your asset as pattern match↵I was talking about this, I'm not sure how to do this. do I need the whole nginx? |
01:56:32 | FromDiscord | <codic> just for this small thing? |
01:56:44 | Yardanico | no |
01:56:52 | Yardanico | https://github.com/dom96/jester#regex |
01:57:25 | bung_ | yeah if you just play for fun using regex is fit your case |
01:58:09 | avatarfighter | Is there a way to verify if the future of AsyncHttpClient.downloadFile has completed? |
01:58:11 | FromDiscord | <codic> Do you have an example though? |
01:58:42 | avatarfighter | My callbacks to the future from downloadFile don't seem to be calling when the file is done downloading so I'm not sure what to do |
01:59:04 | Yardanico | avatarfighter: there's a finished proc |
01:59:12 | Yardanico | https://nim-lang.org/docs/asyncfutures.html#finished |
01:59:28 | Yardanico | also how do you start the future itself? |
01:59:39 | Yardanico | maybe it throws an exception but it's just swallowed if you have a custom callback |
01:59:44 | bung_ | I dont have |
02:00:08 | bung_ | another option , if you'd like serve your assert in another server |
02:00:10 | bung_ | https://github.com/h3rald/nimhttpd |
02:00:18 | avatarfighter | Yardanico: I'm starting the future itself by awaiting the downloadFile proc I don't know if that's the correct thing to do |
02:00:34 | * | dadada__ joined #nim |
02:04:18 | * | wowaname joined #nim |
02:05:43 | avatarfighter | ok nevermind the futures do complete, I managed to write a while loop that never loops lmao |
02:07:35 | * | opal quit (Quit: i'm never coming back) |
02:10:29 | Yardanico | ok made my nigram repo public - https://github.com/Yardanico/nigram - no readme yet, code is in a pretty rough shape for now :) |
02:10:41 | Yardanico | the generated file itself is https://github.com/Yardanico/nigram/blob/master/src/tdlib_types.nim by the way |
02:10:54 | * | wowaname quit (Quit: i'm never coming back) |
02:12:43 | * | opal joined #nim |
02:15:14 | bung_ | why named it nigram, looks like search engine technic... |
02:15:20 | Yardanico | bung_: ? |
02:15:23 | Yardanico | nim + telegram = nigram |
02:15:34 | bung_ | lol |
02:15:36 | Yardanico | i can rename it later |
02:15:59 | FromDiscord | <codic> so with jester, can i use a wildcard like `/*.png`? |
02:16:05 | Yardanico | with regex - sure |
02:16:22 | FromDiscord | <codic> howd that look? |
02:17:37 | * | Senketsu quit (Ping timeout: 264 seconds) |
02:18:00 | FromDiscord | <codic> i'd guess `get re"/.\.png/": resp(readFile(request.matches[0]))` or something? but idk |
02:19:12 | bung_ | you may jusst need ^assets/ |
02:20:10 | FromDiscord | <codic> but what about everything after the colon? the response? |
02:20:15 | bung_ | then send whatever file under that dir, also given a mime type |
02:20:44 | bung_ | that's basic static server logic |
02:20:56 | FromDiscord | <codic> `get re"^assets/": resp(readFile(request.matches[0]))` |
02:21:23 | FromDiscord | <codic> oh wait! |
02:21:26 | FromDiscord | <codic> sent a long message, see http://ix.io/2nmg |
02:21:26 | FromDiscord | <codic> that solves my problem |
02:21:42 | Yardanico | :P |
02:22:24 | bung_ | oh there's public dir , then it be simple. |
02:23:01 | FromDiscord | <codic> aaaaaand it works well! |
02:23:11 | FromDiscord | <codic> wait, i have a crazy idea |
02:23:35 | FromDiscord | <codic> could i use setStaticDir and pass `.` for the current directory, to auto load html files as well? |
02:23:59 | Yardanico | well they are static files aren't they |
02:24:18 | FromDiscord | <codic> yup |
02:24:37 | bung_ | that depends whether it expand the path to absolute path |
02:24:47 | * | dadada__ quit (Ping timeout: 260 seconds) |
02:30:40 | * | dadada joined #nim |
02:31:03 | * | dadada is now known as Guest70920 |
02:31:12 | * | muffindrake quit (Ping timeout: 260 seconds) |
02:33:28 | * | muffindrake joined #nim |
02:46:42 | * | avatarfighter quit (Ping timeout: 260 seconds) |
02:54:30 | * | Guest70920 quit (Ping timeout: 258 seconds) |
02:57:37 | FromDiscord | <Ahlin Chan> how to check if a method exists in `type` |
02:58:35 | FromDiscord | <Ahlin Chan> sent a code paste, see http://ix.io/2nml |
03:00:02 | FromDiscord | <Ahlin Chan> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/714674174756388897 |
03:00:34 | FromDiscord | <flywind> sent a code paste, see http://ix.io/2nmm |
03:00:35 | * | dadada joined #nim |
03:01:13 | * | dadada is now known as Guest14223 |
03:01:17 | FromDiscord | <Ahlin Chan> is there a wat instead of catching the errors ? |
03:01:23 | FromDiscord | <Ahlin Chan> (edit) 'wat' => 'way' |
03:01:44 | FromDiscord | <Elegant Beef> Listen to your compiler 😄 |
03:04:40 | FromDiscord | <Ahlin Chan> okay thanks, i'm always looking for best way to achieve something. |
03:08:35 | FromDiscord | <Ahlin Chan> https://media.discordapp.net/attachments/371759389889003532/714676327332053002/unknown.png |
03:08:39 | FromDiscord | <Ahlin Chan> alright |
03:09:32 | FromDiscord | <Elegant Beef> You're using json for packets and have a proc for a specific json type? |
03:10:11 | FromDiscord | <Ahlin Chan> sent a code paste, see http://ix.io/2nmp |
03:10:17 | FromDiscord | <Ahlin Chan> (edit) 'http://ix.io/2nmp' => 'http://ix.io/2nmq' |
03:10:21 | FromDiscord | <Ahlin Chan> (edit) 'http://ix.io/2nmq' => 'https://discordapp.com/channels/371759389889003530/371759389889003532/714676720955031644' |
03:10:53 | FromDiscord | <Ahlin Chan> sorry about the pic above that was my mistake |
03:11:07 | FromDiscord | <Ahlin Chan> i compiled it again |
03:11:07 | FromDiscord | <Elegant Beef> What are you apolgizing about? |
03:11:19 | FromDiscord | <Ahlin Chan> about the ununsed var |
03:11:22 | * | nermik joined #nim |
03:11:31 | FromDiscord | <Elegant Beef> Oh go the humanity! |
03:11:33 | FromDiscord | <Elegant Beef> (edit) 'go' => 'god' |
03:19:52 | * | avatarfighter joined #nim |
03:21:14 | * | Tongir joined #nim |
03:23:46 | * | Tlanger quit (Ping timeout: 256 seconds) |
03:23:55 | * | chemist69 quit (Ping timeout: 272 seconds) |
03:24:24 | * | Guest14223 quit (Ping timeout: 258 seconds) |
03:24:32 | * | chemist69 joined #nim |
03:30:11 | * | silvernode joined #nim |
03:30:38 | * | dadada__ joined #nim |
03:32:48 | * | avatarfighter quit (Remote host closed the connection) |
03:32:59 | * | avatarfighter joined #nim |
03:38:37 | * | avatarfighter quit (Ping timeout: 260 seconds) |
03:39:23 | * | silvernode quit (Quit: Leaving) |
03:39:39 | * | nermik quit (Ping timeout: 245 seconds) |
04:03:33 | * | avatarfighter joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:42 | * | supakeen joined #nim |
04:31:21 | bung_ | how to test async server? can be done in same process? |
04:53:43 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:59:45 | * | greenfork joined #nim |
05:05:28 | FromDiscord | <Elegant Beef> Can nim archive create a zip file, i know it has a bunch of low level exposed logic, but uncertain if it does make archives? |
05:11:27 | bung_ | zip lib has the api |
05:26:25 | * | zacharycarter joined #nim |
05:30:50 | * | zacharycarter quit (Ping timeout: 260 seconds) |
05:32:02 | * | dddddd quit (Ping timeout: 260 seconds) |
05:32:04 | * | xet7 quit (Quit: Leaving) |
05:38:18 | * | dadada__ quit (Ping timeout: 260 seconds) |
05:45:41 | * | dadada joined #nim |
05:46:04 | * | dadada is now known as Guest66426 |
05:48:02 | * | xet7 joined #nim |
05:56:33 | * | lritter quit (Quit: Leaving) |
06:09:37 | * | Guest66426 quit (Ping timeout: 258 seconds) |
06:14:45 | shashlick | Yes libarchive can do anything with archives |
06:15:25 | shashlick | High level Nim api isn't available yet but you can port any existing libarchive example |
06:15:35 | * | dadada joined #nim |
06:16:02 | * | dadada is now known as Guest78892 |
06:24:13 | * | tdc joined #nim |
06:27:31 | * | solitudesf joined #nim |
06:27:32 | * | Faulander quit (Read error: Connection reset by peer) |
06:27:59 | * | Faulander joined #nim |
06:34:18 | * | FromDiscord quit (Remote host closed the connection) |
06:34:33 | * | FromDiscord joined #nim |
06:39:12 | * | Guest78892 quit (Ping timeout: 256 seconds) |
06:41:26 | * | endragor quit (Remote host closed the connection) |
06:45:37 | * | dadada__ joined #nim |
06:55:35 | * | fredrikhr joined #nim |
06:56:11 | * | endragor joined #nim |
06:59:36 | * | liblq-dev joined #nim |
07:07:30 | * | avatarfighter quit (Quit: Leaving) |
07:09:27 | * | dadada__ quit (Ping timeout: 260 seconds) |
07:15:37 | * | dadada joined #nim |
07:16:02 | * | dadada is now known as Guest25955 |
07:19:46 | * | Tlanger joined #nim |
07:22:31 | * | Tongir quit (Ping timeout: 260 seconds) |
07:28:18 | FromDiscord | <jasonfi> for zero-copy string slices which issue # can I track? |
07:28:35 | FromDiscord | <jasonfi> there's an RFC: https://github.com/nim-lang/RFCs/issues/12 |
07:28:36 | disbot | ➥ [RFC] View/slice |
07:28:43 | * | B4s1l3 joined #nim |
07:28:54 | * | B4s1l3 is now known as opDispatch |
07:29:11 | FromDiscord | <jasonfi> but does issue #178 cover string slices? |
07:29:18 | FromDiscord | <jasonfi> mentioned at the end of the RFC |
07:32:47 | leorize | yes it will |
07:32:59 | leorize | in fact there's a limited version of it that you can use atm |
07:33:10 | leorize | toOpenArray() allows zero-copy slices |
07:35:55 | * | Vladar joined #nim |
07:37:58 | * | arecaceae joined #nim |
07:39:49 | * | Guest25955 quit (Ping timeout: 264 seconds) |
07:43:21 | FromDiscord | <jasonfi> ok thanks |
07:45:40 | * | dadada__ joined #nim |
08:09:31 | * | dadada__ quit (Ping timeout: 256 seconds) |
08:11:25 | * | sschwarzer joined #nim |
08:11:57 | * | sschwarzer quit (Client Quit) |
08:13:46 | * | PMunch joined #nim |
08:15:37 | * | dadada joined #nim |
08:16:02 | * | dadada is now known as Guest62594 |
08:18:04 | PMunch | Hmm, this program I'm interfacing with is calling a `deinit` procedure when it's done with the DLL. Is there something I should call in Nim to free all the memory it has taken up? GC_fullcollect only free unused memory, but I want to clean up absolutely everything. |
08:30:09 | FromDiscord | <Synth> Hello, I'm sorry but may I get some quick help? I am trying to convert a float into float64... how am I able to achieve this? |
08:32:52 | FromDiscord | <Rika> theFloat.float64 @Synth |
08:33:32 | FromDiscord | <Synth> Ohh thank you |
08:33:56 | Zevv | or float64(theFloat), whichever you prefer |
08:35:24 | * | neceve joined #nim |
08:35:29 | PMunch | Or `float64 theFloat` for that matter |
08:35:46 | PMunch | Although I personally prefer `theFloat.float64` |
08:36:14 | FromDiscord | <Synth> Thanks! |
08:38:32 | PMunch | This goes for any valid type conversion by the way |
08:39:13 | * | Guest62594 quit (Ping timeout: 246 seconds) |
08:44:21 | PMunch | Hmm, so for NimScript paramCount and paramStr is the same as the ones that Nim gets fed? |
08:45:13 | liblq-dev | PMunch: FYI `theFloat.float64` doesn't work that well with generic instantiations |
08:45:27 | PMunch | What do you mean? |
08:45:31 | * | dadada__ joined #nim |
08:45:33 | liblq-dev | sometimes it can glitch out and tell you that `theFloat` does not have a field `float64` |
08:45:41 | liblq-dev | and you have to use `float64(theFloat)` |
08:45:47 | PMunch | Ah, yeah that's the only time I tend to use that syntax |
08:45:52 | liblq-dev | same |
08:48:02 | FromDiscord | <Synth> I'm sorry, maybe I get help again? I'm trying to make a progress bar's value change inside a for loop via onButtonClick event but it's telling me that the variable progressbar is immutable although it's declared as a `var`... example can be seen here: https://github.com/trustable-code/NiGui/blob/master/examples/example_02_controls.nim |
08:48:24 | FromDiscord | <Rika> what line |
08:49:33 | FromDiscord | <Synth> On line 26, see how it has: `progressBar.value = 0.5`? |
08:49:55 | FromDiscord | <Synth> I want to change the value as it iterates inside a forloop. However, it's telling me that it's immutable |
08:50:51 | FromDiscord | <Rika> uh |
08:50:56 | FromDiscord | <Rika> no idea 😛 |
08:51:48 | FromDiscord | <Synth> ;-; |
08:52:02 | FromDiscord | <Synth> Should I open an issue? |
08:52:26 | FromDiscord | <Synth> I tried declaring the value as a mutable variable and then changing that afterwards but didn't work either |
08:54:46 | FromDiscord | <Rika> hm |
08:54:55 | FromDiscord | <Rika> you might just be using it wrongly 😛 |
08:55:29 | FromDiscord | <Synth> Hmm... |
08:55:36 | FromDiscord | <Synth> I don't think I am... |
08:55:41 | FromDiscord | <Synth> I'm opening an issue haha |
08:57:52 | PMunch | Synth, do you have a code snippet? |
08:58:35 | PMunch | Looking at this Reddit thread I'm wondering why NimScript doesn't wrap `paramCount` and `paramStr` in a more sensible way: https://www.reddit.com/r/nim/comments/gqjuaf/nimscript_struggles_invalid_integer/ |
08:59:30 | PMunch | It should be trivial to have it only count arguments to the script, and not to nim itself.. |
09:00:16 | * | Tongir joined #nim |
09:02:40 | * | Tlanger quit (Ping timeout: 246 seconds) |
09:03:11 | * | kenran joined #nim |
09:09:13 | * | dadada__ quit (Ping timeout: 264 seconds) |
09:09:21 | * | abm joined #nim |
09:10:51 | * | Vladar quit (Quit: Leaving) |
09:14:51 | * | leorize quit (Quit: WeeChat 2.7.1) |
09:15:36 | * | dadada joined #nim |
09:16:02 | * | dadada is now known as Guest86196 |
09:17:18 | * | leorize joined #nim |
09:21:18 | FromDiscord | <él liquido> https://media.discordapp.net/attachments/371759389889003532/714770119498137610/unknown.png |
09:21:21 | FromDiscord | <él liquido> I like how nim doc preserves my alignment |
09:25:31 | FromDiscord | <flywind> When you don't have comments, it doesn't preserve alignment. |
09:26:12 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/714771357958799471/unknown.png |
09:29:40 | FromDiscord | <Rika> strip trailing whitespace T_T |
09:32:15 | FromDiscord | <flywind> Striping trailing whitespace has the same result. It needs more hacks to get result as below. |
09:32:20 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/714772899805790228/unknown.png |
09:32:54 | FromDiscord | <Rika> i was just criticizing |
09:33:03 | FromDiscord | <Rika> not saying it would fix the issue |
09:34:59 | FromDiscord | <él liquido> @flywind just document your code well :kappa: |
09:35:07 | FromDiscord | <él liquido> how'd you achieve that result? |
09:35:14 | FromDiscord | <él liquido> manually edited the HTML? |
09:38:46 | FromDiscord | <flywind> @él liquido I don't do it. My friend tulayang use `javascript` to adjust output format. It is used by `netkit`. |
09:39:18 | * | Guest86196 quit (Ping timeout: 258 seconds) |
09:40:25 | FromDiscord | <flywind> https://github.com/iocrate/netkit/tree/master/tools/docplus |
09:43:01 | FromDiscord | <flywind> It relays on nodejs. |
09:45:40 | * | dadada__ joined #nim |
09:46:22 | PMunch | That's why I believe we should develop the jsondoc further |
09:46:42 | PMunch | That way it would be trivial to create other kinds of doc representations |
09:46:54 | PMunch | (although it wouldn't be able to copy in-code alignment) |
09:56:28 | * | fredrikhr quit (Ping timeout: 256 seconds) |
10:09:07 | * | disruptek quit (Ping timeout: 260 seconds) |
10:09:30 | * | disbot quit (Ping timeout: 256 seconds) |
10:12:29 | * | disruptek joined #nim |
10:12:57 | * | disbot joined #nim |
10:20:48 | * | Tlanger joined #nim |
10:23:32 | * | Tongir quit (Ping timeout: 272 seconds) |
11:11:25 | * | Vladar joined #nim |
11:13:01 | * | Senketsu joined #nim |
11:20:46 | * | fredrikhr joined #nim |
11:26:02 | * | dddddd joined #nim |
11:34:20 | * | hvn joined #nim |
11:40:35 | PMunch | Is there any ETA on the next Nim version? Even a super rough one? |
11:41:17 | FromDiscord | <Rika> idk but theyre scheduled afaik |
11:41:34 | PMunch | It looks a bit iffy to have `choosenim devel` in my Nim builder docker container that builds our production code.. |
11:41:52 | PMunch | But I need the fixes I applied to OpenSSL |
11:42:57 | * | Vladar quit (Remote host closed the connection) |
11:43:14 | * | Vladar joined #nim |
11:44:07 | FromDiscord | <Rika> backport when |
11:44:31 | PMunch | Yeah I guess I could |
11:54:06 | * | zacharycarter joined #nim |
11:58:22 | * | zacharycarter quit (Ping timeout: 246 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:41 | * | supakeen joined #nim |
12:22:55 | liblq-dev | sometimes I really like that Nim has the convenience consts `on` and `off` |
12:27:29 | * | zacharycarter joined #nim |
12:31:37 | * | zacharycarter quit (Ping timeout: 246 seconds) |
12:32:05 | PMunch | Hmm, anyone remember the thing that allows you to not retype your generics over and over? |
12:38:41 | * | endragor quit (Remote host closed the connection) |
12:39:18 | alehander92 | just not typing `[]` ? |
12:39:33 | alehander92 | proc a(b: seq): int = .. |
12:41:39 | PMunch | That can be a seq of anything though |
12:42:07 | PMunch | I have a type "Cache[X, Y, strat: static[CacheStrategy]]" and I want to not have to type all that |
12:42:25 | alehander92 | does `using` work? |
12:42:28 | alehander92 | with generics |
12:42:49 | alehander92 | you can also just write .. a template which aliases it |
12:44:24 | PMunch | Hmm, using was the one I was thinking about |
12:45:41 | alehander92 | yeah its good |
12:46:25 | PMunch | Hmm, doesn't seem to work with generics: https://play.nim-lang.org/#ix=2nog |
12:49:13 | * | dadada__ quit (Ping timeout: 265 seconds) |
12:50:47 | * | dadada joined #nim |
12:51:11 | * | dadada is now known as Guest37650 |
12:51:30 | alehander92 | then you can use template |
12:54:32 | liblq-dev | are hashes guaranteed to be consistent across different builds? |
12:57:35 | liblq-dev | nvm it doesn't matter for me anyways |
12:57:44 | PMunch | alehander92, a template? |
12:57:49 | liblq-dev | after rethinking this |
12:59:34 | alehander92 | well |
12:59:40 | alehander92 | which just returns the type name |
12:59:52 | alehander92 | so you just write `test: t()` |
13:03:32 | * | Senketsu quit (Ping timeout: 260 seconds) |
13:04:14 | FromDiscord | <Technisha Circuit> Is it possible to import a file from a variable? |
13:04:28 | FromDiscord | <Recruit_main707> why? |
13:05:41 | alehander92 | only from compile time variable |
13:05:55 | alehander92 | otherwise, "why" indeed :) |
13:06:04 | FromDiscord | <Technisha Circuit> > why?↵@Recruit_main707 for my Dimscord command handler |
13:08:09 | * | zacharycarter joined #nim |
13:35:08 | * | couven92 joined #nim |
13:35:08 | * | fredrikhr quit (Disconnected by services) |
13:35:14 | * | couven92 is now known as fredrikhr |
13:36:02 | FromDiscord | <Yardanico> Yes, just pass a static compile time string to a macro which makes an import statement |
13:40:09 | * | couven92 joined #nim |
13:40:47 | * | fredrikhr quit (Disconnected by services) |
13:40:52 | * | couven92 is now known as fredrikhr |
13:41:08 | * | couven92 joined #nim |
13:43:32 | * | kenran quit (Quit: leaving) |
13:44:44 | * | FromDiscord quit (Remote host closed the connection) |
13:45:00 | * | FromDiscord joined #nim |
13:47:45 | * | fredrikhr quit (Disconnected by services) |
13:47:50 | * | couven92 is now known as fredrikhr |
13:48:10 | * | couven92 joined #nim |
13:49:02 | * | couven92 quit (Read error: Connection reset by peer) |
14:08:35 | PMunch | Why can't I use my X generic here? https://play.nim-lang.org/#ix=2noD |
14:09:29 | Araq | good question |
14:10:41 | * | couven92 joined #nim |
14:15:02 | Yardanico | is it a limitation of how much analysis the compiler can do for this case? https://gist.github.com/Yardanico/a5ea2070abf0e1bbf261a4d494c8d94c |
14:15:46 | Yardanico | I mean it's just a minor thing, I can always just write "default(mytype)" after the call which will raise |
14:16:38 | Yardanico | ah right, I can just annotate proc with noreturn explicitly |
14:17:46 | * | AliceT joined #nim |
14:19:45 | * | fredrik92 joined #nim |
14:20:02 | * | fredrik92 quit (Remote host closed the connection) |
14:21:12 | FromDiscord | <Rika> what happens if you overload `default`? ive always wondered |
14:21:14 | * | hvn quit (Ping timeout: 240 seconds) |
14:21:40 | Yardanico | as you would expect |
14:21:46 | Yardanico | you'll shadow the default "default" :P |
14:21:53 | FromDiscord | <Pat> Nim is a straight up beast... 🎙️ |
14:22:07 | * | AliceT quit (Client Quit) |
14:22:08 | Yardanico | https://play.nim-lang.org/#ix=2noJ |
14:22:40 | Yardanico | remove default proc -> it becomes 0 |
14:23:05 | Yardanico | of course it will only work in the current module, not in system or somewhere else |
14:23:18 | Yardanico | I mean if system calls default for int it'll still get 0 probably |
14:23:37 | * | couven92 quit (Ping timeout: 264 seconds) |
14:23:42 | PMunch | Yeah, it doesn't override the actual default value: https://play.nim-lang.org/#ix=2noK |
14:24:13 | PMunch | @Pat, anything in particular you were thinking about? |
14:29:31 | Yardanico | uhh lol |
14:30:06 | PMunch | Uhm.. |
14:30:16 | PMunch | I have an iterator in a library |
14:30:18 | Yardanico | seems like I found another destructors bug :P |
14:30:28 | PMunch | It accesses a DoublyLinkedList from an object and iterator over those in order |
14:30:31 | Yardanico | at least this time it's not related to leaks/,memory |
14:30:47 | PMunch | Now in my test I try to use this iterator, but I have to import the "lists" module for it to work.. |
14:31:27 | * | zacharycarter quit (Ping timeout: 256 seconds) |
14:32:16 | PMunch | The curious think is that nimlsp doesn't see the error, and when I add the import it says that the import is unused :P |
14:32:22 | FromDiscord | <Rika> sounds like a bug or something\ |
14:32:39 | Yardanico | PMunch: oh yeah, sometimes the unused import warning is incorrect |
14:33:13 | PMunch | But it should still be invalid right? |
14:33:28 | PMunch | Err, it should still have worked without importing the lists module right? |
14:33:37 | PMunch | I include the lists module where I create the iterator |
14:38:52 | disruptek | PMunch: no, it shouldn't have worked. |
14:39:09 | disruptek | wait, what? |
14:39:11 | Yardanico | PMunch: if you want it to work you need to import lists and export lists |
14:39:19 | Yardanico | oh, an iterator |
14:39:22 | disruptek | you created the iterator? |
14:39:24 | Yardanico | hmm, maybe due to the fact that they're inlined? |
14:39:43 | disruptek | shouldn't matter. |
14:40:18 | disruptek | can we see some code? |
14:42:19 | PMunch | Of course, here is the iterator: https://github.com/PMunch/nim-cache/blob/master/src/cache.nim#L105, and here I use it: https://github.com/PMunch/nim-cache/blob/master/tests/test1.nim#L91 |
14:42:25 | * | waleee-cl joined #nim |
14:42:49 | PMunch | Notice on line 5 in the test file I import the lists module |
14:43:00 | PMunch | Without it the test fails to compile on that line |
14:43:55 | disruptek | x.items |
14:44:39 | disruptek | it's madness to rely upon implicit items/pairs, imo. |
14:44:42 | Yardanico | disruptek: why? |
14:44:53 | disruptek | for exactly this reason. |
14:45:06 | Yardanico | for loops wouldn't exactly be so attractive if pairs/items weren't available implicitly |
14:45:14 | disruptek | how sad for you. |
14:45:20 | PMunch | Same error with .items |
14:45:24 | PMunch | I already tried that |
14:45:43 | disruptek | i don't believe you. 😁 |
14:45:53 | PMunch | Then download the repo and try yourself :P |
14:46:07 | PMunch | I literally just tried it |
14:46:42 | PMunch | http://ix.io/2noP |
14:47:13 | PMunch | And I agree with Yardanico, implicit is very nice |
14:49:32 | disruptek | looks to me like the error message is correct. |
14:49:42 | Yardanico | disruptek: it's not though? at all |
14:49:52 | Yardanico | cache.nim actually imports lists |
14:50:00 | Yardanico | but test1.nim doesn't |
14:50:02 | disruptek | DoublyLinkedList entries are DoublyLinkedNodes. |
14:50:07 | disruptek | rtfm |
14:50:17 | PMunch | Yeah, so? |
14:50:31 | Yardanico | disruptek: I don't really understand why exactly you're trying to argue about this, sorry :) |
14:50:31 | PMunch | That's why I call .value on it in my iterator.. |
14:50:59 | disruptek | oh, i didn't see this cache.nim iteration. |
14:51:23 | Yardanico | disruptek: https://nim-lang.org/docs/lists.html#items.i%2CSomeLinkedList%5BT%5D |
14:51:27 | PMunch | I have a list in my object, I want to expose an iterator for my object. I iterate over the DoublyLinkedList in my iterator and yield the values.. |
14:51:54 | PMunch | But to use this iterator I need to import the lists module |
14:52:14 | disruptek | required type for cache: items.X items.Y ??? |
14:52:22 | PMunch | Huh? |
14:52:40 | disruptek | required type for cache: Cache[items.X, items.Y, items.strat] |
14:52:52 | PMunch | What are you trying to do? |
14:53:58 | disruptek | trying to understand this error message. |
14:55:14 | PMunch | Here is a more minimal test that shows the error: http://ix.io/2noS |
14:56:22 | PMunch | Oh right, that "required type for cache: Cache[items.X, items.Y, items.strat]" just shows you the iterator it just called |
14:56:35 | disruptek | yeah. |
14:56:38 | PMunch | This one "minimal.nim(13, 14) template/generic instantiation of `items` from here" |
14:57:03 | disruptek | the question is why the other overload wins. |
14:57:13 | PMunch | But the one it should call is the one from the lists module for a DoublyLinkedList (or rather for SomeLinkedList) |
14:57:43 | * | NimBot joined #nim |
14:57:46 | PMunch | It's not in the list, and if it was it should've just worked right? |
14:58:01 | disruptek | that's what i mean; it's shadowing it. |
14:58:20 | PMunch | I don't think that's the issue.. |
14:58:35 | disruptek | why not? |
14:58:53 | PMunch | Because my items doesn't have anywhere near the same signature as the one for a list.. |
14:59:43 | PMunch | I'd guess the issue is somewhere between all the generics I use in the Cache object and that the iterator for a DoublyLinkedList uses SomeLinkedList as its argument |
15:00:37 | disruptek | i can repro it using gram. |
15:00:39 | disruptek | !repo gram |
15:00:40 | disbot | https://github.com/disruptek/gram -- 9gram: 11lightweight generic graph hack 15 2⭐ 0🍴 7& 4 more... |
15:01:16 | disruptek | oh, i don't export items here, nevermind. |
15:01:59 | PMunch | In fact adding an iterator for DoublyLinkedList by just copying the `itemsListImpl` template from the lists module into cache.nim works fine. |
15:02:53 | * | zacharycarter joined #nim |
15:03:42 | PMunch | Hmm, but moving that implementation into its own mini-module and doing "import lists except items" and "import listext" didn't work |
15:03:56 | PMunch | Until I did "export listext.items |
15:04:12 | Yardanico | PMunch: seems to be related to static |
15:04:36 | * | zacharycarter quit (Client Quit) |
15:04:38 | * | cgfuh joined #nim |
15:04:44 | Yardanico | PMunch: small example to reproduce https://play.nim-lang.org/#ix=2noW |
15:04:59 | disruptek | works fine if you lists.items(cache.order), right? |
15:05:24 | Yardanico | disruptek: yes, but that's not the point |
15:05:27 | Yardanico | it should work otherwise too :) |
15:05:34 | disruptek | i agree. |
15:06:00 | PMunch | Ah, yes that does indeed work |
15:06:27 | Yardanico | even simpler example https://play.nim-lang.org/#ix=2noX |
15:06:34 | Yardanico | so yeah, PMunch go ahead and submit a bug report :P |
15:07:02 | PMunch | You're the one with the pretty, minimal examples :) |
15:07:24 | Yardanico | well, it's not hard to learn how to select code and press backspace :P |
15:07:33 | Yardanico | i wonder if it was already reported though |
15:07:49 | Yardanico | seems like it wasn't |
15:08:16 | * | federico3_ joined #nim |
15:08:47 | PMunch | Haha :P |
15:09:01 | PMunch | I've got to walk the dog now anyways, he's getting impatient |
15:09:15 | PMunch | Pushed disrupteks patch at least |
15:09:17 | PMunch | TTYL |
15:09:18 | * | PMunch quit (Quit: leaving) |
15:16:07 | Yardanico | submitted it for PMunch anyway :P https://github.com/nim-lang/Nim/issues/14459 |
15:16:09 | disbot | ➥ Compiler can't find generic ``items`` when iterating over a field in a generic object ; snippet at 12https://play.nim-lang.org/#ix=2np4 |
15:17:24 | * | federico3_ quit (Quit: WeeChat 2.8) |
15:18:09 | * | federico3_ joined #nim |
15:18:42 | * | Vladar quit (Quit: Leaving) |
15:18:44 | * | federico3_ quit (Client Quit) |
15:23:35 | Zevv | that's a funny one |
15:23:58 | disruptek | it's a sigmatch issue, most likely. |
15:24:15 | disruptek | damn module needs rewrite. |
15:24:24 | Yardanico | s/module/compiler |
15:25:49 | Araq | it has nothing to do with sigmatch and it's an old, known bug |
15:26:06 | FromDiscord | <Synth> Is there something like an fstring in Python in Nim? |
15:26:21 | FromDiscord | <Synth> So I can parse variables to a string? |
15:26:47 | Zevv | & |
15:26:57 | Yardanico | @Synth look into strformat module |
15:26:58 | FromDiscord | <Synth> Like:↵```py↵function(f"example {variable}")↵``` |
15:27:08 | FromDiscord | <Synth> Oh alright, thank you |
15:27:14 | Yardanico | !eval import strformat; let a = 5; echo fmt"Hello, {a}!" |
15:27:16 | NimBot | Hello, 5! |
15:27:30 | Zevv | use &, not fmt! :) |
15:27:38 | Yardanico | Zevv: because of escaping? :) |
15:27:47 | FromDiscord | <Synth> I'm confused ;-; |
15:27:54 | Yardanico | @Synth you should not forget that the expansion is done at compile-time though, so you can't have a format string based on runtime values |
15:28:06 | Yardanico | I mean stuff like let a = getUserInput(); fmt(a) wouldn't work |
15:28:08 | FromDiscord | <Synth> Ohh alright, thank you |
15:28:14 | Yardanico | @Synth https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp |
15:28:25 | FromDiscord | <Synth> What's the different between fmt and &? |
15:28:29 | Yardanico | check the link |
15:29:08 | Zevv | I find that paragraph misleading, as it says `The fmt"{expr}" syntax is more aesthetically pleasing` |
15:29:30 | FromDiscord | <Synth> Ahh okay, thank you! |
15:29:36 | Yardanico | Zevv: for some it is |
15:29:38 | Yardanico | for some it's not :P |
15:29:47 | Yardanico | I actually find myself preferring & though |
15:36:16 | * | Trustable joined #nim |
15:38:03 | * | sschwarzer joined #nim |
15:39:23 | FromDiscord | <Rika> you can always do `fmt "{expr}"` tho, no? |
15:39:32 | Yardanico | @Rika I meant this: |
15:39:53 | Yardanico | !eval import strformat; let a = 5; let b = "it's {a}"; echo fmt(a) |
15:39:54 | FromDiscord | <Rika> i mean the differences are gone when you add as tring |
15:39:57 | NimBot | Compile failed: /usercode/in.nim(1, 58) Error: type mismatch: got <int> |
15:39:57 | FromDiscord | <Rika> *space |
15:40:00 | FromDiscord | <Rika> not string |
15:40:05 | Yardanico | !eval import strformat; let a = 5; let b = "it's {a}"; echo fmt(b) |
15:40:07 | NimBot | Compile failed: /usercode/in.nim(1, 59) Error: string formatting (fmt(), &) only works with string literals |
15:40:11 | sschwarzer | I think I can work on the tree iterator again and was looking at ticket https://github.com/nim-lang/Nim/issues/11929 . You had a link in one of the comments, https://gist.github.com/disruptek/52ebcc5b02aa22781500369a0f95b739#file-walker-nim , but the link target doesn't exist anymore. |
15:40:12 | disbot | ➥ xmltree: offer a way to iterate over a whole tree (similar to `items`/`mitems`, but recursive) |
15:40:14 | Yardanico | oh okay it has failsafe for this |
15:40:33 | sschwarzer | oops, should have gone in the private chat :) |
15:40:58 | FromDiscord | <Rika> !eval import strformat; let a = 5; echo fmt "it's {a}\nnot escaped i hope" |
15:41:01 | NimBot | it's 5↵not escaped i hope |
15:53:03 | * | ftsf quit (Ping timeout: 260 seconds) |
15:57:19 | FromDiscord | <Technisha Circuit> Does Nim have something like Python decorators? |
15:58:27 | FromDiscord | <InventorMatt> pragmas take the spot there for nim plus they have the added benefit of being ablt to chain multiple of them |
15:58:58 | FromDiscord | <Technisha Circuit> Oh okay |
16:03:00 | FromDiscord | <Rika> i mean you can chain python decorators |
16:03:10 | FromDiscord | <Rika> but there's gonna be a lot of height taken |
16:07:22 | FromDiscord | <willyboar> ~stream |
16:07:23 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) |
16:08:08 | FromDiscord | <Clyybber> wow |
16:08:20 | FromDiscord | <Clyybber> just realized that NimNodes don't have ref semantics :D |
16:08:37 | * | elijahr joined #nim |
16:08:40 | FromDiscord | <Clyybber> wait |
16:09:24 | FromDiscord | <Clyybber> nevermind |
16:10:08 | * | elijahr quit (Client Quit) |
16:20:30 | * | tane joined #nim |
16:22:59 | FromDiscord | <Synth> Sorry, now I'm attempting to get the number of items generated by `product()` from itertools... anyone able to help me? |
16:23:17 | bung_ | do I need handle system manually? I write a test that doest not quit |
16:23:20 | FromDiscord | <Synth> (edit) 'Sorry, now I'm attempting to get the number of items generated by `product()` from itertools... anyone able to help me? ... ' => 'Sorry, now I'm attempting to get the number of items generated by `product()` from itertools... anyone able to help me?Here's the source: https://narimiran.github.io/itertools/#product.i%2CopenArray%5BT%5D%2CopenArray%5BU%5D' |
16:23:28 | Yardanico | @Synth product is an iterator |
16:23:28 | bung_ | system signal |
16:23:41 | Yardanico | to store the results and stuff you need to use sequtils.toSeq |
16:23:50 | Yardanico | like let data = toSeq(product(...)) |
16:23:58 | FromDiscord | <Synth> Oh I see, thank you so much! |
16:25:14 | * | PMunch joined #nim |
16:26:38 | sschwarzer | Synth: How much items do you (roughly) expect? If you use `toSeq` you'll create the sequence in memory and depending on the size you might not want to do this, especially if you're interested in _only_ the size. |
16:27:32 | sschwarzer | Synth: If your sequence would become large and you just need the number of combinations, you can multiply the lengths of the input sequences for `product`. |
16:32:29 | Yardanico | @Synth to ping him on discord :) |
16:32:50 | sschwarzer | Yardanico: thanks :) |
16:34:25 | FromDiscord | <Synth> A lot of items... haha |
16:34:29 | FromDiscord | <Synth> I mean, a lot |
16:38:19 | sschwarzer | @Synth: Then just multiply the input sizes. |
16:40:04 | FromDiscord | <Synth> I got it to work, thank you guys so much! |
16:40:12 | FromDiscord | <Synth> I'm pretty new to Nim and lately, I've been loving it |
16:40:22 | sschwarzer | Synth: You're welcome :) |
16:40:27 | FromDiscord | <Synth> I've tried Rust but I didn't like it... |
16:40:31 | FromDiscord | <Synth> It was too limiting haha |
16:40:53 | sschwarzer | Synth: I'm also relatively new. (Maybe not in months, but in the time I was able to spend on Nim stuff. ;-) ) |
16:41:42 | sschwarzer | Synth: I also had a look at Rust, but since I (for now) mostly want a language for rather small command line scripts, Rust seemed me just too much overhead. |
16:42:23 | sschwarzer | I'm quite familiar with Python, but was now looking for something with static type checks and compiled code. :) |
16:46:32 | * | greenfork quit (Ping timeout: 265 seconds) |
16:49:18 | * | BohlAdmin joined #nim |
16:55:54 | * | r4vi quit (Ping timeout: 265 seconds) |
16:56:22 | * | BohlAdmin quit (Quit: Pull the pin and count to what?) |
16:56:47 | alehander92 | ok |
17:03:35 | alehander92 | what should i play with from my nim projects learn-compiler(the parallel/IC/other experiment) or nimvm-debugger |
17:06:20 | * | couven92 joined #nim |
17:06:26 | alehander92 | learn |
17:06:45 | * | fredrikhr quit (Disconnected by services) |
17:06:51 | * | couven92 is now known as fredrikhr |
17:08:44 | * | couven92 joined #nim |
17:11:04 | FromDiscord | <zetashift> b-b-both? |
17:26:26 | * | r4vi joined #nim |
17:27:26 | sschwarzer | alehander: the debugger, debugging in Nim needs to improve :-) |
17:27:57 | sschwarzer | although debugging the compiled code hurts me most |
17:29:14 | alehander92 | what do you think is the biggest lack with debugging the compiled code? |
17:29:29 | alehander92 | my daily job is related to it (but its proprietary) |
17:31:12 | sschwarzer | alehander92: when I tried debugging my lazy tree iterator, the mental overhead of understanding the C/Nim datastructures was so big that I reverted to `echo`. I'm familiar with command line debuggers. (I use Python's `pdb` all the time.) |
17:31:35 | alehander92 | hm |
17:31:53 | alehander92 | have you tried e.g. gdb with sourcing nim-gdb.py from tools/ |
17:31:55 | sschwarzer | I mean I understood and could navigate the data structures, but it took so much of my concentration that the debugger really was an advantage |
17:32:11 | alehander92 | yeah, this makes perfect sense |
17:32:17 | sschwarzer | alehander: yes, gdb/nim-gdb.py was what I used. |
17:32:38 | alehander92 | so what was mostly missing compared to e.g. C/C++-printers/tools |
17:32:40 | sschwarzer | I meant that the debugger was _not_ an advantage |
17:32:54 | alehander92 | ah |
17:33:23 | sschwarzer | alehander: I wonder if you could improve the display of data structures so they look more what you'd think about on the "Nim level" |
17:33:43 | sschwarzer | alehander: Although I see that in some cases you really want the low-level stuff. |
17:34:02 | alehander92 | yeah, but maybe a more concrete example would be good |
17:34:11 | alehander92 | do you have somewhere the lazy tree lib |
17:35:40 | sschwarzer | alehander: my experiments so far: https://hg.sr.ht/~sschwarzer/vppdiff/browse/src/vppdiff/cleanxmi.nim . The iterator starts at line 39. |
17:36:20 | sschwarzer | But I'm now working on a different approach, namely with the conventional iterator pattern (with `hasNext` and `next`). |
17:37:53 | sschwarzer | alehander: I'm not even sure whether what I'd like is possible. I think _if_ it's possible the debugger would need to know a lot about the original Nim code and semantics (I guess) to understand what the user expects. |
17:38:03 | alehander92 | ah so its about inlining the iterator |
17:38:36 | sschwarzer | alehander: That too, but even with a different approach (without inlining) it was a problem. |
17:39:44 | alehander92 | i get it |
17:39:53 | * | oprypin_ joined #nim |
17:39:53 | alehander92 | i am sorry, i will look at it tomorrow mostly |
17:40:03 | * | oprypin quit (Ping timeout: 260 seconds) |
17:40:04 | * | FromGitter joined #nim |
17:40:36 | alehander92 | but i guess just seeing mostly iterator state somehow would be useful and maybe a way to invoke iteration easily from the debugger? |
17:41:12 | sschwarzer | alehander: I found it difficult to check the XML tree structure "on the C level" instead of being able to say something "echo toSeq(items(xmlNode))" |
17:41:25 | sschwarzer | alehander: also that, yes |
17:41:38 | alehander92 | yeah, so invoking the iterator would be useful |
17:41:56 | sschwarzer | alehander: Now I think what I want is a Nim repl inside the debugger. :-) |
17:42:06 | alehander92 | hehe, or just a nim repl :P |
17:42:16 | bung_ | xmlNode has a `$` proc doesnt it? |
17:42:18 | alehander92 | yeah, they converge a bit |
17:42:22 | sschwarzer | alehander: a Nim repl would _also_ help :) |
17:42:43 | alehander92 | yeah, btw bung_ is right: its not hard to make `$` easier to call in gdb |
17:42:47 | sschwarzer | bung_: yes, I don't remember right now if you can use it inside the debugger. |
17:42:55 | alehander92 | dollar__ are there |
17:43:13 | alehander92 | you need to loop and just map them using their typeinfo so a command can know which one to invoke |
17:43:14 | sschwarzer | alehander: as in `dollar__(myObject)`? |
17:43:19 | alehander92 | one can add that to nim-gdb |
17:43:25 | alehander92 | well like dollar__hash |
17:43:40 | bung_ | idk now , never debuging in nim |
17:43:45 | alehander92 | thats the thing, currently without this additional python command its annoying to filter for that |
17:43:53 | sschwarzer | alehander: essentially the "repl in the debugger" is what Python's debugger offers. |
17:43:57 | alehander92 | i wrote somthing like that for my job once |
17:44:48 | alehander92 | but toSeq(items()) should be also doable with just writing a simple myItems {.exportc.} which does it |
17:44:50 | alehander92 | and invoking it |
17:44:53 | sschwarzer | alehander: Ideally I'd like to be able to execute statements as they could have been written in the Nim source file in the respective scope. |
17:45:05 | alehander92 | i admit: a much more hardcoded thing, but for a workaround for now |
17:45:16 | alehander92 | yeah this is a good goal |
17:45:36 | alehander92 | in our project, we do something kinda similar (but just for some expressions, not statements) |
17:45:52 | alehander92 | maybe one can try to just add limited nim support to gdb? |
17:46:02 | alehander92 | i think they do have infrastructure for many languages |
17:46:12 | alehander92 | but no idea if this applies to setting variables / access |
17:46:14 | sschwarzer | for example, also `inc(counter)` and continue debugging to see what would happen with this extra increment. But as a first step, inspecting data "on the Nim level" would already be great (I think) |
17:46:26 | alehander92 | yeah, this would be much harder |
17:46:38 | alehander92 | this basically requires the repl+debugger combo |
17:46:44 | alehander92 | maybe |
17:47:52 | sschwarzer | alehander: I was looking at some point at stuff I could contribute to Nim. And as much I'd like this better debugging support, I almost immediately thought this would be far too difficult for my level. :) |
17:48:32 | sschwarzer | I _still_ want to contribute to Nim, but it's really a problem to find the time. |
17:48:45 | sschwarzer | The lazy iterator thing was months ago. :-/ |
17:49:28 | sschwarzer | alehander: it's about this thread: https://forum.nim-lang.org/t/5697 |
17:50:06 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:51:00 | sschwarzer | Unfortunately, there was a critical bug in the code I thought was working and the code I had at this point was already so difficult to understand that I didn't try to fix it but restart with the iterator (design pattern) approach. |
17:51:53 | sschwarzer | The code in itself was/is basic Nim, but keeping in your head what the current state during execution is was too difficult for me. |
17:52:54 | sschwarzer | Then I tried the debugger and the mental overhead of "translating" the C datastructures to Nim datastructures canceled out the insight I could have gotten from using the debugger. |
17:53:06 | alehander92 | yeah, this makes sense |
17:53:14 | bung_ | found there's https://github.com/barcharcraz/nim-libxml2/ might be helpful |
17:53:30 | bung_ | a cpp wrapper |
17:54:01 | alehander92 | <3 useful! |
17:55:10 | alehander92 | sschwarzer debugging support isnt really "difficult" its mostly about motivation/patience to study the related apis/toolset/language repr |
17:55:11 | sschwarzer | bung: Does it allow to delete nodes from the tree while iterating over it? (That's what I tried.) That said, what I _ultimately_ want to achieve can probably also be done more "manually" on a greedily evaluated list of nodes, but maybe that's not really easier. |
17:55:59 | alehander92 | otherwise yeah here might be a way to do it but i will think a bit tomorrow |
17:56:58 | sschwarzer | Just looking at `nim-libxml2` ... I'm not even sure how I'd use it from Nim. A README might have helped. ;) |
17:57:55 | bung_ | I checked it support xpath that's easier for debuging |
17:58:40 | bung_ | it's a wrapper if it fully wrapped , you just need read from http://www.xmlsoft.org |
17:58:49 | sschwarzer | alehander: yes, on principle you can understand almost everything if you have enough time to learn the prerequisites. :) |
17:59:07 | sschwarzer | bung: Right, XPath is nice. |
17:59:21 | Prestige | How should I be retrieving data from a PPcuchar? that's a ptr ptr cuchar |
17:59:30 | alehander92 | that's true :) but there is not much *complexity* in many of the currently popular user requests for debug stuff |
17:59:56 | Yardanico | Prestige: isn't that an array of strings? |
18:00:02 | disruptek | !last clyybber |
18:00:02 | disbot | clyybber spoke in 12#nim 110 minutes ago |
18:00:25 | FromDiscord | <InventorMatt> could nimscript be used as a debugging mechanism? like you run your standard nim through nim and you could easily go through it line by line? |
18:00:27 | Prestige | Yardanico: in this case it's just a char array |
18:00:38 | Yardanico | Prestige: huh? |
18:00:44 | Yardanico | char** ? |
18:00:55 | Prestige | Yeah |
18:01:05 | Yardanico | that looks like an array of strings for me usually |
18:01:07 | sschwarzer | Now I remember what I missed was the ability to delete a node in-place, without having the parent at the same time. There's also a ticket on this: https://github.com/nim-lang/Nim/issues/11729 |
18:01:07 | disbot | ➥ xmltree: Clear a node, not only its children |
18:01:10 | Yardanico | it's basically a 2d character array |
18:01:21 | Zevv | or a pointer to a cstring, commonly passed to functions that allocate a string for you |
18:01:23 | Prestige | usually is but it's just a way for xlib to return properties for windows |
18:01:24 | sschwarzer | But I'm not sure if such an API would be a good fit for Nim. |
18:01:37 | sschwarzer | Hey disruptek! :-) |
18:01:47 | disruptek | hey |
18:01:47 | Prestige | Unsure how to reference the data |
18:02:18 | bung_ | sschwarzer that's common, think of html parser |
18:02:30 | Prestige | Yardanico: https://tronche.com/gui/x/xlib/window-information/XGetWindowProperty.html for context (the last param) |
18:02:49 | bung_ | many scraper need modify the html tree |
18:03:29 | Yardanico | Prestige: yes, see nitems_return |
18:03:33 | Yardanico | prop_return is an array of strings |
18:03:38 | bung_ | modify the tree data structure then serialize it to string |
18:03:39 | Yardanico | nitems_return gives you len of that array I think |
18:04:01 | sschwarzer | bung: right, Python's ElementTree has this ability. Yes, I think it'd be common. |
18:04:28 | bung_ | have you try just set the node to nil? |
18:04:51 | sschwarzer | I'm just checking the ticket. It seems that Nim would need some identity of the node. Otherwise if you have two child nodes with the same data, Nim wouldn't know which one to delete. |
18:05:39 | sschwarzer | bung: Do you mean assigning `nil` to the parent where the child is? |
18:05:45 | Prestige | Yardanico: do I have to cast this? I thought I could just access the data like - val[][i] or something similar |
18:05:58 | bung_ | yes assign parent to nil |
18:06:00 | sschwarzer | bung: There's a `delete` proc, but it requires the parent and the child index. |
18:06:59 | Yardanico | Prestige: try cast[UncheckedArray[cstring]](yourptr) |
18:07:28 | sschwarzer | So by the time, I "arrive" at the child node during the iteration, I no longer have access to the parent. Of course, it can all be done "somehow", but it may not be trivial. I don't remember all details since this was months ago and I hardly did any Nim programming since then if at all. |
18:08:52 | sschwarzer | Object identity doesn't seem to be something that's usually used in Nim, if at all. Objects usually have value semantics (which I usually like!). |
18:10:02 | * | Guest37650 quit (Ping timeout: 256 seconds) |
18:10:14 | bung_ | what's "Object identity" ? |
18:10:21 | Prestige | Looks like I can cast[ptr UncheckedArray[ptr cuchar]](myPtr) and that works for some reason (I think) |
18:10:32 | sschwarzer | So meanwhile we're talking about at least three inter-connected things. :) I guess the debugging improvements would be the most interesting from my point of view because they would help "universally", not only for this XML tree usecase. |
18:11:52 | sschwarzer | bung: It means that objects can be distinguished even if they have the same state. In Python this is usually done via the address (which is abstracted with help of the `id` function) of an object. |
18:12:31 | Yardanico | Prestige: ptr cuchar == cstring |
18:12:43 | Yardanico | if it's not binary data ofc |
18:12:46 | Prestige | Yeah, I'm wanting the individual characters though |
18:12:48 | Yardanico | because cstrings are null terminated |
18:12:48 | bung_ | oh that's repr proc |
18:12:54 | Prestige | afaict |
18:13:04 | bung_ | in nim you can just use `repr proc` |
18:13:13 | Prestige | each char is some data that I want to read, like a window position etc |
18:13:54 | Prestige | I'm getting actual characters back instead of their numerical values though |
18:15:17 | bung_ | and I checked the xmltree doc `XmlNode = ref XmlNodeObj` it's just reference. |
18:15:40 | sschwarzer | bung: yes, this gives me the address, but as I understand it doesn't allow me to remove the child from the parent if I don't have access to the latter. |
18:15:43 | * | dadada joined #nim |
18:16:08 | * | dadada is now known as Guest81893 |
18:19:03 | sschwarzer | bung: My understanding was that deleting a child from a parent means that the child node would be removed from a `seq` of children that the parent node has. But I'm not 100 % sure. Also not sure if setting the child to `nil` would work (haven't seen it documented, and I'd only want to rely on documented behavior). |
18:19:30 | bung_ | ok, try that cpp wrapper see if it can locate node through xpath , then that's would be easy |
18:20:43 | Prestige | Yardanico: would you be up to chatting about this? I feel like I'm just stuck on the nim concept of how to do this. |
18:21:02 | Yardanico | Prestige: i don't have enough experience either, I'm mostly just telling from some knowledge I have :P |
18:21:12 | bung_ | well you can just think of the data structure , it's a tree store references, if node set to nil then that node is gone. |
18:21:31 | Yardanico | btw crashed the compiler with my async stuff :D |
18:21:32 | Yardanico | Error: unhandled exception: closureiters.nim(397, 9) `n.kind == nkStmtListExpr` [AssertionDefect] |
18:21:34 | sschwarzer | That would also be the first time I use a wrapper that doesn't have a "safe" Nim API. But yes, I can try it. (Although honestly I'm also curious to get the iterator pattern to work. ;-) |
18:21:50 | Prestige | Dang. |
18:22:48 | sschwarzer | bung: But my understanding is I need to set the reference to `nil` _in the parent_? But maybe I'm just confused now. ;-/ |
18:23:49 | bung_ | set whatever node you'd like let it gone |
18:23:56 | sschwarzer | bung: Sorry, was still speaking about Nim `xmltree`. With the libxml wrapper, XMLPath can give the parent relatively easily I suppose. |
18:24:36 | sschwarzer | I haven't looked at the xmllib2 API yet. |
18:25:04 | * | zacharycarter joined #nim |
18:25:04 | bung_ | check it maybe same data structure |
18:25:39 | * | Midnight25 joined #nim |
18:25:43 | bung_ | once locate the node you got the reference ,set it to nil, or maybe that lib provide a simple api. |
18:26:34 | * | Midnight25 quit (Remote host closed the connection) |
18:28:29 | Prestige | Maybe this will make more sense than me talking about it Yardanico: https://play.nim-lang.org/#ix=2nq5 |
18:28:57 | Prestige | https://play.nim-lang.org/#ix=2nq6 rather <- |
18:29:31 | sschwarzer | bung: I guess the next thing would be to get the "lazy tree iterator with deletable nodes" working in pure Nim. It _could_ be that using the libxml2 wrapper would be easier, but I'm eager to experiment with the iterator approach. Also because I can imagine that it would be useful in other situations as long as Nim doesn't allow nested iterators. |
18:31:18 | sschwarzer | bung: To me it seems that I can provide a simple lazy iterator that would internally use conventional iterators (the design pattern). So the internal design pattern would be an implementation detail and the public API would be simple and straightforward. |
18:32:28 | bung_ | that's programming design pattern and algorithm |
18:32:59 | sschwarzer | The existence of nested iterators in Python has spoiled me so much that it'll probably take some effort to the nested iterators working. But let's see. |
18:33:06 | sschwarzer | bung: exactly |
18:34:21 | sschwarzer | bung: something like this, but surely easier to apply in Nim: https://en.wikipedia.org/wiki/Iterator_pattern |
18:34:38 | * | cgfuh quit (Quit: WeeChat 2.7.1) |
18:35:05 | * | cgfuh joined #nim |
18:35:06 | sschwarzer | bung: My plan is to have an `Iterator[N]` object that stores the state and `hasNextNode` and `nextNode` procs taking the iterator object as argument. |
18:37:17 | bung_ | well , you can for value in iter :yield value |
18:37:18 | sschwarzer | I'm just not nearly as proficient in Nim as in Python, so thinking about how to do the Nim implemenation and of course actually implementing it just doesn't come as easily for me as for an experienced Nim developer. |
18:37:55 | sschwarzer | bung: Right, this will be the outer layer, so to speak. |
18:38:33 | sschwarzer | iterator treeIter[N](root: N): N = |
18:38:33 | sschwarzer | rootIterator = newIterator(N) |
18:38:33 | sschwarzer | while rootIterator.hasNextNode(): |
18:38:34 | sschwarzer | yield rootIterator.nextNode() |
18:38:57 | sschwarzer | This iterator would be the API for the user of the libary. |
18:39:21 | sschwarzer | (But it's not tested, so there may be bugs even in this simple code. :-D ) |
18:39:30 | * | Guest81893 quit (Ping timeout: 260 seconds) |
18:39:50 | bung_ | oh , that would store in diferent data structure. |
18:40:05 | * | cgfuh quit (Quit: WeeChat 2.7.1) |
18:40:15 | * | cgfuh joined #nim |
18:40:20 | sschwarzer | bung: The existence of the `Iterator` object(s) would be an implementation detail. |
18:40:43 | sschwarzer | The user should only use `treeIter` (possibly changed to another name). |
18:40:49 | sschwarzer | The user should only use `treeIter` (possibly changed to another name later). |
18:41:00 | * | dadada__ joined #nim |
18:41:21 | bung_ | try and see |
18:42:21 | * | cgfuh quit (Client Quit) |
18:43:18 | * | cgfuh joined #nim |
18:44:15 | sschwarzer | bung: Yep :) |
18:44:30 | sschwarzer | Thanks for your feedback everyone! :-) |
18:45:01 | sschwarzer | I'm looking forward to better debugging support. ;-D |
18:46:06 | bung_ | np, good luck! |
18:47:46 | * | waleee-cl joined #nim |
18:47:46 | * | cgfuh quit (Client Quit) |
18:48:05 | * | cgfuh joined #nim |
18:50:01 | * | avatarfighter joined #nim |
18:50:24 | * | cgfuh quit (Client Quit) |
19:01:48 | federico3 | we need a good flatbuffers wrapper |
19:02:55 | FromDiscord | <Recruit_main707> wrapper? |
19:03:03 | FromDiscord | <Recruit_main707> implementation rather |
19:03:21 | FromDiscord | <Recruit_main707> im too lazy to finish mine yet :P |
19:03:25 | FromDiscord | <Recruit_main707> but its almost done |
19:10:36 | FromGitter | <deech> In `gc:{a,o}rc` land how do I tell Nim to not call the destructor on a Nim object passed as a pointer to another language via FFI? Previously I would use `GC_unref` and `GC_ref`. |
19:11:26 | FromDiscord | <Recruit_main707> federico3: i can show you mine so far |
19:11:40 | FromDiscord | <Recruit_main707> there are only a few functions to be transpiled |
19:15:11 | Yardanico | @deech use GC_ref and GC_unref :) |
19:15:22 | Yardanico | arc still has refcounting |
19:15:48 | Yardanico | see https://github.com/Yardanico/nim-snippets/tree/master/clib |
19:16:30 | FromGitter | <deech> Ahah! Good stuff! |
19:16:42 | Yardanico | --debugger:native is optional of course |
19:31:20 | leorize | !repo flatbuffer |
19:31:21 | disbot | https://github.com/Skrylar/skflatbuffers -- 9skflatbuffers: 11FlatBuffers implementation in pure Nim. 15 3⭐ 0🍴 |
19:31:30 | leorize | federico3: ^ |
19:32:58 | sschwarzer | If a proc returns a ref object, is `new(result)` implied or do I need to call it explicitly in the proc? |
19:33:02 | federico3 | leorize: I have the bot in /ignore |
19:33:12 | Yardanico | sschwarzer: if you use object construction syntax - no need for that |
19:33:24 | leorize | federico3: why though lol https://github.com/Skrylar/skflatbuffers |
19:33:25 | Yardanico | otherwise - yes, you need to have it before any "result.a = xxx" assignments |
19:33:33 | Yardanico | but really just use object construction :) |
19:34:06 | sschwarzer | Yardanico: You mean object construction syntax = `MyNewObject(x: myX)`? |
19:34:10 | Yardanico | sschwarzer: yes |
19:34:19 | Yardanico | otherwise you'll need to call new(result) |
19:34:28 | sschwarzer | Yardanico: fine, yes, I'm using this :) |
19:34:29 | Yardanico | since ref objects are nil by default |
19:34:36 | Yardanico | sschwarzer: ah then it's fine :) |
19:35:00 | federico3 | leorize: I saw that repo. |
19:36:17 | sschwarzer | leorize: What was the Neovim command again to stop your Nim plugin (and implicitly restart it) without restarting Neovim? :) |
19:37:15 | sschwarzer | (background: an identifier is marked as an error (red background), but the code compiles and works fine) |
19:37:15 | Yardanico | @deech also updated that example to show how you can do simple error handling :P |
19:37:21 | Yardanico | mostly for myself |
19:37:25 | federico3 | leorize: it looked quite unfinished and it's missing a license |
19:37:37 | Yardanico | also -fsanitize=address with clang helped me remember that in C values are not initalized by default |
19:37:39 | leorize | sschwarzer: call nim#suggest#ProjectStop() |
19:38:05 | Yardanico | and valgrind too "Conditional jump or move depends on uninitialised value(s)" |
19:39:27 | sschwarzer | leorize: I found the function, but calling it didn't help. Hm, could it be related to the fact that the "error" identifier appears as argument to `toSeq`? |
19:40:05 | sschwarzer | With "error identifier" I mean the identifier highlighted as error. |
19:40:13 | leorize | well just do something afterwards and it should redraw the highlight :P |
19:40:55 | sschwarzer | leorize: I deleted the buffer with the file, called `ProjectStop` and implicitly reopened the file with ctrl-o |
19:41:04 | * | abm quit (Ping timeout: 246 seconds) |
19:41:25 | leorize | uh... ProjectStop relies on a variable in the buffer |
19:41:40 | leorize | so call that first then close the buffer |
19:42:37 | sschwarzer | leorize: tricky ... but it worked, thanks! :) |
19:43:06 | leorize | np, though I would rather that we don't have to do this at all :P |
19:43:23 | sschwarzer | leorize: honestly, I was just thinking the same :-D |
19:43:44 | sschwarzer | Yes, it's just a workaround, not a real solution |
19:44:09 | sschwarzer | Is it actually related to `toSeq` (or certain forms of templates)? |
19:44:34 | Yardanico | is it ok to (ab)use "sink" to get a "var" variable in the proc for free? :) |
19:44:44 | Yardanico | so I don't have to do "var myvar = myvar" |
19:47:12 | FromGitter | <deech> Yardanico, thanks! Very helpfu. |
19:51:44 | * | opDispatch is now known as B4s1l3 |
19:51:46 | * | B4s1l3 is now known as opDispatch |
19:53:00 | * | abm joined #nim |
19:56:44 | sschwarzer | leorize: I just looked at the tickets at https://github.com/alaviss/nim.nvim/issues (both open and closed) and there doesn't seem to be a ticket about this problem. Or did I overlook it? |
19:57:39 | * | lritter joined #nim |
19:57:41 | leorize | yea, but don't report there, this is a nimsuggest bug :P |
19:57:50 | leorize | do it at nim-lang/nimsuggest |
19:58:05 | leorize | maybe I should make it easier to generate data for reproducing without nim.nvim |
19:58:26 | sschwarzer | leorize: oi |
19:59:04 | leorize[m] | Yardanico: wait what you can abuse `sink` like that? |
19:59:25 | Yardanico | leorize[m]: of course? |
19:59:38 | Yardanico | sink moves the variable if it can prove there are no reads after that call |
19:59:41 | Yardanico | and otherwise copies it |
19:59:43 | Yardanico | but it's mutable |
19:59:49 | Yardanico | always mutable* |
20:00:17 | sschwarzer | leorize: Now I wonder what I should write in the nimsuggest issue. I have no idea where this problem comes from and how to convince them the problem comes from nimsuggest and not nim.nvim ;-) |
20:00:51 | sschwarzer | leorize: Can you tell by looking at the nimsuggest issues if there already seems to be a ticket on this problem? |
20:01:15 | leorize | I don't think I remember reading one |
20:01:24 | leorize | but seems like this impacts vscode users too |
20:01:34 | sschwarzer | If you know it's a nimsuggest issue, you probably already know what nimsuggest does wrong (even if you may not know in detail what to change in nimsuggest) |
20:01:47 | leorize | I have seen people talking about how their code is marked as error but was fine when compiled |
20:01:55 | sschwarzer | leorize: If there's already a ticket on this it doesn't make sense to enter another one :) |
20:02:12 | sschwarzer | leorize: yes, that's my situation, too. |
20:02:17 | Yardanico | leorize[m]: yeah I had that too |
20:02:29 | Yardanico | it's nimsuggest's fault as far as I know |
20:02:33 | sschwarzer | (at least what occurred today) |
20:02:48 | * | neceve quit (Ping timeout: 256 seconds) |
20:03:12 | Yardanico | try nimsuggest --stdin --debug src/file.nim (when you're in project root dir) |
20:03:19 | Yardanico | and then type "chk src/file.nim" |
20:03:56 | Yardanico | I get errors from tables.nim |
20:04:13 | Yardanico | https://gist.github.com/Yardanico/ad66b369ea940c08671b01bc0f0365bb |
20:04:55 | leorize | Yardanico: does nim check trips on that too? |
20:05:07 | leorize | if it does just report it as a nim check bug |
20:05:10 | Yardanico | leorize: no :) |
20:05:11 | leorize | get things fixed faster |
20:05:13 | Yardanico | nim check reports noe rrors |
20:05:22 | leorize | oh lol |
20:05:24 | Yardanico | so it's nimsuggest-specific |
20:05:42 | Yardanico | One way to do it (like the vscode nim extension does) - run nimsuggest for intellisense |
20:05:46 | Yardanico | but nim check for checking for errors :D |
20:06:03 | Yardanico | and it actually works well (nim check runs on save) |
20:06:15 | FromGitter | <awr1> https://github.com/microsoft/winget-pkgs |
20:06:20 | Yardanico | yeah saw that :P |
20:06:20 | FromGitter | <awr1> might be a good idea to get nim added as a package |
20:06:23 | leorize | well that's just walking around the issue |
20:06:31 | Yardanico | leorize: true |
20:07:11 | leorize | I really need to work on nimsuggest again sometime |
20:07:22 | leorize | or do you wanna try to see if you can fix all this? :) |
20:07:29 | Yardanico | lol |
20:07:33 | Yardanico | I don't think so right now :P |
20:08:51 | sschwarzer | Yardanico: this gives me some quite unexpected output: https://pastebin.com/raw/4BC8R5z6 |
20:09:07 | * | PMunch quit (Quit: leaving) |
20:09:27 | sschwarzer | In my case the file is a tests file that compiles and runs as expected. |
20:09:32 | leorize | my guess is that nimsuggest doesn't initialize the compiler correctly |
20:09:44 | leorize | probably fixable with some patch work |
20:10:16 | leorize | now that we also have the --backend thingy we can also make nimsuggest backend-aware too |
20:18:21 | * | liblq-dev quit (Quit: WeeChat 2.8) |
20:18:26 | * | Senketsu joined #nim |
20:23:27 | bung_ | any lib for cli header info ? |
20:23:30 | * | abm quit (Quit: Leaving) |
20:26:36 | * | tdc quit (Ping timeout: 256 seconds) |
20:28:05 | * | Senketsu quit (Ping timeout: 265 seconds) |
20:29:46 | bung_ | @leorize am interested , what's the todos |
20:32:34 | FromDiscord | <mratsim> Raytracing, now with animation: https://github.com/mratsim/trace-of-radiance/pull/4 |
20:32:36 | disbot | ➥ Animation |
20:34:31 | leorize | sschwarzer: can you share the faulty file? |
20:35:06 | leorize | actually if you can open a nimsuggest bug :P |
20:35:22 | zacharycarter | mratsim: awesome! |
20:37:34 | sschwarzer | leorize: I can give you the file that showed the error, but after having restarting the plugin, I don't see the error anymore, as mentioned. Does it still help to have the file(s)? (It's a test file and the file it tests.) |
20:38:32 | leorize | if you can share a file that trips `nimsuggest chk`, that'd be great :) |
20:38:40 | Yardanico | leorize: ok, wait a bit |
20:38:49 | sschwarzer | leorize: And I'm not completely sure whether I have exactly the file I had. I continued working on the file, but I _think_ the "error problem" was with the version I last committed. |
20:39:00 | leorize | if we can craft a minimal reproducible sample from that it'd be the first step to figuring out why things fail |
20:39:18 | leorize | well the `chk` bug seems to be reproducible |
20:39:30 | leorize | so we cna just target that first |
20:39:32 | leorize | can* |
20:39:39 | sschwarzer | leorize: You mean as with the pastebin content https://pastebin.com/raw/4BC8R5z6 ? |
20:40:24 | Yardanico | Would there be any issues with an object variant with a lot of branches? |
20:40:25 | leorize | yes :) |
20:40:34 | Yardanico | Like at least 100 |
20:40:40 | leorize | idk :p |
20:40:44 | Yardanico | rip |
20:40:54 | leorize | nimsuggest uses the compiler, and if the compiler doesn't trip, it shouldn't trip as well |
20:41:21 | sschwarzer | leorize: ok, I'll try to create/restore consistent files that compile but show the problem and put them on pastebin. |
20:44:24 | bung_ | I create on nimsuggest issue https://github.com/nim-lang/Nim/issues/14461 |
20:44:27 | disbot | ➥ nimsuggest reporting value out of range: -1 notin 0 .. 9223372036854775807 [RangeDefect] ; snippet at 12https://play.nim-lang.org/#ix=2nrm |
20:44:56 | bung_ | not sure how to correct reportting nimsuggest issue. |
20:45:08 | leorize | bung_: once they created a reproducible test case you can try to work on it |
20:45:57 | bung_ | you mean I just take care of bug reported is fine? |
20:46:12 | leorize | well reporting bugs with nimsuggest is hard |
20:46:31 | leorize | since you can't really isolate things down to a reproducible sample |
20:46:50 | bung_ | that's true. |
20:47:52 | bung_ | I guess I need fork nimsuggest source then commented it first, if I work on it. |
20:48:25 | sschwarzer | leorize: https://pastebin.com/htZ3M7T7 and https://pastebin.com/zLwNpnDj . Output from nimsuggest: https://pastebin.com/raw/4BC8R5z6 |
20:48:32 | bung_ | it's not kind of lib that well documented. |
20:48:43 | Yardanico | bung_: nimsuggest code is in the compiler :) |
20:49:01 | Yardanico | well, it's separate but you can find stuff like "when defined(nimsuggest): code specific for nimsuggest" in the compiler |
20:49:26 | leorize | if you're lost you can consult me for a map of how nimsuggest work |
20:49:43 | sschwarzer | leorize: maybe you want to try the files yourself so you can reproduce the problem if there's a misunderstanding or something. |
20:49:51 | bung_ | ok , I can try step by step , may take long. |
20:51:58 | * | Jesin quit (Quit: Leaving) |
20:52:25 | planetis[m] | Are there any plans for Nim to have let variables that alias instead of copy a resource when its safe? |
20:52:46 | leorize | yes |
20:54:08 | planetis[m] | If you use lent T and assign it, it copies right? |
20:54:48 | leorize | sschwarzer: confirmed that it's reproducible |
20:54:54 | leorize | can you open an issue? |
20:55:27 | * | avatarfighter quit (Ping timeout: 260 seconds) |
20:55:47 | sschwarzer | I guess you'd be more qualified to describe the problem, but I can do it if you want. :) |
20:56:07 | leorize | please :) |
20:56:16 | * | Trustable quit (Remote host closed the connection) |
20:56:29 | sschwarzer | leorize: ok :-) |
20:56:30 | bung_ | oh I see the nimsuggest tests, test against file source |
20:56:31 | FromDiscord | <mratsim> @planetis no it sinks |
20:56:44 | * | avatarfighter joined #nim |
20:57:02 | FromDiscord | <mratsim> ah sorry misread, yes it copies but if you use in another proc it does not |
20:57:19 | FromDiscord | <mratsim> otherwise you templates instead of assignments |
20:58:00 | FromDiscord | <mratsim> there was a discussion about creating an alias shorthand that voids having to do "template foo: untyped = myAliasedFoo" |
20:58:28 | Yardanico | leorize: actually seems like it'll be 161 branches :P |
20:58:33 | Yardanico | i hope nim would work for that XD |
20:59:46 | planetis[m] | so no way i can get rid of those templates, so be it. |
21:01:38 | planetis[m] | mratsim: awesome work on your raytracer project btw |
21:01:54 | * | opDispatch quit (Ping timeout: 240 seconds) |
21:02:06 | * | opDispatch joined #nim |
21:03:00 | * | Jesin joined #nim |
21:05:07 | * | Senny joined #nim |
21:09:03 | * | opal quit (Ping timeout: 240 seconds) |
21:11:58 | sschwarzer | leorize: submitted as https://github.com/nim-lang/nimsuggest/issues/115 |
21:11:58 | disbot | ➥ Nimsuggest reports lots of errors for a file that compiles fine |
21:12:17 | leorize | bung_: ^ you can try to tackle that |
21:13:50 | FromDiscord | <mratsim> @planetis, thanks :), I'm happy to get out of the color conversion and video rabbit hole 😛 |
21:16:27 | * | Senny quit (Ping timeout: 260 seconds) |
21:17:09 | sschwarzer | planetis, mratsim: completely agreed. I'm also impressed by mratsim again and again :) |
21:20:50 | * | opal joined #nim |
21:31:42 | FromDiscord | <j$> when should a nimscript task print the description? |
21:38:34 | * | dadada__ quit (Ping timeout: 240 seconds) |
21:45:41 | * | dadada joined #nim |
21:46:06 | * | dadada is now known as Guest61634 |
21:48:53 | FromGitter | <kaushalmodi> j$: Not sure what you mean.. you mean how to print the descriptions of all nimscript tasks? |
21:49:15 | FromDiscord | <j$> yeah |
21:49:21 | FromGitter | <kaushalmodi> type `nim help` |
21:57:10 | bung_ | leorize any suggestion? seems the error info also cant locate where the problem is.. |
21:58:06 | * | tane quit (Quit: Leaving) |
21:58:32 | leorize | bung_: it does located the location, its (col5, col6) |
21:59:12 | leorize | the first thing you should do is see how the compiler is setup by nimsuggest compared to nim, nimpretty, nimfind |
21:59:28 | leorize | maybe some steps in initializing the vm was skipped |
22:01:16 | bung_ | hmm any article I could read first? afaik it build a graph data for project |
22:02:39 | shashlick | is it possible to get the gnu triplet - e.g. x86_64-linux-gnu from Nim during compile time? |
22:03:13 | bung_ | https://pastebin.com/cxL2NHcw see information give me doesnt help |
22:03:39 | bung_ | I even add `doAssert maxSlots > -1` before the line vm.nim 2271 |
22:07:11 | shashlick | i see there's hostOS for os and hostCPU for arch but no way to know the abi |
22:09:28 | * | Guest61634 quit (Ping timeout: 246 seconds) |
22:14:25 | leorize | shashlick: the triplet is not a nim thing unfortunately |
22:14:32 | leorize | you can query gcc for this |
22:15:34 | * | dadada__ joined #nim |
22:17:36 | * | sschwarzer quit (Quit: leaving) |
22:29:37 | * | dadada__ quit (Ping timeout: 264 seconds) |
22:30:37 | * | dadada joined #nim |
22:31:02 | * | dadada is now known as Guest90170 |
22:54:16 | * | Guest90170 quit (Ping timeout: 246 seconds) |
23:00:38 | * | dadada__ joined #nim |
23:01:12 | * | avatarfighter quit (Ping timeout: 260 seconds) |
23:09:23 | * | couven92 quit (Read error: Connection reset by peer) |
23:09:31 | * | avatarfighter joined #nim |
23:19:58 | * | solitudesf quit (Ping timeout: 260 seconds) |
23:24:19 | * | dadada__ quit (Ping timeout: 260 seconds) |
23:30:36 | * | dadada joined #nim |
23:31:03 | * | dadada is now known as Guest73984 |
23:49:30 | skrylar[m] | hoi |
23:54:46 | * | Guest73984 quit (Ping timeout: 265 seconds) |