<< 24-01-2020 >>

00:15:25*opal quit (Quit: i'm never coming back)
00:16:21*opal joined #nim
00:17:44*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:18:15*Ven`` joined #nim
00:18:34*Ven`` quit (Client Quit)
00:18:57*opal quit (Client Quit)
00:19:39*opal joined #nim
00:20:05FromGitter<Varriount> Araq: I miss Nim templates. They make life so much easier.
00:20:51FromGitter<Varriount> Zevv: NPeg's code is very tidy. Or at least, the code generation part is
00:37:51*cron quit (Quit: Leaving.)
00:48:11*cron joined #nim
01:00:08*blueberrypie quit (Quit: Ping timeout (120 seconds))
01:01:35*blueberrypie joined #nim
01:10:01Yardanicotypedesc can only be used in procedure arguments right?
01:13:29Araqroughly, yeah
01:15:25Araqhttps://gist.github.com/Araq/74fc6cfe26e807f7279f65b65500251a this is my version of "binary trees"
01:15:36Araqwith the default GC I get 15s
01:15:42Araqwith M&S 16s
01:15:46Araqwith ARC 10s
01:16:00Araqwould be nice if anybody can confirm these results
01:16:58YardanicoI was asking because I looked into https://github.com/nim-lang/Nim/issues/9932 for curiosity and added "if kind in {skVar, skLet, skConst}: result = t" to tyTypedesc in types.nim instead of result = nil
01:17:00disbotError: internal error: expr(skType); unknown symbol ; snippet at 12https://play.nim-lang.org/#ix=28aW
01:17:10Yardanicoit's probably incorrect but I'm running the testament locally anyway :D
01:18:18FromGitter<timotheecour> @araq ⏎ ⏎ > Excuse me if the question is silly (I'm tired) but does this support "dot chaining" (foo.on.add("a").add("b")) or not? ⏎ ⏎ but dot chaining would be less effective than what’s in the PR `foo.chainOn(initialize(), postprocess("foo"), x1 = 1, x1 += 3, x2 = 5)` ... [https://gitter.im/nim-lang/Nim?at=5e2a45da9ad22d5bd5cc1cfc]
01:19:25disruptekAraq: what's in `prelude`?
01:19:55Yardanicodisruptek: lib/prelude.nim exists in nim repo
01:20:14Yardanicohttps://github.com/nim-lang/Nim/blob/devel/lib/prelude.nim
01:20:24Yardanicoseens like a small file for importing common modules or something
01:20:24disruptekokie, thanks.
01:20:47Araqtimotheecour: people want dot chaining though
01:21:11Araqand since chaining ain't for me, I'm willing to give them what they want
01:22:01FromGitter<timotheecour> how would you dot chain with an operator `+= 3`?
01:23:05AraqI don't care, I don't use chaining, it's stupid
01:23:05disruptekAraq: arc 9.5s, m&s 14.5s, def 33s(!)
01:23:13TangerHas anybody used the libssh2 wrapper (https://github.com/ba0f3/libssh2.nim) for file transfer (scp-ish)?
01:23:24disruptekoh, i have a nim.cfg
01:24:08Araqand the GCs are allowed to cheat, I don't even force a GC_fullCollect
01:24:15Araqwhich is what ARC does...
01:24:19disruptek12.4 default
01:24:31YardanicoAraq: is -d:danger okay to use?
01:24:36Yardanicofor testing this
01:24:44AraqYardanico, I use it too, yes
01:25:40disrupteklooks like low 8s for arc, so almost 30% faster.
01:25:47disrupteker, 1/3rd.
01:27:24Araqok, so roughly comparable
01:27:44Yardanicowell, with default GC I get ~19-21 seconds, with ARC - 11-12s, with m&s around 23s
01:27:50AraqI don't need it that precise, it's for FOSDEM
01:33:44Yardanicoalso by the way, is there any particular reason the build script in csources doesn't parallelize compilation?
01:33:59Yardanicoon modern systems with a lot of cores/threads it would be much faster
01:35:30AraqI almost never run the build script
01:35:57Yardanicowell, I guess it still won't hurt to add that feature since nim itself uses all cores for C compilation by default anyway
01:36:32Araqfeel free to use the makefile instead
01:36:38Araqif we still have it.
01:36:40*jholland__ quit (Quit: Connection closed for inactivity)
01:37:58Yardanicooh it's actually there, never knew there was a makefile in csources o_o
01:39:07*GitterIntegratio quit (Ping timeout: 264 seconds)
01:41:36*cron quit (Quit: Leaving.)
01:43:18Araqbah, manual MM is 6.75s
01:43:25Araqquite a difference
01:43:53disruptekbut arc isn't optimized yet.
01:44:05Araqwell it is optimized quite a bit
01:44:13Araqbut there is more we can do
01:44:25Araqand in theory there is 0 overhead for this particular benchmark
01:44:26disruptekarc isn't /optimal/ yet.
01:45:00Araqmost of the perf difference is the result of our new doing alloc0 and not alloc.
01:45:18disruptekis the realloc in yet?
01:45:36Araqif you mean Zevv's PR
01:45:39disruptekyeah.
01:45:44Araqyes, that's been merged
01:47:32disruptekonly modest improvement, at best. on the other of 2-3% for base64.
01:47:49Araqbase64 is not allocation heavy
01:48:04disrupteki kinda wanna impl one of the fast algos for base64 but if i bother to write something like that, it will be meowhash or similar. something i will use right away.
01:48:17Araqfor base64 you need to see it uses SSE instructions or whatever
01:48:30disruptekright, i did a little research on this, actually.
01:48:57disruptekthere's a c impl that runs at 0.33, which is literally 1/10th of our current speed.
01:49:09disrupteker, 1/10th of our runtime.
01:50:37disruptek!repo fastbase64
01:50:37disbothttps://github.com/lemire/fastbase64 -- 9fastbase64: 11SIMD-accelerated base64 codecs 15 279⭐ 19🍴 7& 1 more...
01:50:51disruptek!repo base64simd
01:50:52disbothttps://github.com/WojciechMula/base64simd -- 9base64simd: 11Base64 coding and decoding with SIMD instructions (SSE/AVX2/AVX512F/AVX512BW/AVX512VBMI/ARM Neon) 15 87⭐ 4🍴
01:51:06disruptekmore than anyone ever wants to know.
01:51:16Araqwell port it to Nim please
01:51:57Araqit's always a great help for the people who have no clue what language to use and so they look at crappy benchmarks and make their decision.
01:52:34Araqit makes sense, I know little about cars so I drive a Ferrari
01:52:39disruptekit's not that so much; the problem is that we actually look pretty bad, and it was improved not long ago.
01:53:23disrupteklemme know when you wanna upgrade and i'll put you into a 911.
01:54:00Araqoh it's late, good night
01:54:03disruptekpeace.
02:10:46*disbot quit (Quit: Bye)
02:10:46*disruptek quit (Quit: Bye)
02:11:22*disbot joined #nim
02:12:17*disruptek joined #nim
02:13:33FromDiscord_<Skaruts> I don't quite understand choosenim, I downloaded it, but there's no `runme.bat` in the zip, like it says in the readme
02:14:12FromDiscord_<Skaruts> (for windows)
02:16:41FromDiscord_<Skaruts> tehre's only a exe and two dlls, and it seems like I can just run it and install nim versions, and seems to work fine actually, but, does it matter which folder choosenim resides in?
02:22:57shashlickNot really, anywhere on path is fine
02:23:04shashlickWhich zip did you download
02:23:35FromDiscord_<Skaruts> choosenim-0.5.1_windows_amd64.zip
02:24:59FromDiscord_<Skaruts> what also confuses me is that the download exes are basically just choosenim with another name and without the dlls
02:25:22FromDiscord_<Skaruts> running it says `could not load: (libcrypto-1_1-x64|libeay64).dll`
02:26:50FromDiscord_<Skaruts> well, exe, singular, I haven't tried the "debug" one
02:39:11*cron joined #nim
02:46:32shashlickYes they are the binaries only
02:47:05shashlickThere should be a runme in the zip, I'll verify later
02:49:09FromDiscord_<Skaruts> ah yes, actually there is
02:49:52FromDiscord_<Skaruts> I did "extract here" instead of into a new folder, so the runme got lost in the middle of all the stuff
02:53:37*cron quit (Quit: Leaving.)
02:55:20*cron joined #nim
03:14:34shashlickOk cool thanks
03:15:07*cron quit (Quit: Leaving.)
03:33:00TangerAm I correct in thinking that the typeinfo module is where I'd be able to inspect properties on objects?
03:36:22*cron joined #nim
03:37:44*cgfuh quit (Quit: WeeChat 2.6)
03:48:52*muffindrake quit (Ping timeout: 248 seconds)
03:51:17*muffindrake joined #nim
04:00:15*marmotini_ quit (Remote host closed the connection)
04:00:20*cron1 joined #nim
04:00:33*marmotini_ joined #nim
04:01:23*cron quit (Ping timeout: 272 seconds)
04:07:57*endragor joined #nim
04:28:45*nsf joined #nim
04:42:37*marmotini_ quit (Remote host closed the connection)
04:43:11*marmotini_ joined #nim
04:47:42*marmotini_ quit (Ping timeout: 265 seconds)
05:06:20FromGitter<Varriount> Tanger: To a certain extent
05:06:50FromGitter<Varriount> You'll also want to look at the macros module
05:07:27TangerVarriount: I ended up using typeinfo and the setX commands available in that lib. I kinda wanted to do it without macros, mainly because I'm working with an object defined in a different library
05:07:47TangerJust took a little while to figure out what and how I'm applying toAny to
05:08:07TangerAlso, the marshal lib source code was a great help for seeing it in action
05:13:34FromGitter<zacharycarter> mratsim: in regards to - `in the Weave devel, i removed the GC constraint` - I installed the Weave using nimble install https://github.com/mratsim/weave.git (I didn't see a devel branch) and I still run into that error
05:17:08*ltriant quit (Quit: leaving)
05:18:04*dddddd quit (Read error: Connection reset by peer)
05:19:59*Cthalupa quit (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in)
05:20:20*Cthalupa joined #nim
05:23:51FromGitter<zacharycarter> weird - but cloning the repo and running nimble install got me passed that error - not sure why nimble + git url didn't do the same thing, but whatever
05:29:28*theelous3 quit (Ping timeout: 265 seconds)
05:30:23*shuffler joined #nim
05:30:55*shuffler quit (Remote host closed the connection)
05:35:32FromGitter<zacharycarter> hmm - according to the manual, regarding gcsafe:
05:35:55FromGitter<zacharycarter> `The invoked proc must not use var parameters nor must any of its parameters contain a ref or closure type. This enforces the no heap sharing restriction.` - does that mean you can't use unsafe pointers as well?
05:37:15FromGitter<zacharycarter> it would appear it does
05:37:47FromGitter<zacharycarter> if the memory it points to is GC'd anyway
05:46:16FromGitter<zacharycarter> well actually - my proc isn't gcsafe for several reasons , so I haven't figured out whether what I asserted earlier regarding an unsafe pointer is true or not
05:48:24FromGitter<zacharycarter> okay yeah - using a pointer actually works, so cool
05:48:33FromGitter<zacharycarter> I was wrong
05:54:50FromGitter<zacharycarter> wellll I got things compiling and running with weave - but my program seg faulted
05:54:57FromGitter<zacharycarter> will have to do more investigation later - need to get ready for work
05:55:14FromGitter<zacharycarter> oh shit - probably because I didn't initialize weave lol
06:02:37FromGitter<kayabaNerve> Does Nim have a cross-platform way of getting the IP behind a domain?
06:04:02FromGitter<zacharycarter> bleh, now - `undefined reference to EnterSynchronizationBarrier` - with mingw windows
06:11:11ZevvkayabaNerve: getaddrinfo
06:11:20FromDiscord_<Skaruts> if my system is 64 bits, shouldn't choosenim install mingw64, instead of mingw32?
06:13:57FromDiscord_<Rika> It installs 32bit by default
06:14:57FromDiscord_<Skaruts> not sure that mingw is the problem though
06:15:19FromDiscord_<Skaruts> thing is, I installed nim through choosenim, and none of my programs run now
06:17:16FromDiscord_<Skaruts> one of them that was built using csfml, I ran the exe that was there from before and it ran fine, and then I compiled it again using the "new" nim and it couldn't load the sfml dlls...
06:18:01FromDiscord_<Skaruts> (despite that they are right next to the exe)
06:19:19FromDiscord_<Rika> Check your path environment variable
06:20:32FromDiscord_<Skaruts> I only have NIMBLE_BIN there
06:21:11FromDiscord_<Skaruts> I had two entries for nim before, and I can't remember exactly what they were...
06:22:07FromDiscord_<Skaruts> well, one was NIM_PATH, and the other was called NIM_C_PATH, but I forgot the actual paths
06:24:19*narimiran joined #nim
06:27:26FromGitter<kayabaNerve> Zevv: Thanks. I got what I needed.
06:28:04FromDiscord_<Skaruts> hmmm, I suppose this is why (by default installs both 32bit nim and mingw): https://github.com/dom96/choosenim/issues/128
06:28:06disbotproposal: on 64-bit Windows, download 64-bit MinGW & Nim
06:32:57*Jjp137 quit (Read error: Connection reset by peer)
06:33:03*Jjp137_ joined #nim
06:35:41*leorize quit (Remote host closed the connection)
06:35:51*cron1 quit (Quit: Leaving.)
06:36:10*leorize joined #nim
06:45:35FromDiscord_<Rika> @Skaruts install 64 bit gcc
06:45:44FromDiscord_<Rika> That should make choose I'm use 64 bit nim
06:45:51FromDiscord_<Rika> Ah yes autocorrect
06:50:54FromDiscord_<Skaruts> where do I get it from?
07:01:03TangerWhat license do you guys select from nimble for projects?
07:01:09TangerNon commercial projects, I should say
07:01:28TangerI always default to MIT because it's first, but is it the best choice?
07:02:56*Pqzcih5 quit (Remote host closed the connection)
07:11:59FromDiscord_<Rika> @Skaruts Uhh, manually install mingw64
07:12:19FromDiscord_<Rika> Tanger, if you like copyfree licencing then yes
07:12:32*livcd quit (Changing host)
07:12:32*livcd joined #nim
07:13:20FromDiscord_<Rika> @Skaruts don't forget to remove the choosenim mingw too
07:13:28FromDiscord_<Rika> Also choosenim nim 32
07:13:45livcddespite the small community this chan is incredibly active!
07:13:55FromDiscord_<Skaruts> so I install it mingw64 somewhere unrelated to nim and nimble?
07:14:06FromDiscord_<Skaruts> and add to path
07:14:07FromDiscord_<Rika> Tanger, personally I use LGPL 3, but that's lightly restrictive
07:14:32FromDiscord_<Rika> Yes, then uninstall old nim then reinstall with choosenim
07:14:51FromDiscord_<Skaruts> alright gonna give it a try
07:15:23FromDiscord_<Skaruts> thanks
07:15:49FromDiscord_<Rika> Don't forget to either reboot or run "refreshenv" after removing from path @Skaruts
07:17:56FromDiscord_<Skaruts> reboot usually doesn't seem to be needed, as far as I can tell
07:18:33FromDiscord_<Skaruts> though I keep that in mind
07:27:09TangerAwesome, thanks Rika
07:36:46*solitudesf- joined #nim
07:51:01*uu91 joined #nim
07:51:26*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
07:55:54*uu91 quit (Remote host closed the connection)
07:59:54*PMunch joined #nim
08:00:00*gmpreussner quit (Quit: kthxbye)
08:03:18FromDiscord_<Rika> Usually reboots aren't needed but they do fix a few issues when it comes to path
08:05:38*gmpreussner joined #nim
08:19:37stefantalpalaruTanger, I like MPL 2.0 - it's like GPL, but limited to file boundaries: https://www.mozilla.org/en-US/MPL/2.0/FAQ/
08:20:04stefantalpalaru"This allows, for example, programs using MPL-licensed code to be statically linked to and distributed as part of a larger proprietary piece of software, which would not generally be possible under the terms of stronger copyleft licenses."
08:31:09FromDiscord_<sbr> Hello folks, new Nim user here.
08:31:09FromDiscord_<sbr> Is there a way to create a "discardable" variable/binding, that doesn't trigger the `is declared but not used [XDeclaredButNotUsed]` warning?
08:31:09FromDiscord_<sbr> For example, in Reason you can do:
08:31:09FromDiscord_<sbr> ```js
08:31:09FromDiscord_<sbr> let _throwAway = "xyz"
08:31:10FromDiscord_<sbr> ```
08:31:11FromDiscord_<sbr> The compiler won't throw a warning.
08:31:13FromDiscord_<sbr> What should I do in Nim?
08:33:13*dadada joined #nim
08:33:14FromGitter<zacharycarter> `discard`
08:33:37*dadada is now known as Guest1482
08:33:40narimiranthere's `{.used.}` pragma
08:33:54FromGitter<zacharycarter> https://play.nim-lang.org/#ix=28bq
08:34:02narimirandon't know if it'll do the trick here
08:34:13FromGitter<zacharycarter> or what narimiran suggested
08:34:36FromGitter<zacharycarter> oh - create a variable - yeah used is probably the right approach
08:34:39narimiransbr, btw, you can't have underscore there in nim ;)
08:35:24narimiranyep, the pragma will work: https://play.nim-lang.org/#ix=28br
08:41:15Guest1482(how) can I get a variable's typename as a string at compile time?
08:41:44PMunch@sbr, you can tag variables and procedures with `{.used.}` to mark them as, well, used. This means that the compiler wont complain if you don't use them (most useful in macros that generate a lot of procedures you might need, otherwise it might be nice to know if you don't use a function any longer). If you have a procedure that returns a value that you don't care about you want to use `discard` to throw that value away. Or if you have written that procedure
08:41:44PMunchyourself you might want to add `{.discardable.}` to make Nim ignore it when you don't use the return variable. You can also do `let _ = myProc()` which is functionally the same as `discard` AFAIK, but that's more useful when unpacking a tuple as in `let (_, x) = (100, 200)`.
08:42:47FromDiscord_<sbr> Thanks, narimaran, PMunch and zacharycarter. That helps.
08:46:01Zevvhttps://marcin.juszkiewicz.com.pl/2019/10/15/how-to-survive-fosdem/
08:48:32FromDiscord_<has1> hi, why doesn't nim do go like concurrency?
08:48:54PMunchGuest1482, depends on how deep you want to go: https://play.nim-lang.org/#ix=28by
08:50:08PMunchJust typename you can get with `getTypeInst(x)`, but if it is a distinct then you might be interested in checking out `getTypeImpl` to dig down to the actual type.
08:55:12*floppydh joined #nim
08:56:14Guest1482PMunch: thanks
08:57:01FromDiscord_<has1> hi, i have asked this before, but how do i use plugin with nim?
08:57:24FromDiscord_<has1> i want to compile code as .dll or .data or whatever and then use this code and call a function from my main nim app
08:58:47PMunchIf you want to load it dynamically on runtime you can use the `dynlib` module: https://nim-lang.org/docs/dynlib.html
09:00:23PMunchIf the dynamic library you load is written in Nim you need to pass --useNimRtl when you compile both your main program and the plug-in, and then compile that dynamic library somewhere to your path (or just locally in the same folder). This makes the main program and the dll able to work with a common GC
09:00:48PMunch(so that you can pass GC'ed memory between your plug-in and your main program)
09:02:47PMunchIf you just want to link against a dynamic library you can check out Nim in action: https://livebook.manning.com/book/nim-in-action/chapter-8/122
09:03:00PMunch(Free chapter)
09:03:36PMunchOh by the way @sbr, please don't post code directly to Discord. It comes through directly to IRC and messes up the chat.
09:03:52PMunchUse a paste site like ix.io, pastebin, or hastebin
09:04:55*marmotini_ joined #nim
09:07:03FromDiscord_<has1> i want to run a function written in nim
09:07:22FromDiscord_<has1> ```
09:07:22FromDiscord_<has1> proc greet() =
09:07:22FromDiscord_<has1> echo "hello world"
09:07:22FromDiscord_<has1>
09:07:22FromDiscord_<has1> when isMainModule:
09:07:23FromDiscord_<has1> greet()
09:07:23FromDiscord_<has1> ```
09:07:24FromDiscord_<has1> this is my plugin code
09:08:03FromDiscord_<sbr> Good to know, I will keep it in mind, PMunch
09:08:28FromDiscord_<has1> but how does the nimrtl thing work? the docs say
09:08:30FromDiscord_<has1> "nim c -d:release lib/nimrtl.nim"
09:08:44FromDiscord_<has1> but there is no file lib/nimrtl.nim, am i supposed to download this somehwere?
09:08:46PMunch@has1, that goes for you too, please don't paste code directly to Discord..
09:09:03FromDiscord_<has1> its literally 4 lines
09:09:03PMunchdisruptek, does disbot have a info shortcut for pastesites?
09:09:40PMunchhas1, that is in the Nim repo, it should be right next to the Nim binary
09:10:25FromGitter<alehander92> hm
09:10:29PMunchhas1, 5 lines, plus two lines for the code start/end marker, so seven lines total. And if you're unlucky someone will say something in the middle of it..
09:10:37FromGitter<alehander92> what kind of plugin is this
09:11:08PMunchI should write an article about that as well now that I think about it..
09:11:20PMunchHow to load dynamic libraries in Nim
09:12:12FromDiscord_<has1> well i want to make it work first
09:12:21FromDiscord_<has1> so its a hello world example
09:12:47*sbr8 joined #nim
09:13:37FromDiscord_<has1> so where is lib/nimrtl?
09:14:04PMunchRight next to the compiler
09:14:09FromDiscord_<has1> user@pc:~$ which nim
09:14:09FromDiscord_<has1> /home/user/.nimble/bin/nim
09:14:25PMunchAh did you install via choosenim?
09:14:29FromDiscord_<has1> yes
09:14:57PMunchThen it is in .choosenim/toolchains/<nim version>/
09:16:11*marmotini_ quit (Remote host closed the connection)
09:18:18FromDiscord_<has1> by the way, the compiler spits out a ton of warnings for this
09:18:22FromDiscord_<has1> like 10x UnusedImport
09:18:32FromDiscord_<has1> 10x XDeclaredButNotUsed
09:18:48FromDiscord_<has1> also lots of "Deprecated"
09:19:10*sealmove joined #nim
09:21:57FromDiscord_<has1> so now i have a file called libnimrtl.so
09:22:17FromDiscord_<has1> So what do I do now? How do i compile the plugin?
09:25:04FromDiscord_<has1> ```
09:25:05FromDiscord_<has1> nim c --app:lib main.nim
09:25:05FromDiscord_<has1> ```
09:25:05FromDiscord_<has1> like this?
09:25:34FromDiscord_<has1> and then the main app with
09:25:35FromDiscord_<has1> ```
09:25:35FromDiscord_<has1> nim c -d:useNimRtl main.nim
09:25:35FromDiscord_<has1> ```
09:28:17*letto quit (Quit: Konversation terminated!)
09:29:08PMunchBoth parts with -d:useNimRtl
09:29:41PMunchAnd all those warnings are normal
09:29:53PMunchAnd please stop pasting things directly into Discord..
09:30:08*letto joined #nim
09:30:13PMunchJust look at this mess: https://irclogs.nim-lang.org/24-01-2020.html#09:25:04
09:31:05FromDiscord_<has1> I am getting
09:31:05FromDiscord_<has1> "libnimrtl.so: cannot open shared object file: No such file or directory
09:31:06FromDiscord_<has1> could not load: libnimrtl.so"
09:31:21FromDiscord_<has1> and yes i copied the file to the directory
09:32:18PMunchTry to run with LD_LIBRARY_PATH=. ./myProgram
09:34:31FromDiscord_<has1> where am i supposed to put this command?
09:34:46PMunchOn your command line?
09:34:55ZevvAr_q, Why is anyway it that arc sinked/moved things get zeroed out? Who cares if the original object still lies around after the operation?
09:36:39FromDiscord_<has1> @PMunch so i run ```LD_LIBRARY_PATH=. ./myProgram```
09:36:40FromDiscord_<has1> gotcha
09:37:19PMunchYes, that environment variable controls where you load libraries from
09:38:50*marmotini_ joined #nim
09:39:34*marmotini_ quit (Read error: Connection reset by peer)
09:39:39*marmotin_ joined #nim
09:42:33FromDiscord_<has1> so now i am getting
09:42:33FromDiscord_<has1> ```
09:42:34FromDiscord_<has1> hello from plugin
09:42:34FromDiscord_<has1> Error loading 'greet' function from library
09:42:34FromDiscord_<has1> ```
09:43:04FromDiscord_<has1> so the plugin function is actually running (it echos this line above) but it still says there was an error?
09:43:42PMunchWhat is the code you use to call it (and again, please don't paste it directly)
09:44:15FromDiscord_<has1> please get over the 2 line copies. I am not going to use pastebin for 2 lines of code
09:44:43PMunchThen I will have to ban you..
09:44:55AraqPMunch, no, please don't
09:44:59PMunchBut to fix your problem you might need to use `extern` or `exportc`
09:45:04Araq2 lines are fine indeed
09:45:05FromDiscord_<has1> then i guess youll have to ban me for copying 2 lines of code
09:45:07*marmotin_ quit (Remote host closed the connection)
09:45:18FromDiscord_<has1> why even have the discord then
09:45:22PMunchAraq, they come through as 4 lines, he should learn to behave..
09:45:58PMunchWe have a todo of getting the Discord bot to automatically create links like the Gitter bot does
09:46:39PMunchBut in the meantime we hope that everyone can be co-operative enough to not spam the chat
09:46:51FromDiscord_<has1> then maybe dont use irc
09:46:54FromDiscord_<has1> if its such a pain?
09:47:18FromDiscord_<Rika> Discord has horrible data privacy
09:47:36FromDiscord_<Rika> I use it because the majority of my friends are here
09:47:47FromDiscord_<Rika> But understand that some people don't want that
09:48:05PMunchI have enough horrible web-apps running, I don't need another.
09:48:27*sbr8 quit (Ping timeout: 240 seconds)
09:48:29FromDiscord_<has1> well someone could just take screenshots of what you say on IRC too. All you say in this public chat is public anyway
09:48:44FromDiscord_<Rika> I don't mean regards chat
09:49:31PMunchBut let's not get this into a discussion of which chat platform is superior
09:49:42FromDiscord_<Rika> Yeah
09:50:17FromDiscord_<mratsim> There is a pinned message on iscord that says "PLEASE don't use multiline message or code snippets". Especially if you want some help.
09:50:26FromGitter<alehander92> has1 sorry, but its very very very very very disrespectful to come into a community and refuse to show a little courtesy
09:50:41PMunchAs I said, you might need `extern` or `exportc` to tell Nim not to mangle the name of your procedure so that it can be found when you try to load it. If you look at the output of `nm myProgram` then you will see what the symbol is actually called in the binary
09:50:43Guest1482can you put a stub for an operator into a template?
09:50:52FromDiscord_<mratsim> We're receptive to bot suggestions, they should cover: matrix, IRC, Discord, Gitter
09:51:07PMunchGuest1482, what do you mean?
09:51:25FromGitter<alehander92> i agree its very annoying to use paste services, but there are plugins/shortcuts/terminal utilities etc for that which make it easy
09:51:29Guest1482for example if you want to do: a op b ( like a + b, or a - b), and then call the template with call(+)
09:51:40FromDiscord_<mratsim> yes
09:52:07FromDiscord_<mratsim> template call(op: untyped): untyped = op(a, b)
09:52:08PMunchYeah, I have a keyboard shortcut that sends my current selection to ix.io, so it's no more work than doing a simple copy-paste to copy a paste link
09:52:24FromDiscord_<mratsim> sorry template call(a, op, b: untyped): untyped = op(a, b)
09:52:31FromDiscord_<has1> @alehander92 i was literally posting a 2 line error message there, what am i supposed to do? Are you telling me to use pastebin to paste 2 lines in there?
09:52:35PMunchIs the current Discord bot a Nim thing, or some pre-existing solution?
09:52:47FromDiscord_<mratsim> actually template call(op: untyped): untyped {.dirty.}= op(a, b) should work
09:53:05*marmotini_ joined #nim
09:53:17FromDiscord_<mratsim> write 2 separate lines, don't paste
09:53:21FromDiscord_<Rika> @mratsim who programmed the bot? Why not automatically use a paste service for multilines
09:53:39FromDiscord_<mratsim> ask @Yardanico ^
09:53:47FromDiscord_<has1> @mratsim huh? What??
09:53:52FromDiscord_<mratsim> AFAIK for the offtopic channel there is a proper bot that supports multiline
09:53:53FromDiscord_<Rika> I'm pretty sure Yardanico is making the we hook version
09:53:57Yardanico@Rika right now the bot just uses matterbridge
09:54:00FromDiscord_<Rika> Webhook I mean
09:54:05FromGitter<alehander92> has1 you can just input the text without discord codeblock formatting, or just use ix.io / another editor shortcut to do that
09:54:06FromDiscord_<Rika> Oh I see
09:54:09PMunchhas1, the bot adds triple quotes to multiline pastes, which adds two lines for each paste
09:54:12Yardanicoyeah, you can check the webhook beta version in https://github.com/Yardanico/ircord
09:54:23Yardanicoit's not stable yet though, need to fix all crashes and changes to the latest discord API
09:54:30FromDiscord_<has1> so the discord codeblock is what annoys you? Not the actual text?
09:54:31PMunchSo if you only have two lines then at least put them on separate lines so they only come through as two lines
09:54:33FromGitter<alehander92> or you can rewrite the bot if you want, after all this is a rule that helps everyone
09:54:47FromDiscord_<Rika> Don't forget to fix upstream too ;;
09:54:56FromDiscord_<Rika> (discordnim is old)
09:55:02FromGitter<alehander92> has1 the fact that it rendered in very unpleasant way in other chat platforms
09:55:16FromDiscord_<has1> @PMunch i was copying the error as is from my cmd and pasting it here to get help
09:55:29PMunchWell, text more than a couple lines annoys us as well. But two lines are generally fine
09:55:34FromDiscord_<Rika> Then take the effort to send the lines in separate messages
09:55:45Guest1482the suggested templates don't work in playground
09:55:47FromDiscord_<Rika> At least with over 2 lines yeab
09:56:03FromDiscord_<has1> i honestly have no idea what you are trying to tell me
09:56:04FromDiscord_<has1> hello from plugin
09:56:04FromDiscord_<has1> Error loading 'greet' function from library
09:56:07FromDiscord_<has1> is this different from
09:56:10FromDiscord_<has1> hello from plugin
09:56:13FromDiscord_<has1> Error loading 'greet' function from library
09:56:14FromDiscord_<has1> ??
09:56:16Guest1482Nim thinks an int literal is given with call(+)
09:56:17FromDiscord_<Rika> Yes
09:56:26FromGitter<alehander92> has1 yes this is much better
09:56:36FromDiscord_<Rika> Newlines aren't separated as messages by the irc bot
09:56:48FromDiscord_<Rika> So they look like one whole message
09:56:53FromDiscord_<Rika> With no newlines
09:56:54FromGitter<alehander92> and yeah one day we need a better bot/bridge, but thats life
09:57:13PMunchhas1, this is the thing I have running on a keyboard shortcut to get ix.io pastes if you want to try it out: https://irclogs.nim-lang.org/24-01-2020.html#09:25:04
09:57:16Yardanicowell ircord actually already has multiline auto pasting support, and editing kind of too :P
09:57:19PMunchWoops: xclip -o -selection -primary | curl -F 'f:1=<-' ix.io | head -c-1 | echo "$(< /dev/stdin)/" | xclip -i -selection clipboard
09:57:31FromDiscord_<has1> i still don't get it. I did the same thing the first time, only that i used a code block around it
09:57:32ZevvPMunch: could the bridges not detect dumps from the other side and create a pastbin/ix dump for the IRC side?
09:57:34FromGitter<alehander92> well then i guess we can try to use ircord? is there a blocker
09:57:34Yardanicoit just tells if the message was modified and resends it, since I didn't find any good diff str lib in Nim
09:57:43PMunchIt grabs your current selection, so it works the same way as Ctrl+C
09:57:46FromDiscord_<Rika> PMunch , dependency on x server :P
09:57:48YardanicoZevv: matterbridge sadly doesn't but ircord does :P
09:57:50FromGitter<alehander92> has1 well .. obviously this is the difference :P
09:58:00FromDiscord_<mratsim> @Guest1482: https://play.nim-lang.org/#ix=28bI
09:58:18Yardanicohttps://github.com/Yardanico/ircord/blob/master/src/ircord.nim#L116
09:58:23FromDiscord_<Rika> Yardanico, doesn't nim have a diff lib right in stdlib? Is it that bad?
09:58:33Yardanicoit wouldn't work for my usecase
09:58:34FromGitter<alehander92> has1 trust me i also prefer to use code blocks on gitter and i did before but it is a pita for the others
09:58:57PMunchZevv, yes that is what we want to happen
09:59:04Yardanicohttps://nim-lang.org/docs/diff.html finds difference between two texts
09:59:09FromDiscord_<has1> So the problem is the code block, not the 2 lines, i can remove the code blocks if its better
09:59:17Yardanicoit only gives you number of changes and start line
09:59:18FromDiscord_<has1> its just a habit to format the block
09:59:29FromDiscord_<has1> either way, this is my code right now:
09:59:30FromDiscord_<has1>
09:59:30FromDiscord_<has1> https://play.nim-lang.org/#ix=28bJ
09:59:35PMunchRika, well yeah. Doesn't have to be though
09:59:47FromDiscord_<mratsim> The 2 lines also render with a strange carriage return character, you can see that in irc-logs.nim-lang.org
09:59:48*marmotini_ quit (Read error: Connection reset by peer)
10:00:00PMunchJust need to find another way to get the current selection and set the clipboard, xclip was just the easiest solution for me
10:00:02*uu91 joined #nim
10:00:14FromDiscord_<Skaruts> @Rika it worked, choosenim installed 64 bits 🙂 thanks
10:00:15FromDiscord_<Rika> Then you realize you're on windows :P
10:00:30FromGitter<alehander92> has1 yeah this would be good for now, and again for everything bigger try to also use some kind of service, sorry for the inconvenience and thanks!
10:00:31Yardanicoalso, just to confirm again, is it okay that ircord decides that a message is big if it's: either more than 2 lines (\n), larger than 500 characters (512 is IRC limit for 1 msg), or has ``` in it (which is used for code blocks usually)
10:00:47FromDiscord_<Rika> Yes
10:00:47PMunchRika, ah well I'm lucky to seldom find myself in that pickle
10:00:52FromGitter<alehander92> yardanico what does it do with big messages?
10:00:54FromDiscord_<Rika> I think that is fine
10:00:58FromDiscord_<mratsim> well, try it and see if there are new complaints
10:00:59Yardanicopaste them to ix.io
10:01:20FromGitter<alehander92> one thing i am afraid about ix.io is that i guess things expire there
10:01:24Yardanicowell yeah
10:01:30FromGitter<alehander92> so if one reads the logs in the future it might be an issue
10:01:31FromDiscord_<Rika> PMunch, I wish that was the same for me too. Old Japanese games prevent me from that though
10:01:35FromGitter<alehander92> but i am not sure for a workaround
10:01:35FromDiscord_<Rika> Anyway
10:01:45PMunchYardanico, yeah that should be fine. But maybe it should be 512 - "<"+username+">".len
10:01:49FromDiscord_<has1> So when i run my above code, it gives me the output "hello from plugin", so it clearly does call the greet function, but then it still errors out, how can i fix this?
10:01:52YardanicoPMunch: ah right
10:02:04FromDiscord_<Rika> PMunch & not +
10:02:05FromDiscord_<has1> So when i run my above code, it gives me the output "hello from plugin", so it clearly does call the greet function from the plugin, but then it still errors out, how can i fix this?
10:02:08FromDiscord_<Rika> Ahahahaha
10:02:22FromDiscord_<Rika> Also parens needed
10:02:28PMunchalehander92, I'm currently running an experiment to see how long the expire is. Seems to be about 2 years
10:02:30FromGitter<alehander92> has1 is there any way to run it under a debugger
10:02:45FromGitter<alehander92> PMunch hm .. we can just send them an email and ask them :P
10:02:46PMunchRika, old games tend to run pretty well under Wine :)
10:02:54FromGitter<alehander92> but its a good experiment :O
10:03:15FromDiscord_<has1> is the function definition even correct? I dont know if it is
10:03:16FromDiscord_<Rika> PMunch, my experience is that the games I tried did not
10:03:20FromDiscord_<Rika> So yeah :/
10:03:20PMunchRika, and sorry I meant & :P Gotten too used to C# *shudders*
10:03:47PMunchalehander92, it's based on wraparound though
10:03:48Yardanicowell if you guys are curious on how ircord works, I can enable it now for bridging #nim-offtopic and offtopic on discord just for a test
10:03:50FromDiscord_<Rika> I say F(#) to that
10:03:57PMunchSo it depends on how many pastes they get
10:04:18PMunchYardanico, sounds like a good idea
10:04:27FromGitter<alehander92> yardanico ok!
10:04:30PMunchRika, yeah there has been some talk around here to start using F#
10:04:41Yardanicostarted it locally on my PC :)
10:04:44Yardanicoit's gonna connect in around 5-10 sec
10:05:04Yardanicoyeah its up now
10:05:36FromGitter<alehander92> has1 where is the .so on your actual filesystem
10:05:41FromGitter<alehander92> is it near the binary
10:06:22FromDiscord_<has1> yes
10:06:29FromDiscord_<has1> but look at the output!
10:06:52FromDiscord_<has1> it prints "hello from plugin" it clearly does call the greet function
10:09:55PMunchhas1, the plugin.nim is still the main module when you compile it as a library
10:10:09Guest1482the operator doesn't get recognized as an identifier when you put it into call(+)
10:10:14PMunchSo that code is put in a part of the so that gets automatically run on load
10:10:21PMunchThat's where the message comes from
10:10:27FromGitter<alehander92> hm but one is libmain.so and the other is different?
10:11:28PMunchBut if you add `{.exportc.}` to the greep procedure it will keep the name greet, and not be named "greep_<some deterministic name mangling string>" (again, take a look at the output of `nm ./myProgram` to see the actual name)
10:12:03PMunchGuest1482, try with backticks around the operator
10:12:14Guest1482already have tried it
10:12:59PMunchGuest1482, like this? https://play.nim-lang.org/#ix=28bP
10:13:03PMunchBecause that works
10:14:21FromGitter<alehander92> and notice a op b wouldnt work
10:15:08Guest1482PMunch: made a stupid error, you're right, of course it works! :D
10:16:10FromDiscord_<has1> oii it seems to work now!
10:16:30FromDiscord_<has1> but what is the difference between
10:16:30FromDiscord_<has1> "proc greet() : string {.exportc.} = "
10:16:37FromDiscord_<has1> and
10:16:37FromDiscord_<has1> proc greet() : cstring {.exportc.} =
10:16:42FromDiscord_<has1> both seem to work
10:16:48Yardanicocstring has a null terminator while string doesn't
10:16:54Yardaniconull terminator for C compatibility
10:17:24Yardanicosee https://nim-lang.org/docs/manual.html#types-cstring-type
10:17:56FromDiscord_<has1> so i can just use string for my nim code?
10:18:11Yardanicowell, you only need to use cstring when you're interfacing with C anyway
10:18:12FromDiscord_<has1> i would use cstring if i was calling a c lib?
10:18:16Yardanicoyou don't have to use cstring in your nim code really
10:18:39Yardanicobut I'm not sure about your case with dynlib and stuff though, there's GC involved
10:19:24PMunchcstring is the same as char *, a Nim string is an object with size, capacity, and a pointer to a cstring.
10:20:01PMunchSince both your parts are using Nim and you use nimrtl you can safely use regular Nim strings.
10:22:43*theelous3 joined #nim
10:23:01FromDiscord_<has1> can i also use loadLib with the actual bytes of the plugin instead of a filepath?
10:23:24PMunchNo
10:23:37PMunchYou would have to write them to a file first
10:23:41FromDiscord_<Rika> Bytes of the binary or the source????
10:24:02FromDiscord_<has1> of the plugin.so file
10:24:17FromDiscord_<Rika> Don't think so, no
10:24:34PMunchloadLib uses the operating systems dynamic loading procedures, which only accepts files
10:25:24FromDiscord_<has1> so if you had a paid plugin, what would prevent someone from just giving the plugin file to someone else?
10:25:29FromDiscord_<has1> and then they can use that
10:26:04FromDiscord_<Rika> That's out of the scope of dylib
10:26:08PMunchWell, nothing, that's why you have huge companies that tries to create ways of solving digital distribution :P
10:26:09FromDiscord_<Rika> Dynlib
10:29:07Yardanico@has1 obviously there would be some kind of protection then
10:29:27Yardanicobut most of it is crackable anyway
10:30:41Guest1482created some pseudo code, I'm going to implement something like this with macros/templates, I'm not suggestion to make this official part of Nim, but still would like to get a review of this idea: https://pastebin.com/pkgauA1s
10:30:53Guest1482s/suggestion/suggesting
10:30:59*solitudesf- quit (Quit: Leaving)
10:31:18*solitudesf joined #nim
10:31:19*surma quit ()
10:31:34*surma joined #nim
10:32:10*Guest1482 is now known as dadada
10:33:14dadadaI think it would make long case-of ladders more readable and hence easier to maintain
10:33:17PMunchGuest1482, oh cool that is indeed helpful
10:33:33PMunchs/Guest1482/dadada
10:33:33dadadaGuest1482 == dadada :D
10:33:41FromDiscord_<Rika> I see
10:34:10PMunchYeah I had a sneaking suspicion that might be you :P
10:34:20Araqthe idea is good but today's Nim can easily do it already via its macro system
10:35:15Araqand the only reason why the VM is copy&paste code is that the VM empowers Nim's macro system so when I wrote it the macro system wasn't stable enough to use
10:35:29Araqchicken and egg
10:35:34narimiranam i missing something? shouldn't this be doable even without macros?
10:36:13Zevvoi Araq. Can I bother you with some questions again? 1) what is the reason that after a move/sink the source memory gets zeroed out? 2) Would it make sense to (partly) consolidate the seqs_v2/strs_v2 implementations?
10:36:23narimiranok, now i see some added details like `opc<when>Float`
10:36:38dadadaAraq: please do not think I'm criticizing your code's quality, this something I've seen in all languages, I just wanted to pick an example, not picking on you or Nim in the least!
10:36:46Araqnarimiran, it's perfectly doable with Nim's macros anyway.
10:36:59Araqdadada, yeah I know and I am not offended.
10:37:04dadada:D puh
10:37:14Araqbut you need to be aware that Nim itself wasn't always written in Nim.
10:37:27dadadatotally get that!
10:38:09AraqI can write a 'dispatch' macro that does away with the boilerplate.
10:38:18PMunchYeah this is a pretty common pattern, would be nice to have a clean solution :)
10:38:39Araqthe problem is that you can't, yet. and that you don't know we can already do it. ;-)
10:38:43FromDiscord_<alehander42> dadada i think this is very interesting
10:39:48AraqZevv, we need to 'disarm' the destructor
10:39:55FromDiscord_<alehander42> but i'd solve it like having just a single decode..; regs[ra].floatVal = apply(operationFor(kind), regs[rb].fl.. , other)
10:40:41Araqdadada, for newer code we indeed use Nim's advanced features now that they are reasonable stable.
10:41:12FromDiscord_<alehander42> apply generates a nkCall, and operationFor returns *somehow* an operation/function
10:41:15Araqof course, usually fixing bugs and writing new code is more important than rewriting old, working code.
10:41:42ZevvAraq: So the distructor somehow looks at the content of the memory and zeroing disarms it. Does that imply that I can't destruct an object that contains only zeros by itself?
10:42:10Araqyeah, kind of, that's what it means
10:42:24AraqI mean the =destroy is called either way
10:42:34Araqbut there is little to be done inside if it's all zeros
10:42:41FromDiscord_<alehander42> and operationFor now is a simple mapping between enum values and operators : i think thats very close to what i'd do in dynamic lang like lisp/python
10:43:10FromDiscord_<alehander42> but oftemplate is also interesting in its own way, but i think it can be kinda done as a macro
10:43:49ZevvAraq: create object X which wraps a file descriptor and has a destructor that closes the fd. I make a deamon that first closes all fds include stdin/stdout/stderr and then instantiate one of these objects. That opens a file and gets fd 0. The =destroy runs and the file is never closed.
10:43:50dadadaalehander42: I'll try to implement it as a macro
10:43:55FromDiscord_<alehander42> hm, i even suspect`<when>` can be supported as syntax if one tries
10:44:43FromDiscord_<alehander42> ok!
10:45:39dadadait'll probably become a nimble package when I'm done ^^
10:46:02AraqZevv, this is a bad idea for plenty of reasons
10:46:29Araqbut apart from that, use a 'valid: bool' flag inside
10:46:47Araqor store fd+1 inside so that 0 is free to mean "nothing here"
10:47:01ZevvSuure, all fine. But you can't deny it is unexpected.
10:47:35FromDiscord_<alehander42> dadada sounds good! i still prefer the `apply/call` code, but many people seem to like different style of reuse
10:48:19AraqZevv, I'm not denying anything but Nim's "default zero" choice is too good for performance to abandon it
10:49:19FromDiscord_<alehander42> but still, `opc<when>Float` vs `opc{when}Float` or `opc[when]float`
10:49:24FromDiscord_<alehander42> not sure about that
10:49:26Zevvof course, just mean that it should be documented
10:49:45AraqI think it is.
10:49:56Araqhowever there is more going on for files
10:50:14Araqwhich makes this problem disappear. kind of.
10:50:22dadadaalehander42: me neither
10:50:34AraqI won't mention it in my talk because my talk is becoming too long already
10:50:38ZevvAnother one then: http://ix.io/28bY - is this correct?
10:51:49Araqyes. for now.
10:52:07Araqwe will remove 'wasMoved+destroy' pairs.
10:52:24Araqand then the spurious destructor calls will disappear
10:52:32Zevvok, thanks
10:52:41Araqhnmm
10:53:08Araqwait a sec, I think that's a bug for today's implementation too :-)
10:54:23Zevvalso - contrary to what I understand from the zeroed memory - if I create only one 'foo' with `val: 0`, I still get 3 destructor calls
10:54:59dadadaalehander42: I'm also considering a more flexible syntax oftemplate opc<op: untyped>Float<op2: untyped>: , when op == Add: `+` when op2 == PowerOfTwo: `^2`
10:55:29Araqdadada, please explore what's possible in Nim before inventing your own inferior syntax
10:56:18dadadaAraq: will do! it's nothing but a template (pun) for a special type of template I was pondering
10:56:59Araqmaybe after 14 years of development it's rather well though-out and pleasant to use.
10:57:46Araqand reasonably feature complete too. I dunno, maybe.
10:58:40AraqZevv, strange, worth investigating. ping Clyybber
10:59:57*abm joined #nim
11:08:28FromDiscord_<alehander42> Araq his syntax can almost be done with a macro
11:08:58FromDiscord_<alehander42> but i agree, try to not overdo it for edge cases
11:09:40FromDiscord_<alehander42> after all the problem you solve is reuse: you want to pass a custom operation to some arguments
11:09:46dadadaalehander42: I might find a better syntax, first I've to collect a number of example use cases to know what the pain points are
11:10:05*NimBot joined #nim
11:10:18FromDiscord_<alehander42> so you dont have to tie it to case/if and other constructs
11:10:35dadadaalehander42: yes, the custom operation is just an example, it could also be a custom integer, string, or anything else you can do in a template
11:10:47FromDiscord_<alehander42> hm yeah more usecases wold be good
11:12:11FromDiscord_<alehander42> but yeah syntax experimentation is fun
11:12:37FromDiscord_<alehander42> what do you think about https://github.com/alehander42/poly
11:12:59FromDiscord_<alehander42> it was inspired by nims older rewrite constraints i think
11:13:06FromDiscord_<alehander42> but i think its too limited probably
11:14:41*sbr8 joined #nim
11:15:53*sbr88 joined #nim
11:17:35sbr88Hi, I'm having problems installing packages via nimble in docker. I've downloaded the semi-official nimlang docker image. But I always get "execution failed". The strange thing is that the command outputs `-o "/usr/src/app/src/myProgram" "/usr/src/app/src/src/myProgram.nim"
11:17:56sbr88The first line is correct, but in the second line the command puts in an extra "src"
11:18:27sbr88And then nimble tells me [OSError] no such file or directory
11:19:03sbr88Can I manually pass the -o flag? It doesn't work with `nimble install -o "/usr/src/app/src/myProgram"
11:19:24*sbr8 left #nim (#nim)
11:25:49dadadaalehander42: poly deserves a more descriptive name. Maybe "discriminate"? (to discriminate can also mean to make a difference between)
11:26:02dadadaotherwise thanks for letting me know about it
11:26:03dadada:D
11:29:08*marmotini_ joined #nim
11:29:09*solitudesf quit (Ping timeout: 272 seconds)
11:31:16*JustASlacker joined #nim
11:33:38FromGitter<alehander92> i was coming from `polymorphism` i think
11:33:47FromGitter<alehander92> but probably not a great name
11:34:11*marmotini_ quit (Ping timeout: 265 seconds)
11:34:26dadadaalehander42: poly also has a meaning of being different from in addition to many and more (what I thought about), as I just found out, maybe it's fine :D ... the name is okay, it just didn't click immediately with me
11:34:27*dddddd joined #nim
11:34:36*cgfuh joined #nim
11:34:58FromGitter<alehander92> yeah exactly
11:35:05FromGitter<alehander92> but i suspect pattern matching is more useful
11:35:09FromGitter<alehander92> for dispatching case objects
11:35:25*marmotini_ joined #nim
11:35:43FromGitter<alehander92> i just liked the way you can define different "overloads" based on pattern matching in erlang/elixir
11:35:54FromGitter<alehander92> but you can still do this in a pattern matching lib
11:36:32*sbr88 left #nim ("leaving")
11:37:10*sbr88 joined #nim
11:43:07*marmotini_ quit (Remote host closed the connection)
11:43:16*marmotini_ joined #nim
11:47:58*marmotini_ quit (Remote host closed the connection)
11:52:11*marmotini_ joined #nim
11:56:42*nsf quit (Quit: WeeChat 2.7)
11:56:53*marmotini_ quit (Remote host closed the connection)
12:03:43*solitudesf joined #nim
12:06:14*Vladar joined #nim
12:11:33*marmotini_ joined #nim
12:22:07*marmotini_ quit (Remote host closed the connection)
12:23:10FromDiscord_<has1> hi, how do i do concurrent stuff in nim?
12:23:21*sbr88 quit (Ping timeout: 268 seconds)
12:24:03FromDiscord_<has1> A simple example is this, i have numbers from 1..10000
12:24:04FromDiscord_<has1> i want to hash(i) and if the hash == given then i want to abort all other "coroutines"/ "threads" and print the result
12:25:01*marmotini_ joined #nim
12:25:16*marmotini_ quit (Remote host closed the connection)
12:25:23PMunchhas1, threadpool might be of interest: https://nim-lang.org/docs/threadpool.html
12:25:24*marmotini_ joined #nim
12:26:07PMunchOr you could try out Weave: https://github.com/mratsim/weave mratsim, is this stable enough to try?
12:33:01*marmotini_ quit (Remote host closed the connection)
12:34:58*marmotini_ joined #nim
12:38:53*marmotini_ quit (Remote host closed the connection)
12:41:29*seni joined #nim
12:44:47Yardanicojust an update on ircord bridge - I've implemented banning of users on Discord from IRC
12:45:06Yardanicoso every person who is in the config of trusted users (I've put all OP users from #nim channel currently, and myself for testing :D) can just do
12:45:12Yardanico!ban Username#1234
12:45:16Yardanicoand that person will be banned on discord
12:55:08Yardanicowhat would be the preferred name for ban command for discord users?
12:55:16Yardanico!bandiscord ?
12:56:15Zevvdisruptek: https://github.com/dspinellis/git-issue
12:56:30Yardanicohmm, !bandisc sounds nice lol
13:06:45*nsf joined #nim
13:13:59Yardanicoif someone wants to test ircord, it's currently bridging #nim-offtopic on IRC and #offtopic on Nim discord server
13:18:58FromDiscord_<yewpad> Can somebody elaborate on why Nim's got this awkward dark-ish green 'language color' on GitHub?
13:19:17*uu91 quit (Ping timeout: 268 seconds)
13:26:16*endragor quit (Remote host closed the connection)
13:26:59*nsf quit (Quit: WeeChat 2.7)
13:28:29FromDiscord_<Rika> Because github is weird
13:29:04Yardanicoall colours are predefined
13:29:11Yardanicohttps://github.com/github/linguist/blob/master/lib/linguist/languages.yml#L3411 nim colour
13:29:29Yardanico#37775b
13:32:22FromGitter<zacharycarter> mratsim: is there any documentation for weave regarding parallel tasks and the gc?
13:35:41FromGitter<zacharycarter> I'm getting an error intermittently - ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e2af2adf85dba0aab08832b]
13:36:06*FromGitter quit (Remote host closed the connection)
13:36:07*oprypin quit (Quit: Bye)
13:36:29*oprypin joined #nim
13:39:53*Kaivo joined #nim
13:48:29*marmotini_ joined #nim
13:51:03*marmotini_ quit (Remote host closed the connection)
13:54:17*marmotini_ joined #nim
13:59:37*r4vi quit ()
13:59:54*r4vi joined #nim
14:00:20Yardanicono FromGitter?
14:02:58PMunchYardanico seems to have died..
14:03:05Yardanicoyeah
14:05:24*zyklon quit (Ping timeout: 248 seconds)
14:11:07*zyklon joined #nim
14:13:44*FromGitter joined #nim
14:23:46*krux02 joined #nim
14:24:27*marmotini_ quit (Remote host closed the connection)
14:26:29ZevvIs there a good reason why `string` is not simply the same as `seq[char]`?
14:26:56FromDiscord_<Clyybber> Not really
14:27:06FromDiscord_<Clyybber> Zevv: Btw, that too many =destroy issue
14:27:10FromDiscord_<Clyybber> Its kinda expected
14:27:35FromDiscord_<Clyybber> You are supposed to do if f != zeroedOut: ... in the destructor
14:28:29*marmotini_ joined #nim
14:32:55*marmotini_ quit (Remote host closed the connection)
14:33:26*marmotini_ joined #nim
14:34:41FromDiscord_<Clyybber> But I guess the dfa could be a bit smarter
14:35:07FromDiscord_<Clyybber> But its getting into the domain of z3 here
14:35:53ZevvIs the zeroedOut() not something the codegen should do for me?
14:36:12FromDiscord_<Clyybber> the if case?
14:36:13FromDiscord_<Clyybber> no
14:36:19FromDiscord_<Clyybber> It must be in the destructor
14:36:46FromGitter<zacharycarter> @Lecale - not sure if this works with directories, but.... - https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/os.nim#L1123
14:36:48Zevvyeah but it could (Should?) only call the distructor if zeroedout
14:36:48FromDiscord_<Clyybber> As of now it also must be in the =sink and in `=`
14:37:02FromDiscord_<Clyybber> Zevv: With the current design no
14:37:14FromDiscord_<Clyybber> see destructors.rst
14:37:17Zevvok, that makes sense - with the current design
14:37:30FromDiscord_<Clyybber> Reminds me
14:37:35*marmotini_ quit (Remote host closed the connection)
14:37:42*marmotini_ joined #nim
14:37:50ZevvDid you also see the other issue, about zeroing out const data?
14:38:03FromDiscord_<Clyybber> I glanced over it while half asleep
14:38:13ZevvI typed it while half asleep
14:38:30FromDiscord_<Clyybber> :p
14:38:53AraqI fixed it half asleep
14:38:58Araqbut only in my head :P
14:39:03FromDiscord_<Clyybber> hehe
14:39:20ZevvI fixed it. Just take the 'NIM_CONST' out of the codegen :)
14:42:00*floppydh quit (Quit: WeeChat 2.7)
14:42:20FromDiscord_<Clyybber> heh
14:42:30FromDiscord_<Clyybber> Zevv; Does it also occur with seqs?
14:42:41Zevvit *is* the seq that does it
14:43:44Zevvbtw, the "too many seqs" issue can be closed then?
14:43:55Zevv(imaging *talking* about these things instead of writing)
14:44:58FromDiscord_<Clyybber> Zevv: Yeah
14:45:52FromDiscord_<Clyybber> To "fix" it we would have to make the dfa aware that in `a.setLen a.len + n` all succeeding writes to a[oldLen..oldLen + n] are firstWrites
14:46:51Araqemplace_back!
14:47:25Zevvbrrr
14:48:54Zevvaraq, can you tell me as well: is there a good reason why `string` is not `seq[char]`?
14:49:26Araqcstring(s) is O(1)
14:50:00Araqthere are plenty of good reasons. strings are usually not used like 'seq[char]'
14:50:23*jholland__ joined #nim
14:50:50Araqthey are in UTF-8. and maybe we want to support non-copy slicing for them via some runtime switch
14:51:05Araqmaybe we want to make them COW
14:51:07Zevvbut nim guarentees they should be intercastable, right?
14:51:27Araqcurrently Nim does that but I don't see how we can keep this promise for forever
14:51:35Zevvah right. that makes sense.
14:51:53FromGitter<alehander92> but is this true for the js backend
14:52:17FromGitter<alehander92> hm yeah it is
14:52:23FromGitter<alehander92> i forgot its an array there as well
14:52:51Araqstrings are hard
14:54:11Araqbtw I noticed --threads:on --gc:arc is 3x slower :-)
14:54:12FromGitter<alehander92> yeaa
14:54:44Zevvalso with useMalloc?
14:55:01Araqa single mutex around alloc is bad, let's use malloc. same thing, 3 times slower.
14:55:22Zevv:)
14:55:23Araqbut to be fair I haven't tested mimalloc yet
14:55:26*PMunch quit (Quit: Leaving)
14:56:26Araqfor other tests mimalloc was slower though, a shared heap is an expensive abstraction
14:59:00Araqmaybe we need a SmallSeq, SmallTable, SmallX...
15:01:30FromGitter<alehander92> the opposite of SharedSeq ?
15:02:59FromGitter<Varriount> Araq: What about a cache of free blocks, local to each thread?
15:04:09*tane joined #nim
15:04:15FromGitter<Varriount> Or this: https://github.com/Begun/lockfree-malloc
15:08:18*abm quit (Quit: Leaving)
15:09:14*marmotini_ quit (Remote host closed the connection)
15:09:40*marmotini_ joined #nim
15:13:41FromDiscord_<Clyybber> Araq: Do you have an idea on how to do emplace_back?
15:14:11*salewski joined #nim
15:14:23*marmotini_ quit (Ping timeout: 260 seconds)
15:16:49salewskiAraq, maybe you should edit the ARC forum post because ARC is much better now. Async and finalizers seems to mostly work now.
15:17:06salewskiBecause some people may read only the topmost post.
15:18:23salewskiAnd maybe fix -gc:arc as it is --gc:arc, and tell peole that deepcopy does currently not work with arc.
15:18:41salewskiBye.
15:18:44*ng0_ joined #nim
15:20:10*salewski quit (Quit: WeeChat 2.6)
15:20:56FromGitter<iffy> I can't get password reset to work on Forum. After resetting my password it says "Invalid username or password"
15:21:31FromGitter<alehander92> oh sorry this seems to happen often
15:22:13*ng0 quit (Ping timeout: 272 seconds)
15:22:22FromGitter<iffy> I'm using Firefox if that makes a difference
15:27:19leorize~forum
15:27:20disbotforum: 11Nim has a forum at https://forum.nim-lang.org/ -- ask @dom96 for help with any account issues.
15:27:51AraqClyybber: well we know it's system.add for seqs, we can cheat
15:29:40AraqVarriount: thread local caching is a standard technique
15:29:55Araqprobably my malloc is simply old crap.
15:37:25*marmotini_ joined #nim
15:40:30Araqping disruptek
15:40:53Zevvdown and out drunk again probably
15:41:04*JustASlacker quit (Quit: Leaving)
15:42:07*Pqzcih5 joined #nim
15:42:16Zevv@clyybber: will you be visiting fosdem by chance?
15:42:30disruptekwut
15:42:41Araqdoes nimph work with --gc:arc now?
15:42:49*marmotini_ quit (Ping timeout: 265 seconds)
15:42:50disruptekno because it relies upon nre.
15:43:01*nsf joined #nim
15:43:48Araqnre could work...
15:43:58disruptek!search backend segfaults
15:43:59disbothttps://github.com/disruptek/nimph/issues/116 -- 3c++ backend segfaults 7& 13 more...
15:44:17disruptekalso, it hasn't built in c++ in a very long time.
15:44:25disrupteki dunno why someone cares, but...
15:44:33FromDiscord_<Clyybber> Zevv: Nope, sadly not 😦
15:48:31*icebattle joined #nim
15:50:27Zevvbumr!
15:51:55disrupteksucks.
15:53:03*lritter joined #nim
15:53:15Zevvdan toch maar RDR2 he
15:53:17Zevvcoop missies
15:53:49disruptek~paste is a frowned-upon behavior in chat; please use a service such as http://ix.io/ or https://gist.github.com/ and supply us a URL instead.
15:53:49disbotpaste: 11a frowned-upon behavior in chat; please use a service such as http://ix.io/ or https://gist.github.com/ and supply us a URL instead.
15:54:39Araqmore results: with 'owned' and --newruntime the timings are identical
15:55:08Araqthere is no reason not to reference count if you never really count
15:55:36ZevvEWRONGWIN, sorry
15:55:46disruptekZevv: i don't wanna store issues in git; GitHub is too nice a tracker.
15:56:18*ptdel joined #nim
15:57:34*krux02 quit (Remote host closed the connection)
15:58:00disruptekbarrier of entry waaay to high.
15:58:10*ng0_ is now known as ng0
16:07:38narimirandisruptek: about pasting services. why not mention the most useful one - nim playground?
16:07:45Yardanicoit uses ix.io though
16:07:53Yardanicobut yeah
16:08:16disruptekoh i forgot the bot doesn't send you guys the urls. just me.
16:08:39disruptek~paste is a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead.
16:08:39disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead.
16:15:08*zedeus_ joined #nim
16:15:39disrupteknow when someone pastes, we'll have three people posting ~paste and three long messages from the bot explaining how not to spam.
16:16:03*zedeus quit (Ping timeout: 240 seconds)
16:16:11FromDiscord_<Clyybber> amazing
16:16:58*kadin joined #nim
16:17:14FromGitter<Varriount> The future is now!
16:18:52*setenforce quit (Ping timeout: 260 seconds)
16:19:21*cron joined #nim
16:19:43*ng0 quit (Ping timeout: 260 seconds)
16:20:00*ng0 joined #nim
16:20:00*ng0 quit (Changing host)
16:20:00*ng0 joined #nim
16:22:20*salewski joined #nim
16:23:56salewskiAraq, nice edit, but one big advantage of ARC is that it is deterministic, and that is not really mentioned in that post!
16:24:29salewskiWell, maybe hidden in the other points.
16:30:32Araqmeh ok, maybe.
16:31:33Araqfor me the most important aspect is that it composes so much better
16:31:33*sealmove quit (Quit: WeeChat 2.7)
16:31:34salewskideterministic is a great Schlagwort and a real benefit. Bye.
16:31:58Araqyeah, it's faster and yeah it uses less memory.
16:32:28Araqbut it also works with customized memory management.
16:33:01Araqand can close my files.
16:34:14salewskihttps://forum.nim-lang.org/t/5825#36241 is a disadvantage still, but maybe someone can fix that later.
16:34:16leorizeAraq: can you take a look at #13201?
16:34:18disbothttps://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default
16:34:51narimiransalewski: what's going on? you forget to write 'bye'!
16:35:47salewskiI am not in such a hurry currently. But I can not sit the whole day on IRC as some of your guys.
16:36:00*narimiran thumbs up
16:36:22salewskiBye.
16:36:25*salewski quit (Quit: WeeChat 2.6)
16:36:41zedeus_so polite
16:42:38*abm joined #nim
16:43:59disrupteknothing good ever came from inheritance in nim.
16:48:11*UNIcodeX joined #nim
16:50:45FromDiscord_<Clyybber> Isn't this about inheriting from parent processes?
16:51:10disrupteki'm referring to salewski's problem.
16:52:03FromDiscord_<Clyybber> ah, I see
16:53:32*marmotini_ joined #nim
16:56:13*zedeus_ is now known as zedeus
16:58:22*cron quit (Quit: Leaving.)
17:02:10*marmotini_ quit (Remote host closed the connection)
17:06:38*sealmove joined #nim
17:06:45disruptekTHE MIND IS GOD
17:08:11*marmotini_ joined #nim
17:10:32sealmovePMunch: is https://github.com/PMunch/jsonschema in appropriate state for use?
17:14:06FromDiscord_<Rika> > nothing good ever came from inheritance in nim.
17:14:06FromDiscord_<Rika> pretty sure it goes "nothing good ever came from inheritance"
17:15:24disruptektell me about it.
17:15:26Zevvoh #13201, sweet. It might lead to the occasional suprise of someone expecting his fds to survive a fork, but I bet it will prevent tons of issues in the future.
17:15:27disbothttps://github.com/nim-lang/Nim/pull/13201 -- 3Make file descriptors from stdlib non-inheritable by default
17:16:41*marmotini_ quit (Remote host closed the connection)
17:17:14*marmotini_ joined #nim
17:20:35*vivus joined #nim
17:20:46*Vladar quit (Quit: Leaving)
17:22:08*marmotini_ quit (Ping timeout: 260 seconds)
17:27:40disruptekshashlick: your read-options-from-compiler is gonna encourage people building more whens into their code, right? doing things like, "if package foobar is in the path, import it"
17:27:58disruptekthat's gonna break some assumptions i want to make.
17:28:33disruptekie. currently there's no way to conditionally import.
17:30:18leorizewhen: import does work?
17:30:25disrupteks/conditionally/opportunistically/
17:31:58lqdev[m]leorize: technically it should, when does not introduce a new scope
17:32:03*muffindrake quit (Quit: muffindrake)
17:32:15*muffindrake joined #nim
17:32:19disruptekit should, it does.
17:32:24leorizeit does
17:32:29leorizeused everywhere in the stdlib :P
17:32:37disrupteki'm talking about determining whether a package is available for import.
17:32:46disruptekand then importing it.
17:32:52leorizeit's doable
17:32:58leorizenimble list -i is parsable
17:33:08disruptekso is `nimble path`.
17:33:14disruptekbut i think this is a dangerous road.
17:34:12disruptekthis is the one thing that has always been a problem with every significant project of mine, due to nimterop.
17:34:58disrupteknot that it's shashlick's fault, of course. but we want less of this, not more.
17:35:00shashlickthat PR, which is dormant since I've not had the time, was to acces command line options
17:35:10shashlickis that what you are talking about
17:35:19disrupteki think so. you cannot use it to get paths?
17:35:54shashlickyes i believe so
17:36:40sealmoveis it possible to get parent node in nim json?
17:36:40shashlickif there was a way to import if installed, i think it would solve all this
17:36:50sealmoveor have to do your own book keeping?
17:36:54shashlickwhen compiles doesn't work with imports
17:38:19disruptekright, i'm saying that this is something of a virtue right now.
17:38:23disruptekit's a tight spec.
17:38:36disruptekwe might be making a mistake to weaken the guarantee.
17:43:11shashlickwe are allowed to check so many other things, why not this
17:44:31*Ven`` joined #nim
17:44:34disruptekyeah, i could be overthinking it.
17:44:35*vivus quit (Quit: Leaving)
17:44:57shashlickbut ya, features can always be used in unintended ways
17:45:07shashlicknimterop lives in that space
17:45:07disruptekbut consider how complex that makes analyzing behavior outside the compiler.
17:45:46disrupteki think we should keep the interface between compile-time and the environment as carefully defined as possible.
17:46:03disruptekit seems to be something we really don't understand yet.
17:46:47disruptekdon't think about the use of these tools today. think about designing a language for 10 years down the road.
17:47:13disruptekwe hope to have decade-old code to work on in 10 years. let's choose what that code looks like.
17:48:40shashlicki agree 100% but at the same time the pleasure of working in Nim for macros and compile time is a big plus
17:48:53shashlickinstead of some random second cousin language like the preprocessor
17:49:13shashlickor having elaborate stuff like make, cmake, etc
17:49:39disruptekdo you want to have to fight a 10-year younger version of yourself, with the vm as the arena? i'm good, but i'm getting old. i'm a shadow of myself 10 years ago.
17:50:29shashlickpretty much everyone here is half my age
17:51:01disruptekthing is, about half of us say that.
17:51:34FromDiscord_<Rika> til slashlick is like 50 or something
17:51:40FromDiscord_<Rika> maybe 60 even
17:52:48disrupteki wanna say gordon and sheerlu_k are in their 50s.
17:52:50shashlickmaybe i'm exaggerating but chalk it up to remembering less math than my 4th grader
17:53:07disruptekokay, shashlick has a 4th grader... how old are those?
17:53:34Araqconditional imports are from hell IMO.
17:53:38disrupteki feel like one of you who wasn't raised by wolves would know.
17:53:40shashlickokay now someone tell me how to find out arch of processor or this choosenim 64-bit installs on windows is not going to happen
17:53:53shashlickmy older one is in 7th grade
17:54:17disrupteki was held back.
17:54:19disruptekall my life.
17:54:39disrupteki'm fine with choosenim not supporting 64bit windows.
17:54:40Araqshashlick, there is an environment variable
17:55:16shashlicknifty
17:55:28shashlickwondering if it was there on 32-bit windows as well
17:55:38disruptekshit, even i knew that shashlick.
17:55:44disruptekwhat are you, like, 100 years old?
17:56:05disrupteki feel like 7th graders are like 13 or 14, right?
17:56:24FromDiscord_<Rika> 7ths are 12 or 13
17:56:46disrupteki guess i like 'em a little older.
17:57:00FromDiscord_<Rika> out of context screenshot time
17:57:26shashlickyep, cannot wave the boomer flag or anything
17:58:24disruptekyou know, gordon is older than that. i think he's early sixties.
17:58:31shashlicklast of the gen x
17:59:03disruptekgenx ends at, what, '79?
17:59:04Araqif PROCESSOR_ARCHITECTURE == AMD64 (
17:59:04Araq SET ARCH=64
17:59:04Araq )
17:59:19Araqecho %PROCESSOR_ARCHITECTURE%
17:59:50disrupteki think that headache bears medical attention, araq.
18:00:14disruptekyou just don't seem like yourself.
18:03:57*abm quit (Ping timeout: 265 seconds)
18:04:11shashlickmaybe i should fix recent choosenim issues than adding new features
18:05:23Araqshashlick, lack of 64bit support is the biggest bug
18:07:15shashlickdeal
18:07:19Araqdisruptek, thanks for your concern, I'll be fine again soon
18:07:47shashlickhttps://blog.differentpla.net/blog/2013/03/10/processor-architew6432/
18:09:01Araqshashlick, I copied it from our build.bat
18:09:25Araqand are unaware of reported bugs, so it's fine
18:11:01*cron1 joined #nim
18:11:29shashlickya since this will be compiled into choosenim which could potentially have a 32-bit build running on 64-bit, we will need to be more careful
18:13:09*sagax quit (Remote host closed the connection)
18:14:25shashlickheh, uname -m on my windows box says i686 when it is x64
18:28:37*sealmove quit (Quit: WeeChat 2.7)
18:31:35*chemist69 joined #nim
18:37:31*nsf quit (Quit: WeeChat 2.7)
18:41:25FromDiscord_<Clyybber> the hell
18:41:35FromDiscord_<Clyybber> shashlick: Which distro?
18:51:03shashlickOn windows with git bash
18:52:34*UNIcodeX quit (Quit: Leaving)
19:05:59FromGitter<Varriount> Araq: "Composes"?
19:08:06AraqZevv, can we use this: http://man7.org/linux/man-pages/man3/mallinfo.3.html
19:08:25Araqit contains int usmblks; /* Maximum total allocated space (bytes) */
19:09:16Araqcould be portable, at least the name predates the invention of the letter 'o'.
19:09:48disruptekneat.
19:11:36AraqVarriount: compose as in "I can use my custom SmallSeq with the standard seq inside a 3rd party lockfree hash table and it actually works"
19:13:15*rockcavera joined #nim
19:20:42leorizeAraq: that function is not portable...
19:25:29FromDiscord_<treeform> Araq, is some thing wrong with this code? https://github.com/nim-lang/Nim/blob/devel/build_all.bat#L8
19:25:52Araqno, I proposed it to shashlick for choosenim
19:26:03FromDiscord_<treeform> oh got it!
19:41:24FromGitter<Vindaar> @narimiran I think I managed to implement a dummy backend, which doesn't draw. I'll let you know once this is merged into ggplotnim's master
19:41:32*opal is now known as wowaname
19:42:03*nsf joined #nim
19:43:04*wowaname is now known as opal
20:01:36*Senketsu joined #nim
20:15:10FromGitter<Vindaar> @narimiran ok, done. Let's hope it works. You have to run `nimble testCI` now.
20:16:52*cron1 quit (Quit: Leaving.)
20:18:18ZevvAraq: Sure we could, but what to do on platforms that don't have it.
20:18:32disruptekyou should just model it.
20:20:13Zevvthis is where the {.weak.} would come in.
20:20:30disrupteksymbols, you mean.
20:20:43Zevvmen
20:21:02Zevvweak men and boneless chickens
20:21:02FromDiscord_<Clyybber> methods are probably faster than storing a closure, right?
20:21:03Araqyup, we need .weak anyway
20:21:04disrupteki think we already have {.softhands.} for that.
20:21:18FromDiscord_<Clyybber> Do we use vtables for methods currently?
20:21:33Araqno we use some custom junk
20:21:45Araqbut performance is ok
20:21:56Araqand faster than closures iirc, ask mratsim
20:21:58disruptekexceptions excepted.
20:22:40FromDiscord_<Clyybber> Araq: How does that custom junk work?
20:22:52FromDiscord_<Clyybber> case/switch statement?
20:24:34narimiran@Vindaar ok, pushed with that change, i'll see tomorrow what CIs are saying this time
20:24:55FromGitter<deech> When working on the compiler do you folks have a workflow that doesn't involve rebuilding it everything you make a change?
20:26:37disruptekdeech: yeah, i'm building it right now. wrt all tests running in 3 seconds, i should be able to do well over 3000 novel tests/second. across compiler versions. i am figuring maybe 6000-10000 relevant tests including runnableExamples.
20:26:55shashlickJust `nim c compiler/nim`
20:27:01Araqdeech: koch temp c example.nim
20:27:15FromDiscord_<Generic> @Clyybber if it wasn't changed it generates a bunch of if statements
20:27:19Araqif you don't use 'koch temp', you're doing it wrong and waste time
20:27:27FromDiscord_<Clyybber> @Generic Ah, alright thanks
20:27:37FromGitter<deech> Araq, that builds the compiler from scratch including nim{1,2,3}.
20:27:37shashlickBut koch temp rebuilds every time right
20:27:46FromGitter<deech> Unless that changed in the past 6 months.
20:27:57Araq'koch temp' != 'koch boot'
20:28:30FromDiscord_<Clyybber> Araq: WDYT about a more general way of exposing RTTI ?
20:29:03Araqnothing, we have getType, we can make that easier to use though.
20:29:14FromDiscord_<Clyybber> Ah, alright. That probably fits
20:29:23FromGitter<deech> I thought RTTI was going away.
20:30:02*leorize quit (Remote host closed the connection)
20:30:13Araqyup, arc doesn't have it.
20:30:26*leorize joined #nim
20:30:29shashlickQuestion on choosenim x64 - do you all want 32 and 64-bit to coexist
20:30:40FromGitter<deech> No
20:30:48FromDiscord_<Clyybber> How do we do dynamic dispatch on arc again?
20:30:50shashlickSwitch between them?
20:31:00disrupteklet them fight and then we'll vote one off the island.
20:31:15*narimiran quit (Ping timeout: 240 seconds)
20:32:01*Senketsu quit (Quit: WeeChat 2.6)
20:32:17AraqClyybber: via 'strstr'
20:32:31AraqI'm not kidding :-)
20:33:04FromDiscord_<Clyybber> umm
20:33:16*Senketsu joined #nim
20:33:29FromDiscord_<Clyybber> how does that work?
20:34:26Araqproc isObj(obj: PNimType, subclass: cstring): bool {.compilerRtl, inl.} =
20:34:26Araq proc strstr(s, sub: cstring): cstring {.header: "<string.h>", importc.}
20:34:26Araq result = strstr(obj.name, subclass) != nil
20:34:56Araqfor DLL interop we produce strings identifying an object in its hierarchy
20:35:06FromDiscord_<Clyybber> Ah
20:35:27Araqit sucks but at least it's not pointer chasing
20:35:32FromDiscord_<Clyybber> So the runtime subtype is stored in a field of the root object, right?
20:35:49Araqonly if the object is "inheritable", but yes
20:35:54FromGitter<Vindaar> @narimiran thanks!
20:36:26FromDiscord_<Clyybber> Araq: Couldn't we store the runtime subtype as an enum and have an extra function to strinify that enum?
20:37:25FromDiscord_<Clyybber> *stringify
20:39:11Araqwe could. see LLVM's codebase
20:39:17Araqit does the same
20:39:31Araqand has some nice document about how to construct the enum values
20:39:57FromDiscord_<Clyybber> And then we could use switch statements for dynamic dispatch
20:40:00Araqbut it assumes a closed world, no DLLs
20:40:20ZevvAraq: ok to split mdisp up and move the different implementations into lib/system/mm/* ?
20:40:27Zevvmmdisp, that is
20:40:36AraqZevv: try it and see if I like the result
20:41:30shashlickAraq - I was thinking today to improve the cross compile situation but was curious on your thoughts
20:41:39shashlickContext - https://github.com/genotrance/nimarchive/issues/6#issuecomment-558789512
20:41:39disbotCant crosscompile
20:41:53FromGitter<Varriount> Zevv: For NPeg, what do the commit instructions do (especially part commit)?
20:44:10shashlickchanging --os to something else should not affect the VM which is still running on the buildOS
20:44:31ZevvVarriount: it 'fixates' the current branch.
20:44:48ZevvBasically it says: right, this part of the '|' matches, throw out the other options
20:46:41disruptekclyybber: if you can use a switch for dispatch, then maybe we can use the extra semantics of switch to do something cool in nim.
20:46:41Zevveffectively throws away the top item of the backtracking stack
20:47:05ZevvAraq: https://github.com/nim-lang/Nim/pull/13254
20:47:06disbotCleaned up mmdisp.nim, moved implementations into lib/system/mm/
20:47:17*sagax joined #nim
20:47:24Araqshashlick: I don't have ideas/thoughts
20:47:29FromDiscord_<Clyybber> disruptek: I think something cool == multimethods
20:47:41FromDiscord_<Clyybber> just nested switch stmts
20:48:38FromDiscord_<Clyybber> disruptek: but tell me what were you thinking of?
20:49:15*Zevv puts his fingers in his ears and goes "lalalaaah"
20:49:34disrupteki'm thinking how to resolve the problem Araq raised, first.
20:49:44Zevvoh, I expected much worse
20:49:59disruptekyou are a dirty old man, zevv.
20:50:02shashlickAraq: okay thanks
20:50:16disruptekbut i guess it takes one to know one.
20:50:20FromDiscord_<Clyybber> disruptek: You mean going over dll boundaries?
20:50:29disruptekyeah.
20:51:00FromDiscord_<Sabena Sema> has staticRead caused any issues in the language? Has it shown itself to be a special case of some other metaprogramming feature?
20:51:05*lritter quit (Read error: Connection reset by peer)
20:51:14FromDiscord_<Clyybber> no
20:51:31disruptekit has shown itself to be a hand-grenade.
20:51:46FromDiscord_<Clyybber> disruptek: disruptek: Since we must compress the string down somehow, I don't know how we could guarantee no collisions
20:51:56FromDiscord_<Clyybber> (If we were to use a hash thingy
20:53:15FromGitter<Varriount> Clyybber: Do you know all possible keys ahead of time?
20:53:23FromDiscord_<Clyybber> Araq: Is the RTTI string only stored in the RootObj or in every object that is inherited from?
20:53:33disruptekwe don't know all possible keys.
20:53:46FromDiscord_<Clyybber> I don't know if we know :p
20:53:53disruptekbut, we could set a limit. then we would know.
20:54:02disruptekbut, i gotta tell ya. it's a big number.
20:54:10*Senketsu quit (Quit: WeeChat 2.7)
20:54:47Zevvwhat are you cooking up today, disruptek?
20:54:52disruptekwe can hash the compilation result so every result has a uuid, and then 16k types.
20:54:52FromGitter<Varriount> What about calling through a pointer?
20:55:04FromGitter<Varriount> go the vtable route
20:55:47FromDiscord_<Clyybber> There shouldn't be much of a difference between vtable and switch dispatch no?
20:56:08FromDiscord_<Clyybber> Oh, nevermind
20:56:47FromDiscord_<Clyybber> Varriount: With the switch approach we could put the switch in the generated method itself though
20:57:02FromDiscord_<Clyybber> And the switch approach also allows multimethods
20:57:12FromGitter<Varriount> Problem with that is that you need to know all the cases beforehand
20:57:22disruptekand it's way friendlier to the compiler, not to mention faster.
20:57:54FromDiscord_<Clyybber> Varriount: Don't you need that with vtable too?
20:58:28FromGitter<Varriount> a vtable is usually passed in with the object
20:58:33*lritter joined #nim
20:58:38FromGitter<Varriount> or is part of the object
20:58:43FromDiscord_<Clyybber> Ah, I see
20:59:08FromGitter<Varriount> So any object (whether native to the program or from a dll) can have the vtable
21:00:08disruptekit would let us do dynamic mixins, i guess.
21:02:21disruptekmaybe that solves the arc problem. the proc pointer lets destroy skip itself, or causes memory to get zero'd, etc.
21:03:04FromDiscord_<Clyybber> I still prefer the switch thing, just for the multimethods :p
21:03:40FromDiscord_<Clyybber> Imagine writing `dynamic` in front of an argument type and it becomes dynamic dispathc
21:03:45FromDiscord_<Clyybber> that would be kinda cool
21:03:48disrupteki think they can work together.
21:04:06FromDiscord_<Clyybber> But vtable is more complicated and bigger
21:04:48FromGitter<Varriount> Or you could do runtime code generation. :P
21:08:05FromDiscord_<Clyybber> heh
21:08:22FromDiscord_<Clyybber> disruptek: dynamic mixins as in attaching methods to a single object instance only?
21:09:16disruptekthat's way harder.
21:09:48FromDiscord_<Clyybber> Araq: Do you have a link to the LLVM doc? I can't find it
21:10:02FromDiscord_<Clyybber> disruptek: And is kinda unneccessary
21:10:23FromDiscord_<Clyybber> So in the end, if we can get the switch approach to work its probably the best
21:10:44disruptekare we able to store a pointer with arc?
21:10:52disruptekin the header, i mean.
21:10:57FromDiscord_<Clyybber> Sure
21:11:13disruptekwhy not store the alloc/dealloc pointer in there?
21:11:16FromDiscord_<Clyybber> We can store whatever your heart desires
21:11:29FromDiscord_<Clyybber> disruptek: You mean the allocator?
21:11:32FromDiscord_<Clyybber> We did that
21:11:37FromDiscord_<Clyybber> but zevv made it go away
21:11:41FromDiscord_<Clyybber> (for good!)
21:11:55Zevvtadaaa!
21:11:57Araqhttps://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html
21:12:05FromDiscord_<Clyybber> Araq: Thanks!
21:12:31disruptekno, a pointer which just runs to prep the memory between stages.
21:12:48disruptekbut we repoint it whenever we run it.
21:12:54disruptekstate machine.
21:13:35FromDiscord_<Clyybber> Araq: Is the RTTI string stored in the RootObj or in the corresponding base object?
21:15:40Araqthe object has a PNimType field at offset 0
21:15:51Araqthe string is inside the PNimType
21:16:23FromDiscord_<Clyybber> Ah, I see.
21:17:00FromDiscord_<Clyybber> Araq: But the PNimType field belongs to the base object right?
21:17:18FromDiscord_<Clyybber> Argh, dumb question ignore please :d
21:17:26FromDiscord_<Clyybber> I got things mixed up
21:26:43Araqgood night
21:27:35*tiorock joined #nim
21:27:35*tiorock quit (Changing host)
21:27:35*tiorock joined #nim
21:27:35*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
21:27:35*tiorock is now known as rockcavera
21:30:08FromDiscord_<Recruit_main_70007> gn
21:32:54FromDiscord_<Clyybber> good night
21:37:00FromDiscord_<Clyybber> Araq: If you are still here, are methods supposed to work on ptr objects?
21:40:33*Trustable joined #nim
21:41:11*filcuc joined #nim
21:49:17FromDiscord_<Clyybber> Aww : ( doesn't work
22:08:23*solitudesf quit (Ping timeout: 268 seconds)
22:16:22*Trustable quit (Remote host closed the connection)
22:22:17FromGitter<Varriount> I never quite understood how RTTI was embedded in current structs, yet an address could be taken of an object and passed to C
22:36:25ZevvI have no clue, but could it not simply sit in front of the object?
22:39:35disruptekdoes it have to be the same object?
22:39:44disrupteks/object/address/
22:44:33*Ven`` quit (Read error: Connection reset by peer)
22:46:12*chemist69 quit (Ping timeout: 260 seconds)
22:46:36*chemist69 joined #nim
22:56:59*nsf quit (Quit: WeeChat 2.7)
23:00:50FromDiscord_<Recruit_main_70007> whats the theme used in the tiny code examples in the web.
23:01:55disruptekennio morricone, the legend of 1900.
23:10:48FromDiscord_<Recruit_main_70007> jokes on me, its not in vscode, anyway thank you and goodnight
23:10:53*filcuc quit (Ping timeout: 272 seconds)
23:17:27*jholland__ quit (Quit: Connection closed for inactivity)
23:19:29*ng0 quit (Quit: leaving)
23:41:42*dadada quit (Ping timeout: 268 seconds)
23:43:46*thomasross joined #nim
23:47:33*tane quit (Quit: Leaving)