00:01:14 | * | Lord_Nightmare joined #nim |
00:07:23 | * | sagax quit (Remote host closed the connection) |
00:08:34 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3ARo |
00:08:44 | FromDiscord | <el__maco> (edit) "https://play.nim-lang.org/#ix=3ARo" => "https://play.nim-lang.org/#ix=3ARp" |
00:08:57 | FromDiscord | <impbox [ftsf]> echo typeof(slice) |
00:09:23 | FromDiscord | <el__maco> ``seq[int]`` they say |
00:10:49 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/system.html#%5B%5D%2Carray%5BIdx%2CT%5D%2CHSlice%5BU%2CV%5D |
00:29:52 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3ARs |
00:31:32 | FromDiscord | <timotheecour> copied; for sharing you'd need this PR: https://github.com/nim-lang/Nim/pull/14869 (there's also `--experimental:views` but it has documented limitations) |
00:33:45 | FromDiscord | <el__maco> right. Thanks for the answers |
00:35:23 | FromDiscord | <el__maco> I clearly need to think about this a bit more. If slice isn't the right mechanism for what I'm trying to do, and a pointer isn't an option, then what would be the right tool 🤔 |
00:35:41 | FromDiscord | <impbox [ftsf]> @elmaco what are you trying to do? |
00:38:54 | FromDiscord | <el__maco> I have a relatively big two dimensional array, and I need to pick a subarray from it and read values from that |
00:39:31 | FromDiscord | <impbox [ftsf]> why not just read from your original array? |
00:40:54 | FromDiscord | <el__maco> I guess I could do that for now |
00:42:13 | FromDiscord | <impbox [ftsf]> what's the point of the slice? |
00:46:37 | * | Guest40 joined #nim |
00:48:49 | FromDiscord | <el__maco> I'm porting something I made in C(++), where I used a pointer to the array which makes the code much cleaner and probably faster too |
00:52:22 | FromDiscord | <el__maco> instead of saying something like ``big_array[row][col8+0],big_array[row][col8+1],...`` I basically do ``int p=big_array[row]+col8; p[0],p[1],...`` |
00:52:39 | FromDiscord | <impbox [ftsf]> well you can do that in nim if you want, you could also make a view type |
00:53:23 | FromDiscord | <impbox [ftsf]> are you doing graphics surface stuff? |
00:53:40 | FromDiscord | <el__maco> kind of? |
00:54:33 | FromDiscord | <el__maco> I'm trying to evaluate Nim as a potential replacement for hobby projects |
00:54:56 | FromDiscord | <el__maco> started yesterday so I'm not very far yet 😅 |
00:55:01 | * | greaser|q quit (Changing host) |
00:55:01 | * | greaser|q joined #nim |
00:55:04 | * | greaser|q is now known as GreaseMonkey |
00:55:04 | FromDiscord | <impbox [ftsf]> yup, doing a direct port of C++ code to nim is probably not as nice as doing it in a nimmy way |
00:55:13 | FromDiscord | <impbox [ftsf]> but you can just use a pointer for a direct mapping if you like |
00:55:40 | FromDiscord | <el__maco> I was able to obtain the pointer, but I wasn't able to say p[1]. Nim seems to want to only do p[] |
00:55:58 | FromDiscord | <ElegantBeef> Nope the issue is `ptr char` is indexable |
00:56:03 | FromDiscord | <ElegantBeef> (edit) "is" => "isnt" |
00:56:08 | FromDiscord | <ElegantBeef> you want `ptr UncheckedArray[char]` |
00:56:11 | FromDiscord | <impbox [ftsf]> `var p = cast[UncheckedArray[uint8]](myArray)` |
00:56:22 | FromDiscord | <ElegantBeef> it distinguishes pointers for type safety |
00:56:24 | FromDiscord | <impbox [ftsf]> (edit) "cast[UncheckedArray[uint8]](myArray)`" => "cast[ptr UncheckedArray[uint8]](myArray)`" |
00:57:35 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3ARy |
00:57:35 | FromDiscord | <impbox [ftsf]> can also do something like this to make it neater |
00:58:14 | FromDiscord | <impbox [ftsf]> then each index is a whole pixel |
00:58:32 | FromDiscord | <el__maco> seems ptr UncheckedArray might be what I'm looking for. However its 4am now and I really need to sleep so I'll have to return to this tomorrow. Thanks for the tips |
01:02:49 | FromDiscord | <el__maco> I feel like I got pretty far. My code compiles, and once I can figure out how to read png image to an Nim array I can start pulling my hair and debugging why the program isn't doing anything like its supposed to |
01:04:08 | FromDiscord | <impbox [ftsf]> you can check out nimPNG for reading a png |
01:04:35 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3ARF |
01:05:04 | FromDiscord | <el__maco> because writing an image works, I assume I might have the pixels in "data", but the bridge from there to an Nim array is still unclear |
01:06:00 | FromDiscord | <el__maco> might just copy them or something, but that's for tomorrow |
01:06:02 | FromDiscord | <impbox [ftsf]> you might want `{.importc,cdecl.}` |
01:06:12 | Guest40 | Hello everyone, is it possible cross a nim program to the linux version from the windows machine? |
01:07:48 | FromDiscord | <impbox [ftsf]> not familiar with lodepng sorry, but if you want to get up and running quick, i'd recommend using nimPNG |
01:09:15 | FromDiscord | <auxym> Hi, I'm looking into setting up something using rabbitMQ/ZeroMQ/Something similar. Does anyone have experience with something similar in Nim? A good library? |
01:09:18 | FromDiscord | <el__maco> I think that call fills ``w`` and ``h`` with the corresponding values, and ``data`` would be a pointer with wh pixels in it |
01:10:14 | FromDiscord | <impbox [ftsf]> ` error = lodepng_decode32_file(&image, &width, &height, filename);`↵`var error = lodepng_decode32_file(data |
01:14:45 | * | arkurious quit (Quit: Leaving) |
01:21:32 | FromDiscord | <impbox [ftsf]> @elmaco https://gist.github.com/ftsf/99669def17ea8ba0dd57d7fb6ad83ea1 this seems to work |
01:25:45 | FromDiscord | <el__maco> sent a code paste, see https://play.nim-lang.org/#ix=3ARK |
01:26:04 | FromDiscord | <el__maco> now I just have to figure out a way to return a variable sized array somehow 😅 |
01:26:09 | FromDiscord | <ElegantBeef> `seq` |
01:26:17 | FromDiscord | <impbox [ftsf]> there's no variable sized arrays in nim use seqs |
01:26:35 | FromDiscord | <ElegantBeef> Also pixie exists 😛 |
01:26:37 | FromDiscord | <el__maco> ``c`` is the result, and it is a seq |
01:26:51 | FromDiscord | <el__maco> but I'm adding each pixel with c.add 😭 |
01:27:07 | FromDiscord | <impbox [ftsf]> yeah you can precreate the seq as the correct size |
01:27:22 | FromDiscord | <el__maco> how? |
01:28:47 | FromDiscord | <impbox [ftsf]> `result = newSeq[uint8](whchannels)` |
01:30:34 | FromDiscord | <el__maco> I guess I should then return that result from the function instead of the argument by reference |
01:30:45 | FromDiscord | <impbox [ftsf]> it's probably more idiomatic yes |
01:31:13 | FromDiscord | <impbox [ftsf]> though i'd recommend returning an object that includes the width and height |
01:31:25 | FromDiscord | <impbox [ftsf]> so you can reference it correctly after the call |
01:32:09 | FromDiscord | <impbox [ftsf]> you can also make a nice `[]` operator that takes x,y |
01:32:34 | FromDiscord | <impbox [ftsf]> so you can do `echo image[x,y]` instead of `echo image[x+yimage.w]` |
01:33:34 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3ARL |
01:38:17 | * | Guest40 quit (Quit: Client closed) |
01:50:47 | NimEventer | New thread by Treeform: Show Nim: Use Nim code from other languages (genny + pixie-python), see https://forum.nim-lang.org/t/8479 |
01:56:04 | FromDiscord | <impbox [ftsf]> @treeform nice! maybe i'll try with nico |
01:56:07 | * | stkrdknmibalz quit (Ping timeout: 252 seconds) |
01:56:27 | FromDiscord | <Elegantbeef> Impbox will have so much tooling to try with nico in the coming days 😜 |
01:56:42 | FromDiscord | <impbox [ftsf]> \o/ exciting |
01:57:15 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ARO |
01:57:48 | FromDiscord | <Elegantbeef> only downside is if you have overloads you need to explicitly make the alias |
01:58:09 | FromDiscord | <treeform> In reply to @impbox "<@!107140179025735680> nice! maybe i'll": That would be a great project for this. Many people could use the nico. |
01:58:22 | FromDiscord | <impbox [ftsf]> mmm nico uses quite a few overloads, maybe i can get rid of some and replace with default args |
01:58:29 | FromDiscord | <treeform> we support overloads |
01:58:41 | FromDiscord | <Elegantbeef> Well treeform we're talking about two different things 😀 |
01:58:59 | FromDiscord | <treeform> See: https://github.com/treeform/pixie/blob/master/bindings/bindings.nim#L129-L130 |
01:59:20 | FromDiscord | <impbox [ftsf]> @treeform how does that work when exporting to C? |
01:59:25 | FromDiscord | <Elegantbeef> I'm talking about nimscripter which will require more work for supporing overloads |
02:00:17 | FromDiscord | <treeform> In reply to @impbox "<@!107140179025735680> how does that": C gets prefixed with the first arguments type |
02:00:31 | FromDiscord | <treeform> so `draw_image` and `draw_mask` |
02:00:44 | FromDiscord | <treeform> the python thing works with just draw (as python supports overloading kind of) |
02:00:47 | FromDiscord | <Elegantbeef> Suffixed |
02:00:52 | FromDiscord | <impbox [ftsf]> gotcha |
02:00:58 | FromDiscord | <impbox [ftsf]> postprefixed |
02:01:03 | FromDiscord | <treeform> midfixed |
02:01:03 | FromDiscord | <Elegantbeef> Lol |
02:01:22 | * | stutonk joined #nim |
02:01:49 | * | vicfred quit (Quit: Leaving) |
02:04:29 | stutonk | Anyone know what kind of thing I should pass in on the Nim side to receive a callee-allocated array pointer from a wrapped C function? |
02:04:36 | FromDiscord | <Elegantbeef> Emitting a proc with all permutations of typeclasses is fun! |
02:04:47 | * | stkrdknmibalz joined #nim |
02:04:50 | FromDiscord | <Elegantbeef> `ptr UncheckedArray[T]` |
02:05:08 | FromDiscord | <Elegantbeef> Depends on the C proc though |
02:07:31 | stutonk | This is the official Nim binding for Xlib. The proc is XQueryTree. The parameter in question is a `PPWindow` which is a `ptr PWindow` and a PWindow is a `ptr Window`. |
02:09:16 | stutonk | Whatever I try that typechecks crashes with a nil deref |
02:09:40 | FromDiscord | <Elegantbeef> You make some `var yourWindow: PWindow` and pass those into your proc |
02:12:15 | FromDiscord | <Elegantbeef> So for that proc you will do something like https://play.nim-lang.org/#ix=3ARS |
02:14:30 | * | krux02 quit (Quit: Leaving) |
02:20:21 | stutonk | The children part of that doesn't typecheck |
02:24:03 | stutonk | And casting it causes a SIGSEGV |
02:25:11 | FromDiscord | <Elegantbeef> `proc XQueryTree(para1: PDisplay, para2: Window, para3: PWindow, para4: PWindow, para5: PPWindow, para6: Pcuint)` |
02:25:33 | FromDiscord | <Elegantbeef> Without proper output cannot say much |
02:29:53 | stutonk | Right. `ptr UncheckedArray[PWindow]` doesn't typecheck as a `ptr ptr Window` and casting it to one causes a segfault. The compiler also won't let me cast the other way |
02:30:17 | FromDiscord | <Elegantbeef> So use a PPWindow |
02:31:08 | stutonk | I can just create a var of type `PPWindow` but can't do anything with it. I don't know how to cast it so it can be indexed like an array |
02:39:35 | stutonk | And it looks like just using a var of type `PPWindow` in the call at all typechecks but causes a segfault |
02:39:41 | FromDiscord | <retkid> how can i convert seq to an immutable type? |
02:44:08 | stutonk | You mean to an array? Or do you mean to just make a particular seq immutable? |
02:44:38 | FromDiscord | <retkid> i have no preference |
02:44:43 | FromDiscord | <Elegantbeef> `let immSeq = otherSeq` |
02:44:44 | FromDiscord | <retkid> just want my seq to be immutable |
02:44:57 | FromDiscord | <retkid> In reply to @Elegantbeef "`let immSeq = otherSeq`": that works |
02:45:00 | stutonk | Yeah, just use a let binding |
02:45:18 | FromDiscord | <retkid> i thought there would be a more elegant solution |
03:07:17 | FromDiscord | <Elegantbeef> @geekrelief\: We're now at https://play.nim-lang.org/#ix=3ARZ which generates overloads as such https://play.nim-lang.org/#ix=3AS1 |
03:07:37 | FromDiscord | <Elegantbeef> It presently doesnt generate overloads for every single parameter, but eitherway it's nicer |
03:08:53 | FromDiscord | <Elegantbeef> When there is ambiguity one needs to make a procedure now, which makes it a tinge better, but ideally all of those symbols would get caught/exported |
03:13:47 | FromDiscord | <retkid> normally i dont like oop |
03:13:51 | FromDiscord | <retkid> java kinda ruined it fo me |
03:13:52 | FromDiscord | <retkid> (edit) "fo" => "for" |
03:14:13 | stutonk | Alright, Elegantbeef. I figured it out. It looks like the solution was to use a var of type `PWindow` and then calling the function with `ppwVar.addr` For some reason, directly using a `ptr ptr` segfaults. Then I can cast to a `ptr UncheckedArray[Window] and it works as expected. Thank you for your help |
03:14:15 | FromDiscord | <retkid> but when I do it in Nim, i feel like "woah this actually makes sense" |
03:14:22 | FromDiscord | <Elegantbeef> But nim isnt oop |
03:14:31 | FromDiscord | <retkid> you can do oop in nim |
03:14:32 | FromDiscord | <cabboose> HERETIC |
03:14:36 | FromDiscord | <cabboose> HERETIC |
03:14:52 | FromDiscord | <cabboose> Nah kidding. What do you mean by oop in nim though |
03:15:05 | FromDiscord | <retkid> type x = ref object of RootObj |
03:15:08 | FromDiscord | <Elegantbeef> I mean you can do OOP in Nim, and it's not too different to Java if you arent using interfaces and the like |
03:15:11 | FromDiscord | <retkid> is technically oop |
03:15:25 | FromDiscord | <retkid> yes but in Java it sucksa |
03:15:28 | FromDiscord | <retkid> and in Nim it makes sesne |
03:15:31 | FromDiscord | <retkid> (edit) "sesne" => "sense" |
03:15:43 | FromDiscord | <retkid> like for example |
03:15:46 | FromDiscord | <cabboose> Definitely covers inheritance to a degree and dynamic dispatching |
03:17:50 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3AS3 |
03:18:15 | FromDiscord | <retkid> i prefer nim here |
03:18:17 | stutonk | It's simpler because Nim objects don't encapsulate behavior. They're basically syntactic sugar over C structs |
03:18:20 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=3AS3" => "https://play.nim-lang.org/#ix=3AS4" |
03:18:29 | FromDiscord | <retkid> well yea i was about to point out |
03:18:36 | FromDiscord | <retkid> i dont like how methods aren't in the class body |
03:18:43 | FromDiscord | <retkid> it looks strange to me |
03:19:21 | FromDiscord | <retkid> I'd probably like it if they did what Kotlin does with reflections |
03:19:27 | stutonk | Yeah, it's a lot like Common Lisp's generic functions |
03:19:49 | FromDiscord | <Elegantbeef> There are a multitude of macros that give class like declaration |
03:19:56 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3AS5 |
03:21:07 | FromDiscord | <retkid> In reply to @stutonk "Yeah, it's a lot": been thinking about learning a lisp dialect |
03:21:10 | FromDiscord | <retkid> like racket |
03:21:49 | stutonk | Racket is pretty sweet. Especially for experimental programming |
03:24:48 | FromDiscord | <retkid> Clojure looks disgusting |
03:26:12 | stutonk | It's actually also pretty nice once you wrap your head around the level of immutability it imposes. The only thing really painful about it is the error messages and some of the namespacing stuff |
03:26:38 | FromDiscord | <retkid> yea |
03:26:42 | FromDiscord | <retkid> that looks not fun |
03:26:58 | stutonk | Nim is right there in the sweetspot of compiler magic and helpful type system though |
03:27:13 | FromDiscord | <retkid> I solve all my problems with lists and arrayas |
03:27:15 | FromDiscord | <retkid> (edit) "arrayas" => "arrays and sets" |
03:27:38 | FromDiscord | <retkid> if I go to a functional programming language I'll learn stuff but I dunno if i want to learn that lession lol |
03:29:45 | stutonk | What lesson do you mean? |
03:30:51 | FromDiscord | <retkid> about solving problems with immutability \ |
03:31:53 | stutonk | In the S-expression languages it's pretty natural. You don't even notice you're doing it |
03:33:06 | stutonk | The only real hurdle there is just understanding how recursion works |
03:35:01 | stutonk | And really, there are functions that simplify most iteration tasks like `map` and `fold` |
03:36:28 | stutonk | And in Clojure they have the threading macros for threading a piece of data through a sequence of functions |
03:40:44 | FromDiscord | <NullCode> man it still takes me too long to do simple nim things |
03:41:20 | FromDiscord | <NullCode> took me 40 minutes to make a proc that returns battery percentage |
03:42:02 | stutonk | Is that on a *Nix system? |
03:44:33 | FromDiscord | <NullCode> win |
03:45:42 | stutonk | Is there some kind of complicated API for it on Windows? On Linux all you have to do is read from a specific file |
03:46:48 | FromDiscord | <NullCode> yeah on nix it's really easy |
03:46:53 | FromDiscord | <NullCode> on win is easy too tbh |
03:47:19 | FromDiscord | <NullCode> you just need to extract battery percentage from a command output |
03:47:27 | FromDiscord | <NullCode> `WMIC PATH Win32_Battery Get EstimatedChargeRemaining` |
03:47:43 | stutonk | What was difficult doing it with Nim? |
03:49:14 | FromDiscord | <NullCode> nothing at all |
03:49:18 | FromDiscord | <NullCode> it's just, I'm an idiot |
03:49:36 | FromDiscord | <NullCode> and still can't memorize what the regex procs do |
03:49:43 | FromDiscord | <NullCode> (edit) "regex" => "important" |
03:49:46 | FromDiscord | <Elegantbeef> Easy dont use regex |
03:49:53 | FromDiscord | <NullCode> i need to dig around docs everytime i wanna do something |
03:50:11 | FromDiscord | <NullCode> mainly os, (str|seq)utils and regex |
03:50:14 | FromDiscord | <NullCode> In reply to @Elegantbeef "Easy dont use regex": lmao |
03:50:30 | FromDiscord | <NullCode> (edit) "os," => "os(proc)," |
03:50:35 | FromDiscord | <NullCode> what do i do then |
03:51:00 | FromDiscord | <Elegantbeef> I generally use scanf from strscans |
03:51:03 | FromDiscord | <NullCode> can't think of easier way than `findAndCaptureAll(output, reg_string).join()` |
03:51:15 | FromDiscord | <NullCode> In reply to @Elegantbeef "I generally use scanf": and here i am having no idea about strscans |
03:51:17 | FromDiscord | <NullCode> wait lemme see docs |
04:00:21 | * | stutonk quit (Quit: Client closed) |
04:05:23 | * | Terry[m] is now known as Theodore[m] |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:28 | FromDiscord | <NullCode> i have arrived after reading docs |
04:06:31 | * | supakeen joined #nim |
04:06:34 | FromDiscord | <NullCode> and my head is still spinning |
04:06:59 | FromDiscord | <Elegantbeef> It's just a regex alternative for simple string -\> variables |
04:07:17 | FromDiscord | <NullCode> yeah i think i can use it now |
04:08:30 | FromDiscord | <NullCode> btw question about strscans |
04:08:44 | FromDiscord | <NullCode> do i have to copy the entire string to match the vals i need |
04:08:47 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/894798245916729374/unknown.png |
04:09:09 | FromDiscord | <Elegantbeef> Yea for somethings |
04:09:16 | FromDiscord | <NullCode> like do "EstimatedChargeRemaining$i$i" |
04:09:25 | FromDiscord | <NullCode> because then it might not work |
04:09:27 | FromDiscord | <Elegantbeef> well just one `$i` |
04:09:32 | FromDiscord | <NullCode> oh |
04:09:38 | FromDiscord | <NullCode> (edit) ""EstimatedChargeRemaining$i$i"" => "`"EstimatedChargeRemaining$i$i"`" |
04:09:47 | FromDiscord | <NullCode> ok then all good |
04:19:11 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/894800862998831136/unknown.png |
04:19:13 | FromDiscord | <NullCode> uhh what |
04:19:33 | FromDiscord | <NullCode> should be 77 |
04:19:34 | FromDiscord | <impbox [ftsf]> is there a reason you're posting screenshots of text? |
04:19:36 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/894800967663505418/unknown.png |
04:19:40 | FromDiscord | <impbox [ftsf]> just post the text |
04:19:48 | FromDiscord | <NullCode> In reply to @impbox "is there a reason": idk lmfao |
04:19:57 | FromDiscord | <NullCode> didn't even notice i was sending screenshots of text |
04:20:01 | FromDiscord | <Elegantbeef> yo ucan jusut do `result` instead of \`life |
04:20:20 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3AS8 |
04:20:29 | FromDiscord | <NullCode> In reply to @Elegantbeef "yo ucan jusut do": alright |
04:20:59 | FromDiscord | <impbox [ftsf]> if the if passing? |
04:21:19 | FromDiscord | <impbox [ftsf]> (edit) "if" => "is" |
04:22:05 | FromDiscord | <NullCode> In reply to @Elegantbeef "yo ucan jusut do": `Error: type mismatch: got <bool> but expected 'int'` |
04:22:14 | FromDiscord | <NullCode> doing the if statement is better |
04:22:21 | FromDiscord | <NullCode> In reply to @impbox "is the if passing?": i think so |
04:22:28 | FromDiscord | <NullCode> wait i forgot doing something important |
04:22:33 | FromDiscord | <Elegantbeef> `discard scanf()` |
04:22:59 | FromDiscord | <impbox [ftsf]> well it might fail, so you shouldn't discard it |
04:23:28 | FromDiscord | <Elegantbeef> If it fails it'll be `0` so it's up to you |
04:23:47 | FromDiscord | <impbox [ftsf]> but it could also actually be 0 |
04:23:56 | FromDiscord | <NullCode> In reply to @impbox "but it could also": yes |
04:24:24 | FromDiscord | <NullCode> why is it 0 and not 80 |
04:24:26 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3ASb |
04:24:40 | FromDiscord | <NullCode> here's what I'm doing |
04:24:42 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3ASc |
04:25:12 | FromDiscord | <NullCode> I'm just wondering if i should use regex instead |
04:25:15 | FromDiscord | <Elegantbeef> there is a space |
04:25:21 | FromDiscord | <NullCode> oh |
04:25:23 | FromDiscord | <NullCode> siht |
04:25:26 | FromDiscord | <NullCode> (edit) "siht" => "shit" |
04:25:33 | FromDiscord | <Elegantbeef> I mean you can use regex if you want |
04:26:02 | FromDiscord | <NullCode> now that i yeeted the space |
04:26:03 | FromDiscord | <NullCode> fixed |
04:26:04 | FromDiscord | <NullCode> thanks a lot |
04:26:07 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3ASd |
04:26:12 | FromDiscord | <NullCode> In reply to @Elegantbeef "I mean you can": nah ill keep using this |
04:26:39 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3ASe |
04:26:57 | FromDiscord | <impbox [ftsf]> (edit) "https://play.nim-lang.org/#ix=3ASe" => "https://play.nim-lang.org/#ix=3ASf" |
04:28:01 | FromDiscord | <NullCode> hmm yeah that works |
04:28:29 | FromDiscord | <NullCode> are there any benefits to doing `std/strscans` |
04:28:35 | FromDiscord | <impbox [ftsf]> it makes beef happy |
04:28:55 | FromDiscord | <NullCode> alright making beef happy too |
04:29:34 | FromDiscord | <impbox [ftsf]> it makes sure it imports from the standard library, even if you had a local file called strscans.nim it'd use the standard library one |
04:33:12 | FromDiscord | <cabboose> Also new std library modules will enforce that iirc |
04:33:36 | FromDiscord | <cabboose> Like setutils will need the std prefix |
04:35:36 | FromDiscord | <NullCode> bruh |
04:35:54 | FromDiscord | <NullCode> ig I'm gonna put std/ on every built in lib then |
04:36:10 | FromDiscord | <impbox [ftsf]> beef is gonna be so happy |
04:36:47 | FromDiscord | <NullCode> XD |
04:37:15 | * | Guest20 joined #nim |
04:37:21 | FromDiscord | <NullCode> sent a long message, see http://ix.io/3ASg |
04:37:35 | * | Guest20 quit (Client Quit) |
04:37:41 | FromDiscord | <impbox [ftsf]> `"EstimatedChargeRemaining$s$i"` |
04:37:43 | FromDiscord | <NullCode> (edit) "http://ix.io/3ASg" => "http://ix.io/3ASh" |
04:38:01 | FromDiscord | <impbox [ftsf]> `$s Skips optional whitespace.` |
04:38:14 | FromDiscord | <NullCode> thats faster? |
04:38:16 | FromDiscord | <NullCode> amazing |
04:38:26 | FromDiscord | <NullCode> man i still have so much to learn from nim |
04:38:26 | FromDiscord | <impbox [ftsf]> very likely faster than doing a string replace |
04:38:30 | FromDiscord | <NullCode> it's kinda depressing |
04:38:38 | FromDiscord | <NullCode> In reply to @impbox "very likely faster than": i see |
04:38:39 | FromDiscord | <impbox [ftsf]> lots to learn means lots of fun to be had |
04:39:50 | FromDiscord | <impbox [ftsf]> string replace is relatively expensive |
04:40:34 | FromDiscord | <impbox [ftsf]> but likely none of this will matter for your use case unless you're doing stuff for realtime |
04:40:41 | * | rockcavera quit (Remote host closed the connection) |
04:41:24 | FromDiscord | <NullCode> I'm planning on making an exe that runs in background |
04:41:31 | FromDiscord | <NullCode> and shouts at you when battery is toolow |
04:41:35 | FromDiscord | <NullCode> (edit) "toolow" => "too low" |
04:41:48 | FromDiscord | <NullCode> (it's a personal project because my laptop keeps shutting down at 5%) |
04:42:09 | FromDiscord | <impbox [ftsf]> yaa, just remember, optimise later when you need to |
04:42:17 | FromDiscord | <NullCode> yup |
04:42:24 | FromDiscord | <impbox [ftsf]> as long as it works ( '')b |
04:44:41 | FromDiscord | <NullCode> well it needs to be fast too :D |
04:46:11 | FromDiscord | <impbox [ftsf]> works and slow is better than not working at all, can always make it faster later |
04:49:13 | FromDiscord | <NullCode> unless you're an idiot who knows only 5% of a language lmfao |
04:54:41 | * | User11 joined #nim |
04:57:30 | * | dongbei joined #nim |
05:00:17 | dongbei | hiya, i'm trying to figure out how to use a .so library compiled from a .cpp in nim. when I used c2nim on the header file it generated a bunch of `discard "foward declaration of blah"` for a struct blah. the .so has the definition but I don't know how to bring it in. |
05:01:44 | dongbei | every time I try to compile my server.nim file i get the compiler error "Error: undeclared identifier: 'blah'" |
05:02:28 | dongbei | does anyone have experience with getting c libraries into a nim prog? |
05:15:33 | FromDiscord | <retkid> so |
05:15:44 | FromDiscord | <retkid> i have imports which are conflicting |
05:15:52 | FromDiscord | <retkid> (edit) "are" => "has" | "hasconflicting ... " added "variables" |
05:15:57 | FromDiscord | <retkid> json, and tables |
05:16:10 | FromDiscord | <retkid> .keys on a table returns the json version... |
05:16:20 | FromDiscord | <retkid> whats the solution for this |
05:19:50 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3ASp |
05:19:59 | FromDiscord | <retkid> (edit) "https://play.nim-lang.org/#ix=3ASp" => "https://play.nim-lang.org/#ix=3ASq" |
05:20:09 | FromDiscord | <Elegantbeef> keys is an iterator so that's just bad usage |
05:20:16 | FromDiscord | <retkid> wait yea i just noticed that |
05:20:19 | FromDiscord | <retkid> lets see |
05:21:23 | FromDiscord | <retkid> the only reason it wasn't red when i removed Json was because everything else was red 🤦♀️ |
05:29:23 | FromDiscord | <impbox [ftsf]> @dongbei you'll need to wrap the cpp header to expose the procs to nim |
05:29:42 | FromDiscord | <impbox [ftsf]> c2nim might do that for you, but you might be better of doing it by hand |
05:29:48 | FromDiscord | <impbox [ftsf]> or at least tweaking the output |
05:50:30 | * | kaliyuga_ joined #nim |
05:50:30 | * | User11 quit (Read error: Connection reset by peer) |
05:51:18 | * | kaliyuga_ quit (Client Quit) |
06:02:13 | FromDiscord | <geekrelief> In reply to @Elegantbeef "<@109484839480107008>\: We're now at": I'm a little confused with what the output https://play.nim-lang.org/#ix=3AS1 is supposed to mean. How do the procs with `discard` get implemented? |
06:02:56 | FromDiscord | <Elegantbeef> Those are implemented by the Nim binary |
06:03:23 | FromDiscord | <Elegantbeef> When you call `loadScript` |
06:03:54 | FromDiscord | <Elegantbeef> They need a body for obvious reasons but the VM overrides their functionality on load |
06:04:04 | FromDiscord | <Elegantbeef> So a simple `discard` works |
06:04:09 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Those are implemented by": I'm not sure I follow. What's the Nim binary you're talking about? |
06:04:19 | FromDiscord | <Elegantbeef> The binary you're scripting |
06:04:44 | FromDiscord | <Elegantbeef> `implNimscriptModule` generates a list of the VM procs + overriding logic |
06:04:56 | FromDiscord | <geekrelief> So in the samples script only 4 procs work? |
06:05:04 | FromDiscord | <geekrelief> `background`, `stroke`, etc. |
06:05:43 | FromDiscord | <Elegantbeef> No all the procs work, the ones with discard are implemented in the VM by code generated with `implNimscriptModule` |
06:06:09 | FromDiscord | <Elegantbeef> It's all an implementation detail that no one will see unless they name procs similarly |
06:06:38 | FromDiscord | <geekrelief> ok, I guess I'll trust it just works. I'll have to read your code to understand what's going on. |
06:06:53 | FromDiscord | <geekrelief> But implNimscriptModule does all the magic I guess. |
06:07:18 | FromDiscord | <geekrelief> nice work! |
06:17:40 | NimEventer | New thread by Xflywind: Contribution-friendly issues for Hacktoberfest 2021, see https://forum.nim-lang.org/t/8480 |
06:19:55 | FromDiscord | <Elegantbeef> Fun, got the generating code for properties done, now global variables can be used in `exportTo` block |
06:20:10 | FromDiscord | <geekrelief> In reply to @Elegantbeef "No all the procs": nice! |
06:20:23 | FromDiscord | <geekrelief> I skimmed over the code for `expose.nim` |
06:20:30 | FromDiscord | <Elegantbeef> But there is a reprocudable bug on the call due to dumb stuff i'm doing |
06:20:35 | FromDiscord | <Elegantbeef> Yea i know it needs comments 😛 |
06:20:35 | FromDiscord | <geekrelief> I'll have to play with this more tomorrow |
06:21:14 | FromDiscord | <geekrelief> no worries. I've gotten used to reading code without comments though. |
06:21:39 | FromDiscord | <geekrelief> I'll just bug you if there's something I don't understand. 😄 |
06:22:16 | FromDiscord | <geekrelief> heading to bed g'night |
06:22:22 | FromDiscord | <Elegantbeef> Buh bye |
06:30:59 | * | neurocyte013288 joined #nim |
06:30:59 | * | neurocyte013288 quit (Changing host) |
06:30:59 | * | neurocyte013288 joined #nim |
06:53:09 | FromDiscord | <NullCode> question |
06:53:13 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/894839629260419114/unknown.png |
06:53:21 | FromDiscord | <NullCode> how to safely exit after getting SIGINT |
06:53:42 | * | jjido joined #nim |
06:56:18 | Amun-Ra | NullCode: https://nim-lang.org/docs/system.html#setControlCHook |
06:56:35 | Amun-Ra | also: https://rosettacode.org/wiki/Handle_a_signal#Nim |
06:58:16 | FromDiscord | <NullCode> thamk |
07:05:50 | FromDiscord | <Mike> Hey, if anyone is awake\: is there a way for me to do something like `readChar(stdin)`, but not line buffered? |
07:06:30 | FromDiscord | <Mike> As in I want to get the character that a user types immediately and not have to wait for a newline |
07:06:47 | FromDiscord | <Elegantbeef> `terminal.getch`? |
07:07:17 | FromDiscord | <Elegantbeef> that blocks until a character is entered, not sure that's what you want either though |
07:07:46 | FromDiscord | <Mike> No that is actually what I want |
07:08:16 | FromDiscord | <Mike> That's perfect, thank you ❤️ |
07:08:42 | FromDiscord | <Elegantbeef> No problem |
07:23:14 | FromDiscord | <NullCode> nice I've arrived to the part where i wanna play some audio |
07:23:55 | * | max22- joined #nim |
07:26:08 | * | PMunch joined #nim |
07:38:35 | * | max22- quit (Ping timeout: 246 seconds) |
07:43:47 | * | TechAspirer is now known as kayabaNerve |
07:45:15 | * | pro joined #nim |
07:46:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:54:56 | * | Vladar joined #nim |
07:59:55 | FromDiscord | <haxscramper> Is casting `set[I]` to unsigned integers considered an implementation detail exploitation, or this is an acceptable way to interface with C's `unsigned int flags` for passing multiple enum values at once? |
08:00:40 | FromDiscord | <Elegantbeef> I'd say it's acceptable, given the logic of how sets work |
08:01:25 | FromDiscord | <Elegantbeef> Bitsets afterall are just human friendly abstractions ontop of bitwise ops |
08:02:26 | * | pro quit (Quit: WeeChat 3.3) |
08:05:51 | NimEventer | New Nimble package! feta - A domain-specific for general purpose office automation. The language is embedded in Nim and allows for quick and easy integration of different office software environments., see https://github.com/FlorianRauls/office-DSL-thesis |
08:05:54 | nrds | <R2D299> itHub: 7"2021 Bachelor Thesis repository for development of an office automatization DSL in Nim" |
08:08:44 | * | sagax joined #nim |
08:12:39 | * | kayabaNerve quit (*.net *.split) |
08:12:40 | * | FromDiscord quit (*.net *.split) |
08:12:40 | * | Freneticks quit (*.net *.split) |
08:12:40 | * | mst quit (*.net *.split) |
08:24:23 | * | kayabaNerve joined #nim |
08:24:23 | * | FromDiscord joined #nim |
08:24:23 | * | Freneticks joined #nim |
08:24:23 | * | mst joined #nim |
08:54:11 | * | max22- joined #nim |
08:59:55 | FromDiscord | <kunitoki> Hey there ! I've tried registering multiple times with different email addresses in the forum but i keep not getting the confirmation emails so i cannot post. And now i run out of email addresses... Anything can be done ? |
09:01:03 | FromDiscord | <kunitoki> in some cases my user is even broken, can't login. keep getting unknown error in the login page |
09:02:36 | FromDiscord | <xflywind> In reply to @kunitoki "Hey there ! I've": You may contact with @dom96 or other admins. |
09:02:57 | FromDiscord | <xflywind> (edit) "admins." => "admins of Nim forum." |
09:13:58 | FromDiscord | <enthus1ast> sent a long message, see https://paste.rs/fQJ |
09:15:03 | FromDiscord | <enthus1ast> i've build the libhydrogen normally with their makefile, and also with their cmake/make |
09:18:51 | FromDiscord | <dom96> In reply to @flywind "You may contact with": make sure to ask people for their nick, that way I can immediately fix it |
09:18:58 | FromDiscord | <dom96> instead of asking for their nick 🙂 |
09:24:08 | PMunch | Well this is annoying. I get an error from macros saying an identifier isn't defined, but outputting the `repr` and then importing that as a file works just fine.. |
09:27:51 | FromDiscord | <enthus1ast> when i look with objdump -t ↵all the functions are there... https://gist.github.com/enthus1ast/8b8660989eac3d8ccb23978e1f852969 |
09:32:00 | FromDiscord | <Varriount> In reply to @PMunch "Well this is annoying.": Sounds like a compiler bug then. |
09:32:08 | PMunch | Yeah probably |
09:34:08 | FromDiscord | <enthus1ast> mhh i got it working |
09:34:18 | FromDiscord | <enthus1ast> i've linked from the commandline |
09:34:28 | FromDiscord | <enthus1ast> not from the wrapper pragma |
09:35:11 | FromDiscord | <Varriount> I wonder how well something like dependency injection could be done with Nim macros. I've been looking at https://python-dependency-injector.ets-labs.org/ for use in something at work, and the concept struck me as one that Nim could possibly do quite well. |
09:43:49 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
09:44:08 | * | Gustavo6046 joined #nim |
09:48:11 | PMunch | New version of Futhark: https://github.com/pmunch/futhark it now supports a wide range of #DEFINE statements and the renaming scheme is vastly improved |
09:48:13 | nrds | <R2D299> itHub: 7"Automatic wrapping of C headers in Nim" |
09:53:41 | * | dongbei quit (Quit: leaving) |
09:57:18 | FromDiscord | <impbox [ftsf]> i always read that lib's name as fthat, and it makes snse because that's what I think about having to writing C wrappers. |
09:57:21 | FromDiscord | <impbox [ftsf]> (edit) "writing" => "write" |
10:00:58 | PMunch | Hmm, I think the renaming is a bit messed up in the new version.. |
10:01:02 | PMunch | Damn it |
10:01:04 | FromDiscord | <Rika> I keep on reading “fut hark” |
10:02:58 | PMunch | That would be pretty close to how you're supposed to pronounce it |
10:03:34 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ATn |
10:03:42 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ATo |
10:04:11 | FromDiscord | <haxscramper> Version string is not guaranteed to be stable, but I don't think they will break it so drastically any time sonn |
10:04:20 | FromDiscord | <haxscramper> So for C compiler include paths I use this |
10:04:40 | PMunch | The problem is though that we don't know if they're compiling against clang or GCC |
10:04:50 | PMunch | Or even if they are on Linux for that matter.. |
10:05:13 | FromDiscord | <haxscramper> You can do additional heuristics and checks |
10:05:38 | FromDiscord | <haxscramper> ah, and by they way, do you generate fully hardcoded include paths? |
10:06:17 | FromDiscord | <haxscramper> Like, it does not really matter what compiler they use if you cut down wrappers before they reach into things like `bits/features.h` or `bits/endian.h` |
10:06:30 | FromDiscord | <haxscramper> And if you are in the library wrappers it is all the same |
10:17:19 | PMunch | I basically just feed those paths to clang and then query clang for the types in the original files I wanted to include |
10:17:51 | PMunch | So if there are some differences in those file it might bubble up. But I haven't noticed any issues with cross-using the headers yet |
11:07:28 | * | krux02 joined #nim |
11:11:37 | FromDiscord | <Goel> So into a proc, since i can't write `else: break` to end a loop if the earliers conditions are not met, using `else: return` does the same? |
11:14:57 | FromDiscord | <Rika> You can break a loop |
11:15:10 | FromDiscord | <Rika> What’s the full picture |
11:15:29 | FromDiscord | <NullCode> can you break an if else tho |
11:15:37 | FromDiscord | <NullCode> I don't know about that |
11:16:52 | FromDiscord | <NullCode> (edit) "don't know about that" => "said previously was stupid" |
11:18:43 | FromDiscord | <Rika> BRB checking irc to read what you said |
11:24:51 | FromDiscord | <NullCode> alright |
11:25:05 | FromDiscord | <NullCode> wait, you can check in irc if discord users edit message? |
11:25:06 | FromDiscord | <NullCode> oh NO |
11:25:31 | FromDiscord | <Rika> Of course |
11:26:03 | FromDiscord | <NullCode> too bad |
11:26:29 | FromDiscord | <Rika> > break an if else↵Bruh |
11:26:29 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3ATR |
11:26:32 | FromDiscord | <NullCode> ive sent shit i wasnt meant to in another irc bridge server |
11:26:41 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
11:26:44 | FromDiscord | <NullCode> In reply to @Rika "> break an if": yeah totally stupid |
11:26:50 | FromDiscord | <Rika> sent a code paste, see https://paste.rs/5rj |
11:26:59 | FromDiscord | <NullCode> now delete thanks |
11:27:23 | FromDiscord | <Goel> What do you mean there is not loop? |
11:27:32 | FromDiscord | <NullCode> if else aint a loop |
11:27:37 | FromDiscord | <NullCode> it's a condition statement |
11:27:47 | FromDiscord | <NullCode> and also, try `else: discard` |
11:28:00 | FromDiscord | <NullCode> it works for me (although idk about loops) |
11:28:05 | FromDiscord | <NullCode> (edit) "loops)" => "procs)" |
11:28:22 | FromDiscord | <Rika> Did you know that you’re not required to put an else |
11:28:43 | FromDiscord | <Rika> Else discard is equivalent to not having an else section |
11:28:56 | FromDiscord | <Goel> Nope doesn't work with else: discard, and if i delete the `else` doesn't work either as expected |
11:29:12 | FromDiscord | <Goel> Only works with `else: return` |
11:29:26 | FromDiscord | <NullCode> well whatever works for you |
11:29:53 | FromDiscord | <NullCode> btw |
11:29:59 | FromDiscord | <NullCode> how can i play an audio file using nim |
11:30:22 | FromDiscord | <NullCode> https://gist.github.com/zacharycarter/846869eb3423e20af04dea226b65c18f |
11:30:26 | FromDiscord | <NullCode> hmm just found this |
11:31:06 | FromDiscord | <Goel> https://nimble.directory/search?query=audio+player |
11:31:59 | FromDiscord | <NullCode> oh shit I've never seen nimble.directory |
11:32:01 | FromDiscord | <NullCode> this is cool |
11:33:55 | FromDiscord | <Goel> Oh yes it is, bookmark it immediatly! :nimble: |
11:37:39 | FromDiscord | <Rika> Honestly I just search on GitHub or other hubs because there’s a lot of stuff not on nimble |
11:40:00 | FromDiscord | <NullCode> yeah I've been searching on github too |
11:40:12 | FromDiscord | <NullCode> but I don't know, it's a lil cumbersome |
11:40:18 | FromDiscord | <NullCode> having to hit next page every now and again |
11:40:29 | FromDiscord | <NullCode> sometimes, a shorter list is better |
11:40:36 | FromDiscord | <Rika> Isn’t it the same issue on the directory |
11:40:44 | FromDiscord | <Rika> You can filter by language in GitHub |
11:41:44 | FromDiscord | <NullCode> i don't see a next page on directory |
11:41:45 | FromDiscord | <NullCode> so yeah |
11:41:52 | FromDiscord | <NullCode> lemme search for something a lil more vague |
11:42:18 | FromDiscord | <NullCode> nope |
11:42:22 | FromDiscord | <NullCode> everything''s inside a single page |
11:42:27 | FromDiscord | <NullCode> (edit) "everything''s" => "everything's" |
11:42:35 | FromDiscord | <NullCode> thats one of the things i love about nim docs |
11:45:21 | FromDiscord | <Rika> Eh some people aren’t a fan of infinite scroll |
11:46:05 | FromDiscord | <NullCode> why not |
11:46:14 | FromDiscord | <NullCode> just control f on one page only |
11:48:21 | FromDiscord | <tbrekalo> how can I return string view from a function? |
11:48:37 | FromDiscord | <enthus1ast> when a c function gets an array, it must be a ptr right? ↵Do i need to do this in nim as well? (so addr arr[0]) or is this handled automatically? |
11:48:38 | FromDiscord | <NullCode> string view? |
11:49:30 | FromDiscord | <tbrekalo> let str = "aabbcc"↵and I want to return from a funciton str[2 .. 4] without making a copy of data |
11:51:44 | FromDiscord | <auxym> nim has copy semantics. why do you want to do this? |
11:51:49 | FromDiscord | <Rika> In reply to @NullCode "why not": If the page unloads you lose your position |
11:51:51 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3ATX |
11:52:05 | FromDiscord | <NullCode> In reply to @Rika "If the page unloads": just control f there again |
11:52:08 | FromDiscord | <enthus1ast> afaik this is a copy↵(@NullCode) |
11:52:13 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3ATZ |
11:52:16 | FromDiscord | <NullCode> oh |
11:52:21 | FromDiscord | <auxym> afaik also |
11:52:41 | FromDiscord | <Rika> Why do you want no copies? |
11:52:49 | FromDiscord | <tbrekalo> large amounts of data |
11:53:00 | FromDiscord | <Rika> There are experimental views afaik |
11:53:07 | FromDiscord | <enthus1ast> i'm not aware of a build in way, but i know there was a discussion about this somewhere on github, you could however build it yourself for your usecase |
11:53:38 | FromDiscord | <tbrekalo> I saw the view experimental feature; wondering was there a standard way of doing it |
11:53:44 | FromDiscord | <tbrekalo> without experimental features |
11:54:13 | FromDiscord | <tbrekalo> but I have a large string and I need to format it that after each 80 chars comes a new line in the output |
11:54:39 | FromDiscord | <Rika> https://nim-lang.org/docs/manual_experimental.html#view-types ? |
11:54:45 | FromDiscord | <Rika> No |
11:54:57 | FromDiscord | <Rika> You can do it in an unsafe way |
11:55:03 | FromDiscord | <Rika> Non experimental but still unsafe |
11:55:18 | * | max22- quit (Ping timeout: 268 seconds) |
11:55:28 | FromDiscord | <auxym> what is "large"? Are you sure copies are really a problem? If so could you just return indices into it or something like that, instead of a view? |
11:55:29 | FromDiscord | <Rika> In reply to @tbrekalo "but I have a": You need to construct a new string for this anyway… |
11:55:55 | FromDiscord | <Rika> Unless you already use ropes or a gap buffer |
11:56:04 | FromDiscord | <auxym> Yeah, making a copy of 80 bytes shouln't be an issue |
11:56:29 | FromDiscord | <Rika> You can’t do that with no copying afaik |
11:56:55 | FromDiscord | <tbrekalo> ehhh.... I still think in tearms of c++ while doing nim |
11:57:21 | FromDiscord | <Rika> We’re slowly getting to views but I don’t see how views would help with the modification you propose |
11:57:32 | FromDiscord | <Rika> You want to insert something, which means shifting memory |
11:57:39 | FromDiscord | <Rika> Or just constructing a new string |
11:57:42 | FromDiscord | <enthus1ast> would the memory grow when you insert newline? |
11:57:49 | FromDiscord | <Rika> Exactly what I mean |
11:59:13 | FromDiscord | <tbrekalo> Would save me an extra copy; maybe.. give me a moment |
11:59:43 | FromDiscord | <tbrekalo> an extra copy per line format |
12:00:08 | FromDiscord | <Rika> Mind showing why |
12:00:09 | FromDiscord | <Rika> ? |
12:00:35 | * | pro joined #nim |
12:00:47 | FromDiscord | <tbrekalo> give me few mins to code it up |
12:02:00 | FromDiscord | <Rika> Sorry |
12:02:22 | * | pro quit (Client Quit) |
12:06:00 | FromDiscord | <Marvel> is there a way to do something like `if a+ b == c and x + y == z` in nim? i tried `&`, `&&`, `and` but none worked |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:14 | FromDiscord | <enthus1ast> and |
12:06:31 | FromDiscord | <enthus1ast> could be that you must overload and |
12:06:32 | * | supakeen joined #nim |
12:06:49 | FromDiscord | <Marvel> huh |
12:06:56 | FromDiscord | <Marvel> when i do that i get type mismatch |
12:07:19 | FromDiscord | <Rika> Avoid having unequal spaces around operators |
12:07:52 | FromDiscord | <Rika> !eval echo 1+1==2 and 2+2==4 |
12:07:53 | NimBot | true |
12:10:08 | FromDiscord | <tbrekalo> Data is once copied into a temporary which is returned from a function and that temporary is then used to copy data onto the result variable; unless compiler omits the return temporary https://media.discordapp.net/attachments/371759389889003532/894919381694439495/unknown.png |
12:11:39 | FromDiscord | <Rika> If you want to not use experimental, return the indices and access them in the loop perhaps |
12:11:56 | FromDiscord | <tbrekalo> In reply to @Rika "If you want to": ye; was thinking about that |
12:11:56 | FromDiscord | <Rika> I can see that it would still copy though |
12:12:08 | FromDiscord | <tbrekalo> ye but one copy instead of two |
12:12:11 | FromDiscord | <Rika> But I believe it is unavoidable since Nim doesn’t really have the support yet |
12:12:36 | FromDiscord | <tbrekalo> thanks |
12:34:26 | FromDiscord | <enthus1ast> to answer my question\: no need to get the addr of an array for c interopt, (just call the correct functions ;) ) |
12:54:31 | FromDiscord | <juan_carlos> So I am responding like questions about Nim, one of the questions is "Maximum length of string", what would be the best answer ?. |
12:54:39 | * | arkurious joined #nim |
12:54:57 | FromDiscord | <juan_carlos> "No limit" ?, "Limited by memory capacity" ? |
12:58:09 | FromDiscord | <demotomohiro> I think it is `min(memory space size, available memory size)` |
13:00:04 | FromDiscord | <Rika> What language has a coded maximum string length? |
13:02:03 | * | rockcavera joined #nim |
13:02:03 | * | rockcavera quit (Changing host) |
13:02:03 | * | rockcavera joined #nim |
13:04:51 | FromDiscord | <el__maco> Pascal had a maximum length of 255, because the first byte of the string array was its length |
13:05:42 | * | Guest9 joined #nim |
13:07:00 | Guest9 | Hello everyone. I have a quite naive question. Is it possible to omit the proc definition/prototyped even if the proc is used before it is implemented? Like in Java? |
13:08:58 | FromDiscord | <demotomohiro> You can do it like C.↵Just declare it like↵`proc foo(a: int)` |
13:09:04 | * | rockcavera quit (Remote host closed the connection) |
13:09:11 | FromDiscord | <Rika> In reply to @el__maco "Pascal had a maximum": Ah I guess technically Nim has this limit as well, except it’s 2^32 or was it 64? |
13:09:34 | FromDiscord | <Rika> In reply to @demotomohiro "You can do it": But the proc has to be implemented later in the same file |
13:10:35 | FromDiscord | <el__maco> you can also avoid forward declararing if you use the most awesome feature of Nim, code reordering |
13:10:57 | FromDiscord | <el__maco> <https://nim-lang.github.io/Nim/manual_experimental.html#code-reordering> |
13:11:08 | Guest9 | I will have a look the reordering. Thank you |
13:11:59 | FromDiscord | <el__maco> its experimental feature so there might be some caveats, but so far its been working well for me |
13:12:53 | FromDiscord | <juan_carlos> I think the only caveat of code reordering is that is not aware of macro-generated proc. |
13:13:14 | Guest9 | Understood. Actually it is ok to me to put lots of function prototype at the beginning of the program since I used the C language daily. Just curious. |
13:14:27 | FromDiscord | <el__maco> personally I find it rather silly that its 2021 and we're still forward declaring functions. A clerical task that's trivial for the computer to do 😔 |
13:16:30 | Guest9 | I think the forward declaring functions is good for software quality in some sense, I think. |
13:16:34 | FromDiscord | <juan_carlos> I kinda like that functions are declared from top to bottom tho. |
13:17:08 | FromDiscord | <juan_carlos> In Python I have to jump around top-bottom and back to find randomly placed function declarations. |
13:17:18 | Guest9 | You can write the functions definition first and fill the implementation later. Make sure everything matches. |
13:18:25 | FromDiscord | <juan_carlos> I think is not trivial, I think is speeds up parsing a lot. |
13:19:34 | FromDiscord | <el__maco> I think computer science curriculums need more Bret Victor in them 😔 |
13:22:24 | FromDiscord | <el__maco> the modern computer is mind boggingly fast. Scanning through a megabyte of text to find some symbol names is not slow at all, or it should not be at least 🤷♂️ |
13:23:29 | FromDiscord | <xflywind> there are two PRs which intend to solve the forward declare issue |
13:23:30 | FromDiscord | <xflywind> https://github.com/nim-lang/Nim/pull/18818 |
13:23:38 | FromDiscord | <xflywind> https://github.com/nim-lang/Nim/pull/18822 |
13:36:45 | * | dukester joined #nim |
13:38:59 | * | rockcavera joined #nim |
13:38:59 | * | rockcavera quit (Changing host) |
13:38:59 | * | rockcavera joined #nim |
13:39:32 | dukester | noob here! Is there program structure that I should follow? Any main() ? Or is Nim code just free-flow; anything goes - except indentation. |
13:40:44 | FromDiscord | <juan_carlos> A `main()` is ok, not mandatory tho. |
13:40:59 | FromDiscord | <juan_carlos> If is named `potato()` it will work anyway. |
13:41:40 | dukester | OK thanks |
13:43:14 | * | dukester left #nim (Leaving) |
13:46:15 | FromDiscord | <NullCode> In reply to @dukester "noob here! Is there": anything goes lmao |
13:46:27 | FromDiscord | <NullCode> you can do whatever you want, functionally nothing will happen |
13:46:32 | FromDiscord | <NullCode> well it might look bad, but yea |
13:48:29 | FromDiscord | <NullCode> anywho, i need some pointers on nigui |
13:48:38 | FromDiscord | <NullCode> https://github.com/trustable-code/NiGui/ |
13:48:40 | nrds | <R2D299> itHub: 7"Cross-platform desktop GUI toolkit written in Nim" |
13:48:53 | FromDiscord | <NullCode> specially, https://github.com/trustable-code/NiGui/blob/1f453d5dac6f42e2bbfd260215c5269324a45603/src/nigui.nim#L2840 |
13:49:14 | FromDiscord | <NullCode> i wanna turn the editable into `false`, but i dont understand how |
13:57:07 | * | asd quit (Ping timeout: 250 seconds) |
13:57:32 | * | Guest9 quit (Quit: Ping timeout (120 seconds)) |
14:00:51 | FromDiscord | <NullCode> ok nvm, no need |
14:01:09 | FromDiscord | <NullCode> i need some other pointers on niGui now |
14:03:12 | FromDiscord | <NullCode> this doesn't work |
14:03:15 | FromDiscord | <NullCode> sent a code paste, see https://play.nim-lang.org/#ix=3AUL |
14:03:17 | FromDiscord | <NullCode> (i don't expect this to work) |
14:03:33 | FromDiscord | <NullCode> but i need to periodically add some shit to the textBox |
14:03:45 | FromDiscord | <NullCode> (edit) "textBox" => "textArea without the use of buttons and stuff" |
14:03:49 | FromDiscord | <NullCode> i wanted it to be automatic |
14:04:06 | FromDiscord | <NullCode> is there a way to do this with Nim/any other "light" gui lib |
14:04:32 | FromDiscord | <NullCode> (edit) "https://play.nim-lang.org/#ix=3AUL" => "https://play.nim-lang.org/#ix=3AUM" |
14:13:13 | * | max22- joined #nim |
14:23:15 | * | dukester joined #nim |
14:28:55 | * | asd joined #nim |
14:31:23 | * | Vladar quit (Quit: Leaving) |
14:41:59 | FromDiscord | <Archion> Hi |
14:44:34 | FromDiscord | <NullCode> hi |
14:45:30 | FromDiscord | <enthus1ast> @NullCode\: you need to to it via timeouts |
14:46:06 | FromDiscord | <enthus1ast> or, what i like to do, is to drive an async loop via gui timeouts/callbacks, and code the stuff with async procs |
14:46:16 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/894958482221064202): @NullCode\: you need to do it via timeouts |
14:47:04 | FromDiscord | <enthus1ast> https://github.com/trustable-code/NiGui/blob/1f453d5dac6f42e2bbfd260215c5269324a45603/src/nigui.nim#L549 |
14:47:22 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/894958482221064202): @NullCode\: you need to do it via \~\~timeouts\~\~ Timers |
14:48:26 | FromDiscord | <enthus1ast> the app.run() blocks the execution so your loop is run after the gui loop is done |
14:48:37 | FromDiscord | <NullCode> i see |
14:49:26 | FromDiscord | <NullCode> lemme see if i can figure out timers |
14:50:03 | FromDiscord | <enthus1ast> https://github.com/trustable-code/NiGui/blob/732acf350fbd46e058eeb852b80edfc2142d4004/examples/example_08_timers.nim |
14:50:37 | FromDiscord | <NullCode> yeah I'm seeing that one |
14:50:50 | FromDiscord | <NullCode> it uses buttons so yeah |
14:51:08 | FromDiscord | <enthus1ast> so? |
14:51:21 | FromDiscord | <enthus1ast> just call the startRepeatingTimer somewhere |
14:51:33 | FromDiscord | <enthus1ast> (before the call to app.run() ) |
14:52:43 | FromDiscord | <enthus1ast> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/894959951598997524): just call the startTimer / startRepeatingTimer somewhere |
14:56:37 | * | dukester left #nim (Leaving) |
14:56:57 | FromDiscord | <NullCode> https://media.discordapp.net/attachments/371759389889003532/894961360222453790/unknown.png |
14:57:01 | FromDiscord | <NullCode> amazing |
14:57:05 | FromDiscord | <NullCode> thanks lots |
14:59:35 | * | dukester joined #nim |
15:03:01 | * | dukester left #nim (#nim) |
15:17:35 | * | Gustavo6046_ joined #nim |
15:18:01 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
15:20:25 | * | Gustavo6046_ is now known as Gustavo6046 |
15:41:47 | * | NeoCron joined #nim |
15:45:58 | FromDiscord | <xflywind> !eval const _ =12; echo _ |
15:46:00 | NimBot | 12 |
15:52:00 | FromDiscord | <Archion> !eval const =12; echo |
15:52:01 | NimBot | Compile failed: /usercode/in.nim(1, 7) Error: identifier expected, but got '=' |
15:52:04 | FromDiscord | <Archion> What |
15:53:17 | FromDiscord | <xflywind> well, the text is `!eval const _ = 12; echo _` |
15:53:28 | FromDiscord | <Archion> O_o |
15:53:46 | FromDiscord | <Archion> !eval const e=12; echo e |
15:53:48 | NimBot | 12 |
15:54:15 | FromDiscord | <xflywind> however |
15:54:16 | FromDiscord | <xflywind> !eval let _ = 12; echo _ |
15:54:17 | NimBot | Compile failed: /usercode/in.nim(1, 18) Error: undeclared identifier: '_' |
15:57:47 | FromDiscord | <Archion> !eval int xd=3+4; echo xd |
15:57:48 | NimBot | Compile failed: /usercode/in.nim(1, 5) Error: undeclared identifier: 'xd' |
15:58:14 | FromDiscord | <enthus1ast> let xd\: int |
15:58:58 | FromDiscord | <enthus1ast> !eval let xd\:int = 3 + 4; echo xd |
15:58:59 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got 'int' |
15:59:20 | FromDiscord | <enthus1ast> !eval let xd\: int = 3 + 4; echo xd |
15:59:22 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: ':' or '=' expected, but got 'int' |
16:00:04 | FromDiscord | <enthus1ast> bridge must break something |
16:02:11 | Amun-Ra | !eval let xd: int = 3 + 4; echo xd |
16:02:12 | NimBot | 7 |
16:02:35 | Amun-Ra | it appears it escapes : |
16:09:17 | FromDiscord | <cgay (Carl Gay)> Hi folks. I was just trying the Playground and when I set it to generate C++ code instead of C I get a 502 error. Just using the default example\: https://play.nim-lang.org/#ix=2lK1 |
16:09:49 | FromDiscord | <cgay (Carl Gay)> Just want to let someone know in case you're not aware of it yet. Not really a problem for me. Thanks. |
16:22:24 | FromDiscord | <gnu+linux user> yes you are correct |
16:24:14 | FromDiscord | <gnu+linux user> {using \n defeeats whole urpose of using nim for crossplatofrm) |
16:26:18 | FromDiscord | <iffy (Matt Haggard)> I'm working on fixing choosenim, which means fixing zippy. Is there a better way to convert bitmasks to a set of enums as I'm doing here? https://github.com/iffy/zippy/blob/master/src/zippy/tarballs.nim#L38 If you don't want to click, I'm just doing this for every bit I want to check\: `if filemode.masked(TUREAD) != 0: result.incl(fpUserRead)` |
16:27:11 | FromDiscord | <cabboose> bra |
16:27:12 | FromDiscord | <cabboose> jesus christ |
16:27:26 | FromDiscord | <cabboose> is that |
16:27:28 | FromDiscord | <cabboose> is that |
16:27:33 | FromDiscord | <cabboose> is that blank space |
16:27:38 | FromDiscord | <cabboose> they are in perfect 3s |
16:27:52 | FromDiscord | <cabboose> anyway, are those enums in order |
16:28:07 | FromDiscord | <cabboose> where are they defined |
16:29:17 | FromDiscord | <iffy (Matt Haggard)> The enums are from the stdlib\: https://nim-lang.org/docs/os.html#FilePermission |
16:29:40 | FromDiscord | <enthus1ast> does not look too bad imho, its readable an all that |
16:30:43 | FromDiscord | <cabboose> well now it really depends on how a set of flags are cast into an int |
16:31:16 | FromDiscord | <cabboose> https://github.com/nim-works/loony/blob/main/loony/ward.nim |
16:31:27 | FromDiscord | <cabboose> that does int-\>set stuff |
16:31:57 | FromDiscord | <cabboose> if it was just cast from set -\> int then you can just do the same thing the other way |
16:32:03 | FromDiscord | <cabboose> enum sets are just bit sets anyway |
16:32:45 | FromDiscord | <treeform> In reply to @iffy (Matt Haggard) "I'm working on fixing": Do you mean to add stream tarball functionlity? |
16:35:26 | FromDiscord | <iffy (Matt Haggard)> treeform\: no, just preserving permissions un untar/unzip |
16:36:41 | FromDiscord | <treeform> Oh that should not be hard |
16:36:58 | FromDiscord | <treeform> Choosenim relies on that? |
16:41:32 | FromDiscord | <iffy (Matt Haggard)> it does in the newest version |
16:41:42 | FromDiscord | <iffy (Matt Haggard)> I've got tars working -- now trying to understand zip files |
17:09:34 | FromDiscord | <iffy (Matt Haggard)> oh, you can just use `and` instead of `masked` |
17:12:14 | FromDiscord | <cabboose> why dun you just make it so you can cast between them |
17:12:56 | FromDiscord | <iffy (Matt Haggard)> That sounds great. How do you suggest doing that? |
17:13:24 | FromDiscord | <cabboose> did you look at the link |
17:13:37 | FromDiscord | <cabboose> or just give me sample code and i'll do it |
17:14:02 | FromDiscord | <iffy (Matt Haggard)> https://github.com/iffy/zippy/blob/master/src/zippy/tarballs.nim#L38 |
17:15:55 | FromDiscord | <iffy (Matt Haggard)> I looked at the link, but I think casting depends on controlling the order the enums are defined (or their value), right? |
17:28:40 | FromDiscord | <cabboose> yeah |
17:29:04 | FromDiscord | <cabboose> you wouldnt have a problem if the os flags werent in the wrong order |
17:31:09 | FromDiscord | <cabboose> so im just going to rotate them |
17:31:11 | FromDiscord | <cabboose> and then cast them to a set |
17:31:14 | FromDiscord | <cabboose> and that should be fine |
17:31:31 | FromDiscord | <cabboose> im just retarded and have to figure out what the binary representations are of these constants you have here |
17:32:05 | FromDiscord | <juan_carlos> sent a long message, see http://ix.io/3AVX |
17:32:25 | FromDiscord | <cabboose> is websocket a ref? |
17:32:58 | FromDiscord | <juan_carlos> Yes, ooh |
17:33:47 | FromDiscord | <cabboose> you can probably set the destroy for the actual object itself |
17:34:19 | FromDiscord | <treeform> is this `ws`'s WebSocket or some other one? |
17:35:16 | FromDiscord | <juan_carlos> Sorry, you right, error message is not too helpful for ref. 😛 |
17:37:37 | FromDiscord | <cabboose> can you try cast the filemode into a uint16, rotate left 10 positions, decrement by 1 and then cast? |
17:38:24 | FromDiscord | <cabboose> or just rotate right |
17:38:28 | FromDiscord | <cabboose> whatever floats your jimmies |
17:41:56 | FromDiscord | <cabboose> hah hold on |
17:43:55 | FromDiscord | <cabboose> omg screw it im just going to rearrange the damn bits manually |
17:47:19 | NimEventer | New question by Alex Craft: Iterate over multiple tuples in Nim?, see https://stackoverflow.com/questions/69455064/iterate-over-multiple-tuples-in-nim |
17:52:21 | FromDiscord | <iffy (Matt Haggard)> hehe... cabboose, tag my name when you're done so I can see the result |
18:03:27 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3AW6 |
18:03:48 | FromDiscord | <cabboose> there you go. That wouldnt have taken so long if my eyes werent bleeding |
18:03:54 | FromDiscord | <cabboose> annoying. |
18:05:24 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3AW9 |
18:17:31 | NimEventer | New thread by Pixeye: Macro work strange behavior, see https://forum.nim-lang.org/t/8481 |
18:21:32 | FromDiscord | <el__maco> I think I got my first Nim program working, yay. A quick benchmark seems to indicate a ~20% performance penalty compared to the C program I modeled it after. Not ideal, but also could be worse I guess |
18:22:09 | FromDiscord | <enthus1ast> maybe you can speed it up |
18:24:10 | FromDiscord | <enthus1ast> -d\:release --opt\:speed --passl\:-flto --passc\:-flto |
18:24:37 | FromDiscord | <el__maco> I used ``-d:danger -d:release --opt:speed`` |
18:27:14 | FromDiscord | <el__maco> ``Command line warning D9002 : ignoring unknown option '-flto'`` |
18:28:01 | FromDiscord | <el__maco> ah, I'm using msvc that must be why |
18:28:04 | FromDiscord | <Rika> -d:release not needed when -d:danger |
18:28:59 | FromDiscord | <enthus1ast> idk if and how msvc can do link time optimization |
18:31:30 | FromDiscord | <el__maco> I'm sure there are things I could do to improve the performance. The C counterpart is using 32 bit ints like C++ does. And there are some pointer shenanigans that probably could be more efficiently expressed if I knew how |
18:32:48 | FromDiscord | <enthus1ast> what do you mean? |
18:35:14 | FromDiscord | <el__maco> I mean I have not looked at the end result that the nim compiler produced, but I'm fairly sure there are things I could do to reduce overhead. Kinda depends on how smart the compiler is optimizing multidimensional array access |
18:36:29 | FromDiscord | <el__maco> there's more of that in the code compared to the C side where its mostly just dereferencing pointers |
18:38:16 | FromDiscord | <el__maco> how stable is the compiler I'm wondering |
18:38:45 | FromDiscord | <el__maco> I already got into a weird situation that looked kinda like a compiler bug, but I'm not sure 😅 |
18:48:47 | FromDiscord | <Schelz> hi, how can I read the input from keyboard, not input type. |
18:51:18 | FromDiscord | <enthus1ast> stdin.readLine() |
18:51:45 | FromDiscord | <enthus1ast> but you should be more specific |
18:52:49 | FromDiscord | <Schelz> for example in a game idk know how to check if (w, a, s, d) is pressed or not |
18:53:12 | FromDiscord | <Schelz> (edit) removed "idk know how" |
18:53:16 | FromDiscord | <enthus1ast> this depends on the engine you're useing |
18:54:13 | FromDiscord | <Schelz> for example win32api.GetAsyncKeyState(0x20) |
18:56:33 | FromDiscord | <enthus1ast> yes on windows you could certainly do this, but i would read the engine's manual how you're supposed to get keyboard input |
18:57:55 | FromDiscord | <enthus1ast> afaik GetAsyncKeyState also get you keypresses when the windows is not active, certainly not what you want |
19:02:05 | FromDiscord | <Schelz> thx 😊 |
19:10:01 | nrds | <Prestige99> Are there any c++ nim wrappers I could check out? I'm thinking of wrapping box2d if it's possible |
19:21:35 | FromDiscord | <qb> sent a code paste, see https://play.nim-lang.org/#ix=3AWw |
19:21:39 | FromDiscord | <qb> How could i realize that piece of python code? |
19:32:44 | FromDiscord | <enthus1ast> you define a type and cast the memory to this type |
19:32:54 | FromDiscord | <enthus1ast> but it depends i think |
19:33:19 | FromDiscord | <enthus1ast> better parse then cast i guess |
19:35:17 | FromDiscord | <enthus1ast> https://github.com/OpenSystemsLab/struct.nim |
19:35:20 | nrds | <R2D299> itHub: 7"Python-like 'struct' for Nim" |
19:43:54 | FromDiscord | <dom96> @iffy thanks for looking into fixing that in zippy, fwiw choosenim actually has functionality to add the +x perms after extracting |
19:44:13 | FromDiscord | <dom96> I was planning to patch that |
19:44:36 | FromDiscord | <dom96> [iffy (Matt Haggard)](https://matrix.to/#/@iffy-529c6cd8ed5ab0b3bf04da13:gitter.im)\: ^ |
19:58:24 | FromDiscord | <dom96> oh, I see it's already in latest zippy, nice |
20:17:13 | * | neurocyte013288 quit (Quit: The Lounge - https://thelounge.chat) |
20:22:01 | FromDiscord | <dom96> I don't suppose anyone's around to test a new choosenim release for me? 🙂 |
20:22:13 | FromDiscord | <dom96> (edit) "for" => "with" |
20:24:51 | FromDiscord | <dom96> ooh, Github's release notes auto-gen is nice: https://github.com/dom96/choosenim/releases/tag/v0.8.2 |
20:25:48 | FromDiscord | <dom96> I'm gonna go make food, once I eat I'll create a macOS binary and finalise release |
20:25:52 | FromDiscord | <dom96> testing appreciated |
20:30:34 | FromDiscord | <ynfle (ynfle)> @dom96 I can try. I'm on macOS |
20:46:19 | FromDiscord | <dom96> added a macos binary, give it a go |
20:50:52 | * | xet7 quit (Remote host closed the connection) |
20:51:58 | * | jjido joined #nim |
20:52:45 | * | xet7 joined #nim |
20:56:42 | FromDiscord | <treeform> is it arm mac or intel mac? |
20:59:48 | FromDiscord | <dom96> intel |
21:01:11 | FromDiscord | <dom96> I've updated the `stable` channel, so you should be able to run `choosenim update self` now to update |
21:01:29 | FromDiscord | <dom96> (edit) "I've updated the `stable` ... channel," added "choosenim" |
21:30:00 | FromDiscord | <tandy> works good \:)↵(@dom96) |
21:41:51 | * | PMunch quit (Quit: leaving) |
21:44:16 | nrds | <Prestige99> Does c2nim not support c++? Trying it on a header file and gettingillegal storage access errors |
21:45:18 | FromDiscord | <Elegantbeef> It can convert some amount of C++ |
21:46:33 | nrds | <Prestige99> You know of any guides I could check out on how to manually wrap a c++ lib? |
21:47:16 | nrds | <Prestige99> I've only modified existing c wrappers |
21:51:16 | nrds | <Prestige99> this is interesting, c2nim is operating on a header file and ate 15G RAM until I killed it |
21:52:55 | * | NeoCron quit (Quit: Leaving) |
21:59:05 | FromDiscord | <Elegantbeef> shooting gumber a message would probably be the easiest 😛 I've never touched C+ |
21:59:23 | nrds | <Prestige99> Same.. |
21:59:42 | nrds | <Prestige99> I'm just surprised I can't find much on how to write wrappers |
22:07:22 | FromDiscord | <treeform> I think c2nim supports simple C++ project, but not big C++ project is simple. |
22:07:29 | FromDiscord | <ynfle (ynfle)> @dom96 what should I be testing? |
22:08:03 | FromDiscord | <treeform> I was trying to sure that c2nim with steamworks (huge C++ api) not luck. I even have hard time reading the C++ code is so convoluted. |
22:09:59 | FromDiscord | <dom96> In reply to @ynfle (ynfle) "@dom96 what should I": Whatever comes to mind 🙂 |
22:13:01 | * | Gustavo6046 quit (Ping timeout: 245 seconds) |
22:18:08 | * | mst quit (Changing host) |
22:18:08 | * | mst joined #nim |
22:19:29 | nrds | <Prestige99> @treeform: Yeah I was trying with box2d, no dice |
22:23:47 | FromDiscord | <treeform> In reply to @nrds "<Prestige> <@107140179025735680>: Yeah I": I tried making a pure nim 2d physics engine, its hard, I don't recommend. https://cdn.discordapp.com/attachments/706542664643772436/820900286716968960/bMxrOg2pig.gif |
22:24:16 | nrds | <Prestige99> That looks awesome. But yeah it's very hard |
22:25:28 | nrds | <Prestige99> probably would be better off just converting box2d to Nim, eh |
22:25:43 | FromDiscord | <treeform> you could try https://github.com/oprypin/nim-chipmunk |
22:25:46 | nrds | <R2D299> itHub: 7"Nim bindings to Chipmunk, a fast and lightweight 2D game physics library" |
22:27:14 | nrds | <Prestige99> Yeah been trying that, been having some problems I'm still figuring out |
22:41:06 | FromDiscord | <tandy> is there a nim library for escaping paths for unix commands? |
22:41:43 | FromDiscord | <tandy> i have paths with $s, brackets, etc, that i need to escape |
22:43:51 | FromDiscord | <tandy> https://nim-lang.org/docs/strutils.html#escape%2Cstring%2Cstring%2Cstring |
22:43:52 | FromDiscord | <tandy> maybe this |
22:46:09 | FromDiscord | <tandy> hmm no |
22:50:25 | FromDiscord | <Elegantbeef> quoteShell\` |
23:02:43 | FromDiscord | <tandy> woah thats it |
23:02:47 | FromDiscord | <tandy> thank you beef |
23:24:17 | * | max22- quit (Remote host closed the connection) |
23:36:42 | FromDiscord | <Elegantbeef> @Bung\: i know it's really late, but nimscripter now seems to support json Nim \<-\> Nimscript |
23:36:49 | FromDiscord | <impbox [ftsf]> \o/ |
23:37:09 | FromDiscord | <Elegantbeef> sorry for the delay, but yea thought you'd be interested given the interest a few months ago |
23:38:30 | FromDiscord | <Elegantbeef> I was the culprit of all my interop issues with these macros 😀 |
23:39:07 | FromDiscord | <Elegantbeef> Accidently was only getting the last entry in the reclist instead of just the entry in the reclist which resulted in it attempting to index an empty node |