<< 23-06-2020 >>

00:01:03*drdee joined #nim
00:01:16*ftsf joined #nim
00:02:25*drdee quit (Client Quit)
00:24:15*krux02_ quit (Remote host closed the connection)
00:31:44mutanttu1keythen it would be like re
00:31:49mutanttu1keyokay so
00:31:57mutanttu1keyhttp://ix.io/2pUD
00:32:11*krux02 joined #nim
00:32:21mutanttu1keyi am trying to get that json formatter to generate something that looks like
00:32:25mutanttu1keyhttp://ix.io/2pUE
00:32:37mutanttu1keythe second being the actual json
00:33:15mutanttu1keyhowever, when i run this i get http://ix.io/2pUF
00:33:59mutanttu1keyso i am clearly doing something wrong
00:40:13*krux02 quit (Remote host closed the connection)
00:41:34shashlick@gokr - http://ix.io/28Lv/nim
00:41:46shashlickhttps://gitter.im/nim-lang/Nim?at=5e3367d3f6945f41ef46b80f
00:43:25shashlick@zetashift who asked for orx.h last time
00:47:40FromDiscord<Yardanico> So, example of how distro packaging can be done in a very wrong way - a guy in Telegram asked why he couldn't cross-compile, and turns out it's because of this - https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/nim#n38
00:48:24FromDiscord<Yardanico> They add options from makepkg.conf (which are by default march=x86_64 mtune=generic) to the global config file and don't remove them after building all the compiler stuff
00:49:02FromDiscord<Yardanico> So even when cross compiling with GCC you'll get -march=x86_64 -mtune=generic in the commandline, and of course it'll fall
00:49:20FromDiscord<Yardanico> I'll probably open an issue in Arch's bug tracker about this later
00:50:37*oddp quit (Ping timeout: 264 seconds)
01:02:38*rockcavera joined #nim
01:06:55*rockcavera quit (Remote host closed the connection)
01:18:54*Tlongir quit (Remote host closed the connection)
01:24:21FromDiscord<Varriount> Yardanico: Why supply flags at all?
01:25:40FromDiscord<Varriount> Also, anyone have a recommendation for a good 3d game engine that is good for relatively simple games and is compatible with Nim?
01:26:19FromDiscord<Zed> hmm, there's the raylib bindings, or you can use zachs frag engine
01:26:41FromDiscord<Zed> raylib has a pretty large community behind it
01:26:52*Zectbumo joined #nim
01:27:08FromDiscord<Zed> https://github.com/Guevara-chan/Raylib-Forever
01:34:28*Tlongir joined #nim
01:40:42*Tongir joined #nim
01:43:15*Tlongir quit (Ping timeout: 260 seconds)
01:45:35FromDiscord<Yardanico> @Varriount to make sure that the makepkg.conf flags are respected for all software
01:47:51*Senny joined #nim
01:50:22*chemist69 quit (Ping timeout: 260 seconds)
01:52:07*chemist69 joined #nim
02:00:04FromGitter<deech> Small thing but it would be nice to have a warning when giving a macro/template the same name as a hardcoded pragma, eg `template compileTime(): ...; proc f() {.compileTime.} = ...`. Nim does the right thing and ignores the user-defined template but some indication of that would be helpful in larger programs.
02:03:45FromGitter<deech> Also imported macros/templates don't seem to work as pragmas: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ I also tried qualifying with `{.a.mypragma.}` but that doesn't seem to work either. [https://gitter.im/nim-lang/Nim?at=5ef16301405be935cdb88df2]
02:14:11*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:14:45*pbb joined #nim
02:18:44FromDiscord<Yardanico> You didn't export
02:19:07FromDiscord<Yardanico> template mypragma*() ...
02:36:18*endragor joined #nim
02:38:36*waleee-cl quit (Quit: Connection closed for inactivity)
02:46:57*muffindrake quit (Ping timeout: 260 seconds)
02:48:45*muffindrake joined #nim
02:59:07FromDiscord<Skaruts> can I throw a compile time error in a proc, if it's called with an object parameter whose `kind` is not one intended for that proc?
02:59:39FromDiscord<Skaruts> like, can I check the object kind in a `when` statement or something like that?
03:04:09FromDiscord<Skaruts> hmm, I cannot evaluate the object at compile time...
03:04:44FromDiscord<Skaruts> would there be any way to ensure this at compile time, though?
03:21:15*lnxw37d4 joined #nim
03:24:37shashlickIt's a variant?
03:29:10FromDiscord<Skaruts> yes
03:36:11*dmi0 quit (Ping timeout: 260 seconds)
03:37:01FromDiscord<SeanOMik> Is there a way I could check if an `untyped` is of `sting`type?
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:41*supakeen joined #nim
04:09:17*opDispatch quit (Quit: Konversation terminated!)
04:24:36shashlick@Skaruts - https://github.com/nim-lang/Nim/blob/devel/compiler/ast.nim#L1049 looks like kind can only be checked at runtime cause that's when the object actually exists
04:45:40*marnix joined #nim
04:48:27*rockcavera joined #nim
04:50:01*dddddd quit (Ping timeout: 264 seconds)
04:54:55*rockcavera quit (Remote host closed the connection)
05:01:27*narimiran joined #nim
05:10:41*mwbrown quit (Ping timeout: 265 seconds)
05:22:34*Romanson joined #nim
05:36:24*Kaivo quit (Ping timeout: 256 seconds)
05:44:26*solitudesf joined #nim
05:44:51*rockcavera joined #nim
05:58:55*Kaivo joined #nim
06:09:39*rockcavera quit (Remote host closed the connection)
06:18:42*Jesin joined #nim
06:22:49*endragor quit (Remote host closed the connection)
06:23:17*endragor joined #nim
06:27:04*lritter joined #nim
06:29:01*endragor quit (Ping timeout: 264 seconds)
06:33:50*endragor joined #nim
06:38:17*PMunch joined #nim
06:51:00*leorize joined #nim
06:52:31*Vladar joined #nim
07:17:21vegaimicrophones are great tools. Cost around $100
07:18:03vegaiwhich I realize might be too high a price, but just saying. If you can afford it and you're broadcasting anything, get one
07:20:47PMunchYeah I borrowed a good microphone for my presentation, so much better than what I usually use
07:25:48FromDiscord<Elegant Beef> I agree, samson meteor is a relatively good USB one imo
07:55:39*tane joined #nim
08:03:24*gokr joined #nim
08:40:41FromDiscord<lqdev> @SeanOMik no, it needs to be typed if you want to check types
08:41:14FromDiscord<lqdev> unless you want to check if it's a string *literal*, then check out macros.expectKind
08:47:09*nikita` joined #nim
08:51:40*Tlanger joined #nim
08:52:34*gokr quit (Ping timeout: 240 seconds)
08:53:54*Tongir quit (Ping timeout: 240 seconds)
08:57:39*drdee joined #nim
08:57:58PMunchHmm, what is a good way to represent keyboard shortcuts so that I'm able to convert them into various formats?
09:07:08*Tongir joined #nim
09:08:38*notandinus quit (Remote host closed the connection)
09:08:38*Nilium quit (Ping timeout: 265 seconds)
09:08:38*Nilium_ joined #nim
09:08:38*deepend quit (Remote host closed the connection)
09:08:41*Nilium_ is now known as Nilium
09:09:18*aeverr quit (Remote host closed the connection)
09:09:34*aeverr joined #nim
09:09:56*Tlanger quit (Ping timeout: 265 seconds)
09:10:04*vikfret joined #nim
09:10:53*deepend joined #nim
09:12:41FromDiscord<Rika> how do i do pointer arithmetic in nim? i cast the ptr T to a what?
09:18:14FromDiscord<mratsim> @Rika https://github.com/status-im/nim-stew/blob/master/stew/ptrops.nim
09:18:52FromDiscord<mratsim> or: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_utils.nim#L12-L18
09:19:15FromDiscord<Rika> thanks
09:19:26PMunch@Rika, you cast it to an int do your math, and then cast it back to a pointer
09:19:32FromDiscord<Rika> okay thanks
09:20:04FromDiscord<mratsim> or: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/io/mp4.nim#L75-L77
09:20:27FromDiscord<mratsim> and you can cast to ByteOffset, use +% and cast back
09:23:52FromDiscord<Shucks> Meow Meow
09:29:49*Trustable joined #nim
09:35:13PMunchHmm, I consider converting stacklang to decimal128
09:35:28PMunchAnd then convert to floats whenever I need to do things that is not supported
09:35:37PMunch(like sin, cos, tan, etc)
09:36:51*oddp joined #nim
09:37:51PMunchHmm, it doesn't round when setting precision, is this by design?
09:37:58PMunchI guess
09:50:29*PMunch quit (Remote host closed the connection)
09:55:38*hoek joined #nim
09:57:46*brainbomb joined #nim
10:15:44*vikfret quit (Quit: Leaving)
10:28:51FromDiscord<Shucks> So I just recognized that `ByteAddress` isnt the optimal choice for my memory read library. As it wouldn't accept int64 addresses and has to be castet manually. What im looking for is cpp's `uintptr_t` (not a standard type aswell). Which changes between int and int64 regarding on the --cpu used. If that makes sense.
10:29:07FromDiscord<Shucks> sent a code paste, see https://discordapp.com/channels/371759389889003530/371759389889003532/724934048190824520
10:30:18FromDiscord<l1pz> is there a way to spawn a detached process in nim? i need something like python's subprocess.Popen()
10:30:45FromDiscord<l1pz> i checked the osproc module, but all the proc's wait for the program's execution
10:32:02*pietroppeter quit (Quit: Connection closed for inactivity)
10:39:31FromDiscord<Zed> PMunch, Dumb question, how do i set up a nimscript build task?
10:41:50FromDiscord<Zed> what i've got so far is ↵`task build,"build the code"`↵but im getting ambiguous call errors and untyped errors
10:42:01FromDiscord<Zed> i cant for the life of me figure out what's causing it
10:44:51FromDiscord<lqdev> @l1pz osproc.startProcess runs in the background
10:45:28FromDiscord<lqdev> and you can optionally use waitForExit if you want to wait until the process finishes
10:48:17*chemist69 quit (Ping timeout: 244 seconds)
10:51:23*NimBot joined #nim
10:53:50*chemist69 joined #nim
10:55:22*Zectbumo quit (Remote host closed the connection)
10:58:51chemist69@Zed: I think the `build` task is predefined and you can not re-define it. Try giving the task a different name
11:00:14FromDiscord<Clyybber> @dom96 Is there a way to nimble install the whole repo with tests and all?
11:02:22FromDiscord<Zed> why not use git?
11:02:29FromDiscord<Zed> chemist69, thanks
11:03:15*ftsf_ joined #nim
11:04:25FromDiscord<Clyybber> @Zed I would, if there is a way to get nimble to spit out the git hash of the latest release of a pkg
11:06:34*ftsf quit (Ping timeout: 240 seconds)
11:06:44*krux02 joined #nim
11:20:03*narimiran quit (Ping timeout: 260 seconds)
11:21:37*narimiran joined #nim
11:23:22*PMunch joined #nim
11:44:55*abm joined #nim
11:46:50*brainbomb quit (Quit: Leaving.)
11:47:00*thomasross quit (Ping timeout: 256 seconds)
11:49:27*drdee quit (Ping timeout: 260 seconds)
11:55:11*mwbrown joined #nim
11:55:50*dddddd joined #nim
11:56:37*PMunch quit (Quit: Leaving)
11:56:53*PMunch joined #nim
12:01:09*vsantana joined #nim
12:06:01*supakeen quit (Quit: WeeChat 2.8)
12:06:41*supakeen joined #nim
12:12:25*brainbomb joined #nim
12:32:20*ftsf_ quit (Ping timeout: 256 seconds)
12:36:25PMunchHmm, isn't it possible to add a case object to a hashset`
12:37:43*brainbomb1 joined #nim
12:38:37*brainbomb quit (Ping timeout: 272 seconds)
12:39:02PMunchhttps://play.nim-lang.org/#ix=2pWp
12:41:52*rockcavera joined #nim
12:50:10FromDiscord<Clyybber> thats... a very weird error
12:50:50FromDiscord<Rika> because the fields cannot be determined at compile time
12:50:57solitudesfyou need to define `==`
12:51:22FromDiscord<Rika> wait why?
12:51:42FromDiscord<mratsim> not defined for case objects, too hard
12:53:49FromDiscord<Clyybber> still worth making an issue for it since the error message is so crazy
12:54:23FromDiscord<Clyybber> (edit) 'so crazy' => 'dumb'
12:57:50FromDiscord<Vindaar> I think it's pretty clear given the context. I do agree though that seeing that message for the first time when comparing variant objects (w/o hash usage) is kinda confusing, unless one knows about the `fields` iterator impl. So the latter could surely be improved
12:59:41*ftsf joined #nim
13:04:46*drdee joined #nim
13:14:54FromDiscord<Clyybber> @mratsim nimble fails to read arraymancers .nimble file on HEAD
13:15:28FromDiscord<mratsim> Well, nimble has a bad trail of breaking with unhelpful "." messages
13:15:36FromDiscord<Vindaar> probably docs related again 😦
13:16:19*waleee-cl joined #nim
13:30:10PMunchOoh, that's what's going on..
13:30:32PMunchBy the way, anyone else having trouble installing inim? http://ix.io/2pWC
13:31:38FromDiscord<Vindaar> just tried and works fine for me. did a koch boot + koch tools 10 min ago
13:32:21PMunchI did a `choosenim update stable` just now
13:32:41PMunchwhat kind of system are you on?
13:33:18PMunchAh, it's the cligen dependency that was outdated
13:33:24FromDiscord<Vindaar> running void linux on my laptop
13:33:29PMunchAnd inim specifies an older version than it actually needs
13:33:42FromDiscord<Vindaar> oh, that makes sense
13:35:28PMunchAh, someone made a PR for this issue 11 hours ago: https://github.com/inim-repl/INim/pull/95
13:35:30disbotFix for #90
13:38:37PMunchHmm, I don't get any colours though..
13:44:58FromDiscord<Rika> how do i dictate the alignment of my type? @_@
13:46:32PMunchDepends on what you need
13:46:50*arecaceae quit (Read error: Connection reset by peer)
13:46:59PMunchIf you use [.packed.} your type will be tightly packed, then you can use padding elements to get whatever alignment you need
13:47:13*arecaceae joined #nim
13:48:46FromDiscord<Rika> my next problem seems to be "how do i check how this cpp struct is aligned" now...
13:51:58PMunchWith offset?
13:52:10PMunchoffsetof*
13:52:18PMunchhttps://linux.die.net/man/3/offsetof
13:52:34Araqomg
13:52:49Araqmy editor changed 'elif' to 'if
13:52:56PMunchHaha, what?
13:53:06Araqyeah, no wonder the tests are red
13:54:39FromDiscord<Rika> thanks
13:57:10shashlickyou should fire your editor
13:58:31FromDiscord<Rika> how would i make a bit field @_@
13:58:40Araqhttps://github.com/nim-lang/RFCs/issues/236 once again, please down/upvote
13:58:41disbotDeprecate the 'defer' statement ; snippet at 12https://play.nim-lang.org/#ix=2pwd
13:58:48FromDiscord<Rika> with a size under 1 byte @_@
13:58:58Araqpreviously I told people not to downvote but that was likely a mistake
14:01:43FromDiscord<Rika> found it
14:01:45FromDiscord<Rika> nvm
14:05:28*PMunch quit (Quit: Leaving)
14:14:13*dmi0 joined #nim
14:20:46FromDiscord<mratsim> fun fact, if you put 4 uint64 in a bitfield, the LLVM IR produced will be an LLVM wideint i256
14:21:04FromDiscord<mratsim> but you can't use any big int arithmetic on it :/
14:24:52FromDiscord<Yardanico> Well yeah, llvm has all sizes from i1 to u65535
14:25:09FromDiscord<Yardanico> Zig exploits this (just for an example)
14:25:51Araqit's terrible but ymmv
14:26:38Araqthe type zoo is already a clusterfuck and it always ends up as complexity you cannot avoid ("can I map uint256 to the database schema?")
14:27:47Araq("what is the %lld pattern for i128 for printf?")
14:28:39AraqI'd rather have Python-like arbitrary precision integers
14:29:07FromDiscord<mratsim> it's good, it has great use cases for embedded devices
14:29:14FromDiscord<mratsim> and similarly for cryptography
14:29:17Araqyeah yeah
14:29:47FromDiscord<mratsim> Python arbitrary precision are not suitable when you don't want alloc
14:30:10Araqsure, you could SSO them
14:30:15FromDiscord<mratsim> and there is no printf, since those types only exist in LLVM IR not Clang
14:30:42Araqyeah, right, and in the IR we never have to deal with outputting them, whom are you kidding
14:30:44FromDiscord<mratsim> whille Clang just exposed ExtInt in April but I don't think there are that much tool using it yet
14:31:29Araqas I said "ymmv", I think it's terrible
14:31:35FromDiscord<mratsim> it only has mathematical operations defined.↵Also within the compiler LLVM have their own APInt (arbtrary precision) package
14:32:06Araqand the "crypto" use cases won't convince me otherwise
14:32:25FromDiscord<mratsim> well, it's as useful as "static"
14:33:05FromDiscord<mratsim> it's just that they don't have type i[bits: static int] = object in LLVM IR
14:34:30FromDiscord<mratsim> Another use-case is WASM code generation optimized for code-size
14:36:04*marquisdefalbala joined #nim
14:37:06AraqI don't care, IMO the benefits don't justify the costs
14:37:40FromDiscord<mratsim> I wouldn't have to write Stint if that was available widely
14:38:38FromDiscord<mratsim> also, they did refine the feature over time and they have actual users: http://blog.llvm.org/2020/04/the-new-clang-extint-feature-provides.html
14:39:21FromDiscord<mratsim> and yes this article confirms that there is no printf
14:40:54Araq"Secondly, we would like to choose a printf/scanf specifier that permits specifying the type for the C language. This was the topic of the WG14 discussion, and also received strong encouragement. We intend to come up with a good representation, then implement this in major implementations."
14:41:20Araqit seems to confirm what I said, people really like printf support for it
14:42:01*drdee quit (Quit: Leaving)
14:44:09Araqlook, I know it's coming and the C standard will embrace it and Nim will catch up and in the end SQLite supports everything that C supports and there will be more stuff to do for Ormin etc etc etc. But I don't like it.
14:47:34Araqcoming soon, custom sized integers with custom alignment requirements. because on paper the size computation algorithms generalize so well and crypto needs it, it cannot cause trouble, right
14:50:03Araqnot to mention fun like i(5) + i(6) == i(6) (convert to bigger integer), ignoring the fact that i(6) + i(6) should be i(7)
14:51:55Araqor else you're once again in the land of overflows. which you cannot map to exceptions because "exceptions are bad". we will never have quality with these ridiculously too low level ideas
14:54:22*pietroppeter joined #nim
14:54:43*dmi0 quit (Ping timeout: 260 seconds)
15:02:51*dmi0 joined #nim
15:02:55FromDiscord<mratsim> if you do i6+i6 into i7 it properly handles the carry
15:03:44FromDiscord<mratsim> this is particularly true for multiplication, if you do i64 * i128 you get an i192
15:04:04AraqI know, it's what I just said
15:04:56FromDiscord<Recruit_main707> sent a long message, see http://ix.io/2pWX
15:05:21Yardanicowell that's why it's experimental and will probably get reimplemented anyway :P
15:07:18FromDiscord<kaletaa> https://media.discordapp.net/attachments/267529878134325248/723271843028664360/image0.gif
15:07:31FromDiscord<Recruit_main707> ? 🥴
15:07:32FromDiscord<Rika> :thinkEgg:
15:08:26FromDiscord<Shucks> iterators don't got `result`?
15:08:35Yardanicono? you use yield in iterators
15:08:39FromDiscord<kaletaa> you have to`yield`
15:08:44FromDiscord<kaletaa> (edit) 'to`yield`' => 'to `yield`'
15:09:03FromDiscord<Shucks> was expecting it could work like: ```iterator foo(): int =↵ result = 1↵ yield```
15:09:19FromDiscord<kaletaa> just `yield 1`
15:09:29Yardanicoyou can just do "var result = 1" then
15:09:38Yardanicosince there's no result in iterators you can make your own
15:09:40Yardanicoand then "yield result"
15:09:48FromDiscord<Shucks> yea
15:11:00*dmi0 quit (Quit: Leaving)
15:11:11FromDiscord<mratsim> templates don't have result as well
15:11:36FromDiscord<mratsim> something that has to do with both templates and iterators being Nim only construct that are pasted verbatim in the C code
15:12:11FromDiscord<Rika> i dont think iterators doesnt have result because of that
15:12:12Araqnot really, templates have no "result" because it makes no sense whatsoever
15:12:20FromDiscord<Rika> it doesnt make sense for iterators to have a result
15:12:53Araqand iterators lack it because it's rarely useful and conveys the wrong idea, an iterator is about control flow
15:14:33Araqyay, I did it, #14396 is no more
15:14:34disbothttps://github.com/nim-lang/Nim/issues/14396 -- 3[ARC] destructive move destroys the object too early ; snippet at 12https://play.nim-lang.org/#ix=2mEL
15:14:47Yardanico🦀
15:22:20*Romanson quit ()
15:28:20FromDiscord<Clyybber> Araq: But your fix is wrong :p
15:28:27*Kaivo quit (Quit: jumping on vpn)
15:28:29Araqhow so?
15:28:52FromDiscord<Clyybber> Maybe wrong is a strong word, but its a deeper issue IMO
15:29:03FromDiscord<Clyybber> of not evaluating Left-To-Right correctly
15:29:08Araqyeah I know
15:29:10YardanicoAraq: btw after your PR "nim c --gc:arc --out:nimtest compiler/nim.nim" fails with /home/dian/Things/Nim/compiler/ast.nim(1104, 52) Error: internal error: '=destroy' operator not found for type bool
15:29:11*Kaivo joined #nim
15:29:36AraqYardanico: fix it :P
15:30:23AraqClyybber: I prefer my fix over yet more temporary vars the optimizer must cut through
15:30:44Araqalso, I'm not sure we have the technology to fix it
15:30:48FromDiscord<Clyybber> Yeah, we have to do analysis to make sure we don't introduce temporary vars that are not needed
15:30:57Araqwith the old codgen not being ast based
15:32:20FromDiscord<Clyybber> Yeah, thats the pain point I'm encountering while trying to fix it
15:32:57FromDiscord<Clyybber> I'll try it again later today
15:33:25AraqI'm tired of this, write a C-IR based codegen already
15:33:30Araqall new code
15:33:49Araqit's not hard, it's only a bit unforgiving work for a couple of months
15:34:20FromDiscord<Recruit_main707> that sounds a bit contradictory :P
15:34:20FromDiscord<Clyybber> We don't need a new IR for this fix though, my plan is to run the DFA on the nim ast
15:34:29Yardanico@Recruit_main707 well hard != long :)
15:34:37FromDiscord<Rika> lewd
15:34:59Yardanicoyou might solve some hard issue in 1 day but you might need 5 years of experience to do that
15:39:56AraqI can tell you how to fix https://github.com/nim-lang/Nim/issues/14647
15:39:57disbotcompile error on latest devel with orc and ssl
15:40:04Araqhow wants to help?
15:40:09AraqI cannot reproduce it though
15:40:57FromDiscord<Clyybber> I can reproduce, so tell me :p
15:41:16*vicfred joined #nim
15:41:25FromGitter<Bennyelg> we have @mashingan here ?
15:41:35Yardanico!seen mashingan
15:41:36disbotmashingan never seen.
15:41:39Yardanicoidk
15:42:01FromGitter<Bennyelg> thanks
15:42:11AraqClyybber cgen.nim line 1803
15:42:22Yardanicowell they're in Telegram group for sure
15:42:32Yardanicounder handle @rahshingan
15:42:38FromGitter<Bennyelg> checking thanks
15:43:14FromDiscord<Clyybber> Araq: Ah I see
15:43:27Araqadd p.flags.incl nimErrorFlagDisabled
15:43:38FromDiscord<Clyybber> was faster :p
15:46:02FromDiscord<Clyybber> Also had to do it for preInitProc
15:46:48Araqyou can do it for newProc(nil, ...) inside newProc, I think
15:47:20Araqand avoid the code duplication
15:48:52AraqClyybber: is there a difference between
15:49:23Araqproc sink(dest, source) = destroy(dest); dest.bitcopy source
15:49:24Araqand
15:49:42Araqproc sink(dest, source) = if dest != nil: decref(dest); dest.bitcopy source
15:50:04Araqfor ref T types
15:50:24FromDiscord<Clyybber> does decref call =destroy?
15:50:34FromDiscord<Clyybber> if not than thats the difference I presume
15:50:43Araqit does
15:50:56FromDiscord<Clyybber> hmm, then there *shouldn't* be a difference in my mind
15:50:59Araqbut I feel like there is some subtle difference with 'nil'
15:51:11Araqdestroy(dest) sets dest to nil
15:51:34Araqon the other hand, it's immediately overwritten anyway, there should be no difference
15:52:04*marnix quit (Ping timeout: 265 seconds)
15:52:42FromDiscord<Clyybber> probably a red herring then
15:53:07FromDiscord<Clyybber> should we always set nimErrorFlagDisabled when the sym is nil?
15:53:16FromDiscord<Clyybber> Sounds a bit risky but from my tests it works
15:56:01AraqI think so, yes
15:58:26FromDiscord<Clyybber> ok, PR is up
16:03:17shashlickanyone know how to get in touch with gokr?
16:03:24Yardanicothey're in discord sometimes
16:03:27Yardanicoping @gokr
16:03:35*rockcavera quit (Remote host closed the connection)
16:04:08FromDiscord<treeform> Does the know if --gc:orc cycle detector run after every "free" or is there a counter to run it after every Nth free. Does cycle detector run on the same stack as the "free". Is there a way to run cycle detector in "debug" mode to warn you about cycles, but then compile it out for release?
16:04:54shashlickcool thanks @yardanico
16:06:53*brainbomb1 quit (Quit: Leaving.)
16:12:05Yardanico@treeform that's a cool idea I guess, since you can't statically detect cycles in more complex cases
16:12:51YardanicoI'd suppose you run your app with orc in debug mode and do all needed tests, and then if you don't have cycles you can compile with arc :P
16:13:39FromDiscord<treeform> @Yardanico I though that was original Araq's idea? I know he changed it, but it looks like a simple compiler flag a way?
16:19:16FromDiscord<juan_carlos> zeroMem does not dealloc right?.
16:20:02FromDiscord<Clyybber> no
16:20:11FromDiscord<juan_carlos> I want a convenience template that does both and take varargs. :|
16:20:32FromDiscord<Clyybber> But you never want to zeroMem and dealloc
16:20:45FromDiscord<Clyybber> Not in this combination: zeroMem; dealloc as its useless
16:20:57FromDiscord<Clyybber> and not in this one either: dealloc; zeroMem as it will crash
16:21:39FromDiscord<juan_carlos> Why is useless?, I can see the data after the dealloc.
16:21:50FromDiscord<Clyybber> no?
16:21:54FromDiscord<Clyybber> thats undefined behaviour
16:21:57FromDiscord<juan_carlos> I mean zeroMem is working, if it wont then is also a bug.
16:22:11FromDiscord<Clyybber> but reading dealloced data is wrong
16:22:32FromDiscord<juan_carlos> No, zeromem;dealloc
16:22:39FromDiscord<Clyybber> yeah, thats useless
16:22:47FromDiscord<Clyybber> why zeroMem it if you dealloc it anyways?
16:23:05FromDiscord<Clyybber> I guess its useful when you need to for security reasons
16:23:19FromDiscord<juan_carlos> ye
16:23:21*fredrikhr joined #nim
16:23:30FromDiscord<juan_carlos> Not reading dealloc'd data.
16:23:45FromDiscord<Clyybber> but you can just define a template yourself :p
16:23:48FromDiscord<Clyybber> thats a niche usecase
16:25:00FromDiscord<Clyybber> ugh, githubs new design is nasty
16:25:29Yardanicowell it's mostly fine
16:25:34Yardanicoexcept the new labels :P
16:25:59FromDiscord<juan_carlos> Too border-radius:99999999
16:26:02FromDiscord<Clyybber> I don't like the new repo page
16:26:07FromDiscord<Clyybber> @juan_carlos exactly :D
16:32:25*vicfred quit (Ping timeout: 246 seconds)
16:40:33*rockcavera joined #nim
16:40:35FromDiscord<exelotl> nice that they made releases more visible, but I think it's still not super clear for newcomers... https://media.discordapp.net/attachments/371759389889003532/725027533145374841/unknown.png
16:41:42FromDiscord<exelotl> they should actually put the download links for each platform right there on the page
16:41:53*ftsf quit (Ping timeout: 258 seconds)
16:42:58FromDiscord<exelotl> also `border-radius: yes`
16:46:19*abm quit (Quit: Leaving)
16:46:22*chemist69 quit (Ping timeout: 260 seconds)
16:47:09*chemist69 joined #nim
16:57:08*natrys joined #nim
17:11:49FromDiscord<Varriount> Put a link to releases in the readme?
17:14:01*Trustable quit (Remote host closed the connection)
17:15:51FromDiscord<juan_carlos> <marquee> v1.0 &nbsp; v1.1 &nbsp; v1.2 &nbsp; v1.3 </marquee>
17:17:25FromDiscord<exelotl> @Varriount yeah absolutely, but most projects won't do that
17:23:04*Jesin quit (Quit: Leaving)
17:26:17FromDiscord<geekrelief> sent a long message, see http://ix.io/2pXv
17:26:51FromDiscord<geekrelief> Any clue as to what could be going wrong?
17:26:56FromDiscord<Recruit_main707> fuck, i didnt find the releases tab, so that why...
17:27:21Yardanico@geekrelief maybe different architecture?
17:27:22FromDiscord<Clyybber> so your own libcurl works?
17:27:27Yardanicoe.g. libcurl.dll is 32bit and your app is 64bit
17:27:28FromDiscord<Clyybber> yeah thats my hunch too
17:27:29Yardanicoor the other way
17:27:37Yardanicoyour .exe must be the same bitness as libcurl.dll
17:28:13FromDiscord<geekrelief> I tried a 32-bit libcurl.dll just to check too and got a bad format: wrong architecture error.
17:28:32FromDiscord<geekrelief> my own dll is just a dummy has one function that returns an int
17:28:34Yardanicoit also might happen if libcurl.dll depends on something else
17:28:50FromDiscord<geekrelief> also tried compiling libcurl.dll from scratch using vcpkg. no luck
17:29:20FromDiscord<Recruit_main707> yeah, windows dlls are extra wonky
17:29:27FromDiscord<geekrelief> yeah I checked inside of libcurl.dll with dependency walker
17:29:34FromDiscord<geekrelief> all the dlls seem accounted for
17:29:59FromDiscord<Recruit_main707> how could you link the dll directly to the exe?
17:30:38FromDiscord<geekrelief> what do you mean link the dll directly? It's just a separate file from the exe
17:30:55Yardanico@Recruit static linking on windows is probably even more pain than on linux :)
17:30:56FromDiscord<geekrelief> I tried putting the dll in the same directory as the exe
17:31:29FromDiscord<Recruit_main707> i had/have the same issue with sdl2, make sure libcurl doesnt depend on something else
17:31:41FromDiscord<Recruit_main707> i think that was my problem
17:32:22shashlickif you are using dynlib, try -d:nimDebugDlOpen
17:32:29FromDiscord<geekrelief> Yeah I checked for that using Dependency Walker. libcurl relies on a couple other libs
17:32:55FromDiscord<geekrelief> but there in the path as far as I can tell.
17:33:05FromDiscord<geekrelief> (edit) 'there' => 'they're'
17:33:10Yardanicoif they're not system-related, try to place them in the same folder too :)
17:33:19FromDiscord<Recruit_main707> never trust windows paths, do that
17:33:19FromDiscord<geekrelief> hehe tried that too
17:33:30Yardanicobut really it should just work, maybe there's something wrong with the .dll
17:33:39FromDiscord<Recruit_main707> im out of ideas ¯\_(ツ)_/¯
17:33:43*Jesin joined #nim
17:33:49FromDiscord<geekrelief> yeah me too lol that's why I'm here 🙂
17:34:08FromDiscord<geekrelief> I'll look into -d:nimDebugDlOpen
17:34:19FromDiscord<geekrelief> thanks everyone
17:34:24*lritter quit (Ping timeout: 258 seconds)
17:35:35FromDiscord<Recruit_main707> good luck, and i personally want to know if you manage to fix it, so ping me :)
17:35:56FromDiscord<geekrelief> @Recruit_main707 will do
17:44:45*narimiran quit (Ping timeout: 258 seconds)
17:49:57*chemist69 quit (Ping timeout: 260 seconds)
17:50:23*chemist69 joined #nim
17:53:55*waleee-cl quit (Quit: Connection closed for inactivity)
18:22:08*marnix joined #nim
18:28:12*sagax quit (Ping timeout: 256 seconds)
18:29:08*sagax joined #nim
18:31:24*fredrikhr quit (Remote host closed the connection)
18:31:47*fredrikhr joined #nim
18:35:53FromDiscord<dom96> > @dom96 Is there a way to nimble install the whole repo with tests and all?↵@Clyybber nope. Why do you wish to do this?
18:36:11*fredrikhr quit (Read error: Connection reset by peer)
18:36:27FromDiscord<Clyybber> To test packages in CI on their latest release
18:36:44*fredrikhr joined #nim
18:36:47FromDiscord<Clyybber> A way to get the git hash of the latest release would be fine too
18:41:18zedeus`nimble develop` should do that
18:42:11*endragor_ joined #nim
18:43:04*leorize quit (Quit: WeeChat 2.8)
18:44:56*endragor quit (Ping timeout: 258 seconds)
18:45:35*leorize joined #nim
18:48:11*endragor_ quit (Remote host closed the connection)
18:49:30FromDiscord<Clyybber> Araq: We can assume nimNoNilSeqs for the compiler nowadays right?
18:49:59FromDiscord<Clyybber> @Zedeus Does it? I thought nimble develop takes a git repo and puts it into your nimble pkgs?
18:50:14FromDiscord<Clyybber> (edit) '@Zedeus' => 'zedeus:'
18:50:43FromDiscord<dom96> Install the package and then run the tests from the original dir then? 🙂
18:51:11FromDiscord<Clyybber> thats what we are doing, but then the tests are tests for HEAD and the packages are releases
18:51:16FromDiscord<Clyybber> and that causes tons of issues
18:51:45FromDiscord<dom96> Huh? Clone a release tag then?
18:52:01FromDiscord<Clyybber> does nimble only use git tags?
18:52:37FromDiscord<dom96> What do you mean? For what purpose?
18:53:13FromDiscord<Clyybber> AFAIK many nimble packages don't use git tags, so I can't clone a release tag
18:54:33*Zectbumo joined #nim
18:54:39FromDiscord<dom96> ... okay. So I assume you are doing this for the Nim CI?
18:54:43FromDiscord<Clyybber> yeah
18:55:15FromDiscord<dom96> Just use nimble develop. It’ll do the right thing for you (clone the latest tag or head into cwd)
18:56:02FromDiscord<Clyybber> ah, I see. I wasn't aware that nimble develop also downloads and installs a package
18:56:17FromDiscord<Clyybber> I only ever used it without params
18:56:30FromDiscord<Clyybber> Thanks :)
18:56:40FromDiscord<dom96> Yeah. It accepts a package name (and version spec too if you like)
18:56:57FromDiscord<dom96> Basically the same arguments as install
18:57:08FromDiscord<Clyybber> And it clones all of it, including the skipDirs right?
18:57:13FromDiscord<dom96> Yes
18:57:17FromDiscord<Clyybber> Ok thanks!
18:59:00*endragor joined #nim
19:00:57FromGitter<jivank> Any recommended way of doing something like a staticRead but after compilation? Something like replacing the staticRead bytes or cating the asset at the end of the executable?
19:01:31FromGitter<jivank> and have the executable read itself
19:06:04*endragor quit (Ping timeout: 246 seconds)
19:06:23leorizeI don't think this has ever been done for Nim
19:08:00*haxscramper joined #nim
19:11:35*pietroppeter quit (Quit: Connection closed for inactivity)
19:17:37*pangey quit (Ping timeout: 272 seconds)
19:19:46*pangey joined #nim
19:25:04*arecaceae quit (Remote host closed the connection)
19:25:49*arecaceae joined #nim
19:34:25*endragor joined #nim
19:37:38FromDiscord<Yardanico> Do OSes not care if you just append something to the end of the binary?
19:38:43FromDiscord<Recruit_main707> any experience of code blocks as an ide?↵(either with or without nim)
19:42:20haxscramperWhy it is not possible to use custom pragma on `const` but `let` or `var` allow this?
19:46:08*D_ quit (Ping timeout: 244 seconds)
19:47:34*endragor quit (Ping timeout: 240 seconds)
19:50:17*D_ joined #nim
19:51:04leorize@Yardanico yea, ELF containers have an "end marker"
19:51:35leorizehaxscramper: I guess it's just that no one implemented it
19:51:43leorizevar/let pragmas are new fwiw
19:52:20leorizeyou should make an issue requesting const pragmas, I'm sure it will be picked up :)
19:57:04Yardanicoleorize: what about PE?
19:57:52leorizesame goes for PE I think, since upx does work with them
20:00:55Yardanicohmm interesting
20:02:02Yardanicoyeah I can easily append with "cat file >> binary" and then it still runs just fine
20:08:29*fredrikhr quit (Read error: Connection reset by peer)
20:09:38*narimiran joined #nim
20:12:14*marnix quit (Ping timeout: 240 seconds)
20:13:08FromGitter<akavel> @Zevv: yes, got it, thanks a lot, the npeg package looks very cool, thanks for creating it! :)
20:14:18*u0_a47 joined #nim
20:15:18*u0_a47 quit (Client Quit)
20:22:51Zevvyw
20:27:04*haxscramper quit (Remote host closed the connection)
20:28:43FromGitter<jivank> Yardanico, do you think that might work cross platform? macos, windows and linux?
20:29:05Yardanicoi think it should, but I don't think how easy it would be to efficiently read the data in the program itself
20:29:21Yardanicoon linux you can append a zip archive to a binary and then unzip or 7z will happily extract the zip part
20:29:21*kungtotte quit (Read error: Connection reset by peer)
20:29:36*kungtotte joined #nim
20:38:37FromDiscord<geekrelief> @Recruit_main707 I finally figured it out why libcurl.dll couldn't load.
20:38:48Yardanicoyay
20:38:58FromDiscord<geekrelief> yay! 🙂
20:39:16Yardanicoso what's the reason? :)
20:39:24FromDiscord<geekrelief> basically, I created a separate C++ project so I could see the error codes coming out of LoadLibrary
20:39:31*al1ranger joined #nim
20:40:24FromDiscord<geekrelief> The errors I had to deal with were error code 193 (wrong bit architecture), 126 (can't find the dll), and 127 (can't find the proc in the module).
20:40:46YardanicoI think there was a PR to nim which added some more debug info on windows for dll loading
20:40:47Yardanicolemme try to find it
20:41:03Yardanicohttps://github.com/nim-lang/Nim/pull/13950
20:41:04disbotadded extended msg for failed library loads w/ incorrect DLL formats
20:41:18Yardanicoif you compile with -d:nimDebugDlOpen of course
20:41:35Yardanicoah
20:41:40FromDiscord<geekrelief> I couldn't find any info on -d:nimDebugDlOpen
20:41:41Yardanicoit's not in a stable release I guess
20:41:50Yardanicoit wasn't backported
20:41:54FromDiscord<geekrelief> I see
20:41:56Yardanicobut it'll be in 1.4 :)
20:42:01FromDiscord<geekrelief> yay!
20:42:16FromDiscord<geekrelief> basically, I had to compile libcurl using vcpkg
20:42:19*natrys quit (Ping timeout: 246 seconds)
20:42:38FromDiscord<geekrelief> and I copied it's dependency zlib1.dll to my path
20:43:10FromDiscord<geekrelief> seems like the libcurl binary provided by nim and by curl maintainers wasn't working
20:43:38FromDiscord<geekrelief> and the ones they provided depended on the different versions of things like libssl, libcrypt and zlib
20:43:50shashlicklooks like getHeader would have made your life easier
20:43:52Yardanicoany specific reason you need libcurl btw? just curious
20:43:58Yardanicosince there's httpclient and stuff
20:44:37FromDiscord<geekrelief> well I started mucking with libcurl last night because I wanted to write a script to download some books https://www.springernature.com/gp/librarians/news-events/all-news-articles/industry-news-initiatives/free-access-to-textbooks-for-institutions-affected-by-coronaviru/17855960
20:45:02YardanicoI just meant that httpclient in nim works for most stuff you would want :)
20:45:05FromDiscord<geekrelief> since I'm new to nim I thought it'd be a good to try writing something to download them
20:45:09Yardanicohttps://nim-lang.org/docs/httpclient.html
20:45:17FromDiscord<geekrelief> gotcha. yeah I didn't know about it
20:45:20*polypus74 joined #nim
20:45:22FromDiscord<geekrelief> until after the struggles
20:45:34FromDiscord<geekrelief> still it bugged me why libcurl wouldn't work
20:45:43FromDiscord<geekrelief> because it seems like it works for other people
20:45:48FromDiscord<geekrelief> anyway, I learned a lot
20:46:07Yardanicofor an overview of the stdlib you can skim over https://nim-lang.org/docs/lib.html
20:46:42FromDiscord<geekrelief> Yeah I need to go through that more thoroughly. I'm still reading through the manual and getting my bearings
20:47:09FromDiscord<geekrelief> thanks for the tip though
20:47:14Yardanicoyeah it's totally okay :)
20:48:27Yardanicoalso in that documented you might be confused why some packages have "std/" prepended - that's because all new nim stdlib packages start there, and it's kinda preferred to import stdlib modules with std prefix so third-party modules can't shadow them
20:48:48Yardanicoyou can import all stdlib modules via std though - not only the ones which are with the std prefix
20:49:06Yardanicothat said, even I still import stdlib modules the old way :D
20:49:33FromDiscord<geekrelief> ok cool thanks for the tip
20:49:46FromDiscord<geekrelief> btw, were can I find out more about -d:nimDebugDlOpen?
20:49:56FromDiscord<geekrelief> I couldn't find it anywhere in the manual
20:50:13Yardanicothere's no real documentation for it :)
20:50:27FromDiscord<geekrelief> hehe of course 🙂
20:50:27leorizeit's only ever mentioned in the error message for not being able to load libraries :P
20:50:30Yardanicomanual mostly covers the language specification itself and not specific implementation details
20:51:39FromDiscord<geekrelief> ok thanks!
20:53:29*Vladar quit (Quit: Leaving)
20:55:05*natrys joined #nim
20:55:10*natrys quit (Client Quit)
20:56:58*al1ranger quit (Quit: Leaving)
21:03:14FromDiscord<Recruit_main707> nice, good job
21:03:19*polypus74 quit (Quit: WeeChat 2.8)
21:03:43*polypus74 joined #nim
21:05:47*polypus74 quit (Client Quit)
21:06:04*polypus74 joined #nim
21:07:36*lmariscal quit (Quit: I'm Out!)
21:08:25polypus74 /msg NickServ VERIFY REGISTER polypus74 xotzylexwckz
21:08:41polypus74oops
21:08:41Yardanicowrong chat :P
21:08:45YardanicoXDD
21:08:45fowlnice
21:08:55*polypus74 quit (Client Quit)
21:09:35*polypus74 joined #nim
21:09:57*marquisdefalbala quit (Quit: Konversation terminated!)
21:10:13*lmariscal joined #nim
21:10:42Yardanicoreported the arch packaging issue https://bugs.archlinux.org/task/67092
21:11:00*marquisdefalbala joined #nim
21:11:57leorizeyou may as well report that they are not using the official source distribution...
21:12:14leorizethey wouldn't even need to download csources if they use the official distribution lol
21:12:38Yardanicoalso, why do they modify compiler/nim.cfg
21:12:49Yardanicothey add same flags to both compiler/nim.cfg and config/nim.cfg
21:12:58Yardanicowhich is redundant
21:13:02leorizeI know
21:13:16FromGitter<jivank> Yardanico, for example python's first argument is the filename itself, if nim does something like that, wouldnt it just be a matter of searching for a marker (echo '---start---' >> executable && cat somefile >> executable)
21:13:17*marquisdefalbala quit (Client Quit)
21:13:37Yardanicowell, yeah, that's totally possible but I mean it can be a little bit inefficient
21:13:42*polypus74 quit (Client Quit)
21:13:44Yardanicoyou can of course get the current binary path
21:13:50*khanate[m]0 left #nim ("User left")
21:13:52Yardanicothere's https://nim-lang.org/docs/os.html#getAppFilename
21:13:57*polypus74 joined #nim
21:14:42leorizethis sort of design is used a lot for sfx archives
21:14:53FromGitter<jivank> right. so in terms of efficiently, do you mean like for example knowing exactly where to seek to?
21:14:56Yardanicoyeah
21:15:05Yardanicowell I'd guess it's pretty fast anyway
21:15:12leorizeyou can use fmAppend and the OS magically point it to the end of file :P
21:15:18FromDiscord<Clyybber> Araq: Maybe doing it for every newProc(nil, ... is not correct after all
21:15:24Yardanicosince the binary part itself is pretty small
21:15:26FromDiscord<Clyybber> tgotoexceptions4.nim fails
21:15:36Yardanicoso this ---start--- marker will likely be in like first 1-5mb of the file
21:16:56FromGitter<jivank> right
21:18:07*polypus74 quit (Client Quit)
21:18:19leorizefor ELF you can just embed additional sections into the binary though, skips all the trouble of appending and searching
21:18:24*polypus74 joined #nim
21:18:33Yardanicoand I think this should be ppossible from nim itself?
21:18:38YardanicoI think you can do it with pragmas
21:18:56Yardanicowell, if the C compiler supports that
21:19:06*lmariscal0 joined #nim
21:19:11leorizenah, this requires an additional program to embed things in
21:19:14Yardanicooh
21:19:25leorizeuseful to make things like 7zsfx
21:20:01FromGitter<jivank> yeah hopefully this works crossplatform and i'll be set
21:20:02leorizewell you can embed things in directly at compile time if you write some assembly I think :P
21:20:12leorize!repo resource
21:20:14disbothttps://github.com/status-im/nimbus -- 9nimbus: 11Nimbus: an Ethereum 1.0 & 2.0 Client for Resource-Restricted Devices 15 355⭐ 52🍴 7& 2 more...
21:20:40leorize!repo asset
21:20:41disbothttps://github.com/SSPkrolik/nimasset -- 9nimasset: 11Pure Nim 3D Assets loading library 15 5⭐ 5🍴 7& 4 more...
21:20:57leorize!repo assets
21:20:58disbothttps://github.com/SSPkrolik/nimasset -- 9nimasset: 11Pure Nim 3D Assets loading library 15 5⭐ 5🍴 7& 3 more...
21:20:58*lmariscal quit (Ping timeout: 260 seconds)
21:20:58*lmariscal0 is now known as lmariscal
21:21:06leorize!package nimassets
21:21:07disbotinternal error😢
21:21:11leorizewhat?
21:21:23leorize!repo xmonader/nimassets
21:21:24disbothttps://github.com/xmonader/nimassets -- 9nimassets: 11bundle your assets into single nim file inspired by go-bindata 15 21⭐ 0🍴
21:23:22*marquisdefalbala joined #nim
21:23:44*lmariscal quit (Read error: Connection reset by peer)
21:26:53*waleee-cl joined #nim
21:28:09FromGitter<jivank> also do you have any recommendations on bundling other static binaries and running them? my current approach is staticRead the binary (based on target OS), extract to tmpdir, mark executable and run
21:28:25FromGitter<jivank> not extract, write to tmpdir
21:29:51leorizeI'd just customize 7zsfx :P
21:30:25leorizebundle all of your binary into one 7z bundle, use 7zsfx on it and tell it to run the main binary on extraction
21:32:12FromGitter<jivank> i see, you can build for all OS with that?
21:32:39Yardanicohttps://github.com/nim-lang/Nim/issues/11827 does "This issue was closed." it was closed by someone using the nim-lang org account?
21:32:41disbotget request with valid url throws "No uri scheme supplied" and exits ; snippet at 12https://play.nim-lang.org/#ix=2q0z
21:32:45Yardanicomean*
21:34:00leorizeit said that the author closed it/
21:34:02leorize?
21:34:06Yardanicono
21:34:11Yardanicoah wait yes
21:34:15Yardanicobut why I received the notification only now?
21:34:27Yardanicosee https://i.imgur.com/ydGRFFC.png
21:34:28Yardanicojust curious :P
21:34:54leorizegithub bugged out? :P
21:34:57Yardanicoprobably
21:38:43*lmariscal0 joined #nim
21:40:18*solitudesf quit (Ping timeout: 256 seconds)
21:48:47FromDiscord<Zachary Carter> hmm if I'm `importcpp`ing a type can I write a Nim type that extends from it?
21:51:47FromDiscord<Vindaar> t
21:51:51FromDiscord<Vindaar> oops
21:56:19FromDiscord<Recruit_main707> probably not
21:58:34*tane quit (Quit: Leaving)
21:59:24FromDiscord<Zachary Carter> I mean I can use emit - but I'd rather not do that if I can avoid it
21:59:34*narimiran quit (Ping timeout: 256 seconds)
22:00:14FromDiscord<Recruit_main707> you could have a type that one of its fields is that class
22:04:55leorize@Zachary you can probably still do composition
22:05:32FromDiscord<Zachary Carter> maybe - I need to override a virtual method
22:08:23leorizelooks like you will have to write some emit
22:09:03FromDiscord<Zachary Carter> yeah
22:09:31*nikita` quit (Quit: leaving)
22:10:18leorizecodegenDecl should help you write the actual implementation, but the C++ class definition must be done via emit
22:10:21*Zectbumo quit (Read error: Connection reset by peer)
22:10:46FromDiscord<Recruit_main707> cpp class generator macro now!
22:12:25FromGitter<Knaque> Hey, I'm sure this is a dumb question, but can anyone give me an example of how I might use an anonymous proc? (i.e. to define a variable.) I can't find a decent existing example.
22:12:59Yardanicolet a = proc(): int = result = 5
22:13:22Yardanicothen "a" will be "proc (): int{.noSideEffect, gcsafe, locks: 0.}"
22:13:34Yardanicoof course you can indent all you want
22:13:36FromDiscord<Recruit_main707> is this useful in any special case, it looks pretty dumb
22:14:02FromGitter<Knaque> What about with arguments?
22:14:44leorizejust put arguments in as usual
22:14:51Yardanicoit's just a proc without a name
22:14:52leorizelet b = proc(s: string) = echo s
22:14:54Yardanicohence "anonymous proc"
22:15:00Yardanicoall other syntax is the same
22:15:20Yardanicohttps://play.nim-lang.org/#ix=2q0L
22:15:33FromGitter<Knaque> Ah, right, I think I properly understand now.
22:15:49Yardanico() is optional without arguments too, so the minimal anonymous proc is
22:16:02FromDiscord<Recruit_main707> i still dont see how anonymous procs can be somewhat useful
22:16:09Yardanicolet 💩 = proc = echo "hi"
22:16:16leorizethey are useful to write callbacks
22:16:18FromDiscord<Recruit_main707> i see...
22:18:49FromDiscord<Recruit_main707> hmmm qtcreator seems to be nuts, and have active nim support, but no one uses it apparently, why?
22:19:17leorizebecause it's heavy as hell?
22:19:23leorizewell lighter than vscode I guess :P
22:19:29Yardanicoquite a lot of editors have nim highlighting support nowadays
22:19:43FromDiscord<Recruit_main707> let that be an "a few"
22:19:45Yardanicodoes it support nimsuggest?
22:19:58Yardanicoactually seems like yes
22:20:00FromDiscord<Recruit_main707> well see in 5 hours :P
22:20:04FromDiscord<Shucks> And still no real ide feeling with any of em 😛
22:20:07Yardanicohttps://code.woboq.org/qt5/qt-creator/src/plugins/nim/suggest/server.cpp.html
22:20:26Yardanicolemme try it
22:20:26leorizewhy do you even need the "real ide feeling" :P
22:20:37Yardanicoit's only one pacman -S away anyway
22:21:02FromDiscord<Recruit_main707> > why do you even need the "real ide feeling" :P↵my brain cant rest when i dont have it
22:21:11FromGitter<Knaque> Right, I think I just misunderstood what an anonymous proc actually was. My bad.
22:21:53FromDiscord<Shucks> debugging, fast suggestions.. that would be great. But yeh, maybe im just lazy.
22:22:20leorizeuse nim.nvim, really fast suggestions :P
22:22:34FromDiscord<mratsim> @Zachary Carter did you see this page to manipulate the C++ VTable? https://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim
22:22:54Yardanicothere's this btw https://doc.qt.io/qtcreator/creator-project-nimble.html
22:22:59Yardaniconeat stuff actually
22:23:00FromDiscord<Zachary Carter> I didn't - thanks @mratsim
22:24:03leorize@Shucks https://asciinema.org/a/276278 I only got this as a debugging example :P
22:24:10FromDiscord<Recruit_main707> i dont want them to deprecate the nim support so ill do my part and use it :P
22:24:18Yardanicohttps://i.imgur.com/ZiMBarf.png
22:24:51FromDiscord<Recruit_main707> even better icon that cpp xD
22:25:02FromDiscord<Recruit_main707> than*
22:25:07Yardaniconow I wonder how I get suggestions to work
22:25:28FromDiscord<Recruit_main707> wait, you have it installed?
22:25:32Yardanicoyes ofc?
22:25:35Yardanicowdym?
22:25:40Yardanicoit's officially part of qt creator
22:25:49Yardanicoexperimental (disabled by default)
22:25:54FromDiscord<Recruit_main707> i know, i meant qt creator itself
22:25:58Yardanicoyes ofc it's ez
22:26:03Yardanicopacman -S qtcreator go brrrrrr (Artix)
22:26:08FromDiscord<Recruit_main707> easily 5 hours
22:26:15Yardanicowat
22:26:16FromDiscord<Shucks> > @Shucks https://asciinema.org/a/276278 I only got this as a debugging example :P↵@leorize[IRC]#0000 Just saw it. Looks like awesome fast. Debugging in vscode looks easier but suggestions are horrible slow. Might be because im on windows aswell. https://media.discordapp.net/attachments/371759389889003532/725114520619712642/gdb.png
22:26:40FromDiscord<Recruit_main707> my pc is being suuuuper slow installing it
22:26:50Yardanicowait even this is documented lol
22:26:51Yardanicohttps://doc.qt.io/qtcreator/creator-completing-code.html#completing-nim-code
22:27:34Yardanicoyes lol
22:27:35FromDiscord<Recruit_main707> \*starts to consider to buy full version*
22:27:36Yardanicosuggestions work now
22:27:39Yardanicowtf
22:28:01Yardanicoalthough no documentation for autocompletion symbols
22:30:10Yardanicogo to defition works too
22:30:15Yardanico(F2)
22:31:11Yardanicowhen you get bored so you read random issues https://i.imgur.com/HcdqEEW.png
22:31:15FromDiscord<Recruit_main707> Pog
22:37:18*endragor joined #nim
22:43:03FromDiscord<Recruit_main707> @mratsim now that you have linked that vtable thing again, i dont understand where does vtable come from
22:43:28FromDiscord<mratsim> from the C++ compiler
22:43:51FromDiscord<mratsim> "discard produces unpretty C code" is very random indeed
22:44:01FromDiscord<Recruit_main707> so, c++ classes == vtable == array[25, pointer]?
22:44:05*Prestige quit (Ping timeout: 272 seconds)
22:44:09Yardanicodepends on number of members ofc
22:44:18Yardanico"For every class that contains virtual functions, the compiler constructs a virtual table, a.k.a vtable. The vtable contains an entry for each virtual function accessible by the class and stores a pointer to its definition. "
22:44:41*Prestige joined #nim
22:45:02FromDiscord<Recruit_main707> that piece of text would be nice to be added to the url for noobies like me
22:45:15FromDiscord<Recruit_main707> to that web rather...
22:45:21Yardanicoadd it yourself ;)
22:45:26Yardanicoanyone can edit github wikis by default
22:45:33Yardanicoand they say "See, VTABLE is only an array of pointers to functions, Nim can handle that easily."
22:46:07leorizenow we just need a convenience macro :P
22:46:14FromDiscord<Recruit_main707> its late and i dont want to think, \*proceeds to copy paste the exact same words*
22:46:17YardanicoI think mratsim started working on one?
22:46:22nisstyreI would naively assume discard for C does (void)foo;
22:46:24Yardanicoi saw some of his code
22:46:27nisstyreis that the case?
22:46:29Yardaniconisstyre: yes
22:46:34nisstyreah ok cool
22:46:42Yardanicoon latest devel that is
22:46:55Yardanicoseems like when the issue was opened it produced a different thing :) https://github.com/nim-lang/Nim/issues/6888
22:46:57disbotdiscard produces unpretty C code... ; snippet at 12https://play.nim-lang.org/#ix=2q0Q
22:50:00*endragor quit (Ping timeout: 256 seconds)
22:51:34FromDiscord<Recruit_main707> something like that? https://media.discordapp.net/attachments/371759389889003532/725120897593376899/unknown.png
22:51:49Yardanicolol
22:52:09Yardanicogrog buy rock
22:52:22Yardanicogrug buy rock
22:52:24Yardanicorock crash
22:52:25Yardanicogrug rage
22:52:30nisstyrefix the tenses and it seems ok
22:53:03nisstyreand the auxiliary verbs
22:55:58FromDiscord<Technisha Circuit> How do i include and use a header file in Nim?
22:56:03FromDiscord<Technisha Circuit> I'm asking for a friend
22:56:11Yardanicoyou don't need to include it explicitly
22:56:24FromDiscord<Technisha Circuit> Oh?
22:56:24Yardanicoyou would usually import types from it by attaching {.importc, header: "myheader.h.}
22:56:28Yardanicolike
22:56:31FromDiscord<Technisha Circuit> O
22:56:41*vsantana quit (Quit: leaving)
22:56:42Yardanicoproc my_c_proc(data: cint): cstring {.importc, header: "myheader.h".}
22:56:45FromDiscord<Technisha Circuit> How would i use that header then?
22:56:57Yardanicoand then you can just call that proc normally
22:57:02FromDiscord<Technisha Circuit> Is the proc gonna act as the namespace?
22:57:09Yardanico??
22:57:13FromDiscord<Technisha Circuit> Or does it have to be a named a function in that header file
22:57:16nisstyreno, C doesn't have namespaces
22:57:19Yardanicoit's not for the whole header, it's just for one function
22:57:25nisstyreit just lets you call that one function
22:57:29Yardanicoyou might want to run c2nim on the header to get everything
22:57:33Yardanicoalthough it doesn't work in all cases
22:57:41YardanicoDamn GitHub why you do this to me :( https://i.imgur.com/Of6MmQu.png
22:57:42*vicfred joined #nim
22:59:06FromDiscord<Technisha Circuit> Oh okay
22:59:27FromDiscord<Technisha Circuit> ~~Would c2nim work on ncurses if someone has tried it?~~
22:59:50Yardanicodo you know github search exists? :) just asking
22:59:53Yardanicoe.g. I found https://github.com/rnowley/nim-ncurses
23:00:08Yardanicoit doesn't even use the headers, it uses the library directly
23:00:26FromDiscord<Technisha Circuit> O
23:00:36Yardanicoalso see https://github.com/pseudo-random/editor/blob/master/backends/ncurses.nim
23:00:59FromDiscord<Technisha Circuit> Oh nice thanks!
23:01:09FromDiscord<Technisha Circuit> @Synth
23:01:21FromDiscord<Technisha Circuit> Ncurses in Nim, just what you needed
23:01:31YardanicoWe have https://github.com/johnnovak/illwill btw
23:01:33Yardanicopurenim
23:02:03FromDiscord<Technisha Circuit> He tried that but it's lacking features
23:02:28FromDiscord<Recruit_main707> nisstyre: I’m not a native English speaker, and either because of that or because I’m tired I don’t see the grammatical errors, if you could change it pls.
23:03:59FromDiscord<Synth> Ohh wow!
23:04:04FromDiscord<Synth> Thank you
23:04:08FromDiscord<Technisha Circuit> You have amazing English though recruit
23:04:20FromDiscord<k1tt3hk4t> Quick question: Is there any easy way to have a garbage collected array that does not have both a capacity and a length field? For instance if I could add a ptr to the GC and just use create/deallocate that would be nice, though I don't know if such a thing is possible
23:04:28FromDiscord<Synth> He’s a level 707 recruit main
23:04:31FromDiscord<Synth> Hahaha
23:04:41FromDiscord<k1tt3hk4t> my impression is that Seq has a stored capacity field somewhere to allow amortization of appends (or else I would expect performance to be horrible)
23:04:54Yardanicoyes
23:05:03Yardanicolen/cap/pointer to data
23:05:22FromDiscord<k1tt3hk4t> alright so, TLDR my question: can I get something like Seq but with only cap/pointer to data
23:05:28FromDiscord<k1tt3hk4t> while still being GCed
23:05:37Yardanicoisn't that more like + pointer to data?
23:05:39Yardanicolike len*
23:05:42Yardanicothe newruntime seq implementation is in https://github.com/nim-lang/Nim/blob/devel/lib/system/seqs_v2.nim btw
23:05:51FromDiscord<k1tt3hk4t> I guess so, from a point of view
23:06:14leorizek1tt3hk4t: yes, this is possible (not that I recommend it...)
23:06:15leorizesee `unsafeNew`
23:06:36leorize^ see above: unsafeNew
23:07:39FromDiscord<k1tt3hk4t> interesting, I'll look into that
23:08:27FromDiscord<k1tt3hk4t> my use case is for a somewhat SoA sort of usecase (not exactly) where the capacity/length of multiple arrays are kind of implied by a single length value
23:08:38FromDiscord<k1tt3hk4t> so I really don't want to use Seq and tote around a bunch of extra meaningless data
23:08:57FromDiscord<k1tt3hk4t> so rest assured I'm not doing this for the sake of doing unsafe things
23:09:15FromDiscord<k1tt3hk4t> I'm even somewhat surprised this isn't exposed via some safe interface
23:09:29Yardanicowhat exactly?
23:09:42FromDiscord<k1tt3hk4t> https://cs.uwaterloo.ca/~imunro/cs840/ResizableArrays.pdf
23:10:09FromDiscord<k1tt3hk4t> basically a data structure similar to a hashed array tree where you maintain blocks of pointers that are 2x and 1/2 the current block of pointers respectively
23:10:15FromDiscord<k1tt3hk4t> in such a way that you get true O(1) snoc
23:10:19FromDiscord<k1tt3hk4t> not amortized
23:10:45FromDiscord<k1tt3hk4t> while retaining O(1) appends in few cycles using clz (or rather the nice fastLog2 function Nim has)
23:10:56FromDiscord<k1tt3hk4t> or sorry, O(1) indexing
23:11:07FromDiscord<k1tt3hk4t> appends are still O(n) of course xDD
23:11:37FromDiscord<k1tt3hk4t> (as in, appending one container to another-- appending a single item is what I'm referring to as snoc here)
23:12:47leorizeit's not exposed because no one built it :P
23:12:54leorizebe the first :)
23:13:07leorizethough you might not want to bring the GC in for this
23:13:19FromDiscord<k1tt3hk4t> why's that
23:13:23leorizeuse destructors and manual allocation for optimal control
23:13:44FromDiscord<k1tt3hk4t> hmm ok, I assume those are going to be more idiomatic going forward?
23:13:52nisstyreRecruit: i didn't mean to be critical, I could fix it if you link the original
23:13:54leorizesee seqs_v2 for how new seq is designed
23:14:49leorizeit's really just more efficient this way
23:15:28leorizethe GC manages many variables: like refcount (which your array type might not care about), potential cycles (which should not be possible for your type)
23:15:38leorizeall of that just bloat things up
23:15:39FromDiscord<k1tt3hk4t> yeah I get the upshot of it-- I was just wanting to design the library in the way that would be easiest to use
23:15:51FromDiscord<k1tt3hk4t> I personally don't even have an issue with 100% manual allocation
23:16:00leorizeprovide a seq-like interface and you're set :)
23:16:00FromDiscord<k1tt3hk4t> but I assume using destructors is going to be the norm going forwards, yes?
23:16:08FromDiscord<k1tt3hk4t> if so, I'd be happy to use them
23:16:09leorizeah yea
23:16:52leorize~destructors
23:16:52disbotno footnotes for `destructors`. 🙁
23:16:54leorize~destructor
23:16:55disbotno footnotes for `destructor`. 🙁
23:17:01Yardanico@k1tt3hk4t the thing is that you can define custom index operators and stuff like that easily in nim, so of course you can make your own versions :)
23:17:02FromDiscord<Clyybber> ~arc
23:17:02disbotarc: 11a new memory manager for Nim; see https://forum.nim-lang.org/t/5734
23:17:18leorize~destructor is https://nim-lang.org/docs/destructors.html
23:17:19disbotdestructor: 11https://nim-lang.org/docs/destructors.html
23:17:25FromDiscord<k1tt3hk4t> yeah, I'm aware of the index operator overloads, they're pretty nifty
23:17:33leorize^ read that for a primer on how to use destructors
23:17:41FromDiscord<k1tt3hk4t> alrighty
23:18:23FromDiscord<Recruit_main707> nisstyre: don’t worry, I didn’t feel like you were↵https://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim
23:18:27leorizedestructors work with all GC, so you don't have to worry about compatibility :)
23:18:37Yardanicoleorize: they work fine with refc?
23:18:40Yardanicothat's nice
23:18:41leorizeyep
23:18:43FromDiscord<k1tt3hk4t> ahh, that's nice then
23:18:47FromDiscord<k1tt3hk4t> I wasn't aware of that
23:18:48Yardanicofwiw https://github.com/avahe-kellenberger/nimdow seems to compile with arc after I changed two lines of code
23:18:59leorizeI've been using them since forever for nim-kmod lol
23:19:00Yardaniconot sure if everything works correctly but it launches with xephyr
23:19:02leorize!repo kmod
23:19:02disbothttps://github.com/alaviss/kmod -- 9kmod: 11High-level libkmod wrapper in Nim 15 0⭐ 0🍴
23:19:58FromDiscord<k1tt3hk4t> thanks for the info :)
23:21:12nisstyreRecruit: I fixed some of it, I'll try to go through the rest
23:21:31nisstyreseems good so far though!
23:21:38nisstyreI didn't know notepad++ used Scintilla
23:21:51Yardaniconice view counts btw https://www.youtube.com/channel/UCDAYn_VFt0VisL5-1a5Dk7Q/videos
23:22:44nisstyreRecruit: for what I changed https://github.com/nim-lang/Nim/wiki/Playing-with-CPP--VTABLE-from-Nim/_compare/24cc4babe1fd736eebc070e9f4e4074488b22195...84671d08d225db8d7fd8f3d66d7b2785884a5abe
23:23:15YardanicoI guess I should make yet another gource video for nim (I made https://www.youtube.com/watch?v=rUJ7Bzgv3n0 and then another guy made another version, can't find it now)
23:23:53leorizethe number kinda fall off for later talks it seem
23:24:09Yardanicowell yeah
23:24:25Yardanicobut not for all
23:24:26Yardanicofidget is almost 1k
23:28:14*marquisdefalbala quit (Quit: Konversation terminated!)
23:33:24*endragor joined #nim
23:34:16*rockcavera quit (Remote host closed the connection)
23:39:47*marquisdefalbala joined #nim
23:41:13FromDiscord<Recruit_main707> There are talks that are more intersting/attractive for the average viewer
23:41:27Yardanicoexplain why ARC talk has 1.2k views then :P
23:41:40YardanicoI mean it's nice but it won't be more interesting to the average viewer :)
23:42:57FromDiscord<Recruit_main707> The exception confirms the rule :P
23:44:00FromDiscord<Zed> Nice video Yardinco, how did you get what files were made/deleted?
23:44:05Yardanicowdym?
23:44:08Yardanicothat's all handled by gource
23:44:14Yardanicohttps://gource.io
23:44:18Yardanicoit has native git support OOTB
23:44:33Yardanicoi just tweaked theme/display/speed/etc configuration
23:44:41FromDiscord<Zed> ah, that makes sense
23:44:45*krux02_ joined #nim
23:45:14FromDiscord<Zed> are you going to make a 'to 1.0 release' timeline?
23:45:51Yardanicolol
23:47:32*krux02 quit (Ping timeout: 260 seconds)
23:48:09*endragor quit (Ping timeout: 258 seconds)
23:49:17*krux02_ quit (Remote host closed the connection)
23:50:36*rockcavera joined #nim
23:51:45FromDiscord<Technisha Circuit> What's the quirky exceptions idea?
23:51:56Yardanicohttps://nim-lang.org/araq/quirky_exceptions.html
23:52:10Yardanicomight be outdated ofc
23:52:29Yardanicowe have goto exceptions nowadays
23:56:15*ftsf joined #nim
23:57:40FromDiscord<KingDarBoja> Woaah I saw that nimlang progression video
23:57:48FromDiscord<KingDarBoja> Even before jumping into iy
23:57:59FromDiscord<KingDarBoja> Had no idea Yardanico made it
23:58:02YardanicoXD