<< 23-11-2023 >>

00:00:10*miragearchitect quit (Ping timeout: 268 seconds)
00:00:20FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/issues/19041#issuecomment-962548645
00:00:49arkanoidElegantbeef: surprisingly, the silly benchmark output shows that GCC is faster than tcc here
00:09:09arkanoidwell, by comparing min/max, seems that tcc is faster in compilation (a lot faster for -d:release) but generates much slower executables, which makes sense in the context of scripting
00:19:34FromDiscord<takemichihanagaki3129> When should I use `typedesc[T]` instead of `T` properly?
00:23:08arkanoidElegantbeef, I've posted the results gcc vs tcc
00:23:29FromDiscord<Elegantbeef> When you want a type instead of an instance
00:25:14FromDiscord<Elegantbeef> Uh huh
00:27:06arkanoidtakemichihanagaki3129: with `proc(foo: T)` you pass a foo that is an instance of type T, with `proc(foo: typedesc[T])` you pass a foo that is a T (like float, string, bool, MyObject, ecc)
00:30:56arkanoidI'm still quite not convinced of the difference between `nim r` and `nimcr`
00:31:09FromDiscord<takemichihanagaki3129> In reply to @arkanoid "<@890300313729400832>: with `proc(foo: T)`": Strange...↵My LSP is giving me a strange error msg, saying that I should use `typedesc`, but in my case I need a instance of `T`, not `T` itself.
00:32:35arkanoidtakemichihanagaki3129: LSP may be wrong, can you share a small example that replicates the hint? I can look at it with nimlsp
00:33:31FromDiscord<takemichihanagaki3129> sent a code paste, see https://paste.rs/ct2x6
00:34:48FromDiscord<takemichihanagaki3129> sent a code paste, see https://play.nim-lang.org/#ix=4McO
00:35:58FromDiscord<Elegantbeef> Is the compiler giving you an error?
00:35:59FromDiscord<Elegantbeef> If not, restart the LSP, if it's still broken, pray for better tooling
00:36:04FromDiscord<Elegantbeef> is `VErrorKind` the enum field or type?
00:36:05FromDiscord<Elegantbeef> What does the compiler actually say
00:48:24FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "is `VErrorKind` the enum": Type
00:48:26arkanoidwhoa, "nimcr + tcc" is so much faster than "nim r + tcc"
00:48:36FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "What does the compiler": Let me have a look
00:48:53FromDiscord<takemichihanagaki3129> In reply to @Elegantbeef "If not, restart the": Sure! I'll try nimsuggest, so.
00:49:22FromDiscord<takemichihanagaki3129> (edit) "look" => "look.↵I was trying to fix this right now, so I made some changes since that message."
01:19:32arkanoidtakemichihanagaki3129: could you please rewrite https://play.nim-lang.org/#ix=4McO in a way we can understand the involved types?
01:21:33FromDiscord<takemichihanagaki3129> In reply to @arkanoid "<@890300313729400832>: could you please": I'm finally starting to understand what I've done wrong here.↵But thanks for your availability. 😉
01:21:46arkanoidno problem
01:23:40FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4McW
01:41:40*jmdaemon joined #nim
01:48:44*beholders_eye quit (Ping timeout: 252 seconds)
03:32:23*edr quit (Quit: Leaving)
03:56:05*miragearchitect joined #nim
04:22:05*miragearchitect quit (Quit: Quit)
04:23:23*miragearchitect joined #nim
04:24:19*miragearchitect quit (Client Quit)
04:28:32*rockcavera quit (Remote host closed the connection)
05:14:15FromDiscord<michaelb.eth> sent a long message, see http://ix.io/4Mdd
05:33:53FromDiscord<Elegantbeef> Did you inline the formatter? @michaelb.eth
05:34:24FromDiscord<michaelb.eth> no
05:34:55FromDiscord<Elegantbeef> Did you compile wiht lto?
05:34:59FromDiscord<michaelb.eth> yes
05:36:19FromDiscord<Elegantbeef> I can only imagine that changing the logic caused the optimiser to change how it did it, unless you have a min repro 😄
05:41:47FromDiscord<michaelb.eth> yeah, I really should shoot for a min repro, I think there's something buggy going on.
05:53:02FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4Mdi
05:59:35FromDiscord<odexine> doesnt seem to make sense
05:59:44FromDiscord<odexine> that its different, i mean
06:00:28FromDiscord<michaelb.eth> sure, seems like it shouldn't make a difference
06:09:10FromDiscord<odexine> what compiler flags
06:10:08FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4Mdm
06:10:57FromDiscord<michaelb.eth> Nim devel, commit `39fbd30`, from just a few days ago
06:14:34FromDiscord<michaelb.eth> oh, forgot to mention and might be relevant, compiler is clang
06:14:40FromDiscord<Elegantbeef> Does `let t = t1 - t0; fmtMilliseconds(t)` also have the slower runtime
06:14:51FromDiscord<michaelb.eth> will try
06:22:45*derpydoo joined #nim
06:48:35FromDiscord<michaelb.eth> In reply to @Elegantbeef "Does `let t =": made it even worse
06:49:50FromDiscord<michaelb.eth> rephrasing: times per `fmtMilliseconds` are slower, slightly more so than previous variants
06:51:34FromDiscord<Elegantbeef> That makes 0 sense
06:51:43FromDiscord<michaelb.eth> I agree
06:58:37FromDiscord<michaelb.eth> my current theory, and again because I saw something quite similar before I involved nim-decimal, there's something buggy happening with floats
07:10:23*PMunch joined #nim
07:34:15*advesperacit joined #nim
07:37:35FromDiscord<pmunch> I mean just comparing these two you get the same times http://ix.io/4Mdz
07:40:06FromDiscord<pmunch> So if anything there's something going on with the above code
07:40:13FromDiscord<pmunch> Or the code above rather
07:58:20*antranigv quit (Ping timeout: 252 seconds)
08:00:47*antranigv joined #nim
08:09:00FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=4MdJ
08:09:12FromDiscord<Elegantbeef> `col: var Collection`
08:09:43FromDiscord<TӨMΛ ☠> Ooh, my goodness, right 😆
08:09:55FromDiscord<TӨMΛ ☠> Can't count how many times this missing `var` got me now, haha
08:10:02FromDiscord<TӨMΛ ☠> Thank you ❤️
08:10:44NimEventerNew thread by chaemon: [] operator and converter are not compatible. , see https://forum.nim-lang.org/t/10674
08:14:02FromDiscord<Elegantbeef> Now go educate that forum post about the importance of `var`
08:30:17PMunchBut wait, shouldn't that work as-is?
08:30:38PMunchresult.data is seq[T], so result.data[0] += 1 should work, right?
08:31:56PMunchI mean throwing `var` into the `[]` makes the code work, but is result.data now converted to a SEQ[T] before calling the `[]` operator?
08:33:50FromDiscord<Elegantbeef> The converter should not fire if it's not mutable
08:47:25PMunchHuh?
08:49:47FromDiscord<Elegantbeef> This seems to be another converter bug, there's no reason for `result.data[0] += 1` to fire a converter
08:53:26PMunchExactly
08:57:26FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4MdU really funny minimized
09:04:11*derpydoo quit (Ping timeout: 264 seconds)
09:12:23FromDiscord<ivorydealership> how can i convert a base64'd image back into an image file with nim? (i could just exec powershell or smt but i want to do it in nim)↵((i might be dumb here but i looked online and struggled to find a working solution.))
09:14:35Amun-Raconvert to bytes, write
09:16:06Amun-Rahttps://nim-lang.org/docs/base64.html#decode%2Cstring
09:24:36FromDiscord<azzkikr> sent a code paste, see https://play.nim-lang.org/#ix=4Me3
09:26:47FromDiscord<intellij_gamer> Make the operator return `var MyObject`, or make it not require a `var MyObject` parameter
09:28:14FromDiscord<intellij_gamer> Issue is that it requires a `var` parameter but what it returns isn't `var` so you can't chain it
09:28:45FromDiscord<nnsee> https://play.nim-lang.org/#ix=4Me6
09:28:51FromDiscord<nnsee> oof, amadan was faster
09:29:11FromDiscord<odexine> why are you using a var for k and then also returning it?
09:29:19FromDiscord<odexine> just thought it was weird
09:29:56*beholders_eye joined #nim
09:37:47FromDiscord<azzkikr> I've just begun exploring the language \:) The compiler complained when I was not using a `k: var MyObject` (`k.name cannot be assigned to`) so I added the keyword. But thanks people, I will check it all out
09:39:37FromDiscord<nnsee> do you _want_ the `/` procedure to modify the object itself? That behaviour wouldn't really make sense to me but it is your code lol - if you want that, you need to use a var
09:41:09FromDiscord<nnsee> in the return type as well, i mean
09:41:12FromDiscord<nnsee> so https://play.nim-lang.org/#ix=4Meb
09:41:52FromDiscord<nnsee> otherwise the interim object created when you do `bleh / "again!"` in the last line isn't a var, which is what the procedure expects
09:42:06FromDiscord<nnsee> does that make sense to you?
09:45:04FromDiscord<nnsee> In reply to @nnsee "do you _want_ the": and what i mean by that is that the output of this doesn't make sense, for example: https://play.nim-lang.org/#ix=4Med
09:45:14FromDiscord<nnsee> the fact that `bleh` is modified when you create `other`
09:46:46FromDiscord<nnsee> the first link i posted doesn't do that, for example
09:47:33*beholders_eye quit (Ping timeout: 260 seconds)
09:49:27*beholders_eye joined #nim
09:51:43FromDiscord<azzkikr> Yeah the idea was to modify the object itself. It's just for exploring purposes, to see what the language can/can't do. The whole bunch makes a lot more sense now, thanks.
10:32:49arkanoidPMunch: hello! I've tried and benchmarked your nimcr project yesteday, and it works great, and it works much faster than "nim r". Afaik nimcr skips the nim compiler step, while "nim r" skips the C compilation step, but not sure
10:49:13Amun-Ranim r is compile + run
10:55:31arkanoidAmun-Ra: but it skips compilation pass if it's already compiled, just like nimcr. Yet, nimcr is much faster
10:55:51arkanoidit drills down to how nim compiler detects if the source has changed or not
11:02:44PMunchNimcr is very simple in that regard, it just checks if the source file you're compiling has changed
11:02:53PMunchDoesn't check any imports or anything
11:10:03FromDiscord<ringabout> Dammit, `-march=native` segfaults my program on Windows: https://play.nim-lang.org/#ix=4MeA When I try to define a function for importc objects
11:13:28FromDiscord<xtrayambak> Hey, @treeform, sorry for the ping. I just wanted to ask -- is image.fillText an expensive function? I've been working on a 2D renderer for a while now and I've pinpointed the majority of the lag to that function. If yes, are there any alternatives that are real-time friendly?
11:16:48PMunchTreeform is US based, so it might be a while until you get a reply
11:18:57FromDiscord<xtrayambak> That's fine with me, lol
11:38:58*jmdaemon quit (Ping timeout: 276 seconds)
11:59:15Amun-Raringabout: don't use nim types in importc procs
12:03:58PMunchYou mean that float?
12:04:18PMunchReplace that with cfloat or cdouble perhaps?
12:14:17*om3ga quit (Read error: Connection reset by peer)
12:17:49*om3ga joined #nim
12:34:08Amun-Ramhm
13:08:01FromDiscord<redmechanics> what are some modern gui librairies that have a decent documentation ?
13:10:39FromDiscord<nnsee> owlkettle?
13:21:37FromDiscord<Phil> Sidenote:↵If owlkettle does not count as having decent documentation please say so as I have a vested interest to make that thing shine until it makes your eyes bleed
13:21:48FromDiscord<Phil> (edit) "Sidenote:↵If owlkettle does not count as having decent documentation please say so ... as" added "and in which aspects"
13:22:38FromDiscord<Phil> Give I am literally flooding the repo with PRs for adding support for more widgets and other improvements here and there as well as providing the starting point for the nimibook docs I tend to be somewhat partial there 😛
13:23:34FromDiscord<Phil> In reply to @redmechanics "what are some modern": Besides owlkettle, there's in general a couple bindings that are pretty decent. PMunch has his own that he posted to me the other day that I forgot the name of because I'm secretly a goldfish
13:23:50FromDiscord<Phil> (edit) "In reply to @redmechanics "what are some modern": Besides owlkettle, there's in general a couple ... bindings" added "GTK"
13:24:04FromDiscord<Phil> There's also QT bindings, either for QT widgets or for QML, not for both
13:24:05Amun-RaI work on some wrappers
13:24:39FromDiscord<Phil> GTK?
13:24:41FromDiscord<Phil> Or QT?
13:24:46Amun-RaGTK
13:24:58Amun-RaGTK 2-4
13:25:51FromDiscord<Phil> Check.↵Other than GTK and QT... errr elcritch is doing pretty impressive work IIRC, but that's WIP
13:25:57FromDiscord<Phil> (edit) "Check.↵Other than GTK and QT... errr elcritch is doing pretty impressive work ... IIRC," added "with Figuro"
13:26:15Amun-RaPhil: btw, what do I have to do to register my package in nimble?
13:27:13FromDiscord<Phil> sent a long message, see http://ix.io/4Mfk
13:27:39Amun-Raoh, thanks
13:27:50FromDiscord<Phil> Fundamentally it really is just a PR to the package-repo
13:28:01FromDiscord<Phil> But nimble has a nice automated process for it so why not
13:28:22FromDiscord<Phil> sent a long message, see http://ix.io/4Mfl
13:28:23FromDiscord<Phil> The package repo being this one: https://github.com/nim-lang/packages
13:28:47FromDiscord<Phil> God damn copy paste sometimes
13:28:53PMunchMine is called genui, and for Gtk it's genuigtk3
13:29:06PMunchI've also wrapped Gtk with Futhark with great success :)
13:30:10*rockcavera joined #nim
13:35:51FromDiscord<Phil> How hard would it be to convince you to implement some DSL magic to make adding event-listeners easier (doesn't have to be owlkettle's style, I just really like can.l's implementation) ?
13:37:07PMunchcan.l?
13:37:39PMunchYou don't like the `-> ("clicked": clickHandler)` syntax?
13:42:46Amun-Rahmm, good idea, I thik I'll implement elem->clicked = handler syntax
13:51:10PMunchI really like the owlkettle syntax though
13:51:14PMunchJust inline it
13:51:24PMunchMakes it impossible to share a callback though
13:59:57FromDiscord<can.l> In reply to @PMunch "Makes it impossible to": You can just use `proc clicked() = myCallback()` if you want to.
14:01:27PMunchAh of course, that's fair
14:03:24FromDiscord<can.l> Parameters would need to be passed manually, though at least in my experience sharing a callback is not that common in owlkettle.
14:06:43PMunchYeah it's not the most common thing. But sometimes you can end up in a situation where it's handy
15:04:53FromDiscord<Phil> Wait, am I mixing things up?
15:05:28FromDiscord<Phil> If you already had inlined event listeners then I didn't say anything and the fact work is fucking me up is actively harming my already broken memory
15:06:16FromDiscord<Phil> (edit) "inlined event listeners" => ""define event-listener as part of the Widget declaration"-syntax"
15:08:54PMunchgenui has this, yes
15:15:42*PMunch quit (Quit: Leaving)
15:18:58FromDiscord<Phil> Sweet!
16:09:20FromDiscord<srabb> happy thanksgiving
16:09:33FromDiscord<srabb> In reply to @PMunch "genui has this, yes": why the hell are you a bot
16:11:43FromDiscord<srabb> roboyt
16:11:46FromDiscord<srabb> robot
16:21:52FromDiscord<demotomohiro> In reply to @srabb "why the hell are": There is bridge between discord and other chat systems like IRC or matrix.↵Messages coming from people using IRC shows here with bot icon.
16:23:40FromDiscord<srabb> ah okei
16:23:51FromDiscord<treeform> In reply to @xtrayambak "Hey, <@107140179025735680>, sorry for": Yes it does a lot.
16:24:32FromDiscord<treeform> What are you using to draw your game? It’s probably best to draw text character by character
16:24:45FromDiscord<xtrayambak> In reply to @treeform "What are you using": I'm using OpenGL, with boxy and pixie.
16:26:15FromDiscord<treeform> Boxy has two examples to draw text fast, static and dynamic
16:26:53FromDiscord<xtrayambak> Ah, I never noticed those. I'll take a look at it. Thanks.
16:26:54FromDiscord<redmechanics> is there anyone that has a project in nim that i can help with as an intermediate programmer and considering the fact i started using nim not long ago ?
16:40:58*jmdaemon joined #nim
16:51:50FromDiscord<Clonkk> What would be your domain of interest  ?↵(@redmechanics)
16:53:46FromDiscord<redmechanics> i don't have any in particular
16:54:46NimEventerNew Nimble package! jacket - A Nim wrapper for the JACK client-side C API aka libjack, see https://github.com/SpotlightKid/jacket
16:54:46NimEventerNew Nimble package! wasmrt - Nim wasm runtime, see https://github.com/yglukhov/wasmrt
16:54:50NimEventerNew Nimble package! yasync - Yet another async/await for Nim, see https://github.com/yglukhov/yasync
17:07:10FromDiscord<xtrayambak> In reply to @isofruit "Quoting my own Obsidian": Wait, nimble publish does that???
17:07:11FromDiscord<xtrayambak> God damn it, I've been manually editing JSON this entire time.
17:15:40*krux02 joined #nim
17:43:16FromDiscord<michaelb.eth> In reply to @redmechanics "i don't have any": maybe try working through last year's (or some past year's) Advent of Code using Nim, and then do this year's Advent of Code in Nim when it starts on Dec 3
17:43:46FromDiscord<michaelb.eth> (edit) "3" => "1"
17:48:08FromDiscord<redmechanics> In reply to @michaelb.eth "maybe try working through": how can i see what thee
17:48:15FromDiscord<redmechanics> (edit) "thee" => "there was to do ?"
17:48:39FromDiscord<michaelb.eth> https://adventofcode.com/2022
17:48:47FromDiscord<michaelb.eth> you can change the year in the URL
17:55:58FromDiscord<Phil> In reply to @xtrayambak "Wait, nimble publish does": There's so much stuff to know for setting things up that it literally triggered me to write and later publish my obsidian notes 😄
18:06:41FromDiscord<tauruuuuuus> Hi! Does anyone know if it is possible to force enums to have a specific underlying type?
18:11:06FromDiscord<tauruuuuuus> It seems like I cannot force them to be 8 bit with:↵`{.size: sizeof(cchar).}`
18:11:55FromDiscord<Chronos [She/Her]> In reply to @tauruuuuuus "Hi! Does anyone know": Usually I assign the first value a '0' as a `uint8` for example
18:12:08FromDiscord<tauruuuuuus> Or at least, calling ord on something with this macro does not yield a 8-bit int..
18:12:10FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4MgJ
18:12:36FromDiscord<tauruuuuuus> In reply to @chronos.vitaqua "Usually I assign the": Tried that too without too much success :s, thanks tho!
18:13:06FromDiscord<Chronos [She/Her]> Hm, sorry, no idea then
18:20:06FromDiscord<nnsee> In reply to @tauruuuuuus "Hi! Does anyone know": you mean something like this? https://nim-lang.org/docs/manual.html#set-type-bit-fields the size pragma in particular
18:21:06FromDiscord<nnsee> or more precisely https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-size-pragma
18:23:32FromDiscord<tauruuuuuus> I had tried that to begin with, turns out my error was caused by something else and I got confused, I love nim a lot but unfortunately the compiler errors are sometimes a bit messy 😅
18:23:42FromDiscord<tauruuuuuus> Thanks tho @nnsee !
18:34:48arkanoidhow can I test if a compile time piece of code compiles?
18:39:30Amun-Rawhen compiles "let x = 2": discard
18:41:15arkanoiddoesn't seems to work in my case. It returns true when code doesn't compile
18:46:23FromDiscord<JX M> #天伊娱乐公司【Long-term recruitment of agents】 The entire network is fair, just and open [Green Platform] Play on mobile phones and computers on site [Open an account for free] business for you 24 hours a day Main business [Baccarat, Dragon Tiger, Niu Niu, Fishing, Chess and Cards] Support\: [Support----USDT,TRX,Bank Card,Alipay,WeChat,KBZ, Register http://ty3799.cc Telegran\: @mjtyyl
18:48:50arkanoidAmun-Ra: check here. The first test should fail, the second doesn't run in VM as expected: https://termbin.com/inh4
18:51:53arkanoidthere's an old issue on this: https://github.com/nim-lang/Nim/issues/14049
18:52:04arkanoidseems that compiles(e) doesn't really catch all the cases
18:52:34Amun-Raright
18:52:58Amun-RaI used it for simple things only
18:55:54FromDiscord<bootymonster69> what would raising an exception from within an `except` block do
18:56:51arkanoidAmun-Ra: here a self contained example https://play.nim-lang.org/#ix=4MgT
18:59:08Amun-Rahmm, so re does not work in static context
19:00:08FromDiscord<bostonboston> In reply to @bootymonster69 "what would raising an": It would raise the exception, the block you're in would not catch it
19:02:22FromDiscord<bostonboston> https://play.nim-lang.org/#ix=4MgV
19:04:16arkanoidAmun-Ra: re is not listed in NimScript compatible modules, and that's ok. The issue here is compiles(e) not able to catch it
19:05:02Amun-Raarkanoid: I always assumed code passed to compiles must be vm legal
19:05:09Amun-RaI see your point now
19:44:20arkanoidwhat's the difference between std/re and std/nre?
19:46:04FromDiscord<Elegantbeef> `nre` is newer iirc
19:46:05FromDiscord<Elegantbeef> Use nimregex though
19:46:08NimEventerNew thread by bsljth: What would I lose if I turn of garbage collection?, see https://forum.nim-lang.org/t/10676
19:46:11FromDiscord<Elegantbeef> Raise an exception↵(@bootymonster69)
19:46:21FromDiscord<Elegantbeef> But personally I say do not use regex
19:55:48*PMunch joined #nim
19:56:00arkanoidElegantbeef, I've just pushed a PR for a lib a lib that didn't work at compile time due to std/regex, and replace it with https://github.com/nitely/nim-regex
19:56:11arkanoidsorry for the repetition, wrong paste
19:57:11arkanoidI think https://nim-lang.org/docs/strutils.html#nimIdentNormalize%2Cstring is not following NEP1 style guide https://nim-lang.org/docs/nep1.html
19:57:23FromDiscord<Elegantbeef> I see
19:57:34arkanoidType identifiers should be in PascalCase. All other identifiers should be in camelCase with the exception of constants which may use PascalCase but are not required to
19:59:35FromDiscord<Elegantbeef> It's just a string that operates on a string it cannot know what your intended meaning or spelling is
19:59:35FromDiscord<Elegantbeef> Should it uppercase a character after `_` probably 😄
20:00:46PMunchHmm, what's the easiest live drawing library in Nim? I want to draw some output while my script runs, just simple putting pixels on a canvas
20:01:34FromDiscord<Elegantbeef> sdl2 is quite easy to do that with
20:01:39FromDiscord<Elegantbeef> You can also use nico if you want it even simpler
20:02:13PMunchYeah I was considering Nico, but I seem to remember it only doing indexed colors
20:03:01FromDiscord<Elegantbeef> It does only indexed colours
20:03:01FromDiscord<Elegantbeef> You got 256 of them though 😛
20:03:06FromDiscord<Elegantbeef> If you want full rgb values then sdl2 is quite simple to setup and draw to
20:03:23PMunchProblem is that I load my colors from a file, so I don't know how many I have
20:03:36PMunchYeah I guess SDL2 would be the next best option
20:14:46*notbad joined #nim
20:15:08NimEventerNew Nimble package! avr_io - AVR registers, interrupts, progmem and peripheral support in nim!, see https://github.com/Abathargh/avr_io/wiki
20:18:35arkanoidPMunch: I'm fiddling with Futhark renaming options, and I'm finding quite big limitations. I've opened an issue to talk about an idea that could end up with better defaults
20:18:51arkanoidPMunch: https://github.com/PMunch/futhark/issues/87
20:19:08PMunchYes, the renaming system should really get a makeover
20:19:51arkanoidPMunch: I've just enabled anycase package at compile time. That could make it easy
20:20:47PMunchWhy do you think nimIdentNormalize is a problem?
20:20:47arkanoidit just a case on kind, and then camel(n) or pascal(n)
20:21:24PMunchIt is there so that I can more easily compare names later on, and if I allowed non-normalized names you could end up with compile-time collisions of names
20:21:25arkanoidbecause if you try to make names NEP1 in renameCallback, nimIdentNormalize flats everything to lowercase
20:21:55PMunchAh, you've fallen into the common fallacy of thinking that Futhark output should be read by humans :P
20:22:30arkanoidPMunch: well, then why adding renaming tools then :D
20:22:44PMunchIt's to rename things with clumsy names
20:23:15FromDiscord<Elegantbeef> Remove C prefix namespaces
20:23:26PMunchI have this for example in my Gtk wrapper: http://ix.io/4Mhl
20:23:31PMunchExactly @Elegantbeef!
20:23:39*notbad quit (Remote host closed the connection)
20:24:08arkanoidexactly what I'm trying to do (successfully) with renameCallback. The issue is flat names as output that kills an handy visual hint when using produced wrappers
20:24:08*lucasta joined #nim
20:24:42PMunchYeah I didn't think of editors showing and auto-completing things when I wrote Futhark
20:25:03PMunchI have a tendency to just type everything myself and don't really use editor tools (despite having written NimLSP)
20:25:45PMunchI haven't even set up keyboard shortcuts for LSP in Vim, I manually write :LspHover when I want to get hover hints or :LspDefinition when I want to jump to definition
20:26:11arkanoidsure, it's not a game changer, it's just something that can be done quite easily without messing up the logic: it's just about preserving case in generated code, and Nim is case insensitive so no change down the road
20:27:25arkanoidbtw, it's just a proposal, not really anything super important
20:28:21PMunchWell the problem lies in how I deal with things internally in Futhark
20:29:14PMunchWell, rather with avoiding collisions from C
20:29:45PMunchSay you have my_var and myvar in C, I can't port those over without doing something to one of them
20:30:16PMunchSo I store the names normalised, so when I encounter the second one I know I've already seen a symbol which will collide
20:30:40PMunchThe reason I normalize first is for speed reasons
20:31:29PMunchBut I guess I could do something like `usedNames.incl result.nimIdentNormalize` and then `if usedNames.contains(result.nimIdentNormalize)` and keep the original casing around
20:37:16arkanoidPMunch: if nimIdentNormalize would do it's job without replacing uppercase with lowercase, I would get what I mean, and futhark would see no change due to case insensitivity, i guess
20:38:35PMunchHuh?
20:45:31arkanoidyou can see from the generated names that the case follows strictly what nimIdentNormalize does. If instead of lowering the whole string with special exception rule for the first letter, it would leave the case as is, it would be possible to preserve the word separation down the road
20:47:10PMunchBut then it wouldn't serve it's current purpose
20:47:16PMunchWhich is to ensure that C names don't collide
20:47:16arkanoideven better, I think it should just follow NEP1 and do camelCase or PascalCase according to object type. I don't think this transformation is more aggressive than what nimIdentNormalize is already doing
20:47:42PMunchIf you can write me an auto-caser I'm all for it :)
20:48:13PMunchAnd by auto-caser I mean something which can detangle all the various C case styles and make sure you can't have collisions
20:48:21arkanoidas I said, I just patched anycase package just for that
20:48:37PMunchSo even MYVAR shouldn't collide with MyVar or My_var.
20:50:27PMunchDo you have a link to anycase?
20:51:32arkanoidI'm not quite sure why you think this change would need change how you handle collisions. I'm just proposing an alternative step for nimIdentNormalize that would preserve case, or even better something that applies pascal or camel depending on type and NEP1. Down the road, if collision happens, you apply same logic as now.
20:53:19arkanoidPMunch: https://github.com/epszaw/anycase
20:55:16PMunchBut the entire logic now is based on identifiers being normalized..
20:56:44PMunchAs I go I collect identifiers in `usedIdentifiers` fully normalized. Then when I encounter an identifier I normalize it and check if it exists in `usedIdentifiers`, then I check if it has a known renaming by looking it up in another table, and in certain cases I also look if the type should be changed from a third table.
20:57:12PMunchAll these tables and hashes use normalized keys to make sure I can't have names which are different in C collide in Nim.
21:08:21arkanoidI'll study futhark code some more, as you're convincing me I'm underestimating the task
21:09:38PMunchIt will be hard to auto-case things, but it shouldn't be too hard to keep the original casing
21:09:55PMunchThat's just a matter of where normalisation happens
21:26:12FromDiscord<bootymonster69> anybody know where I went wrong?:↵https://play.nim-lang.org/#ix=4Mhu
21:27:13FromDiscord<bootymonster69> still playing around with the lanuage. I am aware that "there is a library for that"
21:31:42PMunchYou mean apart from the error message?
21:32:16PMunchLine 38, that `Dynamic_Result` only has one generic argument while it takes two
21:33:23PMunchAh, if you're trying to create default generics this appears to work: https://play.nim-lang.org/#ix=4Mhv
21:33:46PMunchThat being said this code looks like you're heading for a painful mess
21:37:27FromDiscord<bootymonster69> I'm sure I am
21:38:35FromDiscord<bootymonster69> I had no idea you could do that in generic params
21:38:44FromDiscord<bootymonster69> thanks a bunch
21:39:27FromDiscord<bootymonster69> In reply to @bootymonster69 "I'm sure I am": of course I would appreciate any pointers on how to not shoot myself in the foot
21:39:51PMunchDon't horribly abuse generics and type classes is a good start :P
21:40:55PMunchOh, and look up the difference between except and finally
21:41:04FromDiscord<bootymonster69> alrighty. i'm sure I will learn a good balance in time
21:41:12PMunchI'm 95% sure that's not what you want to do
21:41:46PMunchTo be honest I'm not quite sure what you're trying to do here
21:44:00FromDiscord<bootymonster69> just trying to implement a data structure with an array and a length, and the result type
21:44:46FromDiscord<bootymonster69> I tried looking at one of the result libraries in nim and i genuinely could not understand it
21:45:45FromDiscord<Elegantbeef> `U = Error` is invalid
21:45:51FromDiscord<Elegantbeef> Generic parameters do not have defaults
21:46:38FromDiscord<Elegantbeef> Atleast they shouldnt 😄
21:47:46PMunchYeah I was wondering about that
21:47:51FromDiscord<bootymonster69> i'm just trying to pass the buck on what the kind of error in the err variant is going to be. kinda like zig's global error union
21:47:53PMunchI just changed it until it compiled :P
21:47:57FromDiscord<Elegantbeef> I guess it does work, but there is no detail on them being intended, and you cannot have a single parameter with a default
21:48:17PMunchBut I guess not using any of the procs hid the error
21:48:29FromDiscord<Elegantbeef> No I tested it elsewhere and it works
21:48:33FromDiscord<Elegantbeef> But I would not lean on it
21:48:51PMunch@bootymonster69, well if you want to learn Nim then maybe try it the Nim way and just throw an exception?
21:48:52FromDiscord<bootymonster69> In reply to @bootymonster69 "i'm just trying to": does this make sense
21:49:34FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4MhA like this works, but it does not seem intentional 😄
21:49:44FromDiscord<bootymonster69> I personally don't like exceptions because of unpredictable control flow, but again I'm just seeing what I can express in the language more so than trying to work around it
21:50:14FromDiscord<Elegantbeef> So just make procedures return `Error[T, Y]` and annotate them `{.raises:[].}`
21:50:25FromDiscord<Elegantbeef> No longer have exceptions and have explicit flow control
21:50:48FromDiscord<bootymonster69> I was not aware that there was an Error[T, Y]
21:50:56FromDiscord<Elegantbeef> There isn't one
21:50:58FromDiscord<Elegantbeef> It takes 10 seconds to make
21:51:23FromDiscord<bootymonster69> thats a result by a different name, right?
21:51:44FromDiscord<Elegantbeef> Sure
21:51:48FromDiscord<bootymonster69> do you mind showing me?
21:52:24FromDiscord<bootymonster69> I would appreciate it
22:00:25FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4MhD
22:00:28FromDiscord<Elegantbeef> There you go
22:01:19FromDiscord<Elegantbeef> Replace the `success` and `error` with explicit `result = error(...)` if you want
22:01:25FromDiscord<Elegantbeef> or `return error(...)`
22:03:19FromDiscord<bootymonster69> thanks. I haven't gotten to templates and macros yet so it may take a bit of time for me to understand this 🙂
22:03:38FromDiscord<Elegantbeef> These are fairly tame
22:03:53FromDiscord<Elegantbeef> We set the variable we pass in the template and if we're in a proc we return
22:11:58FromDiscord<Elegantbeef> I think technically there should be a `break` aswell
22:12:31FromDiscord<redmechanics> are there any major softwares that use nim ?
22:12:40PMunchDefine major
22:13:04FromDiscord<Elegantbeef> Nitter is the most well known Nim software
22:16:04FromDiscord<redmechanics> In reply to @PMunch "Define major": any software that actually has a real life use and is released to the public
22:16:29PMunchThen yes
22:16:40FromDiscord<Elegantbeef> Yea we don't do that here 😛
22:16:46PMunchFairly generous definition of major though
22:16:47FromDiscord<bostonboston> The Nim compiler 😄
22:17:51PMunchI mean my little calculator thing has real life use, I use it every day, and it's open source on GitHub, so released to the public. Still wouldn't call it major though..
22:18:37FromDiscord<redmechanics> In reply to @PMunch "I mean my little": yes but apart from you i dont think much people use it right ?
22:20:00PMunchNo idea, it's not like I have analytics in it
22:20:07PMunchBut I haven't heard of anyone using it :P
22:20:14FromDiscord<Elegantbeef> Should've boot google analytics in it 😛
22:20:18FromDiscord<Elegantbeef> put
22:20:24FromDiscord<Elegantbeef> Wow that's a brain typo and a half
22:20:37FromDiscord<Elegantbeef> I'm like a toddler writing the alphabet sometimes
22:21:07PMunchI have written software in Nim though which is handling millions of DNS requests a day and is rolled out to many of the customers where I used to work
22:21:25PMunchIt's not exactly public, but it's released and useful
22:21:58*lucasta quit (Remote host closed the connection)
22:22:17*lucasta joined #nim
22:22:50FromDiscord<redmechanics> ok because i like nim but i can't find a lot of info on softwares that use it and i find it is not very well documented apart from official documentation
22:23:14FromDiscord<Elegantbeef> That's the trick no software uses it
22:23:18FromDiscord<Elegantbeef> Relatively speaking
22:23:33FromDiscord<Elegantbeef> It's a niche programming language, they tend not to proliferate software
22:37:50*lucerne quit (Ping timeout: 245 seconds)
22:38:58*fallback quit (Ping timeout: 260 seconds)
22:44:40*advesperacit quit ()
22:45:08*lucerne joined #nim
22:53:46*beholders_eye quit (Ping timeout: 255 seconds)
22:56:06*beholders_eye joined #nim
23:05:03*PMunch quit (Quit: leaving)
23:29:01arkanoidElegantbeef, would you be so patient to explain me compiles(foo) vs compiles(static(foo)) ?
23:29:16arkanoidaren't both "compile time" tests?
23:32:55*lucasta quit (Quit: Leaving)
23:34:02FromDiscord<Elegantbeef> Arkanoid one checks if something compiles the other if it compiles in a static context
23:35:18arkanoidisn't compilation always "static" ?
23:35:30FromDiscord<Elegantbeef> Not when checking when something compiles
23:36:02FromDiscord<Elegantbeef> consider `when compiles(copyMem(pointer nil, pointer nil, 0))` this would return false in your world
23:36:17FromDiscord<Elegantbeef> Since it does not compile on the VM, but it does compile else where
23:37:45arkanoiduhm, quite hard to grasp
23:39:34*beholders_eye quit (Ping timeout: 260 seconds)