<< 19-10-2022 >>

00:04:14*krux02 quit (Quit: Leaving)
00:33:13FromDiscord<ShalokShalom> In reply to @ratapenado "Hello, I was wondering": Godot
00:33:30FromDiscord<ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
00:33:44FromDiscord<Rika> Well he said web interface specifically
00:33:49FromDiscord<Rika> So I don’t think that applies
00:33:52FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=1Xhl
00:34:09FromDiscord<Rika> In reply to @sOkam! "What does this type": The error is further within the template
00:34:18FromDiscord<Rika> So that’s just a hint really
00:34:26FromDiscord<ShalokShalom> I assume it's meant to have both web presence and desktop app with one code base
00:34:41FromDiscord<Elegantbeef> did you miss the 'web interface'
00:34:52FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=1Xhn
00:35:33FromDiscord<ShalokShalom> In reply to @Elegantbeef "did you miss the": No, I just assumed the intent
00:35:48FromDiscord<ShalokShalom> And it's 2.35am here 😅
00:37:28FromDiscord<sOkam!> I guess it was that `logg` is a template, and I'm defining it wrong in some way I don't understand. Will make it proc for now 🤷‍♂️
00:46:53FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=209u
00:47:07FromDiscord<sOkam!> (edit)
00:47:30FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=209u" => "https://play.nim-lang.org/#ix=28AU"
00:51:25arkanoidhow can I reference current table being filled within a sugar.collect loop
00:52:37*disso_peach quit (Remote host closed the connection)
00:52:55*disso_peach joined #nim
00:55:33FromDiscord<Elegantbeef> Dont think you can
01:01:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=2pWI
01:01:31FromDiscord<Elegantbeef> That's correct, that will not error
01:02:11FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=2pWK
01:03:18FromDiscord<sOkam!> why is it segfaulting then? what am i missing?
01:03:33FromDiscord<Elegantbeef> Are you certain that's where the segfault is?
01:03:44FromDiscord<sOkam!> i mean, that's where the console says it is
01:03:57FromDiscord<Elegantbeef> Well without a min reproduction i cannot say much
01:04:19FromDiscord<sOkam!> i know. i just don't know how to get a minimal reproduction version
01:04:25FromDiscord<sOkam!> else I would have posted it
01:04:28arkanoidLol, nim check process has 12GB heap
01:04:49FromDiscord<Elegantbeef> What's the actual code you're running into the issue with?
01:04:57FromDiscord<Elegantbeef> Lol nimcheck might've bit the dust
01:06:15FromDiscord<sOkam!> In reply to @Elegantbeef "What's the actual code": nimgl/examples/topengl.nim↵but its broken away into separate pieces and objects, the code itself worked before. I'm just doing something wrong with the object declaration/initialization/etc
01:08:01arkanoidI'm in a loop where nim check fills ram, kernel kills it, work for 5 minutes, repeat
01:08:05FromDiscord<sOkam!> I added an echo to several lines afterwards, and it seems like that specific line is not the issue
01:08:18FromDiscord<Elegantbeef> What's the entire procedure?
01:10:10FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=2vkw
01:10:26FromDiscord<Elegantbeef> `vert` isnt intialised
01:12:43arkanoidNow I have to reboot the whole machine due to nim check, damn
01:13:11FromDiscord<sOkam!> yeah, I guess I will need a newRenderer() proc after all. Thought I could get away without it, but seems more troublesome for complex types
01:15:37FromDiscord<CircArgs> sent a code paste, see https://play.nim-lang.org/#ix=2x7F
01:16:27FromDiscord<Elegantbeef> Cause you do `.uint64` which means the integer has to be valid
01:16:34FromDiscord<Elegantbeef> you should do `18446744073709551602u64`
01:18:27FromDiscord<CircArgs> @ElegantBeef Thanks it worked! Would you mind clarifying "has to be valid" what is invalid about it with or without the cast?
01:19:19FromDiscord<Elegantbeef> `18446744073709551602` is parsed as a `int`
01:19:19FromDiscord<Elegantbeef> That's outside of the range of `int` as such it errors
01:20:05FromDiscord<Elegantbeef> the `u64` obviously says "this is a uint64 literal so parse it as such"
01:21:02FromDiscord<CircArgs> I see that does make sense. thanks for clarifying
01:30:34*arkurious quit (Ping timeout: 246 seconds)
01:30:54arkanoidI've found which line sends nim check in a crazy loop that fills computer ram when decommented
01:41:52arkanoidis it possible to fill an array with collect?
01:42:18arkanoidkind of collect(array[5,int]): ...
01:49:15FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#ix=2DAO
01:49:25FromDiscord<morgan> (edit)
01:50:38FromDiscord<Elegantbeef> Do you have a bitfield?
01:53:08FromDiscord<morgan> it looks like it can take `SomeInteger`, it's an `int` and uses an int to choose which bit is being set https://media.discordapp.net/attachments/371759389889003532/1032109111053144075/unknown.png
01:53:48FromDiscord<Elegantbeef> What is the type of `myObj2Int`?
01:54:08FromDiscord<morgan> `int`
01:55:42FromDiscord<Elegantbeef> And what's the typedefinition for the type with that field?
01:55:46FromDiscord<morgan> MyObj2 also contains a string and an array of `int`s that i've successfully used bitops stuff with for a bit now
01:56:43FromDiscord<Elegantbeef> Cannot say much without any code
01:59:31FromDiscord<morgan> i'll just replace it with oring with a shifted 1
01:59:59FromDiscord<morgan> that's probably what it does anyways and its not that performance critical
02:33:37FromDiscord<Patitotective> i was making a pr to nim-lang/packages and to test my changes i had to fetch thousands of repositories, that with slow internet takes too much time (more than 10 mins) so i was wondering if introducing a `-d:dontFetchRepos` flag to test everything but the repos was something that could be considered to include in `package_scanner.nim` 🤔
02:33:55FromDiscord<Elegantbeef> Prs welcome
02:34:27FromDiscord<Patitotective> In reply to @Elegantbeef "*Prs welcome*": already making it ;]
03:11:29*derpydoo quit (Quit: derpydoo)
03:48:18*NimBot joined #nim
03:48:21*Onionhammer joined #nim
03:48:41*def-- is now known as def-
03:49:52*m5zs7k joined #nim
03:49:59*jkl joined #nim
03:59:40*kenran joined #nim
04:19:00*vicecea joined #nim
04:27:29*hochata quit (Remote host closed the connection)
04:31:24*kenran quit (Remote host closed the connection)
05:55:28*kenran joined #nim
06:18:20*PMunch joined #nim
06:57:37*kenran` joined #nim
06:59:48*kenran quit (Ping timeout: 264 seconds)
07:12:26FromDiscord<vindaar> arkanoid\: you can either make a PR to add something in `si_units.nim` or you can define your completely own system like so\: https://github.com/SciNim/Unchained/blob/master/examples/custom_unit_system.nim
07:15:04FromDiscord<Phil> I wonder if you can get a db's name out of a DbConn type. For sqlite it seems already difficult because the core object just appears out of nowhere in the source code
07:17:01FromDiscord<Phil> That being the Sqlite3 struct and apparently I'm incapable of reading the docs of the c lib because I can't see anything about the structs fields in there
07:22:55*Jjp137 quit (Read error: Connection reset by peer)
07:27:13FromDiscord<Phil> Für postgres it seems surprisingly easy, they have a straightforward host field...↵↵Question: does this mean that sqlite types don't have fields?↵`Sqlite3 {.pure, final.} = object`
07:30:57*Jjp137 joined #nim
07:32:03FromDiscord<Bung> means cant inherit from it
07:33:06FromDiscord<Phil> After that line starts a new type definition so no fields defined in that file, just wondering if there might be some c magic going on that grants this type the fields of the c struct
07:34:52FromDiscord<Phil> I'm pretty sure that at the very least the sqlite struct represents a file handle so shouldn't it somewhere contain the path to the file it's a handle to?
07:46:40FromDiscord<Elegantbeef> Yes it has no fields
07:46:53FromDiscord<Elegantbeef> It has no type information and no fields, it's a opaque type
07:47:21FromDiscord<Elegantbeef> It's likely that the C library has a pointer type which nim uses `ptr T` for
08:04:57*rockcavera quit (Remote host closed the connection)
08:11:02FromDiscord<Phil> So I still have a chance of there being a filepath stored somewhere... I just need to figure out how to access the fields on the C struct?
08:21:09FromDiscord<demotomohiro> C libraries often hide fields of struct so that user cannot access them directly and provide functions to access data stored in the struct.
08:21:42FromDiscord<Elegantbeef> Yea i'd see if there was a function to access it
08:22:00FromDiscord<Elegantbeef> If not, then i guess you get to play pointer arithmetic
08:24:09FromDiscord<demotomohiro> Once you open the file and got a file handle to it, you can read and write to the file without file path.↵It might discard a file path after opening the file.
08:26:53FromDiscord<Phil> Dangit
08:59:43arkanoidvindaar, I went to the custom route (actually copypaste of original and edit)
09:00:26arkanoidvindaar, I've successfully converted all my code to unchained! it works nice, except that nim check now occasionally goes nuts, fills my ram, and I have to hard reboot the machine
09:00:53arkanoidnot quite unchained problem ^^" but yet it's stopping my party
09:01:26FromDiscord<vindaar> yeah, nimsuggest (or do you run nim check manually?) doesn't like crazy macro code \:(↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
09:05:43arkanoidvindaar, I'm using vscode, which has "check code by using nim check on save"
09:06:46arkanoidthere's also "enable nimsuggests" checkbox, which says it provides suggestions, hover suggestions, etc
09:16:01arkanoidI'm failing in producing a quite easy template. I just want to repace infix func name and operator https://play.nim-lang.org/#ix=4dyr
09:25:07FromDiscord<Bung> shouldn't this be legal ? https://github.com/nim-lang/Nim/blob/devel/tests/types/tillegaltyperecursion.nim
09:27:03FromDiscord<impbox [ftsf]> anyone know of a workaround to get offsetOf to work with array members?
09:27:15FromDiscord<impbox [ftsf]> https://play.nim-lang.org/#ix=4dys
09:39:12FromDiscord<Generic> Arrays are guaranteed to lie linearly in memory so you can just do isize(T) whereas T is the element type
09:40:04FromDiscord<Generic> Add that to the offset of the array object member
09:43:57arkanoidcan I use a template to generate function with generic parameters?
09:44:19arkanoidwhat comes first, template expansion or generic function generation?
09:44:23FromDiscord<impbox [ftsf]> In reply to @Generic "Add that to the": hmm yes... i can nearly do it i think, i just need to figure out the sizeof the member of the array
09:45:03FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=4dyz
09:45:33FromDiscord<impbox [ftsf]> `Error: identifier expected`
09:46:32FromDiscord<impbox [ftsf]> how can i get the type of an array member?
09:50:43FromDiscord<impbox [ftsf]> typetraits' elementType seems useful
09:52:52FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=4dyD
09:53:01FromDiscord<Generic> You can just do either t.m.T or typeof(t.m).T
09:53:37FromDiscord<Generic> Like with any generic object you can retrieve the parameters
09:54:18FromDiscord<impbox [ftsf]> undeclared field typeof(t.m).T -> undeclared field T
09:55:49FromDiscord<Generic> What about the other one?
09:56:18FromDiscord<impbox [ftsf]> same
09:56:34FromDiscord<Generic> Weird
09:57:00FromDiscord<Generic> Maybe it doesn't work because it's a builtin type
09:57:18FromDiscord<Generic> sizeof(typeof(t.m))
09:57:30FromDiscord<Generic> Should work though
09:57:55FromDiscord<impbox [ftsf]> it does, but it doesn't tell me the size of the elements
09:58:02FromDiscord<impbox [ftsf]> unless i can get the number of elements and divide
09:58:39arkanoidI've closed vs studio and now I'm using basic text editor, but "nimble build" fills ram (32GB) and crash everything
09:58:51FromDiscord<Generic> Eh I meant sizeof(typeof(t.m[0]))
09:59:06*xet7 joined #nim
09:59:25FromDiscord<Generic> And you can get the length of the array with len
09:59:28FromDiscord<impbox [ftsf]> nah can't do `t.m[0]` identifier expected
09:59:38FromDiscord<Generic> Oh wait
09:59:58FromDiscord<Generic> You're doing this in a template
09:59:59FromDiscord<impbox [ftsf]> `sizeof(t.m) div t.m.len` works
10:00:13FromDiscord<impbox [ftsf]> yup, doing this in a template
10:00:35FromDiscord<vindaar> arkanoid\: https://play.nim-lang.org/#ix=4dyF
10:00:43FromDiscord<impbox [ftsf]> playground down
10:00:56arkanoidplayground down
10:01:11FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4dyI
10:01:57FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=4dyJ
10:02:20FromDiscord<Generic> ah
10:02:28FromDiscord<Generic> t is a typedesc and not
10:02:32FromDiscord<Generic> a concrete variable
10:02:46FromDiscord<Generic> ok, now I know why my stuff didn't work earlier
10:03:02FromDiscord<impbox [ftsf]> though i just realised my problem is more complex, since I actually want↵`offsetOf(Foo, bar[0].baz)`
10:03:07FromDiscord<impbox [ftsf]> (edit) "bar[0].baz)`" => "bar[3].baz)`"
10:03:25FromDiscord<Generic> just add the offsetof from array type again onto it
10:04:19FromDiscord<impbox [ftsf]> yep, maybe a macro would work better
10:04:38FromDiscord<Generic> idk if you have to do this really often, that might be warrented
10:04:50FromDiscord<impbox [ftsf]> mmm hopefully not =)
10:05:02FromDiscord<impbox [ftsf]> i'll just make a hacky solution for this one case
10:05:10FromDiscord<Generic> ah there's another way
10:05:29FromDiscord<Generic> you can technically also just subtract the pointer of the the element from the pointer of the start
10:05:41FromDiscord<Generic> (edit) "element" => "field"
10:05:59FromDiscord<Generic> only then you're responsible for the fact that there's no implicit deref somewhere
10:06:03FromDiscord<Generic> because then you'll get bogus sizes
10:06:47FromDiscord<impbox [ftsf]> yeah, i'd be happy to do that, except it's referring to types not instances
10:06:56FromDiscord<impbox [ftsf]> maybe i can just make a fake instance and use that to get the offsets
10:08:54arkanoidvindaar, that was the problem, also T and J are Tesla and Joule
10:12:24FromDiscord<vindaar> yeah, but for those the compiler isn't confused (for some reason). It's only `static` that it doesn't like
10:14:03arkanoidno, it get confused too, I had to replace them to make your example work
10:14:24arkanoidit was clearly complaning for some Joule and Tesla thing, which are not really into my logic
10:14:57arkanoidthis compiles and run https://play.nim-lang.org/#ix=4dyO
10:16:31FromDiscord<vindaar> huh, it worked locally for me.
10:16:31FromDiscord<vindaar> which nim version are you on?
10:17:43arkanoid1.6.8
10:19:41arkanoidit works! thanks, this saved a ton of boilerplate code
10:21:00FromDiscord<vindaar> maybe it's something that was fixed in devel then? Or my code was too simple. Anyway, glad it works
10:28:06arkanoidI'm facing "nimble build" that fills 32GB and ram and crashes everything. What0s wrong with https://play.nim-lang.org/#ix=4dyS ?
10:32:38arkanoidit's due to openArray. If I use seq as argument it doesn't behave that way
10:46:42arkanoidI have to deal with array * seq ops, and seq * array ops, this would be the perfect fit for openArray, but if I use it, nimble build goes loop
11:01:01FromDiscord<vindaar> arkanoid\: just added \~all trigonometric functions to measuremancer and some tests & CI https://github.com/SciNim/Measuremancer/pull/3
11:01:20arkanoidhooray!
11:04:26arkanoidI'm trying to extract from my code the minimal example that makes compilator go loop
11:12:25*arkurious joined #nim
11:18:16arkanoidvindaar: can you explain this? With `when` to false, code compiles and runs correctly, with `when` to true, compiler goes loop. I suggest you to don't paste this into anything that would run nim check or run compilation automatically. I thing it would crash play.nim-lang too https://play.nim-lang.org/#ix=4dz0
11:18:37arkanoidif you nim c from command line, you can just ctrl-c before it fills your ram
11:28:57arkanoidhere's a possible way to better understand what's going on withou unchained in the equation https://play.nim-lang.org/#ix=4dz2 , why compiler wants to run function in "when" block ?
11:33:17FromDiscord<Bung> @ElegantBeef https://github.com/nim-lang/Nim/pull/20597 how about this ? the const closure thing
11:44:39*jmdaemon quit (Ping timeout: 252 seconds)
12:30:33arkanoidsolved
12:35:36FromDiscord<vindaar> arkanoid\: I was afk. How did you solve it? And was it specific to `collect`?
12:51:48arkanoidvindaar, I've fixed the recursive compilation problem by setting :not openarray on type arguments https://play.nim-lang.org/#ix=4dzG
12:51:59arkanoidvindarr, but I'm fighting with your code
12:52:12arkanoidmacro `*`*[T: SomeUnit|SomeNumber; U: SomeUnit|SomeNumber](x: T; y: U): untyped =
12:52:44FromDiscord<vindaar> what's the issue?
12:54:22arkanoidthis macro is called in place of mine "func `operator` *[??L: not openArray, ??R: not openArray](a: openArray[??L], b: ??R): auto =" when I try to seq[UnitLess] * m^2
12:55:29arkanoidI'm getting unchained/units.nim(298, 29) * Error: Unsupported : ntySequence
12:56:00arkanoidquestion is why T: SomeUnit|SomeNumber selects seq[UnitLess]
13:00:54*derpydoo joined #nim
13:01:58FromDiscord<vindaar> oh... I see. `SomeUnit` is a concept. When the compiler tries to resolve the overloads it checks the concept. As the concept is rather complicated (it calls a macro itself) this happens. The reason is that I don't handle `seq[SomeUnit]` apparently \:)
13:01:58FromDiscord<vindaar> (in general it shouldn't ever cause a CT error like this of course, the concept should simply not match)
13:04:15FromDiscord<vindaar> can you open an issue with a reproducible code snippet?
13:06:26arkanoiddoing now
13:07:18arkanoidvindaar: https://play.nim-lang.org/#ix=4dzP
13:07:56arkanoidsurely the problem lives between concept and my effort in trying to not match openArray[openArray[..]]
13:09:27arkanoidactually, it don't work even if I remove the template limiters: https://play.nim-lang.org/#ix=4dzQ
13:09:57arkanoid*generic arguments limiter .. do they have a proper name? I'm making them up
13:15:18FromDiscord<vindaar> that code runs fine for me
13:15:29FromDiscord<vindaar> I have a few small changes locally in unchained though
13:15:41FromDiscord<vindaar> (but those should be unrelated)
13:16:47FromDiscord<vindaar> ah
13:16:52FromDiscord<vindaar> can confirm, it's my local fixes
13:16:57FromDiscord<vindaar> will make a PR and tag a new release
13:18:07arkanoidhere the error I am getting: https://play.nim-lang.org/#ix=4dzV
13:18:37arkanoidoh! good! glad to have found something
13:19:35arkanoidthe difference is just seq, if I turn a into an array "a = [1.UnitLess, 2.UnitLess, 3.UnitLess]" my func gets called and it works correctly
13:21:28NimEventerNew Nimble package! measuremancer - A library to handle measurement uncertainties, see https://github.com/SciNim/Measuremancer
13:24:11*CyberTailor joined #nim
13:26:39arkanoid*tiny dance for measuremancer*
13:27:56*m5zs7k quit (Ping timeout: 260 seconds)
13:34:25*m5zs7k joined #nim
13:44:23FromDiscord<vindaar> tagged a new unchained version. let me know if it fixes the problem for you
13:47:51*derpydoo quit (Ping timeout: 268 seconds)
13:50:57arkanoidvindaar, I'll try it right now
13:51:24arkanoidside question: is there a "stack only" table in nim?
13:55:27arkanoidvindaar, it works! :)
13:55:36arkanoidI can continue my run towards the goal
13:57:18FromDiscord<vindaar> nice! let's hope it'll be longer before the next bug 🙈
14:00:41PMunchJust saw measuremancer and unchained, cool libraries!
14:13:51FromDiscord<albassort> can i write a kernel module in nim
14:13:54FromDiscord<albassort> (edit) "nim" => "nim?"
14:13:59FromDiscord<albassort> will GC work?
14:14:26*PMunch quit (Quit: Leaving)
14:15:26arkanoidvindaar, is it considered a feature that "(5.m * 3.ft^-1) = 15 Meter*Foot^-1" ?
14:16:09arkanoidshouldn't this operation result in an UnitLess with a feature conversion towards SI?
14:17:45FromDiscord<vindaar> yes and no. In the past imperial units were always converted if they were multiplied / divided with SI units. When I did the big rewrite to generate things from declarative macros, I added the option to avoid auto conversion for some types. The idea was that if one has e.g. one imperial mixed with other units, possibly the imperial should remain. ↵However, the case you mention (both same quantities), should normally be converted, yes. T
14:18:31*hochata joined #nim
14:20:05FromDiscord<vindaar> you can force the conversion for now using `.to(UnitLess)`. I'll note it down
14:20:25arkanoidwell, the conversion is not happening right now
14:20:32arkanoidI've also noticed another thing
14:22:07arkanoid5.m^2*m^-3 * 2.m^-1 says Error: type mismatch: got <Meter^-1>
14:22:51arkanoidI know that they are technically the same, but the handling should be automatic here, or not?
14:25:03FromDiscord<vindaar> not sure I understand this case
14:28:00arkanoidwait, I'm trying to replicate in an self contained example, but I'm failing so far, so it might just be a defUnit problem
14:31:04*CyberTailor left #nim (Konversation terminated!)
14:43:16*rockcavera joined #nim
14:43:16*rockcavera quit (Changing host)
14:43:16*rockcavera joined #nim
14:47:58*derpydoo joined #nim
14:57:41*rez joined #nim
14:58:58FromDiscord<vindaar> ok, think I fixed it
15:11:02FromDiscord<Andycol> What is the best way to create a stdin prompt↵example it says whats your name? and you enter bob then turns the result into a variable called $name
15:11:53FromDiscord<MrOkram> sent a code paste, see https://play.nim-lang.org/#ix=4dAN
15:14:04*kenran` quit (Remote host closed the connection)
15:18:41*fanta1 joined #nim
15:20:37FromDiscord<MrOkram> Usually in other languages, like Java for example, i'd just put `\"` and be done with it, but here as can be seen that doesn't work, even tho on the Nim Wiki it says `\` is used for escaping chars. https://media.discordapp.net/attachments/371759389889003532/1032312322066227231/unknown.png
15:25:59FromDiscord<Generic> command invocations with no brackets and no space like re"blahaha" have a special rule
15:26:08FromDiscord<Tanguy> `re("\"xxx)`
15:26:12FromDiscord<Tanguy> (edit) "`re("\"xxx)`" => "`re("\"xxx")`"
15:26:37FromDiscord<Generic> either that or write it how it is but with no \
15:26:53FromDiscord<Generic> (edit) "either" => "~~either" | "no \" => "~~"
15:27:19FromDiscord<Generic> that doesn't work for ", only for \
15:27:47FromDiscord<Generic> do what Tanguy said, or use """triple quotes"""
15:28:57FromDiscord<MrOkram> Yup, did, this turned out to work `re("\"[\\W\\w\\D\\d]")`, had to double `\`.
15:29:06FromDiscord<MrOkram> Thanks for help
15:30:05FromDiscord<Tanguy> Maybe triple quotes are indeed better then, you won't have to escape anything↵https://nim-lang.org/docs/manual.html#lexical-analysis-triple-quoted-string-literals
15:31:04FromDiscord<MrOkram> In reply to @Tanguy "Maybe triple quotes are": Perhaps, but i find the `\\` much easier to read somehow.
15:34:45FromDiscord<Elise_Wang> sent a long message, see http://ix.io/4dzS
15:35:55FromDiscord<MrOkram> Well that's a bot
15:57:14*wallabra quit (Ping timeout: 268 seconds)
15:58:49*wallabra joined #nim
16:08:32FromDiscord<jos> In reply to @albassort "can i write a": ORC probably works
16:08:50FromDiscord<jos> they all probably work but ORC makes the most sense for a kernel module
16:09:03FromDiscord<jos> if you have to use GC, anyway
16:09:35FromDiscord<albassort> i would need strutils or program my own manual memory managed version
16:09:43FromDiscord<vindaar> arkanoid\: fix incoming https://github.com/SciNim/Unchained/pull/30
16:12:00FromDiscord<albassort> In reply to @jos "if you *have* to": still tying to figure out how i'd make it work on a kernel level omo
16:12:49FromDiscord<albassort> i would like for it to sit on the end of the input pipe
16:15:05FromDiscord<jos> dunno, follow a nim on a microcontroller tutorial for bare metal and then fill in the delta
16:15:18FromDiscord<jos> probably the best route
16:17:05FromDiscord<jos> nim does compile to C, so you can inspect the output and work backwards from there too
16:25:29FromDiscord<vindaar> arkanoid\: new version is tagged. Hope this is it for now 😁
16:27:34*hochata quit (Ping timeout: 268 seconds)
16:27:54FromDiscord<ringabout> Hello, vindaar. What was I missing for measuremancer? https://github.com/nim-lang/Nim/pull/20599
16:28:45FromDiscord<ringabout> https://github.com/nim-lang/Nim/actions/runs/3281886210/jobs/5404528015
16:29:33FromDiscord<ringabout> It seems that I cannot switch to the right directory or something.
16:29:42FromDiscord<ringabout> > /home/runner/work/Nim/Nim/pkgstemp/measuremancer/tests/tmeasuremancer.nim(1, 8) Error: cannot open file: measuremancer
16:30:19FromDiscord<vindaar> that's rather weird
16:30:29FromDiscord<ringabout> I cannot use cd either
16:30:33FromDiscord<ringabout> > Failure: reInstallFailed↵> cd measuremancer↵> /bin/sh: 1: cd: can't cd to measuremancer
16:30:37arkanoidvindaar, sorry I was in a coding rush. Downloading the second daily update right now
16:30:56arkanoidvindaar, is it always true that UnitLess * float -> float ?
16:31:06FromDiscord<vindaar> I mean the main file in this case is in the root directory of the package. But that shouldn't be a problem I would have guessed
16:31:11arkanoidor float * UnitLess -> float
16:31:35FromDiscord<vindaar> but I don't quite know how the important packages logic works
16:31:50FromDiscord<ringabout> In reply to @vindaar "I mean the main": can you add a config file for switching path or using relative path for tests?
16:31:56FromDiscord<vindaar> `UnitLess` is for all practical purposes just an alias to `float`. There are converters for it↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
16:32:27FromDiscord<vindaar> ah!↵(@flywind)
16:32:56FromDiscord<vindaar> the package isn't actually installed, is it? so that in code `import measuremancer` doesn't work, right?
16:32:56FromDiscord<ringabout> I suppose that measuremancer are not installed globally.
16:33:11FromDiscord<ringabout> Yeah, it gets cloned
16:34:48FromDiscord<vindaar> pushing a fix now
16:34:48FromDiscord<ringabout> In reply to @vindaar "the package isn't actually": Yeah,
16:34:53FromDiscord<ringabout> thank you
16:35:01FromDiscord<vindaar> https://github.com/SciNim/Measuremancer/pull/4
16:37:57FromDiscord<vindaar> tagged a new version. let's see if that fixes it
16:43:29*PMunch joined #nim
16:43:52arkanoididiomatic way to concat two arrays at compile time?
16:45:20PMunch&?
16:45:31PMunchWait, that doesn't work does it
16:47:14PMunchI guess `var res: array[x.len + y.len, typeof(x[0])]; res[0..x.high] = x; res[x.len..^1] = y` might work?
16:48:08arkanoid& doesn't work. Ok so I guess I have to write my own
16:49:12PMunchMy second suggestion does work: https://play.nim-lang.org/#ix=4dBb
16:49:44arkanoidPMunch: thanks! yeah I was testing myself
16:49:51arkanoidlets see if I can wrap it into a function
16:50:31Amun-Rawhat if one wants const? :>
16:51:21Amun-Rahttps://play.nim-lang.org/#ix=4dBc
16:52:38arkanoidto make it work at runtime I think I need to make it generic and bake a different version for each different couple of lengths
16:52:46PMunchAmun-Ra, https://play.nim-lang.org/#ix=4dBd
16:52:56PMunchOr that, yeah
16:53:17Amun-RaPMunch: nice one
16:53:26PMuncharkanoid, yes, Nim arrays are compile-time defined length, so you'd need to do it that way
16:53:37Amun-RaI'm stealing it
16:53:48PMunchOr make a wrapper to a function which just took a pointer and length and used memcpy
16:53:56PMunchOr copyMem or whatever it is in Nim :P
17:04:18arkanoidit works! https://play.nim-lang.org/#ix=4dBg
17:07:08Amun-Rahow long play.nim pastes are alive?
17:07:35PMunchAs long as ix.io keeps them alive
17:07:43PMunchSeems to be a couple years at least
17:08:02Amun-Rahmm
17:08:37PMuncharkanoid, why do you use the paragraph symbol for generic variables?
17:08:40PMunchJust curious
17:08:45PMunchAmun-Ra, how so?
17:08:52PMunchIt might be based on how often they are accessed
17:09:15PMunchI had a script on my old work computer which constantly checked an ix.io paste to see if it was still the same
17:09:20PMunchAnd it lasted for years
17:09:34Amun-RaPMunch: IIRC my few months old pastes are gone, I have to test that
17:10:13PMunchI just went back in the IRC log for this chat room, exactly two years ago and found an old paste link there
17:10:30PMunchDidn't bother to check if the content made sense in context, but it was at least Nim code
17:10:42Amun-Rahmm
17:15:06*derpydoo quit (Ping timeout: 264 seconds)
17:19:59arkanoidPMunch: because I'm using unchained package, which exports a lot of types like N for Newton, T for Tesla, J for Joule and so on. So instead of playing which letter is good, I've added an uncommon prefix
17:20:38PMunchAaah, I see
17:26:20*derpydoo joined #nim
17:27:12FromDiscord<Schelz> is possible to create proc inside a class ? And the procs to return smth when are called ?
17:27:16FromDiscord<Schelz> (edit) "?" => "."
17:27:58PMunch@Schelz, we don't really have classes in Nim
17:28:25FromDiscord<Schelz> oh ok 😅
17:28:28PMunchUnless of course you use something like this: https://github.com/jjv360/nim-classes
17:28:43PMunchNot quite sure what you're trying to achieve
17:29:33PMunchBut typically in Nim you have a type, and a proc which takes that type as the first argument. Because of the unified call syntax you can then do stuff like `myinstance.myprocedure()`
17:29:55PMunchAnd of course then you can use the argument like you normally would
17:31:10FromDiscord<Schelz> sent a code paste, see https://play.nim-lang.org/#ix=4dBh
17:31:19FromDiscord<Schelz> and to be able to call the class functions as types for other porc
17:31:30FromDiscord<Schelz> (edit) "porc" => "func"
17:33:02PMunchSomething like this? https://play.nim-lang.org/#ix=4dBi
17:34:50FromDiscord<Schelz> yeah
17:37:21FromDiscord<Schelz> thx
17:37:57PMunchNo problem
17:38:17PMunchNote that the star there is the "public" modifier. That exports the procedure out of the current module
17:38:29PMunchWithout it you would only be able to call the procedure from the current module
17:38:45FromDiscord<Schelz> got it
17:38:54FromDiscord<Schelz> (edit) "got it ... " added "👍"
17:41:18PMunchIf you want to change the object you need to change the type it takes to `var MyClass`
17:41:25PMunchAnd give it a name other than _ of course
17:47:05*PMunch quit (Quit: leaving)
17:48:57*rez quit (Quit: much snoozes...)
17:50:11*reversem3[m] left #nim (#nim)
17:58:49arkanoidwhat's the correct way to cast an array to a different compatible type? eg type A = float; type B = float; then convert array[5,A] in array[5,B] without copy
17:59:13arkanoiddo I have to use the cast cannon or is there a gentle way to get there?
18:00:28FromDiscord<Rika> Am I reading it right? A and B are both float?
18:00:36FromDiscord<Rika> They’re the same type
18:00:37arkanoidyes
18:00:48FromDiscord<Rika> There’s nothing to convert?
18:01:09arkanoidactually distinct float types
18:01:16arkanoidbut yeah, no value has to be changed
18:03:48*kenran joined #nim
18:15:07FromDiscord<blashyrk> Is there a way to get "out" of a genAst temporarily in order to, for example, loop through a static seq and add NimNodes based on that?↵↵Alternatively, is there a way to "trust me bro" a call to newCall from within a compile time proc and pass an ident that doesn't exist in the current scope/context into the call (that will definitely exist at the place that call node is actually used)?
18:24:11FromDiscord<Horizon [She/Her]> Is the `arc`/`orc` memory management modes suitable for an embedded device? Also what's the difference between `arc` and `orc`?
18:32:25FromDiscord<Tanguy> Arc is suitable, orc is arc + stack scanning to detect cyclic references↵So arc by itself won't be able to free cyclic references
18:49:33*kenran quit (Remote host closed the connection)
19:11:08*xet7 quit (Remote host closed the connection)
19:26:13*rez joined #nim
19:54:57NimEventerNew thread by mantielero: Some help with javascript - OpenCascade.js, see https://forum.nim-lang.org/t/9535
20:01:27FromDiscord<auxym> In reply to @Event Horizon "Is the `arc`/`orc` memory": what tanguy said, and yes, ARC is the best suited MM for #embedded systems
20:02:27FromDiscord<Elegantbeef> You generally dont need cyclical types on embedded luckily 😄
20:05:58FromDiscord<Generic> {.cursor.} and a bit of care you can have cyclic data structures with no problems on ARC
20:10:59FromDiscord<Horizon [She/Her]> Ah alright thanks!
20:12:31qwrbtw, what kind of embedded - the ARC keeps memory usage lower and has lower maximum pauses, but on many "embedded" platforms even refc might do well enough, and i would say that ARC/ORC still has some bugs
20:14:31qwron something like arduino or ESP32 the difference matters, but if you have like 64MB memory and ARM, then probably not
20:16:06FromDiscord<Elegantbeef> line 35 in the test is should compile, but yea the error is 'close' though it should be like "Compile time closures with an environment cannot be used at runtime" or similar↵(@Bung)
20:20:01FromDiscord<Bung> @ElegantBeef you mean 35 should not report error ?
20:20:33FromDiscord<Elegantbeef> Like araq said that closures without environments should work from constants
20:21:00FromDiscord<Elegantbeef> The issue right now is that the compiler doesnt go "Hey this is a static closure, do not statically evaluate"
20:21:46FromDiscord<Bung> 34, 35 are nearly same place
20:22:30FromDiscord<Elegantbeef> Both of the first tests should compile
20:22:31FromDiscord<Bung> oh , so they are both valid.
20:22:57FromDiscord<Elegantbeef> Correct, the idea is that if there is no closure environment it's just a pointer proc that uses the closure calling convention for convience
20:23:55FromDiscord<Bung> after this I need handle assignment or put in array construction
20:24:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dBT
20:25:09FromDiscord<Elegantbeef> Presently if you do `a()` or `b()` the static folding part of the compiler goes "Oh a is a constant" and attempts to call it at compile time
20:25:33FromDiscord<Elegantbeef> Which is clearly wrong, which means there needs to be a check to ensure the proc is not a static variable in the static folding
20:26:32FromDiscord<Elegantbeef> When it comes to constant procs that are invoked outside of `static` the correct thing to do is to emit a call at runtime, but that doesnt happen so the VM errors
20:27:14FromDiscord<Bung> wait, how 35 complies , `VM problem: dest register is not set` this is existed error
20:28:08FromDiscord<Elegantbeef> It's supposed to compile, that's a bug that i'm talking about
20:28:09FromDiscord<Bung> or maybe not , just cause by my modification.
20:28:30FromDiscord<Elegantbeef> That error appears due to the compiler seeing a constant expression and attempting to optimise
20:28:40*fanta1 quit (Quit: fanta1)
20:28:47FromDiscord<Bung> so it's another bug ?
20:29:02FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/devel/compiler/semexprs.nim#L869 is the culrpit
20:29:05FromDiscord<Elegantbeef> culprit even
20:29:21FromDiscord<Elegantbeef> it needs a `callee.kind != skConst and (a or b)`
20:29:41FromDiscord<Bung> okay, I consider fix that.
20:29:56FromDiscord<Elegantbeef> With that change `b()` does compile
20:30:01FromDiscord<Elegantbeef> But `a()` still does not
20:30:04FromDiscord<Bung> I understand now, it shouldn't treate as StaticExpr
20:30:40FromDiscord<Elegantbeef> Yep the symbol is static so it attempts to run it on the VM which is wholly incorrect as it's not called in a static context
20:31:25FromDiscord<Elegantbeef> I dont even know if the `sfNoSideEffect` makes sense
20:31:34FromDiscord<Bung> okay, thank you, I think I'll get more bug fix point
20:31:44FromDiscord<Elegantbeef> Given that you can have a procedure marked no side effect but have side effects inside
20:54:31arkanoidhow do you keep your git/other versioning nim project folder tidy from all the nim binaries that tends to be created here and there during daily work?
20:54:58arkanoiddo you ignore them all, delete them all manually, or you have a better strategy?
20:55:33FromDiscord<huantian> make one folder for all your binaries that you ignore
20:56:13arkanoidhuantian, how you do that? config.nims?
20:56:38FromDiscord<huantian> huh you might be able to do that with config.nims, I just have it configured with vscode launch options
20:56:46FromDiscord<huantian> or I'm using `nix` and it puts stuff in `./result`
20:56:57FromDiscord<huantian> config.nims might actually work tho
20:57:24arkanoidhow comes nix handles this? isn't nix just providing nim shell as-is?
20:58:09FromDiscord<huantian> yeah if i'm testing im either going into a nix shell, which doesn't make any binaries↵or i'm building it with `nix build`, which only puts stuff in `./result/`
20:58:19FromDiscord<Elegantbeef> Or just ignore all binaries↵(@huantian)
20:58:58FromDiscord<Elegantbeef> Manually export the code and make an accompany header or use treeform's genny↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
20:59:43FromDiscord<Patitotective> In reply to @arkanoid "how do you keep": i use this to ignore all files without extension https://github.com/Patitotective/kdl-nim/blob/main/.gitignore
21:00:28FromDiscord<Patitotective> you can also just add `--outdir:bin` to your config.nims
21:04:03arkanoidI'm trying with --outdir: <abspath> but seems not working
21:04:27FromDiscord<Rika> if you are using nimble build it will not pass the parameters from command line
21:04:30FromDiscord<Rika> use a config file
21:04:55arkanoidI have config.nims in project root
21:05:06arkanoidok I see it does work with nim c, but not nimble
21:05:12arkanoidnimble has it's own setting
21:21:00FromDiscord<Patitotective> In reply to @PMunch "Is there a way": https://nim-lang.org/docs/os.html#getAppDir
21:24:24FromDiscord<Esther> sent a code paste, see https://play.nim-lang.org/#ix=4dC4
21:24:29FromDiscord<Esther> I don’t know the proper syntax
21:25:50FromDiscord<Esther> sent a code paste, see https://play.nim-lang.org/#ix=4dC6
21:26:14FromDiscord<Esther> And then you can use either Thing or Any_Thing as a function parameter to communicate whether you handle the nothing case
21:26:23FromDiscord<Esther> Or return value etc
21:26:36FromDiscord<Esther> I probably got some syntax wrong, I’m on my phone
21:26:53FromDiscord<Esther> (edit) "https://play.nim-lang.org/#ix=4dC6" => "https://play.nim-lang.org/#ix=4dC7"
21:28:13FromDiscord<Esther> Importantly the derived type is a subtype of the parent one, i.e not distinct and can happily be converted
21:38:12FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4dCc
21:38:57FromDiscord<Esther> That looks like it’d work, nifty
21:39:38FromDiscord<Esther> It was @Arkanoid that wanted it though not me
21:40:18FromDiscord<Elegantbeef> `setCurrentDir(getAppDir())`↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>)
21:41:09FromDiscord<Elegantbeef> Eh arc doesnt really have bugs. You generally dont really need a cyclic collector on embedded though
21:41:39FromDiscord<Elegantbeef> Embedded most mean is generally microcontrollers so where you're memory and CPU limited heavily
22:29:35*jmdaemon joined #nim
22:29:36arkanoidis there a package to benchmark/time functions?
22:32:27FromDiscord<Esther> Yes, I’ve been using one, nimbench I think?
22:33:40FromDiscord<Esther> Oh no, benchy
22:33:43FromDiscord<Esther> There are a bunch
22:42:28*hochata joined #nim
22:57:18arkanoidthanks!
23:47:37FromDiscord<Sabena Sema> I've been writing rust and boy I miss nim's "fake HKT" thing
23:47:43*rez quit (Quit: much snoozes...)
23:48:01FromDiscord<Sabena Sema> it's kinda funny that such a simple bit of syntax covers so many of the things people actually wanna use HKTs for
23:55:28FromDiscord<Elegantbeef> Doesnt rust have static generics?
23:56:11FromDiscord<Elegantbeef> I might not know what exactly a higher kinded type actually entails