00:00:43 | FromDiscord | <Elegantbeef> Run the nim command yourself and see what the error is |
00:01:25 | FromDiscord | <spazzy> weird |
00:01:34 | FromDiscord | <spazzy> it compiels with nim c but not nimble rund |
00:01:45 | FromDiscord | <spazzy> (edit) "compiels" => "compile↵s" |
00:01:47 | FromDiscord | <Elegantbeef> Ok so what does your `rund` task do |
00:02:31 | FromDiscord | <spazzy> wait it compiles but doesnt run |
00:02:35 | FromDiscord | <spazzy> with nim c |
00:02:59 | FromDiscord | <Elegantbeef> See it's a runtime error |
00:03:08 | FromDiscord | <Elegantbeef> So run it and it should give more info |
00:03:08 | FromDiscord | <spazzy> https://github.com/ftsf/nico |
00:03:19 | FromDiscord | <spazzy> im just running the example from that |
00:04:03 | FromDiscord | <Elegantbeef> I mean this will probably work for me, so what does it say when you run the binary? |
00:04:07 | FromDiscord | <Elegantbeef> Cause it should give more information |
00:04:46 | FromDiscord | <spazzy> its not loading sdl even though its installed |
00:05:16 | FromDiscord | <spazzy> nvm im dumb |
00:05:20 | FromDiscord | <spazzy> its not installed on the system |
00:05:23 | FromDiscord | <spazzy> lol |
00:05:32 | FromDiscord | <spazzy> its a fresh install and i forgot about it |
00:05:33 | FromDiscord | <Elegantbeef> We did it! 😀 |
00:06:00 | FromDiscord | <spazzy> thats a really nice library btw |
00:06:05 | FromDiscord | <spazzy> its way more extensive than it looks |
00:06:30 | FromDiscord | <Elegantbeef> Hey i havent done much to it so i can only say pass the compliment to impbox |
00:07:26 | FromDiscord | <spazzy> btw what do you guys use as an ide |
00:07:35 | FromDiscord | <spazzy> this being a fresh install gives me an excuse to try new things |
00:11:18 | FromDiscord | <Elegantbeef> I use Vscode as an editor for serious things and nvim for one offs |
00:11:36 | FromDiscord | <leorize> i use nvim for everything |
00:14:03 | FromDiscord | <spazzy> i usually use vim for everything but ive had a lot of problems with the autocomplete |
00:14:37 | FromDiscord | <spazzy> at least with nim |
00:14:53 | FromDiscord | <spazzy> it doesnt always recognize imports |
00:14:57 | pippin | is there an easier way than 'write stdout, "string"' to get the effect of echo without the trailing newline? |
00:15:18 | FromDiscord | <Elegantbeef> Nope |
00:15:29 | FromDiscord | <Elegantbeef> Not that i know of atleast |
00:15:43 | FromDiscord | <Elegantbeef> You also have to remember that `echo` flushes the stdout |
00:16:13 | pippin | and hmm.. echo is available in nimscript while stdout isnt |
00:20:19 | FromDiscord | <Elegantbeef> Leorize do you know if there is a nvim plugin that renders the background of scopes different colours? Seems like a simple silly way to tell people that moan about whitespace significant to "sod off"? |
00:21:04 | FromDiscord | <leorize> nope |
00:21:31 | FromDiscord | <leorize> @spazzy\: you use vanilla vim or neovim? |
00:21:49 | FromDiscord | <spazzy> usually vanilla |
00:27:20 | FromDiscord | <spazzy> im switching now that i found out about nim.nvim lol |
00:27:30 | FromDiscord | <spazzy> it just werks |
00:37:00 | * | krux02 quit (Remote host closed the connection) |
00:46:17 | FromDiscord | <leorize> neovim is just better |
00:48:08 | FromDiscord | <Rosen> kinda wish neovim had a graphical interface a la gvim when I'm on windows, but that's my only real "complaint" |
00:48:34 | FromDiscord | <Rosen> it's just one extra step to launch a term when I'm used to not using one on the windows box |
00:58:42 | FromDiscord | <leorize> there are a few attempts but they're not very popular |
01:07:39 | FromDiscord | <spazzy> just install gentoo |
01:11:41 | FromDiscord | <spazzy> sent a code paste, see https://play.nim-lang.org/#ix=3IIb |
01:12:08 | FromDiscord | <spazzy> thats not something from 1.2 by any chance is it |
01:13:17 | FromDiscord | <spazzy> (edit) "https://play.nim-lang.org/#ix=3IIb" => "https://play.nim-lang.org/#ix=3IIc" |
01:30:14 | FromDiscord | <demotomohiro> I'm using neovim-qt on windows↵https://github.com/equalsraf/neovim-qt |
01:53:25 | FromDiscord | <Rosen> hey this doesn't look that bad |
02:15:57 | * | neurocyte0132889 quit (Ping timeout: 240 seconds) |
02:41:49 | * | lumo_e quit (Quit: Quit) |
03:00:32 | FromDiscord | <sharpcdf> this is how i check for git, correct? |
03:00:40 | FromDiscord | <sharpcdf> sent a code paste, see https://play.nim-lang.org/#ix=3IIz |
03:08:41 | FromDiscord | <Elegantbeef> It's a way |
03:08:54 | FromDiscord | <jfmonty2> won't `== 1` only evaluate to true if the command fails? |
03:09:33 | FromDiscord | <Elegantbeef> Yea 0 is success and non zero is an issue |
03:10:36 | FromDiscord | <Elegantbeef> Depending on the application you may want to use libgit instead, but it indeed depends |
03:12:28 | FromDiscord | <Rosen> I also feel like it's slightly evil to check for commands by running them, maybe using "command -v git" instead of git? |
03:13:11 | FromDiscord | <Rika> Isn’t command a shell function |
03:13:42 | FromDiscord | <Rosen> That's true I'm assuming posix |
03:13:50 | FromDiscord | <sharpcdf> In reply to @jfmonty2 "won't `== 1` only": yes |
03:14:15 | FromDiscord | <sharpcdf> In reply to @Rika "Isn’t command a shell": theres a seperate functions for shell commands |
03:14:25 | FromDiscord | <Rosen> Oh my bad then |
03:14:52 | FromDiscord | <sharpcdf> https://nim-lang.org/docs/os.html#execShellCmd%2Cstring |
03:15:57 | FromDiscord | <Elegantbeef> There is also `findExe` |
03:17:01 | FromDiscord | <Rosen> ooh findExe looks best |
03:19:08 | FromDiscord | <sharpcdf> In reply to @Elegantbeef "There is also `findExe`": yea ill use that |
03:20:09 | FromDiscord | <sharpcdf> do you know if you have to provide the extension? |
03:20:29 | * | arkurious quit (Quit: Leaving) |
03:20:43 | FromDiscord | <Elegantbeef> `extensions: openArray[string] = ExeExts` |
03:20:59 | FromDiscord | <Elegantbeef> You can provide them if you want but it uses the const \`ExeExts |
03:21:19 | FromDiscord | <Elegantbeef> Which on posix is nothing |
03:21:32 | FromDiscord | <sharpcdf> alright |
03:21:46 | FromDiscord | <sharpcdf> for now my only target is windows |
03:25:17 | * | noeontheend joined #nim |
03:46:16 | FromDiscord | <that_dude> sent a code paste, see https://play.nim-lang.org/#ix=3IIF |
03:50:38 | NimEventer | New thread by Xioren: Looking for some insight into HttpClient and proxy authorization, see https://forum.nim-lang.org/t/8721 |
03:53:16 | FromDiscord | <Rika> `quote do:` returns a NimNode that you arent using |
03:54:52 | * | src quit (Quit: Leaving) |
03:55:42 | FromDiscord | <that_dude> how would I discard that? |
03:55:59 | FromDiscord | <Elegantbeef> damn it |
03:56:02 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3IIH |
03:56:06 | FromDiscord | <that_dude> do I do something like `discard quote do:`? |
03:56:24 | FromDiscord | <Rika> no |
03:56:25 | FromDiscord | <Rika> that wont work |
03:56:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3III |
03:56:29 | FromDiscord | <Rika> beef moment |
03:56:30 | FromDiscord | <Elegantbeef> And there is a better way to do this |
03:56:44 | FromDiscord | <Rika> hes gonna say macrocache |
03:56:46 | FromDiscord | <Rika> im betting |
03:56:48 | FromDiscord | <Rika> a dollar |
03:56:51 | FromDiscord | <Elegantbeef> It's a better way |
03:56:54 | FromDiscord | <that_dude> lol |
03:57:26 | FromDiscord | <Rika> look into it i recommend |
03:57:29 | FromDiscord | <Rika> its a neat module |
03:58:28 | FromDiscord | <that_dude> I may use it, I think it's a bit more powerful than I think I need right now |
03:58:42 | FromDiscord | <that_dude> Well see if I reach any other snags that may need them |
04:00:56 | FromDiscord | <that_dude> I got a new error, but I gtg for now |
04:01:00 | FromDiscord | <that_dude> Will ask later |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:30 | * | supakeen joined #nim |
04:29:15 | FromDiscord | <sharpcdf> when you call a command with `execCmd()` is the wd the directory of the exe |
04:29:41 | FromDiscord | <Elegantbeef> Nope what ever your present working dir is |
04:29:54 | FromDiscord | <sharpcdf> oh ok so just home |
04:29:58 | FromDiscord | <Elegantbeef> you can do `getAppDir` and `setCurrentDir` if you need to |
04:30:13 | FromDiscord | <sharpcdf> yea i was just thinking that |
04:30:14 | FromDiscord | <Elegantbeef> Not "just home", but whatever your environment set the directory to |
04:30:30 | FromDiscord | <sharpcdf> does `getAppDir` return the app exe in the path |
04:30:33 | FromDiscord | <sharpcdf> or just the directory |
04:30:47 | FromDiscord | <Elegantbeef> What do you think `dir` means? |
04:30:59 | FromDiscord | <sharpcdf> lol |
04:31:03 | FromDiscord | <Elegantbeef> dirppalication? |
04:31:16 | FromDiscord | <sharpcdf> well im pretty sure i used it before and it including the exe in the directory |
04:31:20 | FromDiscord | <Elegantbeef> there is `getAppFilename` for the exe |
04:52:40 | FromDiscord | <Yardanico> apparently total compilation time with clang is 32% faster for me when compiling a nim hello world with `nim c -d:danger --gc:orc --cc:clang -f test.nim` rather than with gcc |
04:52:54 | FromDiscord | <Yardanico> 520ms |
04:56:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
04:57:41 | * | noeontheend joined #nim |
05:00:15 | FromDiscord | <sharpcdf> i want to check if a repository is in either github, gitlab, or bitbucket, how would i go about doing that? |
05:00:32 | FromDiscord | <sharpcdf> right now i just have git clones for all of them but it doesnt work at all |
05:00:50 | FromDiscord | <Yardanico> In reply to @sharpcdf "i want to check": in what context? |
05:01:15 | FromDiscord | <Yardanico> by URL? from the cloned repo tree? or something else? |
05:01:21 | FromDiscord | <sharpcdf> by the url |
05:01:32 | FromDiscord | <Yardanico> just check the hostname? |
05:01:37 | FromDiscord | <sharpcdf> what i have right now is appending the base ur(github, bitbucket, etc.) to the suer/repo |
05:01:42 | FromDiscord | <sharpcdf> (edit) "suer/repo" => "user/repo" |
05:01:47 | FromDiscord | <Yardanico> where do you get user/repo from |
05:01:53 | FromDiscord | <sharpcdf> command line args |
05:01:57 | FromDiscord | <Yardanico> and why do you want to check if it's from github/gitlab/bitbucked |
05:01:58 | FromDiscord | <Yardanico> (edit) "github/gitlab/bitbucked" => "github/gitlab/bitbucket" |
05:02:03 | FromDiscord | <Yardanico> In reply to @sharpcdf "command line args": then let the user specify? |
05:02:14 | FromDiscord | <Yardanico> or set the default as `gh` and allow the user to specify if it's not github |
05:02:22 | FromDiscord | <Yardanico> or allow to also specify the full url if it's not github |
05:02:32 | FromDiscord | <sharpcdf> i want it to specifically infer the base url |
05:02:37 | FromDiscord | <Yardanico> but why |
05:02:41 | FromDiscord | <sharpcdf> of course unless theres no way to do so |
05:02:44 | FromDiscord | <sharpcdf> just because |
05:02:45 | FromDiscord | <Yardanico> i mean if you really want to, just do it |
05:02:47 | FromDiscord | <Yardanico> I don't see the issue |
05:02:55 | FromDiscord | <sharpcdf> well thats my question, how would i do it |
05:03:00 | FromDiscord | <Yardanico> std/httpclient |
05:03:14 | FromDiscord | <sharpcdf> and then just check if it returns a 404? |
05:03:39 | FromDiscord | <Yardanico> well, you'll have to check what the websites return on a wrong URL, but generally yeah |
05:03:46 | FromDiscord | <Yardanico> i just don't see how it's specifically a nim problem :) |
05:03:49 | FromDiscord | <sharpcdf> alright thanks |
05:04:01 | FromDiscord | <Yardanico> and what if the same repo exists in more than 1 website? |
05:04:14 | FromDiscord | <sharpcdf> ill probably default it to github like you said |
05:04:32 | FromDiscord | <sharpcdf> and then gitlab |
05:04:47 | FromDiscord | <sharpcdf> and then bitbucket because i never use it and it seems the least popular 👍 |
05:05:03 | FromDiscord | <Yardanico> there's also sourcehut, gitea and more |
05:05:14 | FromDiscord | <Yardanico> https://sr.ht |
05:05:30 | FromDiscord | <sharpcdf> gitea is self-hosted which makes it a little trickier imo, and ive never heard of sourcehut |
05:05:32 | FromDiscord | <sharpcdf> ill check it out |
05:05:41 | FromDiscord | <sharpcdf> i just want the most popular/common ones |
05:05:41 | FromDiscord | <Yardanico> In reply to @sharpcdf "gitea is self-hosted which": not exactly |
05:05:48 | FromDiscord | <Yardanico> well yeah it is, sorry |
05:05:53 | FromDiscord | <Yardanico> i forgot, though they have a main instance |
05:05:57 | FromDiscord | <Yardanico> (edit) "though" => "thought" |
05:06:13 | FromDiscord | <sharpcdf> lol yeah no |
05:06:16 | FromDiscord | <sharpcdf> they have an example page |
05:06:18 | FromDiscord | <sharpcdf> but thats about it |
05:06:33 | FromDiscord | <sharpcdf> ill add source hut |
05:08:10 | FromDiscord | <Yardanico> also i've seen codeberg a few times |
05:08:19 | FromDiscord | <Yardanico> repo.or.cz too |
05:08:30 | FromDiscord | <sharpcdf> In reply to @Yardanico "also i've seen codeberg": only popular websites |
05:08:37 | FromDiscord | <Yardanico> eh |
05:08:47 | FromDiscord | <Yardanico> that's not how it works with open source software :)) |
05:09:00 | FromDiscord | <Yardanico> it's about what people who use your tool use, not about what's generally popular |
05:09:54 | FromDiscord | <sharpcdf> true |
05:10:04 | FromDiscord | <sharpcdf> but for me the first priority is the more common ones |
05:10:12 | FromDiscord | <sharpcdf> i might get to them later |
06:15:04 | NimEventer | New thread by Xioren: Issues with proxy authentication, see https://forum.nim-lang.org/t/8722 |
07:47:24 | FromDiscord | <joe733> Hi what's the equivalent of Python's `os.read(fd: int, n: int) -> bytes` in nim? |
07:50:35 | FromDiscord | <Elegantbeef> Does that read n number of bytes and return it? |
07:50:56 | FromDiscord | <Elegantbeef> If so https://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural |
08:24:01 | NimEventer | New post on r/nim by miran1: Nim 1.6.2 is out!, see https://reddit.com/r/nim/comments/rj30uu/nim_162_is_out/ |
08:40:58 | FromDiscord | <valerga> is gdb a proper debugger for nim code? |
08:41:05 | FromDiscord | <valerga> i want to ascend from echo debugging lol |
08:41:11 | FromDiscord | <Elegantbeef> You can use it yes |
08:41:15 | FromDiscord | <Elegantbeef> Do you use vscode? |
08:41:19 | FromDiscord | <valerga> yeah |
08:41:31 | FromDiscord | <valerga> i see it has breakpoints |
08:41:33 | FromDiscord | <valerga> but i never use them |
08:41:39 | FromDiscord | <Elegantbeef> https://github.com/saem/vscode-nim#debugging |
08:41:55 | FromDiscord | <Elegantbeef> There is a bit of preamble with Nim debugging in vscode, but this'll get you going |
08:42:02 | * | xet7 quit (Ping timeout: 240 seconds) |
08:42:10 | FromDiscord | <valerga> ok, thanks |
08:42:44 | FromDiscord | <Elegantbeef> I dont often use breakpoint debugging though |
08:42:55 | FromDiscord | <Elegantbeef> So if you need help i'm not the person to ask probably 😀 |
08:55:14 | * | xet7 joined #nim |
09:48:57 | * | Colt quit (Quit: Leaving) |
09:49:14 | * | Colt joined #nim |
10:28:03 | FromDiscord | <TryAngle> is the official youtube channel dead or halted? (no uploads for >5 months now) |
10:29:33 | FromDiscord | <Rika> We have an official YouTube channel? |
10:29:47 | FromDiscord | <Elegantbeef> It's where nimconf is posted |
10:29:49 | FromDiscord | <TryAngle> https://www.youtube.com/channel/UCDAYn_VFt0VisL5-1a5Dk7Q |
10:30:22 | FromDiscord | <Elegantbeef> The online meetups havent happened for whatever reason and there hasnt been any events |
10:30:46 | FromDiscord | <Elegantbeef> What's supposed to posted tiktok esque "how to"s? 😛 |
10:31:01 | FromDiscord | <TryAngle> imagine a Nim Tik Tok Account |
10:31:23 | FromDiscord | <Elegantbeef> I'm sure after FOSDEM there might be another video or two, though i dont know |
10:33:58 | FromDiscord | <valerga> animals |
11:21:14 | * | xet7 quit (Remote host closed the connection) |
11:22:24 | * | xet7 joined #nim |
11:27:34 | * | xet7 quit (Ping timeout: 260 seconds) |
11:39:53 | * | xet7 joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:26:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
12:27:24 | FromDiscord | <joe733> sent a code paste, see https://play.nim-lang.org/#ix=3IKk |
12:27:38 | FromDiscord | <joe733> (edit) "https://play.nim-lang.org/#ix=3IKk" => "https://play.nim-lang.org/#ix=3IKl" |
12:27:57 | FromDiscord | <joe733> (edit) "https://play.nim-lang.org/#ix=3IKl" => "https://play.nim-lang.org/#ix=3IKm" |
12:28:12 | FromDiscord | <Solitude> stop trying to write python |
12:28:13 | FromDiscord | <joe733> (edit) "https://play.nim-lang.org/#ix=3IKm" => "https://play.nim-lang.org/#ix=3IKn" |
12:29:16 | FromDiscord | <joe733> In reply to @Solitude "stop trying to write": Well, can't help much when I'm porting a script from python. |
12:31:32 | FromDiscord | <Rika> Use an object variant |
12:31:56 | FromDiscord | <Rika> If you do not know the types ahead of time then there is no trivial solution |
12:41:30 | FromDiscord | <fenrave> In reply to @TryAngle "imagine a Nim Tik": Nim seems like a great language for that sort of thing |
12:44:25 | FromDiscord | <fenrave> Not much point in typing a table if you don't know the types ahead of time, usually you type a table so it only contains on or two types |
12:44:38 | FromDiscord | <fenrave> Just don't type it unless you really need it |
12:48:37 | FromDiscord | <konsumlamm> you can't not type it though |
12:51:15 | FromDiscord | <garuse> @joe733 perhaps you can use a Table[string, string] instead and convert the values to int with parseInt() depending on what you need. |
12:51:52 | FromDiscord | <joe733> In reply to @garuse "<@656116929102086147> perhaps you can": Thanks, I did something similar. |
12:53:59 | FromDiscord | <konsumlamm> or you use `JsonNode` (from `std/json`) |
13:02:35 | * | src joined #nim |
13:02:36 | FromDiscord | <fenrave> In reply to @konsumlamm "you can't not type": haven't had the ability to play around with nim so I was speaking from experience with other languages |
13:02:51 | FromDiscord | <fenrave> good to know that you need to though |
13:06:24 | FromDiscord | <konsumlamm> you don't need to write down the type, but that doesn't mean that it doesn't have a type, it'll be inferred |
13:07:15 | FromDiscord | <fenrave> yeah |
13:44:43 | FromDiscord | <Rika> In reply to @konsumlamm "or you use `JsonNode`": there should be a better default "semi-any" type that isnt a ref so that we dont need to refer to JsonNode anymore for non-json purposes... |
13:44:55 | FromDiscord | <Rika> i guess one that doesnt store itself |
13:50:17 | FromDiscord | <Rad> Hi! I'm a bit of a noob when it comes to Nim, I've recently picked it up and just installed a package with nimble. How do I use that package? It is the Moe editor and I am using Debian. I might have missed a step or don't have something in my path. |
13:51:16 | FromDiscord | <Rika> ~/.nimble/bin/ |
13:51:19 | FromDiscord | <Rika> in path |
13:51:55 | FromDiscord | <Rad> oh nice, thank you. I should have checked around there 😅 |
13:52:14 | FromDiscord | <Rika> idk, its not obvious imo |
13:54:22 | FromDiscord | <Rad> I was checking in the tooling documentation and I couldn't see anything, so it might not have been obvious. Thank you again. |
13:56:15 | FromDiscord | <Rad> The debian package for nim isn't up to date either, is it an official source? I think it's on 1.4.x? |
13:57:15 | FromDiscord | <Solitude> is any debian package up to date? |
13:57:36 | FromDiscord | <Rad> This is true 😂 |
13:59:53 | FromDiscord | <Rad> I try to use Arch, but I needed a 32-bit OS...I believe arch has one but idk if it's official or not. But it's not a daily driver, it's just for testing on (very) low-end specs. |
14:02:13 | FromDiscord | <konsumlamm> In reply to @Rika "there should be a": honestly, people just shouldn't try to store different types in the same table |
14:04:21 | FromDiscord | <ajusa> In reply to @konsumlamm "honestly, people just shouldn't": Sometimes you need to do this though |
14:09:28 | FromDiscord | <Rika> try not to do it as much as possible |
14:23:01 | FromDiscord | <konsumlamm> often you just think you need to do this |
14:25:44 | * | arkurious joined #nim |
14:44:43 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3IKR |
14:44:49 | FromDiscord | <Rika> thats something else |
14:44:59 | FromDiscord | <Rika> its the one with case of in the object declaration |
14:45:05 | FromDiscord | <TryAngle> ah I see |
14:45:15 | FromDiscord | <TryAngle> In reply to @TryAngle "what is that? is": what is this thing then? |
14:45:29 | FromDiscord | <Rika> generic union is what id call it but i dont know the real term |
14:45:44 | FromDiscord | <Rika> compile time only so its the same as auto essentially |
14:45:50 | FromDiscord | <Rika> except restricted to those types |
14:46:11 | FromDiscord | <TryAngle> ah I see and the normal usecase is to restrict generic procs? |
14:46:25 | FromDiscord | <Rika> implicit generics yes |
14:46:30 | FromDiscord | <Rika> or explicit too i guess |
14:47:46 | FromDiscord | <IsaacPaul> In reply to @konsumlamm "honestly, people just shouldn't": I do it all the time when displaying a list of items to a user. Like say you have a list of orders. One could be a special kind of gift card purchase, one could be a package, one could be physical product, one could be a digital product. They are all being displayed as one list. They are all _not_ the same. It makes sense that the list contains different types. |
14:48:10 | FromDiscord | <IsaacPaul> And they are all displayed differently |
14:48:14 | FromDiscord | <Rika> technically theyre the same type |
14:48:19 | FromDiscord | <Rika> just with variands |
14:48:20 | FromDiscord | <Rika> (edit) "variands" => "variants" |
14:48:29 | FromDiscord | <Rika> and thats an appropriate use case |
14:48:30 | FromDiscord | <IsaacPaul> They all have an id 🙂 |
14:48:44 | FromDiscord | <IsaacPaul> lol |
14:48:47 | FromDiscord | <Rika> wdym? variants can have outside fields |
14:49:06 | FromDiscord | <Rika> object; field: type; case field: type of kind: field: ... |
14:49:51 | FromDiscord | <IsaacPaul> package is a group of orders, a gift card purchase doesn't fall into the same category in our system and has its own table in the database.. |
14:50:17 | FromDiscord | <Rika> still completely possible for that to be a variant |
14:50:46 | FromDiscord | <IsaacPaul> I also add items like Seperator and header. But for example purposes imagine a few of these items just being an Ad |
14:50:48 | FromDiscord | <Rika> if JSON can be represented with an object variant then im pretty sure your described system can too.. |
14:51:14 | FromDiscord | <IsaacPaul> > if JSON can be represented with an object variant ↵Oh that's what you mean |
14:51:15 | FromDiscord | <Rika> string representation is decoupled from internal data representation |
14:51:20 | FromDiscord | <Rika> same with database representation |
14:51:25 | FromDiscord | <Rika> wdym thats what i mean |
14:51:38 | FromDiscord | <Rika> lol what did we misunderstand each other with |
14:51:53 | FromDiscord | <IsaacPaul> Is a variant some kind of special nim thing or a pattern? |
14:53:09 | FromDiscord | <Rika> its a "tagged union" in more common terms |
14:55:25 | FromDiscord | <IsaacPaul> In reply to @Rika "and thats an appropriate": I missed this line lol, and thought you were arguing against it lol |
14:55:42 | FromDiscord | <IsaacPaul> I just woke up my bad lol |
14:56:02 | FromDiscord | <Rika> It’s whatever |
15:00:20 | FromDiscord | <TryAngle> what is more idiomatic?↵Big variadic types or OOP ? |
15:01:48 | FromDiscord | <TryAngle> for example building a graph that is made out of nodes that have different purposes (one stores int, another string and another one stores subnodes etc.) |
15:05:43 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3ILa |
15:07:31 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3ILc |
15:07:49 | FromDiscord | <Solitude> тщ |
15:07:52 | FromDiscord | <Solitude> (edit) "тщ" => "no" |
15:08:14 | FromDiscord | <IsaacPaul> It's kinda the same imo.. Essentially, you're just attaching type info to an obj. |
15:08:43 | FromDiscord | <TryAngle> ah I see so when it gets compiled they are partially different types anyways? |
15:08:55 | FromDiscord | <Solitude> its not the same |
15:09:18 | FromDiscord | <IsaacPaul> I meant in an abstract sense |
15:09:20 | FromDiscord | <Solitude> you can achieve similiar functionality but its not the same |
15:09:30 | FromDiscord | <Solitude> and its more idiomatic to use variants |
15:10:45 | FromDiscord | <TryAngle> but why is that? I have never really used OOP anyways so it's not a big deal for me... just curious |
15:11:15 | NimEventer | New thread by Konsumlamm: A rant about Nim bugs, see https://forum.nim-lang.org/t/8723 |
15:11:44 | FromDiscord | <IsaacPaul> because OOP support isn't exactly first class with nim |
15:12:19 | FromDiscord | <IsaacPaul> OOP also implies more things (inheritence, etc) |
15:12:29 | FromDiscord | <konsumlamm> why is my name capitalized by NimEventer? 🤔 |
15:13:20 | FromDiscord | <IsaacPaul> (edit) "OOP also implies more things (inheritence, ... etc)" added "dynamic dispatch table," |
15:13:38 | FromDiscord | <Solitude> In reply to @konsumlamm "why is my name": @Yardanico explain yourself |
15:14:04 | FromDiscord | <Yardanico> In reply to @Solitude "<@!177365113899057152> explain yourself": idk it looked betger |
15:14:09 | FromDiscord | <Yardanico> (edit) "betger" => "better" |
15:14:37 | FromDiscord | <Yardanico> As some people say |
15:14:41 | FromDiscord | <Yardanico> PRs welcome |
15:14:43 | FromDiscord | <Yardanico> https://github.com/Yardanico/nimeventer/blob/master/src/nimeventer/nimforum.nim#L124 |
15:15:07 | FromDiscord | <TryAngle> @Yardanico how did you implement the profile picture changes of the discord bot? |
15:16:05 | FromDiscord | <Yardanico> In reply to @TryAngle "<@!177365113899057152> how did you": https://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L56 |
15:16:09 | FromDiscord | <Yardanico> Hash of the username |
15:16:37 | FromDiscord | <TryAngle> oh no, I mean on the discord side |
15:17:02 | FromDiscord | <TryAngle> I've looked through the code but I couldn't find it 🤔 ↵I think I'm overlooking idk |
15:18:05 | FromDiscord | <TryAngle> I mean where you tell the discord bot to use that picture |
15:19:30 | FromDiscord | <Yardanico> In reply to @TryAngle "I mean where you": Literally the line I sent you |
15:19:37 | FromDiscord | <Yardanico> I'm using webhooks to send messages |
15:19:44 | FromDiscord | <TryAngle> o_O |
15:19:46 | FromDiscord | <Yardanico> You can specify the avatar URL in a webhook |
15:20:10 | FromDiscord | <Yardanico> You can't send as different users with the normal bot API obviously |
15:20:14 | FromDiscord | <Yardanico> You need webhooks for that |
15:20:23 | FromDiscord | <TryAngle> ah now I understand |
15:20:57 | FromDiscord | <TryAngle> I do not know what webhooks are / they exist↵thought this was just a name you gave that "operation" |
15:21:01 | FromDiscord | <TryAngle> thanks! |
15:22:56 | FromDiscord | <TryAngle> (edit) "they exist↵thought" => "didn't know of their existance↵thought" |
15:30:30 | * | xet7 quit (Quit: Leaving) |
15:43:07 | * | snow joined #nim |
15:43:31 | * | snow is now known as Guest4484 |
15:44:01 | * | Guest4484 quit (Client Quit) |
15:52:39 | * | src_ joined #nim |
15:52:40 | * | src_ quit (Remote host closed the connection) |
15:55:32 | * | src quit (Ping timeout: 240 seconds) |
16:00:59 | FromDiscord | <konsumlamm> In reply to @Yardanico "PRs welcome": https://github.com/Yardanico/nimeventer/pull/3 :P |
16:10:07 | FromDiscord | <haxscramper> In reply to @NimEventer "New thread by Konsumlamm:": @konsumlamm the solution is to have a proper specification |
16:10:25 | FromDiscord | <haxscramper> Proper executable specification that people can referer to |
16:10:28 | FromDiscord | <haxscramper> (edit) "referer" => "refer" |
16:10:56 | FromDiscord | <haxscramper> And that is not written in the current compile test suite style |
16:11:27 | FromDiscord | <konsumlamm> executable as in "says how to implement it"? |
16:11:42 | FromDiscord | <haxscramper> executable as in tests that you can execute |
16:11:55 | FromDiscord | <haxscramper> and test suite that covers all possible loopholes and details |
16:12:15 | FromDiscord | <haxscramper> like damn, we started writing it for nimskull, and I got like five different bugs from closed as fixed issue |
16:12:21 | FromDiscord | <haxscramper> Simply by digging around |
16:12:31 | FromDiscord | <haxscramper> codegen bugs, sem bugs, outright compiler crashes |
16:12:44 | FromDiscord | <ajusa> In reply to @NimEventer "New thread by Konsumlamm:": I've only ran into a couple bugs during 4 years of using Nim for hobby and side projects. Unfortunately, none of those bugs have been fixed and I was forced to rely on workarounds. The Nim tracker is overflowing with nearly 2000 open issues. |
16:12:45 | FromDiscord | <haxscramper> I just sat down to write a spec |
16:13:53 | FromDiscord | <haxscramper> https://github.com/nim-works/nimskull/pull/59 |
16:15:32 | FromDiscord | <haxscramper> In reply to @ajusa "I've only ran into": - 2021: According to the votes, fixing compiler bugs should be our first priority: 55% of our users find it very important |
16:15:43 | FromDiscord | <konsumlamm> In reply to @haxscramper "<@!312654963694108674> the solution is": in general i'd agree |
16:16:05 | FromDiscord | <haxscramper> - 2019: fixing compiler bugs: According to the votes, this should be our first priority; 55% find it very |
16:16:28 | FromDiscord | <konsumlamm> In reply to @haxscramper "And that is not": what's the problem with the current style? |
16:16:59 | FromDiscord | <haxscramper> it is an assorted pile of random tests that is riddled with `echo` checks |
16:17:19 | FromDiscord | <haxscramper> it is not even possible to accurately accertain something is fixed correctly |
16:17:27 | FromDiscord | <haxscramper> tested correctly |
16:17:37 | FromDiscord | <ajusa> I don't know how to feel about Nimskull - on one hand I like the idea of the project and the spirit of modernizing some of the std library and compiler. On the other hand, the Nim community is too small to have a schism like this end well, and libraries published for Nimskull may not work for Nim, and vice versa. |
16:18:34 | FromDiscord | <haxscramper> https://github.com/nim-works/nimskull/issues/41 |
16:19:45 | FromDiscord | <haxscramper> people just come in, throw a couple of tests here and there and call it a day |
16:20:23 | FromDiscord | <haxscramper> and oh now, this `t239048` checks for some RWC thing that status had five years ago, we can't remove it |
16:20:33 | FromDiscord | <haxscramper> (edit) "now," => "no," |
16:21:50 | FromDiscord | <haxscramper> It is hardly possible to test for proper structured compiler diagnostics as well |
16:22:03 | FromDiscord | <haxscramper> Or rather, `nimout/errmsg` is an abysmal way of testing things like that |
16:24:48 | FromDiscord | <haxscramper> In reply to @ajusa "I don't know how": Sure, but I would prefer to work with even smaller set of people that value correctness and clear, laid out milestones that are necessary to achieve that |
16:25:30 | FromDiscord | <haxscramper> even if the correctness comes at a cost of incompatibilities |
16:26:25 | FromDiscord | <haxscramper> and by correctness I mean specifically - fully thought through suite of validations that describe interactions between different parts of the language |
16:31:45 | FromDiscord | <enthus1ast> can i set the gcsafe pragma also for stuff i call? |
16:31:57 | FromDiscord | <enthus1ast> i tried {.push gcsafe.} but it still complains |
16:32:43 | FromDiscord | <enthus1ast> i want to make sure it is gcsafe by useing locks |
16:32:57 | FromDiscord | <hmmm> I fail to see why good testing can't be done in nim directly, form a workgroup make a paper, get carte blanche from araq and then improve it inside nim |
16:33:04 | FromDiscord | <Rika> Isn’t it cast(gcsafe) if you want to fool the compiler |
16:33:17 | FromDiscord | <Rika> In reply to @hmmm "I fail to see": Guess the bottleneck |
16:33:56 | FromDiscord | <hmmm> there isnt 🤨 |
16:34:42 | FromDiscord | <enthus1ast> yes that works, thanks @Rika |
16:35:16 | FromDiscord | <konsumlamm> In reply to @hmmm "I fail to see": afaiu the problem is that the whole test suite would need to be revamped from the ground up |
16:36:16 | FromDiscord | <haxscramper> Current compiler codebase also drags down development |
16:37:01 | FromDiscord | <haxscramper> In reply to @hmmm "I fail to see": > , get carte blanche from araq ↵Like that would ever happen |
16:37:21 | FromDiscord | <haxscramper> And we either end up with mountains of `knownIssue` things |
16:37:39 | FromDiscord | <haxscramper> or we have that crooked spec a-la C++ where things are hacked in because of RWC |
16:38:13 | FromDiscord | <haxscramper> for example, correct spec does require (at least if you want to preserve maintainer's sanity) a structured report refactor |
16:38:26 | FromDiscord | <haxscramper> This is a whole-compiler refactor, by definitino |
16:38:29 | FromDiscord | <haxscramper> (edit) "definitino" => "definitipm" |
16:38:31 | FromDiscord | <haxscramper> (edit) "definitipm" => "definition" |
16:39:18 | FromDiscord | <haxscramper> How many monts will it take before we agree that https://github.com/nim-lang/RFCs/issues/324 and "json is not suitable" need to be revived |
16:39:24 | FromDiscord | <haxscramper> (edit) "monts" => "months" |
16:39:55 | FromDiscord | <haxscramper> In reply to @haxscramper "This is a **whole-compiler**": https://github.com/nim-works/nimskull/pull/94 |
16:41:01 | FromDiscord | <konsumlamm> what does RWC mean? |
16:41:11 | FromDiscord | <haxscramper> "Real World Code (TM)" |
16:41:16 | FromDiscord | <hmmm> well if it can be done without hurting or slowing araq work on features he will give you the keys of the empire, otherwise yea you can do it outside nim but is there even a way to bring home the good stuff back? |
16:41:29 | FromDiscord | <haxscramper> aka "it breaks important packages therefore it is incorrect nim" |
16:41:52 | FromDiscord | <haxscramper> or we have compiler devs PR fixes to external packages to fix them |
16:43:51 | FromDiscord | <haxscramper> In reply to @hmmm "well if it can": Specification is written explicitly to be abstracted from shortcomings of a particular implementation https://github.com/nim-works/nimskull/pull/125/files#diff-6af95d23509b3d3e819c6dd6d422298d829cfd94023e753b4c95f9bbf43f235bR152-R155 |
16:44:35 | FromDiscord | <haxscramper> Of course, when I implement structured reports it would no longer be fully portable |
16:45:35 | FromDiscord | <Rika> In reply to @hmmm "well if it can": that is up to araq and co |
16:46:14 | FromDiscord | <haxscramper> There is a question of |
16:46:16 | FromDiscord | <Rika> changes can prolly be upstreamed if they want it to |
16:46:42 | FromDiscord | <haxscramper> why so many people decided it is better for them to do a hard fork instead of trying to reason with mainline |
16:46:50 | FromDiscord | <haxscramper> but I probably should leave this out of the discussion |
16:49:20 | FromDiscord | <Solitude> In reply to @haxscramper "why so many people": d word |
16:50:12 | FromDiscord | <Rika> 8 bytes? |
16:50:46 | FromDiscord | <konsumlamm> D lang? |
16:50:59 | FromDiscord | <Rika> sorry that was a bad joke and i think i got it wrong also |
16:51:07 | FromDiscord | <Rika> prolly shoulda said 16 bytes |
16:51:13 | FromDiscord | <Rika> i dont remember anymore really |
16:51:16 | FromDiscord | <haxscramper> According to the urban dictionary I should be offended |
16:51:16 | FromDiscord | <konsumlamm> you got it right for 32 bit architectures |
16:51:17 | FromDiscord | <haxscramper> I think |
16:51:24 | FromDiscord | <haxscramper> Not sure though |
16:51:26 | FromDiscord | <Rika> In reply to @konsumlamm "you got it right": good enough |
16:51:52 | FromDiscord | <konsumlamm> though i think intel also uses word to mean 32 bit regardless of the arch? |
16:52:00 | FromDiscord | <Rika> huh |
16:52:05 | * | src joined #nim |
16:52:13 | FromDiscord | <Rika> maybe thats what i remember |
16:52:32 | FromDiscord | <Solitude> discussion = derailed |
16:53:44 | FromDiscord | <enthus1ast> int32 is superior to dword, no questions left |
16:53:44 | FromDiscord | <Rika> thats two d words |
16:53:59 | FromDiscord | <konsumlamm> ah no, it's 16 bits |
16:54:21 | FromDiscord | <Rika> maybe its windows that dword = 32b |
16:54:44 | FromDiscord | <enthus1ast> i always have to google \:D |
17:13:49 | FromDiscord | <VVX7> can someone remind me how to get nimsuggest working in vscode on windows? the update to 1.6.2 seems to have broken it |
17:19:31 | FromDiscord | <VVX7> using nim-saem. saw this https://github.com/saem/vscode-nim#code-completion already |
17:20:09 | FromDiscord | <dom96> did something change with how procs that have a typed pragma macros applied are evaluated in 1.4.0 and 1.6.0? |
17:22:31 | ozzz | Hi! strange stuff here. I enabled libsanitizer - thread one (in linux), and found that it hangs if I use lock for digit increments, or printing to the std out |
17:25:23 | ozzz | what it may be? or acquiring and releasing locks should be done differently? binary crashes with err ../nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed. |
17:52:27 | NimEventer | New post on r/nim by Pcarbonn: Building a simple room-based chat application in Nim (using HTMX), see https://reddit.com/r/nim/comments/rjcn9s/building_a_simple_roombased_chat_application_in/ |
18:07:32 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3IMk |
18:09:13 | FromDiscord | <TryAngle> I know nim is generally more open when it comes to conventions like this but what would be used if it was in the compiler? |
18:09:21 | FromDiscord | <TryAngle> (edit) "I know nim is generally more open when it comes to conventions like this ... but" added "by design" |
18:09:38 | FromDiscord | <TryAngle> or is this more context dependent? |
18:12:46 | FromDiscord | <IsaacPaul> > what would be used if it was in the compiler?↵btrees.nim makes use of the #1 |
18:13:14 | FromDiscord | <IsaacPaul> ccgexprs uses #2 |
18:13:21 | FromDiscord | <konsumlamm> In reply to @TryAngle "I know nim is": it really depends on who would write that compiler code |
18:13:40 | FromDiscord | <konsumlamm> there is no consent |
18:14:08 | FromDiscord | <IsaacPaul> (edit) "ccgexprs" => "ccgexprs.nim" | "#2" => "#2↵and ropes.nim uses #3" |
18:14:11 | FromDiscord | <TryAngle> ok that is indeed very open by design then 😂 ↵thanks |
18:15:22 | FromDiscord | <IsaacPaul> I prefer #3 as I've never seen inc in any other language that I've worked in |
18:15:39 | FromDiscord | <IsaacPaul> but its not big deal either way |
18:15:45 | FromDiscord | <IsaacPaul> (edit) "not" => "no" |
18:17:04 | FromDiscord | <el__maco> inc is from Pascal isn't it |
18:23:55 | FromDiscord | <Rika> i use 1 and 3 depending on my mood xddddddd |
18:26:46 | FromDiscord | <Hamid_Bluri> i prefre `a.inc b` |
18:26:51 | FromDiscord | <Hamid_Bluri> (edit) "prefre" => "prefer" |
18:28:18 | FromDiscord | <Hamid_Bluri> i do whatever i can yo avoid parentheses |
18:29:23 | FromDiscord | <Recruit_main707> In reply to @hamidb80 "i prefer `a.inc b`": i also do a.inc b |
18:29:34 | FromDiscord | <TryAngle> In reply to @hamidb80 "i prefer `a.inc b`": ah true I forgot about that 😬 |
18:30:49 | FromDiscord | <Solitude> zamn, people use `inc` with >1 increments? |
18:32:02 | FromDiscord | <Hamid_Bluri> with what? |
18:32:30 | FromDiscord | <TryAngle> In reply to @Solitude "zamn, people use `inc`": that was what I was wondering XD↵I'm using inc only for += 1 ↵but I just "discovered" that it can also be used for any number and 1 is just the default lol |
18:32:52 | FromDiscord | <Hamid_Bluri> there is also `dec` for `-=` |
18:33:17 | FromDiscord | <hmmm> In reply to @hamidb80 "i prefer `a.inc b`": I think b doesn't feel respected when you do that so I don't do that 🤨 |
19:12:17 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
19:14:24 | * | yann-kaelig joined #nim |
19:15:06 | yann-kaelig | Hello |
19:21:51 | yann-kaelig | I got as a 200% programming beginner a great idea because I was hesitating in the langauge to learn between C++ and Nim. I'm going to learn both and compare them is all aspect, from their installation, through setting up a workflow, to their documentation, courses and writing the code from scratch. |
19:23:40 | FromDiscord | <sheerluck> In reply to @yann-kaelig "I got as a": also learn Python3 and compare all 3 of them |
19:25:03 | yann-kaelig | Thx for the proposal but I was not attracted by python |
19:34:10 | yann-kaelig | I have pedagogical skills that I acquired in school put into practice as a musical teacher which could be useful for Nim language beginners, I will see |
19:38:22 | yann-kaelig | I am going to have questions and to start with the 'nim-basics' documentation I already have a first question. Even before writing a 'Hello world' what is a valid Nim program that does nothing which match a C++ code like "int main() { // Write your code here } ? |
19:39:33 | FromDiscord | <el__maco> empty document? |
19:41:03 | FromDiscord | <el__maco> Nim code doesn't have to exist inside a function like C does, so I think you don't need any boilerplate at all |
19:51:46 | * | xet7 joined #nim |
19:55:17 | * | xet7 quit (Remote host closed the connection) |
19:55:39 | * | xet7 joined #nim |
20:28:16 | yann-kaelig | Can I really said that a program does nothing if the code source is only a single-line comments ? In my point of view the program does something but print nothing. What happening behind the scene in this case ? Also I can not find the explanation of the compilation output https://dpaste.com/76R2FLS2Q starting from CC line to the end. |
20:29:35 | yann-kaelig | The program runs, but print nothing, how can I debug this software and see what's going on in this case |
20:32:57 | FromDiscord | <Yardanico> CC is when the C compiler is compiling the C code that was compiled by the Nim compiler from the Nim code :) |
20:33:03 | FromDiscord | <Yardanico> also not sure what you mean about debug |
20:33:09 | FromDiscord | <Yardanico> it's an empty program, there's nothing to debug |
20:35:28 | yann-kaelig | Yardanico: I don't understand, how the progrma can be empty if I put in it a line which is in this case a comment ? |
20:35:46 | FromDiscord | <Yardanico> a comment does not affect the program's runtime |
20:35:50 | FromDiscord | <Yardanico> it's simply a hint for the programmer |
20:35:57 | FromDiscord | <Yardanico> the compiler just discards it as useless information |
20:36:17 | FromDiscord | <Yardanico> unless you use doc comments, those are saved by the compiler for documenting stuff, but they still don't change the result of compilation |
20:38:38 | yann-kaelig | Yardanico: https://nim-lang.org/docs/docgen.html ? |
20:39:03 | yann-kaelig | You'r talkign about that |
20:40:09 | FromDiscord | <Yardanico> yes, nim has a doc generator, `nim doc`, but I don't think we should really discuss comments regarding empty programs :) |
20:41:04 | * | noeontheend joined #nim |
20:55:16 | FromDiscord | <TryAngle> what are new-style concepts? |
20:56:00 | FromDiscord | <Yardanico> https://github.com/nim-lang/RFCs/issues/168 |
20:57:49 | FromDiscord | <TryAngle> ah with that they look almost identical to Rust traits, interesting |
20:58:26 | FromDiscord | <Yardanico> In reply to @TryAngle "ah with that they": still different though :) |
20:58:33 | FromDiscord | <Yardanico> if you want something similar there's https://github.com/yglukhov/iface |
20:58:37 | FromDiscord | <Yardanico> concepts are a compile time thing only |
20:59:12 | FromDiscord | <TryAngle> what are the differences exactly?↵The nim concepts look a bit more flexible 🤔 |
20:59:13 | FromDiscord | <gandalfs_socks> anybody know if there's a nice way to create an ebook in nim like I would with r and plotly? |
20:59:20 | FromDiscord | <Yardanico> In reply to @TryAngle "what are the differences": Nim concepts are a compile time only thing |
20:59:20 | FromDiscord | <TryAngle> (edit) "exactly?↵The" => "for example?↵The" |
20:59:27 | FromDiscord | <Yardanico> Rust traits are like interfaces |
20:59:41 | yann-kaelig | I don't understand what's going on. the first time I compiled my doesnothing.nim program I got 4 CC: output ( my dpaste ), I removed the executable and build the source code a second time, but this time the CC: doesnothing.nim line disappeared and a third time compilation all of the CC: disappeared |
20:59:43 | FromDiscord | <TryAngle> ah I see while rust traits can be used for "dyn" |
21:00:22 | FromDiscord | <Yardanico> In reply to @yann-kaelig "I don't understand what's": Because Nim keeps a cache of compiled C code |
21:00:28 | FromDiscord | <Yardanico> so it doesn't have to fully recompile the C parts each time |
21:00:53 | FromDiscord | <Recruit_main707> and if the file doesnt change it doesnt recompile either (?) afaik |
21:01:31 | FromDiscord | <Yardanico> not really |
21:01:42 | FromDiscord | <Yardanico> nim always does the Nim compilation part |
21:02:29 | FromDiscord | <Recruit_main707> but not the c part right? |
21:04:22 | FromDiscord | <el__maco> apparently yes. If the intermediate c file did not change, the c compiler is not invoked again |
21:04:38 | FromDiscord | <Yardanico> In reply to @Recruit_main707 "but not the c": yes |
21:07:08 | * | neurocyte0132889 joined #nim |
21:07:08 | * | neurocyte0132889 quit (Changing host) |
21:07:08 | * | neurocyte0132889 joined #nim |
21:07:53 | FromDiscord | <TryAngle> sent a long message, see http://ix.io/3IN7 |
21:09:56 | FromDiscord | <TryAngle> i'm getting suprised day by day by these little features |
21:13:38 | yann-kaelig | Yardanico: Well, I can have something stupid questions like a noob, you saying that Nim compiler "convert/translate/?" nim code to C code then the C compiler compile this C code. Can I see this intermediate code somewhere or it's useless ? |
21:14:03 | FromDiscord | <Yardanico> you can, by default it's stored in the cache folder specific to your user and OS, but you can instruct the nim compiler to save it somewhere you want |
21:14:05 | FromDiscord | <Yardanico> with `--nimcache:folder` |
21:14:19 | FromDiscord | <Yardanico> but just be advised, that code isn't really supposed to be very human readable, especially for beginners |
21:14:46 | FromDiscord | <Yardanico> you almost never need to look at it, maybe only if you use Nim and want to debug some compiler issue that involves the backend (the part that compiles Nim code to C) |
21:15:05 | FromDiscord | <Yardanico> (edit) "backend" => "codegen" |
21:16:25 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3IN9 |
21:16:46 | FromDiscord | <TryAngle> (let's ignore the practicality) |
21:17:17 | * | noeontheend quit (Ping timeout: 240 seconds) |
21:17:41 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3IN9" => "https://play.nim-lang.org/#ix=3INa" |
21:21:51 | * | xet7 quit (Remote host closed the connection) |
21:25:36 | * | xet7 joined #nim |
21:35:27 | FromDiscord | <TryAngle> in VSC in a new project nim suddeny uses 2 spaces instead of 4↵how do I set it to 4 (VSC uses 4 on User, Remote and Workspace)? |
21:35:39 | FromDiscord | <konsumlamm> In reply to @TryAngle "so something like this:": that would work |
21:36:10 | FromDiscord | <Solitude> !eval import macros; dumpTree: let poly = 1.x1² + 1.x2² - 4 |
21:36:10 | NimBot | Compile failed: <no output> |
21:37:03 | FromDiscord | <Solitude> `Ident "x2²"` |
21:37:17 | * | xet7 quit (Remote host closed the connection) |
21:37:36 | FromDiscord | <Solitude> `²` is part of the identifier, not an operator |
21:38:03 | FromDiscord | <Solitude> !eval import macros; dumpTree: (let poly = 1.x1² + 1.x2² - 4) |
21:38:03 | NimBot | Compile failed: <no output> |
21:38:23 | FromDiscord | <Solitude> nvm, its compiler output... |
21:38:55 | FromDiscord | <TryAngle> In reply to @Solitude "`²` is part of": that was the idea 🤔 ↵you can't just add x^2 with x anyways |
21:38:57 | yann-kaelig | well, so looking inside my .cache/nim/doesnothing_d/ folder I can see three differents type of files: '.c' which is pretty clear to understand thanks to the comments. a type '.c.o' No idea what's this file, and a '.json' which look like a log of the compilation with some info ( Is this file used somewhere ? can I use/parse this file to output some values somewhere else ? ) And finally from where all the |
21:38:58 | yann-kaelig | se std libs comes from, generated/downloaded/... by whom ? |
21:40:05 | FromDiscord | <Yardanico> In reply to @yann-kaelig "well, so looking inside": your message got cut off |
21:40:11 | FromDiscord | <Yardanico> .c.o is the compiled .c files |
21:40:14 | FromDiscord | <Yardanico> they're object files |
21:40:26 | FromDiscord | <Yardanico> the stdlib is written in Nim, it comes preinstalled with your Nim installation |
21:40:43 | FromDiscord | <Yardanico> https://nim-lang.org/docs/lib.html |
21:42:56 | FromDiscord | <qb> any fancy idea to parse any type string to a type? eg.: "int32" -> int32 - Not a huge fan of having a case there for all types |
21:43:15 | FromDiscord | <qb> (edit) "case" => "`case`" |
21:44:19 | * | xet7 joined #nim |
21:45:14 | yann-kaelig | Yardanico: and what about the .json file, sry if I'm asking again about it |
21:45:31 | FromDiscord | <Yardanico> it's just a description of the commands Nim used to compile the C files |
21:45:43 | FromDiscord | <Yardanico> In reply to @qb "any fancy idea to": you mean at compile time? |
21:45:54 | FromDiscord | <qb> At runtime |
21:46:02 | FromDiscord | <Solitude> lol |
21:46:27 | FromDiscord | <Solitude> any snippets? |
21:47:26 | FromDiscord | <Yardanico> In reply to @qb "At runtime": I don't think you can simplify it really |
21:47:36 | FromDiscord | <Yardanico> you can make it "look" simpler by moving the complexity elsewhere |
21:47:41 | FromDiscord | <Yardanico> like making a template or a macro |
21:47:46 | FromDiscord | <Yardanico> but that doesn't make it simpler |
21:57:16 | * | mal`` quit (Quit: Leaving) |
21:58:26 | FromDiscord | <qb> alright |
22:10:14 | FromDiscord | <Elegantbeef> @qb\: what're the types though, is it any type or just integers? |
22:11:05 | * | mal`` joined #nim |
22:12:32 | FromDiscord | <Elegantbeef> Regardless there will be a case statement, i'm just interested 😀 |
22:12:37 | yann-kaelig | All of this is very interesting even if I have a lot of things to learn, among other things the config files and I found a documentation about nim's memory management which is at high level for now for me. Really, thank you very much Yardanico for your help, finally I spent all the time on nim, that a good sign :) |
22:12:49 | FromDiscord | <qb> um any I guess. Why does that actually return a `void`? https://play.nim-lang.org/#ix=3INl |
22:15:17 | FromDiscord | <Elegantbeef> This wont work as you expect anyway |
22:15:42 | FromDiscord | <Elegantbeef> But `typedesc` as a return type defaults to void it seems |
22:16:46 | FromDiscord | <Elegantbeef> Also you know `int` and `uint` are platform specific? |
22:17:35 | FromDiscord | <Elegantbeef> And `float` is 64bit regardless |
22:18:52 | FromDiscord | <qb> In reply to @Elegantbeef "Also you know `int`": You mean the bytesize of 4 or 8 bytes on x86/x64? If so yes |
22:19:19 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3INp something like this will be what you want i think |
22:19:35 | FromDiscord | <Elegantbeef> typedesc is a compile time only thing |
22:19:48 | FromDiscord | <Elegantbeef> You cannot use it at runtime like you wanted |
22:20:04 | FromDiscord | <qb> Oh okay. Thank you |
22:20:54 | FromDiscord | <Elegantbeef> Depending on what you're doing you may need an object variant |
22:21:04 | FromDiscord | <Elegantbeef> Either way case statement galore 😛 |
22:34:09 | * | yann-kaelig left #nim (#nim) |
22:43:20 | NimEventer | New Nimble package! wavecore - Client and server database and networking utils, see https://github.com/ansiwave/wavecore |
23:09:48 | FromDiscord | <TryAngle> how would I implement a concept that abstracts over multiple Operators? |
23:14:07 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/80g |
23:14:18 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3INE" => "https://play.nim-lang.org/#ix=3IND" |
23:17:16 | * | Guest2 joined #nim |
23:17:55 | Guest2 | I just intalled 1.6.0 and csfml stopped working |
23:18:19 | Guest2 | 1.6.2 |
23:18:30 | Guest2 | SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
23:18:41 | Guest2 | someone knows why this could be? |
23:19:41 | Guest2 | csfml links to dlls and I think there is a problem trying to load them |
23:23:13 | NimEventer | New thread by BarrOff25: Check nim compiler version during compilation, see https://forum.nim-lang.org/t/8724 |
23:43:59 | FromDiscord | <theangryepicbanana> In reply to @TryAngle "this is what I": `[Add]` declares `Add` as a new type variable, you should try doing `proc operate[T: Add](x, y: T): T = ...` |
23:44:38 | FromDiscord | <theangryepicbanana> (alternatively, you could just do `proc operate(x, y: Add): Add = ...` and you'll get the same effect) |
23:45:44 | * | xet7 quit (Quit: Leaving) |
23:46:27 | * | xet7 joined #nim |
23:50:11 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3INL |
23:50:36 | FromDiscord | <theangryepicbanana> In reply to @TryAngle "thanks, sadly I'm getting": yeah that's because `int` supports `+` and `` |
23:50:48 | FromDiscord | <TryAngle> (edit) "https://play.nim-lang.org/#ix=3INL" => "https://play.nim-lang.org/#ix=3INM" |
23:51:28 | FromDiscord | <TryAngle> what would be the way to keep using int but restrict the operation to only one? |
23:51:40 | FromDiscord | <theangryepicbanana> you could use a distinct type |
23:52:41 | FromDiscord | <theangryepicbanana> sent a code paste, see https://play.nim-lang.org/#ix=3INN |
23:53:53 | FromDiscord | <TryAngle> the issue I'd have then is being restricted to int.↵What I'd like to accomplish is algebra over any type and operator 🤔 |
23:54:17 | FromDiscord | <theangryepicbanana> well you need some way to distinguish which operator you want to use |