<< 03-09-2023 >>

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:01FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4Fev
00:06:11FromDiscord<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:17FromDiscord<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:46FromDiscord<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:35FromDiscord<BanannaMan> Array vs seq. Which one does what better and why?
00:31:01FromDiscord<Elegantbeef> They're the same thing but one is runtime sized
00:34:59FromDiscord<sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=4FeA
00:37:15FromDiscord<Chronos [She/Her]> Fair enough
00:37:15FromDiscord<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:15FromDiscord<BanannaMan> In reply to @Elegantbeef "They're the same thing": Thanks, bot buddy.
00:57:59FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Hm, does anyone know": Just gonna make a macro for it lol
00:58:24FromDiscord<Elegantbeef> You don't need a macro
00:59:43FromDiscord<Chronos [She/Her]> Really?
00:59:54FromDiscord<Chronos [She/Her]> How else would I do it?
01:00:01FromDiscord<Chronos [She/Her]> I mean, I could do a template
01:00:22FromDiscord<Chronos [She/Her]> Yeah I'll do that then
01:00:26FromDiscord<Elegantbeef> A proc
01:00:28FromDiscord<Elegantbeef> Use a proc
01:00:36FromDiscord<Chronos [She/Her]> Actually a proc works
01:00:37FromDiscord<Chronos [She/Her]> Yeah
01:00:38FromDiscord<huantian> Lmao
01:00:48FromDiscord<Chronos [She/Her]> My brain is never working sorry lmao
01:01:03FromDiscord<Chronos [She/Her]> I was thinking of using a macro to avoid assignment initially
01:02:26FromDiscord<Elegantbeef> `mySeq.toArray(0..16)` 😄
01:02:42FromDiscord<Chronos [She/Her]> Is that actually a thing or?
01:02:48FromDiscord<Chronos [She/Her]> I swear I tried it
01:03:18FromDiscord<Chronos [She/Her]> No it isn't
01:09:52FromDiscord<Chronos [She/Her]> Ah, how do I check if a sequence has a value at an index?
01:10:58FromDiscord<Chronos [She/Her]> Catching defects isn't super ideal
01:13:43FromDiscord<Elegantbeef> if `mySeq.high in a..b`
01:25:22FromDiscord<Chronos [She/Her]> Pain
01:26:02FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeH
01:26:24FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeI
01:26:27FromDiscord<Elegantbeef> `static Range`
01:26:32FromDiscord<Chronos [She/Her]> Ah
01:26:34FromDiscord<Elegantbeef> sorry `static slice[int]`
01:26:52FromDiscord<Elegantbeef> Outside of type sections `..` is a `Slice`
01:27:08FromDiscord<Chronos [She/Her]> Ah
01:28:23FromDiscord<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:29FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4FeJ
01:31:55FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4FeK
01:33:46FromDiscord<Chronos [She/Her]> I... Never knew you could do it like that, huh
01:33:48FromDiscord<Chronos [She/Her]> Neat
01:35:56FromDiscord<Chronos [She/Her]> Fuck yeah! My code works now!
01:40:56FromDiscord<dedraiaken> sent a code paste, see https://paste.rs/kofrr
01:42:51FromDiscord<Elegantbeef> `system.len(x)`
01:44:28FromDiscord<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:03FromDiscord<Chronos [She/Her]> Hm... My base32 impl doesn't add a 0 at the start, should I add that or something?
02:02:45FromDiscord<Elegantbeef> Huh?
02:04:34FromDiscord<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:36FromDiscord<Chronos [She/Her]> But yeah
02:39:12*xet7 joined #nim
03:13:44FromDiscord<jviega> Yes, my ULIDS all correctly start w 0
03:16:03FromDiscord<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:18FromDiscord<Chronos [She/Her]> I just append '0' to my ULIDs manually for now (they're read correctly tho)
03:16:19FromDiscord<jviega> It's in that nimutils package, in encodings.nim
03:16:24FromDiscord<Chronos [She/Her]> Thanks!
03:17:58FromDiscord<jviega> There's a function in there to re-extract the timestamp if you want to check it better
03:18:05FromDiscord<Chronos [She/Her]> Heah that's uh gibberish to me
03:18:38FromDiscord<Chronos [She/Her]> https://github.com/Yu-Vitaqua-fer-Chronos/NULID and https://github.com/Yu-Vitaqua-fer-Chronos/Crockford-Base32-Nim
03:18:41FromDiscord<Chronos [She/Her]> Those are my repos
03:18:57FromDiscord<jviega> `x.ulidToTimeStamp()` will go from a ulid back to a timestamp.
03:19:11FromDiscord<Chronos [She/Her]> Yeah my code does that too
03:19:29FromDiscord<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:16FromDiscord<jviega> Well I don't know how you're doing to conversion but string-to-number functions tend to drop leading zeros
03:21:04FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4FeX
03:21:08FromDiscord<Chronos [She/Her]> That's the entirety of my encoder lol
03:25:37FromDiscord<Chronos [She/Her]> I think it's bc I immediately terminate the loop instead of continuing for the last iteration
03:25:41FromDiscord<Chronos [She/Her]> But idk
03:33:42FromDiscord<jviega> Yeah, you're going to drop trailing zeros too because of the 'while num > 0'
03:35:33FromDiscord<Chronos [She/Her]> Makes sense
03:36:39FromDiscord<jviega> Adding the extra zero is a non-issue, ULIDS won't use that byte in our lifetimes
03:40:17FromDiscord<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:22FromDiscord<griffith1deadly> In reply to @heysokam "`confy-droid` sounds catchy 🙂": for android build (for apk) need gradle android template, nimx create this
05:31:52FromDiscord<griffith1deadly> ios maybe too like this
06:25:50om3ga.nimble/pkgs/arraymancer-0.7.17/arraymancer/tensor/operators_broadcasted.nim(18, 9) Error: cannot open file: ./math
06:26:51FromDiscord<Elegantbeef> update arraymancer
06:56:54*jmdaemon joined #nim
07:26:25FromDiscord<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:15FromDiscord<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:56om3gaElegantbeef, no, unfortunately not works
07:39:09FromDiscord<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:10om3gait's in Mac
07:39:23om3ga[email protected]
07:39:26FromDiscord<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:52FromDiscord<Elegantbeef> https://github.com/mratsim/Arraymancer/blob/master/arraymancer.nimble#L2
07:42:55FromDiscord<Elegantbeef> It's not the most recent om3ga
07:43:36om3gastrange, I run install from git
07:43:51FromDiscord<Elegantbeef> It's not tagged though
07:43:52FromDiscord<Phil> sent a long message, see http://ix.io/4Ffw
07:44:01FromDiscord<Elegantbeef> Which means you need to use `@#head`
07:44:17om3gathanks, I will try again
08:11:13om3gaElegantbeef, nah, nimble install arraymancer@#head <- installed using this command
08:12:41om3gasomething 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:04Amun-RaI have a macro that constructs NimNode (it generates const x = "y" statement), how can I inject this into module?
09:12:12Amun-Raexample: https://play.nim-lang.org/#ix=4FfZ
09:22:51Amun-RaI was missing 'const' statement, https://play.nim-lang.org/#ix=4Fg1 now macro returns Error: illformed AST: const
09:33:39Amun-Rait was simpler that I thought:
09:33:40Amun-Rahttps://play.nim-lang.org/#ix=4Fg5
10:04:50*azimut_ joined #nim
10:07:09*azimut quit (Ping timeout: 246 seconds)
10:18:46FromDiscord<queebee> There's no way to set a timeout for a AsyncHttpClient?
10:22:39FromDiscord<odexine> https://nim-lang.org/docs/asyncdispatch.html#withTimeout%2CFuture%5BT%5D%2Cint
10:28:03termerThat won't terminate the connection if it times out
10:28:16termerso you'll have to terminate it yourself if the Future fails
10:28:44FromDiscord<odexine> its pretty hacky yeah unfortunately
10:28:54FromDiscord<queebee> This also will timeout my future. I want to timeout my http connection
10:29:09FromDiscord<odexine> ? you can keep track of both futures
10:29:24FromDiscord<odexine> you also cant have the future still running after timing the connection out?
10:30:46FromDiscord<odexine> sent a code paste, see https://play.nim-lang.org/#ix=4Fgn
10:32:11FromDiscord<queebee> Mh. That are my first tests https://play.nim-lang.org/#ix=4Fgo
10:34:01*ntat quit (Quit: leaving)
10:35:48FromDiscord<queebee> I basically want to test a list of proxies that way. The job queue would be a list of proxies
10:42:06Amun-RaI switched from list of consts to single enum: https://play.nim-lang.org/#ix=4Fgs
10:47:11FromDiscord<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:44FromDiscord<vindaar> the one in `operators_broadcasted` is for sure fixed though
11:02:53FromDiscord<queebee> sent a code paste, see https://play.nim-lang.org/#ix=4FgB
11:05:45FromDiscord<odexine> careful, `read` returns `T` and not `Future[T]`
11:09:29FromDiscord<odexine> i forgot the async pragma somehow lol
11:09:41FromDiscord<odexine> but you could prolly just also yield the future directly
11:09:57FromDiscord<odexine> and i'm not sure if owned still does anything
11:23:32*krux02 joined #nim
11:58:24FromDiscord<Phil> sent a long message, see http://ix.io/4FgN
11:58:53FromDiscord<Phil> (edit) "http://ix.io/4FgN" => "http://ix.io/4FgO"
12:07:01FromDiscord<odexine> in either case ("depends" or not) the queue may contain "unrelated work"
12:07:31FromDiscord<odexine> the task queue must have tasks if there is a future, otherwise `waitFor` will crash
12:09:12FromDiscord<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:20FromDiscord<odexine> the task is to "wait for all of the content then return"
12:11:41FromDiscord<Phil> So basically there's 1 task and that 1 task blocks the thread and waits?
12:12:15FromDiscord<odexine> define "block"
12:12:25FromDiscord<odexine> because any async loop running poll will ofc block that thread
12:12:55FromDiscord<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:13FromDiscord<odexine> no?
12:13:16FromDiscord<odexine> thats not
12:13:41FromDiscord<odexine> okay so we have futures and "tasks" right
12:13:52FromDiscord<odexine> tasks i assume is callbacks
12:13:55FromDiscord<Phil> Yes
12:14:13FromDiscord<odexine> these callbacks are basically called then the result is "keep me in the queue" or "im done"
12:15:13FromDiscord<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:19FromDiscord<Phil> sent a long message, see http://ix.io/4FgS
12:20:15FromDiscord<odexine> that is to my understanding, yes
12:20:45FromDiscord<odexine> iirc its much much much more complicated than just that
12:21:05FromDiscord<odexine> because there's the concept of timers and selectors as well (for nim's async impl
12:21:41FromDiscord<odexine> timers dictate when a callback should be processed iirc
12:22:53FromDiscord<odexine> not sure, there's just a lot to async
12:23:26FromDiscord<odexine> oh selectors and timers both dictate when a callback is to be processed
12:25:13FromDiscord<odexine> i'm confused too now lol
12:25:36FromDiscord<odexine> there's a few concepts to figure out how to link between; timers, selectors, and callbacks
12:31:29FromDiscord<Phil> I assume timer and scheduler are different names for the same thing?
12:32:17FromDiscord<odexine> no
12:32:19FromDiscord<odexine> they are not
12:32:31FromDiscord<odexine> wait, scheduler, i misread
12:33:06FromDiscord<Phil> So "yes" for scheduler being a synonym?
12:33:16FromDiscord<odexine> can you tell me what your definition of scheduler is
12:33:42FromDiscord<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:52FromDiscord<odexine> i believe a scheduler would dictate how timers are made
12:38:03FromDiscord<odexine> timers are basically just countdowns for when to execute a callback
12:38:16FromDiscord<odexine> a scheduler would dictate what these countdowns should be for a callback
12:38:17FromDiscord<odexine> no?
12:38:18FromDiscord<odexine> not sure
12:39:03FromDiscord<odexine> a scheduler would also dictate processing of selectors i think but this one i have no proof xd
12:39:52FromDiscord<odexine> basically right a scheduler would dictate when tasks are processed, as a high level idea of it
12:41:01FromDiscord<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:44FromDiscord<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:29FromDiscord<odexine> well you're gonna have to learn about select/poll
12:42:32FromDiscord<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:43FromDiscord<Phil> Alright, will read up
12:45:21FromDiscord<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:58FromDiscord<odexine> basically
12:46:00FromDiscord<odexine> in linux
12:46:05FromDiscord<odexine> you make a timer file descriptor xd
12:46:45FromDiscord<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:08FromDiscord<odexine> this timer fd will naturally "be ready" when the time specified has elapsed
12:47:21FromDiscord<odexine> https://jvns.ca/blog/2017/06/03/async-io-on-linux--select--poll--and-epoll/
12:47:38FromDiscord<Phil> So basically async IO in Linux as modeled as "This is a file, and opening it takes a long ass time" ?
12:47:50FromDiscord<Phil> Reading the blogpost
12:48:11FromDiscord<odexine> In reply to @isofruit "So basically async IO": no
12:48:31FromDiscord<odexine> only applies to non-"real" files as it says in the post
12:49:57FromDiscord<odexine> naturally it's completely different on windows xd no idea there
12:50:34FromDiscord<odexine> there's also the pretty new backend called `io_uring` for linux
12:51:22FromDiscord<odexine> how low level are you aiming to learn here?
12:53:51FromDiscord<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:25FromDiscord<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:53FromDiscord<Chronos [She/Her]> I need to make bindings for wasmtime in Nim
14:22:01FromDiscord<Chronos [She/Her]> This is Pain™️
14:22:29FromDiscord<Chronos [She/Her]> I should probably wrap all the stuff I need manually
14:26:16*raynei joined #nim
14:38:31FromDiscord<odexine> Hasn’t that been done before with another runtime
14:46:40*ntat joined #nim
14:57:29FromDiscord<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:24FromDiscord<odexine> Have you tried it at least :baqua:
15:11:40FromDiscord<Chronos [She/Her]> I mean, no-
15:12:05FromDiscord<Chronos [She/Her]> There's also the fact I'm procrastinating on the proof of concept impl anyway-
15:12:14FromDiscord<Chronos [She/Her]> (the poc was gonna use wasm3)
15:14:06*azimut_ quit (Ping timeout: 246 seconds)
15:14:32FromDiscord<demotomohiro> Just wrapping only types/procs you use relief pain.
15:25:11*raynei quit (Ping timeout: 246 seconds)
15:29:02FromDiscord<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:21FromDiscord<jaar23> (edit) "threads." => "threads, it printing more log than i expected."
15:56:21FromDiscord<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:13nmzit doesn't matter
15:59:26nmz_ is eliminated, and the only uppercase that matters is the first character
16:00:24nmzthe only case sensitive character that matters is the first one*
16:03:01FromDiscord<jaar23> if it is `Do_Something` , then everyone has to call it `Do_Something` instead of `DoSomething`?
16:03:04FromDiscord<Chronos [She/Her]> You should follow the conventions for Nim programming when possible tbh
16:03:25FromDiscord<jaar23> Nim conventions is camelCase?
16:03:42FromDiscord<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:48nmzhttps://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
16:04:10FromDiscord<Chronos [She/Her]> In reply to @jaar23 "Nim conventions is camelCase?": Yep
16:07:21*azimut joined #nim
16:09:04FromDiscord<jaar23> 🤔 okay, but i do really like snake_case better. haha
16:09:40nmzthe entire point of identifier equality is that you can have your own style in your code
16:10:55nmzSo 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:32FromDiscord<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:42FromDiscord<Chronos [She/Her]> Tho especially if you come from Python, I get that lol
16:13:43FromDiscord<odexine> In reply to @chronos.vitaqua "You *can* still use": that is not a reason to avoid it
16:16:35FromDiscord<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:07FromDiscord<toma400> sent a code paste, see https://paste.rs/0lGxg
16:28:19FromDiscord<odexine> `succ` `pred`?
16:29:07FromDiscord<cedb> juliacaseftw
16:29:11FromDiscord<odexine> this does not work if your enum is "holed"
16:39:47FromDiscord<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:11FromDiscord<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:00FromDiscord<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:55FromDiscord<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:32FromDiscord<cedb> people make too big of a deal of "style uniformity"
17:06:22FromDiscord<cedb> i see styleguides more as a way to avoid yakshaving than because mixing, idk, C declarations style
17:06:22FromDiscord<sOkam! 🫐> sent a long message, see http://ix.io/4Fio
17:06:57FromDiscord<sOkam! 🫐> standard is camelCase, but its not forced. Its only recommended
17:18:08NimEventerNew 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:16FromDiscord<jaar23> In reply to @isofruit "I honestly don't know": i mean i should.
17:31:55FromDiscord<jaar23> In reply to @heysokam "nim doesn't care, at": got it. i use whatever i used to.
17:36:53FromDiscord<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:13FromDiscord<kingterrytheterrible12> https://media.discordapp.net/attachments/371759389889003532/1147948679630688387/image.png https://media.discordapp.net/attachments/371759389889003532/1147948680041734274/image.png
17:49:39FromDiscord<Chronos [She/Her]> In reply to @odexine "that is not a": Why not?
17:50:26FromDiscord<cedb> is school still forcing java on the youth?
17:58:40FromDiscord<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:09FromDiscord<sOkam! 🫐> but autocomplete isn't nim, is it 🤷‍♂️ 🙂
18:15:36FromDiscord<sOkam! 🫐> i see your point, though
18:27:25FromDiscord<Chronos [She/Her]> Autocomplete with Nimsuggest :p
18:27:26FromDiscord<Chronos [She/Her]> Yeah aha
18:45:03termerkingterrytheterrible12, Are you used to C#
18:45:16termeryou're starting your method names with a capital letter which is a C# thing, not a Java thing
18:45:21FromDiscord<kingterrytheterrible12> In reply to @termer "<@655759729477287956>, Are you used": Yes
18:45:30termeralso I think you'd have a much more enjoyable time with IntelliJ IDEA
18:45:34termerThe community edition is free
18:45:36FromDiscord<kingterrytheterrible12> In reply to @termer "you're starting your method": Oh didnt know
18:45:50FromDiscord<kingterrytheterrible12> In reply to @termer "also I think you'd": Its too heavy weight for my liking
18:46:07termerIt's heavy as all hell but it's so much better than everything else
18:46:20FromDiscord<kingterrytheterrible12> Idk vscode works for me
18:46:26termerIt also gives you hints to help you write more idiomatic Java
18:46:29FromDiscord<kingterrytheterrible12> I like their debugger too
18:46:42termersuit yourself
18:47:00FromDiscord<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:12termerwhatever works
18:47:21termerJava taught at school is always terrible and nobody likes doing it
18:47:35FromDiscord<kingterrytheterrible12> Yeah im stuck with it
18:47:49FromDiscord<kingterrytheterrible12> Until i finish this last course then we start learning the good stuff
18:48:06termerwhat's the good stuff
18:48:24FromDiscord<kingterrytheterrible12> Circuits operating systems databases embedded systems
18:56:18FromDiscord<kingterrytheterrible12> the new popos nvidia drivers borked audio
18:57:31FromDiscord<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:26FromDiscord<demotomohiro> `char` type variables can be passed to these type of parameters.
18:59:36FromDiscord<sOkam! 🫐> but are they literals or modifiable ptr char?
19:00:02FromDiscord<sOkam! 🫐> asking because in C those are different things, so wonder if cstring represents both or only literals
19:00:17FromDiscord<sOkam! 🫐> (edit) "literals" => "one or the other"
19:01:01FromDiscord<sOkam! 🫐> asking because literals cannot be modified, while char[] can... so quite a big difference
19:01:39FromDiscord<sOkam! 🫐> (edit) removed "asking because"
19:02:21FromDiscord<demotomohiro> https://en.cppreference.com/w/c/language/const
19:17:06FromDiscord<mratsim> In reply to @heysokam "literals cannot be modified,": If const, they are literals
19:17:59FromDiscord<cedb> its an alias for ptr unchecked arr iirc↵(@sOkam! 🫐)
19:19:20FromDiscord<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:57FromDiscord<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:17FromDiscord<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:49FromDiscord<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:28FromDiscord<sOkam! 🫐> In reply to @toma400 "I remember heavily disliking": pretty much
21:03:27FromDiscord<sOkam! 🫐> In reply to @cedb "thats from araq in": oh i thought it was a `ptr char`
21:03:45FromDiscord<sOkam! 🫐> (edit) "`ptr" => "`distinct ptr"
21:08:41FromDiscord<sOkam! 🫐> that completely confuses me tbh
21:09:04FromDiscord<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:15FromDiscord<~piuvas> hiii
22:38:27FromDiscord<Elegantbeef> Hello
22:54:37FromDiscord<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:03FromDiscord<cedb> it is a bit silly to alias such a short typedef by ootb if it yields so many questions
22:57:18FromDiscord<Elegantbeef> It's not really an alias though
22:57:30FromDiscord<cedb> nim isnt nominal?
22:57:41FromDiscord<Elegantbeef> What?
22:58:04FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Fk0
22:58:23FromDiscord<Elegantbeef> it's equivlent to `ptr UncheckedArray[char]`, but it's not just an alias
22:58:40FromDiscord<cedb> what does equivalence mean then
22:58:50FromDiscord<Elegantbeef> The internal representation is the same
22:59:03FromDiscord<cedb> oh wawwww
23:00:33FromDiscord<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:21FromDiscord<cedb> why would you do this
23:01:54FromDiscord<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:59FromDiscord<Elegantbeef> Sokam loathes themself
23:02:00FromDiscord<Elegantbeef> that is a joke, calm down sokam
23:02:03FromDiscord<sOkam! 🫐> you get the idea 😄
23:02:10FromDiscord<cedb> well its pretty damn simple
23:02:18FromDiscord<Elegantbeef> Well there is little reason to using cstring over string
23:02:21FromDiscord<cedb> nim is designed with a GC in mind
23:02:31FromDiscord<Elegantbeef> You can convert a Nim string to a C string with 0 overhead
23:02:31FromDiscord<sOkam! 🫐> it is simple. im trying to write C-like code, without having to touch C typeless crap
23:02:39FromDiscord<Elegantbeef> As long as the C library doesnt take ownership
23:02:44FromDiscord<cedb> that is /not/ simple
23:02:47FromDiscord<sOkam! 🫐> nim is a much better C replacement, and I want to do things like that
23:03:01FromDiscord<cedb> mistakes all around
23:03:03FromDiscord<Elegantbeef> Sokam is doing something odd, just leave it at that
23:03:34FromDiscord<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:41FromDiscord<cedb> id expect turning off any memory management is mostly targetted for bootstrapping
23:03:57FromDiscord<sOkam! 🫐> In reply to @cedb "id expect turning off": because you are looking at it from the giga-optimizer mindset
23:04:09FromDiscord<sOkam! 🫐> its ok to NOT do optimized stuff, just fun stuff
23:04:24FromDiscord<sOkam! 🫐> because it teaches you, simply because of that
23:04:29FromDiscord<cedb> do you think what you think is optimal?
23:04:44FromDiscord<sOkam! 🫐> i just said the opposite?
23:04:52FromDiscord<cedb> honnestly the last 20 years have been ruined by this like
23:05:08FromDiscord<cedb> "I DONT NEED A GC OR ANY MM I HAVE CHEST HAIR"
23:05:24FromDiscord<sOkam! 🫐> i just said literally the opposite
23:05:35FromDiscord<sOkam! 🫐> i do -not- write code in my main project like that
23:06:38FromDiscord<cedb> yaya i get it you wanna get your hands dirty on lower level nonsense
23:07:23FromDiscord<sOkam! 🫐> learning the -why- of things is not nonsense, is just a form of knowledge
23:07:56FromDiscord<sOkam! 🫐> being a nazi about low level only DIY all no dependencies is a problem. and im not that person
23:12:53FromDiscord<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:25FromDiscord<Elegantbeef> It's all the same
23:13:25FromDiscord<Elegantbeef> We're talking about the internal representation
23:13:33FromDiscord<Elegantbeef> Nim does not see it as anything special it's magic
23:14:36FromDiscord<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:40FromDiscord<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:09FromDiscord<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:44FromDiscord<steslos> sent a code paste, see https://play.nim-lang.org/#ix=4Fk7
23:56:34FromDiscord<Chronos [She/Her]> In reply to @heysokam "its not my main": Why not just use arc?
23:57:17FromDiscord<Chronos [She/Her]> Ah just for low-level testing stuff, fair enough