00:01:53 | * | vicfred quit (Quit: Leaving) |
00:05:09 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3Ul8 |
00:05:21 | FromDiscord | <Elegantbeef> Yea it's like only for calls duuuuude |
00:05:48 | FromDiscord | <Elegantbeef> Sorry couldnt help myself |
00:06:03 | FromDiscord | <creikey> In reply to @Elegantbeef "Creikey did you see": just the pings here I'll try to filter for your username |
00:06:34 | FromDiscord | <creikey> In reply to @Elegantbeef "Is it just the": some of the calls in a chunk of code, like it's doing some logic and draw calls |
00:06:55 | FromDiscord | <Elegantbeef> And what's wrong with `std/with` or the `with` on nimble? |
00:07:03 | FromDiscord | <creikey> I want the convenient feeling of a global drawing context but while passing the `d` drawing context parmeter around |
00:07:26 | FromDiscord | <creikey> In reply to @Elegantbeef "And what's wrong with": let me make the playground example |
00:07:35 | FromDiscord | <creikey> hold on I was supposed to join a class 7 minutes ago |
00:08:17 | * | meowray quit (Remote host closed the connection) |
00:08:27 | * | \u joined #nim |
00:08:50 | * | NimEventer quit (Read error: Connection reset by peer) |
00:09:14 | * | NimEventer joined #nim |
00:12:39 | * | mal`` quit (Ping timeout: 256 seconds) |
00:13:47 | * | Ekho quit (Ping timeout: 256 seconds) |
00:14:49 | * | mal`` joined #nim |
00:17:20 | NimEventer | New Nimble package! parsepage - Automatically extracts the data of sites, see https://gitlab.com/lurlo/parsepage |
00:20:06 | * | Ekho joined #nim |
00:40:10 | FromDiscord | <abdu> In reply to @Elegantbeef "Do they have sub": ok↵How to have `echo` not output nl (newline) so next echo is in par line |
00:40:32 | FromDiscord | <Elegantbeef> `stdout.write` |
00:41:02 | FromDiscord | <abdu> In reply to @Elegantbeef "`stdout.write`": how is its syntax? |
00:41:07 | * | kayabaNerve quit (Ping timeout: 260 seconds) |
00:41:49 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/io.html#write%2CFile%2Cstring |
01:04:31 | FromDiscord | <creikey> In reply to @Elegantbeef "And what's wrong with": https://play.nim-lang.org/#ix=3Uli |
01:04:33 | FromDiscord | <creikey> how do I make this work |
01:05:03 | FromDiscord | <Elegantbeef> Ah have you considered `byaddr`? |
01:05:08 | FromDiscord | <Elegantbeef> Ah nvm |
01:05:18 | FromDiscord | <Elegantbeef> You really cant handle this |
01:05:39 | FromDiscord | <Elegantbeef> Actually.... hmmm |
01:05:57 | FromDiscord | <Elegantbeef> We can actually do this give me a moment |
01:14:30 | FromDiscord | <Elegantbeef> @creikey\: here you go https://play.nim-lang.org/#ix=3Ull |
01:16:06 | FromDiscord | <creikey> In reply to @Elegantbeef "<@180866243819995136>\: here you go": interesting |
01:16:08 | FromDiscord | <creikey> thanks |
01:17:01 | * | neurocyte861449 joined #nim |
01:17:11 | FromDiscord | <Elegantbeef> ah it shouldnt be `proc` it should be typed like so https://play.nim-lang.org/#ix=3Ulm |
01:17:25 | FromDiscord | <Elegantbeef> This properly adds the parameter in the first position if there is an overload that takes it |
01:17:41 | FromDiscord | <Elegantbeef> You could make it more intelligent and look if any are missing and insert it there, but that's hell on earth to reason imo |
01:18:41 | FromDiscord | <creikey> In reply to @Elegantbeef "You could make it": yeah this is not really necessary either |
01:18:46 | FromDiscord | <creikey> this is really useful though |
01:19:06 | FromDiscord | <creikey> makes a lot of code nicer |
01:19:26 | FromDiscord | <creikey> In reply to @Elegantbeef "ah it shouldnt be": can I like paypal you $20 for this |
01:19:26 | * | neurocyte86144 quit (Ping timeout: 268 seconds) |
01:19:26 | * | neurocyte861449 is now known as neurocyte86144 |
01:19:50 | FromDiscord | <Elegantbeef> Lol |
01:21:16 | FromDiscord | <creikey> is there an easy way to make it so you can do like `with d, p:` and it checks for both on the first arg |
01:21:54 | FromDiscord | <creikey> it seems like it's just make arg a seq and add a for loop over it on line 36 |
01:21:57 | FromDiscord | <Elegantbeef> It's a bit harder due to the `applyIfNeeds` logic |
01:23:21 | FromDiscord | <creikey> In reply to @Elegantbeef "It's a bit harder": you can call applyIfNeeds on each object passed to with though right |
01:23:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/UL6 |
01:23:52 | FromDiscord | <Elegantbeef> needscall would be the `applyIfNeeds` `let need =` logic inside a macro |
01:24:22 | FromDiscord | <Elegantbeef> Generating the above i think would be the easiest |
01:24:40 | FromDiscord | <Elegantbeef> This reminds me that I need to support when inside micros |
01:26:15 | * | xet7 joined #nim |
01:34:49 | * | yoyojambo joined #nim |
01:39:08 | * | SamuelMarks joined #nim |
01:39:10 | SamuelMarks | hi |
01:39:19 | FromDiscord | <Elegantbeef> Hello |
01:59:48 | FromDiscord | <Elegantbeef> @creikey\: this uses my abstractions but this is how you'd probably want to do it https://github.com/beef331/micros/blob/master/tests/tapply.nim#L6-L37 |
02:03:39 | SamuelMarks | Hmm actually it shouldn't be too difficult for me to write my own flat CST ("T") for C. I think I'll do that. Probably won't take longer than 24 hours… here we go! |
02:04:32 | FromDiscord | <Elegantbeef> CST? |
02:06:17 | * | rockcavera quit (Remote host closed the connection) |
02:08:40 | * | rockcavera joined #nim |
02:08:40 | * | rockcavera quit (Changing host) |
02:08:40 | * | rockcavera joined #nim |
02:08:48 | * | rockcavera quit (Remote host closed the connection) |
02:09:33 | * | rockcavera joined #nim |
02:09:33 | * | rockcavera quit (Changing host) |
02:09:33 | * | rockcavera joined #nim |
02:09:38 | * | Goodbye_Vincent1 joined #nim |
02:09:53 | * | rockcavera quit (Remote host closed the connection) |
02:10:21 | * | rockcavera joined #nim |
02:10:21 | * | rockcavera quit (Changing host) |
02:10:21 | * | rockcavera joined #nim |
02:10:47 | * | def-- joined #nim |
02:11:05 | * | Goodbye_Vincent quit (Ping timeout: 256 seconds) |
02:11:05 | * | Goodbye_Vincent1 is now known as Goodbye_Vincent |
02:12:13 | * | def- quit (Ping timeout: 256 seconds) |
02:12:13 | * | def-- is now known as def- |
02:15:00 | * | arkurious quit (Quit: Leaving) |
02:16:54 | FromDiscord | <demotomohiro> @creikey Another implementation: https://play.nim-lang.org/#ix=3Uls |
02:17:08 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
02:17:21 | FromDiscord | <demotomohiro> With multiple objects support |
02:20:08 | FromDiscord | <Elegantbeef> Hmm i probably should use compiles more, i just dislike the premise of asking if something compiles |
02:23:23 | FromDiscord | <Rika> Beef knows his code won’t compile anyway |
02:23:30 | FromDiscord | <Elegantbeef> True |
02:25:19 | FromDiscord | <huantian> In reply to @Elegantbeef "CST?": I think it’s concrete syntax tree |
02:25:52 | FromDiscord | <huantian> From that one time I looked at that one python package |
02:27:08 | FromDiscord | <Rika> What’s the difference with an AST? |
02:27:15 | FromDiscord | <huantian> Because I think most python for matters use CST for formatting |
02:27:20 | FromDiscord | <spoon> ayo, used standard library and got using a single nimscript interpreter to work by ~~plagiarizing~~ a nimconf |
02:27:26 | FromDiscord | <huantian> Uh I think it includes more information if I remember correctly |
02:27:52 | FromDiscord | <spoon> now am i able to restrict certain language features for security reasons in nimscript? |
02:28:15 | FromDiscord | <Rika> In reply to @spoon "now am i able": In what context/method are you calling the code? |
02:28:17 | FromDiscord | <spoon> the embedding talk by pmunch btw |
02:28:19 | FromDiscord | <Elegantbeef> Most unsafe things dont exist but there is the vmopsdanger flag iirc |
02:28:44 | FromDiscord | <Elegantbeef> Well when you want to interop steal my vmconversion code to save braincells |
02:29:29 | FromDiscord | <spoon> In reply to @Rika "In what context/method are": right now i just have an object that contains a string with nimscript code, and i am just feeding it to an interpreter whenever it needs to run |
02:29:35 | FromDiscord | <huantian> I can’t remember exactly sure what the difference is tbh, at least in python I think it includes more information on the exact syntax used to make the code! |
02:29:42 | FromDiscord | <huantian> (edit) "code!" => "code?" |
02:29:56 | * | Gustavo6046 quit (Read error: Connection reset by peer) |
02:30:10 | FromDiscord | <Elegantbeef> All the unsafe operations are by default disabled iirc |
02:30:12 | FromDiscord | <spoon> In reply to @Elegantbeef "Most unsafe things dont": is there any documentation on it? |
02:30:21 | FromDiscord | <spoon> see one from 2020 where it's experimental |
02:30:31 | FromDiscord | <Elegantbeef> Nope read the code is all i can say |
02:30:38 | FromDiscord | <Elegantbeef> If you have questions i might be able to help |
02:30:48 | FromDiscord | <Rika> In reply to @huantian "I can’t remember exactly": Okay, wonder what the dude meant about the CST then |
02:31:14 | FromDiscord | <spoon> i mean i guess since it's a string i can try processing away all of the imports i don't like, but people will find a way around that most likely |
02:31:17 | FromDiscord | <Elegantbeef> Also how is this any better than Nimscripter's API? |
02:31:32 | FromDiscord | <Elegantbeef> You just dont ship unsafe modules |
02:31:41 | FromDiscord | <Elegantbeef> Like it's that simple |
02:31:47 | FromDiscord | <Elegantbeef> Cannot access code you dont have |
02:31:57 | FromDiscord | <Elegantbeef> And then again most modules cant be used |
02:32:01 | FromDiscord | <huantian> In reply to @huantian "I can’t remember exactly": don't quote me but it might be like untyped vs typed in nim? ↵but like for python CST contains thigns like whitespace, comments, parentahthes, which I'd assume get lost in ast |
02:32:04 | FromDiscord | <Elegantbeef> You cannot open a socket with nimscript |
02:32:11 | FromDiscord | <Elegantbeef> You cannot write to a file with nimscript |
02:32:20 | FromDiscord | <Rika> Nim AST never has comments |
02:32:27 | FromDiscord | <Rika> except for doc ones |
02:32:41 | FromDiscord | <Rika> That makes sense though |
02:32:48 | FromDiscord | <Elegantbeef> Yea that stuff is lost in AST |
02:33:00 | FromDiscord | <Elegantbeef> It's one reason we have expanded macro calls in error messages |
02:33:31 | FromDiscord | <Rika> Maybe I should make a toy parser for this kinda shit |
02:34:09 | FromDiscord | <huantian> Yeah like if you wanted to make a formatter, you wouldn't want to lose info like comments |
02:35:07 | FromDiscord | <Rika> I was planning on creating a formatter and maybe a linter in the future |
02:35:13 | FromDiscord | <huantian> hm yeah it might be useful to have something like this in nim if one wanted to make a ~~actually good~~ formatter |
02:35:39 | FromDiscord | <Rika> If I were to make a serious one I’d just use the compiler API |
02:35:44 | FromDiscord | <Rika> “Oh wait.” |
02:36:02 | * | Gustavo6046 joined #nim |
02:36:59 | FromDiscord | <huantian> hm what would be a good nim formatter name |
02:37:11 | * | Gustavo6046 quit (Max SendQ exceeded) |
02:37:12 | FromDiscord | <Rika> Are you gonna make one as welll |
02:37:22 | FromDiscord | <huantian> probably not lol↵I just like thinking of names |
02:37:32 | FromDiscord | <huantian> even though I can never think of good ones |
02:37:40 | * | Gustavo6046 joined #nim |
02:38:02 | FromDiscord | <spoon> probably would end up being "formatty" |
02:38:37 | FromDiscord | <Rika> I wouldn’t |
02:38:46 | FromDiscord | <Rika> I’m not a fan, and tree has that for himself |
02:38:48 | * | Gustavo6046 quit (Remote host closed the connection) |
02:39:06 | FromDiscord | <spoon> yea, saw some repos that borrowed from his nimtemplate that had the same name scheme |
02:39:07 | * | Gustavo6046 joined #nim |
02:39:08 | FromDiscord | <Rika> If he beats me to the punch so be it |
02:39:25 | FromDiscord | <huantian> how about "shape carpet" |
02:39:55 | FromDiscord | <spoon> alignymnt |
02:40:03 | FromDiscord | <spoon> (edit) "alignymnt" => "alignimnt" |
02:40:08 | FromDiscord | <spoon> aligniment |
02:40:14 | FromDiscord | <Rika> No |
02:40:18 | FromDiscord | <spoon> eh, i tried |
02:40:24 | FromDiscord | <Rika> No names with “Nim” shoehorned for me lol |
02:40:31 | FromDiscord | <aph> `nim-formatter`, straightforward but lame |
02:40:46 | FromDiscord | <Rika> Why are y’all thinking of names assuming I’ll be making this in time xd |
02:40:52 | FromDiscord | <spoon> every nim project has to have the nim shoehorned into the name though |
02:40:55 | FromDiscord | <spoon> that's an unspoken rule |
02:40:57 | FromDiscord | <huantian> what about "while stuff" |
02:41:03 | FromDiscord | <Rika> I’ll probably give it a Japanese name knowing me |
02:41:25 | FromDiscord | <Rika> In reply to @huantian "what about "while stuff"": Two words makes it annoying to deal with when I make a file name though lol |
02:41:44 | SamuelMarks | Elegantbeef - CST as in Concrete Syntax Tree. Though mine tend to be super flat. As in 1D |
02:42:03 | FromDiscord | <Elegantbeef> Also spoon what was the issue with Nimscripter? |
02:42:31 | SamuelMarks | Rika an AST won't be able to recreate the source exactly as it found it, as it omits comments and whitespace |
02:42:51 | FromDiscord | <spoon> just couldn't find a way to get it to work without either creating or destroying an interpreter each time it needed to run, given that there are a bunch of objects that would need to handle scripts |
02:42:59 | FromDiscord | <spoon> or finding some big workaround using tables |
02:43:12 | FromDiscord | <spoon> might be a method, just haven't found it |
02:43:40 | FromDiscord | <Elegantbeef> Ah i see, not much I can really happily change then |
02:44:03 | FromDiscord | <huantian> the things one has to do for hot reloading |
02:44:16 | FromDiscord | <Rika> What’s the CST for? I don’t remember you mentioning anything |
02:44:59 | SamuelMarks | Rika - So I can parse in C code, modify it [sanely], then emit it back. Also so I can create C code from nothing (just these API constructs), modify it, and emit it fresh. |
02:46:04 | FromDiscord | <Elegantbeef> Well spoon if you can figure out a way to extend nimscripter for this i'd accept a PR, the logic you're talking about is in the single file |
02:46:21 | FromDiscord | <Elegantbeef> That's if you want to of course |
02:46:27 | FromDiscord | <Rika> C parsing, may God bless you |
02:46:39 | FromDiscord | <spoon> aight, really just needs one method like "evaluateSream" or something |
02:47:06 | FromDiscord | <spoon> eh, maybe there's a bit more to it |
02:47:16 | FromDiscord | <huantian> In reply to @Rika "C parsing, may God": is it that bad? |
02:47:17 | SamuelMarks | =D |
02:47:29 | SamuelMarks | huantian - it's kinda ambiguous |
02:48:09 | FromDiscord | <Rika> In reply to @huantian "is it that bad?": Haha depends on the era of time you’re dealing with |
02:48:17 | FromDiscord | <Rika> And the compilers you’re dealing with |
02:48:39 | FromDiscord | <Rika> You usually leave it to a compiler to do the parsing but you can’t really in this case |
02:49:02 | SamuelMarks | Yeah, also LLVM doesn't actually support writing an AST from scratch in its API |
02:49:21 | SamuelMarks | It wants some actual code to parse first, then it can sort-of modify things but not cleanly like Python can |
02:49:46 | FromDiscord | <Rika> Man really you’re in for hell |
02:50:01 | FromDiscord | <Rika> Well, I guess you can ignore a whole number of things but still |
02:50:09 | SamuelMarks | I still think for my purposes it's something I can achieve within the next 24 hours |
02:50:18 | FromDiscord | <Elegantbeef> Hey for parsing they can atleast use something like libclang |
02:50:34 | FromDiscord | <Rika> Didn’t we just say he couldn’t |
02:50:41 | SamuelMarks | Ignore everything that I don't care about and get something that solves my immediate problem, open-source everything, and if others find it useful they'll fill in the bit I don't use to make it fully compliant |
02:50:51 | FromDiscord | <Rika> Sounds like a good plan |
02:51:03 | FromDiscord | <Elegantbeef> I said for parsing rika |
02:51:41 | SamuelMarks | Elegantbeef - Nah libclang ppl said they'll have this API maybe at the end of the year, they told me this morning: https://discourse.llvm.org/t/create-and-emit-ast-for-struct-clang-recorddecl/61383/2 |
02:52:13 | FromDiscord | <Rika> Yeah I don’t see your point beef |
02:55:14 | FromDiscord | <Elegantbeef> We'll just go with my pointful as a circle |
02:55:25 | FromDiscord | <Elegantbeef> with my point is as pointful\ |
02:57:02 | FromDiscord | <Rika> A circle has infinite points |
02:57:29 | FromDiscord | <Rika> Wait you mean sharp tips |
02:58:04 | FromDiscord | <spoon> pointy? |
02:58:54 | FromDiscord | <Rika> Oh my god wait this is hilarious |
02:59:02 | FromDiscord | <Rika> What if I name my formatter “aster” |
03:00:34 | FromDiscord | <huantian> Yes |
03:16:52 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
03:19:52 | * | yiggityswaps joined #nim |
03:23:23 | * | yoyojambo quit (Ping timeout: 268 seconds) |
03:32:37 | * | kayabaNerve joined #nim |
03:41:10 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlB |
03:41:18 | FromDiscord | <aph> should i install nightlies and dump there? |
03:41:54 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlC |
03:42:36 | FromDiscord | <Elegantbeef> i've never installed koch to my path so dont know why |
03:42:52 | FromDiscord | <Elegantbeef> `./koch temp c myFile` is what i generally do, where `./` is a cloned `Nim` |
03:43:10 | FromDiscord | <Elegantbeef> If you show the code i can probably guess the issue 😛 |
03:43:18 | FromDiscord | <aph> In reply to @Elegantbeef "If you show the": lol true |
03:43:27 | FromDiscord | <aph> In reply to @Elegantbeef "`./koch temp c myFile`": time to switch to powershell if it resolves anything |
03:44:16 | FromDiscord | <Elegantbeef> It wont you're calling it, it looks locally for the path iirc |
03:44:57 | FromDiscord | <aph> `./koch` not found |
03:44:59 | FromDiscord | <aph> :P |
03:45:46 | FromDiscord | <aph> dumps https://media.discordapp.net/attachments/371759389889003532/960747048548851772/reader.nim |
03:47:09 | FromDiscord | <aph> oh nvm, it doesn't seem to be the code's issue |
03:47:15 | FromDiscord | <aph> my nim compiler just didn't work lol |
03:54:04 | FromDiscord | <aph> reinstalled nim! resolved! |
03:54:17 | FromDiscord | <demotomohiro> build_at.bat/build_all.sh builds nim from c source before calling koch. |
03:58:03 | FromDiscord | <aph> hmm |
04:00:09 | FromDiscord | <Elegantbeef> Make your code smarter just take in a `Stream` |
04:00:37 | FromDiscord | <aph> okie :> |
04:00:43 | FromDiscord | <Elegantbeef> then you can have a `initPMXFile` that takes a string 😛 |
04:01:01 | FromDiscord | <Elegantbeef> Of course disregard me given you didnt ask for suggestions |
04:02:07 | FromDiscord | <Elegantbeef> your `readVec` will not work |
04:02:21 | FromDiscord | <aph> oh i thought it'll work like a list comp |
04:02:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UlD |
04:02:58 | FromDiscord | <Elegantbeef> `array[amount, float]` \ |
04:03:13 | FromDiscord | <Elegantbeef> And of course you can make a `proc readVec(s: FileStream, size: int): seq[float]` |
04:03:14 | FromDiscord | <aph> ohh |
04:03:33 | FromDiscord | <Elegantbeef> Finally you dont need to return result |
04:03:38 | FromDiscord | <Elegantbeef> result is already implicitly returned |
04:04:28 | FromDiscord | <Elegantbeef> Why are you `include`ing `pmxTypes`? |
04:04:55 | FromDiscord | <aph> In reply to @Elegantbeef "Why are you `include`ing": not sure, `import` didn't get the types |
04:05:01 | FromDiscord | <aph> i think the issue is in that file instead |
04:05:18 | FromDiscord | <aph> whoops |
04:05:20 | FromDiscord | <aph> kinda spammy |
04:05:20 | FromDiscord | <aph> sent a code paste, see https://play.nim-lang.org/#ix=3UlE |
04:05:43 | FromDiscord | <aph> i'm trying to make my code NEP1ish, later 😛 |
04:06:12 | FromDiscord | <aph> or maybe again it's not the code |
04:07:05 | FromDiscord | <Elegantbeef> Cause you didnt export types |
04:07:21 | FromDiscord | <Elegantbeef> You can only access fields/types with `` on them |
04:07:54 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/HKv |
04:08:03 | FromDiscord | <aph> ohh |
04:08:06 | FromDiscord | <aph> ty! |
04:08:06 | FromDiscord | <Elegantbeef> `array` is a generic |
04:08:14 | FromDiscord | <Elegantbeef> you cannot do `myField: array` |
04:08:20 | FromDiscord | <Elegantbeef> In that case it means "all arrays" |
04:08:24 | FromDiscord | <Elegantbeef> you need a size and type |
04:08:36 | FromDiscord | <Elegantbeef> If it's arbitrary size you do `seq[MyType]` |
04:08:50 | FromDiscord | <aph> time to go for seq |
04:08:52 | FromDiscord | <aph> :) |
04:09:05 | FromDiscord | <Elegantbeef> Also you can declare these all in a single typedef 😛 |
04:09:38 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/mwI |
04:10:03 | FromDiscord | <aph> woww |
04:10:06 | FromDiscord | <Elegantbeef> Also worth noting instead of `array[3, float]` i'd use `type Vec3 = array[3, float]` |
04:10:25 | FromDiscord | <Elegantbeef> Less tedious typing |
04:10:39 | FromDiscord | <aph> i didn't know i could do that |
04:10:40 | FromDiscord | <aph> wow |
04:11:30 | FromDiscord | <Elegantbeef> The latter thing is a type alias |
04:11:43 | FromDiscord | <Elegantbeef> Also `float` is 64 bit btwe |
04:11:49 | FromDiscord | <Elegantbeef> If you want 32bit it's float32 |
04:11:59 | FromDiscord | <aph> ohh |
04:12:12 | FromDiscord | <aph> you got me ohhing this morning |
04:12:53 | FromDiscord | <Elegantbeef> And for an ooh |
04:14:17 | FromDiscord | <Elegantbeef> `result.position = s.readVec(3)` can be written `s.read(result.position)` assuming it's a value type |
04:14:59 | FromDiscord | <Elegantbeef> and also assuming they're the same size, in this case the data is 12 bytes and you have an `array[3, float32]` |
04:15:29 | FromDiscord | <aph> i have a `Vec3` |
04:15:30 | FromDiscord | <aph> :) |
04:15:50 | FromDiscord | <Elegantbeef> I mean `Vec3` is just an alias so it's the same thing |
04:16:00 | FromDiscord | <Elegantbeef> If the dest is 12bytes and the source is 12 bytes it'll work |
04:17:51 | FromDiscord | <aph> wow `.read` is cool |
04:18:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UlH |
04:20:24 | * | rockcavera quit (Read error: Connection reset by peer) |
04:20:49 | * | rockcavera joined #nim |
04:20:49 | * | rockcavera quit (Changing host) |
04:20:49 | * | rockcavera joined #nim |
04:21:14 | FromDiscord | <aph> nim is k00l ngl |
04:21:26 | * | Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected]) |
04:21:30 | FromDiscord | <Elegantbeef> Write less not more is my view, and you can do it a lot with Nim |
04:30:15 | * | rockcavera quit (Remote host closed the connection) |
04:40:39 | FromDiscord | <aph> In reply to @Elegantbeef "You can even use": vscode angry at me https://media.discordapp.net/attachments/371759389889003532/960760856675749948/unknown.png |
04:40:40 | FromDiscord | <aph> 😢 |
04:40:58 | FromDiscord | <Elegantbeef> Compiler errors are more helpful |
04:41:47 | FromDiscord | <aph> it has no issues compiling though lol |
04:41:57 | FromDiscord | <Elegantbeef> Ah |
04:42:36 | FromDiscord | <Elegantbeef> What does the extension say? |
04:43:04 | FromDiscord | <aph> spams: `undeclared field: '...'` |
04:43:18 | FromDiscord | <Elegantbeef> Odd |
04:44:30 | FromDiscord | <aph> oh nvm |
04:44:38 | FromDiscord | <aph> i was compiling the wrong files |
04:44:42 | FromDiscord | <aph> heh |
04:44:45 | * | slowButPresent quit (Quit: leaving) |
04:44:51 | FromDiscord | <aph> i forgot to add that little star after attributes |
04:52:30 | FromDiscord | <spoon> ye, i use coderunner and end up wasting time compiling code that does nothing |
04:52:31 | * | yoyojambo joined #nim |
04:53:06 | FromDiscord | <spoon> pretty sure theres a way to configure coderunner in workspaces and get it to use nimble |
04:54:17 | * | yiggityswaps quit (Ping timeout: 248 seconds) |
04:56:12 | FromDiscord | <huantian> coderunner? Why not just vscode launch profiles |
04:59:52 | FromDiscord | <spoon> because i dont know how to use computers |
05:00:10 | FromDiscord | <Elegantbeef> Does anyone really? |
05:01:04 | FromDiscord | <Rika> Especially you beef |
05:01:30 | FromDiscord | <Elegantbeef> Always encouraging me to be a better person, see isnt rika a nice person |
05:02:20 | FromDiscord | <Rika> I’m betting a tonne of newbies absolutely hate me now lol |
05:03:02 | FromDiscord | <Elegantbeef> if they dont get banter, uhh how will they last here |
05:04:30 | FromDiscord | <Rika> Hard to tell what’s banter and what’s argument when you’ve just joined |
05:26:49 | * | yoyojambo quit (Ping timeout: 248 seconds) |
06:24:16 | * | fowl2 joined #nim |
06:25:53 | * | fowl quit (Ping timeout: 246 seconds) |
06:25:53 | * | fowl2 is now known as fowl |
06:58:24 | * | PMunch joined #nim |
07:01:40 | * | SamuelMarks joined #nim |
07:06:01 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
07:11:21 | * | SamuelMarks joined #nim |
07:16:19 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
07:26:14 | * | koltrast_ joined #nim |
07:26:26 | * | koltrast quit (Ping timeout: 246 seconds) |
07:32:32 | FromDiscord | <aph> sent a code paste, see https://paste.rs/SvC |
07:32:37 | * | jjido joined #nim |
07:41:49 | * | koltrast_ quit (Ping timeout: 240 seconds) |
07:50:26 | FromDiscord | <demotomohiro> @aph https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CS%2CT |
07:50:39 | FromDiscord | <aph> In reply to @demotomohiro "<@611418694245154847> https://nim-lang.org/docs/ite": thanks! |
07:51:13 | FromDiscord | <aph> i need to spend some time in the docs from now on! |
07:51:41 | FromDiscord | <Elegantbeef> There's a lot there so take a weekend 😛 |
07:52:00 | FromDiscord | <aph> heh might take me a month |
07:52:08 | FromDiscord | <aph> i still haven't finished the tutorials in the web |
07:52:53 | FromDiscord | <demotomohiro> Or use this inside macro: https://nim-lang.org/docs/macros.html#getTypeImpl%2CNimNode |
07:53:36 | FromDiscord | <aph> thanks 2x! |
07:54:45 | * | koltrast joined #nim |
08:06:19 | PMunch | @Phil, sorry I didn't respond yesterday. That sounds similar to what I want to do, but I want to do it statically with types instead of passing procedures around |
08:06:33 | FromDiscord | <jmgomez> can nim derive a class defined in cpp? |
08:07:20 | PMunch | Essentially if you take a type User in your route then you need to define a proc that takes a request and returns a User object somewhere. |
08:07:33 | PMunch | @jmgomez, I think so |
08:08:45 | FromDiscord | <Elegantbeef> What are you guys talking about pmunch? |
08:08:56 | PMunch | @Elegantbeef, who? |
08:09:10 | FromDiscord | <Elegantbeef> About what you'd do |
08:09:16 | PMunch | Phil and I? |
08:09:21 | FromDiscord | <Elegantbeef> Yes |
08:09:29 | PMunch | Ah, web frameworks |
08:09:52 | PMunch | He wants something Django-esque, and I want something with type-safe routes |
08:10:34 | FromDiscord | <Phil> In reply to @PMunch "<@180601887916163073>, sorry I didn't": Currently at work, but once I'm off I'd love to chat a bit around your idea, because I can only imagine that through passing procs around |
08:10:49 | FromDiscord | <Phil> Tomorrow some time? Today my day is super packed |
08:10:59 | PMunch | I'm also at work :P |
08:11:15 | FromDiscord | <Elegantbeef> Typesafe routes that means less than you'd imagine to me |
08:11:21 | FromDiscord | <Phil> Yeh, but I can't do deep thinking an pseudo-pay-attention to meetings at the same time |
08:11:24 | PMunch | But I'm available most of the day (at least now that my ankle is f-ed) |
08:11:39 | FromDiscord | <Phil> And payment processes |
08:11:41 | FromDiscord | <Phil> Fuck payment processes |
08:11:44 | FromDiscord | <Phil> They're the worst |
08:11:47 | PMunch | I'm lucky enough to not have a lot of meetings :P |
08:11:58 | PMunch | What do you work with? |
08:11:58 | FromDiscord | <Phil> If payment processes were a programming language they'd make brainfuck look easy |
08:12:08 | PMunch | Haha :P |
08:12:45 | PMunch | Not even sure what you mean by payment processes, but the little experience I have with finance-related stuff I wholehearthedly agree that it all seems like a massive clusterfuck |
08:12:54 | FromDiscord | <Phil> Subscription based service, but it's only kinda subscription based.↵You buy a yearly membership but it's sold to you like a monthly one with minimum contract duration of a year that can auto-renew after the year |
08:13:28 | FromDiscord | <Phil> And when you're in the auto-renewal state the conditions to which you can quit the contract are fundamentally different than during the initial yearly membership in so many ways it's ridiculous |
08:14:03 | PMunch | Sounds like a lot of fun to implement /s |
08:14:34 | FromDiscord | <Phil> We don't even fully understand what we need to implement because we're the people designing the process in the first place as well while in meetings with finance people |
08:14:56 | PMunch | I got so annoyed the other day, I wanted to cancel a service, and according to the website the only way to cancel it was to call them. But their phones where swamped so I couldn't get through.. |
08:16:24 | FromDiscord | <Phil> Though to be more nim specific |
08:16:44 | FromDiscord | <Phil> I think what Pmunch meant with type safe routes was, yknow, in a webapplication every URL is associated with a proc |
08:16:45 | FromDiscord | <jmgomez> In reply to @PMunch "<@726017160115126333>, I think so": do you know how? the compiler it's telling me that it must inherit from RootOfObj not sure if Im doing something wrong though |
08:16:56 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix= |
08:17:15 | FromDiscord | <Elegantbeef> mark your `TestCppNim` with `{.inheritable, pure.}` |
08:18:36 | FromDiscord | <Phil> And if you have a parameter in your url the proc that handles requests to that URL should receive the parameters and only these parameters |
08:18:52 | FromDiscord | <Phil> And if it wants to have additional parameters that aren't in the URL then the compiler should scream |
08:18:56 | FromDiscord | <Elegantbeef> Ah so a parser/validator with procedures |
08:19:09 | FromDiscord | <Phil> Sort of, I want sth like that in prologue at least |
08:19:17 | FromDiscord | <Elegantbeef> Well the compiler wouldnt scream it just wouldnt work |
08:19:48 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Umd |
08:20:24 | FromDiscord | <Phil> The main problem this has is that at compile time, I do not know that the handler proc created by `createReadByIdHandler` will only use the ID_PATTERN param |
08:21:04 | FromDiscord | <Phil> Like, it should be possible, I know the proc that will be used with that URL at compile time and I know the URL itself at compile time |
08:21:27 | FromDiscord | <Phil> But currently the created handler could be expecting a parameter "walumba" and it'd only explode at runtime |
08:21:43 | FromDiscord | <Phil> (edit) "But currently the created handler could be expecting a ... parameter" added "string/int/bool" |
08:22:32 | PMunch | I just don't like having to implement route-parsing logic in my route handler |
08:22:48 | FromDiscord | <Elegantbeef> Ah yea i'd be partial to `proc creatureRoute(a: int) {.route:"/creature/$i",.}` |
08:22:54 | PMunch | I also want to support headers and bodies though of course |
08:23:05 | PMunch | That's the idea @Elegantbeef :) |
08:23:09 | FromDiscord | <Phil> My main hope is that by understanding Pmunch's approach I could comprehend a possible solution |
08:23:28 | FromDiscord | <Elegantbeef> Well my nettyrpc does something similar just for network packets instead of routes |
08:23:39 | FromDiscord | <Elegantbeef> It's the same idea, i really should make that more pluggable to other areas |
08:24:31 | PMunch | But I'd do `proc creatureRoute(a: CreatureId) {.route:"/creature/$i".}` and then have a `proc to(req: Request, typedesc[CreatureId]): CreatureId` proc that is responsible for getting the CreatureId out of the route |
08:25:00 | FromDiscord | <Elegantbeef> Eh fuck that |
08:25:11 | FromDiscord | <Elegantbeef> `proc creatureRoute(a: CreatureId) {.route:"/creature/$a"}` |
08:25:57 | PMunch | Or I could just do `proc creatureRoute(a: Creature) {.route:"/creature/$i".}` and my `to` proc would grab the ID, look it up in the Creature table, and pass me the object. With all the not-found logic and such in the to proc and my route just dealing with proper requests |
08:26:19 | FromDiscord | <Elegantbeef> Ah i see i thought it was about parsing |
08:26:25 | FromDiscord | <Phil> How do you assure at compile time that it explodes if you do `proc creatureRoute(a: Creature, b: string) {.route:"/creature/$i".}` ? |
08:26:40 | FromDiscord | <Elegantbeef> you dont use b so it errors? |
08:26:45 | PMunch | Not really, it's about moving the logic of understanding requests out into separate procedures |
08:27:13 | FromDiscord | <Phil> Wait, no, I'm an idiot |
08:27:27 | FromDiscord | <Phil> I mixed two very separate issues because my mind is scrambled with too many complicated problems atm |
08:27:40 | PMunch | @Phil, well it wouldn't, as long as there is a `to(req: Request, b: typedesc[string]): string` procedure |
08:27:47 | FromDiscord | <Phil> One is having extensible handlers, this is completely separate from what I do above |
08:28:00 | FromDiscord | <Phil> That's what Pmunch and I were talking about regarding Django like stuff |
08:28:30 | FromDiscord | <Elegantbeef> I should just go to my hidey hole 😛 |
08:28:52 | FromDiscord | <Elegantbeef> So pmunch you got 10000 stars on your project due to TMWN right? 😛 |
08:28:54 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Ume |
08:29:19 | FromDiscord | <Phil> Ignore all my crap about wanting compile time guarantees for url having the correct params for the handler |
08:29:32 | FromDiscord | <Phil> That's entirely separate from the conversation |
08:30:19 | PMunch | My idea is that the router would match the route to whatever comes in, then it will try to run all the `to` procs in try/catch blocks which returns nice errors (and potentially goes on to other routes), then if everything is able to be extracted from the current HTTP request then it will call the route body. |
08:30:21 | FromDiscord | <Phil> Somehow my brain jumped from "Pmunch has a thing with typesafe" to be a solution for the compile-time-guarantee problem rather than the Django-Like-extensible-Handler-Proc problem |
08:30:41 | FromDiscord | <xflywind> You can try adding a macro wrapping `addRoute`. |
08:30:50 | PMunch | Your route also just returns a single type, and it would be able to format this return type in different ways, similar to how autotemplates works |
08:30:53 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3Umg |
08:31:39 | PMunch | @xflywind, yes that was my idea. Basically don't write my own web-framework, just a new router that can output either Prologue or Jester routes |
08:32:08 | FromDiscord | <Phil> Shit, macros, my weakpoint that I'm procrastinating on solving |
08:32:20 | FromDiscord | <Elegantbeef> Hey micros is progressing |
08:32:43 | PMunch | @Phil don't worry about it, macros are basically dark magic, not a lot of people master them :P |
08:33:30 | PMunch | @Elegantbeef, oh wow, just checked futhark and it has indeed gotten a nice boost in stars |
08:33:34 | FromDiscord | <Elegantbeef> Micros makes life a bit easier, just have to continue abstracting code |
08:34:05 | PMunch | https://star-history.com/#PMunch/futhark&Date |
08:34:13 | FromDiscord | <jmgomez> When importing types you can specify a raw pointer or the actual type, at least in clang in windows if you specify the raw pointer you cant inherit. Is there a way in nim to get a pointer of a type that's compatible with cpp raw pointers? |
08:34:18 | FromDiscord | <Phil> I'm at a point where I think a solid 40-50% of my code is generics |
08:34:32 | FromDiscord | <Phil> I'm getting to that "continue to abstract" |
08:34:48 | FromDiscord | <Elegantbeef> I've never dealt with C++ much but you can try `byref` |
08:35:00 | FromDiscord | <Elegantbeef> Good generic code is reusable code 🙂 |
08:36:00 | PMunch | @Elegantbeef, so apparently the Gnome gitlab is back up |
08:36:12 | FromDiscord | <Elegantbeef> https://github.com/beef331/micros/blob/master/tests/test1.nim#L38-L50 cmon phil you can clearly read this |
08:36:21 | FromDiscord | <Elegantbeef> Yea pmunch i found a bundler so i got dynamic building working |
08:36:24 | PMunch | I remember I was trying to install something to try to build something for you, but I don't remember what it was I was trying to build :P |
08:36:31 | PMunch | Ah right |
08:36:50 | FromDiscord | <Elegantbeef> 50MB package for 30 loc |
08:37:11 | FromDiscord | <Elegantbeef> GTK dynamic is a fucking joke for windows 😛 |
08:37:44 | PMunch | Haha, yeah I remember doing something like that |
08:38:02 | FromDiscord | <Elegantbeef> No clue how small static is |
08:38:08 | FromDiscord | <Elegantbeef> Probably much much smaller |
08:38:49 | PMunch | A short Python script, couple hundred lines, and I needed to bundle it for Windows. Had to bundle in a standalone Python thing, and standalone Gtk stuff. Hundreds of files and plenty of megabytes to run some super simple logic. |
08:39:10 | FromDiscord | <Phil> Okay, g2g, need full attention on payment processes |
08:39:25 | PMunch | Well I guess with static you'd only be shipping parts of Gtk and not the whole thing |
08:39:33 | FromDiscord | <Elegantbeef> Yea |
08:39:39 | FromDiscord | <Elegantbeef> Compiler strips a ton of code |
08:39:48 | FromDiscord | <Elegantbeef> You only ship what you use type deal |
08:40:13 | FromDiscord | <Elegantbeef> Only issue is have 0 intent on testing since debian doesnt ship the libraries |
08:40:25 | FromDiscord | <Elegantbeef> Prebuild dynamic and static would be nice, but dont exist |
08:40:30 | FromDiscord | <Elegantbeef> Not even on third party repos |
08:40:42 | FromDiscord | <Elegantbeef> Debian using programmers are like "What's mingw-gtk" |
08:45:56 | FromDiscord | <jmgomez> In reply to @Elegantbeef "I've never dealt with": you prefix the type with ref? or using something else? If the former, how it differs from ptr? Also how can you dereference it? |
08:46:22 | FromDiscord | <Elegantbeef> `type MyType {.byref, pure inheritable ,... }` |
08:46:27 | FromDiscord | <jmgomez> ohh |
08:46:32 | FromDiscord | <jmgomez> thanks! |
08:46:39 | FromDiscord | <Elegantbeef> `byref` pases it by reference to procedures |
08:46:46 | FromDiscord | <Elegantbeef> It might not be what you want i guess |
08:46:58 | FromDiscord | <Elegantbeef> Like i said have never touched C++ interop so no clue what's required |
08:47:14 | FromDiscord | <jmgomez> Not sure, Im just evaluating options. Im glad that's an option because otherwise too many copies |
08:47:34 | FromDiscord | <Elegantbeef> Eh Nim passes by ref when it should for performance anyway |
08:48:27 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/La2 |
08:48:36 | FromDiscord | <jmgomez> I mean when doing interop with cpp |
08:48:44 | FromDiscord | <Elegantbeef> Or i guess `MyCppType = ptr MyCppType` |
08:48:53 | FromDiscord | <Elegantbeef> `MyCppType = ptr object` |
08:49:18 | FromDiscord | <Elegantbeef> I'm mostly speaking out my arse, so dont hold me accountable if any of this doesnt work |
08:49:36 | * | koltrast quit (Ping timeout: 268 seconds) |
08:49:40 | FromDiscord | <jmgomez> Okay, I appreciate it. Do you know how to travel from Object to Ptr and back? |
08:49:55 | FromDiscord | <Elegantbeef> `[]` to dereference and `addr` to get the address |
08:52:52 | FromDiscord | <jmgomez> addr got working but where the [] supposed to be? doesnt seem to work as prefix |
08:53:00 | FromDiscord | <Elegantbeef> postfix |
08:53:24 | FromDiscord | <jmgomez> ohh a bit odd but that works! |
08:53:39 | FromDiscord | <Elegantbeef> Eh it's consistent imo |
08:53:56 | FromDiscord | <Elegantbeef> array indexing is pointer dereferencing, sequence dereferencing is you guessed it a form of pointer dereferencing 😛 |
08:54:13 | FromDiscord | <jmgomez> that's true |
08:54:21 | FromDiscord | <Elegantbeef> It's better than `` i think |
08:54:36 | FromDiscord | <Elegantbeef> though nim is nothing if not extensible so could always have a `deref(a)` |
08:54:54 | * | koltrast joined #nim |
08:55:03 | FromDiscord | <jmgomez> maybe it is, but I and assume most people are used to it |
08:55:15 | FromDiscord | <jmgomez> yeah, that's the second major selling point of nim |
08:55:31 | FromDiscord | <Elegantbeef> Hey if you came from pascal you'd expect `^` |
08:57:16 | FromDiscord | <jmgomez> unrelated question, when doing FFI in other langs (i.e. rust) you have to call the deallocator in the lang that did the allocation. I assume in nim, as long as you use it in the same lang as target, it isnt the case? |
08:57:54 | FromDiscord | <Elegantbeef> Uhh no clue like i said I havent interoped with C++ |
08:57:59 | FromDiscord | <Elegantbeef> I imagine you dont |
08:58:19 | FromDiscord | <Elegantbeef> C you very much dont have automatic memory management and JS is well GC'd |
08:58:39 | FromDiscord | <jmgomez> 👍 |
08:58:47 | FromDiscord | <ShalokShalom (ShalokShalom)> > unrelated question, when doing FFI in other langs (i.e. rust) you have to call the deallocator in the lang that did the allocation. I assume in nim, as long as you use it in the same lang as target, it isnt the case?↵If you are looking for a language to interop with Rust, I recommend you to look for Gluon. |
08:58:57 | FromDiscord | <Elegantbeef> That's not what they asked |
08:59:15 | FromDiscord | <Elegantbeef> Nim does have destructors if that isnt the case you can map to the proper ones if need be |
08:59:36 | FromDiscord | <ShalokShalom (ShalokShalom)> You can call Rust functions natively https://github.com/gluon-lang/gluon#gluon= |
08:59:41 | FromDiscord | <jmgomez> Thank but nope, Im looking at lang to interop with Cpp. Rust does not does a good job there |
08:59:48 | FromDiscord | <jmgomez> (it does with c though) |
08:59:58 | FromDiscord | <Elegantbeef> D and Nim are like the only ones that do C++ interop |
09:00:08 | FromDiscord | <ShalokShalom (ShalokShalom)> Ah, I see. |
09:00:18 | FromDiscord | <ShalokShalom (ShalokShalom)> Lua? 😛 |
09:00:44 | FromDiscord | <Elegantbeef> We'll say sure but that's not a system language so you're getting a D |
09:00:47 | FromDiscord | <ShalokShalom (ShalokShalom)> Yeah, I think Nim is great for that use case. |
09:01:30 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:02:26 | FromDiscord | <jmgomez> I think so! Just evaluating it so far. One concern though is on the headers files that I will need to include in the cpp side, didnt reach that point yet. But for consuming cpp is crazy good so far |
09:03:00 | PMunch | At some point I hope to add C++ support to Futhark |
09:03:13 | FromDiscord | <Elegantbeef> What a brave soul |
09:03:40 | NimEventer | New thread by JPLRouge: Impure libraries ???, see https://forum.nim-lang.org/t/9074 |
09:04:21 | FromDiscord | <lily & violet> Hi. I'm having trouble passing flags to `nim` from `nimble`, is there a way to do it without having to call manually `nim`? |
09:04:32 | FromDiscord | <Elegantbeef> make a config.nims |
09:04:33 | FromDiscord | <jmgomez> In reply to @PMunch "At some point I": didnt know about Futhark, seems really good |
09:05:21 | FromDiscord | <lily & violet> In reply to @Elegantbeef "make a config.nims": How am I supposed to use it for my case? |
09:05:29 | FromDiscord | <Elegantbeef> What do you mean? |
09:05:37 | * | ltriant_ joined #nim |
09:05:47 | FromDiscord | <lily & violet> Where do I put the file, and what do I put in it? :o |
09:05:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/6vG |
09:06:01 | FromDiscord | <Elegantbeef> Put it next to your `.nimble` |
09:06:08 | FromDiscord | <lily & violet> Okay |
09:06:28 | FromDiscord | <Elegantbeef> long form command line arguments will work int |
09:06:52 | * | ltriant quit (Ping timeout: 268 seconds) |
09:07:37 | FromDiscord | <lily & violet> Running `nimble run` doesn't change the `nim` invocation tho |
09:07:50 | FromDiscord | <lily & violet> even with `config.nims` right beside the .nimble file |
09:07:53 | PMunch | @jmgomez, it's fantastic, I've wrapped multiple libraries with it and for most of them it just works |
09:08:25 | FromDiscord | <Elegantbeef> it should run with the arguments iin the nims file |
09:09:01 | FromDiscord | <Elegantbeef> What does your config look like |
09:09:20 | FromDiscord | <lily & violet> sent a code paste, see https://play.nim-lang.org/#ix=3Umy |
09:10:27 | FromDiscord | <Solitude> place config.nims in the same directory as your main nim file. |
09:10:55 | FromDiscord | <Elegantbeef> I guess with a weird structure it can be at the root? |
09:11:02 | FromDiscord | <lily & violet> those two flags still doesn't show up |
09:11:16 | FromDiscord | <Elegantbeef> can't\ |
09:11:37 | FromDiscord | <lily & violet> My folder structure is the default one after calling nimble init tho |
09:12:15 | FromDiscord | <Elegantbeef> Odd |
09:13:15 | FromDiscord | <Elegantbeef> Full output of `nimble run --verbose`? |
09:14:10 | FromDiscord | <lily & violet> :NLRfacepalmpicard: |
09:14:14 | FromDiscord | <lily & violet> It works |
09:14:24 | FromDiscord | <lily & violet> The flags are just not added to the command line apparently |
09:14:43 | FromDiscord | <lily & violet> Thanks for the help |
09:15:36 | FromDiscord | <Elegantbeef> No problem |
09:20:32 | FromDiscord | <jmgomez> can nim generate a cpp library (not c, but cpp, so no extern) |
09:20:39 | FromDiscord | <jmgomez> (edit) "extern)" => "extern)?" |
09:21:00 | FromDiscord | <Elegantbeef> I dont think so |
09:22:04 | FromDiscord | <jmgomez> so you can only embed it into a cpp either by the C library path or by adding the generated cpp (files which arent supposed to be used)? |
09:22:29 | FromDiscord | <Elegantbeef> I believe so, i could be wrong |
09:22:49 | FromDiscord | <Elegantbeef> You could do something like genny and emit C++ headers i think |
09:24:24 | FromDiscord | <jmgomez> ok, will check it out |
09:25:19 | FromDiscord | <Elegantbeef> There's also the forum which will probably get more concrete answers |
09:26:10 | FromDiscord | <Elegantbeef> I mention it as i'm going to sleep now 😛 |
09:26:41 | FromDiscord | <jmgomez> hahah thanks! |
09:34:10 | FromDiscord | <lily & violet> I'm using VSCode with the Nim extension (v0.6.6, by Konstantin Zaitsev). Is it normal if i'm not getting any autocompletion from 3rd party packages? |
09:34:43 | FromDiscord | <lily & violet> It apparently uses NimSuggest |
09:39:45 | FromDiscord | <Solitude> anything wrong happening with nimsuggest is normal, but you could also try another extension by saem |
09:41:00 | FromDiscord | <lily & violet> Yes okay, thanks |
09:41:45 | * | jmdaemon quit (Ping timeout: 248 seconds) |
10:21:19 | FromDiscord | <TryAngle> hello,↵is there a function to read memory of a process? |
10:27:58 | FromDiscord | <Zoom> This gets Cringe of the Day award↵(@ShalokShalom) |
10:29:04 | PMunch | @TryAngle, probably have to call some C procedure to do that |
10:30:37 | FromDiscord | <TryAngle> In reply to @PMunch "<@147447489316913152>, probably have to": 🥲 |
10:30:54 | FromDiscord | <TryAngle> alright, I also looked through winim and coulnd't find memoryapi or this specific function there |
10:32:10 | FromDiscord | <Zoom> @TryAngle\: https://github.com/khchen/winim/blob/b7b32603f4ef672bc34405bc6200e8aab2c366b1/winim/inc/winbase.nim#L1871 |
10:32:33 | FromDiscord | <TryAngle> In reply to @Zoom "<@147447489316913152>\: https://github.com/khchen/w": 🥺 ↵omg thank u |
10:32:43 | FromDiscord | <TryAngle> how did u find it? |
10:32:53 | FromDiscord | <TryAngle> github search functionality never works for me |
10:33:02 | FromDiscord | <TryAngle> (edit) "github search functionality never works for me ... " added "😐" |
10:34:29 | FromDiscord | <Zoom> I used human-assisted search. |
10:44:27 | FromDiscord | <aph> ~~meanwhile discord:~~ https://media.discordapp.net/attachments/371759389889003532/960852411390525490/unknown.png |
10:44:32 | FromDiscord | <aph> lol |
10:45:10 | FromDiscord | <Rika> Here we go again |
10:54:04 | PMunch | @Rika, haha I think they just found it funny that someone with the bot tag said they used human-assisted search |
10:54:19 | PMunch | But yeah, I wish we could add some kind of disclaimer for Discord users :P |
10:57:00 | FromDiscord | <Zoom> That was insulting. I'm not on Discord.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
10:57:32 | PMunch | @Zoom, no I meant @aph, who appears to be on Discord |
10:57:51 | PMunch | A lot of Discord users come in here and complains that they only get answers from bots :P |
10:58:37 | PMunch | Hmm, I'm trying to wrap a nice wrapper for Coap |
10:58:46 | FromDiscord | <Zoom> Ah, sorry. My jokes rarely fly due to me being not-quite-sharp... |
10:59:23 | PMunch | The coap library requires you to call `coap_startup()` and then later you do `var ctx = coap_new_context()` |
10:59:41 | FromDiscord | <Zoom> So, what syntax would you guys use to take a set of key-value pairs as a program argument? Please, don't say "use a config file". |
11:00:17 | PMunch | Now `coap_startup()` has a simply check to see if it has already been started, so I'm considering to just throw it into my `newContext` procedure as it would likely only be called once anyways |
11:00:20 | PMunch | Thoughts? |
11:00:42 | PMunch | The problem is that you also have coap_cleanup.. |
11:01:02 | PMunch | And calling that from the context destructor might mess things up.. |
11:02:48 | FromDiscord | <Rika> In reply to @Zoom "So, what syntax would": “Use a config file” |
11:03:04 | FromDiscord | <Rika> I mean what else would you want |
11:03:20 | FromDiscord | <Rika> If you want to take in command line arguments you can go to the simplicity of key=value |
11:03:29 | FromDiscord | <Rika> Or environment variables |
11:03:38 | FromDiscord | <Rika> If you’re extra caveman |
11:05:09 | PMunch | Oh huh, the coap_new_context actually calls the coap_startup thing itself.. |
11:10:17 | FromDiscord | <TryAngle> I'm having huge issues with c libraries 😭↵I'm on windows↵I use nimgui, a dear Imgui wrapper library that uses c imgui |
11:10:30 | FromDiscord | <TryAngle> (edit) "nimgui," => "nimgl/imgui," |
11:10:48 | FromDiscord | <TryAngle> i'm getting the error: `could not load: cimgui.dll` |
11:12:18 | FromDiscord | <TryAngle> here is the definition of cimgui in that project https://github.com/nimgl/imgui/tree/master/src/imgui/private |
11:12:41 | FromDiscord | <TryAngle> but how would I make this work 🥺 I have 0 clue |
11:17:25 | FromDiscord | <Rika> Get the dll and put it by the binary |
11:18:28 | PMunch | @TryAngle, switch to an OS with proper library handling |
11:18:41 | PMunch | Or just put the DLL in the same folder as the binary |
11:19:07 | PMunch | Although I highly recommend the first option, slightly painful to begin with, but so worth it |
11:22:37 | FromDiscord | <Rika> Doubt it’s in his control |
11:34:37 | FromDiscord | <TryAngle> In reply to @PMunch "<@147447489316913152>, switch to an": I want, I'm already expereinced with linux↵but I play video games that are not available on linux 😦↵so I waint until I have a second gpu so I can passthrough |
11:35:50 | FromDiscord | <Solitude> In reply to @PMunch "<@147447489316913152>, switch to an": you are lucky araq is not in this chat |
11:37:06 | PMunch | @TryAngle, you should give it a try with Proton, it's surprisingly good. I was able to play Elden Ring the same week it came out |
11:37:22 | PMunch | @Solitude, haha I'd be banned for hate speech |
11:43:26 | FromDiscord | <TryAngle> In reply to @PMunch "<@147447489316913152>, you should give": league of legends 😦 |
11:44:07 | PMunch | Haven't tried it |
11:44:35 | FromDiscord | <Solitude> man, league works perfectly fine on linux |
11:45:45 | FromDiscord | <TryAngle> In reply to @Solitude "man, league works perfectly": 😳 |
11:45:47 | FromDiscord | <TryAngle> how ? |
11:45:48 | FromDiscord | <TryAngle> lol |
11:46:08 | FromDiscord | <TryAngle> Wine? |
12:01:06 | FromDiscord | <Zoom> I am and proudly so.↵I'll go with `--arg=a:1,b:foo,c:42`↵(@Rika) |
12:03:38 | * | koltrast quit (Ping timeout: 260 seconds) |
12:06:26 | * | zeus-supreme joined #nim |
12:08:14 | FromDiscord | <jmgomez> hey guys, In mac it seems to work fine but in windows there is no intellisense? Any idea of what can be going on? https://media.discordapp.net/attachments/371759389889003532/960873496542593024/unknown.png |
12:09:21 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Un2 |
12:09:37 | FromDiscord | <Zoom> Please, if you think screenshots are necessary, at least crop them to the relevant bit. Thanks a lot. |
12:09:59 | FromDiscord | <jmgomez> Sure |
12:10:14 | FromDiscord | <Zoom> Len returns the bytes, basically, not the UTF runes↵(@hmmm) |
12:10:21 | FromDiscord | <hmmm> oh |
12:10:30 | FromDiscord | <hmmm> hmmm |
12:11:00 | FromDiscord | <hmmm> so the à bytes are doubly the fat of the q bytes? |
12:11:13 | FromDiscord | <enthus1ast> you can try to use https://nim-lang.org/docs/unicode.html#runeLen%2Cstring |
12:11:38 | FromDiscord | <hmmm> that's what I wanted! ty enthy |
12:11:42 | FromDiscord | <hmmm> and zoom |
12:14:26 | FromDiscord | <konsumlamm> note that `runeLen` is slower than `len`, as it has to iterate over the whole string |
12:15:13 | FromDiscord | <hmmm> noted |
12:18:16 | FromDiscord | <Zoom> !eval echo "qqqà".toSeq()↵(@hmmm) |
12:18:18 | NimBot | Compile failed: /usercode/in.nim(1, 13) Error: attempting to call undeclared routine: 'toSeq' |
12:19:48 | FromDiscord | <enthus1ast> @['q', 'q', 'q', '\\xC3', '\\xA0'] |
12:20:53 | FromDiscord | <Zoom> Yeah, though prelude is imported by default |
12:26:05 | PMunch | @hmmm, UTF-8 is pretty neat. One byte can typically only hold 256 characters, but the unicode standard has 1,112,064 code points, so how does that work? Essentialy if the first bit of the character is 1 then it needs to read more bytes. You know how many bytes to read by the amount of 1's before the first 0. For two bytes the number starts with 110, for three it starts with 1110 and for four it starts with 11110. Then the following bytes all start with 10. The |
12:26:05 | PMunch | rest of the bits are the data used for the character. |
12:26:48 | FromDiscord | <Zoom> @hmmm\: read this https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/ |
12:27:12 | FromDiscord | <Zoom> and Rust had a nice chapter on UTF strings. Just skip the part about slicing and all |
12:27:17 | PMunch | This of course means that in order to read the length of a UTF-8 string you need to iterate over the entire string character by character and decide how many characters to not count. |
12:28:04 | FromDiscord | <hmmm> or use runelen that does that for you right? 🤔 |
12:28:17 | PMunch | Yes, that is what runeLen does |
12:28:59 | FromDiscord | <Zoom> https://doc.rust-lang.org/book/ch08-02-strings.html#internal-representation - Rust's string is basically a seq of Runes, not a seq of Chars, like Nim's string. |
12:29:35 | FromDiscord | <hmmm> so it's fatter but it's len and runelen are the same thing? |
12:30:31 | FromDiscord | <enthus1ast> the (byte) len is already stored in a nim string and can therefore just returned, the runelen must be computed for the call |
12:31:02 | FromDiscord | <hmmm> oh that's cool I didn't know a string had len built in |
12:31:02 | FromDiscord | <Zoom> It's not fatter, it just more abstract and doesn't support treating itself like a plain sequence every time.↵(@hmmm) |
12:31:23 | FromDiscord | <Rika> There’s no reason you can’t make a string that’s Unicode by default and stores the rune length internally, no one has done it is all |
12:31:23 | FromDiscord | <enthus1ast> len and \\0 |
12:31:33 | FromDiscord | <enthus1ast> like if pascal and c had a baby |
12:31:37 | FromDiscord | <Zoom> That's because Nim's string is currently just a seq, and seq has a length as a field↵(@hmmm) |
12:31:43 | PMunch | Of course it gets a bit more complicated than that if you need to know things like how many glyphs will be displayed, because unicode also has what's called a zero-width joiner. This is how it supports emojis with multiple people and interactions. Skin colour for emoji is another thing that counts as another code-point but doesn't take up a glyph of its own. |
12:32:21 | FromDiscord | <Zoom> Programming sucks - even strings are hard. /s |
12:32:53 | FromDiscord | <enthus1ast> languages are hard |
12:32:59 | FromDiscord | <enthus1ast> human interaction |
12:33:53 | FromDiscord | <Rika> Abolish all languages |
12:34:03 | FromDiscord | <Rika> Go back to never interacting with each other |
12:35:05 | FromDiscord | <lpha3ch0> sent a code paste, see https://play.nim-lang.org/#ix=3Un7 |
12:35:34 | FromDiscord | <lpha3ch0> I'm guessing that malicious actors are using wAuto for malware. |
12:36:36 | FromDiscord | <Rika> Wouldn’t be surprised |
12:38:02 | PMunch | @lpha3ch0, please report these as false positives to the antivirus vendor. That's the only way this will eventually get better |
12:38:54 | PMunch | Malicious actors are using Nim for malware, and honestly I don't even blame them, it's a very good fit for malware. But it means that most antivirus vendors have started to aggressively fingerprint almost everything written in Nim as a virus.. |
12:42:43 | FromDiscord | <Phil> Out of curiosity. I've heard of "null-terminated strings". What are the actually used alternatives to those? |
12:43:02 | FromDiscord | <Phil> non-terminated strings? |
12:44:55 | PMunch | @Phil, well length delimited characters are the most common alternative |
12:45:28 | FromDiscord | <Solitude> In reply to @lpha3ch0 "It's getting harder and": delete windose |
12:45:37 | FromDiscord | <Recruit_main707> In reply to @PMunch "Malicious actors are using": Any low-as-c level language is just as good for malware isn't it?↵The reason they go for niche languages is they are relatively unused |
12:45:49 | PMunch | The DNS protocol for example stores play.nim-lang.org as `<4>play<8>nim-lang<3>org` |
12:46:32 | FromDiscord | <Phil> Hmmm interesting, so null-terminated strings save you a byte on storing a length |
12:46:52 | FromDiscord | <Rika> not really |
12:46:52 | FromDiscord | <Phil> And I guess are more flexible because you can just move the null-terminator back |
12:46:58 | FromDiscord | <Rika> since theres the null terminator byte 🙂 |
12:47:08 | FromDiscord | <Phil> Ah, fair,hmm |
12:47:24 | PMunch | @Phil, and Nim of course stores the length of a string as well as null terminating. The .len operator in Nim just returns the length of the string (and can contain more null characters), but the null termination is kept in place to make .cstring essentially just be a dereference operation (otherwise the string would need to be copied over to a 1 byte larger memory region with an extra null byte). |
12:47:42 | FromDiscord | <Solitude> In reply to @Isofruit "And I guess are": thats just as flexible as decrementing length field |
12:48:25 | PMunch | Null terminated strings made a lot of sense back when memory was super scarce and storing a 16 or 32 bit length for each string was seen as too much waste |
12:49:04 | FromDiscord | <Phil> I assume C has both types of strings? |
12:49:07 | PMunch | It also makes a lot of sense with how arrays in C work |
12:49:10 | FromDiscord | <Rika> they make sense if your strings were under 256 character length lol otherwise just use a byte for the length man... |
12:49:15 | PMunch | Nope, C doesn't really have a string type |
12:49:17 | FromDiscord | <Rika> In reply to @Isofruit "I assume C has": yes |
12:49:19 | FromDiscord | <Rika> technically |
12:49:23 | FromDiscord | <Rika> in common use yes |
12:49:40 | PMunch | It uses a pointer to a character as a string, and then the convention is to read until it finds a null byte. |
12:50:16 | PMunch | But since this can be very insecure it is common to have a length field as part of the signature of any function which uses a string argument |
12:50:37 | PMunch | But it doesn't have one common length-delimited string type |
12:54:21 | FromDiscord | <federico3> "it" being C? I know |
12:54:50 | FromDiscord | <lpha3ch0> In reply to @Solitude "delete windose": I tried to delete Windows, but my laptop hardware is very new and I couldn't get everything working on Linux even after spending days tweaking everything. The last straw before switching back to Windows was my wireless connection would randomly stop working while still showing connected. I would have to disable and reenable wifi to resume working. |
13:00:10 | FromDiscord | <Zoom> There was a time when you could just swap that wifi card for one with working drivers. I suppose now it's all soldered in. |
13:00:42 | PMunch | That's the scariest thing about buying a laptop nowadays |
13:00:58 | PMunch | Trying to find one that works well with Linux without being able to test it out first |
13:01:18 | FromDiscord | <Rika> lenovo has laptops that ship with linux lol |
13:01:31 | FromDiscord | <enthus1ast> the one i sent is a linux notebook manufacturer |
13:01:41 | FromDiscord | <enthus1ast> tuxedocomputers.com |
13:02:47 | PMunch | @Rika, which is why my laptop is a Thinkbook |
13:02:57 | PMunch | @enthus1ast, I assumed as much when I saw that name :P |
13:03:05 | FromDiscord | <lpha3ch0> Thinkbooks and System76 are usually a good bet for Linux compatibility. |
13:03:20 | FromDiscord | <Rika> ive a thinkpad but i dont have linux on it... yet |
13:03:21 | FromDiscord | <lpha3ch0> But in my case I had to take what I was issued for the work laptop. |
13:03:39 | FromDiscord | <lpha3ch0> ... even if I was allowed to reimage with whatever I wanted. |
13:03:53 | PMunch | Of course I also use Dvorak, so the Thinkpad track-nub is a bit of a nuisance.. |
13:04:08 | PMunch | @lpha3ch0, you ask for permission? |
13:05:30 | FromDiscord | <Zoom> Well, if it's free for you and the only issue is wifi, I'd just used a dongle.↵(@lpha3ch0) |
13:06:11 | FromDiscord | <lpha3ch0> In reply to @PMunch "<@275045322705862656>, you ask for": No |
13:07:10 | FromDiscord | <enthus1ast> I would love to have a Lenovo T60 with modern hardware |
13:07:37 | FromDiscord | <enthus1ast> best overall machines i've used so far |
13:08:42 | FromDiscord | <enthus1ast> but lenovo lost my trust with their strange "press down as hard as you can" touchpads |
13:09:20 | FromDiscord | <Phil> In reply to @lpha3ch0 "I tried to delete": Ohhh what's your wireless card? Intel? Or ... was the other one Realtek or sth? |
13:11:00 | PMunch | @enthus1ast, press down as hard as you can touchpads? |
13:11:47 | FromDiscord | <enthus1ast> they thought it would be a good idea to have a touchpad, that instead of "touching" you had to press like a big button |
13:12:19 | PMunch | Oh right, I actually kind of like that (on my T480s), gives a nice feedback |
13:12:24 | FromDiscord | <Phil> Work provided me a Thinkbook that came out... a year ago? 1.5? Something like that, ubuntu is doing surprisingly well on that one.↵Thus I'd be curious what hardware you have just so I can be aware which HW tends to have issues |
13:12:50 | FromDiscord | <TryAngle> In reply to @Rika "Get the dll and": hmmm to get the .dll I think I have to "make" the project |
13:13:02 | PMunch | The T480s works perfectly |
13:13:55 | FromDiscord | <enthus1ast> the drivers back then where so bad, they sometimes moved the mouse to the upper right corner and pressed the mouse button 3 times. (for example when you put your palm on it). Lost a bunch of work because of this bug.↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
13:14:51 | FromDiscord | <Vindaar> tapping on touchpads to click is the absolute worst imo |
13:14:59 | FromDiscord | <Vindaar> physical click all day |
13:15:12 | FromDiscord | <enthus1ast> gave me 3 Month "holidays"↵(@Vindaar) |
13:15:19 | FromDiscord | <enthus1ast> because of RSI syndrom |
13:16:43 | PMunch | TBH I mostly use the track-nub anyways |
13:16:49 | PMunch | Or just keyboard shortcuts |
13:20:20 | NimEventer | New thread by ErikWDev: Changing order of templates causes compilation error. Why in this case?, see https://forum.nim-lang.org/t/9075 |
13:22:53 | FromDiscord | <Vindaar> In reply to @enthus1ast "gave me 3 Month": sorry to hear that, but that sounds like wrong tool for the job |
13:24:50 | * | rockcavera joined #nim |
13:24:50 | * | rockcavera quit (Changing host) |
13:24:50 | * | rockcavera joined #nim |
13:25:34 | FromDiscord | <enthus1ast> sure it was, but back then i had no other choice, lenovo was kfc standart |
13:25:36 | FromDiscord | <enthus1ast> had never heard about RSI before it hit me though \:) |
13:39:11 | FromDiscord | <TryAngle> anybody here knows how to compile libraries via make to .dll so nim can use them? 🥺 |
13:39:20 | FromDiscord | <TryAngle> I'm too stupid to understand c ecosystem |
13:41:30 | PMunch | It all depends on what the Makefile contains |
13:42:22 | PMunch | The make program is just a way to run tasks laid out in a Makefile. And Makefiles themselves are essentially just a bunch of recipes to create files |
13:42:55 | * | SamuelMarks joined #nim |
13:43:54 | FromDiscord | <TryAngle> https://github.com/nimgl/cimgui#compilation |
13:44:06 | FromDiscord | <TryAngle> I used GnuWin32 to compile it via make |
13:44:18 | FromDiscord | <TryAngle> (edit) "GnuWin32" => "GnuWin32's make" | removed "via make" |
13:44:35 | FromDiscord | <TryAngle> but I get this error: `could not load: cimgui.dll` |
13:44:55 | FromDiscord | <TryAngle> https://media.discordapp.net/attachments/371759389889003532/960897827670724628/unknown.png |
13:48:42 | FromDiscord | <Rika> how do you run the exe |
13:48:51 | FromDiscord | <TryAngle> In reply to @Rika "how do you run": nimble run |
13:49:18 | FromDiscord | <Rika> can you try running the exe directly |
13:49:35 | FromDiscord | <TryAngle> same error |
13:49:54 | FromDiscord | <Anuke> I get the following error when attempting to compile the vscode-nim extension:↵> `elrpc.nim(6, 18) Error: cannot open file: nimsuggest/sexp`↵How do I install nimsuggest sources correctly? It's not a standard nimble package. Nim was installed through choosenim on my machine. |
13:50:15 | FromDiscord | <enthus1ast> has the dll the same bitwitdh? |
13:50:30 | FromDiscord | <enthus1ast> 32/64 |
13:50:32 | FromDiscord | <enthus1ast> ? |
13:50:42 | FromDiscord | <TryAngle> In reply to @enthus1ast "has the dll the": how do I know that? |
13:50:55 | FromDiscord | <enthus1ast> i mean, you compiled both \:) |
13:52:14 | FromDiscord | <TryAngle> I literally have 0 clue 😭 |
13:52:29 | FromDiscord | <TryAngle> I did ↵`make -IMGUI_STATIC` in cimgui directory and took the generated dll |
13:52:45 | PMunch | That's definitely not correct |
13:52:46 | FromDiscord | <TryAngle> on my nim project I do `nimble run` |
13:53:02 | PMunch | STATIC probably means it's meant for static linking |
13:53:14 | PMunch | The fact that that even produced a dll is a bit surprising |
13:53:36 | PMunch | @Anuke, nimble install compiler perhaps? |
13:53:53 | FromDiscord | <TryAngle> In reply to @PMunch "STATIC probably means it's": I thought that's what I have to do o_O |
13:54:03 | FromDiscord | <Rika> its not |
13:54:08 | FromDiscord | <Rika> dlls are for dynamic linking |
13:54:09 | FromDiscord | <Anuke> In reply to @PMunch "<@123539225919488000>, nimble install compiler": That worked, thanks. |
13:55:32 | FromDiscord | <TryAngle> In reply to @Rika "dlls are for dynamic": ok I just did only `make` took the dll and same error 😭 |
13:56:32 | FromDiscord | <enthus1ast> 1. check if the dll hase same bittness like your nim app\:↵↵`file the.dll`↵`file the.exe` |
13:56:33 | FromDiscord | <Rika> did you make on mingw |
13:57:03 | FromDiscord | <TryAngle> In reply to @Rika "did you make on": http://gnuwin32.sourceforge.net/packages/make.htm↵I used this |
13:57:08 | FromDiscord | <enthus1ast> 2. check where your application searches the dll\:↵↵`strace the.exe`and look for open and or the dll name |
13:57:24 | FromDiscord | <Rika> can you use mingw instead |
13:58:55 | FromDiscord | <TryAngle> In reply to @enthus1ast "1. check if the": how do I do that o_O https://media.discordapp.net/attachments/371759389889003532/960901353436221500/unknown.png |
13:59:04 | FromDiscord | <TryAngle> In reply to @Rika "can you use mingw": I will look up that |
13:59:57 | FromDiscord | <enthus1ast> yes that looks good↵(@TryAngle) |
14:00:00 | FromDiscord | <TryAngle> In reply to @Rika "can you use mingw": what mingw do u use? do u even use windows for that? |
14:00:05 | FromDiscord | <enthus1ast> now try the strace |
14:00:09 | FromDiscord | <Rika> what do you mean "what mingw" |
14:00:27 | PMunch | Is there a particular reason why you're trying to use it as a DLL? I thought imgui was the kind of library you just compiled into your program |
14:00:28 | FromDiscord | <Rika> try what en is telling you first |
14:00:40 | FromDiscord | <Rika> cimgui is not |
14:00:44 | FromDiscord | <Rika> well |
14:00:45 | FromDiscord | <Rika> it can |
14:00:48 | FromDiscord | <TryAngle> In reply to @PMunch "Is there a particular": I want to use nimgl |
14:00:52 | FromDiscord | <Rika> i guess he didnt use it here tho |
14:01:30 | FromDiscord | <TryAngle> In reply to @TryAngle "I want to use": https://github.com/nimgl/nimgl/blob/master/examples/timgui.nim↵I try to run this example |
14:02:19 | FromDiscord | <TryAngle> In reply to @Rika "what do you mean": msys2, cygwin, mingw-w64 builds, llvm-mingw |
14:03:37 | FromDiscord | <TryAngle> In reply to @Rika "i guess he didnt": waht do you mean 🤔 |
14:04:47 | * | arkurious joined #nim |
14:10:50 | FromDiscord | <enthus1ast> can you also post the output of`strace the.exe`↵?↵Then we know if the application at least pick up the dll |
14:12:58 | * | PMunch quit (Quit: Leaving) |
14:13:46 | FromDiscord | <enthus1ast> should then look like this\:`--- Process 22032 loaded C:\Users\david\projects\nimSubmission\src\tmpls.dll at 0000000064c40000 ` |
14:14:05 | FromDiscord | <TryAngle> In reply to @enthus1ast "can you also post": hmmm I tried strace on linux but it doesn't work 🤔 |
14:14:54 | FromDiscord | <TryAngle> https://media.discordapp.net/attachments/371759389889003532/960905374179942460/unknown.png |
14:15:34 | FromDiscord | <enthus1ast> is this msys? |
14:15:46 | FromDiscord | <TryAngle> In reply to @enthus1ast "is this msys?": i'm doing that command from wsl |
14:17:33 | FromDiscord | <enthus1ast> git for windows also ships with strace |
14:17:47 | FromDiscord | <enthus1ast> in a bash it must be\:↵↵strace ./your.exe |
14:18:02 | FromDiscord | <TryAngle> I don't have strace on windows |
14:18:21 | FromDiscord | <TryAngle> In reply to @enthus1ast "in a bash it": that woks though on wsl |
14:18:37 | FromDiscord | <enthus1ast> its harder to see though |
14:18:47 | FromDiscord | <enthus1ast> but you should see an open call to the dll |
14:19:36 | FromDiscord | <enthus1ast> or several tries, then you know where the exe is searching for the dll |
14:19:54 | FromDiscord | <TryAngle> sent a code paste, see https://paste.rs/aTi |
14:20:10 | FromDiscord | <enthus1ast> before this somewhere |
14:21:58 | FromDiscord | <TryAngle> In reply to @enthus1ast "before this somewhere": there is no other `cimgu`, `cimgui`, `dll` |
14:26:43 | FromDiscord | <enthus1ast> yes it seems the wsl strace does not work |
14:30:22 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
14:31:28 | FromDiscord | <TryAngle> anyways, thanks for trying to help me enthusiast rika and pmunch,↵but I seem to lack intelligence to work with anything c / c++ related↵I quit. |
14:32:15 | FromDiscord | <enthus1ast> or, get the strace from git 4 win (all the tools in this git distro, are worth it any way), the find out more \:) |
14:32:20 | * | Lord_Nightmare joined #nim |
14:32:24 | FromDiscord | <enthus1ast> then |
14:38:23 | FromDiscord | <enthus1ast> i've tried wtrace from here\: https://github.com/lowleveldesign/wtrace/releases/tag/3.2-fix_chocolatey |
14:38:40 | FromDiscord | <enthus1ast> it outputs this for my test\:↵16\:37\:03.6621 server (31016.39280) FileIO/Create 'C\:\\Users\\david\\projects\\nimSubmission\\src\\tmpls.dll' disposition\: OPEN\_EXISTING, options\: 0x200000 -\> SUCCESS |
14:42:40 | FromDiscord | <tandy> https://github.com/tandy-1000/api-binding-template |
14:42:46 | FromDiscord | <tandy> if anyone needs to make API bindings in Nim... |
14:51:23 | * | koltrast joined #nim |
15:14:23 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
15:19:17 | Amun-Ra | tandy: I was expecting Tandy 1000 emulator somewhere in those repos ;> |
15:27:54 | FromDiscord | <tandy> lol |
15:28:06 | Amun-Ra | so dissapointed ;> |
15:28:19 | Amun-Ra | hmm, disappointed* ;> |
15:41:10 | * | SamuelMarks joined #nim |
15:42:59 | FromDiscord | <jmgomez> hey guys, can you call a nims file from a nimble task? |
15:43:08 | FromDiscord | <jmgomez> (edit) "nims" => ".nims" |
15:43:33 | * | PMunch joined #nim |
15:43:47 | FromDiscord | <exelotl> you can by invoking `nim e`, for example: `selfExec "e myfile.nims"` |
15:44:28 | FromDiscord | <exelotl> it's a bit slow though since it has to start up another `nim` process (I think) |
15:45:03 | FromDiscord | <exelotl> or at least, the overhead of initialising the vm is high |
15:45:37 | * | slowButPresent joined #nim |
15:45:55 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
15:45:56 | FromDiscord | <exelotl> oh, as a _nimble_ task I'm not 100% certain but I think what I mentioned should still work |
15:46:36 | FromDiscord | <exelotl> alternatively, you could maybe `include` the file to run it in-place |
15:47:10 | FromDiscord | <jmgomez> okay, thanks! |
15:52:34 | PMunch | @exelotl, yes initialising the VM is a bit slow, but the execution is relatively quick. So if you want to run multiple things I'd recommend using something like nimscripter |
15:53:44 | * | jjido joined #nim |
15:56:02 | FromDiscord | <exelotl> for my project I use the `include` approach so I can just run `nim build` and it executes a bunch of scripts without needing to spin up the VM for each one |
15:56:13 | FromDiscord | <exelotl> uhh here's where I posted about it: https://forum.nim-lang.org/t/8826#57556 |
15:56:35 | FromDiscord | <Rika> https://fglt.nl/guides/visual-novels-on-gnu-linux.html |
15:56:38 | FromDiscord | <Rika> fuuuuuuck |
15:56:43 | FromDiscord | <Rika> wrong send 🙂 |
16:04:42 | * | zeus-supreme1 joined #nim |
16:07:55 | * | zeus-supreme quit (Read error: Connection reset by peer) |
16:15:27 | * | SamuelMarks joined #nim |
16:15:56 | FromDiscord | <jmgomez> does --outdir:DIR supposed to work with app:lib? |
16:19:01 | NimEventer | New thread by Archnim: Managing binary data, see https://forum.nim-lang.org/t/9076 |
16:19:13 | FromDiscord | <jmgomez> it does, I had the order misplaced |
16:20:09 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
16:29:04 | * | xet7 quit (Remote host closed the connection) |
16:33:27 | * | xet7 joined #nim |
16:35:03 | NimEventer | New thread by Archnim: My history on Nim forum, see https://forum.nim-lang.org/t/9077 |
16:42:24 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:47:36 | * | jmdaemon joined #nim |
16:56:20 | * | ozzz is now known as om3ga |
16:58:08 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:58:26 | * | jmdaemon joined #nim |
17:23:51 | * | Gustavo6046 joined #nim |
17:25:28 | * | Gustavo6046 quit (Remote host closed the connection) |
17:25:52 | * | Gustavo6046 joined #nim |
17:37:41 | PMunch | Hmm, is there a way to manually alloc and dealloc a table? |
17:45:53 | * | SamuelMarks joined #nim |
17:52:51 | * | PMunch quit (Quit: leaving) |
17:59:23 | FromDiscord | <demotomohiro> `initTable` proc has `initialSize` parameter to specifiy initial internal heap size. |
18:02:37 | * | jjido joined #nim |
18:03:35 | FromDiscord | <demotomohiro> And there is `clear` proc for table. |
18:04:56 | * | Gustavo6046 quit (Remote host closed the connection) |
18:05:50 | * | Gustavo6046 joined #nim |
18:11:20 | NimEventer | New thread by Jocker: Threading SIGSEGV in HttpClient with SSL, see https://forum.nim-lang.org/t/9078 |
18:15:13 | * | vicfred joined #nim |
18:28:41 | Amun-Ra | is there an equivalent of python's raise StopIteration? as in: https://play.nim-lang.org/#ix=3Up6 |
18:29:48 | FromDiscord | <Rika> you usually store `next` in a var and query `next.finished` to see if it has finished |
18:30:13 | Amun-Ra | oh |
18:30:23 | FromDiscord | <Rika> or you could just use `for i in next(): ` too i believe |
18:30:43 | FromDiscord | <Rika> yup |
18:30:56 | Amun-Ra | I need to call it once or twice during one loop pass |
18:31:20 | FromDiscord | <Rika> wait here then |
18:31:25 | FromDiscord | <Rika> im gonna test something |
18:31:44 | Amun-Ra | I could make a state machine but that way is easier |
18:31:55 | FromDiscord | <Rika> no no, i just checked you dont need to store next in a var |
18:32:01 | FromDiscord | <Rika> `next.finished` |
18:32:15 | Amun-Ra | nice, thanks |
18:32:34 | FromDiscord | <Rika> i JUST noticed next is a var which is why it worked |
18:32:40 | FromDiscord | <Rika> i thought it was an iterator decl |
18:32:41 | FromDiscord | <Rika> so xd |
18:32:41 | FromDiscord | <Rika> yeah |
18:33:54 | Amun-Ra | :> |
18:36:03 | Amun-Ra | it still returns one 0 before setting finished |
18:36:28 | FromDiscord | <Rika> break at the start haha |
18:36:32 | FromDiscord | <Rika> not the end of the loop |
18:37:03 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upa |
18:37:25 | Amun-Ra | Rika: https://play.nim-lang.org/#ix=3Up6 |
18:37:46 | FromDiscord | <Rika> you sent the same link haha |
18:38:04 | Amun-Ra | hmm |
18:38:29 | Amun-Ra | Rika: https://play.nim-lang.org/#ix=t%20wr |
18:38:45 | FromDiscord | <Rika> uhhhhhhh |
18:38:47 | FromDiscord | <Rika> link broke |
18:38:53 | FromDiscord | <Rika> might need to regenerate the link |
18:39:01 | FromDiscord | <demotomohiro> In reply to @jmgomez "Hey guys, any idea": Can you run that command with `--listcmd` that shows how Nim call gcc and linker. |
18:39:57 | Amun-Ra | Rika: https://play.nim-lang.org/#ix=3Upc (tested ;) |
18:40:40 | FromDiscord | <Rika> hmm i remember there being docs on this |
18:40:45 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upd |
18:41:12 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-firstminusclass-iterators |
18:41:14 | FromDiscord | <Rika> here amun-ra |
18:41:23 | FromDiscord | <Rika> read down "Note that system.finished is error prone to use...: |
18:41:24 | FromDiscord | <Rika> (edit) "use...:" => "use..." |
18:41:25 | FromDiscord | <demotomohiro> In reply to @jmgomez "Hey guys, any idea": Nim call `ar` command to build static but do you have `ar` in binutils? Can you run `where ar`? |
18:42:02 | FromDiscord | <jmgomez> first time I heard about ar TBH |
18:42:26 | Amun-Ra | Rika: right, I think I'll go with an exception to reduce the number of checks |
18:42:33 | FromDiscord | <Rika> its for static libs usually with file ext `.a` which is an old archive format |
18:42:38 | FromDiscord | <Rika> ar is for extracting it |
18:42:47 | Amun-Ra | and creating it too |
18:43:01 | FromDiscord | <Rika> okay, whichever you think is best |
18:43:04 | FromDiscord | <Rika> i dont like the system either |
18:43:47 | FromDiscord | <jmgomez> got it, so I need to have it installed. Odd that vcc doesnt have it there already |
18:44:31 | FromDiscord | <jmgomez> using clang did work |
18:44:33 | FromDiscord | <demotomohiro> binutils contains binary tools like `ld`, `as`, `ar`, etc. some of them are used by gcc. |
18:44:53 | FromDiscord | <jmgomez> but I imagine I cant mix something compiled with clang and vcc right? |
18:45:18 | FromDiscord | <jmgomez> In reply to @demotomohiro "binutils contains binary tools": that's on the nim installation folder? |
18:45:33 | FromDiscord | <demotomohiro> In reply to @jmgomez "got it, so I": binutils is usually installed when you install gcc. |
18:45:35 | Amun-Ra | vcc as in msvc? |
18:45:53 | FromDiscord | <jmgomez> yes |
18:46:02 | FromDiscord | <demotomohiro> In reply to @jmgomez "that's on the nim": No, binutils are not included in Nim. |
18:46:03 | FromDiscord | <jmgomez> I think by default they use it on windows |
18:46:09 | Amun-Ra | I don't thinks it will work |
18:46:12 | Amun-Ra | think* |
18:46:23 | FromDiscord | <jmgomez> aggh |
18:46:46 | FromDiscord | <demotomohiro> Nim dont use vcc in default even if it is installed. You need to set --cc:vcc option to use vcc backend. |
18:46:47 | FromDiscord | <jmgomez> thing is that a dynamic library does not seem to link in ue |
18:46:50 | Amun-Ra | msvc uses .lib for static libs |
18:47:01 | Amun-Ra | .a comes from posix world |
18:47:39 | Amun-Ra | I'd be surprised if mixing clang and msvc objects worked |
18:47:51 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Upg |
18:48:07 | FromDiscord | <jmgomez> I think I can get rid of that one |
18:48:08 | FromDiscord | <jmgomez> thanks |
18:49:28 | FromDiscord | <demotomohiro> `vccexe.exe` is a tool shipped with Nim that try to find `cl` in visual studio and call it. |
18:50:26 | FromDiscord | <jmgomez> what do you mean with cl? |
18:50:52 | Amun-Ra | cl.exe, ms compiler executable |
18:50:57 | FromDiscord | <demotomohiro> `cl.exe` is a c/c++ compiler in visual studio. |
18:51:05 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
18:51:06 | FromDiscord | <jmgomez> 👍 |
18:51:38 | FromDiscord | <jmgomez> so I will make sure vccexe.exe is on PATH that should do it, right? |
18:53:15 | FromDiscord | <demotomohiro> Yes. If I remember correctly, vccexe.exe is in same directory as nim.exe. |
18:53:25 | FromDiscord | <jmgomez> does vccexe.exe suppose to live inside .nimble/bin? |
18:53:40 | FromDiscord | <jmgomez> nim is there but I cant see it |
18:56:21 | * | vicecea quit (Remote host closed the connection) |
18:56:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:56:49 | * | vicecea joined #nim |
19:01:11 | FromDiscord | <demotomohiro> `https://nim-lang.org/download/nim-1.6.4_x64.zip` has `vccexe.exe` in nim-1.6.4/bin directory. |
19:01:27 | * | jjido joined #nim |
19:02:05 | FromDiscord | <jmgomez> ohh, I was compiling the sources |
19:02:28 | FromDiscord | <jmgomez> it just finished and output it, test again with it in bin and did work. Thanks a ton for your help! |
19:04:13 | * | toulene quit (Ping timeout: 260 seconds) |
19:04:52 | FromDiscord | <jmgomez> one noob question, if you have a static lib for one platform can you use it to link for another platform? |
19:07:42 | FromDiscord | <demotomohiro> I don't think so. |
19:08:49 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:09:06 | FromDiscord | <demotomohiro> Nim generates C code that works only on specific OS and specific CPU arch. |
19:09:56 | FromDiscord | <jmgomez> ok but is it due just to the nim code or the nature of static libs too? |
19:10:11 | FromDiscord | <jmgomez> I know dyn wont work for sure but not sure about statics one |
19:12:28 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Upq |
19:12:44 | FromDiscord | <demotomohiro> A static library are made of object files. Object files generated by GCC are machine code. |
19:14:00 | FromDiscord | <Rika> In reply to @d4rckh "Hello! Why can't I": Do you have $ defined for execution step |
19:15:02 | FromDiscord | <demotomohiro> In reply to @d4rckh "Hello! Why can't I": `ref` types dont have `$` proc in default. |
19:15:07 | * | neurocyte861449 joined #nim |
19:15:56 | FromDiscord | <demotomohiro> try `echo myseq.repr` or define `$` proc for `executionStep` type. |
19:16:08 | * | neurocyte86144 quit (Ping timeout: 268 seconds) |
19:16:40 | FromDiscord | <d4rckh> what should the `$` proc do? |
19:16:55 | FromDiscord | <Rika> Convert to string |
19:17:09 | FromDiscord | <Rika> It’s a “to string” function |
19:17:17 | FromDiscord | <d4rckh> oh |
19:19:38 | FromDiscord | <d4rckh> .. how should i do that? 😂 |
19:19:42 | FromDiscord | <d4rckh> (edit) removed "😂" |
19:20:12 | FromDiscord | <Rika> Someone else help, I have to go lol |
19:22:20 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Upv |
19:26:31 | FromDiscord | <Daan Breur> huh |
19:26:52 | FromDiscord | <Daan Breur> sometimes this server is less helpful then StackOverflow |
19:30:21 | FromDiscord | <demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3Upw |
19:40:55 | NimEventer | New question by Sergey Python: nim, how to get the result of multithreading execution immediately, without any delay?, see https://stackoverflow.com/questions/71757503/nim-how-to-get-the-result-of-multithreading-execution-immediately-without-any |
20:08:10 | * | SamuelMarks joined #nim |
20:19:39 | * | SamuelMarks quit (Ping timeout: 268 seconds) |
20:20:09 | * | Gustavo6046 quit (Ping timeout: 248 seconds) |
20:21:03 | * | Gustavo6046 joined #nim |
20:43:45 | * | SamuelMarks joined #nim |
20:49:25 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3UpL |
20:49:33 | FromDiscord | <creikey> (edit) "https://play.nim-lang.org/#ix=3UpL" => "https://play.nim-lang.org/#ix=3UpM" |
20:49:40 | FromDiscord | <creikey> (edit) "https://play.nim-lang.org/#ix=3UpM" => "https://play.nim-lang.org/#ix=3UpN" |
20:51:50 | FromDiscord | <demotomohiro> How about to use try expression: https://nim-lang.org/docs/manual.html#exception-handling-try-expression |
21:03:50 | NimEventer | New thread by SergeyPython: Why multithreading execition take time almost equal to single thread execution?, see https://forum.nim-lang.org/t/9079 |
21:09:52 | FromDiscord | <Elegantbeef> try expressions are so lovely |
21:38:27 | FromDiscord | <Zoom> Wait, does `threadpool` not work with orc? I get reads from nil. Not with arc. |
21:38:40 | FromDiscord | <Elegantbeef> I think it should |
21:42:55 | * | wyrd quit (Ping timeout: 240 seconds) |
21:45:06 | * | wyrd joined #nim |
21:52:04 | FromDiscord | <Zoom> Also, `blockUntilAny` is strange |
22:10:42 | * | mn3m0n1c quit (Quit: Connection closed for inactivity) |
22:29:19 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3Uq8 |
22:32:25 | FromDiscord | <demotomohiro> How it is defined? |
22:32:38 | FromDiscord | <demotomohiro> Or declared? |
22:33:40 | FromDiscord | <demotomohiro> !eval var refreshTaste = 1; refreshTaste = 2; echo refreshTaste |
22:33:42 | NimBot | 2 |
22:34:02 | * | zeus-supreme joined #nim |
22:34:03 | FromDiscord | <hmmm> hmm |
22:34:04 | FromDiscord | <Recruit_main707> !eval let refreshTaste = 1; refreshTaste = 2; echo refreshTaste |
22:34:05 | NimBot | Compile failed: /usercode/in.nim(1, 23) Error: 'refreshTaste' cannot be assigned to |
22:34:29 | FromDiscord | <Recruit_main707> !eval refreshTaste = 2; echo refreshTaste |
22:34:30 | NimBot | Compile failed: /usercode/in.nim(1, 1) Error: undeclared identifier: 'refreshTaste' |
22:36:51 | * | zeus-supreme1 quit (Read error: Connection reset by peer) |
22:43:04 | FromDiscord | <Zoom> You'd think there should have been at least a hint you need to cast stuff to make blockUntilAny even compile, not even work \:P |
22:44:11 | FromDiscord | <Zoom> Looks like it never returns `-1` |
22:59:05 | * | rawrrr quit (Quit: Connection closed for inactivity) |
23:04:47 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
23:45:20 | FromDiscord | <Elegantbeef> [Zoom](https://matrix.to/#/@Zoom:matrix.org)\: got some example code? |