<< 17-01-2025 >>

00:17:10strogon14And then your Nim code starts to sing.
00:20:27FromDiscord<Elegantbeef> Atleast someone understood what I said
03:34:24*rockcavera quit (Remote host closed the connection)
04:56:00*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
04:56:24*SchweinDeBurg joined #nim
08:00:49*WinterArch joined #nim
08:02:53*WinterArch quit (Client Quit)
09:25:05FromDiscord<mjsdev> Is there a way to dump a tree from an existing parsed NimNode in a macro?
10:32:55*beholders_eye joined #nim
10:46:07FromDiscord<ali_salah_101> Are there people still using this language? And why?
10:46:24FromDiscord<angelsdust> Me, because it is super comfy
10:49:11*krux02 quit (Quit: Leaving)
10:50:06FromDiscord<ali_salah_101> In reply to @angelsdust "Me, because it is": I mean why do you use it?
10:51:07FromDiscord<angelsdust> In reply to @ali_salah_101 "I mean why do": Ease of use, the result it produces
10:51:32FromDiscord<angelsdust> Like nimble is easier than cmake
10:56:16FromDiscord<mjsdev> ahaha! I've done it!
10:57:06ehmryNim is great because Nim is used by people that choose to use Nim
10:57:09FromDiscord<mjsdev> @ElegantBeef -- thanks for assist the other day.
10:59:47FromDiscord<ali_salah_101> In reply to @angelsdust "Like nimble is easier": I did not understand what you mean. Do you use it to create websites?
11:00:32FromDiscord<angelsdust> In reply to @ali_salah_101 "I did not understand": I am writing a back-end framework in Nim
11:02:41FromDiscord<mjsdev> Sounds like we're in the same boat AngelsDust
11:03:02FromDiscord<angelsdust> In reply to @mjsdev "Sounds like we're in": Oh nice I posted some brainstorm sessions in #webdev
11:03:15FromDiscord<angelsdust> Since I want it to be proper, I finally got routing + "controllers" done
11:03:17FromDiscord<mjsdev> Although mine is more of a general application framework that will have a modular web component
11:03:26FromDiscord<angelsdust> Ah
11:04:24FromDiscord<mjsdev> sent a code paste, see https://play.nim-lang.org/#pasty=HjNUqpsu
11:04:25FromDiscord<angelsdust> One thing I learned is that most web routers are really bad
11:04:34FromDiscord<mjsdev> Then you just implement the `handle` method
11:05:05FromDiscord<angelsdust> sent a code paste, see https://play.nim-lang.org/#pasty=MqGIcbFo
11:05:10FromDiscord<angelsdust> Also interesting way of doing it
11:05:35FromDiscord<angelsdust> I went for a Trie to hold my routes, which have a handling function defined via a `{.route.}` tag
11:06:02FromDiscord<mjsdev> ref to app? Isn't var getting a pointer?
11:06:19FromDiscord<mjsdev> Sorry, I'm still new to the language
11:06:41FromDiscord<angelsdust> I am a noob too dw, afaik var means it is mutable let is not and ref means it will always reference one object
11:06:52FromDiscord<angelsdust> But maybe default is pass by reference already
11:08:55FromDiscord<mjsdev> Ref seems to imply you're passing a pointer directly.
11:09:38FromDiscord<mjsdev> default is copy, var, as I understand will essentially take it as a pointer and it has to be declared as a var
11:09:54FromDiscord<mjsdev> ref, from what I can tell is if you created a pointer to something manually and wanted to pass the pointer
11:10:13FromDiscord<mjsdev> like explicitly pass the pointer
11:10:24FromDiscord<mjsdev> At least that's how I'm reading it
11:10:31FromDiscord<ali_salah_101> In reply to @angelsdust "I am writing a": Is it better than Rest? What is the difference between them?
11:10:51FromDiscord<angelsdust> In reply to @ali_salah_101 "Is it better than": You mean Rust? What is it you want to make, they aren't conventional languages for webdev
11:12:02FromDiscord<ali_salah_101> In reply to @angelsdust "You mean Rust? What": Yes, but my goal is on resources and application performance. Does the Nim language compete?
11:12:26FromDiscord<angelsdust> What is the goal? Even php runs on 64mb ram
11:12:29FromDiscord<ali_salah_101> In reply to @angelsdust "You mean Rust? What": Autocorrect is hurting me😂😂
11:14:20FromDiscord<ali_salah_101> In reply to @angelsdust "What is the goal?": Rust is the only language in my opinion that I can use to talk to and control the Arduino through a website or an application perfectly and quickly in real time.
11:14:42FromDiscord<angelsdust> In reply to @ali_salah_101 "Rust is the only": Arduino? Now I deffo need more context
11:16:22FromDiscord<ali_salah_101> Yes, for example, Arduino and Raspberry Pi give me more rapid control and less resource usage, especially if I want to connect it to an artificial intelligence and control it or see the readings through a website or control it online remotely.
11:17:20FromDiscord<angelsdust> What is the goal you are trying to achieve, neither an Arduino nor Raspberry Pi will give you less resource usage they just have less resources
11:17:37FromDiscord<angelsdust> Tho you could argue the arduino arm-chip is more efficient yada yada
11:24:53FromDiscord<solitudesf> In reply to @ali_salah_101 "Rust is the only": cool opinion
11:29:08FromDiscord<tauruuuuuus> In reply to @ali_salah_101 "Rust is the only": Nim can do that, a lot of us use it for real time work on embedded systems
11:29:32FromDiscord<tauruuuuuus> We support Arduino through frameworks and even low level libraries with no abstraction
11:30:28FromDiscord<tauruuuuuus> And anyways, a lot of languages can, with varying degrees of comfort
11:32:31FromDiscord<odexine> It’s really not a matter of if it can do that but more of how easy is it to do that yeah
11:33:30FromDiscord<tauruuuuuus> Yup, that's what I meant with degrees of comfort
11:45:18FromDiscord<ali_salah_101> In reply to @tauruuuuuus "Yup, that's what I": So can I get the same AI features and lower resource consumption in a language that might be easier? And does NIM deliver?
11:45:37FromDiscord<angelsdust> wdym AI features?
11:46:52FromDiscord<ali_salah_101> In reply to @angelsdust "wdym AI features?": I actually intend to make a robot to be a complete assistant and currently I only intend to teach it to bring me a glass of water, other than chatting and other things that I might intend to have it help me with.
11:47:43FromDiscord<angelsdust> That takes a lot of computing power
11:47:51FromDiscord<angelsdust> You need image recognition, voice parsing
11:47:53FromDiscord<ali_salah_101> Especially since I want to make it a drone and at the same time the noise of the fans is low and at the same time it can carry heavy things. I got the idea from the owl to make the fans low noise.
11:49:04FromDiscord<ali_salah_101> In reply to @angelsdust "You need image recognition,": I know that's why I'm trying to narrow all this down to something that might be more efficient experimentally until I upgrade my CPU and recently try using a GPU.
11:51:55FromDiscord<ali_salah_101> So yes, could a language like Nim make me dispense with Rust?
11:52:17FromDiscord<angelsdust> Yeah, both have the same capabilities
11:52:27FromDiscord<angelsdust> Plus Nim can call c/c++ libraries too
11:52:38FromDiscord<angelsdust> Giving you access to the any library you need
11:56:12*m5zs7k quit (Ping timeout: 252 seconds)
11:58:28FromDiscord<ali_salah_101> In reply to @angelsdust "Giving you access to": But is it actually easier than Rust?
11:59:12*m5zs7k joined #nim
11:59:47FromDiscord<angelsdust> In reply to @ali_salah_101 "But is it actually": This is subjective
12:00:01FromDiscord<bosinski2023> In reply to @ali_salah_101 "But is it actually": mastering rusts borrow-checker is regarded much harder than working with nim..
12:01:08FromDiscord<ali_salah_101> In reply to @angelsdust "This is subjective": I know but I like to collect points of view
12:01:55FromDiscord<ali_salah_101> In reply to @bosinski2023 "mastering rusts borrow-checker is": In this case, I will learn the basics and see if it suits me in terms of performance and ease or not.
12:02:03FromDiscord<ali_salah_101> Thank you again
12:02:34FromDiscord<djazz> Nim works great on embedded/arduino/rpi pico
12:03:58FromDiscord<djazz> Or interfacing with linux drivers
12:04:01FromDiscord<ali_salah_101> This is the first time I've seen a programming language become more popular among girls. This is great.
12:04:34FromDiscord<ali_salah_101> This is reason enough for me to learn this language. 😂😂
12:04:45FromDiscord<angelsdust> In reply to @ali_salah_101 "In this case, I": Performance is how well you write code
12:04:56FromDiscord<angelsdust> In reply to @ali_salah_101 "This is the first": Unique lol
12:05:03FromDiscord<ali_salah_101> Yes, this is correct
12:05:30FromDiscord<angelsdust> Like, my web router runs in O(k) space, doing nanoseconds iirc
12:06:06FromDiscord<ali_salah_101> In reply to @angelsdust "Like, my web router": This is so cool.
12:08:44FromDiscord<djazz> In reply to @ali_salah_101 "This is the first": What
12:09:23FromDiscord<ali_salah_101> In reply to @djazz "What": Nothing, just this language has become beautiful to me,↵Consider it a joke.
12:09:50FromDiscord<bosinski2023> In reply to @djazz "What": name a source, for the claim thats the girls like nim, pls 🙂
12:10:16FromDiscord<djazz> Where are these Nim girls at xD
12:10:34FromDiscord<ali_salah_101> In reply to @bosinski2023 "name a source, for": If girls were like Nim our lives would be much better😂😂
12:11:01FromDiscord<ali_salah_101> In reply to @djazz "Where are these Nim": You are?
12:11:22FromDiscord<angelsdust> :Blink:
12:11:51FromDiscord<djazz> I'm not 😅 sorrey
12:11:56FromDiscord<ali_salah_101> In reply to @angelsdust "<a:Blink:1130356220939735110>": What the problem
12:12:04FromDiscord<ali_salah_101> You are not a girl?
12:12:24FromDiscord<ali_salah_101> In reply to @djazz "I'm not 😅 sorrey": You are not a girl?
12:13:20FromDiscord<angelsdust> They are unique statements
12:15:37FromDiscord<ali_salah_101> In reply to @angelsdust "They are unique statements": I got my brain error
12:15:51FromDiscord<angelsdust> try catch it :KEKW:
12:16:00FromDiscord<djazz> try except
12:18:14FromDiscord<djazz> I mentioned embedded Nim and I you assume? 😄
12:18:25FromDiscord<djazz> (edit) "I" => ""
12:18:47FromDiscord<djazz> That was unexpected
12:19:34FromDiscord<ali_salah_101> In reply to @djazz "That was unexpected": Yes, it is because of your picture, but you are not a girl. I hope that Angel is a girl so that the system does not fall
12:20:00FromDiscord<djazz> Why does it matter to the discussion?
12:20:39FromDiscord<zumi.dxy> Nimder 🤔
12:20:44FromDiscord<ali_salah_101> In reply to @djazz "Why does it matter": It's not important but I liked adding a little comedy.
12:20:50FromDiscord<angelsdust> In reply to @zumi.dxy "Nimder 🤔": lol
12:20:54FromDiscord<ali_salah_101> Sorry if I bothered you
12:31:44FromDiscord<djazz> I havent coded Rust so I dont know how Nim compares
12:32:15FromDiscord<djazz> I like Nim syntax more, its cleaner/easier to read
12:33:07FromDiscord<djazz> But it's a less popular language thats for sure
12:33:50Amun-Ranim is much easier and approachable than rust
12:34:14FromDiscord<angelsdust> Rust's biggest issue imo is that everything is a hidden macro
12:34:15FromDiscord<djazz> In reply to @ali_salah_101 "This is the first": Maybe stack overflow or something has such insights haha
12:34:59FromDiscord<djazz> Managing lifetimes in nim, are there more ways than ref?
12:36:40FromDiscord<lainlaylie> there are these: https://nim-lang.github.io/threading/smartptrs.html
12:37:14FromDiscord<bosinski2023> In reply to @djazz "Managing lifetimes in nim,": pools/arenas as in fusion/pools
12:40:20FromDiscord<djazz> Thanks
12:53:42*beholders_eye quit (Ping timeout: 272 seconds)
13:23:07FromDiscord<melmass> sent a code paste, see https://play.nim-lang.org/#pasty=GTJNRukm
13:23:33FromDiscord<melmass> (edit) "https://play.nim-lang.org/#pasty=JbjdFzhP" => "https://play.nim-lang.org/#pasty=EMgwWjHJ"
13:24:41FromDiscord<melmass> (edit) "https://play.nim-lang.org/#pasty=PwCXxfIz" => "https://play.nim-lang.org/#pasty=ImVEdOJn"
13:24:54FromDiscord<demotomohiro> In reply to @melmass "What is the proper": When you import C things in header files, use header pragma: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
13:25:00FromDiscord<djazz> Use header pragma instead of emit
13:25:13FromDiscord<djazz> You can push it so all can use it and then pop
13:26:28FromDiscord<djazz> I think you can put that entire include string not just filename to header pragma
13:26:42FromDiscord<melmass> Thanks! this was a reduced example (but very good to know still), if I do need some C glue I should then write it in a C file and with an header and user the header pragma too?
13:26:55FromDiscord<melmass> (edit) "user" => "use"
13:27:38FromDiscord<djazz> C source code? Just use Nim?
13:27:47FromDiscord<djazz> Example?
13:27:54FromDiscord<melmass> I'm binding a system library (sysctl on mac)
13:28:37FromDiscord<djazz> Bindings dont need C code outside of headers, usually
13:29:01FromDiscord<djazz> Its just so nim knows how to generate C code
13:30:50FromDiscord<melmass> I'm extracting things in C directly it all works fine but what I explained (when used outside the declaration file I still need those explicit importc)
13:30:59FromDiscord<melmass> sent a code paste, see https://play.nim-lang.org/#pasty=uDKXvPPd
13:31:27FromDiscord<justunknown666> hi guys , i'm new to nim lang😅 and i don't found a Code Editor support nim completly I used VS and other Code Editor but all of them don't useful for beginner user Does any of you have information about it? and Thanks for all in advance🤍
13:32:33FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#pasty=iWruZPtO
13:33:11FromDiscord<djazz> You can inline it with emit also... But compile is better
13:33:26FromDiscord<djazz> Make sure include paths are set using passC/passL
13:33:37FromDiscord<djazz> Or library path
13:33:58FromDiscord<melmass> Thanks! I'll try some things out based on all that
13:34:26FromDiscord<djazz> But if its system files then theres no need I guess
13:34:33FromDiscord<djazz> To link/add includes
14:04:49FromDiscord<djazz> In reply to @justunknown666 "hi guys , i'm": I use vscode and the official nim extension i think. With nimlangserver
14:12:50FromDiscord<melmass> In reply to @djazz "Ah okay, if you": I never used compile pragma before, [this](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma) from the doc gives me "call to undeclared function", how do I make nim aware of it now?
14:14:19Amun-Ramelmass: what's the function?
14:15:43FromDiscord<melmass> sent a code paste, see https://play.nim-lang.org/#pasty=nTsjqaMQ
14:16:07FromDiscord<melmass> (edit) "https://play.nim-lang.org/#pasty=johSIKHr" => "https://play.nim-lang.org/#pasty=ItflGGvE"
14:16:44FromDiscord<djazz> Is sys.c your file or from macos?
14:16:52FromDiscord<melmass> mine!
14:19:07FromDiscord<djazz> So what is the error and what line?
14:19:44FromDiscord<demotomohiro> In reply to @melmass "the ones I had": If these functions are defined in `sys.c`, remove `nodecl` pragma.
14:20:01FromDiscord<melmass> Hmmm using `header` works...
14:20:05FromDiscord<djazz> Ah yeah, that too
14:20:25FromDiscord<melmass> (edit) "Hmmm using `header` works..." => "sent a code paste, see https://play.nim-lang.org/#pasty=mCwJZUOo"
14:20:40FromDiscord<djazz> Without header, importc will use whatever is linked to the binary
14:21:02FromDiscord<djazz> And read up on nodecl vs cdecl
14:21:17FromDiscord<demotomohiro> `sys.c` is not a header file.
14:22:13FromDiscord<demotomohiro> If you do `header: "sys.c"` and import that module multiple times, you will get link errors.
14:22:15FromDiscord<melmass> In reply to @djazz "And read up on": I think that's my issue now I get `conflicting types`, thanks I'll check those
14:22:25FromDiscord<melmass> In reply to @demotomohiro "If you do `header:": Strangely no
14:22:29FromDiscord<djazz> Yeah dont use header with a c file
14:24:32FromDiscord<melmass> works!! thanks all
14:25:20FromDiscord<demotomohiro> `header: "sys.c"` pragma generates `#include "sys.c"` in generated code.↵If `sys.c` is included in multiple .c files, it creates multiple same name functions and you will get error at link time.
14:26:50FromDiscord<demotomohiro> header files in C has `.h` extension.
14:28:12FromDiscord<demotomohiro> If you don't know much about C but want to import C libraries, my articles might help: https://internet-of-tomohiro.pages.dev/nim/gccguide.en↵https://internet-of-tomohiro.pages.dev/nim/clibrary.en
14:32:18FromDiscord<melmass> In reply to @demotomohiro "If you don't know": Thanks! I'm definitely not a c expert, I mostly know about it enough to bind simple libraries, I'll read those https://media.discordapp.net/attachments/371759389889003532/1329820598322335774/image.png?ex=678bbb71&is=678a69f1&hm=fcf3ec254ba08056f9d8aebc15c8722fd767753d4e99483303e9a04c510a01b0&
14:32:57FromDiscord<melmass> All this trouble just to get the `Ghz` value 😅
14:37:17Amun-RaGHz ;)
15:05:59*sixpbeer joined #nim
15:06:58*krux02 joined #nim
15:08:27FromDiscord<justunknown666> In reply to @djazz "I use vscode and": is it support all nim libraries command?
15:10:43*sixpbeer quit (Remote host closed the connection)
15:14:12FromDiscord<lainlaylie> what does that mean
15:50:57FromDiscord<starkiller1493> What's the easiest way to store a UTF-8 char in Nim? Just string?
15:52:57FromDiscord<demotomohiro> In reply to @starkiller1493 "What's the easiest way": https://nim-lang.org/docs/manual.html#types-string-type↵> Per convention, all strings are UTF-8 strings,
15:54:09FromDiscord<fabric.input_output> In reply to @starkiller1493 "What's the easiest way": there's https://nim-lang.org/docs/unicode.html if it interests you
16:01:50FromDiscord<starkiller1493> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#types-string-": I meant as compared to just char type
16:01:56FromDiscord<threefour> What's the best approach for approximating what Go's goroutines accomplish (multithreaded async, essentially) in Nim?
16:03:43FromDiscord<demotomohiro> In reply to @starkiller1493 "I meant as compared": There is `Rune` in unicode module to hold a single Unicode code point.
16:05:02FromDiscord<starkiller1493> In reply to @demotomohiro "There is `Rune` in": Since Rune uses int32 can I just cast it to an array of bytes?
16:10:12FromDiscord<demotomohiro> In reply to @starkiller1493 "Since Rune uses int32": Yes you can, but why do you want to cast it?↵unicode module provides features to convert between string and Rune.
16:11:19*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
16:14:22*Lord_Nightmare joined #nim
16:14:43FromDiscord<starkiller1493> In reply to @demotomohiro "Yes you can, but": I'm serializing and deserializing a MS-NRBF so I'm just looking for the best way to turn UTF8 bytes to a Nim type and back
16:25:30FromDiscord<demotomohiro> In reply to @starkiller1493 "I'm serializing and deserializing": I don't know about MS-NRBF, but if that file format stores utf8 string as it, you can just copy it to string.
16:26:19FromDiscord<demotomohiro> (edit) "it," => "is,"
16:30:01FromDiscord<starkiller1493> In reply to @demotomohiro "I don't know about": It's stored as standard utf8 bytes
16:30:59FromDiscord<starkiller1493> docs says UTF-8 encoded bytes
16:33:04FromDiscord<demotomohiro> In reply to @starkiller1493 "docs says UTF-8 encoded": Then, you can just read the content of the file and copy to string or write string to the file.
16:33:11FromDiscord<nitely_> a Rune is a UTF-32 character. You can convert from utf-8 bytes to string and back.
17:08:13*ntat joined #nim
17:18:52*SchweinDeBurg quit (Ping timeout: 252 seconds)
17:39:18*coldfeet joined #nim
18:03:37*SchweinDeBurg joined #nim
18:13:11*xet7 joined #nim
18:46:14*ensyde joined #nim
18:46:41*ensyde quit (Quit: WeeChat 4.5.1)
18:58:04*ensyde joined #nim
19:34:56*coldfeet quit (Quit: Lost terminal)
19:40:25FromDiscord<michaelb.eth> sent a long message, see https://pasty.ee/zXRxrKPD
19:41:37Amun-Rayes, nim reminds me python 2.x in that matter
19:57:15*valms19901 joined #nim
19:57:48*valms19901 quit (Client Quit)
20:32:55FromDiscord<starkiller1493> In reply to @michaelb.eth "since per the Nim": yeah, I've just hit that when writing tests 😄 I have to use `runeLen` instead of `len`↵what I don't get is↵I made an object `Char = string`, which as I understand, should inherit everything from string, however when i try `myChar.runeLen` the compilation fails with `undeclered field time` (import std/unicode doesn't sem to work)
20:33:21FromDiscord<starkiller1493> (edit) "try" => "use"
20:33:40FromDiscord<starkiller1493> (edit) "field time`" => "field`"
20:33:56FromDiscord<starkiller1493> (edit) "sem to work)" => "help)"
20:45:06FromDiscord<fabric.input_output> sent a code paste, see https://play.nim-lang.org/#pasty=wJrraZec
20:45:15FromDiscord<fabric.input_output> (edit) "https://play.nim-lang.org/#pasty=eTFZZvVK" => "https://play.nim-lang.org/#pasty=YtXtWksf"
20:54:14FromDiscord<starkiller1493> sent a code paste, see https://play.nim-lang.org/#pasty=TouFojMg
20:54:50FromDiscord<starkiller1493> i'm dumb
21:10:55FromDiscord<albassort> when will converters work as intended and not create issues >:(
21:34:20*beholders_eye joined #nim
21:48:17*ntat quit (Quit: Leaving)
21:51:09*krux02 quit (Remote host closed the connection)