<< 25-11-2018 >>

00:14:30*craigger quit (Quit: bye)
00:14:58*craigger joined #nim
00:15:48*craigger quit (Client Quit)
00:16:00FromGitter<zacharycarter> the corresponding C def is - ``` ⏎ ⏎ #define BGFX_STATE_BLEND_LIGHTEN (0 \ ⏎ ⏎ | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE) \ ... [https://gitter.im/nim-lang/Nim?at=5bf9e9c0a115c91ef789e42f]
00:17:59*craigger joined #nim
00:23:29*craigger quit (Quit: bye)
00:26:31*craigger joined #nim
00:32:44*craigger quit (Quit: bye)
00:39:47*craigger joined #nim
01:22:41*zachk quit (Quit: Leaving)
01:29:19*wildlander quit (Quit: Konversation terminated!)
01:34:23*wildlander joined #nim
01:35:47zachcarterif anyone has a chance - bketelsen - is needing acct approval on the forumss
01:38:10zachcarterhe and I communicate on twitter and he uses Nim / would like to offer some thoughts and opinions on my post regarding nim FE wev dec
01:46:52*vlad1777d quit (Ping timeout: 252 seconds)
01:48:35*stefantalpalaru quit (Quit: Leaving)
02:06:37*leorize joined #nim
02:15:47*Serenitor joined #nim
02:28:52*Serenitor quit (Quit: Leaving)
02:29:40*wildlander quit (Quit: Konversation terminated!)
02:32:24*ng0_ joined #nim
02:34:09*ng0 quit (Ping timeout: 256 seconds)
02:51:09*ng0_ quit (Quit: Alexa, when is the end of world?)
03:07:40*banc quit (Quit: ZNC - http://znc.in)
03:23:21*banc joined #nim
03:41:46*enthus1ast quit (Ping timeout: 252 seconds)
03:55:12*enthus1ast joined #nim
04:06:02*leorize quit (Quit: WeeChat 2.2)
04:06:21*leorize joined #nim
04:12:48*wildlander joined #nim
05:11:14shashlick@zacharycarter: we need to open an issue to remove the ordered enums restriction - hopefully Araq can explain why he added it and if it can be removed with minimal consequences
05:12:51shashlickEven with nimterop, I cannot think of an easy way to circumvent this automatically - declarations can depend on other header files
05:18:53leorizeyou can generate a distinct int with a converter from enum
05:52:58*nsf joined #nim
05:59:23*leorize quit (Quit: WeeChat 2.2)
05:59:42*leorize joined #nim
06:01:41shashlickleorize: can you give an example please?
06:07:56leorizehttps://ptpb.pw/SFks/nim
06:08:35leorizeshashlick: ^
06:08:47leorizeIIRC someone is working on something like this for c2nim
06:28:48*kapil____ quit (Quit: Connection closed for inactivity)
06:48:00*narimiran joined #nim
06:59:14*nuxdie quit (Quit: WeeChat 2.2)
07:26:17*kapil____ joined #nim
07:42:46Araqshashlick: ok, we can do that. the reason I didn't was that c2nim reorders the enum
07:43:40Araqthat said, for C interop a distinct int usually work better as C code is eternally confused about flags vs set of flags
08:03:09*smt quit (Read error: Connection reset by peer)
08:11:15*Vladar joined #nim
08:24:28*stefanos82 joined #nim
09:24:04*dddddd quit (Remote host closed the connection)
09:52:53narimiranAraq: are there any things we need to do before 0.19.2 release? updating changelog? something else?
09:54:35*ng0 joined #nim
10:20:24FromGitter<mratsim> too late for 0.19.2, there are lots of changes
10:20:59narimiran@mratsim: https://github.com/nim-lang/Nim/tree/version-0-19
10:21:22narimiranwe have backported a lot of non-breaking stuff
10:21:26FromGitter<mratsim> oh
10:58:37Araqnarimiran, what's your OS?
11:00:21Araqhttps://github.com/nim-lang/Nim/issues/9375 we should fix this and backport it
11:01:19*wildlander quit (Quit: Konversation terminated!)
11:02:51narimiranmanjaro linux, 64bit
11:07:25Araqcan anybody help us with https://travis-ci.org/nim-lang/nightlies/jobs/459303437 ?
11:07:32Araqthese errors are mysterious
11:28:34narimiranmaybe @kaushalmodi?
11:33:35*vlad1777d joined #nim
11:51:07*anamok joined #nim
11:51:09anamokhi
11:53:24FromGitter<dom96> Oooh. Awesome. Bketelson is joining our forum. He wrote Go in Action.
11:54:05anamokHow I can use xterm-256 colors in the terminal? Does the module "terminal" have support for that? I only saw the normal 16 colors there.
11:56:02ng0has anyone ported or tried to work with nim in a musl + gcc toolchain? one of our crew got this into the todo list.
11:56:22leorizeng0: it's already working
11:56:34leorizeI'm running a musl-based distro rn :)
11:56:36ng0just checking if we're first there or someone done it. ah, good
11:56:45narimiranng0: https://scripter.co/nim-deploying-static-binaries/ ?
11:58:14ng0tack :)
12:10:55*theelous3_ joined #nim
12:17:07*banc quit (Ping timeout: 240 seconds)
12:18:07*Gertm left #nim ("Leaving")
12:23:58*banc joined #nim
12:45:12*zachcarter quit (Ping timeout: 268 seconds)
12:46:03anamokI could figure it out and made a gist of it: https://gist.github.com/jabbalaci/700fd51757b1c0a1edac4ef61946bc3d
12:47:29anamokQuestion: in the gist FG and BG are vars. How could I make them const or let?
12:47:51anamokThe problem is that I fill them in a loop.
12:48:35anamokShould I fill a temp var and then assign this tmp to a let?
12:52:55narimirananamok: oh, so you're jabbalaci :)
12:53:32narimiranyou can either use (compile time) proc, or a block, i'll share an example, just a sec
12:58:37narimirananamok: btw, if you're using ints 0..255 for keys, i would use plain ole array for that, not a table
12:59:58anamokright, could be an array too
13:01:02narimirananamok: here you go: http://ix.io/1uov/
13:01:40narimiranarray will be (noticeably) faster
13:02:03anamoknice, thank you
13:07:40*PMunch joined #nim
13:09:11anamokIn Python, for a nice code we say "it's Pythonic". What do we say for a nice Nim code?
13:09:13shashlickleorize: thanks, seems simple enough - but isn't it the other way? You'd want to use SomeEnum everywhere since that's what exists in the C realm? Reason being someProc would be wrapped from C and would expect a SomeEnum.
13:09:57Araqanamok, "Nimish" but probably "idiomatic Nim code"
13:10:14xacehow are you suppose to use the random module in nim? i cant seem to initRand(randomize)
13:10:21shashlickAraq: c2nim does not reorder enums - I have had to manually do that
13:10:51anamokxace: just call randomize() ?
13:11:08shashlickBut if we can come up with a generic pattern for enums, should be usable
13:11:27Araqshashlick, strange I remember merging a PR that implemented enum reordering
13:12:06shashlickJust that I would have to use it for every enum I see - regardless of whether it needs reordering or not
13:12:14xaceyeah that works
13:12:46shashlickWell unless c2nim parses include files as well, it isn't fool proof
13:13:31shashlickCause an enum could | or & values from include files
13:14:01shashlickAnd you have no idea what an expression resolves to unless you fully evaluate it
13:15:51shashlickI honestly don't want to drive another change into Nim to support this scenario. If there's an easy way to do this with a converter then I'm good with that
13:16:19Araqwell adding a sort() to the compiler ain't gonna kill us
13:16:37Araqthe bigger problem that I see is that it helps very little, C enums are not Nim enums
13:19:15shashlickCan you comment on my question to leorize? I feel his example is reserved - https://ptpb.pw/SFks/nim
13:19:34Araqso... it's one of these days. Araq tries non-Nim software on his PC.
13:20:44Araqgem install travis -v 1.8.9 --no-rdoc --no-ri
13:20:44AraqERROR: Could not find a valid gem 'travis' (= 1.8.9), here is why:
13:20:44Araq Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)
13:20:57*zachcarter joined #nim
13:21:23anamokbye
13:21:30*anamok quit (Remote host closed the connection)
13:26:47Araqtravis lint .travis.yml
13:27:03AraqI get 3 warnings, all irrelevant
13:27:21Araq" illegal value windows, defaulting to linux" nope, travis now supports Windows
13:27:58Araqalso, the linter cannot give line information because it's a YAML file and by the time it checks the configuration the line information is gone
13:28:39Calinoutravis lint isn't too up-to-date on stuff
13:29:34Araqwell I guess the bash code in my YAML is wrong... :P
13:32:19Araqshashlick, what's there to comment on?
13:32:43AraqI don't like it because you can achieve the same with
13:32:59Araqconst seValue1 = SomeEnumImpl(0)
13:33:30Araqand that's less confusing because you don't use 2 different types for the same entity
13:34:50Araq"If you want to try out your changes locally: bundle install"
13:35:05Araq--> I don't have "bundle"
13:39:32shashlickAraq: but how do you pass an enum to a C proc which is wrapped - will Nim accept a distinct int?
13:39:53shashlickThe C proc will expect a SomeEnum type
13:40:09Araqdepends on how you wrapped the C proc
13:40:23Araqdon't use .header and you'll live a happy life
13:42:18Araqthinking about it, even with .header there won't be problems, C's type checking is mostly optional, gcc will produce a warning, nim will disable it, everything is fine
13:43:33shashlickOk I'll experiment with it
13:44:13shashlickWas using soloud as a test for nimterop and it has one such enum front and center
13:45:24Araqactually, C doesn't have enums, it only has an alternative spelling for #define constants
13:46:04shashlickI was doing most of the nimterop work in the vm but am now moving it into the compiled portion instead hoping it will be faster
13:46:30shashlickDoes this enum to distinct int work in c++ too?
13:47:19Araqkind of, type E {.importcpp: "E", header: "foo.h".} = distinct int
13:54:34FromGitter<kaushalmodi> narimiran, Araq: I can look at the Travis error, but am traveling at the moment, so I can look at this only in 2 weeks.
14:04:00*dddddd joined #nim
14:11:44*theelous3_ quit (Ping timeout: 250 seconds)
14:19:26*krux02 joined #nim
14:22:12*smitop_ joined #nim
14:23:31*gangstacat quit (Quit: Ĝis!)
14:23:46*krux02 quit (Remote host closed the connection)
14:26:27*krux02 joined #nim
14:55:13*krux02 quit (Remote host closed the connection)
15:04:11*gangstacat joined #nim
15:19:14FromGitter<tim-st> always when I want to use rstrip or lstrip it takes me a half minute to configure the strip proc right :\
15:21:44narimiranwhat's the problem with strip?
15:24:22FromGitter<tim-st> the probem is the param names leading and trailing
15:26:00FromGitter<tim-st> lstrip and rstrip would be much easier, maybe native speakers dont have a problem with it
15:26:18narimiranoh, there is no lstrip and rstrip!
15:26:52narimiranso we need a wrapper around strip?
15:27:24FromGitter<tim-st> yes, it's also there for split -> rsplit and lsplit
15:28:02narimiranwill you make a PR?
15:28:39FromGitter<tim-st> would the procs be allowed?
15:30:12FromGitter<tim-st> or should it be templates? maybe then the binary size doesnt increase
15:32:23narimirani would just make it a proc `proc rstrip(s: string) = strip(s: string, leading = false)`. start with the simplest implementation and see what other will say
15:32:37narimiran(although i already can guess some reactions :))
15:34:42FromGitter<tim-st> hm, I think we should really solve the problem before 1.0 that removePrefix, removeSuffix for set[char] is actually lstrip, rstrip and that rstrip and lstrip are missing
15:35:53FromGitter<tim-st> or just deprecate removePrefix, removeSuffix for set[char] and create an additional for only single char; and add rstrip and lstrip that would solve all
15:41:54*PMunch quit (Read error: Connection reset by peer)
15:43:02narimiranremovePrefix and removeSuffix work on var string and modify it. lstrip and rstrip should, like strip, return a new string
15:45:03*smt joined #nim
15:46:33FromGitter<tim-st> that's another problem. In my opinion all important strutils procs should have a in place overload. This will work because the compiler doesnt allow a return value skipped without discard
15:48:06FromGitter<tim-st> e.g. `echo "abccb".rstrip({'b', 'c'})` can not be the in place version because echo needs a type
15:53:47FromGitter<tim-st> the specific example with removePrefix, removeSuffix was because a prefix and a suffix is a string of fixed length by definition, so it's not correct to allow passing a set[char]
15:53:48narimirani'm not sure i like "it can be inplace or not, it depends on the surroundings"
15:54:24FromGitter<tim-st> do you have an example where this wouldnt work or wouldnt be clear for the dev / compiler?
15:56:49narimirani do not from the top of my head
15:57:05leorizedon't we use the past form of a verb for operation that's return a result?
15:57:24narimirani never know which is which ;)
15:58:16FromGitter<tim-st> leorize: yes, for `sorted` but this doesnt work anymore because it would be `stripped` then and not `strip`
15:58:17leorizeit's written in the API naming guide I believe
15:58:38leorizewhy does it have to be `strip`?
15:59:09FromGitter<tim-st> it doesnt have to be, but would be a breaking change
15:59:20narimiranleorize: familiarity and the least amount of surprise?
15:59:23leorizeah
15:59:39FromGitter<tim-st> my suggestion wouldnt break anything
16:36:50*Trustable joined #nim
17:10:55FromGitter<citycide> @tim-st I agree with you that strutils procs should all have in-place/not in-place overloads where it makes sense
17:12:54dom96Hello guys. What's new in Nim land?
17:13:32narimirandom96: 0.19.2 is almost out :)
17:14:24dom96Oh. Guess it might be helpful if I generate the release notes
17:14:41*zachcarter quit (Ping timeout: 268 seconds)
17:14:44dom96Is there a branch with the backported fixes?
17:15:07narimiranhttps://github.com/nim-lang/nim/tree/version-0-19
17:19:56dom96Cool. I'll generate the release notes.
17:20:05dom96I suppose I should show you how to do that :D
17:39:57serialdev[m]I added nim repl support to emacs dom96
17:40:15serialdev[m]in case more vim ppl might find it useful
17:40:25serialdev[m]*nim
17:46:56dom96Awesome
17:49:40FromGitter<tim-st> @citycide would you prefer overloading in place variants with same proc name or "fixing" the names by adding `In` suffix like `nep1` suggests?
17:50:01dom96narimiran: So here is the release notes generator: https://github.com/dom96/relnotesgen/blob/master/relnotesgen.nim
17:51:07dom96It's a script through-and-through, in that it expects you to modify the source code :)
17:51:31dom96You first need a GitHub access token, which you pass on the command line
17:51:46dom96Then you edit line 95: getCommitList("...") with the version you want
17:51:57dom96(PRs for improvements always welcome)
17:52:27narimiranok, i'll check it out
18:02:10FromGitter<citycide> @tim-st not sure that I mind either way tbh. Nim's type system allows for pretty clear overloads in this case but an `In` suffix would be fine too
18:03:33FromGitter<tim-st> ok, hm
18:06:41FromGitter<tim-st> I also had the problem sometimes that I had to think about if the proc named with past partciple name is the version that returns new or changes like @narimiran said, imo the nicest way would be using same name for both; having this the compiler could even optimize chained calls where both versions exist
18:07:53FromGitter<tim-st> (well only under the assumptions that these do the same :\ )
18:54:43*Perkol joined #nim
18:56:20PerkolIn this https://github.com/nitely/nim-regex package, how do I create compiled regex from already declared text var?
18:56:46Perkolstring var
18:57:04narimiranPerkol: compiled from runtime var?
18:57:29PerkolYes
18:57:47PerkolDynamically
18:57:53narimirantime-machine? :D
18:58:13PerkolLike i want to see if string mathes a set of patterns
18:58:40PerkolAnd if it matches some pattern do something
18:59:38narimiranoh wait, you have various regex patterns, and now you want to see if your string matches some of them?
19:00:06dom96narimiran: Does this look okay? https://gist.github.com/dom96/277dc1ad5b04ef0eaa26637f5b857314
19:00:07PerkolFigured it out
19:00:12dom96I didn't expect this many for 0.19.2
19:01:15narimirandom96: well 0.19.2 is long overdue ;) line 4 and 5 are duplicated
19:02:02dom96It's just the raw output from the script, to give you an idea of what it gives
19:02:37narimiranok, then: it looks okay :)
19:04:10narimiranbtw, that's only 1/3 of all changes made since 0.19.0. october (hactober) was very productive!
19:04:59dom96I thought 0.19.2 is hand-picked commits
19:05:05dom96What was the cut-off?
19:07:08xacedoes nim doc have the ability to include the module itself as a code-block in the generated documentation?
19:07:50xace(this isnt important, im just wondering)
19:08:09narimirandom96: yes, handpicked commits that fix some bugs without introducing new features and/or breaking changes
19:09:09dom96narimiran: that seems like a lot of hand picking :)
19:09:30narimiranbelieve me, it was
19:10:02narimiranbut now we have `[backport]` tag so it is slightly less painful experience :D
19:10:27*zachcarter joined #nim
19:10:28PerkolIs there way to convert cstring to usual string?
19:10:36dom96$
19:10:55Perkol$some_string
19:10:57Perkol?
19:11:00dom96yep
19:11:18PerkolThanks
19:12:31*Vladar quit (Remote host closed the connection)
19:15:09*zachcarter quit (Ping timeout: 252 seconds)
19:20:16*leorize quit (Quit: WeeChat 2.2)
19:31:41*Perkol quit (Quit: Leaving)
19:45:55*abm joined #nim
19:51:44*smitop_ quit (Quit: Connection closed for inactivity)
20:15:39*Trustable quit (Remote host closed the connection)
20:25:15FromGitter<tim-st> quite a few useful procs in strutils got deprecated starting at version 0.20 :\
20:26:14FromGitter<tim-st> @narimiran I've written lstrip, rstrip and in place versions here: https://github.com/tim-st/Nim/commit/2fd675816fd8f9e55a3a62da832764ba616ed674
20:33:04*miran joined #nim
20:33:45FromGitter<tim-st> well, the compiler doesnt supports this kind of overloading...
20:34:48*narimiran quit (Ping timeout: 250 seconds)
20:43:41dom96PMunch: if you're around (and see this), I'm curious where you're giving a lightning talk at FOSDEM
20:43:52dom96Is it in a Devroom? If so, which?
20:55:16*miran is now known as narimiran
21:10:44*zachcarter joined #nim
21:13:45*theelous3_ joined #nim
21:15:06*zachcarter quit (Ping timeout: 250 seconds)
21:19:33xacedoes anyone know if there's a benefit to keeping a 'var' outside a while look, or using a 'let' inside the while loop? will the internal variable just get re-constructed on every iteration? i couldnt measure any noticeable difference in my simple testing...
21:21:21dom96Yes, your var will get re-defined on each iteration
21:32:23*zachcarter joined #nim
21:34:07*nsf quit (Quit: WeeChat 2.3)
21:36:46*zachcarter quit (Ping timeout: 250 seconds)
21:37:01*krux02 joined #nim
21:46:46*kungtotte quit (Remote host closed the connection)
21:48:32*kungtotte joined #nim
22:20:35*narimiran quit (Remote host closed the connection)
22:23:21FromGitter<arnetheduck> xace, the variable will logically get reconstructed but not practically, if it's a stack object - the compiler will hoist any side-effect free stuff outside the loop.. depending on the quality of the optimizer and what you're allocating, there might be benefits to keeping it inside the loop
22:28:32xaceoki fair enough,
22:29:12*Snircle joined #nim
22:32:19FromGitter<arnetheduck> generally, it pays off to tend towards doing what logically makes sense for the problem at hand.. in your case, sounds like `let` is the right thing to do - the readers of your code will thank you
22:32:39FromGitter<arnetheduck> and so will the optimizer, when it gets smarter :)
22:33:38xaceOki, I'll keep doing that in the future :-)
22:35:04*kapil____ quit (Quit: Connection closed for inactivity)
22:38:28*stefantalpalaru joined #nim
22:41:45*stefanos82 quit (Quit: Quitting for now...)
22:45:57FromGitter<mratsim> Yeah I just finished my JIT Hello World: https://github.com/mratsim/jitterland/blob/master/jit_hello.nim
22:55:46*rockcavera joined #nim
23:05:04*ng0 quit (Quit: Alexa, when is the end of world?)
23:07:41*smt` joined #nim
23:11:44*smt quit (Ping timeout: 268 seconds)
23:12:06*smt` quit (Ping timeout: 250 seconds)
23:25:29*eddylu joined #nim
23:32:57*zachcarter joined #nim
23:37:38*zachcarter quit (Ping timeout: 268 seconds)
23:53:56*stefantalpalaru quit (Quit: Leaving)