<< 27-01-2017 >>

00:05:18*stisa quit ()
00:10:28nivkrux02: https://github.com/niv/ed25519.nim
00:10:51nivits on nimble. installing it via nimble install ed25519 will not allow you to just go "import ed25519" and have it compile
00:15:01*hcorion quit (Quit: Konversation terminated!)
00:31:24*Matthias247 quit (Read error: Connection reset by peer)
00:41:50*vlad1777d quit (Quit: Leaving)
00:49:17krux02niv: I don't have problems with "nimble install ed25519" it just compiles fine
00:55:06*dv- quit (Ping timeout: 240 seconds)
00:56:06*def-pri-pub joined #nim
00:56:46*dv- joined #nim
00:56:52*[ui] joined #nim
01:15:11*sz0 joined #nim
01:21:13*couven92 quit (Quit: Client disconnecting)
01:28:57*aedigix quit (Remote host closed the connection)
01:29:06demi-hmmm, is there something out there for nim that does what the "cmd" module does for python? (looking for an interactive command line prompt)
01:29:22*aedigix joined #nim
01:45:34cheatfatedemi-, biggest part of packages nim has are inside of https://github.com/nim-lang/packages/blob/master/packages.json
01:50:12*yglukhov joined #nim
01:54:42*yglukhov quit (Ping timeout: 252 seconds)
01:57:49Xethis weekend, i'm gonna build something in nim
01:58:50Xei'm gonna build a crud app / wiki for a community i'm in
02:07:35*chemist69 quit (Ping timeout: 264 seconds)
02:12:04*chemist69 joined #nim
02:22:03*chemist69 quit (Ping timeout: 276 seconds)
02:23:12*gokr quit (Quit: Leaving.)
02:32:02demi-cheatfate: thanks, i don't see anything in there based on the description, which means i get to implement it myself :)
02:35:03*chemist69 joined #nim
02:52:17*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
03:06:36*[ui] quit (Quit: Connection closed for inactivity)
03:07:17*brson quit (Quit: leaving)
03:18:43*kulelu88 quit (Quit: Leaving)
03:20:10*Trioxin quit (Ping timeout: 240 seconds)
03:20:39*Trioxin joined #nim
03:52:13*yglukhov joined #nim
03:56:22*krux02 quit (Remote host closed the connection)
03:57:30*yglukhov quit (Ping timeout: 240 seconds)
04:09:47*sz0 quit (Quit: Connection closed for inactivity)
04:33:31*def-pri-pub quit (Quit: leaving)
05:06:55*dyson joined #nim
05:07:08*Trioxin quit (Ping timeout: 255 seconds)
05:07:18*dyson is now known as Guest67728
05:12:09*bjz joined #nim
05:12:33*bjz quit (Client Quit)
05:54:51*yglukhov joined #nim
05:59:20*yglukhov quit (Ping timeout: 255 seconds)
06:46:32*Guest67728 quit (Quit: Konversation terminated!)
06:50:11*gokr joined #nim
06:53:50*nsf joined #nim
06:55:43*bjz joined #nim
06:59:53*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:21:19*bjz joined #nim
07:23:38*Matthias247 joined #nim
07:30:54*Matthias247 quit (Read error: Connection reset by peer)
07:34:24*Matthias247 joined #nim
07:38:41*Matthias247 quit (Read error: Connection reset by peer)
08:05:03*rokups joined #nim
08:08:23*chemist69 quit (Quit: WeeChat 1.6)
08:19:06*Guest89004 joined #nim
08:23:42*yglukhov joined #nim
08:26:37*chemist69 joined #nim
08:29:40*yglukhov_ joined #nim
08:30:10*yglukhov quit (Read error: Connection reset by peer)
08:37:28*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
08:49:01*yglukhov_ quit (Remote host closed the connection)
09:04:58*yglukhov joined #nim
09:23:05*Andris_zbx joined #nim
09:31:47*yglukhov quit (Remote host closed the connection)
09:34:07*couven92 joined #nim
09:42:58*Ven joined #nim
09:49:09*Guest89004 quit (Ping timeout: 260 seconds)
09:56:25*yglukhov joined #nim
10:04:16*yglukhov quit (Remote host closed the connection)
10:04:48*yglukhov joined #nim
10:09:06*yglukhov quit (Ping timeout: 240 seconds)
10:11:30*bjz quit (Ping timeout: 240 seconds)
10:12:51*bjz_ joined #nim
10:13:46*PMunch joined #nim
10:23:57*Guest89004 joined #nim
10:35:28Araqhttps://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/oopsla065-burckhardt.pdf
10:37:26*Guest89004 quit (Ping timeout: 248 seconds)
10:38:01*yglukhov joined #nim
10:40:17*yglukhov quit (Remote host closed the connection)
10:46:47*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:52:56*arnetheduck joined #nim
11:10:12*MrAxilus[m] quit (Remote host closed the connection)
11:10:12*jivank[m] quit (Remote host closed the connection)
11:10:12*hohlerde quit (Read error: Connection reset by peer)
11:10:13*ehmry quit (Read error: Connection reset by peer)
11:10:13*Guest73656[m] quit (Read error: Connection reset by peer)
11:10:13*dyce[m] quit (Write error: Connection reset by peer)
11:10:13*erwana[m] quit (Remote host closed the connection)
11:10:13*TheManiac quit (Write error: Connection reset by peer)
11:10:13*M-Quora quit (Write error: Connection reset by peer)
11:11:31*zevlg quit (Remote host closed the connection)
11:23:36*dyce[m] joined #nim
11:24:47*yglukhov joined #nim
11:41:16*Kingsquee joined #nim
12:01:07*Vladar joined #nim
12:02:53*Snircle joined #nim
12:04:46*jivank[m] joined #nim
12:04:46*hohlerde joined #nim
12:04:47*MrAxilus[m] joined #nim
12:04:48*M-Quora joined #nim
12:04:50*ehmry joined #nim
12:04:53*erwana[m] joined #nim
12:04:54*Guest73656[m] joined #nim
12:04:55*TheManiac joined #nim
12:14:44*Kingsquee quit (Quit: https://i.imgur.com/qicT3GK.gif)
12:27:49*yglukhov quit (Remote host closed the connection)
12:31:20*yglukhov joined #nim
12:32:21*yglukhov_ joined #nim
12:32:21*yglukhov quit (Read error: Connection reset by peer)
12:35:03*Ven joined #nim
12:47:52*plm joined #nim
12:47:55plmHi all
12:58:10ftsfo/ yo
12:58:11*yglukhov_ quit (Remote host closed the connection)
12:59:01*yglukhov joined #nim
13:03:41*yglukhov quit (Ping timeout: 255 seconds)
13:12:51demi-how do i properly forward-declare this so that the type and the proc declaration are satisfied? https://gist.github.com/samdmarshall/9319a361eb0ba14a8e3f62683fecc547
13:13:26Vladardemi-: place it under one type block
13:15:43demi-ah, and that will scope it correctly that the order doesn't matter?
13:16:15demi-wow, neat! thanks very much Vladar
13:17:38*arnetheduck quit (Ping timeout: 255 seconds)
13:17:46Vladarnp
13:27:00*arnetheduck joined #nim
13:29:00cheatfatedemi-, is your `micro` supports nim color syntax?
13:29:18*yglukhov joined #nim
13:34:08demi-I opened a PR for it yesterday, i took a stab but may have missed a few things
13:43:01cheatfateit will be awesome if you accept your PR, because i dont like to setup GO on all of my VMs
13:44:48demi-micro isn't my project, just one i contribute to, if you want to see how it looks in my local copy: http://magic.pewpewthespells.com/iv6s
13:46:06cheatfatedemi-, looks very good, i like it
13:46:12cheatfatebut you have problems with your code :)
13:46:32demi-haha, that's what happens when you leave your editor while you are in the middle of writing code
13:46:33cheatfate`var string` is usable only in procedure declaration
13:46:51cheatfatei mean `var Table`, `var bool`
13:47:01cheatfateand `var string` in your type declaration
13:48:12cheatfateif you want to store reference only, you need to make it `ref` or `ptr`
13:48:43demi-ah, so by using a ref i'd be able to change what value is "assigned" to it?
13:48:59cheatfateyep
13:49:20cheatfatebut you also be able to change it without `ref` too
13:49:34*hendi_ joined #nim
13:49:47flyxdemi-: you can also change the value if it is not a ref. but if it is a ref, the string object will not be copied if you do a shallow copy (typically, assignment) of a variable of the CmdPrompt typ
13:49:48flyxe
13:50:39demi-there might be a bug in the nim linter then, the bool property of the CmdPrompt object wouldn't let me assign a new value to it, then i added the "var" and it stopped complaining.
13:51:48flyxwell, inside builtinHelpCommand, ctx is a `CmdPrompt` parameter which makes it read-only. you could make ctx `var CmdPrompt` if you need to change it (and the changes should propagate to the calling site)
13:51:58*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
13:52:23flyxah, that's builtinQuitCommand where you change activePrompt
13:52:24demi-aaah, i see
13:53:09demi-yeah, if i leave off "var" on the bool property it complains, add the var to the bool property and it thinks it is ok; idk, is that a bug with `nim check`?
13:53:40flyxmay well be. the syntax like you have it should not compile because `var Type` is only defined for parameter or return types
13:53:49flyxbut Araq probably knows better
13:54:56demi-also, for the builtinQuitCommand, if i have the CmdPrompt parameter use "var" will that change be applied to only the scope of that call or will the object retain those changes afterwards as well?
13:55:22flyx`var` basically makes the parameter by-reference instead of by-value
13:55:39flyxso it just applies to the calling context of this proc
13:56:19demi-so i would need to pass in a reference to this object to make it retain the changes outside of the scope of the function call
13:56:31flyxi.e. if you pass a ctx object to a `var` parameter, changes to that value inside the proc will be reflected in the passed variable after the call
13:56:48demi-oh, ok, cool.
13:57:48flyxit's like & in C++ or `ref` in C# or `byref` in VB
13:58:11demi-yeah, i was hoping that was the case, thank you
13:59:12*nsf quit (Quit: WeeChat 1.7)
13:59:20demi-also wondering if there is a formal way to test nim packages without putting an additional nim file into the repo with the rest of the package (because that seems to cause erroneous messages when doing `nimble install`)?
14:00:19flyxyou can put testing code right into the module inside a `when isMainModule:` block
14:01:22flyxbut you can also set up separate test modules. there are no conceptual problems with nimble and test code, you may just have an errenous setup
14:03:48flyxmight go away by just moving test code into a `test` or `tests` directory
14:04:41demi-for example: https://gist.github.com/samdmarshall/a709b6425f5cf06849b721b63fb4fccc (this is something i've seen with a number of packages)
14:06:12flyxah yes. the reason is that for all packages you installed with nimble, you can `import foo` for any foo.nim in the main directory of the package. so if y
14:06:19flyxwhoops
14:06:39flyx*so if people put additional files into the main directory, global namespace gets cluttered by name clashes
14:07:03flyxtherefor, somewhen in the future, nimble will disallow any nim files in the root dir that are not named identically to the package name
14:07:48flyxthe hint tells you what you can do. for example, tell nimble not to distribute that file with `skipFiles`
14:07:59demi-ah, is if i make a "tests" directory in the root of my nimble package, then that will be ignored and i'd just do `include "../foo.nim"` to access the package
14:08:47flyxwell I am not sure whether the tests directory will be ignored automatically (would probably be a sensible thing), but even if not, you would need to `import tests/foo.nim` to include that file
14:09:11flyxbut yes, moving it into tests and `import ../foo.nim` is the way to go
14:09:36flyxyou can still disable tests from being distributed by adding the folder to `skipFiles`, I think
14:09:51demi-ok, cool. thanks
14:10:03*yeeve quit (Quit: Leaving)
14:12:10flyxI only publish packages, never look at what happens when people install them ^^
14:12:42*yglukhov quit (Remote host closed the connection)
14:18:30demi-what does this message mean? "template/generic instantiation from here" is it just informative or am i doing something wrong?
14:18:39*yglukhov joined #nim
14:18:48flyxit usually occurs after a line which describes an error
14:19:04Araqno, before.
14:19:11flyxah, okay
14:22:18yglukhovAraq: do you have any concerns if do() may be used as expression? let a = do(): echo "hi"
14:23:56demi-this is the output I am getting: https://gist.github.com/samdmarshall/4302ba8ab1a736ff5613fe0ea58257b8 from this code: https://gist.github.com/samdmarshall/80722b6af0ef4201749382e853ae754b -- I don't understand what it is trying to tell me
14:25:36cheatfatesomething wrong with line "let new_command_hooks = { "cmd": execCallback, "help": help_hook, "pre": pre_hook, "post": post_hook }.toTable"
14:25:50cheatfateand error happens deeper inside of Table[] code
14:28:00flyxdemi-: seems to be a problem in the tables.nim module
14:28:30flyxthe „template/generic instantiation from here“ lines belong with the succeeding warning lines
14:28:37*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:29:44demi-i'm using 0.16.0, does this mean there is a problem with tables package of the stdlib?
14:30:25cheatfatethere is warning because demi storing callbacks
14:30:41cheatfatewhich are not marked as {.gcsafe.}
14:31:10flyxtry to add {.gcsafe.} to line 34
14:31:20flyxprobably not a problem in tables
14:33:29demi-ypu, that fixed it, thanks
14:33:32flyxI also suggest to use the `result` variable directly in line 61 ff. there is no need to use another variable and assign it to `result` in the end
14:33:45cheatfatedemi-, http://nim-lang.org/docs/manual.html#threads-gc-safety
14:33:52*Ven joined #nim
14:56:33*yglukhov quit (Remote host closed the connection)
14:56:51*vlad1777d joined #nim
14:56:52*xet7_ joined #nim
15:04:09*xet7 quit (Ping timeout: 260 seconds)
15:04:17*xet7_ quit (Ping timeout: 255 seconds)
15:07:07*rupil joined #nim
15:09:55*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:11:23*yglukhov joined #nim
15:14:32*Sembei joined #nim
15:15:25yglukhovAraq: i remember there was type extension feature in Nim, but now can't find evidence of it. Is it still there?
15:16:44*Ven joined #nim
15:17:11*Pisuke quit (Ping timeout: 240 seconds)
15:25:07demi-is there a way to allow some functions to be called from outside of a module and not others?
15:25:33subsetparkdemi-: all procs are private by default, put a * after the name of the proc to allow it to be called from outside the module
15:25:55demi-aaah, that is very nice
15:26:04subsetparkTypes work the same way :)
15:27:22*Jesin quit (Quit: Leaving)
15:29:24*Jesin joined #nim
15:31:36*xet7 joined #nim
15:36:53Araqyglukhov: annotate the object with .partial and in some other module do
15:37:06Araqtype OriginalModule.TypeToExtend = object ...
15:37:16Araqbut that has known bugs
15:37:28AraqI still like the feature though and don't want to remove it
15:37:33yglukhovAraq: so i have to know that my type is gonna be extended in advance?
15:37:41Araqyup
15:37:50yglukhovahh. thats unfortunate...
15:38:04Araqno, that's just good design
15:38:10yglukhovyeah yeah
15:38:14Araq:P
15:39:27Araqabout let a = do(): echo "hi"
15:39:31Araqwhat's wrong with it?
15:39:44yglukhovexpression expected, but found "do"
15:39:58yglukhovparse error
15:40:09*yeeve joined #nim
15:41:00Araqah yeah, probably 'do' is an expression "annotation", it cannot stand on its own
15:41:41Araqyeah, it cannot work, would produce ambiguities everywhere
15:42:11Araqfoo do:
15:42:13Araq bar
15:42:23yglukhovAraq: regarding type extensions. I've been thinking of how to implement weak refs in library code. so that a weak ref could be created for any object type. and so that you might not control the type definition of which you're taking the weak ref.
15:43:02yglukhovand type extensions seemed like a perfect solution except the "no control" part.
15:43:15Araqis this foo(do: (bar)) or (foo do:)(bar)
15:43:55AraqWeakRef[T] ?
15:44:02yglukhov(foo do:)(bar) dosnt look like valid code...
15:44:15yglukhovWeakRef[T]? whats that?
15:44:31Araqyes it isn't valid code but it's how it's parsed currently
15:45:06Araqin no language weakrefs are created with partial classes.
15:45:19Araqit's just another container / generic type.
15:45:56yglukhovAraq: do you see a way to implement it currently?
15:46:07yglukhovWeakRefs, i mean
15:46:15yglukhovor does it already exists?
15:46:29AraqI showed how to do them 8 years ago
15:46:37Araqthey are in some test case
15:47:28Araqtests/gc/weakrefs.nim
15:48:23Araqah ok, that doesn't use generics
15:48:23yglukhovyep, found it, but its not fair
15:48:53yglukhovit only works for types which are intended to be weakrefed
15:49:21yglukhovand i want a completely decoupled solution
15:51:40Araqwell it depends on the semantics
15:52:29Araqyou have to watch out your "decoupled" solution is not a single huge ABA problem
15:53:50Araqconsider this: ref X. you turn it into weakref X. you don't use the weakref for a long time.
15:53:56yglukhovproc weak[](ref T): WeakRef[T]; let wr = weak(myInstance); let strongRef = wr.get(); if strongRef.isNil: ...
15:54:06Araqref X gets recycled.
15:54:16Araqthe same memory gets used for a new object of the same type.
15:54:30Araqyou access it via the old weakref.
15:54:44Araqno crash, no corruption, just a logical error.
15:54:45yglukhovno, you're talking about pointers, not weakrefs.
15:54:58yglukhovweakrefs would become nil upon finalization
15:55:23Araqah ok, that's good
15:55:45Araqso you need to have a finalizer and it's already not "decoupled"? :P
15:56:20yglukhovno, because i can't set/change/tweak the finalizer of already created object
15:56:38Araqexactly.
15:57:39yglukhovmaybe we should change cell finalizer to be an array?
15:57:40yglukhov=)
15:57:50yglukhovof procs
15:58:16yglukhovand then do addFinalizer/removeFinalizer or smth...
15:58:57demi-I think I am creating my function callbacks correctly, but the resulting code doesn't compile, i've attached logs and there are links to the code in the comment on here: https://gist.github.com/samdmarshall/2a109072fb926a2710c58a5bd2314b89
16:01:00Araqdemi-: no you don't understand callbacks yet. and apparently nobody else in #nim
16:01:10demi-:(
16:01:17Araqit's the old nimcall vs closure topic.
16:01:22yglukhovdemi-: regardless your code is correct or not, C compiler errors are de facto Nim bugs. Either nim should tell you about your error, or it should compile. Exception is emit pragma and its friends.
16:01:36Araqyglukhov: he uses 'cast' though ;-)
16:01:46demi-she*
16:01:46Araqbut I agree, the codegen should catch it
16:01:54Araqoh sorry.
16:02:11demi-and without casts it complains of wrong types, even though the type signatures are the same
16:02:25Araqno they are not
16:02:31Araqbut maybe the error message is crap
16:02:33*Trustable joined #nim
16:02:49Araqyour *proc type* has calling convention .closure
16:02:57Araqyour *procs* have .nimcall
16:03:18demi-examining the C code that is generated says they aren't the same, but i don't know how to make them the same
16:03:51Araqthere is an implicit conversion from .nimcall to closure but that tends to fail
16:04:11Araqin tuples which what your {:} construct uses under the hood
16:04:28demi-so I have to add {.closure.} to my procs then?
16:05:51*abeaumont quit (Read error: Connection reset by peer)
16:06:26Araqmore likely wrap them in (do(): someProc())
16:06:50yglukhovhaha, i bet it will not work from the first try =))
16:07:03Araqstupid 'do' notation.
16:07:25Araqthat's what you get when not Araq himself designs a feature.
16:07:26demi-is this something i can do to not place a burden on people consuming this module?
16:08:23*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:08:31Araqdunno, the whole module seems to be based on the idea that 'string cases' don't exist in Nim, but they do.
16:09:22demi-oh? it very well be that i'm missing something vital here, just started to learn nim and come from a python+c background.
16:10:35Araqcase mycommand
16:10:42Araqof "help": printHelp()
16:10:57Araqof "manual": printMoreHelp()
16:10:58demi-ooh
16:11:31Araqand even if 'case' fails for you, you write a 'case'-like macro then.
16:13:17demi-yeah I see -- though I don't think that solves the callback problem i'm having, or if it does then I don't see how
16:14:52Araqyou don't have callbacks.
16:15:34Araqyou wrote a mapping from strings to code blocks but since code blocks don't exist you used callbacks.
16:15:42yglukhovdemi-: just init your tables with `[]=` operator instead of the literal. this should work for you.
16:16:06Araqthe 'case' is already the mapping from strings to code blocks and it's as concise as it can get.
16:16:16yglukhovvar myTable = initTable[string, proc()](); myTable["myProc"] = myProc
16:16:45demi-ah, i will try that yglukhov
16:16:58Araqfine, don't listen to me. -.-
16:17:03demi-Araq: i think I see what you are saying, i will try to refactor to use that approach
16:24:49demi-ha, i should have listened to you Araq, yglukhov's approach still yields the compiler errors for me :)
16:25:50Araqwhat you should write instead is a macro that does the trivial string to procname mapping
16:26:13Araqdispatch x:
16:26:22Araq help()
16:26:27Araq quit()
16:26:46Araq launch()
16:27:03Araqthe 'dispatch' macro translates that into:
16:27:07Araqcase x
16:27:11Araqof "help": help()
16:27:17Araqof "quit": quit()
16:27:25Araqof "launch": launch()
16:27:32*yglukhov quit (Remote host closed the connection)
16:27:42demi-ah
16:27:51Araqtada, you wrote something useful. so useful it should become a Nimble package.
16:27:55Araq;-)
16:28:47*yglukhov joined #nim
16:30:20*xet7 quit (Quit: Leaving)
16:31:07yglukhovAraq: so what do you think about the weakrefs? what would be the good approach? currenlty i see two of them, both reaquire come compiler tweaks. 1. allow any obj type to be extended. 2. allow adding finalizers to existing ref instances.
16:32:40yglukhovAraq, demi-: i wonder why my suggestion failed. should not be nimcalls automatically upgraded to closures when passed to `[]=`?
16:33:02Araqyglukhov: yes but she probably messed up with .gcsafety
16:34:11*PMunch quit (Quit: leaving)
16:34:34Araqyglukhov: I have no opinion yet.
16:34:45*couven92 quit (Quit: Client disconnecting)
16:36:23yglukhovAraq: IMO 2 should be easy. Add a flag to cell (finalizerPtrIsActuallyANullTerminatedArrayAndNotAProc). Check this flag when working with finalizers. smth like that...
16:37:15Araqwhat does the finalizer *do* though?
16:37:39Araqit cannot access object fields since the object doesn't know about the weakref fields
16:38:50Araqit can access some globally shared table, not sure if that's a good idea
16:38:51yglukhovthe finalizer nullifies the weakrefs to this object.
16:39:04Araqhow do you find the weakrefs?
16:39:20yglukhovglobally shared table? =)
16:40:09Araqso it's as expensive as an ID mechanism but it doesn't help with networking
16:40:30AraqI'd use an ID mechanism
16:40:43yglukhovID mechanism?
16:41:12Araqobjects have an ID and you can send it over the wire
16:42:06Araqpretty much like the weakref toy example does it
16:43:13yglukhovwhy would an object need id? cast[int](cast[pointer](myObj)) is an id already.
16:43:33Araqyes but that's fragile, non-deterministic, hard to debug
16:44:04Araqand it's an "ABA" ID
16:44:16yglukhovi would not call generating id by "inc gIdGenerator" any more deterministic.
16:44:28Araqobject gets collected, new one gets created, same ID, oops.
16:44:42yglukhovoh, ok.
16:46:13Araqthe globally shared table has other problems too:
16:46:31Araqif the weakref is on the stack what do you do?
16:46:59Araqunregister when it goes out of scope?
16:47:13yglukhovso... lets think about the 1st approach? Extending a type. We define a hidden ref type WeakReferencesToMe. a member of such type is silently injected to an object upon weak(myObj) call
16:47:44Araq'WeakReferencesToMe' is the problem I'm talking about
16:47:59Araqthese need to be kept up to date.
16:48:25Araqincluding the rather nasty "unregister when out of scope"
16:48:26yglukhovunregister when it goes out of scope: no. weak references can be ref objects themselves. with their own finalizer
16:48:47Araqsure but that's quite some overhead
16:49:13yglukhovtrue, but only if you use them =)
16:49:17yglukhovthats fair
16:49:21Araqmy weakrefs don't require that.
16:49:32yglukhovbecause they are not weakrefs =)
16:50:02Araqwhat makes them non-weakrefs?
16:50:24yglukhovor.. ok, they are. except they require a unique id.
16:50:39yglukhovdo cells have unique ids?
16:51:22Araqthey have one when you define:corruption ... ;-)
16:51:37Araqbecause as I said, pointers suck :-)
16:55:22dom96Guys, can we use -> instead of `do` for lambdas?
16:55:28dom96-> and =>
16:56:14Araqyeah well. "from future import `=>` ". maybe the future should arrive.
16:56:16yglukhovAraq: ok, so does it look like both changes are needed? silent extensions to add id field + multiple finalizers to clear global id set?
16:56:31dom96Araq: indeed
16:57:11Araqyglukhov: if you patch the memory subsystem to provide IDs you need neither.
16:57:49Araqbut this means every cell gets an ID and I guess that's just not necessary
16:58:18yglukhovAraq: i kinda like the concept of pay-as-you-go language. adding id to the memory subsystem doesnt comply with that.
16:58:56Araqthe memory subsystem can do it smarter though
16:59:26Araqsince it almost knows this anyway
17:00:45Araqbut C++ doesn't need type extensions and a list of destructors for this feature.
17:01:18Araqthe RC<T> container needs to support weakrefs and then you're done iirc
17:02:41*hendi_ quit (Quit: hendi_)
17:02:50*nsf joined #nim
17:05:12yglukhovAraq: i don't understand your last 2 messages. does c++ already have enough features to do a weakref? what is RC<T>?
17:05:39Araqcheckout Urho's reference counting implementation
17:10:00yglukhovAraq: urho defines RefCounted, which is to be inherited. how does it help? like i said, there is no problem to make a weakref for an object, whose type explicitly allows weakrefs to it.
17:11:08yglukhovthe problem i want to solve is that the type doesn't know upfront even about weakrefs existance
17:14:50yglukhovmaybe im overcomplicating this. to make it clear, I don't need it badly, just trying to find the limits of nim, and to expand them =)
17:14:50*xet7 joined #nim
17:25:08*yglukhov quit (Remote host closed the connection)
17:36:40*brson joined #nim
17:38:52*yglukhov joined #nim
17:43:24*yglukhov quit (Ping timeout: 260 seconds)
17:44:54*byte512 joined #nim
17:47:16AraqBlaXpirit: we really depend on the gitter bridge now. any news?
17:47:18*krux02 joined #nim
17:47:22*krux02 quit (Remote host closed the connection)
17:52:42plmwhy nim needs a Garbage Collector?
17:55:08Araqbecause it was considered the best way to manage memory.
17:56:31Araqnot sure I still agree with that but every way of managing memory has problems and far reaching implications.
17:58:08plmAraq: how rust is capable to mamage memory without a GC?
18:01:38*couven92 joined #nim
18:10:43Araqgo and ask #rust
18:11:01AraqI think you're just trolling me.
18:12:50plmAraq: not, really.
18:13:31plmAraq: I would like to choose a new languge to learn, I am choosing between rust and nim, and for it I would like to know more about advantages of each one
18:13:57AraqI count the minutes until you try to convince me to convert to Islam
18:18:40plmAraq: You still not converted? ohh
18:21:57*yglukhov joined #nim
18:25:51dom96plm: I think at this point you should evaluate the languages for yourself instead of asking us questions.
18:26:08dom96At least when it comes to questions such as "Why did you do it this way?"
18:26:20*yglukhov quit (Ping timeout: 255 seconds)
18:26:39Araqthe question is not even "why", it's more like "I'm too lazy, can you do my homework for me"
18:26:45BlaXpiritAraq, hm PING gitter.im (34.197.6.22) 56(84) bytes of data. 448 packets transmitted, 0 received, 100% packet loss, time 452972ms
18:29:09dom96I guess they're still having issues
18:29:29dom96maybe `mtr` could shed some light on where the traffic stops?
18:31:12*Matthias247 joined #nim
18:36:19plmAraq: please, less
18:39:23*byte512 quit (Ping timeout: 264 seconds)
18:44:07gangstacathello, Araq, any news on the libui DLL?
18:44:54demi-maybe silly question but can I document the properties of an object? if not, can i apply formatting to the text taken from a documentation block in a .nim file?
18:45:30*brson_ joined #nim
18:50:11*brson quit (Ping timeout: 264 seconds)
18:53:24cheatfatedemi-, is this https://gist.github.com/cheatfate/df05f18c1297a0b40ba8171d4c714b65 what you need?
18:53:36BlaXpiritdom96, travels well to 205.251.245.187 (Amazon's), then next item is just ???
18:54:07demi-ah-ha, it needs to be indented, tyvm cheatfate
18:54:17dom96BlaXpirit: hrm. Maybe you could get in touch with gitter and let them know about this problem?
18:54:38Araqgangstacat: patching the .compile pragma so that it doesn't require a DLL anymore
18:54:54gangstacatoh, cool :)
18:54:58Araqlikely finished this weekend
18:55:11BlaXpiritdom96, I will not do that, sorry
18:55:25dom96BlaXpirit: why not?
18:56:35demi-cheatfate: when i do a `nim doc foo.nim` I don't see the per property documentation comments displayed anywhere
18:56:54BlaXpiritalso from a completely different part of Europe, travels well to 205.251.244.191 (Amazon's), then next item is just ???
18:57:23*Andris_zbx quit (Remote host closed the connection)
18:57:39BlaXpiritbut what about you people? can anyone else reach `ping gitter.im`?
18:58:06dom96hrm, nope
18:58:18dom96But it could be that they ignore ICMP packets
18:58:37cheatfatedemi-, mark properties with `*`
18:58:39dom96I can `curl gitter.im` perfectly fine
18:58:49BlaXpiritoh right..
18:58:51euantorI can't ping them either, so they probably block ICMP
18:58:53cheatfatedemi-, so if they market as public `*` it will be documented
18:59:03demi-yeah i have, that doesn't seem to do anything?
18:59:05cheatfatemarked
18:59:17cheatfatecould you gist it?
18:59:22demi-sure
18:59:23*FromGitter joined #nim
18:59:39BlaXpiritwell that was easy... sorry that i failed with my checks. bot is back online
18:59:59BlaXpiritbut yesterday the problem was certainly more than just with pings
19:01:51dom96great, thanks for bringing it back
19:02:07*adeohluwa joined #nim
19:03:40Araqwow thanks :-)
19:03:52Araqdemi-: 'nim doc2' is the better choice
19:06:18demi-oh
19:06:36demi-hahaha
19:07:26demi-turns out, you shouldn't have ad-blockers enabled in your webbrowser because it will strip the "comments" section of the page :)
19:08:18cheatfatelooks like doc2 is buggy
19:08:28cheatfatebut doc dont have such bug
19:17:00*xet7 quit (Quit: Leaving)
19:21:52*xet7 joined #nim
19:23:16*adeohluwa quit (Remote host closed the connection)
20:13:53*kunev quit (Quit: е те!)
20:19:11*kunev joined #nim
20:28:47*nsf quit (Quit: WeeChat 1.7)
20:45:19*mdeck joined #nim
20:55:02*xet7 quit (Quit: Leaving)
20:57:17*kunev quit (Quit: е те!)
20:59:20mdecknewb here. can anyone explain why "echo [0,1].len" fails but "echo array([0,1]).len" works?
21:02:36*kunev joined #nim
21:02:59mdeckusing nim 0.16.0
21:05:18dom96echo([0,1].len) also works
21:06:09mdeckyeah, i figure it's interpreting as (echo [0,1]).len
21:06:17mdeckbut why does the second form work?
21:09:37dom96not sure, Araq?
21:14:00*gokr quit (Quit: Leaving.)
21:17:22Araqwhat's the question?
21:17:51Araqecho [0, 1].len will work in the next versions
21:18:09Araqit used to mean echo[0, 1] aka array access
21:18:31Araqwe now warn about it because it will mean "pass array to echo"
21:26:57*mdeck left #nim (#nim)
21:32:32dom96The question is:# "can anyone explain why "echo [0,1].len" fails but "echo array([0,1]).len" works?"
21:33:28Araqbecause it's a completely different statement.
21:36:10Araqthe second form works because it converts it to the 'array' type class
21:52:06*rokups quit (Quit: Connection closed for inactivity)
21:55:23*Trustable quit (Remote host closed the connection)
21:57:54dom96Araq: what will the new compile pragmas semantics be?
22:01:15*rupil quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
22:01:19Araq.compile: ("dir/*.cpp", "$1.cpp.obj")
22:01:38Araqcompile every file to ".cpp.obj" file
22:02:31Araqbut now my libui example crashes at init time with "everything successful"
22:02:32demi-I am trying to publish a package and it keeps failing with this error message: https://gist.github.com/samdmarshall/6830f76aaf6636be44e367c75676d612
22:06:25dom96demi-: report it please
22:06:43dom96I'm guessing your package has an incorrect Git/Hg URL though
22:07:02dom96or Nim's uri module can't parse it
22:08:56demi-would that be this? https://github.com/nim-lang/Nim/blob/devel/lib/pure/uri.nim
22:10:13dom96yes
22:10:29demi-ok cool, then i'll debug it
22:11:19cheatfatedemi-, debugging nim application will be tough task :)
22:12:29dom96cheatfate: how so?
22:13:08*couven92 quit (Quit: Client disconnecting)
22:13:52demi-dom96: i started using nim 2 days ago
22:15:41cheatfatedemi-, as Araq always says to if you want to inspect nim variable in debugger use `tab` :)
22:15:47cheatfatesays to me
22:16:19dom96demi-: best approach is to use the stack trace to your advantage. Put some echo()'s to see what the URL is for example.
22:16:33dom96and follow the stack trace to see where the URL is retrieved from.
22:17:04Araqcheatfate: last time I checked the "debugger" cannot even watch a page in memory.
22:17:22Araqso I don't see what we lose.
22:17:35AraqLLDB and GDB are mostly useless for me.
22:18:18Araqand watchpoints are the only sensible way to debug. breakpoints do not give me anything.
22:18:26cheatfateAraq, same for VC debugger, but a little bit easier, because it automatically captures local variables
22:18:51cheatfateand with your latest sighashes, names becomes so ugly :)
22:18:56*Ven joined #nim
22:19:04cheatfateand so long
22:19:19demi-is there a tool for demangling the symbol names?
22:19:22Araqyeah, I intend to fix this this weekend though.
22:20:22cheatfateAraq, so names becomes more friendly? or you just build some .symbol file with names associations?
22:20:47Araqlocals will be MUCH more friendly
22:20:53Araqthe rest stays the same
22:21:04AraqI can give you some mapping file though
22:21:36cheatfateAraq, mapping file will be needed of course
22:22:24cheatfatebut i'm still thinking about to make plugin for gdb like `rust`ers doo
22:23:00Araqyeah and others will be grateful.
22:23:14Araqbut I'm betting on my memory tracker.
22:23:28Araqeventually it will help me find bugs ... :-)
22:23:55cheatfateyep, but don't help me to find async bugs :)
22:24:22demi-ok, I found the problem, https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/publish.nim#L170 this line doesn't return anything for me, exit code is 1; thus `url` never gets set which makes `parseUri()` fail on the string "ssh://" here https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/publish.nim#L178
22:24:31Araqwe'll see about that.
22:24:57AraqI'm writing a wiki page about how to debug Nim code.
22:26:44dom96demi-: nice find. What happens when you execute that command in your terminal?
22:26:59demi-same thing, exit code of 1 and no output
22:27:32demi-a remote origin is set (github), and I can push code to it
22:28:05dom96strange, what's your git version?
22:28:43demi-2.11.0
22:29:10dom96I've got 2.7.4
22:29:58*Kingsquee joined #nim
22:30:42dom96I suppose it's unlikely that it's broken in the newer version
22:32:05*Ven quit (Ping timeout: 248 seconds)
22:34:00*Ven joined #nim
22:37:58demi-i'm not seeing a value for any of the repos I have
22:38:46demi-tried with git 2.10.1, which is the oldest i have available to me
22:39:42plmIt is easy to integrate Python with nim? I mean, like as ctypes.
22:39:57dom96plm: yes
22:40:56*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:41:21dom96demi-: what's in $gitRepo/.git/config?
22:41:30plmdom96: I can to find this information on the http://nim-lang.org/documentation.html
22:42:16dom96plm: this might help https://github.com/jboy/nim-pymod
22:44:03plmdom96: thanks :)
22:45:03plmdom96: actually when I need something with high performance I do that part in C and all the rest in Python. My intention is to substitute that part by Nim. What do you think?
22:45:23plm*That C parts
22:46:40*bjz joined #nim
22:46:49dom96plm: sounds like a great idea
22:48:30*libman joined #nim
22:51:26plmdom96: Some projects I migrate of ctypes to cython, becouse using Python with ctypes there was a few delay/low performance when compared with using cython. Said that, I see that the pymod used on nim is the same I would like to know if
22:51:33plmsorry
22:51:43plmwait..
22:52:06AraqI often do the high performance parts in Nim and then all the rest in Nim.
22:52:22demi-lol
22:52:41dom96This is why NimBot needs a quote database
22:53:01plmdom96: Some projects I migrate of ctypes to cython, becouse using Python with ctypes there was a few delay/low performance when compared with using cython. Said that, I see that nim(via pymod) are using the Python/C API, same as ctypes. Are there the same problem?
22:53:22plmAraq: yes, maybe when I will be good in nim :)
22:54:15cheatfateplm, you will not become good in nim, if you not try to make it
22:54:47plmcheatfate: but I already have so much work done in python :)
22:54:58plmcheatfate: For a new projects, maybe
22:55:02cheatfatei dont think you will get any performance boost with such approach
22:55:12plmcheatfate: why not?
22:55:23plmcheatfate: I have using cython
22:56:50cheatfatei dont know what is cython, but if it uses pythons objects/gc and gil then you can't make it faster
22:57:35cheatfatei mean you will not get any performance boost with pymod...
22:57:51plmcheatfate: cython you need to change on functions to static types and others things (python code will be streange) but is possible to compile the new "python" code
22:57:59cheatfateall you performance will be destroyed by memory allocations/deallocations
22:58:12Araqcheatfate: stop being so negative.
22:58:28Araqit's always worth a try if only to learn something.
22:58:44plmcheatfate: but if nim is faster as C/C++, do parts with slow in python (image processing for example) I can to do in nim and result to python
22:59:05plmThe Araq is a bot?
22:59:13plmIs the Araq a bot?
22:59:15subsetparkI recently was experimenting with calling Nim via the Python FFI - I found `ctypes` to be by far the simplest solution
22:59:26dom96plm: yes, he's written in Nim
22:59:41dom96Naturally
23:01:14plmcheatfate: so, use nim binding to python will not be faster like as I use python with C (using ctypes)?
23:07:54cheatfateplm, it depends on many factors
23:16:29*plm quit (Quit: leaving)
23:27:14*Vladar quit (Quit: Leaving)
23:30:36*demi- quit (Quit: Server shutdown in 3... 2... 1...)
23:46:56*demi- joined #nim
23:53:29demi-dom96: i think this is the command that is wanted: `git ls-remote --get-url`
23:54:31demi-also this is the answer to your earlier question that i missed: https://gist.github.com/samdmarshall/25209c2342e9e64d992b9acdc2710044
23:56:21dom96demi-: works for me, feel free to create a PR to change the used command.