00:14:30 | * | craigger quit (Quit: bye) |
00:14:58 | * | craigger joined #nim |
00:15:48 | * | craigger quit (Client Quit) |
00:16:00 | FromGitter | <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:47 | zachcarter | if anyone has a chance - bketelsen - is needing acct approval on the forumss |
01:38:10 | zachcarter | he 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:14 | shashlick | @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:51 | shashlick | Even with nimterop, I cannot think of an easy way to circumvent this automatically - declarations can depend on other header files |
05:18:53 | leorize | you 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:41 | shashlick | leorize: can you give an example please? |
06:07:56 | leorize | https://ptpb.pw/SFks/nim |
06:08:35 | leorize | shashlick: ^ |
06:08:47 | leorize | IIRC 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:46 | Araq | shashlick: ok, we can do that. the reason I didn't was that c2nim reorders the enum |
07:43:40 | Araq | that 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:53 | narimiran | Araq: 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:24 | FromGitter | <mratsim> too late for 0.19.2, there are lots of changes |
10:20:59 | narimiran | @mratsim: https://github.com/nim-lang/Nim/tree/version-0-19 |
10:21:22 | narimiran | we have backported a lot of non-breaking stuff |
10:21:26 | FromGitter | <mratsim> oh |
10:58:37 | Araq | narimiran, what's your OS? |
11:00:21 | Araq | https://github.com/nim-lang/Nim/issues/9375 we should fix this and backport it |
11:01:19 | * | wildlander quit (Quit: Konversation terminated!) |
11:02:51 | narimiran | manjaro linux, 64bit |
11:07:25 | Araq | can anybody help us with https://travis-ci.org/nim-lang/nightlies/jobs/459303437 ? |
11:07:32 | Araq | these errors are mysterious |
11:28:34 | narimiran | maybe @kaushalmodi? |
11:33:35 | * | vlad1777d joined #nim |
11:51:07 | * | anamok joined #nim |
11:51:09 | anamok | hi |
11:53:24 | FromGitter | <dom96> Oooh. Awesome. Bketelson is joining our forum. He wrote Go in Action. |
11:54:05 | anamok | How 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:02 | ng0 | has 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:22 | leorize | ng0: it's already working |
11:56:34 | leorize | I'm running a musl-based distro rn :) |
11:56:36 | ng0 | just checking if we're first there or someone done it. ah, good |
11:56:45 | narimiran | ng0: https://scripter.co/nim-deploying-static-binaries/ ? |
11:58:14 | ng0 | tack :) |
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:03 | anamok | I could figure it out and made a gist of it: https://gist.github.com/jabbalaci/700fd51757b1c0a1edac4ef61946bc3d |
12:47:29 | anamok | Question: in the gist FG and BG are vars. How could I make them const or let? |
12:47:51 | anamok | The problem is that I fill them in a loop. |
12:48:35 | anamok | Should I fill a temp var and then assign this tmp to a let? |
12:52:55 | narimiran | anamok: oh, so you're jabbalaci :) |
12:53:32 | narimiran | you can either use (compile time) proc, or a block, i'll share an example, just a sec |
12:58:37 | narimiran | anamok: btw, if you're using ints 0..255 for keys, i would use plain ole array for that, not a table |
12:59:58 | anamok | right, could be an array too |
13:01:02 | narimiran | anamok: here you go: http://ix.io/1uov/ |
13:01:40 | narimiran | array will be (noticeably) faster |
13:02:03 | anamok | nice, thank you |
13:07:40 | * | PMunch joined #nim |
13:09:11 | anamok | In Python, for a nice code we say "it's Pythonic". What do we say for a nice Nim code? |
13:09:13 | shashlick | leorize: 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:57 | Araq | anamok, "Nimish" but probably "idiomatic Nim code" |
13:10:14 | xace | how are you suppose to use the random module in nim? i cant seem to initRand(randomize) |
13:10:21 | shashlick | Araq: c2nim does not reorder enums - I have had to manually do that |
13:10:51 | anamok | xace: just call randomize() ? |
13:11:08 | shashlick | But if we can come up with a generic pattern for enums, should be usable |
13:11:27 | Araq | shashlick, strange I remember merging a PR that implemented enum reordering |
13:12:06 | shashlick | Just that I would have to use it for every enum I see - regardless of whether it needs reordering or not |
13:12:14 | xace | yeah that works |
13:12:46 | shashlick | Well unless c2nim parses include files as well, it isn't fool proof |
13:13:31 | shashlick | Cause an enum could | or & values from include files |
13:14:01 | shashlick | And you have no idea what an expression resolves to unless you fully evaluate it |
13:15:51 | shashlick | I 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:19 | Araq | well adding a sort() to the compiler ain't gonna kill us |
13:16:37 | Araq | the bigger problem that I see is that it helps very little, C enums are not Nim enums |
13:19:15 | shashlick | Can you comment on my question to leorize? I feel his example is reserved - https://ptpb.pw/SFks/nim |
13:19:34 | Araq | so... it's one of these days. Araq tries non-Nim software on his PC. |
13:20:44 | Araq | gem install travis -v 1.8.9 --no-rdoc --no-ri |
13:20:44 | Araq | ERROR: Could not find a valid gem 'travis' (= 1.8.9), here is why: |
13:20:44 | Araq | 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:23 | anamok | bye |
13:21:30 | * | anamok quit (Remote host closed the connection) |
13:26:47 | Araq | travis lint .travis.yml |
13:27:03 | Araq | I get 3 warnings, all irrelevant |
13:27:21 | Araq | " illegal value windows, defaulting to linux" nope, travis now supports Windows |
13:27:58 | Araq | also, 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:39 | Calinou | travis lint isn't too up-to-date on stuff |
13:29:34 | Araq | well I guess the bash code in my YAML is wrong... :P |
13:32:19 | Araq | shashlick, what's there to comment on? |
13:32:43 | Araq | I don't like it because you can achieve the same with |
13:32:59 | Araq | const seValue1 = SomeEnumImpl(0) |
13:33:30 | Araq | and that's less confusing because you don't use 2 different types for the same entity |
13:34:50 | Araq | "If you want to try out your changes locally: bundle install" |
13:35:05 | Araq | --> I don't have "bundle" |
13:39:32 | shashlick | Araq: but how do you pass an enum to a C proc which is wrapped - will Nim accept a distinct int? |
13:39:53 | shashlick | The C proc will expect a SomeEnum type |
13:40:09 | Araq | depends on how you wrapped the C proc |
13:40:23 | Araq | don't use .header and you'll live a happy life |
13:42:18 | Araq | thinking 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:33 | shashlick | Ok I'll experiment with it |
13:44:13 | shashlick | Was using soloud as a test for nimterop and it has one such enum front and center |
13:45:24 | Araq | actually, C doesn't have enums, it only has an alternative spelling for #define constants |
13:46:04 | shashlick | I 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:30 | shashlick | Does this enum to distinct int work in c++ too? |
13:47:19 | Araq | kind of, type E {.importcpp: "E", header: "foo.h".} = distinct int |
13:54:34 | FromGitter | <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:14 | FromGitter | <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:44 | narimiran | what's the problem with strip? |
15:24:22 | FromGitter | <tim-st> the probem is the param names leading and trailing |
15:26:00 | FromGitter | <tim-st> lstrip and rstrip would be much easier, maybe native speakers dont have a problem with it |
15:26:18 | narimiran | oh, there is no lstrip and rstrip! |
15:26:52 | narimiran | so we need a wrapper around strip? |
15:27:24 | FromGitter | <tim-st> yes, it's also there for split -> rsplit and lsplit |
15:28:02 | narimiran | will you make a PR? |
15:28:39 | FromGitter | <tim-st> would the procs be allowed? |
15:30:12 | FromGitter | <tim-st> or should it be templates? maybe then the binary size doesnt increase |
15:32:23 | narimiran | i 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:37 | narimiran | (although i already can guess some reactions :)) |
15:34:42 | FromGitter | <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:53 | FromGitter | <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:02 | narimiran | removePrefix 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:33 | FromGitter | <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:06 | FromGitter | <tim-st> e.g. `echo "abccb".rstrip({'b', 'c'})` can not be the in place version because echo needs a type |
15:53:47 | FromGitter | <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:48 | narimiran | i'm not sure i like "it can be inplace or not, it depends on the surroundings" |
15:54:24 | FromGitter | <tim-st> do you have an example where this wouldnt work or wouldnt be clear for the dev / compiler? |
15:56:49 | narimiran | i do not from the top of my head |
15:57:05 | leorize | don't we use the past form of a verb for operation that's return a result? |
15:57:24 | narimiran | i never know which is which ;) |
15:58:16 | FromGitter | <tim-st> leorize: yes, for `sorted` but this doesnt work anymore because it would be `stripped` then and not `strip` |
15:58:17 | leorize | it's written in the API naming guide I believe |
15:58:38 | leorize | why does it have to be `strip`? |
15:59:09 | FromGitter | <tim-st> it doesnt have to be, but would be a breaking change |
15:59:20 | narimiran | leorize: familiarity and the least amount of surprise? |
15:59:23 | leorize | ah |
15:59:39 | FromGitter | <tim-st> my suggestion wouldnt break anything |
16:36:50 | * | Trustable joined #nim |
17:10:55 | FromGitter | <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:54 | dom96 | Hello guys. What's new in Nim land? |
17:13:32 | narimiran | dom96: 0.19.2 is almost out :) |
17:14:24 | dom96 | Oh. Guess it might be helpful if I generate the release notes |
17:14:41 | * | zachcarter quit (Ping timeout: 268 seconds) |
17:14:44 | dom96 | Is there a branch with the backported fixes? |
17:15:07 | narimiran | https://github.com/nim-lang/nim/tree/version-0-19 |
17:19:56 | dom96 | Cool. I'll generate the release notes. |
17:20:05 | dom96 | I suppose I should show you how to do that :D |
17:39:57 | serialdev[m] | I added nim repl support to emacs dom96 |
17:40:15 | serialdev[m] | in case more vim ppl might find it useful |
17:40:25 | serialdev[m] | *nim |
17:46:56 | dom96 | Awesome |
17:49:40 | FromGitter | <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:01 | dom96 | narimiran: So here is the release notes generator: https://github.com/dom96/relnotesgen/blob/master/relnotesgen.nim |
17:51:07 | dom96 | It's a script through-and-through, in that it expects you to modify the source code :) |
17:51:31 | dom96 | You first need a GitHub access token, which you pass on the command line |
17:51:46 | dom96 | Then you edit line 95: getCommitList("...") with the version you want |
17:51:57 | dom96 | (PRs for improvements always welcome) |
17:52:27 | narimiran | ok, i'll check it out |
18:02:10 | FromGitter | <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:33 | FromGitter | <tim-st> ok, hm |
18:06:41 | FromGitter | <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:53 | FromGitter | <tim-st> (well only under the assumptions that these do the same :\ ) |
18:54:43 | * | Perkol joined #nim |
18:56:20 | Perkol | In this https://github.com/nitely/nim-regex package, how do I create compiled regex from already declared text var? |
18:56:46 | Perkol | string var |
18:57:04 | narimiran | Perkol: compiled from runtime var? |
18:57:29 | Perkol | Yes |
18:57:47 | Perkol | Dynamically |
18:57:53 | narimiran | time-machine? :D |
18:58:13 | Perkol | Like i want to see if string mathes a set of patterns |
18:58:40 | Perkol | And if it matches some pattern do something |
18:59:38 | narimiran | oh wait, you have various regex patterns, and now you want to see if your string matches some of them? |
19:00:06 | dom96 | narimiran: Does this look okay? https://gist.github.com/dom96/277dc1ad5b04ef0eaa26637f5b857314 |
19:00:07 | Perkol | Figured it out |
19:00:12 | dom96 | I didn't expect this many for 0.19.2 |
19:01:15 | narimiran | dom96: well 0.19.2 is long overdue ;) line 4 and 5 are duplicated |
19:02:02 | dom96 | It's just the raw output from the script, to give you an idea of what it gives |
19:02:37 | narimiran | ok, then: it looks okay :) |
19:04:10 | narimiran | btw, that's only 1/3 of all changes made since 0.19.0. october (hactober) was very productive! |
19:04:59 | dom96 | I thought 0.19.2 is hand-picked commits |
19:05:05 | dom96 | What was the cut-off? |
19:07:08 | xace | does nim doc have the ability to include the module itself as a code-block in the generated documentation? |
19:07:50 | xace | (this isnt important, im just wondering) |
19:08:09 | narimiran | dom96: yes, handpicked commits that fix some bugs without introducing new features and/or breaking changes |
19:09:09 | dom96 | narimiran: that seems like a lot of hand picking :) |
19:09:30 | narimiran | believe me, it was |
19:10:02 | narimiran | but now we have `[backport]` tag so it is slightly less painful experience :D |
19:10:27 | * | zachcarter joined #nim |
19:10:28 | Perkol | Is there way to convert cstring to usual string? |
19:10:36 | dom96 | $ |
19:10:55 | Perkol | $some_string |
19:10:57 | Perkol | ? |
19:11:00 | dom96 | yep |
19:11:18 | Perkol | Thanks |
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:15 | FromGitter | <tim-st> quite a few useful procs in strutils got deprecated starting at version 0.20 :\ |
20:26:14 | FromGitter | <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:45 | FromGitter | <tim-st> well, the compiler doesnt supports this kind of overloading... |
20:34:48 | * | narimiran quit (Ping timeout: 250 seconds) |
20:43:41 | dom96 | PMunch: if you're around (and see this), I'm curious where you're giving a lightning talk at FOSDEM |
20:43:52 | dom96 | Is 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:33 | xace | does 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:21 | dom96 | Yes, 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:21 | FromGitter | <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:32 | xace | oki fair enough, |
22:29:12 | * | Snircle joined #nim |
22:32:19 | FromGitter | <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:39 | FromGitter | <arnetheduck> and so will the optimizer, when it gets smarter :) |
22:33:38 | xace | Oki, 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:57 | FromGitter | <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) |