<< 14-03-2025 >>

00:34:30*Jjp137 quit (Quit: Leaving)
00:36:17*Jjp137 joined #nim
00:39:28*oisota quit (Ping timeout: 272 seconds)
00:39:46*oisota joined #nim
00:40:07*marcus quit (Ping timeout: 272 seconds)
00:40:40*marcus joined #nim
00:52:54*madprops joined #nim
00:53:33madpropsthe mimetypes library from python identifies nim files as video/vnd.nokia.interleaved-multimedia
01:09:41*switchy joined #nim
01:46:47FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=OujlfKRA
01:51:37*tiorock joined #nim
01:51:37*tiorock quit (Changing host)
01:51:37*tiorock joined #nim
01:51:37*rockcavera is now known as Guest3274
01:51:37*Guest3274 quit (Killed (erbium.libera.chat (Nickname regained by services)))
01:51:37*tiorock is now known as rockcavera
03:20:40FromDiscord<lainlaylie> the surest way is to try it and find out
03:42:34*beholders_eye quit (Ping timeout: 252 seconds)
04:17:42*xet7 quit (Ping timeout: 268 seconds)
04:30:03*xet7 joined #nim
04:35:14FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=hfPZKiAr
04:37:36*tiorock joined #nim
04:37:36*tiorock quit (Changing host)
04:37:36*tiorock joined #nim
04:37:36*rockcavera is now known as Guest2027
04:37:36*Guest2027 quit (Killed (silver.libera.chat (Nickname regained by services)))
04:37:36*tiorock is now known as rockcavera
04:39:43*tiorock joined #nim
04:39:43*tiorock quit (Changing host)
04:39:43*tiorock joined #nim
04:39:43*rockcavera is now known as Guest7320
04:39:43*tiorock is now known as rockcavera
04:40:06FromDiscord<heysokam> Is it possible to iterate through a `cstring` without using GC'ed memory?↵_`cstring.items` uses the gc_
04:40:39FromDiscord<heysokam> I imagine I'd have to create a custom iterator, but curious if its doable with cstring somehow
04:41:43FromDiscord<lainlaylie> In reply to @user2m "Is there a tutorial": did you compile with -d:useMalloc?
04:42:40FromDiscord<Elegantbeef> It doesn't use the gc
04:42:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=EEOgOtHI
04:43:09*Guest7320 quit (Ping timeout: 260 seconds)
04:43:23FromDiscord<user2m> In reply to @lainlaylie "did you compile with": I believe I tried that on my prod instance and it didn't solve the issue
04:43:47FromDiscord<lainlaylie> not for solving the issue, it's for valgrind to be able to track memory
04:44:49FromDiscord<user2m> In reply to @lainlaylie "not for solving the": ahh ok I can try that
04:45:16FromDiscord<leorize> here's the arcane chant to use AddressSanitizer if you're interested\: `-d:useMalloc --passC:-fno-omit-frame-pointer --passC:-mno-omit-leaf-frame-pointer --passC:-fsanitize=address --passL:-fsanitize=address`
04:45:43FromDiscord<leorize> just put that in and run the result
04:45:50FromDiscord<leorize> it's faster than valgrind
04:46:10FromDiscord<leorize> you might need `--cc:clang`, but if you want gcc then install `libasan` if your distro provides it
04:46:25FromDiscord<leorize> well not just faster, more accurate, too
04:47:50FromDiscord<heysokam> @ElegantBeef does `echo` use the GC? maybe the error is misleading me to the character, but its echo 🤔
04:47:58FromDiscord<Elegantbeef> Yes it does
04:48:06FromDiscord<heysokam> that'd explain it
04:48:08FromDiscord<user2m> In reply to @leorize "here's the arcane chant": Are there any docs on AddressSanitizer I ran across this term but have no idea what is? Apologies if this is well known, this is my first time digging into memory like this
04:48:17FromDiscord<Elegantbeef> `stdout.write`
04:48:35FromDiscord<Elegantbeef> remember `echo` calls `$` for all arguments
04:49:10FromDiscord<leorize> https://clang.llvm.org/docs/AddressSanitizer.html↵(@user2m)
04:49:18FromDiscord<leorize> https://github.com/google/sanitizers/wiki/AddressSanitizer
04:49:31FromDiscord<Elegantbeef> Leo doesn't put a stamp on anything unless it's been sanitized
04:49:40FromDiscord<Elegantbeef> He soaks everything in hand sanitizer
04:50:04FromDiscord<leorize> that's why my code takes forever to be released
04:50:12FromDiscord<Elegantbeef> Yea that's why
04:50:13FromDiscord<leorize> all that alcohol doesn't bode well with paper
04:50:45FromDiscord<Elegantbeef> My code takes forever cause I do daft things like wrap my vsbf code into a library
04:56:43FromDiscord<user2m> In reply to @leorize "https://clang.llvm.org/docs/AddressSanitizer.html (": Thank you!
04:58:18FromDiscord<leorize> note that none of the tools will catch logical leaks
05:00:27FromDiscord<leorize> if your trouble is caused by allocating too much and never free because you left it in some table or seq that's in use, then only something like heaptrack can detect it\: https://invent.kde.org/sdk/heaptrack
05:01:43FromDiscord<Elegantbeef> Just download more ram it's easier
05:13:53FromDiscord<user2m> In reply to @leorize "here's the arcane chant": Ok so I've compiled for asan - do I just run the application in staging? Will there be some sort of output?
05:25:41FromDiscord<leorize> there will be output on normal exit about leaks↵(@user2m)
05:25:58FromDiscord<leorize> if there are memory corruption bugs, then the software would crash with some output, too
05:27:47*ntat joined #nim
05:28:45FromDiscord<user2m> In reply to @leorize "there will be output": Ok what do you mean by normal exit? I'm currently just stopping the app using ctrl + c in the terminal is that considered normal exit?
05:29:41FromDiscord<user2m> In reply to @leorize "if there are memory": Ok that's insteresting - this seems to be faster than valgrind so maybe I can capture the output in a log and use supervisord to restart the app when it crashes
05:34:49FromDiscord<leorize> I can't remember if LSan would run if the program was terminated by a signal
05:35:50FromDiscord<leorize> nope
05:35:56FromDiscord<leorize> I just tested
05:38:57FromDiscord<leorize> if your app reaches `quit()` or end of main it'd be normal↵(@user2m)
05:39:11FromDiscord<leorize> if not you should add some endpoint to call `quit`
06:24:08*ntat quit (Remote host closed the connection)
06:37:32FromDiscord<heysokam> how does the `nimvm` communicate/transfer data with the compiler?
06:42:17*ntat joined #nim
06:45:57FromDiscord<Elegantbeef> It writes to PNode
07:13:31FromDiscord<heysokam> but I mean, how does it write to it?
07:14:05FromDiscord<heysokam> does it have access to the ast memory directly somehow?
07:17:48FromDiscord<leorize> it is the AST
07:18:16FromDiscord<leorize> nim version of the VM use PNode as storage for everything
07:20:03FromDiscord<heysokam> that's now what I mean↵The VM needs to have access to the data somehow, I'm just asking about how that data is accessed
07:20:41FromDiscord<leorize> it's PNode
07:20:56FromDiscord<heysokam> then how are pnodes passed between each other?
07:21:18FromDiscord<heysokam> even if the shape is a pnode, the data still needs to be communicated
07:21:27FromDiscord<leorize> the only difference between a `NimNode` and `int` is the instruction used to read/write them
07:22:21FromDiscord<heysokam> then how does the VM access `int`s that are part of the compiler's runtime?
07:22:25FromDiscord<leorize> CT data has a PNode representation, and the VM read/write straight to itt
07:22:28FromDiscord<heysokam> they still need to be accessed
07:22:32FromDiscord<leorize> wdym compiler's runtime?
07:22:41FromDiscord<heysokam> the compiler runs, that's a runtime
07:23:27FromDiscord<heysokam> during the compiler runtime, the VM exists somehow somewhere, and can execute the comptime code of the user
07:23:40FromDiscord<heysokam> the vm needs to access the data. How?
07:23:41FromDiscord<leorize> right
07:23:51FromDiscord<leorize> so AST is compiled into bytecode + data store
07:24:13FromDiscord<leorize> data store is just a bunch of PNode with the exact representation of it in Nim's source code
07:24:31FromDiscord<heysokam> so it is serialized and read by the vm?
07:24:48FromDiscord<leorize> yes, all data ops are serialized
07:26:04FromDiscord<heysokam> how is that data transfered?
07:26:21FromDiscord<leorize> so if you add into a seq, it turns into PNode.addChildren(), for example
07:26:35FromDiscord<leorize> the compiler use registers for this
07:26:43FromDiscord<leorize> there's a register bank
07:27:13FromDiscord<leorize> the rules for getting data is simple, just pick it up from regA after the code finish running
07:28:00FromDiscord<heysokam> I'm just trying to understand how the data is transfered, that's all. You are getting really lost in complexity, leorize. I'm asking for a much much simpler question
07:28:19FromDiscord<leorize> I don't know what do you mean by transfered, that is
07:28:24FromDiscord<heysokam> eg: the bytecode is written to a file, the VM reads it
07:29:12FromDiscord<heysokam> eg: the bytecode is written to process-shared memory (if that's even a thing, I have no clue) and the VM modifies that memory directly
07:29:14FromDiscord<heysokam> etc
07:29:40FromDiscord<leorize> bytecode is written into a seq
07:29:55FromDiscord<heysokam> and how does the VM access the seq?
07:29:55FromDiscord<leorize> VM is just a function that read instruction by instruction
07:30:19FromDiscord<leorize> a simple while interpreter loop
07:30:21FromDiscord<heysokam> ic, tyty
08:10:52*xet7 quit (Ping timeout: 244 seconds)
08:19:20*ntat quit (Quit: Leaving)
08:23:03*xet7 joined #nim
08:49:01*ntat joined #nim
09:17:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @lainlaylie "the surest way is": I pass a pointer now, to be sure it does what I actually want to do
09:19:32FromDiscord<System64 ~ Flandre Scarlet> The fact I can now query the pins makes this module EXTREMELY powerful! https://media.discordapp.net/attachments/371759389889003532/1350035612354347069/image.png?ex=67d54624&is=67d3f4a4&hm=8011c25df732c279e4a759b634719dffa63c6baa95f85d30cede8f32ffa97d63&
09:59:57*beholders_eye joined #nim
10:27:59*rockcavera quit (Remote host closed the connection)
10:32:32FromDiscord<griffith1deadly> In reply to @sys64 "The fact I can": will you make treesitter integration for syntax highlights?
10:50:12*beholders_eye quit (Ping timeout: 246 seconds)
11:14:41FromDiscord<enthus1ast.> In reply to @sys64 "The fact I can": Looks cool, but wat is this?
11:14:48FromDiscord<enthus1ast.> (edit) "wat" => "what"
11:26:00*ntat quit (Read error: Connection reset by peer)
11:31:32*ntat joined #nim
11:44:16FromDiscord<aintea> Any idea why treesitter is SO slow at parsing a Nim file ? https://media.discordapp.net/attachments/371759389889003532/1350072032179781732/xk4hrzv.png?ex=67d5680f&is=67d4168f&hm=1cc0dbcf04f7d6df910bf3bb060e4b39d80dab7023f00f1fbbdfab9f0e3a9358&
11:53:39FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "will you make treesitter": https://github.com/BalazsJako/ImGuiColorTextEdit↵I'll use this
11:54:02FromDiscord<System64 ~ Flandre Scarlet> In reply to @enthus1ast. "Looks cool, but what": Kurumi XP, one wavetable generator to rule them all
12:18:15*ntat quit (Read error: Connection reset by peer)
12:24:53*ntat joined #nim
12:37:48FromDiscord<enthus1ast.> so a digital music instrument?
12:38:02*ntat quit (Quit: leaving)
12:38:40*minimi joined #nim
12:40:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @enthus1ast. "so a digital music": Kinda, you can export waveforms / samples for use in other softwares
12:41:50*ntat joined #nim
12:42:29*beholders_eye joined #nim
12:48:05*ntat quit (Quit: leaving)
13:26:56*coldfeet joined #nim
13:37:54*ntat joined #nim
13:51:35FromDiscord<System64 ~ Flandre Scarlet> I hate how Windows defender flags my software...
14:16:28FromDiscord<ayex> yes - I can't stand it either. especially when the program is a dead-simple harmless utility and it gets flagged as "malicious" instead of just "unknown". 🤔
14:40:39FromDiscord<madonuko> docs for nimsutils finally up (<https://fyralabs.github.io/nimsutils/>)↵[nim-documentation-generator](https://github.com/marketplace/actions/nim-documentation-generator) is such a life saver
14:47:55FromDiscord<odexine> In reply to @aintea "Any idea why treesitter": i believe the treesitter rules are complicated as hell, prolly the cause for the speed
14:54:08FromDiscord<System64 ~ Flandre Scarlet> In reply to @ayex "yes - I can't": I dunno what to do against that sadly
15:06:46FromDiscord<ayex> sent a long message, see https://pasty.ee/FPuUnaxB
15:18:13FromDiscord<narimiran> In reply to @sys64 "I hate how Windows": time to change your software!!↵↵and by 'software', i mean: OS.
15:54:01FromDiscord<madonuko> In reply to @Elegantbeef "You have to be": https://github.com/nim-lang/Nim/issues/24780
15:54:41FromDiscord<madonuko> well… I'm proud of myself for discovering another bug in nim
15:54:47FromDiscord<madonuko> :nim1:
16:21:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @narimiran "time to change your": I'm on Linux↵But someone tested my software on Windows, the AV was not happy
16:22:03FromDiscord<narimiran> In reply to @madonuko "well… I'm proud of": I'm not proud of you for using Nim 2.1.9
16:23:58FromDiscord<madonuko> In reply to @narimiran "I'm not proud of": I thought I was using my system nim (which should update when I update my system); turns out I've been using choosenim so I never updated
16:26:22FromDiscord<enthus1ast.> In reply to @madonuko "docs for nimsutils finally": pretty logging: https://github.com/status-im/nim-chronicles↵ ?
16:26:56FromDiscord<madonuko> In reply to @enthus1ast. "pretty logging: https://github.com/status-im/nim-c": I don't think this works in VM?
16:27:16FromDiscord<enthus1ast.> Idk but it's pretty
16:27:28FromDiscord<madonuko> very much
16:28:29FromDiscord<madonuko> the logging implementations in `nimsutils` works under nimscripts (which is the entire point of `nimsutils`, it's called `nimsutils` because it's utilities for nimscript)
16:28:38FromDiscord<madonuko> and yeah just tested that, it doesn't work in VM
16:43:49*ntat quit (Quit: Leaving)
16:57:43*ntat joined #nim
17:04:01*ntat quit (Quit: Leaving)
17:05:44*ntat joined #nim
17:16:12*coldfeet quit (Quit: Lost terminal)
17:16:34*ntat quit (Quit: Leaving)
17:47:33*beholders_eye quit (Ping timeout: 248 seconds)
17:59:20*ntat joined #nim
19:08:25*ntat quit (Quit: Leaving)
19:28:31*GnuYawk quit (Quit: The Lounge - https://thelounge.chat)
19:28:52*GnuYawk joined #nim
20:00:24*coldfeet joined #nim
20:47:16*ntat joined #nim
21:30:17*coldfeet quit (Quit: Lost terminal)
21:54:47*ntat quit (Quit: leaving)
23:28:08*derpydoo joined #nim
23:41:24*derpydoo quit (Remote host closed the connection)
23:44:33*derpydoo joined #nim