00:05:48 | FromDiscord | <HuskyHacks> Hey Nim Discord, so @dom96 just came through one of the security research discords and hung out for a bit. The topic of the erroneous Defender triggers on the compiled binaries came up |
00:06:25 | FromDiscord | <HuskyHacks> if you want, I can help you find out exactly what is flagging in the Nim compiled binaries |
00:06:34 | FromDiscord | <HuskyHacks> The security community makes use of a tool called ThreatCheck to weaponeer payloads, i.e. find out which bytes Defender and AMSI are triggering on. But of course the same tool can be used to identify an erroneous Defender trigger for a legitimate binary and troubleshoot it from there |
00:06:38 | FromDiscord | <ynfle (ynfle)> Its a big issue for many newcomers |
00:07:51 | nrds | <Prestige99> When cross compiling from linux to windows and overriding libraries, do I need to download and point at the windows libs? Or should I only need the .so files? |
00:08:37 | nrds | <Prestige99> Attempting to link sdl2 and sdl_gpu to compile for windows |
00:11:24 | nrds | <Prestige99> Specifically trying --dynlibOverride:SDL2 --passL:/usr/lib/libSDL2.so `x86_64-w64-mingw32/bin/ld: /usr/lib/libSDL2.so: error adding symbols: file in wrong format` |
00:11:37 | FromDiscord | <impbox [ftsf]> you'll need the dll i believe |
00:11:44 | FromDiscord | <impbox [ftsf]> you don't need the .lib files |
00:11:45 | nrds | <Prestige99> ah, alright |
00:16:32 | FromDiscord | <impbox [ftsf]> `--passL:-lSDL` should do it i think |
00:17:37 | nrds | <Prestige99> I passed in the .dll and it seems to have worked |
00:17:51 | nrds | <Prestige99> only problem is now, is there's no dll for sdl_gpu |
00:18:29 | FromDiscord | <Elegantbeef> can you build it using mingw? |
00:18:48 | FromDiscord | <impbox [ftsf]> yeah |
00:19:11 | FromDiscord | <impbox [ftsf]> `-lSDL2` will work cross platform |
00:19:19 | FromDiscord | <impbox [ftsf]> so you don't need to specify the full path/name |
00:19:25 | FromDiscord | <Elegantbeef> well i meant for `sdl2_gpu` |
00:19:31 | FromDiscord | <impbox [ftsf]> but yeah, good luck with sdl2_gpu |
00:19:51 | nrds | <Prestige99> Weird, mine doesn't compile with --passL:-lSDL2 |
00:19:59 | nrds | <Prestige99> cannot find -lSDL2 |
00:20:13 | FromDiscord | <impbox [ftsf]> hmm probably not in your library path |
00:20:24 | FromDiscord | <impbox [ftsf]> `-L.` if it's in current dir |
00:21:55 | nrds | <Prestige99> in what way? |
00:22:44 | nrds | <Prestige99> (it works if I compile for linux but not windows, SDL2.dll is in the current dir) |
00:27:41 | FromDiscord | <impbox [ftsf]> ahh probably needs to be called libSDL2.dll |
00:30:44 | nrds | <Prestige99> rename it to that and do -d:mingw --dynlibOverride:SDL2 --passL:-lSDL ? |
00:30:54 | FromDiscord | <impbox [ftsf]> yep |
00:30:56 | FromDiscord | <impbox [ftsf]> -lSDL2 |
00:31:21 | nrds | <Prestige99> hmm still x86_64-w64-mingw32/bin/ld: cannot find -lSDL2 |
00:31:58 | FromDiscord | <impbox [ftsf]> and `--passL:-L.` to tell it to look in the current dir, or whatever path the library is in |
00:32:29 | FromDiscord | <impbox [ftsf]> unless it's under `x86_64-w64-mingw32/lib/` |
00:32:43 | nrds | <Prestige99> ah adding that --passL:-L. did the trick, thanks |
00:33:19 | nrds | <Prestige99> It actually expected it to be called SDL2.dll |
00:34:39 | FromDiscord | <impbox [ftsf]> oh ok then, sorry |
00:34:52 | nrds | <Prestige99> no worries 🙂 thanks for the help |
01:16:51 | * | neurocyte0132889 quit (Ping timeout: 260 seconds) |
01:19:03 | FromDiscord | <Hi02Hi> In reply to @eyecon "Can I initialize a": I don't think I saw a response, but in sequtils there is newSeqWith(), so `is_prime = new_seq_with(maxnum + 1, true)` |
01:20:11 | FromDiscord | <Elegantbeef> What was teh question? \:d |
01:25:02 | FromDiscord | <eyecon> In reply to @Hi02Hi "I don't think I": Ah, thanks |
01:36:28 | * | Jjp137 quit (Read error: Connection reset by peer) |
01:39:15 | FromDiscord | <impbox [ftsf]> missing out on the context in matrix it seems |
01:40:04 | FromDiscord | <Elegantbeef> Yea replies dont properly reply on the bridge |
03:42:13 | * | rockcavera quit (Remote host closed the connection) |
03:46:37 | * | Jjp137 joined #nim |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
05:50:13 | NimEventer | New thread by Vsajip: How do you get the actual exception from doAssertRaises?, see https://forum.nim-lang.org/t/8546 |
06:06:29 | FromDiscord | <Rika> @beef regards the forum post this doesn’t assert that the exception is raised |
06:07:25 | FromDiscord | <Elegantbeef> Oh right |
06:08:00 | FromDiscord | <Elegantbeef> Thanks now it looks sillier but accomplishes |
06:30:38 | * | kenran joined #nim |
07:00:12 | * | PMunch joined #nim |
07:11:46 | * | pro joined #nim |
07:14:16 | FromDiscord | <Revenant> hey, just trying to get to confirm my observation that the 32-bit version of Nim seems to be quite badly broken, at least on Windows. using the latest 1.6.0 version |
07:14:47 | FromDiscord | <Revenant> which is sad, because then i can only provide 64-bit binaries to my users... |
07:14:57 | FromDiscord | <impbox [ftsf]> broken how? |
07:15:43 | FromDiscord | <Revenant> random memory violations, e.g. i'm passing a string to a simple proc, then the string suddenly changes address after a few loop iterations, resulting in a crash when compiled on 32-bits |
07:15:48 | FromDiscord | <Revenant> on 64-bits, no problems |
07:16:12 | FromDiscord | <Elegantbeef> Well make issues, but 32bit is quite a unicorn now |
07:16:20 | FromDiscord | <Revenant> in what sense? |
07:16:32 | FromDiscord | <Elegantbeef> If you can easily reproduce it i'd like to see the code |
07:16:49 | FromDiscord | <Elegantbeef> 32bit isnt a commonly used architecture anymore |
07:17:13 | FromDiscord | <Revenant> how about windows 7 users? quite a few are on 32-bit still, and there's still 32-bit win 10 installations around |
07:17:16 | FromDiscord | <Revenant> maybe not for linux 🙂 |
07:17:48 | FromDiscord | <Elegantbeef> Supporting EOL software sound silly to me atleast |
07:17:49 | FromDiscord | <Revenant> ok, probably less than 10%... but that's still a few millions of people... |
07:17:54 | madprops | isn't nim development made on windows? |
07:17:59 | FromDiscord | <impbox [ftsf]> it's still supported, so if you have a way to reproduce it worth filing an issue |
07:18:08 | FromDiscord | <impbox [ftsf]> but are you sure it's not user error? |
07:18:11 | FromDiscord | <Revenant> yeah that's fine too, but then they should remove the 32-bit installer from the website |
07:18:15 | FromDiscord | <Revenant> as i said, quite badly broken |
07:18:27 | FromDiscord | <Revenant> and state, "64-bits only" |
07:18:29 | FromDiscord | <impbox [ftsf]> are you wrapping C libs and not using the correct types |
07:19:06 | FromDiscord | <impbox [ftsf]> but yeah, we obviously want it to still work on win32, so if you have an example that isn't working, please share it so we can look into it |
07:19:08 | FromDiscord | <Revenant> could be, it's in my glfw wrapper project |
07:19:36 | FromDiscord | <Revenant> check this↵https://github.com/johnnovak/nim-glfw/blob/master/examples/glad/gl.nim#L3010 |
07:20:06 | FromDiscord | <Revenant> so extname is just a string arg of that proc, and after a few iterations the pointer has a value of 8 |
07:20:08 | FromDiscord | <Revenant> never a good thing 🙂 |
07:20:17 | FromDiscord | <Revenant> maybe memory corruption? |
07:20:24 | FromDiscord | <impbox [ftsf]> well if you're corrupting memory it could be happening anywhere |
07:20:29 | FromDiscord | <Revenant> yeah |
07:20:47 | FromDiscord | <impbox [ftsf]> those types look dangerous |
07:20:54 | FromDiscord | <impbox [ftsf]> if they are int in c they should use cint |
07:21:00 | FromDiscord | <impbox [ftsf]> likewise unsigned int should be cuint |
07:21:02 | FromDiscord | <Revenant> you mean the {.cdecl.} stuff? |
07:21:23 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3CUb |
07:21:53 | FromDiscord | <Revenant> ah yeah... that's doesn't look good |
07:22:17 | FromDiscord | <Revenant> well, it's been working on 64bit nim fine, it's the first time i'm trying it on 32bit |
07:22:20 | FromDiscord | <impbox [ftsf]> but you'd need to check the C header to check they're correct |
07:22:27 | FromDiscord | <Revenant> i'll try specifying the width for every type, etc |
07:22:28 | FromDiscord | <Revenant> thanks |
07:22:30 | FromDiscord | <impbox [ftsf]> yep, my guess is it's a mismatch in int size or something |
07:22:54 | FromDiscord | <Revenant> it would be good if it's something as simple as that 🙂 |
07:23:26 | FromDiscord | <Revenant> i converted those manually from the official khronos opengl headers, those just use c types |
07:23:42 | FromDiscord | <impbox [ftsf]> yep, so if it says "int" in C, use "cint" in nim |
07:23:48 | FromDiscord | <impbox [ftsf]> and unsigned int -> cuint in nim |
07:23:59 | FromDiscord | <Revenant> they should be int32, clearly |
07:24:06 | FromDiscord | <Revenant> yeah okay |
07:24:16 | FromDiscord | <impbox [ftsf]> if they're int in C don't use int32 |
07:24:21 | FromDiscord | <impbox [ftsf]> use cint |
07:24:24 | FromDiscord | <Revenant> okay |
07:24:27 | madprops | why is that? |
07:24:47 | FromDiscord | <impbox [ftsf]> because the c compiler needs to agree with nim about what size they are |
07:24:49 | FromDiscord | <Revenant> i thought ints in C are always 32-bit, then you have long for 64-bit ints |
07:24:58 | FromDiscord | <Revenant> but i guess that's only generally true, not always |
07:26:04 | FromDiscord | <impbox [ftsf]> int can be 64 bits on 64 bit linux, but it's up to the compiler |
07:26:14 | FromDiscord | <impbox [ftsf]> so you want to ensure they're using the same thing |
07:26:27 | FromDiscord | <impbox [ftsf]> so just remember int in C -> cint, unsigned int in C -> cuint |
07:26:42 | FromDiscord | <Revenant> yep, cheers |
07:26:53 | FromDiscord | <impbox [ftsf]> if the c header specifies a bit size, specify the same size |
07:27:03 | FromDiscord | <impbox [ftsf]> eg uint32_t -> uint32 |
07:38:27 | Amun-Ra | int has to be min. 16-bit |
07:42:41 | FromDiscord | <Rika> Huh? |
07:43:00 | FromDiscord | <impbox [ftsf]> in C |
07:43:07 | Amun-Ra | yes |
07:43:09 | FromDiscord | <impbox [ftsf]> according to the spec i think |
07:43:17 | Amun-Ra | mhm |
07:44:05 | FromDiscord | <impbox [ftsf]> has anyone targeted an 8 bit architecture with nim? |
07:44:54 | FromDiscord | <Elegantbeef> I figure the issue with that is the C compiler, unlikely you'd get C from Nim it could compile |
07:45:01 | FromDiscord | <Rika> Oh that’s what you mean |
07:45:25 | FromDiscord | <Rika> Yeah the sizes of int and unsigned are not specific numbers |
07:45:36 | Amun-Ra | impbox [ftsf]: I've found https://disconnected.systems/blog/nim-on-adruino |
07:45:43 | PMunch | impbox_[ftsf], yup. On various microcontrollers |
07:46:13 | FromDiscord | <impbox [ftsf]> mmm arduino isn't 8 bit though is it? |
07:46:25 | FromDiscord | <impbox [ftsf]> i imagine someone might have targeted z80 for gameboy or something |
07:46:29 | FromDiscord | <Rika> It is afaik? |
07:46:35 | Amun-Ra | arduino is not an architecture |
07:46:39 | PMunch | Most of them are I believe |
07:46:45 | FromDiscord | <Rika> The uno (base and most popular) is 8 |
07:46:50 | PMunch | The underlying chips of course |
07:46:54 | FromDiscord | <Rika> Duo and others are 32 |
07:47:02 | FromDiscord | <impbox [ftsf]> ahh atmega328 is 8 bit, interesting |
07:47:24 | PMunch | I've used the ATmega32u4 in both a Leonardo and a Teensy 2.0, and it is 8-bit |
07:47:43 | FromDiscord | <impbox [ftsf]> cool |
07:48:16 | FromDiscord | <impbox [ftsf]> i've done some arduino stuff, never realised it was 8 bit though, only done teensy 3.6 which is 32 bit i think |
07:48:24 | FromDiscord | <impbox [ftsf]> need to try do some nim stuff with teensy |
07:48:52 | Amun-Ra | teensy 3.6 uses ARM |
07:48:55 | FromDiscord | <Elegantbeef> Dont mention microcontrollers it just reminds me i've not done any more wrapping of the pico-sdk! |
07:49:09 | supakeen | Arduino is both a bootloader and a 'standard library' that is implemented for many chipsets. |
07:50:10 | PMunch | Oh yeah, I haven't looked at that any more either |
07:50:32 | PMunch | I still plan on wrapping all the AVR chips and setting up a common Nim ecosystem for microcontrollers |
07:50:40 | PMunch | Basically an alternative to Arduino |
07:50:46 | supakeen | You should speak to dom on that :) |
07:50:53 | supakeen | (also that is a *lot* of work) |
07:51:00 | PMunch | I know |
07:51:16 | FromDiscord | <Elegantbeef> I dont have the hardware to continue wrapping the pico library |
07:51:30 | supakeen | You'd be better off wrapping the ESP32 HAL (or Arduino) and to get support for Nim in platformio :) |
07:51:36 | FromDiscord | <Elegantbeef> Hard to test stuff you cannot test \:P |
07:51:38 | supakeen | (or writing a different toolchain for that bit) |
07:51:41 | FromDiscord | <impbox [ftsf]> i have a bunch of picos i have no use for |
07:51:53 | supakeen | Elegantbeef: What hardware do you need? |
07:51:58 | PMunch | But wrapping Arduino doesn't give us any benefits.. |
07:52:06 | FromDiscord | <Elegantbeef> Actual shit to drive |
07:52:20 | PMunch | I mean my pure Nim -> AVR code is super fast and compact compared to Arduino |
07:52:34 | FromDiscord | <Elegantbeef> I guess i do have an arduino so i can technically test everything |
07:52:46 | supakeen | Elegantbeef: name some stuff, radios? Sensors? |
07:53:36 | FromDiscord | <Elegantbeef> i2c stuff, pretty much anything more complex than just gpio operations |
07:53:39 | supakeen | Ok. |
07:54:13 | supakeen | If you PM me your address I can send you some stuff that speaks I2C, SPI, and I2S (some temperature, pressure, audio, dust, etc sensors). |
07:54:22 | supakeen | Only if you want, of course :) |
07:54:23 | FromDiscord | <Elegantbeef> I do know one person uses my bindings and the i2c bindings seem to work (they printed their name to their scope) |
07:55:08 | meowray | how to create a seq[cint] from nums: ptr UncheckedArray[cint], n: int ? |
07:56:36 | PMunch | var data = newSeqOfCap(n); for i in 0..<n: data.add nums[i] |
07:57:07 | PMunch | I guess you could also use memcpy |
07:57:10 | FromDiscord | <Rika> Collect where smh |
07:58:08 | PMunch | var data = newSeq[cint](n); copyMem(data[0].addr, nums, n*sizeof(cint)) |
07:58:12 | PMunch | Something like that |
07:59:20 | FromDiscord | <Elegantbeef> `import std/sugar; var data = collect(newSeq): for i in 0..<n : nums[i]` for rika's sanity |
08:00:05 | PMunch | Unfortunately there is no way to create a seq without copying. This is simply because seqs are GCd, so you can't just make one frome any kind of data. |
08:01:22 | FromDiscord | <Elegantbeef> Depending what you're doing `nums.toOpenArray(0, n - 1)` could be used, but cannot be stored to a variable |
08:02:02 | PMunch | Ah yes, that is true |
08:02:28 | meowray | i fail to find an API converting `nums.toOpenArray(0, n - 1)` to a seq:( i go with `var a = newSeq[cint](n); for i in 0..<n: a[i] = nums[i] ` currently |
08:02:59 | meowray | the drawback of `copyMem` is like `memcpy` vs `std::copy_n`. the former needs `sizeof(cint)` which is error-prone |
08:03:55 | FromDiscord | <Elegantbeef> Yea it doesnt convert to a seq, it converts it to an `openArray` as the name implies, which is useful if you're iterating or applying operations to it |
08:05:06 | FromDiscord | <Elegantbeef> Though to be able to use it easily without view types you'd probably want to do the unsafe thing of `template numsOa: openArray[cint] = nums.toOpenArray(0, n - 1)` but i digress |
08:05:08 | meowray | the version i currently have:) https://github.com/MaskRay/LeetCode/blob/master/find-k-th-smallest-pair-distance.nim (yeah, i generate self-contained C with the help of https://github.com/goblint/cil/ |
08:06:53 | meowray | follow-up question about testing: any better way than `let a = @[1,6,1].mapIt(cast[cint](it)).toSeq; echo smallestDistancePair(cast[ptr UncheckedArray[cint]](unsafeAddr a[0]), 3, 3)` ? |
08:07:21 | FromDiscord | <Rika> What the hell lol |
08:07:35 | FromDiscord | <Rika> Do you really need to go through so many hoops to do that |
08:07:59 | FromDiscord | <Rika> And what reason |
08:11:29 | meowray | i know it's ugly but LeetCode's "C" language requires such an ugly function signature. https://0x0.st/-ddR.jpg |
08:11:33 | FromDiscord | <Elegantbeef> damn you cannot get a var open array from a pointer |
08:12:44 | meowray | i use the approach from https://zen.su/posts/amalgamating-nim-programs/ (actually, https://maskray.me/blog/2021-09-26-competitive-programming-in-nim ) to get a self-contained C source file that I can submit on leetcode... |
08:33:26 | * | pro quit (Read error: Connection reset by peer) |
08:34:01 | * | pro joined #nim |
08:39:21 | * | pro quit (Quit: WeeChat 3.3) |
08:46:25 | arkanoid | is there any nim porgram/package known to be using CPS? |
08:48:50 | FromDiscord | <Elegantbeef> https://github.com/alaviss/nim-sys https://github.com/nim-works/loony |
08:49:16 | FromDiscord | <tandy> honestly tho, the team needs to hire someone to work on the compiler |
08:49:20 | FromDiscord | <tandy> maybe some more marketting too |
08:49:45 | FromDiscord | <tandy> if money is left over hire someone to make the js backend much more supported by stdlib, make stuff like jstring happen, etc |
08:49:51 | FromDiscord | <haxscramper> There are already people who are hired by status to work on compiler |
08:49:59 | FromDiscord | <tandy> moar |
08:50:33 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/8540#55418The fulltime paid devs are me and Narimiran; xflywind is paid for his work too but he is not a fulltime developer yet. We also sponsor Kiloneie's work on the "edutainment" YouTube videos. |
08:50:37 | FromDiscord | <Rika> 100k isn’t much to hire someone is it |
08:50:59 | FromDiscord | <Elegantbeef> It's enough for fulltime for a year roughly |
08:51:19 | FromDiscord | <Rika> “Me” being Araq by the way |
08:51:45 | FromDiscord | <haxscramper> Nim core devs have to come up with some shared vision for the language, and ecosystem and what we are aiming to advertise |
08:51:56 | FromDiscord | <haxscramper> But instead we are piling up new random features |
08:52:06 | FromDiscord | <haxscramper> 15 new stdlib modules, right |
08:52:18 | FromDiscord | <tandy> no not really↵(@Rika) |
08:52:32 | FromDiscord | <tandy> oh good to hear ur paid |
08:52:40 | FromDiscord | <Rika> Tandy read what I said |
08:52:48 | FromDiscord | <Rika> The “me” refers to Araq |
08:52:51 | FromDiscord | <haxscramper> "me" is araq |
08:52:52 | FromDiscord | <Elegantbeef> He's not that was a quote from araq |
08:52:54 | FromDiscord | <tandy> oh lmao↵(@Rika) |
08:52:56 | FromDiscord | <haxscramper> This is a quote from forum |
08:53:00 | FromDiscord | <Rika> Lol |
08:53:01 | FromDiscord | <tandy> fuck |
08:53:03 | FromDiscord | <haxscramper> I'm not getting paid shit |
08:53:07 | FromDiscord | <Elegantbeef> Hax loves ambiguity |
08:53:20 | FromDiscord | <Rika> Someone pay hax to complain about the state of Nim |
08:53:29 | FromDiscord | <tandy> i havent seen namiran in the repos much |
08:53:30 | FromDiscord | <haxscramper> Well, I write RFCs |
08:53:37 | FromDiscord | <haxscramper> Neither did i |
08:53:38 | FromDiscord | <Elegantbeef> Why would we pay him for something he does for charity 😛 |
08:53:53 | FromDiscord | <haxscramper> He has been described earlier as a community manager |
08:54:00 | FromDiscord | <Rika> RFCs are just fancy complaints |
08:54:08 | FromDiscord | <haxscramper> Twitter/announcements/website maintenance and so on |
08:54:08 | FromDiscord | <Rika> I’m kidding |
08:54:22 | FromDiscord | <tandy> interesting, yeah i think i remember him tellin us off for offtopic in telegram chat |
08:54:28 | FromDiscord | <haxscramper> But that is true for the most part↵(@Rika) |
08:54:57 | arkanoid | will nim ever takeoff? |
08:55:21 | FromDiscord | <haxscramper> Honestly - not sure |
08:55:37 | FromDiscord | <haxscramper> Not with current level of interest for promotion and driving people in |
08:55:49 | FromDiscord | <haxscramper> The language is good |
08:56:10 | PMunch | I think Nim is on a similar path to Python, a slow but steady incline |
08:56:19 | FromDiscord | <haxscramper> The people who manage it I have some complaints about |
08:56:29 | FromDiscord | <haxscramper> But the underlying idea is very good |
08:56:35 | FromDiscord | <Rika> The incline may be slow but I am not so sure about the steadiness |
08:56:53 | FromDiscord | <haxscramper> See commit pulse for the last year on GitHub |
08:56:59 | FromDiscord | <haxscramper> It looks like it is declining |
08:57:26 | FromDiscord | <haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/902481031989448704/image.png |
08:57:36 | FromDiscord | <Elegantbeef> I just think bug fixes/ promised features need to be realized |
08:58:35 | FromDiscord | <Elegantbeef> Many cases of people leave Nim is due to bugs in the present feature set |
08:59:00 | emery | maybe some of use like nice, quiet, hipster languages |
08:59:40 | FromDiscord | <Rika> I wish there were less bugs but I haven’t encountered much so I’m not that fussed |
08:59:50 | FromDiscord | <xflywind> In reply to @haxscramper "https://forum.nim-lang.org/t/8540#55418The fulltime": precisely was paid in March this year |
09:00:13 | arkanoid | if you would leave nim, but keep working on system programming languages, where would you go today? C? Rust? Zig? Ada? Else? |
09:00:15 | FromDiscord | <Elegantbeef> Well i address the low hanging ones when i see them |
09:00:24 | FromDiscord | <tandy> would araq ever retire or something? |
09:00:44 | FromDiscord | <Elegantbeef> I dont like none of the alternatives really |
09:00:46 | FromDiscord | <haxscramper> I want to try out ada, but would probably go for rust↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
09:00:51 | FromDiscord | <haxscramper> Zig is just too limiting |
09:01:20 | FromDiscord | <Elegantbeef> Nim gives me a bunch of stuff i feel is very nice for gamedev related stuff, the others dont do it as nicely imo |
09:01:27 | FromDiscord | <haxscramper> I like the language that give you options for rocket science reactor-tier complexity in your code |
09:01:39 | FromDiscord | <haxscramper> Cxx goes into this as well |
09:02:21 | arkanoid | I'm scared by Cxx, brainfuck is better in everything |
09:02:40 | FromDiscord | <haxscramper> I don't even know what is going on to be honest with this |
09:03:10 | FromDiscord | <haxscramper> There is literally zero effort to manage community expectations |
09:03:26 | FromDiscord | <haxscramper> like, this is the same discussion v5 IIRC |
09:03:31 | FromDiscord | <haxscramper> I had this rant already multiple times |
09:04:49 | FromDiscord | <haxscramper> so I'm going to spare your time, and summarize my complaints as - The underlying ideas for a language are extremely good, but due to lack of singular direction it feels like we are just rowing in circles without any aim, and I haven't seen any clear push from any of the core developers araq just listed to change this |
09:05:04 | arkanoid | the two things that scare me the most are: antivirus problem on windows, general bus-factor 1 on many important modules |
09:05:38 | FromDiscord | <haxscramper> we are working on half a dozen fantastic features, while having ossified compiler codebase that everyone is too afraid to break because muh `--nimPreviewRandomGarbage` |
09:06:23 | FromDiscord | <haxscramper> that reminds |
09:06:26 | FromDiscord | <haxscramper> (edit) "that reminds ... " added "me" |
09:08:52 | FromDiscord | <haxscramper> In reply to @HuskyHacks "if you want, I": I suppose help like that would really be appreciated, though it could probably be discussed in the #internals channel, because as you can see #main has quite a lot of ongoing discussion, so there is a chance your message would simply go unnoticed |
09:10:00 | FromDiscord | <haxscramper> but damn this is depressing |
09:10:21 | FromDiscord | <haxscramper> this whole advertisement/management thing |
09:11:43 | FromDiscord | <haxscramper> I really want the language to succeed, and I hear all of these "2021 is a year of tooling", "we should focus on bugfixes" (every single commuity survery), "IC is the next big thing", get my hopes up |
09:11:45 | FromDiscord | <haxscramper> and then bam |
09:11:53 | FromDiscord | <haxscramper> 15 new stdlib modules with bus factor of 1 |
09:12:00 | FromDiscord | <haxscramper> more garbage to maintain |
09:13:26 | FromDiscord | <tandy> i cri |
09:13:28 | emery | i think it would be better to push new coders towards nim rather than experienced coders, but thats hard. |
09:13:38 | FromDiscord | <Elegantbeef> Hey setutils is nice! |
09:13:45 | FromDiscord | <haxscramper> yeah, everything is nice |
09:14:09 | FromDiscord | <haxscramper> the question is not whether modules are bad and all |
09:14:12 | FromDiscord | <Elegantbeef> I'm clearly joking cause I started it and added a few procs |
09:14:33 | FromDiscord | <haxscramper> but whether they should be the part of stdlib which increases maintenance burned on the langauge itself |
09:16:48 | supakeen | Some of them are indeed 'interesting'. |
09:17:01 | supakeen | I'm not that fond of things ending up in stdlib that say their API is 'experimental'. |
09:17:25 | FromDiscord | <haxscramper> we had fusion, |
09:17:32 | FromDiscord | <haxscramper> "supposedly" |
09:17:40 | FromDiscord | <haxscramper> except it is dead |
09:18:11 | supakeen | Anyways, you do have a point in that a large stdlib isn't necessarily good and a 'bad' stdlib reflects badly on the language. |
09:18:32 | supakeen | I should look at my old PRs and revive them. |
09:19:18 | supakeen | They got marked by stale-bot recently. |
09:19:34 | supakeen | And I don't know if for example the header handling in the http stdlib things is now correct. |
09:20:07 | supakeen | I kinda went AWOL on this: https://github.com/nim-lang/Nim/pull/15478 :( |
09:33:22 | * | koltrast quit (Ping timeout: 258 seconds) |
09:36:17 | FromDiscord | <Kiloneie> Holy cow. https://media.discordapp.net/attachments/371759389889003532/902490809377652746/unknown.png |
09:36:30 | FromDiscord | <Kiloneie> This one is doing really well. |
09:37:33 | FromDiscord | <Kiloneie> If i recall correctly, my very first Nim video got 200 views after a MONTH. This one is 355 in 18 hours, yay. |
09:37:54 | FromDiscord | <Kiloneie> More interesting topics is the lesson here i believe. |
09:38:20 | supakeen | things more people want/need :) |
09:38:50 | FromDiscord | <Kiloneie> ii mean 169 views on this one, but a high score of my channel either way. |
09:38:52 | * | koltrast joined #nim |
09:39:06 | FromDiscord | <Kiloneie> yeah, i need towrite a new list for this |
09:39:14 | FromDiscord | <dom96> Need more clickbait titles 🙂 |
09:39:15 | FromDiscord | <Rika> What’s the retention? |
09:40:04 | FromDiscord | <Kiloneie> retention as in click trough rate or ? i don't understand D: |
09:40:12 | FromDiscord | <Rika> Watch retention |
09:40:20 | FromDiscord | <Kiloneie> oh , let me see |
09:40:21 | FromDiscord | <Rika> How long each view watches the video for |
09:40:49 | FromDiscord | <Kiloneie> well it says 4:52 min is the average on this one, which is btw huge, but i can get more info. |
09:41:00 | FromDiscord | <Rika> I personally wouldn’t call it a win if 90% of the views only watched like 10% of the video |
09:41:08 | FromDiscord | <Rika> Nice |
09:41:18 | FromDiscord | <Rika> That sounds okay, how long is the video |
09:41:23 | FromDiscord | <Kiloneie> 25 min video |
09:41:31 | FromDiscord | <Rika> Well that sounds good enough yes |
09:42:24 | FromDiscord | <Kiloneie> Heres how the rest of my top videos are doing https://media.discordapp.net/attachments/371759389889003532/902492347810611220/unknown.png |
09:42:41 | FromDiscord | <Kiloneie> For some reason people love Tables |
09:43:28 | FromDiscord | <Rika> I wish I could make videos but I already have my time split over so many projects |
09:43:51 | FromDiscord | <Kiloneie> It is a very time consuming thing to do. |
09:44:29 | FromDiscord | <Rika> I know, I’ve done it before |
09:51:34 | FromDiscord | <Hamid Bluri> In reply to @Kiloneie "It is a very": and when you make a mistake,.... you have to rerecord 😮💨 |
09:52:12 | FromDiscord | <Hamid Bluri> i really want to make library |
09:52:34 | FromDiscord | <Hamid Bluri> to visualize/animate |
09:53:33 | FromDiscord | <Hamid Bluri> algorithms, but it seems quite hard |
09:53:48 | FromDiscord | <Hamid Bluri> (edit) "i really want to make ... library" added "a" |
09:56:04 | FromDiscord | <Hamid Bluri> i continue in `#offtopic` |
09:56:47 | FromDiscord | <Rika> In reply to @hamidb80 "and when you make": Some people make videos with minor mistakes but edit/handle it elegantly |
09:57:52 | FromDiscord | <xflywind> In reply to @haxscramper "so I'm going to": > I haven't seen any clear push from any of the core developers araq just listed to change this↵↵I'm not a core developer. Araq, dom96, timotheecour are core developers. I'm only being a member of Nim organization recently. Actually I worked for Nim for only one month in March. |
09:59:35 | * | tinytoast is now known as tinystoat |
10:03:08 | arkanoid | I have to say that I had that video playing yesterday night and I went sleep with my laptop on, and possibly the cats have been walking and restarting the video all night long |
10:04:02 | FromDiscord | <haxscramper> dom does not write a lot of code and is not paid to work on nim full-time IIRC↵(@xflywind) |
10:04:08 | FromDiscord | <haxscramper> well, "transparency" |
10:07:07 | arkanoid | outside casual/hobby programmers, is the whole language rolling on 1 company and 3 people outside of it? |
10:08:32 | FromDiscord | <xflywind> In reply to @haxscramper "dom does not write": I think core developers mean making great contributions to Nim. And dom maintain nim-lang/nimble |
10:09:54 | FromDiscord | <xflywind> nether did timotheer get paid but he has been contributing to Nim |
10:11:37 | FromDiscord | <xflywind> In reply to @haxscramper "well, "transparency"": you can check the expenses of opencollective |
10:12:13 | FromDiscord | <Kiloneie> sent a long message, see http://ix.io/3CVd |
10:12:31 | PMunch | arkanoid, I use it for work. But I'm the only one at the company who does |
10:13:30 | FromDiscord | <xflywind> In reply to @flywind "you can check the": that should be all of the expenses of non-fulltime work |
10:15:22 | FromDiscord | <haxscramper> I think core developers mean full-time work on nim↵(@xflywind) |
10:15:29 | FromDiscord | <xflywind> In reply to @haxscramper "well, "transparency"": see https://opencollective.com/nim/expenses |
10:15:32 | FromDiscord | <haxscramper> "former core developer" yes, but |
10:24:52 | * | arkurious joined #nim |
10:27:22 | FromDiscord | <xflywind> In reply to @haxscramper "I think core developers": Make sense, but it also depends on how much they are paid |
10:28:03 | FromDiscord | <haxscramper> I don't think we would ever see exact numbers that are not on the opencollective |
10:33:50 | FromDiscord | <qb> Anyone a Idea how I could make `foobar` visible for `testlib` ? `dlsym` keep returning nil https://play.nim-lang.org/#ix=3CVh |
10:33:58 | FromDiscord | <qb> (edit) "keep" => "keeps" |
10:36:07 | FromDiscord | <haxscramper> https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-export |
10:36:32 | PMunch | @qb, you might also want to use the dynlib module |
10:39:20 | PMunch | And you can't pass nil as the handle to dlsym I believe |
10:42:28 | FromDiscord | <qb> Mh not sure if dynlib makes sense. What I'm trying to do is to get a pointer to the foobar function provided by the main function from the library which is load |
10:42:52 | FromDiscord | <qb> (edit) "function" => "process" |
10:45:00 | FromDiscord | <qb> not sure if thats technically even doable |
10:45:24 | PMunch | Should be doable |
10:47:36 | arkanoid | PMunch: I also use it at work, but I'm the only IT man there, so it's just my preference |
10:47:54 | arkanoid | (working great so far) |
10:50:22 | FromDiscord | <qb> In reply to @PMunch "And you can't pass": `If handle is RTLD_DEFAULT, dlsym() searches all objects in the current process, in load-order. ` Guess ` define RTLD_DEFAULT ((void ) 0)` could be translated to `cast[pointer](0)` or just nil? |
10:51:05 | PMunch | Just nil should work there |
10:59:04 | PMunch | Hmm, honestly not sure why this isn't working |
11:01:25 | FromDiscord | <qb> Alright. Was just for testing purposes |
11:02:04 | PMunch | It's definitely possible to get a procedure from the program you're imported into though |
11:02:16 | PMunch | I do that in a DLL/so for work |
11:10:06 | * | kenran quit (Ping timeout: 245 seconds) |
11:15:07 | PMunch | Hmm, so apparently passing --passL:"-Wl,--export-dynamic" to the binary makes it work |
11:17:40 | PMunch | And adding the `dynlib` pragma to the foobar proc |
11:20:54 | FromDiscord | <dom96> In reply to @haxscramper "I think core developers": I don’t think “core developer” should mean “paid full-time developer” |
11:22:54 | FromDiscord | <dom96> In reply to @haxscramper "dom does not write": Can confirm I’m not paid to work on Nim. Neither full-time nor part-time. |
11:24:11 | PMunch | Oh wait, no this doesn't work at all.. |
11:33:25 | FromDiscord | <eyecon> I'm taking a look at `std/streams` |
11:33:39 | FromDiscord | <eyecon> And I'm scratching my head as to how we would detect the end of file |
11:33:51 | FromDiscord | <eyecon> Do we just watch for an `IOError`? |
11:34:24 | FromDiscord | <eyecon> Use case: I'm writing, and will be reading back, a number of `uint32`s, but don't know where they end |
11:34:33 | FromDiscord | <eyecon> So I read until the end of the file into a seq |
11:37:10 | FromDiscord | <eyecon> I read https://forum.nim-lang.org/t/2787 and concluded that it might be an open point, but wanted to ask regardless |
11:38:31 | FromDiscord | <Rika> “at end” function |
11:38:32 | FromDiscord | <Rika> ? |
11:39:31 | * | casionaut joined #nim |
12:00:28 | * | kenran joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:32:23 | * | rockcavera joined #nim |
12:32:23 | * | rockcavera quit (Changing host) |
12:32:23 | * | rockcavera joined #nim |
12:35:24 | Amun-Ra | is there a way of checking if type is distinct? |
12:55:59 | * | Vladar joined #nim |
13:05:52 | FromDiscord | <impbox [ftsf]> I'm sure there is at compile time |
13:06:07 | FromDiscord | <impbox [ftsf]> Using a macro you can inspect the typedef |
13:07:52 | arkanoid | Amun-Ra: https://play.nim-lang.org/#ix=3CW6 |
13:08:14 | arkanoid | please mind that it won't work in play.nim-lang.org as it's a compile time thing |
13:09:35 | FromDiscord | <narimiran> @arkanoid: click on "showing: output", and you can see compile-time stuff too 😉 |
13:11:09 | Amun-Ra | arkanoid: thanks |
13:12:18 | arkanoid | narimiran, thanks for the correction |
13:27:40 | FromDiscord | <demotomohiro> !eval type DInt = distinct int; echo DInt is distinct |
13:27:42 | NimBot | true |
13:30:06 | arkanoid | oh! that's new |
13:30:26 | Amun-Ra | hmm |
13:31:11 | arkanoid | demotomohiro, how did you found out that? |
13:32:12 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#generics-type-classes |
13:33:19 | FromDiscord | <Rika> !eval echo int is distinct |
13:33:19 | FromDiscord | <demotomohiro> I'm just using softweres after reading the manual :) |
13:33:30 | NimBot | false |
13:39:15 | * | rockcavera quit (Remote host closed the connection) |
13:45:27 | arkanoid | demotomohiro, second name rainman? |
13:52:56 | FromDiscord | <forlorn> In reply to @haxscramper "Zig is just too": What in particular did you find limiting |
13:56:46 | FromDiscord | <demotomohiro> You don't need to remember eveythings in manual. If you know how type class works, you can get details of type class in manual just by searching for "type class". |
13:57:05 | FromDiscord | <forlorn> sent a code paste, see https://play.nim-lang.org/#ix=3CWk |
13:58:32 | FromDiscord | <forlorn> (edit) "https://play.nim-lang.org/#ix=3CWk" => "https://play.nim-lang.org/#ix=3CWl" |
14:08:20 | FromDiscord | <haxscramper> `int | float` is a compile-time thing. `union(int | float)` is a runtime thing |
14:08:40 | FromDiscord | <haxscramper> not really useful in procedure arguments, but if you want to return different types based on some runtime logic this is the only solution |
14:12:33 | FromDiscord | <IsaacPaul> Well I'm nitpicking, but it's not the _only_ solution lol |
14:21:13 | FromDiscord | <haxscramper> yes, you can create variant object of course |
14:22:45 | arkanoid | never used union objects before, when should I use them? |
14:25:08 | FromDiscord | <IsaacPaul> On the readme for alaviss/union the use case was a making a value an optional (value vs None). If it supports it I'd see it being used to return union(result | error). |
14:27:52 | FromDiscord | <Rika> bet they are |
14:33:01 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3CWu |
14:33:52 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3CWv |
14:34:04 | FromDiscord | <IsaacPaul> really.. I should have just tried it then xD |
14:34:07 | FromDiscord | <IsaacPaul> (edit) "https://play.nim-lang.org/#ix=3CWu" => "https://paste.rs/Smh" |
14:34:40 | FromDiscord | <Gumber> the `importcpp` section of the manual holds all sorts of useful tips for learning how to make `importcpp` your biatch |
14:34:57 | FromDiscord | <Gumber> it's the only way you'll interop with C++ |
14:35:15 | FromDiscord | <Gumber> is learning how to emit the correct C++ with it and `emit` |
14:35:21 | FromDiscord | <Gumber> and sometimes it's a real PITA |
14:35:40 | FromDiscord | <demotomohiro> Nim standard library has `option` module that can represent (value | none). |
14:35:51 | FromDiscord | <Gumber> and sometimes you just have no choice - like in the case of virtual classes / interfaces |
14:35:58 | FromDiscord | <Gumber> where you need to supply an implementation in userland |
14:36:07 | FromDiscord | <Gumber> you'll be stuck using `emit` |
14:36:24 | FromDiscord | <Gumber> or writing some C++ implementation and compiling it in your Nim code |
14:37:00 | FromDiscord | <Gumber> (edit) "userland" => "user land" |
14:37:34 | FromDiscord | <IsaacPaul> ah ok I skimmed over the importcc section. Reading it more thoroughly will help. |
14:37:52 | FromDiscord | <IsaacPaul> Just hate reading. I like doing lol |
14:41:32 | FromDiscord | <IsaacPaul> @Gumber Do you know any open source code that uses importcc for an interface that I can take a look at? |
14:41:41 | FromDiscord | <IsaacPaul> off the top of your head |
14:44:20 | FromDiscord | <demotomohiro> In Nim, unlike C/C++, you cannot do `a = b = c` to copy variable c to a anc b. Making `=` operator returns anything is not a Nim way. Because when you write `foo(a = b):` while you actually need to write `foo(a == b)`, compiler might not report error. |
14:45:15 | FromDiscord | <Rika> i assume the double equals was only done because he couldnt do `x := y` like he wanted |
14:46:19 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3CWC |
14:46:29 | FromDiscord | <Gumber> In reply to @IsaacPaul "<@!204328759715692544> Do you": well I can share some of my code I use `importcpp` a lot |
14:46:50 | FromDiscord | <Gumber> I'll throw up my code later today on github but for now I can share a module |
14:47:28 | FromDiscord | <IsaacPaul> Awesome, I usually learn a lot more reading code over docs 😅 |
14:47:30 | FromDiscord | <Gumber> here - I was wrapping steamworks with this from valve |
14:47:51 | FromDiscord | <Gumber> https://gist.github.com/zacharycarter/cb259acbde43effaae9c0d26fda5dab3 |
14:48:22 | FromDiscord | <Gumber> they're not complete but what is there works |
14:48:31 | FromDiscord | <Gumber> so what is there is correct in other words 🙂 |
14:48:57 | FromDiscord | <Gumber> only thing that COULD be missing is some `bycopy` pragmas but I've never had issues omitting those - even with the C++ backend |
14:50:23 | FromDiscord | <IsaacPaul> ah ok cool. I see what you did to handle callbacks awesome ya this helpful. |
14:50:26 | FromDiscord | <IsaacPaul> (edit) "ah ok cool. I see what you did to handle callbacks awesome ya this ... helpful." added "is" |
14:54:48 | * | kenran quit (Quit: WeeChat info:version) |
15:29:52 | * | casionaut quit (Remote host closed the connection) |
15:39:45 | * | Guest65 joined #nim |
15:43:58 | * | Guest65 quit (Quit: Client closed) |
15:50:22 | FromDiscord | <xflywind> https://www.reddit.com/r/programming/comments/qg2srd/nim_receives_100k_in_bitcoin_donations/ |
15:51:42 | FromDiscord | <dom96> oh cool |
16:12:56 | NimEventer | New thread by Pumpus: NIM IDE, see https://forum.nim-lang.org/t/8547 |
16:14:35 | nrds | <Prestige99> Wasn't there a post exactly like this a few days ago/last week? |
16:19:18 | FromDiscord | <demotomohiro> This one? |
16:19:19 | FromDiscord | <demotomohiro> https://forum.nim-lang.org/t/8515 |
16:19:47 | * | rockcavera joined #nim |
16:19:47 | * | rockcavera quit (Changing host) |
16:19:47 | * | rockcavera joined #nim |
16:20:05 | nrds | <Prestige99> Yep |
16:23:10 | * | PMunch quit (Ping timeout: 260 seconds) |
16:25:05 | FromDiscord | <haxscramper> NIM SHOULD NOT BE WRITTEN AS NIM incoming |
16:29:11 | FromDiscord | <dom96> Aporia 🪦 |
16:31:17 | nrds | <Prestige99> no mention of moe? |
16:31:34 | FromDiscord | <IsaacPaul> I don't know if it's just me, but I can seem to get the nimsaem nim plugin to highlight syntax errors. Following symbols and autocomplete works tho |
16:34:54 | FromDiscord | <Rika> moe isnt really an ide |
16:37:28 | nrds | <Prestige99> what is it? |
16:38:23 | FromDiscord | <Rika> isnt it more like a regular traditional editor |
16:40:54 | * | vicfred joined #nim |
17:04:34 | * | PMunch joined #nim |
17:10:35 | * | PMunch quit (Ping timeout: 264 seconds) |
17:12:04 | * | PMunch joined #nim |
17:35:08 | * | neurocyte0132889 joined #nim |
17:35:08 | * | neurocyte0132889 quit (Changing host) |
17:35:08 | * | neurocyte0132889 joined #nim |
17:45:19 | FromDiscord | <dom96> wow, moe is so cool |
17:45:58 | FromDiscord | <dom96> I especially like how the number 1 feature on its website is "Written in Nim" :nim1: |
18:11:20 | NimEventer | New thread by V3ss0n: Great to see Nim popularity rising , Top post of /r/programming on reddit now., see https://forum.nim-lang.org/t/8548 |
18:17:49 | FromDiscord | <Yardanico> From that thread: apparently https://store.steampowered.com/app/1444480 is made with Godot and Nim |
18:18:03 | FromDiscord | <Yardanico> Will need to manually verify then add to the list :P |
18:20:56 | FromDiscord | <Yardanico> https://steamcommunity.com/app/1444480/discussions/0/2952663522496620840/ |
18:21:17 | FromDiscord | <Yardanico> "strutils.nim(1115) parseInt↵Error: unhandled exception: invalid integer: [ValueError]" so at least some of it is Nim for sure :) |
18:44:46 | FromDiscord | <jos> are there any |
18:44:50 | FromDiscord | <jos> large open source nim projects |
18:45:08 | FromDiscord | <jos> preferably with some users |
18:46:34 | FromDiscord | <Yardanico> nitter |
18:46:35 | FromDiscord | <Yardanico> nim |
18:47:32 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
18:47:47 | mst | huh, had never occurred to me that's why nitter was called that |
18:53:48 | * | neurocyte0132889 joined #nim |
18:53:48 | * | neurocyte0132889 quit (Changing host) |
18:53:48 | * | neurocyte0132889 joined #nim |
19:01:14 | FromDiscord | <reilly> Compiling something for a Raspberry Pi using a custom build script, and getting this error I've never seen before: `/usr/bin/ld: /home/pi/Desktop/nanolab-gui/gui/.nimcache/stdlib_unicode.nim.cpp.o: file not recognized: file truncated` |
19:04:02 | FromDiscord | <reilly> Deleting the `.nimcache` folder did the trick. A build must have gotten interrupted earlier and I didn't know it... |
19:04:25 | FromDiscord | <IsaacPaul> yea I was going to say it seems like the linking couldn't finish parsing the object file |
19:13:10 | FromDiscord | <demotomohiro> Maybe the sdcard your Raspberry PI using is going to die. |
19:14:33 | FromDiscord | <demotomohiro> I heard using sdcard with Raspberry PI doesn't last long time and I lost a sdcard used with raspberry PI 3. |
19:16:14 | FromDiscord | <reilly> I can worry about a dying SD card later, right now I'm wonder why `glfwCreateWindow()` isn't working on the RPi. |
19:17:28 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3CYX |
19:23:59 | FromDiscord | <reilly> Well, I half-solved it. It's still failing to create the window, but instead of failing inside of `glfwCreateWindow()`, it's failing in my own assertion instead. The window is always nil but I don't know why. |
19:30:32 | FromDiscord | <Goel> Wasn't 1.6 going to change the `gc` of Nim to `arc`/`orc` by default? I see the default is still `refc` |
19:32:19 | FromDiscord | <demotomohiro> You are trying to create a window with OpenGL version that is not supported by raspberry pi? |
19:34:43 | FromDiscord | <deech> How do I check to see if the current backend is `cpp` inside a macro? |
19:35:14 | FromDiscord | <Elegantbeef> `when defined(cpp)` |
19:35:36 | FromDiscord | <Elegantbeef> or just `let isCpp = defined(cpp)` |
19:36:08 | FromDiscord | <deech> Duh! Thanks! |
19:36:26 | FromDiscord | <Elegantbeef> No problem, and forgot to say good talk on tuples 😛 |
19:37:46 | FromDiscord | <deech> Thanks! |
19:38:14 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3CZ4 |
19:38:39 | FromDiscord | <reilly> Now I'm worried that NimGL just doesn't support older OpenGL versions... |
19:40:04 | FromDiscord | <Elegantbeef> That's the gflw version no? |
19:41:02 | FromDiscord | <demotomohiro> NimGL just wrap GLFW for Nim. It should support any OpenGL version GLFW supports. |
19:41:47 | FromDiscord | <reilly> "NimGL only supports modern OpenGL." - the readme |
19:42:32 | FromDiscord | <reilly> In reply to @Elegantbeef "That's the gflw version": As far as I can tell, that is how you specify your OpenGL version. |
19:43:41 | FromDiscord | <reilly> I actually hadn't tried it on the RPi without using the `GLFWOpenglProfile` hint until a minute ago, and that actually does initialize the window properly. |
19:44:38 | FromDiscord | <reilly> The problem now is that it "failed to compile vertex shader," telling me that GLSL 3.30 is not supported and that only 1.10, 1.20, 1.00 ES, and 3.00 ES are. |
19:51:25 | FromDiscord | <Gumber> moden opengl meaning anything not legacy opengl |
19:51:33 | FromDiscord | <Gumber> 2.1 is still modern opengl |
19:51:48 | FromDiscord | <Gumber> you should probably be using GLES if you want to write OpenGL for a raspberry Pi |
19:53:10 | FromDiscord | <Gumber> sent a code paste, see https://paste.rs/QEl |
19:53:35 | FromDiscord | <Gumber> you need to specify the version of GLSL you're shaders should be compiled against in the shaders themeslves |
19:53:45 | FromDiscord | <Gumber> it has nothing to do with the version of the OpenGL graphics context you created |
19:53:58 | FromDiscord | <Gumber> (edit) "you're" => "your" |
19:54:01 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3CZ9 |
19:54:13 | FromDiscord | <Gumber> yeah this has nothing to do with GLFW honestly |
19:54:21 | FromDiscord | <Gumber> its user error / not knowing enough about OpenGL |
19:54:28 | FromDiscord | <Gumber> (edit) "yeah this has nothing to do with GLFW honestly ... " added "or Nim or NimGL" |
19:54:50 | FromDiscord | <Gumber> (edit) "its user error / not knowing enough about OpenGL ... " added "& GLSL" |
20:12:36 | FromDiscord | <Alea> so you can use unicode operators↵has anyone ever implemented APL in nim? |
20:15:32 | FromDiscord | <Elegantbeef> You can use a limited selection of unicode operators |
20:18:49 | FromDiscord | <haxscramper> you can use any unicode if you are wiling to deal with the resulting AST |
20:19:20 | FromDiscord | <haxscramper> `ф у н к ц и я(12 ∈ 123)` is technically valid IIRC |
20:20:02 | FromDiscord | <haxscramper> https://wandbox.org/permlink/o6heAvejNox2xKAP |
20:20:03 | FromDiscord | <haxscramper> yes |
20:20:22 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#lexical-analysis-unicode-operators |
20:21:37 | FromDiscord | <haxscramper> tbh we should've enabled this from the start |
20:21:42 | FromDiscord | <haxscramper> nobody uses these operators anyway |
20:22:55 | FromDiscord | <haxscramper> if you want some traditional APL you might also write things in a single operators and then split them |
20:23:07 | FromDiscord | <haxscramper> Like `#$%^&I(` and then iterate over runes |
20:59:31 | nrds | <Prestige99> Is there a preferred way to handle having a ref and non-ref version of the same type? |
20:59:43 | nrds | <Prestige99> I guess a standard |
21:01:02 | * | Vladar quit (Quit: Leaving) |
21:08:06 | FromDiscord | <haxscramper> define regular type as object and the do `A = ref B`. If you plan to use ref more often then name original object like `NimNodeObj` and ref version should be named `NimNode` |
21:08:22 | FromDiscord | <haxscramper> IIRC this is a recommended way/style to deal with this |
21:08:48 | nrds | <Prestige99> Cool, thanks |
22:12:14 | FromDiscord | <lenis> Is there any way to wrap c functions and trace the pointers that it returns?↵Say it returns a struct type with pointers to other strucs, anyone know if you can convert those to refs? |
22:17:01 | FromDiscord | <Elegantbeef> you cannot convert to refs without making refs and setting the internals |
22:17:23 | FromDiscord | <Gumber> is that true? |
22:17:42 | FromDiscord | <Elegantbeef> Well safely |
22:17:52 | FromDiscord | <Elegantbeef> You can cast to a ref all day long but it's not going to be properly managed |
22:18:07 | FromDiscord | <Gumber> well no I don't mean cast to it |
22:18:18 | FromDiscord | <Gumber> oh you want to convert it to a ref I see |
22:18:46 | FromDiscord | <Gumber> yes that'd be trickier |
22:19:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3CZO |
22:19:30 | FromDiscord | <Elegantbeef> Assuming theStruct is a `ptr T` and `YourRefType` is `ref T` |
22:20:36 | FromDiscord | <Gumber> but yeah there are obvious dragons lurking here |
22:20:46 | FromDiscord | <Gumber> depending on what you're doing across the interop boundary |
22:21:24 | FromDiscord | <Elegantbeef> Yea as always using a ref -\> C is dangerous if you dont know what it's doing with the ref |
22:21:45 | FromDiscord | <Elegantbeef> But if you're staying in Nim land this is a safe solution assuming you want to use C to create some stuff then use it in Nim as a Nim type |
22:22:00 | FromDiscord | <Gumber> well maybe it's safe |
22:22:21 | FromDiscord | <Gumber> unless Nim collects the memory and then C tries to access it later |
22:22:36 | FromDiscord | <Gumber> or whatever other weird stuff could happen |
22:22:50 | FromDiscord | <Gumber> you really need to know what your C code is doing |
22:22:54 | FromDiscord | <Elegantbeef> Well i was saying C had no interaction with the output C |
22:23:02 | FromDiscord | <Elegantbeef> output C struct |
22:23:15 | FromDiscord | <Elegantbeef> Of course if it's interacting/expecting it to be there later it's dangerous |
22:23:16 | FromDiscord | <Gumber> I assume C is calling into Nim here or Nim is calling into C and C is returning something to Nim |
22:23:20 | FromDiscord | <Gumber> yeah |
22:23:28 | FromDiscord | <Gumber> just need to be aware of what you're doing is the message I think |
22:23:34 | FromDiscord | <Elegantbeef> It's really a question of what is the C code doing and in the C struct/ what you're doing 😛 |
22:23:38 | FromDiscord | <lenis> in this case im calling a C function which returns data that I then use in nim, never returning to the C library |
22:23:50 | FromDiscord | <Gumber> then you're fine |
22:23:52 | FromDiscord | <Elegantbeef> Well then yes my example will work if C never expects data to persist |
22:24:02 | FromDiscord | <lenis> but would that work if YourRefType has pointers inside of it |
22:24:23 | FromDiscord | <Gumber> those would all need to get boxed |
22:24:26 | FromDiscord | <Elegantbeef> It'd work but you'd need to add a destructor hook to manage those pointers for you |
22:24:29 | FromDiscord | <lenis> type YourRefType = object↵ prop: string↵ otherRefType: ptr MyOtherType |
22:24:33 | FromDiscord | <Elegantbeef> Or box those |
22:24:34 | FromDiscord | <Gumber> well they wouldn't be managed by the GC |
22:24:37 | FromDiscord | <Gumber> unless you box them as well |
22:25:00 | FromDiscord | <Elegantbeef> Well the destructor for the `YourRefType` could though afaik |
22:25:05 | FromDiscord | <Gumber> yeah |
22:25:12 | FromDiscord | <Gumber> well you can't create destructors for ref types |
22:25:32 | FromDiscord | <Gumber> only objects |
22:26:10 | FromDiscord | <Gumber> if you want the pointers to be traced GC references you need to create refs for the objects |
22:26:13 | FromDiscord | <lenis> I actually tried defining a destructor but i got an error saying a destructor was already implicitly defined |
22:26:17 | FromDiscord | <Gumber> as far down the hierarchy as you want to go |
22:26:39 | FromDiscord | <Gumber> the GC will then clean up the underlying memory when it goes out of scope |
22:26:53 | FromDiscord | <Gumber> you could create a destructor for your `object` that wraps your C struct |
22:26:58 | FromDiscord | <Gumber> and then create a ref type from that |
22:26:59 | FromDiscord | <lenis> `var yourRef: YourRefType` implicitly defined a destructor i think |
22:27:04 | FromDiscord | <Gumber> and clean up the pointers in the object's custom destructor |
22:27:10 | FromDiscord | <Gumber> yeah - you can define custom destructors for ref types |
22:27:13 | FromDiscord | <Gumber> but you can do: |
22:27:32 | FromDiscord | <Elegantbeef> I always forget destructor rules |
22:27:37 | FromDiscord | <Elegantbeef> Cant distincts get destructors? |
22:28:07 | FromDiscord | <Yardanico> In reply to @lenis "I actually tried defining": That is usually a problem when you use the type before it's defined |
22:28:08 | FromDiscord | <Gumber> and then handle whatever there |
22:28:10 | FromDiscord | <Gumber> sent a code paste, see https://paste.rs/NBD |
22:28:25 | FromDiscord | <Gumber> oh and yes you need to define the destructor before you reference the type anywhere else |
22:28:42 | FromDiscord | <Yardanico> (edit) "it's" => "the destructor is" |
22:30:23 | * | arkurious quit (Quit: Leaving) |
22:34:23 | FromDiscord | <lenis> In reply to @Yardanico "That is usually a": Thanks, that fixed it |
22:34:26 | FromDiscord | <lenis> I should have known lol |
22:35:09 | FromDiscord | <lenis> ok, i think i have it working, even though its a bit janky. I had to include a pointer to itself to pass back to the C function to free the raw pointer |
22:35:15 | FromDiscord | <lenis> because the ref creates a new pointer |
22:35:23 | FromDiscord | <lenis> but I think its working, thanks guys 🙂 |
22:48:22 | FromDiscord | <resumin> sent a long message, see http://ix.io/3CZU |
22:53:47 | FromDiscord | <Elegantbeef> If you make the gen a macro you invoke you can, but otherwise you cannot, might be able to use a generic instead for this though somewhat boilerplatey |
22:56:10 | FromDiscord | <resumin> Ok, thanks. I don't think the enum and array will need extended on a normal basis, so it seems reasonable to use what I currently doing and splitting it up. |
22:59:36 | FromDiscord | <Elegantbeef> Like this would work https://play.nim-lang.org/#ix=3CZX |
22:59:54 | FromDiscord | <Elegantbeef> I guess the concept should add `E is enum` |
23:01:17 | FromDiscord | <Elegantbeef> It's of course not extendable across module boundaries but it's a simpler more concrete solution |
23:03:03 | FromDiscord | <resumin> That's pretty cool. I haven't made use of concepts.↵↵I have an enum that identifies operating systems and cpus and corresponding arrays that hold detailed information for enum value. I'll push it to a repo. just a moment |
23:14:45 | FromDiscord | <resumin> https://github.com/quantimnot/platforms |
23:47:52 | FromDiscord | <Elegantbeef> [resumin](https://matrix.to/#/@resumin:matrix.org)\: so yea you could make an `implOS` macro which emits the code you need, similar to what i do with nimscripter here https://github.com/beef331/nimscripter/blob/bigrewrite/src/nimscripter/expose.nim#L292 |
23:54:51 | FromDiscord | <lenis> sent a code paste, see https://play.nim-lang.org/#ix=3D09 |
23:55:56 | FromDiscord | <Elegantbeef> wait until you leanr of `ptr UncheckedArray[int](p)[i]` 😀 |
23:56:19 | FromDiscord | <lenis> aw man i knew there had to be an easier solution |
23:56:30 | FromDiscord | <lenis> thanks |
23:56:55 | FromDiscord | <Elegantbeef> You can also do `for x in cast[ptr UncheckedArray[T]](p).toOpenArray(0, count - 1)` |
23:58:31 | FromDiscord | <lenis> does that account for the size of each element? |
23:58:53 | FromDiscord | <Elegantbeef> Well elements are considered `sizeof(T)` |
23:58:56 | FromDiscord | <lenis> oh yeah it should |
23:59:05 | FromDiscord | <lenis> yeah cool, thanks |
23:59:26 | FromDiscord | <Elegantbeef> Though sadly that's a read only openArray |
23:59:56 | FromDiscord | <lenis> yeah thats fine |