<< 21-11-2017 >>

00:01:53skrylararaq will probably hate it, but i have this weird module now where you can associate variables with it and it will do a toposort on those to figure out the update order and run closures when stuff changes
00:16:23*MJCaley joined #nim
00:16:49*rbrt joined #nim
00:20:48Araqskrylar, nope, I'm interested
00:21:01Araqsounds like what I built for Karax's "reactive extensions"
00:23:37skrylarspent a chunk of today working on the macro for it
00:23:56skrylarjust needs the sorting chunk and it should be testable
00:24:54Araqcool, very interesting to compare it to may own dependency graph implementation
00:25:18*sendell quit (Remote host closed the connection)
00:28:10skrylari haven't seen it
00:28:31*MJCaley quit (Quit: MJCaley)
00:34:50skrylarI will admit that I think Redbol dialects are.. nicer than macros.
00:34:58skrylarAlthough I think the nim compiler would have a seizure with them
00:35:19skrylarmostly because a redbol dialect just goes straight to a PEG parser, so you can have any random syntax (the token types are fixed, though :|)
00:47:32*MJCaley joined #nim
01:07:38*voidspacexyz joined #nim
01:13:04*marenz__ quit (Ping timeout: 248 seconds)
02:34:33GitDisc<treeform> I am working on font rasterizer in pure nim. I feel like I made a bunch of progress. I wanted to share. Check this out:
02:34:36GitDisc<treeform>
02:34:36GitDisc<treeform> https://cdn.discordapp.com/attachments/371759389889003532/382358106853736469/unknown.png
02:34:55GitDisc<treeform> And in real scale:
02:34:57GitDisc<treeform>
02:34:57GitDisc<treeform> https://cdn.discordapp.com/attachments/371759389889003532/382358191876472833/unknown.png
02:35:15GitDisc<treeform> Two of them are not mine, can you guss which one is mine?
02:52:27*MJCaley quit (Quit: MJCaley)
02:53:44GitDisc<treeform> mratsim, Green thread, fibres, and coroutines, are like names for the same kind of thing. They are all implemented slightly differently. Each implemination has pros/cons.
02:53:48*chemist69 quit (Ping timeout: 240 seconds)
03:07:39*chemist69 joined #nim
03:30:25*endragor joined #nim
03:32:06*rbrt quit (Quit: Oíche mhaith)
03:41:05skrylarSort of tempted to mark that SuSE-specific bug as wontfix
03:42:12skrylarsuppose that depends on if its possible to try/catch a staticexec call and use pass{c,l} from those clauses
03:45:07*kier joined #nim
03:45:54*dddddd quit (Remote host closed the connection)
03:53:00*JappleAck joined #nim
04:24:11*BitPuffin|osx joined #nim
04:25:01skrylarAraq, prepare for anneurisms: https://github.com/Skrylar/cobweb
04:29:21*JappleAck quit (Ping timeout: 248 seconds)
04:38:19*alfonso joined #nim
04:43:26*JappleAck joined #nim
04:50:35FromGitter<Varriount> treeform: The one on the bottom is yours.
05:06:41*voidspacexyz quit (Ping timeout: 248 seconds)
05:28:42*skrylar quit (Ping timeout: 260 seconds)
05:34:56*skrylar joined #nim
05:40:17*rauss quit (Ping timeout: 248 seconds)
05:43:29*skrylar quit (Ping timeout: 255 seconds)
05:45:35*skrylar joined #nim
05:46:21*voidspacexyz joined #nim
05:49:28*aa_ joined #nim
05:49:52*aa_ quit (Client Quit)
05:54:05*SenasOzys__ quit (Ping timeout: 240 seconds)
06:38:06GitDisc<treeform> Varriount, nope the one in the middle is mine.
06:43:21*nsf joined #nim
07:47:21*dexterk_ joined #nim
07:47:52*dexterk quit (Ping timeout: 252 seconds)
07:59:29FromGitter<Varriount> treeform: You're doing really well then, that
08:03:39FromGitter<Varriount> treeform: How complex is the code?
08:08:55*Vladar joined #nim
08:24:43*xkapastel quit (Quit: Connection closed for inactivity)
08:29:35*claudiuinberlin joined #nim
08:39:39skrylarwell that was fun
08:40:05skrylarusing elisp to convert the foo(): status forms to procs that hceck for errors and raise
08:40:46skrylaralthough in retrospect i suppose a macro could have done that and been passed as a pragma :ponders:
08:48:33*Vladar quit (Ping timeout: 248 seconds)
08:56:16skrylarok. firebird wrapper updated to use exceptions
09:12:20*Arrrr joined #nim
09:22:08*Shoozza quit (Ping timeout: 252 seconds)
09:22:08*Shoozza joined #nim
09:24:07Araqskrylar: https://github.com/pragmagic/karax/blob/master/karax/reactive.nim
10:03:26FromGitter<mratsim> Free compiler courses at Stanford: from HN comments apparently it's good: https://lagunita.stanford.edu/courses/Engineering/Compilers/Fall2014/about
10:07:21cremMost compiler courses I saw for some reason spend 90% of time in parsing part and 10% in code generation.
10:09:37cremAt the university I had 100% parsing course, I guess.
10:26:08*BitPuffin|osx quit (Ping timeout: 248 seconds)
10:30:00*skrylar quit (Remote host closed the connection)
10:31:06AraqI fail to see how Java or C++ could be good languages for compiler development, they should have picked an ML variant
10:33:55Araqthis has come up before and even the Scala inventor eventually admitted that sum types are far superior to build a compiler with than any kind of inheritance model plus a visitor pattern
10:35:26*arnetheduck joined #nim
10:37:49*floppydh joined #nim
10:38:28*gangstacat quit (Quit: Ĝis!)
11:06:15FromGitter<mratsim> Everytime I see "pattern" I read "workaround for language lack of something"
11:07:02FromGitter<alehander42>
11:13:34*Vladar joined #nim
11:30:15*voidspacexyz quit (Ping timeout: 250 seconds)
11:33:48*jrp93 joined #nim
11:33:51*jrp93 left #nim ("Leaving")
11:37:53*gangstacat joined #nim
11:39:40*dddddd joined #nim
12:27:55FromGitter<mratsim> Is there a way to make the {.shallow.} ptragma work without wrapping another type? ⏎ ⏎ ```type COWobject[T] = object ⏎ metadata: int ⏎ data {.shallow.} : seq[T]``` [https://gitter.im/nim-lang/Nim?at=5a141bca540c78242d2e7763]
12:30:03Araqmratsim: nope
12:34:28FromGitter<mratsim> okay
12:35:58*alfonso quit (Quit: Page closed)
12:50:57*sendell joined #nim
13:03:11*sendell quit (Remote host closed the connection)
13:05:27*ryanhowe quit (Quit: WeeChat 1.4)
13:05:53*ryanhowe joined #nim
13:35:05FromGitter<kinokasai> Hey, I've got a problem, where the TypeMismatchError's got and expected are the same to me
13:35:08FromGitter<kinokasai> https://play.nim-lang.org/?gist=aa7481459a8afdb1249fb8b8c8b70d40
13:35:34FromGitter<kinokasai> (It involves seqs of seqs)
13:36:26FromGitter<kinokasai> Would someone be so kind as to explain why this is an error ? c:
13:36:58Araq var seq[seq[int]] # invalid type within an object
13:37:08Araqthe compiler should catch that but doesn't (yay)
13:37:36FromGitter<kinokasai> Hm.
13:37:49FromGitter<kinokasai> How could I fix my code?
13:39:20Araqhttps://play.nim-lang.org/?gist=bf3e5bd346b127dcebd0890ef1bd5ae0
13:42:03FromGitter<kinokasai> Oh man I'm dumb
13:42:08FromGitter<kinokasai> Thanks a lot.
13:42:35cremHm, nimbook says that "break blockname" breaks out of all loops within a block, but that's not what it seems to do.
13:45:58Araqwell it breaks out of the block named "blockname"
13:46:28*endragor quit (Remote host closed the connection)
13:46:57*endragor joined #nim
13:47:11*fvs joined #nim
13:48:19cremYes, it doesn't have to do with loops at all. But it sounded like if there is something in the block after the outer loop, it would be executed. And also it's not clear whether code inside outer loop just after inner loop was supposed to execute too.
13:49:00cremAnyway, after reading but before checking with actual code, I supposed that it works differently.
13:49:23*endragor_ joined #nim
13:51:27*endragor quit (Ping timeout: 248 seconds)
13:52:39*voidspacexyz joined #nim
13:53:37*voidspacexyz quit (Remote host closed the connection)
13:53:41*endragor_ quit (Ping timeout: 250 seconds)
14:03:24*endragor joined #nim
14:03:25*endragor quit (Remote host closed the connection)
14:11:05*dddddd quit (Ping timeout: 240 seconds)
14:11:38*endragor joined #nim
14:12:43Arrrris like the block was a proc and you are returning
14:13:53cremYes, I understand now, it's a jump to the end of the block. It's just that I originally understood it wrong when reading the book.
14:22:38*BitPuffin|osx joined #nim
14:36:54*Guest33 joined #nim
14:36:58Guest33Hello
14:38:19Guest33If I want to build a REST API with `asyncHTTPserver` and `asyncpg`, do I also need `asyncdispatch` and `asyncnet` ?
14:48:51Araqhello troll. you need 'asyncdispatch' too.
15:00:23Guest33im not a troll
15:00:33Guest33im using kiwiirc as a guest
15:01:17Guest33Araq I only need asyncdispatch or asyncnet also?
15:01:45Araqthe compiler will tell you
15:02:45*SenasOzys__ joined #nim
15:03:02Guest33alright
15:03:32*Guest33 left #nim (#nim)
15:03:44*MJCaley joined #nim
15:10:32*elrood joined #nim
15:11:46*BitPuffin|osx quit (Ping timeout: 264 seconds)
15:14:04*rauss joined #nim
15:15:13*xkapastel joined #nim
15:17:27*arecaceae quit (Remote host closed the connection)
15:17:45*arecaceae joined #nim
15:23:21FromGitter<mratsim> @Araq there is no way currently to check if a return value will be used in a `let` assignment, `var` assignment or a function call right?
15:23:44GitDisc<treeform> Varriount, It's not too bad. The code is not very complex, but it feels like I fight for every line. Go back and forth a ton.
15:24:34Araqmratsim: TR macro?
15:27:44FromGitter<mratsim> Oh mmm we can use let and var constraints in TR macro? Have to check that would solve my copy on write issue without needing assignment overloading.
15:29:26*miran quit (Quit: Page closed)
15:30:09Araqtold you before, you can't move into a 'let'
15:30:26Araqyou can only move the last usage
15:30:38Araqyes, the compiler does it wrong too.
15:30:48Araqthat's not a reason to copy this behaviour
15:36:55*laas joined #nim
15:39:37FromGitter<mratsim> If I have `let a = someCostlyObject` and `let b = a` I want both to refer to the same memory location. The expected design is here: https://github.com/mratsim/Arraymancer/issues/157. The reason why is that I expect Tensors to be in the 10+MB to a few GBs in size and memory is scarce and costly. If it's for immutable variables no need to copy it.
15:40:00*endragor quit (Remote host closed the connection)
15:40:33*endragor joined #nim
15:42:32laasAraq: I didn't make a gist, but I made a hastebin: https://hastebin.com/icipunotug.cs
15:42:38laasMy problem:
15:42:49laasfirst set of templates don't work, due to a mysterious error about unknown type, while the second ones do
15:43:05FromGitter<mratsim> Since there is a GC, I won't have the ownership issue / who destroys the object as in C++ / Rust.
15:43:41FromGitter<alehander42> how can I interpolate into string in a template ?
15:44:04FromGitter<alehander42> eg `template a(s: string) = "12"`s`""`
15:44:29Araqmratsim: yes, but you can't just break the language 'var x = y' making a copy and 'let x = y' not making a copy. if you want to avoid copies, use 'ref T'
15:45:32*endragor quit (Ping timeout: 268 seconds)
15:49:46FromGitter<mratsim> The issue is that Tensors have metadata (always copied) and data (ideally copy-on-write). And the special behaviour is only for a specific type, I don't change string/seqs.
15:51:24FromGitter<mratsim> I have the opposite issue with Cuda (and in the future OpenCL) pointers. On let assignment, it's shallow, on var assignment it's also shallow (but I want deep copy)
15:53:10FromGitter<mratsim> In any case assignment overloading is not working so what I can do now is via TR macros detect if parameters are `let` and/or `var` and call the appropriate version.
15:53:31FromGitter<andreaferretti> @mratsim I would not do anything too clever
15:53:37FromGitter<mratsim> Of each of my procs (slice, reshape, etc)
15:53:52FromGitter<andreaferretti> I think whatever behaviour you choose will turn out ot be surprising in some case
15:54:01FromGitter<andreaferretti> I'd stick with using ref types
15:54:12FromGitter<andreaferretti> and explicit cloning when needed
15:57:45FromGitter<mratsim> @andreaferretti it may be what happens in the end but "let -> shallow" and "var -> deep" is simple, that's what Matlab and R are doing while Python and Julia choose reference semantics. It's even better in Nim because there is the `let` vs `var` distinction.
16:00:51FromGitter<andreaferretti> I think this would be confusing in the common case where you want to share AND modify something
16:01:04FromGitter<andreaferretti> like the weights in a RNN
16:01:10FromGitter<andreaferretti> you want them to be shared
16:01:18FromGitter<andreaferretti> but also to train them
16:01:36FromGitter<andreaferretti> I would assume that to have something modifiable I should use a var
16:01:54FromGitter<andreaferretti> with your design, I would get no sharing inadvertently
16:03:57*floppydh quit (Quit: WeeChat 1.9.1)
16:04:11*rbrt joined #nim
16:05:12FromGitter<mratsim> There is explicit opt-in: `var weight2 = weight1.unsafeView`
16:06:22*PMunch joined #nim
16:07:02FromGitter<andreaferretti> ah ok
16:07:13FromGitter<andreaferretti> I prefer explicit cloning, but that's fine
16:07:18FromGitter<mratsim> Basically it's a choice between safe by default (copy) and littering the code with "unsafeSlice, unsafeView, unsafeReshape" or being unsafe by default (ref) but having to clone explicitly and also make it harder to debug unexpected mutation.
16:07:38FromGitter<andreaferretti> yup
16:07:45FromGitter<mratsim> I'm greedy and I want both ;)
16:09:14FromGitter<mratsim> i.e. when there is no mutation involved it's fine to have ref semantics.
16:19:33*rbrt quit (Quit: Oíche mhaith)
16:23:24*rbrt joined #nim
16:23:30*gangstacat quit (Quit: Ĝis!)
16:26:36*gangstacat joined #nim
16:31:02FromGitter<mratsim> I have found this very relevant thread with a macro that warns about implicit copy. Oh oh a new toy to play with: https://forum.nim-lang.org/t/2480
16:33:14*SenasOzys__ quit (Remote host closed the connection)
16:35:25*miran joined #nim
16:49:22*PMunch quit (Remote host closed the connection)
16:51:07*salewski joined #nim
16:53:14salewskiI still have the feeling that Ruby's notation for this statement is better:
16:53:18salewskiw = true if a = 1 and b > 0
16:53:53salewskiIt is only one line, and what happens is at the beginning.
16:54:22salewskiBut I assume there is no macro solution in Nim to aloow this notation.
16:55:22salewskiOh, typo: w = true if a == 1 and b > 0
16:59:11*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
16:59:42*salewski quit (Quit: WeeChat 1.9.1)
17:00:16FromGitter<andreaferretti> else?
17:00:32FromGitter<andreaferretti> withouth an else this does not really make sense
17:00:50FromGitter<andreaferretti> and if you add an else, what happens is not at the beginning any more
17:01:39miranand then it exists `w = if a==1: true else: false`
17:02:31*salewski joined #nim
17:03:08salewskiWell, I have used that Ruby notation without an else always.
17:04:34salewskiI can not remember if an else would be allowed at all in Ruby for that notation -- I guess not.
17:05:20*MJCaley quit (Quit: MJCaley)
17:05:34*Jesin joined #nim
17:05:35salewskiRuby has also unless instead of "if not" which is also nice, but does not allow an else.
17:07:29salewskimiran, I think your suggestion is not really easy to read.
17:07:43miranit is not my suggestion, that's how nim does it :)
17:08:12miranbut i agree it is not the easiest thing to read
17:08:39*jsgrant quit (Read error: Connection reset by peer)
17:09:38*jsgrant joined #nim
17:10:04salewskiif a == 1 and b > 0:
17:10:11salewski w = true
17:10:33salewskiis really not bad, but consumes two lines.
17:11:02miranwell, you can put the second line after :, making it one-liner :)
17:11:26*TjYoco joined #nim
17:12:17salewskiYes, but then what happens is not at the beginning. I did that in my early Nim days, but later slipt it alsways to two lines.
17:12:26*MJCaley joined #nim
17:12:41salewskiif a == 1 and b > 0: w = true
17:13:32salewskiOK, not that important. Bye.
17:18:17*TjYoco quit (Ping timeout: 255 seconds)
17:19:33*Trustable joined #nim
17:19:51AraqNim's way of doing if expressions is superior because it uses the same syntax for statements and expressions. in fact, the distinction between statements and expression belong to the 90ies, we learned a bit about language design since then
17:29:59FromGitter<andreaferretti> I agree
17:30:09FromGitter<andreaferretti> I have never used an if expression without an else
17:30:18FromGitter<andreaferretti> I don't even know what that would mean
17:30:32FromGitter<andreaferretti> what gets assigned to the value in the else case
17:30:33FromGitter<andreaferretti> ?
17:32:28*TjYoco joined #nim
17:33:35salewskiandreaferretti my uses cases are where a variable has an value, and I have to change it under a condition.
17:33:56salewskiI am using a lot if's without else.
17:41:04subsetparki gotta say, 'unless' is the insanest keyword i've ever used
17:41:49FromGitter<andreaferretti> uh that looks super weird to me
17:42:00FromGitter<andreaferretti> for me an if expression is a value
17:42:16FromGitter<andreaferretti> whatever is to the right of `=` has a value BEFORE being assigned
17:42:25FromGitter<andreaferretti> and you assign this value to the left hand side
17:42:46FromGitter<andreaferretti> if I want to change it, I would use an if statement
17:43:08FromGitter<andreaferretti> ```if whatever: ⏎ a = b``` [https://gitter.im/nim-lang/Nim?at=5a1465ab614889d475ab36c0]
17:43:46FromGitter<andreaferretti> but if I use an if expression, that has to be a value
17:44:02FromGitter<andreaferretti> I wouldn't use an if expression for side effects
17:44:36subsetparkbut for these examples, you can also just say `w = a == 1 and b > 0`
17:45:47FromGitter<techate> it isn't an 'if expression'. it's a conditional statement. it's not just for assignment. it reads 'doThis if test', or 'doThis unless test'.
17:45:47*cspar_ quit (Ping timeout: 268 seconds)
17:46:12FromGitter<andreaferretti> I understand
17:46:16FromGitter<andreaferretti> but reading
17:46:32FromGitter<andreaferretti> ```a = 1 if something```
17:46:37FromGitter<andreaferretti> I understand
17:46:50FromGitter<andreaferretti> ```a = (1 if something)```
17:47:02FromGitter<techate> and that isn't what he's talking about.
17:47:04FromGitter<andreaferretti> which does not really make sense
17:47:12FromGitter<andreaferretti> yeah, I get it
17:47:17FromGitter<techate> you keep saying that.
17:47:24FromGitter<andreaferretti> but still I find the notation completely innatural
17:47:32FromGitter<andreaferretti> it reads like an if expression
17:47:34FromGitter<andreaferretti> but it isn't
17:47:44FromGitter<andreaferretti> it is some sort of inverted control flow
17:47:51FromGitter<mratsim> You’re mixing statements and expression salewski, basically you want to declare the statement after the modification, right?
17:48:09FromGitter<techate> it's similar to a thing in Nim. but it, itself, is not in Nim. so that's a source of confusion. this would be an argument against including it in Nim.
17:48:11FromGitter<andreaferretti> I was just pointing out that what looks natural to someone looks horrifying to other people
17:48:12FromGitter<mratsim> I prefer to have the condition before.
17:48:42FromGitter<techate> yes, people with one set of goggles see things differently than other people with other goggles.
17:49:56salewskiandreaferretti: Indeed it is some sort of inverted control flow
17:50:05FromGitter<techate> anyway, the guy with Ruby goggles like them because there's a leading statement and then whether that statement happens is somewhat deemphasized.
17:50:31salewskiCan be confusing at first, but it is used a lot in Ruby.
17:50:46FromGitter<techate> I think you could imitate that by putting the statement in a proc, but that it's not worth it.
17:51:05FromGitter<andreaferretti> The reason I find it confusing is... well, it looks like you are testing the thing too late
17:51:16FromGitter<andreaferretti> `dropBomb if isEnemy`
17:51:19FromGitter<andreaferretti> ops
17:51:25FromGitter<andreaferretti> the bomb is already dropped
17:52:03FromGitter<andreaferretti> Anyway, gotta go, bye!
17:52:51salewskiYes, but the fact that the action is at the beginning can sometimes really help reading the code. Not always.
17:52:55FromGitter<mratsim> “It breaks the law of causality” :P
17:53:14FromGitter<techate> these kinds of complaints require you to forget that the complaint is expressed in English.
17:53:33*fvs left #nim ("ERC (IRC client for Emacs 25.3.1)")
17:53:42*claudiuinberlin joined #nim
17:56:35*acidx quit (Ping timeout: 240 seconds)
17:57:49salewski"goToWork unless itIsSunday" vs "if not sunday: goToWork"
17:58:13salewskiBye.
17:58:22*nsf quit (Quit: WeeChat 1.9.1)
17:59:57*salewski quit (Quit: WeeChat 1.9.1)
18:01:14subsetparkThose types of formulations drive me as crazy in English as in programming: "Ok, take the first door on your right - (uh huh, done) - unless the light is on. Then take the second door on the left!" (dammit!)
18:02:30federico3subsetpark: usually the "unless" is 3 paragraphs below
18:03:07subsetparkIt seems that we are discovering that "unless" should be banished from all language, not just Ruby
18:04:02federico3banished from on-call runbooks probably
18:06:09*jjido joined #nim
18:08:04*MJCaley quit (Quit: MJCaley)
18:19:48*SenasOzys joined #nim
18:21:12cremI'm confused about what "0123456789"[2..<4] means. Nimbook suggests it should be "23456" (from 2nd till 4th from the end), but in reality it is "23" (from 2nd till 4-1=3rd)
18:21:42miranare you sure it is <4 and not ^4?
18:22:02cremAh! wow! Yes, I confused it!
18:22:09cremAmazing.
18:22:47cremI checked like 3 times with the book and didn't notice I typed it wrong.
18:25:02*xkapastel quit (Quit: Connection closed for inactivity)
18:27:35*Arrrr quit (Read error: Connection reset by peer)
18:30:36*gangstacat quit (Quit: Ĝis!)
18:33:57*gangstacat joined #nim
18:41:34*TjYoco quit (Quit: Leaving)
19:02:24*JappleAck quit (Quit: Leaving)
19:03:01*d10n-work joined #nim
19:14:41*MonsterAbyss quit (Ping timeout: 248 seconds)
19:17:13*MonsterAbyss joined #nim
19:18:12*jjido quit (Remote host closed the connection)
19:19:22*jjido joined #nim
19:22:10*cspar joined #nim
19:26:52FromGitter<zetashift> @mratsim think I could follow along instead using Nim? I got some free time soon and get better with programming & Nim
19:29:13*dddddd joined #nim
19:37:08federico3!eval var q = @["", "foo", "bar"]; q.del(0); echo q
19:37:11NimBot@[bar, foo]
19:39:22FromGitter<matrixbot> `pqflx3` !eval var q = @["", "foo", "bar"]; q.delete(0); echo q
19:40:16FromGitter<kayabaNerve> !eval echo("test"[0])
19:40:17*Trustable quit (Remote host closed the connection)
19:40:18NimBott
19:44:06Araqshould we deprecate 'del' and name it something else?
19:44:14federico3yep
19:44:39AraqreplaceByLast ?
19:44:43federico3I just saw the doc: deletes the item at index i by putting x[high(x)] into position i - the name is misleading indeed
19:44:50Araqs.replaceByLast(i)
19:45:35federico3is that even useful?
19:45:52Araqhuh? I use it all the time when performance is critial
19:46:12AraqO(1) deletion that is even possible when iterating over the data structure
19:46:23Araqvery useful in Nim's GC
19:47:14federico3yes, I'm looking at the implementation - it's the only O(1), and replacing it with a s.replaceWith(x, y) would not be the same)
19:47:57dom96huh?
19:47:58dom96why?
19:49:03AraqdelUnordered() ?
19:49:09dom96Why do you want to deprecate it?
19:49:27Araqdom96, in order to rename it
19:49:59Araqbut hash tables also use 'del', 'del' is Nim's unordered delete
19:50:01dom96...
19:50:07dom96Why do you want to rename it then, omg
19:50:19Araqdom96, it's error prone for federico3
19:50:42Araqbut I think 'del' is fine and you need to learn more Nim :P
19:50:47federico3it's not even a "delete" in the first place
19:50:50dom96context please
19:50:56Araqit is!
19:51:05Araqit is a delete, what else
19:51:25Araqdom96, context: system.del vs system.delete
19:51:43dom96*facepalm*
19:51:47federico3replace position x with position s.high and delete the last element
19:51:58dom96Presumably federico3's issue is described on Github?
19:52:06dom96can you link me there?
19:52:17Araqno, it's "swap position x with s.high and delete s.high"
19:52:29dom96I don't see anything in the chat, you just started randomly talking about this.
19:52:33federico3that's my point
19:52:36dom96So I assume there was some discussion somewhere else?
19:52:42Araq"effectively deleting x"
19:52:53federico3dom96: this:
19:52:55Araqdom96, the context is federico3's NimBot example
19:52:55federico3!eval var q = @["", "foo", "bar"]; q.del(0); echo q
19:52:58NimBot@[bar, foo]
19:53:21dom96I see
19:54:11federico3it's just unexpected, given the name "del". I can live with it but I guess it will be surprising to people
19:56:02Araqhttps://unix.stackexchange.com/questions/405783/why-does-man-print-gimme-gimme-gimme-at-0030
19:56:18dom96Well, FWIW I like this name.
19:56:32dom96And I have a feeling my book describes this difference
19:56:32AraqI can't come up with a better name and it's consistent with hash tables
19:56:53Araqsometimes you simply have to read the docs, it sucks, I know
19:57:08federico3it does
19:59:05FromGitter<mratsim> I got tripped by del this weekend too ;)
19:59:14*jjido quit (Read error: Connection reset by peer)
19:59:17FromGitter<mratsim> @zetashift follow along?
20:01:44*rbrt quit (Quit: Oíche mhaith)
20:02:24Araqdom96, can I rename "showstopper" to "upcoming release"
20:02:49Araqit sounds better and I'd like to use it for release planning
20:03:46dom96you should use milestones for release planning
20:04:00Araqthat didn't work well the last time
20:04:32Araqtags seem more useful, they automatically move to the "Next release" target
20:06:33*jjido joined #nim
20:11:20*rbrt joined #nim
20:12:26dom96I do like the current name, but do whatever you wish
20:12:40*SenasOzys quit (Remote host closed the connection)
20:12:46*SenasOzys_ joined #nim
20:16:22Araqwell alternatively I can simply introduce a new tag
20:18:55*jjido quit (Read error: Connection reset by peer)
20:20:47*arnetheduck quit (Remote host closed the connection)
20:23:16*jjido joined #nim
20:26:21*couven92 joined #nim
20:27:55*jjido quit (Read error: Connection reset by peer)
21:02:55cremThere's no way to ensure that string function parameter will be non-nil, is there?
21:16:41*laas quit (Ping timeout: 268 seconds)
21:16:54*ryanhowe quit (Quit: WeeChat 1.4)
21:19:23*PMunch joined #nim
21:24:46*vivus joined #nim
21:26:54*miran quit (Quit: Konversation terminated!)
21:28:09cremwhy is there `nim doc` and `nim doc2`? Which to use?
21:28:31dom96the second one
21:28:31vivuscrem: whatever is on the sites main page
21:28:42dom96they work slightly differently
21:28:52*vlad1777d joined #nim
21:29:25cremThe only difference I noticed so far is missing * on exported symbols.
21:30:05GitDisc<treeform> I think i tried doc2 but it does not go down `includes` like doc does, so i stuck with doc.
21:31:35*Vladar quit (Quit: Leaving)
21:35:26cremHm, why it included all fields of a type (object) in the doc. I thought it would only include exported fields.
21:40:27*vlad1777d quit (Ping timeout: 240 seconds)
21:49:07*vlad1777d joined #nim
22:00:39FromGitter<Varriount> Araq: What would the Nim compiler print at midnight? :P
22:03:29*nsf joined #nim
22:03:38federico3helpful and detailed error messages :P
22:15:00*sendell joined #nim
22:18:18*marenz joined #nim
22:25:19*gangstacat quit (Quit: Ĝis!)
22:26:50PMunchSeeing how this: https://www.reddit.com/r/nim/comments/7dm3le/tutorial_for_types_having_a_hard_time/ got some attention over on Reddit I'm considering writing it up as a proper tutorial format with illustration images and such. Could some one fact check my information there? It's mostly based on my current information about how Nim works, which may or may not be correct :P
22:29:16vivusPMunch: where is your tutorial link?
22:29:54sendelli might be interested in reading it. still not 100% sure about seq/string semantics
22:41:27AraqVarriount: guess what.... "must ... destroy ... unix..."
22:42:10Araqcrem, in 'devel' there is only 'nim doc'
22:42:33Araqso that's what you should use (in former versions that was 'nim doc2')
22:45:12PMunchvivus, sendell, haven't written an actual tutorial for it, just that long Reddit comment :P
22:46:05PMunchsendell, it doesn't really touch that much on seq/string semantics either. That's something I should include if I decide to write a full tutorial
22:47:59cremFunction names are recommended to start from a lowercase letter, right?
22:48:20sendellsomething i'm also wondering is how to get a temporary ptr on a fetched value object, if var/let copies them on assigment
22:48:20crems/from/with
22:48:25PMunchYeah, think so
22:48:39sendellis it idiomatic to use a "ptr T" variable for such stuff?
22:49:09vivusno more pointers in nim
22:49:09PMunchNo, ptr is pretty much only used for C binding-
22:49:31PMunchA ref though can be used
22:50:09sendellyeah but let's say i have a map of owned objects (not ref objects)
22:50:25*claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com)
22:50:48sendelland i want to query it once, then work on it, and it's "safe" since i know i wont touch the map for the time i use it
22:51:01Araqsendell: use addr/unsafeAddr
22:51:11Araqto get a "view" on things
22:51:53sendell"let temp: ptr T" then?
22:52:04Araqand watch my video about "pointer free programming" that shows how you can model Rust-like "borrowed pointers"... err
22:52:29Araqthat's the type yeah, but usually you can let the compiler infer it
22:53:16sendellso in that case i guess using ptr (outside of C interfacing) is supposed idiomatic here?
22:53:30sendelli'll look at the video :)
22:53:32*PMunch quit (Quit: Leaving)
22:54:09Araqit doesn't come up often but it's also not sanctioned
22:54:30Araqit can cause problems with the JS backend though, but simple usages should be fine
22:55:12sendellwhy so?
22:56:09Araqbecause it's really hard to map to JS
22:56:22Araqthere might be bugs left :-)
22:56:30sendelli was supposing that ref & ptr were kind of the same thing on js target but never really looked at the generated code until then
22:56:32sendellhehe ok
22:56:44Araqthey are not
22:56:51sendelluntil now*
22:56:58Araqref object is mapped to idiomatic JS
22:57:02sendellyeah
22:57:08Araqptr is mapped to an (owner, index) pair
22:57:09sendellwat about values?
22:57:31Araqvalues are mapped to JS objects and copied around
22:58:02sendellok as I expected more or less :)
22:58:30sendelland i guess argument and return values are optimized as for C
22:58:49sendelli mean avoiding copies when not necessary
22:59:40Araqyes, argument passing is either const& T or T in C++ speak
22:59:59Araqdepending on the size of T and whether its a blob or not
23:01:25*elrood quit (Quit: Leaving)
23:02:53*nsf quit (Quit: WeeChat 1.9.1)
23:04:28sendellperfect as it's what you end up doing by hand 99% of the time in C++. I found your blog post about "pointer free programming" but no video
23:18:45FromGitter<nitely> `nim doc2 --help` shows `nim --help` is this a bug?
23:20:04*MJCaley joined #nim
23:20:44Araqno. :-)
23:21:12FromGitter<nitely> mmh then how do I see doc2 params?
23:21:53Araqhttps://nim-lang.org/docs/docgen.html
23:24:32FromGitter<nitely> friction
23:24:45Araqbuzzwords
23:25:11FromGitter<nitely> context switching
23:25:19FromGitter<nitely> moar buzzwords
23:26:00FromGitter<nitely> seriously, I knew about the docs, but I wanted to check from command line
23:26:19FromGitter<nitely> but if works as intended then ok
23:28:36*sendell quit (Remote host closed the connection)
23:29:29*sendell joined #nim
23:32:40*sendell quit (Remote host closed the connection)
23:35:24*MJCaley quit (Quit: MJCaley)
23:36:35*astronav_ joined #nim
23:39:15*astronav_ quit (Remote host closed the connection)
23:46:17*rbrt quit (Quit: Oíche mhaith)
23:50:50*MJCaley joined #nim