<< 21-06-2023 >>

00:04:08*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
00:06:49*Lord_Nightmare joined #nim
00:10:59FromDiscord<that_dude.> If I understand concepts correctly, you should assume they are basically a full generic and then constraints are put on them. They aren't really involved with matching types, just promising that some things exist
00:11:11FromDiscord<that_dude.> (edit) "them." => "them later."
00:14:49*oprypin quit (Remote host closed the connection)
00:15:23FromDiscord<.elcritch> @elegantbeef do you know if there's a reason to prefer `proc new(_: typedesc[Foo], arg: int): Foo` vs `proc new(_: type Foo, arg: int): Foo` ?
00:18:12FromDiscord<Elegantbeef> How does it magically get a procedure defined
00:19:20FromDiscord<.elcritch> What do you mean?
00:28:30FromDiscord<.elcritch> Mainly just for the pattern of using `MyType.new(...)` for constructors. I've seen both
00:29:30FromDiscord<Elegantbeef> Bridge moment
00:29:34FromDiscord<Elegantbeef> I was responding to jj
00:29:49FromDiscord<Elegantbeef> They mean the same thing but `typedesc[T]` is what's supposed to be used
00:33:22FromDiscord<.elcritch> Ah thanks, that agrees with my intuition. I think `type Foo` would also require a call to the VM / compileTime.
00:35:27FromDiscord<Elegantbeef> yea type was overloaded to mean 3 different things
00:35:41FromDiscord<Elegantbeef> You now should use `typeof` `typedesc` and `type`(type blocks)
00:40:01FromDiscord<.elcritch> Oh that's new to me, what's the `type` for type blocks? Also is there any docs about that I could link to?
00:40:23FromDiscord<Elegantbeef> `type MyType = X`
00:44:28FromDiscord<Elegantbeef> No to the latter question
00:45:37FromDiscord<.elcritch> Oh gotcha. I never quite got the difference of when to use `type` vs `typeof` . Thanks for the clarification
00:58:36FromDiscord<Elegantbeef> @Andreas thanks you got me off my ass to both make my website purely static without JS and add a lazy writeup page 😄
01:35:19*oldpcuser_ joined #nim
01:37:25*oldpcuser quit (Ping timeout: 260 seconds)
01:54:31*Onionhammer quit (Quit: The Lounge - https://thelounge.chat)
01:54:57*Onionhammer joined #nim
01:59:35*oldpcuser_ quit (Ping timeout: 260 seconds)
02:01:58NimEventerNew post on r/nim by qtless: HappyX And Visual Studio Code, see https://reddit.com/r/nim/comments/14eu8z0/happyx_and_visual_studio_code/
02:47:58*lucasta joined #nim
03:05:55NimEventerNew thread by smsifmjxtzggadeh: Call iterator from within iterator, see https://forum.nim-lang.org/t/10289
03:29:26*oldpcuser joined #nim
03:30:07*oldpcuser quit (Remote host closed the connection)
03:30:39*oldpcuser joined #nim
04:02:34FromDiscord<JJ> In reply to @Elegantbeef "Bridge moment": oh oops, yeah i realized my code was dumb.
04:02:57FromDiscord<JJ> regarding more dumb code however, any chance this can be bashed into working?
04:03:00FromDiscord<JJ> `program.handle((a, b) => cast[typeof(a)](a == b))`
04:03:14FromDiscord<Elegantbeef> What part doesnt work?
04:03:39FromDiscord<Elegantbeef> If you say `=>` doesnt... I'll tell you to stop using`=>`
04:03:58FromDiscord<JJ> it can't infer the type of any parameters and says result can't be of type GenericParam
04:04:16FromDiscord<Elegantbeef> Right it's `=>` not working
04:04:49FromDiscord<Elegantbeef> you're getting an `auto` somewhere and it's not possible to disambiguate
04:05:56FromDiscord<Elegantbeef> This is why I'm a proponent to a `handleIt` template 😄
04:06:59FromDiscord<Elegantbeef> Also why are you casting
04:07:14FromDiscord<Elegantbeef> That's a boolean check, in what world is a cast the right solution to convert it to `a`
04:08:30FromDiscord<JJ> in the world of aesthetics 😅
04:08:43FromDiscord<Elegantbeef> It's better than `typeof(a)(a == b)`?
04:09:22FromDiscord<JJ> a, b, and result are all either uint8 or uint16. i haven't been able to get standard procs to work so i think nim is perhaps rightfully mad about a function returning two separate types
04:09:55FromDiscord<Elegantbeef> Without a proper error message I can only mock your bad code
04:09:57FromDiscord<JJ> oh yeah i should do type conversion instead
04:10:07FromDiscord<JJ> the mocking is appreciated
04:50:56*azimut_ quit (Ping timeout: 240 seconds)
04:59:45*lucasta quit (Quit: Leaving)
05:09:08FromDiscord<JJ> update: i have a consistent crash for nimsuggest but no working code
05:10:24FromDiscord<Elegantbeef> Nice
05:17:12FromDiscord<heysokam> man, nothing makes you value Nim more than going back to C or Cpp for a week, and then coming back↔i'm astonished at how much less friction there is in this language↔i knew it already, has happened before, and i still get surprised everytime i have to do a deep dive into C again
05:17:57FromDiscord<heysokam> im so grateful for the guys that work on the language ❀
05:24:12*ntat joined #nim
05:25:54*NimEventer quit (Server closed connection)
05:26:06*NimEventer joined #nim
05:54:55FromDiscord<ringabout> In reply to @omentic "update: i have a": Is there a crash message?
05:55:25FromDiscord<Elegantbeef> They made an issue I checked it's 355 inside seminst
05:55:33FromDiscord<Elegantbeef> An assert on a generic param
05:55:59FromDiscord<ringabout> Yeah, can reproduce it using `nim check`
05:56:02FromDiscord<ringabout> `Error: internal error: C:\Users\blue\Documents\GitHub\Nim\compiler\seminst.nim(355, 3) `
06:30:31*rockcavera quit (Remote host closed the connection)
07:02:14*PMunch joined #nim
07:23:44*PMunch_ joined #nim
07:27:25*PMunch quit (Ping timeout: 265 seconds)
08:23:53FromDiscord<arkanoid> given "proc foo(bar\: cstring)\: void {.cdecl, varargs.} =", how can I get the length of the varargs and relative items?
08:24:23FromDiscord<arkanoid> in C stdarg would be used https://man7.org/linux/man-pages/man3/stdarg.3.html
08:25:04FromDiscord<Elegantbeef> Likely it's unimplemented
08:25:22FromDiscord<Elegantbeef> You'd have to use emit probably
08:28:30FromDiscord<arkanoid> ok, thanks
08:53:24*om3ga joined #nim
09:03:20*mad_toothbrush joined #nim
09:42:57FromDiscord<choltreppe> sent a code paste, see https://play.nim-lang.org/#ix=4yJN
09:43:48*beholders_eye joined #nim
09:53:22FromDiscord<odexine> no idea
09:53:25FromDiscord<odexine> what version of nim
09:53:41FromDiscord<odexine> do you have code to reproduce if possible too
09:57:33*derpydoo quit (Quit: derpydoo)
10:16:37*PMunch_ is now known as PMunch
10:34:19FromDiscord<choltreppe> the newest devel version, updated a couple hours ago
10:34:49FromDiscord<choltreppe> git hash: 2054f1c3a9c78ac13593e90845807e9e64f22553
10:35:32FromDiscord<choltreppe> In reply to @odexine "do you have code": I will try
11:04:25FromDiscord<yodacbt> In reply to @odexine "What is the full": i am so so sorry i never had a chance to respond
11:31:41FromDiscord<funnybananas> In reply to @Elegantbeef "Could try zigcc in": my host dev machine is Ubuntu. This is a one off project trying to learn more about Nim. Is it as simple as swapping out `-d=mingw` for `-d=zcc` or `-d=zigcc` ?
11:34:08*eery joined #nim
11:35:35FromDiscord<mratsim> In reply to @funnybananas "my host dev machine": --cc:zigcc
12:28:37*bmp joined #nim
12:56:45*eery quit (Remote host closed the connection)
13:00:40*oprypin joined #nim
13:21:04FromDiscord<spotlightkid> sent a long message, see http://ix.io/4yKx
13:24:15*rockcavera joined #nim
13:48:39FromDiscord<michaelb.eth> would json rpc be suitable?
14:01:10FromDiscord<spotlightkid> for this program, probably yes. in the long term I'm looking for sth UDP based, without the overhead of HTTP.
14:11:51*PMunch quit (Quit: Leaving)
14:26:27*mad_toothbrush quit (Ping timeout: 256 seconds)
14:39:08FromDiscord<spotlightkid> So what good json rpc libraries are there? https://github.com/status-im/nim-json-rpc requires all kinds of stuff (e.g. crypto, websockets), which I don't really need.
14:45:02FromDiscord<demotomohiro> https://github.com/jangko/msgpack4nim↔How about to use msgpack?
14:46:29FromDiscord<demotomohiro> Here is RPC implementations based on msgpack:↔https://github.com/rogercloud/nim-rpc↔https://github.com/akiradeveloper/msgpack-rpc-nim
14:53:16FromDiscord<spotlightkid> I tried to compile the example from `nim-rpc` and it errored. It seems the bitrot has set in. It claims to depend on `msgpack4nim` but imports `msgpack`?!
14:56:31FromDiscord<odexine> the package probably used to have the module named as just msgpack
14:58:30FromDiscord<spotlightkid> I guess so. Like I said\: bitrot. Not worth wasting time on it, imho.
14:59:18FromDiscord<juh9870> Hello, I was looking for a scripting language for my automation needs, and someone suggested me to use nim, so I'm here to ask: Can I run nim source file directly, without leaving any compilation artifacts behind? And is there some kind of package manager that I can import packages from? ↔It's crucial for me to only have one file required to run the script, and no files should get created other than whatever script itself is doing
14:59:56FromDiscord<juh9870> (edit) "Hello, I was looking for a scripting language for my automation needs, and someone suggested me to use nim, so I'm here to ask: Can I run nim source file directly, without leaving any compilation artifacts behind? And is there some kind of package manager that I can import packages from? ↔It's crucial for me to only have one ... file" added "source"
15:03:57FromDiscord<spotlightkid> https://nim-lang.org/docs/nims.html (see section "Standalone NimScript")
15:04:25FromDiscord<demotomohiro> Could you tell me why you cannot leave any compilation artifacts?
15:06:44FromDiscord<demotomohiro> Nim has package manager called nimble, but it download module files.
15:07:06FromDiscord<juh9870> as long as those module files are in some global cache directory I'm ok with that
15:07:20FromDiscord<juh9870> and if it doesn't require some package file that declare dpeendencies
15:07:41FromDiscord<odexine> it kinda does
15:07:43FromDiscord<odexine> but also doesnt
15:07:47FromDiscord<spotlightkid> how would that work?↔(@juh9870)
15:08:06FromDiscord<juh9870> Deno, for example, allows you to directly import gh repos
15:08:07FromDiscord<odexine> In reply to @spotlightkid "how would that work?": nim will just import whatever from the global installation directory
15:08:31FromDiscord<odexine> In reply to @juh9870 "Deno, for example, allows": we dont have that
15:08:35FromDiscord<odexine> you still have to manually install them
15:08:45FromDiscord<odexine> and i do not know how the import system works in nimscript
15:08:59FromDiscord<juh9870> In reply to @demotomohiro "Could you tell me": I use multiple systems to develop my projects, and I don't want artifacts hanging around, and adding each one to my sync ignore file would be a pita
15:09:01FromDiscord<spotlightkid> exactly↔(@odexine)
15:09:12FromDiscord<odexine> nimscript has a lot of limitations compared to compiled nim just a notice
15:10:42FromDiscord<juh9870> I see, then probably nim is not for me
15:10:44FromDiscord<juh9870> thanks for info
15:12:01FromDiscord<odexine> i mean the way you want it is a bit strange, most people usually make a build directory where all artifacts go then ignore the whole directory
15:12:48*azimut joined #nim
15:14:19FromDiscord<demotomohiro> In reply to @juh9870 "I use multiple systems": You can set Nim's cache directory to /tmp so that all compilation artifacts are gone after reboot.
15:40:27FromDiscord<nervecenter> In reply to @juh9870 "Hello, I was looking": Nim by default compiles artifacts to a hidden `.nim` directory in your home, the only thing that ends up in your project directory is the final executable. Or, you can use `nim r` and it will compile the executable in `.nim` and run it.
15:41:17FromDiscord<odexine> i kinda forgot about nim r LMFAO thats exactly
15:44:18FromDiscord<michaelb.eth> In reply to @spotlightkid "So what good json": keep in mind that while the dependencies will get downloaded, your compiled code won't have anything in it that you didn't use
15:56:05FromDiscord<michaelb.eth> In reply to @juh9870 "I see, then probably": with it's huge standard library, you may find Racket suits your needs, if you're okay with a lang in the Scheme family:↔https://docs.racket-lang.org/guide/scripts.html↔↔Racket has a JIT and the performance is decent for many things.
16:05:39FromDiscord<xtrayambak> In reply to @juh9870 "Hello, I was looking": Nimscript?
16:10:09FromDiscord<spotlightkid> @michaelb.eth\: you're right. but from a packaging POV it's still not ideal-
16:11:16FromDiscord<michaelb.eth> In reply to @spotlightkid "<@383034029135364096>\: you're right. but": what do you mean? are you referring to downloading/importing 3rd party packages?
16:11:36FromDiscord<spotlightkid> tbh, I'll probably roll my own minimal OSC implementation. have done that in Python once already.
16:11:58FromDiscord<spotlightkid> I mean from a Linux distribution packaging standpoint.
16:13:46FromDiscord<michaelb.eth> sorry, I got mixed up with two different conversations 🙂
16:24:30*attah quit (Server closed connection)
16:24:51*attah joined #nim
16:34:14FromDiscord<arathanis> In reply to @odexine "i kinda forgot about": isn't this just a shortcut for `nim c --run`?
16:37:42FromDiscord<spotlightkid> yes. it's a bit inconvenient though, when you want to use exit codes because you get extra error messages, when the programs does not return 0.
16:38:01FromDiscord<arathanis> or if you need to compile against a different backend
16:38:06FromDiscord<spotlightkid> and it messes with POSIX signal handling, IIRC.
16:38:31FromDiscord<odexine> In reply to @arathanis "isn't this just a": it is not
16:38:41FromDiscord<arathanis> how does it differ?
16:38:51FromDiscord<odexine> artifact not in source directory
16:38:55FromDiscord<arathanis> ahhh
16:51:36*oldpcuser_ joined #nim
16:54:00*oldpcuser quit (Ping timeout: 252 seconds)
17:44:27*PMunch joined #nim
17:58:46FromDiscord<arathanis> is there a good nim library for cryptographic hashing?
18:01:17*azimut quit (Remote host closed the connection)
18:01:46*azimut joined #nim
18:03:41*candlestick joined #nim
18:04:57FromDiscord<demotomohiro> https://github.com/cheatfate/nimcrypto↔https://github.com/ringabout/awesome-nim#cryptography
18:08:25*candlestick quit (Excess Flood)
18:08:53*candlestick joined #nim
18:09:26*candlestick left #nim (#nim)
18:19:29*oldpcuser_ quit (Ping timeout: 240 seconds)
18:29:08*oldpcuser joined #nim
18:30:30FromDiscord<arathanis> thnx
19:36:11*ntat quit (Quit: Leaving)
19:37:35*ntat joined #nim
19:37:59FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4yM4
19:38:48FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=4yM4" => "https://play.nim-lang.org/#ix=4yM5"
19:39:56FromDiscord<mox> is nim worth learning? Been programming in C, Python, rust and go and i just came across nim (in my 8 years of programming) and i hear it offers the readability of python with the speed of rust
19:42:39FromDiscord<Elegantbeef> It's a very expressive system language, if that's what you want sure
19:43:06FromDiscord<nervecenter> In reply to @mox "is nim worth learning?": I'ts very nice, I use it in production. Instead of doing anything clever with memory, it simply relies on (optional) GC/RC. The advantage is that this is one of a small number of native languages where my (again, production, live) code is essentially 100% business logic. Looks like Python, very easy to read. Not quite the same, but it's different where it matters.
19:43:42FromDiscord<nervecenter> It also strongly prefers the stack and referential transparency. To use heap memory, you REALLY have to opt into it.
19:44:07FromDiscord<arathanis> In reply to @mox "is nim worth learning?": if you like Python you will like Nim. It feels ergonomically like statically type compiled Python.
19:44:08FromDiscord<jmgomez> In reply to @jmgomez "Any idea? getting: ": nvm, the type wasnt abailable in the instantiation context
19:44:11FromDiscord<arathanis> (edit) "type" => "typed"
19:44:11FromDiscord<nervecenter> Basic dynamic types like sequences are just a pointer on the stack to a bit of heap memory managed by that stack frame.
19:44:18FromDiscord<jmgomez> (edit) "abailable" => "available"
19:44:28FromDiscord<huantian> I personally also like it for quick scripts and smaller applications, I think its benifits also make it pretty good for that
19:44:49FromDiscord<arathanis> I like it for the friendly community ❀ đŸ„č
19:45:54FromDiscord<mox> In reply to @nervecenter "I'ts very nice, I": Awesome, everything you just said sounds incredibly attractive, i love python, love how easy it is to read, but the speed hurts sometimes. This could be what im looking for ina langauge, readable yet fast, downloading it right now. Especially for hobby projects this could be amazing
19:46:57FromDiscord<huantian> exactly what we need, more hobby projects using nim /j
19:47:09FromDiscord<Elegantbeef> I'm trying huan
19:47:13FromDiscord<mox> In reply to @arathanis "if you like Python": I love python, so nim sounds like a dream come true lmao
19:47:20FromDiscord<Elegantbeef> Ugh
19:47:26FromDiscord<Elegantbeef> Python and Nim are not really that similar
19:47:46FromDiscord<mox> One question i have: Does nim have a place where u can find and install packages, kind of like how rust has crates
19:48:04FromDiscord<Elegantbeef> It has the nimble package manager and package list
19:48:08FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yM6
19:48:26FromDiscord<huantian> In reply to @Elegantbeef "Python and Nim are": yeah the only thing similar is syntax tbh, the way you write programs can be quite different
19:48:29FromDiscord<arathanis> In reply to @mox "One question i have:": nimble which most people here will hazard you about
19:48:48FromDiscord<mox> In reply to @arathanis "nimble which most people": can you elaborate further?
19:48:59FromDiscord<arathanis> its... too much for a package manager?
19:49:03FromDiscord<arathanis> it tries to do too many things
19:49:20FromDiscord<mox> In reply to @arathanis "nim is also *extremely*": nim code can be exported into python? and keep its speed?
19:49:31FromDiscord<arathanis> In reply to @mox "nim code can be": it compiles as a .pyd
19:50:21FromDiscord<arathanis> syntactically Nim is similar to Python but very different pardigm. Where Python leans heavily into OOP Nim leans heavily into procedural programming.↔↔The syntax will look similar but the way a particular solution is constructed will be wildly different.
19:50:34FromDiscord<arathanis> (edit) "pardigm." => "in paradigm."
19:51:17FromDiscord<mox> In reply to @arathanis "it compiles as a": Interesting
19:51:27FromDiscord<mox> In reply to @arathanis "syntactically Nim is similar": I see okay okay, got it
19:51:35FromDiscord<arathanis> In reply to @mox "nim code can be": to elaborate, it will compile to a `.pyd` file which is a DLL file that python can import like a regular module. The underlying code is all compiled nim, it just binds to Python much like a C-extension
19:51:51FromDiscord<arathanis> (edit) "In reply to @mox "nim code can be": to elaborate, it will compile to a `.pyd` file which is a DLL file that python can import like a regular module. The underlying code is all compiled nim, it just binds to Python much like a C-extension ... " added "would but without the boilerplate"
19:52:01FromDiscord<arathanis> so it will run as fast as the Nim code would and is free from the GIL.
19:52:42FromDiscord<arathanis> I often write programs in Python for the incredible dev speed↔profile and find hot spots, and rewrite the hot spot in Nim and get crazy performance and developer alacrity
19:52:57FromDiscord<mox> In reply to @arathanis "to elaborate, it will": Thats amazing wow
19:54:03FromDiscord<mox> In reply to @arathanis "I often write programs": Interesting, regarding nim, does it have a color library similar to pythons? colored, colorama etc, i love colors for CLI tools
19:54:26FromDiscord<mox> also what is the vscode extension for nim? also whats the .extension
19:54:32FromDiscord<dissolved.girl> Colors are just ANSI escape sequences 😅
19:54:54FromDiscord<mox> In reply to @dissolved.girl "Colors are just ANSI": Of course but i was wondering if nim has a library so i wouldn't need to use haha
19:55:00FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4yM9
19:55:21FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4yM9" => "https://play.nim-lang.org/#ix=4yMa"
19:55:36FromDiscord<arathanis> (edit) "https://play.nim-lang.org/#ix=4yMa" => "https://play.nim-lang.org/#ix=4yMb"
19:56:45FromDiscord<arathanis> In reply to @mox "Of course but i": this is a builtin library: https://nim-lang.org/docs/terminal.html#progress-bar-playing-with-colorful-and-styled-text
19:57:32FromDiscord<mox> In reply to @arathanis "this is a builtin": ouuu okay
19:57:34FromDiscord<mox> thank you
19:57:40*ntat quit (Quit: Leaving)
19:57:41FromDiscord<mox> In reply to @arathanis "just make sure to": Noted, will do!
19:57:57FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#ix=4yMc
19:58:18FromDiscord<arathanis> In reply to @mox "also what is the": its called "Nim" but there are two. You want the less reviewed one by nimsaem iirc.
19:59:05FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1121167426596376758/image.png
19:59:29FromDiscord<arathanis> this is the one ive been using, i think its the "good one"
20:00:07NimEventerNew post on r/nim by Uwu_Uwu135: How to import own library., see https://reddit.com/r/nim/comments/14fhoq3/how_to_import_own_library/
20:00:24FromDiscord<bolibompa> how do you use osproc's function `terminate()`?
20:00:29FromDiscord<mox> In reply to @arathanis "its called "Nim" but": Thank you just installed it
20:00:39FromDiscord<arathanis> In reply to @nervecenter "Nim objects and Python": this is all true @mox the semantics are and style are very different. What is similar is the syntax and expressiveness ie the important part
20:00:46FromDiscord<arathanis> (edit) removed "are"
20:03:17FromDiscord<arathanis> @mox there is a 3rd party tool called `inim` you can install globally using nimble that gives you an interpreter to play with nim, it works cause nim compiles extremely fast. it basically recompiles and runs everytime you add a line
20:03:22FromDiscord<arathanis> i use it often
20:03:25FromDiscord<arathanis> for fiddling around
20:03:57FromDiscord<mox> In reply to @nervecenter "Nim objects and Python": Very interesting, i like this a lot, i also appreciate the overview that you are providing. How does nim handle things like types annotaions. do i need to specify the type? and if not will i run into compile errors?
20:04:07FromDiscord<arathanis> it must be typed
20:04:08FromDiscord<arathanis> not optional
20:04:16FromDiscord<arathanis> they aren't annotations
20:04:23FromDiscord<arathanis> its strict and statically typed
20:04:29FromDiscord<mox> okay good to know
20:04:54FromDiscord<mox> In reply to @arathanis "this is all true": So its similar in its readability and expressiveness, not in the way things are done
20:04:58FromDiscord<nervecenter> Local variables using `var` and `let` are type-inferred, EVERYTHING else needs a type annotation
20:05:00FromDiscord<arathanis> exactly
20:05:02FromDiscord<mox> In reply to @arathanis "<@1004399071848583228> there is a": I will check this out
20:05:31FromDiscord<nervecenter> (edit) "variables" => "bindings"
20:06:05FromDiscord<Elegantbeef> `yourProc.terminate()`↔(@bolibompa)
20:06:16FromDiscord<mox> In reply to @nervecenter "Local bindings using `var`": Ahh okay
20:06:31FromDiscord<arathanis> here is a good example: https://media.discordapp.net/attachments/371759389889003532/1121169296870084628/image.png
20:06:43FromDiscord<arathanis> in python they would have been copied by reference
20:06:52FromDiscord<Elegantbeef> I mean it's generally easier to just do `nvim /tmp/test.nim` 😄
20:07:10FromDiscord<arathanis> but Nim falls back on value semantics and `var e2 = e1` actually copied e1
20:07:46FromDiscord<arathanis> if you want to do things with references you have to be explicit, something the manual and docs will let you know about
20:08:18FromDiscord<mox> In reply to @arathanis "if you want to": Awesome, nim just finished installing for me im gpoing to go play with it now
20:08:36FromDiscord<mox> oh onbe last thing, can i disable the highlighting for the nim extension?
20:08:56FromDiscord<arathanis> wdym?
20:09:10FromDiscord<mox> nevermind i think it was on my end
20:09:30FromDiscord<mox> thank you all for the help and information about nim
20:21:25FromDiscord<voidwalker> Hey did anyone come here since yesterday because of the stackoverflow survey results?
20:21:30FromDiscord<demotomohiro> In reply to @bolibompa "how do you use": Call `startProcess` to run a process.↔https://nim-lang.org/docs/osproc.html#startProcess%2Cstring%2Cstring%2CopenArray%5Bstring%5D%2CStringTableRef%2Cset%5BProcessOption%5D↔Call `terminate` with the return value of startProcess when you want terminate.
20:22:32FromDiscord<mox> what http library to use with nim?
20:22:45FromDiscord<bolibompa> In reply to @demotomohiro "Call `startProcess` to run": yeah but lets say i wanna kill a process thats alredy running when i execute my file
20:23:05FromDiscord<bolibompa> In reply to @mox "what http library to": i use httpclient
20:24:31FromDiscord<voidwalker> there's also this: https://github.com/juancarlospaco/harpoon if you find any feature in it lacking in httpclient. I don't think there's any better httpclients out there ? Will work good for basic stuff, but if you want more.. you need to diy
20:24:46FromDiscord<Elegantbeef> there's also puppy and chronos
20:25:07FromDiscord<Elegantbeef> the stdlib uses openssl so it requires shipping it on windows
20:26:02FromDiscord<mox> In reply to @bolibompa "i use httpclient": okay thank you
20:26:06FromDiscord<demotomohiro> In reply to @bolibompa "yeah but lets say": As far as I know, `osproc.terminate` cannot kill any already running process.↔It can kill only processes you started with `osproc.startProcess`.
20:26:20FromDiscord<bolibompa> ok thanks anyway
20:27:31FromDiscord<Elegantbeef> Ping
20:27:41FromDiscord<arathanis> Pong
20:28:02FromDiscord<Elegantbeef> For terminating other programs you likely need to wrap the system API on whatever OS you're targetting
20:28:36FromDiscord<mox> In reply to @Elegantbeef "there's also puppy and": taking a look at puppy right now
20:29:34FromDiscord<Elegantbeef> On linux you can just do `kill(pid, SigTerm)`
20:29:51FromDiscord<Elegantbeef> Which is wrapped here
20:29:52FromDiscord<Elegantbeef> https://nim-lang.org/docs/posix_utils.html#sendSignal,Pid,int
20:30:59FromDiscord<Elegantbeef> The windows version is here https://nim-lang.org/docs/winlean.html#terminateProcess%2CHandle%2Cint
20:31:11FromDiscord<mox> Nim vscode package has virtually no intellsense, normal or issue?
20:31:18FromDiscord<bolibompa> how do i get size of a string?
20:31:24FromDiscord<huantian> `.len`?
20:31:25FromDiscord<Elegantbeef> `.len`
20:31:28FromDiscord<bolibompa> like not length but actual size
20:31:35FromDiscord<bolibompa> amount of bytes
20:31:42FromDiscord<Elegantbeef> Size on stack?
20:31:43FromDiscord<Elegantbeef> Size of heap
20:31:44FromDiscord<arathanis> In reply to @mox "Nim vscode package has": it relies on Nimsuggest which has problems. Sometimes it likes to pretend its chrome and eat all the RAM. Otherwise it can just take some time to initialize. It is one of the current pain points.
20:31:47FromDiscord<Elegantbeef> Size of what
20:32:04FromDiscord<arathanis> Give it some times and intellisense will start functioning
20:32:33FromDiscord<bolibompa> no idea. im trying to make sure that a string im sending isnt too big
20:32:57FromDiscord<mox> In reply to @arathanis "it relies on Nimsuggest": Ah okay got it
20:32:57FromDiscord<Elegantbeef> so you want `.len`
20:33:09FromDiscord<Elegantbeef> `sizeof(string)` is a constant size of the stack allocated size
20:33:20FromDiscord<Elegantbeef> `len` is the dynamically allocated size
20:33:24FromDiscord<bolibompa> alright ill try it out
20:33:26FromDiscord<huantian> maybe `.len + 1` if you're including the null terminator
20:33:50FromDiscord<mox> macos how do i xport nim to my path permentaly
20:33:57FromDiscord<mox> just had a spasm sorry lmao
20:34:17om3gawhat's the difference between `if key in Table` with `if Table.hasKey(key)` ?
20:35:23FromDiscord<arathanis> In reply to @om3ga "what's the difference between": nothing
20:35:27FromDiscord<Andreas> In reply to @om3ga "what's the difference between": no difference
20:35:43om3gathanks lads!
20:36:00FromDiscord<arathanis> `a in b` is sugar for `b.contains(a))` and `contains` for Table is an alias of `hasKey`
20:36:07FromDiscord<arathanis> (edit) "`b.contains(a))`" => "`b.contains(a)`"
20:36:32om3gaI prefer "if key in table", easy to read
20:36:36FromDiscord<elegantbeef> Damn bridge is failing
20:36:40FromDiscord<elegantbeef> Burn it down
20:36:51FromDiscord<arathanis> https://tenor.com/view/burn-so-long-stink-town-simpsons-homer-simpson-burning-bridges-gif-5640116
20:36:53FromDiscord<elegantbeef> In reply to @mox "macos how do i": https://media.discordapp.net/attachments/371759389889003532/1121176936304082944/image.png
20:39:07om3gaI have bash here in Mojave
20:44:52*beholders_eye quit (Ping timeout: 240 seconds)
20:45:21FromDiscord<mox> In reply to @Elegantbeef "there's also puppy and": using puppy but see no way to pass a proxy through
20:48:14FromDiscord<elegantbeef> I don't really use any http clients so uhh yes 😄
21:08:13FromDiscord<michaelb.eth> In reply to @mox "macos how do i": Did you install with choosenim?
21:09:46*PMunch quit (Quit: leaving)
21:20:17FromDiscord<near> The c/c++ backend of version 1.6.12 complains about code at https://play.nim-lang.org/#ix=4yMi↔Nim 1.9.5 with c backend too. Nim 1.9.5 with c++ backend compiles.
21:25:51om3gais not a structure or union....
21:31:00FromDiscord<bolibompa> why wont the variables declare? https://media.discordapp.net/attachments/371759389889003532/1121190555888656434/nim_triflin.jpg
21:36:34*adium quit (Server closed connection)
21:37:30*adium joined #nim
21:38:48FromDiscord<mox> how to get current time?
21:38:51FromDiscord<mox> .time
21:39:15FromDiscord<arathanis> In reply to @mox "how to get current": std/times
21:40:11FromDiscord<huantian> In reply to @bolibompa "why wont the variables": you're declaring gpu in the scope of the inside of the try statement
21:40:16FromDiscord<huantian> it doesn't exist outside of the try statement
21:42:04FromDiscord<bolibompa> Oh shit youre right
21:42:11FromDiscord<bolibompa> Im so used to python
21:42:16FromDiscord<huantian> You might want to consider using a try statement
21:42:37FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4yMo
21:43:20FromDiscord<demotomohiro> In reply to @bolibompa "why wont the variables": How about to use try expression: https://nim-lang.org/docs/manual.html#exception-handling-try-expression
21:43:31FromDiscord<huantian> (edit) "statement" => "expression"
21:43:51FromDiscord<bolibompa> In reply to @demotomohiro "How about to use": Im def gonna use that instead, thanks!
21:52:42FromDiscord<mox> any library for bringing up the file dialog? mac windows or linux
21:59:55FromDiscord<tauruuuuuus> Quick question, if anyone knows: is there no way to natively do a regex-based replace within a macro/at compile time with the stdlib only?
22:04:58FromDiscord<spotlightkid> There is no "the" file dialog on linux. If you need a cross-platform file seletor, you best bet would be one of the big GUi frameworks Qt (e.g. via nimqml) or GTK (e.g. via owlkettle).↔(@mox)
22:05:51FromDiscord<spotlightkid> Or you can rely on the presemce of "zenity" or "yad" on linux and call those as external programs.
22:06:08FromDiscord<mox> In reply to @spotlightkid "There is no "the"": Thank you for the info ill check out owlkettle
22:11:58FromDiscord<bungfro> How would I structure my library like this:↔↔Current you can do `send()`, however I want them to be required to use `mylibrary.send()` instead. Is there any way to do this
22:12:01FromDiscord<bungfro> (edit) "this" => "this?"
22:13:59FromDiscord<Elegantbeef> Why would you force them to do that?
22:14:17FromDiscord<Elegantbeef> If you want to do it you can do `import mylibrary as nil` but why force it onto others
22:15:32FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/GUEOC
22:18:14FromDiscord<huantian> me about to write all the code with `send(MyLibrary)`
22:18:23FromDiscord<!&luke> How can I get futhark to link to a .so filr
22:18:26FromDiscord<!&luke> (edit) "filr" => "file"
22:18:41FromDiscord<huantian> futhark doesn't manage the dynamic linking aspect
22:18:43FromDiscord<huantian> I believe
22:18:51FromDiscord<Elegantbeef> It doesnt
22:18:53FromDiscord<Elegantbeef> you link it yourself
22:18:56FromDiscord<!&luke> Yea I think the Nim compiler does
22:19:05FromDiscord<Elegantbeef> `{.passL:"-lmyLib".}`
22:19:20FromDiscord<!&luke> In reply to @Elegantbeef "`{.passL:"-lmyLib".}`": Ok
22:19:33FromDiscord<bungfro> In reply to @Elegantbeef "Why would you force": Would them defining a variable with the same name override anything? Let's say I have `mylibrary.channels` but they define a variable in their file `channels`?
22:20:47FromDiscord<huantian> your library can export a proc named channels, and your user can import your library and also use their own variable named channels
22:21:18FromDiscord<bungfro> Alright, thanks.
22:21:29FromDiscord<Elegantbeef> Nim allows disambiguation where there is ambiguity
22:21:43FromDiscord<Elegantbeef> you can do `myLibrary.send` if there is ambiguity or `mymodule.send`
22:22:11FromDiscord<Elegantbeef> There is rarely a case where you need to force the user to disambiguate
22:24:25FromDiscord<bungfro> Got it
22:25:23FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4yMv
22:25:53FromDiscord<Elegantbeef> It requires too many iteration increase the iterator iterations
22:26:04FromDiscord<Elegantbeef> The Nim vm has iteration caps to prevent runaway code
22:26:41FromDiscord<!&luke> In reply to @Elegantbeef "It requires too many": i have no idea to what tho
22:27:21FromDiscord<!&luke> should i just spam the 9 key or sm
22:30:48FromDiscord<!&luke> Now it says the source file isn't valid utf8
22:32:12FromDiscord<arkanoid> it's quite common, just raise the limit with a switch↔(@!&luke)
22:32:27FromDiscord<!&luke> In reply to @arkanoid "it's quite common, just": Yea
22:33:14FromDiscord<arkanoid> https://forum.nim-lang.org/t/8771#57167
22:34:17FromDiscord<!&luke> Now it says stddef.h doesnt exisy
22:34:19FromDiscord<!&luke> (edit) "exisy" => "exist"
22:35:44FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4yMw
22:39:29FromDiscord<!&luke> Only using path solved that
22:41:16FromDiscord<!&luke> For passL do I pass the path of the header file?
22:42:35*lucasta joined #nim
22:43:03*lucasta quit (Remote host closed the connection)
22:47:50FromDiscord<Elegantbeef> No
22:47:53FromDiscord<Elegantbeef> You pass the name of the lib
22:47:59FromDiscord<!&luke> In reply to @Elegantbeef "You pass the name": That didn't work
22:48:58FromDiscord<!&luke> sent a code paste, see https://play.nim-lang.org/#ix=4yMy
22:49:15FromDiscord<Elegantbeef> well that's wrong
22:49:36FromDiscord<Elegantbeef> Is this a dynamic or static library?
22:54:29FromDiscord<mox> sent a code paste, see https://play.nim-lang.org/#ix=4yMz
22:59:09FromDiscord<Elegantbeef> https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring
23:04:42FromDiscord<!&luke> i have no ida
23:05:02FromDiscord<!&luke> In reply to @Elegantbeef "Is this a dynamic": i have no idea
23:05:14*rockcavera quit (Remote host closed the connection)
23:08:36FromDiscord<bungfro> sent a code paste, see https://play.nim-lang.org/#ix=4yMC
23:10:04*rockcavera joined #nim
23:11:21FromDiscord<Elegantbeef> Why are you using nimcord instead of dimscord?
23:12:20FromDiscord<bungfro> I'm creating my own library
23:12:36FromDiscord<Elegantbeef> Ah poorly named then 😄
23:12:59FromDiscord<bungfro> Got any ideas 😆
23:13:16FromDiscord<Elegantbeef> Doesnt matter presently, trying to reason where the error comes from
23:13:49FromDiscord<Elegantbeef> does `yourModule.client.login()` wor?
23:13:51FromDiscord<Elegantbeef> work\
23:14:06FromDiscord<Elegantbeef> Curious if it's an issue with an overloaded symbol name, though that error makes no sense in that case
23:14:35FromDiscord<Elegantbeef> does `client` return the same `Client` type as `login` uses
23:14:38FromDiscord<bungfro> No, it doesn't work
23:14:43FromDiscord<bungfro> In reply to @Elegantbeef "does `client` return the": Yeah
23:21:58FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4yME
23:24:26FromDiscord<Elegantbeef> Yep
23:24:29FromDiscord<spotlightkid> This will result in the correct `-lalpm` (not `-llibalpm`!) being passed to the linker.
23:25:04FromDiscord<Elegantbeef> the header file doesnt matter, futhark has it's own wrapped FFI code
23:25:19FromDiscord<Elegantbeef> The entire point of futhark is to get a C ABI in Nim syntax
23:27:05FromDiscord<bungfro> Any idea why this is happening yet or nah?
23:29:27FromDiscord<Elegantbeef> Or atleast look at the code
23:32:46FromDiscord<that_dude.> Sounds like you'll just need to start messing with stuff to try to figure out what breaks down, more echo's and typeof's galore
23:33:38FromDiscord<that_dude.> My first instinct in not to use the same name for both functions and variables
23:34:08FromDiscord<bungfro> In reply to @that_dude. "My first instinct in": I changed them but still the same error.
23:34:30FromDiscord<that_dude.> And also without async?
23:34:35FromDiscord<bungfro> Yeah
23:34:50FromDiscord<that_dude.> And without the `nimcord.` part?
23:35:18FromDiscord<bungfro> yes
23:36:13FromDiscord<elegantbeef> This bridge really is testing my patience, what's your nimcord module
23:36:16FromDiscord<elegantbeef> Let us see
23:39:00FromDiscord<bungfro> sent a code paste, see https://play.nim-lang.org/#ix=4yMG
23:39:22FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4yMH
23:39:30FromDiscord<bungfro> (edit) "https://play.nim-lang.org/#ix=4yMG" => "https://play.nim-lang.org/#ix=4yMI"
23:39:45FromDiscord<bungfro> In reply to @bungfro "Nothing big rn ": Forgot to show the imports, but everything is imported as required.
23:41:56FromDiscord<Prestige> Am I doing something wrong here? https://play.nim-lang.org/#ix=4yMK or is there just an issue with inheritance + generics?
23:42:02FromDiscord<Prestige> boiled it down as much as I could
23:42:50FromDiscord<elegantbeef> In reply to @bungfro "Forgot to show the": So you import and export everything?
23:43:15FromDiscord<bungfro> In reply to @elegantbeef "So you import and": Yep
23:43:20FromDiscord<elegantbeef> No prestige it works "properly" you need a concept to constrain that way
23:43:57FromDiscord<that_dude.> Have you `import types` into test or `export types` from nimcord?
23:44:08FromDiscord<elegantbeef> https://play.nim-lang.org/#ix=4yMK like this
23:44:39FromDiscord<elegantbeef> Inside a type generic parameter `[T: Particle]` states it must be a `Particle` child types are disallowed
23:44:53FromDiscord<elegantbeef> Can you show the verbatim `nimcord`?
23:44:59FromDiscord<bungfro> In reply to @that_dude. "Have you `import types`": I don't import or export them, I use include. In the test.nim file I can get everything I assign, such as token, rest, etc.
23:45:01FromDiscord<Prestige> oh, I wanted to allow Particle _and_ child types
23:45:07FromDiscord<elegantbeef> There you go
23:45:11FromDiscord<Prestige> also you sent me the same link back @elegantbeef
23:45:11FromDiscord<elegantbeef> stop using `include`
23:45:17FromDiscord<elegantbeef> `import` and `export`
23:45:21FromDiscord<elegantbeef> > 500: Something went wrong while uploading, please try again
23:45:22FromDiscord<elegantbeef> Yea sorry
23:45:30FromDiscord<Prestige> ah dang
23:45:31FromDiscord<elegantbeef> https://play.nim-lang.org/#ix=4yML
23:45:32FromDiscord<that_dude.> Include is basically copy and paste, but generally not used
23:46:10FromDiscord<bungfro> In reply to @elegantbeef "`import` and `export`": That works, thank you so much
23:46:24FromDiscord<elegantbeef> You likely accidently created two `client` types
23:46:36FromDiscord<elegantbeef> since `include` is copy paste, hence why the error was so useless
23:46:56FromDiscord<bungfro> I see thanks.
23:47:08FromDiscord<elegantbeef> I'll tell you now aswell, never use `cast`
23:47:12FromDiscord<millymox> @elegantbeef could you help me?
23:47:14FromDiscord<elegantbeef> That'll save you another headacke
23:47:16FromDiscord<elegantbeef> I could
23:47:31FromDiscord<Prestige> I don't quite understand the reason for the concept here but I'll take it for now đŸ€”
23:47:34FromDiscord<millymox> sent a code paste, see https://play.nim-lang.org/#ix=4yMM
23:47:37FromDiscord<elegantbeef> `except CatchableError as e:` and `echo e.msg`
23:47:50FromDiscord<elegantbeef> The reason is that inside of typedefs `T: Parent` forces `Parent`
23:47:54FromDiscord<elegantbeef> So only `Parent` matches
23:48:01FromDiscord<elegantbeef> The concept makes it so child types can match
23:48:17FromDiscord<elegantbeef> It's inconsistent with procedures, but it's what it is
23:48:21FromDiscord<Prestige> interesting
23:49:05FromDiscord<millymox> In reply to @elegantbeef "`except CatchableError as e:`": e.msg brings back the file path aka result
23:49:16FromDiscord<millymox> and also this↔↔2023-06-21
23:49:25FromDiscord<millymox> cannot open: 2023-06-21 17:48:28.373 zenity[63288:1620047] +[CATransaction synchronize] called within transaction
23:52:46FromDiscord<that_dude.> If I had to guess, it starts zenity, but then the main nim program ends, killing the child process
23:53:11FromDiscord<that_dude.> It doesn't look like `execCmdEx` is designed to block https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring
23:53:36FromDiscord<that_dude.> Or something along that line
23:53:54FromDiscord<that_dude.> Or maybe a permission issue?
23:54:08FromDiscord<elegantbeef> `execCmdEx` is blocking
23:54:18FromDiscord<elegantbeef> it returns `string, exitcode` it has to be blocking
23:54:28FromDiscord<that_dude.> Makes sence to me
23:54:34FromDiscord<that_dude.> (edit) "sence" => "sense"
23:54:53FromDiscord<Prestige> Hm okay it worked for the smaller example, but still having the same error with the actual code base. Would you mind taking a look, beef? I think it may be apparent to you, there's not much changed code
23:55:31FromDiscord<Prestige> https://github.com/einheit-tech/shade/compare/particleEmitter?expand=1#diff-8d854b419cb26c4e63784e736859f896ced301f287e27a21a08d9a0576b28ba9R5 is the changes, the example of using the emitter is in `examples/particles/particles_example.nim` (shown near the top)
23:56:21FromDiscord<Prestige> Hell nvm I just figured out the problem, lol
23:58:07FromDiscord<!&luke> In reply to @spotlightkid "It's `libalpm.so` from https://archlinux.org/packag": thank you, that works amazing
23:58:32FromDiscord<elegantbeef> The issue mox is that there are some extra spaces
23:58:41FromDiscord<elegantbeef> `let result = result.strip` works