<< 27-02-2019 >>

00:11:49FromGitter<coocheenin> @FromIRC <shashlick> thank you! I will check tomorrow.
00:12:07ryukopostingdid somebody say musl
00:14:18*matti quit (Quit: Oh dear ...)
00:17:27*matti joined #nim
00:27:02*stefanos82 quit (Remote host closed the connection)
00:27:53*leorize joined #nim
00:33:26*rockcavera joined #nim
01:00:28*dddddd quit (Remote host closed the connection)
01:02:09*noeontheend quit (Ping timeout: 244 seconds)
01:12:00*ptdel joined #nim
01:12:39*carlosmmiranda[m left #nim ("User left")
01:18:44ptdelHello. I'm a stodgy, corporate type from a Python/Typescript shop that lurks the Nim repos. Just stopping by to say please keep up your great work, I love seeing this group dedicated to the language and it's stdlib. My coworkers are already impressed and refreshed by the functionality inherit to Nim, we are cheering for you.
01:22:51*icebattle quit (Quit: leaving)
01:27:14ryukoposting^
01:28:33FromGitter<brentp> I am getting ` Error: Cannot satisfy the dependency on c2nim #3ec45c24585ebaed and c2nim 0.9.14` on a `nimble install` but I can't find what is depending on 0.9.14. Is there a way to make that more obvious?
01:28:49FromGitter<brentp> nimgen is pinned to 3ec45c24585ebaed
01:29:22shashlickbrentp on the road
01:29:33shashlickBut I ran into this recently
01:29:41shashlickWhat packages do you require
01:30:35FromGitter<brentp> @shashlick: https://github.com/brentp/slivar/blob/master/slivar.nimble#L21
01:31:00FromGitter<gogolxdong> Hi, shashlick , morning.
01:31:14*onionhammer joined #nim
01:33:31*onionhammer1 quit (Ping timeout: 246 seconds)
01:34:47shashlickHey @gogolxdong
01:35:13shashlickbrentp I know duktape used nimgen, need to check the others
01:35:50shashlickI had to pin since the newer hash broke something
01:36:52FromGitter<gogolxdong> Do you mean C++ AST mapping to Nim is not completed in nimterop?
01:37:00FromGitter<brentp> yes, duktape uses, but I don't seen anything else. I went through the deps recursively and didn't see where it was defined.
01:37:33FromGitter<brentp> ... defined to require c2nim 0.9.14
01:38:16shashlickhttps://github.com/nim-lang/c2nim/commit/be3e8b9ab81c25cc0cb10b1ae117da57f71560e3#r31256227
01:38:21*ng0 quit (Quit: Alexa, when is the end of world?)
01:39:07FromGitter<gogolxdong> Is it the matter of so much code to do as well?
01:40:32*zachk quit (Quit: Leaving)
01:41:38shashlick@gogolxdong ya I've not gotten that far yet, still since c stuff remains
01:41:52shashlickDo want to get that right before going to c++
01:41:59shashlickYou can use c2nim though
01:42:34shashlickbrentp ya I'm not sure I remember, let me try and find out
01:44:15FromGitter<brentp> @shaslick looks like it might have been fixed: https://github.com/nim-lang/c2nim/issues/131
01:44:47FromGitter<gogolxdong> checked cpp parser of treesitter , 144K loc is overwhelming
01:44:51FromGitter<brentp> nevermind. I guess that's when it was broken. :(
01:46:48FromGitter<gogolxdong> c2nim doesn't process cpp properly as well, iirc
01:48:39FromGitter<gogolxdong> It seems have to farm manually.
01:51:08*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:51:21shashlick@gogolxdong if you can identify the files to wrap, I can give it a go
01:51:45shashlick@brentp is duktape c or c++
01:51:52*rockcavera quit (Remote host closed the connection)
01:52:11FromGitter<gogolxdong> What's your time now?
01:53:40FromGitter<gogolxdong> I could extract the dependency according to the gn ninja make file sent last night.
01:55:36*rockcavera joined #nim
01:56:09FromGitter<brentp> @shashlick it is C
01:58:03FromGitter<gogolxdong> tools/quic/quic_simple_client_bin.cc
01:58:08FromGitter<gogolxdong> tools/quic/quic_simple_server_bin.cc
01:59:22*noeontheend joined #nim
02:01:01shashlickNeat
02:05:36FromGitter<gogolxdong> For the deps I suggest you fetch the code entirely, as the instruction.
02:10:54shashlickbrentp: testing with devel from few days ago on Windows
02:11:21FromGitter<brentp> it's odd. I can get it to work on my machine, but it fails in a docker container.
02:11:58shashlickthat's cause something is already installed
02:12:07shashlickbpbio isn't installing with devel
02:12:10shashlickshould I install #head
02:14:30shashlickwell it's cause duktape isn't installed
02:15:28shashlickhmm, I don't have hg so it is unable to install duktape for me
02:16:20shashlickwhy is it asking for hg
02:19:27shashlicksome nimble bug which causes #dev to make it run hg
02:29:12*abm quit (Ping timeout: 245 seconds)
02:29:23FromGitter<brentp> hmm. yeah. I tagged bpbio v0.1.2, but now that's not building for me. I'll start there. thanks for looking into it.
02:37:49*rockcavera quit (Remote host closed the connection)
03:01:03FromGitter<brentp> @shashlick not sure what's with the error message about c2nim, but there is a problem in duktape-nim because https://github.com/brentp/duktape-nim/blob/dev/duktape/src/duktape.h#L213 is a forward decl, then there's a type def, then the actual definition: https://github.com/brentp/duktape-nim/blob/dev/duktape/src/duktape.h#L244
03:02:35*banc quit (Quit: Bye)
03:06:01FromGitter<brentp> oh. that only occurs with the more recent c2nim
03:11:50*theelous3 quit (Ping timeout: 244 seconds)
03:18:37FromGitter<brentp> so. I got the dockerfile working by adding `nimble install -y c2nim@#3ec45c24585ebaed` explicitly. not sure why that works but I'll take it.
03:23:29shashlickIf duktape is c, you can just use nimterop directly
03:23:35*banc joined #nim
03:23:37shashlickNo complicated dependencies
03:23:52shashlickOr just check in the generated Nim code
03:24:21*nsf joined #nim
03:26:12shashlickBut if that works, don't bother
03:30:26FromGitter<brentp> I'll leave it for now, would have used nimterop, but someone had already started duktape using nimgen.
03:32:59shashlickYa it's been around for a while
04:08:44FromGitter<brentp> it's not possible to do: `nimble install "somepkg >= 1.0"` ?
04:08:55FromGitter<brentp> only `nimble install "somepkg"`
04:15:48*amosbird_ joined #nim
04:19:08*amosbird_ is now known as amosbird
04:23:16*noeontheend quit (Ping timeout: 246 seconds)
04:42:35shashlickYou can in the require statement I think
04:51:25*noonien quit (Quit: Connection closed for inactivity)
04:54:27*noeontheend joined #nim
05:06:39*leorize quit (Quit: WeeChat 2.3)
05:28:53FromGitter<gogolxdong> @shashlick , around?
05:30:29FromGitter<gogolxdong> I made a repository for extracted dependencies to build quic_server and quic_client. https://github.com/gogolxdong/QUIC
05:31:00FromGitter<gogolxdong> which still has 30MB
05:33:36shashlickGoing to bed, and a busy couple days but I will take a look on Friday
05:38:11FromGitter<gogolxdong> sure, good night.
06:03:01*noeontheend quit (Ping timeout: 246 seconds)
06:06:41*Arlenx joined #nim
06:12:34*narimiran joined #nim
06:37:20*leorize joined #nim
06:42:45*ptdel quit (Remote host closed the connection)
06:58:52*Arlenx quit (Quit: Leaving)
07:08:59*Vladar joined #nim
07:14:51*krux02 joined #nim
07:28:48*pwntus joined #nim
07:38:10*amosbird left #nim ("WeeChat 2.4")
07:47:32*rockcavera joined #nim
08:00:00*gmpreussner_ quit (Quit: kthxbye)
08:04:54*gmpreussner joined #nim
08:07:19*PMunch joined #nim
08:09:04*rockcavera quit (Remote host closed the connection)
08:14:49FromDiscord<Zireael> hey guys, I am using a dll for native app, but I would like to have a web version of the same app. is there a way to tell nim compiler to ignore this line (e.g. this one dynlib import) if compiling for javascript?
08:15:04FromDiscord<Zireael> I've looked through the docs and can't figure it out
08:16:03PMunchwhen defined(js)
08:16:07PMunchOr something like that
08:18:58PMunchgithub.com/nim-lang/Nim/wiki/Consts-defined-by-the-compiler
08:19:12FromDiscord<Zireael> aaa, one place I haven't tried looking, thanks
08:20:30PMunchYeah, this works: http://ix.io/1C91/Nim
08:20:41PMunchNo problem :)
08:22:32FromDiscord<Zireael> are there any app/game cross-platform framework/engines? I have tried searching github and I'm having trouble finding stuff that isn't, like, 3 years old
08:28:09PMunchDepends on what exactly you're looking for
08:28:25PMunchFor a game you can use SDL cross-platform
08:28:59PMunchI guess the Godot bindings could do that as well
08:29:21FromDiscord<Zireael> I want to leverage webgl 1 because some phones have sucky webgl2 support
08:29:31FromDiscord<Zireael> (webgl 1 for web, obviously)
08:29:57FromDiscord<Zireael> I don't think SDL bindings can be used with js target, because well, they use a dynlib...
08:30:22PMunchSo you're writing a web-based game for phones?
08:32:15*rockcavera joined #nim
08:32:38PMunchI guess you could try the bgfx bindings: https://github.com/Halsys/nim-bgfx
08:35:15*rockcavera quit (Remote host closed the connection)
08:38:42PMunchYou should be able to use SDL with emscripten I think
08:38:51FromDiscord<Zireael> yeah, pretty much - I tried my Godot game's build on my own phone and nope, doesn't work because sucky drivers on said phone
08:39:18FromDiscord<Zireael> and I want the game to be playable on my own device, so... 😛
08:40:14FromDiscord<Zireael> bgfx... oh wow, it supports webgl 1 too? ❤ thanks a lot
08:41:11*rockcavera joined #nim
08:43:59PMunchHave you tried SDL on your phone?
08:44:25FromDiscord<Zireael> SDL is something I never tried using so far 😛 - I only heard of it
08:45:45PMunchI've got it running on my phone, with pretty decent performance even :)
08:46:39PMunchforum.nim-lang.org/t/640
08:47:44*NimBot joined #nim
08:47:53PMunchUh oh, you alright there NimBot?
08:48:07PMunchforum.nim-lang.org/t/640
08:48:27*JustASlacker joined #nim
08:52:54*bobby quit (Ping timeout: 268 seconds)
08:54:30*bobby joined #nim
09:02:18*bobby quit (Ping timeout: 258 seconds)
09:02:37*bobby joined #nim
09:06:44*floppydh joined #nim
09:09:37*cornfeedhobo quit (Ping timeout: 245 seconds)
09:24:19*neceve joined #nim
09:33:23FromGitter<coocheenin> @shashlick, Morning! Could you so glade to share your 32bit binary (via hbb) of nimble and other nim-tools, that are created during koch execution? NIM Compiler itself working like a charm.
09:43:51PMunchIf the Nim compiler works it should be possible to build to other tools with it
09:56:29FromGitter<alehander42> what happened to @timotheecour
09:56:40FromGitter<alehander42> i havent seen commits by him lately
09:58:27FromGitter<coocheenin> ☝️ February 26, 2019 11:20 PM (https://gitter.im/nim-lang/Nim?at=5c759fab4a65f754733091df) @PMunch Sad, but no way
09:59:24PMunchAah I see
09:59:42PMunchalehander42, yeah I haven't seen him around lately either
10:03:35*kapil____ joined #nim
10:12:00*abm joined #nim
10:39:08*couven92 joined #nim
10:56:14FromGitter<mratsim> 🎆 https://github.com/nim-lang/Nim/commit/ca4b971bc81b2e751e0388d80896fde7079b1679
11:01:55*dddddd joined #nim
11:23:39*cornfeedhobo joined #nim
11:29:34*Pisuke quit (Ping timeout: 250 seconds)
11:29:36*Sembei joined #nim
11:50:51PMunchmratsim, wow really?
11:50:57PMunchIt's now in Nim devel?
11:51:29*ng0 joined #nim
12:17:05FromGitter<kaushalmodi> @alehander42 yeah, I was wondering the same .. missing @timotheecour around here
12:24:02shashlick@coocheenin: where should I upload the binary?
12:25:51shashlick6.5mb around
12:33:54*leorize quit (Ping timeout: 258 seconds)
12:35:38*leorize joined #nim
12:38:54shashlickHere try this link - https://transfernow.net/21ivp4d7pi00
12:39:04shashlickExpires in 6 days
12:40:12FromGitter<coocheenin> @shashlick Done! Thanks a lot.
12:43:11shashlickHere are the scripts to make this yourself
12:43:16shashlickhttps://gist.github.com/genotrance/8789260aff1570c7c5fe930eaba7ce33
12:43:28shashlickLet me know if the bin works
12:44:26shashlickHoly build box scripts to build Nim Linux binaries that work across distros
12:52:55*lritter joined #nim
13:02:19*waleee joined #nim
13:13:36*Vladar quit (Remote host closed the connection)
13:33:11*theelous3 joined #nim
13:34:57narimiransanity check: https://nim-lang.github.io/Nim/lib.html
13:35:12narimirancan somebody try to click on any of the modules?
13:35:26*kungtott1 is now known as kungtotte
13:35:32*kungtotte quit (Quit: leaving)
13:35:42*kungtotte joined #nim
13:35:55*Snircle joined #nim
13:36:32FromGitter<zetashift> All 404 on me
13:36:39FromGitter<zetashift> well all I tried*
13:36:50narimiranok, same here
14:00:57shashlickDitto
14:02:44narimiranand they worked couple minutes before that
14:03:15FromGitter<mratsim> 404 as well
14:06:36FromGitter<coocheenin> @shashlick Of course. Will do.
14:06:42FromGitter<coocheenin> 404 too
14:15:19PMunch404 here as well
14:15:20PMunchOuch
14:18:25*noeontheend joined #nim
14:31:42FromGitter<qqtop> the posix module in the index has gone awol too
14:40:43FromGitter<kaushalmodi> narimiran: I have my local build on the commit prior to that last big commit
14:40:54FromGitter<kaushalmodi> and the docs built using that are working fine
14:41:21FromGitter<kaushalmodi> Do the docs built using that latest commit work fine for you locally? (I haven't tried)
14:41:27narimiran@kaushalmodi "the last big commit" = hot code reloading?
14:41:32FromGitter<kaushalmodi> yes
14:41:41narimirandocs worked fine even after it
14:41:53FromGitter<kaushalmodi> hmm ok
14:43:08narimiranlast commit to `gh-pages` was at 14:07 (hour and a half ago)
14:44:25narimiranand i noticed things stopped working couple of minutes after that
14:44:39*PMunch quit (Remote host closed the connection)
14:45:21narimiranhmmm, could this be some github/travis glitch so maybe just another commit to devel will make the pages work again like before?
14:46:24FromGitter<kaushalmodi> no, it won't
14:46:35FromGitter<kaushalmodi> I see https://github.com/nim-lang/Nim/tree/gh-pages/threads/threads.html
14:46:48FromGitter<kaushalmodi> it should have been https://github.com/nim-lang/Nim/tree/gh-pages/threads.html
14:46:51shashlickAraq: https://github.com/nim-lang/nightlies/commit/2f7c65c10979c954a1f6cc26d86e0eca73f7c594#commitcomment-32501780
14:46:58FromGitter<kaushalmodi> somehow that extra folder got introduced inbetween
14:48:10FromGitter<kaushalmodi> narimiran: That threads.html was just one example; I am seeing `../foo/foo.html` for every module
14:48:27FromGitter<kaushalmodi> it should have been either `../foo.html` or `../foo/index.html`
14:48:44narimiranhmmm, yeah, look at this: https://nim-lang.github.io/Nim/system/system.html
14:50:00narimiranyou're right, an extra folder got introduced somewhere and somehow
14:50:35shashlickkaushalmodi: I've posted my holy build box scripts to build a generic linux binary of Nim - can you please take a look and see what's the best way to integrate into nightlies? cc Araq
14:50:37shashlickhttps://gist.github.com/genotrance/8789260aff1570c7c5fe930eaba7ce33
14:51:01narimiranhttps://github.com/nim-lang/Nim/commit/ca4b971bc81b2e751e0388d80896fde7079b1679#diff-3cb9f480d71020c8cd3d36be5bdd73afL955
14:51:15shashlickcurrent nightlies creates an xz file which can run through this script and create a binary, but that would mean two full builds
14:51:19FromGitter<kaushalmodi> narimiran: the "big commit" is touching docgen.nim and docgen2.nim
14:51:31narimiran@kaushalmodi, yep, just shared a link
14:51:33FromGitter<kaushalmodi> you might want to review that
14:53:02FromGitter<kaushalmodi> shashlick: I haven't tried but it looks promising
14:53:15FromGitter<kaushalmodi> can you put that info in an issue on nightlies so that we don't lose that?
14:53:50shashlickokay cool
14:54:16FromGitter<kaushalmodi> i'm about to get busy with personal life (moving house, emergency international trip coming up), and I won't be able to focus on this for a while
15:02:25FromGitter<matrixbot> `Juan Carlos` Oh, good luck with that!.
15:17:33shashlickAraq: https://github.com/nim-lang/nightlies/issues/22 cc @kaushalmodi
15:18:51shashlickwhile we are at it, I'll appreciate anyone who has a 32-bit linux - old or new - to test this nim binary package and confirm if it works on your install - https://transfernow.net/21ivp4d7pi00
15:33:03*neceve quit (Remote host closed the connection)
15:33:07*rnrwashere joined #nim
15:46:28*rnrwashere quit (Remote host closed the connection)
15:49:20*oz left #nim ("WeeChat 2.4")
15:49:33*oz joined #nim
16:07:19*JustASlacker quit (Remote host closed the connection)
16:11:51*rnrwashere joined #nim
16:33:10FromGitter<alehander42> Araq
16:33:18Araqwhat?
16:33:20FromGitter<alehander42> how can i make renderer.nim render `:` for command and list
16:33:37FromGitter<alehander42> currently it just does `,`
16:34:01FromGitter<alehander42> i mean is there an option, or does it make sense to PR this
16:34:18AraqI'm not sure we keep the information in the typed AST
16:36:27*sealmove joined #nim
16:37:37*rnrwashere quit (Remote host closed the connection)
16:38:23*rnrwashere joined #nim
16:40:35*Vladar joined #nim
16:42:07Araqyou could introduce yet-another silly node flag, but at some point we gotta accept that after syntax sugar elimination we're dealing with a Lisp
16:42:49*shadowbane quit (Ping timeout: 246 seconds)
16:43:20*ng0_ joined #nim
16:43:35*ng0 quit (Remote host closed the connection)
16:43:36*shadowbane joined #nim
16:54:40*ng0_ is now known as ng0
16:55:58*rockcavera quit (Remote host closed the connection)
17:12:48leorizelooks like httpclient doesn't support basic authentication
17:17:30*Trustable joined #nim
17:17:48*flaviu quit (Remote host closed the connection)
17:21:59*stefanos82 joined #nim
17:22:14*nsf quit (Quit: WeeChat 2.4)
17:30:06FromGitter<alehander42> Araq but I am not sure: if we have a stmtlist
17:30:17FromGitter<alehander42> Doesn't it always make sense to generate :
17:30:28FromGitter<alehander42> Even without type info
17:31:01FromGitter<alehander42> If the last argument to a comman ⏎ d is a stmtlist
17:31:18Araqthat's true
17:36:46*rockcavera joined #nim
17:37:59FromGitter<alehander42> Ok I can make a pr for that
17:42:22*Jesin quit (Quit: Leaving)
17:43:58Araqok
17:44:33*Jesin joined #nim
17:47:45FromDiscord<Zireael> let's say I want to use a js rendering library with nim, I understand {.importc } is used, but the only example in the docs is with a function (proc)
17:47:45FromDiscord<Zireael> does this work on e.g. JS classes?
17:52:40leorizefor those, we use importcpp
17:53:12rnrwashereDoes anybody now how can I reliably wait for a flowvar. Right now I am getting SIGSEGV on blockUntil
17:53:33rnrwashereI did ^res
17:54:24leorizetry this threadpool instead: https://github.com/yglukhov/threadpools
18:00:18FromDiscord<Zireael> eh, documentation sucks then - it tells me to use .importc https://nim-lang.org/docs/backends.html
18:01:05narimiranPRs welcome
18:03:29leorizeZireael: There's also the jsffi module that should simplify interfacing with js
18:04:12rayman22201HCR is merged in develop!? Awesome. 🎉
18:05:28leorizenarimiran: has the docs been fixed?
18:06:36narimiranleorize: devel docs that stopped working earlier today? nope, no new commits since then
18:07:51*xet7 quit (Ping timeout: 250 seconds)
18:08:44narimirani asked HCR guys why `docgen` was modified in the first place. waiting for the answer....
18:10:58leorizeI'd say prepare a hotfix as a PR then tag them there :p
18:14:25shashlickleorize: how is yglukhov's threadpools different from the stdlib implementation
18:14:30shashlickwish there was more docs
18:14:56leorize@yglukhov ping
18:15:20leorizeI haven't checked up on the impl, but for the most part, it doesn't crash when stdlib's threadpool does :P
18:16:17shashlick🙂
18:20:08*xet7 joined #nim
18:21:32FromDiscord<demotomohiro> This code cause compile error. Is it a bug?
18:21:32FromDiscord<demotomohiro> https://wandbox.org/permlink/mjenBFrJtqjNxWvA
18:22:50FromGitter<dandevelo> Are there any plans to support import for C constants in Nim?
18:23:13leorizeit's always been possible, not recommended though
18:23:28FromGitter<dandevelo> @leorize how is that possible?
18:23:48leorizesomething like this: https://github.com/nim-lang/Nim/blob/devel/lib/posix/posix_other_consts.nim
18:25:56FromGitter<dandevelo> @leorize I know this is possible for vars, I am looking for consts
18:26:17FromGitter<dandevelo> @leorize vars can not be used at compile time
18:26:34leorizeuse nimterop :P
18:26:54leorizeit'll automatically wrap any C header, and you'd not have to worry about consts
18:27:28leorizedemotomohiro: does seem like a bug to me
18:28:41narimirandemotomohiro: remove pragma and it works
18:29:06narimiranhttps://nim-lang.github.io/Nim/manual.html#pragmas-compiletime-pragma
18:30:35FromGitter<dandevelo> @leorize, nimterop seems like overkill for this. Not sure why this is possible with Nim. It works for procs and types, but not for consts
18:30:56FromGitter<dandevelo> *why this is not possible with Nim
18:31:17leorizebecause for proc we don't need to parse anything
18:31:36leorizeruntime are simple
18:32:05leorizecompile time is the hard part :P
18:32:16FromGitter<dandevelo> i mean procs imported with header pragma instead of dynlib
18:32:57leorizeyou can't check if an imported identifier is a const
18:33:08leorizeNim's approach to {.header.} is optimistic
18:33:36leorizeit just include the header, then assume that whatever in that header will match your declared procs/vars
18:33:52leorizethen generates call as written in C
18:34:03FromGitter<dandevelo> Yes, that's what I am interested in
18:34:10FromGitter<dandevelo> Why do you see that as a problem?
18:34:20leorizeit does not parse the header
18:34:25FromGitter<dandevelo> Why does it need to check if an imported indentified is a const?
18:34:25leorizeit just includes it
18:34:31FromGitter<dandevelo> Why should it parse it?
18:34:56leorizeyou can't identify if something is a const, much less taking the value without knowing what it contains
18:35:25FromGitter<dandevelo> But the real question here is: why do you want to identify if something is a const?
18:35:52leorizethe real question is: how can you get the value for use in compile time if you don't parse it?
18:36:27FromGitter<dandevelo> You simply write it in the generated C file the same way you would write C
18:36:50leorizethen vars should work just fine
18:36:57FromDiscord<demotomohiro> @narimiran it works after removing compileTime pragma, but it should work with compileTime pragma, isnt it?
18:37:14leorizeconsts are for the compiler to evaluate during compile time
18:37:26leorizethe compiler here is Nim compiler, not the underlying C compiler
18:37:26FromGitter<dandevelo> You mean the C compiler, right?
18:37:55FromGitter<dandevelo> The Nim compiler is interested about the type of that const
18:38:03FromGitter<dandevelo> Not the value of that const
18:38:19leorizenope, the value is needed for compile time evaluation within Nim's VM
18:38:21FromGitter<dandevelo> And you specify the type of that const when you import it. Same way you do for types
18:38:50leorizemost of the constant folding is done by the nim compiler
18:39:30FromGitter<dandevelo> That's what I am interested it, for consts that the Nim compiler would just leave in their original form (generated in the C file)
18:40:01leorizethe "pseudo" vars I showed you do just that
18:40:18FromGitter<dandevelo> They can't be used in case statements
18:41:00leorizeyea, case statements require that the value is known by the Nim compiler
18:41:51FromGitter<dandevelo> If the case statements checks a proc argument, how would the Nim compiler know the value of the proc argument?
18:42:24leorizewhat do you mean?
18:43:30leorizeoh, what I mean was the `of` within case stmts requires constant as the operand
18:43:44leorizeconsts that are known to the Nim compiler
18:44:24shashlickdandevelo: just catching up - when you say const, are you saying #define or actual C vars
18:44:33FromGitter<dandevelo> #define
18:44:36FromGitter<dandevelo> sorry
18:44:43FromGitter<dandevelo> I mean #define
18:44:45shashlickya a #define doesn't really exist in C
18:45:01shashlickit is effectively a search/replace in the code
18:45:13shashlickthat the preprocessor does
18:45:26FromGitter<dandevelo> Yes, that is why I am surprised this is not possible with Nim. It is simply a search/replace
18:45:59leorizeYou'd need to parse the header to get the value for search 'n replace :P
18:45:59FromGitter<dandevelo> I mean that #define would be written as it is in the generated C file and the C preprocessor would take care of it
18:46:18FromGitter<dandevelo> Actually the C compiler needs to do that, not the Nim compiler
18:46:31shashlickI know it is used for constants but Nim doesn't see any such thing since it talks to the compiled binary which doesn't have this at all
18:46:46shashlicki think an example of what you want to do will help
18:46:57FromGitter<dandevelo> Sure
18:48:02FromGitter<dandevelo> When using constants like WM_CREATE from windows.h, Nim writes 1 instead of WM_CREATE in the generated C file. When debugging this and setting breakpoints, it helps to see WM_CREATE instead of 1 in the generated C file
18:49:17shashlickhow is WM_CREATE declared in Nim?
18:49:57FromGitter<dandevelo> That's the problem, I don't have a way to declare it except for writing its actual value const WM_CREATE = 1
18:50:20leorizeyou should use --linedirs: on
18:50:45leorizethat'll generate lines directive pointing to the .nim file and not the .c
18:51:01shashlickso that's something we can ask Araq - instead of writing out the value in the rendered C, he could use a #define and not the actual value
18:51:03FromGitter<Varriount> @dandevelo I believe you might be able to use importc on the constant, in order to get that.
18:51:32FromGitter<dandevelo> @shashlick that would be great
18:51:53shashlickbut he might probably ask you why you are debugging the C code and not the Nim code
18:52:02shashlickthat's what leorize is also alluding to
18:54:31shashlickhave you seen the video and blog post explaining how to debug Nim with gdb
18:54:50shashlickit's far better to debug the code you wrote than the code Nim rendered
18:55:46FromGitter<dandevelo> I guess the reason why I wanted this was to peek at the generated C code as I am debugging it. Maybe my C background should get a rest :P
18:59:08FromGitter<HKGx> Hello, ⏎ I've installed Nim (it's my first time with it) and I've got a problem - I can't import any libs directly. I mean, when I'm trying to do `import os` compiler says that it can't find file named "os".
19:00:56shashlickdandevelo: ya and then you don't need to comprehend what Nim does behind the scenes
19:01:22shashlickits like the assembly expert who wants to debug the code gcc generated
19:01:32shashlickyou know what I mean 🙂
19:01:42FromGitter<dandevelo> Yep :)
19:04:37*zachk joined #nim
19:09:27FromGitter<dandevelo> @Varriount tried to use importc on the constant but could not get it to work
19:14:28*waleee quit (Quit: WeeChat 2.4)
19:20:14FromGitter<dandevelo> @shashlick @leorize @Varriount I guess I will use --linedirs for my debugging even though it sometimes misses the correct line. But when that happens I use the call stack to identify the exact function I am currently debugging
19:23:20FromGitter<dandevelo> Thank you all for coping with my rant about importc consts in Nim :D
19:23:50shashlicknp
19:24:27FromDiscord<demotomohiro> This page might help you to debug Nim code.
19:24:27FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.com/nim/gdb.en.html
19:26:32FromDiscord<demotomohiro> @dandevelo you need to add `--debugger:native` option to Nim to generate executable for debug.
19:27:40FromGitter<dandevelo> Thanks @demotomohiro !
19:28:26*sealmove quit (Quit: WeeChat 2.4)
19:31:23FromDiscord<demotomohiro> @hkgx That sounds like `lib` directory that have Nim's standard library is not correctly installed.
19:32:28shashlickhow did you install?
19:36:29FromDiscord<hkg> well, I can access files from it, but I need to do (for example) `import pure/strformat`
19:37:16FromDiscord<hkg> @demotomohiro so i don't know what's wrong
19:39:13FromDiscord<demotomohiro> When you import module in standard library, you can write "import std/strformat" or "import strformat".
19:41:46FromDiscord<hkg> std has only two files 🤔
19:44:30FromDiscord<demotomohiro> Most of standard modules in `lib/pure` directory.
19:45:22FromDiscord<hkg> yeah, I've noticed it
19:45:38FromDiscord<demotomohiro> If you are using Nim ver 0.19.4, there are only 2 files in `lib/pure`.
19:45:58FromDiscord<demotomohiro> Not `lib/pure, `lib/std`
19:46:07FromDiscord<hkg> Yep
19:46:19FromDiscord<hkg> Online two files in std
19:46:23FromDiscord<hkg> Only two files in std
19:47:10FromDiscord<demotomohiro> How did you installed Nim?
19:48:31FromDiscord<hkg> i've put it in some folder in user directory
19:48:35FromDiscord<hkg> and executed finish.exe
19:54:21*salewski joined #nim
19:55:20salewskinarimiran, https://nim-lang.github.io/Nim/system.html gives 404 file not found for me.
19:55:49FromDiscord<demotomohiro> @hkg Did you just download zip file from this page, unzipped it and put some folder?
19:55:49FromDiscord<demotomohiro> https://nim-lang.org/install_windows.html
19:55:52salewskihttps://nim-lang.github.io/Nim/algorithm.html also.
19:56:08narimiransalewski: yeah, it is down and we know why
19:56:14FromDiscord<hkg> finish.exe setted up %PATH% for me
19:56:16FromDiscord<hkg> as I could see
19:56:22salewskiOK, bye.
19:56:33*salewski quit (Client Quit)
19:56:44narimiranall modules are now (by mistake) under ..../moduleName/moduleName.html
19:57:47FromDiscord<demotomohiro> @hkg can you see lib\pure\strformat.nim?
19:57:51FromDiscord<hkg> yup
19:58:13FromDiscord<hkg> I can import packages using
19:58:13FromDiscord<hkg> ```nim
19:58:13FromDiscord<hkg> import pure/math
19:58:13FromDiscord<hkg> ```
19:58:43*a_b_m joined #nim
19:59:19FromDiscord<hkg> but when trying to compile program with strformat
19:59:39FromDiscord<hkg> it throws me an error
19:59:39FromDiscord<hkg> `nim\lib\pure\strformat.nim(253, 8) Error: cannot open file: macros`
20:01:24*abm quit (Ping timeout: 244 seconds)
20:01:49*a__b__m joined #nim
20:04:48FromDiscord<demotomohiro> can you see lib/core/macros.nim?
20:05:02*a_b_m quit (Ping timeout: 245 seconds)
20:13:03FromDiscord<hkg> @demotomohiro yup
20:14:38*ng0 quit (Remote host closed the connection)
20:15:42*ng0 joined #nim
20:21:13*a__b__m quit (Ping timeout: 246 seconds)
20:26:04*a__b__m joined #nim
20:27:02*rnrwashere quit (Remote host closed the connection)
20:27:19*rnrwashere joined #nim
20:29:27FromDiscord<demotomohiro> Can you compile the code that just contain "import macros"?
20:34:27FromDiscord<hkg> nope
20:43:25FromDiscord<demotomohiro> @hkg so your Nim can read lib/pure/strformat.nim but lib/core/macros.nim.
20:43:25FromDiscord<demotomohiro> And these files are actually exist.
20:43:58FromDiscord<hkg> It can't read just *macros*
20:44:01FromDiscord<hkg> or just *strformat*
20:44:14*rnrwashere quit (Remote host closed the connection)
20:46:07FromDiscord<demotomohiro> This error message means Nim can read the file `nim\lib\pure\strformat.nim`
20:46:07FromDiscord<demotomohiro> `nim\lib\pure\strformat.nim(253, 8) Error: cannot open file: macros`
20:46:21FromDiscord<hkg> yeah
20:46:32FromDiscord<hkg> but I import strformat with ```nim
20:46:32FromDiscord<hkg> import pure/strformat
20:46:32FromDiscord<hkg> ```
20:50:04*narimiran quit (Remote host closed the connection)
20:51:50FromDiscord<demotomohiro> You cannot import strformat with `import strformat`?
20:51:55FromDiscord<hkg> nope
20:52:41FromDiscord<hkg> ```nim
20:52:41FromDiscord<hkg> >>> import strformat
20:52:41FromDiscord<hkg> stdin(1, 8) Error: cannot open file: strformat
20:52:41FromDiscord<hkg> ```
20:52:42*Vladar quit (Remote host closed the connection)
20:52:59*floppydh quit (Quit: WeeChat 2.3)
20:56:13FromDiscord<demotomohiro> Can you see nim/config/nim.cfg?
20:57:03FromDiscord<hkg> omg
20:57:52FromDiscord<hkg> smh, it didn't extract
20:58:32FromDiscord<hkg> @demotomohiro big thanks
20:58:39FromDiscord<demotomohiro> np
21:04:01FromDiscord<demotomohiro> When I delete my nim/config/nim.cfg, compiling `import strformat` says `Error: cannot open file: strformat` and compiling `import pure/strformat' says `nim-0.19.4\lib\pure\strformat.nim(253, 8) Error: cannot open file: macros`.
21:04:01FromDiscord<demotomohiro> Showing some error or warning when Nim cannot read nim/config/nim.cfg file might be helpful.
21:04:26FromDiscord<hkg> yeah
21:04:59FromDiscord<demotomohiro> If you are using windows, you can also install Nim using Scoop.
21:05:00FromDiscord<demotomohiro> https://scoop.sh/
21:05:46FromDiscord<hkg> hm, scoop looks cool
21:06:11FromDiscord<hkg> but, I already installed it "the normal way"
21:19:42*rockcavera quit (Remote host closed the connection)
21:19:55*rnrwashere joined #nim
21:24:20*rnrwashere quit (Ping timeout: 255 seconds)
21:39:07*rnrwashere joined #nim
21:43:41*rnrwashere quit (Ping timeout: 255 seconds)
21:48:31Zevvis Nim in chocolatey?
21:49:12Zevvoh 0.11.2
22:09:21*rockcavera joined #nim
22:14:25*a_b_m joined #nim
22:14:49*a_b_m quit (Read error: Connection reset by peer)
22:15:14*a_b_m joined #nim
22:15:34*Trustable quit (Remote host closed the connection)
22:17:06*krux02 quit (Remote host closed the connection)
22:17:17*a__b__m quit (Ping timeout: 244 seconds)
22:28:44*flaviu joined #nim
23:02:34*noeontheend quit (Ping timeout: 246 seconds)
23:02:43*rnrwashere joined #nim
23:04:26*rnrwashere quit (Remote host closed the connection)
23:05:19*rnrwashere joined #nim
23:08:37*rnrwashere quit (Remote host closed the connection)
23:09:51*rnrwashere joined #nim
23:14:08*rnrwashere quit (Remote host closed the connection)
23:18:10*fredrik92 joined #nim
23:19:48*couven92 quit (Ping timeout: 250 seconds)
23:21:38*rnrwashere joined #nim
23:23:30*a_b_m quit (Remote host closed the connection)
23:23:55*a_b_m joined #nim
23:24:54*rnrwashere quit (Remote host closed the connection)
23:31:34*rnrwashere joined #nim
23:38:41*fredrik92 quit (Read error: Connection reset by peer)
23:42:31*Jesin quit (Quit: Leaving)
23:44:54*Jesin joined #nim
23:47:47ryukopostingso who's the dude on the cover of nim in action
23:48:12dom96My great grand father obviously :P
23:48:54ryukopostingwait really or no
23:50:08rayman22201No, they just made Dom dress up in a silly costume :-P
23:52:50*theelous3 quit (Ping timeout: 255 seconds)
23:53:05*leorize quit (Quit: WeeChat 2.3)
23:53:14ryukopostingkek
23:54:59xaceryukoposting: it's explained in the book...
23:55:18ryukopostingo
23:55:32ryukopostingtbh I've only read the first chapter
23:55:44ryukopostinggood first chapter though, I plan to get around to it
23:56:07dom96lol, it's easy to skip over the cover explanation
23:56:28dom96It's before the first chapter
23:56:36dom96Thanks for grabbing a copy btw :)
23:57:06ryukoposting:)
23:58:33*lritter quit (Ping timeout: 244 seconds)