00:00:08 | * | krux02 quit (Ping timeout: 265 seconds) |
00:01:01 | * | voltist joined #nim |
00:07:14 | * | dwdv quit (Ping timeout: 240 seconds) |
00:09:59 | * | zacharycarter quit (Ping timeout: 258 seconds) |
00:13:58 | * | lritter joined #nim |
00:16:41 | FromDiscord | <KingDarBoja> Jumm, I expect the guys to show up at this time |
00:27:39 | voltist | @Vindaar o/ |
00:28:12 | FromDiscord | <Rika> it is i |
00:29:56 | FromDiscord | <KingDarBoja> Rika-sensei! |
00:31:54 | * | Tyresc quit (Quit: WeeChat 2.9-dev) |
01:03:39 | * | krux02_ quit (Remote host closed the connection) |
01:06:44 | FromDiscord | <Rika> ._. the nim syntax highlighting regex is still pretty wonk |
01:06:44 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700874922045472898/unknown.png |
01:07:35 | * | chemist69 quit (Ping timeout: 246 seconds) |
01:08:41 | * | ZoomZoomZoom quit (Read error: Connection reset by peer) |
01:09:48 | * | chemist69 joined #nim |
01:10:54 | FromDiscord | <Elegant Beef> @Gary M has been working on it a bit got to here yesterday |
01:10:54 | FromDiscord | <Elegant Beef> https://cdn.discordapp.com/attachments/371759389889003532/700875971862986823/MzNOi4v.png |
01:11:06 | FromDiscord | <Rika> i know |
01:11:09 | FromDiscord | <Rika> i was there |
01:11:22 | FromDiscord | <Rika> @Gary M new bug lol |
01:11:33 | FromDiscord | <Elegant Beef> I mean i know him from a different server, so he pmed me, so didnt see it here |
01:11:54 | FromDiscord | <Rika> something weird from the string literal highlighter it seems |
01:17:37 | FromDiscord | <KingDarBoja> Eleigant: what editor is that? Looks neat 😄 |
01:18:51 | FromDiscord | <Rika> still vscode im psure |
01:19:36 | leorize | @Rika: I have a degree in parsing Nim with regex, do you need my help? :P |
01:20:51 | * | lritter quit (Ping timeout: 265 seconds) |
01:20:54 | FromDiscord | <Rika> nah this plugin needs your help |
01:21:19 | * | lritter joined #nim |
01:21:27 | leorize | so what's the prob? |
01:21:56 | leorize | I mean, where can I see the code? |
01:22:03 | leorize | is it written in nim? |
01:22:50 | FromDiscord | <Rika> uh no its just a json soup of regex |
01:22:58 | FromDiscord | <Rika> actually i think Gary M did a lot of work on it |
01:23:03 | FromDiscord | <Rika> so maybe wait for them to report |
01:23:05 | leorize | can you generate this json? |
01:23:12 | leorize | if you can't you're in for trouble |
01:23:22 | FromDiscord | <Rika> you can... from yaml |
01:23:37 | leorize | yea you're doomed |
01:24:49 | FromDiscord | <Rika> it just looks like this |
01:24:49 | FromDiscord | <Rika> https://cdn.discordapp.com/attachments/371759389889003532/700879475721764945/unknown.png |
01:26:37 | leorize | I don't know how vscode treat these patterns, but I will tell you that `##[` can start anywhere |
01:27:06 | FromDiscord | <Elegant Beef> Yea that was gary's vscode |
01:27:50 | FromDiscord | <Elegant Beef> I believe he is using tree-sitter now to get better highlighting |
01:28:16 | FromDiscord | <Rika> leorize: that's what the regex says though |
01:28:32 | FromDiscord | <Rika> "get any combo of space or tabs and `#[`" |
01:28:39 | FromDiscord | <Rika> 0 to inf amount |
01:28:57 | leorize | uhmm then why do you even need it? |
01:29:57 | FromDiscord | <Rika> i dont know with the creator |
01:29:59 | FromDiscord | <Rika> i didnt make this |
01:30:18 | FromDiscord | <KingDarBoja> I am curious by the theme Elegant is using on VSCode right now |
01:30:20 | Prestige | Elegant Beef: you have any thoughts on using XSelectInput vs XSetWindowAttributes? |
01:30:40 | Prestige | I haven't found much info on why to use one over the other, for setting up event masks for the root window |
01:30:55 | leorize | vscode should implement proper semantic highlighting |
01:31:17 | leorize | then they can use nimsuggest to highlight the code |
01:31:26 | leorize | much better than trying to use some third party parser |
01:32:03 | FromDiscord | <Rika> i think PMunch is planning to do it? |
01:32:24 | FromDiscord | <Rika> also vscode already uses info from nimsuggest to show popups |
01:32:29 | FromDiscord | <Rika> and suggestions of course |
01:32:52 | leorize | well but not highlighting, arguably the most important :P |
01:33:36 | FromDiscord | <Rika> yeah haha |
01:34:03 | FromDiscord | <Rika> the issue with that is that the file has to be saved before highlighting updates |
01:34:25 | leorize | not really |
01:34:32 | leorize | it can save the file to a temporary location |
01:34:44 | leorize | the plugin probably already do so |
01:34:53 | FromDiscord | <Rika> nope i dont think so |
01:35:06 | leorize | it does, that's the only way nimsuggest communication can be done |
01:35:19 | leorize | suggestion data don't just appear out of nowhere |
01:35:33 | FromDiscord | <Rika> suggestions dont update after modification, |
01:35:45 | FromDiscord | <Rika> only after save |
01:36:01 | leorize | oh you mean you gotta save it atleast once? |
01:36:03 | leorize | then yea |
01:43:22 | FromGitter | <gogolxdong> Will there be problem when insert into a sequence head in a thread and pop in another thread |
01:47:53 | FromDiscord | <Elegant Beef> No i dont prestige, i just got tiling somewhat working, using maprequest over create window |
01:48:07 | FromDiscord | <Elegant Beef> But when i close windows 1 mystery window survives |
01:48:10 | Prestige | Nice good to know |
01:48:22 | Prestige | hm close them how, like a key shortcut? |
01:48:27 | * | dadada quit (Ping timeout: 250 seconds) |
01:48:31 | FromDiscord | <Elegant Beef> No internally |
01:48:49 | Prestige | hm is the root window not closing maybe? |
01:48:59 | FromDiscord | <Elegant Beef> Maybe not |
01:49:44 | FromDiscord | <Elegant Beef> or it's not sending a message properly |
01:49:54 | FromDiscord | <Elegant Beef> or it's not sending a message i expect |
01:50:19 | Prestige | Is there a simple way to debug that while it's running? Like using notify-send or similar |
01:50:47 | FromDiscord | <Elegant Beef> I've been doing `Xephyr :5 & sleep 1; DISPLAY=:5 wm |
01:50:50 | FromDiscord | <Elegant Beef> I've been doing `Xephyr :5 & sleep 1; DISPLAY=:5 wm` |
01:52:01 | Prestige | hm I guess u can see echo statements from there |
01:52:07 | FromDiscord | <Elegant Beef> yea |
01:52:35 | FromDiscord | <Elegant Beef> Wrote this nimscript to handle it |
01:52:36 | FromDiscord | <Elegant Beef> https://hatebin.com/cckjjcwbzz |
01:59:46 | * | dadada joined #nim |
02:00:09 | * | dadada is now known as Guest69899 |
02:04:02 | FromDiscord | <Elegant Beef> Ah my issue was my delete logic was only attempting to delete if i had more than 1 window not equal or greater |
02:05:00 | * | utlagi joined #nim |
02:05:12 | * | utlagi left #nim (#nim) |
02:20:24 | * | muffindrake quit (Ping timeout: 256 seconds) |
02:22:25 | FromDiscord | <KingDarBoja> Arrr |
02:22:38 | FromDiscord | <KingDarBoja> Been like 2 hours looking for the difference on my code with python source code |
02:22:42 | FromDiscord | <Rika> nice |
02:22:43 | * | muffindrake joined #nim |
02:22:45 | FromDiscord | <KingDarBoja> Ugh only 1 tests isn't passing lol |
02:22:53 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/print_location.nim My module |
02:23:27 | FromDiscord | <KingDarBoja> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/language/print_location.py Source on Python |
02:24:24 | FromDiscord | <KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/tests/language/test_print_location.nim#L52 The test failing, I can't pinpoint what's missing |
02:26:20 | FromDiscord | <Rika> did you compare the outputs |
02:27:14 | FromDiscord | <KingDarBoja> I did but not sure why the first two tests are okay whereas the third one is completely different |
02:28:08 | FromDiscord | <KingDarBoja> The string ("thirdLocation") is the thing that's different |
02:29:32 | FromDiscord | <KingDarBoja> Quote from leorize (I think): "Maybe I am not looking at the right angle" |
02:36:02 | FromDiscord | <Gary M> Like beef said I'm looking into using Tree-sitter mainly as a syntax highlighter passing through a Vscode extension. It will probably take a while to write it all but it has the ability to right comprehensive tests so in the end it should be pretty robust 😄 We'll see. |
02:36:22 | FromDiscord | <Gary M> Ha, write* |
02:37:22 | FromDiscord | <Rika> yeah right |
02:37:26 | FromDiscord | <Rika> 😛 |
02:39:16 | disruptek | wut |
02:39:19 | FromDiscord | <Gary M> Hey, it's the default for Atom :P |
02:39:35 | shashlick | its also the backend for nimterop |
02:39:42 | FromDiscord | <Gary M> Yes |
02:40:10 | disruptek | why aren't you guys using lsp and such? |
02:40:42 | FromDiscord | <Rika> does it work just as well :thonk: |
02:40:54 | disruptek | just as well as what? |
02:41:34 | FromDiscord | <Rika> as the regular vscode nim extension |
02:41:56 | disruptek | i dunno. i admit i don't know anything about this. i use nvim. |
02:42:12 | disruptek | i'm just surprised that anyone ever wants to reinvent this wheel. |
02:42:24 | FromDiscord | <Gary M> Vscode LSP support doesn't have syntax highlighting I'm pretty sure. |
02:42:39 | disruptek | that'd shock me. |
02:42:52 | leorize | lsp don't have semantic highlight |
02:42:53 | FromDiscord | <Gary M> It's a wheel that's built in a pretty REGEX flavored rubber thanks to Textmates grammar |
02:43:38 | leorize | nimsuggest was ahead of its time :P |
02:44:09 | FromDiscord | <Rika> realtime semantic highlighting when |
02:44:40 | leorize | once they finally merged the lsp semantic highlighting proposal |
02:44:53 | FromDiscord | <Gary M> So it's either struggling with correctly formatting a json using some Ruby flavored REGEX called Oniguruma |
02:44:54 | leorize | once that's in I'll fix nimlsp up and nim.nvim will move to nimlsp |
02:45:01 | FromDiscord | <Rika> thats a nice name |
02:45:03 | FromDiscord | <Rika> oniguruma |
02:45:26 | FromDiscord | <Gary M> Or maybe doing something different with tree sitter |
02:45:59 | FromDiscord | <Gary M> And I believe it won't be running regex all the time so it's supposed to be faster, idk |
02:46:07 | FromDiscord | <Rika> sounds better |
02:46:25 | FromDiscord | <Gary M> Or at least it won't be running a large textmate file worth of regex |
03:09:03 | * | endragor joined #nim |
03:21:12 | FromDiscord | <KingDarBoja> Sup |
03:21:31 | FromDiscord | <Mask> hello |
03:24:23 | * | endragor quit (Remote host closed the connection) |
03:31:27 | FromGitter | <gogolxdong> I found sometimes program stucks somewhere |
03:31:56 | FromGitter | <gogolxdong> when inserting into a sequence in a thread and pop in another thread |
03:34:02 | FromDiscord | <KingDarBoja> Okay, I found my issue |
03:34:17 | FromDiscord | <KingDarBoja> I was missing a equal sign on some if comparison |
03:34:26 | FromDiscord | <KingDarBoja> Like val + 1 < string.len |
03:34:40 | FromDiscord | <Rika> nice |
03:34:45 | FromDiscord | <KingDarBoja> But actually, it was <= as `..` is not inclusive |
03:35:02 | FromDiscord | <Rika> ???? `..` is inclusive |
03:35:08 | FromDiscord | <KingDarBoja> And ofc Python handles the list subset safely, but Nim doesn't, so I always do these kind of checks |
03:35:13 | FromDiscord | <KingDarBoja> `..<` oops |
03:35:31 | FromDiscord | <Rika> nim does it safely just doesnt assume you want until the end |
03:35:59 | FromDiscord | <KingDarBoja> Yeah but what I meant is |
03:36:13 | FromDiscord | <KingDarBoja> Python can handle index values out of the limit |
03:36:34 | FromDiscord | <KingDarBoja> Like "abcd" is a string, yo ucan subset it like a[0:999] |
03:36:43 | FromDiscord | <Rika> i dont think thats good design |
03:36:54 | FromDiscord | <KingDarBoja> And it will be fine |
03:37:10 | FromDiscord | <KingDarBoja> That's why I always keep on mind the len check |
03:37:16 | FromDiscord | <KingDarBoja> But looks like I missed this one lol |
03:37:54 | FromDiscord | <Rika> use templates or macros |
03:38:51 | FromDiscord | <KingDarBoja> Explain sensei |
03:39:33 | FromDiscord | <Rika> `template withinBounds(idx, arr) = idx < arr.len` or something like that |
03:41:01 | * | FromDiscord <KingDarBoja> red eyes meme |
03:42:32 | FromDiscord | <KingDarBoja> But this also means that I should check again my proc that uses those checks as I always use `<` |
03:43:02 | FromDiscord | <KingDarBoja> Instead of `<=` for comparing things like `i + 1 < someLength` |
03:43:20 | FromDiscord | <KingDarBoja> https://tenor.com/view/simon-cowell-laser-eyes-gif-10617238 The red eyes gif btw |
03:45:30 | FromDiscord | <Rika> not a meme i know of |
03:55:42 | * | Romanson joined #nim |
04:04:57 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:44 | * | supakeen joined #nim |
04:11:36 | FromDiscord | <Elegant Beef> Prestige, did you add `_NET_ACTIVE_WINDOW` to your root window? |
04:11:42 | FromDiscord | <Elegant Beef> If so, how |
04:13:52 | Prestige | probably set the atom but I haven't |
04:14:02 | FromDiscord | <Elegant Beef> Yea i dont get the atoms |
04:14:38 | FromDiscord | <Elegant Beef> Like the XChangeProperty takes 2 Atoms one being property and the other being type |
04:17:13 | FromDiscord | <Mask> hi i'm having an issue installing a package |
04:17:15 | FromDiscord | <Mask> |
04:17:15 | FromDiscord | <Mask> https://cdn.discordapp.com/attachments/371759389889003532/700922867038158879/unknown.png |
04:17:24 | FromDiscord | <Mask> |
04:17:24 | FromDiscord | <Mask> https://cdn.discordapp.com/attachments/371759389889003532/700922904552144926/unknown.png |
04:17:27 | FromDiscord | <Mask> i literally just installed nim |
04:17:30 | FromDiscord | <Mask> i'm on linux |
04:17:40 | FromDiscord | <Mask> it says i am using version 0.17.2 |
04:17:50 | FromDiscord | <Elegant Beef> did you use choosenim? |
04:17:55 | FromDiscord | <Mask> |
04:17:55 | FromDiscord | <Mask> https://cdn.discordapp.com/attachments/371759389889003532/700923034147749928/unknown.png |
04:18:08 | FromDiscord | <Mask> no i'm not familiar with that |
04:18:15 | FromDiscord | <Elegant Beef> Using ubuntu derivative? |
04:18:25 | FromDiscord | <Mask> linux mint xcfe yes |
04:18:27 | FromDiscord | <Rika> nim 0.17 is very old |
04:18:31 | FromDiscord | <Elegant Beef> Yea |
04:18:35 | FromDiscord | <Mask> how can i get the updated verison |
04:18:40 | FromDiscord | <Mask> i installed with apt |
04:18:44 | FromDiscord | <Rika> uninstall the nim from apt |
04:18:46 | FromDiscord | <Elegant Beef> Get choosenim |
04:18:56 | FromDiscord | <Rika> install choosenim either from apt or from somewhere |
04:19:02 | FromDiscord | <Rika> then use choosenim for nim |
04:19:05 | * | nsf joined #nim |
04:19:09 | FromDiscord | <Mask> i can just alias it right |
04:19:11 | FromDiscord | <Elegant Beef> Yea the nim version on the ubuntu repo is shite |
04:19:12 | FromDiscord | <Mask> for less typing? |
04:19:26 | FromDiscord | <Elegant Beef> its 0.20.2-1 on ubuntu |
04:19:44 | FromDiscord | <Elegant Beef> choosenim is a nim version manager |
04:19:45 | FromDiscord | <Mask> uh it can't find the package. Is it called choosenim or something else |
04:19:52 | * | rockcavera quit (Read error: Connection reset by peer) |
04:19:59 | FromDiscord | <Mask> nvm i can figure this part out i think |
04:20:16 | FromDiscord | <Elegant Beef> You can just download a release from nim's site iirc |
04:22:20 | * | rockcavera joined #nim |
04:22:20 | * | rockcavera quit (Changing host) |
04:22:20 | * | rockcavera joined #nim |
04:23:04 | FromDiscord | <Mask> works. Thanks for the help |
04:44:34 | FromDiscord | <Mask> well i'm having another dependancy issue |
04:44:34 | FromDiscord | <Mask> i've tried numerous ubuntu support things for this error, various installs of sdl dev packages etc. nothing seems to work |
04:44:35 | FromDiscord | <Mask> https://cdn.discordapp.com/attachments/371759389889003532/700929744761257984/unknown.png |
04:56:30 | * | endragor joined #nim |
05:00:32 | * | xcm quit (Remote host closed the connection) |
05:02:48 | * | noonien quit (Quit: Connection closed for inactivity) |
05:03:13 | * | xcm joined #nim |
05:12:15 | * | zacharycarter joined #nim |
05:13:28 | * | narimiran joined #nim |
05:30:07 | * | zacharycarter quit (Ping timeout: 260 seconds) |
05:42:23 | Prestige | this xlib code is killing me inside |
05:43:03 | * | audiophile quit (Quit: Going offline, see ya! (www.adiirc.com)) |
05:45:06 | * | NimBot joined #nim |
05:49:33 | FromDiscord | <KingDarBoja> I had to rely on a bool flag to pass into a tuple so I can use it as a None check cuz I was too lazy to rely on Options module lol |
05:49:54 | * | narimiran quit (Quit: leaving) |
05:51:50 | * | couven92 joined #nim |
06:11:10 | * | solitudesf joined #nim |
06:20:40 | * | xet7 quit (Remote host closed the connection) |
06:33:55 | FromDiscord | <Mask> is nimgame2 really the way to go for making games in nim |
06:35:36 | FromDiscord | <Rika> theres the godot bindings |
06:41:38 | FromDiscord | <Varriount> Or if you're comfortable with C, SDL or Allegro |
06:47:54 | FromDiscord | <Rika> man i'm loving npeg, or maybe making PEGs are just super fun |
06:48:01 | FromDiscord | <Rika> parsing legitimately hasnt been easier |
06:51:27 | * | narimiran joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:50 | * | gmpreussner joined #nim |
07:05:47 | * | narimiran quit (Ping timeout: 260 seconds) |
07:08:14 | * | ryan_ joined #nim |
07:08:52 | Zevv | \o/ |
07:09:22 | Zevv | don't forget to make friendly colorful little graphs every now and then for even more gratification |
07:10:25 | * | number_one quit (Ping timeout: 250 seconds) |
07:30:31 | * | Romanson quit (Quit: Connection closed for inactivity) |
07:31:20 | * | rockcavera quit (Remote host closed the connection) |
07:45:56 | FromDiscord | <Elegant Beef> Same prestige it feels poorly documented and very obscure on what's supposed to be done |
07:49:37 | * | supakeen quit (Quit: WeeChat 1.9.1) |
07:50:17 | * | dddddd quit (Ping timeout: 250 seconds) |
07:50:17 | voltist | @Vindaar That spike raster plot you devised has been working well. Have you seen my new issue on the ggplotnim repo? |
07:50:54 | * | supakeen joined #nim |
07:59:40 | * | couven92 quit (Read error: Connection reset by peer) |
07:59:54 | Prestige | Elegant Beef I figured out a few things (maybe things you already had set up) but I'm feeling pretty good moving forward |
08:00:03 | * | couven92 joined #nim |
08:00:09 | Prestige | Do you want a link to my repo? |
08:00:10 | FromGitter | <Vindaar> @voltist: sorry, I was asleep |
08:00:11 | Prestige | Bb |
08:01:10 | FromGitter | <Vindaar> happy to hear the spike raster plots work well for you! `geom_bar` indeed does not support negative heights so far. I'll take a look at it |
08:03:49 | FromGitter | <Vindaar> it's a one line fix though. I simply didn't think about that case |
08:10:36 | voltist | @Vindaar Coolio |
08:10:37 | * | Vladar joined #nim |
08:11:22 | FromDiscord | <Elegant Beef> Sure prestige |
08:11:43 | FromDiscord | <Elegant Beef> Mine's currently private cause i dont like having unfinished software publically available |
08:11:56 | Prestige | https://github.com/avahe-kellenberger/nimdow |
08:12:13 | Prestige | I am just learning nim and like open source so, no shame :) |
08:13:00 | * | narimiran joined #nim |
08:16:32 | * | narimiran quit (Client Quit) |
08:16:41 | FromDiscord | <Elegant Beef> Well i love open source to |
08:17:03 | FromDiscord | <Elegant Beef> but i dislike unusable software visible cause it just fees weird 😄 |
08:17:10 | FromDiscord | <Elegant Beef> feels* |
08:18:50 | FromGitter | <Vindaar> @voltist: just pushed a PR to fix it https://github.com/Vindaar/ggplotnim/pull/65 |
08:18:50 | disbot | ➥ Allow negative bars when using stat = "identity", fixes #64 |
08:19:53 | Guest69899 | Error: internal error: getTypeDescAux(tyProxy) |
08:20:00 | Guest69899 | does this mean I hit on a Nim bug? |
08:20:07 | * | Guest69899 is now known as dadada |
08:20:21 | leorize | dadada: yep |
08:21:48 | voltist | @Vindaar Neat, thanks! |
08:21:59 | FromGitter | <Vindaar> you're welcome! |
08:23:15 | dadada | leorize: it says I should rerun the compilation with ./koch , but there's no ./koch, and no koch in PATH either |
08:23:28 | dadada | when koch is this important, why isn't it setup by choosenim? |
08:23:40 | leorize | koch is the build tool for the compiler |
08:24:09 | leorize | that instruction is for when you want to debug only |
08:24:47 | dadada | as long as Nim is in a state where the user is likely to need to debug it, I think koch should be installed per default |
08:25:07 | * | letto quit (Ping timeout: 260 seconds) |
08:25:38 | dadada | or maybe koch's functionality should be integrated into nim/nimble |
08:25:53 | * | muffindrake quit (Remote host closed the connection) |
08:26:25 | * | muffindrake joined #nim |
08:26:35 | leorize | dadada: ./koch is like `make` |
08:26:37 | dadada | I somewhat agree with krux02 that Nim could use a better CLI, if it was command based (git-like), it could have nim koch .., etc. |
08:26:48 | FromDiscord | <Elegant Beef> Well prestige if you want here is my shitty wm currently, made it public just for you :P |
08:26:49 | FromDiscord | <Elegant Beef> https://github.com/beef331/goodwm |
08:27:12 | Prestige | Ay thanks, that's great |
08:27:54 | FromDiscord | <Elegant Beef> No organization cause im a gibbon |
08:28:17 | dadada | leorize: I understand that, it's just not very helpful to split up tools a Nim developer is likely to require in his Nim life, because eventually you're going to need them and the hassle of separate installation is unjustified in times where everybody has 1TB+ of storage |
08:28:35 | FromDiscord | <Rika> uh |
08:28:40 | FromDiscord | <Rika> *hides in 500gb* |
08:29:09 | dadada | Rika: you're really proving my point, when 500gb is considered "not a lot" |
08:29:16 | leorize[m] | dadada: well do you want the entire compiler source bundled with your compiler installation? |
08:29:30 | leorize[m] | oh wait it's already bundled :p |
08:29:56 | * | letto joined #nim |
08:30:17 | dadada | leorize[m]: you're wording it as if that was a giant file, when in reality the average video on youtube, probably requires more space than Nim's entire compiler source (by far) |
08:31:03 | * | hax-scramper quit (Read error: Connection reset by peer) |
08:31:17 | dadada | leorize[m]: when somebody installs the gcc-toolchain, you can always expect there to be make, so when somebody installs the nim-toolchain, I think it should be expected that there's koch |
08:32:01 | * | hax-scramper joined #nim |
08:33:45 | solitudesf | thats just not true |
08:34:07 | * | narimiran joined #nim |
08:34:10 | * | solitudesf quit (Quit: Leaving) |
08:34:46 | dadada | solitudesf: what's not true? |
08:35:26 | voltist | @Vindaar Great, it works! How would I go about putting a line down the x axis? Just geom_line with its own data entry? |
08:37:09 | dadada | leorize[m]: the same works seems to work on play.nim-lang.org, there's only the one difference that I merged two modules into one file on play.nim-lang.org |
08:37:29 | dadada | s/the same/the same code/ |
08:37:51 | dadada | both on version 1.2.0 |
08:38:09 | Prestige | Hmm I need to look into how nimble wants me repo structured |
08:38:20 | dadada | what OS is play.nim-lang.org running? |
08:38:25 | FromDiscord | <Rika> linux |
08:38:27 | Prestige | I fought it for a while and dislike the structure it was okay with |
08:38:33 | dadada | I'm on linux to |
08:38:34 | dadada | too |
08:39:03 | * | narimiran quit (Ping timeout: 258 seconds) |
08:41:17 | FromGitter | <Vindaar> @voltist: yes, essentially. Not quite sure what you mean by "down the x axis" though. In parallel to the x axis or orthogonal? |
08:43:10 | FromGitter | <Vindaar> e.g. on the y = 0 line: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ using `linerange` is easier, because then you don't have to specify two points and thus add something to a DF [https://gitter.im/nim-lang/Nim?at=5e9abd9ee920022432b44c7a] |
08:43:50 | FromGitter | <Vindaar> note that the `xMin` and `xMax` values are from 0 to 1, since the x axis is discrete and thus covers (0, 1) by definition |
08:44:13 | voltist | Yeah that's exactly what I had in mind, thanks |
08:49:18 | FromGitter | <Vindaar> :) |
08:51:11 | FromGitter | <Vindaar> ok, the PR is merged now |
08:53:11 | * | dwdv joined #nim |
08:55:03 | * | leth left #nim ("ERC (IRC client for Emacs 26.3)") |
08:58:06 | voltist | @Vindaar Good stuff https://liamsc.com/misc/forward.png |
08:58:37 | FromDiscord | <Rika> oh no, small issue i have with PEGs now; theyre slower than my current solution. at least the one i made... |
08:58:54 | FromGitter | <Vindaar> @voltist: nice! |
09:17:42 | * | couven92 quit (Read error: Connection reset by peer) |
09:18:07 | * | couven92 joined #nim |
09:19:14 | * | couven92 quit (Read error: Connection reset by peer) |
09:19:37 | * | couven92 joined #nim |
09:19:59 | * | Trustable joined #nim |
09:26:36 | * | hax-scramper quit (Ping timeout: 265 seconds) |
09:31:13 | * | wiltzutm[m] joined #nim |
09:45:14 | * | Trustable quit (Remote host closed the connection) |
09:49:36 | * | hax-scramper joined #nim |
09:55:15 | * | couven92 quit (Read error: Connection reset by peer) |
09:55:41 | * | couven92 joined #nim |
10:11:08 | FromDiscord | <__ibrahim__> hello, i try to compile server.nim on linux centos it says `Error: cannot open file: asyncdispatch` |
10:11:22 | FromDiscord | <__ibrahim__> hello, i try to compile server.nim on linux centos it says |
10:11:22 | FromDiscord | <__ibrahim__> `Error: cannot open file: asyncdispatch` |
10:13:37 | FromDiscord | <Yardanico> @__ibrahim__ how did you install Nim? and what's it version (run "nim -v") |
10:14:01 | FromDiscord | <__ibrahim__> nim 1.2.0 |
10:14:08 | FromDiscord | <__ibrahim__> i installed it on centos 8 using snap |
10:14:30 | FromDiscord | <Yardanico> really strange, maybe nim can't find the stdlib with the snap image, what if you try to import any other module like "import strutils"? |
10:14:42 | * | couven92 quit (Read error: Connection reset by peer) |
10:15:04 | FromDiscord | <__ibrahim__> cannot open file: strutils |
10:15:09 | * | couven92 joined #nim |
10:15:29 | Yardanico | huh, guess something's wrong with the snap image then |
10:15:35 | FromDiscord | <__ibrahim__> maybe there is a better way to install thatn snap |
10:15:36 | lqdev[m] | try installing using choosenim. |
10:15:55 | FromDiscord | <__ibrahim__> ok |
10:15:58 | lqdev[m] | anything is better than snap, to be honest |
10:16:15 | FromDiscord | <__ibrahim__> im gonna delete the nim in snap |
10:16:33 | Yardanico | yeah, do that so there would be no conflicts |
10:16:54 | FromDiscord | <__ibrahim__> exporting file path to ~/.profile with snap didnt work either |
10:17:15 | Yardanico | that wouldn't work, nim has it's own logic for detecting stdlib location |
10:22:08 | * | letto quit (Quit: Konversation terminated!) |
10:24:20 | * | letto joined #nim |
10:24:39 | FromDiscord | <__ibrahim__> it worked |
10:24:42 | Yardanico | nice |
10:25:33 | FromDiscord | <__ibrahim__> btw i have |
10:25:33 | FromDiscord | <__ibrahim__> `export PATH=/home/***/.nimble/bin:$PATH` |
10:25:33 | FromDiscord | <__ibrahim__> but the terminal isnt detecting nim |
10:25:50 | FromDiscord | <__ibrahim__> in ~/.bash_profile |
10:25:56 | Yardanico | what terminal? |
10:25:57 | FromDiscord | <__ibrahim__> any ideas? |
10:26:04 | Yardanico | bash_profile will only work for bash |
10:26:06 | FromDiscord | <__ibrahim__> default centos |
10:27:12 | Yardanico | well, did you reopen the terminal after adding that to ~/.bash_profile ? |
10:27:23 | FromDiscord | <__ibrahim__> nim |
10:27:23 | FromDiscord | <__ibrahim__> bash: nim: command not found... |
10:27:25 | FromDiscord | <__ibrahim__> yes i have |
10:27:26 | Yardanico | alsl does /home/<yourname/.nimble/bin contain "nim" symlink? |
10:27:44 | Yardanico | after installing choosenim you need to install nim |
10:27:50 | Yardanico | via choosenim |
10:28:04 | Yardanico | like "choosenim stable" |
10:28:43 | FromDiscord | <__ibrahim__> ./choosenim stable |
10:28:43 | FromDiscord | <__ibrahim__> version 1.2.0 already selected |
10:29:25 | Yardanico | where is that choosenim binary located? |
10:29:42 | FromDiscord | <__ibrahim__> in .nimble/bin |
10:30:33 | Yardanico | can you run nim from the same folder? |
10:30:43 | FromDiscord | <__ibrahim__> yes if i do ./nim it works |
10:31:06 | FromDiscord | <__ibrahim__> else if im outside i need to type the whole path for it to work |
10:32:38 | Yardanico | well then for some reason stuff in ~/.bash_profile isn't getting applied, sorry, don't really know why it's that way, but it's related to the shell and not nim really, try to relogin or something |
10:34:25 | FromDiscord | <__ibrahim__> ok thank you |
10:34:29 | Yardanico | try doing "source ~/.bash_profile" and see if nim works after that |
10:34:36 | FromDiscord | <__ibrahim__> it works |
10:34:42 | FromDiscord | <__ibrahim__> but in new shell |
10:34:44 | FromDiscord | <__ibrahim__> it doesnt |
10:35:07 | Yardanico | well yes "source ~/.bash_profile" works for current shell session only |
10:35:14 | Yardanico | so for some reason bash on your system doesn't read ~/.bash_profile |
10:35:20 | FromDiscord | <Rika> use ~/.profile then no? |
10:35:34 | * | hf joined #nim |
10:35:54 | * | hf is now known as Guest38383 |
10:35:56 | * | Guest38383 is now known as Faulander |
10:36:32 | FromDiscord | <__ibrahim__> doesnt work there either |
10:37:42 | FromDiscord | <__ibrahim__> im sure there must be something i did wrong, but anyway thanks alot for the help guys |
10:39:36 | * | voltist quit (Remote host closed the connection) |
10:40:12 | Faulander | hey guys, i have a unicode/utf8 problem. i am running the console program on a linux machine, connected via ssh from windows cmd.exe all utf8 symbols are scrambled and not correctly displayed. i already set the codepage of the windows terminal to 65001, i am out of ideas. |
10:44:54 | * | krux02 joined #nim |
10:44:55 | Yardanico | what happens if other programs on that linux machine try to output utf8 characters? |
10:45:52 | Faulander | no clue if i have another program that outputs utf8 chars |
10:46:03 | Faulander | i could write up a small nim program |
10:47:04 | Yardanico | try to write a bash script which outputs some utf8 chars |
10:47:08 | Yardanico | and run it via ssh from windows |
10:47:17 | Yardanico | if output is still scrambled - it's not a nim issue |
10:47:28 | Yardanico | but rather due to that ssh client not supporting utf8 or something |
10:51:55 | dom96 | Faulander, there is a bug for this on the issue tracker IIRC |
10:54:02 | Faulander | i try with putty, there i can set the encoding |
10:54:37 | Faulander | there are two things i hate about programming: Encoding and TIME/DATE Issues |
10:55:53 | Yardanico | well there are much less encoding issues on *nix since almost all of them use UTF-8 by default nowadays :) |
10:57:31 | FromDiscord | <__ibrahim__> am i supposed to be able to compile to js using the async stuff? |
11:02:22 | Faulander | doesn't work on putty with utf-8 encoding either |
11:03:15 | dom96 | @__ibrahim__ you are not |
11:03:34 | dom96 | You may be able to use https://nim-lang.org/docs/asyncjs.html though |
11:04:05 | dom96 | Although you won't get a seamless C/JS async/await experience with that I'm afraid |
11:06:21 | Faulander | here's a screenshot, just echoing some utf-8 characters: https://imgur.com/a/S19HtYR |
11:06:37 | Yardanico | maybe you don't have fonts or something? |
11:07:55 | FromDiscord | <__ibrahim__> cool, thanks dom96 |
11:08:03 | Faulander | the first one is: U+22D8, ⋘ |
11:08:05 | disbot | https://github.com/nim-lang/Nim/issues/8920 -- 5[Regression (?)] -Inf.int throws OverflowError ; snippet at 12https://play.nim-lang.org/#ix=2ivs |
11:08:51 | Yardanico | ? |
11:09:03 | Yardanico | ah lol disbot reacted to hash8920 |
11:09:04 | FromDiscord | <Rika> bot recognized #8920 part |
11:09:06 | disbot | https://github.com/nim-lang/Nim/issues/8920 -- 5[Regression (?)] -Inf.int throws OverflowError ; snippet at 12https://play.nim-lang.org/#ix=2ivs |
11:09:11 | FromDiscord | <Rika> lmao |
11:10:02 | * | Faulander giggles |
11:10:35 | * | noonien joined #nim |
11:12:24 | Faulander | according to this page: https://cs.nyu.edu/~yap/html/mathematical_operators.html all of the characters are in the COURIER NEW font, which putty uses (and windows cmd.exe) |
11:25:10 | * | lritter quit (Quit: Leaving) |
11:27:53 | * | crem quit (Quit: WeeChat 2.6) |
11:51:37 | * | liblq-dev joined #nim |
12:00:50 | * | zacharycarter joined #nim |
12:01:17 | * | endragor quit (Remote host closed the connection) |
12:02:43 | * | opal quit (Ping timeout: 240 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:37 | * | supakeen joined #nim |
12:08:39 | * | dadada quit (Ping timeout: 260 seconds) |
12:09:25 | * | dadada joined #nim |
12:09:49 | * | dadada is now known as Guest91062 |
12:16:30 | zacharycarter | how can I get an unsafe pointer from a ref object? |
12:16:38 | zacharycarter | `addr`? |
12:16:47 | zacharycarter | that would give me a pointer to the reference right? |
12:17:38 | zacharycarter | yeah - i guess a cast is the right way |
12:17:40 | dom96 | addr myRef[] |
12:17:49 | zacharycarter | thanks dom |
12:20:18 | zacharycarter | @dom96: I'm passing this pointer to a thread func, and I'd like to be able to get back to the ref object so do I need to box the object in the thread func to do so? |
12:20:36 | zacharycarter | casting to a pointer and then casting back to the ref object worked - but is that correct at all? |
12:22:17 | Araq | it is. |
12:23:32 | zacharycarter | thanks Araq |
12:24:19 | dom96 | huh, how can that work? Are you using boehm? |
12:24:52 | dom96 | accessing an object allocated in another thread's heap should fail |
12:24:53 | zacharycarter | arc |
12:25:10 | dom96 | oh |
12:26:11 | zacharycarter | arc's making all my Nim dreams come true |
12:26:46 | zacharycarter | although now I realize I probably could have done a lot more with the default GC had I understood memory management better - but regardless, arc makes it easier to reason about things |
12:28:24 | * | audiophile joined #nim |
12:35:59 | * | crem joined #nim |
12:36:15 | * | endragor joined #nim |
12:40:34 | * | endragor quit (Ping timeout: 240 seconds) |
12:47:34 | * | xcm quit (Ping timeout: 240 seconds) |
12:49:51 | * | xcm joined #nim |
13:09:20 | * | endragor joined #nim |
13:13:39 | * | endragor quit (Ping timeout: 256 seconds) |
13:14:30 | * | muffindrake quit (Quit: muffindrake) |
13:17:40 | * | couven92 quit (Read error: Connection reset by peer) |
13:18:09 | * | couven92 joined #nim |
13:19:27 | * | xcm quit (Read error: Connection reset by peer) |
13:21:28 | * | xcm joined #nim |
13:21:38 | * | ryan_ quit (Remote host closed the connection) |
13:21:56 | * | ryan_ joined #nim |
13:22:00 | * | Mister_Magister quit (Ping timeout: 256 seconds) |
13:22:25 | * | letto quit (Remote host closed the connection) |
13:22:36 | * | Mister_Magister joined #nim |
13:22:50 | * | letto joined #nim |
13:45:13 | Yardanico | continued doing http://www.craftinginterpreters.com today, on functions chapter, the author implements return statement with Java exceptions (well, I did the same in Nim), and the for most stupid microbenchmark with recursive fibonacci with n = 20 my interpreter is about 30ms vs python 17ms :P |
13:45:42 | Yardanico | when I finish this first part I'll write the second implementation in C as the author does just so I can learn a bit about C and lower-level stuff |
13:48:52 | zacharycarter | Would be cool to write the second implementation in Nim |
13:49:01 | zacharycarter | maybe I'll do that when I have time |
13:49:19 | Yardanico | well it's pretty low-level since you implement everything starting from hash tables |
13:49:38 | zacharycarter | sounds fun :D |
13:51:32 | Araq | Yardanico: what the...? |
13:52:02 | Araq | ah you mean your interpreter vs Python's interpreter and not your interpreter written in Python |
13:52:07 | Araq | confusing... |
13:52:15 | Yardanico | Araq: it's the most naive implementation, I'm just following the book with some changes because I"m writing Nim and not Java :P |
13:52:25 | Yardanico | I bet Java implementation would be slower |
13:52:45 | Araq | well as I keep saying, just copy Nim's VM |
13:53:05 | Yardanico | for a real toy interpreter I'll maybe just do this, but I need to learn some stuff so I can understand what's going on it that VM :D |
13:53:12 | Yardanico | *in |
13:53:36 | Araq | I don't even understand what is there to "understand" |
13:53:51 | Araq | you have a loop with a case statement inside. |
13:56:11 | Araq | in fact, calling these things "virtual machines" is hyperbole, it's liking calling a bike a "virtual airplane" |
13:56:18 | Araq | *like |
13:57:32 | nisstyre | Yardanico: the python interpreter is of course written in C and heavily optimized |
13:57:54 | Yardanico | nisstyre: well yeah, but also my interpreter is very bare-bones and Python interpreter probably has to initialize more stuff |
13:57:57 | nisstyre | so I would actually say those numbers reflect really well on Nim for what it's doing |
13:58:17 | nisstyre | Yardanico: I'd have to look at what it's doing but ok |
13:58:37 | Araq | nisstyre: the Python interpreter isn't "heavily optimized", but it's ok |
13:58:53 | nisstyre | fair enough |
13:59:21 | Yardanico | just to give you some info - environments in my current implementation are just TableRefs, and in recursive fibonacci with n = 20 the call stack probably has more than 100 depth |
13:59:56 | nisstyre | Yardanico: so no tail-call elimination then I guess |
14:00:02 | nisstyre | that would be the first thing I'd try to implement |
14:00:17 | * | muffindrake joined #nim |
14:00:42 | Araq | well that would defeat the purpose which is to measure function call overhead |
14:00:56 | nisstyre | actually your code probably isn't tail recursive |
14:00:56 | Yardanico | also gc:arc gives just around same speeds |
14:01:01 | nisstyre | yeah |
14:01:16 | Yardanico | nisstyre: it's just this example from the book itself https://gist.github.com/Yardanico/f042367d4025105302cfeaa0deecc121 |
14:01:29 | nisstyre | yeah that's what I figured |
14:01:59 | livcd | how do I find out what's wrong with this? https://paste.centos.org/view/15d00dd6 |
14:03:01 | Yardanico | livcd: probably you're trying to echo a nil value? |
14:03:04 | Araq | livcd: -d:useMalloc + valgrind |
14:05:03 | livcd | ok |
14:08:11 | livcd | Maybe something with streams and arc? |
14:08:28 | * | rokups joined #nim |
14:09:15 | livcd | also maybe something with cpp and streams? with c it's 0.052s with cpp it's 0.52 |
14:11:52 | Araq | huh? now you're talking about runtimes |
14:13:20 | * | endragor joined #nim |
14:17:40 | disruptek | bikes, airplanes, runtimes. |
14:19:04 | * | narimiran joined #nim |
14:19:34 | * | solitudesf joined #nim |
14:26:25 | livcd | oh nvm it's my fault |
14:26:46 | * | narimiran quit (Quit: leaving) |
14:27:53 | Araq | livcd: what a refreshing outcome. usually it's the Nim compiler's fault. Or mine. |
14:28:36 | FromDiscord | <EdgyNerd> how can I initialise an array of 500 2's? |
14:29:16 | Yardanico | well there's https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
14:29:26 | Yardanico | but idk if you can initialize an array with a different value |
14:29:34 | FromDiscord | <Rika> var a: array[500, int]; for i in 0..499: a[i] = 2 |
14:29:35 | Araq | 2 &* 500 EdgyNerd |
14:29:55 | FromDiscord | <Rika> @EdgyNerd see araq's reply |
14:30:06 | FromDiscord | <EdgyNerd> oh yep that'll work, thanks |
14:30:23 | FromDiscord | <Rika> should i just read through the whole system docs... |
14:30:30 | FromDiscord | <Rika> so i learn this stuff |
14:30:40 | disruptek | nope; araq gets pissy when you rtfm. |
14:30:48 | disruptek | he likes the handholding. |
14:30:55 | Araq | my solution only works in a hypothetical Nim where we are allowed to have new operators |
14:31:28 | Araq | :D |
14:32:58 | livcd | does async work well with arc in this hypothetical Nim? |
14:34:16 | Araq | livcd: yup |
14:35:10 | * | couven92 quit (Read error: Connection reset by peer) |
14:35:25 | livcd | cool! |
14:35:36 | * | couven92 joined #nim |
14:35:40 | Araq | I should probably hack together some prototype and call it Arcyncq |
14:44:49 | disruptek | ~stream |
14:44:50 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
14:44:53 | Yardanico | yay |
14:45:16 | disruptek | i think i added a bug yesterday. |
14:46:24 | Araq | disruptek: you're a good boy. It takes courage to add bugs. |
14:53:53 | FromDiscord | <Recruit_main707> `short month_days[] = {31,28,31};` whats the nim equivalent to something like this? |
14:54:18 | Yardanico | let month_days = [31'i16, 28, 31] |
14:54:30 | FromDiscord | <Recruit_main707> ok, thanks |
14:54:31 | Yardanico | if you really want it to be "short" (16-bit int) |
14:54:46 | FromDiscord | <Recruit_main707> nah, it was just an example |
14:59:04 | livcd | what is disruptek working on? |
14:59:20 | Yardanico | he'll be working on a compiler shortly |
14:59:25 | Yardanico | but just now he fixed his pulseaudio tool |
15:01:02 | Araq | he works on IC |
15:01:14 | Araq | I help him by telling him things he already knows |
15:01:40 | livcd | i checked it on github but I have no idea what it does |
15:03:09 | Araq | livcd: in the end it will make your recompiles faster |
15:03:28 | livcd | Araq: no i meant his pulseauto tool |
15:03:50 | Araq | lol |
15:05:36 | livcd | disruptek what the heck is that pulseauto for? :P |
15:05:52 | disruptek | are there no docs? |
15:06:30 | FromDiscord | <Rika> its pulse AUDIO not pulseauto |
15:06:41 | disruptek | nah. |
15:06:43 | disruptek | !repo pulseauto |
15:06:44 | disbot | https://github.com/disruptek/pulseauto -- 9pulseauto: 11setup pulseaudio stream levels via app names or pids 15 1⭐ 0🍴 |
15:09:55 | livcd | disruptek: you are a human guinea pig |
15:10:00 | * | Trustable joined #nim |
15:11:40 | FromDiscord | <Rika> m |
15:11:41 | FromDiscord | <Rika> i see |
15:12:04 | disruptek | wut |
15:12:20 | livcd | guinea pigs are hungry all the time |
15:12:43 | disruptek | seriously. |
15:12:45 | livcd | they are a little fooddiggers |
15:12:49 | * | zacharycarter quit (Ping timeout: 264 seconds) |
15:16:38 | * | xcm is now known as Guest30329 |
15:16:38 | * | Guest30329 quit (Killed (hitchcock.freenode.net (Nickname regained by services))) |
15:18:26 | * | xcm joined #nim |
15:19:53 | dom96 | lolwat |
15:20:20 | Yardanico | @dom96 https://www.twitch.tv/disruptek :D |
15:21:10 | FromDiscord | <Recruit_main707> would the bridge bot be able to work at any server? |
15:21:31 | FromDiscord | <Recruit_main707> ie: someone wants to connect a discord server and a gitter one? |
15:21:31 | FromDiscord | <Rika> i dont see why not |
15:21:37 | FromDiscord | <Rika> oh |
15:21:38 | Yardanico | @Recruit_main707 wdym exactly? |
15:21:52 | FromDiscord | <Rika> which bridge, first of all |
15:22:10 | Yardanico | ircord is only for IRC<->Discord, but it manages "FromGitter" and "[m]" names in IRC so they appear with nice suffixes on Discord |
15:22:23 | Yardanico | creating a matterbridge alternative to bridge different platforms is kinda harder :) |
15:22:34 | FromDiscord | <Rika> you should also manage kde bridge style names, -m i think is what they use |
15:22:51 | Yardanico | I don't think we have any in Nim channel here :P |
15:23:04 | FromDiscord | <Rika> we had one before |
15:23:28 | Yardanico | ok help me fix the bridge itself instead so we can finally use it here |
15:23:43 | FromDiscord | <Rika> aight im out |
15:24:04 | FromDiscord | <Recruit_main707> so, it cant connect a gitter server and a discord one? |
15:24:11 | FromDiscord | <Rika> i mean i would but i still have no clue what the issue is |
15:24:27 | Yardanico | @Recruit_main707 "ircord" is for Discord<->IRC |
15:24:52 | Yardanico | there's also my 2-year-old simple twitchrelay app to bridge IRC and Twitch IRC chats |
15:25:03 | Yardanico | when dom or 4raq started doing some streams on Twitch |
15:25:33 | Yardanico | you can still find references of it, e.g. on gitter #nim-offtopic is mapped to nim-lang/twitch |
15:25:35 | Yardanico | https://github.com/Yardanico/twitchrelay |
15:29:54 | FromDiscord | <Recruit_main707> how could i check the endianness of the machine my code runs on? |
15:30:12 | Yardanico | https://nim-lang.org/docs/system.html#cpuEndian |
15:30:54 | Yardanico | that const is either littleEndian or bigEndian depending on your target, but generally most architectures are LE |
15:30:59 | Yardanico | like x86 and x86_64 are little endian |
15:31:06 | FromDiscord | <Recruit_main707> is it available at runtime? |
15:31:13 | Yardanico | ehm |
15:31:21 | Yardanico | you can't run the code you compiled for little endian arch on a big-endian really |
15:31:24 | FromDiscord | <Recruit_main707> yeah, that const answered me |
15:31:31 | Yardanico | maybe you want functions which swap endianness instead? |
15:31:34 | FromDiscord | <Skaruts> is there a Nim equivalent to C's `#define Foo`? |
15:31:44 | Yardanico | -d:Foo |
15:32:09 | Yardanico | it depends on what you want to do |
15:32:10 | FromDiscord | <Rika> `when defined(Foo):`? |
15:32:13 | FromDiscord | <Recruit_main707> Yaradinco: i want that, (i already found them) but i must check wether it should be done |
15:32:21 | Yardanico | @Recruit_main707 yeah it's not hard |
15:32:24 | Yardanico | lemme show |
15:32:37 | FromDiscord | <Skaruts> something that can be used with `when` conditions |
15:32:52 | FromDiscord | <Skaruts> when defined, or something along those lines |
15:33:01 | Yardanico | when defined is for any symbol |
15:33:34 | FromDiscord | <Rika> i was ignored 😦 |
15:33:42 | FromDiscord | <Skaruts> so it checks for the existence of a variable? |
15:34:36 | FromDiscord | <Skaruts> @Rika no you weren't :), just that that's what it's for, but not what I'm looking for here |
15:34:44 | Yardanico | can you better explain what you want? |
15:34:52 | FromDiscord | <Rika> that ^ |
15:35:29 | FromDiscord | <Skaruts> well, conditional compiling, based on whether something has been defined |
15:35:34 | Yardanico | when defined |
15:35:43 | Yardanico | there's also "when compiles" |
15:35:53 | Yardanico | https://nim-lang.org/docs/system.html#compiles%2Cuntyped |
15:35:57 | FromDiscord | <Skaruts> but how to define something, is what I'm asking |
15:35:58 | Yardanico | https://nim-lang.org/docs/system.html#defined%2Cuntyped |
15:36:15 | FromDiscord | <Rika> on compile, add `-d:Foo` |
15:36:35 | FromDiscord | <Skaruts> can't be done through code? |
15:36:36 | Yardanico | @Skaruts mainly it's done via -d (short for --define) in the compiler, yes |
15:36:42 | Yardanico | @Skaruts will also work for consts |
15:36:56 | Yardanico | and types |
15:37:03 | Yardanico | ah wait actually no |
15:37:17 | Yardanico | it only works for -d:, for variables you need https://nim-lang.org/docs/system.html#declared%2Cuntyped |
15:38:23 | FromDiscord | <Rika> defined is for feature flags aint it |
15:38:35 | Yardanico | for any compiler defines |
15:39:09 | FromDiscord | <Skaruts> that may help |
15:39:25 | FromDiscord | <Skaruts> gonna give it a try |
15:39:36 | FromDiscord | <Yardanico> @Recruit_main707 see how I did it here https://github.com/Yardanico/nimnbt/blob/00b6ff31547ea3bbe5d4027bd9e5b03415f1f8a4/src/nimnbt.nim#L35 |
15:39:40 | FromDiscord | <Yardanico> about endianness |
15:39:58 | FromDiscord | <Yardanico> and after that code there are usages of it |
15:40:43 | FromDiscord | <Recruit_main707> nice, thanks |
15:40:44 | FromDiscord | <Yardanico> I do it because "The datatypes representing numbers are in big-endian in the PC version, but Pocket Version is in little-endian." |
15:41:00 | FromDiscord | <Yardanico> that code is pretty old though, but I still remembered that I used endianness here 😛 |
15:46:54 | FromDiscord | <Recruit_main707> this code only complains the second time, why?? |
15:46:54 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2ix9 |
15:47:54 | FromDiscord | <Rika> ran it once and it complained |
15:48:37 | FromDiscord | <Recruit_main707> i mean, those two lines are the same, but it only errors in the second one, (here i have isLittle defined: https://play.nim-lang.org/#ix=2ixd) |
15:48:47 | Yardanico | becaise there's no isLittle |
15:48:51 | Yardanico | that's my own constant |
15:48:54 | Yardanico | check my code again |
15:49:04 | Yardanico | https://github.com/Yardanico/nimnbt/blob/00b6ff31547ea3bbe5d4027bd9e5b03415f1f8a4/src/nimnbt.nim#L33 |
15:49:05 | FromDiscord | <Recruit_main707> i know, i have it defined obv :P |
15:49:14 | FromDiscord | <Recruit_main707> that second url has it |
15:49:33 | Yardanico | type mismatch: got <seq[byte]> but expected 'uint16' is pretty self-explanatory |
15:49:39 | Yardanico | byte is 1 byte, uint16 is 2 bytes |
15:49:58 | FromDiscord | <Rika> @Recruit_main707 islittle is true |
15:50:02 | FromDiscord | <Rika> when collapses the statement |
15:50:08 | Yardanico | and what buf[0..1] is supposed to mean? |
15:50:08 | FromDiscord | <Rika> so 1st is never read |
15:50:14 | Yardanico | oh I get what you're trying to do |
15:50:33 | FromDiscord | <Rika> when is compile time so any nonmatching branches are completely removed from runtime |
15:50:35 | FromDiscord | <Recruit_main707> i will swapEndian16 one of those |
15:50:37 | Yardanico | you want to make an uint16 from two bytes? |
15:50:53 | FromDiscord | <Recruit_main707> yes |
15:53:11 | Yardanico | are you dealing with streams? |
15:53:15 | Yardanico | (streams module) |
15:53:26 | FromDiscord | <Recruit_main707> no |
15:53:31 | FromDiscord | <Recruit_main707> at least not for now |
15:54:16 | FromDiscord | <Recruit_main707> `uint16(buf[1] shl buf[0])` should i do something like this? |
15:54:19 | Yardanico | try https://forum.nim-lang.org/t/2626#16256 |
15:54:38 | FromDiscord | <Rika> buf[1] shl 8 and buf[0] or something like that i'd do |
15:54:41 | Yardanico | or https://forum.nim-lang.org/t/2626#16241 |
15:55:06 | Araq | buf[1] shl 8 or buf[0] |
15:55:19 | Araq | 'or', not 'and' |
15:55:20 | Yardanico | and then jus swap endianness if you need |
15:55:25 | FromDiscord | <Rika> oooops |
15:55:35 | FromDiscord | <Rika> sorry for being brainlet lol |
15:55:47 | FromDiscord | <Recruit_main707> ok thank you all |
15:57:21 | * | hax-scramper quit (Ping timeout: 250 seconds) |
15:57:29 | * | rockcavera joined #nim |
15:57:35 | * | chemist69 quit (Ping timeout: 272 seconds) |
15:58:07 | * | chemist69 joined #nim |
15:58:54 | * | zacharycarter joined #nim |
16:02:41 | * | hax-scramper joined #nim |
16:05:28 | federico3 | https://github.com/nim-lang/Nim/issues/9785 how comes this is high priority and had no updates in years? |
16:05:31 | disbot | ➥ Crash in Nim's SSL handling code ; snippet at 12https://play.nim-lang.org/#ix=2ixp |
16:07:21 | * | crem quit (Quit: WeeChat 2.8) |
16:07:54 | * | crem joined #nim |
16:07:58 | leorize | federico3: because no one could reproduce it |
16:08:48 | FromDiscord | <Recruit_main707> `buf[1] shl 8 or buf[0]` how would this code be used for 32 bit, and 64 bit? |
16:09:21 | * | nsf quit (Quit: WeeChat 2.8) |
16:09:37 | leorize | I played with FutureStreams and the API of it is kinda useless |
16:09:55 | leorize | guess I'm off to design my own :/ |
16:10:06 | FromDiscord | <Rika> buf[4] shl 24 or ... 16 or ... 8 or buf[0] |
16:12:09 | FromDiscord | <Recruit_main707> another vscode error, openArray never gets highlighted despite being a type... |
16:13:09 | Yardanico | it's not that smart really |
16:13:21 | dom96 | leorize: please do and make a PR for the stdlib |
16:13:31 | Yardanico | it highlights only stuff which starts with an uppercase character (because most nim types are like this) and for special stuff like "openarray" |
16:13:38 | Yardanico | yes it highlights "openarray" but not "openArray" |
16:14:25 | krux02 | leorize, you mean mean FutureStreams don't provide value to Nim? |
16:14:53 | * | xcm quit (Read error: Connection reset by peer) |
16:14:59 | * | liblq-dev quit (Ping timeout: 256 seconds) |
16:17:02 | * | xcm joined #nim |
16:17:20 | leorize | krux02: I mean that the API make it useless |
16:17:24 | leorize | maybe I'm using it wrong |
16:18:54 | leorize | Yardanico: so it has no concept of Nim's style insensitivity |
16:19:22 | Yardanico | leorize: yeah, it really only differentiates between Type and type by first character |
16:19:38 | Yardanico | so Type and TyPE will get highlighted, but not openArray even if it's a type |
16:19:41 | leorize | dom96: I'm not even sure if I'm using FutureStream correctly |
16:19:47 | leorize | how are you even supposed to use that? |
16:20:19 | leorize | I'm having an input stream from a pipe and it's async |
16:21:51 | FromDiscord | <Rika> well, syntax highlighters cant determine if a symbol is a type |
16:22:04 | FromDiscord | <Rika> it can prolly do openarray properly though |
16:22:05 | Yardanico | well vscode nim plugin uses nimsuggest for other things |
16:22:34 | Yardanico | and believe it or not - nimsuggest can provide highlightings too |
16:22:43 | Yardanico | indirectly, but you can get all symbols from the file and highlight all types for example |
16:22:56 | FromDiscord | <Rika> yeah |
16:22:59 | FromDiscord | <Rika> but it doesnt use that |
16:23:09 | FromDiscord | <Rika> because syntax highlighting is faster than semantic highlighting |
16:23:20 | Yardanico | you can use both |
16:23:21 | leorize | I don't think vscode even support dynamic highlighting |
16:23:26 | leorize | yea you can use both |
16:23:29 | leorize | try nim.nvim |
16:23:56 | FromDiscord | <Rika> in vscode? |
16:24:03 | Yardanico | in general |
16:24:28 | FromDiscord | <exelotl> wtfff I accidentally enabled a Nim REPL in vcode???? |
16:24:28 | FromDiscord | <exelotl> https://cdn.discordapp.com/attachments/371759389889003532/701105879709122649/unknown.png |
16:24:31 | FromDiscord | <Rika> well yeah but not in vscode i dont think |
16:24:41 | FromDiscord | <Rika> @exelotl yeah, `nim secret` |
16:24:53 | Yardanico | @exelotl yeah for some reason it binds "Alt+Enter" for "nim secret" |
16:25:01 | Yardanico | "nim secret" is called like that for a reason though |
16:25:09 | Yardanico | ah wait it's not alt enter |
16:25:17 | FromDiscord | <exelotl> shift + enter |
16:25:49 | Yardanico | ye |
16:26:25 | shashlick | Araq: seeing a crash when printing a PNode, any ideas? https://pastebin.com/CRPNMtTw |
16:26:33 | shashlick | This is devel on osx |
16:27:06 | krux02 | Yardanico: for emacs I highlight everything as a type that follows a `:` |
16:27:20 | Yardanico | krux02: well I mean types appearing in code |
16:27:27 | Yardanico | like "newSeq[MyType]()" |
16:27:50 | krux02 | sorry, I don't do that anymore |
16:28:19 | krux02 | now it is everything that is declared as a type in system.nim and everything that starts with a capital letter. |
16:29:00 | FromDiscord | <Recruit_main707> Araq: is it openarray or openArray by "default" |
16:29:00 | krux02 | regular expression based highlighting only. |
16:29:16 | krux02 | Recruit_main707: you can just look at the declaration in system.nim |
16:29:19 | krux02 | and then you see it. |
16:29:45 | Yardanico | it's openArray but I've always used it as "openarray" lol :D |
16:29:45 | krux02 | Spoiler: it is `openArray` |
16:30:08 | FromDiscord | <Recruit_main707> ok |
16:30:21 | krux02 | The nim compiler uses a strict mode that enforces to use the style of the declaration. |
16:30:40 | krux02 | So you would get an error if you use `openarray` instead of `openArray` in one of the files. |
16:31:15 | FromDiscord | <Rika> why is it lowercase? |
16:31:17 | FromDiscord | <Rika> compat? |
16:33:38 | FromDiscord | <exelotl> vscode only highlights `openarray` |
16:34:10 | FromDiscord | <exelotl> I kinda find it more readable too :\ |
16:34:40 | FromDiscord | <exelotl> or rather, more aesthetically pleasing |
16:36:46 | * | xcm quit (Ping timeout: 265 seconds) |
16:40:50 | disruptek | leorize: did you say you had a fix for nimsuggest? |
16:41:09 | leorize[m] | fix for what? |
16:41:18 | * | xcm joined #nim |
16:41:19 | disruptek | compiler misbehavior. |
16:41:49 | leorize | what misbehavior lol :P |
16:42:00 | leorize | in general then I don't have any fix |
16:42:00 | disruptek | doesn't work. |
16:42:05 | disruptek | doh. |
16:42:14 | leorize | if about the forward decl problem then I do have an idea |
16:42:16 | disruptek | includes support? |
16:42:28 | leorize | yea the forward decl problem |
16:42:38 | leorize | include is processed correctly by nimsuggest |
16:42:43 | leorize | just that forward decl is not |
16:43:00 | disruptek | oh, well, i guess it's something wrong with my setup. |
16:43:20 | leorize | anyway to reproduce this? |
16:43:33 | leorize | and what kind of include support are you talking about? |
16:43:57 | disruptek | cgen.nim imports a lot of other ccg* files that have lotsa errors for me. |
16:44:08 | disruptek | and i cannot jump to defs in them. |
16:44:11 | leorize | it's due to your auto linter |
16:44:25 | leorize | can't jump to defs because I haven't fixed the forward decl thing yet |
16:44:31 | leorize | though it appears to be rather hard :/ |
16:45:36 | leorize | so the idea I have now is to capture the symbol `ref`, then if it has `sfForward`, wait until compilation is completed, then evaluate the symbol again |
16:46:06 | leorize | oh yea, how stable has `indent-rewrite` been for you? |
16:46:17 | leorize | I'd like to merge that one in to work on other things |
16:46:32 | disruptek | i dunno, i think nimsuggest is very unstable for my work. |
16:46:43 | disruptek | what's my linter called? |
16:47:50 | leorize | i dunno what you use |
16:47:52 | leorize | ale? |
16:47:57 | leorize | neomake? |
16:48:03 | leorize | or syntastic? |
16:48:14 | disruptek | ale, but even disabled, it's still broken. |
16:48:17 | disruptek | missing symbols. |
16:48:23 | disruptek | on an include. |
16:48:36 | leorize | hmm gotta investigate that one then :/ |
16:48:55 | disruptek | not sure it could ever work. |
16:48:56 | leorize | I'm working on something rn, so it'll be awhile before I can work on it |
16:49:04 | disruptek | np |
16:53:53 | * | waleee-cl joined #nim |
16:54:03 | * | liblq-dev joined #nim |
16:57:27 | zacharycarter | Is this valid C? `typedef volatile int* foo` - most of the explanations and example code I've encountered around volatile show it being used in variable declarations not type declarations` |
16:57:57 | leorize | yea it's valid |
16:58:41 | zacharycarter | I couldn't figure out how to do this in Nim so I did - {.emit: "typedef volatile int* foo_t".} and then type Foo {.importc: "foo_t".} = object |
16:59:05 | zacharycarter | then I declared `var f: Foo` and checked out the generated C code and it seems produce what I expect |
16:59:20 | zacharycarter | I know I need to use volatileload etc with this |
16:59:27 | FromDiscord | <Recruit_main707> `@Recruit_main707, you want to check if Nim has native ways to read scalars from memory` so thats the question :P |
17:00:20 | leorize | if you have a pointer you can get a value |
17:06:34 | * | audiophile_ joined #nim |
17:09:10 | * | audiophile quit (Ping timeout: 256 seconds) |
17:12:46 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2iy1 cant you edit an openArray? |
17:12:59 | Yardanico | you need to write it as "var openArray[byte" |
17:13:05 | Yardanico | *] |
17:13:14 | FromDiscord | <Recruit_main707> ah right 😁 |
17:16:56 | livcd | wth is wrong with vscode and nim. Sometiems I just dont get any syntax error checking wtf |
17:17:13 | Yardanico | it runs "nim check" and it's not always perfect :) |
17:17:38 | FromDiscord | <Rika> wish you could pass in raw text via some sorta IPC instead of needing to save the file |
17:17:55 | FromDiscord | <Recruit_main707> i clicked randomly over the problems ta and it fixed it, dont know if it had something to do though xD |
17:18:05 | FromDiscord | <Rika> actually, nim check needs the whole project directory |
17:18:10 | FromDiscord | <Rika> so im not sure how well that would go... |
17:18:52 | FromDiscord | <Rika> huh wait why does nim check need project directory anyway what |
17:18:56 | livcd | Yardanico: sometimes i dont see anything "running" |
17:19:06 | Yardanico | well "nim check" isn't running constantly |
17:19:21 | FromDiscord | <Rika> i think he means he doesnt see it running when it should |
17:20:57 | leorize | @Rika: well the IPC here is a file :P |
17:21:25 | leorize | it's arguably much simpler than any alternative |
17:21:34 | FromDiscord | <Rika> hmm i guess it is |
17:21:34 | leorize | though I think LSP have its own way |
17:27:02 | * | fALSO joined #nim |
17:27:05 | fALSO | Hello |
17:27:10 | leorize | hi |
17:27:54 | fALSO | Trying out nim for the first time, going to take a look at the parseopt library |
17:28:08 | * | rokups quit (Quit: Connection closed for inactivity) |
17:28:12 | leorize | I'd say don't use that one :P |
17:28:24 | fALSO | i need three arguments |
17:28:30 | leorize | usually these third party packages get the job done faster: |
17:28:32 | leorize | !repo cligen |
17:28:34 | disbot | https://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces 15 168⭐ 12🍴 7& 1 more... |
17:28:35 | leorize | !repo argparse |
17:28:37 | disbot | https://github.com/iffy/nim-argparse -- 9nim-argparse: 11Argument parsing for Nim 15 33⭐ 3🍴 7& 1 more... |
17:28:55 | fALSO | -m name [ -r time ] [ -s repeats ] |
17:28:58 | disruptek | 2nd argument: you can get better support for cligen. |
17:29:03 | fALSO | ok |
17:29:16 | fALSO | gonna look into your urls ;-) |
17:29:17 | Yardanico | fALSO: yeah cligen will be really easy to use for your use-case |
17:29:48 | fALSO | i have this made on a bash script using getopt, but its becoming too huge and hard to understand |
17:29:58 | fALSO | going to take a look at doing this in nim ;-) |
17:30:06 | fALSO | read about the lang on hacker news |
17:30:14 | fALSO | looks like python somehow |
17:30:27 | fALSO | thank you yardanico leorize |
17:30:29 | disruptek | the interwebs add 10lbs. |
17:31:13 | Yardanico | fALSO: it might look like python on the first glance, but it really is very different :) |
17:31:45 | fALSO | this clingen also seems to need = separating the key from the value |
17:31:50 | FromDiscord | <Recruit_main707> someone knows a bit of go in here? |
17:32:13 | * | tane joined #nim |
17:32:22 | leorize | most of us kinda do :P |
17:32:55 | FromDiscord | <Recruit_main707> `math.Float32bits(n)` is this the same as `cast[uint32](n)` in nim? |
17:33:09 | * | endragor quit (Remote host closed the connection) |
17:33:45 | Yardanico | "Float32bits returns the IEEE 754 binary representation of f, with the sign bit of f and the result in the same bit position. Float32bits(Float32frombits(x)) == x." |
17:34:00 | Yardanico | yeah |
17:34:03 | Yardanico | "func Float32bits(f float32) uint32 { return *(*uint32)(unsafe.Pointer(&f)) }" implementation |
17:34:14 | Yardanico | it's the same as casting |
17:34:50 | leorize | https://github.com/alaviss/nim-ryu/blob/master/basicconv.nim#L34-L52 |
17:34:56 | FromDiscord | <Recruit_main707> thank god, because i didnt understand shit in the wiki (that thing you have cited) |
17:34:59 | leorize | I have a bunch of helpers here that you're free to copy |
17:36:36 | Yardanico | @Recruit_main707 you could just check the source code :P |
17:36:54 | Yardanico | by clicking on "Float32bits" in the header here https://golang.org/pkg/math/#Float32bits |
17:37:21 | FromDiscord | <Recruit_main707> oh |
17:48:56 | * | dddddd joined #nim |
18:03:52 | * | xet7 joined #nim |
18:12:39 | * | endragor joined #nim |
18:17:30 | * | endragor quit (Ping timeout: 258 seconds) |
18:28:34 | disruptek | ~bentley |
18:28:34 | disbot | bentley: 11https://imgur.com/gallery/yEXiWWG -- disruptek |
18:28:34 | disbot | bentley: 11a good boy |
18:30:21 | dom96 | disruptek, is that your pupper? |
18:30:28 | disruptek | yeah. |
18:41:48 | Zevv | I can see that lump you found while petting him some time ago |
18:41:59 | disruptek | yeah. |
18:42:17 | disruptek | wait. |
18:42:26 | disruptek | yeah, it's still there. |
18:42:33 | Zevv | good! |
18:42:49 | disruptek | it's wore down to a nub. |
18:48:00 | * | zacharycarter quit (Ping timeout: 256 seconds) |
18:52:04 | Araq | disruptek: my code works |
18:52:15 | disruptek | what? |
18:52:32 | Araq | SSA for DrNim |
18:52:58 | disruptek | i wish that meant something to me. |
18:53:10 | disruptek | single something assignment? |
18:53:10 | Araq | but it's very complex. now what? rewrite? document it well? if so, where? |
18:53:22 | disruptek | just tests. |
18:53:31 | Araq | and I should really work on something more important... |
18:53:32 | disruptek | it is the nim way! |
18:53:46 | disruptek | people think you spend too much time on drnim and not enough on arc. |
18:53:48 | Araq | so ... how to get out of this dilemma? |
18:54:07 | Zevv | which is more fun? |
18:54:17 | Araq | disruptek: cooldome fixes ARC though and I review and merge his PRs |
18:54:19 | Zevv | let the minions do the mundane work, focus on the stuff that keeps you going! |
18:55:01 | disruptek | itym nimions |
18:55:03 | Araq | Zevv: right now DrNim makes my head explode which is why I'm doing it. I pretend to work on stuff nobody else can do |
18:55:46 | Zevv | araq: sweet, that's the stuff worth working on. Noone wants to see araq burned out on boring jobs |
18:57:11 | FromGitter | <Araq> check this out: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e9b4d87a9ca1862064921cb] |
18:58:01 | Zevv | that is darn sweet! |
18:58:03 | * | kenran joined #nim |
18:58:19 | disruptek | #12818 |
18:58:21 | Zevv | Will it be performant enough for real use? |
18:58:21 | disbot | https://github.com/nim-lang/Nim/issues/12818 -- 3inheritance and generics and ambiguous error message ; snippet at 12https://play.nim-lang.org/#ix=24K1 |
18:58:46 | * | kenran quit (Client Quit) |
18:58:55 | Araq | Zevv: it's pretty slow |
18:59:06 | * | kenran joined #nim |
18:59:26 | Araq | but we can cache the results, I ensured the string representation is sound and cachable |
19:00:46 | disruptek | #13510 |
19:00:47 | disbot | https://github.com/nim-lang/Nim/issues/13510 -- 3mutable iteration over mutable type produces a codegen error ; snippet at 12https://play.nim-lang.org/#ix=2cJp |
19:04:40 | * | xcm quit (Read error: Connection reset by peer) |
19:04:57 | * | endragor joined #nim |
19:06:36 | * | xcm joined #nim |
19:06:37 | * | zacharycarter joined #nim |
19:07:20 | * | xet7 quit (Ping timeout: 258 seconds) |
19:08:47 | * | xet7 joined #nim |
19:11:27 | * | endragor quit (Ping timeout: 260 seconds) |
19:12:14 | * | hax-scramper quit (Ping timeout: 240 seconds) |
19:13:17 | FromGitter | <sheerluck> Don't you think that is nice for gitter users that <Araq> from IRC switched to @Araq from Gitter when he wanted to paste code snippet? |
19:13:24 | * | fALSO left #nim (#nim) |
19:17:07 | Yardanico | he could paste code right here in IRC and nobody will say a thing :P |
19:21:16 | * | xcm quit (Ping timeout: 256 seconds) |
19:27:37 | FromDiscord | <KingDarBoja> Hi guys |
19:30:13 | Yardanico | greetings |
19:30:24 | * | xcm joined #nim |
19:33:37 | FromDiscord | <KingDarBoja> ❤️ |
19:37:43 | FromGitter | <zetashift> hiya |
19:39:56 | FromDiscord | <KingDarBoja> o/ |
19:41:13 | * | abm joined #nim |
19:41:24 | FromDiscord | <KingDarBoja> Watching anime right now instead of coding xD |
19:43:13 | FromGitter | <zetashift> sounds like me |
19:43:35 | leorize[m] | dom96: did you model FutureStream[T] after C#? |
19:43:55 | leorize[m] | I don't quite understand how this interface should be used |
19:44:15 | leorize[m] | at first I thought it would the the async equivalent of `Stream` |
19:44:19 | * | audiophile_ quit (Quit: Going offline, see ya! (www.adiirc.com)) |
19:44:37 | * | audiophile_ joined #nim |
19:44:53 | * | audiophile_ quit (Client Quit) |
19:47:30 | FromDiscord | <KingDarBoja> Sounds very Dart to me |
19:49:45 | leorize | the greatest feature that I can see in FutureStream is the ability to reuse memory |
19:50:03 | leorize | since you consume the value in the stream |
19:50:24 | leorize | but then with a little tweak to Future[T] it would work like that too |
19:52:37 | leorize | I think I'm misunderstanding futurestream |
19:52:52 | leorize | gonna see how rust do this kind of thing |
19:54:58 | * | hax-scramper joined #nim |
19:57:48 | Yardanico | oh guess I found a bug with gc:arc with my interpreter, maybe it's related to object variants |
20:02:41 | * | Jesin quit (Quit: Leaving) |
20:05:19 | Yardanico | seems I can make a relatively small repro, hmm |
20:12:15 | disruptek | yeah, variant objs are a little tricky for discriminator reasons. |
20:12:18 | Prestige | Elegant Beef: Why do you use XChangeWindowAttributes and XSelectInput? I thought they'd both do the same thing (registering the event mask) |
20:16:14 | * | hax-scramper quit (Ping timeout: 256 seconds) |
20:16:35 | Yardanico | disruptek: it seems to not be caused by object variants though :) |
20:17:30 | Yardanico | can't think of a good title though |
20:20:15 | Yardanico | also discovered a compiler SIGSEGV crash in the process, lol |
20:27:43 | * | Jesin joined #nim |
20:29:52 | Araq | Saturday night, nothing better to do |
20:30:16 | Araq | https://github.com/nim-lang/Nim/pull/11865 we can discuss it here if you want to |
20:30:19 | disbot | ➥ [feature] allow `import foo {.privateImport.}` ; snippet at 12https://play.nim-lang.org/#ix=2iAE |
20:31:05 | Yardanico | Araq: is code like https://play.nim-lang.org/#ix=2iAF supposed to work at all? It works with refc, but not with arc |
20:31:19 | Yardanico | I'm in the process of creating the issue so I wanted to ask |
20:31:39 | Yardanico | also doesn't work with orc |
20:31:51 | Araq | Yardanico, no. well the fact that it moves is a bug but afterwards you would have a cycle anyway |
20:32:03 | Araq | it's a known bug, somewhat hard to fix :P |
20:32:07 | Araq | or maybe not |
20:32:09 | disruptek | this private import is definitely a problem. |
20:32:11 | Yardanico | ah ok, then I don't need the issue? |
20:32:23 | Araq | it's a known bug |
20:32:34 | Araq | but once fixed you're left with a memory leak |
20:32:37 | Araq | :P |
20:33:08 | Araq | disruptek, the feature or the lack of this feature? |
20:33:13 | * | xcm quit (Remote host closed the connection) |
20:33:16 | disruptek | lack of |
20:33:28 | Araq | why? |
20:33:47 | FromDiscord | <Recruit_main707> sorry to interrupt. Can something like this be done? https://play.nim-lang.org/#ix=2iAG |
20:33:48 | disruptek | because i have to introduce /structure/ just to hide exports. |
20:34:03 | Yardanico | Araq: and what about compiler SIGSEGV if "type A = TableRef[string, B] B = A" |
20:34:15 | Yardanico | when trying to use these (I understand it's a endless recursion) |
20:34:22 | disruptek | openArray is for use in proc params. |
20:34:27 | Araq | Yardanico, that's new :-) |
20:34:49 | disruptek | it's senseless as a /type/ definition. |
20:34:56 | FromDiscord | <Recruit_main707> disruptek, so i should use a seq then right? |
20:35:02 | disruptek | yeah. |
20:35:10 | FromDiscord | <Recruit_main707> oki |
20:35:11 | disruptek | or array, etc. |
20:35:15 | Araq | Recruit_main707: you can use ptr UncheckedArray[byte] |
20:35:30 | * | xcm joined #nim |
20:35:30 | FromDiscord | <Recruit_main707> is ptr necesary? |
20:35:42 | Araq | yes |
20:36:02 | * | Trustable quit (Remote host closed the connection) |
20:36:03 | Araq | disruptek, please elaborate |
20:36:25 | disruptek | i want to hide code in different files. |
20:36:29 | FromDiscord | <Recruit_main707> as the language creator, which one is the best way (and i stop disturbing) |
20:36:38 | disruptek | these bits need to talk to each other, so a lot of stuff gets exported. |
20:36:50 | disruptek | but i really don't want to impose all that shit on the user of my library. |
20:37:02 | Araq | Recruit_main707: depends on the use case |
20:37:04 | disruptek | or even expose it to them. |
20:37:33 | Yardanico | I think private imports might be useful in some (not a lot of) cases |
20:37:36 | Yardanico | but still |
20:37:44 | disruptek | i think it's reasonable to hand my users unloaded weaponry. |
20:37:50 | Araq | disruptek, this changes the argument entirely |
20:38:03 | disruptek | i'm nothing if not predictable. |
20:38:17 | Yardanico | https://github.com/nim-lang/Nim/issues/14015 |
20:38:19 | disbot | ➥ Compiler crash when types recursively depend on each other ; snippet at 12https://play.nim-lang.org/#ix=2iAJ |
20:38:23 | Araq | the argument as I understood it was "other programmer X wrote Y and I seek to sneak into it" |
20:38:48 | Araq | your argument is now "I myself private import my own stuff so that I don't have to export fields to others" |
20:39:15 | Araq | which is a totally different viewpoint that I'll sleep over, thanks |
20:39:23 | FromDiscord | <Recruit_main707> the original go struct has this: `Bytes []byte` this transpilation is pretty big and id rather dont go back to things i considered done. |
20:40:01 | Araq | Recruit_main707: use a seq[byte] then or a 'ref seq[byte]' to emulate zero-copy slices |
20:40:18 | disruptek | the way krux does it explains the problem quite well. |
20:40:24 | FromDiscord | <Recruit_main707> ok cool |
20:40:27 | disruptek | he just includes everything in a single file. |
20:40:52 | disruptek | stuff he exports is exported. everything else just works and has access to everything else. |
20:41:08 | disruptek | this is a solution but it's not a pleasant one. |
20:42:02 | disruptek | i guess you can use this strategy across directories, which means it's the go technique. i like the way that works. |
20:42:09 | Araq | I prefer it over faking privacy fwiw. "Ah ok, these fields are hidden, only the getters/setters can mutate it. -- Er argh, private imports everywhere" |
20:43:08 | Araq | it's faking hygiene where there isn't any, it's the typical "as long as it's beautiful it cannot be bad" feature |
20:43:26 | Araq | see also "we need a more beautfiul .emit statement" |
20:43:29 | disruptek | if you import a dir, we import dirname.nim. if you import a dir and no dirname.nim exists, we simply concat all files? but they are unordered. :-( |
20:43:54 | disruptek | i guess we have this today without changing anything. |
20:44:09 | Araq | the Go way is simply to 'include' all the files, you can do the same in Nim |
20:44:19 | disruptek | that's what i'm saying. |
20:44:35 | disruptek | but we could have the compiler re-order them and then you don't need a root-level `include`. |
20:44:47 | disruptek | but, go gets away with that. |
20:44:57 | disruptek | it'd take work that we agree the user can do instead, for us. |
20:45:13 | disruptek | plus, it lets you further fracture the directory and stuff. |
20:45:38 | disruptek | i like it. |
20:46:00 | Araq | maybe but it's beginning to look like an entirely different feature |
20:46:27 | Araq | "I want 'import dir' to work, it shall create a concat'ed file with .codeReordering inside" |
20:46:29 | disruptek | it changes nothing. users just need to be taught how to best use the semantics we have. |
20:46:44 | disruptek | no, i don't want that. |
20:46:50 | Araq | well too bad |
20:47:04 | Araq | it would be simpler to do than .privateImport |
20:47:14 | disruptek | we don't need to change anything. |
20:47:33 | disruptek | we just use krux02 approach; works great. |
20:49:55 | krux02 | what is my approach? |
20:50:08 | disruptek | include everything in a file. |
20:50:15 | krux02 | ok |
20:50:24 | krux02 | yea I do that. |
20:50:26 | disruptek | we are on mumble. |
20:50:29 | krux02 | Araq recommended me to do it |
20:50:32 | krux02 | ok |
20:50:36 | * | FromDiscord <KingDarBoja> Gods are speaking, what a good moment to be alive |
20:51:46 | Yardanico | xdd |
20:56:16 | FromDiscord | <Elegant Beef> So prestige, i've got window selection working now, but still have not implemented `_NET_ACTIVE_WINDOW` |
20:56:36 | * | kenran quit (Quit: leaving) |
20:56:37 | Prestige | Nice |
20:56:50 | Prestige | I'm trying to think of a way to allow a config file for keybindings |
20:57:21 | Prestige | Maybe I'll just hardcore it for now and do that later |
20:57:25 | Yardanico | Prestige: use cfg (parsecfg) or TOML (parsetoml) :P |
20:57:34 | Yardanico | TOML is really nice and has a nim lib https://github.com/NimParsers/parsetoml |
20:58:18 | Prestige | oh nice, thanks Yardanico |
20:58:26 | Yardanico | parsecfg is in stdlib |
20:58:45 | FromDiscord | <Elegant Beef> Look at my config.nim file and the setup proc for inspiration on how |
20:58:56 | FromDiscord | <Elegant Beef> I was sorta interested in using nims as a config file but that seems silly 😄 |
20:59:14 | Yardanico | well you can do that |
20:59:15 | FromDiscord | <Elegant Beef> setup proc inside goodwm.nim |
20:59:20 | Yardanico | just embed the vm in your app |
20:59:22 | Yardanico | nimvm I mean |
20:59:30 | Yardanico | and you will be able to evaluate .nims in your compiled apps |
20:59:44 | FromDiscord | <Elegant Beef> Yea i intend to |
21:00:01 | FromDiscord | <Elegant Beef> <https://github.com/Serenitor/embeddedNimScript> Looking at this for it |
21:00:06 | FromDiscord | <Elegant Beef> Since i also want widgets |
21:00:23 | FromDiscord | <Elegant Beef> widgets using nims* |
21:03:10 | * | couven92 quit (Read error: Connection reset by peer) |
21:03:34 | * | couven92 joined #nim |
21:03:47 | FromDiscord | <Elegant Beef> I do plan on doing the thing that will probably turn anyone away from my WM and that is forcing the usage of my status bar, although it'll be made using either nuklear or cimgui so atleast should be fairly customizable |
21:12:46 | * | opal joined #nim |
21:25:45 | FromGitter | <awr1> https://github.com/nim-lang/Nim/pull/13985 |
21:25:46 | disbot | ➥ Make bitand, bitor, bitxor varargs-friendly |
21:26:00 | FromGitter | <awr1> by a macro, is a template sufficient? |
21:26:44 | * | couven92 quit (Read error: Connection reset by peer) |
21:27:06 | * | couven92 joined #nim |
21:28:39 | FromGitter | <awr1> or is there something i'm missing about how varargs for-loops are implemented |
21:32:26 | FromGitter | <awr1> also i was thinking of an addition to bitops: `func bitSlice[T: SomeInteger](bits :T; slice :Slice[T])` |
21:32:44 | FromGitter | <awr1> that extracts a slice of bits and shifts them accordingly |
21:36:08 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:48:45 | leorize | @awr1: varargs is just a syntactic sugar for openArray |
21:49:11 | FromGitter | <awr1> i see |
21:49:45 | FromGitter | <awr1> is that totally true though? because individual members of varargs can have differing types can't they? |
21:49:52 | leorize | nope they can't |
21:49:54 | FromGitter | <awr1> or wait no they can't |
21:49:55 | disruptek | nope. |
21:49:55 | FromGitter | <awr1> yeah |
21:50:10 | FromGitter | <awr1> because echo works by $ing them in the argument |
21:51:10 | FromGitter | <awr1> yeah i think i might make an extra PR for this, making slices work with bits |
21:51:14 | * | xcm quit (Remote host closed the connection) |
21:51:19 | FromGitter | <awr1> i think it would make for a nicer API |
21:53:39 | * | xcm joined #nim |
21:59:25 | FromDiscord | <Recruit_main707> i have no clue how to do something like this: https://play.nim-lang.org/#ix=2iBc (sorry for all this lame questions i am asking) |
22:00:19 | * | couven92 quit (Quit: Client Disconnecting) |
22:14:53 | * | abm quit (Quit: Leaving) |
22:19:07 | * | tane quit (Quit: Leaving) |
22:28:15 | * | hax-scramper joined #nim |
22:29:27 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
22:30:50 | Araq | !rfc writeLine |
22:30:51 | disbot | https://github.com/nim-lang/RFCs/issues/9 -- 3osproc: `waitForExit` can leave process object in inconsistent state (Windows) 7& 3 more... |
22:30:58 | Araq | !rfc write |
22:31:00 | disbot | https://github.com/nim-lang/RFCs/issues/197 -- 3Allocation free printing: remove write(a: varargs[string]) 7& 29 more... |
22:35:08 | leorize | Recruit_main707: well I'm not sure what you're trying to do |
22:35:18 | leorize | but fwiw `streams` let you implement interfaces like that |
22:38:00 | FromDiscord | <Recruit_main707> I have a type, with a Bytes field, and I want to write something in that field, but I’d need it to be initialized, and I don’t know how to do it because it’s a field |
22:38:38 | FromDiscord | <Recruit_main707> (Having the Table initialized didn’t seem to work) |
22:40:55 | leorize | try not to uppercase everything first :P |
22:41:42 | leorize | well fwiw I'm still not sure what you're trying to do |
22:41:47 | leorize | are you porting some C/C++ code? |
22:43:03 | FromDiscord | <Recruit_main707> It’s go |
22:44:30 | leorize | can you give us a small complete example? |
22:44:39 | FromGitter | <awr1> what on earth |
22:44:45 | leorize | the snippet doesn't compile because it doesn't have all the types |
22:44:50 | FromGitter | <awr1> i hope i screwed up something and this isn't a lexer bug |
22:45:48 | FromDiscord | <Recruit_main707> leorize: sadly, I can’t right now, but the only type it’s used and not defined in there is VOffestT which is an in32 iirc |
22:46:21 | FromDiscord | <Recruit_main707> It’s not very important |
22:46:47 | FromGitter | <awr1> okay it was my bad lol |
22:47:38 | leorize | Recruit_main707: https://play.nim-lang.org/#ix=2iBv |
22:49:30 | FromDiscord | <Recruit_main707> [self pin] |
22:49:54 | FromDiscord | <Recruit_main707> So that I can search for this tomorrow morning :P |
22:49:59 | FromDiscord | <Recruit_main707> Thank you |
22:55:23 | zacharycarter | if you're debugging in lldb - how do you deal with templates and line numbers? |
22:55:38 | zacharycarter | I mean for adding breakpoints in nim source files |
23:00:32 | * | Vladar quit (Quit: Leaving) |
23:01:12 | zacharycarter | ah you can do regex for setting breakpoints - perfect |
23:06:22 | zacharycarter | Hmm - so I thought that `--exceptions:setjmp` solved my problems related to `--gc:arc` and threads but my program is intermittently crashing and whenever I run it through lldb I run into an EXC_BAD_ACCESS signal |
23:06:59 | zacharycarter | I looked at the frame variables and saw there was a nimErr local which I dereferenced and the message it has was - `error: Couldn't apply expression side effects : Couldn't dematerialize a result variable: couldn't read its memory` |
23:07:18 | zacharycarter | this is happening inside `threadProcWrapper` |
23:07:52 | Araq | zacharycarter, which OS? |
23:08:14 | zacharycarter | Araq: macOS Mojave 10.14.6 (18G103) |
23:08:42 | zacharycarter | The body of my thread function is simply `discard` |
23:09:00 | Araq | zacharycarter, try --tlsEmulation:off |
23:09:09 | zacharycarter | okay let me give that a shot |
23:10:35 | disruptek | Araq: yeah, ima eat. have a good night; effects system seems to work, but messages are tough. |
23:10:37 | zacharycarter | well that got me to a new error - will try to look more into this - thanks Araq |
23:40:22 | FromGitter | <awr1> and did the PR: https://github.com/nim-lang/Nim/pull/14016 |
23:40:25 | disbot | ➥ Added bitslice operations for bitops ; snippet at 12https://play.nim-lang.org/#ix=2iBP |
23:41:31 | FromGitter | <awr1> wasn't sure if adding the non-mutating procs would be very helpful but i found it strange that they were mutating |
23:44:27 | * | Jjp137 quit (Read error: Connection reset by peer) |
23:45:39 | * | raz left #nim ("*fump*") |
23:55:37 | * | krux02_ joined #nim |
23:58:23 | * | krux02 quit (Ping timeout: 252 seconds) |