<< 07-10-2024 >>

00:00:11*albe quit (Quit: The Lounge - https://thelounge.chat)
00:02:21FromDiscord<Robyn [She/Her]> In reply to @majortrips1763 "Is there any sort": Normally you use PascalCase I believe
00:02:25FromDiscord<Robyn [She/Her]> That's what I use, at least
00:03:20*albe joined #nim
00:21:47*disso-peach joined #nim
01:13:09*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
01:24:11FromDiscord<majortrips1763> Is there anyway to profile garbage creation?
01:33:03FromDiscord<majortrips1763> Ran across thread while trying to figure out performance considerations: https://www.reddit.com/r/nim/comments/yor0ue/how_to_write_performant_nim/
01:39:26FromDiscord<Elegantbeef> Most profile tooling comes down to using native tooling like valgrind and friends
01:41:15FromDiscord<majortrips1763> In reply to @Elegantbeef "Most profile tooling comes": I expected that for most of it, was more curious if there was any sort of reporting from the GC regarding reuse/cleanup/counts/etc
01:41:53FromDiscord<Elegantbeef> Just use `arc` and do not create cycles then you have determinism 😄
01:42:31FromDiscord<Elegantbeef> https://nim-lang.org/docs/system.html#getFreeMem there are some helpful procs here, do not recall if they're mapped for Arc/Orc
01:42:36FromDiscord<majortrips1763> Behold the shrine o'arc, do not question, simply offer up objects and have faith?
01:43:00FromDiscord<majortrips1763> Hehe
01:43:41FromDiscord<Elegantbeef> With arc it's all deterministic lifetimes(if you do not create cycles and have single ownership references) so there is not much to it, if you see an allocation it'll live until it's scope is ended
01:43:46FromDiscord<majortrips1763> This is interesting, dunno if it is still maintained or simply has reached some state of near perfection that needs no more code commits: https://github.com/zero-functional/zero-functional
01:44:32FromDiscord<majortrips1763> In reply to @Elegantbeef "With arc it's all": I am a bit skeptical as to how well it will work w/ N copies of the kernel running across N cores.
01:45:15FromDiscord<Elegantbeef> Well don't share references across threads and it should work fine
01:45:20FromDiscord<majortrips1763> I know, as long as malloc() and free() do their thing and all, and as long as all cores as always kept in-sync .. and cache invalidation between cores is working ;P
01:45:53FromDiscord<majortrips1763> Running a kernel across multiple cores isn't exactly the same universe as multithreading
01:46:49FromDiscord<majortrips1763> At least w/ multithreading in userland, the kernel is doing a whole lot of bookeeping for the application.
01:47:09FromDiscord<Elegantbeef> Running a kernel across multiple cores also isn't exactly the same as N copies of the kernel running across N cores.
01:48:07FromDiscord<Elegantbeef> If each userspace program needs to load it's own kernel I do not want to see what happens when two programs attempt to open a file
01:48:37FromDiscord<majortrips1763> Exactly
01:49:03FromDiscord<majortrips1763> And yes, each userland application can fault in a copy of the kernel onto it's own core.
01:49:17FromDiscord<Elegantbeef> That sound's horrific
01:49:20FromDiscord<Elegantbeef> sounds even
01:49:27FromDiscord<majortrips1763> Yah, and that is normal kernel work
01:50:02FromDiscord<majortrips1763> and the cache lines on each core are always out of sync, so there are intra processor signals that can be sent to do things like cache invalidation
01:50:53FromDiscord<majortrips1763> it gets even more exciting when you move from SMP to ASMP
01:53:21FromDiscord<Elegantbeef> Anyway arc is just an abstraction over manually deallocating resources so it should work just fine
01:57:08FromDiscord<majortrips1763> Right, but first I need to write up a slab allocator, and I am thinking about trying to map that over the top of a page allocator, and the kernel-level malloc() has to deal with its memory space vs allocating memory for userland applications which is a totally different problem space since it has to have virtual mappings created and tracked and the whole works. So much horrific fun.
01:57:35FromDiscord<Elegantbeef> Yea have fun with your own data types and `=destroy` hooks 😄
01:58:54FromDiscord<majortrips1763> Oh, there is no way to let Nim deal with the userland stuff .. it has to be done completely separately. And then there is the whole swap consideration (swapping to disk and swapping to compressed ram) .. like .. the rabbit hole goes down and down and down..
02:08:20FromDiscord<majortrips1763> Is there any fun magic to get Nim to change the entrypoint symbol?
02:09:02FromDiscord<Elegantbeef> I imagine you can compile with `--noMain` then make your own `myMain` which invokes `NimMain`
02:18:05*rockcavera quit (Remote host closed the connection)
02:21:36FromDiscord<random.visitor> not entirely sure about Nim specific, but there's a linker flag for changing the entry point. since you're writing an operating system, I suspect that's the best approach for you
02:22:18FromDiscord<random.visitor> of course, it really depends on what you're doing - e.g. using a boot loader that can parse ELF files, vs jmp at a specific offset to start your OS execution
02:23:12FromDiscord<random.visitor> if jmp to a specific address, you'll want the linker option and perhaps some declaration magic to make it where it needs to go
02:31:41FromDiscord<majortrips1763> Yah, I am really trying to avoid wiring in a boot.S to the whole thing, so making life as difficult as possible for myself in trying to do it purely in `.nim` files ;P
02:38:39FromDiscord<random.visitor> sent a code paste, see https://play.nim-lang.org/#pasty=HWGphmXG
02:39:23FromDiscord<random.visitor> will have to be in the compiled .nim file for it to work from memory
02:39:54FromDiscord<random.visitor> chuck in a nim.cfg, --l: "-Wl,-eentryPoint"
02:40:38FromDiscord<random.visitor> I looked into it a while ago and then moved to another project, so my memory might be a little fuzzy
02:41:18FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=tuEeeIkI
02:41:30FromDiscord<random.visitor> if you're using board specific compilers / not gcc / etc, maybe github will have some ideas on how to structure it
02:41:33FromDiscord<majortrips1763> I am like .. 90% certain I have the rest figured out
02:42:34FromDiscord<majortrips1763> Though .. yopu may have just given me a huge hint...
02:42:38FromDiscord<majortrips1763> (edit) "yopu" => "you"
02:44:08FromDiscord<random.visitor> you'll need to call do like nim c boot.nim to ensure that's the first function the compiler adds to the top of the .text file. if it's in another .nim file that's imported, the linker might have other functions first and then your start function
02:44:25FromDiscord<random.visitor> (edit) "file." => "section."
02:45:42FromDiscord<majortrips1763> Yah, I am using an `include` to drag in the arch-specific bootstrap at the top of the `kernel.nim`, it is always the first symbol.
03:14:44FromDiscord<majortrips1763> Do any of these linker tricks work with `const` ?
03:20:31FromDiscord<random.visitor> can you give me an example of what you mean?
03:29:26FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=VEkUPoEt
03:32:58FromDiscord<majortrips1763> also, can I reference Nim constants w/in the inline asm?
03:37:21FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=gsYSREFE
03:37:41FromDiscord<random.visitor> sent a long message, see https://pasty.ee/vEUYsLWT
03:38:36FromDiscord<random.visitor> (edit) "https://pasty.ee/aZuiWPLz" => "https://pasty.ee/HLQSDfrV"
03:39:55FromDiscord<random.visitor> re referencing nim constants in assembly, hmmm, the answer is probably no as far as I'm aware. you could access variables, but constants would have disappeared by the time you're in the assembler I'd have thought
03:40:18FromDiscord<random.visitor> you might be able to --genscript boot.nim and then edit cache/boot/compile.sh or whatever and gcc -S it to see what the linker is seeing
03:40:24FromDiscord<majortrips1763> Oh .. I can just leave the mbr_header w/in the `start()` proc
03:41:39FromDiscord<majortrips1763> the final ASM isn't going to care if the mbr_header is inside our outside of the `_start` proc in regards to Nim, I just need the final ASM to emit them all in the right order..
03:42:29FromDiscord<majortrips1763> Soo .. the question then .. will the `import` before `proc start()` move `start` in the linking order ;P
03:43:04FromDiscord<random.visitor> assuming the multiboot loader scans for the magic there and not assuming at a fixed offset of 4 bytes from the jmp statement, that'd hold true
03:43:22FromDiscord<majortrips1763> Yah, it scans for the magic on the 4 byte boundaries
03:43:33FromDiscord<majortrips1763> and yah .. I suddenly think I know how Tom Duff felt
03:43:52FromDiscord<random.visitor> cool - otherwise function alignment might've given you some issues
03:44:09FromDiscord<random.visitor> should be fine regarding order of code blocks
03:44:16FromDiscord<random.visitor> as otherwise my code wouldn't be working at the moment
03:44:27FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=aVZFKkgx
03:44:56FromDiscord<majortrips1763> assuming it doesn't optimize that const out of there ;P
03:45:41FromDiscord<Elegantbeef> consts do not get exported unless they're used
03:46:04FromDiscord<majortrips1763> In reply to @Elegantbeef "consts do not get": This one is inside of a `proc`
03:46:38FromDiscord<Elegantbeef> That doesn't mean anything
03:46:55FromDiscord<majortrips1763> Fair enough
03:46:58FromDiscord<Elegantbeef> `const` in Nim is a VM value, it is pasted in any place it's needed
03:47:04FromDiscord<Elegantbeef> If you do not use the value it's omitted
03:49:35FromDiscord<random.visitor> https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html - / Align 64 bits boundary. / .align 8 - your align 4 could be wrong
03:49:45FromDiscord<random.visitor> though I forgot why I was looking up the specification
03:50:42FromDiscord<random.visitor> you'll likely need to put whatever you need in an asm block just to make sure where it needs to go / doesn't get optimized out / etc
03:51:06FromDiscord<majortrips1763> In reply to @random.visitor "https://www.gnu.org/software/grub/manual/multiboot2": Yah, good catch .. my original boot.S I wrote like .. over decade ago .. has both multiboot1 and multiboot2 support in the same boot.S file. `.align 8` is correct for mb2.
03:51:42FromDiscord<majortrips1763> I manually removed a metric ton of `#ifdef` insanity from my copy/paste 🙂
03:53:20*SchweinDeBurg joined #nim
03:58:39*SchweinDeBurg quit (Ping timeout: 246 seconds)
04:00:39*SchweinDeBurg joined #nim
04:03:26*lucasta quit (Quit: Leaving)
04:40:04*ntat joined #nim
04:52:50*SchweinDeBurg quit (Ping timeout: 244 seconds)
04:54:58*SchweinDeBurg joined #nim
05:40:09FromDiscord<random.visitor> I'd favour towards putting the multiboot header in the start asm block - at least you know where it's going to be, and it'll be after the initial jmp
05:40:27FromDiscord<random.visitor> rather than any reordering issues later down the track
06:04:33*PMunch joined #nim
07:28:06*beholders_eye joined #nim
07:40:22*verytemporary190 joined #nim
07:45:36*verytemporary190 left #nim (#nim)
08:06:34*beholders_eye quit (Read error: Connection reset by peer)
08:19:11*beholders_eye joined #nim
09:00:02*beholders_eye quit (Read error: Connection reset by peer)
09:00:31*beholders_eye joined #nim
09:16:42*derpydoo joined #nim
09:57:09*beholders_eye quit (Ping timeout: 260 seconds)
09:58:54*beholders_eye joined #nim
10:12:52*ntat quit (Remote host closed the connection)
10:13:52*ntat joined #nim
10:17:22*ntat quit (Remote host closed the connection)
10:18:55*ntat joined #nim
10:23:45*lucerne joined #nim
10:24:22*ntat quit (Remote host closed the connection)
10:24:46*ntat joined #nim
10:40:14*beholders_eye quit (Ping timeout: 252 seconds)
10:56:15*derpydoo quit (Ping timeout: 260 seconds)
11:40:39FromDiscord<majortrips1763> In reply to @random.visitor "I'd favour towards putting": Was just noticing that various mb2 header tags can request explicit jmp addresses
11:45:49FromDiscord<majortrips1763> Curious, does the `{.compile: ...}` pragma allow `.S` files?
11:46:22FromDiscord<Robyn [She/Her]> In reply to @majortrips1763 "Curious, does the `{.compile:": try it and see?
11:46:36FromDiscord<Robyn [She/Her]> i'd imagine it would
11:49:59FromDiscord<demotomohiro> In reply to @majortrips1763 "Was just noticing that": It should works as it just compile `.S` with backend C compiler.
11:51:05FromDiscord<demotomohiro> I did it before: https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L7
11:51:32FromDiscord<demotomohiro> It compiled with GCC.
11:52:46FromDiscord<majortrips1763> In reply to @demotomohiro "I did it before:": Do you disable NimMain for this?
11:54:31FromDiscord<majortrips1763> For this whole project I should say.
11:57:02FromDiscord<demotomohiro> No, I didn't disable it.↵https://github.com/demotomohiro/MinimumNimPico/blob/main/src/startup.nim#L61↵It starts from `entryPoint` proc, then it jump to `resetHandler` and it calls `main` function in the generated C code.
11:57:58FromDiscord<majortrips1763> https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L36 ...
12:03:04FromDiscord<demotomohiro> And `main` function in the generated C code calls `main` proc (this procedure name should be mangled in generated C code) in https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L294
12:27:21FromDiscord<einjonas> are params passed by ref or value
12:29:30FromDiscord<odexine> By value unless it is variable or a reference
12:29:44FromDiscord<einjonas> ok
12:30:24FromDiscord<einjonas> somehow nim feels a little crazy
12:30:47FromDiscord<einjonas> i mean the method syntax
12:31:10FromDiscord<einjonas> but it's nice to gives devs their preffered way
12:32:21FromDiscord<odexine> I think the method syntax is the best part
12:33:01FromDiscord<einjonas> (edit) "gives" => "give"
12:33:17FromDiscord<majortrips1763> Hmm, code docs postfix the declaration and not prefix it?
12:39:08FromDiscord<sOkam! 🫐> @jmgomez ty dude ❤️ https://media.discordapp.net/attachments/371759389889003532/1292828557957005343/image.png?ex=670527eb&is=6703d66b&hm=bf909cab4f9528fd1827ae3f11aaf2dc1a7ea1a39eaa72f9577f4ac1383eeae2&
12:41:15FromDiscord<odexine> In reply to @majortrips1763 "Hmm, code docs postfix": What do you mean?
12:46:12FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=ffFHXHCy
12:53:44Amun-RaI don't quire follow
12:54:26Amun-Rado you meanig forward declarations?
12:59:40FromDiscord<fabric.input_output> you want the doc comments after the proc body?
13:01:07FromDiscord<majortrips1763> https://nim-lang.org/docs/docgen.html#document-types
13:05:09*xet7 joined #nim
13:06:00FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=QVjXIYRA
13:06:35Amun-Rayes, that's how it works
13:08:00FromDiscord<majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=rNCYRBCA
13:08:23FromDiscord<majortrips1763> Also, not certain if I missed it, but not seeing how to document the proc params.
13:08:39Amun-Raany doc comment declared at the root level goes to the document header
13:12:58FromDiscord<odexine> In reply to @majortrips1763 "Also, not certain if": There isn’t a defined format I think
13:20:05FromDiscord<majortrips1763> In reply to @odexine "There isn’t a defined": Yah, looked over the docgen code and a number of other sources and not seeing anything that would allow automatic break-out of various "sections". E.g. all the fun and useful things that make the C function man pages so dang useful. Synopsis, Description, Return Values, Errors, Standards, History, Caveats, Bugs, etc.. I suspect the vast majority of that stuff would end up needing to
13:25:49Amun-RaC man pages are not the best example as thay don't state what behavior is implementation defined and what's mandated by C standard
13:30:57*pbsds3 quit (Ping timeout: 248 seconds)
13:31:02*pbsds3 joined #nim
14:03:41*beholders_eye joined #nim
14:03:43FromDiscord<majortrips1763> In reply to @Amun-Ra "C man pages are": Totally fair .. I just like how much data the pages have.
14:04:19Amun-Ramhm
14:08:33FromDiscord<majortrips1763> I honestlty think that a lot of API docs anymore are little more than a copy of the function prototypes.
14:10:38*PMunch quit (Quit: Leaving)
14:14:19*anddam is now known as JasonRegimi-is-m
14:14:32*JasonRegimi-is-m is now known as Jason_Regimi
14:14:49*lucasta joined #nim
14:14:52FromDiscord<zumi.dxy> even Rust (the perfect language) isn't safe from this, at least in third party crates
14:23:37FromDiscord<majortrips1763> Are there any docs for module writers? Guidelines and the like?
14:25:48FromDiscord<majortrips1763> I am debating moving all of this multiboot work (version 1 and 2) into a module .. diving down the rabbit hole of writing a stack of parsers for the mbi data and such and realizing it is just going to end up being a rather huge piece of code.. no reason to leave it burried in a subdirectory of this kernel.
14:39:59*beholders_eye quit (Ping timeout: 245 seconds)
14:42:02*beholders_eye joined #nim
14:47:46FromDiscord<zumi.dxy> In reply to @majortrips1763 "Are there any docs": [NEP1](<https://nim-lang.org/docs/nep1.html>) is probably the closest thing
14:48:58FromDiscord<zumi.dxy> it also helps to provide gratuitous amounts of `runnableExamples`
14:50:27FromDiscord<zumi.dxy> actually—NEP1 is the code style
14:50:38FromDiscord<zumi.dxy> https://nim-lang.org/docs/docgen.html
14:50:45FromDiscord<zumi.dxy> this is the doc format
14:51:38FromDiscord<zumi.dxy> In reply to @zumi.dxy "it also helps to": <https://nim-lang.org/docs/system.html#runnableExamples%2Cstring%2Cuntyped>
14:51:51FromDiscord<majortrips1763> lol .. one of the lines in NEP1 is more than a little opinionated .. and ... IMHO .. is a bit confused as to the difference between a "word" and an "acronym" .. like .. they totally could have stated "treat acronyms like words" instead of...↵> In the age of HTTP, HTML, FTP, TCP, IP, UTF, WWW it is foolish to pretend these are somewhat special words requiring all uppercase.↵↵Quite a bit of hubris there.
14:52:55FromDiscord<zumi.dxy> Personally I'm starting to think that `startHttpServer` is a little easy on the eyes than `startHTTPServer` but that's just me
14:53:19FromDiscord<zumi.dxy> of course being Nim these two are basically equivalent
14:53:28FromDiscord<zumi.dxy> and so is `start_http_server`
14:53:53FromDiscord<ayex> my old eyes would prefer `start_http_server` 😉
14:54:06FromDiscord<Robyn [She/Her]> In reply to @zumi.dxy "Personally I'm starting to": no, i agree with you tbh :p
14:54:10FromDiscord<majortrips1763> Yah, I don't care about anyones reasoning .. any projects rules are their rules, I tend to not care so much either way. But there is this thing called the "land of tact" vs "the land of arrogance" .. and I tend to take some issues when someone feels they need to prime a conversation with negative tones as part of their rationale.
14:54:24FromDiscord<ayex> and `Http_Server`
14:54:40FromDiscord<zumi.dxy> Ah yes, Ada_Case
14:56:22FromDiscord<zumi.dxy> In reply to @zumi.dxy "Personally I'm starting to": I'm not hot with `nph`'s 88-line limit seeing as the windows I regularly code on have line lengths less than that↵True, I can always modify it and make my own `nph` but eh…
14:57:13FromDiscord<ayex> I am looking forward to the editor that leverages nims unique casing-insensitivity. like\: writing snake case for vars and Ada\_Case for types, but before commit they get converted to what upstream prefers.. 😁
14:58:17FromDiscord<majortrips1763> I personally am still a tabs person for most of my stuff, though I still tend to fall back on the excuse of "It was good enough for K&R .. and it saves space". I do find it a little humerous that there exists minifying tools to gut the huge glut of spaces from JS and friends considering that the vast majority of what they are removing are the metric ton of spaces caused by 4-space indents and soft tabs 😛
14:58:39FromDiscord<zumi.dxy> Lucky for you Nim prefers 2
14:59:02Amun-RaAda's three space idents are unique
14:59:30FromDiscord<zumi.dxy> You can even get away with 1!
14:59:43FromDiscord<zumi.dxy> but that's a little masochistic
14:59:47FromDiscord<ayex> well, readability suffers
14:59:53FromDiscord<majortrips1763> Anymore and my editor just does whatever the language enforces, else it uses what I prefer. There are better hills to die on ;P
15:00:37FromDiscord<ayex> to me 4 spaces is very readable, less than that and I have a hard time in longer procs..
15:01:11FromDiscord<ayex> but yeah - old eyes.
15:01:29Amun-Rayes, I use 4 space idents almost exclusively; nim is the exception; I started writing 2 space idented nim code and I can't switch to 4 space nim one
15:02:37FromDiscord<zumi.dxy> how much of that is due to Nim's design (either in language or stdlib) "encouraging" deep indentation?
15:02:52Amun-Raand I use Python derived naming convention
15:03:21FromDiscord<zumi.dxy> like, if it's like that, then 4 spaces feels weirder than 2
15:03:30FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/UBwQxqJE
15:03:30FromDiscord<odexine> personally i ran out of shits to give after programming in whatever the fuck
15:03:40FromDiscord<odexine> so i just do whatever im told to yse
15:03:41FromDiscord<zumi.dxy> but then again I've got deeply-indented 4-spaced programs in python
15:03:53FromDiscord<majortrips1763> In reply to @odexine "so i just do": Exactly.
15:04:33FromDiscord<zumi.dxy> There's a trend of opinionated tooling lately
15:05:14FromDiscord<majortrips1763> I don't mind the opinions .. it is the self-contradiction that keeps me entertained.
15:11:04FromDiscord<odexine> ~~i think its fine until you do what go does with the caps for public shit~~
15:15:07FromDiscord<majortrips1763> > Use subjectVerb, not verbSubject, e.g.: fileExists, not existsFile.↵↵While I totally agree with the rule, but I tend to wonder what it would be like to follow an OSV syntax (like English), or OVS (Klingon) .. I don't mind SVO though, Irish Gaelic is SVO and quite fun and relatively intuitive IMHO.
15:19:40FromDiscord<odexine> vso
15:20:47FromDiscord<majortrips1763> Doh, my brain said it right, my hands typed it wrong .. thanks for the catch.
15:21:32Amun-Rapolish is SVO but one may use VSO, OSV, OVS and so on… every form would be comprehensible, some of them going to sound old-polish and some weird
15:22:10Amun-Raand you often drop S and leave VO
15:22:21Amun-RaS is known from V and O declension
15:22:33FromDiscord<majortrips1763> I think my puppy uses verbs for subject and object.. it is all "PlayPlayPlay"
15:23:05*lucasta quit (Remote host closed the connection)
15:29:27FromDiscord<odexine> In reply to @Amun-Ra "polish is SVO but": filipino is vso but operates similarly
15:29:53FromDiscord<odexine> heck i dont think its apt to label stuff in filipino as subjects or objects
15:30:29Amun-Rayou can use only V as in "czytasz?" "(are you) reading?"
15:31:41FromDiscord<odexine> i always enjoy sending this wiki article about how filipino works https://en.wikipedia.org/wiki/Symmetrical_voice
15:31:52FromDiscord<odexine> though its a bit difficult to understand
15:34:33Amun-Rathat's interesing
15:40:07FromDiscord<majortrips1763> Really interesting .. never knew anything about this at all.
15:42:57*xet7 quit (Quit: Leaving)
15:51:47FromDiscord<majortrips1763> Soo .. I am curious about the entire decision to use `&` for adding strings together.. it seems a little odd. My brain still sees `&` as a bitwise operation.↵↵Like, considering `` is shorthand for `+` and all.. I dunno, E.g. 24 = 2+2+2+2
15:52:47FromDiscord<majortrips1763> Hmm .. https://forum.nim-lang.org/t/2755
16:05:52Amun-Ragokr has a point
16:09:32FromDiscord<majortrips1763> In reply to @Amun-Ra "gokr has a point": Agreed
16:17:53FromDiscord<majortrips1763> This has been an interesting read: https://github.com/nim-lang/Nim/issues/8370
16:20:14FromDiscord<fabric.input_output> ah yes
16:20:20FromDiscord<fabric.input_output> immutable view types
16:20:40FromDiscord<fabric.input_output> when `const[ptr T]`
16:21:18FromDiscord<fabric.input_output> where are the pointers to immutable data bruce?
16:21:29FromDiscord<fabric.input_output> I can't shill nim in this state
16:43:47*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
16:53:22*ntat quit (Quit: Leaving)
16:55:41FromDiscord<majortrips1763> Hmm, trying to figure out a naming convention when having related object types (subtypes?).
16:56:25FromDiscord<majortrips1763> <Module><Type><Subtype>?
17:05:27*ntat joined #nim
17:51:15*dvbst joined #nim
17:53:21FromDiscord<.bobbbob> idk what view types are therefore they aren't important 😛
17:54:03FromDiscord<fabric.input_output> In reply to @.bobbbob "idk what view types": pointers and references are a form of view types. `openArray` too
17:54:51FromDiscord<fabric.input_output> I would love to be able to return an `Option[lent T]` from a function
17:55:16FromDiscord<fabric.input_output> where the param is `lent A`
17:55:38FromDiscord<fabric.input_output> and `Option[var T]` from a function where the param is `var A`
18:25:56*coldfeet joined #nim
18:31:10*ntat quit (Quit: Leaving)
18:54:45*dvbst quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
19:04:48*beholders_eye quit (Ping timeout: 246 seconds)
19:06:52*beholders_eye joined #nim
19:38:04FromDiscord<einjonas> how can i dereference a pointer?
19:40:40Amun-Rafoo[]
19:41:05FromDiscord<double_spiral> is windy still in development or is it dead
19:43:07FromDiscord<einjonas> In reply to @Amun-Ra "foo[]": can i wrap it with a function?
19:43:32FromDiscord<einjonas> foo[] is kinda weird
19:44:21FromDiscord<odexine> Sure?
19:44:51FromDiscord<odexine> I think there may be some problems with wrapping it in a function but generally yes you could
19:45:10Amun-Rausually an ordinary . works fine too
19:48:31FromDiscord<einjonas> In reply to @odexine "I think there may": maybe an macro?
19:49:55Amun-Raand if you like to shoot yourself in a foot - a converter
20:18:14FromDiscord<einjonas> is there a way to alloc a struct/object on the heap?
20:18:37FromDiscord<einjonas> with still being in the arc
20:20:56FromDiscord<demotomohiro> In reply to @einjonas "is there a way": https://nim-lang.org/docs/system.html#new%2Ctypedesc
20:21:22FromDiscord<einjonas> thanks
20:33:30FromDiscord<einjonas> get an error after deref an string the second time
20:33:43FromDiscord<einjonas> it was allocated
20:33:58FromDiscord<einjonas> and i printed it with echo
20:34:29FromDiscord<einjonas> something with interal storage error
20:35:14Amun-Rashow an example
20:35:48FromDiscord<einjonas> i am not logged in on my other machine wait a sec
20:38:31FromDiscord<einjonas> proc main() =
20:40:30FromDiscord<einjonas> (edit) "proc main() =" => "sent a code paste, see https://play.nim-lang.org/#pasty=UJVNQMTb"
20:40:44FromDiscord<einjonas> that's not the real code
20:40:47FromDiscord<einjonas> but close
20:40:54FromDiscord<einjonas> just an example
20:41:05FromDiscord<einjonas> had some issues with discord
20:41:26FromDiscord<Elegantbeef> if the `ptr string` outlives the procedure you'll have a problem
20:41:29Amun-Rayou don't copy the data, you're only trying to copy pointers only
20:41:35FromDiscord<Elegantbeef> you likely want to do `s[] = i`
20:42:53FromDiscord<einjonas> oh thanks
20:42:56FromDiscord<einjonas> it worked
20:43:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=eQJzlBXb
20:43:31FromDiscord<Elegantbeef> Though I'm uncertain why you're using `ptr string`
20:43:44FromDiscord<einjonas> is =destroy like raii?
20:43:47FromDiscord<Elegantbeef> If you want to share a string with multiple places use `ref T`
20:43:49FromDiscord<Elegantbeef> Yes
20:44:07FromDiscord<einjonas> i just wanted learn how to alloc in nim
20:44:19Amun-Rause new
20:44:27Amun-Rathat's how you alloc in nim
20:48:27FromDiscord<spotlightkid> @treeform\: would have to answer this definitively, but it seems that many of his projects have not had much development in recent times, but usually they work quite well as is.↵(@double_spiral)
20:49:56FromDiscord<spotlightkid> You could use a glfw wrapper instead, but I like the support for double mouse clicks and, of course, that it's pure Nim.
20:51:55*coldfeet quit (Remote host closed the connection)
21:05:07FromDiscord<Elegantbeef> If you want double clicks don't you just pass your input state as a pointer to the glfw handler and check the time?
21:15:14FromDiscord<spotlightkid> glfw only has a simple clalback for mouse clicks\: https://www.glfw.org/docs/latest/input_guide.html#input_mouse_buttonOfc you can implement double-click detection in glfw yourself, but the point is, why should you have to?
21:15:26FromDiscord<spotlightkid> glfw only has a simple callback for mouse clicks\: https://www.glfw.org/docs/latest/input_guide.html#input_mouse_button Ofc you can implement double-click detection in glfw yourself, but the point is, why should you have to?
21:15:33FromDiscord<kiloneie> is there no other way other than `nimble install nimlangserver` and have it compile everytime ?
21:16:44FromDiscord<spotlightkid> every time when?
21:17:35FromDiscord<kiloneie> with every new version ?
21:19:10FromDiscord<spotlightkid> As far as i understand it, it needs to be compiled against the Nim version you're using it with, so, yes.
21:20:07FromDiscord<Elegantbeef> I think the response is spotlight, in many programs double click is not a distinct thing
21:20:11FromDiscord<kiloneie> that's 10 min on my desktop 2700x, and on just received used with problem with contact of monitor i3-7020u dual core laptop it takes about 20-25 min
21:22:00FromDiscord<Elegantbeef> You can compile nimlangserver and move the binary to another device
21:22:25FromDiscord<Elegantbeef> https://github.com/nim-lang/langserver/releases/tag/v1.6.0 or just download the binary
21:22:53FromDiscord<kiloneie> okay that last part flew over my head somehow
21:23:01FromDiscord<kiloneie> D:
21:23:25FromDiscord<Elegantbeef> There are prebuilt binaries you can download
21:23:32FromDiscord<Elegantbeef> You can download them and place them in your path
21:23:35FromDiscord<Elegantbeef> No compilation needed
21:23:57FromDiscord<kiloneie> im usually pissed if releases don't exist, and this time i simply saw, in order to get the lsp, and here is the command... and totally missed the releases part
21:24:11FromDiscord<kiloneie> welp, my bad
21:37:16FromDiscord<double_spiral> In reply to @spotlightkid "You could use a": Yeah I ended up using a glfw wrapped
21:37:27FromDiscord<double_spiral> (edit) "wrapped" => "wrapper"
21:44:44FromDiscord<savantsupremellc> hi
21:44:47FromDiscord<savantsupremellc> i am new to nim
21:44:59FromDiscord<savantsupremellc> i'd like to make complex DSL
21:45:04FromDiscord<savantsupremellc> (edit) "i'd like to make complex DSL ... " added "easily"
21:45:17FromDiscord<savantsupremellc> what options do i have?
21:46:42FromDiscord<Elegantbeef> Learn macros and use them
21:51:43*rockcavera joined #nim
22:00:51*beholders_eye quit (Ping timeout: 276 seconds)
22:06:51FromDiscord<savantsupremellc> In reply to @Elegantbeef "Learn macros and use": well i've been doing that
22:08:30FromDiscord<savantsupremellc> still want something to make it easier
22:11:22FromDiscord<demotomohiro> Writing templates is easier than writing macros, but they cannot do all macros can do.
22:12:26FromDiscord<savantsupremellc> for instance, as i understand it `krux02/ast-pattern-matching` provides some lib for some of the patterns of constructing DSL (pattern matchin body)
22:12:56FromDiscord<savantsupremellc> but what if i'd like to match off some string code for usability
22:14:48FromDiscord<savantsupremellc> (edit) "but what if i'd like to match off some string code for usability ... " added "`"var $i: $type = $value": ...`"
22:16:47FromDiscord<savantsupremellc> In reply to @Elegantbeef "Learn macros and use": i want a elegant solution for defining `"only allow {x} command in macro body- with arg0 {x} of {y} ..."`
22:17:23FromDiscord<savantsupremellc> (edit) "In reply to @Elegantbeef "Learn macros and use": i want a elegant solution for defining `"only allow {x} command in macro body- with arg0 ... {x}" added "bein"
22:23:45*tiorock joined #nim
22:23:45*rockcavera is now known as Guest9263
22:23:45*tiorock is now known as rockcavera
22:25:36FromDiscord<demotomohiro> Recursively check each `NimNode` in given AST and when its kind is `nnkCall`, check called procedure name and arguments.
22:25:50*tiorock joined #nim
22:25:50*rockcavera is now known as Guest5268
22:25:50*tiorock is now known as rockcavera
22:27:31*Guest9263 quit (Ping timeout: 252 seconds)
22:28:59*Guest5268 quit (Ping timeout: 252 seconds)
23:27:08FromDiscord<treeform> In reply to @double_spiral "is windy still in": I use it nearly every day. There is no new dev because it works for me.
23:29:17FromDiscord<treeform> I use most of my libs in my projects that are not open source. Mostly for work.
23:29:28FromDiscord<double_spiral> The readme is scary as it says its not ready to be used
23:29:50FromDiscord<treeform> I have not shipped anything with it yet.
23:30:11FromDiscord<treeform> To real people so it has not had users yet.