00:06:11 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xnQ |
00:06:35 | FromDiscord | <retkid> does nim come with a server tulity |
00:06:37 | FromDiscord | <retkid> (edit) "tulity" => "utility" |
00:06:45 | FromDiscord | <impbox [ftsf]> what does a server utility do? |
00:07:00 | FromDiscord | <retkid> not utility sorry my vocab sucks |
00:07:04 | FromDiscord | <retkid> uh |
00:07:19 | FromDiscord | <retkid> a library which can listen to ports and send and recieve data |
00:07:23 | FromDiscord | <retkid> (edit) "recieve" => "receive" |
00:07:38 | FromDiscord | <Elegantbeef> `std/net` |
00:07:40 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xnR |
00:08:06 | FromDiscord | <retkid> thank you, time to read docs <3 |
00:08:10 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/net.html |
00:08:47 | FromDiscord | <impbox [ftsf]> @ElegantBeef what's with the std vs no std? |
00:09:16 | FromDiscord | <Elegantbeef> New modules are hidden in a `std` path so you need it for some, so best to encourage it |
00:09:46 | FromDiscord | <impbox [ftsf]> hmm, any docs about it? |
00:10:03 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/lib.html i see a couple have std/ prefix but most don't |
00:10:16 | FromDiscord | <retkid> that is a very useful link |
00:10:17 | FromDiscord | <impbox [ftsf]> should std import be used for all std library libs? |
00:10:20 | FromDiscord | <retkid> i will keep that one |
00:10:30 | FromDiscord | <Elegantbeef> Yes it should be |
00:10:49 | FromDiscord | <Elegantbeef> Old libraries are grandfathered in, but all new ones will require it |
00:11:22 | FromDiscord | <Elegantbeef> So like `setutils` in devel requires `std` |
00:11:35 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/manual.html#modules-pseudo-importslashinclude-paths aha found the docs on it |
00:12:01 | FromDiscord | <Elegantbeef> And as such the devel docs https://nim-lang.github.io/Nim/strutils.html have it now |
00:12:15 | FromDiscord | <impbox [ftsf]> cool |
00:12:42 | FromDiscord | <Rika> ~~same could be said with `pkg` and `.` prefixes~~ |
00:12:47 | FromDiscord | <Elegantbeef> Though dont know how the new atlas tooling will play |
00:13:11 | FromDiscord | <impbox [ftsf]> atlas tooling? |
00:13:45 | FromDiscord | <Rika> atlas should not interfere with normal user code that doesnt have anything to do with the compiler |
00:13:45 | FromDiscord | <Elegantbeef> Atlas is for stdlib management, allowing version selection of the stdlib(or modules in it) |
00:14:02 | FromDiscord | <impbox [ftsf]> ahh |
00:14:07 | FromDiscord | <Rika> In reply to @Rika "atlas should not interfere": i mean this in terms of imports |
00:14:32 | FromDiscord | <Rika> like i dont see how it would change anything |
00:14:48 | FromDiscord | <Rika> there arent any new modules that dont require std after all as you said |
00:14:56 | FromDiscord | <Elegantbeef> Well lik i said "I dont know" 😀 |
00:15:08 | FromDiscord | <Elegantbeef> Damn my E key isnt playing nice |
00:15:34 | FromDiscord | <Rika> did you mean "nic" |
00:19:26 | FromDiscord | <retkid> fuck |
00:19:31 | FromDiscord | <retkid> my attention span is non-existant today |
00:19:35 | FromDiscord | <retkid> (edit) "non-existant" => "non-existent" |
00:19:36 | FromDiscord | <retkid> im dying |
00:21:32 | FromDiscord | <impbox [ftsf]> D: |
00:21:37 | FromDiscord | <impbox [ftsf]> don't die plz |
00:22:32 | madprops | why would a case say not all cases are covered if I have an else .. |
00:22:44 | FromDiscord | <Rika> code? |
00:22:47 | FromDiscord | <impbox [ftsf]> it shouldn't .. show plz? |
00:23:11 | madprops | https://play.nim-lang.org/#ix=3xnU |
00:23:48 | FromDiscord | <impbox [ftsf]> remove the commas |
00:24:03 | madprops | oh haha |
00:24:15 | * | arkurious quit (Quit: Leaving) |
00:24:16 | madprops | this was after turning a table to a case |
00:24:20 | FromDiscord | <impbox [ftsf]> and escape the `'` correctly |
00:24:28 | FromDiscord | <impbox [ftsf]> `'\''` |
00:24:55 | madprops | yeah |
00:26:04 | madprops | still don't think this should be a case anyway |
00:26:11 | madprops | since I used the keys with the table |
00:26:17 | madprops | for k in Morse.keys: |
00:26:57 | FromDiscord | <impbox [ftsf]> https://play.nim-lang.org/#ix=3xnW |
00:28:16 | FromDiscord | <impbox [ftsf]> array would make more sense to me than table, just some empty entries but who cares |
00:28:44 | FromDiscord | <impbox [ftsf]> but you can populate the lookup array from the func |
00:29:34 | madprops | i think table makes sense, |
00:29:39 | madprops | it's just that it looks ugly in docs |
00:29:59 | madprops | since it uses the compiled version |
00:54:01 | FromDiscord | <Elegantbeef> array + set is the best combination |
00:58:00 | FromDiscord | <impbox [ftsf]> i'm sure there's a way to populate an array from a proc at compile time but i can never remember how |
01:01:33 | FromDiscord | <Elegantbeef> Here you go imp https://play.nim-lang.org/#ix=3xo5 |
01:02:48 | FromDiscord | <impbox [ftsf]> rad |
01:02:50 | FromDiscord | <impbox [ftsf]> thanks |
01:03:19 | FromDiscord | <Elegantbeef> Ideally you'd limit the range of the array to the lowest/highest character so `array[lowest..highest, string]` |
01:03:28 | FromDiscord | <Elegantbeef> But i couldnt be arsed to figure out which those were |
01:10:27 | * | Gustavo6046 quit (Ping timeout: 250 seconds) |
01:12:02 | * | Gustavo6046 joined #nim |
01:12:06 | madprops | oh cool |
01:12:48 | * | krux02 quit (Remote host closed the connection) |
01:18:45 | * | neurocyte2 joined #nim |
01:18:45 | * | neurocyte2 quit (Changing host) |
01:18:45 | * | neurocyte2 joined #nim |
01:20:51 | * | neurocyte quit (Ping timeout: 250 seconds) |
01:20:51 | * | neurocyte2 is now known as neurocyte |
01:27:06 | FromDiscord | <Rika> its unnecessarily expensive to use a table for a char LUT |
01:28:39 | FromDiscord | <Elegantbeef> Indeed, reminds me of the powerPC emulator that was using an enum table and just by changing it to an array instead gave them all the performance |
01:29:21 | FromDiscord | <Elegantbeef> The important note is not all `O(1)` are equal 😛 |
01:30:19 | FromDiscord | <Elegantbeef> Then there is also the memory consumption |
01:31:02 | FromDiscord | <Rika> big o notation only shows shape |
01:31:20 | FromDiscord | <Rika> and there is time complexity versus space complexity |
01:31:22 | FromDiscord | <Rika> as you say |
01:50:25 | * | auxym_ quit (Ping timeout: 248 seconds) |
02:15:27 | FromDiscord | <Rika> what the heck? |
02:15:44 | FromDiscord | <Rika> `import pkg/xxx` doesnt work if you have done `nimble develop xxx` |
02:20:12 | nrds | <Prestige99> is that a recent bug? I'm pretty sure I've done that |
02:22:17 | FromDiscord | <Rika> not sure |
02:44:07 | FromDiscord | <retkid> does anyone have any memory on "out of memory" |
02:45:39 | FromDiscord | <Rika> ? |
02:45:41 | FromDiscord | <Rika> what? |
02:47:03 | FromDiscord | <retkid> ah i see the error i think |
02:49:10 | FromDiscord | <retkid> yea no i dont |
02:49:39 | FromDiscord | <retkid> so, i have a server, but when i call a proc to send data to it, it it quits with "out of memory" |
02:50:24 | FromDiscord | <retkid> lemme try some workarounds |
02:52:49 | * | notchris quit (Ping timeout: 248 seconds) |
02:53:52 | FromDiscord | <retkid> so the issue is that java sucks |
02:54:23 | FromDiscord | <Elegantbeef> What do you mean? |
02:54:45 | FromDiscord | <retkid> im just working with java socket stuff and got confused |
02:54:46 | FromDiscord | <retkid> dont worry |
02:56:01 | * | notchris joined #nim |
03:08:39 | * | rockcavera joined #nim |
03:08:39 | * | rockcavera quit (Changing host) |
03:08:39 | * | rockcavera joined #nim |
03:19:56 | madprops | so what is it actually ok to use a table? o_O |
03:20:08 | madprops | when* |
03:20:31 | FromDiscord | <Rika> when the key type is not ordinal |
03:21:51 | madprops | that morse code table was only partly ordinal |
03:22:13 | FromDiscord | <Rika> why> |
03:22:17 | FromDiscord | <Rika> i mean the key type |
03:22:24 | FromDiscord | <Rika> char is ordinal |
03:22:29 | madprops | oh |
03:22:41 | FromDiscord | <impbox [ftsf]> Tables are also good for very sparse data |
03:31:15 | * | vicfred quit (Quit: Leaving) |
03:33:37 | FromDiscord | <retkid> tables are an effective way of handeling data |
03:33:40 | FromDiscord | <retkid> (edit) "handeling" => "handling" |
03:34:34 | FromDiscord | <retkid> i'm having a lot of trouble getting nim to get packets from java, and its not nim's fault, its 100% java's fault and i don't know what its doing |
03:35:21 | FromDiscord | <Arathanis> I've always thought you should use what is the most readable or makes the most sense to you. If performance ultimately becomes an issue you can come back and optimize later, but I think readability and "sense" trumps chasing performance every time unless you can demonstrate the performance is insufficient. |
03:36:05 | FromDiscord | <retkid> what if im building something big and want to be able to scale it |
03:36:23 | FromDiscord | <Arathanis> in which cause, the right time to use tables is whenever it makes sense. |
03:36:59 | FromDiscord | <Arathanis> i still think you should stick to this philosophy when building something big |
03:38:29 | FromDiscord | <Arathanis> 99% of the time your performance bottleneck is going to be a single function, maybe two. You can profile and optimize the slow parts if its too slow when everything comes together and you try to scale.↵↵I'm not saying that you shouldn't design for scalability if you know you need it, only that you shouldn't chase performance in everything you do. Readability really does count. Dev time is expensive, computational power less so. |
03:39:01 | FromDiscord | <retkid> well, im not making money and i'm not taking off work so dev time is worthless |
03:39:06 | FromDiscord | <retkid> and i want this stuff to run on a potato |
03:39:20 | FromDiscord | <Arathanis> Don't say that, your time is never worthless. Money or not. :] |
03:40:06 | FromDiscord | <Rika> In reply to @Arathanis "Don't say that, your": ~~this is very true, esp if youre in uni loooool~ |
03:40:07 | FromDiscord | <Rika> (edit) "loooool~" => "loooool~~" |
03:40:28 | FromDiscord | <Arathanis> I also find it easier to make things run on a potato if I just make it worse with good, readable, elegant code. And if it ultimately fails to run on the potatoes, then you can find out what is bottlenecking your nightshades and make them faster! |
03:40:42 | FromDiscord | <Arathanis> (edit) "worse" => "work" |
03:40:43 | FromDiscord | <retkid> I'm doing some really dubious stuff with my current project. Dunno if it will increase performance or not, and once its finished it'll be nearly impossibly to practically know |
03:40:47 | FromDiscord | <retkid> but |
03:40:49 | FromDiscord | <Arathanis> edited: worse -> work |
03:40:51 | FromDiscord | <retkid> im taking it as a learning thing\ |
03:40:52 | FromDiscord | <retkid> (edit) "thing\" => "thing" |
03:41:00 | FromDiscord | <retkid> (edit) "thing" => "thing, even if it doesn't matter" |
03:41:04 | FromDiscord | <retkid> im still learning stuff so eh |
03:41:44 | FromDiscord | <Arathanis> sure, learning is always good and it never hearts to learn how to optimize! but if you plan to take this into industry, i really think you will benefit a lot from the approach I outlined above |
03:41:48 | FromDiscord | <Rika> In reply to @retkid "I'm doing some really": you can just profile the code tho |
03:41:48 | FromDiscord | <Arathanis> In reply to @Rika "~~this is very true,": ha |
03:42:06 | FromDiscord | <retkid> its a tad more complicated than that |
03:42:08 | FromDiscord | <Rika> me when i entered uni: 😄↵me after a year in uni: 😐 |
03:42:09 | FromDiscord | <Arathanis> In reply to @Rika "you can just profile": yeah, write it in an elegant readable way tahts easy to maintain and extend |
03:42:21 | FromDiscord | <Arathanis> if its too slow you can make it hideous, but fast, monstrosity later |
03:42:29 | FromDiscord | <Arathanis> (edit) "if its too slow you can make it ... hideous," added "a" |
03:42:32 | FromDiscord | <Rika> you can make elegant fast code |
03:42:45 | FromDiscord | <Rika> it just takes much more time than either choice proposed before |
03:42:46 | FromDiscord | <Arathanis> not always but i agree with you 99% of the time |
03:42:48 | FromDiscord | <Arathanis> maybe more than 99% |
03:42:58 | FromDiscord | <Arathanis> there are always edge cases |
03:43:01 | FromDiscord | <retkid> nim makes it pretty easy to write fast code |
03:43:06 | FromDiscord | <Arathanis> yeah its nice for that |
03:43:09 | FromDiscord | <retkid> its kinda built to make fast elegent code |
03:43:09 | FromDiscord | <Rika> In reply to @Arathanis "not always but i": id say 90% |
03:43:11 | FromDiscord | <retkid> (edit) "elegent" => "elegant" |
03:43:17 | FromDiscord | <retkid> if you write fast code in python it looks like php |
03:43:28 | FromDiscord | <Arathanis> love me some python |
03:43:34 | FromDiscord | <Rika> if you write python may god help you |
03:43:44 | FromDiscord | <Arathanis> python is actually my favorite language :P |
03:44:04 | FromDiscord | <Rika> its the language i abandoned due to a lot of things i dont like about it |
03:44:09 | FromDiscord | <retkid> Python is easy provided you have no performance goals |
03:44:23 | FromDiscord | <Arathanis> python is pretty performant if you know what you are doing |
03:44:32 | FromDiscord | <Rika> well my issue with it was not performance |
03:44:50 | FromDiscord | <retkid> I dunno, python's design goal is very simple |
03:44:58 | FromDiscord | <retkid> be like English ((or dutch)) |
03:45:13 | FromDiscord | <retkid> if you don't like that, c'est la vie |
03:45:17 | FromDiscord | <Arathanis> pseudo code that runs! |
03:45:21 | FromDiscord | <Arathanis> i actually love it |
03:45:25 | FromDiscord | <Arathanis> easily my favorite language. |
03:45:40 | FromDiscord | <Arathanis> i started looking into nim because it based its syntax so clearly on python |
03:45:53 | FromDiscord | <retkid> thats surface level |
03:45:58 | FromDiscord | <retkid> skin deep |
03:45:58 | FromDiscord | <Rika> there are things i am fine with wrt. python |
03:46:07 | FromDiscord | <Rika> i just really do not like dynamic typing |
03:46:13 | FromDiscord | <retkid> under the hood, nim is closer to pascal |
03:46:36 | FromDiscord | <Rika> In reply to @Rika "i just really do": and the lack of CTEs too i guess |
03:46:43 | FromDiscord | <Arathanis> i like dynamic typing |
03:46:49 | FromDiscord | <Arathanis> i like that i can use static typing when i want it |
03:47:02 | FromDiscord | <Arathanis> and when i want a quick dirty script for some one off i dont have to fight a type system |
03:47:17 | FromDiscord | <Arathanis> but when im doing anything bigger i can get my typing |
03:47:20 | FromDiscord | <Rika> those scenarios are rare to me |
03:47:30 | FromDiscord | <Rika> i dont remember the last time i had to fight the type system |
03:47:30 | FromDiscord | <Arathanis> they are common enough for me to appreciate it |
03:47:34 | FromDiscord | <retkid> the only time typing has been annoying for me |
03:47:38 | FromDiscord | <retkid> is anything involving java |
03:47:51 | FromDiscord | <Rika> java typing is inelegant |
03:48:01 | FromDiscord | <Arathanis> well now we have 40in widescreen monitors |
03:48:12 | FromDiscord | <Arathanis> so you might be able to display a java class name on a single line now |
03:48:31 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/881747183433551902/unknown.png |
03:48:57 | FromDiscord | <retkid> kotlin writes and look a lot better than java |
03:49:04 | FromDiscord | <retkid> however still has the haulmarks of its bad typing stuff |
03:49:11 | FromDiscord | <retkid> (edit) "however still has the haulmarks of its bad typing stuff ... " added "as it intergrates with java" |
03:49:13 | FromDiscord | <retkid> (edit) "intergrates" => "integrates" |
03:49:35 | FromDiscord | <Arathanis> yeah, i agree |
03:49:38 | FromDiscord | <retkid> i write code like a maniac i know |
03:49:42 | FromDiscord | <retkid> (edit) "know" => "know, lemm be" |
03:49:44 | FromDiscord | <retkid> (edit) "lemm" => "lemme" |
03:50:14 | FromDiscord | <Arathanis> but yes my favorite language is python and i looked into nim for the syntactical similarities |
03:50:28 | FromDiscord | <retkid> yea |
03:50:30 | FromDiscord | <Arathanis> i hate "character noise" |
03:50:32 | FromDiscord | <retkid> still dont see that one |
03:50:34 | FromDiscord | <Rika> how fun that people who both hate and love python look to nim |
03:50:38 | FromDiscord | <Arathanis> and nim does a good job of managing that |
03:50:48 | FromDiscord | <Arathanis> i dont really hate any language |
03:50:58 | FromDiscord | <retkid> Rika, its because nim is very different than python but looks like it |
03:51:02 | FromDiscord | <Arathanis> except maybe JS for breaking boolean algebra u_u |
03:51:13 | FromDiscord | <Arathanis> and PHP for being... you know |
03:51:19 | FromDiscord | <retkid> don't like java |
03:51:25 | FromDiscord | <retkid> never have to program JS because nim |
03:51:26 | FromDiscord | <retkid> so im golden |
03:51:44 | FromDiscord | <Rika> hate is a strong word, i just use it as it is the inverse immediately thought of when thinking of love |
03:51:51 | FromDiscord | <Arathanis> yeah i dont really hate anything |
03:51:57 | FromDiscord | <Arathanis> java's verbosity really turns me off |
03:52:01 | FromDiscord | <retkid> yea no java makes furious |
03:52:04 | FromDiscord | <retkid> like genuinely |
03:52:06 | FromDiscord | <Arathanis> maybe APL for being a "write only" language lmao |
03:52:18 | FromDiscord | <retkid> even after learning a lot of java |
03:52:24 | FromDiscord | <retkid> writing it is like molasiss |
03:52:27 | FromDiscord | <retkid> (edit) "molasiss" => "molasses" |
03:52:30 | FromDiscord | <Rika> In reply to @Arathanis "and PHP for being...": you remind me of the php project i have to set up and maintain (but have been putting it off for months) |
03:52:38 | FromDiscord | <Arathanis> https://media.discordapp.net/attachments/371759389889003532/881748215114924052/unknown.png |
03:52:49 | FromDiscord | <Arathanis> Conway's Game of Life written in APL |
03:52:53 | FromDiscord | <Arathanis> write only language im telling you |
03:53:08 | FromDiscord | <retkid> well |
03:53:10 | FromDiscord | <impbox [ftsf]> I loved python until I used it for a long time, mostly due to the lack of typing and it's standard library. |
03:53:27 | FromDiscord | <retkid> py's standard library is infuriating |
03:53:28 | FromDiscord | <Arathanis> In reply to @impbox "I loved python until": ive been using python for so long, still love it |
03:53:30 | FromDiscord | <retkid> almost as bad as java |
03:53:45 | FromDiscord | <retkid> dunno what they're thinking with it |
03:53:52 | FromDiscord | <Arathanis> you dont liek the standard library? huh, color me surprisefd |
03:53:53 | FromDiscord | <Arathanis> (edit) "surprisefd" => "surprised" |
03:53:55 | FromDiscord | <impbox [ftsf]> Nim has the bits of python i like without the bits I don't so it's great |
03:54:16 | FromDiscord | <retkid> nim is kinda like a language blender |
03:54:19 | FromDiscord | <retkid> with some new ideas thrown in |
03:54:26 | FromDiscord | <Rika> In reply to @Arathanis "you dont liek the": its gained a lot of cruft and inconsistencies over the years |
03:54:35 | FromDiscord | <Rika> its not really annoying to me though |
03:54:46 | FromDiscord | <impbox [ftsf]> Oh also distributing python apps is a massive pain |
03:54:51 | FromDiscord | <impbox [ftsf]> Nim is easy |
03:54:59 | FromDiscord | <retkid> i think, when i want to do simple tasks, i have to go on PIP |
03:55:02 | FromDiscord | <retkid> thats a bad sign |
03:55:14 | FromDiscord | <retkid> and i do the same thing for java except its a pain in the ass to get dependencies to work with Maven |
03:55:19 | FromDiscord | <retkid> so i end up just fucking using it anyway |
03:55:20 | FromDiscord | <Arathanis> oh ive never had issue with distributing python apps I use either PyInstaller or Nuitka if im feeling spicy. |
03:55:36 | FromDiscord | <retkid> i just leave the scripts out there and tell them to figure it out |
03:55:37 | FromDiscord | <retkid> 😎 |
03:58:39 | FromDiscord | <retkid> yea so sometimes on the server recieve |
03:58:48 | FromDiscord | <retkid> random characters get thrown into the strings i recieve |
03:58:53 | FromDiscord | <retkid> (edit) "recieve" => "receive" |
03:59:09 | FromDiscord | <retkid> and other times it doesn't send, for no reason |
04:02:46 | FromDiscord | <Arathanis> sounds like an encoding problem? |
04:03:03 | FromDiscord | <Arathanis> you got something sending utf-8 and something expecting to receive ascii or vice versa? |
04:03:55 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/881751061600276550/unknown.png |
04:04:06 | FromDiscord | <retkid> so yea it seems that |
04:04:36 | FromDiscord | <retkid> after the default length it spits out a character |
04:04:41 | FromDiscord | <retkid> on some overflow issue or something |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:07 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/881751611351891999/unknown.png |
04:06:19 | FromDiscord | <retkid> only happens at the start |
04:06:23 | FromDiscord | <retkid> (edit) "only happens at the start ... " added "1 time" |
04:06:30 | * | supakeen joined #nim |
04:06:32 | FromDiscord | <retkid> (edit) "time" => "time, i could filter that out probably" |
04:08:24 | FromDiscord | <garett> In C, it is possible to define an enum type with no constants. Is there a way to do that in Nim? Maybe if I use `discard` in the body of the enum type declaration? |
04:09:35 | FromDiscord | <Yardanico> In reply to @garett "In C, it is": I don't think it's possible, besides, what would you use it for? |
04:09:48 | FromDiscord | <Yardanico> I mean what do you actually want to do with an empty enum? |
04:10:17 | FromDiscord | <garett> declare a set type with no valid flags, because this is something that appears in vulkan API |
04:10:51 | FromDiscord | <garett> The reason it appears is because future versions of the API may add some flags |
04:11:06 | FromDiscord | <garett> I will just use a `distinct uint32` to approximate it |
04:12:07 | FromDiscord | <Yardanico> oh okay then, your way should work I think |
04:12:18 | FromDiscord | <garett> I confirmed in nim playground that you can't put `discard` in the body of an enum declaration |
04:12:32 | FromDiscord | <Yardanico> i know :) |
04:12:37 | FromDiscord | <garett> Thanks Yardanico 🙂 |
04:12:58 | FromDiscord | <Yardanico> `discard` in type declarations can only be placed when you have some branching with e.g. `case` or `when` |
04:13:00 | FromDiscord | <Yardanico> iirc |
04:13:11 | FromDiscord | <Yardanico> you don't need it to create an empty object for example |
04:13:14 | FromDiscord | <Yardanico> `type EmptyObj = object` |
04:13:21 | FromDiscord | <Yardanico> that's all what's needed, no discard |
04:14:01 | FromDiscord | <garett> I was playing with NimGL's vulkan.nim, and found it awkward to deal with flags. I refactored it to use sets, which makes the code pretty nice, but I must have messed up something somewhere because it breaks the example program 😄 |
04:14:25 | FromDiscord | <Yardanico> there's also a few other vulkan binding repos for nim |
04:14:39 | FromDiscord | <garett> I was surprised that an empty enum can't be declared similar to an empty object, but I don't find it unreasonable. |
04:14:46 | FromDiscord | <Yardanico> https://github.com/nimious/vulkan |
04:14:47 | FromDiscord | <Yardanico> https://github.com/Clyybber/vulkanim |
04:14:48 | nrds | <R2D299> itHub: 7"Nim bindings for Vulkan, the API for access to graphics and compute on GPUs." |
04:14:49 | nrds | <R2D299> itHub: 7"Vulkan bindings for nim" |
04:18:21 | FromDiscord | <garett> both interesting, thanks for the links. Neither is quite as idiomatic as I would like, but I may be able to take inspiration from all three to cobble something nice together |
04:19:44 | * | rockcavera quit (Remote host closed the connection) |
04:19:44 | FromDiscord | <garett> Nim `set` is really ideal for all of the bit flag fields in the vulkan API, makes the code much nicer to read and write, without all the int-casting and bitops |
04:20:53 | FromDiscord | <garett> I'll probably end up doing what I did for D3D11, and just manually translating the headers to Nim 😛 |
04:21:07 | madprops | what's the idea behind toUpperAscii ? |
04:21:13 | madprops | instead of using toUpper all the time |
04:21:21 | madprops | performance gains? |
04:21:37 | FromDiscord | <garett> I think it indicates that it doesn't support uppercasing Unicode letters |
04:21:43 | FromDiscord | <garett> outside the ASCII range |
04:22:28 | FromDiscord | <garett> like converting a lowercase a with umlauts over it into an uppercase A with umlauts over it |
04:24:11 | FromDiscord | <garett> sent a code paste, see https://play.nim-lang.org/#ix=3xoA |
04:24:58 | FromDiscord | <garett> Uppercasing arbitrary Unicode glyphs requires a lot of tables to figure out whether there is an uppercase equivalent and what it is. |
04:25:19 | madprops | I see |
04:25:19 | FromDiscord | <garett> Uppercasing ASCII characters is just an `if` and an add |
04:25:30 | FromDiscord | <retkid> alright |
04:26:04 | FromDiscord | <garett> So, I think your initial inclination is correct, `isUpperAscii` should be faster, but only operates on a subset of possible text |
04:26:23 | FromDiscord | <Yardanico> In reply to @garett "I think it indicates": yes, exactly |
04:26:31 | FromDiscord | <impbox [ftsf]> toUpperAscii also might break unicode characters |
04:26:32 | FromDiscord | <retkid> there is some base 16 in here↵@['\x00', '\x0F', 'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '!'] |
04:26:40 | FromDiscord | <Yardanico> wdym? that's not base 16 |
04:26:41 | FromDiscord | <impbox [ftsf]> if you pass it unicode text |
04:27:06 | FromDiscord | <retkid> yep |
04:27:07 | FromDiscord | <impbox [ftsf]> if you're using ascii functions you want to be sure you're passing them ascii |
04:27:15 | FromDiscord | <retkid> thats just a non printable character |
04:27:35 | FromDiscord | <retkid> i saw \x0F and went... 0x0000F??? |
04:28:01 | FromDiscord | <garett> I think for unicode characters it would be `"\u00000000"` |
04:28:15 | FromDiscord | <retkid> I have a solution, but do you know where these are coming from |
04:28:22 | FromDiscord | <retkid> the second one is seemingly rtandom |
04:28:25 | FromDiscord | <retkid> (edit) "rtandom" => "random" |
04:28:29 | FromDiscord | <Yardanico> then something's wrong with your code |
04:28:31 | FromDiscord | <retkid> is it the sum of the characters |
04:28:37 | FromDiscord | <Yardanico> are you doing FFI or what? |
04:28:42 | FromDiscord | <Yardanico> and what are you interfacing with? |
04:28:48 | FromDiscord | <retkid> server stuff |
04:29:06 | FromDiscord | <retkid> sending a packet |
04:29:09 | FromDiscord | <retkid> might be an encoding thing |
04:29:18 | FromDiscord | <retkid> lemme see if i can change the encoding to UTF in nim |
04:29:23 | FromDiscord | <garett> `'\x0F'` is the ASCII control sequence `SI` |
04:29:36 | FromDiscord | <Yardanico> In reply to @retkid "sending a packet": well, maybe you're sending/receiving it incorrectly :P |
04:29:51 | FromDiscord | <garett> (edit) "`'\x0F'` is the ASCII control sequence `SI` ... " added "(shift in)" |
04:30:21 | FromDiscord | <retkid> In reply to @garett "`'\x0F'` is the ASCII": well, that one is made from the following characters |
04:30:23 | FromDiscord | <Yardanico> having a null terminator at the start of your string isn't a good sign |
04:30:59 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3wYC |
04:31:20 | FromDiscord | <Yardanico> yes, exactly, \x00 at the start signifies that something's wrong |
04:31:30 | FromDiscord | <Yardanico> you shouldn't have a null character at the start of your string |
04:31:48 | FromDiscord | <retkid> it would be cool if i could see it without converting it to a C string tho |
04:31:55 | FromDiscord | <Yardanico> ? |
04:32:13 | FromDiscord | <retkid> so, i only looked at this because i was doing string checks and it didn't work |
04:32:32 | FromDiscord | <Yardanico> you can use `repr` |
04:32:43 | FromDiscord | <Yardanico> !eval echo repr "\x00abc" |
04:32:46 | NimBot | 0x55e15e6f6870"\0abc" |
04:32:53 | FromDiscord | <Yardanico> see the \0 at the start |
04:33:11 | FromDiscord | <retkid> yea |
04:33:20 | FromDiscord | <retkid> repr might be more insightful |
04:34:12 | FromDiscord | <retkid> ahhh |
04:34:17 | FromDiscord | <retkid> repr just shows the full thing |
04:34:18 | FromDiscord | <retkid> thanks |
04:35:49 | FromDiscord | <retkid> well, the origin of this null origin is somewhere in java as this isn't a problem with python or any other lang on this server |
04:40:59 | * | lucerne quit (*.net *.split) |
04:41:00 | * | ecs quit (*.net *.split) |
04:41:00 | * | Amun-Ra quit (*.net *.split) |
04:41:00 | * | Onionhammer quit (*.net *.split) |
04:41:00 | * | crem quit (*.net *.split) |
04:41:17 | * | crem joined #nim |
04:41:18 | * | Onionhammer joined #nim |
04:41:44 | * | Amun-Ra joined #nim |
04:42:32 | * | ecs joined #nim |
04:45:07 | * | dom96 quit (*.net *.split) |
04:45:08 | * | federico3 quit (*.net *.split) |
04:45:08 | * | ormiret quit (*.net *.split) |
04:45:08 | * | NimEventer quit (*.net *.split) |
04:45:08 | * | clemens3 quit (*.net *.split) |
04:45:08 | * | drewr quit (*.net *.split) |
04:45:08 | * | koltrast quit (*.net *.split) |
04:45:29 | * | ormiret joined #nim |
04:45:55 | * | NimEventer joined #nim |
04:46:34 | * | drewr joined #nim |
04:46:47 | * | clemens3 joined #nim |
04:46:52 | * | dom96 joined #nim |
04:46:54 | * | koltrast joined #nim |
04:46:58 | * | federico3 joined #nim |
05:09:26 | arkanoid | When I should use cint and when not? c2nim generates code with ctypes, but offer I see the opposite, like in https://github.com/zevv/nimcoro/blob/master/ucontext.nim |
05:09:48 | arkanoid | s/offer/often/ |
05:11:52 | FromDiscord | <impbox [ftsf]> use cint when you want an int in c |
05:12:20 | FromDiscord | <impbox [ftsf]> if you're calling a c function that takes an int argument, it should take a cint in nim |
05:13:44 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3xoK |
05:26:37 | FromDiscord | <retkid> yea c interop seems annoying |
05:26:49 | FromDiscord | <retkid> im only dealing with c interop on one side which is much more pleasent |
05:27:07 | FromDiscord | <impbox [ftsf]> it's a bit annoying, nicer than i've experienced in other languages though |
05:27:29 | FromDiscord | <retkid> currently my kotlin/java interop is going very nice and running at full speed |
05:27:57 | FromDiscord | <retkid> with communicate over servers |
05:28:37 | FromDiscord | <impbox [ftsf]> JRE calling C functions? |
05:30:30 | arkanoid | Impbox, thanks. But in the linked example he used nim ints for imported struct attributes. Is cint to be used for function arguments only? |
05:30:42 | FromDiscord | <retkid> In reply to @impbox "JRE calling C functions?": YEP |
05:30:43 | FromDiscord | <retkid> (edit) "YEP" => "Yep" |
05:30:44 | FromDiscord | <impbox [ftsf]> arkanoid, anywhere where you'd use int in c |
05:31:25 | FromDiscord | <impbox [ftsf]> so, yes for structs as well, if the struct has an int field in c, use cint in nim |
05:31:56 | FromDiscord | <retkid> cint =/= |
05:32:21 | FromDiscord | <retkid> (edit) "cint =/= ... " added "int" |
05:32:28 | FromDiscord | <retkid> anywhere c is grabbing an int you want to pass ints |
05:32:36 | FromDiscord | <retkid> (edit) "ints" => "cints" |
05:33:12 | FromDiscord | <impbox [ftsf]> cint in nim = int in c↵int in nim != int in c |
05:34:10 | FromDiscord | <impbox [ftsf]> (but depending on platform/compiler int in nim might == int in c so it might look like it works, but if you move to another platform or architecture it might break) |
05:34:24 | FromDiscord | <cabboose> Anyone know if chronos async works with dynamic dispatch? I'm encountering some strange behaviour |
05:34:41 | FromDiscord | <retkid> on linux |
05:34:50 | FromDiscord | <retkid> int and cint work |
05:34:56 | FromDiscord | <retkid> cstrings are still character array's tho |
05:35:07 | FromDiscord | <retkid> (edit) "array's" => "array" |
05:36:10 | FromDiscord | <impbox [ftsf]> i haven't looked but i'd guess they become `char` |
05:36:55 | FromDiscord | <retkid> pretty sure nim just stitches them back into strings and then puts them back in arrays |
05:41:03 | NimEventer | New post on r/nim by Ether-naut: How to get the type of an instance of a subclass, see https://reddit.com/r/nim/comments/pebwxi/how_to_get_the_type_of_an_instance_of_a_subclass/ |
05:57:27 | FromDiscord | <cabboose> Man i'm stupid; I forgot to import chronos on the module that had the base methods with async -.- |
06:07:52 | FromDiscord | <linux user> - |
06:08:01 | FromDiscord | <linux user> (edit) "-" => "-_-" |
06:41:06 | * | PMunch joined #nim |
06:48:29 | * | flynn quit (Read error: Connection reset by peer) |
06:49:36 | * | flynn joined #nim |
07:00:04 | FromDiscord | <fae> idk if i'm doing something wrong in nim or xcode but i can't seem to get a simple proc call working |
07:00:43 | FromDiscord | <fae> sent a code paste, see https://play.nim-lang.org/#ix=3xp8 |
07:02:01 | FromDiscord | <Rika> ? |
07:02:03 | FromDiscord | <Rika> whats the issue? |
07:02:17 | FromDiscord | <Rika> in what way does it not work |
07:02:30 | FromDiscord | <fae> and build it with `nim c -c --os:ios --noMain:on factorial.nim` and copy the resulting C files into my xcode project, I get a linker error saying `ld: 1 duplicate symbol for architecture arm64` |
07:02:42 | FromDiscord | <fae> `duplicate symbol '_factorial' in:` |
07:03:38 | FromDiscord | <fae> pretty sure i'm not configuring xcode correctly |
07:05:57 | FromDiscord | <Elegantbeef> May want to add `cdecl` to that proc definition |
07:07:17 | FromDiscord | <enthus1ast> Also asyncnet and asyncdispatch↵(@retkid) |
07:07:54 | FromDiscord | <retkid> In reply to @enthus1ast "Also asyncnet and asyncdispatch": I’m long since been down the net rabbithole |
07:08:03 | FromDiscord | <enthus1ast> I ser |
07:08:09 | FromDiscord | <retkid> How is asyncnet different |
07:08:54 | FromDiscord | <fae> In reply to @Elegantbeef "May want to add": hmm tried that but still same linker issue |
07:09:05 | FromDiscord | <enthus1ast> They contain Async sockets |
07:09:47 | FromDiscord | <retkid> In what usecase are asynchronous sockets be useful |
07:10:59 | FromDiscord | <impbox [ftsf]> when you want to do other stuff while you wait for sockets to do their thing |
07:11:08 | FromDiscord | <enthus1ast> The netcode i usually write is async.↵You can easily handle multiple clients, states etc without threads and non blocking sockets etc |
07:11:35 | FromDiscord | <Elegantbeef> One of the major use cases of async is to avoid blocking io |
07:11:36 | FromDiscord | <Elegantbeef> Sockets are io |
07:11:40 | FromDiscord | <retkid> Well, my usecase is completely local |
07:11:47 | FromDiscord | <retkid> Only 1 client |
07:12:24 | * | xet7 quit (Remote host closed the connection) |
07:12:24 | FromDiscord | <retkid> The only thing asynchronous might be useful for is handeling multiple commands Being sent in |
07:12:27 | FromDiscord | <impbox [ftsf]> but maybe you want to process the last request while you make another request for example |
07:13:07 | FromDiscord | <impbox [ftsf]> they're useful in a lot of cases, but for very simple cases you might not need them |
07:13:18 | FromDiscord | <retkid> Thinking about it |
07:13:26 | * | xet7 joined #nim |
07:13:34 | FromDiscord | <retkid> Yea the nim sever might be getting pinged like 60 times a second |
07:14:46 | FromDiscord | <enthus1ast> The good thing is that they're quite similar, in fact there even is a multisync pragma so that you can use your code in async or non async fashion↵(@retkid) |
07:15:59 | FromDiscord | <enthus1ast> So quite easy to switch to async later when you need it |
07:17:00 | FromDiscord | <retkid> I’ll switch over to asynchronous sockets tomorrow. Problem is no matter what with a high volume of sends, I’ll be bottlenecked by Java |
07:17:36 | FromDiscord | <retkid> Unless I do some fancy Java parallelism which might not be a thing |
07:18:40 | FromDiscord | <impbox [ftsf]> what are you making? |
07:19:11 | FromDiscord | <retkid> Nim server for maths and atmospherics and physics |
07:19:17 | FromDiscord | <retkid> (edit) "Nim server for maths and atmospherics and ... physics" added "partial" |
07:19:35 | FromDiscord | <retkid> Java for applying the outcomes |
07:20:14 | FromDiscord | <retkid> This frees me to make things as detailed as I want without worrying about performance, practically |
07:30:00 | PMunch | Congrats @exelotl on the Goodboy Galaxy Kickstarter! |
07:30:24 | FromDiscord | <impbox [ftsf]> oh yeah! i need to add my fund that! |
07:36:53 | PMunch | Ah damn, the demo doesn't seem to run under Wine.. |
07:37:36 | PMunch | I just get an error from wTextCtrl.nim(993) init: Error: unhandled exception: cannot wrap this textctrl. [wError] |
07:47:11 | * | xet7 quit (Remote host closed the connection) |
07:48:33 | * | xet7 joined #nim |
07:49:03 | * | xet7 quit (Read error: Connection reset by peer) |
07:50:10 | * | xet7 joined #nim |
07:58:42 | FromDiscord | <fae> https://media.discordapp.net/attachments/371759389889003532/881810143766020116/image0.png |
07:58:50 | FromDiscord | <fae> Yay I got it working on iOS |
07:59:19 | FromDiscord | <fae> Time for Android 😅 |
07:59:55 | PMunch | Oh nice |
08:00:10 | PMunch | What is it that you're running? |
08:01:02 | FromDiscord | <fae> just trying to compile nim procs to c and call them from swift |
08:02:05 | FromDiscord | <fae> is there a way to generate header only files with the c compiler? I needed to manually add my function declarations to the `Bridging-Header.h` file |
08:03:30 | * | max22- joined #nim |
08:04:36 | * | jjido joined #nim |
08:05:53 | FromDiscord | <haxscramper> `--header` is deprecated, so currently the only "official" way to do this is to write things manually |
08:06:37 | PMunch | Wait, is `--header` deprecated? |
08:06:43 | PMunch | That's a shame |
08:07:16 | FromDiscord | <haxscramper> But if you want I suppose you can use `--header`, since it was deprecated because of https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7 |
08:07:50 | * | Vladar joined #nim |
08:08:37 | FromDiscord | <fae> ahh. Well considering I only plan on having one entry point it’s not really a big deal |
08:09:00 | FromDiscord | <haxscramper> It is still even in devel docs https://nim-lang.github.io/Nim/backends.html#interfacing-backend-code-calling-nim |
08:09:22 | FromDiscord | <haxscramper> > ↵> The Nim compiler can generate a C interface header through the --header command-line switch. The generated header will contain all the exported symbols and the NimMain proc which you need to call before any other Nim code.↵> |
08:10:03 | FromDiscord | <haxscramper> So I suppose you can use it, just be aware that it is "kind of not recommended to do so" |
08:10:16 | FromDiscord | <fae> Gotcha, ty for the reference |
08:10:34 | FromDiscord | <xflywind> PR is welcome to remove the docs. |
08:11:30 | FromDiscord | <haxscramper> I'm the wrong person to do so, if anything I'd prefer to have `--header` or something similar to this |
08:12:18 | * | xet7 quit (Remote host closed the connection) |
08:13:05 | FromDiscord | <xflywind> I see, I'll make an issue |
08:13:57 | * | xet7 joined #nim |
08:14:32 | FromDiscord | <haxscramper> Maybe there is no need to push so hard for this to be completely eradicated? |
08:15:58 | FromDiscord | <fae> It could be helpful to people like myself who aren’t very familiar with native compilation |
08:17:20 | FromDiscord | <xflywind> ok |
08:17:21 | FromDiscord | <haxscramper> I suppose something like `--header` is deprecated, please write your 120 exported procs by hand in C |
08:17:22 | FromDiscord | <haxscramper> Would be more appropriate for now |
08:17:43 | FromDiscord | <haxscramper> Util it is completely removed from the compiler |
08:18:03 | FromDiscord | <Elegantbeef> I do have to ask hax, did it need much/any manual touch up? |
08:18:35 | FromDiscord | <dom96> I wish it wasn’t deprecated :/ |
08:18:37 | FromDiscord | <dom96> I use it |
08:18:45 | FromDiscord | <haxscramper> `--header`? |
08:18:45 | FromDiscord | <xflywind> It has been removed from command helps though |
08:18:45 | FromDiscord | <Elegantbeef> The output file |
08:18:47 | FromDiscord | <haxscramper> No, I don't recall doing any manual modifications to it |
08:19:14 | FromDiscord | <dom96> If it’s really deprecated though. The compiler should output a warning when it’s used |
08:19:24 | FromDiscord | <Rika> It is a shame it was removed, but is there anyone to maintain it? |
08:19:25 | FromDiscord | <Elegantbeef> I mean it's clearly a beneficial feature to have |
08:20:05 | FromDiscord | <haxscramper> If we could `{.push` custom macros it would mostly solve the problem I think |
08:20:06 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7#commitcomment-53179688 |
08:20:47 | FromDiscord | <linux user> repost |
08:22:31 | FromDiscord | <fae> i feel i brought up a touchy subject lol |
08:22:57 | FromDiscord | <Rika> Doesn’t seem to be touchy |
08:23:35 | PMunch | Everyone seems to agree that we want the feature, just no-one wants to maintain it :P |
08:23:40 | FromDiscord | <fae> it didnt until i read the comments on the commit |
08:23:46 | FromDiscord | <impbox [ftsf]> seems like a useful feature to have, but sounds like it's a pain to implement |
08:23:47 | FromDiscord | <fae> from at least one individual |
08:23:48 | FromDiscord | <dom96> Could we reimplement it with macros? 😄 |
08:24:36 | PMunch | Hmm, I guess some of it could be done by a macro |
08:24:49 | PMunch | But it might be hard to get totally right |
08:24:52 | FromDiscord | <dom96> I’m wondering where the complexity is |
08:25:01 | FromDiscord | <dom96> I did just wake up though |
08:25:17 | PMunch | Well it requires you to turn Nim AST into C signatures, something the compiler already knows how to do.. |
08:25:40 | FromDiscord | <Elegantbeef> I mean you'd do the same work the compiler did |
08:26:02 | PMunch | And then you'd need to figure out how this all should be written to a file, something which sounds easy until you start considering imports, ordering, etc. |
08:26:02 | FromDiscord | <Elegantbeef> You'd be rewriting cgen inside the nim vm basically |
08:26:18 | PMunch | Exactly, so it's definitely beneficial for the compiler to handle it |
08:26:50 | PMunch | I mean it is already generating the C code, so it's just a matter of not generating the code, but just the signatures. |
08:27:06 | FromDiscord | <Elegantbeef> There is also a possible issue of naming of types/fields but idk about that one |
08:27:23 | FromDiscord | <haxscramper> In reply to @dom96 "Could we reimplement it": we can, just make something like `.exportcWithHeader.` and then call compile-time `writeHeaders()` |
08:27:33 | FromDiscord | <dom96> Hm. Could it be restricted in such a way that it makes generation easier? For example: only C types allowed (cstring etc) |
08:27:40 | FromDiscord | <haxscramper> `const headerDir {.strdefine.} = <get nimcache directory>` |
08:27:46 | FromDiscord | <Elegantbeef> when a programmer uses the word "just" be cautious 😛 |
08:27:48 | FromDiscord | <dom96> In reply to @haxscramper "we can, just make": Yeah. That’s what I have in mind. |
08:28:21 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:29:01 | PMunch | You'd still need to get Nims C mangling rules right |
08:29:07 | FromDiscord | <haxscramper> No |
08:29:12 | PMunch | Which might actually be impossible to do from a macro |
08:29:21 | FromDiscord | <fae> I dont really understand C very well but it looks like the compiler already kind of generates headers inside of the generated `.c.` files even without the `--headers` flag |
08:29:25 | FromDiscord | <haxscramper> When nim generates headers it generates regular names |
08:29:36 | FromDiscord | <impbox [ftsf]> for exportc procs they should be the same right? |
08:29:41 | FromDiscord | <impbox [ftsf]> not mangled |
08:29:43 | FromDiscord | <haxscramper> I have `.exportc.` already, so I don't have to deal with `sdjf;klasjdfklasjd` sighashes |
08:29:46 | FromDiscord | <fae> sent a code paste, see https://play.nim-lang.org/#ix=3xpF |
08:29:49 | FromDiscord | <Elegantbeef> Seems the idea is you search the nim output dir to get the signtures |
08:29:55 | FromDiscord | <fae> and then the definition is bleow |
08:30:24 | FromDiscord | <fae> (edit) "`.c.`" => "`.c`" |
08:30:54 | FromDiscord | <haxscramper> In reply to @Elegantbeef "Seems the idea is": No, signatures have nothing to do with anything, we want to generate usable header, which means there is no signatures involved as I have all procs already annotated with `.exportc` |
08:30:54 | FromDiscord | <Elegantbeef> Those are forward declared |
08:30:57 | FromDiscord | <haxscramper> That does not mangle names |
08:31:14 | FromDiscord | <Elegantbeef> But parameters names can be no? |
08:31:22 | FromDiscord | <Elegantbeef> say you take a `seq[byte]` |
08:31:45 | FromDiscord | <haxscramper> Well, the moment I find out how to sanely interface between C and nim generics I will let you know |
08:32:13 | FromDiscord | <haxscramper> and `seq[byte]` details is an impl. detail |
08:32:16 | FromDiscord | <Elegantbeef> Can you exportc an alias? |
08:33:01 | FromDiscord | <dom96> Usually you’d avoid exporting Nim procs that take Nim types. |
08:33:18 | FromDiscord | <dom96> So I think it’s fair to not bother supporting those |
08:34:01 | FromDiscord | <haxscramper> For `seq[int]` `--header` generates `N_LIB_PRIVATE N_NIMCALL(tySequenceqwqHTkRvwhrRyENtudHQ7g, aa)(void);` |
08:34:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xpH |
08:34:16 | FromDiscord | <Elegantbeef> Ah you can export aliases |
08:34:17 | FromDiscord | <haxscramper> You can't get around it |
08:34:54 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xpJ |
08:35:04 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xpK |
08:35:13 | FromDiscord | <haxscramper> But that's just `{.exportc.}` everything just as I said |
08:35:23 | FromDiscord | <haxscramper> but still |
08:35:54 | FromDiscord | <haxscramper> So in the end it can be just done via simple name-based translation |
08:36:23 | FromDiscord | <Elegantbeef> Yea i was just curious if you could get a usable C type name for generics |
08:40:23 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3xpL |
08:40:51 | FromDiscord | <haxscramper> `exHeader` implementation is left as an exercise for the reader |
08:40:52 | FromDiscord | <Elegantbeef> Could just link the cgen directory for that 😜 |
08:41:18 | FromDiscord | <haxscramper> Well, maybe I will implement something like that in hmisc |
09:00:11 | * | krux02 joined #nim |
09:00:11 | * | jjido joined #nim |
09:15:09 | * | razzlom joined #nim |
09:27:14 | * | razzlom quit (Quit: Quit) |
09:28:55 | * | razzlom joined #nim |
09:30:04 | emery | can anyone see anything oviously wrong with this type? I'm losing a layer of the generic typing with the sets https://play.nim-lang.org/#ix=3xq3 |
09:36:16 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:37:23 | FromDiscord | <KnorrFG> Hey, is anyone aware of a "bidirectional table" for nim? |
09:40:24 | FromDiscord | <impbox [ftsf]> not that i know of, but it seems like it'd be trivial to make |
09:41:53 | * | zargot joined #nim |
09:52:39 | FromDiscord | <impbox [ftsf]> @KnorrFG https://play.nim-lang.org/#ix=3xqn |
09:53:24 | emery | my bad type, but simpler https://play.nim-lang.org/#ix=3xqp |
09:53:36 | * | razzlom quit (Remote host closed the connection) |
09:54:31 | FromDiscord | <impbox [ftsf]> @KnorrFG though this implementation won't work if your key and value are the same type since the calls will be ambigious |
10:10:12 | FromDiscord | <KnorrFG> thanks for the answer. Yeah I know, its not that hard superficially, but I foggily remember that just wrapping 2 tableswasnt a good idea for some reason. Also I didnt want to reimplement all the methods 😛 |
10:10:30 | FromDiscord | <impbox [ftsf]> just implement the ones you need =) |
10:11:47 | FromDiscord | <impbox [ftsf]> i guess there's probably less memory heavy ways where you'd only store the data once and then use indices or something, but depends if that's a bottleneck |
10:24:05 | * | arkurious joined #nim |
10:32:55 | FromDiscord | <Rika> In reply to @impbox "<@!689821975463460892> https://play.nim-lang.org/#i": If the types are the same you can just use the same table |
10:33:03 | FromDiscord | <Rika> Rather a single table |
10:45:50 | FromDiscord | <impbox [ftsf]> not necessarily |
10:46:34 | FromDiscord | <Rika> I don’t see why |
10:46:38 | FromDiscord | <Rika> Not |
10:46:39 | FromDiscord | <impbox [ftsf]> both types might be strings, but A"foo" -> B"bar" but A"bar" -> B"baz" |
10:47:07 | FromDiscord | <Rika> I thought the invariant was that the value points to the key and the key points to the value |
10:48:39 | FromDiscord | <impbox [ftsf]> Key"foo" -> Value"bar"↵Key"bar" -> Value"baz"↵but to get the reverse you need a separate table that maps Value"bar"->Key"foo" |
10:49:41 | FromDiscord | <Rika> Well how would you access the bar that points to baz? |
10:50:07 | FromDiscord | <Rika> Are there two procs for “key index” and “value index”? |
10:50:34 | FromDiscord | <impbox [ftsf]> that's what I was saying, that implementation wouldn't work because it'd be ambiguous |
10:50:43 | FromDiscord | <impbox [ftsf]> but you could use distinct types |
10:51:08 | FromDiscord | <impbox [ftsf]> or add a reverse lookup proc |
10:51:10 | FromDiscord | <haxscramper> For bidirectional `Set[Key] -> Value` I had to do https://haxscramper.github.io/hmisc/hmisc/types/rev_set_table.html |
10:51:26 | FromDiscord | <haxscramper> Which has explicit reverse lookup procs |
10:52:00 | FromDiscord | <haxscramper> If I drop `Value -> Set[Key]` getters, I still need to have two bidirectional checks |
10:52:56 | FromDiscord | <Rika> Okay I get it |
10:53:07 | FromDiscord | <haxscramper> And double all API parts, like `hasKey()`, `hasValue()`, `getKey(V)`, `getValue(K)` |
10:59:29 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
11:04:44 | FromDiscord | <enthus1ast> Or have 3 tables one with the data, one with one relation, one with the other, then lookup In relation table and get the data in a second lookup |
11:05:25 | FromDiscord | <enthus1ast> Have build a "database" this way |
11:13:12 | FromDiscord | <Rika> In reply to @enthus1ast "Have build a "database"": So a graph database |
11:15:12 | FromDiscord | <haxscramper> How do I debug 'generic instantiation is too nested', especially when it seems like everything is working as expected? I did `static: echo` for instantiated types, and it does not show any weird loops or anything of that sort |
11:15:20 | FromDiscord | <haxscramper> I do have relatively deep instantiation though |
11:18:49 | FromDiscord | <exelotl> Thanks PMunch and @impbox [ftsf] <3 |
11:19:30 | PMunch | It looks awesome as always! |
11:19:39 | PMunch | But I can't run the emulated version under Wine (: |
11:19:41 | PMunch | :(* |
11:20:42 | FromDiscord | <exelotl> Oh, the PC download doesn't work in Wine due to something going wrong in wNim I think |
11:21:00 | PMunch | Yeah I got an error from wNim |
11:21:14 | PMunch | wTextCtrl.nim(993) init: Error: unhandled exception: cannot wrap this textctrl. [wError] |
11:22:05 | FromDiscord | <exelotl> It's strange, just some winapi function returning null when it shouldn't, but I didn't have time to figure it out :( |
11:23:06 | FromDiscord | <exelotl> But you can always install mGBA or another emulator of your choice and run the game in there ^^ |
11:25:20 | FromDiscord | <exelotl> Also we added more physical copies to the KS page, these are the "regular" First Press editions, but will be unlimited hopefully! :D |
11:41:20 | PMunch | Oh nice, unfortunately I'm so old that I only have a GBC.. |
11:46:13 | * | jjido joined #nim |
12:02:50 | PMunch | Is there a way to get the names of built-in stuff? |
12:03:09 | PMunch | Or should I just used declared or whatever it's called to avoid collisions with existing names? |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:16 | PMunch | Hmm "declared" doesn't work for e.g. "else" |
12:06:30 | * | supakeen joined #nim |
12:06:30 | PMunch | I just want to check if something would be a valid type name or if it would collide with anything |
12:07:30 | PMunch | I guess I could manually copy this list.. https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords |
12:08:09 | FromDiscord | <Rika> I’m interested in why you need this haha |
12:09:00 | FromDiscord | <impbox [ftsf]> maybe there's a isValidIdentifier function in nim somewhere |
12:09:22 | FromDiscord | <impbox [ftsf]> https://github.com/nim-lang/Nim/blob/8ccde68f132be4dba330eb6ec50f4679e564efac/doc/keywords.txt |
12:10:37 | FromDiscord | <haxscramper> `std/strutils.validIdentifier` |
12:10:55 | FromDiscord | <haxscramper> PMunch\: do you need this for your clang bindings? |
12:11:23 | FromDiscord | <impbox [ftsf]> https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/strutils.nim#L2389 doesn't look like that checks against keywords |
12:11:36 | PMunch | @Rika, I'm using libclang to automatically create Nim bindings for C libraries |
12:11:40 | FromDiscord | <haxscramper> https://haxscramper.github.io/hmisc/hmisc/algo/namegen.html#isReservedNimWord%2Cstring |
12:12:41 | PMunch | Oh cool, that'll be helpful |
12:12:50 | FromDiscord | <haxscramper> ffs, nim "--PrOJeCt" is randomly breaks source links. Anyway, full list is https://github.com/haxscramper/hmisc/blob/master/src/hmisc/algo/namegen.nim#L147 |
12:13:37 | FromDiscord | <whisperdev> Hmm how does one zip a single file with this library? https://github.com/guzba/zippy |
12:13:40 | nrds | <R2D299> itHub: 7"Pure Nim implementation of deflate, zlib, gzip and zip." |
12:14:09 | FromDiscord | <haxscramper> `readFile().compress()`? |
12:14:25 | FromDiscord | <haxscramper> `writeFile("out", "in".readFile().compress())` |
12:15:01 | FromDiscord | <whisperdev> aha |
12:16:01 | FromDiscord | <whisperdev> Thanks! |
12:21:11 | * | xet7 quit (Read error: Connection reset by peer) |
12:21:32 | * | xet7 joined #nim |
12:23:19 | PMunch | Uhm, that would read the entire file into memory though |
12:23:20 | PMunch | So beware |
12:26:38 | FromDiscord | <whisperdev> It seems I cant just unzip the file afterwards in Windows |
12:26:58 | FromDiscord | <impbox [ftsf]> it's probably not a zip |
12:27:10 | FromDiscord | <impbox [ftsf]> just a compressed file |
12:27:24 | FromDiscord | <impbox [ftsf]> rather than an archive of multiple files |
12:28:25 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, I'm using libclang": Ooh I see |
12:28:29 | FromDiscord | <impbox [ftsf]> https://github.com/guzba/zippy/blob/master/examples/ziparchive_compose.nim#L5 |
12:28:37 | FromDiscord | <impbox [ftsf]> @whisperdev try this |
12:28:55 | FromDiscord | <whisperdev> I was looking at it before |
12:28:58 | FromDiscord | <whisperdev> now it makes sense |
12:40:15 | * | rockcavera joined #nim |
12:40:15 | * | rockcavera quit (Changing host) |
12:40:15 | * | rockcavera joined #nim |
12:48:07 | * | max22- quit (Ping timeout: 250 seconds) |
12:51:37 | FromDiscord | <Cark> how can I get an openarray from a bunch of bytes at some pointer address (i have the length too) |
12:52:41 | FromDiscord | <Cark> (edit) "how can I get an openarray from a bunch of bytes at some pointer address (i have the length too) ... " added "?" |
12:53:10 | PMunch | @Cark, probably this: https://nim-lang.github.io/Nim/system.html#toOpenArray%2Cptr.UncheckedArray%5BT%5D%2Cint%2Cint |
12:53:33 | FromDiscord | <Cark> mhh worth a try, thanks ! |
12:55:04 | * | flynn quit (Read error: Connection reset by peer) |
12:56:11 | * | flynn joined #nim |
12:56:51 | FromDiscord | <Neko~Neko~ni> sent a long message, see http://ix.io/3xr6 |
13:01:22 | FromDiscord | <impbox [ftsf]> nim doesn't create the executable, the C linker does, so it's up to that to support it |
13:01:32 | FromDiscord | <impbox [ftsf]> you can pass arguments to the linker to specify the icon |
13:02:07 | FromDiscord | <Neko~Neko~ni> i know that but aren't there option in gcc for adding icons |
13:02:27 | * | kayabaNerve_ joined #nim |
13:02:42 | FromDiscord | <impbox [ftsf]> --passL:"icon.res" |
13:03:16 | * | kayabaNerve quit (Killed (NickServ (GHOST command used by kayabaNerve_))) |
13:03:20 | FromDiscord | <Neko~Neko~ni> i see.how do i pass arguments to the linker? |
13:03:20 | * | kayabaNerve_ is now known as kayabaNerve |
13:03:29 | FromDiscord | <impbox [ftsf]> with --passL |
13:03:46 | FromDiscord | <impbox [ftsf]> `--passL:"this is an argument to the linker"` |
13:03:58 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/nimc.html |
13:03:59 | FromDiscord | <Neko~Neko~ni> gottcha👍 |
13:07:48 | FromDiscord | <whisperdev> @impbox [ftsf] That worked great. |
13:08:31 | FromDiscord | <whisperdev> How would I overwrite the the compression method parameters when calling the writeZipArchive method? |
13:08:39 | FromDiscord | <whisperdev> Or would I just make my own declaration with what I want? |
13:12:50 | FromDiscord | <impbox [ftsf]> i'm not sure sorry |
13:14:02 | FromDiscord | <whisperdev> Not a question for you and in regard to zippy just in general 😄 |
13:44:36 | * | PMunch quit (Quit: Leaving) |
14:11:36 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:22:26 | * | krux02 quit (Quit: Leaving) |
14:55:00 | FromDiscord | <Cark> ok so I think I'm missing some declarations in winuser.h, which i guess is the one in my mingw64 distribution. I'm on windows, my guess is that nim uses the mingw64 which is in the path |
14:55:32 | FromDiscord | <Cark> that version is quite outdated on my computer, and i see the current mingw64 has that declaration |
14:55:56 | FromDiscord | <Cark> can i just replace the content of that folder with the updated version ? |
14:57:50 | FromDiscord | <Cark> btw i've been trying clang-cl and vcc, but so many warnings =) |
14:58:48 | * | flynn quit (Read error: Connection reset by peer) |
14:59:30 | FromDiscord | <Yardanico> In reply to @Cark "btw i've been trying": that's not really an issue, nim silences them usually, if it doesn't then something's wrong :P |
14:59:33 | FromDiscord | <Yardanico> In reply to @Cark "can i just replace": yes |
14:59:49 | FromDiscord | <Cark> @Yardanico thanks ! |
14:59:55 | * | flynn joined #nim |
15:00:04 | FromDiscord | <Cark> doesn't silence them on my computer though ...maybe something wrong here |
15:02:36 | FromDiscord | <Cark> ah i now can declare the missing function, and it actually works, thanks again |
15:10:08 | * | max22- joined #nim |
15:19:33 | * | jjido joined #nim |
15:40:20 | * | beshr joined #nim |
15:48:50 | FromDiscord | <dauuricus (haywhnk)> i'm searching for info about how to build Nim compiler on termux ... |
16:05:38 | * | pch_ is now known as pch |
16:19:19 | NimEventer | New thread by JohnLuck: Any way to avoid the SQL bugs and execute raw strings?, see https://forum.nim-lang.org/t/8382 |
16:34:48 | * | zargot quit (Quit: leaving) |
17:14:10 | * | pro joined #nim |
17:24:29 | FromDiscord | <Goat> Anyone here know of a good Emacs .org parser for nim? |
17:32:55 | * | lucerne joined #nim |
17:40:54 | * | flynn quit (Read error: Connection reset by peer) |
17:42:01 | * | flynn joined #nim |
17:49:15 | FromDiscord | <haxscramper> Good/working - no, but I'm finally (after N months of delays) got back to https://github.com/haxscramper/haxorg and I want to finish it |
17:49:18 | nrds | <R2D299> itHub: 7"<No Description>" |
17:51:16 | FromDiscord | <haxscramper> Right now I got implementation of the main lexer logic, some parsing, tree pretty-printing for parsed tree, AST spec for untyped and WIP spec for semchecked AST |
18:16:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:24:17 | * | flynn quit (Remote host closed the connection) |
18:25:20 | * | jjido joined #nim |
18:25:24 | * | flynn joined #nim |
18:44:07 | * | pro quit (Quit: WeeChat 3.2) |
19:03:42 | FromDiscord | <RattleyCooper> I compiled nim 1.4.8 on my rapsberry pi 4 but for some reason it really doesn't like this line from `netty`: `r.rand(high(uint32).int).uint32` . For some reason it doesn't want to convert an `int` to an `int32` (or maybe it's the other way around). |
19:05:23 | FromDiscord | <RattleyCooper> The `netty` script is the same on both my windows machines and the raspberry pi machine and it still throws an error when I try to use it on the rpi |
19:41:41 | FromDiscord | <Varriount> In reply to @RattleyCooper "I compiled nim 1.4.8": What message do you get? |
19:45:16 | FromDiscord | <RattleyCooper> I will have to check tonight. I really should have written it down or screencapped it. I was refraining from posting the error until I could confirm there was actually an issue. |
19:45:36 | FromDiscord | <RattleyCooper> I believe it was an OSError though. I can check after work and update. |
21:03:33 | * | Vladar quit (Quit: Leaving) |
21:16:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:25:21 | * | ozzz quit (Ping timeout: 248 seconds) |
21:27:40 | FromDiscord | <brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=3xud |
21:28:16 | FromDiscord | <brainproxy> I feel I'm hitting an encoding problem, maybe, or maybe I've misunderstood how to defined `hash` |
21:30:53 | FromDiscord | <Yardanico> to properly define `hash` you have to run `hash` on all fields of your character, and all types of the fields of the object should have `hash` defined too |
21:31:00 | FromDiscord | <Yardanico> see https://nim-lang.org/docs/hashes.html |
21:31:09 | FromDiscord | <Yardanico> for an example on defining a hash proc for a custom type |
21:31:34 | FromDiscord | <brainproxy> but if hash for that type is `hash $instance` |
21:31:41 | FromDiscord | <brainproxy> then should string hashes get compared? |
21:31:51 | FromDiscord | <brainproxy> (edit) "should" => "shouldn't" |
21:40:28 | FromDiscord | <Yardanico> In reply to @brainproxy "then shouldn't string hashes": yes, but IMO it's not good to rely on this |
21:57:34 | FromDiscord | <konsumlamm> In reply to @brainproxy "I have an `OrderedSet[MyType]`.": `hash` should return an `int`, not a `string`↵are you sure that your `hash` implementation is consistent with `==`? |
22:02:30 | FromDiscord | <Yardanico> oh lol, didn't see that |
22:13:31 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
22:15:57 | * | Gustavo6046 joined #nim |
22:16:17 | * | max22- quit (Quit: Leaving) |
22:22:17 | FromDiscord | <trenta3> sent a code paste, see https://play.nim-lang.org/#ix=3xuo |
22:28:10 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
22:30:45 | * | Gustavo6046 joined #nim |
22:35:34 | * | Gustavo6046_ joined #nim |
22:35:40 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
22:38:00 | * | Gustavo6046_ is now known as Gustavo6046 |
22:39:19 | FromDiscord | <RattleyCooper> In reply to @trenta3 "Is there a way": IIRC you can do this in a template with `unpackVarargs` from the `macros` library. You can also use a tuple |
22:41:26 | FromDiscord | <trenta3> In reply to @RattleyCooper "IIRC you can do": I did find `unpackVarargs` by searching in the documentation. What I don't understand is how to implement the part in the line `args += (element,)`, where I need to update a tuple by adding an element at the end of it. This is a part that I cannot realize using unpackVarargs or other methods that I know of. |
22:46:07 | * | byanka__ quit (Ping timeout: 240 seconds) |
22:55:23 | FromDiscord | <RattleyCooper> In reply to @trenta3 "I did find `unpackVarargs`": So, it looks like the decorator parses stuff and then runs some kind of function using the aggregated outputs from the parsing functions. It's kinda difficult to give you direction though because depending on what you're parsing, and the variability of the types used as inputs to that last function call, it's gonna be a different answer |
22:56:28 | FromDiscord | <RattleyCooper> Bc you can definitely do what you're trying to accomplish, but depending on types and that kind of stuff it'll likely just end up working different than python. |
23:01:21 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
23:01:25 | * | Gustavo6046_ joined #nim |
23:02:20 | FromDiscord | <trenta3> In reply to @RattleyCooper "So, it looks like": Yes the types of the parsed elements are widely different, and it doesn't really matter to me if it ends up working differently from python.↵I would like to have something that works and performs more or less such kind of recursive usage of varargs. |
23:02:56 | FromDiscord | <trenta3> Searching on the internet I couldn't find any examples and I feel it is too early for me to start writing macros |
23:03:25 | * | Gustavo6046_ is now known as Gustavo6046 |
23:06:47 | FromDiscord | <trenta3> If you could just point me to a possible way to archieve it, that would be awesome |
23:07:10 | FromDiscord | <Elegantbeef> Could you give a more elaborate input/output example? |
23:08:46 | FromDiscord | <trenta3> In reply to @Elegantbeef "Could you give a": I'm really just interested in how to handle packing and unpacking of tuples, since this is what I don't know how to archieve. The example was mainly "motivating". I will write a more complete example shortly. |
23:10:00 | FromDiscord | <RattleyCooper> There is no "pythonic" way to pass args using an arbitrary iterable like python's `someFunc(someArgs, someKwargs)` |
23:10:59 | FromDiscord | <RattleyCooper> You can unpack args similar to python: `(arg1, arg2) = someFuncThatReturnsTuple()` |
23:11:10 | FromDiscord | <RattleyCooper> (edit) "args" => "tuples" |
23:11:50 | * | stkrdknmibalz joined #nim |
23:12:22 | FromDiscord | <RattleyCooper> It's kind of funny bc I was coming from python a few weeks ago and had the same exact question lol. Unfortunately it's just not an easy answer due to Nim's strict type system |
23:13:16 | nrds | <Prestige99> or fortunately :P |
23:14:26 | FromDiscord | <Elegantbeef> Well there is but to a template rattley and it's in devel |
23:14:28 | FromDiscord | <Elegantbeef> `iterable[T]` exists in `devel` \:D |
23:14:35 | FromDiscord | <RattleyCooper> 😮 |
23:15:06 | FromDiscord | <Elegantbeef> For examples of it in use https://github.com/beef331/truss3d/blob/master/src/truss3D/models.nim#L176-L221 |
23:15:07 | FromDiscord | <trenta3> In reply to @RattleyCooper "It's kind of funny": Ouch, that was actually unexpected, since the `varargs[untyped]` seemed to be exactly the kind of way out of the type system that allows you to do it.↵I see that the implementation of `unpackVarargs` is very short. Maybe I can try to write similar thing to pack and unpack tuples |
23:15:48 | FromDiscord | <RattleyCooper> Lol, same thing I though XD |
23:15:54 | FromDiscord | <Elegantbeef> Well Nim has tuple unpacking |
23:16:29 | FromDiscord | <Elegantbeef> Could also look at https://github.com/technicallyagd/unpack |
23:16:32 | nrds | <R2D299> itHub: 7"sequence/object unpacking/destructuring for nim" |
23:16:34 | FromDiscord | <Elegantbeef> Alternatively https://hlaaftana.github.io/assigns/assigns.html |
23:18:32 | FromDiscord | <RattleyCooper> In reply to @trenta3 "Ouch, that was actually": You should definitely check out macros when you have a few minutes. It's kind of confusing at first but it is well worth the time to learn |
23:19:26 | FromDiscord | <trenta3> In reply to @Elegantbeef "Could also look at": Thanks a lot! This seems a really interesting project to look at and I should definitely try to understand the implementation |
23:21:02 | FromDiscord | <trenta3> In reply to @RattleyCooper "You should definitely check": I know it pays. Unfortunately nim macro syntax does seem wizardry to me |
23:21:39 | FromDiscord | <trenta3> Building the AST components manually is no fun |
23:21:48 | FromDiscord | <Elegantbeef> It's simply writing code to write code. Bit confusing at start but once you get to the AST it's fine |
23:21:54 | FromDiscord | <RattleyCooper> In reply to @trenta3 "Building the AST components": You need some `quote do` in your life |
23:22:07 | FromDiscord | <Elegantbeef> Well that's why there are things like genast and quote, use those as much as you can |
23:22:52 | FromDiscord | <Elegantbeef> You can also break the macro into smaller procedures to make it more managable |
23:23:23 | FromDiscord | <RattleyCooper> Looking at actual macros helps too... I didn't get it until I looked at your macro in nettyrpc beef |
23:23:43 | FromDiscord | <RattleyCooper> and started using treerepr/repr etc |
23:23:53 | FromDiscord | <Elegantbeef> Yep if you need a source of macros, i've got more than a couple libraries that use htem |
23:24:22 | FromDiscord | <Elegantbeef> kashae, constructor, nettyrpc, sumtypes(shittiest) 😀 |
23:25:06 | FromDiscord | <Elegantbeef> You also can ask here i'm more than happy to help |
23:25:10 | FromDiscord | <RattleyCooper> I'm gonna check out kashae and constructor macros next. |
23:26:15 | * | krux02 joined #nim |
23:26:37 | FromDiscord | <Elegantbeef> Kashae i think uses more quote do than nettyrpc did, so should be more understandable, but yea still AST manipulation in there |
23:26:58 | FromDiscord | <trenta3> In reply to @Elegantbeef "Well that's why there": Thanks I'm gonna look at those. |
23:40:37 | * | flynn quit (Read error: Connection reset by peer) |
23:41:43 | * | flynn joined #nim |
23:49:19 | * | auxym_ joined #nim |