<< 19-05-2023 >>

00:04:13*jmdaemon quit (Ping timeout: 256 seconds)
00:13:37FromDiscord<Elegantbeef> `import std/genasts` or just use `macros.quotedo`
00:15:13FromDiscord<SrMordred> sent a code paste, see https://play.nim-lang.org/#ix=4w9S
00:15:39FromDiscord<Andreas> `choosenim update devel`
00:15:44FromDiscord<Elegantbeef> `choosenim devel`
00:18:56FromDiscord<SrMordred> sent a code paste, see https://play.nim-lang.org/#ix=4w9U
00:19:14FromDiscord<Elegantbeef> Use andreas' command
00:19:23FromDiscord<SrMordred> ah
00:19:24FromDiscord<SrMordred> wait
00:21:07FromDiscord<SrMordred> old nim version lurking my path, my bad 🙂
00:28:38*jmdaemon joined #nim
00:39:35*jmdaemon quit (Ping timeout: 240 seconds)
00:59:38*derpydoo joined #nim
01:04:43FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=4w9X
01:05:18FromDiscord<spoon> side note, running on devel, compiling with orc gives me 0 immediately and running with --mm:refc has it just hang
01:07:45*nanxiao joined #nim
01:09:19FromDiscord<spoon> the expected output should be 10, but it gives 0 (only on arc/orc) and hangs on other models
01:29:49FromDiscord<Rika> get last value is wrong
01:29:56FromDiscord<amadan> sent a code paste, see https://paste.rs/p75oz
01:30:05FromDiscord<amadan> So its actually returning the current instead of n↔and its using the same type
01:30:06FromDiscord<Rika> Thats still technically wrong
01:30:14FromDiscord<Rika> current = current.next[]
01:30:22FromDiscord<Elegantbeef> People need to stop using cast
01:30:23FromDiscord<Elegantbeef> I swear
01:30:27FromDiscord<amadan> current is `ref node[T]`
01:30:34FromDiscord<Rika> Why
01:30:45FromDiscord<Rika> It doesnt have to be
01:31:01FromDiscord<amadan> guess not yeah
01:31:04FromDiscord<Elegantbeef> Current is a stack node
01:32:51NimEventerNew thread by noah: Clarification on nim v2 removal of parallel & spawn, see https://forum.nim-lang.org/t/10205
01:34:28FromDiscord<spoon> what's with the `[]` when using reference types?
01:34:40FromDiscord<Elegantbeef> It's the dereference operator
01:34:48FromDiscord<spoon> ah, makes sense
01:34:55FromDiscord<sOkam!> @amadan cast is only for when you want to explictely jump over the type system, because there is no other way around it (like C interop). i saw you removed that part, but just for future cases
01:35:14FromDiscord<Elegantbeef> I sure hope amadan know's what cast is for
01:35:15FromDiscord<spoon> alright, that works
01:35:39FromDiscord<sOkam!> In reply to @spoon "what's with the `[]`": like C's `myPointer`, but with a symbol that actually makes sense
01:35:41FromDiscord<spoon> i realized the dumb mistake later, but i do wonder what's causing the difference between arc/orc and the other mm models
01:35:42FromDiscord<amadan> In reply to @sOkam! "<@259999449995018240> cast is only": dw I didn't have a cast↔The original problem was I was using a ref when it wasn't needed
01:36:11FromDiscord<amadan> (edit) "In reply to @sOkam! "<@259999449995018240> cast is only": dw I didn't have a cast↔The original problem ... was" added "(in my answer to spoon)"
01:36:29FromDiscord<sOkam!> In reply to @amadan "dw I didn't have": oh sry, the code that had a cast was by @spoon
01:36:35FromDiscord<sOkam!> my bad
01:38:16FromDiscord<spoon> In reply to @sOkam! "like C's `*myPointer`, but": now that i think about it, i guess it does considering indexing an array is just dereferencing
01:38:47FromDiscord<sOkam!> yep
01:39:40FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=4w9Z
01:40:07FromDiscord<spoon> alright, i think i got the hang of it, thanks
02:24:41*nanxiao quit (Quit: Client closed)
02:55:44FromDiscord<Catting> Hi everyone! I am new in there.↔Is there any IDE recommendations?
02:56:33FromDiscord<Catting> I am try to use my IntelliJ or Clion to write Nim, but it seems they aren't support
03:03:57FromDiscord<JJ> vscode and `saem/vscode-nim`, or any ide with lsp support and `nimlangserver`
03:04:49FromDiscord<JJ> tooling is unfortunately a weakness of nim: but those will give you code completion and error highlighting
03:08:18FromDiscord<Catting> Oh god, an unfortunate news, I rely heavily on ide😂
03:08:44FromDiscord<Catting> Thanks, I will try your recommends
03:22:00FromDiscord<sOkam!> In reply to @Catting "Oh god, an unfortunate": that made it sound much worse than it actually is↔sure, it can be better. but its definitely not in "unfortunate" level of bad in any way
03:23:12FromDiscord<sOkam!> It has way more stuff out of the box than pure C. Or even cpp I would say↔It only falls behind (and not that much, in reality) if you compare it with rust or similar ecosystems
03:24:52FromDiscord<sOkam!> vscode-nim will get you covered for all your ide needs
04:17:49FromDiscord<Catting> Ok,thanks
04:18:52FromDiscord<michaelb.eth> In reply to @Catting "Hi everyone! I am": Emacs and nimlangserver work pretty well together, but not everyone is willing to the Strange Side of the Force
04:19:02FromDiscord<michaelb.eth> (edit) "In reply to @Catting "Hi everyone! I am": Emacs and nimlangserver work pretty well together, but not everyone is willing to ... the" added "turn to"
04:19:14FromDiscord<Elegantbeef> emacs users are the vegans of text ediditors
04:19:16FromDiscord<Elegantbeef> editors even
04:21:27FromDiscord<that_dude> Beef's got beef
04:21:28FromDiscord<michaelb.eth> true, and all the parens in the e-lisp provide the nutrients we'd otherwise be missing out on
04:23:58FromDiscord<Elegantbeef> Nah just shitty jokes↔(@that_dude)
04:24:54FromDiscord<that_dude> I bet you get that pun a lot
04:30:52*rockcavera quit (Remote host closed the connection)
05:39:49FromDiscord<voidwalker> any updated guide for nim debugging in vs code ?
05:40:55FromDiscord<voidwalker> sent a code paste, see https://paste.rs/e09UR
05:41:41FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=4was" => "https://play.nim-lang.org/#ix=4war"
06:23:57*nanxiao joined #nim
06:42:13*PMunch joined #nim
07:12:08*azimut quit (Ping timeout: 240 seconds)
07:44:23*derpydoo quit (Ping timeout: 240 seconds)
07:45:22*FromDiscord quit (Remote host closed the connection)
07:45:36*FromDiscord joined #nim
07:51:49FromDiscord<voidwalker> :\
08:10:55*lucasta quit (Remote host closed the connection)
08:27:28*Notxor joined #nim
09:25:23FromDiscord<tea> sent a long message, see http://ix.io/4waR
09:26:00FromDiscord<tea> (Also, I am not sure if this is the correct channel to discuss this. Internals seems to be related to development only so I was not willing to post there and disturb everyone 😅)
09:46:54FromDiscord<rakgew> @tea \: regarding nim-metprogramming, I enjoyed these\:↔● https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/↔● https://flenniken.net/blog/nim-macros/
09:47:30FromDiscord<rakgew> and there is also the "mastering nim" book which expands on meta programming.
09:47:38FromDiscord<Rika> In reply to @tea "(Also, I am not": This is the correct channel
09:53:01*nanxiao quit (Quit: Client closed)
09:55:29FromDiscord<⚶ Zeno> Hello world, how can i set timeout for a Future ?
09:56:15FromDiscord<⚶ Zeno> Nevermind, i should have read documentation, thank anyway
09:58:31FromDiscord<voidwalker> @tea there is also this https://ssalewski.de/nimprogramming.html#_advanced_nim
09:59:03FromDiscord<tea> In reply to @rakgew "<@122399590031818754> \: regarding nim-metprogrammi": Thanks ! Is there a way that I can read this book online ? It seems that I can not pay for an ebook (from what I have seen so far)
09:59:19FromDiscord<tea> In reply to @voidwalker "<@122399590031818754> there is": Thanks ! 😄
10:48:00FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wbd
10:48:43FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wbe
11:14:49FromDiscord<voidwalker> Is is possible that the way this array is constructed is problematic, with a template ?
11:20:46*Notxor quit (Ping timeout: 268 seconds)
11:34:17*junaid_ joined #nim
11:38:35PMunchWhat does alloca do voidwalker?
11:41:22Amun-Raallocates memory on the heap in an uncontrollable way
11:41:43PMunchHuh?
11:42:24Amun-Ra(I can't access play.nim)
11:42:33PMunchI'm updating and rebooting it
11:42:35PMunchhttps://man7.org/linux/man-pages/man3/alloca.3.html
11:42:48PMunchHmm, so alloca apparently allocates memory in the stack frame of the caller
11:43:11Amun-Raright, I meant stack
11:43:24Amun-Raalloca is almost never a good idea
11:43:45FromDiscord<voidwalker> I am trying to integrate this method: https://github.com/bpr/vla/blob/27580a5023e9411d9608b79d9e191a632c8e17e4/src/vla.nim#L26 in my code
11:43:49PMunchSo the memory allocated there will be freed once the procedure is over, which is probably why the `len` stuff causes an issue
11:44:09Amun-Raand why that needs to be template
11:44:16FromDiscord<voidwalker> ohh that makes sense now
11:44:30PMunchWell it it wasn't then `alloca` would free the memory once it returned
11:44:35FromDiscord<voidwalker> although I create it in my main code (not a proc)
11:44:51PMunchIt might be that Nim makes a proc of it under the hood
11:44:57PMunchHave a look at the C source code
11:45:02Amun-Raright
11:45:33PMunchWhy do you want to do this though? Aren't you just reinventing the seq-wheel
11:46:04FromDiscord<voidwalker> Just for fun mostly, I am trying to get as many base types on which to store a bit array as possible : )
11:46:19Amun-Rathat's reinventing seq with -d=danger always on ;)
11:46:23FromDiscord<voidwalker> I got array, seq, and now I'm trying allocated at runtime size array
11:46:59Amun-Rathe problem with alloca is you don't know how much size is too much
11:47:01FromDiscord<voidwalker> oh and mratsim suggested I use "ceilDiv" for this `S div (sizeof(B) 8) + int(S mod (sizeof(B) 8) != 0`
11:47:28FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wbp
11:47:35FromDiscord<voidwalker> I get `/home/sgm/.choosenim/toolchains/nim-#devel/lib/pure/math.nim(915, 17) Error: cannot generate VM code for and`
11:48:06FromDiscord<voidwalker> Is there a reason I cannot use ceilDiv in the type definition ?
11:48:15*Notxor joined #nim
11:48:26PMunchBy the way Amun-Ra, the Discord bot will auto-convert multi-line messages to code pastes and share them through the playground
11:48:48PMunchNot everything you see as a playground link actually makes sense there :P
11:49:02Amun-Ra:>
11:49:13PMunchAnd since it uses ix.io as the storage you can always use `ix.io/<four digit code>` to see the paste
11:49:27void09oh I am on irc too, I didn't know
11:50:04PMunchThat's why you get so many red dots in playground pastes, it's the Discord bot not converting them back to `*`
11:50:57FromDiscord<voidwalker> I supposed things used in type definitions should be "compile time". maybe ceilDiv is not compile time for some reason ?
11:51:05FromDiscord<voidwalker> (edit) "supposed" => "suppose"
11:55:42NimEventerNew Nimble package! StripeKit - Stripe API wrapper for Nim, see https://github.com/vfehring/StripeKit
11:58:14FromDiscord<chmod222> Just to be sure, if I have `proc foo(bar: Bar)` and `proc foo[T](bar: T)`, the concrete `bar: Bar` overload will be resolved before the generic `[Bar](bar: Bar)`?
11:58:15FromDiscord<chmod222> Quick test says yes, specific overload
11:59:55PMunchThat is correct
12:00:06PMunchAnd it's because it has a higher specificity
12:15:56*Onionhammer quit (Read error: Connection reset by peer)
12:17:59*Onionhammer joined #nim
12:18:41*junaid_ quit (Remote host closed the connection)
12:18:48FromDiscord<voidwalker> well it's not that it's not compile time-able, `const x = ceilDiv(1,2)` works
12:28:06*lucasta joined #nim
12:40:52FromDiscord<mratsim> In reply to @voidwalker "oh and mratsim suggested": The `B: Units` might be problematic, can use use `B: SomeUnsignedInt` instead?
12:41:18FromDiscord<mratsim> And if it still doesn't work, try making ceilDiv a template
12:41:22FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wby
12:41:23FromDiscord<voidwalker> still gives the same error
12:42:02FromDiscord<mratsim> Try with a template, sometimes operations at type level work better with kne
12:42:05FromDiscord<mratsim> One
12:47:55*rockcavera joined #nim
12:55:44FromDiscord<voidwalker> still the same error
12:55:45FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wbA
13:32:23*PMunch quit (Quit: Leaving)
13:33:38*krux02_ joined #nim
13:34:44FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=4wbQ
13:35:11FromDiscord<voidwalker> implement my own ceildiv ?
13:35:19FromDiscord<mratsim> or do (S+(sizeof(B)-1))/sizeof(B)
13:35:26FromDiscord<voidwalker> is this a compiler bug or what ?
13:35:31FromDiscord<mratsim> (edit) "(S+(sizeof(B)-1))/sizeof(B)" => "(S+(sizeof(B)8-1))/sizeof(B)"
13:35:54*myrix joined #nim
13:36:07FromDiscord<mratsim> In reply to @voidwalker "is this a compiler": The compiler can give up on comoile-time evaluation sometimes
13:38:45*progranner joined #nim
13:43:48FromDiscord<voidwalker> this also doesn't work
13:43:48FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4wbV
13:44:16FromDiscord<voidwalker> nvm, it does work
13:44:28FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=4wbV" => "https://play.nim-lang.org/#ix=4wbW"
14:06:51FromDiscord<voidwalker> oh now I understand what you meant by div/shr, I always have to divide by a power of two and I can use shr instead of div : )
14:10:39*lucasta quit (Remote host closed the connection)
14:10:47Amun-Ravoidwalker: tbh there shouldn't be any difference in the code, gcc/clang will produce shifts in the resulting code
14:11:03*lucasta joined #nim
14:14:35Amun-Rawell, there is a difference with signed types, https://godbolt.org/z/Ph6ehWaa5
14:20:33FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=4wc8
14:20:58FromDiscord<spoon> nothing should be pointing to current, right? do i have to do a manual `=destroy` in this case?
14:22:45FromDiscord<spoon> oh latest devel fixed it
14:22:54FromDiscord<voidwalker> sent a code paste, see https://paste.rs/6l04Y
14:29:05NimEventerNew post on r/nim by MetaMindWanderer: Is it possible to use this novel unit testing approach in nim?, see https://reddit.com/r/nim/comments/13lx1y5/is_it_possible_to_use_this_novel_unit_testing/
14:34:32*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
14:37:46*progranner joined #nim
14:40:06*lucasta quit (Remote host closed the connection)
15:55:50NimEventerNew post on r/nim by qtless: RestAPI Request Models In Nim, see https://reddit.com/r/nim/comments/13lzj83/restapi_request_models_in_nim/
16:22:38FromDiscord<AsbjĂžrn> sent a code paste, see https://play.nim-lang.org/#ix=4wcC
16:26:15FromDiscord<demotomohiro> Do you want to export Nim function to C that takes a pointer to C function and call it?
16:28:47FromDiscord<firasuke> What's the preferred method to bootstrap Nim from source? and what dependencies are needed?
16:31:16FromDiscord<demotomohiro> In reply to @firasuke "What's the preferred method": https://github.com/nim-lang/Nim↔You need a git to download source and gcc to compile csource.↔After download, just run build_all.sh or build_all.bat
16:34:13FromDiscord<michaelb.eth> In reply to @firasuke "What's the preferred method": choosenim can be helpful for that, just depending on your setup; e.g. `choosenim '#version-1-6'` will fetch latest commit on the `version-1-6` branch of nim-lang/Nim on github and build the compiler and the other tools from source
16:35:11FromDiscord<michaelb.eth> but as @demotomohiro notes can you also just clone the repo, checkout what you want, and use the build script
16:38:48FromDiscord<firasuke> thanks for the pointers
16:39:00FromDiscord<firasuke> it's for packaging nim in a recipe file for a custom distribution
16:39:06FromDiscord<firasuke> I prefer not to use choosenim for this purpose
16:39:19FromDiscord<firasuke> I read some recipes from mainstream distributions that use koch
16:39:31FromDiscord<firasuke> don't know if it's still relevant
16:40:23FromDiscord<demotomohiro> @AsbjĂžrn↔Here is minimum example:↔https://play.nim-lang.org/#ix=4wcD
16:41:12FromDiscord<AsbjĂžrn> yes, exactly↔(@demotomohiro)
16:41:15FromDiscord<AsbjĂžrn> Awesome!! thanks đŸ«‚â†”(@demotomohiro)
16:41:20FromDiscord<AsbjĂžrn> I'm gonna go play around with it a bit
16:41:28FromDiscord<demotomohiro> In reply to @firasuke "I prefer not to": build_all.sh or build_all.bat calls koch to build nim from source.
16:42:06FromDiscord<AsbjĂžrn> nim is so powerfull.. it keeps amazing me that I can be like "I wonder if I could..." and usually the answer is yes
16:42:25FromDiscord<firasuke> In reply to @demotomohiro "build_all.sh or build_all.bat calls": koch is nim's maintenance script, so if I understood correctly I only need a modern C compiler and shell as dependencies
16:43:12FromDiscord<demotomohiro> It seems Nim can do anything what C can do.
16:44:08FromDiscord<AsbjĂžrn> but with real types
16:45:25FromDiscord<firasuke> In reply to @demotomohiro "It seems Nim can": well yeah, I am just using my custom C compiler to cross compile a nim software I wrote, and it just works
16:45:36FromDiscord<firasuke> (edit) "my" => "a" | "acustom ... C" added "cross compiled"
16:47:51FromDiscord<demotomohiro> In reply to @firasuke "well yeah, I am": Yes, Nim is good at cross compiling as long as you have a C compiler for cross compiling.
16:48:10FromDiscord<Arathanis> does Nim have built in pointer arithmetic somewhere or do i need to roll my own?
16:48:35FromDiscord<Arathanis> its not hard, just dont want to reinvent the wheel if there is a `std/ptrarithmetic` library
16:49:16FromDiscord<demotomohiro> In reply to @Arathanis "does Nim have built": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-can-nim-do-pointer-arithmeticqmark
16:50:57FromDiscord<demotomohiro> Nim language itself doesn't have much pointer arithmetic.
16:51:10FromDiscord<Arathanis> ohh ok, so for some use cases i can use Unchecked array
16:51:10FromDiscord<Arathanis> got it
16:51:13FromDiscord<Arathanis> i was doing this:
16:51:53FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4wcI
16:53:40FromDiscord<voidwalker> there is this: https://github.com/kaushalmodi/ptr_math
16:54:30FromDiscord<Arathanis> oh cool, his is pretty much what i was doing too
16:55:47*azimut joined #nim
17:08:44FromDiscord<firasuke> In reply to @demotomohiro "build_all.sh or build_all.bat calls": ok running build_all.sh seems to be fetching csources v1, I have 2 questions here, why is not using v2? also is it possible to provide the sources for an offline build?
17:09:02Amun-RaI have a funny case where quit() does not really quit the app (and the thread support is off)
17:10:13FromDiscord<firasuke> In reply to @firasuke "ok running build_all.sh seems": unless the versions actually specify csources v1 for nim 1.x and csources v2 for nim 2.x
17:16:04FromDiscord<demotomohiro> In reply to @firasuke "ok running build_all.sh seems": I don't know why it is not v2.↔About offline build, i never tried it before.↔You would need to learn what build_all.sh do.
17:16:32FromDiscord<firasuke> oh ok
17:16:35FromDiscord<firasuke> makes sense
17:18:50FromDiscord<demotomohiro> I think, you build csources first.↔https://github.com/nim-lang/csources_v2↔Then build koch in Nim source and run koch to build Nim and Nim tools.
17:19:24FromDiscord<firasuke> yup, I think that might work
17:33:23FromDiscord<jmgomez> Is CSources basically the result c compilation of the Nim compiler?
17:41:39FromDiscord<demotomohiro> It looks like so:↔https://github.com/nim-lang/csources_v2/tree/master/c_code/1_1
18:01:47FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4wcW
18:11:50FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=4wcY
18:12:00FromDiscord<SirOlaf> (edit) "https://play.nim-lang.org/#ix=4wcY" => "https://play.nim-lang.org/#ix=4wcZ"
18:12:36FromDiscord<SirOlaf> Way I know of would be storing it in a temp variable, taking addr and converting pointer to seq[byte]
18:13:18FromDiscord<SirOlaf> (edit) "temp" => "second"
18:14:21FromDiscord<SirOlaf> But that still copies if you try to use it
18:16:06FromDiscord<demotomohiro> In reply to @Arathanis "is there a batteries": Probably `sizeof(mySeq) + sizeof(mySeq[0]) mySeq.len` is shortest way.↔But it doesn't contains all allocated heap size.
18:18:15FromDiscord<demotomohiro> In reply to @SirOlaf "Any way to avoid": Probably sink is not used because you use cast.
18:18:31FromDiscord<SirOlaf> Yeah but I wouldn't expect cast to cause a copy
18:18:48FromDiscord<SirOlaf> Isn't it meant to be dangerous and lower level
18:21:21FromDiscord<demotomohiro> I think `toOpenArray` or `toOpenArrayByte` is what you need.↔https://nim-lang.org/docs/system.html#toOpenArrayByte%2Cstring%2Cint%2Cint
18:24:45FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4wd1
18:26:50FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=4wd2
18:26:58FromDiscord<SirOlaf> `Error: invalid type: 'openArray[byte]' in this context: 'A' for let`
18:28:04FromDiscord<SirOlaf> Makes sense that it doesn't work, but error is not helpful
18:30:00FromDiscord<demotomohiro> How about to use `readBytes`?↔https://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural
18:31:16FromDiscord<SirOlaf> sent a code paste, see https://play.nim-lang.org/#ix=4wd3
18:31:16FromDiscord<SirOlaf> But you're right, readBytes would work
18:31:18FromDiscord<SirOlaf> Thanks
18:34:18FromDiscord<Arathanis> In reply to @demotomohiro "Probably `sizeof(mySeq) + sizeof(mySeq[0])": im unaware of the allocated heap size, where is that coming from? also I used `elementType` to cover the 0 len case where mySeq[0] would explode
18:35:41FromDiscord<demotomohiro> In reply to @Arathanis "im unaware of the": `sizeof` should not run given code.
18:36:25FromDiscord<demotomohiro> !eval var x = @[1]; echo sizeof(x[100000])
18:36:29NimBot8
18:36:52FromDiscord<Arathanis> OH ok
18:37:19FromDiscord<Arathanis> so it doesnt care about the index in sizeof lol
18:38:03FromDiscord<Arathanis> !e import std/typetraits; var x = @[1, 2, 3, 4, 5, 6]; echo sizeof(x) + sizeof(elementType(x))x.len
18:38:17FromDiscord<demotomohiro> `sizeof` just get the type of given expression and calculate the size at compile time.
18:38:19FromDiscord<Arathanis> !eval import std/typetraits; var x = @[1, 2, 3, 4, 5, 6]; echo sizeof(x) + sizeof(elementType(x))x.len
18:38:22NimBotCompile failed: /usercode/in.nim(1, 92) Error: invalid token: (\29)
18:38:47FromDiscord<Arathanis> !eval import std/typetraits; var x = @[1, 2, 3, 4, 5, 6]; echo (sizeof(x) + sizeof(elementType(x))x.len)
18:38:50NimBotCompile failed: /usercode/in.nim(1, 93) Error: invalid token: (\29)
18:38:52FromDiscord<Arathanis> 😭
18:39:20FromDiscord<Arathanis> !eval var x = @[1, 2, 3, 4, 5, 6]; echo (sizeof(x) + sizeof(x[0])x.len)
18:39:23NimBotCompile failed: /usercode/in.nim(1, 60) Error: invalid token: (\29)
18:40:11FromDiscord<demotomohiro> Maybe some of characters in your code doesn't work on discord bridge.
18:41:16FromDiscord<Arathanis> !eval import std/typetraits; var x = @[1,2,3,4,5,6]; let s = sizeof(x) + sizeof(elementType(x))x.len; echo s
18:41:20NimBotCompile failed: /usercode/in.nim(1, 90) Error: invalid token: (\29)
18:41:27FromDiscord<Arathanis> you must be right
18:41:31FromDiscord<demotomohiro> !eval echo 1 2
18:41:33NimBotCompile failed: /usercode/in.nim(1, 9) Error: invalid token: (\29)
18:41:52FromDiscord<demotomohiro> it seems '' doesnt work
18:41:53FromDiscord<Arathanis> !eval import std/typetraits; var x = @[1,2,3,4,5,6]; let s = sizeof(x) + sizeof(elementType(x))\x.len; echo s
18:41:56NimBotCompile failed: /usercode/in.nim(1, 91) Error: invalid token: (\29)
18:42:10FromDiscord<Arathanis> (edit) "sizeof(elementType(x))\x.len;" => "sizeof(elementType(x))\\x.len;"
18:42:22FromDiscord<Arathanis> oh its a format character
18:42:28FromDiscord<Arathanis> !eval import std/typetraits; var x = @[1,2,3,4,5,6]; let s = sizeof(x) + sizeof(elementType(x))\\x.len; echo s
18:42:31NimBotCompile failed: /usercode/in.nim(1, 92) Error: invalid token: (\29)
18:45:06FromDiscord<Arathanis> !eval `import std/typetraits; var x = @[1,2,3,4,5,6]; let s = sizeof(x) + sizeof(elementType(x))x.len; echo s`
18:45:09NimBotCompile failed: /usercode/in.nim(1, 23) Error: identifier expected, but got ';'
18:45:47FromDiscord<Arathanis> theres probably some secret tech for using ``
18:50:32FromDiscord<⚶ Zeno> sup people, what purpose is pcre64.dll in nim's bin directory ? i couldn't find it's purpose online
18:50:34FromDiscord<michaelb.eth> !eval `echo (NimMajor, NimMinor, NimPatch)`
18:50:36NimBotCompile failed: /usercode/in.nim(1, 16) Error: identifier expected, but got ','
18:51:12FromDiscord<michaelb.eth> !eval `(NimMajor, NimMinor, NimPatch)`
18:51:14NimBotCompile failed: /usercode/in.nim(1, 11) Error: identifier expected, but got ','
18:51:24FromDiscord<michaelb.eth> hmm
18:51:31FromDiscord<Arathanis> !eval (NimMajor, NimMinor, NimPatch)
18:51:33NimBotCompile failed: /usercode/in.nim(1, 1) Error: expression '(NimMajor, NimMinor, NimPatch)' is of type '(int, int, int)' and has to be used (or discarded)
18:51:45FromDiscord<Arathanis> !eval echo (NimMajor, NimMinor, NimPatch)
18:51:48NimBot(1, 6, 12)
18:52:04FromDiscord<demotomohiro> In reply to @⚶ Zeno "sup people, what purpose": I think it is used to implement regular expression in stdlib.
18:52:40FromDiscord<⚶ Zeno> In reply to @demotomohiro "I think it is": makes sense
18:53:00FromDiscord<michaelb.eth> yeah, it's an external dep for one/both of Nim's regex libs
18:53:21FromDiscord<voidwalker> where can I see the nim code after template expansion ?
18:53:27FromDiscord<⚶ Zeno> In reply to @michaelb.eth "yeah, it's an external": thanks
18:53:37FromDiscord<demotomohiro> In reply to @⚶ Zeno "makes sense": https://github.com/nim-lang/Nim/blob/devel/lib/wrappers/pcre.nim#L318
18:54:26FromDiscord<⚶ Zeno> In reply to @demotomohiro "https://github.com/nim-lang/Nim/blob/devel/lib/wrap": thanks to you too
18:54:40FromDiscord<michaelb.eth> on non-Windows, you'd normally get it via package manager (`apt`, `brew`, whatever) but on Windows the simplest course is arguably just to provide a bundle of DLLs along with Nim and its tools
18:55:12FromDiscord<⚶ Zeno> In reply to @michaelb.eth "on non-Windows, you'd normally": yea agreed
18:55:26FromDiscord<demotomohiro> In reply to @voidwalker "where can I see": https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped↔This might work for template.
18:55:37FromDiscord<michaelb.eth> I say arguably because I think there'd be merit in MSYS2 becoming the recommended way to get up and running with Nim on Windows, but others strongly disagree
18:56:54FromDiscord<michaelb.eth> with MSYS2 you'd just install libpcre with pacman if you need it, just like using a package manager on non-Windows
18:58:57FromDiscord<voidwalker> @demotomohiro I am not quite sure if I am using it wrong or what, but it's not working
18:59:47FromDiscord<voidwalker> ah nevermind, the code was way before the last terminal output, it works
19:00:56FromDiscord<michaelb.eth> @voidwalker if the other compiler output gets distracting while debugging your template/macro, you can try compiler flags like `--hints:off` to cut down on some of the noise
19:02:03FromDiscord<voidwalker> ok now I finally see what I might have been doing wrong with that alloca call. It's supposed to free the memory after the calling proc is finished, and I thought I call it in main() but nope, it was in a proc called from main that called the template
19:02:06FromDiscord<demotomohiro> In reply to @voidwalker "<@288750616510201856> I am not": `expandMacros` outputs at compile time.
19:02:46FromDiscord<voidwalker> so I need a template within a template
19:03:56FromDiscord<voidwalker> is it still a proc if I mark it with inline ?
19:03:58FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4wd8
19:04:03FromDiscord<voidwalker> in the C sense
19:04:18FromDiscord<Arathanis> https://media.discordapp.net/attachments/371759389889003532/1109194840685678662/image.png
19:12:24FromDiscord<demotomohiro> In reply to @voidwalker "is it still a": If I remember correctly, It become a c function with `inline`.
19:12:57FromDiscord<voidwalker> I tested with inline and it still messes up, I need a nested template.. ugh, i'm not good with templates
19:17:43FromDiscord<kcvinker> How to use unicode character literal in nim ?
19:17:56FromDiscord<Chronos [She/Her]> I'm unsure on how I should implement my event system honestly
19:18:22FromDiscord<Chronos [She/Her]> I want to support events being called asynchronously but that won't exactly matter in a WASM env, would it?
19:19:44FromDiscord<huantian> In reply to @kcvinker "How to use unicode": like this kind?
19:19:45FromDiscord<huantian> !eval echo "\u6211"
19:19:48NimBot我
19:20:16FromDiscord<Chronos [She/Her]> Hey beef, how would I run multiple WASM envs simultaneously? Would I just use threads for it? Since if that's the case, passing data may be problematic
19:26:51FromDiscord<demotomohiro> !eval echo ""○△□◇"
19:26:53NimBotCompile failed: /usercode/in.nim(1, 20) Error: closing " expected
19:27:06FromDiscord<demotomohiro> !eval echo "○△□◇"
19:27:09NimBot○△□◇
19:34:10FromDiscord<voidwalker> https://play.nim-lang.org/#ix=4wde - what's wrong with this template ? doesn't compile
19:52:58*Figworm joined #nim
19:53:10*Figworm quit (Client Quit)
20:10:51*Zevv left #nim (#nim)
20:37:53*rockcavera quit (Read error: Connection reset by peer)
20:38:28*rockcavera joined #nim
20:38:28*rockcavera quit (Changing host)
20:38:28*rockcavera joined #nim
20:44:42FromDiscord<Elegantbeef> @voidwalker\: inside a template all usages of the template parameters are replaced so that's `bv.10 = 10`
21:05:14FromDiscord<voidwalker> ah crap yeah that's not a proc : P
21:06:51FromDiscord<voidwalker> finally that's working
21:07:26FromDiscord<voidwalker> Now I have to figure out how useful that array will be if it dies when the proc it's created in returns
21:15:54*progranner quit (Quit: My Mac has gone to sleep. ZZZzzz
)
21:17:25*myrix quit (Ping timeout: 240 seconds)
21:28:17*noxnivi joined #nim
21:28:26noxnivigood day
21:28:57FromDiscord<Elegantbeef> Hello
21:29:25noxnivii'm having issues with the forum, nim-forum, i mean
21:29:35noxnivii can't post because i need to confirm email
21:29:45noxnivibut i can't find where to confirm email
21:29:49FromDiscord<Elegantbeef> that's seriously still a thing
21:29:52FromDiscord<Elegantbeef> Someone needs to ping @moderators
21:30:55FromDiscord<Elegantbeef> It's supposed to send a confirmation email, but it seems very buggy in that it fails a majority of the time
21:31:08noxnivii see...
21:31:21noxnivifunny thing though is that i posted before
21:31:35noxnivijust today it stopped working asking for the email confirmation thing
21:31:50noxnivibut no option to resend the confirmation email
21:32:11noxnivididn't know that Elegantbeef
21:36:53noxnivilooks like forum needs some enhancements
21:37:08FromDiscord<Elegantbeef> To quote what they say "PRs welcome"
21:38:26FromDiscord<voidwalker> "The forum is written in Nim" : D
21:42:46FromDiscord<jmgomez> I wonder if is the forum didnt exists and people asked in stack overflow Nim would have make into any of the "famous langs indexes" based on stack overflow popularity
21:43:35noxnivioh well...
21:43:50noxniviin the meantime, I mean, while i get that solved
21:44:20noxnivii need help with packing Nim+QML software
21:44:33noxnivithat is what i was trying to ask in the forum
21:44:59FromDiscord<Elegantbeef> Copy all the required DLLs next to the binary zip it and ship it
21:45:42noxnivimy issue is with the .qml files
21:46:17noxniviif I do that then when unzipped there will be a bunch of .qml files floating around
21:46:23noxnividoesn't look nice
21:46:25noxnivi:)
21:47:15FromDiscord<Elegantbeef> `staticRead` them and hope there is a proc to load them from memory
21:50:35noxniviaha... staticRead, I'll look into that
21:50:40noxnivithanks Elegantbeef
21:50:53FromDiscord<Elegantbeef> If you cannot load from memory use `memfiles` then
21:56:21noxniviwill review both methods, see which works
21:56:27noxnivithanks
21:56:37noxnivi:)
21:57:24FromDiscord<Elegantbeef> Also looking around seems you can make a `.qrc` if you do not want many files
22:03:29noxniviyes that .qrc file I already have
22:03:43noxnivinimqml docs and examples already point to that
22:03:54noxnivithat is what i was trying to write in the forum
22:04:04noxniviwith a tree of the project files
22:04:07noxnivi:D
22:04:10noxnivibut was a no go
22:04:13noxniviXD
22:17:34*lucasta joined #nim
22:22:13*Notxor quit (Remote host closed the connection)
23:07:55FromDiscord<System64 ~ Flandre Scarlet> Is it possible to import all files from a folder? https://media.discordapp.net/attachments/371759389889003532/1109256147195662406/image.png
23:12:56noxnivibye all
23:13:01*noxnivi quit (Quit: Leaving)
23:13:09FromDiscord<huantian> Bye
23:17:18FromDiscord<Rika> In reply to @System64 "Is it possible to": Not built in, either manually or make a macro I think
23:39:07FromDiscord<@theperfectcomputer-628303036da0> why does the function signature for satisfy have a function signature in it?
23:39:30FromDiscord<@theperfectcomputer-628303036da0> https://schneiderfelipe.github.io/microparsec/microparsec/internals.html#satisfy,,openArray[string]
23:39:34FromDiscord<@theperfectcomputer-628303036da0> sorry
23:39:35FromDiscord<@theperfectcomputer-628303036da0> semicolon
23:39:50FromDiscord<@theperfectcomputer-628303036da0> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1109264001055072286): why does the function signature for satisfy have a function semicolong in it?
23:39:54FromDiscord<@theperfectcomputer-628303036da0> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1109264001055072286): why does the function signature for satisfy have a function semicolon in it?
23:43:20FromDiscord<@theperfectcomputer-628303036da0> chatGPT says that after semicolon is for parameters that aren't regular
23:43:28FromDiscord<@theperfectcomputer-628303036da0> so I guess that's solved
23:43:50FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "Not built in, either": ah alright, and how can I get type of an object please? It is for a Case statement
23:54:57FromDiscord<System64 ~ Flandre Scarlet> Alright so I struggle with inheritence here↔It is supposed to be an OscillatorModule that inherits from SynthModule, but it doesn't display OscillatorModule, why? https://media.discordapp.net/attachments/371759389889003532/1109267985635483658/image.png
23:55:24FromDiscord<huantian> `of` not `is` I think
23:55:59FromDiscord<System64 ~ Flandre Scarlet> oh alright
23:56:13FromDiscord<huantian> `of` does runtime type check, `is` is static type check
23:56:26FromDiscord<System64 ~ Flandre Scarlet> Aaaah it works! thanks!
23:57:14FromDiscord<System64 ~ Flandre Scarlet> In reply to @huantian "`of` does runtime type": and how can I use case: of with that?
23:58:31FromDiscord<Rika> In reply to @@theperfectcomputer-628303036da0 "chatGPT says that after": semicolon and comma are roughly equivalent in function signatures
23:58:49FromDiscord<Rika> In reply to @System64 "and how can I": you dont
23:59:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @Rika "you dont": Uh oh! So YandereDev moment I guess?