<< 03-03-2022 >>

00:02:01girvoUnrelated, but my favourite thing in the world is UART suddenly no longer responding with anything I expect lol
00:03:06girvoHaha and _now_ it works. Oh joy
00:03:11girvoHardware is "fun"
00:07:31girvoAside 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:48FromDiscord<Elegantbeef> This did give me an excuse to play around with my toy typed macros module
00:29:19*krux02_ joined #nim
00:29:21FromDiscord<Elegantbeef> Surprisingly simple implementation https://play.nim-lang.org/#ix=3Rdj
00:29:53*krux02 quit (Ping timeout: 256 seconds)
00:31:49girvoOh nice!
00:31:57girvoDefinitely gonna borrow that if you don't mind ;)
00:32:09FromDiscord<Elegantbeef> Well it's not public yet so no you arent 😛
00:32:56girvobwahaha
00:33:19girvoOne day then :) your implementation is much more elegant than mine, though it is somewhat working
00:34:57girvoI distinctly remember using a library that enabled typed macros (different syntax mind you) way back whe
00:35:00girvowhen*
00:35:55girvoAlthough 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:23FromDiscord<Elegantbeef> There have been some implementations of macro utillities for a while, so dont doubt it
00:37:03girvoOne 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:01FromDiscord<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:05FromDiscord<Elegantbeef> I'd say not much has really changed
00:40:03girvoYeah macros are powerful but they were definitely a bit lacking in some ergonomics compared to other parts of the language
00:40:20girvoAnd 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:04FromDiscord<auxym> eli5 (or something)? What's a typed macro, vs the untyped macro that I'm somewhat used to?
00:46:21FromDiscord<Elegantbeef> Well that's not what we're talking about
00:46:28FromDiscord<Elegantbeef> Typed macros are semantically checked
00:46:44FromDiscord<Elegantbeef> A typed macro api is api that uses static typing with Nim nodes to make it more expressive and ergonomic
00:50:21FromDiscord<Elegantbeef> typed macros let you introspect types and do all the fancy jazz of macros on a typed nodes
00:56:23FromDiscord<auxym> ah, I sort of of get it, I think. So sort of one level higher than plain AST (aka untyped)?
01:00:24FromDiscord<Elegantbeef> Dont follow
01:01:06girvoMy destructor for Task now works correctly, now that I fixed my main loop :)
01:01:12FromDiscord<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:49FromDiscord<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:49NimEventerNew 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:50girvoThat'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:56FromDiscord<cvv.tracy> sent a code paste, see https://paste.rs/nTx
02:44:04FromDiscord<cvv.tracy> whats going wrong?
02:44:06FromDiscord<cvv.tracy> sent a code paste, see https://play.nim-lang.org/#ix=3RdC
02:44:45FromDiscord<cvv.tracy> nvm i used the wrong cpu
02:46:49*Gustavo6046_ quit (Quit: Leaving)
02:47:10*Gustavo6046 joined #nim
02:48:48FromDiscord<Elegantbeef> `echo cast[int](s.addr).toHex` is the way to do it imo
02:51:05girvoOh that's way nicer
02:51:21girvoIs 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:29FromDiscord<Elegantbeef> no repr is generally more explanitive
02:55:05FromDiscord<Girvo> Yeah makes sense
03:42:06*khole joined #nim
03:45:01FromDiscord<MaskDuck> what is the different between `let` and `const`?
03:45:11FromDiscord<Elegantbeef> let is runtime, const is compile time
03:46:03FromDiscord<congusbongus> const is more like constexpr in C++↵and not at all like javascript's let and const, despite the same names
03:51:41FromDiscord<MaskDuck> In reply to @congusbongus "const is more like": well
03:51:47FromDiscord<MaskDuck> what is similar with it in python
03:52:35FromDiscord<Elegantbeef> python doesnt even have immutable variables afaik
03:52:38FromDiscord<huantian> python variables are all var
03:53:51FromDiscord<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:39FromDiscord<MaskDuck> ah ok thanks
03:56:48nrds<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:53FromDiscord<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:51FromDiscord<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:39NimEventerNew thread by Prestige: Can there be an else clause on a template (or macro)?, see https://forum.nim-lang.org/t/8970
04:53:08FromDiscord<Elegantbeef> Prestige use `do`
04:53:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3RdU
04:55:05nrds<Prestige99> Ah, so that's what I'd seen before
04:55:20nrds<Prestige99> the `do` keyword is a bit weird here eh
04:56:08FromDiscord<Rika> not really, why?
04:56:17*Gustavo6046 quit (Ping timeout: 240 seconds)
04:56:20FromDiscord<Elegantbeef> named do blocks do have a RFC iirc
04:56:25nrds<Prestige99> From a reading perspective
04:56:32FromDiscord<Rika> i guess so
04:56:32nrds<Prestige99> Neat, that will be nice
04:56:42FromDiscord<Rika> beef can you link the rfc xd
04:58:38FromDiscord<Elegantbeef> Cant find it, might be a fever dream
04:59:36FromDiscord<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:13FromDiscord<Elegantbeef> Ah was a forum post https://forum.nim-lang.org/t/8259#53171
05:36:45nrds<Prestige99> ah, the same use case https://forum.nim-lang.org/t/8259#53165
05:51:56FromDiscord<Rika> Else is not a good alternative
05:52:02FromDiscord<Rika> It’s less general than do
05:57:53*jkl quit (Quit: Gone.)
05:58:18*jkl joined #nim
06:12:30nrds<Prestige99> Yeah, I think I don't completely understand templates
06:12:53nrds<Prestige99> I was expecting the code to be inlined so I could just naturally use `else`
06:13:26FromDiscord<Elegantbeef> The AST still needs to be valid
06:14:00FromDiscord<Elegantbeef> It's more about the AST than templates, the template emits a `ifStmt(elifBranch)`
06:14:08nrds<Prestige99> the else in my example seems to be included in the `body` right?
06:14:12FromDiscord<Elegantbeef> there is no way for code after that `ifStmt` to add `else` to that AST
06:14:17nrds<Prestige99> ah, I see
06:14:22FromDiscord<Elegantbeef> No in your example else is another stmt
06:14:43FromDiscord<Elegantbeef> So you just have an else statement in top level
06:15:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rec
06:15:01nrds<Prestige99> Well damn
06:18:08FromDiscord<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:39PMunchIt's quite annoying that you can't name your secondary blocks
08:37:53PMunchIt's one of the few things you can't do in Nim, that and create other proc types..
08:38:22PMunchBut no-one liked my arbitrary proc-type RFC..
08:39:07FromDiscord<Elegantbeef> I do like it, but quickly becomes very messy
08:39:33PMunchHow so?
08:42:48FromDiscord<Elegantbeef> Well it gets harder to distinguish a proc def from a general call i think
08:43:10PMunchA general call?
08:43:17FromDiscord<Elegantbeef> `myProctype someThing(a, b)` for instance
08:43:27FromDiscord<Elegantbeef> I'm probably wrong
08:43:43FromDiscord<Elegantbeef> But i do very much like it, and personally thing it's better than pragmas
08:44:03FromDiscord<Elegantbeef> think\
08:44:16FromDiscord<Rika> I don’t like it for as long as the keyword proc is omitted…
08:44:18PMunchIt just feels a bit artificial that this thing is one of the few parts of the syntax we can't change
08:44:23FromDiscord<Rika> And even if not I’m still on the fence
08:44:34PMunchLike anything signature-like is off-limits
08:44:34FromDiscord<Rika> I do agree though I’m not really a fan of the pragma syntax either
08:44:52FromDiscord<Elegantbeef> I find pragmas very ill-eloquent but there isnt a good solution that i can see
08:45:00FromDiscord<Rika> Pretty much
08:45:04FromDiscord<Elegantbeef> I dont like C#/Rusts' preannotations either
08:45:21PMunchI'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:26FromDiscord<Rika> By extension, Python decorators too?
08:45:36FromDiscord<Elegantbeef> yea
08:45:47FromDiscord<Elegantbeef> It's the same thing with `let`
08:46:43FromDiscord<Rika> I’m not sure, I think I would prefer decorators for less than 4 or so pragma combinations
08:47:07FromDiscord<Rika> Again though it’s hard to bolt that on to the syntax
08:47:33PMunchPersonally 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:33FromDiscord<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:18PMunchThis would have the weird side-effect that `proc` could also be used on a block of things though..
08:48:38FromDiscord<Elegantbeef> I dont think it's that weird
08:50:54*gsalazar joined #nim
08:52:02PMunchWell maybe not weird, but certainly a bit foreign
08:55:07FromDiscord<Rika> Not very weird I’d say
08:55:31PMunchWell maybe not with a proc or two
08:55:59PMunchBut 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:32FromDiscord<Elegantbeef> Imagine one type def in just a single block 😛
08:57:13PMunchHaha, fair enough
08:58:17*ltriant joined #nim
08:58:24FromDiscord<Rika> Type blocks are already weird outside of Nim though no?
08:58:43FromDiscord<Elegantbeef> You mean in that they dont exist?
09:06:16*ltriant quit (Ping timeout: 250 seconds)
09:21:08PMunchThe 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:20PMunchBut all that could be solved by better macro tools
09:21:35PMunchIt would break every single existing macro though
09:21:47PMunchWell, 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:31PMunchHmm, is there a way to write to terminal without a newline in a macro?
09:59:44PMunchstdout.write complains that it can't importc stdout on compile-time..
10:01:48FromDiscord<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:09PMunchUhm, can't we print uints any longer? http://ix.io/3ReD
10:54:00*gsalazar joined #nim
10:55:39PMunchTried to throw a dollar in there: http://ix.io/3ReE
10:57:15FromDiscord<planetis> weird
10:58:25FromDiscord<planetis> works for me for both uint and uint64
11:00:08*gsalazar quit (Ping timeout: 272 seconds)
11:03:46FromDiscord<Rika> theres prolly a converter in macros that does uint->nimnode for some reason
11:04:25NimEventerNew question by itil memek cantik: To reset Nim runtime array, see https://stackoverflow.com/questions/71336036/to-reset-nim-runtime-array
11:05:19FromDiscord<Rika> we already answered this...
11:11:05FromDiscord<demotomohiro> He/She think he get better answer on stackover flow rather than Nim discord or Nim forum?
11:13:37FromDiscord<Rika> idk
11:59:45PMunchI think my system is a bit broken: http://ix.io/3ReQ
12:00:55FromDiscord<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:45FromDiscord<ynfle> Is there a way to attach a macro as a pragma to a lambda?
12:16:33PMunchDoesn't the normal {..} syntax work?
12:17:38PMunchHmm, so I'm trying to fix this: https://github.com/PMunch/futhark/issues/9
12:17:55PMunchThe problem is that negative number can't be converted to unsigned numbers in Nim
12:18:00FromDiscord<ynfle> In reply to @PMunch "Doesn't the normal {..}": Ya, I meant the sugar `=>` lambdas
12:18:21PMunch@ynfle, oh I believe they don't have any syntax for attaching pragmas
12:18:39FromDiscord<ynfle> In reply to @PMunch "The problem is that": You can cast
12:18:51PMunchExactly, in that situation you can cast
12:19:04PMunchBut let's say I have a cuchar
12:19:16PMunchThat's a uint8 basically
12:19:31PMunchSo casting 10'i64 to that won't work will it?
12:20:24PMunchHuh, tried it on the playground and apparently it does..
12:47:09FromDiscord<Waldecir Santos> How can I declare a "nullable" sequence?
12:47:56FromDiscord<Rika> make it a pointer or a reference? or use options, its safer
12:51:29FromDiscord<Waldecir Santos> Perfect let me try it
12:56:40FromDiscord<Waldecir Santos> It worked, Option and checking with IsNone, ty @Rika
12:56:51FromDiscord<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:24FromDiscord<Tanguy> Is there a oneliner to know the number of fields in an object at CT?↵eg: static echo fields(theType).len
13:52:37FromDiscord<Lüke> What's the best way to learn it
13:54:18FromDiscord<enthus1ast> Learn what\_
13:54:19FromDiscord<enthus1ast> ?
13:54:24FromDiscord<Lüke> Nim
13:54:42FromDiscord<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:44FromDiscord<enthus1ast> i think this depends on you, how you normally learn new stuff? \:)
13:55:00FromDiscord<Lüke> In reply to @enthus1ast "i think this depends": YouTube
13:55:18FromDiscord<enthus1ast> mh yeah i think we have some yt vids
13:55:23FromDiscord<Lüke> Ok
13:55:39FromDiscord<enthus1ast> i can recommend to choose a small issue you have, and fix it with nim
13:55:40FromDiscord<Lüke> Thx
13:55:48FromDiscord<Lüke> In reply to @enthus1ast "i can recommend to": Ok
13:55:52FromDiscord<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:51PMunchOh goodness gracious. I'm looking at the pakku package manager and this code is so hard to read..
14:15:18FromDiscord<Rika> i thought so too lmao
14:15:46PMunch@Tanguy, not that I know of, no
14:16:17PMunch@Rika, it's just full of building structures and passing them around filtering stuff in and out
14:16:42PMunchLike every procedure takes 8 different arguments and spits out a tuple of a bunch of sequences and tables
14:16:47PMunchIt's crazy town
14:20:58FromDiscord<Rika> mm love it when procs have more than 6 or so params
14:24:35PMunch@Michal_Maršálek, it's syntactically pretty similar, but they're quite different under the hood
14:24:49PMunchNim compiles to C and JavaScript, Swift only native compiles I believe
14:25:01PMunchAnd it doesn't have meta-programming
14:25:13PMunchAs far as I can tell
14:37:03FromDiscord<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:35PMunch@lpha3ch0, yeah the fingerprinting for AV is completely broken for Nim..
14:48:02PMunchKeep submitting those false-positives though, that's the only way this might someday get fixed
14:51:28*gsalazar joined #nim
14:57:16FromDiscord<fbpyr> on our side only nim-grab.exe gets flagged as 'trojan'.. 🙄
15:02:18*arkurious joined #nim
15:06:57FromDiscord<Evrensel Kişilik> hewwwooooo
15:07:09FromDiscord<Evrensel Kişilik> Nim types are circular
15:07:10FromDiscord<Evrensel Kişilik> 😱
15:08:43FromDiscord<huantian> Well they can be at least
15:16:46FromDiscord<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:44FromDiscord<Rika> I think it is type erased at that point, perhaps?
15:24:48FromDiscord<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:01FromDiscord<Evrensel Kişilik> In reply to @Rika "I think it is": whaaaaaaaat
15:25:08*slowButPresent joined #nim
15:25:17FromDiscord<Rika> Maybe check what a Nim array compiles into in C
15:25:27FromDiscord<Rika> I can’t, I’m about to sleep lol
15:26:05FromDiscord<Evrensel Kişilik> In reply to @Rika "Maybe check what a": https://media.discordapp.net/attachments/371759389889003532/948964486147084308/unknown.png
15:26:06FromDiscord<Evrensel Kişilik> thissss
15:26:17FromDiscord<Evrensel Kişilik> im doing Nim things
15:28:00PMunch@System64_~_Flandre_Scarlet, might I interest you in Futhark?
15:28:01FromDiscord<Evrensel Kişilik> i can get `gdb.Value`
15:28:06FromDiscord<Evrensel Kişilik> (edit) "i can get `gdb.Value` ... " added "indexes"
15:28:11FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, might I interest": What's that?
15:28:27FromDiscord<Evrensel Kişilik> (edit) "i can" => "im able to"
15:28:30PMunch@System64_~_Flandre_Scarlet, https://github.com/PMunch/futhark
15:28:39FromDiscord<Evrensel Kişilik> buuuuut itereation is infinite
15:28:40FromDiscord<Evrensel Kişilik> 😭
15:28:56FromDiscord<Rika> Sorry I don’t know how to help here
15:29:05FromDiscord<Evrensel Kişilik> WHERE ARE NIM DEEEEEEEVSSS
15:29:42PMunch@Evrensel_Kişilik, take it easy
15:29:52PMunchSpamming this channel won't get you anywhere
15:30:10FromDiscord<Evrensel Kişilik> In reply to @PMunch "Spamming this channel won't": YOU BOT
15:30:14FromDiscord<Evrensel Kişilik> you are an AI
15:30:21PMunchNot this again..
15:30:29PMunchI'm not a bot, I'm using IRC
15:30:33FromDiscord<Evrensel Kişilik> i don't talk to bots
15:30:46PMunchWe're bridged into Discord through a bot
15:31:40FromDiscord<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:32FromDiscord<Evrensel Kişilik> oh
15:32:40FromDiscord<Evrensel Kişilik> i was doing a typo lol
15:33:07PMunch@System64_~_Flandre_Scarlet, hmm might be. Futhark only needs to be able to parse your files with clang though
15:33:23PMunchI've used futhark and compiled my Nim code with GCC just fine
15:33:30PMunchIn fact that's what I normally do
15:34:21FromDiscord<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:03PMunchThat should be fine then
15:36:54FromDiscord<System64 ~ Flandre Scarlet> ah alright
15:38:26FromDiscord<Evrensel Kişilik> yayyy
15:38:27FromDiscord<Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948967601437048902/unknown.png
15:38:28FromDiscord<Evrensel Kişilik> got it
15:38:45FromDiscord<Evrensel Kişilik> soooooooo auto array support is incoming
15:39:43FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RfN
15:39:43FromDiscord<System64 ~ Flandre Scarlet> during installation
15:41:42FromDiscord<Evrensel Kişilik> yayyyyyyy
15:41:42FromDiscord<Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948968418541969428/unknown.png
15:42:57PMunch@System64_~_Flandre_Scarlet, did you install libclang first?
15:43:52FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, did you install": through nimble?
15:44:09PMunchAh wait, you're on Windows..
15:44:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Ah wait, you're on": yes I'm
15:44:50PMunch@System64_~_Flandre_Scarlet, in that case see this: https://github.com/PMunch/futhark/issues/1
15:45:45PMunchOr just the installation section of the README I guess: https://github.com/PMunch/futhark#installation
15:46:07FromDiscord<System64 ~ Flandre Scarlet> ah alright, thanks
15:53:31FromDiscord<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:19FromDiscord<Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948974612929191957/unknown.png
16:06:27FromDiscord<Evrensel Kişilik> this says optimized out
16:06:41FromDiscord<Evrensel Kişilik> soooooooooo how could i get size of ptr array?
16:06:52FromDiscord<Evrensel Kişilik> i added auto array support
16:07:24FromDiscord<Evrensel Kişilik> nooow im working on ptr array support
16:07:38FromDiscord<Evrensel Kişilik> oh
16:07:43FromDiscord<Evrensel Kişilik> damn it is garbage collected
16:07:44FromDiscord<Evrensel Kişilik> lol
16:09:00*gsalazar quit (Ping timeout: 240 seconds)
16:10:28*ltriant joined #nim
16:11:54FromDiscord<Evrensel Kişilik> i forgot build command
16:12:06FromDiscord<Evrensel Kişilik> how can i build with debug symbols?
16:14:06PMunch@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:32PMunchThat -L should probably be within the quotes
16:14:46PMunchAnd you might need to escape the space in that path, not entirely sure
16:15:21PMunch@Evrensel_Kişilik, --debugger:native?
16:16:05*al1ranger quit (Quit: Leaving)
16:16:08PMunchAnd 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:38FromDiscord<Evrensel Kişilik> In reply to @PMunch "@Evrensel_Kişilik, --debugger:native?": found
16:18:12FromDiscord<Phil> TFW you wanna download an arch iso but it only shows you a torrent
16:18:34FromDiscord<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:57FromDiscord<Phil> .... a second after I wrote this it finally found some peers to download from
16:19:05FromDiscord<Phil> (edit) "from" => "from, after waiting for 2 minutes already"
16:19:16nrds<Prestige99> There are direct downloads further down the page if you want to try those
16:20:42FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://paste.rs/EZ2
16:38:54NimEventerNew 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:48PMunch@System64_~_Flandre_Scarlet, try `nimble install futhark --passL:"-LC:/Program\ Files/LLVM/lib/libclang.lib"`
16:45:10PMunchOh sorry, `nimble install futhark --passL:"-LC:/Program\ Files/LLVM/lib"`
16:45:43FromDiscord<Evrensel Kişilik> yayyy
16:45:48FromDiscord<Evrensel Kişilik> i made ptr arrays tooo
16:45:49FromDiscord<Evrensel Kişilik> https://media.discordapp.net/attachments/371759389889003532/948984553173844028/unknown.png
16:47:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Rg5
16:50:22PMunchWhy is it looking in C:\Users\user\Documents\programmation\Tilengine\include\Files\LLVM?
16:51:50FromDiscord<Ayy Lmao> Is there a way to make a copy of a ref without constructing a new one from scratch?
16:52:15PMunchWait, 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:22FromDiscord<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:36PMunch@Ayy_Lmao, define copy of a ref
16:52:46PMunch`var x = y` creates a copy of the reference
16:53:11PMunch`var x = y.copy` or `var x = y.deepCopy` creates a copy of the underlying object
16:53:32PMunch@System64_~_Flandre_Scarlet, yeah it looks like it is messing up on that space
16:53:53PMunchMaybe `nimble install futhark --passL:"-L'C:/Program\ Files/LLVM/lib'"`?
16:54:00PMunchI'm not too familiar with path handling on Windows
16:54:34FromDiscord<System64 ~ Flandre Scarlet> still not
16:55:39FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3Rge
16:56:00FromDiscord<Ayy Lmao> (edit) "https://play.nim-lang.org/#ix=3Rge" => "https://play.nim-lang.org/#ix=3Rgf"
16:56:44FromDiscord<Waldecir Santos> How should implement `$` to make an object "echoable" ? I've implemented $ but I'm getting this error
16:56:52FromDiscord<Waldecir Santos> sent a code paste, see https://play.nim-lang.org/#ix=3Rgg
16:56:55FromDiscord<Waldecir Santos> it works if I do `echo $obj`
16:57:53PMunch@Ayy_Lmao, try deepCopy then
16:58:26PMunch@Waldecir_Santos, that sounds odd. it should be applied automatically in that situation
16:58:41PMunchBut you might need to export it if you want to echo it from a different module
16:58:52FromDiscord<Waldecir Santos> this is the declaration `proc `$`[T: Model](model: T): string =`
16:59:09PMunchAh, it might not match a generic like that
17:00:03FromDiscord<Ayy Lmao> In reply to @PMunch "@Ayy_Lmao, try deepCopy then": Yeah deepCopy works, thanks!
17:00:04*ltriant joined #nim
17:05:25FromDiscord<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:28PMunch@Waldecir_Santos, common mistake, didn't you see my first suggestion? :)
17:06:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Maybe `nimble install futhark": It still doesn't work
17:06:58FromDiscord<Waldecir Santos> In reply to @PMunch "@Waldecir_Santos, common mistake, didn't": I see it now, sorry and Thank you !
17:07:36PMunch@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:48PMunch@Waldecir_Santos, no problem :)
17:34:33*gsalazar joined #nim
17:34:34FromDiscord<System64 ~ Flandre Scarlet> well I have a problem : seems the header changed
17:34:45PMunchWhich header?
17:34:49FromDiscord<System64 ~ Flandre Scarlet> That https://media.discordapp.net/attachments/371759389889003532/948996885878800444/Tilengine.h
17:35:39PMunchJust a sec, need to reboot
17:35:40*PMunch quit (Quit: leaving)
17:36:01FromDiscord<System64 ~ Flandre Scarlet> This is the old header https://media.discordapp.net/attachments/371759389889003532/948997185293410314/Tilengine.h
17:36:42FromDiscord<System64 ~ Flandre Scarlet> wait wtf↵I forgot how I c2nim'ed this
17:37:17*PMunch joined #nim
17:37:24FromDiscord<System64 ~ Flandre Scarlet> But this is the old binding https://media.discordapp.net/attachments/371759389889003532/948997532237840395/Tilengine.nim
17:38:09FromDiscord<System64 ~ Flandre Scarlet> and here the new one https://media.discordapp.net/attachments/371759389889003532/948997722004930620/Tilengine.nim
17:40:50PMunchWait, why are you asking me about c2nim stuff?
17:40:58PMunchJust use Futhark :(
17:41:01PMunch:)*
17:41:34FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Just use Futhark :(": I want to use it, but I struggle with this error :/
17:48:26FromDiscord<Evrensel Kişilik> https://github.com/rohanrhu/gdb-frontend/commit/5f3f1b352d68caec78bc8085a4257ffc74d6a4ce
17:48:38FromDiscord<Evrensel Kişilik> you can try this revision
17:48:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "you can try this": me?
17:49:14FromDiscord<Evrensel Kişilik> In reply to @System64 "me?": oh no i mean all Nim people 😱
17:49:20FromDiscord<System64 ~ Flandre Scarlet> Ah alright, sorry
17:49:29FromDiscord<System64 ~ Flandre Scarlet> I thought it was about my problem
17:49:40FromDiscord<Evrensel Kişilik> In reply to @System64 "I thought it was": what is your problem?
17:50:26FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "what is your problem?": Cannot install Futhark
17:50:33FromDiscord<Evrensel Kişilik> In reply to @System64 "Cannot install Futhark": what is it??
17:50:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "what is it??": Converting a C header into nim
17:58:46PMunch@System64_~_Flandre_Scarlet, if you get it working you won't have to worry about headers changing
18:03:46FromDiscord<rlipsc> sent a long message, see http://ix.io/3RgC
18:04:05FromDiscord<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:37FromDiscord<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:15FromDiscord<rlipsc> To summarise: what's the best way within a macro to tell if a `NimNode` returns a value.
18:10:56FromDiscord<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:29FromDiscord<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:07FromDiscord<Waldecir Santos> It's seems like a python class/def for me
18:14:25FromDiscord<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:06FromDiscord<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:26FromDiscord<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:52PMunch@System64_~_Flandre_Scarlet, you would have to clone the Futhark repo to have them locally
18:20:09PMunchThen move your files into there, and then nimble install while standing in that folder
18:20:25FromDiscord<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:32FromDiscord<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:51FromDiscord<System64 ~ Flandre Scarlet> and where should I put the lib and dll?
18:27:03FromDiscord<System64 ~ Flandre Scarlet> okay seems it still doesn't find clang
18:27:37*Gustavo6046 joined #nim
18:28:59FromDiscord<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:30FromDiscord<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:39FromDiscord<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:14FromDiscord<pmunch> The API is used for a couple things, so it would really be best if it didn't break
18:48:43FromDiscord<System64 ~ Flandre Scarlet> PMunch, even if I put the libs into the folder, it still doesn't work
18:49:08FromDiscord<pmunch> Same error?
18:49:42FromDiscord<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:27FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RgO
18:52:21FromDiscord<rlipsc> sent a code paste, see https://paste.rs/wb2
18:52:44FromDiscord<System64 ~ Flandre Scarlet> In reply to @rlipsc "`ld.exe: cannot find -lclang`": I don't know how to solve it
18:55:35FromDiscord<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:16PMunch@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:31PMunchAnd what command was that?
19:01:45PMunch@System64_~_Flandre_Scarlet, and what command was that?
19:01:52FromDiscord<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:02FromDiscord<rlipsc> sent a code paste, see https://play.nim-lang.org/#ix=3RgW
19:02:22PMunch@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:41FromDiscord<System64 ~ Flandre Scarlet> on Windows it's a DLL
19:03:09PMunch@ajusa, I still like the idea of using the Accept header, that way it's not really HTMX specific
19:03:12FromDiscord<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:40PMunchYeah that's what I'm trying to figure out
19:03:46PMunchWhy it isn't finding it
19:03:50PMunchStupid Windows..
19:04:19FromDiscord<rlipsc> yeah the path stuff in windows seems like an ancient clingon in 2022
19:04:29FromDiscord<System64 ~ Flandre Scarlet> I hate Windows lol
19:05:16FromDiscord<ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3RgX
19:05:49FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3RgY
19:06:54*jjido joined #nim
19:07:35FromDiscord<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:04PMunch@b4mbus, async != threads
19:09:48FromDiscord<b4mbus> In reply to @PMunch "<@644284217525665793>, async != threads": What are you reffering to?
19:10:17PMunch"Ive actually never done anything involving
19:10:17PMunch# threads except some simple programs or maybe calling async functions.!
19:10:25PMunchOops, silly copy-paste..
19:10:46FromDiscord<b4mbus> well yeah, I should have probably say `parallelism/concurrency`
19:10:53FromDiscord<b4mbus> (edit) "say `parallelism/concurrency`" => "said`parallelism/concurrency`"
19:11:07FromDiscord<System64 ~ Flandre Scarlet> Humm so what should I do?
19:18:17FromDiscord<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:42FromDiscord<auxym> In reply to @System64 "Humm so what should": do you have clang.dll somewhere gcc can find it?
19:20:04FromDiscord<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:09FromDiscord<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:13FromDiscord<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:47FromDiscord<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:24FromDiscord<b4mbus> In reply to @auxym "How does that work?": How does what work?
19:25:35FromDiscord<b4mbus> the error handler?
19:27:28FromDiscord<auxym> yes
19:33:20FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3Rh5
19:33:21FromDiscord<b4mbus> sent a code paste, see https://paste.rs/SE5
19:33:42FromDiscord<b4mbus> again: Im quite new to Nim and Ive never made anything big, never designed any software, neved dealt with concurrency/parallelism
19:35:47FromDiscord<planetis> any chance I could get smthing like that compiling https://play.nim-lang.org/#ix=3Rh6 ?
19:43:00FromDiscord<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:09FromDiscord<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:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rh8
19:47:38FromDiscord<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:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Rh9
19:50:01FromDiscord<planetis> wow
19:50:12FromDiscord<planetis> thanks elegant beef
19:51:09FromDiscord<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:55FromDiscord<Elegantbeef> Probably 325
19:52:11FromDiscord<Elegantbeef> That or 301
19:52:26FromDiscord<Elegantbeef> The issue is not array semming though
19:52:55FromDiscord<planetis> Bar[a] matches enum? wtf
19:52:55FromDiscord<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:03FromDiscord<Elegantbeef> `T: static enum` is a value
19:53:09FromDiscord<planetis> oh ok
19:53:11FromDiscord<Elegantbeef> `T: enum` is a type
19:53:52FromDiscord<b4mbus> In reply to @auxym "On the topic of": which one are you talking about?
19:56:07FromDiscord<auxym> https://fosdem.org/2022/schedule/event/nim_concurrency/
19:57:05FromDiscord<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:43FromDiscord<b4mbus> In reply to @auxym "I was suggesting *making*": Ill check that out, thanks
20:01:44FromDiscord<planetis> i got rid of generics, there are a pain in the rear
20:03:24FromDiscord<Elegantbeef> They really arent but ok 😛
20:03:27FromDiscord<planetis> I don't know how you do it, but they never work for me and i have no clue whats happening
20:03:57FromDiscord<planetis> well that's it when I am trying more complicated stuff
20:04:30FromDiscord<Elegantbeef> I normally try stuff if it doesnt work try to fix it, aside from the array isssue
20:04:42FromDiscord<Elegantbeef> That stuff is unfixable afaict 😛
20:05:28FromDiscord<planetis> if you are curious what it was https://play.nim-lang.org/#ix=3Rhe its just a bitset
20:06:06FromDiscord<Elegantbeef> Is nim's built in set not good enough?
20:06:34FromDiscord<planetis> well up to a point
20:07:14FromDiscord<planetis> i think after 64 values it becomes an array byte
20:07:31FromDiscord<planetis> so in theory array uint is faster
20:07:42FromDiscord<Elegantbeef> after 8 values\
20:07:54FromDiscord<planetis> need to check out if its vectorised
20:08:04FromDiscord<Elegantbeef> `set[0..15]` emits a `NI[2]` in C
20:17:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @auxym "do you have clang.dll": I installed Clang
20:17:29FromDiscord<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:36FromDiscord<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:31FromDiscord<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:27FromDiscord<Phil> Oh lord... what command can I use to update nim again? Seems the arch repos have it on 1.4.8
21:06:42FromDiscord<auxym> consider using https://github.com/dom96/choosenim
21:09:15FromDiscord<enthus1ast> choosenim
21:09:15FromDiscord<enthus1ast> (if it supports arch)
21:12:43FromDiscord<Phil> There we go, I was being an idiot and didn't have the right things set in the classpath
21:12:46FromDiscord<Phil> It does support arch
21:14:35FromDiscord<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:30FromDiscord<enthus1ast> "how do i compile with THIS exact compiler, THAT linker, THIS exact lib, THAT exact aux stuff...
21:15:31FromDiscord<enthus1ast> "
21:20:41FromDiscord<System64 ~ Flandre Scarlet> FINALLY!!!!! https://media.discordapp.net/attachments/371759389889003532/949053723559223416/unknown.png
21:22:24FromDiscord<Phil> Got to say, gnome40 looks pretty dang nice if not tainted by ubuntu
21:22:37FromDiscord<Phil> Or maybe that's just the 8 years younger CPU
21:33:23PMunch@System64_~_Flandre_Scarlet, hooray!
21:34:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, hooray!": But I have a problem
21:35:05FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949057349115605002/unknown.png
21:35:06PMunchHaha, of course, what's the problem?
21:35:15FromDiscord<System64 ~ Flandre Scarlet> just posted the screen
21:35:30PMunchAh, you're not supposed to call Øpir yourself
21:35:33PMunchFuthark does that for you
21:35:53FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "Futhark does that for": it didn't generated a Futhark executablz
21:35:54FromDiscord<System64 ~ Flandre Scarlet> (edit) "executablz" => "executable"
21:36:04PMunchNah Futhark is a macro
21:36:16FromDiscord<System64 ~ Flandre Scarlet> How does it work?
21:36:47PMunch`import futhark; importc: sysPath "/path/to/clang/includes"; "Tilengine.h"`
21:36:50PMunchSomething like that
21:37:21FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "`import futhark; importc: sysPath": ah alright↵But it uses a DLL, is it a problem?
21:37:32PMunchNope
21:37:41PMunchJust link the DLL with passL like you normally would
21:37:51FromDiscord<System64 ~ Flandre Scarlet> okay so I'll try a simple thing to start
21:38:01PMunchOr dynlib, or whatever mechanism you used with your c2nim library
21:38:37FromDiscord<System64 ~ Flandre Scarlet> it's a dll so, a dynamic library
21:42:15*wyrd quit (Ping timeout: 240 seconds)
21:42:56FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "`import futhark; importc: sysPath": Like that? https://media.discordapp.net/attachments/371759389889003532/949059326864146432/unknown.png
21:44:16FromDiscord<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:37FromDiscord<System64 ~ Flandre Scarlet> I also had this error https://media.discordapp.net/attachments/371759389889003532/949062768676466718/unknown.png
21:59:14PMunchYou're supposed to put them on multiple lines
21:59:23PMunchLike it's done in the Futhark readme
21:59:31PMunchBut I've gotta go shovel snow now
21:59:32*PMunch quit (Quit: leaving)
22:00:16*ltriant joined #nim
22:05:19FromDiscord<pmunch> You might need a \`path "."\` or something as well to let clang know where to find Tilengine.h
22:06:58FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "You might need a": https://media.discordapp.net/attachments/371759389889003532/949065373725114469/unknown.png
22:07:59FromDiscord<pmunch> You shouldn't need lines 7-12
22:08:15FromDiscord<pmunch> Not quite sure about that error though
22:08:38FromDiscord<System64 ~ Flandre Scarlet> will try without
22:10:28FromDiscord<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:38FromDiscord<pmunch> Oh yeah that error didn't have anything to do with those lines
22:17:34FromDiscord<pmunch> Hmm, in your cache folder, what's the content of the opir\_\<somehash\>.json file?
22:17:34FromDiscord<System64 ~ Flandre Scarlet> did I do something wrong?
22:18:17FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "Hmm, in your cache": where is this cache?
22:19:00FromDiscord<pmunch> The normal Nim cache
22:21:18FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "The normal Nim cache": that? https://media.discordapp.net/attachments/371759389889003532/949068981900296242/opir.json
22:23:18FromDiscord<pmunch> Hmm, don't think so, but I can't open the file on my phone.
22:24:19FromDiscord<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:47FromDiscord<System64 ~ Flandre Scarlet> here? https://media.discordapp.net/attachments/371759389889003532/949069857943601242/unknown.png
22:25:06FromDiscord<Evrensel Kişilik> In reply to @System64 "here?": 😱 W11 😱
22:25:09FromDiscord<System64 ~ Flandre Scarlet> yeah
22:25:54FromDiscord<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:15FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "No it's clearly linux": No it's W11
22:26:28FromDiscord<Elegantbeef> it was a joke
22:26:37FromDiscord<Evrensel Kişilik> In reply to @Elegantbeef "No it's clearly linux": i want you beeeeef
22:26:50FromDiscord<Evrensel Kişilik> cook yourself pls
22:27:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "There's supposed to be": I don't have it I think
22:28:19FromDiscord<Evrensel Kişilik> @System64 ~ Flandre Scarlet what are you doing with Nim??
22:28:34FromDiscord<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:50FromDiscord<Evrensel Kişilik> In reply to @System64 "I try to make": oh damn
22:29:07FromDiscord<Evrensel Kişilik> what game?
22:29:23FromDiscord<System64 ~ Flandre Scarlet> platformer↵But I want Tilengine working first
22:29:41FromDiscord<Evrensel Kişilik> why don't use use Godot or Unity?? 😱
22:29:54FromDiscord<Evrensel Kişilik> you could deploy your game to different platforms easily
22:30:01FromDiscord<Evrensel Kişilik> you can still use Nim with Godot
22:30:15FromDiscord<System64 ~ Flandre Scarlet> yeah true but I like the graphics capabilities of Tilengine
22:40:06FromDiscord<Evrensel Kişilik> what are advantages of that over Godot or Unity's tilemap systems?
22:40:06FromDiscord<pmunch> @System64 ~ Flandre Scarlet\: again, NOT the opir folder. The cache folder for your project
22:40:06FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "<@380360389377916939>\: again, NOT the": I don't have this folder
22:40:06FromDiscord<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:06FromDiscord<pmunch> It looks like your file is main.nim, which means it's probably in that main\_d folder
22:40:06FromDiscord<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:06FromDiscord<pmunch> Ah, that means that Øpir failed to generate anything..
22:40:06*greyrat joined #nim
22:40:06FromDiscord<pmunch> Strange
22:40:06FromDiscord<System64 ~ Flandre Scarlet> I don't understand why
22:40:06FromDiscord<pmunch> You should see the Øpir command in your compilation output, could you try to run that in a normal terminal?
22:40:07FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949072833248632842/unknown.png
22:40:07FromDiscord<Evrensel Kişilik> In reply to @System64 "": is the library built?
22:40:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "is the library built?": yeah I have the DLL
22:40:07FromDiscord<Evrensel Kişilik> oh damn
22:40:07*jmdaemon joined #nim
22:40:07FromDiscord<Evrensel Kişilik> send the code that loads the DLL
22:40:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "send the code that": the old binding was made with C2nim
22:40:24FromDiscord<Evrensel Kişilik> In reply to @System64 "the old binding was": soooooo
22:40:37FromDiscord<Evrensel Kişilik> can you send your code?
22:40:49FromDiscord<Evrensel Kişilik> testTileengine.nim
22:40:52FromDiscord<pmunch> Yeah you see that third hint?
22:41:03FromDiscord<pmunch> Try copying that command and run it in your terminal
22:41:08FromDiscord<System64 ~ Flandre Scarlet> alright
22:41:15FromDiscord<pmunch> Running\: \<Øpir command\>
22:41:23FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3RhS
22:42:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "Running\: \<Øpir command\>": https://media.discordapp.net/attachments/371759389889003532/949074233273774130/unknown.png
22:42:29FromDiscord<Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3RhU
22:44:01FromDiscord<pmunch> Ah, it seems like Windows messes up on the path..
22:44:16FromDiscord<Recruit_main707> classic
22:44:20FromDiscord<pmunch> As you can see it tries to split that Clang path at the .
22:44:34FromDiscord<Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3RhV
22:44:40FromDiscord<Evrensel Kişilik> (edit) "https://play.nim-lang.org/#ix=3RhV" => "https://play.nim-lang.org/#ix=3RhW"
22:44:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @Evrensel Kişilik "sooo where are you": The same folder as the nim code
22:44:55FromDiscord<pmunch> I really need someone who runs Windows to give Futhark a little brushup to make sure everything works..
22:45:47FromDiscord<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:19FromDiscord<System64 ~ Flandre Scarlet> okay so I'll try something
22:48:24FromDiscord<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:00FromDiscord<Evrensel Kişilik> https://futhark.readthedocs.io/en/latest/index.html
22:49:23FromDiscord<Evrensel Kişilik> this library
22:50:06FromDiscord<Evrensel Kişilik> do you need this library?
22:50:19FromDiscord<System64 ~ Flandre Scarlet> No I think no
22:50:19FromDiscord<Evrensel Kişilik> or it is required by tilengine library?
22:50:33FromDiscord<System64 ~ Flandre Scarlet> Tilengine requires SDL
22:50:48FromDiscord<Evrensel Kişilik> what is the requirement of this library coming from? 😱
22:51:46FromDiscord<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:33FromDiscord<Evrensel Kişilik> do you have source of tilengine?
22:55:53FromDiscord<System64 ~ Flandre Scarlet> https://github.com/megamarc/Tilengine/
22:56:05FromDiscord<System64 ~ Flandre Scarlet> (not my code)
22:57:17FromDiscord<Evrensel Kişilik> 😱 damn
22:57:30FromDiscord<Evrensel Kişilik> where is this futhark library's requirement coming from?
22:57:32FromDiscord<Evrensel Kişilik> interesting
22:57:42FromDiscord<Evrensel Kişilik> and what is opir command?
22:58:22FromDiscord<Elegantbeef> Futhark is a C binding generator
23:00:51FromDiscord<Evrensel Kişilik> In reply to @Elegantbeef "Futhark is a C": oh i thought that
23:01:04FromDiscord<Evrensel Kişilik> otherwise why would that be there 😱
23:07:19FromDiscord<Evrensel Kişilik> isn't there an interface to call dynamic library functions in Nim?
23:07:33FromDiscord<Elegantbeef> There are
23:07:37FromDiscord<Evrensel Kişilik> 😱
23:07:45FromDiscord<mratsim> dynamic function written in C or in Nim?
23:07:48FromDiscord<mratsim> there are for both
23:07:54FromDiscord<Elegantbeef> https://nim-lang.org/docs/dynlib.html an entire module for it
23:07:59FromDiscord<Evrensel Kişilik> @System64 ~ Flandre Scarlet
23:08:06FromDiscord<mratsim> or you can just use {.exportpy.} for example if you want t o use from Python 😉
23:08:12FromDiscord<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:16FromDiscord<Evrensel Kişilik> sooooooo why does he need a binding creator thingy?? 😱
23:08:36FromDiscord<mratsim> less lines of code to type.
23:08:48FromDiscord<mratsim> and OS abstractions?
23:08:54FromDiscord<mratsim> who knows
23:08:57FromDiscord<Evrensel Kişilik> oh i never like writing less lines
23:09:24FromDiscord<mratsim> I assume the C of all C devs and their {{{{{}}}}}
23:09:34FromDiscord<mratsim> same
23:10:53FromDiscord<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:27FromDiscord<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:05FromDiscord<Evrensel Kişilik> In reply to @pmunch "<@359071052397281280>\: with dynamic libraries": yess buuuut maybe an interface to interact
23:16:13FromDiscord<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:47FromDiscord<Evrensel Kişilik> you could interpret DLL things and interact them
23:16:48FromDiscord<pmunch> @Evrensel Kişilik\: what do you mean?
23:17:26FromDiscord<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:36FromDiscord<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:47FromDiscord<Evrensel Kişilik> there is an interface for `dlopen()`/`LoadLibrary()` right?
23:18:35FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "<@380360389377916939>\: that looks correct,": But why it doesn't work?
23:18:51FromDiscord<Evrensel Kişilik> @System64 ~ Flandre Scarlet oh you can already do `LoadLibrary()` in Nim on Windows 😱
23:18:58FromDiscord<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:14FromDiscord<pmunch> I even get completions in my editor \:)
23:19:35FromDiscord<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:54FromDiscord<pmunch> @System64 ~ Flandre Scarlet\: it still doesn't work after you fixed the path?
23:20:16FromDiscord<pmunch> Remember to update sysPath \:)
23:20:43FromDiscord<System64 ~ Flandre Scarlet> even, it doesn't work
23:20:52*vicecea joined #nim
23:21:24FromDiscord<System64 ~ Flandre Scarlet> ah wait
23:21:34*ssiyad quit (Read error: Connection reset by peer)
23:21:42*ssiyad joined #nim
23:21:57FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Ri8
23:22:34FromDiscord<Evrensel Kişilik> sent a code paste, see https://play.nim-lang.org/#ix=3Ri9
23:22:46FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949084446991200306/unknown.png
23:23:49*rockcavera quit (Remote host closed the connection)
23:24:10FromDiscord<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:35FromDiscord<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:46FromDiscord<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:38FromDiscord<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:50FromDiscord<pmunch> So if you manage to get Futhark to call Øpir with those arguments it should work \:)
23:26:22FromDiscord<System64 ~ Flandre Scarlet> I still only have that https://media.discordapp.net/attachments/371759389889003532/949085358409269279/unknown.png
23:26:39FromDiscord<pmunch> Yup
23:26:52FromDiscord<pmunch> That's all you should need
23:27:04FromDiscord<System64 ~ Flandre Scarlet> and I can interact with the Tilengine library now?
23:27:11FromDiscord<pmunch> Yup
23:27:27FromDiscord<System64 ~ Flandre Scarlet> How?
23:27:40FromDiscord<pmunch> Call a function?
23:27:57FromDiscord<pmunch> Idk, I don't know how Tilengine works
23:28:26FromDiscord<pmunch> But you should now be able to call procedures from Tilengine
23:28:36FromDiscord<System64 ~ Flandre Scarlet> Autocompletion doesn't work
23:29:04FromDiscord<pmunch> Not all editors are too happy with that macro
23:29:19FromDiscord<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:38FromDiscord<pmunch> Not necessarily, you could ship the cached file
23:31:06FromDiscord<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:18FromDiscord<demotomohiro> In reply to @pmunch "Not necessarily, you could": That nice!
23:32:52FromDiscord<System64 ~ Flandre Scarlet> Still doesn't work https://media.discordapp.net/attachments/371759389889003532/949086987497922570/unknown.png
23:33:04FromDiscord<System64 ~ Flandre Scarlet> I tried to look for the cached file, I don't find it
23:33:45FromDiscord<VVX7> oh wow futhark looks awesome
23:34:05FromDiscord<Evrensel Kişilik> In reply to @VVX7 "oh wow futhark looks": really?
23:35:22NimEventerNew thread by Mardiyah: How to delete and reset runtime array ?, see https://forum.nim-lang.org/t/8973
23:35:41FromDiscord<pmunch> @System64 ~ Flandre Scarlet\: and those Øpir commands work when you copy them into a terminal?
23:36:16FromDiscord<System64 ~ Flandre Scarlet> yeah, it doesn't display an error at least↵but not the nim compile
23:41:50FromDiscord<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:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "So when you run": exact
23:43:32FromDiscord<pmunch> Hmm, that is very strange..
23:44:07FromDiscord<pmunch> Unfortunately I can't really think of anything else. And I really need to get some sleep
23:45:10FromDiscord<System64 ~ Flandre Scarlet> I understand
23:45:22FromDiscord<System64 ~ Flandre Scarlet> I think I'll stick with the old Tilengine version for now
23:45:50FromDiscord<pmunch> Wait, what's the content of the futhark-includes.h file?
23:45:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @pmunch "Wait, what's the content": ah lemme see
23:46:04FromDiscord<System64 ~ Flandre Scarlet> https://media.discordapp.net/attachments/371759389889003532/949090311957798932/futhark-includes.h
23:46:40FromDiscord<pmunch> Hmm, yeah that's correct
23:46:47FromDiscord<System64 ~ Flandre Scarlet> that's good?
23:46:58FromDiscord<pmunch> And those exact Øpir commands really do spit out JSON now?
23:47:06FromDiscord<pmunch> Yeah that's fine
23:47:17FromDiscord<System64 ~ Flandre Scarlet> I don't have any json
23:47:58FromDiscord<pmunch> Huh? You told me the commands gave you JSON?
23:48:46FromDiscord<System64 ~ Flandre Scarlet> yeah but no file
23:49:34FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=3Rid
23:50:38FromDiscord<pmunch> And that gave you JSON? But no opir file in C\:\\Users\\nicol\\nimcache\\testTilengine\_d\\
23:51:25FromDiscord<System64 ~ Flandre Scarlet> That, but not any file https://media.discordapp.net/attachments/371759389889003532/949091657322745886/unknown.png
23:54:00FromDiscord<pmunch> Hmm, very strange
23:54:36*jmdaemon quit (Ping timeout: 240 seconds)
23:55:01FromDiscord<System64 ~ Flandre Scarlet> but I can print it to a JSON
23:55:12FromDiscord<System64 ~ Flandre Scarlet> with the ``>`` operator
23:56:47FromDiscord<pmunch> Yeah the problem is just figuring out what file to pipe it to..
23:57:04FromDiscord<System64 ~ Flandre Scarlet> output.json?
23:57:06FromDiscord<pmunch> The it needs to be the correct hash for Futhark no pick it up
23:57:22FromDiscord<System64 ~ Flandre Scarlet> seems complex
23:57:47FromDiscord<pmunch> Yup
23:58:13FromDiscord<System64 ~ Flandre Scarlet> I feel like I'm stuck :/
23:59:02FromDiscord<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:21FromDiscord<pmunch> That should tell you the file it would open