00:26:42 | * | jmdaemon quit (Ping timeout: 250 seconds) |
00:27:04 | NimEventer | New thread by Naterlarsen: Wish to use nim to take a screenshot of my desktop background , see https://forum.nim-lang.org/t/9999 |
00:28:07 | * | jmdaemon joined #nim |
00:33:32 | * | sagax quit (Quit: Konversation terminated!) |
00:35:48 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qQo |
00:36:16 | FromDiscord | <Elegantbeef> How is arc complaining you're making a cycle? |
00:36:29 | FromDiscord | <Ayy Lmao> This shouldn't be making a cycle correct? |
00:36:44 | FromDiscord | <Ayy Lmao> It's saying `Warning: ':env.info1.createInstance = (:anonymous, :env)' creates an uncollectable ref cycle; annotate 'info1' with .cursor` |
00:36:51 | FromDiscord | <Elegantbeef> Arc doesnt track manually managed memory |
00:37:13 | FromDiscord | <Ayy Lmao> Info is a ref btw |
00:37:17 | FromDiscord | <Elegantbeef> Oh it has cycle analysis for closures it seems |
00:37:33 | FromDiscord | <Elegantbeef> If you want to remove the cycle give the proc a parameter that is `info` |
00:38:18 | FromDiscord | <Ayy Lmao> I'll see if I can do that |
00:38:37 | FromDiscord | <Elegantbeef> The cycle is created cause `info -> closure -> closureEnv -> infoField -> info ->...` |
00:40:28 | FromDiscord | <Ayy Lmao> In reply to @Elegantbeef "If you want to": That seems to fix it, thanks! |
00:46:24 | NimEventer | New Nimble package! jsFetchMock - A simple lib to intercept Javascript fetch to capture or edit the data, see https://git.ozzuu.com/thisago/jsfetchMock |
01:01:09 | * | derpydoo joined #nim |
01:20:56 | * | Nick62 joined #nim |
01:22:29 | * | azimut joined #nim |
01:22:58 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=4qQA |
01:23:08 | FromDiscord | <Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=4qQA" => "https://play.nim-lang.org/#ix=4qQB" |
01:25:47 | FromDiscord | <Elegantbeef> `test(cast[pointer](dog))` |
01:25:54 | FromDiscord | <Elegantbeef> References are pointer equals |
01:26:03 | FromDiscord | <Elegantbeef> You took an address to the stack value |
01:26:42 | FromDiscord | <Ayy Lmao> Ah that makes sense |
01:26:47 | FromDiscord | <Elegantbeef> I am scared that you're doing a cast and using \`pointer |
01:29:00 | FromDiscord | <Ayy Lmao> I am trying to use dynamic dispatch with a user pointer in a c library. |
01:31:07 | FromDiscord | <pattmax> Can Nim's compiler pedigree be traced back? |
01:34:55 | FromDiscord | <Elegantbeef> Meaning what exactly |
01:37:28 | NimEventer | New thread by elcritch: Cheerp 3.0? C++ to WASM compiler, see https://forum.nim-lang.org/t/10000 |
01:49:40 | FromDiscord | <pattmax> In reply to @Elegantbeef "Meaning what exactly": Nim's compiler was originally bootstrapped with this old C implementation, compiled with GCC |
01:49:49 | FromDiscord | <pattmax> so you can recreate the steps to get the current compiler |
01:50:14 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/csources_v2 |
01:50:26 | FromDiscord | <Elegantbeef> Nim's compiler was never written in C |
01:50:41 | FromDiscord | <Elegantbeef> It was written in Pascal transpiled to Nim then generates Cc |
01:51:21 | FromDiscord | <pattmax> got it, thank you |
01:51:46 | FromDiscord | <Elegantbeef> You can clone the repo and use `./build_all.sh` to bootstrap and everything |
01:55:46 | * | jmdaemon quit (Ping timeout: 276 seconds) |
01:57:02 | * | azimut quit (Ping timeout: 255 seconds) |
01:58:08 | * | azimut joined #nim |
02:22:25 | * | jmdaemon joined #nim |
02:52:04 | * | Nick62 quit (Quit: Client closed) |
03:05:03 | * | Nick62 joined #nim |
03:05:10 | FromDiscord | <Takemichi Hanagaki> In reply to @Elegantbeef "It was written in": I'm curious now, what is the reason of the pascal choice? |
03:07:42 | FromDiscord | <Elegantbeef> If you havent noticed the entire language is pascal |
03:08:01 | FromDiscord | <Elegantbeef> Araq liked turbo(or object?) pascal |
03:24:54 | FromDiscord | <Takemichi Hanagaki> Got it! |
03:30:02 | FromDiscord | <Rika> pretty sure it was object |
04:16:36 | * | lumo_e quit (Quit: Quit) |
04:17:30 | FromDiscord | <sOkam!> Is there a way to check if the file is compiled with -gc:none in a define?↵i know you can do `when defined(orc):`, etc... but what about lack of a gc? |
04:19:06 | * | Nick62 quit (Quit: Client closed) |
04:19:33 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/compilesettings.html#querySetting%2CSingleValueSetting |
04:26:25 | * | arkurious quit (Quit: Leaving) |
04:37:54 | * | Zevv_ is now known as Zevv |
04:41:12 | FromDiscord | <sOkam!> ty ✍️ |
04:54:19 | * | Nick62 joined #nim |
05:10:41 | * | rockcavera quit (Remote host closed the connection) |
05:47:15 | * | fallback quit (Ping timeout: 260 seconds) |
05:55:05 | * | fallback joined #nim |
06:12:02 | FromDiscord | <JeysonFlores> Which is the best tooling (Editor, lsp) for developing in Nim? |
06:18:17 | FromDiscord | <amadan> vscode with the nim plugin by saem with either nimlsp or nimlangserver is what I think most poeple use |
06:21:46 | * | Nick62 quit (Quit: Client closed) |
06:26:09 | * | derpydoo quit (Quit: derpydoo) |
06:27:22 | NimEventer | New thread by alexeypetrushin: Nim ORC example benchmark, see https://forum.nim-lang.org/t/10001 |
06:41:08 | * | Nick62 joined #nim |
06:55:31 | FromDiscord | <sOkam!> can a `ptr int` reference a `array[N, int]`? |
06:56:21 | FromDiscord | <Rika> What do you mean? |
06:56:32 | FromDiscord | <sOkam!> in C, an array is just a pointer |
06:56:49 | FromDiscord | <Rika> A ptr int is a ptr int. There is no other interpretation unless you use cast |
06:56:59 | FromDiscord | <sOkam!> so was wondering if I can use it as a way to pass an array of unkown size, but known type, to a proc as input |
06:57:02 | FromDiscord | <Elegantbeef> You can do `myArray[0].addr` if you want |
06:57:11 | FromDiscord | <Elegantbeef> But it's just pointer to an element |
06:57:24 | FromDiscord | <Rika> Beef say the sacred type name |
06:57:29 | FromDiscord | <Rika> Unchecked array |
06:57:42 | FromDiscord | <Elegantbeef> Yep use `ptr UncheckedArray[int]` and be sane |
06:57:44 | FromDiscord | <sOkam!> oh didn't remember about those |
06:57:49 | FromDiscord | <Elegantbeef> Do not fall into C's untyped madness |
06:57:52 | FromDiscord | <sOkam!> tyty |
06:58:01 | FromDiscord | <sOkam!> yeah, i really want them to be typed |
06:58:14 | FromDiscord | <Elegantbeef> Then whatever you write make an alias that takes `var openarray[int]` |
06:59:07 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html has a section on openArray if you care |
06:59:13 | FromDiscord | <Elegantbeef> Gotta whore shitty writing |
07:18:47 | * | PMunch joined #nim |
07:22:26 | FromDiscord | <sOkam!> feels like openArray is like `SomeNumber` for array types? or am i misunderstanding |
07:22:41 | FromDiscord | <Elegantbeef> It's not |
07:22:44 | FromDiscord | <Elegantbeef> It's not generic |
07:25:41 | FromDiscord | <sOkam!> kk |
07:26:12 | FromDiscord | <sOkam!> do streams work in gc:none, btw? |
07:26:31 | FromDiscord | <Elegantbeef> StringStreams obviously do not |
07:26:38 | FromDiscord | <sOkam!> im used to working with files as raw strings, or seq[uint8], but without the gc don't know what to do with them |
07:26:58 | FromDiscord | <Elegantbeef> Streams are also ref objects |
07:27:31 | FromDiscord | <sOkam!> how do you do io in gcnone then 🤔 |
07:28:17 | PMunch | Low-level file IO I guess |
07:28:27 | PMunch | Why are you using gc:none? |
07:28:31 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/io.html#readBytes%2CFile%2CopenArray%5B%5D%2CNatural%2CNatural↵https://nim-lang.org/docs/io.html#readBuffer%2CFile%2Cpointer%2CNatural |
07:28:33 | FromDiscord | <sOkam!> learning |
07:28:44 | PMunch | Ah right |
07:30:13 | FromDiscord | <sOkam!> wait, `File` are not streams? |
07:30:47 | FromDiscord | <sOkam!> im confused |
07:31:02 | FromDiscord | <Elegantbeef> Files are not streams |
07:31:05 | FromDiscord | <Elegantbeef> That's why filestreams exist |
07:31:23 | FromDiscord | <Elegantbeef> Files are the lowest level Nim's IO gets |
07:31:25 | FromDiscord | <sOkam!> https://media.discordapp.net/attachments/371759389889003532/1085465258396745728/image.png |
07:31:36 | FromDiscord | <sOkam!> i saw "stream" there, and got giga-confused |
07:31:50 | FromDiscord | <sOkam!> kk, all good then |
07:32:11 | FromDiscord | <Elegantbeef> The only thing is you need some API to get a filehnalde |
07:32:12 | FromDiscord | <Elegantbeef> handle even |
07:32:53 | FromDiscord | <sOkam!> what do you mean by api? the one that io provides, or one that i need to write for gcnone? |
07:33:09 | FromDiscord | <Elegantbeef> `open` uses a `string` |
07:33:21 | FromDiscord | <Elegantbeef> So you have to use some other method of getting the file opened |
07:33:54 | FromDiscord | <Elegantbeef> This is why I say there is little value in learning without arc |
07:34:02 | FromDiscord | <Elegantbeef> You equally can treat `newSeq` as `malloc` |
07:34:05 | FromDiscord | <Elegantbeef> or `new` as malloc |
07:34:17 | FromDiscord | <Elegantbeef> Then you can use the pointer operating procedures |
07:34:28 | FromDiscord | <sOkam!> why would i write arc, when i can write orc |
07:34:29 | FromDiscord | <Elegantbeef> And you get the exact same learning without having to rewrite from scratch |
07:34:34 | FromDiscord | <sOkam!> i have no need for arc |
07:34:41 | FromDiscord | <sOkam!> its the same idea as orc, just lower level |
07:34:54 | FromDiscord | <Elegantbeef> It's the same level as orc |
07:35:10 | FromDiscord | <sOkam!> then more on my point 🙈 |
07:35:29 | FromDiscord | <sOkam!> i know gc:none is dumb, but the point of it is not usefulness, its the learning |
07:35:37 | FromDiscord | <Elegantbeef> Sure you can also use orc and do the same as i suggested |
07:36:04 | FromDiscord | <Elegantbeef> If you read my point I did not say "Just use arc" |
07:36:09 | FromDiscord | <Elegantbeef> I said use arc with pointer procedures |
07:36:20 | FromDiscord | <Elegantbeef> Treat Nim types as allocators and use them as such |
07:36:23 | FromDiscord | <sOkam!> also, whats the fun of a challenge if you are allowed to break the rules as you see fit? there is no fun in that |
07:36:34 | FromDiscord | <Elegantbeef> Instead of using `readFile` you use `readBuffer` |
07:37:01 | FromDiscord | <Elegantbeef> Then check your program with valgrind and other tools to see if you did something wrong |
07:37:19 | FromDiscord | <sOkam!> kk |
07:39:29 | FromDiscord | <Elegantbeef> Plus if you use arc, you can learn how to properly make custom collections with hooks that function for arc + orc |
07:39:38 | FromDiscord | <Elegantbeef> It's just better for learning anyway |
07:39:57 | FromDiscord | <Elegantbeef> Afterall manual memory management is mostly just inserting `malloc` and `free` in a RAII like fashion |
07:41:33 | FromDiscord | <sOkam!> Afterall hardcore minecraft is mostly just playing minecraft normally, in a more careful fashion |
07:41:37 | FromDiscord | <sOkam!> same deal |
07:41:49 | FromDiscord | <Elegantbeef> You are missing the point |
07:41:54 | FromDiscord | <sOkam!> no i see it |
07:42:07 | FromDiscord | <sOkam!> i just want to play the gc:none game, that's all |
07:42:35 | FromDiscord | <sOkam!> its not for the usefulness, its for the fun challenging learning |
07:42:56 | FromDiscord | <sOkam!> i could probably learn more efficiently in arc, but that's missing the point of the idea |
07:51:56 | FromDiscord | <sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4qRq |
07:52:29 | FromDiscord | <Elegantbeef> If something doesnt work it's not "non covered functionality" it's a the broken nimsuggest |
07:53:22 | FromDiscord | <sOkam!> yeah but sometimes its hard to know if typo or actual error |
07:54:43 | * | kenran joined #nim |
08:06:11 | PMunch | I have to say, I'm still shocked by how well Futhark works. Currently doing some work in Gtk with webview and I can just throw in extra imports and everything just works |
08:06:49 | * | rmt joined #nim |
08:07:22 | PMunch | But I might have to change out the JSON parser.. |
08:07:35 | PMunch | The built in Nim one is pretty slow at compile-time |
08:07:58 | PMunch | But that might just be compile-time slowness in general.. |
08:10:03 | PMunch | Hmm, I am throwing 981031 lines of JSON at it though, so that might be why it takes a while.. |
08:10:18 | FromDiscord | <Elegantbeef> Well being the slowest parser doesnt help regardless 😄 |
08:31:06 | * | Notxor joined #nim |
08:31:36 | PMunch | What other compile-time JSON parsers are there out there? |
08:31:38 | PMunch | jsony? |
08:35:14 | FromDiscord | <sOkam!> pmunch, ever tested futhark in gc:none, or only on usual gc? |
08:35:32 | PMunch | I haven't tested it, but it should work fine |
08:35:45 | PMunch | I mean it just wraps C code, and C code doesn't have GC anyways |
08:44:15 | NimEventer | New thread by grd: A list of programs, see https://forum.nim-lang.org/t/10002 |
08:49:43 | * | Notxor quit (Read error: Connection reset by peer) |
08:49:45 | * | Notxor_ joined #nim |
09:18:49 | FromDiscord | <ieltan> Hello |
09:20:50 | FromDiscord | <ieltan> I was wondering if `break`ing from a try block if a condition fails was good practice ? or does this falls into the "don't use exceptions for control flow" category ? |
09:22:40 | PMunch | Breaking from a try block? |
09:22:46 | PMunch | Is that even possible? |
09:23:24 | PMunch | Ah, no that's not possible |
09:24:02 | PMunch | Or did you mean to wrap the entire try statement in block? |
09:24:41 | FromDiscord | <Elegantbeef> It is possible to break flow control from a try block |
09:25:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4qRL |
09:25:40 | FromDiscord | <Elegantbeef> I think it's likely fine, but ymmv |
09:26:15 | PMunch | That's not breaking though, that's just throwing an exception :P |
09:26:33 | PMunch | https://play.nim-lang.org/#ix=4qRN |
09:26:35 | FromDiscord | <ieltan> https://play.nim-lang.org/#ix=4qRM |
09:26:50 | FromDiscord | <ieltan> you cannot break from a bare try block |
09:26:51 | FromDiscord | <ieltan> my bad |
09:26:58 | PMunch | Exactly |
09:27:17 | PMunch | What I normally do is to break from a block (named or otherwise) |
09:27:41 | FromDiscord | <ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4qRO |
09:28:02 | PMunch | The benefit of this over an exception is that there is no expensive stack trace gathering/object creation stuff. But of course you don't get bubbling |
09:28:24 | FromDiscord | <ieltan> In reply to @PMunch "What I normally do": I just started experimenting with this too |
09:28:52 | PMunch | Named blocks are great because then you don't have to worry about suddenly having a for loop in your code which breaks things |
09:29:03 | FromDiscord | <ieltan> I just wrapped a bunch of early return in a `block` and replaced `return`with `break` |
09:29:06 | FromDiscord | <ieltan> this is really great |
09:32:13 | PMunch | Of course if you don't want to name every block you can do something like this: https://play.nim-lang.org/#ix=4qRP |
09:32:33 | PMunch | @ieltan, also keep in mind that blocks implicitly return their last element |
09:32:52 | PMunch | https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html |
09:33:07 | PMunch | So you can have complex logic which puts a value into an immutable variable |
09:45:02 | * | azimut quit (Quit: ZNC - https://znc.in) |
09:48:57 | * | azimut joined #nim |
10:02:00 | * | Nick62 quit (Quit: Client closed) |
10:22:21 | FromDiscord | <sOkam!> is there a version of `echo` without `\n` added? |
10:22:30 | PMunch | stdout.write |
10:24:35 | FromDiscord | <sOkam!> worked, ty ✍️ |
10:33:47 | FromDiscord | <djazz> It doesnt flush I think? stdout.flushFile() |
10:35:19 | PMunch | Indeed it doesn't auto-flush, but that's rarely an issue IME |
10:36:39 | * | Nick62 joined #nim |
10:47:48 | * | Nick62 quit (Quit: Client closed) |
10:51:54 | Zevv | it's an issue when you don't emit a newline |
10:52:49 | * | derpydoo joined #nim |
11:03:06 | PMunch | True |
11:03:23 | PMunch | I tend to use stdout.write to build up strings in the output without having to concatenate them first |
11:09:42 | PMunch | So at some point I will output a newline |
11:12:04 | PMunch | What do people use in Nim to store simple program state across runs? |
11:12:38 | PMunch | A database would of course work, but I'm just curious if people are using something more specific for the task |
11:20:34 | FromDiscord | <sOkam!> how can you buildup a cstring of some sort when using gcnone? |
11:21:06 | FromDiscord | <sOkam!> i guess you preallocate a string big enough? |
11:21:16 | FromDiscord | <sOkam!> (edit) "a string" => "an array" |
11:21:37 | FromDiscord | <ieltan> In reply to @PMunch "What do people use": I would assume json since it's "simple state". |
11:21:50 | FromDiscord | <ieltan> Also thanks for the link you have sent to me |
11:22:11 | PMunch | Link? |
11:22:19 | PMunch | Oh, to my website :P No problem |
11:22:23 | FromDiscord | <ieltan> In reply to @PMunch "<@256520101015060480>, also keep in": this |
11:22:35 | PMunch | Yeah JSON would probably be an okay choice |
11:22:41 | FromDiscord | <ieltan> I really love this "exception-free" programming |
11:22:55 | PMunch | sOkam, yeah pretty much |
11:23:00 | PMunch | @ieltan, good to hear :) |
11:23:26 | FromDiscord | <ieltan> also you can sort of do the same thing with `while true:` in Python, very intriguing that i only hear about this technique now |
11:23:34 | PMunch | sOkam, you can of course also pass in a pointer to anything to stuff which takes a cstring |
11:24:01 | FromDiscord | <ieltan> of course in python you cannot name the while loop |
11:24:04 | PMunch | So you could have a global array with some set capacity and just build all your messages there if you don't want to malloc/free all the time |
11:24:11 | FromDiscord | <ieltan> so it is kinda limited |
11:24:20 | FromDiscord | <sOkam!> ah good idea for bigger tasks |
11:24:21 | PMunch | @ieltan, well you can't name loops in Nim either |
11:24:34 | PMunch | But you can always add a block :) |
11:25:02 | FromDiscord | <sOkam!> in this case im building up a file, and have known size, so should be fine with an array. just have to go back to thinking in C land, Nim has spoiled me with comfort 🙂 |
11:25:19 | PMunch | sOkam, if you want to go real crazy you can build your own strutils lib of sorts which just acts on the global string buffer :P |
11:25:22 | FromDiscord | <ieltan> yes, i was saying that because to my knowledge there is no `block` in python |
11:25:47 | PMunch | sOkam, well in that case you can just write directly to the file |
11:26:48 | PMunch | @ieltan, yeah it's not a super common feature |
11:26:52 | FromDiscord | <sOkam!> isn't that gonna be super slow |
11:26:55 | PMunch | Really useful though |
11:27:15 | PMunch | sOkam, why would that be slow? If you need to write to the file anyways |
11:27:25 | PMunch | Your OS should buffer the file for you |
11:27:28 | FromDiscord | <sOkam!> yeah but with the array you write all at once |
11:30:01 | FromDiscord | <sOkam!> sent a code paste, see https://paste.rs/3OW |
11:31:49 | PMunch | Are w and h cstrings as well? |
11:31:57 | FromDiscord | <sOkam!> numbers |
11:32:07 | FromDiscord | <sOkam!> but will be chars too |
11:32:17 | PMunch | Then I believe you have to turn them into cstrings manually |
11:32:28 | PMunch | I don't think there is a cstrutils anywhere |
11:32:41 | PMunch | This has annoyed me a bit when doing stuff with Ratel as well |
11:32:50 | FromDiscord | <Rika> In reply to @PMunch "I don't think there": 🙂 |
11:32:53 | FromDiscord | <Rika> Check again |
11:33:11 | FromDiscord | <sOkam!> #sendlinks 🙂 |
11:33:13 | FromDiscord | <Rika> I was pretty sure theres smth like such but much more basic |
11:33:27 | PMunch | Holy shit: https://github.com/nim-lang/Nim/blob/devel/lib/pure/cstrutils.nim |
11:33:38 | FromDiscord | <sOkam!> oh niice |
11:33:39 | FromDiscord | <Rika> 😂 |
11:33:40 | PMunch | Eh, okay |
11:33:47 | PMunch | That wasn't as useful as I expected |
11:33:47 | FromDiscord | <Rika> Not a lot in it |
11:33:54 | FromDiscord | <Rika> Theres smth though, needs more |
11:33:58 | PMunch | Sure |
11:34:10 | PMunch | But for turning e.g. a number into a cstring it doesn't help much |
11:34:53 | FromDiscord | <sOkam!> oh its only basic comparisons 😔 |
11:37:40 | FromDiscord | <sOkam!> i guess i can always wrap some things in <string.h> |
11:40:28 | PMunch | Yeah that's pretty common |
11:40:34 | PMunch | A lot of sprintf |
12:10:32 | FromDiscord | <sOkam!> man i completely forgot how damn painful char are in C 😭 |
12:11:35 | NimEventer | New thread by exelotl: .o files going missing before linking?, see https://forum.nim-lang.org/t/10004 |
12:33:48 | * | derpydoo quit (Ping timeout: 255 seconds) |
12:44:39 | PMunch | sOkam, that's why we use Nim :P |
12:44:50 | FromDiscord | <System64 ~ Flandre Scarlet> https://nim-lang.org/blog/2020/06/30/ray-tracing-in-nim.html↵Faster than C++? Is that true? |
12:45:35 | PMunch | @System64_~_Flandre_Scarlet, sure, why wouldn't it be? |
12:45:44 | PMunch | A weird thing to lie about in an article.. |
12:46:22 | FromDiscord | <System64 ~ Flandre Scarlet> That's pretty impressive since I thought C/C++ were the fastests |
12:47:20 | PMunch | Indeed. The reason Nim is able to get an edge is because it outputs C code you wouldn't dream of writing by hand |
12:47:52 | PMunch | You could of course write the same thing it C/C++, but it wouldn't be very readable |
12:52:03 | FromDiscord | <System64 ~ Flandre Scarlet> So high level language that optimize your output C/C++ Code and then you also have GCC that optimize your code again |
12:52:12 | * | derpydoo joined #nim |
12:52:20 | FromDiscord | <0ffh> In reply to @System64 "That's pretty impressive since": Classically, it's more like FORTRAN is the fastest, though with modern C (with the restricted keyword, etc) you might get there. |
12:53:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @0ffh "Classically, it's more like": Oh interesting↵And is FORTRAN as hard as C? |
12:53:07 | FromDiscord | <0ffh> Most C++ features tend to make it slower than C. |
12:53:37 | FromDiscord | <0ffh> In reply to @System64 "Oh interesting And is": What is hard? You mean hard to learn or? |
12:54:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @0ffh "What is hard? You": to learn and to master |
12:54:24 | PMunch | Nim Fortran target when? |
12:54:44 | FromDiscord | <0ffh> In reply to @System64 "to learn and to": I honestly don't know. I suppose it depends. |
12:57:20 | FromDiscord | <System64 ~ Flandre Scarlet> Btw, how does ARC/ORC work? And does it have impact on performances? |
12:58:25 | FromDiscord | <Nerve> In reply to @System64 "Btw, how does ARC/ORC": https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html |
13:03:58 | * | randomuser464876 joined #nim |
13:04:16 | * | Notxor_ quit (Quit: Leaving) |
13:07:49 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4qT4 |
13:07:57 | PMunch | Definitely has an impact on performance, but mostly a positive one |
13:08:29 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Definitely has an impact": I thought GCs has negative impacts on performances? |
13:16:35 | * | randomuser464876 quit (Quit: Client closed) |
13:17:03 | PMunch | Well, it depends |
13:17:03 | * | randomuser464876 joined #nim |
13:17:16 | PMunch | I really meant compared to the refc GC |
13:17:21 | PMunch | The original one |
13:18:21 | PMunch | ARC does automatic reference counting (kinda in the name), which means that things will get freed as they drop out of the scope. This won't really add any more overhead on runtime than what manual reference counting does |
13:18:44 | FromDiscord | <auxym> I mean, you can absolutely write poorly performing code with manual MM, too. Allocating all the time in a hot loop, for example. Memory leaks aren't great for performance, either. |
13:19:18 | PMunch | With ORC it has to scan for cycles, which is a hit to performance, but it shouldn't be that much |
13:20:04 | FromDiscord | <auxym> In reply to @System64 "Oh this is interesting": Nim doesn't support cyclical imports, yet. It's on the roadmap for 2.2 or something like that IIRC |
13:21:55 | FromDiscord | <auxym> https://github.com/nim-lang/RFCs/issues/503 |
13:22:25 | FromDiscord | <jmgomez> What a paint it was to get rid of cycles on NimForUE |
13:22:47 | FromDiscord | <jmgomez> (edit) "paint" => "pain" |
13:30:23 | PMunch | Damn, my Futhark'd Gtk wrapper is over 200k lines.. Glad I didn't have to write that by hand |
13:37:40 | FromDiscord | <ShalokShalom> Hnn, both open() and readFile() complain about an "unhandled exception" |
13:37:47 | FromDiscord | <jmgomez> In reply to @PMunch "Damn, my Futhark'd Gtk": How long does it takes you to compile it? |
13:38:10 | FromDiscord | <ShalokShalom> sent a code paste, see https://play.nim-lang.org/#ix=4qTc |
13:38:25 | FromDiscord | <ShalokShalom> https://nim-by-example.github.io/files/ |
13:38:36 | PMunch | Without the cache it takes a little while :P |
13:38:51 | FromDiscord | <jmgomez> I mean the Nim part |
13:39:01 | PMunch | Hold on, let me time it |
13:39:24 | PMunch | What do you mean? When Futhark has already run the compilation takes seconds, if that |
13:39:48 | FromDiscord | <jmgomez> yeah, like if you do it with `--compileOnly` |
13:40:12 | FromDiscord | <jmgomez> I had to really split and hack around the NUE bindings to get decent Nim comp times |
13:40:34 | FromDiscord | <jmgomez> It is true that its probably 1M+ LoC |
13:41:02 | PMunch | How did you wrap that? |
13:41:34 | FromDiscord | <jmgomez> the bindings? With UE's reflection APIs |
13:41:40 | PMunch | Aah right |
13:41:51 | FromDiscord | <Nerve> In reply to @System64 "I thought GCs has": This entirely depends on how many allocations and deallocations your code is doing. For example, if a Java program were to create a number of objects using `new` and those objects and their references never went out of scope, the GC would never run. A GC only runs under two conditions: 1) It is set to periodically run, for example each frame in a game, 2) you attempt to allocate something new and |
13:41:57 | PMunch | Wait, do you run reflection on every compilation? |
13:42:13 | FromDiscord | <Nerve> Nim heavily prefers allocating to the stack, not the heap, so it's very easy to keep allocation, and thus GC activity, very low |
13:42:44 | FromDiscord | <jmgomez> Nope, I have a process that introspect the whole engine (including the user code looking for changes) and it something changes or runs another process where a Nim macro outputs Nim code that the user can consume to interop with UE |
13:43:02 | FromDiscord | <jmgomez> (edit) "it" => "if" |
13:43:43 | FromDiscord | <jmgomez> The whole thing, taking into account basic plugins and the fix of cycles, takes a few minutes to run on the first run |
13:44:04 | PMunch | Oh right, because this is within the UE editor? |
13:44:26 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Hnn, both open() and": runtime? what's the stacktrace |
13:44:53 | FromDiscord | <ShalokShalom> idk |
13:44:56 | FromDiscord | <ShalokShalom> how to check this? |
13:45:08 | FromDiscord | <ShalokShalom> I just hit F6 in VSCode 😛 |
13:45:17 | FromDiscord | <ShalokShalom> So nim c -r |
13:45:35 | * | rockcavera joined #nim |
13:45:40 | PMunch | Okay, without cache (and it has to rebuild the binding) this program takes 93s to compile. With cache it's 5.5s |
13:46:03 | FromDiscord | <jmgomez> In reply to @PMunch "Oh right, because this": Kind off, I managed to run it without the editor but yes, you need to start up the engine so it collects the metadata. They have a really hacky way of doing reflection |
13:46:20 | PMunch | I see |
13:46:23 | FromDiscord | <jmgomez> In reply to @PMunch "Okay, without cache (and": 5.5 should be the Nim part without minor changes? |
13:46:55 | FromDiscord | <jmgomez> if you change a file, like a leaf, what's the timing? |
13:47:07 | FromDiscord | <jmgomez> In reply to @ShalokShalom "So nim c -r": shouldnt that produce something on the console? |
13:47:07 | PMunch | A leaf? |
13:47:15 | FromDiscord | <jmgomez> yeah, like the entry point |
13:47:37 | PMunch | Huh? |
13:47:54 | FromDiscord | <ShalokShalom> In reply to @jmgomez "shouldnt that produce something": Yes? |
13:47:55 | PMunch | I just tried changing something in my main program it took 2.36s :P |
13:48:12 | FromDiscord | <jmgomez> ahh that's good then! |
13:48:15 | FromDiscord | <jmgomez> nice |
13:48:20 | FromDiscord | <ShalokShalom> In reply to @ShalokShalom "Hnn, both open() and": . |
13:48:24 | PMunch | Yeah, it's pretty nice :) |
13:48:39 | FromDiscord | <ShalokShalom> Error: unhandled exception: cannot open: config.toml [IOError]↵Error: execution of an external program failed: '/home/matthias/Documents/crown/backend ' |
13:48:49 | FromDiscord | <jmgomez> In reply to @ShalokShalom "Error: unhandled exception: cannot": yes, that |
13:49:05 | FromDiscord | <ShalokShalom> Idk why its complaining about an unhandled exception. How is an exception involved in this? |
13:49:10 | FromDiscord | <jmgomez> but the full thing if any. Can you open another file? |
13:49:24 | FromDiscord | <jmgomez> well, if there is an issue with the OS it should raise, shouldnt it? |
13:49:41 | FromDiscord | <ShalokShalom> there is nothing else |
13:50:05 | FromDiscord | <ShalokShalom> sent a long message, see http://ix.io/4qTh |
13:50:25 | FromDiscord | <ShalokShalom> https://paste.ee/p/PRmQK |
13:51:22 | FromDiscord | <jmgomez> it says that it cant open it. It may be the file missing or the path wrong or permissions? Not sure |
13:51:38 | FromDiscord | <ShalokShalom> Same thing with another file |
13:51:47 | FromDiscord | <jmgomez> try to use a full path |
13:51:49 | FromDiscord | <ShalokShalom> The files are in the same directory |
13:52:03 | FromDiscord | <ShalokShalom> Well, the error message isnt really saying anything in that regards |
13:52:14 | FromDiscord | <ShalokShalom> Why unhandled exception? |
13:52:17 | FromDiscord | <ShalokShalom> I will try |
13:52:17 | FromDiscord | <jmgomez> `/home/matthias/.choosenim/toolchains/nim-1.6.12/lib/system/io.nim(760) open` |
13:52:27 | FromDiscord | <jmgomez> `Error: unhandled exception: cannot open: config.toml [IOError]` |
13:52:27 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=4qTi |
13:53:30 | FromDiscord | <ShalokShalom> Yeah, seems to work with full path |
13:53:41 | FromDiscord | <ShalokShalom> Why not within the same directory, and the file name alone? |
13:53:47 | FromDiscord | <ShalokShalom> And why this error message? |
13:54:33 | FromDiscord | <ShalokShalom> Is this something that I considering worth reporting, or just the type of errors that are considered sufficient? |
13:54:33 | FromDiscord | <jmgomez> do `echo getCurrentDir()` (with OS imported) |
13:54:38 | FromDiscord | <ShalokShalom> thanks |
13:55:21 | FromDiscord | <ShalokShalom> /home/matthias |
13:55:31 | FromDiscord | <ShalokShalom> It seems to think its somewhere else |
13:55:37 | FromDiscord | <jmgomez> Not sure, I mean it's kind of clear if you are use to it. But it can be improved for sure, feel free to report an issue if you feel like it should be better |
13:55:56 | FromDiscord | <ShalokShalom> thanks a lot |
13:56:15 | FromDiscord | <ShalokShalom> https://nim-by-example.github.io/files/ |
13:56:36 | FromDiscord | <ShalokShalom> this article mentions "Suppose we have a file in the same directory as our nim program..." |
13:56:51 | FromDiscord | <ShalokShalom> So is the article incorrect, or..? |
13:57:25 | FromDiscord | <ShalokShalom> > Hint: /home/matthias/Documents/crown/backend [Exec]↵> /home/matthias |
13:57:35 | FromDiscord | <ShalokShalom> (second line is that getCurrentDir()) |
13:59:29 | FromDiscord | <jmgomez> 🤷♂️ |
13:59:53 | FromDiscord | <gogolxdong> `/home/ubuntu/flarenfts-backend/main.nim(3, 8) Error: cannot open file: web3` |
14:00:11 | * | jmdaemon quit (Ping timeout: 264 seconds) |
14:00:28 | FromDiscord | <gogolxdong> with latest devel and nimble |
14:00:39 | FromDiscord | <gogolxdong> (edit) "with latest devel ... and" added "Nim" |
14:01:31 | FromDiscord | <gogolxdong> (edit) "with latest devel Nim and nimble ... " added "and packages installed under NIMBLE_DIR/pkgs2" |
14:04:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "Nim doesn't support cyclical": Oh alright, it would be nice to have it! |
14:05:45 | * | kenran quit (Remote host closed the connection) |
14:07:45 | FromDiscord | <ShalokShalom> where do Nim programs usually put their configuration files? |
14:07:54 | FromDiscord | <ShalokShalom> is there some universal "for all OS" thing? |
14:09:00 | PMunch | https://nim-lang.org/docs/os.html#getConfigDir |
14:09:05 | PMunch | That's a good place to start |
14:10:26 | FromDiscord | <ShalokShalom> thanks a lot |
14:12:19 | * | Notxor joined #nim |
14:15:27 | FromDiscord | <gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1085566935133077544/image.png |
14:15:55 | FromDiscord | <gogolxdong> Any idea to make it right? |
14:16:49 | FromDiscord | <Phil> `import pkg/[... packages...]` |
14:16:57 | FromDiscord | <Phil> with ...packages... being what you're listing there |
14:17:24 | FromDiscord | <Phil> I generally recommend:↵- When importing from std-lib, import with `import std/[...package...]` |
14:17:48 | FromDiscord | <gogolxdong> yes, I've tried and got `/home/ubuntu/flarenfts-backend/main.nim(2, 11) Error: cannot open file: pkg/web3` |
14:17:52 | FromDiscord | <Phil> (edit) "std/[...package...]`" => "std/[...package...]`↵- When importing locally, import with `import ./<package_name>`↵- when importing another lib, import with `import pkg/[...packges..]`" |
14:18:06 | FromDiscord | <Phil> I assume you have done `nimble install web3`? |
14:18:12 | FromDiscord | <gogolxdong> sure |
14:18:34 | FromDiscord | <djazz> Added web3 to nimble file? |
14:19:00 | FromDiscord | <gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1085567830239498314/image.png |
14:19:31 | FromDiscord | <gogolxdong> https://media.discordapp.net/attachments/371759389889003532/1085567960334213120/image.png |
14:20:06 | FromDiscord | <djazz> Making a library? |
14:20:23 | FromDiscord | <Phil> Okay, weird, hmmmmm |
14:20:33 | FromDiscord | <Phil> Nah, it's a general problem, in a minimal example for me on devel it doesn't work either |
14:21:12 | FromDiscord | <Phil> Actually, that's just for web3 |
14:21:50 | FromDiscord | <Phil> I can compile `import pkg/prologue` on devel |
14:21:51 | FromDiscord | <Phil> weird |
14:22:41 | FromDiscord | <gogolxdong> It's for whatever move to the first place |
14:22:48 | FromDiscord | <gogolxdong> (edit) "move" => "moved" |
14:22:56 | FromDiscord | <Phil> One sec, I'm installing the libs you specified here |
14:22:59 | FromDiscord | <Phil> and the web3 takes ages |
14:23:13 | FromDiscord | <gogolxdong> `/home/ubuntu/flarenfts-backend/main.nim(2, 11) Error: cannot open file: pkg/prologue` |
14:23:14 | FromDiscord | <Phil> quite literally, it's been a hot minute now |
14:24:47 | FromDiscord | <Phil> What's your devel version? |
14:25:17 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4qTy |
14:26:18 | FromDiscord | <Phil> Just updated, you might be running into entirely different issues as well:↵> .....................................................................................................................................................................................................................................fatal.nim(51) sysFatal↵> Error: unhandled exception: field 'sym' is not accessible for type 'TNode' using 'kind = 65' [Field |
14:27:26 | FromDiscord | <Phil> with web3 I start running into ↵> /home/philipp/.nimble/pkgs/httputils-0.3.0/httputils.nim(607, 14) Error: undeclared identifier: 'shallowCopy'↵Which is fascinating because I'm on devel on the same version as you |
14:28:25 | FromDiscord | <Phil> Chronos has the same issue of shallowCopy not being defined, does that require some kind of flag? |
14:28:57 | FromDiscord | <gogolxdong> shallow should be removed due to ORC |
14:29:29 | FromDiscord | <gogolxdong> what's your nimble version, I noticed your packages installed under pkgs/ |
14:29:43 | FromDiscord | <gogolxdong> mine are installed under pkgs2/ |
14:30:15 | FromDiscord | <gogolxdong> sent a code paste, see https://play.nim-lang.org/#ix=4qTC |
14:30:18 | FromDiscord | <Phil> nimble automatically swaps when you use choosenim devel |
14:30:33 | FromDiscord | <Phil> So I agree that it's weird it's looking up under pkg and not pkgs2 |
14:30:36 | FromDiscord | <Phil> (edit) "pkg" => "pkgs" |
14:31:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qTE |
14:31:52 | FromDiscord | <Phil> > nimble v0.14.0 compiled at 2023-03-14 01:05:49↵> git hash: couldn't determine git hash |
14:32:23 | FromDiscord | <gogolxdong> Ok, got the same error, I have a fork of web3 fixed shallow things. |
14:34:18 | FromDiscord | <gogolxdong> (edit) "Ok, ... goterror" added "after cp whatever under pkgs2/ to pkgs/ , I" | "error," => "error with yours," |
14:55:09 | FromDiscord | <gogolxdong> Thanks for your help! I'm try to manage the rest. |
15:02:45 | FromDiscord | <Phil> Sorry I couldn't do more and good luck! |
15:07:23 | * | jmdaemon joined #nim |
15:17:21 | * | randomuser464876 quit (Quit: Client closed) |
15:26:40 | * | Notxor quit (Remote host closed the connection) |
16:06:00 | * | zgasma joined #nim |
16:09:55 | FromDiscord | <Nerve> Is there absolutely no way to get compile-time constant `JsonNode`s? |
16:10:31 | FromDiscord | <Nerve> I have some dynamic configurations for which I have presets, and having to instantiate them with `let` is slowing down my program's startup time |
16:24:12 | FromDiscord | <planetis> you can use std/marshal at compile time |
16:26:15 | * | arkurious joined #nim |
16:27:35 | * | PMunch quit (Quit: leaving) |
16:34:32 | FromDiscord | <Nerve> The point is that at runtime I am using the `JsonNode`s for configuration, and to have pre-made configurations I have to declare those with `let`. Unless you're saying it's possible to marshal JSON strings into const `JsonNode`s at compile time? So `%` is the thing that can't run at compile-time? |
16:34:48 | FromDiscord | <Nerve> (edit) "const `JsonNode`s" => "`const JsonNode`s" |
16:34:49 | * | Notxor joined #nim |
16:44:23 | FromDiscord | <Phil> In reply to @Nerve "Is there absolutely no": Best I can do you is read in at compile time and convert to JsonNode at runtime |
16:44:52 | FromDiscord | <Phil> Second best I can do you is: use jsony and stick with a static json setup |
16:45:24 | FromDiscord | <Nerve> It looks like `parse_json` can be called at compile time, seeing if it will work but I think I have some curly brace issues |
16:47:19 | FromDiscord | <Nerve> Okay nevermind, `JsonNode` is not a valid compile-time type |
16:47:32 | FromDiscord | <Nerve> `Error: invalid type: 'JsonNode' in this context: 'Table[system.string, json.JsonNode]' for const` |
16:48:04 | FromDiscord | <Nerve> I could store them as const strings and only parse them at runtime when I actually use them |
16:48:15 | FromDiscord | <Nerve> (edit) "const strings" => "`const string`s" |
16:49:00 | FromDiscord | <Nerve> Like you said above |
16:49:31 | * | jmdaemon quit (Ping timeout: 276 seconds) |
16:50:09 | * | jmdaemon joined #nim |
16:50:32 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qUD |
16:51:07 | FromDiscord | <Phil> If you can live with your json file being explicitly typed like the `Config` type here, then I highly recommend just using the jsony approach |
16:51:48 | FromDiscord | <Phil> I'd argue that it's more sensible to have your config file static like this either way, because then you don't need to wonder if config of name "x" actually exists, the compiler checks that for you |
16:53:44 | FromDiscord | <Phil> And that is just the minor benefits on top of the jsony way doing exactly what you originally wanted to do 😛 |
17:02:12 | FromDiscord | <Nerve> It's not a config file |
17:02:19 | FromDiscord | <Nerve> I'm not reading anything from file |
17:02:36 | FromDiscord | <Nerve> I have `JsonNode` literals using `%` |
17:02:44 | FromDiscord | <Nerve> Should have clarified that in the beginning, sorry |
17:03:00 | FromDiscord | <Nerve> This is not user-configurable stuff, they're pre-made so they're hard-coded |
17:03:52 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=4qUG |
17:04:19 | FromDiscord | <Nerve> In reply to @jmgomez "<@143177514385145856> you sure you": I don't know, what does this do? |
17:04:38 | FromDiscord | <jmgomez> it should give you your JsonNode at comp time |
17:04:41 | FromDiscord | <Nerve> Relative to const |
17:04:47 | FromDiscord | <Nerve> (edit) "const" => "`const`" |
17:05:10 | FromDiscord | <jmgomez> I think a ref object cant be const |
17:05:28 | FromDiscord | <jmgomez> which makes sense |
17:14:59 | FromDiscord | <Ntsékees> I've successfully compiled regexps at compile time in my last Nim project |
17:15:00 | NimEventer | New thread by noah: Testament + valgrind: importing asyncdispatch or threadpool causes valgrind to throw?, see https://forum.nim-lang.org/t/10005 |
17:15:44 | FromDiscord | <Ntsékees> so I don't see a reason you couldn't parse a JSON string at compile time |
17:18:36 | FromDiscord | <jmgomez> In reply to @jmgomez "": I mean.. |
17:35:49 | FromDiscord | <Hourglass [She/Her]> Question: Would it be better to do `Nim -> Java source code -> JVM bytecode`? Or directly to JVM bytecode? |
17:52:31 | FromDiscord | <turbo> I have an old bit of Nim code that invokes `.shallow` on a string. That doesn't seem to exist anymore. What did it do? |
17:54:11 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "Question: Would it be": For your users, going directly to JVM bytecode would be preferred under the assumption that Nim --> JVM bytecode is faster than Nim --> Java --> JVM Bytecode↵Compilation times can be a factor for folks.↵However, going directly to Bytecode may be harder than going to Java, so going first the easier route so that it at least exists could be saner. |
17:54:38 | FromDiscord | <Phil> (edit) "In reply to @Hourglass, When the Hour Strikes "Question: Would it be": For your users, going directly to JVM bytecode would be preferred under the assumption that Nim --> JVM bytecode is faster than Nim --> Java --> JVM Bytecode↵Compilation times can be" => "sent" | "factor for folks.↵However, going directly to Bytecode may be harder than going to Java, so going first the easier route so that it at least exists could be sane |
17:54:57 | FromDiscord | <turbo> Actually it seems to exist and not exist at the same time: https://media.discordapp.net/attachments/371759389889003532/1085622176444584091/image.png |
17:55:58 | FromDiscord | <Phil> I ran into an issue like that for the first time this noon, so I don't know much more about that yet.↵@gogolxdong might if he figured something out yet as he ran into the same problem 3 hours ago |
17:56:48 | FromDiscord | <turbo> Ah I see we came to the same conclusion, it went out the window with ORC |
17:57:44 | FromDiscord | <turbo> > .shallow predates move semantics and is a deadend. We should simply remove it.↵- Araq |
17:57:50 | FromDiscord | <turbo> I guess that settles it 😄 |
18:02:24 | * | jmdaemon quit (Ping timeout: 252 seconds) |
18:06:31 | * | rockcavera quit (Remote host closed the connection) |
18:14:26 | * | azimut quit (Ping timeout: 255 seconds) |
18:17:27 | * | azimut joined #nim |
18:31:14 | * | Notxor quit (Remote host closed the connection) |
18:37:31 | * | LyndsySimon quit (Quit: Connection closed for inactivity) |
18:37:51 | * | rmt quit (Ping timeout: 255 seconds) |
18:42:04 | FromDiscord | <I have 50GB of nothing on my PC> std/terminal getch() can't detect arrow keys, can it? |
18:51:11 | * | cnx quit (Ping timeout: 264 seconds) |
18:53:24 | * | cnx joined #nim |
19:01:50 | FromDiscord | <Livid> I'm writing tests that testament can run, and I'm writing them for a project that has a .nimble file and a config file for nim (project was made using the playdate-nim template projects). However, when there are things in that config file, the tests can't compile or their executables go elsewhere and I don't know where. How could I get testament to work? |
19:06:12 | FromDiscord | <Livid> Oops! I got it. |
19:06:46 | FromDiscord | <Livid> I spent a while on this and didn't find a minor problem. For those wondering, the template provided a config.nim file for the tests, but I needed to change a path in the file. |
19:06:48 | FromDiscord | <Nerve> Is there any way to use a timezone string to get a timezone type back using only procedures in `std/times`? I have a UTC timestamp and a UTC offset and want to format that into a local time string. |
19:14:13 | * | rockcavera joined #nim |
19:14:38 | FromDiscord | <Phil> In reply to @Livid "I spent a while": If you spent a while on this and this turns out to be a not that specific issue, you could jot it down in a self-answered SO question for easier searchability with search-engines like google 😉 |
19:15:05 | FromDiscord | <Elegantbeef> @Nerve\: `parseTime` takes a string a format and a timezone |
19:15:57 | FromDiscord | <Nerve> Yes, but the timezone of the timestamp is UTC. I need to offset it after I've parsed it as UTC. |
19:18:08 | FromDiscord | <Elegantbeef> Add the timezone to the string, parse it as utc then use `local(parsedTime)`? |
19:21:19 | * | Notxor joined #nim |
19:23:19 | FromDiscord | <Hourglass [She/Her]> In reply to @Isofruit "For your users, going": That makes sense yeah |
19:26:06 | FromDiscord | <Phil> In reply to @Hourglass, When the Hour Strikes "That makes sense yeah": Always keep in mind:↵The best product in many cases is the one that exists |
19:26:20 | FromDiscord | <Phil> Having something that works imperfectly is better than having nothing |
19:27:00 | FromDiscord | <Phil> That among many other things is why keeping in mind how easy it is to write software is fairly important |
19:27:31 | FromDiscord | <Phil> (edit) "important" => "important.↵In economic terms, how much does it cost you (in this case in terms of time) to develop X.↵If going the route of compiling to java is significantly faster to develop, do that." |
19:27:47 | * | azimut quit (Ping timeout: 255 seconds) |
19:31:19 | FromDiscord | <Gumbercules> I'd probably just compile Nim to C and use JNI |
19:31:54 | FromDiscord | <Gumbercules> But I'm not sure what the requirements / project is about. |
19:32:02 | FromDiscord | <Gumbercules> (edit) "But I'm not sure what the requirements ... /" added "are" |
19:35:25 | FromDiscord | <Phil> If that's easier/less work, that'd be even more preferrable |
19:50:43 | FromDiscord | <Nerve> In reply to @Elegantbeef "Add the timezone to": Okay, I need to try this |
19:57:23 | * | jmdaemon joined #nim |
20:03:27 | FromDiscord | <Nerve> In reply to @Elegantbeef "Add the timezone to": Does not work. Also I'm not trying to convert to the program's local time, I'm trying to convert to the timestamp that I have on-hand which accompanies the UTC timestamp (separated piece of data, they're not in the same string) |
20:03:49 | FromDiscord | <Nerve> (edit) "work." => "work, prints as if UTC time but also prints the timestamp, which is...confusing." |
20:04:10 | FromDiscord | <Nerve> (edit) "(separated" => "(separate" |
20:05:22 | FromDiscord | <Elegantbeef> Well you then need to make a timezone object and use `parse` with that |
20:06:14 | FromDiscord | <Nerve> Yes, how do I do that |
20:07:07 | FromDiscord | <Nerve> Without `timezones`, only with `std/times` |
20:09:07 | FromDiscord | <Elegantbeef> No clue really, my guess would be `newTimeZone` |
20:09:08 | * | Notxor quit (Remote host closed the connection) |
20:09:57 | FromDiscord | <Elegantbeef> That plus `zonedTimeFromTime` perhaps |
20:10:00 | * | Guest6 joined #nim |
20:10:03 | FromDiscord | <Elegantbeef> Just read the docs and take a stab at it 😄 |
20:11:20 | * | rockcavera quit (Read error: Connection reset by peer) |
20:12:39 | * | rockcavera joined #nim |
20:12:39 | * | rockcavera quit (Changing host) |
20:12:39 | * | rockcavera joined #nim |
20:23:04 | * | Notxor joined #nim |
20:28:59 | * | arkanoid quit (Ping timeout: 248 seconds) |
20:37:41 | * | arkanoid joined #nim |
20:44:54 | NimEventer | New thread by PMunch: Moderator updates, see https://forum.nim-lang.org/t/10006 |
20:54:39 | * | arkanoid quit (Ping timeout: 268 seconds) |
20:56:48 | * | arkanoid joined #nim |
20:57:25 | * | Notxor quit (Remote host closed the connection) |
20:57:43 | * | Notxor joined #nim |
21:54:11 | * | adium quit (Ping timeout: 264 seconds) |
21:55:07 | * | adium joined #nim |
22:00:17 | * | ltriant quit (Ping timeout: 246 seconds) |
22:14:25 | * | ltriant joined #nim |
22:22:37 | termer | I seem to recall there was a compile time thing I could use to check if something compiles |
22:22:48 | termer | does anyone know what that was, or whether I'm remembering something that doesn't exist? |
22:23:23 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4qVA |
22:23:59 | FromDiscord | <Phil> I have been told that "compiles" is a mean but incredibly useful hack for the record |
22:26:20 | termer | aha |
22:26:21 | termer | thanks |
22:26:51 | termer | I wanted to use it to check for a proc that works on a specific data type, but whose existence is optional |
22:47:15 | * | dv^_^ joined #nim |
22:55:15 | * | dv^_^ quit (Quit: dv^_^) |
23:05:00 | * | Notxor quit (Quit: Leaving) |
23:22:11 | * | Guest6 quit (Quit: Client closed) |
23:28:04 | FromDiscord | <Patitotective> is there some way i could program nim in the cloud like collab or jupyter? |
23:31:48 | anddam | Elegantbeef: ping |
23:32:51 | FromDiscord | <Elegantbeef> Pong |
23:33:51 | anddam | n0ice |
23:34:21 | anddam | Elegantbeef: apropos the nim/imgui thingy from the other day, I have been tweaking around with the example, all fine and dandy, and I used the cpp backend |
23:34:28 | anddam | in order to not needing the cimgui.dll |
23:35:05 | anddam | now I wonder how can I get the .exe and send it to a friend, I expected to navigate my nice ~/.nimble/pkgs directory, find some imgui.dll someplace and put it near the executables |
23:35:11 | anddam | x/les/ c/le/ |
23:35:18 | anddam | I find no such thing |
23:35:31 | FromDiscord | <Elegantbeef> If you use C++ you do not need a .dll |
23:35:36 | anddam | I don't |
23:35:40 | anddam | and other people? |
23:35:41 | FromDiscord | <Elegantbeef> The `.exe` Nim builds is all you need |
23:35:54 | anddam | that's swell |
23:36:10 | FromDiscord | <Elegantbeef> The C++ backend compiles the C++ code into the Nim binary, it's no different to using dear-imgui directly in C++ |
23:36:30 | anddam | ok, I assumed that using dear-imgui one had to ship the library as well |
23:36:38 | anddam | using in C++ |
23:37:00 | anddam | I mean seems to good, so probably it is not true |
23:37:12 | anddam | x/to / c/too/ |
23:37:17 | * | dv^_^ joined #nim |
23:37:33 | FromDiscord | <Elegantbeef> Nope |
23:37:38 | FromDiscord | <Elegantbeef> You only need the library for cimgui |
23:37:52 | FromDiscord | <Elegantbeef> Cause it is a dynamically library, dear-imgui is a source library |
23:38:01 | FromDiscord | <Elegantbeef> Which means it's no different to `import std/strutils` in Nim |
23:38:05 | anddam | oh a 2.5MB .exe |
23:38:10 | FromDiscord | <Elegantbeef> You do not need a `libnimstrutils.dll` |
23:39:07 | FromDiscord | <Elegantbeef> Exactly it's going to be a big boy, especially if you statically link glfw or whatever you use for context management |
23:40:53 | anddam | this is beautiful |
23:40:59 | anddam | now I only need to learn me some nim |
23:41:06 | anddam | thanks |
23:41:22 | FromDiscord | <Elegantbeef> I didnt do anything 😛 |
23:41:56 | FromDiscord | <Patitotective> In reply to @Patitotective "is there some way": repl seems to do the deed |
23:42:19 | anddam | wops, I just added a random unicode char to a text label and the compiler choked |
23:42:53 | anddam | → for the record, igText() did *not* like it |
23:43:02 | anddam | Patitotective: there's a nim repl? |
23:45:53 | FromDiscord | <Elegantbeef> There is inim, but it still recompiles the source file so it's not that fast |
23:45:57 | FromDiscord | <Elegantbeef> Though you can use tcc with it |