00:00:19 | FromDiscord | <Technisha Circuit> T: So, any compiled languages that can make DLLs or .so files out of libraries should theoretically be usable in Nim, right? |
00:00:55 | FromDiscord | <Elegant Beef> Well the C# .dlls run on the C# runtime |
00:01:06 | FromDiscord | <Elegant Beef> They are not system libraries |
00:01:24 | FromDiscord | <Elegant Beef> For instance you can run C# .dlls on linux using dotnet core |
00:01:33 | FromDiscord | <Technisha Circuit> Oh okay |
00:01:49 | FromDiscord | <Elegant Beef> It's an annoying overlap of extensions |
00:01:54 | FromDiscord | <Technisha Circuit> Big oof |
00:02:19 | FromDiscord | <Technisha Circuit> So C# DLLs and .so files aren't usable in Nim |
00:02:24 | FromDiscord | <Elegant Beef> C# doesnt make .so |
00:02:30 | FromDiscord | <Elegant Beef> It only makes .dlls |
00:02:36 | FromDiscord | <Elegant Beef> Which are usable through dotnet core |
00:02:43 | FromDiscord | <Elegant Beef> Or mono |
00:03:27 | FromDiscord | <Technisha Circuit> O |
00:03:45 | FromDiscord | <Elegant Beef> like if you make a dotnetcore CLI application on linux it'll output a runnable .dll |
00:03:56 | FromDiscord | <Technisha Circuit> Oh okay :p |
00:04:00 | FromDiscord | <Elegant Beef> you do `dotnet ./*.dll` |
00:04:10 | FromDiscord | <Technisha Circuit> That's weird imo |
00:04:17 | FromDiscord | <Rika> its dot net |
00:04:25 | FromDiscord | <Rika> what do you expect, a sane interface for linux? |
00:04:35 | FromDiscord | <Technisha Circuit> :p |
00:04:45 | FromDiscord | <Elegant Beef> Well the weird part is the extension overlap |
00:04:50 | FromDiscord | <Technisha Circuit> Wdym? |
00:05:00 | FromDiscord | <Rika> im thinking of making a more sane redis wrapper api but i cant think of a good one so ill prolly just leave it to another time |
00:05:03 | FromDiscord | <Elegant Beef> They're both .dlls but cant be used reversibly |
00:05:49 | FromDiscord | <Technisha Circuit> Kinda weird, dotnet, coding in general is weird |
00:06:00 | FromDiscord | <Technisha Circuit> (edit) 'dotnet,' => 'dotnet is weird,' |
00:06:20 | FromDiscord | <Rika> programmers are not sane |
00:06:21 | FromDiscord | <Elegant Beef> Like a C# .dll when imported to your C# project works like C# code written anywhere, no manual bindings nothing it's just parsed as C# code |
00:06:26 | FromDiscord | <Rika> therefore our work is not sane |
00:06:27 | FromDiscord | <Technisha Circuit> That's true |
00:06:36 | FromDiscord | <Technisha Circuit> O |
00:06:50 | FromDiscord | <Elegant Beef> It'd have taken point 3 seconds to name it a `.dllsharp` |
00:06:57 | FromDiscord | <Elegant Beef> Or something less redundant |
00:07:06 | FromDiscord | <Technisha Circuit> So basically C# is a weird language |
00:07:15 | FromDiscord | <Elegant Beef> Well it's java, but by microsoft |
00:07:29 | FromDiscord | <Technisha Circuit> Oh okay, that's worse |
00:08:00 | FromDiscord | <Elegant Beef> Well there is the mono runtime |
00:08:05 | FromDiscord | <Technisha Circuit> How difficult would it be for me to make a crappy Ruby backend for Nim? :GWchinaSakuraThinking: |
00:08:06 | FromDiscord | <Rika> net core |
00:08:09 | FromDiscord | <Elegant Beef> Which is the openjre equivlent i guess |
00:08:16 | FromDiscord | <Technisha Circuit> I'm just curious again :P |
00:08:25 | FromDiscord | <Technisha Circuit> > Which is the openjre equivlent i guess↵Nice |
00:08:26 | FromDiscord | <Elegant Beef> Man, why dont you just work in nim 😄 |
00:08:44 | FromDiscord | <Technisha Circuit> Because it's fun messing with multiple languages at once hahaha |
00:08:59 | FromDiscord | <Rika> id prolly end myself if i did what you do |
00:09:00 | FromDiscord | <Elegant Beef> I can only agree when there is a GPU involved |
00:09:06 | FromDiscord | <Technisha Circuit> And Rika said it themself,↵> programmers are not sane↵> therefore our work is not sane |
00:09:11 | FromDiscord | <Elegant Beef> Program on a phone and want multiple langauges? Rika |
00:09:15 | FromDiscord | <Rika> technica |
00:09:16 | FromDiscord | <Rika> (edit) 'technica' => 'technicae' |
00:09:22 | FromDiscord | <Technisha Circuit> :P |
00:09:25 | FromDiscord | <Rika> you are the least sane amongst us right now |
00:09:34 | FromDiscord | <Technisha Circuit> Not surprised xD |
00:09:50 | FromDiscord | <Elegant Beef> Like if you want to use other languages, i say use them, unless you really need some cross langauge support |
00:09:53 | FromDiscord | <Rika> you're less sane than if you subtracted my sanity with beef's or vice versa |
00:09:55 | FromDiscord | <Technisha Circuit> :GWchinaNayuSmile: |
00:10:15 | FromDiscord | <Elegant Beef> Well if you subtract my sanity from yours it's still your sanity |
00:10:20 | FromDiscord | <Elegant Beef> 100-0 = 100 |
00:10:46 | FromDiscord | <Rika> youre telling me tech has negative sanity? |
00:10:46 | FromDiscord | <Elegant Beef> Dont bring up your or statement |
00:10:47 | FromDiscord | <Rika> damn |
00:11:02 | FromDiscord | <Technisha Circuit> > Like if you want to use other languages, i say use them, unless you really need some cross langauge support↵I still love Nim and I'm starting to use it way more then Python, but messing with multiple langs is fun |
00:11:44 | FromDiscord | <Technisha Circuit> > youre telling me tech has negative sanity?↵@Rika i do, i have negative infinity sanity |
00:11:52 | FromDiscord | <Elegant Beef> I only really know C#/HLSL/Nim, so i dont know how it is |
00:11:58 | FromDiscord | <Technisha Circuit> :GWomoRaphiWink: |
00:12:10 | FromDiscord | <Elegant Beef> I dont touch other languages cause i tend to dislike them for various reasons |
00:12:18 | FromDiscord | <Technisha Circuit> Oh? |
00:12:36 | FromDiscord | <Technisha Circuit> Also, do you prefer braces or whitespace-based programming? |
00:12:40 | FromDiscord | <Elegant Beef> Indifferent |
00:12:45 | FromDiscord | <Elegant Beef> I prefer clean code |
00:12:47 | FromDiscord | <Elegant Beef> And tabs |
00:12:48 | FromDiscord | <Technisha Circuit> Cool |
00:12:54 | FromDiscord | <Technisha Circuit> ONot cool |
00:12:59 | FromDiscord | <Technisha Circuit> (edit) 'ONot' => 'Not' |
00:12:59 | FromDiscord | <Rika> lmao |
00:13:07 | FromDiscord | <Technisha Circuit> Tabs are a pain- |
00:13:20 | FromDiscord | <Technisha Circuit> Just make tabs into 4 spaces by default- |
00:13:21 | FromDiscord | <Elegant Beef> I think just like everyone customizes their editor they should be able to customize the rendering of their text |
00:13:29 | FromDiscord | <Elegant Beef> I do for nim just to be in a middle ground |
00:13:36 | FromDiscord | <Technisha Circuit> :P |
00:13:48 | FromDiscord | <Elegant Beef> But as i've said before i use big old indents of 8 in C#, and like it as it's very clear indent |
00:14:04 | FromDiscord | <Rika> until everyone makes tabs have a sane default im still not supporting tabs |
00:14:15 | FromDiscord | <Technisha Circuit> :P |
00:14:20 | FromDiscord | <Technisha Circuit> Tabs are stupid- |
00:14:21 | FromDiscord | <Elegant Beef> I mean i only use vscode so idk what doesnt have a sane default |
00:14:24 | FromDiscord | <Elegant Beef> They really arent |
00:14:27 | FromDiscord | <Elegant Beef> The lack of support is |
00:14:33 | FromDiscord | <Rika> notepad, literally every browser, etc |
00:14:36 | FromDiscord | <Rika> nano |
00:14:48 | FromDiscord | <Elegant Beef> How is it anymore stupid than being able to customize your editor |
00:14:52 | FromDiscord | <Rika> any standard text editor i assume |
00:14:57 | FromDiscord | <Technisha Circuit> Maybe Nim should accept both, but just change tabs to spaces by default |
00:15:10 | FromDiscord | <Elegant Beef> Well no Araq openly said he wants one standard |
00:15:16 | FromDiscord | <Rika> i think nim should be fine with either and error out when both are used |
00:15:24 | FromDiscord | <Elegant Beef> Well per one module |
00:15:33 | FromDiscord | <Elegant Beef> Each module is solved on a module by module basis |
00:15:39 | FromDiscord | <Elegant Beef> That could work |
00:15:50 | FromDiscord | <Rika> but i still dont like tabs 😛 |
00:16:00 | FromDiscord | <Elegant Beef> I mean you dont dislike tabs, you dislike that they arent supported |
00:16:12 | FromDiscord | <Elegant Beef> If they were supported and customized everywhere would you still be opposed to them? |
00:16:13 | FromDiscord | <Rika> its really just the shitty default size |
00:16:47 | FromDiscord | <Elegant Beef> I think a majority of people agree that in modern editors being able to look at code the way you want to is beneficial, since it doesnt change the underlying code |
00:17:05 | FromDiscord | <Elegant Beef> Spaces hardcode that into the file, imagine if the font used was hardcoded in the file |
00:17:09 | FromDiscord | <Rika> also am i the only one who doesnt use either indent guides or indent highlights |
00:17:26 | FromDiscord | <Elegant Beef> You mean colourful indents? |
00:17:40 | FromDiscord | <Technisha Circuit> Just add```nim↵#? replace(sub=" ", by=" ")```to the start of your file to use tabs, just change by to be however many spaces you want |
00:17:43 | FromDiscord | <Elegant Beef> Where each stage gets a colour, or just visiblle whitespace? |
00:17:44 | FromDiscord | <Rika> indent guides as in the lines, and highlights as in the colored in indents |
00:17:53 | FromDiscord | <Technisha Circuit> And replace sub with an actual tab |
00:18:00 | FromDiscord | <Elegant Beef> Yes i know that exists but i dont like it |
00:18:15 | FromDiscord | <Technisha Circuit> Oh? Why not? |
00:18:18 | FromDiscord | <Rika> https://media.discordapp.net/attachments/371759389889003532/719706906519666778/unknown.png |
00:18:21 | FromDiscord | <Rika> no guides |
00:18:33 | FromDiscord | <Rika> theyre kinda too distracting for me |
00:18:39 | FromDiscord | <Elegant Beef> Cause the source relies on a single line to be useable |
00:18:47 | FromDiscord | <Elegant Beef> I only use visible whitespace |
00:18:51 | FromDiscord | <Technisha Circuit> Fair enough |
00:18:52 | FromDiscord | <Elegant Beef> Also cause it's against conventions |
00:18:58 | FromDiscord | <exelotl> Rainbow indents are nice, but people who use rainbow indents and strip-trailing-whitespace are mad |
00:19:00 | FromDiscord | <Technisha Circuit> :P |
00:19:20 | FromDiscord | <exelotl> Like what's the point in rainbow indents full of holes |
00:19:30 | FromDiscord | <Elegant Beef> Forgot i changed my vscode theme yesterday, but anyway↵This is all i got https://media.discordapp.net/attachments/371759389889003532/719707207922614392/unknown.png |
00:19:33 | FromDiscord | <Rika> i use only strip trailing |
00:19:59 | FromDiscord | <Elegant Beef> Guess i have indent levels, dont notice it until i screenshot |
00:20:11 | FromDiscord | <exelotl> That's a nice theme beef, what is it? |
00:20:37 | FromDiscord | <Technisha Circuit> Winux? |
00:20:53 | FromDiscord | <Elegant Beef> Bearded Theme Arc |
00:20:56 | FromDiscord | <Elegant Beef> Yes |
00:21:01 | FromDiscord | <Elegant Beef> A joke |
00:21:08 | FromDiscord | <Elegant Beef> Still acceptable for my build system |
00:21:08 | FromDiscord | <Technisha Circuit> O |
00:21:14 | FromDiscord | <Technisha Circuit> :P |
00:21:15 | FromDiscord | <Rika> gnuwu winux |
00:21:33 | FromDiscord | <exelotl> owo |
00:21:42 | FromDiscord | <Elegant Beef> Bearded theme has like 20 themes to choose from |
00:22:15 | FromDiscord | <Rika> I'd juwst wike tuwu intewject fow a moment. Whawt uwu'we wefewwing tuwu as winux, iws in fact, gnu/winux, ow as i've wecentwy taken tuwu cawwing iwt, gnu pwus winux. |
00:22:38 | FromDiscord | <Rika> i apologize |
00:23:42 | FromDiscord | <Technisha Circuit> Hahahahaha |
00:23:56 | FromDiscord | <Technisha Circuit> I actually apologize for asking xD |
00:24:05 | FromDiscord | <Elegant Beef> lol |
00:24:18 | FromDiscord | <Elegant Beef> I was going to add winblows and walled garden for mac |
00:24:45 | * | rockcavera quit (Read error: Connection reset by peer) |
00:25:10 | * | rockcavera joined #nim |
00:27:15 | FromDiscord | <Elegant Beef> Also exelotl the ayu-mirage theme is nice but it doesnt work with nim's syntax highlighting |
00:29:14 | FromDiscord | <Technisha Circuit> . |
00:37:07 | FromDiscord | <Elegant Beef> , |
00:59:39 | * | theelous3 quit (Read error: Connection reset by peer) |
01:03:56 | * | chemist69_ joined #nim |
01:07:25 | * | chemist69 quit (Ping timeout: 264 seconds) |
01:09:34 | * | Tlanger joined #nim |
01:12:28 | * | Tongir quit (Ping timeout: 260 seconds) |
01:14:14 | * | oddp quit (Ping timeout: 256 seconds) |
01:20:36 | FromDiscord | <Technisha Circuit> : |
01:24:59 | FromDiscord | <Rika> i dont know why i am getting "operation now in progress" in linux when using jester |
01:25:02 | FromDiscord | <Rika> and redis |
01:25:06 | FromDiscord | <Rika> no clue what to do... |
01:25:32 | FromDiscord | <Technisha Circuit> I have no idea what redis is |
01:25:51 | FromDiscord | <Rika> https://redis.io |
01:26:46 | * | FromDiscord quit (Remote host closed the connection) |
01:27:01 | * | FromDiscord joined #nim |
01:27:57 | FromDiscord | <Technisha Circuit> O |
01:28:05 | FromDiscord | <Elegant Beef> no it's io |
01:28:33 | FromDiscord | <Technisha Circuit> (edit) 'O' => 'Io' |
01:28:35 | FromDiscord | <Rika> wdym? |
01:28:45 | FromDiscord | <Elegant Beef> I was making a joke |
01:28:50 | FromDiscord | <Technisha Circuit> :P |
01:28:56 | FromDiscord | <Elegant Beef> Tech said O, and i said "No it's IO" |
01:29:07 | FromDiscord | <Elegant Beef> Since the url is io |
01:29:18 | FromDiscord | <Technisha Circuit> A very bad joke, but a joke nevertheless |
01:29:23 | FromDiscord | <Technisha Circuit> xD |
01:29:42 | * | FromDiscord quit (Remote host closed the connection) |
01:29:55 | * | FromDiscord joined #nim |
01:30:15 | FromDiscord | <Elegant Beef> The only difference between a good joke and a bad joke is whether you get punched |
01:30:47 | * | endragor joined #nim |
01:31:30 | FromDiscord | <Technisha Circuit> *Punches @Elegant Beef* |
01:31:32 | FromDiscord | <Technisha Circuit> :3 |
01:57:07 | * | silvernode joined #nim |
02:10:35 | * | arecaceae quit (Remote host closed the connection) |
02:11:07 | * | arecaceae joined #nim |
02:11:56 | adnan338 | The nim forum webpage should have backlinks to the homepage imo |
02:13:02 | FromGitter | <ynfle> Is there a way to determine whether a type ident/sym is user-defined or system defined? |
02:17:03 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:18:38 | * | muffindrake joined #nim |
02:47:34 | leorize[m] | @ynfle technically system-defined is user-defined :P |
02:48:31 | leorize[m] | and no, there aren't anyway since we don't have a concept of user-defined and system-defined |
02:52:43 | FromDiscord | <Elegant Beef> When you think about it, nim programmers are just sophisitcated macros 😄 |
02:53:07 | FromDiscord | <Elegant Beef> Do i get punched for that joke aswell? |
02:53:57 | FromDiscord | <Rika> no, you do get kicked though |
02:54:01 | FromDiscord | <Rika> *kick* |
02:54:04 | FromDiscord | <Elegant Beef> Damn |
02:54:20 | FromDiscord | <Elegant Beef> This is yet another hate filled group using christian imagery 😛 |
03:07:46 | * | rockcavera quit (Remote host closed the connection) |
03:12:49 | * | silvernode quit (Ping timeout: 264 seconds) |
03:16:25 | * | adnan338 quit (Ping timeout: 264 seconds) |
03:24:25 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:30:01 | * | pbb joined #nim |
03:35:55 | * | silvernode joined #nim |
03:38:18 | * | robotme joined #nim |
03:48:23 | * | silvernode quit (Ping timeout: 246 seconds) |
03:53:32 | * | dddddd quit (Ping timeout: 256 seconds) |
04:00:55 | FromDiscord | <Zed> How can i assign a variable of type tuple but not assign it yet |
04:01:37 | FromDiscord | <Zed> sent a code paste, see http://ix.io/2oH0 |
04:02:05 | FromDiscord | <Zed> but where it is assigned to is in a try block |
04:04:56 | FromDiscord | <Elegant Beef> What type of tuple |
04:05:20 | FromDiscord | <Zed> tuple of strings |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:03 | FromDiscord | <Elegant Beef> `a : (string,string)` |
04:06:12 | FromDiscord | <Elegant Beef> Or the other tuple syntaxz |
04:06:14 | FromDiscord | <Elegant Beef> (edit) 'syntaxz' => 'syntax' |
04:06:38 | * | supakeen joined #nim |
04:08:35 | FromDiscord | <Elegant Beef> With a pre declared tuple↵https://play.nim-lang.org/#ix=2oH2 |
04:09:05 | FromDiscord | <Elegant Beef> You can of course use named parameters in the tuple creation |
04:09:44 | FromDiscord | <Zed> yep, thanks |
04:10:06 | FromDiscord | <Elegant Beef> No problem |
04:11:16 | shashlick | conan support is now working in nimterop - time for tests |
04:23:12 | FromDiscord | <flywind> What is conan?🤣 |
04:24:02 | * | robotme quit (Quit: robotme) |
04:24:36 | * | robotme joined #nim |
04:24:39 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:24:41 | FromDiscord | <Elegant Beef> A barbarian |
04:26:03 | shashlick | http://conan.io |
04:26:15 | * | adnan338 joined #nim |
04:26:22 | shashlick | prebuilt binaries for hundreds of libraries cross platform |
04:28:40 | FromDiscord | <flywind> Ok. Looks good. |
04:29:50 | FromDiscord | <Zed> your really letting out all the jokes today @Elegant Beef |
04:30:06 | FromDiscord | <Elegant Beef> Well none of them are good though |
04:30:08 | FromDiscord | <Technisha Circuit> Is there any DBL wrapper for Nim? |
04:30:25 | FromDiscord | <Technisha Circuit> > Well none of them are good though↵Can i also punch you in advance |
04:30:30 | voltist | sashlick: What do you mean by support for conan? |
04:30:35 | FromDiscord | <Elegant Beef> If you wish |
04:30:40 | FromDiscord | <Zed> can i get in line lol |
04:30:41 | FromDiscord | <Elegant Beef> Im just rereading the nim manual 😄 |
04:31:25 | FromDiscord | <Technisha Circuit> Nice |
04:31:30 | FromDiscord | <Technisha Circuit> *Punches @Elegant Beef* |
04:31:31 | FromDiscord | <Technisha Circuit> :3 |
04:31:48 | FromDiscord | <Technisha Circuit> I wish i had a girlfriend, ngl- |
04:32:01 | FromDiscord | <Technisha Circuit> It'd be funny to annoy the shit out of them- |
04:32:08 | FromDiscord | <Elegant Beef> Domestic violence isnt annoying |
04:32:40 | FromDiscord | <Technisha Circuit> Why tf would i hit my own girlfriend- |
04:32:50 | FromDiscord | <Technisha Circuit> I ain't abusive, just annoying- |
04:32:51 | FromDiscord | <Elegant Beef> https://media.discordapp.net/attachments/371759389889003532/719770961116921936/unknown.png |
04:33:23 | FromDiscord | <Technisha Circuit> Bruh, i couldn't hurt anyone with these punches even if my knife depended on it |
04:33:28 | FromDiscord | <Technisha Circuit> (edit) 'knife' => 'lofe' |
04:33:33 | FromDiscord | <Technisha Circuit> (edit) 'lofe' => 'life' |
04:33:40 | FromDiscord | <Elegant Beef> knife depended on it was funnier |
04:33:40 | FromDiscord | <Zed> so you've got a knife now |
04:34:28 | FromDiscord | <Technisha Circuit> Shush- |
04:35:38 | FromDiscord | <Technisha Circuit> ~~If my knife depended on it y'all would be dead in a second~~ |
04:35:42 | FromDiscord | <Technisha Circuit> Jkjk Hahahaha |
04:36:11 | FromDiscord | <Technisha Circuit> The knife would be for someone i hate the most |
04:36:18 | FromDiscord | <Elegant Beef> Way to threaten me |
04:36:35 | FromDiscord | <Elegant Beef> I still dont get the point of methods |
04:36:37 | FromDiscord | <Technisha Circuit> If i have depression, who do i hate the most- |
04:36:59 | FromDiscord | <Technisha Circuit> The answer is obvious- |
04:37:18 | FromDiscord | <Elegant Beef> Like i get they're more OOP esque, but couldnt it just be a field in the object that's assigned? |
04:37:33 | * | robotme quit (Quit: robotme) |
04:38:03 | FromDiscord | <Technisha Circuit> What's a method in Nim? :P |
04:38:35 | FromDiscord | <Elegant Beef> It's a dynamically dispatched function for reference types |
04:38:43 | FromDiscord | <Technisha Circuit> Wdym? :P |
04:38:51 | FromDiscord | <Rika> Well then there's your reason |
04:39:02 | FromDiscord | <Elegant Beef> It can be overridden and changed on a type basis |
04:39:03 | * | robotme joined #nim |
04:39:14 | FromDiscord | <Rika> Also ngl I kinda want to switch to my Kanji nickname here |
04:39:20 | FromDiscord | <Technisha Circuit> ~~Nice i helped someone even though i didn't know what they were talking about~~ |
04:39:22 | FromDiscord | <Rika> But meh |
04:39:23 | FromDiscord | <Technisha Circuit> Go for it |
04:39:40 | FromDiscord | <Elegant Beef> I mean i dont see the difference between a field and a method |
04:39:46 | FromDiscord | <Technisha Circuit> Just put `(Rika)` in brackets for a few days so people know it's you |
04:39:56 | FromDiscord | <Elegant Beef> One is hard coded and cant be changed at runtime |
04:40:05 | FromDiscord | <Technisha Circuit> (edit) '`(Rika)`' => '`Rika`' | '`Rika`in brackets ... for' => '`Rika`in bracketsnext to your' |
04:40:12 | FromDiscord | <Elegant Beef> Using a field would be more modular as far as i can see |
04:42:28 | FromDiscord | <Rika> @Technisha Circuit irc shoes global name so lol |
04:42:41 | * | silvernode joined #nim |
04:44:19 | FromDiscord | <Technisha Circuit> Oof |
04:45:16 | * | FromDiscord quit (Remote host closed the connection) |
04:45:32 | * | FromDiscord joined #nim |
04:46:13 | * | narimiran joined #nim |
04:48:00 | * | silvernode quit (Quit: Leaving) |
04:48:16 | * | silvernode joined #nim |
05:01:01 | Tlanger | Can you attach custom pragmas to procs and then build a seq or array that contains info about them? |
05:04:16 | * | solitudesf joined #nim |
05:04:29 | * | solitudesf quit (Remote host closed the connection) |
05:04:53 | * | solitudesf joined #nim |
05:06:09 | FromDiscord | <Rika> AFAIK yeah |
05:06:19 | FromDiscord | <Rika> Custom pragmas are just macros |
05:14:12 | silvernode | So, I'm bored...posted in nim-offtopic about it. What's going on with everyone tonight, anything exciting? It is 22:13 here in AZ right now. |
05:15:15 | silvernode | No work this time so I can work on anything I want. |
05:25:09 | bung | check needed-libraries repo you may found something interested |
05:33:04 | * | robotme quit (Quit: robotme) |
05:33:29 | * | robotme joined #nim |
05:37:53 | * | kenran joined #nim |
05:55:47 | * | aenesidemus quit (Ping timeout: 246 seconds) |
06:01:19 | Tlanger | Alright, so I got what I wanted (https://play.nim-lang.org/#ix=2oHj) |
06:01:58 | Tlanger | But I can't import commands from that file, it throws `Error: type mismatch: got <void>` |
06:03:04 | * | FromDiscord quit (Remote host closed the connection) |
06:03:22 | * | FromDiscord joined #nim |
06:04:23 | Tlanger | Something to do with accessing a var created by a macro in an imported file? |
06:04:33 | Tlanger | (if that's even a thing, haha) |
06:05:02 | * | PMunch joined #nim |
06:06:06 | bung | there's repo already do same task |
06:06:20 | bung | !repo shell |
06:06:21 | disbot | https://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 280⭐ 20🍴 7& 21 more... |
06:06:36 | bung | oh , wrong |
06:07:11 | bung | https://github.com/Vindaar/shell |
06:08:25 | FromDiscord | <Zed> you can already do that with `os` |
06:08:33 | FromDiscord | <Zed> os.execShellCmd |
06:12:08 | Tlanger | Yeah, I don't want these to be just from the shell |
06:12:31 | * | lritter joined #nim |
06:12:42 | Tlanger | It's for adding a few default commands to Inim like the ones listed |
06:13:03 | FromDiscord | <Zed> ah ok |
06:13:11 | Tlanger | Buuut, I need to check to see if someone is calling a command with or without the parenthesis |
06:13:52 | FromDiscord | <Zed> use strutils |
06:13:52 | Tlanger | ie pwd |
06:14:02 | FromDiscord | <Zed> theres a function called contains |
06:14:35 | FromDiscord | <Zed> or find |
06:25:16 | * | tdc joined #nim |
06:48:27 | * | adnan338 quit (Ping timeout: 260 seconds) |
07:08:50 | * | NamPNQ joined #nim |
07:21:28 | * | NamPNQ quit (Remote host closed the connection) |
07:32:03 | PMunch | Aha, so in C code iterators are actual objects, not pointers |
07:32:25 | PMunch | But they contain two pointers, so copying the object would still refer you to the same iterator. |
07:33:30 | PMunch | So I guess the only way to create an identifier for iterators would be to write it into the compiler.. |
07:33:44 | PMunch | Or... |
07:37:33 | PMunch | I can cast it to an array of bytes two pointers long.. |
07:37:40 | PMunch | And hash that |
07:49:31 | * | Trustable joined #nim |
08:00:05 | * | neceve_ joined #nim |
08:07:58 | * | fredrikhr joined #nim |
08:09:45 | * | crem quit (Ping timeout: 246 seconds) |
08:11:11 | PMunch | So this seems to work: https://play.nim-lang.org/#ix=2oHA |
08:18:21 | FromDiscord | <djazz> time to try fight circular dependencies in nim again 😅 |
08:18:37 | FromDiscord | <djazz> rn i use a types.nim file that i include |
08:34:24 | * | oddp joined #nim |
08:40:08 | Araq | hey watch this out, https://hub.packtpub.com/is-scala-3-0-a-new-language-all-together-martin-odersky-its-designer-says-yes-and-no/ |
08:40:22 | Araq | Scala might get an indentation based syntax :-) |
08:43:05 | voltist | Is there a standard library proc to check if a float is a whole number other that floor(x) == x? |
08:43:54 | * | Vladar joined #nim |
08:47:58 | FromDiscord | <djazz> hmm, i get an error when i do `ctx.body = openAsync(path)` but this works: \`body=\`(ctx, openAsync(path)) |
08:48:10 | FromDiscord | <djazz> 😒 |
08:49:59 | FromDiscord | <djazz> ctx is of type Context, which inherits Response. the setter signature is proc \`body=\`*(this: Response, val: AsyncFile) |
08:50:27 | FromDiscord | <djazz> this worked fine til i started splitting up the type definitions... |
08:50:38 | FromDiscord | <djazz> in separate modules |
08:50:47 | FromDiscord | <mratsim> @Isomorpheus Nim Scientific chat: https://gitter.im/SciNim/community |
08:55:08 | Zevv | leorize[m]: my server still down for you? |
08:55:21 | Zevv | no problems here, uptime 310 days |
09:00:04 | * | Tongir joined #nim |
09:03:01 | * | Tlanger quit (Ping timeout: 272 seconds) |
09:09:08 | FromDiscord | <djazz> the error i get: Error: type mismatch: got <AsyncFile> but expected 'Body = ref Body:ObjectType' |
09:14:49 | FromDiscord | <djazz> same error if i cast Context to a Response: Response(ctx).body = openAsync(path) |
09:15:21 | PMunch | Zevv, zevv.nl just points to your GitHub.. |
09:15:43 | FromDiscord | <djazz> oh, nvm, i had made the body property public, silly me |
09:15:45 | PMunch | Ah, but this works: http://zevv.nl/nim-memory/ |
09:15:52 | PMunch | (Although no HTTPS, shame) |
09:19:03 | * | krux02 joined #nim |
09:19:08 | Zevv | yeah, better encrypt that shit! |
09:19:17 | Zevv | https://zevv.nl/nim-memory/ |
09:22:28 | * | oddp quit (Read error: Connection reset by peer) |
09:24:05 | * | Tlanger joined #nim |
09:25:03 | PMunch | Unable to connect :P |
09:26:36 | * | oddp joined #nim |
09:26:45 | * | Tongir quit (Ping timeout: 256 seconds) |
09:30:07 | Zevv | wut |
09:30:13 | * | narimiran quit (Ping timeout: 264 seconds) |
09:30:29 | Zevv | yeah, you're on IPv4, are you! |
09:30:33 | Zevv | sneaky bugger! |
09:42:08 | * | narimiran joined #nim |
09:42:38 | narimiran | alehander92: can you merge https://github.com/alehander92/comprehension/pull/4 please? |
09:42:38 | disbot | ➥ fix deprecated stuff |
09:44:19 | PMunch | Zevv, now it works :) |
09:45:27 | * | robotme quit (Ping timeout: 272 seconds) |
10:01:18 | * | russellb1 joined #nim |
10:01:26 | russellb1 | Hi folks |
10:01:53 | russellb1 | How do I return an array from a procedure? Am I trying something sane?! |
10:02:37 | FromDiscord | <djazz> Zevv, nice read, thanks! |
10:03:10 | Zevv | yw |
10:03:45 | narimiran | russellb1: without looking at your code, i'm guessing you really need a `seq`, not an array |
10:05:05 | russellb1 | @narimran: hhmmm |
10:05:08 | russellb1 | I see |
10:07:16 | * | adnan338 joined #nim |
10:07:54 | krux02 | russellb1, depends |
10:08:13 | krux02 | russellb1, you can return a seq, an array, an openarray |
10:08:26 | krux02 | array is fixed size. Keep that in mind. |
10:09:01 | krux02 | also, do you want a copy of data, or you you want to reference data somewhere else. |
10:16:09 | FromDiscord | <Zed> does anyone have any nim multithreading examples? |
10:19:20 | FromDiscord | <Recruit_main707> krux02: can you return an openArray??? |
10:19:31 | FromDiscord | <Shucks> https://play.nim-lang.org/#ix=2oI1 This is very inefficient. How would I `toHex` the whole byte sequence at once? |
10:19:44 | krux02 | Recruit_main707: yes you can |
10:20:00 | FromDiscord | <Recruit_main707> how? |
10:20:04 | krux02 | you can return subarrays as open array as well |
10:20:16 | krux02 | generally with the `toOpenarray` helper procs |
10:20:17 | FromDiscord | <Recruit_main707> do you have an example? |
10:20:25 | krux02 | I think there are examples |
10:20:26 | FromDiscord | <Recruit_main707> i see |
10:20:52 | FromDiscord | <Recruit_main707> and you specify the returning type of the proc as AopenArray[type]? |
10:22:16 | russellb1 | @krux02: I want reference data |
10:22:37 | krux02 | russellb1, then openarray is probably the best option |
10:22:55 | krux02 | Recruit_main707: yes |
10:23:03 | * | robotme joined #nim |
10:23:16 | russellb1 | @krux02: How easy to pass a reference to an external C program as a pointer? |
10:23:22 | russellb1 | Or how possible? |
10:23:39 | krux02 | super easy |
10:23:51 | krux02 | unsafeAddr is your friend |
10:24:05 | PMunch | @Zed, what are you looking for? |
10:24:08 | krux02 | allows you to get the addr of everything |
10:25:17 | FromDiscord | <Recruit_main707> i always thought unsafeAddr is very long |
10:25:45 | krux02 | then rename it with a template |
10:26:10 | krux02 | template myUnsafeAddress(argument: untyped): untyped = unsafeAddr(argument) |
10:26:30 | krux02 | or better make it typed |
10:26:40 | krux02 | template myUnsafeAddress(argument: typed): untyped = unsafeAddr(argument) |
10:26:57 | PMunch | But now you made it longer krux02! /s |
10:27:14 | FromDiscord | <Zed> PMunch, just something more then what's in the docs |
10:27:23 | krux02 | yes, making it shorter is a task for the reader |
10:27:34 | krux02 | :D |
10:28:49 | PMunch | @Zed, I guess I should finish my article on threading in Nim.. |
10:29:04 | FromDiscord | <Zed> maybe |
10:29:29 | PMunch | There's this: https://livebook.manning.com/book/nim-in-action/chapter-6/49 |
10:31:04 | FromDiscord | <Shucks> > https://play.nim-lang.org/#ix=2oI1 This is very inefficient. How would I `toHex` the whole byte sequence at once?↵@Shucks for the logs: `cast[string](sequence).toHex()` works fine. |
10:32:48 | FromDiscord | <Zed> Thanks PMunch, ill read through it |
10:36:07 | * | Senny quit (Ping timeout: 272 seconds) |
10:37:21 | russellb1 | Thanx a much @kurx02 |
10:37:39 | * | russellb1 left #nim ("WeeChat 2.8") |
10:39:19 | FromDiscord | <mratsim> @Shucks just use byteutils: https://github.com/status-im/nim-stew/blob/master/stew/byteutils.nim#L132-L154 |
10:42:28 | * | russellb1 joined #nim |
10:44:26 | russellb1 | \close |
10:44:30 | * | russellb1 left #nim (#nim) |
10:47:15 | Tlanger | Hey folks, do we have any existing tools for what's being mentioned on this post? https://forum.nim-lang.org/t/4048 |
10:47:49 | * | russellb joined #nim |
10:47:59 | * | russellb left #nim (#nim) |
10:48:27 | Yardanico | Tlanger: I don't think so |
10:48:29 | PMunch | Tlanger, I don't think so. But it shouldn't be super hard to insert timing statements into the compiler |
10:50:36 | alehander92 | narimiran |
10:50:37 | alehander92 | okk |
10:50:49 | alehander92 | ready? |
10:50:52 | * | robotme quit (Quit: robotme) |
10:51:12 | Tlanger | True that, thanks |
10:56:13 | voltist | Are documentation updates counted as patches in Semantic Versioning? |
10:56:28 | voltist | Or new features |
10:56:46 | * | silvernode quit (Ping timeout: 256 seconds) |
11:02:19 | narimiran | alehander92: thanks |
11:02:57 | narimiran | voltist: is that a joke? |
11:02:59 | PMunch | voltist, I'd say patches |
11:03:42 | voltist | narimiran: Nope |
11:04:18 | voltist | PMunch: What's your reasoning behind that? My first thought is that it would be neither and not up the version |
11:05:17 | PMunch | Well of course, but if you need to cut a new version to publish or some such |
11:05:54 | * | opDispatch quit (Quit: Konversation terminated!) |
11:05:59 | voltist | Oh right yeah |
11:07:34 | * | robotme joined #nim |
11:07:41 | * | robotme quit (Client Quit) |
11:12:24 | * | gour joined #nim |
11:13:37 | gour | PMunch: hello, i'd have to decide which gui to use with nim, so wonder if you have any further plans in regard to wxnim? |
11:13:51 | PMunch | Define plans |
11:14:17 | gour | wel, some further development if it is required, maintain, etc. |
11:15:17 | * | kenran quit (Ping timeout: 265 seconds) |
11:15:22 | gour | how does it compare with e.g. NiGUI for real work... |
11:16:19 | Yardanico | gour: you might also be interested in https://github.com/StefanSalewski/gintro |
11:17:41 | gour | Yardanico: i plan to work on multi-platform app and way too often i'm told that GTK & Mac OS do not fit together well... |
11:17:52 | gour | i'm on linux however... |
11:17:56 | Yardanico | well nigui will only really work for simple apps |
11:18:09 | Yardanico | also GTK on macOS is fine but you probably won't have that "native" look |
11:18:16 | Yardanico | nigui on macos uses GTK too fwiw |
11:18:42 | gour | Yardanico: yes, but there is plan to add native macos support. is gintro more mature/complete? |
11:19:04 | Yardanico | gour: well gintro is much more complete since it's a binding to all of GTK 3 (and GTK 4 too) |
11:19:25 | gour | Yardanico: only one contributor for gintro... |
11:19:36 | Yardanico | and mostly one contributor to NiGUi too |
11:19:48 | Yardanico | and macos support is in the "planned" status for at least 3 years in nigui |
11:20:49 | Yardanico | IMO gintro is currently the best choice for advanced GUIs in Nim |
11:20:55 | gour | Yardanico: ohh...which GUIs for Nim are using GC saving the user to handle memory manually? i know that gintro does it, not sure about nimx, nigui... |
11:20:55 | Yardanico | for simpler stuff nigui will be enough |
11:21:05 | Yardanico | gour: nigui does it as well |
11:21:09 | Yardanico | nimx too |
11:21:15 | Yardanico | nimx doesn't use any native frameworks at all though |
11:21:18 | Yardanico | it uses OpenGL |
11:21:29 | Yardanico | well, also webgl for js backend |
11:21:50 | gour | Yardanico: i do not plan toy app...thinking about it for quite some time, but due to various reasons was not able to work on it earlier...and using nim seems as better idea than python |
11:22:23 | Yardanico | well as I said before for more advanced GUIs you might have luck with gintro since there are some tutorials about GTK and stuff, and gintro itself has a lot of examples |
11:22:28 | gour | for some reason, nimx does not seems ok for me, althoug it even target android... |
11:22:40 | Yardanico | nimx is pretty advanced too, but it lacks documentation a bit |
11:22:48 | Yardanico | gour: define "does not seem ok" :P |
11:22:58 | PMunch | goul, well I plan to make sure that it continues to run on the latest version of Nim. And to fix any bugs that pop up. But it's mostly just a wrapper around wxWidgets with the addition of a fairly straight forward DSL, haven't really planned any more features. But I'll gladly accept PRs if they are well made |
11:23:46 | gour | Yardanico: well, just a feeling...is Stefan visiting this place? |
11:24:26 | gour | PMunch: does it take care of memory management or it has to be done manually? |
11:24:33 | Yardanico | you might have better luck asking about gintro on the forum, but yeah, they're there sometimes |
11:24:34 | Yardanico | !seen StefanSalewski |
11:24:34 | disbot | StefanSalewski never seen. |
11:24:36 | Yardanico | lol |
11:24:51 | Yardanico | seems like he doesn't really visit IRC nowadays |
11:24:59 | Yardanico | so yeah, ask on the forum (or in gintro issues) about gintro |
11:25:03 | gour | ok |
11:25:10 | Yardanico | e.g. see https://forum.nim-lang.org/t/5759 |
11:25:10 | PMunch | I think he does, but not directly on IRC |
11:25:56 | Yardanico | ah |
11:25:59 | Yardanico | !seen salewski |
11:25:59 | disbot | salewski quit 720 hours ago and last spoke 20 hours ago |
11:26:06 | Yardanico | that's the one :) |
11:26:22 | gour | if i need to bind 3rd party C library which i'd include in sources, which build system would you recommend for nim or it can be done with nim's tools only? |
11:26:36 | Yardanico | you can define any tasks in .nimble |
11:26:42 | PMunch | gour, well it uses the WxWidgets memory model, so I guess you might have to do some manual stuff there |
11:26:48 | PMunch | Don't remember TBH |
11:26:58 | gour | even bulding of manual written in e.g. rst? |
11:27:09 | gour | PMunch: ok |
11:27:17 | PMunch | You can use Nim directly, possibly with something like nimterop |
11:28:36 | gour | PMunch: with nimterop one can also provide soe called thick (aka more Nim) bindings instead of just wrapper over C API? |
11:28:56 | Yardanico | of course, yes |
11:29:12 | Yardanico | you just create idiomatic nim procedures which call native C functions |
11:29:20 | * | gour thumbs up |
11:29:28 | PMunch | Yeah, what you typically do is use something like that to create the thin wrapper and then build a thick wrapper on top |
11:29:37 | gour | nice |
11:30:38 | * | kenran joined #nim |
11:33:27 | gour | so, these days, nimterp is preferable over c2nim? |
11:33:42 | Yardanico | well, it automates more things |
11:33:55 | Yardanico | c2nim still has its advantages |
11:34:43 | * | silvernode joined #nim |
11:34:59 | * | silvernode quit (Client Quit) |
11:35:49 | * | silvernode joined #nim |
11:35:59 | gour | which ones? |
11:38:47 | shashlick | C++ support |
11:41:03 | gour | ahh, that one i don't need, hopefully :-) |
11:42:41 | shashlick | It's on the road map for nimterop, right now focusing on http://Conan.io support |
11:43:07 | * | silvernode quit (Quit: Leaving) |
11:43:40 | shashlick | Instead of building libraries, getHeader will simply download pre-built binaries and headers with -d:xxxConan |
11:44:20 | * | silvernode joined #nim |
11:45:05 | Yardanico | https://studfile.net/preview/2915940/page:2/ |
11:45:09 | Yardanico | sorry wrong window |
11:46:59 | * | neceve_ quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
11:47:25 | * | neceve_ joined #nim |
11:51:37 | * | dddddd joined #nim |
12:05:46 | * | silvernode_ joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:40 | * | supakeen joined #nim |
12:07:08 | * | clemens3 quit (Quit: WeeChat 2.7) |
12:07:19 | * | gour left #nim ("WeeChat 2.8") |
12:15:29 | * | silvernode_ quit (Quit: Leaving) |
12:21:40 | ldlework | In a Nim template, if I'm using `backticks` to construct an identifier name, is there anyway to transform the input, like captialize the first letter? |
12:21:56 | ldlework | I tried, colorize(s, `fg c.toUpper()`) |
12:21:59 | ldlework | but that didn't work |
12:25:02 | ldlework | oh right types are not case sensitive or something |
12:25:26 | PMunch | The first character is case-sensitive |
12:25:41 | PMunch | But no, there is no way to do that, you'd need to use a macro |
12:27:06 | * | endragor quit (Remote host closed the connection) |
12:27:33 | * | endragor joined #nim |
12:32:01 | * | endragor quit (Ping timeout: 264 seconds) |
12:33:14 | * | rockcavera joined #nim |
12:42:21 | * | dmi00 joined #nim |
12:42:21 | * | dmi0 quit (Read error: Connection reset by peer) |
12:42:36 | FromDiscord | <djazz> running into another overloading issue again. In my Response object type I have `status*: HttpCode` and if I want to be able to set an int to it I tried to do `proc ´status=´*(this: Response, code: int) = this.status = HttpCode(code)` (i flipped the ´ here so it would highlight) but I still get same error `type mismatch: got <int literal(304)> but expected 'HttpCode = distinct range 0..599(int)'` |
12:43:23 | FromDiscord | <djazz> if I remove the * from the type definition it works because then it doesnt see the property, but I would have to write another setter and more getters |
12:43:28 | FromDiscord | <djazz> or rename the prop |
12:46:50 | FromDiscord | <djazz> seems like * doesnt matter if i use it in same file |
12:46:55 | FromDiscord | <djazz> here is an example https://play.nim-lang.org/#ix=2oIw |
12:49:23 | ldlework | colorize.nim(13, 15) Error: undeclared identifier: 'fggreen' |
12:49:31 | ldlework | if colorize imports terminal, shouldn't it find fgGreen? |
12:49:51 | ldlework | oh nm |
12:52:16 | PMunch | Any reason you're not using termstyles? |
12:53:05 | FromDiscord | <willyboar> 🙂 |
12:54:05 | FromDiscord | <djazz> the manual at https://nim-lang.org/docs/manual.html#procedures-properties says "the builtin dot access is preferred if it is available" but I thought that was only inside the proc, not for the whole module? |
12:55:28 | FromDiscord | <djazz> seems like i would have to make setters and getters |
12:57:58 | FromDiscord | <mratsim> it's in the module, there is no way to know which proc are the blesed accessors otherwise |
12:59:32 | FromDiscord | <djazz> looks like i can't have two getters either, "overloaded 'status' leads to ambiguous calls" |
13:03:20 | FromDiscord | <djazz> oh well, guess I'll have the users of the module use HttpCode instead of passing numbers |
13:05:22 | * | endragor joined #nim |
13:09:56 | * | endragor quit (Ping timeout: 256 seconds) |
13:14:26 | alehander92 | you can use converters |
13:15:32 | alehander92 | but there was a reason to use this type def |
13:15:58 | FromDiscord | <djazz> if it wasn't distinct it would be easy 😄 |
13:16:00 | alehander92 | i guess its similar to units/etc: makes it hard to pass a variable containing a random int there |
13:16:16 | FromDiscord | <djazz> yeah |
13:16:31 | * | endragor joined #nim |
13:16:36 | FromDiscord | <djazz> a http code should be a symbol (or in nim's case, distinct type) |
13:16:42 | alehander92 | `200.code` or something seems cool to me |
13:16:46 | FromDiscord | <djazz> youh shouldnt do math on them |
13:16:46 | alehander92 | it can be enum |
13:16:58 | alehander92 | but i agree this might be more confusing, so distinct should be fine |
13:17:09 | FromDiscord | <djazz> there are constants, e.g. Http200 |
13:17:17 | alehander92 | yeah |
13:17:28 | FromDiscord | <djazz> so the user have to do ctx.status = Http404 |
13:17:44 | FromDiscord | <djazz> and to get int, just do ctx.status.int |
13:18:15 | FromDiscord | <djazz> found a missing http code, imma make my first Nim PR 😄 |
13:18:39 | * | endragor quit (Remote host closed the connection) |
13:18:46 | * | endragor joined #nim |
13:19:15 | alehander92 | hm, yeah |
13:19:18 | alehander92 | which one |
13:21:02 | * | dmi00 is now known as dmi0 |
13:32:22 | krux02 | gour: https://github.com/krux02/nimAntTweakBar/blob/master/AntTweakBar.nim |
13:32:32 | krux02 | I recommend you to just compile the C files with Nim directly. |
13:32:43 | krux02 | Then you don't need any build system except the nim compiler. |
13:33:11 | ldlework | Can I unmarshal json into type variants? |
13:38:17 | alehander92 | not sure |
13:38:30 | alehander92 | but you can using a lib even if its not possible with stdlib |
13:38:36 | alehander92 | but try with the stdlib first |
13:46:08 | * | Vladar quit (Quit: Leaving) |
13:49:38 | * | drewr quit (Ping timeout: 260 seconds) |
13:55:21 | * | drewr joined #nim |
14:06:16 | * | NimBot joined #nim |
14:09:37 | * | oddp quit (Remote host closed the connection) |
14:09:58 | Yardanico | ldlework: yes |
14:10:08 | Yardanico | well if you mean object variants, not "type variants" |
14:10:15 | ldlework | Yardanico: yeah, how do you do it? |
14:10:33 | Yardanico | just use json.to |
14:13:46 | Yardanico | and the json kind field should either be with the same name as an enum member |
14:13:54 | Yardanico | or with the same string value as the enum member |
14:14:03 | Yardanico | of the enum member* |
14:16:38 | Yardanico | https://play.nim-lang.org/#ix=2oIR |
14:17:09 | Yardanico | of course you have to understand that you can't have fields with the same name in different branches - although this can be solved when you modify the json.to macro |
14:25:34 | * | PMunch quit (Quit: leaving) |
14:26:57 | * | Tyresc joined #nim |
14:34:17 | * | kenran_ joined #nim |
14:36:21 | * | kenran quit (Ping timeout: 265 seconds) |
14:43:21 | ldlework | How do you explicitly skip default args and provide trailing varargs? |
14:43:34 | Yardanico | you don't? |
14:43:43 | Yardanico | just create another procedure overload I guess |
14:44:24 | Yardanico | ah wait actually |
14:44:32 | Yardanico | ldlework: this works |
14:44:32 | Yardanico | https://play.nim-lang.org/#ix=2oIW |
14:44:55 | * | silvernode quit (Ping timeout: 260 seconds) |
14:45:23 | ldlework | thanks |
14:46:15 | * | drewr quit (Quit: upgrade) |
14:53:23 | * | opal quit (Ping timeout: 240 seconds) |
14:53:46 | * | Vladar joined #nim |
14:54:47 | disruptek | never marry for love. |
14:55:20 | * | opal joined #nim |
14:55:54 | * | waleee-cl joined #nim |
14:56:07 | * | madprops left #nim ("Leaving") |
14:56:57 | Zevv | yeah, I heard this story once of a dude who married a girl from a rich family. But he ran away. |
14:57:13 | livcd | disruptek: You did?! |
14:57:17 | disruptek | sounds like a real prick. |
14:57:33 | Zevv | well, I met him once, and he was pretty cool actually |
14:57:54 | disruptek | accidents happen in even the best-regulated families. |
15:00:04 | livcd | my friend's the opposite. He knew it would be an awesome business transaction. And It was |
15:03:06 | * | aenesidemus joined #nim |
15:20:25 | * | dmi0 quit (Quit: Leaving) |
15:21:48 | disruptek | YOLO |
15:26:06 | * | kenran_ quit (Ping timeout: 258 seconds) |
15:27:55 | * | drewr joined #nim |
15:29:59 | FromDiscord | <Kiloneie> What the hell is this, today suddendly VS Code won't open each file i opened from different folders in separate editors, and then when i try to drag the tab it made instead of the window like i would in the browser out to make a new window it freezes permanently. |
15:49:25 | * | narimiran quit (Ping timeout: 264 seconds) |
15:49:29 | fredrikhr | I am writing a docker image that should contain Nim, but the image uses other dependencies as well, what is my best way to put Nim into that? Download the binaries from nim-lang and extract? |
15:50:27 | * | alehander92 quit () |
15:50:58 | * | alehander92 joined #nim |
15:50:58 | * | alehander92 is now known as alexander92 |
15:51:14 | * | alexander92 is now known as alehander92 |
15:51:42 | * | Trustable quit (Remote host closed the connection) |
15:51:47 | fredrikhr | Or maybe someone can point me to where the Dockerfile for building the Nim image is? |
15:53:10 | alehander92 | maybe this can help https://github.com/status-im/nim-docker ? |
15:53:22 | alehander92 | but this is status-im specific, otherwise not sure where the playground repo is |
15:53:31 | alehander92 | but it might also have docker for nim |
15:54:29 | * | Trustable joined #nim |
15:54:33 | fredrikhr | alehander92, well I was thinking of the nimlang/nim image on Docker Hub |
15:54:41 | alehander92 | ahh i am not sure |
15:54:47 | * | bung quit (Quit: Lost terminal) |
15:55:03 | FromDiscord | <codic> how do i get a random element from seq again? |
15:56:17 | FromDiscord | <codic> oh, random.sample |
16:00:33 | FromDiscord | <codic> how do i cross compile from solus linux to windows? |
16:00:50 | * | adnan338 quit (Ping timeout: 260 seconds) |
16:06:09 | FromDiscord | <djazz> mingw |
16:06:31 | Yardanico | or zig (which embeds clang) |
16:08:12 | * | a_chou joined #nim |
16:09:21 | FromDiscord | <codic> zig xd↵i used `sudo eopkg it mingw-w64 mingw-w64-32bit mingw-w64-binutils mingw-w64-binutils-32bit mingw-w6-gcc mingw-w64-gcc-32bit` |
16:09:23 | FromDiscord | <codic> then `nim c --cpu:amd64 --os:windows --gcc.exe:x86_64-w64-mingw32-gcc --gcc.linkerexe:x86_64-w64-mingw32-gcc -d:ssl *.nim` |
16:09:33 | FromDiscord | <codic> but it keeps saying it can't find x86_64-w64-mingw32-gcc: |
16:09:56 | Yardanico | are you sure it's in your $PATH? |
16:10:11 | Yardanico | also yeah, i'm not joking about using zig |
16:10:22 | Yardanico | I mean zig cc |
16:10:48 | FromDiscord | <codic> oh |
16:10:59 | FromDiscord | <codic> It should be in my path if it was installed right |
16:11:09 | Yardanico | yes |
16:11:16 | FromDiscord | <codic> /usr/bin/x86_64-w64-mingw32-gcc doesn't exist either |
16:11:20 | FromDiscord | <Recruit_main707> are you on windows= |
16:11:23 | FromDiscord | <Recruit_main707> ?* |
16:11:23 | FromDiscord | <codic> no |
16:11:27 | FromDiscord | <codic> i want to compile FOR windows |
16:11:29 | Yardanico | @Recruit read context pls |
16:11:38 | FromDiscord | <codic> because some friends just dont understand the awesomeness of liux |
16:11:41 | FromDiscord | <codic> (edit) 'liux' => 'linux' |
16:12:21 | * | oddp joined #nim |
16:12:58 | FromDiscord | <codic> d:mingw doesnt work either |
16:13:00 | FromDiscord | <codic> cant find it |
16:13:10 | Yardanico | if you can't execute it in your shell |
16:13:13 | FromDiscord | <Rika> thats weird |
16:13:15 | Yardanico | how do you expect nim to find it |
16:13:20 | FromDiscord | <Rika> it should have installed right |
16:13:33 | FromDiscord | <codic> sent a code paste, see http://ix.io/2oJ6 |
16:13:38 | FromDiscord | <codic> which one would make sense for what i want to do? |
16:13:45 | FromDiscord | <Rika> did you get all of the ones with gcc |
16:13:46 | FromDiscord | <Rika> xd |
16:13:51 | FromDiscord | <codic> yes |
16:13:55 | FromDiscord | <codic> except the dbginfo ones |
16:13:57 | Yardanico | mingw-w64-gcc |
16:14:02 | FromDiscord | <codic> yeah i have it |
16:14:17 | FromDiscord | <Rika> can you query eopkg if it is installed |
16:14:33 | FromDiscord | <codic> yes |
16:14:45 | Yardanico | find /usr -name "x86_64-w64-mingw32-gcc" |
16:14:49 | FromDiscord | <codic> https://media.discordapp.net/attachments/371759389889003532/719947619954065448/unknown.png |
16:14:52 | FromDiscord | <codic> You can see the Installed |
16:14:53 | FromDiscord | <codic> Sur |
16:14:54 | FromDiscord | <codic> (edit) 'Sur' => 'Sure' |
16:15:04 | FromDiscord | <codic> ohh i see |
16:15:05 | FromDiscord | <codic> it found it in `/usr/share/mingw-w64/bin/x86_64-w64-mingw32-gcc` |
16:15:09 | Yardanico | see |
16:15:20 | Yardanico | I'm not sure why that's not in $PATH in solus though |
16:15:22 | FromDiscord | <codic> can i symlink that in /usr/bin? |
16:15:23 | Yardanico | if it installs to that location |
16:15:27 | FromDiscord | <Rika> go ahead |
16:16:19 | FromDiscord | <codic> Okay let's hope this works |
16:16:26 | FromDiscord | <codic> Yay |
16:23:11 | * | a_chou quit (Quit: a_chou) |
16:34:23 | FromDiscord | <djazz> Restart your shell and see if its in your path |
16:34:41 | FromDiscord | <djazz> Or set PATH manually 🙂 |
16:42:13 | FromDiscord | <Kiloneie> Man am i having difficulty saying the word "iterator", longest recording session ever i thin D: |
16:43:10 | FromDiscord | <codic> it did work |
16:43:13 | FromDiscord | <codic> with the symlink |
16:57:44 | disruptek | !repo alsa |
16:57:46 | disbot | https://github.com/Arkq/bluez-alsa -- 9bluez-alsa: 11Bluetooth Audio ALSA Backend 15 429⭐ 106🍴 7& 29 more... |
17:15:10 | fredrikhr | running `nimble install choosenim`. It fails stating: "Tip: 36 messages have been suppressed, use --verbose to show them.". Then I ran `nimble install --verbose choosenim`, it still fails, but it still won't tell me the reason why the build failed? |
17:15:45 | FromDiscord | <Kiloneie> is there some kind of shortcut or why is my keyboard language getting switched to english randomly ? |
17:15:50 | FromDiscord | <Kiloneie> On Windows |
17:16:06 | Yardanico | no? |
17:16:23 | Yardanico | also we have #nim-offtopic for stuff like that (not that it really matters when the chat is not active though) |
17:16:37 | FromDiscord | <Kiloneie> i know xD sorry |
17:17:08 | FromDiscord | <Kiloneie> (happens very often when playing a certain game, it's infuriating...) |
17:18:09 | fredrikhr | @Kiloneie Windows+Space or RightAlt+RightShift are both shortcuts to changing the Keyboard layout |
17:19:28 | FromDiscord | <Kiloneie> huh... i guess i hit windows + spacebar often... |
17:22:26 | FromDiscord | <Cut a weeb and a pedo bleeds> how do you ```nim "\xC3\xB3" == r"\xC3\xB3"``` |
17:22:33 | FromDiscord | <Cut a weeb and a pedo bleeds> pardon the nim |
17:22:55 | FromDiscord | <Cut a weeb and a pedo bleeds> what do I need to do to the rstring to make it like the normal string? |
17:23:16 | FromDiscord | <brainproxy> in nim how do I do "change the working directory to the directory in which the executable is running"? |
17:23:51 | FromDiscord | <Cut a weeb and a pedo bleeds> https://nim-lang.org/docs/os.html#setCurrentDir%2Cstring |
17:24:06 | FromDiscord | <Cut a weeb and a pedo bleeds> there's also another one for the current dir |
17:24:17 | FromDiscord | <Cut a weeb and a pedo bleeds> https://nim-lang.org/docs/os.html#getCurrentDir |
17:24:25 | FromDiscord | <Cut a weeb and a pedo bleeds> sorry |
17:24:46 | Yardanico | you meant https://nim-lang.org/docs/os.html#getAppFilename :) |
17:24:51 | FromDiscord | <Cut a weeb and a pedo bleeds> yep |
17:25:13 | FromDiscord | <brainproxy> getAppDir |
17:25:27 | Yardanico | well yeah, for the directory - sure |
17:25:40 | Yardanico | getAppDir uses getAppFilename internally anyway :D |
17:25:43 | FromDiscord | <brainproxy> cool, thanks |
17:25:49 | Yardanico | https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/os.nim#L2972 |
17:26:19 | * | B4s1l3 joined #nim |
17:27:34 | * | B4s1l3 is now known as opDispatch |
17:42:33 | * | narimiran joined #nim |
17:46:17 | FromGitter | <kaushalmodi> What is `lent T` return type? Where can I learn more about it? |
17:47:22 | FromGitter | <kaushalmodi> Ref: https://github.com/kaushalmodi/std_vector/issues/9#issuecomment-640316525 /cc @timotheecour |
17:47:23 | disbot | ➥ misc feedback part 2 |
17:52:38 | * | lritter quit (Quit: Leaving) |
17:56:55 | FromGitter | <Julioevm> Hey everyone, is there a simple way of running a shell command from a nim program and get the output from said command to process it further? |
17:57:13 | FromGitter | <Julioevm> execShellCmd seems to return the error code |
17:57:41 | FromGitter | <kaushalmodi> `execProcess` |
17:58:47 | FromGitter | <kaushalmodi> There's `execCmdEx` too, but after I learned about `execProcess`, I prefer that because I don't need to shell-quote the args manually |
18:00:43 | FromGitter | <Julioevm> cool, seems thats just what I was looking for |
18:00:45 | FromGitter | <Julioevm> thanks! |
18:06:52 | FromGitter | <anon767> hey does someone know why this gives me "type mismatch" error? ⏎ https://gist.github.com/anon767/64695597ea05eb842620c88a46086b51 |
18:07:34 | FromDiscord | <Rika> @anon767 test.table[0] = false |
18:08:34 | FromGitter | <anon767> oh haha thx |
18:12:26 | FromDiscord | <mratsim> The new assembly syntax from Rust is interesting: https://blog.rust-lang.org/inside-rust/2020/06/08/new-inline-asm.html |
18:25:25 | FromDiscord | <tyler569> it's kinda interesting and probably more approachable than GCC extended asm, but in comparison it's super limited |
18:26:44 | * | kenran joined #nim |
18:38:38 | FromDiscord | <Kiloneie> Was gonna make 2 videos today, 1 for yesterday's absence but umm... guess a long singular one is fine i guess: https://youtu.be/avTodIhY5lc |
18:39:12 | FromDiscord | <Kiloneie> Took me a while to be able to even say Iterators without tying my tongue xD... |
18:42:23 | * | crem joined #nim |
18:47:20 | FromDiscord | <Shucks> https://play.nim-lang.org/#ix=2oK8 this works, but I would like to pass arguments to my callback procs and actually have no idea how to deal with it. Could someone help me out. |
18:50:48 | * | crem quit (Read error: Connection reset by peer) |
18:53:32 | FromDiscord | <mratsim> callback: proc(env: pointer) {.nimcall, gcsafe.} |
18:53:45 | FromDiscord | <Generic> inline assembler in general is a step child |
18:54:02 | FromDiscord | <Generic> I know it's not meant to be used for more than a few lines |
18:54:27 | FromDiscord | <Generic> but once you jump into dedicated assembler files interop with C++ becomes horrible |
18:54:50 | FromDiscord | <mratsim> for bigint or cryptography you are basically required to drop down in assembler |
18:55:37 | FromDiscord | <Generic> I know for the carry stuff, though from my experience doesn't this mess totally with the compiler's scheduling abilities? |
18:55:43 | * | crem joined #nim |
18:56:18 | FromDiscord | <Generic> this is a bit of a curse of gcc's implementation of neon intrinsics |
18:56:39 | FromDiscord | <Generic> some of them are implemented via inline assembler instead of via builtins |
18:57:01 | FromDiscord | <mratsim> assembler yes, inline assembler no |
18:57:29 | FromDiscord | <mratsim> gcc can elide or choose registers or even whether it puts them in memory or register if you tag them with +rm |
18:57:54 | FromDiscord | <mratsim> the only annoying thing is that GCC and Clang have different extended assembler convention for accesses with offsets |
18:58:21 | FromDiscord | <Generic> hm, my problem was that sooner or later I reached the maximum amount of operands |
18:58:40 | FromDiscord | <mratsim> I tried to build a compiler for inline assembler as a proof of concept: https://github.com/mratsim/constantine/blob/master/constantine/primitives/research/addcarry_subborrow_compiler.nim#L43-L61 |
18:59:04 | FromDiscord | <mratsim> in GCC for a 8 byte displacement I would use 8+%[b] |
18:59:11 | FromDiscord | <mratsim> in Clang 8%[b] |
18:59:36 | FromDiscord | <Generic> interesting, though Nim is better of than C++ anyway |
18:59:37 | FromDiscord | <mratsim> otherwise you get super weird and unhelpful errors |
19:00:31 | FromDiscord | <mratsim> also if you tag a proc {.inline.} Clang will just bail out with that syntax |
19:01:04 | FromDiscord | <mratsim> If I expand on that I will pass all array indices as arguments instead of playing with array offsets |
19:01:32 | FromDiscord | <mratsim> that might lead to 50 arguments when iterating on 2 arrays with 20 elements for an addition but oh well ... |
19:01:56 | FromDiscord | <mratsim> someone is trying to pass 3M arguments to a function since a month ago 😉 |
19:05:12 | FromDiscord | <Generic> I wonder if we could in theory write better neon intrinsics in Nim |
19:05:18 | FromDiscord | <Generic> with some kind of higher level assembler dsl |
19:05:24 | FromDiscord | <mratsim> Sure |
19:05:48 | FromDiscord | <Generic> (alternatively you could just use clang) |
19:05:58 | FromDiscord | <mratsim> it's a bit limited |
19:06:07 | FromDiscord | <mratsim> you don't have easy access to shuffle for example |
19:06:28 | FromDiscord | <mratsim> but this matrix multiplication code reaches the speed of decades old BLAS code: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_ukernel_sse2.nim |
19:06:40 | FromDiscord | <mratsim> and adding support for new instructions and fallback is very easy |
19:06:50 | FromDiscord | <mratsim> https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_ukernel_avx512.nim#L40-L74 |
19:07:18 | FromDiscord | <mratsim> for extending with neon the hardest would be runtime detection of Neon support |
19:08:13 | FromDiscord | <Generic> I'm not super familar with sse, though from the surface I prefer neon simply for it's interleaved/deinterleaved store |
19:09:21 | FromDiscord | <mratsim> well it's just that if neon has load, store, addition, multiplication, I just need to put the function name in there and voila neon support |
19:09:59 | FromDiscord | <mratsim> and it would be competitive or even faster than han optimized ASM kernels |
19:10:27 | FromDiscord | <mratsim> I can't beat Intel, but ARm didn't put as much work in their linear algebra routines |
19:10:40 | FromDiscord | <mratsim> and I can beat OpenBLAS |
19:12:49 | * | Senny joined #nim |
19:14:20 | FromDiscord | <Generic> why haven't you already? |
19:14:54 | FromDiscord | <mratsim> added Neon? |
19:14:56 | FromDiscord | <Generic> yes |
19:15:02 | FromDiscord | <mratsim> lack of time |
19:15:16 | FromDiscord | <mratsim> I have to whip up my Raspberry Pi to test them |
19:15:49 | FromDiscord | <Generic> hm, I imagine it would be (atleast for the matrix mul) pretty straightforward |
19:16:02 | FromDiscord | <Generic> though this is really not field |
19:17:29 | FromDiscord | <Generic> the code for float ops generated from neon intrinsics a lot less quirky than integer |
19:17:50 | Yardanico | if you have a relatively modern android phone you can install termux and run a SSH server here, and connect from the computer (via wifi or you can also use termux over adb) |
19:18:19 | Yardanico | and then test in termux (since it's a linux environment for android including a C compiler) |
19:18:39 | Yardanico | most modern phones (on android) supports tons of ARM extensions |
19:19:44 | FromDiscord | <Generic> pretty much any aarch64 processor supports neon |
19:29:57 | FromDiscord | <mratsim> I have nim-beacon-chain running on my phone 😉 |
19:30:06 | FromDiscord | <mratsim> and a pretty popular tweet on that |
19:30:15 | Yardanico | yeah termux is nice |
19:30:27 | Yardanico | I remember when I had to do some dirty manual hand patching of the C files for termux on android :P |
19:30:29 | FromDiscord | <mratsim> https://twitter.com/m_ratsim/status/1224769743892230151 |
19:30:30 | Yardanico | to replace a few functions |
19:30:30 | * | silvernode joined #nim |
19:30:33 | Yardanico | before it was added to upstream |
19:30:54 | FromDiscord | <mratsim> This is Nim + Eth2 running on 5 phones |
19:31:00 | Yardanico | @mratsim why ubuntu chroot though? it didn't work without it or because dependencies? |
19:31:15 | FromDiscord | <mratsim> it was in an ubuntu chroot |
19:31:34 | Yardanico | i mean didn't it work in termux itself? |
19:32:40 | Yardanico | but yeah, impressive anyway :) |
19:48:48 | FromDiscord | <mratsim> No it didn't work on termux afaik |
19:49:03 | FromDiscord | <mratsim> something about having a package manager:p |
19:49:15 | Yardanico | it has a pkg manager :) |
19:49:20 | Yardanico | apt based |
19:49:21 | Yardanico | "pkg" |
19:49:26 | Yardanico | (that's the command name) |
19:49:48 | Yardanico | https://github.com/termux/termux-packages |
20:00:20 | * | Jesin quit (Quit: Leaving) |
20:03:19 | * | Jesin joined #nim |
20:04:31 | * | kenran quit (Ping timeout: 246 seconds) |
20:09:13 | fredrikhr | On linux, where does nimble put the nimcache when calling install? |
20:09:22 | disruptek | ~nimcache |
20:09:22 | disbot | nimcache: 11the best way to figure out where it is located is to specify that location with --nimcache -- disruptek |
20:10:16 | Yardanico | fredrikhr: nim on most *nix OSes uses ~/.cache/nim |
20:10:20 | Yardanico | ~ being your home folder |
20:10:21 | disbot | no footnotes for ``. 🙁 |
20:10:43 | fredrikhr | disruptek, Yardanico, and when invoking nimble I do that how? `-p --nimcache:/path/to/somewhere` ? |
20:10:54 | Yardanico | as I said you can just look into ~/.cache/nim :P |
20:13:35 | fredrikhr | So a docker container running nimble would simply delete .cache, right? |
20:13:42 | Yardanico | wdym? |
20:13:56 | Yardanico | it won't delete anything, why would it |
20:14:05 | Yardanico | users in docker containers have their own homedir |
20:14:05 | disruptek | i dunno, i don't use nimble. |
20:14:07 | Yardanico | usually |
20:14:32 | disruptek | you can delete the .cache thusly, or just cause nim to ignore it with -f to the compiler. |
20:14:36 | fredrikhr | Yardanico, because of the size of the layers, you want each layer to be as small as possible, you don't actually need the cache |
20:14:40 | disruptek | ie. force rebuild. |
20:15:03 | disruptek | fredrikhr: are you putting a compiler under a lambda layer? |
20:15:11 | disruptek | under/into |
20:15:27 | fredrikhr | disruptek, no, I am making myself a devcontainer |
20:15:55 | disruptek | ah, well you don't need the .cache but it might be worthwhile if you want to avoid recompiling stuff. |
20:16:02 | Yardanico | disruptek: you can't disable it anyway |
20:16:11 | Yardanico | since nim needs a place to store .c files temporarily :P |
20:16:17 | Yardanico | well you can change it to /tmp for example lol |
20:16:41 | disruptek | he's talking about freezing an image, not removing .cache ability. |
20:16:46 | fredrikhr | disruptek, yeah I know, but when I build the container, I don't need the cache for the intermediaries, so I'd delete them |
20:16:49 | disruptek | he wants it to be as small as possible. |
20:17:03 | Yardanico | well just delete the cache after building then |
20:17:14 | Yardanico | rm -rf ~/.cache/nim and done |
20:17:49 | fredrikhr | Yardanico, that was the plan, hence my original question: Where is it. You answered it: in ~/.cache/nim, and yes there I found it |
20:18:03 | fredrikhr | adding the rm step in my dockerfile now :) |
20:18:04 | disruptek | for example, nigel reuses cache so that a subsequent test run can be accelerated because dependencies are already compiled. |
20:18:32 | disruptek | it just bakes it into a new immutable layer. |
20:19:18 | fredrikhr | And I noticed that the linux binaries that I download from https://nim-lang.org/download/nim-$NIM_VERSION-linux_x64.tar.xz contain the c_code directory for the compiler, I don't need that either IIRC? |
20:19:40 | disruptek | not once you've built it, no. |
20:20:01 | disruptek | it's weird that it'd incude csources. |
20:20:17 | disruptek | i'll defer to someone that uses binaries. |
20:20:29 | fredrikhr | disruptek, I thought so too, but I'll just rm it |
20:20:30 | * | tdc quit (Ping timeout: 258 seconds) |
20:21:54 | Yardanico | fredrikhr: you do to build the compiler, not after that though |
20:22:28 | Yardanico | csources contain a frozen compiled C code for the nim compiler (0.20.0) for almost all platforms for initial bootstrap |
20:22:36 | fredrikhr | Yardanico, I don't build the compiler at all (too much hazzle), I simply download the pre-built binaries from the nim-lang website |
20:22:42 | Yardanico | ah okay |
20:23:03 | fredrikhr | But yeah, I know how building the compiler works, I'll do that for my windows image, but not there yet |
20:23:14 | Yardanico | there are prebuilt windows binaries as well fwiw |
20:23:43 | fredrikhr | Yardanico, yup I know, but since I am the VCC guy, I'll recompile using that backend :D |
20:23:59 | Yardanico | well, be careful about dll dependencies though :P |
20:24:05 | fredrikhr | (BTW, I used to be called couven92, I renamed my nick) |
20:24:12 | Yardanico | oh right it's you :P |
20:24:19 | disruptek | it is he! |
20:24:19 | Yardanico | like the binaries then might require vc redistributable |
20:24:37 | fredrikhr | Yardanico, not if done correctly |
20:26:12 | * | narimiran quit (Quit: leaving) |
20:26:41 | FromDiscord | <Shucks> > ↵> https://play.nim-lang.org/#ix=2oK8 this works, but I would like to pass arguments to my callback procs and actually have no idea how to deal with it. Could someone help me out.↵> Im still stuck. Didn't found any information on the board aswell :/ |
20:27:57 | Yardanico | you just add an argument to that proc type, although it should always be the same |
20:28:03 | Yardanico | also you wouldn't be able to pass GC'd types really |
20:28:51 | Yardanico | something like https://play.nim-lang.org/#ix=2oKK |
20:29:04 | disruptek | damnit my dog's ass stinks. |
20:29:11 | Yardanico | pervert. |
20:29:24 | FromDiscord | <Rika> @Shucks in `callback: proc()`, you must indicate argument type (and name but the name can be anything) |
20:29:32 | FromDiscord | <Rika> no you cannot have this vary |
20:29:35 | FromDiscord | <mratsim> @Shucks: callback with arguments - https://github.com/mratsim/Arraymancer/blob/master/src/autograd/autograd_common.nim#L85-L96↵calling it: https://github.com/mratsim/Arraymancer/blob/master/src/autograd/autograd_common.nim#L237 |
20:29:46 | fredrikhr | woah... Deleting the nim intermediaries shaved off 128MB of data :O |
20:29:47 | Yardanico | @Rika that's what i said :P |
20:30:09 | fredrikhr | i.e. cache and nim c_code |
20:30:40 | FromDiscord | <mratsim> other example↵callback with argument: https://github.com/mratsim/weave/blob/master/weave/datatypes/sync_types.nim#L32↵calling it: https://github.com/mratsim/weave/blob/master/weave/workers.nim#L41 |
20:31:52 | FromDiscord | <mratsim> Note that Weave serializes the argument in a data field and uses a `pointer` (untyped) and cast the callback to a generic proc(env: pointer) type to support any proc via type erasure |
20:32:10 | FromDiscord | <Shucks> Thanks gonna check that out. ↵> you just add an argument to that proc type, although it should always be the same↵@Yardanico[IRC]#0000 That makes sense but I want to be flexible with the arg type and amount of arguments |
20:32:22 | Yardanico | well that's much harder |
20:32:51 | FromDiscord | <mratsim> Then you need to use the same strategy as I use in Weave |
20:32:55 | Yardanico | pointers? :P |
20:33:08 | FromDiscord | <mratsim> poor man's closure |
20:33:22 | FromDiscord | <mratsim> a data type that is large enough to support all kinds of arguments |
20:33:29 | FromDiscord | <mratsim> (I use 144 bytes) |
20:33:43 | FromDiscord | <mratsim> ah but you don't need closure |
20:34:10 | FromDiscord | <mratsim> store all proc as proc(env: pointer) and cast them to the correct type just before use |
20:34:48 | FromDiscord | <mratsim> or store the argument in an array before call and then take the address of that array and pass it to the proc |
20:44:50 | FromDiscord | <Shucks> https://play.nim-lang.org/#ix=2oLw |
20:44:56 | FromDiscord | <Shucks> guess i've found a hacky solution |
20:45:38 | Yardanico | yeah, that's closures :P |
20:45:51 | Yardanico | ah wait no |
20:50:13 | * | beatmox quit (Ping timeout: 252 seconds) |
20:50:18 | * | qwertfisch quit (Quit: ZNC - http://znc.in) |
21:00:50 | * | zedeus quit (Ping timeout: 256 seconds) |
21:02:30 | * | zedeus joined #nim |
21:04:58 | * | clemens3 joined #nim |
21:10:13 | Zevv | Bwaah, we need an inline asm syntax, quick, quick! |
21:10:56 | FromDiscord | <él liquido> is it because **rust**, perhaps? |
21:11:24 | Zevv | quicker! quickest! |
21:11:31 | FromDiscord | <él liquido> well theoretically we have `asm` but it's lame |
21:11:45 | Zevv | well, I bet we can macroize some asm emits |
21:11:54 | Zevv | clobber away! |
21:16:25 | * | neceve_ quit (Ping timeout: 264 seconds) |
21:21:17 | * | noone joined #nim |
21:21:41 | * | noone is now known as Guest16946 |
21:22:36 | * | Trustable quit (Remote host closed the connection) |
21:27:49 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:28:42 | Guest16946 | is there a way for compile time configuration files in nimble other than nim.cfg and project.nimble? |
21:30:29 | * | krux02 quit (Remote host closed the connection) |
21:30:35 | Guest16946 | i am looking for a simpler way to set a configuration structure when coding for some of my projects |
21:41:51 | FromDiscord | <mratsim> @Zevv I might be able to update this JIT assembler so that it produces ASM at compile-time as well: https://github.com/numforge/laser/blob/master/examples/ex07_jit_brainfuck_vm.nim#L26-L43 |
21:46:14 | shashlick | Guest16946 - what exactly do you want to do |
21:52:08 | FromDiscord | <exelotl> petition to rename volatileLoad/volatileStore to peek/poke |
21:52:12 | FromDiscord | <exelotl> https://en.wikipedia.org/wiki/PEEK_and_POKE |
22:00:19 | * | Vladar quit (Quit: Leaving) |
22:01:23 | Guest16946 | shashlick - i would like a simple to use configuration system for projects, for example camera saturation values are a modifiable parameter during development stages, however during runtime that parameter should stay constant across all releases of the executable code. currently we are using json files to read the configuration values that way, in |
22:01:23 | Guest16946 | the future however i would like to do a cross compilation and package the configuration values directly inside the executable |
22:01:31 | Guest16946 | is there currently a way to do so? |
22:02:11 | Guest16946 | the issue with json files is we cannot use const on the json file making it still require that configuration file |
22:03:47 | * | krux02 joined #nim |
22:10:26 | * | aenesidemus quit (Ping timeout: 260 seconds) |
22:16:50 | disruptek | sure. |
22:17:55 | disruptek | i think stdlib has like three different configuration parsers. you can also embed your json as a string, parse it at compile time into a variable, or whatever. |
22:18:25 | Guest16946 | i am having issues doing: |
22:18:53 | Guest16946 | `const json: JsonNode = parseJson("data/config.json")` |
22:19:39 | * | aenesidemus joined #nim |
22:19:45 | disruptek | const jsonData = staticRead"data/config.json" and then at runtime you can `let js = jsonData.parseJson` |
22:20:08 | Guest16946 | Error: invalid type for const: JsonNode |
22:20:19 | FromDiscord | <Rika> `const json: JsonNode = static: let data=staticRead"data/config.json" ; parseJson(data)`↵? |
22:20:26 | FromDiscord | <Rika> ah |
22:20:29 | FromDiscord | <Rika> json node is only runtime |
22:20:33 | FromDiscord | <Rika> makes sense |
22:20:34 | FromDiscord | <Rika> sorry lol |
22:21:06 | Guest16946 | i can do it into a const string and than convert it to json node at runtime and than convert into the datastructure i use for configurations |
22:21:08 | disruptek | you can also just `var foo {.compileTime.} = js["somekey"].getInt` |
22:21:35 | disruptek | plenty of good options. |
22:22:03 | * | opal quit (Ping timeout: 240 seconds) |
22:23:07 | Guest16946 | Error: redefinition of 'json'; previous declaration here: |
22:23:09 | ldlework | I've been screwing with pure languages for a few months it took me a few minutes to realize what I was doing wrong with strutils.removePrefix |
22:23:27 | Guest16946 | import jsonlet json = %*{"hello":"goodbye"}var foo {.compileTime.} = getStr(json["hello"]) |
22:23:44 | FromDiscord | <Rika> dont use the name json lol |
22:24:17 | Guest16946 | my bad ya |
22:24:24 | disruptek | your first let is runtime, the var is .compileTime, so it won't work. |
22:24:24 | Guest16946 | Error: cannot evaluate at compile time: js |
22:24:46 | disruptek | you can use .compileTime on a proc, too, if it's easier. |
22:25:03 | disruptek | or define it outside a static block and then work on it inside. |
22:25:12 | Guest16946 | oh ok ya i have to manually say {.compileTime.} on json |
22:25:21 | Guest16946 | why can i not just use const on it? |
22:25:30 | disruptek | because it's on the heap. |
22:25:45 | Guest16946 | AH ok |
22:25:57 | Guest16946 | thank you |
22:26:05 | * | qwertfisch joined #nim |
22:35:08 | * | opal joined #nim |
22:43:41 | * | qwertfisch_ joined #nim |
22:44:51 | * | qwertfisch quit (Ping timeout: 256 seconds) |
22:47:29 | * | opDispatch quit (Quit: Konversation terminated!) |
22:49:51 | * | krux02 quit (Remote host closed the connection) |
22:54:43 | * | adnan338 joined #nim |
22:55:05 | ldlework | Anyone know what this error means? /nix/store/35b1cm6xxaygrwmk36rj75hagmqldnx7-nim/discovery.nim(23, 10) Error: cannot instantiate: 'nix[seq[SuiteSpec]]'; got 1 type(s) but expected 0 |
22:55:09 | ldlework | https://gist.github.com/dustinlacewell/eebae66a7a87b2a1d406fcf40a19c459 |
22:55:41 | * | beatmox joined #nim |
23:03:56 | ldlework | Error: recursion is not supported in iterators doh |
23:04:21 | * | adnan338 quit (Read error: Connection reset by peer) |
23:16:14 | * | qwertfisch_ is now known as qwertfisch |
23:17:26 | Prestige | Hm a c lib I'm using has rgb values for cushorts, I wonder how I could convert hex into that format. Anyone have ideas? |
23:22:37 | Prestige | for some reason splitting up the hex value and multiplying by 30 is getting the correct color but I have no idea why |
23:26:04 | FromDiscord | <mratsim> seems like a recipe for a fun weekend :p |
23:28:37 | * | aenesidemus quit (Read error: Connection reset by peer) |
23:32:44 | ldlework | How can I type alias a seq type? |
23:32:54 | ldlework | I tried type Foos = seq[Foo] |
23:32:59 | ldlework | but then I'm not sure how to construct it |
23:33:51 | FromDiscord | <Rika> `var foos: Foos`? |
23:34:18 | FromDiscord | <Rika> itll be initialized then; or you can also do `var foos = newSeq[Foo]()` or something |
23:34:20 | ldlework | huh that worked |
23:34:44 | FromDiscord | <Rika> its just an alias after all |
23:35:06 | ldlework | I didn't know that just defining a var would initialize it |
23:37:08 | FromDiscord | <Rika> why not? seqs are no longer nillable |
23:41:35 | ldlework | I just started using Nim again yesterday since like 2010 |
23:44:16 | * | dv^_^_ is now known as dv^_^ |
23:44:30 | * | Tyresc quit (Quit: WeeChat 2.9-dev) |
23:44:54 | FromDiscord | <willyboar> @mratsim you said someone runs a procedure with 3M args? |
23:46:06 | * | xace quit (Ping timeout: 260 seconds) |
23:49:37 | * | xace joined #nim |