<< 29-06-2022 >>

00:02:28FromDiscord<Prestige> I hear that a lot in general (not just with nim)
00:02:51FromDiscord<Elegantbeef> Yea i mean it's due to the android build process for native code, it's not easy
00:03:48FromDiscord<demotomohiro> Install termux on android, install Nim & Neovim on termux and create command line program is an easiest way to create an app runs on android :p
00:04:47FromDiscord<Prestige> Lol
00:06:39FromDiscord<Elegantbeef> The future of google play is running `nimble install myprogram`
00:10:46*noeontheend quit (Ping timeout: 268 seconds)
00:28:12*noeontheend joined #nim
00:33:43FromDiscord<demotomohiro> I have wrote this program on Termux on Android:↵https://github.com/demotomohiro/DUBF↵It tests you to see whether you can distinguish similar looking characters.
00:34:27FromDiscord<Elegantbeef> Is there a list of homoglyphs? I've never personally looked 😄
00:36:16FromDiscord<Elegantbeef> Well if there are any lists they're all inside JS projects apparently
00:39:51FromDiscord<!Patitotective> the best way to convert a string to a seq is `str.toSeq()`, right?
00:40:35FromDiscord<Elegantbeef> string to a sequence of what?
00:40:59FromDiscord<!Patitotective> chrs
00:41:00FromDiscord<!Patitotective> (edit) "chrs" => "chars"
00:41:17FromDiscord<Elegantbeef> `toOpenArray` if you dont want to copy
00:42:08FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=41a0
00:42:44FromDiscord<demotomohiro> @ElegantBeef I just picked characters that I think looks similar: https://github.com/demotomohiro/DUBF/blob/65f3c469f9acbd767201672f5fc1de73d30a7f4f/src/dubf.nim#L4
00:43:29FromDiscord<Elegantbeef> There is `allIt` but that's for a single collection
00:44:31FromDiscord<Elegantbeef> Though you could do something like `(0..first.high).allIt(predicate(first[it], second[it]))`
00:44:49FromDiscord<!Patitotective> In reply to @Elegantbeef "Though you could do": 🤔
00:45:49FromDiscord<demotomohiro> Overload `==` for type `A` and `B` and compare 2 seqs like `seq1 == seq2`?
00:46:52FromDiscord<Elegantbeef> What patito sequtils has magic procedures
00:46:55FromDiscord<!Patitotective> In reply to @demotomohiro "Overload `==` for type": yea well but the other solution is more generic
00:47:06FromDiscord<Elegantbeef> "more generic"
00:47:12FromDiscord<!Patitotective> hehe
00:47:18FromDiscord<Elegantbeef> It's inaccurately named
00:47:40FromDiscord<Elegantbeef> It's doing more than checking if A equals B it's checking that it passes a predicate
00:47:56FromDiscord<!Patitotective> then `fullfillPredicate`? lol
00:48:05FromDiscord<Elegantbeef> The real question is why does it exist?
00:48:25FromDiscord<Elegantbeef> You're just making a proc to iteratively call a procedure, why not just call the procedure you want
00:48:48FromDiscord<Elegantbeef> Like why does predicate work on the element level when you could just write a proc that works on the element level
00:49:02FromDiscord<!Patitotective> i translated it from c++ 🤷‍♂️ ↵but i guess youve got reason
00:49:47FromDiscord<Elegantbeef> I mean i dont even have context
00:49:57FromDiscord<Elegantbeef> So i'm just saying what i can see
00:53:03FromDiscord<!Patitotective> ImGuiColorTextEdit saves lines as sequences of glyphs (with the color for each glyph and more) so when it needs to compare an actual string to a segment of a line it used that `equals` procedure↵but now i think it will be much easier to make a proc that converts a line to a string and then compare it
00:53:21FromDiscord<!Patitotective> (edit) "procedure↵but" => "procedure (to get the string of a glyph)↵but"
00:53:31FromDiscord<Elegantbeef> That doesnt sound very unicode compliant
00:55:12FromDiscord<Elegantbeef> Infact what you provided was certainly not unicode compliant 😄
00:55:15FromDiscord<!Patitotective> well each glyph holds a rune but i havent tested it yet so :p
00:56:37FromDiscord<!Patitotective> for it to be unicode compliant it will have to check that each rune in both strings are the same right? not strings but runes
00:56:48FromDiscord<Elegantbeef> Yes
00:57:06FromDiscord<Elegantbeef> I mean you have to ensure both characters are identical
00:57:29FromDiscord<Elegantbeef> The issue is that with the above code you broke up the string into characters so depending on what you're checking you're going to get incorrect result
00:57:46FromDiscord<Elegantbeef> Say you where checking for only printable characters
00:58:02FromDiscord<!Patitotective> so, should i use this https://nim-lang.org/docs/unicode.html#runes.i%2Cstring
00:58:16FromDiscord<Alea> is there some macro way to convert a string to a variable name?
00:58:46FromDiscord<Elegantbeef> yea alea you just do `ident(myString)`
00:58:53FromDiscord<Alea> very cool, thanks
00:58:57FromDiscord<Elegantbeef> Patito if you're breaking up a string and want to run a predicate on it yes you do
00:59:35FromDiscord<Elegantbeef> You want the predicate to take the entire glyph not just 1 part out of 4 possible parts
01:02:23FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=41a4
01:02:52FromDiscord<Elegantbeef> I mean if you're just comparing you can just do `str1 == str2`
01:03:14FromDiscord<Elegantbeef> utf8 doesnt change basic logic
01:03:34FromDiscord<Elegantbeef> For two strings to be identical they have to have the same data and same length
01:03:45FromDiscord<Alea> In reply to @Elegantbeef "yea alea you just": so that returns a NimNode; how do I actually use that as say an object field name?
01:04:02FromDiscord<Elegantbeef> You place it where you need it
01:04:08FromDiscord<Elegantbeef> It's AST you need to emit AST
01:06:47FromDiscord<Elegantbeef> Also this is terrible to do ` if str1.runeAt(i) != str2.runeAt(i):`
01:06:47FromDiscord<Elegantbeef> For unicode getting a rune at a index requires iterating the entire string
01:08:00FromDiscord<Elegantbeef> Sadly there isnt a good closure iterator
01:08:11FromDiscord<Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=41a5
01:09:11FromDiscord<Professor Actual Factual> (edit) "https://play.nim-lang.org/#ix=41a5" => "https://play.nim-lang.org/#ix=41a7"
01:09:38FromDiscord<Elegantbeef> Full code would be nice
01:09:41FromDiscord<Elegantbeef> Also do `x: MyObj`
01:10:17FromDiscord<Elegantbeef> also make that a `proc genMainCaseStmt(x: NimNode)`
01:10:20FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=41a8
01:10:55FromDiscord<Elegantbeef> You can but if you have two lines you can just compare the glyphs
01:12:14FromDiscord<demotomohiro> In reply to @Professor Actual Factual "Hello macro wizards, how": If you want to separate some code in macro, use proc that takes/return `NimNode`.
01:12:35FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "also make that a": Thank you that worked 🙂
01:12:40FromDiscord<Elegantbeef> Macros expand at callsite
01:12:41FromDiscord<Professor Actual Factual> In reply to @demotomohiro "If you want to": Thanks 🙂
01:12:49FromDiscord<Elegantbeef> So yes you cannot have a macro return a nimnode
01:13:55FromDiscord<!Patitotective> In reply to @Elegantbeef "You can but if": but glyphs hold more than the runes so ill need to map each lines to get the runes
01:18:21FromDiscord<!Patitotective> also how do i compare two runes lenghts? do i have to convert them two strings first
01:21:17FromDiscord<Elegantbeef> `runeLen` exists
01:21:38FromDiscord<Elegantbeef> But you should be able to just do `runeA == runeB`
01:21:38FromDiscord<!Patitotective> yea but it takes a string, not a rune :7↵https://nim-lang.org/docs/unicode.html#runeLen%2Cstring
01:21:40FromDiscord<!Patitotective> (edit) ":7↵https://nim-lang.org/docs/unicode.html#runeLen%2Cstring" => ":/↵https://nim-lang.org/docs/unicode.html#runeLen%2Cstring"
01:21:53FromDiscord<!Patitotective> In reply to @Elegantbeef "But you should be": i only want to compare the lenght
01:21:55FromDiscord<!Patitotective> (edit) "lenght" => "length"
01:23:24FromDiscord<Elegantbeef> Bitwise ops is the answer
01:24:16FromDiscord<!Patitotective> https://nim-lang.org/docs/unicode.html#size%2CRune 🤔
01:24:31FromDiscord<Elegantbeef> Yep
01:24:46*noeontheend quit (Ping timeout: 268 seconds)
01:55:51FromDiscord<Prestige> I'm contemplating home automation, but don't want to deal with these pre-made solutions like alexa etc that talk to a company's infrastructure. Anyone here doing something like this? If not, I might just start from the ground up
01:56:07FromDiscord<Elegantbeef> Think pmunch might be
02:04:21*jkl1337 is now known as jkl
02:24:13FromDiscord<Prestige> hm yeah he has some ikea smart home things it looks like
02:28:54FromDiscord<fezhead> i've heard high praise for https://www.home-assistant.io/
02:45:59FromDiscord<!Patitotective> i have a `handleKeyboardInputs` bool and a `handleKeyboardInputs` proc (that gets ran when `handleKeyboardInputs` is true)↵which one should i rename? 🤔
02:46:32FromDiscord<Elegantbeef> `hasKeyboardInputs` and `handleKeyboardInputs`
02:48:44FromDiscord<!Patitotective> 🧠
03:23:41*LuxuryMode quit (Quit: Connection closed for inactivity)
03:52:21*xet7 joined #nim
03:57:08*arkurious quit (Quit: Leaving)
04:09:41FromDiscord<b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41al
04:10:26FromDiscord<Rika> Run the binary directly
04:11:07FromDiscord<b1rdf00d> sent a code paste, see https://play.nim-lang.org/#ix=41am
04:16:42FromDiscord<Rika> Ah I didn’t read the thing properly
04:17:23FromDiscord<b1rdf00d> if I change the exit code, then the result is multiplied by 256, e.g. exit(2) -> 512
04:22:52*toluene quit (Read error: Connection reset by peer)
04:24:35*toluene0 joined #nim
04:29:22NimEventerNew Nimble package! seq2d - A 2D Sequence Implementation, see https://github.com/avahe-kellenberger/seq2d
04:44:01*rockcavera quit (Remote host closed the connection)
04:44:19FromDiscord<Elegantbeef> @Prestige\: you know your `items` should yield just `value` and you should have another for x, y coord?
04:44:33FromDiscord<Elegantbeef> You also dont have a mutable version of those
04:48:23FromDiscord<demotomohiro> It should have `proc `[]`[T](this: var Seq2D[T], x, y: int): var T {.inline.} =`.
04:48:24FromDiscord<Elegantbeef> Guess the items part is subjective
04:50:20FromDiscord<demotomohiro> `x`, `y` parameter of `[]` and `[]=` should be `Natural` so that it never be negative value.
04:52:16FromDiscord<demotomohiro> In reply to @Elegantbeef "<@778498877464117248>\: you know your": https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-implicit-itemsslashpairs-invocations
04:52:52FromDiscord<xflywind> I would like to build a github bot collecting compiler metrics for each commit => https://github.com/nim-lang/Nim/pull/19941#issuecomment-1169531271
04:57:48FromDiscord<Elegantbeef> Also prestige https://nim-lang.org/docs/osproc.html#execProcesses%2CopenArray%5Bstring%5D%2Cproc%28int%29%2Cproc%28int%2CProcess%29 exists you dont need to remake it yourself
05:00:18FromDiscord<Prestige> In reply to @Elegantbeef "<@778498877464117248>\: you know your": Eh it doesn't make a whole lot of sense here imo
05:01:06FromDiscord<Prestige> In reply to @Elegantbeef "You also dont have": I wasn't sure how to do that with something like int because it would throw an error, saying it doesn't have an address
05:01:19FromDiscord<Elegantbeef> What?
05:01:41FromDiscord<Elegantbeef> Iterators can yield `(int, int, var T)`
05:02:34FromDiscord<Prestige> Yeah I had an error with that
05:02:41FromDiscord<Prestige> I'll recreate it tomorrow
05:02:53FromDiscord<Elegantbeef> Take your go go juice before writing it
05:04:26FromDiscord<Prestige> Eh?
05:05:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=41at
05:05:19FromDiscord<Elegantbeef> It works
05:05:58FromDiscord<Elegantbeef> It even works with that god awful tuple syntax
05:06:24FromDiscord<Elegantbeef> Did you perchance do `var (int, int, T)`?
05:06:50FromDiscord<Elegantbeef> Or did you not have a `[]` which returned `var T`
05:08:12FromDiscord<Elegantbeef> Also i'd raise a `RangeDefect` for the `[]` accessors
05:09:01FromDiscord<Elegantbeef> Feel free to tell me to sod off whenever
05:09:13FromDiscord<Prestige> I did what you did but used a named tuple
05:09:24FromDiscord<Elegantbeef> It even works with a named tuple
05:09:53FromDiscord<Prestige> Didn't for me earlier so I removed it
05:10:12FromDiscord<Prestige> I'm on my phone I'll try again tomorrow
05:11:03FromDiscord<Elegantbeef> Well this concludes my unasked for code review 😄
05:13:20FromDiscord<Prestige> I don't think it'd make a difference but I think I was using += or `inc`
05:14:10FromDiscord<Elegantbeef> A suggestion that is completely up to you is to use a template instead of copy pasting the code for those raise checks
05:14:32FromDiscord<Elegantbeef> I dont like to repeat myself so i template stuff like that
05:15:14FromDiscord<Prestige> Good idea
05:22:02*gsalazar_ joined #nim
05:24:45*gsalazar quit (Ping timeout: 256 seconds)
07:13:57*gsalazar_ quit (Quit: Leaving)
07:14:14*gsalazar joined #nim
07:47:07NimEventerNew thread by Dee0xeed: State machines example : echo-server, see https://forum.nim-lang.org/t/9271
07:53:08NimEventerNew thread by Xflywind: Which metrics we should collect for each commit if building a GitHub Action bot?, see https://forum.nim-lang.org/t/9272
08:16:54FromDiscord<soundmodel> In reply to @exelotl "Java is so painful": It's not just the language, it's also that the VM makes these stupid locks like "no option for not using GC" and therefore "no precise control over sub 20ms latencies".
08:17:52FromDiscord<soundmodel> so if I wish to develop algorithms that are in fact about low-latency, then the mere Java VM seems to invalidate all of this. And there's no option to use anything else.
08:30:42FromDiscord<soundmodel> Nim could make a good language for mobile, but I wonder if we'd ever see such.
08:30:56FromDiscord<soundmodel> (edit) "such." => "this."
08:34:50FromDiscord<Phil> I never developed for Android. What's stopping it from running binaries compiled for arm ?
08:36:13FromDiscord<Phil> The ability to install/run the binary with any reasonable amount of effort?
08:36:34FromDiscord<Elegantbeef> The way the OS is layed out it cannot native code like a desktop
08:36:36FromDiscord<Elegantbeef> I mean it can inside termux
08:36:54FromDiscord<Phil> So JVM or go die?
08:37:09FromDiscord<Elegantbeef> Well it's not JVM but pretty much you need to use it to talk to the core OS for apps
08:37:42FromDiscord<Elegantbeef> So in the case of like a SDL2 backed program with opengl you need to use a basic java class to setup the context and call your native code
08:38:01FromDiscord<Elegantbeef> It's not impossible to make this easy, it's just a pain in the arse to setup ime
08:38:11FromDiscord<soundmodel> Yes termux can run C programs etc., but that means that you ought to not have a GUI and definitely not a nativeone.
08:38:16FromDiscord<soundmodel> (edit) "nativeone." => "native one."
08:38:51FromDiscord<Prestige> I'm contemplating getting a pinephone and just writing apps for whatever I need personally, tbh. I'm tired of android stuff
08:39:18FromDiscord<soundmodel> So in essence a non-JVM language cannot touch and Android platform.
08:39:25FromDiscord<Elegantbeef> Like in my experience it's fiddling with android studio, then writing android make files, then finally getting it to work
08:39:41FromDiscord<soundmodel> which is a bit odd, because then new language developments cannot be implemented on such platforms
08:40:04FromDiscord<soundmodel> so one writes with Nim for desktop, but not on mobile
08:40:05FromDiscord<Elegantbeef> Well you can use a system library, but yea you need to interop back and forth
08:40:45FromDiscord<soundmodel> (edit) "and" => "an"
08:41:04FromDiscord<Elegantbeef> nimx and nico for instance supports android to some capacity
08:41:31FromDiscord<Elegantbeef> No native gui which is a little bit of a shame given Nim's macro capabillities
08:41:39FromDiscord<soundmodel> Yes, but they cannot get past the VM's limitations, so they will not solve the fundamental problems.
08:41:48FromDiscord<soundmodel> they just allow using another language
08:42:09FromDiscord<Elegantbeef> "VM limitations"?
08:42:28FromDiscord<soundmodel> well mainly GC
08:42:38FromDiscord<Elegantbeef> They do get past the VM limitations
08:42:48FromDiscord<Elegantbeef> They're system libraries they're not on the VM
08:42:58FromDiscord<Elegantbeef> They're sandboxed but you get full control of memory allocations
08:43:07FromDiscord<soundmodel> so they're bindings on Android NDK?
08:43:16FromDiscord<soundmodel> (edit) "on" => "to"
08:43:22FromDiscord<Elegantbeef> How else do you run Nim on android?
08:43:34FromDiscord<soundmodel> but I thought Android NDK was a subset of the SDK
08:43:46FromDiscord<Elegantbeef> NDK is the native part of it
08:44:04FromDiscord<soundmodel> since the official page says that it's "The Android NDK is a toolset that lets you implement parts of your app in native code"
08:44:04FromDiscord<Elegantbeef> It's how you use libraries written in other languages, it runs natively afaik
08:44:23FromDiscord<soundmodel> (edit) removed "it's"
08:44:26FromDiscord<Elegantbeef> You can implement the entirety other than the entry in native code
08:44:47FromDiscord<soundmodel> hmm I'll have to look at nimx etc. then
08:45:02FromDiscord<Elegantbeef> It doesnt use native gui on android but it is cross platform
08:45:39FromDiscord<Elegantbeef> Checkout sdl2's android example if you want to see what's required
08:46:08FromDiscord<Elegantbeef> You do have a lot of code written in java running in conjunction, but you can work entirely in Nim, Nico for instance allows you to make games written in Nim only
08:46:19FromDiscord<soundmodel> but this is what I meant, if it doesn't use native GUI, then it's not "native"
08:46:28FromDiscord<Elegantbeef> I mean the code is native
08:46:39FromDiscord<Elegantbeef> That's what i'm talking about, it doesnt use native gui, but the code is native
08:46:49FromDiscord<Elegantbeef> If you want native gui you need to use interop to achieve that
08:47:54FromDiscord<soundmodel> but I'd probably also have a sluggier GUI than sluggier background tasks
08:48:09FromDiscord<soundmodel> so if it can run C at native speeds, then that's a better deal than the VM
08:48:31FromDiscord<soundmodel> (edit) "but I'd probably also have a sluggier GUI ... than" added "rather"
08:49:16NimEventerNew thread by FabienPRI: Compilation error from nim 1.4 to 1.6.6, see https://forum.nim-lang.org/t/9273
08:49:59FromDiscord<Elegantbeef> Yea it'll be running native code so it can run as fast as possible and leak as much memory as your little heart desires
08:50:18FromDiscord<soundmodel> Ehh: "Hardware accelerated. Nimx uses OpenGL for the graphics. When no animation is running nimx will redraw the windows only when needed to be power efficient. It can also be switched to high FPS mode so it could be used as a porting layer for games."
08:50:30FromDiscord<soundmodel> why doesn't this mean that it's doing a native GUI?
08:50:39FromDiscord<soundmodel> you mean that it just doesn't look like the native?
08:50:45FromDiscord<soundmodel> (edit) "look" => "look"
08:50:50FromDiscord<Elegantbeef> I mean it's not using the native gui tool kit yes
08:51:13FromDiscord<Elegantbeef> when people say "native gui" i think that it uses the default GUI toolkit
08:51:15FromDiscord<soundmodel> hmm this sounds very promising then
08:51:22FromDiscord<Elegantbeef> It's natively rendered of course
08:51:42FromDiscord<Elegantbeef> There is also fidget you can look at
08:52:07FromDiscord<soundmodel> not necessarily, it could also mean whether the GUI is a webview or something?
08:52:14FromDiscord<Elegantbeef> Both are in development so may not have the greatest experience, but ymmv. I have not used either much
08:52:19FromDiscord<Elegantbeef> I mean it could mean alot
08:52:32FromDiscord<Elegantbeef> There is no concrete definition of "native gui"
08:53:47FromDiscord<soundmodel> well I'm using it for "non-emulated"
08:54:18FromDiscord<Elegantbeef> Semantics aside have fun
08:54:45FromDiscord<Elegantbeef> I wonder if Phil has followed along in this conversation
08:54:54FromDiscord<Elegantbeef> He's probably just staring at all his models shouting "eureka"
08:56:11FromDiscord<soundmodel> I was about to start learning Java just because of Android, but now it seems that I don't have to
08:56:30FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=41ba
08:56:48FromDiscord<Elegantbeef> That is indeed some code
08:58:01FromDiscord<Andreas> In reply to @Elegantbeef "That is indeed some": some optimization question : why `_raiseOverflow` and not `raiseOverflow` ?
08:58:22FromDiscord<soundmodel> is "inline asm" an official feature? I didn't see it in the book.
08:58:34FromDiscord<Elegantbeef> It's in the manual
08:58:43FromDiscord<Andreas> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
08:58:47FromDiscord<Elegantbeef> No clue andreas i dont know next to nothing about asm
08:59:03FromDiscord<soundmodel> pretty useful
08:59:14FromDiscord<Elegantbeef> perhaps even "know next to nothing"
08:59:18FromDiscord<Andreas> In reply to @Elegantbeef "No clue andreas i": ty, its prbly some name-mangling thing
08:59:21FromDiscord<soundmodel> because I believe this is what made C/C++ useful also
09:00:24FromDiscord<Elegantbeef> It could be due to where `raiseOverflow` is defined
09:00:55FromDiscord<Andreas> In reply to @soundmodel "because I believe this": after spending 3 hrs with that, i guess in-lining in C and using this from Nim might be easier..
09:01:34FromDiscord<Elegantbeef> Is this really better than the generated Nim code?
09:02:42FromDiscord<soundmodel> some very performance critical parts might require lower abstraction than C
09:02:55FromDiscord<Andreas> In reply to @Elegantbeef "Is this really better": its about this https://github.com/degski/soft_dwcas↵and the CMPXCHG16 from the C-side is a total mess.
09:03:23FromDiscord<Elegantbeef> Yea that's not going to be read atleast right now
09:03:35FromDiscord<Elegantbeef> Dont know if reading asm is something someone should do at 3am 😛
09:06:55FromDiscord<Andreas> In reply to @Elegantbeef "Dont know if reading": no, don't hurt yourself...
09:13:43FromDiscord<soundmodel> I'm honestly thinking about moving all my effort to Nim at this point, but I've been confused about people who say that we'd expect to have Java and C++ around for another 10 years or so
09:14:08FromDiscord<soundmodel> sometimes I wonder if it's just propaganda
09:14:39FromDiscord<Elegantbeef> Use Nim if you have reason to use it or want to, otherwise dont use it
09:14:55FromDiscord<soundmodel> Nim just seems to do so much better what people are using C++ and Java for
09:15:02FromDiscord<Andreas> In reply to @soundmodel "I'm honestly thinking about": nope, it the 'installed-base' and zillions of people who are using and working on this.. make 10 rather 25
09:15:16FromDiscord<Andreas> (edit) "25" => "25yrs"
09:15:32FromDiscord<soundmodel> yes this is the issue, but it offers so much that neither Java nor C++ does
09:15:42FromDiscord<soundmodel> so it's simply not pragmatic to even ask for such things with older languages
09:16:04FromDiscord<soundmodel> so I've narrowed my options down to: 1) remaining old-school vs 2) trying to modernize the world
09:17:19FromDiscord<soundmodel> it solves the issues of people fighting with trying to make Java "low-latency (a new GC strategy)" and "a better language (Kotlin)" or people trying to make C++ a nicer language
09:17:38FromDiscord<soundmodel> (edit) "it solves the issues of people fighting with trying to make Java "low-latency (a new GC strategy)" and "a better language (Kotlin)" or people trying to make C++ a nicer language ... " added "(with C's performance)"
09:18:45FromDiscord<soundmodel> but there's a lot of rewriting to be done
09:20:34FromDiscord<soundmodel> QGIS 3? That's already 20 years of C++ development.
09:21:06FromDiscord<soundmodel> So I've been wondering whether this is in fact a reason why Nim would not ever become a tool for what it would be good at
09:21:12FromDiscord<soundmodel> just because there's too much work to be redone
09:22:46FromDiscord<xflywind> Lacking money and contributors is one of the main reasons.
09:23:00FromDiscord<xflywind> (edit) "one" => "two"
09:23:09FromDiscord<soundmodel> but who would genuinely want to rewrite e.g. 20 years of work?
09:24:04FromDiscord<Rika> someone, once the work to rewrite 20 years of work is less than the work to maintain it
09:24:05FromDiscord<soundmodel> rather than continue drinking the tar that C++ or Java is
09:24:40*rockcavera joined #nim
09:24:41*rockcavera quit (Changing host)
09:24:41*rockcavera joined #nim
09:24:53FromDiscord<soundmodel> but this could also mean more effort towards C projects
09:25:27FromDiscord<soundmodel> e.g. I was seeking code some while ago and I noticed that I'd prefer to use "stable C" code, which in fact means using less popular projects
09:25:36FromDiscord<soundmodel> when the mainstream is C++
09:25:44FromDiscord<soundmodel> (edit) "is" => "projects are in"
09:30:11FromDiscord<Andreas> In reply to @soundmodel "So I've been wondering": well, if Nim could be established as a learning and prototyping-lang in academia - and i believe PseudoCode->Nim is a attractive option, AFAIK that could change things.
09:31:13FromDiscord<soundmodel> well one thing is that most people don't even know it exists
09:31:31FromDiscord<soundmodel> so they're still looking at Kotlin or C++20 or whatever as the solution
09:31:44FromDiscord<soundmodel> to existing problems
09:33:01FromDiscord<Andreas> In reply to @soundmodel "so they're still looking": C++, since one human-lifetime seems too short to learn and understand the standard, i'd stay away from this.
09:33:28FromDiscord<soundmodel> I've always viewed it a bad idea to choose a tool that's inherently more demanding
09:37:14FromDiscord<Andreas> In reply to @soundmodel "I've always viewed it": and in this regard 'Mastering Nim' [https://www.amazon.de/Mastering-Nim-complete-programming-language/dp/B0B4R7B9YX/ref=sr_1_4?mk_de_DE=ÅMÅŽÕÑ&crid=1AOPDPOODY3YI&keywords=Nim&qid=1656495361&sprefix=nim%2Caps%2C81&sr=8-4] is very important, too.
09:40:19FromDiscord<soundmodel> Like it says: "Learning a programming language is a huge time investment."
09:40:30FromDiscord<soundmodel> and I think spending that time on Java or C++ is bad
09:40:39FromDiscord<soundmodel> (edit) "and I think spending that time on Java or C++ is ... badidea" added "a" | "abad ... " added "idea"
09:41:07FromDiscord<soundmodel> (edit) "idea" => "idea, because we already know about the inherent design flaws"
09:44:27FromDiscord<soundmodel> it's like betting on a boat that has sailed just fine up to this point and ignoring the fact that it's almost certainly going to sink eventually
09:44:36FromDiscord<Andreas> In reply to @soundmodel "and I think spending": time investment [https://www.iso.org/standard/79358.html] 1896-pages vs. 296 (Nim)↵and 198 CHF vs. 62€
09:46:14FromDiscord<soundmodel> and also consider the development times
09:46:36FromDiscord<soundmodel> if nim code will eventually be easier to use, then the time saved there compared to C++ will be huge
09:47:43FromDiscord<soundmodel> I just don't yet the best way to deal with existing C/C++ codebases
09:47:51FromDiscord<soundmodel> rewrite all in Nim vs interop
09:48:21FromDiscord<soundmodel> In Java land I figured out that it's often much easier to rewrite the whole thing in Java than to use JNI
09:48:54FromDiscord<soundmodel> and one is also left with cleaner code
10:01:39*CAPSLOCKSTOAT is now known as tinystoat
10:08:25FromDiscord<Generic> In reply to @Andreas "well, if Nim could": honestly yes
10:09:03FromDiscord<soundmodel> well it should appeal e.g. because it teaches best parts of C++, Java and Python
10:09:17FromDiscord<soundmodel> without needing to talk about transpilers or something
10:09:29FromDiscord<soundmodel> (edit) "needing" => "the need"
10:09:30FromDiscord<Generic> I currently have algorithms and datastructures in Uni and those ADT we use just scream Nim (or Pascal if you will so)
10:09:59FromDiscord<soundmodel> at this point I think we were taught C++, Java, C# and Python not because they're good languages
10:10:07FromDiscord<soundmodel> but because they thought that they will have all the jobs
10:10:15FromDiscord<soundmodel> which though is a bad point to make in academics
10:10:31FromDiscord<soundmodel> if one wishes to grow up a newly thinking generation
10:10:52FromDiscord<Generic> let's go and formally define the possible values of everything and then throw everything out of the window when implementing it in Python
10:11:00FromDiscord<soundmodel> now I still find 20-somethings writing Java, even when Java to me represents what people in their fifties write
10:11:18FromDiscord<soundmodel> and 20-somethings should not think what people in their fifties think
10:12:28FromDiscord<Generic> the OOP coolaid flows deep
10:13:01FromDiscord<Generic> and is generally considered the "proper" and "maintainable" solution
10:13:35FromDiscord<soundmodel> I don't understand this discussion about maintainability even, because of e.g. Java's security pitfalls
10:13:49FromDiscord<soundmodel> maintainable, because of support, not because of good design
10:14:07FromDiscord<Generic> I know
10:14:43FromDiscord<Generic> apparently it's more maintable if you split everything up into dozens of classes and interfaces
10:14:47FromDiscord<soundmodel> and then I was taught that good code should be an independent entity
10:15:04FromDiscord<soundmodel> if it's hard to update, then it's flawed
10:15:17FromDiscord<soundmodel> (edit) "flawed" => "wrongly built"
10:15:40FromDiscord<Prestige> oop is overused but has its use cases
10:16:00FromDiscord<Generic> In reply to @soundmodel "if it's hard to": I don't think that's necessarily wrong, just that creating dozens of classes and interfaces prematurely just doesn't help with this task
10:16:03FromDiscord<soundmodel> I never understood why they made OO-only
10:16:14FromDiscord<soundmodel> when to me it's evident that paradigms lend themselves as DSLs
10:16:25FromDiscord<soundmodel> not necessarily "-only" paradigms
10:16:50FromDiscord<soundmodel> e.g. write your management parts in C and then just a OO-C DSL to write a GUI
10:17:01FromDiscord<soundmodel> (edit) "just" => "use"
10:19:14FromDiscord<soundmodel> https://stackoverflow.com/questions/10504271/easily-parsing-a-dsl-with-pure-c
10:19:17FromDiscord<Generic> one thing which Nim really taught me as a princible, is to always use the least powerful tool for a task
10:19:25FromDiscord<soundmodel> but it also mentions Lua there, which I've considered a serious Nim competitor
10:19:34FromDiscord<Generic> and in most cases a class is already an overkill
10:19:42FromDiscord<Generic> while in some it's an adequate tool
10:19:56FromDiscord<Generic> (edit) "powerful" => "powerful, but adequate"
10:20:47FromDiscord<soundmodel> I've also been looking at moving to Lua instead, because it's more available
10:23:20FromDiscord<Andreas> In reply to @soundmodel "I've also been looking": stay with us and try https://github.com/jangko/nimLUA
10:26:39FromDiscord<Generic> I like lua as a scripting language, because it actually is just that
10:27:01FromDiscord<soundmodel> I think Lua is what C++ should've been
10:27:26FromDiscord<soundmodel> you want to write C and script repetitive parts, not write C and write repetitive parts in C++
10:28:31FromDiscord<Generic> C++ has enough things going for it over C than just the OOP constructs
10:29:04FromDiscord<soundmodel> I'm not sure if OOP is even useful for other than as a "macro" thing
10:29:11FromDiscord<soundmodel> most computations are imperative
10:30:16FromDiscord<soundmodel> so in a sense there should not even be a "pure OO" computing paradigm
10:30:28FromDiscord<soundmodel> but rather it's just an abstraction over imperative
10:31:19FromDiscord<Generic> sometimes OO abstractions are very useful
10:31:35*wallabra quit (Ping timeout: 255 seconds)
10:31:56FromDiscord<soundmodel> abstractions, but not that you tie the whole language to be OO (like Java does)
10:32:13FromDiscord<Generic> yes, but C++ doesn't do that
10:32:20FromDiscord<Generic> some people use it like Java, but you don't have
10:32:25FromDiscord<Generic> (edit) "some people use it like Java, but you don't have ... " added "to"
10:32:35FromDiscord<soundmodel> no but it does not maybe sit at the abstraction level that a scripting language over C does
10:32:47FromDiscord<soundmodel> because it means that one's still writing parts in C
10:32:51FromDiscord<soundmodel> that one would wish to script
10:33:11FromDiscord<soundmodel> and then you have people doing C -> C++ -> Lua
10:34:36FromDiscord<soundmodel> but Lua and Nim seem similar in some cases
10:34:45FromDiscord<soundmodel> e.g. because they both interact on top of C and C++
10:35:36FromDiscord<Generic> I don't think that's a good comparison
10:36:24FromDiscord<Generic> lots of things are build on top of C
10:36:33FromDiscord<soundmodel> well yes, e.g. because the other isn't statically typed
10:37:53FromDiscord<soundmodel> thought there seems to be Typed Lua
10:38:11FromDiscord<soundmodel> well also that they're crucially meant to be "C-extension" languages
10:38:32FromDiscord<soundmodel> and they abstract more than C++
10:38:52FromDiscord<Generic> the problem is that dynamic typing makes languages significantly simpler
10:39:16FromDiscord<Generic> without it you need atleast good generics
10:39:38FromDiscord<soundmodel> (edit) "thought" => "though"
10:40:27FromDiscord<Generic> in the end I think that static typing is worth the extra complexity (that's why I'm using Nim afterall), but for scripting language a simpler language is a benefit
10:40:32FromDiscord<soundmodel> but I'm not sure what the core arguments for Nim over Lua are
10:40:48FromDiscord<soundmodel> as currently I perceive that Lua has a better support for libraries for example
10:40:53FromDiscord<Generic> static typing, speed, ...
10:41:52FromDiscord<soundmodel> but there's Typed Lua, and Lua is still faster than Python
10:42:25FromDiscord<Generic> it's still slow, if you're only stringing together C libraries that doesn't make a difference
10:42:38FromDiscord<Generic> but once you implement anything yourself it's a deep dive
10:42:50FromDiscord<Generic> with Nim that's not at all the case
10:43:29FromDiscord<soundmodel> https://scilua.org/
10:43:33FromDiscord<soundmodel> slow?
10:44:41FromDiscord<soundmodel> based on that it seems that it's on average about as fast as C
10:46:10FromDiscord<Generic> read what I wrote, if you use an external C library to do the matrix multiplication for you, everything is as fast as C
10:47:21FromDiscord<soundmodel> but isn't this the point of using C in the first place?
10:47:35FromDiscord<soundmodel> and then using a scripting language to make writing repetitive parts nicer or to allow nicer abstractions for readability
10:47:48FromDiscord<Generic> with Nim you can do everything in one language
10:48:10FromDiscord<soundmodel> well yes
11:16:14*pro joined #nim
12:01:31*pro quit (Quit: pro)
12:11:03*ltriant quit (Ping timeout: 256 seconds)
12:13:57*ltriant joined #nim
12:20:21FromDiscord<Phil> I mean, if you're only stringing c libs together you can make the case of why not use python? I'm sure you can compile python to a binary as well if that's the thing you want
12:31:05*GreaseMonkey quit (Quit: No Ping reply in 180 seconds.)
12:32:12*vicecea quit (Remote host closed the connection)
12:32:21*greaser|q joined #nim
12:33:13*vicecea joined #nim
12:52:40FromDiscord<aph> sent a code paste, see https://play.nim-lang.org/#ix=41c9
12:56:11FromDiscord<soundmodel> In reply to @Isofruit "I mean, if you're": Because ultimately there's a plethora of apps for which a 30x speed penalty is non-ideal
12:56:44FromDiscord<soundmodel> but I like the option of using Python libraries from Nim, because that means that one can run "that specific stochastics algo" or something
12:58:31FromDiscord<soundmodel> tbh I don't understand people that are still pushing Python to mobile and whatever. Maybe their motive is to just lower dev time, while compromising software quality.
13:00:33FromDiscord<soundmodel> I think some guy somewhere was trying to do a music application with C for audio and Python for GUI, but while reasonable in theory, the Python parts are still very slow
13:02:30*jmdaemon quit (Ping timeout: 264 seconds)
13:04:41FromDiscord<deech> How do hooks work with inherited objects? eg. if I make `=copy` an error in a parent does the child also inherit it, does `=destroy` cascade up the inheritance chain?
13:08:23FromDiscord<soundmodel> but after reading more about Nim, it has started to seem to me that a lot of other langs are quite obsolete tbh
13:08:28FromDiscord<soundmodel> because they offer nothing better
13:08:48FromDiscord<soundmodel> well, except for support and libraries, but that's not even part of the language
13:08:57FromDiscord<soundmodel> (edit) "that's" => "those are"
13:09:19FromDiscord<soundmodel> R for example seems very comical these days
13:33:39FromDiscord<Phil> In reply to @soundmodel "Because ultimately there's a": If python just does the calls to the libs that performance penalty barely matters
13:34:16FromDiscord<Phil> If python does actual work it matters, but it would also matter in lua then if I understood you right
13:36:03FromDiscord<soundmodel> based on what benchmarks
13:36:13FromDiscord<Phil> Never wrote lua so no idea of its typical performance, but what I understood so far it's that performance of both isn't great, though lua is still better than python. But in the scenario of having c do the work, the performance of the caller language doesn't matter
13:36:18FromDiscord<soundmodel> there's also added overhead from going from C to Python, just like in any FFI
13:37:01FromDiscord<enthus1ast> lua (at least luajit) has the reputation to be very fast
13:37:25*arkurious joined #nim
13:37:36FromDiscord<enthus1ast> thats (one?) the reason it is used in quite a lot of game engines
13:37:43FromDiscord<Phil> I recall a GitHub repo with highly synthetic benchmarks that put python via number crunching in numpy up there with the best of them
13:38:18FromDiscord<enthus1ast> also python's pypy seems to be also quite fast
13:38:23FromDiscord<soundmodel> but python program cannot be as fast as a C program
13:38:34FromDiscord<soundmodel> (edit) "python" => "a Python"
13:38:40FromDiscord<soundmodel> due to the added layers
13:39:11FromDiscord<soundmodel> my starting point is not btw to "drop into C", but to consider C first and then how to make it less verbose
13:40:02FromDiscord<Phil> True, but it's close enough while needing a fraction of the effort, which was your usecase for adding lua into the if I understood you right
13:41:35FromDiscord<Phil> Close enough being within 20-30% or so
13:41:57FromDiscord<soundmodel> https://dzhelil.info/_images/convergence_id.png
13:42:26FromDiscord<soundmodel> I guess this works out, because possibly there's absolutely nothing in in Python except for maybe reading a few symbols
13:42:38FromDiscord<soundmodel> (edit) "in" => "being done"
13:44:38FromDiscord<Phil> Pretty much, which is why I was making the case that if it's only about having a different interface to code written in c then python tells a more compelling story, assuming your task means no actual work is being done in python
13:45:30*LuxuryMode joined #nim
13:45:36FromDiscord<Phil> And why I was supporting generics point that the calling language doesn't matter in such scenarios
13:45:52FromDiscord<soundmodel> but I've interpreted that Nim and Python have different goals
13:46:00FromDiscord<soundmodel> which means that Python is not the answer
13:47:33FromDiscord<soundmodel> C++ is another answer, but it fails in usability perspectives
13:47:47FromDiscord<soundmodel> but it fulfills "extension of C"
13:48:06FromDiscord<Phil> I'll come back to this once off work, this is going beyond the time I can dedicate to this during work
13:48:13NimEventerNew thread by Dee0xeed: Stack/heap addresses, confusion, see https://forum.nim-lang.org/t/9274
13:48:25FromDiscord<soundmodel> I've been going around this topic for some months
13:48:46FromDiscord<soundmodel> I have a bunch of projects that I'd like to work on, but I cannot select between Nim, Java, C++, C.
13:48:58FromDiscord<soundmodel> (edit) "C." => "C and Python."
13:49:02FromDiscord<soundmodel> (edit) "C" => "C, Lua"
13:50:23FromDiscord<deadmeme77> Which language and ecosystem do you want to learn the most?
13:50:28FromDiscord<deadmeme77> Choose that
13:51:13FromDiscord<enthus1ast> i would choose nim, then build stuff thats missing and release these libs = win \:)
13:52:39FromDiscord<Zoom> If you have to ask the questions either you're too free and can choose whatever you like the most, or you're not so free in your choices but don't understand it fully. In the latter case, stick with Python.↵(@soundmodel)
13:57:00FromDiscord<soundmodel> Purely from a functional perspective I'd go with Python, since it has all the needed libraries, but since Nim is about the same but faster, then it should be trivially a better language ultimately
13:57:35FromDiscord<enthus1ast> at least, its much easier to produce working code with nim than in python
13:57:57FromDiscord<enthus1ast> python crashes later on runtime, while nim code does not even compile
13:58:35FromDiscord<soundmodel> at one point my problem was that there wasn't libraries
13:58:49FromDiscord<soundmodel> now the main problem is that I don't want to use sinking ship language technologies
13:59:45FromDiscord<soundmodel> (edit) "now the main problem is that I don't want to use sinking ship language ... technologieswhere" added "technologies, i.e." | "technologies, i.e.technologies ... " added "where your code is going to become obsolete"
14:06:01*sagax quit (Read error: Connection reset by peer)
14:06:21FromDiscord<soundmodel> I read that some devs use Java etc. not for long-termism, but more as a "develop, ship and discard" -sense
14:06:28FromDiscord<soundmodel> (edit) "-sense" => "kind of thing"
14:07:31FromDiscord<soundmodel> (edit) "long-termism," => "longtermism,"
14:14:37FromDiscord<soundmodel> "Longtermism is an altruistic stance that we should be giving priority to improving the lives of people in the future over ourselves."
14:15:00FromDiscord<soundmodel> so if we choose to use Nim now, then the future could be nicer
14:20:27*sagax joined #nim
14:53:16FromDiscord<PyryTheBurger> when i make a type with variables, how can i assign them multiple times?
15:02:30FromDiscord<PyryTheBurger> like how can i change variables of an object multiple times
15:03:05FromDiscord<enthus1ast> what do you mean?
15:04:30FromDiscord<enthus1ast> myObj.myVar = myNewValue
15:04:41FromDiscord<PyryTheBurger> sent a long message, see http://ix.io/41cQ
15:04:50FromDiscord<PyryTheBurger> sent a long message, see http://ix.io/41cR
15:04:54FromDiscord<PyryTheBurger> but it says v.color cannot be assigned to
15:05:01FromDiscord<!Patitotective> use `mpairs`
15:05:17FromDiscord<PyryTheBurger> ohh
15:05:19FromDiscord<PyryTheBurger> perfect
15:05:22FromDiscord<PyryTheBurger> thankyou
15:06:33FromDiscord<PyryTheBurger> i love how with nim there is such a helpful community
15:43:50FromDiscord<luteva> can i get the (current) size of a stream? I want to jump to the end of the stream. I could use setPosition() but how can i know the position where the streams ends (at the moment)? Do I need to readLine until the end? Or is there a cleverer way?
15:44:29FromDiscord<luteva> something like stream.getLength()
15:44:45FromDiscord<luteva> or stream.getSize()
15:44:55FromDiscord<luteva> but that doesn't exist.
15:48:06FromDiscord<enthus1ast> a stream could maybe never end
15:48:18FromDiscord<enthus1ast> is this a fileStream?
15:48:56FromDiscord<🐒🧠br4n_d0n> In reply to @deech "How do hooks work": I think deech's question got lost in the argument about Java, Python, etc.↵So, I'm posting it again for his sake
15:50:39FromDiscord<enthus1ast> @luteva if it is a filestream you could use the file size
15:51:21FromDiscord<luteva> In reply to @enthus1ast "a stream could maybe": this is why i am asking for the _current length_
15:51:39FromDiscord<luteva> 🙂
15:53:42FromDiscord<d4rckh> durCheckin is a `Duration`, why is `durCheckin.seconds` trying to call `seconds(durCheckin)` instead of giving me the `seconds` property of the duration?
15:53:46FromDiscord<luteva> ok so it seems that i have to implement that proc. can i get the source of the stream? so that i can write a generic proc for both: stringstream and filestream?
15:56:15FromDiscord<enthus1ast> @d4rckh\: seconds is not exported
15:56:31FromDiscord<!Patitotective> In reply to @d4rckh "durCheckin is a `Duration`,": it needs to convert the seconds AND nanoseconds to whole seconds↵use https://nim-lang.org/docs/times.html#inSeconds%2CDuration
15:56:43FromDiscord<d4rckh> ah, actually i just wanted a human readable representation of the duration
15:56:56FromDiscord<d4rckh> i can just use the `$` proc instead
16:13:36FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=41d5
16:17:59FromDiscord<Gabben> sent a code paste, see https://play.nim-lang.org/#ix=41d6
16:19:02FromDiscord<golova> What's some actual difference between `cuint` and `uint` in C backend? Doing some low-level assembler stuff and calculation seems wrong, so
16:22:19FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41d9
16:25:32FromDiscord<golova> In reply to @Patitotective "how can i make": you can make simple wrapper func with a `var T` return type
16:27:22FromDiscord<golova> In reply to @golova "you can make simple": https://play.nim-lang.org/#ix=2lK1
16:27:46FromDiscord<!Patitotective> In reply to @golova "https://play.nim-lang.org/#ix=2lK1": i think you sent the wrong link
16:28:09FromDiscord<golova> sorry
16:28:15FromDiscord<golova> (edit) "https://play.nim-lang.org/#ix=2lK1" => "https://play.nim-lang.org/#ix=41db"
16:28:17FromDiscord<golova> fixed
16:30:07FromDiscord<!Patitotective> In reply to @golova "https://play.nim-lang.org/#ix=41db": that works if i don't assign `wrapper(verySeq, 0)` to a variable https://play.nim-lang.org/#ix=41dd
16:31:23FromDiscord<!Patitotective> In reply to @enthus1ast "a pointer works, but": i also think its quite unsafe :/
16:31:44FromDiscord<enthus1ast> imho its better to just directly access the seq
16:33:18FromDiscord<!Patitotective> yea but with nested seqs it gets quite verbose↵but i guess 🤷‍♂️
16:36:11FromDiscord<golova> what's wrong with `ptr` approach?
16:38:07FromDiscord<!Patitotective> untraced references are unsafe https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
16:53:58FromDiscord<golova> In reply to @Patitotective "untraced references are unsafe": I know, but they unsafe only if misused
16:54:25FromDiscord<golova> if you create some well-written template using `ptr`'s nothing bad will happen
16:58:33FromDiscord<!Patitotective> i fear myself, ill just directly access the seq
17:15:39*pro joined #nim
17:24:57*LuxuryMode quit (Quit: Connection closed for inactivity)
17:31:23FromDiscord<exelotl> In reply to @Gabben "How to write a": You can't afaik, macro pragmas are only for vars, procs and types.
17:32:14FromDiscord<exelotl> but if you're just wanting to make a pragma that adds other pragmas, the `{.pragma.}` pragma might suffice
17:32:26FromDiscord<exelotl> https://nim-lang.org/docs/manual.html#userminusdefined-pragmas-pragma-pragma
17:34:50FromDiscord<exelotl> In reply to @golova "What's some actual difference": `cuint` is typically 32 bits even on 64-bit machines. `uint` has the machine's native integer size (64 bits on 64-bit machines)
17:42:28*pro quit (Quit: pro)
18:32:26FromDiscord<PyryTheBurger> how do i remove the last charecter form a string?
18:34:24FromDiscord<eyecon> `s.setlen(s.len-1)`?
18:35:00FromDiscord<eyecon> Assuming non-unicode-aware
18:35:59FromDiscord<PyryTheBurger> is it possible to have unicode recognize backspace
18:38:04FromDiscord<!Patitotective> In reply to @PyryTheBurger "is it possible to": not sure what you mean but you may want to use https://nim-lang.org/docs/unicode.html↵and maybe measure the lenght of the last rune and remove it (?)
18:45:09*noeontheend joined #nim
19:01:55*Guest89 joined #nim
19:04:00*Guest89 quit (Client Quit)
19:20:58*noeontheend quit (Ping timeout: 240 seconds)
19:21:18FromDiscord<🐒🧠br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=41ec
19:21:25*krux02 joined #nim
19:23:47FromDiscord<Kermithos> In reply to @br4n_d0n "How do I represent": what error did you get?
19:24:51FromDiscord<🐒🧠br4n_d0n> ``Error: missing closing ' for character literal``
19:29:21FromDiscord<!Patitotective> unicode do not fit in a characther, you need to use a string
19:29:22*LuxuryMode joined #nim
19:30:05FromDiscord<🐒🧠br4n_d0n> That's was my guess, but I wasn't sure how nim handled ``' '``
19:30:35FromDiscord<!Patitotective> if you really a single one you can do `"🐡".runeAt(0)`↵then youll have a `Rune`
19:31:08FromDiscord<🐒🧠br4n_d0n> Wouldn't that require an import for Rune?
19:31:19FromDiscord<!Patitotective> `import std/unicode`
19:32:16FromDiscord<🐒🧠br4n_d0n> Yeah, I was trying to do it without imports, so I'll just use ``" "`` unless this ends up taking more space than a ``Rune`` would
19:32:53*averell quit (Quit: .)
19:45:24FromDiscord<Kermithos> is https://play.nim-lang.org down?
19:46:10FromDiscord<luteva> How can i post some formated code, here? I mean how to make it being formatted?
19:47:03FromDiscord<Prestige> Use 3 grave markers followed by nim
19:47:09FromDiscord<🐒🧠br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=41ee
19:47:27FromDiscord<luteva> thx!
19:48:45FromDiscord<🐒🧠br4n_d0n> In reply to @Kermithos "is https://play.nim-lang.org down?": I think I broke it
19:50:11FromDiscord<Kermithos> I thought I did xd
19:50:27FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=41ei
19:50:42FromDiscord<luteva> (edit)
19:51:19FromDiscord<Rika> you shouldnt close the file if you close the stream
19:51:35FromDiscord<luteva> ok. Thanks!
19:52:15FromDiscord<luteva> why? and could i also close the file (and not the stream)? or will this lead to a leak?
19:53:10FromDiscord<Rika> the stream closes the file
19:53:16FromDiscord<Rika> i dont know on the second question
19:53:33FromDiscord<luteva> ok thank you very much!
20:06:31*greaser|q quit (Changing host)
20:06:31*greaser|q joined #nim
20:06:53*greaser|q is now known as GreaseMonkey
20:18:10FromDiscord<luteva> is there an easy example of a stream continously read a file (e.g. a log file) and just printing out what came in?↵I am not sure about the async await part which is needed i guess. So an easy example would be great!
20:19:48FromDiscord<luteva> or do i just need a never-ending loop?
20:20:21FromDiscord<luteva> (and some sleep to not burn the CPU)
20:21:36FromDiscord<Elegantbeef> It's an IO operation so async should be golden but doesnt seeem that there are async file streams 😄
20:21:50FromDiscord<huantian> Wait really?
20:21:57FromDiscord<huantian> Ohhh yeah I remember seeing that issue somewhere
20:24:19FromDiscord<Elegantbeef> Yea the way the stream module is written i think makes it so you cannot use async with it
20:24:27FromDiscord<Elegantbeef> Since it calls procs internally
20:24:55FromDiscord<huantian> Wait I think there is an asyncRead somewhere right
20:24:59FromDiscord<Elegantbeef> Wonder if could use tags + concepts
20:25:19FromDiscord<Elegantbeef> https://nim-lang.org/docs/asyncstreams.html#read%2CFutureStream%5BT%5D you mean?
20:25:20FromDiscord<huantian> I know the async downloadFile uses something async file
20:25:58FromDiscord<Elegantbeef> There is a `readToStream`
20:27:22FromDiscord<Elegantbeef> Actually we could just use static generics for streams
20:28:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41ev
20:28:10FromDiscord<Elegantbeef> Then we can reuse most code
20:31:39FromDiscord<Elegantbeef> Guess that might be a thing for Nimv2 if someone is so inclined
21:41:41FromDiscord<slymilano> @Araq new book!? Woah congrats!
21:41:48FromDiscord<slymilano> https://nim-lang.org/blog/2022/06/29/mastering-nim.html
21:48:26*wallabra joined #nim
21:49:19FromDiscord<ripluke> Is there a way that I can "listen" to the output of a command
21:49:37FromDiscord<ripluke> Like a command which outputs a line Everytime something changes
21:50:10FromDiscord<Elegantbeef> You want a file watcher?
21:50:37FromDiscord<ripluke> Not exactly
21:51:00FromDiscord<ripluke> Like it's hard to describe
21:51:10FromDiscord<Elegantbeef> Well use your words
21:51:31FromDiscord<ripluke> But I have this shell command that outputs a line of text Everytime something changes
21:51:58FromDiscord<Elegantbeef> "something"?
21:52:03FromDiscord<ripluke> So I want to do something every time that command outputs a new line
21:52:30FromDiscord<Elegantbeef> I mean you just `readLine` then after you do your logic
21:52:54FromDiscord<ripluke> In reply to @Elegantbeef "I mean you just": Yea but how can I read line from a shell command
21:53:26FromDiscord<ripluke> So basically I'm script a bar for my wm
21:53:47FromDiscord<ripluke> And I have this shell command that outputs a line of text every time my focused window changes
21:55:02FromDiscord<Elegantbeef> you run the shell in your program
21:55:06FromDiscord<Elegantbeef> rather the command
21:55:15FromDiscord<Elegantbeef> `startProcess`
21:55:37FromDiscord<ripluke> Oh and then I read line from it?
21:55:44FromDiscord<Elegantbeef> Yes
21:55:48FromDiscord<ripluke> Ok
21:55:59FromDiscord<Elegantbeef> Readline is blocking so you probably want async or a thread to do it
22:00:36FromDiscord<ripluke> Ok
22:08:34FromDiscord<Bubblie> how do forward declare a proc that returns a boolean etc.
22:09:22FromDiscord<demotomohiro> You can forward declare like `proc foo(x: int): bool`.
22:09:48FromDiscord<Bubblie> thanks!
22:21:49*noeontheend joined #nim
22:35:26FromDiscord<luteva> how do i get updates written into a file in a nim programm that has opened the file and reads the data using a filestream?↵I mean i do not get the updates. I open the file that is opend in the nim programm in an editor, add some lines save it. but the newly added lines aren't reflected in the nim programm.↵Do I have to close and reopen the file whenever i expect some updates?
22:35:58FromDiscord<Elegantbeef> Filestreams store position you need to reset the position when the file is modified
22:36:10FromDiscord<Elegantbeef> Look at https://nim-lang.org/docs/os.html#getLastModificationTime%2Cstring
22:43:54FromDiscord<luteva> do you have any examle? i don't understand. reset the position to what value? i mean, when i add some line at the end of the file and save the file, i would expect the newly added line to get read by the readline proc.
22:49:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41fa
22:49:28FromDiscord<Elegantbeef> If you're writing to a file it should just work
22:50:21FromDiscord<luteva> sent a code paste, see https://play.nim-lang.org/#ix=41fc
22:50:38FromDiscord<luteva> (edit)
22:56:21FromDiscord<Elegantbeef> Do not get why it's doing that
22:59:07FromDiscord<luteva> 🤔
23:07:10*noeontheend quit (Ping timeout: 268 seconds)
23:13:08*noeontheend joined #nim
23:14:02FromDiscord<voidwalker> @ElegantBeef (on discord) do you take unsolicited pms ? Cause I sent you one : )
23:15:17FromDiscord<Elegantbeef> I had seen it but I dont have a response
23:15:30FromDiscord<Elegantbeef> I tend to only talk in public so people can correct me
23:16:34FromDiscord<Prestige> Elegantbeef: I made changes to https://github.com/avahe-kellenberger/seq2d if you had more feedback. I'm still not sure what name I'd use in places of `items` and `mitems` but I'm open to suggestions
23:16:35FromDiscord<voidwalker> Well, I'd ask here but it's kind of a longer conversation, and not specifically nim related, just a more general program design, to be written in nim
23:16:53FromDiscord<!Patitotective> beef, the runes check thing already existed↵https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/unicode.nim#L619
23:17:11FromDiscord<Elegantbeef> `indexValues` or `posValues` and `mPosValues` or similar
23:17:59FromDiscord<Elegantbeef> I dont get what you need that for patito but ok
23:18:42FromDiscord<Elegantbeef> Not like it's really active here anyway↵(@voidwalker)
23:19:00FromDiscord<Elegantbeef> I'm not going to tell you how to write your entire program, who knows i might not even give suggestions depending on what it is
23:20:07*noeontheend quit (Ping timeout: 268 seconds)
23:21:31FromDiscord<voidwalker> obviously I don't need it written for me, or detailed specifications for each part. It's a sort of an universal content (video, applications, documents etc) manager, launcher and downloader.
23:24:03FromDiscord<voidwalker> I began writing it in pascal/lazarus, cause of the very easy cross platform gui templating. But lack of recent libraries for various stuff, dead end community, and potentially very few contributors.. I decided it's not the right path to go
23:25:03FromDiscord<Elegantbeef> Well start writing and if people want to contribute they will
23:25:16FromDiscord<Elegantbeef> Hell for things like that contributors are probably not even in the community the language is in
23:25:23*krux02 quit (Remote host closed the connection)
23:25:44FromDiscord<Elegantbeef> If people like tooling but find bugs or want to add features they'll learn the language
23:25:52FromDiscord<voidwalker> Can I at least tell you what it's about ? in pm
23:26:14FromDiscord<Elegantbeef> It seems like you're capable of doing such so yes you can
23:30:37FromDiscord<!Patitotective> In reply to @Elegantbeef "Then have fun": no wrapping, just fun https://media.discordapp.net/attachments/371759389889003532/991848195313373274/unknown.png
23:35:59FromDiscord<Elegantbeef> How bad is your code though patito?
23:36:44FromDiscord<luteva> what does 'owned' mean? I am still wondering about the FileStream code which doesn't get updates.... So the newFileStream creates an "owned FileStream". If owned means "this is the owner and the only one that is allowed to write to the file", then this might be the reason why the stream doesn't get any updates.... right?
23:37:09FromDiscord<Elegantbeef> I think owned might be a no op now but used to have meaning
23:37:14FromDiscord<Elegantbeef> I see it a lot but i dont know what it means exactly
23:45:38FromDiscord<!Patitotective> In reply to @Elegantbeef "How bad is your": amazing unicode support
23:46:03FromDiscord<Elegantbeef> Damn i heard the matrix dodge with that one
23:48:29FromDiscord<!Patitotective> also c++ code is barely commented so there are some parts ive no idea what they do
23:48:57FromDiscord<xflywind> owned had meanings in newruntime. But newruntime is deprecated no op.
23:49:21FromDiscord<xflywind> It can probably be removed.
23:50:37FromDiscord<xflywind> (edit) "deprecated no op." => "deprecated."
23:50:51FromDiscord<Prestige> Making a wrapper for c++ code is a pain still isn't it?
23:51:17FromDiscord<Elegantbeef> It was 200 loc prestige
23:51:41FromDiscord<Elegantbeef> The public api that is
23:51:50FromDiscord<Prestige> Oh I'm asking about something unrelated to the conversation
23:52:06FromDiscord<Prestige> Looking into https://develop.kde.org/frameworks/kirigami/
23:52:11FromDiscord<Elegantbeef> It's not that much of a pain if it's small, if it's a large library c2nim can kinda be used but not seemlessly
23:53:16FromDiscord<Elegantbeef> Ideallly you get a C api but given it's qt yea good luck with that
23:53:31FromDiscord<Prestige> ah here it is https://invent.kde.org/frameworks/kirigami
23:54:41FromDiscord<!Patitotective> In reply to @Elegantbeef "It's not that much": if i tried to use c2nim for the whole file it would index of out ranfe↵if i tried with just a function it will only wrap the function header :/
23:54:49FromDiscord<!Patitotective> In reply to @Elegantbeef "It was 200 loc": 300
23:54:58FromDiscord<Elegantbeef> You have to setup the file for c2nim to work well
23:55:04FromDiscord<Elegantbeef> You cannot just feed it like futhark
23:55:11FromDiscord<!Patitotective> 🤨
23:55:35FromDiscord<xflywind> In reply to @luteva "what does 'owned'": just ignore owned. It should have been removed or ignored by nim doc.
23:55:48FromDiscord<Elegantbeef> c2nim is not the same as futhark it works purely on the text and knowledge it has it doesnt rely on a C/C++ compiler to reason what code is
23:56:36FromDiscord<Elegantbeef> But yea prestige you should be in theory capable of wrapping that with C2Nim + a bunch of time but there is no futhark for C++ code
23:59:30FromDiscord<Prestige> c++ makes me sad