00:02:26 | FromDiscord | <AmjadHD> Is it preferable to use local variables whenever possible ? |
00:02:38 | FromDiscord | <Elegantbeef> Of course |
00:03:09 | FromDiscord | <AmjadHD> So should I wrap global variables in a main proc ? |
00:03:24 | FromDiscord | <!&luke> How can I square a number |
00:03:26 | FromDiscord | <Elegantbeef> You can if you want for global variables, it's up to you there |
00:03:30 | FromDiscord | <Elegantbeef> `x x` |
00:03:35 | FromDiscord | <Elegantbeef> Or import `std/math` and do `x ^ 2` |
00:03:38 | FromDiscord | <!&luke> Something like the operator in python |
00:03:43 | FromDiscord | <!&luke> In reply to @Elegantbeef "Or import `std/math` and": Ok |
00:04:19 | FromDiscord | <!&luke> In reply to @Elegantbeef "`x * x`": The problem with that is that I'm squaring a complex math equation, and that would be incredibly verbose |
00:04:29 | FromDiscord | <AmjadHD> In reply to @Elegantbeef "You can if you": Is there any difference performance wise |
00:04:34 | FromDiscord | <AmjadHD> (edit) "In reply to @Elegantbeef "You can if you": Is there any difference performance wise ... " added "?" |
00:04:45 | FromDiscord | <Elegantbeef> Nope it's purely design |
00:10:27 | FromDiscord | <AmjadHD> In reply to @Elegantbeef "Nope it's purely design": I remember reading somewhere (I think in the forum) that having a main function is actually faster. |
00:10:42 | FromDiscord | <Elegantbeef> No longer the case i believe |
00:10:48 | FromDiscord | <Generic> really? |
00:10:57 | FromDiscord | <Generic> does it lift global variables to locals now? |
00:11:19 | FromDiscord | <Elegantbeef> I think araq has said it's no longer the case |
00:11:21 | FromDiscord | <Elegantbeef> I could be wrong |
00:13:00 | FromDiscord | <auxym> there |
00:13:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49L2 |
00:13:22 | FromDiscord | <Elegantbeef> But no TRMs are dicks |
00:13:42 | FromDiscord | <auxym> there is still this bug which means you have to have a main if you're using volatile (which is not many people outside embedded I guess) https://github.com/nim-lang/Nim/issues/14623 |
00:31:53 | FromDiscord | <Girvo> Silly question: whats a TRM in this context |
00:32:12 | FromDiscord | <Elegantbeef> term rewriting macros, an experimental feature that uses a pattern to apply a macro/template |
00:32:16 | FromDiscord | <Girvo> Ahhhh right |
00:38:41 | * | jmdaemon quit (Ping timeout: 252 seconds) |
00:44:09 | FromDiscord | <!&luke> How can I get the factors of a number as an array |
00:44:24 | FromDiscord | <!&luke> (edit) "factors" => "multiples" |
00:47:02 | FromDiscord | <Elegantbeef> The multiples up to what? |
00:47:09 | FromDiscord | <Elegantbeef> There are infinite multiples of a number |
00:49:48 | FromDiscord | <!&luke> In reply to @Elegantbeef "There are infinite multiples": No? You can only have multiples up to the number itself |
00:50:08 | FromDiscord | <!&luke> The greatest multiple of a number would be 1 and that number |
00:50:36 | FromDiscord | <!&luke> Oh I’m dumb |
00:50:40 | FromDiscord | <!&luke> I meant factors |
00:52:58 | FromDiscord | <Elegantbeef> Look up how to calculate factors and make a procedure that does that |
00:59:42 | FromDiscord | <auxym> In reply to @ripluke "I meant factors": https://rosettacode.org/wiki/Proper_divisors |
01:02:08 | FromDiscord | <Mr.Ender> sent a code paste, see https://play.nim-lang.org/#ix=49L9 |
01:02:17 | FromDiscord | <Mr.Ender> (edit) "https://play.nim-lang.org/#ix=49L9" => "https://play.nim-lang.org/#ix=49La" |
01:02:24 | FromDiscord | <Mr.Ender> (edit) "https://play.nim-lang.org/#ix=49La" => "https://play.nim-lang.org/#ix=49Lb" |
01:02:39 | FromDiscord | <huantian> In reply to @auxym "https://rosettacode.org/wiki/Proper_divisors": that is definitely a translation of C |
01:02:46 | FromDiscord | <Mr.Ender> (edit) "https://play.nim-lang.org/#ix=49Lb" => "https://play.nim-lang.org/#ix=49Lc" |
01:03:47 | FromDiscord | <auxym> someone could then edit the wiki with a more idiomatic version 🙂 (maybe @!&luke) |
01:03:51 | FromDiscord | <huantian> also suprised they didn't do up to sqrt n |
01:03:59 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=49Ld |
01:04:53 | FromDiscord | <Elegantbeef> Welcome to antivirus and obscure languages↵(@Mr.Ender) |
01:05:19 | FromDiscord | <Mr.Ender> In reply to @Elegantbeef "Welcome to antivirus and": Would be there a way of fixing this |
01:05:39 | FromDiscord | <auxym> disable antivirus is the only real fix right now |
01:05:49 | FromDiscord | <Mr.Ender> but what about for other people |
01:05:55 | FromDiscord | <Elegantbeef> Report it as a false positive to the antivirus and hope it changes |
01:06:01 | FromDiscord | <Mr.Ender> In reply to @Elegantbeef "Report it as a": ok |
01:06:09 | FromDiscord | <Elegantbeef> Right now you can get just `echo "hello world"` to be flagged as malware |
01:06:43 | FromDiscord | <Elegantbeef> antivirus is terrible |
01:06:51 | FromDiscord | <auxym> @Mr.Ender some discussion here https://forum.nim-lang.org/t/9388#61669 and here https://forum.nim-lang.org/t/9358#61448 |
01:09:21 | FromDiscord | <Mr.Ender> I guess |
01:09:59 | FromDiscord | <Elegantbeef> It's of course a shame, but it's on the antivirus "tooling" to work properly |
01:11:19 | FromDiscord | <Mr.Ender> true |
01:11:23 | FromDiscord | <Girvo> Yep. The fact they've decided to flag a programming language as a virus is fucking stupid. |
01:11:29 | FromDiscord | <Girvo> Excuse my language. |
01:11:39 | FromDiscord | <Elegantbeef> You're just speaking your native tongue |
01:11:45 | FromDiscord | <Mr.Ender> nim is being flagged as a virus? |
01:11:51 | FromDiscord | <Elegantbeef> Yep |
01:11:52 | FromDiscord | <Girvo> Yep |
01:11:55 | FromDiscord | <Mr.Ender> wow |
01:12:20 | FromDiscord | <Elegantbeef> There is a community of people writing malware with Nim as such they do a lowest common denominator approach to virus detection and flag a shit load of Nim software |
01:12:53 | FromDiscord | <Mr.Ender> when looking at solutions earlier I found you can pay for a certificate from microsoft to prove your software is safe I feel its only there so they make money and not for user safty |
01:12:59 | FromDiscord | <Mr.Ender> (edit) "safty" => "safety" |
01:13:17 | FromDiscord | <Girvo> Which is silly: more viruses are written in C++ than anything else, but they don't flag GCC sigh |
01:13:18 | FromDiscord | <Elegantbeef> The only way to prove software is safe is to audit it, everything else is a lie! 😛 |
01:13:26 | * | jmdaemon joined #nim |
01:13:28 | FromDiscord | <auxym> the backstory is that some malware writers and researchers started using Nim, because it's a friendly and efficient language that allows low-level constructs. AVs work on pattern-matching, and they apparently have a bunch of patterns that are just typical nim codegen that gets flagged as malware, because some malware uses nim |
01:13:50 | FromDiscord | <Mr.Ender> ;/ |
01:14:03 | FromDiscord | <Elegantbeef> Time to use Go... oh wait 😛 |
01:14:04 | FromDiscord | <auxym> In reply to @Elegantbeef "The only way to": which is another way of saying that it's impossible to prove that software is safe 🙂 |
01:14:31 | FromDiscord | <Mr.Ender> I was planning to use go before this before I found its a language meant to be used for servers |
01:14:54 | FromDiscord | <Elegantbeef> It also has the same malware issue and has a section on their page about being falsely detected |
01:15:07 | FromDiscord | <Elegantbeef> It's a real shame when you have to say "trust us we say it's safe" to distribute software |
01:15:17 | FromDiscord | <Mr.Ender> ya |
01:15:54 | FromDiscord | <auxym> interesting, hadn't heard that about go. hoping it pushes AV vendors and/or IT departments to make the right decisions |
01:16:51 | FromDiscord | <Elegantbeef> Yea flywind brought it up the last time we had this conversation |
01:17:59 | FromDiscord | <Elegantbeef> The common reaction of programmers is "Dont use windows" |
01:18:19 | FromDiscord | <Girvo> Sadly work means I don't get a choice |
01:18:56 | FromDiscord | <Elegantbeef> Yea i know, but it's a common sentiment regardless |
01:19:12 | FromDiscord | <Elegantbeef> Powerless to do anything about it so sit in the corner of hoping something changes |
01:19:26 | FromDiscord | <Elegantbeef> Maybe we make Nim malware that destroys your PC if you write Nim malware |
01:19:29 | FromDiscord | <Elegantbeef> That's the trick |
01:59:53 | FromDiscord | <Patitotective> In reply to @Elegantbeef "Maybe we make Nim": please |
02:00:21 | * | derpydoo joined #nim |
02:18:43 | FromDiscord | <Girvo> Like a cursed Clippy "I see you're writing malware..." |
02:19:22 | FromDiscord | <Elegantbeef> Could call it crowy and make it a crowbar wielding a tire iron |
02:29:27 | FromDiscord | <Bung> found implement proc like read until xxx is ineffective, it cause much more read loop, isn't it? |
02:30:29 | * | arkurious quit (Quit: Leaving) |
03:50:22 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
04:23:08 | * | jmdaemon joined #nim |
06:13:52 | * | wallabra quit (Quit: ZNC 1.8.2 - https://znc.in) |
06:13:56 | * | wallabra_ joined #nim |
06:15:34 | * | wallabra_ is now known as wallabra |
06:22:15 | FromDiscord | <qb> is `passL:-s` the same as `passL:-static`? Didn't found any information |
06:26:10 | Amun-Ra | qb: no, passL=-s is like adding strip -s after build |
06:26:41 | Amun-Ra | it removes all symbol tables and reloc infos from executable |
06:29:12 | FromDiscord | <Elegantbeef> Look at your c compiler |
06:29:12 | FromDiscord | <Elegantbeef> I dont think it's the same, but i dont know i dont |
06:29:12 | FromDiscord | <Elegantbeef> Rather linker 😄 |
06:29:34 | Amun-Ra | it's not :) |
06:29:49 | Amun-Ra | https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options |
06:29:57 | Amun-Ra | -s Remove all symbol table and relocation information from the executable. |
06:30:07 | Amun-Ra | -static On systems that support dynamic linking, this overrides -pie and prevents linking with the shared libraries. On other systems, this option has no effect. |
06:30:18 | * | rockcavera quit (Remote host closed the connection) |
06:38:31 | FromDiscord | <qb> Thanks 🙂 |
06:48:49 | * | PMunch joined #nim |
06:56:44 | Amun-Ra | no worries :) |
06:57:08 | Amun-Ra | use -s only when building release |
07:27:10 | * | m5zs7k quit (Ping timeout: 268 seconds) |
07:28:13 | * | m5zs7k joined #nim |
07:28:47 | * | neceve quit (Quit: ZNC - https://znc.in) |
07:53:59 | FromDiscord | <ECHO> is there a way for me to execute a shell command and have the output in a variable? |
07:54:31 | FromDiscord | <ECHO> because `execShellCmd()` just outputs it |
07:54:42 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring |
07:56:00 | Amun-Ra | staticExec |
07:56:10 | Amun-Ra | (from std/system) |
07:56:16 | Amun-Ra | oh, you mean runtime |
08:01:56 | FromDiscord | <NullCode> In reply to @auxym "the backstory is that": yeah thats about right |
08:02:28 | * | vicecea quit (Remote host closed the connection) |
08:02:29 | FromDiscord | <NullCode> i really hate the malware devs who use nim to make bad stuff |
08:02:58 | * | vicecea joined #nim |
08:04:23 | FromDiscord | <ECHO> In reply to @Elegantbeef "https://nim-lang.org/docs/osproc.html#execCmdEx%2Cs": is there any specific module i have to impot? |
08:04:27 | FromDiscord | <ECHO> import |
08:04:36 | FromDiscord | <NullCode> import std/osproc |
08:05:03 | FromDiscord | <NullCode> that should be the only module you need |
08:05:07 | FromDiscord | <NullCode> btw question |
08:05:15 | FromDiscord | <NullCode> how can i do this in nim https://media.discordapp.net/attachments/371759389889003532/1016620080580268032/unknown.png |
08:05:38 | FromDiscord | <NullCode> this is what i was trying https://media.discordapp.net/attachments/371759389889003532/1016620176722116608/unknown.png |
08:05:50 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/terminal.html#ansiForegroundColorCode%2CColor |
08:05:58 | PMunch | Have a look at terminalstyles |
08:06:01 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/terminal.html#writeStyled%2Cstring%2Cset%5BStyle%5D |
08:06:04 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/terminal.html#styledWrite.m%2CFile%2Cvarargs%5Btyped%5D |
08:06:08 | FromDiscord | <NullCode> i know |
08:06:16 | PMunch | termstyle, sorry: https://github.com/PMunch/termstyle |
08:06:18 | FromDiscord | <NullCode> but windows cmd doesn't allow for ansi escape |
08:06:26 | PMunch | Ah, that's easy to fix |
08:06:30 | PMunch | Just switch to Linux |
08:06:32 | FromDiscord | <NullCode> In reply to @NullCode "how can i do": unless you do this |
08:06:39 | FromDiscord | <NullCode> In reply to @PMunch "Just switch to Linux": ah yes, very easy |
08:06:54 | FromDiscord | <NullCode> if only i wasnt targeting windows users |
08:07:21 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/1016620607741370388/unknown.png |
08:07:24 | FromDiscord | <NullCode> i tried to do this in nim |
08:07:36 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/1016620672719532072/unknown.png |
08:07:38 | FromDiscord | <NullCode> and this happens |
08:08:00 | FromDiscord | <NullCode> (ps: I've confirmed the python method works in, well, python) |
08:08:01 | FromDiscord | <Elegantbeef> Windows users are scared of the terminal, making it colourful just scares them more |
08:08:11 | FromDiscord | <NullCode> In reply to @Elegantbeef "Windows users are scared": LMAO |
08:08:18 | FromDiscord | <Rika> https://stackoverflow.com/questions/65726013/enabling-ansi-escape-code-processing-on-the-modern-windows-command-line-c |
08:08:56 | FromDiscord | <Rika> https://solarianprogrammer.com/2019/04/08/c-programming-ansi-escape-codes-windows-macos-linux-terminals/ |
08:08:58 | FromDiscord | <NullCode> man |
08:09:14 | FromDiscord | <Rika> If you want it easy, use the packages listed above |
08:09:21 | FromDiscord | <Elegantbeef> who'd you try to do it in Nim? |
08:09:22 | PMunch | Ah yes, that seems to be about the same thing I found |
08:09:24 | FromDiscord | <Elegantbeef> Howd |
08:09:31 | FromDiscord | <Elegantbeef> I think i have dyslexia |
08:10:18 | FromDiscord | <NullCode> but i was wondering why `execCmd("")` doesn't work in nim |
08:10:27 | FromDiscord | <NullCode> is python just stupid, and doing smth else in the bg |
08:10:31 | FromDiscord | <NullCode> i should check it |
08:10:35 | FromDiscord | <Rika> Likely |
08:10:41 | FromDiscord | <Rika> Python is mr batteries included after all |
08:10:46 | PMunch | It seems like `terminal.enableTrueColors` calls the correct thing |
08:11:04 | FromDiscord | <NullCode> really |
08:11:06 | FromDiscord | <NullCode> i tried that before |
08:11:08 | FromDiscord | <NullCode> let me try again |
08:11:30 | PMunch | Ah wait, that might just try to enable 24-bit support.. |
08:11:38 | Amun-Ra | os.system is platform dependent |
08:11:42 | FromDiscord | <NullCode> nah https://media.discordapp.net/attachments/371759389889003532/1016621700823134248/unknown.png |
08:11:51 | FromDiscord | <NullCode> platform-independant |
08:12:05 | FromDiscord | <Rika> Platform dependent in terms of design |
08:12:12 | FromDiscord | <Rika> Platform independent in terms of usage |
08:12:13 | PMunch | Is this the console, or powershell by the way |
08:12:15 | Amun-Ra | yes |
08:12:21 | FromDiscord | <NullCode> legacy cmd |
08:12:24 | FromDiscord | <NullCode> In reply to @Rika "Platform independent in terms": true |
08:12:25 | FromDiscord | <Rika> In reply to @PMunch "Is this the console,": I assume cmd.exe |
08:12:25 | Amun-Ra | usage is independent, results are |
08:12:30 | Amun-Ra | dependent* |
08:12:58 | FromDiscord | <Rika> You can technically just tell people to use the new windows terminal but that’s extra steps so |
08:13:47 | FromDiscord | <NullCode> yeah |
08:13:57 | FromDiscord | <NullCode> my main target was just using cmd |
08:14:18 | FromDiscord | <NullCode> wterminal is possible ofc, but thats just gonna put pressure on the smol brains |
08:15:18 | FromDiscord | <Rika> Gate keeping time |
08:16:50 | PMunch | Did you try those C variations? |
08:18:25 | FromDiscord | <NullCode> which ones |
08:18:53 | FromDiscord | <NullCode> https://solarianprogrammer.com/2019/04/08/c-programming-ansi-escape-codes-windows-macos-linux-terminals/ these? |
08:19:00 | PMunch | These ones: https://stackoverflow.com/questions/65726013/enabling-ansi-escape-code-processing-on-the-modern-windows-command-line-c |
08:19:01 | FromDiscord | <NullCode> well i might be a bit dumb for winapi |
08:19:21 | FromDiscord | <NullCode> especially in nim |
08:19:56 | FromDiscord | <NullCode> i already have a hard time with winapi in CPP |
08:19:58 | PMunch | Just have a look at the enableTrueColors thing, it calls the same API |
08:20:11 | PMunch | You can probably just copy paste together bits from there |
08:20:13 | FromDiscord | <NullCode> alright |
08:21:18 | FromDiscord | <NullCode> if only i could figure out what os.system("") does damn |
08:23:03 | Amun-Ra | I guess it calls SetConsoleMode and sets ENABLE_VIRTUAL_TERMINAL_PROCESSING flag |
08:23:36 | Amun-Ra | (in pre win10 oses) |
08:24:29 | PMunch | Yeah, that's probably all it does |
08:24:51 | PMunch | Well, not all it does of course. But all it does in relation to this |
08:25:20 | PMunch | It's a bit weird that it does that though |
08:25:21 | * | derpydoo quit (Quit: derpydoo) |
08:25:40 | Amun-Ra | yes, I didn't know it works that way |
08:29:56 | FromDiscord | <enthus1ast> When you use nimja all the templates are compiled into the binary↵(<@709044657232936960_madprops=5b=49=52=43=5d>) |
10:07:15 | * | rockcavera joined #nim |
10:07:15 | * | rockcavera quit (Changing host) |
10:07:15 | * | rockcavera joined #nim |
10:22:36 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49My |
10:22:44 | FromDiscord | <Nalmyth> Is it possible somehow? 🤔 |
10:22:46 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49My" => "https://play.nim-lang.org/#ix=49Mz" |
10:23:24 | FromDiscord | <Nalmyth> Specifically I want to pass the module, because then I can access multiple types from that module |
10:23:41 | FromDiscord | <Nalmyth> (edit) "module" => "module, not just a single type (as in this case)" |
10:29:32 | PMunch | Not quite sure what you're trying to do there |
10:31:07 | FromDiscord | <Nalmyth> In reply to @PMunch "Not quite sure what": Basically I want to access subtypes of an `untyped` kind |
10:31:20 | FromDiscord | <Nalmyth> `kind.Type` Where type is defined in `test_a` and `test_b` |
10:31:30 | FromDiscord | <Nalmyth> (edit) "type" => "`Type`" |
10:31:53 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MC |
10:32:07 | FromDiscord | <Nalmyth> Or that's not possible with nim AST expansion? |
10:38:02 | PMunch | I still have idea idea what you're actually trying to do.. |
10:38:28 | FromDiscord | <b1rdf00d> have you got a more concrete example? |
10:39:47 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49ME |
10:39:55 | FromDiscord | <Nalmyth> And it would be really useful to be able to treat these modules as generics |
10:40:19 | FromDiscord | <Nalmyth> Sometimes I have a function which needs multiple types from either `type_a.nim` or `type_b.nim` |
10:41:12 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MF |
10:41:28 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49MF" => "https://play.nim-lang.org/#ix=49MG" |
10:41:30 | FromDiscord | <Nalmyth> At the moment I would have to write out that function twice |
10:41:43 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MH |
10:41:54 | FromDiscord | <Nalmyth> It would be great if I had access to the module as a generic |
10:42:25 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MI |
10:42:44 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MJ |
10:42:56 | FromDiscord | <Nalmyth> Or maybe I'm thinking about this in the wrong way? |
10:42:57 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49MJ" => "https://play.nim-lang.org/#ix=49MK" |
10:44:14 | FromDiscord | <Rika> why do you have types that differ only by module name? |
10:44:49 | FromDiscord | <Nalmyth> An example would be inheritance, but I didn't actually build this codebase so I don't have the full answer to that question |
10:45:24 | * | estiquelapice quit () |
10:45:25 | FromDiscord | <Nalmyth> (edit) "An example would be inheritance, but I didn't actually build this codebase so ... I" added "unfortunately" |
10:45:43 | FromDiscord | <Rika> why would inheritance be an example... |
10:47:03 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MM |
10:47:45 | FromDiscord | <Rika> hmm i see |
10:47:59 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MN |
10:48:10 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49MN" => "https://play.nim-lang.org/#ix=49MO" |
10:48:44 | FromDiscord | <Rika> embed the version in the type, then alias the versioned type into a "regularly named" type? |
10:49:17 | FromDiscord | <Rika> v1 in a v1 module, etc↵then in some "all types" module `type Thing = ThingV7` or so |
10:49:24 | FromDiscord | <Rika> export it too sorry |
10:49:54 | FromDiscord | <Nalmyth> Hmm, so then you're doing `all_types.Thing | all_types.Thing2` |
10:50:19 | FromDiscord | <Rika> ? |
10:50:55 | FromDiscord | <Rika> i dont really know what your versioned use case is |
10:51:00 | FromDiscord | <Rika> (edit) "versioned" => "versioning" |
10:51:17 | FromDiscord | <Nalmyth> The versioned use case is the beacon chain, and supporting older versions of validator systems |
10:52:21 | FromDiscord | <Nalmyth> Sorry to be less specific, a crypto use case in a format like git branching |
10:52:33 | FromDiscord | <Rika> i get it im still thinking about a solution |
10:53:57 | FromDiscord | <b1rdf00d> how will you know which TypeA you want to return? |
10:54:54 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MR |
10:55:06 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=49MR" => "https://play.nim-lang.org/#ix=49MS" |
10:57:38 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49MU |
11:12:09 | FromDiscord | <b1rdf00d> If you're happy to do this: `something[test_a]() -> test_a.TypeA` , then what about↵↵`something[test_a.TypeA]() -> test_a.TypeA` ? |
11:13:25 | FromDiscord | <b1rdf00d> It's interesting what you're trying to do, but I don't think I grasp what makes _one_ of the types in the module special to become the return type. It sounds like it's purely based off the type name? |
11:15:28 | FromDiscord | <Nalmyth> In reply to @b1rdf00d "If you're happy to": Generics are fine if you only use one type from `type_a` but quite commonly I have more than one to be used in a single function (sometimes 5 or more) |
11:15:34 | FromDiscord | <Nalmyth> I think I'm getting closer though |
11:15:41 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49N2 |
11:15:47 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49N3 |
11:16:01 | FromDiscord | <Nalmyth> Is there some easily spottable problem with the above code? |
11:18:31 | FromDiscord | <b1rdf00d> should that macro have a return type? |
11:18:47 | FromDiscord | <Nalmyth> Hmm |
11:18:51 | FromDiscord | <b1rdf00d> I'm only just trying to write my own macros 🥲 |
11:19:11 | FromDiscord | <Nalmyth> That's it! |
11:19:13 | FromDiscord | <b1rdf00d> But it looks like that's a function with no return |
11:19:22 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49N4 |
11:19:31 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=49N5 |
11:20:44 | FromDiscord | <Nalmyth> Thank you guys, very helpful 🙏 |
11:21:32 | FromDiscord | <b1rdf00d> 🦆 , no worries 🙂 was an interesting question |
12:00:10 | * | jmdaemon quit (Ping timeout: 244 seconds) |
12:00:52 | * | arkurious joined #nim |
12:07:05 | FromDiscord | <qb> Is there something in the standard libs to get the screen resolution? |
12:09:07 | * | tk quit (Quit: Well, this is unexpected.) |
12:09:33 | * | tk joined #nim |
12:11:51 | FromDiscord | <auxym> hm that might be something you would have to get from wayland/x on linux, and from win32 api on windows |
12:11:56 | FromDiscord | <auxym> (just guessing) |
12:12:49 | FromDiscord | <auxym> for windows probably this https://stackoverflow.com/questions/4631292/how-to-detect-the-current-screen-resolution |
12:14:05 | * | estiquelapice joined #nim |
12:14:59 | FromDiscord | <qb> Yea I know. Was just hoping theres something done |
12:21:07 | PMunch | Don't think so, unfortunately |
12:21:33 | PMunch | I implemented something like this for notifishower, you're free to grab the code for x11 from there if you want to make a library out of it :) |
12:23:19 | PMunch | I mean you can't do screen resolution without handling multi-monitor setups |
12:23:45 | PMunch | notifishower does that, it creates and updates a list of monitors |
13:34:22 | * | rockcavera quit (Read error: Connection reset by peer) |
13:35:08 | * | rockcavera joined #nim |
13:35:09 | * | rockcavera quit (Changing host) |
13:35:09 | * | rockcavera joined #nim |
14:00:46 | FromDiscord | <flywind> Is there a better solution for https://github.com/andreaferretti/cello/pull/4 ? |
14:01:00 | FromDiscord | <jos> when i run nimble test, i get this odd error |
14:01:11 | FromDiscord | <jos> it doesn't matter what's inside my test file |
14:01:12 | FromDiscord | <jos> sent a code paste, see https://play.nim-lang.org/#ix=49NK |
14:01:14 | FromDiscord | <jos> i always get this error |
14:01:23 | FromDiscord | <jos> i have no clue how to debug this, is there a way to get a full stack trace? |
14:18:20 | FromDiscord | <jos> ok well I think it's missing the .nim in the cli command listed at the bottom, which might make sense? |
14:18:29 | FromDiscord | <jos> idk why it would, or if it's supposed to |
14:19:20 | FromDiscord | <Rika> thats fine |
14:19:30 | FromDiscord | <Rika> at least it should be |
14:21:20 | * | derpydoo joined #nim |
14:25:38 | * | PMunch quit (Quit: Leaving) |
14:45:22 | FromDiscord | <Yardanico> In reply to @jos "i have no clue": this looks like a compiler crash |
14:45:27 | FromDiscord | <Yardanico> how did you install nim? |
14:45:39 | FromDiscord | <Yardanico> if you want to get the compiler stack trace, you need to build the compiler in debug mode |
14:51:16 | FromDiscord | <jos> I used choosenim |
15:26:21 | FromDiscord | <qb> In reply to @qb "Is there something in": In case someone is looking for it https://play.nim-lang.org/#ix=49Og |
15:27:02 | FromDiscord | <qb> In reply to @qb "Is there something in": In case someone is looking for it https://play.nim-lang.org/#ix=49Oh |
15:28:05 | FromDiscord | <Prestige> Rip Wayland |
15:31:38 | FromDiscord | <Yardanico> In reply to @Avahe "Rip Wayland": it'll probably work with xwayland just fine, although not fully sure |
15:34:10 | FromDiscord | <Prestige> Hmm yeah |
15:38:48 | * | Guest64 joined #nim |
16:31:17 | FromDiscord | <federico3> if Nim had some vulnerability management like https://www.veracode.com/blog/managing-appsec/vulnerable-methods-under-hood it would be nice |
16:42:05 | FromDiscord | <dom96> seems like something that should be generalizable to all programming languages |
16:47:27 | * | jmdaemon joined #nim |
16:47:47 | FromDiscord | <federico3> indeed |
17:17:11 | FromDiscord | <@chronomatopoeia:matrix.org> Could someone please advise me on how to bridge from element.io to discord as this server has done? |
17:20:53 | FromDiscord | <chronomatopoeia> In reply to @@chronomatopoeia:matrix.org "Could someone please advise": So if you are chatting from element.io, it shows you as a bot? |
17:25:54 | FromDiscord | <Rika> yes |
17:32:35 | FromDiscord | <@chronomatopoeia:matrix.org> Do you know if it's possible to do voice chat and video between the two?↵(@Rika) |
17:34:18 | FromDiscord | <Rika> no |
17:34:21 | FromDiscord | <Rika> i do not |
17:34:35 | * | krux02 joined #nim |
17:39:47 | * | neceve joined #nim |
17:40:01 | FromDiscord | <liebebtc> Click on the link and thank me later 👉👉👉https://t.me/+6418gUGZ6qQ2YzE0 |
17:43:10 | FromDiscord | <that_dude> <@&371760044473319454> I think |
17:44:01 | FromDiscord | <that_dude> yeah, looks like it's more crypto stuff |
17:55:58 | * | derpydoo quit (Ping timeout: 240 seconds) |
18:08:28 | * | Guest64 quit (Quit: Client closed) |
18:08:40 | FromDiscord | <leorize> this is what we use\: https://t2bot.io/discord/ |
18:10:07 | * | derpydoo joined #nim |
18:46:36 | FromDiscord | <dom96> doubt it's possible |
18:55:21 | * | qwr quit (Quit: kernel upgrade) |
19:07:52 | FromDiscord | <jmgomez> Hey guys, does std symbols get compiled every time (just the nim part, not the c one) even though they are in the compiler sources? Im asking this because I have a lot of nim symbols and not sure if adding them to the compiler will speed things up |
19:11:21 | FromDiscord | <dom96> source code in compiler/: no. Source code in stdlib/ yes |
19:11:42 | FromDiscord | <dom96> (edit) "stdlib/" => "lib/" |
19:12:08 | * | neceve_ joined #nim |
19:12:36 | * | neceve_ quit (Client Quit) |
19:14:09 | * | neceve_ joined #nim |
19:14:26 | * | neceve quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:15:22 | * | neceve_ is now known as neceve |
19:19:47 | FromDiscord | <jmgomez> In reply to @dom96 "source code in compiler/:": So we want to improve the compilation times for NimForUE and we were wondering if we can add it to the compiler and compile it once, similar of how the "magic" thing is done. Do you think that will work? For the actual Cpp we are already using PCHs but files like the engine symbols are about 50k lines of nim code |
19:25:06 | * | krux02 quit (Remote host closed the connection) |
19:27:44 | FromDiscord | <Forest [She/Her]> Can i not have a proc accept an openarray or varargs? I'm getting an ambiguous call error |
19:56:01 | FromDiscord | <LOU> sent a code paste, see https://play.nim-lang.org/#ix=49Pa |
19:56:16 | FromDiscord | <LOU> and i'm new to nim and im wondering what the equivalent of this is |
20:12:38 | FromDiscord | <Bung> read threads manual,or check http beast source |
20:12:54 | FromDiscord | <Bung> (edit) "http beast" => "httpbeast" |
20:13:15 | FromDiscord | <huantian> We annoyingly don’t have built in thread pools |
20:14:08 | FromDiscord | <huantian> So there’s no easy built in way to concurrently perform tasks with a maximum concurrency |
20:15:37 | FromDiscord | <Bung> it's just number of threads |
20:17:25 | FromDiscord | <huantian> Yeah I haven’t found a similar interface to that, or to pythons async semaphore which does the same thing with async |
20:17:50 | FromDiscord | <huantian> I have tried just copying pythons async semaphore which might be the best way to go here |
20:18:49 | FromDiscord | <huantian> If there is tho please do lemme know cus I would like something like that too |
20:19:51 | FromDiscord | <mratsim> In reply to @huantian "So there’s no easy": You don't need threads to parse a website, it bottlenecked by IO unless you run machine learning algorithm on each |
20:20:09 | FromDiscord | <huantian> Yeah I don’t mean with threads |
20:20:29 | FromDiscord | <mratsim> (edit) "it" => "it's" |
20:20:50 | FromDiscord | <huantian> Not true threading (which pythons threadpool isn’t) but like async with a cap on concurrent requests |
20:21:27 | FromDiscord | <LOU> In reply to @huantian "Not true threading (which": Yeah that's basically what i had in mind plus executor.map just makes everything so easy in python |
20:22:04 | FromDiscord | <huantian> Yep it’s super ez on python |
20:22:23 | FromDiscord | <mratsim> In reply to @LOU "Yeah that's basically what": `for url in urls: await Foo()` |
20:22:32 | FromDiscord | <mratsim> (edit) "Foo()`" => "foo(url)`" |
20:22:34 | FromDiscord | <huantian> That’s not concurrent |
20:22:56 | FromDiscord | <mratsim> In reply to @huantian "That’s not concurrent": sure it is, if foo is async it's concurrent |
20:23:11 | FromDiscord | <huantian> You’d want `await all(urls.map(foo))` |
20:23:16 | FromDiscord | <mratsim> ah right |
20:23:25 | FromDiscord | <huantian> But you get the problem of how to limit concurrency |
20:23:27 | FromDiscord | <mratsim> yes my bad, don't await in the loop |
20:23:43 | FromDiscord | <huantian> Because sometimes you don’t want to send 2000 requests to a server at a time |
20:23:57 | FromDiscord | <LOU> Well i dont have to worry about hat in my situation because its all different hosts |
20:24:08 | FromDiscord | <LOU> anyway thanks for the help guys |
20:24:19 | FromDiscord | <mratsim> it's best to use a rate-limiting library in that case |
20:24:40 | FromDiscord | <huantian> Huh didn’t think of that |
20:24:47 | FromDiscord | <huantian> Is there one for Nim httpclient? |
20:24:57 | FromDiscord | <mratsim> https://github.com/status-im/nim-chronos/blob/78cdf967a354adee5b9a4a01ea1543de7d77bde3/chronos/ratelimit.nim |
20:25:10 | FromDiscord | <Bung> In reply to @huantian "I have tried just": https://github.com/disruptek has some projects related to that |
20:25:22 | FromDiscord | <mratsim> https://intronetworks.cs.luc.edu/current/html/tokenbucket.html#token-bucket-definition |
20:34:08 | * | qwr joined #nim |
21:19:35 | FromDiscord | <jos> is there a guide to using ORC correctly with nim? |
21:20:03 | FromDiscord | <Elegantbeef> It |
21:20:03 | FromDiscord | <jos> a codebase that uses ORC correctly should use move semantics + the acyclic annotation + what else? |
21:20:07 | FromDiscord | <Elegantbeef> 's pretty much just write Nim |
21:20:32 | FromDiscord | <jos> i wanna do it with all the bits and bobs though |
21:20:34 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/destructors.html is the best material on what it gives you 😄 |
21:20:48 | FromDiscord | <Elegantbeef> A lot of the bits and bobs are inferred |
21:21:13 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/destructors.html#sink-parameter-inference though this isnt on by default |
21:22:14 | FromDiscord | <jos> mmk |
21:22:18 | FromDiscord | <jos> i will just let it rip then |
21:22:22 | FromDiscord | <jos> ty |
21:24:04 | FromDiscord | <Elegantbeef> There is also https://nim-lang.org/docs/destructors.html#the-dotcursor-annotation i guess |
21:36:40 | FromDiscord | <jos> is nim.cfg supposed to work with nimble? i can't get the --mm:orc flag passed in |
21:37:53 | FromDiscord | <jos> well if i put an invalid value for --mm it complains about that |
21:38:16 | FromDiscord | <jos> but if i use --verbose the command nimble uses to build is: |
21:38:21 | FromDiscord | <jos> `/Users/jos/.nimble/bin/nim c --colors:on --noNimblePath -d:NimblePkgVersion=0.1.0 --path:/Users/jos/.nimble/pkgs/patty-0.3.4 -o:/Users/jos/tfp/labs/crag/bin/crag /Users/jos/tfp/labs/crag/src/crag.nim` |
21:38:28 | FromDiscord | <jos> and i don't see any mention |
21:38:36 | FromDiscord | <jos> (edit) "and i don't see any mention ... " added "of the mm flag" |
21:39:11 | FromDiscord | <jos> ooo is orc the default now? |
21:41:48 | FromDiscord | <Elegantbeef> It's default soon maybe it is on devel dont recall |
21:42:02 | FromDiscord | <jos> weird, i don't really know why |
21:42:13 | FromDiscord | <jos> it doesn't show it in the output |
21:42:24 | FromDiscord | <jos> but it does seem to know it's orc |
21:42:30 | FromDiscord | <jos> says `Hint: gc: orc; opt: none (DEBUG BUILD, `-d:release` generates faster code)` |
21:44:01 | FromDiscord | <EyeCon> I also didn't really understand how I can make nimble add a flag to the build commands |
21:44:41 | FromDiscord | <jos> i think you use nim.cfg and then the nim program itself picks up nim.cfg |
21:45:01 | FromDiscord | <jos> i don't think nimble ever really knows anything about nim.cfg, so i guess it doesn't add it to the args for the nim invocation |
21:45:16 | FromDiscord | <jos> idk, i guess it works |
21:58:26 | FromDiscord | <jos> are there any large nim programs that would be suitable for benchmarking orc vs refc? |
21:58:59 | FromDiscord | <jos> like i just want to see the diff in normal use between a few different types of programs |
21:59:17 | FromDiscord | <jos> is there a big list of cool nim programs aha |
22:02:00 | FromDiscord | <Patitotective> In reply to @EyeCon "I also didn't really": create a `buildd` task :p |
22:02:25 | FromDiscord | <Bung> In reply to @jos "like i just want": I think nim important libs in CI already taken care of that |
22:04:15 | FromDiscord | <jos> the paper referenced by the devs in the orc article has some pretty serious overhead from |
22:04:24 | FromDiscord | <jos> their orc implementation in a lot of benchmarks |
22:04:45 | FromDiscord | <jos> but i think that might be because it's just a drop-in replacement for java's GC, and in practice with a codebase using ownership semantics and not the java stdlib, the overhead would be much less |
22:04:53 | FromDiscord | <jos> but i'm not sure how to test this |
22:06:06 | FromDiscord | <jos> maybe i can hack together a torture test and just check myself |
22:08:22 | FromDiscord | <Bung> well, most important libs also do test on orc , but not benchmark |
22:09:33 | FromDiscord | <jos> ye im trying to make a lang and i like the idea of orc |
22:09:56 | FromDiscord | <jos> but i'm not confident that it's fast enough so i'm trying to look at existing implementations of the paper and see what's up |
22:10:29 | FromDiscord | <EyeCon> In reply to @Patitotective "create a `buildd` task": That's an option for sure |
22:11:51 | FromDiscord | <Patitotective> In reply to @jos "ye im trying to": why yet another? |
22:12:15 | FromDiscord | <Generic> Java has indeed a much harder time with something like orc |
22:12:47 | FromDiscord | <Generic> because in Nim most ref objects can be identified by the compiler to be acyclic |
22:13:05 | FromDiscord | <Generic> while in Java every object is by default extendable |
22:13:08 | FromDiscord | <Yardanico> In reply to @Generic "because in Nim most": the compiler doesn't do this right now though (as far as I know, I might be wrong) ;) |
22:13:17 | FromDiscord | <Yardanico> that's why in Araq's talk he talked about `acyclic` pragma |
22:13:23 | FromDiscord | <Yardanico> so you regain performance lost when going from ARC to ORC |
22:13:53 | FromDiscord | <Generic> oh really I thought it was only necessary for types which could be acyclic |
22:14:06 | FromDiscord | <Generic> but you gurantee that you never build cycles with it |
22:14:17 | FromDiscord | <Yardanico> In reply to @Generic "but you gurantee that": yes, so then ORC won't scan those ref objects for cycles |
22:14:23 | FromDiscord | <Yardanico> that's the only purpose of acyclic AFAIK |
22:16:59 | FromDiscord | <jos> how can the lang know which are acyclic? unless you just mean by type |
22:17:18 | FromDiscord | <jos> like if Node refs other Nodes, it obviously may be cyclic |
22:17:36 | FromDiscord | <jos> why isn't that possible in java's gc? |
22:18:04 | FromDiscord | <thomas20> Thank me later https://t.me/+FE01vMtarjEwOWM0 |
22:19:28 | FromDiscord | <Yardanico> In reply to @jos "how can the lang": i mean technically it could analyse the whole program and determine if there's an assignment to a field of some type (e.g. `Node`) to the field of a variable of the same type |
22:19:34 | FromDiscord | <Yardanico> but I don't know how complex that would be |
22:19:58 | FromDiscord | <jos> i don't think finding the assignment is even necessary |
22:20:02 | FromDiscord | <Generic> yeah |
22:20:11 | FromDiscord | <jos> but java is statically typed so i figure they could probably do the same optimization |
22:20:20 | FromDiscord | <Generic> the issue is inheritance |
22:21:23 | FromDiscord | <Generic> because every type which can be inherited, an inheriting type could add a field which could create a cycle |
22:22:38 | FromDiscord | <Generic> but if a type solely consists of non inheritable types it could be completely statically checked that if it recursively doesn't contain a reference to this exact type it's definitely acyclic |
22:22:56 | FromDiscord | <Generic> and in Nim where types aren't inheritable by default that's probably not even that rare |
22:23:13 | FromDiscord | <Elegantbeef> I think it'd be nice to have a `-d:ensureAcyclic` which would at runtime ensure the graph is never cyclical |
22:23:29 | FromDiscord | <thomas20> Thank me later https://t.me/+FE01vMtarjEwOWM0 |
22:23:39 | FromDiscord | <Elegantbeef> I dont think i will |
22:23:59 | FromDiscord | <Generic> while in Java you need to mark classes as final to be uninheritable, which isn't done is extensively as it should be |
22:24:21 | FromDiscord | <Generic> In reply to @Elegantbeef "I think it'd be": that's another story, though I'd appreciate something like this too |
22:24:30 | FromDiscord | <jos> that's something i wanna add for my lang |
22:24:44 | FromDiscord | <Generic> adieu spammer |
22:25:01 | FromDiscord | <jos> the uhh |
22:25:55 | FromDiscord | <jos> i was thinking that having non-cycle tolerant refcounting ala swift + a cycle detector in debug mode |
22:26:11 | FromDiscord | <jos> might be good enough |
22:26:43 | FromDiscord | <Elegantbeef> Yea pretty much what quite a few want just to ensure one can use ARC with their code |
22:26:59 | FromDiscord | <Elegantbeef> Orc is nice and all but if you dont need it it's better |
22:27:06 | FromDiscord | <Generic> I actually quite liked the original newruntime |
22:27:12 | FromDiscord | <Yardanico> yeah, it was already proposed by treeform on the forum, and maybe even on github |
22:27:14 | FromDiscord | <Generic> with the owned types |
22:27:24 | FromDiscord | <Yardanico> the ensureAcyclic switch/define/whatever |
22:28:09 | FromDiscord | <Elegantbeef> Yea i was talking about it with him |
23:05:57 | FromDiscord | <Datavenia> How is the user experience for the JS backend, and can one have a reasonably comfortable FP experience in Nim? |
23:10:26 | FromDiscord | <Elegantbeef> You can do fp like things but due to how Nim's iterators work things like chained filter/map/... are slower than just doing it imperatively |
23:11:32 | FromDiscord | <Elegantbeef> Slower due to multiple allocations |
23:11:57 | FromDiscord | <B L Â D É> Guys how do object variance with case of work under the hood |
23:12:05 | FromDiscord | <B L Â D É> And what are the alternatives |
23:12:12 | FromDiscord | <Bung> kinda subjective, not tied to js backend, that's how you feel coding in nim and its libs |
23:12:51 | FromDiscord | <Elegantbeef> They're just tagged union↵(@B L Â D É) |
23:12:52 | FromDiscord | <Elegantbeef> unions\ |
23:13:13 | FromDiscord | <Elegantbeef> There really arent alternatives to tagged unions, there is just sugar on top |
23:13:49 | FromDiscord | <Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#coding-how-to-store-different-types-in-seqqmark is a good referencehere |
23:16:08 | FromDiscord | <B L Â D É> Thank u |
23:18:39 | FromDiscord | <Datavenia> In reply to @Bung "kinda subjective, not tied": But like is the experience of doing a website in Nim okay? |
23:18:59 | FromDiscord | <Datavenia> In reply to @Elegantbeef "You can do fp": Gotcha, could you do it lazily? |
23:19:17 | FromDiscord | <Bung> checkout karax see how you feel it |
23:20:54 | FromDiscord | <Elegantbeef> The issue is mostly that `a.map(someProc).filter(someProc)...` allocates a new sequence per each `map` and `filter` call due to how it works↵(@Datavenia) |
23:21:59 | FromDiscord | <Elegantbeef> Nim does have for loop macros so one can make a iterator macro that does it imperatively without any extra allocations https://github.com/beef331/slicerator/blob/master/tests/tchain.nim#L8 for reference |
23:22:53 | FromDiscord | <Datavenia> Oh interesting, thank you. |
23:23:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=49PB |
23:23:39 | FromDiscord | <Elegantbeef> https://github.com/zero-functional/zero-functional#zero-functional also does exist |
23:25:11 | FromDiscord | <Datavenia> Like do folks use Nim all that much for the js backend? |
23:27:58 | FromDiscord | <geekrelief> Hey Elegantbeef, I'm generating a ton of nim coding for the NimForUE bindings, and Juan and I were discussing potential crazy solutions to fix the compile times. Since we have no idea when IC is going to come out, we were thinking about compiling in the nimforue bindings directly into the nim compiler somehow. Do you think that's a viable route? |
23:28:20 | FromDiscord | <geekrelief> (edit) "coding" => "code" |
23:29:44 | FromDiscord | <Yardanico> In reply to @geekrelief "Hey Elegantbeef, I'm generating": does most of the code stay the same? then you can just create a separate binary that runs the macros at compile-time and saves the resulting Nim code to a file which then your library uses |
23:29:50 | FromDiscord | <Yardanico> and add some basic caching and stuff |
23:29:53 | FromDiscord | <Elegantbeef> It'd require a ton of Nim compiler magic, so much so i doubt it'd be worth it↵(@geekrelief) |
23:30:12 | FromDiscord | <Elegantbeef> Plus maintaining a forked compiler is a alot of work |
23:30:13 | FromDiscord | <geekrelief> In reply to @Yardanico "does most of the": Yeah once the bindings are generated they'll stay the same until there's a new Unreal engine release |
23:30:18 | FromDiscord | <Yardanico> yeah then you can just do that |
23:30:29 | FromDiscord | <Elegantbeef> Look at how futhark does it |
23:31:26 | FromDiscord | <geekrelief> @Yardanico yeah we're essentially generating the bindings once already.. |
23:31:34 | FromDiscord | <geekrelief> (edit) removed "essentially" |
23:31:50 | FromDiscord | <geekrelief> @ElegantBeef basically we're doing what futhark is doing |
23:31:54 | FromDiscord | <Yardanico> huh, weird |
23:32:01 | FromDiscord | <geekrelief> but the binding code is a lot |
23:32:01 | FromDiscord | <Yardanico> the thing is that with macros the compiler still has to rerun them on every compilation |
23:32:13 | FromDiscord | <Yardanico> but if you output their result to a file then the compiler doesn't need to rerun them, it just has the resulting code |
23:34:08 | FromDiscord | <geekrelief> ok yeah we can try running that through a macro preprocessing step, but that part of the code only takes 5 secs to compile. but once we include the unreal bindings there are no macros and that's like 10s of thousands of lines of nim code. |
23:34:37 | FromDiscord | <geekrelief> for instance we have 1 file that's 50K lines of nim bindings |
23:34:49 | FromDiscord | <Yardanico> yeah I don't know of anything that can help fix long compile-times if it's just plain Nim code |
23:35:06 | FromDiscord | <geekrelief> yeah, we're looking for out of the box ideas to reduce compile times |
23:35:06 | FromDiscord | <Elegantbeef> A faster compiler or IC is the only solution 😄 |
23:35:20 | FromDiscord | <Elegantbeef> Rewrite the compiler to use DOD, how hard could it be! |
23:35:23 | FromDiscord | <geekrelief> ok yeah.. I was tell Juan IC is our fix, but... |
23:35:28 | FromDiscord | <geekrelief> who knows when that'll come |
23:35:35 | FromDiscord | <Yardanico> I mean you can at least build the compiler in full danger mode with LTO (and potentially PGO) applied and specifically profiled for your bindings, but it won't bring that much and is just a bandaid |
23:35:56 | FromDiscord | <Yardanico> In reply to @geekrelief "who knows when that'll": also what nim versions did you test on? |
23:36:01 | FromDiscord | <geekrelief> we're on devel |
23:36:09 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:36:10 | FromDiscord | <geekrelief> maybe a couple weeks old |
23:36:10 | FromDiscord | <Yardanico> and yeah, arc/orc compilation is generally slower than with refc because of all the additional analysis the compiler has to do |
23:36:36 | FromDiscord | <Yardanico> but I know you can't really use refc in nimforue (and I don't advise to) |
23:37:20 | FromDiscord | <geekrelief> alright, so wait for IC or hmm.. do you think nimscripter or doing something with the vm could help? |
23:37:57 | FromDiscord | <Elegantbeef> Im mean you could use a plugin system for the internal code but that's layers of abstractions stacked |
23:38:27 | FromDiscord | <Yardanico> In reply to @geekrelief "alright, so wait for": well if you used the VM it'd be the same as using macros, and if you have macros nim still has to analyze the code generated by macros, so it'll only make compile times longer |
23:38:59 | FromDiscord | <Yardanico> is there some way to easily run the binding compilation to check how long it takes? |
23:39:15 | FromDiscord | <Yardanico> i would maybe check where the time is spent (although that'll probably just be arc/orc analysis code) |
23:39:16 | FromDiscord | <geekrelief> In reply to @Yardanico "well if you used": I'm suggesting that we trying to create a vm with the nimforue bindings bridged somehow, so we'd code in nimscript |
23:39:30 | FromDiscord | <Yardanico> oh, but won't that defeat the whole purpose of the bindings? |
23:39:40 | FromDiscord | <Yardanico> you'll have the speed of the Nim VM instead of the compiled Nim, and the VM isn't really that fast |
23:39:46 | FromDiscord | <Yardanico> it'll be like using Python for Unreal Engine |
23:40:33 | FromDiscord | <geekrelief> In reply to @Yardanico "it'll be like using": right, it's not the same as using the bindings directly |
23:40:58 | FromDiscord | <Yardanico> In reply to @Yardanico "is there some way": ^ping |
23:41:37 | FromDiscord | <geekrelief> In reply to @Yardanico "^ping": yeah we're still checking how long it takes, juan has to go it's past midnight, but our file is like 50K lines right now |
23:42:14 | FromDiscord | <Yardanico> I mean i wanted to check myself maybe :) if it's not hard to do right now |
23:42:57 | FromDiscord | <geekrelief> oh ok, it's not in a good state. There's quite a bit of setup |
23:43:08 | FromDiscord | <geekrelief> but maybe next week? |
23:43:08 | FromDiscord | <Datavenia> What’s IC? |
23:43:13 | FromDiscord | <Yardanico> In reply to @Datavenia "What’s IC?": incremental compilation |
23:43:15 | FromDiscord | <Elegantbeef> incremental compilation |
23:43:20 | FromDiscord | <geekrelief> incremental compilation |
23:43:26 | FromDiscord | <Yardanico> In reply to @Elegantbeef "incremental compilation": a bot replied slower than a human! |
23:43:27 | FromDiscord | <Elegantbeef> compilation that's incremental |
23:43:32 | FromDiscord | <Yardanico> are you coded in Python or something?! |
23:43:34 | FromDiscord | <EyeCon> Incremental compilation |
23:43:38 | FromDiscord | <Elegantbeef> No go↵(@Yardanico) |
23:43:40 | FromDiscord | <geekrelief> araq's nightmare |
23:43:45 | FromDiscord | <geekrelief> i don't know |
23:43:53 | FromDiscord | <geekrelief> we've been waiting years for it? |
23:43:58 | FromDiscord | <geekrelief> 😄 |
23:44:44 | FromDiscord | <Elegantbeef> Given https://github.com/nim-lang/Nim/projects/1 you'd think it was 99% done |
23:45:05 | FromDiscord | <Datavenia> Hrm IC and an LLVM backend? :p |
23:45:12 | FromDiscord | <Elegantbeef> Nlvm already exists |
23:45:18 | FromDiscord | <Elegantbeef> LLVM isnt all that important though |
23:47:05 | FromDiscord | <Datavenia> How come? |
23:47:40 | FromDiscord | <Elegantbeef> It makes it much harder to do embedded for one |
23:48:05 | FromDiscord | <geekrelief> would C/C++/JS interop even be anything with llvm? |
23:48:16 | FromDiscord | <Elegantbeef> Yes but it'd all be `importc` only |
23:48:26 | FromDiscord | <Elegantbeef> You could not `compile` or `emit` or anything else like that |
23:48:33 | FromDiscord | <geekrelief> ok |
23:48:39 | FromDiscord | <Elegantbeef> You're only capable of linking symbols |
23:49:10 | FromDiscord | <geekrelief> so what's the advantage of it? |
23:49:28 | FromDiscord | <Elegantbeef> You get all the targets llvm supports |
23:49:32 | FromDiscord | <Elegantbeef> All the optimisations it has |
23:50:23 | FromDiscord | <geekrelief> I wonder how much better is clang vs msvc then. |
23:50:36 | FromDiscord | <Elegantbeef> If you get a cross platform linker like Zig you get a ton of easy targets 😄 |
23:50:56 | FromDiscord | <geekrelief> yeah that would be super cool |
23:51:25 | FromDiscord | <Elegantbeef> Zig and Rust both want a C backend though cause it does open doors |
23:51:48 | FromDiscord | <Elegantbeef> It's much much easier to use a language in a preexisting workflow when you can just poop it out and go to town |
23:52:06 | FromDiscord | <Elegantbeef> Like girvo uses Nim soley due to the fact it's nicer than C/C++ and it uses C as it's target |
23:52:24 | FromDiscord | <Elegantbeef> It allows them to use their whole build pipeline without any tremendous work |
23:52:43 | FromDiscord | <geekrelief> I'm not familiar with girvo is that a project / company? |
23:52:51 | FromDiscord | <Elegantbeef> That's a person |
23:52:53 | FromDiscord | <Elegantbeef> 😄 |
23:52:57 | FromDiscord | <geekrelief> lol |
23:52:59 | FromDiscord | <Yardanico> https://github.com/girvo i assume |
23:53:01 | FromDiscord | <Elegantbeef> @Girvo\: are you a project/company?! |
23:53:25 | FromDiscord | <Elegantbeef> Just ousted that aussie bastard! |
23:54:12 | FromDiscord | <Elegantbeef> He used to be into nim years ago but recently came back for rewritting the software for his work's embedded hardware |
23:55:00 | FromDiscord | <geekrelief> cool, glad to hear people coming back to nim after leaving |
23:55:06 | FromDiscord | <Elegantbeef> If it wasnt for Nim he'd be writing it in C/C++ and crying |
23:55:11 | FromDiscord | <Elegantbeef> The nice part about a llvm compiler though is that you can just say "Make me a wasm binary" and poof you get one |
23:55:24 | FromDiscord | <Elegantbeef> Since llvm has a wasm backend |
23:55:48 | FromDiscord | <geekrelief> is arne still working on it? |
23:56:00 | FromDiscord | <Elegantbeef> He does when he gets the time |
23:56:05 | FromDiscord | <Elegantbeef> I know he updated the readme when i bitched |
23:56:10 | FromDiscord | <Elegantbeef> But it's on 1.6 now |
23:57:09 | FromDiscord | <geekrelief> alright, thanks for the chat beef. going to catch up on some sleep. take care! |
23:57:23 | FromDiscord | <Elegantbeef> Buh bye, sorry i couldnt give you the magical speed switch 😛 |
23:58:32 | FromDiscord | <geekrelief> no worries, @Yardanico both of you at least helped confirm my options |