<< 21-01-2019 >>

00:32:07*skellock quit (Ping timeout: 240 seconds)
00:32:42*theelous3 quit (Remote host closed the connection)
00:39:06*vlad1777d joined #nim
00:43:53*skellock joined #nim
00:49:07*skellock quit (Ping timeout: 240 seconds)
00:49:13*troido left #nim ("WeeChat 2.2")
00:52:07FromGitter<zetashift> Great work on the raylib bindings irskep!
00:58:23*ftsf joined #nim
01:07:20shashlickFirst nimterop wrapper!
01:11:56FromGitter<irskep> shashlick: I'll remove the va_list line when you do an official release
01:12:35shashlickI've pushed the change
01:13:03shashlickAre you using the cached copy by default?
01:13:06FromGitter<irskep> I'd rather pin to a tag or something, I don't like using master#HEAD
01:13:31FromGitter<irskep> I guess anyone who installs it now will get an error so you're right I should make the change anyway
01:15:23FromGitter<irskep> hmm, uninstalling and reinstalling didn't work
01:17:30FromGitter<irskep> ah no, it was my fault.
01:17:35FromGitter<irskep> done!
01:17:44FromGitter<irskep> but you should really start doing actual release tags :-P
01:17:57*seni quit (Remote host closed the connection)
01:18:23*seni joined #nim
01:18:41*skellock joined #nim
01:32:11shashlickI was diligent with it with nimgen
01:32:42shashlickNow I'm debating if it is needed, but ya breaking changes are possible
01:32:54*zyklon_ quit (Read error: Connection reset by peer)
01:50:31*zyklon_ joined #nim
02:00:21*wildlander quit (Quit: Konversation terminated!)
02:01:45FromGitter<arnetheduck> just me, or is there a more aggressive policy to closing bug reports early?
02:04:06FromGitter<irskep> shashlick: you in fact JUST made a breaking change to a live user so...yes.
02:09:19*seni quit (Quit: Leaving)
02:09:42FromGitter<arnetheduck> anyway.. https://github.com/nim-lang/Nim/issues/9667#issuecomment-455926088 points out some things about introducing ABI to the language.. not sure if that's where the language wants to go (by introducing language-level constructs) or if it's to be kept in a module (python style), but if there's interest I can open a separate issue about it, @krux02
02:17:41*ng0 quit (Ping timeout: 256 seconds)
02:23:15*ng0 joined #nim
02:31:12FromGitter<matrixbot> `sotrhraven` I know it is off topic. I do know some of you like ada. What is your opinion of Eiffel?
02:35:58*Tyresc quit (Quit: WeeChat 2.4-dev)
02:36:04*ng0 quit (Quit: Alexa, when is the end of world?)
02:47:58*skellock quit (Ping timeout: 245 seconds)
02:49:53*skellock joined #nim
02:54:16*skellock quit (Ping timeout: 250 seconds)
03:00:35*banc quit (Quit: Bye)
03:11:15*vlad1777d quit (Ping timeout: 246 seconds)
03:22:12*banc joined #nim
03:29:22*Geezus42 quit (Ping timeout: 250 seconds)
04:03:51FromGitter<kaushalmodi> anyone here to help with a basic C question?
04:04:44*skellock joined #nim
04:04:58*nsf joined #nim
04:18:32leorizehi kaushalmodi :)
04:18:35leorizejust ask
04:18:56FromGitter<kaushalmodi> trying to wrap ⏎ ⏎ ```XXTERN void *svGetArrElemPtr1(const svOpenArrayHandle, int indx1);``` [https://gitter.im/nim-lang/Nim?at=5c45482f831899452421bc7f]
04:18:59FromGitter<kaushalmodi> in nim
04:19:05FromGitter<kaushalmodi> looks like that fn returns a pointer
04:19:44FromGitter<kaushalmodi> but nimterop is creating a wrapper like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45485fc45b986d1193a47c]
04:19:54FromGitter<kaushalmodi> which I think is wrong .. but I am not sure
04:20:00leorizeyep, that's wrong
04:20:11leorizeopen a bug report for nimterop I guess
04:20:32FromGitter<kaushalmodi> yes, but to open the bug report, I am trying to know what the correct wrapper should look like
04:21:08FromGitter<kaushalmodi> In Nim, I have use pointer types only associated with a type, like `ptr int`
04:21:31FromGitter<kaushalmodi> in above case, I don't know what that void pointer points to.. could be an int, float, anything
04:21:35leorize`proc svGetArrElemPtr*(...): pointer`
04:21:42leorize`proc svGetArrElemPtr*(...): pointer {...}`
04:21:43FromGitter<kaushalmodi> huh, that's it?
04:21:46FromGitter<kaushalmodi> let me try :)
04:21:53leorizeyea, we have untyped pointer :P
04:22:19leorizebasically just add :pointer to nimterop generated wrapper lol
04:24:38FromGitter<kaushalmodi> yep, I'm trying that, but stumbling at another point
04:24:54FromGitter<kaushalmodi> in the example C code that I am translating to Nim, it is `*(int*)svGetArrElemPtr1(dyn_arr, i)`
04:25:14FromGitter<kaushalmodi> and this is what I am doing in Nim: `castint (svGetArrElemPtr1Fix(dyn_arr, i)[])`
04:25:28FromGitter<kaushalmodi> *that Fix suffix is my fixed wrapper version*
04:25:47*skellock quit (Ping timeout: 240 seconds)
04:26:02FromGitter<kaushalmodi> I am using that in strformat `fmt` as `echo fmt"Nim: {i} {castint (svGetArrElemPtr1Fix(dyn_arr, i)[])}"`
04:26:36FromGitter<kaushalmodi> but getting error: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c4549fcba355012a470866f]
04:27:34FromGitter<kaushalmodi> I think that C snippet is casting the value referenced by the returned pointer to int
04:28:02FromGitter<kaushalmodi> but looks like that's not what that C syntax means or my Nim translation of that is wrong
04:36:40FromGitter<kaushalmodi> ok, so if I have the wrapper as: ⏎ ⏎ ```echo fmt"Nim: {i} {svGetArrElemPtr1Fix(dyn_arr, i)[]}"``` ⏎ ⏎ works [https://gitter.im/nim-lang/Nim?at=5c454c57f780a1521f42fcfc]
04:37:30FromGitter<kaushalmodi> so I need to figure out how to convert `pointer` to `ptr int` if `svGetArrElemPtr1Fix` return type is `pointer`
04:40:19FromGitter<kaushalmodi> worked! finally .. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ comments are welcome if there's a more canonical way to do the above [https://gitter.im/nim-lang/Nim?at=5c454d339bfa375aab348c76]
04:44:21leorizewell, cast is how you do that :p
05:00:33shashlicki'll take a look @kaushalmodi - void * should become pointer yes
05:04:17zestyrshashlick: the time_t and va_list change is nice when cImport is used, but for nimagemagick I have to use a pre-generated wrapper, so it doesn't really fix the problem for me unless I add nimterop as a dependency and import nimterop/types
05:08:23shashlickdo you have any suggestions? one option is to import nimterop/types in the wrapper
05:08:56shashlicknimterop/cimport also exports the types so you could add that as well
05:09:35shashlickone option is to import nimterop/types in the wrapper <= meaning add an `import nimterop/types` to toast output
05:13:04zestyryea, I was just thinking I could avoid having to add nimterop as a dependency since the toast output still needs changes
05:29:46*cag104 joined #nim
05:44:04*LargeEpsilon joined #nim
05:49:06*narimiran joined #nim
05:53:59*dddddd quit (Remote host closed the connection)
05:54:47*cag104 quit (Ping timeout: 256 seconds)
05:56:48*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
06:06:19shashlickwhat are you changing in the output?
06:20:53zestyrI wrote a simple build script here: https://github.com/zestyr/nimagemagick/blob/master/build.nims
06:21:16zestyrall those "Method" types are missing due to the tree-sitter bug, and the last two changes are to silence warnings
06:23:27*skellock joined #nim
06:24:07*darithorn quit (Quit: Leaving)
06:28:19*skellock quit (Ping timeout: 272 seconds)
06:33:47shashlickzestyr: do you prefer having a static nim or okay with the cimport approach?
06:36:37zestyrI'm fine with using cimport, toast only takes 40ms to generate on my machine plus it's cached
06:42:08*vegax87 quit (*.net *.split)
06:42:18*LargeEpsilon quit (Ping timeout: 246 seconds)
06:44:03*vegax87 joined #nim
06:46:11shashlickokay then you can define those missing types in your wrapper before the cImport call
06:46:36shashlickhand wrap those things or use c2nim on just those pieces and put it in
06:55:03*krux02 joined #nim
07:12:13*LargeEpsilon joined #nim
07:29:36*ftsf quit (Quit: Leaving)
07:39:08*lritter joined #nim
07:49:04leorizeshashlick: can you take a look at pkg-config integration? It'd be easier to wrap system libraries headers with it
07:53:26shashlickSure I can take a look
07:53:56shashlickWindows users will have to take a hike though
07:54:07leorizewell, they won't need it anw :P
07:54:40leorizeIt seems to me that nimterop doesn't support empty struct
07:54:58Zevvwow, "nimagemagick", slick name :)
07:55:46shashlickLeorize ya that's pending - you mean struct X; right
07:55:51leorizeyea
07:56:26shashlickI need it for nimarchive, was going to add it today before some bug reports took me elsewhere
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:57shashlickMeanwhile, does pkg-config only work on installed libraries or also on stuff you clone from http://github.com
08:01:10leorizeinstalled libraries
08:02:18leorizeit's used to get the include/lib directories for those libraries automatically
08:02:50shashlickHow would it be different than simply running a gorge and passing to nimterop?
08:03:06leorizeis that you'd have to parse it :P
08:03:20shashlickYou mean adding some code to parse the output
08:03:25shashlickOk sounds fair
08:04:17leorizeyea, it returns -I -L -l flags for the compiler
08:04:58*gmpreussner joined #nim
08:05:37shashlickCould you open an issue to track it?
08:06:01shashlickAlso how would you make such a wrapper cross platform
08:06:22leorizeit'd be cross-distribution
08:06:37leorizeI'm wrapping Linux's libkmod, which is used to manage kernel modules
08:06:55leorizeit only work on linux, and is available in every distribution out there
08:07:05leorizebundling your own version doesn't sound nice
08:07:40shashlickWrapper libs that is
08:07:56shashlickIn fact that sounds like the right direction to go in
08:08:28shashlickNo longer needing wrapper libraries, simply use c like any other package
08:09:37Zevvleorize: for pkg-config it would make sense to integrate deeper so that the ldflags are also picked up
08:09:38*zyklon_ quit (Read error: Connection reset by peer)
08:10:21shashlickBut then it is the user's headache to download and setup the dependencies
08:10:52Zevvon all "normal" distributins this is done by the package manager.
08:10:57shashlickThough nimterop can add some tools to help assist the process
08:10:58Zevvapt, yum, etc
08:11:03leorizeyou could say it's helpful for people who want to give seamless C interop a test :)
08:11:12shashlickYa life's easy on Linux
08:11:35shashlickWindows, not so much
08:12:19Zevvthe nice thing with pkgconfig is that it adapts quite well with cross compiling or other root dirs. I can build my small embedded mips root and just point pkgconfig to my root top, and it'll find all the libs and header in there instead of in the host os
08:13:08shashlickOk pkg-config is in - any other ideas?
08:13:49ZevvI'm not sure if this already works, but can I include "math.h" wihouht explicitly asking for /usr/include?
08:14:04Zevvthe toolchain preproessor knows where to find stuff
08:14:16leorizeyou'd need to call cAddStdDir()
08:14:34Zevvcould nimterop learn this from the preprocessor?
08:14:47shashlickI have a math.h test already on windows
08:14:54Zevvthe other day I solved this by creating an otherwise empty headerfile with a single include in there and running recursive
08:15:12shashlickDoesn't work on Linux though since math.h there is all over the place
08:15:44Zevvnot specifically math.h, just any header. I would like to be able to cross compile to another target, and use the tooltchains knowledge about the root to find the proper include paths
08:15:55shashlickSee nimterop/tests/tmath.nim
08:16:09Zevv(sorry for all the typos, mobile/travveling)
08:16:33zestyrshashlick: small thing but for enums, could you add a check that prevents this? "(AllChannels).ChannelType" -> "conversion from ChannelType to itself is pointless"
08:17:01Zevvtheres a pragma to disable that warning, that might be a quick solution
08:17:48shashlickIt's possible - but will need to track every enum value and type to avoid that though
08:18:09zestyrdon't bother if it's too much work, I'll just add the pragma
08:18:27Zevvnimterop could just emit the pragma, just like the codereordering
08:18:42shashlickWhat pragma is it?
08:18:53Zevvlooking for it
08:19:34zestyr{.hint[ConvFromXtoItselfNotNeeded]: off.}
08:20:05Zevvthanks
08:20:21leorizeZevv: IIRC you said you have problems with Nim's autoindent with using zah/nim.vim, right?
08:20:52shashlickI'll add it to nimterop - it might happen more often since enums build on each other
08:21:05Zevvleorize: it jumps around when I type colons
08:21:26Zevvmight be a local config problem, not sure
08:21:36shashlickZevv so does cAddStdDir not work for you?
08:21:36leorizecan you try this one? https://github.com/alaviss/nim.nvim/blob/master/indent/nim.vim
08:22:05Zevvim at my computer in half an hour, will check. thanks!
08:23:58shashlickOk folks, gotta sleep but feel free to open issues, happy to improve nimterop based on your past C wrapping experiences and requirements
08:24:08shashlickAnd thanks for all the feedback and testing!
08:24:50Zevvshashlick: nightynight, thanks again
08:24:57zestyrHappy to help, thank you for the great work :)
08:25:51leorize'night shashlick, thanks for the great work :)
08:27:01*zyklon_ joined #nim
08:41:49Zevvleorize: seems to work quite well, I'll use it today and see how it behaves. Thanks!
09:13:40leorizeglad it worked well for you :)
09:18:36*floppydh joined #nim
09:26:21*vlad1777d joined #nim
09:42:44*ng0 joined #nim
09:53:25Zevvleorize: vim <8.0 doesn't know about v:true
09:54:11*ikan-keli_ quit (Ping timeout: 250 seconds)
09:54:29leorizeyou should upgrade :p
09:54:36leorizeor just change it to 1
09:54:41leorizefalse then 0
09:54:42ZevvI did
09:54:57ZevvI'm stuck with old centos dists at work
09:58:26leorizeinstall nix :)
09:58:40leorizeit works per-user
10:00:42Zevvwhat's nix
10:07:24leorizeZevv: https://nixos.org/nix/
10:08:54Zevvmore package managers is what the world needs
10:09:07Zevvlets go fully python!
10:09:47leorizeat least it's better than compiling your own vim :P
10:10:23ZevvI just cope and suffer. People ask me how I'm doing, I put up a friendly smile and I say I'm just fine - but deep inside I scream the scream that nobody hears
10:11:24Zevvor I just make an nfs mount, of course
10:11:24*zyklon_ quit (Read error: Connection reset by peer)
10:13:03FromGitter<gogolxdong> How to solve ⏎ [Error] Error occurred handling client messages. ⏎ socket closed ⏎ Async traceback: ⏎ nqtpserver.nim(164) nqtpserver ... [https://gitter.im/nim-lang/Nim?at=5c459b2f0721b912a5b44737]
10:13:07*ng0 quit (Ping timeout: 256 seconds)
10:14:23*ng0 joined #nim
10:14:37FromGitter<gogolxdong> everytime refresh mainpage, seems an opened websocket being forced close.
10:14:43*stefanos82 joined #nim
10:15:18Zevvleorize: good tip: nix, thanks!
10:15:21FromGitter<gogolxdong> after a certain times, websocket server stops responding.
10:16:53Araqwell refresh makes the browser send a 'quit' message, that's the "forced close" I think
10:17:06Araqmakes sense, right?
10:18:09Araqseems to be a websocket bug, recvFrame_continue shouldn't continue if the socket was closed
10:19:39*LargeEpsilon quit (Quit: WeeChat 2.4-dev)
10:22:31FromGitter<gogolxdong> I think so.
10:24:35FromGitter<gogolxdong> should I file an issue to websocket?
10:24:50*skellock joined #nim
10:24:53Araqyes
10:25:30Araqbut make sure you use the latest websocket version, it got a couple of bugfixes
10:29:01*zyklon_ joined #nim
10:29:17*skellock quit (Ping timeout: 250 seconds)
10:32:30FromGitter<gogolxdong> sure, confirmed
11:24:43*dom96_w joined #nim
11:39:40FromGitter<kaushalmodi> shashlick: thanks for pushing that void pointer bug to the highest priority, and fixing it right away!
11:42:33FromGitter<kaushalmodi> You are helping me device the best SystemVerilog <-> C integration via Nim!
11:43:31FromGitter<kaushalmodi> This process is helping me learn a little bit of C too :)
11:44:49narimiranquick nim-trivia question:
11:45:30narimiranwithout looking, can you tell the difference between `parsexml` and `xmlparser` module? (did you even know that both of those are in the stdlib?)
11:48:28Araqparsexml is the low level parser that xmlparser uses
11:51:47narimiranthat was the question for people who didn't write both of those modules! :P
11:57:51ZevvThere are more of these releationships that don't make sense on the first look, like the relation between asyncfutures, asyncmacro, asyncfd en and asyncnet
11:58:52*aguspiza joined #nim
12:06:01dom96_wasyncfd is a module?
12:06:39Zevvno, true :)
12:15:53Araqnarimiran: I agree it's bad but the reasoning was like "this one is a verb, it does stuff, this is a noun, it's higher level"
12:16:20Araqand parse* was a naming scheme, parsecfg, parsexml, parsejson, parsesql
12:17:27narimiranyeah, i'm familiar with parse* naming scheme, so i was surprised when i saw there is also xmlparser
12:26:53*PMunch joined #nim
12:27:03*skellock joined #nim
12:31:49*skellock quit (Ping timeout: 268 seconds)
12:34:01*nsf quit (Quit: WeeChat 2.3)
12:35:18*NimBot joined #nim
12:51:51ZevvCan nimdoc also generate documentation for non exported types and procs?
12:54:26*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:02:36*dom96_w joined #nim
13:07:14*stefanos82 quit (Remote host closed the connection)
13:14:06Araqno. PRs welcome
13:26:07*banc quit (Ping timeout: 240 seconds)
13:28:06FromGitter<timotheecour> @zevv : related to https://github.com/nim-lang/RFCs/issues/115
13:31:30*dddddd joined #nim
13:41:29*nc-x joined #nim
13:41:31nc-xCreated https://github.com/nim-lang/Nim/pull/10403
13:41:33*Vladar joined #nim
13:41:45*nc-x quit (Client Quit)
14:03:16*skellock joined #nim
14:03:56*zachk joined #nim
14:22:36FromGitter<dandevelo> Why was the {.define: pragma deprecated? What is the new way to define something in code?
14:23:32Araquse consts and 'when' when you are in Nim code
14:25:45FromGitter<dandevelo> What would be the new way to do {.define: ssl.} ?
14:29:35FromGitter<dandevelo> How would consts work for that?
14:34:48*nsf joined #nim
14:45:32FromGitter<timotheecour> hi @araq was `debuginfo.nim` every working? looks like it’s dead code now: ⏎ `when false: gDebugInfo.registerEnum(…)`
15:00:06Araqit rotted due to the heavy compiler refactorings
15:00:19Araqbut it did work
15:00:23FromGitter<timotheecour> do u remember what id did
15:01:05FromGitter<timotheecour> is it for endb or (lldb and gdb) ?
15:01:29Araqit is for ".ndi" files
15:02:00AraqI wanted to patch GDB to load the .ndi files for more runtime information
15:02:05FromGitter<timotheecour> Ok; so it’d serialize what compiler knows to ndi files
15:02:12FromGitter<timotheecour> aha
15:02:23FromGitter<timotheecour> Im working on (hopefully) a better version of that
15:02:32Araqnice
15:02:51FromGitter<timotheecour> thought it would be related when i saw that module
15:03:06FromGitter<arnetheduck> patch gdb or use its plugin interface?
15:03:33FromGitter<timotheecour> use plugin interface
15:04:00FromGitter<alehander42> i am still not sure why is this beneficial compared to just generating runtime debuginfo data structures
15:04:05Araqarnetheduck, well since then we got Nim pretty printers for GDB in nim-gdb
15:04:05FromGitter<timotheecour> (focusing on lldb since… ya know… broken on osx) ; but different approach
15:04:59shashlickAraq looks like gorge caching never gets flushed with --forceBuild
15:06:15shashlickI'll be working on a fix
15:06:26FromGitter<timotheecour> also i got some nice results based on using azure pipelines: more parallelism (10 free concurrent jobs) + 2X speedup compared to travis/appveyor
15:06:42Araqshashlick, yay :-)
15:06:44FromGitter<timotheecour> running same CI
15:09:30FromGitter<arnetheduck> shashlick, one thing I often run into is `{.compile.}` not recompiling properly (for nlvm, `wrapper.cc`..).. there's some dep analysis bug there as well, if you're looking at these parts, I just haven't been able to pinpoint it exactly.. only that I often get linking errors because it hasn't been compiled, then I have to go change the `.cc` file (basically, even though the corresponding `.o` is missing, nim thinks
15:09:30FromGitter... it doesn't need to recompile)..
15:10:18Araqit checksums the .c file, nothing more, nothing less
15:10:28Araqand -f forces a recompile
15:10:45Araqit never led me down so I don't know what you're doing :P
15:11:37shashlickI've seen it happen with wrappers too, will try to debug
15:11:46FromGitter<gogolxdong> @shashlick, is there a way to keep the intermedia nim file of nimterop?
15:12:30FromGitter<dandevelo> Is there any new way to write {.define: ssl.} in Nim code since the .define pragma was deprecated?
15:12:44shashlickRight now you can redirect stdout or check nimcache for the gorge cache @gogolxdong
15:13:04shashlickBut there's plans to have it output to a file
15:13:30*PMunch quit (Remote host closed the connection)
15:13:33*TheLemonMan joined #nim
15:13:35Araqdandevelo: ssl needs to become the default
15:13:36*shadowbane quit (Quit: Konversation terminated!)
15:13:54AraqTheLemonMan, welcome back :-)
15:14:00TheLemonManAraq: the direct/indirect terminology may not be clear enough for the user
15:14:04shashlick@dandevelo: you can use a local nim.cfg or config.nims
15:14:20FromGitter<dandevelo> @Araq so I should simply use {.define: ssl.} for now?
15:14:31TheLemonManthank you :) I've been watching from distance the awesome progress you made
15:14:32shashlickBut I agree we need the {.define.} pragma back
15:15:02TheLemonManshashlick: nice work on nimterop, I also have an unreleased libclang based bindings generator here :P
15:15:36shashlickNice @TheLemonMan
15:15:46narimiranhey TheLemonMan! very nice to see you back and active!
15:15:56FromGitter<dandevelo> @shashlick: yes, I also would like the {.define.} pragma back. Don't know why it was deprecated
15:15:58shashlickThat's where I started and ran away once I saw how big clang is
15:16:20FromGitter<arnetheduck> @Araq @shashlick my guess would be that the dep analysis of the file that contains the `{.compile.}` statement prevents the hash-the-c-file stage even to be reached..
15:16:26*zyklon_ quit (Read error: Connection reset by peer)
15:17:00*shadowbane joined #nim
15:17:54shashlick@TheLemonMan - can you share your code? Will see if I can steal anything
15:17:59FromGitter<timotheecour> @thelemonman cool; do you have any plan on shaing ?
15:19:03TheLemonMansure thing, I'll upload everything later today
15:19:10FromGitter<timotheecour> i’m always a bit nervous about how far can treesitter go when it comes to parsing complex C++ headers (eg opencv), whereas libclang (or clang binary producing AST file) would *just work*
15:19:41FromGitter<timotheecour> (despite adding clang dependency; but not bad if just clang binary)
15:19:52TheLemonMannot so fast, libclang is also quite hostile to C++ :P
15:20:08TheLemonManthe C++ api is a bit nicer but...well it's a C++ interface
15:20:09FromGitter<timotheecour> what do u mean
15:21:12TheLemonManthe API is quite limited when it comes to templates & funky stuff, check out rust's bindgen to see how many hoops they have to go trough
15:21:41FromGitter<timotheecour> what do u think of approach based on https://github.com/genotrance/nimterop/issues/28#issue-386646796 via `clang -Xclang -ast-dump`
15:22:57TheLemonManthe IR AST idea is nice, you can always substitute the tree-sitter based toast with a libclang based one
15:24:20FromGitter<timotheecour> Ya that was what i was suggesting there; IMO treesitter is still well suited for: `C` + other languages (eg python), bringing simplicity for those (all using common AST ) ; but for C++ i think libclang will be needed
15:24:48FromGitter<timotheecour> 1) for binding
15:25:00skellockTheLemonMan: welcome back! \o/
15:25:07shashlickAgain, if we stick to wrapping and not complete translation, we might be okay
15:25:23FromGitter<timotheecour> but templates….
15:25:33FromGitter<zacharycarter> wb TheLemonMan
15:26:06FromGitter<timotheecour> (and ya welcome back!!)
15:26:11shashlickIf you have a good example of a concern, we can run it through tree sitter to see if the ast is adequate to differentiate
15:26:13FromGitter<zacharycarter> starting shortly on resurrection of the pg - it took me until 4pm yesterday to get a stupid OS on my new machine
15:26:17TheLemonMano/
15:26:38FromGitter<zacharycarter> so I didn't get around to working on rebuild the pg yesterday
15:26:50FromGitter<kaushalmodi> hello, I am still on that nimterop venture with svdpi.h
15:28:02FromGitter<kaushalmodi> I have: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45e502c45b986d1197ae64]
15:28:10FromGitter<timotheecour> @shashlick well there was https://github.com/genotrance/nimterop/issues/25 but sure i can add more bad examples
15:28:24FromGitter<kaushalmodi> but that fails compilation with: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45e5171cb70a372a143aa9]
15:28:54FromGitter<kaushalmodi> The addressed `svdpi.nim(18, 3)` line is where I have ` s_vpi_vecval* {.importc: "s_vpi_vecval", header: xlmIncludePath / "svdpi.h".} = object`
15:29:45shashlick@kaushalmodi if the type is being imported into another file, you need * for the fields as well
15:30:24FromGitter<kaushalmodi> thanks!
15:30:31FromGitter<kaushalmodi> some progress .. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45e597746d4a677aeaae0f]
15:30:46FromGitter<kaushalmodi> looks like I need to copy the element identifiers with the same case
15:30:49shashlick@timotheecour will I really saw that as a minor bug, not in context with c++
15:31:36FromGitter<kaushalmodi> shashlick: yes, that now compiles!
15:31:44FromGitter<kaushalmodi> thank you
15:31:57FromGitter<kaushalmodi> slowly and steadily I am getting there
15:32:03FromGitter<kaushalmodi> thanks for all the help
15:32:55shashlickNp, please let me know all the hacks you have to put in so that we can fix nimterop
15:32:56Araqwell c2nim can parse C++ templates and wrap them. I am not sure why patching it is out. But I also don't mind new tools.
15:33:58FromGitter<timotheecour> i’m talking about opencv like headers
15:34:41FromGitter<timotheecour> can c2nim handle that? (not the long deprecated C headers for opencv, but the newers c++ ones)
15:34:48*zyklon_ joined #nim
15:36:38Araqc2nim can handle almost no header whatsoever without touching it. But as I tried to explain a couple of times, that's a totally misguided goal.
15:36:41*ng0 quit (Ping timeout: 256 seconds)
15:36:58Araqchar** in C is underspecified, it can be a pointer to an array of cstrings. or not.
15:37:19shashlickAraq I really would have patched c2nim but the compiler dependency causes problems
15:37:22Araqso you *need* manual intervention no matter what.
15:38:06shashlickI prefer using existing tools - gcc, tree-sitter, etc. but that's probably because I'm lazy
15:38:37Araqyou can copy ast.nim and renderer.nim from the compiler over to c2nim. no depedency anymore then but you also need to apply the occasional patches we do to renderer.nim
15:39:21FromGitter<zacharycarter> Anyone have any suggestions / guides on compiler setups for Nim using windows?
15:39:28FromGitter<zacharycarter> do people use mingw?
15:39:42FromGitter<zacharycarter> or MSVC?
15:39:45*ng0 joined #nim
15:39:53FromGitter<dandevelo> I would say MSVC
15:40:17*nc-x joined #nim
15:40:22nc-xThe compiler won't bootstrap with msvc
15:40:23FromGitter<zacharycarter> okay - and as far as package managers go - are people still using scoop?
15:40:31FromGitter<zacharycarter> ah - so I'll need both - okay
15:40:33nc-xthere has been a long standing bug regarding that
15:40:33*ng0 quit (Client Quit)
15:40:35shashlickI just mingw
15:41:06FromGitter<zacharycarter> alright - that info should get me going - thank you
15:41:19nc-xhttps://github.com/nim-lang/Nim/issues/6229
15:41:29nc-xI use mingw-w64 from msys2
15:41:40nc-xhttps://www.msys2.org/
15:42:16FromGitter<zacharycarter> thank you
15:42:41FromGitter<zacharycarter> that's good info - I remember having difficulties previously getting mingw installed correctly on Windows
15:42:54FromGitter<Clyybber> hey nc-x, are you still working on tuple unpacking for iterators?
15:43:22shashlickJust download the mingw zip from http://nim-lang.org
15:43:36shashlickOr use choosenim
15:43:48nc-xbusy with college.
15:43:48nc-xI did work on support for mutable items yesterday but hit a roadblock
15:44:11nc-xcodegen generates *varname = newvalue, whereas it should generate varname = newvalue (without the *)
15:44:36nc-xI will look at it again on wednesday most probably
15:44:52FromGitter<zacharycarter> I'm not worried about installing Nim perse
15:45:38FromGitter<zacharycarter> it's more about all the various linux tools you need on windows
15:45:44FromGitter<Clyybber> @nc-x I feel you. College steals so much time
15:45:49FromGitter<zacharycarter> so that's why I use scoop
15:46:02FromGitter<zacharycarter> and I think I've used the mingw distribution nc-x linked earlier
15:46:16FromGitter<zacharycarter> those combined I think worked best for me when I previously tried Nim - I had just forgot where that mingw distro was
15:46:21nc-x@zacharycarter just use mingw gcc < 7 or latest... Some versions between gcc 7-8.2build1(or something) have some bugs
15:46:30FromGitter<zacharycarter> University was a waste of time for me
15:46:35nc-xSame
15:46:35FromGitter<zacharycarter> I regret ever going to be honest
15:46:43nc-xAnd I am doing bachelors in CS
15:46:52nc-xhorribly outdated sylabus
15:46:55nc-xtoo many subjects
15:47:00*zyklon_ quit (Read error: Connection reset by peer)
15:47:01nc-x0 focus on practical stuff
15:47:02FromGitter<zacharycarter> heh - mine was in History, if I had actually majored in CS I probably would have found more use out o fit
15:47:04nc-xuseless
15:47:15FromGitter<zacharycarter> well - learning all the theory etc now will pay off
15:47:22FromGitter<zacharycarter> even if it doesn't seem practical
15:47:34FromGitter<zacharycarter> unless you already knew all of that - and in that case - I agree it's useless
15:47:40nc-xnot really. you don't really know the Indian education system
15:48:11FromGitter<zacharycarter> you're right - I don't... but my point is employers at highly-regarded tech companies will want you to know CS theory
15:48:14nc-xwe have lab classes where we are just supposed to sit for 2hours and do nothing
15:48:15FromGitter<zacharycarter> and not just practical things
15:48:21FromGitter<zacharycarter> okay that is dumb
15:48:23FromGitter<zacharycarter> and a waste of money
15:48:29nc-xand lab exams are basically cheating and doing nothing
15:48:56FromGitter<arnetheduck> generally, the objective of universities is to teach you to think and vocational schools teach you to do.. they serve different purposes
15:49:03nc-xmost faculties do not know anything and any answer that is not same as the book is marked wrong in exams
15:49:15FromGitter<zacharycarter> @arnetheduck - I don't think anyone can "teach you to think"
15:49:26FromGitter<zacharycarter> you can develop and refine critical thinking skills
15:49:30nc-xsome subjects/faculties were pretty good though
15:49:56FromGitter<zacharycarter> but that's as far as I think it goes - I think University's primary role is to teach students to be self-sufficient information gatherers and researchers
15:50:15FromGitter<zacharycarter> but it's highly dependent on what you're going to school for - is it an Art school? Then you're probably not going to gain much benefit from ^
15:51:02nc-xmost of the students in India go for MBA afterwards because they don't know even the basics of programming
15:51:18FromGitter<zacharycarter> My Uni had the #1 sculpture school in the US or something my first year - but I didn't know any Art students in my dorm that were doing work like I was
15:51:26nc-xso the universities are failing to make them self sufficient even
15:51:29FromGitter<Clyybber> holy fuck, why does AT&T syntax have target architecture specific comment syntax
15:51:31FromGitter<zacharycarter> they were just doing art project after art project - the only class comparable I guess was art history
15:52:04AraqThe 'A' in AT&T syntax stands for 'accident'
15:52:04nc-xanyways we are going OT
15:53:05nc-xBTW @zacharycarter I usually follow https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2 to install mingw (because I never remember what I need to type ;))
15:55:14*nc-x quit (Quit: Page closed)
15:56:23AraqTheLemonMan, your PR uses 'direct reference', I suggested "indirection", I think both are equally hard to understand
15:56:44Araqand 'reference to a proc' might be interpreted as 'ref proc'
16:01:59FromGitter<zacharycarter> thank you!
16:02:08FromGitter<Clyybber> How would I get the AST after transformation in a rendered form?
16:02:22FromGitter<Clyybber> Is there some builting option of the compiler to do that?
16:03:49*zyklon_ joined #nim
16:03:50Araqecho repr(result)
16:03:53TheLemonManAraq: let's see if the irc folks have better alternatives
16:04:28shashlickI just find msys a waste since git bundles a bunch of tools anyway
16:04:50FromGitter<Clyybber> Huh, so repr can do that too. Amazing
16:05:58*aguspiza quit (Ping timeout: 250 seconds)
16:11:22*Trustable joined #nim
16:16:34AraqClyybber: It's a special overload and likely a design mistake
16:20:01*zachcarter joined #nim
16:20:59*vonHabsi__ joined #nim
16:21:48*vonHabsi1 joined #nim
16:21:50*vonHabsi quit (Ping timeout: 268 seconds)
16:22:15*vonHabsi_ quit (Ping timeout: 246 seconds)
16:24:15zachcarterdom96: if you have a moment, can you please PM me or just confirm that the IP address for the playground is - 162.243.192.65
16:33:21*Snircle joined #nim
16:39:54*darithorn joined #nim
16:47:23*ikan-keli_ joined #nim
16:47:46*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:49:41*banc joined #nim
16:50:18FromGitter<kaushalmodi> Araq: Is there something systemically wrong in this snippet? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45f84a9bfa375aab390c8b]
16:50:41FromGitter<kaushalmodi> If I run that once, it works, but I run the same second time, and I get SIGUSR fault
16:51:07*lritter quit (Ping timeout: 240 seconds)
16:51:13FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45f8810a491251e3314d3a]
16:52:14FromGitter<kaushalmodi> I tried multiple variants but they all crash the same way: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45f8bd0721b912a5b6be59]
16:54:01TheLemonManare you passing a C-style array to it?
16:54:23FromGitter<kaushalmodi> hmm, what's a c-style array, sorry
16:54:41FromGitter<kaushalmodi> I was just using the Nim `array` as you see in the signature
16:54:41TheLemonMana pointer, essentially
16:55:04TheLemonManoh, can you share a snippet to check how you're invoking it?
16:55:10*floppydh quit (Quit: WeeChat 2.3)
16:55:33shashlickhttps://github.com/grg/verilator/blob/master/include/vltstd/svdpi.h#L86 is the type
16:55:43FromGitter<kaushalmodi> it''s getting invoked by systemverilog via the Nim exported .so object
16:55:51FromGitter<kaushalmodi> let me share the compiled C
16:56:33TheLemonManI'm more of a VHDL guy heh
16:57:41FromGitter<kaushalmodi> this is the generated C: https://ptpb.pw/sCU4/c
16:57:51shashlickcan you also post how you invoke the proc
16:57:54FromGitter<kaushalmodi> though .. I don't know the code in SystemVerilog simulator that invokes that
16:58:22FromGitter<arnetheduck> any linux user around? can you try this, in an empty dir? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45fa2e8ce4bb25b8e94791]
16:58:34FromGitter<kaushalmodi> shashlick: I am invoking like this in SV: https://ptpb.pw/wV4J
16:58:42FromGitter<kaushalmodi> which unfortunately would be of no use
16:59:22FromGitter<genotrance> @arnetheduck: https://pastebin.com/4cxSPwjP
17:00:34shashlick@kaushalmodi: this is a pure nim proc, i don't see how libdpi gets involved
17:00:40shashlickare you calling nim from C?
17:01:04FromGitter<kaushalmodi> The nim proc compiles to .so
17:01:31FromGitter<kaushalmodi> and the C backend in the systemverilog simulator is calling the functions from that libdpi.so
17:01:49shashlickwell dll territory isn't without its thorns
17:01:56shashlicki've not gone there yet
17:02:18FromGitter<kaushalmodi> what does that SIGSEV mean btw?
17:02:28*abm joined #nim
17:02:33FromGitter<kaushalmodi> an access to an unallocated array element is being done?
17:03:13FromGitter<kaushalmodi> .. and it always crashes after accessing the first 3 elements on the second call
17:03:24shashlickaccessing invalid memory
17:03:55shashlickso it sounds like you are accessing an array that isn't allocated or something
17:04:12*Vladar quit (Remote host closed the connection)
17:04:15FromGitter<arnetheduck> @genotrance ah right, knew that hack would come back and bite me :/
17:04:18FromGitter<kaushalmodi> hmm, possibly a bug in the SV simulator too, I guess
17:04:43TheLemonManare you sure the array is always 10 elements long?
17:04:47FromGitter<kaushalmodi> yes
17:04:56FromGitter<kaushalmodi> TheLemonMan: yes
17:06:03FromGitter<kaushalmodi> what's interesting is that it crashes even when I call that get_nums twice, but on different 10-elem arrays each time
17:06:26FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45fc127a0f4d5b19e56f8b]
17:07:23FromGitter<kaushalmodi> if I comment out that first call or the second call to get_nums, it works
17:07:34TheLemonMandoes it crash if you don't change the values in nums?
17:07:46FromGitter<kaushalmodi> yes, crashes then too
17:07:58FromGitter<kaushalmodi> (I had already tried that)
17:08:25TheLemonManok, does it crash if you replace everything with just a single echo ?
17:09:43FromGitter<zacharycarter> hrm - does anyone else have access to nim's cloudflare account?
17:09:56FromGitter<zacharycarter> besides Dominik?
17:10:25FromGitter<kaushalmodi> TheLemonMan: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45fd009bfa375aab3935d4]
17:10:41FromGitter<kaushalmodi> so it crashes when trying to accessing the array elems
17:10:55*dom96_w joined #nim
17:11:56TheLemonManI see there's a dollar__KFm7UN9cjH9clssa0Pow9cRmg that's missing from the C code you pasted
17:12:21shashlick@kaushalmodi - where are you declaring the array?
17:12:25FromGitter<zacharycarter> nm about the cloudflare bit - I just found the original droplet creation email and it has the same IP - so something is wrong with my firewall config I assume
17:12:45FromGitter<kaushalmodi> shashlick: on the systemverilog side
17:14:08FromGitter<kaushalmodi> TheLemonMan: what does that dollar_ signify?
17:14:30TheLemonMana custom `$` proc
17:14:33FromGitter<kaushalmodi> I'm not dealing with strings in that proc, so something to do with echo?
17:15:12FromGitter<kaushalmodi> but the s_vpi_vecval is mapped to this in Nim ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c45fe2020b78635b65d2cfd]
17:15:28FromGitter<kaushalmodi> and svLogicVecVal is aliased to s_vpi_vecval (above)
17:15:42FromGitter<kaushalmodi> and we have a default `$` for objects
17:15:45FromGitter<kaushalmodi> right?
17:16:02TheLemonManoh I see, yes we do
17:16:24FromGitter<kaushalmodi> and the default `$` works as shown above: ⏎ ⏎ ```Nim: nums[0] = (aval: 10, bval: 0) ⏎ Nim: nums[1] = (aval: 11, bval: 0)``` [https://gitter.im/nim-lang/Nim?at=5c45fe681cb70a372a14f3be]
17:16:39TheLemonMantry with -gc:none
17:18:22FromGitter<kaushalmodi> that worked! woot!
17:18:24*zyklon_ quit (Read error: Connection reset by peer)
17:18:31FromGitter<kaushalmodi> but I don't understand why :P
17:19:05TheLemonManthe GC hates you :D
17:19:30FromGitter<kaushalmodi> what's special about that little code above?
17:20:38TheLemonManI guess you have to sprinkle a little magic to let the GC play well when your code is a so
17:20:56TheLemonManbut you have to ask Araq, that's outside my area of expertise
17:21:16FromGitter<kaushalmodi> hmm, thanks for your help btw
17:21:30shashlickit is probably trying to free something that doesn't belong to it
17:22:00FromGitter<kaushalmodi> also I am getting a lot of *.. uses GC'ed memory* warnings now
17:22:03FromGitter<kaushalmodi> but the code runs fine
17:22:27shashlickif you are just running one time and not staying resident, you might be fine
17:22:56FromGitter<kaushalmodi> yeah, running just one time, but I'll know for sure by the time this experiment finishes :)
17:24:15FromGitter<kaushalmodi> so is this correct paraphrasing: Nim was trying to free up the memory allocated by the C code on the systemverilog side.
17:24:36FromGitter<kaushalmodi> it should have probably associated the get_num proc args with those arrays in the memory and not touched those
17:25:10shashlickthat's why i was asking how it was being declared
17:25:26FromGitter<kaushalmodi> shashlick: that's tool internal which I cannot see
17:26:09shashlickwhat i don't get is what nim is freeing there
17:26:10FromGitter<zacharycarter> dom96: looks like I might need some assistance on the cloudflare side after all, at least according to this guide - https://www.digitalocean.com/community/tutorials/how-to-host-a-website-using-cloudflare-and-nginx-on-ubuntu-16-04 - I'm not sure I have the origin cert or private key handy anywhere
17:26:18shashlickperhaps the C code makes that clearer
17:26:55FromGitter<zacharycarter> nevermind - I guess https://play.nim-lang.org/ is no longer throwing 522 errors
17:27:08FromGitter<zacharycarter> but I can't restrict traffic to just port 443 this way through the firewall - i have to have port 80 open as well
17:27:34FromGitter<zacharycarter> this unblocks me at least for now
17:28:36FromGitter<kaushalmodi> shashlick: may be related but what surprised me was that both of these Nim-side proc signatures worked: ⏎ ⏎ ```proc get_nums2(numsRef: ref array[10, svLogicVecVal]) {.exportc.} = ⏎ ...``` [https://gitter.im/nim-lang/Nim?at=5c4601440a491251e33191d6]
17:29:03FromGitter<kaushalmodi> .. or may be that's not so surprising if I understood how the above 2 actually worked at low level
17:30:08shashlickso you don't know how get_nums() is being invoked?
17:30:19FromGitter<kaushalmodi> no
17:30:40shashlickwell then you probably want to assume you are being passed a pointer rather than a var array
17:30:49shashlickbut ya, without visibility, no idea what to think
17:31:08FromGitter<kaushalmodi> it's usually pointers for stucts, etc
17:31:28FromGitter<kaushalmodi> I tried var because I was trying to modify the passed array and it just worked
17:33:03shashlickprobably because array is managed by Nim - if you pass in an array and cast it, perhaps it might work
17:33:07FromGitter<kaushalmodi> found this public copy of the SystemVerilog 2017 standard: http://ecee.colorado.edu/~mathys/ecen2350/IntelSoftware/pdf/IEEE_Std1800-2017_8299595.pdf
17:33:19FromGitter<kaushalmodi> appendix H has the C-side implementation details
17:35:02TheLemonManhmm, how did you declare get_nums on the sysverilog side?
17:35:30FromGitter<kaushalmodi> TheLemonMan: using the SV DPI-C API
17:35:32FromGitter<kaushalmodi> ```code paste, see link```
17:36:46*zyklon_ joined #nim
17:38:40FromGitter<kaushalmodi> TheLemonMan: so do you work in the asic industry? or studying?
17:41:42TheLemonMannot really, my area of expertise is more geared towards the analogic side of the electronics
17:41:54FromGitter<kaushalmodi> hmm
17:42:54TheLemonManhave you tried using just a plain `echo nums[i]` instead of using strfmt?
17:43:28TheLemonManI really doubt SV is giving you a faulty pointer
17:44:16FromGitter<kaushalmodi> TheLemonMan: you're right
17:44:34FromGitter<kaushalmodi> I actually just removed all echoes and no crash without `--gc:none` too
17:46:24*leorize quit (Ping timeout: 252 seconds)
17:48:30*leorize joined #nim
17:49:58TheLemonMankaushalmodi, iirc modelsim is able to dump a .c file from your SV file
17:50:05FromGitter<kaushalmodi> it crashes even if I use plain echoes
17:50:39FromGitter<kaushalmodi> TheLemonMan: I don't have modelsim license .. will see if cadence has a way to do that
17:51:29FromGitter<kaushalmodi> about the crash, so, adding --gc:none prevents crash, or removing all echoes for the array elements
17:52:51TheLemonMantry without --gc:none and with GC_disable() as first call
17:53:17FromGitter<kaushalmodi> to add more detail, if I leave the echoes only in the first run of get_nums, it's fine. But the echoes in the second run causes the crash
17:54:05shashlicktrying to add empty struct support to nimterop but i get error: storage size of ?s0_X8vUbe3oSrwuT7g3oGFTjQ? isn?t known
17:54:09shashlickany ideas?
17:54:26FromGitter<kaushalmodi> yes, `GC_disable()` works too
17:55:07TheLemonManok, so impor this proc in your code https://github.com/yglukhov/nimpy/blob/8fb6428d4a92aecedb11432298e42e460b92352f/nimpy.nim#L717 and replace GC_disable with it
18:00:04leorizeis this intended? http://ix.io/1ySt
18:01:49FromGitter<kaushalmodi> TheLemonMan: `updateStackBottom` doesn't prevent the crash
18:02:35FromGitter<kaushalmodi> this is what I did: https://ptpb.pw/t1xm/nim
18:02:55FromGitter<kaushalmodi> Earlier I put `GC_disable()` in place of `updateStackBottom()` and that worked
18:04:11Araquse --gc:regions and withScratchRegion, I'm writing a blog post covering it...
18:04:32FromGitter<kaushalmodi> where should `withScratchRegion` go?
18:06:47shashlickcan you have an empty union in C like an empty struct?
18:07:32leorizeI think you can
18:07:49leorizealtho it'll be quite pointless as an empty struct can do the same
18:08:01shashlicklooks like gcc doesn't mind
18:08:05shashlickanywy, looks like i got it working
18:08:56*aguspiza joined #nim
18:08:58TheLemonMankaushalmodi: withScratchRegion:\nbody...
18:09:47FromGitter<kaushalmodi> TheLemonMan: I'll try that. Though I need to document when to use that.
18:10:00FromGitter<kaushalmodi> try something, and if it crashes, wrap in `withScratchRegion`?
18:10:02shashlickAraq: is it possible to know with macros which procs/types have been defined so far?
18:10:37TheLemonManthat's a bit too extreme, afaik the region mechanism is a very simple arena
18:11:30Araqshashlick: there is only system.declared
18:13:05FromGitter<kaushalmodi> Araq, TheLemonMan: thanks, the `--gc:region` worked too
18:13:28shashlickAraq: i need to get a list rather than check for something known - is it possible to get the AST at a particular point?
18:13:40Araqit's impossible by design
18:14:10AraqI don't like unprincipled "introspection" so that I cannot read 'proc foo' without realizing what a macro might do with it
18:14:17FromGitter<kaushalmodi> now I have this: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ and I compile with `--gc:regions` [https://gitter.im/nim-lang/Nim?at=5c460bf90721b912a5b74923]
18:14:34FromGitter<kaushalmodi> the question is, when do I know that I need to wrap the code with `withScratchRegions`.
18:14:45Araqthe 'ref array' looks completely wrong
18:15:42FromGitter<kaushalmodi> I am translating that bit from C to Nim. I found two examples online, and they both look different
18:15:46FromGitter<kaushalmodi> ex1: http://geekwentfreak.com/posts/eda/SystemVerilog_C_pass_datatypes/#passing-and-receiving-mixed-packed-and-unpacked-arrays
18:16:24FromGitter<kaushalmodi> ex2: http://www.testbench.in/DP_08_ARRAYS.html (this is badly formatted and the code doesn't even work .. look for `void fib` in there)
18:16:26shashlickAraq: okay, then what i'd need to do is take the output of parseStmt() and check if a particular node is already declared and throw it out
18:16:42shashlickthis is related to https://github.com/genotrance/nimterop/issues/56 cc @kaushalmodi
18:17:22federico3https://github.com/travis-ci/travis-ci/issues/2285#issuecomment-42724719 we can enable nice log folding in Travis CI
18:17:26FromGitter<kaushalmodi> shashlick: oh, cool!
18:17:57shashlick@kaushalmodi - might be a bunch of effort though since i'm still an amateur with the AST
18:18:22FromGitter<kaushalmodi> no worries, and that's a low priority request
18:18:31FromGitter<kaushalmodi> a nice-to-have feature
18:18:51FromGitter<kaushalmodi> as nimterop gets more robust, they shouldn't be a need for the user to override the Nim wrappers
18:18:59FromGitter<kaushalmodi> s/they/there
18:19:04shashlickwell but it's always a catch up
18:19:08shashlickusers find issues and work around it
18:19:13shashlickif i fix it then i break their stuff
18:19:27shashlickcc @irskep
18:19:31*zyklon_ quit (Read error: Connection reset by peer)
18:19:31FromGitter<kaushalmodi> fixing > breaking :)
18:19:44Araqhmm this control flow graph is like crack for compiler devs. So many useful properties become easy to compute.
18:20:35FromGitter<kaushalmodi> Araq: about your earlier comment: ⏎ ⏎ > the 'ref array' looks completely wrong ⏎ ⏎ what would be the correct approach [https://gitter.im/nim-lang/Nim?at=5c460d721cb70a372a156044]
18:20:51Araqthe 'var array' version
18:21:07Araqif you need the mutability, otherwise just the 'array'
18:21:25FromGitter<kaushalmodi> yes, I need mutability, so `var` version it is
18:21:41FromGitter<kaushalmodi> I got confused because the SV standard says that all objects are passed by reference
18:22:37FromGitter<kaushalmodi> the standard says that the `svLogicVecVal` is passed by reference, so this works: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c460ded35350772cf6941ca]
18:22:51FromGitter<kaushalmodi> but it's not clear how an array of `svLogicVecVal` is passed
18:23:01FromGitter<kaushalmodi> so I was fumbling with things and trying out what worked
18:27:23FromGitter<kaushalmodi> Araq: And we cannot have a mutable `openArray` right?
18:27:36Araqsure, var openArray is totally a thing
18:27:52FromGitter<kaushalmodi> I thought I tried that .. let me try again
18:28:47leorizekaushalmodi: note that openarray is a pair of pointer and length, so it might not be what C code expects
18:28:52FromGitter<kaushalmodi> nope, does something weird at run time, give me a min
18:29:34FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c460f8ec45b986d1198e5c1]
18:29:48FromGitter<kaushalmodi> will need to kill that terminal; it's unresponsive :P
18:29:51narimiranAraq: should https://github.com/nim-lang/Nim/pull/10400 be backported?
18:30:19*absolutejamPhone joined #nim
18:30:23shashlickhttps://github.com/nim-lang/Nim/pull/10407 should be backported i think
18:34:46FromGitter<kaushalmodi> leorize: yep, looks like the SystemVerilog side is not communicating with the libdpi on what's the expected array size and so it's inflooping
18:36:49*zyklon_ joined #nim
18:37:49Araqnarimiran: 10400 is a new feature, kind of, 10407 is a real fix though
18:38:59narimirani've seen that 10400 fixes 9418, which is reported as a problem on 0.19.0, and marked as regression
18:40:19Araqok then go for it
18:41:03narimiranok. and merge+backport 10407 once the CI is green?
18:43:07*zachcarter quit (Ping timeout: 240 seconds)
18:44:38*skellock quit (Ping timeout: 245 seconds)
18:44:46Araqsure
18:48:00*skellock joined #nim
18:53:24*ng0 joined #nim
18:55:38*zachcarter joined #nim
19:02:37ryukopostingI'm trying to put together a list of libraries/packages/whatever that are popular in Go/Rust/Python/whatever, but aren't available in Nimble yet, anyone have ideas?
19:02:59narimiranryukoposting: matplotlib :)
19:03:35ryukopostingty
19:03:36Araqhe said *popular*.
19:03:52FromGitter<alehander42> ryukoposting, you can also take a look at the nim-lang/needed-libraries
19:03:53FromGitter<alehander42> repo later
19:04:11ryukopostingoh man, didn't know that was there, thanks alehander42
19:04:29FromGitter<alehander42> but it needs to be filled with more ideas indeed
19:04:34FromGitter<alehander42> np
19:05:27ryukopostinga couple days ago I kinda just ran through the most popular projects on GitHub written in Go, cross-referenced that with nimble.directory, and made a list
19:05:31TheLemonManwith nimpy you can already use matplotlib & seaborn
19:05:50narimiranTheLemonMan: fully or just some subset of it?
19:06:44Araqmuhaha, new analysis algorithm works.
19:07:04Araqand it's obviously correct by construction, no fixpoints, no cry
19:07:06TheLemonManYMMV ofc, but I've been able to do most of my data viz w/ it
19:08:51FromGitter<alehander42> @ryukoposting great, i'd love to see it
19:09:13ryukopostingI'll type it up, it's not super descriptive, kinda just a list of things, but yknow
19:10:28narimiranTheLemonMan: that's great to hear! if you can share some non-trivial example, that would be great (and of much interest to many, i think)
19:13:06dom96_wAraq: :O
19:13:57Araqdom96_w: what?
19:14:29dom96_wAraq: regarding what you said, is this what we discussed or is this some other analysis algo?
19:14:59Araqit's not what we discussed (yet), it's the foundation for it
19:15:52Araq3 days for the infrastructure for "abstract interpretation", not too bad. But now I should fix bugs.
19:17:56FromGitter<Bennyelg> this dummy code should work somehone? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c461ae38318994524273134]
19:20:47Araqsomehow but why bother, do the inplace variant, Nim is not some shitty dialect of Haskell
19:20:47*zyklon_ quit (Read error: Connection reset by peer)
19:21:32FromGitter<Bennyelg> heheh nah I just practice in algorithms myself to cleanup some grey cells in my memory.
19:21:45FromGitter<Bennyelg> but I am keep getting stackoverflow :/
19:25:25FromGitter<Bennyelg> was missed that: ⏎ ⏎ ``` if item == pivot: ⏎ continue``` [https://gitter.im/nim-lang/Nim?at=5c461ca4cb47ec30007d7051]
19:25:31*absolutejam joined #nim
19:29:21ryukopostingalehander42 https://dailyprog.org/f/dnpq/ it's a bit of a mess, but just a few things I came across
19:29:38*Sembei quit (Ping timeout: 245 seconds)
19:29:47*MyMind joined #nim
19:36:11*absolutejamPhone quit (Remote host closed the connection)
19:36:29*absolutejamPhone joined #nim
19:37:58*zyklon_ joined #nim
19:43:39FromGitter<irskep> How up-too-date is this book? https://www.manning.com/books/nim-in-action
19:44:22FromGitter<irskep> Published 2017; how much has the language changed?
19:46:31Araqsome examples in there require --nilseqs:on but that's it.
19:46:43Araqthe programs and snippets are part of our test suite
19:47:35*nsf quit (Quit: WeeChat 2.3)
19:52:28FromGitter<zetashift> Seems like that is a common question(about Nim in Action) maybe add it to the FAQ? https://nim-lang.org/faq.html
20:01:42dom96_wAraq: do they? IIRC there isn't more than 1 if any at all
20:06:12*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:07:44*birdspider joined #nim
20:13:49*Jesin quit (Quit: Leaving)
20:14:25*birdspider quit (Remote host closed the connection)
20:15:54*Jesin joined #nim
20:17:12*flaviu joined #nim
20:18:37Araqflaviu: hey, welcome back
20:38:06*narimiran quit (Ping timeout: 250 seconds)
20:42:50*Trustable quit (Remote host closed the connection)
20:55:28*banc quit (Ping timeout: 245 seconds)
21:00:06*banc joined #nim
21:10:41*TheLemonMan quit (Quit: Page closed)
21:35:08flaviuoh, hi Araq, nice to see you all again!
21:35:40ZevvDocumentation for symbols with {.async.} pragma is lost in bleeding edge docs.
21:35:54ZevvThe symbols are available, but all ## docs are missing
21:36:09AraqZevv: we know and have a PR addressing it
21:36:15Zevvok
21:36:23Araqand we'll also backport this fix
21:36:35AraqI'm sure 0.19.2 is also affected
21:36:44ZevvI was just wondering for 40 minutes why my own text didnt show up while adding documentation
21:36:49Araqwell no, I'm not sure at all. But I guess.
21:37:01Zevvthanks
21:40:06Zevvnaming issue: option for generating docs for non-exported objects: --docUnExported? --docInternal? --docAll? --otherIdeas?
21:46:40ryukopostingAraq 0.19.2 and 0.19.0 are both affected, have not tested 0.19.1
21:49:15Araq--docInternal is great
21:53:22FromGitter<zacharycarter> The frontend for https://play.nim-lang.org/ is back up - the backend I haven't started on yet
21:55:03Araq!echo "test"
21:55:22Araqhmm not for NimBot.
21:55:43FromGitter<zacharycarter> well I think NimBot depends on the playground's backend being up
21:55:56FromGitter<zacharycarter> also - I probably need to add some more config to nginx to handle routing to the backend service
21:56:05FromGitter<zacharycarter> I will work on these things tonight - taking a break for now
21:59:00Zevvzacharycarter: what time zone are you in?
21:59:06Araqbad news for you then. it's already "tonight".
21:59:12Araq:P
21:59:26Zevvbut: the night is still young!
21:59:56FromGitter<zacharycarter> Zevv: EST
22:00:00FromGitter<zacharycarter> so it's only 5PM here
22:00:30ZevvAraq: how many hours a week do you actually spend on Nim. I think I've seen you here 7 days a week from 07.00 to 23.00?
22:01:06ZevvOh now you can't answer, its after 23.00 :)
22:02:42Araqusually weekends are reserved for my family. But they need more sleep than I do, so the weekend is also for Nim related research projects...
22:07:25absolutejamAraq: if you don't mind me asking, is Nim your primary job?
22:09:32Araqyes
22:10:32absolutejamwhat makes more sense for a CLI/shell type program - `appname <get/update/create/delete> <x/y/z>` or `appname <x/y/z> <get/update/create/delete>`?
22:11:14absolutejamI was thinking verb first, but if I do category (x/y/z) first, I could have it 'enter' the category for repeated use
22:11:15Araqright now our team of paid developers consists of krux02 and narimiran and me. Thanks to Status's superb involvement.
22:11:16ZevvI'd say the latter, but that's just me
22:11:38absolutejamah, that's awesome
22:11:46absolutejamI wasn't sure how big the team was
22:11:52ZevvOh narimiran as well, I didn't know, cool
22:12:23ZevvI always though dom96 was also on the list
22:12:32krux02hi from the team
22:13:10ZevvHey there team :)
22:14:25Zevvabsolutejam: you do "git show ae5d8fb", not "git ae5d8fb show". You do "nim c test.nim" not "nim test.nim c"
22:14:36krux02btw, I am often online, and when I am online I am also most of the available. I am just not that much actively writing here anymore as I used to. But when you wrtie me directly I will answer.
22:14:46ryukopostingwas about to say that Zevv
22:15:03Zevvkrux02: what's your specialism in Nimland?
22:15:17dom96Zevv: Maybe someday... :)
22:15:19*skellock quit (Quit: WeeChat 2.3)
22:16:03krux02my personal goal for Nim to is say no to new features. Set constraints for existing features and generally get thing to a point where one can say that they are done.
22:16:55krux02but specifically I do macros, sizeof alignof, bugfixes etc
22:17:07Araqgdb support...
22:17:11krux02yes
22:17:15krux02forgot to mention that
22:17:22krux02I worked on that today as well.
22:17:48AraqI didn't work today. Had so much fun that I cannot call it "work".
22:17:48krux02gdb support should survive a binary reload now
22:17:50Zevvgood to know! I always think of Nim as araq->compiler and dom96->stdlib. You guys should do more PR about the team and say hi to the community
22:18:39Araqwe're producing videos.
22:18:53Zevvtrue
22:19:11Araqin fact. I should upload the one we produced on friday.
22:19:35absolutejamthat's awesome
22:19:38absolutejamcan't wait
22:20:28*skellock joined #nim
22:20:54rayman22201❤️ Yay videos!
22:22:59dom96Zevv: I guess I am sort of responsible for the stdlib, nowadays narimiran is taking on more of that role. I do still volunteer as much as I can and complain if I disagree with the direction it's going ;)
22:23:41Zevvcomplaining is important work, never stop :)
22:23:41*zyklon_ quit (Read error: Connection reset by peer)
22:25:26shashlicknice to see all this growth 🙂
22:27:00ZevvWell, very nice to officially have met the team guys! I must say that #nim is a very welcome place; you're all patient with all the stupid questions I keep coming up with. Keep up the good work!
22:27:16*Zevv off to bed now. I always loved to work nights, but it breaks me up these days.
22:27:25Araqgood night.
22:27:46krux02I mean I work now for Nim, so I shouldn't say anything else. But I personally think that Nim is such a good language by now that I just expect growth. It is just hard to convince people of a new language. A language is like a religion to people.
22:28:12krux02maybe just showing off cool things you can do in Nim with videos is a good way to attract at least some people.
22:28:41krux02but I have to say good night for now as well. I have to get up early again.
22:28:45krux02bye
22:31:20FromGitter<arnetheduck> nimble lock files being discussed here, in case you missed it: https://github.com/nim-lang/nimble/issues/127
22:34:50*krux02 quit (Remote host closed the connection)
22:37:29dom96Araq: Yeah, not sure about JSON
22:37:57dom96It's more likely these will be edited manually by a human than by some random utility
22:38:40Araqwhy would they? you sail 'nimble pin' and Nimble produces one.
22:41:49*zyklon_ joined #nim
22:42:25dom96Yeah, alright. I don't really mind.
22:46:27absolutejammakes sense Zevv ryukoposting, thanks
22:47:00absolutejamHey, I shilled Nim earlier on Reddit!
22:47:17absolutejamIt seems like Crystal has more renown yet it seems lacking in comparison to Nim
22:47:32absolutejamThe only reason I found Nim was when exploring Crystal and other languages
22:50:48FromGitter<arnetheduck> there's utility in the lock file being readable, for comparing what's going on with deps and editing manually.. there's no real gain in being cryptic about it - that said, json or toml is similar in this sense, don't expect people to comment their lock files really.. toml is the fad of the day though
22:54:06Araqhmm I typed "sail" instead of "say". Time to sleep.
22:54:36*aguspiza quit (Ping timeout: 250 seconds)
22:54:58dom96Araq: or is it time to buy a boat? :P
22:56:29FromGitter<deansher> I am preparing to create a PR for manual.rst. I checked out a fresh (forked) devel branch and ran `build_all.sh`. When I run `./koch docs` or the individual `bin/nim rst2html` command that koch uses for manual.rst, I see 8 lines like `manual_snippet_101.nim(10, 5) Error: ...` Is this a known thing, or a problem with my Nim compile?
22:59:07Araqsome snippets are expected to fail
22:59:31Araqjust bad error reporting, if koch docs says it's good then it is good
22:59:57FromGitter<deansher> Ok, thanks Araq.
23:08:02FromGitter<JasperJenkins> How would I initialize a `ref HashSet`? This is what I have: `let initialized: ref HashSet[Num] = new(initSetNum ())`
23:18:09AraqnewHashSet[Num]()
23:23:01*absolutejam quit (Ping timeout: 268 seconds)
23:25:02FromGitter<JasperJenkins> Misunderstood what new() did. sets doesn't come with builtin ref variants like tables does :(
23:28:19Araqah yeah, use the value based variants
23:53:39*ng0 quit (Ping timeout: 256 seconds)
23:56:31*ng0 joined #nim
23:58:10*skellock quit (Ping timeout: 268 seconds)