00:57:37 | * | auxym_ quit (Ping timeout: 248 seconds) |
01:25:35 | * | happycorsair[m] joined #nim |
01:37:03 | FromDiscord | <vevirit105> https://media.discordapp.net/attachments/371759389889003532/875553502158528532/fd503064d92655844644f29f77fb4bbb.png |
01:37:17 | FromDiscord | <vevirit105> https://media.discordapp.net/attachments/371759389889003532/875553559997980802/81067760_p0.png |
01:38:31 | FromDiscord | <vevirit105> https://media.discordapp.net/attachments/371759389889003532/875553873727729664/sample-a5a114c6ddc515d6b861faf3813865c7.png |
02:10:30 | * | Helios joined #nim |
02:22:51 | FromDiscord | <impbox [ftsf]> if you want to mutate a variable passed in, but not mutate it outside, you can just declare in the function `var a = a` for example |
02:31:35 | * | nixfreak_nim[m] joined #nim |
02:46:38 | * | arkurious quit (Quit: Leaving) |
03:32:04 | madprops | what is {'a', 'b'} ? seems to work like an array |
03:32:24 | * | rockcavera quit (Remote host closed the connection) |
03:33:25 | nrds | <Prestige99> A set |
03:34:23 | madprops | oh |
03:34:47 | madprops | so unique values |
03:38:30 | madprops | what could be the nicest way to get an array of a..z ? |
03:41:47 | madprops | I'm just doing a simple 'collect' |
03:42:04 | FromDiscord | <Elegantbeef> int -\> char or char -\> array? |
03:44:06 | FromDiscord | <Elegantbeef> cause you can do `var a: array['a'..'z', int]` |
03:46:00 | madprops | oh nice |
03:47:55 | madprops | don't think that works |
03:48:11 | madprops | oh nvm |
03:49:42 | madprops | hmm |
03:49:52 | madprops | not sure how to initialize that |
03:50:16 | madprops | with a..z |
03:50:44 | madprops | 'a', 'b', 'c' ... |
03:50:59 | FromDiscord | <Elegantbeef> `for c in 'a'..'z'` |
03:51:13 | madprops | yeah |
03:51:24 | madprops | was wondering if there was a oneliner |
03:51:38 | FromDiscord | <Elegantbeef> Init it to what though? |
03:52:47 | madprops | a seq of chars |
03:52:50 | madprops | or array i mean |
03:52:59 | FromDiscord | <lamersc.com 🐧> In reply to @Elegantbeef "Init it to what": abcdefghijklmnopqrstuvwxyz 🕶️ |
03:53:16 | FromDiscord | <Elegantbeef> I dont quite know what you mean, you want an array of characters? |
03:53:25 | madprops | yeah from a to z |
03:53:52 | madprops | oh i guess i could just use a string |
03:53:54 | madprops | :) |
03:54:08 | madprops | but i would still want to generate that |
03:54:12 | madprops | instead of copying a long line |
03:54:48 | madprops | array is better though |
03:55:40 | madprops | also seems 'collect' is new |
03:55:43 | madprops | since it's not available on 1.0 |
03:58:10 | madprops | https://play.nim-lang.org/#ix=3vNL |
04:00:28 | FromDiscord | <Elegantbeef> There isnt a range to array method so this is pretty much the best you can do https://play.nim-lang.org/#ix=3vNM |
04:03:19 | madprops | didn't know you could return from a block like that, interesting |
04:03:32 | FromDiscord | <Elegantbeef> All flow control can be an expression |
04:05:20 | madprops | I knew about if/else |
04:05:26 | madprops | but didn't think of block |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:30 | * | supakeen joined #nim |
05:03:15 | * | flynn quit (Read error: Connection reset by peer) |
05:04:21 | * | flynn joined #nim |
06:32:48 | * | max22- joined #nim |
06:44:49 | * | PMunch joined #nim |
07:22:32 | PMunch | Hmm, started looking at eink monitors again |
07:35:22 | * | xet7 joined #nim |
07:42:08 | PMunch | Every vacation I find myself wanting a small eink laptop which would work in direct sunlight, have insane battery life, and would allow me to code and use simple services on the go |
07:43:04 | FromDiscord | <Elegantbeef> Didnt realize there we eink monitors for external screens |
07:43:27 | FromDiscord | <Rika> There’s plenty |
07:43:49 | FromDiscord | <Rika> I own an e ink tablet and it’s pretty amazing for reading manga or books |
07:44:27 | PMunch | Yeah I have a small Kinda that's great for reading books. But I'd like something with an input :P |
07:45:49 | FromDiscord | <Rika> Kinda hahaha |
07:46:19 | FromDiscord | <Rika> They’re too niche and being usurped by other technologies with drawbacks other people are more fine with |
07:46:49 | FromDiscord | <Rika> Like faster refresh and colour but worse battery life and daylight visibility |
07:47:15 | FromDiscord | <Rika> But I think the manufacturer of the displays is called Dasung |
07:47:38 | FromDiscord | <Rika> No laptop for the aforementioned issues |
07:47:56 | FromDiscord | <Rika> Probably just easier to get a display and turn the main one off lol |
07:48:26 | FromDiscord | <Elegantbeef> pmunch has a 3D printer so clearly he'll modify his laptop to work with one of them |
07:53:33 | FromDiscord | <System64 ~ Flandre Scarlet> > SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵File not found or null pointer? |
07:55:50 | FromDiscord | <Rika> Null pointer |
07:55:55 | FromDiscord | <Rika> Which could mean file not found lol |
07:57:07 | PMunch | @ElegantBeef, there is even a full 25.3" screen from Dasung that's coming at the end of the year. And the new ones have surprisingly good refresh rates, but still no colours |
07:57:22 | FromDiscord | <Rika> Well is colour a concern for you |
07:57:23 | PMunch | There are small ones with 7 colour displays, which would be great for syntax highlighting and such |
07:57:52 | PMunch | Colour would be nice, but definitely not a necessity |
07:58:04 | FromDiscord | <Rika> Well you could just go with underline bold italics and permutations |
07:58:40 | FromDiscord | <Rika> If you’re a bit crazy maybe also strikethrough |
07:58:45 | PMunch | ElegantBeef, I don't think I'd want to try and sacrifice my laptop for something like this. But there is a guy who is in the process of replacing the panel on his T480 (same laptop I have) with an eink display |
07:59:09 | PMunch | @Rika, for sure. I guess with a special purpose editor I could even do different fonts |
07:59:48 | FromDiscord | <Rika> Sounds like it’s time to make one |
07:59:50 | PMunch | @System64, hard to tell what's wrong without any code |
08:00:11 | PMunch | There are some small eink screens on ebay that's RPi compatible |
08:00:29 | PMunch | 9.7" and 10.3", which might be big enough for what I have in mind |
08:01:07 | FromDiscord | <Rika> That’s just as big as my tablet though |
08:01:21 | PMunch | Which tablet? |
08:01:28 | FromDiscord | <Rika> Some tablets can be used as monitors |
08:01:36 | FromDiscord | <Rika> Some Onyx Boox tablet |
08:01:56 | PMunch | Hmm, interesting |
08:02:20 | PMunch | I have the 6" Kindle, that would be a bit small. But apparently there is some jailbreak software that can turn it into a terminal |
08:02:31 | PMunch | But I want something I can customise a bit more |
08:02:47 | FromDiscord | <System64 ~ Flandre Scarlet> How can I disable the GC please? |
08:03:02 | FromDiscord | <Rika> Why? |
08:03:14 | PMunch | --gc:none |
08:03:25 | PMunch | @Rika, was that why for me or System64? |
08:03:35 | FromDiscord | <System64 ~ Flandre Scarlet> I try to figure out why I have a null pointer |
08:03:35 | FromDiscord | <Rika> System |
08:03:41 | FromDiscord | <System64 ~ Flandre Scarlet> ah thanks |
08:03:55 | FromDiscord | <Elegantbeef> GC doesnt magically give a null pointer |
08:03:57 | PMunch | @System64, hint: it's not the GC :P |
08:04:25 | PMunch | Yeah it's definitely not the GC giving you a null pointer exception, unless you're doing something really exotic |
08:04:35 | FromDiscord | <Rika> It could be they are using the memory allocation APIs wrong |
08:04:55 | FromDiscord | <Elegantbeef> or you know |
08:05:13 | FromDiscord | <Elegantbeef> !eval var a\: ref int; echo a[] |
08:05:14 | NimBot | Compile failed: /usercode/in.nim(1, 9) Error: ':' or '=' expected, but got 'keyword ref' |
08:05:37 | FromDiscord | <Rika> Yes but I assume that would have been weeded out early on the debugging process |
08:05:39 | PMunch | I would call that exotic in Nim-land |
08:05:46 | PMunch | Most people never has to deref anything |
08:05:49 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "!eval var a\: ref": what's that? |
08:06:05 | FromDiscord | <Rika> I guess I’m not part of most people |
08:06:51 | FromDiscord | <proud linux user> :susPog: |
08:08:26 | FromDiscord | <Elegantbeef> That's purposely dereferencing a nil reference |
08:14:16 | FromDiscord | <System64 ~ Flandre Scarlet> even with GC off it crashes |
08:14:39 | FromDiscord | <Elegantbeef> It's a nil reference the GC isnt causing it |
08:15:30 | PMunch | Yeah, no big surprise there |
08:15:34 | FromDiscord | <System64 ~ Flandre Scarlet> and can a nil reference be caused by an extern lib? |
08:15:51 | FromDiscord | <Elegantbeef> It can be caused by anything that attempts to dereference a nil pointer |
08:15:52 | PMunch | Of course, if it's doing something weird, or you're passing it weird data |
08:24:04 | PMunch | Hmm, how easy would it be to interface with a keyboard in an old laptop? |
08:24:31 | PMunch | I've got a bunch of old laptops in the basement, so I could definitely reuse one of those as a case |
08:24:33 | FromDiscord | <Elegantbeef> They're usually designed to be interfaced with human hands, so easily! 😜 |
08:25:39 | PMunch | Haha :P |
08:26:04 | PMunch | Hmm, I mean I have already written keyboard firmware. So if I just get the pins of the matrix I should be able to fairly easily do it :P |
08:26:25 | FromDiscord | <Elegantbeef> depends on the model of course but some old laptops just used ps/2 for trackpad/keyboard |
08:26:55 | PMunch | Hmm, I have some really old ones as well |
08:27:11 | PMunch | And I think they even have 4:3 monitors which is the same as the e-ink screen |
08:28:41 | PMunch | Problem with old laptops is that they are a bit chunky.. |
08:33:10 | PMunch | I mean I have two old Lifebook B2154 laptops that might be perfect for this |
08:39:44 | PMunch | It has a 10.4" screen |
08:40:58 | * | xet7 quit (Ping timeout: 272 seconds) |
08:41:17 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/nims_template.nim#L62 |
08:42:58 | FromDiscord | <haxscramper> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz)\: Code before that is just a boilerplate that does not really have to change much, except for `conf.structuredErrorHook =` part - that's where you add your error handler, and I assume you would want something better than just `assert false` |
08:43:32 | FromDiscord | <haxscramper> Then you just pass ast to `processModule3` and it evaluates things in nimscript |
08:45:03 | FromDiscord | <haxscramper> `include compiler/passes` is needed due to `processTopLevelStmt` - it is not exported. There is an older version of this script where I tested things from code script and from node, (so you can eval text or eval AST) - https://github.com/haxscramper/hack/commit/3881ae5be6b63e7843299061a81a30b970f4b9bf#diff-b92c209186bfda7a25aae8b0d1fb3d876b9fe7e5f28007fbe2e9fcd4804d6937R131-R183 |
08:46:01 | FromDiscord | <haxscramper> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/875660267764187136): https://github.com/haxscramper/hack/blob/d2324554cff3d9c3401715700e67383bb4474771/testing/nim/compilerapi/nims_template.nim#L62 |
08:52:59 | * | xet7 joined #nim |
09:02:27 | FromDiscord | <System64 ~ Flandre Scarlet> @haxscramper even with the rewritten version of my program it crashes |
09:04:41 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/commit/ac6941b3058d6cc36a4205c575e889ebd13ea30f also example of adding custom proc |
09:06:33 | FromDiscord | <haxscramper> In reply to @System64 "<@!608382355454951435> even with the": I didn't say rewriting it would make crash go away. Instead I suggested you to rewrite it in order to make it easier to spot the difference |
09:06:55 | FromDiscord | <haxscramper> So, if it crashes, then rewrite is not exact, and you need to figure out what changed |
09:07:37 | FromDiscord | <System64 ~ Flandre Scarlet> maybe the problem are from my bindings so I'll inspect that |
09:08:44 | FromDiscord | <System64 ~ Flandre Scarlet> I don't think it's from SDL (it's not from me and it's supposed to be stable) |
09:10:12 | FromDiscord | <haxscramper> You used `.cdecl, importc, dynlib: tilenginedll.` for bindings, so it makes sense to just look at the C code |
09:10:54 | FromDiscord | <haxscramper> You can "inspect" your binings however you like, but if you want to really see what is going on, and what is different, you should just take end result and compare them |
09:12:24 | FromDiscord | <System64 ~ Flandre Scarlet> the binding is based on the header file |
09:14:21 | FromDiscord | <haxscramper> whatever |
09:15:38 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3vRP |
09:15:54 | FromDiscord | <haxscramper> yes |
09:15:55 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#ix=3vRP" => "https://play.nim-lang.org/#ix=3vRQ" |
09:16:50 | FromDiscord | <System64 ~ Flandre Scarlet> the thing is TLN_VideoCallback is a pointer in C |
09:17:48 | FromDiscord | <haxscramper> `typedef void(TLN_VideoCallback)(int scanline);` means `declare TLN_VideoCallback as pointer to function (int) returning void` |
09:18:09 | FromDiscord | <haxscramper> Nim `TLN_VideoCallback = proc(cint) {.cdecl.}` has the same effect |
09:18:23 | FromDiscord | <haxscramper> cdecl procvar is a pointer to proc |
09:18:41 | FromDiscord | <haxscramper> closure procvar is different, but if you have `{.cdecl.}` it would mean the same thing |
09:20:53 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3vRR |
09:21:50 | FromDiscord | <haxscramper> yes |
09:24:07 | FromDiscord | <System64 ~ Flandre Scarlet> So I don't know what's going on :/ |
09:24:38 | FromDiscord | <haxscramper> So C code looks identical? |
09:24:58 | PMunch | What's the type of that callback? |
09:25:00 | FromDiscord | <haxscramper> `s/looks/is` |
09:25:09 | FromDiscord | <haxscramper> In reply to @PMunch "What's the type of": `void(TLN_VideoCallback)(int scanline);` |
09:25:23 | FromDiscord | <haxscramper> And it was wrapped as`proc (scanline: cint) {.cdecl, gcsafe.}` |
09:25:25 | FromDiscord | <System64 ~ Flandre Scarlet> my binding is accurate to the header so yeah |
09:25:30 | FromDiscord | <haxscramper> ffs |
09:25:51 | FromDiscord | <haxscramper> I'm sorry, but do you read what I just said? You need to look at the generated C |
09:26:11 | PMunch | That looks like it's correct |
09:26:11 | FromDiscord | <haxscramper> not just visuall inspect bindings and say "aha, it is the same so everything else is also identical" |
09:26:40 | FromDiscord | <haxscramper> it is highly unlikely the error is in the bindings |
09:28:01 | FromDiscord | <System64 ~ Flandre Scarlet> This is the generated C file https://media.discordapp.net/attachments/371759389889003532/875672032245846046/generated.c |
09:28:58 | * | vicfred quit (Quit: Leaving) |
09:31:16 | FromDiscord | <haxscramper> yes, I know. I also mentioned you can use `--stacktrace:off` and `--linestrace:off` to get rid of `nimfr_("<%", "C:\\nim-1.4.8\\lib\\system\\comparisons.nim");` that pollutes everything |
09:31:35 | FromDiscord | <System64 ~ Flandre Scarlet> ah yeah, let me do that |
09:39:08 | FromDiscord | <System64 ~ Flandre Scarlet> normally it's cleaned up https://media.discordapp.net/attachments/371759389889003532/875674826466033745/generated.c |
09:57:10 | FromDiscord | <fae> Today has been fun. Figured out how to build enet, load up the dylib, connect a host and client using https://github.com/c0ntribut0r/cat-400/blob/master/c4/lib/enet/enet.nim and got peer messages sending back and forth in response to keypress with SDL. Now to continue with multiplayer pong 😄 . Nim makes things very easy. |
09:58:06 | FromDiscord | <fae> The biggest thing that tripped me up was figuring out how to cast a `pointer` back to a string |
10:01:15 | * | Vladar joined #nim |
10:02:17 | FromDiscord | <Paupi woodberg> In reply to @System64 "normally it's cleaned up": https://media.discordapp.net/attachments/371759389889003532/875680650894671902/Screenshot_20210813-110136.png |
10:03:48 | FromDiscord | <System64 ~ Flandre Scarlet> you can't simply execute the code |
10:04:02 | FromDiscord | <Paupi woodberg> In reply to @System64 "you can't simply execute": Why |
10:04:05 | FromDiscord | <Paupi woodberg> ? |
10:04:34 | FromDiscord | <System64 ~ Flandre Scarlet> it's not a main function |
10:05:37 | FromDiscord | <Paupi woodberg> O!↵Am not really good in c! |
10:23:30 | PMunch | fae, how are you casting a pointer to string, that's potentially something that could trip you up and give you segfaults |
10:24:31 | PMunch | There is a command that generates a build script for the C output if you want to build the C sources. I think it's --genScript |
10:25:17 | FromDiscord | <Rika> Who is Fae |
10:25:30 | FromDiscord | <Rika> Ah I missed their message nvm |
10:27:26 | FromDiscord | <fae> https://media.discordapp.net/attachments/371759389889003532/875686976496492574/Screen_Shot_2021-08-13_at_3.27.07_AM.png |
10:27:42 | FromDiscord | <Rika> Ah that is fine |
10:27:42 | FromDiscord | <fae> I'm sure it's unsafe, but not sure what else to do with a `ptr uint8` |
10:28:07 | FromDiscord | <Rika> Well you cannot avoid unsafe when interfacing with C (unless you aren’t) |
10:28:19 | FromDiscord | <dom96> ideally you should write a safe wrapper around this to isolate the unsafety |
10:28:34 | FromDiscord | <dom96> depends what you're doing though |
10:29:50 | FromDiscord | <fae> Just tinkering really, started messing with Nim only recently. I was happy the enet wrapper even worked at all. |
10:31:08 | FromDiscord | <fae> I had never used enet before directly (only indirectly love2d and godot) so being able to get it working so easily says a lot about how easy Nim makes it. |
10:31:23 | * | auxym_ joined #nim |
10:40:32 | emery | if I put a C++ object into a `ref` type, is the constructor called when the Nim `ref object` is created ? is there simple way to force the constructor to be called? |
10:41:54 | FromDiscord | <haxscramper> you need to use placement new |
10:42:30 | emery | haxscramper: what is that? |
10:47:17 | emery | c++ is such a horrible language |
10:47:20 | PMunch | It would be nice if Nim had a built-in object type for cstring with size that could work like a string, was assumed to not be freed while you're using it (manually managed by the user), and didn't require copying.. |
10:47:41 | PMunch | Something like a special case seq that didn't interact with the GC at all.. |
10:49:50 | FromDiscord | <haxscramper> In reply to @emery "<@608382355454951435>: what is that?": C++ object can call constructor on already allocated memory |
10:49:51 | FromDiscord | <haxscramper> https://wandbox.org/permlink/qqpPSMM468EpLIpL |
10:50:05 | FromDiscord | <haxscramper> Nim allocates memory with `ref` and you call placement new here |
10:50:18 | FromDiscord | <haxscramper> Without placement new it will just allocate, but constructor won't be called |
10:51:06 | FromDiscord | <haxscramper> Though it seems like `new(result)` is sufficient, and destructor is called correctly |
10:52:10 | FromDiscord | <haxscramper> Nim `new` just does ` result = (Struct)newObj( (&NTIDzqc1yILohvRHG0NLsQ9aXw_), sizeof(Struct));` |
10:53:12 | FromDiscord | <haxscramper> In reply to @haxscramper "Though it seems like": Though I would not be so sure about that, and it is probably safer to still use destructor, |
10:53:17 | FromDiscord | <haxscramper> Or look into it in more detailk |
10:55:54 | FromDiscord | <haxscramper> `proc newImportAux() {.header: "<new>", importcpp: "//".}` is needed because placement new is declared in this header, but I can't use header and provide implementation in `newT` |
10:56:09 | FromDiscord | <haxscramper> This is a hack, i don't know what would be the correct workaround |
10:57:33 | FromDiscord | <haxscramper> `importcpp: "((void)0)".` is probably better |
10:59:22 | emery | haxscramper: I'll work something out, thanks |
10:59:45 | * | PMunch quit (Read error: Connection reset by peer) |
11:01:49 | * | PMunch joined #nim |
11:06:16 | * | PMunch quit (Remote host closed the connection) |
11:07:21 | * | auxym_ quit (Read error: No route to host) |
11:07:41 | * | auxym_ joined #nim |
11:11:43 | * | PMunch joined #nim |
11:20:00 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3vSi |
11:20:01 | * | auxym_ quit (Ping timeout: 248 seconds) |
11:20:50 | FromDiscord | <enthus1ast> i must carefully study the code you sent, have just skimmed through it yet. |
11:21:49 | FromDiscord | <haxscramper> Yes, I also wanted to addapt jinja templates, so it is naturally similar |
11:22:13 | FromDiscord | <enthus1ast> but you want to do it dynamic? |
11:22:29 | FromDiscord | <haxscramper> It would be possible to write an implementation that allows to have both dynamic and static templates |
11:22:40 | FromDiscord | <haxscramper> It is more involved though |
11:23:03 | FromDiscord | <haxscramper> There are actually three ways to do this |
11:23:40 | FromDiscord | <haxscramper> ● Nim macro that generates template code↵● Compiler-based logic that generates template code (not really different from macro)↵● Compiler-based, but directly evaluates code - this one allows for no-recompile template changes |
11:25:08 | FromDiscord | <haxscramper> I'm after latter one because it does not require user to import whole haxdoc source code in their template (\~200k sloc including all dependencies) |
11:25:35 | FromDiscord | <haxscramper> But at the same time compiled template is faster, so I can provide couple of default presets |
11:25:53 | FromDiscord | <haxscramper> For now I just wanted to show you an example of how dynamic one can be done |
11:25:58 | FromDiscord | <haxscramper> So you would have full overview of the possibilities |
11:27:12 | FromDiscord | <haxscramper> If you want I can think hyperhybrid one that allows to switch between all three solutions in a single code base |
11:28:02 | FromDiscord | <haxscramper> At least right now I feel like it would be possible |
11:29:08 | FromDiscord | <enthus1ast> yes i also had nr3 in mind, but it must be possible to use any nim functions also the ffi ones, i guess it could be possible to make ffi functions available in a custom compiler |
11:30:24 | FromDiscord | <enthus1ast> so one must be able to define functions that are later available in the templates, then maybe the compiler lib must be then compiled once and then is able to evaluate the templates dynamically |
11:31:41 | FromDiscord | <enthus1ast> yes, i'm looking forward to study your code |
11:35:33 | FromDiscord | <PsychoClay> is there a way to make `db_sqlite.exec` go faster, currently its takes ~17 seconds for about 7k inserts, on python this takes like half a second |
11:35:54 | FromDiscord | <haxscramper> Yes, that's how main nim vm does it - just tons of `registerCallback()` calls for all procs https://github.com/nim-lang/Nim/blob/devel/compiler/vmops.nim#L69You can do https://en.wikipedia.org/wiki/Opaque_pointer by exposing opaque handlers to the objects, and making all template logic function via proc calls |
11:36:14 | FromDiscord | <haxscramper> nim just binds to sqlite3, so all optimizations apply equally https://avi.im/blag/2021/fast-sqlite-inserts/↵(@PsychoClay) |
11:36:31 | FromDiscord | <haxscramper> You can also use prepared queries etc. |
11:36:48 | FromDiscord | <haxscramper> I would start with prepared queries |
11:36:56 | FromDiscord | <PsychoClay> il try that |
11:37:01 | FromDiscord | <haxscramper> I suppose python implementation does this implicitly, or has default connection configurations |
11:38:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vSo |
11:39:39 | FromDiscord | <haxscramper> or `evalTemplateWithDb(db, getPrecompiledTemplate(hptNimDocStyle #[ or hptRustDocStype, or hptDoxygenStyle ]#)` |
11:40:02 | FromDiscord | <haxscramper> Latter one is already possible with your current implementation |
11:40:32 | FromDiscord | <haxscramper> I just need to find some time to test it |
11:41:15 | FromDiscord | <enthus1ast> @PsychoClay\:↵And maybe disable all foreign key checks\:↵PRAGMA ignore\_check\_constraints = boolean;and also insert your stuff in a transaction, then the index will be generated only once i guess |
11:44:30 | * | auxym_ joined #nim |
11:52:01 | * | auxym_ quit (Ping timeout: 248 seconds) |
11:53:45 | FromDiscord | <PsychoClay> got it down to 8 secs |
11:54:13 | * | auxym_ joined #nim |
11:57:40 | FromDiscord | <PsychoClay> now the slow part seems to be `strutils.replace` |
11:59:02 | FromDiscord | <PsychoClay> ok nvm |
11:59:27 | FromDiscord | <PsychoClay> it was 8 sec with vallgrind 0.6 without |
12:04:50 | * | max22- quit (Ping timeout: 252 seconds) |
12:05:41 | * | rockcavera joined #nim |
12:05:41 | * | rockcavera quit (Changing host) |
12:05:41 | * | rockcavera joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:31 | * | supakeen joined #nim |
12:14:41 | * | rockcavera quit (Remote host closed the connection) |
12:16:10 | FromDiscord | <System64 ~ Flandre Scarlet> @haxscramper Alright I found something very weird↵with ``--stacktrace:off --linetrace:off``, no crash, if I remove theses arguments, crashes |
12:16:48 | FromDiscord | <haxscramper> Crashes as in `SEGFAULT`, or you just get an exception? |
12:17:19 | FromDiscord | <System64 ~ Flandre Scarlet> ``Error: execution of an external program failed: 'C:\Users\nicol\Documents\programmation\testNim\newTest.exe '`` |
12:17:24 | FromDiscord | <System64 ~ Flandre Scarlet> just that |
12:18:52 | FromDiscord | <System64 ~ Flandre Scarlet> and sometime the ``SIGSEGV: Illegal storage access. (Attempt to read from nil?)`` error |
12:22:57 | FromDiscord | <System64 ~ Flandre Scarlet> ``nim compile -r --nimcache:"./cache" --stacktrace:off --linetrace:off newTest.nim`` keeps runtime checks right? |
12:24:06 | FromDiscord | <haxscramper> yes, but C library does not have any |
12:24:14 | FromDiscord | <haxscramper> tilengine |
12:24:34 | FromDiscord | <System64 ~ Flandre Scarlet> yeah? what happens with Tilengine? |
12:25:01 | * | rockcavera joined #nim |
12:26:04 | * | auxym_ quit (Ping timeout: 268 seconds) |
12:26:34 | FromDiscord | <haxscramper> nothing |
12:26:46 | FromDiscord | <haxscramper> you use dynamic C dll with no runtime checks |
12:26:57 | FromDiscord | <haxscramper> Therefore it won't magically add runtime checks |
12:31:34 | FromDiscord | <System64 ~ Flandre Scarlet> ah I'm conscious of that, but it's weird it crashes if I remove theses 2 args |
12:35:23 | FromDiscord | <System64 ~ Flandre Scarlet> But I like how well Nim interops with C |
12:36:16 | FromDiscord | <System64 ~ Flandre Scarlet> you can even import raw C code |
12:38:36 | FromDiscord | <System64 ~ Flandre Scarlet> what'ss the difference between stacktrace and linetrace? |
12:42:35 | FromDiscord | <haxscramper> `stacktrace` adds calls to `nimfr_` and `popFrame()` at the start/end of each function↵`linetrace` without stracktrace does not do anyting, but if both are enabled calls to `nimln_(` are added so C code could provide exception positions that correspond to the nim code |
12:43:21 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vSB |
12:44:18 | FromDiscord | <System64 ~ Flandre Scarlet> Ah I see, but I dunno why they make my program crashing |
12:49:03 | * | arkurious joined #nim |
12:51:06 | * | auxym_ joined #nim |
12:56:04 | * | auxym_ quit (Read error: No route to host) |
12:56:25 | * | auxym_ joined #nim |
13:06:20 | * | auxym_ quit (Ping timeout: 272 seconds) |
13:10:02 | * | PMunch quit (Remote host closed the connection) |
13:14:44 | * | PMunch joined #nim |
13:52:48 | FromDiscord | <Rika> might be a timing thing |
14:02:30 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Rika "might be a timing": wdym? |
14:03:25 | FromDiscord | <Rika> wait this isnt threaded so maybe a memory layout thing |
14:03:28 | FromDiscord | <Rika> ? |
14:03:40 | FromDiscord | <Rika> well its one of those "debug works release doesnt" kinda issues |
14:04:19 | FromDiscord | <System64 ~ Flandre Scarlet> ah so it's Nim's fault? |
14:05:28 | PMunch | I had a weird issue like that with using a crypto library to read Keepass files |
14:05:40 | PMunch | It works perfectly in debug mode, but release mode breaks it |
14:07:03 | * | max22- joined #nim |
14:07:16 | * | PMunch quit (Quit: Leaving) |
14:07:19 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "It works perfectly in": Ah let me try in release |
14:10:07 | FromDiscord | <Rika> In reply to @System64 "ah so it's Nim's": no, its just one of those odd bugs that happen in pretty much any lang maybe save for rust |
14:10:21 | FromDiscord | <Rika> no, im sure rust has these issues as well |
14:10:39 | FromDiscord | <System64 ~ Flandre Scarlet> but why this bug occurs? |
14:10:56 | FromDiscord | <System64 ~ Flandre Scarlet> and I use callback functions, it's supposed to be threaded no? |
14:11:09 | FromDiscord | <konsumlamm> "it"? |
14:11:38 | FromDiscord | <System64 ~ Flandre Scarlet> callbacks |
14:16:39 | FromDiscord | <konsumlamm> and wdym by "supposed to be threaded"? |
14:23:51 | FromDiscord | <System64 ~ Flandre Scarlet> executed in parallel |
14:26:10 | FromDiscord | <Yardanico> In reply to @System64 "and I use callback": if tilengine doesn't run the callbacks on the same thread as your nim program and you don't use arc/orc you'll need to call setupForeignThreadGC at the start of any callback you pass to tilengine |
14:26:48 | FromDiscord | <Yardanico> although nowadays i'd just recommend you to use orc |
14:27:14 | FromDiscord | <System64 ~ Flandre Scarlet> what's the difference between Arc and Orc? |
14:27:25 | FromDiscord | <Yardanico> orc is arc with a cycle collector (so it can deal with cycles) |
14:27:53 | FromDiscord | <Yardanico> https://nim-lang.org/blog/2020/10/15/introduction-to-arc-orc-in-nim.html↵https://nim-lang.org/blog/2020/12/08/introducing-orc.html |
14:31:36 | FromDiscord | <System64 ~ Flandre Scarlet> I'll try that |
15:07:16 | FromDiscord | <System64 ~ Flandre Scarlet> But why it works without tracestack and traceline ? |
15:19:49 | FromDiscord | <haxscramper> probably due to some strackframe context that is not properly handled when callback is executed by another thread |
15:20:24 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
15:37:53 | * | Vladar quit (Remote host closed the connection) |
15:38:56 | * | KurtGodel joined #nim |
16:02:27 | * | Pyautogui joined #nim |
16:18:15 | FromDiscord | <System64 ~ Flandre Scarlet> It crashes with --gc:orc |
16:28:45 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3vTW |
16:28:58 | * | Pyautogui quit (Quit: Connection closed) |
16:29:47 | * | Pyautogui joined #nim |
16:30:19 | FromDiscord | <Rika> use `WideCString` |
16:32:03 | FromDiscord | <Ayy Lmao> Interesting, didn't know about that type. How do I go about assigning a nim string to it? `var test: LPCWSTR = "Test"` doesn't work when I change it |
16:32:37 | FromDiscord | <Rika> `var test: LPCWSTR = newWideCString "Test"`? |
16:33:23 | FromDiscord | <Ayy Lmao> Sweet that seems to work. Thanks! |
16:33:59 | FromDiscord | <Ayy Lmao> Out of curiosity, would making a converter for that be considered a bad idea? |
16:35:00 | FromDiscord | <Rika> that's your call |
16:36:22 | FromDiscord | <Ayy Lmao> Also I've been wondering, there are some types that are imported with `system`, like `UncheckedArray` and `WideCString` that disobey the convention of nim builtin types starting with lower case. Is there a reason for this? |
16:36:57 | * | Pyautogui quit (Quit: Connection closed) |
16:38:49 | FromDiscord | <Rika> because theyre not "builtin" types |
16:40:07 | FromDiscord | <Ayy Lmao> So they are essentially made up of builtin types instead of being builtin themselves? |
16:40:56 | FromDiscord | <Ayy Lmao> Oh I found it in the nim source as `WideCString = ptr UncheckedArray[Utf16Char]` |
16:41:00 | FromDiscord | <Ayy Lmao> So that makes sense |
17:18:16 | madprops | does nim has that "feature" of rust where it caches stuff after builds, making some directories huge? |
17:18:30 | madprops | have to do 'cargo clean' after a while |
17:18:35 | madprops | or it grows to gigabytes |
17:19:07 | madprops | so far it seems only rust projects were huge like that |
17:19:30 | FromDiscord | <Rika> nim binaries are not characteristically large so even if it did it probably wouldnt grow as large |
17:19:47 | FromDiscord | <Rika> i believe the cache actually gets wiped periodically |
17:21:40 | FromDiscord | <islem> hi |
17:21:51 | FromDiscord | <rxx> @islem @islem hi cupcakes |
17:22:04 | FromDiscord | <islem> you know were in a professional discord server, you should meme here |
17:22:11 | FromDiscord | <islem> (edit) "were" => "we're" |
17:22:17 | FromDiscord | <islem> (edit) "should" => "shouldn't" |
17:22:18 | FromDiscord | <rxx> What |
17:22:23 | FromDiscord | <rxx> Idc |
17:22:43 | FromDiscord | <islem> ok lemme just free() your life real quick |
17:25:08 | FromDiscord | <Rika> okay |
17:25:12 | FromDiscord | <Gabryx86_64> In reply to @islem "you know we're in": he did in the osdev server too |
17:25:46 | FromDiscord | <rxx> Hi cupcakes @Gabryx86_64 😘 😘 😘 🥰 |
17:25:56 | FromDiscord | <Gabryx86_64> please stop |
17:27:25 | FromDiscord | <islem> oh god |
17:40:38 | * | auxym_ joined #nim |
17:48:40 | FromDiscord | <haxscramper> `Error: typechecked nodes may not be modified` how can I get `typed` proc in the pragma, and then change its implementation? |
17:49:15 | FromDiscord | <haxscramper> Should I just `copyNimTree` whole implementation or there is simpler way around this? |
18:05:53 | * | lain quit (Ping timeout: 248 seconds) |
18:07:06 | * | lain joined #nim |
18:19:13 | FromDiscord | <Sabena Sema> even with experimental:views I can't have a view type as a subobject of a record right? |
18:21:11 | madprops | is 1.4.0 still the stable version? |
18:21:36 | FromDiscord | <haxscramper> 1.4.8 |
18:21:46 | FromDiscord | <haxscramper> I think you should be able to↵(@Sabena Sema) |
18:21:50 | madprops | hmm if I do 'choosenim stable' it says it's already at stable |
18:21:58 | FromDiscord | <haxscramper> (when they are ready) |
18:22:18 | FromDiscord | <Sabena Sema> and if I do I can't rebind the view type after creating said record? (I can't reassign to the variable) |
18:23:21 | FromDiscord | <haxscramper> `choosenim update stable`↵(<@709044657232936960_madprops=5b=49=52=43=5d>) |
18:23:23 | FromDiscord | <haxscramper> I'm not sure what you mean. If you have `field: openarray[T]` then you would be able to assign to it, like any other field |
18:23:47 | FromDiscord | <haxscramper> `openarray[T]` would be a start/end pointer, so nothing prevents you from assigning to it |
18:23:50 | madprops | oh I needed 'choosenim update stable' |
18:26:29 | FromDiscord | <haxscramper> Actually it works now |
18:26:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vUx |
18:27:06 | FromDiscord | <haxscramper> Not with `var openarray[int]` ` error: request for member ‘Field0’ in something not a structure or union test_prog_13.oa.Field0 = (NI)s1_prog_7->data+(((NI) 0)); test_prog_13.oa.Field1 = (((NI) 2))-(((NI) 0))+1;` |
18:27:37 | FromDiscord | <Elegantbeef> try with `--newRuntime` or `arc/orc` |
18:27:55 | FromDiscord | <Elegantbeef> I know in my experience toying with them the old runtime did not add enjoyment |
18:28:53 | FromDiscord | <haxscramper> `nim r --newRuntime --gc:arc test.nim` same issue |
18:30:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vUz |
18:30:03 | FromDiscord | <haxscramper> But not object with a variable |
18:30:20 | FromDiscord | <haxscramper> Fails with codegen |
18:30:23 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vUA |
18:30:40 | FromDiscord | <haxscramper> Probably a bug, and I think I've seen this somewhere |
18:31:51 | FromDiscord | <haxscramper> nope, at least nothing tagged as "view types" |
18:34:19 | FromDiscord | <undersquire> is it possible to `raise` values that are not objects of Exception ? |
18:35:09 | FromDiscord | <leorize> nope |
18:35:18 | FromDiscord | <undersquire> i wish it supported that |
18:35:32 | FromDiscord | <undersquire> it would be nice to be able to just raise any value |
18:35:32 | * | max22- quit (Ping timeout: 245 seconds) |
18:35:48 | FromDiscord | <haxscramper> You can write own exception |
18:36:01 | FromDiscord | <undersquire> or something |
18:36:03 | FromDiscord | <haxscramper> But it is a horrible idea to raise non-exception IMO |
18:36:09 | FromDiscord | <undersquire> sent a code paste, see https://paste.rs/AeP |
18:36:27 | FromDiscord | <haxscramper> And strings are no reference types, so |
18:36:40 | FromDiscord | <undersquire> wait it has to be a reference type |
18:36:41 | FromDiscord | <undersquire> (edit) "type" => "type?" |
18:37:15 | FromDiscord | <undersquire> wait so how do you obtain data from an exception type? |
18:37:32 | FromDiscord | <haxscramper> just like any other reference type?↵(@undersquire) |
18:37:42 | FromDiscord | <Elegantbeef> `except YourException as e` |
18:37:44 | FromDiscord | <haxscramper> reference type only means it is allocated on heap |
18:37:48 | FromDiscord | <undersquire> In reply to @Elegantbeef "`except YourException as e`": ah ty |
18:37:53 | FromDiscord | <haxscramper> and behaves like it is a pointer/reference |
18:38:11 | FromDiscord | <haxscramper> Nim string buffer is allocated on heap, but it does not behave like a reference |
18:38:13 | FromDiscord | <undersquire> In reply to @haxscramper "reference type only means": yeah i meant how do u get it from the `except` statement, but beef answered that |
18:38:23 | FromDiscord | <Elegantbeef> Explained here https://nim-lang.org/docs/manual.html#exception-handling-except-clauses |
18:38:34 | FromDiscord | <undersquire> so you can technically store any values in your exception |
18:38:54 | FromDiscord | <undersquire> thats all I wanted to be able to do, I thought you could only store a string with an exception |
18:39:55 | FromDiscord | <haxscramper> you can create a `VoidStarError` which has `pointer: payload` |
18:40:17 | FromDiscord | <haxscramper> Basically exceptions are `ref` to guarantee they outlive stack unwinding. I think |
18:40:21 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3vUE |
18:40:36 | FromDiscord | <haxscramper> Just `object of CatchableError` is enoug↵(@undersquire) |
18:40:39 | FromDiscord | <undersquire> oh ok |
18:40:48 | FromDiscord | <haxscramper> For some veird reason `newException` requires just `object` |
18:40:48 | FromDiscord | <haxscramper> idk why |
18:41:11 | FromDiscord | <haxscramper> But internally it does `(ref Exception)(msg: "....")` |
18:41:20 | FromDiscord | <haxscramper> I personally write constructors for my exceptions, so it goes like `raise newArgumentError( ... )` |
18:41:38 | FromDiscord | <undersquire> ah ok |
18:41:44 | FromDiscord | <undersquire> ty this helps a lot |
18:42:08 | FromDiscord | <haxscramper> Oh, and your code is not fully valid as `newException` accepts second argument as exception message |
18:42:15 | FromDiscord | <haxscramper> So `10` is not going to go into `errorcode` |
18:43:12 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3vUF |
18:44:31 | FromDiscord | <undersquire> yeah |
18:44:42 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3vUI |
18:44:59 | FromDiscord | <undersquire> oh you can just do ref MyException () ? |
18:45:49 | FromDiscord | <undersquire> sent a code paste, see https://play.nim-lang.org/#ix=3vUJ |
19:05:10 | * | max22- joined #nim |
19:28:01 | * | auxym_ quit (Ping timeout: 248 seconds) |
20:00:38 | * | auxym_ joined #nim |
20:01:38 | * | Yardanico joined #nim |
20:12:00 | * | NimEventer joined #nim |
20:12:29 | FromDiscord | <Yardanico> moved eventer bot to libera chat |
20:14:57 | * | auxym_ quit (Ping timeout: 248 seconds) |
20:48:43 | madprops | Editor shows an error but it still compiles https://i.imgur.com/M7mVd6r.png |
20:58:07 | FromDiscord | <Yardanico> how are you compiling it? |
20:58:12 | FromDiscord | <Yardanico> i mean the command |
21:02:29 | madprops | nim js file.nim |
21:02:54 | madprops | ah i guess it's just not an error for js |
21:04:53 | FromDiscord | <Yardanico> you might try to specify --backend:js in your .nim.cfg or .nims file but I'm not certain it'll work |
21:20:48 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
21:24:29 | * | Lord_Nightmare joined #nim |
22:08:54 | FromDiscord | <retkid> i know the answer is no but |
22:09:11 | FromDiscord | <retkid> do you think theres any known way to bundle efficient c binaries into a jvm enviroment |
22:09:15 | FromDiscord | <retkid> (edit) "enviroment" => "environment" |
22:09:57 | FromDiscord | <retkid> I would like to integrate nim into some java stuff because im afraid physics calculations might be too expensive for java |
22:19:15 | FromDiscord | <retkid> yea no |
22:19:19 | FromDiscord | <retkid> this is currently not a thing |
22:19:20 | FromDiscord | <retkid> :\ |
22:24:49 | * | max22- quit (Quit: Leaving) |
22:27:25 | FromDiscord | <undersquire> In reply to @retkid "do you think theres": it is possible |
22:27:35 | FromDiscord | <undersquire> take a look at JNI |
22:27:56 | FromDiscord | <retkid> but idk if that would help preformance at all |
22:27:56 | FromDiscord | <treeform> In reply to @retkid "do you think theres": Don't ask me why I looked into it, regular java api looked really hard but I found this https://github.com/jnr/jnr-ffi |
22:27:58 | nrds | <prestigebot99> itHub: 7"Java Abstracted Foreign Function Layer" |
22:27:59 | FromDiscord | <retkid> (edit) "preformance" => "performance" |
22:28:44 | FromDiscord | <treeform> Android Java has the NDK which feels better. |
22:29:15 | FromDiscord | <retkid> Well, the only reason i would do this is for making my code run as fast as i can |
22:29:15 | FromDiscord | <treeform> Desktop java JNI looks kind of hard |
22:29:18 | FromDiscord | <retkid> but |
22:29:25 | FromDiscord | <retkid> I don't think this would help at all |
22:29:35 | FromDiscord | <undersquire> In reply to @retkid "Well, the only reason": just dont use Java then 😉 |
22:29:51 | FromDiscord | <retkid> In reply to @undersquire "just dont use Java": CANT |
22:29:53 | FromDiscord | <treeform> In my experience java is ok at speed, depending how you write it. |
22:29:53 | FromDiscord | <undersquire> Java itself is not that slow |
22:30:12 | FromDiscord | <retkid> so my dumb idea requires a ton of java work |
22:30:12 | FromDiscord | <undersquire> you just have to avoid the GC as much as possible to avoid serious performance drops |
22:30:27 | FromDiscord | <undersquire> In reply to @retkid "so my dumb idea": what are you trying to make that needs Java (or is it an assignment)? |
22:30:28 | FromDiscord | <treeform> My ex-coworkers where very good at writing java-xml-java-deeply nested monsters that ran pretty slow. |
22:30:33 | FromDiscord | <treeform> so don't do that and your java should be fast |
22:30:39 | FromDiscord | <retkid> In reply to @undersquire "what are you trying": im doing some physics stuff in minecraftr |
22:30:40 | FromDiscord | <retkid> (edit) "minecraftr" => "minecraft" |
22:30:42 | FromDiscord | <undersquire> Ah |
22:30:49 | FromDiscord | <retkid> involving fluid dynamics and stuff |
22:30:52 | FromDiscord | <undersquire> Java is fine for it, just do the physics in java |
22:31:10 | FromDiscord | <retkid> well im afraid all of the calculations will just make it run like molasis |
22:31:23 | FromDiscord | <retkid> the game im basing it off runs like bytecode and still struggles |
22:31:25 | FromDiscord | <undersquire> 😂 trust me Java is really good at optimizing stuff |
22:31:30 | FromDiscord | <undersquire> math should be fine |
22:32:04 | FromDiscord | <undersquire> it probably isnt worth the effort to try to use C with Java (trust me it can be a pain) |
22:32:07 | FromDiscord | <treeform> The key to making simulation stuff in java is to avoid OOP and use flat arrays as much as possible. SOA vs AOS |
22:32:11 | FromDiscord | <undersquire> ^ |
22:32:24 | FromDiscord | <undersquire> this helps avoid the GC |
22:32:26 | FromDiscord | <retkid> In reply to @treeform "The key to making": im learing to ue hashmaps |
22:32:29 | FromDiscord | <treeform> But that actually a key in any language 🙂 |
22:32:31 | FromDiscord | <retkid> (edit) "ue" => "use" |
22:32:34 | FromDiscord | <undersquire> ye |
22:33:35 | FromDiscord | <retkid> for some reason hasmaps run like 186x faster |
22:33:40 | FromDiscord | <retkid> (edit) "hasmaps" => "hashmaps" |
22:33:41 | FromDiscord | <treeform> Many java (and non Java) games allocate most things upfront and have some thing used in-use and not-in-use flags, to get around GC. |
22:34:06 | FromDiscord | <treeform> So there is no allocations per frame. |
22:34:11 | NimEventer | New Nimble package! tkrzw - Wrappers over the Tkrzw Database Manager C++ library., see https://git.sr.ht/~ehmry/nim-tkrzw |
22:34:32 | * | auxym_ joined #nim |
22:34:34 | FromDiscord | <retkid> with a game like minecraft where you might break a hole in a wall |
22:34:42 | FromDiscord | <retkid> and you gotta depressurize a part of a space station |
22:34:49 | FromDiscord | <retkid> you cant really prebake stuff |
22:35:37 | FromDiscord | <retkid> and you can obviously do generalizations, like if a large area of 0 pressure encounters a small area of preasure, just delete the area with preasureb |
22:35:45 | FromDiscord | <retkid> (edit) "preasureb" => "preasure" |
22:36:09 | FromDiscord | <retkid> Idk, i've been procrastinating starting this because its kinda scary to me lol |
22:36:12 | FromDiscord | <treeform> Is that minecraft or ss13? |
22:36:22 | FromDiscord | <retkid> In reply to @treeform "Is that minecraft or": porting ss13 to minecraft for no reason |
22:36:31 | FromDiscord | <retkid> at least thats my goal |
22:36:39 | FromDiscord | <treeform> ss13 has two models handling pressures |
22:36:47 | FromDiscord | <treeform> one is pre "voxel" |
22:36:50 | FromDiscord | <retkid> I might start digging around in gonecode |
22:36:55 | FromDiscord | <retkid> (edit) "gonecode" => "gooncode" |
22:37:21 | FromDiscord | <treeform> and one is per "region" where regions are created and destroyed and have nodes telling you how much goes from one to the other. |
22:37:35 | FromDiscord | <treeform> region is much faster and much more predictable |
22:37:47 | FromDiscord | <treeform> voxel is super slow, but can be more "fun". |
22:38:06 | FromDiscord | <treeform> Different servers choose one or the other and that sets up the mood. |
22:38:33 | FromDiscord | <retkid> so, my idea is currently that all sealed areas will be regions until something else is found in them |
22:38:38 | FromDiscord | <retkid> then they split into voxels or something |
22:38:55 | FromDiscord | <retkid> i need to start writing the code to get a solid understaning of it |
22:38:57 | FromDiscord | <retkid> (edit) "understaning" => "understanding" |
22:38:59 | FromDiscord | <treeform> yeah |
22:39:05 | FromDiscord | <retkid> i also have to polish up my fluid dynamics stuff |
22:39:07 | FromDiscord | <treeform> Minecraft is also 3d |
22:39:10 | FromDiscord | <treeform> its like much harder |
22:39:21 | FromDiscord | <treeform> if you like ss13 checkout my blog post: https://blog.istrolid.com/blog/space-station-13-remakes.html |
22:39:27 | FromDiscord | <retkid> 1^2 vs 1^3 |
22:39:31 | FromDiscord | <retkid> exponentially harder |
22:40:09 | FromDiscord | <treeform> You probably want regions, some sort of quad tree |
22:40:10 | * | flynn quit (Read error: Connection reset by peer) |
22:40:19 | FromDiscord | <treeform> then breakout into voxels when its interesting |
22:40:28 | FromDiscord | <retkid> so what im doing is, im never announcing anything to anyone, im just gonna work and see what happens |
22:40:30 | FromDiscord | <treeform> door or a hole opened up |
22:40:41 | FromDiscord | <retkid> if i announce anything publicly it'll be a finished or semi-finished product |
22:40:48 | FromDiscord | <retkid> but it may just go nowhere |
22:40:51 | FromDiscord | <retkid> /sh\ |
22:40:53 | FromDiscord | <retkid> (edit) "/sh\" => "¯\_(ツ)_/¯" |
22:41:17 | * | flynn joined #nim |
22:41:23 | FromDiscord | <treeform> You have seen: https://minecraft-spacestation13.weebly.com/ |
22:41:30 | FromDiscord | <retkid> I have, im pretty sure |
22:41:38 | FromDiscord | <retkid> that one got abandoned |
22:41:54 | FromDiscord | <retkid> they have a github of unusable code because forge sucks |
22:42:19 | FromDiscord | <retkid> https://github.com/birdbrainswagtrain/MineStation13 |
22:42:21 | nrds | <prestigebot99> itHub: 7"A Minecraft mod intended to replicate the popular BYOND game, Space Station 13." |
22:42:53 | FromDiscord | <retkid> I have other people who may or may not help me so im doing it all alone |
22:55:04 | * | auxym_ quit (Ping timeout: 258 seconds) |
22:57:11 | FromDiscord | <retkid> :nim2: |
23:05:29 | * | auxym_ joined #nim |
23:06:00 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3vW2 |
23:06:10 | * | auxym_ quit (Client Quit) |
23:08:07 | FromDiscord | <dain> like i want to parse the json without having to write it all in a busy nested line, but break it up into blocks like they do in that section |
23:08:16 | FromDiscord | <dain> (edit) "parse" => "deal with" |
23:16:46 | * | Pyautogui joined #nim |
23:21:19 | Pyautogui | Is it good Nim to use references like you would use pointers in C? Like https://play.nim-lang.org/#ix=3vWy. |
23:22:04 | FromDiscord | <Elegantbeef> You use references when you want references, if you want a pointer you use a pointer |
23:22:12 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3vWz |
23:22:22 | FromDiscord | <Elegantbeef> You also dont need to use cast for simple conversions |
23:22:30 | Pyautogui | Got it. |
23:33:42 | * | Pyautogui quit (Quit: Connection closed) |
23:48:34 | FromDiscord | <dain> sent a code paste, see https://play.nim-lang.org/#ix=3vWD |
23:51:57 | FromDiscord | <haxscramper> Not right now, kv matching requires {} syntax |
23:52:39 | FromDiscord | <dain> oh :( |
23:52:53 | FromDiscord | <haxscramper> So for json you can only use it |
23:53:02 | FromDiscord | <dain> oh btw, are the docs correct here? https://nim-lang.github.io/fusion/src/fusion/matching.html#matching-different-things-kvminuspairs-matching |
23:53:08 | FromDiscord | <dain> there is no "file" key in the json |
23:54:51 | FromDiscord | <haxscramper> It does not show output, so technically it is a correct example as it only describes syntax. But this should be clarified, yes |
23:55:02 | FromDiscord | <haxscramper> And added to tests |