00:09:44 | * | stefanos82 quit (Quit: Quitting for now...) |
00:24:00 | * | rayman22201 joined #nim |
00:25:49 | * | rayman227 quit (Ping timeout: 260 seconds) |
00:54:26 | FromGitter | <kayabaNerve> Yep |
00:54:31 | FromGitter | <kayabaNerve> Or .int32 |
00:54:43 | FromGitter | <kayabaNerve> Or ((int32) 128) |
00:54:49 | FromGitter | <kayabaNerve> Or int32 128 |
01:04:13 | AlexMax | What is #? |
01:04:37 | AlexMax | The unofficial FAQ mentions this as a way to convert your tabs to spaces before compiling |
01:04:40 | AlexMax | #? replace(sub = "\t", by = " ") |
01:05:10 | AlexMax | doing a search for it in the manual comes up with 0 results and it's ungoogleable |
01:06:01 | FromGitter | <kayabaNerve> AlexMax: `#?` or `#` |
01:06:05 | FromGitter | <kayabaNerve> `#` is a comment... |
01:06:32 | AlexMax | #? |
01:07:14 | FromGitter | <kayabaNerve> https://forum.nim-lang.org/t/2105 |
01:07:20 | FromGitter | <kayabaNerve> This says try #! |
01:08:19 | FromGitter | <kayabaNerve> https://nim-lang.org/docs/filters.html |
01:08:54 | FromGitter | <kayabaNerve> That says it's ⏎ `#? replace("\t", " ")` |
01:08:59 | * | endragor joined #nim |
01:09:44 | AlexMax | ah there we go |
01:13:44 | * | endragor quit (Ping timeout: 256 seconds) |
01:17:25 | * | thomasross__ joined #nim |
01:20:01 | * | thomasross_ quit (Ping timeout: 248 seconds) |
01:40:32 | * | abm quit (Ping timeout: 268 seconds) |
01:43:47 | FromGitter | <kayabaNerve> AlexMax #! or #? :P |
01:46:37 | FromGitter | <kayabaNerve> #? got it |
01:49:42 | * | rayman219 joined #nim |
01:52:24 | * | rayman22201 quit (Ping timeout: 256 seconds) |
01:52:27 | * | rayman292 joined #nim |
01:54:06 | * | rayman219 quit (Ping timeout: 256 seconds) |
02:17:38 | * | have joined #nim |
02:19:07 | * | have quit (Killed (Sigyn (Spam is off topic on freenode.))) |
02:26:25 | * | Jesin quit (Read error: Connection reset by peer) |
02:26:38 | * | Jesin joined #nim |
02:40:09 | * | vivus joined #nim |
02:57:16 | * | vivus quit (Quit: Leaving) |
03:11:14 | * | chamar joined #nim |
03:13:50 | * | endragor joined #nim |
03:15:22 | * | chamar quit (Read error: Connection reset by peer) |
03:46:01 | * | dddddd quit (Remote host closed the connection) |
03:57:19 | * | deepend- is now known as deepend |
03:58:25 | * | Slade14 joined #nim |
03:58:51 | * | Slade14 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
04:22:49 | * | stefanos82 joined #nim |
04:23:36 | * | BitPuffin quit (Remote host closed the connection) |
04:32:40 | * | rayman22201 joined #nim |
04:35:27 | * | rayman292 quit (Ping timeout: 240 seconds) |
04:44:48 | * | nsf joined #nim |
04:52:34 | * | floppydh quit (Remote host closed the connection) |
04:53:18 | * | floppydh joined #nim |
05:23:21 | * | kspencer7 joined #nim |
05:23:25 | * | kspencer7 quit (K-Lined) |
05:23:30 | FromGitter | <gogolxdong> any wrong with this getmac.nim snippet , result is imcomplete network interface ip with only high 8 bits for each. http://ix.io/1jGS |
05:24:22 | FromGitter | <gogolxdong> incomplete. |
05:28:50 | * | macky joined #nim |
05:28:54 | * | macky quit (K-Lined) |
05:42:34 | * | gmpreussner quit (Ping timeout: 260 seconds) |
05:45:11 | FromGitter | <alehander42> how to create a set from seq |
05:45:20 | FromGitter | <alehander42> toSet ? |
05:48:34 | * | gmpreussner joined #nim |
05:56:06 | FromGitter | <alehander42> @Araq are they init string = "" and seq = @[] |
05:56:10 | FromGitter | <alehander42> going to apply to js backend |
05:56:50 | FromGitter | <alehander42> it would be bad for reusing code if they don't ( and I doubt it can have a significant slowdown effect on js) |
06:02:47 | * | floppydh quit (Remote host closed the connection) |
06:03:59 | * | floppydh joined #nim |
06:08:43 | * | stefanos82 quit (Quit: Quitting for now...) |
06:18:33 | * | cods11 joined #nim |
06:19:26 | * | cods11 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
06:26:38 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6bde9e2a8e6c60839b877d] |
06:32:35 | * | ng0 joined #nim |
06:41:50 | FromGitter | <timotheecour> help needed: I have a bunch of PR's in backlog and would like them merged if there are no further concern, see https://github.com/pulls?utf8=%E2%9C%93&q=is%3Apr+author%3Atimotheecour+sort%3Aupdated-desc+is%3Aopen+org%3Anim-lang the most urgent one is https://github.com/nim-lang/Nim/pull/8584 which fixes a number of issues, and on which other PR's in my backlog depend (to, in turn, fix a number of pre-existing |
06:41:50 | FromGitter | ... issues) |
06:45:05 | * | yglukhov[i] quit (Ping timeout: 240 seconds) |
06:45:23 | FromGitter | <felipetesc> hi there ! I'm wondering if any of you I cab use jester for production ???? |
06:48:05 | FromGitter | <gogolxdong> I used to , but it failed for unknown reason since not long ago, you can ask @dom96 |
06:48:52 | FromGitter | <gogolxdong> `var ip = inet_ntoa((castptr posix.Sockaddr_in (addr(buf[i].ifr_addr))).sin_addr)` |
06:49:19 | FromGitter | <gogolxdong> got this to get ipv4 address. |
06:51:17 | * | arecaceae quit (Remote host closed the connection) |
06:51:36 | * | arecaceae joined #nim |
06:51:59 | * | girvo quit (Ping timeout: 260 seconds) |
06:52:58 | FromGitter | <felipetesc> @gogolxdong ty ! |
06:54:17 | FromGitter | <gogolxdong> next step is to calculate the cumulative traffic during interval for each interface. |
06:55:27 | FromGitter | <felipetesc> it seems a lot of code 4 something not so complicated |
07:00:25 | FromGitter | <gogolxdong> It's the same in C, interoperation with C is like that , you can wrap high level neat code based on what you got in Nim for such purpose. |
07:02:24 | * | Vladar joined #nim |
07:02:51 | FromGitter | <felipetesc> proc ipv4 = |
07:03:55 | * | girvo joined #nim |
07:06:33 | FromGitter | <gogolxdong> funny is I got it right in Nim, and cannot get it right in C. |
07:08:27 | FromGitter | <felipetesc> so, nim is actually making c better ! |
07:08:48 | * | PMunch joined #nim |
07:09:15 | FromGitter | <gogolxdong> definitely. |
07:19:16 | FromGitter | <gogolxdong> best part is leverage template and macro. |
07:37:03 | * | TheLemonMan joined #nim |
08:03:34 | * | gmpreussner_ joined #nim |
08:03:48 | * | gmpreussner quit (Ping timeout: 265 seconds) |
08:04:48 | FromGitter | <gogolxdong> we are going to improve some functionalities of IPFS, persistent storage, append only , always available and SLA for MVP. |
08:15:14 | * | lostlabyrinth16 joined #nim |
08:15:38 | * | lostlabyrinth16 quit (Remote host closed the connection) |
08:15:44 | * | yglukhov[i] joined #nim |
08:19:06 | FromGitter | <gogolxdong> Which c plugin do you usually use for C format? |
08:33:43 | FromGitter | <gogolxdong> in Vim. |
08:34:21 | TheLemonMan | clang-format |
08:34:56 | TheLemonMan | clang also ships with a nice plugin called clang-format.py |
08:36:49 | FromGitter | <gogolxdong> Try the following keystrokes: ⏎ ⏎ gg=G |
08:37:00 | FromGitter | <gogolxdong> this is amazing. |
08:38:31 | TheLemonMan | that works well until shit hits the fan, vim's C parser is not perfect :) |
08:39:44 | FromGitter | <gogolxdong> agreed. |
08:41:43 | * | Vladar quit (Remote host closed the connection) |
08:42:24 | * | Vladar joined #nim |
08:46:38 | * | abm joined #nim |
08:56:07 | TheLemonMan | Araq, small q about `quote` behaviour. I tried fixing #8573 by evaluating the user-supplied block in an empty scope but that breaks the json's `to` macro since it relies on the evaluation of `verifyJsonKind` from the outer scope. I think the whole call to `verifyJsonKind` should be quoted, what do you think? |
08:57:03 | Araq | I dunno, but I do know that 'evalOnce' keeps its declared variable from being gensym'ed because of Nim's template evaluation rules and it's bad |
08:57:35 | Araq | in general helper 'block's are always a hack around broken gensym behaviour |
08:58:07 | Araq | I should write a blog post about hygiene in a macro system... |
08:58:23 | Araq | and why these things are so fucking hard... |
08:58:41 | TheLemonMan | yeah, I discovered that the hard way but can't think of any other work-around beside rewriting mapIt as a macro |
08:59:28 | Araq | we need to introduce "staged" template evaluation for the 'fmt' macro. that would fix evalOnce() as a sideeffect |
08:59:56 | Araq | but first we need to fill in the holes in Nim's spec... |
09:02:04 | TheLemonMan | more yaks to shave, yay (?) |
09:03:59 | Araq | well I enjoy writing specs, you don't have to debug them :-) |
09:05:28 | TheLemonMan | unless you use latex for writing the specs, then you _also_ have to debug those :) |
09:10:57 | * | xet7 joined #nim |
09:12:11 | Araq | I keep wondering how many results in math and science are wrong due to typos that are just too hard to spot in Latex. I hope the number is 0, but I wouldn't bet on it. |
09:13:22 | Araq | news! Higgs boson debunked! the calculations were based on a typo in a latex document. |
09:13:55 | livcd | what if some are right just because of the typos :) |
09:15:37 | Araq | modified theory of relativity found! Crucial insights were lost in overfull hboxes. |
09:16:12 | FromGitter | <timotheecour> since u guys r discussing this, in #8584, i really don't like "ompiles((let _ = s))" as it could hide other issues |
09:17:32 | TheLemonMan | Fermat had an overfull margin but he didn't use latex, how do you explain this?! |
09:17:57 | Araq | Fermat was very ahead of his time. |
09:18:57 | FromGitter | <timotheecour> @lemonboy what do u mean by "Yep, but I can't think of a better way to shunt the bare openArray literals into the other code path" ? |
09:19:09 | TheLemonMan | hmm, you can't really quote anything but identifiers using backticks and I haven't been able to use any other `op` without getting an "invalid indentation" error |
09:20:15 | TheLemonMan | timotheecour: those should go in the `for x in <literal>` path in order to avoid the duplication of the literal (one for .len and one in the for) |
09:22:16 | dom96 | Araq: I worked with a guy at CERN who's father wrote /the/ book on LaTex (also worked at CERN) |
09:22:59 | dom96 | So I think the Higg's Boson is safe :P |
09:26:54 | Araq | ok, so fat people continue to have a good excuse. |
09:28:38 | FromGitter | <timotheecour> @TheLemonMan ok using a block works! thanks a bunch, much cleaner! |
09:30:54 | * | ecx86 joined #nim |
09:31:44 | * | ecx86 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
09:32:44 | FromGitter | <timotheecour> @thelemonboy for ur failing case, "[].mapIt(it)" I don't see how that could be valid, since what would be the type of that? (in nim , let a = @[] isn't legal) |
09:44:19 | FromGitter | <timotheecour> k, all comments addressed except "Yep, but I can't think of a better way to shunt the bare openArray literals into the other code path" ; not sure what's wrong with `type(s) isnot openArray` ? (also, we could improve after this PR unless u have a good suggestion?) |
09:46:31 | TheLemonMan | timotheecour, the openarray literal is substituted twice in the template |
09:48:02 | FromGitter | <timotheecour> i c... any suggestions? |
09:48:35 | TheLemonMan | `compiles((let _ = s))` :P I can't think of anything else right now |
09:48:50 | FromGitter | <timotheecour> on a related note, is there a macro for is_lvalue to test whether something is an LVALUE ? |
09:50:30 | FromGitter | <timotheecour> and 1 more question: not sure what's the state of move semantics: when does `let a = b` perform copy? cf @Varriount 's concern in a related scenario here: https://github.com/nim-lang/Nim/pull/8107#discussion_r197675748 "My only concern here is that if iter is an object (say, a table) the assignment will copy the entire structure, which may be quite expensive." |
09:51:06 | * | data-man quit (Quit: Konversation terminated!) |
09:54:09 | * | anderson1 joined #nim |
09:54:18 | * | anderson1 quit (Remote host closed the connection) |
09:54:26 | Araq | when it's provably the last read operation of 'b' |
09:55:04 | Araq | we have a broken dataflow analysis for this, but it's good enough for that one |
09:56:46 | FromGitter | <gogolxdong> Is there a solution to evaluate actual bandwidth between two peers? |
09:57:58 | * | dddddd joined #nim |
10:03:01 | TheLemonMan | timotheecour, the `compiles` should go in the `when` |
10:05:35 | * | data-man joined #nim |
10:06:44 | FromGitter | <timotheecour> do u mean: ⏎ when compiles(s.len) and compiles((let _ = s)): ... ⏎ else: |
10:06:56 | TheLemonMan | yep |
10:07:14 | FromGitter | <timotheecour> that seems suboptimal because i'll lead to reallocs in result.add op |
10:07:41 | FromGitter | <timotheecour> i mean the tests pass currently :-) |
10:08:33 | TheLemonMan | hm? how's that? |
10:09:59 | FromGitter | <timotheecour> `var result: seq[outType] = @[]; for a in ...; result.add op` leads to amortized O(log(n)) realloc calls |
10:10:24 | FromGitter | <timotheecour> vs a single alloc call if we know length ahead of time |
10:10:29 | * | krux02 joined #nim |
10:10:42 | TheLemonMan | meh, if you use bare openarray literals you deserve that :) |
10:11:15 | TheLemonMan | we know the length but we can't stash it somewhere and we don't want to duplicate it, there's no way out |
10:11:50 | FromGitter | <timotheecour> again, the tests pass as i wrote it (at least locally) and they seem to cover the edge cases we discovered; did u have another edge case in mind? |
10:12:05 | krux02 | TheLemonMan, there are no openarry literals |
10:12:44 | FromGitter | <timotheecour> i think he's referring to: `doAssert openArrayint ([1,2]).mapIt(it) == @[1,2]` |
10:12:51 | krux02 | openarray is just a way to pass consecutive data without copy |
10:13:32 | krux02 | well I don't know what openArrayint is |
10:13:40 | krux02 | but it is not a literal |
10:14:05 | krux02 | [1,2] is an array literal, tho other thing is a forced conversion |
10:14:20 | TheLemonMan | timotheecour, sure the tests are green, but you're sending `openArray[int]([1,2]).len ... for x in openArray[int]([1,2]):` to the codegen |
10:14:41 | krux02 | and to be honest, I think that assertion is wrong, because it ensures that ater map the type is explicity a seq |
10:14:46 | krux02 | I do not agree on that |
10:15:40 | krux02 | TheLemonMan, then I guess there is a template implemented incorrectly. |
10:15:50 | FromGitter | <timotheecour> i don't understand; what do u expect on RHS of "doAssert openArrayint ([1,2]).mapIt(it) == " ? |
10:16:22 | TheLemonMan | krux02, yes, that's what I was trying to say |
10:17:06 | krux02 | timotheecour: I would implement a test, that only checks for the length of the result and content, but not type. |
10:18:00 | krux02 | in functional programming, when you do ``map`` on something, you generally do not want it to secretly change the type of the collection |
10:18:24 | krux02 | there as cases where it does make sense to change the type of the collection though |
10:18:30 | krux02 | (I think) |
10:19:22 | krux02 | timotheecour: I would change the structure of thesting the content to a loop. |
10:19:35 | FromGitter | <timotheecour> well everything in sequtils returns a `seq` ; it's not really a module for `functional` programming; i was only fixing pre-existing bugs here; for functional programming (that operates lazily), that's addressed somewhere else |
10:20:33 | krux02 | no functional programming does not operate per se lazy |
10:20:38 | krux02 | haskell operatos lazy |
10:20:47 | krux02 | but haskell is not the definition of functional programming |
10:21:15 | krux02 | Scala and Ocaml are good non lazy functional programming languages, too. |
10:22:10 | FromGitter | <timotheecour> what's the concern with `doAssert openArrayint ([1,2]).mapIt(it) == @[1,2]` again? is that the fact it allocates ? if so, I was thinking of using something that doesn't allocate, like in D, using D's equals: ⏎ ⏎ `doAssert openArrayint ([1,2]).mapIt(it).equals [1,2]` ; was that ur concern ? |
10:27:03 | FromGitter | <timotheecour> anyhow, changing return type of `sequtils.mapIt` to something other than `seq` is definitely out of scope of this PR |
10:29:06 | FromGitter | <alehander42> @krux02 so what should happen if you map a set? you either make sure you get out a seq or you can get a smaller set |
10:31:05 | FromGitter | <timotheecour> again; everything in sequtils returns a `seq` ; for lazy variants of map, filter, etc, other modules can be used. |
10:31:45 | Araq | yup, what timotheecour said. btw is Timothee your first name? |
10:32:05 | * | xet7 quit (Remote host closed the connection) |
10:32:30 | FromGitter | <timotheecour> yup |
10:33:54 | krux02 | I thought it was Timo |
10:33:55 | * | clyybber joined #nim |
10:34:00 | krux02 | Timo the Courious |
10:34:08 | FromGitter | <timotheecour> lol |
10:34:37 | krux02 | :P |
10:35:08 | FromGitter | <alehander42> I agree, I just opposed the idea that seq is a bad return type :D |
10:35:53 | FromGitter | <alehander42> I wondered myself about that when initially creating zero-functional |
10:36:25 | FromGitter | <timotheecour> well, I'd like a module that returns an iterator instead of a seq for all map,filter,joiner,chain,etc operations, but that's blocked by this regression: https://github.com/nim-lang/Nim/issues/8188 |
10:39:02 | FromGitter | <alehander42> afaik @michael72 implemented something like that in zero-functional, but with additional hints |
10:41:39 | FromGitter | <timotheecour> no more hints needed! see https://github.com/zero-functional/zero-functional/issues/36#issuecomment-410977005 |
10:43:06 | FromGitter | <alehander42> oh nice, michael is really doing wonders |
10:43:11 | FromGitter | <alehander42> yeah i wondered about the to iter |
10:43:42 | * | clyybber2 joined #nim |
10:44:54 | FromGitter | <alehander42> js support is still pretty important tho for such a lib, the lack of support for closure iteratos there is a problem |
10:45:04 | * | clyybber quit (Ping timeout: 256 seconds) |
10:45:54 | FromGitter | <timotheecour> once stabilized, this should be stdlib material. lazy map/filter/etc FTW ! (NOTE: after that, sequtils's eager variants of map/etc could be simply wrappers around the lazy variants with (IIUC) 0 overhead: ⏎ `mapEager(a) = a.mapLazy.toSeq` do u guys agree? |
10:47:28 | FromGitter | <timotheecour> btw: I have an upcoming PR (not pushed yet) that'll support universal toSeq (would work with anything (both iterators and things that support for iteration), and support UFCS) |
10:49:36 | FromGitter | <timotheecour> @alehander42 is this js closure iterator missing tracked in github ? not seeing it here: https://github.com/nim-lang/Nim/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+javascript+closure |
10:50:38 | FromGitter | <timotheecour> other question: what does a js backend do that couldn't be done (more efficiently an potentially with less compatibility issues) via compilation to wasm ? |
10:51:50 | FromGitter | <mpcjanssen> @timotheecour manipulate the DOM efficiently? JS != wasm |
10:54:02 | FromGitter | <timotheecour> in the C++ world, emscripten solves this (see https://kripken.github.io/emscripten-site/docs/api_reference/html5.h.html ; I used it a bit) ; couldn't nim reuse all that since it can target C++? |
10:55:08 | * | clyybber2 quit (Ping timeout: 256 seconds) |
10:55:32 | FromGitter | <alehander42> @timotheecour well wasm is in early stages yet, it's a bit like "c backend vs x86_64 backend" |
10:55:36 | FromGitter | <mpcjanssen> that only exposes dom events not the whole dome itself |
10:55:54 | FromGitter | <alehander42> it's very important for interop with dom, all the other js libs/frameworks etc |
10:56:08 | FromGitter | <alehander42> and we honestly need our own wasm backend |
10:56:10 | FromGitter | <mpcjanssen> probably because it's used to update a WebGL canvas |
10:56:23 | FromGitter | <alehander42> because I can't imagine how would one debug a nim=>c=>ermscripten=>wasm thing |
10:56:30 | FromGitter | <alehander42> app* |
10:58:05 | * | spirit_pact joined #nim |
10:58:15 | krux02 | timotheecour: WASM is really just a compilation target that can be executed in the browser |
10:58:53 | FromGitter | <timotheecour> > that only exposes dom events not the whole DOm itself ⏎ ⏎ no that's just 1 page of the docs; u can access whole DOM, call other js functions, all the good stuff; i've tried and bit and it's powerful (and unbeatable in terms of efficiency compared to using js or even asm.js). |
10:58:57 | krux02 | alehander42: printf debugging |
11:00:14 | krux02 | well the talks on WASM say it it can't access the DOM, but they are working on it. |
11:00:29 | FromGitter | <timotheecour> so I don't see a `nim wasm file.nim` has someone tried `nim cpp file.nim` followed by `cpp to wasm`? |
11:00:35 | krux02 | I personally hope for a WASM compilation target outside of the browser. |
11:01:13 | FromGitter | <alehander42> @timotheecour I agree that a wasm backend would be very cool, but the js backend is important at least for 5+ more years until the wasm ecosystem starts to get actually mainstream |
11:01:23 | krux02 | I mean I want to have a wasm executable that is as portable as an mp3 music file, or an avi movie. |
11:01:29 | * | noonien joined #nim |
11:01:35 | TheLemonMan | Araq, so json's usage of quote is "dirty" as the unquoted pieces of the AST should be reported verbatim. Should we add "dirty" quotes or fix json with more direct AST manipulation? |
11:01:44 | FromGitter | <alehander42> @krux02 you write gdb tools, you know printf debugging is not enough :P |
11:02:13 | krux02 | I just wanted to answer your question :p |
11:02:47 | krux02 | but if you see how cumbersome the terminal gdb interface is, then you thing, well printf debugging isn't at all that bad. |
11:02:59 | * | miran joined #nim |
11:03:02 | FromGitter | <alehander42> @krux02 what do you think about https://github.com/nebulet/nebulet |
11:03:10 | FromGitter | <alehander42> ahh i got so used to it, i like it now |
11:03:36 | FromGitter | <mratsim> @metasyn, @cabhishek did a Nim talk at Netflix back in November iirc. ANd Windgo, Inc smart window company is using Nim for research: https://forum.nim-lang.org/t/3456 |
11:03:50 | FromGitter | <timotheecour> on that note, is there lldb debugging for nim? i onlt see defunct endb (too bad, had cool features), and gdb(for which im running into a number of issues, different from endb...) |
11:03:59 | * | spirit_pact quit (Ping timeout: 276 seconds) |
11:04:06 | FromGitter | <mratsim> also Beamdog software is using Nim for Neverwinter Nights 1 Enhanced Edition tooling: https://github.com/niv/neverwinter_utils.nim |
11:04:31 | FromGitter | <mratsim> @timotheecour if you compile with debugger:native lldb works not too bad |
11:04:47 | * | rwg9 joined #nim |
11:05:01 | krux02 | alehander42 that is for sure interesting. |
11:05:25 | krux02 | I really do like webassembly, even though I normally think everything from the web is like cancer. |
11:05:38 | FromGitter | <timotheecour> (eg, --debugger:endb stops before main, but not --debugger:gdb) |
11:06:35 | krux02 | timotheecour what is your issue with gdb? |
11:06:46 | krux02 | I usually do --debugger:native |
11:06:59 | krux02 | but that would be gdb |
11:07:19 | krux02 | I don't think there is a difference between lldb and gdb debug symbols in the program. |
11:07:48 | FromGitter | <mratsim> endb is not maintained anymore, iirc Araq is looking for someone to take over. |
11:07:52 | krux02 | then I run gdb with nim_gdb |
11:08:19 | krux02 | mratrsim: that "someone to take over" is not going to happen any time soon. |
11:08:29 | krux02 | I think it is more likely that it will be dropped entirely |
11:09:28 | krux02 | mratsim: So I would rather say endb is kind of abandoned in favor of gdb. |
11:09:39 | krux02 | (even though I really hate gdb debugging) |
11:09:52 | FromGitter | <timotheecour> that's kind of too bad (maybe), having an awesome debugging experience that sources back to sim code (with nim plugins etc) could be really useful |
11:10:10 | * | rwg9 quit (Ping timeout: 244 seconds) |
11:10:13 | krux02 | sim code? |
11:10:30 | krux02 | well I wrote a gdb plugin |
11:10:32 | FromGitter | <timotheecour> lol, typo |
11:10:39 | krux02 | you run it with nim_gdb |
11:10:59 | krux02 | nim-gdb I mean, sorry. |
11:11:59 | krux02 | it is in /path/to/Nim/tools/nim-gdb.py |
11:12:12 | zacharycarter[m] | Regarding - https://github.com/nim-lang/Nim/issues/8535 - I was looking into the compiler code last night and I'm not sure how this would best be achieved by doing something here? |
11:12:13 | zacharycarter[m] | https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1082 |
11:12:14 | zacharycarter[m] | Also - would I need to emit code to initialize these? |
11:12:46 | FromGitter | <alehander42> @timotheecour the product I am working in will also help with nim debugging, but it's not yet ready for a release |
11:13:09 | krux02 | alehander42 what are you working on? |
11:13:20 | FromGitter | <timotheecour> actually gdb debugging doesn't work at all for me (on OSX): ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c21d05ec2bc174fd50ed8] |
11:13:38 | FromGitter | <timotheecour> ( at least, endb gives me *something*) |
11:13:58 | krux02 | the most important part of a debugger is, it should make the program flow more visible, and gdb on the terminal does not do that |
11:14:12 | krux02 | i just puts more complexity on top, because you also have to learn gdb commands. |
11:14:34 | TheLemonMan | zacharycarter[m], have a look at ccgthreadvars.nim first |
11:14:46 | krux02 | what is your vesion of gdb? |
11:15:01 | zacharycarter[m] | TheLemonMan: will do |
11:15:03 | krux02 | normally apple ships acient versions of open source tools |
11:15:11 | zacharycarter[m] | thanks for looking into this issue btw too |
11:15:18 | krux02 | just to show off how awesome their tools are in comparison |
11:16:11 | FromGitter | <timotheecour> /Users/timothee/homebrew//bin/gdb v 8.1 |
11:16:13 | krux02 | timotheecour: can you past the result of ``gdb --version`` |
11:16:44 | FromGitter | <timotheecour> lldb is no better: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c229c2a8e6c60839d0fac] |
11:17:34 | FromGitter | <timotheecour> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c22cd67eb9f60feb7b8b5] |
11:17:53 | krux02 | that is new enough I guess |
11:18:01 | FromGitter | <timotheecour> ``` lldb --version ⏎ lldb-902.0.79.7 ⏎ Swift-4.1``` [https://gitter.im/nim-lang/Nim?at=5b6c22e9637ee66082c7f39a] |
11:18:17 | krux02 | but your problem is already at starting gdb |
11:18:31 | FromGitter | <codem4ster> hi all, I'm trying to make `nake build` in godot-nim project on Windows10 it said cannot find cl.exe first, then I add path cl.exe then it run vccexe and said cannot find `limits.h`. Found the limits.h file in several directories and added to `INCLUDE` env variable. In some of them it hangs forever and some of them it says things like this; ⏎ ⏎ ```code paste, see link``` |
11:18:31 | FromGitter | ... [https://gitter.im/nim-lang/Nim?at=5b6c23062a8e6c60839d12a4] |
11:18:33 | FromGitter | <timotheecour> `sudo gdb` also doesn't work |
11:19:09 | FromGitter | <codem4ster> may be you have any idea? |
11:19:39 | FromGitter | <codem4ster> `https://pragmagic.github.io/godot-nim/master/index.html` |
11:19:43 | krux02 | sorry I do not use Godot, nor Windows, nor nake |
11:20:42 | FromGitter | <timotheecour> @codem4ster did u try using mingw 's gcc installed via nim's finish.exe instead? (i had a PR that bootstraps Nim from source on windows) |
11:20:46 | FromGitter | <mratsim> @timotheecour, did you allow GDB/LLDB to attach to other processes? It’s a specific setup iirc |
11:21:20 | FromGitter | <codem4ster> @timotheecour how can I do that? |
11:21:40 | FromGitter | <timotheecour> yes, i've use gdb, lldb with other binaries, no problem there |
11:22:37 | * | natrys joined #nim |
11:23:17 | FromGitter | <mratsim> strange, I used lldb just yesterday with latest nim#develop without any issue. |
11:23:22 | FromGitter | <codem4ster> @timotheecour I don't know how to say to nake that use gcc instead of cl.exe :( |
11:23:40 | FromGitter | <timotheecour> @codem4ster see https://github.com/nim-lang/Nim/pull/8564/files (it links also to https://nim-lang.org/install_windows.html to get gcc from mingw from finish.exe from release prebuilt nim) |
11:24:18 | FromGitter | <timotheecour> @mratsim which OS? i'm in OSX right now |
11:24:46 | krux02 | codem4ster: does godot require nake to build your project? Normally Nim is compiled with nimble. |
11:25:02 | * | wildlander joined #nim |
11:25:20 | FromGitter | <mratsim> @timotheecour MacOS 10.13.6 |
11:26:00 | FromGitter | <timotheecour> does both gdb and lldb work, and what versiosn of these? |
11:26:23 | FromGitter | <codem4ster> yes it needs nake @krux02 |
11:26:49 | FromGitter | <mratsim> lldb-902.0.79.7, gdb didn’t try for a while |
11:29:18 | FromGitter | <timotheecour> @mratsim interesting, besides the above mentioned error for lldb (ImportError: cannot import name *remove*dead_weakref) it actually starts and i can do `r`; however how do u break on a NIM file? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c258ee9b96f2c98e48548] |
11:31:09 | * | tzekid joined #nim |
11:34:51 | FromGitter | <codem4ster> @krux02 it says at the end of build `direShell(["nimble", "c", ".."/"src"/"stub.nim", "-o:.."/"_dlls"/libFile])` ⏎ I think it uses also nimble |
11:45:57 | * | alefir joined #nim |
11:45:58 | * | alefir is now known as Guest449 |
11:46:25 | * | Guest449 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
11:48:58 | * | couven92 joined #nim |
11:50:31 | * | mcspud26 joined #nim |
11:50:31 | FromGitter | <mratsim> @timotheecour yeah the breakpoint is a hit and miss, sometimes it works but sometimes it doesn’t :/ |
11:51:44 | FromGitter | <mratsim> I have the same issue currently, but I remember being able to break properly when debugging big int division in stint |
11:51:54 | krux02 | I normally break with rbreak |
11:52:01 | krux02 | rbreak <funcname> |
11:52:24 | FromGitter | <mratsim> @krux02 but funcnames are mangled no? |
11:52:30 | krux02 | r is for regular expression, but the important part is that it doesn't require you to write the full function name |
11:52:49 | krux02 | so you can skipl the base64 hash part of tho name |
11:53:13 | FromGitter | <mratsim> nice tip |
11:53:32 | krux02 | so you can do rbreak on foobar and it will break on all functions containing foobar, so it works on generics, too |
11:54:41 | krux02 | I think it should be in the readme |
11:55:19 | FromGitter | <alehander42> you can easily complete the function name with tab too |
11:55:28 | FromGitter | <alehander42> so b funct.. also works fine |
11:55:38 | * | mcspud26 quit (Ping timeout: 255 seconds) |
11:55:39 | krux02 | there is somewhere a guide on how to debug nim. It lists all sorts of advices that I don't concider as debugging, and then in the end there is just mentions gdb slightly without going into good advices at all. |
11:56:03 | krux02 | alehander42: yes that works when you have one unique completion, |
11:56:22 | FromGitter | <alehander42> nope, with multiple completions too, you have to choose one of them |
11:56:23 | krux02 | but it doesn't help you to pick the version with the signature you are looking for |
11:56:30 | krux02 | rbreak is an easy way to break on all of them |
11:56:41 | FromGitter | <alehander42> well usually i dont want to do that :D |
11:56:52 | krux02 | well I do |
11:57:04 | FromGitter | <alehander42> btw who has problems with breakpoint reliability ? |
11:57:33 | krux02 | also nice, you can use the exportc pragma to control tho name of a function as it is seen from the debugger. |
11:57:36 | FromGitter | <alehander42> breaking on nim lines should work extremely correctly with the good line directives |
11:57:50 | FromGitter | <alehander42> yes I do this sometimes |
11:58:11 | krux02 | alehander42 what gdb frontend do you use? |
11:58:20 | FromGitter | <alehander42> well, CLI |
11:58:25 | krux02 | ok |
11:58:35 | krux02 | I use emacs, which is basically just cli |
11:58:43 | krux02 | plus some other windows |
11:58:52 | FromGitter | <alehander42> and for the project I am working on , I have built a custom gdb-compatible frontend too |
11:59:28 | krux02 | basically it is a gdb tui, but without the fuckups |
11:59:38 | krux02 | well, with some less fuckups. |
12:00:13 | FromGitter | <alehander42> I never have time to learn emacs |
12:00:28 | FromGitter | <alehander42> i dont know about gdb |
12:00:37 | FromGitter | <alehander42> but i ve heard a lot of good stuff about magit |
12:00:46 | ldlework | magit is the best git interface |
12:01:21 | FromGitter | <timotheecour> > you can use the exportc pragma to control tho name of a function ⏎ that seems like an undesirable workaround; it should work using file.nim:32 or nim_functon_name (not mangled) |
12:01:49 | ldlework | krux02: you should move your config to https://github.com/dustinlacewell/emacs-nougat |
12:02:50 | FromGitter | <alehander42> @timotheecour file.nim:32 should definitely work |
12:02:59 | FromGitter | <alehander42> if it doesn't please report an issue |
12:03:00 | FromGitter | <mratsim> by the way, how does exportc work with generic, can we use `{.exportc:”Fooname_” & $T.}` |
12:03:35 | FromGitter | <timotheecour> > Alexander Ivanov @alehander42 04:57 ⏎ > breaking on nim lines should work extremely correctly with the good line directives ⏎ ⏎ what do u mean ? do u mean adding to code `{.line xxx. }` ? if so, that's very unpractical [https://gitter.im/nim-lang/Nim?at=5b6c2d975ec2bc174fd5541b] |
12:04:04 | FromGitter | <alehander42> no, I mean that the compiler itself should produce `#line ..` correctly |
12:04:13 | FromGitter | <alehander42> with the right options |
12:04:17 | FromGitter | <alehander42> do you use `--lineDir:on` ? |
12:04:25 | FromGitter | <timotheecour> oups!! |
12:06:10 | FromGitter | <alehander42> i think `--debugger:native` should turn lineDir on anyway |
12:06:37 | FromGitter | <mratsim> but it does |
12:06:45 | FromGitter | <mratsim> it turns 2 flags |
12:06:59 | FromGitter | <alehander42> so, does somebody have issues with `path:line` breakpoints with the flags on ? |
12:07:12 | FromGitter | <mratsim> I’ll retry |
12:07:23 | krux02 | ldlework, I am confused, "Then anywhere within your outline you can include it" |
12:07:26 | krux02 | what outline |
12:07:35 | ldlework | krux02: the org outline |
12:07:44 | krux02 | what org outline? |
12:08:03 | ldlework | the idea is your config is an org-mode document that a) contains elisp blocks b) imports elisp blocks from the shared snippet library |
12:08:11 | ldlework | krux02: look in user-outlines/ |
12:08:15 | krux02 | my config file is elisp |
12:08:31 | krux02 | I don't plan to change that |
12:08:47 | ldlework | krux02: ok well saying "I don't want this" is different than the confusion you expressed. |
12:08:51 | ldlework | I was just answering your question. |
12:09:09 | ldlework | And obviously all emacs configuration is elisp. Orgmode is just a way to organize that elisp. |
12:09:28 | krux02 | well you said i should move my config to emacs-nougat |
12:09:45 | FromGitter | <mratsim> @alehander42 just —debugger:native is working for me at the moment with Nim devel from yesterday. |
12:09:52 | ldlework | krux02: yes? |
12:09:55 | FromGitter | <mratsim> I wonder if there was a regression mmm |
12:10:19 | krux02 | I just disagree on that |
12:10:26 | ldlework | That is clear. |
12:10:31 | krux02 | ok |
12:10:35 | krux02 | then everything is said |
12:10:39 | * | ldlework cringes. |
12:10:50 | krux02 | but sorry, I could have said it in the first place |
12:11:20 | FromGitter | <mratsim> (https://files.gitter.im/nim-lang/Nim/veHR/2018-08-09_14-11-11.png) |
12:11:41 | FromGitter | <mratsim> @alehander42 ^ not working for imported files - https://github.com/status-im/nim-stint/blob/master/stint/io.nim |
12:12:28 | * | dadabidet joined #nim |
12:13:21 | * | tzekid quit (Ping timeout: 252 seconds) |
12:14:27 | FromGitter | <timotheecour> confirmed it works for `b file.nim:line` awesome! @mratsim hmm, can u report this bug ? (ideally reduced if possible) |
12:15:16 | FromGitter | <mratsim> yeah no problem, will do later. |
12:18:52 | FromGitter | <alehander42> @mratsim breaking in io.nim when debugging test_io.nim seems to work ok for me (gdb ubuntu) |
12:18:55 | FromGitter | <alehander42> strange |
12:20:15 | * | nkk71 joined #nim |
12:21:01 | dadabidet | Since nim generates C code, is it compatible with tinycc ? |
12:21:15 | FromGitter | <mratsim> @dadabidet, yes |
12:21:18 | dadabidet | it would be great if it did |
12:21:31 | FromGitter | <alehander42> it works even with lldb |
12:21:39 | dadabidet | so is it a good idea to use nim as a game scripting language? |
12:21:42 | FromGitter | <mratsim> @alehander42 it works for me as well, I wonder if it’s breakpoint of nimble packages that doesn’t work |
12:21:42 | FromGitter | <alehander42> I didn't even realize i have lldb :D |
12:21:56 | FromGitter | <mratsim> @alehander42 debugging from cloned stint works |
12:22:08 | * | nkk71 quit (Remote host closed the connection) |
12:22:36 | FromGitter | <mratsim> try with something installed from nimble |
12:23:20 | FromGitter | <mratsim> @dadabidet: There was talks of using Nim instead of Godotscript |
12:24:21 | FromGitter | <mratsim> @dadabidet: And Beamdog is using Nim for tooling of Neverwinter Nights 1 enhanced edition. I’m not sure if it will be used for scripting instead of their old Aurora script though: https://github.com/niv/neverwinter_utils.nim |
12:24:41 | PMunch | databidet, I've used Nim for writing games. Works really well |
12:24:49 | dadabidet | question: is the GC embedded inside the generated C code? |
12:25:01 | FromGitter | <mratsim> @dadabidet, yes, but you can remove it. |
12:25:07 | FromGitter | <timotheecour> so I can call simple nim function via: `(lldb) p fun2_ALFlENhZsqTbOkwPqw67Tg_2()` to call `fun2()` ; I'm wondering how to generalize that , ideally i'd like to call `echo some_var` or `run_custom(var1, var2)` |
12:25:08 | FromGitter | <mratsim> compile with gc:none |
12:25:23 | dadabidet | what happens if I remove the GC? any issue? |
12:25:42 | dadabidet | or do I need to clean memory manually? |
12:25:48 | FromGitter | <mratsim> most of the standard lib rely on GC |
12:25:59 | FromGitter | <mratsim> you can mix both GC-ed and manual managed memory |
12:26:52 | FromGitter | <mratsim> but when you say game scripting, are you talking about user scripting (i.e. people might try to write stuff to pwn your server/game?) |
12:27:22 | FromGitter | <mratsim> if so you might want to create a domain specific language that only allows certain things. |
12:28:15 | dadabidet | I'm just in the developing phase, I'm not really worrying about malicious users right now |
12:28:46 | dadabidet | Im not into making a language |
12:29:18 | FromGitter | <mratsim> you can use Nim as a base language but only allow vetted function |
12:29:44 | dadabidet | nim has some python flavor, and since Im aiming for some C++ libs, another script language might be useful for high level stuff like loading data etc |
12:30:49 | FromGitter | <mratsim> `macro callIfAuthorized(funcname:untyped): untyped = if funcname not in AuthorizedTable: doNotAllow() else: result = quote do `funcname`()` |
12:31:14 | dadabidet | does nim have list and dict comprehension like python? |
12:31:14 | FromGitter | <mratsim> If it’s purely dev side, Nim would be perfect. |
12:31:25 | FromGitter | <mratsim> you can use for loop |
12:31:33 | dadabidet | and function like filter, map, etc? |
12:31:39 | FromGitter | <mratsim> it does but the syntax is ugly at the moment and it will be replaced |
12:31:42 | FromGitter | <mratsim> yes |
12:31:46 | FromGitter | <mratsim> sequtils |
12:32:06 | FromGitter | <mratsim> or https://github.com/zero-functional/zero-functional |
12:32:20 | FromGitter | <mratsim> or https://github.com/numforge/loop-fusion |
12:32:32 | FromGitter | <codem4ster> I read the compiler doc, and want to generate dll for windows. I tried --app=lib but it wants cl.exe. How can I properly configure my environment to create a dll file? What I need for that? |
12:33:10 | FromGitter | <mratsim> @dadabidet be sure to bookmark this to find functions: https://nim-lang.org/docs/theindex.html |
12:36:15 | * | albel7272 joined #nim |
12:39:05 | dadabidet | ah named tuples, awesome! |
12:39:28 | dadabidet | I wonder how they're represented in memory |
12:39:50 | dadabidet | no dict? |
12:40:21 | PMunch | Nope, they're converted to a C style struct |
12:40:35 | * | albel7272 quit (Ping timeout: 240 seconds) |
12:41:23 | FromGitter | <Vindaar> dict -> https://nim-lang.org/docs/tables.html |
12:43:57 | dadabidet | what does {} mean by default in nim? |
12:45:15 | FromGitter | <timotheecour> set |
12:45:23 | FromGitter | <timotheecour> {.foo.} is pragma |
12:46:24 | Araq | yeah, I think ENDB is unfixable. it injects so much more code into the code that you seek to debug that I cannot imagine it'll work out for e.g. multi-threaded programs |
12:47:20 | Araq | or async programs or anything that you might need a debugger for, it's a toy |
12:47:26 | FromGitter | <timotheecour> @mratsim using `callIfAuthorized` seems not robust enough or not flexible enough; why not use a sandbox? to run untrusted code inside it |
12:47:39 | dadabidet | https://narimiran.github.io/nim-basics no sets here? |
12:49:07 | dadabidet | the slice syntax is different than python thing[0..3] gets 4 things, python thing[0:3] gets 3 |
12:50:14 | Araq | thing[0..<3] gets 3 things |
12:50:20 | FromGitter | <timotheecour> @araq any experience calling code from lldb (or maybe gdb)? basic stuff like `(lldb) p fun2_ALFlENhZsqTbOkwPqw67Tg_2()` to call fun2() works but i'd like to call more complex stuff, eg: `myecho myvar[1].foo(b)` |
12:51:03 | FromGitter | <kaushalmodi> dadabidet: I am learning Nim and I update my notes here: https://scripter.co/notes/nim/ There you will find anything from beginner level stuff to beginner+ level. You can search in that one page for stuff like dict, comprehension, etc. Of course, the TheIndex official page of Nim is the holy grail. My notes might serve as a little help with Nim from a beginner's perspective. |
12:51:23 | Araq | sorry, no, krux02 submitted the GDB patches |
12:55:11 | FromGitter | <timotheecour> k thx will ask him; while you're here... any idea how to get name context of current execution point at compile time? file,line,col => we already have; how about module, proc? |
12:55:57 | Araq | I think there is a feature request open for this |
12:56:41 | FromGitter | <timotheecour> well i think that's the 1 i just referred to :) "we need a standard way to get name of procedure #8212 ⏎ " |
12:56:46 | miran | dadabidet: i'm the author of that tutorial :) no sets there, sorry |
12:57:26 | dadabidet | no problem |
12:58:24 | miran | there are two types of sets in nim, bitsets and hash sets - if you want python-like sets (hash sets), you need to `import sets` |
12:58:39 | dadabidet | mh |
12:59:17 | * | salewski joined #nim |
12:59:22 | miran | and if you find anything in the tutorial confusing, or some errors - please report it |
12:59:49 | * | couven92 quit (Read error: Connection reset by peer) |
13:01:24 | * | endragor quit (Remote host closed the connection) |
13:02:08 | FromGitter | <mratsim> you can built dictionaries with {key1: val1, key2, val2}.toTable actually |
13:02:46 | FromGitter | <mratsim> if keys are strings look into strtables, those are optimized/specialized for strings keys |
13:03:32 | dadabidet | mmmh doesn't seem like a mature language, Im going to miss python |
13:03:34 | miran | oh, `strtabs`! i didn't know that exists! |
13:04:25 | TheLemonMan | you can always call python stuff using nimpy! |
13:04:33 | miran | dadabidet: i'm coming from python too. don't give up on nim too early. try to use it a bit more and it will get under your skin, and you'll see that some things are nicer/better than in python |
13:04:34 | FromGitter | <timotheecour> for execution context (procedure name, module name), I'm thinking about using `for scope in walkScopes(c.currentScope):` (as done in locals.nim) ; wondering if that's the right approach |
13:04:48 | miran | and i'm saying that as a big python-lover |
13:05:03 | * | salewski quit (Quit: WeeChat 2.0.1) |
13:05:51 | dadabidet | some things, like what? |
13:06:14 | FromGitter | <kaushalmodi> (Looks like my earlier comment about my Nim notes just got lost.. dadabidet: did you get that?) |
13:07:04 | dadabidet | FromGitter, yes <FromGitter> <kaushalmodi> dadabidet: I am learning Nim and I update my notes here: h |
13:07:04 | FromGitter | dadabidet, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim |
13:07:06 | FromGitter | <timotheecour> well for starters u get the benefit of a statically compiled language, making it easier to reason about code, do refactorings and finding bugs at compile time instead of runtime |
13:08:56 | FromGitter | <mratsim> second, for deployment you don’t need to fumble with virtualenv, pip/conda/wheel how to I get the proper version of the dependency |
13:09:34 | FromGitter | <kaushalmodi> dadabidet: ok, thanks for confirming. |
13:10:12 | FromGitter | <mratsim> and you build standalone binaries. No need to make sure Python is installed with the proper version on your client system |
13:10:45 | FromGitter | <mratsim> Relevant XKCD: https://xkcd.com/1987/ |
13:11:51 | FromGitter | <timotheecour> @mratsim what do u think about the slicing discussion (https://github.com/mratsim/Arraymancer/issues/262) |
13:13:54 | * | natrys quit (Quit: natrys) |
13:15:07 | * | dave24 quit (Quit: rirc v0.1) |
13:15:13 | FromGitter | <mratsim> I couldn’t take the time to parse everything but: ⏎ ⏎ 1) having tensor being just a view means client has to worry about storage. If I want people to convert from Python I need to manage it. However I do plan to have a super low-level API that would only work on top of buffers see https://github.com/mratsim/Arraymancer/issues/175#issuecomment-388215144 |
13:16:55 | FromGitter | <mratsim> 1) Slice reduces dimension: Already had this conversation with edubart on the Gitter. There are issues that comes from it in Numpy, and I prefer keeping the tensor shape. Need to find again the examples |
13:17:35 | FromGitter | <mratsim> 1) Slicing error as compile-time: would love to do it but that doesn’t work if the buffer is a seq, on ly if it’s an array or array of array |
13:17:39 | FromGitter | <timotheecour> > having tensor being just a view means client has to worry about storage ⏎ ⏎ that's just a wrapper away, as shown in examples i wrote in that issue: `auto matrix = slice!double(3, 4);` wraps creating a buffer (in D, a dynamic array), followed by returning a ND view over it, so it's transparent |
13:19:38 | * | stefanos82 joined #nim |
13:20:40 | FromGitter | <mratsim> And yeah I know Mir and was impressed with Ilya (was it 9il) work, I reference it when trying to implement a fallback BLAS from scratch: https://github.com/mratsim/Arraymancer/issues/25 |
13:20:53 | Araq | a slice is just a nicer word for a dangling pointer |
13:21:14 | FromGitter | <timotheecour> > * Slicing error as compile-time: would love to do it but that doesn’t work if the buffer is a seq, on ly if it’s an array or array of array ⏎ ⏎ nope, I've written the examples in that issue to show which errors are CT vs RT: the number of dimensions are CT errors, the out of bounds ones are RT errors ; but (as i showed in issue), in nim `echo d[0]` gives RT instead of CT error (wrong dimensinos) |
13:23:07 | Araq | out of bound errors can be made CT and we'll do it to yet-another killer feature to Nim :P |
13:23:14 | Araq | *to add |
13:23:26 | FromGitter | <timotheecour> > a slice is just a nicer word for a dangling pointer ⏎ ⏎ actually this issue doesn't happen in D in practice, using D's dynamic array semantics. Very happy to discuss this at length |
13:23:46 | Araq | it happened to me in practice when writing packedjson |
13:24:16 | Araq | and don't see how D would have prevented it |
13:24:48 | krux02 | slice, range, span. I used to know what all these words mean, until I learned Nim |
13:24:54 | krux02 | here they all mean something else |
13:24:58 | FromGitter | <mratsim> @timotheecour but the number of dimension must be runtime: ⏎ ⏎ var a = [1, 2, 3, 4].toTensor() ⏎ var b = a.stack([5, 6, 7, 8].toTensor) [https://gitter.im/nim-lang/Nim?at=5b6c40aaa6af14730b10a9d6] |
13:25:39 | krux02 | and none of the usages of theses words in Nim I personally think are very useful, therefore I always forget what they mean. |
13:26:17 | FromGitter | <mratsim> I would have the number of dimensions/rank be part of the type as a static int but it’s a pain: https://github.com/mratsim/Arraymancer/blob/master/Design_document.md#have-the-rank-of-the-tensor-be-part-of-its-type |
13:26:28 | Araq | it's not my fault you never learned Pascal at school. |
13:26:41 | FromGitter | <timotheecour> number of dim is CT: ⏎ auto matrix = slice!double(3, 4); ⏎ static assert matrix.shape.length == 2 // that's CT ⏎ assert matrix.shape == [3,4] // that's RT [https://gitter.im/nim-lang/Nim?at=5b6c41115762ee4fe551aaaa] |
13:26:58 | krux02 | I learned c++ at school. |
13:27:27 | FromGitter | <mratsim> @timotheecour once you can stack tensors with arbitrary tensors read from a .npy file it’s not CT. |
13:27:51 | FromGitter | <timotheecour> python will never be CT; i'm talking about D's mir here :) |
13:28:19 | FromGitter | <mratsim> yeah but I’m trying to convert Python data scientists, not D data scientists ;) |
13:28:21 | krux02 | python is a bit weird anyway |
13:28:37 | FromGitter | <mratsim> the less friction there is, the better it is |
13:29:34 | FromGitter | <mratsim> Having the rank be part of the type would be awesome, I wouldn’t need this metadataArray data structure: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/metadataArray.nim#L17-L31 |
13:29:55 | krux02 | in nim it is often hard to see if something is evaluated it compile time or at runtime. |
13:30:14 | FromGitter | <mratsim> but it adds coginitive overhead for library users |
13:30:23 | FromGitter | <timotheecour> well nim is a static language, not dynamic one, so the static approach offers mostly advantages compared ; in particular : bugs at CT, much more efficient code generation. I will bet money on that aspect. |
13:30:44 | FromGitter | <mratsim> you’re preaching to a fellow CT guy :P |
13:31:09 | FromGitter | <mratsim> This library is like the poster-child of compile-time evaluation: https://github.com/status-im/nim-stint |
13:31:20 | FromGitter | <mratsim> you can do uint2048 computation all at compile time |
13:31:29 | FromGitter | <mratsim> addition, division, ... |
13:32:03 | krux02 | mratsim: do you put the dimensions of a tensor is such an array. |
13:32:11 | FromGitter | <timotheecour> I think we can have best of both worlds though, using dynamic wrappers where needed, but built on a core that's using CT dimensions. analog to variants being dynamic wrappers for CT data |
13:32:15 | FromGitter | <mratsim> @krux02 yes |
13:32:15 | krux02 | I know I needed to do that, too, when I worked on my tensor library. |
13:32:39 | krux02 | I wanted to use seq in the beginning, because they were compile time only. |
13:32:40 | FromGitter | <timotheecour> but the core needs to be static dims. very sure about that |
13:33:19 | krux02 | but the compiler didn't a allow a seq as a generic parameter. |
13:33:35 | FromGitter | <mratsim> @timotheecour @andreaferretti and me started with the same assumption, his previous linalg library used static everywhere https://github.com/unicredit/linear-algebra |
13:33:54 | FromGitter | <mratsim> hence why so many static issues where raised by us |
13:34:10 | Araq | sorry about that |
13:35:21 | FromGitter | <timotheecour> right, dimensions should use an array, not a seq. |
13:35:21 | FromGitter | <mratsim> but he found himself fighting too much with stuff that needed runtime values (besides compiler bugs) |
13:35:50 | FromGitter | <mratsim> This was his announcement though we had a longer chat on that: https://github.com/unicredit/linear-algebra/issues/5#issuecomment-307799671 |
13:36:38 | FromGitter | <mratsim> just before his reply you can see why I didn’t choose static param for dimensions |
13:39:45 | FromGitter | <timotheecour> ok will read in detail, we can continue discussion later (need to crash now). This is a pretty fundamental design point so it's worth investigating to do the right thing. I know it works out well in mir (modulo limitations of D ;-) ) |
13:40:06 | krux02 | well when I worked on it ``static[seq[int]]`` did not work |
13:40:43 | FromGitter | <mratsim> @krux02 need an array, seq in the NimVM are arrays anyway when you pass them around |
13:40:48 | krux02 | I think the size as static parameters makes sense for small matrices |
13:40:54 | krux02 | for example everything in glm |
13:40:58 | FromGitter | <timotheecour> when would one need `static[seq[int]]`? (why not `array[N, int]` for eg, for dimension) ? |
13:41:27 | krux02 | but if it grows in size beyond that the overhead is marginably small for a runtime size value. |
13:41:31 | FromGitter | <mratsim> when you broadcast or squeeze you need to add a new dimension or remove several |
13:41:32 | Araq | fwiw I doubt it can work well in principle. |
13:42:16 | FromGitter | <mratsim> by the way squeeze wouldn’t work at all with compile-time rank |
13:42:33 | FromGitter | <mratsim> (it removes all singleton dimensions at runtime) |
13:42:34 | krux02 | what does squeeze do? |
13:42:37 | Araq | rank N means you need N nested for loops and that's pretty hard to express generically |
13:42:57 | dom96 | That's where macros come in :P |
13:42:59 | Araq | and once you did you pray the compiler transforms it into a single linear loop |
13:43:02 | FromGitter | <mratsim> if you have a 3D tensor of shape (3, 1, 1), it transform into a tensor of shape (3) |
13:43:41 | Araq | seems easier to throw away the rank and only introduce it when necessary (displaying output?) |
13:43:44 | krux02 | well I supported tensor operations in Einstein Notation (implicit sum) that generated all the nested for loop |
13:44:12 | FromGitter | <mratsim> @Araq, I have the macro to generate those loops at compile-time, but it’s less efficient due to code size |
13:44:29 | Araq | yeah, I know, macros... |
13:44:40 | Araq | they destroy every argument. |
13:44:43 | Araq | :-) |
13:44:47 | krux02 | anmratsim: that is pretty easy to do at compile time. |
13:44:56 | krux02 | the problem is that it requires a marco |
13:44:59 | FromGitter | <mratsim> You can check there: https://github.com/mratsim/Arraymancer/issues/164 |
13:45:16 | * | dom96 wonders what the discussion is about |
13:45:21 | FromGitter | <mratsim> I have my reference runtime implementation, and the macro based no branching loop |
13:45:23 | krux02 | but I think Nim did not allow that |
13:46:13 | FromGitter | <mratsim> @dom96 multidimensional array, should the dimension be a static int and part of the type to allow compile-time optimization |
13:46:21 | krux02 | ``proc seqeeze[Dims](tensor: Tensor[Dims]): Tensor[squeezeType[Dims]] = `` |
13:46:49 | krux02 | but I think I had problems using that pattern |
13:46:52 | FromGitter | <mratsim> but the end squeeze dimension depends on the runtime dimension. |
13:47:03 | krux02 | I wanted to calculate the result type using symbols from the arguments list |
13:47:10 | krux02 | but the compiler did not want that |
13:47:21 | * | mwbrown quit (Ping timeout: 240 seconds) |
13:47:24 | FromGitter | <mratsim> if you slice with runtime data and then squeeze the slice, what happens |
13:47:51 | FromGitter | <mratsim> (i’m not talking about lemon) |
13:48:00 | krux02 | lol |
13:48:14 | krux02 | I did not have a squeeze operation. |
13:48:16 | FromGitter | <timotheecour> > rank N means you need N nested for loops and that's pretty hard to express generically ⏎ ⏎ it actually works out nicely :) name me the operation (concat, reshape, ND-diagonal, sub-tensor, etc) , it works quite simply (see mir implementation) ; would need to port it to nim which would be expressed in even simpler terms. More importantly: it will be much faster. |
13:48:23 | krux02 | to be honest it was a vacuum project. |
13:48:31 | krux02 | program in thin air |
13:48:43 | krux02 | that was why it failed |
13:49:05 | TheLemonMan | who's squeezing what? |
13:49:29 | krux02 | TheLemonMan, mratsim is slicing and squeezing you |
13:49:55 | krux02 | :P |
13:50:29 | FromGitter | <mratsim> @timotheecour I would need reshape, broadcast, squeeze and stack with compile-time rank: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/shapeshifting.nim |
13:50:35 | Araq | Timothee, we'll see about that. ;-) I'm happy to be proven wrong. |
13:51:00 | * | ryanhowe joined #nim |
13:51:50 | FromGitter | <timotheecour> right, for dynamic ranks (eg images that could be gray or RGB), one can treat them by a wrapper type that contains a 3D tensor + dynamic rank. |
13:51:51 | FromGitter | <mratsim> idem, I would love to have the rank be part of the type, but those operations are like bread and better when preparing data. |
13:51:59 | * | mwbrown joined #nim |
13:52:27 | * | SebastianFlyte16 joined #nim |
13:52:40 | dom96 | mratsim: I suppose ideally you would support both |
13:53:06 | FromGitter | <mratsim> My ultimate goal is to process 3D videos: so i need (Batch, Time, Color, Depth, height, width) dimensions |
13:53:47 | FromGitter | <mratsim> well no my ultimate goal is a Starcraft 2 bot but I can’t sell that :P |
13:53:49 | krux02 | mratsim: what do you mean my 3D videos |
13:54:47 | krux02 | a sequence of images seen as a big 3D array of pixels, or stereoscopic images, or true voxel based videos? |
13:55:07 | krux02 | mratsim: I wouldn't say that |
13:55:15 | FromGitter | <mratsim> currently you can process videos, the Youtube video prediction challenge to autotag a video between 4000+ tags just finished today btw - https://www.kaggle.com/c/youtube8m-2018 |
13:55:45 | krux02 | tasbot is AGDQ is raising a lot of attention. |
13:56:06 | FromGitter | <mratsim> @krux02, neural network are pretty agnostic, as long as the number of dimensions match you can process it. |
13:56:47 | krux02 | I don't necessary like neural networks in computers. |
13:56:57 | krux02 | they do things that people don't understand. |
13:57:12 | krux02 | for image processing they are nice though. |
13:57:21 | * | SebastianFlyte16 quit (Ping timeout: 248 seconds) |
13:57:31 | FromGitter | <mratsim> well, you can say the same about cars or airplanes or cryptography or nuclear power plant. |
13:57:52 | FromGitter | <mratsim> even people tend to do things that others don’t understand |
13:58:21 | krux02 | but generally I prefer is software problems are solved with good engineering instead of the magic bullet of machine learning that in the end nobody will be able to understand. |
13:59:05 | FromGitter | <mratsim> The main issue is believing that it is a magic bullet, like “big data”, and “blockchain” or “Agile" |
13:59:43 | * | ryanhowe quit (Quit: WeeChat 1.4) |
14:00:03 | krux02 | people even think that programming can be done at some point in the future by computers. |
14:00:44 | krux02 | They didn't realize that most programming is already done by computers, it is called a compiler, and we only talk in a higher level language to the computer. |
14:00:51 | FromGitter | <mratsim> Mandatory CommitStrip: https://www.commitstrip.com/wp-content/uploads/2016/08/Strip-Les-specs-cest-du-code-650-finalenglish.jpg |
14:01:36 | * | dadabidet left #nim ("Leaving") |
14:01:57 | krux02 | lol |
14:02:00 | krux02 | did not know that one |
14:02:08 | krux02 | exactly what I said |
14:03:08 | dom96 | For most software it'll be enough to get an AI that is as smart as humans. Might as well assume that this is where we are heading in the future. |
14:03:31 | krux02 | dom96: as smart as humans is not enough |
14:03:46 | krux02 | a human can only understand what it actually experienced |
14:04:06 | dom96 | We can easily have the AI experience what most humans experience |
14:04:23 | krux02 | an AI that does not experience anything like a human, because it sits in a computer and does not have human needs, will never understand the way humans understand. |
14:04:35 | krux02 | dom96, not really. |
14:04:50 | krux02 | the simplest example, is the invention of the cup handle. |
14:05:25 | dom96 | It might take a lot of questioning by the AI but eventually you will get something that the human wants |
14:05:26 | krux02 | if you don't have fingers that sense hotness and the need to drink to survive and the joy of drinking hot drinks, you would never come up with a cup handle |
14:06:29 | krux02 | and no, questioning a human is not enough. |
14:06:37 | dom96 | "Make me a cup" <ok, here is a CAD model> "I need it to have a handle" <ok, here it is with a handle> "Take a look at a picture of my hand and design me a better handle" |
14:06:39 | dom96 | etc. |
14:07:15 | FromGitter | <mratsim> the thing is, we thrive in ambiguity |
14:07:15 | dom96 | And if an AI is as smart (and creative) as humans then they will come up with some genius designs |
14:07:34 | krux02 | no it is not about "I need it to have a handle" it is about coming up with the concept of a handle. |
14:08:05 | * | pringlecake joined #nim |
14:08:06 | krux02 | the handle is already invented, but think of it as if it would not exist yet. |
14:08:06 | dom96 | Again, if an AI is sufficiently intelligent they will be able to understand that humans can feel heat |
14:08:17 | dom96 | and deduce that hot liquids mean heat on the cup |
14:08:22 | dom96 | and that a handle is required |
14:08:35 | dom96 | You don't need a superhuman intelligence to figure this out |
14:08:43 | dom96 | Nor does the AI need to experience what we experience |
14:08:49 | dom96 | They just need to be sympathetic |
14:08:51 | krux02 | well for that the computer needs a precise model of the human way of seeing the world |
14:09:01 | FromGitter | <mratsim> there is no AI like you describe at the moment @dom96 |
14:09:11 | FromGitter | <mratsim> currently they are trained on a specific problem |
14:09:12 | dom96 | Of course there isn't |
14:09:22 | FromGitter | <timotheecour> > Slicing error as compile-time: would love to do it but that doesn’t work if the buffer is a seq, on ly if it’s an array or array of array ⏎ ⏎ buffer should be a contiguous segment in memory (eg pointer + length + data size), not an array of array . the minimal data for a view is: `(rank: int, dimensions: array[N, T], pointer: ptr T, strides: array[N, int])`. Given that, you can define all |
14:09:22 | FromGitter | ... reshaping/slicing/sub-tensor/casting/object field projections, all reusing same buffer, just by doing operations on the header (strides + dims + rank). |
14:09:55 | dom96 | the AI can create this model by observing humans |
14:10:05 | dom96 | or even just reading the wikipedia page titled "Homo Sapiens" |
14:10:25 | krux02 | dom96: you can't put all knowledge in the world and say "invent something", computer: "I have something it is the cup handle" |
14:10:51 | dom96 | Of course not. Every invention is a solution to a problem |
14:11:08 | krux02 | for the cup handle you need a human to experience the pain of feeling a hot cup, and then the thoughts "hmm, a handle would solve this" |
14:11:12 | dom96 | In a world where the cup handle was not invented, the problem is "I need an object to store hot liquids without burning my hands" |
14:11:37 | dom96 | I don't think you do |
14:11:57 | krux02 | yes, and for the computer to come up with that realization, it just needs to experience a human life. |
14:12:08 | dom96 | Feedback from real humans would certainly help, but it's not necessary |
14:12:18 | dom96 | A wheelchair could be invented by a human who is not disabled |
14:12:54 | dom96 | And I wouldn't be surprised if it was |
14:12:55 | krux02 | you don't need feedback from real humans, you need the simulation of real humans in a simulated world. Like in Matrix |
14:13:24 | krux02 | A wheelchair could not be invented by a human who is not disabled and does not know any disabled person. |
14:13:40 | dom96 | Yes, but like I said, an AI can observe humans |
14:13:49 | dom96 | it can learn about them from other humans that observed them |
14:13:58 | FromGitter | <mratsim> @timotheecour all the shape operations in Arraymancer are only done on metadata. |
14:14:00 | dom96 | from books that contain these observations |
14:14:06 | * | pringlecake quit (Ping timeout: 244 seconds) |
14:14:42 | krux02 | an AI can't understand books that are written from a human perspective, when it doesn't know how humans percieve the world |
14:15:21 | dom96 | I think it can |
14:15:25 | krux02 | books are a very compressed form factor of human experience. Everything a humans sees a common sense is not written down. |
14:15:34 | dom96 | But it's not just books |
14:15:43 | dom96 | Like I said, the AI can observe humans |
14:15:47 | krux02 | well just agree to disagree. |
14:16:05 | dom96 | okay |
14:19:40 | Araq | pure science fiction. it's not even clear an "AI" can be built, it takes a laptop to simulate a single neuron. you have 80 billions of these, not even Google has 80 billions of devices put together in a single network with low enough latency to process information on a reasonable level. You can only hope that most of what a neuron does is not all that relevant for information processing. |
14:20:56 | krux02 | Araq: simulating a world like Matrix, I don't think it will ever be possible. |
14:21:09 | krux02 | But there is the theory that this world is just a simulation. |
14:21:25 | Araq | yeah, it's nuts. |
14:21:36 | krux02 | but possible |
14:21:46 | krux02 | but it is a waste of time to go too deep into it. |
14:21:46 | Araq | IMO it's not. |
14:22:51 | krux02 | well I think it doesn't matter. |
14:23:13 | Araq | I think it's obviously false, because of the infinite regress it causes. |
14:23:19 | dom96 | Another debate heh |
14:23:24 | krux02 | because no matter what the asswer is, it would not affect anyone actions. |
14:23:30 | dom96 | I think an AI is possible simply by the virtue that we exist |
14:23:37 | dom96 | Question is what you define as "artificial" |
14:24:14 | dom96 | What if I manage to grow a brain synthetically and connect it a computer? |
14:24:17 | dom96 | *it to |
14:24:35 | Araq | well but you don't "manage to grow a brain". end of story. |
14:25:07 | dom96 | how is that end of story? |
14:25:14 | dom96 | Assume that I can |
14:25:30 | dom96 | If the human body can do it, why can't we sometime in the future? |
14:26:33 | krux02 | dom96: you are talking to a brain that is connected to a computer |
14:27:08 | dom96 | That brain is sustained by a human body though |
14:27:15 | dom96 | I think there is a line to be drawn here |
14:27:19 | Araq | why would I? I might as well assume it's impossible, because it takes nature 18 years to grow one that is actually connected to a body |
14:27:21 | dom96 | or at least a new name given to something like this |
14:27:24 | FromGitter | <tavurth> Hey guys |
14:27:27 | krux02 | there is also a body and finger and a keyboard involved in the brain/computer interface, but as a whole it is a brain connected to a computer |
14:27:51 | dom96 | Araq: If nature can do it then so can we |
14:28:01 | dom96 | Seems like a perfectly logical prediction |
14:28:16 | Araq | yes, but we might need to replicate large parts of how nature does. |
14:28:20 | FromGitter | <tavurth> I really enjoy using nodemon, and using it with nim like `nodemon --ignore ./nimcache --exec "nim -r c" nimtest.nim` gives me a really nice workflow |
14:28:22 | krux02 | Nature took how many million years for it? |
14:28:23 | Araq | *does it. |
14:28:23 | dom96 | It's just a case of time + research investment |
14:28:45 | FromGitter | <tavurth> I was wondering if there was a way to not run `[Processing]` if a files imports have not changed? |
14:29:07 | FromGitter | <tavurth> Now I'm doing `import {moduleName}` |
14:29:08 | krux02 | there is |
14:29:16 | FromGitter | <tavurth> And the `[Processing]` stuff takes up a huge amount of time |
14:29:31 | FromGitter | <tavurth> (Compared to the compile time) |
14:29:32 | krux02 | ah you mean not just the output |
14:29:43 | FromGitter | <tavurth> Yea |
14:29:44 | krux02 | currently the compiler has to touch everything when you compile somthing |
14:29:52 | FromGitter | <tavurth> I was thinking maybe making a `dylib` |
14:29:53 | krux02 | but it is being worked on |
14:30:22 | krux02 | no all nim files need to be processing when compiling a project |
14:30:33 | krux02 | so make your macros fast |
14:30:39 | FromGitter | <tavurth> Hmm, and can I call into a `.so` file directly? |
14:30:48 | FromGitter | <mratsim> offtopic, Julia 1.0: https://julialang.org/blog/2018/08/one-point-zero |
14:30:56 | krux02 | you can always call dlopen |
14:31:24 | * | nstr21 joined #nim |
14:31:42 | * | nstr21 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
14:31:45 | FromGitter | <tavurth> @krux02, Ok thank you for the info :) |
14:32:01 | FromGitter | <tavurth> It's plenty fast at the moment I guess, just nice if I could make it even faster |
14:32:10 | krux02 | mratsim: I am really wondering why you don't do your tensor magic in julia, as far as I know julia has macros as well |
14:32:27 | FromGitter | <mratsim> @tavurth https://github.com/nim-lang/Nim/issues/7874 |
14:33:13 | krux02 | tavurth: in nim that part is not something you can control over, it will become faster and you won't even have to do anything about it. |
14:33:53 | FromGitter | <mratsim> @krux02: I tried Julia, 2 years ago, for me it was slower and clunkier to use than Python (package management, then end keyword, solution to slowness was adding types), but it’s more like a sentiment than some objective things |
14:34:11 | FromGitter | <mratsim> the worst being array indexing starting at 1 |
14:34:22 | krux02 | the end keyword really was an issue? |
14:34:34 | krux02 | for me the indentation based syntax in Nim is an issue |
14:34:39 | krux02 | even today. |
14:34:40 | dom96 | hah, first comment on HN regarding Julia: this is premature |
14:34:56 | Araq | mratsim: do you know how they managed to get their macro system stable? |
14:35:13 | Araq | it's comparable to Nim's and for Nim it caused a never ending delay of v1 |
14:35:17 | FromGitter | <mratsim> @krux02 yeah I really don’t like the end keyword in Ruby and Julia and Crystal |
14:35:23 | krux02 | I wonder if anybedy here has ever written something in this Apple language called swift. |
14:35:30 | dom96 | krux02: indentation is causing you issues? how? |
14:35:38 | Araq | dom96, don't go there... |
14:36:13 | krux02 | dom96, well all other programming languages that I used just used {} |
14:36:14 | FromGitter | <mratsim> @Araq nop I don’t know, I’m not really following Julia, it just popped up in my news. I didn’t check in depth their macro stuff though I did look at some useful macros when I was doing arraymancer iterators. |
14:36:26 | krux02 | then I set up my auto formatting as an external tool |
14:36:32 | dom96 | hrm, possible marketing opportunity: tweeting at JuliaLang from @nim_lang congratulating them on their release |
14:36:35 | dom96 | should I do it? :) |
14:36:40 | FromGitter | <mratsim> yeah |
14:36:42 | krux02 | and tada copy pasting code from block to block automatically works |
14:36:53 | krux02 | in nim I have had to unlearn that pattern |
14:36:57 | dom96 | krux02: so you're just not used to it |
14:37:00 | krux02 | and manually indent everything |
14:37:13 | krux02 | dom96, that is most of it, yes |
14:37:27 | dom96 | I feel like that's also the reason people are so opposed to style insensitivity |
14:37:33 | krux02 | but still even after years of Nim I still don't see it as being better at anything |
14:37:45 | Araq | it's actually solvable and even easy but no editor I know of gets it right... :-) |
14:38:18 | FromGitter | <mratsim> @krux02 Julia doesn’t need my tensor magic, tensors are a builtin type in Julia |
14:38:56 | krux02 | I think style insesitivity is a usique Nim weirdness that has no real practical advantages but puts nim in a special place where no other language is. |
14:39:01 | FromGitter | <mratsim> This has my attention: ⏎ ⏎ > Cassette.jl provides a powerful mechanism to inject code-transformation passes into Julia’s compiler, enabling post-hoc analysis and extension of existing code. Beyond instrumentation for programmers like profiling and debugging, this can even implement automatic differentiation for machine learning tasks. |
14:39:16 | * | PMunch quit (Quit: Leaving) |
14:39:39 | krux02 | the only advantage of style insesitivity that I see is that people don't use identifiers of the same name that aren't different at all. |
14:39:57 | krux02 | but that isn't something an experienced programmer would do anyway |
14:40:04 | FromGitter | <mratsim> yeah, let’s bring back the sailing ship and change to case sensitivity :P |
14:40:40 | FromGitter | <mratsim> though I don’t mind for underscore |
14:40:45 | FromGitter | <mratsim> :D |
14:40:46 | * | l2y joined #nim |
14:41:11 | krux02 | the first letter is already case sensitive |
14:41:13 | * | l2y quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
14:41:14 | krux02 | what a weird logic |
14:41:37 | Araq | dunno, if case sensitivity would work in practice I would write 'GCC -o foo.o foo.c' since it's called 'GCC', not 'gcc' |
14:42:21 | krux02 | what is called GCC |
14:42:27 | krux02 | gcc is the command line program |
14:42:58 | krux02 | and you can write your own program gCc that is a totally different program it you want to |
14:43:04 | Araq | the alllower commands in unix are a testament of an utterly broken piece of technology, but nobody wants to admit it, so *shrug* |
14:43:22 | krux02 | allower commands? |
14:43:31 | Araq | cp, grep, gcc, ls ... |
14:43:41 | leorize | I think he said "all lower" :P |
14:43:43 | krux02 | well the naming if crap, for sure |
14:43:52 | FromGitter | <mratsim> wow on HN there is a lot of discussions about Julia’ poor exception handling and dependencies management |
14:43:54 | krux02 | ah |
14:44:23 | krux02 | I like all lower case in unix pretty well |
14:44:25 | dom96 | This is why we need a substantial RC period |
14:44:37 | krux02 | it is for fast typing on the command line |
14:44:38 | dom96 | With hopefully a HN thread |
14:44:59 | krux02 | and then all lower is easier |
14:45:06 | livcd | I too prefer Get-ChildItem |
14:45:08 | FromGitter | <kaushalmodi> krux02: Use rectangle copy/paste in Emacs :) |
14:45:23 | FromGitter | <kaushalmodi> krux02: Regarding "and tada copy pasting code from block to block automatically works" |
14:45:40 | krux02 | kaushalmodi: and how do I handle out of emacs copies? |
14:46:03 | FromGitter | <kaushalmodi> krux02: You go out of emacs? :P |
14:46:04 | Araq | yes, caps are a usability nightmare so you want protection from the assholes that name their stuff XCG_CONFIG |
14:46:22 | krux02 | and no it does not solve my problem, because copy paste in reclangles is again managing the indentation manually |
14:46:41 | Araq | and that's why you make the machine ignore this petty shit |
14:46:46 | krux02 | I have to select a rectangle and carefully make sure I don't take the indentation |
14:47:25 | FromGitter | <kaushalmodi> krux02: Not sure I follow.. to start the rectangle selection at the desired indentation level.. it's not too capricious |
14:47:27 | krux02 | well for a shell I would even agree to make it case insensitive |
14:48:13 | dom96 | I've got my zsh set up to be case insensitive and I love it |
14:48:19 | krux02 | but then again for shell scripts that are written down, I would prefer it to be case sensitive. |
14:48:34 | FromGitter | <kaushalmodi> krux02: C-SPC C-s <desired end term> RET C-x r M-w |
14:49:02 | * | NimBot joined #nim |
14:49:09 | krux02 | Araq, you mad the compiler even yell at inconsistent spaces around an operator, but it doesn't complain when I write my foo_bar foObAr |
14:49:14 | FromGitter | <tavurth> Spacemacs has a pretty good nim layer |
14:49:34 | FromGitter | <mratsim> @krux02 that was @miran PR :P |
14:49:44 | Araq | krux02, fair enough, we can make the compiler complain about that one too |
14:49:52 | Araq | it's harder to do though :P |
14:50:02 | krux02 | tavurth: if you use it for a while you will want to disable eldoc and everything related to nimsuggest, they will make your editing slow |
14:50:16 | Araq | and what's worse, I don't know if it's noSideEffect or nosideeffect |
14:50:26 | FromGitter | <mratsim> killall nimsuggest is super useful when working with macros |
14:50:33 | FromGitter | <tavurth> @kruz02, slowing down the editor? |
14:50:38 | FromGitter | <mratsim> or noSideEffects |
14:50:39 | FromGitter | <kaushalmodi> fwiw, only-the-first-char-being-case-sensitive has never come in my way |
14:50:41 | federico3 | krux02: that would be a task for a good linter |
14:50:43 | FromGitter | <tavurth> (https://files.gitter.im/nim-lang/Nim/IJOY/Screenshot-from-2018-08-09-17-49-42.png) |
14:50:46 | * | Auctus19 joined #nim |
14:50:48 | * | Auctus19 quit (Remote host closed the connection) |
14:50:48 | FromGitter | <tavurth> Looks pretty helpful |
14:50:50 | FromGitter | <kaushalmodi> you just stay consistent with *your* style |
14:51:01 | krux02 | I want an identifier to be used consistently in the entire project |
14:51:36 | FromGitter | <kaushalmodi> krux02: But you control that consistency |
14:52:01 | krux02 | interesting color scheme |
14:52:19 | Araq | I enjoy the protection Nim gives me from krux02's spellings... |
14:52:29 | * | rayman261 joined #nim |
14:52:37 | federico3 | krux02: contribute to https://github.com/FedericoCeratto/nimfmt or others |
14:52:58 | krux02 | federico3, what is nimfmt going to help me? |
14:53:15 | krux02 | it can't take over indentation, because indentation is semanic, so it may not touch it |
14:53:21 | * | rayman22201 quit (Ping timeout: 240 seconds) |
14:53:35 | federico3 | krux02: Detect inconsistent variable/function naming |
14:54:05 | krux02 | inconsistent spaces are detected by the compiler |
14:54:20 | krux02 | I did not find a way yet to disable that warning. |
14:54:24 | Araq | also interesting that Julia throw away old cruft |
14:54:41 | Araq | well that's what I interpret from their release news |
14:54:44 | FromDiscord_ | <treeform> nimfmt is the best thing that can happen to teams working on nim |
14:55:04 | krux02 | "on nim" or "in nim" |
14:55:22 | dom96 | I love how many people pick on the 1-based indexing in Julia |
14:55:22 | FromDiscord_ | <treeform> it removes class of arguments programmers like to have |
14:55:36 | FromDiscord_ | <treeform> "in nim" |
14:55:51 | dom96 | It's ridiculous IMO but there you go |
14:56:11 | dom96 | (not 1-based indexing, the complaints) |
14:56:16 | FromGitter | <kaushalmodi> Talking about throwing away cruft, @dom96, can you close https://github.com/nim-lang/Nim/pull/8003 by removing isAsciiLower etc for strings |
14:56:22 | krux02 | is it normal that I cringe every time when I see "Dynamic" somewhere when it is about programming(languages) |
14:56:58 | Araq | can we *please* remove the .tags mechanism? :-/ |
14:57:18 | dom96 | nooooo |
14:57:28 | Araq | number of bugs it found: 0 |
14:57:47 | Araq | noooo ??? |
14:57:49 | Araq | why? |
14:58:16 | dom96 | It's a great feature, but it's not developed enough to be useful |
14:58:43 | dom96 | I'm okay with you ripping it out for 1.0 and keeping a open mind about implementing it again in the future |
14:59:39 | TheLemonMan | Araq, speaking of stuff that can be removed, can I remove the unused postInitProc? |
14:59:47 | federico3 | if anything tags and effects should be developed more |
14:59:54 | krux02 | really "See issue #8003" as the deprecation comment? |
15:00:04 | krux02 | that is not nice at all |
15:00:55 | dom96 | Speaking of stuff that can be removed, can we remove the do notation? |
15:00:57 | Araq | how do we know postInitProc is unused? |
15:01:24 | Araq | dom96, fine with me, but boy, this would break code... |
15:01:33 | krux02 | dom96: I use ``quote do:`` a lot |
15:01:47 | * | drh joined #nim |
15:01:48 | Araq | krux02, 'quote do' wouldn't be affected |
15:01:55 | krux02 | but apart from that, I hate the do natation. I have to look it up every time I use it. |
15:02:05 | krux02 | it is really not a good intuitive syntax. |
15:02:07 | dom96 | yeah, but there is no reason why `quote:` can't work, is there? |
15:02:15 | TheLemonMan | Araq, because the compiler always leaves it empty |
15:02:23 | krux02 | there is a second argument to quote. |
15:02:26 | dom96 | krux02: yeah, that's exactly why I want to remove it |
15:02:31 | krux02 | but there is no way to acually pass that argument |
15:02:32 | Araq | TheLemonMan, sure ok, we have tests covering it anyway |
15:02:40 | dom96 | but yeah, just for anon procs |
15:02:53 | krux02 | maybe there should be a way to pass that argument. |
15:02:54 | * | drh quit (Remote host closed the connection) |
15:02:55 | dom96 | krux02: quote("`"): ...? |
15:03:14 | dom96 | Honestly, `do` in quote doesn't make sense to me at all |
15:03:16 | krux02 | dom96: yes for example |
15:03:24 | Araq | yeah that argument... I always wondered how it could possibly work. |
15:03:24 | FromGitter | <kaushalmodi> dom96: You mean removing the anon procs? |
15:03:26 | dom96 | `do` only makes sense for macros when you want to pass multiple bodies |
15:03:28 | krux02 | for me neither |
15:03:33 | Araq | turns out ... it simply doesn't. |
15:03:34 | dom96 | quote: .... do: .... do: .... |
15:03:37 | FromGitter | <kaushalmodi> I guess I would be fine as long as the `future` is there |
15:03:49 | krux02 | dom96: you don't need multiple bodies for macros |
15:03:52 | dom96 | kaushalmodi: you can still write: proc () = ... |
15:03:58 | dom96 | and IMO that's just better |
15:04:01 | Araq | or the => thing |
15:04:05 | dom96 | yeah |
15:04:06 | krux02 | you can just put everything in one body and then have named subbodies |
15:04:12 | FromGitter | <kaushalmodi> Araq: That's what I meant by `future` |
15:04:19 | FromGitter | <kaushalmodi> ah.. `sugar` |
15:04:23 | krux02 | you know you can make a body out of arbitrary identifiers |
15:04:33 | krux02 | ``mysubbody:`` |
15:04:48 | dom96 | krux02: yes, that would be another way to do this |
15:04:56 | dom96 | and we could then get rid of `do` completely |
15:05:17 | dom96 | So if you have better ideas for how to specify multiple bodies to a macro invokation Araq is all ears :P |
15:06:45 | krux02 | dom96: multiple bodies https://github.com/krux02/opengl-sandbox/blob/2ff6ae971f9200ac70439536bcc5c5cfcd9ee466/examples/hello_shapes.nim#L223 |
15:07:20 | krux02 | for the macro it is just one body, but logically it is multiple bodies |
15:07:28 | krux02 | and all of them even have a name |
15:08:29 | Araq | yeah, that's usually what I do too |
15:11:03 | Araq | oh and I'm deprecating {.this: self.} |
15:11:39 | Araq | and regionized pointers too |
15:11:57 | FromGitter | <mratsim> ah yeah those, I tried to play with them and failed iserably |
15:12:24 | FromGitter | <mratsim> once lent types are there, we can have proper memory arena |
15:12:51 | dom96 | So do we need `do` at all? |
15:13:51 | krux02 | Araq: what do (did) regionized pointers do? |
15:14:56 | krux02 | mratsim: what is a memory arena? |
15:16:09 | krux02 | is there hard drive memory fighting against flash memory in regular intervals with big audience. |
15:16:22 | krux02 | (sorry, I just needed to make that unfunny comment) |
15:17:10 | Araq | it's ok, we need unfunny comments in order to see the funny ones |
15:17:30 | krux02 | yea |
15:17:58 | krux02 | I think the memory arena is watched by cd-rom memory from the press |
15:18:30 | krux02 | did that one make it any better? |
15:19:01 | FromGitter | <mratsim> @krux02: https://en.wikipedia.org/wiki/Region-based_memory_management |
15:19:27 | FromGitter | <mratsim> that’s basically a memory pool |
15:19:47 | FromGitter | <mratsim> except that you can have heterogeneous objects |
15:20:47 | krux02 | I like the idea in Mr Blow's programming language where every function call has the implicit context argument, and part of the context is the allocator. |
15:21:06 | Araq | yeah, it's called "thread local storage". |
15:21:45 | krux02 | Araq: are you referring to mratsim or me? |
15:21:50 | Araq | to you. |
15:22:06 | krux02 | ah, ok. |
15:22:21 | krux02 | well he said the inverse |
15:22:32 | krux02 | that you can use it to do thread local storage. |
15:22:59 | Araq | yes, that's one way to implement TLS. Hint: There are better ways to do it. |
15:23:32 | krux02 | well with threads I am by far no expert. |
15:23:55 | krux02 | I rarely get in a situation where a signle thread isn't enough. |
15:24:25 | Araq | but if you have TLS, you have this implicit "context" too, it cuts both ways. |
15:24:53 | Araq | it's not a groundbreaking superior new bombastic invention. it's pretty old stuff. |
15:25:16 | krux02 | it is not really about being a new thing or ground breaking |
15:25:25 | krux02 | it is about practicality and simplicity |
15:25:30 | krux02 | and it is simple to understand |
15:26:18 | krux02 | where "thread local storage" seems simple to understand as well, bun then it is also a pretty magic attribute |
15:27:11 | Araq | well there is an easy bijection here, there is no magic |
15:27:38 | krux02 | I think most in a programming language should be about good engineering, not about fascinating science. |
15:27:54 | krux02 | put that things in that are necessary to build quality software and make them easy to use. |
15:28:30 | Araq | good engineers can deal with basic abstract math. it's the programmers who usually can't. |
15:28:53 | krux02 | what do you mean? |
15:29:08 | krux02 | I like basic math. |
15:29:44 | Araq | it's fine to build a language based on good engineering practices. it's wrong to assume that this will then appeal to programmers, or to be "simple" enough for them to use |
15:30:10 | krux02 | well it will appeal to people who want to get stuff done. |
15:30:19 | krux02 | and stuff done will appeal other programmers. |
15:31:31 | Araq | I've seen people getting stuff done in Delphi. Nobody gave a fuck. :P |
15:31:54 | krux02 | I played Age of Wonders II, great game, programmed in delphi. |
15:32:35 | krux02 | I also thing as long as there is enough pressure, people can get stuff done no matter how bad the environment is. |
15:32:42 | krux02 | see javascript |
15:32:43 | FromGitter | <alehander42> my father used delphi when I was way younger and I was like "what's this weird stuff, why not C like we all do in school" |
15:32:46 | FromGitter | <alehander42> little did i know |
15:33:21 | krux02 | alehander42 what is it that you do know now? |
15:33:27 | FromGitter | <alehander42> people do great stuff even in excel |
15:33:32 | Araq | in fact, it's embarrassing nimsuggest *STILL* doesn't work as well as Delphi did in the 90ies. |
15:33:58 | FromGitter | <alehander42> well, I've read a lot of stories how well the Delphi IDE-s/frameworks worked and how much ahead of their time they were |
15:35:10 | krux02 | then why did delphi die? |
15:35:26 | FromGitter | <mratsim> windows only? |
15:35:34 | krux02 | well that is a good point |
15:35:49 | Araq | terrible management too, plus MS hired the brain behind it |
15:35:53 | krux02 | but that is not a thing that can't be addressed. |
15:36:27 | Araq | well "die", it still exists and Lazarus is the open source, portable clone |
15:36:45 | krux02 | Araq, let me guess MS made that brain busy with other non important stuff so he doesn't focus that much on Delphi any more? |
15:37:08 | Araq | no, they hired him to invent C#. |
15:37:22 | krux02 | ah, well |
15:38:07 | krux02 | C# is also one of those mutant languages. |
15:38:07 | FromGitter | <alehander42> and now typescript |
15:38:46 | Araq | C#'s design only suffers from its initial heavy Java influences |
15:39:30 | krux02 | typescript lets you annotate javascript with types thet then are stripped away in the compilation process to javascript and then the javascript engines has to to play a guessing game on what types they were for the JIT compiler. |
15:39:41 | * | francisl joined #nim |
15:39:43 | krux02 | am I the only one who things that is stupid? |
15:39:49 | Araq | plus a bit from this "runs on a virtual machine" stuff |
15:39:57 | Araq | krux02, it's webscale |
15:40:11 | krux02 | Araq: that is also Java. |
15:40:22 | Araq | true. |
15:41:07 | krux02 | I think Java is still the only statically types languages besides C that has no type inference. |
15:41:48 | Araq | that's not true, 3+5 is inferred to have the type 'int', for example |
15:42:04 | krux02 | in the beginning C# was a java clone. I don't know but I could even imagine that it forged from their initial Java implementation for windows exporer. |
15:42:32 | Araq | no, they paid a team of developers to design something better. and they did. |
15:42:41 | krux02 | Araq: but when you want to assign that to a variable, you have to explicitly type that variable |
15:42:58 | Araq | unfortunately they didn't throw away the VM idea altogether |
15:43:02 | krux02 | but initially is was so just the same as java |
15:43:36 | Araq | .NET started with the "support multiple PLs" idea, the JVM didn't. |
15:44:00 | Araq | and you can see it, .NET supports value based datatypes, for example |
15:44:41 | krux02 | but generics were like in java with type erasure and later they learned it was bad (IFAIK) |
15:45:01 | krux02 | java never fixed that |
15:45:47 | Araq | .NET does perform specialization for not-reference types |
15:46:02 | krux02 | I know |
15:46:12 | krux02 | but that is not what it was in the beginning |
15:46:21 | krux02 | but I don't know it exactly |
15:46:30 | krux02 | Araq: another story, I read Nim is supportey by Etherium miners |
15:46:35 | Araq | it didn't copy this mistake either. the only mistake they copied was the covariant arrays |
15:46:41 | Araq | iirc. |
15:47:01 | Araq | to allow easy porting of Java code... (ugh!) |
15:47:01 | krux02 | covariant arrays? |
15:47:09 | krux02 | arrays in java are not covariant |
15:47:16 | Araq | they are. |
15:47:18 | FromGitter | <mratsim> what is a covariant array? |
15:47:33 | FromGitter | <alehander42> @krux02 well a lot of vm-s do this, facebook's hiphop also doesn't use hack's type afaik |
15:47:48 | FromGitter | <alehander42> and this is not typescript's fault |
15:47:55 | FromGitter | <alehander42> nim is playing the same game with its js backend |
15:48:16 | krux02 | alehander42: yes it is not the fault of typescript, it the the fault of the entire web development stack |
15:48:48 | krux02 | and in nim I can just compile to c and not care about the web development stack. |
15:49:38 | Araq | until your game/software needs to run on a mobile phone... |
15:49:45 | krux02 | Araq: I am not sure if we are talking about the same thing, but from scala I leared most what covariance means. when A is supertype of B, then Seq[A] is also supertype of Seq[B] |
15:50:00 | Araq | yes, that is true in Java. |
15:50:10 | krux02 | not for arrays |
15:50:28 | Araq | https://stackoverflow.com/questions/18666710/why-are-arrays-covariant-but-generics-are-invariant |
15:50:45 | * | Vladar quit (Remote host closed the connection) |
15:52:00 | FromGitter | <mratsim> Monads + Higher Kinded Types would mean that we wouldn’t have to ask these covariant questions ;) *Haskell crashing the party* |
15:52:53 | krux02 | oh yea you are right, arrays are covariant. But for primitive types they are still flat data structures there is not boxing happening. I thought covariance would be affected by it, but it isn't primitive types don't inherit from anything. |
15:53:35 | krux02 | mratsim: When you want programmer to run away, just mention Monads. |
15:53:51 | * | stefanos82 quit (Quit: Quitting for now...) |
15:54:03 | krux02 | I constantly forget what they are, but I used them. |
15:54:40 | * | Vladar joined #nim |
15:54:52 | Araq | and in an alternative universe you would tell me Mr Blow based his language on Monads, because it's a sound engineering practice. |
15:55:16 | krux02 | Araq: covariant types are very useful. In combination with the type inference they really do a great job in scala |
15:55:59 | * | stefanos82 joined #nim |
15:56:17 | krux02 | well to be honest I am very interested in his language. But I am also a bit scared that it might get all the attention and Nim will eventually become non important. |
15:56:32 | krux02 | he has 4 full time developers on that language |
15:58:13 | krux02 | it's so sad that most of the time now languages solve problems of older languages, but then they always introduce new problems that the old ones just don't have. |
15:58:53 | FromGitter | <mratsim> Blow is from Jai or Odin? |
15:59:00 | Araq | Jai |
15:59:00 | krux02 | Jai |
15:59:18 | FromGitter | <mratsim> Odin had this interesting dilemma for Metaprogramming, they mention Nim btw: https://odin.handmade.network/blogs/p/1723-the_metaprogramming_dilemma |
16:01:07 | Araq | I'm not worried about Jai at all, I think game programmers are terrible at language design, sorry. |
16:01:54 | Araq | "I used C++ and it sucks, so I'm writing a better language" is not how I started Nim. |
16:02:49 | FromGitter | <mratsim> Corollary: Researchers are terrible at library design |
16:03:06 | * | Demp12 joined #nim |
16:03:30 | FromGitter | <mratsim> (proof: Python data science ecosystem flaky performance if you naively use everything) |
16:03:33 | * | Demp12 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
16:04:01 | FromGitter | <mratsim> .s/everything/anything |
16:04:08 | leorize | Araq: how was Nim started btw? |
16:05:03 | Araq | "This Lisp macro system is pretty good and a perfect fit for systems programming. Moreso than it is useful for a dynamic programming" |
16:05:19 | TheLemonMan | one beer too much and *boom* Nim was born |
16:05:19 | Araq | language." |
16:05:34 | TheLemonMan | two beers too much and we got static[T] :P |
16:06:39 | FromGitter | <mratsim> @TheLemonMan concepts and static are from aah :P |
16:06:54 | FromGitter | <mratsim> but if there wasn’t static you would get Rust drama over integer parameters |
16:07:43 | krux02 | rust has no integer parameters? |
16:07:56 | FromGitter | <mratsim> no |
16:07:59 | Araq | well there were other reasons like "There is no reason systems programming can't have a nice Pythonic syntax" |
16:08:17 | stefanos82 | Araq, I remember when we first chatted and you shared what Nim is in a simple, yet incredibly powerful sentence: Efficiency of C, Elegance of Python, and expandability of Lisp |
16:08:22 | Araq | or "I'd rather copy Ada's type system than C's" |
16:08:45 | FromGitter | <mratsim> @krux02 so this is how array traits are implemented: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c670d67eb9f60feb9712a] |
16:08:54 | FromGitter | <mratsim> only up to size 32 |
16:08:55 | krux02 | Araq: where "nice" is subjective |
16:09:00 | FromGitter | <mratsim> then you’re on your own |
16:09:07 | leorize | I was under the impression that Nim was meant to be a Pascal preprocessor, but ended up being it's own language |
16:09:43 | FromGitter | <mratsim> and here is the integer parametrics drama: https://github.com/rust-lang/rfcs/pull/884 https://github.com/rust-lang/rfcs/issues/1038 https://github.com/rust-lang/rfcs/pull/1931 |
16:09:43 | Araq | no, but I wrote Pascal preprocessors before. They were terrible. |
16:09:57 | stefanos82 | how old are you Araq? |
16:10:37 | FromGitter | <mratsim> so I think @TheLemonMan that static are pretty good given how those RFCS are treated/stalled in Rust |
16:11:41 | FromGitter | <mratsim> (well they are pretty good now, one year ago, they drove me crazy) |
16:11:50 | TheLemonMan | mratsim, I love the idea behind static, they're just a little too brittle for everyday use |
16:12:31 | Araq | I think it all needs to be replaced by macros, but let's get v1 out first |
16:12:46 | Araq | stefanos82, 35 |
16:12:47 | FromGitter | <mratsim> let’s replace Araq by a macro |
16:13:03 | FromGitter | <mratsim> wy do you need AI when you have macros duh :P |
16:13:25 | stefanos82 | Araq: bloody hell, the same age as I? You are a freaking genius man... you know so much stuff LOL! |
16:14:48 | * | Trustable joined #nim |
16:15:00 | FromGitter | <mratsim> Btw regarding programming languages “killer feature” there was a discussion about dependent types on Reddit last week but no one told me what they brought compared to static/generics: https://www.reddit.com/r/programming/comments/948jys/the_future_of_programming_is_dependent_types/e3l2g1g/ |
16:17:01 | krux02 | I think there isn't much a programming language really needs, it is just that no new language really nails what a programming language needs. They introduce new syntax and awesome features and enforce certain styles of programming |
16:17:29 | krux02 | especially I don't like it when a programming language enforces a memory layout |
16:18:57 | FromGitter | <mratsim> web devs need different things, I would be spooked if they could manage the memory in the browser |
16:20:06 | krux02 | mratsim: is a worse memory managment that the enforced one of javascript even possible? |
16:21:23 | krux02 | ok I have to go |
16:21:46 | * | krux02 quit (Remote host closed the connection) |
16:24:10 | FromGitter | <mratsim> dunno :P, I love my “undefined” in JS :S |
16:32:11 | * | Code_Red24 joined #nim |
16:32:56 | * | Code_Red24 quit (Remote host closed the connection) |
16:33:22 | * | xset joined #nim |
16:33:38 | * | xset quit (K-Lined) |
16:34:12 | * | smt joined #nim |
16:35:32 | FromGitter | <Bennyelg> does deduplicate(someSeq) should work on any type of sequence ? i guess it does but how can he check SpecialType == SpecialType ? |
16:36:16 | leorize | Bennyelg: I think it depends on whether == is defined for that type |
16:36:21 | leorize | or else it won't compile |
16:36:36 | FromGitter | <Bennyelg> so it did compiled but didnt worked |
16:37:51 | FromGitter | <Bennyelg> Ill try some few more things, if it doesn't work I'll post here |
16:42:16 | * | elrood joined #nim |
16:54:00 | FromDiscord_ | <emekoi> nim successfull compiles erroneous code as long as its never executed, should produce an error? |
17:01:38 | Araq | as long as it is not *instantiated* |
17:02:06 | * | tribly quit (Quit: WeeChat 2.2) |
17:03:02 | * | tribly joined #nim |
17:07:54 | FromDiscord_ | <emekoi> is that due to dead code elimination or just how the compiler works? |
17:08:16 | Araq | the compiler does check every piece of code you write |
17:08:40 | * | VampiricPadraig joined #nim |
17:08:43 | Araq | it's not clear what "erroneous code" means |
17:09:22 | * | VampiricPadraig quit (Remote host closed the connection) |
17:10:57 | FromGitter | <tim-st> I also saw this a few times, maybe it's better to get the error direct also when it's not instantiated |
17:11:36 | Araq | sure, let's redesign Nim's generics, what could possibly go wrong |
17:12:10 | FromGitter | <tim-st> oh, I thought it was about procs that arent used and have errors |
17:12:27 | Araq | these are checked. completely. |
17:12:28 | FromGitter | <tim-st> I only see the errors when I call the proc |
17:12:38 | Araq | nah I doubt it. |
17:13:10 | FromGitter | <tim-st> hm, maybe it's only related to `nim check` have to test it |
17:15:12 | FromGitter | <tim-st> Araq: |
17:15:15 | FromGitter | <tim-st> proc test1(): string = ⏎ result = nil ⏎ ⏎ test1() [https://gitter.im/nim-lang/Nim?at=5b6c76a367eb9f60feb9ce05] |
17:15:18 | * | BitPuffin joined #nim |
17:15:27 | FromGitter | <tim-st> when the last line is not there it shows no error |
17:16:19 | FromGitter | <tim-st> also in compilation not only `nim check` |
17:17:49 | FromDiscord_ | <emekoi> in certain procs i call code that doesn't even exist and i get no errors when. compiling. |
17:18:33 | FromGitter | <tim-st> yes, that's likely similar like I have shown above. maybe it's intended to decrease compilation time |
17:19:04 | Araq | yeah, no idea what you're talking about. must be the nimsuggest plugin |
17:19:23 | * | thomasb9511 joined #nim |
17:19:25 | FromGitter | <tim-st> no, I dont use nimsuggest |
17:20:05 | FromGitter | <tim-st> ```proc test1(): string = ⏎ result = nil ⏎ ⏎ #test1() ⏎ echo 1``` [https://gitter.im/nim-lang/Nim?at=5b6c77c4179f842c97162025] |
17:20:11 | * | thomasb9511 quit (Remote host closed the connection) |
17:21:33 | FromDiscord_ | <emekoi> there is no error with nimsuggest, nim check, nim c, nim cpp, or nim js. |
17:22:39 | FromGitter | <tim-st> yes, for the code above I only get the error when the line is uncommented |
17:24:59 | FromDiscord_ | <emekoi> i'm talking about different code, and the error you get from your code is because you need to discard the string returned from test1. |
17:25:53 | Araq | emekoi, please gist it/report it |
17:26:40 | FromGitter | <tim-st> emekoi: oh, you're right, I thought `result = nil` doesnt work for strings in devel |
17:27:01 | Araq | tim-st: it's an on-going effort :P |
17:27:59 | FromGitter | <tim-st> ok |
17:30:27 | * | data-man quit (Quit: Konversation terminated!) |
17:31:03 | * | data-man joined #nim |
17:31:24 | FromGitter | <tim-st> the following code is an error without linenumber, is that considered a "crash"? |
17:31:34 | FromGitter | <tim-st> ```proc test1(): string = ⏎ result = nil & ""``` [https://gitter.im/nim-lang/Nim?at=5b6c7a7667eb9f60feb9e2cb] |
17:31:59 | FromGitter | <tim-st> `Error: unhandled exception: false ast.nim(1606) getStrOrChar [AssertionError]` |
17:32:15 | Araq | yup, a crash |
17:32:21 | FromDiscord_ | <emekoi> Araq, i think your initial comment on generics was correct. when i remove all the genrics the compiler reports that the procs don't exist. |
17:34:03 | FromGitter | <tim-st> ok, for now I cant reproduce the problem with uncalled procs, maybe this was fixed recently but I think atleast in an older version it wasnt checked |
17:34:39 | Araq | no, but nimsuggest can skip it in order to reply more quickly |
17:35:05 | FromGitter | <tim-st> ok |
17:35:21 | * | Tyrantelf11 joined #nim |
17:37:09 | * | Tyrantelf11 quit (Read error: Connection reset by peer) |
17:44:53 | FromDiscord_ | <emekoi> most basic example: `proc a[T](b:int)=b.c()` |
17:45:25 | Araq | well b.c() could exist :P |
17:45:34 | Araq | when instantiated |
17:46:54 | FromDiscord_ | <libman> Random thought of the day: the most common criticism of Nim (esp from Go and Python users), lack of obviousness of where each symbol comes from, is 100% solved with editor "Go to definition" feature. We need to raise awareness! |
17:47:02 | FromDiscord_ | <emekoi> true but, `proc a[T](b:int):void=return 1` also compiles. |
17:47:47 | FromDiscord_ | <libman> Use F12 (vscode), use F12, F12 is your friend, lalala... |
17:48:20 | Araq | it's not obvious where a symbol comes from in Python. |
17:48:27 | Araq | not at all. |
17:49:29 | FromDiscord_ | <emekoi> don't we need to put status.im in the sponsors page? |
17:49:50 | FromDiscord_ | <libman> Well, there seems to be more confusion when people s/Python/Nim/, esp with overloaded operators. |
17:49:56 | Araq | emekoi: dom96 is working on it |
17:50:39 | FromDiscord_ | <emekoi> alrighty |
17:52:15 | * | francisl quit (Quit: francisl) |
17:54:31 | * | chamar joined #nim |
17:54:32 | FromGitter | <tim-st> libman: the problem is that this doesnt work (very well) somtimes it works perfect, sometimes it needs more than 20minutes... |
17:54:51 | FromGitter | <tim-st> a working language server for nim would solve these problems |
17:55:05 | Araq | no it wouldn't |
17:55:11 | FromGitter | <tim-st> why? |
17:55:17 | Araq | it's just a more complex protocol for the same features. |
17:55:32 | Araq | but I have a cheap way out, stay tuned |
17:56:42 | FromGitter | <tim-st> ok, for me the most important thing is that it should return the 5 most interesting results (not 1000) and it should return within 1.5 seconds always |
17:57:00 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
17:57:21 | FromGitter | <tim-st> but maybe this is not a problem of nimsuggest but of the vscode implementation of nimsuggest |
17:57:34 | Araq | it orders the results by priority |
17:57:52 | Araq | the priority is calculated from a number of factors including "how often was this used before" |
17:58:05 | FromGitter | <tim-st> yes, the results are good, but it just doesnt work in vscode, I dont know why |
17:58:24 | Araq | there is at least one bad regression that I'm working on |
17:59:09 | FromGitter | <tim-st> ok, but as I said maybe it's also the vscode implementation because for me it never worked (since I use nim like 1 year) |
17:59:29 | Araq | but also the VScode plugin needs some changes |
18:00:51 | FromGitter | <tim-st> btw does nimsuggest uses tcp or udp? |
18:01:43 | FromDiscord_ | <emekoi> is it possible to store `var`s in a container? for example, you have a `seq[var int]` and when you edit entries in the `seq` it updates the original `var`? |
18:02:21 | Araq | TCP. and no, the connection via localhost is not a bottleneck. |
18:03:00 | FromGitter | <tim-st> no, I thought when it used udp that information is lost, but when it works on other ides it's definetly a problem with vscode plugin |
18:03:11 | FromDiscord_ | <libman> Maybe it's a Windows problem. I remember everything in vscode being A LOT slower and more annoying when I briefly had to use Win10... |
18:03:52 | Araq | emekoi, you can only use seq[ptr int] or seq[ref int] to get that |
18:03:54 | FromGitter | <tim-st> Yes, it's slow on windows, and it worked good on linux the first 5 times, after that the very same |
18:05:37 | * | francisl joined #nim |
18:08:08 | Araq | speaking of which ... how can I add 'nimsuggest' to the PATH on Linux? |
18:08:35 | Araq | no, editing .bashrc does not count, I don't start VSCode from a bash session |
18:09:33 | Yardanico | Araq, edit /etc/profile :D |
18:09:52 | FromDiscord_ | <libman> Um, I use one ~/.profile for everything. |
18:10:03 | miran | Araq: add a simple script to /etc/profile.d ? |
18:10:52 | miran | this is what was recommended to me when i was looking for that stuff |
18:11:06 | FromDiscord_ | <libman> /me predictably uses mksh. |
18:11:43 | Yardanico | I use zsh (but without any frameworks) |
18:15:42 | * | nsf quit (Quit: WeeChat 2.2) |
18:27:35 | Demos[m] | use ~/.pam_environment |
18:28:03 | Araq | can I also use ~/.bananajoe? |
18:28:26 | Demos[m] | pam_env works in non-shell things |
18:30:12 | Araq | on every Linux system? |
18:30:15 | Demos[m] | also these bash style profile things don't work for shells like fish (and prob powershell) |
18:31:49 | FromGitter | <kaushalmodi> Araq: `man pam_env` |
18:32:12 | Demos[m] | it has to actually load pam_env. almost everything does |
18:32:24 | miran | Demos[m]: i haven't experienced any problems in fish |
18:32:50 | Demos[m] | well fish won't load stuff in ~/.profile or /etc/profile.d |
18:33:20 | miran | it works here just fine |
18:33:33 | Araq | "This module can also pares a file with simple KEY=VAL pairs on separate lines (/etc/environment by default)." |
18:33:40 | Araq | so ... /etc/environment ? |
18:34:05 | Demos[m] | yep |
18:34:16 | FromGitter | <kaushalmodi> Araq: If you scroll to the bottom, it shows the precedence |
18:34:42 | FromGitter | <kaushalmodi> The `~/.pan_environment` supercedes the other pam files |
18:35:19 | Araq | do the BSDs have "pam"? |
18:36:16 | Demos[m] | PLEASE be careful though, since it's set by login (the program) stuff like nuking the path can be bad. Also the user will need to restart their session (logout and back in) for env vars set in pam_env to get set |
18:36:43 | Demos[m] | looks like some do |
18:37:26 | Demos[m] | idk if they use pam_env though |
18:41:55 | dom96 | The fact that there is no one answer to this really goes to show the problem with Linux |
18:42:33 | FromGitter | <kaushalmodi> dom96: There's always an answer for the OS you are using |
18:43:21 | FromGitter | <kaushalmodi> This question is specific to Araq's Linux OS, right? |
18:43:33 | dom96 | macOS seems to have a pretty elegant way of handling this |
18:43:40 | dom96 | /etc/paths |
18:43:49 | dom96 | just a file with a directory per line |
18:44:05 | Araq | kaushalmodi, no it's to improve the installation experience |
18:44:33 | * | Affliction14 joined #nim |
18:44:44 | FromGitter | <kaushalmodi> Araq: Got it. I missed the beginning of the conversation. |
18:44:50 | * | Affliction14 quit (K-Lined) |
18:45:01 | FromGitter | <kaushalmodi> How is Nim installation different though.. |
18:45:29 | FromGitter | <kaushalmodi> Folks should be knowing which file to edit to update their PATH if they having been using unix systems |
18:45:56 | FromGitter | <kaushalmodi> The file varies with OS and shell too |
18:45:59 | Demos[m] | yeah don't mess with pam_env during installation |
18:46:08 | FromGitter | <kaushalmodi> For tcsh, I use .tchrc |
18:46:39 | FromGitter | <kaushalmodi> At work, they have a .mycshrc |
18:46:49 | FromGitter | <kaushalmodi> So it's not Nim's job to set the PATH env var |
18:46:52 | Demos[m] | yeah for fish I use the fish_user_paths universal var |
18:48:43 | Araq | ok, I'm not doing anything then |
18:49:00 | FromGitter | <kaushalmodi> yeah.. |
18:49:30 | Araq | lesson learned, Linux users hate automation. |
18:49:46 | FromGitter | <kaushalmodi> It's automated already |
18:49:58 | FromGitter | <kaushalmodi> I didn't need to do anything special when I installed nim/nimsuggest |
18:50:01 | FromGitter | <data-man> We need update shell's autocompletions for the Nim. |
18:50:08 | FromGitter | <kaushalmodi> the installations happen in a bin dir that is already in PATH |
18:50:18 | Araq | it remains unclear why they use computers but that's a mystery for another day. |
18:50:21 | dom96 | Araq: Linux users expect their software to be installed in /usr/bin |
18:50:41 | FromGitter | <data-man> Or /usr/local/bin |
18:50:51 | Araq | or /opt, yeah yeah, I know, I know |
18:50:56 | FromGitter | <kaushalmodi> Also installers (almost all that I know of) support a `--prefix` switch |
18:51:15 | dom96 | yeah.... we've been there |
18:51:42 | FromGitter | <kaushalmodi> the general flow is: ⏎ ⏎ ```./configure --prefix=/foo/bar ⏎ make ⏎ make install``` [https://gitter.im/nim-lang/Nim?at=5b6c8d3e179f842c9716a473] |
18:51:48 | FromGitter | <kaushalmodi> done |
18:51:50 | FromGitter | <kaushalmodi> no tinkering of PATH needed |
18:52:10 | * | stefanos82 quit (Quit: Quitting for now...) |
18:52:15 | FromGitter | <kaushalmodi> (user doing this would know to add `/foo/bar/bin` to their `PATH` before-hand |
18:52:46 | Araq | thank you for telling me everything I already knew. |
18:53:07 | Araq | I only had a hole of knowledge when it comes to PATH. |
18:53:16 | Araq | and got enlightened, thanks. |
18:53:29 | FromGitter | <kaushalmodi> Araq: You mentioned the lack of automation.. so just connected the installation flow with PATH |
18:53:40 | FromGitter | <kaushalmodi> Sorry for over-elaboration |
18:54:07 | Araq | plenty of people don't have 'sudo' and still want to enjoy Nim ;-) |
18:54:15 | FromGitter | <kaushalmodi> I don't |
18:54:18 | * | francisl quit (Quit: francisl) |
18:54:21 | FromGitter | <kaushalmodi> my flow is for non-sudo installs |
18:54:22 | Demos[m] | yeah my 2c is to just make it easy to get the output in the usual GNU Install Dirs layout and let package maintainers deal with setting path |
18:54:25 | FromGitter | <kaushalmodi> and so the --prefix |
18:55:00 | dom96 | At this point we may as well tell people to use Docker |
18:55:11 | dom96 | I've seen people who do that by default |
18:55:18 | Araq | +1 |
18:55:34 | dom96 | They just grab a Docker image and alias `nim` to `docker run blah blah` |
18:55:53 | Demos[m] | ugh |
18:55:55 | FromGitter | <kaushalmodi> Grokking docker is on my todo list |
18:56:14 | FromGitter | <kaushalmodi> Docker is not known/installed in my work/field |
18:56:20 | FromGitter | <data-man> I hold nim in the /home/projects/Nim/bin and link it to /usr/local/bin :) |
18:56:39 | FromGitter | <kaushalmodi> @data-man I do linking, but using GNU Stow |
18:57:04 | dom96 | I just add ~/projects/nim/bin to my PATH |
18:57:31 | FromGitter | <kaushalmodi> I manage multiple versions of tools using stow |
18:57:36 | FromGitter | <kaushalmodi> ```> /home/kmodi/stowed/bin/nim -> ../../stow/pkgs/nim/devel/bin/nim``` |
18:58:31 | Demos[m] | heh I have a nim implementation of stow sitting around :D |
18:58:31 | FromGitter | <data-man> Stow? Perl? No, thanks! :) |
18:58:47 | Araq | btw the usual ./configure script is hard to audit, but whatever |
18:59:06 | FromGitter | <kaushalmodi> @data-man Thankfully I never needed to debug it |
18:59:06 | Demos[m] | please don't call it configure unless it's actually from autotools |
18:59:14 | FromGitter | <kaushalmodi> It Just Works(TM) |
18:59:52 | Araq | Demos[m], we don't use autotools and have no configure |
19:00:08 | Demos[m] | good. Let's keep it that way :D |
19:02:27 | FromGitter | <data-man> @Araq Why build scripts don't use masks (*.c)? |
19:02:33 | Araq | the downside is though that we don't check whether your C compiler has a non-buggy memcpy() implementation |
19:03:19 | Araq | or whether your hardware has a CPU. |
19:03:57 | Demos[m] | heh yeah. So like autotools is bad. but it's so bad, and so few understand how to do anything clever that it does enforce some conventions on packages |
19:04:46 | Araq | data-man: because it's generated code |
19:05:09 | FromGitter | <data-man> So let's to generate code with masks. |
19:06:09 | Demos[m] | do you mean globs? |
19:06:30 | FromGitter | <data-man> Yes. |
19:06:44 | Demos[m] | if so it's because it makes it hard to detect when you need to reconfigure the project |
19:06:56 | Demos[m] | some build systems do use them, along with a daemon to monitor inotify events |
19:07:06 | Demos[m] | but like on linux it's impossible to correctly use inotify for this |
19:07:44 | Demos[m] | build2 and bazel come to mind here |
19:08:32 | Demos[m] | any in any case it only makes sense for languages with a compilation model of one file per compiler output |
19:08:40 | Demos[m] | of which nim is not one |
19:09:22 | FromGitter | <data-man> I like the tup (I promote it each time :) ) |
19:09:53 | Demos[m] | I like meson |
19:12:44 | FromGitter | <data-man> ninja in nim = nimja! https://github.com/RedBeard0531/nimja |
19:14:50 | * | Typhon0 joined #nim |
19:17:02 | Araq | data-man: firstly, do not touch this code |
19:17:16 | Araq | secondly, why are globs better, it's generated code? |
19:18:20 | FromGitter | <data-man> Tiny scripts, more readable. |
19:18:34 | Araq | thirdly, see firstly, Nim builds on Solaris and vxWorks, don't change it |
19:19:10 | * | Typhon0 quit (Remote host closed the connection) |
19:19:22 | FromGitter | <kayabaNerve> Please don't require Docker. Please. Why change it? |
19:19:46 | Araq | I'm not changing anything but I noticed VSCode on Linux has trouble to find 'nimsuggest' |
19:20:15 | FromGitter | <kayabaNerve> "VSCode on Linux" "trouble" |
19:20:30 | FromGitter | <kayabaNerve> I don't think this is a Nim problem, for some reason... |
19:20:37 | FromGitter | <kaushalmodi> .. all of this discussion because of an editor. On Emacs, set the `nimsuggest-path` and be done :P |
19:20:42 | * | celyr0 joined #nim |
19:21:57 | Araq | I can do the same for VSCode but it's nice to have software that doesn't require so much configuration... |
19:22:05 | * | celyr0 quit (Read error: Connection reset by peer) |
19:22:58 | livcd | yeah dont break solaris please |
19:23:20 | FromGitter | <kaushalmodi> Araq: VSCode should be asked to look for the binary in the PATH |
19:23:34 | FromGitter | <kaushalmodi> It's user's problem that that binary goes to PATH |
19:23:41 | FromGitter | <kaushalmodi> Emacs auto sets that var using `(executable-find "nimsuggest")` |
19:23:51 | Araq | kaushalmodi: the PATH lacks it for idiots like me who modified .bashrc |
19:25:05 | Araq | which is what started this conversation. and then I thought, "maybe Nim's scripts/koch can do that out of the box" |
19:25:32 | * | francisl joined #nim |
19:25:56 | livcd | someone just asked for a pirated copy of Nim in Action on the forums ? |
19:26:04 | FromGitter | <kaushalmodi> got it. So your quick fix might be just symlinking nimsuggest in one of the dirs that you already have in PATH |
19:26:31 | Araq | yeah but here is the thing, I don't know what I have in PATH because when I type |
19:26:34 | Araq | echo $PATH |
19:26:39 | dom96 | livcd: lol what |
19:26:40 | Araq | in my bash ... it's there :P |
19:26:52 | FromGitter | <kayabaNerve> Who uses Solaris? |
19:27:12 | livcd | AT&T,British Telecom,Goldman Sachs |
19:27:37 | dom96 | It's pretty easy to find a pirated copy tbh |
19:28:36 | livcd | tbh i bought all my manning books on 50% off sales |
19:28:38 | FromGitter | <kaushalmodi> why doesn't this work on forum? |
19:28:41 | FromGitter | <kaushalmodi> ````Nim_in_Action.pdf <https://www.youtube.com/watch?v=dQw4w9WgXcQ>`_``` |
19:29:23 | Araq | Solaris is awesome, it has ZFS which is the best FS because it starts with a Z so it's the last FS you will ever need |
19:29:26 | FromGitter | <kaushalmodi> That link shows up unhyperlinked :) |
19:30:52 | livcd | Solaris is awesome because the servers it runs on are aesthetically pleasing |
19:31:08 | FromGitter | <kayabaNerve> Araq seems legit |
19:32:22 | dom96 | kaushalmodi: docgen bug. You need some non-hyperlinked text before it |
19:33:28 | livcd | what kind of drugs do you need to take in order to ask for a pirated copy on the official forums ? |
19:34:28 | dom96 | This user seems like a troll |
19:34:31 | dom96 | Check their post history |
19:39:08 | miran | with UFC, is it acceptable to have functions that are called `letterCount` instead of `getLetterCount`, so you can do something that looks like attribute: `string.letterCount` instead of `string.getLetterCount()`? or does it add confusion? |
19:39:40 | Araq | afaict the consensus is to leave out the 'get' but not the '()' |
19:39:50 | dom96 | `letterCount` to me implies a simple lookup |
19:39:53 | dom96 | not a count operation |
19:40:04 | dom96 | although `getLetterCount` implies the same tbh |
19:40:11 | Araq | string.countLetters() |
19:40:16 | dom96 | yeah |
19:40:49 | miran | Araq: ok, didn't know that () should stay |
19:41:30 | Araq | well I personally don't use them much, but others prefer it this way. |
19:42:01 | miran | ok, so piping is done as: `string.firstFunc().secondFunc().etc()`, and not `string.firstFunc.secondFunc.etc` |
19:42:21 | * | ng0 joined #nim |
19:42:22 | Araq | no, it depends on what these Funcs do. |
19:42:47 | Araq | the idea is that the () is for "expensive" calls |
19:43:02 | miran | aha! |
19:43:35 | miran | these my funcs are quite simple, and without () looks fine to me |
19:44:50 | Araq | it's mostly a matter of taste, I leave out the () and use a profiler instead |
19:45:37 | miran | for example, `parseInt` or `splitLines` don't need the (), right? |
19:46:05 | Araq | both of these would count as "expensive" |
19:47:52 | Araq | but others would use the () for "has side effects" |
19:48:18 | miran | so () for procs, no() for func :) |
19:49:16 | Araq | sounds acceptable to me |
19:49:37 | miran | thanks for the clarifications! |
19:50:08 | * | Vladar quit (Remote host closed the connection) |
19:53:24 | * | wsm joined #nim |
19:53:34 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
19:54:16 | * | wsm quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
19:54:34 | * | francisl quit (Quit: francisl) |
19:56:14 | FromDiscord_ | <exelotl> hey will anything ever happen with this mascot? I adore the design https://github.com/nim-lang/Nim/issues/7768 |
19:58:22 | Araq | sorry, but it reminds me too much of the Gopher. |
19:59:34 | Araq | and I can't stand these fluffy designs, give us something more gritty |
20:01:44 | Araq | let's try a lion |
20:02:27 | * | a_b_m joined #nim |
20:03:02 | * | a__b__m joined #nim |
20:05:18 | Araq | or Cthulhu |
20:05:26 | * | abm quit (Ping timeout: 244 seconds) |
20:05:38 | Araq | or Pikachu |
20:06:02 | miran | you can't go more badass than honey badger |
20:06:16 | Araq | or Appa |
20:06:59 | * | a_b_m quit (Ping timeout: 244 seconds) |
20:07:16 | Araq | or Momo |
20:07:54 | Araq | or Khorne |
20:08:47 | miran | off/on-topic: the code that runs fine on 0.18, i get "out of memory" output on 0.18.1 |
20:10:16 | dom96 | Lion please |
20:10:38 | * | natrys joined #nim |
20:10:41 | FromDiscord_ | <exelotl> I'd strongly oppose the honey badger because I don't think a mascot should look like it wants to tear you limb from limb |
20:11:23 | FromDiscord_ | <exelotl> lion could be good but it needs something distinctive so it's not just 'a lion' |
20:12:25 | * | vosper joined #nim |
20:12:36 | Araq | exelotl: I agree completely, don't worry about the honey badger |
20:13:32 | TheLemonMan | I kept misreading "honey badger" as "horny badger" and was thorougly confused for a bit |
20:13:48 | miran | TheLemonMan: also good idea! :D :D |
20:14:04 | FromDiscord_ | <exelotl> lmao |
20:14:44 | Araq | miran, huh, that's new. I thought the allocator got better |
20:15:57 | miran | Araq: my devel is "Compiled at 2018-07-13" - if it got better in the last month or so, i could update it and try again |
20:17:05 | Araq | yup, please try again |
20:17:47 | Araq | if you need fluffy, start with this, maybe, https://vignette.wikia.nocookie.net/nickelodeon/images/d/d2/Momo.png/revision/latest/scale-to-width-down/250?cb=20170428224745 |
20:21:03 | Araq | it's an evolved monkey that can fly with its ears, maybe symbolizing Nim's flexibility or something |
20:22:01 | Araq | it's from my favorite cartoon for children |
20:22:36 | dom96 | a cute lion would be better IMO |
20:23:14 | Araq | a cute Cthulhu? |
20:23:18 | Araq | :P |
20:23:20 | FromDiscord_ | <libman> I propose we use a chainsaw as the Nim mascot. |
20:23:26 | FromGitter | <arnetheduck> oy, @dom96 - any chance of adding nimbus to nim-lang front page projects? |
20:24:16 | dom96 | arnetheduck: sure, got a logo for it? |
20:25:26 | FromDiscord_ | <libman> Chainsaws are very productive and useful power tools. And it references the blockCHAIN. |
20:26:18 | FromGitter | <arnetheduck> dom96, hm, we can use the status logo for now - I can probably find a high-res version of it somewhere - or do you have one already perhaps? speaking of which, a logo competition is in the works :) |
20:27:29 | dom96 | I can just create a logo like for the other projects |
20:27:34 | dom96 | just wondering if you have something specific |
20:27:41 | dom96 | I'll be adding Status under the Top Sponsors section |
20:27:55 | * | rkta joined #nim |
20:28:12 | * | rkta quit (K-Lined) |
20:31:35 | Demos[m] | it would need to be a fluffy chainsaw |
20:32:08 | Demos[m] | (I'm willing to chip in if we need to commission something) |
20:32:45 | Araq | well I now want Momo... |
20:33:12 | Araq | but give it a crown. and maybe mutate it in order to avoid copyright problems |
20:34:51 | dom96 | IMO a real animal is the best mascot |
20:35:22 | Araq | the world of mascots is running out of real animals though |
20:35:42 | Araq | and a lion is a bit boring tbh |
20:36:25 | FromDiscord_ | <libman> Chainsaw chainsaw RAH RAH RAH! |
20:37:30 | Demos[m] | a predator could be good, a hunter. Harkin back to Nimrod and when fun was still allowed |
20:41:42 | Araq | Momo is a good hunter :P |
20:41:56 | miran | Araq: after updating devel to the latest version - it works! (no more "out of memory") |
20:44:41 | Araq | give the lion big ears so that it can fly |
20:45:38 | miran | aNIManiacs? |
20:45:52 | Araq | https://xkcd.com/353/ |
20:46:12 | miran | one of the search results: http://images4.fanpop.com/image/photos/16900000/Warner-Siblings-Monarchs-animaniacs-16925494-1165-713.jpg |
20:46:44 | Araq | we *need* an animal that can fly. |
20:51:23 | Araq | miran, -1 |
20:51:42 | miran | don't worry, i wasn't serious ;) |
20:52:46 | Araq | omg, haven't seen this before https://xkcd.com/2030/ it's so true |
20:54:27 | Araq | "I don't quite know how to put this, but our entire field is bad at what we do, and if you rely on us, everyone will die" LOL |
20:56:42 | dom96 | Updating the paypal donations is such a pain |
20:58:04 | * | Trustable quit (Remote host closed the connection) |
21:02:31 | FromDiscord_ | <libman> Ok, I got it. An animated flying fluffy Prince Vultan (as played by Brian Blessed) wearing a crown and holding a chainsaw! |
21:03:21 | Araq | fluffy + chainsaw doesn't work |
21:03:21 | * | miran quit (Ping timeout: 240 seconds) |
21:03:32 | FromGitter | <cooldome> Hi, I am trying to find a place in compiler's codegen where compiler adds _2, _3 to the coflicting variables names. |
21:04:03 | FromGitter | <cooldome> Araq, can you say where is it please? |
21:04:18 | Araq | sighashes.nim |
21:04:30 | FromDiscord_ | <libman> Nim shouldn't be fluffy. It should be a blockCHAIN power tool that cuts through anything! |
21:05:20 | Araq | proc idOrSig*(s: PSym, currentModule: string, |
21:05:20 | Araq | sigCollisions: var CountTable[SigHash]): Rope |
21:05:35 | FromDiscord_ | <libman> Sheep are fluffy. Wake up sheeple! |
21:05:45 | Araq | iirc that's the only place where it's done |
21:07:33 | FromDiscord_ | <libman> Vast BigDotCom and government conspiracy to disempower us! |
21:08:35 | FromDiscord_ | <libman> Ok, my final suggestion: flying animated unfluffy Alex Jones wearing a crown with two chainsaws. |
21:09:30 | FromDiscord_ | <libman> (Or my old suggestion of a T-Rex.) |
21:09:35 | FromGitter | <cooldome> Thanks. Looks like somehow I have messed up owners while delaying transf now I get duplicate `i` variables in some rare hard to trace cases. |
21:10:14 | Araq | oh yeah, this "owner" mechanism is just wrong |
21:11:20 | Araq | and shouldn't have been introduced |
21:12:24 | * | aziz joined #nim |
21:12:45 | Araq | but now we're stuck with it. |
21:17:47 | * | drot15 joined #nim |
21:18:42 | * | Kinny4 joined #nim |
21:18:47 | * | drot15 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
21:19:47 | FromGitter | <arnetheduck> logo competition for another status / ethereum lang: https://github.com/ethereum/vyper/issues/794 |
21:20:21 | * | Kinny4 quit (Remote host closed the connection) |
21:23:41 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
21:28:43 | FromGitter | <timotheecour> sorry silly question: anyone knows how to search for posts I’m seeing here and allow sorting results? I’m using gitter but judging from https://gitlab.com/gitlab-org/gitter/webapp/issues/566 it’s not supported; or maybe another software than gitter will allow me that? |
21:30:40 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:30:52 | dom96 | timotheecour: Google + site:irclogs.nim-lang.org is likely the best option |
21:33:53 | FromGitter | <timotheecour> @dom96 thanks for the tip; is there an easy way to store locally all of these messages? than i could write my own search/sort from local data (hopefully has a json or other text format) |
21:34:04 | * | vosper joined #nim |
21:34:39 | * | Jesin quit (Read error: Connection reset by peer) |
21:36:40 | * | Jesin joined #nim |
21:38:55 | dom96 | arnetheduck: You guys got a repo/page with high quality Status logos anywhere? |
21:39:55 | vosper | \Is there any documentation about what the ints returned by socket.sendTo mean? https://nim-lang.org/docs/net.html#sendTo,Socket,string,Port,pointer,int,Domain,int32 |
21:40:19 | Araq | it's usually "bytes sent" |
21:40:59 | vosper | Oh, thanks... and if it's -1? |
21:41:08 | vosper | Some kind of error? |
21:41:18 | Araq | yes |
21:41:55 | vosper | Anyway to find out what the error is? (If it's not obvious, I'm very new to Nim) |
21:42:28 | dom96 | It'll raise on error |
21:42:29 | Araq | "You may wish to use the high-level version of this function which is defined below." |
21:42:34 | dom96 | Not return -1 |
21:42:50 | Araq | the high level version raises on error, dunno about the low level version |
21:42:59 | * | rayman22201 joined #nim |
21:43:07 | dom96 | hrm, no, that's not the case |
21:44:01 | FromGitter | <arnetheduck> @dom96, from what I can tell, the implementation of that particular function will not raise.. did I miss something? |
21:44:11 | dom96 | indeed |
21:44:15 | dom96 | That sucks |
21:44:17 | FromGitter | <arnetheduck> in fact, there's a useless success variable being set |
21:44:58 | Araq | according to inferred effects both would raise OSError. |
21:45:15 | dom96 | Yeah, but that's misleading :( |
21:45:24 | dom96 | Probably because of the getAddrInfo |
21:45:26 | * | abeaumont quit (Remote host closed the connection) |
21:45:37 | * | rayman261 quit (Ping timeout: 248 seconds) |
21:45:44 | Araq | but I've told you before this mechanism is just not good enough |
21:45:47 | dom96 | This might call for a breaking change |
21:46:32 | FromGitter | <arnetheduck> so the two foremost experts of the language can't tell what a function does, by looking at its signature, and get confused by what errors are inferred.. this is why we need something better |
21:46:37 | FromGitter | <zetashift> @dom86 I'm getting an error running the hello world termbox sample: https://pastebin.com/NHFtQZWe |
21:46:49 | FromGitter | <zetashift> Do I need an other Nim version? |
21:47:11 | Araq | arnetheduck. no need to put more salt into my wounds. |
21:47:53 | dom96 | zetashift: not sure, try a previous commit, I merged a PR that might have broken it recently |
21:47:55 | vosper | let socket = newSocket() |
21:47:55 | vosper | let result = socket.sendTo("127.0.0.1", Port(9187), "1234") |
21:47:55 | vosper | stdout.writeLine(result) |
21:48:16 | vosper | So that prints "-1" to stdout when I run it... but you think it definitely should raise an error |
21:48:17 | vosper | ? |
21:48:26 | dom96 | vosper: no, I was wrong |
21:48:41 | FromGitter | <arnetheduck> it's salt mixed with hot peppers, poured with pure self interest in mind - given that I'll be looking at similar bugs and issues for the foreseeable future in the code I have to work with |
21:48:42 | vosper | Oh, sorry, I wasn't following the discussion correctly, I guess |
21:49:47 | dom96 | arnetheduck: It's misleading in the context of the stdlib |
21:49:59 | dom96 | And as such it needs to be fixed |
21:50:35 | dom96 | Yes, we can make it into a much larger deal and overhaul the exception system completely or nuke the exceptions, but that's an over-reaction |
21:50:49 | * | Guest15155 joined #nim |
21:51:00 | Araq | I wrote a long RFC that solves all of these problems. |
21:51:24 | Araq | at the cost of unknown new problems and a massive code breakage |
21:51:38 | dom96 | Yes, and I'm skeptical that it actually fixes this problem |
21:52:19 | dom96 | vosper: Sorry, we get side tracked a lot here, it's easy to get lost :) In any case, I consider this a problem in the stdlib, the `sendTo` function shouldn't return an int |
21:53:10 | * | Demos_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
21:53:18 | Araq | I think 'sendTo' is fine, the low level procs return "bytes sent or negative value for errors" |
21:53:29 | dom96 | The low level procs don't belong in `net` |
21:53:33 | dom96 | That's what `nativesockets` is for |
21:53:45 | * | danielhuman joined #nim |
21:53:45 | vosper | @dom96: ok, thanks. So, for now, there's no way for me to tell why there's an error? It seems odd that trying to send a UDP message to localhost could error, anyway... |
21:54:01 | * | noonien quit (Quit: Connection closed for inactivity) |
21:54:38 | FromGitter | <zetashift> yea dom works with the previous commit, should I open an issue? |
21:54:41 | Araq | there is raiseOSError(osLastError()) |
21:54:46 | dom96 | vosper: You're not initialising the socket correctly: newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) |
21:55:00 | dom96 | It gets created as a TCP socket by default |
21:55:12 | dom96 | zetashift: please, or just fix it if you can |
21:55:23 | vosper | @dom96 Oh, I just looked at the example for a UDP socket in the docs https://nim-lang.org/docs/net.html#examples-connecting-to-a-server |
21:55:33 | dom96 | vosper: yeah, that's invalid, it was fixed recently |
21:55:43 | FromGitter | <arnetheduck> @dom96 the fact that it can and does happen in the stdlib is exponentially worse - it means that anyone writing code that uses the stdlib is clueless about how errors are reported and writes equally shitty code in turn |
21:55:45 | dom96 | but docs are always pointing to the latest stable release |
21:56:00 | * | Guest15155 quit (Ping timeout: 256 seconds) |
21:56:21 | vosper | Oh, I see. Yeah, the code you posted looks a lot more like what I'm used to. |
21:56:54 | FromGitter | <arnetheduck> https://medium.com/message/everything-is-broken-81e5f33a24e1 is the canonical article on the subject :) |
21:57:27 | dom96 | arnetheduck: You cannot prevent all mistakes |
21:57:34 | dom96 | No matter how hard you try |
21:57:49 | dom96 | Of course I'm happy to hear suggestion about how to limit the mistakes more effectively :) |
21:57:53 | dom96 | *suggestions |
21:58:27 | * | danielhuman quit (Ping timeout: 240 seconds) |
21:59:17 | vosper | @Araq your suggestion got me "Error: unhandled exception: Socket is not connected [OSError]" which is better than -1, but I'm not sure I would have figured the problem out (though, I probably would have if I'd been reading the fixed docs) |
22:01:06 | dom96 | yeah, we could add a check in sendTo/recvFrom to verify the protocol is right |
22:01:25 | dom96 | Perhaps we should have created distinct types for these in the first place :( |
22:01:41 | FromGitter | <zetashift> oh welp I ran into an other error and googling seems that the C libs of termbox don't support windows haha |
22:01:59 | FromGitter | <zetashift> I'll try to fix the error on the latest commit for now |
22:02:19 | FromGitter | <cooldome> I need some some insights. ⏎ Anyone has idea why the following proc can get duplicate `i` definition in the codegen, but only if a compiling a module that calls another module that calls this one from system.nim: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5b6cb9eb67eb9f60febb59bf] |
22:02:46 | FromGitter | <arnetheduck> I'd say that's what @Araq's RFC is about .. boils down to taking a hard stance on errors similar to 'discard', making explicit every time you're ignoring them at some reasonable boundary (functions probably) |
22:02:49 | dom96 | zetashift: oh yeah, I'm afraid they don't :( |
22:03:04 | FromGitter | <cooldome> At least an idea how I can trace it down |
22:03:31 | dom96 | arnetheduck: can you outline how Araq's proposal would help in this situation? |
22:04:53 | dom96 | Btw nimbus is now a featured project and status is displayed in the top sponsors section on https://nim-lang.org/ |
22:05:09 | dom96 | (If you have a better logo I'll happily replace it) |
22:10:03 | FromGitter | <zetashift> fixed the error though running into another one |
22:10:25 | FromGitter | <zetashift> I'll boot into my arch see if I still get this stuff one that |
22:11:09 | FromGitter | <arnetheduck> https://github.com/nim-lang/Nim/issues/7826 - so the fundamental issue with that function is that it has two error reporting styles and it's not obvious which one is being used from the signature.. the fact that there's a result/return value indicates that the author of the function assumed exceptions would not happen, or wanted to make life hard for whoever calls the function by forcing the caller to handle errors |
22:11:09 | FromGitter | ... in two ways.. if it was the former, the compiler should have prevented it, and if it was the latter, they should have had to annotate the function explicitly to make sure that the poor choice is onerous to make |
22:15:00 | FromGitter | <arnetheduck> @dom96 - cool - I'll get back to you with a high-res logo as soon as I find it, it should be the blue-and-white status thing |
22:15:28 | Araq | to put it differently, essentially the exception mechanism circumvents the type checker |
22:15:57 | FromGitter | <arnetheduck> @dom96 - actually, you have it already - down in the sponsors part - can just reuse the same? |
22:16:30 | dom96 | arnetheduck: it would be nice to get a different logo for Nimbus and/or Status |
22:16:33 | Araq | and "tracking" these exceptions is smart, but you don't want "smart" in your type signatures. |
22:17:04 | Araq | you want smart in the proc body, not in its signature. |
22:17:10 | dom96 | Actually, this misleading tracking can be solved by highlighting inferred exceptions |
22:17:50 | dom96 | And allowing me to specify: this proc definitely raises OSError |
22:18:02 | dom96 | (as opposed to: this proc /only/ raises OSError) |
22:19:34 | dom96 | Exception tracking and the effect system is a brilliant feature, it's just limited, it needs to be more flexible |
22:19:45 | dom96 | It shouldn't shackle me |
22:20:44 | dom96 | You could maybe even provide a count of how far in the call stack the `raise` occurs |
22:21:48 | FromGitter | <arnetheduck> lots of brand logos to choose from: https://github.com/status-im/design-guides - until nimbus gets its own, the status one is really the most appropriate for the project as well |
22:22:00 | * | natrys quit (Quit: natrys) |
22:22:09 | Araq | that's the first thing you hide from the compiler, dom96 |
22:22:30 | Araq | because of callbacks that can do "anything" and async is built on top of these |
22:22:33 | * | aziz quit (Quit: Ex-Chat) |
22:23:03 | dom96 | arnetheduck: cool, I'll use this one for the Top Sponsors: https://github.com/status-im/design-guides/blob/master/status-logo-symbol.svg |
22:23:52 | Araq | on the other hand, sendTo(): int throws Exception has the same problem. |
22:24:05 | Araq | sendTo: Natural throws Exception hasn't. |
22:25:05 | dom96 | Even for async procs I can mark them as raising OSError |
22:25:29 | Araq | you can, the compiler infers "raises Exception" though |
22:25:44 | dom96 | yes, and that's fine |
22:26:37 | dom96 | An explicit statement like: {.raises: Inferred & [OSError].} would be great |
22:27:12 | Araq | it infers the OSError too, I don't understand you |
22:29:03 | dom96 | If the docgen shows me that the OSError has been specified explicitly, then that proves that OSError will be used to signal an error by the procedure |
22:29:24 | * | Jesin quit (Read error: Connection reset by peer) |
22:29:29 | dom96 | Currently there is no way to distinguish inferred exceptions and explicit in the docs |
22:29:35 | Araq | as opposed to the inferred exceptions that the compiler has proven can happen too? |
22:29:52 | dom96 | And there is no way to flexibly state exceptions explicitly |
22:31:01 | Araq | inferred exceptions are not worse than your manual annotations, the problem is that the inference allows you to be sloppy |
22:33:01 | dom96 | I want to be able to signal to the user of my procedure that a certain exception isn't just something I forgot to handle |
22:33:11 | dom96 | It's specifically used by my procedure to signal errors |
22:33:19 | dom96 | Another topic: https://github.com/nim-lang/Nim/blame/devel/lib/pure/net.nim#L1401 |
22:33:26 | dom96 | How many times have you actually used &=? |
22:35:03 | Araq | I thought it would grow on me but I found an even better way of doing the same |
22:35:51 | Araq | still a generic 'sink' operator is sexy and Python can only dream about it |
22:37:08 | dom96 | It's bloat |
22:38:32 | Araq | maybe. strings/seqs have 'add', files have 'write' and sockets have 'send', kinda messy |
22:38:49 | * | badon joined #nim |
22:39:12 | * | badon is now known as Guest74433 |
22:39:36 | Araq | and an operator avoids this problem, hence '&=' |
22:39:49 | dom96 | Yeah, Unix solves this whole mess by making everything a file |
22:39:57 | * | Guest74433 quit (Killed (Unit193 (Spam is not permitted on freenode.))) |
22:40:07 | dom96 | Surprised you don't love this approach :P |
22:40:22 | dom96 | Maybe Unix just hasn't gone far enough |
22:40:31 | dom96 | After all, you still have write vs. send |
22:40:39 | Araq | 1. that's not what Unix does. |
22:41:03 | Araq | 2. Unix doesn't give us a consistent "write" verb as you noticed. |
22:41:42 | Araq | 3. "write" for strings feels weird for strings, "add" feels weird for files/sockets, hence &= |
22:41:51 | AlexMax | Plan 9 allows you to open tcp connections using the filesystem, iirc |
22:42:41 | FromGitter | <Varriount> I've said it before: we should have an SQL based OS |
22:43:00 | * | ng0 joined #nim |
22:43:41 | dom96 | Why in the world is osLastError in ospaths? |
22:44:07 | dom96 | Araq: &= feels weird for everything |
22:44:26 | Araq | it's not, it's in oserr.nim, but that's not a module of its own |
22:44:39 | dom96 | https://nim-lang.org/docs/ospaths.html#raiseOSError,OSErrorCode,string |
22:45:23 | FromDiscord_ | <libman> Everything is a stream.\ |
22:45:57 | Araq | you can never take a bath in the same stream |
22:47:24 | Araq | x = x & "x" --> x &= "x" |
22:47:34 | Araq | it definitely is not weird for strings |
22:48:07 | dom96 | it is when you are used to x.add "x" :) |
22:48:10 | FromDiscord_ | <libman> &= is not any weirder than += |
22:49:26 | FromDiscord_ | <libman> But I'm sure people will soon start creating ASCII porn operators in their Nim modules... |
22:52:20 | * | echotangoecho joined #nim |
22:53:56 | FromGitter | <data-man> > Everything is a stream. ⏎ ⏎ Yes! And everything (except smell, maybe) have the size. #8185 :-D |
22:55:26 | * | elrood quit (Quit: Leaving) |
23:10:36 | * | Sembei joined #nim |
23:11:57 | * | Pisuke quit (Ping timeout: 244 seconds) |
23:15:11 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:21:42 | * | echotangoecho quit (Quit: Lost terminal) |
23:43:16 | * | MyMind joined #nim |
23:44:04 | * | Sembei quit (Ping timeout: 260 seconds) |
23:44:19 | * | vosper quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:48:32 | * | vosper joined #nim |