02:23:10 | * | xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in) |
02:23:25 | * | xutaxkamay joined #nim |
03:29:37 | * | lucasta quit (Quit: Leaving) |
04:21:08 | FromDiscord | <knakas> I’m relatively new to programming, but I’m curious could we do use nim to cross compile to Apple II using something like this? https://cc65.github.io/ |
04:44:06 | FromDiscord | <James idowu Toyin> sent a long message, see https://pasty.ee/aHgSRmtR |
05:45:30 | FromDiscord | <arathanis> <@&371760044473319454> |
06:13:27 | * | ntat joined #nim |
06:24:19 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
06:26:19 | * | SchweinDeBurg joined #nim |
07:33:39 | * | ntat quit (Quit: Leaving) |
08:42:06 | FromDiscord | <arm_3_d> did someone try to use embedded wasm runtime? https://github.com/bytecodealliance/wasm-micro-runtime↵how hard it is to integrate into nim app? |
08:43:01 | FromDiscord | <Elegantbeef> I think I looked it it quite a while ago, it should be easy t wrap with futhark if there's a C-API |
08:43:39 | FromDiscord | <Elegantbeef> Personally I've just used wasm3 with https://github.com/beef331/wasm3 for my wasm tinkering |
08:47:37 | FromDiscord | <arm_3_d> @ElegantBeef thanks, didn't see that. Will check it out |
08:48:36 | FromDiscord | <Elegantbeef> My fancy stuff ontop of wasm3 is not well documented so at the very least you can use the underlying C-api |
08:55:29 | * | Artea joined #nim |
08:57:45 | FromDiscord | <nimaoth> @arm_3_d I started wrapping wasmtime a while a go, it's still WIP though: https://github.com/Nimaoth/nimwasmtime |
08:58:37 | FromDiscord | <arm_3_d> Thanks, that would help a lot |
09:32:28 | ehmry | is there a way to suppress exceptions for seq indexing? I want to use `if i < s.len: s[i]` in a `{.raises: [].}` proc |
09:36:32 | ehmry | nevermind, the compiler understands what `except: discard` does |
09:37:08 | Amun-Ra | that should work fine with raises:[] without any changes |
09:37:20 | Amun-Ra | s[i] may generate only IndexDefect |
09:38:48 | Amun-Ra | you can push checks: off to disable index checks |
09:39:24 | Amun-Ra | https://play.nim-lang.org/#pasty=TihzmolI |
12:09:08 | FromDiscord | <arnetheduck> In reply to @Amun-Ra "you can push checks:": checks: off with an invalid index will (eventually) lead to a memory fault due to an invalid memory access - it's not something you ever want to do |
12:10:14 | FromDiscord | <arnetheduck> In reply to @ehmry "nevermind, the compiler understands": `except: discard` is undefined behavior - per the manual, you cannot rely on `Defect` being caught always - but then again, `Defect` is also not part of `raises` analysis so you shouldn't have to do anything in particular |
12:10:48 | ehmry | yea, I don't want defect to be caught |
12:11:27 | FromDiscord | <arnetheduck> well, for `seq`, there's no raises tracking for `[]` |
12:12:05 | Amun-Ra | arnetheduck: yes, but if that case it's fine |
12:12:40 | FromDiscord | <arnetheduck> (edit) "`[]`" => "`[]`, you can use it freely in `{.raises: [].}` and it'll raise that Defect right past the any raises annotations - in particular, on a negative `i` you'll hit a defect also 🙂" |
12:12:46 | Amun-Ra | memory fault in best case scenarion, undefined behavior in worst cast |
12:13:00 | Amun-Ra | s/scenarion/scenario/ |
12:13:30 | Amun-Ra | if that's not a part of some hot code, I wouldn't turn limit checking off |
12:18:24 | FromDiscord | <demotomohiro> If you do bound checks `if i >= 0 and i < s.len:` before accessing the seq, bound check code in `s[i]` will be removed if you turn on optimization: https://internet-of-tomohiro.pages.dev/nim/nimruntimecheckoptimize.en#how-nim-s-runtime-checks-are-optimized-out-simple-openarray-read-with-an-index |
12:18:44 | Amun-Ra | oh, nice |
12:21:25 | FromDiscord | <demotomohiro> GCC do optimization called jump threading: https://en.wikipedia.org/wiki/Jump_threading↵that removes redundant branches. |
12:22:26 | ehmry | that's an entirely different thing from effect tracking and I wouldn't trust any of it to be stable |
12:22:32 | Amun-Ra | the check will stay in js target |
12:24:48 | FromDiscord | <gokr> Two things that bite me over and over: Somehow ending up with circular dependencies but... a) not realizing that is the problem (odd errors) and b) still confused how it happened (don't recall details now). And... I was beating my head against a "expression has no type" error for a long time, until I realized I had a discard in front of an expression that had no return value. Meh! I wonder if this is "just me" stuff. I realize I should let t |
12:42:18 | FromDiscord | <ayex> well, then you would get the false positives from the AI as tradeoff - not necessarily sure that is better. |