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. |
12:48:51 | FromDiscord | <gokr> Hehe, well. So far it has been very helpful though, amazed that it is so good at Nim actually (Sonnet 3.5, latest) |
13:35:47 | * | ntat joined #nim |
13:48:20 | FromDiscord | <double_spiral> Anyone know if futhark can bind structs and types? Or is it just for functions |
14:35:16 | FromDiscord | <spotlightkid> structs, yes, I'm sure. what other types do you mean? typedefs? |
14:35:44 | FromDiscord | <double_spiral> Yeah |
14:36:00 | FromDiscord | <double_spiral> How can i get the structs to work? I dont see any in the output |
14:38:27 | FromDiscord | <spotlightkid> I didn't have to do anything special. Can you share your wrapper code? |
14:39:14 | FromDiscord | <spotlightkid> Here's an example where I wrapped a C library, which has only two header files, the second included from the first\:↵https://github.com/SpotlightKid/nim-libsoundio/blob/master/src/soundio.nim |
14:39:53 | FromDiscord | <spotlightkid> And the generated Nim wrapper\: https://github.com/SpotlightKid/nim-libsoundio/blob/master/src/soundio_gen.nim |
14:40:54 | FromDiscord | <double_spiral> sent a code paste, see https://play.nim-lang.org/#pasty=tgySfCBI |
14:41:18 | FromDiscord | <double_spiral> sent a code paste, see https://play.nim-lang.org/#pasty=katTgBxc |
14:48:59 | FromDiscord | <spotlightkid> Well, I can't really try it without autobind.c. What 's the error message? |
14:54:31 | FromDiscord | <ayex> what would be the canonical way in nim,↵↵to implant an app\_icon.ico into a win executable? |
14:55:31 | FromDiscord | <double_spiral> sent a code paste, see https://play.nim-lang.org/#pasty=eEBHIhbs |
14:55:42 | FromDiscord | <double_spiral> And the issue is that the struct just doesnt get translated |
14:55:58 | FromDiscord | <double_spiral> (edit) "translated" => "translated/binded" |
14:56:57 | * | lucasta joined #nim |
14:58:31 | FromDiscord | <spotlightkid> @double_spiral\: https://github.com/PMunch/futhark?tab=readme-ov-file#hard-names-and-overrides↵You need a `struct_` prefix. |
14:59:10 | FromDiscord | <spotlightkid> i.e. the nim name is `struct_c_ExampleStruct`, |
14:59:16 | FromDiscord | <spotlightkid> i.e. the nim name is `struct_c_ExampleStruct`. |
15:01:48 | FromDiscord | <double_spiral> I tried this and nim didnt see it. I believe my issue at this point is that it doesnt exist in the futhark output |
15:02:07 | FromDiscord | <double_spiral> sent a code paste, see https://play.nim-lang.org/#pasty=WKvEswRP |
15:04:26 | FromDiscord | <spotlightkid> It does here\: https://cpaste.org/?802b56d4d3bc1ea0#DmGbCCsXqvQAvPi9JYYNL6jDNJj83KzGKk9ryViataJU |
15:04:34 | FromDiscord | <spotlightkid> Nim version? futhark version? |
15:05:03 | FromDiscord | <double_spiral> Latest for both |
15:05:08 | FromDiscord | <double_spiral> Ill try clearing the cache |
15:06:01 | FromDiscord | <double_spiral> Oh that was the issue |
15:06:07 | FromDiscord | <double_spiral> Thanks for the help |
15:07:23 | FromDiscord | <spotlightkid> Yeah, I usually always clean the cache when using futhark. For example it doesn't invalidate the cache when the rename callback changes. |
16:15:38 | FromDiscord | <emanresu3> how can I see the value of a string variable in gdb? When I do `p x` it shows ` $1 = <optimized out>`. I'm compiling with `nim --lineDir:on --debuginfo --d:debug --debugger:native` |
17:09:43 | * | lucasta quit (Quit: Leaving) |
17:52:02 | FromDiscord | <demotomohiro> Did you use `nim-gdb`? https://github.com/nim-lang/Nim/blob/devel/bin/nim-gdb |
18:14:26 | FromDiscord | <emanresu3> no, first I heard of it. I'll try it |
18:26:40 | Amun-Ra | if you compiled nim from source, you have nim-gdb already in bin directory |
18:31:50 | FromDiscord | <emanresu3> sent a code paste, see https://play.nim-lang.org/#pasty=DEUNjDwD |
18:52:56 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/apDkZsKI |
18:53:06 | FromDiscord | <bubbly_avocado_86424> (edit) "https://pasty.ee/sEeHnkmh" => "https://pasty.ee/KsbOtwVE" |
18:53:31 | FromDiscord | <Elegantbeef> `myJsonNode[0]` |
18:53:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ftihEuZY |
19:01:42 | FromDiscord | <tauruuuuuus> Soooo can macros be overloaded? |
19:01:49 | FromDiscord | <bubbly_avocado_86424> hmm, well, yes↵works for JsonNode indeed |
19:01:55 | FromDiscord | <tauruuuuuus> I think I wasted the last hour of my life with cryptic errors because of this |
19:05:11 | FromDiscord | <tauruuuuuus> That's the only one thing I really dislike about nim, the errors can be a bit out of this world sometimes |
19:06:21 | FromDiscord | <bubbly_avocado_86424> In reply to @tauruuuuuus "That's the only one": the errors can indeed be challenging when learning Nim, i'm also no fan of forced indentation really↵style is a choice and a discipline, not something to enforce the hard way |
19:07:11 | FromDiscord | <tauruuuuuus> The more I use it the more I don't dislike the indentation think tbh, but I never had any problems with it |
19:07:21 | FromDiscord | <tauruuuuuus> (edit) "more" => "less" | removed "don't" |
19:07:36 | FromDiscord | <Elegantbeef> Yesn't↵(@tauruuuuuus) |
19:07:57 | FromDiscord | <Elegantbeef> You cannot overload an untyped macro as overloading requires typing |
19:08:06 | FromDiscord | <tauruuuuuus> In reply to @Elegantbeef "Yesn't (<@375951998337417229>)": LOL |
19:08:21 | FromDiscord | <Elegantbeef> Atleast you cannot overload parameter types, you can overload arity |
19:08:23 | FromDiscord | <bubbly_avocado_86424> In reply to @tauruuuuuus "The more I use": i appreciate indentation to be configurable, haven't checked if it can be set to my own size |
19:08:39 | FromDiscord | <tauruuuuuus> In reply to @Elegantbeef "You cannot overload an": oooooh nice nice, chatgpt just thought you couldn't |
19:09:14 | FromDiscord | <Elegantbeef> Well good thing we do not rely on chatgpt and just check using a compiler |
19:10:22 | FromDiscord | <tauruuuuuus> Yup, but when the compiler error does not tell you that, it's nice to have an AI companion reassuring you lol |
19:10:43 | FromDiscord | <Elegantbeef> Except the AI companion doesn't know anything |
19:10:50 | FromDiscord | <Elegantbeef> So it's just gas lighting yourself |
19:10:55 | FromDiscord | <tauruuuuuus> I'm fine with that |
19:11:04 | FromDiscord | <tauruuuuuus> LOL |
19:11:17 | FromDiscord | <tauruuuuuus> Jokes aside, thanks for the info |
19:11:40 | FromDiscord | <tauruuuuuus> I actually started using chatgpt more as a google search because of nim errors lately |
19:11:40 | FromDiscord | <bubbly_avocado_86424> i like lighting gas ↵does that exempt me ? |
19:11:55 | FromDiscord | <emanresu3> AI knows as much as information is on the internet, there isn't as much on Nim as with other languages |
19:12:12 | FromDiscord | <bubbly_avocado_86424> In reply to @emanresu3 "AI knows as much": i actually like that most of the time |
19:13:37 | FromDiscord | <tauruuuuuus> Yeah folks, I'm just using it as a gathering info tool to then make a more in-depth search |
19:13:53 | FromDiscord | <tauruuuuuus> Nothing crazy, but coming back to the macro thing |
19:14:34 | FromDiscord | <tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=ZyGGHyiL |
19:14:39 | FromDiscord | <tauruuuuuus> (edit) "https://play.nim-lang.org/#pasty=vnxaZkHU" => "https://play.nim-lang.org/#pasty=kpbvhbEw" |
19:15:16 | FromDiscord | <tauruuuuuus> Then now I can do something like overloading a template that then calls the macro with different args? The compiler does not give me problems but I wonder if it's ok |
19:15:32 | FromDiscord | <Elegantbeef> Well yea aslong as the overloads are all of the same typeness |
19:15:42 | FromDiscord | <Elegantbeef> If you attempt to overload `untyped` you're going to not be able to |
19:16:04 | FromDiscord | <tauruuuuuus> I'll give you a snippet to get an opinion |
19:18:00 | FromDiscord | <tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=vSqIVgWL |
19:18:17 | FromDiscord | <Elegantbeef> You're overloading untyped |
19:18:21 | FromDiscord | <tauruuuuuus> I wrote this and it seems to work correctly, if I use one or the other, I just want to know if it's supposed to |
19:18:45 | FromDiscord | <tauruuuuuus> Mmm ok, my fear is this works now but maybe it's because of "luck" |
19:18:49 | FromDiscord | <Elegantbeef> You're not going to be able to use `template isr(v: static VectorInterrupt, p: untyped): untyped = ` |
19:19:19 | FromDiscord | <Elegantbeef> To dispatch you need to type the 2nd parameter and that means `p` has to be typed |
19:19:25 | FromDiscord | <tauruuuuuus> you're right |
19:19:46 | FromDiscord | <tauruuuuuus> this is the final macro thing to learn in nim for me |
19:19:52 | FromDiscord | <Elegantbeef> I'm something of a compiler myself |
19:20:07 | FromDiscord | <tauruuuuuus> the typed vs untyped thingie, I get it from a high level perspective but I lack the intuition |
19:20:21 | FromDiscord | <tauruuuuuus> In reply to @Elegantbeef "I'm something of a": I hope you're not a c++ one kind sir.. |
19:20:45 | FromDiscord | <Elegantbeef> Certainly not just a large stupid model for a Nim compiler |
19:23:02 | FromDiscord | <tauruuuuuus> lol I just switched to `typed` as the last parameter for both macro and templates and it works |
19:23:06 | FromDiscord | <tauruuuuuus> Was it that easy? |
19:23:32 | FromDiscord | <Elegantbeef> I mean it shouldn't matter if `p: untyped` can be untyped |
19:23:53 | FromDiscord | <tauruuuuuus> I guess I don't get the difference in general |
19:24:17 | FromDiscord | <Elegantbeef> If the code compiles whilst parsing and semantically analysing `p` then it's fine |
19:24:18 | FromDiscord | <tauruuuuuus> I remember a discussion where Araq was pointing out that untyped should essentialy be deprecated tho |
19:24:26 | FromDiscord | <Elegantbeef> If you did not want it to analyse `p` you'd have issues |
19:25:03 | FromDiscord | <tauruuuuuus> Could you give me one example where I would not want that? |
19:25:08 | FromDiscord | <tauruuuuuus> Just for my sanity/clarity |
19:25:24 | FromDiscord | <Elegantbeef> It's a whole massive change |
19:25:24 | FromDiscord | <Elegantbeef> Yes he wants to make it so the compiler always attempts to analyse code and emit `nnkOpenSym`s instead of needing `untyped` |
19:26:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=TNLjfnRA |
19:26:32 | FromDiscord | <Elegantbeef> This does not compile cause `echo it` needs to be typed to see if it matches `doThing(val: int)` |
19:27:02 | FromDiscord | <Elegantbeef> @bubbly_avocado_86424 you can ask that question here |
19:27:36 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/dOgisbby |
19:28:14 | FromDiscord | <tauruuuuuus> sent a code paste, see https://play.nim-lang.org/#pasty=zfcYzQzK |
19:28:17 | FromDiscord | <tauruuuuuus> Thanks so much |
19:28:18 | FromDiscord | <Elegantbeef> It surely should |
19:29:07 | FromDiscord | <Elegantbeef> That was to the json question |
19:30:02 | FromDiscord | <Elegantbeef> And to the indention comment you made in passing, install indention rainbows and or enable indention lines |
19:33:28 | FromDiscord | <bubbly_avocado_86424> ah, wuuut, i need to insert a space to print↵echo "myvar", myvar,myvar.kind↵echo "myvar", myvar, myvar.kind |
19:33:34 | FromDiscord | <jm_sts> In reply to @tauruuuuuus "the typed vs untyped": Untyped lets you do somewhat illegal syntax but without tooling support |
19:34:57 | FromDiscord | <Elegantbeef> No you do not need to insert that space |
19:35:38 | FromDiscord | <Elegantbeef> Well I'd not say illegal syntax, but yes |
19:35:44 | FromDiscord | <Elegantbeef> If it's illegal syntax it does not parse |
19:36:05 | FromDiscord | <bubbly_avocado_86424> not sure what i did wrong but now it works, sigh |
19:36:19 | FromDiscord | <bubbly_avocado_86424> i'm starting to think computers are emerging sentience |
19:36:22 | FromDiscord | <Elegantbeef> Did you perhaps have `echo"...."`? |
19:36:25 | FromDiscord | <bubbly_avocado_86424> or me losing sentience |
19:36:37 | FromDiscord | <bubbly_avocado_86424> nope, i don't think so |
19:36:38 | FromDiscord | <Elegantbeef> Cause `echo""` is different from `echo ""` |
19:36:53 | FromDiscord | <Elegantbeef> Well then you are purposely throwing a wrench in your progress |
19:37:09 | FromDiscord | <bubbly_avocado_86424> hmmm |
19:37:15 | FromDiscord | <bubbly_avocado_86424> makes sense |
19:37:24 | FromDiscord | <bubbly_avocado_86424> going back i don't see much difference |
19:41:34 | FromDiscord | <bubbly_avocado_86424> i think i was trying out too much on one line and this interfered↵i'm just an average joe, not a math genius |
19:47:13 | FromDiscord | <jm_sts> In reply to @Elegantbeef "If it's illegal syntax": Right, like it still needs to create a valid AST |
19:50:38 | * | coldfeet joined #nim |
20:03:51 | FromDiscord | <bubbly_avocado_86424> does nim have something like quit or break or exit to end the program ? |
20:05:34 | FromDiscord | <griffith1deadly> In reply to @bubbly_avocado_86424 "does nim have something": https://nim-lang.org/docs/system.html#quit%2Cint |
20:27:14 | FromDiscord | <bubbly_avocado_86424> sent a long message, see https://pasty.ee/WYjOUIDH |
20:27:48 | FromDiscord | <Elegantbeef> `readFile` is relative to the current working directory `staticRead` is relative to the nim module |
20:28:13 | * | coldfeet quit (Remote host closed the connection) |
20:28:49 | FromDiscord | <bubbly_avocado_86424> ow, that's a bit odd, would be welcome to see that in the doc↵https://nim-lang.org/docs/system.html#staticRead |
20:31:19 | FromDiscord | <bubbly_avocado_86424> ehm, pretty cool, so now i have the .json written inside of the binary |
21:03:37 | * | ntat quit (Quit: Leaving) |
21:26:20 | FromDiscord | <gokr> Been fiddling trying out LLDB vs GDB in vscode and using the nimlldb.py script that now is included in Nim. Lots of room for improvement 🙂 |
21:26:39 | FromDiscord | <gokr> Seems there are multiple forks of nimlldb.py around too |
22:54:25 | * | m5zs7k_ joined #nim |
22:55:17 | * | m5zs7k quit (Ping timeout: 265 seconds) |
22:58:58 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
23:02:51 | * | m5zs7k_ is now known as m5zs7k |
23:07:48 | * | gshumway quit (Quit: .) |
23:12:00 | * | gshumway joined #nim |
23:28:16 | FromDiscord | <knakas> Is there a bounty board? |
23:30:16 | FromDiscord | <knakas> If not the idea would be for paid nim work. Like do this thing I want, I’ll seed the bounty with X $$. If that’s enough for some one to do then it’s enough but more than one person can contribute to a bounty. (I want Apple II support but county commit to a large bounty.) |
23:30:28 | FromDiscord | <knakas> (edit) "county" => "could not" |
23:32:38 | * | lucasta joined #nim |
23:37:53 | * | Lord_Nightmare joined #nim |
23:44:00 | FromDiscord | <.bobbbob> not dismissing your bounty idea but I really doubt nim can run on an apple ii, nim needs certain things from the c library like malloc to compile and even then nim would be way to heavy to run on the 6502 |
23:49:08 | FromDiscord | <Elegantbeef> It's best to just spend the time and see how far you can get 😄 |