00:00:36 | * | francisl quit (Quit: francisl) |
00:01:01 | * | francisl joined #nim |
00:01:23 | * | francisl quit (Client Quit) |
00:03:41 | * | Pisuke quit (Ping timeout: 240 seconds) |
00:07:12 | * | Matthias247 quit (Read error: Connection reset by peer) |
00:11:49 | * | Serenit0r joined #nim |
00:14:01 | * | Serenitor quit (Ping timeout: 240 seconds) |
00:32:27 | * | Serenitor joined #nim |
00:33:41 | * | Serenit0r quit (Ping timeout: 240 seconds) |
00:35:38 | * | vlad1777d quit (Remote host closed the connection) |
00:52:15 | * | Jesin quit (Ping timeout: 248 seconds) |
01:03:35 | def-pri-pub | Any good way to make the C compilation step of Nim run faster? I tried `tcc` and there wasn't much of a meaningful speed boost |
01:14:21 | * | Jesin joined #nim |
01:20:41 | * | def-pri-pub quit (Ping timeout: 240 seconds) |
01:41:55 | * | chemist69 quit (Ping timeout: 255 seconds) |
01:55:47 | * | chemist69 joined #nim |
02:14:07 | * | def-pri-pub joined #nim |
02:14:07 | * | def-pri-pub quit (Changing host) |
02:14:07 | * | def-pri-pub joined #nim |
02:33:20 | Tanger | Hey guys, does anybody know of a working example using websockets and nim >= 0.17.0 |
02:37:47 | def-pri-pub | try this: https://github.com/niv/websocket.nim ? |
02:43:45 | * | Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif) |
02:46:32 | * | yglukhov joined #nim |
02:51:12 | * | yglukhov quit (Ping timeout: 260 seconds) |
03:11:10 | * | endragor joined #nim |
03:22:16 | * | Kingsquee joined #nim |
03:25:50 | * | Serenit0r joined #nim |
03:29:37 | * | Serenitor quit (Ping timeout: 248 seconds) |
03:37:38 | * | Pisuke joined #nim |
03:38:35 | * | dddddd quit (Remote host closed the connection) |
03:47:58 | * | yglukhov joined #nim |
03:52:31 | * | yglukhov quit (Ping timeout: 248 seconds) |
04:04:34 | * | def-pri-pub quit (Quit: leaving) |
04:05:17 | * | Kingsquee quit (Read error: Connection reset by peer) |
04:05:39 | * | Kingsquee joined #nim |
04:13:28 | * | haha_ joined #nim |
04:14:17 | FromGitter | <Varriount> def-pri-pub: Turn off all optimization? |
04:15:05 | * | haha_ quit (Client Quit) |
04:18:35 | * | relax joined #nim |
04:25:57 | * | BigEpsilon joined #nim |
04:47:58 | Tanger | def-, Sweet, cheers man. |
04:59:36 | * | relax quit (Ping timeout: 240 seconds) |
05:00:29 | * | miran joined #nim |
05:14:27 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
05:23:55 | * | Vladar joined #nim |
05:30:39 | * | miran quit (Ping timeout: 248 seconds) |
05:38:09 | * | BigEpsilon quit (Ping timeout: 248 seconds) |
05:44:12 | * | miran joined #nim |
05:44:27 | * | cspar_ quit (Ping timeout: 260 seconds) |
05:50:05 | * | cspar_ joined #nim |
05:50:21 | * | miran quit (Ping timeout: 240 seconds) |
06:05:33 | * | BigEpsilon joined #nim |
06:08:08 | * | Serenit0r quit (Quit: Leaving) |
06:10:48 | * | nsf joined #nim |
06:44:01 | * | filcuc joined #nim |
06:50:43 | * | yglukhov joined #nim |
06:54:55 | * | yglukhov quit (Ping timeout: 248 seconds) |
06:56:58 | * | yglukhov joined #nim |
06:57:45 | * | yglukhov quit (Remote host closed the connection) |
06:58:13 | * | yglukhov joined #nim |
07:04:10 | * | PMunch joined #nim |
07:04:17 | * | gokr joined #nim |
07:09:10 | * | yglukhov quit (Remote host closed the connection) |
07:33:37 | * | claudiuinberlin joined #nim |
07:33:43 | * | yglukhov joined #nim |
07:38:07 | * | yglukhov quit (Ping timeout: 248 seconds) |
07:40:37 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
07:42:07 | * | vlad1777d joined #nim |
07:47:03 | * | claudiuinberlin joined #nim |
07:51:46 | * | claudiuinberlin quit (Client Quit) |
07:55:41 | FromGitter | <Bennyelg> Hey, I want to modify key with new value (table type) how do I do that? |
07:55:48 | FromGitter | <Bennyelg> args.mgetOrPut(args, "sql", "tmpTable") not work |
07:56:57 | * | nattefrost joined #nim |
07:57:35 | Araq | args["sql"] = "tmpTable" |
07:57:47 | FromGitter | <Bennyelg> not working . |
07:58:01 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5908ee5c9a4c5f3474b2] |
07:58:47 | FromGitter | <Bennyelg> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5937ee5c9a4c5f347551] |
08:00:01 | FromGitter | <superfunc_twitter> I think the table is immutable |
08:00:11 | FromGitter | <Bennyelg> seems like |
08:00:16 | FromGitter | <Bennyelg> but this is very strange lol |
08:00:21 | FromGitter | <superfunc_twitter> You'd need `var Table[string, string]` |
08:00:26 | FromGitter | <superfunc_twitter> in the type signature |
08:00:59 | FromGitter | <Bennyelg> I pass Table from another scope |
08:01:06 | FromGitter | <Bennyelg> I just want to add/ modify/delete keys from it |
08:01:15 | FromGitter | <Bennyelg> I need to ref to another object? |
08:02:36 | * | cspar_ quit (Ping timeout: 252 seconds) |
08:03:23 | FromGitter | <superfunc_twitter> if the table being passed in is a var, then you just need to change the type sig |
08:05:07 | * | claudiuinberlin joined #nim |
08:05:20 | FromGitter | <Bennyelg> how can I pass it as a var just x(var x: Table[..]) ? |
08:05:31 | FromGitter | <Bennyelg> how to cast Some() value to string |
08:06:12 | FromGitter | <Bennyelg> I tried with the format() but it did not help |
08:06:33 | FromGitter | <FridgeSeal> @zacharycarter I (finally) finished my Nim re-write of my Python lambda function and got everything working! I couldn't get the dll/so approach working via Python's CTypes (kept crashing with an uncatchable `out of memory` error, but I got the integration working using the PyMod library (https://github.com/jboy/nim-pymod) |
08:06:42 | FromGitter | <superfunc_twitter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59ae5b12ba0f0f6e381a7041] |
08:06:59 | FromGitter | <Bennyelg> thanks |
08:07:12 | FromGitter | <superfunc_twitter> sorry I apparently dont know how to format lmao |
08:15:04 | * | couven92 joined #nim |
08:15:22 | FromGitter | <Bennyelg> Did I found A bug? ⏎ I try to replace "some string is now big" using Some("some string") ⏎ "some string is now big".replace(Some("some string") , "") ⏎ noting happend [https://gitter.im/nim-lang/Nim?at=59ae5d1a210ac26920f78c19] |
08:16:40 | * | cspar_ joined #nim |
08:17:30 | * | Matthias247 joined #nim |
08:17:49 | FromGitter | <superfunc_twitter> strutils replace returns a new string, doesn't modify the original |
08:19:32 | FromGitter | <Bennyelg> I tried that already not change but let me try again |
08:20:15 | FromGitter | <Bennyelg> Not working. |
08:21:11 | FromGitter | <Bennyelg> To be clear, this ⏎ ⏎ ``` var x = "Hello world" ⏎ var x2 = x.replace("world", "") ⏎ echo(x2)``` [https://gitter.im/nim-lang/Nim?at=59ae5e77b16f2646420881f6] |
08:21:13 | FromGitter | <Bennyelg> is working |
08:21:31 | FromGitter | <superfunc_twitter> can you paste the snippet that isnt? |
08:21:36 | FromGitter | <Bennyelg> but If you get `Some` type value after nre it, try to replace it and it wont work |
08:23:21 | FromGitter | <Bennyelg> contains also return false |
08:23:22 | FromGitter | <Bennyelg> lol |
08:23:24 | FromGitter | <Bennyelg> this is funny |
08:23:50 | FromGitter | <superfunc_twitter> without the failing snippet I'm just shooting in the dark |
08:24:16 | FromGitter | <Bennyelg> you don't need snippet try to simulate simple 3 lines |
08:24:37 | FromGitter | <superfunc_twitter> lol ok good luck |
08:24:54 | FromGitter | <Bennyelg> thanks :-) |
08:26:15 | * | yglukhov joined #nim |
08:30:53 | * | yglukhov quit (Ping timeout: 255 seconds) |
08:31:25 | * | yglukhov joined #nim |
08:33:26 | * | yglukhov quit (Remote host closed the connection) |
08:33:38 | * | yglukhov joined #nim |
08:38:58 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
08:44:37 | * | vlad1777d quit (Quit: Leaving) |
08:52:07 | crem | Is ftsf someone on this channel? |
08:52:18 | crem | Morning! |
08:54:01 | crem | aka Jez Impbox |
08:54:56 | * | claudiuinberlin joined #nim |
09:01:36 | * | mahmudov quit (Remote host closed the connection) |
09:01:55 | * | thomasross_ joined #nim |
09:04:06 | * | thomasross quit (Ping timeout: 240 seconds) |
09:09:53 | * | dom96|w joined #nim |
09:11:41 | crem | Wenn ich beider initObj und newObj brauche, was ist die typiche Weise das zu machen? Gibt es eine Weise die Codeduplication zu vermeiden ohne die dritte Function? (z.B. init(self: var Obj), die ist aus beider newObj und initObj geruft wird) |
09:17:37 | FromGitter | <mratsim> newObj for ref object, initObj for stack object |
09:19:08 | crem | I know that. What if I need both? Sometimes I use object on stack, sometimes on heap. Is there a way to e.g. call initObj from newObj to avoid code duplication? |
09:21:05 | * | Arrrr joined #nim |
09:21:37 | crem | Anyway, probably that's not needed often. |
09:41:58 | * | BitPuffin|osx joined #nim |
09:42:50 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:53:00 | * | endragor quit (Remote host closed the connection) |
09:53:18 | flyx | crem: instead of a third proc, you can use a template |
09:55:03 | * | endragor joined #nim |
09:59:29 | * | endragor quit (Ping timeout: 248 seconds) |
10:12:13 | * | endragor joined #nim |
10:12:14 | * | endragor quit (Remote host closed the connection) |
10:15:42 | * | Arrrr quit (Ping timeout: 260 seconds) |
10:22:17 | * | endragor joined #nim |
10:22:51 | * | haha_ joined #nim |
10:24:47 | * | endragor quit (Remote host closed the connection) |
10:26:17 | * | ShalokShalom_ joined #nim |
10:29:05 | * | ShalokShalom quit (Ping timeout: 240 seconds) |
10:30:52 | * | ShalokShalom_ is now known as ShalokShalom |
10:51:47 | * | endragor joined #nim |
10:52:04 | * | dddddd joined #nim |
10:54:34 | FromGitter | <Bennyelg> does nim have pretty print for tables? |
10:56:01 | * | gokr quit (Ping timeout: 240 seconds) |
10:58:25 | FromGitter | <Grabli66> Why it's not working? https://play.nim-lang.org/?gist=a35a8a0c0148cbdd24b478d5b56a4b39 |
11:02:56 | flyx | Grabli66: you need to make dosome() a template in order to capture the actual type of this |
11:03:47 | flyx | or at least that's what I expect |
11:05:12 | FromGitter | <Grabli66> I tried like this: template dosome(this : untyped) : untyped = echo this.type.name |
11:05:16 | FromGitter | <Grabli66> Also not works |
11:08:19 | FromGitter | <ChristianWitts> `echo this.name` works |
11:09:19 | flyx | Grabli66: echo name(this.type) |
11:09:30 | flyx | that works with the proc version |
11:10:16 | FromGitter | <Grabli66> Great. It works |
11:10:41 | flyx | but don't ask me why this.type.name does not |
11:11:00 | FromGitter | <Grabli66> Why it does not? :) |
11:11:06 | flyx | it confuses the compiler |
11:11:12 | flyx | I guess |
11:14:22 | * | Yardanico joined #nim |
11:14:29 | FromGitter | <k0pernicus> Is there any update about interfaces in Nim? I saw interesting blog posts in order to implement them as "user-space features", but is it planned to implement interfaces as a “language feature” level? :-) |
11:19:46 | FromGitter | <Bennyelg> no new line echo? |
11:19:49 | FromGitter | <Bennyelg> how |
11:21:13 | FromGitter | <k0pernicus> Benny: ? |
11:21:21 | FromGitter | <Bennyelg> > |
11:21:22 | FromGitter | <Bennyelg> ? |
11:22:10 | FromGitter | <k0pernicus> I don’t understand your question… You want to print something without new line ending? |
11:22:18 | Araq | stdout.write |
11:22:20 | FromGitter | <Bennyelg> yea |
11:23:30 | FromGitter | <Bennyelg> thanks. |
11:24:27 | * | haha_ quit (Quit: haha_) |
11:24:43 | Araq | hmm after the VS code update indentation is super fucked up, yay |
11:26:16 | couven92 | Araq, oh so it's like that with you too? I was wondering whether I had just fucked my settings... :O |
11:26:26 | crem | Reading others' nim code, it's a bit hard to find meaning of idenfieir defined in different module. It's just not clear where to search. (And I don't have an idea how that could be fixed. Probably using IDEs is good enough, but if it's just a code on github, then it's not simple.) |
11:26:43 | * | crem is afraid to sound criticizing again. |
11:29:02 | Araq | I heard that a lot and it never made too much sense. |
11:29:27 | Araq | var x: MyObject; x.foo # where does 'foo' come from? |
11:30:05 | Araq | answer: chances are high from where MyObject comes from. |
11:30:26 | Araq | that's the same for every other widespread language out there, Python, Ruby, C#... |
11:32:19 | crem | But where MyObject comes from? |
11:32:37 | Araq | MyObject.nim or myobjects.nim |
11:32:44 | Yardanico | crem, "go to definition" ? :) |
11:32:48 | Araq | the jury is still out, most prefer MyObject.nim |
11:32:55 | FromGitter | <Bennyelg> how I can multiple string ? for example echo("=" * 10) |
11:32:56 | crem | There's no "go to definition" on github. |
11:33:01 | PMunch | Hard to do on GitHub Yardanico |
11:33:07 | Yardanico | Bennyelg: strutils.repeat |
11:33:15 | Yardanico | so like |
11:33:16 | FromGitter | <Bennyelg> Thanks |
11:33:20 | Yardanico | echo("=".repeat(10)) |
11:33:35 | Araq | maybe github is a primitive environment for code navigation. big surprise |
11:34:30 | FromGitter | <Bennyelg> Thanks. |
11:35:51 | PMunch | Haha, that's true Araq |
11:36:07 | PMunch | And I guess the problem here is more to do with people stylistic choices than anything else |
11:36:13 | Yardanico | Araq, crem, "go to definition" ? :) |
11:36:16 | FromGitter | <Grabli66> Maybe make a special command for compiler to list all procs with module name for some type? Example: nim proclist main.nim MyObject |
11:36:16 | Yardanico | oh sorry |
11:36:17 | Yardanico | wrong paste |
11:36:21 | Yardanico | Araq, https://github.com/Microsoft/vscode/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aopen%20indentation |
11:36:22 | * | dom96|w quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
11:36:36 | Yardanico | 128 open, 383 closed |
11:36:38 | PMunch | If people chose LongVerboseNamesThatReallyLayItOutForYou then it would be easy to see where that came from |
11:37:07 | PMunch | Grabli66 can't nimsuggest do that already? |
11:37:15 | Yardanico | it can |
11:37:23 | Yardanico | but not as a separate cmd afaik |
11:37:50 | FromGitter | <Grabli66> It can? Cool. I did not know |
11:38:08 | Yardanico | it definitely can |
11:38:13 | Yardanico | because nimsuggest uses compiler :) |
11:38:21 | FromGitter | <Grabli66> Great |
11:38:49 | FromGitter | <Grabli66> Then, there is no problem at all :) |
11:39:25 | * | Arrrr joined #nim |
11:40:53 | FromGitter | <Grabli66> Hhhm. Nimsuggest is a tool for IDE? I can't use this from console? |
11:41:56 | Yardanico | you definitely can |
11:42:05 | Yardanico | but yes, it's mostly for IDEs and text editors |
11:43:04 | Yardanico | e.g. you can use it in vim/emacs/vscode/sublime (with nim plugins) |
11:43:08 | Yardanico | also in notepad++ |
11:43:19 | FromGitter | <Grabli66> Ok. Tell me how i can get all procs for some type with nimsuggest. I don't see any command for that in nimsuggest |
11:43:36 | Yardanico | nimsuggest operates on files |
11:44:42 | Yardanico | https://nim-lang.org/docs/nimsuggest.html |
11:47:25 | Araq | grabli66: that's 'nim doc2 foo.nim' and then "group by type" |
11:50:58 | Yardanico | Araq, are nim docs regenerated after new release? |
11:51:01 | couven92 | Araq, BTW, editDistance for Unicode is not as simple as you suggested, you cannot easily get the upper or lower triangles (whatever those are) because there is no easily calcultable half of the string |
11:51:51 | FromGitter | <Grabli66> Great. I created documentation. But it's not what i want. In my source code, i use a "Request" object. And i want a list of all procedures, with module names that can be used with that object. |
11:53:42 | PMunch | couven92, wouldn't you just handle them separately as glyphs? |
11:53:51 | PMunch | Or runes rather |
11:54:06 | Yardanico | PMunch, well |
11:54:10 | Yardanico | this is slower |
11:54:23 | couven92 | PMunch, I would, but Araq won't let be convert the string to runes, since it creates (very much) memory allocation overhead |
11:54:38 | Yardanico | I've implemented it with two runes sequences (the most inefficient way), and it was 20x slower than ascii version |
11:55:58 | PMunch | Aah |
11:56:22 | Yardanico | well it still can be done faster |
11:56:25 | Yardanico | because I choose the easy way |
11:56:40 | Yardanico | (store two seqs of each string runes) |
11:56:56 | FromGitter | <Bennyelg> way i cant do this: typeMapping.keys.join(",") |
11:57:08 | Araq | Grabli66: so ... and how do you think this can work? nimsuggest compiles any .nim file out there for you to answer that question? |
11:57:23 | Araq | toSeq(typeMapping.keys).join"," |
11:57:27 | Yardanico | yeah |
11:57:33 | Yardanico | there's a feature request on github btw |
11:57:38 | Yardanico | for this exact proc |
11:57:55 | Yardanico | https://github.com/nim-lang/Nim/issues/943 |
11:58:17 | Yardanico | well it would be easy to add "keys" proc which will return a seq |
11:58:25 | Yardanico | but I don't know if it would be a good addition to stdlib |
11:58:25 | FromGitter | <Bennyelg> @Araq it's not working |
11:58:29 | Yardanico | import sequtils |
11:58:38 | FromGitter | <Bennyelg> undecleard field 'keys' |
11:58:40 | Yardanico | ah |
11:58:44 | Yardanico | wait |
11:58:50 | Yardanico | what is your "typeMapping" ? |
11:59:09 | FromGitter | <Grabli66> <Araq>, i think that nimsuggest can get all imported files for module, and get all procedures for type :) |
11:59:12 | Yardanico | if you want to have something like a dictionary |
11:59:16 | Yardanico | you should use tables |
11:59:17 | * | Kingsquee quit (Remote host closed the connection) |
11:59:32 | Yardanico | {a: b, c: d} is just a syntax sugar for openarray[(value, value)] |
11:59:37 | Yardanico | https://nim-lang.org/docs/tables.html |
11:59:49 | FromGitter | <Bennyelg> typeMapping is a OrederdDict |
11:59:54 | Yardanico | ah |
12:00:00 | Yardanico | ordered dict? |
12:00:00 | Yardanico | what |
12:00:18 | Yardanico | maybe ordered table? |
12:00:23 | Araq | but then you already know the modules because you imported them, but yeah, nimsuggest can do that use an editor with nimsuggest support |
12:01:20 | Yardanico | Araq, what is the easiest way to make a link which will point to some proc/type in nim-generated docs? |
12:01:21 | FromGitter | <k0pernicus> Can we compute, at compile time, a regular expression? |
12:01:42 | Yardanico | no, because it requires C ffi |
12:01:52 | Yardanico | and pegs doesn't work at compile-time AFAIK |
12:01:53 | FromGitter | <Bennyelg> yea it's ordered table |
12:01:54 | Yardanico | maybe it was fixed |
12:02:00 | FromGitter | <Bennyelg> but now How I get only the keys |
12:02:02 | Araq | it wasn't |
12:02:11 | FromGitter | <k0pernicus> Aaah ok - I understand now the message `cannot 'importc' variable at compile time` |
12:02:12 | Araq | toSeq(foo.keys) |
12:02:28 | Yardanico | import sequtils |
12:02:30 | Yardanico | import strutils |
12:02:30 | Yardanico | toSeq(foo.keys).join(",") |
12:02:36 | Arrrr | you can make a program and call it in compile time |
12:02:38 | Yardanico | if you have "foo" declared |
12:02:43 | FromGitter | <Bennyelg> as I said "Undecleared keys" |
12:02:51 | Yardanico | show full source code please? |
12:03:00 | FromGitter | <Grabli66> <Araq>, i use VS code. But i think it can't show me that information, or i don't know how to show it. |
12:03:06 | Yardanico | it can |
12:03:09 | Yardanico | with nim plugin |
12:03:18 | FromGitter | <Grabli66> I use nim plugin |
12:03:26 | FromGitter | <Bennyelg> function parseTypes(): OrderedTable[string, string] = |
12:03:27 | Araq | Glabli66: you need to configure it |
12:03:37 | FromGitter | <Bennyelg> var x = parseTypes() |
12:03:53 | FromGitter | <Bennyelg> toSeq(x.keys).join(",") not working |
12:04:07 | FromGitter | <Grabli66> <Araq>, Is there a documentation how? |
12:04:32 | FromGitter | <Grabli66> Ok. I'll try to find |
12:04:39 | Yardanico | Bennyelg: can you show full source code please |
12:04:43 | Yardanico | e.g. which can compile separately |
12:06:00 | Yardanico | Araq, also, if I really know the size of seq, should I divide this size by 1.5? because as you said there's 1.5x of size you've specified |
12:06:11 | Yardanico | ah, no |
12:06:13 | Yardanico | it's for "add" |
12:07:41 | Araq | yeah |
12:10:55 | Yardanico | you wouldn't believe this: in comments for two-year old article about Nim someone has left feedback like "nim is python in the javascript programmer's ass". So he thinks that Nim "stole" let/const from JS :D |
12:12:17 | crem | There's no let/const in javascript (at least as of ES5), there are ones in typescript though. |
12:12:28 | Yardanico | crem, there is in ES2015 |
12:12:50 | Yardanico | crem, as you speak russian - https://vk.com/groups?w=wall-54530371_156163 |
12:13:07 | Yardanico | it's a copy-paste of two-year old article about nim |
12:13:22 | Yardanico | which was written by the guys from ZEO alliance |
12:13:48 | * | endragor quit (Remote host closed the connection) |
12:14:16 | * | Snircle joined #nim |
12:14:23 | crem | probably taken from typescript then, which surely had let/const in 2010. That's weird that it's stated as being released in 2012 as I'm sure I read docs about it before 2011. |
12:15:38 | FromGitter | <Yardanico> Well anyway this guy said this without any arguments :) |
12:16:01 | FromGitter | <Yardanico> And Nim development started in 2004 (if wiki is correct) |
12:16:20 | * | arnetheduck joined #nim |
12:17:05 | crem | It's not at all important which language introduced particular feature (or keyword!) first. |
12:18:35 | * | Yardanico quit (Ping timeout: 240 seconds) |
12:19:10 | Araq | I took 'const' and 'var' from Pascal and 'let' from ML ... |
12:19:33 | Araq | Typescript/JS had no influence on Nim's design whatsoever |
12:20:09 | FromGitter | <Bennyelg> Any library which check if the import is unused? |
12:20:10 | crem | I like that declaring constant variable (which is safer) is not longer than declaring mutable one. |
12:21:12 | Araq | Bennyelg, use nimsuggest, remove imports until the code stops working or just leave it, nobody gives a fuck about unused imports |
12:21:20 | Araq | they don't cause any harm |
12:23:03 | * | claudiuinberlin joined #nim |
12:23:11 | * | endragor joined #nim |
12:26:17 | FromGitter | <Bennyelg> how do I use nimsuggest :D |
12:26:38 | * | endragor quit (Remote host closed the connection) |
12:27:21 | * | Yardanico joined #nim |
12:28:34 | Yardanico | I actually like the thing that you can easily go to nim stdlib with nimsuggest |
12:30:11 | * | rauss quit (Quit: WeeChat 1.9) |
12:32:10 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:32:25 | FromGitter | <Grabli66> Karax framework is abandoned? |
12:32:30 | Yardanico | it's definitely not |
12:32:36 | Yardanico | because Araq himself develops Karax |
12:32:47 | Yardanico | check branches: https://github.com/pragmagic/karax/branches |
12:32:52 | Yardanico | nextgen Updated 5 days ago by Araq |
12:33:19 | FromGitter | <Grabli66> Ok. Is it ready for production? |
12:33:51 | Yardanico | ask Araq, but I think he uses it, or someone from Xored |
12:34:30 | FromGitter | <Grabli66> Good. Need to try. |
12:35:50 | Yardanico | wait what |
12:35:57 | Yardanico | Hint: operation successful (19795 lines compiled; 0.121 sec total; 22.422MiB peakmem; Release Build) for compiling todoapp example from nim to JS |
12:36:02 | Yardanico | how it's so fast? |
12:36:09 | Yardanico | ah, JS doesn't requires compilation |
12:37:48 | FromGitter | <Bennyelg> nimble packages |
12:38:00 | FromGitter | <Bennyelg> where can I find a source site like pypi |
12:38:27 | FromGitter | <stisa> @Bennyelg https://nimble.directory ? |
12:38:29 | Yardanico | Well nimble stores all package entries on github |
12:38:32 | Yardanico | but yeah, use nimble.directory |
12:39:06 | Yardanico | wow! |
12:39:14 | Yardanico | I didn't knew nimble.directory has this: https://nimble.directory/ci/badges/pylib/nimdevel/output.html |
12:40:35 | * | Vladar quit (Remote host closed the connection) |
12:41:36 | * | haha_ joined #nim |
12:41:44 | Yardanico | maybe I should make a small feature request to automatically remove ANSI sequences :) |
12:41:47 | Yardanico | or colorize them :P |
12:44:41 | crem | Is nimble for nim the same as pip for python? What is koch? What is nake? |
12:45:00 | * | Vladar joined #nim |
12:45:05 | Yardanico | crem, nimble is a package manager |
12:45:11 | Yardanico | koch is a tool to build compiler and compiler tools |
12:45:16 | Yardanico | so compiler-related stuff |
12:45:31 | FromGitter | <k0pernicus> Crem > https://github.com/nim-lang/Nim :-) |
12:45:36 | Yardanico | nake is Makefile-like thing which allows you to write ANY nim code to describe your tasks |
12:45:42 | crem | koch is like bazel, ok. |
12:45:48 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
12:45:48 | FromGitter | <Bennyelg> I want to add new package |
12:45:56 | FromGitter | <Bennyelg> I just need to write some tests first |
12:46:03 | Yardanico | Bennyelg: you can use "nimble publish" or create PR manually |
12:46:20 | Yardanico | crem, also, about nake - nimble with .nims files seems better |
12:46:25 | FromGitter | <Bennyelg> nice, i create everything and it's pretty ready |
12:46:28 | Yardanico | well there are different opinions |
12:46:31 | FromGitter | <Bennyelg> I'll post you guys this message soon |
12:49:50 | * | rokups joined #nim |
12:51:53 | Yardanico | Bennyelg: don't forget that github is a public thing and we can still find your repo :) |
12:52:59 | FromGitter | <Bennyelg> My first Nim program |
12:53:01 | FromGitter | <Bennyelg> https://github.com/Bennyelg/csvql |
12:53:06 | * | Jesin quit (Ping timeout: 240 seconds) |
12:53:19 | Yardanico | well yeah I found it myself :P |
12:53:32 | FromGitter | <Bennyelg> pull requests/stars/ are very welcome |
12:53:37 | Yardanico | https://github.com/search?q=language%3ANim+created%3A2017-09-05 |
12:53:52 | FromGitter | <Bennyelg> and of course if its worth to push it no nimble |
12:54:33 | * | dom96|w joined #nim |
12:54:49 | FromGitter | <Bennyelg> to* |
12:57:15 | couven92 | do we have an echo with noSideEffects? |
12:57:26 | def- | couven92: debugEcho? |
12:57:34 | Yardanico | yeah |
12:57:47 | couven92 | def-, thanks! :) |
12:58:02 | Yardanico | guys, noSideEffect is used by compiler to remove unused code? |
12:58:49 | def- | Not that I know of, but it could be in the future |
12:59:08 | def- | I think it's mostly used to check that you don't accidentally call something with side effects inside |
12:59:15 | Yardanico | yeah I know about that |
12:59:39 | * | rauss joined #nim |
13:02:29 | FromGitter | <Grabli66> Nim programmer should avoid side effects? :) |
13:02:50 | Yardanico | no |
13:02:58 | Yardanico | it's just here if programmer wants to know it |
13:03:10 | couven92 | do we have do-while in Nim? |
13:03:18 | def- | couven92: you can make your own |
13:03:19 | Yardanico | no, but you can easily implement your do-while :P |
13:03:27 | couven92 | :) |
13:03:36 | Yardanico | it's pretty straightforward |
13:03:37 | def- | https://github.com/def-/nim-unsorted/blob/master/dowhile.nim |
13:03:57 | def- | (or use while true: ... if not a: break) |
13:05:28 | FromGitter | <Grabli66> Should nim developer avoid "try/catch", for better performance? |
13:05:51 | couven92 | def-, Yardanico, yeah I know... I was just wondering, it's so rarely used in C#, C, etc., that I did know whether I just hadn't seen any do-whiles or whether it just not exists :) |
13:07:57 | * | haha_ quit (Quit: haha_) |
13:14:59 | Yardanico | def-, looking at this - https://github.com/def-/nim-unsorted/blob/master/forest/funMagicForest.nim |
13:15:15 | Yardanico | maybe we should add new proc like filterIt, but which will allow you to write the name of variable you want to use |
13:15:22 | Yardanico | so like |
13:16:11 | Yardanico | or wiat |
13:16:13 | Yardanico | ah yes |
13:16:33 | * | relax joined #nim |
13:17:05 | Yardanico | def-, https://gist.github.com/Yardanico/186f11984d8c61ad4d275420f45f0635 |
13:17:30 | Yardanico | oh wait it works actually |
13:17:30 | crem | https://github.com/ftsf/ld39-minisyn/blob/master/nico/nico.nim how can I find where updateFunc defined is. :-\ |
13:17:44 | Yardanico | easy |
13:17:45 | Yardanico | https://github.com/ftsf/ld39-minisyn/search?utf8=%E2%9C%93&q=updateFunc&type= |
13:17:54 | Yardanico | https://github.com/ftsf/ld39-minisyn/blob/b7f695c1e18a37ec7b1fcc522f709ce252c98f37/nico/nico/backends/common.nim#L118 |
13:18:09 | Yardanico | but you probably want to search for setUpdateFunc |
13:18:22 | Yardanico | https://github.com/ftsf/ld39-minisyn/blob/b7f695c1e18a37ec7b1fcc522f709ce252c98f37/nico/nico.nim#L1423 |
13:19:14 | Yardanico | and also with nimsuggest this would be VERY easy |
13:19:34 | Yardanico | crem, and also this "nico" is just a copy of this https://github.com/ftsf/nico |
13:19:51 | def- | Yardanico: i don't like to use templates too much |
13:19:55 | Yardanico | so ftsf copied it to make distribution easier maybe |
13:20:22 | Yardanico | def-, well, with them you can reduce the need for manually write types everywhere :) |
13:21:29 | def- | Yardanico: use the non-functional version instead ;) |
13:21:45 | def- | easier to read, faster |
13:26:10 | * | relax quit (Ping timeout: 264 seconds) |
13:27:56 | * | relax joined #nim |
13:31:43 | * | Jesin joined #nim |
13:44:08 | * | miran joined #nim |
13:54:53 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:05:33 | FromGitter | <Bennyelg> Review & comments are welcome :D ⏎ https://github.com/Bennyelg/csvql ⏎ I can say officially after first programming with nim - nim is fun. |
14:06:54 | crem | lines 18 and 19 could be merged into one. |
14:11:57 | * | relax quit (Ping timeout: 260 seconds) |
14:13:22 | * | nattefrost quit (Remote host closed the connection) |
14:14:27 | Yardanico | Bennyelg: after you will add test I'll be able to change it :0 |
14:14:31 | Yardanico | without breaking something |
14:17:06 | Yardanico | because I'll try to e.g. replace nre with "pegs", remove many repetitions |
14:22:42 | Yardanico | I already see where can I improve it :) |
14:23:23 | * | relax joined #nim |
14:28:39 | * | PMunch quit (Quit: Leaving) |
14:31:13 | * | claudiuinberlin joined #nim |
14:31:37 | FromGitter | <k0pernicus> Imagine I have more than 10_000 JSON files than contain three different fields (for example, `first_name`, `last_name` and `characteristics`). ⏎ `first_name` is a string. ⏎ `last_name` is a string. ⏎ `characteristics` is a sequence of string. ⏎ I want, for each of those files, to construct a vector which contains if this file contains a value or not (so, a vector of boolean values). ... |
14:31:37 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=59aeb549614889d475c29e4f] |
14:32:08 | * | mahsav2 joined #nim |
14:32:10 | FromGitter | <k0pernicus> This code works, but the program takes about a minute to perform on less than 10_000 JSON files... |
14:32:18 | FromGitter | <Yardanico> did you compile it with -d:release ? |
14:32:29 | FromGitter | <k0pernicus> Do you have any idea how to speed up this program please? |
14:32:34 | FromGitter | <k0pernicus> HO! I FORGOT! |
14:32:37 | FromGitter | <k0pernicus> Thanks @Yardanico |
14:32:45 | FromGitter | <Yardanico> try with -d:release and give us results please :) |
14:32:52 | FromGitter | <Yardanico> I think IO would be a bottleneck here |
14:33:03 | FromGitter | <Yardanico> well it depends if your OS caches this files or nopt |
14:33:05 | * | mahsav quit (Ping timeout: 248 seconds) |
14:33:19 | FromGitter | <Yardanico> also |
14:33:29 | FromGitter | <k0pernicus> Ouch, I don’t know for the OS thing :-/ |
14:33:35 | * | relax quit (Ping timeout: 240 seconds) |
14:34:28 | FromGitter | <Yardanico> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aeb5f4614889d475c2a32e] |
14:34:38 | FromGitter | <Yardanico> You don't need to specify so many types by yourself |
14:34:59 | FromGitter | <k0pernicus> True, thanks :-) |
14:35:10 | FromGitter | <k0pernicus> So, without `release` flag: ⏎ real 1m6.705s ⏎ user 1m0.678s ⏎ sys 0m4.011s [https://gitter.im/nim-lang/Nim?at=59aeb61e66c1c7c4771995dc] |
14:35:36 | * | claudiuinberlin quit (Client Quit) |
14:36:29 | FromGitter | <k0pernicus> With `release` flag... |
14:36:47 | FromGitter | <k0pernicus> ```real 0m18.719s ⏎ user 0m13.797s ⏎ sys 0m3.811s``` [https://gitter.im/nim-lang/Nim?at=59aeb67f210ac26920f9570b] |
14:36:55 | FromGitter | <k0pernicus> JUST-WOW |
14:37:05 | FromGitter | <Yardanico> well I don't know if this is fast enough for you :) |
14:37:25 | FromGitter | <k0pernicus> If is takes more than 1 second, nop... |
14:37:29 | FromGitter | <k0pernicus> (joking :-p) |
14:37:40 | FromGitter | <k0pernicus> Yep, it’s good :-) |
14:37:46 | FromGitter | <k0pernicus> Thanks a lot @Yardanico :-) |
14:37:47 | Yardanico | also, why do you need "try" "except" in when isMainModule ? |
14:37:57 | Yardanico | you're not accessing any keys here |
14:38:05 | Yardanico | you should add try except in your get_json_nodes |
14:38:24 | Yardanico | because data will contain nim object |
14:38:29 | Yardanico | so KeyError can't happen here |
14:38:35 | FromGitter | <k0pernicus> It’s a mistake actually |
14:38:39 | * | claudiuinberlin joined #nim |
14:38:49 | FromGitter | <k0pernicus> I forgot to copy that line after the `try` statement: `let data = to(node.get(), FeaturesTemplate)` |
14:38:54 | Yardanico | ah |
14:38:55 | Yardanico | ok :) |
14:39:00 | FromGitter | <k0pernicus> Sorry for that :-) |
14:39:26 | FromGitter | <k0pernicus> Maybe I can avoid to “translate” my JSON datastructure into an object... |
14:39:58 | Yardanico | well yeah, your program will take a bit less RAM maybe |
14:40:00 | Yardanico | and will be a bit faster |
14:40:09 | FromGitter | <k0pernicus> So, instead of `let data = to(node.get(), FeaturesTemplate`, just grab the information I needed... |
14:40:22 | FromGitter | <k0pernicus> I will try a new version |
14:40:49 | Yardanico | also |
14:40:55 | * | claudiuinberlin quit (Client Quit) |
14:41:21 | Yardanico | you may also try to remove regex pattern of files :) well I don't really know if it will speed up or slow down your code |
14:41:44 | Yardanico | I mean to replace it with pegs/strscans if applicable |
14:41:46 | Yardanico | but regexs are fine too |
14:42:00 | FromGitter | <k0pernicus> Yep, maybe try an `.endsWith(“.json”)` thing |
14:42:18 | Yardanico | ah |
14:42:32 | Yardanico | I thought you really need that regex to check if filename starts with some word :) |
14:42:46 | FromGitter | <k0pernicus> Later yes |
14:43:05 | FromGitter | <k0pernicus> But I can experiment without in order to get some speed results |
14:43:08 | FromGitter | <k0pernicus> ;-) |
14:43:24 | FromGitter | <k0pernicus> `pegs/strscans` -> I will check that |
14:43:35 | FromGitter | <k0pernicus> I don’t know anything about those |
14:44:37 | Yardanico | well I don't say they're better :) |
14:45:36 | * | Arrrr quit (Quit: Leaving.) |
14:45:48 | * | relax joined #nim |
14:46:22 | * | cspar_ quit (Ping timeout: 260 seconds) |
14:46:35 | FromGitter | <k0pernicus> Do you know how to extract a sequence from a `JsonNode` type? |
14:46:47 | FromGitter | <k0pernicus> I see `getStr` to extract a string for example... |
14:48:40 | Yardanico | k0pernicus |
14:48:57 | Yardanico | https://nim-lang.org/docs/json.html#getElems,JsonNode,seq[JsonNode] |
14:49:05 | Yardanico | so you would get seq[JsonNode] |
14:49:25 | Yardanico | and if you iterate over it, you'll able to do "iterval.str" |
14:49:44 | FromGitter | <k0pernicus> Oh ok |
14:49:58 | FromGitter | <k0pernicus> So, a sequence is actually a seq of JsonNode (string) ? |
14:50:24 | Yardanico | well it's just a seq of JsonNode |
14:50:35 | FromGitter | <k0pernicus> Yeah, right |
14:50:40 | Yardanico | because Nim can't prove that some field in json will be a string or not |
14:51:18 | FromGitter | <k0pernicus> Ok, done :-) |
14:53:15 | FromGitter | <k0pernicus> Hmmm... |
14:53:29 | FromGitter | <k0pernicus> Actually, without “translation”, it’s worth |
14:53:54 | FromGitter | <k0pernicus> 3 seconds more for the non-released version, 1 second more the released version |
14:54:45 | Yardanico | well times can differ |
14:55:02 | Yardanico | "time" isn't reliable, but if it's slower for you - use "translation" :) |
14:55:11 | * | claudiuinberlin joined #nim |
14:55:16 | FromGitter | <k0pernicus> I will :-) |
15:00:57 | * | Jesin quit (Ping timeout: 260 seconds) |
15:01:50 | * | Jesin joined #nim |
15:06:38 | * | PMunch joined #nim |
15:08:45 | crem | Why is {.base.} needed? |
15:09:41 | Yardanico | crem, https://nim-lang.org/docs/manual.html#multi-methods |
15:11:00 | crem | Yes I've seen that. |
15:11:04 | crem | So what does it do? |
15:11:25 | crem | Other than "acts as a reminder for the programmer" |
15:11:57 | * | Trustable joined #nim |
15:13:36 | * | relax quit (Ping timeout: 240 seconds) |
15:13:56 | Yardanico | crem, well I don't actually use methods so I don't know :) |
15:14:03 | Yardanico | I don't need runtime dispatching |
15:16:17 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:20:23 | FromGitter | <k0pernicus> Is there a “Nim way” to get the index of a value, in my sequence? |
15:20:43 | Yardanico | index proc ? :) |
15:20:43 | FromGitter | <k0pernicus> I searched in sequtils, but I didn’t found anything about that... |
15:20:50 | Yardanico | it's in system module |
15:20:56 | Yardanico | so you don't need to import it |
15:21:01 | FromGitter | <k0pernicus> Oh ok |
15:21:05 | * | arnetheduck quit (Ping timeout: 240 seconds) |
15:21:15 | Yardanico | ah sorry |
15:21:18 | Yardanico | it's not "index" |
15:21:21 | Yardanico | it's "find" |
15:21:25 | FromGitter | <k0pernicus> ah ah ^^ |
15:21:27 | Yardanico | https://nim-lang.org/docs/system.html#find,T,S |
15:21:31 | FromGitter | <k0pernicus> Ok, no problem |
15:21:37 | Yardanico | Returns the first index of item in a or -1 if not found. |
15:21:43 | FromGitter | <k0pernicus> I searched Cmd+F with “index” so... |
15:21:48 | FromGitter | <k0pernicus> Great :-) |
15:21:50 | FromGitter | <k0pernicus> Thanks a lot! |
15:23:23 | dom96|w | k0pernicus: I guess getting choosenim to compile didn't work out? |
15:23:37 | FromGitter | <k0pernicus> It worked |
15:23:47 | FromGitter | <k0pernicus> I send you a PR yesterday I think |
15:23:48 | FromGitter | <k0pernicus> :-) |
15:24:54 | FromGitter | <k0pernicus> I was waiting for your comments/review to start working on new choosenim issues (if you are OK with that) |
15:27:06 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
15:32:19 | dom96|w | k0pernicus: oh cool, I didn't check for new PRs yesterday so I didn't realise you sent one :) |
15:33:02 | FromGitter | <k0pernicus> @dom96 No problem :-) Sorry for the delay |
15:43:10 | * | Matthias247 quit (Read error: Connection reset by peer) |
15:44:57 | * | ofelas joined #nim |
15:45:57 | FromGitter | <k0pernicus> I am trying to store a Table into a JSON file. ⏎ For that, each key in my Table DS is a key in my JSON file, and each associated value (a sequence of string) has to be an associated value in my JSON file. |
15:46:53 | FromGitter | <k0pernicus> For that, I have to create a new JsonNode (JArray) type, and to add in “manually” all my values from the Table DS, right? |
15:47:22 | Yardanico | k0pernicus: yeah there's no shortcut for that AFAIK |
15:47:43 | FromGitter | <k0pernicus> Ok, thanks :-) |
15:49:06 | FromGitter | <k0pernicus> And to convert a sequence of string into a JArray type - no easy way neither? |
15:50:14 | Yardanico | well let me try something |
15:53:19 | * | claudiuinberlin joined #nim |
15:53:26 | * | relax joined #nim |
15:55:12 | Yardanico | well yeah |
15:55:25 | Yardanico | you'll need to iterater over this sequence |
15:55:27 | Yardanico | but |
15:55:30 | Yardanico | there's another bad way |
15:55:44 | FromGitter | <k0pernicus> Ah ah ^^ |
15:56:25 | Yardanico | ok nvm |
15:56:32 | Yardanico | I'll give you an example of creating JSON |
15:57:00 | FromGitter | <k0pernicus> no problem - I will test the current version of my prototype actually |
15:57:11 | FromGitter | <k0pernicus> I will try later to make some experiments with Neo |
15:57:58 | Yardanico | well it's pretty easy |
15:58:04 | Yardanico | to construct json you want |
15:58:10 | Yardanico | https://gist.github.com/Yardanico/6b0791b1385e2ebf27deafba0210cfa5 |
15:58:25 | FromGitter | <k0pernicus> Oh! |
15:58:31 | FromGitter | <k0pernicus> The `%` is great |
15:58:55 | FromGitter | <k0pernicus> I didn’t had a look at this operator in the documentation... |
15:58:58 | FromGitter | <k0pernicus> My bad :-( |
15:59:24 | * | BigEpsilon joined #nim |
16:00:41 | FromGitter | <k0pernicus> Thanks @Yardanico for this snippet |
16:00:49 | Yardanico | does it work for you? |
16:00:59 | FromGitter | <k0pernicus> I will try in a couple of minutes |
16:01:02 | FromGitter | <k0pernicus> (debugging…) |
16:03:26 | PMunch | Hmm, anyone know if there is a wrapper of https://github.com/baylej/tmx, or any other Tiled parsers for Nim? |
16:04:45 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:04:52 | FromGitter | <k0pernicus> @Yardanico Got a problem... |
16:07:52 | FromGitter | <k0pernicus> This is the ugly code I wrote ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aecbd88f4427b462d5bb3a] |
16:07:58 | * | claudiuinberlin joined #nim |
16:09:34 | FromGitter | <Yardanico> what problem? |
16:10:18 | Yardanico | PMunch, maybe this can help? |
16:10:19 | Yardanico | https://github.com/PapaNoah/morriton/blob/dde7d5fdccee23558d7a90d77d41b704034b8d5b/src/map/parser.nim |
16:10:57 | FromGitter | <k0pernicus> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aecc91ba0f0f6e381ce8b9] |
16:11:05 | * | mahsav2 quit (Ping timeout: 240 seconds) |
16:11:13 | * | yglukhov quit (Remote host closed the connection) |
16:11:16 | FromGitter | <k0pernicus> This code reached this error `Error: ordinal type expected` |
16:11:24 | FromGitter | <k0pernicus> At line `vectors.add %{file, %current_indexes}` |
16:11:30 | FromGitter | <k0pernicus> (so, the last one) |
16:12:59 | PMunch | Hmm interesting Yardanico. But it seem like he made a simple parser for his own game only. |
16:13:06 | PMunch | So it's not really generic |
16:13:11 | Yardanico | PMunch, https://github.com/Tormund/rod_tilemap ? |
16:13:16 | Yardanico | well yeah it's for rod too |
16:13:32 | Yardanico | PMunch, |
16:13:34 | Yardanico | I found this - https://github.com/jsudlow/nimtmapreader |
16:13:51 | Yardanico | well it doesn't seem to support tmx |
16:14:37 | PMunch | Ah, Tiled can export to both xml and json |
16:14:44 | FromGitter | <k0pernicus> It’s ok, I saw the problem :-) |
16:14:48 | FromGitter | <Yardanico> @k0pernicus also |
16:14:50 | FromGitter | <Yardanico> for better performance |
16:14:54 | FromGitter | <k0pernicus> ‘,’ instead of ‘:' |
16:14:56 | FromGitter | <k0pernicus> Yep? |
16:15:01 | FromGitter | <Yardanico> Don't use var current_indexes: seq[int] = repeat(0, len_features_vector) |
16:15:14 | FromGitter | <Yardanico> use var current_indexes: seq[int] = newSeqint (len_features_vector) |
16:15:17 | FromGitter | <Yardanico> oh |
16:15:21 | FromGitter | <Yardanico> wait a sec :) |
16:15:47 | FromGitter | <Yardanico> @k0pernicus use this: https://gist.github.com/Yardanico/28fc7a75e34eabb694158cb2104fb09f |
16:15:50 | PMunch | So support for .tmx which is the xml format isn't really an issue as you can simply export as json |
16:16:04 | * | yglukhov joined #nim |
16:16:11 | FromGitter | <Yardanico> and you can use it the same way |
16:16:12 | FromGitter | <k0pernicus> Thanks @Yardanico |
16:16:17 | FromGitter | <k0pernicus> Default values, like for Go? |
16:16:25 | FromGitter | <Yardanico> well they're really "default" |
16:16:40 | FromGitter | <Yardanico> so all non-ref types have default values - just binary "0" |
16:16:50 | FromGitter | <Yardanico> for int this is 0, for float - 0.0, for bool - false |
16:16:53 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:16:57 | FromGitter | <Yardanico> for value from enum - 0 |
16:16:58 | FromGitter | <Yardanico> and so on |
16:17:04 | FromGitter | <k0pernicus> I see :-) |
16:17:11 | FromGitter | <k0pernicus> I didn’t know! |
16:17:15 | FromGitter | <k0pernicus> Thanks a lot |
16:17:21 | FromGitter | <Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
16:17:26 | FromGitter | <Yardanico> there's a table of default values |
16:18:39 | FromGitter | <k0pernicus> Ok |
16:20:17 | * | yglukhov quit (Ping timeout: 248 seconds) |
16:20:21 | * | filcuc quit (Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/) |
16:23:21 | couven92 | okay Araq, got editDistance for unicode working now, review: https://github.com/nim-lang/Nim/pull/6301 |
16:24:40 | couven92 | gotta go now though... bbl |
16:24:41 | * | couven92 quit (Quit: Client disconnecting) |
16:29:28 | FromGitter | <k0pernicus> @Yardanico It seems that `var vectors = newJObject()` does not create a JSON object... |
16:30:02 | FromGitter | <k0pernicus> When I try to add an object (`vectors.add %{file: %current_indexes}`), I got `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` |
16:30:11 | Yardanico | wait |
16:30:28 | Yardanico | why did you use newJObject? |
16:30:33 | Yardanico | k0pernicus: look at my snippet |
16:30:33 | Yardanico | https://gist.github.com/Yardanico/6b0791b1385e2ebf27deafba0210cfa5 |
16:30:43 | Yardanico | newJArray here |
16:30:48 | FromGitter | <k0pernicus> Oh right! |
16:30:55 | FromGitter | <k0pernicus> But |
16:31:10 | FromGitter | <k0pernicus> I will insert the JArray in JObject later, no? |
16:31:38 | FromGitter | <Yardanico> you actually don't need to do that |
16:31:43 | FromGitter | <k0pernicus> Oh ok |
16:31:46 | FromGitter | <k0pernicus> Great |
16:31:48 | FromGitter | <Yardanico> [{"6511":[3,2,2,1,4]},{"5":[1,2,3,4,5]}] is a valid json |
16:32:01 | FromGitter | <k0pernicus> Ok, pretty cool :-) |
16:32:20 | FromGitter | <k0pernicus> Yep, it works |
16:42:04 | FromGitter | <k0pernicus> Python prototype (Using Numpy): ⏎ ⏎ ```real 0m49.777s ⏎ user 0m28.265s ⏎ sys 0m16.725s``` [https://gitter.im/nim-lang/Nim?at=59aed3dcbac826f0548248bf] |
16:42:58 | * | PMunch quit (Quit: leaving) |
16:43:15 | FromGitter | <couven92> @Yardanico did you have timing tests for editDistance? Or just the simple that I can write in a few seconds? |
16:45:09 | miran | guys, any easy way to do a[start:stop:step] in nim? |
16:45:19 | * | Sentreen quit (Ping timeout: 248 seconds) |
16:45:47 | miran | for example, i want just odd elements of some sequence |
16:47:00 | Yardanico | miran, yes |
16:47:03 | Yardanico | countup supports step |
16:47:29 | Yardanico | couven92: let me try :) |
16:47:42 | Yardanico | couven92: and araq means - get rid of debugEcho's |
16:48:00 | miran | i know about countup, but i cannot just do: `a[countup(0, 10, 2)]` |
16:48:06 | Yardanico | miran, well yeah you can't |
16:48:08 | Yardanico | use "for" loop |
16:48:57 | miran | yeah, for loop was my first solution. i thought there might be something more convenient |
16:49:03 | FromGitter | <couven92> @Yardanico yeah, I realized that when I stepped into the bus :P will do that immediately once I'm home |
16:49:13 | Yardanico | well I'll try it anyway |
16:50:00 | Yardanico | couven92: also there's some unused variables in your implementation :) but it looks very cool anyway |
16:50:16 | Yardanico | two unused vars |
16:50:19 | Yardanico | len_chars_a and len_chars_b |
16:51:25 | FromGitter | <couven92> Really :O, ah, yes, yeah I'll delete those... apparently it was really time for me to get home if I have been *that* inattentive |
16:51:37 | Yardanico | well you're a legend |
16:52:07 | Yardanico | you're really a legend! unicode editdistance is only 4x slower (40ns vs 10ns) vs strutils editDistance |
16:52:11 | FromGitter | <k0pernicus> *Love is in the air…* |
16:52:20 | FromGitter | <couven92> Hmm |
16:52:29 | FromGitter | <Yardanico> ===```nim=== ⏎ ⏎ ===GlobalBenchmark relative time/iter iters/s=== ⏎ ⏎ ===GlobalBenchmark 294.84ps 3.39G=== ... [https://gitter.im/nim-lang/Nim?at=59aed64db16f2646420b08af] |
16:52:47 | FromGitter | <Yardanico> but strutils is only ascii |
16:52:54 | FromGitter | <Yardanico> and your proc is every character from unicode :) |
16:53:20 | FromGitter | <Yardanico> also I think maybe *somewhere* in the future we'll make unicode module the default for string operations? |
16:53:25 | FromGitter | <Yardanico> or no? |
16:53:46 | FromGitter | <couven92> Yeah, it has to iterate through both strings to count runes though... |
16:54:15 | FromGitter | <couven92> Ascii doesn't need that |
16:54:42 | Yardanico | I think this is a good performance |
16:54:58 | Yardanico | lol |
16:55:32 | Yardanico | with gcc and ascii strings your proc is only 2x slower than pure-ascii version |
16:55:46 | Yardanico | and with gcc and unicode string it's only 3.4x slower |
16:55:46 | FromGitter | <couven92> I have one more optimization in mind, let's see if that helps |
16:58:29 | def- | miran: something like this? https://gist.github.com/def-/b2a308b705865ad182121df0a4688cfd |
16:59:11 | * | Sentreen joined #nim |
16:59:42 | miran | def-: something like that :) |
17:01:24 | * | couven92 joined #nim |
17:02:42 | miran | def-: but more like this maybe: https://gist.github.com/narimiran/c3b9179b82380e17f0b4b98a1acf0ef2 |
17:03:05 | def- | sure, i just used the syntax from haskell |
17:03:15 | miran | recognized it :) |
17:03:22 | Yardanico | miran, you may also be interested in this |
17:03:23 | Yardanico | https://github.com/Yardanico/nimpylib/blob/master/src/pylib/range.nim |
17:03:36 | Yardanico | it's lazy python-like range implementation |
17:03:41 | * | xet7 quit (Ping timeout: 240 seconds) |
17:03:52 | Yardanico | but if you want to use it - you should "include" it, not import |
17:03:58 | Yardanico | or change "range" to "pyrange" for example |
17:04:08 | Yardanico | I mean type and all template/proc names |
17:05:08 | Yardanico | it has almost the same performance as countup |
17:05:24 | miran | thanks Yardanico, will take a look |
17:05:34 | Yardanico | because it uses the same algorithm as countup for iterating :) |
17:05:49 | Yardanico | And I ported some code from JS library with python-like range |
17:06:03 | Yardanico | e.g. min, max, contains |
17:08:58 | miran | another quick one - string unpacking is not possible? |
17:09:42 | * | yglukhov joined #nim |
17:09:45 | miran | for example: let (a, b, c) = word[i..i+2] |
17:11:39 | FromGitter | <cabhishek> Hi! Is any one using https://github.com/zah/nim.vim for vim and got it work? If not then what else is recommended for vim? |
17:12:41 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
17:13:11 | couven92 | @cabhishek: Hmm... PMunch would know... But AFAIK he's having a familiy dinner today... |
17:14:32 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:14:37 | couven92 | @cabhishek: But we discussed the other day, that enabling whitespace rendering is a good idea in indent sensitive languages like Nim, Python and Ruby |
17:14:37 | * | haha_ joined #nim |
17:15:43 | FromGitter | <couven92> I do this in my `.vimrc` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aedbbfba0f0f6e381d3970] |
17:15:58 | * | nsf quit (Quit: WeeChat 1.9) |
17:16:18 | * | yglukhov joined #nim |
17:18:26 | FromGitter | <couven92> oh crap, I meant this: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=59aedc62614889d475c37544] |
17:20:21 | * | xet7 joined #nim |
17:21:52 | FromGitter | <cabhishek> @couven92 does the plugin show errors on file save? |
17:22:18 | FromGitter | <cabhishek> I have basic syntax highlighting/indentation working |
17:22:31 | * | mahsav joined #nim |
17:22:39 | couven92 | I don't know... maybe use syntastic? |
17:23:08 | FromGitter | <Yardanico> btw I have a slightly *bad* way to consistently check for nim errors in VSCode |
17:23:14 | FromGitter | <Yardanico> I've set auto file save delay to 1ms |
17:23:26 | programisto | could someone clarify the semantics of returning var variable vs variable froma function? |
17:23:38 | programisto | is result within the function body var or does tht also have an impact outside of the function |
17:24:07 | Yardanico | programisto, if you get a value from table and return it as "var Type", user will be able to modify it |
17:24:09 | couven92 | you can return var variable? :O |
17:24:12 | Yardanico | and it will be modified in table |
17:24:13 | Yardanico | couven92, yes |
17:24:34 | programisto | Yardanico: thanks |
17:24:54 | couven92 | Yardanico, how? why? when? under which circumstances? |
17:24:55 | Yardanico | for example |
17:24:59 | Yardanico | couven92, programisto, https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L172 |
17:25:19 | Yardanico | https://github.com/nim-lang/Nim/blob/master/lib/pure/collections/tables.nim#L414 |
17:25:42 | couven92 | huh |
17:25:52 | * | BigEpsilon joined #nim |
17:25:56 | Yardanico | well it's not needed very often for your own programs |
17:26:00 | Yardanico | but it's needed for stdlib |
17:26:01 | Yardanico | also |
17:26:04 | Yardanico | you can return "ref Type" |
17:26:09 | Yardanico | or also you can do this |
17:27:03 | programisto | could I tell you guys my secret? nim is kind of addictive |
17:27:21 | programisto | that pythonicness combined with mapping so closely to C is fun |
17:27:27 | programisto | very easy to understand what's going on |
17:27:40 | Yardanico | programisto, also don't forget lisp macros :D |
17:28:18 | programisto | yeah wow |
17:28:20 | Yardanico | programisto, also not only C, but C++ and ObjC |
17:28:22 | Yardanico | and even JS :P |
17:28:32 | programisto | kind of feel sorry for those bums getting hyped into stuff like rust |
17:28:59 | programisto | nim is like the greatest language ever, why is it not more popular |
17:29:33 | programisto | sorry, it's just fun |
17:29:41 | Yardanico | programisto, almost the main thing in the world is money |
17:29:59 | Yardanico | rust is backed by mozilla - I doubt it will go somewhere without them |
17:30:17 | Yardanico | *would |
17:30:26 | programisto | yeah, the dynamkc makes sense |
17:30:33 | * | claudiuinberlin joined #nim |
17:30:47 | programisto | I think if you sat down 8/10 programmers and had them evaluate nim and rust for the average programs they'd put together, nim is a win almost every time |
17:31:02 | programisto | it just has the right combination of expressivenexs and low level acccess |
17:31:28 | programisto | that goese for go, maybe even python, though that's more dependent on library access |
17:39:11 | Yardanico | well also about any big rust program: it would still have crashes |
17:39:22 | Yardanico | because big programs usually interact with something other than rust code |
17:39:50 | Yardanico | also TIL that Rust doesn't check for out of bounds in compile-time |
17:39:53 | Yardanico | it does that in runtime |
17:41:14 | Yardanico | and I'm not joking here |
17:41:21 | * | BigEpsilon quit (Ping timeout: 240 seconds) |
17:41:51 | * | xet7 quit (Ping timeout: 248 seconds) |
17:46:42 | * | vlad1777d joined #nim |
17:47:28 | * | thomasross_ quit (Remote host closed the connection) |
17:47:53 | * | thomasross_ joined #nim |
17:53:19 | * | Trustable quit (Remote host closed the connection) |
17:58:36 | * | xet7 joined #nim |
18:03:16 | Yardanico | guys |
18:03:23 | Yardanico | does anyone have weird bug on github? |
18:03:29 | Yardanico | there's no styles applied |
18:03:47 | Yardanico | I have it, and my friend too |
18:03:51 | FromGitter | <Yardanico> image: |
18:03:56 | FromGitter | <Yardanico> (https://files.gitter.im/nim-lang/Nim/GpDg/image.png) |
18:04:01 | * | xet7 quit (Ping timeout: 240 seconds) |
18:06:18 | FromGitter | <ephja> stylesheet 404 |
18:08:07 | * | Arrrr joined #nim |
18:08:07 | * | Arrrr quit (Changing host) |
18:08:07 | * | Arrrr joined #nim |
18:09:08 | * | relax quit (Ping timeout: 255 seconds) |
18:09:23 | * | relax joined #nim |
18:09:27 | Arrrr | why does github look so ugly |
18:10:18 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:11:00 | * | pilne joined #nim |
18:11:51 | * | claudiuinberlin joined #nim |
18:12:41 | Arrrr | huh now it works ok |
18:12:50 | Yardanico | oh |
18:12:51 | Yardanico | fixed |
18:13:02 | * | TjYoco joined #nim |
18:13:33 | * | xet7 joined #nim |
18:20:48 | * | xet7 quit (Ping timeout: 240 seconds) |
18:22:16 | * | thomasross joined #nim |
18:22:26 | * | francisl joined #nim |
18:22:28 | * | thomasross quit (Remote host closed the connection) |
18:22:56 | * | thomasross joined #nim |
18:23:36 | * | thomasross_ quit (Ping timeout: 240 seconds) |
18:25:34 | * | couven92 quit (Read error: Connection reset by peer) |
18:27:11 | * | francisl quit (Ping timeout: 248 seconds) |
18:28:18 | * | thomasross quit (Read error: Connection reset by peer) |
18:28:36 | * | thomasross joined #nim |
18:30:17 | * | thomasross quit (Remote host closed the connection) |
18:30:32 | * | thomasross joined #nim |
18:31:17 | * | francisl joined #nim |
18:33:28 | * | thomasross_ joined #nim |
18:35:41 | * | francisl quit (Ping timeout: 255 seconds) |
18:36:08 | * | thomasross quit (Ping timeout: 255 seconds) |
18:38:08 | * | xet7 joined #nim |
18:41:48 | * | francisl joined #nim |
18:45:06 | * | Vladar quit (Remote host closed the connection) |
18:45:16 | * | francisl_ joined #nim |
18:46:56 | * | francisl quit (Ping timeout: 248 seconds) |
18:46:56 | * | francisl_ is now known as francisl |
18:48:01 | * | TjYoco quit (Quit: Page closed) |
18:56:14 | * | claudiuinberlin quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
19:05:28 | * | relax quit (Ping timeout: 240 seconds) |
19:05:36 | Yardanico | dom96|w, what can be the reason of this? https://gist.github.com/Yardanico/19d8525f8c2bfde21b54e8ebd88e15de |
19:06:11 | Yardanico | this package should be available - https://github.com/nim-lang/packages/commit/c8d4514bb1c4333ae1b5855569681cf57dcddce5 |
19:14:42 | * | relax joined #nim |
19:16:56 | * | haha_ quit (Quit: haha_) |
19:17:07 | * | claudiuinberlin joined #nim |
19:21:21 | dom96 | Yardanico: http://irclogs.nim-lang.org/packages.json takes a while to update |
19:21:34 | Yardanico | dom96, I've removed all urls from nimble.ini |
19:21:37 | Yardanico | except nim-lang.org one |
19:21:51 | Yardanico | still fails for some reason |
19:22:07 | Yardanico | dom96, https://gist.github.com/Yardanico/77f8fb4cafcf210798219c69d893afb3 |
19:22:09 | dom96 | Like I said, that takes a while to update. |
19:22:34 | dom96 | https://github.com/nim-lang/packages/raw/master/packages.json |
19:23:03 | Yardanico | why this isn't the default? :) |
19:23:49 | Yardanico | but thanks |
19:24:32 | * | nsf joined #nim |
19:25:13 | dom96 | Pretty sure it is |
19:25:17 | dom96 | You just had an old nimble.ini |
19:25:28 | Yardanico | ah, ok |
19:32:11 | crem | why is nico not in nimble, while https://github.com/ftsf/nico suggests that it should be |
19:32:34 | * | BigEpsilon joined #nim |
19:32:34 | Yardanico | crem, we don't know |
19:32:38 | Yardanico | ask ftsf |
19:33:50 | crem | if only I knew how to contact him.. |
19:34:15 | Yardanico | write an issue in this repo? |
19:34:53 | Yardanico | I don't need to teach you how to use github I think :) |
19:36:59 | * | Yardanico quit (Remote host closed the connection) |
19:41:07 | * | PMunch joined #nim |
19:48:45 | * | rokups quit (Quit: Connection closed for inactivity) |
19:51:00 | * | BigEpsilon quit (Ping timeout: 252 seconds) |
19:59:29 | * | relax quit (Ping timeout: 248 seconds) |
20:04:09 | FromGitter | <Bennyelg> @Yardanico thanks, I'll add tests tomorrow :) |
20:14:28 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) |
20:30:30 | * | Matthias247 joined #nim |
20:35:47 | * | francisl quit (Quit: francisl) |
20:38:13 | crem | Turned out that there is a youtube video which contains detailed explanation why it is not in the repo. |
20:38:36 | * | miran quit (Ping timeout: 240 seconds) |
20:40:06 | * | dom96|w quit (Ping timeout: 240 seconds) |
20:40:45 | * | rauss quit (Quit: WeeChat 1.9) |
20:47:46 | PMunch | Hmm, doesn't Nim throw an Overflow/Underflow error when you subtract from a uint? |
20:48:45 | ehmry | PMunch: probably not with -d:release |
20:48:52 | * | Jesin quit (Quit: Leaving) |
20:49:00 | PMunch | Hmm |
20:49:07 | PMunch | This is without -d:release |
20:49:15 | ehmry | I'm not sure but you can turn those checks off explicitly |
20:49:50 | PMunch | But I was trying to add some simple += -= functions for uint32 and int32, that would detect overflow/underflow and just max or min out the uint value |
20:49:54 | PMunch | So it wouldn't wrap |
20:50:13 | PMunch | Tried with a try except OverflowError but that didn't seem to do much.. |
20:51:44 | * | ofelas quit (Quit: shutdown -h now) |
20:51:46 | * | vivus joined #nim |
21:06:29 | Araq | uints are not checked for overflows |
21:06:42 | PMunch | Why not? |
21:07:03 | Araq | cause unsigned numbers are idiotic anyway |
21:07:27 | Araq | it's just some bit pattern, if you're lucky you can get some meaningful bits |
21:13:54 | PMunch | Isn't that true for all data in a computer though? :P |
21:15:02 | PMunch | Oh well, I'm off to bed now |
21:15:08 | * | PMunch quit (Quit: leaving) |
21:15:58 | * | pleiosaur joined #nim |
21:24:11 | * | relax joined #nim |
21:26:56 | * | ipjk joined #nim |
21:32:15 | dom96 | Unfortunately no matter how idiotic unsigned ints are deemed, there is a use for them and we should probably ensure they throw an error on underflow/overflow. |
21:33:14 | * | endragor joined #nim |
21:37:35 | * | endragor quit (Ping timeout: 248 seconds) |
21:40:49 | * | relax quit (Ping timeout: 248 seconds) |
22:02:36 | * | Snircle joined #nim |
22:03:38 | * | gokr joined #nim |
22:10:47 | Araq | and break compatibility with every hashing algorithm out there? |
22:11:00 | Araq | as well as compat with C/C++ were these abound? |
22:11:49 | * | mahmudov joined #nim |
22:23:53 | * | Arrrr quit (Quit: Leaving.) |
22:28:33 | * | cspar_ joined #nim |
22:31:24 | * | skrylar joined #nim |
22:31:37 | skrylar | well. there was no response on the rfc3339 thing. so i wrote a module for it |
22:31:52 | skrylar | doesn't handle leap seconds yet, but otherwise |
22:33:53 | skrylar | i think we do have oid's in the stdlib though, can probably change the bson code to use that |
22:41:34 | * | nsf quit (Quit: WeeChat 1.9) |
22:56:54 | * | vlad1777d quit (Ping timeout: 252 seconds) |
23:08:15 | * | gokr quit (Ping timeout: 248 seconds) |
23:12:05 | * | def-pri-pub joined #nim |
23:12:05 | * | def-pri-pub quit (Changing host) |
23:12:05 | * | def-pri-pub joined #nim |
23:27:48 | * | RushPL quit (Ping timeout: 240 seconds) |
23:33:34 | * | yglukhov quit (Remote host closed the connection) |
23:54:18 | skrylar | TIL you can use break inside of templates https://gist.github.com/Skrylar/2b3c52373482d0701746a1a0acdabec6 |