00:18:54 | arkanoid | mh, now my project compiles with C but doesn't with C++ |
00:58:13 | FromDiscord | <demotomohiro> It seems you got the error from C++ backend and `tyObject_MasterF...` doesn't have copy constructor but you tried to call it. |
01:04:59 | * | Mister_Magister quit (Quit: bye) |
01:06:52 | * | Mister_Magister joined #nim |
01:15:59 | * | lucasta joined #nim |
01:28:53 | * | jkl quit (Ping timeout: 240 seconds) |
01:37:58 | rockcavera | Robyn [She/Her] Sorry to answer just now, but I've been away these days. What do you mean by using nimcheck in the vscode plugin?. https://irclogs.nim-lang.org/08-03-2024.html#18:06:47 |
01:42:58 | FromDiscord | <Ethin> Question\: how do you do out parameters in stdcall-based functions? Is it just `param: var t` as normal and vim just converts it automatically? |
01:43:21 | FromDiscord | <Ethin> Like for interoping with C libs via std/dynload |
01:43:23 | FromDiscord | <Elegantbeef> `var T` is equal to a `ptr T` in C |
01:43:33 | FromDiscord | <Elegantbeef> So it's a valid `out` param |
01:43:41 | FromDiscord | <Ethin> Ah okay, thanks so much \:D |
01:43:46 | FromDiscord | <Elegantbeef> if you're on 2.0 you can even use `out` |
01:46:27 | * | jkl joined #nim |
01:48:24 | * | jkl quit (Client Quit) |
01:49:23 | * | jkl joined #nim |
01:49:56 | FromDiscord | <Elegantbeef> Ethin you can always run c2nim on prototypes if you want to see what Nim thinks X is π |
01:51:19 | FromDiscord | <Robyn [She/Her]> In reply to @rockcavera "Robyn [She/Her] Sorry to": It's fine! The Nimsaem plugin used to allow you to choose between the language server and Nim check, but that was removed in the official extension |
01:51:27 | FromDiscord | <Ethin> True. Though I'd have to majorly trim down this header file, I don't think it would like it given it's a midl-generated C/C++ header (it isn't COM but they still use the IDL for that). So instead I'm just using `std/dynlib` to dynamically load the DLL and call those functions |
01:51:42 | FromDiscord | <Elegantbeef> c2nim does not need entire typedescs |
01:51:49 | FromDiscord | <Elegantbeef> It's a simple parser/converter |
01:56:19 | arkanoid | major showstopper: my project compiles with C but with C++. Error is in the backend: malebolgia.nim:33:9: error: use of deleted function βtyObject_Master__F3e20AfgTBHcMGUUxuJL1g::tyObject_Master__F3e20AfgTBHcMGUUxuJL1g(const tyObject_Master__F3e20AfgTBHcMGUUxuJL1g&)β |
01:59:07 | FromDiscord | <Robyn [She/Her]> Report in #internals maybe? |
02:02:11 | arkanoid | where is it? discord? |
02:02:29 | FromDiscord | <Elegantbeef> Or matrix π |
02:02:44 | rockcavera | Robyn [She/Her] yes, but I'm using the official plugin. Thanks for clarifying. |
02:02:45 | FromDiscord | <Elegantbeef> Or if you can reproduce it make an issue on github like a responsible person |
02:07:24 | arkanoid | Elegantbeef, won't be easy, but I'll try |
02:15:50 | FromDiscord | <sOkam! π«> @ElegantBeef does it sound possible to create a way to alloc-dealloc cstringArrays with hooks? |
02:16:12 | FromDiscord | <Elegantbeef> If you make your own distinct `cstringarray` yes |
02:16:24 | FromDiscord | <sOkam! π«> yeah that would be the idea |
02:17:06 | FromDiscord | <sOkam! π«> what would I need? just a destroy hook, or something else? |
02:17:39 | FromDiscord | <Elegantbeef> That's it |
02:17:47 | FromDiscord | <sOkam! π«> kk ty |
02:19:14 | FromDiscord | <Elegantbeef> RAII is quite indistinguishable from manual memory management so if you can do it manually you can likely use RAII |
02:19:35 | FromDiscord | <Elegantbeef> `=destroy` is your `dealloc` `=sink` is a `move` and `=wasMoved` is a `reset` or `zero` |
02:19:54 | FromDiscord | <sOkam! π«> makes sense |
02:20:18 | FromDiscord | <Elegantbeef> If I have to explain what `copy` or `dup` is I'll cry π |
02:22:02 | FromDiscord | <sOkam! π«> what's your `alloc` in the hooks context? creating a variable? |
02:22:21 | FromDiscord | <Elegantbeef> Any constructor proc |
02:28:40 | FromDiscord | <Elegantbeef> That's the "Resource acquisition" part of RAII |
02:28:48 | arkanoid | could you please try this if it compiles or your machine or not? For me it fails in C++ but succeeds in C: https://play.nim-lang.org/#pasty=wwRclUWtAGAB |
02:31:08 | FromDiscord | <Elegantbeef> Fails on my machine |
02:31:47 | FromDiscord | <sOkam! π«> what would happen if I create a destroy= hook for vanilla cstringArray? π€ |
02:32:06 | FromDiscord | <Elegantbeef> You cannot |
02:32:11 | FromDiscord | <Elegantbeef> Hooks have to be in the same module as declaration |
02:32:33 | FromDiscord | <sOkam! π«> you mean as the type declaration? |
02:32:38 | FromDiscord | <sOkam! π«> i had no idea about that |
02:33:08 | arkanoid | Elegantbeef, for this kind of problem, would you open an issue on malebolgia or nim itself? the error seems into the C++ backend to me |
02:34:12 | FromDiscord | <Elegantbeef> Go for malebolgia then let araq decide π |
02:34:39 | arkanoid | straight to the king |
02:41:13 | FromDiscord | <Elegantbeef> I wouldn't say that but sure |
02:41:57 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=ImsmlosORxZB |
02:44:57 | FromDiscord | <Elegantbeef> Valgrind it but it looks fine |
02:45:41 | FromDiscord | <Elegantbeef> Actually I'd use `openArray[string]` |
02:47:00 | FromDiscord | <Elegantbeef> Oh also it's `=destroy` |
02:49:19 | arkanoid | Elegantbeef why not? was it offensive? english is not my mothertongue |
02:49:53 | arkanoid | but I might have found the issue just after opening the issue |
02:50:57 | FromDiscord | <Elegantbeef> Nah "King" just implies chosen by god π |
02:51:54 | FromDiscord | <Elegantbeef> I'll be sure to point out offensive things from you when I see them |
02:51:57 | arkanoid | uh? no? history says otherwise, generally |
02:52:06 | FromDiscord | <Elegantbeef> What? |
02:52:33 | FromDiscord | <Elegantbeef> Kings generally were believed to be chosen by god, especially during the 10th-19th century |
02:52:53 | FromDiscord | <Elegantbeef> The Church being so powerful was the one to hand out power |
02:53:11 | FromDiscord | <Elegantbeef> As such leaders were said to be given power from the pope and by extension a 'god' |
02:54:02 | * | adium quit (Quit: Stable ZNC by #bnc4you) |
02:54:24 | * | lucasta quit (Remote host closed the connection) |
02:54:31 | FromDiscord | <Elegantbeef> https://en.wikipedia.org/wiki/Divine_right_of_kings |
02:54:33 | FromDiscord | <Elegantbeef> And all that jazz |
02:55:01 | arkanoid | it depends if you read what the used-to-be-kings wrote, or what the people wrote |
02:55:32 | FromDiscord | <Elegantbeef> Non religious people couldnt write for a long period of time π |
02:56:02 | FromDiscord | <Elegantbeef> Atleast in Europe |
02:58:59 | FromDiscord | <Elegantbeef> For context I'm not overly against calling him a king and am mostly joking |
02:59:10 | arkanoid | there are generally more non-blessed texts saying how kings were bad than otherwise. Problem is that distribution of the latter type of text was much easier |
03:00:11 | FromDiscord | <sOkam! π«> @ElegantBeef ty beef π |
03:00:32 | * | adium joined #nim |
03:00:36 | FromDiscord | <Elegantbeef> Hey that's interrupting our inane "King is bad" conversation that is certainly related to Nim! |
03:01:07 | arkanoid | elegantbeef, btw be careful that "nimble install malebolgia" installs 0.1.0, you need to "nimble install malebolgia@#head" to get 1.3.1 |
03:01:08 | FromDiscord | <sOkam! π«> excuse my peasant ways. how rude of me |
03:01:22 | arkanoid | but the issue I've found is present 1.3.1 |
03:02:46 | FromDiscord | <Elegantbeef> No problem |
03:02:46 | FromDiscord | <Elegantbeef> Though when it comes to whether something is proper never trust me and always trust valgrind and friends |
03:08:11 | arkanoid | funny how the most trivial malebolgia example fails with c++ |
03:10:40 | arkanoid | I think I should fallback to weave, o roll my own threads |
03:10:57 | arkanoid | how many threadpool libs are out there? |
03:16:24 | FromDiscord | <Ethin> Okay this is weird.... I'm trying to use naylib but it's acting like I'm using GCC/Clang and not NSVC even though I'm passing --cc=vcc |
03:16:29 | FromDiscord | <Elegantbeef> @sOkam! π« hey I'm wrong a lot so it's best to trust real tooling π |
03:16:43 | FromDiscord | <Ethin> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1219122202021073038): Okay this is weird.... I'm trying to use naylib but it's acting like I'm using GCC/Clang and not MSVC even though I'm passing --cc=vcc |
03:16:47 | FromDiscord | <Elegantbeef> I'm just a tool π |
03:17:26 | FromDiscord | <sOkam! π«> In reply to @Elegantbeef "I'm just a tool": well then you are famous, even a rock band was named in your honor! (and a really really good one at that) |
03:17:38 | FromDiscord | <Elegantbeef> Uh oh british rock |
03:17:46 | FromDiscord | <Elegantbeef> Wait that's american |
03:17:52 | FromDiscord | <Elegantbeef> What band am I thinking of... |
03:18:23 | FromDiscord | <Elegantbeef> Ethin do you have a config that might be overriding your choice? |
03:21:36 | FromDiscord | <Ethin> I don't think so. There isn't one in my project's directory |
03:21:57 | FromDiscord | <Elegantbeef> Nim prints what configs it's using |
03:22:19 | FromDiscord | <Elegantbeef> If there are non for your local project then you do not have any |
03:22:53 | FromDiscord | <Ethin> I've looked in the Naylib project (that's where it's failing) and it fails when it's trying to build raylib because it's passing GCC arguments to MSVC |
03:26:18 | FromDiscord | <Elegantbeef> Ah then "PR's welcome" π |
03:26:18 | FromDiscord | <Elegantbeef> Though I'd hate depending on vcc for any project, but then again I'd hate depending on any windows tooling |
03:28:04 | FromDiscord | <Ethin> I mean I have no idea why it's using GCC and not VCC so |
03:28:15 | FromDiscord | <Elegantbeef> Cause Nim uses mingw by default |
03:28:45 | FromDiscord | <Ethin> And yeah, normally I wouldn't depend on VCC but most GNU stuff doesn't exactly work well on Windows so |
03:28:59 | FromDiscord | <leorize> you can use clang with msvc target |
03:29:15 | FromDiscord | <Ethin> Yeah but shouldn't my `--cc=vcc` override anything other projects want if they leave it unspecified? |
03:29:30 | FromDiscord | <Elegantbeef> Not if naylib is passing flags expecting a gnu compatible compiler |
03:29:47 | FromDiscord | <Elegantbeef> Naylib is passing flags assuming it's gnu compatible |
03:30:36 | FromDiscord | <Elegantbeef> https://github.com/planetis-m/naylib/blob/main/src/raylib.nim#L7-L10β΅https://github.com/planetis-m/naylib/blob/main/src/raylib.nim#L50β΅And you can find the rest π |
03:31:04 | FromDiscord | <Ethin> Ouchy |
03:32:29 | FromDiscord | <Ethin> Uh.... I'm calling `std/dirs/walkDirRec` like this\: `for path in walkDirRec("sounds", relative=true, checkDir = true, skipSpecial=true):` and it's claiming a type mismatch? |
03:32:44 | FromDiscord | <Ethin> π |
03:33:01 | FromDiscord | <Elegantbeef> Likely should be `Path"sounds"` |
03:33:36 | FromDiscord | <Elegantbeef> `"sounds"` is a string `Path` is a distinct string you need to explicitly convert it |
03:33:56 | FromDiscord | <Ethin> Oh |
03:34:17 | FromDiscord | <Ethin> The compiler error is a bit confusing |
03:34:34 | FromDiscord | <odexine> what does it say? |
03:36:19 | FromDiscord | <Elegantbeef> It tells you the issue is the first parameter inside the `[]` |
03:36:20 | FromDiscord | <Elegantbeef> I still prefer the old mismatch messages even though they filled up the console |
03:39:33 | FromDiscord | <Ethin> sent a code paste, see https://play.nim-lang.org/#pasty=gUQcHlHiwNWo |
03:40:27 | FromDiscord | <Ethin> Sigh, the ironic thing is that MSVC would work fine lol |
03:46:29 | arkanoid | to link a static library, it is sufficient to switch("passL", "/absolute/path/to/libfoo.a"), correct? |
03:52:53 | FromDiscord | <Ethin> Not really sure how to resolve this one |
03:52:54 | FromDiscord | <Ethin> I get the averseness to MSVC but IMO if your building on windows it should be assumed that MSVC is being used |
03:52:55 | FromDiscord | <leorize> looks like you're missing an include or so |
03:52:55 | FromDiscord | <leorize> that kind of syntax is valid, but clang probably couldn't resolve WINBOOL as a type |
03:52:55 | FromDiscord | <Ethin> It's not in my code, so I'm uncertain how to fix it... Idk why they just don't use the win32 headers TBH |
03:52:57 | FromDiscord | <leorize> try getting rid of that line? https://github.com/planetis-m/naylib/blob/b8d4ec1390fb76fb2bdbc7b6d0fdf9a0443ac9ef/src/raylib.nim#L9 |
03:52:57 | FromDiscord | <Ethin> I mean I guess I could try MinGW but I really question if it'll change anything |
03:52:57 | FromDiscord | <leorize> it will work |
03:52:58 | FromDiscord | <leorize> the library author said they tested it on windows and windows is supported |
03:53:00 | FromDiscord | <leorize> and I doubt that they use msvc |
03:53:02 | FromDiscord | <Ethin> Huh, MingW seems to work fine strangely |
03:53:04 | FromDiscord | <leorize> avoid msvc for nim stuff, it's almost never tested |
03:59:54 | FromDiscord | <leorize> yea |
04:00:26 | FromDiscord | <leorize> Ethin\: not the case for nim, unfortunately |
04:34:54 | FromDiscord | <zumi.dxy> does msvc still rep "mostly c89" nowadays |
04:35:10 | FromDiscord | <zumi.dxy> or "half hearted c99" |
04:36:33 | FromDiscord | <Ethin> By default? It supports C17/18 and C++23 |
04:36:44 | FromDiscord | <Ethin> Pretty sure it's on C++11/14 by default now and C11 |
04:36:56 | FromDiscord | <Ethin> In some ways it's ahead of the other compilers |
04:37:27 | FromDiscord | <zumi.dxy> nice |
04:37:56 | FromDiscord | <zumi.dxy> msvc does seem to prioritize c++ |
04:47:04 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
04:47:28 | * | SchweinDeBurg joined #nim |
04:54:03 | FromDiscord | <Ethin> Probably because the majority of windows APIs are C++ based, particularly the modern ones |
04:54:30 | FromDiscord | <planetis> Ethin\: replied on your issue. Sorry you have trouble installing naylib, hope you find a fix. |
04:55:15 | FromDiscord | <planetis> There's also the original Makefile, maybe there's a clue there |
04:56:29 | FromDiscord | <Ethin> sent a long message, see https://pasty.ee/xQevpHdOzdic |
04:57:26 | FromDiscord | <Elegantbeef> You need to pass `--debugger:native` if you want to use a debugger |
04:57:43 | FromDiscord | <Elegantbeef> Also should do `-d:useMalloc` if you want to remove Nim's allocate and just use C's malloc |
04:58:31 | FromDiscord | <planetis> Nqybe you forgot initWindow() |
04:58:47 | FromDiscord | <planetis> Maybe you forgot initWindow() |
05:00:02 | FromDiscord | <Ethin> Oh now it works, I wonder if the debug build is making it slow |
05:01:12 | FromDiscord | <Ethin> And my code for converting strings to wstrings isn't working, it's just sending random garbage to this DLL |
05:01:20 | FromDiscord | <planetis> Yes it does, btw how did you fix it? What changes did you do forn mingw? |
05:01:42 | FromDiscord | <planetis> Yes it does, btw how did you fix it? What changes did you do for mingw? |
05:02:12 | FromDiscord | <Ethin> I just ran `finish.exe`. I'm not a fan of mingw myself, it tends to break randomly on modern versions of windows for me (at least some msys-based utilities I have installed do with allocator errors) but it works fine now other than my DLL issue |
05:03:26 | FromDiscord | <Ethin> sent a code paste, see https://play.nim-lang.org/#pasty=eRdFNnodpETd |
05:03:35 | FromDiscord | <Elegantbeef> Why are you using method? |
05:04:06 | FromDiscord | <Ethin> Because it's a class? Am using nim-classes for it's nice macros |
05:04:25 | FromDiscord | <Elegantbeef> Uh huh |
05:04:58 | FromDiscord | <Ethin> ? |
05:05:15 | FromDiscord | <Ethin> Do you not like it? |
05:05:46 | FromDiscord | <Elegantbeef> I'm just searching for why that does not work, not going to give my opinion on OOP and class macros |
05:06:20 | FromDiscord | <Ethin> Yeah it just sends random garbage even though I'm sending a `std/strformat` fmt string |
05:07:11 | FromDiscord | <Ethin> I wonder if I can do procs and not methods with the nim-classes macro? The example only does methods but maybe? |
05:07:28 | FromDiscord | <Elegantbeef> Might allow procs for static dispatch |
05:07:38 | FromDiscord | <Elegantbeef> That won't change how it behaves though |
05:08:56 | FromDiscord | <Ethin> sent a code paste, see https://play.nim-lang.org/#pasty=UZbnjRjguUUp |
05:09:22 | FromDiscord | <Ethin> So I'm wondering if the representation it's getting is the problem |
05:09:34 | FromDiscord | <Elegantbeef> Heh `wstring` is a `distinct string` |
05:09:40 | FromDiscord | <Elegantbeef> So yea there's your problem |
05:09:58 | FromDiscord | <Elegantbeef> You want `&yourWstr` |
05:10:12 | FromDiscord | <Elegantbeef> so the ugly `& +$yourString` |
05:11:13 | FromDiscord | <Ethin> Oh damn I didn't think of that |
05:11:14 | FromDiscord | <Elegantbeef> In modern Nim I'd imagine `wstring` would be a `distinct ptr UncheckedArray[uint16]` and have it's own destructor |
05:11:46 | FromDiscord | <Elegantbeef> You can also just use `std/widestrs` if you must |
05:12:12 | FromDiscord | <Elegantbeef> It does not have as many helpful utils but it's interopable with raw `wchar_T ` |
05:12:57 | FromDiscord | <Ethin> Yeah I could |
05:13:17 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=PvjmIttlbxry |
05:13:45 | FromDiscord | <Elegantbeef> I'm surprised there is no utf8 procedure |
05:14:08 | FromDiscord | <Ethin> Yeah methods are the only thing allowed in class bodies. Might want to look at other libraries then, I like me some static dispatch |
05:14:36 | FromDiscord | <Elegantbeef> Well a method on an object without children is a static dispatch |
05:14:40 | FromDiscord | <Ethin> I mean I could use std/encodings to throw around conversions but that'd get even uglier |
05:15:01 | FromDiscord | <Elegantbeef> You can just do `newWideStr(myString)` if you use std/widestrs |
05:15:07 | FromDiscord | <Ethin> Then what's the problem with using the method keyword? π |
05:15:10 | FromDiscord | <Elegantbeef> It returns a `ptr UncheckedArray[uint16]` |
05:15:18 | FromDiscord | <Elegantbeef> It implies OOP and I dislike using OOP |
05:15:46 | FromDiscord | <Ethin> I mean the nice thing about Nim is it sort-of lets you pick the paradigm you want to use |
05:16:11 | FromDiscord | <Ethin> So I'd want to change the parameters from wstring to ptr UncheckedArray[uint16]\` then |
05:16:27 | FromDiscord | <Elegantbeef> Or `std/widestrs`'s type |
05:16:45 | FromDiscord | <Ethin> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1219152352096026684): So I'd want to change the parameters from `wstring` to `ptr UncheckedArray[uint16]` then |
05:17:03 | FromDiscord | <Ethin> I might just do that and ditch winim for this particular module |
05:22:19 | FromDiscord | <Elegantbeef> `std/unicode` is purely for utf8 encoding in a `openArray[char]` |
05:22:20 | FromDiscord | <Ethin> Ah okay. Say, why does std/widestrs have WideCString and WideCStringObj? |
05:22:21 | FromDiscord | <Elegantbeef> You cannot define hooks for `ref` |
05:22:43 | FromDiscord | <Elegantbeef> I assume the alias is just for old code |
05:23:43 | FromDiscord | <Ethin> Oh |
05:34:11 | FromDiscord | <Ethin> Question\: is there a document that explains the difference between all the different `-mm` options? |
05:34:31 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/mm.html |
05:34:45 | FromDiscord | <Ethin> Oh, found it, it's [this one](https://nim-lang.org/docs/mm.html) right? |
05:35:00 | FromDiscord | <Elegantbeef> On my side I sent it first |
05:35:03 | FromDiscord | <Ethin> Lol good timing \:D |
05:35:16 | FromDiscord | <Ethin> You ninja'd me |
05:35:24 | FromDiscord | <Elegantbeef> I one by 20 seconds here! |
05:35:26 | FromDiscord | <Elegantbeef> won\ |
05:37:59 | FromDiscord | <Ethin> \:D Yep, ninja! |
05:56:12 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=prGhACLHJQdm |
05:56:25 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=fYxCNkVkLyhK |
05:56:40 | FromDiscord | <sOkam! π«> In reply to @pmunch "Hmm, sounds like a": will do |
05:57:06 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=phgNqNlUQfMh |
05:58:12 | FromDiscord | <sOkam! π«> In reply to @pmunch "Yes, use a rename": but how do you do it? |
05:58:18 | FromDiscord | <sOkam! π«> I'm renaming the fields |
05:58:30 | FromDiscord | <sOkam! π«> but for some reason its prefixing `enum` to the enum declaration |
05:59:38 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=VwCZHWHoNXSj |
05:59:49 | FromDiscord | <sOkam! π«> totally missed it, it was lower down |
06:00:17 | FromDiscord | <pmunch> Ah yes, that's an artifact of the C type system π |
06:01:15 | FromDiscord | <Ethin> What's a good UI framework you guys would recommend? The IUP ones and such don't appear to have been maintained in a long time |
06:03:31 | FromDiscord | <sOkam! π«> In reply to @pmunch "Ah yes, that's an": do you have a way to skip creating all of those `const TheNameOfTheEnumField` generated from each enum field? |
06:06:02 | FromDiscord | <pmunch> What do you mean! The only time Futhark should generate consts for enum fields is when you have an enum with more than one label for the same value. In that case I generate consts for the extra labels |
06:08:04 | FromDiscord | <sOkam! π«> In reply to @pmunch "What do you mean!": idk how it works, but its generating the consts for all fields I've seen π€·ββοΈ |
06:08:43 | FromDiscord | <pmunch> Hmm, that sounds like a bug π€ |
06:08:47 | FromDiscord | <sOkam! π«> In reply to @pmunch "What do you mean!": https://media.discordapp.net/attachments/371759389889003532/1219165589377912952/vulkan.nim?ex=660a4f6f&is=65f7da6f&hm=d30b33c32f0131a5586c8c00eef7d3aae66b6ac560d16d8dba2954fda8742d21& |
06:09:29 | FromDiscord | <pmunch> I'm currently on my phone, will have a look at it later |
06:09:41 | FromDiscord | <sOkam! π«> In reply to @pmunch "I'm currently on my": oh wait no you are 100% right |
06:09:49 | FromDiscord | <sOkam! π«> (edit) "wait no" => "wait, no," |
06:09:57 | FromDiscord | <pmunch> Nice |
06:10:07 | FromDiscord | <sOkam! π«> its generating fields for the `_EXT` versions of the enum, not for the defaults |
06:10:16 | FromDiscord | <sOkam! π«> (edit) "fields" => "consts" |
06:25:14 | * | ntat joined #nim |
06:44:48 | FromDiscord | <Ethin> Are you just running the Vulkan headers through c2nim? I'd recommend writing a parser that generrates Nim code for you based on `vk.xml` if it weren't for the fact that for whatever reason the Khronos group decided it was a good idea to mix C and XML \:P |
06:56:39 | FromDiscord | <Ethin> Anyone have a template for getting started with embedded dev/OSDev in Nim? I've always wanted to try it with Nim to see how far I can get but boot loaders like Limine don't have a Nim library for it that I know of. |
06:57:15 | FromDiscord | <Ethin> Anyone have a template/guide for getting started with embedded dev/OSDev in Nim? I've always wanted to try it with Nim to see how far I can get but boot loaders like Limine don't have a Nim library for it that I know of. Could make my own now that I know the volatile pragma exists, I suppose... |
07:26:24 | * | PMunch joined #nim |
07:36:55 | FromDiscord | <zumi.dxy> there's this I guess https://github.com/dom96/nimkernel |
07:39:51 | FromDiscord | <pmunch> In reply to @Ethin "Are you just running": Running it through Futhark, not c2nim. Futhark is generally much better |
07:40:28 | * | advesperacit joined #nim |
07:46:20 | FromDiscord | <sOkam! π«> @pmunch I'm getting a ton of these now, because the enum values collide with struct types π€β΅They are inside enums, so they should be easily solvable by the compiler, but futhark is adding these anywayβ΅Any idea how to control that? https://media.discordapp.net/attachments/371759389889003532/1219190136181489705/image.png?ex=660a664b&is=65f7f14b&hm=0190e5e706042d5e472c92ee3be3c9c4f6407d6865ccae56d2029f2d078e50f5& |
07:47:25 | FromDiscord | <pmunch> Hmm, that's a bit unfortunate |
07:48:20 | FromDiscord | <pmunch> Basically Futhark refuses names to be reused |
07:49:06 | FromDiscord | <pmunch> So you could use a rename callback to give them other names, but there is no way to make one named just `Instance` for example as that name is already taken by something else |
07:49:11 | FromDiscord | <zumi.dxy> I used futhark and then wrote bindings based on its outputβ΅they can be a good starting point but oftentimes enums are contextual like thatβ΅you may as well write up something yourself |
07:49:39 | FromDiscord | <sOkam! π«> In reply to @zumi.dxy "I used futhark and": if you say this, you haven't dealt with maintaining a moving api ever |
07:49:49 | FromDiscord | <sOkam! π«> you have no clue that mount of work that futhark automates |
07:49:58 | FromDiscord | <pmunch> Part of the reason I created Futhark TBH |
07:50:07 | FromDiscord | <sOkam! π«> (edit) "that mount" => "the amount" |
07:50:18 | FromDiscord | <pmunch> Had a moving API and it kept breaking my hand-written wrapper |
07:50:38 | FromDiscord | <pmunch> But letting Futhark do the thing automatically and then providing a nicer API on top is still valid |
07:50:40 | FromDiscord | <zumi.dxy> can't say i've dealt with huge projects either |
07:50:41 | FromDiscord | <sOkam! π«> i'm doing that. but there are hundreds πβ΅my rename file is already +300lines |
07:51:29 | FromDiscord | <pmunch> If something changes in the API then you'd get compilation errors (hopefully) |
07:52:08 | PMunch | https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L172-L191 |
07:52:25 | PMunch | That's the part that's causing this @sOkam |
07:52:28 | FromDiscord | <sOkam! π«> In reply to @pmunch "If something changes in": good luck tracking the weird ones. one of those nasty ones is why I moved to using futhark instead of manually maintaining it |
07:52:42 | FromDiscord | <sOkam! π«> will take a look, ty |
07:53:06 | PMunch | As you can see the anti-collision stuff is still applied after the renameCallback |
07:53:25 | FromDiscord | <zumi.dxy> next time i make a C API I'll check if it's Futhark-Friendlyβ’οΈ :p |
07:53:28 | FromDiscord | <sOkam! π«> yeah I just noticed |
07:53:47 | PMunch | @zumi.dxy, most things are nowadays :) |
07:54:25 | FromDiscord | <sOkam! π«> In reply to @PMunch "As you can see": is there any chance that you could do this exception for enums?β΅they won't collide, even if they collide, because of enum overloads π€ |
07:55:16 | PMunch | I mean you could do a check on `kind == "enumval"` |
07:55:50 | PMunch | Line 183: `and kind != "enumval"` |
07:56:11 | PMunch | Oh wait.. That's just attach the hex instead |
07:56:48 | PMunch | The problem is if you have an enum with `MYCOOLENUMVAL` and `MyCoolEnumVal` |
07:57:01 | PMunch | They would collide, and must have some handling added to them |
07:57:13 | FromDiscord | <sOkam! π«> wdym? |
07:57:43 | PMunch | Well if you had a single enum with two values that are distinct in C land because of casing but aren't distinct in Nim land |
07:58:14 | PMunch | `sanitizeName` exists to deal with issues like that |
07:58:33 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=zlSyEQAfxHIa |
07:58:44 | FromDiscord | <sOkam! π«> That should not collide, its inside an enum |
07:59:34 | PMunch | But this collides: https://play.nim-lang.org/#pasty=uSrluWKXcizh |
07:59:34 | FromDiscord | <sOkam! π«> In reply to @PMunch "Well if you had": ah i see what you mean |
07:59:41 | PMunch | brb |
08:00:21 | FromDiscord | <sOkam! π«> In reply to @PMunch "But this collides: https://play.nim-lang.org/#pasty": but those are not the case I'm trying to solveβ΅I see what you mean, but what I mean is that there should be a way to not add them the enumval postfix when not necessary |
08:06:19 | FromDiscord | <sOkam! π«> sent a code paste, see https://play.nim-lang.org/#pasty=DzUUBChNpGbN |
08:14:09 | * | tiorock joined #nim |
08:14:09 | * | rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
08:14:09 | * | tiorock is now known as rockcavera |
08:16:01 | FromDiscord | <myxi> sent a code paste, see https://play.nim-lang.org/#pasty=FVkxpksrsnLk |
08:17:33 | FromDiscord | <nnsee> sent a code paste, see https://play.nim-lang.org/#pasty=gVGDrpkIncjn |
08:17:45 | FromDiscord | <myxi> ohh |
08:43:22 | PMunch | sOkam, yeah I get what you mean, I'm just saying that with how Futhark is built that might be a bit tricky to achieve |
08:44:08 | FromDiscord | <sOkam! π«> kk |
08:44:10 | PMunch | Basically this line has to be done without the global state: https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L349 |
08:45:52 | PMunch | Hmm, it might actually not be that hard |
08:46:30 | PMunch | Since usedNames is passed in (through state, but there is an overload here) it should be fairly simple to create a new one for each enum and just use sanitizeName with that |
08:46:57 | PMunch | Could you create an issue for this on GitHub? |
09:11:47 | FromDiscord | <Ethin> Isn't there a pragma you can put on enums to require the fully qualified name? Maybe that might help |
09:12:55 | PMunch | There is (was?) the `pure` pragma for enums. But this is Futhark doing the name mangling, so no amount of pragmas will help here |
09:13:00 | FromDiscord | <nnsee> i think you're thinking of `.pure` |
09:13:10 | PMunch | It should be a rather simple fix though |
09:13:28 | FromDiscord | <Elegantbeef> Pure does not force anything anymore |
09:30:45 | * | rockcavera quit (Remote host closed the connection) |
09:43:32 | FromDiscord | <myxi> is there some tool in the stdlib to fetch the version i set in my .nimble file? |
09:49:18 | FromDiscord | <myxi> In reply to @myxi "is there some tool": i am basically just trying to have a --version flag for my program, so if there's some other standard, that's fine for me too |
09:55:42 | FromDiscord | <nnsee> In reply to @myxi "i am basically just": no standard. really, one should be made imho |
09:55:49 | FromDiscord | <nnsee> meanwhile you may use any of the solutions here https://forum.nim-lang.org/t/7231 |
10:00:20 | FromDiscord | <myxi> thanks |
10:03:51 | FromDiscord | <myxi> sent a code paste, see https://play.nim-lang.org/#pasty=pCpMKOuOtQNo |
10:07:36 | FromDiscord | <sOkam! π«> @pmunch #done βοΈ |
10:23:29 | PMunch | Thanks :) |
10:24:13 | PMunch | Hmm, I should release my project-mode stuff.. |
10:24:35 | PMunch | Now I'm using a secret version, but it slowly drifts from master |
10:31:40 | FromDiscord | <ayex> currently looking into writing a browser addon. since `sleep()` is not available on js backend, how would I wait for a button to appear on the page that shows up after I initiated `node.click()`? |
10:36:41 | FromDiscord | <ieltan> Hello, quick question for the experts here. In an hashtable/hashmap implementation do you think it's judicious to store the indexes of all filled slots in a set ? The stdlib implementation implement iterators for `Table` by yielding every slots that returns true with `isFilled`. I wondered if there was a better solution and came up with it, but I suppose someone had this idea before me and there is a technical reason why this isn't done al |
10:43:56 | * | SebastianM joined #nim |
10:44:08 | * | SebastianM quit (Client Quit) |
10:45:14 | FromDiscord | <ayex> nvm I found\: `setTimeout(callback, 1_000)` π |
10:54:18 | PMunch | @ieltan, a set would be the same thing thing though |
10:54:31 | PMunch | You could store them in a sequence if you absolutely need fast iteration |
10:55:07 | PMunch | But if you need this fast iteration then storing them in a table probably isn't what you want anyways |
10:55:41 | FromDiscord | <ieltan> In reply to @PMunch "You could store them": fair enough π |
10:56:27 | FromDiscord | <ieltan> In reply to @PMunch "But if you need": Absolutely, but it seems like a low hanging fruit that could be used to mitigate this problem |
10:57:02 | PMunch | Well you're not really mitigating a problem, because you now need to hash and lookup the value in the table |
10:57:08 | PMunch | By iterating you skip that step |
10:59:06 | FromDiscord | <ieltan> So, it's a good thing ? I'm not really sure now π
|
10:59:17 | PMunch | It could be a good thing at least :P |
10:59:26 | PMunch | Probably not a very bad thing |
10:59:46 | PMunch | But profiling is your friend if you absolutely need more speed |
11:00:12 | FromDiscord | <ieltan> Alright, thanks for the input it's really helpful π |
11:26:56 | * | PMunch_ joined #nim |
11:28:22 | * | ntat quit (Quit: Leaving) |
11:30:07 | * | PMunch quit (Ping timeout: 268 seconds) |
12:08:52 | FromDiscord | <Ras π«> testing |
12:09:33 | FromDiscord | <nnsee> sorry about that |
12:09:49 | FromDiscord | <Robyn [She/Her]> Hm? What happened? |
12:10:01 | FromDiscord | <Ras π«> i set up a matrix homeserver \:p |
12:10:12 | FromDiscord | <Ras π«> for some reason, i'm not getting chat history, though |
12:10:16 | FromDiscord | <Ras π«> for this room |
12:10:31 | FromDiscord | <Ras π«> oh, suddenly it appeared |
12:10:36 | FromDiscord | <Ras π«> guess it was just taking its sweet time |
12:14:31 | FromDiscord | <Robyn [She/Her]> Oooh |
12:14:36 | FromDiscord | <Robyn [She/Her]> Yeah I'd imagine it'd take ages to sync |
13:01:40 | * | krux02 joined #nim |
13:17:59 | FromDiscord | <ayex> sent a long message, see https://pasty.ee/YINCNEHnJOzD |
13:18:48 | * | rockcavera joined #nim |
13:19:24 | FromDiscord | <ayex> sent a long message, see https://pasty.ee/ClxMuWDrRlNR |
13:21:37 | * | ntat joined #nim |
13:23:00 | FromDiscord | <pmunch> Maybe `Event.KeyboardEvent.key`? |
13:23:17 | FromDiscord | <pmunch> I assume `KeyboardEvent` is an `object of Event` or similar |
13:23:47 | * | PMunch_ is now known as PMunch |
13:23:50 | FromDiscord | <ayex> ah? that sounds easy enough - thank you so much! will try that |
13:25:53 | FromDiscord | <ayex> yay - works like charm β¨ !! \\o/β΅β΅thank you [pmunch](https://matrix.to/#/%40_discord_392962235737047041%3At2bot.io) |
13:35:53 | PMunch | No problem, gotta love an easy fix |
13:40:42 | arkanoid | is there a way to make nimsuggest work on nimscript .nims file, too? my config.nims is filled with errors according to nimsuggest, but it works |
13:41:05 | arkanoid | attempting to call undeclared routine: 'switch' |
13:41:38 | PMunch | "Is there a way" - yes |
13:41:50 | PMunch | But I think that way might be to patch nimsuggest.. |
13:42:13 | arkanoid | if I add "impost system/nimscript" on top I get "ambiguous call; both system.switch(key: string, val: string) [proc declared in nim-2.0.2/lib/system/nimscript.nim(67, 6)] and nimscript.switch(key: string, val: string) [proc declared in nim-2.0.2/lib/system/nimscript.nim(67, 6)] match for: (string, string)" |
13:42:56 | arkanoid | oh, I though it was s configuration thing |
13:45:57 | * | ntat quit (Read error: Connection reset by peer) |
13:46:14 | arkanoid | also "projectDir" is set wrong. Nimble test fills "projectDir" with test dir, not project dir |
13:47:08 | * | ntat joined #nim |
14:00:40 | * | derpydoo joined #nim |
14:10:24 | * | ntat quit (Quit: Leaving) |
14:39:49 | * | xet7 quit (Remote host closed the connection) |
15:01:16 | FromDiscord | <blashyrk> Hi. Why does Nim deep copy heap allocated stuff by default? Seems kinda counterintuitive for a systems (or systems-adjacent) programming language o_O |
15:01:51 | FromDiscord | <blashyrk> Isn't `seq` for example a stack-managed pointer into heap? Why does assigning a seq to another var deep copy by default? |
15:02:11 | FromDiscord | <odexine> seq is intentionally given value semantics |
15:02:42 | * | SEP quit (Ping timeout: 255 seconds) |
15:02:47 | FromDiscord | <odexine> the only value-semantic heap-alloc types are seq and string iirc |
15:02:54 | FromDiscord | <blashyrk> I guess using `ref ` explicitly fixes this behavior right? |
15:02:59 | FromDiscord | <odexine> yes |
15:03:08 | FromDiscord | <odexine> not sure if it becomes a double indirection though |
15:03:23 | * | derpydoo quit (Ping timeout: 260 seconds) |
15:03:25 | FromDiscord | <odexine> i dont remember |
15:03:28 | FromDiscord | <odexine> (edit) " i" => "i" |
15:04:22 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=EFIQexHyKWKN |
15:04:54 | FromDiscord | <odexine> full error please |
15:04:57 | * | SEP joined #nim |
15:05:06 | FromDiscord | <ayex> oki, just a sec |
15:05:09 | FromDiscord | <odexine> likely error because you're using `seq` which is also the type name |
15:05:14 | FromDiscord | <odexine> as a variable name |
15:05:16 | FromDiscord | <odexine> change the name |
15:05:37 | FromDiscord | <ayex> sent a code paste, see https://play.nim-lang.org/#pasty=kaBkRQTRIEFc |
15:06:03 | FromDiscord | <ayex> ah I see - let me try with a different name |
15:06:27 | FromDiscord | <ayex> nope same error |
15:06:32 | FromDiscord | <odexine> ah, additionally, you're using an immutable variable |
15:06:34 | FromDiscord | <odexine> let -> var |
15:06:59 | FromDiscord | <ayex> ah right that is nonsene π
β΅β΅thank you |
15:08:18 | FromDiscord | <ayex> that was it - yikes, I obviously need some coffee πβ΅[odexine](https://matrix.to/#/%40_discord_259277943275126785%3At2bot.io) thank you! |
15:08:59 | FromDiscord | <ayex> I was so focused on the the type I did not look at mutability.. |
15:15:44 | * | PMunch quit (Ping timeout: 260 seconds) |
15:47:24 | * | ntat joined #nim |
16:09:29 | * | krux02 quit (Remote host closed the connection) |
16:13:50 | FromDiscord | <whisperecean> What does some from options do? In layman's terms? π |
16:20:07 | * | xet7 joined #nim |
16:27:11 | FromDiscord | <odexine> wraps a value into an object that isnt nothing |
16:27:17 | FromDiscord | <odexine> object? i mean option, sorry |
16:31:19 | NimEventer | New Nimble package! pnimrp - terminal based audio station player in nim, see https://git.disroot.org/bloomingchad/pnimrp |
16:40:17 | FromDiscord | <fosster> getting random index out of bounds errors with getContent from AsyncHttpClient, is it only me..? |
16:46:20 | FromDiscord | <fosster> now I'm getting seemingly random errors on getContent |
16:46:33 | FromDiscord | <fosster> probably it fails to parse the response |
16:47:35 | FromDiscord | <fosster> shouldn't I fetch a XML RSS feed with getContent? |
16:54:46 | FromDiscord | <Elegantbeef> getContent should be fine, you can always try get instead |
16:55:06 | FromDiscord | <System64 ~ Flandre Scarlet> Just installed Nim on my Linux |
16:57:16 | FromDiscord | <Elegantbeef> Congrats |
16:57:37 | FromDiscord | <Elegantbeef> You're now a leet haxor writing malware |
16:57:46 | FromDiscord | <System64 ~ Flandre Scarlet> π€£ |
16:57:57 | FromDiscord | <System64 ~ Flandre Scarlet> Or to compile Kurumi on Linux |
17:04:27 | * | zgasma joined #nim |
17:13:55 | FromDiscord | <Robyn [She/Her]> Kurumi? |
17:34:43 | FromDiscord | <.bobbbob> In reply to @Elegantbeef "You're now a leet": "hey guys is nim good for malware, and how would I write malware in it, just asking as a joke haha" |
17:56:42 | * | krux02 joined #nim |
18:02:16 | * | TC__ is now known as TC |
18:20:30 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @chronos.vitaqua "Kurumi?": My wavetables synth |
18:26:04 | FromDiscord | <kiloneie> what kind of error is this: `test "Forced Fail":β΅ check(1 == 2)` using expect(ArithmeticDefect) or assertion doesn't make the check ok... |
18:36:01 | * | PMunch joined #nim |
18:51:59 | FromDiscord | <System64 ~ Flandre Scarlet> I wonder how Nim manages cross-compilationβ΅Do I need to install some MinGW dependencies? |
18:52:11 | FromDiscord | <System64 ~ Flandre Scarlet> To cross compile to Windows? |
18:53:14 | PMunch | I think you can just use clang/zig to compile to Windows as well |
18:53:25 | PMunch | But I've done MinGW in the past to cross compile |
18:54:24 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "But I've done MinGW": I'm using Garuda Linux and I struggle to install some MinGW dependencies (mingw-w64-sfml) |
18:54:45 | PMunch | Why are you struggling? |
18:55:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Why are you struggling?": Compilation error with the curl dependencie |
18:56:34 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=dWeRuTHObpDp |
18:57:24 | PMunch | Hmm, what a strange error |
18:58:04 | FromDiscord | <System64 ~ Flandre Scarlet> Yeahβ΅So I used a Windows vm to compile a C program |
18:59:30 | PMunch | Bit cumbersome |
18:59:50 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Bit cumbersome": I can set a docker image with Arch too |
19:00:55 | * | krux02_ joined #nim |
19:03:27 | * | krux02 quit (Ping timeout: 255 seconds) |
19:29:51 | FromDiscord | <myxi> In reply to @sys64 "I can set a": clang seems more than enough, i've not tried it personally though https://mcilloni.ovh/2021/02/09/cxx-cross-clang/ |
19:30:20 | FromDiscord | <Elegantbeef> The issue is cross compiling libraries outside of Nim |
19:30:36 | FromDiscord | <Elegantbeef> Clang and zig work well but you need all your libs you use in windows form |
19:30:49 | FromDiscord | <Elegantbeef> Sadly there is no msys2 for linux π |
19:31:04 | FromDiscord | <Elegantbeef> I mean there is mxe but it does not have things like gtk4 |
19:32:50 | FromDiscord | <Elegantbeef> It also hogs the compilation pipeline |
19:33:10 | FromDiscord | <Elegantbeef> aur does have a bunch of mingw libraries but you have to compile them from source so it's an awful experience |
19:33:32 | FromDiscord | <Elegantbeef> I imagine one could download and extract all of the msys2 packages and then just point your C compiler to them |
19:33:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "aur does have a": And it doesn't even work for me, I have an error because of curl for mingw (see above) |
19:34:04 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @myxi "clang seems more than": Oh, might work better! |
19:34:09 | FromDiscord | <Elegantbeef> "Prs welcome" π |
19:34:14 | FromDiscord | <System64 ~ Flandre Scarlet> wdym? |
19:34:29 | FromDiscord | <Elegantbeef> I mean it's in AUR you can PR to fix the issue if you really want |
19:34:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "I mean it's in": I dunno how to do that |
19:34:47 | FromDiscord | <Elegantbeef> That guide is not going to help much with your issue since curl is not apart of the C std |
19:37:48 | FromDiscord | <System64 ~ Flandre Scarlet> isn't clang less good than gcc? |
19:37:55 | FromDiscord | <Elegantbeef> No |
19:38:01 | FromDiscord | <System64 ~ Flandre Scarlet> better? |
19:38:04 | FromDiscord | <Elegantbeef> Clang is generally better than gcc at optimising |
19:38:10 | FromDiscord | <Elegantbeef> But they're both fine |
19:41:00 | FromDiscord | <myxi> sent a code paste, see https://play.nim-lang.org/#pasty=QLZiCecmyncL |
19:51:51 | FromDiscord | <Ethin> Probably all the protocols it supports lol |
19:52:40 | FromDiscord | <Ras π«> you can't send a PR to AUR. best you can do is post the patch as a comment |
19:52:50 | FromDiscord | <Elegantbeef> That's a PR to me |
19:52:57 | FromDiscord | <Ras π«> fair enough |
19:53:36 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @myxi "what are you using": It's a dependency |
20:01:14 | FromDiscord | <Ethin> What's best practice for downloading and linking to precompiled C libs in a nimble package? Is there some way I could do that with nimble? That is, could I tell nimble "Download this package/zip archive and pass these arguments to link to it and this is where the headers are at"? |
20:01:28 | FromDiscord | <Elegantbeef> Nope |
20:01:37 | FromDiscord | <Elegantbeef> Submodule it and use a config.nims is the best way |
20:02:16 | FromDiscord | <Ethin> \:-( Damn, was hoping to automate that |
20:02:16 | FromDiscord | <Elegantbeef> You can use preinstallhooks to download it |
20:02:19 | FromDiscord | <Elegantbeef> But that requires using system utils since nimble does not expose arbitrary http requests |
20:02:30 | FromDiscord | <Ethin> Particularly since it's a release I'd like to link to and building the library from source is... Very very complicated/unconventional |
20:03:16 | FromDiscord | <Elegantbeef> So if you want to depend on the user have `wget` `curl` or whatever tools you need on their system it's not too bad |
20:03:48 | FromDiscord | <Ethin> I take it I can't say "use this dep only in config.nims"? |
20:04:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=yIOEtvFgloQP |
20:04:39 | FromDiscord | <Elegantbeef> You can do a `taskRequires` but nimscript has no ffi |
20:05:43 | FromDiscord | <Ethin> Huh okay, I suppose that would work. Pretty sure I could depend on curl existing pretty much everywhere |
20:06:15 | FromDiscord | <Elegantbeef> Windows exists |
20:06:19 | FromDiscord | <Ethin> Was just wondering since I know in systems like CMake you can just use ExternalProject and such |
20:06:46 | FromDiscord | <Ethin> I think Windows has curl by default now. I know it has tar and such |
20:07:07 | FromDiscord | <Ethin> Yup, it does, my curl.exe is in c\:\\windows\\system32 |
20:07:19 | FromDiscord | <Elegantbeef> Yea Nimble is really only concerned with nim packages sadly |
20:08:17 | FromDiscord | <Elegantbeef> Atlas has more concern with external code but uncertain how it'd handle nested external dependencies |
20:09:00 | FromDiscord | <Ethin> That's why I was just going to download the release since building the library is a PITA (it depends on TrueAudioNext/Embree and a bunch of other stuff to build) |
20:09:43 | FromDiscord | <Elegantbeef> Yes it's simple enough to expect curl/wget in the shell and download those inside a `before install` |
20:10:01 | FromDiscord | <Ethin> I wonder if I could use futhark for that part though? The README talks about automating the download/build of a library but I imagine I could also say "this is a binary so there's no build method, just pull in these headers" |
20:11:18 | * | ntat quit (Quit: Leaving) |
20:13:40 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/atlas/issues/3 but yea luckily atlas does have some concern with external code π |
20:16:39 | FromDiscord | <Ethin> How would I incorporate that? Would I ship the full atlas workspace in a git repo? |
20:16:50 | FromDiscord | <Ethin> Never used atlas so am only used to nimble lol |
20:17:15 | FromDiscord | <System64 ~ Flandre Scarlet> Is clang easier for cross-compilation? |
20:18:03 | FromDiscord | <Elegantbeef> You would not need to ship anything but your code and likely a `.nimble` |
20:18:36 | FromDiscord | <Elegantbeef> the `.nimble` would probably have like a `foreignDep "someurl.tar.gz"` or something of that sort and a extractor could download and extract that I'd imagine |
20:18:39 | FromDiscord | <Elegantbeef> No clue though π |
20:18:51 | FromDiscord | <Elegantbeef> Clang is not much easier for cross compilation, but it is |
20:18:59 | FromDiscord | <Elegantbeef> it is easier |
20:19:08 | FromDiscord | <Ethin> The problem with building the library from source is you have to (1) change to a subdirectory in the repo, (2) run build/getdeps.py, and then (3) run build/build.py. Building it using ordinary CMake doesn't exactly work well. Given the shear project complexity I just like to go download it from the releases page as a binary release and just use that |
20:19:09 | FromDiscord | <Elegantbeef> Like I said though your issue is not the C compiler but the C dependencies |
20:19:27 | FromDiscord | <Elegantbeef> Right ethin but I'm saying you could always just depend on the build artifact |
20:19:47 | FromDiscord | <System64 ~ Flandre Scarlet> yeah this is an huge problemβ΅And this curl error prevent me to going further in the installation |
20:20:24 | FromDiscord | <Elegantbeef> Probably best to use msys2 in wine, a docker container, a vm, LXD or a CI |
20:20:32 | FromDiscord | <Ethin> I know, just have to figure out how, will look into Atlas |
20:20:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Probably best to use": msys2 freezes at 50% in wine |
20:20:47 | FromDiscord | <Elegantbeef> Atlas does not presently support what I'm talking about sadly π |
20:20:56 | * | PMunch quit (Quit: leaving) |
20:21:07 | FromDiscord | <Ethin> Then I am quite confused on what you mean xD |
20:21:09 | FromDiscord | <Elegantbeef> So best to just use `before install` and `curl` your assets |
20:21:30 | FromDiscord | <Elegantbeef> I'm saying it's actually interested in supporting external dependencies regardless if they're in source or binary form |
20:21:35 | FromDiscord | <Ethin> Does that execute before build too? |
20:21:45 | FromDiscord | <Elegantbeef> no |
20:21:52 | FromDiscord | <Elegantbeef> You can do `before build` if you wanted |
20:22:08 | FromDiscord | <Elegantbeef> You can do a `before` or `after` on any task |
20:22:26 | FromDiscord | <Ethin> Ah okay. Then I would just need to tell nim/futhark where the deps are at |
20:23:12 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/mmozeiko/docker-mingw-w64β΅Maybe this docker can help me |
20:24:08 | FromDiscord | <Elegantbeef> What are you trying to build? |
20:24:24 | FromDiscord | <Elegantbeef> I know you have a curl dep but what's the library? |
20:24:39 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "I know you have": mingw-w64-sfml |
20:27:05 | FromDiscord | <Elegantbeef> Sfml does ship a mingw library |
20:27:27 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Sfml does ship a": The Linux one? |
20:27:37 | FromDiscord | <Elegantbeef> https://www.sfml-dev.org/download/sfml/2.6.1/ |
20:28:04 | FromDiscord | <System64 ~ Flandre Scarlet> Setting this up would be a nightmare |
20:28:44 | FromDiscord | <Elegantbeef> Hey you download it then do `--passC"-I /path/to/sfml/include" --passL:"-L /path/to/sfml/lib"` |
20:29:37 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Hey you download it": It's not for nim in this case, it's for a C/C++ project |
20:31:59 | FromDiscord | <Elegantbeef> Best to just setup a docker imager or CI |
20:32:03 | FromDiscord | <Elegantbeef> image\ |
20:32:32 | FromDiscord | <Elegantbeef> Actually I'm daft you cannot run windows on linux |
20:32:43 | FromDiscord | <System64 ~ Flandre Scarlet> I have a VM |
20:37:13 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "I wonder how Nim": Look into ZigCC, it's pretty convenient to more |
20:37:24 | FromDiscord | <Elegantbeef> Will no one listen to me |
20:37:27 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Clang and zig work": Ah |
20:38:32 | FromDiscord | <Phil> @ElegantBeef no |
20:39:02 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Will no one listen": Nope |
20:39:03 | FromDiscord | <Elegantbeef> I am presently van gogh's scream |
20:39:05 | FromDiscord | <Phil> That would be too easy |
20:40:13 | FromDiscord | <Phil> In reply to @Elegantbeef "I am presently van": Man you're old then |
20:50:38 | FromDiscord | <System64 ~ Flandre Scarlet> Is there a recommanded Docker for cross-compilation to Windows? |
20:50:57 | FromDiscord | <Ethin> Are Nim structs automatically C-compatible? |
20:51:13 | FromDiscord | <Ethin> Wait, stupid question lol |
20:51:31 | FromDiscord | <Ethin> I had a brain fart xD |
21:03:44 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "Is there a recommanded": π€·ββοΈ just use whatever you find |
21:12:56 | FromDiscord | <Ras π«> huh? did you hear that? almost sounded like someone said something |
21:28:05 | FromDiscord | <Elegantbeef> Like a fart in wind storm |
21:40:56 | NimEventer | New thread by mantielero: JS bindings question - Quill, see https://forum.nim-lang.org/t/11242 |
21:44:22 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=YoRuonUmOOmb |
22:32:18 | FromDiscord | <System64 ~ Flandre Scarlet> I already hate docker |
22:33:28 | FromDiscord | <Elegantbeef> Same |
23:07:02 | * | rockcavera quit (Remote host closed the connection) |
23:16:02 | * | advesperacit quit () |
23:19:17 | FromDiscord | <griffith1deadly> same |
23:19:39 | FromDiscord | <Robyn [She/Her]> In reply to @sys64 "I already hate docker": :P |
23:43:44 | FromDiscord | <jviega> In reply to @Elegantbeef "I am presently van": Is that a joke or did you mean Munch? |
23:45:26 | FromDiscord | <Elegantbeef> Hey i'm not an art historian |
23:45:34 | FromDiscord | <Elegantbeef> It's commonly attributed to van gogh |
23:47:24 | FromDiscord | <jviega> Uhh, okay. I know 0 about art but I know thatβs not him π |