<< 09-08-2018 >>

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:26FromGitter<kayabaNerve> Yep
00:54:31FromGitter<kayabaNerve> Or .int32
00:54:43FromGitter<kayabaNerve> Or ((int32) 128)
00:54:49FromGitter<kayabaNerve> Or int32 128
01:04:13AlexMaxWhat is #?
01:04:37AlexMaxThe unofficial FAQ mentions this as a way to convert your tabs to spaces before compiling
01:04:40AlexMax#? replace(sub = "\t", by = " ")
01:05:10AlexMaxdoing a search for it in the manual comes up with 0 results and it's ungoogleable
01:06:01FromGitter<kayabaNerve> AlexMax: `#?` or `#`
01:06:05FromGitter<kayabaNerve> `#` is a comment...
01:06:32AlexMax#?
01:07:14FromGitter<kayabaNerve> https://forum.nim-lang.org/t/2105
01:07:20FromGitter<kayabaNerve> This says try #!
01:08:19FromGitter<kayabaNerve> https://nim-lang.org/docs/filters.html
01:08:54FromGitter<kayabaNerve> That says it's ⏎ `#? replace("\t", " ")`
01:08:59*endragor joined #nim
01:09:44AlexMaxah 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:47FromGitter<kayabaNerve> AlexMax #! or #? :P
01:46:37FromGitter<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:30FromGitter<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:22FromGitter<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:11FromGitter<alehander42> how to create a set from seq
05:45:20FromGitter<alehander42> toSet ?
05:48:34*gmpreussner joined #nim
05:56:06FromGitter<alehander42> @Araq are they init string = "" and seq = @[]
05:56:10FromGitter<alehander42> going to apply to js backend
05:56:50FromGitter<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:38FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6bde9e2a8e6c60839b877d]
06:32:35*ng0 joined #nim
06:41:50FromGitter<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:50FromGitter... issues)
06:45:05*yglukhov[i] quit (Ping timeout: 240 seconds)
06:45:23FromGitter<felipetesc> hi there ! I'm wondering if any of you I cab use jester for production ????
06:48:05FromGitter<gogolxdong> I used to , but it failed for unknown reason since not long ago, you can ask @dom96
06:48:52FromGitter<gogolxdong> `var ip = inet_ntoa((castptr posix.Sockaddr_in (addr(buf[i].ifr_addr))).sin_addr)`
06:49:19FromGitter<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:58FromGitter<felipetesc> @gogolxdong ty !
06:54:17FromGitter<gogolxdong> next step is to calculate the cumulative traffic during interval for each interface.
06:55:27FromGitter<felipetesc> it seems a lot of code 4 something not so complicated
07:00:25FromGitter<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:51FromGitter<felipetesc> proc ipv4 =
07:03:55*girvo joined #nim
07:06:33FromGitter<gogolxdong> funny is I got it right in Nim, and cannot get it right in C.
07:08:27FromGitter<felipetesc> so, nim is actually making c better !
07:08:48*PMunch joined #nim
07:09:15FromGitter<gogolxdong> definitely.
07:19:16FromGitter<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:48FromGitter<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:06FromGitter<gogolxdong> Which c plugin do you usually use for C format?
08:33:43FromGitter<gogolxdong> in Vim.
08:34:21TheLemonManclang-format
08:34:56TheLemonManclang also ships with a nice plugin called clang-format.py
08:36:49FromGitter<gogolxdong> Try the following keystrokes: ⏎ ⏎ gg=G
08:37:00FromGitter<gogolxdong> this is amazing.
08:38:31TheLemonManthat works well until shit hits the fan, vim's C parser is not perfect :)
08:39:44FromGitter<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:07TheLemonManAraq, 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:03AraqI 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:35Araqin general helper 'block's are always a hack around broken gensym behaviour
08:58:07AraqI should write a blog post about hygiene in a macro system...
08:58:23Araqand why these things are so fucking hard...
08:58:41TheLemonManyeah, I discovered that the hard way but can't think of any other work-around beside rewriting mapIt as a macro
08:59:28Araqwe need to introduce "staged" template evaluation for the 'fmt' macro. that would fix evalOnce() as a sideeffect
08:59:56Araqbut first we need to fill in the holes in Nim's spec...
09:02:04TheLemonManmore yaks to shave, yay (?)
09:03:59Araqwell I enjoy writing specs, you don't have to debug them :-)
09:05:28TheLemonManunless you use latex for writing the specs, then you _also_ have to debug those :)
09:10:57*xet7 joined #nim
09:12:11AraqI 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:22Araqnews! Higgs boson debunked! the calculations were based on a typo in a latex document.
09:13:55livcdwhat if some are right just because of the typos :)
09:15:37Araqmodified theory of relativity found! Crucial insights were lost in overfull hboxes.
09:16:12FromGitter<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:32TheLemonManFermat had an overfull margin but he didn't use latex, how do you explain this?!
09:17:57AraqFermat was very ahead of his time.
09:18:57FromGitter<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:09TheLemonManhmm, 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:15TheLemonMantimotheecour: 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:16dom96Araq: I worked with a guy at CERN who's father wrote /the/ book on LaTex (also worked at CERN)
09:22:59dom96So I think the Higg's Boson is safe :P
09:26:54Araqok, so fat people continue to have a good excuse.
09:28:38FromGitter<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:44FromGitter<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:19FromGitter<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:31TheLemonMantimotheecour, the openarray literal is substituted twice in the template
09:48:02FromGitter<timotheecour> i c... any suggestions?
09:48:35TheLemonMan`compiles((let _ = s))` :P I can't think of anything else right now
09:48:50FromGitter<timotheecour> on a related note, is there a macro for is_lvalue to test whether something is an LVALUE ?
09:50:30FromGitter<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:26Araqwhen it's provably the last read operation of 'b'
09:55:04Araqwe have a broken dataflow analysis for this, but it's good enough for that one
09:56:46FromGitter<gogolxdong> Is there a solution to evaluate actual bandwidth between two peers?
09:57:58*dddddd joined #nim
10:03:01TheLemonMantimotheecour, the `compiles` should go in the `when`
10:05:35*data-man joined #nim
10:06:44FromGitter<timotheecour> do u mean: ⏎ when compiles(s.len) and compiles((let _ = s)): ... ⏎ else:
10:06:56TheLemonManyep
10:07:14FromGitter<timotheecour> that seems suboptimal because i'll lead to reallocs in result.add op
10:07:41FromGitter<timotheecour> i mean the tests pass currently :-)
10:08:33TheLemonManhm? how's that?
10:09:59FromGitter<timotheecour> `var result: seq[outType] = @[]; for a in ...; result.add op` leads to amortized O(log(n)) realloc calls
10:10:24FromGitter<timotheecour> vs a single alloc call if we know length ahead of time
10:10:29*krux02 joined #nim
10:10:42TheLemonManmeh, if you use bare openarray literals you deserve that :)
10:11:15TheLemonManwe 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:50FromGitter<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:05krux02TheLemonMan, there are no openarry literals
10:12:44FromGitter<timotheecour> i think he's referring to: `doAssert openArrayint ([1,2]).mapIt(it) == @[1,2]`
10:12:51krux02openarray is just a way to pass consecutive data without copy
10:13:32krux02well I don't know what openArrayint is
10:13:40krux02but it is not a literal
10:14:05krux02[1,2] is an array literal, tho other thing is a forced conversion
10:14:20TheLemonMantimotheecour, 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:41krux02and to be honest, I think that assertion is wrong, because it ensures that ater map the type is explicity a seq
10:14:46krux02I do not agree on that
10:15:40krux02TheLemonMan, then I guess there is a template implemented incorrectly.
10:15:50FromGitter<timotheecour> i don't understand; what do u expect on RHS of "doAssert openArrayint ([1,2]).mapIt(it) == " ?
10:16:22TheLemonMankrux02, yes, that's what I was trying to say
10:17:06krux02timotheecour: I would implement a test, that only checks for the length of the result and content, but not type.
10:18:00krux02in functional programming, when you do ``map`` on something, you generally do not want it to secretly change the type of the collection
10:18:24krux02there as cases where it does make sense to change the type of the collection though
10:18:30krux02(I think)
10:19:22krux02timotheecour: I would change the structure of thesting the content to a loop.
10:19:35FromGitter<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:33krux02no functional programming does not operate per se lazy
10:20:38krux02haskell operatos lazy
10:20:47krux02but haskell is not the definition of functional programming
10:21:15krux02Scala and Ocaml are good non lazy functional programming languages, too.
10:22:10FromGitter<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:03FromGitter<timotheecour> anyhow, changing return type of `sequtils.mapIt` to something other than `seq` is definitely out of scope of this PR
10:29:06FromGitter<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:05FromGitter<timotheecour> again; everything in sequtils returns a `seq` ; for lazy variants of map, filter, etc, other modules can be used.
10:31:45Araqyup, what timotheecour said. btw is Timothee your first name?
10:32:05*xet7 quit (Remote host closed the connection)
10:32:30FromGitter<timotheecour> yup
10:33:54krux02I thought it was Timo
10:33:55*clyybber joined #nim
10:34:00krux02Timo the Courious
10:34:08FromGitter<timotheecour> lol
10:34:37krux02:P
10:35:08FromGitter<alehander42> I agree, I just opposed the idea that seq is a bad return type :D
10:35:53FromGitter<alehander42> I wondered myself about that when initially creating zero-functional
10:36:25FromGitter<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:02FromGitter<alehander42> afaik @michael72 implemented something like that in zero-functional, but with additional hints
10:41:39FromGitter<timotheecour> no more hints needed! see https://github.com/zero-functional/zero-functional/issues/36#issuecomment-410977005
10:43:06FromGitter<alehander42> oh nice, michael is really doing wonders
10:43:11FromGitter<alehander42> yeah i wondered about the to iter
10:43:42*clyybber2 joined #nim
10:44:54FromGitter<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:54FromGitter<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:28FromGitter<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:36FromGitter<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:38FromGitter<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:50FromGitter<mpcjanssen> @timotheecour manipulate the DOM efficiently? JS != wasm
10:54:02FromGitter<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:32FromGitter<alehander42> @timotheecour well wasm is in early stages yet, it's a bit like "c backend vs x86_64 backend"
10:55:36FromGitter<mpcjanssen> that only exposes dom events not the whole dome itself
10:55:54FromGitter<alehander42> it's very important for interop with dom, all the other js libs/frameworks etc
10:56:08FromGitter<alehander42> and we honestly need our own wasm backend
10:56:10FromGitter<mpcjanssen> probably because it's used to update a WebGL canvas
10:56:23FromGitter<alehander42> because I can't imagine how would one debug a nim=>c=>ermscripten=>wasm thing
10:56:30FromGitter<alehander42> app*
10:58:05*spirit_pact joined #nim
10:58:15krux02timotheecour: WASM is really just a compilation target that can be executed in the browser
10:58:53FromGitter<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:57krux02alehander42: printf debugging
11:00:14krux02well the talks on WASM say it it can't access the DOM, but they are working on it.
11:00:29FromGitter<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:35krux02I personally hope for a WASM compilation target outside of the browser.
11:01:13FromGitter<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:23krux02I 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:35TheLemonManAraq, 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:44FromGitter<alehander42> @krux02 you write gdb tools, you know printf debugging is not enough :P
11:02:13krux02I just wanted to answer your question :p
11:02:47krux02but 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:02FromGitter<alehander42> @krux02 what do you think about https://github.com/nebulet/nebulet
11:03:10FromGitter<alehander42> ahh i got so used to it, i like it now
11:03:36FromGitter<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:50FromGitter<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:06FromGitter<mratsim> also Beamdog software is using Nim for Neverwinter Nights 1 Enhanced Edition tooling: https://github.com/niv/neverwinter_utils.nim
11:04:31FromGitter<mratsim> @timotheecour if you compile with debugger:native lldb works not too bad
11:04:47*rwg9 joined #nim
11:05:01krux02alehander42 that is for sure interesting.
11:05:25krux02I really do like webassembly, even though I normally think everything from the web is like cancer.
11:05:38FromGitter<timotheecour> (eg, --debugger:endb stops before main, but not --debugger:gdb)
11:06:35krux02timotheecour what is your issue with gdb?
11:06:46krux02I usually do --debugger:native
11:06:59krux02but that would be gdb
11:07:19krux02I don't think there is a difference between lldb and gdb debug symbols in the program.
11:07:48FromGitter<mratsim> endb is not maintained anymore, iirc Araq is looking for someone to take over.
11:07:52krux02then I run gdb with nim_gdb
11:08:19krux02mratrsim: that "someone to take over" is not going to happen any time soon.
11:08:29krux02I think it is more likely that it will be dropped entirely
11:09:28krux02mratsim: So I would rather say endb is kind of abandoned in favor of gdb.
11:09:39krux02(even though I really hate gdb debugging)
11:09:52FromGitter<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:13krux02sim code?
11:10:30krux02well I wrote a gdb plugin
11:10:32FromGitter<timotheecour> lol, typo
11:10:39krux02you run it with nim_gdb
11:10:59krux02nim-gdb I mean, sorry.
11:11:59krux02it is in /path/to/Nim/tools/nim-gdb.py
11:12:12zacharycarter[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:13zacharycarter[m]https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim#L1082
11:12:14zacharycarter[m]Also - would I need to emit code to initialize these?
11:12:46FromGitter<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:09krux02alehander42 what are you working on?
11:13:20FromGitter<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:38FromGitter<timotheecour> ( at least, endb gives me *something*)
11:13:58krux02the 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:12krux02i just puts more complexity on top, because you also have to learn gdb commands.
11:14:34TheLemonManzacharycarter[m], have a look at ccgthreadvars.nim first
11:14:46krux02what is your vesion of gdb?
11:15:01zacharycarter[m]TheLemonMan: will do
11:15:03krux02normally apple ships acient versions of open source tools
11:15:11zacharycarter[m]thanks for looking into this issue btw too
11:15:18krux02just to show off how awesome their tools are in comparison
11:16:11FromGitter<timotheecour> /Users/timothee/homebrew//bin/gdb v 8.1
11:16:13krux02timotheecour: can you past the result of ``gdb --version``
11:16:44FromGitter<timotheecour> lldb is no better: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c229c2a8e6c60839d0fac]
11:17:34FromGitter<timotheecour> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c22cd67eb9f60feb7b8b5]
11:17:53krux02that is new enough I guess
11:18:01FromGitter<timotheecour> ``` lldb --version ⏎ lldb-902.0.79.7 ⏎ Swift-4.1``` [https://gitter.im/nim-lang/Nim?at=5b6c22e9637ee66082c7f39a]
11:18:17krux02but your problem is already at starting gdb
11:18:31FromGitter<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:31FromGitter... [https://gitter.im/nim-lang/Nim?at=5b6c23062a8e6c60839d12a4]
11:18:33FromGitter<timotheecour> `sudo gdb` also doesn't work
11:19:09FromGitter<codem4ster> may be you have any idea?
11:19:39FromGitter<codem4ster> `https://pragmagic.github.io/godot-nim/master/index.html`
11:19:43krux02sorry I do not use Godot, nor Windows, nor nake
11:20:42FromGitter<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:46FromGitter<mratsim> @timotheecour, did you allow GDB/LLDB to attach to other processes? It’s a specific setup iirc
11:21:20FromGitter<codem4ster> @timotheecour how can I do that?
11:21:40FromGitter<timotheecour> yes, i've use gdb, lldb with other binaries, no problem there
11:22:37*natrys joined #nim
11:23:17FromGitter<mratsim> strange, I used lldb just yesterday with latest nim#develop without any issue.
11:23:22FromGitter<codem4ster> @timotheecour I don't know how to say to nake that use gcc instead of cl.exe :(
11:23:40FromGitter<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:18FromGitter<timotheecour> @mratsim which OS? i'm in OSX right now
11:24:46krux02codem4ster: does godot require nake to build your project? Normally Nim is compiled with nimble.
11:25:02*wildlander joined #nim
11:25:20FromGitter<mratsim> @timotheecour MacOS 10.13.6
11:26:00FromGitter<timotheecour> does both gdb and lldb work, and what versiosn of these?
11:26:23FromGitter<codem4ster> yes it needs nake @krux02
11:26:49FromGitter<mratsim> lldb-902.0.79.7, gdb didn’t try for a while
11:29:18FromGitter<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:51FromGitter<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:31FromGitter<mratsim> @timotheecour yeah the breakpoint is a hit and miss, sometimes it works but sometimes it doesn’t :/
11:51:44FromGitter<mratsim> I have the same issue currently, but I remember being able to break properly when debugging big int division in stint
11:51:54krux02I normally break with rbreak
11:52:01krux02rbreak <funcname>
11:52:24FromGitter<mratsim> @krux02 but funcnames are mangled no?
11:52:30krux02r is for regular expression, but the important part is that it doesn't require you to write the full function name
11:52:49krux02so you can skipl the base64 hash part of tho name
11:53:13FromGitter<mratsim> nice tip
11:53:32krux02so you can do rbreak on foobar and it will break on all functions containing foobar, so it works on generics, too
11:54:41krux02I think it should be in the readme
11:55:19FromGitter<alehander42> you can easily complete the function name with tab too
11:55:28FromGitter<alehander42> so b funct.. also works fine
11:55:38*mcspud26 quit (Ping timeout: 255 seconds)
11:55:39krux02there 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:03krux02alehander42: yes that works when you have one unique completion,
11:56:22FromGitter<alehander42> nope, with multiple completions too, you have to choose one of them
11:56:23krux02but it doesn't help you to pick the version with the signature you are looking for
11:56:30krux02rbreak is an easy way to break on all of them
11:56:41FromGitter<alehander42> well usually i dont want to do that :D
11:56:52krux02well I do
11:57:04FromGitter<alehander42> btw who has problems with breakpoint reliability ?
11:57:33krux02also nice, you can use the exportc pragma to control tho name of a function as it is seen from the debugger.
11:57:36FromGitter<alehander42> breaking on nim lines should work extremely correctly with the good line directives
11:57:50FromGitter<alehander42> yes I do this sometimes
11:58:11krux02alehander42 what gdb frontend do you use?
11:58:20FromGitter<alehander42> well, CLI
11:58:25krux02ok
11:58:35krux02I use emacs, which is basically just cli
11:58:43krux02plus some other windows
11:58:52FromGitter<alehander42> and for the project I am working on , I have built a custom gdb-compatible frontend too
11:59:28krux02basically it is a gdb tui, but without the fuckups
11:59:38krux02well, with some less fuckups.
12:00:13FromGitter<alehander42> I never have time to learn emacs
12:00:28FromGitter<alehander42> i dont know about gdb
12:00:37FromGitter<alehander42> but i ve heard a lot of good stuff about magit
12:00:46ldleworkmagit is the best git interface
12:01:21FromGitter<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:49ldleworkkrux02: you should move your config to https://github.com/dustinlacewell/emacs-nougat
12:02:50FromGitter<alehander42> @timotheecour file.nim:32 should definitely work
12:02:59FromGitter<alehander42> if it doesn't please report an issue
12:03:00FromGitter<mratsim> by the way, how does exportc work with generic, can we use `{.exportc:”Fooname_” & $T.}`
12:03:35FromGitter<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:04FromGitter<alehander42> no, I mean that the compiler itself should produce `#line ..` correctly
12:04:13FromGitter<alehander42> with the right options
12:04:17FromGitter<alehander42> do you use `--lineDir:on` ?
12:04:25FromGitter<timotheecour> oups!!
12:06:10FromGitter<alehander42> i think `--debugger:native` should turn lineDir on anyway
12:06:37FromGitter<mratsim> but it does
12:06:45FromGitter<mratsim> it turns 2 flags
12:06:59FromGitter<alehander42> so, does somebody have issues with `path:line` breakpoints with the flags on ?
12:07:12FromGitter<mratsim> I’ll retry
12:07:23krux02ldlework, I am confused, "Then anywhere within your outline you can include it"
12:07:26krux02what outline
12:07:35ldleworkkrux02: the org outline
12:07:44krux02what org outline?
12:08:03ldleworkthe 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:11ldleworkkrux02: look in user-outlines/
12:08:15krux02my config file is elisp
12:08:31krux02I don't plan to change that
12:08:47ldleworkkrux02: ok well saying "I don't want this" is different than the confusion you expressed.
12:08:51ldleworkI was just answering your question.
12:09:09ldleworkAnd obviously all emacs configuration is elisp. Orgmode is just a way to organize that elisp.
12:09:28krux02well you said i should move my config to emacs-nougat
12:09:45FromGitter<mratsim> @alehander42 just —debugger:native is working for me at the moment with Nim devel from yesterday.
12:09:52ldleworkkrux02: yes?
12:09:55FromGitter<mratsim> I wonder if there was a regression mmm
12:10:19krux02I just disagree on that
12:10:26ldleworkThat is clear.
12:10:31krux02ok
12:10:35krux02then everything is said
12:10:39*ldlework cringes.
12:10:50krux02but sorry, I could have said it in the first place
12:11:20FromGitter<mratsim> (https://files.gitter.im/nim-lang/Nim/veHR/2018-08-09_14-11-11.png)
12:11:41FromGitter<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:27FromGitter<timotheecour> confirmed it works for `b file.nim:line` awesome! @mratsim hmm, can u report this bug ? (ideally reduced if possible)
12:15:16FromGitter<mratsim> yeah no problem, will do later.
12:18:52FromGitter<alehander42> @mratsim breaking in io.nim when debugging test_io.nim seems to work ok for me (gdb ubuntu)
12:18:55FromGitter<alehander42> strange
12:20:15*nkk71 joined #nim
12:21:01dadabidetSince nim generates C code, is it compatible with tinycc ?
12:21:15FromGitter<mratsim> @dadabidet, yes
12:21:18dadabidetit would be great if it did
12:21:31FromGitter<alehander42> it works even with lldb
12:21:39dadabidetso is it a good idea to use nim as a game scripting language?
12:21:42FromGitter<mratsim> @alehander42 it works for me as well, I wonder if it’s breakpoint of nimble packages that doesn’t work
12:21:42FromGitter<alehander42> I didn't even realize i have lldb :D
12:21:56FromGitter<mratsim> @alehander42 debugging from cloned stint works
12:22:08*nkk71 quit (Remote host closed the connection)
12:22:36FromGitter<mratsim> try with something installed from nimble
12:23:20FromGitter<mratsim> @dadabidet: There was talks of using Nim instead of Godotscript
12:24:21FromGitter<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:41PMunchdatabidet, I've used Nim for writing games. Works really well
12:24:49dadabidetquestion: is the GC embedded inside the generated C code?
12:25:01FromGitter<mratsim> @dadabidet, yes, but you can remove it.
12:25:07FromGitter<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:08FromGitter<mratsim> compile with gc:none
12:25:23dadabidetwhat happens if I remove the GC? any issue?
12:25:42dadabidetor do I need to clean memory manually?
12:25:48FromGitter<mratsim> most of the standard lib rely on GC
12:25:59FromGitter<mratsim> you can mix both GC-ed and manual managed memory
12:26:52FromGitter<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:22FromGitter<mratsim> if so you might want to create a domain specific language that only allows certain things.
12:28:15dadabidetI'm just in the developing phase, I'm not really worrying about malicious users right now
12:28:46dadabidetIm not into making a language
12:29:18FromGitter<mratsim> you can use Nim as a base language but only allow vetted function
12:29:44dadabidetnim 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:49FromGitter<mratsim> `macro callIfAuthorized(funcname:untyped): untyped = if funcname not in AuthorizedTable: doNotAllow() else: result = quote do `funcname`()`
12:31:14dadabidetdoes nim have list and dict comprehension like python?
12:31:14FromGitter<mratsim> If it’s purely dev side, Nim would be perfect.
12:31:25FromGitter<mratsim> you can use for loop
12:31:33dadabidetand function like filter, map, etc?
12:31:39FromGitter<mratsim> it does but the syntax is ugly at the moment and it will be replaced
12:31:42FromGitter<mratsim> yes
12:31:46FromGitter<mratsim> sequtils
12:32:06FromGitter<mratsim> or https://github.com/zero-functional/zero-functional
12:32:20FromGitter<mratsim> or https://github.com/numforge/loop-fusion
12:32:32FromGitter<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:10FromGitter<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:05dadabidetah named tuples, awesome!
12:39:28dadabidetI wonder how they're represented in memory
12:39:50dadabidetno dict?
12:40:21PMunchNope, they're converted to a C style struct
12:40:35*albel7272 quit (Ping timeout: 240 seconds)
12:41:23FromGitter<Vindaar> dict -> https://nim-lang.org/docs/tables.html
12:43:57dadabidetwhat does {} mean by default in nim?
12:45:15FromGitter<timotheecour> set
12:45:23FromGitter<timotheecour> {.foo.} is pragma
12:46:24Araqyeah, 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:20Araqor async programs or anything that you might need a debugger for, it's a toy
12:47:26FromGitter<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:39dadabidethttps://narimiran.github.io/nim-basics no sets here?
12:49:07dadabidetthe slice syntax is different than python thing[0..3] gets 4 things, python thing[0:3] gets 3
12:50:14Araqthing[0..<3] gets 3 things
12:50:20FromGitter<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:03FromGitter<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:23Araqsorry, no, krux02 submitted the GDB patches
12:55:11FromGitter<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:57AraqI think there is a feature request open for this
12:56:41FromGitter<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:46mirandadabidet: i'm the author of that tutorial :) no sets there, sorry
12:57:26dadabidetno problem
12:58:24miranthere 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:39dadabidetmh
12:59:17*salewski joined #nim
12:59:22miranand 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:08FromGitter<mratsim> you can built dictionaries with {key1: val1, key2, val2}.toTable actually
13:02:46FromGitter<mratsim> if keys are strings look into strtables, those are optimized/specialized for strings keys
13:03:32dadabidetmmmh doesn't seem like a mature language, Im going to miss python
13:03:34miranoh, `strtabs`! i didn't know that exists!
13:04:25TheLemonManyou can always call python stuff using nimpy!
13:04:33mirandadabidet: 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:34FromGitter<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:48miranand i'm saying that as a big python-lover
13:05:03*salewski quit (Quit: WeeChat 2.0.1)
13:05:51dadabidetsome things, like what?
13:06:14FromGitter<kaushalmodi> (Looks like my earlier comment about my Nim notes just got lost.. dadabidet: did you get that?)
13:07:04dadabidetFromGitter, yes <FromGitter> <kaushalmodi> dadabidet: I am learning Nim and I update my notes here: h
13:07:04FromGitterdadabidet, I'm a bot, *bleep, bloop*. I relay messages between here and https://gitter.im/nim-lang/Nim
13:07:06FromGitter<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:56FromGitter<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:34FromGitter<kaushalmodi> dadabidet: ok, thanks for confirming.
13:10:12FromGitter<mratsim> and you build standalone binaries. No need to make sure Python is installed with the proper version on your client system
13:10:45FromGitter<mratsim> Relevant XKCD: https://xkcd.com/1987/
13:11:51FromGitter<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:13FromGitter<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:55FromGitter<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:35FromGitter<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:39FromGitter<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:40FromGitter<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:53Araqa slice is just a nicer word for a dangling pointer
13:21:14FromGitter<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:07Araqout of bound errors can be made CT and we'll do it to yet-another killer feature to Nim :P
13:23:14Araq*to add
13:23:26FromGitter<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:46Araqit happened to me in practice when writing packedjson
13:24:16Araqand don't see how D would have prevented it
13:24:48krux02slice, range, span. I used to know what all these words mean, until I learned Nim
13:24:54krux02here they all mean something else
13:24:58FromGitter<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:39krux02and none of the usages of theses words in Nim I personally think are very useful, therefore I always forget what they mean.
13:26:17FromGitter<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:28Araqit's not my fault you never learned Pascal at school.
13:26:41FromGitter<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:58krux02I learned c++ at school.
13:27:27FromGitter<mratsim> @timotheecour once you can stack tensors with arbitrary tensors read from a .npy file it’s not CT.
13:27:51FromGitter<timotheecour> python will never be CT; i'm talking about D's mir here :)
13:28:19FromGitter<mratsim> yeah but I’m trying to convert Python data scientists, not D data scientists ;)
13:28:21krux02python is a bit weird anyway
13:28:37FromGitter<mratsim> the less friction there is, the better it is
13:29:34FromGitter<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:55krux02in nim it is often hard to see if something is evaluated it compile time or at runtime.
13:30:14FromGitter<mratsim> but it adds coginitive overhead for library users
13:30:23FromGitter<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:44FromGitter<mratsim> you’re preaching to a fellow CT guy :P
13:31:09FromGitter<mratsim> This library is like the poster-child of compile-time evaluation: https://github.com/status-im/nim-stint
13:31:20FromGitter<mratsim> you can do uint2048 computation all at compile time
13:31:29FromGitter<mratsim> addition, division, ...
13:32:03krux02mratsim: do you put the dimensions of a tensor is such an array.
13:32:11FromGitter<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:15FromGitter<mratsim> @krux02 yes
13:32:15krux02I know I needed to do that, too, when I worked on my tensor library.
13:32:39krux02I wanted to use seq in the beginning, because they were compile time only.
13:32:40FromGitter<timotheecour> but the core needs to be static dims. very sure about that
13:33:19krux02but the compiler didn't a allow a seq as a generic parameter.
13:33:35FromGitter<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:54FromGitter<mratsim> hence why so many static issues where raised by us
13:34:10Araqsorry about that
13:35:21FromGitter<timotheecour> right, dimensions should use an array, not a seq.
13:35:21FromGitter<mratsim> but he found himself fighting too much with stuff that needed runtime values (besides compiler bugs)
13:35:50FromGitter<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:38FromGitter<mratsim> just before his reply you can see why I didn’t choose static param for dimensions
13:39:45FromGitter<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:06krux02well when I worked on it ``static[seq[int]]`` did not work
13:40:43FromGitter<mratsim> @krux02 need an array, seq in the NimVM are arrays anyway when you pass them around
13:40:48krux02I think the size as static parameters makes sense for small matrices
13:40:54krux02for example everything in glm
13:40:58FromGitter<timotheecour> when would one need `static[seq[int]]`? (why not `array[N, int]` for eg, for dimension) ?
13:41:27krux02but if it grows in size beyond that the overhead is marginably small for a runtime size value.
13:41:31FromGitter<mratsim> when you broadcast or squeeze you need to add a new dimension or remove several
13:41:32Araqfwiw I doubt it can work well in principle.
13:42:16FromGitter<mratsim> by the way squeeze wouldn’t work at all with compile-time rank
13:42:33FromGitter<mratsim> (it removes all singleton dimensions at runtime)
13:42:34krux02what does squeeze do?
13:42:37Araqrank N means you need N nested for loops and that's pretty hard to express generically
13:42:57dom96That's where macros come in :P
13:42:59Araqand once you did you pray the compiler transforms it into a single linear loop
13:43:02FromGitter<mratsim> if you have a 3D tensor of shape (3, 1, 1), it transform into a tensor of shape (3)
13:43:41Araqseems easier to throw away the rank and only introduce it when necessary (displaying output?)
13:43:44krux02well I supported tensor operations in Einstein Notation (implicit sum) that generated all the nested for loop
13:44:12FromGitter<mratsim> @Araq, I have the macro to generate those loops at compile-time, but it’s less efficient due to code size
13:44:29Araqyeah, I know, macros...
13:44:40Araqthey destroy every argument.
13:44:43Araq:-)
13:44:47krux02anmratsim: that is pretty easy to do at compile time.
13:44:56krux02the problem is that it requires a marco
13:44:59FromGitter<mratsim> You can check there: https://github.com/mratsim/Arraymancer/issues/164
13:45:16*dom96 wonders what the discussion is about
13:45:21FromGitter<mratsim> I have my reference runtime implementation, and the macro based no branching loop
13:45:23krux02but I think Nim did not allow that
13:46:13FromGitter<mratsim> @dom96 multidimensional array, should the dimension be a static int and part of the type to allow compile-time optimization
13:46:21krux02``proc seqeeze[Dims](tensor: Tensor[Dims]): Tensor[squeezeType[Dims]] = ``
13:46:49krux02but I think I had problems using that pattern
13:46:52FromGitter<mratsim> but the end squeeze dimension depends on the runtime dimension.
13:47:03krux02I wanted to calculate the result type using symbols from the arguments list
13:47:10krux02but the compiler did not want that
13:47:21*mwbrown quit (Ping timeout: 240 seconds)
13:47:24FromGitter<mratsim> if you slice with runtime data and then squeeze the slice, what happens
13:47:51FromGitter<mratsim> (i’m not talking about lemon)
13:48:00krux02lol
13:48:14krux02I did not have a squeeze operation.
13:48:16FromGitter<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:23krux02to be honest it was a vacuum project.
13:48:31krux02program in thin air
13:48:43krux02that was why it failed
13:49:05TheLemonManwho's squeezing what?
13:49:29krux02TheLemonMan, mratsim is slicing and squeezing you
13:49:55krux02:P
13:50:29FromGitter<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:35AraqTimothee, we'll see about that. ;-) I'm happy to be proven wrong.
13:51:00*ryanhowe joined #nim
13:51:50FromGitter<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:51FromGitter<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:40dom96mratsim: I suppose ideally you would support both
13:53:06FromGitter<mratsim> My ultimate goal is to process 3D videos: so i need (Batch, Time, Color, Depth, height, width) dimensions
13:53:47FromGitter<mratsim> well no my ultimate goal is a Starcraft 2 bot but I can’t sell that :P
13:53:49krux02mratsim: what do you mean my 3D videos
13:54:47krux02a sequence of images seen as a big 3D array of pixels, or stereoscopic images, or true voxel based videos?
13:55:07krux02mratsim: I wouldn't say that
13:55:15FromGitter<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:45krux02tasbot is AGDQ is raising a lot of attention.
13:56:06FromGitter<mratsim> @krux02, neural network are pretty agnostic, as long as the number of dimensions match you can process it.
13:56:47krux02I don't necessary like neural networks in computers.
13:56:57krux02they do things that people don't understand.
13:57:12krux02for image processing they are nice though.
13:57:21*SebastianFlyte16 quit (Ping timeout: 248 seconds)
13:57:31FromGitter<mratsim> well, you can say the same about cars or airplanes or cryptography or nuclear power plant.
13:57:52FromGitter<mratsim> even people tend to do things that others don’t understand
13:58:21krux02but 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:05FromGitter<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:03krux02people even think that programming can be done at some point in the future by computers.
14:00:44krux02They 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:51FromGitter<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:57krux02lol
14:02:00krux02did not know that one
14:02:08krux02exactly what I said
14:03:08dom96For 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:31krux02dom96: as smart as humans is not enough
14:03:46krux02a human can only understand what it actually experienced
14:04:06dom96We can easily have the AI experience what most humans experience
14:04:23krux02an 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:35krux02dom96, not really.
14:04:50krux02the simplest example, is the invention of the cup handle.
14:05:25dom96It might take a lot of questioning by the AI but eventually you will get something that the human wants
14:05:26krux02if 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:29krux02and no, questioning a human is not enough.
14:06:37dom96"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:39dom96etc.
14:07:15FromGitter<mratsim> the thing is, we thrive in ambiguity
14:07:15dom96And if an AI is as smart (and creative) as humans then they will come up with some genius designs
14:07:34krux02no 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:06krux02the handle is already invented, but think of it as if it would not exist yet.
14:08:06dom96Again, if an AI is sufficiently intelligent they will be able to understand that humans can feel heat
14:08:17dom96and deduce that hot liquids mean heat on the cup
14:08:22dom96and that a handle is required
14:08:35dom96You don't need a superhuman intelligence to figure this out
14:08:43dom96Nor does the AI need to experience what we experience
14:08:49dom96They just need to be sympathetic
14:08:51krux02well for that the computer needs a precise model of the human way of seeing the world
14:09:01FromGitter<mratsim> there is no AI like you describe at the moment @dom96
14:09:11FromGitter<mratsim> currently they are trained on a specific problem
14:09:12dom96Of course there isn't
14:09:22FromGitter<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:22FromGitter... reshaping/slicing/sub-tensor/casting/object field projections, all reusing same buffer, just by doing operations on the header (strides + dims + rank).
14:09:55dom96the AI can create this model by observing humans
14:10:05dom96or even just reading the wikipedia page titled "Homo Sapiens"
14:10:25krux02dom96: you can't put all knowledge in the world and say "invent something", computer: "I have something it is the cup handle"
14:10:51dom96Of course not. Every invention is a solution to a problem
14:11:08krux02for 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:12dom96In 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:37dom96I don't think you do
14:11:57krux02yes, and for the computer to come up with that realization, it just needs to experience a human life.
14:12:08dom96Feedback from real humans would certainly help, but it's not necessary
14:12:18dom96A wheelchair could be invented by a human who is not disabled
14:12:54dom96And I wouldn't be surprised if it was
14:12:55krux02you don't need feedback from real humans, you need the simulation of real humans in a simulated world. Like in Matrix
14:13:24krux02A wheelchair could not be invented by a human who is not disabled and does not know any disabled person.
14:13:40dom96Yes, but like I said, an AI can observe humans
14:13:49dom96it can learn about them from other humans that observed them
14:13:58FromGitter<mratsim> @timotheecour all the shape operations in Arraymancer are only done on metadata.
14:14:00dom96from books that contain these observations
14:14:06*pringlecake quit (Ping timeout: 244 seconds)
14:14:42krux02an AI can't understand books that are written from a human perspective, when it doesn't know how humans percieve the world
14:15:21dom96I think it can
14:15:25krux02books are a very compressed form factor of human experience. Everything a humans sees a common sense is not written down.
14:15:34dom96But it's not just books
14:15:43dom96Like I said, the AI can observe humans
14:15:47krux02well just agree to disagree.
14:16:05dom96okay
14:19:40Araqpure 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:56krux02Araq: simulating a world like Matrix, I don't think it will ever be possible.
14:21:09krux02But there is the theory that this world is just a simulation.
14:21:25Araqyeah, it's nuts.
14:21:36krux02but possible
14:21:46krux02but it is a waste of time to go too deep into it.
14:21:46AraqIMO it's not.
14:22:51krux02well I think it doesn't matter.
14:23:13AraqI think it's obviously false, because of the infinite regress it causes.
14:23:19dom96Another debate heh
14:23:24krux02because no matter what the asswer is, it would not affect anyone actions.
14:23:30dom96I think an AI is possible simply by the virtue that we exist
14:23:37dom96Question is what you define as "artificial"
14:24:14dom96What if I manage to grow a brain synthetically and connect it a computer?
14:24:17dom96*it to
14:24:35Araqwell but you don't "manage to grow a brain". end of story.
14:25:07dom96how is that end of story?
14:25:14dom96Assume that I can
14:25:30dom96If the human body can do it, why can't we sometime in the future?
14:26:33krux02dom96: you are talking to a brain that is connected to a computer
14:27:08dom96That brain is sustained by a human body though
14:27:15dom96I think there is a line to be drawn here
14:27:19Araqwhy 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:21dom96or at least a new name given to something like this
14:27:24FromGitter<tavurth> Hey guys
14:27:27krux02there 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:51dom96Araq: If nature can do it then so can we
14:28:01dom96Seems like a perfectly logical prediction
14:28:16Araqyes, but we might need to replicate large parts of how nature does.
14:28:20FromGitter<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:22krux02Nature took how many million years for it?
14:28:23Araq*does it.
14:28:23dom96It's just a case of time + research investment
14:28:45FromGitter<tavurth> I was wondering if there was a way to not run `[Processing]` if a files imports have not changed?
14:29:07FromGitter<tavurth> Now I'm doing `import {moduleName}`
14:29:08krux02there is
14:29:16FromGitter<tavurth> And the `[Processing]` stuff takes up a huge amount of time
14:29:31FromGitter<tavurth> (Compared to the compile time)
14:29:32krux02ah you mean not just the output
14:29:43FromGitter<tavurth> Yea
14:29:44krux02currently the compiler has to touch everything when you compile somthing
14:29:52FromGitter<tavurth> I was thinking maybe making a `dylib`
14:29:53krux02but it is being worked on
14:30:22krux02no all nim files need to be processing when compiling a project
14:30:33krux02so make your macros fast
14:30:39FromGitter<tavurth> Hmm, and can I call into a `.so` file directly?
14:30:48FromGitter<mratsim> offtopic, Julia 1.0: https://julialang.org/blog/2018/08/one-point-zero
14:30:56krux02you 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:45FromGitter<tavurth> @krux02, Ok thank you for the info :)
14:32:01FromGitter<tavurth> It's plenty fast at the moment I guess, just nice if I could make it even faster
14:32:10krux02mratsim: 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:27FromGitter<mratsim> @tavurth https://github.com/nim-lang/Nim/issues/7874
14:33:13krux02tavurth: 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:53FromGitter<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:11FromGitter<mratsim> the worst being array indexing starting at 1
14:34:22krux02the end keyword really was an issue?
14:34:34krux02for me the indentation based syntax in Nim is an issue
14:34:39krux02even today.
14:34:40dom96hah, first comment on HN regarding Julia: this is premature
14:34:56Araqmratsim: do you know how they managed to get their macro system stable?
14:35:13Araqit's comparable to Nim's and for Nim it caused a never ending delay of v1
14:35:17FromGitter<mratsim> @krux02 yeah I really don’t like the end keyword in Ruby and Julia and Crystal
14:35:23krux02I wonder if anybedy here has ever written something in this Apple language called swift.
14:35:30dom96krux02: indentation is causing you issues? how?
14:35:38Araqdom96, don't go there...
14:36:13krux02dom96, well all other programming languages that I used just used {}
14:36:14FromGitter<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:26krux02then I set up my auto formatting as an external tool
14:36:32dom96hrm, possible marketing opportunity: tweeting at JuliaLang from @nim_lang congratulating them on their release
14:36:35dom96should I do it? :)
14:36:40FromGitter<mratsim> yeah
14:36:42krux02and tada copy pasting code from block to block automatically works
14:36:53krux02in nim I have had to unlearn that pattern
14:36:57dom96krux02: so you're just not used to it
14:37:00krux02and manually indent everything
14:37:13krux02dom96, that is most of it, yes
14:37:27dom96I feel like that's also the reason people are so opposed to style insensitivity
14:37:33krux02but still even after years of Nim I still don't see it as being better at anything
14:37:45Araqit's actually solvable and even easy but no editor I know of gets it right... :-)
14:38:18FromGitter<mratsim> @krux02 Julia doesn’t need my tensor magic, tensors are a builtin type in Julia
14:38:56krux02I 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:01FromGitter<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:39krux02the 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:57krux02but that isn't something an experienced programmer would do anyway
14:40:04FromGitter<mratsim> yeah, let’s bring back the sailing ship and change to case sensitivity :P
14:40:40FromGitter<mratsim> though I don’t mind for underscore
14:40:45FromGitter<mratsim> :D
14:40:46*l2y joined #nim
14:41:11krux02the first letter is already case sensitive
14:41:13*l2y quit (Killed (Unit193 (Spam is not permitted on freenode.)))
14:41:14krux02what a weird logic
14:41:37Araqdunno, 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:21krux02what is called GCC
14:42:27krux02gcc is the command line program
14:42:58krux02and you can write your own program gCc that is a totally different program it you want to
14:43:04Araqthe alllower commands in unix are a testament of an utterly broken piece of technology, but nobody wants to admit it, so *shrug*
14:43:22krux02allower commands?
14:43:31Araqcp, grep, gcc, ls ...
14:43:41leorizeI think he said "all lower" :P
14:43:43krux02well the naming if crap, for sure
14:43:52FromGitter<mratsim> wow on HN there is a lot of discussions about Julia’ poor exception handling and dependencies management
14:43:54krux02ah
14:44:23krux02I like all lower case in unix pretty well
14:44:25dom96This is why we need a substantial RC period
14:44:37krux02it is for fast typing on the command line
14:44:38dom96With hopefully a HN thread
14:44:59krux02and then all lower is easier
14:45:06livcdI too prefer Get-ChildItem
14:45:08FromGitter<kaushalmodi> krux02: Use rectangle copy/paste in Emacs :)
14:45:23FromGitter<kaushalmodi> krux02: Regarding "and tada copy pasting code from block to block automatically works"
14:45:40krux02kaushalmodi: and how do I handle out of emacs copies?
14:46:03FromGitter<kaushalmodi> krux02: You go out of emacs? :P
14:46:04Araqyes, caps are a usability nightmare so you want protection from the assholes that name their stuff XCG_CONFIG
14:46:22krux02and no it does not solve my problem, because copy paste in reclangles is again managing the indentation manually
14:46:41Araqand that's why you make the machine ignore this petty shit
14:46:46krux02I have to select a rectangle and carefully make sure I don't take the indentation
14:47:25FromGitter<kaushalmodi> krux02: Not sure I follow.. to start the rectangle selection at the desired indentation level.. it's not too capricious
14:47:27krux02well for a shell I would even agree to make it case insensitive
14:48:13dom96I've got my zsh set up to be case insensitive and I love it
14:48:19krux02but then again for shell scripts that are written down, I would prefer it to be case sensitive.
14:48:34FromGitter<kaushalmodi> krux02: C-SPC C-s <desired end term> RET C-x r M-w
14:49:02*NimBot joined #nim
14:49:09krux02Araq, 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:14FromGitter<tavurth> Spacemacs has a pretty good nim layer
14:49:34FromGitter<mratsim> @krux02 that was @miran PR :P
14:49:44Araqkrux02, fair enough, we can make the compiler complain about that one too
14:49:52Araqit's harder to do though :P
14:50:02krux02tavurth: 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:16Araqand what's worse, I don't know if it's noSideEffect or nosideeffect
14:50:26FromGitter<mratsim> killall nimsuggest is super useful when working with macros
14:50:33FromGitter<tavurth> @kruz02, slowing down the editor?
14:50:38FromGitter<mratsim> or noSideEffects
14:50:39FromGitter<kaushalmodi> fwiw, only-the-first-char-being-case-sensitive has never come in my way
14:50:41federico3krux02: that would be a task for a good linter
14:50:43FromGitter<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:48FromGitter<tavurth> Looks pretty helpful
14:50:50FromGitter<kaushalmodi> you just stay consistent with *your* style
14:51:01krux02I want an identifier to be used consistently in the entire project
14:51:36FromGitter<kaushalmodi> krux02: But you control that consistency
14:52:01krux02interesting color scheme
14:52:19AraqI enjoy the protection Nim gives me from krux02's spellings...
14:52:29*rayman261 joined #nim
14:52:37federico3krux02: contribute to https://github.com/FedericoCeratto/nimfmt or others
14:52:58krux02federico3, what is nimfmt going to help me?
14:53:15krux02it 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:35federico3krux02: Detect inconsistent variable/function naming
14:54:05krux02inconsistent spaces are detected by the compiler
14:54:20krux02I did not find a way yet to disable that warning.
14:54:24Araqalso interesting that Julia throw away old cruft
14:54:41Araqwell that's what I interpret from their release news
14:54:44FromDiscord_<treeform> nimfmt is the best thing that can happen to teams working on nim
14:55:04krux02"on nim" or "in nim"
14:55:22dom96I love how many people pick on the 1-based indexing in Julia
14:55:22FromDiscord_<treeform> it removes class of arguments programmers like to have
14:55:36FromDiscord_<treeform> "in nim"
14:55:51dom96It's ridiculous IMO but there you go
14:56:11dom96(not 1-based indexing, the complaints)
14:56:16FromGitter<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:22krux02is it normal that I cringe every time when I see "Dynamic" somewhere when it is about programming(languages)
14:56:58Araqcan we *please* remove the .tags mechanism? :-/
14:57:18dom96nooooo
14:57:28Araqnumber of bugs it found: 0
14:57:47Araqnoooo ???
14:57:49Araqwhy?
14:58:16dom96It's a great feature, but it's not developed enough to be useful
14:58:43dom96I'm okay with you ripping it out for 1.0 and keeping a open mind about implementing it again in the future
14:59:39TheLemonManAraq, speaking of stuff that can be removed, can I remove the unused postInitProc?
14:59:47federico3if anything tags and effects should be developed more
14:59:54krux02really "See issue #8003" as the deprecation comment?
15:00:04krux02that is not nice at all
15:00:55dom96Speaking of stuff that can be removed, can we remove the do notation?
15:00:57Araqhow do we know postInitProc is unused?
15:01:24Araqdom96, fine with me, but boy, this would break code...
15:01:33krux02dom96: I use ``quote do:`` a lot
15:01:47*drh joined #nim
15:01:48Araqkrux02, 'quote do' wouldn't be affected
15:01:55krux02but apart from that, I hate the do natation. I have to look it up every time I use it.
15:02:05krux02it is really not a good intuitive syntax.
15:02:07dom96yeah, but there is no reason why `quote:` can't work, is there?
15:02:15TheLemonManAraq, because the compiler always leaves it empty
15:02:23krux02there is a second argument to quote.
15:02:26dom96krux02: yeah, that's exactly why I want to remove it
15:02:31krux02but there is no way to acually pass that argument
15:02:32AraqTheLemonMan, sure ok, we have tests covering it anyway
15:02:40dom96but yeah, just for anon procs
15:02:53krux02maybe there should be a way to pass that argument.
15:02:54*drh quit (Remote host closed the connection)
15:02:55dom96krux02: quote("`"): ...?
15:03:14dom96Honestly, `do` in quote doesn't make sense to me at all
15:03:16krux02dom96: yes for example
15:03:24Araqyeah that argument... I always wondered how it could possibly work.
15:03:24FromGitter<kaushalmodi> dom96: You mean removing the anon procs?
15:03:26dom96`do` only makes sense for macros when you want to pass multiple bodies
15:03:28krux02for me neither
15:03:33Araqturns out ... it simply doesn't.
15:03:34dom96quote: .... do: .... do: ....
15:03:37FromGitter<kaushalmodi> I guess I would be fine as long as the `future` is there
15:03:49krux02dom96: you don't need multiple bodies for macros
15:03:52dom96kaushalmodi: you can still write: proc () = ...
15:03:58dom96and IMO that's just better
15:04:01Araqor the => thing
15:04:05dom96yeah
15:04:06krux02you can just put everything in one body and then have named subbodies
15:04:12FromGitter<kaushalmodi> Araq: That's what I meant by `future`
15:04:19FromGitter<kaushalmodi> ah.. `sugar`
15:04:23krux02you know you can make a body out of arbitrary identifiers
15:04:33krux02``mysubbody:``
15:04:48dom96krux02: yes, that would be another way to do this
15:04:56dom96and we could then get rid of `do` completely
15:05:17dom96So if you have better ideas for how to specify multiple bodies to a macro invokation Araq is all ears :P
15:06:45krux02dom96: multiple bodies https://github.com/krux02/opengl-sandbox/blob/2ff6ae971f9200ac70439536bcc5c5cfcd9ee466/examples/hello_shapes.nim#L223
15:07:20krux02for the macro it is just one body, but logically it is multiple bodies
15:07:28krux02and all of them even have a name
15:08:29Araqyeah, that's usually what I do too
15:11:03Araqoh and I'm deprecating {.this: self.}
15:11:39Araqand regionized pointers too
15:11:57FromGitter<mratsim> ah yeah those, I tried to play with them and failed iserably
15:12:24FromGitter<mratsim> once lent types are there, we can have proper memory arena
15:12:51dom96So do we need `do` at all?
15:13:51krux02Araq: what do (did) regionized pointers do?
15:14:56krux02mratsim: what is a memory arena?
15:16:09krux02is there hard drive memory fighting against flash memory in regular intervals with big audience.
15:16:22krux02(sorry, I just needed to make that unfunny comment)
15:17:10Araqit's ok, we need unfunny comments in order to see the funny ones
15:17:30krux02yea
15:17:58krux02I think the memory arena is watched by cd-rom memory from the press
15:18:30krux02did that one make it any better?
15:19:01FromGitter<mratsim> @krux02: https://en.wikipedia.org/wiki/Region-based_memory_management
15:19:27FromGitter<mratsim> that’s basically a memory pool
15:19:47FromGitter<mratsim> except that you can have heterogeneous objects
15:20:47krux02I 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:06Araqyeah, it's called "thread local storage".
15:21:45krux02Araq: are you referring to mratsim or me?
15:21:50Araqto you.
15:22:06krux02ah, ok.
15:22:21krux02well he said the inverse
15:22:32krux02that you can use it to do thread local storage.
15:22:59Araqyes, that's one way to implement TLS. Hint: There are better ways to do it.
15:23:32krux02well with threads I am by far no expert.
15:23:55krux02I rarely get in a situation where a signle thread isn't enough.
15:24:25Araqbut if you have TLS, you have this implicit "context" too, it cuts both ways.
15:24:53Araqit's not a groundbreaking superior new bombastic invention. it's pretty old stuff.
15:25:16krux02it is not really about being a new thing or ground breaking
15:25:25krux02it is about practicality and simplicity
15:25:30krux02and it is simple to understand
15:26:18krux02where "thread local storage" seems simple to understand as well, bun then it is also a pretty magic attribute
15:27:11Araqwell there is an easy bijection here, there is no magic
15:27:38krux02I think most in a programming language should be about good engineering, not about fascinating science.
15:27:54krux02put that things in that are necessary to build quality software and make them easy to use.
15:28:30Araqgood engineers can deal with basic abstract math. it's the programmers who usually can't.
15:28:53krux02what do you mean?
15:29:08krux02I like basic math.
15:29:44Araqit'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:10krux02well it will appeal to people who want to get stuff done.
15:30:19krux02and stuff done will appeal other programmers.
15:31:31AraqI've seen people getting stuff done in Delphi. Nobody gave a fuck. :P
15:31:54krux02I played Age of Wonders II, great game, programmed in delphi.
15:32:35krux02I also thing as long as there is enough pressure, people can get stuff done no matter how bad the environment is.
15:32:42krux02see javascript
15:32:43FromGitter<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:46FromGitter<alehander42> little did i know
15:33:21krux02alehander42 what is it that you do know now?
15:33:27FromGitter<alehander42> people do great stuff even in excel
15:33:32Araqin fact, it's embarrassing nimsuggest *STILL* doesn't work as well as Delphi did in the 90ies.
15:33:58FromGitter<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:10krux02then why did delphi die?
15:35:26FromGitter<mratsim> windows only?
15:35:34krux02well that is a good point
15:35:49Araqterrible management too, plus MS hired the brain behind it
15:35:53krux02but that is not a thing that can't be addressed.
15:36:27Araqwell "die", it still exists and Lazarus is the open source, portable clone
15:36:45krux02Araq, 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:08Araqno, they hired him to invent C#.
15:37:22krux02ah, well
15:38:07krux02C# is also one of those mutant languages.
15:38:07FromGitter<alehander42> and now typescript
15:38:46AraqC#'s design only suffers from its initial heavy Java influences
15:39:30krux02typescript 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:43krux02am I the only one who things that is stupid?
15:39:49Araqplus a bit from this "runs on a virtual machine" stuff
15:39:57Araqkrux02, it's webscale
15:40:11krux02Araq: that is also Java.
15:40:22Araqtrue.
15:41:07krux02I think Java is still the only statically types languages besides C that has no type inference.
15:41:48Araqthat's not true, 3+5 is inferred to have the type 'int', for example
15:42:04krux02in 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:32Araqno, they paid a team of developers to design something better. and they did.
15:42:41krux02Araq: but when you want to assign that to a variable, you have to explicitly type that variable
15:42:58Araqunfortunately they didn't throw away the VM idea altogether
15:43:02krux02but initially is was so just the same as java
15:43:36Araq.NET started with the "support multiple PLs" idea, the JVM didn't.
15:44:00Araqand you can see it, .NET supports value based datatypes, for example
15:44:41krux02but generics were like in java with type erasure and later they learned it was bad (IFAIK)
15:45:01krux02java never fixed that
15:45:47Araq.NET does perform specialization for not-reference types
15:46:02krux02I know
15:46:12krux02but that is not what it was in the beginning
15:46:21krux02but I don't know it exactly
15:46:30krux02Araq: another story, I read Nim is supportey by Etherium miners
15:46:35Araqit didn't copy this mistake either. the only mistake they copied was the covariant arrays
15:46:41Araqiirc.
15:47:01Araqto allow easy porting of Java code... (ugh!)
15:47:01krux02covariant arrays?
15:47:09krux02arrays in java are not covariant
15:47:16Araqthey are.
15:47:18FromGitter<mratsim> what is a covariant array?
15:47:33FromGitter<alehander42> @krux02 well a lot of vm-s do this, facebook's hiphop also doesn't use hack's type afaik
15:47:48FromGitter<alehander42> and this is not typescript's fault
15:47:55FromGitter<alehander42> nim is playing the same game with its js backend
15:48:16krux02alehander42: yes it is not the fault of typescript, it the the fault of the entire web development stack
15:48:48krux02and in nim I can just compile to c and not care about the web development stack.
15:49:38Araquntil your game/software needs to run on a mobile phone...
15:49:45krux02Araq: 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:00Araqyes, that is true in Java.
15:50:10krux02not for arrays
15:50:28Araqhttps://stackoverflow.com/questions/18666710/why-are-arrays-covariant-but-generics-are-invariant
15:50:45*Vladar quit (Remote host closed the connection)
15:52:00FromGitter<mratsim> Monads + Higher Kinded Types would mean that we wouldn’t have to ask these covariant questions ;) *Haskell crashing the party*
15:52:53krux02oh 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:35krux02mratsim: When you want programmer to run away, just mention Monads.
15:53:51*stefanos82 quit (Quit: Quitting for now...)
15:54:03krux02I constantly forget what they are, but I used them.
15:54:40*Vladar joined #nim
15:54:52Araqand in an alternative universe you would tell me Mr Blow based his language on Monads, because it's a sound engineering practice.
15:55:16krux02Araq: 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:17krux02well 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:32krux02he has 4 full time developers on that language
15:58:13krux02it'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:53FromGitter<mratsim> Blow is from Jai or Odin?
15:59:00AraqJai
15:59:00krux02Jai
15:59:18FromGitter<mratsim> Odin had this interesting dilemma for Metaprogramming, they mention Nim btw: https://odin.handmade.network/blogs/p/1723-the_metaprogramming_dilemma
16:01:07AraqI'm not worried about Jai at all, I think game programmers are terrible at language design, sorry.
16:01:54Araq"I used C++ and it sucks, so I'm writing a better language" is not how I started Nim.
16:02:49FromGitter<mratsim> Corollary: Researchers are terrible at library design
16:03:06*Demp12 joined #nim
16:03:30FromGitter<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:01FromGitter<mratsim> .s/everything/anything
16:04:08leorizeAraq: how was Nim started btw?
16:05:03Araq"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:19TheLemonManone beer too much and *boom* Nim was born
16:05:19Araqlanguage."
16:05:34TheLemonMantwo beers too much and we got static[T] :P
16:06:39FromGitter<mratsim> @TheLemonMan concepts and static are from aah :P
16:06:54FromGitter<mratsim> but if there wasn’t static you would get Rust drama over integer parameters
16:07:43krux02rust has no integer parameters?
16:07:56FromGitter<mratsim> no
16:07:59Araqwell there were other reasons like "There is no reason systems programming can't have a nice Pythonic syntax"
16:08:17stefanos82Araq, 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:22Araqor "I'd rather copy Ada's type system than C's"
16:08:45FromGitter<mratsim> @krux02 so this is how array traits are implemented: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b6c670d67eb9f60feb9712a]
16:08:54FromGitter<mratsim> only up to size 32
16:08:55krux02Araq: where "nice" is subjective
16:09:00FromGitter<mratsim> then you’re on your own
16:09:07leorizeI was under the impression that Nim was meant to be a Pascal preprocessor, but ended up being it's own language
16:09:43FromGitter<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:43Araqno, but I wrote Pascal preprocessors before. They were terrible.
16:09:57stefanos82how old are you Araq?
16:10:37FromGitter<mratsim> so I think @TheLemonMan that static are pretty good given how those RFCS are treated/stalled in Rust
16:11:41FromGitter<mratsim> (well they are pretty good now, one year ago, they drove me crazy)
16:11:50TheLemonManmratsim, I love the idea behind static, they're just a little too brittle for everyday use
16:12:31AraqI think it all needs to be replaced by macros, but let's get v1 out first
16:12:46Araqstefanos82, 35
16:12:47FromGitter<mratsim> let’s replace Araq by a macro
16:13:03FromGitter<mratsim> wy do you need AI when you have macros duh :P
16:13:25stefanos82Araq: 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:00FromGitter<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:01krux02I 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:29krux02especially I don't like it when a programming language enforces a memory layout
16:18:57FromGitter<mratsim> web devs need different things, I would be spooked if they could manage the memory in the browser
16:20:06krux02mratsim: is a worse memory managment that the enforced one of javascript even possible?
16:21:23krux02ok I have to go
16:21:46*krux02 quit (Remote host closed the connection)
16:24:10FromGitter<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:32FromGitter<Bennyelg> does deduplicate(someSeq) should work on any type of sequence ? i guess it does but how can he check SpecialType == SpecialType ?
16:36:16leorizeBennyelg: I think it depends on whether == is defined for that type
16:36:21leorizeor else it won't compile
16:36:36FromGitter<Bennyelg> so it did compiled but didnt worked
16:37:51FromGitter<Bennyelg> Ill try some few more things, if it doesn't work I'll post here
16:42:16*elrood joined #nim
16:54:00FromDiscord_<emekoi> nim successfull compiles erroneous code as long as its never executed, should produce an error?
17:01:38Araqas long as it is not *instantiated*
17:02:06*tribly quit (Quit: WeeChat 2.2)
17:03:02*tribly joined #nim
17:07:54FromDiscord_<emekoi> is that due to dead code elimination or just how the compiler works?
17:08:16Araqthe compiler does check every piece of code you write
17:08:40*VampiricPadraig joined #nim
17:08:43Araqit's not clear what "erroneous code" means
17:09:22*VampiricPadraig quit (Remote host closed the connection)
17:10:57FromGitter<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:36Araqsure, let's redesign Nim's generics, what could possibly go wrong
17:12:10FromGitter<tim-st> oh, I thought it was about procs that arent used and have errors
17:12:27Araqthese are checked. completely.
17:12:28FromGitter<tim-st> I only see the errors when I call the proc
17:12:38Araqnah I doubt it.
17:13:10FromGitter<tim-st> hm, maybe it's only related to `nim check` have to test it
17:15:12FromGitter<tim-st> Araq:
17:15:15FromGitter<tim-st> proc test1(): string = ⏎ result = nil ⏎ ⏎ test1() [https://gitter.im/nim-lang/Nim?at=5b6c76a367eb9f60feb9ce05]
17:15:18*BitPuffin joined #nim
17:15:27FromGitter<tim-st> when the last line is not there it shows no error
17:16:19FromGitter<tim-st> also in compilation not only `nim check`
17:17:49FromDiscord_<emekoi> in certain procs i call code that doesn't even exist and i get no errors when. compiling.
17:18:33FromGitter<tim-st> yes, that's likely similar like I have shown above. maybe it's intended to decrease compilation time
17:19:04Araqyeah, no idea what you're talking about. must be the nimsuggest plugin
17:19:23*thomasb9511 joined #nim
17:19:25FromGitter<tim-st> no, I dont use nimsuggest
17:20:05FromGitter<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:33FromDiscord_<emekoi> there is no error with nimsuggest, nim check, nim c, nim cpp, or nim js.
17:22:39FromGitter<tim-st> yes, for the code above I only get the error when the line is uncommented
17:24:59FromDiscord_<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:53Araqemekoi, please gist it/report it
17:26:40FromGitter<tim-st> emekoi: oh, you're right, I thought `result = nil` doesnt work for strings in devel
17:27:01Araqtim-st: it's an on-going effort :P
17:27:59FromGitter<tim-st> ok
17:30:27*data-man quit (Quit: Konversation terminated!)
17:31:03*data-man joined #nim
17:31:24FromGitter<tim-st> the following code is an error without linenumber, is that considered a "crash"?
17:31:34FromGitter<tim-st> ```proc test1(): string = ⏎ result = nil & ""``` [https://gitter.im/nim-lang/Nim?at=5b6c7a7667eb9f60feb9e2cb]
17:31:59FromGitter<tim-st> `Error: unhandled exception: false ast.nim(1606) getStrOrChar [AssertionError]`
17:32:15Araqyup, a crash
17:32:21FromDiscord_<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:03FromGitter<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:39Araqno, but nimsuggest can skip it in order to reply more quickly
17:35:05FromGitter<tim-st> ok
17:35:21*Tyrantelf11 joined #nim
17:37:09*Tyrantelf11 quit (Read error: Connection reset by peer)
17:44:53FromDiscord_<emekoi> most basic example: `proc a[T](b:int)=b.c()`
17:45:25Araqwell b.c() could exist :P
17:45:34Araqwhen instantiated
17:46:54FromDiscord_<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:02FromDiscord_<emekoi> true but, `proc a[T](b:int):void=return 1` also compiles.
17:47:47FromDiscord_<libman> Use F12 (vscode), use F12, F12 is your friend, lalala...
17:48:20Araqit's not obvious where a symbol comes from in Python.
17:48:27Araqnot at all.
17:49:29FromDiscord_<emekoi> don't we need to put status.im in the sponsors page?
17:49:50FromDiscord_<libman> Well, there seems to be more confusion when people s/Python/Nim/, esp with overloaded operators.
17:49:56Araqemekoi: dom96 is working on it
17:50:39FromDiscord_<emekoi> alrighty
17:52:15*francisl quit (Quit: francisl)
17:54:31*chamar joined #nim
17:54:32FromGitter<tim-st> libman: the problem is that this doesnt work (very well) somtimes it works perfect, sometimes it needs more than 20minutes...
17:54:51FromGitter<tim-st> a working language server for nim would solve these problems
17:55:05Araqno it wouldn't
17:55:11FromGitter<tim-st> why?
17:55:17Araqit's just a more complex protocol for the same features.
17:55:32Araqbut I have a cheap way out, stay tuned
17:56:42FromGitter<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:21FromGitter<tim-st> but maybe this is not a problem of nimsuggest but of the vscode implementation of nimsuggest
17:57:34Araqit orders the results by priority
17:57:52Araqthe priority is calculated from a number of factors including "how often was this used before"
17:58:05FromGitter<tim-st> yes, the results are good, but it just doesnt work in vscode, I dont know why
17:58:24Araqthere is at least one bad regression that I'm working on
17:59:09FromGitter<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:29Araqbut also the VScode plugin needs some changes
18:00:51FromGitter<tim-st> btw does nimsuggest uses tcp or udp?
18:01:43FromDiscord_<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:21AraqTCP. and no, the connection via localhost is not a bottleneck.
18:03:00FromGitter<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:11FromDiscord_<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:52Araqemekoi, you can only use seq[ptr int] or seq[ref int] to get that
18:03:54FromGitter<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:08Araqspeaking of which ... how can I add 'nimsuggest' to the PATH on Linux?
18:08:35Araqno, editing .bashrc does not count, I don't start VSCode from a bash session
18:09:33YardanicoAraq, edit /etc/profile :D
18:09:52FromDiscord_<libman> Um, I use one ~/.profile for everything.
18:10:03miranAraq: add a simple script to /etc/profile.d ?
18:10:52miranthis is what was recommended to me when i was looking for that stuff
18:11:06FromDiscord_<libman> /me predictably uses mksh.
18:11:43YardanicoI use zsh (but without any frameworks)
18:15:42*nsf quit (Quit: WeeChat 2.2)
18:27:35Demos[m]use ~/.pam_environment
18:28:03Araqcan I also use ~/.bananajoe?
18:28:26Demos[m]pam_env works in non-shell things
18:30:12Araqon every Linux system?
18:30:15Demos[m]also these bash style profile things don't work for shells like fish (and prob powershell)
18:31:49FromGitter<kaushalmodi> Araq: `man pam_env`
18:32:12Demos[m]it has to actually load pam_env. almost everything does
18:32:24miranDemos[m]: i haven't experienced any problems in fish
18:32:50Demos[m]well fish won't load stuff in ~/.profile or /etc/profile.d
18:33:20miranit works here just fine
18:33:33Araq"This module can also pares a file with simple KEY=VAL pairs on separate lines (/etc/environment by default)."
18:33:40Araqso ... /etc/environment ?
18:34:05Demos[m]yep
18:34:16FromGitter<kaushalmodi> Araq: If you scroll to the bottom, it shows the precedence
18:34:42FromGitter<kaushalmodi> The `~/.pan_environment` supercedes the other pam files
18:35:19Araqdo the BSDs have "pam"?
18:36:16Demos[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:43Demos[m]looks like some do
18:37:26Demos[m]idk if they use pam_env though
18:41:55dom96The fact that there is no one answer to this really goes to show the problem with Linux
18:42:33FromGitter<kaushalmodi> dom96: There's always an answer for the OS you are using
18:43:21FromGitter<kaushalmodi> This question is specific to Araq's Linux OS, right?
18:43:33dom96macOS seems to have a pretty elegant way of handling this
18:43:40dom96/etc/paths
18:43:49dom96just a file with a directory per line
18:44:05Araqkaushalmodi, no it's to improve the installation experience
18:44:33*Affliction14 joined #nim
18:44:44FromGitter<kaushalmodi> Araq: Got it. I missed the beginning of the conversation.
18:44:50*Affliction14 quit (K-Lined)
18:45:01FromGitter<kaushalmodi> How is Nim installation different though..
18:45:29FromGitter<kaushalmodi> Folks should be knowing which file to edit to update their PATH if they having been using unix systems
18:45:56FromGitter<kaushalmodi> The file varies with OS and shell too
18:45:59Demos[m]yeah don't mess with pam_env during installation
18:46:08FromGitter<kaushalmodi> For tcsh, I use .tchrc
18:46:39FromGitter<kaushalmodi> At work, they have a .mycshrc
18:46:49FromGitter<kaushalmodi> So it's not Nim's job to set the PATH env var
18:46:52Demos[m]yeah for fish I use the fish_user_paths universal var
18:48:43Araqok, I'm not doing anything then
18:49:00FromGitter<kaushalmodi> yeah..
18:49:30Araqlesson learned, Linux users hate automation.
18:49:46FromGitter<kaushalmodi> It's automated already
18:49:58FromGitter<kaushalmodi> I didn't need to do anything special when I installed nim/nimsuggest
18:50:01FromGitter<data-man> We need update shell's autocompletions for the Nim.
18:50:08FromGitter<kaushalmodi> the installations happen in a bin dir that is already in PATH
18:50:18Araqit remains unclear why they use computers but that's a mystery for another day.
18:50:21dom96Araq: Linux users expect their software to be installed in /usr/bin
18:50:41FromGitter<data-man> Or /usr/local/bin
18:50:51Araqor /opt, yeah yeah, I know, I know
18:50:56FromGitter<kaushalmodi> Also installers (almost all that I know of) support a `--prefix` switch
18:51:15dom96yeah.... we've been there
18:51:42FromGitter<kaushalmodi> the general flow is: ⏎ ⏎ ```./configure --prefix=/foo/bar ⏎ make ⏎ make install``` [https://gitter.im/nim-lang/Nim?at=5b6c8d3e179f842c9716a473]
18:51:48FromGitter<kaushalmodi> done
18:51:50FromGitter<kaushalmodi> no tinkering of PATH needed
18:52:10*stefanos82 quit (Quit: Quitting for now...)
18:52:15FromGitter<kaushalmodi> (user doing this would know to add `/foo/bar/bin` to their `PATH` before-hand
18:52:46Araqthank you for telling me everything I already knew.
18:53:07AraqI only had a hole of knowledge when it comes to PATH.
18:53:16Araqand got enlightened, thanks.
18:53:29FromGitter<kaushalmodi> Araq: You mentioned the lack of automation.. so just connected the installation flow with PATH
18:53:40FromGitter<kaushalmodi> Sorry for over-elaboration
18:54:07Araqplenty of people don't have 'sudo' and still want to enjoy Nim ;-)
18:54:15FromGitter<kaushalmodi> I don't
18:54:18*francisl quit (Quit: francisl)
18:54:21FromGitter<kaushalmodi> my flow is for non-sudo installs
18:54:22Demos[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:25FromGitter<kaushalmodi> and so the --prefix
18:55:00dom96At this point we may as well tell people to use Docker
18:55:11dom96I've seen people who do that by default
18:55:18Araq+1
18:55:34dom96They just grab a Docker image and alias `nim` to `docker run blah blah`
18:55:53Demos[m]ugh
18:55:55FromGitter<kaushalmodi> Grokking docker is on my todo list
18:56:14FromGitter<kaushalmodi> Docker is not known/installed in my work/field
18:56:20FromGitter<data-man> I hold nim in the /home/projects/Nim/bin and link it to /usr/local/bin :)
18:56:39FromGitter<kaushalmodi> @data-man I do linking, but using GNU Stow
18:57:04dom96I just add ~/projects/nim/bin to my PATH
18:57:31FromGitter<kaushalmodi> I manage multiple versions of tools using stow
18:57:36FromGitter<kaushalmodi> ```> /home/kmodi/stowed/bin/nim -> ../../stow/pkgs/nim/devel/bin/nim```
18:58:31Demos[m]heh I have a nim implementation of stow sitting around :D
18:58:31FromGitter<data-man> Stow? Perl? No, thanks! :)
18:58:47Araqbtw the usual ./configure script is hard to audit, but whatever
18:59:06FromGitter<kaushalmodi> @data-man Thankfully I never needed to debug it
18:59:06Demos[m]please don't call it configure unless it's actually from autotools
18:59:14FromGitter<kaushalmodi> It Just Works(TM)
18:59:52AraqDemos[m], we don't use autotools and have no configure
19:00:08Demos[m]good. Let's keep it that way :D
19:02:27FromGitter<data-man> @Araq Why build scripts don't use masks (*.c)?
19:02:33Araqthe downside is though that we don't check whether your C compiler has a non-buggy memcpy() implementation
19:03:19Araqor whether your hardware has a CPU.
19:03:57Demos[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:46Araqdata-man: because it's generated code
19:05:09FromGitter<data-man> So let's to generate code with masks.
19:06:09Demos[m]do you mean globs?
19:06:30FromGitter<data-man> Yes.
19:06:44Demos[m]if so it's because it makes it hard to detect when you need to reconfigure the project
19:06:56Demos[m]some build systems do use them, along with a daemon to monitor inotify events
19:07:06Demos[m]but like on linux it's impossible to correctly use inotify for this
19:07:44Demos[m]build2 and bazel come to mind here
19:08:32Demos[m]any in any case it only makes sense for languages with a compilation model of one file per compiler output
19:08:40Demos[m]of which nim is not one
19:09:22FromGitter<data-man> I like the tup (I promote it each time :) )
19:09:53Demos[m]I like meson
19:12:44FromGitter<data-man> ninja in nim = nimja! https://github.com/RedBeard0531/nimja
19:14:50*Typhon0 joined #nim
19:17:02Araqdata-man: firstly, do not touch this code
19:17:16Araqsecondly, why are globs better, it's generated code?
19:18:20FromGitter<data-man> Tiny scripts, more readable.
19:18:34Araqthirdly, see firstly, Nim builds on Solaris and vxWorks, don't change it
19:19:10*Typhon0 quit (Remote host closed the connection)
19:19:22FromGitter<kayabaNerve> Please don't require Docker. Please. Why change it?
19:19:46AraqI'm not changing anything but I noticed VSCode on Linux has trouble to find 'nimsuggest'
19:20:15FromGitter<kayabaNerve> "VSCode on Linux" "trouble"
19:20:30FromGitter<kayabaNerve> I don't think this is a Nim problem, for some reason...
19:20:37FromGitter<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:57AraqI 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:58livcdyeah dont break solaris please
19:23:20FromGitter<kaushalmodi> Araq: VSCode should be asked to look for the binary in the PATH
19:23:34FromGitter<kaushalmodi> It's user's problem that that binary goes to PATH
19:23:41FromGitter<kaushalmodi> Emacs auto sets that var using `(executable-find "nimsuggest")`
19:23:51Araqkaushalmodi: the PATH lacks it for idiots like me who modified .bashrc
19:25:05Araqwhich 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:56livcdsomeone just asked for a pirated copy of Nim in Action on the forums ?
19:26:04FromGitter<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:31Araqyeah but here is the thing, I don't know what I have in PATH because when I type
19:26:34Araqecho $PATH
19:26:39dom96livcd: lol what
19:26:40Araqin my bash ... it's there :P
19:26:52FromGitter<kayabaNerve> Who uses Solaris?
19:27:12livcdAT&T,British Telecom,Goldman Sachs
19:27:37dom96It's pretty easy to find a pirated copy tbh
19:28:36livcdtbh i bought all my manning books on 50% off sales
19:28:38FromGitter<kaushalmodi> why doesn't this work on forum?
19:28:41FromGitter<kaushalmodi> ````Nim_in_Action.pdf <https://www.youtube.com/watch?v=dQw4w9WgXcQ>`_```
19:29:23AraqSolaris 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:26FromGitter<kaushalmodi> That link shows up unhyperlinked :)
19:30:52livcdSolaris is awesome because the servers it runs on are aesthetically pleasing
19:31:08FromGitter<kayabaNerve> Araq seems legit
19:32:22dom96kaushalmodi: docgen bug. You need some non-hyperlinked text before it
19:33:28livcdwhat kind of drugs do you need to take in order to ask for a pirated copy on the official forums ?
19:34:28dom96This user seems like a troll
19:34:31dom96Check their post history
19:39:08miranwith 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:40Araqafaict the consensus is to leave out the 'get' but not the '()'
19:39:50dom96`letterCount` to me implies a simple lookup
19:39:53dom96not a count operation
19:40:04dom96although `getLetterCount` implies the same tbh
19:40:11Araqstring.countLetters()
19:40:16dom96yeah
19:40:49miranAraq: ok, didn't know that () should stay
19:41:30Araqwell I personally don't use them much, but others prefer it this way.
19:42:01miranok, so piping is done as: `string.firstFunc().secondFunc().etc()`, and not `string.firstFunc.secondFunc.etc`
19:42:21*ng0 joined #nim
19:42:22Araqno, it depends on what these Funcs do.
19:42:47Araqthe idea is that the () is for "expensive" calls
19:43:02miranaha!
19:43:35miranthese my funcs are quite simple, and without () looks fine to me
19:44:50Araqit's mostly a matter of taste, I leave out the () and use a profiler instead
19:45:37miranfor example, `parseInt` or `splitLines` don't need the (), right?
19:46:05Araqboth of these would count as "expensive"
19:47:52Araqbut others would use the () for "has side effects"
19:48:18miranso () for procs, no() for func :)
19:49:16Araqsounds acceptable to me
19:49:37miranthanks 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:14FromDiscord_<exelotl> hey will anything ever happen with this mascot? I adore the design https://github.com/nim-lang/Nim/issues/7768
19:58:22Araqsorry, but it reminds me too much of the Gopher.
19:59:34Araqand I can't stand these fluffy designs, give us something more gritty
20:01:44Araqlet's try a lion
20:02:27*a_b_m joined #nim
20:03:02*a__b__m joined #nim
20:05:18Araqor Cthulhu
20:05:26*abm quit (Ping timeout: 244 seconds)
20:05:38Araqor Pikachu
20:06:02miranyou can't go more badass than honey badger
20:06:16Araqor Appa
20:06:59*a_b_m quit (Ping timeout: 244 seconds)
20:07:16Araqor Momo
20:07:54Araqor Khorne
20:08:47miranoff/on-topic: the code that runs fine on 0.18, i get "out of memory" output on 0.18.1
20:10:16dom96Lion please
20:10:38*natrys joined #nim
20:10:41FromDiscord_<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:23FromDiscord_<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:36Araqexelotl: I agree completely, don't worry about the honey badger
20:13:32TheLemonManI kept misreading "honey badger" as "horny badger" and was thorougly confused for a bit
20:13:48miranTheLemonMan: also good idea! :D :D
20:14:04FromDiscord_<exelotl> lmao
20:14:44Araqmiran, huh, that's new. I thought the allocator got better
20:15:57miranAraq: 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:05Araqyup, please try again
20:17:47Araqif 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:03Araqit's an evolved monkey that can fly with its ears, maybe symbolizing Nim's flexibility or something
20:22:01Araqit's from my favorite cartoon for children
20:22:36dom96a cute lion would be better IMO
20:23:14Araqa cute Cthulhu?
20:23:18Araq:P
20:23:20FromDiscord_<libman> I propose we use a chainsaw as the Nim mascot.
20:23:26FromGitter<arnetheduck> oy, @dom96 - any chance of adding nimbus to nim-lang front page projects?
20:24:16dom96arnetheduck: sure, got a logo for it?
20:25:26FromDiscord_<libman> Chainsaws are very productive and useful power tools. And it references the blockCHAIN.
20:26:18FromGitter<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:29dom96I can just create a logo like for the other projects
20:27:34dom96just wondering if you have something specific
20:27:41dom96I'll be adding Status under the Top Sponsors section
20:27:55*rkta joined #nim
20:28:12*rkta quit (K-Lined)
20:31:35Demos[m]it would need to be a fluffy chainsaw
20:32:08Demos[m](I'm willing to chip in if we need to commission something)
20:32:45Araqwell I now want Momo...
20:33:12Araqbut give it a crown. and maybe mutate it in order to avoid copyright problems
20:34:51dom96IMO a real animal is the best mascot
20:35:22Araqthe world of mascots is running out of real animals though
20:35:42Araqand a lion is a bit boring tbh
20:36:25FromDiscord_<libman> Chainsaw chainsaw RAH RAH RAH!
20:37:30Demos[m]a predator could be good, a hunter. Harkin back to Nimrod and when fun was still allowed
20:41:42AraqMomo is a good hunter :P
20:41:56miranAraq: after updating devel to the latest version - it works! (no more "out of memory")
20:44:41Araqgive the lion big ears so that it can fly
20:45:38miranaNIManiacs?
20:45:52Araqhttps://xkcd.com/353/
20:46:12miranone of the search results: http://images4.fanpop.com/image/photos/16900000/Warner-Siblings-Monarchs-animaniacs-16925494-1165-713.jpg
20:46:44Araqwe *need* an animal that can fly.
20:51:23Araqmiran, -1
20:51:42mirandon't worry, i wasn't serious ;)
20:52:46Araqomg, haven't seen this before https://xkcd.com/2030/ it's so true
20:54:27Araq"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:42dom96Updating the paypal donations is such a pain
20:58:04*Trustable quit (Remote host closed the connection)
21:02:31FromDiscord_<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:21Araqfluffy + chainsaw doesn't work
21:03:21*miran quit (Ping timeout: 240 seconds)
21:03:32FromGitter<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:03FromGitter<cooldome> Araq, can you say where is it please?
21:04:18Araqsighashes.nim
21:04:30FromDiscord_<libman> Nim shouldn't be fluffy. It should be a blockCHAIN power tool that cuts through anything!
21:05:20Araqproc idOrSig*(s: PSym, currentModule: string,
21:05:20Araq sigCollisions: var CountTable[SigHash]): Rope
21:05:35FromDiscord_<libman> Sheep are fluffy. Wake up sheeple!
21:05:45Araqiirc that's the only place where it's done
21:07:33FromDiscord_<libman> Vast BigDotCom and government conspiracy to disempower us!
21:08:35FromDiscord_<libman> Ok, my final suggestion: flying animated unfluffy Alex Jones wearing a crown with two chainsaws.
21:09:30FromDiscord_<libman> (Or my old suggestion of a T-Rex.)
21:09:35FromGitter<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:14Araqoh yeah, this "owner" mechanism is just wrong
21:11:20Araqand shouldn't have been introduced
21:12:24*aziz joined #nim
21:12:45Araqbut 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:47FromGitter<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:43FromGitter<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:52dom96timotheecour: Google + site:irclogs.nim-lang.org is likely the best option
21:33:53FromGitter<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:55dom96arnetheduck: You guys got a repo/page with high quality Status logos anywhere?
21:39:55vosper\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:19Araqit's usually "bytes sent"
21:40:59vosperOh, thanks... and if it's -1?
21:41:08vosperSome kind of error?
21:41:18Araqyes
21:41:55vosperAnyway to find out what the error is? (If it's not obvious, I'm very new to Nim)
21:42:28dom96It'll raise on error
21:42:29Araq"You may wish to use the high-level version of this function which is defined below."
21:42:34dom96Not return -1
21:42:50Araqthe high level version raises on error, dunno about the low level version
21:42:59*rayman22201 joined #nim
21:43:07dom96hrm, no, that's not the case
21:44:01FromGitter<arnetheduck> @dom96, from what I can tell, the implementation of that particular function will not raise.. did I miss something?
21:44:11dom96indeed
21:44:15dom96That sucks
21:44:17FromGitter<arnetheduck> in fact, there's a useless success variable being set
21:44:58Araqaccording to inferred effects both would raise OSError.
21:45:15dom96Yeah, but that's misleading :(
21:45:24dom96Probably 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:44Araqbut I've told you before this mechanism is just not good enough
21:45:47dom96This might call for a breaking change
21:46:32FromGitter<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:37FromGitter<zetashift> @dom86 I'm getting an error running the hello world termbox sample: https://pastebin.com/NHFtQZWe
21:46:49FromGitter<zetashift> Do I need an other Nim version?
21:47:11Araqarnetheduck. no need to put more salt into my wounds.
21:47:53dom96zetashift: not sure, try a previous commit, I merged a PR that might have broken it recently
21:47:55vosperlet socket = newSocket()
21:47:55vosperlet result = socket.sendTo("127.0.0.1", Port(9187), "1234")
21:47:55vosperstdout.writeLine(result)
21:48:16vosperSo that prints "-1" to stdout when I run it... but you think it definitely should raise an error
21:48:17vosper?
21:48:26dom96vosper: no, I was wrong
21:48:41FromGitter<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:42vosperOh, sorry, I wasn't following the discussion correctly, I guess
21:49:47dom96arnetheduck: It's misleading in the context of the stdlib
21:49:59dom96And as such it needs to be fixed
21:50:35dom96Yes, 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:00AraqI wrote a long RFC that solves all of these problems.
21:51:24Araqat the cost of unknown new problems and a massive code breakage
21:51:38dom96Yes, and I'm skeptical that it actually fixes this problem
21:52:19dom96vosper: 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:18AraqI think 'sendTo' is fine, the low level procs return "bytes sent or negative value for errors"
21:53:29dom96The low level procs don't belong in `net`
21:53:33dom96That's what `nativesockets` is for
21:53:45*danielhuman joined #nim
21:53:45vosper@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:38FromGitter<zetashift> yea dom works with the previous commit, should I open an issue?
21:54:41Araqthere is raiseOSError(osLastError())
21:54:46dom96vosper: You're not initialising the socket correctly: newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
21:55:00dom96It gets created as a TCP socket by default
21:55:12dom96zetashift: please, or just fix it if you can
21:55:23vosper@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:33dom96vosper: yeah, that's invalid, it was fixed recently
21:55:43FromGitter<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:45dom96but docs are always pointing to the latest stable release
21:56:00*Guest15155 quit (Ping timeout: 256 seconds)
21:56:21vosperOh, I see. Yeah, the code you posted looks a lot more like what I'm used to.
21:56:54FromGitter<arnetheduck> https://medium.com/message/everything-is-broken-81e5f33a24e1 is the canonical article on the subject :)
21:57:27dom96arnetheduck: You cannot prevent all mistakes
21:57:34dom96No matter how hard you try
21:57:49dom96Of course I'm happy to hear suggestion about how to limit the mistakes more effectively :)
21:57:53dom96*suggestions
21:58:27*danielhuman quit (Ping timeout: 240 seconds)
21:59:17vosper@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:06dom96yeah, we could add a check in sendTo/recvFrom to verify the protocol is right
22:01:25dom96Perhaps we should have created distinct types for these in the first place :(
22:01:41FromGitter<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:59FromGitter<zetashift> I'll try to fix the error on the latest commit for now
22:02:19FromGitter<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:46FromGitter<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:49dom96zetashift: oh yeah, I'm afraid they don't :(
22:03:04FromGitter<cooldome> At least an idea how I can trace it down
22:03:31dom96arnetheduck: can you outline how Araq's proposal would help in this situation?
22:04:53dom96Btw nimbus is now a featured project and status is displayed in the top sponsors section on https://nim-lang.org/
22:05:09dom96(If you have a better logo I'll happily replace it)
22:10:03FromGitter<zetashift> fixed the error though running into another one
22:10:25FromGitter<zetashift> I'll boot into my arch see if I still get this stuff one that
22:11:09FromGitter<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:09FromGitter... 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:00FromGitter<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:28Araqto put it differently, essentially the exception mechanism circumvents the type checker
22:15:57FromGitter<arnetheduck> @dom96 - actually, you have it already - down in the sponsors part - can just reuse the same?
22:16:30dom96arnetheduck: it would be nice to get a different logo for Nimbus and/or Status
22:16:33Araqand "tracking" these exceptions is smart, but you don't want "smart" in your type signatures.
22:17:04Araqyou want smart in the proc body, not in its signature.
22:17:10dom96Actually, this misleading tracking can be solved by highlighting inferred exceptions
22:17:50dom96And allowing me to specify: this proc definitely raises OSError
22:18:02dom96(as opposed to: this proc /only/ raises OSError)
22:19:34dom96Exception tracking and the effect system is a brilliant feature, it's just limited, it needs to be more flexible
22:19:45dom96It shouldn't shackle me
22:20:44dom96You could maybe even provide a count of how far in the call stack the `raise` occurs
22:21:48FromGitter<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:09Araqthat's the first thing you hide from the compiler, dom96
22:22:30Araqbecause of callbacks that can do "anything" and async is built on top of these
22:22:33*aziz quit (Quit: Ex-Chat)
22:23:03dom96arnetheduck: 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:52Araqon the other hand, sendTo(): int throws Exception has the same problem.
22:24:05AraqsendTo: Natural throws Exception hasn't.
22:25:05dom96Even for async procs I can mark them as raising OSError
22:25:29Araqyou can, the compiler infers "raises Exception" though
22:25:44dom96yes, and that's fine
22:26:37dom96An explicit statement like: {.raises: Inferred & [OSError].} would be great
22:27:12Araqit infers the OSError too, I don't understand you
22:29:03dom96If 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:29dom96Currently there is no way to distinguish inferred exceptions and explicit in the docs
22:29:35Araqas opposed to the inferred exceptions that the compiler has proven can happen too?
22:29:52dom96And there is no way to flexibly state exceptions explicitly
22:31:01Araqinferred exceptions are not worse than your manual annotations, the problem is that the inference allows you to be sloppy
22:33:01dom96I 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:11dom96It's specifically used by my procedure to signal errors
22:33:19dom96Another topic: https://github.com/nim-lang/Nim/blame/devel/lib/pure/net.nim#L1401
22:33:26dom96How many times have you actually used &=?
22:35:03AraqI thought it would grow on me but I found an even better way of doing the same
22:35:51Araqstill a generic 'sink' operator is sexy and Python can only dream about it
22:37:08dom96It's bloat
22:38:32Araqmaybe. 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:36Araqand an operator avoids this problem, hence '&='
22:39:49dom96Yeah, 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:07dom96Surprised you don't love this approach :P
22:40:22dom96Maybe Unix just hasn't gone far enough
22:40:31dom96After all, you still have write vs. send
22:40:39Araq1. that's not what Unix does.
22:41:03Araq2. Unix doesn't give us a consistent "write" verb as you noticed.
22:41:42Araq3. "write" for strings feels weird for strings, "add" feels weird for files/sockets, hence &=
22:41:51AlexMaxPlan 9 allows you to open tcp connections using the filesystem, iirc
22:42:41FromGitter<Varriount> I've said it before: we should have an SQL based OS
22:43:00*ng0 joined #nim
22:43:41dom96Why in the world is osLastError in ospaths?
22:44:07dom96Araq: &= feels weird for everything
22:44:26Araqit's not, it's in oserr.nim, but that's not a module of its own
22:44:39dom96https://nim-lang.org/docs/ospaths.html#raiseOSError,OSErrorCode,string
22:45:23FromDiscord_<libman> Everything is a stream.\
22:45:57Araqyou can never take a bath in the same stream
22:47:24Araqx = x & "x" --> x &= "x"
22:47:34Araqit definitely is not weird for strings
22:48:07dom96it is when you are used to x.add "x" :)
22:48:10FromDiscord_<libman> &= is not any weirder than +=
22:49:26FromDiscord_<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:56FromGitter<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