00:03:10 | Araq | zacharycarter: C++ is "safer" in the sense because you cannot forget to write the 'try finally' |
00:04:46 | * | craigger quit (Quit: bye) |
00:07:54 | * | craigger joined #nim |
00:20:35 | * | craigger quit (Quit: bye) |
00:23:02 | * | zachk quit (Read error: Connection reset by peer) |
00:23:17 | * | kapil____ quit (Quit: Connection closed for inactivity) |
00:23:24 | * | craigger joined #nim |
00:23:35 | * | zachk joined #nim |
00:24:52 | * | zachk quit (Changing host) |
00:24:53 | * | zachk joined #nim |
01:04:14 | * | literal quit (Read error: Connection reset by peer) |
01:19:43 | FromGitter | <arnetheduck> I posit that the vast majority of the std lib is not exception safe, and makes no attempt at any kind of error handling, leading to resource leaks in the face of any error.. just search for `open` and `close` and you'll find tonnes of code which is not protected.. this is fine because nim is rarely used in any kind of long-running processes - in a script that opens <50 files it doesn't simply matter |
01:23:32 | FromGitter | <arnetheduck> even the very core of the language (`system.nim`) has these issues - https://github.com/nim-lang/Nim/issues/9657 - it is simply not part of nim culture to do any kind of error handling |
01:28:35 | FromGitter | <arnetheduck> perhaps this is why the supervisor idea is so popular - you run the app until it crashes - which frees up all resources - then you just restart it again |
01:50:35 | * | xace quit (Ping timeout: 268 seconds) |
01:50:37 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
02:23:43 | * | tribly quit (Quit: WeeChat 2.3) |
02:24:43 | * | tribly joined #nim |
02:28:02 | * | zachk quit (Quit: Leaving) |
02:35:40 | * | xace joined #nim |
02:51:48 | * | kungtotte quit (Remote host closed the connection) |
03:06:26 | * | vlad1777d quit (Ping timeout: 268 seconds) |
03:07:41 | * | banc quit (Quit: ZNC - http://znc.in) |
03:16:37 | * | leorize joined #nim |
03:23:53 | * | banc joined #nim |
03:43:42 | * | abm quit (Ping timeout: 250 seconds) |
03:55:03 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
04:00:10 | * | theelous3_ quit (Ping timeout: 250 seconds) |
04:04:59 | * | dddddd quit (Remote host closed the connection) |
04:25:14 | * | leorize quit (Quit: WeeChat 2.2) |
04:45:16 | * | endragor joined #nim |
04:48:07 | * | endragor quit (Remote host closed the connection) |
04:48:16 | * | endragor joined #nim |
05:16:29 | * | nsf joined #nim |
05:35:41 | * | stefanos82 joined #nim |
05:36:04 | * | narimiran joined #nim |
06:25:50 | * | NimBot joined #nim |
06:32:22 | FromGitter | <gogolxdong> What's the difference between pbkdf2 and hkdf? |
06:34:17 | FromGitter | <gogolxdong> after settling sha256.hmac , there is an issue of my nim code of hkdfExpand, which expected implement specification ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bff8869f59704348e1f78b6] |
06:36:10 | FromGitter | <gogolxdong> what's the meaning of `|` there `or` or concatenation? |
06:47:31 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bff8b837d26db1e8312476a] |
07:04:28 | * | narimiran quit (Remote host closed the connection) |
07:14:02 | Araq | arnetheduck: you can posit all you want but you're wrong. the reason the stdlib avoids try finally is that it is expensive for the C target |
07:18:16 | Araq | and it's also very telling that the fix for #9657 is to swallow the error message |
07:18:38 | FromGitter | <gogolxdong> Is there anything inconsistent with the RFC? |
07:20:05 | Araq | on my linux machine every Gtk app prints crappy warnings in the terminal. Because it's written in C and C lacks exceptions, so "dump the error message somewhere and try to continue" is the only option they have in practice. |
07:20:50 | Araq | gogolxdong: which RFC? |
07:29:18 | FromGitter | <gogolxdong> https://tools.ietf.org/html/rfc5869 |
07:33:20 | * | krux02 joined #nim |
07:37:08 | * | Vladar joined #nim |
08:01:06 | FromGitter | <gogolxdong> correct the concatenated const to octet , result still varies. |
08:01:39 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bff9ce3a115c91ef7ade85e] |
08:06:01 | Araq | not my expertise, sory |
08:08:17 | FromGitter | <gogolxdong> no problem, it is rarely to be reinvented. |
08:19:11 | * | zakora joined #nim |
09:03:09 | * | floppydh joined #nim |
09:06:14 | * | Vladar quit (Remote host closed the connection) |
09:08:04 | * | Sembei quit (Read error: Connection reset by peer) |
09:09:08 | * | Sembei joined #nim |
09:09:29 | * | kapil____ joined #nim |
09:11:18 | FromGitter | <alehander42> i want to never log out of the forum, is there such an option |
09:15:58 | serialdev[m] | Use Riot.im @alehander42 through matrix you never log out |
09:16:18 | serialdev[m] | https://riot.im/app/#/room/#freenode_#nim:matrix.org |
09:18:11 | FromGitter | <narimiran> forum != irc |
09:21:59 | serialdev[m] | early morning mind fog 😅 |
09:22:28 | * | deathpoison joined #nim |
09:29:34 | * | ng0 joined #nim |
09:29:44 | FromGitter | <alehander42> yeah, I never log out from gitter too :D |
09:30:06 | FromGitter | <alehander42> I actually wondered about riot.im, what is its + e.g. compared to discord |
09:32:07 | FromGitter | <narimiran> riot is a matrix client |
09:32:56 | FromGitter | <alehander42> and matrix is nice, because decentralizatn |
09:32:58 | FromGitter | <alehander42> right |
09:35:52 | Araq | hmmm I don't need to debug this |
09:37:30 | FromGitter | <mratsim> this: self? |
09:38:20 | Araq | no --incremental:on |
09:38:44 | Araq | it's "immediately obvious" why it has bugs |
09:39:10 | Araq | and here "immediately" means it took me one week |
09:42:38 | FromGitter | <gogolxdong> @mratsim you can help me with hkdfExpand |
09:46:49 | FromGitter | <mratsim> `|` means `or` I think, I’m looking into pbkdf2 specs and they use `||` for concat |
09:47:04 | FromGitter | <mratsim> https://tools.ietf.org/html/rfc2898 |
09:47:47 | FromGitter | <gogolxdong> so it's bitor? |
09:47:50 | FromGitter | <mratsim> yes |
09:54:05 | FromGitter | <gogolxdong> (where the constant concatenated to the end of each T(n) is a single octet.) bitwise or doesn't make sense, two RFC might be out of different authors, prev and info are seq[uint8] , how to use bitwise or. |
09:55:57 | FromGitter | <gogolxdong> This is it's Go implementation ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bffb7adf59704348e209595] |
09:57:03 | FromGitter | <gogolxdong> I made Nim comparable to this with update*() |
09:57:21 | FromGitter | <alehander42> Araq: I'll try today to make a simple ref nil checking prototype at least for some cases, to see if it seems reasonabl |
10:02:03 | FromGitter | <gogolxdong> I want to finish HKDF and PR to nimcrypto, help to check this |
10:03:18 | * | druonysus quit (Ping timeout: 268 seconds) |
10:05:19 | * | druonysus joined #nim |
10:05:19 | * | druonysus quit (Changing host) |
10:05:19 | * | druonysus joined #nim |
10:09:24 | Araq | alehander42: nice |
10:11:11 | * | dom96_w joined #nim |
10:16:32 | FromGitter | <mratsim> @gogolxdong ugh, if the ietf is not consistent with their own notation that’s bad :/ |
10:19:12 | FromGitter | <mratsim> here is another one: https://github.com/seb-m/CryptoPill/blob/master/CryptoPill/hkdf/hkdf.c#L233-L246 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bffbd20d24f9324d26f9f83] |
10:20:01 | FromGitter | <gogolxdong> basically the same ,right? |
10:20:42 | FromGitter | <mratsim> looking, but instead of @[i] for the final byte, just use [i] |
10:21:13 | FromGitter | <mratsim> also result should be seq[byte] not string |
10:21:46 | FromGitter | <mratsim> there is an extra update in the loop in the C impl I linked |
10:22:10 | FromGitter | <gogolxdong> but expression 'i' is of type: uint8 ⏎ proc updateT: bchar (hmctx: var HMAC; data: openArray[T]) ⏎ first type mismatch at position: 2 ⏎ required type: openarray[T: bchar] [https://gitter.im/nim-lang/Nim?at=5bffbdd2a115c91ef7aeb2fa] |
10:22:44 | FromGitter | <gogolxdong> update requires openarray |
10:22:56 | FromGitter | <mratsim> [byte i] |
10:23:19 | FromGitter | <mratsim> bchar is a thing? lol |
10:24:23 | * | zakora quit (Quit: WeeChat 2.2) |
10:26:39 | FromGitter | <gogolxdong> where is the extra update? it's remains the same with changing @[i] to [i] |
10:30:34 | FromGitter | <mratsim> ah sorry I didn’t see your concat |
10:31:00 | FromGitter | <mratsim> btw @alehander42 I finished my JIT-ted BrainfuckVM here: https://github.com/mratsim/jitterland/blob/master/bfVM_v03_jit.nim |
10:31:16 | * | d_s left #nim (#nim) |
10:37:50 | Araq | Assembler[Reg_x86_64] what is this magic? |
10:41:00 | Araq | oh it's part of your code |
10:41:55 | FromGitter | <alehander42> @mratsim nice, does it actually show better performance (I know its just a learning exercise but still) |
10:42:47 | FromGitter | <alehander42> btw today I wondered about a very weird optimization, e.g. if somebody changes rarely a boolean-hotspot-variable: a boolean variable which is very oftenly used for branching |
10:43:29 | FromGitter | <alehander42> does it exist an optimization which rewrites/replaces the function pointer to such bodies with a specialized no-branch versions |
10:44:56 | FromGitter | <alehander42> probably this doesn't make a lot sense with branch prediction |
10:46:16 | Araq | that's what many JITs do, yes |
10:47:00 | Araq | but it needs to be done carefully, self-modifying code needs to flush the instruction caches |
10:47:28 | Araq | and it's also a security nightmare IMHO, but every JIT is |
10:47:46 | * | abm joined #nim |
10:52:16 | * | abm quit (Client Quit) |
10:53:35 | FromGitter | <mratsim> @alehander42 yes, 2.5x perf improvement on this bench: https://github.com/mratsim/jitterland/blob/master/brainfuck_src/kostya_bench.bf |
10:53:51 | FromGitter | <mratsim> and 10x perf improvement on mandelbrot fractal: https://github.com/mratsim/jitterland/blob/master/brainfuck_src/mandelbrot.bf |
10:54:17 | FromGitter | <mratsim> the first bench is just rpinting ZYWVX … DCBA |
11:01:01 | * | abm joined #nim |
11:05:45 | FromGitter | <mratsim> @alehander42 predictable branch have no cost. Or used to have no cost due to speculative execution |
11:05:57 | FromGitter | <mratsim> with spectre, meltdown and L1TF I’m not sure anymore |
11:06:02 | * | dddddd joined #nim |
11:06:45 | FromGitter | <mratsim> i.e. for predictable branches (90%+ branch correct branch prediction) if/else is faster than CMOV |
11:06:56 | FromGitter | <alehander42> yes, it makes sense |
11:07:18 | FromGitter | <alehander42> but maybe in a world with spectre/meltdown new opt might be useful |
11:07:23 | FromGitter | <mratsim> ah, it changed with Skylake: https://github.com/xiadz/cmov |
11:10:34 | * | vlad1777d joined #nim |
11:24:37 | FromGitter | <alehander42> Araq, how do you usually echo PNodes/PTypes etc |
11:25:23 | Araq | debug(x) or typeToString(t) and $node |
11:29:45 | FromGitter | <alehander42> hm I tried $node and i couldn't find such for PNode |
11:31:39 | FromGitter | <alehander42> ah render |
11:36:10 | FromGitter | <alehander42> do you prefer text or tree representation usually actually |
11:43:07 | * | theelous3_ joined #nim |
11:48:37 | * | nolanv joined #nim |
12:09:27 | FromGitter | <alehander42> `ref.nim(9, 11) Error: can't access field: a a nil` ⏎ ok, my prototype works for simple cases and simple if isNil checks |
12:10:44 | FromGitter | <narimiran> someone posted our Advent of Nim to HN: https://news.ycombinator.com/item?id=18559449 |
12:25:22 | stefanos82 | congrats Nim team :D you are #1 on HN! ^_^ |
12:27:47 | FromGitter | <narimiran> wow, i didn't even notice it is in 1st place |
12:29:55 | FromGitter | <narimiran> whoever wrote that blog post must be a great guy! :P :D |
12:39:53 | FromGitter | <alehander42> Araq, I actually catch contradictions too: `if a.isNil and not a.isNil:` `Error: a can't be both nil and safe` |
12:40:13 | FromGitter | <alehander42> is this actually bad, as one might want to leave this valid (e.g. if false) |
12:45:57 | FromGitter | <arnetheduck> > the reason the stdlib avoids try finally is that it is expensive for the C target |
12:47:15 | FromGitter | <arnetheduck> fast over correct - yes, that's the culture - are you claiming somehow that the resource leaks (file handles, capped at 1024 often) go away because you do it quickly? |
12:49:35 | FromGitter | <arnetheduck> that also doesn't explain why sometimes, it's used and sometimes it's not (for open/close pairs) |
12:51:03 | Araq | sometimes it's bad code, sometimes it's "I know this cannot throw... argh..." |
12:51:16 | Araq | ;-) |
12:51:56 | Araq | in the compiler it's "I know if this throws the compiler should die and the OS will cleanup anyway" |
12:52:39 | Araq | as I said, having an OS run your code definitely helps, but the language can't assume there is an OS |
12:53:21 | Xe | speaking of without an OS, how would you suggest compiling nim to raw webassembly without emcc? |
12:53:35 | Xe | i'm looking at using nim for event sourcing code in wasm |
12:54:15 | Xe | i'm willing to patch the compiler to support the webassembly environment's syscalls |
12:55:04 | Araq | but if you have constructive suggestions I'm all ears, it's not that I love exceptions. I don't. But I found no real alternative. |
12:55:39 | FromGitter | <mratsim> I feel like this discussion comes again and again: https://github.com/status-im/nimbus/wiki/Exceptions-and-errors |
12:57:19 | Araq | Xe, well with emmcc or similar tools we need to reinvent a wasm codegen which not only doesn't support exceptions, threading, IO |
12:57:26 | Araq | but also freaking function pointers. |
12:57:36 | Araq | *without emcc |
12:57:59 | Xe | yeah half of the problem is my environment isn't javascript |
12:59:25 | * | zahary quit (Quit: Connection closed for inactivity) |
12:59:30 | Xe | hmm, a thought: have nim emit c and use the c compiler emitting to webassembly with explicit annotations for the symbols that i want to import from the "real world"? |
13:02:00 | Xe | like, normal posix c |
13:02:35 | Xe | without wasm-specific codegen, with some patch to system.nim to support the syscalls that this environment uses |
13:03:11 | Xe | or is that just not fundamentally possible in a way that implies i don't understand a lot of how the nim compiler works? |
13:08:02 | FromGitter | <arnetheduck> `I know this cannot throw... argh...` is the thing I'm worried about for status / nimbus / production-use-of-nim - all I ask for is tools (lang features) and defaults that flip "errors are hidden" to "errors are visible and must be explicitly ignored" - much like `discard` - ie a developer should be allowed to explicitly ignore them, but needs help to see where that decision must be taken because it's something |
13:08:02 | FromGitter | ... humans are notoriously bad at and computers are very good at.. if that becomes too onerous, it's ok - it's motivation to come up with constructs that help make it less onerous |
13:09:18 | Araq | Xe, it would work |
13:09:35 | Araq | arnetheduck: ah for this I have found a nice solution. |
13:09:39 | FromGitter | <arnetheduck> they become even more important if you want to target the language for something that doesn't have the safety net of an `OS` |
13:10:17 | Araq | we have {.push raises: [].} |
13:10:52 | Araq | then you're forced to annotate your procs with explicit .raises annotations |
13:11:01 | Araq | to override the [] default |
13:11:48 | Araq | however, this feature doesn't work, but I can declare that a compiler bug and backport it to 0.19.2 |
13:12:21 | FromGitter | <narimiran> "Can someone sell me Nim in few sentences if I am a D user?" pinging @timotheecour https://news.ycombinator.com/item?id=18559867 |
13:14:28 | FromGitter | <arnetheduck> that's a start - and in the world view of running nim without a safety net that you can crash out of, it should be the default that you switch off - so here's a challenge then: make it the default in the std lib - it's a reasonable ask - the std lib isn't a quick-and-dirty hack / script where arguably you don't care about errors |
13:14:36 | livcd | narimiran: easy. He can complain about Nim in polish and dom will take notes. |
13:16:26 | FromGitter | <zetashift> Can't believe the HN thread went to #1 seems weird, but hell I'll take it |
13:18:16 | FromGitter | <narimiran> livcd: lol |
13:18:27 | FromGitter | <narimiran> @zetashift me neither, and me too :D |
13:19:11 | Araq | arnetheduck: agreed. |
13:20:14 | FromGitter | <arnetheduck> it's also good motivation for you to come up with constructs that make it less onerous.. two birds in one stone :) |
13:20:27 | FromGitter | <arnetheduck> *with |
13:23:47 | * | dom96_w quit (Changing host) |
13:23:47 | * | dom96_w joined #nim |
13:23:56 | dom96_w | yay, HN |
13:24:12 | dom96_w | Nice job narimiran :D |
13:24:53 | FromDiscord_ | <the_ultamite_nim_fan> Hackernews loves nim, where I heard about it |
13:25:27 | FromGitter | <zetashift> that isn't miran who posted it though haha |
13:25:31 | FromGitter | <narimiran> HN usually has mixed feelings about nim ;) |
13:26:09 | FromGitter | <narimiran> @zetashift no, it wasn't me who posted it on HN, but dom96_w is referring to the blog post ;) |
13:26:32 | dom96_w | yep, narimiran wrote the blog post :) |
13:26:33 | FromGitter | <zetashift> ah yeah that makes more sense |
13:26:38 | dom96_w | but yes, good job to the person that posted iot |
13:26:39 | dom96_w | *it |
13:26:43 | FromDiscord_ | <the_ultamite_nim_fan> i think average it gets a overall positive response, but there is sometimes skepticism yea |
13:27:33 | FromGitter | <narimiran> and while we're at it: good job @mratsim for answering those HN questions! |
13:28:15 | FromGitter | <zetashift> case/style insensitivity and indentation discussions are most of the negativity |
13:29:08 | FromGitter | <mratsim> strangely there are none at the moment |
13:29:22 | FromGitter | <alehander42> indentation is silly in 2018, python is </criticism> |
13:30:06 | FromGitter | <narimiran> i've seen one comment mentioning 'case-insensitivity', but so far so good :) |
13:32:44 | FromGitter | <narimiran> btw, currently we have 24 people on our private AoC leaderboard |
13:33:02 | FromGitter | <alehander42> a link? |
13:34:56 | FromGitter | <narimiran> go here: https://adventofcode.com/2017/leaderboard/private and then enter the following code: `40415-c732e66e` |
13:36:41 | FromGitter | <narimiran> 25 :) |
13:37:00 | * | Snircle joined #nim |
13:37:23 | FromGitter | <alehander42> thanks |
13:37:31 | FromGitter | <alehander42> hm, so we upload only answers, not solutioins? |
13:38:40 | FromGitter | <narimiran> yup. (but don't try to brute-force it, they increase waiting times for submitting for every wrong answer ;)) |
13:38:48 | * | leorize joined #nim |
13:40:01 | FromGitter | <alehander42> i guess they require answer for a big input |
13:41:04 | * | leorize quit (Client Quit) |
13:41:30 | FromGitter | <narimiran> you can try to solve any of 75 tasks from the previous three years to get an idea how things look/work (go to Events, then choose a year) |
13:41:54 | FromGitter | <alehander42> oh, no time |
13:41:54 | FromGitter | <alehander42> :D |
13:42:20 | * | leorize joined #nim |
13:42:28 | FromGitter | <narimiran> who said there are no case-insensitivity comments? here you go: https://news.ycombinator.com/item?id=18560018 :D |
13:43:04 | dom96_w | D: |
13:43:25 | FromGitter | <narimiran> @alehander42 it's just a few clicks and you'll see the inputs ;) |
13:47:57 | FromGitter | <alehander42> Araq: now my prototype works for some loops too: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bffee0d6621313894392537] |
13:48:06 | dom96_w | https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |
13:48:07 | dom96_w | This is wrong |
13:48:22 | dom96_w | It calls it "partial case insensitivity" when it should be "partial style insensitivity" |
13:48:36 | FromGitter | <alehander42> ops, the error is on line `echo b.a` * |
13:50:43 | FromGitter | <alehander42> the 0, 1, 2 iterations scheme seems to work nice (and it's pretty easy: I just check with map1 again and make union of map0, map1 and map2 after ) |
13:51:32 | FromGitter | <alehander42> still, a lot more to do ofc |
13:52:59 | dom96_w | So how do we argue against this? https://news.ycombinator.com/item?id=18560092 |
13:53:43 | FromGitter | <zetashift> nimpretty? |
13:53:50 | FromGitter | <alehander42> well, interop with C/JS: you can't control all identifiers, because we can reuse a rich ecosystem of other lang |
13:53:56 | dom96_w | read the context |
13:55:08 | FromGitter | <alehander42> 1) they are not opposite: we can, and probably will have nimpretty for a single codebase and still make it possible to import libs not following NEP1 |
13:56:42 | dom96_w | I don't think that's a valid reason. You can name your wrapper procedures whatever you want |
13:57:12 | dom96_w | proc foo() {.importc: "foo_bar".} |
13:57:18 | * | Notkea quit (Ping timeout: 250 seconds) |
13:58:35 | FromGitter | <alehander42> yeah, but renaming 100 importc-es because you don't want the default foo_bar isn't nice |
13:58:53 | FromGitter | <alehander42> well, in this case you can still reuse other nim libs which don't conform |
13:59:12 | FromGitter | <alehander42> and again, nimpretty/gofmt makes most sense for your own codebase |
14:02:34 | * | endragor quit (Remote host closed the connection) |
14:02:59 | * | PMunch joined #nim |
14:05:30 | * | nsf quit (Quit: WeeChat 2.3) |
14:09:40 | Araq | alehander42, or you use c2nim --nep1 |
14:11:37 | * | Notkea joined #nim |
14:13:39 | * | endragor joined #nim |
14:14:38 | * | vlad1777d quit (Ping timeout: 245 seconds) |
14:15:07 | FromGitter | <alehander42> ah I didn't know that |
14:17:36 | dom96_w | Araq: Read HN? |
14:18:06 | * | endragor quit (Ping timeout: 250 seconds) |
14:21:21 | Araq | and then ...? |
14:21:40 | Araq | what's the argument? "I don't know how importc: "name here" works"? |
14:21:56 | Araq | that's not even an argument... |
14:22:52 | dom96_w | Read this thread please: https://news.ycombinator.com/item?id=18559449 |
14:22:54 | FromGitter | <alehander42> Araq: i think I found a bug in excpt.nim with my new ref-checking code |
14:26:36 | Araq | dom96_w, ok ... and now ? |
14:28:11 | dom96_w | Give a bit of care towards the points raised by these people and attempt to win them over with arguments. |
14:28:19 | Araq | I can search for the neuroscience study which proves humans think in sound, not in spelling, so "spelling matters for humans" is pretty mistaken |
14:29:30 | Araq | not sure why that even requires a study though, it's immediately obvious for anybody with a tiny bit of self reflection |
14:31:36 | FromGitter | <alehander42> basically in `raiseExceptionEx` we never check if `e` is not nil, so `raise (something that become nil)` segfaults (I guess the idea is: this can't happen normally?) |
14:32:34 | dom96_w | Humans do. Programmers are trained to look for any small discrepancies, and this includes spelling |
14:32:46 | dom96_w | I think JoeAltmaier makes a good point |
14:32:57 | dom96_w | How do you fight this ambiguity? |
14:33:29 | dom96_w | Case insensitivity sadly encourages it |
14:36:54 | PMunch | To be honest I've never encountered this in my time using Nim |
14:37:44 | PMunch | It is a valid concern, but I don't think its something that has ever caused an issue in Nim code |
14:39:49 | PMunch | The thing is that once you get used to it you know that pidTarget and pIdTarget is the same thing, so you either relax you expectations, or you don't construct your names with this ambiguity. And besides, a "pointer to a target id" and a "scalar process id" probably don't share the same type, so the compiler should be catching that anyways if you ever used it wrong. |
14:40:07 | * | Vladar joined #nim |
14:40:38 | FromGitter | <narimiran> PMunch: copy paste this there |
14:41:57 | dom96_w | See, now that's a beautiful argument and is exactly what I am looking for |
14:41:59 | Araq | dom96_w, programming is far too important to make every human unlearn and focus on historical mistakes made by Unix's creators |
14:42:00 | * | endragor joined #nim |
14:46:11 | PMunch | Added it to my reply |
14:46:25 | dom96_w | Awesome. Thank you PMunch |
14:46:37 | FromGitter | <narimiran> +1 |
14:46:58 | * | endragor quit (Ping timeout: 268 seconds) |
14:47:15 | PMunch | dom96_w, saw your reply about the Dev room idea for next years FOSDEM by the way (was offline but read the IRC log later that day) |
14:47:48 | PMunch | I certainly would be interesting |
14:48:57 | dom96_w | Replied to your comment with something that popped into my head regarding nimpretty |
14:49:04 | dom96_w | Let me know if it makes sense |
14:49:12 | dom96_w | I think it's another advantage of style insensitivity |
14:51:23 | Araq | neither gofmt nor nimpretty change the spellings btw, I don't know why it comes up. it's true though that tooling can rename things if the name doesn't matter to begin with... |
14:52:32 | Araq | so yeah, gofmt can't change it and nimpretty *could* |
14:52:58 | dom96_w | Nimpretty *should* change the spellings |
14:53:06 | dom96_w | convention is to use camelCase |
14:53:09 | dom96_w | so let's make that the case |
14:53:40 | PMunch | It should also make sure you don't use two different casings of the same identifier |
14:53:42 | dom96_w | narimiran: https://news.ycombinator.com/item?id=18560290 |
14:53:44 | dom96_w | We need to clairfy this |
14:53:58 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
14:55:10 | FromGitter | <narimiran> dom96_w fastest *player* on *leaderboard* — the one who has the most points |
14:55:33 | FromGitter | <mratsim> I don’t like camelCase |
14:55:47 | FromGitter | <mratsim> even dom you’re using dom96_w instead of dom96W |
14:55:56 | FromGitter | <narimiran> i.e. the one who will be awake at 5 a.m. UTC for 25 days :) |
14:56:25 | Araq | I don't like underscored, they suck on every font I ever used |
14:56:34 | Araq | *underscores |
14:56:44 | FromGitter | <mratsim> use better fonts? :P |
14:56:48 | Araq | here_try to_tokenize this mess |
14:56:54 | FromGitter | <narimiran> @alehander42 should i leave this one to you to answer? :) https://news.ycombinator.com/item?id=18560497 |
14:58:30 | FromGitter | <alehander42> I can try, thank you, I was just talking about adt to a friend :D |
14:58:32 | FromGitter | <alehander42> adt-s* |
14:59:11 | Araq | mratsim: and what font would that be? |
14:59:28 | Araq | they are universally rendered below the current line... |
15:00:19 | Araq | heck, some programming languages allow for the minus in identifiers because underscores suck so much |
15:00:29 | Araq | so that you can write foo-bar-baz |
15:00:38 | FromGitter | <zacharycarter> I just don't want to see the C/C++ pattern |
15:01:01 | FromGitter | <zacharycarter> where identifiers start having underscore prefixes / suffixes |
15:01:04 | * | Snircle joined #nim |
15:01:50 | FromGitter | <zacharycarter> and inferred meaning |
15:01:57 | FromGitter | <mratsim> I use Inconsolata |
15:02:11 | PMunch | Ditto |
15:02:19 | PMunch | It's a pretty good font |
15:02:44 | PMunch | Inconsolata for Monospace, M+ for UI font |
15:03:10 | FromGitter | <mratsim> Menlo is excellent as well |
15:03:43 | FromGitter | <narimiran> iosevka here (once you get used to its narrowness) |
15:04:05 | leorize | same here :) |
15:04:28 | * | stefanos82 quit (Remote host closed the connection) |
15:05:12 | Araq | F# moved from under_scores to fooBar iirc |
15:05:23 | FromGitter | <alehander42> I liked the monaco font before |
15:05:53 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
15:06:12 | FromGitter | <alehander42> @narimiran I tried to add an overview in https://news.ycombinator.com/item?id=18560497 ping me if you think it should be fixed |
15:06:43 | FromGitter | <mratsim> Apparently there is a mono font called Nimbus :D - https://en.wikipedia.org/wiki/Nimbus_Mono_L |
15:06:43 | FromGitter | <alehander42> I am not sure about the links: many people put them in `[i]` on HN |
15:07:26 | FromGitter | <narimiran> @alehander42 your links are fine the way they are now |
15:08:18 | * | endragor joined #nim |
15:08:32 | Araq | https://whatheco.de/2011/02/10/camelcase-vs-underscores-scientific-showdown/ |
15:08:36 | * | Snircle_ joined #nim |
15:08:39 | * | dom96_w joined #nim |
15:09:00 | FromGitter | <alehander42> which reminds me, @andreaferretti if I add something like the patty's `variant` macros to gara, maybe I should move the lib to an org where more people can maintain/improve it? (e.g. you or somebody else interested) |
15:09:35 | FromGitter | <zetashift> I use iosevka too, and didn't F# switch because of the C# styleguide? |
15:11:21 | FromGitter | <mratsim> @Araq, how do you measure programmer performance? I don’t have a `rdtsc()` clock in my head :P |
15:11:47 | * | Snircle quit (Ping timeout: 240 seconds) |
15:12:26 | * | endragor quit (Ping timeout: 244 seconds) |
15:14:36 | FromGitter | <mratsim> https://www.computer.org/csdl/proceedings/icpc/2010/4113/00/4113a196-abs.html |
15:15:01 | FromGitter | <mratsim> `While results indicate no difference in accuracy between the two styles, subjects recognize identifiers in the underscore style more quickly.` |
15:15:19 | FromGitter | <zacharycarter> Araq - thank for the explanation regarding the exceptions in Java / Nim vs C++ destructors and what the argument was about |
15:17:04 | Araq | mratsim: it's not about "recognizing" identifiers though. it's about "mental tokenization", which I claim is MUCH better with camelCase |
15:17:52 | Araq | it's the point of camelCase to "compress" the identifier so that the structure is more visible |
15:18:26 | FromGitter | <alehander42> a-b is absolutely more visible |
15:18:34 | FromGitter | <mratsim> not in my experience, I read faster the underscores while I spend mental energy to separate words in camelCase |
15:18:36 | FromGitter | <alehander42> but I think nobody can win in those discussions |
15:18:42 | FromGitter | <alehander42> that's why conventions exist |
15:18:55 | Araq | that's also why we use 'i' for iteration variables and not 'counter' |
15:19:47 | FromGitter | <alehander42> because of convention, not because they are short |
15:19:51 | FromGitter | <alehander42> if you write y |
15:19:57 | FromGitter | <alehander42> it would be more confusing than index |
15:20:16 | Araq | the convention emerged because shortness is a virtue |
15:20:37 | FromGitter | <alehander42> it depends |
15:20:43 | * | dom96_w quit (Changing host) |
15:20:43 | * | dom96_w joined #nim |
15:20:47 | FromGitter | <alehander42> in limited local contexts yes |
15:20:56 | FromGitter | <alehander42> but you wouldn't call a global constant i |
15:21:11 | dom96_w | wow, C++'s behaviour when it comes to assigning int to a string is incredibly subtle |
15:21:50 | FromGitter | <zacharycarter> the whole lack of resource closing in the stdlib though - if true - is troubling |
15:22:39 | FromGitter | <zacharycarter> I know that I personally haven't been affected by too many - at least not that I know of |
15:22:54 | Araq | "if true" we would have bug reports about them and would fix them... |
15:23:17 | FromGitter | <zacharycarter> yeah - that's where my head is at too |
15:23:56 | FromGitter | <alehander42> Araq: the prototype ref nil checking works so well, I am busy fixing one of my own projects |
15:24:22 | Araq | lol, did you base it on my dfa.nim? |
15:24:51 | FromGitter | <alehander42> not yet, but I plan to maybe reuse the cfg ideas |
15:25:25 | Araq | then how does it work? |
15:26:37 | FromGitter | <alehander42> currently I am directly doing it on the AST(I know: not sound), but I wanted to just test that the thing I have in mind works |
15:27:17 | Araq | you can make it sound with the AST too |
15:27:36 | FromGitter | <mratsim> woooooww a Wild comment by @Araq in 2009: http://yosefk.com/blog/ihatecamelcase.html#comment-258 |
15:28:55 | Araq | that must have been a long time ago |
15:29:30 | FromGitter | <alehander42> Araq: maybe. for loops I use the check 0 1 and 2 iterations idea from the paper you linked |
15:29:45 | FromGitter | <alehander42> instead of some kind of fixpoint analysis |
15:31:57 | FromGitter | <alehander42> I might upload a simple WIP commit later |
15:36:06 | * | narimiran joined #nim |
15:44:32 | FromGitter | <alehander42> btw is `isNil` magic, somehow like `echo` etc? what I mean is, can I be sure it's not somehow overloaded |
15:45:16 | * | stefanos82 joined #nim |
15:48:10 | Araq | obviously not, but overloaded syms don't have .magic = mIsNil |
15:51:29 | FromGitter | <alehander42> aha, that's what I have to check! |
15:51:55 | * | abm quit (Quit: Leaving) |
15:52:21 | FromGitter | <alehander42> and probably mAnd and mOr too etc |
15:53:41 | Araq | yup |
15:54:04 | FromGitter | <zacharycarter> @alehander42 - is this for the language you're writing with Nim? |
15:56:56 | FromGitter | <alehander42> ahh now genMagic makes sense |
15:59:01 | livcd | dom96_w: btw what do you do @ FB ? |
15:59:08 | * | endragor joined #nim |
15:59:43 | * | deathpoison quit (Quit: Leaving.) |
16:00:05 | FromGitter | <alehander42> @zacharycarter no, I am trying to catch usage of possibly nil refs on compile time in the nim compiler |
16:01:51 | * | seni joined #nim |
16:07:40 | * | endragor quit (Ping timeout: 268 seconds) |
16:13:00 | * | abm joined #nim |
16:25:21 | * | nsf joined #nim |
16:25:56 | Araq | yay, somebody destroyed my ID mechanism in the compiler |
16:26:59 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:31:58 | * | dom96_w joined #nim |
16:34:32 | * | seni quit (Quit: Leaving) |
16:37:23 | FromGitter | <zetashift> if I have an identifier in foo.nim that clases with a identifier in system.nim, how can I force the one in foo.nim? |
16:37:24 | FromGitter | <arnetheduck> I have to wonder.. if someone added up all the time spend by developers discussing the relative merits of camel and underscore case, whether the minimal difference in "parsing speed" would come even close to make up for it |
16:38:14 | leorize | zetashift: `foo.<identifier>` |
16:38:25 | leorize | the compiler would complain if you don't qualify it anyway |
16:38:54 | FromGitter | <zetashift> mhmhm I tried that but I still get the identifier not found |
16:39:06 | FromGitter | <alehander42> is it exported |
16:39:34 | narimiran | that no export by default has bitten me sooooo many times! |
16:39:46 | FromGitter | <zetashift> yea it even shows up in auto-complete but it still isn't working |
16:42:14 | FromGitter | <zetashift> fixed it, need to read on the `export` keyword better my bad |
16:48:25 | * | dom96_w quit (Changing host) |
16:48:25 | * | dom96_w joined #nim |
16:48:47 | dom96_w | Perhaps it would make sense to create a PR for style insensitive search for ripgrep |
16:53:09 | narimiran | dom96_w: i was thinking about that. this might end, ok maybe not all, but half of the comments :) |
16:53:44 | dom96_w | yeah, the remainder will require Nim plugins to add a "style insensitive" option to IDEs/editors which should be fairly trivial |
16:54:28 | narimiran | and when that is solved, "why whitespace significant" commentators will rise once again! :P |
16:56:14 | * | Trustable joined #nim |
16:56:47 | narimiran | btw, now we have 32 players on our leaderboard! (few hours ago it was 18) |
16:57:01 | dom96_w | awesome |
16:57:19 | dom96_w | btw I think it might be a good idea to update the blog post to clarify what "fastest" means |
16:58:09 | narimiran | ok, i've commented on HN, we can add a clarification in our post if you think it is needed (i think it is clear, but i'm biased) |
17:03:00 | FromGitter | <alehander42> I don't really think that all tools understanding how to grep nim would be enough |
17:03:21 | FromGitter | <alehander42> people mostly complain it seems strange/confusing |
17:03:34 | FromGitter | <alehander42> this will never be completely fixed |
17:03:41 | FromGitter | <alehander42> its the same with python indentation |
17:04:07 | narimiran | there is one comment on HN posted recently about how this is because we are used to other languages so we think that is the way it should be |
17:04:18 | FromGitter | <alehander42> maybe the most succesful language of the last 25 years(+ java) and people still dislike indentation often |
17:04:41 | narimiran | https://news.ycombinator.com/item?id=18560991 |
17:04:50 | Amun_Ra | \\\\\\ |
17:05:11 | narimiran | Amun_Ra: ////// |
17:05:19 | FromGitter | <alehander42> so adding grepability would be great, but the goal should be to decrease the comments to e.g. 10-20% max, they would be always some |
17:06:01 | Araq | really? that should be the goal? why not make them program in Nim because it has the best lib ecosystem |
17:06:16 | Araq | like AI experts are kinda forced into Python |
17:07:14 | FromGitter | <alehander42> well duh |
17:07:18 | FromGitter | <alehander42> obviously |
17:09:03 | FromGitter | <alehander42> but you can be sure people using python spent mandecades arguing indentation on similar threads |
17:09:27 | FromGitter | <zetashift> still probably are but people accept it cause python is almost everywhere now |
17:09:41 | Araq | and in the meantime JS got Coffeescript |
17:10:06 | FromGitter | <alehander42> yes, and people started making this ecosystem because python people managed to defend the indentation story and to convince them it's fine |
17:10:55 | FromGitter | <alehander42> my point was exactly this: there would be always such comments, the goal should be for them to be minority compared to discussion o fbetter stuff |
17:11:08 | Araq | ok, so "defend your ground" is what you are saying? |
17:11:19 | dom96_w | That is certainly what I am saying |
17:11:50 | dom96_w | It's significantly different when you've got people being skeptical and silence, vs. people being skeptical and being told why we disagree |
17:13:59 | FromGitter | <alehander42> that's my point, but + "don't expect that these comments would stop in the next 20 years: they just might decrease" |
17:14:32 | * | zakora joined #nim |
17:14:58 | dom96_w | In other news: https://blog.golang.org/go2-here-we-come |
17:15:19 | dom96_w | narimiran: what do you think about an article on nim-lang.org titled "Go 2 is already here... it's called Nim" ? :P |
17:16:04 | Araq | dom96_w, common wisdom says it's bad marketing to play down your competitors |
17:16:42 | FromGitter | <alehander42> yeah :D and you wouldn't want a crowd of people suspicious of generics |
17:17:54 | narimiran | dom96_w: lol :) |
17:17:56 | FromGitter | <alehander42> maybe "Comparing Nim and Go 2", something neutral, there are interesting points e.g. contract proposal vs concepts |
17:18:28 | narimiran | be prepared for "Nim 1.0 is already here...." ;) |
17:19:55 | narimiran | but generally, i think our blog on nim-lang.org should have more frequent posts (and i plan to work on that) |
17:20:37 | * | PMunch quit (Remote host closed the connection) |
17:24:37 | dom96_w | Araq: is it? Most major brands do it frequently |
17:24:51 | dom96_w | When Apple killed the headphone jack every company started making fun of them |
17:24:59 | dom96_w | only to kill the headphone jack next year... |
17:26:56 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
17:27:15 | FromGitter | <alehander42> this decision was sad and the way samsung follow the trend is also very sad |
17:27:33 | FromGitter | <mratsim> You can do AI in R, C or C++. I’m sure you will complain about either the weird syntax or the lack of Numpy |
17:28:27 | FromGitter | <alehander42> it doesn't matter if other brands do it, we don't want to diss other languages |
17:29:17 | FromGitter | <alehander42> do you want to see "Nim 1 already here, it's called Crystal, leave Nim" tomorrow? |
17:29:54 | Xe | stuff like that feels like https://write.as/ieefrdfdnanwtz9d tbh |
17:38:58 | * | Ven`` joined #nim |
17:39:26 | serialdev[m] | Regarding AI aswell python is great for research/model but awful at productionizing it |
17:40:05 | serialdev[m] | just look at the mess that is tensorflow its soooo much unnecesary crud for most usecases that most likely will never need a distributed system |
17:40:17 | serialdev[m] | I feel like Nim could be that performance sugar |
17:40:36 | serialdev[m] | and also the best constrained embedded language for AI |
17:42:12 | FromGitter | <zetashift> I'm doing kaggle stuff with python which is working well, I've been meaning to try arraymancer/pytorch so I can use nim but it feels daunting mainly because the documentation(or lack thereof) |
17:48:27 | * | druonysus quit (Quit: No Ping reply in 180 seconds.) |
17:48:40 | narimiran | @zetashift @mratsim is also kaggler, but IIRC he didn't yet use his arraymancer on kaggle |
17:49:35 | FromGitter | <mratsim> my main issue with Arraymancer for Kaggle is not documentation but tooling |
17:49:58 | FromGitter | <mratsim> Especially dataframe tooling |
17:50:09 | * | druonysus joined #nim |
17:50:21 | FromGitter | <mratsim> i.e. if I have a bunch of path to images in a CSV, currently it’s hack and dirty solution |
17:50:32 | FromGitter | <zetashift> there is NimData right? |
17:50:45 | FromGitter | <mratsim> also saving models and recursive NN models |
17:51:35 | FromGitter | <mratsim> but to be fair, Keras is awful for actual load from disk workflow as well: https://github.com/mratsim/Amazon-Forest-Computer-Vision/blob/master/src/k_dataloader.py |
17:51:58 | FromGitter | <mratsim> 270 lines for a lazy loader, vs PyTorch 60 lines: https://github.com/mratsim/Amazon-Forest-Computer-Vision/blob/master/src/p_dataload.py |
17:52:13 | FromGitter | <mratsim> and this was with PyTorch 0.1 so ages ago |
17:53:22 | narimiran | solving *any* kaggle task (even just titanic or minst) in nim/arraymancer would already be a success, and something to write home about |
17:54:25 | FromGitter | <mratsim> I don’t think NimData can support this kind of aggregate at the moment: https://github.com/mratsim/home-credit-default-risk/blob/master/src/feature_engineering/fte_pos_cash.py#L37-L48 |
17:54:54 | FromGitter | <mratsim> MNIST is done ;), Titanic is so much harder without a complete dataframe |
17:55:10 | narimiran | done? is it published somewhere? |
17:56:05 | FromGitter | <zetashift> wasn't MNIST one of the examples? |
17:56:11 | FromGitter | <zetashift> of arraymancer* |
17:57:11 | FromGitter | <mratsim> yes, here: https://github.com/mratsim/Arraymancer/blob/master/examples/ex02_handwritten_digits_recognition.nim |
17:57:38 | narimiran | oh, i've missed it completely, sorry |
17:57:47 | FromGitter | <mratsim> but yeah I need something to output a result CSV |
17:57:55 | FromGitter | <mratsim> Also at least an XGBoost wrapper |
17:58:56 | FromGitter | <mratsim> but right now I’m working on the low level backend for a while. |
17:59:28 | FromGitter | <mratsim> it’s been gnawing at me since about May when I implemented RNNs. |
18:03:15 | FromGitter | <mratsim> ah for regular ML I also need one-hot encoding. Sparse matrix support would be nice as well to avoid exploding RAM. |
18:05:01 | serialdev[m] | yeah might pick arraymancer for some kaggle too to see if I can spot some stuff to add |
18:05:17 | serialdev[m] | but once its all solid |
18:05:22 | serialdev[m] | we should do a nim-lang group |
18:05:31 | serialdev[m] | and compete see if we can get near the top spots |
18:06:21 | FromGitter | <mratsim> data viz is of course missing as well: either via Nim-plotly or I started something with Vega as it looked promising: https://github.com/numforge/monocle |
18:07:17 | narimiran | serialdev[m]: i haven't been on kaggle in a lot of time so things might have change, but even participating in something that isn't python/R would, i guess, already draw some attention |
18:11:44 | serialdev[m] | yeah |
18:11:55 | serialdev[m] | the higgs boson challenge was won by a guy |
18:12:04 | serialdev[m] | using common lisp on his own library |
18:12:10 | serialdev[m] | so its doable |
18:12:31 | FromGitter | <unreadable> hey, how is the nim support for calling cpp code? |
18:12:41 | FromGitter | <unreadable> i'm trying to bind this https://github.com/uNetworking/uWebSockets |
18:15:52 | * | Vladar quit (Read error: Connection reset by peer) |
18:16:39 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:18:21 | Araq | unreadable: just use jester instead |
18:18:59 | Araq | this thing reads like a workaround for the lack of a good macro system |
18:19:20 | * | Ven`` joined #nim |
18:19:29 | * | Jesin joined #nim |
18:26:32 | FromGitter | <unreadable> does jester include websockets? |
18:30:34 | Araq | websockets are available as a nimble package |
18:33:53 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
18:34:59 | FromGitter | <unreadable> ok, thanks! |
18:35:00 | * | nsf quit (Quit: WeeChat 2.3) |
18:46:03 | * | Vladar joined #nim |
18:48:44 | * | Ven`` joined #nim |
18:57:00 | blarghz[m] | Is this a bug? |
18:57:05 | * | blarghz[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/gdaQwtojjcQjDTlZbsVJkZnZ > |
18:57:21 | blarghz[m] | (I saw https://github.com/nim-lang/Nim/pull/8711 ) |
18:59:20 | FromGitter | <zetashift> I don't think so since keys() is an iterator and toSeq only accepts openarrays |
19:00:33 | Araq | toSeq also accepts iterators, I think |
19:00:34 | FromGitter | <zetashift> whoops it's keys not keys() |
19:02:43 | narimiran | yes, `toSeq` accepts iterators too |
19:04:07 | FromGitter | <zetashift> ah okay. I do remember working with tables several times and once I had to do `toSeq(table.keys)` instead of `table.keys.toSeq` but I just shrugged it off as something I did wrong |
19:07:39 | FromGitter | <zetashift> found the piece `directions = toSeq(moves.keys) ` and changing it to `directions = moves.keys.toSeq` gives me the error `Error: type mismatch: got <Table[system.string, godotcoretypes.Vector2]> ⏎ but expected one of: ⏎ proc keys(self: Dictionary): Array ⏎ proc keys(self: Dictionary): Array` [https://gitter.im/nim-lang/Nim?at=5c0038fbced7003fe1a662a8] |
19:08:10 | Araq | that's documented, maybe read the docs |
19:09:13 | * | abm quit (Quit: Leaving) |
19:10:29 | FromGitter | <zetashift> well I did say "but I just shrugged it off as something I did wrong" just above that :P |
19:10:41 | FromGitter | <zetashift> Is it in the manual? |
19:11:10 | Araq | "limitations of the dot notation" |
19:11:39 | Araq | though actually it's a limitation of 'untyped' |
19:11:58 | Araq | can't typecheck untyped. maybe that's why it was named this way |
19:22:34 | * | m712 quit (Quit: bye-nyan!) |
19:27:37 | * | m712 joined #nim |
19:33:44 | blarghz[m] | Ah, so it's a known limitation. Thanks. I didn't see that part of the manual - sorry. |
19:34:08 | blarghz[m] | I only did a CTRL+F for "UFCS". |
19:34:31 | blarghz[m] | Which was a rookie error, given that I know Araq prefers "method call syntax" :) |
19:36:05 | * | nsf joined #nim |
20:01:14 | * | mavidser joined #nim |
20:01:58 | mavidser | hey. tryign to build nim 0.18 from source; can't see any build.sh to compile from there. |
20:02:02 | mavidser | am i missing something> |
20:02:08 | mavidser | s/>/? |
20:06:31 | Araq | the tar.xz or .zip has the build.sh, if you build from github, follow the github instructions |
20:07:36 | mavidser | Araq: yeah, there wasn't one to be found. readme.txt seems a bit outdated maybe? |
20:08:10 | mavidser | cuz readme.md tells me to clone csources repo and to use the build.sh there |
20:08:24 | * | Vladar quit (Remote host closed the connection) |
20:16:33 | FromGitter | <kayabaNerve> mavidser: 0.18 is a couple of versions old. If you need it, I recommend using choosenim |
20:18:05 | mavidser | ack. should have done that |
20:18:17 | mavidser | thanks |
20:40:01 | FromDiscord_ | <Armaldio> Hello everyone, |
20:40:01 | FromDiscord_ | <Armaldio> |
20:40:01 | FromDiscord_ | <Armaldio> Any way to have standalone nim compiler ? |
20:40:01 | FromDiscord_ | <Armaldio> Like I need to embed it as part of my tool but that could be usefull that the end-user doesnt have to install nim |
20:59:11 | FromGitter | <mratsim> import compiler |
20:59:23 | FromGitter | <mratsim> ah, mmmh not sure |
21:01:45 | FromGitter | <arnetheduck> Araq, another trivial seq bug for you: https://github.com/nim-lang/Nim/issues/9825 :) |
21:09:15 | * | tdc joined #nim |
21:20:44 | * | zakora quit (Quit: WeeChat 2.2) |
21:27:59 | * | nsf quit (Quit: WeeChat 2.3) |
21:33:14 | * | Trustable quit (Remote host closed the connection) |
21:43:22 | FromDiscord_ | <treeform> @Armaldio, you probably want some thing like nimscript, which is a scripting language that looks like nim that you could embed. |
21:43:42 | FromDiscord_ | <treeform> a nim compiler would require a C compiler to go with it too |
21:43:49 | FromDiscord_ | <treeform> and a bunch of other stuff, but it could be done |
21:45:57 | * | narimiran quit (Remote host closed the connection) |
21:46:48 | Araq | treeform: actually it's not "a bunch of other stuff", clang+Nim works and is pretty much free of dependencies |
21:47:06 | Araq | however, it is a huge package |
21:50:06 | FromGitter | <arnetheduck> how's the `tinyc` port doing these days? |
21:52:02 | Araq | I don't know, never found it reliable on windows |
22:04:14 | * | vlad1777d joined #nim |
22:19:38 | blarghz[m] | Stupid question: How can I do, for example, tuple unpacking at compile-time? |
22:19:43 | blarghz[m] | I read that `const (a, b) = (1, 2)` doesn't work because you can only do tuple unpacking with `var` and `let`. |
22:19:50 | blarghz[m] | But I don't understand how to use `static` now that it opens a new scope. (I saw the following pattern on some blog, but it no longer works). |
22:20:07 | * | blarghz[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/KpipyLxhnPUuZQHmYRlAvXcF > |
22:22:21 | * | Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:31:29 | Araq | dunno, it doesn't come up in "real" code :P |
22:31:34 | FromGitter | <kayabaNerve> What do you guys think about having .. also work for countdown? |
22:31:40 | FromGitter | <kayabaNerve> Currently it's a NOP |
22:31:55 | Araq | it must stay a nop. reason: basic logic. |
22:32:03 | FromGitter | <kayabaNerve> I personally think it should work for both and if you want the NOP behavior, you should type out countup. |
22:32:16 | FromGitter | <kayabaNerve> Araq: I read .. as "to". |
22:32:23 | FromGitter | <kayabaNerve> 0 to 5 is just as logical as 5 to 0. |
22:32:45 | Araq | for i in 0..x.len-1 # ok, thanks for iterating from -1 to 0 when x is empty. |
22:33:23 | FromGitter | <kayabaNerve> So it isn't so much as the logic of the .. itself but how it's used. |
22:33:38 | Araq | yeah, it's currently used because it works. |
22:34:02 | FromGitter | <kayabaNerve> I would just say "move to ..<" which would remain as countup(). :P |
22:34:15 | FromGitter | <kayabaNerve> It's already a breaking change. |
22:34:28 | FromGitter | <kayabaNerve> That said, I do understand less breaking is better than more breaking. |
22:34:41 | FromGitter | <kayabaNerve> I also understand I am not everyone nor the BDFL. :P |
22:35:43 | Araq | you are not even yourself |
22:36:13 | FromGitter | <kayabaNerve> What do you mean? |
22:36:22 | Araq | let a = parseInt(stdin.readLine); let b = parseInt(stdin.readLine) |
22:36:39 | Araq | for i in a..b # iteration order is a runtime thing and depends on the inputs |
22:36:56 | Araq | # that was never useful for anybody in the entire history of computing. |
22:37:02 | FromGitter | <kayabaNerve> Yes. That's why this is a breaking change. It turns a NOP into an OP. |
22:37:15 | FromGitter | <kayabaNerve> Then why does countdown exist? |
22:37:19 | Araq | it's not a breaking change. it's pure madness. |
22:37:19 | FromGitter | <kayabaNerve> It does have uses. |
22:37:32 | Araq | countdown vs countup is a static, compile-time choice |
22:37:39 | FromGitter | <kayabaNerve> The reason I'm bringing it up is because of reverse array iteration. |
22:37:53 | Araq | your proposal turns the choice to runtime. that's not only useless, it's harmful |
22:38:49 | FromGitter | <kayabaNerve> I believe it's harmful as a breaking change but not harmful as a change. |
22:39:10 | Araq | I believe you don't understand your own proposal. |
22:39:35 | FromGitter | <kayabaNerve> `..` still reads as "to". You can still have the NOP behavior by explicitly typing countup. It allows .. to be used wherever countdown can be used. |
22:39:42 | FromGitter | <kayabaNerve> I believe I have. |
22:39:53 | FromGitter | <kayabaNerve> *I do. |
22:40:56 | * | abm joined #nim |
22:47:26 | FromGitter | <mratsim> I’d rather introduce `<—` for countdown :D, that will break my libs to have random order |
22:48:01 | FromGitter | <mratsim> often I have for i in a ..< b: relying that I will not enter the loop if b < a |
22:48:35 | FromGitter | <mratsim> otherwise @alehander42 @araq “Productionized” JIT showing off Nim metaprogramming for the X86 opcode tables: https://github.com/numforge/laser/blob/master/laser/photon_jit/x86_64/x86_64_ops.nim |
22:57:00 | FromGitter | <arnetheduck> for all the claims of inclusive ranges being so hot, it's funny how popular `..<` remains ;) |
22:59:29 | * | rockcavera quit (Remote host closed the connection) |
23:01:23 | * | rockcavera joined #nim |
23:06:17 | FromGitter | <mratsim> I’m about 80% exclusive and 20% inclusive. I did stumble upon weird hacks in Python code due to exclusive ranges |
23:07:34 | FromGitter | <kayabaNerve> @mratsim I don't want to change ..< at all :P It read as to less than. If X is greater than Y, it went past that. |
23:08:04 | FromGitter | <kayabaNerve> I would like a secondary operator since `..` is a breaking/contentious change. |
23:08:16 | FromGitter | <kayabaNerve> My question is why <- over -- lol |
23:08:50 | FromGitter | <kayabaNerve> It's closer to .., Nim doesn't use it, and it still clearly communicates countdown |
23:09:09 | Araq | arnetheduck: I never claimed they are "hot", they are more expressive, logical and symmetrical. |
23:10:19 | Araq | and if you wanna improve the situation even moreso, argue for 1 based indexing ;-) |
23:10:44 | FromGitter | <kayabaNerve> @arnetheduck ..< is inclusive of the first arg, exclusive of the second. |
23:10:54 | FromGitter | <kayabaNerve> Araq oh god please no |
23:11:02 | FromGitter | <kayabaNerve> 0 makes sense. It should be 0. |
23:12:03 | FromGitter | <kayabaNerve> It's not even a comment the "first" element. It's about pointers and offsets. I feel people who support 1 based indexing are building toy langs for n00bs or don't understand the underlying concepts. |
23:14:41 | FromGitter | <arnetheduck> @Araq well, with 1-based indexing they'd actually begin to make sense :) because b-a would at least give you the number of elements |
23:15:52 | Araq | I bought tickets, they are numbered from 5 to 8. that's 8-5+1 = 4 tickets. |
23:16:10 | Araq | in your world the tickets are numbered from 5 to 9 exclusively. |
23:16:18 | Araq | it makes no sense... |
23:16:37 | Araq | you don't have a ticket with the number 9. |
23:17:02 | Araq | but whatever. teaching programmers basic math is impossible |
23:17:49 | FromGitter | <arnetheduck> I sold 4 tickets starting at #5. the next one I sell should be 9. makes perfect sense. |
23:18:36 | FromGitter | <arnetheduck> http://carlosfernandezgallardo.com/wp-content/uploads/2014/07/6o9.png |
23:26:19 | * | stefanos82 quit (Remote host closed the connection) |
23:26:20 | * | federico3 quit (Remote host closed the connection) |
23:27:06 | * | Calinou quit (Remote host closed the connection) |
23:27:29 | * | federico3 joined #nim |
23:28:15 | * | Calinou joined #nim |
23:32:21 | FromGitter | <brentp> from a c-api, I have a pointer to a `char *` that has effectively `$n` fixed-length strings where some are `\0` padded to make up length. whats the fastest way to get this into `seq[string]`? |
23:32:39 | FromGitter | <brentp> it seems that `cStringArray` does not really apply here. |
23:37:09 | FromGitter | <kayabaNerve> Iterate over each element and add them to the seq. To convert from a cstring to a string, use $. |
23:37:32 | FromGitter | <kayabaNerve> Since you know the amount, you can call newSeq and set each element instead of adding them. |
23:46:19 | FromGitter | <brentp> yeah. ok. basically doing that. thought I might be able to split and just rely on null termination. |
23:47:10 | * | zachk joined #nim |
23:47:36 | * | zachk quit (Changing host) |
23:47:36 | * | zachk joined #nim |