<< 17-12-2024 >>

00:51:58FromDiscord<.throwstar> Does nim have imaginary number support?
00:55:39FromDiscord<.throwstar> Specifically, c has the constant `I` in `complex.h` and Im looking for something like that
00:56:56FromDiscord<bostonboston> Std/complex
00:57:21FromDiscord<.throwstar> I skimmed this and I didnt see anything like `I`
00:58:49FromDiscord<bostonboston> What do you need to accomplish
01:00:24FromDiscord<.throwstar> Heres the c version of the equation im trying to copy `out[f] += in[i] cexp(2Ipi t)`
01:01:17FromDiscord<.throwstar> Im trying to learn fourier transforms and the storage of the output is a complex number because you can derive both sin and cosin from them
01:03:34FromDiscord<.throwstar> I can share my code if that would help
01:03:40FromDiscord<.throwstar> (edit) "I can share my code ... if" added "so far"
01:08:10FromDiscord<bostonboston> `complex(0, 1)` would be I, but the equation you want in Nim I believe is `exp(complex(0, 2pit))`
01:10:26FromDiscord<bostonboston> And std/complex defines `` for mixed real and complex operands, so you're covered there
01:16:15FromDiscord<.throwstar> In reply to @bostonboston "`complex(0, 1)` would be": I think this worked, thank you
02:17:28FromDiscord<kreed1415> I'm new to Nim. What exactly is config.nims vs nimble?
02:18:15FromDiscord<kreed1415> it's not clear when the code in config.nims runs if you do nimble mytask
02:19:52FromDiscord<bostonboston> Anytime you compile config files are processed following these rules https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files↵↵Including if you compile through a task
02:22:43FromDiscord<kreed1415> maybe it helps to show exactly what im stumbling on. I'm wanting to play around with the Sokol library which has a section on how to run their examples with Emscripten but it doesn't really explain the basics of how to pass the flag
02:22:56FromDiscord<kreed1415> https://github.com/floooh/sokol-nim/tree/master?tab=readme-ov-file#emscriptern---web
02:24:12FromDiscord<kreed1415> I have the toolchain installed and in my path so I believe I should just need to add the -d:emscripten somewhere
02:25:14FromDiscord<bostonboston> https://nim-lang.github.io/nimble/create-packages.html#nimble-tasks
02:25:37FromDiscord<bostonboston> You want to put -d:emscripten before the task name
02:25:57FromDiscord<kreed1415> let met give that a shot
02:26:02FromDiscord<kreed1415> (edit) "met" => "me"
02:29:02FromDiscord<kreed1415> interesting, so that compiles but the flag doesn't seem to do anything. The flag is seems to be a part of the config.nims file I was instructed to add but im not sure if I need to do anything to the nimble for it to actually use config.nims
02:29:11FromDiscord<kreed1415> (edit) removed "is"
02:52:43FromDiscord<kreed1415> ah ok I managed to get it working just not with a nimble.
02:55:32*valms19901 quit (Ping timeout: 252 seconds)
03:11:04FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=sHePVlgS
03:13:25FromDiscord<Elegantbeef> `mapIt` does not take an iterable
03:13:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=QbSSgknq
03:14:26FromDiscord<Phil> That's inefficient as hell though (2 copies of the seq, no?), that you didn't perish writing this is amazing!
03:14:31FromDiscord<bostonboston> In reply to @kreed1415 "interesting, so that compiles": The config.nims just needs to be in one of those directories described in the docs, but in this case probably in the same dir as the nimble file. In the repo you send me at the bottom it says to use nimble build -d: emscripten, did you try that one?
03:14:41FromDiscord<Elegantbeef> The super explodey itermacros has a mapIt
03:15:03FromDiscord<Elegantbeef> `tbl.pairs.mapIt((it[0], it[1])).collect()` works with those
03:15:06FromDiscord<albassort> alright
03:15:11FromDiscord<Elegantbeef> Sorry `slicerator/itermacros`
03:15:35FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=zmKPFzcT
03:15:39FromDiscord<kreed1415> In reply to @bostonboston "The config.nims just needs": yeah it wasn't working. I made my own repo with a single file and am slowly writing a .nimble to try and understand. it's a learning process
03:15:41FromDiscord<albassort> yes this needs to exist
03:16:04FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=OTGYWHss
03:16:12FromDiscord<albassort> what do? its defined by its capacity to have this function
03:16:18FromDiscord<albassort> so it should know
03:16:34FromDiscord<albassort> err
03:16:35*rockcavera quit (Remote host closed the connection)
03:16:37FromDiscord<albassort> maybe i should use func
03:16:45FromDiscord<Phil> In reply to @Elegantbeef "*The super explodey itermacros": I already need to invest more time into maintenance than I like, I ain't adding more explody stuff on top of it.
03:16:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=gkSTElBZ
03:17:04FromDiscord<Phil> But thanks for the hint, I'll take the easy route out and just do a for-loop
03:17:10FromDiscord<Elegantbeef> Hey my chains macro in that package is pretty safe 😛↵(@Phil)
03:17:26FromDiscord<albassort> i dont know what a mixin is 😭
03:17:30FromDiscord<albassort> in nim
03:17:41FromDiscord<Phil> It's about where a generic looks for symbol
03:18:11FromDiscord<Elegantbeef> > Generics have a feature called mixin which allow the compiler to look at the scope of instantion aswell as declaration for a symbol. This allows something some refer to as a "Generic Interface", where user code allows overriding behaviour without runtime costs.
03:18:13FromDiscord<Phil> And at least either I don't understand it well or the way it functions is very... mixed, likely both
03:18:16FromDiscord<Elegantbeef> From my writeup
03:18:19FromDiscord<kreed1415> Is it common to use a .nimble as the build tool for an app even if it isn't meant to be a package?
03:18:31FromDiscord<albassort> and how does this work here beef?
03:18:36FromDiscord<Elegantbeef> I just use `config.nims` cause nimble is slow for rapid protoyping
03:18:57FromDiscord<Elegantbeef> Assuming `JsonStorable` is a generic constraint it allows your `%` to be chosen at that procedure's instantiation
03:19:31FromDiscord<albassort> no % refers to the func and procs in std/Json
03:19:41FromDiscord<Elegantbeef> Write cause it bound to it
03:19:44FromDiscord<Elegantbeef> Right\
03:19:55FromDiscord<Elegantbeef> `mixin` will force it to resolve to the most specific overload at instantiation
03:20:04FromDiscord<albassort> and where do i put this?
03:20:05FromDiscord<Elegantbeef> That's the entire point
03:20:08FromDiscord<Phil> In reply to @kreed1415 "Is it common to": I personally use it because I started and am really not feeling the effort to migrate.↵It does what I need. Generally though as a build-tool... I dunno. config.nims can be neat as well and is potentially faster. Could also look into Atlas
03:20:15FromDiscord<Elegantbeef> Inside your procedure that calls `%`
03:20:21FromDiscord<Phil> (edit) "In reply to @kreed1415 "Is it common to": I personally use it because I started ... and" added "with it"
03:20:41FromDiscord<Elegantbeef> I also hate complex build systems so much prefer just setting a flag and having it go
03:20:51FromDiscord<kreed1415> In reply to @isofruit "I personally use it": i just like the idea of being able to setup tasks which seems to be a nimble thing, but I suppose I could just pass flags to config
03:21:02FromDiscord<Elegantbeef> Tasks work in config.nims aswell
03:21:10FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=AMYAovix
03:21:11FromDiscord<Elegantbeef> you just do `nim taskname`
03:21:21FromDiscord<Elegantbeef> Yes
03:21:21FromDiscord<Phil> In reply to @kreed1415 "i just like the": I mean, I use it that way. I have nimble tasks for literally everything, from compiling to building and deploying a docker-container
03:21:23FromDiscord<kreed1415> syntax hilighting got mad at it
03:21:28FromDiscord<albassort> nah didn't work
03:21:29FromDiscord<Elegantbeef> What I like doing is defining my tasks in a config.nims then `include`ing it
03:21:35FromDiscord<Elegantbeef> What's the error now?
03:21:48FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=xXlhhcfU
03:21:55FromDiscord<albassort> (edit) "https://play.nim-lang.org/#pasty=FVEXGyQd" => "https://play.nim-lang.org/#pasty=dkKiObIi"
03:22:00FromDiscord<Elegantbeef> Do you have a `%` that works on your type?
03:22:04FromDiscord<bostonboston> In reply to @kreed1415 "Is it common to": I use it for a few projects that aren't libraries and just ignore the nimble develop and nimble build cmds
03:22:07FromDiscord<Elegantbeef> I aint so no overload there
03:22:19FromDiscord<albassort> this is a compiler error, its not being used yet
03:22:31FromDiscord<albassort> so its just not compiling for any type
03:22:32FromDiscord<Elegantbeef> What's your proc?
03:22:44FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=BeBFLlFq
03:22:55FromDiscord<Elegantbeef> No
03:22:55FromDiscord<Elegantbeef> What's your `%` proc
03:23:04FromDiscord<albassort> none specific, its not used
03:23:21FromDiscord<Elegantbeef> Huh
03:23:24FromDiscord<albassort> the function isn't being called anywhere
03:23:33FromDiscord<albassort> (edit) "function" => "proc"
03:23:40FromDiscord<Elegantbeef> That's my point what is your `%` you're trying to invoke
03:23:41FromDiscord<kreed1415> huh yeah this works but vscode syntax hilithing haes it
03:23:42FromDiscord<bostonboston> In reply to @kreed1415 "syntax hilighting got mad": Seems to be a known issue https://github.com/nim-lang/vscode-nim/issues/74
03:23:43FromDiscord<kreed1415> (edit) "haes" => "hates"
03:24:15FromDiscord<Elegantbeef> https://github.com/beef331/libnimib/blob/master/config.nims↵https://github.com/beef331/libnimib/blob/master/nimib.nimble#L16My preferred way of making tasks if I was not clear
03:24:18FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=yWpuBZDm
03:24:44FromDiscord<Elegantbeef> Is it accessible in the module invoking your `initParams`?
03:24:50FromDiscord<albassort> yes
03:24:59FromDiscord<Elegantbeef> Before the call?
03:25:03FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=BsdmslJy
03:25:06FromDiscord<albassort> it has all of these
03:25:13FromDiscord<albassort> it doesn't have any for JsonStorable
03:25:26FromDiscord<albassort> but JsonStorable is defined by its %
03:25:26FromDiscord<Elegantbeef> Right so the issue is likely just concepts
03:25:35FromDiscord<Elegantbeef> `[T: JsonStorable](args: varargs[T])`
03:25:41FromDiscord<Elegantbeef> Skip the concept
03:25:55FromDiscord<Elegantbeef> This is most likely not what you want anyway
03:26:10FromDiscord<Elegantbeef> I assume you want to be able to do `initParams(10, "hmm", 30)`
03:26:25FromDiscord<albassort> yes :3
03:26:40FromDiscord<Elegantbeef> So yea you want a macro
03:26:52FromDiscord<albassort> but i never learned macros in 4 years
03:26:54FromDiscord<albassort> i dont wanna do it now
03:26:55FromDiscord<Elegantbeef> `varargs[T]` does not work for invariant types
03:27:02FromDiscord<Elegantbeef> Well then use a tuple
03:27:26FromDiscord<Elegantbeef> `proc initParams(args: tuple)`
03:27:32FromDiscord<Elegantbeef> Tuples are Nim's varadic generics
03:27:47FromDiscord<Elegantbeef> Can do `args: tuple | object`
03:28:54FromDiscord<albassort> how can i get the length of a tuple?
03:29:40FromDiscord<Elegantbeef> `typetraits.tupleLen`
03:34:05FromDiscord<albassort> err
03:34:10FromDiscord<albassort> how can iterate over a tuple?
03:34:26FromDiscord<Elegantbeef> `fields`
03:34:28FromDiscord<albassort> yes
03:34:29FromDiscord<albassort> thank you
03:34:30FromDiscord<albassort> i forgor
03:37:16FromDiscord<albassort> alright
03:37:42FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#pasty=UOCyZyRL
03:37:49FromDiscord<albassort> boom, static typing be damned
03:37:52FromDiscord<albassort> ...almost
03:38:19FromDiscord<Elegantbeef> You best make a better error message
03:39:04FromDiscord<albassort> also this sugar needs to exist because the BTC rpc takes args positionally and needs them to be the right type
03:39:15FromDiscord<albassort> which is... insane and stupid
03:39:29FromDiscord<Elegantbeef> Something using json and using positional can die
04:40:29*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
04:40:53FromDiscord<dawidek.2137> is there an alternative to repr for arc/org?
04:54:14FromDiscord<bosinski2023> In reply to @dawidek.2137 "is there an alternative": yes, make a `proc `$`( pt :ptr T) :string =`
04:54:55FromDiscord<bosinski2023> (edit) "`$`(" => "`$`[T]("
05:14:49FromDiscord<demotomohiro> In reply to @dawidek.2137 "is there an alternative": Or you can just dereference it if you know it is not nil. Like `echo myref[]`
06:04:30*coldfeet joined #nim
06:14:53*SchweinDeBurg joined #nim
06:52:56*alexdaguy joined #nim
08:12:51*coldfeet quit (Quit: Lost terminal)
10:06:54FromDiscord<System64 ~ Flandre Scarlet> Hi!↵I want to implement scripting in my program. Should I use Lua or Python for user scripts? What are the pros and cons of each?
10:07:46Amun-Ralua is usually a first choice, dunno about nim-lua wrappers
10:08:26FromDiscord<Elegantbeef> It's more tedious but I continue to say wasm is best for scripting 😄
10:08:35Amun-Ra:P
10:08:50Amun-Rathat's unorthodox choice :>
10:09:04FromDiscord<System64 ~ Flandre Scarlet> Wasm is complex for users
10:09:19FromDiscord<Elegantbeef> Just ship a lua to wasm compiler 😄
10:10:01FromDiscord<System64 ~ Flandre Scarlet> Or LUAJIT?
10:10:28FromDiscord<Elegantbeef> Use lua over python
10:10:43FromDiscord<Elegantbeef> Wren, dascript, and angelscript are other alternatives
10:11:01FromDiscord<System64 ~ Flandre Scarlet> Are they supported by Nim?
10:12:37FromDiscord<Elegantbeef> They're embeddable
10:13:14FromDiscord<System64 ~ Flandre Scarlet> I meant↵Is there some Nim modules for that? I know there is one for Lua
10:13:34FromDiscord<Elegantbeef> no clue
10:20:38FromDiscord<odexine> Wren one exists
10:20:47FromDiscord<odexine> Probably dead because it’s from liquid from what I recall
11:09:21*valms19901 joined #nim
12:03:42FromDiscord<dawidek.2137> there are rumors you can use nimscript in your own program
12:03:54FromDiscord<dawidek.2137> as in, evaluate it at runtime
12:04:37FromDiscord<odexine> Rumours??
12:07:52FromDiscord<System64 ~ Flandre Scarlet> But I think that Nimscript isn't the fastest
12:08:29Amun-Raare you writing game engine?
12:21:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "are you writing game": No, but it will involve DSP stuff
12:21:18Amun-Ravia scripting?
12:21:41FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "via scripting?": There is a module where you can write code
12:34:56FromDiscord<griffith1deadly> when dont support reentrant calls
12:35:48FromDiscord<griffith1deadly> In reply to @sys64 "But I think that": as i see some time ago, someone says that nims slower that python (maybe specific to use case)
12:36:00FromDiscord<griffith1deadly> (edit) "when" => "wren"
12:37:32FromDiscord<griffith1deadly> i some time ago found that language good, but i dont have enough time to make my personal project with binding for it↵ https://github.com/marcobambini/gravity
12:48:02FromDiscord<odexine> In reply to @griffith1deadly "as i see some": It generally is, the interpreter was kinda just for macros and compile time evaluation at first
12:48:14FromDiscord<odexine> Not as much optimisation put into it as python
12:51:58FromDiscord<System64 ~ Flandre Scarlet> In reply to @griffith1deadly "i some time ago": Sounds interesting!
12:52:31FromDiscord<System64 ~ Flandre Scarlet> About Python with Nim?↵Does the user must install Python? Or is it directly embedded into my program?
12:58:25Amun-Rayou have to have libpython installed
12:58:34FromDiscord<griffith1deadly> In reply to @sys64 "About Python with Nim?": as i know it is limited to system python installation
12:58:52Amun-Raand all the stdlib files a script may use
13:08:47*coldfeet joined #nim
13:13:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @Amun-Ra "and all the stdlib": So I may have a bunch of stuff?
13:14:21*coldfeet quit (Quit: Lost terminal)
13:15:33*alexdaguy quit (Quit: WeeChat 4.4.4)
13:16:17Amun-Rayou have to have libpythonX.XX-stdlib or -minimal installed; when on windows - whole python; although local libpython.dll and stdlib directory may also work
13:17:23FromDiscord<System64 ~ Flandre Scarlet> And can the Python script even call Nim code?
13:17:45Amun-Raif you embed python to the nim app you expose the api to a script
13:17:53Amun-Ras/if/when/
13:18:02FromDiscord<Robyn [She/Her]> you could use pocketlang as the scripting engine
13:18:08Amun-Raor lua
13:18:42FromDiscord<Robyn [She/Her]> https://github.com/khchen/nimpk
13:18:56FromDiscord<Robyn [She/Her]> In reply to @Amun-Ra "or lua": Lua was already said tbf :p
13:19:03Amun-RaI know :)
13:19:11Amun-Rathat's my subliminal message ;)
13:21:10FromDiscord<Robyn [She/Her]> lol
13:25:31FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "https://github.com/khchen/nimpk": Oh that looks convincing
13:25:39FromDiscord<System64 ~ Flandre Scarlet> Same for Lua
13:25:57FromDiscord<Robyn [She/Her]> indeed~
13:26:03FromDiscord<Robyn [She/Her]> tho smh, WASM is superior
13:26:18FromDiscord<System64 ~ Flandre Scarlet> Can Lua also have deep integration with Nim?
13:26:52FromDiscord<Robyn [She/Her]> In reply to @sys64 "Can Lua also have": It exposes an API and it's made to be embedded so I'd assume so, you just gotta find some modern Nim bindings
13:28:43FromDiscord<System64 ~ Flandre Scarlet> Oh, PocketLang arrays start at 0!
13:29:29FromDiscord<Robyn [She/Her]> indeed
13:29:50Amun-Raand I guess pocketlang has ints too
13:29:56Amun-Ralua has only number
13:36:57FromDiscord<System64 ~ Flandre Scarlet> And probably faster than Python too
13:47:58*ntat joined #nim
14:00:55FromDiscord<odexine> In reply to @Amun-Ra "lua has only number": before 5.3
14:00:59FromDiscord<odexine> Or was it 5.2
14:01:18Amun-RaI lost contact with lua ~5.1/5.2-ish
14:06:22FromDiscord<odexine> Most people never go past 5.1. Lua kinda went bonkers then TBF
14:06:56FromDiscord<rakgew> well 5.1 was the jit version iirc
14:10:52FromDiscord<System64 ~ Flandre Scarlet> Lua Nim modules are so old
15:12:10FromDiscord<Robyn [She/Her]> In reply to @sys64 "Lua Nim modules are": nimpk it is then? :(
15:12:15FromDiscord<Robyn [She/Her]> (edit) ":(" => ":)"
15:23:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "nimpk it is then?": 5 months since the last commit, so that's ok
15:32:33*krux02 joined #nim
15:38:32FromDiscord<Robyn [She/Her]> In reply to @sys64 "5 months since the": If It Works, It's Good Enough™️
15:42:45*nils` quit (Ping timeout: 248 seconds)
16:40:39FromDiscord<marioboi3112> In reply to @sys64 "I guess it's Python": yeah, some python std modules ported into Nim modules
17:11:08*nils` joined #nim
17:14:13FromDiscord<kreed1415> Are there a good list of impressive applications that use Nim? I'm interested in making the case to try using it for some work stuff.
17:14:39FromDiscord<.bobbbob> https://github.com/ringabout/awesome-nim
17:19:56FromDiscord<kreed1415> I meant like released applications. Maybe companies that use Nim
17:22:31FromDiscord<angelsdust> Many companies have NDAs
17:22:47FromDiscord<demotomohiro> In reply to @kreed1415 "I meant like released": https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim↵https://internet-of-tomohiro.pages.dev/nim/faq.en#community-is-there-game-created-with-nimqmark
17:23:55FromDiscord<bostonboston> In reply to @kreed1415 "Are there a good": I think the largest public use of Nim, is Status
17:25:47FromDiscord<kreed1415> In reply to @demotomohiro "https://github.com/nim-lang/Nim/wiki/Organizations-": nice thanks
17:31:50*nils` quit (Ping timeout: 265 seconds)
18:06:01*nils` joined #nim
18:52:15FromDiscord<Robyn [She/Her]> In reply to @marioboi3112 "yeah, some python std": I don't think they're ported, it actually calls the Python function
18:52:47FromDiscord<Robyn [She/Her]> Yeah it calls the OG Python function
18:53:02FromDiscord<Robyn [She/Her]> It's using `nimpy` and wrapping it so it's typesafe and idiomatic
18:59:51FromDiscord<kreed1415> can anyone point me to a resource on generating wrappers for c/c++ libs?
19:00:13FromDiscord<kreed1415> I see wrappers all over the place that say they were generated but I don't see a resource on how one actually makes these
19:02:48FromDiscord<marioboi3112> In reply to @chronos.vitaqua "Yeah it calls the": oh reallyy?? i thought they were ported, i was lookin for the UPBGE lib there but cant seem to find it
19:03:56FromDiscord<Robyn [She/Her]> In reply to @marioboi3112 "oh reallyy?? i thought": UPBGE?
19:04:29FromDiscord<bostonboston> In reply to @kreed1415 "can anyone point me": c2nim, futhark
19:04:30FromDiscord<promator> Its so easy, even I did it.↵On cell now, but can share later↵(@kreed1415)
19:04:36FromDiscord<Robyn [She/Her]> In reply to @kreed1415 "can anyone point me": Well for C, there's Futhark, and before Futhark people used `c2nim` but iirc it's p broken now
19:04:48FromDiscord<Robyn [She/Her]> https://github.com/PMunch/futhark @kreed1415
19:04:57FromDiscord<kreed1415> yeah I tried c2nim and it had a massive memory leak
19:07:25Amun-Ramemory leak? it's more than probably user fault
19:08:26FromDiscord<demotomohiro> Wrapping C/C++ library with Nim doesn't means resources C/C++ library allocates are automatically freed.↵You need to manually free C/C++ resources yourself or wrap them using destructor.
19:08:47FromDiscord<marioboi3112> In reply to @chronos.vitaqua "UPBGE?": yes indeed
19:09:03*nils` quit (Ping timeout: 276 seconds)
19:09:44FromDiscord<Robyn [She/Her]> never heard of it
19:10:12FromDiscord<kreed1415> In reply to @Amun-Ra "memory leak? it's more": I literally mean I ran the c2nim command and suddenly 24gigs of my ram were gone
19:10:19FromDiscord<kreed1415> I wasn't using the generated lib
19:10:23FromDiscord<Robyn [She/Her]> Oh
19:10:28FromDiscord<Robyn [She/Her]> Jesus
19:10:29FromDiscord<kreed1415> it's also a known issue
19:10:34FromDiscord<kreed1415> it was reported by others months ago
19:11:03FromDiscord<marioboi3112> In reply to @chronos.vitaqua "never heard of it": really? its basically a game engine based on Blender
19:11:47FromDiscord<marioboi3112> uses python for scripting, but i noticed that UPBGE was on cpython's repo and was wondering if there were any docs
19:13:08FromDiscord<Robyn [She/Her]> Aah okay, yeah no clue, sorry
19:13:19FromDiscord<marioboi3112> yeah no probs!
19:13:25FromDiscord<Robyn [She/Her]> In reply to @kreed1415 "it was reported by": Could try compiling c2nim with the refc memory manager and seeing if it helps?
19:14:48*beholders_eye joined #nim
19:29:58*nils` joined #nim
19:33:10*beholders_eye quit (Ping timeout: 265 seconds)
19:35:39FromDiscord<kreed1415> aaaaand now getting futhark to run on windows is being a pain
19:40:04FromDiscord<System64 ~ Flandre Scarlet> In reply to @kreed1415 "Are there a good": https://system64mc.github.io/kurumi
19:42:58FromDiscord<System64 ~ Flandre Scarlet> I've written this in Nim
19:43:58*beholders_eye joined #nim
19:50:41FromDiscord<marioboi3112> In reply to @kreed1415 "aaaaand now getting futhark": why not try wsl then
19:51:08FromDiscord<marioboi3112> In reply to @sys64 "https://system64mc.github.io/kurumi": is this like a showcase of your custom GUI lib
19:54:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @marioboi3112 "is this like a": No I use Dear ImGui
20:13:27FromDiscord<promator> With javascript as target?↵(@System64 ~ Flandre Scarlet)
20:19:58FromDiscord<Elegantbeef> Likely wasm
20:20:17FromDiscord<Elegantbeef> Yea there's an index.wasm
20:20:26FromDiscord<promator> Oh nice
20:24:16FromDiscord<marioboi3112> In reply to @sys64 "No I use Dear": ohhh i see
20:24:42FromDiscord<marioboi3112> also is it intentional for the piano to not make any sounds
20:26:11FromDiscord<Elegantbeef> Seems one has to enable audio preview
20:27:48FromDiscord<promator> Dont you have to output js first to get wasm? Havent checked on nim wasm support for some time
20:28:35FromDiscord<Elegantbeef> No
20:28:44FromDiscord<Elegantbeef> You can compile wasm then load it with any JS
20:28:56FromDiscord<Elegantbeef> Or even use it in a non browser wasm VM
20:29:01FromDiscord<promator> Thats nice, need to check up on that
20:30:44FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Or even use it": But would it work for a GUI app?
20:32:14FromDiscord<Elegantbeef> If you expose the same functions that you use in the browser to the wasm VM
20:32:41FromDiscord<Elegantbeef> sdl2/glfw aren't magic in the browser, they expose functions you can use in the wasm VM
20:33:19FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "sdl2/glfw aren't magic in": Oh so I need to write a fronted?
20:34:15FromDiscord<Elegantbeef> When you load the wasm VM you need to expose all the host functions that your library exposes
20:35:11FromDiscord<Elegantbeef> Which is practically what your browser does when you link sdl2 or glfw
20:35:33FromDiscord<Elegantbeef> Not that there is any point in doing it with a wasm vm outside of browser, just compile to native
20:36:01FromDiscord<System64 ~ Flandre Scarlet> It would be worth if it was truly compile once run everywhere
20:36:19FromDiscord<Elegantbeef> Except your host binary would have to be compiled for every target you wanted to support
20:36:28FromDiscord<Elegantbeef> Just like your browser is
20:43:49FromDiscord<Elegantbeef> Compile once run everywhere is quite tedious aswell unless you target a well installed VM with support for your libraries (Java/Browser Standard WASM) 😄
20:51:29Amun-RaI build that way (except ofc libc)
20:51:57Amun-Rawell, that depends on the definition of "everywhere"
20:52:15FromDiscord<Elegantbeef> You build a binary to target all OSes?
20:52:23FromDiscord<Elegantbeef> Have fun with cosmopolitan libc
20:53:06Amun-Raall Linux OS-es with any version of external libraries I depend on, except libc
20:53:56FromDiscord<Elegantbeef> That hardly counts
20:54:12FromDiscord<promator> Why Not musl
20:54:27FromDiscord<Elegantbeef> cause dynamic libraries are nice 😛
20:54:41FromDiscord<promator> Meh
20:54:56FromDiscord<promator> Tell that golang
20:54:57FromDiscord<Elegantbeef> I will
20:55:18FromDiscord<Elegantbeef> Who wants to compile a static library for musl for all their deps
20:55:18Amun-Rahttps://dpaste.com/743KNEG7E
20:56:25FromDiscord<Elegantbeef> Yea that's nice but then you have to use something like my rdldd to find what it links 😄
20:56:28*beholders_eye quit (Ping timeout: 252 seconds)
20:57:06FromDiscord<Elegantbeef> My program that uses sdl2\_nim and opengl has the same list of linked libraries btw
20:57:16Amun-RaI made dynlib wrapper and I had to wrap all supported libs and I just look up from higher priority one to the least priority one :>
20:59:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=dJbYTIlJ
21:02:06Amun-Rathat was my first library I've written in Nim (and don't look at those macros, they work tho) ;) https://github.com/amnr/dlutils
21:05:28*beholders_eye joined #nim
21:10:28FromDiscord<Elegantbeef> I wonder if an `importc` variant that takes a book would've been accepted for the `{.unchecked.}` equivalent
21:11:14Amun-Rahmm
21:11:47FromDiscord<Elegantbeef> Given Nim's `dynlib` mechanism there really is not much point in forcing you to do all of this work is all my point is
21:11:59FromDiscord<Elegantbeef> Like it already does most of this
21:12:55Amun-Rait's just less typing, and having optional bindings is good for portability
21:13:21FromDiscord<Elegantbeef> Right but the optional nature could be done in Nim's dynlib stuff
21:13:51FromDiscord<Elegantbeef> with an `importc` that takes an optional bool, same with a `dynlib` probably
21:14:01Amun-Ratrue
21:26:29FromDiscord<kreed1415> can anyone explain how to use futhark to generator a wrapper for a dynamic lib?
21:26:46FromDiscord<Elegantbeef> Point it at the header then link the dll
21:26:47FromDiscord<kreed1415> the docs show how to generate when compiling from source
21:27:40FromDiscord<kreed1415> In reply to @Elegantbeef "Point it at the": so in the souerce you just importc the headers and where do you do the linking?
21:27:56FromDiscord<Elegantbeef> `--passL`
21:28:00FromDiscord<kreed1415> (edit) "souerce" => "source"
21:28:11FromDiscord<kreed1415> just when I run the script?
21:28:41FromDiscord<Elegantbeef> Either `{.passL: ...}` in your code or `--passL:` in your config
21:28:49FromDiscord<kreed1415> oh I can do that
21:38:43FromDiscord<kreed1415> So do I need to always provide the full source to Futhark or just the headers I want to wrap?
21:39:25FromDiscord<kreed1415> sent a code paste, see https://play.nim-lang.org/#pasty=McpXaojl
21:39:53FromDiscord<kreed1415> sent a code paste, see https://play.nim-lang.org/#pasty=GpGuYKRD
21:40:15FromDiscord<kreed1415> which is a dependency of the file but not one of the headers you would normally need to use
21:41:13*ntat quit (Read error: Connection reset by peer)
21:42:34FromDiscord<Elegantbeef> You just supply it the headers
21:44:09*valms19901 quit (Ping timeout: 265 seconds)
21:44:38FromDiscord<kreed1415> In reply to @Elegantbeef "You just supply it": hmm then I wonder why it is trying to find that header
21:44:58FromDiscord<Elegantbeef> Probably cause you did not provide the correct path
21:45:06FromDiscord<kreed1415> well that file isn't in the path
21:45:08*ntat joined #nim
21:45:11FromDiscord<Elegantbeef> It uses flags just like a C compiler
21:45:22FromDiscord<kreed1415> that header isn't one that is shipped with SDL
21:45:36FromDiscord<kreed1415> I could add the full source
21:46:06FromDiscord<Elegantbeef> Is `SDL.h` the ABI header or the compilation header?
21:46:25FromDiscord<kreed1415> ABI header I think. ill double check
21:46:28FromDiscord<kaistarkk> Is Dominik Picheta still around?
21:46:36FromDiscord<Elegantbeef> Nope
21:46:37FromDiscord<kaistarkk> His book is really good
21:46:39FromDiscord<kaistarkk> Ah bummer
21:47:58*rockcavera joined #nim
21:48:31FromDiscord<kreed1415> In reply to @Elegantbeef "Is `SDL.h` the ABI": it's the ABI header
21:49:09FromDiscord<kreed1415> wait somehow im missing that despite downloading it
21:50:40FromDiscord<kreed1415> ok it's there but still not finding itm progress but hmm
21:51:57FromDiscord<kreed1415> (edit) "itm" => "it's"
21:52:07FromDiscord<kreed1415> (edit) "it's progress but hmm" => "it"
22:01:04FromDiscord<kreed1415> sent a code paste, see https://play.nim-lang.org/#pasty=YpRVvFvR
22:01:36FromDiscord<kreed1415> sent a code paste, see https://play.nim-lang.org/#pasty=UWXGJZEk
22:01:49FromDiscord<Elegantbeef> `--maxLoopIterationsVM: 1000000000`
22:01:51FromDiscord<Elegantbeef> Push it to the limit
22:01:59FromDiscord<kreed1415> ok
22:05:02FromDiscord<kreed1415> so i ended up with an exe lol
22:05:11FromDiscord<kreed1415> BUT it did in fact run
22:07:15FromDiscord<riptide7847> Where is the best place to ask noob questions?
22:08:13FromDiscord<kreed1415> In reply to @riptide7847 "Where is the best": that's a great question because im doing that in main and maybe this isn't the right place
22:08:29FromDiscord<Elegantbeef> That seems like a noob question and it was asked here
22:08:29FromDiscord<Elegantbeef> So .... hmmm carry the 1
22:09:37FromDiscord<riptide7847> I'll go ahead and ask because I must be doing something ridiculously dumb
22:10:36FromDiscord<riptide7847> If I import a library and then access a symbol in my script, it works. If I use the "as" keyword and precede the symbol with the name I give the import, the parser seems unable to find it
22:11:22FromDiscord<riptide7847> Literally import sdl2 works, but if I use import sdl2 as sdl, then precede my symbol with sdl. It doesn't
22:13:28*ntat quit (Quit: Leaving)
22:31:10FromDiscord<kreed1415> @ElegantBeef I got it generated! Thanks. Im sure ill have more questions but thanks for the support
22:32:16FromDiscord<Elegantbeef> @riptide7847 got a reproduction?
22:38:10FromDiscord<riptide7847> Can't seem to reproduce so it must have something to do with what I'm importing
22:38:24FromDiscord<riptide7847> I'll work on it and not spam main with junk lol
22:46:01*beholders_eye quit (Ping timeout: 265 seconds)