00:00:24 | FromDiscord | <MaksimBoyarkin> By the way, how are things with coroutines in Him? |
00:00:59 | FromDiscord | <MaksimBoyarkin> (edit) "Him?" => "Nim?" |
00:04:07 | NimEventer | New thread by Alexeypetrushin: Auto-free C pointer when Nim object gets GC, see https://forum.nim-lang.org/t/8470 |
00:20:27 | FromDiscord | <exelotl> sent a long message, see http://ix.io/3AmV |
00:23:30 | FromDiscord | <exelotl> personally I'm using Nimcoro because it's the only one that's possible to use with --gc:none |
00:23:52 | FromDiscord | <exelotl> (if you modify it to use a preallocated area of memory for the stack) |
00:24:06 | FromDiscord | <exelotl> but if that wasn't a consideration I'd probably try closure iterators first |
00:27:17 | FromDiscord | <MaksimBoyarkin> In reply to @exelotl "you have a few": thx |
01:20:10 | FromDiscord | <Gumber> more than that! |
01:20:18 | FromDiscord | <Gumber> don't forget about fibers / context switching 🙂 |
01:20:25 | FromDiscord | <Gumber> they'll require dropping down to asm though |
01:20:50 | FromDiscord | <Gumber> but I actually already have an implementation of a job system using fibers and system threads |
01:21:13 | FromDiscord | <Gumber> but I think closure iterators might be a bit easier to get a handle on |
01:31:54 | * | vicfred joined #nim |
02:16:55 | * | arkurious quit (Quit: Leaving) |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:08:34 | * | rockcavera quit (Read error: Connection reset by peer) |
04:09:36 | * | rockcavera joined #nim |
04:09:36 | * | rockcavera quit (Changing host) |
04:09:36 | * | rockcavera joined #nim |
04:35:41 | * | Guest71 joined #nim |
04:36:49 | Guest71 | Hello everyone. I have a naive question about the seq. Is it possible to case its type? Like: (float)mySeq |
04:37:12 | Guest71 | I need to convert a float seq into complex seq. |
04:37:25 | Guest71 | Thanks in advance. |
04:40:36 | FromDiscord | <Elegantbeef> You can make a conversion procedure, or just use `sequtils.map`/`sugar.collect` |
04:42:27 | Guest71 | Thank you. I will look at the sequtils.map |
04:42:43 | * | Guest71 quit (Quit: Client closed) |
04:47:39 | FromDiscord | <cabboose> Sounds like you want the procedure to hold different types? |
04:47:41 | * | rockcavera quit (Remote host closed the connection) |
04:47:56 | FromDiscord | <Elegantbeef> Sounded more like they want to convert the elements to a different type |
04:48:08 | FromDiscord | <Elegantbeef> 'e' is near \`'t' case -\> cast |
04:48:17 | FromDiscord | <cabboose> Hahahahaha ofc |
04:48:48 | FromDiscord | <cabboose> When did you become a typo linguist you dastardly devil |
04:48:49 | FromDiscord | <Elegantbeef> I fuck up a lot |
05:09:14 | FromDiscord | <Yandong Zhang> [cabboose](https://matrix.to/#/@cabboose:matrix.org)\: [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org) Want to convert the real number seq into the complex seq and use the FFT. The sequtils.map works well. Thanks again. |
05:09:40 | FromDiscord | <Yandong Zhang> I just tried. |
05:53:13 | NimEventer | New Nimble package! hottie - Sampling profiler that finds hot paths in your code., see https://github.com/treeform/hottie |
05:53:16 | nrds | <R2D299> itHub: 7"Sampling profiler that finds hot paths in your code." |
05:57:52 | FromDiscord | <impbox [ftsf]> hot |
05:57:59 | FromDiscord | <Elegantbeef> tie |
06:05:14 | NimEventer | New Nimble package! shady - Nim to GPU shader language compiler and supporting utilities., see https://github.com/treeform/shady |
06:05:16 | nrds | <R2D299> itHub: 7"Nim to GPU shader language compiler and supporting utilities." |
06:08:38 | FromDiscord | <NullCode> Where can i learn intermediate/ advanced nim stuff |
06:08:47 | FromDiscord | <NullCode> I'm pretty sure i have the basics covered |
06:09:56 | FromDiscord | <impbox [ftsf]> have you read the book? |
06:10:06 | FromDiscord | <impbox [ftsf]> it's good |
06:11:08 | FromDiscord | <Elegantbeef> Wait impbox can read?! |
06:11:45 | FromDiscord | <impbox [ftsf]> (i assume it's good) |
06:12:19 | FromDiscord | <impbox [ftsf]> other than the book, i learn the advanced stuff from @ElegantBeef's play links |
06:12:39 | FromDiscord | <Elegantbeef> I really should make a more official source of information |
06:12:56 | FromDiscord | <Elegantbeef> Some annoying asshat in realtime chats isnt the best |
06:13:18 | FromDiscord | <Rika> In reply to @impbox "other than the book,": From what I’ve read they’re not that advanced yet |
06:15:05 | FromDiscord | <Elegantbeef> An authoritative annoying asshat's written tutorials in a blog style post seems better |
06:15:16 | FromDiscord | <NullCode> In reply to @impbox "have you read the": Nim basics pdf thingy? Yes |
06:15:19 | FromDiscord | <NullCode> I forgot exact name tho |
06:15:21 | FromDiscord | <impbox [ftsf]> Nim in Action |
06:15:27 | FromDiscord | <impbox [ftsf]> https://livebook.manning.com/book/nim-in-action/ |
06:15:29 | FromDiscord | <NullCode> In reply to @impbox "Nim in Action": Can you link it |
06:15:45 | FromDiscord | <NullCode> Ok no i haven't read this |
06:16:12 | nrds | <Prestige99> Elegantbeef has a nice post about marcos on dev.to |
06:16:40 | FromDiscord | <Elegantbeef> nah the post about marcos is on 50shadesofmarcos.com |
06:16:46 | FromDiscord | <Elegantbeef> The macro post is on dev.to indeed |
06:17:35 | FromDiscord | <impbox [ftsf]> https://dev.to/beef331/demystification-of-macros-in-nim-13n8 looks to be it |
06:18:06 | FromDiscord | <Elegantbeef> Been meaning to make a more advanced macro explanation |
06:18:34 | FromDiscord | <Elegantbeef> Maybe will do if i get nimscripters interop not poop anymore |
06:19:49 | FromDiscord | <cabboose> What are you trying to learn↵(@NullCode) |
06:20:16 | FromDiscord | <cabboose> The book isn’t the best for advanced IMO (I have read it)↵(@impbox [ftsf]) |
06:20:29 | FromDiscord | <cabboose> Very good to start off |
06:20:35 | FromDiscord | <Elegantbeef> Impbox was joking about not reading it |
06:20:53 | FromDiscord | <Elegantbeef> atleast i hope so |
06:20:59 | FromDiscord | <impbox [ftsf]> The metaprogramming section is good |
06:21:13 | FromDiscord | <Elegantbeef> I know i havent read it cause i'm too cool for books |
06:21:25 | FromDiscord | <cabboose> Holy shit beef does blogs |
06:21:25 | FromDiscord | <cabboose> I will consume them |
06:21:32 | FromDiscord | <Elegantbeef> I do blog() |
06:21:34 | FromDiscord | <impbox [ftsf]> the blogs or beef? |
06:21:46 | FromDiscord | <cabboose> Both |
06:22:20 | FromDiscord | <cabboose> You might be right; it was beyond me when I started but I didn’t have a very good computer science background to understand it↵(@impbox [ftsf]) |
06:22:44 | * | max22- joined #nim |
06:22:58 | FromDiscord | <cabboose> The whole node structure and what not makes more sense now; but initially I was just thinking “wot” |
06:23:01 | FromDiscord | <cabboose> “I write words” |
06:23:04 | FromDiscord | <Elegantbeef> Also impbox have you got nico to work with 1.6 yet? |
06:23:07 | FromDiscord | <cabboose> “What are nodes” |
06:23:34 | FromDiscord | <impbox [ftsf]> @ElegantBeef nah i haven't got 1.6 to install yet |
06:23:44 | FromDiscord | <Elegantbeef> Ah me either |
06:23:52 | FromDiscord | <Elegantbeef> Cannot be arsed to do a work around on it either |
06:24:15 | FromDiscord | <impbox [ftsf]> onboarding for nim is a big problem |
06:24:22 | FromDiscord | <Elegantbeef> Just curious cause I wanted to try embedding nimscript + nico + wasm |
06:24:34 | FromDiscord | <impbox [ftsf]> maybe i'll try and get it working this weekend |
06:24:43 | FromDiscord | <impbox [ftsf]> currently working 5 days though so i'm le tired |
06:24:52 | FromDiscord | <impbox [ftsf]> so much for quitting my job |
06:25:02 | FromDiscord | <Elegantbeef> Yea i mean i still have to finish the interop again, so it's no big deal |
06:25:51 | FromDiscord | <impbox [ftsf]> In reply to @cabboose "The whole node structure": yeah i kinda skimmed it first time, but going back to it with a focus on learning metaprogramming it's good |
06:26:01 | FromDiscord | <cabboose> Is there an operation to get a binary with X number of bits set to 1? |
06:26:04 | FromDiscord | <impbox [ftsf]> helps if you have a goal in mind |
06:26:10 | FromDiscord | <impbox [ftsf]> learning without a goal is hard |
06:26:26 | FromDiscord | <Elegantbeef> are you on 1.5.1+ cabb? |
06:26:35 | FromDiscord | <cabboose> This↵(@impbox [ftsf]) |
06:27:12 | FromDiscord | <cabboose> Yeah |
06:27:13 | FromDiscord | <cabboose> bleeding edge dude |
06:27:19 | FromDiscord | <Elegantbeef> Ah then i might have something |
06:27:30 | FromDiscord | <impbox [ftsf]> @cabboose `((1 shl 5) - 1)` |
06:27:34 | FromDiscord | <impbox [ftsf]> (edit) "5)" => "x)" |
06:27:57 | FromDiscord | <cabboose> Oooo ofc |
06:28:06 | FromDiscord | <impbox [ftsf]> https://media.discordapp.net/attachments/371759389889003532/893021368646529024/unknown.png |
06:28:11 | FromDiscord | <cabboose> Thank you; so obvious in hindsight lmao |
06:28:40 | FromDiscord | <impbox [ftsf]> i always get shl/shr mixed up because i get left and right mixed up |
06:29:12 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3AnL |
06:29:28 | FromDiscord | <Elegantbeef> `echo` and `toBin` are just for showcase |
06:29:31 | FromDiscord | <cabboose> So verbose |
06:29:44 | FromDiscord | <impbox [ftsf]> complementary! |
06:29:58 | FromDiscord | <Elegantbeef> I mean it's not that verbose |
06:29:59 | FromDiscord | <cabboose> Fair |
06:30:06 | FromDiscord | <impbox [ftsf]> you can also just type them in as literals `0b01111` |
06:30:26 | FromDiscord | <cabboose> Yeah but it’s supposed to get the mask based on a constant |
06:31:06 | FromDiscord | <cabboose> The -1 IMO is pretty explicit |
06:31:20 | FromDiscord | <impbox [ftsf]> a bit offensive |
06:31:26 | FromDiscord | <cabboose> I didn’t think of it before but it’s the one I’ll go for |
06:31:34 | FromDiscord | <Elegantbeef> Shame! |
06:31:50 | FromDiscord | <Elegantbeef> Mine uses the new setutils! |
06:31:54 | FromDiscord | <Elegantbeef> It's clearly cooler |
06:31:54 | FromDiscord | <cabboose> Mate that’s the one you put |
06:32:23 | FromDiscord | <cabboose> I am a simple brained person beef |
06:32:40 | FromDiscord | <cabboose> Forgive me |
06:32:41 | FromDiscord | <cabboose> \:’) |
06:32:57 | FromDiscord | <Elegantbeef> I mean i forgot how i implemented complement so... 😛 |
06:33:18 | FromDiscord | <cabboose> Peas in a pod |
06:33:42 | FromDiscord | <Elegantbeef> ah it's just internally `{0..11}` |
06:33:53 | * | jjido joined #nim |
06:34:11 | * | jjido quit (Client Quit) |
06:34:13 | FromDiscord | <cabboose> That does look nice 👀 |
06:34:46 | FromDiscord | <Elegantbeef> Well sadly it's not that simple though since there is no type annotation |
06:35:11 | FromDiscord | <cabboose> But lower bit ops are more language agnostic |
06:44:10 | FromDiscord | <impbox [ftsf]> i think they're a bit op |
06:51:56 | * | PMunch joined #nim |
06:57:49 | FromDiscord | <Elegantbeef> Lol spent so much time trying to figure out why this wasnt working, turns out some asshat accidently did `[T: object or tuple]` |
06:58:01 | * | jjido joined #nim |
06:58:11 | FromDiscord | <treeform> who was the asshat? |
06:58:24 | FromDiscord | <Elegantbeef> I'd prefer not to self incriminate |
06:59:34 | FromDiscord | <impbox [ftsf]> is it because this is deprecated? |
07:01:03 | FromDiscord | <Elegantbeef> Nah it's just cause i thought it'd work but was making it go throw a macro which destroyed it |
07:01:18 | FromDiscord | <Elegantbeef> But now have the nimscript -\> nim rewrite done |
07:01:39 | FromDiscord | <impbox [ftsf]> \o/ |
07:02:43 | FromDiscord | <Elegantbeef> Got to get the otherside done again then clean up and get to play with a better done version of nimscripter |
07:03:34 | FromDiscord | <Elegantbeef> All of this presently works |
07:03:36 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/893030299171172362/image.png |
07:06:10 | FromDiscord | <impbox [ftsf]> what does the "test" argument do? |
07:06:22 | FromDiscord | <Elegantbeef> "module" it's implemented in |
07:07:11 | FromDiscord | <Elegantbeef> Makes sense for if you want a bunch of different interpreters for different things |
07:07:29 | FromDiscord | <Elegantbeef> May eventually be added to a faux module with that name aswell since i believe that's possible |
07:07:40 | FromDiscord | <Elegantbeef> So you'd do `import test` inside the nimscript |
07:08:09 | FromDiscord | <impbox [ftsf]> cool |
07:08:10 | FromDiscord | <Elegantbeef> Presently it's just to hold specific functions so you can do `implNimScriptModule(test)` and get all the functions it holds |
07:10:00 | FromDiscord | <Elegantbeef> Heavily using the macro cache to elevate some issues i had with the previous method, `implNimScriptModule` actually emits a list of lambdas that call the procedures that are stored in the macrocache, this way you dont have as many problems with needing to import X before being able to call Y |
07:30:18 | PMunch | Damn it.. How am I supposed to wrap this: `XDamageCreate(Display *dpy, Drawable drawable, int level);` and `#define X_DamageCreate 1` |
07:31:52 | FromDiscord | <Rika> thats one reason why we cant do auto-wrapping i guess |
07:32:09 | FromDiscord | <Elegantbeef> `xDamageCreate`- proc and `XDamageCreate`- const |
07:32:31 | FromDiscord | <Rika> that just shifts the problem though |
07:32:37 | FromDiscord | <Rika> what now when you have a type and a define |
07:32:45 | PMunch | I mean I could rename X_DamageCreate to XunderscoreDamageCreate |
07:32:51 | PMunch | And stuff like that.. |
07:33:06 | FromDiscord | <Rika> so we're back to mangling |
07:33:13 | FromDiscord | <Elegantbeef> Well when you have that problem you swim over to C land and shit on the nearest C programmer |
07:33:19 | FromDiscord | <Elegantbeef> If it's yourself i'm sorry you have to |
07:33:28 | PMunch | Yeah, but that's just the nature of mapping a bigger space onto a smaller one |
07:33:29 | FromDiscord | <Rika> and if its you |
07:33:52 | FromDiscord | <Elegantbeef> Time to use unicode characters pmunch |
07:34:04 | nrds | <Prestige99> emoji var names |
07:34:17 | PMunch | Oh man :P That'd be a massive mess :P |
07:34:22 | FromDiscord | <Rika> unicode underscore |
07:34:25 | FromDiscord | <Rika> lets gooooo |
07:34:36 | FromDiscord | <Rika> "how to force snake case in nim" |
07:34:45 | PMunch | <_< |
07:34:47 | FromDiscord | <Rika> im sorry maybe i shouldnt have said that |
07:35:17 | FromDiscord | <Elegantbeef> It's not that worst solution to this problem, i'm more likely to copy paste anything named `XUnderscoreDamgeCreate` than manually write it 😛 |
07:36:01 | PMunch | The problem is that you're probably reading a C guide |
07:36:22 | PMunch | And suddenly it looks like something didn't get automatically wrapped |
07:36:41 | FromDiscord | <Rika> well what if someone has "AunderscoreA" and "A_A" |
07:36:42 | FromDiscord | <Rika> xdddd |
07:37:26 | PMunch | My current workaround is to rename things as _1 _2 _3, etc. whenever I map something to something that already existed |
07:37:40 | FromDiscord | <Rika> works i guess |
07:38:03 | FromDiscord | <Elegantbeef> Just throw in the type `Define` `Func`.... |
07:38:32 | FromDiscord | <Rika> i think it should only apply for defines |
07:39:07 | FromDiscord | <Rika> so DefXDamageCreate or so |
07:40:37 | PMunch | Hmm, problem now is that if I include file X which includes file Y, the defines from file Y will get their names first, then file X will get _1 postfixes |
07:45:49 | * | jkl quit (Quit: Gone.) |
07:46:40 | * | jkl joined #nim |
07:49:41 | * | neurocyte0132 joined #nim |
07:49:41 | * | neurocyte0132 quit (Changing host) |
07:49:41 | * | neurocyte0132 joined #nim |
08:08:05 | nrds | <Prestige99> When creating an object that has a seq[Foo] property, does the seq start with a len 0 or does it alloc memory before anything is added? |
08:10:10 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:12:57 | FromDiscord | <Jonah> a user of my cli written in nim is getting `could not load: (libcrypto-1_1-x64|libeay64).dll` errors on windows, assuming it's from openssl missing. what's the easiest way for them to install that? does the nim installer for windows include it? |
08:13:42 | FromDiscord | <Yardanico> You can just ship those DLLs with your binary |
08:14:25 | FromDiscord | <Yardanico> They're available in the bin directory where nim.exe itself is located |
08:14:49 | FromDiscord | <Yardanico> Or you can also get them from https://nim-lang.org/download/dlls.zip |
08:15:01 | FromDiscord | <Yardanico> No need to ship all DLLs inside of the archive, only the ones needed |
08:15:21 | FromDiscord | <Yardanico> As another (more complicated) solution you can statically link openssl |
08:15:47 | FromDiscord | <impbox [ftsf]> @Prestige default seq will be len 0 i believe |
08:15:48 | FromDiscord | <Jonah> which dlls do you think they need |
08:15:55 | FromDiscord | <Jonah> just `libcrypto-1_1-x64.dll`? |
08:16:23 | nrds | <Prestige99> Cool - couldn't find info on it in the docs, but was hoping it'd be 0 |
08:16:56 | FromDiscord | <impbox [ftsf]> afaik nim doesn't set any defaults other than zeroing memroy |
08:17:09 | FromDiscord | <NullCode> In reply to @Jonah "a user of my": It is indeed from openssl being missing |
08:17:13 | FromDiscord | <NullCode> I had that same error too |
08:17:30 | FromDiscord | <NullCode> My solution was to use `puppy` https://github.com/treeform/puppy |
08:17:33 | nrds | <R2D299> itHub: 7"Puppy fetches HTML pages for Nim." |
08:18:02 | FromDiscord | <Jonah> why would i want to use some 3rd party library for that |
08:18:13 | FromDiscord | <Jonah> if the dll is missing just provide the dll |
08:18:14 | FromDiscord | <NullCode> Because static linking is tedious |
08:18:25 | FromDiscord | <NullCode> In reply to @Jonah "if the dll is": Oh you have that kinda scenario |
08:18:28 | FromDiscord | <NullCode> In that case, sure |
08:18:44 | FromDiscord | <NullCode> Just grab dlls from `%nim_dir%\bin` |
08:19:11 | FromDiscord | <Jonah> yeah that's what yardanico said |
08:19:15 | * | Vladar joined #nim |
08:20:10 | PMunch | @Prestige, something like `var x: seq[int]` is a completely nulled out object. This means that size is 0, capacity is 0, and buffer pointer is nil. |
08:22:22 | nrds | <Prestige99> Perfect |
08:23:24 | FromDiscord | <Elegantbeef> Comically the "just provide the dll" is sadly not a common view \:D |
08:26:22 | FromDiscord | <Jonah> does this same issue happen on linux |
08:27:00 | FromDiscord | <Jonah> i guess i've never noticed since i always have nim installed which provides the deps it needs |
08:27:31 | FromDiscord | <Elegantbeef> I think openssl is typically on linux, but dont recall, can always statically link if you must have a self contained binary |
08:27:56 | PMunch | This is usually not a problem on Linux because you normally have dependencies like this installed system-wide |
08:27:58 | FromDiscord | <Elegantbeef> Pretty tedious as i understand it, but idk never done it |
08:29:00 | FromDiscord | <Jonah> i've heard statically linking openssl specifically is irresponsible as it leaves users vulnerable to any crypto issues unless you're keeping the linked version up to date |
08:29:17 | FromDiscord | <Jonah> but telling this guy to download the dll manually is not any safer so |
08:29:51 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Pretty tedious as i": I wouldn't say that it's tedious, but more complicated than normal compilation of course |
08:30:02 | PMunch | Which is why Linux updates these dependencies system wide |
08:30:24 | FromDiscord | <Yardanico> In reply to @Jonah "does this same issue": Not really as virtually all Linux desktop distros ship with OpenSSL |
08:31:15 | FromDiscord | <Yardanico> VoidLinux used LibreSSL for a long time, which is mostly compatible with OpenSSL, but even they decided to switch back to OpenSSL because of other projects only really being tested with OpenSSL |
08:31:59 | FromDiscord | <Yardanico> https://voidlinux.org/news/2021/02/OpenSSL.html |
08:32:35 | FromDiscord | <Jonah> would nim ever consider a compiler flag to statically link those DLLs/whatever the linux equivalent is? |
08:32:46 | FromDiscord | <Jonah> so devs don't have to figure it out themselves |
08:33:53 | FromDiscord | <Yardanico> don't think so, it's on the level of the C compiler and also with static linking you should follow the licenses of the project you're linking with |
08:34:10 | FromDiscord | <Yardanico> That said, it's possible to make Nim config scripts to simplify the process |
08:34:34 | FromDiscord | <Yardanico> See e.g. https://github.com/kaushalmodi/hello_musl |
08:34:37 | nrds | <R2D299> itHub: 7"NimScript (config.nims) for building a static binary using Nim + musl + pcre + libressl/openssl" |
08:38:54 | FromDiscord | <Jonah> neat |
08:56:50 | FromDiscord | <Yardanico> @timotheecour btw, about the binary size - with latest Nim and the same cmdline the hello world binary is 7.4kb, might have something to do with newer LLVM versions in zig cc or something else |
08:57:11 | FromDiscord | <Yardanico> `nim c --os:any -d:posix -d:noSignalHandler --cc:clang --clang.exe="zigcc.sh" --clang.linkerexe="zigcc.sh" -d:danger --gc:arc -d:useMalloc --panics:on --passL:"-target x86_64-linux-musl -flto" --opt:size↵ hello.nim`↵↵zigcc.sh is because Nim doesn't accept commands in clang.exe like "zig cc" |
08:57:24 | FromDiscord | <Yardanico> I will also try with musl GCC to see if it's much different from zig cc |
08:58:15 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Aol |
08:58:51 | FromDiscord | <Yardanico> ah right, forgot one more trick `strip -R .comment -R .note -R .note.ABI-tag hello` then the size is 7296 |
08:59:07 | FromDiscord | <Yardanico> (this removes the comment sections from the binary that state which compiler version it was created with) |
08:59:45 | ehmry | does anyone remember the github issue on for making the compiler emit FILE:LINE output? or does anyone have a patch? |
09:02:56 | PMunch | FILE:LINE output? |
09:08:13 | ehmry | PMunch: "standard" compiler output for giving the location of a line within a file |
09:08:34 | ehmry | like GCC or clang or go or pcc |
09:08:59 | PMunch | Still not sure what you want |
09:09:23 | FromDiscord | <impbox [ftsf]> makes sense to me, but i don't know of the github issue |
09:10:57 | nrds | <Prestige99> Is there a way to expose a readonly view of a seq of an object? E.g. https://play.nim-lang.org/#ix=3Aor |
09:11:10 | nrds | <Prestige99> I suppose my only other option would be to wrap the seq impl |
09:11:11 | FromDiscord | <impbox [ftsf]> ehmry https://github.com/nim-lang/Nim/issues/690 there you go |
09:12:12 | PMunch | Prestige, I mean you could put in in a different module and not export the children field? |
09:12:19 | FromDiscord | <impbox [ftsf]> Prestige, not afaik |
09:12:23 | PMunch | Oh wait, you have a children template.. |
09:12:38 | nrds | <Prestige99> Yeah |
09:12:54 | nrds | <Prestige99> Wanted to expose useful functions to iterate etc without allowing modifications |
09:13:08 | nrds | <Prestige99> like using things in sequtils |
09:13:08 | FromDiscord | <Elegantbeef> `lent T` |
09:13:54 | nrds | <Prestige99> ohh neat |
09:13:57 | nrds | <Prestige99> https://nim-lang.github.io/Nim/destructors#lent-type |
09:14:18 | ehmry | impbox [ftsf]: yes, thank you! |
09:14:29 | FromDiscord | <Yardanico> anyone knows of any prebuilt clang musl toolchains? |
09:14:39 | FromDiscord | <Yardanico> there are quite a lot for GCC, but can't find any with clang |
09:14:55 | FromDiscord | <Elegantbeef> It will copy if it needs to IE\: `var a = getsomeThing()` but aside from that it will be a read only pointer |
09:15:52 | PMunch | We seriously need more documentation for how lent and sink and ARC works.. |
09:15:54 | FromDiscord | <Elegantbeef> But yea does exactly what you want https://play.nim-lang.org/#ix=3Aos |
09:16:39 | FromDiscord | <Elegantbeef> Probably |
09:16:44 | nrds | <Prestige99> hm |
09:18:18 | nrds | <Prestige99> ah it needed to be a proc, okay |
09:18:20 | nrds | <Prestige99> Thanks beef |
09:18:51 | FromDiscord | <Elegantbeef> Yea templates being code substitution cannot use stuff like that afaik |
09:19:17 | FromDiscord | <Elegantbeef> having a template return a `lent T` doesnt make sense as it's pasting the body where it's called |
09:19:42 | nrds | <Prestige99> Yeah found it interesting that it compiles but doesn't work the same way as a proc would |
09:20:21 | FromDiscord | <Elegantbeef> Arguably might be a "bug" |
09:20:40 | FromDiscord | <Elegantbeef> Though i guess you could be calling a functioning internally which does borrow |
09:28:31 | FromDiscord | <Yardanico> From https://github.com/nim-lang/website/pull/301, maybe someone will find it useful: |
09:28:48 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Aoy |
09:35:51 | FromDiscord | <NullCode> In reply to @Yardanico "See e.g. https://github.com/kaushalmodi/hello_musl": Hello musl is cool |
10:11:54 | Zevv | Is it common in elixir code to whitespace align the ->'s in a case? |
10:12:12 | Zevv | oh damn EWRONGCHAN |
10:12:13 | FromDiscord | <Rika> This is the Nim channel sir |
10:12:19 | FromDiscord | <Yardanico> XDD |
10:12:25 | FromDiscord | <Yardanico> exposed |
10:12:45 | Zevv | Fuck Nim |
10:13:19 | Zevv | Oh wait. also the wrong channel to say that, isn't it? |
10:14:01 | FromDiscord | <Yardanico> it's the wrong universe to say that |
10:14:04 | FromDiscord | <Rika> Someone ban pls |
10:14:05 | FromDiscord | <Rika> Troll |
10:14:32 | Zevv | yeah it's about time I got banned |
10:15:38 | * | PMunch swings hammer |
10:15:51 | PMunch | Anyways, are you checking out Elixir Zevv? |
10:15:51 | Zevv | PMunch, our might local Thor |
10:15:58 | Zevv | not checking out, I'm flying high |
10:16:12 | Zevv | this stuff is hilarious. I'm just telling my computer *what* to do, not *how* to do it |
10:16:27 | PMunch | That's the beauty of functional programming :) |
10:16:27 | Zevv | I played around a few months ago, ported npeg to xpeg |
10:16:37 | PMunch | At least if you have a good functional language.. |
10:16:52 | Zevv | now I needed a distributed system for managing a fleet of embedded computers connected to a load, power supply, temp sensor etc to do battery measurements |
10:16:59 | Zevv | this clustering stuff just _works_ |
10:17:05 | Zevv | I wrote about 250 lines of elixir. It all works |
10:17:19 | Zevv | clustring. HTTP rest & json api. programmable scripting. communication with the hardware |
10:17:26 | Zevv | 750 lines |
10:17:31 | PMunch | Oh right, Elixir uses Erlang for the distributed bits right? |
10:17:39 | PMunch | Damn, that's impressive |
10:17:41 | Zevv | right. It lies on top of OTP |
10:17:53 | Zevv | but the underlying framework is solid as hell. |
10:18:16 | Zevv | Supervisor trees, hot code reloading, gazillions of tasks, actors |
10:18:41 | Zevv | it really nicely matches the problem I'm working on now |
10:19:35 | PMunch | Yeah it sounds like a perfect fit for the use-case you mentioned |
10:20:13 | PMunch | How's the speed of Elixir/the Erlang VM by the way? |
10:20:26 | PMunch | Not like benchmarking speeds, but ballpark |
10:33:25 | Zevv | latest version gained JIT this year |
10:33:42 | Zevv | its not in the rust or nim or c ballpark |
10:33:55 | Zevv | but is much better then python, php, ruby and the likes |
10:35:54 | PMunch | Cool |
10:36:02 | Zevv | its semi-dynamic so it's not light on the allocations and all |
10:36:06 | Zevv | you pay for that, right |
10:36:10 | PMunch | I mean if it was in the C ballpark it would be amazing for a functional language |
10:36:38 | Zevv | but I decided that raw performance is something I rarely need. And there is always FFI of course |
10:36:57 | Zevv | it makes for a nice team with Nim or Rust, for example |
10:37:08 | PMunch | Yeah, most functional languages tend to have slightly worse performance in order to give the guarantees it does |
10:38:49 | FromDiscord | <hotdog> Hey @PMunch |
10:39:00 | FromDiscord | <hotdog> Futhark is awesome |
10:39:06 | PMunch | Thanks :) |
10:39:20 | PMunch | Have you used it for anything particular? |
10:39:28 | PMunch | Or did you just try it out? |
10:39:31 | FromDiscord | <hotdog> I used it a couple days ago to wrap jack (audio library) headers |
10:39:44 | FromDiscord | <hotdog> I was trying to put together a quick prototype |
10:39:53 | PMunch | Oh nice, did it work alright for those? |
10:40:36 | FromDiscord | <hotdog> And used some existing jack wrapper from nimble or github, but it was broken, outdated and kept segfaulting. Spent a while trying to fix it and gave up. Then decided to try futhark and in literally 2 minutes I had a fully working wrapper |
10:40:55 | FromDiscord | <hotdog> So it's ideal for prototyping |
10:41:14 | FromDiscord | <hotdog> You can just pull a library in super quickly |
10:41:27 | PMunch | @Zevv, I kinda want to see something like zero-functional expanded to an entire language. Compile-time lazy evaluation and compile-time resolution of the things zero-functional does |
10:41:29 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
10:41:39 | FromDiscord | <hotdog> I saw the mixed reactions on the forum, and I disagree with a lot of what was said |
10:42:07 | PMunch | @hotdog, that is the exact same experience I have had using Futhark :) |
10:42:21 | FromDiscord | <hotdog> For me, Nim is a swiss-army-knife that can do so much, and integrate in so many places. But it doesn't work if you have to spend 6+ hours wrapping each library you want to use |
10:43:04 | PMunch | I was a bit surprised by some of the negativity on the forum, but I guess it was a bit down to me sort-of claiming Futhark would replace c2nim and nimterop |
10:43:12 | FromDiscord | <hotdog> But before e.g. publishing to nimble, I probably would put some effort in to make it more Nim style |
10:43:20 | FromDiscord | <hotdog> My wrapper, I mean |
10:43:26 | PMunch | Oh for sure |
10:43:32 | FromDiscord | <hotdog> But it's so handy to have a working library so quickly |
10:43:55 | FromDiscord | <tandy> feels like a spoiler to read this now↵(@Yardanico) |
10:43:58 | PMunch | Yeah, and it's perfect if you're just making a small application for yourself. Or as you said prototyping something |
10:44:02 | FromDiscord | <Yardanico> In reply to @tandy "feels like a spoiler": why? |
10:44:06 | FromDiscord | <Yardanico> it's better to know the changes beforehand |
10:44:08 | FromDiscord | <hotdog> In reply to @PMunch "I was a bit": Yeah I can see that. I think it fills a slightly different use case |
10:44:13 | FromDiscord | <Yardanico> most of this was already in changelog.md |
10:44:28 | FromDiscord | <hotdog> In reply to @PMunch "Yeah, and it's perfect": Yeah 100% |
10:44:37 | PMunch | It is a bit different for sure |
10:44:51 | FromDiscord | <hotdog> I've got a question for you |
10:44:51 | PMunch | Have you had a look at the cached output by the way? |
10:45:32 | FromDiscord | <hotdog> For the symbol renaming, would it be possible to have a callback? I want to e.g. change every symbol that ends in "_t" to a more nim-style type name |
10:45:44 | FromDiscord | <hotdog> But don't want to write every symbol into the wrapper |
10:45:59 | FromDiscord | <hotdog> In reply to @PMunch "Have you had a": Yeah I did, had a poke around |
10:46:04 | PMunch | I want to write a mode that doesn't output all the `when declared` shenanigans so it would be slightly better for wrapping |
10:46:12 | PMunch | Ooh, that is a good idea indeed |
10:46:28 | FromDiscord | <tandy> how↵(@hotdog) |
10:46:31 | FromDiscord | <tandy> that sounds amazing |
10:46:32 | PMunch | If you've had a look at the Futhark sources I have a "TODO: Rethink this" over the entire renaming table :P |
10:46:44 | FromDiscord | <tandy> agree↵(@hotdog) |
10:46:45 | FromDiscord | <hotdog> In reply to @PMunch "I want to write": Cool that would be good. I navigated around mostly by jump-to-definition |
10:47:07 | PMunch | Ah, that is indeed the best way to navigate that mess |
10:47:20 | FromDiscord | <tandy> i mean yeah ive seen the changes before but its just exciting to read the blog posts lol↵(@Yardanico) |
10:47:36 | PMunch | It's output that way to ensure you won't have collisions and so that you can define your own overriding types |
10:48:00 | PMunch | But that's less of a concern if you're going to process it into a wrapper |
10:48:28 | FromDiscord | <hotdog> In reply to @PMunch "It's output that way": I see |
10:48:42 | PMunch | But throwing some callbacks in at various points is a good idea |
10:48:49 | FromDiscord | <hotdog> Maybe a callback to handle collisions |
10:48:58 | FromDiscord | <hotdog> ah snap 🙂 |
10:49:06 | PMunch | Yeah, I'm actually working on some better collision handling right now.. |
10:49:10 | PMunch | It's a bit of a mess |
10:51:27 | FromDiscord | <hotdog> Cool |
10:51:44 | FromDiscord | <hotdog> I'm keen to see how it goes |
10:52:22 | PMunch | Most of the trouble comes from trying to convert C names to Nim-names without horrible mangling |
10:52:43 | PMunch | This sometimes causes overlaps (just scroll back a bit and you'll see me mentioning some of them) |
10:52:58 | FromDiscord | <hotdog> Yeah I can imagine that |
10:53:48 | FromDiscord | <Rika> ~~damn so you didn’t opt for the Unicode underscore method~~ |
10:54:04 | PMunch | But the `when declared` stuff is just so that you'll be able to fix wrapping issues by just declaring it yourself. A feature that I missed when doing c2nim and nimterop |
10:54:07 | FromDiscord | <hotdog> I guess the main thing is handling different naming conventions used in C, there could even be a few presets for different common ones |
10:54:18 | * | neurocyte0132 quit (Ping timeout: 260 seconds) |
10:54:19 | PMunch | @Rika, haha, give me a keyboard that can output those and I'll consider it |
10:54:32 | FromDiscord | <hotdog> In reply to @PMunch "But the `when declared`": Yeah that is handy |
10:54:36 | FromDiscord | <Rika> On it chief, making the firmware right now |
10:55:22 | PMunch | Damn it, just realised that I have written keyboard firmware in Nim that would support that.. You could literally fork it and have a keyboard firmware I can flash onto my keyboard in minutes.. |
10:55:33 | FromDiscord | <hotdog> Anyway, go to rush off. Just wanted to say good job on it, nice one @PMunch |
10:55:37 | FromDiscord | <Rika> Poggers |
10:55:44 | PMunch | Thanks again |
10:55:50 | PMunch | Gotta go to a meting myself |
10:55:56 | FromDiscord | <Rika> See you |
11:01:27 | FromDiscord | <tandy> using essentia / flucoma from nim would be amazing |
11:02:23 | FromDiscord | <Rika> ? |
11:02:29 | FromDiscord | <Rika> Reply with unknown content? |
11:06:15 | FromDiscord | <tandy> strange |
11:06:30 | FromDiscord | <tandy> i asked pmunch if they were going to support cpp |
11:10:32 | FromDiscord | <Rika> C++ is another beast |
11:10:34 | FromDiscord | <Rika> I doubt it |
11:11:08 | FromDiscord | <tandy> damn |
11:11:25 | FromDiscord | <enthus1ast> i one want to try it on windows\: https://github.com/PMunch/futhark/issues/1 |
11:11:33 | FromDiscord | <Yardanico> In reply to @tandy "damn": your best bet is to hope haxscramper suceeds :) |
11:11:37 | FromDiscord | <Yardanico> (edit) "suceeds" => "succeeds" |
11:11:55 | FromDiscord | <Yardanico> he's doing the ultimate C++ wrapping tool and wants to test it on the ultimate C++ beast - Qt |
11:11:58 | FromDiscord | <tandy> where is haxscramper working on that?↵(@Yardanico) |
11:12:03 | FromDiscord | <enthus1ast> to install it i had changed the nimble file to not install opir, build it by hand, then copy opir to the nimble dir |
11:12:05 | FromDiscord | <tandy> oh my god↵(@Yardanico) |
11:12:08 | FromDiscord | <tandy> incredibly based |
11:12:09 | FromDiscord | <Yardanico> it's too early to try rn I think |
11:12:27 | FromDiscord | <Yardanico> https://github.com/haxscramper/hcparse |
11:12:30 | nrds | <R2D299> itHub: 7"High-level nim bindings for parsing C/C++ code" |
11:27:43 | FromDiscord | <cabboose> He will definitely succeed |
11:27:52 | FromDiscord | <cabboose> the question is whether he will burn down his computer before that happens |
11:28:03 | FromDiscord | <cabboose> pray for him 🙏 |
11:31:33 | FromDiscord | <haxscramper> It would be pretty helpful if I wasn't the only person actually doing thinking, because all other solutions just seem to be a quick-patches, without diving deep into details of macro expansion, interfacing with virtual classes, c templates, portability and tracking of library abi changes and so on |
11:32:04 | FromDiscord | <haxscramper> Maybe I should put up more issues in "help wanted" section |
11:32:48 | FromDiscord | <haxscramper> And when 1.6 finally comes out and unbreaks my CI write documentation for the whole internal API |
11:34:06 | FromDiscord | <haxscramper> Because implementing this, given right tools is not as hard as coming up with the design |
11:36:12 | FromDiscord | <tandy> is there really no interest from araq / lead nim devs in working on the stuff ur doing? |
11:36:51 | * | Vladar quit (Remote host closed the connection) |
11:38:16 | FromDiscord | <Rika> Probably just have their hands full |
11:41:03 | FromDiscord | <tandy> makes sense↵(@Rika) |
11:44:07 | FromDiscord | <haxscramper> In reply to @tandy "is there really no": c2nim seems to be "good enough for now" for them |
11:44:55 | FromDiscord | <haxscramper> At least there was no real push for any other official tooling that involved libclang/tree-sitter/boost::wave and other tools of that sort |
11:45:29 | FromDiscord | <tandy> hmm, dont they have a lot of money in their open collective |
11:45:42 | FromDiscord | <haxscramper> c2nim is basically a lowest common denominator. It works ... often enough |
11:45:43 | FromDiscord | <tandy> would be useful to fund some ppl with that |
11:45:53 | FromDiscord | <haxscramper> Well |
11:46:09 | FromDiscord | <haxscramper> It is not exactly a problem that can be solved by throwing money at it |
11:46:23 | FromDiscord | <haxscramper> Or we would just end up with new nimterop or something like that |
11:47:18 | FromDiscord | <haxscramper> Main issue is collecting use cases and iteratively adapting the solution |
11:47:26 | FromDiscord | <haxscramper> Coming up with good base tooling and building on top of this |
11:47:52 | FromDiscord | <haxscramper> So far I haven't seen any solution that followed this procedure, it mostly just straight-up jump to codegen |
12:02:01 | * | jjido joined #nim |
12:02:55 | * | max22- quit (Ping timeout: 260 seconds) |
12:04:36 | * | jjido quit (Client Quit) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:16:32 | FromDiscord | <Goel> Is it possible to specify to import only a single exported procedure form another module, instead of the whole module |
12:16:36 | FromDiscord | <Goel> (edit) "module" => "module?" |
12:16:51 | FromDiscord | <enthus1ast> from module import foo |
12:30:19 | FromDiscord | <gnu+linux user> but does it do any good on terms of generated csource of module having no other code other than imported procs |
12:30:31 | FromDiscord | <gnu+linux user> (edit) "procs" => "procs?" |
12:30:59 | FromDiscord | <cabboose> Nim only compiles the code you use anyway |
12:31:22 | FromDiscord | <cabboose> Well there are exceptions to that I think |
12:34:52 | FromDiscord | <Yardanico> @gnu+linux user as cabboose said, Nim always has dead-code elimination on |
12:35:04 | FromDiscord | <Yardanico> unless the procedure is marked with `{.exportc.}` |
12:40:30 | * | arkurious joined #nim |
12:47:17 | FromDiscord | <Goel> I had to do that because i only needed a single `type = object` from another module. Instead of importing that i triet to "trick" it creating the same type object, same name, same structure and fields, withing my module, but then when i export this module with its procedures, the compiler complains. So i suppose every created object even if is exactly the same (same name and fields) of another already present in a different module, is still |
12:47:19 | * | jjido joined #nim |
12:54:49 | FromDiscord | <cabboose> Unless you have collision issues then you can still import the whole module. It doesn’t effect performance. Otherwise you can do the from module import |
12:54:59 | FromDiscord | <cabboose> All kinds of ways to be tricky about it if you need |
13:01:18 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
13:14:20 | FromDiscord | <Yardanico> In reply to @Goel "I had to do": yes of course, that's how it should work |
13:15:10 | * | rockcavera joined #nim |
13:15:10 | * | rockcavera quit (Changing host) |
13:15:10 | * | rockcavera joined #nim |
13:18:26 | * | Gustavo6046 quit (Ping timeout: 245 seconds) |
13:20:00 | FromDiscord | <gnu+linux user> so from is a placebo 😔 |
13:29:07 | FromDiscord | <cabboose> Well no; it’s good for collisions, so like if you had two procs of the same names in module a and b |
13:29:12 | FromDiscord | <cabboose> You can either import everything except that proc from b |
13:29:19 | FromDiscord | <cabboose> Or just import the ones you want from b |
13:29:23 | * | max22- joined #nim |
13:31:40 | FromDiscord | <NullCode> but is there size reduction |
13:31:44 | FromDiscord | <NullCode> if we do from |
13:31:54 | FromDiscord | <NullCode> (edit) "from" => "`from`" |
13:32:18 | FromDiscord | <exelotl> no, Nim has dead code elimination regardless |
13:32:46 | FromDiscord | <exelotl> if you import something and don't use it, it won't show up in the generated C code |
13:33:54 | FromDiscord | <NullCode> i see |
13:34:06 | FromDiscord | <exelotl> I like to use `from` for cases where a module is just imported so that I can call a single proc on line 733 |
13:38:14 | FromDiscord | <exelotl> or cases where it's really not clear where a proc came from - e.g. in my game there's a shard (currency) counter but i sometimes re-use it to show messages. So I have `from shards import showMessage` to tell the reader (e.g. my future self) that yes, this is weird and I know it |
13:44:32 | * | Schnouki joined #nim |
13:59:54 | * | PMunch quit (Quit: Leaving) |
14:03:26 | * | neurocyte0132 joined #nim |
14:03:26 | * | neurocyte0132 quit (Changing host) |
14:03:26 | * | neurocyte0132 joined #nim |
14:20:34 | * | Gustavo6046 joined #nim |
14:25:26 | FromDiscord | <Rika> when types are extremely generic in name (Image, Color) i qualify them (pixie.Image, pixie.Color), then both procs and types are obvious as to where they come from |
14:36:52 | FromDiscord | <Gumber> or you can alias the import |
14:36:58 | FromDiscord | <Gumber> `import pixie as pix` or whatever |
14:37:30 | FromDiscord | <Gumber> I don't know - I rarely find the aliasing stuff / import stuff useful and I usually just do what @Rika described above... |
14:44:14 | FromDiscord | <reilly> Are there any ways of doing a bitwise AND besides the `bitops.bitand()` macro? I think it has some pragmas that are causing me issues. |
14:46:26 | FromDiscord | <Gumber> yes |
14:46:32 | FromDiscord | <Gumber> `0 and 1` |
14:47:13 | FromDiscord | <Gumber> In reply to @reilly "Are there any ways": https://play.nim-lang.org/#ix=3ApM |
14:49:16 | FromDiscord | <reilly> Oh yeah, duh. Thanks. |
14:56:48 | FromDiscord | <reilly> So, I've got a pointer to a `uint8`. How can I access the memory located `x` bytes away from this pointer? |
14:57:17 | FromDiscord | <reilly> Specifically, I''m trying to assign to a portion of memory `x` bytes away from a pointer. |
14:57:27 | FromDiscord | <reilly> (edit) "I''m" => "I'm" |
14:58:16 | FromDiscord | <Gumber> @reilly pointer arithmetic is one option |
14:58:27 | FromDiscord | <Gumber> if you know what the underlying memory represents you could cast it to that |
14:58:34 | FromDiscord | <Gumber> so if it's like an array of uint8s or something |
14:58:47 | FromDiscord | <Gumber> and you know the size of the underlying array - you could cast it to that and access it that way |
14:59:05 | * | neurocyte0132 quit (Quit: The Lounge - https://thelounge.chat) |
14:59:17 | FromDiscord | <Gumber> you could also cast it to an `ptr UncheckedArray[uint8]` and then use the subscript operator to access the element you want |
15:00:23 | * | neurocyte0132 joined #nim |
15:00:23 | * | neurocyte0132 quit (Changing host) |
15:00:23 | * | neurocyte0132 joined #nim |
15:01:02 | FromDiscord | <Gumber> I've used this library before - https://github.com/kaushalmodi/ptr_math - with success |
15:01:05 | nrds | <R2D299> itHub: 7"Pointer arithmetic in Nim" |
15:03:03 | FromDiscord | <tandy> are there any similar language projects to nim atm? |
15:05:24 | FromDiscord | <auxym> Similar how? Nim is often lumped in with Rust, Go, Zig, D, Crystal. Whether they are "similar" is somewhat subjective and depends on what you are comparing. Some people even say Nim is "similar" to python because of whitespace syntax, despite the fact that they are pretty different languages on most other axes |
15:05:55 | FromDiscord | <tandy> i guess nice syntax, high level, general purpose?↵(@auxym) |
15:06:07 | FromDiscord | <Gumber> Nim isn't really high level.... |
15:06:07 | FromDiscord | <tandy> i wouldnt say zig is an alternative to nim |
15:06:15 | FromDiscord | <tandy> it can be though |
15:06:26 | FromDiscord | <tandy> whereas zig isnt at all |
15:06:36 | FromDiscord | <Gumber> Well Zig is meant to replace C Nim isn't |
15:06:43 | FromDiscord | <Gumber> Nim will probably eventually get a Zig compiler backend |
15:06:56 | FromDiscord | <Gumber> But I mean you can compile inline assembly with Nim - I wouldn't call it high level |
15:07:01 | FromDiscord | <tandy> yee↵(@Gumber) |
15:07:06 | FromDiscord | <tandy> awesome hahah↵(@Gumber) |
15:07:07 | FromDiscord | <Gumber> semantic wise it's much closer to C++ than a lot of other languages |
15:07:18 | FromDiscord | <tandy> i suppose general purpose is better↵(@Gumber) |
15:07:20 | FromDiscord | <Gumber> so if you consider C++ high level, I guess Nim is then too, but..... |
15:07:33 | FromDiscord | <Gumber> No I don't think there are many languages like Nim - maybe the closest would be D |
15:07:42 | FromDiscord | <Gumber> but I also don't know much about D's memory model |
15:07:53 | FromDiscord | <tandy> what about crystal? i havent looked at that much↵(@Gumber) |
15:07:57 | FromDiscord | <Gumber> lol |
15:08:17 | FromDiscord | <Gumber> sorry it's just whenever I hear Crystal or V these days I chuckle |
15:08:19 | FromDiscord | <Rika> crystal is still vm based isnt it |
15:08:27 | FromDiscord | <Gumber> Crystal still doesn't support windows afaik lol |
15:08:36 | FromDiscord | <Rika> i find crystal at least much more respectable than v/ |
15:08:43 | FromDiscord | <Gumber> I mean yeah - but it's still kind of a joke IMO |
15:08:52 | FromDiscord | <Gumber> been kind of sitting in the same state since it was announced for the most part |
15:08:56 | FromDiscord | <tandy> yeah its pretty funny how out of all these attempts nim is the only one that survived↵(@Gumber) |
15:08:59 | FromDiscord | <Gumber> and everyone was sooooo hyped about it |
15:09:11 | FromDiscord | <Gumber> well Nim has been around for close to two decades at this point |
15:09:24 | FromDiscord | <Gumber> or it's nearing that point anyway |
15:09:39 | FromDiscord | <Gumber> it's much older than Crystal or V or Zig or Rust |
15:09:41 | FromDiscord | <tandy> damn i didnt realise↵(@Gumber) |
15:09:49 | FromDiscord | <tandy> i thought it was only a decade |
15:10:03 | FromDiscord | <Gumber> nope |
15:10:25 | FromDiscord | <Gumber> 13 years ago it says now |
15:10:29 | FromDiscord | <Gumber> but I think that's probably wrong |
15:10:30 | FromDiscord | <Gumber> https://en.wikipedia.org/wiki/Nim_(programming_language) |
15:10:40 | FromDiscord | <Gumber> yeah it was started in 2005 |
15:10:43 | FromDiscord | <Gumber> development - so 16 years now |
15:10:57 | FromDiscord | <Gumber> became public in 2008 with the name `Nimrod` |
15:11:37 | FromDiscord | <Gumber> why are you looking for alternatives anyway? what don't you like about Nim? |
15:11:41 | FromDiscord | <Gumber> or are you just curious? |
15:11:46 | FromDiscord | <dom96> In reply to @Gumber "Nim will probably eventually": seriously doubt this, far more likely we'll get a LLVM backend |
15:11:52 | FromDiscord | <Gumber> I mean we already have one |
15:11:58 | FromDiscord | <Gumber> NLVM |
15:12:08 | FromDiscord | <Gumber> and I would much prefer a Zig backend to an LLVM one |
15:12:21 | FromDiscord | <Gumber> LLVM brings all sorts of issues that Zig is already figuring out |
15:12:31 | FromDiscord | <tandy> wow↵(@Gumber) |
15:13:01 | FromDiscord | <Gumber> also zigcc exists now so..... |
15:13:02 | FromDiscord | <tandy> just curious, i love nim, but im not sure about its long term position↵(@Gumber) |
15:13:22 | FromDiscord | <Gumber> I think worrying about that kind of thing is a bit pointless if you're exploring niche languages |
15:13:35 | FromDiscord | <tandy> tru lol |
15:14:20 | FromDiscord | <Gumber> I will RFC hard for Zig compiler backend when Zig reaches a more mature state |
15:14:26 | FromDiscord | <Gumber> (edit) "I will RFC hard for ... Zig" added "a" |
15:14:31 | nrds | <Prestige99> That would be great |
15:14:45 | FromDiscord | <enthus1ast> what would be the benefit to have a zig backend over c? |
15:15:23 | FromDiscord | <tandy> zig is the future? |
15:16:11 | FromDiscord | <Gumber> Because Zig is going to be a safer alternative to C with less UB |
15:16:44 | FromDiscord | <tandy> cant wait till we fix computers |
15:16:50 | FromDiscord | <enthus1ast> would be interesting to have a direct nim -\> binary instead of a backend |
15:17:11 | FromDiscord | <enthus1ast> though nim would be the future \:) |
15:17:27 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Aqa |
15:17:28 | FromDiscord | <Gumber> this is why a Zig backend is more attractive than a C one |
15:17:39 | FromDiscord | <dom96> Nim->Zig->LLVM->Binary would just be too much |
15:17:42 | FromDiscord | <Gumber> I mean we can go to LLVM and deal with long ass compile times like the Rust team has to |
15:17:47 | FromDiscord | <dom96> C UB can be avoided |
15:17:48 | FromDiscord | <Gumber> Zig is ditching LLVM |
15:17:52 | FromDiscord | <Gumber> or has been working on doing that for a while |
15:18:21 | FromDiscord | <Gumber> https://kristoff.it/blog/zig-new-relationship-llvm/ |
15:18:47 | FromDiscord | <enthus1ast> UB? |
15:19:11 | FromDiscord | <Gumber> undefined behaviour |
15:19:54 | FromDiscord | <Gumber> In reply to @dom96 "C UB can be": I mean sure - but it doesn't change the fact that the language spec is full of it.... |
15:19:58 | FromDiscord | <Gumber> Zig aims to completely avoid that |
15:20:12 | FromDiscord | <Gumber> I don't even know why anyone wants an LLVM backend |
15:20:20 | FromDiscord | <Gumber> like - we've seen what's happened with rust in relation to compile times.... |
15:20:26 | FromDiscord | <Gumber> do we really want to go down that same road? |
15:20:50 | FromDiscord | <Gumber> (edit) "an" => "a" |
15:21:01 | FromDiscord | <dom96> > and adds an amazing feature for debug builds of your code: incremental compilation with in-place binary patching, another unique Zig feature.↵hah, that article says this and has links to "color blind async/await" + "zig comptime", pretty sure you could say Nim has both too |
15:21:51 | FromDiscord | <dom96> In reply to @Gumber "do we really want": nope, I'm happy with C compilation |
15:22:02 | FromDiscord | <Gumber> I mean me too |
15:22:07 | FromDiscord | <Gumber> but I'd be happier with Zig compil;ation |
15:22:12 | FromDiscord | <Gumber> (edit) "compil;ation" => "compilation" |
15:22:18 | FromDiscord | <Gumber> once Zig is ready anyway |
15:22:55 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
15:24:10 | FromDiscord | <dom96> at that point why not just use Zig? |
15:25:08 | nrds | <Prestige99> why not just use c? |
15:25:52 | FromDiscord | <tandy> so does zig support IC yet?↵(@Gumber) |
15:26:27 | FromDiscord | <dom96> because C has a poor type system, poor module system and is in general an archaic language |
15:27:16 | nrds | <Prestige99> So you think Nim doesn't have advantages over Zig? |
15:27:33 | FromDiscord | <Gumber> I don't know if zig has IC fully implemented yet I know they're working on it |
15:27:47 | FromDiscord | <Gumber> Look you don't use zig and you don't use C because Nim has higher level abstractions than both languages |
15:27:58 | FromDiscord | <Gumber> The point is if zig is going to eventually end up being a better C it doesn't even make sense to compile to see anymore it makes sense to compile to zig |
15:28:17 | FromDiscord | <Gumber> But we're not there yet The zig team is still working on making zig a c replacement it's obviously making a lot of progress towards that but it's not there yet |
15:28:31 | FromDiscord | <Gumber> The zig team has also made some incredible tooling like zig CC which basically eliminates the need for cross compile tool chains altogether |
15:28:41 | * | beshr joined #nim |
15:28:46 | FromDiscord | <Gumber> So zig is going to end up being like a better LLVM for Nim |
15:28:51 | FromDiscord | <haxscramper> It is harder to compiler to zig because it is harder to use it as dumb backend |
15:28:54 | * | beshr quit (Changing host) |
15:28:54 | * | beshr joined #nim |
15:29:10 | FromDiscord | <Gumber> This is true there are more language semantics and rules and everything like that it's definitely a more complex challenge than writing a C compiler back end |
15:29:16 | FromDiscord | <haxscramper> if zig code is too smart we have to transpile nim code to correct zig |
15:29:18 | FromDiscord | <Gumber> But I think in the end if it is feasible it is worth the effort |
15:29:30 | FromDiscord | <Gumber> Right but I think one of the design goals of the zig team is to keep it simple I guess we'll just have to find out how simple it ends up being |
15:29:30 | FromDiscord | <haxscramper> which is harder than converting to correct C |
15:29:45 | FromDiscord | <Gumber> Yeah I mean you're right if it ends up being a transpilation step instead of a compilation step then we will have issues for sure |
15:30:04 | FromDiscord | <haxscramper> and what benefits does zig bring to us again? |
15:30:10 | FromDiscord | <dom96> Prestige: I don't think the advantages are large enough to warrant implementing a Zig backend for Nim over simply just using Zig |
15:30:16 | FromDiscord | <haxscramper> it being better language makes harder for us to compile to it |
15:30:19 | FromDiscord | <Gumber> Well less undefined behavior more memory safety |
15:30:22 | FromDiscord | <haxscramper> the smarter zig gets |
15:30:33 | FromDiscord | <haxscramper> the worse our backend impl would have to be |
15:30:45 | FromDiscord | <haxscramper> have you seen generated C for iterators for examples? |
15:30:48 | FromDiscord | <dom96> What undefined behaviour does Nim have due to its C compilation? |
15:30:50 | FromDiscord | <Gumber> Yeah I mean I agree with and see your points I'm just optimistic that it won't be so high level and so full of abstractions that it will make targeting it difficult but I don't know I don't follow its development extremely closely |
15:30:52 | FromDiscord | <haxscramper> it is just rat's nest of gotos |
15:31:06 | FromDiscord | <Gumber> Nim doesn't have undefined behavior but it has to account for it |
15:31:14 | FromDiscord | <Gumber> Well that's probably a misnomer but |
15:31:32 | FromDiscord | <Gumber> My point is nim doesn't have to expose C'sa UB |
15:31:45 | FromDiscord | <haxscramper> In reply to @Gumber "Yeah I mean I": again, what benefits does it brings us again, except for abstract "C is UB from top to bottom" |
15:31:58 | FromDiscord | <haxscramper> does it have larger ecosystem? |
15:32:16 | FromDiscord | <haxscramper> maybe some unique libs that we would benefit from using? |
15:32:26 | FromDiscord | <haxscramper> access to new platforms that C can't compile to? |
15:32:39 | FromDiscord | <haxscramper> more performant backend for free? |
15:32:43 | FromDiscord | <Gumber> In reply to @haxscramper "it is just rat's": No on the ecosystem |
15:32:54 | FromDiscord | <Gumber> I don't know about the unique library situation but I mean there are libraries for most things in C |
15:32:54 | FromDiscord | <haxscramper> I mean zig is nice to use |
15:33:19 | FromDiscord | <haxscramper> We'd better targeting `.net` or java ecosystem |
15:33:21 | FromDiscord | <Gumber> My thinking is that platforms and available targets will become easier to write code for with a zig back end than it presently is let's see |
15:33:29 | FromDiscord | <Gumber> With C |
15:33:41 | FromDiscord | <Gumber> Well those would be transpilation |
15:33:47 | FromDiscord | <haxscramper> why? |
15:33:51 | FromDiscord | <Gumber> And I imagine just as difficult if zig ends up being very high level |
15:34:03 | FromDiscord | <Gumber> Because they're at the same abstraction level as Nim |
15:34:11 | FromDiscord | <haxscramper> they are all bytecode vm |
15:34:18 | FromDiscord | <haxscramper> we already have bytecode register vm |
15:34:22 | FromDiscord | <haxscramper> I'm talking jvm |
15:34:23 | FromDiscord | <haxscramper> etc. |
15:34:25 | FromDiscord | <Gumber> Okay I see what you're saying |
15:34:28 | FromDiscord | <Gumber> CLR and JVM |
15:34:47 | FromDiscord | <haxscramper> yes, though maybe transpilation to java is easier than jvm code generation |
15:34:56 | FromDiscord | <Gumber> I don't know I've never tried either |
15:34:57 | FromDiscord | <haxscramper> idk, so right now this is just an assumption |
15:35:17 | FromDiscord | <Gumber> Yeah it very much is and that's why I said probably it would get one but if it turns out that zig ends up being too high level to make it worth it then I'm totally wrong |
15:35:47 | FromDiscord | <Gumber> I think one of the design goals was always to replace C and b a viable compilation target but I don't know if that's changed or if it is even still something people are exploring |
15:35:58 | FromDiscord | <Gumber> I explored zig probably 3 to 4 years ago at this point when it was still just a baby |
15:36:25 | FromDiscord | <Gumber> And I know the language semantics and the project itself have changed quite rapidly since I last took a solid look at the project |
15:36:52 | FromDiscord | <Gumber> I know that when I wrote in zig I missed a lot of the abstractions in Nim, and especially Nims metaprogramming |
15:37:12 | FromDiscord | <Gumber> But writing's Zig was much nicer than writing C |
15:39:09 | FromDiscord | <Gumber> Also I have no idea how zig's standard library is going to compare to C's at the end of the day |
15:40:14 | FromDiscord | <haxscramper> I think we would get better shot at interfacing with zig |
15:40:24 | FromDiscord | <haxscramper> or generating zig APIs with something like genny |
15:40:27 | FromDiscord | <haxscramper> EEE strategy |
15:40:44 | * | Gustavo6046 joined #nim |
15:41:15 | FromDiscord | <haxscramper> well, last E is not necessary, but still |
15:41:43 | FromDiscord | <Gumber> yeah that could work well too I think and yeah might end up being better than a Zig compiler backend |
15:42:36 | * | neurocyte0132 quit (Ping timeout: 245 seconds) |
16:00:38 | FromDiscord | <Gumber> yeah but no need to extinguish zig lol |
16:00:47 | FromDiscord | <Gumber> had a meeting in the middle of those replies xD |
16:10:15 | FromDiscord | <Yandong Zhang> Hello everyone, I have a question for sequence comparing. |
16:10:17 | FromDiscord | <Yandong Zhang> assert(@[1.0,1.0,1.0,1.0,1.0] == @[1.0,1.0,1.0,1.0,1.0],"wrong!") |
16:10:37 | FromDiscord | <Gumber> you're comparing refs |
16:10:41 | FromDiscord | <Yandong Zhang> The above statement is not correct. Do anyone know how to compare the seq? |
16:10:53 | FromDiscord | <Shoto> It'd be cool if i could use C libs easily via Zig ngl |
16:11:02 | FromDiscord | <Gumber> You can use C libs easily via Nim 🙂 |
16:11:22 | FromDiscord | <Gumber> In reply to @Yandong Zhang "The above statement is": sequences are ref objects you need to compare the objects the ref points to, not the refs |
16:11:33 | FromDiscord | <Shoto> In reply to @Gumber "You can use C": I haven't been able to figure that out at all lol |
16:11:39 | FromDiscord | <Gumber> do you know C? |
16:11:49 | FromDiscord | <Shoto> Enough to make a basic C program, yes |
16:11:59 | FromDiscord | <Gumber> well then learn how to use `importc` |
16:12:03 | FromDiscord | <Gumber> because it's that easy |
16:12:17 | FromDiscord | <Yandong Zhang> @Gumber\: assert([1.0,1.0,1.0,1.0,1.0] == [1.0,1.0,1.0,1.0,1.0],"wrong!")↵Still not work 🙄 |
16:12:35 | FromDiscord | <Gumber> you're also comparing floating point values |
16:12:44 | FromDiscord | <Gumber> which is not going to work.... |
16:13:04 | nrds | <Prestige99> seems odd, why doesn't that work? |
16:13:05 | FromDiscord | <Gumber> depending on your cpu arch and default word size |
16:13:12 | FromDiscord | <Gumber> you're either comparing sixty-four bit floating point values or 32-bit |
16:13:12 | FromDiscord | <Yandong Zhang> assert([1,2] == [1,2],"wrong!")↵ Not work too |
16:13:22 | FromDiscord | <Gumber> that should work.... |
16:13:23 | FromDiscord | <Shoto> Hm alright |
16:13:33 | FromDiscord | <Gumber> give me one sec Yandong, let me take a look |
16:14:14 | FromDiscord | <Yandong Zhang> Sorry. Works now. |
16:14:20 | FromDiscord | <Yandong Zhang> Thank you |
16:14:21 | FromDiscord | <Gumber> was about to say 🙂 |
16:14:24 | FromDiscord | <Gumber> yeah, no problem! |
16:14:40 | FromDiscord | <Gumber> In reply to @nrds "<Prestige> seems odd, why": because floating point units in modern CPUs don't work that way 🙂 |
16:14:49 | FromDiscord | <Gumber> floating point math by nature is imprecise |
16:15:11 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Aqp |
16:15:24 | nrds | <Prestige99> yeah but I'd think an expression if 1.0 == 1.0 should always be true |
16:15:43 | FromDiscord | <Gumber> one would think.... |
16:15:46 | FromDiscord | <xflywind> Compare string form or using map + https://nim-lang.github.io/Nim/math.html#almostEqual%2CT%2CT%2CNatural |
16:16:26 | FromDiscord | <xflywind> (edit) "using map +" => "use" |
16:16:44 | FromDiscord | <Yandong Zhang> @xflywind\: I use the echo now. Give the assertion. |
16:16:52 | FromDiscord | <Yandong Zhang> REPL way to do the test, LoL |
16:17:09 | FromDiscord | <Yandong Zhang> give up the assertion at this moment. |
16:17:25 | FromDiscord | <Gumber> in general it's just not a good idea to use `==` when checking for equality with floating point values |
16:17:33 | FromDiscord | <Gumber> I think Nim has like `~=` or something? |
16:18:16 | FromDiscord | <Yandong Zhang> Do not know. Another question is, is there a convenient way the convert seq[float] to seq[int]? |
16:18:25 | FromDiscord | <Yandong Zhang> Maybe we need to use the map? |
16:18:38 | FromDiscord | <Gumber> maybe something in `sequtils` |
16:18:44 | FromDiscord | <Gumber> just know that it will == allocations |
16:19:02 | FromDiscord | <Gumber> because that module is full of pure functions and doesn't mutate state |
16:19:19 | FromDiscord | <Yandong Zhang> Will check the sequtils. Thanks again. |
16:19:45 | FromDiscord | <Gumber> https://rosettacode.org/wiki/Approximate_equality#Nim |
16:19:46 | FromDiscord | <Gumber> yeah np! |
16:21:35 | FromDiscord | <xflywind> In reply to @Gumber "https://rosettacode.org/wiki/Approximate_equality#N": Yeah, it is implemented as https://nim-lang.github.io/Nim/math.html#almostEqual%2CT%2CT%2CNatural |
16:21:52 | FromDiscord | <Yardanico> In reply to @Gumber "sequences are ref objects": no |
16:22:00 | FromDiscord | <Gumber> huh? |
16:22:06 | FromDiscord | <Gumber> oh yeah that changed fuck |
16:22:06 | FromDiscord | <Yardanico> nim sequences are ref objects internally, but they have value semantics in Nim |
16:22:06 | FromDiscord | <Gumber> lol |
16:22:10 | FromDiscord | <Yardanico> it never changed |
16:22:13 | FromDiscord | <Yardanico> it always was that way :) |
16:22:20 | FromDiscord | <Gumber> oh well, I barley use sequences so.... |
16:22:33 | FromDiscord | <Gumber> and yes I know it's the same for strings |
16:22:52 | FromDiscord | <Gumber> I guess I just forgot seqs had the same thing - I dunno man I'm always in C land |
16:22:56 | FromDiscord | <Gumber> or C++ land |
16:23:07 | FromDiscord | <Gumber> I rarely rely on Nim strings or sequences etc.... |
16:23:21 | FromDiscord | <Gumber> but thank you for clarifying my error Yard 🙂 |
16:24:34 | FromDiscord | <Gumber> sent a code paste, see https://play.nim-lang.org/#ix=3Aqr |
16:24:46 | FromDiscord | <Rika> !eval assert(@[1.0,1.0,1.0,1.0,1.0] == @[1.0,1.0,1.0,1.0,1.0],"wrong!") |
16:24:48 | NimBot | <no output> |
16:24:51 | FromDiscord | <Yardanico> yeah, it's specific to floats that it doesn't work |
16:24:53 | FromDiscord | <Gumber> right |
16:24:56 | FromDiscord | <Yardanico> @Rika different hardware |
16:24:59 | FromDiscord | <Yardanico> can yield different results |
16:25:03 | FromDiscord | <Rika> of course |
16:25:11 | FromDiscord | <Yardanico> !eval assert(@[1.0,1.0,1.0,1.0,1.0] == @[1.0,1.0,1.0,1.0,1.0],"wrong!") |
16:25:13 | NimBot | <no output> |
16:25:22 | FromDiscord | <Rika> i just sent that |
16:25:25 | FromDiscord | <Yardanico> yes |
16:25:29 | FromDiscord | <Gumber> !eval assert(@[1.0,1.0,1.0,1.0,1.0] == @[1.0,1.0,1.0,1.0,1.0],"wrong!") |
16:25:31 | NimBot | <no output> |
16:25:35 | FromDiscord | <Gumber> what hardware are we all on? |
16:25:36 | FromDiscord | <Gumber> oh weait |
16:25:37 | FromDiscord | <Gumber> lol |
16:25:39 | FromDiscord | <Gumber> it's all nimbot's hardware |
16:25:40 | FromDiscord | <Gumber> xD |
16:25:42 | FromDiscord | <Rika> xd |
16:25:47 | FromDiscord | <Gumber> god my brain sucks without my meds |
16:25:55 | FromDiscord | <Rika> why not take them |
16:25:57 | FromDiscord | <Gumber> trying not to take them every day because they're bad for you |
16:26:01 | FromDiscord | <Rika> huh okay |
16:26:03 | FromDiscord | <Gumber> being on speed every day isn't the greatest thing ever |
16:26:27 | FromDiscord | <Gumber> I'm trying to do 4x a week instead of 7x |
16:26:44 | FromDiscord | <Gumber> to avoid glaucoma, dementia, etc... later in life which stimulants put you at higher risk for |
16:26:58 | FromDiscord | <Gumber> anyway ot |
16:29:13 | FromDiscord | <Yandong Zhang> Today is my third of Nim learning/programming. I just felt that the grammar of Nim is too powerful. Thus, it may not be suitable for a team to use because everyone finally will customize their own grammar. With that said, it looks like Nim is the best tool for a small group or solo programming. |
16:30:40 | FromDiscord | <Rika> it can be suitable for a team once the proper linting tools pop up |
16:31:01 | FromDiscord | <Rika> that way you can lint for editing then lint back for committing |
16:31:21 | FromDiscord | <Rika> and there will be no preferred style issues |
16:36:59 | FromDiscord | <Yandong Zhang> @Rika\: Any lint recommendation? I did not go that far yet. 3x |
16:38:53 | FromDiscord | <Rika> not as of now, the linters are very basic as of now |
16:39:02 | FromDiscord | <Rika> and theres pm just two of them too |
16:39:14 | FromDiscord | <Rika> nimpretty and morepretty (which is just an extension of nimpretty) |
16:40:19 | * | kobi7 joined #nim |
16:40:46 | kobi7 | Hello everyone! |
16:41:11 | FromDiscord | <Rika> hello, whats up? |
16:41:46 | kobi7 | good! I am seeking information about fidget the gui lib |
16:42:15 | kobi7 | anybody has experience with it, here? |
16:43:04 | FromDiscord | <Rika> afaik its currently undermaintained because the author is busy, but thats just from what i hear |
16:43:16 | FromDiscord | <Rika> i havent actually confirmed it from the author themself... |
16:43:40 | kobi7 | is treeform around sometime? maybe I should ask my question in the forum |
16:44:25 | FromDiscord | <Rika> he is sometimes but not as often nowadays as i remember |
16:44:31 | FromDiscord | <dom96> just ask your questions, treeform will respond eventually I'm sure |
16:44:43 | kobi7 | thanks dom, so here goes |
16:44:52 | FromDiscord | <Rika> @treeform a question for you below |
16:45:15 | FromDiscord | <Rika> im not sure if he backreads so just in case... |
16:45:38 | kobi7 | the dsl in fidget is basically templates of an id which is the name of the control, and a block of code that describes it and its procs |
16:46:22 | kobi7 | the way to do a binding to a var, is mentioning that var, which is a global or in the higher scope. |
16:46:34 | FromDiscord | <Shoto> Probably a stupid question but if i wanted to make a plugin for this Python server software (https://github.com/Podrum/podrum-docs/blob/main/plugins/creating.rst) with Nimpy, how would i actually get the code to work? |
16:46:56 | kobi7 | Now I am interested in reusing controls, so I want to pass the binding part (passing that variable to the dsl template) |
16:47:25 | FromDiscord | <Shoto> Would i have to wrap it up in a Python file or can i use the new Types system in Nimpy to emulate a class (i genuinely don't want to because OOP is meh but like, i can't see any other way around it) |
16:47:33 | kobi7 | (or multiple vars) |
16:48:44 | kobi7 | so that's the question, making a self contained widget/control. because from the tests and examples, I only see low level building it, which is fun but perhaps not so productive |
16:50:18 | kobi7 | The gui scene in Nim is in general not very clear. Atleast wrt portable gui: I have tried Nigui and nimx a while ago, but they had very few controls. Maybe it's better to interface with python or something? |
16:52:06 | FromDiscord | <Gumber> what GUI scene in any language is clear? |
16:52:07 | FromDiscord | <Shoto> If you're looking for a GUI library maybe check nimraylib_now? Iirc they have RayGUI |
16:52:10 | FromDiscord | <Gumber> (edit) "what ... GUI" added "cross platform" |
16:52:17 | kobi7 | Oh, I spoke too soon, looking at available pkgs I see "spinner":Spinner is a companion library for the wonderful Fidget |
16:53:05 | FromDiscord | <Gumber> (edit) "what cross platform GUI scene in any ... language" added "compiled native" |
16:53:52 | kobi7 | Gumber, well there are mature libraries like wx, fox toolkit, gtk, qt, iup, first that come to mind. |
16:54:06 | FromDiscord | <Gumber> Nim has bindings to wx |
16:54:11 | FromDiscord | <Gumber> I don't know what fox toolkit is |
16:54:13 | kobi7 | of course i prefer the simpler solutions |
16:54:15 | FromDiscord | <Gumber> I think Nim has bindings to gtk too |
16:54:23 | FromDiscord | <Gumber> qt is not simple - but bindings are in the work |
16:54:27 | FromDiscord | <Gumber> and I wouldn't call that a clear picture lol |
16:54:43 | FromDiscord | <Gumber> (edit) "work" => "works I believe" |
16:55:04 | FromDiscord | <Gumber> also GUI requirements differ vastly between use cases |
16:55:12 | kobi7 | a clear picture, I mean mature or "battle tested" as they say, with enough controls to make a non-trivial gui app |
16:55:24 | kobi7 | today the android case is also important |
16:55:27 | FromDiscord | <Gumber> I mean you're free to wrap whatever C/C++ library you want |
16:55:32 | FromDiscord | <Gumber> well maybe to you 🙂 |
16:55:40 | FromDiscord | <treeform> kobi7, about fidget, you can bind any var if you wrap your control in a function or a template. |
16:55:55 | kobi7 | hi treeform |
16:56:27 | kobi7 | oh, so simply to add another proc that wraps the declaring code? |
16:56:59 | FromDiscord | <treeform> in hn.nim app I pass ID, but you can pass anything: https://github.com/treeform/fidget/blob/master/examples/hn/hn.nim#L31 |
16:57:14 | FromDiscord | <treeform> you can even pass a string and bind it |
16:57:23 | FromDiscord | <treeform> but it has to be a var string so that it can be modified in place |
16:58:42 | kobi7 | cool, I understand now. Thanks! |
16:59:11 | kobi7 | if you're here, what about themes? is there a mechanism that gets a json or a hashtable with a theme name and values? |
16:59:26 | FromDiscord | <treeform> for some thing like a toggle you might pass a `var bool` and modify it in the unclick handler |
16:59:28 | kobi7 | (values for each component) |
17:00:01 | kobi7 | OKay. Btw, are there more docs? couldn't find much |
17:00:02 | FromDiscord | <treeform> yeah at work where I use this lib, I have a file with common controls I use. |
17:00:09 | FromDiscord | <treeform> and they take the normal stuff in. |
17:00:20 | FromDiscord | <treeform> there isn't more docs sorry |
17:00:28 | FromDiscord | <treeform> fidget1 is on hold while I work on fidget2 |
17:00:46 | kobi7 | ah, will it have the same simplicity and dsl? |
17:01:06 | FromDiscord | <treeform> yes and no |
17:01:12 | FromDiscord | <treeform> its going to be different |
17:01:43 | kobi7 | as long as you don't make a WPF out of it. the horror.. |
17:01:53 | kobi7 | :) |
17:02:10 | kobi7 | your gui lib reminds me of rebol's |
17:03:12 | FromDiscord | <treeform> rebol is very short though |
17:03:27 | FromDiscord | <treeform> rebol UI takes amazingly short amount of code |
17:03:37 | kobi7 | yes, and quite primitive, but the same style |
17:04:27 | kobi7 | I like your thinking, what you did with that. I think it's a fun way to program |
17:04:47 | FromDiscord | <treeform> I am glad you like it. |
17:07:14 | kobi7 | so, spinner lib is the way forward for more controls? |
17:09:11 | * | vicfred_ joined #nim |
17:10:05 | * | Gustavo6046_ joined #nim |
17:10:32 | FromDiscord | <enthus1ast> @treeform\: do we need figma to use fidget? |
17:10:45 | FromDiscord | <enthus1ast> or just for designing? |
17:11:30 | kobi7 | it looks like the recommended way, according to the website, but you can use the dsl directly |
17:12:27 | FromDiscord | <enthus1ast> i must admit that it was a big no no for me the create an account on some website just to create guis on my machine |
17:12:51 | * | supakeen_ joined #nim |
17:13:57 | kobi7 | I haven't tried figma yet, but the plugin is installed on the website. i mean, no local installation afaict |
17:15:17 | FromDiscord | <enthus1ast> thats a sign that it will be a locked garden soon |
17:16:59 | FromDiscord | <treeform> Yes the spinner library has the right idea. Bunch of functions to create controls. But really every place usually has custom buttons and controls anyways. You want to project your brand. |
17:17:07 | kobi7 | i don't know, there is a free plan and an upgraded one for unlimited designs. I am not a designer so haven't yet used it, but it has a plugins section on the website, which on my account has Fidget Export |
17:17:12 | FromDiscord | <treeform> So you would have to create some thing like the spinner library |
17:17:36 | * | Gustavo6046 quit (*.net *.split) |
17:17:36 | * | supakeen quit (*.net *.split) |
17:17:36 | * | vicfred quit (*.net *.split) |
17:17:36 | * | blackbeard420 quit (*.net *.split) |
17:17:36 | * | crem quit (*.net *.split) |
17:17:37 | * | Gustavo6046_ is now known as Gustavo6046 |
17:18:33 | kobi7 | hmm, not so good for code reuse. perhaps flexible theming support instead? like, maybe take inspiration from css |
17:18:59 | kobi7 | or some variant of it |
17:19:08 | FromDiscord | <treeform> @enthus1ast I think its terrible that in most companies designers design the UI then most of their work is thrown a way for programmers to implement (draw the UI again) it in code. |
17:19:20 | FromDiscord | <treeform> My goal is to eliminate this waste. |
17:19:50 | FromDiscord | <treeform> We used to make 3d models in code, but now we use Blender, Maya and other programs. |
17:20:06 | FromDiscord | <treeform> We used to make sound in code (chip tunes etc..) but now we use Sound editing programs. |
17:20:14 | FromDiscord | <enthus1ast> yes, i do not have the bigger picture |
17:20:52 | FromDiscord | <enthus1ast> i thought figma was a gui library itself |
17:21:25 | FromDiscord | <treeform> Because UI is now sufficiently complex ... we have left the realm of simple buttons and boxes... we need a whole profession just to position and brand the controls. |
17:21:32 | * | kinkinkijkin quit (Remote host closed the connection) |
17:21:46 | FromDiscord | <treeform> Na Figma is just an Editor that Designers really like. |
17:21:52 | * | kinkinkijkin joined #nim |
17:22:05 | FromDiscord | <treeform> Like "Adobe Photoshop" but for UI work. |
17:22:07 | * | blackbeard420 joined #nim |
17:22:07 | * | crem joined #nim |
17:22:14 | FromDiscord | <treeform> Its really taking the design world by storm. |
17:22:20 | FromDiscord | <treeform> Every one is switching to it. |
17:22:40 | FromDiscord | <treeform> I have never seen a program take over a profession (UX design) this fast. |
17:23:45 | kobi7 | treeform, so in Figma, can I simply pick a theme |
17:24:02 | kobi7 | d control kit and use it? is it free to use? |
17:24:21 | FromDiscord | <treeform> So Figma has like a Github for UX designers |
17:24:42 | FromDiscord | <treeform> Its called "community" |
17:24:47 | FromDiscord | <treeform> https://www.figma.com/community/explore |
17:25:00 | FromDiscord | <treeform> You can go to UI kit section: |
17:25:01 | FromDiscord | <treeform> https://www.figma.com/community/ui_kits |
17:25:08 | FromDiscord | <treeform> and there are 1000s of UI kits to choose from |
17:25:14 | FromDiscord | <treeform> you can just pick one out now |
17:25:15 | FromDiscord | <treeform> and go with it |
17:25:26 | FromDiscord | <treeform> its free to use as community requires a single license |
17:25:54 | FromDiscord | <treeform> everything in the community is: https://creativecommons.org/licenses/by/4.0/ |
17:25:58 | kobi7 | wow very nice |
17:26:14 | FromDiscord | <treeform> its hard of hard to switch between them |
17:26:18 | FromDiscord | <treeform> they don't use common naming theme |
17:26:22 | FromDiscord | <treeform> so its not like a theme you pick |
17:26:34 | FromDiscord | <treeform> once you pick one and use the names you are kind of stuck with it |
17:26:53 | kobi7 | so after export, I only need to modify the generated code for the bindings? |
17:26:58 | FromDiscord | <treeform> Its more like picking theme from theme forest or some thing |
17:27:42 | kobi7 | it does make it simpler for non-designers to do an indie gui work |
17:27:56 | FromDiscord | <enthus1ast> thank you for the insight @treeform very interesting |
17:27:58 | FromDiscord | <treeform> only if it works |
17:27:59 | kobi7 | work = app |
17:28:44 | FromDiscord | <treeform> How I see it is this, say I am a programmer that knows nothing about the complex and rich field of UX. When I make UIs they look crappy. |
17:28:59 | * | supakeen_ is now known as supakeen |
17:29:09 | FromDiscord | <treeform> I go to the figma community, find a theme/app that kind of looks like what I want mine to look like. |
17:29:36 | FromDiscord | <treeform> Copy the file down, follow the license to attribute it... maybe clean it up for my needs. |
17:30:06 | FromDiscord | <treeform> Make the code for my app, but use the visuals from the UX designers so that my app looks "good". |
17:30:21 | FromDiscord | <treeform> No more programmer art and ui from me. |
17:30:40 | kobi7 | sounds like an awesome deal to me |
17:30:42 | FromDiscord | <treeform> Even though I am not good at UX, I get good UX for my apps, because I just copy. |
17:31:33 | kobi7 | when I need more controls though, eiher make it by hand or get from another such kit, and then have to modify all the colors etc to look similar, right? |
17:31:46 | FromDiscord | <treeform> yeah |
17:32:22 | kobi7 | awesome, this changes the usual story, by a lot |
17:32:23 | FromDiscord | <treeform> If you have $ and are a company, you might even reach out to the person that made the original controls and do a deal 🙂 |
17:32:44 | FromDiscord | <treeform> what kind of app thing do you want to make? |
17:32:57 | kobi7 | I'd feel like I'm ripping off and want to give back to that designer |
17:33:09 | FromDiscord | <treeform> well its just like github in a way |
17:33:25 | FromDiscord | <treeform> when you use fidget are you ripping me off? |
17:34:04 | kobi7 | no, but if i had $$ i'd probably donate some as either appreciation or support for dev |
17:34:12 | FromDiscord | <treeform> UX industry finally discovered the magic of open source. |
17:36:27 | kobi7 | I am figuring out if I can make a side income, a work from home kind of thing, in the age of corona limitations. for now, simple frontends, an app that does one thing, and be portable to smart phone (android) and the 3 large oses (linux, mac, windows) |
17:37:03 | FromDiscord | <treeform> If you give me the type of an app you want I might find a theme that will fit. |
17:38:38 | kobi7 | I think it will look like a batch converter type of app. u know, like audio convert, or image resize, audio normalize, markup to doc, all these conversions, probably useful to someone :-) |
17:39:35 | kobi7 | though i haven't done android development before. |
17:39:57 | kobi7 | need to see what UI changes are required, etc. but step by step... |
17:40:42 | kobi7 | In any case, after these answers I feel more hopeful |
17:41:09 | * | vicfred_ quit (Quit: Leaving) |
17:42:47 | * | MightyJoe joined #nim |
17:43:00 | * | skrzyp1 joined #nim |
17:43:54 | * | mal``` joined #nim |
17:44:28 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
17:44:28 | * | xet7 quit (Ping timeout: 265 seconds) |
17:44:29 | * | skrzyp quit (Ping timeout: 265 seconds) |
17:44:29 | * | mal`` quit (Ping timeout: 265 seconds) |
17:45:24 | * | xet7 joined #nim |
17:45:30 | * | asd quit (Ping timeout: 265 seconds) |
17:45:45 | * | asd joined #nim |
17:48:55 | kobi7 | really nice. Thanks treeform, enthusiast. i'm off. |
17:49:02 | * | kobi7 quit (Quit: Leaving) |
18:00:21 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/E06 |
18:01:48 | FromDiscord | <haxscramper> pixie-python just imports generated bindings, without any extra setup, but this does not work for my case (or maybe I missed something) |
18:01:49 | FromDiscord | <treeform> We are fixing that like right now: hardcoded "pixie" |
18:02:24 | FromDiscord | <haxscramper> This requries more than a single fix in the file template? |
18:02:45 | FromDiscord | <haxscramper> I just fixed this, probably missed some other part that had to be edited |
18:02:53 | FromDiscord | <treeform> https://github.com/treeform/genny/pull/26/files |
18:03:22 | FromDiscord | <treeform> I just merged that PR in |
18:03:56 | FromDiscord | <treeform> are you on mac or windows? |
18:04:12 | FromDiscord | <haxscramper> linux |
18:04:16 | FromDiscord | <treeform> you need to have the dll were you .py file is |
18:04:18 | FromDiscord | <haxscramper> and no, the issue still persists |
18:04:21 | FromDiscord | <treeform> or .so in your case |
18:04:34 | FromDiscord | <treeform> `dir = os.path.dirname(sys.modules["test"].file)` |
18:05:01 | * | KainAlive joined #nim |
18:05:19 | * | jjido joined #nim |
18:05:19 | FromDiscord | <treeform> what is the actual error? It looks like your traceback is cut off |
18:06:10 | FromDiscord | <treeform> genny will generate two files .py file and the .so file for your platform. |
18:06:18 | FromDiscord | <treeform> both need to be present next to each other |
18:06:30 | FromDiscord | <haxscramper> https://github.com/treeform/genny/blob/235641dcbecface46d3d472e2dbd08dd231d72b9/src/genny/languages/python.nim#L451 um this is still hardcoded? |
18:06:32 | FromDiscord | <treeform> you might also have to add init.py when going into a folder |
18:06:52 | FromDiscord | <haxscramper> In reply to @treeform "what is the actual": this is the actuall error |
18:07:10 | FromDiscord | <haxscramper> anyway, I will look into more details about all unwritten assumptions python makes |
18:07:36 | FromDiscord | <haxscramper> I just thought it was some me-genny interaction error |
18:08:32 | FromDiscord | <treeform> Your Traceback does not appear to be complete |
18:08:44 | FromDiscord | <treeform> it needs to say what the error was on the last line |
18:08:51 | FromDiscord | <haxscramper> ah,ffs |
18:09:01 | FromDiscord | <haxscramper> anyway, |
18:09:04 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Ar2 |
18:09:38 | FromDiscord | <treeform> ok fixin in real time: https://github.com/treeform/genny/pull/27/files |
18:09:42 | FromDiscord | <treeform> pull and run |
18:10:35 | * | KainAlive quit (Read error: Connection reset by peer) |
18:13:08 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Ar3 |
18:13:29 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Ar4 |
18:13:58 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3Ar3" => "https://play.nim-lang.org/#ix=3Ar5" |
18:15:33 | FromDiscord | <cabboose> If I try to use enums as bitfields I get VM does not support cast from tySet to tyInt32 |
18:17:34 | FromDiscord | <guzba> sent a code paste, see https://play.nim-lang.org/#ix=3Ar7 |
18:18:50 | FromDiscord | <guzba> you'll also need to `pip install .` each time the python changes as i am not aware of a `nimble develop` equiv for python (though there prob is one) |
18:19:01 | FromDiscord | <guzba> (edit) "you'll also need to `pip install .` each time the python changes ... as" added "in the python dir" |
18:20:55 | FromDiscord | <haxscramper> alright, seems like I'm here for quite some time until I try to figure out all of this |
18:21:06 | FromDiscord | <haxscramper> because my python experience is basically non-existent |
18:21:15 | FromDiscord | <treeform> if you have the test script in the same dir as your lib (not ideal) |
18:21:16 | FromDiscord | <treeform> it should work |
18:21:28 | FromDiscord | <haxscramper> I do have this, but it doesn't work |
18:21:48 | FromDiscord | <haxscramper> I showed my directory structure in the last question |
18:22:54 | FromDiscord | <guzba> In reply to @haxscramper "I do have this,": the python set up stuff is annoying to get right, but it is a one-time battle. I suggest matching the pixie-python repo structure as a shortcut |
18:22:57 | FromDiscord | <treeform> hmm sys.modules["genny_main"] might be breaking it |
18:23:03 | FromDiscord | <guzba> (edit) "In reply to @haxscramper "I do have this,": the python set up stuff is annoying to get right, but it is a one-time battle. I suggest matching the pixie-python repo structure as a shortcut ... " added "https://github.com/treeform/pixie-python" |
18:24:10 | FromDiscord | <guzba> you will need to move the generated python out of the nim area into the python directory structure. i do not recommend trying to intermingle |
18:24:53 | FromDiscord | <guzba> sys.modules expects a pip "genny_main" to be located somewhere, which requires the setup.py and `pip install .` on the python repo |
18:25:05 | FromDiscord | <guzba> (edit) "the" => "your" |
18:28:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Arb |
18:28:56 | FromDiscord | <haxscramper> In the end I was planning to take a look at implementing C++ codegen anyway |
18:32:11 | FromDiscord | <treeform> at one point it worked simpler, but python packages require a more complex apporach |
18:32:21 | FromDiscord | <treeform> not our fault 🙂 |
18:33:13 | FromDiscord | <Gumber> Python is the pits |
18:33:39 | FromDiscord | <Gumber> https://media.discordapp.net/attachments/371759389889003532/893203955037900800/python_environment.png |
18:33:59 | FromDiscord | <enthus1ast> thanks to this ^ |
18:34:03 | FromDiscord | <enthus1ast> i found nim |
18:37:57 | FromDiscord | <haxscramper> I mean python is simple and easy to learn language |
18:38:11 | FromDiscord | <haxscramper> not their fault they have 234123123 different ways to import things |
18:38:16 | * | neurocyte0132 joined #nim |
18:38:57 | FromDiscord | <haxscramper> I've spent like 10 minutes trying to figure out why `from generated.test import ` was failing, because I thought I messed up relative imports |
18:39:16 | FromDiscord | <haxscramper> and everything I found were like some random SO answers with ten different code pieces |
18:39:23 | FromDiscord | <haxscramper> and mile-long articles |
18:39:30 | FromDiscord | <haxscramper> that can be summarized on one like |
18:39:53 | FromDiscord | <haxscramper> "hello folks, now we are going to learn how to import shit.py into your crap_pile project" |
18:40:25 | FromDiscord | <haxscramper> wall of text |
18:40:30 | FromDiscord | <enthus1ast> i cannot remember the nitty gritty of module creation in python, but back then i was not able to create a nice (importable) module of my (crap) code back then |
18:40:50 | FromDiscord | <enthus1ast> i had to rewrite large parts of the code |
18:40:57 | FromDiscord | <enthus1ast> then i found nim \:) |
18:43:56 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:48:57 | FromDiscord | <treeform> @haxscramper I am looking forward to what you do with C++ |
19:18:35 | * | jjido joined #nim |
19:31:40 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Aru |
19:33:12 | FromDiscord | <haxscramper> I'm trying to figure out where some generated source code comes from, and it would certainly help someone to try to contribute to improved wrapper generators for a language |
19:34:17 | * | skrzyp1 is now known as skrzyp |
19:40:33 | FromDiscord | <treeform> I don't know how helpful that will be. |
19:40:53 | FromDiscord | <treeform> We already port the doc comments, its pretty easy to figure out where the stuff came from. |
19:41:28 | FromDiscord | <haxscramper> I've spent last half an hour trying to trace back where `def get_data` exactly comes from |
19:41:44 | FromDiscord | <haxscramper> of course I'm new to the code base and all, so |
19:41:53 | FromDiscord | <treeform> genny_main_obj_get_data |
19:41:55 | FromDiscord | <haxscramper> well, I just asked, if you don't think it is useful I wont |
19:42:00 | FromDiscord | <treeform> it somes from MainObj.data |
19:42:15 | FromDiscord | <haxscramper> In reply to @treeform "genny_main_obj_get_data": no, I was talkint about `python/exportProcPy` |
19:42:16 | FromDiscord | <treeform> (edit) "somes" => "comes" |
19:42:23 | FromDiscord | <haxscramper> line 138 and previous |
19:42:44 | FromDiscord | <haxscramper> `genny/src/languages/python.exportProcPy` |
19:43:00 | FromDiscord | <treeform> but most procs come from exportProcPy ? |
19:43:20 | FromDiscord | <treeform> most procs would have `# generated from python.nim:same line` |
19:43:25 | FromDiscord | <haxscramper> i'm not really pushing for it, I just asked |
19:43:39 | FromDiscord | <haxscramper> no means no, I will just keep debugging echos to my tests |
19:43:49 | FromDiscord | <treeform> debuging echos are fine |
19:44:26 | FromDiscord | <treeform> maybe there is value to some sort of verbose output flag |
19:44:35 | FromDiscord | <treeform> but I would have to see it |
19:44:46 | FromDiscord | <treeform> I would not want to ship a file to people with those in |
19:44:49 | FromDiscord | <haxscramper> I was talking about something like this https://media.discordapp.net/attachments/371759389889003532/893221864678236180/unknown.png |
19:45:10 | FromDiscord | <treeform> that could be helpful yes |
19:45:28 | FromDiscord | <treeform> if they can be turned off for final build |
19:45:44 | FromDiscord | <treeform> a python programmer looking at this |
19:45:48 | FromDiscord | <treeform> would have no clue about nim stuff |
19:46:06 | FromDiscord | <treeform> when they just want to use the library |
19:46:34 | FromDiscord | <treeform> brb |
19:48:30 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3Arx |
19:49:04 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3Arx" => "https://play.nim-lang.org/#ix=3ArB" |
19:49:57 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3ArB" => "https://play.nim-lang.org/#ix=3ArF" |
19:54:31 | FromDiscord | <Shoto> I'm curious, has anyone implemented a JRE in Nim? |
20:04:22 | * | jfinkhaeuser quit (Ping timeout: 265 seconds) |
20:04:53 | * | skrzyp quit (Ping timeout: 264 seconds) |
20:04:57 | * | def- quit (Ping timeout: 268 seconds) |
20:05:43 | * | def- joined #nim |
20:06:49 | * | skrzyp joined #nim |
20:06:59 | * | neurocyte01326 joined #nim |
20:06:59 | * | neurocyte01326 quit (Changing host) |
20:06:59 | * | neurocyte01326 joined #nim |
20:08:19 | * | neurocyte0132 quit (Ping timeout: 252 seconds) |
20:08:19 | * | neurocyte01326 is now known as neurocyte0132 |
20:08:40 | FromDiscord | <Yardanico> no |
20:08:49 | FromDiscord | <Yardanico> implementing something like that takes a lot of effort |
20:09:00 | FromDiscord | <Yardanico> In reply to @Shoto Todoroki "I'm curious, has anyone": maybe you just want to interface with Java code? |
20:09:06 | FromDiscord | <Yardanico> https://github.com/yglukhov/jnim |
20:09:09 | nrds | <R2D299> itHub: 7"Nim - Java bridge" |
20:09:37 | * | jfinkhaeuser joined #nim |
20:11:27 | FromDiscord | <Shoto> Nah was just legit curious |
20:12:02 | FromDiscord | <SivadNai> Does anyone use winim a lot? I was trying to adapt one of the examples, but despite what I understood worked from reading the API, i sat back and cried tears as an error appeared onsrceen https://play.nim-lang.org/#ix=3ArL |
20:27:14 | Mister_Magister | how do you initialize array filling it iwth one value? |
20:28:27 | FromDiscord | <haxscramper> You can fill it via loop if you are talkint about `array[N, T]` |
20:28:44 | Mister_Magister | ye but loop seems like overdoing it |
20:28:49 | Mister_Magister | isn't there some fancy dandy wy? |
20:28:51 | Mister_Magister | way* |
20:29:07 | FromDiscord | <haxscramper> `for it in mitems(arr): it = value` |
20:29:07 | nrds | <Prestige99> like init with ints all set to 5 for example? |
20:29:13 | FromDiscord | <haxscramper> not really fancy IMO |
20:29:28 | Mister_Magister | for example |
20:29:29 | FromDiscord | <haxscramper> There is `newSeqWith()`, but that is for `seq[T]` |
20:29:55 | FromDiscord | <haxscramper> `var arr: array[5, int]; for i in mitems(arr): i = 5; echo arr` |
20:30:00 | FromDiscord | <Elegantbeef> If you must make it more complicated `import std/strutils; var myArr: array[100, int]; myArray.applyit(it = 5)` 😀 |
20:30:16 | FromDiscord | <Elegantbeef> No reason to make it more complicated |
20:30:21 | nrds | <Prestige99> sequtils |
20:30:41 | FromDiscord | <haxscramper> quick, patch strutils to have applyit |
20:30:44 | FromDiscord | <Elegantbeef> Yea i'm dumb |
20:30:48 | Mister_Magister | but looping is like |
20:30:56 | Mister_Magister | even in C you can do it |
20:31:02 | FromDiscord | <Elegantbeef> like exactly what happens underneat |
20:31:04 | Mister_Magister | but not in nim |
20:31:07 | FromDiscord | <haxscramper> wel |
20:31:14 | FromDiscord | <Elegantbeef> you can do `array = [5, 5, 5, 5, 5]` |
20:31:17 | FromDiscord | <haxscramper> what do you mean even in C but not in nim |
20:32:12 | nrds | <Prestige99> Seems like newSeqWith is _almost_ what he'd want |
20:32:14 | FromDiscord | <Elegantbeef> To be fair since we left out the `{.noinit.}` we're doing twice the work |
20:32:19 | nrds | <Prestige99> https://nim-lang.org/docs/sequtils.html#newSeqWith.t%2Cint%2Cuntyped |
20:32:22 | Mister_Magister | int array[1000] = {0} |
20:32:25 | Mister_Magister | every element will be 0 |
20:32:48 | FromDiscord | <treeform> @haxscramper I think `types.add &"class {objName}(Structure):" & loc() & "\n"` but be better but up to you |
20:32:50 | Mister_Magister | you don't need to use loop like neanderthal |
20:32:56 | FromDiscord | <haxscramper> we don't have special magic syntax to splice array initialization |
20:33:02 | Mister_Magister | shiet |
20:33:20 | nrds | <Prestige99> it does default to 0 for ints if you were curious |
20:33:25 | Mister_Magister | oh |
20:33:25 | FromDiscord | <Yardanico> @Mister_Magister https://nim-lang.org/docs/algorithm.html#fill%2CopenArray%5BT%5D%2CT |
20:33:29 | nrds | <Prestige99> Is the playground down? |
20:33:29 | Mister_Magister | hmm |
20:33:42 | nrds | <Prestige99> nice Yard |
20:33:43 | FromDiscord | <haxscramper> In reply to @treeform "<@!608382355454951435> I think `types.add": they are literally all `loc("\n")`, so would be unnecessary clutter |
20:33:45 | Mister_Magister | but does it default to 0 with uint8 |
20:33:46 | FromDiscord | <Yardanico> !eval echo "I'm not down" |
20:33:54 | FromDiscord | <Elegantbeef> I mean you can just do `proc newArrayWith[Idx;T](a: array[Idx, T], val: T): array[Idx, T] = for x in mitems(a): x = val` |
20:33:55 | FromDiscord | <Yardanico> @Mister_Magister all value types in nim are zero-initialized |
20:33:58 | nrds | <Prestige99> 🤔 |
20:34:04 | Mister_Magister | ah |
20:34:05 | Mister_Magister | thank |
20:34:09 | FromDiscord | <Yardanico> including uint8 |
20:34:12 | FromDiscord | <Elegantbeef> "all value types" all memory is |
20:34:13 | Mister_Magister | oki |
20:34:32 | Mister_Magister | thank |
20:34:46 | NimBot | Compile failed: <no output> |
20:34:50 | Mister_Magister | just debugging some stuff and slowly going insane |
20:34:55 | FromDiscord | <haxscramper> In reply to @haxscramper "they are literally all": But I"m just testing things around, right now I'm mostly thinking about whether or not I should try to do `template <typename T> struct NimSeq() {}` and related iterator things |
20:34:55 | Mister_Magister | !eval echo "what" |
20:35:20 | FromDiscord | <Yandong Zhang> Hello everyone. I have a large float seq and I am wandering that how to save to a file effectively. In python's numpy, we can use the npy format. |
20:35:45 | FromDiscord | <Yardanico> @Yandong Zhang what do you mean by "effectively"? for binary serialization you can just use https://github.com/treeform/flatty |
20:35:48 | nrds | <R2D299> itHub: 7"Flatty - tools and serializer for plain flat binary files." |
20:35:55 | NimBot | Compile failed: <no output> |
20:36:07 | FromDiscord | <Elegantbeef> The simplest way non third party library way is to open a file stream write the length of the seq then iterate the seq writing each float |
20:36:19 | FromDiscord | <Yandong Zhang> I will try. Thank you |
20:36:45 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/8214#52833 |
20:36:46 | FromDiscord | <Elegantbeef> Otherwise flatty, frosty, or any other file format saving is the best |
20:37:38 | FromDiscord | <Elegantbeef> So hax thanks again for mentioning the proper method of Nimscript interop, finally did get the Nimscript -\> Nim method finished and functioning |
20:37:55 | FromDiscord | <Elegantbeef> Have to do the otherway which will be "fun" |
20:37:58 | FromDiscord | <haxscramper> In reply to @haxscramper "But I"m just testing": `set[T]`, `seq[T]`, probably do something unholy with `mitems` and `items` |
20:38:28 | FromDiscord | <haxscramper> like mutable and immutable iterators over underlying data ... |
20:38:38 | FromDiscord | <haxscramper> I can pause/resume nim iterator evaluation |
20:38:44 | FromDiscord | <haxscramper> I can put then into closure iterators |
20:39:04 | FromDiscord | <haxscramper> but doing this in general case is basically reimplementing CPS transform |
20:39:21 | FromDiscord | <haxscramper> and `try: finally` blocks inside of nim iterators have to be ported somehow maybe |
20:39:44 | FromDiscord | <haxscramper> well, easiest way to get quick internal brain bleeding |
20:40:45 | * | rockcavera quit (Remote host closed the connection) |
20:41:10 | * | rockcavera joined #nim |
20:41:10 | * | rockcavera quit (Changing host) |
20:41:10 | * | rockcavera joined #nim |
20:53:29 | FromDiscord | <Yandong Zhang> I met an error while trying the frosty\: "frosty.nim(1, 11) Error\: cannot open file\: std/genasts |
20:53:38 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:53:41 | FromDiscord | <Yandong Zhang> Can anyone help? |
20:53:55 | FromDiscord | <haxscramper> it seems like you need to use lastest nim devel |
20:54:00 | FromDiscord | <haxscramper> for frosty |
21:15:21 | FromDiscord | <haxscramper> In reply to @haxscramper "`set[T]`, `seq[T]`, probably do": I think the only way to provide `NimSeq<T>` instead of creating billion identically-named-but-actually-different types is to reimplement some part of the nim sequence API in C++ |
21:20:10 | * | beshr quit (Read error: Connection reset by peer) |
21:20:21 | FromDiscord | <Yandong Zhang> sent a long message, see http://ix.io/3As1 |
21:20:21 | FromDiscord | <iffy (Matt Haggard)> I'm attempted to POST to a https://www.google.com address using and AsyncHttpClient and postContent, but I keep getting Additional info\: "Temporary failure in name resolution". I can ping [www.google.com](http://www.google.com) from the machine just fine. What are some other debugging steps I can try? |
21:20:26 | FromDiscord | <Yandong Zhang> It works, though not very efficient. |
22:15:14 | kinkinkijkin | is there a uint4 in nim? I could check but i wanna make sure here |
22:15:26 | * | oprypin quit (Quit: Bye) |
22:15:35 | * | oprypin joined #nim |
22:23:53 | FromDiscord | <Elegantbeef> there is not but you can use bit fields |
22:24:21 | FromDiscord | <Elegantbeef> Assuming you want it in an object |
22:24:40 | kinkinkijkin | might just use uint8 then, just trying to fit colour information for an output interface that only accepts 4 bit colour |
22:24:59 | kinkinkijkin | but has col1 and col2 for every position |
22:25:03 | FromDiscord | <Elegantbeef> You also can do `0u8..(0b1111)u8` |
22:25:34 | FromDiscord | <Elegantbeef> It'd accept values 0-15 that are u8 |
22:26:59 | kinkinkijkin | tbh the codesize penalty might be more than the datasize penalty of using u8 and just limiting 0-15 |
22:28:03 | kinkinkijkin | im trying to make a media creation software to run on a particular device that comes with a max of 32MB ram in its largest configuration |
22:28:58 | kinkinkijkin | not terribly hard considering it's just a tracker and people did this all the time a while back, it's just that id like to assure cleanliness like they would've back when such a size was big |
23:13:07 | * | max22- quit (Remote host closed the connection) |
23:51:37 | * | naquad quit (Ping timeout: 252 seconds) |
23:59:41 | * | Pyautogui joined #nim |