00:01:28 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
00:11:32 | * | rockcavera joined #nim |
00:18:37 | FromGitter | <deech> IIUC `method` is a runtime dispatch construct so some type information must be kept around at runtime, is there any documentation that specifies what and when that happens? |
00:20:52 | * | theelous3 quit (Ping timeout: 248 seconds) |
00:26:28 | FromGitter | <gogolxdong> the error has gone. |
00:26:28 | FromGitter | <Vindaar> @deech the only place I'm aware of that mentions RTTI at all is the typeinfo module: https://nim-lang.github.io/Nim/typeinfo.html ⏎ I'm off to bed now. Good night :) |
00:41:34 | * | luis_ quit (Remote host closed the connection) |
00:49:01 | * | sagax quit (Ping timeout: 244 seconds) |
00:50:15 | * | user0225 quit (Quit: user0225) |
00:52:34 | * | krux02_ quit (Remote host closed the connection) |
00:56:20 | * | Kaivo quit (Ping timeout: 272 seconds) |
01:07:16 | * | arecaceae quit (Read error: Connection reset by peer) |
01:07:40 | * | arecaceae joined #nim |
01:12:47 | * | Jjp137 quit (Read error: Connection reset by peer) |
01:13:30 | * | Jjp137 joined #nim |
01:26:41 | * | laaron joined #nim |
01:50:17 | xace | could someone help explain what happens on this line: https://github.com/kitsunyan/pakku/blob/1f6a5c6188a80bab511f56cb36eae824765c89d6/src/feature/syncinstall.nim#L312 # my understanding is that `editorEnv` is a string variable. What happens when you just put the string variable like that? |
01:58:45 | xace | oh, nvm now i see that it's part of a if-statement |
02:54:03 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
02:54:32 | * | laaron joined #nim |
03:16:35 | * | LEdoian[m] joined #nim |
03:20:28 | * | livcd quit (Ping timeout: 246 seconds) |
03:28:46 | * | livcd joined #nim |
03:29:57 | * | dddddd quit (Remote host closed the connection) |
03:48:03 | * | chemist69 quit (Ping timeout: 264 seconds) |
03:49:32 | * | chemist69 joined #nim |
04:01:05 | * | darithorn quit (Read error: Connection reset by peer) |
04:02:02 | FromGitter | <gogolxdong> D:\Nim\lib\system\jssys.nim(53, 6) Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory ⏎ when compile nimx with task nake js |
04:04:54 | * | fjellfras joined #nim |
04:08:43 | * | laaron quit (Remote host closed the connection) |
04:11:06 | * | laaron joined #nim |
04:18:33 | * | rockcavera quit (Remote host closed the connection) |
04:26:05 | FromGitter | <kayabaNerve> Use `except Exception as e` |
04:27:37 | * | owl_000 quit (Ping timeout: 250 seconds) |
04:46:28 | * | endragor joined #nim |
04:51:20 | * | nsf joined #nim |
04:59:17 | * | laaron quit (Remote host closed the connection) |
05:01:53 | * | laaron joined #nim |
05:06:09 | * | snooptek joined #nim |
05:15:56 | * | narimiran joined #nim |
05:17:32 | * | owl_000 joined #nim |
05:26:12 | owl_000 | what enum {.pure.} pragma does? i added {.pure.} and can't find any differences. |
05:28:32 | owl_000 | and is enum values can be only string? |
06:04:14 | FromGitter | <zacharycarter> owl_000: pure forces you to address enum values as EnumName.EnumValue |
06:04:19 | Zevv | .pure. enums allow for names to collide |
06:04:30 | FromGitter | <zacharycarter> to allow for ^ |
06:04:40 | Zevv | zacharycarter: you're not forced to qualify |
06:04:50 | FromGitter | <zacharycarter> oh? I thought you were |
06:05:43 | Zevv | only for non-unique values |
06:09:49 | FromGitter | <zacharycarter> ah okay |
06:10:07 | livcd | good morning |
06:10:23 | livcd | gogolxdong: you around? |
06:10:47 | FromGitter | <zacharycarter> I think the best thing to do is for an enum named `FooEnum` prefix all values with `fe` so like `feFoo` feBar` etc... |
06:10:59 | * | solitudesf joined #nim |
06:23:47 | * | actuallybatman quit (Ping timeout: 245 seconds) |
06:23:47 | Zevv | that is *soo* C |
06:27:30 | lqdev[m] | but it doesn't cause as many problems as in C (namespacing) |
06:28:41 | * | PMunch joined #nim |
06:36:05 | * | Vladar joined #nim |
06:44:11 | * | tankf33der joined #nim |
06:59:53 | * | tankf33der left #nim (#nim) |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:03:52 | FromGitter | <zacharycarter> I don't really mind if some C patterns are baked into Nim |
07:03:52 | FromGitter | <zacharycarter> but others *cough Zevv* take offense for some reason :P |
07:03:52 | FromGitter | <zacharycarter> like when you use `const FOO_BAR = 1` |
07:03:52 | FromGitter | <zacharycarter> I have a feeling that makes Zevv twitch / cringe |
07:04:49 | * | gmpreussner joined #nim |
07:08:51 | FromDiscord_ | <Shield> you gotta scream those consts |
07:12:27 | Zevv | oh no I love that |
07:12:34 | Zevv | I'm a C man, and too old to ever change |
07:12:42 | FromGitter | <zacharycarter> lol |
07:12:50 | Zevv | I hate it that nim has no proper preprocessor to abuse |
07:12:55 | Zevv | all this fiddling with macros, bah |
07:26:03 | FromGitter | <zacharycarter> hahaha |
07:26:53 | FromGitter | <alehander42> you can kinda do it with source filters |
07:27:00 | FromGitter | <gogolxdong> @livcd yes |
07:31:46 | * | krux02 joined #nim |
07:37:36 | * | sagax joined #nim |
07:43:07 | Zevv | wow lets make an m4 compatible source filter |
07:46:58 | FromGitter | <alehander42> 1) term rewriting macros |
08:23:10 | * | floppydh joined #nim |
08:26:08 | livcd | gogolxdong: Do you know xcgui ? |
08:27:15 | PMunch | livcd, hard to find any english docs on it it seems |
08:28:16 | * | shomodj joined #nim |
08:29:26 | FromGitter | <gogolxdong> what's that? |
08:29:59 | livcd | some chinese gui lib |
08:30:03 | livcd | http://www.xcgui.com/ |
08:30:48 | * | shomodj quit (Client Quit) |
08:33:38 | PMunch | Windows only by the looks of it |
08:35:32 | FromGitter | <gogolxdong> yeah, it's Windows only. |
08:37:37 | * | floppydh quit (Quit: WeeChat 2.5) |
08:42:44 | * | shomodj joined #nim |
08:51:36 | PMunch | Hmm, what are the current differences between a normal build and -d:release? |
08:52:04 | PMunch | My program fails when I compile with -d:release on 0.20.2, but works fine without |
08:53:39 | * | ng0 joined #nim |
08:54:55 | Zevv | "fails"? |
08:56:07 | PMunch | It's doing some decryption, which comes out garbled on a release build |
08:57:53 | leorize | I think the only diff are: stacktrace off, -O3 optimization on |
08:58:49 | leorize | I think -O3 is messing up with your code, try passing -d:release -t:'-O0' and see if it's working |
08:59:32 | PMunch | Nope, still messed up |
08:59:44 | PMunch | Was that supposed to be -t |
09:00:05 | leorize | it's --passC, I think the sort form is -t |
09:00:43 | leorize | try --opt:none then |
09:01:10 | PMunch | Ah, it's definitely -O3 that does it |
09:01:33 | PMunch | But passing -O0 to a release build adds both flags, and the GCC compiler chooses O3 |
09:02:01 | PMunch | Just passing O3 without release messes up as well |
09:02:37 | PMunch | Some for O1 |
09:02:58 | Zevv | So O3 messes up your nim-generated code? |
09:03:00 | PMunch | Hmm, strange, this used to work.. |
09:03:27 | PMunch | Zevv, I don't think O3 does anything to the code does it? |
09:03:37 | Zevv | well, it can break *bad* code |
09:03:47 | Zevv | or fix it, depending on how you look at it |
09:03:52 | Zevv | it typically changes UB |
09:04:02 | Zevv | but nim generated C code should never show UB, right |
09:04:27 | leorize | well gcc optimization make code fails faster :P |
09:04:39 | Zevv | that much is true :) |
09:05:00 | leorize | I'm not entirely sure if -O3 is that safe |
09:05:22 | Zevv | well, it is supposed to be |
09:05:28 | leorize | libgcrypt has special override for certain part of it to disable gcc optimization |
09:06:16 | leorize | PMunch: if you have clang with sanitizer, try -t:'-fsanitizer=ubsan' -l:'-fsanitizer=ubsan' |
09:07:41 | PMunch | Only got GCC on this machine |
09:10:22 | Zevv | Does O2 work for you? |
09:10:28 | PMunch | Nope |
09:10:33 | Zevv | that is very bad |
09:10:46 | PMunch | Only O0 works |
09:11:11 | leorize | can you share the code? |
09:11:16 | PMunch | O[1|2|3] fails |
09:11:27 | PMunch | Sure, it's my libkeepass repo on GitHub |
09:11:29 | leorize | if -O1 fails then the code is already broken :P |
09:12:04 | Zevv | euh but that's a python module? |
09:12:18 | Zevv | are you sure you're on the right irc channel? :) |
09:13:52 | PMunch | https://github.com/PMunch/libkeepass |
09:13:55 | PMunch | It's a Nim module |
09:14:24 | * | solitudesf quit (Read error: Connection reset by peer) |
09:14:26 | * | solitudesf- joined #nim |
09:18:43 | PMunch | Hmm, it seems like it has something to do with the salsa module or how it's used |
09:19:15 | PMunch | But I can't get that module itself to misbehave |
09:19:38 | PMunch | But adding an echo of pwBytes right after this line: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim#L256 |
09:19:53 | PMunch | Shows that it decrypts the first password just fine, but then it starts failing |
09:22:06 | narimiran | i think my `nimble` is broken (i can't install packages), and running `koch nimble` didn't make my problems go away. what now? |
09:22:38 | PMunch | Okay this is very strange.. |
09:23:04 | PMunch | I added some echo statements before the crypt, and keyArr changes when run with O3, but not when run with O0 |
09:26:47 | PMunch | Okay, moved the pointer dereference from here: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim#L256 to here: https://github.com/PMunch/libkeepass/blob/master/src/libkeepass.nim#L211 and now it works fine with -d:release as well.. |
09:27:46 | PMunch | Oh well, off to lunch now. If anyone has any idea what causes this (Is it even a Nim bug? Codegen bug?) please ping me |
09:27:57 | Zevv | narimiran: "broken"? |
09:28:15 | Zevv | does it complain? Clean your nimblecache? |
09:29:45 | narimiran | Zevv: here is the output, it is the same/similar with different packages: http://ix.io/1TvM |
09:34:09 | narimiran | here is what is in /tmp/....: 1. blake2.ini: http://ix.io/1TvN ; 2. blake2.nims: http://ix.io/1TvO |
09:34:52 | Zevv | yeah I got just that one |
09:35:04 | Zevv | ./koch --latest nimble |
09:35:14 | Zevv | or update your koch and rebuild koch manually |
09:37:08 | narimiran | yep, i needed to update `koch` before running `koch nimble`. thanks! |
09:37:56 | Zevv | the root cause is warnings about unused imports. If you have a nimble file without custom targets, strutils is imported and not used, and the 'nim e' error message ends up in the .ini file in the nimble cache. |
09:58:29 | leorize | I wouldn't want to know how that's implemented |
10:12:28 | * | fjellfras quit (Quit: Leaving) |
10:13:58 | FromGitter | <alehander42> what's new these days in nim |
10:14:16 | narimiran | unused imports warning :) |
10:16:50 | Zevv | unused import warnings *everywhere* :) |
10:20:13 | FromGitter | <alehander42> i am just trying to get rid of |
10:20:14 | FromGitter | <alehander42> XDeclaredButNotUsed |
10:20:18 | FromGitter | <alehander42> warnings |
10:20:26 | FromGitter | <alehander42> but for some autogenerated stuff by a serialization |
10:20:31 | FromGitter | <alehander42> what was the switch : ) |
10:21:25 | FromGitter | <alehander42> --hint[XDeclaredButNotUsed]:off |
10:21:26 | FromGitter | <alehander42> ok |
10:21:55 | FromGitter | <alehander42> so if we pass a similar switch, does this fix the import thing |
10:22:06 | FromGitter | <alehander42> or do you want to still see the "actual" unused ones :P |
10:22:39 | narimiran | i like this new feature, i cleaned up some of my code. and the same happened in lots of places in stdlib |
10:25:00 | * | lritter joined #nim |
10:32:38 | dom96 | I feel like having this many ways to install Nimble is doing us a disservice |
10:33:03 | dom96 | at the very least, koch needing to be recompiled for this thing is non-intuitive so it might be a good idea to move the Nimble version it installs to a text file or something |
10:35:32 | * | owl_000 quit (Quit: Leaving) |
10:44:32 | leorize | @alehander42: you can always tag your auto generated stuff with {.used.} :P |
10:44:49 | leorize | hmm, does that pragma also work for modules? |
10:45:23 | * | laaron quit (Remote host closed the connection) |
10:48:33 | * | laaron joined #nim |
10:50:32 | FromGitter | <alehander42> leorize, hm, nice |
10:50:34 | FromGitter | <alehander42> thank you |
10:59:09 | * | floppydh joined #nim |
11:08:45 | dom96 | hm, is it a holiday in Germany today too? |
11:09:25 | FromGitter | <Vindaar> nope |
11:12:38 | dom96 | Haven't seen Araq in a while |
11:12:52 | narimiran | he said he'll be here later today |
11:14:26 | livcd | dom96: he is stuck reading Gordon's posts |
11:14:34 | narimiran | lol |
11:15:25 | * | JustASlacker joined #nim |
11:18:19 | livcd | But I also want to retire to Thailand like Gordon |
11:20:06 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
11:26:50 | * | laaron quit (Remote host closed the connection) |
11:28:31 | * | laaron joined #nim |
11:32:04 | FromGitter | <mratsim> @alehander42 there are a couple of XDeclaredButNotUsed issue on the tracker (including the main one that has been closed by workaround) |
11:33:31 | FromGitter | <mratsim> see and linked issues: https://github.com/nim-lang/Nim/issues/4044 |
11:34:14 | FromGitter | <mratsim> and https://github.com/nim-lang/Nim/issues/11826 |
11:35:42 | * | owl_000 joined #nim |
11:36:09 | owl_000 | is it possible to store value e.g.float in enum variants |
11:39:37 | FromGitter | <alehander42> but does |
11:39:39 | FromGitter | <alehander42> hint and warning |
11:39:43 | FromGitter | <alehander42> do the same ? @mratsim |
11:39:48 | FromGitter | <alehander42> i use --hint |
11:40:18 | FromGitter | <mratsim> @owl_000 yes: https://nim-lang.org/docs/manual.html#types-object-variants |
11:40:45 | FromGitter | <mratsim> @alehander42 I suppose they are implemented the same way |
11:41:16 | FromGitter | <alehander42> i think owl means |
11:41:25 | FromGitter | <alehander42> enum A = 0.1 B = 0.2 etc # pseudo |
11:41:36 | FromGitter | <alehander42> i think this was possible with strings .. |
11:44:14 | owl_000 | yes, only string can be stored in enum, if i write like this, 'value=2' it becomes ord, it can be printed by echo ord(value) |
11:44:18 | FromGitter | <alehander42> sorry @mratsim your suggestion is really better for @owl_000 imo |
11:44:39 | FromGitter | <alehander42> using variants would be probably better as one needs more stuff |
11:44:41 | FromGitter | <alehander42> anyway |
11:44:46 | FromGitter | <alehander42> otherwise one can do https://forum.nim-lang.org/t/110 |
11:44:50 | FromGitter | <alehander42> yeah |
11:45:00 | FromGitter | <alehander42> but it seems its only possible with string |
11:45:28 | FromGitter | <alehander42> but i wouldnt use that for float |
11:45:52 | FromGitter | <alehander42> whats your usecase owl_000 |
11:46:05 | FromGitter | <alehander42> @mratsim yeah, they probably work the same with the pragma? |
11:46:39 | FromGitter | <mratsim> yes I think so |
11:57:11 | owl_000 | docs/manual.html#types-object-variants is difficult one, i will look it later, after learning some more. i am in 'tut1 enumerations'. the description is tiny, it should be brief. |
12:03:04 | FromGitter | <alehander42> in some cases where enums dont fit, one can simply use several const-s |
12:08:30 | * | dddddd joined #nim |
12:10:22 | * | alexander92 joined #nim |
12:10:36 | PMunch | Or an array enumerated by an enum :) |
12:10:55 | PMunch | And possibly write a little helper macro to populate it |
12:11:25 | PMunch | Like what I did here: https://peterme.net/metaprogramming-and-read-and-maintainability-in-nim.html |
12:11:38 | * | theelous3 joined #nim |
12:15:20 | * | Kaivo joined #nim |
12:21:51 | dom96 | This was a fun one https://github.com/nim-lang/Nim/issues/12052 |
12:24:33 | * | fjellfras joined #nim |
12:24:47 | livcd | dom96: cg @ your promotion |
12:25:01 | dom96 | thanks |
12:27:46 | * | sealmove joined #nim |
12:28:07 | sealmove | hey, would it be interesting to add Nim support for https://kaitai.io/ ? |
12:29:33 | * | rockcavera joined #nim |
13:08:14 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
13:09:14 | FromGitter | <Vindaar> would someone with mod privileges in the forum be so kind to activate my account? :) https://forum.nim-lang.org/profile/Vindaar |
13:09:35 | * | laaron joined #nim |
13:12:37 | narimiran | done |
13:13:19 | FromGitter | <Vindaar> sweet, thanks! |
13:21:17 | * | shomodj joined #nim |
13:31:30 | krux02 | sealmove: there is also Protobuf and Capt'n proto. The list of binary format declaration languages is long. |
13:33:03 | * | JustASlacker quit (Ping timeout: 264 seconds) |
13:35:11 | * | abm joined #nim |
13:39:46 | * | JustASlacker joined #nim |
13:54:13 | owl_000 | https://play.nim-lang.org/#ix=1TwA what is the solution? or is it possible to return two different types? |
13:56:33 | leorize | see the options module |
13:57:31 | FromGitter | <iffy> I'm making a Nim library that is called from NodeJS. Node will often call the Nim code in one or more threads. What do I need to do within Nim to handle being called in that way? I'm already using `--gc:regions`. Do I need to enable `--threads:on`? Is there other setup code I need to call at the beginning of each thread? |
13:57:32 | narimiran | yeah, options are probably the way to go. poor man's solution might be to return a tuple `(isValid: bool, value: int)` |
13:58:15 | leorize | @iffy: just add `--threads:on` :P just in case |
13:58:24 | leorize | are you using gc:regions correctly though? |
13:58:36 | FromGitter | <iffy> hehe, probably not |
13:58:52 | FromGitter | <iffy> when I add `--threads:on` my test program actually crashes |
13:58:59 | leorize | switch to devel then embrace --newruntime :P |
13:59:09 | FromGitter | <iffy> well... |
13:59:44 | Araq | iffy you need setupForeignThreadGc |
13:59:54 | FromGitter | <iffy> I have already released a version to users that is using `--gc:regions` that works without problems. It doesn't do anything asychronous/threaded, but I'd like to start doing some |
14:00:23 | FromGitter | <iffy> Araq: is that safe to call multiple times from the same thread? |
14:00:45 | Araq | yes |
14:00:58 | dom96 | Araq, hey! I've fixed the memory problems I was having. I reported two bugs which I was able to reproduce (to a certain extent): https://github.com/nim-lang/Nim/issues/12045 https://github.com/nim-lang/Nim/issues/12052. The former is IMO quite important to fix, I had to do some really annoying workarounds to get my code to work. |
14:01:05 | leorize | @iffy if you "use" gc:regions as in just passing "--gc:regions" then it's gonna be the same as "--gc:none"... |
14:01:23 | dom96 | Araq, oh, sorry, actually I've got three issues. This one is the one that is the most important to fix: https://github.com/nim-lang/Nim/issues/12042 |
14:01:35 | FromGitter | <iffy> leorize: oh rats, so I have to explicitly use withRegion? |
14:01:44 | Araq | dom96, ok, well |
14:01:45 | FromGitter | <iffy> I thought there was a default region |
14:01:47 | Araq | can't be hard to fix |
14:02:19 | dom96 | Araq, yeah, that one should be easy for someone that's familiar with the compiler |
14:02:21 | leorize | you have to deallocate regions manually |
14:02:27 | leorize | it's not automatically collected |
14:02:41 | dom96 | it will make working with openarrays much easier |
14:02:46 | * | endragor quit (Remote host closed the connection) |
14:02:46 | leorize | and it's easier to do so with a MemRegion |
14:03:22 | dom96 | there is also some weird behaviour with `set` and memory usage |
14:03:50 | * | endragor joined #nim |
14:04:13 | FromGitter | <iffy> so shall I used `--gc:regions`, `--threads:on`, and `setupForeignThreadGc`? Or some other combination? |
14:04:30 | FromGitter | <iffy> regions was recommended as ideal for a library |
14:06:02 | * | PMunch quit (Remote host closed the connection) |
14:07:17 | leorize | if you're ready you can use --newruntime :P |
14:08:00 | FromGitter | <iffy> Is --newruntime ready for me? |
14:08:04 | FromGitter | <iffy> (also, is it documented?) |
14:10:54 | leorize | https://github.com/nim-lang/Nim/blob/devel/doc/destructors.rst |
14:11:43 | * | sentreen quit (Quit: sentreen) |
14:15:25 | * | sentreen joined #nim |
14:16:16 | * | endragor quit (Remote host closed the connection) |
14:17:00 | sealmove | krux02: Which method for declaring binary formats would you recommend? |
14:19:34 | * | endragor joined #nim |
14:23:47 | * | endragor quit (Ping timeout: 245 seconds) |
14:31:16 | FromGitter | <iffy> leorize: that looks great, though I'm hesitant to base a production product on it since it's still experimental |
14:31:47 | leorize | well gc:regions is even more experimental |
14:32:10 | leorize | it's not actively maintained nor used afaict |
14:34:01 | * | solitudesf- quit (Remote host closed the connection) |
14:34:15 | * | solitudesf- joined #nim |
14:38:18 | FromGitter | <iffy> and now I know it's effectively "gc:none" as I'm using it, I need to reevaluate. |
14:43:19 | krux02 | sealmove: I would write a macro that does binary serialization in Nim only. I did that in the past, it gives me the control I need plus the automation I want. |
14:46:00 | sealmove | But serialization is not the only use-case. My use-case is parsing existing formats like the Windows Registry. Making a macro for this feels like re-inventing the wheel, and it would be limited to Nim (theoretically bad, althought I don't mind atm) |
14:55:37 | FromDiscord_ | <Shield> "Objects that contain pointers that point to the same object are not supported by Nim's model." |
14:55:47 | FromDiscord_ | <Shield> what are the implications of this? |
14:56:11 | FromGitter | <iffy> If I distribute a nim library and include some C header files, how do I include those header files automatically when a user of my nim package compiles their program? |
15:02:55 | * | solitudesf- quit (Ping timeout: 246 seconds) |
15:04:10 | * | JustASlacker quit (Remote host closed the connection) |
15:05:03 | * | laaron quit (Quit: ZNC 1.7.1 - https://znc.in) |
15:05:59 | * | laaron joined #nim |
15:11:30 | FromGitter | <mratsim> @sealmove, kaitai looks similar to NESM https://gitlab.com/xomachine/NESM |
15:12:25 | FromGitter | <mratsim> @iffy, like this: https://github.com/mratsim/weave/blob/51401d137df36b7f12ad8b6a8092708791e21c83/benchmarks/wtime.nim#L2-L8 |
15:15:46 | sealmove | mratsim: interesting, but I think this goes beyond serialization needs. Working with existing format is different than serializing data (making your own, as-simple-as-possible, format). |
15:19:10 | * | laaron quit (Remote host closed the connection) |
15:21:09 | * | laaron joined #nim |
15:25:01 | FromGitter | <mratsim> kaitai seems to be like a yaml description of a file. Similar to how nesm types would be defined |
15:25:47 | FromGitter | <mratsim> so if you could parse .ksy at compile-time, you could create the Nim type corresponding to the .ksy, and use NESM for the serialization/deserialization part |
15:26:03 | FromGitter | <mratsim> (but maybe I'm just looking too far ahead :P) |
15:30:55 | * | endragor joined #nim |
15:32:55 | sealmove | not yet sure, but I suspect .ksy has capabilities which can't be encapsulated into a Nim type. |
15:33:37 | * | owl joined #nim |
15:36:41 | * | owl_000 quit (Ping timeout: 250 seconds) |
15:37:13 | sealmove | or at the very least, parsing .ksy and creating Nim types for complex formats could be *very* involved |
15:39:46 | * | laaron quit (Remote host closed the connection) |
15:41:54 | * | laaron joined #nim |
15:42:31 | lqdev[m] | I'm getting a weird `The futex facility returned an unexpected error code.` error on glfwTerminate(), any ideas why it might be happening? this is the problematic line: https://github.com/liquid600pgm/rapid/blob/master/src/rapid/gfx/window.nim#L42 |
15:43:04 | lqdev[m] | I'm pretty sure this is an error with my GLFW wrapper, though I can't tell what's the problem. |
15:43:39 | sealmove | examples: variable-length structures, fields which exist only if a condition is met, repeating patterns as padding, and so on |
15:51:55 | FromGitter | <mratsim> @lqdev: did you perhaps take a lock that you didn't release or something |
15:52:03 | FromGitter | <mratsim> a futex is a linux low-level lock |
15:52:17 | lqdev[m] | @mratsim I don't use locks in my program |
15:53:16 | * | darithorn joined #nim |
15:53:30 | FromGitter | <mratsim> maybe you forgot to dispose/release/destroy a GLFW resource that takes a lock then? |
15:54:11 | lqdev[m] | I don't think so, glfwTerminate is supposed to dispose of all resources by itself |
15:55:32 | lqdev[m] | also, this issue only started appearing on recent Mesa drivers (19.1.3) |
15:55:53 | * | sentreen quit (Ping timeout: 245 seconds) |
16:00:01 | * | owl_000 joined #nim |
16:02:57 | * | owl quit (Ping timeout: 245 seconds) |
16:04:16 | FromGitter | <mratsim> well no idea then. whip-up gdb, take a deep breath and dive |
16:09:03 | * | fjellfras quit (Quit: Leaving) |
16:09:39 | * | sentreen joined #nim |
16:11:04 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
16:13:48 | lqdev[m] | aah, never thought about using gdb lol |
16:14:09 | lqdev[m] | I debug Nim code mostly using echo statements XD |
16:15:18 | FromGitter | <mratsim> I don't know how you can survive low-level dev without gdb/lldb |
16:20:06 | * | sz0 joined #nim |
16:21:57 | * | a_b_m joined #nim |
16:23:47 | * | rayman22201 joined #nim |
16:25:03 | * | abm quit (Ping timeout: 245 seconds) |
16:30:27 | * | endragor quit (Remote host closed the connection) |
16:31:26 | * | actuallybatman joined #nim |
16:33:38 | FromGitter | <alehander42> make sure to import e.g. source nim-gdb.py |
16:33:44 | FromGitter | <alehander42> from tools in the compiler |
16:47:17 | * | owl_000 quit (Quit: Leaving) |
16:52:29 | * | vlad1777d quit (Remote host closed the connection) |
16:55:02 | * | vlad1777d joined #nim |
17:03:21 | * | sentreen quit (Quit: sentreen) |
17:06:51 | * | sentreen joined #nim |
17:08:06 | * | theelous3 quit (Ping timeout: 244 seconds) |
17:11:51 | leorize | living with exceptions is hard when you also need to not scare users... |
17:12:05 | leorize | how do you all deal with exceptions in CLI apps? |
17:12:28 | leorize | do you just throw it and use that as error message, or you handle it then pretty print something for the user? |
17:13:12 | alexander92 | i am not sure i ever did something in nim focused on non-programmers |
17:13:36 | leorize | not necessary to be restricted to Nim |
17:14:40 | disruptek | i figure the user has a much better idea of what to do than i do. |
17:24:51 | FromDiscord_ | <DeltaPHC> Re: debugging. One small thing that would help a lot, that I've seen in some other languages, is a `dbg(x)` proc or macro that echos the value of the expression, along with the source file and line number and junk, while *also* returning that expression at that position |
17:25:39 | FromDiscord_ | <DeltaPHC> That way, you can just attach `dbg(...)` to an existing expression and it'll work just the same, except you'll also get debug info |
17:26:29 | FromDiscord_ | <DeltaPHC> just as a tool you can use temporarily, not something that stays in your code |
17:27:11 | FromGitter | <iffy> @mratsim thank you! |
17:28:04 | * | sentreen quit (Ping timeout: 248 seconds) |
17:31:10 | leorize | @DeltaPHC I believe the same can be replicated by a simple macro |
17:31:14 | * | sentreen joined #nim |
17:32:48 | FromDiscord_ | <DeltaPHC> Oh I know. I'm just suggesting it as something that could be in the standard lib, since it could be widely useful |
17:33:07 | FromDiscord_ | <DeltaPHC> enhanced print-debugging, heh |
17:34:13 | FromGitter | <alehander42> you're right |
17:34:18 | FromGitter | <alehander42> `debug` in sugar.nim |
17:34:19 | FromGitter | <alehander42> is similar |
17:34:38 | FromGitter | <alehander42> but not the same: you can write one yourself, using instantiationInfo |
17:34:51 | FromGitter | <alehander42> you can also use a full logging lib https://github.com/status-im/nim-chronicles/ |
17:35:13 | FromGitter | <alehander42> but it uses a bit different approach |
17:35:40 | FromDiscord_ | <DeltaPHC> I know that logging libs exist. I'm more suggesting a lighter-weight thing |
17:35:43 | FromGitter | <zacharycarter> would this be the correct way to handle this C Array? |
17:35:55 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d64187bf2821072aa1a9a4a] |
17:36:16 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d6418909b381b084ffb44c7] |
17:36:41 | FromGitter | <zacharycarter> and then - ⏎ ⏎ ```smap[2 * (i + w * j)] = ...;``` [https://gitter.im/nim-lang/Nim?at=5d6418a9a080d70ab585f442] |
17:36:59 | FromGitter | <zacharycarter> ```smap[2 * (i + w * j)] = ...``` |
17:37:15 | FromGitter | <zacharycarter> first code block = C++ |
17:37:15 | FromGitter | <zacharycarter> second = Nim |
17:37:19 | FromGitter | <zacharycarter> in both set of code blocks |
17:37:47 | FromGitter | <zacharycarter> I'm mostly concerned about the c array of floats and the Nim unchecked array of float32s |
17:38:09 | FromGitter | <mratsim> the mem[] can be implicit |
17:38:17 | FromGitter | <mratsim> mem.data will auto deref |
17:38:42 | FromGitter | <mratsim> otherwise that seems ok |
17:38:54 | FromGitter | <zacharycarter> gotcha, thanks! |
17:39:26 | FromGitter | <zacharycarter> bleh - I have no idea where my terrain example port is going bonkers |
17:39:40 | FromGitter | <zacharycarter> I guess I will go to sleep early and try to use my brain when it's fresh in the morning to figure it out |
17:39:42 | FromGitter | <zacharycarter> so very close... |
17:39:59 | FromGitter | <mratsim> you can check against my malloc implementation: https://github.com/mratsim/weave/blob/master/e04_channel_based_work_stealing/primitives/c.nim#L18-L27 |
17:40:40 | FromGitter | <zacharycarter> thanks - I'll give that a slot |
17:40:43 | FromGitter | <zacharycarter> shot* |
17:50:17 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
17:52:02 | * | actuallybatman quit (Ping timeout: 258 seconds) |
17:52:21 | * | actuallybatman joined #nim |
17:53:30 | * | solitudesf- joined #nim |
17:53:59 | leorize | narimiran, Zevv, disruptek: more nim.nvim refactoring is up for testing in the 'refactoring' branch |
17:54:22 | leorize | also, how has the refactored version work for everyone? :) |
17:54:31 | narimiran | is there something specific we should test? |
17:54:47 | * | ng0 joined #nim |
17:55:00 | leorize | well test everything :P |
17:55:06 | leorize | I've just rewritten the querying code |
17:55:25 | leorize | so every nimsuggest-based tasks should be tested |
17:57:14 | leorize | the refactoring added about 153 LoC though :P |
17:57:19 | leorize | most of which are docs |
17:57:44 | narimiran | documenting your own code? you're getting old.... |
17:58:52 | leorize | well I can do nim without docs |
17:59:00 | * | Trustable joined #nim |
17:59:03 | leorize | but vimscript... no, just no |
18:00:49 | leorize | also, does anyone notice any perf changes? |
18:01:17 | leorize | in theory things should be faster now, but most of the time spent is in nimsuggest anyway :P |
18:01:57 | narimiran | for me it was already fast enough, but i'll see if i can spot any differences |
18:02:35 | disruptek | feels the same to me, but i'm on a fairly quick machine. |
18:03:45 | leorize | well perf isn't the main point of the refactoring anyway |
18:03:57 | leorize | what everyone should see now is less vim errors popping up |
18:04:04 | disruptek | sure; it doesn't seem slower, if that helps. 😉 |
18:04:08 | leorize | I've cut all TOCTOU bugs in the code |
18:04:50 | disruptek | you've cut all... what? |
18:05:09 | leorize | "time of check, time of use" bugs |
18:06:33 | leorize | the plugin used to check for several constraints that might change during execution |
18:07:08 | * | ng0 quit (Write error: Connection reset by peer) |
18:07:08 | * | leorize quit (Read error: Connection reset by peer) |
18:07:08 | * | laaron quit (Read error: Connection reset by peer) |
18:08:34 | * | laaron joined #nim |
18:08:41 | disruptek | cool. |
18:11:33 | leorize[m] | also, Zevv, I've written enough docs on how each part works for you to try adding vim8 support :p |
18:13:20 | Zevv | who me? No, I use neovim, not vim8! |
18:16:19 | * | ng0 joined #nim |
18:17:25 | leorize[m] | I thought you complained about how I forced you to maintain config for both vims :p |
18:20:13 | Zevv | yeah, that's nasty |
18:21:26 | lqdev[m] | is there a fuzzy search for nim? |
18:21:56 | leorize[m] | fuzzy search? |
18:24:32 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
18:24:44 | alexander92 | i think the sublime algorithm |
18:24:55 | alexander92 | was explained or open sourced somewhere |
18:25:00 | lqdev[m] | yeah, I mean like when you type `ot` into your IDE it will show you `OrderedTable` or something |
18:25:04 | * | ng0 joined #nim |
18:25:56 | alexander92 | i've written one similar function in my code a long time ago, but i dont think i use it .. no idea if it works well |
18:27:01 | alexander92 | ix.io/1Tyc/nim |
18:27:44 | lqdev[m] | just noticed shashlick has a fts_fuzzy_match wrapper |
18:27:44 | alexander92 | https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/ probably a better resource |
18:28:09 | lqdev[m] | but I wanted a pure Nim implementation |
18:28:49 | * | leorize joined #nim |
18:31:22 | lqdev[m] | meh, fts_fuzzy_match is written in C++ |
18:31:28 | * | narimiran_ joined #nim |
18:31:34 | lqdev[m] | I'm going to port it over to Nim |
18:32:21 | * | sentreen quit (Quit: sentreen) |
18:33:01 | * | rayman22201 quit (Quit: Connection closed for inactivity) |
18:33:02 | Araq | +1 |
18:33:31 | shashlick | @lqdev |
18:33:33 | alexander92 | i was in a discussion in the zig channel about imposibillity ruby's dsl autocompletion |
18:33:35 | shashlick | I use it in feud |
18:33:38 | shashlick | Works great |
18:33:44 | alexander92 | so i thought about this : isnt it possible for nim macro dsl-s |
18:33:48 | * | narimiran quit (Ping timeout: 245 seconds) |
18:33:51 | alexander92 | to have good advanced autocompletion |
18:34:16 | shashlick | https://github.com/genotrance/feud/blob/master/wrappers/fuzzy.nim |
18:34:18 | alexander92 | e.g. if you use expectKind / or ast_pattern_matching on your input, or even some helper "suggest" procs |
18:34:23 | shashlick | Uses nimterop and c2nim |
18:34:32 | alexander92 | you can generate suggestions inside it |
18:34:50 | alexander92 | hypothetically |
18:35:00 | Araq | alexander92, it is possible and not even that hard |
18:35:18 | shashlick | @lqdev what in your use case requires pure Nim |
18:35:29 | shashlick | Also, someone else had written some fuzzy find in Nim |
18:35:43 | Araq | alexander92, tested the new karax? |
18:35:46 | alexander92 | is this something that should also be in nimsuggest |
18:36:29 | alexander92 | Araq, ok, just writing my todo task list: i am putting new karax in |
18:37:26 | FromGitter | <brentp> is there standard code somewhere to access an UncheckArray? e.g. with int, HSlice, etc? |
18:37:57 | Araq | brentp: you access it via [], like any other array |
18:38:09 | lqdev[m] | @shashlick nothing really, it's just my preference. I don't want to use C++ because C is the default, more stable option |
18:38:34 | shashlick | Well why does it matter if you are only using the lib |
18:39:42 | alexander92 | lqdev, shashlick is doing all this work on wrapping all the C/C++ he can find ! |
18:39:42 | shashlick | You don't need `nim cpp` for your whole app to use a c++ library |
18:40:05 | lqdev[m] | shashlick: what do I need then? |
18:40:08 | alexander92 | kidding, but really, i agree we should reuse c/cpp libs |
18:41:07 | FromGitter | <brentp> @Araq. seems to allow integer acess via `[]`, but not slicing. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d6427c39b381b084ffbb46a] |
18:41:19 | shashlick | Well, at least in feud I do use cpp for the plugin that uses fuzzy |
18:41:36 | shashlick | But you can just link with cpp mode and leave compile as is |
18:41:54 | * | wildtrees joined #nim |
18:42:05 | shashlick | See https://github.com/nimterop/nimterop/blob/master/config.nims |
18:42:17 | * | sentreen joined #nim |
18:42:44 | Zevv | isnt there a fuzzy mach in dochack? |
18:43:01 | Zevv | tools/dochack/fuzzysearch.nim |
18:45:23 | Araq | so ... don't slice? how can you slice it anyway... slicing usually allocates |
18:45:39 | * | floppydh quit (Quit: WeeChat 2.5) |
18:46:20 | * | clyybber joined #nim |
18:48:06 | FromGitter | <brentp> fair enough |
18:50:29 | shashlick | @Araq curious what's your feedback on https://github.com/nimterop/nimterop/blob/v020/nimterop/build.nim#L498 |
18:51:54 | Araq | don't have any |
18:52:00 | Araq | bbl |
18:57:56 | * | livcd quit (Changing host) |
18:57:56 | * | livcd joined #nim |
19:04:45 | * | shomodj joined #nim |
19:05:57 | * | shomodj quit (Client Quit) |
19:07:59 | FromGitter | <brentp> how can I tell if bounds-checking is on? |
19:08:42 | disruptek | accessing an oob index prevents compilation. |
19:10:44 | FromGitter | <brentp> `when compileOption("boundChecks")` |
19:18:56 | * | sz0 quit (Quit: Connection closed for inactivity) |
19:22:19 | * | nsf quit (Quit: WeeChat 2.5) |
19:23:41 | * | clyybber quit (Quit: WeeChat 2.5) |
19:25:14 | * | sealmove quit (Quit: WeeChat 2.5) |
19:26:43 | FromGitter | <iffy> How do I avoid this type mismatch error: http://ix.io/1Tys |
19:27:09 | FromGitter | <iffy> I think maybe it's not matching on the proc type? |
19:27:13 | * | a__b__m joined #nim |
19:27:26 | FromGitter | <iffy> hi, @brentp! |
19:27:38 | FromGitter | <iffy> thanks for noticing the argparse failure on devel |
19:28:42 | FromGitter | <brentp> hey Matt. sure! thanks for creating that package. |
19:30:53 | * | a_b_m quit (Ping timeout: 245 seconds) |
19:31:00 | * | sagax quit (Ping timeout: 272 seconds) |
19:33:39 | FromGitter | <brentp> you can use object instead of tuple and then your example works |
19:34:46 | * | clyybber joined #nim |
19:34:57 | clyybber | Araq: https://github.com/nim-lang/Nim/pull/11926 is ready now |
19:35:01 | clyybber | I removed the test |
19:35:26 | * | Ven`` joined #nim |
19:37:40 | * | Ven`` is now known as Ven_de_Thiel |
19:37:44 | FromGitter | <iffy> @brentp do you know why object works and not tuple in that case? |
19:38:10 | FromGitter | <brentp> no idea. but I've hit something similar before. |
19:38:57 | FromGitter | <iffy> From the docs here https://nim-lang.org/docs/tut1.html#advanced-types-tuples I would have thought the opposite (that tuples work and objects don't) |
19:40:04 | * | sagax joined #nim |
19:52:34 | * | devmoses joined #nim |
19:53:44 | * | netsky_ joined #nim |
19:55:52 | * | devmoses left #nim (#nim) |
19:57:33 | * | shomodj joined #nim |
20:02:24 | * | shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:14:48 | * | netsky_ quit (Quit: Leaving) |
20:17:45 | * | a__b__m quit (Quit: Leaving) |
20:22:19 | * | abm joined #nim |
20:26:54 | * | Trustable quit (Remote host closed the connection) |
20:29:49 | * | narimiran_ quit (Ping timeout: 246 seconds) |
20:40:26 | FromDiscord_ | <Kiloneie> Do you guys use Nim to program websites using JS compilation ? |
20:51:29 | FromDiscord_ | <treeform> Yes. I do for work. I get paid to do it 🙂 |
20:53:02 | FromDiscord_ | <treeform> Works great I like it. It feels like a bit like using typescript. |
20:53:27 | FromDiscord_ | <Kiloneie> I will give it a try thanks. |
20:54:29 | FromDiscord_ | <treeform> Modern JS uses some thing like react and angular though. I don't. |
20:54:45 | FromDiscord_ | <treeform> I stick to the classic feel JS mostly. |
20:58:18 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
21:02:47 | * | Vladar quit (Remote host closed the connection) |
21:03:49 | * | ng0 joined #nim |
21:14:49 | * | clyybber quit (Quit: WeeChat 2.5) |
21:16:08 | * | shomodj joined #nim |
21:18:26 | * | Ven_de_Thiel quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:30:29 | * | actuallybatman quit (Quit: leaving) |
21:33:36 | * | shomodj_ joined #nim |
21:35:52 | * | shomodj quit (Ping timeout: 245 seconds) |
21:42:23 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
21:45:04 | * | pbb joined #nim |
21:45:56 | * | gangstacat quit (Quit: Ĝis!) |
21:51:10 | * | abm quit (Quit: Leaving) |
21:51:41 | * | abm joined #nim |
22:12:36 | dom96 | This desperately needs a signal boost: https://forum.nim-lang.org/t/5130 |
22:16:32 | * | actuallybatman joined #nim |
22:17:15 | disruptek | that looks pretty ugly. |
22:19:12 | * | solitudesf- quit (Ping timeout: 245 seconds) |
22:24:22 | dom96 | disruptek, cut that out. Being condescending doesn't help anybody. |
22:24:39 | disruptek | what's condescending about it? |
22:26:04 | FromDiscord_ | <exelotl> it didn't read as condescending to me |
22:26:50 | ldlework | dom96: i think they just meant like 'a nasty bug' |
22:27:01 | disruptek | tbh, i think his reaction is a little extreme -- threatening to divorce the pre-1.0 language from an entire industry -- but i understand his frustration. i've been there. |
22:27:48 | disruptek | this person came from the C world; lotsa yoda ifs. |
22:28:20 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
22:28:27 | dom96 | ldlework, based on what I've seen from them so far I doubt it. But that is indeed another way to interpret it, and if that is what disruptek meant then I apologise. |
22:28:43 | ldlework | dom96: isn't -that- condescending? |
22:29:07 | * | pbb joined #nim |
22:29:21 | disruptek | no harm, no foul. just trying to put more eyes on it. |
22:33:04 | dom96 | ldlework, what's condescending about it? |
22:37:07 | dom96 | There is nothing wrong with trying to keep the chat a welcoming place, especially for someone who's considering leaving the community. |
22:42:36 | FromDiscord_ | <Shield> is it really a threat? |
22:44:35 | FromDiscord_ | <exelotl> Hey so, is it ok to have a generic type Foo[T] in Nim, where T is not actually used anywhere in the type definition? |
22:45:02 | FromGitter | <mratsim> @dom96 issue fixed ;) |
22:45:24 | FromGitter | <mratsim> I agree with disruptek, ugly bug |
22:45:53 | dom96 | mratsim: <3 |
22:46:17 | FromGitter | <mratsim> This one is ugly too :/ https://forum.nim-lang.org/t/5124 |
22:46:26 | disruptek | i'm playing with the code and it's not making a lot of sense to me. |
22:46:55 | FromGitter | <mratsim> because he was desperate and added echo everywhere |
22:47:01 | FromGitter | <mratsim> the fix is there: https://github.com/pb-cdunn/nim-help/pull/1 |
22:47:03 | ldlework | dom96: "based on what I've seen from them so far" is the obvious condescension :P |
22:47:04 | FromGitter | <mratsim> 1 LOC |
22:47:22 | FromGitter | <mratsim> change ref Db return type to Db and it magically work |
22:47:42 | ldlework | dom96: oh you were talking about the guy in the thread, no disruptek heh total misread there |
22:47:45 | * | ldlework jumps out of a window. |
22:48:09 | FromDiscord_ | <exelotl> Basically I have an object with a byte array inside, where the byte array is cast to a different type depending on the specialisation of the object |
22:48:11 | FromGitter | <mratsim> seems like there is a bug when returning a ref type (that was not defined as type Foo = ref object / ref Bar) |
22:48:19 | FromDiscord_ | <exelotl> like this: https://gist.github.com/exelotl/09c7fb07ae08d97aa9738d63b960bacc |
22:49:03 | FromGitter | <mratsim> @exelotl do you have a question? |
22:49:33 | FromDiscord_ | <exelotl> is it ok to use generics like that? |
22:50:02 | FromGitter | <mratsim> yes |
22:50:09 | FromGitter | <mratsim> that's how Nim channels are implemented |
22:50:16 | FromDiscord_ | <exelotl> oh sweet, cool :D |
22:50:45 | FromGitter | <mratsim> https://github.com/nim-lang/Nim/blob/devel/lib/system/channels.nim#L39 |
22:51:53 | disruptek | i'm reading your PR but it doesn't answer any of my questions. o.O |
22:52:14 | FromGitter | <mratsim> well I didn't try to understand the code, only the bug :P |
22:52:24 | FromGitter | <mratsim> I have no idea what the code is doing :P |
22:53:48 | FromDiscord_ | <DeltaPHC> What's the difference between `ptr` and `pointer`? |
22:54:26 | disruptek | i meant, i don't understand the bug. :-D |
22:54:32 | FromGitter | <mratsim> pointer is type erased, ptr needs a type like ptr int32, ptr char or ptr MyContext_t |
22:54:50 | FromDiscord_ | <DeltaPHC> Ah, I kinda figured it would be something like that |
22:54:51 | FromGitter | <mratsim> if you know C, pointer is quivalent to "void *" |
22:55:16 | FromGitter | <mratsim> a pointer parameter accepts both pointer and ptr T |
22:55:17 | FromDiscord_ | <DeltaPHC> But then it seems like you can also use `ptr` like a typeclass, lol |
22:55:49 | FromGitter | <mratsim> yes, you can do "when T is ptr or pointer: foo()" if you want |
22:56:04 | FromDiscord_ | <DeltaPHC> Only slightly confusing, but I get it |
22:56:32 | * | lritter quit (Quit: Leaving) |
22:56:52 | * | gangstacat joined #nim |
22:58:08 | FromDiscord_ | <DeltaPHC> So, to sum up: |
22:58:08 | FromDiscord_ | <DeltaPHC> `ptr T` --> a pointer to T |
22:58:08 | FromDiscord_ | <DeltaPHC> `ptr` --> a typeclass accepting any `ptr T` |
22:58:09 | FromDiscord_ | <DeltaPHC> `pointer` --> a physical type kinda like a void pointer in C. Any `ptr` can be implicitly converted to this |
22:58:53 | FromGitter | <mratsim> yep |
22:59:29 | FromDiscord_ | <exelotl> mratsim: what happens with channels if your type is bigger than pbytes.len? |
23:00:42 | FromDiscord_ | <Shield> I don't quite understand why you need T in Actor*[T] = ptr ActorObj |
23:01:22 | FromGitter | <mratsim> it's to more easily convert data |
23:01:31 | FromGitter | <mratsim> and to have type checking in the high level API |
23:01:47 | FromDiscord_ | <exelotl> yeah, that ^ |
23:02:05 | FromGitter | <mratsim> I expect it crashes with IndexError @exelotl (or worse it truncates) |
23:02:53 | FromGitter | <mratsim> also if you really have a lot of data to transfer, you should just copy the pointer to the data and transfer ownership |
23:03:16 | FromGitter | <mratsim> but some compiler help would be nice for ownership transfer |
23:03:18 | FromDiscord_ | <Shield> interesting, didn't know type checking still happens even if you don't use that type within the object |
23:03:44 | FromDiscord_ | <exelotl> @Shield yeah me neither, that's why I wanted to check here before I settled on this design xD |
23:03:44 | FromDiscord_ | <DeltaPHC> I'm still pretty new to Nim, but its type system is certainly deeper than my initial impressions. (that's a good thing IMO) |
23:07:32 | FromDiscord_ | <DeltaPHC> Nim even has const generics. Rust isn't quite there :B |
23:11:05 | FromDiscord_ | <exelotl> there's one main thing I've struggled with in my Nim GBA efforts so far, which is that Nim doesn't really have a good way to get a pointer to some constant data |
23:13:04 | FromDiscord_ | <exelotl> since 'const' in Nim is strictly a compile-time constant, and while 'let' is immutable it doesn't lead to consts in the generated C code |
23:17:56 | FromDiscord_ | <exelotl> I have to work around it by either (a) using `emit` to produce C consts and then importing them back into Nim or (b) importing the C '&' operator and using it with some dangerous assumptions about what will happen when I do &myNimConst |
23:26:45 | * | shomodj_ quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
23:46:53 | * | krux02 quit (Remote host closed the connection) |