00:02:04 | * | beholders_eye quit (Ping timeout: 245 seconds) |
00:45:42 | FromDiscord | <ant2024> What's a nim equivalent to rustls? Or just any good tls package |
00:45:50 | FromDiscord | <ant2024> (edit) "package" => "nimble" |
01:11:53 | FromDiscord | <Elegantbeef> https://github.com/thechampagne/rustls-nim there is this, but https://nimble.directory/search?query=tls |
01:12:00 | * | rockcavera joined #nim |
01:19:54 | * | SchweinDeBurg joined #nim |
01:23:36 | * | aikaeksen quit (Quit: Client closed) |
01:47:53 | * | lucasta joined #nim |
01:57:01 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
02:20:21 | * | fallback quit (Quit: IRCNow and Forever!) |
02:42:23 | * | fallback joined #nim |
02:42:43 | * | fallback quit (Client Quit) |
03:06:19 | * | fallback joined #nim |
03:18:14 | FromDiscord | <omareladly> Are there Nim programming books ?? |
03:18:26 | FromDiscord | <omareladly> And are there free ones ? |
03:35:35 | FromDiscord | <goerge_lsd> https://letmegooglethat.com/?q=nim+programming+books |
03:37:05 | FromDiscord | <goerge_lsd> the free one: https://nimprogrammingbook.com/ |
03:46:34 | * | rockcavera quit (Read error: Connection reset by peer) |
03:46:53 | * | rockcavera joined #nim |
03:46:54 | * | rockcavera quit (Changing host) |
03:46:54 | * | rockcavera joined #nim |
03:55:44 | FromDiscord | <demotomohiro> Official Nim tutorial and manual are not books but free and good for learning. |
03:56:25 | * | rockcavera quit (Remote host closed the connection) |
04:06:17 | * | SchweinDeBurg joined #nim |
04:22:38 | FromDiscord | <omareladly> In reply to @goerge_lsd "https://letmegooglethat.com/?q=nim+programming+book": Than you |
04:23:06 | FromDiscord | <omareladly> In reply to @demotomohiro "Official Nim tutorial and": Yeah, they are but books tend to be like discussion with the author |
04:23:43 | FromDiscord | <omareladly> In reply to @goerge_lsd "the free one: https://nimprogrammingbook.com/": I was trying to make sure it’s an official |
04:36:09 | FromDiscord | <albassort> you can only learn to code, by coding |
04:36:14 | FromDiscord | <albassort> so i would recommend you just uhhhhhh do it |
04:36:19 | FromDiscord | <albassort> JUST DO IT |
04:36:55 | FromDiscord | <koaledu> Common albassort W take |
04:38:23 | * | lucasta quit (Quit: Leaving) |
04:41:05 | FromDiscord | <morgan (ping with reply)> anyone done dynamic runtime function generation? i want to debug my opengl code and i'd like to see all the gl func calls printed out, which i think requires dynamically generating a function for every function, which takes in the required inputs and passes them to the actual function and then stdout.write its name and ideally also the inputs |
04:41:58 | FromDiscord | <Elegantbeef> If someone has used a macro they have done this 😄 |
04:42:09 | FromDiscord | <morgan (ping with reply)> i could also modify all the proc updates from the loader to add some macro which replaces it with a wrapped form |
04:42:31 | FromDiscord | <albassort> this is reading the call stack ::) |
04:42:35 | FromDiscord | <Elegantbeef> Since opengl is preloaded you can make a DLL that interecepts the gl calls and prints them |
04:42:37 | FromDiscord | <albassort> (edit) "::)" => "::), which macros can do" |
04:42:46 | FromDiscord | <morgan (ping with reply)> ooh right the call stack |
04:43:21 | FromDiscord | <morgan (ping with reply)> i might be easiest to make a macro and actually insert it into all the gl redefs |
04:43:25 | FromDiscord | <Elegantbeef> is dynamically loaded\ |
04:44:05 | * | ntat joined #nim |
04:46:15 | FromDiscord | <morgan (ping with reply)> all the redefs seem to be of the form `glCullFace = cast[proc (mode: GLenum) {.stdcall.}](load("glCullFace"))`, so i could make a debug macro which i insert around the cast, and transform that ast (if some define) to a proc def which takes the same inputs and outputs and calls that loaded proc ptr |
04:46:52 | FromDiscord | <Elegantbeef> I might be wrong but you can just make a dynamic library with the procs if you really wanted |
04:47:27 | FromDiscord | <morgan (ping with reply)> i probably could |
04:48:44 | FromDiscord | <morgan (ping with reply)> i want to have something which doesn't need to be special cased for all these things so it would be easy to add to if i was to regen this opengl loader with more extensions and copy in new stuff |
04:49:26 | FromDiscord | <Elegantbeef> Right a macro that handles the logic seems the simplest |
04:49:41 | FromDiscord | <Elegantbeef> So you can then just `myMacro: # proc defs here` |
04:49:46 | FromDiscord | <morgan (ping with reply)> i think im gonna look at the ast of that and some others and see if i can figure out a macro to generate a wrapping proc def |
04:50:01 | FromDiscord | <morgan (ping with reply)> oh to like handle the list of all of them in a loop |
04:50:17 | FromDiscord | <morgan (ping with reply)> i was thinking inserting it on each line but that sounds easier to add in |
04:50:35 | FromDiscord | <morgan (ping with reply)> since it's broken up into a bunch of different functions (each gl version, each extension) |
04:50:47 | FromDiscord | <Elegantbeef> Yea you can just process the entire stmtlist of definitions |
04:51:22 | FromDiscord | <Elegantbeef> I do have to ask, are you using the opengl debug hook? |
04:52:05 | FromDiscord | <morgan (ping with reply)> not that i know of |
04:52:36 | FromDiscord | <Elegantbeef> Well that gives you diagnostics when you pass incorrect parameters or attempt to misuse resources |
04:52:37 | FromDiscord | <Elegantbeef> So set that up |
04:52:45 | FromDiscord | <morgan (ping with reply)> ah ill look into it |
04:52:48 | FromDiscord | <morgan (ping with reply)> i was suggested renderdoc but it's not on mac so i can't use that |
04:53:50 | FromDiscord | <morgan (ping with reply)> i have a working opengl code, but im trying to figure out why my library, with inputs that should match my existing working example, isn't working (just clear color, no shader doesn't do default draw white if present for whatever reason) |
04:54:21 | FromDiscord | <Elegantbeef> Time to move to a better dev environment↵(@morgan (ping with reply)) |
04:54:42 | FromDiscord | <morgan (ping with reply)> ¯\_(ツ)_/¯ |
04:55:01 | FromDiscord | <Elegantbeef> It's surprising there is no mac build given it's on other platforms |
04:55:30 | FromDiscord | <morgan (ping with reply)> apparently there was some issue and it was too much work for them and they canned their alpha version |
04:55:42 | FromDiscord | <morgan (ping with reply)> idr what the reason was |
04:55:57 | FromDiscord | <morgan (ping with reply)> it built mostly ok but didn;t work iirc |
04:56:03 | FromDiscord | <Elegantbeef> Well yea not like opengl is common anymore on mac |
04:58:25 | FromDiscord | <morgan (ping with reply)> yeah |
04:58:31 | FromDiscord | <morgan (ping with reply)> working but not well supported |
05:01:47 | FromDiscord | <morgan (ping with reply)> eventually i'd like to have metal/vulkan/moltenvk (which would require redoing my shader system to at least parse a full AST rather than just a ASlisT, if i was to even keep the same shader syntax) but i do want to keep gl3.3 for compat, since i think it is all i need and support for that goes back quite a bit |
05:40:22 | FromDiscord | <morgan (ping with reply)> ok so looking into it, the ARB and KHR debug extensions seem to be unsupported in apple's opengl impl |
05:40:36 | FromDiscord | <morgan (ping with reply)> which is annoying |
05:40:47 | FromDiscord | <morgan (ping with reply)> but i will go back to looking into macros for it |
05:41:09 | FromDiscord | <morgan (ping with reply)> getting a list of what was called and what was input to it is what i want, regardless of how i get it |
05:42:52 | FromDiscord | <morgan (ping with reply)> which is funny considering that the KHR ext has 3 authors employed at apple lol |
05:43:23 | FromDiscord | <morgan (ping with reply)> (edit) "which" => "the lack of support" | "the lack of supportis ... funny" added "kinda" |
05:49:41 | * | _________ quit (Ping timeout: 248 seconds) |
05:51:51 | * | _________ joined #nim |
06:07:37 | FromDiscord | <morgan (ping with reply)> well ill work on it more tomorrow but i worked out roughly the ast transformation i gotta do to it |
07:14:58 | * | ntat quit (Quit: Leaving) |
07:27:44 | * | coldfeet joined #nim |
07:33:45 | FromDiscord | <Dorothy Allen> sent a long message, see https://pasty.ee/RCEnkGWm |
07:38:19 | * | def- quit (Quit: -) |
07:38:34 | * | coldfeet quit (Remote host closed the connection) |
07:38:44 | * | def- joined #nim |
07:41:48 | * | def- quit (Client Quit) |
07:42:36 | * | def- joined #nim |
07:48:53 | FromDiscord | <bung8954> what's the possible reason my app runs fine when compiled with amd64 arch but failed with arm64 arch, it causes `Illegal storage access` |
07:49:13 | FromDiscord | <odexine> In reply to @Dorothy Allen "Any Cashapp? Chime? Zelle?": <@&371760044473319454> |
08:18:25 | * | xet7 quit (Remote host closed the connection) |
08:45:08 | * | mfg joined #nim |
08:47:01 | Amun-Ra | unaligned memory access? |
08:47:33 | Amun-Ra | are there any casts in the code, bung8954? |
11:21:27 | FromDiscord | <demotomohiro> In reply to @morganalyssa "anyone done dynamic runtime": How about to use glDebugger? https://www.opengl.org/sdk/tools/gDEBugger/ |
12:09:03 | * | beholders_eye joined #nim |
12:27:45 | FromDiscord | <dreadnought7600> In reply to @omareladly "I was trying to": It's not official afaik, and a little bit of the info in it is out of date |
12:28:48 | FromDiscord | <dreadnought7600> Mastering Nim would be the more appropriate choice for an official book |
12:33:25 | * | ntat joined #nim |
12:40:25 | * | lucasta joined #nim |
13:07:55 | FromDiscord | <crim4> Can I bring some marketing in this chat? Not to sound arrogant, but after all this time, Nim still is in the shadow related to younger programming languages, also it failed being the replacement of GDScript for Godot 4, can I suggest to the staff behind this great language to take advantage of the great C++ interop, that only Nim has, to develop as great looking and featurefull game in UE5 to show people what Nim can do so easily compared t |
13:08:24 | * | beholders_eye quit (Ping timeout: 252 seconds) |
13:08:37 | FromDiscord | <crim4> (edit) "great" => "awesome" | "as" => "a" |
13:08:57 | FromDiscord | <crim4> (edit) "great" => "good" |
13:09:33 | FromDiscord | <crim4> obviously the Nim version should be a one-click-to-setup |
13:09:44 | FromDiscord | <crim4> often the worst part is setupping stuff |
13:10:27 | * | beholders_eye joined #nim |
13:20:38 | * | ryuukk quit (Remote host closed the connection) |
13:23:05 | * | ryuukk joined #nim |
13:25:38 | FromDiscord | <ant2024> In reply to @Elegantbeef "https://github.com/thechampagne/rustls-nim there is": Ah I see, thanks |
13:26:27 | FromDiscord | <ant2024> Also, just wondering. What about nim makes it more Native then languages like C or Rust |
13:26:43 | FromDiscord | <Robyn [She/Her]> In reply to @crim4 "Can I bring some": NimForUE5 exists |
13:27:16 | FromDiscord | <Robyn [She/Her]> Also, so does https://github.com/godot-nim/gdext-nim |
13:32:27 | FromDiscord | <zumi.dxy> In reply to @ant2024 "Also, just wondering. What": the only thing more "native" would be assembly language or machine code 😛 |
13:37:06 | FromDiscord | <ant2024> But how? |
13:37:45 | FromDiscord | <ant2024> Like, again, how is it mor native than c or cpp |
13:40:20 | FromDiscord | <koaledu> It is not?↵Nim uses C/C++/Obj-C to generate binary code |
13:41:13 | FromDiscord | <zumi.dxy> With the LLVM implementation it's about as "native" as Rust, since they both compile to LLVM IR before going into machine code |
13:41:50 | FromDiscord | <zumi.dxy> The reference implementation of Nim uses C as its intermediate representation, though this will change in the future |
13:42:39 | FromDiscord | <koaledu> Will it change? How? |
13:43:07 | FromDiscord | <zumi.dxy> https://github.com/nim-lang/nif |
13:44:05 | FromDiscord | <koaledu> I read a bit about this, is this like QBE/LLVM? |
13:44:48 | FromDiscord | <Robyn [She/Her]> In reply to @koaledu "I read a bit": NIF is just an intermediate format, ig kinda like LLVM but you should be able to get a Nim AST from NIF |
13:45:27 | FromDiscord | <zumi.dxy> If there's a -> NIF frontend will we be able to convert everything into Nim? 😛 |
13:47:51 | FromDiscord | <koaledu> I could probably use this as the backend for the language I plan to make for my thesis project |
13:48:58 | FromDiscord | <koaledu> I don't want to mess around generating architecture specific code. LLMV seems a little too complex for what I want to do and was thinking about QBE |
13:52:42 | FromDiscord | <Robyn [She/Her]> probably↵(@zumi.dxy) |
13:52:59 | FromDiscord | <zumi.dxy> In reply to @zumi.dxy "If there's a *": I just checked issues, there is a NIF to Nim AST planned↵assuming Nim code can be rendered from the AST↵About fits well with the one item from the Zen of Nim |
13:56:06 | FromDiscord | <Robyn [She/Her]> i want to make a visual novel engine in Nim |
13:56:42 | FromDiscord | <koaledu> That would be really cool |
13:57:04 | FromDiscord | <koaledu> I want to make a VN after I played Steins;Gate |
13:57:23 | FromDiscord | <Robyn [She/Her]> idk if it's an engine but i want to make something like Ink by Inkle |
13:58:28 | FromDiscord | <zumi.dxy> ~~imagine a blazing fast Doki Doki Literature Club~~ |
13:58:39 | FromDiscord | <Robyn [She/Her]> a simple language and a way to trigger functions on scenes |
13:59:02 | FromDiscord | <koaledu> In reply to @zumi.dxy "~~imagine a blazing fast": Apparently the last release of the game is not made in Python anymore |
13:59:27 | FromDiscord | <zumi.dxy> hang on, what |
14:00:36 | FromDiscord | <Robyn [She/Her]> In reply to @koaledu "Apparently the last release": oh damn |
14:00:37 | FromDiscord | <koaledu> DDLC was made in Ren'Py↵DDLC+ was made in Unity |
14:00:42 | FromDiscord | <Robyn [She/Her]> Daaamn |
14:00:54 | FromDiscord | <zumi.dxy> ~~Lemme guess, Monika now codes in C# instead of Python~~ |
14:01:04 | FromDiscord | <koaledu> Yes, actually |
14:01:09 | FromDiscord | <zumi.dxy> LMAO NICE |
14:01:20 | FromDiscord | <koaledu> She learnt a new language, good for her |
14:01:25 | FromDiscord | <Robyn [She/Her]> I'm planning on making a VN in Godot using my own format lol |
14:03:32 | FromDiscord | <zumi.dxy> ahhhhh has it been that long 💀 https://media.discordapp.net/attachments/371759389889003532/1283427714862153769/image.png?ex=66e2f4b4&is=66e1a334&hm=947ab682cf8e67ef83e40b07e4546af6763bac48c8d278f7a756975277942cb0& |
14:03:45 | FromDiscord | <Robyn [She/Her]> Not too sure everything a VN needs though, I know it needs a history and scenes need IDs and such, but not much else |
14:11:01 | * | beholders_eye quit (Ping timeout: 248 seconds) |
14:11:41 | FromDiscord | <odexine> I remember someone working on a VN engine here years ago |
14:23:18 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "I remember someone working": oh? |
14:24:36 | FromDiscord | <odexine> you can see a few mentions of some people making engines from searching "VN" |
14:32:07 | FromDiscord | <Robyn [She/Her]> oh rad |
14:34:34 | * | mfg quit (Ping timeout: 252 seconds) |
14:39:32 | * | ryuukk quit (Read error: Connection reset by peer) |
14:41:12 | * | ryuukk joined #nim |
15:06:54 | FromDiscord | <cineration> So I’m trying to compile Nim for the raspberry pie zero 2 w. When I run ./koch boot -d:release my raspberry pi hangs, my ssh session closes and I cannot reconnect. Not sure if I need the 32 bit version bc I’m on a 64 but build of raspbian. Anybody have any suggestions? |
15:09:45 | FromDiscord | <nervecenter> In reply to @cineration "So I’m trying to": Check if your GCC toolchain is 32-bit, and also the build script architecture string may need changing, I had to manually substitute it, I think `arm32 -> arm` or something of that sort. |
15:10:43 | FromDiscord | <nervecenter> Also I would recommend connecting a monitor and keyboard because it's just not a super powerful machine, if anything the compilation is blocking the ssh pipe |
15:11:17 | FromDiscord | <nervecenter> Although the W has 4 cores right? hmmm |
15:12:46 | FromDiscord | <cineration> In reply to @nervecenter "Also I would recommend": That’s what I thought and let it run overnight but either it was still compiling or something went wrong. I’ll give 32 bit a shot later and see what happens. I appreciate it! |
15:23:34 | FromDiscord | <odexine> it might just be locked real hard, not sure if koch has a flag to set how many cores to use |
15:30:00 | FromDiscord | <nikolasdi> Hello, I am trying to sign up on the forum but it fails to send me the email, no matter what email account I try. Is there some problem with it? |
15:42:06 | FromDiscord | <ant2024> In reply to @zumi.dxy "With the LLVM implementation": So the only real thing nim has over C and Rust is thatbits easier? That's respectable |
15:45:02 | Amun-Ra | that's oversimplification |
15:48:44 | * | beholders_eye joined #nim |
15:49:27 | * | beholders_eye quit (Client Quit) |
15:56:34 | FromDiscord | <ant2024> Oh yeah it's also Fullstack no? Since it can compile to JavaScript |
15:56:43 | FromDiscord | <ant2024> And embedded systems since it compiles into C |
15:58:19 | * | beholders_eye joined #nim |
16:01:03 | FromDiscord | <rakgew> imho also the meta programming is far more impressive.↵(@ant2024) |
16:06:39 | * | beholders_eye quit (Ping timeout: 245 seconds) |
16:10:21 | FromDiscord | <crim4> In reply to @chronos.vitaqua "NimForUE5 exists": exactly for that reason |
16:10:39 | FromDiscord | <crim4> nim has the potential to become a widely used language |
16:10:56 | FromDiscord | <crim4> but zero marketing was done right |
16:20:23 | FromDiscord | <Robyn [She/Her]> In reply to @crim4 "but zero marketing was": tell that to Araq in #internals :P |
16:22:26 | FromDiscord | <crim4> something says me he won't take it as a pure suggestion |
16:22:33 | FromDiscord | <crim4> @_araq |
16:24:03 | FromDiscord | <Robyn [She/Her]> he doesn't like pings :p |
16:26:55 | FromDiscord | <koaledu> I mean, I don't know how would you make a programming language more popular↵↵Many people just code because they want to money and won't bother to learn anything that won't be required for a job |
16:28:35 | FromDiscord | <koaledu> When I talk with my CS colleagues about newer programming languages they just say things like "C++/C#/Java already exist" or "but there are no jobs for that" |
16:33:22 | FromDiscord | <zumi.dxy> I'm a bit wary about posting C and Go on my resume for some reason |
16:34:24 | FromDiscord | <koaledu> Why? |
16:35:09 | FromDiscord | <zumi.dxy> The jobs that require them seem to be pretty specific here↵Most shops might take PHP, Java, C# |
16:35:50 | FromDiscord | <zumi.dxy> Okay, maybe some more are using Go |
16:36:19 | FromDiscord | <zumi.dxy> but my work rn involves plain ol' C |
16:36:33 | FromDiscord | <koaledu> I have never seen a job asking for Go here↵Just Java/PHP/C# |
16:38:37 | FromDiscord | <zumi.dxy> Coworkers saw a Rust post at Canonical (but of course) and thought I could do it↵..."could"↵But idk, Rust just has a bit much baggage to me |
16:40:45 | FromDiscord | <koaledu> Yeah, I found it a little bit complex and unproductive |
16:45:49 | FromDiscord | <omareladly> When should I use pointers and when should I not ? |
16:46:01 | FromDiscord | <omareladly> And what is .base and . Inline ? |
16:49:08 | FromDiscord | <ieltan> In reply to @omareladly "When should I use": `ref` or `ptr` ? |
16:49:52 | FromDiscord | <ieltan> In reply to @omareladly "And what is .base": base is for dynamic dispatch I think |
16:51:30 | FromDiscord | <morgan (ping with reply)> In reply to @demotomohiro "How about to use": the latest version appears to be over 10 years old |
16:52:33 | FromDiscord | <ieltan> Use `inline` when your function would benefit inlining basically. It's a hint for the compiler so it's not guaranteed to actually inline it which is why I wouldn't really care too much about it since I assume the c compiler would know better than me about these kind of things, I usually do care if I'm writing a library aka something intended to be reused a ton of times |
16:53:44 | FromDiscord | <demotomohiro> In reply to @morganalyssa "the latest version appears": How to log OpenGL calls is not changed for more than 10 years 🙂↵Maybe there are newer debuggers for OpenGL. |
16:54:50 | FromDiscord | <morgan (ping with reply)> well i could give it a try, im just not sure if it’ll work given that much time |
16:55:39 | FromDiscord | <demotomohiro> In reply to @omareladly "When should I use": I use `ptr` only when I need to use C library or memory mapped-io. |
16:57:27 | FromDiscord | <omareladly> sent a long message, see https://pasty.ee/wFlFcEoY |
16:57:51 | FromDiscord | <demotomohiro> In reply to @omareladly "And what is .base": `base` pragma is used for method: https://nim-lang.org/docs/manual.html#methods |
16:58:34 | FromDiscord | <fabric.input_output> `base`d :P |
17:02:17 | FromDiscord | <ieltan> As a rule of thumb @omareladly, always stick to no `ptr`/`ref` because Nim is based on value types and pass-by-value semantics by default. If you need to mutate a value type you must annotate the parameter of tbe proc to take in `var MyType` which will do the job of passing a pointer. |
17:03:29 | FromDiscord | <ieltan> Avoid `ptr` if you're not doing c interop or creating custom data structures or multithreading really anything that `ref` is not suited for |
17:04:00 | FromDiscord | <morgan (ping with reply)> or make a type a ref object to easily make it passed as a reference without (much) code change |
17:05:59 | FromDiscord | <morgan (ping with reply)> i’ve been using a mix of the two but that’s because i’ve had some level of interop and also some variable size memory for interop |
17:06:15 | * | nyeaa49284230101 quit (Quit: The Lounge - https://thelounge.chat) |
17:07:06 | FromDiscord | <morgan (ping with reply)> even my custom convolver i think i used ptr uncheckedarray for faster variable size memory |
17:07:23 | FromDiscord | <morgan (ping with reply)> but you generally don’t need it for pure nim stuff |
17:07:35 | FromDiscord | <ieltan> The most common uses cases for using `ref`:↵- making a type that contains itself to avoid recursion↵- your object is huge to the point allocating on the heap is better than copying the object as you pass it around. ↵- your objects lifetime exceed that of the function that allocated it, it "escapes". |
17:08:12 | FromDiscord | <ieltan> That's on top of my head but I think that's probably 99% of usecases already |
17:08:55 | FromDiscord | <ieltan> And the last one very much depends if you can get away with copying it or if it's too much |
17:20:18 | FromDiscord | <omareladly> sent a long message, see https://pasty.ee/HNdSXTyl |
17:20:20 | FromDiscord | <omareladly> ?? |
17:20:37 | FromDiscord | <Robyn [She/Her]> In reply to @omareladly "So to summarize: ": `ref` is fine in pure Nim |
17:20:46 | FromDiscord | <Robyn [She/Her]> In embedded, `arc` is perfectly fine |
17:20:49 | FromDiscord | <ieltan> I don't mean "it's not recommended" but just use the appropriate feature at the appropriate time |
17:21:10 | FromDiscord | <Robyn [She/Her]> In reply to @ieltan "I don't mean "it's": yeah, don't make everything a `ref` |
17:21:12 | FromDiscord | <ieltan> `ref` is "fine" but a lot of people over use it |
17:21:21 | FromDiscord | <omareladly> In reply to @chronos.vitaqua "In embedded, `arc` is": Arc as in do by reference and the compiler will optimize ? |
17:21:29 | FromDiscord | <omareladly> Im still new to nim |
17:21:34 | FromDiscord | <ieltan> My visions blurs at code that just spams ref everywhere |
17:22:55 | FromDiscord | <nervecenter> In reply to @omareladly "Arc as in do": By and large you do not need to use `ref` or `ptr` anywhere in most Nim code. Dynamic types (strings, seqs, other collections) are by default stack-managed scoped pointers (`unique_ptr` in C++). It's all done for you and reference counted by default. Only optimize and go lower level when you absolutely must extract optimal performance, because Nim code free of any memory semantics is already c |
17:23:10 | FromDiscord | <nervecenter> (edit) "C++)." => "C++) and work as value types." |
17:23:22 | FromDiscord | <Robyn [She/Her]> In reply to @omareladly "Arc as in do": `arc` is a memory management strategy, I think the C compiler is pretty good at optimising that, you should ask in #embedded since the folk there will know more than me |
17:23:49 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
17:23:51 | FromDiscord | <omareladly> Thank you all |
17:24:08 | FromDiscord | <omareladly> In reply to @chronos.vitaqua "`arc` is a memory": Yeah I should also check the embedded bros for that |
17:24:42 | FromDiscord | <odexine> well robyn is right enough id say |
17:25:11 | FromDiscord | <Robyn [She/Her]> No sweat o7 |
17:25:25 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "well robyn is right": hush, elixir user |
17:25:34 | FromDiscord | <odexine> ??????????????????? |
17:25:38 | FromDiscord | <ieltan> In embedded ithink it's a bit tricky because you need useMalloc and use the allocator that you use for the chip? |
17:25:49 | FromDiscord | <ieltan> Not sure about that tho |
17:26:03 | FromDiscord | <odexine> oh yeah no mmap |
17:26:07 | FromDiscord | <ieltan> Right |
17:26:26 | FromDiscord | <nervecenter> In reply to @omareladly "Thank you all": I'll give you a case in point: I maintain a 27k line CLI data analysis program written entirely in Nim. The ONLY time I ever use `ref` is for Object variants which currently work but are not final and require it, and `ptr` in some FFI hooking to a C library which I eventually did not need and removed. Everything else is free of ANY memory semantics. |
17:26:41 | FromDiscord | <nervecenter> (edit) "which" => "(which" | "it," => "it)," |
17:26:44 | FromDiscord | <ieltan> Nim allocator uses mmap so you will need the whole `useMalloc` trick to get it working on platforms that don't offer it |
17:27:00 | FromDiscord | <ieltan> And `patchFile` |
17:27:21 | FromDiscord | <omareladly> What about the methods part |
17:27:23 | FromDiscord | <omareladly> ?? |
17:27:26 | FromDiscord | <ieltan> It's not hardcore stuff but if you don't know this ahead of time it's going to be annoying |
17:27:38 | FromDiscord | <omareladly> I couldn’t wrap my head about it ↵↵↵I know methods |
17:27:47 | FromDiscord | <ieltan> In reply to @omareladly "What about the methods": Basically only use it for dynamic dispatch |
17:27:50 | FromDiscord | <nervecenter> Nim is not object oriented |
17:28:03 | FromDiscord | <nervecenter> It's mainly procedural with functional sprinkling |
17:28:16 | FromDiscord | <morgan (ping with reply)> i have barely used nim’s OO stuff at all in my time using nim, object variants are a plenty good enough replacement |
17:28:30 | FromDiscord | <odexine> i dont think ive ever productively used nims oo stuff |
17:28:49 | FromDiscord | <omareladly> In reply to @ieltan "Basically only use it": So if I have a type player ↵↵And I want to update player |
17:28:54 | FromDiscord | <ieltan> Meh, rust is what I'd call procedural with the functional sparkling bit |
17:29:00 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "???????????????????": i was making a stupid joke about me being the professional even tho that prolly ain't true- |
17:29:01 | FromDiscord | <omareladly> In reply to @omareladly "So if I have": Just copy a new value |
17:29:05 | FromDiscord | <omareladly> ?? |
17:29:24 | FromDiscord | <omareladly> I mean OO is in the tutorial |
17:29:24 | FromDiscord | <odexine> In reply to @chronos.vitaqua "i was making a": wouldnt the user of the more popular language be more professional |
17:29:37 | FromDiscord | <morgan (ping with reply)> no you can write to stuff in the object |
17:29:51 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "wouldnt the user of": not in niche language smh |
17:30:04 | FromDiscord | <ieltan> In reply to @omareladly "Just copy a new": No, you'll use `proc (p: var Player)` |
17:30:12 | FromDiscord | <morgan (ping with reply)> if the proc has it as a var type input or if it’s a global var |
17:30:13 | FromDiscord | <odexine> In reply to @chronos.vitaqua "not in *niche language*": i mean discord uses elixir wheres nims discord equivalent HUHHHHH? |
17:30:38 | FromDiscord | <Robyn [She/Her]> In reply to @odexine "i mean discord uses": I'm working on it :'D |
17:30:56 | FromDiscord | <odexine> hire me once you go big |
17:30:56 | FromDiscord | <omareladly> In reply to @ieltan "No, you'll use `proc": Is this similar to…. Dare I say it…. Go structs functions |
17:31:12 | FromDiscord | <ieltan> In reply to @omareladly "Is this similar to….": I don't use go so I can't really answer that question |
17:31:24 | FromDiscord | <omareladly> Ok, let me rephrase it |
17:31:39 | FromDiscord | <omareladly> Does this dedicate the procedures to this specific type |
17:31:46 | FromDiscord | <nervecenter> If you make an object the `var` first parameter of a proc, you can "emulate" method call style |
17:31:53 | FromDiscord | <ieltan> In reply to @omareladly "Does this dedicate the": Yes |
17:32:01 | FromDiscord | <omareladly> Ohhh…. That’s it |
17:32:08 | FromDiscord | <omareladly> This is the part I was searching for |
17:32:14 | FromDiscord | <omareladly> 😂😂😂😂😂😂 |
17:32:34 | FromDiscord | <ieltan> That's static dispatch, it's the default operating mode in Nim :p |
17:32:45 | FromDiscord | <omareladly> I should have known |
17:33:00 | FromDiscord | <omareladly> I mean this is mainly why I needed pointers |
17:33:16 | FromDiscord | <omareladly> Of course I have embedded course |
17:33:21 | FromDiscord | <omareladly> This year |
17:33:32 | FromDiscord | <ieltan> Yeah but all that nasty stuff is abstracted away so you don't have to think about it too much usually |
17:33:50 | FromDiscord | <omareladly> In reply to @omareladly "Of course I have": So I would prefer if also learn how to do embedded in nim |
17:34:12 | FromDiscord | <omareladly> Nim libraries doesn’t work with no GC ↵↵I see this as an absolute win |
17:34:34 | FromDiscord | <ieltan> Instead of "oh I need a pointer because I need mutation" in Nim gets reduced to "oh I need mutation. Guess I'll use `var` |
17:34:40 | FromDiscord | <omareladly> (edit) "an absolute" => "a big" |
17:34:46 | FromDiscord | <ieltan> (edit) "`var`" => "`var`"" |
17:35:01 | FromDiscord | <omareladly> In reply to @ieltan "Instead of "oh I": I meant for manual memory management |
17:35:22 | FromDiscord | <omareladly> But now I get what you are trying to tell me |
17:35:31 | FromDiscord | <ieltan> Well manual memory management is one of the few things you will need `ptr` |
17:35:44 | FromDiscord | <omareladly> In reply to @ieltan "Well manual memory management": Yes |
17:35:58 | FromDiscord | <ieltan> Btw you can use Nim's own allocator using the `create/dealloc/resize` API |
17:36:13 | FromDiscord | <ieltan> For your manual memory management woes |
17:36:40 | FromDiscord | <morgan (ping with reply)> In reply to @nervecenter "If you make an": it doesn’t need to be var, if it doesn’t mutate it |
17:36:59 | FromDiscord | <omareladly> You mean the „Let“ |
17:38:47 | FromDiscord | <ieltan> Fun fact, if you want `var` but you don't need mutation (because you just want to return a reference for example) you can use `lent` |
17:39:29 | FromDiscord | <nervecenter> In reply to @morganalyssa "it doesn’t need to": True, but if for some cursed reason you want to make a stateful object and method API, that's how you do it. I actually found it was a good way to make a script generator for an external tool like `gnuplot` and I may share the source sometime soon. |
18:06:47 | FromDiscord | <morgan (ping with reply)> yea |
18:29:34 | * | beholders_eye joined #nim |
18:41:12 | * | ntat quit (Quit: Leaving) |
18:50:29 | FromDiscord | <mrgaturus> what are the cases where a `=copy` ocurrs instead a `=sink`? |
18:51:27 | FromDiscord | <Robyn [She/Her]> In reply to @mrgaturus "what are the cases": when you use a value after it was passed to a function that accepts a sink param, I presume |
19:10:02 | FromDiscord | <demotomohiro> In reply to @mrgaturus "what are the cases": https://nim-lang.org/docs/destructors.html#move-semantics |
19:22:57 | FromDiscord | <mrgaturus> thanks |
19:29:59 | * | xet7 joined #nim |
20:08:38 | * | jkl quit (Quit: Gone.) |
20:22:46 | FromDiscord | <melmass> Does anyone knows of a library to "package"' gui apps for mac? |
20:27:56 | * | jkl joined #nim |
20:42:51 | * | jjido joined #nim |
21:13:39 | * | nyeaa49284230101 joined #nim |
21:14:08 | * | rockcavera joined #nim |
21:19:33 | * | aikaeksen joined #nim |
21:23:21 | * | aikaeksen quit (Quit: Ping timeout (120 seconds)) |
21:26:17 | FromDiscord | <crim4> In reply to @chronos.vitaqua "he doesn't like pings": cringe |
21:26:47 | * | aikaeksen joined #nim |
21:27:05 | * | aikaeksen quit (Write error: Broken pipe) |
21:28:36 | FromDiscord | <crim4> In reply to @koaledu "When I talk with": yes those are zombies not devs |
21:29:16 | FromDiscord | <crim4> as there is plenty of these zombie people, there is also a lot of interested ones |
21:30:15 | FromDiscord | <pmunch> In reply to @crim4 "cringe": When did it become cringe to be busy? |
21:30:58 | FromDiscord | <crim4> it's cringe the reputation aura of that message |
21:31:22 | FromDiscord | <crim4> btw you all are always so interested only in ironic stupid messages |
21:31:31 | FromDiscord | <crim4> and always skip the main ones |
22:13:25 | FromDiscord | <aintea> Where can I make suggestions about the server ? It would be great to have a forum channel to ask questions like the gleam server (yes I am a traitor, I tried other languages than Nim, please don't jail me) so that questions don't sink in the flow of messages |
22:24:23 | FromDiscord | <pmunch> In reply to @crim4 "btw you all are": I am? I don't read everything here, so it might just be that I caught a couple by chance. I agree that Nim doesn't get enough good PR |
22:24:59 | FromDiscord | <pmunch> In reply to @aintea "Where can I make": Not quite sure what you mean? We already have the forums |
22:25:26 | FromDiscord | <Elegantbeef> They want discord forums, an even more unsearchable forum |
22:26:32 | FromDiscord | <pmunch> Ah, I think that would cause unnecessary fragmentation, and as you point out searchability would be fairly limited. |
22:44:58 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
23:07:39 | FromDiscord | <nervecenter> sent a long message, see https://pasty.ee/htBUNhfy |
23:08:04 | FromDiscord | <nervecenter> (edit) "https://pasty.ee/wNavmkGA" => "https://pasty.ee/SKrEhcKz" |
23:08:20 | FromDiscord | <nervecenter> (edit) "https://pasty.ee/whUtfzAA" => "https://pasty.ee/IdYGEGuK" |
23:22:47 | FromDiscord | <koaledu> In reply to @nervecenter "Yeah I've made the": I remember there was a controversy about Flutter becoming less popular and many people were shouting about it being useless and death and whatever↵↵Those people didn't know how to program, they just knew how to use Flutter, the moment the company uses something else they will no longer be able to adapt |
23:23:52 | FromDiscord | <Elegantbeef> People keep saying all programmers will be replaced by an LLM, so we're all redundant just have fun! |
23:27:07 | FromDiscord | <double_spiral> You're right, I should start coding in backdoors |
23:30:11 | FromDiscord | <Elegantbeef> Never heard of that language |
23:32:26 | FromDiscord | <ant2024> how could I get my device's gpu and/or cpu through nim's standard library? |
23:33:09 | FromDiscord | <double_spiral> In reply to @Elegantbeef "Never heard of that": Made me smile |
23:43:37 | FromDiscord | <demotomohiro> In reply to @ant2024 "how could I get": What's you want to get from your gpu and/or cpu? |
23:49:17 | FromDiscord | <ant2024> for this im making a neofetch like thing |
23:49:23 | FromDiscord | <ant2024> just for practice |
23:52:03 | * | Artea joined #nim |