<< 28-05-2022 >>

00:00:02FromDiscord<!Patitotective> can i do something like `proc foo[T: not PrefsNode, not string]() = ` ?
00:00:39FromDiscord<Rika> or
00:00:45FromDiscord<Rika> I mean and
00:00:46FromDiscord<Rika> Lol
00:00:56FromDiscord<Rika> Brain working as expected
00:01:33FromDiscord<!Patitotective> `not PrefsNode and string`?
00:07:38FromDiscord<Rika> And not
00:08:44FromDiscord<Elegantbeef> or `not (PrefNode or string)`
00:10:55FromDiscord<Rika> Thanks de Morgan
00:11:31FromDiscord<Elegantbeef> Indeed
00:14:29FromDiscord<Rika> Who swapped off topic and main
00:14:34FromDiscord<Rika> Yardanicoooooo
00:30:39FromDiscord<!Patitotective> actually i dont need that lol↵i wasnt exporting the other contains proc Lol
01:22:36FromDiscord<!Patitotective> @demotomohiro why is your nim faq raw html? what about markdown
01:23:34FromDiscord<Elegantbeef> Nimib is right there! 😜
01:25:32*arkurious quit (Remote host closed the connection)
01:27:10FromDiscord<demotomohiro> In reply to @Patitotective "<@288750616510201856> why is your": My Nim FAQ site is generated from RestructuredText:↵https://github.com/demotomohiro/Internet-of-Tomohiro/blob/master/src/articles/nim/faq.nim
01:27:59FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.app/aboutthisblog.en
01:28:43FromDiscord<!Patitotective> code blocks are really... weird https://media.discordapp.net/attachments/371759389889003532/979919115277991946/unknown.png
01:29:51FromDiscord<demotomohiro> It uses Nim RST to html generator.
01:30:56FromDiscord<demotomohiro> https://nim-lang.org/docs/rstgen.html
01:32:20FromDiscord<demotomohiro> I guess I need to write some CSS files to render code block nicely.↵I'm not expert of web front end.
01:32:46FromDiscord<!Patitotective> thats why i suggest using markdown↵it looks good and the syntax is easy
01:33:10FromDiscord<Elegantbeef> Nimib does make it quite easy and you still get a single Nim file
01:33:18FromDiscord<!Patitotective> In reply to @Elegantbeef "Nimib does make it": ⬆️
01:34:41FromDiscord<Elegantbeef> ⬇️
01:35:14FromDiscord<!Patitotective> hey
01:45:31FromDiscord<Rika> ⬅️
01:48:49FromDiscord<!Patitotective> 🙄
02:06:14FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3YN4
02:06:22FromDiscord<System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=3YN4" => "https://play.nim-lang.org/#ix=3YN5"
02:08:50FromDiscord<Elegantbeef> You need to read the data
02:09:31FromDiscord<Elegantbeef> `open` doesnt do anything but open a file handle, there is no data in memory
02:10:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "You need to read": Ah alright, so how can I read the data then?
02:11:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YN6
02:11:18FromDiscord<Elegantbeef> Whoops 😄
02:11:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YN7
02:11:45FromDiscord<System64 ~ Flandre Scarlet> the seq should be the size of the file
02:12:21FromDiscord<Elegantbeef> This will make it that size
02:12:40FromDiscord<Elegantbeef> Sorry should be `newSeqOfCap[int](100)`
02:13:40FromDiscord<System64 ~ Flandre Scarlet> there is no way to cast the stream directly?
02:13:51FromDiscord<Elegantbeef> No cause it's not in memory
02:13:59FromDiscord<Elegantbeef> You need to load it into memory
02:14:08FromDiscord<System64 ~ Flandre Scarlet> aaah alright
02:15:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YN8
02:15:08FromDiscord<Elegantbeef> Also dont forget to `defer: fs.close()` after opening it
02:15:41FromDiscord<System64 ~ Flandre Scarlet> ah alright
02:16:10FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3YN9
02:17:58FromDiscord<Elegantbeef> You clearly did something wrong
02:18:15FromDiscord<Elegantbeef> Full code and file
02:19:25FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3YNa
02:19:28FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/979931884790349934/byte.dat
02:20:31FromDiscord<Elegantbeef> Like i said i fucked up
02:20:38FromDiscord<Elegantbeef> You want `newSeqOfCap[int32]`
02:20:53FromDiscord<Elegantbeef> Works just fine
02:20:57FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/hXC
02:23:01FromDiscord<Elegantbeef> That also works
02:23:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YNc
02:24:11FromDiscord<Elegantbeef> The last one will be faster afaik
02:26:32*Guest58 joined #nim
02:26:38*Guest58 quit (Client Quit)
02:26:47*Guest58 joined #nim
02:26:58FromDiscord<System64 ~ Flandre Scarlet> seems it works
02:29:09*Guest58 quit (Client Quit)
02:55:00FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/6Hx
02:55:49FromDiscord<Elegantbeef> Sounds like an indention error
02:56:10FromDiscord<Elegantbeef> https://github.com/Patitotective/ImClocks/blob/devel/src/prefsmodal.nim#L60
02:56:26FromDiscord<Elegantbeef> Is that valid?
02:57:10FromDiscord<!Patitotective> wooops thanks
02:57:35FromDiscord<Zectbumo> sent a code paste, see https://paste.rs/hmn
02:57:46FromDiscord<Elegantbeef> The data is big endianess afaik
02:58:03FromDiscord<Elegantbeef> You could always make a `BigEndian` stream that did all the converting for you
02:58:13FromDiscord<Zectbumo> I'll look for that
02:58:29FromDiscord<Elegantbeef> I didnt say use, i said make 😛
02:58:51FromDiscord<Zectbumo> https://nim-lang.org/docs/system.html#bigEndian
02:59:27FromDiscord<Zectbumo> so odd, a link that doesn't exist? search bigendian and it comes up but you click on it and it goes nowhere
02:59:51FromDiscord<Zectbumo> https://media.discordapp.net/attachments/371759389889003532/979942048109068390/unknown.png
03:02:29FromDiscord<Zectbumo> !eval echo cpuEndian
03:02:31NimBotlittleEndian
03:02:48FromDiscord<Elegantbeef> Almost all modern processors are LE so good luck finding a BE 😄
03:02:58FromDiscord<Zectbumo> ARM
03:03:04FromDiscord<Elegantbeef> Even arm is LE
03:03:08FromDiscord<Elegantbeef> Modern ARM atleast
03:03:09FromDiscord<Zectbumo> can be both actually
03:03:21FromDiscord<Elegantbeef> Can be but a majority of the processors are LE
03:03:31FromDiscord<Zectbumo> arm can switch dynamically
03:03:49FromDiscord<Zectbumo> which is really cool feature so you can switch modes, parse something quickly, switch back
03:04:25FromDiscord<Zectbumo> but, yes. it's typically put into LE mode
03:04:30FromDiscord<demotomohiro> I heard that most of network protocols use bigendian
03:04:40FromDiscord<Elegantbeef> Yes network is the one place that uses BE
03:04:50FromDiscord<Zectbumo> you could even say all?
03:05:50FromDiscord<demotomohiro> It seems there are issue and PR to add endian aware stream, but it is not merged: https://github.com/nim-lang/Nim/issues/12790
03:07:44FromDiscord<Zectbumo> there was some company, I think maybe Motorola, maybe Intel?, that went LE over network to detect even/odd quickly.
03:08:34FromDiscord<Zectbumo> BE is good on network to quickly detect if your message size is too big
03:10:11FromDiscord<demotomohiro> If I remember collectly, msgpack protocol uses big endian and this msgpack library implements byte order conversion: https://github.com/jangko/msgpack4nim/blob/90c6e7926ff9f77ea5121746cc429b718680fcc5/msgpack4nim.nim#L179
03:14:51FromDiscord<Zectbumo> In reply to @demotomohiro "It seems there are": yikes, that is a full discussion on something that sounds like an easy problem. I solved my endianness issue with streams and a 2 line proc
03:15:06FromDiscord<demotomohiro> In reply to @Zectbumo "there was some company,": That means when you are receiving 64bit int value, you can detect if the value is too high only with higher 32bit of it without receiving lower 32bit?
03:15:46FromDiscord<Zectbumo> you can possibly detect it even in the first byte read
03:18:21FromDiscord<demotomohiro> yea
03:18:51FromDiscord<Zectbumo> So, I'm compiling using -d:release and as the docs say it doesn't show a stack trace, which is true, but it does show one line of error with the nim library and line number. `Error: cannot open: myfile io.nim(853) readFile`↵this could be a security issue. One can determine the language and version range by the ".nim" and the line number given.
03:20:02FromDiscord<Zectbumo> what's happening is when debug is enabled the stack report and error is sent over the network to debug. great! but then -d:release and now it's just one line error. better, but not great
03:22:42FromDiscord<demotomohiro> I think you can catch the exception and change error message or do what something else.
03:23:36FromDiscord<huantian> I mean yeah ig, you could wrap your main function and `quit(1)` on the except
03:25:44FromDiscord<Zectbumo> it needs to exit cleanly and report the error on the network. what's the `if debug:` test?
03:25:57FromDiscord<Zectbumo> (edit) "test?" => "test for nim?"
03:26:37FromDiscord<Zectbumo> In reply to @demotomohiro "I think you can": in debug mode, I need the error as is. so I guess I'll have to do this with some `if not debug:`
03:27:18FromDiscord<huantian> when not defined(debug):?
03:27:31FromDiscord<Zectbumo> thx
03:29:11FromDiscord<demotomohiro> or `when defined(release):`
03:33:29*ehmry quit (Ping timeout: 256 seconds)
03:33:32FromDiscord<Zectbumo> huh, now thinking about it. how in the world does a program compiled with -d:release know about library names and line numbers?? sounds like debug is turned on
03:34:20FromDiscord<Zectbumo> I'll try a force recompile
03:36:23FromDiscord<Elegantbeef> Raising an exception stores this information↵(@Zectbumo)
03:36:39FromDiscord<huantian> solution: remove all exceptions
03:36:44FromDiscord<demotomohiro> I think Nim generates the error message by taking line number and filename at compile time
03:37:10FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/979951436970463232/image.png
03:39:27*ehmry joined #nim
03:39:42FromDiscord<Zectbumo> that's interesting
03:40:17FromDiscord<Zectbumo> there is no release check in the exception source
03:40:55FromDiscord<Zectbumo> where does it shorten it?
03:41:04FromDiscord<huantian> probably checks this flag: <https://nim-lang.org/docs/nimc.html#additional-features-stacktrace-option>
03:41:34FromDiscord<Zectbumo> In reply to @huantian "solution: remove all exceptions": I don't follow
03:41:41FromDiscord<Elegantbeef> It does it in the compiler probably zect
03:42:22FromDiscord<Zectbumo> In reply to @huantian "probably checks this flag:": I turned linetrace and stacktrack off, no go
03:42:36FromDiscord<Zectbumo> I think I'll open up an issue
03:42:38FromDiscord<Elegantbeef> What are you trying to do?
03:42:45FromDiscord<Zectbumo> remove the stack trace on release
03:43:02FromDiscord<Zectbumo> like I was promised
03:44:47FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3YNm
03:45:04FromDiscord<Zectbumo> what's that 1 line stack at the bottom?
03:45:22FromDiscord<Elegantbeef> It's a single frame that is given with release
03:45:43FromDiscord<Elegantbeef> It's not really a stacktrace if there is only a single frame 😄
03:45:58FromDiscord<demotomohiro> You can remove stack trace with `--stackTrace:off` compiler option.
03:46:05*ehmry quit (Ping timeout: 255 seconds)
03:46:59FromDiscord<Zectbumo> I did that, doesn't work
03:47:36FromDiscord<Zectbumo> `-d:release --lineTrace:off --opt:size -x --debugInfo:off -f --stackTrace:off --verbosity:0`
03:47:40FromDiscord<Zectbumo> nothing works
03:48:06FromDiscord<Zectbumo> it's a bug. I'll file it
03:48:53FromDiscord<Elegantbeef> I dont get the point of having your program crash with 0 explanation but you can always -d\:danger
03:49:21FromDiscord<Elegantbeef> Nevermind it still has a trace
03:50:36FromDiscord<Zectbumo> well, I want the 1st error line. release should just say `Error: cannot open: foo` just not the 1 line stack trace after that
03:53:28FromDiscord<Zectbumo> In reply to @Elegantbeef "image.png": what file is this in?
03:54:28FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#Exception
03:55:33FromDiscord<Zectbumo> thx. do you see my thumbs up on your matrix side?
03:56:21FromDiscord<Elegantbeef> No reactions are one sided
03:56:28FromDiscord<Elegantbeef> I can react all day long and you wont see it
03:57:07FromDiscord<Zectbumo> aw, I had a feeling. well, thx for all those times I never said thx then that I've reacted to
04:06:23*ehmry joined #nim
04:08:17FromDiscord<retkid> is there anyway to group enums and make an enum hyarchy
04:08:25FromDiscord<retkid> (edit) "hyarchy" => "hiarchy"
04:08:31FromDiscord<retkid> (edit) "hiarchy" => "hierarchy"
04:08:36FromDiscord<Elegantbeef> Macros
04:08:43FromDiscord<retkid> anything else
04:08:51FromDiscord<Elegantbeef> What are you after?
04:09:08FromDiscord<retkid> i have a hierarchy
04:09:15FromDiscord<retkid> and i wanna consolidate it into one object
04:09:16FromDiscord<retkid> like
04:09:26FromDiscord<retkid> ehh
04:09:59FromDiscord<Elegantbeef> I mean still macros but you said enum
04:10:36FromDiscord<retkid> the object is modular and has branching things
04:10:42FromDiscord<retkid> if you have x you need y
04:10:45FromDiscord<Elegantbeef> That's an object variant not an enum
04:10:49FromDiscord<retkid> no
04:10:52FromDiscord<retkid> i have a bunch of enums
04:10:58FromDiscord<retkid> i want to make into an object with variations
04:11:07FromDiscord<Elegantbeef> Example please
04:12:05FromDiscord<retkid> land type↵1. requires baseRock↵2. requires desert or rain↵3 if rain, needs frequency
04:13:10FromDiscord<retkid> i guess i can just make a weird function with almost all variables with defaults
04:15:52FromDiscord<Elegantbeef> That's not an example
04:24:59*Guest25 joined #nim
04:25:26*Guest25 quit (Client Quit)
04:51:28FromDiscord<uncle jim> what is the equivalent of pythons isdigit() in nim?
04:53:41FromDiscord<huantian> `someChar in '0'..'9'`
04:53:51FromDiscord<huantian> though maybe there's a isDigit function somewhere
04:54:08FromDiscord<huantian> https://nim-lang.org/docs/strutils.html#isDigit%2Cchar
04:54:10FromDiscord<huantian> yep
04:54:51FromDiscord<huantian> does the same thing but is probably more readable
05:01:25NimEventerNew post on r/nim by hugosenari: Nim packages stats, see https://reddit.com/r/nim/comments/uzg65t/nim_packages_stats/
05:09:52FromDiscord<demotomohiro> In reply to @stoneface "just trying to pass": I have created a PR that always add /nologo option to lib command.↵And it calls `lib` command using vccexe so that you can run Nim command without using VS tools command prompt.↵https://github.com/nim-lang/Nim/pull/19843
05:12:34FromDiscord<stoneface> Awesome
05:40:54FromDiscord<Zectbumo> what is nimscript for?
05:41:17FromDiscord<huantian> non-compiled nim
05:41:39FromDiscord<Zectbumo> is it useful for users? or is this a compiler tool?
05:41:52FromDiscord<Zectbumo> it can't even open("aFile")
05:42:16FromDiscord<huantian> It's both: nimscript is the code that the compiler vm can run, and it's used for compiletime execution
05:42:17FromDiscord<Zectbumo> I think I had my hopes up too high
05:42:38FromDiscord<huantian> but you can use it as a substitute for say bash where you don't want compilation
05:42:41FromDiscord<huantian> or for user scripting
05:43:04FromDiscord<huantian> In reply to @Zectbumo "it can't even open("aFile")": That's 'cus `open(filename)` uses the C FFI, which nimscript doesn't support
05:43:05FromDiscord<Zectbumo> but you kinda can't right? it cand do any importc stuff
05:43:22FromDiscord<huantian> well not everything needs to be FFI for it to be useful 😛
05:43:41FromDiscord<Zectbumo> can it read from stdin?
05:43:54FromDiscord<huantian> https://nim-lang.github.io/Nim/nimscript.html#readAllFromStdin
05:44:14FromDiscord<Zectbumo> oh there is a module. I see
05:45:47FromDiscord<Zectbumo> okay so I can shuffle files around, I just can't read any of them
05:46:46FromDiscord<Zectbumo> I would have to pipe in and pipe out
05:49:32FromDiscord<huantian> What are you using nimscript for?
05:49:51FromDiscord<Zectbumo> I'm just exploring nim website and saw it. I was wondering if I could script with it
05:50:17FromDiscord<Zectbumo> do you use it?
05:54:14FromDiscord<huantian> Nah I don’t really have a need for scripting
05:54:18*xet7 joined #nim
05:56:41FromDiscord<huantian> I prefer compiled binaries for most of my stuff
05:57:00FromDiscord<Zectbumo> nim r works pretty well for me
05:57:14FromDiscord<huantian> And for other convenience things I think someone has this shebang cache thingy that I can never remember the name of
05:58:22FromDiscord<Zectbumo> hmm, I wonder if you could `#!nim r /dev/stdin`
05:59:51*xet7 quit (Ping timeout: 258 seconds)
06:03:48FromDiscord<Zectbumo> shebang not being able to do multiple args is so weak. and it's so dumb env -S isn't standard
06:11:38FromDiscord<Zectbumo> In reply to @Zectbumo "hmm, I wonder if": it worked!
06:11:55FromDiscord<Zectbumo> I had to wrap nim r /dev/stdin, but it worked
06:12:30FromDiscord<Zectbumo> who needs scripting \:D
06:13:15*xet7 joined #nim
06:15:11FromDiscord<gibson> sent a code paste, see https://play.nim-lang.org/#ix=3YNJ
06:21:15FromDiscord<demotomohiro> I wrote nimscript before: https://github.com/demotomohiro/lincity-ng-build-windows
06:28:23FromDiscord<demotomohiro> In reply to @gibson "Closures in nim make": What is the type of variable and how do you call it?
06:31:40FromDiscord<gibson> sent a code paste, see https://paste.rs/Jlc
08:08:17FromDiscord<Phil> Huh... first time I got this compilation error `lto-wrapper: warning: using serial compilation of 113 LTRANS jobs`
08:21:01FromDiscord<Zectbumo> In reply to @Zectbumo "it worked!": I was fooled, it didn't work. the echo "hello world" also works exactly the same in bash XD
08:43:13FromDiscord<mbrc> Suppose a library call gives me an object, but I only want to store a reference to that object. How do I make a reference of the object I get. In particular, in the nimraylib\_now library, the "loadTexture" method returns a texture, but I only wanna store a reference to it, how do I do this?
08:43:47FromDiscord<Elegantbeef> You
08:43:49FromDiscord<Elegantbeef> You'd need to heap allocate it
08:44:00FromDiscord<Elegantbeef> You cannot safely store a reference to a stack allocated type
08:44:58FromDiscord<mbrc> That makes sense. How do I move an object I get to the heap?
08:45:29FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YOb
08:45:47FromDiscord<mbrc> Ohhh. That makes so much sense, thanks!!
08:46:11FromDiscord<Elegantbeef> I dont know the typedef of texture
08:47:19FromDiscord<mbrc> What you wrote works perfectly. Is the reason why we can't safely take a ref to something on the stack is because its undefined behavior?
08:47:37FromDiscord<mbrc> Like its not guaranteed that the object wont be moved around?
08:47:37FromDiscord<Elegantbeef> No you references are GC managed
08:48:16FromDiscord<Elegantbeef> you can take addr of stack values but it'd be a dangling pointer
08:48:46FromDiscord<mbrc> Because it will get moved around?
08:48:59FromDiscord<Elegantbeef> No cause the stack grows/shrinks
08:49:07FromDiscord<Elegantbeef> Well writes over when a procedure is called
08:49:45FromDiscord<mbrc> I see
08:50:41FromDiscord<mbrc> Oh I see now.
08:51:04FromDiscord<mbrc> So if I do let texture = loadTexture(), then it allocates the texture on the stack (which will be thrown away once the function call returns)
08:51:15FromDiscord<mbrc> thats why refs are not valid
08:51:30FromDiscord<Elegantbeef> Pretty much it's a dangling pointer if you point to the stack after a proc is called
08:51:39FromDiscord<Elegantbeef> Which means the address might be valid, it might not be
08:51:49FromDiscord<Elegantbeef> Valid i mean that it hasnt been overwritten yet
08:52:00FromDiscord<mbrc> Yeah but thats entirely implementation dependent
08:52:20FromDiscord<Elegantbeef> References also are GC'd so you cannot raise data to them with the GC still working properly
08:53:11FromDiscord<mbrc> I see
08:53:18FromDiscord<mbrc> Thanks for the help!
08:55:59FromDiscord<Elegantbeef> No problem
09:21:31madpropsno problemo
09:21:35madpropsi'll help you with your demo
09:24:08*jmdaemon quit (Ping timeout: 250 seconds)
09:37:40FromDiscord<Phil> In reply to @Elegantbeef "References also are GC'd": What does it mean to raise data?
10:13:14*jjido joined #nim
10:46:44FromDiscord<Rika> You cannot promote a pointer into a reference pretty much
10:49:18madpropsyou can promote that pointer on my website hmu
10:51:28FromDiscord<jmgomez> hey guys, is it too crazy/difficult to modify the compiler to include custom cpp headers/symbols so compilation times are faster?
10:52:07madpropsyou mean like locally on your machine?
10:52:12madpropsnot at all
10:52:18FromDiscord<jmgomez> yes
10:52:48madpropscould it lead to some issues?
10:53:32FromDiscord<jmgomez> cool, thing is we are working on this unreal plugin, and there are thousands of headers being pulled I guess when inc compilation is out that wont be an issue but right now takes like 10 seconds (in a fast machine) to compile
10:55:34FromDiscord<Rika> I don’t know what you mean exactly by include custom headers
10:57:26FromDiscord<jmgomez> In order to use types from another cpp project in nim you have to include them via the importc option right? I was referring to that
10:58:28FromDiscord<Rika> Yes
10:59:00FromDiscord<Rika> Why would this increase compile speed
10:59:42FromDiscord<jmgomez> because the symbols are already there? dont they?
11:00:20FromDiscord<Rika> They still need to be processed the same, in the standard library or not
11:00:46FromDiscord<jmgomez> ohh ok
11:01:08FromDiscord<jmgomez> so the only adv that it would have is to be able to use them from NimScript?
11:01:48FromDiscord<Rika> Not even because NimScript does not have FFI
11:01:56FromDiscord<Rika> You’d have to add it manually in the VM
11:04:30*gsalazar quit (Ping timeout: 240 seconds)
11:04:39*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:08:10FromDiscord<jmgomez> oh
11:31:42FromDiscord<deadmeme77> can I ask how to convert a list into tables/critbittree?
11:39:30FromDiscord<deadmeme77> basically I have @["key", "value", "excess"] and I want to convert it into @["key": "value"]
11:46:21FromDiscord<Rika> A single value in a sequence or many values?
11:52:26FromDiscord<deadmeme77> a single value in a sequence, then I'll add it into the CritBitTree using incl[T] proc
11:52:37FromDiscord<deadmeme77> (edit) "I'll" => "I want to"
11:54:18*def- quit (Quit: -)
11:56:58FromDiscord<Rika> So just index 0 and 1 then?
11:57:38*def- joined #nim
11:57:45FromDiscord<deadmeme77> Yes! So I need some way to output the values of indexes 0 and 1 huh
11:59:00FromDiscord<Rika> theSeq[0]?
11:59:59*def- quit (Client Quit)
12:00:57*def- joined #nim
12:01:23*def- quit (Client Quit)
12:01:51*def- joined #nim
12:01:52*def- quit (Client Quit)
12:02:13*def- joined #nim
12:06:47def-un
12:09:36Amun-Ramoin
12:18:54FromDiscord<deadmeme77> In reply to @Rika "theSeq[0]?": Thank you! It's finished now
12:19:31*krux02 joined #nim
12:36:57FromDiscord<Yayko> Hello everyone, I really need help please, I am trying to wrap SDL2 with C2NIM but nothing comes out, I am trying to convert file.h using C2NIM file.h and the output is an empty Nim file.↵Can someone send me a real doc or tutorial to use C2NIM please?
12:46:15*tk quit (Quit: Well, this is unexpected.)
12:47:21*arkurious joined #nim
12:47:25*tk joined #nim
12:55:41*jjido joined #nim
12:56:26*tk quit (Ping timeout: 255 seconds)
12:56:29*atk joined #nim
12:58:36*atk quit (Changing host)
12:58:36*atk joined #nim
12:59:18*atk is now known as tk
13:01:03FromDiscord<Forest> Idk how often Planetis checks GitHub so https://github.com/planetis-m/naylib/issues/29 @planetis ^^
13:08:43FromDiscord<planetis> That's weird
13:08:59FromDiscord<planetis> Installed with nimble?
13:09:41FromDiscord<planetis> I have removed nayget, it depends once again on nake
13:10:11FromDiscord<planetis> See if removing and reinstalling naylib helps
13:11:15FromDiscord<Forest> Nope, not with nimble
13:11:19FromDiscord<Forest> I just cloned the repo
13:11:32ehmryyayko: why not https://github.com/nim-lang/sdl2?
13:21:07FromDiscord<Yayko> In reply to @ehmry "<@897838441453191218>: why not https://github.com/n": Thanks, I know there are a lot of SDL2 wrappers for nim^^ .↵But my question was more about using C2Nim, as I'd like to wrap SDL2 myself to see how it works and be able to do it again later for my future needs with other libraries.
13:23:44ehmryyayko: SDL2 must not be a good example because other people keep wrapping it by hand
13:26:36FromDiscord<aquova> Hello everyone, I have what is probably a very basic question. Using `scanf`, is it possible to capture "the rest of the string"? Say my input is something like `1. Hello World`, and I want to capture "Hello World" what is the best way to do this? It seems to want a much more rigid layout than parsing for an unknown string
13:28:18FromDiscord<Forest> Does Nim have a way for me to make 'shortcuts' for frequently accessed objects? Let's say there's `entity.shape.body.position`, could i somehow do `entity.position`?
13:29:59FromDiscord<Yardanico> make a template
13:30:11FromDiscord<Yardanico> there was a lib that did this as well, can't remember the name now
13:30:12FromDiscord<Yepoleb> Define a `position` proc for entity that returns the value
13:30:16FromDiscord<Yardanico> In reply to @aquova "Hello everyone, I have": yes it is possible
13:30:17FromDiscord<Yardanico> $+
13:30:48FromDiscord<Yardanico> it wasn't working correctly in some earlier nim versions, but in 1.4/1.6 it should work correctly
13:31:16FromDiscord<aquova> The docs say I need to specify a token following it; I tried `$+\n` but that didn't work correctly. Will it work if it's left blank?
13:31:41FromDiscord<Yardanico> yes it will
13:31:47FromDiscord<aquova> ty, I will give that a try
13:32:24FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3YP3
13:34:15FromDiscord<Yardanico> In reply to @aquova "The docs say I": but yes, you're right, the docs are a bit unclear, it would be better to clarify this behaviour
13:34:33FromDiscord<aquova> You are correct, that worked perfectly. Thanks!
13:35:14FromDiscord<Forest> In reply to @Yardanico "make a template": Hm? How do those work
13:35:20FromDiscord<Forest> In reply to @Yepoleb "Define a `position` proc": That is an option too tbh
13:35:28FromDiscord<Yardanico> In reply to @Forest "Hm? How do those": simple code substitution
13:35:42FromDiscord<Yardanico> making it a proc would result in useless function calls (runtime cost) just for the sake of shortness
13:35:49FromDiscord<Yardanico> with templates it'll be 0 cost
13:36:35FromDiscord<Forest> Yeah that's what i was thinking
13:36:45FromDiscord<Forest> Hm okay, there's probably examples in the manual
13:41:00FromDiscord<Forest> Is there also a way to have a field in a type to be `CustomType` or nil?
13:46:01FromDiscord<Yardanico> std/options
13:47:52FromDiscord<Forest> Thanks!
13:49:31*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
13:50:35FromDiscord<Yepoleb> In reply to @Yardanico "making it a proc": I assumed it gets inlined 100% of the time
13:50:45FromDiscord<Yardanico> In reply to @Yepoleb "I assumed it gets": i wouldn't expect this to be true
13:50:54FromDiscord<Yardanico> maybe with inline pragma, but I'm not so sure without it (except if you compile with LTO)
13:50:59FromDiscord<Yardanico> and templates will be shorter to write anyway
13:55:11FromDiscord<Yepoleb> Sad
14:01:35*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
14:03:55*ehmry joined #nim
14:06:59*tk quit (Quit: Well, this is unexpected.)
14:07:51FromDiscord<planetis> Then you haven't run nake buildDesktop yet↵(@Forest)
14:07:54*tk joined #nim
14:11:36FromDiscord<Forest> In reply to @planetis "Then you haven't run": I did, i cloned the repo, `cd`ed into the dir and ran `nake buildDesktop`
14:11:43FromDiscord<Forest> That's when i got the erorr
14:12:58*ehmry quit (Ping timeout: 244 seconds)
14:13:19FromDiscord<planetis> Oh sheep
14:14:48FromDiscord<planetis> I don't get it, what is the command you run?
14:17:01FromDiscord<Zoom> Is the "Planety" GH org related to [planetis](https://matrix.to/#/@planetis:matrix.org) in any way?
14:17:52*ehmry joined #nim
14:26:39FromDiscord<deech> Is there any existing syntax / macros for array construction that looks like: `makeSeq("a","b",@["c","d","e"],"f",...)` that makes `@["a","b","c","d","e","f",...]`?
14:27:25FromDiscord<deech> Basically some kind of strformat like thing but for generic data structure construction ...
14:30:49FromDiscord<planetis> Nope
14:31:56FromDiscord<Zoom> That's a nice coincidence than
14:32:30FromDiscord<Zoom> That's a nice coincidence then
14:33:17FromDiscord<planetis> There are zero imports to raylib.nim in the namefile so how that even happened
14:33:31FromDiscord<planetis> There are zero imports to raylib.nim in the nakefile so how that even happened
14:39:45FromDiscord<Forest> In reply to @Forest "I did, i cloned": The one here
14:41:16FromDiscord<Forest> Nothing else
14:41:42FromDiscord<planetis> I can't reproduce...
14:41:48FromDiscord<Forest> Just `git clone https://github.com/planetis-m/naylib`, then `cd naylib` and `nake buildDesktop`
14:41:54FromDiscord<Forest> Hm that's odd
14:50:20*tk quit (Quit: Well, this is unexpected.)
14:52:55*tk joined #nim
14:53:04FromDiscord<mbrc> Suppose I have a type A with a field of another type B. If I have something of type ref A, how do I get the ref associated to the field of type B from this?
14:56:19FromDiscord<Rika> In reply to @mbrc "Suppose I have a": Type B would not be a reference
14:57:50FromDiscord<mbrc> Yeah but can I get a reference to the B, something like what would be `&(ptr_to_A -> b)` in C++ ?
14:59:31FromDiscord<mbrc> because if I understand correctly, since the object A is on the heap, all its fields are too, so they technically have a well-defined location in memory
15:23:29NimEventerNew thread by Jasonfi: Channels documentation, see https://forum.nim-lang.org/t/9178
16:14:12FromDiscord<System64 ~ Flandre Scarlet> I hate CPU endianess!
16:15:44FromDiscord<System64 ~ Flandre Scarlet> here is the first 4 bytes of the files https://media.discordapp.net/attachments/371759389889003532/980142338645053490/unknown.png
16:16:08FromDiscord<System64 ~ Flandre Scarlet> and here is the first 4 bytes in memory https://media.discordapp.net/attachments/371759389889003532/980142437215375380/unknown.png
16:16:19FromDiscord<System64 ~ Flandre Scarlet> How can I avoid this please?
16:18:13FromDiscord<exelotl> retreat to a cabin in the woods, become a PowerPC developer
16:19:06FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3YPC
16:23:09FromDiscord<System64 ~ Flandre Scarlet> so, I have the wrong 32-bits values
16:23:29FromDiscord<exelotl> you can't avoid it, that's just how it works. The file is storing data in little-endian, the CPU works with little endian data. If you copy 00h .. 03h from that file into a uint32 you'll get a uint32 with the value of 0xff332854
16:24:59FromDiscord<exelotl> if you were to cast that uint32 to an `array[4, uint8]` and printed out the values you'd get `0x54, 0x28, 0x33, 0xff`
16:25:47FromDiscord<System64 ~ Flandre Scarlet> this is what I want↵I want this order
16:27:19FromDiscord<exelotl> that's what you have. it's just not how it behaves when you treat the 4 bytes as a single uint32
16:37:31FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3YPI
16:41:57FromDiscord<exelotl> The first approach adapts how it works depending on the endianness of the host platform. Which would be problematic if you're running on a big-endian system but reading a little-endian file.↵The second approach functions the same regardless of the host platform, it'll always get the byte at 03h.
16:42:00FromDiscord<System64 ~ Flandre Scarlet> this is the blue component?
16:42:11FromDiscord<System64 ~ Flandre Scarlet> arr[3]
16:42:31FromDiscord<exelotl> not according to your hex editor :P
16:43:28FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/980149316251443250/unknown.png
16:43:56FromDiscord<System64 ~ Flandre Scarlet> so it's green component in little endian
16:44:28FromDiscord<exelotl> wat
16:47:21FromDiscord<exelotl> I think transcribing the html notation from the data is most likely not correct - you've reversed the components, unless the file is stored in RRGGBBAA big-endian
16:47:28FromDiscord<exelotl> (edit) "stored" => "storing colours" | "storing coloursin RRGGBBAA big-endian ... " added "format"
16:47:51FromDiscord<exelotl> but I would guess it's storing them in AARRGGBB little-endian
16:49:12FromDiscord<exelotl> (I don't actually know anything about this file so I could be wrong heh)
16:49:29FromDiscord<System64 ~ Flandre Scarlet> I think it's RGBA here
16:49:37FromDiscord<System64 ~ Flandre Scarlet> in my hex editor
16:50:39FromDiscord<exelotl> the endianness is important though. AARRGGBB little-endian will appear as `BB GG RR AA` when viewed byte-for-byte in a hex editor
16:56:06FromDiscord<geekrelief> sent a long message, see http://ix.io/3YPK
16:57:01*PMunch joined #nim
16:58:22FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3YPL
16:59:33FromDiscord<System64 ~ Flandre Scarlet> In reply to @exelotl "the endianness is important": ah, in my hex it's RRGGBBAA
16:59:44FromDiscord<geekrelief> On another note, how can I check which gc is being useed at compile time?
16:59:50FromDiscord<System64 ~ Flandre Scarlet> so the CPU will read AABBGGRR?
17:11:48NimEventerNew thread by Geekrelief: GC refc crash calling into nim from C++, see https://forum.nim-lang.org/t/9179
17:15:00FromDiscord<!Patitotective> is there a way to use `{.strdefine.}` pragma in nimscript (`.nimble`)?
17:15:38FromDiscord<!Patitotective> i want to be able to define the output path for a nimble task
17:15:49NimEventerNew thread by Carcinocron: Unable to compile nim to wasm on aarch64, see https://forum.nim-lang.org/t/9180
17:25:38*jjido joined #nim
17:27:29FromDiscord<Ayy Lmao> How do I hold a bunch of string slices without copying them? Should I hold cstrings?
17:39:01FromDiscord<huantian> I think the solution was either use experimental views or cry about it unfortunately
17:41:09FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3YPV
17:41:47FromDiscord<!Patitotective> https://github.com/Patitotective/tinydialogs/blob/main/src/tinydialogs/tinyfiledialogs/tinyfiledialogs.h#L61
17:42:19FromDiscord<!Patitotective> (edit) "https://github.com/Patitotective/tinydialogs/blob/main/src/tinydialogs/tinyfiledialogs/tinyfiledialogs.h#L61" => "https://github.com/Patitotective/tinydialogs/blob/main/src/tinydialogs/tinyfiledialogs/tinyfiledialogs.h#L179"
17:45:56FromDiscord<demotomohiro> If you hold string slices with cstring, these cstring can become invalid pointer if the string reallocate internal string. Just hold index & size pair as slice might safer way. And you dont need to hold long string slice, you can use int32 or smaller type as index&size and save memory.
17:47:30FromDiscord<!Patitotective> In reply to @Patitotective "im getting this sus": nvm i needed to RTFM
17:48:04FromDiscord<demotomohiro> @!Patitotective I guess you need to link some libraries that contains these undefined ref functions.
17:48:41FromDiscord<!Patitotective> yeah they were in the tinyfiledialogs readme hehe
17:49:03*PMunch quit (Quit: leaving)
17:51:05FromDiscord<Ayy Lmao> In reply to @demotomohiro "If you hold string": My current solution has been to hold an index and size pair. I figured that was the safest way.
17:52:51FromDiscord<demotomohiro> @geekrelief I think you can use this: https://nim-lang.org/docs/compilesettings.html
17:54:47*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:56:38FromDiscord<demotomohiro> If I understand correctly, when you use view type to hold string slice, modifying the string while there is a view type to the string is compile error.
18:00:03FromDiscord<Ayy Lmao> In reply to @demotomohiro "If I understand correctly,": I'll have to look into it. Thanks!
18:26:33FromDiscord<Forest> Does anyone know what would be a good way to store a set of textures under a name? Like `textures.idle`
18:26:56FromDiscord<Forest> It shouldn't be possible to do `idle` on its own, since idle is a list of objects
18:29:35FromDiscord<Forest> A table would be great if i could do `tableName.key`
18:36:18FromDiscord<geekrelief> In reply to @demotomohiro "If I understand correctly,": thanks!
18:39:39FromDiscord<Ayy Lmao> In reply to @Forest "Does anyone know what": If you don't know the names until runtime I think you're stuck with a table probably. It's probably possible to write a nasty macro to do `tableName.key` but it's probably not advisable.
18:41:42FromDiscord<Ayy Lmao> If you know the names at compiletime you can just use an object, tuple, or even a module if you wanted.
18:43:25FromDiscord<Forest> Ah fair, thanks!
18:49:53FromDiscord<mbrc> did anyone have an answer to this? Sorry for asking again
18:51:12FromDiscord<Yardanico> In reply to @mbrc "did anyone have an": there's no safe way to do this, you can do it with `ptr`, but that's a raw unsafe pointer
18:51:18FromDiscord<Yardanico> (for context - the question was "Suppose I have a type A with a field of another type B. If I have something of type ref A, how do I get the ref associated to the field of type B from this?")
18:53:13FromDiscord<demotomohiro> ref type is similar to `std:shared_ptr<T>` in C++. It cannot point to class member safely.
18:57:06FromDiscord<demotomohiro> Ref types automatically free the heap it points to when last ref is gone. But if it points to a field of ref object, it should not free heap.
18:57:29FromDiscord<Forest> How would i allow reassignment to a field in my type?
18:58:42FromDiscord<demotomohiro> Use `var` variable.
19:01:00FromDiscord<Zectbumo> what do we all use to syntax highlight nim?
19:01:21FromDiscord<Zectbumo> in html
19:02:33FromDiscord<Yardanico> highlite
19:02:43FromDiscord<Yardanico> https://nim-lang.org/docs/highlite.html
19:03:04FromDiscord<Yardanico> simple example that makes it use highlight.js css classes (the highlighting itself is statically generated) https://github.com/pietroppeter/nimib/blob/main/src/nimib/highlight.nim
19:03:34FromDiscord<Zectbumo> 👍
19:06:09FromDiscord<mbrc> I see, makes sense. I did end up restructuring my code. Is it a recommended style to use and pass `ref`s for nontrivial objects everywhere?↵(@demotomohiro)
19:11:26FromDiscord<Elegantbeef> It's recommended when you need references
19:11:32*jjido joined #nim
19:11:47FromDiscord<Elegantbeef> Using references just cause will slow your program down
19:13:09FromDiscord<!Patitotective> In reply to @Patitotective "is there a way": beef, is this not possible? or maybe add arguments to a nimble task
19:13:41FromDiscord<huantian> could you just use parseopt? or just parse command line inputs directly idk↵(@!Patitotective)
19:13:51FromDiscord<demotomohiro> @mbrc this might help you to understand the difference between `ref object` and `object` type: https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
19:14:11FromDiscord<!Patitotective> In reply to @huantian "could you just use": 🤔
19:14:14FromDiscord<Elegantbeef> No clue patitot
19:16:00FromDiscord<Elegantbeef> Demo you also could link https://forum.nim-lang.org/t/8426#54529 😄
19:16:06FromDiscord<Yardanico> does anyone remember where nim has the logic for finding dynamic libs (with the dynlib pragma)
19:17:56FromDiscord<deech> The `cpp` backend currently seems to ignore the `--noMain:on` flag, I see a `NimMainModule` generated in the output, is this expected?
19:18:10FromDiscord<Yardanico> noMain means that it won't generate the C main function
19:18:20FromDiscord<Yardanico> Nim still needs some entry function to initialize globals and similar
19:18:45FromDiscord<Yardanico> In reply to @Yardanico "does anyone remember where": I'm trying to make it use macports openssl on osx 10.11 (friend's request), but it only seems to check /usr/local/bin and /usr/lib
19:18:51FromDiscord<Yardanico> even thought the $PATH has much more dirs
19:19:42FromDiscord<Elegantbeef> `LD_LIBRARY_PATH`?
19:19:44FromDiscord<demotomohiro> @Elegantbeef Thank you!
19:20:44FromDiscord<Yardanico> In reply to @Elegantbeef "`LD_LIBRARY_PATH`?": it's empty on this macosx, and I don't see it being checked in Nim code related to dynlib anywhere
19:20:47*krux02 quit (Remote host closed the connection)
19:20:49FromDiscord<Elegantbeef> No no dont thank me past me deserves all the credit
19:20:54FromDiscord<Yardanico> i will try I guess
19:21:04FromDiscord<Elegantbeef> It's empty by default
19:21:17FromDiscord<Elegantbeef> You use it to provide more library paths before it checks system paths
19:21:45FromDiscord<Yardanico> hmm I'm trying to export it but it doesn't help, lemme try with inline
19:21:45*krux02 joined #nim
19:23:27FromDiscord<Zectbumo> In reply to @Yardanico "simple example that makes": bummer, it doesn't seem to be portable code ↵`Error: cannot open file: /usr/local/compiler/pathutils`
19:23:39FromDiscord<Yardanico> it is portable, it just needs the compiler sources
19:23:48FromDiscord<Yardanico> in normal nim installations with choosenim/manual you'll have them
19:23:55FromDiscord<Zectbumo> I see
19:23:58FromDiscord<Yardanico> otherwise you have to "nimble install compiler" but that might go wrong
19:24:45FromDiscord<Zectbumo> /usr/local/compiler is an odd place to put this, I would think
19:25:14FromDiscord<Yardanico> In reply to @Zectbumo "/usr/local/compiler is an odd": that's because you have an os-wide Nim installation and packagers tend to change paths where things go
19:25:22FromDiscord<Yardanico> in nim distribution it's <nim root>/compiler
19:25:30FromDiscord<Zectbumo> yeah
19:25:38FromDiscord<Yardanico> arch nim package changes where nim things go quite a bit
19:26:03FromDiscord<Zectbumo> this needs to be rethunk
19:27:19FromDiscord<Yardanico> that's why it's better to install nim manually or with choosenim
19:27:24FromDiscord<eyecon> How can I represent "any pointer type"? Background: I'm trying to pack my `UncheckedArray` `cast`s into a function, so it would cast the incoming value. An `untyped` in a template would probably work but do we have a way to express this for a proc?
19:27:40FromDiscord<Yardanico> `pointer`
19:28:04FromDiscord<Yardanico> also why make procs just for casts? templates are enough I think
19:28:09FromDiscord<eyecon> In reply to @Yardanico "`pointer`": OK, thanks, let me try
19:28:33FromDiscord<eyecon> In reply to @Yardanico "also why make procs": You say "enough" but for me the templates are a higher complexity thing
19:28:50FromDiscord<eyecon> If it's more appropriate to use a template, I can use them, no problem
19:28:50FromDiscord<Zectbumo> In reply to @Yardanico "that's why it's better": unfortunately choosenim only supports a few platforms
19:28:59FromDiscord<Zectbumo> so...
19:29:04FromDiscord<Yardanico> "manual" installation is easy
19:29:09FromDiscord<Yardanico> 4 lines, and 1-2 more to add to $PATH
19:29:17FromDiscord<Yardanico> assuming you have a C compiler and Git
19:29:39FromDiscord<Zectbumo> In reply to @Yardanico ""manual" installation is easy": it's not. I tried. nim doesn't have `00% portable code
19:29:44FromDiscord<Zectbumo> (edit) "`00%" => "100%"
19:29:49FromDiscord<Yardanico> what do you even mean
19:29:54FromDiscord<Yardanico> Nim works on 10s of OSes and CPU architectures
19:29:58FromDiscord<Zectbumo> there are some errors
19:30:03FromDiscord<Yardanico> can you be specific?
19:31:13FromDiscord<Zectbumo> okay, for example, back in nim 1.6.4 (which is my distro current version) there is a test function that goes something like `[$iguana -eq "YES"] do this`
19:31:42FromDiscord<Zectbumo> well, `-eq` is for testing integers, not strings
19:31:57FromDiscord<eyecon> sent a code paste, see https://play.nim-lang.org/#ix=3YQm
19:32:08FromDiscord<Yardanico> you can just `copyMem`
19:32:22FromDiscord<Yardanico> In reply to @Zectbumo "okay, for example, back": this was a bug (regression) and was fixed
19:32:26FromDiscord<Yardanico> anything else?
19:32:39FromDiscord<Zectbumo> yes, okay let me look
19:32:49FromDiscord<dom96> In reply to @Zectbumo "unfortunately choosenim only supports": which platform are you on? arm I guess?
19:32:55FromDiscord<Zectbumo> OpenBSD
19:33:11FromDiscord<dom96> ahh, yeah, that's too exotic to keep support for :)
19:33:20FromDiscord<Yardanico> In reply to @Zectbumo "OpenBSD": nim itself supports that fine, choosenim doesn't, yes
19:33:30FromDiscord<Zectbumo> yes
19:33:56FromDiscord<dom96> I wonder if rustup supports it
19:34:25FromDiscord<Yardanico> In reply to @eyecon "Would this work? I": @eyecon
19:34:30FromDiscord<dom96> maybe if I can get access to some OpenBSD VMs it wouldn't be too tough to support
19:34:33FromDiscord<Yardanico> sent a code paste, see https://paste.rs/QFg
19:34:53FromDiscord<eyecon> I was just trying almost the same
19:35:13FromDiscord<eyecon> Does `newSeq` allocate or just set the capacity? According to your solution, it allocates, right?
19:35:16FromDiscord<dom96> Doesn't seem like rustup supports it either https://github.com/rust-lang/rustup/issues/2168
19:35:32FromDiscord<Yardanico> In reply to @eyecon "Does `newSeq` allocate or": eh, that's a bit of a wrong wording
19:35:40FromDiscord<Yardanico> even if you change capacity nim allocates
19:35:53FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3YQn
19:36:04FromDiscord<Yardanico> it's just that if you change the length itself, you can access all elements for the whole length
19:36:06FromDiscord<Yardanico> with capacity you can't
19:36:24FromDiscord<Yardanico> newSeq preallocates the whole seq which is needed here, because otherwise you won't be able to get the address of the first element
19:36:38FromDiscord<Yardanico> but there is no difference between newSeq and newSeqOfCap in terms of how much they allocate for the same length
19:36:56FromDiscord<Yardanico> In reply to @Zectbumo "here's one that deals": huh, does nim compiler use endians?
19:37:15FromDiscord<eyecon> After a `newSeq`, is it possible to access the newly allocated elements with indexing etc.?
19:37:22FromDiscord<Yardanico> In reply to @eyecon "After a `newSeq`, is": yes
19:37:31FromDiscord<Yardanico> don't you see my `result[0].addr`
19:37:44FromDiscord<eyecon> I thought it might have been special-cased
19:37:52FromDiscord<eyecon> So that's not the case, good
19:38:06FromDiscord<eyecon> Thank you
19:39:13FromDiscord<Zectbumo> In reply to @dom96 "ahh, yeah, that's too": can I try to send in some patches to help support OpenBSD?
19:39:16FromDiscord<Yardanico> of course
19:39:36FromDiscord<Yardanico> @Zectbumo no one has even claimed that Nim has "100% portable code", but for a lot of OSes/CPU arches the installation is really easy even for a manual one (c compiler + git)
19:39:50FromDiscord<Yardanico> and of course patches that improve compatibility for different OSes/architectures are always accepted
19:40:01FromDiscord<Yardanico> for example Nim has quite a lot of code specifically for Genode
19:40:02*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:41:30FromDiscord<Zectbumo> okay, I'll have to research the changes. and some strategy to fit in with the rest of the code. right now the patches overwrite source (like changing gcc to egcc) so I'll have to ping you guys for ideas how to go about this
20:03:42FromDiscord<Zectbumo> sent a code paste, see https://play.nim-lang.org/#ix=3YQr
20:03:54FromDiscord<Zectbumo> this confused me hard. I was only getting 1 line of code
20:04:29FromDiscord<Zectbumo> this is a bit rude. at least throw an error saying deprecated.
20:04:39FromDiscord<Zectbumo> (edit) "throw" => "print"
20:05:10FromDiscord<Zectbumo> (edit) "code" => "my file"
20:06:22FromDiscord<Zectbumo> then I look at docs and it says "deprecated" so I look at source to see WTH and it's hardcoded to read 1 line?? 🪦
20:09:16FromDiscord<Zectbumo> follow up question, why not just fix readLines (single param)?
20:10:52FromDiscord<dom96> In reply to @Zectbumo "can I try to": yeah, I would appreciate it in fact :)
20:11:17FromDiscord<Zectbumo> I'll give it a go
20:11:24FromDiscord<dom96> maybe for these less common platforms we can make the init.sh script print out a message describing how to install choosenim via the native package manager
20:11:46FromDiscord<dom96> (assuming openbsd has something similar to arch's community repos)
20:12:11FromDiscord<Zectbumo> yeah that would work. what would it take to get choosenim to support OpenBSD itself?
20:12:39FromDiscord<dom96> someone willing to build the openbsd binaries whenever a new release happens
20:12:49FromDiscord<dom96> (or some sort of automation that makes this easy)
20:13:11FromDiscord<dom96> It's already annoying enough having to build Windows + Linux + macOS manually
20:13:16FromDiscord<Zectbumo> I may be able to support that. let's see how I do with the code base first
20:14:08FromDiscord<dom96> I did merge this recently: https://github.com/dom96/choosenim/pull/296
20:14:35FromDiscord<Zectbumo> and to get my thinking going, what sort of workflow is there now? VMs? which one?
20:14:37FromDiscord<dom96> Though of late I've been very demotivated to do any more work on my Nim projects
20:14:58FromDiscord<Zectbumo> oh why?
20:15:24FromDiscord<dom96> Lots of different reasons which I'd rather not talk about here :)
20:16:41FromDiscord<Zectbumo> ah got it. well, I'll push forward
20:17:52FromDiscord<retkid> i want an array of arrays but because they're of different sizes i cant assign it
20:17:55FromDiscord<Zectbumo> there are so many reasons to be down for me and nim is the most exciting thing I have in my life right now. so I'll try to run with the torch a bit 😊
20:18:02FromDiscord<retkid> how do i get around this
20:22:05FromDiscord<huantian> array of seqs or object of arrays
20:22:26FromDiscord<Tuatarian> is there a way for me to define a field in a type as either of 3 types?
20:23:01FromDiscord<Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=3YQy
20:23:18FromDiscord<Generic> case objects
20:23:33FromDiscord<Generic> https://nim-lang.org/docs/manual.html#types-object-variants
20:23:57FromDiscord<huantian> or if it's known at compiletime, generics
20:24:32FromDiscord<Generic> yeah right, for this specific instance of a matrix type generics would be better suited
20:26:49FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3YQz
20:28:09FromDiscord<retkid> In reply to @huantian "array of seqs or": how do i convert to seqs
20:28:14FromDiscord<retkid> like [1,2,3
20:28:17FromDiscord<retkid> (edit) "[1,2,3" => "[1,2,3]"
20:28:21FromDiscord<retkid> but it needs to be predefined
20:28:23FromDiscord<huantian> `@[1, 2, 3]`
20:28:24FromDiscord<huantian> ?
20:28:28FromDiscord<retkid> oh yea
20:28:31FromDiscord<retkid> i forgot about that
20:32:57FromDiscord<retkid> can i make default values in types
20:36:49FromDiscord<huantian> hm?
20:36:55FromDiscord<huantian> wdym by types
20:41:36FromDiscord<retkid> In reply to @huantian "wdym by types": a typeObject that is initialized with a default type
20:42:05FromDiscord<retkid> (edit) "type" => "value"
20:48:34FromDiscord<Zectbumo> manual says "The default value depends on the type and is always a zero in binary." so I'm guessing no?
20:48:41FromDiscord<retkid> actually
20:48:52FromDiscord<retkid> it grabs the first value of an enum
20:48:54FromDiscord<retkid> ie 0
20:48:58FromDiscord<Forest> In reply to @demotomohiro "Use `var` variable.": idk what you mean
20:49:01FromDiscord<retkid> so it has a default if you check for 0
20:49:51FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3YQC
20:51:29FromDiscord<Forest> Hm i'm iterating over a sequence of my entity object though?
20:52:17FromDiscord<huantian> then the sequence should be var
20:52:31FromDiscord<Forest> It is `var Entities:seq[Entity] = @[]`
20:53:33FromDiscord<Forest> I get an error when trying to do an assigment, and if i comment the lines out it goes away completely?
20:53:49FromDiscord<huantian> https://play.nim-lang.org/#ix=3YQE
20:53:53FromDiscord<huantian> can you send the code?
20:54:00FromDiscord<Forest> yeah doing that rn
20:56:04FromDiscord<Forest> main.nim (may be relevent?): https://play.nim-lang.org/#ix=3YQG↵utils/extras.nim: https://play.nim-lang.org/#ix=3YQH↵↵Error: http://ix.io/3YQF
20:56:31FromDiscord<Forest> commenting lines 81 to 83 completely removes the whole error
20:56:58FromDiscord<Forest> sent a code paste, see https://paste.rs/KXJ
20:58:08FromDiscord<Forest> i could upload this to github to make it easier lol
20:59:49FromDiscord<Forest> https://github.com/Mythical-Forest-Collective/RayPlatformer
21:00:06FromDiscord<Forest> Oof accidentally left the .so there
21:01:05FromDiscord<huantian> it should be Entities.mitems() if you want mutable versions of the seq elements
21:02:41FromDiscord<Forest> ah okay, thanks!
21:03:23FromDiscord<huantian> also naming a var in CamelCase smh my head
21:03:46FromDiscord<retkid> i write everything in thisCase
21:04:07FromDiscord<huantian> wups I meant PascalCase
21:04:14FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/980214940512161792/unknown.png
21:06:22FromDiscord<Forest> In reply to @huantian "also naming a var": :p
21:07:40FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/980215803762856076/unknown.png
21:07:46FromDiscord<retkid> we programmers sure are interesting people
21:09:22FromDiscord<luteva> is there any effort on a nim adapter/wrapper class for the arangoDB?
21:10:38FromDiscord<Forest> Anyone know if i can make a variable just reference a value as a tempory shorthand? or will `var x = y` do that for mw?
21:10:44FromDiscord<Forest> (edit) "mw?" => "me?"
21:10:59FromDiscord<Generic> you'd need view types for that
21:11:26FromDiscord<Forest> what are those? :p
21:11:50FromDiscord<Generic> they're not stable yet
21:12:01FromDiscord<Generic> but they would allow something like this
21:12:22FromDiscord<Generic> if you want to make a short hand you can also use a template
21:12:42FromDiscord<Generic> `template shortname: untyped = longname`
21:13:27FromDiscord<Generic> afaik all constructs in Nim can also be local to a proc
21:13:32FromDiscord<Generic> so you don't need to throw this into global scope
21:14:17FromDiscord<Forest> In reply to @Generic "but they would allow": im using Nim devel anyway aha
21:14:26FromDiscord<Forest> In reply to @Generic "so you don't need": oh okay then cool
21:14:36FromDiscord<Forest> In reply to @Generic "`template shortname: untyped =": thanks :)
21:14:37*krux02 quit (Read error: Connection reset by peer)
21:28:25*mahlon quit (Ping timeout: 248 seconds)
21:34:28*mahlon joined #nim
21:35:44*jjido joined #nim
21:52:26*mahlon quit (Ping timeout: 258 seconds)
21:57:47*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:06:43NimEventerNew thread by Treeform: Show Nim: Guzba and I are publishing YouTube videos discussing our work in Nim, see https://forum.nim-lang.org/t/9181
22:08:05FromDiscord<treeform> ^ Let me know what you think 🙂
22:08:17NimEventerNew post on r/nim by treeform: Show Nim: Guzba and I are publishing YouTube videos discussing our work in Nim, see https://reddit.com/r/nim/comments/uzxazi/show_nim_guzba_and_i_are_publishing_youtube/
22:11:04FromDiscord<Rika> Sorry but I don’t think
22:11:10*mahlon joined #nim
22:27:23FromDiscord<demotomohiro> Sorry but it is hard to read source code because font size is too small. I need larger display.
22:30:19FromDiscord<Psych0p4th.nim> hey guys, anyone here can tell if have one nimble packet like scapy for python or gopacket for go, but for nim ?
22:30:51FromDiscord<Rika> So a packet inspector?
22:31:01FromDiscord<Psych0p4th.nim> no one packet creator
22:31:12FromDiscord<Rika> In reply to @demotomohiro "Sorry but it is": This is a good point, you usually need very large fonts for mobile viewing to be any good
22:31:19FromDiscord<Psych0p4th.nim> packet inspector i guess is the pcap lib avaible in nimble
22:36:45FromDiscord<treeform> In reply to @Rika "This is a good": I did not think about mobile use case
22:37:13FromDiscord<Rika> I don’t usually worry about it since the font size I use is already very large lol
22:37:21FromDiscord<Rika> <— blind motherfucker
22:38:28FromDiscord<martinium> anyone know how echo a seq to stdout without it also showing the @[] around the seq? Preferably all at once without having to iterate through the seq
22:38:55FromDiscord<huantian> I mean you can do `@[1, 2, 3].join(", ")`
22:39:04FromDiscord<huantian> but you gotta iterate through the seq no matter wht
22:39:25FromDiscord<martinium> I am trying to have them all on 1 line
22:39:37FromDiscord<martinium> @["142.251.40.142"]
22:39:41FromDiscord<martinium> is an example
22:40:07FromDiscord<martinium> want to just have the IP and any additional IPs just print side by side without iteration
22:41:16FromDiscord<huantian> `@[1, 2, 3].join(", ") == "1, 2, 3`
22:47:14FromDiscord<huantian> from `std/strutils` btw
22:50:25FromDiscord<martinium> trying now
22:51:30FromDiscord<martinium> that did it
22:51:38FromDiscord<martinium> needed the strutils import
22:52:49FromDiscord<martinium> thanks for the help @huantian
22:53:02FromDiscord<huantian> no prb
23:13:57FromDiscord<deadmeme77> has anyone tried to use nimble in replit before? I assume using the nixpkgs version? Would be cool if we can share GUI apps thru replit
23:19:17*mahlon quit (Ping timeout: 260 seconds)
23:21:13*mahlon joined #nim
23:32:05FromDiscord<Elegantbeef> You cannot change the behaviour else you may ruin functioning code↵(@Zectbumo)
23:32:49FromDiscord<Elegantbeef> Changes to how things work even if they're bugs can ruin functioning code, so breakages need to wait for a new breaking allowed version
23:34:19FromDiscord<huantian> Dang how did the bridge skip so many messages lol
23:34:32FromDiscord<Elegantbeef> No clue
23:34:37FromDiscord<Elegantbeef> Guess i restarted it
23:36:49FromDiscord<Elegantbeef> @treeform\: I do have to say one of the big benefits of the matrix based image effect is that it allows multiple different effects without a new shader, you can just plopp in new values and bam you have outline detection or whatever your kernel does
23:37:23FromDiscord<Elegantbeef> kernel based\
23:43:25FromDiscord<treeform> In reply to @Elegantbeef "<@107140179025735680>\: I do have": that's true
23:48:04FromDiscord<Elegantbeef> Also do you know about the dual kawase blur?
23:52:03FromDiscord<Elegantbeef> It's generally more efficient than a Gaussian blur afaik, so might be worth looking at
23:56:30*tk quit (Quit: Well, this is unexpected.)
23:57:25FromDiscord<Elegantbeef> I did find it a bit odd your blur render the texture to a smaller frame buffer then upscale
23:57:40FromDiscord<Elegantbeef> didnt render the texture\
23:58:46*tk joined #nim