<< 09-03-2024 >>

00:00:33FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=QRtZlnGeDAUL
00:00:50FromDiscord<Elegantbeef> No
00:00:50FromDiscord<Elegantbeef> Just run the code after
00:00:57FromDiscord<Elegantbeef> The issue is the `-r` command makes it a child process of Nim
00:01:10FromDiscord<Elegantbeef> `./ISSTracker.exe` should not have that behaviour
00:01:27FromDiscord<Elegantbeef> Also if this is a program that just prints out the ISS's long/lat nice program 😄
00:02:06FromDiscord<amarevite> ah youre right it's the `--run` causing it sorry about that
00:07:28FromDiscord<amarevite> sent a long message, see https://pasty.ee/uHjnmqaBVTJX
00:07:42FromDiscord<amarevite> (edit) "https://pasty.ee/XlBYrsdwarDB" => "https://pasty.ee/IvPWqjQLiKdz"
00:18:44*robertmeta joined #nim
01:02:45*rockcavera quit (Remote host closed the connection)
01:55:33FromDiscord<zumi.dxy> y'know, i look at some people going on here with "i wanna write malware in nim" and i'm reminded of the whole "people want programming languages that are famous for excelling in one thing, not general purpose good for everything ones" discourse :(
01:56:03FromDiscord<zumi.dxy> nitter is in bad shape and no one even knows it's nim↔methinks we need to annoy people a lot more
01:58:27FromDiscord<Elegantbeef> RIIN strikeforce? 😄
01:58:55FromDiscord<zumi.dxy> "no-brainer FFI" is a selling point for me personally, being able to compile with a library instead of merely linking to it because it compiles to the same language the library was written in↔i wonder how e.g. Haxe compares in this front
02:04:01FromDiscord<zumi.dxy> In reply to @Elegantbeef "RIIN strikeforce? 😄": I think it's not really equivalent --- RIIR is basically a moral imperative at this point
02:04:45FromDiscord<zumi.dxy> I don't think we have that same kind of push
02:04:50FromDiscord<zumi.dxy> and I see no reason to
02:05:03FromDiscord<zumi.dxy> the closest thing is probably the Zen of Nim
02:05:52FromDiscord<zumi.dxy> if memory safety is all people want, most languages should suffice...
02:06:27FromDiscord<zumi.dxy> I feel there's something else at play
02:29:43FromDiscord<morgan> RIIN? RIIR?
02:30:12FromDiscord<Elegantbeef> Rewrite it in Rust
02:30:17FromDiscord<morgan> ah
02:34:00FromDiscord<morgan> i think one could make a compelling push for replacing python with nim, ideally with a tutorial on using python libraries with a c backend in nim. easier to make the leap than to rust
02:34:58FromDiscord<morgan> and python is used in a lot of places, so even a small percent porting to nim would be a big bump in nim usage
02:35:00FromDiscord<Elegantbeef> As someone that has wrote a single Python program... wait people actually use that?
02:35:06FromDiscord<MDuardo> You will use Rustℱ and be happy
02:35:23FromDiscord<morgan> python is used a lot for data science as glue code
02:35:26FromDiscord<zumi.dxy> I have rewritten a Python program of mine to Nim
02:35:30FromDiscord<zumi.dxy> and gave it a GUI
02:35:54FromDiscord<morgan> but it means you’re basically dependent on using compiled backend libraries, doing it yourself in python is gonna be quite slow
02:36:44FromDiscord<zumi.dxy> meanwhile Mojo is marketed as an even more straightforward path↔isn't that supposed to be drop-in for Python for đŸ”„ AI đŸ”„ purposes?
02:37:12FromDiscord<zumi.dxy> the difference is Nim is here, free and open
02:37:18FromDiscord<Elegantbeef> It's not really aimed for python programmers
02:37:25FromDiscord<zumi.dxy> Mojo I'm not sure the floodgates have opened
02:37:28FromDiscord<Elegantbeef> Since it's more like Rust with a Python skin
02:37:36FromDiscord<morgan> just using the same libraries for all the number crunching, or comparable ones, probably won’t be faster but if it’s about the same perf, it means you can write whatever yourself and not get a 1000x slowdown
02:37:44FromDiscord<zumi.dxy> In reply to @Elegantbeef "Since it's more like": because it has `fn`? :p
02:37:49FromDiscord<Elegantbeef> No
02:38:10FromDiscord<Elegantbeef> Cause it has traits, explicit move semantics and Rust borrow semantics
02:38:34FromDiscord<Elegantbeef> Like you explicitly have to declare procedures as taking in `owned` and have to explicitly move to it
02:39:13FromDiscord<zumi.dxy> ok yeah that does sound familiar
02:40:10FromDiscord<Elegantbeef> The worst part is that to declare a struct with default semantics you have to use a pragma or implement all the basic hooks
02:41:33FromDiscord<Elegantbeef> https://docs.modular.com/mojo/manual/structs#struct-definition it's a cruel joke if you ask me
02:42:47FromDiscord<Elegantbeef> https://docs.modular.com/mojo/manual/structs#value-decorator \:D\\
02:43:58FromDiscord<Elegantbeef> But yea I do not see it aimed at python programmers as much as it's aimed ad AI programmers
02:44:25FromDiscord<Elegantbeef> Using Nim's move semantics would be vastly more accessible to any python developer
02:45:18FromDiscord<morgan> ok yeah reading thru that it is definitely not a drop in replacement
02:45:35FromDiscord<Elegantbeef> It's supposed to support python code
02:45:42FromDiscord<Elegantbeef> So you can drop python code in and it should work
02:45:55FromDiscord<Elegantbeef> But actual mojo is Rust but python
02:46:01FromDiscord<morgan> yeah
02:46:09FromDiscord<Elegantbeef> Anything inside a `def` is a dynamic typed hellscape
02:46:47FromDiscord<morgan> also no default move and copy without a decorator seems like such a weird decision
02:48:32FromDiscord<zumi.dxy> mfw Nim is officially more Pythonic than Mojo :p
02:49:19FromDiscord<Elegantbeef> The one thing Mojo does have is SIMDing 😄
02:49:30FromDiscord<Elegantbeef> Vectorize all the datas
02:50:01FromDiscord<zumi.dxy> I've been trying to use Nimscript as a Python replacement↔Nimscript still has to "compile" to nimvm right?
02:51:01FromDiscord<zumi.dxy> I could use more speed there really
02:51:09FromDiscord<zumi.dxy> but it is workable
02:51:25FromDiscord<zumi.dxy> (edit) "I could use more speed there really ... " added "(in terms of "warm up time")"
02:51:53FromDiscord<morgan> In reply to @zumi.dxy "mfw Nim is officially": i used python for quite a while, it was what made me realize i like to code. but yeah nim spoke to me way better than mojo is right now
02:52:10FromDiscord<Elegantbeef> Eh I just use compiled Nim most times
02:52:25FromDiscord<morgan> partly because it was a combination of what i liked about python and what i liked about kitlang
02:57:19FromDiscord<zumi.dxy> kitlang at first glance is interesting↔"rust except they actually spell out the keywords and without a ton of noise"
02:57:40FromDiscord<morgan> kitlang was basically a c preprocessor lol
02:57:44FromDiscord<morgan> it was neat
02:57:46FromDiscord<morgan> i enjoyed it
02:57:57FromDiscord<morgan> but if you think nim has a small userbase
02:58:04FromDiscord<zumi.dxy> take pride in syntactic sugar
02:58:17FromDiscord<zumi.dxy> c is syntactic sugar over asm anyway 😏
02:58:21FromDiscord<morgan> kit almost certainly maxed out under 100 active users
02:58:28FromDiscord<morgan> lol fair point
02:58:36FromDiscord<zumi.dxy> asm itself is syntactic sugar over machine code
02:58:40FromDiscord<Elegantbeef> Yea Val(hylo now), Vale, Odin, Hare, Jai, all have smaller userbases than Nim i presume
02:59:00FromDiscord<morgan> kit never got bootstrapped and i think that was its death
02:59:16FromDiscord<morgan> i think it was written in haskell, which i never learned
02:59:19FromDiscord<Elegantbeef> Insert gingerbill's view of bootstrapping here
02:59:48FromDiscord<zumi.dxy> bootstrapping is supposed to make it possible to have different implementations of a language, right?
02:59:49FromDiscord<morgan> so when the dev burnt out, development ceased
02:59:55FromDiscord<Elegantbeef> I don't agree with his view 😄
02:59:55FromDiscord<MDuardo> Jai doesn't even have a public release
03:00:02FromDiscord<morgan> bootstrapping is writing the compiler in itself
03:00:10FromDiscord<Elegantbeef> Bootstrapping allows developers of the language contribute without having to learn another language
03:00:11FromDiscord<zumi.dxy> i wonder if the nim compiler can be compiled with nlvm
03:00:23FromDiscord<zumi.dxy> or just partially
03:00:25FromDiscord<Elegantbeef> Some like gingerbill view it as a "Masturbatory endeavour"
03:00:35FromDiscord<Elegantbeef> Gingerbill is the creator of Odin
03:00:42FromDiscord<Elegantbeef> Just for context
03:00:53FromDiscord<morgan> ah
03:01:11FromDiscord<morgan> i disagree with that, i would’ve contributed to kit if the compiler was written in kit, or even in c
03:01:40FromDiscord<Elegantbeef> I also disagree I likely would not have contributed to Nim if it was written in C/C++
03:01:46FromDiscord<zumi.dxy> i know mrustc makes it plausible to port the rust compiler onto different platforms↔and then you just compile each version incrementally until you get to latest nightly!
03:02:09FromDiscord<Elegantbeef> Yea we just have csources and you compile those with your C compiler
03:02:35FromDiscord<Elegantbeef> Once you're boot strapped for your host env you then just supply the compiler with the arguments you need for your destination
03:03:45FromDiscord<zumi.dxy> if i want to make "portable" code like that I basically need to write nim like C right
03:03:56FromDiscord<Elegantbeef> Nope
03:04:05FromDiscord<zumi.dxy> because as I understand it nim generated C code is platform dependent
03:04:10FromDiscord<zumi.dxy> mostly
03:04:25FromDiscord<MDuardo> Nim can compile to other platforms
03:04:40FromDiscord<Elegantbeef> Right the generated C is platform dependant but you wouldn't use the csources for one platform to many
03:04:44FromDiscord<Elegantbeef> You just use Nim to compile to your platform
03:04:54FromDiscord<Elegantbeef> Plus you can use Arc/Orc anywhere
03:05:34FromDiscord<morgan> In reply to @morganalyssa "i disagree with that,": well tbf i did contribute to the language in the form of a kinda shitty package manager but i couldn’t really contribute to the compiler
03:05:46FromDiscord<Elegantbeef> I think that the csources are crossplatform though
03:06:14FromDiscord<Elegantbeef> https://github.com/nim-lang/csources_v2/blob/master/build.sh#L97 given
03:06:42FromDiscord<MDuardo> Probably still better than `pip`↔(@morgan)
03:09:01FromDiscord<Elegantbeef> Just use submodules 😄
03:12:12FromDiscord<zumi.dxy> In reply to @Elegantbeef "Plus you can use": yeah even on game boy 😏
03:13:20FromDiscord<morgan> lol well, i mostly say that because it had one dev (me) and (probably only) one user (me), and almost certainly had multiple significant vulnerabilities lol, since nobody else looked at the code most likely
03:13:51FromDiscord<morgan> but it was usable
03:14:00FromDiscord<zumi.dxy> In reply to @Elegantbeef "You just use Nim": my use case is "I want to generate C code that can be compiled by anything with a C99 compiler using the default nimbase.h because I feel a bit bad about making people have to get Nim first"
03:14:31FromDiscord<zumi.dxy> because this particular project I'm using it on already has a bunch of simple C tools
03:14:54FromDiscord<morgan> oh and it didn’t do different versions per repo/project/whatever, they all got stuck in a global folder that i lucked into being able to put my own directory prefix for imports at the very least
03:15:20FromDiscord<Elegantbeef> Ah looking at csources it has a variation for all supported platforms
03:15:28FromDiscord<Elegantbeef> So... yea I guess that's not great 😄
03:16:17FromDiscord<zumi.dxy> my specific tool does a bit more than "simple" and I use Nim to ease the pain
03:17:44FromDiscord<Elegantbeef> It's not ideal but you can always ship statically compiled binaries using musl 😄
03:17:56FromDiscord<zumi.dxy> Assuming x86_64, yeah
03:18:14FromDiscord<Elegantbeef> Well arm and x86
03:18:26FromDiscord<Elegantbeef> The rest you need Nim in your toolchain
03:18:32FromDiscord<zumi.dxy> I've yet to dive deeper into kitlang but that one could have been used for this purpose probably
03:18:56FromDiscord<morgan> i think you could cross-compile archs and then just have a big zip with a txt file named “run whichever matches your system”
03:19:02FromDiscord<zumi.dxy> While Nim is a "proper compiler", is Kit a "transpiler"?
03:19:16FromDiscord<morgan> yeah kit is probably much closer to that
03:19:17FromDiscord<Elegantbeef> Some don't even think Nim is a compiler
03:19:19FromDiscord<Elegantbeef> So... who cares
03:19:27FromDiscord<morgan> you could just use plain c code inline
03:19:32FromDiscord<zumi.dxy> Nim mangles names and optimizes to heck
03:19:53FromDiscord<zumi.dxy> does kit do the same?
03:19:54FromDiscord<Elegantbeef> Nim mangles names due to C's limitations
03:20:09FromDiscord<Elegantbeef> Ah there was a followup 😄
03:20:20FromDiscord<morgan> In reply to @zumi.dxy "does kit do the": it’s been ages i have no clue. i don’t recommend using it at this point tbh
03:20:55FromDiscord<morgan> In reply to @morganalyssa "you could just use": i vaguely remember the pointer hell i went thru writing the cli arg parser i wrote, well, when i looked again at the code and had no clue what was going on
03:21:09FromDiscord<morgan> in glorious unreadable c pointer syntax
03:23:04FromDiscord<zumi.dxy> me when I cast from pointer type to pointer type to pointer type
03:37:47FromDiscord<MDuardo> I like Zig more for those kind of things
04:03:07FromDiscord<demotomohiro> In reply to @bosinski2023 "i'm struggeling how to": This code seems work:↔https://play.nim-lang.org/#pasty=KuyRxnLNBAas
04:04:24FromDiscord<zumi.dxy> In reply to @MDuardo "I like Zig more": I want to play with it more but its build system intimidated me a bit
05:43:44FromDiscord<amarevite> sent a code paste, see https://play.nim-lang.org/#pasty=XInSIcWvKqXA
05:44:11FromDiscord<Elegantbeef> The difference only introduces specific symbols
05:44:15FromDiscord<Elegantbeef> is one only\
05:48:01FromDiscord<amarevite> im not sure what you mean
05:48:14FromDiscord<Elegantbeef> `import toSeq` only imports `toSeq`
05:48:26FromDiscord<Elegantbeef> `import std/sequtils` imports all symbols that are exported from `sequtils`
05:49:39FromDiscord<amarevite> oh yeah i understand that part↔i just dont understand if theres any technical benefit in choosing one over the other
05:50:09FromDiscord<amarevite> like if im only gonna use `toSeq` is there a benefit to importing just that one instead of the whole `std/sequtils`
05:50:10FromDiscord<Elegantbeef> Nope
05:50:13FromDiscord<Elegantbeef> The former is better so you do not have to constantly append new imports as you surely new them
05:50:18FromDiscord<Elegantbeef> surely need them\
05:50:30FromDiscord<Elegantbeef> No cause Nim's compiler compiles the entire module
05:51:34FromDiscord<amarevite> alright then↔ill continue using it like i currently do which is to communicate to myself which library a proc came from if im only using one or two from a library that i havent used much before
05:51:48FromDiscord<Elegantbeef> Plus doing `from x import y` causes issues if you want to use a type
05:51:54FromDiscord<Elegantbeef> Cause Nim has no type attached procedures
05:53:55FromDiscord<amarevite> so if i wanted to use a procedure that uses a type from that library, i would have to import the whole library or that proc would break?
05:54:39FromDiscord<Elegantbeef> No
05:54:47FromDiscord<Elegantbeef> If you want to use operations for a type you have to import them all
05:54:49FromDiscord<Elegantbeef> One by one
06:06:00NimEventerNew thread by Cnerd: Calling compiler flags in file, see https://forum.nim-lang.org/t/11180
06:19:04FromDiscord<zumi.dxy> In reply to @Elegantbeef "`import toSeq` only imports": does that mean `toSeq` can be used unqualified while every other symbol would need `sequtils.` in front↔or that only `toSeq` would be available
06:19:32FromDiscord<leorize> the former
06:20:36FromDiscord<zumi.dxy> so that's why `from x import nil` works
06:54:34*ntat joined #nim
07:12:22*azimut quit (Ping timeout: 260 seconds)
07:34:55*redj quit (Quit: No Ping reply in 180 seconds.)
07:36:28*redj joined #nim
07:52:46FromDiscord<morgan> feels good to split up my code into multiple files, and replacing the several hundred line file with like a dozen lines at most
07:53:02FromDiscord<morgan> im exporting stuff so i can just `import clap`
07:56:47FromDiscord<morgan> i'm over halfway thru the example plugin but it doesn't have params so i found another bit of code to copy from for that lol
08:14:09FromDiscord<sOkam! đŸ«> In reply to @morganalyssa "feels good to split": ikr! nim modules are amazing for keeping projects neat and organized
08:16:49*junaid_ joined #nim
08:25:58*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
08:26:49*xutaxkamay joined #nim
08:40:10*advesperacit joined #nim
10:17:01FromDiscord<whisperecean> In reply to @Elegantbeef "<@740841107117834330> you'l have to": I can fork it but I need to understand how to fixi t 😄
10:21:52FromDiscord<saint.___.> In reply to @morganalyssa "i'm over halfway thru": Awesome!
11:00:37FromDiscord<saint.___.> Does anyone here use lldb for debugging nim programs? Just wondering if you still cannot use tab to autocomplete variable names and what you do instead. Seems super complicated to have to go manually through a list of variables etc
12:40:54*xet7 quit (Remote host closed the connection)
13:31:12FromDiscord<bosinski2023> In reply to @demotomohiro "This code seems work:": this is really amazing - thank you so much, ありがべう
14:13:57FromDiscord<ikeepgettingfuckingtermed> sent a code paste, see https://play.nim-lang.org/#pasty=yDrXJtMQdfCV
14:14:01FromDiscord<ikeepgettingfuckingtermed> with
14:14:48FromDiscord<ikeepgettingfuckingtermed> sent a code paste, see https://play.nim-lang.org/#pasty=lztfsvkoXDGy
14:15:59FromDiscord<ikeepgettingfuckingtermed> sent a code paste, see https://play.nim-lang.org/#pasty=ingLFlNrURIM
14:57:26*azimut joined #nim
14:58:58*junaid_ quit (Remote host closed the connection)
15:19:26*xet7 joined #nim
15:27:20*xet7 quit (Remote host closed the connection)
15:44:46*azimut quit (Ping timeout: 260 seconds)
15:53:03*xet7 joined #nim
16:36:45*xet7 quit (Remote host closed the connection)
16:44:11FromDiscord<saint.___.> In reply to @ikeepgettingfuckingtermed "then it's just ": makes sense!
17:03:53FromDiscord<kiloneie> New Nim video: https://youtu.be/sh376LVJT8w↔If you got any feedback, please give it in this thread: https://forum.nim-lang.org/t/8552
17:26:13FromDiscord<saint.___.> In reply to @kiloneie "New Nim video: https://youtu.be/sh376LVJT8w": Awesome! I saw this come up in my subscriptions
17:38:17*azimut joined #nim
18:36:11*derpydoo joined #nim
18:49:42*ntat quit (Quit: Leaving)
19:34:21arkanoidis "import vmath except isNaN" suppose to NOT import isNaN? I have this on top of my nim file, but compiler complains "geom.nim(79, 38) Error: ambiguous call; both math.isNaN(x: SomeFloat) [func declared in /home/jack/nim/toolchains/nim-2.0.2/lib/pure/math.nim(192, 6)] and vmath.isNan(x: SomeFloat)"
19:35:38Amun-Rayou can select explicit isNaN
19:36:15arkanoidsure, but it takes some typing. I just don't want to import vmath.isNaN
19:36:24arkanoidbut it seems not working to me
19:36:28Amun-RaI see
19:37:13FromDiscord<Robyn [She/Her]> In reply to @arkanoid "is "import vmath except": It's supposed to but that seems word
19:37:50FromDiscord<Robyn [She/Her]> You could do `from vmath import isNaN as isVNaN`
19:40:07arkanoidbut I need to import all vmath except that
19:40:26arkanoidso I would need both lines
19:57:13FromDiscord<odexine> what other imports do you have? perhaps something is exporting vmath
19:58:46FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#pasty=VBokuOnRCQhk
20:01:16FromDiscord<Robyn [She/Her]> In reply to @arkanoid "but I need to": Ah
20:02:50*def- quit (Quit: -)
20:04:52*def- joined #nim
20:06:41FromDiscord<Elegantbeef> `import vmath except isNan`
20:06:42FromDiscord<Elegantbeef> arkanoid
20:06:42FromDiscord<Elegantbeef> Or the otherway for math
20:06:55*derpydoo quit (Ping timeout: 260 seconds)
20:07:43FromDiscord<Elegantbeef> Ah i'm blind
20:07:45FromDiscord<Elegantbeef> Import all your modules with `except isNan` 😄
22:45:27FromDiscord<morgan> well my code seems to not get loaded, so im guessing i need something getting the attribute stuff in there
22:57:59FromDiscord<ccloud_> sent a long message, see https://pasty.ee/SKaIsvIJsJgM
22:59:20FromDiscord<Elegantbeef> gFG is incremented at 727
23:00:50*advesperacit quit ()
23:04:35FromDiscord<ccloud_> Yes, but it can be a local var.
23:13:29FromDiscord<ccloud_> I thought that the idea was to restore them after styledWrite(), but it never happens because resetAttributes() sets them to 0.
23:24:40FromDiscord<Elegantbeef> Yea it does seem to be useless 😄
23:25:33NimEventerNew thread by dwhall256: A template to emit ARM asm, see https://forum.nim-lang.org/t/11188
23:56:17arkanoidevery time I try to do some typeclass fu or concept fu, I face weird compiler behaviour like not finding imported functions
23:56:30FromDiscord<Elegantbeef> `mixin`
23:57:58FromDiscord<Elegantbeef> Without an example I can only scream mixin