00:43:41 | * | tokyovigilante_ joined #nim |
00:44:21 | * | tokyovigilante quit (Ping timeout: 246 seconds) |
00:44:21 | * | tokyovigilante_ is now known as tokyovigilante |
01:02:18 | FromDiscord | <Savant> sent a long message, see https://pasty.ee/khiuBurT |
01:02:32 | FromDiscord | <Savant> sent a long message, see https://pasty.ee/kalrlMBZ |
01:02:33 | FromDiscord | <Savant> sent a long message, see https://pasty.ee/tEbrupzP |
01:02:33 | FromDiscord | <Savant> sent a long message, see https://pasty.ee/IApBRkjb |
01:07:53 | FromDiscord | <Elegantbeef> > has its own proprietary syntax as well ? |
01:10:01 | FromDiscord | <Savant> ? |
01:10:14 | FromDiscord | <Elegantbeef> What do you mean it has a proprietary syntax |
01:10:22 | FromDiscord | <Savant> sorry |
01:10:51 | FromDiscord | <Savant> i'd like to use the same "syntax" in compile time as i would at runtime |
01:10:51 | FromDiscord | <Savant> is that silly? |
01:10:53 | FromDiscord | <Savant> things like NimNode |
01:10:54 | FromDiscord | <Elegantbeef> Yes |
01:10:56 | FromDiscord | <Savant> parseStmt |
01:10:57 | FromDiscord | <Savant> etc |
01:11:02 | FromDiscord | <Savant> how's that |
01:11:05 | FromDiscord | <Savant> seems like it would be pretty sweet to me |
01:11:50 | FromDiscord | <Elegantbeef> Nim is a statically compiled language, which means the runtime would have to have a VM embedded into it to be able to parse and interpret the code |
01:12:45 | FromDiscord | <Savant> forgive my ignorance but that seems like the reasoning for why it does not already exist |
01:12:51 | FromDiscord | <Savant> naturally |
01:13:13 | FromDiscord | <Elegantbeef> Right, which is why it's silly |
01:13:17 | FromDiscord | <Savant> hm |
01:13:58 | FromDiscord | <Elegantbeef> Having a language that is statically compiled, but also can do things at runtime is incompatible imo |
01:14:51 | FromDiscord | <Elegantbeef> If you can do `var a = someMacro()` and `someMacro` is evaluated at runtime you now have `a` which is not static |
01:16:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=VfHhhJko |
01:20:31 | FromDiscord | <Elegantbeef> Actually I misinterpreted what you meant |
01:20:40 | FromDiscord | <Elegantbeef> you can use the nimscript api and use the same syntax just fine |
01:20:46 | FromDiscord | <Savant> bruh |
01:20:47 | FromDiscord | <Savant> really |
01:20:58 | FromDiscord | <Elegantbeef> Well yea nimscript is a language |
01:21:01 | FromDiscord | <Savant> yea i don't want execution / vm stuff |
01:21:37 | FromDiscord | <Savant> i just want my parsing logic to be the same in a compile time and runtime |
01:21:40 | FromDiscord | <Elegantbeef> So then write code that works at CT and runtime |
01:22:57 | FromDiscord | <Elegantbeef> Unlike other languages with CTE, Nim's CT doesn't require any annotations to use a procedure written |
01:27:01 | FromDiscord | <Savant> `system/nimscript` provides the same ast exports as `macros`? |
01:27:01 | FromDiscord | <Savant> well that's simply what i'd like |
01:27:09 | FromDiscord | <Elegantbeef> No |
01:27:10 | FromDiscord | <Savant> without the hubba bubba about VM junk |
01:27:12 | FromDiscord | <Elegantbeef> Well that's not how this works, you have to embed the VM |
01:27:15 | FromDiscord | <Savant> hm |
01:27:19 | FromDiscord | <Savant> i gotcha |
01:27:21 | FromDiscord | <Savant> but if we remove execution |
01:27:24 | FromDiscord | <Savant> doesn't it sorta work like dat |
01:27:26 | FromDiscord | <Elegantbeef> Stop using `parseStmt` for 'parsing' |
01:27:40 | FromDiscord | <Elegantbeef> You can hook up the nim parser and use that alone if you want |
01:28:06 | FromDiscord | <Elegantbeef> I have no example of that, but atlas I believe does it |
01:29:08 | FromDiscord | <Savant> very new to nim coming from js |
01:29:13 | FromDiscord | <Savant> this↵https://raw.githubusercontent.com/elcritch/cdecl/refs/heads/main/src/cdecl/compiler/macros2.nim |
01:29:14 | FromDiscord | <Savant> i'll look into this |
01:29:15 | FromDiscord | <Savant> really seems exactly what i want |
01:29:17 | FromDiscord | <Savant> thanks |
01:29:23 | FromDiscord | <Savant> with even like `parseStmt` overwrittetn |
01:29:24 | FromDiscord | <Elegantbeef> Why are you using parsestmt anyway? |
01:29:43 | FromDiscord | <Savant> but... i get issues i think related to new versions of nim/libs |
01:31:06 | FromDiscord | <Savant> to load some code into a nimnode stmt |
01:31:07 | FromDiscord | <Elegantbeef> So you're using it to piggy back on the Nim parser instead of writing your own? |
01:31:32 | FromDiscord | <Savant> i guess if thats how it works |
01:32:18 | FromDiscord | <Elegantbeef> Well what do you do with the node after? |
01:32:35 | FromDiscord | <Savant> currently im just doing some basic stuff like looping its children / validating the code thereafter - extracting some information for whatever purposes i may have |
01:33:20 | FromDiscord | <Savant> later it'll include transformation |
01:33:25 | FromDiscord | <Elegantbeef> Is this for a file format, compilation, or something else? |
01:33:32 | FromDiscord | <Savant> file format |
01:33:38 | FromDiscord | <Savant> trying to do js `{}` |
01:33:39 | FromDiscord | <Savant> mixed with `:` |
01:34:09 | FromDiscord | <Elegantbeef> So yes this is a poor usage of the parser |
01:34:14 | FromDiscord | <Savant> haha |
01:34:15 | FromDiscord | <Elegantbeef> Writing a parser from scratch to match a spec will make your life so much easier |
01:34:17 | FromDiscord | <Elegantbeef> But it's a nice shortcut to working code |
01:34:20 | FromDiscord | <Elegantbeef> Parsers are not hard to write |
01:35:51 | FromDiscord | <Elegantbeef> Also by `js` do you mean json or javascript |
01:35:57 | FromDiscord | <Elegantbeef> Cause one is compilation the other is a fileformat in my definition |
01:36:05 | FromDiscord | <Savant> sorry i meant like i want `{}` identation mixed in with the python `:` |
01:36:07 | FromDiscord | <Savant> as seen in "js" |
01:36:20 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
01:38:51 | FromDiscord | <Savant> i made it poorly happen with some regex like stuff -\>↵created new file "compiler" which "transpiles" at runtime then calls normal nim command with args passed through |
01:38:58 | FromDiscord | <Savant> i want to have- like a header or something, where i could denote something |
01:38:59 | FromDiscord | <Savant> this all works really groovy for how shitty i am |
01:39:02 | FromDiscord | <Savant> but the problem now became |
01:39:06 | FromDiscord | <Savant> and i want to extract that bit of info at runtime |
01:39:27 | FromDiscord | <Savant> but i want to use the same funcs |
01:39:32 | FromDiscord | <Savant> bc later my utility will grow large |
01:40:28 | FromDiscord | <Elegantbeef> Well there's your problem, regex is hardly a solution to this problem 😄 |
01:40:30 | FromDiscord | <Savant> be kinda messy having two systems even tho the solution is bridging two systems |
01:40:38 | FromDiscord | <Savant> YEA haha i understand that part of it |
01:40:42 | FromDiscord | <Savant> BUT it works for me now |
01:40:46 | FromDiscord | <Savant> what could you tell me abt this? |
01:40:56 | FromDiscord | <Savant> isn't this sorta like regex with organization |
01:41:04 | FromDiscord | <Elegantbeef> No |
01:42:06 | FromDiscord | <Elegantbeef> I mean design a requirement for the language, then write a parser that extracts it to an AST then process it how you want |
01:42:21 | FromDiscord | <Savant> do you have any ref on that process of "parsing to AST" |
01:42:29 | FromDiscord | <Savant> thats what i meant sorry |
01:42:56 | FromDiscord | <Elegantbeef> crafting interpreters |
01:43:09 | FromDiscord | <Savant> awesome thanks |
01:45:23 | FromDiscord | <Savant> will look into this |
01:47:14 | FromDiscord | <Savant> if im not mistaken this is that |
01:47:17 | FromDiscord | <Savant> https://raw.githubusercontent.com/elcritch/cdecl/refs/heads/main/src/cdecl/compiler/macros2.nim |
01:47:25 | FromDiscord | <Elegantbeef> Correct |
01:47:30 | FromDiscord | <Elegantbeef> But that's still a bad idea to rely on |
01:47:37 | FromDiscord | <Savant> yeah yeah yeah |
01:56:52 | * | lucasta joined #nim |
02:00:32 | FromDiscord | <Savant> but then also i couldnt use the same utility for compile time |
02:01:31 | FromDiscord | <Savant> cheeky cheeky ok |
02:01:34 | FromDiscord | <Elegantbeef> Correct, time to write a parser |
02:01:35 | FromDiscord | <Savant> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1296654115081945108): but then also i couldnt use the same utility for compile time? |
02:08:46 | * | rockcavera quit (Remote host closed the connection) |
02:15:00 | * | lucasta quit (Quit: Leaving) |
02:42:05 | * | pmp-p quit (Ping timeout: 252 seconds) |
02:45:21 | * | pmp-p joined #nim |
03:47:21 | * | SchweinDeBurg joined #nim |
04:08:40 | * | Guest76 joined #nim |
04:40:32 | * | pmp-p quit (Ping timeout: 252 seconds) |
04:46:48 | * | pmp-p joined #nim |
05:52:59 | * | Guest76 quit (Ping timeout: 256 seconds) |
06:01:11 | FromDiscord | <spaceshaman> how do I uh... append strings 👉 👈 |
06:03:29 | FromDiscord | <spaceshaman> got it. I wanted `&` |
06:04:01 | FromDiscord | <spaceshaman> is `&=` effectively the same as `.add(`? |
06:05:15 | FromDiscord | <odexine> yes |
06:16:59 | FromDiscord | <spaceshaman> are templates auto inlined code? How do I ensure something is ctfe? do you have to assign to const? |
06:17:06 | FromDiscord | <kiloneie> In reply to @Elegantbeef "Kate does seem faster": I think it's about the same, but i prefer Geany's well most things. |
06:18:10 | FromDiscord | <Elegantbeef> `const` or `static`↵(@spaceshaman) |
06:18:37 | FromDiscord | <kiloneie> In reply to @spaceshaman "are templates auto inlined": every value simply has to be known at compile time, i think even a `var` can work as long as the data is known at compile time(last i checked) |
06:19:02 | FromDiscord | <spaceshaman> > static means comptime↵Flashbacks to D |
06:20:11 | FromDiscord | <spaceshaman> so `echo static factorial(5)` is computing factorial in ctfe? |
06:22:39 | FromDiscord | <odexine> should be yes |
06:25:40 | FromDiscord | <spaceshaman> nim is forward declared |
06:25:55 | FromDiscord | <Elegantbeef> No |
06:26:12 | FromDiscord | <odexine> what? |
06:26:18 | FromDiscord | <spaceshaman> I might be using that term inverted |
06:26:28 | FromDiscord | <Elegantbeef> I assume they're pointing out that Nim requires order of declaration to match order of use |
06:26:50 | FromDiscord | <spaceshaman> yeah |
06:27:03 | FromDiscord | <spaceshaman> wait |
06:27:15 | FromDiscord | <spaceshaman> you mean declaration must precede use |
06:27:18 | FromDiscord | <Elegantbeef> As much as people hate it, I sure as shit love it reading code |
06:27:43 | FromDiscord | <Elegantbeef> Well you have to declare procedures before you can use them so I think in an odd shitty way I was right |
06:28:36 | FromDiscord | <spaceshaman> oh but not functions? |
06:28:43 | FromDiscord | <odexine> procedures are "functions" |
06:28:46 | FromDiscord | <Elegantbeef> They're the same thing |
06:28:53 | FromDiscord | <Elegantbeef> Functions are procedures |
06:28:53 | FromDiscord | <odexine> different terminology |
06:29:04 | FromDiscord | <spaceshaman> right but the different keywords |
06:29:07 | FromDiscord | <Elegantbeef> But not all procedures are functions |
06:29:37 | FromDiscord | <odexine> i mean what i said in the common use of the term function |
06:29:42 | FromDiscord | <spaceshaman> I was wondering for a moment if it did the haskel thing where declarative code is order free |
06:29:46 | FromDiscord | <odexine> not in the functional programming usage which is rarer |
06:30:19 | FromDiscord | <spaceshaman> ive been hanging around PL devs too much |
06:31:59 | FromDiscord | <spaceshaman> In reply to @Elegantbeef "As much as people": Ive been going through my pl feature preferences and applying a principled razor to them. I think this is one I missed. Declaration before use is probably a good thing. |
06:32:36 | FromDiscord | <spaceshaman> Recently I switched sides on the brackets vs indentation debate |
06:32:54 | FromDiscord | <Elegantbeef> It does make it so much easier to read code when you know a procedure is above you |
06:33:33 | FromDiscord | <Elegantbeef> Arguably one can say "just use tooling", but it's nice to the mind when reading code top down and building up mindscape of whats what |
06:33:43 | FromDiscord | <zumi.dxy> So it's preferable than using code reordering? |
06:33:51 | FromDiscord | <Elegantbeef> It is to me |
06:34:06 | FromDiscord | <spaceshaman> Its also harder to half ass the implementation of forward declaration of symbols in the compiler if you just axe that |
06:34:08 | FromDiscord | <Elegantbeef> Whether you like having your code all spaghetified is between you and your god |
06:34:23 | FromDiscord | <spaceshaman> In reply to @spaceshaman "Its also harder to": godot fucks this up so bad |
06:34:39 | FromDiscord | <Elegantbeef> Just make a multi pass compiler, how hard could it be! |
06:34:47 | FromDiscord | <kiloneie> hmm, but if one enforced forward declaration when sharing code, but it was possible to do it anywhere... still probably worse than not being possible ... i think... the benefits are what ? spagheti code ? i already freak out on code longer than 2x page scroll, you want me to jump up and down like we are using ˙goto`s ? |
06:35:00 | FromDiscord | <spaceshaman> In reply to @Elegantbeef "Just make a multi": ...said many foolish pl devs |
06:35:29 | FromDiscord | <Elegantbeef> The benefits are simply order independent usage at the cost of a complex problem especially when you have macros |
06:35:40 | FromDiscord | <kiloneie> when was `include` added ? i don't remember it at 1.0... |
06:35:46 | FromDiscord | <Elegantbeef> Pre 1.0 |
06:35:50 | FromDiscord | <kiloneie> oh damn |
06:35:52 | * | coldfeet joined #nim |
06:35:56 | FromDiscord | <Elegantbeef> Never use include unless you're making one file out of many, thanks |
06:36:10 | FromDiscord | <Elegantbeef> Pretend like include does not exist |
06:36:30 | FromDiscord | <spaceshaman> Allong the same lines, I think identifiers `should_have_separators` like `snake_case` or `kebab-case` |
06:36:42 | FromDiscord | <Elegantbeef> Eh camel case reads fine enough |
06:36:46 | FromDiscord | <spaceshaman> no |
06:36:53 | FromDiscord | <spaceshaman> no it does not. |
06:36:58 | FromDiscord | <Elegantbeef> It does to me |
06:37:04 | FromDiscord | <kiloneie> In reply to @Elegantbeef "Never use include unless": im only using it to spread out e.g. Player, Wall, EnemyMario into their own little files, not actually splitting the code |
06:37:12 | FromDiscord | <Elegantbeef> So then use `import` |
06:38:18 | FromDiscord | <kiloneie> In reply to @Elegantbeef "So then use `import`": what does import achieve that include doesn't in my case ? |
06:38:23 | FromDiscord | <Elegantbeef> The issue with `include` is that you recompile the file into the module that `include` does |
06:38:29 | FromDiscord | <spaceshaman> camel case can be pretty but its less readable than just having a gap |
06:39:09 | FromDiscord | <Elegantbeef> So later on if you ever want to do something like `import bleh/player` you now have multiple symbols that are identical but not the same type and interfere with overload |
06:39:43 | FromDiscord | <spaceshaman> regarding indentation though, I dont like dynamic typing. Why did I spend all those years prefering dynamic indentation using brackets? |
06:40:01 | FromDiscord | <Elegantbeef> Python sold you a world and you turned it down |
06:40:12 | FromDiscord | <kiloneie> In reply to @Elegantbeef "So later on if": oh, im not using it for that https://media.discordapp.net/attachments/371759389889003532/1296724492755664896/image.png?ex=6713544b&is=671202cb&hm=a3595bd9e2f45304f4030e9c5dac04877447c1258ca062321b228a9252980c2c& |
06:40:22 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1296724538612252693/image.png?ex=67135455&is=671202d5&hm=91d92a7697e453998a94f122469ac867296530e13ee8f8f24c07d7a33ebcc46b& |
06:40:25 | FromDiscord | <Elegantbeef> What's `objects` have? |
06:40:30 | FromDiscord | <kiloneie> uhm |
06:40:38 | FromDiscord | <Elegantbeef> Yea I do not see why you'd use `include` for this |
06:40:50 | FromDiscord | <kiloneie> https://media.discordapp.net/attachments/371759389889003532/1296724655251521537/image.png?ex=67135471&is=671202f1&hm=4aa771b4520b07da94eccc8584ee0b9b4cbe2a2dea1a6ed2b9cfc269b1196053& |
06:40:53 | FromDiscord | <Elegantbeef> I mean I actively use delayed imports though, so I'm probably not the best person to refer to |
06:41:02 | FromDiscord | <Elegantbeef> TIHI |
06:41:16 | FromDiscord | <spaceshaman> Ive pretty much always prefered static typing so there was no big change there. Arguably this all came from there |
06:41:21 | FromDiscord | <kiloneie> i snagged a macro to simply auto include me the whole DIR |
06:41:45 | FromDiscord | <kiloneie> i will see if i need import, but atm im not sold for this case |
06:41:49 | FromDiscord | <Elegantbeef> Well then I guess that works, although it's uh huh |
06:42:18 | FromDiscord | <kiloneie> i do wish Nim's LSP would shut up on player.nim being an error inside of it |
06:42:26 | FromDiscord | <kiloneie> on it's own |
06:42:55 | FromDiscord | <Elegantbeef> Well include is fine here, but i'd still import it and not include the player module |
06:43:05 | FromDiscord | <Elegantbeef> If we're caring about my opinion that is |
06:43:25 | FromDiscord | <kiloneie> what kind of checks does import do ? |
06:43:29 | FromDiscord | <Elegantbeef> include is a specialised tool to me and should only be used in situations where import + delayed imports do not work |
06:43:49 | FromDiscord | <Elegantbeef> A module that is imported must be compilable |
06:43:55 | FromDiscord | <Elegantbeef> That's it |
06:44:06 | FromDiscord | <kiloneie> include doesn't ? |
06:44:14 | FromDiscord | <Elegantbeef> Nope it pastes code in |
06:44:23 | FromDiscord | <kiloneie> oO |
06:44:24 | FromDiscord | <Elegantbeef> I do not even know if needs to be parsable, I imagine so |
06:44:33 | FromDiscord | <kiloneie> hmm but this does have use cases ... |
06:45:02 | FromDiscord | <Elegantbeef> include must compile after including, import is a compilable standalone module |
06:45:25 | FromDiscord | <Elegantbeef> For context on delayed imports https://github.com/beef331/nimtrest/wiki/Code-snippets#delayed-imports |
06:53:43 | FromDiscord | <kiloneie> Okay, so when i will be pushing out all "drawing" procs into a file, i should NOT include but import.↵↵Can one just `export` the whole module ? (i see that you can import and export what you imported, but can you just `export self/selfFilename` or `export appDir()` ? |
06:54:20 | FromDiscord | <fabric.input_output> yes |
06:54:23 | FromDiscord | <Elegantbeef> `export modulename` if you import a module |
06:55:15 | FromDiscord | <kiloneie> In reply to @Elegantbeef "`export modulename` if you": you mean that i have to export modules that are imported in the importable module ? |
06:55:38 | FromDiscord | <Elegantbeef> You have to export any modules you want accessible yes |
06:56:24 | FromDiscord | <kiloneie> but not if only that module needs them ? e.g. macros for "objects.nim", but main.nim doesn't need that ? |
06:56:39 | FromDiscord | <Elegantbeef> They work just like normal modules |
06:56:57 | FromDiscord | <Elegantbeef> You only export what you want someone else to get from importing this module |
06:56:57 | FromDiscord | <kiloneie> i've never really thought about this 😛 |
06:57:10 | FromDiscord | <kiloneie> okay, seems simple enough |
06:57:47 | FromDiscord | <kiloneie> does it matter where you export though ? the end ? start ? doesn't matter ? |
06:58:24 | FromDiscord | <Elegantbeef> I want you to think that question through |
06:59:46 | FromDiscord | <kiloneie> i'd say the end if i want the entire module exported, but i don't know how the compiler works |
07:00:06 | FromDiscord | <Elegantbeef> Why would exporting a symbol change how a module is compiled? |
07:00:34 | FromDiscord | <Elegantbeef> does `proc doThing() = discard` suddenly stop working inside this module if you remove the `` |
07:02:37 | FromDiscord | <kiloneie> im not sure your example is comparable... im just saying that if `export AppDir()` is at the start of module b, then the compiler will know to... hmm i guess it doesn't matter. I guess main would just check what is exported from that module and import it |
07:02:48 | FromDiscord | <Elegantbeef> There you go |
07:02:53 | FromDiscord | <Elegantbeef> They are comparable |
07:03:04 | * | coldfeet quit (Remote host closed the connection) |
07:03:26 | FromDiscord | <Elegantbeef> also it's just `AppDir` not `AppDir()` |
07:03:52 | FromDiscord | <Elegantbeef> Export order does not matter cause symbols exported are added to a list of symbols |
07:04:04 | FromDiscord | <Elegantbeef> There is nothing special about export that makes it order dependant |
07:04:51 | FromDiscord | <Elegantbeef> When you import a module it compiles the module if it was not compiled, then introduces all exported symbols |
07:04:52 | FromDiscord | <kiloneie> i was wrongly remember adding the () i guess. I forget when `()` is required... no arguments procs right ? i know it when im coding, but i can't remember right now |
07:05:13 | FromDiscord | <Elegantbeef> `()` is required when you're invoking, that's it |
07:05:47 | FromDiscord | <Elegantbeef> `export` works symbols not values so invoke makes little sense there |
07:06:27 | FromDiscord | <kiloneie> hmm okay |
07:14:50 | FromDiscord | <kiloneie> do we have procs or whatever that can figure out to go up and down a level of folders ? |
07:26:50 | FromDiscord | <odexine> "figure out"?? |
07:28:35 | FromDiscord | <kiloneie> https://css-tricks.com/quick-reminder-about-file-paths/ |
07:28:39 | FromDiscord | <kiloneie> this is what i wanted |
07:28:55 | FromDiscord | <kiloneie> i forget this... |
07:32:04 | FromDiscord | <kiloneie> Man this nim-lang.org extension or Nim's LSP takes some time sometimes, telling me of an error that isn't there, i c -r, still telling me, then i hover over the import and 2 seconds later it finally realizes, oh, my bad... <.< WIP |
07:32:27 | FromDiscord | <fabric.input_output> what if |
07:32:30 | FromDiscord | <fabric.input_output> you didn't use lsp |
07:33:54 | FromDiscord | <odexine> its really the suggestion engines fault |
07:34:01 | FromDiscord | <odexine> its just slow and on a bad architecture |
07:34:11 | FromDiscord | <odexine> no one seems to want to fix it though |
07:34:16 | FromDiscord | <odexine> naturally me included |
07:39:40 | FromDiscord | <kiloneie> well i changes main.nim to import instead of including `objects.nim` which still uses the macro to include player.nim, wall.nim which now import and export to get code checking going on. But the Nim's LSP freaks out and only shuts up if i hover my mouse over the `main.nim`'s `import objects.nim` |
07:40:13 | FromDiscord | <kiloneie> though hopefully it will only freak out on changes in those files, an easy thing to remember. |
07:40:48 | FromDiscord | <kiloneie> Can one `import` the whole directory, rendering that macro useless ? |
07:41:51 | FromDiscord | <odexine> no |
07:41:57 | FromDiscord | <odexine> imports are on files |
07:42:09 | FromDiscord | <kiloneie> okay, im not walking the dirs, this is fine |
07:42:48 | FromDiscord | <odexine> why do you need it to be automatic anyway? |
07:43:19 | FromDiscord | <kiloneie> because it's gonna be a lot of files, and i intend to not just make a game but a mini Game Maker of sorts, not just a level editor with it |
07:43:27 | FromDiscord | <kiloneie> and so, manual is just NOT an option |
07:43:49 | FromDiscord | <kiloneie> yes i realize this works only at compile time atm |
07:43:55 | FromDiscord | <kiloneie> not the point |
07:45:33 | FromDiscord | <kiloneie> What i want might be extremely tricky to do... |
08:09:08 | FromDiscord | <spaceshaman> The nim compiler is directory aware and doesn't need you to pass included files in right? |
08:09:21 | FromDiscord | <spaceshaman> A la gcc |
08:12:19 | Amun-Ra | right |
09:32:21 | * | omid joined #nim |
09:32:43 | * | omid is now known as omnad |
09:34:41 | omnad | hi nim-world! |
09:35:25 | FromDiscord | <nnsee> hi omnad |
09:36:40 | omnad | i'm puzzled ... what's that about what you call 'partial case-insensitivity'? why is the first character case sensitive? |
09:37:13 | omnad | also, i am not sure why i'd want that kind of 'Identifier equality'. |
09:42:00 | FromDiscord | <blackmius> first character case-sensitive to separate types and variables |
09:42:24 | FromDiscord | <demotomohiro> If there are two variable `Filename` and `filename`, they don't confuse people.↵But if there are 2 variable `filename` and `fileName`, they might confuse some people. |
09:42:32 | FromDiscord | <blackmius> you shouldnt want it or unwanted either |
09:43:02 | FromDiscord | <blackmius> you just dont use variables like↵↵mYsUpErVaRiAbLE |
09:43:40 | FromDiscord | <blackmius> (edit) "you just dont use variables like↵↵mYsUpErVaRiAbLE ... " added "and at the same time another mySuPERvArIAble" |
09:45:34 | FromDiscord | <demotomohiro> In Nim, you cannot declare variables `filename` and `fileName` in one scope. |
09:55:33 | FromDiscord | <pmunch> Hmm, would probably break some stuff now. But it should be technically possible to have a type and a variable named the same since they are so different. That way we could have full case insensitivity, and `var file: file` would be valid because it knows that `: <something>` can only mean a type |
09:56:33 | FromDiscord | <pmunch> Would mean that there's a few ambiguous cases though, so might cause some issues, but as long as you have the ability to disambiguate somehow then it should be fine. |
10:08:16 | omnad | thanks! |
10:16:48 | * | omnad quit (Quit: leaving) |
10:48:34 | * | ryuukk quit (Remote host closed the connection) |
10:50:55 | * | ryuukk joined #nim |
11:15:08 | * | ntat joined #nim |
11:59:04 | * | ntat quit (Quit: Leaving) |
12:30:32 | FromDiscord | <kiloneie> Is it just me, or is there less people regularly active on Nim discord than it used to be ? |
12:34:46 | * | coldfeet joined #nim |
12:40:24 | FromDiscord | <pmunch> It ebbs and flows a bit |
12:40:40 | FromDiscord | <pmunch> Can't procedures have custom pragmas? https://play.nim-lang.org/#pasty=TACiKCYf |
12:40:50 | FromDiscord | <odexine> yes? |
12:40:55 | FromDiscord | <odexine> async is a custom pragma |
12:41:01 | FromDiscord | <pmunch> There's also the fact that we now have many different channels |
12:41:10 | FromDiscord | <pmunch> So the conversation is spread out a bit more |
12:41:17 | FromDiscord | <pmunch> @odexine check the example I sent |
12:41:24 | * | ntat joined #nim |
12:41:25 | FromDiscord | <pmunch> Async is like `task` in that snippte |
12:41:30 | FromDiscord | <odexine> you mean a template pragma okay |
12:41:37 | FromDiscord | <pmunch> I'm wondering why `stackSize` doesn't work |
12:42:52 | FromDiscord | <ayex> definitively - I used them before. |
12:42:57 | FromDiscord | <pmunch> Hmm, I can extract it from the `procImpl` definition though |
12:43:12 | FromDiscord | <pmunch> @ayex, any idea what you did differently? |
12:43:53 | FromDiscord | <ayex> custom pragmas on progs - definitively - I used them before. |
12:44:27 | FromDiscord | <odexine> you probably cant extract them via a macro pragma |
12:44:57 | FromDiscord | <odexine> im testing more things wait |
12:47:10 | FromDiscord | <odexine> In reply to @pmunch "Hmm, I can extract": prolly why you cant use the macros functions |
12:48:21 | FromDiscord | <ayex> let me check the snippet..↵(@pmunch) |
12:52:03 | * | coldfeet quit (Remote host closed the connection) |
12:54:37 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=TFHIIIXW |
12:55:54 | FromDiscord | <ayex> [pmunch](https://matrix.to/#/%40_discord_392962235737047041%3At2bot.io) would the pragma tempalte not need to be placed above type, as it is used there? |
13:16:10 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=CPPHDuxc |
13:24:59 | FromDiscord | <odexine> well yes but i assume task is intended to be used as a pragma |
13:29:16 | FromDiscord | <ayex> I see. but there is no definition of `task` as a pragma(?) -↵↵to me only `stackSize` seems to be defined as pragma? |
13:29:35 | FromDiscord | <pmunch> Macros can be called as a pragma 😉 |
13:29:42 | FromDiscord | <pmunch> Async is just a macro |
13:35:20 | FromDiscord | <ayex> ah I did not know that, thank you 🙂↵(@pmunch) |
13:37:12 | * | ryuukk quit (Remote host closed the connection) |
13:39:06 | * | ryuukk joined #nim |
14:32:58 | * | zgasma joined #nim |
15:31:22 | * | lucasta joined #nim |
15:47:54 | * | fallback quit (Read error: Connection reset by peer) |
16:09:13 | * | fallback joined #nim |
16:49:27 | * | lucasta quit (Remote host closed the connection) |
17:53:35 | * | tokyovigilante quit (Read error: Connection reset by peer) |
17:53:51 | * | tokyovigilante joined #nim |
18:23:08 | FromDiscord | <grumblygibson> In reply to @xtrayambak "How are you supposed": https://nim-lang.org/docs/manual.html#types-object-variants |
18:55:33 | FromDiscord | <spaceshaman> Is there a reason that primitive types aren't capitalized? |
19:01:44 | FromDiscord | <ieltan> In reply to @spaceshaman "Is there a reason": No clue, but if I had to guess, to distinguish compiler built-ins from user code |
19:04:15 | Amun-Ra | and to distinguish primitive type from non-primitive object |
19:05:19 | Amun-Ra | and it's, de facto, standard ;> |
19:12:37 | FromDiscord | <spaceshaman> Its a shame they did that. Because then you cant do `var string: String` |
19:15:42 | FromDiscord | <spaceshaman> Is there a way to tell the compiler to treat default initialization as an error? |
19:19:21 | * | disso-peach joined #nim |
19:23:02 | Amun-Ra | spaceshaman: https://play.nim-lang.org/#pasty=caTWfUmm |
19:23:47 | * | disso-peach quit (Client Quit) |
19:25:21 | Amun-Ra | warningAsError and Uninit=on |
19:34:00 | FromDiscord | <.bobbbob> Isnt it put {.experimental: "strictDefs".} in the file |
19:35:46 | FromDiscord | <spaceshaman> And with that is there a way to explicitly init with garbage/uninitialized memory? |
19:36:16 | Amun-Ra | var somearray {.noinit.}: array[5, byte] |
19:47:56 | FromDiscord | <frusadev> Hi! |
19:48:29 | FromDiscord | <frusadev> How should i go about creating a macro that makes functions public? something like `pub proc ...` |
20:01:21 | FromDiscord | <leorize> you can't modify syntax with macros, fwiw |
20:02:14 | FromDiscord | <leorize> however you can create a macro that mark all procs in its block public |
20:26:51 | FromDiscord | <double_spiral> I didn't know Nim had a pub keyword |
20:28:41 | FromDiscord | <leorize> nim doesn't |
20:32:03 | FromDiscord | <double_spiral> Oh that's what I wanted to call the macro, I see |
20:32:09 | FromDiscord | <double_spiral> (edit) "I" => "he" |
20:52:49 | * | ntat quit (Quit: Leaving) |
21:28:32 | * | rockcavera joined #nim |
23:25:02 | FromDiscord | <spaceshaman> how do I declare something before it is defined? |
23:25:37 | FromDiscord | <spaceshaman> so that you can do mutual recursion for instance |
23:28:38 | FromDiscord | <spaceshaman> I finally found the docs |
23:30:07 | * | thomasross joined #nim |
23:30:59 | FromDiscord | <spaceshaman> imo this should link to `https://nim-lang.org/docs/manual.html` https://media.discordapp.net/attachments/371759389889003532/1296978867340185600/image.png?ex=67144132&is=6712efb2&hm=b039fc5f0f3bb52e831560e8987f246405f6d20b1a121e157940e0982f80eddb& |
23:31:48 | FromDiscord | <spaceshaman> the page it takes you to atm should be under a 'learn nim' tab |
23:32:09 | FromDiscord | <spaceshaman> you should never have to scroll for something so important |
23:32:52 | * | thomasross quit (Remote host closed the connection) |
23:35:28 | * | thomasross joined #nim |
23:36:38 | FromDiscord | <aintea> I do agree this should lead to the real docs and not to the learn Nim |
23:37:00 | FromDiscord | <Elegantbeef> "PRs welcome" |
23:38:49 | FromDiscord | <demotomohiro> If you really create a PR: https://github.com/nim-lang/website |
23:41:47 | FromDiscord | <demotomohiro> I think that documentation page is desgined for new comers. |
23:49:30 | FromDiscord | <spaceshaman> I might actually |
23:51:05 | FromDiscord | <spaceshaman> so the type of a function literal is... the same as declaring a function literal? |
23:52:34 | FromDiscord | <spaceshaman> sent a long message, see https://pasty.ee/cyKtfake |
23:52:46 | FromDiscord | <spaceshaman> (edit) "https://pasty.ee/FwLqkadh" => "https://pasty.ee/GGArFJJY" |
23:52:52 | FromDiscord | <spaceshaman> (edit) "https://pasty.ee/qgQmMTZb" => "https://pasty.ee/afOctaWT" |
23:53:15 | FromDiscord | <spaceshaman> that seems a little problematic |
23:53:29 | FromDiscord | <spaceshaman> the parser has my sympathy |
23:59:50 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type↵Top level procedures are `nimcall` in default. Procedures defined inside a procedure and refers local variables are closure.↵The calling convention of `type MyProc = proc()` is `closure`. |