00:43:15 | * | vlad1777d joined #nim |
00:47:40 | FromGitter | <gogolxdong> Is there a name of VDOM and DOM synchronization? |
00:48:12 | FromGitter | <gogolxdong> hook or something |
00:56:19 | FromGitter | <gogolxdong> React uses diffing, there is no such operation since karax1.0,what I should call this technology? |
00:57:42 | FromGitter | <zacharycarter> there's definitely DOM diffing in karax - https://github.com/pragmagic/karax/blob/master/karax/karax.nim#L117 |
01:02:08 | FromGitter | <gogolxdong> noticed thunk |
01:03:53 | FromGitter | <gogolxdong> lazy computing? |
01:05:58 | * | Tyresc quit (Quit: WeeChat 2.3-dev) |
01:05:59 | * | vlad1777d quit (Ping timeout: 250 seconds) |
01:06:45 | FromGitter | <gogolxdong> the name of Araq's idea? |
01:08:30 | FromGitter | <gogolxdong> reads like VDOM and DOM switching. |
01:15:34 | FromGitter | <gogolxdong> dthunk |
01:16:10 | FromDiscord_ | <Virepri> ok |
01:16:28 | FromDiscord_ | <Virepri> I need some real serious help. |
01:16:29 | FromDiscord_ | <Virepri> https://hastebin.com/oyiriyogof.bash |
01:16:34 | FromDiscord_ | <Virepri> what even is the difference? |
01:16:47 | FromDiscord_ | <Virepri> it feels like nimc is just butthurt for the sake of being butthurt |
01:18:08 | FromDiscord_ | <Virepri> I just don't get how `proc(x,y:T):int{.closure.}' is ANY different from `proc(x,y:TimeEvent): int{.noSideEffect, gcsafe, locks: 0}` |
01:18:16 | FromDiscord_ | <Virepri> I just don't get how `proc(x,y:T):int{.closure.}` is ANY different from `proc(x,y:TimeEvent): int{.noSideEffect, gcsafe, locks: 0}` |
01:18:23 | FromDiscord_ | <Virepri> like, it just makes no sense |
01:18:29 | FromDiscord_ | <Virepri> I have gotten this error so many times today |
01:20:00 | FromDiscord_ | <Virepri> there *has* to be *some* logical explanation to that |
01:20:41 | * | omenar joined #nim |
01:21:24 | shashlick | Please gist your code |
01:21:43 | shashlick | The two procs are not identical in signature |
01:21:45 | FromDiscord_ | <Virepri> https://hastebin.com/soboherato.sql |
01:21:56 | shashlick | Which includes pragmas |
01:22:40 | FromDiscord_ | <Virepri> like, I just don't even know where to _start_ with fixing the issue |
01:23:17 | shashlick | just a sec |
01:25:22 | * | omenar quit (Ping timeout: 272 seconds) |
01:25:24 | shashlick | i haven't used the do syntax for procs |
01:25:40 | FromDiscord_ | <Virepri> I was trying it to see if it'd help |
01:25:47 | shashlick | https://nim-lang.org/docs/algorithm.html#sort%2CopenArray%5BT%5D%2Cproc%28T%2CT%29 is the function signature for sort |
01:25:58 | shashlick | you need to declare a closure |
01:26:23 | shashlick | https://nim-lang.org/docs/manual.html#procedures-closures is how closures are declared |
01:28:28 | shashlick | `events.sort proc (x,y: TimeEvent): int = if x.timeUnix > y.timeUnix: 1 else: 0` perhaps |
01:31:21 | FromDiscord_ | <Virepri> nope |
01:31:23 | FromDiscord_ | <Virepri> same issue |
01:31:47 | * | martin2 quit (Ping timeout: 244 seconds) |
01:32:35 | * | martin2 joined #nim |
01:53:39 | * | snowolf_ quit (Ping timeout: 268 seconds) |
01:56:40 | * | zachk quit (Quit: Leaving) |
01:58:06 | * | ftsf joined #nim |
02:00:16 | * | ftsf quit (Client Quit) |
02:00:36 | * | ftsf joined #nim |
02:01:47 | * | kapil____ joined #nim |
02:05:09 | shashlick | https://github.com/nim-lang/Nim/issues/6706 |
02:05:19 | shashlick | Seems similar, not sure what came out of it |
02:16:28 | * | dddddd quit (Remote host closed the connection) |
02:28:27 | * | abm quit (Ping timeout: 240 seconds) |
02:49:34 | FromGitter | <xmonader> what is the idiomatic way to insert multiline strings in multiline strings in nim? ⏎ ⏎ stringWith3quotes = fmt"myvalue = """ """ " ⏎ lines = fmt""" ⏎ {stringWith3quotes} ... [https://gitter.im/nim-lang/Nim?at=5c11c8be4808192b032a8ca8] |
03:00:44 | FromGitter | <genotrance> Well once it is a string, fmt should work per usual |
03:00:51 | FromGitter | <genotrance> Regardless of multi line or not |
03:02:27 | FromGitter | <xmonader> it's about having triple quotes in it @genotrance |
03:06:13 | shashlick | You could escape it with \ |
03:08:46 | * | banc quit (Quit: Bye) |
03:09:19 | FromGitter | <xmonader> @shashlick I'm. |
03:10:10 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:12:06 | shashlick | Can you please gist |
03:16:37 | FromGitter | <xmonader> https://pastebin.com/9gMu5n31 |
03:17:04 | FromGitter | <xmonader> doesn't work within fmt context @shashlick |
03:18:35 | * | martin2 quit (Ping timeout: 250 seconds) |
03:19:18 | leorize | xmonader: replace fmt with `&` |
03:19:34 | leorize | in the `let s` line |
03:19:51 | leorize | this is because the escape `\` operator does not work with raw string |
03:21:41 | FromGitter | <xmonader> @leorize thank you :( |
03:24:18 | * | banc joined #nim |
03:34:03 | * | leorize quit (Quit: WeeChat 2.2) |
03:35:56 | * | leorize joined #nim |
03:48:31 | * | vlad1777d joined #nim |
04:08:54 | FromGitter | <arnetheduck> on package managers and build systems: https://matthewbauer.us/blog/build-systems.html |
04:26:56 | * | nsf joined #nim |
04:27:14 | * | snowolf joined #nim |
04:32:16 | * | nc-x joined #nim |
04:33:09 | nc-x | shashlick: what is the type of EDIT_ALWAYS_INSERT_MODE https://github.com/nim-lang/Nim/issues/9952 |
04:36:43 | nc-x | enums are always supposed to be ordinal type (int), i.e. they are implemented. There was a regression for some time, when it did not show any error for that and silently used wrong values instead. |
04:38:30 | nc-x | Oh I see |
04:38:57 | nc-x | use EDIT_ALWAYS_INSERT_MODE.int32 like in the next line and it will work |
04:41:55 | nc-x | But i think assigning another enum value should be allowed. |
04:43:33 | leorize | nc-x: it's allowed, but only if that enum doesn't have holes |
04:43:33 | ldlework | arnetheduck that article could be a lot longer heh |
04:44:14 | * | vlad1777d quit (Ping timeout: 272 seconds) |
04:46:43 | * | nc-x quit (Ping timeout: 256 seconds) |
04:48:41 | FromDiscord_ | <citycide> @alehander42 @technicallyagd I did a huge refactoring of https://github.com/citycide/fugitive to use gara & unpack. After doing it I ran into a pretty nasty hidden conflict between the two |
04:48:53 | FromDiscord_ | <citycide> since gara generates code calling an `unpack` proc and unpack happens to introduce one. all I got was an unhelpful error about the expression gara generates being untyped or ambiguous |
04:49:11 | FromDiscord_ | <citycide> at least until I updated unpack which deprecates that `unpack` proc which is what tipped me off |
04:49:43 | FromDiscord_ | <citycide> I don't think there's anything that can be done about it but it caused me tremendous pain 😁 |
04:50:47 | * | kapil____ quit (Quit: Connection closed for inactivity) |
04:52:00 | FromDiscord_ | <citycide> the two packages are great though, I love me some pattern matching & syntax sugar |
04:54:25 | * | lritter quit (Ping timeout: 268 seconds) |
04:55:04 | * | lritter joined #nim |
04:57:25 | * | lritter quit (Remote host closed the connection) |
04:58:42 | FromDiscord_ | <citycide> (by the way, using `import unpack except unpack` fixed it even if it sounds goofy haha) |
05:02:57 | FromGitter | <kdheepak> Wow. This puzzle today. |
05:07:51 | * | narimiran joined #nim |
05:20:08 | * | endragor joined #nim |
05:31:15 | FromGitter | <xmonader> i managed to finish this in my first 4 hours of my vacation today :D https://github.com/xmonader/nimassets |
05:31:30 | FromGitter | <xmonader> can someone take a look at the code for review? |
05:38:56 | * | snowolf quit (Ping timeout: 250 seconds) |
05:40:00 | * | gangstacat quit (Quit: Ĝis!) |
05:52:34 | * | omenar joined #nim |
05:56:50 | * | omenar quit (Ping timeout: 246 seconds) |
06:41:22 | * | snowolf joined #nim |
06:44:07 | FromDiscord_ | <citycide> @xmonader very cool, I'll be taking a look soon. one thing I can say initially is that I'm not a fan of including the name of the language you use in the name of a module or tool especially when publishing to something like nimble (it's all nim anyway) |
06:50:56 | FromGitter | <xmonader> @citycide thanks! I feel the same too. maybe assets is just enough |
06:55:41 | * | narimiran quit (Ping timeout: 250 seconds) |
07:03:34 | * | Cthalupa quit (Ping timeout: 272 seconds) |
07:04:28 | * | Cthalupa joined #nim |
07:14:53 | * | Cthalupa quit (Ping timeout: 246 seconds) |
07:15:30 | * | Cthalupa joined #nim |
07:21:59 | Araq | Virepri: Please gist a longer example. |
07:22:04 | * | Cthalupa quit (Ping timeout: 250 seconds) |
07:22:28 | Araq | I'm sure the problem is that something is .closure and yours is nimcall |
07:22:52 | Araq | which is a type conversion and these don't compose with containers |
07:23:05 | Araq | but to be able to help you further I need to see some code |
07:24:16 | * | Cthalupa joined #nim |
07:30:45 | * | krux02 joined #nim |
07:32:55 | FromGitter | <alehander42> @citycide thanks! fugitive looks very cool btw! |
07:33:45 | FromGitter | <kungtotte> Using a unique name or including "nim" in the name does improve search results though. Googling "nim assets" is likely going to be futile, for example. |
07:38:18 | FromGitter | <xmonader> @kungtotte i think he meant in the binary name not in the repo name itself |
07:40:48 | * | omenar joined #nim |
07:45:31 | * | omenar quit (Ping timeout: 250 seconds) |
08:02:02 | * | ftsf quit (Quit: Leaving) |
08:06:26 | * | snowolf quit (Ping timeout: 260 seconds) |
08:07:48 | * | snowolf joined #nim |
08:21:36 | * | snowolf quit (Ping timeout: 260 seconds) |
08:23:42 | * | zakora joined #nim |
08:27:29 | * | snowolf joined #nim |
08:37:05 | * | snowolf quit (Ping timeout: 250 seconds) |
08:41:00 | * | rockcavera quit (Remote host closed the connection) |
08:42:42 | * | jjido joined #nim |
08:43:58 | * | stefanos82 joined #nim |
08:52:26 | FromGitter | <timotheecour> @araq i’m not making up the bug i’m seeing; if you have OSX you shd be able to reproduce |
08:54:35 | FromGitter | <narimiran> idiomatic way to wrap around an enum? |
08:56:18 | FromGitter | <narimiran> e.g. if myEnum is `one, two, three`, when i `inc myEnum` repeatedly i want to go one, two, three, one, two, three, one, ... |
08:56:58 | * | snowolf joined #nim |
08:58:57 | FromGitter | <alehander42> i guess you have to write one, but it might be surprising .. I'd call it incCycle or incMod maybe |
08:59:34 | FromGitter | <alehander42> as just `inc`leads to the assumption `inc(a) > a` |
08:59:53 | FromGitter | <narimiran> eh, i guess i'll just have a separate int counter which i increase, and then `mod` with enum length |
09:00:55 | FromGitter | <narimiran> well, and use an array. ugly hack, but i don't have an extra time to invent things currently |
09:01:18 | * | snowolf quit (Ping timeout: 250 seconds) |
09:02:39 | Araq | e = EnumType(ord(e) + 1 mod M) |
09:02:56 | Araq | ^ here, I "invented" it for you |
09:03:53 | FromGitter | <narimiran> haha, ok, i thought it would be more complicated than that :) |
09:06:34 | FromGitter | <alehander42> proc incCycleT: enum (a: var T) = ⏎ a = T((a.int + 1) mod (T.high.int + 1)) |
09:07:40 | FromGitter | <alehander42> is mod with less priority than + o.O |
09:08:32 | FromGitter | <alehander42> `proc incCycleT: enum (a: var T) =` * as a header |
09:09:37 | FromGitter | <alehander42> Araq's solution is simpler |
09:10:49 | Araq | timotheecour: I don't think you're making it up. I think it's some special case. osproc is used |
09:10:53 | Araq | - in testament |
09:10:59 | Araq | - by tests testament runs |
09:11:02 | Araq | - by the compiler |
09:11:24 | Araq | are these all broken for you? no, they are not |
09:11:44 | FromGitter | <timotheecour> I’ve been using it before too; it works in many cases, but I’ve just hit a bug I believe |
09:12:12 | FromGitter | <alehander42> btw Araq, I updated my nim yesterday and I saw all the ospaths stuff is now not available for the JS backend: does it make sense to provide it with some custom "assume this os for ospaths" flag/arg |
09:12:44 | FromGitter | <gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c12228c5e409525035cd59c] |
09:14:28 | FromGitter | <gogolxdong> 7323 line is `rawEcho(cstrToNimstr((len_182039(instance_234123))+""));` |
09:18:40 | * | kapil____ joined #nim |
09:19:20 | FromGitter | <mratsim> the joy of JS undefined |
09:22:32 | FromGitter | <alehander42> so the original code is echo instance.len ? what is instance |
09:23:53 | FromGitter | <alehander42> @mratsim just was making PR about https://github.com/nim-lang/Nim/issues/9946 :D |
09:24:15 | FromGitter | <mratsim> no, you were starring super weird repo :P - https://github.com/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee |
09:26:08 | FromGitter | <alehander42> fuzz testing github :D |
09:27:38 | FromGitter | <alehander42> i like that the code of conduct is the only normal file there |
09:28:59 | * | omenar joined #nim |
09:33:22 | * | omenar quit (Ping timeout: 250 seconds) |
09:35:27 | FromGitter | <gogolxdong> instance is of JsonNode type. |
09:36:46 | FromGitter | <alehander42> Araq, is `== nil` always converted to magic isNil |
09:36:56 | FromGitter | <alehander42> mIsNil |
09:37:05 | Araq | no |
09:37:16 | FromGitter | <gogolxdong> which yielded by pairs iterator in jsffi which I have hacked JsObject to JsonNode. |
09:37:18 | Araq | it's mEqRef or something |
09:38:10 | FromGitter | <alehander42> @gogolxdong you changed JsObject to JsonNode? they don't really anything in common |
09:38:12 | FromGitter | <gogolxdong> it works in a minimal test code. |
09:38:46 | FromGitter | <gogolxdong> JsonNode of karax jjson |
09:39:07 | FromGitter | <gogolxdong> not stdlib JsonNode |
09:39:19 | * | dddddd joined #nim |
09:39:46 | FromGitter | <alehander42> `proc len*(x: JsonNode): int = (if x.isNil: 0 else: x.length)` |
09:39:50 | FromGitter | <gogolxdong> it's the same in js context. |
09:39:57 | FromGitter | <alehander42> oh well, already something that wouldn't be broken after my PR :D |
09:40:09 | FromGitter | <alehander42> if x is undefine |
09:40:32 | FromGitter | <alehander42> but still not sure why your instance becomes undefined in the first place then |
09:40:51 | FromGitter | <gogolxdong> me too |
09:41:04 | FromGitter | <alehander42> do you have like a small gist with the example |
09:42:49 | FromGitter | <gogolxdong> sure.it's easy to work.But it doesn't work in project context.what is your PR about? |
09:44:36 | FromGitter | <alehander42> what I meant was, can you upload an actual example with your code? because it's hard to guess only from a limited error |
09:45:16 | FromGitter | <alehander42> I am still not sure what do you mean by "which yielded by pairs iterator in jsffi which I have hacked JsObject to JsonNode." |
09:49:15 | FromGitter | <alehander42> it sounds like you changed directly `iterator pairs*(obj: JsObject): (cstring, JsObject)` which isn't a good idea |
09:54:36 | FromDiscord_ | <technicallyagd> @citycide well, I guess it's time to actually get rid of the deprecated `unpack,lunpack,vunpack` then. |
09:56:02 | * | stefanos82 quit (Read error: Connection reset by peer) |
09:56:22 | * | floppydh joined #nim |
10:11:07 | * | dom96_w joined #nim |
10:13:17 | FromGitter | <gogolxdong> @alehander42 in my project context |
10:13:55 | FromGitter | <gogolxdong> changed JsObject to JsonNode |
10:15:45 | * | PMunch joined #nim |
10:16:06 | FromGitter | <alehander42> well, in any case `instance` is undefined for some reason |
10:16:39 | FromGitter | <alehander42> the place where `instance` comes from generates an undefined value |
10:18:43 | FromGitter | <alehander42> you have to either find out why and make it stop producing undefined or check if it's undefined somewhere in your code, the same way as with nil (this doesn't have much to do with karax/JsObject/JsonNode) |
10:19:22 | FromGitter | <gogolxdong> it works in test code.I will check later.Is your PR about isNil? |
10:21:16 | FromGitter | <alehander42> do you mean it works in karax tests? without supplying an actual example we can run, it's just very hard to say anything more |
10:21:24 | * | zakora quit (Quit: WeeChat 2.2) |
10:22:00 | FromGitter | <alehander42> yes, it simplifies things a bit, but you still have to check with isNil if it's possible that there is a nil/undefined value after it |
10:34:31 | FromGitter | <gogolxdong> http://ix.io/1vUE |
10:35:13 | FromGitter | <gogolxdong> I was on metro , and the string is huge . |
10:36:09 | FromGitter | <gogolxdong> This works well, it's almost the same and doesn't work where it is. |
10:36:37 | * | omenar joined #nim |
10:37:11 | * | rockcavera joined #nim |
10:41:07 | * | omenar quit (Ping timeout: 240 seconds) |
10:42:03 | FromGitter | <alehander42> so this works for me too |
10:44:35 | FromGitter | <alehander42> however this pairs impl doesn't even check if the JsonNode is actually an JObject |
10:44:49 | FromGitter | <alehander42> so it will fail for some other cases |
10:46:00 | FromGitter | <alehander42> when you are sure you have a {..} thing, it's best to use JsAssoc |
10:46:12 | FromGitter | <alehander42> which already has pairs/and most other iterators |
10:46:23 | FromGitter | <alehander42> {a: b, e: ..} thing * |
10:49:10 | FromGitter | <alehander42> not perfect, but something like this https://gist.github.com/alehander42/2bce6547624d18224b5da028bca88d06 |
10:50:48 | FromGitter | <alehander42> JsonNode is good where you really aren't sure what type a value is (or while you're prototyping and you don't want to write down fields, but in a perfect world, I'd type your subobjects too) |
10:55:05 | FromGitter | <mratsim> btw, I think JsonNode should be in their own library called DynType or RtType |
10:55:21 | FromGitter | <mratsim> so that everyone that needs runtime types standardise of those |
10:55:40 | FromGitter | <alehander42> yeah, I also thought that a lot |
10:55:55 | FromGitter | <alehander42> everytime ppl say "use JsonNode for <dynamic dsdgdfg>" |
10:56:06 | FromGitter | <mratsim> RFC :P |
10:57:16 | FromGitter | <mratsim> ok I’m writing one, but it will be short. |
10:57:47 | FromGitter | <alehander42> grat |
10:57:48 | FromGitter | <alehander42> great |
10:59:13 | Araq | JsonNode is JSON data |
10:59:22 | Araq | Javascript is not JSON |
10:59:51 | Araq | JsonNode is also not "I dunno, some JS dynamic fluff" |
11:00:32 | Araq | use this instead: type Dunno {.importc.} = ref object |
11:03:08 | FromGitter | <alehander42> JsonNode should be a distinct DynamicValue imo |
11:03:52 | FromGitter | <alehander42> but you're right, Dynamic is not exact, it's more like a union |
11:04:02 | FromGitter | <alehander42> or c variant |
11:04:22 | FromGitter | <alehander42> JsObjects are DynamicValue (overloading `.` `()` etc) |
11:05:02 | FromGitter | <zah> Dynamic values may have their specific fields. If you want a general library, "dynamic" can be an opt-in concept that remaps the dot operators to more specific procs such as "getField", "executeCall", etc |
11:05:02 | FromGitter | <alehander42> but still yaml/toml/many others etc produce basically the same variant |
11:05:56 | FromGitter | <zah> And there will be at least several types of dynamic values - full foreign objects (such as js, numpy, etc that support calls) and just dynamic data structures (such as json, yaml, xml, etc) |
11:17:24 | FromGitter | <mratsim> here you go: https://github.com/nim-lang/Nim/issues/9962 |
11:18:12 | FromGitter | <mratsim> there is a distinction between binary and non-binary format |
11:18:33 | FromGitter | <mratsim> we should focus on non-binary like json, xml, yaml, toml |
11:18:48 | FromGitter | <mratsim> html as well |
11:20:27 | * | snowolf joined #nim |
11:21:13 | FromGitter | <alehander42> I think it's important to have an easy way for people to parse formats directly to normal typesafe nim objects |
11:21:30 | FromGitter | <alehander42> defined with schema-s or similar to json's `to` or something else |
11:22:10 | FromGitter | <alehander42> I think the `json` approach might be suboptimal for some cases: e.g. taking the type info in consideration while parsing might let you directly construct the final objects instead of text -> JsonNode -> obj |
11:24:54 | FromGitter | <alehander42> so such dynamic and variant-like ( fully dynamic / dynamic data structures as @zah calls them) generalizations would be very useful, but for the variant-like ones people should be motivated to use schemas whenever possible |
11:27:48 | dom96_w | Over use of RFCs will soon be a Nim meme |
11:29:33 | FromGitter | <zah> I'm about to release a general serialization library that is able to deserialize formats such as JSON to strongly typed objects without using any intermediate representations |
11:29:55 | FromGitter | <zah> I was planning to share it when some docs are written. It already works |
11:34:51 | PMunch | dom96_w, RFC: Official Nim RFC meme |
11:35:10 | PMunch | zah, cool |
11:36:51 | Zevv | dom96_w: I'm risking to be considered too stupid for this stuff, but I still do not grasp the root cause of the async/gcsafe issue. Do you have a minute for me? Since the async mechanism relies solely on futures and callbacks, why is there even an threading issue? |
11:37:27 | dom96_w | Zevv: It's just the compiler being extra sensitive |
11:37:50 | dom96_w | If you enable threads then there is a chance your callback will be called in another thread |
11:37:57 | dom96_w | so it must be gcsafe |
11:38:14 | Zevv | But where is the culprit then? Where does this possible call originate? |
11:38:25 | FromGitter | <alehander42> @zah nice, does it support any other formats currently |
11:38:30 | FromGitter | <alehander42> already |
11:39:21 | Zevv | If there is only one async event loop in one thread, all callbacks will run from this thread, right? |
11:39:23 | FromGitter | <zah> I will implement what we need in Status - JSON, RLP and ProtoBuf, but adding new formats should be relatively simple |
11:40:44 | FromGitter | <zah> Avro support would be valuable and I hope somebody will do it soon |
11:41:33 | PMunch | It's really annoying that Nim nodes don't support .high and slicing.. |
11:42:17 | FromGitter | <alehander42> @PMunch I usually define my own `slice` |
11:42:26 | FromGitter | <alehander42> for them |
11:42:31 | PMunch | Yeah.. But we shouldn't have to IMO |
11:42:45 | FromGitter | <alehander42> agreed, probably a helper would be accepted in macros.nim |
11:43:13 | FromGitter | <alehander42> I don't really need `.high` tho, I usually just iterate with pairs, not sure of other usecase |
11:44:33 | FromGitter | <mratsim> @zah, not Avro, no one uses that. Apache Arrow is better |
11:44:46 | PMunch | Well, I tried to use 1..high because I couldn't do [1..^1] |
11:45:19 | FromGitter | <mratsim> see for example Nvidia RAPIDS: https://devblogs.nvidia.com/wp-content/uploads/2018/10/pipeline-1024x382.png |
11:46:18 | FromGitter | <mratsim> for data science Protobuf for Neural net and CSV/Apache Arrow for dataframes |
11:46:52 | FromGitter | <mratsim> and hdf5 but that’s an insane format ... |
11:48:09 | FromGitter | <zah> Apache Arrow looks quite cool indeed |
11:48:46 | FromGitter | <zah> But Mamy, you could look into it when I write some docs about the framework |
11:49:21 | FromGitter | <alehander42> @PMunch ah makes sense |
11:49:24 | FromGitter | <mratsim> another use of Apache Arrow: https://blog.cloudera.com/blog/2016/03/feather-a-fast-on-disk-format-for-data-frames-for-r-and-python-powered-by-apache-arrow/ |
11:49:51 | FromGitter | <mratsim> yeah, no problem. I need some serialisation in Arraymancer |
11:50:17 | FromGitter | <mratsim> I have hdf5 and Numpy, but I need to read from protobuf for Tensorflow and the new ONNX format pushed by Facebook and Microsoft |
11:51:55 | PMunch | alehander42, using something like this is very nice though: https://github.com/krux02/ast-pattern-matching |
11:52:02 | FromGitter | <mratsim> I’m still waiting for vtref btw ;) I have weird cases when combining generic methods with object variant where the generic method cannot see the variant fields. |
11:52:46 | * | snowolf quit (Ping timeout: 260 seconds) |
11:52:47 | Zevv | dom96_w: I did a - naive - experiment by removing the gcsafe requirement of the asyncHttpServer processRequest, and now I'm able to just specify a callback without any need for gc-safity. My initial tests "just work" for me, and no complaints from the compiler. So Why is it that the processRequest callback is marked gcsafe? I'm trying to understand by going through the git history, but it seems that Araq added |
11:52:53 | Zevv | a first 'gcsafe' pragma in asyncHttpServer in 2014 with the comment "asynchttpserver compiles again", and from there on it propagated through the rest of the functions up to the callbacks |
11:58:32 | dom96_w | Pretty sure you won't be able to use asynchttpserver without that gcsafe pragma in a program that uses threads |
11:58:35 | dom96_w | That's the reason for it |
11:58:37 | dom96_w | But give it a try |
12:03:56 | Zevv | dom96_w: I did. And I don't see any side effects. http://paste.ubuntu.com/p/4X46K9hbF5/ is all that is needed |
12:04:39 | Zevv | Compiles and runs with --threads:on |
12:13:24 | dom96_w | Araq, please explain |
12:14:36 | Zevv | My only guess is that the whole .gcsafe. propagation is ment to protect the user from polling the event loop from the wrong thread |
12:16:17 | FromGitter | <alehander42> @PMunch you don't have to convince me, I also have a pattern matching lib, that's the best approach |
12:17:48 | FromGitter | <alehander42> but ast_pattern_matching is the best for the macro Node-s indeed, very nice UX |
12:18:24 | FromGitter | <alehander42> and nice error messages |
12:32:15 | * | Snircle joined #nim |
12:35:25 | * | jjido quit (Ping timeout: 250 seconds) |
12:37:23 | * | stefanos82 joined #nim |
12:45:42 | dom96_w | Zevv: yes, the compiler cannot infer where the callback will be called from |
12:48:21 | Zevv | Ok, that finally makes sense - this has been bothering for over a year now |
12:48:42 | Zevv | This should protect me from poll()ing the event queue from the wrong thread |
12:49:05 | Zevv | and the price I pay is hassle with pragmas to tell the compiler "trust me, I know what I'm doing" |
12:49:47 | Zevv | This has been a bit of a pain. I am trying to convince some of my collueges to look into Nim, but me not being able to explain why the gcsafe was needed does not help my credibility :) |
12:51:30 | Zevv | But then again: this happens to be in place for the Async HTTP server, but it is missing for a lot of other async functions. I'm able to do async TCP sockets without any requirements on .gcsafe. pragmas. |
12:52:43 | FromGitter | <arnetheduck> @Araq rename branch? |
12:53:55 | FromGitter | <mratsim> someone removed JS from Nim? https://travis-ci.org/nim-lang/Nim/jobs/467452950#L2748-L2750 |
12:54:10 | FromGitter | <mratsim> https://travis-ci.org/nim-lang/Nim/jobs/467452950#L3493-L3512 |
12:55:20 | * | vlad1777d joined #nim |
12:55:29 | * | snowolf joined #nim |
13:12:46 | * | abm joined #nim |
13:29:45 | Araq | arnetheduck: haven't forgotten, I'm going through the PR queue |
13:30:04 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
13:30:28 | Araq | dom96_w, can't explain what I don't know. I know that there is a lovely special effect system rule regarding callback parameters |
13:31:14 | Araq | that seems to apply here, but cooldome wants to remove this rule :-) |
13:40:53 | sendell[m] | should we add a macro for hasing objects (by hasing all their fields) in "hashes" module, maybe? https://nim-lang.org/docs/hashes.html#hash%2CT |
13:41:12 | sendell[m] | there's no convenient way to "default hash" an object as I understand it |
13:42:25 | Araq | don't repeat the $ mistake |
13:42:42 | Araq | where everything has a string repr and compiles even though it shouldn't |
13:43:07 | FromGitter | <mratsim> array should have a `$` |
13:43:14 | FromGitter | <mratsim> and ref objects don’t compile ;) |
13:43:26 | Araq | array has a `$` |
13:43:36 | FromGitter | <mratsim> since only 1 year ago |
13:43:46 | FromGitter | <mratsim> it was painful when I started Nim |
13:44:03 | Araq | it's less painful now |
13:44:16 | FromGitter | <mratsim> now I have generic problems :D |
13:45:17 | sendell[m] | why would that be a mistake? sounds practical haha |
13:49:42 | sendell[m] | well yeah maybe for hashes it's dangerous, and the macro i'm talking about should not be named "hash" but "defaultHash" or someting. But I cannot see why having a default string repr for everythiung is bad |
13:50:21 | FromGitter | <alehander42> +1 |
13:50:39 | Araq | if every type T supports every operation O it's generic valhalla. It also means you don't have any type checking left.. |
13:52:50 | FromGitter | <mratsim> what’s wrong with Valhalla? |
13:53:18 | * | Vladar joined #nim |
13:54:27 | sendell[m] | I love type checking but since $ is not automatically inserted (except for echo) I think there's no consequences on type checking ? If you type "$" you know you want a string repr, and it's good to have a default one provided |
13:55:58 | sendell[m] | I do agree though that for hash it's dangerous since most of the time you want to provide a custom one, and having a default hash for objects allows to forget that :) |
13:56:57 | sendell[m] | If the name is different from "hash", it allows the user to knowingly wrap that default implementation for its type |
14:02:54 | FromGitter | <arnetheduck> good hashing functions are optimizations - you can essentially have `hash(t: auto) = 0` and it will be correct for its intened use in a hash map - don't see why it's dangerous to have a better one than that by default as long as it's easy to override.. only problem perhaps is that `hash` is overloaded to mean `some hopefully distinct value` and `cryptographiccally secure hash` |
14:05:27 | * | snowolf quit (Ping timeout: 264 seconds) |
14:12:50 | sendell[m] | valid point. What I meant by dangerous is that it removes the "warning" of the compiler telling you "take care, now you should implement hashing for this type, since its now used" |
14:17:56 | FromGitter | <alehander42> @Araq `$` is not every operation |
14:18:27 | * | dddddd quit (Quit: Hasta otra..) |
14:18:33 | FromGitter | <alehander42> it's possible to have a default string representation of every valid object |
14:18:53 | * | dddddd joined #nim |
14:18:53 | FromGitter | <mratsim> that’s like random: crypto secure or pseudo random |
14:19:26 | FromGitter | <alehander42> I guess your hope is that having only several `$` will lead to easy finding errors e.g. when you write "e" & $e instead of "e" & $e.f or "e" & e instead of "e" & e(f) |
14:20:11 | FromGitter | <alehander42> this might make sense, but then representation should just be e.g. `.repr` |
14:20:19 | FromGitter | <alehander42> and afaik it is actually `.repr` |
14:20:23 | FromGitter | <arnetheduck> yeah, good point sendell.. thinking about it, I like the balance where an automated field hasher exists in the hash module, but you have to enable it explicitly through some simple means, per type |
14:20:42 | shashlick | @xmonader: check out nimdeps |
14:24:19 | Araq | hashing is like equality, a tough problem and "just do it memberwise" may not cut it |
14:24:50 | sendell[m] | @arnetheduck exactly what I'm thinking :) one way would be to provide that macro as a different name like "defaultHash" that the user could wrap using "proc hash(v:MyType):Hash = defaultHash(v)" but there might be other (better) ways I don't know about |
14:25:15 | FromGitter | <mratsim> sane defaults that can be overridden |
14:25:44 | Araq | I prefer an explicit lift(MyObject, `$`) |
14:26:00 | Araq | lift(MyObject, hash) |
14:26:27 | Araq | not a fan of defaults that I need to disable but you can argue either way |
14:26:44 | FromGitter | <mratsim> I don’t mind, I like lift as well: https://github.com/numforge/laser/blob/master/tests/test_x86_reductions.nim#L15-L17 |
14:27:58 | FromGitter | <mratsim> we need a monad.nim :P |
14:28:00 | * | snowolf joined #nim |
14:28:43 | sendell[m] | @Araq here it would a default that you need to manually enable, instead of disable |
14:30:44 | FromGitter | <mratsim> We all know how GDP opt-in went ;) |
14:30:48 | FromGitter | <mratsim> GDPR* |
14:31:15 | FromGitter | <mratsim> the do you want cookies on every single websites is just insane |
14:32:12 | sendell[m] | https://addons.mozilla.org/fr/firefox/addon/i-dont-care-about-cookies/ |
14:32:20 | sendell[m] | ;) |
14:33:20 | sendell[m] | (No I'm not arguing in favor of a "i-dont-care-about-hashes" pluggin for vscode) |
14:33:30 | * | floppydh quit (Ping timeout: 244 seconds) |
14:34:22 | * | endragor quit (Remote host closed the connection) |
14:34:51 | * | floppydh joined #nim |
14:34:52 | * | floppydh quit (Client Quit) |
14:35:02 | * | floppydh joined #nim |
14:35:31 | * | snowolf quit (Ping timeout: 260 seconds) |
14:39:23 | shashlick | @Araq, @dom96, i did some preliminary research on removing compiler dependency in nimble and it seems feasible |
14:40:00 | shashlick | I'll submit a basic PR to remove the dependency for just one proc to give an idea, it can be incrementally removed. The advantage is that in the future, nimble could support full Nim capabilities in nimble rather than just the vm |
14:42:10 | shashlick | Package owner could decide how much functionality he wants to leverage beyond vm but will think of that later if it is worth the effort |
14:43:30 | shashlick | Most of the changes can be isolated to nimscript support.nim |
14:45:41 | shashlick | Also, I think all the code for supporting older versions of the compiler can be discarded since new implementation won't depend on internals |
14:46:03 | shashlick | Just the command line interface which is stable for a while |
14:46:35 | Araq | sounds good |
14:50:07 | shashlick | Araq: does the compiler package install the entire lib directory today? |
14:50:39 | Araq | hmmm I don't know |
14:50:53 | Araq | why would it, it's the stdlib, every Nim has it |
14:51:46 | shashlick | Right, looking at the nimble file, it's only the compiler directory |
14:52:38 | shashlick | But you could have a mismatch of an older compiler built into nimble but newer stdlib |
14:53:02 | Araq | yeah there is a check for that in Nimble somewhere |
14:53:20 | shashlick | Another tight coupling of tool to installed compiler rather than one that can stand independently |
14:53:49 | shashlick | Even if we did improve nimble, other tools will still be tightly coupled |
14:55:04 | shashlick | I'd think that if I depended on the compiler but be truly independent, I'd like to include the stdlib as well in the compiler nimble package |
14:56:03 | shashlick | Or perhaps have a separate stdlib package that can be versioned and depended on |
14:58:01 | Araq | you trade one set of problems for another, then every Nim tool comes with its own stdlib version |
14:59:42 | shashlick | Yep either you link to the installed Nim compiler and stdlib which means being compiled right there or carrying your own copy of everything |
15:00:03 | shashlick | Can't be in the middle which is the same as the former but perhaps an untested configuration |
15:01:23 | shashlick | C2nim could break at any time if it tags an old compiler but depends on stdlib which can be different on the current install |
15:03:16 | Araq | no, c2nim only uses the compiler's AST rendering engine |
15:03:32 | Araq | c2nim doesn't process system.nim |
15:04:19 | Araq | yeah, I know, I know, this means the compiler AST+render should be a Nimble package that the Nim compiler depends on |
15:07:50 | shashlick | So what's happening is that these tools are using a specific version of compiler component but built with a completely different compiler and stdlib combo |
15:09:24 | PMunch | Hmm, is there a way to take an object created in a macro and make it available on runtime? Or do I have to manually create the AST to create that object? |
15:09:35 | shashlick | I guess it works but makes me feel queasy, perhaps it's not an issue |
15:09:38 | FromGitter | <mratsim> quote do: |
15:10:10 | shashlick | PMunch: const x = macro() |
15:10:38 | PMunch | shashlick, but how would the macro return the object? |
15:11:45 | FromGitter | <mratsim> quote do |
15:12:11 | FromGitter | <mratsim> or result = newStmtList().add newLit(yourObject) |
15:12:13 | shashlick | It could even be a proc |
15:12:37 | shashlick | Since it is a const, Nim knows to do it at compile time |
15:12:46 | * | Cthalupa quit (Ping timeout: 244 seconds) |
15:13:11 | FromGitter | <alehander42> what kind of obj is it @PMunch |
15:13:41 | shashlick | In nimdeps, I created the const in a macro |
15:13:41 | shashlick | https://github.com/genotrance/nimdeps/blob/master/nimdeps.nim |
15:13:54 | * | Cthalupa joined #nim |
15:14:54 | shashlick | In snip, I do it inline |
15:14:54 | shashlick | https://github.com/genotrance/snip/blob/master/src/snip/keymap.nim |
15:17:00 | PMunch | alehander42, what do you mean what kind? |
15:17:11 | PMunch | Currently trying out mratsims, suggestion |
15:18:49 | * | NimBot joined #nim |
15:19:40 | FromGitter | <alehander42> well, if it's a literal, you can just construct it easily, if it's a complicated ref object with cycles, it's pretty different |
15:19:47 | PMunch | Hmm, didn't seem to like that.. |
15:20:01 | PMunch | Well its not a ref object, and no cycles |
15:20:07 | PMunch | But it is a variant object |
15:20:10 | FromGitter | <mratsim> @Pmunch for example: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim#L225-L226 |
15:20:19 | PMunch | Which newLit doesn't seem to like |
15:20:26 | FromGitter | <mratsim> and definition: https://github.com/numforge/laser/blob/master/laser/primitives/matrix_multiplication/gemm_ukernel_generator.nim#L157 |
15:20:35 | FromGitter | <mratsim> yeah for non native type you need to use quote do |
15:22:31 | FromGitter | <alehander42> @PMunch and all of its fields are not ref objects and have no cycles? |
15:22:41 | PMunch | Correct |
15:22:43 | FromGitter | <alehander42> well, you'll have to construct it in this case |
15:22:50 | PMunch | Error: object constructor needs an object type |
15:23:06 | PMunch | When trying to use "quote do: `nameOfMyVariable`" |
15:23:21 | FromGitter | <alehander42> no, this can't possibly work |
15:23:30 | FromGitter | <alehander42> you need to generate the code that constructs it |
15:23:35 | FromGitter | <alehander42> in the `quote` |
15:23:49 | PMunch | Hmm, that's what I was afraid of |
15:24:20 | FromGitter | <alehander42> well, it's just a interpreted value in the nim VM |
15:24:29 | PMunch | Yeah I know |
15:24:43 | FromGitter | <alehander42> probably it's possible for one to write a more general constructValue helper |
15:25:08 | FromGitter | <alehander42> but I guess it's just not a very common usecase |
15:25:18 | PMunch | Basically what I'm trying to do is to parse a DSL and convert that code into something that would at runtime be an object |
15:25:27 | PMunch | I'd imagine that would be rather common.. |
15:26:27 | FromGitter | <alehander42> but why do you need to create the same object on compile time, that seems more unusual to me |
15:26:49 | FromGitter | <alehander42> usually one needs to directly create the constructing NimNode |
15:27:01 | PMunch | Yeah, I was just silly when I wrote the macro |
15:28:06 | FromGitter | <alehander42> it shouldn't be too ugly, also one can just generate many ⏎ ⏎ ```quote: ⏎ `stuff`.`field` = `node```` ⏎ ⏎ etc [https://gitter.im/nim-lang/Nim?at=5c127a86f992693c7a6ad01f] |
15:28:51 | FromGitter | <mratsim> DSL parsing: https://github.com/numforge/laser/blob/master/laser/photon_jit/x86_64/x86_64_ops.nim#L24-L55 |
15:29:10 | FromGitter | <mratsim> another one: https://github.com/mratsim/glyph/blob/master/glyph/snes/opcodes.nim#L16-L34 |
15:29:25 | * | virtualm64 joined #nim |
15:29:59 | FromGitter | <mratsim> and to create the object: https://github.com/numforge/laser/blob/master/laser/photon_jit/x86_64/x86_64_base.nim#L282-L288 |
15:30:58 | PMunch | Yeah I guess I could do something similar.. |
15:31:21 | FromGitter | <mratsim> what I can instantiate with newLit, I use newLit on |
15:31:28 | FromGitter | <mratsim> otherwise I need to construct objects |
15:31:33 | PMunch | Just wondering if there was a way to do it automatically |
15:32:08 | FromGitter | <mratsim> well you can’t even quote do enums, because they are transformed in int ;) |
15:33:02 | FromGitter | <mratsim> you can create an objConstr macro |
15:33:58 | FromGitter | <mratsim> you can getImpl the type to get the number of fields and the macro does objConstr(newIdentNode”MyType”, GenType1, GenType2, Field1, Field2) |
15:34:28 | FromGitter | <mratsim> GenType if you need to provide generic type isntantiation |
15:35:02 | FromGitter | <mratsim> but it’s a lot of work for something that is probably use rarely in a codebase. |
15:37:03 | shashlick | PMunch: I did the exact thing using the proc approach though not for a variant |
15:37:17 | shashlick | For testing purposes in nimterop |
15:38:03 | shashlick | https://github.com/genotrance/nimterop/blob/master/nimterop/globals.nim |
15:38:23 | shashlick | The Ast object there, I could create it in grammar.nim at compile time |
15:38:50 | shashlick | It didn't work with a proc type though so I had to use int there |
15:41:28 | xace | is there a existing tool that generates the full docs with json formatting or is my vest choice to make my own based on this https://github.com/nim-lang/Nim/blob/devel/tools/kochdocs.nim ? |
15:44:08 | FromGitter | <mratsim> nim jsondoc is a thing :P |
15:44:22 | FromGitter | <mratsim> https://nim-lang.org/docs/docgen.html#document-types-json |
15:45:51 | FromGitter | <arnetheduck> that's funny, given that json is the one text format that doesn't allow you to put comments in it :) |
15:46:20 | FromGitter | <mratsim> I think text is an implementation detail ;) |
15:48:08 | * | narimiran joined #nim |
15:48:09 | * | nsf quit (Quit: WeeChat 2.3) |
15:54:35 | xace | mratsim: yeah, i was aware of jsondoc. I was mostly curious on how to generate the full https://nim-lang.org/docs/theindex.html documentation and store it locally as json, so that I can my own tool to view documentation |
15:54:44 | xace | make my own* |
15:55:02 | FromGitter | <mratsim> Nim generates a .idx file if you pass certain flags |
15:55:09 | FromGitter | <mratsim> I don’t remember which one though |
15:55:30 | xace | my tool will be cli only as thats commonly the only thing i have access too |
15:56:05 | shashlick | That's a fun use case - I'd use it |
15:56:30 | xace | reading the docs on my phone is a pain... seems like google search results behave differently on my phone, even when i use incognito |
15:57:52 | xace | shashlick: yeah, it has been on my mind for a while, and last night i figured, it is time to do it... |
16:02:15 | FromGitter | <kaushalmodi> xace: That would be nice; looking forward to it |
16:02:37 | FromGitter | <kaushalmodi> For now, I am using the docs from devdocs to get "CLI-like" doc access interface |
16:02:49 | FromGitter | <kaushalmodi> my post on that: https://scripter.co/accessing-devdocs-from-emacs/#devdocs-lookup-demo (click on that image to see the GIF) |
16:03:12 | xace | cool, ill check it now :) |
16:06:05 | xace | using devdocs json seems like a good idea. but last time i checked over there they had old nim documentation |
16:06:35 | * | vlad1777d quit (Ping timeout: 268 seconds) |
16:07:19 | FromGitter | <kaushalmodi> xace: I had sent a PR to devdocs |
16:07:26 | FromGitter | <kaushalmodi> it now reflects 0.19.0 docs |
16:07:52 | FromGitter | <kaushalmodi> I had also enabled devel branch docs, but the devdocs dev did not want to support publishing unreleased version docs |
16:09:26 | xace | Ah, thats cool |
16:10:15 | FromGitter | <kaushalmodi> xace: But you are still working on that CLI tool you promised, right? :) |
16:10:39 | xace | yeah, just thinking of a clever way to make it generate the docs on other people computers |
16:22:43 | * | ng0 joined #nim |
16:35:03 | shashlick | devdocs link anchors don't work anymore |
16:35:30 | shashlick | Plus having links to source would be cool |
16:37:15 | shashlick | But cli app will be much preferred |
16:45:35 | * | PMunch quit (Remote host closed the connection) |
16:47:58 | Zevv | narimiran[m]: can you push your AoC repo up to date |
16:49:08 | * | Cthalupa quit (Ping timeout: 268 seconds) |
16:49:28 | * | Vladar quit (Remote host closed the connection) |
16:49:35 | * | Cthalupa joined #nim |
17:03:00 | narimiran | Zevv: heh, i will i will :) |
17:03:23 | narimiran | i'm trying to make my solution a bit less messy |
17:11:53 | * | virtualm64 quit (Quit: Page closed) |
17:12:31 | * | gangstacat joined #nim |
17:15:47 | * | abm quit (Ping timeout: 250 seconds) |
17:20:18 | * | nsf joined #nim |
17:23:47 | Zevv | thanks :) |
17:30:14 | stephenwithav | Has anyone had success using ahirner's ffmpeg bindings? I'm attempting to build a rough encoder outline and it's failing spectacularly. Code and detailed errors at: https://gist.github.com/stephenwithav/9db7b6758d59e6491e7353cd6e590d1c |
17:30:50 | narimiran | Zevv: why do you need it? ;) |
17:38:51 | * | snowolf joined #nim |
17:49:35 | FromGitter | <mratsim> @stephenwithav, this reminds me of some issue I had with Nim OpenCL |
17:49:53 | FromGitter | <mratsim> I had to pass a pointer to a pointer to textures instead of a ptr to textures |
17:51:10 | FromGitter | <mratsim> create a `var ctxPtr: ptr ptr AVCodecContext` and do `ctxPtr[] = context` |
17:51:30 | FromGitter | <mratsim> and pass that to avcodec_free_context |
17:51:35 | FromGitter | <mratsim> it should work |
17:53:58 | Zevv | narimiran: "need" is a big word. But I'm trying to get more proficient in Nim idiom, so it's nice to compare my solutions with others |
17:57:29 | narimiran | Zevv: yeah, sorry for the too strong word. i'm still not satisfied with my solution. in the mean time, can i have a link to your repo? |
18:00:10 | xace | even generating jsondoc based on this code https://github.com/nim-lang/Nim/blob/devel/tools/kochdocs.nim seems to get various errors, e.g. this time it's complaining about https://pastebin.com/raw/BFEcR3xP |
18:02:16 | xace | that error came up after trying to run nim jsondoc -o:$HOME/.cache/noc/cpuload.json $HOME/.choosenim/toolchains/nim-0.19.0/lib/pure/concurrency/cpuload.nim |
18:04:59 | Zevv | narimiran: my repo is only local, I'll put it online when I get home |
18:10:09 | narimiran | Zevv: here's my solution, not yet in the repo: https://old.reddit.com/r/adventofcode/comments/a5qd71/2018_day_13_solutions/ebpncfj/ |
18:11:23 | narimiran | Zevv: if you have any comments/questions/suggestions, let me know |
18:14:20 | xace | kaushalmodi: when you generated the PR to devdocs, did you create the docs in json format? as i'm trying to `nim jsondoc lib/pure/concurrency/cpuload.nim` # it fails as it doesnt import os (im guessing). How did you deal with this? |
18:23:24 | xace | looking at some of the jsondoc output they come with <span> and other html tags... |
18:26:19 | FromGitter | <mratsim> @Araq, I have a direct acyclic graph, a context owns all the nodes which are ref objects. For convenience the Nodes refer back to their context and their parents. ⏎ ⏎ To break the cyclic referencing I used to use `ref MyObj` for the owning context and `ptr MyObj` for those back references but then I had issues with the GC moving “MyObj” (during mark-and-sweep I suppose). ⏎ ⏎ Due to that I went back to |
18:26:19 | FromGitter | ... using ref everywhere but I expect that it’s pretty stressing for the GC. ... [https://gitter.im/nim-lang/Nim?at=5c12a44bca317a0e25c0586e] |
18:32:54 | FromGitter | <alehander42> Mamy,you really hate `ref |
18:33:21 | Zevv | narimiran: https://github.com/zevv/aoc2018. Nothing is polished for publication :) |
18:44:14 | * | zakora joined #nim |
18:49:19 | Araq | mratsim: ok |
18:51:17 | * | floppydh quit (Quit: WeeChat 2.3) |
19:00:50 | FromGitter | <mratsim> Are you talking like the librarian in the DiscWorld? :P |
19:03:41 | * | snowolf quit (Ping timeout: 250 seconds) |
19:06:41 | FromGitter | <kaushalmodi> xace: The JSON is created by devdocs itself |
19:06:53 | FromGitter | <kaushalmodi> My PR was to just update their config file related to Nim: https://github.com/freeCodeCamp/devdocs/pull/896/files |
19:07:41 | stephenwithav | Thank you, mratsim. I had a ctxPtr, but didn't assign it with ctxPtr[] = context. |
19:08:05 | stephenwithav | ctxptr |
19:08:37 | xace | kaushalmodi: Hmm oki. |
19:14:03 | * | Cthalupa quit (Ping timeout: 244 seconds) |
19:16:47 | * | Cthalupa joined #nim |
19:28:59 | stephenwithav | mratsim: same "Illegal storage access" error with Nim 0.19 |
19:31:37 | * | kapil____ quit (Quit: Connection closed for inactivity) |
19:33:48 | * | snowolf joined #nim |
19:34:08 | * | zakora quit (Quit: WeeChat 2.2) |
19:35:38 | * | shodan45 quit (Quit: No Ping reply in 180 seconds.) |
19:38:24 | * | snowolf quit (Ping timeout: 252 seconds) |
19:39:59 | * | shodan45 joined #nim |
19:43:07 | * | abm joined #nim |
19:50:08 | * | tdc joined #nim |
19:52:32 | * | nsf quit (Quit: WeeChat 2.3) |
20:04:47 | * | gmpreussner quit (Ping timeout: 240 seconds) |
20:08:18 | * | gmpreussner joined #nim |
20:20:36 | FromGitter | <brentp> anyone know of strformat-like libraries for nim that let the format string be created at run-time? |
20:29:48 | xace | shouldnt nim docgen -d:nimdoc lib/pure/concurrency/cpuload.nim ignore this section: https://github.com/nim-lang/Nim/blob/devel/lib/pure/concurrency/cpuload.nim#L84 |
20:30:06 | xace | *nim jsondoc -d:nimdoc |
20:37:33 | * | miran joined #nim |
20:39:00 | Araq | xace, I think jsondoc should define nimdoc on its own |
20:39:11 | Araq | mratsim: that would be "ugh", no? |
20:39:20 | xace | Araq: yeah i saw it in compiler/main.nim # but it still triggers an error on cpuload.nim |
20:40:23 | * | narimiran quit (Ping timeout: 268 seconds) |
20:40:28 | FromGitter | <yyyc514> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c12c3bc987052387edf7498] |
20:41:05 | Araq | no, it's ok |
20:41:15 | FromGitter | <yyyc514> ugly though :) |
20:42:22 | Araq | for more fields you can write a template or a macro |
20:42:31 | FromGitter | <yyyc514> ah |
20:42:33 | Araq | but for just these two it's ok |
20:42:47 | xace | nim jsondoc -o:/tmp/testdoc.json nim-0.19.0/lib/pure/concurrency/cpuload.nim # Araq: do you know what this isn't working? it results in this error: https://pastebin.com/raw/BFEcR3xP |
20:42:49 | * | miran quit (Remote host closed the connection) |
20:43:03 | * | snowolf joined #nim |
20:44:09 | xace | Araq: nvm, the 0.19.0 version doesnt check for defined(nimdoc) |
21:00:51 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c12c8830a86bc6f8da2d0f0] |
21:01:26 | FromGitter | <brentp> I can't get that to use `stringable` for the table value. Am I missing something? |
21:04:07 | FromGitter | <mratsim> @Araq the librarian says Ook. Ook! Oook |
21:04:23 | FromGitter | <mratsim> https://en.wikipedia.org/wiki/Unseen_University#Librarian |
21:04:41 | Araq | I read it in German :P |
21:04:44 | FromGitter | <mratsim> https://esolangs.org/wiki/ook! |
21:04:48 | Araq | there it's "ugh" |
21:04:52 | FromGitter | <mratsim> there is even a programming language ;) |
21:04:58 | FromGitter | <mratsim> In French it’s ook as well |
21:05:08 | Araq | well German is special |
21:05:48 | FromGitter | <kayabaNerve> @mratsim ... dare you to create a Funge to Nim macro. |
21:06:21 | FromGitter | <kayabaNerve> I'll settle for 2D but I would like the full Funge98 set. :thinking: |
21:06:49 | Araq | brentp: well you don't use 'stringable' anyway |
21:06:53 | Araq | *anywhere |
21:07:25 | FromGitter | <brentp> @Araq, when I do, I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c12ca0d539aca60b20648dd] |
21:07:58 | FromGitter | <mratsim> @kayabaNerve this? https://en.wikipedia.org/wiki/Befunge |
21:10:47 | * | pbodev1 joined #nim |
21:10:57 | * | pbodev1 left #nim (#nim) |
21:12:35 | Araq | you can't instantiate a generic with a syntactic constraint |
21:12:53 | Araq | at some point the compiler needs to know the concrete types and their sizes |
21:13:00 | Araq | it's called "concept", not "interface" |
21:18:14 | FromGitter | <iffy> Is there a way to display logging output when running `nimble test`? |
21:20:06 | FromGitter | <iffy> `--verbose` doesn't do it |
21:21:54 | FromGitter | <kayabaNerve> @mratsim Funge98 is 3D |
21:22:13 | FromGitter | <kayabaNerve> https://esolangs.org/wiki/Funge-98 |
21:22:14 | FromGitter | <brentp> ok. thanks @Araq . indeed I was thinking it of interface |
21:22:30 | FromGitter | <kayabaNerve> So I understand Nim isn't and you can't effectively work on a 3D map |
21:22:42 | FromGitter | <kayabaNerve> But you can still use the new commands unrelated to 3D |
21:25:09 | FromGitter | <mratsim> that seems fun :P |
21:25:19 | FromGitter | <mratsim> but I have too many stuff :P |
21:25:32 | FromGitter | <mratsim> even when I need a break I always something fun to work on |
21:28:54 | * | stefanos82 quit (Remote host closed the connection) |
21:42:40 | * | Jesin quit (Quit: Leaving) |
21:47:59 | * | Jesin joined #nim |
21:53:04 | * | Snircle quit (Ping timeout: 250 seconds) |
21:53:26 | * | Tyresc joined #nim |
21:57:20 | * | Snircle joined #nim |
22:24:03 | * | stefantalpalaru joined #nim |
22:24:12 | * | vlad1777d joined #nim |
22:40:06 | FromGitter | <mratsim> @alehander42 sorry I got swept up in a bench. I don’t hate ref, what I hate is allocating in a loop. And allocating with cyclic dependency is worse because you need a mark and sweep pass to collect unused references |
23:14:09 | * | zachk joined #nim |
23:16:37 | * | zachk quit (Changing host) |
23:16:37 | * | zachk joined #nim |
23:33:58 | FromDiscord_ | <citycide> anyone have a good way to get shell output asynchronously? |
23:40:19 | * | PrimHelios joined #nim |
23:41:35 | FromGitter | <rayman22201> @citycide, maybe the cheatface asynctools library again? https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim |
23:43:42 | PrimHelios | is it possible to use var parameters in an async procedure? this code (https://hastebin.com/sopuduhifu.cs) compiles without the async pragma, but with it, I get the error: "temp1.nim(4, 3) Error: illegal capture 'x' of type <var int> which is declared here: temp1.nim(3, 12)" |
23:47:58 | FromDiscord_ | <citycide> @rayman22201 hmm, Nimble can pull a PR branch right? master doesn't compile on 0.19.0. it's interesting that asyncproc is mostly a copy of osproc - would be nice to have in stdlib if possible |
23:53:39 | FromGitter | <rayman22201> @citycide you can do `nimble install package&#git-tag` to install an arbitrary branch. Yes, it would be nice to be in the stdlib, but #small-language problems. Too much to do and too few people to do it. |
23:54:16 | FromGitter | <rayman22201> no `&` that was a typo |
23:54:41 | FromGitter | <rayman22201> it's `nimble package@git-tag` |