<< 30-06-2022 >>

00:16:04FromDiscord<luteva> it is just horrible, when you try/want/need to wrap it....
00:20:25FromDiscord<luteva> it took me days to get a simple "press this"-QButton working with the qt lib wrapped in nim.
00:23:14FromDiscord<Prestige> It's a shame it's such a pain, makes me not want to work with any c++ related libraries
00:24:17FromDiscord<Elegantbeef> Make C apis great again
00:24:59FromDiscord<Prestige> even that's not fun tbh
00:25:07FromDiscord<Prestige> unless futhark can just do it for you
00:27:14FromDiscord<Elegantbeef> It can just do it for you
00:27:15FromDiscord<Elegantbeef> I mean you have to wrap it after for idiomatic feeling
00:27:15FromDiscord<Elegantbeef> But you cant get better than https://github.com/beef331/miniaudio/blob/master/src/miniaudio.nim#L4-L18
00:27:15FromDiscord<Elegantbeef> The entire C api jusst imported with like 10 loc
00:27:17FromDiscord<Elegantbeef> It's like Zig levels of magic
00:29:25FromDiscord<luteva> In reply to @Avahe "It's a shame it's": same for me. it is not ment to be wrapped. So throw it away. you also have this "unknown memory layout"-problem for inheritance in c++.
00:29:57FromDiscord<Elegantbeef> Yea i mean people try to shoehorn nim into existing game engines from like 20 years ago
00:30:41FromDiscord<Elegantbeef> Like it's technically possible but it's a fools errand
00:36:15FromDiscord<luteva> there are of course c++ libraries that are ment to be integrated into other languages, like xapian e.g.↵if you find a list of at leat a handful language bindings on the projects page, then chances are that it won't be too hard 🙂
00:39:43FromDiscord<Elegantbeef> A lot of libraries do have a C-api so it makes life better
00:40:04FromDiscord<Elegantbeef> There arent many languages that can actually interop with C++ like Nim/D can so it's a understandable hell
01:20:43*sagax quit (Excess Flood)
01:27:51*sagax joined #nim
03:50:40*arkurious quit (Quit: Leaving)
05:34:23*rockcavera quit (Remote host closed the connection)
05:36:20NimEventerNew thread by Jasonfi: HN post for Mastering Nim, see https://forum.nim-lang.org/t/9275
05:39:08*LuxuryMode quit (Quit: Connection closed for inactivity)
06:48:53FromDiscord<Elegantbeef> > There's 3 languages in the same class. Julia, Nim and Crystal.↵Man hackernews makes me laugh
06:50:47FromDiscord<Prestige> Yeah, thought that was an odd statement
06:51:01FromDiscord<Prestige> I thought they were going to say nim, rust, and go. Lol
06:51:26FromDiscord<Elegantbeef> Also @Phil you've misrepresented compile time procedures, any procedure that is just nim code and doesnt rely on lowlevel operations are compile time!
06:51:46FromDiscord<Rika> can be compile time
06:52:04FromDiscord<Elegantbeef> Yea what you said
06:53:23FromDiscord<Elegantbeef> Yea prestige it's an odd statement nim and crystal are both system languages iirc so it's not a bad comparison, but julia is a super odd one
06:54:07FromDiscord<Elegantbeef> It's a weird scripting language but not but is
06:56:09FromDiscord<Rika> But not but is?
06:56:22FromDiscord<Elegantbeef> Yea you get it
07:01:32FromDiscord<Rika> Yeah I don’t
07:02:19FromDiscord<Elegantbeef> it's kinda like C# in that it's not low level but it's not super high level, it can be AOT'd but it can also be JIT'd
07:02:51FromDiscord<jmgomez> hey guys, is there a way to invoke a macro in runtime? I dont want to change the actual ast code but to emit nim code, from data that I get at runtime, into a file (via repr). I know I could save it in a intermediate format (i.e. json) and read it at compile time, but I wonder if I can save that extra step
07:03:00FromDiscord<Elegantbeef> It also uses multiple dispatch is it's fucking crazy
07:03:18FromDiscord<Elegantbeef> You could embed the NimVM and use that
07:03:28FromDiscord<Rika> I still don’t understand multiple dispatch tbh
07:04:07FromDiscord<Elegantbeef> You use runtime information of every parameter to reason which procedure to call instead of just the first parameter
07:04:53FromDiscord<Rika> It doesn’t sound too bad
07:05:02FromDiscord<Rika> Caveats are? Other than performance
07:05:12FromDiscord<Elegantbeef> So in the case of collision with two shapes `circle` and `square` you can have `collide(circle, circle)` `collide(circle, square)` `collide(square, circle)` `collide(square, square)`
07:05:19FromDiscord<Elegantbeef> It's tremendously difficult to reason what's being called
07:05:21FromDiscord<jmgomez> In reply to @Elegantbeef "You could embed the": is that referring to my question? if so, any direction on how to do it?
07:05:35FromDiscord<Elegantbeef> Nimscripter will be the easiest way
07:05:53FromDiscord<Elegantbeef> https://github.com/beef331/nimscripter/tree/master/examples/macrorepl i have an example similar to what you're doing
07:06:17FromDiscord<jmgomez> cool, thank you!
07:06:33FromDiscord<Elegantbeef> For each new type you add you add yet another possible overload to a method call
07:06:56FromDiscord<Elegantbeef> So multipile dispatch is notorious difficult to reason about
07:09:05FromDiscord<jmgomez> talking about dispatchers, its mentioned that nim dispatcher works with ref objects, which makes sense. Any chance they do work with ptr too?
07:09:23FromDiscord<Elegantbeef> Methods or static dispatch?
07:09:41FromDiscord<jmgomez> methods
07:09:47FromDiscord<Elegantbeef> For native nim objects the type information is there so i dont see why not
07:11:03FromDiscord<jmgomez> I mean, for bound ptrs
07:11:24FromDiscord<d4rckh> what's nimscript?
07:11:27FromDiscord<Elegantbeef> You mean imported objects?
07:11:39FromDiscord<jmgomez> yes
07:11:53FromDiscord<Elegantbeef> No it will not it lacks the type information
07:12:05FromDiscord<jmgomez> no way you can provide it?
07:12:05FromDiscord<Elegantbeef> Nimscript is a subset of Nim that runs on the NimVm and is used for static evaluation and macros
07:12:21FromDiscord<Elegantbeef> No it's the first field of a type a pointer to the Nim type information
07:12:23FromDiscord<Prestige> Is it still very slow?
07:12:36FromDiscord<Elegantbeef> I dont know how slow it is
07:12:41FromDiscord<Elegantbeef> I've never really benchmarked it
07:12:52FromDiscord<Rika> Most people say it’s “at least faster than Python”
07:13:03FromDiscord<Elegantbeef> Dont know if it's true stiiill
07:13:21FromDiscord<Prestige> I heard it's slower than python by a good bit
07:13:44FromDiscord<Prestige> but I heard that like maybe 8 months ago
07:13:55FromDiscord<Elegantbeef> I dont think it's speed is really a concern
07:14:26FromDiscord<Prestige> Yeah true
07:14:34FromDiscord<Prestige> it's not like people are using python for speed anyway
07:14:52FromDiscord<Elegantbeef> I mean i'm very much of the view "use wasm if you want to script a program from your language of choice"
07:15:07FromDiscord<Elegantbeef> Nimscript is really good for quickly interoping with a program or for things like a config
07:16:04FromDiscord<Prestige> I don't really know why python is used so much other than its historical usage
07:16:40FromDiscord<Rika> Because it’s easy in both syntax and batteries included
07:17:22FromDiscord<Prestige> is it really batteries included? It seems to have a lot of libraries people could use, but I thought they're 3rd party
07:17:41FromDiscord<Prestige> I could see (compiled) nim actually being a great replacement
07:18:01FromDiscord<Rika> The standard library is sizeable so yes
07:18:18FromDiscord<Rika> I don’t see Nim as a replacement until the ecosystem expands in size xd
07:18:26FromDiscord<Elegantbeef> the downside is nim isnt hacker friendly
07:18:55FromDiscord<Prestige> What does that mean?
07:19:21FromDiscord<Elegantbeef> You can open up python code with any text editor change nothing and have it run on your system without having to get any thing on most distros
07:19:39FromDiscord<Elegantbeef> "change nothing" ah yes brain that makes sense
07:19:42FromDiscord<Prestige> ah, yeah. Systems coming with python helps
07:19:42FromDiscord<Elegantbeef> change something
07:20:54FromDiscord<Rika> Well it’s either static linking (ala Go) or VM (ala a lot of other languages out there)
07:21:09*xet7 quit (Remote host closed the connection)
07:21:21FromDiscord<Rika> And the first doesn’t even help for other operating systems
07:21:47NimEventerNew post on r/nim by mids106: Book: Mastering Nim – A complete guide to the programming language, see https://reddit.com/r/nim/comments/vo2chj/book_mastering_nim_a_complete_guide_to_the/
07:26:12FromDiscord<Prestige> the more I think about it, the more I like static linking
07:27:17FromDiscord<Elegantbeef> With modern internet and storage it's less of an issue that prior but it does have the downside of security are more annoying
07:28:00FromDiscord<Rika> I like having both options available
07:28:08FromDiscord<Rika> I don’t want to be stuck with one or the other
07:29:26*sagax quit (Excess Flood)
07:40:58*ltriant quit (Ping timeout: 240 seconds)
07:46:40FromDiscord<soundmodel> Anyone have theory as to why there are so many langs that are trying something similar to Nim, but possibly not as good?
07:47:03FromDiscord<soundmodel> (edit) "Anyone have theory as to why there are so many langs that are trying something similar to Nim, but ... possibly" added "are"
07:47:13FromDiscord<Elegantbeef> There have always been many languages, just now there are a bunch more programmers that want specific things
07:47:15FromDiscord<Rika> People are afraid of change
07:47:16FromDiscord<soundmodel> (edit) "Anyone have theory as to why there are so many langs that are trying something similar to Nim, but ... are" added "that"
07:47:43FromDiscord<Rika> Also risk and effort of changing things
07:47:59FromDiscord<Rika> Especially true in enterprise of course
07:48:45FromDiscord<soundmodel> But I mean, considering Nim makes e.g. D, Vala, Zig and V totally interesting to me
07:49:30FromDiscord<Prestige> Funny enough I found Nim on accident. Was trying to look up Zig but forgot the name, ended up finding nim instead and dove in
07:49:56FromDiscord<Elegantbeef> Comically is i think that's a common occurrence for people to confuse zig for nim
07:49:57FromDiscord<soundmodel> (edit) "interesting" => "uninteresting"
07:50:23FromDiscord<Elegantbeef> Different strokes for different folks and all that↵(@soundmodel)
07:50:36FromDiscord<Elegantbeef> There is a reason so many languages exist the developers/designers think they can do better
07:50:42FromDiscord<Prestige> I looked up a list of programming languages with 3 letters, cuz that's all I could remember
07:50:50FromDiscord<soundmodel> In reply to @Elegantbeef "Different strokes for different": It should say uninteresting
07:51:03FromDiscord<soundmodel> (edit) "uninteresting" => "uninteresting, I typoed"
07:51:10FromDiscord<Elegantbeef> I know
07:51:35FromDiscord<Elegantbeef> Oh odd the reply doesnt show the edit
07:53:40FromDiscord<soundmodel> Zig and D seemed to have more authentic C experience, but Nim's c interop seems to achieve essentially the same goals
07:53:56FromDiscord<soundmodel> (edit) "c" => "C"
07:55:20FromDiscord<locria> How to run a command when installing nim library
07:55:38FromDiscord<Elegantbeef> Well Odin and Zig are the most C-like
07:55:40FromDiscord<locria> I need to run custom build script when installing nim library with `nimble install`
07:56:34FromDiscord<soundmodel> C-likeness is not even a good goals, interfacing with C is
07:56:51FromDiscord<soundmodel> (edit) "goals," => "goal,"
07:57:07FromDiscord<locria> Interfacing with C++ is hell for anyone
07:57:13FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41gu
07:57:31FromDiscord<locria> In reply to @Elegantbeef "you might be able": in nimble file?
07:57:33FromDiscord<locria> (edit) "nimble" => ".nimble"
07:57:38FromDiscord<Elegantbeef> Yes
07:57:44FromDiscord<Elegantbeef> I dont know if it'll work
07:57:44FromDiscord<Elegantbeef> It might
07:59:35FromDiscord<locria> Is there `cd` in Nim?
07:59:50FromDiscord<Elegantbeef> Nim or nimble's nimscript?
08:00:13FromDiscord<locria> Nim
08:02:27FromDiscord<locria> Can I run nimscript with `nim r ...` ?
08:07:09FromDiscord<Elegantbeef> `setCurrentDir`
08:07:28FromDiscord<Elegantbeef> Do not know
08:13:29FromDiscord<S3cur3Th1sSh1t> Hi Guys,↵I'm trying to use special characters in a Nim DLL for the export function, but they are never escaped correctly. Do you have some ideas on how to escape it?↵↵`proc funcname(): BOOL {.stdcall,exportc: "^/??@".} =`
08:14:58FromDiscord<demotomohiro> At least, it should be valid C function name, isn't it?
08:15:01FromDiscord<S3cur3Th1sSh1t> sent a code paste, see https://play.nim-lang.org/#ix=41gA
08:15:52FromDiscord<S3cur3Th1sSh1t> Well I found some DLL's using function names with theese characters, so it should be possible https://media.discordapp.net/attachments/371759389889003532/991980377252044830/unknown.png
08:16:39FromDiscord<S3cur3Th1sSh1t> `?` can be escaped with `qmark` for example, but this is not done when using `exportc`. Also opened an issue about that https://github.com/nim-lang/Nim/issues/19945
08:17:21FromDiscord<Elegantbeef> Are you attempting to escape `?`?
08:17:42FromDiscord<xflywind> write a macro to escape exported names.
08:19:02FromDiscord<demotomohiro> These function names looks like unmangled C++ function name.
08:22:25FromDiscord<apahl> Hi, is someone aware of a Nim library that can read TIFF files and allows basic pixel manipulation?
08:24:07FromDiscord<S3cur3Th1sSh1t> In reply to @demotomohiro "These function names looks": Possible. I don't know to be honest. But I'm looking for a way to export functions like those.↵ This screenshot shows, that it's done correctly without `ecportc`. So I'm assuming, that this should also be possible when using it. https://media.discordapp.net/attachments/371759389889003532/991982451989676062/unknown.png
08:26:08FromDiscord<locria> In reply to @S3cur3Th1sSh1t "Possible. I don't know": `{.extern: "namehere", exportc.}`
08:26:22FromDiscord<locria> `{.extern: "namehere", exportcpp.}`
08:27:04FromDiscord<locria> They generate C source code , so you can't use invalid C-identifier
08:28:27FromDiscord<demotomohiro> In reply to @apahl "Hi, is someone aware": https://nimble.directory/search?query=image
08:29:31FromDiscord<locria> You should ask the C linker to use another name
08:29:56FromDiscord<xflywind> In reply to @S3cur3Th1sSh1t "Possible. I don't know": Write your own escape macros.
08:30:11FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=41gF
08:30:33FromDiscord<S3cur3Th1sSh1t> In reply to @locria "You should ask the": Some link on how to do that?
08:30:49FromDiscord<locria> don't know
08:31:05FromDiscord<demotomohiro> Nim automatically convert function name to valid c-identifier when you declare proc `^/??@"`. But `exportc: "^/??@"` asks Nim to generate C function with specified name.
08:31:06FromDiscord<apahl> In reply to @demotomohiro "https://nimble.directory/search?query=image": Yes, thank you, I did that. But AFAIK none of those projects can read TIFF files.
08:32:08FromDiscord<locria> search for how to make a C function use a different name in symbol table
08:32:57FromDiscord<demotomohiro> In reply to @apahl "Yes, thank you, I": There is a plan to add TIFF support to pixie: https://github.com/treeform/pixie/issues/429
08:33:44FromDiscord<apahl> Oh, that is neat. I will follow the issue. Thank you.
08:40:53FromDiscord<Phil> In reply to @Elegantbeef "Also <@180601887916163073> you've misrepresented": I don't think I'm understanding this one.↵So the compiler infers at time whether he can just automatically make a proc purely compile-time without having a compile-time-pragma ?
08:41:42FromDiscord<Phil> Or is that where the "can be compiletime" comment from Rika comes in and you do need the compile-time-pragma?↵At which point I'm just confused
08:46:28FromDiscord<demotomohiro> https://wandbox.org/permlink/eXc5OpeqohBO6Q5p↵In this code, proc `foo` can be used at both runtime and compile time.
08:51:38FromDiscord<locria> Can I use pixie with OpenGL?
09:00:42FromDiscord<demotomohiro> This code uses pixie with OpenGL: https://gist.github.com/demotomohiro/6ae8baf1e40fffae3858c2ff01a8d241
09:02:34FromDiscord<demotomohiro> It uses `glDrawPixels` just for simplicity. It is a deprecated OpenGL function.
09:05:11FromDiscord<Elegantbeef> Pixie is cpu based so yes
09:11:53*pro joined #nim
09:23:17FromDiscord<jmgomez> Any idea how to get around this? Error: VM does not support 'cast' from tyUInt64 to tyEnum
09:23:53FromDiscord<Elegantbeef> Dont cast do `uint64` or `MyEnum(myInt)`
09:24:18FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41gL
09:24:33FromDiscord<jmgomez> It's the or there. Any other suggestion for doing bitor over them?
09:25:14FromDiscord<Elegantbeef> I mean use Nim's sets
09:25:30FromDiscord<jmgomez> unfortunately they dont support uint64
09:25:40FromDiscord<Elegantbeef> What?
09:26:44FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=41gM
09:26:49FromDiscord<jmgomez> (edit) "https://play.nim-lang.org/#ix=41gM" => "https://play.nim-lang.org/#ix=41gN"
09:27:16FromDiscord<Elegantbeef> The issue isnt the uint64 the issue is the enum values
09:27:36FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41gO
09:28:45FromDiscord<jmgomez> yeah, I know, but I need it to be uint64
09:28:46FromDiscord<Elegantbeef> But eitherway you should be able to do `name(uint64(ord(a)) or uint64(ord(a)))`
09:28:57FromDiscord<jmgomez> okay!
09:29:02FromDiscord<Elegantbeef> Why does it need to be though?
09:29:18FromDiscord<jmgomez> because that's the size of their counterpart on cpp
09:29:28FromDiscord<Elegantbeef> It's fixed size so the C compiler doesnt care if you pass it to as uint64
09:30:23FromDiscord<jmgomez> and how it will be holding the values if they are large?
09:30:44FromDiscord<Elegantbeef> The issue is if you need specific values for the enuum
09:31:06FromDiscord<Elegantbeef> If it's just 0..63 bits it's fine but if you have flags with more than 1 bit you have issues
09:31:07FromDiscord<jmgomez> yeah, I do
09:31:57FromDiscord<Elegantbeef> Ah i guess with larger sets it does need a typecast
09:32:33FromDiscord<jmgomez> In reply to @Elegantbeef "But eitherway you should": this seemed to work, thanks!
09:35:48FromDiscord<Elegantbeef> I guess you dont need to convert it into a uint64 if you're just doing a bitwise op
09:48:50FromDiscord<arnetheduck> In reply to @jmgomez "if you try to": keep in mind that nim `enum`:s are not the same as `c` enums - if you have something enum-like in C, you're likely better off with `const` in nim to represent it, using the same type as `c` (`uint64`) in your case
09:49:29FromDiscord<enthus1ast> this is what always annoys me when dealing with c apis↵(@arnetheduck)
09:50:31FromDiscord<arnetheduck> well, there's many c features that don't have an equivalent in nim, and vice versa - this is just one more, though I guess the fact that they share keyword makes it worse
09:50:52FromDiscord<jmgomez> Does that applies to C++ too?
09:51:11FromDiscord<jmgomez> I mean, dont know in c but in cpp you can specify the underlaying type
09:52:06FromDiscord<arnetheduck> it applies even more strongly to C++ 😉
09:53:21FromDiscord<arnetheduck> it's not the underlying type that is the problem really, but rather the surrounding semantics (handling of holes, multiple values with the same ordinal, random `Defect` on the nim side crashing your application etc)
09:54:06FromDiscord<retkid> arrayfire's nim page is archived
09:54:07FromDiscord<retkid> is uh
09:54:15FromDiscord<retkid> this for any reason i should be worried about
09:55:50FromDiscord<jmgomez> ok, thanks for the heads up! Will revisit and change them to const
10:01:13FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/992006890701733978/unknown.png
10:01:14FromDiscord<retkid> pain
10:03:24FromDiscord<enthus1ast> wait \:\: is a c++ namespace or?
10:04:00FromDiscord<enthus1ast> and youre compiling with gcc
10:04:43FromDiscord<enthus1ast> afaik it should be g++ not gcc
10:05:00FromDiscord<retkid> how do i change that I've never done c++ with nim only gcc
10:05:06FromDiscord<retkid> its a c++ lib
10:05:11FromDiscord<enthus1ast> nim cpp
10:05:12FromDiscord<retkid> so it should be g++
10:05:33FromDiscord<retkid> https://tenor.com/view/chefs-kiss-french-chef-perfect-dish-excellent-food-perfection-gif-20341505
10:05:44FromDiscord<retkid> i never knew you had to change to cpp if you use cpp libraries
10:06:00FromDiscord<retkid> but that makes... more than a little sense
10:06:15FromDiscord<enthus1ast> at least worth a try \:)
10:26:46*wallabra quit (Ping timeout: 272 seconds)
10:40:11*ltriant joined #nim
10:46:26FromDiscord<jmgomez> I have a macro-pragma that emits a body in a proc. In another macro, Im emitting a proc signature only with that pragma. Should that work?
10:47:19FromDiscord<jmgomez> (I mean, I can use the first one by hand)
10:56:32*pro quit (Remote host closed the connection)
11:09:09FromDiscord<rb3.nim> Hey guys, is it possible to use spawn/spawnX from std/threadpool in nimscript? I just want to build some nim dlls in parallel
11:10:02FromDiscord<Andreas> In reply to @rb3.nim "Hey guys, is it": yes, with examples : http://mirroronet.pl/pub/mirrors/video.fosdem.org/2022/D.nim/nim_concurrency.webm
11:11:27FromDiscord<rb3.nim> In reply to @Andreas "yes, with examples :": I meant from nimscript, as in a .nims file
11:11:48FromDiscord<rb3.nim> I want to make a build task that does this
11:11:57FromDiscord<Andreas> In reply to @rb3.nim "I meant from nimscript,": sry, my bad..
11:12:40FromDiscord<demotomohiro> In reply to @rb3.nim "Hey guys, is it": If you want to run nim commands in parallel, I think you need to run multiple processes, not run multi-threads.
11:13:44FromDiscord<rb3.nim> In reply to @Andreas "sry, my bad..": No worries. Just asking in case its possible. I don't think it is
11:14:09FromDiscord<demotomohiro> I think this is what you need but I don't know if it works on nimscript: https://nim-lang.org/docs/osproc.html#execProcesses,openArray%5Bstring%5D,proc(int),proc(int,Process)
11:14:16FromDiscord<rb3.nim> In reply to @demotomohiro "If you want to": My idea was to spawn processes via `exec` from the threads so I could join them.
11:14:28FromDiscord<rb3.nim> since `exec` blocks
11:14:44FromDiscord<rb3.nim> ohhh
11:15:13FromDiscord<rb3.nim> In reply to @demotomohiro "I think this is": Nice Ill take a look at this. Thanks!
11:19:50FromDiscord<rb3.nim> Damn, it looks like it uses FFI, so it can't run in the VM
11:21:40FromDiscord<demotomohiro> Maybe you can write a nim code that calls `osproc.execProcesses` and run that code from your nimscript.
11:22:32FromDiscord<rb3.nim> Ya that was gonna be my "hack". Nimscript will build the thing that builds the other thing 😂 was hoping it was gonna be simpler
11:22:39FromDiscord<rb3.nim> Thanks!
12:18:10FromDiscord<Forest> Hm, I'm planning on implementing a JVM backend for Nim, but I'm wondering on some of the difficulties I'll encounter while doing this
12:18:51FromDiscord<Forest> I'm planning on having this generate Java source code, it may not be readable but it should compile to bytecode
12:18:55FromDiscord<Rika> The fact that a good amount of libraries depend on C interoperability?
12:19:09FromDiscord<Rika> It’s prolly better to directly do bytecode no?
12:19:14FromDiscord<Forest> A big issue I'm thinking about is generating multiple java files to classes
12:19:57FromDiscord<Forest> In reply to @Rika "It’s prolly better to": Most likely yeah, but if someone wants to make it output a certain line of java code, that should be doable imo for easier intergration, especially if writing something like a Minecraft plugin
12:20:36FromDiscord<Forest> In reply to @Rika "The fact that a": Eh, main goal is getting the syntax working, it's kinda like how the JS backend is for the web specifically
12:20:48FromDiscord<Forest> JVM backend is just so we can use Nim on the JVM
12:22:10FromDiscord<Forest> Also, if I'm able to make one backend, what's stopping me from making more 👀
12:22:49FromDiscord<Rika> Well nothing
12:23:02FromDiscord<Rika> If you’re willing to put in the effort then there’s nothing really stopping you
12:23:19FromDiscord<Forest> Though my 'backends' would be more like building onto the compiler instead of my own fork
12:24:07FromDiscord<Forest> Since iirc it's possible to import passes.nim, right? No idea what it is for yet tho so gotta do some reading, especially if wanting to make my own backend
12:25:47*xet7 joined #nim
12:26:19FromDiscord<Forest> My main reason for doing this is because i hate Java syntax and other languages don't fill the gap imo
12:26:23FromDiscord<arnetheduck> https://github.com/oracle/graal/blob/master/docs/reference-manual/llvm/README.md - you can run `nlvm`-generated code straight on a JVM
12:26:32FromDiscord<Forest> Oh?
12:26:45FromDiscord<arnetheduck> "in theory" at least 😉
12:26:59FromDiscord<Forest> Aah, yeah but my issue is that i want to be able to interop with Java almost seamlessly
12:27:31FromDiscord<Forest> So importing classes, hell even making Java packages in Nim, would be interesting
12:27:43FromDiscord<arnetheduck> well, there are two parts to that,: the language instructions and the runtime - the latter is probably the bigger problem in terms of work
12:28:21FromDiscord<arnetheduck> it's similar to wasm for example: it's easy to generate wasm bytecode - much more work to also support wasi
12:28:38FromDiscord<Forest> Fair
12:28:44FromDiscord<luteva> is there an "index-engine" lib in nim? I mean something that builds up an index for incremental search/filter/tagging on the input given?
12:29:35*xet7 quit (Remote host closed the connection)
12:30:38*xet7 joined #nim
12:51:51FromDiscord<voidwalker> what do you use for fast search, strings, in a few hundre MB data set ?
12:53:52FromDiscord<enthus1ast> @luteva\: i've build a toy index search
12:54:00FromDiscord<enthus1ast> just for fun
12:54:34FromDiscord<enthus1ast> https://github.com/enthus1ast/nimBooks/blob/master/bookSearch.nim
12:54:53FromDiscord<enthus1ast> but its just a toy
12:56:16FromDiscord<aph> does `std/re` have group matches? i couldn't find it, or should i use another lib?
12:57:38FromDiscord<enthus1ast> std/re needs pcre library, we also have a pure nim regex lib btw\: https://github.com/nitely/nim-regex
12:58:53FromDiscord<aph> oic, thanks
13:00:58FromDiscord<d4rckh> how could i debug a unserialization?
13:01:07FromDiscord<d4rckh> i keep getting `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` when deserializing a sequence
13:01:17FromDiscord<d4rckh> if it has 1 element it works just fine. add another one and it crashes
13:01:52FromDiscord<enthus1ast> maybe one of the elements has an uninitialized ref
13:02:01FromDiscord<enthus1ast> ref/ptr
13:02:17FromDiscord<d4rckh> i cant have refs set to null?
13:02:39FromDiscord<d4rckh> its actually a ref obejct
13:02:41FromDiscord<d4rckh> (edit) "obejct" => "object"
13:02:51FromDiscord<d4rckh> i set it to null before serializing and i restore it at unserialization
13:04:02FromDiscord<enthus1ast> i don't know, depends on the serializer i guess
13:04:33FromDiscord<enthus1ast> checking for nil is a thing
13:05:37FromDiscord<d4rckh> i think i will do like
13:05:45FromDiscord<d4rckh> a raw version of the same type
13:06:01FromDiscord<d4rckh> without any refs
13:08:13FromDiscord<enthus1ast> what serializer do you use?
13:08:37FromDiscord<d4rckh> std/marshal
13:08:44FromDiscord<michaelb.eth> I'm having a problem in a test suite setup/teardown where I want to create a dir before each test and delete that dir and all its contents after each test. It works as expected on Linux and macOS, but on Windows the OS is insisting one/more of the files in the dir is still in use and the deletion fails with an exception. I've double-checked that resources are being closed on the Nim side, so it seems like I need to somehow else convi
13:16:37*xet7 quit (Remote host closed the connection)
13:18:20FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/992056492326912050/unknown.png
13:18:27FromDiscord<d4rckh> it sometimes happens and it sometimes doesnt lol
13:18:29FromDiscord<d4rckh> its pretty annoying
13:21:09FromDiscord<Tuatarian> Why is my custom operator not working as an operator?
13:21:47FromDiscord<Tuatarian> If I wrap a func/proc in backticks it doesn't seem to work as an operator unless I'm overloading something
13:22:00FromDiscord<Tuatarian> Can you not do custom operators?
13:22:31FromDiscord<whisper> I am trying to call some winapi with winim and I get this on nim 1.7.1 with arc
13:22:34FromDiscord<whisper> expression cannot be cast to LPDWORD=ptr DWORD
13:25:06*xet7 joined #nim
13:36:16FromDiscord<enthus1ast> @whisper\: can you share some code?
13:37:56FromDiscord<enthus1ast> @d4rckh\: i had this error a few times before; i do not know exactly what happened as well, can you try different gc for fun? eg --gc\:orc↵(@d4rckh)
13:39:04FromDiscord<enthus1ast> @whisper\: a LPDWORD is a long pointer to a DWORD,↵so you should do stuff like\:someFunc(addr myDword)
13:39:05FromDiscord<d4rckh> 🤞🏽
13:39:12FromDiscord<d4rckh> its compiling
13:39:33FromDiscord<enthus1ast> @d4rckh\: would be interesting if it crashes on another place
13:39:37FromDiscord<enthus1ast> or crashes at all
13:39:46FromDiscord<d4rckh> nope
13:39:55FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/992061928065224847/unknown.png
13:41:06FromDiscord<enthus1ast> @d4rckh\: mhh; just guessing, but do you mix release and debug somehow ?
13:41:22FromDiscord<enthus1ast> eg loading a debug dll in a release host or the other way around?
13:41:28FromDiscord<d4rckh> i have -d:debug
13:41:58FromDiscord<enthus1ast> or mixing default gc with arc/orc?
13:42:08FromDiscord<d4rckh> if i simply compile it it still crashes lol
13:42:12FromDiscord<enthus1ast> can remeber that i had issues with this once
13:42:19FromDiscord<d4rckh> no
13:45:55FromDiscord<enthus1ast> @d4rckh\: can you compile with "-d\:useSysAssert -d\:useGcAssert" and see if the error changes?
13:46:07FromDiscord<enthus1ast> https://github.com/nim-lang/Nim/issues/2507
13:47:46*xet7 quit (Ping timeout: 268 seconds)
13:50:35FromDiscord<d4rckh> https://media.discordapp.net/attachments/371759389889003532/992064610888855572/unknown.png
13:50:36FromDiscord<d4rckh> hm
13:55:16*vicecea quit (Remote host closed the connection)
13:55:46*vicecea joined #nim
13:57:05FromDiscord<xflywind> See also https://github.com/nim-lang/Nim/issues/16496
13:58:44FromDiscord<d4rckh> Ouch
13:58:53FromDiscord<d4rckh> Well what can I do about it?
13:58:57FromDiscord<d4rckh> Use another serializer?
14:00:04FromDiscord<xflywind> Report the issue and use something like https://github.com/status-im/nim-json-serialization
14:00:41FromDiscord<xflywind> https://github.com/status-im/nim-serialization
14:01:05FromDiscord<xflywind> (edit) "https://github.com/status-im/nim-serialization" => "https://github.com/status-im?q=serialization+&type=all&language=&sort="
14:01:30FromDiscord<d4rckh> oh pretty cool
14:01:33FromDiscord<d4rckh> are there any docs?
14:02:19FromDiscord<xflywind> https://github.com/status-im/nim-serialization#introduction
14:07:37FromDiscord<d4rckh> `fatal error: Failed to convert to JSON an unsupported type: proc (x: Time): ZonedTime{.closure, ↵gcsafe, locks: 0.}` 🤔
14:07:56FromDiscord<d4rckh> it lacks some types
14:09:48FromDiscord<enthus1ast> sent a long message, see http://ix.io/41hD
14:11:03FromDiscord<xflywind> concat? https://nim-lang.org/docs/sequtils.html#concat%2Cvarargs%5Bseq%5BT%5D%5D
14:11:23FromDiscord<enthus1ast> yeah for seq i know
14:11:40FromDiscord<enthus1ast> but was wondering if we have some stuff for arrays as well
14:11:48*arkurious joined #nim
14:11:48*xet7 joined #nim
14:12:06FromDiscord<xflywind> I don't there is because array is fixed size which is needed at compile time.
14:12:13FromDiscord<xflywind> (edit) "fixed size" => "fixed-size"
14:12:21FromDiscord<Rika> that doesnt matter though no?
14:13:40FromDiscord<enthus1ast> sent a long message, see http://ix.io/41hE
14:13:42FromDiscord<Rika> `proc &[ASize: static int, BSize: static int, Type](a: array[ASize, Type], b: array[BSize, Type]): array[ASize + BSize, Type]`↵should be a valid proc signature no?
14:14:05FromDiscord<enthus1ast> i could just do copyMem sure, or cast uint64 to array[8,byte]
14:14:19FromDiscord<enthus1ast> but it seems we do not have such a syntax yet
14:15:49FromDiscord<demotomohiro> !eval echo [1, 2, 3] & [4, 5, 6]
14:16:47FromDiscord<xflywind> nim playground seems to be down
14:16:48FromDiscord<enthus1ast> & is only for seq
14:16:49NimBotCompile failed: <no output>
14:23:58*xet7 quit (Remote host closed the connection)
14:25:51*averell joined #nim
14:31:23FromDiscord<demotomohiro> @enthus1ast You can overload `&` for array: https://wandbox.org/permlink/RcHmLSj66zvj9hAA
14:31:42FromDiscord<enthus1ast> \:D
14:31:47FromDiscord<enthus1ast> i'm just doing that
14:31:55FromDiscord<enthus1ast> but you where faster \:)
14:32:47FromDiscord<enthus1ast> this is very clever\: array[I + J
14:37:21FromDiscord<enthus1ast> yeah yours is better
14:38:08FromDiscord<enthus1ast> thats mine https://paste.debian.net/1245755/
14:47:08FromDiscord<Rika> 😦 i provided the idea
14:47:38FromDiscord<enthus1ast> thank you as well Rika
14:47:52FromDiscord<enthus1ast> var result = [0x49.byte, 0xBA] & cast[array[sizeof(address), byte]](address) & [0x41, 0xff, 0xe2]this is now valid
14:53:26FromDiscord<PyryTheBurger> how do i have a proc as an argument of a proc and call that argument proc?
14:54:14FromDiscord<Rika> `..., argument: proc(argument: type, argument: type): rettype, ...`
14:55:45FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41hQ
14:55:48FromDiscord<PyryTheBurger> how can i have varargs of any type
14:57:04FromDiscord<enthus1ast> afaik they all must be the same type
14:57:11FromDiscord<PyryTheBurger> oh damn
14:57:15FromDiscord<PyryTheBurger> sucks
14:58:45FromDiscord<enthus1ast> but you still have some options
14:59:01FromDiscord<enthus1ast> depending on what you wanna do
15:00:27FromDiscord<PyryTheBurger> how do i completely remove something from a seq
15:01:45FromDiscord<enthus1ast> sent a long message, see http://ix.io/41i1
15:03:54FromDiscord<Shinyzenith> sent a code paste, see https://play.nim-lang.org/#ix=41i4
15:04:21FromDiscord<Shinyzenith> (edit) "https://play.nim-lang.org/#ix=41i4" => "https://play.nim-lang.org/#ix=41i5"
15:05:46FromDiscord<enthus1ast> this is a nim channel \:)
15:05:55FromDiscord<Shinyzenith> Yeah it's a nim question
15:06:02FromDiscord<Rika> i think they want to convert it to nim
15:06:03FromDiscord<enthus1ast> void pointer ?
15:06:23FromDiscord<Shinyzenith> In reply to @Rika "i think they want": No no I wrote it in nim, I'm just more comfortable with explaining the idea in C
15:06:30FromDiscord<Rika> idgi then
15:06:43FromDiscord<Shinyzenith> In reply to @enthus1ast "void pointer ?": won't that break the type system?
15:06:48FromDiscord<enthus1ast> sure
15:07:12FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=41i6
15:07:18FromDiscord<enthus1ast> yes imho it should
15:07:28FromDiscord<Rika> then i dont get the problem
15:07:34FromDiscord<Shinyzenith> I'll try that and get back to you
15:07:43FromDiscord<Rika> must be in the same file + same block
15:07:49FromDiscord<enthus1ast> yes
15:08:26FromDiscord<Shinyzenith> oh same block
15:08:27FromDiscord<Shinyzenith> I didn't do that
15:08:54FromDiscord<PyryTheBurger> how do i convert a string to int
15:09:13FromDiscord<enthus1ast> import strutils↵echo parseInt("123")
15:09:28FromDiscord<Shinyzenith> In reply to @Shinyzenith "I didn't do that": Yep it no longer complains about the types, thanks \@enthus1ast and @Rika
15:09:36FromDiscord<Shinyzenith> (edit) "\@enthus1ast" => "@\enthus1ast"
15:10:00FromDiscord<Shinyzenith> Any particular reason why defining B in another type block doesn't work?
15:10:05FromDiscord<Rika> because it doesnt
15:10:11FromDiscord<Rika> just a limitation of the compiler rn
15:10:18FromDiscord<Rika> i dont know why
15:10:21FromDiscord<Shinyzenith> Huh That's interesting
15:10:34FromDiscord<enthus1ast> maybe this gets addressed when we have incremental compilation
15:10:38FromDiscord<Shinyzenith> what if I were to split it into two files because the current one will grow a lot↵↵what would I do in that case?
15:10:39FromDiscord<enthus1ast> but idk
15:10:47FromDiscord<enthus1ast> yes thats the thing
15:11:03FromDiscord<Shinyzenith> That's messy 😔
15:11:27FromDiscord<enthus1ast> you can do i kinda like c headers work and put the typedefs in one file
15:11:43FromDiscord<Shinyzenith> yeah I was thinking of making a types file or so
15:11:47FromDiscord<Shinyzenith> kinda like c headers
15:16:48FromDiscord<enthus1ast> @PyryTheBurger\: i can recommend https://nim-lang.org/docs/theindex.html there you can quickly search through the stdlib
15:17:37FromDiscord<PyryTheBurger> why is my varargs not working tho
15:18:18FromDiscord<Rika> ?
15:18:56FromDiscord<PyryTheBurger> bruh it saying my function is a void even tho its supposed to be a proc like what
15:19:14FromDiscord<enthus1ast> ?
15:19:18FromDiscord<!Patitotective> ?
15:19:23FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41i8
15:21:01FromDiscord<enthus1ast> sounds like missing return type↵(@PyryTheBurger)
15:21:17FromDiscord<enthus1ast> but the error message would help
15:21:52FromDiscord<PyryTheBurger> sent a long message, see http://ix.io/41i9
15:22:10FromDiscord<enthus1ast> yes
15:22:16FromDiscord<enthus1ast> you call finished
15:22:44FromDiscord<enthus1ast> if you want to give the proc itself to the newTimer do not call it
15:22:56FromDiscord<PyryTheBurger> what do you mean
15:23:11FromDiscord<enthus1ast> finished($i) is a function call
15:23:30FromDiscord<enthus1ast> i guess finished($i) does not return another proc right?
15:23:30FromDiscord<PyryTheBurger> but how do i pass an argument to it
15:23:42FromDiscord<Rika> you do it in the function you pass the function into
15:23:52FromDiscord<enthus1ast> or wrap it in another proc
15:24:05FromDiscord<PyryTheBurger> what
15:24:31FromDiscord<Rika> can you give your code
15:25:17FromDiscord<PyryTheBurger> not really sorry
15:25:25FromDiscord<PyryTheBurger> ill try to fix it myself
15:35:07FromDiscord<enthus1ast> you basically wrap your procs
15:35:08FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/2yv
15:35:13FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41ic
15:35:45FromDiscord<PyryTheBurger> cool but i already figured out a more flexible way: just turn finished into a bool
15:37:03FromDiscord<enthus1ast> if this works for you then yes \:)
15:44:46FromDiscord<federico3> at $149 it's a good deal!↵(@Prestige)
16:12:43*Goodbye_Vincent quit (Quit: Ping timeout (120 seconds))
16:13:13*Goodbye_Vincent joined #nim
16:15:24*Goodbye_Vincent quit (Client Quit)
16:16:20*Goodbye_Vincent joined #nim
16:28:49*Goodbye_Vincent quit (Quit: Ping timeout (120 seconds))
16:30:28*Goodbye_Vincent joined #nim
16:38:23FromDiscord<Zeantar> sent a code paste, see https://play.nim-lang.org/#ix=41ip
16:39:33FromDiscord<!Patitotective> can you show your `[]` call
16:42:12FromDiscord<!Patitotective> In reply to @Zeantar "Hello. I'm new to": are you sure you are importing `std/tables` in the module you're accessing the table?
16:43:48FromDiscord<Zeantar> I didn't do it. Thank you. I got it now.
16:57:14*Amun-Ra quit (Quit: Gdyby mi się chciało tak jak mi się nie chce...)
16:59:41*Amun-Ra joined #nim
17:22:13FromDiscord<Prestige> federico3: I'm actually looking to get the pinephone pro, it's a bit more pricey but I think I'll do it. I'll try to just write apps for anything I need
17:59:35FromDiscord<d4rckh> any std/marshal alternatives that can convert most types of the std libraries?
17:59:41FromDiscord<d4rckh> (edit) "alternatives" => "alternative"
17:59:58*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
18:03:09FromDiscord<d4rckh> i think i will just write my own 'serializers'
18:03:40*Lord_Nightmare joined #nim
18:06:01FromDiscord<d4rckh> is it possible to convert a DateTime to a timestamp that i can later convert it back to a DateTime object?
18:09:52FromDiscord<!Patitotective> In reply to @d4rckh "is it possible to": https://nim-lang.org/docs/times.html#fromUnix%2Cint64↵https://nim-lang.org/docs/times.html#toUnix%2CTime↵(?)
18:10:17FromDiscord<d4rckh> i was looking at the same thing but that takes a Time 🤔
18:10:53FromDiscord<!Patitotective> https://nim-lang.org/docs/times.html#toTime%2CDateTime (?)
18:11:16Amun-Rad4rckh: dt.toTime.toUnix
18:11:18FromDiscord<d4rckh> yeah i found that too just now
18:11:27FromDiscord<d4rckh> i thought theres a better way haha
18:11:34FromDiscord<d4rckh> i dont really like chaining functions like that
18:12:12FromDiscord<d4rckh> can you convert it back to a DateTime?
18:12:22FromDiscord<d4rckh> (edit) "it" => "the Time"
18:12:27Amun-Raif you look at Time.toUnix there's not much to it
18:12:42Amun-RaTime is just a distinct int64
18:13:00Amun-RatoUnix is jut a cast
18:17:33*krux02 joined #nim
18:29:51FromDiscord<voidwalker> can't find example, what is the syntax for adding a new item to a sequence of objects, by specifying the literal values?
18:30:44FromDiscord<voidwalker> ` movies.add(id:33,ptitle:"a",otitle:"b",year:1,runtime:1,rating:1)`
18:31:04FromDiscord<voidwalker> this doesn't work, it needs a `proc add[T](x: var seq[T]; y: openArray[T])`
18:31:30FromDiscord<enthus1ast> you need to create the object
18:31:54FromDiscord<d4rckh> if i assigned strings to my enum values can i easily convert a string to an enum value?
18:32:31FromDiscord<voidwalker> doesn't add create it ?
18:32:51FromDiscord<enthus1ast> eg\:↵movies.add Movie(id\: 33)
18:33:27FromDiscord<enthus1ast> no, the seq add justs adds an object to a seq↵(@voidwalker)
18:34:05FromDiscord<voidwalker> movies.add Movie(id: 33) - what is this ?
18:34:40FromDiscord<enthus1ast> Movie(id\: 33, ptitle\: "a", etc..)
18:35:20FromDiscord<enthus1ast> yes, use parseEnum from strutils↵(@d4rckh)
18:36:00FromDiscord<voidwalker> @enthus1ast ok, so that is an object.. you mean I can add it to the sequence if i put movie( ) before its members?
18:36:21FromDiscord<enthus1ast> when your object is called Movie then yes
18:36:53FromDiscord<voidwalker> object type is called movie, yes. and movies is seq[movie]
18:37:16FromDiscord<voidwalker> and i do not have a variable declared to store a single movie instance
18:37:43FromDiscord<enthus1ast> you don't need to, you can create one and directly add it to the seq
18:38:14FromDiscord<voidwalker> movies.add(movie(id:33,ptitle:"a",otitle:"b",year:1,runtime:1,rating:1))
18:38:15FromDiscord<voidwalker> this works
18:38:42FromDiscord<enthus1ast> i would recommend that you name your object types with a captical first letter
18:38:43FromDiscord<enthus1ast> like Movie
18:41:07FromDiscord<enthus1ast> this is more or less a convention, also also has the benefit that you still can use movie as a variable
18:42:02FromDiscord<voidwalker> yep, i stopped learning nim for almost a month, and now I forgot most of what I learned :\
18:42:36FromDiscord<enthus1ast> keep on going, its worth learning \:)
18:42:36FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=41iU
18:42:56FromDiscord<voidwalker> how do i force it to return uint32 ?
18:43:00FromDiscord<voidwalker> I also knew this but forgot :\
18:43:30FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41iW
19:05:09FromDiscord<voidwalker> yep, that works. Thanks. Now I got a case where there's no valid int to be parsed, but a "\N". Is there no way to get a 0 returned on parseUInt error instead of an exception ?
19:06:12FromDiscord<voidwalker> also, is this doc out of date, cause I only see parseint taking a var where to store the result of conversion, and the return value is number of processed chars
19:06:15FromDiscord<voidwalker> https://nim-lang.org/docs/parseutils.html#parseInt%2Cstring%2Cint%2Cint
19:26:50FromDiscord<PyryTheBurger> if i have some object, which has a int variable that grows all the time, when it gets to a certain number how do i completely remove that object from memory?
19:50:06FromDiscord<soundmodel> Any input as to how much benefit does Nim with C interop offer compared to just C
19:50:36FromDiscord<soundmodel> I'm interested in doing some Requested Libraries, but I'm confused as to whether the effort towards the bindings is worth it compared to just writing C
19:54:59FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=41jc
19:55:35*jmdaemon joined #nim
19:55:49FromDiscord<voidwalker> ohh it seems that's what I was using already
19:55:55FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=41jc" => "https://play.nim-lang.org/#ix=41jd"
19:56:09FromDiscord<voidwalker> didn't notice it's a different unit
19:56:20FromDiscord<huantian> also, unless you really need that extra bit or you need uint for compatibility, I'd use a range instead
19:56:26FromDiscord<voidwalker> any idea how to build code for release instead of debug, in vscodium ?
19:56:38FromDiscord<huantian> are you using a buidl task?
19:56:44FromDiscord<voidwalker> i am using f6
19:57:03FromDiscord<Forest> How would i make a backend without modifying the Nim source?
19:57:32FromDiscord<huantian> if you wanna build for release, you either wanna make a build task that uses `-d:release`, or just run the command yourself: `nim c -d:release file.nim`, or if you're using nimble `nimble build -d:release`
19:57:39*wallabra joined #nim
19:57:57FromDiscord<Forest> Is it possible to make it so when the outputted binary is ran, it'll call the options like how it's done in the built-in backends?
19:58:54FromDiscord<voidwalker> where do i make that build task to use -d:release?
19:59:09FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=41jf
19:59:18FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=41jf" => "https://play.nim-lang.org/#ix=41jg"
20:00:13FromDiscord<voidwalker> what's wrong with using uint though ?
20:00:24FromDiscord<voidwalker> no, I do not really need that extra bit
20:00:53FromDiscord<voidwalker> but there's a lot of data and i wanted to use the smallest types to accomodate it
20:01:51FromDiscord<huantian> In reply to @voidwalker "where do i make": check out <https://code.visualstudio.com/docs/editor/tasks>↵you wanna make a file at `.vscode/tasks.json` that runs a command, with `"group": "build"`↵then Ctrl + Shift + B to run it
20:03:36FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=41jj
20:04:01FromDiscord<huantian> this is mine for example https://media.discordapp.net/attachments/371759389889003532/992158587478622298/tasks.json
20:04:53FromDiscord<voidwalker> @huantian found 'Nim: Build Command' in nim extension settings in vscodium
20:04:58FromDiscord<voidwalker> that will work
20:05:14FromDiscord<huantian> In reply to @voidwalker "what's wrong with using": they talk about it here ↵https://nim-lang.org/docs/tut1.html#advanced-types-subranges
20:08:03*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
20:08:14FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=
20:08:24FromDiscord<voidwalker> wraps around ?
20:13:59*wallabra joined #nim
20:14:51FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=41jl
20:18:18FromDiscord<voidwalker> oh, you mean they get back to 0 after reaching their maxint.. that's expected, no ?
20:19:00FromDiscord<Andreas> yes, uint8 goes from 9 to 255 and then wraps to 0 and goes on
20:19:07FromDiscord<Andreas> (edit) "9" => "0"
20:20:48FromDiscord<voidwalker> I don't see a problem with that, if you know your data cannot cause it to go over
20:20:54FromDiscord<Andreas> (edit) "on" => "on.↵seems, many don't expect this and AFAIK this is the reason for int-type is the index-type to use in Nim. Which is a 'defensive' decision, but as obviously many ppl got this wrong, it is like so.."
20:24:39FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/41jo
20:25:08FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=41jp
20:32:42FromDiscord<voidwalker> well. i tried recompiling with uint( uint64) instead of uint8 and uint16, and +200MB RAM, and a few percent slower runtime ?
20:36:49FromDiscord<voidwalker> the RAM usage makes sense, since it's a 1.5GB tsv I'm loading into memory, but the slightly faster execution ?
20:41:01FromDiscord<Andreas> sent a code paste, see https://play.nim-lang.org/#ix=41js
20:41:07FromDiscord<voidwalker> no, just release, and --opt:speed
20:41:44*rockcavera joined #nim
20:41:44*rockcavera quit (Changing host)
20:41:44*rockcavera joined #nim
20:42:02FromDiscord<voidwalker> oh wow real improvement, from 9 sec to 8sec
20:42:10FromDiscord<Forest> In reply to @Forest "Is it possible to": :p
20:42:29FromDiscord<Forest> Don't really understand how I'd do this part, or if I'd need to write that part myself completely
20:52:41FromDiscord<soundmodel> In reply to @Professor Actual Factual "Depends on the library": Thank you. But shouldn't this also motivate some guidelines for understand "good C practices for Nim interop"? So that one could gauge beforehand, how feasible a binding will be?
20:59:45FromDiscord<soundmodel> In reply to @soundmodel "Thank you. But shouldn't": I'm thinking of doing this in Nim: https://github.com/mbrucher/PyVST/tree/master/pyvst
21:00:04FromDiscord<soundmodel> So now I'd wonder e.g. that if it maps to Python, then will it also map to Nim?
21:03:33FromDiscord<Professor Actual Factual> In reply to @soundmodel "Thank you. But shouldn't": Please note im not a C expert.↵↵Its true that documentation is somewhat lacking here. The only real C guidelines I can give you are. 1 Dont use macros/preprocessor, 2 keep external dependencies to a minimum, 3 ideally the C final API should a single header/C file, 4 try to stick to default builders like Make.
21:04:39FromDiscord<Professor Actual Factual> (edit) "Make." => "Make (this is nimterop specific or for generating a dynlib)."
21:04:49FromDiscord<soundmodel> a lot of well-used libraries aren't single-header libs
21:05:18FromDiscord<soundmodel> but this shouldn't cause a problem, if they're able to create JNI bindings and whatever, right?
21:07:25FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/41jx
21:08:04FromDiscord<Professor Actual Factual> Single header files are useful IMO because they are easier to bind to using the available interop tools. They are in no way a requirement.
21:08:31FromDiscord<Professor Actual Factual> (edit) "http://ix.io/41jx" => "http://ix.io/41jy"
21:09:29FromDiscord<soundmodel> I wonder if one can use 2. if the lib itself builds a lib
21:09:36FromDiscord<soundmodel> like VST does
21:11:28FromDiscord<Professor Actual Factual> sent a long message, see http://ix.io/41jz
21:12:35FromDiscord<Professor Actual Factual> C2nim does just that translates C files or h files to nim.↵Nimterop does all that, has more features, and allows you to script to install the dynlib. Think of it like the setup.py equivalent for nim.
21:13:17FromDiscord<soundmodel> it builds a .dll from the C code
21:13:26FromDiscord<soundmodel> so I wonder what it means for a binding language
21:15:13FromDiscord<voidwalker> If I do ` for movie in movies:`, where movie is an object, and movies is a seq[movie], how do I get the id of the current item iterated ?
21:15:39FromDiscord<voidwalker> or do I have to count it manually
21:18:07FromDiscord<soundmodel> In reply to @Professor Actual Factual "If thats the case": No I meant that the code builds a .dll from the code (creates a VST plug-in)
21:18:35FromDiscord<soundmodel> (edit) "plug-in)" => "plug-in), so essentially what has been written in the Nim bindings must go into that .dll"
21:18:48FromDiscord<soundmodel> (edit) "in" => "using"
21:19:14FromDiscord<huantian> In reply to @voidwalker "or do I have": check out https://nim-lang.org/docs/enumerate.html
21:19:40FromDiscord<Elegantbeef> You can also just do `for i, movie in movies`
21:20:06FromDiscord<soundmodel> In reply to @soundmodel "No I meant that": and I'm confused now between whether the bindings will first translate to C and then build normally or whether one needs to use the Nim compiler to "produce a .dll"
21:20:56FromDiscord<Elegantbeef> Nim always compiles to another language
21:21:10FromDiscord<soundmodel> I don't even understand how PyVST builds the .dll
21:21:15FromDiscord<Elegantbeef> I guess unless you talk about the nimvm where it's interpreted
21:21:27FromDiscord<Professor Actual Factual> In reply to @soundmodel "and I'm confused now": Im getting a bit confused here. Just to check we're on the same page. I'm assuming you are talking about going from C to Nim (and not the other away around)
21:21:43FromDiscord<soundmodel> In reply to @Professor Actual Factual "Im getting a bit": yes
21:24:42FromDiscord<Professor Actual Factual> sent a code paste, see https://play.nim-lang.org/#ix=41jB
21:28:54FromDiscord<Professor Actual Factual> You can always follow this tutorial to learn: https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f↵Albeit its not the best tutorial
21:31:19FromDiscord<ezquerra> @Impostor, I found a “missing character” in my copy of your book, page 51 https://media.discordapp.net/attachments/371759389889003532/992180556823543808/IMG_1315.jpg
21:32:34FromDiscord<ezquerra> That was meant for Araq
21:32:57FromDiscord<ezquerra> (edit) "@Impostor," => "@Araq ,"
21:33:33FromDiscord<Elegantbeef> Just ping everyone that starts with A you're bound to get him
21:39:46FromDiscord<voidwalker> ask for refund
21:40:38FromDiscord<voidwalker> I wish he'd made an ebook :\ I mean I'd buy the physical book but it's $70 in europe with shipping for me :\
21:45:54FromDiscord<Professor Actual Factual> In reply to @voidwalker "I wish he'd made": Im canada based and got free shipping. Whats up with that
21:46:08FromDiscord<voidwalker> in Europe it's 62 EUR + shipping
21:47:47FromDiscord<Professor Actual Factual> In reply to @voidwalker "in Europe it's 62": 80 CAD + free shipping
21:48:23FromDiscord<Elegantbeef> Where did it ship from domestic or US?
21:51:36FromDiscord<Professor Actual Factual> In reply to @Elegantbeef "Where did it ship": Bolton Ontario Canada. Low volume book sales are usually made on demand, therefore can be made locally. Hence the high price
21:58:54FromDiscord<soundmodel> In reply to @Professor Actual Factual "Ok I can give": Ehh, but how does it produce the api.dll?
21:59:15FromDiscord<Elegantbeef> It doesnt you compile libraries seperate to code that relies on them
21:59:45FromDiscord<soundmodel> but VSTs are shipped only by giving the user a .dll
21:59:56FromDiscord<soundmodel> so I don't understand how it can work if one's now required to give api.nim as well
21:59:58FromDiscord<Elegantbeef> Oh you're talking about generating a dll for a program
22:00:02FromDiscord<soundmodel> yes
22:00:08FromDiscord<soundmodel> DAW programs load a .dll
22:00:11FromDiscord<Elegantbeef> You export the required code then build with `--app:lib`
22:00:51FromDiscord<Elegantbeef> programs that load dlls look for specific procedure names that take specific arguments
22:01:16FromDiscord<Elegantbeef> You export your Nim procedures that match what it's looking for and it will just work
22:06:41FromDiscord<whisper> In reply to @enthus1ast "<@740841107117834330>\: a LPDWORD is": let buffer = newMString(256)↵ let pBuffer = cast[LPSTR](&buffer)↵ GetUserNameA(pBuffer, cast[LPDWORD](buffer))↵ result = cast[string](buffer)
22:07:20FromDiscord<soundmodel> In reply to @Elegantbeef "You export the required": What does "You export the required code" mean?
22:07:46FromDiscord<Elegantbeef> You give Nim `exportC` pragmas and a desired unmangled name for the procedure
22:24:30*oprypin quit (Quit: Bye)
22:24:40*oprypin joined #nim
22:41:36*syl_ quit (Quit: ZNC 1.8.2 - https://znc.in)
22:42:22*syl joined #nim
22:53:34FromDiscord<retkid> soooooooooooo
22:53:45FromDiscord<retkid> does anyone have a source for these common gpu functions
22:53:51FromDiscord<retkid> so i can learn all of them
22:54:02FromDiscord<Elegantbeef> "common gpu functions"
22:54:15FromDiscord<retkid> im writing the ones I SEE
22:54:16FromDiscord<retkid> aaa
22:54:22FromDiscord<retkid> well more array manipulation functions
22:54:30FromDiscord<Elegantbeef> What?
22:55:13FromDiscord<retkid> afa() msum() sum_as_int()
22:55:42FromDiscord<retkid> i wish i had a word for situations like this
22:56:09FromDiscord<Elegantbeef> Well i've never seen those operations in my life so... yea
22:56:41FromDiscord<retkid> ¯\_(ツ)_/¯
22:56:42FromDiscord<retkid> ok then
22:56:57FromDiscord<retkid> well it would be cool if this library had docs
22:57:06FromDiscord<Elegantbeef> What library?
22:58:56*wallabra_ joined #nim
23:00:18*wallabra quit (Ping timeout: 268 seconds)
23:00:18*wallabra_ is now known as wallabra
23:15:19FromDiscord<retkid> if i didn't like the name of a libraries proc is there anyway to change it?
23:15:37FromDiscord<Elegantbeef> Fork it and rename them
23:15:41FromDiscord<Elegantbeef> use `patchFile`
23:15:52FromDiscord<Elegantbeef> Make a file that imports it and exports aliased procedures
23:20:41FromDiscord<retkid> In reply to @Elegantbeef "Fork it and rename": i dont wanna be useful for this community
23:22:00FromDiscord<Elegantbeef> recuses himself from further conversation