<< 20-05-2018 >>

00:00:13FromDiscord<awr> as far as i'm aware
00:03:50*rockcavera quit (Remote host closed the connection)
00:04:05*Sentreen quit (Ping timeout: 240 seconds)
00:05:04FromGitter<data-man> Some useful links :) ⏎ https://github.com/MicrosoftDocs/winrt-apihttps://github.com/Microsoft/cppwinrt
00:06:12FromDiscord<awr> there may be some overlap with win32 but a lot of the stuff is removed
00:08:49FromDiscord<awr> like, for example, i don't think you can use VirtualAlloc() anymore in WinRT, but instead its like VirtualAllocFromApp()
00:09:57*arecaceae quit (Remote host closed the connection)
00:10:21*arecaceae joined #nim
00:10:41FromDiscord<awr> there's lots of weird other things too
00:11:26FromDiscord<awr> e.g. i don't think you can do arbitrary file I/O anywhere unless its user-mediated with a dialog thing that WinRT provides
00:15:05FromGitter<data-man> sqlite3.c have a lot a stuff related to WinRT
00:17:27*Sentreen joined #nim
00:28:54PMunchWhat does --opt:none do?
00:39:14FromGitter<data-man> @PMunch: After checking projectName.json I assume, that default gcc's options. But I can be wrong. :)
00:40:33*smt` quit (Ping timeout: 248 seconds)
00:41:15PMunchHmm, okay
00:41:25PMunchAnd --opt:speed is -O3 or something like that?
00:42:59FromGitter<data-man> -O3 -fno-strict-aliasing for me
00:45:04PMunchRight
01:00:25FromGitter<data-man> @PMunch: Try experimenting with ```-Ofast``` and ```-faggressive-loop-optimizations``` ⏎ https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Optimize-Options.html
01:15:58PMunchWhat is gc:regions?
01:17:47FromGitter<data-man> When is defined then uses https://github.com/nim-lang/Nim/blob/devel/lib/system/gc_regions.nim
01:19:10FromGitter<Varriount> Araq: Ah, thanks for the heads up.
01:19:42FromGitter<Varriount> Do you have any other comments on that code?
01:20:49FromGitter<data-man> @Varriount: Which code? I want to see. :)
01:21:09PMunchHmm, it uses a lot of memory..
01:23:16FromGitter<Varriount> @data-man https://gist.github.com/Varriount/edfaf064fa17658f2d88c1d740a7070b
01:23:47FromGitter<Varriount> @data-man it's the http query generation code for the AWS API
01:23:56FromGitter<data-man> Thanks!
01:24:15*endragor joined #nim
01:24:39FromGitter<Varriount> The most nowhere noteworthy thing about it is that it uses toOpenArray extensively to avoid string copying
01:26:25FromGitter<Varriount> Also, rather than using sequence's of strings, it uses single, concatenated strings and sequences of objects
01:30:25FromGitter<data-man> You can get cmp from memfiles `==`
01:35:26Araqhttps://github.com/Araq/packedjson btw help me with my awesome project
01:39:28FromGitter<data-man> @Araq what you need?
01:40:00Araqthe []= accessor for objects needs to be implemented
01:40:11Araqand testing, testing, testing and then more testing
01:40:36*FuntDobra joined #nim
01:40:52FromGitter<data-man> It isn't important thing for me :)
01:41:45FromGitter<data-man> But thanks for varint! I have many optimizations. :)
01:46:49FromGitter<data-man> Sadly, that current json don't passed all tests from JSONTestSuite :(
01:51:07*endragor quit (Remote host closed the connection)
01:51:10*ARCADIVS joined #nim
02:05:34*gangstacat quit (Remote host closed the connection)
02:09:47*gangstacat joined #nim
02:16:47*PMunch quit (Quit: leaving)
02:26:09*FuntDobra quit (Ping timeout: 248 seconds)
02:41:30FromGitter<data-man> Steps for reproduce: ⏎ ```git clone --depth 1 git://github.com/nst/JSONTestSuite.git``` ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/nim-lang/Nim?at=5b00e05ae1cf621dba328bef]
03:21:18FromDiscord<emekoi> is it a bug that Nim can't store procs that take or return type classes?
03:21:45FromDiscord<emekoi> is it a bug that Nim can't store procs that take or return type classes in arrays or seqs?
03:22:35FromGitter<data-man> Some code?
03:27:25FromDiscord<emekoi> the code
03:27:53FromDiscord<emekoi> ```
03:27:53FromDiscord<emekoi> type
03:27:53FromDiscord<emekoi> Indicator = proc(): int | uint
03:27:53FromDiscord<emekoi>
03:27:53FromDiscord<emekoi> var
03:27:53FromDiscord<emekoi> indicators = newSeq[Indicator]()
03:27:54FromDiscord<emekoi> ```
03:28:03FromDiscord<emekoi> gives this error
03:28:12FromDiscord<emekoi> ```
03:28:12FromDiscord<emekoi> Hint: system [Processing]
03:28:13FromDiscord<emekoi> Hint: debug [Processing]
03:28:13FromDiscord<emekoi> Error: internal error: mapType
03:28:13FromDiscord<emekoi> No stack traceback available
03:28:13FromDiscord<emekoi> To create a stacktrace, rerun compilation with ./koch temp c <file>
03:28:14FromDiscord<emekoi> ```
03:31:04*skrylar quit (Remote host closed the connection)
03:31:22*skrylar joined #nim
03:32:04FromGitter<data-man> Works for ```Indicator = proc(): int```
03:32:06*rauss quit (Quit: WeeChat 2.1)
03:33:07FromDiscord<emekoi> and
03:33:07FromDiscord<emekoi> ```
03:33:07FromDiscord<emekoi> type
03:33:07FromDiscord<emekoi> Indicator = proc(arr: SomeNumber)
03:33:07FromDiscord<emekoi>
03:33:07FromDiscord<emekoi> var
03:33:08FromDiscord<emekoi> indicators = newSeq[Indicator]()
03:33:09FromDiscord<emekoi> ```
03:33:11FromDiscord<emekoi> gives this error
03:33:11FromDiscord<emekoi> ```
03:33:13FromDiscord<emekoi> test.nim(12, 33) Error: expression 'newSeq(Natural(0))' has no type (or is ambiguous)
03:33:14FromDiscord<emekoi> ```
03:33:30*rauss joined #nim
03:35:14FromGitter<data-man> It's correct. Key words are ```is ambiguous```
03:36:25FromDiscord<emekoi> so in order to store a proc in a seq or array it's arguments and return values must be concrete types?
03:36:45FromGitter<data-man> Yes.
03:38:46FromGitter<data-man> Not only for proc. For any non concrete type.
03:40:09FromDiscord<emekoi> okay
03:41:28FromGitter<data-man> Try to use object variant with proc fields.
03:47:47FromDiscord<emekoi> well thats not a problem anymore because i had my types switched around so a different type of proc was supposed to be stored in a seq.
03:48:38FromGitter<data-man> Good. :)
03:49:14FromGitter<arnetheduck> playing around with a nim result type, feel free to comment: https://github.com/arnetheduck/nim-result/pull/1
03:52:13leorizearnetheduck: you might want to use the `unittest` module for testing
03:52:54FromGitter<data-man> Yes, it's out of the box :)
03:55:13FromGitter<arnetheduck> @leorize, I'm kind of more hoping for comments on the result type itself (implementation, tricks, api, etc) :)
03:56:31FromGitter<data-man> "Jives well" -> "Lives well" ?
03:58:18*xkapastel quit (Quit: Connection closed for inactivity)
03:59:33*FuntDobra joined #nim
04:07:25*arecaceae quit (Read error: Connection reset by peer)
04:07:37*skrylar quit (Remote host closed the connection)
04:07:49*arecaceae joined #nim
04:18:12FromGitter<arnetheduck> hm, should be `jibes`, though can also be `jives` sometimes
04:18:37leorizearnetheduck: why aren't there any API to unwrap a result without checking for errors?
04:19:00*xkapastel joined #nim
04:21:39*FuntDobra quit (Ping timeout: 260 seconds)
04:23:26FromDiscord<citycide> I haven't been able to make a small repro yet - I've got an `iterator` that I then have a `proc`/`accumulateResult` wrapper around. when I then use `sequtils.mapIt` on the resulting `seq`, an echo for example within the iterator will run twice
04:23:32FromDiscord<citycide> normal `map` seems fine
04:23:58leorizecitycide: are you using devel?
04:24:09FromDiscord<citycide> also the type on hover of my `accumulateResult` proc is `Error Type` which is strange
04:24:35FromDiscord<citycide> 0.18 actually - is this a fix in devel?
04:26:41leorizeIIRC there were some fixes for sequtils in devel, so you might want to try using it
04:27:31FromGitter<data-man> @citycide: https://github.com/nim-lang/Nim/issues/7187 ?
04:33:12FromDiscord<citycide> @data-man seems relevant at least, especially when following that to https://github.com/nim-lang/Nim/pull/7513
04:33:32FromDiscord<citycide> I'll try devel
04:41:26FromGitter<data-man> Also try https://github.com/alehander42/zero-functional
04:44:18FromDiscord<citycide> still happens on devel actually
04:44:28FromDiscord<citycide> I'm assuming it's the same underlying problem
04:46:27FromDiscord<citycide> actually scratch that I think it may be solved on devel, I forgot to switch back to `mapIt` before testing
04:47:03FromGitter<data-man> @skilchen's fix isn't solve this problem?
04:48:40*yglukhov joined #nim
04:49:06FromDiscord<citycide> @data-man pretty sure his/her PR #7513 did fix it
04:50:00FromGitter<data-man> No, from his comment in #7187
04:50:38FromDiscord<citycide> @data-man oh, I don't know I'm not affected by that one currently
04:51:56FromDiscord<citycide> how about this type hint? `t.resultList: Error Type`
04:52:51FromGitter<data-man> More code, please. :)
04:53:05*yglukhov quit (Ping timeout: 256 seconds)
04:56:47FromDiscord<citycide> I'll be putting the whole repo up soon so will do more about that then 😄
04:57:05FromGitter<data-man> Ok.
04:58:59FromGitter<data-man> And thanks for fugitive! :)
05:07:25*cavariux quit (Quit: WeeChat 2.1)
05:17:36FromDiscord<citycide> @data-man ah for sure haha. surprised it gets used by someone else 😆
05:20:47FromGitter<data-man> I prefer pure Nim tools! :)
05:45:49*miran joined #nim
05:46:51*nolanv joined #nim
05:46:56FromGitter<kayabaNerve> ```type myType* = ref object of RootObj ⏎ start: uint32 ⏎ end: string``` ⏎ ⏎ Error: cannot instantiate DoublyLinkedList ⏎ got: <void> ⏎ but expected: <T> ... [https://gitter.im/nim-lang/Nim?at=5b010bd052194a4a67fbf91c]
05:47:18FromGitter<kayabaNerve> I did try making the members of myType public in case it just thought it was an empty type
05:47:26FromGitter<kayabaNerve> I did triple check my spelling
05:49:27FromGitter<kayabaNerve> (thanks in advance; ```myVar:``` is part of a type, that's why I didn't put var in front of it )
05:54:40leorizekayabaNerve: `end` is a keyword, you have to escape it
06:12:42*dddddd quit (Remote host closed the connection)
06:19:32FromGitter<arnetheduck> @leorize, you have the `[]` operator to unwrap
06:20:52leorizearnetheduck: oh, I missed that somehow :P
06:20:53FromGitter<arnetheduck> or you can just access `value` which is the same as "unwrap" with no error checking whatsoever (well, in nim, you'll get a `FieldError` or some such)
06:23:04leorizeI kind of hope that the `[]` operator would convert error into a string then raise it.
06:24:27FromGitter<arnetheduck> the idea was that it would raise the error with a `ResultError` and give the actual error value in the exception object (could do string as well I guess), but compiler is broken :)
06:25:20FromGitter<arnetheduck> also, if you're using `Result` to capture an existing exception, it will simply reraise that, which probably makes sense (like future)
06:26:31FromGitter<data-man> @arnetheduck: Awesome!
06:28:18*xkapastel quit (Quit: Connection closed for inactivity)
06:43:17FromGitter<xmonader> Do you guys know of any logic engine written in nim?
06:47:46*leorize quit (Quit: WeeChat 2.1)
06:55:19*nsf joined #nim
07:07:26*CodeVance joined #nim
07:12:34FromGitter<data-man> @xmonader: Which logic? Fuzzy?
07:22:44FromGitter<xmonader> @data-man like prolog or datalog languages implemented as DSLs
07:24:15*miran quit (Quit: Konversation terminated!)
07:29:45FromGitter<data-man> Rule-based logic engine, right? ⏎ I don't know prolog. But for Nim such package not exist, I'm sure. :) ⏎ If you know Ruby, try port it's library.
07:35:51FromGitter<xmonader> yeah i'd like to do some experiments with a logic engine in nim specially nim is really good in dsls
07:39:55FromGitter<data-man> https://github.com/search?q=logic+engine&type=Repositories ⏎ 392 available repository for now :)
07:42:14*xet7 joined #nim
07:43:10*yglukhov joined #nim
07:43:36FromGitter<kayabaNerve> leorize: The actual fields are start and difficulty
07:43:55FromGitter<kayabaNerve> I renamed it to end because it was the first thing I thought of. Didn't realize it would affect the diagnosis. Sorry
07:46:20FromGitter<kayabaNerve> Difficulty.nim ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b0127cb8c24fe61eafc39ce]
07:47:35FromGitter<kayabaNerve> Oh. I misread it. That line works fine. It's the blocks line that doesn't work fine.
07:47:47FromGitter<kayabaNerve> Error: cannot instantiate DoublyLinkedList ⏎ got: <void> ⏎ but expected: <T>
07:48:16FromGitter<kayabaNerve> The Block type is also imported and is ⏎ `type Block* = ref object of RootObj ⏎ ⏎ ```nonce*: uint32 ⏎ time*: uint32 ⏎ miner*: string ⏎ proof*: string ⏎ hash*: string```` [https://gitter.im/nim-lang/Nim?at=5b0128401cfca775e1225c52]
07:48:46FromGitter<kayabaNerve> And it may be the difficulty line but the compiler's line number is blocks (no idea if it's carrying over)
07:49:35*jaco60 joined #nim
07:52:35FromGitter<kayabaNerve> Found the issue. The files had the same name...
07:53:07*rockcavera joined #nim
07:54:30*yglukhov quit (Remote host closed the connection)
07:55:32*yglukhov joined #nim
07:56:51FromGitter<xmonader> I did that course before http://composingprograms.com/pages/45-unification.html
07:57:53FromGitter<data-man> @kayabaNerve: So, now all works?
07:59:11FromGitter<kayabaNerve> Yep
08:00:05*yglukhov quit (Ping timeout: 256 seconds)
08:03:54*gmpreussner_ quit (Ping timeout: 260 seconds)
08:05:14*gmpreussner joined #nim
08:07:39FromGitter<mratsim> @kayabaNerve yes using proc with the same name as files might give you strange errors because Nim supports (?) higher-order modules
08:08:05FromGitter<mratsim> also if you ever want to use nim reserved keyword like block you can use backtick like here: https://github.com/status-im/nimbus/issues/13
08:10:20*FuntDobra joined #nim
08:14:16FromGitter<kayabaNerve> Thanks
08:27:58FromGitter<kayabaNerve> So if I have a ref object (type myTypeRef = ref myType), and want to pass it to a function, I create the ref object by calling new(myVar) (if myVar is of type myTypeRef), right? ⏎ ⏎ Because that's what I'm doing but I'm getting illegal storage access errors.
08:32:27FromGitter<mratsim> yes
08:32:45FromGitter<mratsim> or (ref myType)(field1: foo, field2: bar)
08:33:35FromGitter<mratsim> short example: https://github.com/mratsim/golem-prime/blob/master/src/core/c_boardstate.nim#L70-L72
08:35:18FromGitter<kayabaNerve> @mratsim ⏎ ⏎ ```new(result) ⏎ result.creation = getTime()``` ⏎ ⏎ SIGSEGV: Illegal storage access. (Attempt to read from nil?) [https://gitter.im/nim-lang/Nim?at=5b01334641f54f22e2436939]
08:35:49FromGitter<mratsim> BlockchainObj should be “object of RootObj"
08:35:58FromGitter<mratsim> you have double ref indirection here
08:36:07FromGitter<mratsim> Blickchain is ref ref object of RootObj
08:36:33FromGitter<kayabaNerve> Got it
08:36:44FromGitter<kayabaNerve> Do I need to use 2 objects?
08:36:45FromGitter<mratsim> or you can just use `Blockchain = ref object of RootObj`
08:36:49FromGitter<kayabaNerve> Got it
08:37:08FromGitter<kayabaNerve> That wouldn't work though with ⏎ (blockchain: ref Blockchain) though
08:37:30FromGitter<mratsim> Here is an example where I use 2 objects, but that’s because I use both ptr FooObj and ref FooObj: https://github.com/mratsim/Arraymancer/blob/master/src/autograd/ag_data_structure.nim#L20-L40
08:37:41FromGitter<mratsim> (blockchain: Blockchain)
08:37:48FromGitter<mratsim> no problem ;)
08:38:10FromGitter<kayabaNerve> So I was trying to edit the variable passed
08:38:19FromGitter<kayabaNerve> And thought I was smart by looking it up and using ref
08:38:20FromGitter<ephja> T(...) where T is a 'ref' will call 'new' implicitly
08:38:23FromGitter<mratsim> it will work fine
08:38:24FromGitter<kayabaNerve> But it was ok all along?
08:38:25FromGitter<kayabaNerve> Yep
08:40:00FromGitter<mratsim> basically for stack/seq/string objects: ⏎ ⏎ 1) want to mutate the value: pass as var ⏎ for ref/ptr objects: ⏎ 2) want to mutate the content: pass normally ... [https://gitter.im/nim-lang/Nim?at=5b01345fb84be71db91f2564]
08:46:06*SenasOzys joined #nim
09:01:51*rauss quit (Read error: Connection reset by peer)
09:03:45*rauss joined #nim
09:05:17FromGitter<tim-st> shouldnt `sequtils` have the same standard procs like string, e.g. `find(a, b)` and `contains(a, b)`
09:09:12FromGitter<ephja> the implementations in the system module works for sequences though
09:09:38FromGitter<tim-st> really?
09:09:55FromGitter<tim-st> tried it with custom type and didnt
09:11:26FromGitter<tim-st> nope doesnt work for std types:
09:11:27FromGitter<tim-st> var a = @[1,2,3] ⏎ var b = @[1,2,3,4] ⏎ echo a in b
09:12:35FromGitter<tim-st> here is my approach, but maybe it matches to many generics: https://pastebin.com/ZCZEZHB0
09:12:59FromGitter<ephja> oh right, the openarray overload is for individual elements only
09:13:58FromGitter<tim-st> I think this should be changed, I didnt expected to have to write this procs for seq
09:16:04*eldiz joined #nim
09:16:53FromGitter<tim-st> my guess was, that strutils and sequtils can share nearly all procs e.g. `startsWith`, `endsWith` and even `editDistance`
09:18:04FromGitter<tim-st> or atleast the std procs that are semantically not bound to text
09:36:28*yglukhov joined #nim
09:46:49*yglukhov quit (Remote host closed the connection)
09:48:50*eldiz quit (Quit: Leaving)
09:52:07*yglukhov joined #nim
09:53:13*FuntDobra quit (Ping timeout: 256 seconds)
09:57:19*CodeVance quit (Read error: Connection reset by peer)
09:59:04*CodeVance joined #nim
10:02:10*PMunch joined #nim
10:14:42PMunchHmm, when creating a template that creates procedures Nim adds a bunch of numbers to each argument name
10:15:44PMunchSo for example "proc name*(table: TomlTableRef, address: string): t" get's turned into "proc getInt(table228426: TomlTableRef; address228428: string): int64". Note that `name` and `t` comes from the template
10:17:04PMunchIs there a way to avoid this?
10:19:37*nsf quit (Quit: WeeChat 2.1)
10:28:11*Vladar joined #nim
10:38:50*Trustable joined #nim
10:42:24AraqPMunch: use a .dirty template
10:43:53PMunchAh
11:04:04*yglukhov quit (Remote host closed the connection)
11:05:35*yglukhov joined #nim
11:08:47cremWhere should I put that {. gcsafe .} to silence that warning?
11:09:17cremNo way to silence it if in library it's not gcsafe?..
11:10:23cremPMunch: Are you author of parsetoml?
11:10:42cremI forgot who was the author..
11:10:50PMunchCurrent maintainer I guess
11:10:58PMunchAuthor is no longer using Nim
11:11:13PMunchHe changed the authorship to an organization called NimParsers
11:11:55cremThere is this: https://github.com/nim-lang/Nim/issues/7847 :)
11:14:29PMunchHmm
11:20:00dom96crem: I wouldn't worry about this warning
11:20:15dom96are you even using threads?
11:20:24FromGitter<kayabaNerve> @mratsim I have something you might like
11:21:10FromGitter<kayabaNerve> https://github.com/kayabaNerve/Currency/blob/master/lib/Binary.nim
11:21:13PMunchHmm, just running the parsetoml file with verbosity 2 it complains on line 413: "let newValue = parseValue(state)"
11:21:32FromGitter<kayabaNerve> I'm submitting a Linux kernel patch to replace GMP with that. I plan on it being accepted instantly /s
11:22:19PMunchNo idea why that's GC-unsafe though
11:22:43cremOk, my 10 lines of code do sigsegv... What was it again?.. Do I have to do new() for strings?
11:22:52cremDon't remember..
11:23:20cremAh no, it's inside parsetoml..
11:23:28FromGitter<kayabaNerve> (if you couldn't tell, it's a Native Nim unlimited precision Binary UInt class)
11:23:36PMunchIt seems that every passing of state is declared not GC-safe..
11:23:49PMunchcrem, code?
11:24:01cremIt does sigsegv when I do parseFile() for non-existing file.
11:24:07cremI expected it to throw exception...
11:24:24cremOr, maybe another toml library then.
11:25:02PMunchAh, yeah it creates a nil stream
11:25:05PMunchI'll fix it
11:25:21PMunchI didn't write the original, only updated it to v0.4.0 of the TOML specification
11:27:31cremOther toml libs don't write.. Ok, so have to check if file exists then.
11:28:44*yglukhov quit (Remote host closed the connection)
11:28:49PMunchYou should do that anyways :P
11:30:53cremI relied on library to do that for me. Because between my check and library opens the file, file can be gone.
11:32:49PMunchI have added a check there now
11:32:54PMunchNot pushed yet
11:33:02PMunchStill trying to figure out this GC thing..
11:33:56cremWhat's idiomatic way to check if string is empty? Is there something else that if mystr != "" ?
11:35:11crem..every half a year I decide to write something in nim and ask the same noob questions.
11:35:40FromGitter<tim-st> If you want to know if string is not nil and string.len == 0; I think there was a proc that checks len == 0 without checking if string is nil
11:37:31PMunchnot myStr.isNil and myStr.len == 0
11:37:39FromGitter<tim-st> its called `mystr.xlen == 0`
11:37:46FromGitter<tim-st> xlen tests without checking nil
11:37:52dom96myStr.len != 0 is enough
11:37:56dom96.len return 0 on nil
11:37:58FromGitter<mratsim> @kayabaNerve Aha, good luck with that. To properly model currencies I’ve started to use Mpdecimal: https://github.com/status-im/nim-decimal
11:38:00PMunchAh, cool
11:38:26cremWow, pretty verbose. :)
11:38:34FromGitter<tim-st> @dom96 it seems he wanted to know the dfference between "" and nil thats not seen with only checking len == 0
11:38:51FromGitter<mratsim> Ideally currencies will be added as a distinct type, and there will be a converter that can be plugged to Bloomberg, so that adding USD and EUR is either an compile-time error or a proper conversion.
11:39:23dom96crem: How does the language you're familiar with handle this?
11:40:10FromGitter<tim-st> @mratsim ideally the complete http://cldr.unicode.org/ will be added
11:40:22PMunchHmm, I really can't figure out this GC error thing..
11:40:50FromGitter<mratsim> @tim-st my last sentence was for @kayabaNerve not you ;)
11:41:22cremEmpty strings? In C++ it's mystr.empty(), in python it's "if mystr:", in javascript it's "if (mystr)", in perl it's if ($mystr).. What else.. In bash it's if [[ -n "$x" ]]
11:41:24FromGitter<tim-st> ok^^, I thought it was a general guess
11:42:11FromGitter<tim-st> `str.len == 0` is safe and the same as pythons if str:...
11:42:27cremEven in C it's if (*str) :)
11:43:30PMunchWhat's wrong with myString.len == 0?
11:44:46cremNext question: how to exit process? There are some "exitnow" in posix, and terminateProcess for winlean, but is there something that will work both in windows and posix systems?
11:45:08cremAh!, it's quit, not exit.
11:48:11dom96crem: and all of those I consider implicit and therefore risky :)
11:48:28dom96If you want risk just add: converter toBool(x: string): bool = x.len == 0 :P
11:49:25cremOk, I'm not complaining, just wanted to check if I write something non-idiomatic.
11:50:04cremPMunch: How can I write toml file? http://parsetoml.readthedocs.io/en/latest/introduction.html <- I could find nothing about writing there.
11:50:17PMunchYeah those docs are old..
11:50:29*CodeVance quit (Read error: Connection reset by peer)
11:50:44PMunchtoTomlString
11:51:21cremIs there toTomlFile?
11:52:34cremHm.. Is there writeStringToFile?..
11:53:00PMunchwriteFile("filename.toml", tomlData)
11:53:07cremThanks!
11:53:12PMunchhttps://peterme.net/handling-files-in-nim.html
11:53:12*CodeVance joined #nim
11:53:37PMunchSo for you it would be writeFile("output.toml", tomlData.toTomlString)
11:56:21cremHow can I modify it?.. Is there setString() similar to getString()?
11:56:54*CodeVance quit (Read error: Connection reset by peer)
12:00:26cremhm.. maybe yaml is a better choice.
12:01:36*dddddd joined #nim
12:01:54dom96I'd suggest JSON
12:03:05cremIt's a bit less human-friendly. With forbidden trailing commas and having to balance parentheses.
12:03:08PMunchcrem, modify the TOML?
12:03:50cremI need that tool urgently, till tomorrow evening. And that makes me think that I should probably just fall back to C++.
12:05:16cremIt's taking more than a day for me for "Read username from config. If it's not there, ask and save to a config".
12:05:30cremAt this rate I'm not going to finish on time.
12:06:52PMunchvar b = table.getValueFromFullAddr("input.flags"); b.boolVal = false
12:06:57PMunchThat's how you can set a value
12:07:48cremhttps://nimyaml.org/ yaml seems to be cleaner. Will try to do it for another hour or so, then decide.
12:10:58PMunchOkay, just pushed a new version of parsetoml
12:11:12PMunchIt adds a nil check and fixes a little bug I found in toTomlString
12:11:15*yglukhov joined #nim
12:11:27PMunchI'll add some setter procs now
12:15:43cremyaml doesn't work too, it seems. Or at least error message says nothing how to fix it. https://gist.github.com/mooskagh/95aa30f924528240f3b3839f26a25ccf
12:15:47cremOk, json then.
12:15:53cremARRRR
12:16:10cremThat's frustrating. Nothing works. :)
12:16:48cremI thought if it has own website, it should work..
12:23:37*nsf joined #nim
12:23:51ddddddmaybe just keep it simple. Store the username in its own file, crem
12:24:17PMunchcrem, what do you mean JSON doesn't work?
12:24:20cremIt's not just username, it's config. But I start with username.
12:24:31cremyaml doesn't work, not json
12:24:32dddddda file per config, then
12:24:47cremtrying json.
12:26:18PMunchJSON is a safe bet
12:26:26PMunchTrying to add what you need to TOML as we speak
12:28:26cremjson module can unmarshal but cannot marshal?..
12:29:58PMunchWhat do you mean?
12:30:17cremthere is nice to() macro, but no from() macro.
12:31:11PMunchWhy would you need that?
12:31:20PMunchJust work on the JSON object
12:31:30dom96from = %
12:31:37PMunchI implemented a whole database that way :)
12:31:55dom96https://nim-lang.org/docs/json.html#creating-json
12:32:16crem%* is cryptic. :)
12:32:20cremOk, trying, thanks.
12:36:03cremIt worked! Magically. :)
12:37:30PMunchYeah, JSON in great
12:49:17FromGitter<kayabaNerve> @mratsim Why use decimals at all? Just use UInts. Decimals should only be a UX thing.
12:49:59FromGitter<kayabaNerve> And it's not really a good luck thing as more than a completed code thing (the binary file) :P I tested it out. It works.
12:50:04*CodeVance joined #nim
12:50:09FromGitter<kayabaNerve> I do have yet to do conversions/reversions though. Adding that next
12:50:10FromGitter<mratsim> mpdecimal has everythin, is the default since Python 3.4 and is fast.
12:50:13FromGitter<kayabaNerve> And no idea on the speed
12:50:25FromGitter<kayabaNerve> Will that work on Nim stable? :P
12:50:40FromGitter<mratsim> yes, but the current wrapper is super low-level
12:51:12FromGitter<kayabaNerve> I'll stick with my own code unless it slows down with priv keys/addresses
12:51:48FromGitter<mratsim> usually that’s the best thing to do I think.
12:51:59FromGitter<kayabaNerve> I'm actually quite proud of it
12:52:24FromGitter<kayabaNerve> I got the conversion/reversion algos off the internet but I did binary addition/subtraction myself, with the first try for subtraction
12:52:33FromGitter<kayabaNerve> Of course, that means it's probably slow as hell
12:53:59FromGitter<kayabaNerve> I'm just using a string and methods for it... probably should update it
12:54:22FromGitter<kayabaNerve> 32 8 bit ints...
13:00:02*FuntDobra joined #nim
13:19:22*FuntDobra quit (Ping timeout: 256 seconds)
13:37:25*yglukhov quit (Remote host closed the connection)
13:41:10euantorThe Nix package for Nim is finally up to date! https://github.com/NixOS/nixpkgs/pull/40556 - should be easier to update in the future too, hopefully
13:41:55*smt joined #nim
13:47:43*dkncgtik6mr0 joined #nim
13:51:48PMunchcrem, new version of parsetoml. It now has `add` and `set` procs so you can update fields in your table :)
13:57:03dom96euantor: Nice, but why run the tests?
14:01:25*gokr joined #nim
14:02:13euantordom96: it appears to be the convention. They already had a package for 0.17.2 which ran the tests in the check phase, now it targets 0.18.0 and most of the tests actually pass (except one on ARM doing float equality checks)
14:08:37Notkeaalso, running the tests enabled us to spot some problems :p
14:11:11euantorYep
14:15:21*FuntDobra joined #nim
14:28:03*FuntDobra quit (Ping timeout: 256 seconds)
14:38:21cremhttps://gist.github.com/mooskagh/e112a05a1fc37c67753a219edb4833d1 Why GcUnsafe warning this time?
14:39:20FromGitter<krux02> crem
14:39:37FromGitter<krux02> you use proc and method at the same time for Update
14:39:41FromGitter<krux02> why that
14:39:47FromGitter<krux02> maybe that is the reason
14:40:08cremproc Update is not for this hierarchy
14:40:42cremI've updated the code
14:40:56cremor order not to be confusing
14:40:59cremstill the same
14:41:56cremIt's worrying that for every seemingly basic question people start to guess. Makes me think that unless you developed that language, you don't really understand how to use it.
14:45:06FromGitter<krux02> Well I know how to use the subset of the langugae that I use
14:45:23FromGitter<krux02> but I try to stay away from weird awkward features that I don't fully understand
14:45:37FromGitter<krux02> and "method" is one of them
14:46:16FromGitter<krux02> OO hierarchies I do understand I just don't think they are useful
14:47:02FromGitter<krux02> or better said "very useful", there might be a few corner cases where it is actually the right fit
14:48:17cremhttps://nim-lang.org/docs/terminal.html#setCursorXPos,File,int setCursorXPos needs some File. Where to get it?
14:49:30FromGitter<krux02> stdin?
14:50:04cremwhy not stdout?
14:50:45FromGitter<krux02> well you said it, stout is probably the correct solution
14:51:04FromGitter<krux02> I just think it's weird
14:57:19cremWorks with stdout indeed. Thanks. (although it's weird). Still not clear wiat to do with GcUnsafe warning.
14:57:36*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
14:58:37cremHow can I call parent's method?
14:58:45FromGitter<stisa> crem: mark the method with `gcsafe` ?
14:59:00FromGitter<ephja> I compiled 32-bit and 64-bit libui dll's with vs 2015 and neither loads -.-
14:59:44cremWell, what does that do? How do I know if it's gcsafe or not gcsafe?
15:00:18cremIt's like compiler saying "Warning: your code is incorrect" unless you add {. correct .}
15:00:23FromGitter<ephja> the Dependencies app doesn't display any errors, and who knows if it should do that just like depends.exe does, which does not work well on newer windows versions
15:00:48PMunchHmm, any ideas for a `%` and consequently a `%*` operator for TOML?
15:01:02PMunchWhat operator suits it best
15:01:38FromGitter<stisa> crem: https://nim-lang.org/docs/manual.html#threads-gc-safety basically if it doesn't access globals it's safe
15:02:19FromGitter<ephja> NiGui doesn't work for me on windows 10. termbox is linux only. nimx should be fine though if you don't care much about the layout. js+dom takes care of that though
15:03:09PMunchephja, wxWidgets?
15:03:10cremSo do I have to add gcsafe to all functions?. It complains at almost all of them.
15:03:29FromGitter<kayabaNerve> @mratsim I made the base 10 equivalent
15:03:32cremThat's silly. I don't know what I'm doing.
15:03:39FromGitter<kayabaNerve> But I'm encountering an edge case bug on the subtract function
15:05:45FromGitter<kayabaNerve> https://github.com/kayabaNerve/Currency/blob/master/lib/UInt.nim#L67 10001 and 9999 returns 11, not 2. The test values of 10/8, 8/6, 10011/1000 all worked
15:06:21*FuntDobra joined #nim
15:09:46FromGitter<mratsim> it’s probably a borrow issue
15:10:38FromGitter<kayabaNerve> L67 is the edge case where the digit of b is bigger than the digit of a
15:10:53FromGitter<kayabaNerve> So yes, it's a carry issue :)
15:11:23dom96PMunch: The same one?
15:11:32*yglukhov joined #nim
15:11:40FromGitter<kayabaNerve> I'd appreciate any insights you have if you have a few seconds
15:11:43dom96crem: Honestly, just ignore this warning
15:12:02FromGitter<kayabaNerve> Same for anyone here, of course :P
15:12:13FromGitter<kayabaNerve> I'll be working on it on my own either way
15:12:13dom96Create your software instead of worrying about a warning that only shows up when the verbosity is 2
15:12:23cremBut nimlime keeps on throwing that warning to me.
15:12:36cremIn a popup!
15:12:48dom96wtf
15:12:49dom96Why
15:13:02FromGitter<mratsim> @kayabaNerve I’m swamped now, trying to get ahead in a data science competition. However I’m saw several char-based bigint decimal library, some related to Project Euler to solve the project euler problems
15:13:10dom96Maybe add --threadAnalysis:off to a nim.cfg file and it'll stop
15:13:12FromGitter<mratsim> I saw*
15:13:12FromGitter<kayabaNerve> I'll look them up
15:13:22dom96and ask Varriount to fix this
15:13:24dom96it's ridiculous
15:13:25cremYou just Ctrl+S to save file, and there is a popup with this warning. :)
15:13:32PMunchdom96, wouldn't that collide with things if you want to use both?
15:13:39FromGitter<kayabaNerve> Also, quick math. This is one bit per array entry. There are 2^32 possible array entries. That means, since there's 2^32 bits, the max value is 2^2^32. Right?
15:14:06FromGitter<mratsim> one byte per array no?
15:14:10dom96PMunch: Better yet, maybe you could map JsonNode to TOML?
15:14:20FromGitter<kayabaNerve> @mratsim Well. Thats for the Binary lib
15:14:33FromGitter<mratsim> you should pack them then
15:14:36FromGitter<kayabaNerve> For UInt, it's 10 possibilities or... 3.5 bits
15:14:50FromGitter<kayabaNerve> The point wasn
15:15:04FromGitter<kayabaNerve> It was checking its 2^2^32
15:15:05dom96PMunch: If we use different operators for each format we'll run out of operators very quickly
15:15:20dom96If someone needs to use both then they can write json.`%`.
15:15:52FromGitter<mratsim> Each array element takes 1 byte, if you have a 2^32 array that’s 2^32 bytes needed.
15:15:59FromGitter<kayabaNerve> Not the question
15:16:24FromGitter<kayabaNerve> The question is the max possible value if the there's 1 bit per array element and 2^32 possible entries
15:16:25FromGitter<mratsim> you want to now the max value you can represent?
15:16:28FromGitter<kayabaNerve> 2^2^32, right?
15:16:29FromGitter<kayabaNerve> Yes
15:16:50FromGitter<mratsim> 2^32 - 1
15:16:52NotkeaI have a question about constants and static blocks evaluation order: which is evaluated first?
15:17:05FromGitter<mratsim> @notkea order of appearance
15:17:08FromGitter<kayabaNerve> A 32 bit system with 32 bits represents that many
15:17:19Notkeathanks
15:17:24FromGitter<kayabaNerve> So that means, if one entry is one bit, that an array has a cap of 32 entries
15:17:27FromGitter<kayabaNerve> Unless my math is wrong
15:17:33FromGitter<kayabaNerve> *math/logic/understanding
15:17:40FromGitter<mratsim> you lost me :P
15:17:42FromGitter<kayabaNerve> I thought so too at first.
15:17:53FromGitter<kayabaNerve> 32 bits makes 2^32 max value
15:18:02FromGitter<mratsim> minus 1
15:18:02PMunchdom96, what do you mean "map"
15:18:19FromGitter<kayabaNerve> 1 bit per array entry, with 2^32 possible entries, makes the max value not 2^32, but 2^2^32-1
15:18:22FromGitter<kayabaNerve> Right?
15:18:29dom96PMunch: I mean provide a proc that converts a JsonNode to TOML
15:18:42*yglukhov quit (Remote host closed the connection)
15:18:52FromGitter<kayabaNerve> Dude. This is trippy. I also thought 2^32 and was pissed I made a complex uint32 until my friend pointed out it was 2^2^32
15:18:55FromGitter<kayabaNerve> (yes. -1.)
15:18:57FromGitter<mratsim> no, uint32, is 32 bits with value of 0 or 1. And the max uint32 is 2^32 - 1
15:19:04FromGitter<kayabaNerve> Yes
15:19:09FromGitter<kayabaNerve> So if you have 2^32 bits
15:19:14FromGitter<mratsim> ah
15:19:15FromGitter<kayabaNerve> The max value is 2^2^32
15:19:16FromGitter<mratsim> right
15:19:22FromGitter<kayabaNerve> And if you have 1 bit per entry
15:19:26FromGitter<kayabaNerve> And 2^32 entries
15:19:29PMunchdom96, that already exists :)
15:19:33FromGitter<kayabaNerve> Then yes, 2^2^32
15:19:37FromGitter<kayabaNerve> Yes?
15:19:40FromGitter<mratsim> yes
15:19:49FromGitter<kayabaNerve> Trippy math
15:19:57FromGitter<kayabaNerve> Not trying to teach you an answer. Actually checking
15:20:12FromGitter<kayabaNerve> Because it's a weird as hell equation
15:22:44*gokr quit (Ping timeout: 265 seconds)
15:23:22FromGitter<kayabaNerve> @mratsim Why can't math be easy
15:23:43FromGitter<kayabaNerve> a+b=c. Done. Solved the Bermuda Triangle. Instant TX cryptocurrency built. UDP/TCP combined for amazingness.
15:33:22FromGitter<krux02> @kayabaNerve why can't we all be super intelligent genies like they are shown in Hollywood movies, and can fill blackboards with formulas in just one fading scene
15:35:56FromGitter<kayabaNerve> @krux02 Turns out if everyone was a genius we wouldn't have anything to do and nobody would be special and we'd lose all sense of emotions and humanity
15:39:39*FuntDobra quit (Ping timeout: 265 seconds)
15:40:02*edcragg quit (Quit: ZNC - http://znc.in)
15:40:15*edcragg joined #nim
15:44:08*smt quit (Remote host closed the connection)
15:44:35*smt joined #nim
15:45:06FromGitter<mratsim> The worse thing in movies are the super resolution zooms I think :P
15:46:54cremIs there a shorthand for object initialization instead of assigning values to every field individually?
15:50:22cremAre ref object parameters mutable by default?
15:51:15PMunchcrem, yes and yes
15:51:26PMunchOr well, the data pointed to by the ref is mutable
15:51:29PMunchThe ref itself is not
15:51:45PMunchshorthand is just "SomeObject(hello: 100)"
15:54:32*PMunch quit (Quit: leaving)
15:56:31cremNo way to make them immutable?
15:56:41FromGitter<kayabaNerve> Don't make them public out of the file
15:56:49FromGitter<kayabaNerve> Make a constructor function and getters
15:57:27*yglukhov joined #nim
15:57:37FromGitter<kayabaNerve> Actual question: Did I help? If so, yay. If not, should I be quiet or try again/explain more.
16:14:53*jaco60 quit (Quit: Textual IRC Client: www.textualapp.com)
16:15:59*yglukhov quit (Remote host closed the connection)
16:22:11*Jipok[m] joined #nim
16:31:52*yglukhov joined #nim
16:38:49*yglukhov quit (Remote host closed the connection)
16:40:15*yglukhov joined #nim
16:40:17*yglukhov quit (Remote host closed the connection)
16:45:58*rockcavera quit (Remote host closed the connection)
16:49:15*FuntDobra joined #nim
17:00:24NotkeaI'm trying to use json {de,}serialisation macros with generics, but I obtain the following error: lib/pure/json.nim(814, 14) template/generic instantiation from here; lib/pure/json.nim(807, 42) Error: undeclared field: 'val'
17:00:32Notkeais this actually supported?
17:06:53dom96This happens because there is no `%` for Option[T]
17:07:13dom96There is a PR for it, you can steal that code and place it in your code base for now
17:12:13Notkeathanks
17:23:11*yglukhov joined #nim
17:27:27*yglukhov quit (Ping timeout: 240 seconds)
17:31:58*yglukhov joined #nim
17:33:33*yglukhov quit (Read error: Connection reset by peer)
17:34:09*yglukhov joined #nim
17:34:37*yglukhov quit (Client Quit)
17:39:42*yglukhov joined #nim
17:40:03NotkeaI'm having an issue with tuples of function that I don't understand: Error: type mismatch: got <tuple of (proc (event: Event): JsonNode{.noSideEffect, gcsafe, locks: 0.}, proc (jsonNode: JsonNode): Event{.noSideEffect, gcsafe, locks: 0.})> but expected 'EventSerialiser = tuple[serialiser: proc (event: Event): JsonNode{.closure.}, deserialiser: proc (jsonNode: JsonNode): Event{.closure.}]'
17:42:13*qwertfisch is now known as kugelfisch
17:44:00dom96Notkea: mark your proc with {.closure.}
17:45:01NotkeaI get: Error: '.closure' calling convention for top level routines is invalid
17:46:09dom96alternatively you can mark your type with {.nimcall.} I think
17:48:11Notkeait gives the first error again :/
17:51:10*yglukhov quit (Read error: Connection reset by peer)
17:51:50*yglukhov joined #nim
17:51:53dom96:/
17:51:58dom96gist?
17:55:26Notkeahttps://paste.gnugen.ch/raw/WFvp
17:56:45*FuntDobra quit (Ping timeout: 264 seconds)
17:58:53dom96serialiser: proc(event: Event): JsonNode {.nimcall.},
17:58:55dom96That's what I meant
17:58:59dom96Works for me
17:59:50*xkapastel joined #nim
18:00:10Notkeadoesn't for me, even after adding the annotation at line 30
18:00:14Notkea(I'm using 0.18.0)
18:01:07NotkeaI'll try with unstable
18:06:26*leorize joined #nim
18:08:15Notkeastill no luck O.O
18:09:50Notkeaoh I was adding it only to one of the functions
18:10:46Notkeaworks now, thanks!
18:12:04FromGitter<kayabaNerve> This is interesting. ⏎ ⏎ I have two uint32s. This if statement fails. ⏎ if firstUint > secondUint: [https://gitter.im/nim-lang/Nim?at=5b01ba731cfca775e123ed76]
18:12:16FromGitter<kayabaNerve> Sometimes it works. Sometimes it doesn't.
18:13:22FromGitter<Varriount> @kayabaNerve What do you mean by "sometimes"?
18:13:27FromGitter<kayabaNerve> Hash is too low: 1250173748 (secondUint) ⏎ Must be at least: 1145324612 (firstUint) ⏎ ⏎ Like with these. The second is obviously greater yet the if statement still triggers [https://gitter.im/nim-lang/Nim?at=5b01bac7b84be71db9209312]
18:14:12FromGitter<Varriount> Hm, can you look and see what the generated C code is doing?
18:14:13FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ 4 passes, no idea if valid, one that should pass, one that shouldn't. Pass = doesn't trigger the if statement [https://gitter.im/nim-lang/Nim?at=5b01baf5b84be71db920932f]
18:14:29FromGitter<kayabaNerve> Sure
18:14:37FromGitter<kayabaNerve> Been a while varriount
18:14:39FromGitter<kayabaNerve> How are you?
18:14:46FromGitter<Varriount> You can see what C lines correspond to Not loves using `--lineDir:on`
18:15:07FromGitter<Varriount> *Nim lines
18:15:29FromGitter<Varriount> I'm good. Currently trying to debug this AWS API code
18:15:58dom96Varriount: You should probably get rid of the --verbosity:2 in NimLime
18:16:08dom96especially if people get popups for those gc safety warnings :(
18:17:41FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b01bbc58c24fe61eafdd0b0]
18:17:49FromGitter<Varriount> @kayabaNerve What are you working on?
18:17:57FromGitter<kayabaNerve> A blockchain
18:18:13FromGitter<kayabaNerve> Sort of
18:18:42FromGitter<kayabaNerve> I'm building a PoW local blockchain. There's no TXs or networking.
18:18:54FromGitter<kayabaNerve> There is rotating difficulties.
18:18:55federico3a what?
18:19:08FromGitter<kayabaNerve> https://github.com/kayabaNerve/Currency/Reputation
18:19:29FromGitter<kayabaNerve> Proof of Work. Blocks are only added if they pass a mathematical question that verify work was done
18:19:51FromGitter<kayabaNerve> In this case, the question is if part of the hash is greater than the difficulty
18:19:58FromGitter<kayabaNerve> And currently, it's insecure as hell
18:20:03FromGitter<kayabaNerve> I'm just testing what I have
18:20:13FromGitter<kayabaNerve> 1) https://github.com/kayabaNerve/Currency/tree/master/Reputation
18:20:46FromGitter<kayabaNerve> It's only using the hash of the proof so if you find a valid proof, you can use it infinitely. I understand that. I'm working on it.
18:21:57FromGitter<kayabaNerve> @Varriount Any ideas?
18:22:40FromGitter<kayabaNerve> I can upload a larger C fragment if necessary. That just looks to be the proper section. Obfuscated as hell... (yet I'm sure a obfuscator would be way worse)
18:24:58Araqusing -d:release helps to clean up the C code fwiw
18:25:18FromGitter<kayabaNerve> Clean up for efficiency or readability?
18:25:24FromGitter<kayabaNerve> Or both?
18:25:26Araqreadability
18:25:37FromGitter<kayabaNerve> Thanks. That seems... backwards but I'll take it
18:25:37Araqwell efficiency is its primary goal
18:25:47Araqbut readability improves as a side effect
18:26:32FromGitter<kayabaNerve> Got it. Thanks for the tip
18:26:38FromGitter<kayabaNerve> Now it's: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5b01bdddb84be71db9209a17]
18:27:07FromGitter<kayabaNerve> Nope. I messed up, Didn't reload the file.
18:27:15FromGitter<kayabaNerve> Sorry
18:27:40*metaden92[m] quit (*.net *.split)
18:27:40*planetis[m] quit (*.net *.split)
18:27:40*libman[m] quit (*.net *.split)
18:27:40*endes[m] quit (*.net *.split)
18:27:40*TheManiac quit (*.net *.split)
18:27:40*stisa quit (*.net *.split)
18:27:41*skrzyp quit (*.net *.split)
18:27:41*craigger quit (*.net *.split)
18:27:41*cornfeedhobo quit (*.net *.split)
18:27:43*kugelfisch is now known as qwertfisch
18:27:49*craigger joined #nim
18:28:34FromGitter<kayabaNerve> It doesn't change at all. Even when I use -d:release and also -f
18:30:09*skrzyp joined #nim
18:31:29FromGitter<kayabaNerve> I also tried wrapping it into my... in progress String based number class, which goes digit by digit to compare (ASCII codes), and had similar results. I don't see any... truncation? Printing issues? Overflows? In the values though.
18:36:35Araq raise newException(IndexError, "key not in object")
18:36:35Araq # :-(
18:36:42Araqthat's a KeyError then...
18:37:10Araqalso, not sure this should raise at all...
18:38:38FromGitter<Varriount> dom96: I have a major improvement to NimLime in the works.
18:39:05FromGitter<Varriount> Araq: Is this for a table?
18:39:10dom96Varriount: great, but maybe you could make this quick fix?
18:39:44Araqvarriount, that's json.nim
18:40:07FromGitter<Varriount> dom96: https://github.com/Varriount/NimLime/blob/master/NimLime.sublime-settings#L167
18:40:22dom96crem ^
18:40:34*cornfeedhobo joined #nim
18:40:44*gokr joined #nim
18:41:05FromGitter<Varriount> I love it when I go to great lengths for configurability, and then no-one reads the actual settings. :/
18:41:16*stisa joined #nim
18:41:30Araqconfigurability is no substitute for good defaults
18:42:46*metaden92[m] joined #nim
18:42:46*planetis[m] joined #nim
18:42:46*endes[m] joined #nim
18:43:36*libman[m] joined #nim
18:43:58*rauss quit (*.net *.split)
18:43:58*m712 quit (*.net *.split)
18:43:58*crem quit (*.net *.split)
18:43:59*narimiran[m] quit (*.net *.split)
18:43:59*tersec quit (*.net *.split)
18:43:59*def- quit (*.net *.split)
18:43:59*ketralnis quit (*.net *.split)
18:44:05FromDiscord<citycide> Araq: sounds like a quote fit for the top of one of Nims docs pages 😉
18:44:08*m712 joined #nim
18:44:13*def- joined #nim
18:44:16*rauss joined #nim
18:44:23FromGitter<Varriount> The default is needed to show hints. It just so happens that GC hints are included (but not wanted)
18:44:25*crem joined #nim
18:44:26FromGitter<kayabaNerve> How is Nim Atom while editors are up?
18:44:33*ketralnis joined #nim
18:44:44*tersec joined #nim
18:44:48FromGitter<kayabaNerve> I've only used Aporia for Nim but I've used Atom for the past 6 months or so and would like to stick with it
18:46:04FromGitter<Varriount> Meh, I'm sticking with Sublime Text, if only on the grounds that it's more efficient with my computer's resources and battery.
18:46:17FromDiscord<citycide> @kayabaNerve I haven't used anything else but vscode's is top notch
18:47:26FromGitter<kayabaNerve> I just hate VS :P
18:47:54FromGitter<kayabaNerve> Varriount: I got a Razer Blade just so I could run editors. browsers, and apps at once
18:47:58FromGitter<kayabaNerve> Not really an issue for me
18:48:15FromGitter<kayabaNerve> That said, it doesn't fix my bugs.... still looking over this if statement
18:48:23FromGitter<kayabaNerve> I can't tell if it's me, Nim, or C
18:48:48FromDiscord<citycide> @kayabaNerve not VS, VS Code. very different
18:48:59FromGitter<kayabaNerve> I hate every Visual Studio product
18:49:05FromGitter<kayabaNerve> Every product in the VS Suite
18:49:18FromDiscord<citycide> really wouldn't put VS code in that category at all but ok
18:49:23FromGitter<kayabaNerve> I have both on my laptop due to dependencies
18:49:30FromGitter<kayabaNerve> They both infuriate me
18:50:11*narimiran[m] joined #nim
18:50:25FromGitter<kayabaNerve> Also, what's the FromDiscord bit? Is there a Nim channel on a server or a Nim Discord?
18:51:24FromGitter<Varriount> @kayabaNerve Ah, I tried one of those. How's the battery life on that?
18:51:26FromGitter<ephja> wasn't there a flag to get more detailed dll loading errors?
18:51:50FromGitter<Varriount> I sent mine back and got a dell XPS, as the battery life wasn't what I needed.
18:52:03FromGitter<kayabaNerve> @Varriount Not going to lie, I use it as a Desktop most of the time. I just occasionally travel and didn't want to use the external GPU thingy
18:52:14FromGitter<Varriount> Ah, makes sense then.
18:52:26FromDiscord<citycide> @kayabaNerve there's a Discord, Gitter & irc and they're all bridged together
18:52:26FromGitter<kayabaNerve> I also don't see that big of a difference with the Stealth in size/weight. Sure it's moticeable but not if I'm moving around
18:52:38FromGitter<Varriount> @kayabaNerve Oh, you got the stealth?
18:52:42FromGitter<kayabaNerve> Can I lift it with 2 fingers? No. Can I put in a backpack without bending over? Yes
18:52:45FromGitter<kayabaNerve> No
18:52:48FromGitter<kayabaNerve> I got the regular
18:52:53FromGitter<Varriount> Ah, ok.
18:53:06FromGitter<kayabaNerve> I wanted the internal GPU. Stealth just has Intel Integrated
18:53:09FromGitter<kayabaNerve> GTX 1060 FTW
18:53:14FromGitter<Varriount> Yep. :D
18:53:17FromGitter<kayabaNerve> citycide: Link me?
18:53:31FromGitter<kayabaNerve> The 17" pro is ridiculous though
18:53:50FromDiscord<citycide> @kayabaNerve https://discord.gg/YUTdxG
18:53:50FromGitter<kayabaNerve> That's a desktop with a UPS and everything it needs built in (monitor, keyboard, mouse)
18:54:04*TheManiac joined #nim
18:54:05FromGitter<kayabaNerve> Same for all the MSI 18" dual power brick monstrosities
18:54:11FromGitter<Varriount> 17" laptops tend to be too heavy for me.
18:54:13FromGitter<kayabaNerve> Razer Blade is a nice mix of power and mobility
18:54:16FromGitter<kayabaNerve> Agreed
18:54:44FromDiscord<Kayaba> @citycide Thanks citycide
18:54:48FromDiscord<Kayaba> @citycide Thanks
18:54:58FromDiscord<citycide> 👍
18:54:58FromGitter<kayabaNerve> Edits count as a new message? Weird
18:55:29FromGitter<Varriount> @kayabaNerve `(NU32)(T9_) < (NU32)(T10_)` -> You're compiling on a 32 bit machine?
18:55:34FromGitter<kayabaNerve> I understand why. The discord.js lib has a hook for message(msg), and messageUpdate(oldMsg, newMsg)
18:55:49FromGitter<kayabaNerve> @Varriount Nope. 64 bit thick and through. All the software is too IIRC
18:55:55FromGitter<kayabaNerve> I just want 32 bit ints
18:56:07FromGitter<Varriount> And you're sure they aren't just wrapping around?
18:56:07FromGitter<kayabaNerve> I'm changing to a multiprecision setup soon
18:56:20FromGitter<kayabaNerve> For now my hack was uint32 though
18:56:25FromGitter<kayabaNerve> I'm converting a 8 digit hex string
18:56:30FromGitter<ephja> the libui examples work when generated with VS. I shouldn't have to compile with gcc for nim, right?
18:56:50FromGitter<Varriount> @kayabaNerve By the way, have you looked at the NimCrypto library?
18:57:20FromGitter<kayabaNerve> So I'm at the max value of a 32 bit int if I hit ffffffff
18:57:22FromGitter<kayabaNerve> And yes
18:57:28FromGitter<kayabaNerve> It didn't have what I wanted
18:57:45FromGitter<kayabaNerve> Well it did. It just also had a ton of stuff I didn't want, and I had better ways of getting access to what I wanted
18:58:21FromGitter<Varriount> Ah, just wanted to make sure. I'm using it's md5 and hashing stuff for this AWS library.
18:58:38FromDiscord<Kayaba> Isn't there a standard lib for md5?
18:58:43FromDiscord<Kayaba> And thanks for checking
18:58:56FromGitter<Varriount> I need SHA and MAC stuff
18:59:08FromDiscord<Kayaba> Got it
18:59:48FromDiscord<Kayaba> I used C for SHA512. It was my test dummy for loading c libs from Nim as I need a few
19:00:17FromDiscord<Kayaba> I also just liked the c code better. I found some unlicensed code with horrible formatting that I cleaned up. Just a couple hundred lines...
19:00:33FromDiscord<Kayaba> I think Nim SHA is 600. Maybe because it has multiple bit sizes?
19:00:48FromDiscord<Kayaba> Also, for the Nim behind this messed up if statement: https://github.com/kayabaNerve/Currency/blob/master/Reputation/Difficulty.nim
19:01:22FromDiscord<Kayaba> L19
19:02:13FromGitter<tim-st> is it possible to add `likely` to a specific case instead of if?
19:03:15FromGitter<tim-st> of should I replace the case by likely if and elif ?
19:15:32federico3any way to get an object type as a string e.g. $type(foo) ?
19:21:50FromGitter<mratsim> import typetraits foo.type.name?
19:26:02federico3oh, there's "name" - thanks mratsim
19:34:23FromDiscord<ZarsBranchkin> Also that library has `$` operator as alias for name, so `$type(foo)` with it imported would work as well
19:37:08FromDiscord<awr> wrt the laptop discussion I've heard a lot of praise about the XPS * series
19:42:09FromDiscord<awr> it's pretty cool that laptops now can have desktop-class graphics and not just something "a step behind"
19:42:27*smt` joined #nim
19:44:33*smt quit (Ping timeout: 248 seconds)
19:46:49*FuntDobra joined #nim
19:57:09*sherjilozair joined #nim
20:09:57*Zevv joined #nim
20:10:22ZevvHi - how do I await on more then one future in parallel?
20:11:43*sherjilozair left #nim ("Leaving...")
20:15:28FromGitter<krux02> awr: laptops will never have the same level graphis as desktop, just alone because of the power consumption
20:16:27FromGitter<krux02> there is a price you have to pay to be mobile.
20:17:29FromGitter<kayabaNerve> @krux02 Which is why I also bought a Desktop :P Threadripper, 1080 Ti, 32gb of RAM...
20:19:57FromGitter<krux02> @kayabaNerve: for a time I had a desktop with four times that spec
20:21:05*FuntDobra quit (Ping timeout: 245 seconds)
20:22:00FromGitter<kayabaNerve> @krux02 2 Xeons, Titan Xs in SLI, 128gb of RAM?
20:22:09FromGitter<kayabaNerve> The Threadrpper is two Ryzens
20:22:14FromGitter<kayabaNerve> I'm getting another 32GB soon
20:24:18FromGitter<mratsim> @krux02 GTX 1060 for laptops is actually slightly overclocked compared to the desktop version and has better perf
20:25:07FromGitter<krux02> I don't know the exact spec anymore, because I just don't remember those GPU names, but it was 4 GPUs and 128gb of RAM
20:25:40FromGitter<krux02> and I think it was 2 CPU with 8 cores each plus hyperthreading
20:25:49FromGitter<krux02> so 32 virtual cores
20:26:56FromGitter<kayabaNerve> 32 threads
20:27:02FromGitter<kayabaNerve> And that's 2x, not 4x :P
20:27:40FromGitter<kayabaNerve> (well. Likely. GPU performance doesn't scale directly, 1080 Ti is likely better performing, I have 16 threads and likely a better clockrate)
20:27:44FromGitter<krux02> @mratsim people always say that "now we really have the same performance of laptops as on desktops" people said that 10 years ago, 20 years ago, whatever time you put
20:27:52FromGitter<krux02> things are always improving
20:27:59*nsf quit (Quit: WeeChat 2.1)
20:28:06FromGitter<kayabaNerve> It's close though
20:28:09FromGitter<tim-st> when I define a array of tuple with values like `10u8` should I write every single link the `u8` suffix or does the compiler understand that the first line should be applied to all lines?
20:28:18FromGitter<tim-st> *line
20:28:30FromGitter<mratsim> I’m not sure the compiler can do nested inference
20:28:35FromGitter<mratsim> try to use mapLiterals
20:28:45FromGitter<tim-st> how does it work?
20:29:02FromGitter<krux02> but the performance of that desktop machine was ASS. It had great specs on the paper, but really starting anything was crap.
20:29:06FromGitter<mratsim> there is an example in sequtils, I’m not sure it works for arrays though.
20:29:30FromGitter<krux02> It used windows 10 and something called "mosaic" I think to connect to 15 connected monitors
20:29:58FromGitter<tim-st> @mratsim yes, could work, thank you
20:30:24FromGitter<krux02> but you can't just assume software that is written for one GPU to just scale to 4 GPUs connected to 15 monitors
20:30:46FromGitter<krux02> I really didn't like to work on that machine.
20:31:03FromGitter<kayabaNerve> I hear POSTing that much RAM takes forever
20:31:17FromGitter<krux02> (mostly because of windows, but also because everything fels so slow even though it should have felt awesomely fast)
20:31:26FromGitter<mratsim> My “desktop” (actually server) only has a Xeon E3-1230v5 (equivalent Skylake i7-6600 without GPU) + 1070 + 16GB ECC RAM.
20:31:28FromGitter<kayabaNerve> (literal minutes; compare that to a fraction of a second though with 16gb of RAM)
20:31:37FromGitter<krux02> POSTing?
20:31:37FromGitter<kayabaNerve> That's still a great build @mratsim
20:31:50FromGitter<kayabaNerve> https://en.wikipedia.org/wiki/Power-on_self-test
20:31:54FromGitter<mratsim> It has up to 14 SATA ports though :D
20:32:05FromGitter<kayabaNerve> @mratsim Where do you live?
20:32:10FromGitter<kayabaNerve> When will you be out of the house?
20:32:13FromGitter<mratsim> France
20:32:15FromGitter<kayabaNerve> Are you human and can you be shanked?
20:32:30FromGitter<mratsim> I’m out almost everyday of the week to dance =)
20:32:31FromGitter<kayabaNerve> Do you prefer your gut or your neck looking pretty?
20:32:40FromGitter<kayabaNerve> #AskingTheRealQuestions
20:32:52FromGitter<ephja> will trade for APU from 2013. much value
20:33:05FromGitter<kayabaNerve> Lol
20:33:27*Zevv left #nim (#nim)
20:34:05AraqZevv: by using 'or' for the Futures
20:34:24Araqtoo bad he already left, maybe he will read it in the logs though
20:35:33FromGitter<kayabaNerve> People leave? Sounds like a poor decision
20:35:49AraqI mean he left IRC
20:36:00FromGitter<kayabaNerve> Yeah
20:36:03FromGitter<kayabaNerve> Leaving at all
20:36:16FromGitter<kayabaNerve> We got genius people here with great personalities
20:36:42FromGitter<kayabaNerve> A mix of quality help, quality progress, and quality offtopic discussions
20:39:09Araqthanks
20:40:29FromGitter<tim-st> it wont work (tested with mapLiterals too) :(
20:40:29FromGitter<tim-st> const highPrimaryWeights = @[ ⏎ (0u16, 0u16), ⏎ (1, 1), ⏎ ] [https://gitter.im/nim-lang/Nim?at=5b01dd3d1cfca775e124532a]
20:41:10FromGitter<tim-st> (without declaring u16 on every line)
20:43:05FromGitter<mratsim> const highPrimaryWeights: array[2, (uint16, uint16)] = [ ⏎ (0, 0), ⏎ (1, 1), ⏎ ] ⏎ Does this work? I don’t think nested literals would be converted automatically though [https://gitter.im/nim-lang/Nim?at=5b01ddd9b84be71db921008f]
20:44:12FromGitter<tim-st> @mratsim no :( I tried the same, it doesnt, although it's perfectly well defined
20:44:13FromGitter<ephja> don't think so. reported a similar limitation for ranges
20:45:32FromGitter<ephja> it can get especially verbose for ranges
20:45:32FromGitter<mratsim> I think you’re out of luck, use an editor with multi cursor.
20:46:22Araqiirc mapLiterals works recursively
20:46:24FromGitter<mratsim> Don’t worry it would still be better than go’s poor man generics: https://qph.ec.quoracdn.net/main-qimg-dd2dc3bc72b058b85774ee804a521165
20:46:40FromGitter<tim-st> ok, thanks, it's just bad to have 130_000 times uX written where the file size of source gets much higher
20:47:27FromGitter<mratsim> if those are known at compile-time you can always pass those to a macro.
20:47:48FromGitter<tim-st> thats too much work and increases compile time, I think
20:48:11*yglukhov quit (Read error: Connection reset by peer)
20:48:44*yglukhov joined #nim
20:51:50*Vladar quit (Quit: Leaving)
21:06:53FromGitter<kayabaNerve> @mratsim I think Ifixed my UInt lib
21:07:04FromGitter<kayabaNerve> Max value of 2^3.3^32 -1
21:07:06FromGitter<kayabaNerve> Or so
21:07:12FromGitter<kayabaNerve> It might be 3.3^2
21:07:16FromGitter<kayabaNerve> I don't actually know
21:11:56FromGitter<mratsim> lol
21:12:42FromGitter<kayabaNerve> 1) 3^2^32 -1 ofc
21:12:46FromGitter<kayabaNerve> Not just 3.3^2
21:13:06FromGitter<mratsim> why 3.3 ?
21:13:15FromGitter<kayabaNerve> That's roughly the needed bits for 10 values
21:13:21FromGitter<mratsim> ah I see
21:13:23FromGitter<kayabaNerve> 2^3.3
21:13:52FromGitter<kayabaNerve> Yeah. the mod function is slow as hell, and broken
21:13:53FromGitter<kayabaNerve> BUT
21:13:56FromGitter<kayabaNerve> The rest works
21:14:11FromGitter<kayabaNerve> Solution? Delete the mod function
21:14:14FromGitter<kayabaNerve> What mod function
21:14:56FromGitter<kayabaNerve> Enjoy https://github.com/kayabaNerve/Currency/blob/master/lib/UInt.nim
21:18:57*CodeVance quit (Quit: Leaving.)
21:19:36*CodeVance joined #nim
21:26:09FromGitter<Varriount> @kayabaNerve So it was the mod function?
21:33:28FromGitter<mratsim> crypto without mod? that’s hardcore :P
21:34:39FromGitter<mratsim> I spent something like 2~3 days to implement the fastest mod possible in Stint. Even finding issues in the paper I implemented :/
21:41:03*CodeVance quit (Quit: Leaving.)
21:41:25*CodeVance joined #nim
21:45:33*PMunch joined #nim
21:46:08PMunchcrem, forgot to drop you a note but I made some extensive changes to parsetoml: https://github.com/NimParsers/parsetoml/issues/18
21:46:46PMunchOh woops, that was supposed to be #19
21:47:10FromGitter<kayabaNerve> @Varriount What?
21:47:26FromGitter<kayabaNerve> @mratsim I had to add it back in and I'm not using this for keygen
21:47:29FromGitter<kayabaNerve> Just balance handling
21:47:38FromGitter<kayabaNerve> Whats the best way to insert a character?
21:47:50FromGitter<kayabaNerve> I found insertSep but I only want to insert it once 3 places in from the right
21:48:03FromGitter<kayabaNerve> (abcdefghi.jkl)
21:48:35FromGitter<kayabaNerve> Use substrings and &?
21:49:43FromGitter<mratsim> not familiar with strutils (who needs strings?) but there should be an insert function, don’t slice and & that would allocate extra fluff
21:50:07FromGitter<kayabaNerve> Like this? strRate.substr(0, strRate.len-3) & "." & strRate.substr(strRate.len-3, 3)
21:50:17FromGitter<kayabaNerve> I checked strutils; only found insertSep
21:50:40FromGitter<kayabaNerve> system.nim proc insert(x: var string; item: string; i = 0.Natural) {..}
21:50:41FromGitter<kayabaNerve> Thanks
22:06:40FromGitter<tim-st> Is it ok to store data in an array when only ~30% is used? the total size would be 260kb
22:07:05*ARCADIVS quit (Ping timeout: 240 seconds)
22:14:58*Trustable quit (Remote host closed the connection)
22:18:13FromGitter<mratsim> That’s over 10% of your stack on Unix. I would use a ref array or a seq for that.
22:19:09FromGitter<tim-st> it's const memory, the other choice would be use minimal perfect hash function, but this would slow down quite a bit
22:19:33FromGitter<mratsim> if it’s known at compile-time it’s fine, it will be stored in the BSS of your program.
22:19:53FromGitter<mratsim> https://en.wikipedia.org/wiki/.bss
22:20:19FromGitter<tim-st> thx, what would be the max size of an array that would be ok with "bss"
22:20:34FromGitter<tim-st> and would it still be quick like stack access?
22:20:35FromGitter<mratsim> any size, it just increase your binary size.
22:20:44FromGitter<mratsim> probably faster.
22:21:23FromGitter<tim-st> nice, thanks, would you prefer this way to have 260kb with 30% only used or size 80kb with slower runtime?
22:21:30FromGitter<mratsim> the first access would have to be done from disk, but further access would be as fast as stack if data is kept in L2~L3 cache
22:21:49FromGitter<tim-st> L2 is only 2mb or not?
22:22:39FromGitter<mratsim> L2 is 256KB on Haswell
22:22:55PMunch"lib/pure/random.nim(176, 3) Error: cannot evaluate at compile time: state" can't random be used at compile-time?
22:23:10FromGitter<mratsim> @PMunch, there is a var state
22:23:22FromGitter<mratsim> it’s seeded with /dev/urandom or the current time
22:23:43PMunchYeah I tried to call randomize(0) to avoid that
22:23:49FromGitter<tim-st> ok, thanks, so only the retrieved items are stored in L2 not the whole const array of 260kb?
22:23:51FromGitter<mratsim> but if you set an initial see you can use it at compile-time iirc
22:24:14*ARCADIVS joined #nim
22:24:17FromGitter<mratsim> @tim-st basically the CPU will retrieve by cache-line, i.e. 64B by 64B
22:25:00FromGitter<tim-st> ok, thanks, I think my first version can use it this way then^^
22:25:09FromGitter<mratsim> @Pmunch compile-time random: https://github.com/mratsim/golem-prime/blob/master/src/montecarlo/mc_zobristhash.nim#L13-L27
22:25:39PMunchAh right, so I basically need to keep my own state
22:25:54FromGitter<mratsim> you have to set your own random seed, and pass it to all compile-time random library calls: var rng = initRand(0x1337DEEDBEAF) # Completely arbitrary random seed
22:26:15FromGitter<mratsim> arf I manage to make a typo
22:34:02PMunchHmm, damn.. I need to use the same seed as it uses by default..
22:37:52PMunchEh, I was just trying to make "main_cheating.nim" for the completely unscientific benchmark :P
22:38:17PMunchBasically doing all the compilation on compile-time and just output the result on runtime
22:40:42*sz0 joined #nim
22:46:22*leorize quit (Quit: WeeChat 2.1)
22:46:41*tefter joined #nim
22:48:53PMunchHmm, peculiar: http://ix.io/1aUU/Nim this gives a wrong result of 81, removing the {.compileTime.} pragma makes it produce the correct result of 331665
23:09:11dom96sounds like a VM bug
23:10:58FromGitter<mratsim> seems like C++ took back the crown
23:11:13FromGitter<mratsim> with pool allocation
23:16:29FromDiscord<Aearnus> hey, I've got a bit of a problem. I'm trying to define a ```nim
23:16:29FromDiscord<Aearnus> proc `$`[T](x: Ordinal[T])```
23:16:29FromDiscord<Aearnus> but I can't figure out how to convert an ordinal back to an int
23:18:14FromDiscord<Aearnus> (also, on an unrelated note: how can I upload packages to nimble? i wrote an `either` type that would be useful to contribute)
23:20:50FromDiscord<citycide> @Aearnus https://github.com/nim-lang/nimble#publishing-packages
23:21:05FromDiscord<Aearnus> ah, `int(x)`. that was waay harder to find than necessary
23:21:07FromDiscord<Aearnus> and thanks!
23:21:29FromDiscord<citycide> TLDR `nimble publish`
23:21:49FromDiscord<Aearnus> `nimble publish` automatically makes a PR?
23:21:55FromDiscord<citycide> yup!
23:22:02FromDiscord<Aearnus> that's strange
23:22:10FromDiscord<Aearnus> but I guess I'll take it ¯\_(ツ)_/¯
23:22:57FromDiscord<citycide> I'm guessing the plan in the future is to move to a registry separate from github
23:23:38FromDiscord<Aearnus> that'd probably be smart
23:23:48FromDiscord<Aearnus> Nix uses github though and they seem to not have issues
23:24:07FromDiscord<citycide> most package managers have as a start. npm did and probably a few others
23:24:19PMunchmratsim, yeah I saw
23:24:29PMunchConsidering to add pools to the Nim version as well
23:24:37PMunchdom96, hmm that's not good
23:24:55FromDiscord<Aearnus> that just doesn't _feel_ right
23:25:15*chris_ joined #nim
23:25:24*chris_ is now known as sworah
23:26:04FromDiscord<citycide> why am I being warned by nimble about the `pkg` suffix on Windows, I thought that was the standard
23:28:54FromDiscord<Aearnus> how do you add a docstring to a function?
23:29:06FromDiscord<Aearnus> how do you add a docstring to a proc?
23:29:35FromDiscord<Aearnus> unless that's not a thing -- but I assume it is, having read module docs
23:29:48FromDiscord<citycide> ```nim
23:29:48FromDiscord<citycide> proc foo () =
23:29:48FromDiscord<citycide> ## This is a docstring
23:29:48FromDiscord<citycide> discard
23:29:48FromDiscord<citycide> ```
23:29:49FromDiscord<Aearnus> unless that's not a thing -- but I assume it is, having read autogenerated module docs
23:33:04FromDiscord<Aearnus> here's a strange question: should I put my real name or my handle in the `author` field for the package? some communities are strict about stuff like this
23:36:49*tefter quit (Remote host closed the connection)
23:37:20Araqreal name is way more common afaict
23:42:07*sworah quit (Quit: leaving)
23:43:34FromDiscord<Aearnus> Alright cool
23:43:54FromDiscord<Aearnus> Any particular reason why Nim doesn't come with an either type? It's strange, considering it comes with a maybe type
23:44:34*sworah joined #nim
23:45:06*sworah quit (Client Quit)
23:45:31FromDiscord<Aearnus> I'm a Haskell guy so that was one of the first things I needed to use haha
23:45:36*xet7 quit (Remote host closed the connection)
23:51:03FromGitter<Varriount> What exactly do you mean by "either type"?
23:51:58FromDiscord<citycide> like Rust's `Result`, it either contains an error or the value
23:53:46FromGitter<data-man> ```code paste, see link``` ⏎ ⏎ @Araq: If proc a () it's not used, the compiler in any case processes «bigdata.inc»? [https://gitter.im/nim-lang/Nim?at=5b020a895666c42eb6286ec0]
23:54:58FromDiscord<Aearnus> ```nim
23:54:59FromDiscord<Aearnus> type
23:54:59FromDiscord<Aearnus> EitherKind = enum
23:54:59FromDiscord<Aearnus> leftKind, rightKind
23:54:59FromDiscord<Aearnus> Either[L,R] = object
23:54:59FromDiscord<Aearnus> case kind:
23:55:00FromDiscord<Aearnus> of leftKind:
23:55:00FromDiscord<Aearnus> left: L
23:55:01FromDiscord<Aearnus> of rightKind:
23:55:02FromGitter<Araq> sure
23:55:03FromDiscord<Aearnus> right: R
23:55:04FromDiscord<Aearnus> ```
23:57:17FromGitter<data-man> Hmm, compiler could be more smarter. :)
23:57:58FromGitter<data-man> Oh, "smart" was deprecated.