<< 12-05-2022 >>

00:30:30*duuude quit (Ping timeout: 260 seconds)
00:38:39*reversem3[m] quit (Ping timeout: 240 seconds)
00:39:21*buster_blue[m] quit (Ping timeout: 248 seconds)
00:53:36*sagax quit (Remote host closed the connection)
01:03:45*vicfred joined #nim
01:07:20FromDiscord<ynfle> How do I get the root dir of the nimble package?
01:07:53FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html#projectDir
01:08:15FromDiscord<Elegantbeef> If you're inside nimble that might work, otherwise you're pooched
01:09:09*reversem3[m] joined #nim
01:10:54FromDiscord<ynfle> Thanks I realized it doesn't make sense for me because it's a binary
01:11:04FromDiscord<ynfle> At runtime
01:11:23FromDiscord<Elegantbeef> `getAppDir` or w/e in the `std/os`
01:22:15*bananahead quit (Ping timeout: 252 seconds)
01:23:04*bananahead joined #nim
01:26:42FromDiscord<Zoom> How do you deal with ambiguous calls to funcs taking `openArray[char]` and `cstring`? `string` satisfies both
01:27:06FromDiscord<Elegantbeef> What do you mean?
01:27:27FromDiscord<Elegantbeef> you can do `proc(a: string)(myProcName)`
01:29:06FromDiscord<Zoom> I mean `Error: ambiguous call; both modA.foo(s: openArray[char]) blah-blah and modB.foo(s: cstring) match for (string)`
01:29:57FromDiscord<Elegantbeef> yea i mean `proc(a: openarray[char])(foo)(myString)`
01:30:14FromDiscord<Elegantbeef> That's how you resolve ambiguity in Nim
01:32:59*sagax joined #nim
01:39:10FromDiscord<Zoom> Sorry, not following. `modA.foo` was a direct match before, the changes introduced ambiguity
01:40:34FromDiscord<Elegantbeef> If you are authoring the module you can do `a: cstring and not string` or the same for `openArray[T]`
01:41:34FromDiscord<Elegantbeef> The old implicit conversion is kicking resolution's ass
01:42:19FromDiscord<Zoom> Thanks, this will do
01:44:47FromDiscord<Zoom> Nope, `openArray[char] and not cstring` doesn't work \:P
01:47:25*stkrdknmibalz quit (Ping timeout: 256 seconds)
01:49:35FromDiscord<Elegantbeef> Nope it wont
01:49:36FromDiscord<Elegantbeef> openarray is dumbly evaluated
01:49:36FromDiscord<Elegantbeef> Forgot about that
01:51:52FromDiscord<Zoom> Well, `foo(a: string | openArray[char])` works, however stupid it may look.
01:52:17FromDiscord<ynfle> I'm just using a cache dir
01:58:39*buster_blue[m] joined #nim
02:16:08*fallback quit (Ping timeout: 260 seconds)
02:16:36*qwestion quit (Ping timeout: 248 seconds)
02:18:12*droidrage quit (Ping timeout: 248 seconds)
02:18:41FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/EFF
02:18:46FromDiscord<Elegantbeef> I'm dumb
02:19:16FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/0fs
02:20:03FromDiscord<Elegantbeef> Implicit conversions dont work with generic type classes
02:27:25*fallback joined #nim
02:42:53*Zectbumo quit (Remote host closed the connection)
02:49:43*kayabaNerve joined #nim
02:56:12FromDiscord<Prestige> Is there a way to have a param type be a subset of an enum's values?
02:56:31FromDiscord<Prestige> like proc foo(a: SomeEnum.A | SomeEnum.B)
02:57:00FromDiscord<Elegantbeef> You cannot dispatch on values only ranges
02:57:02FromDiscord<Elegantbeef> you can do `proc foo(a: A..B)`
02:57:23FromDiscord<Prestige> hmm
02:59:28FromDiscord<Elegantbeef> It doesnt let you specialize for values though it's just runtime checked
03:00:01FromDiscord<Elegantbeef> You make want `proc foo(a: static Foo) = when a in {A, B}: ... else: {.error: "Invalid type".}`
03:02:07FromDiscord<Prestige> oh cool that would work great actually
03:02:09FromDiscord<Prestige> thanks
03:11:55FromDiscord<Elegantbeef> Static parameters are wonderful
03:12:55FromDiscord<Prestige> Hm I actually need a different additional param if it's a certain set of enum states passed in
03:13:05FromDiscord<Prestige> idk maybe I'll just write duplicate functions
03:15:24FromDiscord<Elegantbeef> Yea no clue what you're doing
03:16:47FromDiscord<Elegantbeef> 😄
03:16:50FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/KTF
03:17:43*arkurious quit (Quit: Leaving)
03:18:09FromDiscord<Prestige> It's for controller axes
03:18:16*Zectbumo joined #nim
03:18:39FromDiscord<Prestige> So if they pass in Axis.LEFT_X I need to check Direction. LEFT and Direction.RIGHT
03:19:21FromDiscord<Prestige> I need to disallow passing in Direction.UP and Direction.DOWN if they pass in an X axis, etc
03:19:33FromDiscord<Prestige> which should all be able to be done at compile time
03:20:54FromDiscord<Elegantbeef> Yea you can do `static: assert dir in {Up, Down}`
03:22:52FromDiscord<Prestige> ah inside the function? Neat
03:25:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XyC
03:26:24FromDiscord<Elegantbeef> then you do `dir.toHorz` and have a safely typed Horz/Vert 😄
03:35:01FromDiscord<Prestige> Okay one more thing, is there a way to go from an enum value to the enum state? Where the values are sparse ints, can't use them for ordinals. Maybe I just need to iterate and match
03:36:08FromDiscord<Elegantbeef> "the enum state"?
03:37:13FromDiscord<Prestige> like Axis.LEFT_X = 5
03:37:17FromDiscord<huantian> Do you mean like ParseEnum?
03:37:19FromDiscord<Prestige> I need to go from 5 to LEFT_X
03:37:28FromDiscord<Elegantbeef> Yea make a table at compile time
03:37:33FromDiscord<Elegantbeef> I do it with SDL2 in my inputs.nim
03:39:03FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/inputs.nim#L22-L54
03:39:05FromDiscord<Prestige> just a const table to reverse the mapping?
03:39:08FromDiscord<Prestige> ty
03:39:38FromDiscord<Elegantbeef> I emit my own enum instead of using theirs
03:39:47FromDiscord<Elegantbeef> Then i convert to mine in the event handle loop
03:40:18FromDiscord<Elegantbeef> I like enum indexed stuff, not that it's ideal the way i use it 😄
03:40:47*rockcavera quit (Remote host closed the connection)
03:44:36FromDiscord<Prestige> I think I'll just do a const table
03:44:42FromDiscord<Prestige> macros are still too unreadable for me
03:46:33*kayabaNerve quit (Ping timeout: 276 seconds)
03:46:50FromDiscord<Elegantbeef> iirc it emits the table for an enum to another
03:46:53FromDiscord<Elegantbeef> So you maay want to steel that
03:57:09*slowButPresent quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
03:58:07*kayabaNerve joined #nim
04:08:26FromDiscord<Rika> Beef do I need to make a new pico project just to run an example in the repo
04:08:38FromDiscord<Rika> Also is this why you technically have no tests
04:08:40FromDiscord<Elegantbeef> I think so
04:28:42*duuude joined #nim
05:04:33*ltriant_ joined #nim
05:06:39*ltriant quit (Ping timeout: 252 seconds)
05:09:52FromDiscord<Prestige> There's really no way to create a type that's a set of enum states? I really thought that would be a thing that exists
05:10:09FromDiscord<Elegantbeef> I showed you how but you didnt want it
05:10:13FromDiscord<Rika> You can? Just not a selective set
05:10:26FromDiscord<Elegantbeef> You can with a selective set aswell
05:10:34FromDiscord<Rika> Really?
05:10:40FromDiscord<Prestige> eh?
05:11:00FromDiscord<Prestige> Were you talking about the `toHorz` thing?
05:11:07FromDiscord<Elegantbeef> Before that
05:11:12FromDiscord<Prestige> I mean something like https://play.nim-lang.org/#ix=3XyS
05:11:57FromDiscord<Prestige> or `SubFoo = A | C`
05:14:53FromDiscord<Prestige> I couldn't get your `MyCheckedFoo` thing to work if that's what you meant
05:15:50FromDiscord<Elegantbeef> Ruh roh compiler bug
05:18:32FromDiscord<Prestige> What now?
05:21:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XyT
05:22:18FromDiscord<Elegantbeef> Sadly cannot do `type CheckedEnum[T: enum, S: static set[T]] = distinct T`
05:22:28FromDiscord<Elegantbeef> Compiler cannot reason `static set[T]`
05:23:53FromDiscord<Prestige> weird
05:24:13FromDiscord<Prestige> I might just make 4 functions, 1 for each direction, then
05:26:44*duuude quit (Remote host closed the connection)
05:28:10*duuude joined #nim
05:33:12FromDiscord<Elegantbeef> I did the fucked up stuffs
05:33:18FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/bcR
05:33:24FromDiscord<Prestige> I'm still shocked we can't create concrete types like that, it sohuld be possible
05:33:28FromDiscord<Prestige> (edit) "sohuld" => "should"
05:33:33FromDiscord<Elegantbeef> I just did
05:33:37FromDiscord<Elegantbeef> So uhh take that
05:33:38FromDiscord<Prestige> hmm
05:34:12FromDiscord<Prestige> I mean like, we should be able to do simple things like `type Foo = 3 | 8` imo
05:34:25FromDiscord<Prestige> Because you could check that at compile time, right
05:34:35FromDiscord<Elegantbeef> that doesnt make sense to me
05:35:03FromDiscord<Prestige> It would just mean any type of `Foo` would have to be 3 or 8
05:35:04FromDiscord<Elegantbeef> I mean it's practically what i did above i guess
05:35:14FromDiscord<Prestige> Yeah just more uh.. involved
05:35:22FromDiscord<Elegantbeef> Eh we can resolve that
05:35:42FromDiscord<huantian> Just make a better range type that can combine multiple ranges ez clap
05:36:09FromDiscord<Prestige> Maybe I'm just spoiled by typescript
05:36:56FromDiscord<Elegantbeef> That's actually probably a better method of what i'm doing here↵(@huantian)
05:37:07FromDiscord<Prestige> We _should_ be able to have this, but god knows how much work it'd be to add to the compiler
05:38:29FromDiscord<Prestige> Maybe I'll write up another RFC for people to shoot down
05:38:42FromDiscord<Elegantbeef> People shot down your RFCs?
05:39:00FromDiscord<Prestige> Mostly the MI one, lol
05:39:25FromDiscord<Prestige> I also proposed changes to Tables which seemed well received but nothing became of it
05:39:59FromDiscord<Prestige> https://github.com/nim-lang/Nim/issues/18250
05:41:15FromDiscord<Prestige> https://github.com/nim-lang/Nim/pull/18835 this is interesting...
05:42:06FromDiscord<huantian> Hmm does left..left | up..up not work lol
05:42:24FromDiscord<Elegantbeef> It could huan
05:43:17FromDiscord<Prestige> Interesting idea
05:44:43FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XyX
05:45:57FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/CxU
05:46:07FromDiscord<Verdure> I have found a particularly good airdrop program. There is no raffle and you don't have to pay to get it. ONLY ONE THOUSAND NFTS,FIRST-COME, FIRST-SERVED!!! For more details please see https://twitter.com/MetaNotey/status/1514800247339646976?s=20&t=QALG_O1tBe7v7D8KbFAHag
05:46:10FromDiscord<Prestige> Would be nice if you could just do `let a: FiveEight = 5`
05:46:33FromDiscord<Prestige> Can someone ban @Verdure
05:47:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XyY
05:47:12FromDiscord<Elegantbeef> dont let that guy that doesnt get banter to see that joke
05:47:14FromDiscord<Prestige> Neat
05:47:35FromDiscord<Prestige> No more chucklehead?
05:47:51FromDiscord<Elegantbeef> You cannot do it generically but for specific generics you can
05:48:47FromDiscord<Rika> In reply to @Verdure "I have found a": <@&371760044473319454>
05:48:56FromDiscord<Prestige> now I just need to write up an RFC so we could simplify this down to `type FiveEight = 5 | 8`
05:49:06FromDiscord<Elegantbeef> Ugh
05:49:41FromDiscord<Elegantbeef> That adds so much to the compiler that it doesnt really need 😄
05:50:13FromDiscord<huantian> Maybe you can abuse concepts for this 😛
05:50:38FromDiscord<Elegantbeef> What's more needed is the abillity to instantiate `Checked[T; valid: static openarray[T]] = distinct T`
05:50:59FromDiscord<huantian> Hmm
05:51:27FromDiscord<Elegantbeef> Like if you can instantiate that you can just make a macro that handles lets you do `checkedType(5, 8)` no need for compiler ssupport
05:51:31FromDiscord<Prestige> That'd be a good step but would still be somewhat complicated as an end user, moreso that just defining type like I was showing (with literals)
05:51:48FromDiscord<Prestige> hm true
05:51:53FromDiscord<Elegantbeef> Except the issue there prestige is you can use literals as a type parameter
05:52:06FromDiscord<Elegantbeef> `var a: seq[100]` is valid
05:52:24FromDiscord<Elegantbeef> Maybe not with seq
05:52:54FromDiscord<Elegantbeef> Ok how the hell did it work huan i showed it to you before
05:53:51FromDiscord<Elegantbeef> Ah nevermind i goofed it
05:53:56FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XyZ
05:55:47FromDiscord<Elegantbeef> Actually we can use macro magic to emit this all
05:56:21FromDiscord<Elegantbeef> So we can do `checkedVal(5, 8)` then check if there is a `CheckedVal` in the collection that has the value
06:00:40FromDiscord<huantian> Range types are implemented in the compiler right
06:00:57FromDiscord<Elegantbeef> Yes
06:01:29FromDiscord<huantian> Makes sense
06:02:23FromDiscord<huantian> It’s kind of both a compile time and runtime type
06:13:15FromDiscord<j-james> What are view types?
06:13:35FromDiscord<Elegantbeef> Types that enable safely borrowing memory
06:13:35FromDiscord<j-james> I found https://nim-lang.org/docs/manual_experimental.html#view-types but I don't fully understand `lent T` or what view types are used for
06:14:23FromDiscord<Elegantbeef> They're used for reducing memory consumption and increasing performance
06:15:01FromDiscord<j-james> So like a reference in Rust?
06:15:15FromDiscord<Elegantbeef> Yes
06:16:15FromDiscord<j-james> interesting
06:17:02FromDiscord<Rika> Move semantics that aren’t completely opaque to the programmer pretty much
06:17:48FromDiscord<j-james> they're pretty opaque to me while i'm trying to wrap my head around them haha
06:18:29FromDiscord<Elegantbeef> @Prestige\: hotshot part deux https://play.nim-lang.org/#ix=3Xz2
06:19:03FromDiscord<Elegantbeef> Like it's not overly dramatic to add code for it, just need to use your noggin and work against the compiler's wishes 😄
06:19:14FromDiscord<Prestige> Hmm
06:20:11FromDiscord<Prestige> With a converter that works quite well
06:20:36FromDiscord<j-james> The docs say a view type is one of `lent T` or `openArray[T]`: are those equivalent to being passed by value and passed by reference?
06:21:06FromDiscord<Elegantbeef> View types reuse memory so they're always passed by reference
06:21:21FromDiscord<Elegantbeef> It's not equivalent to it though
06:21:38FromDiscord<j-james> oh, is it just that anything is either `T` or `openArray[T]`
06:21:56FromDiscord<Elegantbeef> `lent T` is saying "Hey we're borrowing this variable immutably"
06:22:10FromDiscord<Elegantbeef> `openArray[T]` is also technically a borrow
06:23:52FromDiscord<Prestige> Now if we can https://play.nim-lang.org/#ix=3Xz3
06:25:29FromDiscord<Elegantbeef> Though it's presently implemented in a way that you cannot have it outlive the source
06:25:50FromDiscord<Elegantbeef> The big thing that view types give you is the abillity to statically know your memory is always safely owned, so you can hold onto a `var T` from a getter
06:25:57FromDiscord<Elegantbeef> With view types the above can set the `myType`'s `a` to `100` without it we copy `a.myVal` and mutate it
06:25:57FromDiscord<Elegantbeef> though i think it'd be `var a : var int = myType.getVal`
06:26:02FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/uRO
06:28:05FromDiscord<Elegantbeef> Would have to steal code fro m unions i think
06:29:17FromDiscord<Elegantbeef> I'm dumb
06:29:25FromDiscord<Elegantbeef> i used `getType` again
06:29:38FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Xz5
06:29:40FromDiscord<Elegantbeef> That works
06:31:03FromDiscord<j-james> hmm i'm having some trouble following the example
06:31:05FromDiscord<j-james> what does `: var int` indicate?
06:31:18FromDiscord<Elegantbeef> You want a view type instead of a copy
06:31:47FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Xz7 fixed even more
06:32:47FromDiscord<Elegantbeef> Downside is prestige `[Right, Left]` doesnt match
06:32:58FromDiscord<Elegantbeef> But if you use type aliases you should be fine
06:33:24FromDiscord<Prestige> Thanks :)
06:33:50FromDiscord<Elegantbeef> No problem
06:35:01FromDiscord<j-james> what happens to `a` when `myType` dies in the example?
06:35:09FromDiscord<j-james> that's enforced by the compiler to never happen?
06:35:18FromDiscord<Elegantbeef> It's ensured `a` cannot outlive `myType`
06:35:32FromDiscord<Elegantbeef> That's the big part of safe view types they have a borrow checker
06:36:03FromDiscord<Elegantbeef> Prestige you know you arent doing the check right?
06:36:09*PMunch_ is now known as PMunch
06:36:24FromDiscord<j-james> interesting, that makes sense
06:36:32FromDiscord<j-james> thanks for the explanation 😄
06:36:46FromDiscord<Elegantbeef> Need to do `assert d in Horizontal.T` or similar there
06:36:54FromDiscord<Elegantbeef> Yes you can rename the generic parameter if you wish
06:51:51*jjido joined #nim
06:53:10*duuude quit (Ping timeout: 240 seconds)
07:12:25FromDiscord<j-james> holy smokes concepts look incredible
07:12:31FromDiscord<j-james> how did i not know about these
07:12:35FromDiscord<Elegantbeef> They are
07:12:39FromDiscord<impbox [ftsf]> hmm `echo not 1` -> `-2` i'd expect `0`. are my expectations off or is nim doing something weird?
07:12:59PMunchimpbox_[ftsf], why would you expect 0?
07:13:31FromDiscord<Elegantbeef> All bits but the first are turn on
07:13:32FromDiscord<Elegantbeef> the first is off
07:13:38FromDiscord<impbox [ftsf]> and `echo not 0` -> `-1`, i'd expect `1`
07:13:40PMunch1 is 0b00000001 not 1 is 0b11111110, if you know your two's complement rule of negative binary numbers that's 2
07:14:14FromDiscord<impbox [ftsf]> hmm ok! i'm just silly then, thanks
07:14:22FromDiscord<Rika> “Not” is bit wise not
07:14:49FromDiscord<Rika> It isn’t Boolean not; Boolean not naturally only happens when the type is Boolean
07:15:01FromDiscord<impbox [ftsf]> gotcha
07:15:13PMunchYeah, not true returns false, and not false returns true
07:15:18FromDiscord<Rika> 👌
07:15:39FromDiscord<impbox [ftsf]> i have an int holding either a 0 or 1 value, should probably be a bool
07:15:49FromDiscord<Rika> It isn’t
07:16:02FromDiscord<Rika> That assumption isn’t applied
07:16:11FromDiscord<impbox [ftsf]> i mean, i should make it a bool instead of an int
07:16:20FromDiscord<Rika> Oh okay
07:16:24FromDiscord<Rika> I misread
07:16:35FromDiscord<impbox [ftsf]> though I want it to be a 1 bit integer =p
07:17:10FromDiscord<Rika> Usually it isn’t time efficient
07:17:16FromDiscord<Rika> In such case, I mean
07:17:24FromDiscord<Rika> Space efficient but not time efficient
07:17:45FromDiscord<Rika> Even worse if you’re storing a Boolean in a type with other fields
07:17:55FromDiscord<Rika> Then you have to add padding anyway
07:37:37FromDiscord<jmgomez> Hey guys, arent static var supported in type pragma macros?
07:38:03FromDiscord<Rika> What’s the issue exactly?
07:38:03FromDiscord<Elegantbeef> Code example?
07:38:19FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Xzi
07:38:28FromDiscord<Elegantbeef> Doesnt make sense to be static
07:39:09FromDiscord<Elegantbeef> Actually nevermind thought that was a pragma pragma
07:39:28*Arrrrrrr joined #nim
07:40:33FromDiscord<jmgomez> so arent they supported or is there soemthing wrong in the code?
07:40:51FromDiscord<Elegantbeef> Nah values to pragma macros arent supported it seems
07:41:00FromDiscord<Elegantbeef> Atleast typedesc macros
07:41:20FromDiscord<Rika> Weird exception
07:41:26FromDiscord<Rika> Since they work with function pragmas
07:41:35FromDiscord<Elegantbeef> They're specially handled and poorly at that
07:41:39FromDiscord<jmgomez> okay.. yes, that why I wasnt sure
07:41:41FromDiscord<Elegantbeef> Wait
07:41:45FromDiscord<Elegantbeef> you're doing `typed`
07:41:46FromDiscord<Rika> Fix it then beef smh
07:41:54FromDiscord<Elegantbeef> typdef macros do not work with `typed`
07:42:00FromDiscord<Elegantbeef> I tried rika, i'm not smart enough
07:42:12FromDiscord<jmgomez> ohh that make it compile
07:42:16FromDiscord<jmgomez> didnt know that
07:42:17FromDiscord<mratsim> use `macro(pathToGenFile: static string, body: utyped): untyped`
07:42:31FromDiscord<Elegantbeef> Too late mratsim i realized it was typed 😛
07:42:41FromDiscord<mratsim> (edit) "utyped):" => "untyped):"
07:42:45FromDiscord<jmgomez> thanks guys!
07:43:11FromDiscord<jmgomez> one last thing, can you call a macro from another macro? like to do a wrapper of that one where the parameter is set?
07:43:37FromDiscord<mratsim> with `quote do` or make the common part a proc on NimNode
07:43:41FromDiscord<Rika> Just use a proc
07:43:41FromDiscord<Rika> Yeah
07:43:48FromDiscord<Rika> A proc that handles NimNodes
07:44:06FromDiscord<jmgomez> problem with proc is that I still what to use the other macro but just less often
07:44:19FromDiscord<mratsim> both can call the proc
07:44:20FromDiscord<jmgomez> and it will require one extra
07:44:24PMunchThen you probably want to return something that will call your macro with a static parameter
07:44:43FromDiscord<jmgomez> I guess that's cleaner approach
07:44:52PMunchYou can have optional parameters to procedures as well
07:45:20FromDiscord<jmgomez> 👍
07:45:27PMunchHmm, I found this video https://www.youtube.com/watch?v=ExwqNreocpg, and now I'm trying to create a tiny Nim program that uses Xlib
07:45:43PMunchCurrently I have it down to 14472, but I can't seem to get it further
07:45:58PMunchFollowing of course this guide: https://hookrace.net/blog/nim-binary-size/
07:46:27PMunchbut it quickly gets irrelevant because I need some of the stuff they remove to actually call X11 libraries..
07:46:39FromDiscord<Elegantbeef> You are using arc right?
07:47:04FromDiscord<Elegantbeef> LTO on? `--opt:size`?
07:47:20PMunchThis is what I have so far: http://ix.io/3Xzl
07:48:32FromDiscord<Elegantbeef> Can try the other exception modes, dont recall if they work with arc though
07:51:26PMunchI tried exceptions:goto, but that didn't give me anything
07:51:47FromDiscord<Rika> That’s default on ARC no?
07:51:53FromDiscord<Elegantbeef> arc uses it by default yes
07:53:35PMunchNope, none of the others where any better
07:57:55FromDiscord<Elegantbeef> Dont recall does danger turn off all checks?
07:58:18PMunchYeah it should disable just about everything
07:58:21FromDiscord<Elegantbeef> actually gets off his ass to read the nimc docs, yes
07:59:15PMunchHmm, seems like a C program doing the same thing gets to about the same size..
07:59:52FromDiscord<Elegantbeef> Well fuck
08:00:38FromDiscord<Rika> Don’t think there’s much you can do about that
08:00:49FromDiscord<Rika> Just use a jumbo sized QR xd
08:00:54FromDiscord<Elegantbeef> Use a different C compiler perhaps
08:01:08FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Xzv
08:01:47FromDiscord<Rika> It doesn’t need to be a static string in the procedure
08:01:53FromDiscord<Elegantbeef> it needs to be `string` as an argument
08:01:55FromDiscord<Elegantbeef> `static` is only for dispatch it's then lowered to `string` inside
08:02:09FromDiscord<jmgomez> ohh okay
08:02:30PMunch@Rika, the biggest QR codes can only store about 2.5kb..
08:02:50PMunchI'm currently at about 14k
08:02:51FromDiscord<Elegantbeef> Time to make a bigger standard
08:03:07FromDiscord<enthus1ast> There are several standards already
08:03:33FromDiscord<Elegantbeef> Do they statically link the code?
08:03:54FromDiscord<Elegantbeef> I notice you arent statically linking anything which means you're probably using dynlib loading for x11 right?
08:06:21FromDiscord<Rika> Static linking would just make it larger?
08:06:45FromDiscord<Elegantbeef> The code to interact with the dynamic library might be smaller than the used parts of the static library
08:06:47FromDiscord<Elegantbeef> In small examples it's very likely
08:06:55FromDiscord<Elegantbeef> might be larger than\
08:07:57PMunchYeah I thought about that
08:08:23FromDiscord<Rika> A lot of these standards max at around 3 kilobytes
08:08:37FromDiscord<enthus1ast> i read a article about the same issue but with windows pe
08:08:40FromDiscord<Rika> I highly doubt your dynamic loading code is 11 kilobytes
08:09:21FromDiscord<Rika> There’s a lot more trimming down to do
08:28:28PMunchWelp, static linking with X11 made the binary go from 18744 to 964240 :P
08:28:34PMunchSo no big surprise there
08:30:37FromDiscord<Elegantbeef> We're getting close
08:30:49PMunchClose to what? :P
08:30:58FromDiscord<Elegantbeef> My new standard's limit
08:32:38PMunchHmm, a program which just does `echo "Hello world"` takes 14568 bytes..
08:38:44*duuude joined #nim
08:42:04*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:51:45FromDiscord<jmgomez> hey guys, one question. If a type A uses another type B (or inherit from it) can you access the other type B and inspect it within a macro?
08:52:16FromDiscord<Elegantbeef> You can use macros to go up the type tree yes
08:52:49FromDiscord<Elegantbeef> You need to use `getTypeImpl` or the other `getType` proccedures on the symbol
08:52:52FromDiscord<Elegantbeef> If it's not a symbol you're SOL
08:54:49PMunchWell, not entirely
08:55:41FromDiscord<Elegantbeef> I more mean in reference to the fact they had a macro on a typedef 😄
08:56:23FromDiscord<Elegantbeef> @jmgomez\: you may want to take a peak at https://github.com/beef331/oopsie it atleast shows the AST traversals you can copy
08:57:22FromDiscord<jmgomez> cool, thanks!!
09:00:35*firq quit (Quit: WeeChat 3.5)
09:10:40*koltrast joined #nim
09:22:02FromDiscord<Zoom> That's some wtf moment (#6529, #7432, #18325).↵[email protected] said in 2017\:> Maybe they should, not sure if that's safe to do in general though. Type systems are tricky. But since you live with the generic instantiations already, use a concept instead?↵And in 2021\:> We need to write an RFC and outline why nothing bad can happen when the "or" types become less picky.↵Do we have an RFC?
09:22:21FromDiscord<Elegantbeef> We do not
09:22:40FromDiscord<Elegantbeef> You know you can just write his name he's on discrod he only responds to pings from here
09:23:39FromDiscord<Elegantbeef> I did try to fix it but no avail
09:24:49*Zectbumo quit (Remote host closed the connection)
09:26:12FromDiscord<Zoom> I don't know how pings on Discord work and don't care much.↵We need to get Sixte to write that RFC so no one could possibly argue.
09:26:28*dtomato6 joined #nim
09:26:39*dtomato quit (Ping timeout: 240 seconds)
09:26:39*dtomato6 is now known as dtomato
09:26:41FromDiscord<Elegantbeef> You mean so no one would care to read it to argue
09:27:03FromDiscord<Zoom> Does it matter?
09:27:08FromDiscord<Elegantbeef> Sixte speaks generally like he's writing a white paper with no regard for actual messages parsed 😄
09:29:54FromDiscord<Elegantbeef> But yes openarray have many sharp edges that should be resolved 😄
09:31:47FromDiscord<Elegantbeef> I could document all the issues with them presently, if you want
09:32:52FromDiscord<Zoom> Who's he by the way? Wasn't it insinuated once he's that Chinese CS guy?
09:32:52FromDiscord<Zoom> Yin Wang
09:32:58FromDiscord<Elegantbeef> No clue
09:33:13FromDiscord<Elegantbeef> I just know that they come of very academic and dont understand 99% of what they say
09:33:33FromDiscord<Zoom> https://www.yinwang.org/resources/gucs-sample-chapter1.pdf
09:34:37FromDiscord<Zoom> This reads offensive \:D
09:34:43FromDiscord<Elegantbeef> and i dont\
09:34:45FromDiscord<xflywind> In reply to @Zoom "Who's he by the": Why do think it is him?
09:35:37FromDiscord<Zoom> Someone just said it or asked him. I just know nothing about him/her
09:36:14FromDiscord<Elegantbeef> So Zoom just for some of the fun in bite size form `proc doThing(a: openarray[int or char])` doesnt work without explicit `toOpenArray`, but `proc doThing[T: int or char](a: openarray[T]` does
09:37:59FromDiscord<Zoom> @xflywind\: I remember I tried to read some of yinwang.org artiles through deepl and to be frank it felt a bit more engaging than Sixte's posts \:-/
09:38:39FromDiscord<Elegantbeef> Open array much like iterable does not compose
09:38:42FromDiscord<Elegantbeef> Which makes it sad
09:39:15FromDiscord<Elegantbeef> `proc doThing(a: openarray[int] or int)` doesnt accept both yet again 😄
09:39:47FromDiscord<Elegantbeef> `template doThing(a: iterable[int] or openarray[int])` doesnt work either 😄
09:39:55FromDiscord<xflywind> In reply to @Zoom "Someone just said it": I don't know him much, though he is infamous on my country's internet.
09:43:58*Arrrrrrr quit (Quit: Arrrrrrr)
09:46:02FromDiscord<Zoom> Care to elaborate in #offtopic? I like me some internet lore.↵(@xflywind)
09:49:02FromDiscord<xflywind> sure
10:01:22FromDiscord<Zoom> This is all very frustrating and a serious obstacle in cleaning up stdlib \:(
10:29:10FromDiscord<Zoom> Is a `defined(nimscript)` a subset of `defined(nimvm)`?
10:32:04FromDiscord<Zoom> The limitations on when nimvm statements lead to lots of duplicate code in branches for js/nimdoc...
10:38:44FromDiscord<ambient> using Arraymancer, I'm little confused how there's: float, float32, system.float
10:44:50FromDiscord<ambient> ideally there would be only 1 32-bit float and I wouldn't have to worry about it
10:53:32PMunchsystem.float is the same as float
10:54:32PMunchAnd float is the same as float64
10:54:51PMunchThere is only 1 32-bit float, and that is float32
10:55:00PMunch(on 64-bit systems at least)
10:55:04PMunch@ambient ^
10:55:53FromDiscord<ambient> ok gotcha
10:56:36PMunchGreat.. Another Python project which doesn't work because of mismatched dependencies..
10:56:42FromDiscord<ambient> (I mean: got you) according to dict the meaning doesn't seem to be the same
10:56:57PMunchAccording to dict?
10:57:07FromDiscord<ambient> https://www.merriam-webster.com/dictionary/gotcha
10:57:30*jmdaemon quit (Ping timeout: 276 seconds)
10:58:06*duuude quit (Ping timeout: 252 seconds)
10:58:22PMunch@ambient, that is gotcha the noun. It comes from "I got you!"
10:58:48PMunchNot sure how widespread the usage of gotcha as a verb is, but I understood what you meant anyways
10:59:39PMunchAccording to the three comments on that page this is at least fairly common
11:00:28PMunchThe Cambridge dictionary has both definitions: https://dictionary.cambridge.org/dictionary/english/gotcha
11:06:34*jjido joined #nim
11:21:07*ttkap quit (Ping timeout: 240 seconds)
11:22:13NimEventerNew Nimble package! blarg - A basic little argument parser, see https://github.com/squattingmonk/blarg
11:42:17*ttkap joined #nim
11:43:11FromDiscord<ambient> sent a code paste, see https://paste.rs/ti0
11:51:30*Gustavo6046 joined #nim
11:52:25*wallabra quit (Ping timeout: 248 seconds)
11:52:28*Gustavo6046 is now known as wallabra
11:57:23PMunchHmm, so apparently when dynamically linking the ELF format will create data pages for the symbols it expects to load etc. So the ELF binary is just full of nulls that get mmapped into memory before being filled in.
12:15:54FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3XAm
12:16:47FromDiscord<mratsim> and there is one that is optimized here: https://github.com/SciNim/impulse/blob/master/impulse/fft/pocketfft.nim#L300-L339=
12:16:58FromDiscord<mratsim> (edit) "https://github.com/SciNim/impulse/blob/master/impulse/fft/pocketfft.nim#L300-L339=" => "https://github.com/SciNim/impulse/blob/master/impulse/fft/pocketfft.nim#L300-L339, it's framework agnostic"
12:18:11*duuude joined #nim
12:19:38FromDiscord<ambient> I wish I knew about scim a week ago 🥲
12:22:18NimEventerNew Nimble package! limiter - A simple to use HTTP rate limiting library to limit any action during a specific period of time., see https://github.com/supranim/limiter
12:24:13FromDiscord<Stuffe> which variable type declaration matches this argument type `openarray[tuple[key, value: string]]`?
12:24:33FromDiscord<Stuffe> I tried `seq` but it didn't work https://media.discordapp.net/attachments/371759389889003532/974285953919230032/Screen_Shot_2022-05-12_at_19.24.29.png
12:25:20FromDiscord<Yardanico> In reply to @Stuffe "which variable type declaration": you can't declare this as a type directly, but openArray accepts seqs and arrays
12:25:30FromDiscord<Stuffe> i know
12:25:48FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XAq
12:25:56FromDiscord<Stuffe> i want to declare an empty one
12:26:09FromDiscord<Stuffe> is there a way to do that?
12:26:18FromDiscord<Yardanico> specifically for httpclient or something else?
12:26:23FromDiscord<Stuffe> actually I want the type for a struct
12:26:38FromDiscord<Yardanico> httpclient just uses https://nim-lang.org/docs/httpcore.html#HttpHeaders
12:26:49FromDiscord<Stuffe> i am using jester though
12:27:08FromDiscord<Yardanico> it is using HttpHeaders as well
12:27:29FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/974286694423609354/unknown.png
12:27:37FromDiscord<Stuffe> ok well that doesn't help
12:27:49FromDiscord<Yardanico> but generally you can probably store the values as `seq[tuple[key, val: string]]` and pass them, but not really efficient
12:28:06FromDiscord<Yardanico> isn't it better to create some base headers once without having to create them each time
12:28:19FromDiscord<Yardanico> i just don't know your usecase
12:28:21FromDiscord<Stuffe> i want to put it in a struct though
12:28:28FromDiscord<Yardanico> In reply to @Stuffe "i want to put": yes, but why you can't put headers in a struct?
12:28:32FromDiscord<Yardanico> `HttpHeaders` i mean
12:28:44FromDiscord<Stuffe> the struct definition needs a type
12:28:47FromDiscord<Yardanico> sorry for asking so much, but i'm just confused
12:28:51FromDiscord<Yardanico> In reply to @Stuffe "the struct definition needs": that is a type
12:28:53FromDiscord<Yardanico> from httpcore
12:29:01FromDiscord<Stuffe> ok let me try
12:29:15FromDiscord<Yardanico> and jester even exports httpcore so you already have access to `HttpHeaders` if you use jester
12:31:57FromDiscord<Stuffe> how do I assign values to this data type?
12:32:01*rockcavera joined #nim
12:32:02*rockcavera quit (Changing host)
12:32:02*rockcavera joined #nim
12:32:05FromDiscord<Stuffe> I tried req.headers["Content-Disposition"] = @["attachment"]
12:32:11FromDiscord<Stuffe> (edit) "req.headers["Content-Disposition"]" => "`req.headers ["Content-Disposition"]" | "@["attachment"]" => "@["attachment"]`"
12:32:30FromDiscord<Yardanico> yes that should work
12:32:35FromDiscord<Yardanico> https://nim-lang.org/docs/httpcore.html#%5B%5D%3D%2CHttpHeaders%2Cstring%2Cseq%5Bstring%5D
12:32:51FromDiscord<Stuffe> well it gives me an error
12:32:58FromDiscord<Yardanico> what error?
12:33:20FromDiscord<Stuffe> ah ok after importing httpcore it worked
12:33:33FromDiscord<Stuffe> thanks
12:36:55FromDiscord<Stuffe> actually it doesn't work in this case
12:37:04FromDiscord<Stuffe> https://media.discordapp.net/attachments/371759389889003532/974289104692985866/Screen_Shot_2022-05-12_at_19.37.00.png
12:39:17FromDiscord<Stuffe> it makes me a bit of a sad panda that argument types descriptions don't match with identifier declaration type descriptions
12:39:33FromDiscord<Stuffe> would make things easier for a lot of people i am sure
12:39:36FromDiscord<Yardanico> In reply to @Stuffe "": oh well, that's why I asked the usecase :)
12:39:44FromDiscord<Yardanico> In reply to @Stuffe "would make things easier": structural equivalence would be quite bad for normal tuples IMO
12:39:47FromDiscord<Yardanico> nim already has it for tuples
12:39:54FromDiscord<Zoom> Can you pass more than one code block to a template? I need a macro If I want to access them by names, right?
12:40:00FromDiscord<Yardanico> so yeah, in this case if you need it for `resp`, just store it as a seq[tuple[key, val: string]]
12:40:17FromDiscord<Stuffe> but thats the whole issue the whole time
12:40:21FromDiscord<Stuffe> that I need the type for that
12:41:03FromDiscord<Stuffe> I want to put this in a struct so I need the exact type
12:41:26FromDiscord<Stuffe> what is the type that works was my question the whole time
12:41:28FromDiscord<demotomohiro> @Zoom https://internet-of-tomohiro.netlify.app/nim/faq.en.html#template-how-to-pass-multiple-code-blocks-to-a-templateqmark
12:41:38FromDiscord<Yardanico> In reply to @Stuffe "I want to put": again
12:41:40FromDiscord<Yardanico> `seq[tuple[key, val: string]]`
12:41:42FromDiscord<Yardanico> is the exact type
12:41:46FromDiscord<Yardanico> :D
12:42:00FromDiscord<Yardanico> sequence of tuples consisting of two fields - key and val, both being strings
12:42:13FromDiscord<Yardanico> `openArray` accepts both arrays and sequences of the underlying type
12:42:18FromDiscord<Stuffe> In reply to @Stuffe "": but I tried that and it doesn't work
12:42:24FromDiscord<Stuffe> i tried that before asking here
12:42:32FromDiscord<Stuffe> i understand how`openArray works
12:42:38FromDiscord<Stuffe> (edit) "how`openArray" => "how openArray"
12:43:14FromDiscord<Zoom> Thanks, the trouble with that is that branches are unnamed on the call site \:(↵(@demotomohiro)
12:43:26FromDiscord<Stuffe> sorry my screenshot didn't show the full error message
12:43:48FromDiscord<ambient> @mratsim looks like pocketFFT is only 2x fast as my pure Nim implementation, and only 1.5x fast if set to imprecise https://gist.github.com/amb/4f70bcbea897024452d683b40d18be1f
12:46:20FromDiscord<Yardanico> @Stuffe maybe you didn't check the proc signature for that `resp` overload?
12:46:23FromDiscord<Yardanico> it's supposed to be used like this:
12:46:29FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XAu
12:46:46FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/974291544825806848/unknown.png
12:46:47FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/974291548659404890/unknown.png
12:47:39FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/974291766419271710/unknown.png
12:47:46*noeontheend joined #nim
12:48:15FromDiscord<Yardanico> or if you want to reorder it or specify argument names: `resp(content = "body", code = Http200, headers = x.headers)`
12:49:40FromDiscord<Yardanico> jester doesn't have any other `resp` overloads with `headers` so you must always provide a response code for this one
12:51:57NimEventerNew thread by Mildred: Interoperable stream type, see https://forum.nim-lang.org/t/9153
12:52:08*noeontheend quit (Ping timeout: 260 seconds)
12:55:00FromDiscord<mratsim> sent a long message, see http://ix.io/3XAx
12:58:19NimEventerNew Nimble package! supranim - A fast Hyper Server & Web Framework, see https://github.com/supranim/supranim
12:58:54FromDiscord<ambient> sent a code paste, see https://play.nim-lang.org/#ix=3XAy
12:59:19FromDiscord<mratsim> Though I was too busy to continue it, these day I'm doing BigInt FFT (https://github.com/mratsim/constantine/blob/master/research/kzg_poly_commit/fft_fr.nim) and Elliptic Curve FFT (https://github.com/mratsim/constantine/blob/master/research/kzg_poly_commit/fft_g1.nim)
13:15:27*duuude quit (Ping timeout: 260 seconds)
13:32:16*duuude joined #nim
13:41:39*rockcavera quit (Remote host closed the connection)
13:45:04*thadeudepaula quit (Quit: WeeChat 3.4)
13:54:51FromDiscord<Yardanico> enter
14:00:39*PMunch quit (Quit: Leaving)
14:03:14*rejt8 joined #nim
14:04:50*rejt8 quit (Quit: WeeChat 3.4)
14:07:05*rejt8 joined #nim
14:18:42FromDiscord<mratsim> select
14:20:33FromDiscord<Zoom> DROP TABLE
14:24:34*rejt8 is now known as voidg8
14:24:49*voidg8 quit (Quit: WeeChat 3.4)
14:27:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:30:08*hellstabber joined #nim
14:31:01*vicfred quit (Quit: Leaving)
14:38:42FromDiscord<Alea> bobby tables is such a good boy :EmotiPleased:
14:43:12FromDiscord<tandy> `var lShuffled = l` is this a deep copy for a `seq[int]`?
14:43:58FromDiscord<Rika> Sequences are copied yes
14:45:36FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=3XAT
14:45:51*arkurious joined #nim
14:48:19FromDiscord<Rika> Are tensors deep copied? I am not sure
14:48:25*hellstabber quit (Quit: Textual IRC Client: www.textualapp.com)
14:50:11FromDiscord<huantian> Ig it depends on if they’re ref objects somewhere internally?
14:54:41*hellstabber joined #nim
14:55:31*hellstabber quit (Client Quit)
14:55:41*hellstabber joined #nim
14:58:15FromDiscord<Bubblie> In reply to @Elegantbeef "`../` is not parsed": Hey beef should I possibly try to make a fix for this import issue in a pr?
15:02:05FromDiscord<Bubblie> I dont think it would be too hard to fix, hopefully
15:07:45FromDiscord<Bubblie> Where are imports and paths handled in nim?
15:13:16FromDiscord<tandy> clone is a deep copy i think↵(@Rika)
15:19:53FromDiscord<mratsim> In reply to @tandy "any clue as to": `lShuffled[i] = l[idx]`↵↵This is suspect since they use the same buffer
15:20:17FromDiscord<mratsim> `lShuffled = l`
15:31:49FromDiscord<spoon> anyone with nimlsp working on coc.nvim?
15:45:00FromDiscord<Prestige> I am @spoon
15:46:05FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3XBg
15:47:04FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=3XBh
15:47:19FromDiscord<Prestige> I have nimlsp built locally so I just point to the binary
15:47:29FromDiscord<Prestige> the verbose isn't actually needed unless you're debugging
15:48:26FromDiscord<spoon> what's the command to get the output again?
15:48:29FromDiscord<Prestige> Then I have `autocmd BufNewFile,BufRead .nim, set filetype=nim` in my `init.vim`
15:48:47FromDiscord<spoon> ah
15:48:50FromDiscord<Prestige> You mean `CocInfo` ?
15:48:56FromDiscord<Prestige> (edit) "`CocInfo`" => "`:CocInfo`"
15:49:24FromDiscord<spoon> there was some command i used that had some error launching the server
15:49:30FromDiscord<spoon> i'll try modifying my init.vim
15:50:10FromDiscord<spoon> `[coc.nvim] Server languageserver.nim failed to start: Launching server "languageserver.nim" using command nimlsp failed.`
15:50:15FromDiscord<spoon> that's the error
15:50:25FromDiscord<spoon> nimlsp is on my path
15:50:56FromDiscord<spoon> (also this is on my windows pc if that means anything)
15:51:20FromDiscord<Prestige> Maybe look at https://github.com/neoclide/coc.nvim/wiki/Debug-language-server
15:54:15FromDiscord<Prestige> It looks like CI failed for windows builds, 3 days ago. I wonder if that's related. What nimlsp version are you on?
15:54:59FromDiscord<spoon> `[Error - 10:52:40 AM] spawn nimlsp ENOENT`
15:55:01FromDiscord<spoon> hm
15:55:19FromDiscord<spoon> should be on the latest release branch
15:55:36FromDiscord<Prestige> https://github.com/PMunch/nimlsp/issues/121
15:55:41FromDiscord<Prestige> This may be the problem
15:55:46FromDiscord<spoon> nimlsp was working with kate
15:56:09FromDiscord<Prestige> oh? Interesting..
16:14:21FromDiscord<Prestige> Is there a way for a macro to take a static varargs[typedesc] or something similar?
16:18:12FromDiscord<tandy> i think you are right, i tried this and it seems to work ` lShuffled, shuffledIndices = toSeq(0..l.shape[0]-1)`↵(@mratsim)
16:22:33NimEventerNew Nimble package! smoothing - Smoothing functions for Regression and Density Estimation, see https://github.com/paulnorrie/smoothing
16:22:33NimEventerNew Nimble package! leopard - Nim wrapper for Leopard-RS: a fast library for Reed-Solomon erasure correction coding, see https://github.com/status-im/nim-leopard
16:37:34FromDiscord<root> Hello!
16:37:55FromDiscord<Rika> Hello
16:38:15FromDiscord<root> This is a really random question, but does nim happen to support python libraries?
16:38:25*vicfred joined #nim
16:42:46FromDiscord<Rika> Making or using?
16:42:50FromDiscord<Rika> I believe not using?
16:42:57FromDiscord<Rika> “Nimpy” for making
16:42:58FromDiscord<demotomohiro> https://github.com/yglukhov/nimpy
16:43:15FromDiscord<Rika> Oh it can use
16:43:18FromDiscord<Rika> Cool
16:43:24*slowButPresent joined #nim
16:45:18*slowButPresent quit (Client Quit)
16:46:13FromDiscord<demotomohiro> There are Nim libraries to use Nim module from Python:↵https://github.com/Pebaz/nimporter↵https://github.com/treeform/genny
16:47:02FromDiscord<Yardanico> In reply to @demotomohiro "There are Nim": nimporter isn't really relevant, it's just a wrapper over nimpy to automate building nim extensions
16:47:31FromDiscord<Yardanico> genny is relevant, yes, but it's more for generating bindings for existing projects
16:52:50FromDiscord<root> Thank you for the help!
17:12:12*pch quit (Ping timeout: 240 seconds)
17:14:39*pch joined #nim
17:16:27*noeontheend joined #nim
17:17:34*slowButPresent joined #nim
17:17:45*slowButPresent quit (Changing host)
17:17:45*slowButPresent joined #nim
17:19:26*arkt8 joined #nim
17:21:03*arkt8 quit (Quit: WeeChat 3.4)
17:21:49FromDiscord<Yardanico> overflow
17:22:26*rejt8 joined #nim
17:22:46*rejt8 left #nim (#nim)
17:23:39*pro joined #nim
17:24:23*jjido joined #nim
17:27:32FromDiscord<ambient> what kind of alignment guarantees should I expect from Tensor[Complex[float]]? can I just cast it to a float64 array with 4 times the length and manipulate it directly or are there some things I should be aware of? also should I manually set the alignment with {.align(32).} if I want to use AVX instructions on Tensors?
17:28:01FromDiscord<ambient> is the internal memory representation of 1D Tensor[T] the same as seq[T]?
17:28:36FromDiscord<ambient> 🤯
17:31:20*pro quit (Quit: pro)
17:33:35reversem3[m]trying to create docs for karax using nim doc , now I can use a for loop and create all the docs but is there a tool which will create in index page first ?
17:34:04*arkt8 joined #nim
17:34:06reversem3[m]Otherwise I have lots of html pages but no starting point to reference
17:36:12*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:38:01*arkt8 quit (Client Quit)
17:39:37FromDiscord<geekrelief> How can I find out version of C++ does nim generate with cpp?
17:39:57FromDiscord<ambient> answering to myself https://scinim.github.io/getting-started/basics/common_datatypes.html seems to indicate that seq and Tensor indeed have the same internal memory representation
17:41:39FromDiscord<Yardanico> In reply to @ambient "answering to myself https://scinim.github.io/gettin": doesn't look like it - "Under the hood the data is stored as a pointer + length pair for types that can be copied using copyMem (Nim's memcpy). Otherwise it contains a seq[T] for the data."
17:41:50FromDiscord<Yardanico> seqs have a bit of different layout if we were to talk about actual internal representation
17:42:10FromDiscord<ambient> I'm mainly talking about 1D Tensor vs seq, multidimensionals are obviously different indexing scheme
17:42:32FromDiscord<Yardanico> i mean if you just do .addr then it'll work
17:42:37FromDiscord<Yardanico> but just casting the seq itself won't work
17:42:46FromDiscord<Yardanico> like `elem[0].addr` I mean
17:42:52FromDiscord<ambient> I'm not sure I understand the difference
17:42:54FromDiscord<Yardanico> that will work, but `elem.addr` won't work the way you want
17:43:00FromDiscord<Yardanico> In reply to @ambient "I'm not sure I": nim seqs have an internal structure
17:43:08FromDiscord<Yardanico> of len, cap, and pointer to data
17:43:13FromDiscord<Yardanico> it also differs a bit between refc and arc
17:43:20FromDiscord<Yardanico> cap = capacity
17:43:43FromDiscord<ambient> yeah the capacity is not the same as the items most of the time
17:44:07FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3XBD
17:45:19FromDiscord<Yardanico> and for refc it's a pointer to object of len, cap and data
17:45:23FromDiscord<root> This language is sick
17:45:28FromDiscord<Yardanico> you can easily see that if you do `sizeof` with both refc and arc
17:45:31FromDiscord<root> Why is it not more popular?
17:45:31*duuude quit (Ping timeout: 252 seconds)
17:45:48FromDiscord<ambient> nerds like to code, instead of talk
17:45:57FromDiscord<root> Wym
17:46:06FromDiscord<ambient> (i have no clue)
17:46:18FromDiscord<root> Ok
17:46:28FromDiscord<root> And it compiles to C, c++, and js???
17:46:39FromDiscord<root> It should be an industry standard tbh
17:47:34FromDiscord<demotomohiro> There are C standard and C++ standard.
17:47:36*duuude joined #nim
17:47:50FromDiscord<ambient> well from my perspective, the first I heard of Rust, I was frontloaded with all kinds of evangelism talking points. With Nim it's just "It's kind of like Python, but compiles into C"
17:48:09FromDiscord<root> True
17:48:35FromDiscord<demotomohiro> This is why Nim generates C code: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#language-design-why-nim-transepile-to-cqmark
17:49:30FromDiscord<root> Are there any easy libraries for making gui in nim?
17:49:56FromDiscord<root> I mainly make desktop tools
17:50:02FromDiscord<ambient> I think there are no easy libraries for making GUI in any language, unless you fire up Godot engine
17:50:12FromDiscord<root> Ok
17:50:28FromDiscord<root> How do I specify which Lang I want nim to compile to?
17:50:36FromDiscord<resumin> sent a long message, see http://ix.io/3XBF
17:50:53FromDiscord<Yardanico> In reply to @root "How do I specify": `c` actually means both "compile" and "compile to c" at the same time
17:50:56FromDiscord<federico3> @demotomohiro\: you might want to improve https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ
17:51:03FromDiscord<Yardanico> so you traditionally can just do `nim cpp` or `nim js` to compile to others
17:51:14FromDiscord<ambient> https://github.com/marcomq/nimview looks pretty neat, hopefully will have time at some point to look into
17:51:17FromDiscord<Yardanico> there's also a new way (although I personally don't use it), like `nim c --backend:cpp`
17:51:38FromDiscord<Yardanico> but yeah, there are a lot of GUI options, webviews, native ones (even fully written in Nim), imgui, tons of bindings
17:51:54FromDiscord<Yardanico> but there's no 1 "flagship" UI library that everyone will say "yeah, you should use this specifically for Nim"
17:52:04FromDiscord<Yardanico> all have their own advantages and disadvantages
17:52:09FromDiscord<root> Ok
17:53:07FromDiscord<root> How hard is nim/c programs to crack?
17:53:12*arkt8 joined #nim
17:53:25FromDiscord<Yardanico> define "crack"
17:53:29FromDiscord<Yardanico> and "hard" compared to what?
17:53:31FromDiscord<root> Unpack
17:53:34FromDiscord<Yardanico> ??
17:53:38FromDiscord<ambient> well there's no sprintf unless you absolutely want to have it
17:53:40FromDiscord<Yardanico> you can't "unpack" them, they're native code
17:53:41FromDiscord<root> In reply to @Yardanico "and "hard" compared to": Compared to python
17:53:48FromDiscord<Yardanico> In reply to @root "Compared to python": much more harder
17:53:59FromDiscord<root> Ok
17:54:15FromDiscord<Yardanico> because for nim/c/etc you actually have to reverse engineer the binary by disassembling, and for python you can easily turn the bytecode back into the source close to the original
17:54:28FromDiscord<root> Ok
17:54:33FromDiscord<root> Thanks for the help
17:54:39FromDiscord<Yardanico> In reply to @root "Ok": btw, it'd be a bit nicer if you can react to messages with thumbs up or something instead of saying "ok" every time to not fill the chat :)
17:55:10*rockcavera joined #nim
17:55:11*rockcavera quit (Changing host)
17:55:11*rockcavera joined #nim
17:55:30FromDiscord<ambient> I don't even know how to syntax highlight stuff in Discord
17:55:43FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=
17:56:04FromDiscord<Prestige> sent a code paste, see https://play.nim-lang.org/#ix=3XBI
17:56:11FromDiscord<Yardanico> yeah, just markdown code blocks
17:59:02*arkt8 left #nim (#nim)
18:03:12*Zectbumo joined #nim
18:08:50*kenran joined #nim
18:16:44*slowButPresent quit (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
18:17:43*arkt8 joined #nim
18:33:24*stkrdknmibalz joined #nim
18:34:59FromDiscord<exelotl> @reversem3 the following worked for me: `nim doc --project --index:on --git.url:https://github.com/exelotl/natu --git.commit:devel --outdir:docs natu/docs.nim`
18:35:44FromDiscord<exelotl> where docs.nim is a file that imports every module I want to document
18:58:16*noeontheend quit (Ping timeout: 246 seconds)
19:00:37*Zectbumo quit (Read error: Connection reset by peer)
19:11:32*duuude quit (Ping timeout: 260 seconds)
19:15:12reversem3[m]I have been looking into `nim doc` and trying to explain in a human way this very simple proc and what it means
19:15:46*reversem3[m] uploaded an image: (240KiB) < https://libera.ems.host/_matrix/media/r0/download/matrix.org/BnShvZeKpVFINuvyprccXwme/image.png >
19:15:49reversem3[m]Here is a screenshot of what it looks like :
19:16:57reversem3[m]I think nim doc is an excellent tool , but the wording and examples have to be clear
19:17:45reversem3[m]Can anyone see what this could explain better ?
19:20:11reversem3[m] * Can anyone see , how this could be explained better?
19:26:49*duuude joined #nim
19:34:24*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP ([email protected]), or my Discord (Gustavo6046#9009), or possibly my Mastodon [email protected]), or email ([email protected]).)
19:47:23*wallabra joined #nim
19:52:44FromDiscord<Toromino> Why does sqlite raise that error upon creating a table? https://media.discordapp.net/attachments/371759389889003532/974398739395543100/unknown.png
19:54:40*noeontheend joined #nim
19:58:23FromDiscord<Prestige> That's a funny error message
19:58:26FromDiscord<Prestige> Can you show the code?
19:58:50*noeontheend quit (Ping timeout: 240 seconds)
19:59:30FromDiscord<Toromino> sent a code paste, see https://play.nim-lang.org/#ix=3XCe
20:00:42FromDiscord<Toromino> (edit) "https://play.nim-lang.org/#ix=3XCe" => "https://play.nim-lang.org/#ix=3XCh"
20:00:53FromDiscord<Toromino> In reply to @Avahe "That's a funny error": Even weirder is that it only crashes upon creating the database. After it is created I can interact with it just fine.
20:01:17FromDiscord<Toromino> (edit) "In reply to @Avahe "That's a funny error": Even weirder is that it only crashes upon creating the database. After it is created I can ... interactthe" added "start the program again and" | "it" => "the database"
20:12:36*kayabaNerve quit (Ping timeout: 276 seconds)
20:20:22*slowButPresent joined #nim
20:27:54*kayabaNerve joined #nim
20:36:27*kayabaNerve quit (Ping timeout: 260 seconds)
20:40:35FromDiscord<!Patitotective> In reply to @root "Are there any easy": https://github.com/nimgl/imgui 😎
20:40:56FromDiscord<!Patitotective> and for an example https://github.com/Patitotective/ImTemplate
20:41:18FromDiscord<!Patitotective> In reply to @demotomohiro "This is why Nim": damn raw html
20:52:52FromDiscord<ambient> @!Patitotective nice job. Good, more complex examples than hello world for Nim GUI dev is sorely needed
20:53:38FromDiscord<!Patitotective> im currently working on the 7GUIs tasks for ImTemplate v2.0↵https://eugenkiss.github.io/7guis/tasks
20:55:47reversem3[m]how do you convert a string to a float
20:56:07FromDiscord<!Patitotective> https://nim-lang.org/docs/strutils.html#parseFloat%2Cstring ?
21:00:05reversem3[m]perfect thanks
21:01:10*kayabaNerve joined #nim
21:01:17*vicecea quit (Remote host closed the connection)
21:01:34*kayabaNerve quit (Remote host closed the connection)
21:01:47*vicecea joined #nim
21:12:11reversem3[m]How do I make this work with strings echo("Your temperature is: ", degree_in_fahrenheit in Fahrenheit and FahToCel(x).floor, "in Celsius")
21:12:57reversem3[m]It should say "Your temperature is: 100 in fahrenheit and -13.0 in celcius
21:14:00reversem3[m]nm I got it now
21:18:34FromDiscord<Elegantbeef> Yea it's not great, might need an RFC or similar to get some progress on that.
21:26:02FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3XCE
21:26:41FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3XCE" => "https://play.nim-lang.org/#ix=3XCF"
21:27:02FromDiscord<!Patitotective> (edit) "https://paste.rs/yib" => "https://play.nim-lang.org/#ix=3XCG"
21:27:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XCH
21:27:58FromDiscord<!Patitotective> wouldnt it be cooler to support `a, b = 2`?
21:28:08FromDiscord<!Patitotective> or is there some conflict
21:28:09FromDiscord<!Patitotective> (edit) "conflict" => "conflict?"
21:28:23FromDiscord<Elegantbeef> Personally i think joined assignment is dumb
21:28:41FromDiscord<!Patitotective> but for lazy persons
21:29:04FromDiscord<Elegantbeef> If you're going to write code lazily dont let me see it
21:29:29FromDiscord<!Patitotective> :[
21:30:00Amun-Raa, b = 2 looks like tuple unpacking went bad
21:30:21FromDiscord<!Patitotective> they're not even tuples, are they?
21:30:42Amun-Ra2 for sure isn't ;>
21:30:55FromDiscord<Elegantbeef> Well `(a, b) =` makes a L-value tuple
21:31:27FromDiscord<!Patitotective> what proc is called when `(a, b) = (1, 2)`
21:31:29FromDiscord<!Patitotective> (edit) "2)`" => "2)`?"
21:31:47FromDiscord<Elegantbeef> No proc is called
21:32:06FromDiscord<Elegantbeef> It's an assignment of an L-value tuple to the right hand
21:32:24FromDiscord<!Patitotective> sad
21:40:46FromDiscord<luteva> sent a long message, see http://ix.io/3XCL
21:41:07FromDiscord<Elegantbeef> leftout `proc`
21:42:10FromDiscord<luteva> is "proc" necessary, here?
21:42:17FromDiscord<Elegantbeef> Yes
21:42:33FromDiscord<Elegantbeef> I didnt say it for giggles 😛
21:42:50*kenran quit (Quit: WeeChat info:version)
21:43:28FromDiscord<luteva> so i can either write proc ... or use the concept x ..... notation? but cannot use concept without x and without proc?
21:43:42FromDiscord<Elegantbeef> Exactly new concepts are lacking features
21:43:55FromDiscord<luteva> ok thanks!
21:44:01FromDiscord<Zoom> @sekao\: Hey Zach, what are your goals with the illwill fork?
21:44:01reversem3[m]Is it possible to readLine multiple strings , 1 at a time? and then process them ?
21:44:29FromDiscord<Rika> In reply to @reversem3 "Is it possible to": What does that mean? As in each string is a “line”?
21:44:32reversem3[m]for instance I was to get the dimensions of a box but I want the user to input three values
21:45:18FromDiscord<Rika> Oh you mean to “intake” three or whatever amount of lines at a time in a loop?
21:45:28reversem3[m]then take the three values and then calculate them , or do I need to read in 1 value per time
21:45:49reversem3[m]yeah I supposed it would have to be a while loop then huh ?
21:45:57FromDiscord<Rika> With read line and if your values are per line then you have to do it one at a time
21:46:21FromDiscord<Rika> If you put the three values in the same line then it’s no problem
21:47:02reversem3[m]would that be a seq then ?
21:47:29FromDiscord<Rika> No it would just be a single string, you’d still have to parse the values out somehow
21:48:05reversem3[m]ok so either way it would have to be one string at a time
22:02:12*tk quit (Quit: Well, this is unexpected.)
22:03:15FromDiscord<federico3> what's the best way to parse a nim file and extract proc definitions?
22:04:11FromDiscord<Elegantbeef> Depends where you are
22:04:40FromDiscord<Elegantbeef> If you're in compilation you can load the file into memory and usue `parseStmt`/`parseExpr`
22:04:41FromDiscord<Elegantbeef> Otherwise you may want to look at the NimVm and use it to parse for you so you can expand macros and the like
22:04:57*tk joined #nim
22:06:25FromDiscord<federico3> thanks. I was looking for parse-\ but parseExpr is not listed in https://nim-lang.github.io/fusion/theindex.html
22:06:28*caliente22 quit (Ping timeout: 248 seconds)
22:08:06FromDiscord<j-james> concepts pretty much eclipse range types, right?
22:08:23FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=3XCU
22:08:37FromDiscord<Rika> One is simpler and probably less bug free due to that
22:09:39FromDiscord<Recruit_main707> but ideally yes
22:10:25FromDiscord<sekao> In reply to @Zoom "<@610133894120865803>\: Hey Zach, what": i added truecolor support and currently working on a feature to allow working with subsets of a terminal buffer (called "slices" for now) using relative coords. important for making reusable TUI components.
22:10:25FromDiscord<Rika> In an ideal world lol
22:11:16FromDiscord<Elegantbeef> Well concepts are statically reasoned so you cannot use a concept to represent runtime logic
22:11:47FromDiscord<Elegantbeef> Range types inject range checking so you cannot make it equivlent
22:12:19FromDiscord<Zoom> I like illwill but I'm a bit worried about the amount of global vars and overall structure. Do you plan any general refactoring?↵(@sekao)
22:12:33FromDiscord<Zoom> The first thing which comes to mind is to separate keyboard handling part
22:12:42FromDiscord<Elegantbeef> TIL Zach responds to pings here
22:12:49FromDiscord<Rika> Who
22:12:58*jjido joined #nim
22:13:08FromDiscord<Elegantbeef> The author of paravim and the like
22:13:17FromDiscord<Zoom> Even better to make it a separate lib, I think. Wdyt?
22:13:17FromDiscord<Elegantbeef> I mean vimcubed the most important human invention
22:13:21FromDiscord<Rika> Scary, why do you know his first name
22:13:32FromDiscord<Elegantbeef> Cause he's made many videos about his stuffs
22:13:45FromDiscord<Elegantbeef> and zach is easier to write then sekao
22:13:49FromDiscord<Rika> Okay
22:13:56FromDiscord<sekao> In reply to @Zoom "I like illwill but": yeah i already removed some globals
22:14:12FromDiscord<Zoom> There's such a thing as NimConf for starters...↵(@Rika)
22:14:49FromDiscord<sekao> In reply to @Elegantbeef "*TIL Zach responds to": that was my first message on here 😛 i didnt realize this place existed
22:15:20FromDiscord<Elegantbeef> Lol welcome
22:15:28FromDiscord<exelotl> In reply to @federico3 "what's the best way": I'm working on a dumb python script that does this, to use with Sphinx. I hope to have it finished next week sometime
22:15:29FromDiscord<Elegantbeef> This is where i write all my inane rambling
22:15:30FromDiscord<Zoom> How come I just tab-completed you then? \:D
22:15:43FromDiscord<Elegantbeef> Exelotl doing more work
22:16:06FromDiscord<exelotl> xP
22:16:08FromDiscord<Rika> Beef what do you think about wrapping registers in pico lib?
22:16:29FromDiscord<Elegantbeef> Rika i have like -10 iq when it comes to that
22:16:31FromDiscord<Rika> I just got in a situation where I need to anyway so I will, but I wanna see if you’d like it
22:16:38FromDiscord<Rika> Okay I’ll look into it
22:16:42FromDiscord<Elegantbeef> Well when it comes to most things
22:16:55FromDiscord<Elegantbeef> I'm like the worst person to be the maintainer of picostdlib
22:17:17FromDiscord<Rika> Because you ain’t interested in embedded programming or because you just don’t know?
22:17:26FromDiscord<Rika> Or is it a time thing I don’t know
22:17:32FromDiscord<Elegantbeef> I'm interested but dont have much hard ware to actually play with it
22:17:44FromDiscord<Elegantbeef> So i dont actually learn anything about it
22:17:45FromDiscord<Elegantbeef> Or write any code in the space
22:18:01FromDiscord<Rika> Is it that hard to find a pico where you’re at? Or am I wrong in what I’m thinking about
22:18:21FromDiscord<Elegantbeef> I have a pico, i just dont have any of the other hardware like screens or i2c stuff
22:18:28FromDiscord<Rika> Oh okay
22:18:46FromDiscord<Rika> Then I’ll do some stuff since I have screens and LED matrices and whatnot
22:18:49FromDiscord<Elegantbeef> So when someone says X works i trust them, like martinx with the i2c stuff
22:19:27FromDiscord<ambient> i have like 100 stm32, someone just would have to solder them to pcbs
22:19:40FromDiscord<huantian> Where do you get that many lol
22:19:45FromDiscord<ambient> aliexpress
22:19:53FromDiscord<Rika> Damn did you do a production run of some product or something to have that many?
22:20:15FromDiscord<ambient> well they come in a roll and take very little space so i thought why not, there's always something I can put them in
22:20:15FromDiscord<exelotl> In reply to @Elegantbeef "Exelotl doing more work": I previously had some success extracting doc comments in nimscript using a typed macro that you invoke like `getDocs: include "foo.nim"`↵But you still have to do traversal logic and resort to manual parsing in some cases, and it only works with a subset of Nim code (even though the code doesn't run, it still has to be valid nimscript)
22:20:32FromDiscord<Rika> In reply to @ambient "well they come in": I see
22:20:32FromDiscord<exelotl> So I figured just parsing the files manually is better
22:20:39FromDiscord<ambient> but these days JLCPCB does assembly so it's kind of relic of the past
22:20:42FromDiscord<Rika> Let me see if I can get a role of pico chips hahaha
22:20:46FromDiscord<Rika> Roll
22:20:48FromDiscord<Rika> I can English
22:21:21FromDiscord<huantian> I wanna try using a pico on my next keeb but it’s gonna be a split and idk if they have firmware for it
22:21:42FromDiscord<Rika> Lol coincidentally I am writing keyboard firmware
22:21:44FromDiscord<ambient> keyboard firmware is super simple to write, as long as you already have a usb stack
22:21:55FromDiscord<Rika> I think PMunch has some already made but not for the pico
22:22:11FromDiscord<Rika> In reply to @ambient "keyboard firmware is super": Not if you’re being ambitious hahaha
22:22:12FromDiscord<ambient> bit banging USB is for the adventurous types
22:22:13FromDiscord<huantian> But then I have to account for likeee demultiplexers and oleds and stuff
22:22:18FromDiscord<Rika> But for the most part it’s simple yes
22:22:45FromDiscord<Rika> In reply to @ambient "bit banging USB is": Really easy on the pico since there are two coprocessors that can handle arbitrary IO protocols
22:22:45FromDiscord<Elegantbeef> Dont have to use nimscript
22:22:46FromDiscord<Elegantbeef> Yea i mean i you might be able to use other APIs to parse nim code, i could be wrong↵(@exelotl)
22:23:08FromDiscord<Rika> In reply to @huantian "But then I have": What’s the demux for?
22:23:09FromDiscord<Elegantbeef> Anyway dogs want to walk, so i guess ping rika if you're missing my sass
22:23:16FromDiscord<Rika> OLED screens are often just SPI no?
22:23:22FromDiscord<huantian> In reply to @Rika "What’s the demux for?": Yeah true
22:23:26FromDiscord<huantian> Wups
22:23:26FromDiscord<Rika> Rather the ones used on keyboard
22:23:42FromDiscord<huantian> It’s just for getting more pins for other stuff
22:23:48FromDiscord<huantian> Like the rotary encoder
22:23:48FromDiscord<ambient> most OLEDs I have are both SPI and i2c iirc
22:24:19FromDiscord<Rika> Ideally I’d use I2C since it’s less pins used lol not like a keyboard needs to display 60 fps content
22:24:48FromDiscord<Rika> In reply to @huantian "It’s just for getting": Demultiplexer for that? Don’t you just use either a shift register or an IO expander?
22:25:11FromDiscord<Rika> You can put the whole keyboard matrix on two shift registers and save a lot of pins that way hahaha
22:25:27FromDiscord<huantian> Huh ig you could
22:25:39FromDiscord<Rika> effectively two; they’d have to have enough bits to do all rows/columns
22:25:50FromDiscord<Rika> You can chain them anyway so yeah
22:31:52FromDiscord<ambient> I was sure there was some FPGA tools for Nim like nMigen but I must have been dreaming
22:33:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:34:38FromDiscord<luteva> sent a long message, see http://ix.io/3XCW
22:35:16FromDiscord<Prestige> I have a type want to essentially duplicate, but add more properties to it. Is the right thing to do just use `type Foo = object of Bar` or does that set up some other weird inheritance stuff along with it?
22:39:02*noeontheend joined #nim
22:41:30FromDiscord<Bubblie> Do any of you know where nim handles imports and import modules?
22:41:34FromDiscord<Bubblie> In the nim-lang repo
22:57:53*noeontheend quit (Ping timeout: 256 seconds)
22:58:00FromDiscord<Elegantbeef> @Prestige\: you can use inheritance and if you dont want type information do `type Foo {.pure, inheritable.} = object`
22:58:28FromDiscord<Elegantbeef> Or use concepts like a human
22:58:52FromDiscord<Elegantbeef> Concepts cannot be recursive↵(@luteva)
23:01:06*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP ([email protected]), or my Discord (Gustavo6046#9009), or possibly my Mastodon [email protected]), or email ([email protected]).)
23:01:48FromDiscord<luteva> In reply to @Elegantbeef "Concepts cannot be recursive": why not?↵I mean with the proc notation it works just fine! (that's what i just discovered and what a )
23:02:07FromDiscord<luteva> (edit) "a )" => "i am surprised about)"
23:02:14FromDiscord<Elegantbeef> The original concepts are done with compile statements so it's a recursive check that isnt logical
23:02:25FromDiscord<luteva> ok
23:02:54FromDiscord<Elegantbeef> Actually it might work
23:03:32FromDiscord<Elegantbeef> Never mind it's recursive 😄
23:03:42FromDiscord<luteva> so i have to use the 'proc' notation when i want to check for a proc that returns the type of a concept.
23:03:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XD0
23:04:08FromDiscord<Elegantbeef> Personally i dont really see the point in the returning the concept
23:07:32*wallabra joined #nim
23:12:55FromDiscord<!Patitotective> hmm, im having issues with new lines on windows, it seems they use `\x0D\x0A` instead of `\n` (?)↵so i was wondering if i should do `newLine <- '\n' | "\x0D\x0A"`??
23:13:34FromDiscord<Elegantbeef> Welcome to the world of line endings
23:14:19FromDiscord<Elegantbeef> Yes you should do `'\n'` and `\p`
23:14:21FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-string-literals
23:16:16FromDiscord<Prestige> Yeah I basically just wanted the same members of a type, plus some more
23:16:25FromDiscord<Prestige> I could just not be lazy and duplicate the code I suppose
23:16:42FromDiscord<Elegantbeef> Yea just use inheritance with pure
23:16:47FromDiscord<!Patitotective> In reply to @Elegantbeef "Yes you should do": nice and thanks :]
23:16:48FromDiscord<Elegantbeef> Sorry it's not `\p`
23:17:00FromDiscord<Elegantbeef> `\c\n` or `\n`
23:19:40FromDiscord<!Patitotective> shouldnt i just do `\p`? since its platform specific 🤔
23:19:43FromDiscord<!Patitotective> (edit) "🤔" => "🤨"
23:21:51FromDiscord<!Patitotective> actually `\p` or `\n` because people could use \n on windows
23:23:21FromDiscord<spoon> windows terminal
23:25:02FromDiscord<!Patitotective> In reply to @Elegantbeef "`\c\n` or `\n`": actually youve got reason↵its easier to just say that hehe
23:33:32FromDiscord<theangryepicbanana> is there a fast way to pop multiple items from a seq at once?
23:33:56FromDiscord<Elegantbeef> You want to make a new sequence with X number of elements?
23:34:22FromDiscord<theangryepicbanana> kinda, I'd like to pop the last N values of a seq and add it to another seq
23:35:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XD5
23:35:17FromDiscord<Elegantbeef> actually i think that'd be `(start, lengthOfSlice)`
23:35:44FromDiscord<theangryepicbanana> yeah I also have to wonder if there's a length-based slice operation as opposed to range-based
23:36:07FromDiscord<theangryepicbanana> but I suppose that could work for now
23:36:28FromDiscord<Elegantbeef> Well you can do `[a..b]` but that makes a new sequence
23:36:36FromDiscord<Elegantbeef> `toOpenArray` is the fastest slice operator
23:36:45FromDiscord<theangryepicbanana> hmm ok
23:40:56FromDiscord<luteva> sent a long message, see https://paste.rs/YtS
23:41:31FromDiscord<Elegantbeef> Why does `save(p)` return `p`
23:42:09FromDiscord<Elegantbeef> `save` should probably be like `proc saveTo(target: var SomeTarget, myType: T)`
23:42:36FromDiscord<luteva> because the object can be updated and maybe i have to use the new version of the object.
23:43:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3XD8
23:43:48FromDiscord<Elegantbeef> `type P` is the bound type of the concept being checked
23:44:02FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/43l
23:45:28FromDiscord<luteva> oh yes! that may help! thanks! I'llo try that.
23:45:40FromDiscord<luteva> (edit) "I'llo" => "I'll"
23:45:47FromDiscord<Elegantbeef> If the new concepts work for you you should use them
23:45:53FromDiscord<Elegantbeef> Otherwise go to the old ones
23:46:01FromDiscord<Elegantbeef> Though i personally default to the old ones since they're presently more capable
23:47:07FromDiscord<luteva> yes. i just also wanted to try out and understand how it would work in the older version... just learning 🙂
23:47:16FromDiscord<Elegantbeef> Ah ok
23:48:47FromDiscord<luteva> so, in the end, it was just the typeof(..) i was missing.
23:49:02FromDiscord<Elegantbeef> yes `a is b` needs the right hand to be a typedesc
23:49:07FromDiscord<Elegantbeef> the left hand works with a value or type
23:49:45FromDiscord<luteva> 👍
23:51:39FromDiscord<⎝⪩﹏⪨⎠> I managed to get just the compiler to work on Pop!_OS 22.04
23:52:00FromDiscord<Elegantbeef> Congrats!
23:52:00FromDiscord<⎝⪩﹏⪨⎠> And tried to install a VS Code extension for Nim.
23:52:04FromDiscord<⎝⪩﹏⪨⎠> But...
23:52:18FromDiscord<⎝⪩﹏⪨⎠> But I'm having some troubles.
23:52:57FromDiscord<⎝⪩﹏⪨⎠> I want to go and see the code I don't understand about Nim (like `echo` or `log2`), but the extension can't find the definitions.
23:53:04FromDiscord<⎝⪩﹏⪨⎠> And it used to work fine before.
23:53:14FromDiscord<Elegantbeef> Do you have nimsuggest in your path
23:53:16FromDiscord<⎝⪩﹏⪨⎠> Even in Windwos.
23:53:23FromDiscord<⎝⪩﹏⪨⎠> In reply to @Elegantbeef "Do you have nimsuggest": What's that?
23:53:40FromDiscord<⎝⪩﹏⪨⎠> More extra steps? Well, I can try them.
23:53:53FromDiscord<⎝⪩﹏⪨⎠> But I only have the compiler, nothing else.
23:53:58FromDiscord<Elegantbeef> does `nimsuggest` work?
23:53:58FromDiscord<⎝⪩﹏⪨⎠> No nimble or choosenim.
23:54:16FromDiscord<Elegantbeef> Well if you dont have nimsuggest then tooling will not work
23:54:19FromDiscord<⎝⪩﹏⪨⎠> Because choosenim buggy in Ubuntu 22.04-based distros.
23:54:47FromDiscord<Elegantbeef> You could try http://gitnim.com/ instead of choosenim
23:55:00FromDiscord<Elegantbeef> It's not commonly used but works well ime