<<27-09-2020>>

00:00:00*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:01:05*njoseph joined #nim
00:01:47*junland joined #nim
00:13:15FromDiscord<treeform> that was not in your snipit
00:13:17FromGitter<Knaque> My brain is just not functioning tonight, so I have to ask, what would be the easiest way of sending/receiving messages between a Nim program and a website?
00:13:24Yardanicohttp requests
00:13:27FromDiscord<treeform> ["foo"].getStr() or getFloat()...
00:13:45FromDiscord<treeform> I prefer websocket over http/rest
00:13:52FromDiscord<treeform> but http/rest is more widely used
00:22:41*enthus1ast quit (Ping timeout: 246 seconds)
00:33:02*a_chou quit (Remote host closed the connection)
00:33:37FromGitter<Knaque> When Treeform spoke up I remembered that he had a WebSocket library, and sure enough, that's all I needed.
00:34:59*enthus1ast joined #nim
00:42:22FromDiscord<treeform> yes I do
00:42:24FromDiscord<treeform> I love websockets
01:00:56disruptekdude.
01:02:07*lritter quit (Ping timeout: 240 seconds)
01:03:02*lritter joined #nim
01:06:02*hipoint-yc9 joined #nim
01:09:45*apahl quit (Ping timeout: 272 seconds)
01:11:10*apahl joined #nim
01:13:26*reversem3 quit (*.net *.split)
01:13:27*agentofuser[m] quit (*.net *.split)
01:13:27*silvernode[m] quit (*.net *.split)
01:13:27*orazovae[m] quit (*.net *.split)
01:13:28*unclechu quit (*.net *.split)
01:13:29*OMGOMG quit (*.net *.split)
01:13:29*hpyc9 quit (*.net *.split)
01:13:29*hipoint-yc9 quit (Quit: 420)
01:13:57*hpyc9 joined #nim
01:18:47Prestigesup disruptek
01:25:35*apahl quit (Ping timeout: 272 seconds)
01:27:27*apahl joined #nim
01:31:31disruptekwhat did i do?
01:39:37*kinkinkijkin quit (Remote host closed the connection)
01:40:24*abm quit (Quit: Leaving)
01:44:29FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2ySm
01:46:26FromDiscord<UNIcodeX> (edit) 'https://play.nim-lang.org/#ix=2ySm' => 'https://play.nim-lang.org/#ix=2ySo'
02:01:04*krux02 quit (Remote host closed the connection)
02:08:10FromDiscord<Elegant Beef> I could be wrong but i think the template generates an identfier with gensym which causes an issue with the macro invoke
02:13:13FromDiscord<UNIcodeX> it doesn't like `fmt`. If I use `"$1 : $2".format(cpuTime()-tStart, label)` it works....
02:13:19FromDiscord<Elegant Beef> Well yea
02:13:24FromDiscord<UNIcodeX> but.... I lose formatting.
02:13:24FromDiscord<Elegant Beef> https://play.nim-lang.org/#ix=2ySz this works aswell
02:13:57FromDiscord<Elegant Beef> I dont know the properway to use the template identifier for the macro, but what i just did is a dumb method of doing it
02:14:26FromDiscord<UNIcodeX> I didn't know about inject pragman
02:14:27FromDiscord<UNIcodeX> (edit) 'pragman' => 'pragma'
02:14:44FromDiscord<Elegant Beef> Well it's akin to properly declaring a variable so it's not proper to use here i imagine
02:14:57FromDiscord<Elegant Beef> Since if you dont block it, it defines tElapsed into scope
02:15:30FromDiscord<Elegant Beef> So it works but until someone smarter than me says if it's a hack or a proper fix i still fill iffy about using it 😄
02:15:37FromDiscord<Elegant Beef> feel*
02:20:44FromDiscord<UNIcodeX> > Well it's akin to properly declaring a variable so it's not proper to use here i imagine↵@Elegant Beef interesting, but I'm getting this `Error: undeclared identifier: 'label'`
02:20:51FromDiscord<UNIcodeX> straight copy and paste
02:21:04FromDiscord<UNIcodeX> choosenim devel
02:21:13FromDiscord<Elegant Beef> I mean works on nim playground
02:21:59FromDiscord<Elegant Beef> oh
02:22:05FromDiscord<Elegant Beef> forgot that you pass a string to the template
02:27:46FromDiscord<Elegant Beef> I say just clap your hands until someone that knows templates shows up 😄
02:33:37disruptekyou can use .inject in the params, too, but i can't even tell what you're trying to accomplish.
02:34:11FromDiscord<UNIcodeX> I'm just trying to find out how long certain parts of a procedure take.
02:35:36disrupteki usually try: body finally: evho
02:37:18disruptekyou can var foo {.inject.}: string and then set it inside the body; just insert your declaration in front of the body. the body can access it because it's in scope.
02:38:10disruptekif you want to access something local but not necessarily in the caller, you use bindsym.
02:41:14FromDiscord<flywind> May be better not to use `fmt` in templates.
02:41:58FromDiscord<flywind> I have ever written similar program without `fmt` https://github.com/xflywind/timeit/blob/ba4e90546af33632aea06208bc0f2d33418d2558/src/timeitpkg/main.nim#L146
02:47:15FromDiscord<UNIcodeX> > I have ever written similar program without `fmt` https://github.com/xflywind/timeit/blob/ba4e90546af33632aea06208bc0f2d33418d2558/src/timeitpkg/main.nim#L146↵@flywind Nice. Why oh why did I try to reinvent the wheel. This does what I'm looking for. Thanks!
02:48:35FromDiscord<flywind> no problem
03:02:29*muffindrake quit (Ping timeout: 272 seconds)
03:04:01*muffindrake joined #nim
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:34*supakeen joined #nim
04:07:31*leorize[m]1 left #nim ("User left")
04:07:49*leorize[m]1 joined #nim
04:15:35disruptek!repo criterion
04:15:36disbot12https://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 4🍴 7& 1 more...
04:19:53*shad0w_ joined #nim
04:29:46*waleee-cl quit (Quit: Connection closed for inactivity)
04:33:32FromDiscord<hobbledehoy> Nice
04:51:17FromDiscord<iWonderAboutTuatara> Hey everyone
04:51:23FromDiscord<iWonderAboutTuatara> ah dammit beef is offline
04:51:41FromDiscord<iWonderAboutTuatara> trying to implement a `->` instead of a `:` for proc return types to learn more about macros
04:52:05FromDiscord<iWonderAboutTuatara> and I'm getting really stuck on how to loop through something here
04:52:25FromDiscord<iWonderAboutTuatara> when i take `->` as the macro I don't get a NN with the full proc decl
04:52:29FromDiscord<iWonderAboutTuatara> so It's hard to work with
04:59:12FromDiscord<Elegant Beef> Dammit sucks he's offline
05:00:54FromDiscord<iWonderAboutTuatara> lmaoo
05:01:05FromDiscord<iWonderAboutTuatara> glad you're here, you're the expert on this kind of thing
05:01:10FromDiscord<iWonderAboutTuatara> any way to test this kind of thing?
05:01:17FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2ySY
05:01:23FromDiscord<iWonderAboutTuatara> this is an AST from this statmenet
05:01:26FromDiscord<Elegant Beef> I'm not an expert
05:01:28FromDiscord<iWonderAboutTuatara> `f(s : int) -> int : return 1`
05:01:31FromDiscord<iWonderAboutTuatara> close enough
05:01:49FromDiscord<iWonderAboutTuatara> (edit) '`f(s' => '```nim↵f(s' | '1`' => '1```'
05:02:02FromDiscord<Elegant Beef> You're attempting to replicate swift return types?
05:02:27FromDiscord<iWonderAboutTuatara> idk if its in swift
05:02:33FromDiscord<iWonderAboutTuatara> attempting to replicate -> return types
05:02:37FromDiscord<iWonderAboutTuatara> but, only for pure funcs
05:02:50FromDiscord<iWonderAboutTuatara> ie using `->` indicates a func and `:` indicates a pro
05:02:53FromDiscord<iWonderAboutTuatara> (edit) 'pro' => 'proc'
05:03:15FromDiscord<Elegant Beef> Ok so what
05:03:17FromDiscord<Elegant Beef> (edit) 'what' => 'what's the issue'
05:03:31FromDiscord<iWonderAboutTuatara> When I pass this to the proc
05:03:59FromDiscord<iWonderAboutTuatara> Is it just passing the `Ident ->` or the entire Stmtlist or the infix?
05:04:28FromDiscord<iWonderAboutTuatara> How do I check what's being passed also, when writing this outside of a dumptree throws error
05:04:41FromDiscord<Elegant Beef> Well without the macro made of course it'd error
05:09:44FromDiscord<Elegant Beef> @iWonderAboutTuatara seems like you're trying to change nim's syntax which isnt allowed
05:10:47FromDiscord<iWonderAboutTuatara> not allowed?
05:10:49FromDiscord<iWonderAboutTuatara> That's sad
05:14:00FromDiscord<Elegant Beef> Actually im uncertain why it was being a pain
05:14:16FromDiscord<iWonderAboutTuatara> wdym macro mode?
05:14:20FromDiscord<iWonderAboutTuatara> bit confused
05:14:27FromDiscord<Elegant Beef> made
05:14:37FromDiscord<iWonderAboutTuatara> no doubt
05:14:50FromDiscord<iWonderAboutTuatara> but I want to know what exactly is being passed, infix or ident
05:14:59FromDiscord<Elegant Beef> Well i mean this works https://play.nim-lang.org/#ix=2yT1
05:16:27*solitudesf joined #nim
05:17:04FromDiscord<iWonderAboutTuatara> wait how is it only passing things on the left?
05:17:48FromDiscord<iWonderAboutTuatara> wait yeah how did you seperate them?
05:18:05FromDiscord<Elegant Beef> I have limited knowledge on how the parser works 😄
05:18:49FromDiscord<Elegant Beef> `->` is an operator which means it requires a macro which takes a left and right, then you know you want a body which requires an `:` or possibly `=` although im uncertain of the latter
05:19:25FromDiscord<iWonderAboutTuatara> I see
05:19:33FromDiscord<iWonderAboutTuatara> so left and right in the macro params are keywords?
05:19:40FromDiscord<Elegant Beef> Nope
05:19:57FromDiscord<iWonderAboutTuatara> parser assumes first param is left and next is right?
05:20:00FromDiscord<Elegant Beef> It's an operator so it takes a left side and a right side
05:20:05FromDiscord<Elegant Beef> Yea i think so 😄
05:20:09FromDiscord<iWonderAboutTuatara> oh interesting
05:20:21FromDiscord<iWonderAboutTuatara> this seems super complex
05:20:29FromDiscord<iWonderAboutTuatara> /confusing
05:21:24FromDiscord<Elegant Beef> Lol you can do it, it's not too bad, all you have to do is generate the identdefs for a func definition and then set it's body to what you get from the user
05:21:46FromDiscord<Elegant Beef> I believe in you!
05:22:03FromDiscord<iWonderAboutTuatara> thanks!
05:22:30FromDiscord<iWonderAboutTuatara> so because `->` is interpreted as an operation
05:22:35FromDiscord<iWonderAboutTuatara> because its an operator/symbol
05:23:13FromDiscord<Elegant Beef> Yep
05:23:17FromDiscord<iWonderAboutTuatara> it takes an operand (left side, first param) and another operand (right side, second param)
05:23:31FromDiscord<Elegant Beef> That's my take on it
05:23:34FromDiscord<Elegant Beef> I could be wrong 😛
05:23:38FromDiscord<iWonderAboutTuatara> then because of the `:` that's a third nodeset/thing so I need a third param?
05:23:50*thomasross quit (Ping timeout: 272 seconds)
05:25:13FromDiscord<Elegant Beef> Yea i think so 😄
05:25:17FromDiscord<iWonderAboutTuatara> so I think it's dependant on the number of same level nodes you need
05:25:24FromDiscord<iWonderAboutTuatara> if you take anything less then 3 here than it throws an error
05:25:26*apahl quit (Ping timeout: 246 seconds)
05:25:36FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2yT7
05:25:57FromDiscord<iWonderAboutTuatara> oops
05:26:02FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2yT8
05:26:12FromDiscord<iWonderAboutTuatara> the macro itself is `Ident "->"`
05:26:28FromDiscord<iWonderAboutTuatara> We need Call block, Ident Int, and StmtList
05:26:41*apahl joined #nim
05:27:00FromDiscord<iWonderAboutTuatara> if we take any less than that in the macro, we just have either `int` or `: discard` hanging out which throws an error
05:27:05FromDiscord<iWonderAboutTuatara> specifically an indent compiler error
05:27:22FromDiscord<iWonderAboutTuatara> the first macro param takes the first same level node, ie the call
05:27:36FromDiscord<iWonderAboutTuatara> second macro param takes the 2nd same level node, ie the `Ident "int"`
05:27:50FromDiscord<iWonderAboutTuatara> third marco param takes the 3rd same level node, ie the `StmtList`
05:28:00FromDiscord<iWonderAboutTuatara> Could be completely wrong on this, but this is what I got from like 2 seconds
05:28:29FromDiscord<Elegant Beef> That's about all there is
05:39:52*voltist quit (Remote host closed the connection)
05:52:36FromDiscord<iWonderAboutTuatara> That's good, I can work with that!
05:55:04*narimiran joined #nim
06:06:38*arecacea1 quit (Remote host closed the connection)
06:07:03*arecacea1 joined #nim
06:10:59*nikita` joined #nim
06:12:48*mmohammadi9812 joined #nim
06:16:35*mmohammadi98129 joined #nim
06:17:57*mmohammadi9812 quit (Ping timeout: 256 seconds)
06:17:58*mmohammadi98129 is now known as mmohammadi9812
06:26:46*lritter quit (Ping timeout: 246 seconds)
06:27:16*kenran joined #nim
06:34:33*kungtotte quit (Read error: Connection reset by peer)
06:34:39*mmohammadi9812 quit (Ping timeout: 258 seconds)
06:35:45*kungtotte joined #nim
06:36:35FromDiscord<Elegant Beef> @iWonderAboutTuatara are you bald yet from pulling your hair out? 😛
06:43:52*kenran quit (Ping timeout: 256 seconds)
06:51:22FromDiscord<iWonderAboutTuatara> I actually tooka bit of a break
06:51:25FromDiscord<iWonderAboutTuatara> to prevent hair loss
06:57:31*vicfred quit (Remote host closed the connection)
06:57:56*vicfred joined #nim
07:04:08*zielmicha__ quit (Read error: Connection reset by peer)
07:04:33*alehander92 quit (Ping timeout: 258 seconds)
07:04:50*zielmicha__ joined #nim
07:05:49*alehander92 joined #nim
07:13:52*Vladar joined #nim
07:23:06*mmohammadi98129 joined #nim
07:32:41*mmohammadi98129 quit (Quit: I quit (╯°□°)╯︵ ┻━┻)
07:41:29*kinkinkijkin joined #nim
07:42:42*arecacea1 quit (Remote host closed the connection)
07:43:11*arecacea1 joined #nim
07:47:15*bung joined #nim
07:49:47*mmohammadi98129 joined #nim
07:50:49bungI create socket on main thread, pass it to child thread , let it do io work, that doesn't work, right?
07:52:40bungI got File descriptor not registered.
07:53:13*narimiran quit (Ping timeout: 246 seconds)
07:56:46*kinkinkijkin quit (Remote host closed the connection)
07:57:10*kinkinkijkin joined #nim
07:59:41leorizebung: you are doing cross-thread async?
08:00:10leorizethen you will have to use asyncdispatch.unregister(fd) on the thread that spawned the socket
08:00:29leorizethen register() on the thread that control the socket
08:11:30bungnot sure that fit my case, on the main thread side , I do newAsyncSocket connect, on the child thread I call async proc and addCallback to that future.
08:25:11*mmohammadi98129 quit (Quit: Ping timeout (120 seconds))
08:26:00*mmohammadi98129 joined #nim
08:28:43bungleorize let me try
08:35:26*reversem3 joined #nim
08:35:26*orazovae[m] joined #nim
08:35:26*agentofuser[m] joined #nim
08:35:26*silvernode[m] joined #nim
08:35:26*unclechu joined #nim
08:35:26*OMGOMG joined #nim
08:37:57*superbia1 is now known as superbia
08:42:57bungleorize it's worked , ty!
08:58:22*superbia1 joined #nim
08:58:26*shad0w_ quit (Ping timeout: 260 seconds)
09:00:42*superbia quit (Ping timeout: 258 seconds)
09:02:05*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:30:58*mmohammadi98129 quit (Ping timeout: 256 seconds)
09:39:13*mmohammadi98129 joined #nim
10:10:26*waleee-cl joined #nim
10:11:05*mmohammadi98129 quit (Ping timeout: 240 seconds)
10:15:11*fowl quit (Read error: Connection reset by peer)
10:15:19*sirn quit (Read error: Connection reset by peer)
10:15:28*fowl joined #nim
10:15:43*sirn joined #nim
10:19:55*MyMind joined #nim
10:21:28*Sembei quit (Ping timeout: 256 seconds)
10:21:32*mmohammadi98129 joined #nim
10:21:57FromDiscord<enthus1ast> @flywind don't feel disencourage when i open issues in prologue; i enjoy useing it so far 🙂
10:33:49FromDiscord<flywind> Never mind. I am more afraid of without users than without issues 😄
10:37:24*abm joined #nim
10:38:51FromDiscord<flywind> @enthus1ast
10:43:02*surma quit (Ping timeout: 272 seconds)
10:44:45*surma joined #nim
10:50:43*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
10:51:00*ehmry joined #nim
11:12:28FromGitter<cschardt> I happend to notice, that the colon character somehow operates like a function call, see for all variations https://play.nim-lang.org/#ix=2yUC
11:13:33FromGitter<cschardt> Could I have known this by reading the manual? Can sombody point me to the section, where this is explained?
11:13:48FromDiscord<Rika> colons after a function call pass the statements after the colon as the last parameter of the function
11:13:52FromDiscord<lqdev> that's because you're passing a code block as the last param
11:14:03FromDiscord<lqdev> which evaluates to the last statement in the block
11:14:42FromDiscord<Rika> the *result of the statement
11:14:49FromDiscord<Rika> made a mistake
11:24:04*sealmove joined #nim
11:25:30ForumUpdaterBotNew thread by Chaemon: Calling same-named-function from abstruct object, see https://forum.nim-lang.org/t/6864
11:25:40*mmohammadi98129 quit (Ping timeout: 246 seconds)
11:34:43*newUser joined #nim
11:36:31newUserhi, I have for example a #define D2PI (6.283185307179586476925287) in a C header file and want to import it into a nim file, how can I do this?
11:38:27FromDiscord<haxscramper> No, you can't directly import C defines. The Closest nim alternative would be `const D2PI = 6.283185307179586476925287`
11:40:00orazovae[m]how do I sort a sequence?
11:41:18newUserthx
11:41:19*Trustable joined #nim
11:48:23sealmovenewUser: there is a program called c2nim which does the bulk of the work, but usually you still need to tweak the result.
11:48:43newUserk
11:49:31sealmovecheck it out with `nimble install c2nim`, and then the syntax is `c2nim <c header file>` in the command-line.
11:50:28sealmovehonestly this is the only feature I am jealous of Zig...
11:51:24FromDiscord<Rika> orazovae: import algorithm and use the sort proc there
11:51:43newUseryup, works
11:51:47newUserthx
11:52:16newUserconst D2PI* = (6.283185307179586)
11:52:43newUsernice is the struct conversion....
11:52:48sealmoveand some other preprocessor stuff turn into templates
11:53:50sealmovepersonally I still find it tedious to make C bindings...
11:54:03sealmovebut maybe that's as good as it can get
11:54:11newUserI'm only playing around with it...
11:56:49FromDiscord<krisppurg> How would you do this in Nim? In python:↵`struct.pack_into(">I", header, 8, 60028)`↵I'm kind of struggling and confused with byte stuff in Nim.
11:57:17sealmovekrisppurg we don't have standard lib procs for that
11:58:12sealmovemaybe try this? https://github.com/OpenSystemsLab/struct.nim
12:00:13newUsersealmove: I have converted some procs too with c2nim, but there is missing {.importc, header:... after every proc, is it possible with one declaration to import all functions from header file
12:00:16newUser?
12:01:29sealmoveI think it's not :|
12:01:39newUserso copy and paste...
12:01:48sealmoveyou can use a seperate file and run c2nim on the header
12:02:22sealmovethen import the resulting file of c2nim
12:02:59newUseryes, but I get proc1, proc 2 etc but without proc1 {.importc, header:, proc 2 {.importc, header: ... etc
12:03:52FromDiscord<Rika> you can use a separate pragma-making pragma to at least reduce the repetition of the pragma
12:04:04sealmoveI see, maybe take a look at c2nim's options
12:04:30sealmoveif it's not possible then it's a good potential feature request for c2nim
12:04:48newUser<Rika> how this?
12:05:27newUserthe best is to have one {.importc, header: on top of the file...
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:30FromDiscord<Rika> you can do something like `{.pragma: name, importc, header: ....}` then use `{.name.}` on all function declarations
12:06:38*supakeen joined #nim
12:06:47newUserahhh, ok
12:07:23*bra-ket quit (Ping timeout: 240 seconds)
12:26:03bungparams:varargs[T] using @params turn to seq[T], right ? I still get `which cannot be captured as it would violate memory safety`
12:26:33*xace quit (Ping timeout: 258 seconds)
12:26:56FromDiscord<Rika> full error and code please
12:27:06FromDiscord<Rika> rather, minimized code if possible
12:27:47bungsee https://play.nim-lang.org/#ix=2yV2
12:27:53FromDiscord<Rika> will look
12:28:43*xace joined #nim
12:28:54FromDiscord<shashlick> @newUser there is a header option for c2nim
12:29:04FromDiscord<shashlick> What are your wrapping though
12:29:31newUser?
12:30:46FromDiscord<Rika> there seems to be some weird issues regards varargs and async?
12:30:48newUserI have converted a header file from c to nim and have now many procs but without {.importc, header: " ... etc
12:31:19newUserto use the static lib
12:31:53newUserI have picked 2 functions and it works
12:32:27newUserbut I don't want to copy and paste 200 times and more the same importc
12:33:07FromDiscord<Rika> you can probably use the push and pop pragma
12:33:13newUserwith {.pragma: name, importc, header: ....} works but the same, copy and paste
12:33:15FromDiscord<Rika> {.push: importc....}
12:33:23FromDiscord<Rika> this will apply to all under the pragma
12:33:24newUseron top
12:33:31FromDiscord<Rika> then just {.pop.} to end it
12:33:43newUserwill try it
12:33:56FromDiscord<Rika> put it on an empty line
12:34:38bungRika I didn't know that, I remeber I can use @
12:35:31FromDiscord<Rika> well i cant access the param at all no matter what i do
12:35:37FromDiscord<Rika> so its not @ but the varargs type
12:35:41FromDiscord<Rika> thats the issue
12:35:44FromDiscord<Rika> i believe
12:38:35newUser<Rika> biggggg smilleeee, thx
12:38:44newUserit works
12:38:55newUserbut after push no :
12:39:00FromDiscord<Rika> yes
12:39:02FromDiscord<Rika> its not a block
12:39:05FromDiscord<Rika> its just a pragma
12:39:09FromDiscord<Rika> its kinda weird but eh
12:39:57newUserhurray.... thx a lot, have a nice sunday, bye
12:40:09*newUser quit (Remote host closed the connection)
12:40:31bungdoes it related to object variant param ?
13:11:25*tane joined #nim
13:22:07*solitudesf- joined #nim
13:22:38*solitudesf quit (Ping timeout: 272 seconds)
13:51:04*krux02 joined #nim
13:55:12FromDiscord<Recruit_main707> newUser, as shashlick said, c2nim has a --header option that will actually wrap the header file instead of transpiling it
13:56:10bungRika you're right, it just releated to async
14:00:33*bung quit (Quit: Lost terminal)
14:07:44*narimiran joined #nim
14:18:08*bung joined #nim
14:22:23*NimBot joined #nim
14:26:36sealmove@Rika just to clarify: after this `push` pragma you still have to declare all procs in nim right?
14:27:26sealmoveI wonder if nim could somehow implement seemless interop with C, since it compiles to C...
14:27:36FromDiscord<Rika> yes
14:28:19sealmovefor example Zig has this feature, but Zig is a C compiler, it doesn't compile to C, so I don't know...
14:29:33FromDiscord<Rika> nim is not a c compiler
14:30:53sealmoveI guess Nim compiler would have to generate and inject the Nim declaration itself. Theoretically it's possible right?
14:31:27FromDiscord<Rika> is there a reason you arent using nimterop
14:32:46*bosyf joined #nim
14:33:55bosyfhas anyone noticed there is no slice assignment for seqs? you cant do s[1..3] = @[1, 2, 3] for example but you can for arrays
14:34:18sealmoveDoesn't nimterop depend on c2nim? meaning it has the same limitations. I guess it's not a matter of integrating it into the Nim compiler but rather improving c2nim.
14:34:30FromDiscord<Rika> look into it
14:35:03bosyflike you can set slices of arrays to either seqs or arrays, but you cant set slices of seqs to anything
14:35:23FromDiscord<Rika> probably just an oversight bosyf
14:37:16bosyfoh, my bad, i was assigning a seq of ints to a seq of bytes
14:37:26*bosyf quit (Remote host closed the connection)
14:38:15FromDiscord<Rika> oh lol
14:40:19sealmoveah nimterop doesn't depend on c2nim hmm
15:04:58*sealmove quit (Read error: Connection reset by peer)
15:28:30*gmaggior joined #nim
15:46:16*a_chou joined #nim
16:13:28FromDiscord<juan_carlos> Hacktoberfest incoming
16:21:25*a_chou quit (Ping timeout: 246 seconds)
16:24:58*a_chou joined #nim
16:25:45FromDiscord<Recruit_main707> is there something similar to `std::bind` for nim?
16:27:16Zevvnah, just wrap it in a closure proc
16:29:41FromDiscord<Recruit_main707> hmm, im not sure that would work, this is a pretty specific situation
16:31:27*dv-^_^6 joined #nim
16:52:54FromDiscord<haxscramper> Can also make all sorts of unpacking operators on top of pattern matching. Like `(_, (@a, @b)) := (1, (2, 3))`, `[@first, all @other] := [1,2,3]` and basically anything else
16:53:21FromDiscord<haxscramper> Using the same syntax as in`case`
16:53:41FromDiscord<haxscramper> And also rust's `if let` and `while let`
16:53:51FromDiscord<haxscramper> Basically for free
16:55:53FromDiscord<haxscramper> Like `a, *b = [1,2,3,4]` in python. And also nested tuple unpacking
16:58:43FromDiscord<Recruit_main707> Zevv: can you show me an example of your solution to a lack of `std::bind`?
17:01:32FromDiscord<KingDarBoja> > Hacktoberfest incoming↵Yeah
17:01:36FromDiscord<KingDarBoja> I posted it on <#371759607934353448>
17:05:12FromDiscord<dom96> what y'all contributing to?
17:08:28disruptekincremental compilation
17:09:20FromDiscord<haxscramper> Unpacking arrays into fixed-size slices is a common use case?
17:09:28FromDiscord<haxscramper> Like binary unpacking for example
17:12:51ZevvRecruit_main707: Can you explain your problem then? Maybe my understanding of ::bind is half baked
17:13:20ZevvBut basically no more then this trivial thing: https://play.nim-lang.org/#ix=2yWz
17:15:52FromDiscord<Recruit_main707> yep, i did something similar in the end
17:16:02Zevvand that didn't work?
17:16:13FromDiscord<Recruit_main707> i think it has
17:16:27*a_chou quit (Ping timeout: 240 seconds)
17:16:28Zevvwell, there you go :)
17:16:30FromDiscord<Recruit_main707> the problem was that i have to pass an instance
17:16:46Zevvwhat's an instance
17:16:52FromDiscord<Recruit_main707> of an object
17:17:06FromDiscord<Avatarfighter> What is up everyone
17:17:22ZevvRecruit_main707: and why is/was that a problem?
17:17:27ZevvAvatarfighter: Hey there
17:17:28FromDiscord<Recruit_main707> now the "problem" is that i need to save that reference somewhere in my data structure, but i can live with that
17:17:36FromDiscord<Recruit_main707> Avatarfighter: sup
17:17:41ZevvCan't you save it in the closure?
17:18:09FromDiscord<Recruit_main707> i dont think so
17:18:21Zevvhave you tried pushing it harder?
17:18:24FromDiscord<Avatarfighter> Zevv, Recruit_main707: What are you two doing? It sounds interesting.
17:18:37ZevvI have no clue. He's talking dirty C++ things
17:18:52Zevvwhich I don't understand. So I gave a nonsense answer which happened to be almost the right thing
17:18:53FromDiscord<Recruit_main707> acually, i might be able to
17:19:07*a_chou joined #nim
17:19:18FromDiscord<iWonderAboutTuatara> anyone running a linux box here?
17:19:26FromDiscord<Avatarfighter> cpp 😮
17:19:34FromDiscord<Avatarfighter> I do @iWonderAboutTuatara Laptop + servers
17:23:46ZevvRecruit_main707: code is data, data is code. with closures you don't need objects. I bet you can do that just fine :)
17:25:50*hnOsmium0001 joined #nim
17:30:37FromDiscord<Recruit_main707> Zevv: im pretty sure i cant do it without saving the reference somewhere, here you have the most minimal example i could write showcasing the issue, just in case you want to have a look at it, but you already have done more than enough, so thanks.↵https://play.nim-lang.org/#ix=2yWE
17:32:57FromDiscord<iWonderAboutTuatara> how is it for desktop use?
17:33:01FromDiscord<iWonderAboutTuatara> how much size should I assign?
17:33:32FromDiscord<iWonderAboutTuatara> does it make more sense to go WSL on Windows or WINE on linux?
17:33:58*Vladar quit (Quit: Leaving)
17:34:51ZevviWonderAboutTuatara: these are pretty broad questions
17:35:12ZevvI have never used windows in my life, but I find linux desktop use usually pretty crappy
17:35:38FromDiscord<Avatarfighter> @iWonderAboutTuatara I run Linux Mint on my laptop and I would say that the desktop experience is smoother if not better than windows. The only downside is the lack of a lot of big brand software(you'll find alternatives) and driver support and stuff
17:36:03FromDiscord<Avatarfighter> im WSL will do more than enough for most peoples needs
17:36:21FromDiscord<Avatarfighter> (edit) 'WSL' => 'sure *WSL'
17:42:17FromDiscord<lqdev> ah yes, linux users.
17:42:34FromDiscord<lqdev> honestly, please just stick with windows. it will save you a lot of headaches in the long run.
17:42:46*mmohammadi98129 joined #nim
17:42:59FromDiscord<lqdev> unless you want to spend countless hours on debugging why stuff doesn't wanna work, that is.
17:45:11FromDiscord<iWonderAboutTuatara> I mean, worth trying no?
17:45:25FromDiscord<iWonderAboutTuatara> I don't have major issues with win10 at the moment
17:45:34FromDiscord<iWonderAboutTuatara> I run linux on my laptop and it's fine
17:46:00FromDiscord<iWonderAboutTuatara> @Avatarfighter WSL doesn't support gui apps for whatever reason
17:46:04FromDiscord<iWonderAboutTuatara> at least not easilt
17:46:11leorizeif you use intel/amd hardware linux will work 99% of the time
17:46:17FromDiscord<iWonderAboutTuatara> and also its broken for me
17:46:25FromDiscord<Avatarfighter> I tried upgrading my linux mint, I spent 4 hours getting everything ready and it failed and I have no idea why
17:46:29FromDiscord<iWonderAboutTuatara> I use intel it 7400 & nvidia gtx10603gb
17:46:34FromDiscord<iWonderAboutTuatara> would be using popos
17:46:48FromDiscord<iWonderAboutTuatara> who provides an ISO prebuilt with the proprietary nvidia drivers
17:46:56superbia1archlinux
17:47:16FromDiscord<iWonderAboutTuatara> arch bad
17:47:21FromDiscord<iWonderAboutTuatara> I used arch for a bit
17:47:28FromDiscord<Yardanico> nvidia bad
17:47:31FromDiscord<iWonderAboutTuatara> way too much pain for way too little gain
17:47:33FromDiscord<iWonderAboutTuatara> agreed nvidia bad
17:47:37leorizeif you want linux without having to scratch your head everytime an update breaks something, fedora silverblue is the best out there
17:47:41FromDiscord<iWonderAboutTuatara> but I buy the cheapest best hwcard
17:47:49superbia1leorize: you want archlinux
17:47:51PrestigeArch and fedora are good
17:47:55FromDiscord<Avatarfighter> I need to figure out if I can upgrade the eMMC chip in my chromebook, I have recently learned that microsd cards can corrupt with repeatedly writing to it
17:48:00FromDiscord<iWonderAboutTuatara> see but then I'd ahve to deal with wayland and dnf
17:48:06superbia1guck wayland
17:48:14superbia1use xorg
17:48:14leorizewayland is cool
17:48:15FromDiscord<iWonderAboutTuatara> plus proprietary nvidia drivers on foss first fedora would suck for sure
17:48:28FromDiscord<iWonderAboutTuatara> wayland is unusable last i tried
17:48:32FromDiscord<Avatarfighter> I'm so sorry for starting this conversation guys
17:48:44FromDiscord<iWonderAboutTuatara> nah this is fun lmao
17:48:46leorizewe should move this to #nim-offtopic
17:48:50FromDiscord<Avatarfighter> yeah we shoould
17:48:50FromDiscord<iWonderAboutTuatara> also it's my fault, I inquired first
17:48:52FromDiscord<iWonderAboutTuatara> good idea
17:49:20FromDiscord<Avatarfighter> Its fine though, everyone knows Linux Mint is the best so there shouldn't even be an argument 🥴
17:51:52FromDiscord<Rika> MFs fuckin invaded the keyboard talk with this linux argument SMH
17:54:59*a_chou quit (Ping timeout: 240 seconds)
17:58:35FromDiscord<Avatarfighter> @Rika lmao
17:59:08Adeondoes anyone know a link to a code or example that uses "genSym" the function in a template?
17:59:26AdeonI know there is {.gensym.} like "var something {.gensym.} =" but I wonder how the function itself would be used
17:59:55FromDiscord<haxscramper> You should use it in macros like `let variable = genSym(nskLet, "varname")`
18:00:19Adeonah right yes
18:00:22FromDiscord<haxscramper> Templates are hygienic by default and there is no need to create unique identifiers explicitly
18:01:41Adeonthanks
18:01:48FromDiscord<haxscramper> Why `echo typeof((@[1,2,3][0..2]))` is `int` but the same expression evaluated - `echo (@[1,2,3][0..2])` clearly gives `seq[int]`
18:04:20*arecacea1 quit (Read error: Connection reset by peer)
18:04:57*arecacea1 joined #nim
18:06:40FromDiscord<iWonderAboutTuatara> confused about something with macros here
18:06:51FromDiscord<iWonderAboutTuatara> sent a code paste, see https://paste.rs/6cE
18:07:55FromDiscord<iWonderAboutTuatara> throws error `Invalid node kind nnkIdentDefs for macros.\`$\``
18:08:08FromDiscord<Rika> cant print idefsd
18:08:09FromDiscord<Rika> (edit) 'idefsd' => 'idefs'
18:08:10FromDiscord<iWonderAboutTuatara> ```Invalid node kind nnkIdentDefs for macros.\`$\````
18:08:17FromDiscord<iWonderAboutTuatara> oh, that is odd
18:08:20leorizeuse `treeRepr` to print NimNode
18:08:21FromDiscord<Rika> use repr or treerepr
18:08:23FromDiscord<haxscramper> You need to explicitly convert to string representation using `node.repr` or `node.toStrLit()`
18:08:23FromDiscord<Rika> its normal
18:08:35FromDiscord<iWonderAboutTuatara> was just a debugging thing
18:08:46FromDiscord<iWonderAboutTuatara> I just looped through each n in the idefs and printed that
18:08:52FromDiscord<iWonderAboutTuatara> man soem of these errors are so cryptic
18:08:58FromDiscord<iWonderAboutTuatara> especially with macros
18:09:07FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yWN
18:09:27FromDiscord<haxscramper> Highly recommend using for printf debugging
18:09:40FromDiscord<iWonderAboutTuatara> I don't know how to debug using not printf lol
18:09:45FromDiscord<lqdev> @haxscramper n.repr
18:09:51FromDiscord<iWonderAboutTuatara> people think I'm crazy but I've legitimately just never bothered
18:09:55FromDiscord<iWonderAboutTuatara> thanks for that though, will be using it
18:10:17FromDiscord<haxscramper> > @haxscramper n.repr↵@lqdev whatever. There is not visual difference so it does not really matter anyway
18:10:54FromDiscord<haxscramper> > I don't know how to debug using not printf lol↵@iWonderAboutTuatara This is explicitly superiour way of debugging IMO
18:12:26FromDiscord<iWonderAboutTuatara> print debugging?
18:12:55FromDiscord<iWonderAboutTuatara> It makes it very easy to identify exactly where the error is, which is why I've never bothered to learn another method
18:13:10FromDiscord<iWonderAboutTuatara> I really do need error highlighting to make programming tolerable though
18:13:39FromDiscord<iWonderAboutTuatara> new issue
18:13:44FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2yWQ
18:13:51FromDiscord<iWonderAboutTuatara> for `f(a, b, c, int) -> int: return 1`
18:14:13FromDiscord<iWonderAboutTuatara> the issue is that the third thing I add to idefs (int) is set as the value of C
18:14:15FromDiscord<iWonderAboutTuatara> instead of the type
18:14:45FromDiscord<iWonderAboutTuatara> I know nim static type uses a default value
18:14:51FromDiscord<iWonderAboutTuatara> (I think anyway)
18:17:07FromDiscord<iWonderAboutTuatara> but is there a less painful way to make this work than a lot of if/switch statements?
18:19:41FromDiscord<haxscramper> Sorry I don't really follow what are you trying to do here, especially that part with "third thing I add to idefs (int) is set as the value of C".
18:20:14FromDiscord<lqdev> btw @iWonderAboutTuatara `left[1..^1] == left[1..left.len - 1]`
18:20:24FromDiscord<haxscramper> You need to pass /value/ instead nim node for `c`?
18:27:41FromDiscord<iWonderAboutTuatara> oh you can ^1, forot about that
18:27:59FromDiscord<iWonderAboutTuatara> I want to declare those params to not have inital values
18:28:12FromDiscord<iWonderAboutTuatara> and instead just be declared with a type
18:28:57leorizehttps://github.com/nim-lang/Nim/commit/57b7841c184e9f185d6d2404a1320e5d089e0e0f <- returning openarray is gonna be possible \o/
18:32:30FromDiscord<haxscramper> > I want to declare those params to not have inital values↵@iWonderAboutTuatara you need to add empty node and wrap whole declaration into `VarSection` - https://play.nim-lang.org/#ix=2yWX
18:32:39FromDiscord<haxscramper> https://nim-lang.org/docs/macros.html#statements-var-section
18:34:41FromDiscord<iWonderAboutTuatara> I see
18:34:44FromDiscord<iWonderAboutTuatara> thanks!
18:36:22*thomasross joined #nim
18:47:45*pbb quit (Remote host closed the connection)
18:48:48FromDiscord<iWonderAboutTuatara> how does one make a pragma node?
18:48:57*pbb joined #nim
18:49:03FromDiscord<iWonderAboutTuatara> for a newproc, I want to add a pragma
18:49:19disruptekaddPragma
18:49:38disruptekpragmas are just identifiers.
18:52:11FromDiscord<iWonderAboutTuatara> `newNimNode(nnkPragma).add(nnkIdent("noSideEffect"))`
18:52:14FromDiscord<iWonderAboutTuatara> this didn't work
18:52:36FromDiscord<iWonderAboutTuatara> oh I see
18:55:06disruptekexcept when they are symbols. have fun with that.
18:56:05FromDiscord<iWonderAboutTuatara> wait no nevermind
18:56:10FromDiscord<iWonderAboutTuatara> that didn't work
18:56:13FromDiscord<iWonderAboutTuatara> this is so confusing
18:56:22FromDiscord<iWonderAboutTuatara> disruptek: how do I pass a pragma to newProc?
18:59:50FromDiscord<Yardanico> https://www.python.org/dev/peps/pep-0638/
18:59:54FromDiscord<Yardanico> hehehe
19:00:14FromDiscord<Yardanico> but they decided to go the Rust way and add ! to signify the use of macros
19:00:24FromDiscord<iWonderAboutTuatara> not a fan of that
19:00:34FromDiscord<iWonderAboutTuatara> the idea with macros is to work them in right?
19:00:39FromDiscord<Yardanico> It's not accepted yet
19:00:44FromDiscord<iWonderAboutTuatara> oh good
19:00:58FromDiscord<iWonderAboutTuatara> I don't think signifying that x is a macro is super helpful
19:01:16FromDiscord<iWonderAboutTuatara> but I really do need to know what is happening here
19:01:25FromDiscord<Yardanico> well, you can read the proposal
19:01:29FromDiscord<iWonderAboutTuatara> ```nim result = newProc(name = left[0], params = idefs[0..^1].toSeq, body = fbody,).addPragma(ident("noSideEffect"))```
19:01:33FromDiscord<iWonderAboutTuatara> oh not that
19:01:40FromDiscord<iWonderAboutTuatara> (edit) '```nim result' => '```nim↵result'
19:01:46FromDiscord<iWonderAboutTuatara> I get a weird error here
19:02:33FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2yXf
19:02:45FromDiscord<iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2yXg
19:03:35FromDiscord<Yardanico> does addPragma return something?
19:03:43FromDiscord<Yardanico> Doesn't it modify in place?
19:03:53FromDiscord<iWonderAboutTuatara> wouldn't it take the modified version then?
19:03:59FromDiscord<iWonderAboutTuatara> oh wait nevermind
19:04:14FromDiscord<Yardanico> no, this is different
19:04:29FromDiscord<Yardanico> you need↵result = newProc ..↵result.addPragma ...
19:04:33FromDiscord<iWonderAboutTuatara> that worked
19:04:40FromDiscord<iWonderAboutTuatara> and gave way to another confusing error
19:04:53FromDiscord<Yardanico> well the previous error wasn't really confusing :)
19:05:06FromDiscord<iWonderAboutTuatara> too many words
19:05:18FromDiscord<Yardanico> It told you that there's nothing to assign to result because addPragma doesn't return Antony
19:05:25FromDiscord<Yardanico> (edit) 'Antony' => 'anything else'
19:05:33FromDiscord<iWonderAboutTuatara> `has no type (or is ambiguous)`
19:05:35FromDiscord<iWonderAboutTuatara> I missed that
19:05:46FromDiscord<Yardanico> Well, what's the new error
19:05:50FromDiscord<iWonderAboutTuatara> that isn't what showed in vscode though, i had to compile to see it
19:06:01FromDiscord<iWonderAboutTuatara> `Error: type expected, but got: int, a, b, c: int`
19:06:21FromDiscord<iWonderAboutTuatara> https://play.nim-lang.org/#ix=2yXh
19:07:02FromDiscord<Yardanico> Well of course
19:07:24FromDiscord<iWonderAboutTuatara> I'm almost certian I'm missing something obvious here, but I have no clue what it is
19:07:36FromDiscord<Yardanico> You're not adding proc params properly
19:08:01*Kaivo quit (Quit: WeeChat 2.9)
19:08:04FromDiscord<iWonderAboutTuatara> what should I be doing instead?
19:08:59FromDiscord<iWonderAboutTuatara> I'm more than a bit confused
19:09:54FromDiscord<Yardanico> Why do you create a varSection?
19:10:28FromDiscord<iWonderAboutTuatara> I was told this is the correct way to assign a type and not a value
19:10:54FromDiscord<iWonderAboutTuatara> earlier, the identdefs were saying that `c = int` instead of `c : int`
19:10:56FromDiscord<Yardanico> but we're doing proc definitions there
19:11:39FromDiscord<iWonderAboutTuatara> what should I be doing instead?
19:11:54FromDiscord<iWonderAboutTuatara> I removed the varsec line, somehow works properly
19:12:13FromDiscord<iWonderAboutTuatara> the error is still there, but it says `a, b, c : int` now
19:12:32FromDiscord<iWonderAboutTuatara> (edit) '`a,' => '`var int, a,' | 'c :' => 'c:'
19:12:46FromDiscord<iWonderAboutTuatara> which is confusing, where is the var coming from?
19:13:03FromDiscord<iWonderAboutTuatara> nevermind, fixed that
19:13:37FromDiscord<iWonderAboutTuatara> this stuff is confusing, now I'm getting `illformed AST: a`
19:13:49*kenran joined #nim
19:14:21FromDiscord<Yardanico> Took me some time since I'm from the phone
19:14:23FromDiscord<Yardanico> https://play.nim-lang.org/#ix=2yXo
19:16:04FromDiscord<iWonderAboutTuatara> huh weird
19:16:13FromDiscord<iWonderAboutTuatara> I don't see anything you're doing too differently
19:16:42FromDiscord<iWonderAboutTuatara> like obviously your code is just way cleaner and better overall, but interms of what it's doing I don't see the difference
19:16:44FromDiscord<iWonderAboutTuatara> odd
19:17:21FromDiscord<iWonderAboutTuatara> oh I see, you explicitly made idefs an @[]
19:17:26FromDiscord<iWonderAboutTuatara> thanks!
19:29:08*giannicozy joined #nim
19:29:28giannicozyHello, I am just wondering, will version 1.3 be released any time soon?
19:31:26FromDiscord<Recruit_main707> the way nim versions work is:↵odd versions are stable releases↵and even versions are nightlies, which are essentially released every day or two and are the latest ones (when they are released that is)
19:31:27FromDiscord<Rika> the next version will be 1.4
19:31:48FromDiscord<Rika> even versions are not nightlies?
19:31:58FromDiscord<Rika> thats backwards
19:32:32FromDiscord<mratsim> Anyway to have non-inlined const, I get my huge big int arrays duplicated in every file that uses them, meaning everywhere.
19:32:50FromDiscord<Recruit_main707> the translator switched the orders smh
19:33:06giannicozyWell, I found a lot of bugfixes for my code in the github, but I don't really want to use a development version yet. I just want to know if I should endure the bugs a little longer or if the stable version is close to ready.
19:33:38FromDiscord<Recruit_main707> whats wrong with nightlies?
19:34:18FromDiscord<Recruit_main707> you dont need to clone the code and build it, they are the same as the normal installation
19:35:42*Trustable quit (Remote host closed the connection)
19:35:49FromDiscord<iWonderAboutTuatara> wait @Yardanico I'm still super confused
19:36:12FromDiscord<iWonderAboutTuatara> how are what you did and what I did different?
19:36:17FromDiscord<iWonderAboutTuatara> https://play.nim-lang.org/#ix=2yXt
19:36:19giannicozyOh, well, that's good to know, but I guess I feel a little unsafe using them. I would really like to install the version once and not have to care for a while. But I guess if I want that then I'm not exactly looking for the cutting edge stuff.
19:36:22FromDiscord<Yardanico> you used toSeq incorrectly
19:36:32FromDiscord<iWonderAboutTuatara> wdym?
19:36:39FromDiscord<iWonderAboutTuatara> the reprs of both are the same
19:36:49FromDiscord<Rika> are the treereprs the same though
19:37:06FromDiscord<iWonderAboutTuatara> how do I check?
19:37:07FromDiscord<Yardanico> Well anyway I can't answer now, sorry :)
19:37:11FromDiscord<iWonderAboutTuatara> no problem
19:37:20FromDiscord<iWonderAboutTuatara> @Rika using treerepr throws error
19:37:23*giannicozy quit (Remote host closed the connection)
19:37:36FromDiscord<Recruit_main707> have you imported macros¿
19:37:46FromDiscord<iWonderAboutTuatara> yep
19:37:51FromDiscord<iWonderAboutTuatara> I sent the nimgrounds link
19:37:58FromDiscord<iWonderAboutTuatara> https://play.nim-lang.org/#ix=2yXt\
19:38:42FromDiscord<Recruit_main707> what should it output?
19:39:01FromDiscord<iWonderAboutTuatara> it should already work
19:39:09FromDiscord<iWonderAboutTuatara> I'm just asking what the difference between oldidefs and idefs is
19:40:32FromDiscord<Rika> @iWonderAboutTuatara https://media.discordapp.net/attachments/371759389889003532/759862053628018718/unknown.png
19:41:15FromDiscord<iWonderAboutTuatara> how did you echo that?
19:41:44FromDiscord<Rika> `echo idefs.mapit(it.treerepr)`
19:41:55FromDiscord<iWonderAboutTuatara> oh I see
19:42:07FromDiscord<iWonderAboutTuatara> so what's happened here is that the identdefs is after the ident int node?
19:42:12FromDiscord<iWonderAboutTuatara> so the proc isn't given a return type?
19:44:23FromDiscord<Rika> proly
19:47:25*kenran quit (Ping timeout: 240 seconds)
19:52:44FromDiscord<iWonderAboutTuatara> I see
19:52:48FromDiscord<iWonderAboutTuatara> this is fun but very confusing
20:03:41FromDiscord<Yardanico> If you check what params of the proc should be and that newProc accepts openArray for params, it's not confusing :)
20:08:25FromDiscord<Yardanico> macros docs in the start show AST for most of possible Nim constructs
20:09:04FromDiscord<iWonderAboutTuatara> I think this is the kind of thing that you only really understand by doing
20:09:28FromDiscord<iWonderAboutTuatara> I have no experience with metaprogramming before this, so most of this AST manip concepts are new to me
20:13:56*krux02 quit (Remote host closed the connection)
20:14:21FromDiscord<Vindaar> > I think this is the kind of thing that you only really understand by doing↵certainly helped me a ton
20:14:21*krux02 joined #nim
20:14:24FromDiscord<iWonderAboutTuatara> Sorry if I'm being annoying with all the (relatively) basic questions by the way
20:14:37FromDiscord<iWonderAboutTuatara> I'll find my feet sooner or later
20:20:26*pangey quit (Ping timeout: 256 seconds)
20:21:19FromDiscord<Recruit_main707> i am trying to pass a method as a function pointer so that it is called somewhere else, but the base method keeps getting called, how can i avoid it?↵(code snippet: https://play.nim-lang.org/#ix=2yXI)↵I warn you that the code might not be easy to understand
20:23:00*pangey joined #nim
20:24:50FromDiscord<krisppurg> @sealmove[IRC]#0000 i have tried struct.nim however I can't find any `struct_into`.
20:32:59*narimiran quit (Ping timeout: 265 seconds)
20:43:36*def- quit (Quit: -)
20:43:47*def- joined #nim
20:51:39*a_chou joined #nim
20:54:38*a_chou quit (Remote host closed the connection)
20:56:07*MyMind quit (Quit: WeeChat 2.9)
21:11:07*solitudesf- quit (Ping timeout: 240 seconds)
21:11:40FromDiscord<lqdev> huh, that's weird. the compiler thinks an object's field doesn't exist for some reason
21:16:44*arecacea1 quit (Remote host closed the connection)
21:17:18*arecacea1 joined #nim
21:18:05*vqrs quit (Ping timeout: 240 seconds)
21:18:54*Jesin quit (Quit: Leaving)
21:20:19*vqrs joined #nim
21:22:31*Jesin joined #nim
21:36:16*tane quit (Quit: Leaving)
21:45:01FromDiscord<dom96> It's official https://twitter.com/nim_lang/status/1310334495439171584
21:45:31FromDiscord<Avatarfighter> Congrats everyone !
21:58:40FromDiscord<exelotl> Nice! :O
22:12:24FromDiscord<demotomohiro> Congratulations!
22:58:43FromDiscord<Avatarfighter> I really need to learn what the stuff in the Arraymancer library do because I'm incredibly curious to see what I can do but I'm so lost on where to start
23:07:06FromDiscord<Vindaar> what are you confused about?
23:07:20FromDiscord<Vindaar> Feel free to ask as many questions as necessary
23:09:51FromDiscord<Avatarfighter> I guess I'm confused about where I can start learning about wtf a tensor is and how do they allow for deep learning
23:10:19FromDiscord<Avatarfighter> I can write myself little programs with the arraymancer library I just don't understand why something does what it does lol
23:13:26FromDiscord<Vindaar> Hmm, well. How much math do you know or enjoy?
23:13:36FromDiscord<Avatarfighter> Oh gosh
23:14:16FromDiscord<Avatarfighter> Well I enjoy learning Math, I'm just pretty terrible at it lol
23:14:49FromDiscord<Avatarfighter> I'm still in high school so I wouldn't say that I know that much math when you think about math as a whole
23:15:28FromDiscord<Vindaar> Focus on the enjoy aspect. That you're bad at it is most likely just your view on yourself based on learning "math" in a rather bad way
23:15:56FromDiscord<Vindaar> If you're in high school I assume you know what a matrix is?
23:16:01FromDiscord<Avatarfighter> I do yes 🙂
23:17:16FromDiscord<Avatarfighter> tbh I am bad at math because of the way I was taught to take notes, I recently just switched the style for my notes and math is a whole new subject for me lmao
23:17:45FromDiscord<Vindaar> ok! In the simplest explanation a tensor as nothing but a generalization of the concept:↵scalar -> vector -> matrix -> ...↵Each can be thought of as a tensor of a certain rank
23:17:55FromDiscord<Vindaar> that's good to hear!
23:18:36FromDiscord<Vindaar> And tensors then allow you to have objects with higher rank ("higher dimensionality") essentially
23:19:18FromDiscord<Avatarfighter> Ohhh
23:19:25FromDiscord<Vindaar> e.g. a tensor of rank 3 is somewhat like a 3D matrix. Take a look here: https://en.wikipedia.org/wiki/Levi-Civita_symbol#/media/File:Epsilontensor.svg
23:21:27FromDiscord<Vindaar> well, technically the levi-civita symbol is _not_ a tensor, but that's precisely where tensors in computer science and maths typically lose their equivalence (a tensor is only specific kind of object, that transforms in a specific way under a coordinate transformations, which interestingly enough one of the main ingredients as to why general relativity is so hard mathematically, haha)
23:22:06FromDiscord<Vindaar> for CS you can really just think of a tensor as an N dimensional matrix
23:23:23FromDiscord<Avatarfighter> I'm doing more research into this
23:23:26FromDiscord<Avatarfighter> this is so cool!!
23:23:31FromDiscord<Vindaar> it is 🙂
23:24:11*ehmry quit (Ping timeout: 272 seconds)
23:25:21FromDiscord<Vindaar> but this makes me realize right now how much stuff I have forgotten already 😦
23:25:32*ehmry joined #nim
23:25:36FromDiscord<Avatarfighter> Thanks for explanation Vindaar, I'm going to see if I can find an explanation on how ranking in nd-arrays work lol
23:25:43FromDiscord<Avatarfighter> n-dimensional arrays ig
23:25:53FromDiscord<Avatarfighter> or rather tensors(?)
23:26:49FromDiscord<Vindaar> well, that's the thing. I think many people just say nd-arrays to make it clearer that we aren't talking about mathematical tensors (at least not always)
23:28:11*mmohammadi98129 quit (Ping timeout: 258 seconds)
23:28:38FromDiscord<Vindaar> if you want to look at something, which is probably too crazy, but imo one of the best introductions to the math of tensors (from a practical point of view, it's not as rigorous as a mathematician might like), check out the beginning of Sean Carroll's notes on GR here:↵https://arxiv.org/pdf/gr-qc/9712019.pdf↵If you're anything like me seeing something like that might be inspiring 🙂
23:29:02FromDiscord<Vindaar> page 13 introduces tensors
23:29:30FromDiscord<Avatarfighter> I'll check it out 🙂 Wow this just puts into perspective how little I know about stuff and how hard it is for me to find information explained plainly on it.
23:30:15FromDiscord<Vindaar> I don't want to depress you, but... I feel the exact same to this day. I always though that feeling might disappear after studying physics. And it never did
23:30:41*abm quit (Read error: Connection reset by peer)
23:30:58FromDiscord<Vindaar> There's just too much stuff out there, that's too hard to grasp and only so little time... And as I mentioned, one forgets stuff too quickly, sigh
23:31:27FromDiscord<Avatarfighter> I run into this feeling quite a bit when doing "regular" programming lol
23:31:30FromDiscord<Vindaar> (doesn't mean I didn't learn _a lot_ and it wasn't worth it or something)
23:31:42FromDiscord<Vindaar> haha, happens to me too! 😄
23:33:04FromDiscord<Avatarfighter> I'm excited to get a higher education, I aspire to be at the point where I know the proper terms to search for on google sometimes its a bit awkward trying to find structures that are specialized when you don't actually know the name
23:33:40FromDiscord<Vindaar> oh yes, it really is. That's why education is worth so much. Helps with _knowing where to find stuff_
23:33:57FromDiscord<Avatarfighter> I think I spent a couple days learning that a Patricia tree is a thing lol
23:34:10FromDiscord<Vindaar> no idea what that is 🙃
23:34:19FromDiscord<Vindaar> oh a trie
23:34:23FromDiscord<Avatarfighter> Its a Radix tree
23:34:25FromDiscord<Avatarfighter> yeah
23:35:07FromDiscord<Avatarfighter> Its a really space efficient trie for strings that have common prefixes and I spent wayyy too long looking for the correct term
23:35:36FromDiscord<Vindaar> that's pretty cool
23:35:43FromDiscord<Vindaar> not the looking long part though
23:36:06FromDiscord<Avatarfighter> 🤷‍♂️ it is what it is
23:36:19FromDiscord<Vindaar> ok, anyways. I need to go to bed. ↵In case you have any mathy (programming related maybe) questions, feel free to ping me!
23:36:33FromDiscord<Avatarfighter> I will, thank you very much for the explanation and the help Vindaar 🙂
23:36:59FromDiscord<Vindaar> you're very welcome!
23:40:28FromDiscord<exelotl> woahh I understand what a tensor is now
23:41:22FromDiscord<Avatarfighter> right ?? lol
23:41:34FromDiscord<Avatarfighter> I thought it was something scary not a N-dimensional array
23:44:38FromDiscord<InventorMatt> i am trying to test out concepts and and I am getting an error even though the variable should pass all of the tests. any help to fix it or to know if it is impossible would be appreciated. https://play.nim-lang.org/#ix=2yYv
23:50:39FromDiscord<exelotl> @InventorMatt concepts are only able to express compile-time facts about a type, but here you're trying to use them to express runtime facts about an instance of that datatype
23:51:13FromDiscord<exelotl> (edit) 'that datatype' => 'a type'
23:51:27FromDiscord<InventorMatt> okay, that makes sense. thanks
23:52:34FromDiscord<exelotl> np :)
23:53:56FromDiscord<InventorMatt> is there a way to express runtime facts about an instance for a proc input. like for example only allowing unit vectors for the input?
23:56:05FromDiscord<exelotl> only with runtime checks, for example you could throw an exception if the magnitude is not approximately equal to 1
23:56:49FromDiscord<exelotl> but, if you know you're passing a constant value you can do compile time checks on it, I'll cook up an example