<< 04-02-2019 >>

00:02:06*stefanos82 quit (Remote host closed the connection)
00:03:08*seni joined #nim
00:03:52*wildlander quit (Quit: Konversation terminated!)
01:10:47*Tyresc quit (Quit: WeeChat 2.4-dev)
01:23:25*rockcavera quit (Ping timeout: 268 seconds)
01:37:06*a_b_m quit (Ping timeout: 250 seconds)
01:43:36*noonien quit (Quit: Connection closed for inactivity)
02:03:51*seni quit (Quit: Leaving)
02:12:54*rockcavera joined #nim
02:51:38*Cthalupa quit (Ping timeout: 250 seconds)
02:52:58*Cthalupa joined #nim
03:02:25*banc quit (Quit: Bye)
03:06:22*Cthalupa quit (Ping timeout: 250 seconds)
03:08:31*Cthalupa joined #nim
03:21:08*banc joined #nim
03:29:45FromGitter<Varriount> @riddl_gitlab Why are you trying to use unsigned integers?
03:31:06shashlicki'm passing an untyped body to a macro which creates a proc
03:31:54shashlicki want to refer to params passed to that proc in the body but nim says undeclared identifier
03:40:57leorizeriddl_gitlab try appending `u` to 0
03:41:06leorizebut you shouldn't use uints in general
03:43:26shashlickhttps://github.com/genotrance/feud/blob/master/src/pluginapi.nim#L38 <= that's my macro
03:43:51shashlickhttps://github.com/genotrance/feud/blob/master/plugins/file.nim#L92 <= that's how I want to call it
03:51:31leorizeshashlick: try adding `{.inject.}`?
03:51:59leorizeusually the proc and it's param would be gensym-ed
03:52:41shashlickto the macro?
03:52:56leorizeyea, add it to the generated function signature
03:55:26shashlickI added it to onLoad and onUnload as a pragma but no luck
03:56:04leorizetry also adding it next to the params?
03:58:42shashlicknope
04:04:41leorizeshashlick: I think using a `{.dirty.}` template would work best here
04:05:19shashlickbut this isn't a template, it is a macro generating a proc
04:07:06leorizeare you going to use macro functions?
04:07:15*ryukoposting quit (Quit: WeeChat 1.6)
04:07:31shashlickya see the second link where i want to use them
04:07:53*nsf joined #nim
04:10:04leorizeyes, but you won't need a macro to do that
04:10:09leorizea template would do just fine
04:10:39leorize`quote` is basically template with extra steps
04:12:23shashlicki changed to a template with a body: untyped and it still complains that ctx is undeclared
04:14:27leorizeadd `{.dirty.}` to the template
04:15:21shashlickokay now it is complaining about callbacks which is a const
04:17:13leorizecan you post the errors somewhere?
04:19:09shashlick..\src\pluginapi.nim(38, 18) Error: undeclared identifier: 'callbacks'
04:20:05leorizetry adding `mixin callbacks`?
04:22:58shashlickbind callbacks worked
04:24:23shashlickwhy do I have to bind?
04:25:56shashlickbut thanks! it works 😄
04:26:29leorizeeither a bug or it's just how dirty templates work :P
04:28:46shashlickyay, my plugin infrastructure now works
04:28:59shashlicki can edit files and things will get rebuilt and loaded automatically
04:31:25*dddddd quit (Remote host closed the connection)
04:40:56*leb__ quit (Ping timeout: 240 seconds)
04:50:57*leb__ joined #nim
05:13:36FromGitter<Varriount> shashlick: What are you working on?
06:26:02*kapil____ joined #nim
06:52:09*narimiran joined #nim
06:53:16*krux02 joined #nim
07:01:40*krux02 quit (Remote host closed the connection)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:00:16*lritter joined #nim
08:04:52*gmpreussner joined #nim
08:05:41Araqthis explains a lot...
08:05:48Araqvar compilerPrefix* = "compiler" / "nim" ## built via ./koch tests
08:06:05Araqso tests defaults to some temp compiler in compiler/ ?
08:07:43Araqterrible.
08:25:50FromGitter<timotheecour> @araq that dates back from this comment: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c57f70dc2dba5382eda4a60]
08:26:32FromGitter<timotheecour> i also don’t like it; one option is `getCurrentCompilerExe`, another option is `nim`
08:27:03FromGitter<timotheecour> But that obviously needs some thought
08:28:21Araqit should use nim.exe from the PATH unless --nim is used
08:29:10Araqwe can also introduce a NIM_EXE env var that is used by every tool and play the envvar game
08:29:55Araqwhere everything depends on global state. But I guess it already does thanks to PATH
08:30:47FromGitter<timotheecour> here’s a solid argument against PATH: `nim_temp` would never work
08:31:28Araqyeah the logic would be like: use --nim if exists, else test NIM_EXE, else use nim.exe from PATH
08:32:03FromGitter<timotheecour> so NIM_EXE is preferable to PATH; but there is another option: `—define:nimCompiler:…` which user can put in his ~/.config/config.nims for eg
08:32:54Araqno. I don't want a "recursive" nim.exe
08:33:13FromGitter<timotheecour> what do u mean recursive
08:33:29Araqconfig.nims is processed by nim.exe
08:34:01Araqand I thought you meant that it looks at 'nimCompiler' and delegates to it
08:34:22FromGitter<timotheecour> no i don’t mean that
08:35:13FromGitter<timotheecour> what u run on cmd line obviously needs to be in PATH (eg nim or nim_temp or koch or whatever); that’s the program that’ll run and will NOT delgate to nimCompiler
08:36:27FromGitter<timotheecour> i think this deserves a github issue tho, to make sure all arguments r considered'
08:36:51Araqplease don't
08:38:00Araqit's really simple, we won't have NIM_EXE, tools default to the nim.exe from PATH as before and testament will be fixed
08:38:51Araqto override nim.exe globally, mess with the env var PATH instead of a new one
08:38:58FromGitter<timotheecour> how about: ⏎ use `nimCompiler` from `-d:nimCompiler:nim_temp` if exists, else test NIM_EXE, else use nim.exe from PATH
08:39:45AraqI don't understand how -d:nimCompiler:nim_temp could work unless you keep recompiling testament
08:40:24FromGitter<timotheecour> right
08:41:31FromGitter<timotheecour> > we won't have NIM_EXE, tools default to the nim.exe from PATH as before and testament will be fixed ⏎ ⏎ doesn’t work with `nim_temp` for examples
08:41:52Araqno for that you use --nim
08:42:25FromGitter<timotheecour> ok so we still need `—nim`, i thought u wanted to get rid of it
08:43:00Araq(plus nim_temp is really for something else to begin with...)
08:43:09FromGitter<timotheecour> but `koch tests` doesnt’ rebuild nim, and `compilerPrefix` is set to `—nim`
08:43:41Araqhere is my workflow in a nutshell
08:43:55Araq1. develop stuff with 'koch temp c/doc/cpp testfile'
08:44:15Araq2. ensure 'koch boot && koch boot -d:release' still works
08:44:45Araq3. run selected tests with testament (can and should use the nim.exe from PATH)
08:45:11AraqI don't run tests with nim_temp
08:46:02FromGitter<timotheecour> > plus nim_temp is really for something else to begin with ⏎ ⏎ `nim_temp` is just an example, i often run tests w a `nim_experiment_xyz`
08:46:48FromGitter<timotheecour> `./koch tests` can just use `nim` from PATH, else from `—nim`; and (new thing) not from `compiler" / “nim`
08:46:57FromGitter<timotheecour> Yes?
08:47:01Araqyes
08:48:17FromGitter<timotheecour> while u’re here, https://github.com/nim-lang/Nim/pull/10545
08:54:21*floppydh joined #nim
09:01:58*JustASlacker joined #nim
09:04:57*kapil____ quit (Quit: Connection closed for inactivity)
09:06:44*a_b_m joined #nim
09:14:33*Vladar joined #nim
09:29:50narimirandoes nimsuggest leak memory? naaaah https://i.imgur.com/NYn5q9O.png :D
09:31:08leorizeyes, and that's not new :P
09:31:18FromGitter<timotheecour> https://github.com/nim-lang/nimsuggest/issues/75
09:32:21FromGitter<timotheecour> which makes me wonder: seems like a stdlib issue (staticRead) rather than nimsuggest issue
09:33:18leorizewell, nimsuggest have to evaluate expressions to highlight code properly :P
09:36:35Araqnarimiran, fix it ;P
09:40:49narimiranshit, i should have been quiet :D
09:40:50Araqer ... "I read a 600kB file with staticRead" ... well
09:41:22Araqmaybe don't read a 600kB file then, looks more like a memory fragmentation issue
09:41:57Araqcompiler allocates 600kb, frees it, reuses the memory for smaller objects, allocates another 600kb
09:41:58*joshbaptiste quit (Ping timeout: 246 seconds)
09:42:09Araqon the other hand, that's what TLSF was written for
09:42:14FromGitter<mratsim> I’m more concerned about nimsuggesst 100% CPU usage ...
09:42:27FromGitter<mratsim> that’s like everytime I use CTFE
09:42:33leorizeI found that nimsuggest only reach that when it starts evaluating a new file
09:42:58leorizeonce the results are known nimsuggest won't reevaluate it
09:43:42leorizesolution: lower the cpu priority for nimsuggest
09:43:52leorizealso make sure that your OS have a sane scheduler
09:43:58Araqthat's a hack, not a "solution"
09:44:02leorize:P
09:45:06Zevv100% is not a problem; any process that has to do any work will use 100% of the (a) CPU. The question is "how long"
09:45:22leorizemaybe reduce the iteration limit for nimsuggest?
09:47:29FromGitter<mratsim> @Zevv, any process that sleeps will use 100% of the CPU as well
09:48:28Araq"sleeps"? no.
09:48:35Zevvoh? I always though it will not be scheduled an the kernel will handle the sleeping
09:48:40Zevvin a low power state, these days
09:48:47leorizeunless by sleep you mean `while a < 1000000: inc a` :P
09:49:50FromGitter<mratsim> the while foo: polling loop :/
09:50:07Zevvmratsim: I once worked on a platform where the CPU would be powered off if all processes were sleeping. After the time was due it would basically do a cold boot, restore all state from SRAM and resume as if nothing happened
09:50:16Araqthe pooling loops get detected by some CPUs iirc
09:50:21FromGitter<mratsim> you know that when you launch a game and on the main screen the CPU goes 100% … I hate that
09:50:33Araqand then the CPU powers down anyway
09:51:04Zevvanyway: if you'd throttle nimsuggest, the result would just be slower operation, and upsetting the user, right?
09:51:41leorizea way out would be to reduce the iteration limit
09:52:06leorizethat should keep the result usable(?)
09:54:07Araqthe VM has an iteration limit
09:54:51Araqyeah, that's right, the VM solved the halting problem. Take that, you stupid computer science!
09:55:57ZevvI've heard the halting problem has been solved using a big stick. Just bang your computer until it stops.
09:58:10Araqthat's the "Turing as an engineer" variant, the VM uses a counter instead
09:58:19Zevvboth effective
10:03:47FromGitter<timotheecour> @araq ok to split megatest in 2 (by half)? It sometimes causes final link step to fail (with no error messages) ⏎ `Error: execution of an external program failed: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5c580e03f04ef00644d8bd1c]
10:06:15FromGitter<timotheecour> also https://github.com/nim-lang/Nim/pull/10545 is finally green and i need it for other upcoming PRs
10:10:35*xet7 quit (Ping timeout: 268 seconds)
10:20:03AraqIMHO you misuse parentDir, declare it a bug and then you change its behaviour
10:20:44Araq"/" has no parent directories, it's not its own parent
10:22:08Araqand why are your paths full of double slashes? before you arrived I didn't even know it's valid
10:22:30*xet7 joined #nim
10:24:46Araqand how can this be a prerequisite for upcoming PRs... I'm not trying to mock you, please explain the context
10:26:15Araqtimotheecour: megatest also triggered other new bugs we need to look into. Unfortunately we have enough bugs already.
10:27:09FromGitter<timotheecour> Ugh, here we go again, the justification time, fine: ⏎ ⏎ > *<Araq>* "/" has no parent directories, it's not its own parent ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c58137c975714406b911db2]
10:27:30*stefanos82 joined #nim
10:28:07FromGitter<timotheecour> as well as in bash, directly: ⏎ ⏎ ```dirname / ⏎ /``` ⏎ ⏎ Its the sane behavior [https://gitter.im/nim-lang/Nim?at=5c5813b7f04ef00644d8e861]
10:28:22Araqdirname is not the same as parentDir
10:28:44Araqwhile p.len > 0: p = p.parentDir # yay, you broke it for '/'
10:29:55Araqand yeah if you break my code it's "justification time"
10:32:28FromGitter<timotheecour> ok 1 issue at a time; what do u mean by `still has multiple yields` ?
10:33:39Araqthe iterator has multiple 'yield' statements --> code bloat for an inline iterator
10:33:53Araqas the loop's body is then duplicated
10:35:28Araqit's hard to do without multiple yields though because this iterator is misdesigned, too many options that control its behaviour
10:35:36*ng0 joined #nim
10:36:28Araqwhich is why I prefer my 'while p.len > 0: p = p.parentDir' loops that you broke with your new parentDir
10:36:36FromGitter<timotheecour> trying to understand here; that affects performance? or another factor?
10:36:42Araqcode size.
10:37:17FromGitter<timotheecour> well we need just 1 parentDir, the other 1 is a workaround (or should become the main one)
10:37:34FromGitter<timotheecour> (typo => parentDirs)
10:39:18FromGitter<timotheecour> is that an actual bottleneck though ? i’d rather have correctness first and speed can come in future PR if it’s proven a bottleneck ;
10:39:49Araqit's a standard lib, you don't know the bottlenecks.
10:40:16Araqalso again, for every yield statement the for loop *body* is duplicated
10:40:39Araqif the body is 100 lines of code and you have 4 yields, that makes 400 lines of code
10:41:49Araqbut ok, correctness first is fine with me, how is parentDir"/" == "/" correct? it's not.
10:42:54FromGitter<timotheecour> can u write down in PR the list of tests where u disagree with the `expected` i gave ? then i can justify each decision
10:43:17FromGitter<timotheecour> (there are clear bugs from before PR)
10:43:46AraqI already replied on the issue
10:43:47narimiranAraq: what i think @timotheecour is trying to solve/change is the last element `echo toSeq(parentDirs("/a/b/c/d"))`
10:44:19FromGitter<timotheecour> that’s just one of the things that the PR fixes
10:44:35AraqtoSeq(parentDirs) always was broken but now my while loops are broken
10:45:12narimiranso, `low priority` label, and let's move on?
10:46:16FromGitter<timotheecour> not low priority, parentDir and parentDirs are broken and I want to fix it with this PR
10:48:20Araqthen fix it, but don't shift the problem around
10:48:21*leb__ quit (Ping timeout: 250 seconds)
10:48:59Araq"works for me, but objectively it broke code that's out there, including the Nim compiler itself" is not a fix
10:50:27FromGitter<timotheecour> `parentDir("a/b//“)` returns `a/b/` how is this not a bug?
10:50:46FromGitter<timotheecour> and yes, double paths do happen
10:51:27Araqthat is a bug, yes, but parentDir"/" == "" is by design
10:51:42Araqand my code relies on it
10:51:48Araqand it makes sense.
10:52:18narimiranparentDir("/a") == ?
10:52:26Araqand the alternative is something like if parentDir() in ["C:", "/", "D:"]
10:53:07Araqor rather in (when defined(windows): ["C:", "D:"] else ["/"])
10:53:20FromGitter<timotheecour> at the very least we need a proc with the semantic that i gave to to `parentDir` in the PR, it could be called `dirName` ; that’s exactly the semantic i expect from it, analog to other languages
10:53:22Araqand even that would be wrong still
10:54:21Araqand why would dirname for "foo/bar" not return "foo/bar" if that's a directory?
10:54:35*leb__ joined #nim
10:54:55FromGitter<timotheecour> I really don’t understand why `parentDir(“/foo") ` is empty; no other languages does that
10:55:11leorizebecause there's no parent for the root dir?
10:55:29Araqwell parent dir for "/foo" should be "/"
10:55:37Araqbut for "/" it should be empty
10:56:02AraqI agree parentDir is wrong, but the parent dir of "/" is not "/".
10:56:02FromGitter<timotheecour> yes, but previously u said https://github.com/nim-lang/Nim/issues/8734 is not a valid bug…
10:56:17Araqnot everything in there is a bug
10:56:48Araqall I really care about is that parentDir"/" keeps returning ""
10:57:45FromGitter<timotheecour> then we need a bool option as most languages do same as I did; i can try to do research and get back
10:58:05Araqno ffs. I don't care what dirname does in other langs
10:58:13Araqit's not "dirname"
10:58:22Araqit's written as 'parentDir'
10:58:22*dddddd joined #nim
10:58:27FromGitter<timotheecour> then would u accept a `dirName`
10:58:46leorizethe `dirname` behavior came from the POSIX spec IIRC
10:59:14Araq'dirname' is a misleading name
10:59:32FromGitter<timotheecour> it’s the name and behavior that everybody else uses though
10:59:40leorizePOSIX isn't the best spec out there :P
10:59:43*tzui joined #nim
11:00:11leorizewell, but I wouldn't like having a `dirname` in the stdlib
11:00:28leorizesoon people will ask whether they should use `dirname` or `parentDir`
11:01:50FromGitter<timotheecour> in all OSX i know: ⏎ ⏎ ```cd / ⏎ cd .. ⏎ Pwd ⏎ /``` ⏎ ⏎ => consistent w dirName [https://gitter.im/nim-lang/Nim?at=5c581b9e975714406b9156d2]
11:01:59FromGitter<timotheecour> (Typo: in all OS )
11:02:20Araqwho cares we don't have an os.pwd either
11:03:10Zevv /cc
11:05:16Araqhttps://docs.microsoft.com/de-de/dotnet/api/system.io.path.getdirectoryname?view=netframework-4.7.2
11:05:26AraqThis code produces the following output:
11:05:26AraqGetDirectoryName('C:\MyDir\MySubDir\myfile.ext') returns 'C:\MyDir\MySubDir'
11:05:26AraqGetDirectoryName('C:\MyDir\MySubDir') returns 'C:\MyDir'
11:05:26AraqGetDirectoryName('C:\MyDir\') returns 'C:\MyDir'
11:05:26AraqGetDirectoryName('C:\MyDir') returns 'C:\'
11:05:27AraqGetDirectoryName('C:\') returns ''
11:05:30FromGitter<timotheecour> same thing: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c581c799221b9382d11862b]
11:05:54leorizeju/ur
11:05:56leorizeoops
11:06:04FromGitter<timotheecour> so on posix, behavior i have in PR is correct
11:06:04Araqbut notice that parentDir is also not C#'s GetDirectoryName
11:06:11leorizehttps://superuser.com/questions/186184/the-parent-of-the-root-directory
11:06:28narimiranso, EOD? we need to fix `parentDir("/foo")`, and that's it, we can move on?
11:09:24Araqif I understand the situation correctly dirname is a hack for a missing parentDir operation and the "directory name" of "foo/bar" happens to produce "foo" too, so it's good enough to go up in the tree
11:11:20Araq" Evaluating as NimScript file failed with:
11:11:20Araq ... C:\Users\rumpf\projects\nim\lib\pure\os.nim(944, 10) Error: undeclared identifier: 'useWinUnicode'." why?
11:12:19FromGitter<timotheecour> is that after my PR?
11:12:25Araqno
11:12:57AraqI'm re-enabling nimble package testing to testament
11:14:48Araqbut it's ok, it's a regressiong from my os/ospaths reforms
11:16:36Araqah it's a Nimble issue
11:49:00*joshbaptiste joined #nim
11:58:30*banc quit (Ping timeout: 250 seconds)
11:58:43*banc joined #nim
12:05:47*neceve joined #nim
12:06:44*leb__ quit (Ping timeout: 250 seconds)
12:11:13*kungtotte joined #nim
12:17:00FromGitter<timotheecour> @araq for the sake of unblocking that PR, `parentDir(“/“)` is now back to empty, and we can revisit this after that PR is merged so at least the other bugs are fixed in the meantime
12:18:18FromGitter<timotheecour> > *<Araq>* and the alternative is something like if parentDir() in ["C:", "/", "D:”] ⏎ ⏎ there’s a better alternative: `isRoot(dir)` which would mean exactly that (in a robust way wrt multiple slashes etc)
12:19:01FromGitter<timotheecour> (`isRootDir` is a completely different animal (and a bit oddly named IMO) but `isRoot` or another name can be used for that)
12:20:56*jubalh joined #nim
12:21:54Araqthat would still be off as I might want to iterate for the isRoot() case, but *after* it I don't anymore
12:23:30FromGitter<timotheecour> do u have a code snippet as a concrete use case example?
12:23:53Araqthe one you "fixed" in the compiler
12:24:12AraqC:\nim.cfg is a perfectly fine config file
12:24:23Araqand after the C: I'd like to leave the loop
12:25:27Araqbtw fyi: the results for 0.19.9 on "some" Nimble package are a desaster
12:25:42Araqmost stuff is broken in subtle ways
12:25:52Araqbbl
12:25:56FromGitter<timotheecour> u mean as a result of that PR ?
12:28:33FromGitter<timotheecour> > most stuff is broken in subtle ways ⏎ ⏎ that’s what i had observed in https://github.com/nim-lang/Nim/pull/10247
12:47:46shashlick@Varriount: yet another text editor
12:52:13*dom96_w joined #nim
12:53:28*vlad1777d joined #nim
12:55:47*d10n-work joined #nim
13:04:55dom96_wAraq: I thought you got the website push working
13:20:59*leb__ joined #nim
13:26:27*tzui quit (Remote host closed the connection)
13:27:48*tzui joined #nim
13:29:28*leb__ quit (Ping timeout: 264 seconds)
13:42:13Araqdom96_w, told you I didn't
13:42:37dom96_wkeep pinging me for stuff like this
13:42:54Araqyou promised you would do it on FOSDEM
13:44:50*nsf quit (Quit: WeeChat 2.3)
13:46:33Araqnimble test
13:46:33Araq Warning: Package 'arraymancer' has an incorrect structure. It should contain a single directory hierarchy for source files, named 'arraymancer', but file 'autograd.nim' is in a directory named 'autograd' instead. This will be an error in the future.
13:46:33Araq Hint: If 'autograd' contains source files for building 'arraymancer', rename it to 'arraymancer'. Otherwise, prevent its installation by adding `skipDirs = @["autograd"]` to the .nimble file.
13:48:41Araqhttps://gist.github.com/Araq/7b7974aaade522157abb0bb4b34d7c5a
13:48:49dom96_wI said I would try and do it on the train, but the train internet was unusable
13:49:02dom96_wI didn't have a chance to do it while at FOSDEM
13:49:11Araqand then you had no internet for 2 days... :P
13:49:32dom96_wsnd then I forgot
13:49:51Araqanyway, this is bad, I don't understand this error message
13:50:45dom96_wWhy did you post the warning?
13:50:53dom96_wIs that what you don't understand?
13:51:01Araqno, then I gisted it instead
13:51:10narimiransooo, dom96_w, how was FOSDEM? :)
13:51:18Araqthat's arraymancer with Nim devel
13:51:28Araqno idea what's wrong
13:52:01dom96_wnarimiran: pretty good. Met krux02, couven92, a guy called Max and a couple other people
13:53:36dom96_warnetheduck was pretty elusive though
13:54:21Araqhe always is :-)
14:01:06shashlickAraq are macros not allowed to be dirty?
14:01:23Araqwhat would that even mean
14:01:55*vlad1777d quit (Ping timeout: 268 seconds)
14:02:39shashlickLast night I wanted to pass a body to a macro
14:02:56JustASlackerwhat would be the nim way of doing something like "lsof -i | grep bacula-fd | grep ESTABLISHED -c"
14:03:14shashlickThe macro generated a proc
14:03:22JustASlackeruse execShellCmd ?
14:03:27shashlickAnd I wanted to pass the body into the proc
14:03:39*vlad1777d joined #nim
14:03:58dom96_wJustASlacker: yes, or research what APIs `lsof` calls and wrap them in Nim
14:04:02shashlickSo the body contained references to the param of the proc
14:04:11JustASlackerdom96_w: hm, funky idea
14:04:15dom96_wIt's likely something in POSIX though and so should already be wrapped in the `posix` module
14:04:16shashlickNim complains undeclared
14:04:17FromDiscord_<juan_carlos> psutil on nimble
14:04:58JustASlackeroh ,there is a posix module
14:05:10Araqshashlick, make the macro take an 'untyped' parameter
14:05:17*kapil____ joined #nim
14:05:19Araqand ensure it's not overloaded on this position
14:05:21JustASlackerwow that looks ugly
14:05:34shashlickAraq I tried that but it didn't work
14:05:58*dom96_w quit (Quit: Textual IRC Client: www.textualapp.com)
14:06:08Araqit works, it's used extensively in Karax and elsewhere
14:06:21shashlickLeorize finally got me up and running with a dirty template
14:06:27shashlickOk I'll check Karax
14:09:47*vlad1777d quit (Ping timeout: 240 seconds)
14:17:46FromGitter<mratsim> @araq not sure what the error is, but it seems quite recent
14:18:14Araqmratsim: I managed to fix it but now I'm in blas.dll hell
14:18:32Araqand I moved on to nimongo
14:18:36FromGitter<mratsim> which platform are you on?
14:18:53Araqwindows
14:19:00FromGitter<mratsim> ah yeah windows
14:19:10FromGitter<mratsim> in the CI I use nuget to download blas
14:19:50FromGitter<mratsim> hopefully with Laser I can remove that dependency or have a at least a 80% speed fallback
14:20:21Araqthe dependency is ok, I don't expect stuff to work anyway
14:20:33Araqbut Nim's error message sucks
14:20:42Araqor maybe the regression sucks
14:21:28Araqtheory vs practice. In theory static checking for my tensors is lovely. in practice I cannot get it to compile and would have to use Python instead
14:21:39FromGitter<mratsim> according to the error message, one tensor became a seq
14:22:27Araqyeah I fixed it.
14:29:24*rokups joined #nim
14:45:06narimiranto continue the discussion about nimsuggest memory consumption from this morning:
14:45:31narimiranchanging these would be a (too) easy fix? :) https://github.com/nim-lang/Nim/blob/devel/nimsuggest/nimsuggest.nim.cfg#L13
14:46:46Araqhow much RAM do you have?
14:47:04narimiranplenty, but that's not the point
14:47:44Araqwhat is the point?
14:48:41*aguspiza joined #nim
14:49:01*plushie joined #nim
14:54:08narimiranpoint is that some suggesting tool shouldn't be allowed to take all|half of somebodies RAM
14:54:33narimiranif it leaks (and it does), we can kill it earlier, before it becomes a monster
14:55:10Araqso ... if it takes 4GB it's a monster but if it takes 2GB it isn't?
14:55:28narimiranover 200MB is a monster already :D
14:56:14narimirancurrently i kill all nimsuggest processes several times a day
14:58:38Araq"all processes"? Why does it start more than one
15:00:09*ng0 quit (Ping timeout: 256 seconds)
15:00:26FromGitter<mratsim> vscode plugin once again I guess
15:00:43FromGitter<mratsim> same, I need to killall nimsuggest quite often
15:00:50narimiranhuh, i thought that's normal and expected :/ let me see if i can narrow it down when a new process appears
15:00:52FromGitter<mratsim> especially just before benchmarking
15:00:57narimiran(yes, vscode plugin)
15:10:05narimiranok, there are two behaviours i'm experiencing when i try to edit more than one file in vscode:
15:10:48narimiraneither there is a new nimsuggest process for the second file, or i don't have code completition for it
15:33:38narimiranAraq: here is a screenshot of multiple nimsuggest processes, courtesy of vscode plugin: https://i.imgur.com/W6UFs8z.png
15:42:35*JustASlacker quit (Remote host closed the connection)
15:54:16*nsf joined #nim
16:06:05*plushie quit (Quit: WeeChat 1.9.1)
16:13:07*leb__ joined #nim
16:23:16*seni joined #nim
16:24:09*kapil____ quit (Quit: Connection closed for inactivity)
16:41:30*gmengano joined #nim
16:43:47*gmengano quit (Client Quit)
16:49:50*dom96_w joined #nim
16:50:08dom96_whttps://www.reddit.com/r/nim/comments/aillno/speeding_up_python_with_nim/efq1q23/?context=3
16:50:21dom96_wWho was it that said this is a common optimisation problem? Mratsim? :)
16:50:27*dom96_w quit (Client Quit)
16:52:07FromGitter<mratsim> yep
16:53:06FromGitter<mratsim> there is a forum thread about that in the past 6 days too
16:53:23FromGitter<mratsim> we probably need a dedicated article, similar to faster commend line tools in Nim
16:53:31FromGitter<mratsim> command*
16:54:02FromDiscord_<juan_carlos> I got 3 modules on PyPI, 3~20 X speed, depends how CPU intensive stuff is.
16:54:34FromDiscord_<juan_carlos> Some Python modules on C are really manually hand crafted to state of the art after a lot of years to.
17:00:46FromGitter<mratsim> I’m pretty sure the main issue is intermediate string allocation when people concatenate or loop over a string
17:04:11FromDiscord_<juan_carlos> Best is to get all strings and join all them at once, if possible.
17:04:21*floppydh quit (Quit: WeeChat 2.3)
17:08:01FromGitter<mratsim> People coming from a language with a GC that also does memory pooling are not trained to do that
17:09:00FromGitter<mratsim> relevant: https://forum.nim-lang.org/t/2816
17:25:57*neceve quit (Ping timeout: 246 seconds)
18:17:07*chimez joined #nim
18:17:22*chimez quit (Client Quit)
18:30:30*vlad1777d joined #nim
18:49:31*theelous3 joined #nim
18:51:35*nsf quit (Quit: WeeChat 2.3)
19:49:09Araqhmm my osx lacks CLOCK_REALTIME
19:56:43Araq„As FreeBSD and OSX support CLOCK_REALTIME, there's no reason to keep this code around.“
19:56:56Araqyes there is, older OSXes still lack it...
20:00:03*Cthalupa quit (Ping timeout: 245 seconds)
20:00:59leorizeAraq: that's rather weird, what version of OSX are you running?
20:01:28Araq10.11.6 El Capitan
20:02:31*Cthalupa joined #nim
20:03:41leorizeah, I see, only 10.12+ supports it
20:03:45Araqand why don't we use mach_absolute_time
20:03:48*lritter quit (Quit: Leaving)
20:04:05Araqposix is an illusion, there are only real OSes and we need to target them.
20:05:31leorizeyou can try :) I don't have a Mac when I wrote that patch so I just relied on the CI
20:06:26*rokups quit (Quit: Connection closed for inactivity)
20:07:57Araqno, I reverted your commit instead, partially for OSX
20:30:04*Trustable joined #nim
20:59:28dom96website deployed
21:01:27*Trustable quit (Remote host closed the connection)
21:17:46FromGitter<riddl_gitlab> any sprintf equivalent in nim?
21:17:59dom96https://nim-lang.org/docs/strformat.html
21:19:46FromGitter<riddl_gitlab> thank you, duck duck go should index nim website better;)
21:20:23FromGitter<kaushalmodi> at least on google, "nim string formatter" returns strformat link
21:20:49FromGitter<kaushalmodi> well, ddg too: https://duckduckgo.com/?q=nim+string+formatter&t=hk&ia=web
21:21:06FromGitter<kaushalmodi> ok, 3rd link
21:21:14FromGitter<riddl_gitlab> yeah, I should look for more generalized term
21:21:28FromGitter<riddl_gitlab> not "sprintf equivalent nim" ;)
21:21:58FromGitter<kaushalmodi> heh
21:23:02dom96hopefully duck duck go will pick it up in the irc logs :)
21:23:22FromGitter<riddl_gitlab> :D
21:24:03FromGitter<Clyybber> I'm trying to build nim on alpine linux, does musl not provide limits.h?
21:24:33FromGitter<Clyybber> Because building the csources fails with limits.h not being available
21:25:40FromGitter<riddl_gitlab> install musl-dev
21:26:15FromGitter<Clyybber> Thank you
21:27:48FromDiscord_<juan_carlos> Theres a project named nim_config thats a nimscript with tasks to install musl, compile, etc etc
21:28:27FromGitter<kaushalmodi> nim_config will sort of evolve into my personal nim config
21:28:33FromGitter<kaushalmodi> like my emacs config, etc.
21:28:41FromGitter<kaushalmodi> see the hello_musl project instead: https://github.com/kaushalmodi/hello_musl
21:28:47*aguspiza quit (Ping timeout: 240 seconds)
21:29:15FromGitter<kaushalmodi> though, that library requires the user to have the musl library installed on their machine
21:29:38FromGitter<Clyybber> @kaushalmodi Does nim not compile without such a config?
21:29:56*leb__ quit (Ping timeout: 240 seconds)
21:30:20FromGitter<kaushalmodi> the hello_musl is basically a repo to store recipes for compiling various libs using musl + nim
21:30:24FromGitter<kaushalmodi> like pcre and openssl
21:30:59FromGitter<kaushalmodi> if you don't plan to statically link those 2 libs, you won't need most of the config in hello_musl
21:31:19FromGitter<Clyybber> Ah ok. Does the stdlib make use of pcre or openssl/libressl?
21:31:28FromGitter<kaushalmodi> also, I wanted `nim musl foo.nim` to do the Right Thing(TM) and that's how that hello_musl project was born
21:32:32FromGitter<kaushalmodi> `httpclient` needs ssl
21:32:44FromGitter<kaushalmodi> if you are using the inbuilt `re`, you will need pcre
21:33:17FromGitter<kaushalmodi> (and many other stdlibs use ssl)
21:33:17FromGitter<Clyybber> Does nre require pcre too?
21:33:22FromGitter<kaushalmodi> nre is deprecated
21:33:38FromGitter<kaushalmodi> https://scripter.co/notes/nim/#regex
21:33:55FromGitter<kaushalmodi> if you don't want to rely on pcre, `nimble install regex`
21:34:30FromGitter<Clyybber> Thank you
21:35:54FromGitter<timotheecour> > nre is deprecated ⏎ ⏎ Ugh… not that again; nre has a better API, we have to either keep both or deprecate the other
21:36:00Araqyay, 0.19.4 is out. thanks dom96
21:36:21Araqyes, that again, because that's what we claimed to be the case
21:37:26FromGitter<Clyybber> I thought nre was the newer one, so thats why I was confused
21:39:10FromGitter<timotheecour> @Clyybber you have to read the entire thread (eg https://github.com/nim-lang/RFCs/issues/31#issuecomment-427682084) to get a good understanding of re vs nre
21:43:05FromGitter<Clyybber> Don't know what that is related to, but I'm encountering two new issues rn.
21:43:39FromGitter<Clyybber> Nimble for some reason keeps downloading a dependency of a package of mine
21:44:03FromGitter<Clyybber> and linking fails with musl and undefined references to vulkan functions...
21:44:58FromGitter<Clyybber> @kaushalmodi Do you know what could cause undefined references with musl but not with glibc?
21:46:06*narimiran quit (Ping timeout: 250 seconds)
21:46:28FromGitter<Clyybber> Im using {.link:.}, does that not work with musl out of the box?
21:46:35shashlickuse nimpcre if you want to compile it in
21:47:18FromGitter<Clyybber> I don't use nre or re right now, I'm using my vulkan wrapper
21:47:30FromGitter<Clyybber> And I'm linking libvulkan.so
21:47:37FromGitter<Clyybber> but it doesn't work with musl
21:57:10*Vladar quit (Remote host closed the connection)
22:26:36*thomasross quit (Remote host closed the connection)
22:29:23*thomasross joined #nim
22:30:28*thomasross quit (Max SendQ exceeded)
22:31:11*thomasross joined #nim
22:32:43*thomasross quit (Max SendQ exceeded)
22:33:15*thomasross joined #nim
22:35:08*thomasross quit (Max SendQ exceeded)
22:35:34*thomasross joined #nim
22:36:31dom96https://news.ycombinator.com/item?id=19081351
22:36:38dom96*cough*
22:41:51FromGitter<riddl_gitlab> what Status is? some cryptocurrency scam company?
22:42:09FromGitter<arnetheduck> yep, terrible people
22:42:10xace_lol
23:15:11*flaviu quit (Remote host closed the connection)
23:15:37*flaviu joined #nim
23:22:41*flaviu quit (Remote host closed the connection)
23:44:12*vlad1777d quit (Ping timeout: 244 seconds)
23:59:57*stefanos82 quit (Remote host closed the connection)