00:01:50 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:02:11 | * | njoseph joined #nim |
00:10:48 | FromDiscord | <Nisha's alt> What's a compiler for nim that uses incremental building? :P |
00:13:28 | FromDiscord | <sealmove> hmm I am trying to use `scanTuple` and I am getting `Error: attempting to call undeclared routine: 'scanTuple'` |
00:13:31 | FromDiscord | <rosewood> ok now it is working but I can't do a `nimble build` :/ |
00:14:07 | FromDiscord | <ElegantBeef> Add `compiler` to your nimble file |
00:14:15 | FromDiscord | <ElegantBeef> Scantuple is only in devel |
00:14:22 | FromDiscord | <ElegantBeef> Update to devel and it'll be in `strscan` |
00:14:32 | FromDiscord | <ElegantBeef> Also it warms my heart to see you attempt to use it |
00:14:35 | FromDiscord | <sealmove> will it be in 1.4.6? |
00:14:40 | FromDiscord | <ElegantBeef> Dont think so |
00:14:44 | FromDiscord | <sealmove> why not |
00:14:53 | FromDiscord | <ElegantBeef> I dont know how stdlib additions propagate |
00:15:02 | FromDiscord | <ElegantBeef> Dont think they add anything only fix them per version |
00:15:43 | FromDiscord | <sealmove> ah, so 1.5.0 |
00:16:32 | FromDiscord | <ElegantBeef> well 1.6.0 when it hits stable |
00:16:37 | FromDiscord | <ElegantBeef> 1.5.1 is devel atm |
00:17:54 | FromDiscord | <sealmove> I see. Ok π
I accept that. |
00:23:58 | FromDiscord | <ElegantBeef> Yea you can imagine how impatient i am considering i've stuff to the stdlib which is pretty useful π |
00:25:45 | FromDiscord | <ElegantBeef> (edit) "Yea you can imagine how impatient i am considering i've ... stuff" added "added" |
00:39:24 | FromDiscord | <konsumlamm> just always use latest devel, problem solved |
00:39:38 | FromDiscord | <ElegantBeef> ^ |
00:39:55 | FromDiscord | <ElegantBeef> Plus you get features like a better doc gen and `spellSuggest` |
00:39:58 | FromDiscord | <ElegantBeef> so it's just how to live |
00:40:17 | FromDiscord | <Rika> So howβs them stability yo |
00:42:22 | FromDiscord | <konsumlamm> in the worst case there are some regressions |
00:42:35 | FromDiscord | <konsumlamm> but there are also a lot of bugfixes |
00:46:36 | * | vicfred quit (Quit: Leaving) |
00:51:27 | FromDiscord | <sealmove> I have 1 c program and 1 nim program and I am trying to connect the stdin/stdout of the c program with the nim program so I can send/receive data to/from it. Any hints? |
00:56:11 | FromDiscord | <ElegantBeef> `osproc` |
00:56:29 | FromDiscord | <Rika> You mean one program is running the other or |
00:56:33 | FromDiscord | <Rika> Individual binaries |
00:56:38 | FromDiscord | <ElegantBeef> `startProcess` is non blocking iirc |
00:56:40 | FromDiscord | <sealmove> no, they are running separately |
00:56:41 | FromDiscord | <Rika> Individual binaries you use shell utilities |
00:56:50 | FromDiscord | <ElegantBeef> Well time for IPC! |
00:56:56 | FromDiscord | <Rika> Or that yes |
00:57:03 | FromDiscord | <sealmove> IPC? |
00:57:11 | FromDiscord | <ElegantBeef> Interprocess communication |
00:57:12 | FromDiscord | <Rika> If you canβt pipe use inter process communication |
00:57:21 | FromDiscord | <Rika> Fuck you beef |
00:57:27 | FromDiscord | <Rika> Smh |
00:57:30 | FromDiscord | <ElegantBeef> Sockets, mmap, or your favourite version |
00:57:50 | FromDiscord | <ElegantBeef> There are many ways to do IPC, so have fun with it π |
00:58:13 | FromDiscord | <sealmove> Yeah I was thinking Sockets. But I can't modify the C program, so I was hopping I could connect to its stdin/stdout with a socket from the Nim program. |
00:58:26 | FromDiscord | <ElegantBeef> well you can launch the program from nim |
00:58:28 | FromDiscord | <ElegantBeef> using osproc |
00:58:41 | FromDiscord | <ElegantBeef> then you can write to the stdin and read the stdout |
00:59:05 | FromDiscord | <sealmove> If I launch it separately, can't I use its pid somehow to connect? |
00:59:31 | FromDiscord | <ElegantBeef> Possibly though there is no global method of doing such |
00:59:50 | FromDiscord | <Rika> Maybe? But itβs not portable |
01:00:08 | FromDiscord | <Rika> Thereβs probably a file somewhere in /proc or something that allows you to do so |
01:00:09 | FromDiscord | <sealmove> i don't care for portability at this point π
I am on Linux |
01:00:11 | FromDiscord | <ElegantBeef> Start the program from the nim binary is my view |
01:00:28 | FromDiscord | <Rika> Yeah |
01:00:28 | FromDiscord | <ElegantBeef> Well then yes you should be able to `/proc/pid/0` iirc is stdin |
01:00:50 | FromDiscord | <sealmove> oh right, and I just write to it |
01:01:30 | FromDiscord | <Rika> Smh why canβt you just pipe |
01:01:37 | FromDiscord | <Rika> Does it have to be two way? |
01:01:49 | FromDiscord | <sealmove> yes, it's back-and-forth |
01:01:56 | FromDiscord | <Rika> I see |
01:03:31 | FromDiscord | <sealmove> It would be nice if there was a socket-like interface for connecting to a local processes via their pid. |
01:03:52 | FromDiscord | <ElegantBeef> I mean that's what starting a process kinda gives you |
01:04:13 | FromDiscord | <ElegantBeef> But time for you to make a library for it and expose the API using extern to change the world π |
01:05:13 | FromDiscord | <ElegantBeef> like you can `proccess.inputStream.write("Hello world")` |
01:05:34 | FromDiscord | <Rika> Canβt you make one of the programs open a socket |
01:05:44 | FromDiscord | <ElegantBeef> and also `proccess.peakableOutputStream.peek` |
01:05:47 | * | vicfred joined #nim |
01:06:00 | FromDiscord | <ElegantBeef> Cant modify the C source so wouldnt be overly useful |
01:06:08 | FromDiscord | <sealmove> In reply to @Rika "Canβt you make one": yes, the Nim program I can |
01:07:08 | FromDiscord | <ElegantBeef> What program are you communicating with? |
01:08:53 | * | Tlangir joined #nim |
01:09:24 | FromDiscord | <sealmove> It's a program generates and outputs graphs |
01:09:32 | FromDiscord | <sealmove> (edit) "It's a program ... generates" added "that" |
01:10:30 | FromDiscord | <sealmove> I know, very general sentence π
if I knew why you ask I could be more specific prbly |
01:11:10 | FromDiscord | <ElegantBeef> Was just curious if there was any alternatives to it |
01:12:38 | FromDiscord | <sealmove> ah, hmm, well, my main goal is to make the Nim program such as using it to connect to the c process locally needs minimal changes compared to when using it to connect to the same program running remotely. |
01:12:48 | FromDiscord | <sealmove> so i can test it locally |
01:13:01 | FromDiscord | <sealmove> (edit) "process" => "program" |
01:13:42 | FromDiscord | <sealmove> basically i need a uniform interface for connecting to local/remote process |
01:14:46 | FromDiscord | <ElegantBeef> Ok so then a program which launches a binary and exposes a socket to send strings/recieve strings from it would work? |
01:15:28 | FromDiscord | <sealmove> Yes, it sounds good |
01:16:10 | FromDiscord | <sealmove> I am looking for that socket exposition :P |
01:16:34 | FromDiscord | <ElegantBeef> Well it's not an overly complex program |
01:18:54 | FromDiscord | <ElegantBeef> a program that takes a port, a binary name, and arguments for that binary, launches the binary, opens a socket on the port then you have your simple packets which would be 0, 1, 2 which is write to stdin, read output, read error π |
01:19:14 | * | krux02 quit (Remote host closed the connection) |
01:19:37 | FromDiscord | <ElegantBeef> Atleast that's all it sounds like, no clue the actual complexity π |
01:22:18 | FromDiscord | <sealmove> I still don't get it, how do you associate the socket with the process? |
01:23:04 | FromDiscord | <ElegantBeef> I'm going to quickly write the server logic π |
01:24:01 | FromDiscord | <j-james> What's wrong with my object inheritance here? |
01:24:12 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2VNl |
01:24:33 | FromDiscord | <j-james> And would it be possible to tell an openArray to start indexing at a particular number? |
01:24:50 | FromDiscord | <sealmove> In reply to @j-james "And would it be": yes |
01:25:03 | FromDiscord | <Rika> No because sequences cannot index from another number..? What you can? |
01:25:42 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2VNm |
01:25:52 | FromDiscord | <Rika> But vector is not a generic type |
01:26:25 | FromDiscord | <sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2VNo |
01:26:27 | FromDiscord | <ElegantBeef> `OpenArray[int]` isnt an allowed type definition so that shouldnt be allowed |
01:26:29 | FromDiscord | <Rika> No it is not |
01:26:36 | FromDiscord | <Rika> Did they change it? |
01:26:39 | FromDiscord | <ElegantBeef> Nah |
01:26:40 | FromDiscord | <ElegantBeef> It's lower |
01:26:48 | FromDiscord | <ElegantBeef> UncheckedArray is upper |
01:26:51 | FromDiscord | <sealmove> oh, my bad |
01:27:10 | FromDiscord | <Rika> In reply to @ElegantBeef "`OpenArray[int]` isnt an allowed": Isnβt it allowed if you were using views |
01:27:36 | FromDiscord | <ElegantBeef> Yes |
01:29:06 | FromDiscord | <sealmove> how comes you can index `array`s however you want, but not `openArray`s? |
01:29:36 | FromDiscord | <ElegantBeef> cause arrays let you use any ordinals openArray is an abstraction over `seq[T]` and all `arrays[size, T]` |
01:30:00 | FromDiscord | <ElegantBeef> `array[3..3, int]` is valid and indexed with `arr[3]` |
01:30:29 | FromDiscord | <ElegantBeef> to index when you are using non 0indexed arrays with open you should do `[oa.low + i]` |
01:39:06 | FromDiscord | <j-james> In reply to @ElegantBeef "to index when you": I'm a little bit confused - is changing the indexing of openArrays (or an equivalent just for array types) possible at all? |
01:39:16 | FromDiscord | <Rika> No |
01:39:24 | FromDiscord | <ElegantBeef> Sequences are by default 0 indexed |
01:39:29 | FromDiscord | <Rika> Sequences cannot have index changes so open arrays cannot as well |
01:39:39 | FromDiscord | <ElegantBeef> arrays are the only type that can be accessed non 0'd |
01:43:35 | FromDiscord | <j-james> I see, thanks |
01:44:32 | FromDiscord | <j-james> There's something still wrong with my inheritance code, though - it seems to be telling me that an array doesn't count as a Vectored array |
01:44:34 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2VNq @sealmove this is the basis of it still not nearly usable but might give you an indication |
01:44:34 | FromDiscord | <j-james> `<type array[0..1, int]> but expected 'Vector = openArray[int]'` |
01:44:50 | FromDiscord | <ElegantBeef> well the way nim's oop work is `object of Parent` |
01:45:15 | FromDiscord | <ElegantBeef> Also why do you even want to use `1..2` for the array |
01:45:56 | FromDiscord | <ElegantBeef> Seal i do suppose it still lacks a `ip port` which it'd connect to aswell |
01:46:18 | FromDiscord | <ElegantBeef> Can we see an attempted use case of this james or is this all you have sofar? |
01:46:39 | FromDiscord | <ElegantBeef> I tried to avoid assuming what people want and just want to see what they want |
01:46:40 | FromDiscord | <j-james> Yeah, no problem |
01:46:50 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2VNr |
01:46:58 | FromDiscord | <j-james> I'm throwing out the `1..2` thing |
01:47:05 | FromDiscord | <ElegantBeef> Ok so no reason for the open array |
01:47:12 | FromDiscord | <j-james> This is me writing a terrible linear algebra library to teach myself linear algebra |
01:47:48 | FromDiscord | <j-james> Sorry, here's where the openArray is helpful |
01:47:56 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2VNs |
01:48:08 | FromDiscord | <ElegantBeef> still really not π |
01:48:21 | FromDiscord | <j-james> So I'd like to have it so that some methods are generally applicable to any vector, while others like the cross product only take a 3d vector |
01:48:30 | FromDiscord | <j-james> Still kinda not, yeah |
01:48:39 | FromDiscord | <ElegantBeef> Well a generic would work there |
01:48:39 | FromDiscord | <j-james> (edit) removed "a" | "vector" => "vectors" |
01:50:29 | FromDiscord | <ElegantBeef> @j-james something ike this https://play.nim-lang.org/#ix=2VNt |
01:50:48 | FromDiscord | <ElegantBeef> shouldnt be a second when should be `elif` |
01:50:54 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2VNu like this π |
01:52:39 | FromDiscord | <j-james> Oh interesting |
01:53:20 | FromDiscord | <ElegantBeef> Forgot to implement the `+` op https://play.nim-lang.org/#ix=2VNv |
01:54:17 | FromDiscord | <ElegantBeef> Could use a concept for `twoComp` and `ThreeComp` |
01:55:06 | FromDiscord | <j-james> That `or` syntax is really cool |
01:55:49 | FromDiscord | <j-james> The other reason I was trying to do it with `openArray`s was to generalize it to VectorDs |
01:56:17 | FromDiscord | <j-james> Would something like `Vector = Vector2d or Vector3d or seq[int]` work? |
01:56:28 | FromDiscord | <ElegantBeef> It'd work yes |
02:03:35 | * | Tlanger joined #nim |
02:05:41 | * | Tlangir quit (Ping timeout: 240 seconds) |
02:07:18 | FromDiscord | <Gary M> can you use a case for object type like you'd do `if a is B` |
02:29:36 | * | Jesin joined #nim |
02:41:36 | * | rockcavera joined #nim |
02:46:20 | FromDiscord | <Rika> Not that I know of |
03:01:21 | FromDiscord | <Gary M> is there an easy way of getting the number of digits in an int? |
03:29:49 | FromDiscord | <Rika> Increment a counter then do div 10 on it until 0 I donβt know |
03:35:14 | FromDiscord | <InventorMatt> It would also be easy to convert to a string and get the length of it. It is probably very inefficient though |
03:37:08 | * | spiderstew joined #nim |
03:37:41 | * | spiderstew_ quit (Ping timeout: 240 seconds) |
03:56:56 | FromDiscord | <ElegantBeef> `log10(3).int + 1. |
03:56:58 | FromDiscord | <ElegantBeef> (edit) "1." => "1`" |
03:57:10 | FromDiscord | <ElegantBeef> I mean `log10(num) + 1` |
03:57:11 | * | vicfred quit (Quit: Leaving) |
04:00:20 | * | vicfred joined #nim |
04:09:42 | * | rockcavera quit (Remote host closed the connection) |
04:13:14 | FromDiscord | <Rika> Uses float unnecessarily |
04:17:52 | * | dom96_ joined #nim |
04:20:24 | * | Simon[m]6 quit (*.net *.split) |
04:20:25 | * | fbpyr[m] quit (*.net *.split) |
04:20:25 | * | m33[m] quit (*.net *.split) |
04:20:25 | * | jfondren[m] quit (*.net *.split) |
04:20:27 | * | Northstrider[m] quit (*.net *.split) |
04:20:27 | * | dom96 quit (*.net *.split) |
04:34:41 | * | Northstrider[m] joined #nim |
04:35:22 | * | fbpyr[m] joined #nim |
04:35:31 | * | m33[m] joined #nim |
04:37:53 | * | Simon[m]6 joined #nim |
04:42:05 | * | jfondren[m] joined #nim |
04:57:44 | * | vicfred quit (Quit: Leaving) |
05:10:19 | FromDiscord | <ajusa> Weird question but does inheritance use less memory than variant objects in Nim? |
05:14:34 | FromDiscord | <ElegantBeef> variants use unions so only take up the largest variant type, so probably the same |
05:14:46 | FromDiscord | <ElegantBeef> Highly depends on your variant vs, your inherited object |
05:14:53 | ForumUpdaterBot | New thread by Halloleo: Library for generating a DOM table from a Nim Table? (JS backend), see https://forum.nim-lang.org/t/7780 |
05:16:21 | ForumUpdaterBot | New Nimble package! streamfix - FIX Protocol streaming parser (Financial Information eXchange), see https://github.com/inv2004/streamfix |
05:20:04 | * | narimiran joined #nim |
06:53:36 | * | fredrikhr joined #nim |
06:58:08 | * | PMunch joined #nim |
07:05:55 | * | Vladar joined #nim |
08:19:49 | PMunch | Can anyone figure out why these two are different? http://ix.io/2VOm |
08:20:09 | PMunch | Here's the generated C code as well: http://ix.io/2VOn |
08:22:19 | PMunch | Ah damn it.. |
08:22:22 | PMunch | Never mind.. |
08:22:50 | PMunch | It was because that sizeof(Descriptor) turned into an 8, but the C definition turned into a 7 |
08:23:09 | PMunch | Adding {.packed.} to the object type definition fixed it |
08:37:23 | Clonkk[m] | I hate code based on sizeof in C for this exact reason |
08:38:24 | PMunch | Yeah, I'll be rewriting this in better Nim style now that it works |
08:38:39 | PMunch | I just didn't want to start a major refactor before I had some working Nim code I could work with |
08:40:49 | PMunch | Hmm, I have a vague memory about talk of allowing other keywords than `do` for passing multiple blocks to a macro/template. Did that ever go anywhere? |
08:44:45 | Clonkk[m] | Are you talking about ``with`Γ¨ ? |
08:44:51 | Clonkk[m] | * Are you talking about ``with`` ? |
08:45:00 | Clonkk[m] | Not sure what that became |
08:45:00 | PMunch | Hmm, I don't think so |
08:46:09 | PMunch | More things like turning `macro myMacro(body, else: untyped): untyped` invocation from `myMacro: echo "hello world" do: echo "otherwise"` into `myMacro: echo "hello world" else: echo "otherwise"` |
08:46:22 | Clonkk[m] | Ah it wasn't part of stdlib it's a Zevv project https://github.com/zevv/with |
08:46:44 | Clonkk[m] | <PMunch "More things like turning `macro "> No idea |
08:46:58 | PMunch | I know about `with`, look at the contributor list ;) |
08:47:52 | Clonkk[m] | Haha, fair enough |
08:48:08 | PMunch | I basically rewrote the whole thing :P |
08:48:35 | PMunch | Only three lines of the original remained https://github.com/zevv/with/pull/2/files |
08:57:01 | FromDiscord | <j-james> So either my grasp of advanced types or my grasp of how procedures can work is shaky (or both), but there's something fundamentally wrong with this code that I'm overlooking |
08:57:13 | FromDiscord | <j-james> sent a code paste, see https://play.nim-lang.org/#ix=2VOL |
08:59:53 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2VON here you go |
09:00:09 | * | Vladar quit (Read error: Connection reset by peer) |
09:00:17 | PMunch | Damn it, beat me to it :P |
09:00:33 | FromDiscord | <ElegantBeef> Too busy coding keyboard to use yours |
09:01:00 | PMunch | Haha, right now I'm just having something to eat :P |
09:01:34 | FromDiscord | <ElegantBeef> Also can you please just put all those types in a single type block thanks π |
09:02:06 | * | Vladar joined #nim |
09:02:20 | FromDiscord | <j-james> Haha π
|
09:02:25 | FromDiscord | <ElegantBeef> "Hey i want to add a new type, i have to newline and write `type` yet again" |
09:02:40 | Clonkk[m] | Why does C++ code generation tries to use Nim fields ? |
09:02:44 | FromDiscord | <Gary M> Oh hey, Vectors |
09:02:54 | FromDiscord | <ElegantBeef> also with that version a, b will always be the same type |
09:03:57 | FromDiscord | <j-james> _poorly done vectors_ |
09:04:53 | FromDiscord | <Gary M> Want to see some fast as fuck vectors π I'm working on simd optimized game math with stuff in #gamedev |
09:05:11 | FromDiscord | <j-james> So with that `+` overloading, is the syntax `param + param` exclusive to operators? |
09:05:13 | FromDiscord | <Rika> slam them vectors yo |
09:07:45 | FromDiscord | <ElegantBeef> @j-james realistically you can just do https://play.nim-lang.org/#ix=2VOU |
09:08:21 | FromDiscord | <ElegantBeef> The Vector2 and Vector3 types dont matter much when you're allowing interop with any collection of equal size |
09:09:24 | FromDiscord | <Gary M> Beef you forgot the type block |
09:09:47 | FromDiscord | <j-james> I'll read up on generics, thanks @ElegantBeef |
09:09:51 | FromDiscord | <ElegantBeef> I only did the let one since i had to write another variable π |
09:09:58 | FromDiscord | <j-james> And thanks for finding my problems π |
09:21:28 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2VOW |
09:22:12 | FromDiscord | <Rika> make a macro that generate procs d0 and d1 etcif you like |
09:23:09 | FromDiscord | <ElegantBeef> nah |
09:23:17 | FromDiscord | <ElegantBeef> Update to devel and use `setutils` |
09:23:28 | FromDiscord | <ElegantBeef> we have `set[d1] = true` there |
09:24:30 | FromDiscord | <ElegantBeef> Or if you dont want to update just copy this macro somewhere https://github.com/nim-lang/Nim/blob/devel/lib/std/setutils.nim#L65 |
09:24:41 | FromDiscord | <ElegantBeef> (edit) "macro" => "func" |
09:25:33 | FromDiscord | <jtiai> That's better because I have tons of if-else blocks for bits. |
09:26:22 | FromDiscord | <jtiai> Though I still wish dot notation. π |
09:26:58 | FromDiscord | <ElegantBeef> well you can either make a macro to generate the procs or use a macro + dotoperators to implement it |
09:27:19 | FromDiscord | <ElegantBeef> And it's too late for me to throw the latter together π¦ |
09:27:33 | FromDiscord | <ElegantBeef> So on that note i'm outta here |
09:28:42 | FromDiscord | <jtiai> Given that I'm on day 6 with my Nim adventure I think I'll settle for premade stuff... |
09:29:57 | * | jaens[m] joined #nim |
09:44:36 | * | l1x quit (Quit: Connection closed for inactivity) |
09:57:47 | FromDiscord | <j-james> So generics are only useful in this case because of the flexibility of the openArray type, right? |
09:57:48 | FromDiscord | <j-james> https://play.nim-lang.org/#ix=2VP2 |
10:00:53 | * | lritter joined #nim |
10:04:46 | FromDiscord | <GE> I asked earlier for a cross platform GUI, but the suggested one doesn't work on BSD. Any other well usable GUI libraries for nim? |
10:07:06 | FromDiscord | <InventorMatt> Depending on how many features you need NiGUI could work |
10:18:26 | FromDiscord | <jtiai> btw, why Nim language was original created for? |
10:18:32 | FromDiscord | <jtiai> (edit) "original" => "originally" |
10:19:03 | FromDiscord | <GE> Nim was created to be a language as fast as C, as expressive as Python, and as extensible as Lisp. According to wikipedia at least. |
10:20:21 | FromDiscord | <jtiai> At least Python part is still... a bit lagging. π |
10:20:56 | FromDiscord | <Solitude> nah |
10:21:11 | FromDiscord | <Solitude> (edit) "nah ... " added "π" |
10:21:26 | FromDiscord | <Rika> In reply to @jtiai "At least Python part": why so? |
10:22:26 | FromDiscord | <jtiai> Well statically typed and compiled language really can't do all the magic Python can. And it doesn't because it's fast and usable on other parts. |
10:22:47 | FromDiscord | <Rika> it said expressive, as in "the code looks clean" |
10:22:53 | FromDiscord | <Rika> not "as able as python" |
10:23:07 | FromDiscord | <jtiai> Well "clean" is quite subjective term... |
10:23:33 | * | qwr prefers compile-time macro magic to runtime magic, imho easier to reason without running to observe behaviour |
10:23:40 | FromDiscord | <Rika> a lot of things are subjcetive |
10:25:16 | * | tane joined #nim |
10:25:41 | * | l1x joined #nim |
10:26:01 | qwr | and python is imho terrible in letting you know of errors in latest possible time (maybe TCL is worse in this part) |
10:26:15 | FromDiscord | <jtiai> what is tcl? |
10:26:24 | FromDiscord | <GE> TCL is a scripting language |
10:26:30 | FromDiscord | <GE> and TK is for GUIs |
10:26:37 | FromDiscord | <GE> commonly referred to as TCL/TK |
10:26:43 | FromDiscord | <jtiai> ah. that. never used. |
10:27:06 | FromDiscord | <GE> It's pretty obscure nowadays. I wouldn't expect you to know it. It's rarely used outside of UNIX world. |
10:28:11 | FromDiscord | <jtiai> I guess debian counts as unix world? |
10:28:28 | FromDiscord | <GE> Yeah. Debian is linux and linux is unix-like. And TCL/TK is in the debian repos too. |
10:30:51 | FromDiscord | <jtiai> but anyway never user tcl/tk. Probably heard of years ago. |
10:31:02 | FromDiscord | <GE> It used to be pretty popular in the 90s. |
10:31:13 | FromDiscord | <jtiai> Don't recall. π |
10:31:20 | FromDiscord | <GE> But has fallen out of favor with GTK, Qt, and other toolkits taking over it. |
10:32:42 | qwr | today it isn't much used except maybe for the TK ui part (and I discovered sometime ago that bitkeeper guys wrote http://www.little-lang.org/ for TK that compiles to TCL bytecode...) |
10:33:51 | FromDiscord | <Rika> prolly python and tkinte |
10:33:52 | FromDiscord | <Rika> r |
10:34:06 | FromDiscord | <GE> tkinter is more popular than tcl/tk itself. |
10:34:15 | FromDiscord | <Rika> well yeah |
10:37:29 | PMunch | Hmm, for some reason my C procedure re-implemented in Nim is about 10% smaller in program size |
10:37:38 | narimiran | is @treeform maybe on discord/matrix? |
10:38:40 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2VP9 |
10:39:38 | FromDiscord | <Solitude> https://nim-lang.org/docs/manual.html#generics |
10:43:45 | FromDiscord | <jtiai> Ooo... π‘ |
10:47:27 | FromDiscord | <Gennadiy> How do I specify a couple of C libs to the Nim compiler? |
10:51:00 | PMunch | @Gennadiy, what do you mean? |
10:51:23 | FromDiscord | <demotomohiro> passLβ΅https://nim-lang.org/docs/nimc.htmlβ΅https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-passl-pragma |
10:53:49 | FromDiscord | <Gennadiy> gsl-nim wraps the GSL library but I belive it is built with libslang.so in its lib directory. β΅I want to use libgsl and libgslcblas that I have built on Windows. |
10:56:53 | FromDiscord | <demotomohiro> If it wraps C functions with dynlib pragma, you don't need to pass any compiler options to Nim for the C library. Just put the .dll files where your executable can find. |
10:59:36 | FromDiscord | <Gennadiy> I imagine this wouldn't wotk for static libraries: libgsl.lib and libgslcblas.lib? |
11:01:28 | FromDiscord | <Gennadiy> Thanks @demotomohiro . Found the dlls and it's worked. |
11:01:29 | FromDiscord | <demotomohiro> Try DynlibOverride: |
11:01:30 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/nimc.html#dynliboverride |
11:02:33 | FromDiscord | <Gennadiy> Excellent. Thanks for the `dynliboverride` tip. Might need that for the future. |
11:20:41 | FromDiscord | <Yardanico> In reply to @narimiran "is <@107140179025735680> maybe on": He's on Discord, yes, but seems away right now |
11:20:54 | narimiran | thanks, Yardanico! |
11:39:38 | FromDiscord | <Goel> @Yardanico Do you use Discord directly? Like the webversion or with the installer or through a bridge? |
11:40:18 | FromDiscord | <Yardanico> Through the application, why do you ask though? If I used the bridge you would see me as "IRC" |
11:40:56 | FromDiscord | <Goel> I don't know if its a bug with my version or its like this, but i noticed if i click the [IRC] users in this chat, it shows me the previous [IRC] user that sent that message, and not the current users that actually wrote it |
11:41:43 | FromDiscord | <Goel> (edit) "users" => "user" |
11:42:17 | FromDiscord | <Goel> (edit) "it" => "it. (For example, if i click on narimiran[IRC] discord shows me its qwr[IRC]" |
11:45:26 | * | PMunch quit (Ping timeout: 240 seconds) |
11:46:52 | liblq-dev | it's a discord bug |
11:47:11 | liblq-dev | it's been broken like this for years |
11:49:21 | FromDiscord | <Yardanico> yep |
11:49:27 | FromDiscord | <Yardanico> nothing we can do about it |
11:57:59 | * | PMunch joined #nim |
12:05:58 | * | krux02 joined #nim |
12:15:33 | FromDiscord | <Gennadiy> What is wrong with this and/or is there an alternative way to construct it?β΅`var table_of_tables: Table[Table[string, int], float] = { {"a": 1, "b": 1}.toTable: 0.2, {"a": 1, "b": 2}.toTable: 0.8 }.toTable` |
12:21:05 | PMunch | @Gennadiy, the key of a table needs to have `hash` a `==` procedures |
12:21:19 | PMunch | Some default ones are provided, but not one for `Table` |
12:25:28 | liblq-dev | i see that the keys among the keys are the same, couldn't you get away with using a tuple then? |
12:26:04 | liblq-dev | `{ (a: 1, b: 1): 0.2, (a: 1, b: 2): 0.8 }.toTable` |
12:27:45 | * | PMunch quit (Ping timeout: 260 seconds) |
12:27:48 | * | sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in) |
12:28:09 | * | sacredfrog joined #nim |
12:32:23 | FromDiscord | <Gennadiy> I see. Thanks @PMunch |
12:33:15 | FromDiscord | <Gennadiy> @liblq-dev[IRC] I guess I could but it seems that it also needs a hash. |
12:33:29 | liblq-dev | tuples have a built-in hash |
12:35:21 | FromDiscord | <Gennadiy> Ah, works. Thanks. |
12:40:22 | * | PMunch joined #nim |
12:47:20 | * | rockcavera joined #nim |
13:04:39 | FromDiscord | <GE> Has anyone made CAD or 3D imaging software using just nim? |
13:06:29 | PMunch | Not that I know of |
13:06:45 | FromDiscord | <GE> Can I make 3D software with nim? |
13:07:19 | PMunch | Sure |
13:07:44 | PMunch | You can make anything in Nim :) |
13:15:30 | FromDiscord | <GE> How complete is the GTK bindings for nim? |
13:16:01 | PMunch | They're auto-generated from the C sources, so they should be pretty complete |
13:46:33 | * | Clonkk[m] < https://matrix.org/_matrix/media/r0/download/matrix.org/FHuKUxiFQKzWhssCpmYkJDMd/message.txt > |
13:47:00 | FromDiscord | <platycat> is there any easy way to browse the list of procedures a module exports? |
13:47:43 | narimiran | create docs and search for `proc`? :D |
13:47:46 | FromDiscord | <Clonkk> sent a code paste, see https://play.nim-lang.org/#ix=2VPV |
13:50:47 | FromDiscord | <platycat> well, I'm talking about gintro, which generates bindings, so I can't ctrl+f, and calling `nim doc` on any of the source files fails |
13:51:02 | FromDiscord | <platycat> (edit) "bindings," => "bindings using some macros or whatnot," |
13:57:31 | FromDiscord | <Solitude> In reply to @platycat "well, I'm talking about": grep |
13:57:50 | FromDiscord | <platycat> In reply to @Solitude "grep": no, the relevant identifiers don't exist in the source, because it's translating it |
13:57:58 | FromDiscord | <platycat> this doesn't seem to work either huh https://media.discordapp.net/attachments/371759389889003532/831166254571061298/unknown.png |
13:58:33 | FromDiscord | <Solitude> ? |
13:59:47 | FromDiscord | <Solitude> In reply to @platycat "no, the relevant identifiers": how can they not exist |
13:59:59 | FromDiscord | <Solitude> In reply to @platycat "this doesn't seem to": what are you trying to do with this? |
14:00:20 | * | clyybber joined #nim |
14:00:26 | FromDiscord | <platycat> In reply to @Solitude "how can they not": https://github.com/StefanSalewski/gintro/tree/master/gintro I am not sure, you tell me |
14:00:41 | FromDiscord | <Solitude> In reply to @platycat "https://github.com/StefanSalewski/gintro/tree/maste": the repo contains only generator |
14:00:53 | FromDiscord | <Solitude> when you nimble install it the bindings get generated |
14:00:58 | FromDiscord | <Solitude> and they contain all symbols you need |
14:01:01 | FromDiscord | <platycat> thanks |
14:01:03 | * | PMunch quit (Quit: leaving) |
14:01:04 | FromDiscord | <platycat> I will look there |
14:04:36 | FromDiscord | <platycat> I found it there, thank you |
14:07:32 | FromDiscord | <treeform> In reply to @narimiran "is <@107140179025735680> maybe on": I am here a lot. |
14:09:28 | narimiran | hey @treeform! |
14:10:02 | narimiran | i've seen that you've updated `fidget`, but is there some other package of yours which can demonstrate the nimble problem you talked about on friday? |
14:11:03 | FromDiscord | <treeform> at the moment no, I went over every project and made sure it works with all the current libs. |
14:11:43 | FromDiscord | <treeform> I can probably create a fake set of projects. |
14:12:00 | FromDiscord | <treeform> or maybe you can install older fidget? |
14:12:08 | FromDiscord | <treeform> and older pixie had this issue |
14:12:38 | FromDiscord | <treeform> right before this commit: https://github.com/treeform/fidget/commit/1d7de0e9bc6157b4195e34faa3e52918fd262b73 |
14:13:07 | narimiran | ok, i'll try to play with those two packages (and their old versions) |
14:14:19 | FromDiscord | <treeform> the idea is to have nested project, first nested project has lib > 1.0.0 and the later one have lib = 1.0.0 and they will not work |
14:14:59 | FromDiscord | <treeform> as nimble only installs by the first rule, while uses the other rules as more of an assert |
14:31:01 | FromDiscord | <treeform> order of requires and what you already have installed is dependent |
14:39:20 | FromDiscord | <dom96> It's probably best to repro this in isolation with dummy packages |
14:39:31 | FromDiscord | <dom96> although I'm not sure what your goal is narimiran π |
14:40:19 | Clonkk[m] | If you're refererring to this issue : https://github.com/treeform/fidget/issues/145 ; the result of nimble dependencies resolution was dependent on what you had previously installed as well |
14:40:31 | Clonkk[m] | So reproducing in isolation might be hard |
14:56:06 | FromDiscord | <GE> How easily could a C++ programmer learn nim? |
15:05:18 | FromDiscord | <treeform> In reply to @GE "How easily could a": I think it depends on many factors. Nim is easy to learn. I think how many years experience programming and how many other languages they know would be a bigger factor. Nim is similar to C++ in some ways but not in others. C++ is a complex language some one who knows C++ well could probably learn any language pretty easy. |
15:05:44 | FromDiscord | <treeform> I don't know of any other top 20 language that is more complex then C++. |
15:06:35 | FromDiscord | <treeform> ... Haskell maybe more complex? |
15:06:45 | FromDiscord | <GE> Assembly. |
15:07:04 | FromDiscord | <treeform> I find Assembly to be very easy to learn. Hard to build big software in. |
15:07:12 | Clonkk[m] | Assemble isn't complex to learn |
15:07:18 | FromDiscord | <GE> The x86 manual is over 1,000 pages long. |
15:07:27 | FromDiscord | <treeform> When I was just starting out programming I learned QBASIC, then tried learning C. |
15:07:29 | Clonkk[m] | So ? |
15:07:39 | FromDiscord | <treeform> But C was so hard, I learned assembly instead. |
15:08:12 | FromDiscord | <treeform> You only use like 1% of all possible assembly instructions day to day. |
15:09:44 | Clonkk[m] | I'd say that If you exclude macros, a C++ developer can be proficient in Nim in about a month or two (depending how long per day you spend on it). |
15:10:00 | FromDiscord | <GE> I find C very easy to learn. What's difficult is learning how to not shoot yourself in the foot with things like pointers and whatever. |
15:10:34 | FromDiscord | <treeform> I was learning C with Turbo C and the errors I was getting were very strange. |
15:10:51 | FromDiscord | <treeform> I found Turbo Assembler easier at the time. |
15:10:56 | Clonkk[m] | <FromDiscord "<GE> I find C very easy to learn"> C is easy to learn but hard to build complex stuff with without mistake. |
15:11:28 | FromDiscord | <GE> That's more or less what I said Clonkk. |
15:11:46 | Clonkk[m] | Yes, I was agreeing with you |
15:12:40 | FromDiscord | <GE> Hey zetashift, I was meaning to ask you a question. How good are the nim bindings for godot? Are they good enough to make full games with them? |
15:13:44 | FromDiscord | <zetashift> I saw this tweet: https://twitter.com/convexcollider/status/1375765660219887621 and I wonder what we could do to put out there that Nim isn't _that_ complicated |
15:14:29 | FromDiscord | <zetashift> Metaprogramming is basically the most advanced thing in Nim's arsenal but I don't see languages like Elixir succumbing to being complex |
15:15:12 | Clonkk[m] | Complexity in a language is not inherently bad if it allows to simplify designs |
15:16:20 | FromDiscord | <zetashift> In reply to @GE "Hey zetashift, I was": Ah, what a coincedence, I'm busy with Godot and Nim right now haha, I'm using https://github.com/geekrelief/gdnim to make a tetris clone. It's neat, and yes I think they are good enough to make full games, with the big caveat that there is little GDNative documentation |
15:16:41 | FromDiscord | <GE> How can documentation be improved? |
15:18:09 | FromDiscord | <zetashift> Well for now the bindings need some work to be stable, after that some docs can be made, for now I find the best way to just look at some GDScript samples and convert them using Nim. The low level workings of the bindings are WIP because there might also be a jump to Godot 4.0 happening |
15:18:35 | FromDiscord | <GE> I thought the bindings already were stable. |
15:19:00 | FromDiscord | <zetashift> In reply to @GE "I thought the bindings": They are stable in that, you can work with them now, but gdnim is also focused on getting Godot 4.0 support |
15:19:11 | FromDiscord | <zetashift> You can work with them now and be productive |
15:21:06 | * | fredrikhr quit (Quit: Client Disconnecting) |
15:21:36 | FromDiscord | <zetashift> In reply to @Clonkk "Complexity in a language": I agree, but currently there seems to be a push to have "simple" languages like Go or Zig, that have a minimalistic design. Nim is getting categorized as a "big" language, I don't really think that's entirely true and especially for low level stuff I think it's important to market Nim as a solid fundamentals language. |
15:22:07 | FromDiscord | <zetashift> In reply to @GE "I thought the bindings": The bindings also have been used in production for an Android/iOS game, which one I sadly don't know. |
15:22:28 | FromDiscord | <GE> Do you happen to have your tetris clone available online? I would like to use them as a possible reference if it's clean and well commented as necessary. |
15:22:57 | FromDiscord | <zetashift> I just started like an hour ago with a repo haha, I'll post it when it's done |
15:23:00 | FromDiscord | <zetashift> I'll try to document it |
15:23:16 | FromDiscord | <GE> Cool. Take your time. there's no rush here. |
15:23:23 | FromDiscord | <zetashift> In the meantime you could look at: https://github.com/geekrelief/gdnim_hb_arpg |
15:23:33 | FromDiscord | <zetashift> (It works with hot code reloading!) |
15:23:40 | FromDiscord | <GE> hot code reloading? |
15:24:24 | FromDiscord | <zetashift> Basically when you press 'F5' in Godot, your game is running. If you then alt-tab and change some code, the editor will automatically pickup your code changes and reflect it in the running game |
15:24:38 | FromDiscord | <GE> Sounds very convenient. |
15:24:57 | FromDiscord | <zetashift> https://defold.com/manuals/hot-reload/ |
15:25:03 | FromDiscord | <zetashift> best explanation I could google |
15:38:24 | FromDiscord | <GE> What I like about nim is how readable the syntax is. What you read is exactly what will happen. Nothing is a mystery like C++ is. |
15:43:42 | giaco__ | I want to switch from unittest to testament, what's the best way to separate different tests like suite/test in unittest? |
15:45:14 | giaco__ | is one test per nim file the way to go? |
15:47:04 | FromDiscord | <GE> If I was to make a compile/build script with compile flags, should I just make a regular script for that? Or us nmake? |
15:47:42 | FromDiscord | <GE> (edit) "us" => "use" |
15:52:15 | liblq-dev | nim.cfg? |
15:53:01 | FromDiscord | <Yardanico> @GE as liblq-dev said, nim.cfg for most flags is enough, although if you're using nimble it's better to specify it as a build task there |
15:53:11 | FromDiscord | <Yardanico> also, nim.cfg doesn't honor -d:release and -d:danger, so keep that in mind |
15:53:33 | FromDiscord | <GE> Would it be okay if I made a shell script to compile with options? |
15:53:44 | FromDiscord | <Yardanico> if you prefer that, sure |
15:54:18 | Clonkk[m] | Isn't config.nims preferred to nim.cfg ? |
15:54:35 | FromDiscord | <Yardanico> yes, that too, but there's no big difference between then for compilation flags |
16:00:11 | * | solitudesf quit (Quit: Idle for 30+ days) |
16:00:11 | * | sekao[m] quit (Quit: Idle for 30+ days) |
16:06:56 | FromDiscord | <treeform> In reply to @liblq-dev "nim.cfg?": maybe? configure.nims |
16:11:14 | ForumUpdaterBot | New Nimble package! graphql - GraphQL parser, server and client implementation, see https://github.com/status-im/nim-graphql |
16:15:48 | FromDiscord | <Nisha's alt> What's the link for the Nim manual? |
16:15:55 | FromDiscord | <Nisha's alt> Preferably up-to-date :p |
16:16:12 | FromDiscord | <Nisha's alt> It's someone who's checking out Nim for the first time so |
16:16:12 | FromDiscord | <zetashift> https://nim-lang.org/docs/manual.html latest stable |
16:16:19 | FromDiscord | <Nisha's alt> Thanks |
16:16:33 | FromDiscord | <zetashift> Might be better to link this then: https://nim-lang.org/documentation.html ? |
16:17:12 | FromDiscord | <Nisha's alt> Uh https://media.discordapp.net/attachments/371759389889003532/831201294676394045/Screenshot_20210412_171705_com.android.chrome.jpg |
16:17:42 | FromDiscord | <zetashift> oh yikes |
16:17:57 | FromDiscord | <zetashift> I am getting that too with firefox |
16:18:00 | FromDiscord | <Nisha's alt> Lmao |
16:18:05 | FromDiscord | <zetashift> (edit) "I am getting that too with firefox ... " added "android" |
16:20:43 | FromDiscord | <zetashift> Well tell your contact to check it out on desktop π |
16:47:36 | FromDiscord | <Nisha's alt> Lmao sure |
16:48:26 | ForumUpdaterBot | New thread by Jasonfi: Opinions on ordering parameters, see https://forum.nim-lang.org/t/7783 |
16:53:43 | * | haxscramper joined #nim |
17:13:23 | FromDiscord | <carpal> could someone send me an example of the nim's ir? |
17:13:39 | FromDiscord | <carpal> that nim uses as intermediate language? |
17:14:16 | FromDiscord | <Yardanico> Currently it's the same AST |
17:14:33 | FromDiscord | <Yardanico> With all types and stuff resolved |
17:16:13 | FromDiscord | <Mustache Man> any ideas how to improve the performance of this? https://play.nim-lang.org/#ix=2VR1 |
17:17:05 | FromDiscord | <Mustache Man> i've looked into some reservoir sampling, but i'm not sure it's any improvement to memory or cpu cycles |
17:17:28 | FromDiscord | <Mustache Man> (edit) "cycles" => "cycles. my implementation might have sucked, though." |
17:30:15 | FromDiscord | <carpal> In reply to @Yardanico "With all types and": resolved means that are evaluated to the effective structure or primitive or that type checking is done? |
17:35:02 | FromDiscord | <haxscramper> Identifiers are replaced with symbols that have information about type |
17:35:19 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/8b5769133cf30dae2a6ed15aa3ba9d2f2be713ec/compiler/ast.nim#L763 |
17:35:42 | FromDiscord | <haxscramper> You can print `treeRepr()` of `typed` macro argument - that is what compiler operates on (roughly speaking) |
17:36:14 | FromDiscord | <haxscramper> nim IR is mostly via macro API, though some details are hidden to make it easier to write macro |
17:49:02 | * | haxscram` joined #nim |
17:49:11 | * | haxscram` left #nim (#nim) |
17:50:31 | * | haxscramper quit (Ping timeout: 260 seconds) |
17:53:05 | FromDiscord | <0xc45> sent a code paste, see https://play.nim-lang.org/#ix=2VRb |
17:54:33 | FromDiscord | <Yardanico> when defined(A) or defined(B) |
17:54:40 | FromDiscord | <Yardanico> if that's what you meant |
17:54:43 | FromDiscord | <Nisha's alt> Was abiut to say that |
17:55:38 | FromDiscord | <0xc45> It is! Thanks much! π |
17:55:40 | FromDiscord | <0xc45> I feel dumb now lol |
18:09:28 | * | abm joined #nim |
18:14:07 | * | vicfred joined #nim |
18:15:58 | * | NimBot joined #nim |
18:17:03 | FromDiscord | <Nisha's alt> Lmao don't worry about it |
18:17:12 | FromDiscord | <Nisha's alt> Even the best programmers make small mistakes lol |
18:17:45 | FromDiscord | <0xc45> Ain't that the truth. The longer I stare at my screen, the dumber my mistakes get π |
18:18:33 | FromDiscord | <Nisha's alt> Mooood a f |
18:51:04 | FromDiscord | <Hi02Hi> In reply to @Mustache Man "any ideas how to": I came up with https://play.nim-lang.org/#ix=2VRq, basically exp(0.5) -> sqrt, and arr.take(x) -> arr[0..<x] |
18:53:25 | FromDiscord | <Hi02Hi> although it feels wierd to say exp(0.5) is sqrt(), since exp() usually means e^x |
19:05:29 | * | vicfred quit (Quit: Leaving) |
19:08:39 | * | Jesin quit (Ping timeout: 268 seconds) |
19:09:03 | FromDiscord | <Mustache Man> In reply to @Hi02Hi "although it feels wierd": they are the same |
19:09:18 | FromDiscord | <Mustache Man> e^0.5 is the same as sqrt |
19:10:11 | FromDiscord | <Mustache Man> i didn't know Nim could subset a sequence this way, that's cool! |
19:15:42 | liblq-dev | e^0.5 is the same as sqrt of what |
19:15:52 | liblq-dev | you mean sqrt e? |
19:15:58 | FromDiscord | <Mustache Man> ys |
19:16:00 | FromDiscord | <Mustache Man> (edit) "ys" => "yes" |
19:17:27 | FromDiscord | <Mustache Man> sorry, shouldn't have used 'e' |
19:18:27 | * | abm quit (Quit: Leaving) |
19:30:55 | * | lritter quit (Ping timeout: 252 seconds) |
19:39:48 | FromDiscord | <Mustache Man> In reply to @Hi02Hi "I came up with": thanks! this is a fair amount faster. it's about the same speed as the reservoir sampling that i tried, but it's much more readable |
19:40:15 | FromDiscord | <Hi02Hi> π |
19:43:51 | * | clyybber quit (Quit: WeeChat 3.1) |
19:44:35 | * | clyybber joined #nim |
19:47:54 | * | junland quit (Quit: %ZNC Disconnected%) |
19:48:41 | * | junland joined #nim |
19:59:35 | ForumUpdaterBot | New Nimble package! aria - Aria2 API lib for Nim for any backend https://aria2.github.io, see https://github.com/juancarlospaco/aria |
20:11:38 | FromDiscord | <GE> What's the least complicated way to make command line arguments for nim? |
20:12:06 | FromDiscord | <exelotl> uuuh any idea what I'm doing wrong here? π€ https://play.nim-lang.org/#ix=2VRS |
20:13:21 | FromDiscord | <Rika> `.Fixed[:T,N]` |
20:13:25 | FromDiscord | <Rika> i think |
20:13:33 | FromDiscord | <Rika> yup |
20:13:36 | FromDiscord | <exelotl> ohhhh |
20:13:38 | FromDiscord | <exelotl> ty |
20:16:43 | FromDiscord | <exelotl> oops my maths was wrong too lol |
20:18:59 | FromDiscord | <GE> What is the recommend way in nim to make command line arguments? |
20:19:55 | FromDiscord | <exelotl> depends how complex your program is and whether you want any dependencies or not |
20:20:25 | FromDiscord | <exelotl> @GE personally I like to just use parseopt: https://nim-lang.org/docs/parseopt.html |
20:20:25 | Prestige | maybe https://nim-lang.org/docs/parseopt.html |
20:20:35 | FromDiscord | <exelotl> booya |
20:20:38 | Prestige | hehe |
20:21:19 | FromDiscord | <GE> Can I enforce usage of parameters? Like give an error if none were provided? |
20:23:29 | FromDiscord | <exelotl> yes, for example you can assign them to `Option` types and then check if they're `none` afterwards: https://github.com/exelotl/natu/blob/devel/tools/gbafix.nim#L99-L104 |
20:23:42 | FromDiscord | <exelotl> (or in this case I just check for empty string) |
20:23:59 | FromDiscord | <TennisBowling> hey everyone, I'm just getting into nim, and I have some packages in python that I was wondering how I could import them into a nim program (can I even?) |
20:24:07 | FromDiscord | <exelotl> (edit) "yes, for example you can assign them to ... `Option`type" added "variables of the" | "types" => "type" |
20:24:36 | FromDiscord | <Yardanico> In reply to @TennisBowling "hey everyone, I'm just": https://github.com/yglukhov/nimpy |
20:25:01 | FromDiscord | <TennisBowling> wow |
20:25:06 | FromDiscord | <TennisBowling> thanks! |
20:26:19 | FromDiscord | <TennisBowling> also, I read that you can compile nim to c++. how can I do this? |
20:26:26 | FromDiscord | <Yardanico> `nim cpp` |
20:26:32 | FromDiscord | <Yardanico> or `nimble cpp` if you're using nimble |
20:26:49 | FromDiscord | <Yardanico> but C++ still acts as a backend for Nim, so don't expect perfect human-readable C++ |
20:27:05 | FromDiscord | <exelotl> @Rika any idea why it would fail when I change it from `func` to `template`? π€ |
20:27:12 | FromDiscord | <exelotl> https://play.nim-lang.org/#ix=2VRW |
20:34:46 | FromDiscord | <haxscramper> In reply to @Yardanico "but C++ still acts": IMHO it is safe that you can expect code that is more readable than most C++ |
20:34:52 | FromDiscord | <Yardanico> In reply to @haxscramper "IMHO it is safe": XD |
20:34:52 | FromDiscord | <haxscramper> (edit) "In reply to @Yardanico "but C++ still acts": IMHO it is safe ... that" added "to say" |
20:35:11 | FromDiscord | <Yardanico> I mean surely, because nim's C++ backend doesn't use any complex C++ features |
20:36:05 | FromDiscord | <Rika> generic template be funky |
20:36:08 | FromDiscord | <haxscramper> Yes, from what I can tell the only thing that makes it not-very-readable is reliance on gotos (for inlined templates and other constructs that cannot really be mapped to "native" C++) |
20:36:14 | FromDiscord | <haxscramper> (edit) "Yes, from" => "From" |
20:40:26 | * | Vladar quit (Quit: Leaving) |
20:45:40 | FromDiscord | <SivadNai> Anyone a wiz with winim? I wanted to use nim to adjust display resolution, but i don't get how to use EnumDisplaySettings() |
21:02:40 | ForumUpdaterBot | New question by SlightlyKosumi: How to resize display resolution on windows with nim, see https://stackoverflow.com/questions/67065630/how-to-resize-display-resolution-on-windows-with-nim |
21:06:20 | * | Jesin joined #nim |
21:10:04 | FromDiscord | <ElegantBeef> I dont even see what module that procedure comes from sivad |
21:10:23 | FromDiscord | <ElegantBeef> winim docs dont list it anywhere |
21:10:36 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/831275130516275220/unknown.png |
21:11:09 | FromDiscord | <ElegantBeef> Hey it has docs, if it's not there it should be π |
21:12:11 | * | narimiran quit (Ping timeout: 240 seconds) |
21:12:24 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Hey it has docs,": i only trust source code :) |
21:12:42 | FromDiscord | <ElegantBeef> Well the docs are source code |
21:12:59 | FromDiscord | <Yardanico> not when some project says that they have some specific feature in readme |
21:13:01 | FromDiscord | <Yardanico> but it's not in source code |
21:13:13 | FromDiscord | <Yardanico> so they just lied to me |
21:13:17 | FromDiscord | <ElegantBeef> Eitherway we can both agree the docs should list it |
21:13:23 | FromDiscord | <Yardanico> they probably do |
21:13:23 | FromDiscord | <Solitude> In reply to @ElegantBeef "Well the docs are": source code is docs |
21:13:40 | FromDiscord | <ElegantBeef> I checked every module on their docs it's not there |
21:14:22 | FromDiscord | <Yardanico> well I guess that generating docs for all of the win api in a single file might be a little bit bad |
21:14:40 | FromDiscord | <ElegantBeef> Informative though |
21:14:49 | FromDiscord | <Yardanico> In reply to @ElegantBeef "Informative though": except that your browser will not open it :) |
21:14:58 | FromDiscord | <TennisBowling> okay one last question from me (I promise!) is there any way to port all my python code to nim without needing to rewrite it all? |
21:15:01 | FromDiscord | <Yardanico> https://github.com/khchen/winim/blob/master/winim/inc/winuser.nim look how many exported stuff are there |
21:15:03 | FromDiscord | <Yardanico> In reply to @TennisBowling "okay one last question": no |
21:15:05 | FromDiscord | <SivadNai> I kind of expect winim to be light on documentation, considering what it is doind |
21:15:15 | FromDiscord | <Yardanico> In reply to @SivadNai "I kind of expect": yeah, most of the stuff there is just plain win api |
21:15:17 | FromDiscord | <ElegantBeef> Dynamic typed -> Static typed is a pain in the ass |
21:15:18 | FromDiscord | <Yardanico> it doesn't need "documentation" |
21:15:28 | FromDiscord | <TennisBowling> In reply to @Yardanico "no": okay, thats fine |
21:15:29 | FromDiscord | <Yardanico> msdn already documents everything |
21:17:46 | * | clyybber quit (Ping timeout: 252 seconds) |
21:24:29 | FromDiscord | <SivadNai> the python example dressed up enumDisplaySettings() and changeDisplaySettings() in romper suits |
21:39:27 | * | tane quit (Quit: Leaving) |
21:50:04 | ForumUpdaterBot | New post on r/nim by phpOstrich: Nimext, see https://reddit.com/r/nim/comments/mpo8lc/nimext/ |
22:06:21 | * | haxscramper joined #nim |
22:06:23 | * | haxscramper quit (Remote host closed the connection) |
22:11:09 | FromDiscord | <pointystick> @SivadNai here's an example of using ChangeDisplaySettings. I wrote it a couple of years ago (before Nim 1.0) but it should still work. https://play.nim-lang.org/#ix=2VSz |
22:25:41 | * | leorize quit (Remote host closed the connection) |
22:26:15 | * | leorize joined #nim |
22:49:12 | ForumUpdaterBot | New thread by Deech: Perceus: Optimized Ref Counting For Koka, see https://forum.nim-lang.org/t/7784 |
22:52:48 | * | abm joined #nim |
23:02:47 | FromDiscord | <Gennadiy> The `product` proc in `algorithm` produces the cartesian product of an array. It is defined like so:β΅`proc product[T](x: openArray[seq[T]]): seq[seq[T]]`β΅How would I get the cartesian product of two arrays/sequences of different types, e.g., `proc product[T, R]`? |
23:06:39 | FromDiscord | <Rika> in that case what would the return type be |
23:13:33 | FromDiscord | <Gennadiy> Good question. A seq of tuples: seq[seq[(T,R)]]. I hope I wrote that correctly. |
23:14:38 | FromDiscord | <Rika> seq[seq[tuple[a: T, b: R]]] |
23:15:37 | FromDiscord | <Gennadiy> Thanks, that makes more sense. |
23:22:36 | FromDiscord | <Gennadiy> sent a long message, see http://ix.io/2VST |
23:29:42 | FromDiscord | <InventorMatt> you could easily create that like this https://play.nim-lang.org/#ix=2VSV |
23:40:16 | FromDiscord | <Gennadiy> That could work. Thanks @InventorMatt . |
23:41:14 | * | xet7 quit (Remote host closed the connection) |
23:42:26 | * | wasted_youth2 joined #nim |