00:01:19 | FromDiscord | <Elegantbeef> Here is fine |
00:07:19 | * | lucasta joined #nim |
00:08:02 | FromDiscord | <umi_l> sent a code paste, see https://play.nim-lang.org/#pasty=cCwNZOEt |
00:08:23 | FromDiscord | <Elegantbeef> `value: sink ShaderParam` |
00:09:03 | FromDiscord | <Elegantbeef> One of your types has `=dup` errored so you can either use `ref` for that type take `ShaderParam` as a sink or make `ShaderParam` a ref |
00:12:46 | FromDiscord | <umi_l> From what I understand this implies giving ownership to the proc? (reading: https://nim-lang.org/docs/destructors.html#sink-parameters) |
00:13:22 | FromDiscord | <Elegantbeef> correct it allows you to take ownership of the parameter inside, disarming the destructor |
01:21:29 | FromDiscord | <.tokyovigilante> Is there any way to wrap a C function like `va_start`? Apparently C23 says you can drop the second (type) param but Musl doesn't seem to have caught up |
01:21:58 | FromDiscord | <.tokyovigilante> `#define va_start(v,l) builtin_va_start(v,l)` |
01:24:07 | FromDiscord | <.tokyovigilante> Actual musl seems to have (`48:#define va_start(v, ...) builtin_va_start(v, 0)`) but Nim doesn't like it |
01:24:27 | FromDiscord | <.tokyovigilante> `proc va_start(ap: va_list) {.cdecl, importc, header: "<stdarg.h>"}` |
01:25:02 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=rvGEAmrl |
02:00:34 | FromDiscord | <nervecenter> If it's just a define then make your Nim FFI proc call the same thing the define does |
02:11:05 | FromDiscord | <.tokyovigilante> Ta, the issue is that the second param (l) is an arbitrary type, although maybe a null would work? |
02:21:59 | FromDiscord | <demotomohiro> In reply to @.tokyovigilante "Is there any way": How `va_start` works with Nim?↵https://en.cppreference.com/w/c/variadic/va_start↵https://play.nim-lang.org/#pasty=mSdmrMPO↵Nim has to generate C function with the variable arguments to use `va_start` but how to do that? |
02:40:17 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=gVCURzzp |
02:40:26 | FromDiscord | <.tokyovigilante> it should work, but doesn't in practice. |
02:47:30 | FromDiscord | <.tokyovigilante> actually maybe I need `args.addr` rather than `args` (ie `ptr va_list`) |
02:51:09 | * | lucasta quit (Quit: Leaving) |
02:53:03 | FromDiscord | <.tokyovigilante> nope, that didn't help. Getting a crash when I subsequently call vsnprintf - |
02:54:13 | FromDiscord | <.tokyovigilante> sent a code paste, see https://play.nim-lang.org/#pasty=lDPvTwer |
03:16:25 | * | rockcavera quit (Remote host closed the connection) |
03:34:20 | * | strogon14 quit (Ping timeout: 255 seconds) |
03:35:19 | FromDiscord | <demotomohiro> In reply to @.tokyovigilante "actually maybe I need": https://play.nim-lang.org/#pasty=RexQbLVK↵It seems you cannot use `va_arg` unless you can pass type name to it. |
03:43:38 | FromDiscord | <.tokyovigilante> In reply to @demotomohiro "https://play.nim-lang.org/#pasty=RexQbLVK It seems ": Thanks, I don’t need `va_arg` as I am using `vsnprintf` to write the varargs to a string, but the pointer to the list doesn’t seem to work for me. |
03:44:15 | * | strogon14 joined #nim |
03:47:59 | FromDiscord | <demotomohiro> In reply to @.tokyovigilante "Thanks, I don’t need": It seems `vsnprintf` doesn't take pointer to `va_list`, just takes `va_list`.↵https://en.cppreference.com/w/c/io/vfprintf |
04:09:44 | FromDiscord | <.tokyovigilante> Sorry yup I am passing the list directly, not a pointer |
07:23:22 | * | cornfeedhobo quit (Ping timeout: 252 seconds) |
07:26:30 | * | coldfeet joined #nim |
07:32:03 | * | cornfeedhobo joined #nim |
07:40:07 | * | fallback quit (Quit: IRCNow and Forever!) |
07:51:21 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
07:51:47 | * | SchweinDeBurg joined #nim |
08:04:22 | * | fallback joined #nim |
08:21:43 | * | kenran joined #nim |
08:28:04 | * | coldfeet quit (Remote host closed the connection) |
09:00:22 | * | beholders_eye joined #nim |
09:36:10 | * | beholders_eye quit (Ping timeout: 260 seconds) |
09:44:49 | * | beholders_eye joined #nim |
10:38:33 | * | kenran quit (Remote host closed the connection) |
11:05:12 | * | coldfeet joined #nim |
11:23:19 | * | beholders_eye quit (Ping timeout: 260 seconds) |
11:27:51 | * | coldfeet quit (Remote host closed the connection) |
11:35:37 | * | beholders_eye joined #nim |
12:03:12 | * | lucasta joined #nim |
12:19:51 | * | lucasta quit (Quit: Leaving) |
12:43:33 | FromDiscord | <xtrayambak> Does anyone know what the correct way to emit a function that has the `extern "C"` property for the C++ backend? |
12:43:40 | FromDiscord | <xtrayambak> (edit) "Does anyone know what the correct way to emit a ... function" added "Nim" |
12:44:08 | FromDiscord | <xtrayambak> Is it just `{.cdecl.}`? |
12:46:57 | FromDiscord | <demotomohiro> In reply to @xtrayambak "Does anyone know what": If I remember correctly, `exportc` do so. |
12:47:07 | FromDiscord | <xtrayambak> Nevermind, exportcpp does seem to work |
12:48:09 | FromDiscord | <xtrayambak> my LSP server was getting mad at seeing it |
13:24:03 | * | ntat joined #nim |
13:55:02 | FromDiscord | <pitagyrosapola> Hi, I am "playing" with various languages with respect to memory safety. From what I collected Nim 2.2.0 use owned refs according to the paper "Ownership you can count on". There is a crtic here (https://muxup.com/2023q4/ownership-you-can-count-on) that says that Nim abandoned the idea. Is that correct? |
13:55:24 | FromDiscord | <pitagyrosapola> (edit) "according to" => "as described in" |
14:04:28 | FromDiscord | <nervecenter> sent a long message, see https://pasty.ee/wNDOBEUX |
14:05:53 | FromDiscord | <nervecenter> (edit) "https://pasty.ee/dvBimrRb" => "https://pasty.ee/lkACLVxZ" |
14:06:25 | FromDiscord | <nervecenter> (edit) "https://pasty.ee/sQlRLNaU" => "https://pasty.ee/vhuCRuOC" |
14:11:32 | FromDiscord | <pitagyrosapola> In reply to @nervecenter "AFAIK borrow semantics have": Thank you for the clarification. |
14:21:37 | FromDiscord | <nervecenter> In reply to @pitagyrosapola "Thank you for the": Please keep in mind I'm not a compiler dev and if 2.2.0 has some advanced memory semantic features, you should ask Ara, the language creator, over in #internals. He doesn't keep track of #main. |
14:21:44 | FromDiscord | <nervecenter> (edit) "Ara," => "Araq," |
14:22:01 | FromDiscord | <nervecenter> (edit) "Araq," => "@\Araq," |
14:27:12 | FromDiscord | <pitagyrosapola> @nervecenter : I am not ready to head to "Olympus Mountain", BTW the choice to pause https://github.com/nim-lang/RFCs/issues/144 and replace with https://github.com/nim-lang/RFCs/issues/177 was mainly because of breaking changes, not correctness. I |
14:30:05 | FromDiscord | <nervecenter> I'm not sure I get your sentiment. That channel is the place to discuss these features, and he and other compilers devs are the ones who can give the most exact answers concerning memory semantics. |
14:30:24 | FromDiscord | <nervecenter> (edit) "semantics." => "semantics and development timeframes." |
14:47:56 | FromDiscord | <pitagyrosapola> ok then @nervecenter , I will ask there |
14:48:09 | FromDiscord | <pitagyrosapola> thank you for encouraging me |
14:48:17 | * | beholders_eye quit (Ping timeout: 248 seconds) |
14:50:18 | * | lucasta joined #nim |
14:53:35 | FromDiscord | <michaelb.eth> In reply to @nervecenter "I've been informed that": coming back to this, not sure if you found your answer...↵↵where is the string coming from? and what is the encoding at the source? |
15:30:51 | FromDiscord | <nervecenter> In reply to @michaelb.eth "coming back to this,": I figured out what we actually need. I got the mistaken idea in my head that UTF-8 could be "fixed", but the valid UTF-8 needs to be produced at the source. What I settled on with the dev of the system I'm coupled with is to strip invalid bytes until the resulting string is valid UTF-8. |
16:40:36 | * | lucasta quit (Quit: Leaving) |
16:53:29 | * | ntat quit (Quit: Leaving) |
17:00:42 | FromDiscord | <mtriplet> How do you save in helix? |
17:00:50 | FromDiscord | <mtriplet> I am having a hard time to save a file |
17:05:00 | FromDiscord | <muddmaker> According to the docs (<https://docs.helix-editor.com/commands.html>) it's `:w` |
17:05:51 | FromDiscord | <michaelb.eth> In reply to @mtriplet "How do you save": have a look at https://docs.helix-editor.com/commands.html |
17:16:27 | * | Artea quit (Quit: ZNC 1.9.1 - https://znc.in) |
17:50:47 | * | redj quit (Ping timeout: 252 seconds) |
17:53:04 | * | GnuYawk quit (Quit: The Lounge - https://thelounge.chat) |
17:53:28 | * | GnuYawk joined #nim |
18:56:23 | * | ntat joined #nim |
18:58:14 | * | pbsds37 joined #nim |
18:58:19 | * | pbsds3 quit (Ping timeout: 260 seconds) |
18:58:19 | * | pbsds37 is now known as pbsds3 |
19:23:46 | FromDiscord | <mtriplet> In reply to @michaelb.eth "have a look at": Uhmmm I have a hard time following the instruction |
19:24:18 | FromDiscord | <mtriplet> In reply to @muddmaker "According to the docs": like making a new save file |
19:24:33 | FromDiscord | <mtriplet> in software function, it means saves as |
19:25:08 | FromDiscord | <muddmaker> It takes a path parameter https://media.discordapp.net/attachments/371759389889003532/1304527142029099181/image.png?ex=672fb713&is=672e6593&hm=194ca6bde5d009cdb8cd0ec6099409503c49ff22198cfda1151af96cda2ae6be& |
19:25:25 | FromDiscord | <muddmaker> `:w some/path.txt` to save the buffer to a new location |
19:26:03 | FromDiscord | <mtriplet> In reply to @muddmaker "`:w some/path.txt` to save": wait what? |
19:27:15 | FromDiscord | <mtriplet> also i am not good at writing exact path location |
19:28:59 | FromDiscord | <muddmaker> What do you expect it to do for you? |
19:30:46 | FromDiscord | <muddmaker> Also, this should probably be #offtopic |
19:34:41 | FromDiscord | <mtriplet> In reply to @muddmaker "Also, this should probably": oh ok |
19:34:48 | FromDiscord | <mtriplet> In reply to @muddmaker "What do you expect": I guess like more asking |
20:29:38 | * | lucasta joined #nim |
21:06:43 | FromDiscord | <guttural666> how do you people debug Nim programs? |
21:08:32 | FromDiscord | <ollicron_53732> In reply to @guttural666 "how do you people": Supposedly you can use any debugger. I haven't tried but I hear gdb works. The compiler and runtime apparently also offers a stack trace. |
21:09:23 | FromDiscord | <ollicron_53732> Because it is suggested to be high level use only; you shouldn't need to examine memory, as you can't even sensibly print addresses or things stored in the heap without extra work |
21:13:10 | FromDiscord | <ollicron_53732> Instead use testing with `assert()` and `doAssert()` |
21:16:38 | FromDiscord | <.tokyovigilante> I have used gdb a little bit in extremis particularly when working with C libraries but compared to the Swift/Xcode experience, most other IDE integrations are lacking. `nim-gdb` is helpful for setting breakpoints etc, but you're stepping through the raw C output from the Nim compiler, which is a bit confronting 😉 |
21:22:32 | FromDiscord | <guttural666> guess I'm too spoiled by Qt Creator's visual dabugger |
21:22:49 | FromDiscord | <guttural666> (edit) "visual" => "gui" |
21:22:56 | FromDiscord | <guttural666> (edit) "dabugger" => "debugger" |
21:27:04 | * | rockcavera joined #nim |
21:27:39 | FromDiscord | <ollicron_53732> it's suggested to not use `ptr` and instead use `ref` as much as possible so garbage collection just happens automatically. |
21:28:28 | FromDiscord | <ollicron_53732> though you don't have to play by the rules. c; |
21:37:15 | FromDiscord | <.bobbbob> I never write bugs 🙂 |
21:39:52 | FromDiscord | <nnsee> "the tests are wrong!" |
21:48:29 | FromDiscord | <voajabo> In reply to @guttural666 "how do you people": https://github.com/pragmagic/vscode-nim/issues/65 |
21:55:51 | FromDiscord | <guttural666> In reply to @voajabo "https://github.com/pragmagic/vscode-nim/issues/65": I be vimmin tho, going to try gdbgui so my cave man brain can understand |
22:08:27 | * | tokyovigilante quit (Ping timeout: 276 seconds) |
22:10:17 | * | tokyovigilante joined #nim |
22:55:32 | * | ntat quit (Quit: Leaving) |
23:00:26 | FromDiscord | <.tokyovigilante> In reply to @guttural666 "I be vimmin tho,": I did not know this was a thing |
23:03:35 | FromDiscord | <guttural666> In reply to @.tokyovigilante "I did not know": there is no such thing the python community will not visualize apparently |
23:04:08 | FromDiscord | <.tokyovigilante> God bless them. They should really rewrite in Nim though 😉 |
23:04:49 | FromDiscord | <.tokyovigilante> Also that looks like its stepping nim instructions, not the C IR, is that possible in plain gdb? |
23:44:49 | FromDiscord | <double_spiral> In reply to @.tokyovigilante "God bless them. They": Another nim fan? |
23:45:11 | FromDiscord | <double_spiral> Oh this is the nim server lol |