<< 28-11-2021 >>

00:00:51*Onionhammer joined #nim
00:01:19FromDiscord<evoalg> nice! ... yea "hello" isn't a long string ... gosh i had to compile with "-d:release" and knock a zero off each of them just so it'd finish in a reasonable time on my system lol ... thank you for the nice example!
00:01:46FromDiscord<Elegantbeef> Well you should only bench on release or danger anywho
00:02:01FromDiscord<Elegantbeef> No problem for the example though
00:06:21FromDiscord<evoalg> That "full iter" one might even be slower when it has to do `a[i]` to actually use the values, or will it be just the same?
00:06:47FromDiscord<Elegantbeef> Oh right i forgot to index
00:07:46FromDiscord<Elegantbeef> It'll probably get inlined and not matter much
00:08:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GiZ
00:08:46FromDiscord<Elegantbeef> Yea no cost
00:09:06FromDiscord<Elegantbeef> That std deviation of 20ns on the naive iteration is fucking silly
00:09:16FromDiscord<Elegantbeef> That's 50% of the average
00:10:03FromDiscord<evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3Gj0
00:10:24FromDiscord<Elegantbeef> what flags are you passing?
00:10:31FromDiscord<Elegantbeef> I'm doing `-d:release -d:lto`
00:10:45FromDiscord<evoalg> `nim -r -d:release c slicerator_test3.nim`
00:10:49FromDiscord<Recruit_main707> what was lto againg?
00:10:49FromDiscord<Elegantbeef> Though the `lto` doesnt matter too much
00:10:56FromDiscord<Elegantbeef> Link time optimization
00:11:02FromDiscord<Recruit_main707> thanks
00:11:19FromDiscord<Elegantbeef> it's preferable to use `--passC:"-flto" --passL:"-flto"`
00:11:28FromDiscord<Elegantbeef> Since that works on all compilers
00:13:15FromDiscord<evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3Gj2
00:13:18FromDiscord<ynfle (ynfle)> Why doesn't `-d:lto`?
00:13:42FromDiscord<Elegantbeef> Why dont do `-d:lto`?
00:14:04FromDiscord<Elegantbeef> It passes the wrong flags to clang and other C compilers
00:14:05FromDiscord<ynfle (ynfle)> Why doesn't it work on al compilers?
00:14:19FromDiscord<ynfle (ynfle)> Why can't it be configured to pass the correct ones?
00:14:27FromDiscord<Elegantbeef> It can but apparently no one bothered
00:14:55FromDiscord<Elegantbeef> Yea i dont know evo, quite odd performance numbers
00:15:00FromDiscord<Elegantbeef> Did you use a much bigger string?
00:15:06FromDiscord<Elegantbeef> Or is it still `"Hello"`?
00:15:38FromDiscord<evoalg> still "hello" ... but let me remind you that I'm running nim on linux with is on docker on my mac
00:16:02FromDiscord<Elegantbeef> Ah
00:16:16FromDiscord<evoalg> cos I'm cray cray
00:16:24FromDiscord<Elegantbeef> Apparently so
00:16:31FromDiscord<Elegantbeef> Takes 3 seconds to install Nim on mac 😛
00:19:12*k0ta quit (Ping timeout: 260 seconds)
00:20:10FromDiscord<evoalg> it runs a lot faster!
00:20:16FromDiscord<evoalg> on my mac
00:20:25FromDiscord<Elegantbeef> Is the performance difference noticeable now?
00:22:58FromDiscord<evoalg> sent a code paste, see https://play.nim-lang.org/#ix=3Gj7
00:25:04FromDiscord<Elegantbeef> Yay!
00:25:15FromDiscord<Elegantbeef> The deviation is unreal
00:25:31FromDiscord<evoalg> yea ... that's still with only "hello"
00:27:32FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://play.nim-lang.org/#ix=3Gj8
00:29:08FromDiscord<evoalg> In reply to @Elegantbeef "The deviation is unreal": the deviation true!
00:30:08FromDiscord<Elegantbeef> Is that suppose to fail running Mask?
00:32:39FromDiscord<@MaskRay:matrix.org> Maybe...
00:32:57FromDiscord<Elegantbeef> I just mean that example runs finee
00:34:05FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://paste.rs/Fjw
00:34:38FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://play.nim-lang.org/#ix=3Gj9
00:34:42FromDiscord<@MaskRay:matrix.org> Edited the message. It is fine with refc but crashes with arc/orc.
00:34:46FromDiscord<Elegantbeef> Ah
00:34:53*vicecea quit (Remote host closed the connection)
00:35:02FromDiscord<Elegantbeef> I mean i'd be cautious using a ref in a pointer object, i dont know the validity there
00:35:49*vicecea joined #nim
00:36:11FromDiscord<Elegantbeef> This might be a bug, or this might be bad practice hard for me to reason
00:37:05FromDiscord<Elegantbeef> Hopefully someone smarter than i can weigh in
00:38:22FromDiscord<@MaskRay:matrix.org> Yeah, the usage looks suspicious. I'll just avoid the usage. Since I do manual memory management, I'll just avoid `ref` in the members
00:41:32FromDiscord<konsumlamm> in general, is there any performance difference between writing to a `var` parameter vs returning a new value?
00:42:03FromDiscord<Elegantbeef> Well there is supposed to be NVRO optimization but it can be buggy
00:42:47FromDiscord<Elegantbeef> NVRO should rewrite `proc(args): T` to `proc(args, ret: var T)` and pass the address of the variable in the case of `var a = doThing()`
00:43:12FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-nrvo
00:43:12FromDiscord<konsumlamm> oh, i've heard of NRVO a lot (mostly that it's not reliable), but i never bothered to look it up
00:43:50FromDiscord<Elegantbeef> Depends on the type of course on how bad it is if it fails, but yea if concerned just pass it
00:43:54FromDiscord<konsumlamm> so without NRVO, a `var` parameter would be more efficient because returning something would copy it?
00:44:04FromDiscord<Elegantbeef> Yep
00:44:16FromDiscord<Elegantbeef> It's only a concern with large data types
00:44:27FromDiscord<Elegantbeef> with small type it doesnt make much sense afaik
00:44:41FromDiscord<konsumlamm> i see, ty
00:45:17FromDiscord<Elegantbeef> Didnt know `If p can raise an exception, NRVO applies regardless. `
00:51:51*k0ta joined #nim
00:53:53FromDiscord<evoalg> @ElegantBeef am I correct in thinking that slicing by allocation vs by iterator wont make any practical different for most programs?
01:01:42FromDiscord<Elegantbeef> Well slicing in a for statement creates a copy that is then destroyed by the memory management so indeed
01:05:03FromDiscord<evoalg> (Sorry it might have been a been cheeky for me to suggest that ... even though I don't find it satisfying that slices to that wasteful stuff, I'm wondering if it'll make any practical difference)
01:05:09FromDiscord<Elegantbeef> The only cases you want to keep the value around is when you're doing something like `var a = yourSeq[a..b]` and there is no semantic difference with the iterators
01:05:47FromDiscord<Elegantbeef> I mean it's a correct statement, the only difference is performance
01:06:02FromDiscord<Elegantbeef> Semantically the program will run the same using my iterators or using slices
01:06:16FromDiscord<evoalg> `var a = yourSeq[a..b]` <-- that works with an iterator?
01:06:25FromDiscord<Elegantbeef> Nope
01:06:34FromDiscord<Elegantbeef> That's the proc
01:06:40FromDiscord<evoalg> gotcha
01:06:41FromDiscord<Elegantbeef> iterators are only called in `for` statements or loops
01:06:55FromDiscord<evoalg> ahh ok!
01:06:57FromDiscord<Elegantbeef> i say or loops but i'm being daft
01:07:23*Onionhammer quit (Ping timeout: 256 seconds)
01:08:22FromDiscord<evoalg> I take it you don't like using `for i, x in ...` at any time ... how would you do that instead? ... `for i in ... ` and then just do `a[i]` etc?
01:08:36FromDiscord<Elegantbeef> The issue isnt `for i, x in ...`
01:08:45FromDiscord<Elegantbeef> The issue is the `yourCollection[a..b]`
01:08:57FromDiscord<Elegantbeef> without my package that's making a brand new collection
01:09:03FromDiscord<Elegantbeef> So it's very silly to do
01:09:12*Onionhammer joined #nim
01:10:19FromDiscord<evoalg> but ... but ... even before slicerator, I get the impression you'd avoid ever using `for i, x in` ? (yea I'm changing the subject a bit sorry)
01:10:27FromDiscord<Elegantbeef> No i dont
01:10:38FromDiscord<Elegantbeef> I like the pairs iterator very much
01:10:53FromDiscord<Elegantbeef> My disdain was with using slices + pairs
01:11:36FromDiscord<evoalg> ok phew! All clear now 🙂
01:12:22arkanoidhaving big sad moments with nim <> python interop for science. We're far far from interop
01:12:56FromDiscord<Elegantbeef> The mechanism of `for i, x in coll[a..b]` is a lazy solution to the problem, but i'll give it's easy to do
01:13:17FromDiscord<Elegantbeef> cause you're slicing that collection then iterating over it, so it's doing twice the work
01:13:34FromDiscord<Elegantbeef> What's wrong with the interop?
01:16:09arkanoidpassing strings from arraymancer to python (pandas/numpy) is not working
01:16:25arkanoidit's ok if you stay with numbers, but strings are just no
01:16:55FromDiscord<Elegantbeef> How is the interop beingn done?
01:17:03FromDiscord<Elegantbeef> being done even
01:17:38arkanoidarraymancer + datamancer + scinim/numpyarrays + nimpy
01:18:03FromDiscord<Elegantbeef> Nimpy should handle it
01:18:07FromDiscord<Elegantbeef> But odd that it doesnt
01:18:54arkanoidhttps://play.nim-lang.org/#ix=3Gjg
01:19:04arkanoidit won't run online
01:20:04FromDiscord<Elegantbeef> Jeez i'm going to be testing code that talks to python, what have i done to deserve this
01:21:50arkanoidI'm trying escape python too
01:22:24arkanoidbut I need to move data for this
01:22:37FromDiscord<Elegantbeef> I dont try to escape it
01:22:40FromDiscord<Elegantbeef> I never visited 😛
01:23:56arkanoidgot captured from it due to data science, sadly it has very good tools
01:25:24arkanoidthis is how toNdArray is supposed to be used to move data from nim to python: https://scinim.github.io/getting-started/external_language_integration/nim_with_py.html
01:26:29FromDiscord<Elegantbeef> it errors for you on the `toNdArray`?
01:27:03arkanoidyes, it returns a Error: type mismatch
01:27:16arkanoidnumpyarrays.nim(179, 37)
01:28:22FromDiscord<Elegantbeef> Seems it's 100% just a string tensor isnt happened
01:28:26FromDiscord<Elegantbeef> handled
01:28:29FromDiscord<Elegantbeef> Jeez i cannot type
01:28:47arkanoidthis is the error I get: https://play.nim-lang.org/#ix=3Gjj
01:28:57FromDiscord<Elegantbeef> Yea same error
01:29:22arkanoidexactly. Without the possibility to send a string Tensor to python, no party for science
01:29:54arkanoidactually I'm quite confused if I do really need to use scinim/numpyarrays
01:30:48arkanoidby lurking the arraymancer issues it seems that there a thing called "laser" already merged supposed to make this operation possible, but unsure
01:32:19FromDiscord<Elegantbeef> Well `KnownSupportsCopyMem` is the issue
01:32:32FromDiscord<Elegantbeef> I dont know where it's declared
01:32:55FromDiscord<Elegantbeef> Ah it's in arraymancer
01:33:31FromDiscord<Elegantbeef> https://github.com/mratsim/Arraymancer/blob/66372d249b849102fd196345a08d4563d904751a/src/arraymancer/laser/tensor/datatypes.nim#L17 either string needs to be added here and handled, or a new overload that accepts `Tensor[string]` needs to be implemented
01:33:33arkanoidI think the real issue is this. Try "let data = @[@["a","b","c"],@["d","e","f"]].toTensor.get_data_ptr"
01:34:03FromDiscord<Elegantbeef> It's calling `toUnsafeView` on the tensor and not getting one cause it's not handled for this type
01:34:31arkanoidmaybe because strings does not support copymem?
01:34:52FromDiscord<Elegantbeef> Well they do just not directly
01:35:40FromDiscord<Elegantbeef> https://github.com/mratsim/Arraymancer/blob/66372d249b849102fd196345a08d4563d904751a/src/arraymancer/laser/tensor/initialization.nim#L259 implementing this for a string is probably the only solution
01:36:08FromDiscord<Elegantbeef> should be `cast[ptr UncheckedArray[char](yourString[0].unsafeAddr)` though dont know the downside
01:36:34FromDiscord<Elegantbeef> I very much dont know about it
01:37:09arkanoidI'll just consider nim+python integration not possible when dealing with a dataframe with a string column
01:37:25FromDiscord<Elegantbeef> I think it's fully doable just it'll require copying data
01:39:28arkanoidsure I'm not planning to share GC'ed stuff between the two worlds
01:39:47arkanoidbut how to copy/interop with strings is not documented
01:47:50arkanoidsigh, every time I try to start a new project with nim instead of python, I have to walk back to that old dirty road. Sad. Hopefully I will be able to write some nim functions and export them with exportpy
01:48:26arkanoidthanks for the help Elegantbeef
01:49:37FromDiscord<JOSTGRANT> On the topic of Python vs Nim; Is there a rough equivalent to "Wheels" floating around?
01:51:55arkanoidthis money went to numpy, scipy, matplotlib and pandas: https://chanzuckerberg.com/newsroom/czi-awards-16-million-for-foundational-open-source-software-tools-essential-to-biomedicine/ . Nim is just better for everything, it just lacks libs and users
01:52:27arkanoidJOSTGRANT, what do you mean? Why you want wheels?
01:53:40FromDiscord<JOSTGRANT> To make it trivial to install C/C++ level dependencies for Nim packages in Nimble. Maybe this is already possible and I just haven't looked deep enough though :^P
01:56:02arkanoidAll files and folders in the directory where the .nimble file resides will be copied as-is
01:56:27arkanoidyou can however skip some directories or files by setting the skipDirs, skipFiles or skipExt options in your .nimble file. Directories and files can also be specified on a whitelist basis, if you specify either of installDirs, installFiles or installExt then Nimble will only install the files specified
01:56:39arkanoidI'm just copypasting from https://github.com/nim-lang/nimble
01:57:36FromDiscord<JOSTGRANT> Is that how Wheels works? I have no idea, I assumed it was grabbing offsite and there was just some config you specified or something? Have only been an end-user of it -- not done any of the actual grunt-work to make it happen
01:59:58arkanoidThe *.whl file is similar to an *.egg in that it’s basically a *.zip file in disguise. If you rename the extension from *.whl to *.zip, you can open it up with your zip application of choice and examine the files and folders inside at your leisure
02:01:04FromDiscord<JOSTGRANT> So it's all just prepackaged then (underlying C/C++ dependencies). Fair enough. So wonder if this is just not done as-often currently in Nim because it'd bloat a given package / archive?
02:02:01arkanoidthere's a setup file to do stuff
02:02:52arkanoidhave to go now, sorry, it's damn cold here
02:03:32FromDiscord<JOSTGRANT> arkanoid: np thanks for the clarification!
02:03:46arkanoidyw
02:04:39FromDiscord<JOSTGRANT> _will also def look into it more. Guess it should be trivial for what I've been messing with recently (namely raylib demos ... could just add the given headers to my repo for now I guess anyways)._
02:07:29*xet7 quit (Quit: Leaving)
02:07:55*xet7 joined #nim
02:18:16*k0ta quit (Ping timeout: 245 seconds)
02:18:27*k0ta joined #nim
02:23:02*k0ta quit (Ping timeout: 240 seconds)
02:24:31*kayabaNerve joined #nim
02:25:19*k0ta joined #nim
02:29:06FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3Gjt
02:33:34FromDiscord<Elegantbeef> `K`
02:33:42FromDiscord<Anonymous Poet> it doesnt like it
02:33:54FromDiscord<Anonymous Poet> because it thinks T is of type `Equipment`, which doesnt have a `K`
02:34:09FromDiscord<Elegantbeef> Yea to be expected
02:34:22FromDiscord<Anonymous Poet> i couldnt find a way to get the inherited class type
02:34:37FromDiscord<Anonymous Poet> also all i have is a `typedesc`, not an instantiated obj
02:37:34*neurocyte0132889 quit (Ping timeout: 268 seconds)
02:38:41FromDiscord<Elegantbeef> This seems to be a fun problem to solvee
02:38:51FromDiscord<Elegantbeef> Trying to do it without a macro
02:39:31FromDiscord<Elegantbeef> Macro might be the only case without fields
02:39:45*k0ta quit (Ping timeout: 256 seconds)
02:39:55*k0ta joined #nim
02:40:11FromDiscord<Anonymous Poet> i can maybe kind of cheat it, because i know that the enum is named `EquipmentKind`, (ie. `$T & "Kind"`) if theres a way to turn a string into the type it names
02:41:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Gju
02:44:08FromDiscord<Anonymous Poet> let me play around with it a bit
02:52:43FromDiscord<Elegantbeef> Here is a macro approach https://play.nim-lang.org/#ix=3Gjw
02:52:57FromDiscord<Elegantbeef> Only works for this specific object and relation ship so something can very easily fuck it up i imagine
02:54:06*arkurious quit (Quit: Leaving)
02:58:52FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3Gjy
03:00:48FromDiscord<Anonymous Poet> supposing i know that the structure always follows this pattern (each case only has a single member, with the matching name + type), and we can assume that i can read the correct object; but i need to parse the enum type to know what to read and then cast to the right variant
03:01:35FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3GjF
03:01:41FromDiscord<Elegantbeef> The macro does work if this is the pattern you have
03:02:34FromDiscord<Elegantbeef> Also if it's `kind` is root level on all objects you can do anothing thing
03:02:47FromDiscord<Anonymous Poet> why is the returned object of type `EquipmentKind` instead of `Equipment`?
03:02:59FromDiscord<Anonymous Poet> yes, kind is root level; what do you have in mind?
03:03:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GjG
03:04:09FromDiscord<Anonymous Poet> still prints the same thing :/
03:04:28FromDiscord<Elegantbeef> What's the expected output?
03:04:51FromDiscord<Anonymous Poet> `Equipment`, ie. `get` is supposed to return an object of type T
03:05:01FromDiscord<Elegantbeef> It does
03:05:04FromDiscord<Anonymous Poet> actually im very confused why this is printing the wrong thing
03:05:12FromDiscord<Anonymous Poet> is this the overloaded $?
03:05:32FromDiscord<Anonymous Poet> yup, i was just being dumb
03:06:04FromDiscord<Anonymous Poet> out of curiosity, does the line↵`typeof(T().kind)` actually allocate anything? or is the compiler smart enough to know i just want the type?
03:06:10FromDiscord<Elegantbeef> and no `typeof(T().kind)` is not done at runtiime
03:06:34FromDiscord<Elegantbeef> `typeof` gets the type of an expression so has to be done statically which means compile time
03:08:00FromDiscord<Anonymous Poet> thanks, i think this is close to what i had in mind; let me play around with it a bit. next issue is going to be creating an object of the matching variant
03:26:38FromDiscord<Anonymous Poet> ok, so i did get to the next issue now
03:26:40FromDiscord<impbox [ftsf]> looking at using https://github.com/nim-lang/dialogs i'm wondering if there's a way I can open a dialog but not block my app while it's open?
03:28:36FromDiscord<Anonymous Poet> In reply to @impbox "looking at using https://github.com/nim-lang/dialog": not familiar with this lib, but when you say "block my app" do you mean the app freezes, or that you cant access the content behind the dialog? the second one seems intended, and the first you might need to work around by having a different thread for rendering and working/processing
03:29:51FromDiscord<impbox [ftsf]> the app freezes, I'd like the dialog to run separately and I guess notify my app when a selection has been made
03:30:03FromDiscord<impbox [ftsf]> maybe I can use a separate process
03:30:08FromDiscord<impbox [ftsf]> or threads
03:30:20FromDiscord<Elegantbeef> Yea the easy answer is throw up a thread
03:30:46FromDiscord<Elegantbeef> A thread shouldnt be too bad
03:31:45FromDiscord<Elegantbeef> I atleast assume you're after the `info`/`warning` dialogs?
03:34:12FromDiscord<impbox [ftsf]> nah, open file
03:34:30FromDiscord<impbox [ftsf]> it's for a live music visualiser, so i don't it to pause the show when i want to load in a new file
03:42:05FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3GjX
03:42:24FromDiscord<Elegantbeef> This cannot be done
03:42:29FromDiscord<Anonymous Poet> oh no, why?
03:42:31FromDiscord<Elegantbeef> Without having a list of all types in scope
03:42:46FromDiscord<Anonymous Poet> ah
03:42:49FromDiscord<Elegantbeef> Well you've got a runtime value you want to convert to a type
03:42:49FromDiscord<Elegantbeef> It's not static
03:43:01FromDiscord<Anonymous Poet> this is meant to run at compiletime
03:43:05FromDiscord<Elegantbeef> If that was a `const` it is doable
03:43:09FromDiscord<Elegantbeef> Oh then yes it's doable
03:43:38FromDiscord<Elegantbeef> Though pretty pointless, but i'll show how
03:43:40FromDiscord<Anonymous Poet> its not quite const though; im parsing a schema file and generating the types from that
03:44:01FromDiscord<Elegantbeef> Well if it's done at compile time should be fine
03:44:03FromDiscord<Anonymous Poet> why do you say it is pointless? i might be missing something in that case
03:44:25FromDiscord<Elegantbeef> depends on what you're doing i suppose
03:45:13FromDiscord<Anonymous Poet> i have a schema file and a binary buffer created by that schema; im trying to write a codegen lib that will create the code to parse buffers specified by the given schema
03:45:28FromDiscord<Anonymous Poet> we can assume the schema is known at compile time
03:46:06FromDiscord<Anonymous Poet> ive implemented everything except the variant types that the schema allows
03:47:45FromDiscord<Elegantbeef> It might be doable, depends on how you skin it
03:47:49FromDiscord<Anonymous Poet> i think the way im trying to implement this may or may not be quite right though
03:47:53FromDiscord<Elegantbeef> You're probably better passing it to macro
03:48:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3GjY
03:48:33FromDiscord<Anonymous Poet> in the case of this `get` function, we can assume that the type exists, but is not in scope of this file
03:49:30FromDiscord<Elegantbeef> Can i see the scheme?
03:49:58FromDiscord<Anonymous Poet> i can give an example schema, but it changes, hence the code gen :p
03:50:09FromDiscord<Anonymous Poet> specifically, im trying to write a flatbuffer compiler
03:50:51FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3GjZ
03:52:16FromDiscord<Elegantbeef> I dont know much about flat buffers, but i dont know if this is the right way around
03:52:16FromDiscord<Anonymous Poet> im imagining that the code im writing would be compiled by the end user together with their schema, and would generate some nim files that their project would import to read the data from the schema
03:53:08FromDiscord<Elegantbeef> the way i see it you have a variety of types you tag/id that can be used with a flat buffer then when you store the types it writes `id, data, id, data` ... so then you can access it directly
03:53:34FromDiscord<Elegantbeef> But it only works for static sized types afaik
03:53:41FromDiscord<Elegantbeef> Like i said i dont know anything about it, so probably should shush
03:55:10FromDiscord<Anonymous Poet> thats not quite correct; because the schema is agreed upon out-of-band, you dont have the same static sized type requirements
03:55:30FromDiscord<Elegantbeef> Isnt the entire point of it so you dont have to unpack values
03:55:32FromDiscord<Anonymous Poet> there are still some restrictions (like on alignment, etc), but i dont think thats relevant
03:56:23FromDiscord<Anonymous Poet> i think the point is more that you dont need to deserialize the whole buffer, if youre looking for a specific entry, you can follow a short number of pointer derefs to get what you want
03:57:01FromDiscord<Anonymous Poet> so if i know that my root type is Monster, and given a buffer i want Monster.Pos.Z, i dont need to read the whole buffer and parse it
03:57:05FromDiscord<Elegantbeef> yea i dont know anything about it, from briefly reading i figured you just have your structs stored with an ID so you can access fields
03:58:02FromDiscord<Anonymous Poet> the format is fairly simple though not as well documented as id like, haha :/ structs are just stored as dumps of data, tables are a bit more complex
03:58:23FromDiscord<Anonymous Poet> in any case though, i can read all of the basic types just fine, and mostly do the generic code generation that i want
03:58:52FromDiscord<Anonymous Poet> the problem (and maybe this is a design flaw on my part) is for the unions, i need to read the type (thats fine) and then return an object of the matching type
03:59:18FromDiscord<Anonymous Poet> i can do this, but i dont know how to express the return object construction bit
03:59:34FromDiscord<Elegantbeef> I can only say look at serialization libraries
04:00:37FromDiscord<Anonymous Poet> hmm, not sure that will really help for this; do you have any recommendations for resources on generics in nim? and macros?
04:01:25FromDiscord<Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 is all i really have for macros generics are simple so i dont think you overly need manuals for them 😀
04:01:48FromDiscord<Anonymous Poet> i guess i meant "generics in macros" 😄 thanks
04:06:02*supakeen quit (Quit: WeeChat 3.3)
04:06:32*supakeen joined #nim
04:08:36FromDiscord<Rika> There is a protocol buffer compiler and library in Nim
04:08:42FromDiscord<Rika> Maybe take a look
04:09:45FromDiscord<Anonymous Poet> interesting, thanks
04:15:21meowrayHow to emulate a dynamic_cast with a `template`? Like C++ `if (auto *maybe_sub = dynamic_cast<Sub>(x))`
04:16:23FromDiscord<Elegantbeef> dynamic cast is a conversion to an inherited type?
04:16:58FromDiscord<Anonymous Poet> dynamic cast tries to convert to a parent type
04:17:22FromDiscord<Elegantbeef> Should just be `ParentType(yourType)`
04:17:46FromDiscord<Anonymous Poet> dynamic cast is runtime though; not sure how you can do the conditional like this
04:18:06FromDiscord<Anonymous Poet> and sorry, not parent, child type
04:18:10FromDiscord<Elegantbeef> `if yourType of SpecificType`
04:22:50FromDiscord<Elegantbeef> hopefully that suffices meow
04:23:10FromDiscord<Elegantbeef> actually that should be `yourVal` 😛
04:24:22FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://play.nim-lang.org/#ix=3Gk7
04:24:55FromDiscord<Elegantbeef> Well dont you want to convert it to so it should be `(ptr T)(res)`?
04:25:15FromDiscord<@MaskRay:matrix.org> Ah, yes!
04:30:15FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://paste.rs/65P
04:31:47FromDiscord<@MaskRay:matrix.org> sent a code paste, see https://play.nim-lang.org/#ix=3Gk9
04:31:50FromDiscord<Elegantbeef> Lol
04:31:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Gka
04:32:10FromDiscord<@MaskRay:matrix.org> Your version is correct. Thanks!
04:32:22FromDiscord<Elegantbeef> Well it's not correct as much as an option
04:33:07FromDiscord<Elegantbeef> You may want to look at using type aliases or making your own create that handles this better so you dont need `ptr T` everywhere
04:34:28FromDiscord<Elegantbeef> That is assuming you are mostly doing `ptr T`
04:38:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Gkb
04:38:46FromDiscord<Elegantbeef> Jeez this client hates me
04:38:52FromDiscord<Rika> why the untyped return for templates
04:38:53FromDiscord<Rika> ?
04:39:08FromDiscord<Elegantbeef> I mean it can be typed i was being lazy
05:07:27FromDiscord<@MaskRay:matrix.org> Nice. How do I use object construction syntax with `ptr object`? I.e. I want to initialize `someField` when creating `ChildA`
05:09:50FromDiscord<Elegantbeef> `a[] = typeof(a[])(someField: 30)` it's not ergonomic one bit
05:12:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Gki
05:14:00FromDiscord<Marisol> Hey guys, does norm has automatic created_at and updated_at support? Or need to implement manually for every model?
05:19:42FromDiscord<@MaskRay:matrix.org> Then I'll stick with `object` instead of `ptr object` so that I can use `create`. I am using `ptr` for the main data structure (Section, Symbol) and `ref` for objects with few instances (linker script command) because `ref` has better ergonomics. I guess I am abusing https://nim-lang.org/docs/manual.html#types-mixing-gc-ed-memory-with-nimptr hope I don't run into weird issues...
05:32:29FromDiscord<Elegantbeef> I've not done much with manual memory management so i can only really wish you luck 😀
06:44:19*Doraemon joined #nim
06:46:46*neocron quit (Ping timeout: 260 seconds)
07:25:55FromDiscord<evoalg> When should I use Deepcopy ... when Nim copies by vaulue anyway??
07:42:05FromDiscord<Rika> The value of a reference is merely the pointer
07:42:13FromDiscord<Rika> If you want to cross pointer boundaries you use deep copy
07:43:40FromDiscord<evoalg> ahh thank you!
07:48:55*tinystoat quit (Quit: Reconnecting)
07:49:04*tinystoat joined #nim
08:32:13FromDiscord<Ricky Spanish> how can you convert a string to a byte array?
08:40:35FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3Gl2
08:56:34FromDiscord<qb> Umm how does a compile time os check work? I saw it before somewhere but can't remember. `when win32:`
08:57:13FromDiscord<Elegantbeef> `when defined(windows)`?
08:57:23FromDiscord<qb> thanks
09:59:59FromDiscord<DaiChimpo> Is there a reason a fileStream could = nil after being declared with newFileStream() besides an invalid file name?
10:00:45FromDiscord<DaiChimpo> sent a code paste, see https://play.nim-lang.org/#ix=3Gll
10:01:06FromDiscord<DaiChimpo> it's 5am maybe I should just stop coding lmfao
10:01:31FromDiscord<Rika> Where are you running the program and where is the file located
10:01:41FromDiscord<DaiChimpo> same directory
10:01:52FromDiscord<Rika> Are you running on the terminal
10:02:00FromDiscord<Rika> Is the terminal in the same directory
10:02:32FromDiscord<DaiChimpo> I have another similar program in a parent directory that works, but that's an interesting theory. Lemme try absolute path then
10:05:04FromDiscord<DaiChimpo> ok fair point absolute path works. Terminal is on a separate drive (haha) but program in E:\X\Y works when this in E:\X\A\B\C doesn't. This is for morning me probably
10:07:32FromDiscord<DaiChimpo> god damn it it's because the filename is relative to the terminal's working directory and not the .nim file's directory, I am going to bed
10:08:13FromDiscord<Elegantbeef> `import std/os; setCurrentDir(getAppDir())` 😛
10:56:05FromDiscord<enthus1ast> I always pretend the getAppDir() to a path and do not change the working dir.
10:56:43FromDiscord<enthus1ast> Prepend
10:58:29FromDiscord<enthus1ast> Imho changing the working dir is an antipattern
11:01:47FromDiscord<Rika> Why
11:05:23FromDiscord<enthus1ast> at least in shellscripts its bad because it changes the terminals work dir
11:05:32FromDiscord<enthus1ast> unless you run it in a subshell
11:06:05FromDiscord<enthus1ast> just tried it with nim and does not change the outer work dir
11:06:16FromDiscord<enthus1ast> so maybe not that bad \:)
11:15:40*src joined #nim
11:15:48NimEventerNew thread by Templatedperson: Is it possible to make the program crash if orc gc finds a cyclic reference?, see https://forum.nim-lang.org/t/8662
11:15:54*src quit (Read error: Connection reset by peer)
11:22:31FromDiscord<ag> In reply to @NimEventer "New thread by Templatedperson:": I didn't know there were plans for custom allocators, nice.
11:39:22qwrweird, I can't get the forum page load at all in firefox, even with tracking protection and ublock disabled - but no problem with epiphany
11:39:43*src joined #nim
11:39:49*src quit (Remote host closed the connection)
11:40:54*neurocyte0132889 joined #nim
11:40:54*neurocyte0132889 quit (Changing host)
11:40:54*neurocyte0132889 joined #nim
11:42:40FromDiscord<Yardanico> can you check the console?
11:44:36qwrUncaught TypeError: css.match is not a function modifyCSS https://forum.nim-lang.org/t/8662:461 clicking it gives line not found with no source:)
11:45:27qwralso a lot of CSP warnings - Ignoring “'unsafe-inline'” within script-src: ‘strict-dynamic’ specified; Ignoring “https:” within script-src: ‘strict-dynamic’ specified; Ignoring “http:” within script-src: ‘strict-dynamic’ specified
11:46:49qwrok, let matches = css.match(REGEX_FONT_FAMILY);
11:47:02qwrseems to be the offending line
11:49:02*qwr is not 100% sure, if it is the real cause, but this seems only real exception in the console
11:51:07qwrhm this also - Loading failed for the <script> with source “https://www.googletagmanager.com/gtag/js?id=UA-58103537-1”. just before the exception
11:51:44FromDiscord<Yardanico> well that should be fine
11:52:10FromDiscord<Yardanico> can you maybe check the network tab and see if forum.js is being downloaded?
11:52:16FromDiscord<Yardanico> after refreshing the page
11:53:27qwrGET
11:54:00FromDiscord<Yardanico> yes, but is it being downloaded successfully?
11:54:11qwrhttps://forum.nim-lang.org/js/forum.js?t=2020-08-2420%3A22%3A46
11:54:13qwr200 OK Cached
11:54:17FromDiscord<Yardanico> but yeah, it must be something specific to your environment/network
11:54:22FromDiscord<Yardanico> it works for me in both chrome/firefox
11:56:42qwrthe googletagmanager stuff shouldn't really matter? (seems that i've got it blocked from dns)
11:56:44*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
11:57:08qwrand if it did, it should affect epiphany as well...
11:57:21FromDiscord<Yardanico> yeah, I also run adguard home and have ublock origin installed, yet the forum works
11:57:37FromDiscord<Yardanico> are you blocking recaptcha maybe?
12:01:41*neurocyte0132889 joined #nim
12:01:41*neurocyte0132889 quit (Changing host)
12:01:41*neurocyte0132889 joined #nim
12:05:49qwrnot directly, but i have privacy.firstparty.isolate and privacy.resistFingerprinting enabled
12:06:01*supakeen quit (Quit: WeeChat 3.3)
12:06:31*supakeen joined #nim
12:06:50FromDiscord<Yardanico> well, not sure, never used those, try disabling them
12:07:14qwrdisabled - nothing changed...
12:08:05qwrbut on the other hand, if you're using recaptcha 3 then it gives me really bad scores due not normally being able to track me :)
12:10:50qwr Your score is: 0.3
12:12:03qwrthat is with ublock and tracking protection disabled on the https://antcpt.com/eng/information/demo-form/recaptcha-3-test-score.html
12:15:58FromDiscord<Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=3GlW
12:16:52FromDiscord<enthus1ast> you can use JsonNode (from the json module)
12:17:30FromDiscord<enthus1ast> then you can serialize it with `$ % myJsonVar`
12:17:59FromDiscord<Ricky Spanish> ah awesome thank you
12:20:35FromDiscord<enthus1ast> is greenfork here?
12:32:36FromDiscord<dom96> In reply to @qwr "weird, I can't get": Even the front page? Can you try in a private window (should give a clean session)?
12:39:26qwri've got firefox setup in "always private" mode, and closed the browser, so already did it
12:39:57qwrthe page header shows, like login button, then there is the spinner and white all the way down
12:42:21qwrforum.nim-lang.org also shows the Latest and Changes buttons, and nim-lang.org seems fine
14:33:47*arkurious joined #nim
14:41:32FromDiscord<gdquest> sent a code paste, see https://play.nim-lang.org/#ix=3GmZ
14:42:38FromDiscord<gdquest> sent a code paste, see https://play.nim-lang.org/#ix=3Gn0
14:42:48FromDiscord<gdquest> Could someone tell me what I'm doing wrong?
14:43:05FromDiscord<gdquest> (edit) "Could" => "Does" | "tell me" => "know"
14:45:14FromDiscord<gdquest> (what i'm doing in the meantime is using a plain `proc` instead of a template)
14:45:51FromDiscord<lenis> I dont really see why your template wouldnt work. but I also dont understand why regexWrap isnt just a proc
14:48:20FromDiscord<Rika> templates cant return
14:48:42FromDiscord<Rika> dont put return there and instead rely on implicit value return
14:49:07FromDiscord<lenis> ah yeah thats right
14:49:12FromDiscord<Rika> copy paste = return is copied = proc now returns what template was supposed to return
14:49:18FromDiscord<Rika> = type error
14:50:03FromDiscord<Rika> why not just use a proc? a template here wouldnt improve speeds and would prolly bloat binary size
14:56:34FromDiscord<gdquest> In reply to @Rika "why not just use": That's what I'm doing, I just wanted to see how this worked
14:56:41FromDiscord<gdquest> In reply to @Rika "templates cant return": Thanks! That was that 🙂
14:57:21FromDiscord<gdquest> I just tested making a few templates and macros to get a sense for how they work and what you can do with them basically
14:57:37FromDiscord<gdquest> Thanks for the help
14:57:50FromDiscord<lenis> sent a code paste, see https://play.nim-lang.org/#ix=3Gn6
14:58:30FromDiscord<Rika> need comma
14:58:37FromDiscord<gdquest> Oh, that's cool, thanks!
14:58:46FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Gn7
14:58:50FromDiscord<Rika> also at the end whoops
14:58:54FromDiscord<gdquest> `procName` is a built-in keyword?
14:59:08FromDiscord<lenis> In reply to @Rika "need comma": youre right sorry
14:59:08FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Gn8
14:59:10FromDiscord<Rika> In reply to @gdquest "`procName` is a built-in": no, argument of templaet
14:59:12FromDiscord<Rika> (edit) "templaet" => "template"
14:59:22FromDiscord<gdquest> Ah right, of course 🙂
15:00:20FromDiscord<lenis> you might also have to add {.inject.} im not certain
15:00:52FromDiscord<gdquest> Is there a code formatter or options to have something a bit more like Python's black for Nim? In particular, I'm looking for something that tidies up line returns between procs, things like those
15:01:10FromDiscord<gdquest> I like to use opinionated formatters that just format about everything for you
15:01:37FromDiscord<gdquest> E.g. `black` will ensure there are always 2 lines between functions and classes in Python
15:03:04FromDiscord<qb> `nimpretty` ?
15:03:40FromDiscord<Rika> nimpretty is opinionated
15:03:52FromDiscord<gdquest> I use it, sure, but it doesn't do the above
15:04:10FromDiscord<Rika> i was planning on making a stronger formatter but i did not have the time
15:04:16FromDiscord<Rika> or rather still do not
15:04:16FromDiscord<qb> aww
15:04:42FromDiscord<gdquest> A formatter in Nim seems pretty fun to make as you have the whole AST,
15:04:50FromDiscord<gdquest> But it's always quite a bit of work
15:05:18FromDiscord<Rika> well you'll need to find out where to get the parser (prolly compiler-as-a-package but i dont know the status of that)
15:05:31FromDiscord<gdquest> Ah okay
15:06:22FromDiscord<gdquest> I'm not fond of how nimpretty does line returns either, it tries to keep things packed vertically and doesn't favor making things easier to read I feel
15:06:23FromDiscord<lenis> btw
15:07:20FromDiscord<gdquest> sent a code paste, see https://play.nim-lang.org/#ix=3Gnr
15:07:21FromDiscord<lenis> since when you you do tuple unpacking
15:07:31FromDiscord<Rika> forever
15:07:44FromDiscord<gdquest> I'm just learning but saw this in the manual I think
15:08:21FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3Gnt
15:08:35FromDiscord<Rika> which is why i was planning on making a flexible one (prolly more akin to clang-format)
15:09:25FromDiscord<gdquest> Yeah so to me opinionated should be non-configurable, but driven by UX design work
15:09:40FromDiscord<gdquest> That is, gathering data on what people find most readable and formatting like that
15:10:18FromDiscord<gdquest> I doubt that's how nimpretty was developed, that is, gathering quantitative feedback and doing A/B testing with many users
15:10:38FromDiscord<gdquest> Which is fine, it's still a useful tool
15:11:15FromDiscord<gdquest> It's just that it simply splits lines longer than 80 character after an operator. It's a sound, simple rule programming-wise
15:11:38FromDiscord<gdquest> But it doesn't optimize for what's easiest to read for most people
15:12:05FromDiscord<gdquest> Nimpretty will let you split lines however you want too, if you want to do it manually instead
15:12:38FromDiscord<gdquest> Anyway, thanks much once again.
15:13:04FromDiscord<gdquest> (edit) "Nimpretty will ... let-" added "also" | "alsolet you split lines however you want too, if you want to do it manually instead ... " added "- it just checks the line length"
15:13:15FromDiscord<gdquest> (edit) "Nimpretty will also let you split ... lines" added "and format"
15:14:08FromDiscord<Rika> In reply to @gdquest "Yeah so to me": well i want it to be configurable, but the defaults are also good
15:31:52*Bager170 joined #nim
15:32:13Bager170are there plans to make the fields iterator work for object variants? i don't see why they shouldn't
15:36:25FromDiscord<Rika> technically cant (unless you mean what i think you mean) because fields is a compiletime iterator and whichever fields actually are part is dependent on runtime info
15:38:08Bager170couldn't you expand it to a case statement?
15:38:58Bager170like you put all the fields of one object variant into one case statement branch and same for the other one
15:39:56Bager170or am i wrong in thinking that the fields iterator acts like a macro?
15:40:18FromDiscord<Rika> im thinking about it
15:40:49FromDiscord<Rika> it could probably work but that would be a large possibly breaking change i'd assume
15:41:03FromDiscord<Rika> or new edge case issues
15:45:20FromDiscord<Slava0135> found vscode theme fitting Nim style https://media.discordapp.net/attachments/371759389889003532/914542481490706562/unknown.png
15:46:09*Bager170 quit (Quit: Client closed)
16:06:47FromDiscord<hmmm> oioi I need to parse an xml file and get out all the contents between a tag. Since there are many I also want all the matches placed on a seq. What should I use?
16:07:11FromDiscord<Rika> xmltree?
16:07:21FromDiscord<hmmm> sounds right
16:07:25FromDiscord<hmmm> I'll look into it
16:07:42FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=3GnN
16:08:48FromDiscord<Rika> no
16:08:53FromDiscord<Rika> afaik at least
16:09:09FromDiscord<Rika> prolly something's there but i would call it "hacky"
16:09:19FromDiscord<Rika> maybe something to do with line instantiation info
16:27:34FromDiscord<qb> In reply to @Slava0135 "found vscode theme fitting": Which one is that?
16:29:19FromDiscord<Slava0135> In reply to @qb "Which one is that?": rainglow https://media.discordapp.net/attachments/371759389889003532/914553549214613547/unknown.png
16:29:31FromDiscord<Slava0135> (edit) "In reply to @qb "Which one is that?": rainglow ... https://media.discordapp.net/attachments/371759389889003532/914553549214613547/unknown.png" added "plugin"
16:30:31FromDiscord<Slava0135> ~~one i showed above wasn't contrast~~
16:31:56FromDiscord<Slava0135> contrast https://media.discordapp.net/attachments/371759389889003532/914554208722776105/unknown.png
16:34:29NimEventerNew thread by Codic12: Errors with Option[T] on 1.4.8, see https://forum.nim-lang.org/t/8664
16:36:58FromDiscord<qb> In reply to @Slava0135 "rainglow plugin": Thats pretty cool. But the bottom toolbar is yellow which makes it almost unreadable
16:39:40*anddam quit (Quit: WeeChat 3.3)
16:40:08FromDiscord<Slava0135> yea
16:40:54FromDiscord<codic> In reply to @NimEventer "New thread by Codic12:": thanks, bot
16:42:49*anddam joined #nim
16:51:16FromDiscord<TryAngle> is there something like a ↵while let x = ... and x.isSome()↵in Nim?
16:51:21FromDiscord<qb> How would I make a hint message in my nim.cfg? Or echo some message
16:53:02NimEventerNew question by ChrisoLosoph: Does single file type exist to get path or name of a file in Nim?, see https://stackoverflow.com/questions/70145573/does-single-file-type-exist-to-get-path-or-name-of-a-file-in-nim
17:02:00FromDiscord<hmmm> oi I want to use the magic incantation "with <file open>: do a lot of thingies" where do I find the docs about it
17:02:21FromDiscord<hmmm> I remember using it in the past but forgot all about it lol
17:04:55FromDiscord<Rika> In reply to @TryAngle "is there something like": no
17:05:17FromDiscord<Rika> In reply to @hmmm "I remember using it": i dont recall such a thing being in the standard library'
17:06:31FromDiscord<qb> Something like that was in the template documentation https://nim-lang.org/docs/tut2.html#templates
17:07:14FromDiscord<Rika> i dont think its recommended anymore though as destructors are slowly being introduced
17:07:15Amun-Rathere's pascal-like
17:07:22Amun-Ra…'with' in Nim
17:09:20*src joined #nim
17:10:01FromDiscord<hmmm> I'm pretty it exists 🤔
17:10:04FromDiscord<hmmm> sure
17:10:40Amun-Rahttps://nim-lang.org/docs/with.html ;>
17:10:58FromDiscord<hmmm> oh u see
17:11:02*src quit (Client Quit)
17:11:16FromDiscord<hmmm> but does it work with files
17:11:26FromDiscord<hmmm> I see a string example 🤨
17:12:08Amun-Rait works closely to Pascal's with equivalent
17:12:22Amun-Raand it's a different beast than Python one
17:13:31FromDiscord<JOSTGRANT> In reply to @Slava0135 "contrast": Pretty dang close to Ayu tbh
17:14:49FromDiscord<Slava0135> show me
17:15:40FromDiscord<Rika> In reply to @hmmm "I'm pretty it exists": "with" exists but not the one you describe
17:20:07FromDiscord<JOSTGRANT> @Slava0135 Okay, not as-much as I remember. lool ↵(Example is the bottom of crown.nim from greenfork's raylibnow proj) https://media.discordapp.net/attachments/371759389889003532/914566335269339186/unknown.png
17:21:22*terminalpusher joined #nim
17:21:26FromDiscord<Rika> ~~god damn thats a real hard to read font~~
17:21:36FromDiscord<JOSTGRANT> Think I'm 'remembered' / recall a similarity with the yellow for keywords, and orange in Ayu, green strings, and purple being present.
17:21:57FromDiscord<Rika> ah yes yellow and orange my worst nightmare
17:23:34FromDiscord<JOSTGRANT> Should be 'droid sans mono'; Though I'm not really font-picky unless it's REALLY out there. lol
17:23:53FromDiscord<Rika> it's just too thin for me
17:24:32FromDiscord<JOSTGRANT> "Thin" as-in not enough spacing between characters, or the actual characters themselves are too thin?
17:24:52FromDiscord<Rika> latter
17:25:34FromDiscord<JOSTGRANT> It's honestly something I don't even consciously notice; Now that I'm looking can see it between numerals though I guess.
17:25:55FromDiscord<Rika> i notice because i read much more erratically lmao
17:26:01FromDiscord<Rika> or slowly
17:26:36FromDiscord<JOSTGRANT> For me, I feel like color-themes are more important than most fonts tbh. But very possibly I'm "the weird one". lol
17:26:56FromDiscord<Rika> oh colour matters a lot too but font thickness isnt negligible
17:28:26FromDiscord<JOSTGRANT> I guess they (fonts) are just easier to 'not notice' consciously ; When a bad 'theme' can result in actual revulsion
17:28:47FromDiscord<Rika> ~~me swearing by my solarized~~
17:31:02FromDiscord<JOSTGRANT> I've jumped all around; When I was still on Emacs I wrote a custom light and dark theme and was pretty happy with them -- then switched to Atom then eventually VSCode an about a dozen-or-so themes in that transitionally period and at somepoint @lqdev either recommended and/or just posted screenshots in this server about Ayu and have been on 'Ayu Mirage' ever since.
17:31:25FromDiscord<JOSTGRANT> (edit) "an" => "and"
17:32:15FromDiscord<Rika> i use solarized because i can actually see the differences between colours without taking idk 3 seconds to compare
17:32:47FromDiscord<JOSTGRANT> Yeah, not a huge fan of Solarized but am 100% with them in the goal of highly contrasted themes are the ideal
17:33:56FromDiscord<TryAngle> In reply to @Rika "no": ok ty
17:34:12FromDiscord<JOSTGRANT> Well I guess solarized isn't "highly contrasting" tbf but the hues are notable enough to 'not be a problem'
17:34:18FromDiscord<Rika> In reply to @TryAngle "ok ty": i mean there probably is in some macro beef made but L O L
17:34:25FromDiscord<Rika> not something for prod i'd say
17:34:41FromDiscord<Rika> In reply to @JOSTGRANT "Well I guess solarized": its been a massive help yes
17:35:44FromDiscord<JOSTGRANT> I think Ayu Mirage fits into a similar niche; There's not an extreme amount of 'pop' compared to the bg but it's certainly more than enough to easily tell apart elements
17:36:14FromDiscord<JOSTGRANT> It doesn't feel like everything is a "shade of grey" which seems pretty common in theme design. lol
17:38:54FromDiscord<TryAngle> In reply to @Rika "i mean there probably": ah true I forgot that you can almost write your own language in nim XD
17:40:58FromDiscord<TryAngle> what is a lent? https://media.discordapp.net/attachments/371759389889003532/914571579634102332/unknown.png
17:43:56FromDiscord<Rika> "Lent is a solemn religious observance in the Christian liturgical calendar commemorating the 40 days Jesus spent fasting in the desert"
17:43:58FromDiscord<Rika> im joking
17:44:53FromDiscord<Rika> https://nim-lang.org/docs/destructors.html
17:46:48*src joined #nim
17:47:00*src quit (Remote host closed the connection)
17:48:02FromDiscord<hmmm> oioi I want to chunk my stringies in pieces of 64 chars lines
17:48:05FromDiscord<hmmm> how do I
17:49:57FromDiscord<hmmm> like this: https://www.php.net/manual/en/function.chunk-split.php
17:50:23FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3GoA
17:50:54FromDiscord<hmmm> isn't there something like chunkthis(string,64)
17:51:16FromDiscord<Rika> itertools 3rd party lib
17:51:20FromDiscord<hmmm> hmm
17:51:21FromDiscord<Rika> or was it iterutils
17:51:26FromDiscord<Rika> i dont fuckin know go ask a computer
17:51:30FromDiscord<hmmm> lol
17:51:56FromDiscord<hmmm> Rika = :nim1:
17:52:55FromDiscord<apahl> In reply to @Rika "https://nim-lang.org/docs/destructors.html": Theses hooks only have effect with ORC and ARC, not with the "normal", is that correct?
17:53:05FromDiscord<apahl> (edit) ""normal"," => ""normal" GC,"
17:53:18FromDiscord<apahl> (edit) "Theses" => "These"
17:54:38FromDiscord<Rika> i dont know the answer to that, but from what i recall (and know that my memory is more spotty than a consumer ram stick in a nuclear reactor site), they do get called
17:55:03FromDiscord<apahl> Lol, fair enough.
18:08:56FromDiscord<TryAngle> In reply to @Rika ""Lent is a solemn": ty
18:09:09FromDiscord<TryAngle> are arrays or strings indexed with uint or int?
18:15:21*Guest19 joined #nim
18:15:48Guest19Hello.I am on Fedora 35 and there is no match for the Nim package. Anyone knows what's up?
18:16:02Guest19Is it working for everyone else?
18:18:21FromDiscord<hmmm> Rika I actually wrote a while loop to chunk stuff around. I feel it's so solid it could blaze into our std
18:23:48Guest19Looks like the Nim package is unmaintained? https://src.fedoraproject.org/rpms/nim
18:31:01FromDiscord<hmmm> hmm
18:31:32FromDiscord<hmmm> I mean it's fedora, as far as we know shipping decade old stuff is "part of the plan"
18:32:41FromDiscord<hmmm> apparently both arch and aur are still at 1.4.x
18:34:18FromDiscord<apahl> In reply to @Guest19 "Looks like the Nim": IMO, the easiest way to install Nim on Linux and to keep it up to date, is to clone the repo and run `./build_all.sh` (https://github.com/nim-lang/Nim/#compiling)
18:34:37nrds<Prestige99> or just use choosenim
18:36:00nrds<Prestige99> I think that easiest
18:36:04nrds<Prestige99> that's*
18:40:40Guest19Alright. Cool.
18:40:42*Guest19 quit (Quit: Client closed)
18:43:08FromDiscord<huantian> In reply to @hmmm "apparently both arch and": Ik mainline arch is, idk about aur
18:43:21FromDiscord<huantian> I just use the choosenim package
18:47:25FromDiscord<JOSTGRANT> In reply to @hmmm "apparently both arch and": Just checked, yeah, 1.4.8 on Arch
18:48:27FromDiscord<JOSTGRANT> As other's have said; Would 100% just use choosenim
19:44:41Amun-Rawhat's the fastest way of setting all elements of seq to 0?
20:01:52FromDiscord<TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3Gpv
21:42:35*Doraemon quit (Quit: Leaving)
21:42:56*NeoCron joined #nim
21:43:23FromDiscord<DaiChimpo> is there a nim equivalent of _getch()?
21:48:37Amun-Rathere's getch in terminal module
21:56:43FromDiscord<Phytolizer> how can one get the current username in nim? i know how to get it in C using getlogin_r(), is there a similar function in Nim?
21:59:35Amun-Ragetlogin in posix module
21:59:55Amun-Rathere's getlogin_r, too
22:01:15FromDiscord<Phytolizer> oh i was missing that module when searching the wiki. thanks
22:01:44FromDiscord<Phytolizer> (edit) "wiki." => "docs."
22:09:48FromDiscord<Yardanico> In reply to @Phytolizer "how can one get": You might also want to check out https://nim-lang.org/docs/os.html#getHomeDir , it's about the home dir but it's cross platform
22:10:51FromDiscord<Yardanico> It just gets the home dir from the env variable though
22:24:27*fputs4 joined #nim
22:26:11*fputs quit (Ping timeout: 245 seconds)
22:26:11*fputs4 is now known as fputs
22:47:13*NeoCron quit (Quit: Leaving)
23:27:52*terminalpusher quit (Remote host closed the connection)
23:39:30FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=3Gqp
23:41:02FromDiscord<Phytolizer> In reply to @Yardanico "You might also want": yeah i saw that but am only using Linux and so the getlogin() fn is good enough for me rn
23:41:08FromDiscord<Elegantbeef> That just means you dont have `{.base.}` applied to the method, which you do
23:41:22FromDiscord<Elegantbeef> So i can only imagine you're using an older nim version since it doesnt appear on 1.6.0
23:41:33FromDiscord<Phytolizer> using 1.7.1
23:43:21FromDiscord<Phytolizer> do you think it is just a bug in nimlsp? it does compile with nim
23:43:47FromDiscord<Phytolizer> using nimlsp 0.3.2
23:45:03FromDiscord<Elegantbeef> Quite possibly
23:45:24FromDiscord<Elegantbeef> Does `nim check` print any errors?
23:45:35FromDiscord<Phytolizer> nope
23:46:08FromDiscord<Elegantbeef> Then something spooky is happening 😛
23:46:44*adium quit (Quit: Stable ZNC by #bnc4you)
23:47:37FromDiscord<Phytolizer> alright, i'll type up an issue. thanks