00:01:51 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:02:11 | * | njoseph joined #nim |
00:11:18 | * | krux02 quit (Ping timeout: 240 seconds) |
00:18:15 | * | a_chou joined #nim |
00:26:37 | PMunch | Just got done editing down the second episode of the keyboard firmware stuff. Probably going to stream again tomorrow :) |
00:32:42 | * | a_chou quit (Remote host closed the connection) |
00:33:21 | * | a_chou joined #nim |
00:45:34 | * | abm quit (Quit: Leaving) |
00:53:41 | * | oz joined #nim |
01:05:12 | * | arecaceae quit (Remote host closed the connection) |
01:05:30 | * | arecaceae joined #nim |
01:10:51 | * | a_chou quit (Quit: a_chou) |
01:28:39 | * | rockcavera joined #nim |
01:44:34 | * | Tanger joined #nim |
02:04:51 | FromDiscord | <Zachary Carter> In reply to @dom96 "`when defined(js): import jshttpclient": I think the entire point is so that you don't have to make this distinction in userspace |
02:04:54 | FromDiscord | <Zachary Carter> (edit) "userspace" => "user space" |
02:05:14 | FromDiscord | <Zachary Carter> you just import httpclient and it works regardless of the backend |
02:28:30 | * | D_ quit (Quit: 💨) |
02:28:38 | * | D__ joined #nim |
02:31:23 | * | PMunch quit (Quit: leaving) |
02:57:30 | ForumUpdaterBot | New thread by Masiarek2: Quit() - inconsistent behavior - osx terminal vs visual studio, see https://forum.nim-lang.org/t/7715 |
03:44:06 | * | spiderstew joined #nim |
03:45:21 | * | spiderstew_ quit (Ping timeout: 250 seconds) |
04:12:11 | * | greaser|q quit (Changing host) |
04:12:11 | * | greaser|q joined #nim |
04:12:15 | * | greaser|q is now known as GreaseMonkey |
04:17:36 | * | vicfred quit (Quit: Leaving) |
04:19:53 | * | vicfred joined #nim |
04:26:14 | * | rockcavera quit (Remote host closed the connection) |
05:15:20 | * | NimBot joined #nim |
05:34:42 | * | vegai joined #nim |
05:51:01 | * | narimiran joined #nim |
05:51:38 | * | shmorgle quit (Ping timeout: 240 seconds) |
05:57:28 | saem | Looking at the nim-gdb.py wrapper again and all I can think of is Yardanico and I saying not much more than "NTI" to each other over and over again. 😆 |
06:09:37 | * | xet7 quit (Remote host closed the connection) |
06:10:40 | * | xet7 joined #nim |
06:12:31 | * | GreaseMonkey quit (Remote host closed the connection) |
06:13:30 | * | vicfred quit (Quit: Leaving) |
06:26:14 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:43:04 | Clonkk[m] | NTI? |
06:47:09 | * | Kumool joined #nim |
06:57:01 | * | greaser|q joined #nim |
07:01:47 | * | letto_ quit (Read error: Connection reset by peer) |
07:02:19 | * | letto joined #nim |
07:13:51 | FromDiscord | <Yardanico> Nim Type Information |
07:14:07 | FromDiscord | <Yardanico> Runtime type information generated by Nim |
07:18:31 | saem | ah yes, colonObjectType my old friend. |
07:22:25 | ForumUpdaterBot | New thread by Halloleo: Emacs fans tell me: What autocomplete and symbol look-up package are you using?, see https://forum.nim-lang.org/t/7716 |
07:41:25 | * | lritter joined #nim |
08:13:45 | Oddmonger | is {.global.} going to die ? |
08:16:02 | saem | @Yardanico: if you're curious, I updated the gdb branch, tests are passing, things work a fair bit better. But the AST still doesn't quite render correctly with the variants. Getting closer. |
08:16:41 | FromDiscord | <Yardanico> Oh, nice |
08:18:09 | * | leorize quit (Remote host closed the connection) |
08:18:53 | * | leorize joined #nim |
08:20:53 | FromDiscord | <Yardanico> In reply to @Oddmonger "is {.global.} going to": Global pragma actually works with ARC as I found out, just not when initializing in the declaration |
08:31:00 | Oddmonger | you mean : « var x {.global.} :int » is ok , but not « var x {.global.} = 42 » ? |
08:31:51 | FromDiscord | <Yardanico> with non value types it's always ok |
08:32:03 | FromDiscord | <Yardanico> I mean with value types |
08:34:34 | Oddmonger | i don't understand, can i have a sample of what's working and what's not , please ? |
08:35:50 | FromDiscord | <Yardanico> Check the issue |
08:35:52 | FromDiscord | <Yardanico> I updated it |
08:36:06 | Oddmonger | ok thank you |
08:38:08 | FromDiscord | <Yardanico> lo and behold |
08:38:18 | FromDiscord | <Yardanico> the workaround to make global work with ARC like it does with refc: |
08:38:25 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2UrI |
08:38:37 | FromDiscord | <Yardanico> (compile with refc and arc - second example works in both cases, first one only works correctly with refc) |
08:38:48 | FromDiscord | <Yardanico> system.once uses the global pragma too btw |
08:40:35 | FromDiscord | <flywind> `system.once` can be deprecated if needed. |
08:40:39 | FromDiscord | <Yardanico> why? |
08:40:42 | FromDiscord | <flywind> It is not thread-safe |
08:41:06 | FromDiscord | <Yardanico> we can just add a warning/hint that it's not thread safe :) |
08:41:37 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/pull/16192/files |
08:41:58 | FromDiscord | <flywind> a possible implementation without `{.global.}`. |
08:44:38 | FromDiscord | <Yardanico> true, but that'll incur more overhead, right? |
08:44:55 | FromDiscord | <Yardanico> since each time the "once" is reached we'll need to check an atomic bool |
08:45:20 | FromDiscord | <flywind> So I have a good reason to object to timotheecour's PR 😛 |
08:45:52 | FromDiscord | <flywind> yeah |
08:49:27 | FromDiscord | <mratsim> threadsafe once is useful as well |
08:49:35 | FromDiscord | <mratsim> so 2 variants? |
08:49:44 | FromDiscord | <mratsim> {.threadonce.} |
08:50:47 | FromDiscord | <flywind> sounds good |
09:01:04 | Oddmonger | thank you for the sample, Yardanico |
09:02:25 | * | Vladar joined #nim |
09:08:24 | * | Tanger quit (Quit: Leaving) |
09:18:28 | * | krux02 joined #nim |
09:33:13 | federico3 | https://nitter.cattube.org/ryancdotorg/status/1375484757916672000 |
09:43:06 | FromDiscord | <exelotl> god, {.compileTime.} access at runtime is so jank |
09:46:30 | FromDiscord | <exelotl> if the initial state of the variable at runtime is not guaranteed to be the same as the final state of the variable at compile time, what's even the point? |
09:48:00 | FromDiscord | <Yardanico> have you tried converting compileTime into const? |
09:48:14 | FromDiscord | <Yardanico> and AFAIK compileTime was initially meant for variables that _only_ exist at compile time |
09:50:01 | FromDiscord | <Yardanico> @flywind sorry if I might be annoying, but as I've seen you were fixing some mistakes in docs |
09:50:24 | FromDiscord | <Yardanico> in https://nim-lang.org/docs/net.html#recv%2CSocket%2Cstring%2Cint it should be "from socket into data" data instead of buf |
09:50:38 | FromDiscord | <Yardanico> and https://nim-lang.org/docs/net.html#recv%2CSocket%2Cint says "Reads up to size bytes from socket into buf." but that proc actually returns stuff |
09:51:47 | FromDiscord | <flywind> do you want me to make a PR? Or yourself? |
09:52:21 | FromDiscord | <exelotl> In reply to @Yardanico "have you tried converting": yep, I did that yesterday and it solved my issue :) |
09:52:34 | FromDiscord | <Yardanico> In reply to @flywind "do you want me": can you do it? :P i thought you had a similar PR, so it's easier to fix it there |
09:53:34 | FromDiscord | <flywind> It should be a separate PR IMO because I'm closing a issue not doing docs cleaning up. |
09:55:09 | FromDiscord | <flywind> anyway you can file an issue. |
09:56:52 | FromDiscord | <flywind> (edit) "issue." => "issue(if you don't want to make a PR 🙂" |
09:57:53 | FromDiscord | <flywind> In reply to @Yardanico "can you do it?": Small PR is easier to be accepted. |
09:58:05 | FromDiscord | <Yardanico> ok sure |
10:00:52 | FromDiscord | <Yardanico> @flywind do you think we can remove " Note: data must be initialized"? |
10:01:00 | FromDiscord | <Yardanico> since data is a string and strings are always initialized in Nim by default |
10:01:32 | FromDiscord | <Yardanico> that hint was there since 7 years ago |
10:04:30 | FromDiscord | <flywind> I am not sure. It should be allocated enough space I guess? |
10:05:01 | FromDiscord | <Yardanico> no, the proc allocates by itself |
10:05:17 | FromDiscord | <Yardanico> `data.setLen(size)` |
10:05:33 | FromDiscord | <flywind> didn't notice it, safe to remove I think |
10:08:02 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/17566 |
10:09:09 | FromDiscord | <Yardanico> also, on a related note, I think we should document the difference between a buffered and an unbuffered socket |
10:09:27 | FromDiscord | <Yardanico> with a buffered socket (which is the default) in net you must be sure that the server will send the amount of data you requested |
10:09:35 | FromDiscord | <Yardanico> otherwise it'll loop forever |
10:09:55 | FromDiscord | <Yardanico> i'm not sure if this is a bug 🤔 |
10:23:30 | FromDiscord | <Yardanico> oh its not a bug - https://github.com/nim-lang/Nim/issues/11425 |
11:15:29 | FromDiscord | <Mr Axilus> In nim, is there any performance difference between using `return` vs `result =`? |
11:16:13 | FromDiscord | <Mr Axilus> If no, what's the general preference in a situation where both would accomplish the same thing? |
11:16:38 | FromDiscord | <Yardanico> result is preferred |
11:17:12 | FromDiscord | <Yardanico> and about "return vs result" performance - compiler might be able to do more analysis if you use "result" instead of "return", but I don't think that it's a big difference |
11:17:20 | FromDiscord | <Yardanico> but anyway, "result" is idiomatic and preferred unless you need return for control flow :) |
11:59:27 | * | fredrikhr joined #nim |
12:03:20 | * | couven92 joined #nim |
12:03:29 | * | fredrikhr quit (Disconnected by services) |
12:03:36 | * | couven92 is now known as fredrikhr |
12:13:54 | * | PMunch joined #nim |
12:15:54 | * | fredrikhr quit (Read error: Connection reset by peer) |
12:18:37 | * | fredrikhr joined #nim |
12:24:45 | FromDiscord | <Zachary Carter> Why does the github update channel have a bunch of him forum updates in it? Seems broke |
12:31:43 | * | couven92 joined #nim |
12:32:19 | * | fredrikhr quit (Disconnected by services) |
12:32:24 | * | couven92 is now known as fredrikhr |
12:36:14 | ForumUpdaterBot | New question by Suraj Bhattathiri: Implicit return value from a proc, see https://stackoverflow.com/questions/66854296/implicit-return-value-from-a-proc |
12:45:19 | * | rockcavera joined #nim |
12:50:07 | FromDiscord | <arnetheduck> In reply to @Yardanico "but anyway, "result" is": fwiw, we've completely stopped using `result` almost completely due to the high bug incidence in code using it (https://status-im.github.io/nim-style-guide/03_language.html#result-return) - using expressions instead guarantees that all code paths actually have a value - there's no performance difference |
12:50:40 | FromDiscord | <arnetheduck> (edit) "completely" => "\" |
12:50:46 | FromDiscord | <arnetheduck> (edit) removed "\" |
12:51:19 | FromDiscord | <arnetheduck> In reply to @Yardanico "and about "return vs": it does less analysis actually, as it stands - it's very easy to _not_ set it in some code paths |
12:51:27 | FromDiscord | <arnetheduck> (edit) "paths" => "paths, or set it twice" |
13:11:01 | FromDiscord | <Yardanico> In reply to @Zachary Carter "Why does the github": Because it's bridged to #nim-news |
13:11:15 | FromDiscord | <Yardanico> We had GitHub events from disbot there, but we don't have them now... |
13:26:26 | FromDiscord | <clyybber> In reply to @arnetheduck "it does less analysis": From "most structured" to "least structured" the order would go: expression/single return expression/single result assignment > result assignments > multiple returns |
13:26:45 | FromDiscord | <clyybber> So result is still somewhat preferable over multiple returns |
13:26:55 | FromDiscord | <clyybber> but of course it depends |
13:27:33 | FromDiscord | <arnetheduck> in our code `return` is generally used to avoid nesting - ie you check for a bunch of preconditions which you return early from - everything else, expressions |
13:28:26 | FromDiscord | <Rika> sometimes expressions are too limiting though? |
13:29:08 | FromDiscord | <arnetheduck> so `return` tends to lead to quite clear code - specially because indent is significant, auditing that lots of branches that all touch `result` do so correctly is nigh impossible - with expressions, the compiler does it for you |
13:29:42 | FromDiscord | <clyybber> yeah agreed; if possible expressions are the clearest IMO |
13:30:05 | FromDiscord | <arnetheduck> In reply to @Rika "sometimes expressions are too": this is a matter of style mostly - once you get used to it, you simply factor your code in a slightly different way |
13:30:20 | FromDiscord | <Rika> then the same argument can be applied for result |
13:30:22 | FromDiscord | <clyybber> you can also return in expressions; but that's somewhat cursed |
13:30:36 | FromDiscord | <clyybber> In reply to @Rika "then the same argument": yeah, it really depends on the context/situation |
13:30:49 | FromDiscord | <clyybber> just use whatever represents the intend/ thought process most clearly |
13:30:55 | FromDiscord | <clyybber> (edit) "intend/" => "intent/" |
13:30:59 | FromDiscord | <arnetheduck> In reply to @Rika "then the same argument": it has been our experience, that no, pragmatically, humans can't 🙂 |
13:30:59 | FromDiscord | <Rika> which is why im not saying "expressions are bad" but "results are not as bad as shown" |
13:31:14 | * | astronavt quit (Remote host closed the connection) |
13:31:34 | * | astronavt joined #nim |
13:33:17 | FromDiscord | <arnetheduck> it's a bit like using a typed vs an untyped language - you can write correct and clear code with both, but expressions, just like type, allow you to structurally eliminate a particular class of bugs |
13:33:54 | * | astronavt quit (Remote host closed the connection) |
13:34:02 | FromDiscord | <konsumlamm> In reply to @Zachary Carter "you just import httpclient": except `jshttpclient` is it's own module that provides a synchronous and asynchronous version that afaik is not planned to be used in `httpclient` and `asynchttpclient` respectively |
13:34:15 | FromDiscord | <arnetheduck> In reply to @Clyybber "you can also return": funny enough, `nim-result` relies on this quite heavily behind the scenes 🙂 |
13:34:16 | * | astronavt joined #nim |
13:34:23 | FromDiscord | <clyybber> yeah I know :D |
13:34:48 | FromDiscord | <arnetheduck> I would even go as far as saying that it was key to getting acceptable ergonomics |
13:34:58 | FromDiscord | <clyybber> one thing that's been on my todo list is to ensure that non-linear control flow breaks to a safe point |
13:36:15 | FromDiscord | <clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2UsH |
13:36:39 | FromDiscord | <clyybber> and the break/return/noreturn inside the expression is only allowed when it also exits the declaration scope of `a` |
13:37:33 | FromDiscord | <arnetheduck> oh, that's nasty.. what happens now, default init? |
13:37:50 | * | astronavt quit (Remote host closed the connection) |
13:37:54 | FromDiscord | <clyybber> yeah I think so |
13:38:03 | krux02 | @clyybber: what is the issue with the code you pasted? |
13:38:16 | FromDiscord | <clyybber> In reply to @krux02 "<@107882072974065664>: what is the": it breaks the semantics of let |
13:38:18 | FromDiscord | <Rika> krux: what does a get set to? |
13:38:28 | krux02 | I see |
13:38:34 | * | astronavt joined #nim |
13:39:26 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2UsI |
13:40:49 | FromDiscord | <Zachary Carter> In reply to @konsumlamm "except `jshttpclient` is it's": ah, thanks for the explanation 🙂 |
13:41:20 | FromDiscord | <konsumlamm> In reply to @Zachary Carter "ah, thanks for the": (note the "afaik", i'm not 100% sure) |
13:44:04 | krux02 | @clüübber: Any progress on my tuple expression PR? |
13:44:47 | krux02 | @clyybber: sorry for mistyping your name |
13:45:08 | FromDiscord | <clyybber> haha np |
13:45:51 | FromDiscord | <clyybber> I think it's basically ready, I'll take a look today |
13:50:13 | krux02 | thank you |
14:02:31 | ForumUpdaterBot | New question by Joshua Cohen: My code is producing an error when run asynchronously but it works synchronously, see https://stackoverflow.com/questions/66855551/my-code-is-producing-an-error-when-run-asynchronously-but-it-works-synchronously |
14:12:39 | * | waleee-cl joined #nim |
14:39:19 | * | shmorgle joined #nim |
14:42:48 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2UsZ |
14:43:22 | FromDiscord | <Rika> `proc func(c: ptr char, s: size_t)` i think? |
14:43:56 | FromDiscord | <Rika> depends on what the char pointer represents |
14:44:04 | FromDiscord | <Rika> array? var param? etc |
14:45:15 | FromDiscord | <jtiai> it's a pointer to a single character. |
14:45:37 | FromDiscord | <Rika> and nothing else? then as i wrote |
14:46:10 | FromDiscord | <Rika> if you want to call from c, dont forget to use {.exportc: "exported_name".} |
14:46:33 | FromDiscord | <Rika> In reply to @Rika "`proc func(c: ptr char,": `size_t` -> `csize_t` |
14:46:34 | FromDiscord | <Rika> sorry |
14:46:56 | FromDiscord | <Rika> also `char` -> `cchar`, sorry x2 |
14:47:10 | FromDiscord | <jtiai> and then how to convert that to nim char? since getting type mismatch for `proc foo(c: char)`.... |
14:47:39 | FromDiscord | <Rika> use ptr char, then dereference with `[]`; `let c: char = c[]` |
14:47:45 | FromDiscord | <konsumlamm> a pointer to a char is not a char |
14:50:52 | FromDiscord | <Yardanico> Use cstring |
14:51:44 | FromDiscord | <Rika> In reply to @jtiai "it's a pointer to": @ Yardanico |
14:52:05 | FromDiscord | <Rika> its not an array |
14:52:26 | FromDiscord | <Yardanico> that's rare :) then yeah either cstring or ptr chat |
14:52:29 | FromDiscord | <Yardanico> chat |
14:52:31 | FromDiscord | <Yardanico> Aaaa |
14:52:54 | FromDiscord | <Yardanico> cstring with a single element is the same as pointer to a single character so you could use any of those |
14:53:14 | FromDiscord | <Yardanico> well, almost, there's also a null terminator |
14:54:00 | FromDiscord | <Rika> in this case there probably is no terminator |
14:54:02 | FromDiscord | <Solitude> In reply to @Yardanico "cstring with a single": why use precise types when cstring kinda fits :))))))))) |
14:54:06 | FromDiscord | <Rika> therefore dont use cstring |
14:54:12 | FromDiscord | <Yardanico> In reply to @Solitude "why use precise types": :))) |
14:54:25 | FromDiscord | <Yardanico> but now I wonder what that C function does |
15:14:48 | * | fredrikhr quit (Quit: Disconnecting) |
15:55:46 | * | D__ is now known as D_ |
15:59:40 | * | vicfred joined #nim |
16:00:09 | * | nxnl[m] quit (Quit: Idle for 30+ days) |
16:04:07 | * | a_chou joined #nim |
16:19:59 | * | a_chou quit (Quit: a_chou) |
16:35:09 | FromDiscord | <lantos> hmmm, cant import sdl2 when I installed it on a fresh computer↵anyone else found this? |
16:36:03 | ForumUpdaterBot | New Nimble package! batchsend - Nim / Python library to feed HTTP server quickly with custom messages, see https://github.com/marcomq/batchsend |
16:48:35 | FromDiscord | <zetashift> In reply to @lantos "hmmm, cant import sdl2": Did you install it? What is the exact error you get when you try to compile? |
16:49:16 | FromDiscord | <lantos> nimble install sdl2_nim↵^ works ↵but ``cannot open file: sdl2`` |
16:49:39 | FromDiscord | <Goel> You need to install the dependencies of sdl2, not just the sdl2 bindings |
16:49:59 | FromDiscord | <lantos> yep apt install libsdl2-dev |
16:51:52 | FromDiscord | <Goel> Probably they are not set correctly in your PATH then |
16:54:29 | FromDiscord | <zetashift> did you import it using `import sdl2/sdl` ? |
16:55:19 | FromDiscord | <lantos> In reply to @zetashift "did you import it": works but sdl2/audio fails |: |
16:57:14 | FromDiscord | <Yardanico> @Goel if that was the case the error would've been different |
16:57:48 | FromDiscord | <Yardanico> In reply to @lantos "nimble install sdl2_nim ^": There's no such thing as sdl2 audio |
16:57:55 | FromDiscord | <Yardanico> You probably want sdl2/mixer |
16:58:03 | FromDiscord | <Yardanico> sdl2/sdl_mixer |
16:58:10 | FromDiscord | <Yardanico> https://github.com/Vladar4/sdl2_nim/blob/master/examples/ex401_mixer.nim |
16:58:23 | FromDiscord | <zetashift> it might be |
16:58:27 | FromDiscord | <lantos> 👁️ 👄 👁️ |
16:58:28 | FromDiscord | <lantos> https://github.com/Vladar4/sdl2_nim/tree/master/sdl2/private |
16:58:30 | FromDiscord | <zetashift> sdl2/sdl/audio |
16:58:40 | FromDiscord | <zetashift> import sdl2/sdl |
16:58:43 | FromDiscord | <Yardanico> @lantos "private" |
16:58:49 | FromDiscord | <Yardanico> why would you want to import private modules |
16:58:51 | FromDiscord | <zetashift> https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/sdl.nim#L7 |
16:58:57 | FromDiscord | <Yardanico> exactly |
16:59:11 | FromDiscord | <lantos> 👁️ 👄 👁️ < me dumb emoji |
16:59:11 | FromDiscord | <zetashift> it exports it, the docs mention it audio too, I'm not sure why it can't find it |
16:59:52 | FromDiscord | <zetashift> Is it working? |
17:01:17 | FromDiscord | <lantos> Hmmm, I think It's the sdl2 module I'm importing |
17:01:52 | FromDiscord | <lantos> if I nimble install sdl2 sdl2_nim↵^ could be causing conflicts? |
17:02:08 | * | clyybber joined #nim |
17:02:34 | FromDiscord | <Yardanico> yes exactly |
17:04:22 | FromDiscord | <lantos> yeah wiping the pkg dir and ran nimble install↵I just assumed the .nimble files would let you specify the exact package |
17:05:17 | FromDiscord | <Yardanico> yes |
17:05:28 | FromDiscord | <Yardanico> but then you also need to build/run your app with `nimble` instead of `nim` |
17:10:51 | FromGitter | <Clyybber> @HJarausch Hey, can you please test https://github.com/nim-lang/Nim/pull/17574 ? |
17:11:53 | * | Trustable joined #nim |
17:13:17 | * | Trustable quit (Client Quit) |
17:22:15 | * | haxscramper joined #nim |
17:22:19 | * | astronavt quit (Remote host closed the connection) |
17:22:43 | * | astronavt joined #nim |
17:25:39 | * | Jesin quit (Quit: Leaving) |
17:28:19 | FromDiscord | <jtiai> Is there way to generate just header file from nim? |
17:30:18 | FromDiscord | <jtiai> Like now I do `nim c -d:release --header:stuff.h stuff.nim` but it also compiles it I would like to avoid that if possible. |
17:31:15 | FromDiscord | <Solitude> `-c` maybe |
17:31:37 | leorize | note that --header: is completely unsupported afaik |
17:36:53 | FromDiscord | <jtiai> If it's unsupported how calling nim from C is supposed to work then? Because that's how it is done in backend integration docs... |
17:37:30 | leorize | usually you'd write your own prototype |
17:38:00 | leorize | we generally avoid using nim's header because they contains a ton of nim's C macros |
17:38:57 | leorize | but if it's in the docs then I guess it's fine to use now |
17:39:11 | FromDiscord | <mratsim> it has always been in the doc |
17:39:18 | leorize | though I'm slightly wary since `nim --fullhelp` doesn't list it |
17:39:21 | FromDiscord | <mratsim> but I don't think there is a flag to generate just the header |
17:39:36 | FromDiscord | <mratsim> I've seen it in the doc since I started with Nim |
17:40:25 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2Uu2 |
17:41:23 | leorize | it means your C compiler disagrees with Nim about int size |
17:41:53 | FromDiscord | <Yardanico> @jtiai that error will occur if you're telling nim that you're compiling for 64-bits but the C compiler compiles for 32-bits |
17:41:55 | FromDiscord | <Yardanico> and vice-versa |
17:42:39 | FromDiscord | <jtiai> That is true. Wrong gcc... |
17:45:23 | FromDiscord | <jtiai> WOO! I have my own operating system kernel with libc! |
17:47:51 | FromDiscord | <jtiai> Hmm, apparently few functions before `echo` works... |
17:51:15 | FromDiscord | <zetashift> Very nice @jtiai !! |
17:52:18 | * | tane joined #nim |
17:52:23 | * | vicfred quit (Quit: Leaving) |
17:55:57 | * | clyybber quit (Remote host closed the connection) |
17:57:35 | FromDiscord | <fwsgonzo> so, let's say I wanted to be able to support Nim backtraces |
17:57:40 | FromDiscord | <fwsgonzo> is it enough to support sigaction? |
17:59:03 | * | lritter quit (Quit: Leaving) |
18:01:46 | PMunch | Streaming some more keyboard firmware development in about 5 minutes :) |
18:02:40 | * | vicfred joined #nim |
18:03:44 | FromDiscord | <fwsgonzo> blink those lights! |
18:05:57 | leorize | @fwsgonzo you need to implement the `signal()` API for now... |
18:07:33 | FromDiscord | <fwsgonzo> alright, thanks |
18:08:24 | leorize | system/excpt.nim has the code used for backtrace on signal |
18:08:37 | leorize | you can modify that to hook into your own signaling system if needed |
18:09:05 | PMunch | Stream is live: https://www.twitch.tv/pmunche |
18:20:23 | * | tiorock joined #nim |
18:20:23 | * | tiorock quit (Changing host) |
18:20:23 | * | tiorock joined #nim |
18:20:23 | * | rockcavera quit (Killed (barjavel.freenode.net (Nickname regained by services))) |
18:20:23 | * | tiorock is now known as rockcavera |
18:35:36 | * | rockcavera is now known as Guest48727 |
18:35:36 | * | tiorock joined #nim |
18:35:37 | * | Guest48727 quit (Killed (rothfuss.freenode.net (Nickname regained by services))) |
18:35:37 | * | tiorock is now known as rockcavera |
18:56:55 | FromDiscord | <will> how can I find if a file exists? |
18:57:03 | FromDiscord | <Yardanico> fileExists |
18:57:10 | FromDiscord | <Yardanico> https://nim-lang.org/docs/os.html#fileExists%2Cstring |
18:57:11 | FromDiscord | <Yardanico> quite literally |
18:57:39 | FromDiscord | <will> hmm that wasnt showing up before, thanks for the help |
19:12:22 | * | rockcavera quit (Remote host closed the connection) |
19:13:37 | * | rockcavera joined #nim |
19:16:01 | ForumUpdaterBot | New thread by Matthesoundman: Inline print a sequence or strip '"', see https://forum.nim-lang.org/t/7719 |
19:23:55 | * | rockcavera quit (Remote host closed the connection) |
19:30:21 | * | rockcavera joined #nim |
19:36:28 | * | cornfeedhobo joined #nim |
19:39:59 | FromDiscord | <fwsgonzo> whats the simplest way to crash nim? |
19:40:05 | FromDiscord | <fwsgonzo> (edit) "whats the simplest way to crash ... nim?" added "in" |
19:40:13 | FromDiscord | <fwsgonzo> something like idiv 0 |
19:40:20 | FromDiscord | <fwsgonzo> (edit) "something like idiv 0 ... " added "or asm ud2" |
19:41:59 | * | cornfeedhobo left #nim ("when i leave, come together like butt cheeks") |
19:45:03 | * | clyybber joined #nim |
19:45:26 | FromDiscord | <Hi02Hi> https://nim-lang.org/docs/system.html#quit%2Cint is one option |
19:56:57 | FromDiscord | <dom96> doAssert false |
19:57:33 | FromDiscord | <fwsgonzo> thanks |
19:57:56 | stefantalpalaru | Is there any tool to generate Nim call graphs? |
20:07:53 | FromDiscord | <haxscramper> No, there is no such tool, though I started working on graphviz callgraph dump and dropped midway because naive implementation generated very large graphs and I didn't have time to properly cut out unnecessary parts |
20:08:06 | FromDiscord | <haxscramper> You might try using sourcetrail integration to get something close though https://media.discordapp.net/attachments/371759389889003532/826185969740546068/unknown.png |
20:08:24 | FromDiscord | <haxscramper> https://github.com/haxscramper/haxdoc |
20:09:26 | FromDiscord | <haxscramper> Not really stable, but it works for nim compiler codebase at least. |
20:24:06 | * | narimiran quit (Ping timeout: 240 seconds) |
20:31:33 | * | evilkhaoskat joined #nim |
20:31:53 | * | evilkhaoskat quit (Client Quit) |
20:41:32 | * | kenran joined #nim |
21:05:25 | PMunch | Man, this really caused trouble for me during the stream.. https://github.com/nim-lang/Nim/issues/17497 |
21:05:47 | PMunch | Had to patch the compiler with a small revert to the 1.4.0 behaviour in order to make progress |
21:10:49 | * | haxscramper quit (Remote host closed the connection) |
21:23:46 | * | kenran quit (Quit: leaving) |
21:38:28 | FromDiscord | <fwsgonzo> you cant do that, many architectures rely on execute-only memory to protect against certain types of attacks |
21:39:02 | FromDiscord | <fwsgonzo> on architectures where XO is supported .text will not be readable |
21:39:58 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Uve |
21:42:38 | PMunch | fwsgonzo, wait was that comment for me? |
21:43:08 | FromDiscord | <fwsgonzo> just commenting on putting data in .text |
21:43:23 | PMunch | It's pretty common on AVR |
21:44:01 | PMunch | I've done it for my Arduboy stuff |
21:44:06 | PMunch | And now for this keyboard stuff |
21:44:12 | PMunch | But this bug absolutely wrecks it |
21:44:21 | * | tane quit (Quit: Leaving) |
21:44:34 | PMunch | And it would cause a lot of extra copying on normal code as well |
21:50:35 | FromDiscord | <fwsgonzo> ah ok |
21:51:45 | FromDiscord | <fwsgonzo> alright, so for my backtrace question: I got better results when `--debugger:native` was enabled |
22:18:47 | * | Vladar quit (Quit: Leaving) |
22:20:26 | * | vicfred quit (Quit: Leaving) |
22:22:58 | * | Q-Master quit (Ping timeout: 252 seconds) |
22:23:05 | * | Q-Master joined #nim |
22:25:51 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2Uvn |
22:58:55 | PMunch | Hmm, the built in set type needs exceptions to work. That is a slight bummer for AVR code |
23:01:28 | FromDiscord | <clyybber> why does it need exceptions? |
23:16:35 | PMunch | Seems to mostly be memory setting/clearing |
23:32:41 | * | vicfred joined #nim |
23:59:48 | * | krux02 quit (Remote host closed the connection) |