00:00:11 | * | albe quit (Quit: The Lounge - https://thelounge.chat) |
00:02:21 | FromDiscord | <Robyn [She/Her]> In reply to @majortrips1763 "Is there any sort": Normally you use PascalCase I believe |
00:02:25 | FromDiscord | <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:11 | FromDiscord | <majortrips1763> Is there anyway to profile garbage creation? |
01:33:03 | FromDiscord | <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:26 | FromDiscord | <Elegantbeef> Most profile tooling comes down to using native tooling like valgrind and friends |
01:41:15 | FromDiscord | <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:53 | FromDiscord | <Elegantbeef> Just use `arc` and do not create cycles then you have determinism 😄 |
01:42:31 | FromDiscord | <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:36 | FromDiscord | <majortrips1763> Behold the shrine o'arc, do not question, simply offer up objects and have faith? |
01:43:00 | FromDiscord | <majortrips1763> Hehe |
01:43:41 | FromDiscord | <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:46 | FromDiscord | <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:32 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Well don't share references across threads and it should work fine |
01:45:20 | FromDiscord | <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:53 | FromDiscord | <majortrips1763> Running a kernel across multiple cores isn't exactly the same universe as multithreading |
01:46:49 | FromDiscord | <majortrips1763> At least w/ multithreading in userland, the kernel is doing a whole lot of bookeeping for the application. |
01:47:09 | FromDiscord | <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:07 | FromDiscord | <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:37 | FromDiscord | <majortrips1763> Exactly |
01:49:03 | FromDiscord | <majortrips1763> And yes, each userland application can fault in a copy of the kernel onto it's own core. |
01:49:17 | FromDiscord | <Elegantbeef> That sound's horrific |
01:49:20 | FromDiscord | <Elegantbeef> sounds even |
01:49:27 | FromDiscord | <majortrips1763> Yah, and that is normal kernel work |
01:50:02 | FromDiscord | <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:53 | FromDiscord | <majortrips1763> it gets even more exciting when you move from SMP to ASMP |
01:53:21 | FromDiscord | <Elegantbeef> Anyway arc is just an abstraction over manually deallocating resources so it should work just fine |
01:57:08 | FromDiscord | <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:35 | FromDiscord | <Elegantbeef> Yea have fun with your own data types and `=destroy` hooks 😄 |
01:58:54 | FromDiscord | <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:20 | FromDiscord | <majortrips1763> Is there any fun magic to get Nim to change the entrypoint symbol? |
02:09:02 | FromDiscord | <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:36 | FromDiscord | <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:18 | FromDiscord | <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:12 | FromDiscord | <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:41 | FromDiscord | <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:39 | FromDiscord | <random.visitor> sent a code paste, see https://play.nim-lang.org/#pasty=HWGphmXG |
02:39:23 | FromDiscord | <random.visitor> will have to be in the compiled .nim file for it to work from memory |
02:39:54 | FromDiscord | <random.visitor> chuck in a nim.cfg, --l: "-Wl,-eentryPoint" |
02:40:38 | FromDiscord | <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:18 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=tuEeeIkI |
02:41:30 | FromDiscord | <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:33 | FromDiscord | <majortrips1763> I am like .. 90% certain I have the rest figured out |
02:42:34 | FromDiscord | <majortrips1763> Though .. yopu may have just given me a huge hint... |
02:42:38 | FromDiscord | <majortrips1763> (edit) "yopu" => "you" |
02:44:08 | FromDiscord | <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:25 | FromDiscord | <random.visitor> (edit) "file." => "section." |
02:45:42 | FromDiscord | <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:44 | FromDiscord | <majortrips1763> Do any of these linker tricks work with `const` ? |
03:20:31 | FromDiscord | <random.visitor> can you give me an example of what you mean? |
03:29:26 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=VEkUPoEt |
03:32:58 | FromDiscord | <majortrips1763> also, can I reference Nim constants w/in the inline asm? |
03:37:21 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=gsYSREFE |
03:37:41 | FromDiscord | <random.visitor> sent a long message, see https://pasty.ee/vEUYsLWT |
03:38:36 | FromDiscord | <random.visitor> (edit) "https://pasty.ee/aZuiWPLz" => "https://pasty.ee/HLQSDfrV" |
03:39:55 | FromDiscord | <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:18 | FromDiscord | <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:24 | FromDiscord | <majortrips1763> Oh .. I can just leave the mbr_header w/in the `start()` proc |
03:41:39 | FromDiscord | <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:29 | FromDiscord | <majortrips1763> Soo .. the question then .. will the `import` before `proc start()` move `start` in the linking order ;P |
03:43:04 | FromDiscord | <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:22 | FromDiscord | <majortrips1763> Yah, it scans for the magic on the 4 byte boundaries |
03:43:33 | FromDiscord | <majortrips1763> and yah .. I suddenly think I know how Tom Duff felt |
03:43:52 | FromDiscord | <random.visitor> cool - otherwise function alignment might've given you some issues |
03:44:09 | FromDiscord | <random.visitor> should be fine regarding order of code blocks |
03:44:16 | FromDiscord | <random.visitor> as otherwise my code wouldn't be working at the moment |
03:44:27 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=aVZFKkgx |
03:44:56 | FromDiscord | <majortrips1763> assuming it doesn't optimize that const out of there ;P |
03:45:41 | FromDiscord | <Elegantbeef> consts do not get exported unless they're used |
03:46:04 | FromDiscord | <majortrips1763> In reply to @Elegantbeef "consts do not get": This one is inside of a `proc` |
03:46:38 | FromDiscord | <Elegantbeef> That doesn't mean anything |
03:46:55 | FromDiscord | <majortrips1763> Fair enough |
03:46:58 | FromDiscord | <Elegantbeef> `const` in Nim is a VM value, it is pasted in any place it's needed |
03:47:04 | FromDiscord | <Elegantbeef> If you do not use the value it's omitted |
03:49:35 | FromDiscord | <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:45 | FromDiscord | <random.visitor> though I forgot why I was looking up the specification |
03:50:42 | FromDiscord | <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:06 | FromDiscord | <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:42 | FromDiscord | <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:09 | FromDiscord | <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:27 | FromDiscord | <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:39 | FromDiscord | <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:49 | FromDiscord | <majortrips1763> Curious, does the `{.compile: ...}` pragma allow `.S` files? |
11:46:22 | FromDiscord | <Robyn [She/Her]> In reply to @majortrips1763 "Curious, does the `{.compile:": try it and see? |
11:46:36 | FromDiscord | <Robyn [She/Her]> i'd imagine it would |
11:49:59 | FromDiscord | <demotomohiro> In reply to @majortrips1763 "Was just noticing that": It should works as it just compile `.S` with backend C compiler. |
11:51:05 | FromDiscord | <demotomohiro> I did it before: https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L7 |
11:51:32 | FromDiscord | <demotomohiro> It compiled with GCC. |
11:52:46 | FromDiscord | <majortrips1763> In reply to @demotomohiro "I did it before:": Do you disable NimMain for this? |
11:54:31 | FromDiscord | <majortrips1763> For this whole project I should say. |
11:57:02 | FromDiscord | <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:58 | FromDiscord | <majortrips1763> https://github.com/demotomohiro/MinimumNimPico/blob/main/src/uartReg.nim#L36 ... |
12:03:04 | FromDiscord | <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:21 | FromDiscord | <einjonas> are params passed by ref or value |
12:29:30 | FromDiscord | <odexine> By value unless it is variable or a reference |
12:29:44 | FromDiscord | <einjonas> ok |
12:30:24 | FromDiscord | <einjonas> somehow nim feels a little crazy |
12:30:47 | FromDiscord | <einjonas> i mean the method syntax |
12:31:10 | FromDiscord | <einjonas> but it's nice to gives devs their preffered way |
12:32:21 | FromDiscord | <odexine> I think the method syntax is the best part |
12:33:01 | FromDiscord | <einjonas> (edit) "gives" => "give" |
12:33:17 | FromDiscord | <majortrips1763> Hmm, code docs postfix the declaration and not prefix it? |
12:39:08 | FromDiscord | <sOkam! 🫐> @jmgomez ty dude ❤️ https://media.discordapp.net/attachments/371759389889003532/1292828557957005343/image.png?ex=670527eb&is=6703d66b&hm=bf909cab4f9528fd1827ae3f11aaf2dc1a7ea1a39eaa72f9577f4ac1383eeae2& |
12:41:15 | FromDiscord | <odexine> In reply to @majortrips1763 "Hmm, code docs postfix": What do you mean? |
12:46:12 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=ffFHXHCy |
12:53:44 | Amun-Ra | I don't quire follow |
12:54:26 | Amun-Ra | do you meanig forward declarations? |
12:59:40 | FromDiscord | <fabric.input_output> you want the doc comments after the proc body? |
13:01:07 | FromDiscord | <majortrips1763> https://nim-lang.org/docs/docgen.html#document-types |
13:05:09 | * | xet7 joined #nim |
13:06:00 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=QVjXIYRA |
13:06:35 | Amun-Ra | yes, that's how it works |
13:08:00 | FromDiscord | <majortrips1763> sent a code paste, see https://play.nim-lang.org/#pasty=rNCYRBCA |
13:08:23 | FromDiscord | <majortrips1763> Also, not certain if I missed it, but not seeing how to document the proc params. |
13:08:39 | Amun-Ra | any doc comment declared at the root level goes to the document header |
13:12:58 | FromDiscord | <odexine> In reply to @majortrips1763 "Also, not certain if": There isn’t a defined format I think |
13:20:05 | FromDiscord | <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:49 | Amun-Ra | C 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:43 | FromDiscord | <majortrips1763> In reply to @Amun-Ra "C man pages are": Totally fair .. I just like how much data the pages have. |
14:04:19 | Amun-Ra | mhm |
14:08:33 | FromDiscord | <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:52 | FromDiscord | <zumi.dxy> even Rust (the perfect language) isn't safe from this, at least in third party crates |
14:23:37 | FromDiscord | <majortrips1763> Are there any docs for module writers? Guidelines and the like? |
14:25:48 | FromDiscord | <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:46 | FromDiscord | <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:58 | FromDiscord | <zumi.dxy> it also helps to provide gratuitous amounts of `runnableExamples` |
14:50:27 | FromDiscord | <zumi.dxy> actually—NEP1 is the code style |
14:50:38 | FromDiscord | <zumi.dxy> https://nim-lang.org/docs/docgen.html |
14:50:45 | FromDiscord | <zumi.dxy> this is the doc format |
14:51:38 | FromDiscord | <zumi.dxy> In reply to @zumi.dxy "it also helps to": <https://nim-lang.org/docs/system.html#runnableExamples%2Cstring%2Cuntyped> |
14:51:51 | FromDiscord | <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:55 | FromDiscord | <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:19 | FromDiscord | <zumi.dxy> of course being Nim these two are basically equivalent |
14:53:28 | FromDiscord | <zumi.dxy> and so is `start_http_server` |
14:53:53 | FromDiscord | <ayex> my old eyes would prefer `start_http_server` 😉 |
14:54:06 | FromDiscord | <Robyn [She/Her]> In reply to @zumi.dxy "Personally I'm starting to": no, i agree with you tbh :p |
14:54:10 | FromDiscord | <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:24 | FromDiscord | <ayex> and `Http_Server` |
14:54:40 | FromDiscord | <zumi.dxy> Ah yes, Ada_Case |
14:56:22 | FromDiscord | <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:13 | FromDiscord | <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:17 | FromDiscord | <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:39 | FromDiscord | <zumi.dxy> Lucky for you Nim prefers 2 |
14:59:02 | Amun-Ra | Ada's three space idents are unique |
14:59:30 | FromDiscord | <zumi.dxy> You can even get away with 1! |
14:59:43 | FromDiscord | <zumi.dxy> but that's a little masochistic |
14:59:47 | FromDiscord | <ayex> well, readability suffers |
14:59:53 | FromDiscord | <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:37 | FromDiscord | <ayex> to me 4 spaces is very readable, less than that and I have a hard time in longer procs.. |
15:01:11 | FromDiscord | <ayex> but yeah - old eyes. |
15:01:29 | Amun-Ra | yes, 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:37 | FromDiscord | <zumi.dxy> how much of that is due to Nim's design (either in language or stdlib) "encouraging" deep indentation? |
15:02:52 | Amun-Ra | and I use Python derived naming convention |
15:03:21 | FromDiscord | <zumi.dxy> like, if it's like that, then 4 spaces feels weirder than 2 |
15:03:30 | FromDiscord | <majortrips1763> sent a long message, see https://pasty.ee/UBwQxqJE |
15:03:30 | FromDiscord | <odexine> personally i ran out of shits to give after programming in whatever the fuck |
15:03:40 | FromDiscord | <odexine> so i just do whatever im told to yse |
15:03:41 | FromDiscord | <zumi.dxy> but then again I've got deeply-indented 4-spaced programs in python |
15:03:53 | FromDiscord | <majortrips1763> In reply to @odexine "so i just do": Exactly. |
15:04:33 | FromDiscord | <zumi.dxy> There's a trend of opinionated tooling lately |
15:05:14 | FromDiscord | <majortrips1763> I don't mind the opinions .. it is the self-contradiction that keeps me entertained. |
15:11:04 | FromDiscord | <odexine> ~~i think its fine until you do what go does with the caps for public shit~~ |
15:15:07 | FromDiscord | <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:40 | FromDiscord | <odexine> vso |
15:20:47 | FromDiscord | <majortrips1763> Doh, my brain said it right, my hands typed it wrong .. thanks for the catch. |
15:21:32 | Amun-Ra | polish 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:10 | Amun-Ra | and you often drop S and leave VO |
15:22:21 | Amun-Ra | S is known from V and O declension |
15:22:33 | FromDiscord | <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:27 | FromDiscord | <odexine> In reply to @Amun-Ra "polish is SVO but": filipino is vso but operates similarly |
15:29:53 | FromDiscord | <odexine> heck i dont think its apt to label stuff in filipino as subjects or objects |
15:30:29 | Amun-Ra | you can use only V as in "czytasz?" "(are you) reading?" |
15:31:41 | FromDiscord | <odexine> i always enjoy sending this wiki article about how filipino works https://en.wikipedia.org/wiki/Symmetrical_voice |
15:31:52 | FromDiscord | <odexine> though its a bit difficult to understand |
15:34:33 | Amun-Ra | that's interesing |
15:40:07 | FromDiscord | <majortrips1763> Really interesting .. never knew anything about this at all. |
15:42:57 | * | xet7 quit (Quit: Leaving) |
15:51:47 | FromDiscord | <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:47 | FromDiscord | <majortrips1763> Hmm .. https://forum.nim-lang.org/t/2755 |
16:05:52 | Amun-Ra | gokr has a point |
16:09:32 | FromDiscord | <majortrips1763> In reply to @Amun-Ra "gokr has a point": Agreed |
16:17:53 | FromDiscord | <majortrips1763> This has been an interesting read: https://github.com/nim-lang/Nim/issues/8370 |
16:20:14 | FromDiscord | <fabric.input_output> ah yes |
16:20:20 | FromDiscord | <fabric.input_output> immutable view types |
16:20:40 | FromDiscord | <fabric.input_output> when `const[ptr T]` |
16:21:18 | FromDiscord | <fabric.input_output> where are the pointers to immutable data bruce? |
16:21:29 | FromDiscord | <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:41 | FromDiscord | <majortrips1763> Hmm, trying to figure out a naming convention when having related object types (subtypes?). |
16:56:25 | FromDiscord | <majortrips1763> <Module><Type><Subtype>? |
17:05:27 | * | ntat joined #nim |
17:51:15 | * | dvbst joined #nim |
17:53:21 | FromDiscord | <.bobbbob> idk what view types are therefore they aren't important 😛 |
17:54:03 | FromDiscord | <fabric.input_output> In reply to @.bobbbob "idk what view types": pointers and references are a form of view types. `openArray` too |
17:54:51 | FromDiscord | <fabric.input_output> I would love to be able to return an `Option[lent T]` from a function |
17:55:16 | FromDiscord | <fabric.input_output> where the param is `lent A` |
17:55:38 | FromDiscord | <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:04 | FromDiscord | <einjonas> how can i dereference a pointer? |
19:40:40 | Amun-Ra | foo[] |
19:41:05 | FromDiscord | <double_spiral> is windy still in development or is it dead |
19:43:07 | FromDiscord | <einjonas> In reply to @Amun-Ra "foo[]": can i wrap it with a function? |
19:43:32 | FromDiscord | <einjonas> foo[] is kinda weird |
19:44:21 | FromDiscord | <odexine> Sure? |
19:44:51 | FromDiscord | <odexine> I think there may be some problems with wrapping it in a function but generally yes you could |
19:45:10 | Amun-Ra | usually an ordinary . works fine too |
19:48:31 | FromDiscord | <einjonas> In reply to @odexine "I think there may": maybe an macro? |
19:49:55 | Amun-Ra | and if you like to shoot yourself in a foot - a converter |
20:18:14 | FromDiscord | <einjonas> is there a way to alloc a struct/object on the heap? |
20:18:37 | FromDiscord | <einjonas> with still being in the arc |
20:20:56 | FromDiscord | <demotomohiro> In reply to @einjonas "is there a way": https://nim-lang.org/docs/system.html#new%2Ctypedesc |
20:21:22 | FromDiscord | <einjonas> thanks |
20:33:30 | FromDiscord | <einjonas> get an error after deref an string the second time |
20:33:43 | FromDiscord | <einjonas> it was allocated |
20:33:58 | FromDiscord | <einjonas> and i printed it with echo |
20:34:29 | FromDiscord | <einjonas> something with interal storage error |
20:35:14 | Amun-Ra | show an example |
20:35:48 | FromDiscord | <einjonas> i am not logged in on my other machine wait a sec |
20:38:31 | FromDiscord | <einjonas> proc main() = |
20:40:30 | FromDiscord | <einjonas> (edit) "proc main() =" => "sent a code paste, see https://play.nim-lang.org/#pasty=UJVNQMTb" |
20:40:44 | FromDiscord | <einjonas> that's not the real code |
20:40:47 | FromDiscord | <einjonas> but close |
20:40:54 | FromDiscord | <einjonas> just an example |
20:41:05 | FromDiscord | <einjonas> had some issues with discord |
20:41:26 | FromDiscord | <Elegantbeef> if the `ptr string` outlives the procedure you'll have a problem |
20:41:29 | Amun-Ra | you don't copy the data, you're only trying to copy pointers only |
20:41:35 | FromDiscord | <Elegantbeef> you likely want to do `s[] = i` |
20:42:53 | FromDiscord | <einjonas> oh thanks |
20:42:56 | FromDiscord | <einjonas> it worked |
20:43:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=eQJzlBXb |
20:43:31 | FromDiscord | <Elegantbeef> Though I'm uncertain why you're using `ptr string` |
20:43:44 | FromDiscord | <einjonas> is =destroy like raii? |
20:43:47 | FromDiscord | <Elegantbeef> If you want to share a string with multiple places use `ref T` |
20:43:49 | FromDiscord | <Elegantbeef> Yes |
20:44:07 | FromDiscord | <einjonas> i just wanted learn how to alloc in nim |
20:44:19 | Amun-Ra | use new |
20:44:27 | Amun-Ra | that's how you alloc in nim |
20:48:27 | FromDiscord | <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:56 | FromDiscord | <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:07 | FromDiscord | <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:14 | FromDiscord | <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:26 | FromDiscord | <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:33 | FromDiscord | <kiloneie> is there no other way other than `nimble install nimlangserver` and have it compile everytime ? |
21:16:44 | FromDiscord | <spotlightkid> every time when? |
21:17:35 | FromDiscord | <kiloneie> with every new version ? |
21:19:10 | FromDiscord | <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:07 | FromDiscord | <Elegantbeef> I think the response is spotlight, in many programs double click is not a distinct thing |
21:20:11 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> You can compile nimlangserver and move the binary to another device |
21:22:25 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/langserver/releases/tag/v1.6.0 or just download the binary |
21:22:53 | FromDiscord | <kiloneie> okay that last part flew over my head somehow |
21:23:01 | FromDiscord | <kiloneie> D: |
21:23:25 | FromDiscord | <Elegantbeef> There are prebuilt binaries you can download |
21:23:32 | FromDiscord | <Elegantbeef> You can download them and place them in your path |
21:23:35 | FromDiscord | <Elegantbeef> No compilation needed |
21:23:57 | FromDiscord | <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:11 | FromDiscord | <kiloneie> welp, my bad |
21:37:16 | FromDiscord | <double_spiral> In reply to @spotlightkid "You could use a": Yeah I ended up using a glfw wrapped |
21:37:27 | FromDiscord | <double_spiral> (edit) "wrapped" => "wrapper" |
21:44:44 | FromDiscord | <savantsupremellc> hi |
21:44:47 | FromDiscord | <savantsupremellc> i am new to nim |
21:44:59 | FromDiscord | <savantsupremellc> i'd like to make complex DSL |
21:45:04 | FromDiscord | <savantsupremellc> (edit) "i'd like to make complex DSL ... " added "easily" |
21:45:17 | FromDiscord | <savantsupremellc> what options do i have? |
21:46:42 | FromDiscord | <Elegantbeef> Learn macros and use them |
21:51:43 | * | rockcavera joined #nim |
22:00:51 | * | beholders_eye quit (Ping timeout: 276 seconds) |
22:06:51 | FromDiscord | <savantsupremellc> In reply to @Elegantbeef "Learn macros and use": well i've been doing that |
22:08:30 | FromDiscord | <savantsupremellc> still want something to make it easier |
22:11:22 | FromDiscord | <demotomohiro> Writing templates is easier than writing macros, but they cannot do all macros can do. |
22:12:26 | FromDiscord | <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:56 | FromDiscord | <savantsupremellc> but what if i'd like to match off some string code for usability |
22:14:48 | FromDiscord | <savantsupremellc> (edit) "but what if i'd like to match off some string code for usability ... " added "`"var $i: $type = $value": ...`" |
22:16:47 | FromDiscord | <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:23 | FromDiscord | <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:36 | FromDiscord | <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:08 | FromDiscord | <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:17 | FromDiscord | <treeform> I use most of my libs in my projects that are not open source. Mostly for work. |
23:29:28 | FromDiscord | <double_spiral> The readme is scary as it says its not ready to be used |
23:29:50 | FromDiscord | <treeform> I have not shipped anything with it yet. |
23:30:11 | FromDiscord | <treeform> To real people so it has not had users yet. |