<< 31-12-2021 >>

00:06:11FromDiscord<Isofruit> God
00:06:35FromDiscord<Isofruit> Effin dammit, I have a problem but I'm getting fairly obvious vibes I don't understand my problem, one minute
00:18:09FromDiscord<Isofruit> In reply to @Elegantbeef "The only issue is": First of all, thanks! That does work!↵So if I'm understanding this right, any overload I write for toJsonHook and fromJsonHook is automatically applied if they are imported?
00:18:24FromDiscord<Isofruit> (edit) "imported?" => "imported and a given datatype that needs to be serialized fits?"
00:27:58FromDiscord<konsumlamm> `setLen` (for `seq`s) guaranteed to initialize the new elements? the documentation doesn't mention anything about that, but i'd assume so?
00:28:06FromDiscord<konsumlamm> is
00:28:14PMunch@Isofruit, that's pretty much it, yes
00:28:35PMunch@konsumlamm, it initialises them to zero, like normal in Nim
00:36:57FromDiscord<konsumlamm> what is the expected behaviour for shifting a negative amount?
00:37:14FromDiscord<konsumlamm> i'm getting 0, or is this undefined/backend-dependent?
00:37:15PMunchLike shl -1?
00:37:18FromDiscord<konsumlamm> ye
00:37:49PMunchHmm, tbh I have no idea
00:39:27PMunchHmm, looks like it would be backend dependent
00:40:16PMunchIf you look in `compiler/ccgexprs.nim` at line 639 you can see the implementation for the shift left magic
00:41:24FromDiscord<konsumlamm> hmm k, so it's UB
00:41:30FromDiscord<konsumlamm> (with the C backend)
00:41:47PMunchAnd `compiler/jsgen.nim` for the JS backend
00:46:47FromDiscord<Isofruit> Head -> Desk
00:47:41FromDiscord<Isofruit> That moment when you realize your database stores Dates and Times as a string, but what `norm` believes you've got stored is a float... for some reason... no idea why. Are times stored in floats in some formats? I thought it was strings and integers?
00:48:19FromDiscord<Isofruit> (edit) "string," => "string (`"yyyy-MM-dd HH:mm:ss'.'ffffff"` format),"
00:48:27FromDiscord<Elegantbeef> unix float?
00:48:37PMunchfloats for seconds and sub-second precision in unix timestamps
00:49:38FromDiscord<Isofruit> Ah, the sub second precision is likely why norm assumes this, alright, now to figure out if norm has something that can deal with my format or whether I have to custom do sth
00:52:37*PMunch quit (Quit: leaving)
01:08:50FromDiscord<Isofruit> I have to do something custom and I also messed up around half a year ago when I updated a few things and by doing so introduced a set of entries that have a differing datetime-string-format (they don't have the milliseconds)
01:08:57FromDiscord<Isofruit> shoooooot meeeeee
01:13:59FromDiscord<mattrb> In reply to @Elegantbeef "Yea do update me": Looks like the `{.packed.}` pragma adds `packed` attribute in the generated c code `struct attribute((packed)) tyObject_DMACNT2cV7m9bJ6vy1I9c3lXofHjQsg`. Otherwise, it generates identical code. I don't know enough about c to tell why `packed` is required when every field defines a number of bits, though. Guess I need to look at the asm now lol
01:14:19FromDiscord<mattrb> Unless anyone happens to know this offhand :p
01:15:30FromDiscord<Isofruit> Semantics question:↵Norm does this ↵`func to(dbVal; T: typedesc[string]): T = dbVal.s`↵I have not ever yet seen a semicolon in between parameters (nor have I seen the keyword func yet for that matter but I assume that's just one of those dynamic dispatcher keywords and leave it at that), how can that compile?
01:18:11FromDiscord<Elegantbeef> That shouldnt compile
01:18:40FromDiscord<Elegantbeef> `;` in proc headers is the same as as comma but just more clear
01:18:58FromDiscord<Elegantbeef> `proc doThing(a: int, b: float)` == `proc doThing(a: int; b: float)`
01:19:18FromDiscord<Isofruit> I found some documents that I'm not sure are official , "https://docs.w3cub.com/nim/manual.html", they talk about that the `using` keyword might have sth to do with this
01:19:37FromDiscord<Elegantbeef> Ah yes they're using the using keyword then
01:19:46FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-using-statement
01:20:00FromDiscord<Elegantbeef> That's the official language manual the first is a weird thing
01:20:25FromDiscord<Isofruit> Ohhhhh
01:21:16FromDiscord<Isofruit> Man, got to say, I love the fact that this language is actually somewhat comprehensive to me, but man do I wish I had like 3 weeks off work to get more consecutive time that I could sink into this
01:34:17FromDiscord<Isofruit> Can you redefine an existing func from a library to get it to use your own func instead?
01:34:37FromDiscord<Elegantbeef> Only if it's defined in such a way using generics/templates
01:35:21FromDiscord<Isofruit> I might just be shit out of luck, this smells like a database migration that I'll have to do to make the db compatible with norm
01:37:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K8o
01:37:49FromDiscord<Elegantbeef> the comment should say "to only instantiate once"
01:38:02FromDiscord<Elegantbeef> Which basically means `doOtherThing` is only overridable once per type
01:38:37FromDiscord<Elegantbeef> But using a template will overide it for every call using the one in scopep
01:38:45FromDiscord<Elegantbeef> Doesnt help you one bit presently
01:39:07FromDiscord<Isofruit> Give me a second to check what's happening here, I haven't touched templating yet (I know the high-level concept, never actually used it)
01:39:54FromDiscord<Elegantbeef> The only special thing is the `mixin` statement which says "We will use any procedure at callsite when we call this template"
01:40:14FromDiscord<Elegantbeef> It forces the symbol to be open is the technical term
01:40:26FromDiscord<Isofruit> I'm perfectly fine to generally override it, effectively the way norm did it is wrong for my project so I wouldn't want "their" way of converting `DateTime` from database-value into `DateTime` to ever happen ever
01:41:03FromDiscord<Elegantbeef> Generally i just suggest to fork the repo when there are differences and possibly make a PR behind a flag
01:45:14*oisota joined #nim
01:45:33FromDiscord<Isofruit> I feel neither confident, nor competent enough for the PR strategy, particularly as I don't see a general solution to this one.↵There's at least dozens of ways you could store a datetime in your database and you can't really cover them all.↵The default behaviour they chose wasn't a bad one, just doesn't mesh well with how Django stores datetimes in sqlite by default
01:45:45FromDiscord<Isofruit> (edit) "I feel neither confident, nor competent enough for the PR strategy, particularly as I don't see a general solution to this one.↵There's at least dozens of ways you could store a datetime in your database and you can't really cover them all.↵The default behaviour they chose wasn't a bad one, just doesn't mesh well with how Django stores datetimes in sqlite by default ... " added "(That's how I initially created the databas
01:46:25FromDiscord<Elegantbeef> I have to look at the Norm API now to see
01:46:39FromDiscord<Isofruit> One sec, let me make your life easier
01:47:36FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3K8r
01:47:45FromDiscord<Isofruit> (edit)
01:48:21FromDiscord<Elegantbeef> Ah you want to see a cheat way to define your own type?
01:48:23FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3K8r" => "https://play.nim-lang.org/#ix=3K8s"
01:48:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=
01:48:34FromDiscord<Elegantbeef> Shit 😀
01:48:35FromDiscord<Isofruit> (edit) "https://play.nim-lang.org/#ix=3K8s" => "https://play.nim-lang.org/#ix=3K8r"
01:48:47FromDiscord<Elegantbeef> There we go
01:48:50FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K8t
01:49:07FromDiscord<Elegantbeef> Now just implement the above and use the `MyDateTime` whenever you'd use `DateTime` and you're golden
01:49:08FromDiscord<Isofruit> Nah, more like I want the DateTime type (I just defined how to convert that to json and possibly needs it utils down the line)
01:49:38FromDiscord<Elegantbeef> That's the point of the above it allows you to use your own procs instead of the Norm provided
01:49:48FromDiscord<Isofruit> ideally I'd have a type that is only distinct for norm, but that would allow me to still use Datetime functions from the times lib
01:50:15FromDiscord<Elegantbeef> And you still can you just do `myDateTimeVal.DateTime.timesProcName`
01:50:24FromDiscord<Elegantbeef> Or you can borrow them from times
01:50:59FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#distinct-type-modeling-currencies if you want to read more about `distinct`s
01:51:02FromDiscord<Isofruit> You can borrow functions? Sorry, it's really late where I'm at, I only know the term from Rust where it refers to memory borrowing
01:51:23FromDiscord<Isofruit> (Not that I'm any good at Rust mind you)
01:51:28FromDiscord<Elegantbeef> Well this is a distinct so "borrow" means to use the distinct base's functions
01:51:49FromDiscord<Elegantbeef> The above `MyDateTime` is internally `DateTime` but is a different type to the type system
01:52:02FromDiscord<Elegantbeef> So you do need to convert it or borrow from the base to use the functions from times
01:52:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K8u
01:53:15FromDiscord<Elegantbeef> Anyway use the distinct method and either borrow/wrap procs you need
01:53:32FromDiscord<Isofruit> That sounds way cleaner than any idea I've had so far, I'll try it
01:53:44FromDiscord<Isofruit> Though I'm not sure I'll get that done tonight, I likely should sleep at some point
01:54:29FromDiscord<Elegantbeef> It does suck that they didnt make it easier to override the time functions but alas
01:55:15FromDiscord<Elegantbeef> Given the way it's done you could make a PR which has a global function pointer for DateTime
01:55:32*Gustavo6046 quit (Ping timeout: 240 seconds)
01:55:40*Gustavo6046 joined #nim
01:56:24FromDiscord<Isofruit> I'm so far incredibly happy with the developer experience overall though
01:56:34FromDiscord<Isofruit> Yeah, this particular problem sucks a bit
01:56:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3K8v
01:57:12FromDiscord<Elegantbeef> It's a non invasive PR imo, though YMMV
01:57:41FromDiscord<Elegantbeef> I guess it could just be `proc():string`
01:58:07FromDiscord<Elegantbeef> Or just a string 😛
01:58:48FromDiscord<Elegantbeef> the dbValue would be a proc certainly
01:59:32FromDiscord<Elegantbeef> "This has been another episode of beef's inane ramblings"
02:01:55FromDiscord<Isofruit> I'll try to parse this tomorrow, my brain shut down when it encountered that I apparently can't borrow time's `now()` for `MyDateTime`
02:02:37FromDiscord<Elegantbeef> You cant borrow stuff like that
02:02:51FromDiscord<Elegantbeef> you'd make a `proc now(): MyDateTime = MyDateTime(times.now())`
02:07:03FromDiscord<Isofruit> Yeh, tomorrow me's problem... or maybe even for the new year 😄
02:07:10FromDiscord<Isofruit> Thanks for the support !
02:07:29FromDiscord<Elegantbeef> No problem
02:12:18*Gustavo6046 quit (Quit: Leaving)
02:12:36*Gustavo6046 joined #nim
02:22:40*thomasross joined #nim
02:38:17*neurocyte0132889 quit (Ping timeout: 240 seconds)
02:53:13*rockcavera quit (Remote host closed the connection)
03:14:04*rockcavera joined #nim
03:14:04*rockcavera quit (Changing host)
03:14:04*rockcavera joined #nim
04:56:04*arkurious quit (Quit: Leaving)
04:58:05FromDiscord<Zonifer> Hey everyone! Just started to learn nim and I had a quick question. I'm working on building a basic http server and I was curious what `{.async.}` is in `proc cb(req: Request) {.async.} =` would it be the return type?
04:58:21FromDiscord<Yardanico> In reply to @Zonifer "Hey everyone! Just started": that's a pragma
04:58:35FromDiscord<Yardanico> pragmas are generic annotations in nim that can be used for different things
04:58:42FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#pragmas
04:58:57FromDiscord<Yardanico> And specifically about async - https://nim-lang.org/docs/asyncdispatch.html#asynchronous-procedures
04:59:16FromDiscord<Zonifer> In reply to @Yardanico "that's a pragma": Cool thanks for the link! I'll read up 🙂
06:34:16FromDiscord<macintacos> Just want to make sure I'm not doing something very-obviously wrong before I open an issue or something, because I'm new to Nim. I'm trying out the very first basic example in the Testament docs (https://nim-lang.github.io/Nim/testament.html) and it doesn't seem to work at all. Running on macOS, v 1.6.2 https://media.discordapp.net/attachments/371759389889003532/926362600730689616/unknown.png
06:39:45FromDiscord<macintacos> If there's something wrong with my setup, that's fine, but I must say that error message is a tad puzzling. wish it was a bit more descriptive about the exact path it's looking for instead of what seems to be a placeholder path value
06:43:54FromDiscord<Elegantbeef> @macintacos\: what does `testament run` do?
06:44:40FromDiscord<macintacos> sent a code paste, see https://play.nim-lang.org/#ix=3Ka4
06:52:33FromDiscord<Elegantbeef> I've never used testament directly so i do not know
06:53:07FromDiscord<Elegantbeef> seems it wants the folder name
06:53:19FromDiscord<Elegantbeef> so like `testament tests`
06:59:37*ayko-chan joined #nim
06:59:49FromDiscord<leorize> unfortunately testament is one of the tool that is not tested for use with anything that is not the nim compiler
07:00:33FromDiscord<leorize> to deal with this problem, put your test in `tests/<category name>/test0.nim` relative to the directory where you call testament
07:01:07ayko-chanhow can i get Ctrl+key keys from a terminal in nim?
07:03:23FromDiscord<Elegantbeef> Dont they just come in as `char` from `getCh` and similar?
07:05:17*thomasross quit (Ping timeout: 240 seconds)
07:26:33FromDiscord<Rika> Kinda yes
07:26:42FromDiscord<Rika> Afaik they emit as escape codes
07:26:50FromDiscord<Rika> Rather control codes
07:28:23ayko-chanfor example Ctrl-H gives aschi 8 that is BS aka. Backspace
07:28:29ayko-chanok thx
07:31:35FromDiscord<Rika> https://en.m.wikipedia.org/wiki/ANSI_escape_code
07:31:39FromDiscord<Rika> Seems to be very helpful
07:45:48FromDiscord<fakubishes> #csindustrylounge\:nerdsin.space↵recently started aimed at people in software indstury career questions industry questions thoughts gossip etc
07:48:22FromDiscord<Rika> What
07:49:32FromDiscord<Elegantbeef> Matrix spam
07:53:38FromDiscord<Yardanico> Nice to see Nim being tried on retro computers, one of the advantages of having a C backend :)
07:53:39FromDiscord<Yardanico> https://eab.abime.net/showthread.php?t=94213
07:53:45FromDiscord<Yardanico> https://www.atari-forum.com/viewtopic.php?t=39930
07:53:57FromDiscord<Yardanico> just found a few
07:54:46FromDiscord<Yardanico> Ah I actually forgot that Nim has both of these in the platform list, but still
08:38:54*Gustavo6046 quit (Quit: Leaving)
08:49:22ayko-chancan a 2Dseq be printed without the [] and "" ?
08:50:58FromDiscord<Rika> What?
08:51:15FromDiscord<Rika> You will need to make a custom $ proc for it I assume
08:56:41FromDiscord<evoalg> I don't understand, seq's aren't displayed with "" anyway?
09:07:31FromDiscord<evoalg> like this? https://play.nim-lang.org/#ix=3KaK
09:08:36*jjido joined #nim
09:36:51FromDiscord<NOP0 (NOP0)> Checking out nim again after some years absence. Im confused about what to use, there's nim and there's nimskull. What's the difference? Thanks
09:37:46FromDiscord<Yardanico> nimskull is not related to nim in any way, it's a separate project by some people that are not happy with the main repository and development progress
09:38:20FromDiscord<Yardanico> just use Nim itself unless you have some specific issues that are fixed in nimskull
09:38:39FromDiscord<haxscramper> I wouldn't go as far as saying that it is not related "in any way", but if you want to just use then you should probably go with nim right now
09:38:46FromDiscord<haxscramper> (edit) "right now" => "for the time being"
09:39:02FromDiscord<Yardanico> yeah, I meant that it's not directly affiliated with Nim
09:41:05FromDiscord<NOP0 (NOP0)> Ok, so which one is more popular, I'm concerned about learning nim if nimskull is the future . Sorry if this is stupid questions or if I'm stepping on someone's toes.
09:41:23FromDiscord<Solitude> nim
09:41:43FromDiscord<Yardanico> just use nim
09:42:17FromDiscord<haxscramper> nimskull is not exactly ready for "users" anyway, we are busy fixing decade of the tech debt mainline has
09:43:10FromDiscord<NOP0 (NOP0)> Tech debt, what is it. Will it impact my code?
09:43:35FromDiscord<Solitude> maybe
09:44:40FromDiscord<haxscramper> `<insert default rant here>` most likely not at the start, so if you want to just use nim you can go with the mainline compiler and don't worry about implications
09:44:56FromDiscord<haxscramper> I mean it works, just not as good as I think it should
09:46:38FromDiscord<NOP0 (NOP0)> Ok. Theres some issues. I see. Thanks people 🙂
10:01:46ayko-chancan i use getch but without stoping the app for input?
10:02:09FromDiscord<Yardanico> you'll need to use threads for that
10:02:19FromDiscord<Yardanico> so that you do your work in the main thread and wait for the input in another
10:05:23ayko-chansed
10:11:13FromDiscord<rforcen (roberto forcen)> how to compile nim from source on a 2GB SBC?
10:12:01FromDiscord<Yardanico> i think 2gb RAM is enough
10:12:08FromDiscord<Yardanico> to compile nim from source
10:12:12FromDiscord<Yardanico> @rforcen what architecture btw?
10:12:17FromDiscord<Yardanico> we have nightlies for quite a lot of architectures
10:13:55FromDiscord<rforcen (roberto forcen)> arm
10:14:27NimEventerNew thread by Rforcen: Compiling nim from source on low memory SBC, see https://forum.nim-lang.org/t/8757
10:14:30FromDiscord<rforcen (roberto forcen)> issues an error & abort
10:15:19FromDiscord<Yardanico> what arm specifically?
10:15:41FromDiscord<rforcen (roberto forcen)> also tried on a 1gb rpi3b\: Linux asd 5.4.83-v7+ #1379 SMP Mon Dec 14 13\:08\:57 GMT 2020 armv7l GNU/Linux
10:16:00FromDiscord<rforcen (roberto forcen)> armv7l
10:16:09FromDiscord<Yardanico> https://github.com/nim-lang/nightlies/releases/tag/2021-12-14-version-1-6-48c62ca48bc1f0a0ff4bc891e720297b3e8e5c15
10:16:14FromDiscord<Yardanico> just grab https://github.com/nim-lang/nightlies/releases/download/2021-12-14-version-1-6-48c62ca48bc1f0a0ff4bc891e720297b3e8e5c15/nim-1.6.1-linux_armv7l.tar.xz from there
10:16:19FromDiscord<Yardanico> they're statically linked and all that
10:17:02FromDiscord<rforcen (roberto forcen)> just downloading & trying...
10:18:00FromDiscord<rforcen (roberto forcen)> nope\: nim\: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, with debug\_info, not stripped
10:18:28FromDiscord<rforcen (roberto forcen)> required \: /bin/ls\: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=67a394390830ea3ab4e83b5811c66fea9784ee69, stripped
10:18:50FromDiscord<Yardanico> ??
10:18:55FromDiscord<Yardanico> not sure what's the error
10:19:46FromDiscord<rforcen (roberto forcen)> trying w/7l...
10:19:54FromDiscord<Yardanico> wait, so did you download aarch64? i gave you a link to the armv7l one
10:19:56FromDiscord<Yardanico> those are different
10:20:07FromDiscord<Yardanico> armv7l binaries should usually work on aarch64 but not the other way
10:20:20FromDiscord<Yardanico> kind of like i386 and amd64
10:20:55FromDiscord<rforcen (roberto forcen)> yes!, the 7l works fine, thanx
10:21:10FromDiscord<Rika> In reply to @ayko-chan "can i use getch": What does this exactly mean? You want it to be non blocking?
10:21:18FromDiscord<Yardanico> also those nightlies are statically linked with musl so they don't really have any dependencies by themselves
10:23:48ayko-chani want that getc() dosent wait for user input but if the key is pressed when getch() is running it gets the char
10:23:52FromDiscord<rforcen (roberto forcen)> now trying in a Linux mini 5.5.0-rc6-aml-s9xxx #rc1.037 SMP PREEMPT Wed Feb 5 15\:16\:17 MSK 2020 aarch64 aarch64 aarch64 GNU/Linux
10:24:30FromDiscord<Yardanico> yeah for that you'd want to get aarch64
10:24:47FromDiscord<Rika> In reply to @ayko-chan "i want that getc()": Are you trying for posix or multi platform
10:24:59FromDiscord<rforcen (roberto forcen)> yes the 64bit also works fine, THANX for all
10:25:07FromDiscord<Yardanico> no problem :)
10:26:49FromDiscord<Isofruit> Heyho! I've run into my next serialization issue where I think I'm not quite getting how to turn a JsonNode into a custom type with `fromJson`
10:26:58ayko-chanposx
10:27:05ayko-chandont care about windows
10:27:07FromDiscord<Yardanico> In reply to @Isofruit "Heyho! I've run into": hm, can you show some code?
10:27:13FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Kbg
10:27:35FromDiscord<Isofruit> One sec, Copy pasting error
10:27:50FromDiscord<Isofruit> > Exception message: b.kind == JObject failed: JString
10:27:59FromDiscord<Isofruit> explodes somewhere in jsonutils
10:29:13FromDiscord<Elegantbeef> `parseJson` instead of `toJson`
10:30:33FromDiscord<Yardanico> also @Isofruit your json isn't valid
10:30:37FromDiscord<Yardanico> json strings are always double quoted
10:31:05FromDiscord<Elegantbeef> `"""{"name": "walumba"}"""`
10:31:27FromDiscord<Elegantbeef> Or manually escape `"` internally if you're a masochist
10:31:49FromDiscord<Isofruit> No kink shaming here!
10:31:58FromDiscord<Yardanico> also @Isofruit your code won't really work anyway because you're inheriting from Model
10:32:04FromDiscord<Yardanico> so you must supply parameters from Model too
10:32:12FromDiscord<Yardanico> i really don't know if this stuff is supported by norm or not
10:32:46FromDiscord<Yardanico> well, in this case it's just the id field
10:32:47FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/926422629852794920/unknown.png
10:33:21FromDiscord<Yardanico> and then it says "Updated automatically, do not update manually!"
10:37:42FromDiscord<Isofruit> Hmmmmmm
10:39:09FromDiscord<Isofruit> First off, the `parseJson` swap worked out, thanks @ElegantBeef ... I'll need to read over the docs again to get a mental model on when to use what
10:40:09FromDiscord<Yardanico> In reply to @Isofruit "First off, the `parseJson`": you don't actually need jsonutils at all in your case
10:40:12FromDiscord<Yardanico> parseJson and json.to
10:40:14FromDiscord<Yardanico> are enough
10:40:29FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Kbl
10:42:22FromDiscord<Isofruit> That is really cool, thanks a lot @Yardanico ↵... so I'll also need to read over "to" again↵Either way though, the id issue persists so it's a matter of "do I need to define a new type for this that isn't a model or not"
10:50:22FromDiscord<qb> In reply to @Yardanico "so instead of nice": Does that still happen?
10:50:42FromDiscord<Yardanico> uh, i don't think i tried nimbleimgui after that :)
10:50:44FromDiscord<Yardanico> i can try now again
10:50:56FromDiscord<qb> would be great. Im on x11 aswell
10:51:04FromDiscord<qb> it's on nimble now aswell
10:52:06FromDiscord<Yardanico> In reply to @qb "would be great. Im": also, just a tip - change `assert` to `doAssert` - `assert`s are not compiled with -d:danger or --assertions:off, while `doAssert` are, and in your case you need them to be compiled in since you call various init procedures with asserts
10:52:27FromDiscord<qb> Sure, thanks 🙂
10:54:10FromDiscord<Yardanico> nope, still get a black background
10:54:25FromDiscord<Yardanico> also the default positions of the windows are kind of weird https://media.discordapp.net/attachments/371759389889003532/926428071119159336/unknown.png
10:54:26FromDiscord<qb> weird
10:54:29FromDiscord<Yardanico> they're all overlapping
10:54:45FromDiscord<qb> yea I should add a ui cfg
10:55:34FromDiscord<Isofruit> > -d:danger↵I love the fact that I have access to flags that scream "I like to live dangerously"
10:55:49FromDiscord<Yardanico> well it's not exactly "danger"
10:55:52FromDiscord<Yardanico> it just disables all runtime checks ;)
10:55:59FromDiscord<Isofruit> Yeh, it's just funny to think about ^^
10:56:11FromDiscord<Isofruit> Mostly a dev-prod difference in my eyes
10:56:22FromDiscord<Yardanico> in fact in nim < 0.20 -d:release was actually -d:danger
10:56:28FromDiscord<Yardanico> but then it got changed to the current state of things
10:56:34FromDiscord<Yardanico> so that -d:release became safer
10:56:40FromDiscord<Yardanico> (and a bit slower, but that's fine)
10:56:56FromDiscord<Yardanico> you can always disable checks in specific parts of your code or compile with some checks off or with -d:danger
10:57:03*adigitoleo joined #nim
10:57:24FromDiscord<Yardanico> @qb what DE are you on? maybe plasma doesn't support this kind of transparency?
10:57:29FromDiscord<Isofruit> I mean, if d:release is even thrice as slow as normal compiling it's still faster than Rust (which isn't really a great benchmark but... well it's what I moved away from anyway)
10:57:47FromDiscord<Yardanico> In reply to @Isofruit "I mean, if d:release": ah i was talking about runtime performance, not compilation speed :P
10:57:56FromDiscord<Isofruit> Ohhh check
10:58:00FromDiscord<Yardanico> -d:danger disables _runtime_ checks
10:58:19FromDiscord<qb> I'm on gnome
10:58:22FromDiscord<Yardanico> hm
10:58:39FromDiscord<Isofruit> ~~Look, I'm rewriting my backend on my hobby project solely for ego purposes, if I can get even 1 ms reduction in pageload it'll be worth it to my ego~~
10:59:29FromDiscord<qb> Could I add extra files to `nimble install` so the ui config will be copied aswell?
10:59:48FromDiscord<Yardanico> yes, nimble might complain but it'll install files
11:00:00FromDiscord<Yardanico> or you can just hardcode the ui config in the code ™️
11:00:07FromDiscord<qb> oh great idea
11:00:51FromDiscord<Solitude> In reply to @qb "I'm on gnome": on tiling wm it spawn fullscreen black window with imgui windows inside it https://media.discordapp.net/attachments/371759389889003532/926429689222934598/unknown.png
11:01:04FromDiscord<Yardanico> it always spawns a fullscreen window
11:01:17FromDiscord<Yardanico> it's just that on some DEs it becomes transparent so you're under the fake impression of it being multiple windows
11:01:24FromDiscord<Yardanico> when in fact it's one window with imgui
11:01:25FromDiscord<Solitude> yuck
11:01:51FromDiscord<qb> yup
11:04:49FromDiscord<Yardanico> also @qb about static linking with cimgui - it's possible, but not officially supported by cimgui and requires a bit of extra work
11:04:57FromDiscord<Yardanico> you might as well just compile with Nim's C++ backend, then you don't need cimgui
11:05:24FromDiscord<Yardanico> and yes, your app seems to compile fine with the C++ backend
11:05:33FromDiscord<Yardanico> just `nim cpp -r src/NimbleImGui.nim`
11:05:45FromDiscord<qb> yup default is cpp as backend on the nimble file now
11:05:45FromDiscord<Yardanico> then imgui is statically compiled into your binary without any additional layers like cimgui
11:05:52FromDiscord<Yardanico> but yeah, cimgui static compilation is possible
11:06:08FromDiscord<Yardanico> some time ago another person in this chat was wondering the same and eventually succeeded
11:06:37FromDiscord<Yardanico> In reply to @Yardanico "so @anddam to build": ^ this and above
11:16:44adigitoleohi there, can I find a tutorial on using the FFI somewhere? I'd like to call a C lib from nim, nothing too complicated but I've never done that kind of thing
11:20:06adigitoleoOh I just found the nim in action chapter: https://livebook.manning.com/book/nim-in-action/chapter-8/
11:21:26FromDiscord<el__maco> personally I just forward declare the procs with {.importc.} pragma and then pass the c library to the compiler using `--clib:mylib` command line argument
11:22:57FromDiscord<geekrelief> yeah the manual kind of covers it https://nim-lang.github.io/Nim/manual.html#foreign-function-interface, but dom's book looks like a good tutorial
11:23:58FromDiscord<geekrelief> For more complicated things you can try futhark https://github.com/PMunch/futhark or nimterop / c2nim.
11:24:09FromDiscord<geekrelief> (edit) "/" => "or"
11:24:45FromDiscord<NOP0 (NOP0)> Read up on nimskull situation. Kinda sad for nim, have been following nim since 2012. Not critizising anyone, I dont have the full reasons or context. Maybe Im overreacting I dont know
11:25:27FromDiscord<Rika> You probably are
11:26:44adigitoleoNOP0: care to elaborate?
11:27:04FromDiscord<Solitude> you are overreacting
11:28:21adigitoleogeekrelief: futhark looks cool, thanks for the link I'll keep an eye on it for future projects
11:29:21FromDiscord<geekrelief> np, thank PMunch 🙂 I personally use my fork of nimterop https://github.com/geekrelief/nimterop
11:30:10FromDiscord<geekrelief> but that's only because I started with it before futhark came out
11:31:10adigitoleoyeah looks too complicated for me just now, I'm from Python land so I've never been this low level before :)
11:31:56FromDiscord<geekrelief> I was in the same boat a couple months ago. I did have prior experience with C, but I was, maybe still am, rusty.
11:32:07FromDiscord<Yardanico> RUSTY?!!?!
11:32:09FromDiscord<geekrelief> If you have specific questions, feel free to ask
11:33:02FromDiscord<geekrelief> In reply to @Yardanico "**RUST**Y?!!?!": I don't know if you're making a pun about Rust or surprised that I said I'm not great with C.
11:33:07FromDiscord<Yardanico> the former :P
11:33:12FromDiscord<geekrelief> 🙂
11:33:16FromDiscord<Isofruit> TIL rust is a trigger word
11:33:22FromDiscord<Rika> Here yes
11:33:46FromDiscord<Isofruit> Fair
11:34:19FromDiscord<geekrelief> can't all languages try to interop?
11:34:24FromDiscord<geekrelief> 😄
11:35:04FromDiscord<Isofruit> The only thing fought more bloodily than the language wars are the wars in germany over what specifically is a pancake
11:35:10FromDiscord<Rika> Of course, the difficulty is what changes
11:35:31FromDiscord<NOP0 (NOP0)> Seems like a divide in the community because of difficulties getting things merged
11:35:44FromDiscord<Isofruit> Sounds like a
11:35:45FromDiscord<Rika> Skull? Kinda
11:35:47FromDiscord<Isofruit> merge conflict
11:35:58FromDiscord<Rika> Git out
11:36:14FromDiscord<Isofruit> 👉 👉
11:36:49FromDiscord<haxscramper> well, technically you can say that is due to troubles of getting things merged
11:37:45FromDiscord<qb> In reply to @Yardanico "nope, still get a": Sorry to bother you. Could you try again? 😄
11:38:12FromDiscord<Yardanico> still black :(
11:38:17FromDiscord<qb> god damnit
11:38:21FromDiscord<qb> 😄
11:38:40FromDiscord<qb> but the config works now huh
11:39:49FromDiscord<qb> Not sure what causes that. Just works fine here >.< https://media.discordapp.net/attachments/371759389889003532/926439496910770196/Bildschirmfoto_von_2021-12-31_12-39-23.png
11:39:55FromDiscord<haxscramper> In reply to @haxscramper "well, technically you can": Main issue is that we really don't agree with what things development should focus on right now
11:44:20FromDiscord<Rika> and it seems to be more work to get everyone to do one thing than to do things separately
11:44:52ayko-chanhow can i get here only the 1'st row https://play.nim-lang.org/#ix=3KbB
11:45:45FromDiscord<Isofruit> Hmmm I wonder if you can deserialize into a type and just leave one of its fields empty...
11:46:04FromDiscord<Rika> @PMunch maybe needed but I think the playground is down
11:46:20FromDiscord<Rika> Or maybe it’s just this specific link
11:46:35FromDiscord<Rika> Nope the whole thing is 502
11:47:58FromDiscord<Isofruit> Ah, so it wasn't my cache or something
11:49:55FromDiscord<geekrelief> ayko-chan, can you post your code here?
11:51:45ayko-chanwhy
11:51:51ayko-chanit will fill irc
11:52:16FromDiscord<Yardanico> use other paste services
11:52:49FromDiscord<Solitude> http://ix.io/3KbB
11:52:59FromDiscord<Yardanico> ah right
11:53:13ayko-chanhttps://pastebin.com/5RUCqGmF
11:53:16ayko-chanhere
11:53:57FromDiscord<qb> https://logpasta.com/paste/80010654-ef6b-45f7-87d3-3b00324739d1
11:53:59FromDiscord<qb> btw 😄
11:55:23*badsektor joined #nim
11:57:14FromDiscord<sOkam!> https://tenor.com/view/respect-hat-cap-kid-gif-7551965
11:57:21FromDiscord<sOkam!> (edit) "https://tenor.com/view/respect-hat-cap-kid-gif-7551965" => "A moment of admiration for Nim's `div` and `/` behavior on ints↵So intuitive ↵https://tenor.com/view/respect-hat-cap-kid-gif-7551965"
11:58:04FromDiscord<sOkam!> (edit) "A moment of admiration for Nim's `div` and `/` ... behavior" added "default" | "↵https://tenor.com/view/respect-hat-cap-kid-gif-7551965" => " :hatsoff: https://tenor.com/view/respect-hat-cap-kid-gif-7551965"
11:59:39FromDiscord<Rika> Sounds sarcastic
11:59:43FromDiscord<Rika> What’s wrong with it
12:00:03FromDiscord<Yardanico> in his case it's not sarcastic
12:00:10FromDiscord<Yardanico> @Rika check #gamedev
12:00:36FromDiscord<Rika> Ah I see, nice
12:00:43FromDiscord<sOkam!> In reply to @Rika "Sounds sarcastic": It's 100% legitimate. Its literally dope
12:00:52FromDiscord<Rika> Yeah I like it when operators are consistent to what they would do
12:01:05FromDiscord<Rika> Python has it too so I don’t really notice haha
12:01:07FromDiscord<sOkam!> Why on earth would I not want a float out of an int division by default 👀
12:01:41FromDiscord<sOkam!> I get it that you dont cast types... but its expected behavior on paper
12:03:26FromDiscord<Rika> I don’t know, it’s probably a preference thing, but yeah
12:03:52FromDiscord<Rika> I think you should be explicit when you want integer or float behaviour
12:04:08FromDiscord<Rika> No more int()/int()
12:04:21FromDiscord<Rika> So god damn long, that expression
12:04:33FromDiscord<sOkam!> yeah
12:07:45FromDiscord<evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3KbL
12:09:29ayko-chanhow can i get here only the 1'st row https://play.nim-lang.org/#ix=3KbB (HELP PLEASE)
12:10:02FromDiscord<Yardanico> 1st row of what?
12:10:10ayko-chanread the source
12:10:19FromDiscord<Yardanico> i did
12:10:29FromDiscord<Yardanico> you have multiple rows in all sequences
12:10:30ayko-chanof the a seq
12:11:19FromDiscord<Yardanico> http://ix.io/3KbB the direct code link if someone missed
12:11:36FromDiscord<Yardanico> In reply to @ayko-chan "of the a seq": a[0]
12:11:45FromDiscord<Yardanico> gives you the first "row" of the a seq
12:11:48FromDiscord<Yardanico> is this what you want or wat?
12:11:50ayko-chanoh ok
12:11:51FromDiscord<Yardanico> i'm honestly confused
12:12:15FromDiscord<Yardanico> don't you just want zip?
12:15:42ayko-chanoh thanks. :)
12:15:50*ayko-chan quit (Quit: Leaving)
12:35:02*xet7 quit (Quit: Leaving)
12:36:37FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3KbW
12:37:25FromDiscord<Yardanico> afaik jsony allows for similar stuff
12:37:27FromDiscord<Yardanico> https://github.com/treeform/jsony
12:37:45FromDiscord<Isofruit> Just slightly annoying that I can instantiate an object of that type without having the fields set (which is what norm is relying on to work), but can't convert json to one
12:38:08FromDiscord<Isofruit> I'll take a look at jsony!
12:40:03FromDiscord<Isofruit> I swear to christ if I manage to figure this one out I'll write an example up for norm and see if I can't get it throw into their docs or sth
12:43:26FromDiscord<hmmm> are you swearing upon the name of our lord and saviour over such petty concerns? 🧐
12:43:42FromDiscord<hmmm> I'm worried for the salvation of your soul 🧐
13:02:00FromDiscord<dom96> In reply to @adigitoleo "Oh I just found": yeah, this chapter is free. You can also download it from https://book.picheta.me/ as a PDF
13:14:05FromDiscord<Shiba> does anyone know anybook or video or article that covers every aspect of nim
13:14:15FromDiscord<Shiba> (edit) "does anyone know anybook or video or article that covers every aspect of nim ... " added "language"
13:14:46FromDiscord<Shiba> (edit) "anybook" => "any book"
13:15:59FromDiscord<Rika> The manual, probably
13:16:06FromDiscord<Rika> Every aspect is defined as?
13:32:07FromDiscord<Isofruit> sent a code paste, see https://play.nim-lang.org/#ix=3Kc8
13:32:35FromDiscord<NOP0 (NOP0)> How will nimskull differ from nim?
13:33:18FromDiscord<konsumlamm> have you read their readme?
13:33:38FromDiscord<haxscramper> for now we don't have any explicit directions where we want to change the implementation, we are solely focusing on the compiler stability, documentation and test improvements
13:34:14FromDiscord<haxscramper> there are some associated prerequisites, but the language-specific changes will happen way later
13:35:57FromDiscord<haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/926468140609712188): for now we don't have any explicit directions where we want to change the implementation, we are solely focusing on the compiler stability and documentation as well as test improvements
13:38:08FromDiscord<NOP0 (NOP0)> Ok, interesting, which language pain points are you looking at?
13:38:19FromDiscord<konsumlamm> sent a code paste, see https://paste.rs/8OH
13:38:22FromDiscord<konsumlamm> you'll probably want to open an issue
13:43:13FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/Hq9
13:43:19FromDiscord<haxscramper> Main pain point right now is an absolutely abysmal state of the compiler code base - once that is addressed at least somehow (by cleaning up the error reporting system, documenting implementation, rethinking some internal data management) we can start looking deeper. At the same time we want to improve the test suite - it is just a pile of randomly thrown together checks for random conditions, riddled with `disbled: true` or checks th
13:44:15FromDiscord<haxscramper> for example, nim compiler can output, in total 568 different error message diagnostics
13:44:32FromDiscord<haxscramper> welp, can you guess whether anyone checked for them all in test suite?
13:45:32FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3Kcc
13:46:00FromDiscord<Solitude> In reply to @enthus1ast "is there a good": no, write a macro
13:46:38FromDiscord<haxscramper> https://forum.nim-lang.org/t/8723 related
13:47:14FromDiscord<NOP0 (NOP0)> Ok, so the nimskull improvements is then merged back?
13:47:17FromDiscord<enthus1ast> yeah thought that this might be the way. Thanks↵(@Solitude)
13:47:41FromDiscord<haxscramper> no, the main problem is that core devs don't see things I'm talking about right now as a problem
13:48:02FromDiscord<haxscramper> compare roadmaps https://github.com/nim-lang/RFCs/issues/437 https://github.com/nim-works/nimskull#near-term-development
13:49:52FromDiscord<haxscramper> right now we are in the blue area mostly, with high-level overvieew of the progress here https://github.com/nim-works/nimskull/discussions/142?sort=new
13:49:53FromDiscord<NOP0 (NOP0)> Ok
13:50:07FromDiscord<enthus1ast> found a bug in the img [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) "Compiler on NodeJS" is doublicated
13:52:34FromDiscord<NOP0 (NOP0)> How is the speed of development nimskull vs nim?
13:52:58FromDiscord<Yardanico> as haxscramper mentioned, nimskull isn't focused much on actual development right now
13:53:05FromDiscord<Yardanico> they're making strategy and roadmap first
13:53:28FromDiscord<haxscramper> we've already made strategy and roadmap, but otherwise this is correct
13:53:35FromDiscord<haxscramper> feature-wise we are completely stale
13:55:04FromDiscord<haxscramper> maybe tooling-wise it will be faster a little
13:55:21FromDiscord<Isofruit> In reply to @konsumlamm "you'll probably want to": Opened a github issue and started praying I didn't mess up the reporting. Who knows
13:55:28FromDiscord<haxscramper> as in - some of the internal improvements would allow to write functioning nimpretty implementation for example
13:55:50FromDiscord<Isofruit> (edit) "knows" => "knows. Thanks for the hint though, I was 100% convinced that one was entirely on me"
13:55:50FromDiscord<haxscramper> instead of this joke we have right now
14:09:32FromDiscord<Shiba> In reply to @Rika "The manual, probably": can i download fit for offline reading
14:09:38FromDiscord<Shiba> (edit) "fit" => "it"
14:10:51FromDiscord<dom96> You can always print to PDF 😄
14:14:20FromDiscord<konsumlamm> In reply to @Isofruit "Opened a github issue": it's not so rare to find a bug in Nim, i found quite some bugs by just playing around
14:24:35ozzzHi! I have issues with gcc11.1 <- Is it supported?
14:24:50ozzzor I should expect glitches
14:25:05FromDiscord<Isofruit> At least it's not crippling, though figuring out how else to format my custom data type will be annoying
14:25:25FromDiscord<Isofruit> (edit) "data" => "datetime"
14:26:01FromDiscord<Isofruit> In reply to @konsumlamm "it's not so rare": At least it's not crippling, though figuring out how else to format my custom datetime type will be annoying
14:27:03FromDiscord<Solitude> In reply to @Isofruit "At least it's not": whats stopping you from using original proc, just without the borrowing?
14:28:06*xet7 joined #nim
14:28:18*arkurious joined #nim
14:29:38FromDiscord<Isofruit> In reply to @Solitude "whats stopping you from": My datetime is distinct from normal datetime, the reason lies in the norm library.↵It converts output from dB queries into model types and already has something pre defined for Datetime that I can't override
14:29:51*rockcavera quit (Remote host closed the connection)
14:31:06FromDiscord<Solitude> In reply to @Isofruit "My datetime is distinct": you can still use original proc on your distinct type if you jsut convert it
14:31:27FromDiscord<Isofruit> So I tell it to use my totally different neat custom datetime (their datetime assumes you store a unix timestamp float but my dB already stores it as strings formatted yyyy-Mm-dd HH:mm:ss and...)↵Wait I can?
14:31:30FromDiscord<Solitude> you dont need borrow for that
14:31:38FromDiscord<Solitude> would be pretty stupid if you couldnt
14:31:51FromDiscord<Solitude> just convert your distinct back to DateTime
14:32:50*rockcavera joined #nim
14:32:50*rockcavera quit (Changing host)
14:32:50*rockcavera joined #nim
14:33:50FromDiscord<NOP0 (NOP0)> How many people are working on nimskull vs nim?
14:35:12FromDiscord<haxscramper> nimskull does not have full-time developers, but it is me, saem and leorize for the most part. Nim has araq (full-time, paid), narimiran (full-time, paid) and a lot of other contirbutors
14:35:31FromDiscord<Solitude> In reply to @NOP0 (NOP0) "How many people are": https://matrix.to/#/#nimworks:envs.net
14:35:50FromDiscord<NOP0 (NOP0)> Ok, thanks 😊
14:36:22FromDiscord<Isofruit> In reply to @Solitude "just convert your distinct": I'll need to have a look once I'm back at my PC in a couple hours... Or tomorrow. That would definitely solve that problem though, thanks for the hint!
14:37:43*adigitoleo quit (Quit: adigitoleo)
14:42:32*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:43:33*ehmry joined #nim
15:48:25arkanoidwhat's the difference from platform "standalone" and "any"?
15:55:44arkanoidif I have a proc that returns a proc that returns a proc, is it a closure of a closure? Do I have to define it explicitly?
16:26:47*badsektor quit (Remote host closed the connection)
16:59:55*soundmodel joined #nim
17:00:26soundmodelany ideas where to ask help with Fidget?
17:09:34*rockcavera quit (Remote host closed the connection)
17:12:18FromDiscord<Yardanico> @soundmodel don't really think there is a place like that
17:12:25FromDiscord<Yardanico> treeform has been remaking fidget from scratch for quite some time
17:12:32FromDiscord<Yardanico> so current fidget is in this weird state
17:13:06soundmodelI'm having trouble starting with it and understanding how it utilizes nim templates
17:13:15soundmodelmight be standard nim though, but as a newbie it's confusing
17:13:57soundmodelso such as, how is the group template used here: https://github.com/treeform/fidget/blob/4e0f79ef0a3e6021ccb37af833715947274515cc/examples/minimal/minimal.nim#L9
17:15:43soundmodelI cannot find an instance of it which has one string argument
17:15:49soundmodelhttps://github.com/treeform/fidget/blob/28606653dc31f77730a88f7569da2d5040ad912b/src/fidget.nim#L81
17:21:15soundmodelnor do I understand how inner is used in https://github.com/treeform/fidget/blob/28606653dc31f77730a88f7569da2d5040ad912b/src/fidget.nim#L75
17:24:03FromDiscord<Yardanico> @soundmodel maybe you misunderstood templates
17:24:09FromDiscord<Yardanico> templates can take normal arguments but also code blocks
17:24:15FromDiscord<Yardanico> so the group template takes a string as the first parameter
17:24:24FromDiscord<Yardanico> and the code after : and indentation as the second parameter
17:24:50FromDiscord<Yardanico> i don't really know inner workings of fidget though, and I don't think that many people do :P
17:25:24soundmodelahh I see, so inner : untyped refers to those blocks
17:29:13soundmodelI don't know, I found that syntax a bit odd, because that the block is used as an argument is a bit "implicit"
17:33:27soundmodelI also don't understand where the constructs that don't seem to be defined in a file may lie, such as: https://github.com/treeform/fidget/blob/28606653dc31f77730a88f7569da2d5040ad912b/src/fidget.nim#L19
17:33:43FromDiscord<Isofruit> Huh... Could it be that jsony doesn't like multiple levels of nesting? I noticed my norm models don't get properly desetialized if it has a field that contains more than 3 levels of nesting... I'll have to do some more testing in the new year to narrow the cause down
17:33:45soundmodelthere's no earlier mention of nodeStack
17:37:31soundmodelit's defined in common, but I don't understand how does it look like it's modifying a variable defined in another .nim file
17:37:40nixfreaknim[m]ok so stupid question, what is the difference between importing a module like `import module/submodle` or `import module` `import submodule`
17:38:10nixfreaknim[m]Is there a difference why one wouldn't work over the other one ?
17:39:19FromDiscord<Yardanico> yes, because in the first case you only import the submodule
17:39:25FromDiscord<Yardanico> "module" in this case is a directory
17:39:33FromDiscord<Yardanico> and in the latter case you import both module and submodule as two modules
17:40:41soundmodelit seems almost like it uses vars in another file as "global variables"
17:40:47soundmodelbut this sounds like an odd design decision
17:44:31soundmodelhttps://nim-lang.org/docs/manual.html#modules-export-statement
17:46:59soundmodelwhat if MyObject was var?
17:48:03nixfreaknim[m]Yardanico oh ok thanks
17:52:44*thomasross joined #nim
17:58:10soundmodelI'm also trying to compile some of the examples for fidget
17:58:13soundmodeland I get fatal error: X11/Xlib.h: No such file or directory
17:58:19soundmodelI wonder if I'm missing some dependencies
17:58:54FromDiscord<Yardanico> yep, you need X development libs for that
18:04:29FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3KeN
18:05:02FromDiscord<treeform> I recommend returning some thing like a seq if its "variable count"
18:05:59FromDiscord<enthus1ast> i will just use this in a loop and i want to have the tuple unpacked
18:06:30FromDiscord<enthus1ast> but would the macro generate the WHOLE iterator?
18:07:18FromDiscord<treeform> with macros you can do basically anything
18:08:00FromDiscord<treeform> you probably will probably only have 1-5 components you want to do at once
18:08:09FromDiscord<treeform> I would just define the 1-5 iterators you will use
18:08:13FromDiscord<enthus1ast> yes
18:08:18FromDiscord<enthus1ast> was also thinking about this
18:08:27FromDiscord<treeform> probably simpler to debug
18:08:32FromDiscord<enthus1ast> yeah
18:09:53FromDiscord<enthus1ast> the only downside to this i see (except the code doublication) is that the returned tuple does not have the correct names
18:10:04FromDiscord<treeform> so `entities(a,b): tuple[a,b]`, `entities(a,b,c) : tuple[a,b,c]`, `entities(a,b,c,d): tuple[a,b,c,d]` etc...
18:10:14FromDiscord<enthus1ast> yes
18:10:40FromDiscord<treeform> I don't really use named tuples, or really tuples in general.
18:11:00FromDiscord<enthus1ast> i think i go with this route
18:11:07FromDiscord<enthus1ast> will take this route i mean \:)
18:11:47soundmodelI got the X11 libs
18:11:51soundmodeland now I'm stuck at /usr/bin/ld: cannot find -lGL
18:14:06FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3KeQ
18:14:37FromDiscord<treeform> were `e.pos` does the `reg.getComponent(e, Pos)`
18:16:04FromDiscord<enthus1ast> mh
18:16:17FromDiscord<enthus1ast> e.pos would then be a closure?
18:16:41FromDiscord<treeform> I would not. Closures are kind of slow I would not use them for ECS.
18:17:05FromDiscord<enthus1ast> the thing is, i currently can have any type as a component
18:17:14FromDiscord<enthus1ast> no oop
18:17:15FromDiscord<tandy> u need to install libgl↵(<@709044657232936960_soundmodel=5b=49=52=43=5d>)
18:17:19FromDiscord<tandy> what distro?
18:17:27FromDiscord<tandy> i did this the other day for imgui
18:17:40FromDiscord<enthus1ast> so in your example this must also be a macro
18:18:01FromDiscord<enthus1ast> ah no, not true, they are components
18:18:15FromDiscord<treeform> See here: https://play.nim-lang.org/#ix=2nbR
18:18:21FromDiscord<treeform> they can be plain procs or templates for speed
18:18:22FromDiscord<enthus1ast> gotta know my code \:)
18:19:06FromDiscord<treeform> Its my "Entity Component System in 10 lines"
18:19:53FromDiscord<treeform> does not use macros, but does use advanced templates 🙂
18:20:22soundmodelalready feeling so much nicer than C++
18:20:40soundmodelI hated having to use C++ for the tasks that I'm looking for Nim to do
18:20:44FromDiscord<enthus1ast> a clever @treeform
18:20:56FromDiscord<enthus1ast> did not know this syntax exists to be honest
18:21:06FromDiscord<enthus1ast> proc `has componentType`\
18:21:18FromDiscord<treeform> yeah its neat
18:21:19FromDiscord<enthus1ast> `proc `has componentType``
18:21:40FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=3KeT
18:21:59FromDiscord<enthus1ast> i've build this type of thing in my previous ecs but with macros, it was way to complicated
18:22:15FromDiscord<treeform> macros are always too complex
18:22:25FromDiscord<treeform> I would focus on the API you want the ECS to have first
18:22:34FromDiscord<treeform> my goal is to make it not feel like ECS at all
18:22:39FromDiscord<enthus1ast> yes
18:22:43FromDiscord<treeform> but still provide the benefits
18:22:46FromDiscord<treeform> (edit) "but still provide the benefits ... " added "of speed"
18:23:11FromDiscord<treeform> Its important to realize that different components should be stored in different data structures
18:23:16FromDiscord<treeform> some thing like array for common components
18:23:28FromDiscord<treeform> and something like hashtable or b-tree for less common ones
18:23:50FromDiscord<treeform> then there are all kind of shortcuts to iterating with them
18:24:57FromDiscord<enthus1ast> i do not know how well my ecs performs, speed is not yet an issue in my current project, i mainly use it to build up complex "objects"
18:25:34FromDiscord<enthus1ast> https://github.com/enthus1ast/ecs/blob/master/src/ecs.nim
18:35:02FromDiscord<deech> Is there a way to tell the difference between a argument passed in by the user and a default parameter, eg. in `proc p(s:string = "some string") ...` I'd like to know if the user explicitly passed in "some string".
18:36:31soundmodelAny idea where nimble may install /examples/ by default
18:36:35soundmodelthat may come with some Github project
18:36:48soundmodelI cannot find it under ~/.nimble/pkgs where the package installed lies
18:36:52soundmodelbut no /examples/ folder
18:38:38soundmodelthen it says that to run examples one must clone again and do install
18:38:47soundmodelso I wonder if this would lead to having two fidgets in nimble?
18:38:53soundmodelhttps://github.com/treeform/fidget#how-to-run-the-examples
18:38:59soundmodelsince I've already done nimble install fidget
18:39:15FromDiscord<huantian> In reply to @haxscramper "as in - some": No way good nimpretty would be awesome
18:45:59FromDiscord<Solitude> In reply to @deech "Is there a way": if its a single default argument, you could just introduce overload without that argument that assumes default value.
18:46:33FromDiscord<tandy> i thought araq was part time? didnt he have a job at some german firm?
18:47:14FromDiscord<deech> In reply to @Solitude "if its a single": That's a good idea but unfortunately wouldn't work in this case, there are a number of parameters. Thanks!
18:47:54*Gustavo6046 joined #nim
18:48:02FromDiscord<haxscramper> https://forum.nim-lang.org/t/8540#55418
18:48:31*SebastianM joined #nim
18:48:37FromDiscord<tandy> interesting
18:48:57FromDiscord<tandy> hope everyone who does prs gets their bug bounties lol
18:52:44*SebastianM quit (Client Quit)
18:53:28FromDiscord<treeform> In reply to @soundmodel "https://github.com/treeform/fidget#how-to-run-the-e": To get examples you will need to clone the repo with git, nimble does not install extra folders like examples
18:54:30*Gustavo6046 quit (Ping timeout: 260 seconds)
19:09:57*cornfeedhobo quit (Ping timeout: 256 seconds)
19:28:37*cornfeedhobo joined #nim
19:46:12FromDiscord<mattrb> Quick q, probably stupid. Is there a standard way to add a signed int to an unsigned int, or do I need to check the sign, convert it to an unsigned int, then add or subtract it?
19:52:31FromDiscord<mattrb> Guess I can just use the two's complement
19:53:26*soundmodel quit (Quit: Client closed)
19:57:25FromDiscord<Rosen> sent a code paste, see https://play.nim-lang.org/#ix=3KfV
19:57:33FromDiscord<Rosen> ignore me wait
19:57:45FromDiscord<Rosen> (edit) "ignore me wait ... " added "(i deleted last message)"
20:00:09FromDiscord<treeform> In reply to @mattrb "Quick q, probably stupid.": You should convert.
20:01:35FromDiscord<treeform> I also don't recommend using unsigned ints together. I would only use unsigned ints its when I am doing bit fiddling or doing optimizations and have benchmarks.
20:01:42FromDiscord<Solitude> In reply to @mattrb "Quick q, probably stupid.": you could just cast signed int to unsigned
20:02:23*xet7 quit (Remote host closed the connection)
20:12:42FromDiscord<mattrb> Ah yeah I could also just cast
20:13:01FromDiscord<mattrb> I do have a valid use for unsigned ints
20:14:01FromDiscord<mattrb> And I'm using ints because I need to apply need to add and subtract numbers from those uints, and it's faster to have a LUT for the values to add and subtract by
21:56:46FromDiscord<huantian> Currently trying to make a program that downloads files from a list of urls, and wondering if there was a good way to get the name of the file with downloadFile
21:57:01*Gustavo6046 joined #nim
21:57:27FromDiscord<huantian> since there are duplicate file names, I'd need to check if something with that filename already exists or not
21:57:57FromDiscord<huantian> but mainly I want to not have to do a GET request for the Content-Disposition header, then the other one in downloadFile
21:58:37FromDiscord<Elegantbeef> Is the file name in the url?
21:58:52FromDiscord<huantian> unfortunately not for all the urls
21:59:26FromDiscord<Elegantbeef> Well then you dont have anyway to get the file name afaik
22:02:39FromDiscord<huantian> the Content-Disposition header contains the filename, which I can probably extract with some regex or something↵but I'd need to do a separate request to read the headers
22:02:56FromDiscord<huantian> ig I could just copy the code from downloadFile and make my own version
22:04:13*redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
22:05:09*redj joined #nim
22:16:03FromDiscord<Elegantbeef> Cant you just access the header properly instead of abusing regex? 😀
22:19:05FromDiscord<huantian> unfotunately the header value looks like this `attachment;filename="Lemon Demon - Angry People.rdzip";filename=UTF-8''Lemon%20Demon%20-%20Angry%20People.rdzip` with the quotation marks also being optional (apparently)
22:21:53FromDiscord<huantian> I am using the headers field but I need to do something to just get the filename here
22:24:23FromDiscord<Elegantbeef> I guess you need a str capture mechanism
22:24:23FromDiscord<Elegantbeef> So https://play.nim-lang.org/#ix=3Kgw
22:24:32FromDiscord<Elegantbeef> I dont like regex in most cases so... 😀
22:28:17FromDiscord<huantian> heh
22:32:40FromDiscord<huantian> <https://play.nim-lang.org/#ix=3Kgy>↵Trying to do something, no idea if this is right xD
22:33:18FromDiscord<Elegantbeef> Why are we using private access?
22:34:15FromDiscord<huantian> HttpClient.getBody is a private field
22:34:37FromDiscord<Elegantbeef> That only adds to the confusion
22:39:00FromDiscord<huantian> uhh sorry lemme think a bit
22:41:50FromDiscord<Elegantbeef> I guess what you're doing is copying the downloadFile proc so it makes sense
22:41:50FromDiscord<Elegantbeef> Just odd
22:44:51FromDiscord<huantian> yeah I'm not sure if there's a better way to do the equivalent of downloadFile, but add my own code that does something with the response
22:45:29FromDiscord<huantian> copying it directly is what came to my mind, but might not be the best idea
22:46:44FromDiscord<Elegantbeef> Well you can do an http get request then write the bodystream to a file i think
22:47:33FromDiscord<huantian> does that load the entire file into memory though?
22:47:38FromDiscord<Elegantbeef> No
22:47:45FromDiscord<Elegantbeef> `bodystream` is a stream
22:47:55FromDiscord<huantian> ah
22:48:48FromDiscord<sOkam!> Is there fixed-point arithmetic in Nim?
22:49:05FromDiscord<Elegantbeef> Ah nvm it's a stringStream
22:49:10FromDiscord<Elegantbeef> So yea that all in memory
23:01:35FromDiscord<huantian> oh ok
23:13:30*NimBot joined #nim
23:15:19*FromDiscord joined #nim
23:17:01*thomasross quit (*.net *.split)
23:17:01*kayabaNerve quit (*.net *.split)
23:17:02*vicecea quit (*.net *.split)
23:17:02*Goodbye_Vincent quit (*.net *.split)
23:17:02*perro quit (*.net *.split)
23:17:02*flynn quit (*.net *.split)
23:17:02*rb quit (*.net *.split)
23:17:02*Onionhammer quit (*.net *.split)
23:17:02*joshbaptiste quit (*.net *.split)
23:17:02*mal`` quit (*.net *.split)
23:17:02*Jjp137 quit (*.net *.split)
23:17:03*dtomato quit (*.net *.split)
23:17:03*greyrat quit (*.net *.split)
23:17:03*anddam quit (*.net *.split)
23:17:03*oddish quit (*.net *.split)
23:17:03*def- quit (*.net *.split)
23:17:04*averell quit (*.net *.split)
23:17:04*meowray quit (*.net *.split)
23:17:04*dv^_^ quit (*.net *.split)
23:17:04*oprypin quit (*.net *.split)
23:17:04*pippin quit (*.net *.split)
23:17:04*Zevv quit (*.net *.split)
23:17:04*Lord_Nightmare quit (*.net *.split)
23:17:05*xiamx[m] quit (*.net *.split)
23:17:05*cheer[m] quit (*.net *.split)
23:17:05*robertmeta quit (*.net *.split)
23:17:05*xiamx quit (*.net *.split)
23:17:05*nixfreaknim[m] quit (*.net *.split)
23:17:06*toothlessgear quit (*.net *.split)
23:17:06*blackbeard420 quit (*.net *.split)
23:17:06*tinytoast quit (*.net *.split)
23:17:06*zacts quit (*.net *.split)
23:17:06*dom96 quit (*.net *.split)
23:17:06*adium quit (*.net *.split)
23:17:06*redj quit (*.net *.split)
23:17:06*GreaseMonkey quit (*.net *.split)
23:17:07*crem quit (*.net *.split)
23:17:07*koltrast quit (*.net *.split)
23:17:07*notchris quit (*.net *.split)
23:17:07*Schnouki quit (*.net *.split)
23:17:07*gshumway quit (*.net *.split)
23:17:07*madprops quit (*.net *.split)
23:17:08*lain quit (*.net *.split)
23:17:08*qwr quit (*.net *.split)
23:17:08*djanatyn quit (*.net *.split)
23:17:08*jjido quit (*.net *.split)
23:17:08*happycorsair[m] quit (*.net *.split)
23:17:08*mjsir911 quit (*.net *.split)
23:17:08*ormiret quit (*.net *.split)
23:17:08*Yardanico quit (*.net *.split)
23:17:08*NimEventer quit (*.net *.split)
23:17:09*tk quit (*.net *.split)
23:17:09*ecs quit (*.net *.split)
23:17:09*[R] quit (*.net *.split)
23:17:09*anadahz quit (*.net *.split)
23:17:10*oz quit (*.net *.split)
23:17:10*Gustavo6046 quit (*.net *.split)
23:17:10*ehmry quit (*.net *.split)
23:17:10*nrds quit (*.net *.split)
23:17:10*beshr quit (*.net *.split)
23:17:10*sagax quit (*.net *.split)
23:17:10*ozzz quit (*.net *.split)
23:17:10*dv2 quit (*.net *.split)
23:17:10*oisota quit (*.net *.split)
23:17:10*LyndsySimon quit (*.net *.split)
23:17:11*Amun-Ra quit (*.net *.split)
23:17:11*euantorano quit (*.net *.split)
23:17:11*systemdsucks quit (*.net *.split)
23:17:11*Ekho quit (*.net *.split)
23:17:11*mikko quit (*.net *.split)
23:20:09*xet7 joined #nim
23:20:09*rp3 joined #nim
23:20:09*mahlon_ joined #nim
23:20:09*hexeme joined #nim
23:20:09*redj joined #nim
23:20:09*Gustavo6046 joined #nim
23:20:09*thomasross joined #nim
23:20:09*ehmry joined #nim
23:20:09*jjido joined #nim
23:20:09*oisota joined #nim
23:20:09*kayabaNerve joined #nim
23:20:09*vicecea joined #nim
23:20:09*nrds joined #nim
23:20:09*beshr joined #nim
23:20:09*Lord_Nightmare joined #nim
23:20:09*def- joined #nim
23:20:09*perro joined #nim
23:20:09*anadahz joined #nim
23:20:09*sagax joined #nim
23:20:09*tk joined #nim
23:20:09*ozzz joined #nim
23:20:09*Goodbye_Vincent joined #nim
23:20:09*xiamx joined #nim
23:20:09*flynn joined #nim
23:20:09*xiamx[m] joined #nim
23:20:09*rb joined #nim
23:20:09*dtomato joined #nim
23:20:09*Onionhammer joined #nim
23:20:09*joshbaptiste joined #nim
23:20:09*averell joined #nim
23:20:09*mal`` joined #nim
23:20:09*pippin joined #nim
23:20:09*zacts joined #nim
23:20:09*toothlessgear joined #nim
23:20:09*Jjp137 joined #nim
23:20:09*gshumway joined #nim
23:20:09*dv2 joined #nim
23:20:09*nixfreaknim[m] joined #nim
23:20:09*GreaseMonkey joined #nim
23:20:09*notchris joined #nim
23:20:09*Schnouki joined #nim
23:20:09*blackbeard420 joined #nim
23:20:09*ecs joined #nim
23:20:09*greyrat joined #nim
23:20:09*crem joined #nim
23:20:09*tinytoast joined #nim
23:20:09*[R] joined #nim
23:20:09*happycorsair[m] joined #nim
23:20:09*cheer[m] joined #nim
23:20:09*anddam joined #nim
23:20:09*oddish joined #nim
23:20:09*meowray joined #nim
23:20:09*LyndsySimon joined #nim
23:20:09*NimEventer joined #nim
23:20:09*djanatyn joined #nim
23:20:09*koltrast joined #nim
23:20:09*Yardanico joined #nim
23:20:09*robertmeta joined #nim
23:20:09*qwr joined #nim
23:20:09*lain joined #nim
23:20:09*madprops joined #nim
23:20:09*ormiret joined #nim
23:20:09*adium joined #nim
23:20:09*dom96 joined #nim
23:20:09*mjsir911 joined #nim
23:20:09*oprypin joined #nim
23:20:09*dv^_^ joined #nim
23:20:09*Zevv joined #nim
23:20:09*Amun-Ra joined #nim
23:20:09*oz joined #nim
23:20:09*euantorano joined #nim
23:20:09*systemdsucks joined #nim
23:20:09*Ekho joined #nim
23:20:09*mikko joined #nim
23:20:45*cornfeedhobo_ joined #nim
23:22:41*SebastianM joined #nim
23:23:37SebastianMHappy New Year!
23:24:41*arkurious joined #nim
23:25:00*SebastianM quit (Client Quit)
23:31:37*thomasross quit (Ping timeout: 240 seconds)
23:36:06nrds<Prestige99> you too SebastainM
23:36:11*oprypin quit (Quit: Bye)
23:36:28*oprypin joined #nim
23:44:36*neurocyte0132889 joined #nim
23:44:36*neurocyte0132889 quit (Changing host)
23:44:36*neurocyte0132889 joined #nim