<< 13-09-2018 >>

00:18:27*tiorock joined #nim
00:18:27*tiorock quit (Changing host)
00:18:27*tiorock joined #nim
00:18:27*rockcavera quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
00:18:27*tiorock is now known as rockcavera
00:31:57*brainproxy quit (Read error: Connection reset by peer)
01:04:30AlexMaxoh man
01:04:40AlexMaxhow much can a library change in a year :(
01:05:14AlexMax(answer, a lot)
01:19:19AlexMaxwonder if nimgen will work on it
01:22:01FromGitter<rayman22201> worth a shot. god speed
01:39:47shashlickwhat do you have so far
01:45:54*brainproxy joined #nim
01:47:38*zachcarter joined #nim
01:47:58zachcarterhttps://gist.github.com/zacharycarter/88afdd9b3295fb3e3c1f592ff7b38076 - DSL for ES6 classes
01:48:06zachcarterand interpolating Nim expressions inside of the DSL
01:48:17zachcartererr I guess ES2015 classes if you want to be accurate
01:52:04AlexMaxshashlick: Well zachcarter did most of the hard work in doing the initial thing.
01:52:19AlexMaxI was just trying to bring it up to date
01:53:14AlexMaxtrouble is, there's been a lot of formatting changes, so it's hard to diff today's library with a year ago
01:53:28zachcarterAlexMax: what library is this you're referring to?
01:53:34AlexMaxnuklear
01:53:36zachcarterah
01:53:42AlexMaxI did some piddly stuff today
01:54:02zachcarterI have had my head / hands out of game dev for a minute now - due to work
01:54:04AlexMaxgot it working with a commit that's about a dozen commits ahead of yours
01:54:10zachcarterbut I really hope to get back into it soon
01:54:16AlexMaxI gotcha, you've said as much before
01:54:23AlexMaxso I thought I might try to help
01:54:24zachcarterand hopefully get some of these libraries back up to date
01:54:33zachcarter:) it's greatly appreciated!
01:55:30AlexMaxnuklear just has a gigantic surface area
01:55:39AlexMaxand it's easy to miss API changes
01:55:41zachcarteryeah it does
01:55:53zachcarterI feel like it was even larger than before when I made the initial bindings
01:55:55shashlickso am curious how the original wrapper was done - c2nim?
01:55:58zachcartererr large before*
01:56:08zachcartermmm - a lot of it was done manually
01:56:12AlexMaxsome things are easy to spot, like when a struct changes you usually can't see anything
01:56:14zachcarterbut c2nim helped out greatly
01:56:30zachcarterI mean - I think I can probably produce bindings for any verison of nuklear in a couple of hous
01:56:34AlexMaxothers, not so much...especially if it's a part of the API that the demo doesn't cover
01:56:47zachcarterit just takes know how of working with c2nim / how to fix commonly encountered issues with it
01:57:16zachcarterand then - testing your bindings is another ball game
01:57:26zachcarterbecause Nuklear doesn't provide any graphics API as a backend
01:57:36zachcarterso you have to implement that too - and hope you got that correct as well
01:57:44AlexMaxYeah, and there are about a dozen different ways you can hook the demo up too
01:57:50zachcarteryeah
01:58:18zachcarterit'ts not the simplest library ever - I will do my earnest to update the bindings ASAP
01:58:35zachcarterI just *finally* got nim expression interpoalted into the JS I'm producing
01:58:37AlexMaxalso, c2nim doesn't cover stuff like macros
01:58:43zachcarterno - it doesn't
01:58:49AlexMaxand there are a fair number of them
01:58:57zachcarterbut you can use the C preprocessor for that
01:58:59zachcartergcc -E
01:59:10shashlicknimgen could make life easier
01:59:22zachcarterso you do like - `gcc -E nuklear.h -o nuklear.hpp`
01:59:26zachcarter`c2nim nuklear.hpp`
01:59:38zachcarterand any preprocessor symbols - macros, etc - will have been resolved
01:59:42shashlickare you compiling in the c files or loading the dynlib? I don't see either
02:00:00zachcarterI think there's a compile pragma at the top of the file
02:00:17shashlickthat's just bind.c
02:00:40zachcarterand it points to a .c file which includes the required header files / defines the implementation symbol
02:00:58zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/master/src/bind.c
02:00:59AlexMaxAlso, fwiw, nuklear has completely changed structure in the past year - instead of being a single-header lib, it's been split up with a single-header option
02:01:19AlexMaxI think maybe linking aginst src/nuklear.h might be a better idea, since it's a smaller header
02:01:22zachcarterhttps://github.com/zacharycarter/nuklear-nim/blob/master/nuklear.nim#L242
02:01:27AlexMaxless work on the compiler's part
02:01:54zachcarterI can look at that
02:02:06shashlickokay I get it, used to be one file
02:02:17shashlicknow its all split up
02:02:37zachcarteryeah - that's quite a change
02:02:44zachcarterI will work on it this weekend and get it up to date
02:02:55zachcarterI plan on using these bindings in the future - so I need to do it anyway
02:03:15shashlickI can run it through nimgen and set that up real quick
02:03:30shashlickif you want to adapt your wrapper over that, it will be cool
02:03:41zachcarterthat'd be swell
02:03:53shashlickokay let me try
02:03:58zachcarterI need to run out of the house for a few minutes - I'll be back shortly
02:04:17FromGitter<kaushalmodi> I was looking for a way to compile static binaries and I came across this: https://www.reddit.com/r/programming/comments/2wk7q6/static_linking_with_nim/
02:04:58shashlickwhich lib you want to include?
02:04:58FromGitter<kaushalmodi> From what I read Nim script is a better and recommended way nowadays?
02:05:14FromGitter<kaushalmodi> musl
02:06:53FromGitter<kaushalmodi> The linked example separately sets --opt, runs strip, etc. Is it possible to pack all of that under a single -d:musl switch?
02:08:23shashlickno idea honestly
02:09:59shashlickzacharycarter: looks like the single file mode is still supported
02:11:12FromGitter<kaushalmodi> shashlick: hmm, looks like what I want is possible.. https://github.com/nim-lang/Nim/wiki/Using-nimscript-for-configuration
02:14:53AlexMaxshashlick: It's still supported, but the src/ header just includes what you need and saves the c compiler from having to parse the entire thing :)
02:15:07AlexMaxevery time
02:16:31shashlickDo you mean every time you recompile during dev?
02:16:57shashlickWhile developing an app that includes this lib
02:37:01*dddddd quit (Remote host closed the connection)
02:42:44zachcarterback
02:43:04zachcartershashlick: well - it'd probably be easiest to get the current bindings working via that or your nimgen lib
02:44:56zachcarterso jazzed about this ES6 Class DSL macro - I've been fighting this guy who just throws TypeScript links out wheneve I mention Nim frontend dev
02:45:00zachcarterdo that with TypeScript :P
02:45:44zachcarteralso - the fact I was able to port 90% of hyperHTML in 3ish days - means Nim wins :P - Google is still working on their TypeScript port
02:46:12zachcarternow to start building web components / porting hyperHTMl examples
03:48:09*tiorock joined #nim
03:48:09*tiorock quit (Changing host)
03:48:09*tiorock joined #nim
03:48:09*rockcavera is now known as Guest99498
03:48:09*tiorock is now known as rockcavera
03:50:53*Guest99498 quit (Ping timeout: 245 seconds)
04:29:43*endragor joined #nim
04:35:57*cspar quit (Ping timeout: 252 seconds)
04:43:03*miran joined #nim
04:47:08*erratic joined #nim
05:12:34*darithorn quit (Quit: WeeChat 2.2)
05:18:53*nsf joined #nim
05:34:09*cspar joined #nim
05:35:22*kapil___ joined #nim
05:48:54*miran quit (Quit: Konversation terminated!)
06:11:33FromGitter<gogolxdong> Is this right to use jester as static server ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b99ff95be4f30062687ed29]
06:21:27*cspar quit (Ping timeout: 240 seconds)
06:22:22FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a021ed655361f76f13452]
06:24:06*couven92 joined #nim
06:35:16shashlickzachcarter, AlexMax: nimnuklear is up and running with nimgen - https://github.com/genotrance/nimnuklear
06:35:44shashlickit compiles πŸ˜„ so might still need work to get it working
06:38:37FromGitter<gogolxdong> great
06:39:00TangerHey guys, if I want to test a client/server connection, is there a way to stop runForever() and continue with the next test?
06:39:55TangerSo either I asyncCheck/runForever for the server and send a single bit of data with waitFor (on the client), or waitFor blocks the server and I can't connect the client
06:40:06FromGitter<gogolxdong> nuklear seems promising.
06:41:14FromGitter<gogolxdong> and cool.
06:44:36FromGitter<rayman22201> Run the server as a child process and kill it at the end of the test.
06:45:43FromGitter<rayman22201> @Tanger
06:53:57FromGitter<gogolxdong> thanks for bring us these new exciting scope.
07:01:30TangerCool, I'll give it a crack rayman22201
07:15:15zachcartergogolxdong: https://gist.github.com/zacharycarter/edf61211101167d996de2a73ad1fd5f4
07:15:28zachcarternew version of the es2015 class macro I was working on - I turned it into a DSL
07:16:58zachcartertomorrow I will have web components working with my port of hyperHTML
07:19:51FromGitter<gogolxdong> yes, I have read relevant resource you sent me, and tried to understand how the porting would be . Seems graphics is the breakthrough of Nim? :)
07:19:53*Vladar joined #nim
07:22:30*TheLemonMan joined #nim
07:25:13FromGitter<gogolxdong> I have been through nimx, wxnim ,.etc for graphical programming and karax for web programming, your port of hyperHtml and nuklear will take an ⏎ additive effect for visualization domain.
07:26:48zachcarter:D
07:26:51zachcarterhopefully
07:28:49*PMunch joined #nim
07:37:44*erratic quit (Read error: No route to host)
07:47:22FromGitter<gogolxdong> we have to migrate our vue frontend to Nim solution to unify backend and frontend in Nim once for all.
07:48:04*erratic joined #nim
07:50:36*rockcavera quit (Read error: Connection reset by peer)
07:50:55*rockcavera joined #nim
07:50:55*rockcavera quit (Changing host)
07:50:55*rockcavera joined #nim
08:02:37*gmpreussner_ quit (Ping timeout: 246 seconds)
08:03:24*gmpreussner joined #nim
08:25:23*leorize quit (Quit: WeeChat 2.2)
08:30:35*hoijui joined #nim
08:38:21*floppydh quit (Remote host closed the connection)
08:39:04*floppydh joined #nim
08:39:55FromGitter<Bennyelg> Nim Nim Nim
08:40:17FromGitter<Bennyelg> does Araq every said why he called Nim Nimrod/Nim ?
08:40:23FromGitter<Bennyelg> ever*
08:42:10PMunchWell Nimrod was a biblical king (which is why Nim has a crown as it's logo). I think it was meant as a way to say that it's good
08:44:41FromGitter<Bennyelg> I am jewish and yes nimrod was a king but I didn't thought it's because of that
08:44:50FromGitter<Bennyelg> cool name
08:45:50PMunchIn the US Nimrod has some unfortunate co-notations after Bugs Bunny sarcastically called Elmer Fudd for Nimrod (the king was known as a great hunter, Elmer not so much). This reference was lost on the young viewers who just assumed it meant something similar to an idiot, which is what most people associate with the word today.
08:46:06PMunchAnd that's why it was shortened to Nim IIRC
08:46:42FromGitter<Bennyelg> hehe
08:49:01zachcartersweet - custom elements are working again with the new DSL macro
08:49:23zachcarterno barriers to web components now - just need to port over a few more lines of hyperHTML and I can re-write all the hyperHTML examples in Nim
08:51:22PMunchWhat are you working on zachcarter?
08:52:27zachcarterPMunch: https://gist.github.com/zacharycarter/5ac96a35020393c16819983f0fbb0cbc
08:52:30zachcarterfor work
08:52:38zachcarterneed to be able to produce web components
08:55:00*PMunch_ joined #nim
08:55:56*PMunch quit (Disconnected by services)
08:56:31*PMunch_ left #nim (#nim)
08:56:46*PMunch joined #nim
08:56:59PMunchOh cool
08:58:05zachcarterthanks
08:59:04FromGitter<Bennyelg> where can I find examples of osproc
08:59:15FromGitter<Bennyelg> executing commands and get results (os commands)
09:00:56PMunchBennyelg, what do you mean?
09:01:26FromGitter<Bennyelg> the most naive example: ls -la and print the results inside nim
09:02:02PMunchlet (outp, errC) = execCmdEx("ls -la"); echo outp
09:02:11TheLemonMandon't parse ls output!
09:02:36FromGitter<Bennyelg> not going to parse anything just wanted to test the os libraries
09:04:45FromGitter<mratsim> you can use `when defined(librarytest): var testCounter: int`
09:05:20FromGitter<mratsim> @Tanger ^
09:05:53FromGitter<mratsim> and put some more when defined, to increment and stop after a certain number of iteration
09:06:09FromGitter<mratsim> and run your tests after passing -d:librarytest
09:14:20*kapil___ quit (Quit: Connection closed for inactivity)
09:16:37FromGitter<mratsim> @dom96, is that spam? is there a calculator on the website? https://forum.nim-lang.org/t/4193, there are a lot of calculator example but I don’t see a calculator on the website: https://forum.nim-lang.org/t/4193
09:30:09*krux02 joined #nim
09:36:17FromGitter<gogolxdong> How to overload `$` ?
09:36:38TheLemonManproc `$`(x: MyType): string = ...
09:37:20FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a2fd0be4f300626891d8b]
09:38:41FromGitter<gogolxdong> field is JsonNode
09:40:13TheLemonManwhy a template?
09:40:48FromGitter<gogolxdong> don't want to write product[...].getStr, product[...].getStr
09:41:27FromGitter<gogolxdong> template $ doesn't work.
09:42:39FromGitter<gogolxdong> and some fields are not string type.
09:43:32FromGitter<gogolxdong> in a for loop.
09:45:00FromGitter<xmonader> any example on SSL sockets using nim?
09:46:26FromGitter<gogolxdong> like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a31f2f08bc22dfb4e3860]
09:48:46FromGitter<gogolxdong> template except`$` works
09:48:59FromGitter<gogolxdong> but doesn't have good semantics.
09:49:27*hoijui quit (Ping timeout: 240 seconds)
09:49:42FromGitter<gogolxdong> also not as simple as one single `$`.
09:50:15*stefanos82 joined #nim
09:51:35TheLemonMana macro/template may help here
09:51:51FromGitter<gogolxdong> except $?
09:52:38TheLemonManyeah, maybe something that unpacks all the `body` fields into variables (if you need em all)
09:55:46*kapil___ joined #nim
09:56:18FromGitter<gogolxdong> I'd rather define a template except the reserved symbols. like P
09:56:49*hoijui joined #nim
09:57:26FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a34853b7e6c2edd0e48a2]
09:59:52FromGitter<gogolxdong> or S, because it looks like $ and could mean Stringify.
10:10:21TheLemonManhttps://glad.dav1d.de/ noice
10:14:27*zachcarter quit (Ping timeout: 240 seconds)
10:16:07FromGitter<gogolxdong> Does mapLiterals op work with template?
10:19:29FromGitter<Bennyelg> Can someone answer a newbie question? ⏎ I understand the concept of macros and wrote few examples + read the nim in action book. ⏎ But still I am struggling to find the use cases when I should use it. ⏎ Anyone can help [https://gitter.im/nim-lang/Nim?at=5b9a39b01ee2ca65020d879a]
10:23:04krux02performance problems in nim-mode font lock (syntax highlighting in emacs speech) have been fixed
10:23:27krux02(by me in my PR)
10:38:47FromGitter<Bennyelg> If I created a "special" text file. how do I use vs code to color the keyword syntax of my special text file
10:40:14FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a3e8e7dca306503f4ca3f]
10:41:00FromGitter<gogolxdong> there is something wrong with this macro, has no data.
10:41:45FromGitter<krux02> @Bennyelg I can tell you now how to do it in emacs.
10:42:01TheLemonMangogolxdong, you're not calling .add on `dataString`
10:42:08*hoijui quit (Ping timeout: 245 seconds)
10:42:21FromGitter<krux02> emacs has search based fontification, or that is how they call it. Basically a regular expression that searches for keywords and when it finds them they get highlighted
10:42:45FromGitter<gogolxdong> how to do that.
10:42:45FromGitter<Bennyelg> But Im not using emacs :|
10:42:54FromGitter<krux02> and some characters can be marked as comment start/end charaters etc to control if in a comment/string
10:43:05FromGitter<krux02> that filters out wrong positives
10:43:47FromGitter<krux02> maybe vs-code was modeled after emacs
10:44:08FromGitter<Bennyelg> pretty sure it does
10:45:24FromGitter<krux02> I found out that emacs is much smoother to use on Mac OS than other OS, because the option and command keys don't conflict with the ctrl keys of emacs
10:45:41FromGitter<krux02> many ctrl keys of emacs even work in the browser
10:45:58TheLemonMangogolxdong, you want something like newCall(bindSym"datastring, quote ...), but you're better off building a new nnkBracketExpr
10:46:08FromGitter<Bennyelg> I'll give it a try
10:46:46FromGitter<krux02> @Bennyelg are you on a mac?
10:47:36FromGitter<krux02> if yes, you can try Ctrl-f for forward, Alt-f for forward word, Ctrl-a for beginning of line
10:48:05FromGitter<krux02> normally those keys only work in emacs, but not on the mac here they are available on many more programs
10:53:02FromGitter<gogolxdong> @TheLemonMan, could you show me the code?
10:53:39FromGitter<Bennyelg> @krux02 yes
10:53:49TheLemonMangogolxdong, have a look at how `newLit` for seq[T] types does it
10:55:50FromGitter<gogolxdong> can you use newLit in quote do scope?
10:55:57FromGitter<gogolxdong> can I use
10:56:26FromGitter<Bennyelg> what quote: does
10:56:29FromGitter<Bennyelg> I don't understand
11:02:40*dddddd joined #nim
11:02:52FromGitter<alehander42> it constructs NimNode-s in the same way a template works
11:03:06FromGitter<alehander42> e.g. if you don't want to write `nnkCall.newTree(ident("a"))`
11:03:09FromGitter<alehander42> you can write
11:03:20FromGitter<alehander42> ```quote: ⏎ a()``` [https://gitter.im/nim-lang/Nim?at=5b9a43f8be4f300626899bcf]
11:04:16FromGitter<alehander42> a better example is ⏎ ⏎ ```quote: ⏎ myCall(`arg`, 2) + 4``` [https://gitter.im/nim-lang/Nim?at=5b9a44307dca306503f4ed93]
11:04:27FromGitter<alehander42> where arg is a NimNode variable in your macro
11:04:38FromGitter<alehander42> (more or less .. there is a gotcha with idents, but otherwise thats it)
11:05:02*ftsf quit (Read error: Connection reset by peer)
11:05:14FromGitter<Bennyelg> thanks
11:06:06FromGitter<narimiran> @alehander42 what are the differences between `quote` and `quote do`
11:07:01FromGitter<alehander42> honestly not sure, in my usage mostly that i can do `a = quote do: b` on one line
11:07:09FromGitter<alehander42> but `quote:` needs to be multiline
11:07:39FromGitter<alehander42> so `quote do` is easier to use as an expression
11:08:25FromGitter<narimiran> oh, i have used `quote do:` with multiline stuff
11:08:46FromGitter<gogolxdong> unable to newLit for seq[string], the data is known at runtime.
11:08:58FromGitter<gogolxdong> for dataString
11:09:01FromGitter<narimiran> just tried it and it works the same way without `do`
11:09:37FromGitter<alehander42> yeah, I mean that I can't use `quote:` on one line
11:09:56FromGitter<alehander42> and I use `quote:` for multiline because .. it's shorted :D
11:10:03FromGitter<alehander42> short*
11:10:39FromGitter<gogolxdong> macro is not feasible here. only template works .
11:13:39FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a466354587954f997791c]
11:14:23FromGitter<gogolxdong> body is response of http request parsed json object.
11:15:40FromGitter<gogolxdong> if mapLiterals works with template , will achieve the similar syntax.
11:15:59FromGitter<alehander42> well, add `echo result.repr` to the end of `toData` and you'll see that you don't generate the code you want
11:17:32FromGitter<alehander42> you need to generate something like ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a474be5c2cc56ad82d84e]
11:26:28FromGitter<kaushalmodi> krux02: Thanks (for fixing the performance issues in nim-mode). I'll try it out later today. How did you debug and fix the issue? Did Anders Lindgren help?
11:26:54FromGitter<gogolxdong> yes, it's not, point is the macro has an intention to cross compile time.
11:46:23*SenasOzys joined #nim
11:46:26FromGitter<krux02> @kaushalmodi basically I wrote an e-mail with a small piece of code to Anders Lindgren where I knew that it was causing performance issues. He instantly saw the big problem that was slowing down everything.
11:46:28PMunchHmm, I'm starting multiple processes from Nim with startProcess. Now I want to save all their outputs to files, and interleave them in the output of my program. How can I poll/read asynchronously from multiple streams?
11:46:39FromGitter<krux02> I just implemented it there and everywhere else.
11:47:09FromGitter<krux02> He also gave me some information on how the fontification process works.
11:49:36*noonien joined #nim
11:52:22krux02@kaushalmodi: the big problem was that fontification normally always does a regional search of keywords. But nim font lock does not do regional search
11:52:45krux02it always searched the entire buffer/file to the end
11:52:57krux02with a lot of hackery
11:53:17FromGitter<kaushalmodi> Makes senses. Thanks for the summary.
11:53:18krux02I currently rewrite a lot of these fontifications by removing hackery.
11:53:38krux02I think nim-mode is almost unmaintainable
11:54:00krux02so much code and you really need to know all features of elisp to be able to barely understand it.
11:54:29krux02@kaushalmodi: do you still have merge rights on nim-mode?
11:55:17FromGitter<kaushalmodi> I never had merge rights there.
11:56:24FromGitter<narimiran> @mratsim this might be interesting to you: https://nextjournal.com/sdanisch/the-julia-challenge
11:56:42FromGitter<narimiran> (i've also posted it on the forum, for others to see/participate)
12:01:07FromGitter<bung87> well julia has repl
12:01:16FromGitter<Bennyelg> nim has too
12:01:20FromGitter<Bennyelg> inim
12:02:31FromGitter<bung87> cool , never heard before
12:02:45FromGitter<kaushalmodi> also `nim secret`
12:05:32FromGitter<bung87> I often use REPL in python
12:07:51PMunchWhy isn't this just defined for file handles? https://github.com/nim-lang/Nim/blob/master/lib/pure/osproc.nim#L1292
12:08:20PMunchAs it stands now hasData only works on the stdout and not stderr..
12:08:33FromGitter<kaushalmodi> PMunch: Yeah, that would be nice
12:09:04PMunchThen you could just use myProcess.outputHandle.hasData and myProcess.errorHandle.hasData
12:13:00FromGitter<kaushalmodi> Oooh I like the new multiple select prompt in `nimble init`
12:17:54FromGitter<bung87> there was a issue related to this, not cross platform ,dont know how is it now
12:24:36FromGitter<kaushalmodi> How do I set gcc.exe, etc. in config.nims?
12:24:56FromGitter<kaushalmodi> I am trying to translate the nim.cfg in https://www.reddit.com/r/programming/comments/2wk7q6/static_linking_with_nim/ to a config.nims
12:30:49PMunchHmm, files are defined in system.. Is there something like a fileutils?
12:35:40FromGitter<kaushalmodi> answering to myself to above question: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a599cbe4f3006268a1b94]
12:36:16FromGitter<kaushalmodi> now just one unknown (for now).. how do I set `-d:release` in NimScript task? Using `switch("d", "release")` doesn't seem to work
12:42:05FromGitter<dom96> @mratsim yep. Spammer. He posted "hi" on some random thread too
13:04:39FromGitter<kaushalmodi> I have committed a template project for building musl built static binaries here: https://github.com/kaushalmodi/hello_musl
13:05:07FromGitter<kaushalmodi> But I will need some help from here to complete the Todo list in there: https://github.com/kaushalmodi/hello_musl#todo-list
13:06:45*kungtotte quit (Read error: Connection reset by peer)
13:07:59FromGitter<zetashift> @narimiran that's a pretty cool post
13:09:17FromDiscord<Shield> is there a way to force enums names to be contained in some scoop? i hate to use prefixes, so far wrapping my code in a block does the trick but i want it to be the other way arround (i'm using enums to define actions and it's gonna have lots of actions)
13:11:27*kungtotte joined #nim
13:18:00FromGitter<mratsim> @narimiran saw that thanks: https://github.com/SimonDanisch/julia-challenge/issues/1
13:26:13FromGitter<zetashift> @mratsim that was way too fast
13:26:19FromGitter<zetashift> are you an AI?
13:26:42FromGitter<mratsim> it’s not implemented, I’m making sure of the rules
13:26:54FromGitter<zetashift> ohh oay
13:27:24FromGitter<zetashift> still a scary how fast you came up with the issue
13:33:32*endragor quit (Remote host closed the connection)
13:39:56*SenasOzys quit (Remote host closed the connection)
13:40:22*SenasOzys joined #nim
13:42:29*NimBot joined #nim
13:46:04*Yardanico quit (Ping timeout: 240 seconds)
13:50:23*Yardanico joined #nim
13:52:45*endragor joined #nim
13:54:18*kapil___ quit (Quit: Connection closed for inactivity)
13:56:47*endragor quit (Ping timeout: 240 seconds)
13:58:04*cspar joined #nim
14:08:07*nsf quit (Quit: WeeChat 2.2)
14:20:18*PMunch quit (Quit: Leaving)
14:35:56FromGitter<kaushalmodi> How do you check if a binary/executable exists from inside config.nims?
14:37:28FromGitter<Vindaar> @kaushalmodi on current devel there's `findExe` in the nimscript module . Wasn't available in v0.18.0 it seems. But I just tried it and it doesn't find an executable in my PATH
14:37:47FromGitter<kaushalmodi> findExe looks for exec only in current dir
14:38:07FromGitter<Vindaar> the docs say it also considers PATH, no?
14:38:17*hoijui joined #nim
14:38:38FromGitter<kaushalmodi> hmm, let me check.. I probably looked at stable release docs
14:38:45FromGitter<kaushalmodi> though.. that is in os module
14:38:52FromGitter<kaushalmodi> and nimscript cannot import os, I think
14:39:11FromGitter<Vindaar> if you build the docs locally, you'll see there's a `findExe` in the nimscript module now
14:39:23FromGitter<kaushalmodi> ah OK, thanks. Let me check
14:40:05FromGitter<kaushalmodi> it works!
14:40:06FromGitter<kaushalmodi> thanks
14:40:11FromGitter<kaushalmodi> πŸŽ‰
14:40:14FromGitter<Vindaar> oh, it does? nice! :)
14:40:21FromGitter<kaushalmodi> it doesn't for you?
14:40:31FromGitter<Vindaar> nope, it returns an empty string
14:40:40FromGitter<kaushalmodi> I just put ` echo findExe("musl-gcc")`
14:40:59FromGitter<kaushalmodi> and it printed `/home/kmodi/stowed/bin/../../stow/pkgs/musl/1.1.20/bin/musl-gcc`
14:41:27FromGitter<kaushalmodi> (which is correct.. I use GNU Stow for local pkg management.)
14:45:06FromGitter<Vindaar> I tried it with `gcc` and nothing, whereas a call to `which gcc` works just fine
14:45:38shashlickya I think I added findExe() recently
14:46:01FromGitter<Vindaar> good idea :)
14:46:17shashlickhttps://github.com/nim-lang/Nim/pull/7442
14:47:21FromGitter<kaushalmodi> @Vindaar Hmm.. `findExe("gcc")` works too..
14:47:45FromGitter<Vindaar> probably my weird machine :D
14:48:52shashlickcheck if it works in `nim c` mode
14:49:27FromGitter<Vindaar> interestingly it does
14:50:56*arecaceae quit (Remote host closed the connection)
14:51:15*arecaceae joined #nim
14:53:15FromGitter<kaushalmodi> I cannot echo colored string in nimscript as I cannot import terminal
14:53:30FromGitter<kaushalmodi> What do people do? Manually echo the color escape codes?
14:54:33TheLemonManavoid color? :P
14:55:06FromGitter<kaushalmodi> I want to highlight error messages, else they get lost in the barrage of messages
14:57:22FromGitter<kaushalmodi> quit works but the quit is not so graceful
14:57:33FromGitter<kaushalmodi> example, with `quit("You need to have the musl library installed and musl-gcc binary in PATH.", QuitFailure)` in config.nims, I get:
14:58:34FromGitter<kaushalmodi> https://ptpb.pw/1Kav/text
15:00:12TheLemonManit's not _that_ bad, isn't it?
15:00:31FromGitter<Vindaar> you can import macros and use `error` from there. I think that's a little nicer
15:00:42FromGitter<Vindaar> at least the error appears in the last line
15:01:40FromGitter<kaushalmodi> TheLemonMan: This error is for users; I don't want to be scared looking at the stacktrace
15:03:29FromGitter<kaushalmodi> @Vindaar Now I get 2 stacktraces: https://ptpb.pw/SH-r/text
15:03:47FromGitter<kaushalmodi> the good part is that "Error:" shows in red now.. but .. too stacktracy :P
15:04:02FromGitter<Vindaar> πŸ™ˆ
15:04:33FromGitter<kaushalmodi> .. may be I show check of musl in the .nimble..
15:05:18FromGitter<Vindaar> (https://files.gitter.im/nim-lang/Nim/QEQA/macroError.png)
15:05:23FromGitter<Vindaar> is what it looks like for me
15:07:16FromGitter<kaushalmodi> I was calling a task in .nimble with a custom define that triggered a block in .nims
15:07:24FromGitter<kaushalmodi> I had the error in the .nims
15:07:35FromGitter<kaushalmodi> Now I moved the binary exists check to .nimble and it looks better
15:07:38FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b9a7d3a0cfe7f30f18bc52b]
15:07:51FromGitter<Vindaar> I just defined a `test` task and called a proc from `config.nims`
15:08:03FromGitter<Vindaar> (by including `config.nims` into the nimble file)
15:09:16*hoijui quit (Ping timeout: 246 seconds)
15:09:49*hoijui joined #nim
15:10:08FromGitter<kaushalmodi> arghh, and findExe does not work in .nimble
15:10:31FromGitter<kaushalmodi> as you discovered earlier, it works only with nim c, so it worked in the .nims
15:11:07FromGitter<kaushalmodi> e.g. https://ptpb.pw/Fl2p/nim always errors out
15:11:13FromGitter<kaushalmodi> findExe returns "" there
15:13:36FromGitter<Vindaar> Oh, and I was running it from nimble indeed :/
15:15:54FromGitter<kaushalmodi> shashlick: Should this be filed as a bug?
15:17:42FromGitter<kaushalmodi> I'll live with the 2 stack traces for now..
15:22:58*floppydh quit (Quit: WeeChat 2.2)
15:26:27FromGitter<kaushalmodi> @Vindaar Thanks for your help! Now I can auto-detect if musl-gcc exists, in the .nims: https://github.com/kaushalmodi/hello_musl/commit/1a967c45c17518f3cff1f3f0dd84b4747db3df26
15:26:51FromGitter<kaushalmodi> I'd now like to do the same in the .nimble too, for `strip` and (not yet added) `upx` binaries
15:32:32FromGitter<timotheecour> how do we use `{.passl: "-lm".}` ? it gives: `Error: attempting to call undeclared routine: β€˜passl'`
15:33:41*Trustable joined #nim
15:34:09FromGitter<kaushalmodi> @timotheecour I think you need to use `push`. Example: https://hookrace.net/blog/what-makes-nim-practical/#debug-and-release-builds
15:35:30FromGitter<timotheecour> same error
15:38:11FromGitter<timotheecour> I see it used in math.nim, and I need it to add rpath to avoid "could not load: libfreeimage.dylib” without having to "export DYLD_LIBRARY_PATH” (which is not good)
15:39:57*Pisuke joined #nim
15:40:33*MyMind quit (Ping timeout: 252 seconds)
15:40:39*wildlander joined #nim
15:43:30*miran joined #nim
15:44:06FromGitter<timotheecour> ah, just `{.passl: "-lm”.}` works; can’t be used as a pragma attached to a proc
15:50:51*leorize joined #nim
15:51:27*Jesin quit (Quit: Leaving)
15:56:05*nsf joined #nim
16:08:35shashlick@kaushalmodi: do you have the latest nimble?
16:09:04*sagax quit (Remote host closed the connection)
16:09:22shashlickit has its own copy of the compiler and VM so might need separate changes there, or you need to get a build with latest compiler code
16:14:11FromGitter<kaushalmodi> shashlick: yes, I build it using koch from Nim devel branch
16:15:25FromGitter<kaushalmodi> To reproduce the issue I am seeing, see the findExe-in-nimble branch: https://github.com/kaushalmodi/hello_musl/tree/findExe-in-nimble?files=1
16:16:17shashlickdom96 might know best
16:17:23shashlickActually ya, it needs to be added there too
16:17:26shashlickhttps://github.com/nim-lang/nimble/blob/master/src/nimblepkg/nimscriptsupport.nim
16:18:12shashlickSee setupVM() which needs to be updated
16:18:36shashlickWonder why is a copy and not an import
16:31:06*Jesin joined #nim
16:36:14*nsf quit (Quit: WeeChat 2.2)
16:37:48FromGitter<kaushalmodi> shashlick: That doesn't look right. That means that right now we have 2 flavors of NimScript: one for .nims and another for .nimble.
17:06:47*noonien quit (Quit: Connection closed for inactivity)
17:15:19shashlickyep
17:22:49FromGitter<Bennyelg> https://nim-lang.org/docs/db_odbc.html
17:22:51FromGitter<Bennyelg> not found?
17:24:40*natrys joined #nim
17:27:54FromGitter<kaushalmodi> Finally got what I wanted in that musl experiment: https://github.com/kaushalmodi/hello_musl !
17:27:57FromGitter<Bennyelg> whats the problem? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Im getting: ... [https://gitter.im/nim-lang/Nim?at=5b9a9e1db9531f2dfa60a4f6]
17:28:13FromGitter<kaushalmodi> (continuing) command: `nim musl src/hello_musl.nim`
17:33:49*Jesin quit (Quit: Leaving)
17:33:55*sagax joined #nim
17:37:09*Jesin joined #nim
17:39:18*nsf joined #nim
17:40:34*Trustable quit (Remote host closed the connection)
18:11:13*zachcarter joined #nim
18:42:24FromGitter<dm1try> guys, before creating an issue/PR I want to ask about `splitLines` behaviour: ⏎ is the presence of empty line after the terminal EOL is expected in result? more info in this comment (https://github.com/nim-lang/Nim/issues/8961#issuecomment-420990659)
18:43:54FromGitter<dm1try> Ruby( looks like a Python also) treat this situation in different way(without a new line)
18:48:39FromGitter<dm1try> maybe it was already discussed somewhere? according to this comment in somehow related proc (https://github.com/nim-lang/Nim/blob/devel/lib/pure/strutils.nim#L685) such behaviour is expected but I'm nor sure: ⏎ ⏎ ```>>> import strutils ⏎ >>> countLines "\n" ⏎ 2``` [https://gitter.im/nim-lang/Nim?at=5b9ab107be4f3006268c682d]
18:52:43*PMunch joined #nim
18:55:12*nsf quit (Quit: WeeChat 2.2)
18:56:56FromGitter<Vindaar> at least the `countLines` example is unambiguous, no?
19:00:59*jjido joined #nim
19:12:10FromGitter<dm1try> maybe =) it depends on "line" meaning(a sequence of characters with end-of-line marker/or without)
19:14:38FromGitter<Vindaar> imo it makes sense, because ⏎ ⏎ 1) `countLines "" == countLines "\n"` ⏎ doesn't make sense to me, neither does ⏎ 2) `countLines "" == 0` (which then would also imply `countLines "a" == 0` ... [https://gitter.im/nim-lang/Nim?at=5b9ab71ef08bc22dfb5186a3]
19:17:15FromGitter<Vindaar> this way the number of lines in a string is simply `n * '\n' + 1`, which is nice and easy
19:23:54ldleworkI have heard it said before that the syntax Nim has is not intrinsic to Nim and its compiler system. That technically, Nim has a "programmable syntax", in a sense beyond the macro system. Is this true, or am I having false memories?
19:24:32ldleworkI remember it being that the syntax that Nim has, is just the syntax it has, and that all the compiler really cares about is that it eventually gets a Nim AST, regardless of where it came from.
19:25:11ldleworkI'm trying to remember if this was actually a unique intended feature, or if this is just true of Nim in the sense that it is true of all languages, if you go off, and implement a new tokenizer and so on.
19:34:42*hoijui quit (Ping timeout: 264 seconds)
19:37:39FromGitter<mratsim> It’s probably true for all languages that offers a macro system
19:39:47*jjido quit (Read error: Connection reset by peer)
19:41:59ldleworkI mean beyond the macro system
19:42:34ldleworkthe macro system expects to parse Nim-as-we-know-it code
19:46:31*krux02 quit (Remote host closed the connection)
19:50:42*rockcavera quit (Ping timeout: 272 seconds)
19:59:56*rockcavera joined #nim
20:02:15*SenasOzys quit (Remote host closed the connection)
20:02:51FromGitter<rayman22201> It's true of all compilers that use an AST (most do, but some rare languages don't). It's a pretty broad statement. Some compilers break up the stages of compilation more cleanly than others. Clang and LLVM for example.
20:03:32*SenasOzys joined #nim
20:11:19FromGitter<kaushalmodi> @mratsim I was looking at your .travis.ci for inspiration. I am trying to understand if the cache stuff is needed for regular Nim projects: https://github.com/mratsim/Arraymancer/blob/master/.travis.yml#L4-L7
20:11:38FromGitter<kaushalmodi> .. or how does that cache setting help with Arraymancer?
20:14:19*SenasOzys quit (Remote host closed the connection)
20:15:37FromGitter<mratsim> Nim stores compilation stuff in ~/.cache/nim now
20:15:47FromGitter<mratsim> so it will speed up compilation of dependencies
20:23:10FromGitter<kaushalmodi> But it is using `ccache`. What is that?
20:40:43*miran quit (Ping timeout: 246 seconds)
20:47:18*Vladar quit (Remote host closed the connection)
20:49:24shashlickNice idea to cache that
20:50:10FromGitter<arnetheduck> @mratsim for the status builds, `ccache` slowed things down because it caused the cache zip that's stored to grow causing it to take much longer to compress/decompress.. `.cache` already contains a bunch of object files, and then `ccache` will contain the same ones, except it will grow to also contain all the old versions
20:50:33shashlickI'm using appveyor for both windows and Linux
20:50:47shashlickhttps://github.com/genotrance/nimgen/blob/master/appveyor.yml
20:52:04shashlickI'm testing with 0.18.0 and it takes 8 minutes to test all wrappers
20:52:35shashlickI'd like to test with devel too, and perhaps older versions
20:52:41shashlickBut it's so slow
20:52:58shashlickAny suggestions to speed up appreciated
20:54:35FromGitter<kaushalmodi> In the case of my toy project, the bottle neck is choosenim installation :) https://travis-ci.org/kaushalmodi/hello_musl/jobs/428347207
20:55:08FromGitter<kaushalmodi> roughly 5-6 mins
20:57:17*natrys quit (Ping timeout: 244 seconds)
20:58:13shashlickI'm caching the xz file and manually compiling on Linux
20:58:45FromGitter<mratsim> @arnetheduck ah I see, well arraymancer depends on very seldom updated lib but maybe I should use it only for the versioned binary dependencies
21:00:16FromGitter<arnetheduck> well, if you're caching `.cache/nim`, that should already be cached.. if you do both `ccache` and `.cache`, you'll cache the same object files twice, plus you have to pay for the slowdown of `ccache` - it splits the compile into preprocess and compile, and does hashing on the intermediate file, so all that takes time as well..
21:01:38shashlickActually I'm at 13 minutes for both windows and Linux
21:01:38shashlickhttps://ci.appveyor.com/project/genotrance/nimgen/branch/master/job/y8vjrqebf4e3mkav
21:02:37FromGitter<arnetheduck> @kaushalmodi @shashlick you can check out https://github.com/status-im/nimbus/blob/master/.travis.yml to see how we cache the whole nim compiler (we have a custom fork at status) and a stable C++ dep (rocksdb)
21:03:49FromGitter<kaushalmodi> @arnetheduck In my case, I want to use the devel Nim build
21:04:09shashlickI'll look into recreating this on appveyor
21:04:12shashlickThanks
21:04:14FromGitter<arnetheduck> @kaushalmodi yeah, so you can use the same trick.. it's a matter of changing the git repo
21:04:28shashlickBut ya, want to test with devel too
21:04:45FromGitter<kaushalmodi> but.. if I am caching, how will it track devel?
21:05:04FromGitter<kaushalmodi> The reason is that I am using `findExe` in config.nims that only devel supports
21:05:18FromGitter<kaushalmodi> Want to make sure that future changes in devel don't break that
21:05:19FromGitter<arnetheduck> @shashlick there's https://github.com/status-im/nimbus/blob/master/.appveyor.yml which does a similar feat.. it's incredibly ugly with batch files though, or maybe I just suck at batch files (which I'm fine with)
21:05:22shashlickThat's why I've been asking for nightly builds
21:05:54FromGitter<kaushalmodi> so.. caching is not an option, right?
21:06:06FromGitter<kaushalmodi> if you want to sort of test using the latest devel too
21:06:07FromGitter<arnetheduck> @kaushalmodi check out the yml - it caches the commit that the branch is pointing to - if the branch changes, it rebuilds
21:06:14FromGitter<kaushalmodi> aha
21:06:20FromGitter<kaushalmodi> will have a look, thanks
21:06:23shashlickI've added binary builds support in choosenim but it's still not pulled in
21:06:59shashlickhttps://github.com/dom96/choosenim/pull/63
21:09:35FromGitter<kaushalmodi> @arnetheduck I shouldn't need the NPROC, right. I am not using rockdb
21:11:51FromGitter<kaushalmodi> why do you do `- "export NIMVER=$(git ls-remote https://github.com/status-im/nim.git HEAD | cut -f 1)"` instead of `- export NIMVER="$(git ls-remote https://github.com/status-im/nim.git HEAD | cut -f 1)"`
21:14:30FromGitter<xmonader> For nim core developer requires to be fluent in C and C++ and Nim in the same time?
21:16:54TheLemonManthe more the merrier
21:19:05FromGitter<arnetheduck> @kaushalmodi because it worked :) don't need `NPROC`
21:20:03FromGitter<arnetheduck> the first is a `yaml` escape, the other is a `shell` escape
21:22:35FromGitter<kaushalmodi> right, I religiously do shell escaping; saw the whole thing quoted for the first time
21:22:36FromGitter<kaushalmodi> :)
21:28:23FromGitter<kaushalmodi> @arnetheduck Thanks for your help! That caching works great! https://travis-ci.org/kaushalmodi/hello_musl/builds/428364318
21:29:39*Jesin quit (Quit: Leaving)
21:33:17*rockcavera quit (Read error: Connection reset by peer)
21:38:53*PMunch quit (Read error: Connection reset by peer)
21:41:22shashlick@kaushalmodi: so you don't delete older built versions?
21:41:45shashlickfrom the cache
21:44:31*gangstacat quit (Quit: Ĝis!)
21:46:41shashlickis musl supported on windows
21:49:53FromGitter<kaushalmodi> shashlick: Hmm, I'd assume the cache auto-expires
21:50:34FromGitter<kaushalmodi> Windows is not on musl supported OSes: https://www.musl-libc.org/intro.html
21:50:59shashlicknice work on this, would be great on windows to make mini executables
21:58:11FromGitter<kaushalmodi> so in this quest to learn making musl builds, there are so many ancillary things I learnt and more that I yet need to learn :)
21:59:09FromGitter<kaushalmodi> I learnt about building nim on travis, and then caching it. Thanks @mratsim and @arnetheduck. I learnt how to write config.nims. Thanks @Vindaar and shashlick :)
21:59:30FromGitter<kaushalmodi> now next.. need to learn how to auto publish the musl builts to https://github.com/kaushalmodi/hello_musl/releases ..
21:59:40FromGitter<arnetheduck> @kaushalmodi that reminds me of https://github.com/nim-lang/Nim/pull/5698 where I suggest that the C library should be treated as any other third-party library - this would fit very with what you're up to, I think
22:00:49FromGitter<arnetheduck> right now, there's a broken posix layer that's the worst of all worlds - neither does it expose the full capabilities of the local C library, nor is it particularly cross-platform given the mess that posix is, in general
22:00:53FromGitter<kaushalmodi> I want to learn the whole deployment flow. Committing nim code is the easy part.. then building it, deploying it to the Releases section.
22:01:29FromGitter<kaushalmodi> Once this flow is set up on this toy repo, it will be easy to copy/paste for real Nim projects
22:02:58*passenger83 joined #nim
22:04:12*passenger83 quit (Client Quit)
22:06:00*Jessin joined #nim
22:11:28*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
22:11:59*gangstacat joined #nim
22:12:40*Jessin is now known as Jesin
22:17:37FromGitter<xmonader> In the process of having a nice highlevel api for redis client `extracted` and adapted most of them from nim's official client https://github.com/xmonader/nim-redisclient/blob/highlevelapi/tests/testredisclient.nim#L44
22:21:17FromDiscord<Shield> is there a way to save/load the state of closure iterators?
22:40:51*Jesin quit (Quit: Leaving)
22:56:48*Jesin joined #nim
23:10:51*rockcavera joined #nim
23:21:47*stefanos82 quit (Quit: Quitting for now...)
23:21:50*wildlander quit (Quit: Konversation terminated!)
23:22:43FromDiscord<jos> darwintiler rules!
23:27:51*rockcavera quit (Ping timeout: 252 seconds)