<< 24-04-2021 >>

00:18:09*oculux joined #nim
00:26:44*sz0 quit (Quit: Connection closed for inactivity)
00:34:09*wasted_youth2 joined #nim
00:46:10*Tlangir quit (Remote host closed the connection)
00:52:38*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:52:56*njoseph joined #nim
01:11:28*jess quit (Quit: Lost terminal)
01:12:25*jess joined #nim
01:56:10*letto_ quit (Remote host closed the connection)
01:56:37*letto_ joined #nim
02:38:52ForumUpdaterBotNew thread by Masiarek2: Incorrect example in documentation for Return statement?, see https://forum.nim-lang.org/t/7844
03:43:41*thomasross quit (Ping timeout: 240 seconds)
03:48:02*abm quit (Quit: Leaving)
03:57:00*spiderstew joined #nim
03:57:55*spiderstew_ quit (Ping timeout: 250 seconds)
05:01:52*rockcavera quit (Remote host closed the connection)
05:07:51*gangstacat quit (Ping timeout: 260 seconds)
05:08:39*gangstacat joined #nim
05:21:49*narimiran joined #nim
05:21:54*narimiran quit (Remote host closed the connection)
05:50:41*xet7 quit (Remote host closed the connection)
06:15:14*vicfred quit (Quit: Leaving)
06:20:36*letto_ quit (Quit: Konversation terminated!)
06:21:29FromDiscord<mattrb> sent a code paste, see https://paste.rs/gjo
06:23:11*letto joined #nim
06:44:00*xet7 joined #nim
06:59:59*GitterIntegratio quit (Ping timeout: 245 seconds)
07:00:49*phatnael[m] quit (Ping timeout: 245 seconds)
07:00:50*antholop[m] quit (Ping timeout: 245 seconds)
07:02:42*phatnael[m] joined #nim
07:03:58*antholop[m] joined #nim
07:04:43*GitterIntegratio joined #nim
07:49:30ForumUpdaterBotNew thread by Drkameleon: Forcing comparison overloads for custom ref objects, see https://forum.nim-lang.org/t/7845
08:28:50FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=33ip
08:40:32FromDiscord<haxscramper> You need to make a variable global or pass pointer/reference to it to callback
09:00:03*unclechu quit (Quit: Idle for 30+ days)
09:04:41*Vladar joined #nim
09:05:21FromDiscord<jtiai> Considering that I can't change callback signature is there way to piggyback that info?
09:06:23*koltrast_ is now known as koltrast
09:06:28FromDiscord<Rika> why not?
09:07:25FromDiscord<Rika> i think
09:07:29FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=33ph
09:07:54FromDiscord<Rika> by the way, `if someVariable == 456:`
10:16:02ForumUpdaterBotNew thread by Shirleyquirk: Collision-resistant hash for 64bit pointers, see https://forum.nim-lang.org/t/7846
11:25:18FromDiscord<jtiai> sent a code paste, see https://paste.rs/xrJ
11:25:36FromDiscord<Rika> because there are holes in the enum i believe?
11:25:58FromDiscord<Rika> i dont know why thats the case
11:26:04FromDiscord<Rika> (edit) "i dont know why thats the case ... " added "though"
11:27:45FromDiscord<jtiai> Good guess. It's about holes.
11:28:05FromDiscord<flywind> use devel version and this module https://nim-lang.github.io/Nim/enumutils.html
11:28:23FromDiscord<flywind> for enums with holes
11:39:10FromDiscord<jtiai> Now if I could get devel version...
11:40:23FromDiscord<flywind> you can copy the implementation on your file
11:40:38FromDiscord<flywind> https://github.com/nim-lang/Nim/blob/devel/lib/std/enumutils.nim#L1
11:42:51FromDiscord<flywind> In reply to @jtiai "Now if I could": if you can use choosenim, it would be simple(`choosenim update devel`)
11:44:42FromDiscord<flywind> you can get binary from https://github.com/nim-lang/nightlies/releases
11:52:28FromDiscord<gollark> How do I convert an array of 8 bytes to an int64?
11:53:12FromDiscord<gollark> Without just manually writing all the bitshifts and such.
11:53:40FromDiscord<Rika> how unsafe are you willing to go
11:54:32FromDiscord<gollark> Ideally, no unsafety.
11:55:44FromDiscord<Rika> then the bitshifts
11:56:18FromDiscord<gollark> I see.
11:56:41FromDiscord<clyybber> @gollark do you care about endianness?
11:56:47FromDiscord<gollark> Nope.
11:57:09FromDiscord<gollark> I have a thing which fills an array with secure random bytes and I want an integer from it, basically.
11:57:16FromDiscord<clyybber> ah I see
11:57:43FromDiscord<haxscramper> Is it possible to somehow disable discriminant field assignment check?
11:58:30FromDiscord<gollark> I found that `cast[int64]` works, although it may be horribly unsafe.
11:58:34FromDiscord<haxscramper> I'm writing (de)serialization for case objects and this one is very annoying since I have to do special hoops and jumps to first get `kind` and then construct an object
11:58:34FromDiscord<Rika> In reply to @gollark "Ideally, no unsafety.": ngl i dont know how else you would do that given you want 0 unsafe
11:58:41FromDiscord<Rika> may? is
11:59:57FromDiscord<haxscramper> (edit) "special hoops and jumps" => "implement nontrivial object constructor logic" | "construct" => "create"
12:02:43*GitterIntegratio left #nim ("User left")
12:05:16FromDiscord<clyybber> @haxscramper could use addr and offsetof
12:05:17FromDiscord<haxscramper> In reply to @haxscramper "Is it possible to": The only way to really work around this is to set field using `addr` or something like that. Using `-d:oldCaseObjects` is not a solution because I don't want to rely on this flag
12:05:43FromDiscord<haxscramper> In reply to @Clyybber "<@!608382355454951435> could use addr": Yes, but that is a horrible hack that would not work in VM or for JS target
12:07:43FromDiscord<clyybber> there is no other good way afaik
12:07:59FromDiscord<clyybber> you could cast to an equivalent object but that's basically the same thing
12:08:00FromDiscord<clyybber> so
12:08:34FromDiscord<clyybber> maybe something like a {.cast(safeAssign).} block would be a good idea to have?
12:08:48FromDiscord<clyybber> in which the field assignments are not checked
12:09:00FromDiscord<haxscramper> it would certainly simplify some codegen for object construction
12:09:16FromDiscord<jtiai> for some reason my windows doesn't want to nstall choosenim...
12:09:45FromDiscord<haxscramper> Right now I have to make sure (1) kind fields are placed first in object serialization, and if I have nested fields it requires to generate long nested case with checks
12:10:01FromDiscord<haxscramper> Each check constructing single object with kind fields known at compile-time
12:10:09FromDiscord<haxscramper> Can't even group shared branches
12:10:29FromDiscord<clyybber> @haxscramper important IMO is that it uses the {.cast(...).} since it then fits with the "unsafe is grepping for addr/cast" goal we are trying to steer towards
12:11:09FromDiscord<haxscramper> Sounds good to me, maybe I will turn this into RFC later, because it makes a lot of sense
12:11:14FromDiscord<clyybber> cool, thanks!
12:11:22FromDiscord<clyybber> is also reasonable easy to implement I think
12:11:32FromDiscord<clyybber> (edit) removed "reasonable"
12:15:49*gangstacat quit (Quit: Ĝis!)
12:21:02*screamapiller[m] joined #nim
12:43:39*gangstacat joined #nim
12:47:44*natrys joined #nim
14:09:07*rockcavera joined #nim
14:19:33*tane joined #nim
14:27:45FromDiscord<dabmlfz> https://media.discordapp.net/attachments/371759389889003532/835522402506637352/unknown.png
14:27:47FromDiscord<dabmlfz> sent a code paste, see https://paste.rs/hFT
14:28:01FromDiscord<dabmlfz> if I change the backend to c, then em++ is used as expected.
14:28:27FromDiscord<dabmlfz> oh
14:29:04FromDiscord<dabmlfz> sent a code paste, see https://play.nim-lang.org/#ix=34hU
14:56:39*NimBot joined #nim
15:33:05*vicfred joined #nim
15:38:58*thomasross joined #nim
15:39:59FromGitter<bung87> at compile time can I detect if a ident is declared ?
15:41:50FromDiscord<haxscramper> `when declared(ident)`
15:48:59FromGitter<bung87> hmm this seems not work inside compile time proc
15:55:10FromGitter<bung87> ```code paste, see link``` ⏎ ⏎ I want do something like this [https://gitter.im/nim-lang/Nim?at=60843f5e1f84d71853d91b2e]
16:00:39FromGitter<haxscramper> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=608440a7a9dd556843faece3]
16:00:45*mjsir911 quit (Quit: Goodbye, World!)
16:01:04*mjsir911 joined #nim
16:01:41FromGitter<haxscramper> If that does not solve your issue show what "does not work" exactly
16:02:34FromGitter<bung87> I commented my type decalration I got `Error: undeclared identifier: 'NSMenu'`
16:02:34*xet7 quit (Read error: Connection reset by peer)
16:03:18FromGitter<bung87> my expression is `objcr: ⏎ ⏎ ```let menubar: ID = [NSMenu alloc]```` [https://gitter.im/nim-lang/Nim?at=60844146a2ac0d38e7d72c3c]
16:03:52FromGitter<haxscramper> You commented out type declaration, of course it would be an undefined identifier
16:04:16FromGitter<haxscramper> Or `NSMenu` is something different?
16:04:34FromGitter<bung87> I dont want it throw error , so I want something like `declared`
16:05:38FromGitter<bung87> in my case the ident could be a Class name or a singleton instance, they both starts A-Z
16:06:47FromGitter<bung87> currently I need declare every Class that might occurs in there
16:08:59FromGitter<bung87> https://play.nim-lang.org/#ix=34yV if I declares every needs class this will work perfect
16:10:22FromGitter<haxscramper> You need to define all types in advance. If you need to skip some `[ClassName` parts then you can convert them to `when declared(ClassName): # body`
16:11:39*goblinslayer[m] quit (Ping timeout: 245 seconds)
16:12:04*Zoom[m] quit (Ping timeout: 245 seconds)
16:16:48*Zoom[m] joined #nim
16:20:17*goblinslayer[m] joined #nim
16:22:44FromDiscord<dain> I can't get this imgui binding to work https://github.com/nimgl/imgui
16:23:32FromGitter<bung87> no idea now, for now I just declares all class that needs.
16:24:00FromDiscord<dabmlfz> In reply to @dain "I can't get this": how exactly doesn't it work?
16:25:16FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=34BL
16:25:56FromDiscord<dain> it's the same issue this guy had https://forum.nim-lang.org/t/7058 but there was no solution in that thread
16:26:02FromDiscord<dabmlfz> this isn't how imgui works
16:26:10FromDiscord<dabmlfz> you're getting a null pointer exception
16:26:29FromDiscord<dabmlfz> you need to setup a window first and others before calling igText
16:26:58FromDiscord<dain> I get the same error when I try to run the test file included in the repo
16:27:38FromDiscord<dabmlfz> which test file?
16:27:58FromDiscord<dain> oh wait I mean, the example code on the readme
16:28:18FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=34Ce
16:28:25FromDiscord<dabmlfz> yes that won't work without setting up a window and initializing imgui
16:28:32FromDiscord<dabmlfz> look at test.nim
16:28:51FromDiscord<dabmlfz> and the original imgui repo: https://github.com/ocornut/imgui/tree/64aab8480a5643cec1880af17931963a90a8f990/examples/example_glfw_opengl3
16:28:55FromDiscord<dain> hm
16:30:12FromDiscord<dain> sent a long message, see http://ix.io/34Cg
16:30:34FromDiscord<dabmlfz> yeah you need opengl and glfw
16:30:39FromDiscord<dabmlfz> they're both packages
16:30:46FromDiscord<dain> so the imgui package doesn't include all the dependencies it needs?
16:30:53FromDiscord<dain> or did i just install it wrong
16:31:44FromDiscord<dabmlfz> imgui is platform/api agnostic, it doesn't create the window and setup opengl for you
16:32:41FromDiscord<dain> oh hey I just did `nimble install nimgl` and then recompiled and it worked :D
16:33:03FromDiscord<dabmlfz> that's nice!
16:33:04FromDiscord<dain> i didnt realize i had to do that manually, i thought the imgui package did that itself
16:34:17FromDiscord<dabmlfz> hmm nimgl/imgui does provide helpers that help create a window and initialize opengl and imgui for opengl and glfw combination
16:34:19FromDiscord<dabmlfz> https://github.com/nimgl/imgui/blob/master/src/imgui/impl_glfw.nim↵https://github.com/nimgl/imgui/blob/master/src/imgui/impl_opengl.nim
16:34:58ForumUpdaterBotNew thread by Xioren: Is there a reliable way to round?, see https://forum.nim-lang.org/t/7850
16:35:22FromDiscord<dabmlfz> https://github.com/ocornut/imgui/tree/master/examples are the different examples for different backends for the original cpp library
16:35:46FromDiscord<dain> so when using this library do I just read the original C++ docs and translate it in my head to nim, assuming that the bindings work? ive never used imgui before and I don't know C++
16:36:21FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=34D1
16:36:22FromDiscord<jtiai> That is my block of stuff.
16:36:33FromDiscord<jtiai> which works.
16:37:14FromDiscord<dabmlfz> In reply to @dain "so when using this": I'd say c++ knowledge is valuable as this is only a wrapper for c wrapper of the original imgui c++ library
16:37:45FromDiscord<dabmlfz> if you plan to use glfw + opengl, then you don't have to worry about the backend as nimgl/imgui provides abstractions for those
16:38:10FromDiscord<dabmlfz> but let's say you wanted to use directx 11 + win32, then you'd have to read the c++ example and translate that
16:38:22FromDiscord<dabmlfz> (edit) "win32," => "win32 backend,"
16:38:41FromDiscord<dain> i think just opengl
16:38:53FromDiscord<dain> i just wanna make a rinkydink gui for a linux program
16:39:40FromDiscord<dabmlfz> sent a code paste, see https://play.nim-lang.org/#ix=34DA
16:40:21FromDiscord<jtiai> Well I'm complete noob what omes to imgui so I don't have a clue what "normally" means.
16:46:45FromDiscord<dabmlfz> sent a long message, see http://ix.io/34EQ
16:51:00FromDiscord<dain> ya that makes sense
16:51:01FromDiscord<dain> thankyou
16:56:00FromDiscord<jtiai> Hmm, choosenim is broken in windows apparently.
16:57:27FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=34GF
17:05:28*xet7 joined #nim
17:10:47FromDiscord<zidsal> @jitiai I can't reproduce this, when I swap versions it swaps correctly;
17:17:07FromDiscord<zidsal> quick question what about the toTable method allows the following code to work `assert b == {'a': 5, 'b': 9}.toTable` I can't see anything in the docs that lets you build tuples with {} ?
17:25:23*natrys quit (Quit: natrys)
17:32:26reversem3how would I write a test for this proc ? proc fullName(fname: string, lname: string): string =
17:33:07reversem3I thought I could do doAssert fullName("first, second") == true
17:33:21reversem3 * I thought I could do doAssert fullName("first", "second") == true
17:33:58Amun_RadoAssert will always be run whether you test or not
17:34:29saemAlso type miss match, so no you can't do that. You need to compare it to a string.
17:34:58reversem3 * I thought I could do doAssert fullName("first", "second") == "hello", "world"
17:35:21reversem3like this doAssert fullName("first", "second") == "hello", "world"
17:35:21reversem3A
17:35:53ForumUpdaterBotNew Nimble package! mn - A truly minimal concatenative programming language., see https://h3rald.com/mn
17:35:53ForumUpdaterBotNew Nimble package! min - A small but practical concatenative programming language and shell., see https://min-lang.org
17:35:55saemYup, and that should fail the assert, what happens?
17:36:56reversem3just sysfatal
17:37:07reversem3I am using inim though
17:37:29saemDunno about inim
17:37:50FromDiscord<jtiai> In reply to @zidsal "@jitiai I can't reproduce": Doesn't work for me. Location of choosenim installed is completely different from my normal nim and apparently paths didn't change when trying to switch nim version.
17:38:13saemBut you did a failing assert, that'll typically break most repls in most languages.
17:38:40reversem3ok so yes it failed
17:40:28FromDiscord<zidsal> @jtiai if you give me 20 mins I can go through your env with you and get this sorted
17:41:58reversem3oh ok so `doAssert myFullname("first", "second") == ""
17:42:04reversem3 * oh ok so `doAssert myFullname("first", "second") == ""`
17:43:36reversem3so even if its toUpper since my just proving its two strings it doesn't matter
17:43:54reversem3 * so even if its toUpper since I'm just proving its two strings it doesn't matter
17:44:30saemChoosenim doesn't change paths. Make sure the directory it uses is early in your path. Then use it to change Nim versions. Then verify it by checking the version as reported by nim --version
17:45:13reversem3make just choosenim is in your $PATH though
17:45:38reversem3same with nimble
17:53:16FromDiscord<dom96> @jtiai `which nim`
17:53:34FromDiscord<dom96> It's very likely your PATH is set up wrong
17:55:02reversem3or `locate nim`
17:55:39reversem3`echo $PATH | grep -i nim`
17:57:09reversem3should look something like this `/home/nixfreak/.nimble/bin/nim`
18:00:12FromDiscord<Nisha's alt> Lmao i found this: https://github.com/Anuken/nimdustry
18:00:14FromDiscord<Nisha's alt> Seems cool
18:04:21reversem3Yeah , what is ecs though
18:05:33reversem3ok so its using opengl , glfw, glad, and sdl
18:09:47FromDiscord<jtiai> In reply to @dom96 "<@!630837607537836062> `which nim`": I'm on windows. There are no "which".
18:10:43FromDiscord<zetashift> I think Windows has `where`
18:10:57FromDiscord<jtiai> And as a side note, Windows thought that "nimsuggest" is malicious software.
18:11:20FromDiscord<zetashift> There seems to be a lot of (false) positives for nim exe's lately
18:12:03FromDiscord<jtiai> `where nim` didn't do anything (no output but no error either)
18:12:09FromDiscord<zetashift> @leorize there was some work done on Nim treesitter grammar no? Is there a repo somewhere
18:12:31leorize[m]I think @haxscramper worked on one
18:12:47FromDiscord<zetashift> In reply to @jtiai "`where nim` didn't do": Means `nim.exe` isn't in your PATH
18:13:03FromDiscord<zetashift> did you install through choosenim (sorry I didn't read the whole convo)
18:13:31FromDiscord<jtiai> how come "nim --version" reports version if it's not in path?
18:13:37FromDiscord<zetashift> oh
18:13:43FromDiscord<zetashift> that's peculiar
18:14:03FromDiscord<haxscramper> In reply to @leorize "I think <@608382355454951435> worked": https://github.com/haxscramper/tree-sitter-nim
18:15:05FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=34Tw
18:15:25FromDiscord<haxscramper> Right now I’m not working on it and I need to learn to use tree-sitter for more intricate parts of nim grammar
18:16:00FromDiscord<zetashift> sent a code paste, see https://paste.rs/g68
18:16:23FromDiscord<jtiai> There is nothing about choosenim in my path.
18:17:17FromDiscord<dom96> In reply to @jtiai "I'm on windows. There": Your shell looks like WSL...
18:17:17FromDiscord<zidsal> choosenim is in the .nimble/bin directory
18:17:29FromDiscord<jtiai> My shell is powershell.
18:17:46FromDiscord<dom96> but yes, you can just use `where nim` then
18:18:14FromDiscord<jtiai> `where nim` doesn't return anything.
18:18:31FromDiscord<zetashift> In reply to @jtiai "There is nothing about": Remove that path `C:\Users\jani\nim-1.4.4\bin` and instead check if there exists a `C:\Users\jani\.nimble\bin` folder with nim in it, and add that folder to the PATH
18:19:30FromDiscord<jtiai> In reply to @zetashift "Remove that path `C:\Users\jani\nim-1.4.4\bin`": Now we're getting close, there is indeed nim.exe in my nimble dir.
18:20:21FromDiscord<zidsal> thats the choosenim, nim. so do as zeta says as I suspect when you call nim its just picking the first nim you see in your path. You currently have 2 nim's in your path 1 in .nimble/bin and 1 in -1.4.4\bin
18:21:40*PMunch joined #nim
18:21:52FromDiscord<jtiai> Well, obviously path order is honoured 🙂
18:22:01FromGitter<bung87> @haxscramper I understand now, `when declared(a)` can't have subsequence `and a is ID`, I move that parts to a template now , works fine
18:22:14*vicfred quit (Quit: Leaving)
18:23:37FromDiscord<zetashift> In reply to @jtiai "Well, obviously path order": In this case `choosenim` made the assumption with it's installation instruction that there is no other Nim installation.
18:24:30FromDiscord<jtiai> Actually choosenim kind of didn't do any assumptions. Installation instructions just didn't said that I need to remove any hand installed version paths.
18:25:19reversem3can't you just create a new ENV variable for nimble?
18:25:48FromDiscord<zetashift> In reply to @jtiai "Actually choosenim kind of": That's what I meant but from a different angle. Is it working now?
18:26:37FromDiscord<jtiai> downloadin/building/hoping.
18:26:52reversem3So is incremental compilation off the table for now and developer tools are priority ?
18:27:00FromDiscord<zetashift> ah, alright I'm hoping for the best too
18:27:23FromDiscord<zetashift> In reply to @reversem3 "So is incremental compilation": IC somewhat landed, and IC enables Nim to have better dev tools
18:27:40FromDiscord<zetashift> https://github.com/nim-lang/RFCs/issues/46#issuecomment-816822357
18:28:35FromDiscord<haxscramper> sent a long message, see http://ix.io/34VR
18:28:56FromDiscord<haxscramper> In reply to @reversem3 "So is incremental compilation": IC enables better developer tools
18:29:10FromDiscord<jtiai> (and now I screwed up my env 😄 )
18:29:11FromDiscord<haxscramper> nimsuggest to be specific, and IDE experience
18:29:25reversem3ok so "The first milestone is complete: IC works for 4 carefully selected test cases. There will be a follow-up milestone.
18:29:25reversem3"
18:30:56FromDiscord<jtiai> Now it works.
18:31:26FromDiscord<zetashift> Nice!
18:32:45FromDiscord<jtiai> now lets see if enums starts to work...
18:41:04FromDiscord<jtiai> `Error: cannot open file: fusion/btreetables`... Hmm what happened to fusion and btreetables?
18:44:27FromDiscord<clyybber> In reply to @haxscramper "While writing an RFC": but how do you work around it in the VM?
18:44:32FromDiscord<clyybber> And js?
18:45:04FromDiscord<haxscramper> sent a code paste, see https://paste.rs/3ia
18:45:13FromDiscord<haxscramper> verbose but I can deal with that
18:46:35FromDiscord<haxscramper> (edit) "https://play.nim-lang.org/#ix=34YV" => "https://play.nim-lang.org/#ix=34YU"
18:48:04FromDiscord<haxscramper> This is the only complaint I had - it is either backend-specific hack or more verbose than I would like, but I don't feel like the latter one justifies change
19:11:44FromDiscord<haxscramper> Though to make `ProveInit` shut up I would have to generate a separate object construction
19:12:54*bpr joined #nim
19:13:57*bpr quit (Client Quit)
19:15:21FromDiscord<haxscramper> Not `ProveInit` - `Error: cannot prove that it's safe to initialize with the runtime value for the discriminator 'k1'`
19:39:35*PMunch quit (Quit: leaving)
19:54:42FromDiscord<jtiai> sent a code paste, see https://paste.rs/8Rs
19:56:08FromDiscord<haxscramper> https://forum.nim-lang.org/t/7838 for recent discussion of similar problem. You can set captured variables to be global, pass things via pointer or get dirty and manually decompose closure into proc/env parts
19:57:23FromDiscord<haxscramper> From what I can tell you are working with some GUI library, so global variables should be fine I suppose, because everything runs in a single-threaded event loop. At leas if I understand it correctly, I might wrong on this one
19:57:35FromDiscord<jtiai> nimgl.
19:57:46FromDiscord<jtiai> And putting gui for my 6502 CPU emulator.
19:58:20FromDiscord<creonico> Hey, how can I statically wrap a windows library in Nim?
20:00:54FromDiscord<ElegantBeef> What do you mean "Statically wrap" static link it?
20:01:01FromDiscord<ElegantBeef> (edit) "wrap"" => "wrap","
20:01:37FromDiscord<demotomohiro> get .lib file and add --passL:"foo.lib" to nim compiler
20:02:21FromDiscord<demotomohiro> nim compiler option
20:03:46FromDiscord<creonico> To be straight foward, I want to link the `<windows.h>` with Nim
20:04:20FromDiscord<demotomohiro> windows.h is something to includes, not link
20:04:49FromDiscord<demotomohiro> if you want to use windows API, check https://github.com/khchen/winim
20:06:46FromDiscord<creonico> @demotomohiro How can I do that without `winim`, I want to learn to do it myself
20:07:09FromDiscord<ElegantBeef> Saem you said it'd be difficult to add enum inference in for casestmts! It was easy to bodge it in, just add a new type on context and assign it every time you enter a case statement then revert it back to the previous one, totally sensible and doesnt result in not being able to run tests 😛
20:07:34FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-importc-pragma
20:07:43FromDiscord<ElegantBeef> Pragmas below that also help
20:08:48FromDiscord<ElegantBeef> My bodge actually did let this compile though, so i'll take it as a "win" https://play.nim-lang.org/#ix=35d2
20:09:50FromDiscord<demotomohiro> As @ElegantBeef said, if you want to learn how to import windows API without winim, learn about importc, dynlib, or header pragma.
20:10:06FromDiscord<ElegantBeef> i'd say "and header" but yea
20:10:40FromDiscord<creonico> what is dynlib?
20:10:45FromDiscord<creonico> dynamic library?
20:11:05FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
20:11:32FromDiscord<demotomohiro> winlean module in Nim's standard library is also good example to import windows APIs.↵https://github.com/nim-lang/Nim/blob/devel/lib/windows/winlean.nim
20:12:52FromDiscord<demotomohiro> dynlib pragma can be used to import functions from shared library (.dll in windows, .so file on posix).
20:13:28FromDiscord<creonico> alright, thanks for the help
20:18:03FromDiscord<jtiai> \o/ (almost works)
20:27:28saem@ElegantBeef you're doing the work of a type inference variable (forget what those are called exactly). Anyhow, now you're adding more stuff to context which is associated with the traversal life time so that information is only available at that point in time and not in later passes or what have you. That might work for a while/long enough.
20:28:43FromDiscord<ElegantBeef> Lol it's silly is what it is
20:29:05*joast quit (Quit: Leaving.)
20:33:42FromDiscord<Sabena Sema> does nim transcode paths?
20:33:49FromDiscord<Sabena Sema> and how does nim narrow wide windows paths?
20:33:52FromDiscord<ElegantBeef> Really just need extra information when doing a qualified look up of the of branches of the casetype
20:34:14FromDiscord<ElegantBeef> Paths are just strings in Nim if that's what you mean
20:34:50FromDiscord<Sabena Sema> sure, but for example, what happens to windows paths that have unpaired surrogates
20:35:17*Kumool left #nim ("Ploop")
20:36:17*vicfred joined #nim
20:36:29FromDiscord<Sabena Sema> in particular on windows if you want to read a path, append some directoy name and write to that file you _can not_ narrow it and expect things to always work
20:36:41FromDiscord<haxscramper> Nim `std/os` uses `string` for path handling and does not keep path valid all the time
20:37:07FromDiscord<haxscramper> So messing things up is quite easy
20:38:04FromDiscord<haxscramper> This is a known problem. Compiler has its own `distinct`-based path handling, I wrote myself one too and leorize was (is) working on https://github.com/alaviss/nim-sys
20:38:17FromDiscord<Sabena Sema> OK so my evil path generator will have not do a bunch of importc crap then
20:38:17*joast joined #nim
20:38:56FromDiscord<Sabena Sema> I'm trying to gather prior work for discussions in c++'s SG16
20:39:32FromDiscord<jtiai> Wonder how Python pathlib does it since it's quite intuitive...
20:39:35saemHmm, yeah I probably wasn't thinking about the direction of propagating type information correctly. There might be some subtleties but I can't thinking of the issues with them right now.
20:42:08FromDiscord<Sabena Sema> I think they screw it up too
20:42:26FromDiscord<Sabena Sema> or well, they can give you invalid UTF
20:42:47FromDiscord<Sabena Sema> c++ kinda intends to get it right, but I'm not sure we do (linux implementations might)
20:43:08FromDiscord<ElegantBeef> Remove paths, just have every file indexed by a uint64
20:43:11FromDiscord<Sabena Sema> the other _very_ annoying thing is that windows paths and NT paths are not the same
20:43:27FromDiscord<Sabena Sema> this is the SG16 conclusion "we should not let users print file paths ever"
20:43:54FromDiscord<Sabena Sema> because they are not text and have no encoding information with them
20:44:09FromDiscord<checkersai> ` Error: type expected, but got: func`
20:44:13FromDiscord<checkersai> Oh no I broke the compiler
20:44:37FromDiscord<checkersai> I was trying to work on https://github.com/nim-lang/Nim/issues/11518 but I guess I done goofed
20:56:33FromDiscord<zidsal> sent a code paste, see https://paste.rs/LgS
20:58:16FromDiscord<checkersai> In reply to @checkersai "` Error: type expected,": more specifically `genasts.nim(51, 58) Error: type expected, but got: func`
20:58:53FromDiscord<checkersai> I must say I am perplexed, I don't even know what the character at the end is supposed to be
20:59:03FromDiscord<checkersai> or why it's there
21:15:47FromDiscord<creonico> Hey, I want to import a module of mine `import src.module` but it says that using `.` instead of `\` is deprecated?
21:16:09*joast quit (*.net *.split)
21:16:09*spiderstew quit (*.net *.split)
21:16:09*screamapiller[m] quit (*.net *.split)
21:16:09*antholop[m] quit (*.net *.split)
21:16:09*ckafi[m] quit (*.net *.split)
21:16:09*crem quit (*.net *.split)
21:16:09*casaca quit (*.net *.split)
21:16:09*conkker quit (*.net *.split)
21:16:09*kaliy quit (*.net *.split)
21:16:09*voidpi quit (*.net *.split)
21:16:09*Eyess quit (*.net *.split)
21:16:09*fmaruki quit (*.net *.split)
21:16:09*Araq quit (*.net *.split)
21:16:09*WilhelmV1nWeiner quit (*.net *.split)
21:16:09*shodan45 quit (*.net *.split)
21:16:10*FromDiscord quit (*.net *.split)
21:16:10*revere quit (*.net *.split)
21:16:10*ldlework quit (*.net *.split)
21:16:10*acidx quit (*.net *.split)
21:16:10*jken quit (*.net *.split)
21:16:10*wasted_youth2 quit (*.net *.split)
21:16:10*rolha quit (*.net *.split)
21:16:10*anoj[m] quit (*.net *.split)
21:16:10*ShalokShalom[m] quit (*.net *.split)
21:16:10*Benjamin[m]2 quit (*.net *.split)
21:16:10*goblinslayer[m] quit (*.net *.split)
21:16:10*Zoom[m] quit (*.net *.split)
21:16:10*Clonkk[m] quit (*.net *.split)
21:16:10*lnxw37d4 quit (*.net *.split)
21:16:10*leorize[m] quit (*.net *.split)
21:16:11*jfondren[m] quit (*.net *.split)
21:16:11*fbpyr[m] quit (*.net *.split)
21:16:11*Northstrider[m] quit (*.net *.split)
21:16:11*FlammableDuck[m] quit (*.net *.split)
21:16:11*jaens[m] quit (*.net *.split)
21:16:11*blackbeard420 quit (*.net *.split)
21:16:11*EastByte quit (*.net *.split)
21:16:11*gangstacat quit (*.net *.split)
21:16:11*phatnael[m] quit (*.net *.split)
21:16:11*njoseph quit (*.net *.split)
21:16:11*kwilczynski quit (*.net *.split)
21:16:11*euantorano quit (*.net *.split)
21:16:11*teiresias quit (*.net *.split)
21:16:11*pbb quit (*.net *.split)
21:16:11*Yardanico quit (*.net *.split)
21:16:11*npgm quit (*.net *.split)
21:16:11*ehmry quit (*.net *.split)
21:16:11*rockcavera quit (*.net *.split)
21:16:11*teasea quit (*.net *.split)
21:16:12*Lord_Nightmare quit (*.net *.split)
21:16:12*kitech1- quit (*.net *.split)
21:16:12*Amun_Ra quit (*.net *.split)
21:16:12*voltist quit (*.net *.split)
21:16:12*aeverr quit (*.net *.split)
21:16:12*dom96_ quit (*.net *.split)
21:16:12*xet7 quit (*.net *.split)
21:16:12*oculux quit (*.net *.split)
21:16:12*hyiltiz quit (*.net *.split)
21:16:12*arecaceae quit (*.net *.split)
21:16:12*Q-Master quit (*.net *.split)
21:16:12*nisstyre quit (*.net *.split)
21:16:12*bozaloshtsh quit (*.net *.split)
21:16:12*raboof quit (*.net *.split)
21:16:12*giaco__ quit (*.net *.split)
21:16:12*mal`` quit (*.net *.split)
21:16:12*so_ quit (*.net *.split)
21:16:12*surma quit (*.net *.split)
21:16:12*blaumetallic[m] quit (*.net *.split)
21:16:12*kuon quit (*.net *.split)
21:16:12*neceve quit (*.net *.split)
21:16:12*guelosk[m] quit (*.net *.split)
21:16:12*MTRNord quit (*.net *.split)
21:16:12*Avatarfighter[m] quit (*.net *.split)
21:16:12*Onionhammer quit (*.net *.split)
21:16:12*koltrast quit (*.net *.split)
21:16:12*qwr quit (*.net *.split)
21:16:12*tane quit (*.net *.split)
21:16:12*Gustavo6046 quit (*.net *.split)
21:16:12*Kaivo quit (*.net *.split)
21:16:12*def- quit (*.net *.split)
21:16:12*junland quit (*.net *.split)
21:16:12*xace quit (*.net *.split)
21:16:13*Jesin quit (*.net *.split)
21:16:13*nekits07 quit (*.net *.split)
21:16:13*notchris quit (*.net *.split)
21:16:13*lain quit (*.net *.split)
21:16:13*blueberrypie quit (*.net *.split)
21:16:13*ForumUpdaterBot quit (*.net *.split)
21:16:13*ligist[m] quit (*.net *.split)
21:16:13*m33[m] quit (*.net *.split)
21:16:13*ee7[m] quit (*.net *.split)
21:16:13*reversem3 quit (*.net *.split)
21:16:13*JStoker quit (*.net *.split)
21:16:13*zopsi quit (*.net *.split)
21:16:13*icebattle quit (*.net *.split)
21:16:13*Ekho quit (*.net *.split)
21:16:13*astronavt quit (*.net *.split)
21:16:13*oz quit (*.net *.split)
21:16:13*cornfeedhobo quit (*.net *.split)
21:17:40*so_ joined #nim
21:17:40*mal`` joined #nim
21:17:40*raboof joined #nim
21:17:40*bozaloshtsh joined #nim
21:17:40*nisstyre joined #nim
21:17:40*Q-Master joined #nim
21:17:40*arecaceae joined #nim
21:17:40*hyiltiz joined #nim
21:17:40*oculux joined #nim
21:17:40*xet7 joined #nim
21:17:40*joast joined #nim
21:17:40*screamapiller[m] joined #nim
21:17:40*antholop[m] joined #nim
21:17:40*spiderstew joined #nim
21:17:40*WilhelmV1nWeiner joined #nim
21:17:40*casaca joined #nim
21:17:40*crem joined #nim
21:17:40*ckafi[m] joined #nim
21:17:40*conkker joined #nim
21:17:40*Araq joined #nim
21:17:40*fmaruki joined #nim
21:17:40*Eyess joined #nim
21:17:40*voidpi joined #nim
21:17:40*kaliy joined #nim
21:17:40*jken joined #nim
21:17:40*acidx joined #nim
21:17:40*ldlework joined #nim
21:17:40*revere joined #nim
21:17:40*FromDiscord joined #nim
21:17:40*shodan45 joined #nim
21:18:20*surma joined #nim
21:18:20*blaumetallic[m] joined #nim
21:18:20*kuon joined #nim
21:18:20*neceve joined #nim
21:18:20*guelosk[m] joined #nim
21:18:20*MTRNord joined #nim
21:18:20*Avatarfighter[m] joined #nim
21:18:20*Onionhammer joined #nim
21:18:20*koltrast joined #nim
21:18:20*qwr joined #nim
21:18:24*raboof quit (Max SendQ exceeded)
21:18:26*cornfeedhobo joined #nim
21:18:58*ligist[m] joined #nim
21:18:58*m33[m] joined #nim
21:18:58*ee7[m] joined #nim
21:18:58*reversem3 joined #nim
21:18:58*JStoker joined #nim
21:18:58*zopsi joined #nim
21:18:58*icebattle joined #nim
21:18:58*Ekho joined #nim
21:18:58*astronavt joined #nim
21:18:58*oz joined #nim
21:19:05*tane joined #nim
21:19:05*Gustavo6046 joined #nim
21:19:05*Kaivo joined #nim
21:19:05*def- joined #nim
21:19:05*junland joined #nim
21:19:05*xace joined #nim
21:19:05*nekits07 joined #nim
21:19:05*lain joined #nim
21:19:05*blueberrypie joined #nim
21:19:05*ForumUpdaterBot joined #nim
21:19:06*screamapiller[m] quit (Ping timeout: 245 seconds)
21:19:10*wasted_youth2 joined #nim
21:19:10*rolha joined #nim
21:19:10*anoj[m] joined #nim
21:19:10*ShalokShalom[m] joined #nim
21:19:10*Benjamin[m]2 joined #nim
21:19:13*giaco__ joined #nim
21:19:16*antholop[m] quit (Max SendQ exceeded)
21:19:22*goblinslayer[m] joined #nim
21:19:22*Zoom[m] joined #nim
21:19:22*Clonkk[m] joined #nim
21:19:22*lnxw37d4 joined #nim
21:19:22*leorize[m] joined #nim
21:19:22*jaens[m] joined #nim
21:19:22*jfondren[m] joined #nim
21:19:22*fbpyr[m] joined #nim
21:19:22*Northstrider[m] joined #nim
21:19:22*FlammableDuck[m] joined #nim
21:19:22*blackbeard420 joined #nim
21:19:22*EastByte joined #nim
21:19:22*rockcavera joined #nim
21:19:22*teasea joined #nim
21:19:22*kitech1- joined #nim
21:19:22*Amun_Ra joined #nim
21:19:22*voltist joined #nim
21:19:22*aeverr joined #nim
21:19:22*dom96_ joined #nim
21:19:27*notchris joined #nim
21:19:31*ckafi[m] quit (Ping timeout: 245 seconds)
21:19:34*d10n-work quit (Ping timeout: 245 seconds)
21:19:39*notchris quit (Changing host)
21:19:39*notchris joined #nim
21:19:45*JStoker quit (Max SendQ exceeded)
21:19:45*astronavt quit (Max SendQ exceeded)
21:19:45*Ekho quit (Max SendQ exceeded)
21:19:47*ligist[m] quit (Ping timeout: 267 seconds)
21:19:47*m33[m] quit (Ping timeout: 246 seconds)
21:19:48*ee7[m] quit (Ping timeout: 267 seconds)
21:19:50*blaumetallic[m] quit (Ping timeout: 248 seconds)
21:19:50*neceve quit (Ping timeout: 248 seconds)
21:19:50*guelosk[m] quit (Ping timeout: 248 seconds)
21:19:50*MTRNord quit (Ping timeout: 248 seconds)
21:19:50*Avatarfighter[m] quit (Ping timeout: 248 seconds)
21:19:52*stisa quit (Ping timeout: 258 seconds)
21:19:52*konradmb[m] quit (Ping timeout: 258 seconds)
21:19:53*Technisha[m] quit (Ping timeout: 258 seconds)
21:19:53*Jeff[m]2 quit (Ping timeout: 258 seconds)
21:19:53*Avahe[m] quit (Ping timeout: 258 seconds)
21:19:53*j-james[m] quit (Ping timeout: 258 seconds)
21:19:53*DannyHpy[m] quit (Ping timeout: 258 seconds)
21:19:53*BitPuffin quit (Ping timeout: 258 seconds)
21:19:59*hoek quit (Ping timeout: 245 seconds)
21:20:01*goblinslayer[m] quit (Ping timeout: 272 seconds)
21:20:02*Zoom[m] quit (Ping timeout: 272 seconds)
21:20:02*Clonkk[m] quit (Ping timeout: 247 seconds)
21:20:02*lnxw37d4 quit (Ping timeout: 247 seconds)
21:20:02*leorize[m] quit (Ping timeout: 272 seconds)
21:20:02*jfondren[m] quit (Ping timeout: 272 seconds)
21:20:02*fbpyr[m] quit (Ping timeout: 247 seconds)
21:20:02*FlammableDuck[m] quit (Ping timeout: 272 seconds)
21:20:02*jaens[m] quit (Ping timeout: 272 seconds)
21:20:03*JStoker joined #nim
21:20:15*fowl quit (Ping timeout: 258 seconds)
21:20:21*gangstacat joined #nim
21:20:21*njoseph joined #nim
21:20:21*kwilczynski joined #nim
21:20:21*euantorano joined #nim
21:20:21*teiresias joined #nim
21:20:21*pbb joined #nim
21:20:21*Yardanico joined #nim
21:20:21*ehmry joined #nim
21:20:22*rolha quit (Ping timeout: 276 seconds)
21:20:23*anoj[m] quit (Ping timeout: 276 seconds)
21:20:23*ShalokShalom[m] quit (Ping timeout: 276 seconds)
21:20:23*Benjamin[m]2 quit (Ping timeout: 276 seconds)
21:20:23*kwilczynski quit (Max SendQ exceeded)
21:20:27*reversem3 quit (Ping timeout: 246 seconds)
21:20:50*raboof joined #nim
21:21:06*raboof quit (Excess Flood)
21:21:39*clyybber joined #nim
21:21:55*raboof joined #nim
21:21:57Prestigeyeah you want to import foo/bar
21:22:38*dom96_ quit (Excess Flood)
21:23:14*dom96 joined #nim
21:23:15*clyybber quit (Client Quit)
21:23:44FromDiscord<creonico> can you say that in english please
21:24:00FromDiscord<ElegantBeef> you do `src/module` instead of `src.module`
21:24:02Prestigetype `import src/module`
21:24:07*kwilczynski joined #nim
21:24:14FromDiscord<creonico> I do, it says can't open file
21:24:23*clyybber joined #nim
21:24:36FromDiscord<ElegantBeef> It's a relative path so probably just `module`
21:24:42*npgm joined #nim
21:25:00*fowl joined #nim
21:26:05*d10n-work joined #nim
21:26:39FromDiscord<creonico> ok, that worked but I cannot use the module name to create a variable?
21:27:57FromDiscord<ElegantBeef> What do you mean?
21:28:56Prestigelike an exported variable?
21:28:59*hoek joined #nim
21:30:35FromDiscord<creonico> so I have a Module type inside my module, and I want to create a module variable of type Module in the main file
21:30:51FromDiscord<ElegantBeef> so do `type ObjectName = object`
21:30:53FromDiscord<creonico> But it says that I am redefining module because it's already defined
21:30:55FromDiscord<ElegantBeef> you need the export marker
21:31:01FromDiscord<creonico> I do have that
21:31:08Prestigecan you share the code?
21:31:16FromDiscord<ElegantBeef> Code is always preferable to words
21:31:27FromDiscord<creonico> sure
21:32:30FromDiscord<creonico> sent a code paste, see https://paste.rs/L8O
21:33:29FromDiscord<creonico> sent a code paste, see https://play.nim-lang.org/#ix=35s2
21:33:42*raboof quit (Read error: Connection timed out)
21:34:29*raboof joined #nim
21:34:37FromDiscord<creonico> I come from a Lua background by the way
21:34:48FromDiscord<ElegantBeef> It's cause of the `module` module and `module` variable
21:35:03FromDiscord<ElegantBeef> rename the files `modules.nim` and that solves it:D
21:35:04FromDiscord<ElegantBeef> (edit) "it:D" => "it 😄"
21:35:29FromDiscord<ElegantBeef> you can do `module.create(module)` which is the issue
21:35:47FromDiscord<ElegantBeef> it doesnt know if the `module` is the module or the variable
21:36:09FromDiscord<ElegantBeef> also unless you really want to you can do↵`var module = Module(name: "Some name")`
21:36:53FromDiscord<creonico> ok, can I do↵`var module:Module = {name: "Some name"};`↵?
21:37:00FromDiscord<ElegantBeef> Nope
21:37:25FromDiscord<creonico> Do I have to specify the type before the parameters?
21:37:47FromDiscord<creonico> (edit) "parameters?" => "fields?"
21:37:49FromDiscord<ElegantBeef> I mean you have to do `Module(name: "some name")` 😄
21:37:54FromDiscord<ElegantBeef> It's a obj constructor
21:38:08FromDiscord<zidsal> has anyone been able to et nim-gdb to run on windows? when I run it I get the following error `NameError: name `file` is not defined`
21:39:01FromDiscord<creonico> In reply to @ElegantBeef "I mean you have": That sucks, im saying the type twice, in C you can do as I typed it
21:39:09FromDiscord<ElegantBeef> no you arent
21:39:23FromDiscord<ElegantBeef> `var module = Module(name: "Some Name")` is only once
21:39:43FromDiscord<creonico> but that doesn't satisfy me 🥺
21:40:43Prestigewhat do you want?
21:41:10FromDiscord<ElegantBeef> Seems like they want explict type and constructor
21:41:24FromDiscord<ElegantBeef> So silly behaviour when `Module(...)` tells you the type 😄
21:42:18FromDiscord<creonico> right, I want to specify the type with the identifier and then assign based on that type
21:42:26FromDiscord<creonico> Can I not do that with metaprogramming?
21:43:12PrestigeIf you mean let foo: Foo = Foo(...) you can do that. But the variable name and import can't have the same name
21:43:33Prestigecan't import foo and have a variable also named foo, as far as I know
21:48:20*leorize[m] joined #nim
21:48:20leorize[m]yea, the dot import syntax is deprecated
21:48:26leorize[m]you should write `import src/module` instead
21:48:50FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=35uJ @creonico if you wanted this mod
21:48:59FromDiscord<ElegantBeef> (edit) "mod" => "mess"
21:49:35FromDiscord<ElegantBeef> But my response is just do the idiomatic way of `var module = Module(..)` since it gives the same information and is less ugly
21:49:50FromDiscord<zidsal> @ElegantBeef that nim playground is empty :p
21:49:57FromDiscord<ElegantBeef> ix.io issues
21:50:04FromDiscord<ElegantBeef> Refresh a few times if blank
21:50:51FromDiscord<zidsal> yup that worked
21:51:25FromDiscord<ElegantBeef> I couldnt be arsed to support the curly syntax
21:51:30*konradmb[m] joined #nim
21:51:38FromDiscord<ElegantBeef> but it's the same logic
22:09:10*tane quit (Quit: Leaving)
22:15:41*Vladar quit (Quit: Leaving)
22:27:22*clyybber quit (Remote host closed the connection)
22:29:03*JStoker is now known as Guest86869
22:29:04*dom96 quit (Changing host)
22:29:04*dom96 joined #nim
22:29:10*Lord_Nightmare joined #nim
22:29:12*Jesin joined #nim
22:29:28*astronavt joined #nim
22:32:01FromDiscord<checkersai> sent a code paste, see https://paste.rs/TgY
22:32:04FromDiscord<checkersai> basic example but you get the idea
22:32:32FromDiscord<checkersai> (edit) "https://paste.rs/maz" => "https://play.nim-lang.org/#ix=35Cr"
22:32:46*jfondren[m] joined #nim
22:32:47*neceve joined #nim
22:32:47*BitPuffin joined #nim
22:32:47*antholop[m] joined #nim
22:32:47*fbpyr[m] joined #nim
22:32:47*m33[m] joined #nim
22:32:47*jaens[m] joined #nim
22:32:47*goblinslayer[m] joined #nim
22:32:47*Zoom[m] joined #nim
22:32:48*Benjamin[m]1 joined #nim
22:32:48*j-james[m] joined #nim
22:32:48*Avahe[m] joined #nim
22:32:48*DannyHpy[m] joined #nim
22:32:48*lnxw37d4 joined #nim
22:32:48*Avatarfighter[m] joined #nim
22:32:48*MTRNord joined #nim
22:32:49*stisa joined #nim
22:32:49*reversem3 joined #nim
22:32:49*rolha joined #nim
22:32:53*anoj[m] joined #nim
22:32:53*ligist[m] joined #nim
22:32:53*Jeff[m]2 joined #nim
22:32:53*FlammableDuck[m] joined #nim
22:32:54*phatnael[m] joined #nim
22:32:54*Technisha[m] joined #nim
22:32:54*ShalokShalom[m] joined #nim
22:32:55*blaumetallic[m] joined #nim
22:32:55*ckafi[m] joined #nim
22:32:55*guelosk[m] joined #nim
22:32:55*screamapiller[m] joined #nim
22:32:56*Clonkk[m] joined #nim
22:32:56*ee7[m] joined #nim
22:36:33FromDiscord<Hi02Hi> sent a code paste, see https://play.nim-lang.org/#ix=35D9
22:36:57FromDiscord<checkersai> perfect, thanks
22:37:47FromDiscord<Hi02Hi> mp
22:37:50FromDiscord<Hi02Hi> (edit) "mp" => "np"
22:38:25FromDiscord<Hi02Hi> a question i have, is there a performance difference between `nim c` and `nim cpp` ?
22:39:15*Ekho joined #nim
22:48:52FromDiscord<Recruit_main707> there could be yes, but its usually minimal
22:49:43FromDiscord<Recruit_main707> it is thought that nim c is faster, but just because human c is usually faster than human c++, but there are no actual benchmarks afaik
22:52:48FromDiscord<exelotl> a few years ago I think `nim cpp` was better for exceptions but that's probably not the case anymore
23:25:30leorize[m]yea, --exceptions:goto (used when --gc:arc/--gc:orc is specified, can also be manually specified), is faster than both c-setjmp and cpp exceptions
23:25:40leorize[m]at least according to the bench araq posted sometime ago
23:27:31FromDiscord<garett> hello folks. I'm looking for a way to write a generic type, Id[T] such that, when T is uint64, I can deduce the type uint32 for the two halves of the id, when T is uint32, I can deduce the type uint16 for the two halves of the id, etc. I don't know a way to do this type deduction in Nim. Any ideas?
23:28:04FromDiscord<garett> Can I put a `when` block inside the type declaration for `Id[T]`?
23:28:47FromDiscord<garett> In C++ I could do this with template specialization, but I'm not sure whether there is a similar technique to employ here
23:42:04Prestigedo you mean like how you can use a case statement for variadic types?
23:43:25Prestigehttp://nim-lang.github.io/Nim/manual.html#types-object-variants
23:43:31FromDiscord<ElegantBeef> Well you've made be stumble onto a bug
23:43:32FromDiscord<garett> sent a code paste, see https://paste.rs/1ss
23:43:51FromDiscord<ElegantBeef> (edit) "be" => "me"
23:45:17FromDiscord<ElegantBeef> Well odd bug https://play.nim-lang.org/#ix=35P4
23:46:26Prestigewhat's the bug?
23:46:40FromDiscord<ElegantBeef> It's a string
23:46:45FromDiscord<garett> wow, I didn't know you could use a when expression in a type spec like that
23:46:45FromDiscord<ElegantBeef> it should be a float
23:46:54FromDiscord<ElegantBeef> I mean it compiles but it's bugged
23:47:02FromDiscord<ElegantBeef> The first call should require a float64 in the second spot
23:47:41FromDiscord<ElegantBeef> So seems it doesnt work, or T isnt resolved when that expression runs
23:47:47Prestigeoh I see
23:48:11FromDiscord<garett> trying this now 🙂
23:48:15FromDiscord<garett> sent a code paste, see https://paste.rs/UgG
23:48:24Prestigeis it because when is a compile time keyword?
23:48:25FromDiscord<ElegantBeef> Like i said it wont work
23:48:46FromDiscord<ElegantBeef> That shouldnt matter prestige since the procedure is generated at compile time
23:48:49Prestigeand a is a generic so the expression evaluates to false
23:48:54Prestigehm
23:49:02FromDiscord<ElegantBeef> well even `T.type` is the same
23:49:07FromDiscord<ElegantBeef> (edit) "`T.type`" => "`T`"
23:50:04*giaco__ quit (Quit: WeeChat 2.8)
23:50:45*giaco joined #nim
23:51:18FromDiscord<ElegantBeef> Also prestige since the type `a` is known at compile time it'll be pasted in there the same, just weird
23:53:17FromDiscord<ElegantBeef> Like this works fine https://gdl.space/daxukupafo.md
23:55:49FromDiscord<ElegantBeef> @garett did that work?
23:55:56FromDiscord<ElegantBeef> Or does it have the same issue as the proc?
23:56:10FromDiscord<garett> no, I tried to post a play-nim link, but I got an error
23:56:17FromDiscord<ElegantBeef> Yea ix.io is fucked atm
23:56:48FromDiscord<garett> https://play.nim-lang.org/#ix=35P4
23:56:59FromDiscord<garett> hmm, didn't work
23:57:34FromDiscord<garett> sent a code paste, see https://play.nim-lang.org/#ix=35Rl
23:58:45FromDiscord<garett> The `when` expression evaluates to `uint8`, regardless of the type of U
23:59:40FromDiscord<ElegantBeef> Yea seems it is oddly resolved