00:01:42 | FromDiscord | <Anuke> I have a `type` composed of 4 `unit8`s, and I would like to to take up exactly 4 bytes in memory and be cast-able into an int32/float32. Questions:↵1. Is it guaranteed to take up exactly 4 bytes?↵2. Are the fields guaranteed to be in order, e.g. with offsets of 0/1/2/3 bytes? They are on my machine, but I need to be sure it still works that way on others.↵3. Do I need to use the `{.packed.}` pragma here at all? |
00:01:49 | ForumUpdaterBot | New question by Alex Craft: How to avoid modifying function with macros pragma?, see https://stackoverflow.com/questions/67275225/how-to-avoid-modifying-function-with-macros-pragma |
00:03:07 | FromDiscord | <ElegantBeef> @Anuke you can do `type TypeName {.size:4.}` to make sure it takes up 4 bytes, which i imagine should disable alignment and similar optimizations |
00:03:40 | FromDiscord | <ElegantBeef> Alternatively you can do `type Typename = array[4, byte]` 😄 |
00:04:54 | FromDiscord | <Anuke> Is the size pragma documented somewhere? I don't see it in the manual |
00:06:10 | FromDiscord | <ElegantBeef> Doesnt seem like it's explicitly documented, just used in enum examples |
00:08:33 | FromDiscord | <demotomohiro> In reply to @exelotl "yeah I'm working under": It seems defer can be used with --gc:none --os:standalone↵https://wandbox.org/permlink/wLUmfAWB7mUWfnKh |
00:09:32 | FromDiscord | <exelotl> oh! this changes everything 👀 |
00:10:09 | FromDiscord | <exelotl> imma have to advocate for defer now (previously I didn't care about it) xD |
00:24:53 | ForumUpdaterBot | New thread by Spip: [ANN] Nim0, a playground to learn compiler internals, see https://forum.nim-lang.org/t/7866 |
00:52:45 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:53:04 | * | njoseph joined #nim |
00:56:43 | * | Tanger joined #nim |
01:06:48 | * | Tlangir joined #nim |
01:09:25 | * | Tanger quit (Ping timeout: 252 seconds) |
01:11:57 | * | abm quit (Read error: Connection reset by peer) |
01:49:54 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
01:50:21 | * | johnnynitwits joined #nim |
01:53:29 | * | johnnynitwits quit (Client Quit) |
01:53:53 | * | johnnynitwits joined #nim |
02:00:49 | * | MTRNord quit (Ping timeout: 245 seconds) |
02:01:03 | * | MTRNord joined #nim |
02:18:14 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
02:18:49 | * | johnnynitwits joined #nim |
02:25:37 | * | wasted_youth2 joined #nim |
02:26:13 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
02:26:36 | * | johnnynitwits joined #nim |
02:30:30 | * | teal joined #nim |
02:32:02 | * | teal quit (Client Quit) |
02:35:52 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
02:36:16 | * | johnnynitwits joined #nim |
02:37:17 | * | johnnynitwits quit (Client Quit) |
02:38:15 | * | johnnynitwits joined #nim |
02:43:17 | * | wasted_youth2 quit (Ping timeout: 250 seconds) |
02:44:09 | * | wasted_youth2 joined #nim |
02:45:33 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
02:46:10 | * | johnnynitwits joined #nim |
02:46:18 | * | johnnynitwits quit (Client Quit) |
02:46:46 | * | johnnynitwits joined #nim |
02:46:54 | * | Tlangir quit (Remote host closed the connection) |
02:47:16 | * | Tlangir joined #nim |
02:49:47 | * | D_ quit (Ping timeout: 250 seconds) |
02:51:21 | * | D_ joined #nim |
02:55:53 | * | thomasross quit (Ping timeout: 240 seconds) |
03:18:59 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
03:19:22 | * | johnnynitwits joined #nim |
03:25:35 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
03:26:06 | * | johnnynitwits joined #nim |
03:53:30 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
03:53:54 | * | spiderstew_ joined #nim |
03:53:55 | * | johnnynitwits joined #nim |
03:54:59 | * | spiderstew quit (Ping timeout: 245 seconds) |
03:58:27 | * | johnnynitwits quit (Client Quit) |
03:58:52 | * | johnnynitwits joined #nim |
04:22:19 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
04:22:52 | * | johnnynitwits joined #nim |
04:22:55 | * | johnnynitwits quit (Excess Flood) |
04:23:06 | * | johnnynitwits joined #nim |
04:29:01 | * | narimiran joined #nim |
04:30:23 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
04:31:04 | * | johnnynitwits joined #nim |
04:38:24 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
04:38:51 | * | johnnynitwits joined #nim |
05:02:29 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
05:03:03 | * | johnnynitwits joined #nim |
05:15:55 | * | rockcavera quit (Remote host closed the connection) |
05:41:40 | FromDiscord | <Varriount> @c-blake Could you merge these comments please? https://github.com/nim-lang/RFCs/issues/267#issuecomment-825584327 |
06:12:39 | ForumUpdaterBot | New Nimble package! nmark - fast markdown parser, see https://github.com/kyoheiu/nmark |
06:17:09 | FromDiscord | <ElegantBeef> Shame yet another pushed binary 😄 |
06:17:41 | FromDiscord | <ElegantBeef> If i say kyoheiu 3 times it summons them and i can point out they pushed a binary right? |
06:22:51 | * | D_ quit (Remote host closed the connection) |
06:23:46 | * | D_ joined #nim |
06:25:19 | * | johannes_ joined #nim |
06:26:44 | * | arecaceae quit (Remote host closed the connection) |
06:27:03 | * | arecaceae joined #nim |
07:15:23 | * | grimler32 quit (Ping timeout: 265 seconds) |
07:29:17 | * | casaca quit (Ping timeout: 246 seconds) |
07:30:07 | * | casaca joined #nim |
07:39:25 | euantorano | Araq: is your builds.sr.ht account a paid account or a free one? As of May 1st, it has to be paid to use builds: https://drewdevault.com/2021/04/26/Cryptocurrency-is-a-disaster.html |
07:40:53 | euantorano | If it’s free, I am happy to send you the money needed for a year’s paid access, just contact me. We need to decide if we are sticking with it or if it’s worth looking at self hosted CI for the BSDs or an alternative option altogether - BuildKite is self hosted and free for open source so might be worth checking out. |
07:49:24 | * | PMunch joined #nim |
07:52:59 | Clonkk[m] | Is there a way to forward varargs when you use the conversion syntax ? |
08:14:45 | * | sz0 joined #nim |
08:40:46 | FromGitter | <yglukhov> Hey guys. Can anyone explain how my 3 months old pr (#16695) haven't got into release yet? |
08:43:15 | FromDiscord | <flywind> you need to label it as backport: 1.4 to get it to release |
08:43:41 | * | Jesin quit (Ping timeout: 240 seconds) |
08:44:17 | FromDiscord | <flywind> it has been documented, see https://nim-lang.github.io/Nim/contributing.html#the-cmdgit-stuff-general-commit-rules |
08:44:28 | giaco | is it possible to write testcases in separate files on procs without exporting them? |
08:45:19 | FromDiscord | <flywind> use devel then `import someUnexportModule {.all.}` + importutils module |
08:45:28 | FromDiscord | <flywind> use stable just use `include` |
08:49:09 | giaco | cool! thanks |
08:50:09 | FromGitter | <yglukhov> flywind: I see, thanks. How do I backport an already merged commit then? |
08:50:31 | giaco | as I need to revert back from using import on all my tests, I now face the problem to detect which exports are actually unused outside the module. Can Nim help me on this task? |
08:51:12 | FromDiscord | <flywind> You can leave a comment and @narimiran |
08:52:14 | narimiran | @yglukhov there was no new major release since then |
08:52:58 | FromGitter | <yglukhov> narimiran: Right. I wanted it to get into 1.4 though. |
08:53:13 | FromGitter | <yglukhov> can you backport it please? |
08:53:41 | narimiran | ok |
08:53:53 | FromGitter | <yglukhov> thanks! |
08:55:19 | FromGitter | <yglukhov> and #16696 too please. Both prs address kinda similar stuff. |
08:58:17 | * | jess joined #nim |
09:01:17 | * | vicfred quit (Quit: Leaving) |
09:18:54 | giaco | I've changed my "import" into "include" statements in my test*.nim files, and not it fails to compile with weird errors on "doAssert" like: Error: type mismatch: got <Payload, Payload>, but expected one of: proc `==`[T: tuple | object](x, y: T): bool, first type mismatch at position: 2, required type for y: T: tuple or object but expression 'Payload(<omissis>)' is of type: Payload. Payload is "type |
09:18:56 | giaco | Payload = object" |
09:19:11 | giaco | s/not/now |
09:20:18 | FromDiscord | <flywind> what's your include statement like? |
09:20:47 | giaco | include libfoo, libbar |
09:23:08 | giaco | if I switch back to import it compiles and runs successfully |
09:29:01 | * | clyybber joined #nim |
09:39:46 | giaco | :-/ |
09:55:11 | giaco | what do you read from that error line? I see nonsense |
10:00:37 | ForumUpdaterBot | New thread by Drkameleon: Generate JsObject for use in JavaScript, see https://forum.nim-lang.org/t/7868 |
10:03:32 | giaco | I've switch back to import as include raises problem I don't understand |
10:06:29 | * | xace quit (Ping timeout: 265 seconds) |
10:07:56 | * | xace joined #nim |
10:31:01 | FromDiscord | <carpal> hello, when the nim's compiler is walking the ast to resolve all types does it also resolve references to functions? |
10:32:21 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=3ffk |
10:32:25 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=3ffk" => "https://paste.rs/7r0" |
10:32:41 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=3ffn" => "https://paste.rs/A78" |
10:32:51 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=3ffp" => "https://play.nim-lang.org/#ix=3ffm" |
10:32:53 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=3ffm" => "https://paste.rs/ZWK" |
10:33:18 | FromDiscord | <carpal> or it is resolved nexlty? |
10:33:21 | FromDiscord | <carpal> (edit) "https://paste.rs/tkZ" => "https://paste.rs/24Y" |
10:33:28 | FromDiscord | <carpal> once the ast is typed |
10:36:16 | FromDiscord | <haxscramper> The compiler resolves all identifiers as it goes over AST, otherwise it would not be possible to type of `add`'s return value (if there were any) |
10:36:48 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/2ff517462bf8609b30e6134c96658aa7912b628a/compiler/semcall.nim#L566 |
10:37:48 | FromDiscord | <haxscramper> https://media.discordapp.net/attachments/371759389889003532/836551698540396544/unknown.png |
10:38:20 | FromDiscord | <haxscramper> All `sem` functions call each other, including overload call resolution |
10:40:18 | * | Jesin joined #nim |
10:48:13 | FromDiscord | <mlokis> sent a code paste, see https://paste.rs/Wp4 |
10:48:40 | FromDiscord | <mlokis> its macro output btw |
10:49:20 | FromDiscord | <haxscramper> yes |
10:49:34 | FromDiscord | <haxscramper> Run with `expandMacros` to see after-semcheck AST |
10:49:47 | FromDiscord | <haxscramper> https://wandbox.org/permlink/RGS7aqpk96DBANEu |
10:52:20 | FromDiscord | <haxscramper> Though if you add runtime variable you need to wrap constant parts in `()` to fold constants |
10:52:28 | FromDiscord | <haxscramper> Otherwise it does not work that good |
10:52:43 | FromDiscord | <mlokis> sent a code paste, see https://play.nim-lang.org/#ix=3fik |
10:53:33 | FromDiscord | <mlokis> still better the nothing, i thought i qould have to optimize it manually |
10:53:42 | FromDiscord | <mlokis> (edit) "qould" => "would" |
10:54:05 | FromDiscord | <mlokis> (edit) "manually" => "myself" |
10:55:13 | FromDiscord | <flywind> it is high optimized by compiler(a preallocated string and append operations) |
10:55:26 | FromDiscord | <haxscramper> I would probably suggest to not rely on compiler optimizations and instead provide more optimal code |
10:56:12 | FromDiscord | <flywind> sent a code paste, see https://paste.rs/AfF |
10:56:29 | FromDiscord | <flywind> see `genStrConcat` |
10:57:06 | FromDiscord | <flywind> while `strformat` should optimize a bit more for int/float. |
10:57:22 | FromDiscord | <flywind> (edit) "optimize" => "have optimization" |
10:57:34 | * | FromDiscord quit (Remote host closed the connection) |
10:57:50 | * | FromDiscord joined #nim |
10:58:48 | FromDiscord | <haxscramper> so `'a' & 'b' & 'c'` might cause three function calls instead of `"abc"` being appended at once? |
11:01:02 | ForumUpdaterBot | New Nimble package! hottext - Rapid serial text presenter, see https://git.sr.ht/~ehmry/hottext |
11:02:16 | * | teasea quit (Quit: teasea) |
11:02:35 | FromDiscord | <flywind> string literals should be optimized I guess |
11:02:37 | * | teasea joined #nim |
11:02:58 | FromDiscord | <mlokis> sent a code paste, see https://paste.rs/C79 |
11:03:01 | * | sagax joined #nim |
11:03:56 | FromDiscord | <mlokis> macro took 120 lines of code |
11:04:32 | FromDiscord | <mlokis> it is messy as f |
11:12:32 | FromDiscord | <carpal> In reply to @haxscramper "The compiler resolves all": but function identifiers require types to be resolved, with function overloading add(int, int) if different from add(int, int8) |
11:13:02 | FromDiscord | <d4rckh> if i have a long if statement with a bunch of or's and and's how do i go about splitting it on a new line? |
11:13:29 | FromDiscord | <carpal> so to resolve the identifier add(1, 2) the compiler needs to kwow the types of 1 and 2, to do this the compiler needs to evaluate the expressions but at this point isn't a mess to mix all in the same phase? |
11:14:20 | FromDiscord | <carpal> In reply to @mlokis "anyway i just finished": cool |
11:15:21 | FromDiscord | <carpal> In reply to @carpal "so to resolve the": or maybe the compiler could resolve the identifier by replacing the identifier add with the overloads of add |
11:15:59 | FromDiscord | <carpal> and then in another phase the compiler will evaluate the parameter expressions to find the rightoverload |
11:16:02 | FromDiscord | <carpal> (edit) "rightoverload" => "right overload" |
11:16:07 | FromDiscord | <carpal> right? |
11:21:08 | FromDiscord | <haxscramper> In reply to @carpal "so to resolve the": It does not need to "evaluate" an expression, it must only resolve it's type |
11:21:14 | FromDiscord | <haxscramper> And that's exactly what compiler does |
11:25:46 | FromDiscord | <d4rckh> any reason i cant call replace here? https://media.discordapp.net/attachments/371759389889003532/836563767428120596/unknown.png |
11:26:53 | FromDiscord | <flywind> do you import `strutils`? |
11:27:08 | FromDiscord | <d4rckh> oh |
11:27:18 | FromDiscord | <d4rckh> looks like i forgot about it |
11:27:19 | FromDiscord | <d4rckh> thank you |
11:27:29 | FromDiscord | <flywind> np |
11:31:43 | FromDiscord | <carpal> In reply to @haxscramper "And that's exactly what": yes, my question was if it does resolve the expression's types during the type resolution |
11:32:08 | FromDiscord | <carpal> so in the same phase it also does semantic checks? |
11:34:49 | FromDiscord | <haxscramper> Expression type resolution itself is a semantic check if I'm not mistaken about terminology. So yes, it resolves types "in the same phase" |
11:38:19 | * | idxu quit (Quit: ZNC - https://znc.in) |
11:38:36 | * | idxu joined #nim |
11:51:28 | FromDiscord | <carpal> I mean↵`var x: string = 10`↵this is semantically wrong |
11:54:14 | FromDiscord | <carpal> so the compiler resolves the type string, checks if x is doubly declared and if the expression type and the context's type are the same? |
11:54:26 | FromDiscord | <carpal> all in the same phase? |
11:56:45 | FromDiscord | <carpal> sent a code paste, see https://play.nim-lang.org/#ix=3fsr |
11:56:52 | FromDiscord | <carpal> (edit) "https://play.nim-lang.org/#ix=3fsr" => "https://play.nim-lang.org/#ix=3fss" |
11:57:26 | FromDiscord | <carpal> is because of all is done in a one phase that the compiler can't refer to forward declared type or functions? |
11:58:33 | FromDiscord | <carpal> (edit) "one" => "single" |
12:00:00 | FromDiscord | <Nisha's alt> Is there a tool to turn TS into Nim? |
12:00:10 | FromDiscord | <Nisha's alt> And how well does it work? :P |
12:00:21 | FromDiscord | <Recruit_main707> !search ts2nim |
12:00:40 | FromDiscord | <Recruit_main707> I thought we could use that command |
12:00:46 | FromDiscord | <Nisha's alt> The bot isn't here anu more |
12:00:54 | FromDiscord | <Recruit_main707> Ah xd |
12:01:00 | FromDiscord | <Nisha's alt> Disbot got kicked when Disruptek did :p |
12:01:27 | FromDiscord | <Nisha's alt> Someone should make a bot for it though, it honestly sucks not having disbot :p |
12:02:12 | FromDiscord | <Recruit_main707> https://github.com/bung87/ts2nim |
12:05:12 | FromDiscord | <Nisha's alt> Thanks! How would i make it translate deps into Nim too? Lol |
12:12:16 | FromDiscord | <haxscramper> In reply to @carpal "all in the same": Are you asking how it is done in nim compiler or how you would write it in your own language? |
12:24:06 | * | rockcavera joined #nim |
12:26:29 | * | johannes_ quit (Quit: leaving) |
12:29:34 | * | Vladar joined #nim |
12:30:02 | FromDiscord | <Unaimend> Any idea why this is not working, the error message is not really helpful ↵https://play.nim-lang.org/#ix=3fxy |
12:32:22 | FromDiscord | <exelotl> In reply to @Hitoshi Shinsou|💻⭐ "Someone should make a": Call it datbot :P |
12:33:47 | FromDiscord | <pointystick> Unaimend, my guess is the matrix is expecting ints but gets enum'd values. Putting '.ord' to turn the enum values into ints lets it compile, not sure if it's correct though |
12:34:05 | FromDiscord | <Unaimend> ahh thx |
12:34:16 | FromDiscord | <haxscramper> that is correct |
12:34:33 | FromDiscord | <haxscramper> Nim `enum` is not implicitly convertible to `int` |
12:34:52 | FromDiscord | <Unaimend> In reply to @haxscramper "Nim `enum` is not": 😢 |
12:36:05 | FromDiscord | <Rika> a lot of things arent implicitly convertible in nim tho |
12:38:48 | FromDiscord | <carpal> In reply to @haxscramper "Are you asking how": how the nim compiler manages these operations |
12:38:55 | FromDiscord | <carpal> just to learn about it |
12:39:54 | FromDiscord | <mlokis> i feel like nim compiler builds on it self |
12:46:34 | PMunch | This is a bad idea, right? https://github.com/dfdeshom/nimrdkafka/blob/master/example.nim#L50-L53 |
12:46:48 | PMunch | That string should probably pre-allocate those 512 bytes |
12:49:04 | FromDiscord | <whisperdev> how can I do something like this? |
12:49:38 | FromDiscord | <whisperdev> let bin = fmt""{bin_path}"" // prints: "C:\Program Files\bin\foo.exe" ? |
12:50:43 | PMunch | Something like this probably `let bin = fmt"\"{bin_path}\""` |
12:55:42 | FromDiscord | <whisperdev> Does not work... |
12:55:59 | PMunch | Define not working |
13:00:38 | FromDiscord | <konsumlamm> using `&` instead of `fmt` should work |
13:00:53 | FromDiscord | <konsumlamm> the latter is a raw string literal, so backslash isn't interpreted as escape |
13:01:58 | FromDiscord | <konsumlamm> alternatively, `fmt"""..."""` should also work (without backslash) |
13:05:17 | PMunch | Oh right, I forgot that fmt was a raw string literal |
13:13:27 | FromDiscord | <d4rckh> how do i set it so it uses `-d:ssl` when i compile using `nimble build` automatically? |
13:14:31 | FromDiscord | <d4rckh> oh nvm i just pass it to the command directly |
13:15:54 | PMunch | You can also add it in the module.nims file |
13:15:57 | PMunch | Or nim.cfg |
13:16:08 | PMunch | Or drop it in your nimble file I think |
13:19:14 | FromDiscord | <whisperdev> argggh none of it works |
13:21:14 | FromDiscord | <Rika> ? even `&"\"\'"`? |
13:21:23 | FromDiscord | <Rika> oops, `\"` not `\'` |
13:22:32 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
13:23:41 | * | ehmry joined #nim |
13:29:19 | FromDiscord | <d4rckh> does anyone have a github action template i can use to automatically compile my nim app and make a release for it?↵tried some from the forums but didnt work for me |
13:45:03 | ForumUpdaterBot | New thread by Ginko: Variable set at compile time, see https://forum.nim-lang.org/t/7871 |
13:49:13 | * | Vladar quit (Remote host closed the connection) |
13:54:28 | * | Vladar joined #nim |
14:02:24 | * | NimBot joined #nim |
14:11:06 | ForumUpdaterBot | New thread by FabienPRI: Global var & thread, see https://forum.nim-lang.org/t/7872 |
14:41:17 | * | grimler32 joined #nim |
14:42:57 | grimler32 | Evil People Messed with my LIFE! Are there any universe editors here with access to the 4 bit 3 dimensional god code at the multiverse level?? |
14:44:08 | FromDiscord | <Anuke> Anyone know of a C/nim library that can encode gifs with RGBA data as frames? I've found <https://github.com/lecram/gifenc>, but it's very basic and requires indexed data and a palette, which I don't have.↵I've tried writing each frame to disk as a PNG and running imagemagick on that, but as one might expect, that approach is incredibly slow. |
14:45:53 | grimler32 | Evil People Messed with my LIFE! Are there any universe editors here with access to the 4 bit 3 dimensional god code at the multiverse level?? |
14:45:59 | * | gangstacat quit (Ping timeout: 260 seconds) |
14:47:49 | PMunch | @Anuke, I think Gifs are pallette based, so some part of your chain need to convert it to palette/index anyways |
14:48:08 | PMunch | You might want to look into animated PNGs, or just simply a video format |
14:48:16 | PMunch | And grimler32, please don't spam |
14:48:47 | * | gangstacat joined #nim |
14:48:49 | FromDiscord | <Rika> either spam or bot :thonk: |
14:50:55 | FromDiscord | <Anuke> I know palettes are required, but I was hoping of a library out there that automatically does the palette conversion for me.↵The issue with other formats is that, sadly, they aren't as widely supported - APNGs don't play in Discord, and videos can't be embedded in many places. |
14:51:14 | PMunch | @Rika, I mean he's on IRC so I could just ban him |
14:51:50 | FromDiscord | <haxscramper> !eval type Abyss = distinct void; echo sizeof(Abyss) |
14:51:53 | NimBot | 0 |
14:53:12 | FromDiscord | <exelotl> if you want to destroy the universe you won't get very far encoding 3 dimensions in 4 bits... |
15:05:17 | ForumUpdaterBot | New thread by Alexeypetrushin: RPC in 10 and REST API in 5 lines of Nim, see https://forum.nim-lang.org/t/7873 |
15:07:27 | * | PMunch quit (Quit: leaving) |
15:18:48 | ForumUpdaterBot | New post on r/nim by h234sd: RPC in 10 and REST API in 5 lines of Nim, see https://reddit.com/r/nim/comments/mzqrd2/rpc_in_10_and_rest_api_in_5_lines_of_nim/ |
15:32:30 | FromDiscord | <jtiai> Does nim has similar documentation mechanism as Python has Sphinx? |
15:32:52 | FromDiscord | <haxscramper> `nim doc` |
15:33:10 | FromDiscord | <haxscramper> https://nim-lang.org/docs/docgen.html |
15:33:50 | FromDiscord | <jtiai> that looks like reference documentation generator. |
15:34:14 | FromDiscord | <jtiai> But can you write docs like Python documentation or for example Django docs (all written in Sphinx) with docgen? |
15:35:36 | FromDiscord | <haxscramper> What features specifically are you talking about? |
15:35:49 | FromDiscord | <haxscramper> nim manual/tutorials etc. are created using `nim doc` too |
15:36:29 | FromDiscord | <jtiai> cross referensing pages, titles (different levels) index pages, search, adding images, arbitrary code and so on. |
15:37:01 | FromDiscord | <jtiai> <https://docs.djangoproject.com/en/3.2/> docs like that. |
15:38:05 | FromDiscord | <haxscramper> It can't do exactly like that, but nim doc also uses RST so you can have most of it's features |
15:38:33 | FromDiscord | <haxscramper> like images, titles, "arbitrary code" (whatever this means) and so on |
15:38:37 | * | MarderIII joined #nim |
15:39:35 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=3g18 |
15:40:15 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement↵https://raw.githubusercontent.com/nim-lang/Nim/devel/doc/manual.rst |
15:41:18 | FromDiscord | <haxscramper> yes it can |
15:43:51 | FromDiscord | <jtiai> Looks like it's missing few niceties sphinx provides - like automatic hierarchy and links. |
15:44:26 | FromDiscord | <jtiai> Sphinx also has quite simple theming... |
15:45:56 | FromDiscord | <haxscramper> I'm also working on an alternative documentation generator, but it is currently heavily WIP |
15:46:52 | * | def- quit (Quit: -) |
15:47:01 | FromDiscord | <jtiai> Sphinx is pretty nice it mainly adds nice build system plus additional stuff helping for docs. |
15:47:39 | * | def- joined #nim |
15:47:42 | FromDiscord | <exelotl> ah this topic again... I really want a Sphinx Nim extension 😅 |
15:47:50 | FromDiscord | <jtiai> That would be nice 😄 |
15:47:57 | FromDiscord | <haxscramper> is it that good? |
15:48:16 | FromDiscord | <jtiai> Sphinx? |
15:48:20 | FromDiscord | <haxscramper> yes |
15:48:23 | * | tane joined #nim |
15:48:33 | FromDiscord | <jtiai> Must be because CPython uses it. |
15:48:45 | FromDiscord | <exelotl> just need a way to say "please embed the signature and description of this Nim symbol here" within my own written docs |
15:48:48 | FromDiscord | <jtiai> and there is site "readthedocs.org" which mainly builds sphinx docs... |
15:49:06 | FromDiscord | <exelotl> it would work so well because both Sphinx and Nim use RST |
15:50:25 | FromDiscord | <jtiai> sent a long message, see https://paste.rs/ZNm |
15:51:30 | FromDiscord | <haxscramper> sounds really interesting |
15:51:42 | FromDiscord | <haxscramper> I will look into it then, maybe adapt some features for haxdoc |
15:52:59 | ForumUpdaterBot | New post on r/nim by miran1: NimConf 2021, see https://reddit.com/r/nim/comments/mzrjfc/nimconf_2021/ |
15:54:34 | FromDiscord | <flywind> see rst.html |
15:55:21 | FromDiscord | <jtiai> In reply to @haxscramper "I will look into": This is my "book" which is generated using Sphinx. Uses quite many features of sphinx except code docs. https://becomingpygamer.book.tiainen.cc/en/latest/ |
15:55:25 | FromDiscord | <flywind> https://nim-lang.github.io/Nim/rst.html |
15:55:56 | reversem3 | Wish there was a asciidoctor lib for nim |
15:56:17 | reversem3 | !help |
15:56:38 | reversem3 | !package asciidoctor |
15:56:42 | FromDiscord | <flywind> what is asciidoctor? |
15:57:01 | FromDiscord | <jtiai> Some Java... crap 😄 |
15:57:08 | reversem3 | nope |
15:57:20 | reversem3 | its actually written in ruby |
15:57:51 | FromDiscord | <haxscramper> the only lightweight markup language that I know of that actually has good tables |
15:57:57 | FromDiscord | <haxscramper> And not this ASCII-art madness |
15:58:36 | reversem3 | @dom96 used it to write his book , I use it all the time for writing docs |
15:58:36 | reversem3 | https://asciidoctor.org/ |
15:58:37 | reversem3 | lol no not ascii art |
15:58:50 | FromDiscord | <haxscramper> yeah |
15:59:05 | FromDiscord | <haxscramper> Maybe they actually tried writing two-line table cell or something |
15:59:30 | reversem3 | its wonderful to use and I also use antora https://antora.org/ |
16:00:08 | reversem3 | Tables are a breeze with asciidoctor |
16:00:12 | FromDiscord | <flywind> Nim may embrace markdown completely in the future https://github.com/nim-lang/Nim/pull/17827#issuecomment-826686846 |
16:01:16 | reversem3 | https://asciidoctor.org/docs/asciidoc-writers-guide/#a-new-perspective-on-tables |
16:02:56 | FromDiscord | <haxscramper> The only complaint about asciidoctor I have really is that they went with "more character combinations" for tables instead of org-mode approach which is more keyword-heavy. So `#+table:`, `#+row` etc. |
16:03:05 | FromDiscord | <haxscramper> `#+caption:` |
16:04:08 | reversem3 | I used to use org-mode back in the day but switched to JoplinApp cause I can run it anywhere and I can use encryption |
16:04:45 | reversem3 | https://joplinapp.org/ |
16:05:20 | FromDiscord | <haxscramper> org-mode is basically never used outside emacs, that is true. |
16:05:35 | * | blackpawn joined #nim |
16:06:26 | FromDiscord | <whisperdev> Does anyone know how can I make my app to ask for administrator's privileges on Windows? |
16:06:34 | FromDiscord | <whisperdev> You are supposed to compile it with some manifest or something. |
16:09:36 | * | Vladar quit (Quit: Leaving) |
16:09:38 | reversem3 | I love using emacs but org-mode came a real pain in the ass to sync and keep track of versions , thats why I moved to Joplin |
16:10:25 | * | blackpawn quit (Ping timeout: 268 seconds) |
16:10:55 | FromDiscord | <flywind> In reply to @whisperdev "Does anyone know how": I don't know. but maybe you can check the program is ran by admin |
16:10:58 | FromDiscord | <flywind> https://github.com/nim-lang/RFCs/issues/343 |
16:12:35 | FromDiscord | <whisperdev> let me try! thanks |
16:13:27 | ForumUpdaterBot | New Nimble package! niml - html dsl, see https://github.com/jakubDoka/niml |
16:13:45 | * | blackpawn joined #nim |
16:30:02 | reversem3 | niml looks pretty cool , you can even generate javascript using a proc |
16:43:28 | * | narimiran quit (Ping timeout: 252 seconds) |
16:54:05 | FromDiscord | <madman> `\develkinc\Shader-Kinc/Sources\@mexShader.nim.c:676: error: undefined reference to 'systemInit000'` has anyone seen this error before |
16:54:31 | FromDiscord | <madman> (building c generated nim on android studio) |
16:57:03 | * | liblq-devel joined #nim |
16:57:53 | * | liblq-devel quit (Client Quit) |
17:00:57 | FromDiscord | <dom96> In reply to @reversem3 "<@132595483838251008> used it to": it is very good, but definitely has its quirks. |
17:02:50 | reversem3 | No MD is perfect but it is getting updated on a regular basis I believe |
17:06:19 | FromDiscord | <haxscramper> In reply to @haxscramper "There is a `#science`": @dom96 there was a nim job posting yesterday and I forgot to ping you, so maybe you could put it in announcements or something. Not sure if this is really necessary, but maybe it will help |
17:12:54 | giaco | I'm writing a proc with OR argument type. Inside the proc I'd like to if type A do this, if type B do that. How should I accomplish this? Should I use "case" or "is" or "type" or "typeof" or what? |
17:14:36 | FromDiscord | <haxscramper> `when arg is A:` |
17:14:47 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement |
17:17:02 | giaco | thanks! |
17:17:45 | * | narimiran joined #nim |
17:18:51 | giaco | I'm quite confused by this topic. I got that "when" is kinda preprocessor on steroids, but also is and typeof operates at compile time, or not? |
17:19:57 | FromDiscord | <haxscramper> yes |
17:20:03 | FromDiscord | <haxscramper> `when` evaluates iot |
17:20:11 | FromDiscord | <haxscramper> its argument and conditionally compiles block of code |
17:20:51 | FromDiscord | <haxscramper> `is` is a type equality check it is evaluated at compile-time |
17:21:24 | FromDiscord | <haxscramper> all code that you put in `when` can be put in `if` condition too |
17:24:44 | giaco | adding when+is compiles and runs correctly, but replacing when with if doesn't compile anymore |
17:25:48 | reversem3 | is https://github.com/nim-lang/iup dead ? |
17:25:56 | giaco | I think in my case "if" doesn't know that it is dealing with a OR kind of type argument, but "when" does |
17:26:03 | FromDiscord | <haxscramper> because `when` conditionally compiles block |
17:26:12 | FromDiscord | <haxscramper> `if` compiles both and runs code conditionally |
17:29:40 | giaco | this means that ORred arguments actually creates multiple separate procs at compile time, otherwise it wouldn't be able to accept "else" like it is doing now |
17:29:54 | * | xet7 quit (Remote host closed the connection) |
17:30:13 | * | fredrikhr joined #nim |
17:30:34 | FromDiscord | <haxscramper> yes, generics proc generates different implementation for each argument type |
17:31:00 | FromDiscord | <haxscramper> I don't think there is any way of doing it differently without going into dynamic typing |
17:31:55 | giaco | oh no, I prefer them compiled, I'm disintossicating from dynamic typing |
17:39:24 | giaco | another question. I have a template in module A that calls a function of module B, so A imports B. When I call that template from module C I have to import both A and B to compile, not just A. Should I think of templates as something like "include"? |
17:44:46 | * | idf quit (Ping timeout: 268 seconds) |
17:46:59 | FromDiscord | <haxscramper> I would advise to think of templates as they are described in manual - "A template is a simple form of a macro: It is a simple substitution mechanism that operates on Nim's abstract syntax trees." |
17:47:09 | FromDiscord | <haxscramper> Otherwise you could just confuse yourself |
17:47:27 | FromDiscord | <haxscramper> And yes, because it is an AST-based substitution you might have to export all necessary symbols |
17:48:55 | FromDiscord | <Nisha's alt> Does anyone know if `raylib_now` actually works with Raylib 3.7? |
17:49:02 | FromDiscord | <Nisha's alt> I can't test it myself rn |
17:49:16 | FromDiscord | <Nisha's alt> (edit) "3.7?" => "2/3.7? (Not sure which version it's on)" |
17:52:10 | giaco | thanks for the description |
18:01:14 | * | vicfred joined #nim |
18:03:43 | ForumUpdaterBot | New thread by DontForceMe: Why learn NIM, see https://forum.nim-lang.org/t/7874 |
18:10:30 | * | xet7 joined #nim |
18:12:14 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
18:12:30 | * | kitech1 joined #nim |
18:22:04 | * | rockcavera quit (Remote host closed the connection) |
18:25:10 | FromDiscord | <mischa_u> In reply to @Hitoshi Shinsou|💻⭐ "I can't test it": it works with 3.5, it hasn't been updated yet for 3.7; but the convert script might just work with minimal modifications |
18:28:25 | * | neceve quit (Ping timeout: 276 seconds) |
18:28:26 | * | jaens[m] quit (Ping timeout: 276 seconds) |
18:28:27 | * | Benjamin[m]1 quit (Ping timeout: 276 seconds) |
18:30:17 | * | neceve joined #nim |
18:35:14 | * | jaens[m] joined #nim |
18:35:14 | * | Benjamin[m]1 joined #nim |
18:35:34 | giaco | math.round returns a float even when used without decimal places arguement, that would make an int. What use is that? |
18:43:59 | FromDiscord | <Nisha's alt> In reply to @mikeX "it works with 3.5,": Ah alright, thanks! |
18:57:07 | FromDiscord | <mlokis> How long is expected wait for my package to be added to the list? |
19:06:50 | * | rockcavera joined #nim |
19:06:56 | * | rockcavera quit (Remote host closed the connection) |
19:12:31 | * | rockcavera joined #nim |
19:42:00 | FromDiscord | <mlokis> do we have a macro that turns nim code into js string? |
20:17:22 | giaco | I'm stress testing my web app with 20K GET requests ready to submit as fast as possible (no, not a ddos, both are managed by me :P), so I've created a newAsyncHttpClient and I am looping await client.request and closing the AsyncHttpClient once at the end of the list. It works but is much slower than expected. Both client and server machines are < 5% used cpu and also bandwidth usage is ~30Kbps, so I |
20:17:24 | giaco | don't know where the bottleneck is. Any idea? |
20:18:31 | FromDiscord | <ElegantBeef> Did you build it as release? |
20:18:36 | giaco | yes |
20:22:10 | FromDiscord | <ElegantBeef> Well time to use a profiler |
20:25:41 | FromDiscord | <ajusa> If you do await client.request doesn't that mean that you're basically just doing all the requests in serial? Like you only send a request at a time? |
20:26:44 | giaco | ajusa, yes |
20:27:41 | FromDiscord | <ajusa> Well what's the average time for a request then? My guess is that latency (assuming that you are running these on different machines) is the problem |
20:27:55 | FromDiscord | <ajusa> Otherwise it could be IO, like a database call |
20:30:08 | giaco | it makes sense. Let me turn it to parallel async requests |
20:32:08 | giaco | will asyncfutures.all make them parallel? (well, async parallel) |
20:34:43 | FromDiscord | <ajusa> I think so? You may run out of sockets though, depends on your OS settings |
20:42:46 | FromDiscord | <Anuke> Why does nim require --threads:on to use threads? Is there any reason it's not enabled by default on supported platforms? |
20:46:52 | FromDiscord | <ElegantBeef> I'll say to not have thread analysis on by default, but that's probably not the reason |
20:47:18 | FromDiscord | <ElegantBeef> Certainly not the reason 😄 |
20:49:34 | FromDiscord | <Nisha's alt> Is there an alternative way to call Python code in Nim?- |
20:49:40 | FromDiscord | <Nisha's alt> That does use CFFI? |
20:49:54 | FromDiscord | <Nisha's alt> Doesn't↵FFI |
20:51:34 | FromDiscord | <Nisha's alt> Probably via RustPython or something |
20:51:50 | FromDiscord | <ElegantBeef> And how do you plan on talking to that rust interpreter |
20:54:43 | giaco | well, looking at wireshark it seems clear that is is useless to recycle an AsyncHttpClient sending multiple gets using "asyncfutures.all", as they would be serialized anyway |
20:55:37 | giaco | I should split the requests into multiple tcp sockets and maybe just serialize a subset of all the requests each |
20:55:40 | * | tane quit (Quit: Leaving) |
21:12:46 | * | MarderIII quit (Quit: Leaving) |
21:17:05 | * | narimiran quit (Ping timeout: 260 seconds) |
21:23:24 | * | thomasross joined #nim |
21:46:26 | giaco | why my program exits even when an exception that's catched upper in the call stack is raised? |
21:47:08 | giaco | I have also a "catch all" around the main, but exceptions kills the program anyway |
21:47:39 | giaco | itsays "unhandled exception", but it really is: Error: unhandled exception: Bad file descriptor [OSError] |
21:50:49 | * | fredrikhr quit (Ping timeout: 245 seconds) |
21:54:49 | FromDiscord | <Nisha's alt> In reply to @ElegantBeef "And how do you": CFFI? :P |
22:05:41 | FromDiscord | <ElegantBeef> @Nisha's alt so yea pretty much either you get to make a Nim interpreter or use CFFI |
22:06:44 | FromDiscord | <Nisha's alt> Lol Nim Interpreter go brrrrrr |
22:06:47 | FromDiscord | <ElegantBeef> Well dynlib would also work but that's just CFFI in a trenchcoat imo 😄 |
22:06:53 | FromDiscord | <Nisha's alt> Fair lol |
22:25:29 | FromDiscord | <ElegantBeef> Eh, my type inference passes CI! |
22:31:28 | ForumUpdaterBot | New post on r/nim by MrCordigle: Is it possible to have a reference to a generic type/concept embedded in an object?, see https://reddit.com/r/nim/comments/n00ga7/is_it_possible_to_have_a_reference_to_a_generic/ |
22:41:42 | giaco | I got my answer in asyncdispatch.nim |
22:44:43 | giaco | wait, no, I haven't found my answer: the exceptions behave differently in release and debug |
22:55:13 | * | xet7 quit (Remote host closed the connection) |
22:56:21 | * | xet7 joined #nim |
23:31:56 | FromDiscord | <arun> py2many.py v0.1 is out: https://pypi.org/project/py2many/↵↵Can transpile python code to nim. 9 out of 16 tests passing. Please try it out and open issues on github. |
23:33:46 | FromDiscord | <ElegantBeef> This only works for typed python right? |