00:02:51 | * | auxym quit (Ping timeout: 276 seconds) |
00:04:07 | * | Oddmonger quit (Ping timeout: 265 seconds) |
00:20:06 | * | vicfred joined #nim |
00:24:58 | FromDiscord | <theangryepicbanana> pretty sure I just killed the typechecker https://media.discordapp.net/attachments/371759389889003532/872998647976046652/unknown.png |
00:41:47 | mst | theangryepicbanana: http://trout.me.uk/foom2.jpg |
00:42:05 | FromDiscord | <theangryepicbanana> yeah pretty fun |
00:42:36 | FromDiscord | <theangryepicbanana> also just found out that implicit generics work just fine here, not sure why |
00:45:53 | mst | I have no idea but I sympathise with "bending software until it breaks" cos I do it all the time so the least I could do was provide a cute kitty to look at while you curse :D |
00:46:14 | FromDiscord | <theangryepicbanana> I appreciate the kitty :) |
00:46:53 | FromDiscord | <theangryepicbanana> this is now day 7 of arguing with nim's type checker |
01:13:30 | * | auxym joined #nim |
01:23:17 | * | neurocyte0 joined #nim |
01:23:18 | * | neurocyte0 quit (Changing host) |
01:23:18 | * | neurocyte0 joined #nim |
01:25:50 | FromDiscord | <undersquire> In reply to @theangryepicbanana "pretty sure I just": Lol |
01:26:24 | FromDiscord | <undersquire> It broke cause u need to use <T> not <T> |
01:26:45 | FromDiscord | <theangryepicbanana> In reply to @undersquire "It broke cause u": obv |
01:26:56 | * | neurocyte quit (Ping timeout: 258 seconds) |
01:26:57 | * | neurocyte0 is now known as neurocyte |
01:27:03 | FromDiscord | <undersquire> Simple mistake 😉 |
01:43:47 | * | arkurious quit (Quit: Leaving) |
01:53:54 | * | krux02 quit (Remote host closed the connection) |
02:04:53 | * | auxym quit (Ping timeout: 258 seconds) |
02:05:16 | * | redj quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
02:06:08 | * | redj joined #nim |
02:14:38 | * | redj quit (Read error: Connection reset by peer) |
02:14:56 | * | redj joined #nim |
02:39:02 | * | tiorock joined #nim |
02:39:03 | * | tiorock quit (Changing host) |
02:39:03 | * | tiorock joined #nim |
02:39:03 | * | rockcavera quit (Killed (zirconium.libera.chat (Nickname regained by services))) |
02:39:03 | * | tiorock is now known as rockcavera |
03:04:36 | * | tiorock joined #nim |
03:04:36 | * | tiorock quit (Changing host) |
03:04:36 | * | tiorock joined #nim |
03:04:36 | * | rockcavera is now known as Guest8834 |
03:04:36 | * | Guest8834 quit (Killed (platinum.libera.chat (Nickname regained by services))) |
03:04:36 | * | tiorock is now known as rockcavera |
03:07:10 | FromDiscord | <Alea> Why does nim only have bitwise operators and not logical ones? Isn't bitwise slower when you just need a circuit breaker in your logic? |
03:07:46 | FromDiscord | <undersquire> logical ones as in like `break` ? |
03:07:53 | FromDiscord | <undersquire> (edit) "logical ones as in like `break` ... ?" added "and `continue`" |
03:07:53 | FromDiscord | <Alea> No like && vs & |
03:07:56 | FromDiscord | <undersquire> oh |
03:08:02 | FromDiscord | <undersquire> i think it does |
03:08:24 | FromDiscord | <Alea> It seems like and, or, etc. Do bitwise |
03:08:31 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3v7A |
03:08:48 | FromDiscord | <Elegantbeef> `and` is bitwise with ints, and boolean with bools |
03:08:49 | FromDiscord | <Elegantbeef> if you want a concise different op `import std/bitops` |
03:09:35 | FromDiscord | <Alea> So False or True or False or ... Would cut off early? |
03:10:11 | FromDiscord | <undersquire> yeah |
03:10:25 | FromDiscord | <undersquire> False or True (this is true so it should end here) |
03:10:47 | FromDiscord | <undersquire> @ElegantBeef what is your take on this? https://forum.nim-lang.org/t/8301 |
03:10:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3v7C |
03:10:55 | FromDiscord | <Elegantbeef> This is testable pretty easily 😀 |
03:11:01 | FromDiscord | <undersquire> personally i think its a cool idea to make the language a bit more consistent |
03:11:36 | FromDiscord | <Elegantbeef> I dont see the point proc definitions can get long so you'd have to scroll up to see if you're in a proc def, macro, template, or func |
03:11:59 | FromDiscord | <Elegantbeef> It also would have another indent level eaten for no reason but "consistency" |
03:12:03 | FromDiscord | <undersquire> oh true |
03:12:22 | FromDiscord | <undersquire> i forgot it could also be template, func etf |
03:12:25 | FromDiscord | <undersquire> (edit) "etf" => "etc" |
03:12:36 | FromDiscord | <undersquire> and yeah it would use another indentation level |
03:12:56 | FromDiscord | <Alea> In reply to @Elegantbeef "This is testable pretty": It came up during bed time reading and it was going to eat at me 😂 |
03:13:05 | FromDiscord | <Alea> No comp to test on |
03:13:13 | FromDiscord | <Alea> Although playground to be fair |
03:13:29 | FromDiscord | <Elegantbeef> Ok well alea it doesnt call echo |
03:13:29 | FromDiscord | <Elegantbeef> Plus pragmas get more confusion |
03:13:30 | FromDiscord | <Elegantbeef> Plus pragmas get more confusing |
03:15:43 | FromDiscord | <Elegantbeef> And personally i only use var/const/let sections, so it's not overly consistent to me |
03:18:20 | FromDiscord | <Elegantbeef> I'd rather have the abillity to use `closure` `cdecl` `noconv` and similar to declare a procedure to get rid of the constant pragma usage 😛 |
03:19:34 | FromDiscord | <Elegantbeef> Would also make the type mismatch easier to spot |
03:35:26 | FromDiscord | <gogolxdong (liuxiaodong)> Is there any RELIC library in Nim? https://github.com/relic-toolkit/relic |
03:35:29 | nrds | <R2D299> itHub: 7"Code" |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:33 | * | supakeen joined #nim |
04:31:07 | * | thunder joined #nim |
04:45:07 | * | rockcavera quit (Remote host closed the connection) |
05:04:27 | FromDiscord | <Rika> In reply to @exelotl "there's no solution for": The bots can’t scrape if the validation channel is locked to them (unverified users) and admins and only them and admins |
05:40:07 | FromDiscord | <bolino> Hi, I have an issue with db_mysql. |
05:40:26 | FromDiscord | <bolino> Hi, I have an issue with db_mysql |
05:45:41 | * | thunder quit (Ping timeout: 258 seconds) |
05:46:00 | FromDiscord | <bolino> sent a long message, see http://ix.io/3v7Y |
05:46:20 | FromDiscord | <bolino> (edit) "http://ix.io/3v7Y" => "http://ix.io/3v7Z" |
05:47:44 | FromDiscord | <Elegantbeef> is `?` a special character in sql? |
05:51:06 | FromDiscord | <bolino> In reply to @Elegantbeef "is `?` a special": Yes, it's used for parameter substitution, but when it's alone, not when in a string. I tried to escape it with \, but it fails. Never had this issue in native SQL or any other language. I'm afraid the Nim library just parse for ? to interprete it as parameter substitution instead of treating the full string first. |
05:51:22 | FromDiscord | <bolino> (edit) "\," => ""\"," |
05:51:32 | FromDiscord | <bolino> (edit) ""\"," => ""`\`"," |
05:51:43 | FromDiscord | <bolino> (edit) "?" => "`?`" |
06:00:16 | FromDiscord | <Elegantbeef> I'd check the source for the procedure and see if there is anything odd |
06:37:23 | FromDiscord | <mratsim> In reply to @gogolxdong (liuxiaodong) "Is there any RELIC": I looked into relic before choosing a crypto library but it requires generating custom C code for the exact primitives you need.↵↵I might have something ready to use depending on what you want, so what do you need from there? |
06:39:09 | * | max22- joined #nim |
07:34:52 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
07:39:06 | * | neurocyte joined #nim |
07:39:06 | * | neurocyte quit (Changing host) |
07:39:06 | * | neurocyte joined #nim |
07:44:38 | arkanoid | I'm trying hard to grok what the "mangle" option of c2nim does |
07:45:08 | arkanoid | mangle "_" "p" replaces ALL names with just ppppppppppppppppppppppppp |
07:45:37 | arkanoid | mangle "{.*}__{.*}" "$1_p_$2" seemns to work for replacing __ with _ |
07:46:17 | arkanoid | but this: mangle "_{.*}" "p_$1" and this: mangle "{.*}_" "$1_p" does NOT replace heading and trailing underscores |
07:46:45 | arkanoid | manual says that they follow PEG syntax, but it doesn't seems https://www.gnu.org/software/guile/manual/html_node/PEG-Syntax-Reference.html |
07:54:18 | FromDiscord | <haxscramper> I'm pretty sure it does https://github.com/nim-lang/c2nim/blob/0557f1e2a86b2a9e99acd23ebc41cfa7dcdfc76b/mangler.nim#L65 |
07:54:36 | FromDiscord | <haxscramper> You can try `std/peg` as a standalone |
07:55:51 | * | neceve joined #nim |
08:46:13 | * | maxime_ joined #nim |
08:47:57 | * | max22- quit (Ping timeout: 268 seconds) |
08:55:15 | FromDiscord | <dain> really basic question I have: |
08:55:40 | FromDiscord | <Elegantbeef> Real basic answer might suffice |
08:55:58 | FromDiscord | <dain> nim encourages unqualified imports. when reading such a module, how do you figure out where each function comes from |
08:56:18 | FromDiscord | <dain> im used to python where you can always tell by the prefix |
08:56:29 | FromDiscord | <Elegantbeef> Tooling + imports |
08:58:43 | FromDiscord | <Elegantbeef> And if you dont have tooling, is it really a concern to know which module X comes from, since you know you're probably not able to compile the code 😀 |
09:02:15 | FromDiscord | <dain> what tools tells you where the functions come from |
09:02:42 | FromDiscord | <Elegantbeef> The vscode extension has it listed in hovering |
09:02:55 | FromDiscord | <Elegantbeef> Goto definition also does |
09:11:11 | FromDiscord | <Rika> The more you use a language the easier it becomes to tell where something comes from hahaha |
09:11:23 | FromDiscord | <Rika> Basically memory |
09:11:41 | FromDiscord | <Rika> And if you don’t know then tooling as said above |
09:11:56 | FromDiscord | <Rika> And then there’s also intuition lol |
09:12:37 | FromDiscord | <Elegantbeef> Yea it doesnt really matter where a symbol comes from assuming no overlap and you import just what you need |
09:12:43 | FromDiscord | <Elegantbeef> The compiler does tell you when you have unused modules |
09:13:21 | FromDiscord | <Elegantbeef> If you're wanting to see all the symbols the stdlib has you may consider looking at and searching here https://nim-lang.org/docs/theindex.html |
09:15:45 | FromDiscord | <Rika> Of course, you can have tooling import via “from import” too |
09:15:56 | FromDiscord | <Rika> Don’t ask me how to set that up though, I do not know |
09:16:31 | FromDiscord | <Rika> In reply to @Rika "Of course, you can": Notably nvim-compe can do this with configuration |
09:16:40 | FromDiscord | <haxscramper> https://narimiran.github.io/2019/07/01/nim-import.html |
09:17:00 | * | beshr quit (Ping timeout: 272 seconds) |
09:30:16 | FromDiscord | <dain> oh ya I knew that the compiler could figure it out, was just wondering how I would |
09:30:19 | FromDiscord | <dain> thanks :) |
09:40:31 | FromDiscord | <Rika> It’s usually obvious due to types and function names |
10:54:34 | arkanoid | I really don't get peg syntax |
10:55:50 | emery | we'd have nim on plan9 if it wasn't for {.align.} |
10:58:55 | arkanoid | this plan9? https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs |
10:59:38 | emery | yep |
11:00:08 | emery | the native C compiler is only C99 |
11:00:30 | arkanoid | this never fell under my radar in last 20 years. I've been living on the moon probably. Cool project! |
11:01:35 | emery | well, plan9 hasn't been used much in the last 20 years |
11:02:23 | FromDiscord | <haxscramper> What is wrong with .align. |
11:03:04 | emery | older compilers don't have any guarantess on aligning stuff |
11:03:35 | FromDiscord | <haxscramper> Ah, I just thought it somehow completely prevents use on plan9. |
11:04:09 | FromDiscord | <haxscramper> So you technically can use it, but not all features are available |
11:04:44 | emery | it does, you don't see align very much, but its used in the GC, so stuff works until things are freed |
11:38:05 | FromDiscord | <enthus1ast> i'm fighting with staticRead, i've build a template engine which compiles everything on compile time. my "compileTemplateFile" functions accepts a static string to a path. But staticRead behaviour is not want i want, it is relative to the imported modules path. It also not accepts absolute dirs. Any idea how to solve this? |
11:41:15 | FromDiscord | <Rika> make your compileTemplateFile take in a static string with the contents of the file instead of a path |
11:41:17 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3v8X |
11:41:25 | FromDiscord | <Rika> and just tell the user to use staticstring(path) or so |
11:41:42 | FromDiscord | <enthus1ast> yes that can work for not extended templates |
11:41:50 | FromDiscord | <enthus1ast> but for extended templates it will not \:/ |
11:42:00 | FromDiscord | <Rika> i have no idea what extended templates are |
11:42:15 | FromDiscord | <enthus1ast> an index.html can extend a master.html |
11:42:31 | FromDiscord | <enthus1ast> and have the whole boiler plate from master around its code blocks |
11:43:06 | FromDiscord | <Rika> i dont know how to help then sorry |
11:43:42 | FromDiscord | <enthus1ast> sent a code paste, see https://paste.rs/IOn |
11:44:11 | FromDiscord | <enthus1ast> wow that code block is broken, sorry |
11:46:04 | FromDiscord | <Rika> i dont know how "broken" looks |
11:46:07 | FromDiscord | <Rika> it looks fine in discord |
11:46:26 | FromDiscord | <enthus1ast> ok in matrix it is broken ... |
11:47:31 | FromDiscord | <enthus1ast> the problem is that the {% extends master.nwt %} internally must call staticRead to read the master template, and this is relative to my parser |
11:51:01 | FromDiscord | <enthus1ast> which basically is a showstopper 😥 |
11:54:11 | * | maxime_ quit (Ping timeout: 268 seconds) |
11:54:21 | FromDiscord | <Rika> windows or linux |
11:54:29 | FromDiscord | <enthus1ast> currently windows |
11:54:51 | FromDiscord | <enthus1ast> but it must run everywhere (i consider it to run even in the browser) |
11:54:59 | FromDiscord | <enthus1ast> but then it is of course another logic |
11:55:28 | FromDiscord | <Rika> heres the code to staticread https://github.com/nim-lang/Nim/blob/devel/compiler/vmdeps.nim#L13 |
11:56:05 | FromDiscord | <enthus1ast> yes |
11:58:17 | FromDiscord | <enthus1ast> mh |
11:59:06 | FromDiscord | <enthus1ast> i think now it works. Thank you Rika. I'm a little dizzy already, to much coding. |
11:59:15 | FromDiscord | <Rika> what did you do lol |
11:59:22 | FromDiscord | <Rika> i dont see anything obvious to make it work |
11:59:37 | FromDiscord | <enthus1ast> in the users file\: |
11:59:43 | FromDiscord | <Rika> and i did think it was weird that staticread didnt work with absolute directories |
12:00:03 | FromDiscord | <enthus1ast> template scriptDir()\: string =↵ parentDir(instantiationInfo(-1, true).filename)↵↵proc renderIndex(users\: seq[User])\: string = compileTemplateFile(scriptDir() / "index.nwt.html") |
12:00:31 | FromDiscord | <enthus1ast> in the parser\:`let masterStr = staticRead( parentDir(path) / secondsStepTokens[0].extendsPath)` |
12:01:08 | FromDiscord | <enthus1ast> yes that was my mistake, i called scriptDir()↵(@Rika) |
12:02:33 | FromDiscord | <enthus1ast> so basically i took the parent dir from the file i want to render |
12:02:34 | FromDiscord | <enthus1ast> which also does not work all the time mhhhhh, but for now it is good enough i guess |
12:03:47 | FromDiscord | <enthus1ast> no not the "the file i want to render" but my executable ... |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:35 | * | supakeen joined #nim |
12:09:48 | FromDiscord | <enthus1ast> yeah nice, the template engine works quite well. Basically a "jina" or "twig" for nim. Strongly typed \:) |
12:10:51 | * | auxym joined #nim |
12:12:49 | FromDiscord | <enthus1ast> but in constrast to my old "nimWebTemplates" this one is compiled and has "if elif else / while / for / eval / variables / comments / include / extend" functionallity |
12:16:53 | * | auxym quit (Ping timeout: 250 seconds) |
12:17:10 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
12:31:51 | * | auxym joined #nim |
12:39:06 | * | auxym quit (Ping timeout: 240 seconds) |
12:46:29 | * | maxime_ joined #nim |
12:49:01 | * | rockcavera joined #nim |
12:49:01 | * | rockcavera quit (Changing host) |
12:49:01 | * | rockcavera joined #nim |
13:03:53 | * | arkurious joined #nim |
13:09:37 | FromDiscord | <enthus1ast> ugh staticRead still bites me |
13:09:55 | FromDiscord | <enthus1ast> its behaviour is nearly useless ... |
13:15:43 | FromDiscord | <enthus1ast> do you know if the compiler has a global where the current working dir is stored? This might help |
13:18:50 | FromDiscord | <Rika> isnt there a function for that |
13:19:06 | FromDiscord | <enthus1ast> all must be at compile time |
13:19:15 | FromDiscord | <TurtleP> Yeah, the os module has one @Rika |
13:19:16 | FromDiscord | <enthus1ast> because the templates are parsed on compile time |
13:19:55 | FromDiscord | <enthus1ast> nope cannot use getCurrentDir() on compile time |
13:20:53 | * | vicfred_ joined #nim |
13:20:56 | FromDiscord | <krisppurg> Anyone who knows nimsuggest, is there an example of a generic parameter and a label? |
13:21:15 | FromDiscord | <enthus1ast> either the current working dir (where the compiler is invoked) or the file that is compiled (the one that i specify via nim c -r i/need/this/path.nim) |
13:21:47 | FromDiscord | <xflywind> You need compile with `-d:vmopsDanger` |
13:22:07 | FromDiscord | <xflywind> or so to use `getCurrentDir` at compile time. |
13:24:00 | * | vicfred quit (Ping timeout: 272 seconds) |
13:24:04 | FromDiscord | <xflywind> https://github.com/nim-lang/Nim/blob/6563a685c1076cb5342f65d192b8f2a983220dba/compiler/vmops.nim#L296 |
13:25:56 | FromDiscord | <xflywind> yeah compile with `--experimental:vmopsDanger` |
13:28:08 | FromDiscord | <enthus1ast> yesss |
13:28:09 | FromDiscord | <xflywind> works for me |
13:28:12 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3v9l |
13:28:29 | FromDiscord | <enthus1ast> @xflywind\: thank you \:D |
13:29:18 | FromDiscord | <xflywind> you are welcome |
13:29:47 | FromDiscord | <enthus1ast> do you know by chance if i can enable this in a module file? |
13:30:06 | FromDiscord | <Rika> not recommended |
13:30:57 | FromDiscord | <enthus1ast> the problem is if this is not enabled via the module file, then this must be specified for every project that uses the template engine |
13:34:10 | FromDiscord | <Rika> i think experimental is a pragma |
13:34:36 | FromDiscord | <enthus1ast> {.experimental\: "vmopsDanger".} is not working |
13:34:43 | FromDiscord | <Rika> {.experimental: vmopsDanger.} i think? i dont remember its been a while since i wrote nim code. if not maybe string |
13:35:47 | * | vicfred_ quit (Quit: Leaving) |
13:36:36 | FromDiscord | <Rika> i dont think this can be enabled by pragma |
13:38:00 | FromDiscord | <xflywind> I don't know, at least you can use `staticExec` + shell command at compile time 🙂 |
13:38:19 | FromDiscord | <enthus1ast> yes i tried as well... |
13:38:47 | FromDiscord | <enthus1ast> maybe i will do this but its very ugly |
13:40:42 | FromDiscord | <enthus1ast> maybe i should open an incident for a more usable staticRead |
13:45:49 | FromDiscord | <xflywind> Compile time is quite limited, maybe generate templates at runtime. |
13:46:11 | FromDiscord | <enthus1ast> the templates evaluate to nim source code |
13:46:50 | FromDiscord | <enthus1ast> this is basically a compiled jinja or twig |
13:49:16 | FromDiscord | <Ænigma> sent a code paste, see https://play.nim-lang.org/#ix=3v9t |
13:49:58 | * | vicfred joined #nim |
13:50:07 | FromDiscord | <Ænigma> (edit) "https://play.nim-lang.org/#ix=3v9t" => "https://play.nim-lang.org/#ix=3v9u" |
13:52:10 | FromDiscord | <Rika> nim uses `initT()` for a naming style |
13:53:00 | FromDiscord | <Rika> but some people use `init(T: typedesc[MyType], ...): T` or `init[T: MyType](...): T` afaik? |
13:53:59 | FromDiscord | <Ænigma> I see |
13:58:18 | FromDiscord | <Rika> imo the generic one (the last one i said) is the best one |
13:59:01 | * | Lord_Nightmare quit (Remote host closed the connection) |
13:59:36 | * | Lord_Nightmare joined #nim |
13:59:49 | arkanoid | could you please help me write a PEG mangle rule for c2nim that removes all trailing underscores? like in foo_ -> foo |
14:35:44 | arkanoid | wait, I might have just found the right mindset! "^{ ( !'_' . )* }'_'$" |
14:36:55 | arkanoid | no, I was wrong |
14:38:23 | FromDiscord | <haxscramper> `#mangle "'_'{@}'_''_'" "$1"` is a possible solution, but! |
14:38:33 | FromDiscord | <haxscramper> peg does not support non-greedy quantifiers |
14:38:48 | FromDiscord | <haxscramper> But that handles `void test() {` correctly |
14:38:54 | FromDiscord | <haxscramper> Why someting sane |
14:39:14 | arkanoid | I'm testing with string "foo_bar_" -> expected output "foo_bar" |
14:39:18 | FromDiscord | <haxscramper> like regex (which everyone in the world already knows) wasn't used is completely beyond me |
14:40:57 | arkanoid | haxscramper, actually not sure, but PEG is actually deterministic, regex is not |
14:41:41 | arkanoid | and I'd say this is a requirement if dealing with code |
14:42:16 | FromDiscord | <haxscramper> requirement for dealing with code would be converting identifiers to nep1 by default |
14:42:47 | FromDiscord | <haxscramper> or supporting both regex and peg |
14:43:59 | FromDiscord | <haxscramper> I don't ask "do you really want me to generate `_poor_mans_mangling_` identifiers as-is?" in hcparse |
14:43:59 | FromDiscord | <haxscramper> I just fix it |
14:44:06 | FromDiscord | <haxscramper> so you put shit in get something usable out, without having to learn some never-before-seen text matching syntax |
14:46:01 | FromDiscord | <haxscramper> and I'm pretty sure "deterministic" does not really add anything when we talk about `^_(.?)_$` |
14:46:34 | FromDiscord | <haxscramper> which is, by the way, the use case |
14:46:56 | FromDiscord | <haxscramper> honestly I would just use `sed` on code generated from c2nim |
14:49:41 | FromDiscord | <haxscramper> I also checked whether you could use full peg grammar in `#mangle` - sadly this is not possible |
14:51:29 | * | vicfred quit (Quit: Leaving) |
14:56:13 | FromDiscord | <haxscramper> Peg also has very strange notion of capture group. I tried to do `#mangle "'_' { (!'_') } { ('_' (!'_') ) } '_'" "[#1$1][#1$2]"`↵` _` |
14:56:40 | FromDiscord | <haxscramper> Leading `'_'`, then search until next `_`, |
14:56:47 | FromDiscord | <haxscramper> Then repeatedly search for `_<things>` |
14:56:51 | FromDiscord | <haxscramper> Followed by `_` |
14:57:20 | FromDiscord | <haxscramper> And given `void _foo_bar_() {}` it mangles it to `proc [#1][#2]foo[#1][#2]bar[#1][#2]()` |
14:57:30 | FromDiscord | <haxscramper> So it is applied like three times total? |
15:01:30 | FromDiscord | <haxscramper> https://regex101.com/r/WWO1nB/1 |
15:02:46 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/873217905288953896): Peg also has very strange notion of capture group. I tried to do `#mangle "'_' { (!'_') } { ('_' (!'_') ) } '_'" "[#1$1][#2$2]"`↵` _` |
15:04:21 | arkanoid | I've been playing with the mangle option for hours and yet I'm not there |
15:06:09 | arkanoid | if you read here: https://nim-lang.org/docs/pegs.html , there's "{@} E" and "@@ E" that should exactly do what I need (capture all except trailing underscore), but mangle "{@} '_'" "$1" transforms "foo_false_" in "foofalse" |
15:06:17 | arkanoid | so there's something I don't get yet |
15:06:28 | arkanoid | it shouldn't be greedy, but apparently is |
15:08:12 | arkanoid | maybe maybe I just got it: mangle "{@} ('_'$)" "$1" |
15:08:42 | FromDiscord | <haxscramper> does not work for leading, works for trailing |
15:09:01 | FromDiscord | <haxscramper> `{@}('_'+$)` is more correct |
15:09:02 | FromDiscord | <haxscramper> `foo` |
15:09:34 | FromDiscord | <haxscramper> `^'_'{@}('_'+$)` |
15:09:42 | arkanoid | yeah, I'm just trying to replace tralining. I've a separate mangle for removing heading |
15:10:00 | arkanoid | actually 3 mangles, remove heading, remove heading, remove double "__" |
15:10:24 | arkanoid | but yeah probably I will try to merge them |
15:10:44 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vai |
15:10:50 | arkanoid | but if I first replace __ with _ then the other two can be merged easily |
15:10:55 | FromDiscord | <haxscramper> oh no, `foo` fails |
15:10:55 | FromDiscord | <haxscramper> `^'_'{@}('_'$)` yes |
15:13:32 | arkanoid | "( ^ '_'* ) @@ ( '_'* $ )" "$1" |
15:14:04 | arkanoid | otherwise it won't remove trailing if heading is not present |
15:14:40 | FromDiscord | <haxscramper> https://github.com/nim-lang/c2nim/pull/218 |
15:18:39 | arkanoid | this is the spirit! thanks |
15:18:52 | FromDiscord | <generic linux user> thats the spirit |
15:19:19 | FromDiscord | <Rika> no u |
15:19:20 | arkanoid | yeah, sorry, I've literally translated from my language |
15:19:22 | arkanoid | :D |
15:23:31 | FromDiscord | <exelotl> In reply to @Rika "imo the generic one": I like `proc init(foo: var Foo, ...)` but it doesn't really fit that nicely with arc I guess :( |
15:23:44 | FromDiscord | <Rika> why not |
15:23:47 | FromDiscord | <haxscramper> Honestly I did it only because it is possible to make PR on github without cloning/pushing etc, just using web interface |
15:24:06 | FromDiscord | <Rika> and im not a fan of that, it requires me to have an out variable |
15:24:20 | FromDiscord | <haxscramper> So not that big of a deal |
15:27:12 | * | neceve quit (Ping timeout: 258 seconds) |
15:28:08 | arkanoid | haxscramper, I've just realised there's a --nep1 option in c2nim that does all the underscore thing automatically |
15:29:58 | FromDiscord | <haxscramper> making most wanted option non-default |
15:30:02 | FromDiscord | <haxscramper> classic |
15:30:04 | arkanoid | I've just realised that's creating also big holes in syntax |
15:30:23 | FromDiscord | <haxscramper> what do you mean? |
15:30:45 | arkanoid | I mean, I was already quite far from compilable nim code, but with --nep1 I'm even further away |
15:31:28 | FromDiscord | <exelotl> In reply to @Rika "why not": I came to that conclusion when I was trying it a few weeks ago, as assignment seems to be the preferred way to initialise things. `foo.init()` does pair nicely with `foo.destroy()`, but that's superseded by destructors in arc |
15:31:39 | FromDiscord | <haxscramper> so `#mangle` is better in that case? |
15:31:58 | FromDiscord | <haxscramper> Can you show what exactly `--nep1` breaks? |
15:42:00 | FromDiscord | <top level await> hello could anybody look at my code ? |
15:42:09 | FromDiscord | <top level await> I don't think it's that good and I want some second opinions |
15:42:14 | FromDiscord | <top level await> I'm trying out nim and have really liked it so far |
15:43:06 | FromDiscord | <top level await> https://github.com/yourfriendoss/yourfriendoss |
15:43:09 | nrds | <R2D299> itHub: 7"Website + Readme" |
15:45:24 | FromDiscord | <top level await> the nim code is a single file `run.nim` |
15:47:18 | FromDiscord | <haxscramper> If you need mostly stylistic commments -↵● https://github.com/yourfriendoss/yourfriendoss/blob/main/run.nim#L34 usually it is not necessary to use `strutils` all over the place↵● https://github.com/yourfriendoss/yourfriendoss/blob/main/run.nim#L1 std imports are better done with `std/[]` prefix, other ones I assume are packages? (there is no `.nimble` file for a project, so I would have to manually install all of them). |
15:47:57 | FromDiscord | <haxscramper> Otherwise it looks fine |
15:48:05 | FromDiscord | <top level await> what's a .nimble? |
15:48:21 | FromDiscord | <top level await> i don't know a better way to do the replacing |
15:49:56 | arkanoid | haxscramper, I'm trying to create minimal example. Problem is that I'm converting a 11K lines long C header |
15:51:18 | FromDiscord | <haxscramper> In reply to @arkanoid "<@608382355454951435>, I'm trying to": you can just send it as is, I just want to take a quick look |
15:51:22 | nrds | <Prestige99> Anyone else have a problem accidentally typing discard instead of discord now? |
15:52:12 | FromDiscord | <haxscramper> well, with your current `#mangle` modifications etc, I would just do `c2nim`, `c2nim --nep1` and look at cwdiff |
15:52:50 | FromDiscord | <top level await> how do I add stuff a dependency to my .nimble file? |
15:52:55 | FromDiscord | <top level await> (edit) "stuff a" => "\a" |
15:52:59 | FromDiscord | <top level await> (edit) "\a" => "a" |
15:53:01 | FromDiscord | <top level await> how do I add a dependency to my .nimble file? |
15:53:30 | FromDiscord | <generic linux user> In reply to @top level await "what's a .nimble?": breuh |
15:53:30 | FromDiscord | <haxscramper> I was talking about `strutils.replace` - there is no need for `strutils.` part. Just `replace` would be sufficient |
15:53:31 | FromDiscord | <haxscramper> Pin minimum required prologue versions, like `prologue >= 0.4.4"` |
15:53:37 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vay |
15:54:05 | FromDiscord | <top level await> In reply to @richard stallmen(crazy GNU guy) "breuh": i'm very new to nim.. |
15:54:26 | FromDiscord | <generic linux user> please suit yourslef |
15:54:46 | FromDiscord | <haxscramper> it seems like matrix bridge is routed through a potato floating somewhere in the pacific ocean |
15:54:56 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vaz |
15:55:04 | FromDiscord | <top level await> (edit) "https://play.nim-lang.org/#ix=3vaz" => "https://play.nim-lang.org/#ix=3vaA" |
15:55:06 | FromDiscord | <haxscramper> yes, that is correct |
15:55:11 | FromDiscord | <top level await> thanks |
15:56:02 | FromDiscord | <haxscramper> now `nimble run` should pull down all deps, build and run binary |
15:56:51 | FromDiscord | <generic linux user> oh i didnt know that you had run |
15:57:09 | FromDiscord | <generic linux user> lesson: read doc :| |
15:57:26 | arkanoid | haxscramper, no problem. I can send you raw initial .h and the .nim generated via c2nim and mangling rules |
16:00:46 | FromDiscord | <haxscramper> yes, that would be enogh |
16:02:56 | * | neceve joined #nim |
16:06:03 | FromDiscord | <Rika> In reply to @haxscramper "it seems like matrix": that implies it is water cooled |
16:10:06 | FromDiscord | <generic linux user> :| |
16:15:23 | * | maxime_ quit (Quit: Leaving) |
16:16:17 | * | max22- joined #nim |
16:33:50 | * | neceve quit (Remote host closed the connection) |
16:35:05 | * | neceve joined #nim |
16:40:45 | arkanoid | haxscramper, here's the c2nim output without manual mangling but --nep1 https://termbin.com/nyci |
16:40:56 | arkanoid | I've removed lines 30:34 |
17:06:22 | arkanoid | I think this is a good file identify possible c2nim improvements |
17:06:39 | arkanoid | for example, I'm finding '__' even with --nep1 |
17:06:51 | * | rockcavera quit (Remote host closed the connection) |
17:26:52 | FromDiscord | <codic> gintro looks to auto generate stuff, and I'm trying to grep for `DestroyNotify` to see what it aliases to but can't find it, and the compiler isn't being helpful; what could I do? |
17:27:20 | FromDiscord | <codic> actually found it |
17:27:26 | FromDiscord | <codic> ~/.nimble/bin/pkgs |
17:28:33 | FromDiscord | <codic> sent a code paste, see https://paste.rs/H8G |
17:28:55 | FromDiscord | <codic> oh no cdecl i guess |
17:36:02 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vbl |
17:39:33 | FromDiscord | <codic> ok so the destroy proc should be replaced with nil |
18:17:14 | * | max22- quit (Ping timeout: 272 seconds) |
18:49:44 | FromDiscord | <StefanSalewski (StefanSalewski)> Codic, I can not really help you with vte async, but you may look at |
18:49:48 | FromDiscord | <StefanSalewski (StefanSalewski)> https://github.com/StefanSalewski/gintro/blob/master/examples/gtk3/vte.nim |
18:50:04 | FromDiscord | <StefanSalewski (StefanSalewski)> and [StefanSalewski/gintro#82](https://github.com/StefanSalewski/gintro/issues/82) |
18:50:11 | FromDiscord | <StefanSalewski (StefanSalewski)> Bye, logout |
18:58:34 | FromDiscord | <codic> yeah I got it to work, thanks |
18:59:47 | * | max22- joined #nim |
19:10:38 | FromDiscord | <StefanSalewski (StefanSalewski)> codic, great! |
19:10:43 | FromDiscord | <StefanSalewski (StefanSalewski)> logout |
19:13:48 | nrds | <sorcerer99> o/ |
19:37:28 | FromDiscord | <top level await> logout |
19:37:47 | nrds | <sorcerer99> login |
19:37:52 | FromDiscord | <top level await> lol |
19:37:59 | FromDiscord | <top level await> i've been learning this language |
19:38:03 | nrds | <sorcerer99> :P |
19:38:03 | FromDiscord | <top level await> such fun |
19:38:06 | FromDiscord | <top level await> it's like python but native |
19:38:08 | FromDiscord | <top level await> love it |
19:41:24 | * | SebastianM joined #nim |
19:45:51 | FromDiscord | <Rika> remember that it only looks like python |
19:46:21 | FromDiscord | <top level await> it looks like python but isn't |
19:46:27 | FromDiscord | <PsychoClay> is it prossible to pass a socket between threads? |
19:48:16 | * | vsantana joined #nim |
19:49:01 | FromDiscord | <Elegantbeef> I'd say it's possible but i'd question the safety of it |
19:49:36 | FromDiscord | <PsychoClay> well i tried it but the connection seems to fail when i pass it to a different thread |
19:49:56 | FromDiscord | <PsychoClay> it doesnt give any exception sadly |
19:49:59 | FromDiscord | <top level await> how do I import a file from a directory and use it? I'm trying to split every route into into my routes/ directory, but I can't seem to use it.. I get some weird unexplainable error. |
19:50:16 | FromDiscord | <Elegantbeef> `import foldername/modulename` |
19:50:25 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vbX |
19:50:28 | FromDiscord | <Elegantbeef> you can also do `import foldername/[a, b, c]` |
19:50:28 | FromDiscord | <top level await> and so on |
19:50:33 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vbY |
19:52:27 | FromDiscord | <dom96> In reply to @PsychoClay "well i tried it": what's your high-level goal? |
19:52:52 | * | vsantana left #nim (#nim) |
19:53:26 | FromDiscord | <Elegantbeef> If the first block is the main file you dont have prologue in that file so i dont see how this works \:D |
19:53:47 | FromDiscord | <PsychoClay> In reply to @dom96 "what's your high-level goal?": i have 1 thread for accepting websocket connections with the ws library, and another rpc thread to send messages on those websockets |
19:54:22 | FromDiscord | <dom96> why are you using threads for this? async should be enough |
19:56:27 | FromDiscord | <PsychoClay> il try that |
20:04:00 | nrds | <Prestige99> what's up sorcerer |
20:04:12 | nrds | <sorcerer99> chillin and you sir |
20:05:54 | nrds | <Prestige99> same, work almost over. Gotta work on my wm this weekend lol |
20:06:00 | nrds | <sorcerer99> lol |
20:06:13 | nrds | <sorcerer99> are you gonna do it, or be lazy like me? rofl |
20:07:10 | nrds | <Prestige99> uhh well I have a few other projects to work on as well so we'll see :P |
20:08:54 | nrds | <sorcerer99> lol |
20:15:20 | FromDiscord | <top level await> elegantbeef |
20:15:32 | FromDiscord | <Elegantbeef> ME! |
20:15:35 | FromDiscord | <top level await> YHES |
20:16:00 | FromDiscord | <top level await> run.nim https://pastebin.com/Hnc7nnf3 |
20:16:27 | FromDiscord | <top level await> routes/index.nim https://pastebin.com/0p424qvv |
20:16:36 | FromDiscord | <top level await> error: run.nim line 83 |
20:31:18 | * | SebastianM quit (Quit: Bye) |
20:49:50 | FromDiscord | <rishavs (Rishav Sharan)> sent a code paste, see https://play.nim-lang.org/#ix=3vcd |
20:50:02 | FromDiscord | <tandy> a nim window manager?↵(<@709044657232936960_nrds=5b=49=52=43=5d>) |
20:50:11 | FromDiscord | <Elegantbeef> you can use a tuple just without tuple unpacking |
20:51:01 | FromDiscord | <rishavs (Rishav Sharan)> Sorry, I didn't quite understand |
20:51:23 | FromDiscord | <Elegantbeef> Yes it's call nimdow tandy |
20:51:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vce |
20:51:42 | FromDiscord | <tandy> oh sick |
20:51:51 | FromDiscord | <Elegantbeef> I'm also presently working on one |
20:51:54 | FromDiscord | <rishavs (Rishav Sharan)> ooh. that looks so trivial now! Thanks! |
20:52:36 | FromDiscord | <tandy> repo link? |
20:52:38 | FromDiscord | <tandy> also damn this doesnt support wayland |
20:52:51 | FromDiscord | <top level await> wayland bad |
20:52:56 | FromDiscord | <Elegantbeef> I mean i say "of course not i game" |
20:53:08 | FromDiscord | <Elegantbeef> I joke, i just cant be arsed to use wayland |
20:53:20 | FromDiscord | <tandy> why↵(@top level await) |
20:53:24 | FromDiscord | <codic> i like wayland but until stuff like screen sharing works properly i'll stick with x11 |
20:53:25 | FromDiscord | <top level await> idk |
20:53:29 | FromDiscord | <Elegantbeef> Still relatively early but got most systems in place https://github.com/beef331/goodwm |
20:53:32 | nrds | <R2D299> itHub: 7"<No Description>" |
20:53:40 | FromDiscord | <tandy> works on my machine [TM]↵(@codic) |
20:53:43 | FromDiscord | <top level await> i've never used wayland and i've only seen bugs with it ol |
20:53:47 | FromDiscord | <Elegantbeef> on discord screensharing works properly with wayland + audio afaik |
20:53:47 | FromDiscord | <top level await> x11 has never failed me |
20:53:50 | FromDiscord | <codic> anyone know how a x11 wm can tell clients that it supports the emwh _NET_WM_FULLSCREEN hint? |
20:53:53 | FromDiscord | <codic> oh it didn't for me |
20:54:04 | FromDiscord | <tandy> wayland isnt perfectly supported tho i agree |
20:54:07 | FromDiscord | <tandy> eg. zoom flatpak |
20:54:17 | FromDiscord | <tandy> but thats proprietary so idgaf |
20:54:17 | FromDiscord | <Elegantbeef> Dont you just add it as an xatom to the root window? |
20:54:45 | FromDiscord | <tandy> early days haha |
20:55:02 | FromDiscord | <top level await> In reply to @top level await "error: run.nim line 83": still cant figure this out |
20:55:41 | FromDiscord | <tandy> is wayland support planned? |
20:55:41 | FromDiscord | <Elegantbeef> Well to be fair i did originally write one in this repo(you can see the history) like a year ago |
20:55:43 | FromDiscord | <tandy> ahh |
20:55:43 | FromDiscord | <top level await> error |
20:55:43 | FromDiscord | <tandy> rip |
20:55:45 | FromDiscord | <Elegantbeef> I do not plan to support wayland since it uses a completely different api |
20:55:45 | FromDiscord | <tandy> you should write a readme |
20:55:45 | FromDiscord | <Elegantbeef> I mean it will be done when it's usable |
20:55:56 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcg |
20:55:58 | FromDiscord | <top level await> that's the error I'm experiencing with the above code |
20:56:17 | FromDiscord | <top level await> run.nim https://pastebin.com/Hnc7nnf3↵routes/index.nim https://pastebin.com/0p424qvv↵error: run.nim line 83 |
20:56:24 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vch |
20:56:35 | FromDiscord | <Elegantbeef> try `"/".UrlPattern` if that doesnt work `["/".UrlPattern]` \:D |
20:56:57 | FromDiscord | <codic> if i look at dwm, it does that, but some more things: |
20:56:57 | FromDiscord | <Elegantbeef> Codic are you also working on a WM \:D |
20:57:05 | FromDiscord | <codic> yep |
20:57:10 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vci |
20:57:29 | FromDiscord | <Elegantbeef> Yea i previously tried to use DWM as reference but it's too undescript for me |
20:58:17 | FromDiscord | <top level await> elegantbeef |
20:58:18 | FromDiscord | <top level await> `app.addRoute("/".UrlPattern, index)` |
20:58:34 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcj |
20:58:37 | nrds | <Prestige99> !gh nimdow |
20:58:38 | nrds | <R2D299> vahe-kellenberger/nimdow 2https://github.com/avahe-kellenberger/nimdow - quot;A window manager written in Nim (In Development)" |
20:58:41 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vck |
20:58:42 | nrds | <Prestige99> @tandy |
20:58:53 | FromDiscord | <codic> actually nimdow supports fullscreen let me check how it does it |
20:59:15 | nrds | <Prestige99> I'm the author btw |
20:59:21 | FromDiscord | <Elegantbeef> I've never used prologue so i cannot say much of how it works/supposed t owork |
20:59:27 | FromDiscord | <top level await> same |
20:59:37 | FromDiscord | <top level await> prolouge docs are so outdated |
20:59:39 | FromDiscord | <codic> Prestige: nice! |
20:59:51 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vcl |
20:59:55 | FromDiscord | <codic> oh no |
20:59:56 | FromDiscord | <top level await> https://planety.github.io/prologue/staticfiles.html |
20:59:57 | FromDiscord | <codic> one is on the root window |
21:00:02 | FromDiscord | <codic> the other is on the supporting window |
21:00:09 | FromDiscord | <top level await> this doc is broken |
21:00:24 | FromDiscord | <top level await> urls.urlPatterns where that come from uh? |
21:00:30 | nrds | <Prestige99> In nimdow's code look for NetWMStateFullScreen in windowmanager.nim |
21:00:32 | FromDiscord | <codic> that it supports all those atoms? |
21:00:34 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vcp |
21:00:49 | FromDiscord | <codic> yeah I have an implementation of fullscreen already I'm just trying to figure out how to advertise it |
21:01:05 | FromDiscord | <codic> otherwise some clients that just try to do it work, like chromium, but others don't, like firefox, because first it checks if its supported |
21:01:08 | nrds | <Prestige99> Yeah that shows which atoms are supported |
21:03:33 | FromDiscord | <codic> oh it's just an enum that you populate |
21:06:42 | FromDiscord | <codic> it looks like only NetAtoms are used in Nimdow, not WmAtoms or XAtoms |
21:07:40 | nrds | <Prestige99> Perhaps I should provide them all |
21:15:38 | FromDiscord | <top level await> any alternitaves http framework that has good documentation? |
21:15:43 | FromDiscord | <top level await> (edit) removed "alternitaves" |
21:16:53 | FromDiscord | <codic> httpbeast is pretty good |
21:16:57 | FromDiscord | <codic> jester is a nice wrapper |
21:17:04 | FromDiscord | <top level await> i might switch from prolouge to httpx |
21:17:19 | nrds | <Prestige99> @codic if you have any question about wm stuff just ping me |
21:17:29 | nrds | <Prestige99> questions* |
21:22:46 | FromDiscord | <top level await> nim to me is |
21:22:50 | FromDiscord | <top level await> python + js + C |
21:22:52 | FromDiscord | <top level await> (edit) "C" => "C++" |
21:22:53 | FromDiscord | <top level await> (edit) "C++" => "C" |
21:22:56 | FromDiscord | <top level await> (edit) "C" => "C/C++" |
21:22:59 | FromDiscord | <top level await> (edit) "C/C++" => "C" |
21:23:01 | FromDiscord | <top level await> (edit) "C" => "C++" |
21:23:02 | FromDiscord | <top level await> (edit) "C++" => "C" |
21:23:08 | nrds | <Prestige99> uh |
21:23:25 | nrds | <Prestige99> all the edits |
21:23:26 | FromDiscord | <top level await> i edited that many times, sorry |
21:23:36 | FromDiscord | <top level await> i forgot there's a irc bridge |
21:23:47 | nrds | <Prestige99> haha np |
21:24:00 | FromDiscord | <top level await> the hint of js |
21:24:04 | FromDiscord | <top level await> comes from the `var` and `let` |
21:24:13 | FromDiscord | <top level await> so i sometimes write `const` instead of `let` |
21:24:39 | nrds | <Prestige99> Yeah it throws me off sometimes going back and forth between nim and js |
21:24:43 | FromDiscord | <top level await> python from the fact `from a import a` `import a` and `echo "hi"` |
21:25:00 | FromDiscord | <top level await> i constantly switch between java, js and python |
21:25:17 | FromDiscord | <top level await> i might drop java entirely if I get better at nim though |
21:25:42 | nrds | <Prestige99> I pretty much only use nim and typescript now |
21:25:47 | FromDiscord | <top level await> I use java cause I don't need to pack anything togethr with it. Like you don't need 300 libaries. You can just grab swing and throw a theme on it lol |
21:26:02 | FromDiscord | <top level await> Also I think of js due to `nimble` |
21:26:10 | FromDiscord | <top level await> And the fact that you can install packages THAT quickly |
21:28:29 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vct |
21:28:45 | FromDiscord | <Elegantbeef> Case statement macros or fusion/matching |
21:29:13 | FromDiscord | <Elegantbeef> But you can just you know do a case statement on it's `.theType` field |
21:29:36 | nrds | <Prestige99> normal case statements need to be compile time I believe |
21:30:13 | FromDiscord | <Elegantbeef> What do you mean by that prestige? |
21:30:49 | nrds | <Prestige99> like the `of "foo"` part |
21:31:18 | FromDiscord | <codic> yeah that is comptime known |
21:31:31 | FromDiscord | <codic> just like `of MotionNotify:`, etc |
21:32:27 | FromDiscord | <codic> XEvent is a union, so I want to switch on what type it is: https://tronche.com/gui/x/xlib/events/structures.html |
21:33:40 | FromDiscord | <codic> also, is it ok to blanket recieve events with xselectinput and filter stuff out, or should i explicitly xgrabkey for everything I want? |
21:33:41 | nrds | <Prestige99> yeah i think you should be able to do that |
21:34:03 | nrds | <Prestige99> only grab what you need |
21:34:28 | * | xet7 quit (Read error: Connection reset by peer) |
21:34:43 | * | xet7 joined #nim |
21:34:57 | FromDiscord | <codic> okay, i think i'll go back to using if/else and move the event handlers into functions |
21:35:02 | FromDiscord | <codic> right now its just one messy big file |
21:37:04 | FromDiscord | <Elegantbeef> The of statements of a normal case statement do need to be compile time, i gues |
21:37:05 | FromDiscord | <Elegantbeef> The of statements of a normal case statement do need to be compile time, i guess |
21:37:31 | * | neceve quit (Ping timeout: 258 seconds) |
21:37:58 | FromDiscord | <Elegantbeef> I mean https://github.com/beef331/goodwm/blob/master/src/goodwm.nim#L69-L92 |
21:38:07 | FromDiscord | <Elegantbeef> It's not that hard to not use case here |
21:38:11 | FromDiscord | <codic> oh wait |
21:38:14 | FromDiscord | <codic> the field is literally called |
21:38:15 | FromDiscord | <codic> .theType |
21:38:16 | FromDiscord | <codic> hahahaha |
21:38:29 | FromDiscord | <codic> i thought you were using it as an example |
21:38:37 | FromDiscord | <top level await> `template/generic instantiation of `format` from here↵` |
21:38:40 | FromDiscord | <top level await> (edit) "`template/generic" => "template/generic" | "here↵`" => "here" |
21:38:42 | FromDiscord | <top level await> what do this error mean> |
21:38:44 | FromDiscord | <top level await> (edit) "mean>" => "mean?" |
21:38:56 | FromDiscord | <Elegantbeef> It means it doesnt have a `format` accessible |
21:39:10 | FromDiscord | <Elegantbeef> Probably due to your lovely selective importing |
21:39:13 | FromDiscord | <top level await> ah thank you |
21:39:20 | FromDiscord | <top level await> In reply to @Elegantbeef "Probably due to your": it is faster |
21:39:21 | FromDiscord | <top level await> in my head |
21:39:23 | FromDiscord | <top level await> ok? |
21:39:41 | FromDiscord | <top level await> but should I not do that? |
21:39:58 | FromDiscord | <Elegantbeef> It's generally only done when you want to only get a few symbols due to collisions |
21:39:59 | FromDiscord | <top level await> cause I don't want everything polluted with stuff I don't want |
21:40:19 | FromDiscord | <top level await> well I'm redoing the entire app anyways |
21:40:20 | FromDiscord | <Elegantbeef> Pollution isnt a big issue imho |
21:40:22 | FromDiscord | <top level await> in httpx |
21:41:10 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vcw |
21:41:21 | FromDiscord | <Elegantbeef> Local modules on a single liine, packages all seperated by a new line |
21:41:27 | FromDiscord | <Elegantbeef> But that's up to you |
21:41:37 | FromDiscord | <Elegantbeef> I find selective imports annoying since you have to add more whenever you need them |
21:41:53 | FromDiscord | <codic> yeah but when you only need very few things from a module its ok |
21:41:59 | FromDiscord | <codic> or like one proc |
21:42:40 | FromDiscord | <top level await> what's the diffrence |
21:42:45 | FromDiscord | <top level await> between a func and a proc |
21:42:59 | FromDiscord | <Elegantbeef> Functions are pure and cannot have side effects |
21:43:13 | FromDiscord | <Elegantbeef> So no touching non-const global states |
21:44:41 | FromDiscord | <top level await> ah |
21:44:45 | FromDiscord | <top level await> i should use that more then |
21:45:12 | FromDiscord | <Elegantbeef> Just like const -\> let -\> var you should func -\> proc |
21:46:45 | FromDiscord | <Elegantbeef> Though procs are actually converted to `noSideEffects`(funcs) if they dont have side effects |
21:48:08 | FromDiscord | <codic> xephyr is kinda sucky, pretty handy to have a wm open on the other vty |
21:48:21 | FromDiscord | <Elegantbeef> Eh xephyr works fine for me |
22:00:17 | FromDiscord | <top level await> elegantbeef |
22:00:18 | FromDiscord | <top level await> `` |
22:00:26 | FromDiscord | <top level await> this is how I decided on doing my imports |
22:00:28 | FromDiscord | <top level await> (edit) "``" => "sent a code paste, see https://paste.rs/SHu" |
22:01:00 | FromDiscord | <top level await> all packages in same line like `import httpx, nre, markdown` |
22:01:27 | FromDiscord | <top level await> nre is std, forgot |
22:01:30 | FromDiscord | <Elegantbeef> Yea you can do them how ever you want really, it's just what I said I do, you can write the language however it works for you |
22:01:43 | FromDiscord | <top level await> do you know any capybara images |
22:01:51 | FromDiscord | <top level await> i need more for my capy images |
22:02:41 | FromDiscord | <Elegantbeef> There are many images of those nice rodents |
22:02:57 | FromDiscord | <Elegantbeef> If that means anything aside from the actual docile animal, i dont know what that means |
22:03:10 | FromDiscord | <top level await> they are so nice |
22:03:13 | FromDiscord | <top level await> btw |
22:03:14 | FromDiscord | <top level await> they're harmless |
22:03:32 | FromDiscord | <Elegantbeef> hence "docile" |
22:03:40 | FromDiscord | <top level await> they are like |
22:03:43 | FromDiscord | <top level await> th BEST eniamel |
22:04:08 | FromDiscord | <top level await> our friend group |
22:04:10 | FromDiscord | <top level await> we call them |
22:04:12 | FromDiscord | <top level await> crappy bars |
22:04:20 | FromDiscord | <top level await> https://yourfriend.lv/capybaras/3.jpg |
22:04:20 | FromDiscord | <top level await> tetris |
22:04:44 | FromDiscord | <top level await> https://media.discordapp.net/attachments/371759389889003532/873325742841274368/3.png |
22:08:50 | * | max22- quit (Quit: Leaving) |
22:11:57 | FromDiscord | <top level await> also |
22:12:01 | FromDiscord | <top level await> the entire idea of that website |
22:12:05 | FromDiscord | <top level await> is that it's a contained readme.md |
22:12:17 | FromDiscord | <top level await> so I can use it as my github profile readme |
22:12:17 | FromDiscord | <top level await> https://github.com/yourfriendoss |
22:14:44 | FromDiscord | <Elegantbeef> Consider looking at https://github.com/pietroppeter/nimib |
22:14:47 | nrds | <R2D299> itHub: 7"nimib 🐳 - nim 👑 driven ⛵ publishing ✍" |
22:17:01 | FromDiscord | <codic> ufcs is so awesome I love it |
22:17:30 | FromDiscord | <codic> i just wish there was a x11 wrapper for nim that used nim types and didn't put X in front of everything... I might do that |
22:18:53 | FromDiscord | <Elegantbeef> Yea i'm more annoyed by the `para1: cint, para2: cint` \:P |
22:19:45 | FromDiscord | <top level await> elegantbeef |
22:19:54 | FromDiscord | <top level await> that's more like a documentation framework |
22:19:54 | FromDiscord | <top level await> lmfao |
22:20:08 | FromDiscord | <Elegantbeef> Sure but it outputs .md |
22:20:16 | FromDiscord | <top level await> i don't like it though lol |
22:20:18 | FromDiscord | <top level await> this seems natrual to me |
22:20:20 | FromDiscord | <top level await> that doesn't |
22:20:38 | FromDiscord | <top level await> probably once I get more into nim I can try that.. for now that seems complicated & useless |
22:22:28 | FromDiscord | <top level await> i feel more control with httpx |
22:22:32 | FromDiscord | <top level await> like i can do whatever i want with it |
22:22:35 | FromDiscord | <top level await> than prolouge |
22:22:41 | FromDiscord | <codic> i should switch to matrix for this server i'm just too lazy |
22:22:42 | FromDiscord | <top level await> i just get ON REUQEST: do shit with reuqest |
22:23:34 | FromDiscord | <top level await> In reply to @codic "i should switch to": same |
22:23:44 | FromDiscord | <top level await> I wanna go full foss actually |
22:23:53 | FromDiscord | <top level await> but spotify and discord are preventing me from doing that |
22:23:57 | FromDiscord | <top level await> and google classrooms |
22:24:02 | FromDiscord | <top level await> and google itself lol |
22:24:42 | FromDiscord | <undersquire> In reply to @top level await "and google itself lol": Yep |
22:25:06 | FromDiscord | <top level await> duckduckgo is simply not good enough |
22:25:06 | FromDiscord | <top level await> lol |
22:25:18 | FromDiscord | <undersquire> Yeah its results are not good |
22:25:23 | FromDiscord | <top level await> yup |
22:25:26 | FromDiscord | <undersquire> (edit) "Yeah its results are not ... good" added "as" |
22:25:48 | FromDiscord | <undersquire> SearX is the best option |
22:26:10 | FromDiscord | <undersquire> But it’s self hosted so u either gotta use someone’s instance or host ur own |
22:27:07 | FromDiscord | <undersquire> (edit) "SearX is the best ... option" added "Foss" |
22:28:20 | FromDiscord | <top level await> why do people hate cloudflare? |
22:28:59 | FromDiscord | <undersquire> Because if it goes down, so does half the internet lol (since so many websites rely on it) |
22:29:14 | FromDiscord | <top level await> In late 2019, Cloudflare was criticized for providing services to the anti-black website Chimpmania |
22:29:16 | FromDiscord | <top level await> whaaaaaaaat |
22:29:23 | FromDiscord | <top level await> you can't just deny a purchase lol |
22:29:26 | FromDiscord | <undersquire> Wtf |
22:29:57 | FromDiscord | <undersquire> I never heard anything about that |
22:33:45 | FromDiscord | <dom96> In reply to @top level await "i might switch from": Just FYI: httpx and httpbeast are just a web servers. |
22:34:07 | FromDiscord | <top level await> yup |
22:34:10 | FromDiscord | <top level await> that's all I want |
22:34:14 | FromDiscord | <top level await> also I did switch to httpx |
22:35:26 | FromDiscord | <dom96> hm, I wonder if httpx includes the latest httpbeast patches |
22:35:39 | FromDiscord | <top level await> how latest are they? |
22:35:53 | FromDiscord | <dom96> 12 June |
22:36:00 | FromDiscord | <top level await> of this year ? :Bruh: |
22:36:04 | FromDiscord | <dom96> yep |
22:36:13 | FromDiscord | <top level await> latest commit: ↵on Oct 22, 2020 |
22:36:51 | FromDiscord | <top level await> if you ever plan on adding wepoll support, please annouce it somewhere, ty |
22:38:14 | FromDiscord | <dom96> I'd rather not. It's extra maintenance. For Jester I just use asynchttpserver on Windows |
22:38:46 | FromDiscord | <top level await> Who maintains httpx? |
22:39:08 | FromDiscord | <dom96> xflywind |
22:39:24 | FromDiscord | <top level await> @xflywind - do you plan on updating httpx to include the latest patches ? thank you |
22:40:00 | FromDiscord | <dom96> Why did you decide to move away from prologue? |
22:40:16 | FromDiscord | <top level await> i had issues with routing |
22:40:22 | FromDiscord | <top level await> also the documentation was kind of broken |
22:40:34 | FromDiscord | <top level await> i just wanted something that I can quickly edit and that i know what it is going to do |
22:40:38 | FromDiscord | <dom96> maybe you could give jester a try? |
22:44:59 | FromDiscord | <top level await> i can't pass it's get to a function |
22:47:49 | FromDiscord | <dom96> can you elaborate? |
22:48:33 | FromDiscord | <top level await> actually I'm gonna try something |
22:53:05 | * | flynn quit (Remote host closed the connection) |
22:54:10 | FromDiscord | <top level await> how do I check if I'm on windows or on posix? |
22:54:12 | * | flynn joined #nim |
22:54:36 | FromDiscord | <dom96> `when defined(windows)` and `when defined(posix)` |
22:54:41 | FromDiscord | <dom96> but what are you trying to do? 🙂 |
22:55:00 | FromDiscord | <top level await> I'm gonna look through httpbeast |
22:55:04 | FromDiscord | <top level await> I wanna make a updated fork |
22:57:45 | FromDiscord | <top level await> btw @dom96 |
22:57:48 | FromDiscord | <top level await> for some reason there's |
22:57:56 | FromDiscord | <top level await> import times # TODO this shouldn't be required. Nim bug? |
22:58:01 | FromDiscord | <top level await> even though times is used in a bunch of places |
22:58:18 | FromDiscord | <top level await> this place actually |
22:58:21 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcI |
22:58:41 | FromDiscord | <dom96> it's old code, I can barely remember it, check the blame |
22:59:13 | FromDiscord | <top level await> only problem I can see under windows is this |
22:59:20 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcJ |
23:06:35 | FromDiscord | <top level await> ` var data: ptr Data = addr(selector.getData(fd))` |
23:06:43 | FromDiscord | <top level await> template/generic instantiation of `getData` from here |
23:06:46 | FromDiscord | <top level await> hm.. weird.. |
23:08:11 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3vcO |
23:09:58 | FromDiscord | <dom96> sequtils.filter maybe |
23:11:11 | FromDiscord | <codic> returns a copy, I need either a pointer o an index because i'm going to mutate the value in clients |
23:31:50 | * | auxym joined #nim |
23:32:16 | FromDiscord | <top level await> anybody used https://github.com/nimgl/imgui before here? |
23:32:19 | nrds | <R2D299> itHub: 7"ImGui bindings for Nim via cimgui" |
23:33:04 | FromDiscord | <top level await> i love imgui but i wanna use it in imgui |
23:33:06 | FromDiscord | <top level await> but this seems hard lol |
23:38:39 | FromDiscord | <Elegantbeef> I've used it a bit a while ago |
23:38:49 | FromDiscord | <top level await> on windows? |
23:38:51 | FromDiscord | <top level await> probably not lol |
23:38:59 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcQ |
23:39:05 | FromDiscord | <Elegantbeef> You have to init everything |
23:39:10 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcR |
23:39:27 | FromDiscord | <Elegantbeef> https://github.com/nimgl/nimgl/blob/master/examples/timgui.nim |
23:39:35 | FromDiscord | <top level await> sent a code paste, see https://play.nim-lang.org/#ix=3vcS |
23:40:27 | FromDiscord | <Elegantbeef> Those bindings are mostly for a renderer agnostic setting, if you want to actually render it you'll need to open up a window, setup a context and the similar using a file like that `timgui.nim` |
23:41:00 | FromDiscord | <top level await> i've only used imgui in python.. |
23:41:05 | FromDiscord | <top level await> where it was trivally easy lol |
23:41:26 | FromDiscord | <top level await> https://pypi.org/project/imgui/ |
23:41:37 | FromDiscord | <Elegantbeef> Well python's library hides it all from you |
23:41:43 | FromDiscord | <top level await> yes |
23:41:44 | FromDiscord | <top level await> i like that |
23:42:36 | FromDiscord | <Elegantbeef> Well then you'll have to write the abstraction for that |
23:43:15 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vcX |
23:43:15 | FromDiscord | <Elegantbeef> That imgui binding is meant for a bring your own renderer approach |
23:43:52 | FromDiscord | <Elegantbeef> Well if that's a dynamic list, yes |
23:44:13 | FromDiscord | <Ayy Lmao> Because I am having some very strange behavior doing this where a sequence I use later on will throw an exception saying that it changed length while iterating over it |
23:44:16 | FromDiscord | <Elegantbeef> though you can do `var memory = create(cDouble, cDoublesToWrite)` |
23:44:33 | FromDiscord | <Elegantbeef> then you dont need the cast for the api call |
23:45:07 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "though you can do": I will try that and see if it alleviates my problem |
23:45:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3vcY |
23:45:55 | FromDiscord | <Elegantbeef> In this case you use `createU` since you dont need it to 0 memory |
23:47:55 | FromDiscord | <Elegantbeef> Also you're probably looking at a different error |
23:48:03 | FromDiscord | <Elegantbeef> If you could provide testable code, that'd be grand \:D |
23:48:50 | FromDiscord | <Elegantbeef> Wait.. apiFuncThatWritesToACDoublePtr doesnt take an int? |
23:50:45 | FromDiscord | <Ayy Lmao> My problem still seems to persist. I don't really know how to provide testable code. This is an extremely elusive problem that makes zero sense to me. I am making a dll that is an extension for a DAW called Reaper. The problem only happens when I have a win32 dialog window running. |
23:51:03 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "Wait.. apiFuncThatWritesToACDoublePtr doesnt take": It does, I just didn't add it in my pseudo example |
23:51:53 | FromDiscord | <Elegantbeef> Cause that error makes 0 sense when talking about this code |
23:53:31 | FromDiscord | <Ayy Lmao> It's a weird problem, basically I am trying to request for some audio data from Reaper. The sequence being resized while iterating error happens if I try to loop through `rawBuffer` in my example and build a sequence with `mySeq.add`. |
23:53:55 | FromDiscord | <Elegantbeef> What's that loop look like? |
23:54:17 | FromDiscord | <Ayy Lmao> If I allocate the required samples beforehand and just write them to the sequence like `mySeq[i] = sample`, it works, but causes some weird behavior later on |
23:55:02 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vcZ |
23:56:00 | FromDiscord | <Elegantbeef> Cause i mean this works https://play.nim-lang.org/#ix=3vd0 |
23:56:01 | FromDiscord | <top level await> how do i do |
23:56:09 | FromDiscord | <top level await> do: while syntax in nim? |
23:56:10 | FromDiscord | <Ayy Lmao> If I use this function to get the audio, and then later on try to loop through the return of it and build a sequence from it by using the `add` function, it will say the sequence changed length while iterating over it |
23:56:55 | FromDiscord | <Elegantbeef> there is no do while so you can just init the vars before hand then run the while loop |
23:57:15 | * | xet7 quit (Remote host closed the connection) |
23:57:25 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "Cause i mean this": Yeah it works, it just doesn't work sometimes depending on if I call the function from an event posted by a win32 window |
23:58:10 | FromDiscord | <Ayy Lmao> The weird thing is I can get it to work by preallocating the sequence I'm building beforehand, but I have to call the function repeatedly because sometimes it won't fill the whole buffer |
23:58:14 | * | xet7 joined #nim |