00:02:01 | girvo | Unrelated, but my favourite thing in the world is UART suddenly no longer responding with anything I expect lol |
00:03:06 | girvo | Haha and _now_ it works. Oh joy |
00:03:11 | girvo | Hardware is "fun" |
00:07:31 | girvo | Aside from the explicit destructor on the Task object, it is working nicely. Cheers for the help! |
00:28:04 | * | jmdaemon quit (Ping timeout: 272 seconds) |
00:28:48 | FromDiscord | <Elegantbeef> This did give me an excuse to play around with my toy typed macros module |
00:29:19 | * | krux02_ joined #nim |
00:29:21 | FromDiscord | <Elegantbeef> Surprisingly simple implementation https://play.nim-lang.org/#ix=3Rdj |
00:29:53 | * | krux02 quit (Ping timeout: 256 seconds) |
00:31:49 | girvo | Oh nice! |
00:31:57 | girvo | Definitely gonna borrow that if you don't mind ;) |
00:32:09 | FromDiscord | <Elegantbeef> Well it's not public yet so no you arent 😛 |
00:32:56 | girvo | bwahaha |
00:33:19 | girvo | One day then :) your implementation is much more elegant than mine, though it is somewhat working |
00:34:57 | girvo | I distinctly remember using a library that enabled typed macros (different syntax mind you) way back whe |
00:35:00 | girvo | when* |
00:35:55 | girvo | Although I have a feeling it may have just been faking it. I do remember it gave crazy weird compile errors. I'm gonna go look at my old projects, this is going to annoy me otherwise if I can't remember it |
00:36:23 | FromDiscord | <Elegantbeef> There have been some implementations of macro utillities for a while, so dont doubt it |
00:37:03 | girvo | One thing I definitely need to do is brush up on whats changed. The last production usage I had of Nim was when v1 had literally just been released |
00:38:01 | FromDiscord | <Elegantbeef> I've been wanting a typed macro API for a while, also wanting more utilities for a long time, the stdlib macros lacks a lot of nice features. |
00:38:05 | FromDiscord | <Elegantbeef> I'd say not much has really changed |
00:40:03 | girvo | Yeah macros are powerful but they were definitely a bit lacking in some ergonomics compared to other parts of the language |
00:40:20 | girvo | And yeah that's so far what I've seen! Most of what I've been writing with my old knowledge is working fine lol |
00:46:04 | FromDiscord | <auxym> eli5 (or something)? What's a typed macro, vs the untyped macro that I'm somewhat used to? |
00:46:21 | FromDiscord | <Elegantbeef> Well that's not what we're talking about |
00:46:28 | FromDiscord | <Elegantbeef> Typed macros are semantically checked |
00:46:44 | FromDiscord | <Elegantbeef> A typed macro api is api that uses static typing with Nim nodes to make it more expressive and ergonomic |
00:50:21 | FromDiscord | <Elegantbeef> typed macros let you introspect types and do all the fancy jazz of macros on a typed nodes |
00:56:23 | FromDiscord | <auxym> ah, I sort of of get it, I think. So sort of one level higher than plain AST (aka untyped)? |
01:00:24 | FromDiscord | <Elegantbeef> Dont follow |
01:01:06 | girvo | My destructor for Task now works correctly, now that I fixed my main loop :) |
01:01:12 | FromDiscord | <Elegantbeef> typed macros are ran later than untyped macros so have type information they can use, the typed macro api uses distinct to give more(and safe) functionality to Nim nodes |
01:07:31 | * | girvo quit (Read error: Connection reset by peer) |
01:14:18 | * | krux02_ quit (Remote host closed the connection) |
01:19:40 | * | jmdaemon joined #nim |
01:21:49 | FromDiscord | <Elegantbeef> @auxym\: here's an example of my typed api https://play.nim-lang.org/#ix=3Rdt |
01:25:05 | * | jmdaemon quit (Ping timeout: 256 seconds) |
01:42:17 | * | girvo joined #nim |
01:42:17 | * | girvo quit (Client Quit) |
01:42:48 | * | jmdaemon joined #nim |
01:42:56 | * | girvo joined #nim |
02:08:20 | * | vicfred joined #nim |
02:24:49 | NimEventer | New question by itil memek cantik: Simple syntax to print out Nim address, see https://stackoverflow.com/questions/71331415/simple-syntax-to-print-out-nim-address |
02:25:14 | * | jmdaemon quit (Ping timeout: 272 seconds) |
02:28:10 | * | Gustavo6046 quit (Remote host closed the connection) |
02:28:17 | * | Gustavo6046_ joined #nim |
02:30:10 | * | jmdaemon joined #nim |
02:36:04 | * | vicfred quit (Quit: Leaving) |
02:43:50 | girvo | That's an interesting SO question. Best I can come up with is `echo fmt"{cast[int](addr(s)):#x}"` where s is the variable. Is there a better way? |
02:43:56 | FromDiscord | <cvv.tracy> sent a code paste, see https://paste.rs/nTx |
02:44:04 | FromDiscord | <cvv.tracy> whats going wrong? |
02:44:06 | FromDiscord | <cvv.tracy> sent a code paste, see https://play.nim-lang.org/#ix=3RdC |
02:44:45 | FromDiscord | <cvv.tracy> nvm i used the wrong cpu |
02:46:49 | * | Gustavo6046_ quit (Quit: Leaving) |
02:47:10 | * | Gustavo6046 joined #nim |
02:48:48 | FromDiscord | <Elegantbeef> `echo cast[int](s.addr).toHex` is the way to do it imo |
02:51:05 | girvo | Oh that's way nicer |
02:51:21 | girvo | Is repr identical in output to that? |
02:51:33 | * | girvo quit (Read error: Connection reset by peer) |
02:52:02 | * | neurocyte0917090 quit (Ping timeout: 240 seconds) |
02:53:29 | FromDiscord | <Elegantbeef> no repr is generally more explanitive |
02:55:05 | FromDiscord | <Girvo> Yeah makes sense |
03:42:06 | * | khole joined #nim |
03:45:01 | FromDiscord | <MaskDuck> what is the different between `let` and `const`? |
03:45:11 | FromDiscord | <Elegantbeef> let is runtime, const is compile time |
03:46:03 | FromDiscord | <congusbongus> const is more like constexpr in C++↵and not at all like javascript's let and const, despite the same names |
03:51:41 | FromDiscord | <MaskDuck> In reply to @congusbongus "const is more like": well |
03:51:47 | FromDiscord | <MaskDuck> what is similar with it in python |
03:52:35 | FromDiscord | <Elegantbeef> python doesnt even have immutable variables afaik |
03:52:38 | FromDiscord | <huantian> python variables are all var |
03:53:51 | FromDiscord | <huantian> technically `let` is `typing.Final`, but `typing.Final` is only enforced by a static type checker, while `let` is enforced by the language |
03:56:20 | * | arkurious quit (Quit: Leaving) |
03:56:39 | FromDiscord | <MaskDuck> ah ok thanks |
03:56:48 | nrds | <Prestige99> Is there a simple way to implement items and mitems as T vs lent T without duplicating the code? I could write a template, but am curious about alternatives |
03:56:53 | FromDiscord | <MaskDuck> In reply to @Elegantbeef "python doesnt even have": python right now is the only language i know |
03:57:14 | * | khole_ joined #nim |
03:57:34 | * | khole_ quit (Remote host closed the connection) |
03:57:38 | * | khole quit (Quit: Leaving) |
04:00:51 | FromDiscord | <Girvo> Are there any good documents on ref objects/mem management in general with ARC and threads? |
04:01:05 | * | rockcavera quit (Remote host closed the connection) |
04:04:37 | * | jmdaemon quit (Ping timeout: 240 seconds) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:32 | * | supakeen joined #nim |
04:07:36 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
04:10:13 | * | Gustavo6046 joined #nim |
04:10:27 | * | Gustavo6046 quit (Remote host closed the connection) |
04:12:40 | * | acidsys quit (Excess Flood) |
04:13:12 | * | acidsys joined #nim |
04:14:56 | * | Gustavo6046 joined #nim |
04:33:13 | * | jmdaemon joined #nim |
04:52:39 | NimEventer | New thread by Prestige: Can there be an else clause on a template (or macro)?, see https://forum.nim-lang.org/t/8970 |
04:53:08 | FromDiscord | <Elegantbeef> Prestige use `do` |
04:53:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3RdU |
04:55:05 | nrds | <Prestige99> Ah, so that's what I'd seen before |
04:55:20 | nrds | <Prestige99> the `do` keyword is a bit weird here eh |
04:56:08 | FromDiscord | <Rika> not really, why? |
04:56:17 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
04:56:20 | FromDiscord | <Elegantbeef> named do blocks do have a RFC iirc |
04:56:25 | nrds | <Prestige99> From a reading perspective |
04:56:32 | FromDiscord | <Rika> i guess so |
04:56:32 | nrds | <Prestige99> Neat, that will be nice |
04:56:42 | FromDiscord | <Rika> beef can you link the rfc xd |
04:58:38 | FromDiscord | <Elegantbeef> Cant find it, might be a fever dream |
04:59:36 | FromDiscord | <Rika> beef dreams of amazing RFCs at night |
05:23:47 | * | nrds quit (Remote host closed the connection) |
05:26:50 | * | nrds joined #nim |
05:31:13 | FromDiscord | <Elegantbeef> Ah was a forum post https://forum.nim-lang.org/t/8259#53171 |
05:36:45 | nrds | <Prestige99> ah, the same use case https://forum.nim-lang.org/t/8259#53165 |
05:51:56 | FromDiscord | <Rika> Else is not a good alternative |
05:52:02 | FromDiscord | <Rika> It’s less general than do |
05:57:53 | * | jkl quit (Quit: Gone.) |
05:58:18 | * | jkl joined #nim |
06:12:30 | nrds | <Prestige99> Yeah, I think I don't completely understand templates |
06:12:53 | nrds | <Prestige99> I was expecting the code to be inlined so I could just naturally use `else` |
06:13:26 | FromDiscord | <Elegantbeef> The AST still needs to be valid |
06:14:00 | FromDiscord | <Elegantbeef> It's more about the AST than templates, the template emits a `ifStmt(elifBranch)` |
06:14:08 | nrds | <Prestige99> the else in my example seems to be included in the `body` right? |
06:14:12 | FromDiscord | <Elegantbeef> there is no way for code after that `ifStmt` to add `else` to that AST |
06:14:17 | nrds | <Prestige99> ah, I see |
06:14:22 | FromDiscord | <Elegantbeef> No in your example else is another stmt |
06:14:43 | FromDiscord | <Elegantbeef> So you just have an else statement in top level |
06:15:00 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rec |
06:15:01 | nrds | <Prestige99> Well damn |
06:18:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/LNY |
06:57:21 | * | slowButPresent quit (Quit: leaving) |
06:58:11 | * | Gustavo6046 joined #nim |
07:07:19 | * | jjido joined #nim |
07:19:15 | * | ltriant quit (Ping timeout: 256 seconds) |
07:45:17 | * | PMunch joined #nim |
07:55:55 | * | Gustavo6046 quit (Quit: Leaving) |
07:56:57 | * | vicecea quit (Remote host closed the connection) |
07:57:27 | * | vicecea joined #nim |
08:01:44 | * | krux02 joined #nim |
08:05:08 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:37:39 | PMunch | It's quite annoying that you can't name your secondary blocks |
08:37:53 | PMunch | It's one of the few things you can't do in Nim, that and create other proc types.. |
08:38:22 | PMunch | But no-one liked my arbitrary proc-type RFC.. |
08:39:07 | FromDiscord | <Elegantbeef> I do like it, but quickly becomes very messy |
08:39:33 | PMunch | How so? |
08:42:48 | FromDiscord | <Elegantbeef> Well it gets harder to distinguish a proc def from a general call i think |
08:43:10 | PMunch | A general call? |
08:43:17 | FromDiscord | <Elegantbeef> `myProctype someThing(a, b)` for instance |
08:43:27 | FromDiscord | <Elegantbeef> I'm probably wrong |
08:43:43 | FromDiscord | <Elegantbeef> But i do very much like it, and personally thing it's better than pragmas |
08:44:03 | FromDiscord | <Elegantbeef> think\ |
08:44:16 | FromDiscord | <Rika> I don’t like it for as long as the keyword proc is omitted… |
08:44:18 | PMunch | It just feels a bit artificial that this thing is one of the few parts of the syntax we can't change |
08:44:23 | FromDiscord | <Rika> And even if not I’m still on the fence |
08:44:34 | PMunch | Like anything signature-like is off-limits |
08:44:34 | FromDiscord | <Rika> I do agree though I’m not really a fan of the pragma syntax either |
08:44:52 | FromDiscord | <Elegantbeef> I find pragmas very ill-eloquent but there isnt a good solution that i can see |
08:45:00 | FromDiscord | <Rika> Pretty much |
08:45:04 | FromDiscord | <Elegantbeef> I dont like C#/Rusts' preannotations either |
08:45:21 | PMunch | I've wanted to create HTTP routes in a framework as something signature-like, but I can't because the `proc (args): ret =` syntax is so fixed and locked off |
08:45:26 | FromDiscord | <Rika> By extension, Python decorators too? |
08:45:36 | FromDiscord | <Elegantbeef> yea |
08:45:47 | FromDiscord | <Elegantbeef> It's the same thing with `let` |
08:46:43 | FromDiscord | <Rika> I’m not sure, I think I would prefer decorators for less than 4 or so pragma combinations |
08:47:07 | FromDiscord | <Rika> Again though it’s hard to bolt that on to the syntax |
08:47:33 | PMunch | Personally I'd want `proc`, `let`, `var` etc. to all be the same "blockStmt" node kind and have as their first ident their name. Then let procs be the same node kind as assignments, a blockStmt with a `proc` ident, followed by an identDef with a bracket node with identDefs and the return type, and all that in an nnkAsgn to the stmtList of the body |
08:47:33 | FromDiscord | <Elegantbeef> Well the benefit of annotations is that they happen on their own line, so that's nice to reduce proc def noise |
08:48:18 | PMunch | This would have the weird side-effect that `proc` could also be used on a block of things though.. |
08:48:38 | FromDiscord | <Elegantbeef> I dont think it's that weird |
08:50:54 | * | gsalazar joined #nim |
08:52:02 | PMunch | Well maybe not weird, but certainly a bit foreign |
08:55:07 | FromDiscord | <Rika> Not very weird I’d say |
08:55:31 | PMunch | Well maybe not with a proc or two |
08:55:59 | PMunch | But imagine a whole standard library module with just one `proc` at the top, and then every definition in just one massive block below |
08:56:32 | FromDiscord | <Elegantbeef> Imagine one type def in just a single block 😛 |
08:57:13 | PMunch | Haha, fair enough |
08:58:17 | * | ltriant joined #nim |
08:58:24 | FromDiscord | <Rika> Type blocks are already weird outside of Nim though no? |
08:58:43 | FromDiscord | <Elegantbeef> You mean in that they dont exist? |
09:06:16 | * | ltriant quit (Ping timeout: 250 seconds) |
09:21:08 | PMunch | The only problem with my idea (apart from having to rewrite a bunch of stuff, is that it would be very tedious to have to verify if something is a procedure definition |
09:21:20 | PMunch | But all that could be solved by better macro tools |
09:21:35 | PMunch | It would break every single existing macro though |
09:21:47 | PMunch | Well, not every single one, but a lot of them |
09:41:29 | * | jmdaemon quit (Ping timeout: 256 seconds) |
09:57:49 | * | msimm joined #nim |
09:59:31 | PMunch | Hmm, is there a way to write to terminal without a newline in a macro? |
09:59:44 | PMunch | stdout.write complains that it can't importc stdout on compile-time.. |
10:01:48 | FromDiscord | <Elegantbeef> Short of printing a character that ignores `\n` i dont think so |
10:05:18 | * | ltriant joined #nim |
10:18:53 | * | gsalazar quit (Ping timeout: 256 seconds) |
10:28:52 | * | msimm quit (Quit: Leaving) |
10:53:09 | PMunch | Uhm, can't we print uints any longer? http://ix.io/3ReD |
10:54:00 | * | gsalazar joined #nim |
10:55:39 | PMunch | Tried to throw a dollar in there: http://ix.io/3ReE |
10:57:15 | FromDiscord | <planetis> weird |
10:58:25 | FromDiscord | <planetis> works for me for both uint and uint64 |
11:00:08 | * | gsalazar quit (Ping timeout: 272 seconds) |
11:03:46 | FromDiscord | <Rika> theres prolly a converter in macros that does uint->nimnode for some reason |
11:04:25 | NimEventer | New question by itil memek cantik: To reset Nim runtime array, see https://stackoverflow.com/questions/71336036/to-reset-nim-runtime-array |
11:05:19 | FromDiscord | <Rika> we already answered this... |
11:11:05 | FromDiscord | <demotomohiro> He/She think he get better answer on stackover flow rather than Nim discord or Nim forum? |
11:13:37 | FromDiscord | <Rika> idk |
11:59:45 | PMunch | I think my system is a bit broken: http://ix.io/3ReQ |
12:00:55 | FromDiscord | <Rika> sus |
12:01:33 | * | tinystoat quit (Remote host closed the connection) |
12:01:41 | * | tinystoat joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:30 | * | supakeen joined #nim |
12:10:40 | * | tinystoat quit (Quit: Reconnecting) |
12:10:48 | * | tinystoat joined #nim |
12:13:45 | FromDiscord | <ynfle> Is there a way to attach a macro as a pragma to a lambda? |
12:16:33 | PMunch | Doesn't the normal {..} syntax work? |
12:17:38 | PMunch | Hmm, so I'm trying to fix this: https://github.com/PMunch/futhark/issues/9 |
12:17:55 | PMunch | The problem is that negative number can't be converted to unsigned numbers in Nim |
12:18:00 | FromDiscord | <ynfle> In reply to @PMunch "Doesn't the normal {..}": Ya, I meant the sugar `=>` lambdas |
12:18:21 | PMunch | @ynfle, oh I believe they don't have any syntax for attaching pragmas |
12:18:39 | FromDiscord | <ynfle> In reply to @PMunch "The problem is that": You can cast |
12:18:51 | PMunch | Exactly, in that situation you can cast |
12:19:04 | PMunch | But let's say I have a cuchar |
12:19:16 | PMunch | That's a uint8 basically |
12:19:31 | PMunch | So casting 10'i64 to that won't work will it? |
12:20:24 | PMunch | Huh, tried it on the playground and apparently it does.. |
12:47:09 | FromDiscord | <Waldecir Santos> How can I declare a "nullable" sequence? |
12:47:56 | FromDiscord | <Rika> make it a pointer or a reference? or use options, its safer |
12:51:29 | FromDiscord | <Waldecir Santos> Perfect let me try it |
12:56:40 | FromDiscord | <Waldecir Santos> It worked, Option and checking with IsNone, ty @Rika |
12:56:51 | FromDiscord | <Rika> 👌 |
13:01:25 | * | rockcavera joined #nim |
13:01:25 | * | rockcavera quit (Changing host) |
13:01:25 | * | rockcavera joined #nim |
13:16:17 | * | jjido joined #nim |
13:31:04 | * | acidsys quit (*.net *.split) |
13:31:04 | * | cornfeedhobo quit (*.net *.split) |
13:31:04 | * | madprops quit (*.net *.split) |
13:31:04 | * | lain quit (*.net *.split) |
13:31:05 | * | ssiyad quit (*.net *.split) |
13:31:05 | * | dv^_^ quit (*.net *.split) |
13:31:05 | * | mal`` quit (*.net *.split) |
13:32:30 | * | acidsys joined #nim |
13:32:30 | * | cornfeedhobo joined #nim |
13:32:30 | * | madprops joined #nim |
13:32:30 | * | lain joined #nim |
13:32:30 | * | ssiyad joined #nim |
13:32:30 | * | dv^_^ joined #nim |
13:32:30 | * | mal`` joined #nim |
13:33:16 | * | cornfeedhobo quit (Max SendQ exceeded) |
13:33:16 | * | ssiyad quit (Max SendQ exceeded) |
13:33:24 | * | ssiyad joined #nim |
13:42:32 | * | cornfeedhobo joined #nim |
13:43:45 | * | ltriant quit (Ping timeout: 256 seconds) |
13:45:24 | FromDiscord | <Tanguy> Is there a oneliner to know the number of fields in an object at CT?↵eg: static echo fields(theType).len |
13:52:37 | FromDiscord | <Lüke> What's the best way to learn it |
13:54:18 | FromDiscord | <enthus1ast> Learn what\_ |
13:54:19 | FromDiscord | <enthus1ast> ? |
13:54:24 | FromDiscord | <Lüke> Nim |
13:54:42 | FromDiscord | <Michal Maršálek> I just took a long at the Swift programming language at it seems to be (syntactically) almost identical to Nim. How do they compare in other aspects? I wasn't able to find any article that would focus on comparing the two. |
13:54:44 | FromDiscord | <enthus1ast> i think this depends on you, how you normally learn new stuff? \:) |
13:55:00 | FromDiscord | <Lüke> In reply to @enthus1ast "i think this depends": YouTube |
13:55:18 | FromDiscord | <enthus1ast> mh yeah i think we have some yt vids |
13:55:23 | FromDiscord | <Lüke> Ok |
13:55:39 | FromDiscord | <enthus1ast> i can recommend to choose a small issue you have, and fix it with nim |
13:55:40 | FromDiscord | <Lüke> Thx |
13:55:48 | FromDiscord | <Lüke> In reply to @enthus1ast "i can recommend to": Ok |
13:55:52 | FromDiscord | <Michal Maršálek> (edit) "long" => "look" | "at" => "for the first time and" |
14:00:43 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
14:14:51 | PMunch | Oh goodness gracious. I'm looking at the pakku package manager and this code is so hard to read.. |
14:15:18 | FromDiscord | <Rika> i thought so too lmao |
14:15:46 | PMunch | @Tanguy, not that I know of, no |
14:16:17 | PMunch | @Rika, it's just full of building structures and passing them around filtering stuff in and out |
14:16:42 | PMunch | Like every procedure takes 8 different arguments and spits out a tuple of a bunch of sequences and tables |
14:16:47 | PMunch | It's crazy town |
14:20:58 | FromDiscord | <Rika> mm love it when procs have more than 6 or so params |
14:24:35 | PMunch | @Michal_Maršálek, it's syntactically pretty similar, but they're quite different under the hood |
14:24:49 | PMunch | Nim compiles to C and JavaScript, Swift only native compiles I believe |
14:25:01 | PMunch | And it doesn't have meta-programming |
14:25:13 | PMunch | As far as I can tell |
14:37:03 | FromDiscord | <lpha3ch0> BitDefender is detecting anything in Nim as malware, even a one line `echo "Hello"`. I submitted multiple false-positive reports to them. |
14:47:35 | PMunch | @lpha3ch0, yeah the fingerprinting for AV is completely broken for Nim.. |
14:48:02 | PMunch | Keep submitting those false-positives though, that's the only way this might someday get fixed |
14:51:28 | * | gsalazar joined #nim |
14:57:16 | FromDiscord | <fbpyr> on our side only nim-grab.exe gets flagged as 'trojan'.. 🙄 |
15:02:18 | * | arkurious joined #nim |
15:06:57 | FromDiscord | <Evrensel Kişilik> hewwwooooo |
15:07:09 | FromDiscord | <Evrensel Kişilik> Nim types are circular |
15:07:10 | FromDiscord | <Evrensel Kişilik> 😱 |
15:08:43 | FromDiscord | <huantian> Well they can be at least |
15:16:46 | FromDiscord | <Evrensel Kişilik> how can i calculate array size of Nim array in GDB? |
15:19:31 | * | gsalazar quit (Ping timeout: 256 seconds) |
15:22:03 | * | gsalazar joined #nim |
15:24:44 | FromDiscord | <Rika> I think it is type erased at that point, perhaps? |
15:24:48 | FromDiscord | <System64 ~ Flandre Scarlet> I need a reminder↵↵How can I c2nim-ify a .h file please? It should be used with a dll |
15:25:01 | FromDiscord | <Evrensel Kişilik> In reply to @Rika "I think it is": whaaaaaaaat |
15:25:08 | * | slowButPresent joined #nim |
15:25:17 | FromDiscord | <Rika> Maybe check what a Nim array compiles into in C |
15:25:27 | FromDiscord | <Rika> I can’t, I’m about to sleep lol |
15:26:05 | FromDiscord | <Evrensel Kişilik> In reply to @Rika "Maybe check what a": https://media.discordapp.net/attachments/371759389889003532/948964486147084308/unknown.png |
15:26:06 | FromDiscord | <Evrensel Kişilik> thissss |
15:26:17 | FromDiscord | <Evrensel Kişilik> im doing Nim things |
15:28:00 | PMunch | @System64_~_Flandre_Scarlet, might I interest you in Futhark? |
15:28:01 | FromDiscord | <Evrensel Kişilik> i can get `gdb.Value` |
15:28:06 | FromDiscord | <Evrensel Kişilik> (edit) "i can get `gdb.Value` ... " added "indexes" |
15:28:11 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, might I interest": What's that? |
15:28:27 | FromDiscord | <Evrensel Kişilik> (edit) "i can" => "im able to" |
15:28:30 | PMunch | @System64_~_Flandre_Scarlet, https://github.com/PMunch/futhark |
15:28:39 | FromDiscord | <Evrensel Kişilik> buuuuut itereation is infinite |
15:28:40 | FromDiscord | <Evrensel Kişilik> 😭 |
15:28:56 | FromDiscord | <Rika> Sorry I don’t know how to help here |
15:29:05 | FromDiscord | <Evrensel Kişilik> WHERE ARE NIM DEEEEEEEVSSS |
15:29:42 | PMunch | @Evrensel_Kişilik, take it easy |
15:29:52 | PMunch | Spamming this channel won't get you anywhere |
15:30:10 | FromDiscord | <Evrensel Kişilik> In reply to @PMunch "Spamming this channel won't": YOU BOT |
15:30:14 | FromDiscord | <Evrensel Kişilik> you are an AI |
15:30:21 | PMunch | Not this again.. |
15:30:29 | PMunch | I'm not a bot, I'm using IRC |
15:30:33 | FromDiscord | <Evrensel Kişilik> i don't talk to bots |
15:30:46 | PMunch | We're bridged into Discord through a bot |
15:31:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, https://github.com/PMu": Sounds interesting! but the lib I'm using uses gcc or MSVC, is that a problem? |
15:32:32 | FromDiscord | <Evrensel Kişilik> oh |
15:32:40 | FromDiscord | <Evrensel Kişilik> i was doing a typo lol |
15:33:07 | PMunch | @System64_~_Flandre_Scarlet, hmm might be. Futhark only needs to be able to parse your files with clang though |
15:33:23 | PMunch | I've used futhark and compiled my Nim code with GCC just fine |
15:33:30 | PMunch | In fact that's what I normally do |
15:34:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "I've used futhark and": I think my lib was built with MSVC ('cause Visual Studio) but the code is C99 |
15:36:03 | PMunch | That should be fine then |
15:36:54 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright |
15:38:26 | FromDiscord | <Evrensel Kişilik> yayyy |
15:38:27 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948967601437048902/unknown.png |
15:38:28 | FromDiscord | <Evrensel Kişilik> got it |
15:38:45 | FromDiscord | <Evrensel Kişilik> soooooooo auto array support is incoming |
15:39:43 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RfN |
15:39:43 | FromDiscord | <System64 ~ Flandre Scarlet> during installation |
15:41:42 | FromDiscord | <Evrensel Kişilik> yayyyyyyy |
15:41:42 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948968418541969428/unknown.png |
15:42:57 | PMunch | @System64_~_Flandre_Scarlet, did you install libclang first? |
15:43:52 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, did you install": through nimble? |
15:44:09 | PMunch | Ah wait, you're on Windows.. |
15:44:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Ah wait, you're on": yes I'm |
15:44:50 | PMunch | @System64_~_Flandre_Scarlet, in that case see this: https://github.com/PMunch/futhark/issues/1 |
15:45:45 | PMunch | Or just the installation section of the README I guess: https://github.com/PMunch/futhark#installation |
15:46:07 | FromDiscord | <System64 ~ Flandre Scarlet> ah alright, thanks |
15:53:31 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RfP |
16:00:38 | * | vicfred joined #nim |
16:02:38 | * | al1ranger joined #nim |
16:06:19 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948974612929191957/unknown.png |
16:06:27 | FromDiscord | <Evrensel Kişilik> this says optimized out |
16:06:41 | FromDiscord | <Evrensel Kişilik> soooooooooo how could i get size of ptr array? |
16:06:52 | FromDiscord | <Evrensel Kişilik> i added auto array support |
16:07:24 | FromDiscord | <Evrensel Kişilik> nooow im working on ptr array support |
16:07:38 | FromDiscord | <Evrensel Kişilik> oh |
16:07:43 | FromDiscord | <Evrensel Kişilik> damn it is garbage collected |
16:07:44 | FromDiscord | <Evrensel Kişilik> lol |
16:09:00 | * | gsalazar quit (Ping timeout: 240 seconds) |
16:10:28 | * | ltriant joined #nim |
16:11:54 | FromDiscord | <Evrensel Kişilik> i forgot build command |
16:12:06 | FromDiscord | <Evrensel Kişilik> how can i build with debug symbols? |
16:14:06 | PMunch | @System64_~_Flandre_Scarlet, it says in your error: Error: unhandled exception: file 'C:\Users\user\Documents\programmation\Tilengine\include\Files\LLVM\lib' does not exist [OSError] |
16:14:32 | PMunch | That -L should probably be within the quotes |
16:14:46 | PMunch | And you might need to escape the space in that path, not entirely sure |
16:15:21 | PMunch | @Evrensel_Kişilik, --debugger:native? |
16:16:05 | * | al1ranger quit (Quit: Leaving) |
16:16:08 | PMunch | And please try to stick to normal spelling, you're going to wear out your o key.. |
16:16:38 | * | ltriant quit (Ping timeout: 260 seconds) |
16:16:38 | FromDiscord | <Evrensel Kişilik> In reply to @PMunch "@Evrensel_Kişilik, --debugger:native?": found |
16:18:12 | FromDiscord | <Phil> TFW you wanna download an arch iso but it only shows you a torrent |
16:18:34 | FromDiscord | <Phil> (edit) "TFW you wanna download an arch iso but it only shows you a torrent ... " added "that takes forever to start downloading" |
16:18:57 | FromDiscord | <Phil> .... a second after I wrote this it finally found some peers to download from |
16:19:05 | FromDiscord | <Phil> (edit) "from" => "from, after waiting for 2 minutes already" |
16:19:16 | nrds | <Prestige99> There are direct downloads further down the page if you want to try those |
16:20:42 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/EZ2 |
16:38:54 | NimEventer | New thread by Akito: Nim project using C++ Backend with single module using library wrapping a C library, see https://forum.nim-lang.org/t/8971 |
16:44:48 | PMunch | @System64_~_Flandre_Scarlet, try `nimble install futhark --passL:"-LC:/Program\ Files/LLVM/lib/libclang.lib"` |
16:45:10 | PMunch | Oh sorry, `nimble install futhark --passL:"-LC:/Program\ Files/LLVM/lib"` |
16:45:43 | FromDiscord | <Evrensel Kişilik> yayyy |
16:45:48 | FromDiscord | <Evrensel Kişilik> i made ptr arrays tooo |
16:45:49 | FromDiscord | <Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948984553173844028/unknown.png |
16:47:04 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Rg5 |
16:50:22 | PMunch | Why is it looking in C:\Users\user\Documents\programmation\Tilengine\include\Files\LLVM? |
16:51:50 | FromDiscord | <Ayy Lmao> Is there a way to make a copy of a ref without constructing a new one from scratch? |
16:52:15 | PMunch | Wait, is it messing up the path and only grabbing " Files/LLVM/lib" from the one you passed in and attaches it to your current working directory? |
16:52:22 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Why is it looking": No idea, but ``C:\Users\user\Documents\programmation\Tilengine\include\`` is my working directory |
16:52:36 | PMunch | @Ayy_Lmao, define copy of a ref |
16:52:46 | PMunch | `var x = y` creates a copy of the reference |
16:53:11 | PMunch | `var x = y.copy` or `var x = y.deepCopy` creates a copy of the underlying object |
16:53:32 | PMunch | @System64_~_Flandre_Scarlet, yeah it looks like it is messing up on that space |
16:53:53 | PMunch | Maybe `nimble install futhark --passL:"-L'C:/Program\ Files/LLVM/lib'"`? |
16:54:00 | PMunch | I'm not too familiar with path handling on Windows |
16:54:34 | FromDiscord | <System64 ~ Flandre Scarlet> still not |
16:55:39 | FromDiscord | <Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3Rge |
16:56:00 | FromDiscord | <Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=3Rge" => "https://play.nim-lang.org/#ix=3Rgf" |
16:56:44 | FromDiscord | <Waldecir Santos> How should implement `$` to make an object "echoable" ? I've implemented $ but I'm getting this error |
16:56:52 | FromDiscord | <Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3Rgg |
16:56:55 | FromDiscord | <Waldecir Santos> it works if I do `echo $obj` |
16:57:53 | PMunch | @Ayy_Lmao, try deepCopy then |
16:58:26 | PMunch | @Waldecir_Santos, that sounds odd. it should be applied automatically in that situation |
16:58:41 | PMunch | But you might need to export it if you want to echo it from a different module |
16:58:52 | FromDiscord | <Waldecir Santos> this is the declaration `proc `$`[T: Model](model: T): string =` |
16:59:09 | PMunch | Ah, it might not match a generic like that |
17:00:03 | FromDiscord | <Ayy Lmao> In reply to @PMunch "@Ayy_Lmao, try deepCopy then": Yeah deepCopy works, thanks! |
17:00:04 | * | ltriant joined #nim |
17:05:25 | FromDiscord | <Waldecir Santos> In reply to @PMunch "Ah, it might not": `$` was not exported 🤦♂️ , I've missed the `` |
17:06:12 | * | ltriant quit (Ping timeout: 272 seconds) |
17:06:28 | PMunch | @Waldecir_Santos, common mistake, didn't you see my first suggestion? :) |
17:06:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Maybe `nimble install futhark": It still doesn't work |
17:06:58 | FromDiscord | <Waldecir Santos> In reply to @PMunch "@Waldecir_Santos, common mistake, didn't": I see it now, sorry and Thank you ! |
17:07:36 | PMunch | @System64_~_Flandre_Scarlet, well you need to figure out how to pass the libclang library to Futhark, I'm not familiar enough with Windows to help you unfortunately. Maybe @enthus1ast who initially figured out how to compile for Windows can tell you more? |
17:07:48 | PMunch | @Waldecir_Santos, no problem :) |
17:34:33 | * | gsalazar joined #nim |
17:34:34 | FromDiscord | <System64 ~ Flandre Scarlet> well I have a problem : seems the header changed |
17:34:45 | PMunch | Which header? |
17:34:49 | FromDiscord | <System64 ~ Flandre Scarlet> That https://media.discordapp.net/attachments/371759389889003532/948996885878800444/Tilengine.h |
17:35:39 | PMunch | Just a sec, need to reboot |
17:35:40 | * | PMunch quit (Quit: leaving) |
17:36:01 | FromDiscord | <System64 ~ Flandre Scarlet> This is the old header https://media.discordapp.net/attachments/371759389889003532/948997185293410314/Tilengine.h |
17:36:42 | FromDiscord | <System64 ~ Flandre Scarlet> wait wtf↵I forgot how I c2nim'ed this |
17:37:17 | * | PMunch joined #nim |
17:37:24 | FromDiscord | <System64 ~ Flandre Scarlet> But this is the old binding https://media.discordapp.net/attachments/371759389889003532/948997532237840395/Tilengine.nim |
17:38:09 | FromDiscord | <System64 ~ Flandre Scarlet> and here the new one https://media.discordapp.net/attachments/371759389889003532/948997722004930620/Tilengine.nim |
17:40:50 | PMunch | Wait, why are you asking me about c2nim stuff? |
17:40:58 | PMunch | Just use Futhark :( |
17:41:01 | PMunch | :)* |
17:41:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Just use Futhark :(": I want to use it, but I struggle with this error :/ |
17:48:26 | FromDiscord | <Evrensel Kişilik> https://github.com/rohanrhu/gdb-frontend/commit/5f3f1b352d68caec78bc8085a4257ffc74d6a4ce |
17:48:38 | FromDiscord | <Evrensel Kişilik> you can try this revision |
17:48:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "you can try this": me? |
17:49:14 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "me?": oh no i mean all Nim people 😱 |
17:49:20 | FromDiscord | <System64 ~ Flandre Scarlet> Ah alright, sorry |
17:49:29 | FromDiscord | <System64 ~ Flandre Scarlet> I thought it was about my problem |
17:49:40 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "I thought it was": what is your problem? |
17:50:26 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "what is your problem?": Cannot install Futhark |
17:50:33 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "Cannot install Futhark": what is it?? |
17:50:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "what is it??": Converting a C header into nim |
17:58:46 | PMunch | @System64_~_Flandre_Scarlet, if you get it working you won't have to worry about headers changing |
18:03:46 | FromDiscord | <rlipsc> sent a long message, see http://ix.io/3RgC |
18:04:05 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, if you get": and where is the Futhark folder? Maybe if I put the libs inside, it can work |
18:05:37 | FromDiscord | <Waldecir Santos> I was reading the document/tutorial and see a topic about `Dynamic dispatch` but the tutorial dosen't explain what is and what is the diference between Static vs Dynamic the only diference I can see is the use of `method` instead of `proc` |
18:08:15 | FromDiscord | <rlipsc> To summarise: what's the best way within a macro to tell if a `NimNode` returns a value. |
18:10:56 | FromDiscord | <rlipsc> In reply to @Waldecir Santos "I was reading the": dynamic dispatch means what gets dispatched can change at runtime (`method` could call different code depending on the run time type), whereas static dispatch is fixed at compile time and never changes. |
18:12:57 | * | rockcavera quit (Remote host closed the connection) |
18:13:29 | FromDiscord | <Waldecir Santos> In reply to @rlipsc "dynamic dispatch means what": Isn't better to use Generics ? I still don't understand the use case for it. |
18:14:07 | FromDiscord | <Waldecir Santos> It's seems like a python class/def for me |
18:14:25 | FromDiscord | <rlipsc> Generics are statically dispatched. Essentially they create a new proc for each type and the compiler works out which version to call. What gets run is fixed at compile time. |
18:15:06 | FromDiscord | <rlipsc> Python is dynamically typed for everything and doesn't really have static dispatch, so if you're used to that I can understand your confusion! |
18:17:26 | FromDiscord | <rlipsc> dynamic dispatch, at least for `method`, is based on inheritance so if you're using that you might well want `method` to work out which version of the call it should use at run time |
18:19:52 | PMunch | @System64_~_Flandre_Scarlet, you would have to clone the Futhark repo to have them locally |
18:20:09 | PMunch | Then move your files into there, and then nimble install while standing in that folder |
18:20:25 | FromDiscord | <rlipsc> `proc` and generics being static means Nim knows it can just output the code without needing to check anything. Often, this is "better" (faster), but ofc it depends what you're doing 🙂 |
18:20:32 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, you would have": ah alright, will try that |
18:21:41 | * | gsalazar quit (Ping timeout: 256 seconds) |
18:21:51 | FromDiscord | <System64 ~ Flandre Scarlet> and where should I put the lib and dll? |
18:27:03 | FromDiscord | <System64 ~ Flandre Scarlet> okay seems it still doesn't find clang |
18:27:37 | * | Gustavo6046 joined #nim |
18:28:59 | FromDiscord | <ajusa> PMunch is there any reason the list of versions isn't read at runtime for the Nim playground? Is it so you can add a new version without restarting the web server? |
18:31:30 | FromDiscord | <ajusa> also just as an FYI - I'm making decent progress on the HTMX conversion, but this can result in the playground API breaking. Not sure who is really using it. The ix.io links won't be broken though, I've come up with a way to avoid that |
18:47:39 | FromDiscord | <pmunch> @ajusa\: yes there is a script which updates the docker images automatically. So that's why the versions are read on runtime |
18:48:14 | FromDiscord | <pmunch> The API is used for a couple things, so it would really be best if it didn't break |
18:48:43 | FromDiscord | <System64 ~ Flandre Scarlet> PMunch, even if I put the libs into the folder, it still doesn't work |
18:49:08 | FromDiscord | <pmunch> Same error? |
18:49:42 | FromDiscord | <ajusa> In reply to @pmunch "The API is used": got it. In that case, I'll focus on just adding new routes for HTMX rather than replacing the old JSON ones |
18:50:27 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RgO |
18:52:21 | FromDiscord | <rlipsc> sent a code paste, see https://paste.rs/wb2 |
18:52:44 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @rlipsc "`ld.exe: cannot find -lclang`": I don't know how to solve it |
18:55:35 | FromDiscord | <rlipsc> me either, but at a guess I'd say `-lclang` is some library or switch that the C/C++ backend can't find the path for? |
18:56:47 | * | ltriant joined #nim |
19:00:16 | PMunch | @ajusa, better yes use the `Accept` header like I did in https://github.com/PMunch/autotemplate/ or a `.json` postfix and a route that matches with or without it. |
19:01:31 | PMunch | And what command was that? |
19:01:45 | PMunch | @System64_~_Flandre_Scarlet, and what command was that? |
19:01:52 | FromDiscord | <ajusa> In reply to @PMunch "<@102899813149855744>, better yes use": that won't be needed, as all HTMX requests by default include the `HX-Request` header which I can use to distinguish frontend requests from JSON requests. That way it's purely additive. |
19:01:55 | * | ltriant quit (Ping timeout: 256 seconds) |
19:02:02 | FromDiscord | <rlipsc> sent a code paste, see https://play.nim-lang.org/#ix=3RgW |
19:02:22 | PMunch | @rlipsc, -lclang is telling the C compiler that we want to link in libclang.so on Linux, or whatever the equivalent on Windows is |
19:02:41 | FromDiscord | <System64 ~ Flandre Scarlet> on Windows it's a DLL |
19:03:09 | PMunch | @ajusa, I still like the idea of using the Accept header, that way it's not really HTMX specific |
19:03:12 | FromDiscord | <rlipsc> In reply to @PMunch "<@800432830605819906>, -lclang is telling": Ah fair enough, maybe it just can't see the paths for some reason then |
19:03:40 | PMunch | Yeah that's what I'm trying to figure out |
19:03:46 | PMunch | Why it isn't finding it |
19:03:50 | PMunch | Stupid Windows.. |
19:04:19 | FromDiscord | <rlipsc> yeah the path stuff in windows seems like an ancient clingon in 2022 |
19:04:29 | FromDiscord | <System64 ~ Flandre Scarlet> I hate Windows lol |
19:05:16 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3RgX |
19:05:49 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3RgY |
19:06:54 | * | jjido joined #nim |
19:07:35 | FromDiscord | <b4mbus> Ive actually never made any bigger application in my life so I want to start to do something. I have no idea how to design software, classes, etc. and I will post the whole thing here somewhere once I finish it (hopefully I will) |
19:09:04 | PMunch | @b4mbus, async != threads |
19:09:48 | FromDiscord | <b4mbus> In reply to @PMunch "<@644284217525665793>, async != threads": What are you reffering to? |
19:10:17 | PMunch | "Ive actually never done anything involving |
19:10:17 | PMunch | # threads except some simple programs or maybe calling async functions.! |
19:10:25 | PMunch | Oops, silly copy-paste.. |
19:10:46 | FromDiscord | <b4mbus> well yeah, I should have probably say `parallelism/concurrency` |
19:10:53 | FromDiscord | <b4mbus> (edit) "say `parallelism/concurrency`" => "said`parallelism/concurrency`" |
19:11:07 | FromDiscord | <System64 ~ Flandre Scarlet> Humm so what should I do? |
19:18:17 | FromDiscord | <auxym> In reply to @b4mbus "well yeah, I should": so what do you want to do? threads or single-threaded async? Or async and threads? Tbh for your use case, you should probably just do single-threaded async. Consider threads if/when you become CPU-bound. |
19:19:42 | FromDiscord | <auxym> In reply to @System64 "Humm so what should": do you have clang.dll somewhere gcc can find it? |
19:20:04 | FromDiscord | <b4mbus> Well Im not sure :p. The error handler has to be running separately and at the same time as the discord service - the discord service is basically the meat of the app, there's the main loop that handles all the inbound/outbound requests. The error handler loop should be running because if some command or some other part of the app raises an error it should get picked up and handled. |
19:20:09 | FromDiscord | <b4mbus> In reply to @auxym "so what do you": Well Im not sure :p. The error handler has to be running separately and at the same time as the discord service - the discord service is basically the meat of the app, there's the main loop that handles all the inbound/outbound requests. The error handler loop should be running because if some command or some other part of the app raises an error it should get picked up and handled. |
19:23:13 | FromDiscord | <auxym> How does that work? Do you have some sort of catchall exception handler? Or do you use `Result`? Something else? Still sounds like something that could be awaited in an async event loop, if you want to avoid the complexity of threads. |
19:23:47 | FromDiscord | <auxym> On the topic of threads, I'd recommend Araq's latest FOSDEM talk, even though the title is sort of misleading (concurrency). |
19:25:24 | FromDiscord | <b4mbus> In reply to @auxym "How does that work?": How does what work? |
19:25:35 | FromDiscord | <b4mbus> the error handler? |
19:27:28 | FromDiscord | <auxym> yes |
19:33:20 | FromDiscord | <b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rh5 |
19:33:21 | FromDiscord | <b4mbus> sent a code paste, see https://paste.rs/SE5 |
19:33:42 | FromDiscord | <b4mbus> again: Im quite new to Nim and Ive never made anything big, never designed any software, neved dealt with concurrency/parallelism |
19:35:47 | FromDiscord | <planetis> any chance I could get smthing like that compiling https://play.nim-lang.org/#ix=3Rh6 ? |
19:43:00 | FromDiscord | <auxym> In reply to @b4mbus "again: Im quite new": I was mostly wondering how your errors get added to the error queue. But in any case, could you not make your error handler proc `{.async.}` and await the handler instead of adding errors to the queue? I'm not at all an expert on this stuff, but threads would probably just add complexity to your code without any performance gain (unless you are cpu bound on a single thread just handling your ap |
19:45:09 | FromDiscord | <b4mbus> In reply to @auxym "I was mostly wondering": \> But in any case, could you not make your error handler proc {.async.} and await the handler instead of adding errors to the queue?↵wym `could you not`? My error handler proc is not async and Im not awaiting anywhere |
19:46:58 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rh8 |
19:47:38 | FromDiscord | <planetis> actually I am trying to use the enum to compute a different size |
19:47:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:49:11 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rh9 |
19:50:01 | FromDiscord | <planetis> wow |
19:50:12 | FromDiscord | <planetis> thanks elegant beef |
19:51:09 | FromDiscord | <planetis> out of curiosity do you know which code path enums follow https://github.com/nim-lang/Nim/blob/devel/compiler/semtypes.nim#L296 ? |
19:51:55 | FromDiscord | <Elegantbeef> Probably 325 |
19:52:11 | FromDiscord | <Elegantbeef> That or 301 |
19:52:26 | FromDiscord | <Elegantbeef> The issue is not array semming though |
19:52:55 | FromDiscord | <planetis> Bar[a] matches enum? wtf |
19:52:55 | FromDiscord | <Elegantbeef> The issue is the preparation for array semming, the T isnt replaced with the type, and as such the array sem cannot work |
19:53:03 | FromDiscord | <Elegantbeef> `T: static enum` is a value |
19:53:09 | FromDiscord | <planetis> oh ok |
19:53:11 | FromDiscord | <Elegantbeef> `T: enum` is a type |
19:53:52 | FromDiscord | <b4mbus> In reply to @auxym "On the topic of": which one are you talking about? |
19:56:07 | FromDiscord | <auxym> https://fosdem.org/2022/schedule/event/nim_concurrency/ |
19:57:05 | FromDiscord | <auxym> I was suggesting making your handler proc async, to clarify. That way the built-in async event queue could dispatch the error handling calls for you instead of having your own queue in a separate thread. |
19:57:43 | FromDiscord | <b4mbus> In reply to @auxym "I was suggesting *making*": Ill check that out, thanks |
20:01:44 | FromDiscord | <planetis> i got rid of generics, there are a pain in the rear |
20:03:24 | FromDiscord | <Elegantbeef> They really arent but ok 😛 |
20:03:27 | FromDiscord | <planetis> I don't know how you do it, but they never work for me and i have no clue whats happening |
20:03:57 | FromDiscord | <planetis> well that's it when I am trying more complicated stuff |
20:04:30 | FromDiscord | <Elegantbeef> I normally try stuff if it doesnt work try to fix it, aside from the array isssue |
20:04:42 | FromDiscord | <Elegantbeef> That stuff is unfixable afaict 😛 |
20:05:28 | FromDiscord | <planetis> if you are curious what it was https://play.nim-lang.org/#ix=3Rhe its just a bitset |
20:06:06 | FromDiscord | <Elegantbeef> Is nim's built in set not good enough? |
20:06:34 | FromDiscord | <planetis> well up to a point |
20:07:14 | FromDiscord | <planetis> i think after 64 values it becomes an array byte |
20:07:31 | FromDiscord | <planetis> so in theory array uint is faster |
20:07:42 | FromDiscord | <Elegantbeef> after 8 values\ |
20:07:54 | FromDiscord | <planetis> need to check out if its vectorised |
20:08:04 | FromDiscord | <Elegantbeef> `set[0..15]` emits a `NI[2]` in C |
20:17:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "do you have clang.dll": I installed Clang |
20:17:29 | FromDiscord | <System64 ~ Flandre Scarlet> So it should be in the PATH |
20:25:36 | * | jmdaemon joined #nim |
20:45:41 | * | rockcavera joined #nim |
20:45:41 | * | rockcavera quit (Changing host) |
20:45:41 | * | rockcavera joined #nim |
20:59:36 | FromDiscord | <auxym> In reply to @System64 "So it should be": I don't think PATH is used for dll resolution. See: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#search-order-for-desktop-applications |
21:03:31 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @auxym "I don't think PATH": It's for installing a module (Futhark), and it needs a dll for compiling the module |
21:04:27 | FromDiscord | <Phil> Oh lord... what command can I use to update nim again? Seems the arch repos have it on 1.4.8 |
21:06:42 | FromDiscord | <auxym> consider using https://github.com/dom96/choosenim |
21:09:15 | FromDiscord | <enthus1ast> choosenim |
21:09:15 | FromDiscord | <enthus1ast> (if it supports arch) |
21:12:43 | FromDiscord | <Phil> There we go, I was being an idiot and didn't have the right things set in the classpath |
21:12:46 | FromDiscord | <Phil> It does support arch |
21:14:35 | FromDiscord | <enthus1ast> path(es?) are such a madness on "real system" like clusters etc that one needs special tools for handling them.... ( http://modules.sourceforge.net/ ) |
21:15:30 | FromDiscord | <enthus1ast> "how do i compile with THIS exact compiler, THAT linker, THIS exact lib, THAT exact aux stuff... |
21:15:31 | FromDiscord | <enthus1ast> " |
21:20:41 | FromDiscord | <System64 ~ Flandre Scarlet> FINALLY!!!!! https://media.discordapp.net/attachments/371759389889003532/949053723559223416/unknown.png |
21:22:24 | FromDiscord | <Phil> Got to say, gnome40 looks pretty dang nice if not tainted by ubuntu |
21:22:37 | FromDiscord | <Phil> Or maybe that's just the 8 years younger CPU |
21:33:23 | PMunch | @System64_~_Flandre_Scarlet, hooray! |
21:34:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, hooray!": But I have a problem |
21:35:05 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949057349115605002/unknown.png |
21:35:06 | PMunch | Haha, of course, what's the problem? |
21:35:15 | FromDiscord | <System64 ~ Flandre Scarlet> just posted the screen |
21:35:30 | PMunch | Ah, you're not supposed to call Øpir yourself |
21:35:33 | PMunch | Futhark does that for you |
21:35:53 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "Futhark does that for": it didn't generated a Futhark executablz |
21:35:54 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "executablz" => "executable" |
21:36:04 | PMunch | Nah Futhark is a macro |
21:36:16 | FromDiscord | <System64 ~ Flandre Scarlet> How does it work? |
21:36:47 | PMunch | `import futhark; importc: sysPath "/path/to/clang/includes"; "Tilengine.h"` |
21:36:50 | PMunch | Something like that |
21:37:21 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "`import futhark; importc: sysPath": ah alright↵But it uses a DLL, is it a problem? |
21:37:32 | PMunch | Nope |
21:37:41 | PMunch | Just link the DLL with passL like you normally would |
21:37:51 | FromDiscord | <System64 ~ Flandre Scarlet> okay so I'll try a simple thing to start |
21:38:01 | PMunch | Or dynlib, or whatever mechanism you used with your c2nim library |
21:38:37 | FromDiscord | <System64 ~ Flandre Scarlet> it's a dll so, a dynamic library |
21:42:15 | * | wyrd quit (Ping timeout: 240 seconds) |
21:42:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "`import futhark; importc: sysPath": Like that? https://media.discordapp.net/attachments/371759389889003532/949059326864146432/unknown.png |
21:44:16 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949059664090378300/unknown.png |
21:44:51 | * | jmdaemon quit (Ping timeout: 256 seconds) |
21:49:16 | * | wyrd joined #nim |
21:56:37 | FromDiscord | <System64 ~ Flandre Scarlet> I also had this error https://media.discordapp.net/attachments/371759389889003532/949062768676466718/unknown.png |
21:59:14 | PMunch | You're supposed to put them on multiple lines |
21:59:23 | PMunch | Like it's done in the Futhark readme |
21:59:31 | PMunch | But I've gotta go shovel snow now |
21:59:32 | * | PMunch quit (Quit: leaving) |
22:00:16 | * | ltriant joined #nim |
22:05:19 | FromDiscord | <pmunch> You might need a \`path "."\` or something as well to let clang know where to find Tilengine.h |
22:06:58 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "You might need a": https://media.discordapp.net/attachments/371759389889003532/949065373725114469/unknown.png |
22:07:59 | FromDiscord | <pmunch> You shouldn't need lines 7-12 |
22:08:15 | FromDiscord | <pmunch> Not quite sure about that error though |
22:08:38 | FromDiscord | <System64 ~ Flandre Scarlet> will try without |
22:10:28 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "You shouldn't need lines": Still errors https://media.discordapp.net/attachments/371759389889003532/949066253866250330/unknown.png |
22:16:38 | FromDiscord | <pmunch> Oh yeah that error didn't have anything to do with those lines |
22:17:34 | FromDiscord | <pmunch> Hmm, in your cache folder, what's the content of the opir\_\<somehash\>.json file? |
22:17:34 | FromDiscord | <System64 ~ Flandre Scarlet> did I do something wrong? |
22:18:17 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "Hmm, in your cache": where is this cache? |
22:19:00 | FromDiscord | <pmunch> The normal Nim cache |
22:21:18 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "The normal Nim cache": that? https://media.discordapp.net/attachments/371759389889003532/949068981900296242/opir.json |
22:23:18 | FromDiscord | <pmunch> Hmm, don't think so, but I can't open the file on my phone. |
22:24:19 | FromDiscord | <pmunch> There's supposed to be an opir\_\<bunch of letters and numbers\>.json file in your projects nimcache folder. Not the Futhark/Opir folder |
22:24:47 | FromDiscord | <System64 ~ Flandre Scarlet> here? https://media.discordapp.net/attachments/371759389889003532/949069857943601242/unknown.png |
22:25:06 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "here?": 😱 W11 😱 |
22:25:09 | FromDiscord | <System64 ~ Flandre Scarlet> yeah |
22:25:54 | FromDiscord | <Elegantbeef> No it's clearly linux "nouveau" is in the top left, showing the gpu drivers in the file browser, and not just being french for "new" |
22:26:15 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "No it's clearly linux": No it's W11 |
22:26:28 | FromDiscord | <Elegantbeef> it was a joke |
22:26:37 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "No it's clearly linux": i want you beeeeef |
22:26:50 | FromDiscord | <Evrensel Kişilik> cook yourself pls |
22:27:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "There's supposed to be": I don't have it I think |
22:28:19 | FromDiscord | <Evrensel Kişilik> @System64 ~ Flandre Scarlet what are you doing with Nim?? |
22:28:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "<@!380360389377916939> what are you": I try to make a game, but I want a specific library |
22:28:50 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "I try to make": oh damn |
22:29:07 | FromDiscord | <Evrensel Kişilik> what game? |
22:29:23 | FromDiscord | <System64 ~ Flandre Scarlet> platformer↵But I want Tilengine working first |
22:29:41 | FromDiscord | <Evrensel Kişilik> why don't use use Godot or Unity?? 😱 |
22:29:54 | FromDiscord | <Evrensel Kişilik> you could deploy your game to different platforms easily |
22:30:01 | FromDiscord | <Evrensel Kişilik> you can still use Nim with Godot |
22:30:15 | FromDiscord | <System64 ~ Flandre Scarlet> yeah true but I like the graphics capabilities of Tilengine |
22:40:06 | FromDiscord | <Evrensel Kişilik> what are advantages of that over Godot or Unity's tilemap systems? |
22:40:06 | FromDiscord | <pmunch> @System64 ~ Flandre Scarlet\: again, NOT the opir folder. The cache folder for your project |
22:40:06 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "<@380360389377916939>\: again, NOT the": I don't have this folder |
22:40:06 | FromDiscord | <pmunch> If the file you compile is mygame.nim it would be mygame\_d for development files or mygame\_r for release filen |
22:40:06 | FromDiscord | <pmunch> It looks like your file is main.nim, which means it's probably in that main\_d folder |
22:40:06 | FromDiscord | <System64 ~ Flandre Scarlet> I only have that https://media.discordapp.net/attachments/371759389889003532/949071982425673738/futhark-includes.h |
22:40:06 | * | greyrat_ quit (Ping timeout: 240 seconds) |
22:40:06 | FromDiscord | <pmunch> Ah, that means that Øpir failed to generate anything.. |
22:40:06 | * | greyrat joined #nim |
22:40:06 | FromDiscord | <pmunch> Strange |
22:40:06 | FromDiscord | <System64 ~ Flandre Scarlet> I don't understand why |
22:40:06 | FromDiscord | <pmunch> You should see the Øpir command in your compilation output, could you try to run that in a normal terminal? |
22:40:07 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949072833248632842/unknown.png |
22:40:07 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "": is the library built? |
22:40:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "is the library built?": yeah I have the DLL |
22:40:07 | FromDiscord | <Evrensel Kişilik> oh damn |
22:40:07 | * | jmdaemon joined #nim |
22:40:07 | FromDiscord | <Evrensel Kişilik> send the code that loads the DLL |
22:40:07 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "send the code that": the old binding was made with C2nim |
22:40:24 | FromDiscord | <Evrensel Kişilik> In reply to @System64 "the old binding was": soooooo |
22:40:37 | FromDiscord | <Evrensel Kişilik> can you send your code? |
22:40:49 | FromDiscord | <Evrensel Kişilik> testTileengine.nim |
22:40:52 | FromDiscord | <pmunch> Yeah you see that third hint? |
22:41:03 | FromDiscord | <pmunch> Try copying that command and run it in your terminal |
22:41:08 | FromDiscord | <System64 ~ Flandre Scarlet> alright |
22:41:15 | FromDiscord | <pmunch> Running\: \<Øpir command\> |
22:41:23 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RhS |
22:42:10 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "Running\: \<Øpir command\>": https://media.discordapp.net/attachments/371759389889003532/949074233273774130/unknown.png |
22:42:29 | FromDiscord | <Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3RhU |
22:44:01 | FromDiscord | <pmunch> Ah, it seems like Windows messes up on the path.. |
22:44:16 | FromDiscord | <Recruit_main707> classic |
22:44:20 | FromDiscord | <pmunch> As you can see it tries to split that Clang path at the . |
22:44:34 | FromDiscord | <Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3RhV |
22:44:40 | FromDiscord | <Evrensel Kişilik> (edit) "https://play.nim-lang.org/#ix=3RhV" => "https://play.nim-lang.org/#ix=3RhW" |
22:44:51 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "sooo where are you": The same folder as the nim code |
22:44:55 | FromDiscord | <pmunch> I really need someone who runs Windows to give Futhark a little brushup to make sure everything works.. |
22:45:47 | FromDiscord | <pmunch> @Evrensel Kişilik\: he's not loading the DLL in that code. You just tell Nim to link against the DLL when you compile your project |
22:46:19 | FromDiscord | <System64 ~ Flandre Scarlet> okay so I'll try something |
22:48:24 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "I really need someone": I did that and... https://media.discordapp.net/attachments/371759389889003532/949075796620873738/unknown.png |
22:49:00 | FromDiscord | <Evrensel Kişilik> https://futhark.readthedocs.io/en/latest/index.html |
22:49:23 | FromDiscord | <Evrensel Kişilik> this library |
22:50:06 | FromDiscord | <Evrensel Kişilik> do you need this library? |
22:50:19 | FromDiscord | <System64 ~ Flandre Scarlet> No I think no |
22:50:19 | FromDiscord | <Evrensel Kişilik> or it is required by tilengine library? |
22:50:33 | FromDiscord | <System64 ~ Flandre Scarlet> Tilengine requires SDL |
22:50:48 | FromDiscord | <Evrensel Kişilik> what is the requirement of this library coming from? 😱 |
22:51:46 | FromDiscord | <System64 ~ Flandre Scarlet> Tilengine only requires SDL2 |
22:53:49 | * | rockcavera quit (Remote host closed the connection) |
22:54:16 | * | rockcavera joined #nim |
22:54:16 | * | rockcavera quit (Changing host) |
22:54:16 | * | rockcavera joined #nim |
22:54:33 | FromDiscord | <Evrensel Kişilik> do you have source of tilengine? |
22:55:53 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/megamarc/Tilengine/ |
22:56:05 | FromDiscord | <System64 ~ Flandre Scarlet> (not my code) |
22:57:17 | FromDiscord | <Evrensel Kişilik> 😱 damn |
22:57:30 | FromDiscord | <Evrensel Kişilik> where is this futhark library's requirement coming from? |
22:57:32 | FromDiscord | <Evrensel Kişilik> interesting |
22:57:42 | FromDiscord | <Evrensel Kişilik> and what is opir command? |
22:58:22 | FromDiscord | <Elegantbeef> Futhark is a C binding generator |
23:00:51 | FromDiscord | <Evrensel Kişilik> In reply to @Elegantbeef "Futhark is a C": oh i thought that |
23:01:04 | FromDiscord | <Evrensel Kişilik> otherwise why would that be there 😱 |
23:07:19 | FromDiscord | <Evrensel Kişilik> isn't there an interface to call dynamic library functions in Nim? |
23:07:33 | FromDiscord | <Elegantbeef> There are |
23:07:37 | FromDiscord | <Evrensel Kişilik> 😱 |
23:07:45 | FromDiscord | <mratsim> dynamic function written in C or in Nim? |
23:07:48 | FromDiscord | <mratsim> there are for both |
23:07:54 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/dynlib.html an entire module for it |
23:07:59 | FromDiscord | <Evrensel Kişilik> @System64 ~ Flandre Scarlet |
23:08:06 | FromDiscord | <mratsim> or you can just use {.exportpy.} for example if you want t o use from Python 😉 |
23:08:12 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @Elegantbeef "https://nim-lang.org/docs/dynlib.html an entire mod": But I need the header too |
23:08:16 | FromDiscord | <Evrensel Kişilik> sooooooo why does he need a binding creator thingy?? 😱 |
23:08:36 | FromDiscord | <mratsim> less lines of code to type. |
23:08:48 | FromDiscord | <mratsim> and OS abstractions? |
23:08:54 | FromDiscord | <mratsim> who knows |
23:08:57 | FromDiscord | <Evrensel Kişilik> oh i never like writing less lines |
23:09:24 | FromDiscord | <mratsim> I assume the C of all C devs and their {{{{{}}}}} |
23:09:34 | FromDiscord | <mratsim> same |
23:10:53 | FromDiscord | <Elegantbeef> Less code is generally better since there is less to go wrong 😛 |
23:14:34 | * | rockcavera quit (Remote host closed the connection) |
23:14:59 | * | rockcavera joined #nim |
23:14:59 | * | rockcavera quit (Changing host) |
23:14:59 | * | rockcavera joined #nim |
23:15:27 | FromDiscord | <pmunch> @Evrensel Kişilik\: with dynamic libraries you still need to tell Nim what kind of stuff is in the DLL. Normally that means writing all the procedure signatures and type definitions yourself. With Futhark you just give it your header files and it creates all the Nim definitions for you automatically |
23:16:05 | FromDiscord | <Evrensel Kişilik> In reply to @pmunch "<@359071052397281280>\: with dynamic libraries": yess buuuut maybe an interface to interact |
23:16:13 | FromDiscord | <pmunch> @System64 ~ Flandre Scarlet\: that looks correct, now you should be able to compile your code and Futhark should be able to get the output of Øpir \:) |
23:16:47 | FromDiscord | <Evrensel Kişilik> you could interpret DLL things and interact them |
23:16:48 | FromDiscord | <pmunch> @Evrensel Kişilik\: what do you mean? |
23:17:26 | FromDiscord | <demotomohiro> If you want to use a few functions from a C library, manually write binding is fine. But If you want to use many functions in C library or you need to create a Nim binding for a C library that exports many functions, manually write binding is hard. |
23:17:36 | FromDiscord | <pmunch> Futhark translates the header files to Nim definitions. Then you link in your dynamic library and Nim is now able to call everything in the DLL as if it was written in Nim |
23:17:47 | FromDiscord | <Evrensel Kişilik> there is an interface for `dlopen()`/`LoadLibrary()` right? |
23:18:35 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "<@380360389377916939>\: that looks correct,": But why it doesn't work? |
23:18:51 | FromDiscord | <Evrensel Kişilik> @System64 ~ Flandre Scarlet oh you can already do `LoadLibrary()` in Nim on Windows 😱 |
23:18:58 | FromDiscord | <pmunch> @demotomohiro\: even with few definitions it's easy to get them slightly wrong and break something. Now that I'm used to using Futhark the overhead of using a C library is barely even there anymore. Just import and start coding |
23:19:14 | FromDiscord | <pmunch> I even get completions in my editor \:) |
23:19:35 | FromDiscord | <pmunch> @Evrensel Kişilik\: that's the easy part. Nim does that for you |
23:19:45 | * | vicecea quit (Ping timeout: 256 seconds) |
23:19:54 | FromDiscord | <pmunch> @System64 ~ Flandre Scarlet\: it still doesn't work after you fixed the path? |
23:20:16 | FromDiscord | <pmunch> Remember to update sysPath \:) |
23:20:43 | FromDiscord | <System64 ~ Flandre Scarlet> even, it doesn't work |
23:20:52 | * | vicecea joined #nim |
23:21:24 | FromDiscord | <System64 ~ Flandre Scarlet> ah wait |
23:21:34 | * | ssiyad quit (Read error: Connection reset by peer) |
23:21:42 | * | ssiyad joined #nim |
23:21:57 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Ri8 |
23:22:34 | FromDiscord | <Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3Ri9 |
23:22:46 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949084446991200306/unknown.png |
23:23:49 | * | rockcavera quit (Remote host closed the connection) |
23:24:10 | FromDiscord | <pmunch> Yes, that is the JSON output of Øpir. Futhark automatically calls Øpir, and dumps that output in a file (the file I asked you to find in the cache folder earlier). Then it reads that file in the Futhark macro and generates Nim code from it |
23:24:35 | FromDiscord | <System64 ~ Flandre Scarlet> and where is this Nim code? |
23:24:44 | * | rockcavera joined #nim |
23:24:45 | * | rockcavera quit (Changing host) |
23:24:45 | * | rockcavera joined #nim |
23:24:46 | FromDiscord | <demotomohiro> In reply to @Evrensel Kişilik "there is an interface": Here:↵https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import↵https://nim-lang.org/docs/dynlib.html |
23:25:38 | FromDiscord | <pmunch> It's in a futhark\_\<hash\>.nim file in your cache. But Futhark will automatically import it for you with that importc statement |
23:25:50 | FromDiscord | <pmunch> So if you manage to get Futhark to call Øpir with those arguments it should work \:) |
23:26:22 | FromDiscord | <System64 ~ Flandre Scarlet> I still only have that https://media.discordapp.net/attachments/371759389889003532/949085358409269279/unknown.png |
23:26:39 | FromDiscord | <pmunch> Yup |
23:26:52 | FromDiscord | <pmunch> That's all you should need |
23:27:04 | FromDiscord | <System64 ~ Flandre Scarlet> and I can interact with the Tilengine library now? |
23:27:11 | FromDiscord | <pmunch> Yup |
23:27:27 | FromDiscord | <System64 ~ Flandre Scarlet> How? |
23:27:40 | FromDiscord | <pmunch> Call a function? |
23:27:57 | FromDiscord | <pmunch> Idk, I don't know how Tilengine works |
23:28:26 | FromDiscord | <pmunch> But you should now be able to call procedures from Tilengine |
23:28:36 | FromDiscord | <System64 ~ Flandre Scarlet> Autocompletion doesn't work |
23:29:04 | FromDiscord | <pmunch> Not all editors are too happy with that macro |
23:29:19 | FromDiscord | <demotomohiro> In reply to @pmunch "<@288750616510201856>\: even with few": That is true. But if I write a Nim library that use C library with futhark, everyone using the library also need to install futhark and clang, isn't it? |
23:29:38 | FromDiscord | <pmunch> Not necessarily, you could ship the cached file |
23:31:06 | FromDiscord | <pmunch> I've seen someone do a \`when defined(useFuthark)\` switch to determine if they should use Futhark or just import the cached file that had been copied into the repo |
23:31:18 | FromDiscord | <demotomohiro> In reply to @pmunch "Not necessarily, you could": That nice! |
23:32:52 | FromDiscord | <System64 ~ Flandre Scarlet> Still doesn't work https://media.discordapp.net/attachments/371759389889003532/949086987497922570/unknown.png |
23:33:04 | FromDiscord | <System64 ~ Flandre Scarlet> I tried to look for the cached file, I don't find it |
23:33:45 | FromDiscord | <VVX7> oh wow futhark looks awesome |
23:34:05 | FromDiscord | <Evrensel Kişilik> In reply to @VVX7 "oh wow futhark looks": really? |
23:35:22 | NimEventer | New thread by Mardiyah: How to delete and reset runtime array ?, see https://forum.nim-lang.org/t/8973 |
23:35:41 | FromDiscord | <pmunch> @System64 ~ Flandre Scarlet\: and those Øpir commands work when you copy them into a terminal? |
23:36:16 | FromDiscord | <System64 ~ Flandre Scarlet> yeah, it doesn't display an error at least↵but not the nim compile |
23:41:50 | FromDiscord | <pmunch> So when you run that exact command you get a bunch of JSON? But when you compile that program it doesn't work and there is no opir file in your cache? |
23:42:55 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "So when you run": exact |
23:43:32 | FromDiscord | <pmunch> Hmm, that is very strange.. |
23:44:07 | FromDiscord | <pmunch> Unfortunately I can't really think of anything else. And I really need to get some sleep |
23:45:10 | FromDiscord | <System64 ~ Flandre Scarlet> I understand |
23:45:22 | FromDiscord | <System64 ~ Flandre Scarlet> I think I'll stick with the old Tilengine version for now |
23:45:50 | FromDiscord | <pmunch> Wait, what's the content of the futhark-includes.h file? |
23:45:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pmunch "Wait, what's the content": ah lemme see |
23:46:04 | FromDiscord | <System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949090311957798932/futhark-includes.h |
23:46:40 | FromDiscord | <pmunch> Hmm, yeah that's correct |
23:46:47 | FromDiscord | <System64 ~ Flandre Scarlet> that's good? |
23:46:58 | FromDiscord | <pmunch> And those exact Øpir commands really do spit out JSON now? |
23:47:06 | FromDiscord | <pmunch> Yeah that's fine |
23:47:17 | FromDiscord | <System64 ~ Flandre Scarlet> I don't have any json |
23:47:58 | FromDiscord | <pmunch> Huh? You told me the commands gave you JSON? |
23:48:46 | FromDiscord | <System64 ~ Flandre Scarlet> yeah but no file |
23:49:34 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Rid |
23:50:38 | FromDiscord | <pmunch> And that gave you JSON? But no opir file in C\:\\Users\\nicol\\nimcache\\testTilengine\_d\\ |
23:51:25 | FromDiscord | <System64 ~ Flandre Scarlet> That, but not any file https://media.discordapp.net/attachments/371759389889003532/949091657322745886/unknown.png |
23:54:00 | FromDiscord | <pmunch> Hmm, very strange |
23:54:36 | * | jmdaemon quit (Ping timeout: 240 seconds) |
23:55:01 | FromDiscord | <System64 ~ Flandre Scarlet> but I can print it to a JSON |
23:55:12 | FromDiscord | <System64 ~ Flandre Scarlet> with the ``>`` operator |
23:56:47 | FromDiscord | <pmunch> Yeah the problem is just figuring out what file to pipe it to.. |
23:57:04 | FromDiscord | <System64 ~ Flandre Scarlet> output.json? |
23:57:06 | FromDiscord | <pmunch> The it needs to be the correct hash for Futhark no pick it up |
23:57:22 | FromDiscord | <System64 ~ Flandre Scarlet> seems complex |
23:57:47 | FromDiscord | <pmunch> Yup |
23:58:13 | FromDiscord | <System64 ~ Flandre Scarlet> I feel like I'm stuck :/ |
23:59:02 | FromDiscord | <pmunch> I mean you could try to manually throw an \`echo opirCache\` in here\: https://github.com/PMunch/futhark/blob/master/src/futhark.nim#L484 |
23:59:21 | FromDiscord | <pmunch> That should tell you the file it would open |