00:00:02 | * | termer quit (*.net *.split) |
00:00:02 | * | gshumway_ quit (*.net *.split) |
00:00:02 | * | attah quit (*.net *.split) |
00:00:52 | * | termer joined #nim |
00:00:57 | * | azimut quit (Ping timeout: 246 seconds) |
00:01:06 | * | attah joined #nim |
00:02:13 | * | gshumway joined #nim |
00:06:01 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Fev |
00:06:11 | FromDiscord | <sOkam! 🫐> I will try explicitely importing them, to see if that works |
00:16:57 | * | lain quit (Server closed connection) |
00:17:37 | * | lain joined #nim |
00:21:17 | FromDiscord | <Chronos [She/Her]> Is there any reason for me to use `func` instead of `proc`? Ik `func` is for no side effects but isn't the compiler smart enough to figure it out? |
00:26:46 | FromDiscord | <Elegantbeef> It can figure it out unless it a recursive call through generics, but sometimes you also want to force things to have no side effects |
00:30:35 | FromDiscord | <BanannaMan> Array vs seq. Which one does what better and why? |
00:31:01 | FromDiscord | <Elegantbeef> They're the same thing but one is runtime sized |
00:34:59 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FeA |
00:37:15 | FromDiscord | <Chronos [She/Her]> Fair enough |
00:37:15 | FromDiscord | <Chronos [She/Her]> Hm, does anyone know if there's any helper proc to make any seq into an array? Something kinda like `toArray[16](a[0..16])`? |
00:57:15 | FromDiscord | <BanannaMan> In reply to @Elegantbeef "They're the same thing": Thanks, bot buddy. |
00:57:59 | FromDiscord | <Chronos [She/Her]> In reply to @chronos.vitaqua "Hm, does anyone know": Just gonna make a macro for it lol |
00:58:24 | FromDiscord | <Elegantbeef> You don't need a macro |
00:59:43 | FromDiscord | <Chronos [She/Her]> Really? |
00:59:54 | FromDiscord | <Chronos [She/Her]> How else would I do it? |
01:00:01 | FromDiscord | <Chronos [She/Her]> I mean, I could do a template |
01:00:22 | FromDiscord | <Chronos [She/Her]> Yeah I'll do that then |
01:00:26 | FromDiscord | <Elegantbeef> A proc |
01:00:28 | FromDiscord | <Elegantbeef> Use a proc |
01:00:36 | FromDiscord | <Chronos [She/Her]> Actually a proc works |
01:00:37 | FromDiscord | <Chronos [She/Her]> Yeah |
01:00:38 | FromDiscord | <huantian> Lmao |
01:00:48 | FromDiscord | <Chronos [She/Her]> My brain is never working sorry lmao |
01:01:03 | FromDiscord | <Chronos [She/Her]> I was thinking of using a macro to avoid assignment initially |
01:02:26 | FromDiscord | <Elegantbeef> `mySeq.toArray(0..16)` 😄 |
01:02:42 | FromDiscord | <Chronos [She/Her]> Is that actually a thing or? |
01:02:48 | FromDiscord | <Chronos [She/Her]> I swear I tried it |
01:03:18 | FromDiscord | <Chronos [She/Her]> No it isn't |
01:09:52 | FromDiscord | <Chronos [She/Her]> Ah, how do I check if a sequence has a value at an index? |
01:10:58 | FromDiscord | <Chronos [She/Her]> Catching defects isn't super ideal |
01:13:43 | FromDiscord | <Elegantbeef> if `mySeq.high in a..b` |
01:25:22 | FromDiscord | <Chronos [She/Her]> Pain |
01:26:02 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeH |
01:26:24 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeI |
01:26:27 | FromDiscord | <Elegantbeef> `static Range` |
01:26:32 | FromDiscord | <Chronos [She/Her]> Ah |
01:26:34 | FromDiscord | <Elegantbeef> sorry `static slice[int]` |
01:26:52 | FromDiscord | <Elegantbeef> Outside of type sections `..` is a `Slice` |
01:27:08 | FromDiscord | <Chronos [She/Her]> Ah |
01:28:23 | FromDiscord | <Chronos [She/Her]> Uh all I'm getting is a vague `Error: type expected`, let me make a minimal example of the code rq |
01:31:29 | FromDiscord | <Chronos [She/Her]> https://play.nim-lang.org/#ix=4FeJ |
01:31:55 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4FeK |
01:33:46 | FromDiscord | <Chronos [She/Her]> I... Never knew you could do it like that, huh |
01:33:48 | FromDiscord | <Chronos [She/Her]> Neat |
01:35:56 | FromDiscord | <Chronos [She/Her]> Fuck yeah! My code works now! |
01:40:56 | FromDiscord | <dedraiaken> sent a code paste, see https://paste.rs/kofrr |
01:42:51 | FromDiscord | <Elegantbeef> `system.len(x)` |
01:44:28 | FromDiscord | <Chronos [She/Her]> Is there a good error for if an array doesn't have the required length? Thinking of using a RangeDefect but hm... Idk if it's right |
01:52:03 | FromDiscord | <Chronos [She/Her]> Hm... My base32 impl doesn't add a 0 at the start, should I add that or something? |
02:02:45 | FromDiscord | <Elegantbeef> Huh? |
02:04:34 | FromDiscord | <Chronos [She/Her]> Idk, ULIDs start with a 0, right? But for some reason, mine don't, and most ULID impls don't bc of the base32 impls being done correctly |
02:04:36 | FromDiscord | <Chronos [She/Her]> But yeah |
02:39:12 | * | xet7 joined #nim |
03:13:44 | FromDiscord | <jviega> Yes, my ULIDS all correctly start w 0 |
03:16:03 | FromDiscord | <Chronos [She/Her]> In reply to @jviega "Yes, my ULIDS all": Could you send a link to your base32 encoder? I just wanna double check if mine is missing something |
03:16:18 | FromDiscord | <Chronos [She/Her]> I just append '0' to my ULIDs manually for now (they're read correctly tho) |
03:16:19 | FromDiscord | <jviega> It's in that nimutils package, in encodings.nim |
03:16:24 | FromDiscord | <Chronos [She/Her]> Thanks! |
03:17:58 | FromDiscord | <jviega> There's a function in there to re-extract the timestamp if you want to check it better |
03:18:05 | FromDiscord | <Chronos [She/Her]> Heah that's uh gibberish to me |
03:18:38 | FromDiscord | <Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID and https://github.com/Yu-Vitaqua-fer-Chronos/Crockford-Base32-Nim |
03:18:41 | FromDiscord | <Chronos [She/Her]> Those are my repos |
03:18:57 | FromDiscord | <jviega> `x.ulidToTimeStamp()` will go from a ulid back to a timestamp. |
03:19:11 | FromDiscord | <Chronos [She/Her]> Yeah my code does that too |
03:19:29 | FromDiscord | <Chronos [She/Her]> I can parse ULIDs perfectly fine, it's just that I have to append a '0' to the start of the ULID manually |
03:20:16 | FromDiscord | <jviega> Well I don't know how you're doing to conversion but string-to-number functions tend to drop leading zeros |
03:21:04 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeX |
03:21:08 | FromDiscord | <Chronos [She/Her]> That's the entirety of my encoder lol |
03:25:37 | FromDiscord | <Chronos [She/Her]> I think it's bc I immediately terminate the loop instead of continuing for the last iteration |
03:25:41 | FromDiscord | <Chronos [She/Her]> But idk |
03:33:42 | FromDiscord | <jviega> Yeah, you're going to drop trailing zeros too because of the 'while num > 0' |
03:35:33 | FromDiscord | <Chronos [She/Her]> Makes sense |
03:36:39 | FromDiscord | <jviega> Adding the extra zero is a non-issue, ULIDS won't use that byte in our lifetimes |
03:40:17 | FromDiscord | <Chronos [She/Her]> Yeah I know lol, just is mildly irritating but oh well |
04:25:34 | * | om3ga_ is now known as om3ga |
04:47:20 | * | azimut joined #nim |
05:26:28 | * | ntat joined #nim |
05:30:22 | FromDiscord | <griffith1deadly> In reply to @heysokam "`confy-droid` sounds catchy 🙂": for android build (for apk) need gradle android template, nimx create this |
05:31:52 | FromDiscord | <griffith1deadly> ios maybe too like this |
06:25:50 | om3ga | .nimble/pkgs/arraymancer-0.7.17/arraymancer/tensor/operators_broadcasted.nim(18, 9) Error: cannot open file: ./math |
06:26:51 | FromDiscord | <Elegantbeef> update arraymancer |
06:56:54 | * | jmdaemon joined #nim |
07:26:25 | FromDiscord | <cedb> im managing the deployment of a k8s cluster with id say like 20 containers with quite a bit of nonsense going on in the docker file. Id like to parametrize/template/generate (wtv the word/approach) these dockerfiles but their dsl sucks. what do you think is better\:↵● generate dockerfile from some config↵● silly templates ala ninja↵● some kind of stupid dsl superset of docker files |
07:28:15 | FromDiscord | <cedb> example of dumb stuff i hate to do by hand\: a new dep requires a dep but only at build time so i need to add the package in install but also to uninstall at the end, but sometimes in dev i like keeping the makedepends around to poke at stuff |
07:31:41 | * | junaid_ joined #nim |
07:38:56 | om3ga | Elegantbeef, no, unfortunately not works |
07:39:09 | FromDiscord | <Phil> In reply to @cedb "example of dumb stuff": Regarding this: Why not have a separate build-container to build you application and the output of that you actually deploy |
07:39:10 | om3ga | it's in Mac |
07:39:23 | om3ga | [email protected] |
07:39:26 | FromDiscord | <Phil> That means you now have 2 dockerfiles but both of them are simpler because one cares about build-time dependencies and the other only about runtime dependencies |
07:42:52 | FromDiscord | <Elegantbeef> https://github.com/mratsim/Arraymancer/blob/master/arraymancer.nimble#L2 |
07:42:55 | FromDiscord | <Elegantbeef> It's not the most recent om3ga |
07:43:36 | om3ga | strange, I run install from git |
07:43:51 | FromDiscord | <Elegantbeef> It's not tagged though |
07:43:52 | FromDiscord | <Phil> sent a long message, see http://ix.io/4Ffw |
07:44:01 | FromDiscord | <Elegantbeef> Which means you need to use `@#head` |
07:44:17 | om3ga | thanks, I will try again |
08:11:13 | om3ga | Elegantbeef, nah, nimble install arraymancer@#head <- installed using this command |
08:12:41 | om3ga | something goes wrong. or compiler corrupted, I will try switch to latest devel |
08:28:44 | * | marcus quit (Remote host closed the connection) |
08:29:54 | * | marcus joined #nim |
09:09:04 | Amun-Ra | I have a macro that constructs NimNode (it generates const x = "y" statement), how can I inject this into module? |
09:12:12 | Amun-Ra | example: https://play.nim-lang.org/#ix=4FfZ |
09:22:51 | Amun-Ra | I was missing 'const' statement, https://play.nim-lang.org/#ix=4Fg1 now macro returns Error: illformed AST: const |
09:33:39 | Amun-Ra | it was simpler that I thought: |
09:33:40 | Amun-Ra | https://play.nim-lang.org/#ix=4Fg5 |
10:04:50 | * | azimut_ joined #nim |
10:07:09 | * | azimut quit (Ping timeout: 246 seconds) |
10:18:46 | FromDiscord | <queebee> There's no way to set a timeout for a AsyncHttpClient? |
10:22:39 | FromDiscord | <odexine> https://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint |
10:28:03 | termer | That won't terminate the connection if it times out |
10:28:16 | termer | so you'll have to terminate it yourself if the Future fails |
10:28:44 | FromDiscord | <odexine> its pretty hacky yeah unfortunately |
10:28:54 | FromDiscord | <queebee> This also will timeout my future. I want to timeout my http connection |
10:29:09 | FromDiscord | <odexine> ? you can keep track of both futures |
10:29:24 | FromDiscord | <odexine> you also cant have the future still running after timing the connection out? |
10:30:46 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#ix=4Fgn |
10:32:11 | FromDiscord | <queebee> Mh. That are my first tests https://play.nim-lang.org/#ix=4Fgo |
10:34:01 | * | ntat quit (Quit: leaving) |
10:35:48 | FromDiscord | <queebee> I basically want to test a list of proxies that way. The job queue would be a list of proxies |
10:42:06 | Amun-Ra | I switched from list of consts to single enum: https://play.nim-lang.org/#ix=4Fgs |
10:47:11 | FromDiscord | <vindaar> if you ever installed the HEAD of a nimble package it will always pick that instead of a possible newer version. Maybe that's what you see?↵Aside from that the `math` imports should all be fixed by now. Unless you stumble on some other case that was overlooked↵(<@709044657232936960_om3ga=5b=49=52=43=5d>) |
10:47:44 | FromDiscord | <vindaar> the one in `operators_broadcasted` is for sure fixed though |
11:02:53 | FromDiscord | <queebee> sent a code paste, see https://play.nim-lang.org/#ix=4FgB |
11:05:45 | FromDiscord | <odexine> careful, `read` returns `T` and not `Future[T]` |
11:09:29 | FromDiscord | <odexine> i forgot the async pragma somehow lol |
11:09:41 | FromDiscord | <odexine> but you could prolly just also yield the future directly |
11:09:57 | FromDiscord | <odexine> and i'm not sure if owned still does anything |
11:23:32 | * | krux02 joined #nim |
11:58:24 | FromDiscord | <Phil> sent a long message, see http://ix.io/4FgN |
11:58:53 | FromDiscord | <Phil> (edit) "http://ix.io/4FgN" => "http://ix.io/4FgO" |
12:07:01 | FromDiscord | <odexine> in either case ("depends" or not) the queue may contain "unrelated work" |
12:07:31 | FromDiscord | <odexine> the task queue must have tasks if there is a future, otherwise `waitFor` will crash |
12:09:12 | FromDiscord | <Phil> But what if all the Future has to do is wait for an HTTP request? Is the task then just to wait 10ms and then return? |
12:11:20 | FromDiscord | <odexine> the task is to "wait for all of the content then return" |
12:11:41 | FromDiscord | <Phil> So basically there's 1 task and that 1 task blocks the thread and waits? |
12:12:15 | FromDiscord | <odexine> define "block" |
12:12:25 | FromDiscord | <odexine> because any async loop running poll will ofc block that thread |
12:12:55 | FromDiscord | <Phil> No other async task gets executed in the meantime, even if there are multiple and the current one is doing nothing since it's still waiting for a response. |
12:13:13 | FromDiscord | <odexine> no? |
12:13:16 | FromDiscord | <odexine> thats not |
12:13:41 | FromDiscord | <odexine> okay so we have futures and "tasks" right |
12:13:52 | FromDiscord | <odexine> tasks i assume is callbacks |
12:13:55 | FromDiscord | <Phil> Yes |
12:14:13 | FromDiscord | <odexine> these callbacks are basically called then the result is "keep me in the queue" or "im done" |
12:15:13 | FromDiscord | <odexine> for high level stuff like requests, a callback for that is "read all i can from a socket, put it in the future, if the socket is done remove me, if its not keep me" |
12:19:19 | FromDiscord | <Phil> sent a long message, see http://ix.io/4FgS |
12:20:15 | FromDiscord | <odexine> that is to my understanding, yes |
12:20:45 | FromDiscord | <odexine> iirc its much much much more complicated than just that |
12:21:05 | FromDiscord | <odexine> because there's the concept of timers and selectors as well (for nim's async impl |
12:21:41 | FromDiscord | <odexine> timers dictate when a callback should be processed iirc |
12:22:53 | FromDiscord | <odexine> not sure, there's just a lot to async |
12:23:26 | FromDiscord | <odexine> oh selectors and timers both dictate when a callback is to be processed |
12:25:13 | FromDiscord | <odexine> i'm confused too now lol |
12:25:36 | FromDiscord | <odexine> there's a few concepts to figure out how to link between; timers, selectors, and callbacks |
12:31:29 | FromDiscord | <Phil> I assume timer and scheduler are different names for the same thing? |
12:32:17 | FromDiscord | <odexine> no |
12:32:19 | FromDiscord | <odexine> they are not |
12:32:31 | FromDiscord | <odexine> wait, scheduler, i misread |
12:33:06 | FromDiscord | <Phil> So "yes" for scheduler being a synonym? |
12:33:16 | FromDiscord | <odexine> can you tell me what your definition of scheduler is |
12:33:42 | FromDiscord | <Phil> None, I just know the name exists and my brain has it associated with async so I was trying to form connections |
12:37:52 | FromDiscord | <odexine> i believe a scheduler would dictate how timers are made |
12:38:03 | FromDiscord | <odexine> timers are basically just countdowns for when to execute a callback |
12:38:16 | FromDiscord | <odexine> a scheduler would dictate what these countdowns should be for a callback |
12:38:17 | FromDiscord | <odexine> no? |
12:38:18 | FromDiscord | <odexine> not sure |
12:39:03 | FromDiscord | <odexine> a scheduler would also dictate processing of selectors i think but this one i have no proof xd |
12:39:52 | FromDiscord | <odexine> basically right a scheduler would dictate when tasks are processed, as a high level idea of it |
12:41:01 | FromDiscord | <Phil> Solid maybe. ↵I'm currently also staring down the docs of std/asyncdispatch and was confused for a moment that it was all solely related to files and file-descriptors, since e.g. adding a task to execute in 5 seconds or so is also a valid async usecase, though likely not the main one. |
12:41:44 | FromDiscord | <Phil> Like I'm aware that under Linux everything's a file, but I just kinda assume that e.g. me adding a task to a task-queue of "echo 'blabla' in 5 seconds" isn't really IO and has no file associated |
12:42:29 | FromDiscord | <odexine> well you're gonna have to learn about select/poll |
12:42:32 | FromDiscord | <Phil> So that std/asyncdispatch, which feels like "general async" in terms of lib naming, is focussed on solely the IO aspect is currently confusing me slightly |
12:42:43 | FromDiscord | <Phil> Alright, will read up |
12:45:21 | FromDiscord | <Phil> Okay std/selectors is not all that helpful and googling this stuff isn't exactly easy with all the noise of "how do I use async in general" muddying the waters |
12:45:58 | FromDiscord | <odexine> basically |
12:46:00 | FromDiscord | <odexine> in linux |
12:46:05 | FromDiscord | <odexine> you make a timer file descriptor xd |
12:46:45 | FromDiscord | <odexine> and the kernel will treat it like a regular fd that the select api will manage (the select api basically looks at file descriptors and says when they have things to read) |
12:47:08 | FromDiscord | <odexine> this timer fd will naturally "be ready" when the time specified has elapsed |
12:47:21 | FromDiscord | <odexine> https://jvns.ca/blog/2017/06/03/async-io-on-linux--select--poll--and-epoll/ |
12:47:38 | FromDiscord | <Phil> So basically async IO in Linux as modeled as "This is a file, and opening it takes a long ass time" ? |
12:47:50 | FromDiscord | <Phil> Reading the blogpost |
12:48:11 | FromDiscord | <odexine> In reply to @isofruit "So basically async IO": no |
12:48:31 | FromDiscord | <odexine> only applies to non-"real" files as it says in the post |
12:49:57 | FromDiscord | <odexine> naturally it's completely different on windows xd no idea there |
12:50:34 | FromDiscord | <odexine> there's also the pretty new backend called `io_uring` for linux |
12:51:22 | FromDiscord | <odexine> how low level are you aiming to learn here? |
12:53:51 | FromDiscord | <odexine> i'll be going, i'm also not too sure about all my knowledge so its prolly better to triple check with someone else as well |
12:57:25 | FromDiscord | <Phil> In reply to @odexine "how low level are": Not trying to be able to apply, just a rough but accurate grasp of the concepts is my goal |
14:21:53 | FromDiscord | <Chronos [She/Her]> I need to make bindings for wasmtime in Nim |
14:22:01 | FromDiscord | <Chronos [She/Her]> This is Pain™️ |
14:22:29 | FromDiscord | <Chronos [She/Her]> I should probably wrap all the stuff I need manually |
14:26:16 | * | raynei joined #nim |
14:38:31 | FromDiscord | <odexine> Hasn’t that been done before with another runtime |
14:46:40 | * | ntat joined #nim |
14:57:29 | FromDiscord | <Chronos [She/Her]> Wasm3, but that's an interpreter which would be fine for smaller stuff but if you're calling into Java code from the runtime, that gets kinda expensive |
15:07:24 | FromDiscord | <odexine> Have you tried it at least :baqua: |
15:11:40 | FromDiscord | <Chronos [She/Her]> I mean, no- |
15:12:05 | FromDiscord | <Chronos [She/Her]> There's also the fact I'm procrastinating on the proof of concept impl anyway- |
15:12:14 | FromDiscord | <Chronos [She/Her]> (the poc was gonna use wasm3) |
15:14:06 | * | azimut_ quit (Ping timeout: 246 seconds) |
15:14:32 | FromDiscord | <demotomohiro> Just wrapping only types/procs you use relief pain. |
15:25:11 | * | raynei quit (Ping timeout: 246 seconds) |
15:29:02 | FromDiscord | <jaar23> In reply to @jaar23 "Trying to create some": when i register the handler multiple times on diff threads. turn out i think i resolved my issues by writing a multi thread logging library myself. https://github.com/jaar23/octolog↵feel free to have a look and open up issues for me. |
15:30:21 | FromDiscord | <jaar23> (edit) "threads." => "threads, it printing more log than i expected." |
15:56:21 | FromDiscord | <jaar23> i want to declare my proc and variable to use `snake_case` eg, `do_something` instead of `doSomething`. ↵can i declare it as `do_something` in my codebase while other using my library as `doSomething` or `do_something`? |
15:59:13 | nmz | it doesn't matter |
15:59:26 | nmz | _ is eliminated, and the only uppercase that matters is the first character |
16:00:24 | nmz | the only case sensitive character that matters is the first one* |
16:03:01 | FromDiscord | <jaar23> if it is `Do_Something` , then everyone has to call it `Do_Something` instead of `DoSomething`? |
16:03:04 | FromDiscord | <Chronos [She/Her]> You should follow the conventions for Nim programming when possible tbh |
16:03:25 | FromDiscord | <jaar23> Nim conventions is camelCase? |
16:03:42 | FromDiscord | <Chronos [She/Her]> In reply to @jaar23 "if it is `Do_Something`": Nope, as long as it starts with a capital D, you can do `Dosomething`, `DoSomething` and `Do_Some_thing` |
16:03:48 | nmz | https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality |
16:04:10 | FromDiscord | <Chronos [She/Her]> In reply to @jaar23 "Nim conventions is camelCase?": Yep |
16:07:21 | * | azimut joined #nim |
16:09:04 | FromDiscord | <jaar23> 🤔 okay, but i do really like snake_case better. haha |
16:09:40 | nmz | the entire point of identifier equality is that you can have your own style in your code |
16:10:55 | nmz | So while you can do it, you're also limiting yourself to only you working in the code, if anyone helps you out and they follow the normal style, its gonna be jarring |
16:11:32 | FromDiscord | <Chronos [She/Her]> You can still use snake case, but if you plan for others to use your code, should avoid it really |
16:11:42 | FromDiscord | <Chronos [She/Her]> Tho especially if you come from Python, I get that lol |
16:13:43 | FromDiscord | <odexine> In reply to @chronos.vitaqua "You *can* still use": that is not a reason to avoid it |
16:16:35 | FromDiscord | <jaar23> i think lexical-analysis-identifier-equality is really good, it is style agnostic. however, when other working with is really a problem. ↵programmer A prefer snake_case, programmer B prefer camelCase, although we can have both live at the same place, but looking at 2 diff style is quite difficult |
16:23:07 | FromDiscord | <toma400> sent a code paste, see https://paste.rs/0lGxg |
16:28:19 | FromDiscord | <odexine> `succ` `pred`? |
16:29:07 | FromDiscord | <cedb> juliacaseftw |
16:29:11 | FromDiscord | <odexine> this does not work if your enum is "holed" |
16:39:47 | FromDiscord | <Phil> In reply to @jaar23 "i think lexical-analysis-identifier-equality is": True. However I find it not to be that big a deal.↵In a team you'll have need for coding conventions, that's just one more that you specify.↵In an open source setting it's not that big a deal to have a comment in the PR that requests converting camelCase to snake_case or vice versa |
16:40:11 | FromDiscord | <Phil> (edit) "In reply to @jaar23 "i think lexical-analysis-identifier-equality is": True. However I find it not to be that big a deal.↵In a team you'll have need for coding conventions, that's just one more that you specify.↵In an open source setting it's not that big a deal to have a comment in the PR that requests converting camelCase to snake_case or vice versa ... " added "and the PR-creator to update the PR accordingly." |
16:46:18 | * | cedb left #nim (WeeChat 4.0.4) |
17:02:00 | FromDiscord | <jaar23> In reply to @isofruit "True. However I find": yea, i agree. that PR requests may required for the repo owner who wants more hygine |
17:02:55 | FromDiscord | <Phil> In reply to @jaar23 "yea, i agree. that": I honestly don't know what managing your own lib without PRs would look like |
17:05:32 | FromDiscord | <cedb> people make too big of a deal of "style uniformity" |
17:06:22 | FromDiscord | <cedb> i see styleguides more as a way to avoid yakshaving than because mixing, idk, C declarations style |
17:06:22 | FromDiscord | <sOkam! 🫐> sent a long message, see http://ix.io/4Fio |
17:06:57 | FromDiscord | <sOkam! 🫐> standard is camelCase, but its not forced. Its only recommended |
17:18:08 | NimEventer | New post on r/nim by Xr0mpere: Les Coups d'État en Afrique : Histoire, Causes et Conséquences, see https://reddit.com/r/nim/comments/1692jnq/les_coups_détat_en_afrique_histoire_causes_et/ |
17:31:16 | FromDiscord | <jaar23> In reply to @isofruit "I honestly don't know": i mean i should. |
17:31:55 | FromDiscord | <jaar23> In reply to @heysokam "nim doesn't care, at": got it. i use whatever i used to. |
17:36:53 | FromDiscord | <kingterrytheterrible12> pov: java uni work (i learnt x86_64 assembly for this) https://media.discordapp.net/attachments/371759389889003532/1147948340848369794/image.png https://media.discordapp.net/attachments/371759389889003532/1147948341209075832/image.png |
17:38:13 | FromDiscord | <kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1147948679630688387/image.png https://media.discordapp.net/attachments/371759389889003532/1147948680041734274/image.png |
17:49:39 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "that is not a": Why not? |
17:50:26 | FromDiscord | <cedb> is school still forcing java on the youth? |
17:58:40 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "nim doesn't care, at": Autocomplete would insert the name as is using that style iirc |
18:15:09 | FromDiscord | <sOkam! 🫐> but autocomplete isn't nim, is it 🤷♂️ 🙂 |
18:15:36 | FromDiscord | <sOkam! 🫐> i see your point, though |
18:27:25 | FromDiscord | <Chronos [She/Her]> Autocomplete with Nimsuggest :p |
18:27:26 | FromDiscord | <Chronos [She/Her]> Yeah aha |
18:45:03 | termer | kingterrytheterrible12, Are you used to C# |
18:45:16 | termer | you're starting your method names with a capital letter which is a C# thing, not a Java thing |
18:45:21 | FromDiscord | <kingterrytheterrible12> In reply to @termer "<@655759729477287956>, Are you used": Yes |
18:45:30 | termer | also I think you'd have a much more enjoyable time with IntelliJ IDEA |
18:45:34 | termer | The community edition is free |
18:45:36 | FromDiscord | <kingterrytheterrible12> In reply to @termer "you're starting your method": Oh didnt know |
18:45:50 | FromDiscord | <kingterrytheterrible12> In reply to @termer "also I think you'd": Its too heavy weight for my liking |
18:46:07 | termer | It's heavy as all hell but it's so much better than everything else |
18:46:20 | FromDiscord | <kingterrytheterrible12> Idk vscode works for me |
18:46:26 | termer | It also gives you hints to help you write more idiomatic Java |
18:46:29 | FromDiscord | <kingterrytheterrible12> I like their debugger too |
18:46:42 | termer | suit yourself |
18:47:00 | FromDiscord | <kingterrytheterrible12> In reply to @termer "It also gives you": Its uni work nobody cares about anything but if your code works or not |
18:47:12 | termer | whatever works |
18:47:21 | termer | Java taught at school is always terrible and nobody likes doing it |
18:47:35 | FromDiscord | <kingterrytheterrible12> Yeah im stuck with it |
18:47:49 | FromDiscord | <kingterrytheterrible12> Until i finish this last course then we start learning the good stuff |
18:48:06 | termer | what's the good stuff |
18:48:24 | FromDiscord | <kingterrytheterrible12> Circuits operating systems databases embedded systems |
18:56:18 | FromDiscord | <kingterrytheterrible12> the new popos nvidia drivers borked audio |
18:57:31 | FromDiscord | <sOkam! 🫐> does `cstring` map in its C codegen to `const char`, `char`, `char thing[]`, or does it change between all of them depending on the context? |
18:58:26 | FromDiscord | <demotomohiro> `char` type variables can be passed to these type of parameters. |
18:59:36 | FromDiscord | <sOkam! 🫐> but are they literals or modifiable ptr char? |
19:00:02 | FromDiscord | <sOkam! 🫐> asking because in C those are different things, so wonder if cstring represents both or only literals |
19:00:17 | FromDiscord | <sOkam! 🫐> (edit) "literals" => "one or the other" |
19:01:01 | FromDiscord | <sOkam! 🫐> asking because literals cannot be modified, while char[] can... so quite a big difference |
19:01:39 | FromDiscord | <sOkam! 🫐> (edit) removed "asking because" |
19:02:21 | FromDiscord | <demotomohiro> https://en.cppreference.com/w/c/language/const |
19:17:06 | FromDiscord | <mratsim> In reply to @heysokam "literals cannot be modified,": If const, they are literals |
19:17:59 | FromDiscord | <cedb> its an alias for ptr unchecked arr iirc↵(@sOkam! 🫐) |
19:19:20 | FromDiscord | <cedb> thats from araq in internals room\: cstring = ptr UncheckedArray[char] |
19:42:33 | * | ntat quit (Quit: leaving) |
20:18:15 | * | xmachina joined #nim |
20:35:57 | FromDiscord | <toma400> In reply to @heysokam "nim doesn't care, at": I remember heavily disliking this at first, but then falling in love with the idea. It also kinda shrinks amount of issues you can have with typos, at least if you get used to not using capitalisation as a differentiation tool (bad practice overall in many cases, so it's enforcing right things). |
20:38:17 | FromDiscord | <toma400> Coding style is fascinating thing tbh, bouncing from Python into Java and then Rust I got used to all kinds of those and couldn't decide which style I love the most.↵So I kinda incorporated all of them, each for every type of data - `snake_case` is for variables, `camelCase` gets for functions/procs, `CapitalisedStyle` is for classes/structs, and `SHOUTS` are for enums (no, not constants, I never get used to shouting at these peaceful v |
20:38:49 | FromDiscord | <toma400> (edit) "get" => "got" |
20:39:53 | * | xmachina quit (Quit: WeeChat 4.0.4) |
20:45:12 | * | junaid_ quit (Remote host closed the connection) |
20:46:39 | * | lucasta joined #nim |
20:54:17 | * | xmachina joined #nim |
20:54:40 | * | xmachina quit (Client Quit) |
21:02:28 | FromDiscord | <sOkam! 🫐> In reply to @toma400 "I remember heavily disliking": pretty much |
21:03:27 | FromDiscord | <sOkam! 🫐> In reply to @cedb "thats from araq in": oh i thought it was a `ptr char` |
21:03:45 | FromDiscord | <sOkam! 🫐> (edit) "`ptr" => "`distinct ptr" |
21:08:41 | FromDiscord | <sOkam! 🫐> that completely confuses me tbh |
21:09:04 | FromDiscord | <sOkam! 🫐> I thought I had an idea of how to deal with cstrings, now I don't think I do anymore 🙈 |
21:13:06 | * | lucasta quit (Quit: Leaving) |
21:39:06 | * | azimut quit (Ping timeout: 246 seconds) |
22:28:15 | FromDiscord | <~piuvas> hiii |
22:38:27 | FromDiscord | <Elegantbeef> Hello |
22:54:37 | FromDiscord | <cedb> i tried to push him on whats the best interpretation but it sounds like something that matters if you do a lot of messy mixes of C and Nim. The only time you should think about it is before calling into C and since cstrings are a big mess you can't really have a general rule for this↵(@sOkam! 🫐) |
22:55:03 | FromDiscord | <cedb> it is a bit silly to alias such a short typedef by ootb if it yields so many questions |
22:57:18 | FromDiscord | <Elegantbeef> It's not really an alias though |
22:57:30 | FromDiscord | <cedb> nim isnt nominal? |
22:57:41 | FromDiscord | <Elegantbeef> What? |
22:58:04 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Fk0 |
22:58:23 | FromDiscord | <Elegantbeef> it's equivlent to `ptr UncheckedArray[char]`, but it's not just an alias |
22:58:40 | FromDiscord | <cedb> what does equivalence mean then |
22:58:50 | FromDiscord | <Elegantbeef> The internal representation is the same |
22:59:03 | FromDiscord | <cedb> oh wawwww |
23:00:33 | FromDiscord | <sOkam! 🫐> In reply to @cedb "i tried to push": the problem is that I am with `--mm:none` and doing a LOT of cstring stuff, since there is no regular strings in mm:none |
23:01:21 | FromDiscord | <cedb> why would you do this |
23:01:54 | FromDiscord | <sOkam! 🫐> why would I use nim, i should just use c↵or i should just use cpp, because its nicer↵or i should just use java, becuase ...↵or rust... becuase... |
23:01:59 | FromDiscord | <Elegantbeef> Sokam loathes themself |
23:02:00 | FromDiscord | <Elegantbeef> that is a joke, calm down sokam |
23:02:03 | FromDiscord | <sOkam! 🫐> you get the idea 😄 |
23:02:10 | FromDiscord | <cedb> well its pretty damn simple |
23:02:18 | FromDiscord | <Elegantbeef> Well there is little reason to using cstring over string |
23:02:21 | FromDiscord | <cedb> nim is designed with a GC in mind |
23:02:31 | FromDiscord | <Elegantbeef> You can convert a Nim string to a C string with 0 overhead |
23:02:31 | FromDiscord | <sOkam! 🫐> it is simple. im trying to write C-like code, without having to touch C typeless crap |
23:02:39 | FromDiscord | <Elegantbeef> As long as the C library doesnt take ownership |
23:02:44 | FromDiscord | <cedb> that is /not/ simple |
23:02:47 | FromDiscord | <sOkam! 🫐> nim is a much better C replacement, and I want to do things like that |
23:03:01 | FromDiscord | <cedb> mistakes all around |
23:03:03 | FromDiscord | <Elegantbeef> Sokam is doing something odd, just leave it at that |
23:03:34 | FromDiscord | <sOkam! 🫐> its not my main project, i write with normal GC stuff always. but the goal of that project is to write mm:none as if it was C, but without all of the C problems that nim solves reaaaaally well, even without a gc |
23:03:41 | FromDiscord | <cedb> id expect turning off any memory management is mostly targetted for bootstrapping |
23:03:57 | FromDiscord | <sOkam! 🫐> In reply to @cedb "id expect turning off": because you are looking at it from the giga-optimizer mindset |
23:04:09 | FromDiscord | <sOkam! 🫐> its ok to NOT do optimized stuff, just fun stuff |
23:04:24 | FromDiscord | <sOkam! 🫐> because it teaches you, simply because of that |
23:04:29 | FromDiscord | <cedb> do you think what you think is optimal? |
23:04:44 | FromDiscord | <sOkam! 🫐> i just said the opposite? |
23:04:52 | FromDiscord | <cedb> honnestly the last 20 years have been ruined by this like |
23:05:08 | FromDiscord | <cedb> "I DONT NEED A GC OR ANY MM I HAVE CHEST HAIR" |
23:05:24 | FromDiscord | <sOkam! 🫐> i just said literally the opposite |
23:05:35 | FromDiscord | <sOkam! 🫐> i do -not- write code in my main project like that |
23:06:38 | FromDiscord | <cedb> yaya i get it you wanna get your hands dirty on lower level nonsense |
23:07:23 | FromDiscord | <sOkam! 🫐> learning the -why- of things is not nonsense, is just a form of knowledge |
23:07:56 | FromDiscord | <sOkam! 🫐> being a nazi about low level only DIY all no dependencies is a problem. and im not that person |
23:12:53 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "it's equivlent to `ptr": i thought you said its a distinct ptr char. i was trusting that from that point of view |
23:13:25 | FromDiscord | <Elegantbeef> It's all the same |
23:13:25 | FromDiscord | <Elegantbeef> We're talking about the internal representation |
23:13:33 | FromDiscord | <Elegantbeef> Nim does not see it as anything special it's magic |
23:14:36 | FromDiscord | <Elegantbeef> Which of course means it's down to code gen to handle the resultant C type and `char` and `char[]` are the same |
23:19:40 | FromDiscord | <cedb> really really sounds like something you shouldnt have to think about unless you know how memory shenanigans work in C itself + calling conventions ABI, elf structure etc |
23:24:09 | FromDiscord | <sOkam! 🫐> it just sounds like something you dont want to have to think about, not something nobody should think about |
23:36:59 | * | krux02 quit (Remote host closed the connection) |
23:55:44 | FromDiscord | <steslos> sent a code paste, see https://play.nim-lang.org/#ix=4Fk7 |
23:56:34 | FromDiscord | <Chronos [She/Her]> In reply to @heysokam "its not my main": Why not just use arc? |
23:57:17 | FromDiscord | <Chronos [She/Her]> Ah just for low-level testing stuff, fair enough |