<< 31-05-2022 >>

00:00:15FromDiscord<Yepoleb> nice, thanks
00:00:36FromDiscord<Elegantbeef> Yea if you run it refc you'll see an issue with the data
00:00:49FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/980984155028471838/image.png
00:01:00FromDiscord<Elegantbeef> That should never happen for obvious reasons šŸ˜„
00:01:14FromDiscord<Elegantbeef> With orc it properly counts from 0-100
00:02:42FromDiscord<Yepoleb> reading all the warnings about refs i was worried i would have to go back to manual memory management 😱
00:02:57*cyraxjoe quit (Ping timeout: 260 seconds)
00:03:00FromDiscord<Elegantbeef> Orc/arc are much nicer for most things
00:03:48FromDiscord<Yepoleb> that's a big relief
00:04:08FromDiscord<Yepoleb> thanks for explaining and testing this for me
00:04:26FromDiscord<Elegantbeef> Like global heap allocated variables can be accessed safely with a `{.cast(gcsafe).}:` block
00:04:40FromDiscord<Elegantbeef> No problem
00:04:51FromDiscord<Elegantbeef> I'm contemplating what to work on so this makes me pretend i'm doing something productive šŸ˜„
00:05:48FromDiscord<Yepoleb> documentation šŸ˜‰
00:06:08FromDiscord<Yepoleb> is global heap and shared heap the same thing?
00:06:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YZr
00:07:33FromDiscord<Yepoleb> is that not true for refc?
00:07:59FromDiscord<Elegantbeef> No in refc the heap isnt shared so you cannot access that variable that way afaik
00:08:02FromDiscord<Elegantbeef> I'd need to test it
00:14:30FromDiscord<Andreas> In reply to @Elegantbeef "I'd need to test": atm i use `refc` and send a SharedPtr of a linked-list to a couple of threads. They mutate the list concurently. So passing a SharedPtr works for me..
00:14:42FromDiscord<Yepoleb> i think i read somewhere that global variables are exempt, but i can't find it anymore
00:15:50FromDiscord<Elegantbeef> They might be↵(@Yepoleb)
00:15:59FromDiscord<Elegantbeef> But i just showed a global variable causing havoc
00:16:02FromDiscord<Elegantbeef> So who knows
00:16:14FromDiscord<Yepoleb> yeah, right
00:17:32FromDiscord<Yepoleb> i'm just gonna try to avoid that mess altogether
00:32:05*krux02 joined #nim
00:37:21*dtomato joined #nim
01:02:16*krux02 quit (Remote host closed the connection)
01:27:38*noeontheend quit (Ping timeout: 244 seconds)
02:08:47*arkurious quit (Quit: Leaving)
02:57:38*rockcavera quit (Remote host closed the connection)
03:03:42FromDiscord<Izanami恮Megumi> so
03:04:01FromDiscord<Izanami恮Megumi> I'm trying to get started with Nim but it keeps returning me errors with my helloworld.nim file
03:04:28FromDiscord<Izanami恮Megumi> https://media.discordapp.net/attachments/371759389889003532/981030373909737522/unknown.png
03:04:36FromDiscord<Izanami恮Megumi> I wonder if I've done something wrong
03:06:22FromDiscord<Izanami恮Megumi> oh wait
03:06:24FromDiscord<Elegantbeef> You dont seem to have a `gcc` setup
03:06:26FromDiscord<Izanami恮Megumi> I know what gcc is
03:06:27FromDiscord<Elegantbeef> How did you install Nim?
03:06:33FromDiscord<Izanami恮Megumi> lemme try installing it
03:06:50FromDiscord<Elegantbeef> You may want to use choosenim
03:06:57FromDiscord<Izanami恮Megumi> In reply to @Elegantbeef "How did you install": normally I guess?
03:07:07FromDiscord<Izanami恮Megumi> from nim-lang.org then running finish.exe
03:07:24FromDiscord<Izanami恮Megumi> In reply to @Elegantbeef "You may want to": is that a different compiler?
03:07:45FromDiscord<Elegantbeef> No it's a better way to get Nim
03:10:12FromDiscord<demotomohiro> You need to set `PATH` environmrnt variable so that you can run gcc on command prompt.
03:11:28FromDiscord<Izanami恮Megumi> In reply to @Elegantbeef "No it's a better": well I did what the video told me to do
03:11:52FromDiscord<Izanami恮Megumi> so I don't know where to get this choose nim
03:12:03FromDiscord<Izanami恮Megumi> either way I'm downloading gcc, hope it gets it to work
03:12:47FromDiscord<Izanami恮Megumi> the one I downloaded is .tar.gz though
03:12:59FromDiscord<huantian> I think finish.exe should install gcc you just have to add it to path right?
03:13:25FromDiscord<Izanami恮Megumi> when it asked me to add stuff to path I said yes
03:14:04FromDiscord<Izanami恮Megumi> trying it again
03:14:20FromDiscord<demotomohiro> So `gcc --version` works on your console?
03:14:59FromDiscord<Izanami恮Megumi> https://media.discordapp.net/attachments/371759389889003532/981033019605405776/unknown.png
03:15:28FromDiscord<Izanami恮Megumi> ill try restarting
03:15:30FromDiscord<Izanami恮Megumi> might work
03:18:28FromDiscord<Izanami恮Megumi> it did
03:18:30FromDiscord<Izanami恮Megumi> lmao
03:18:39FromDiscord<Izanami恮Megumi> thanks either way
04:34:15FromDiscord<proton> How to show lines when use --stacktrace
04:40:52FromDiscord<Bung> am tring to read stream object from pdf file, I can use strutls.find find "stream" position, but when try to find "endstream" I get -1
04:42:54FromDiscord<Elegantbeef> what you're saying doesnt make any sense
04:43:30FromDiscord<Bung> am looking for help
04:44:02FromDiscord<Elegantbeef> And i'm trying to offer it, so provide code and the file
04:44:50FromDiscord<Bung> https://media.discordapp.net/attachments/371759389889003532/981055634118152202/Screenshot_2022-05-31_at_12.45.06_PM.png
04:46:29FromDiscord<Elegantbeef> That's indeed some code that really is hard to process
04:47:41FromDiscord<Bung> ok , I'll push to github
04:47:51FromDiscord<Elegantbeef> Eh i'm writing a cleaner solution
04:49:07FromDiscord<Bung> I was get the idea from internet, it is a py script extract jpg from pdf
04:51:30FromDiscord<Bung> https://github.com/bung87/pdf2image
04:57:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YZP
04:58:06FromDiscord<Elegantbeef> Shit that doesnt work properly
04:58:16FromDiscord<huantian> Bad beef
04:58:40FromDiscord<Elegantbeef> But it's a better way to do it imo then loading the entire PDF into memory, if you have it in memory just use regex at that point
05:07:27FromDiscord<Bung> I get the point of your code , but the sub string find will fails when it in middle of two read ?
05:07:42FromDiscord<Elegantbeef> Yea that's the issue i spoke of
05:07:52FromDiscord<Elegantbeef> If you're reading it all in memory just use regex
05:07:57FromDiscord<Elegantbeef> If you want to be efficient fix that bug with mine
05:09:45FromDiscord<proton> Anyone knows why stacktrace doesn't show line number any more?
05:09:46FromDiscord<Bung> I have no idea how to fix that in that way , I also face this when I programing http form parser
05:11:05FromDiscord<Elegantbeef> Bung you can use the stream API and do `readStr` and do the check on that instead
05:11:23FromDiscord<Elegantbeef> But anyway regex is just easier here
05:11:38FromDiscord<Elegantbeef> They should are you certain you dont have `-d:danger`?↵(@proton)
05:13:29FromDiscord<Bung> I agree with you ,I want to know why my code does not work, since my code is less dependency
05:14:01FromDiscord<proton> sent a long message, see https://paste.rs/GAT
05:19:21FromDiscord<proton> Have no idea which line to check.šŸ˜‚
05:20:36*wallabra quit (Ping timeout: 246 seconds)
05:22:20FromDiscord<Elegantbeef> That might work
05:22:24FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/qOs
05:22:55FromDiscord<Elegantbeef> It keeps the last 8 characters in buffer so it should be capable of capturing messages across the 120 character data reads
05:23:58FromDiscord<Elegantbeef> `read = file.readBuffer(hayStackBuff[8].addr, hayStackBuff.len - 8)` whoops
05:24:24FromDiscord<Bung> index out of bounds [IndexDefect]
05:24:27FromDiscord<Elegantbeef> Fuck that's still wrong
05:24:27FromDiscord<Elegantbeef> Yea
05:24:34FromDiscord<Elegantbeef> ` hayStackBuff.add hayStackBuff.toOpenArray(hayStackBuff.len - 8, 8)` is wrong
05:24:39FromDiscord<Elegantbeef> Atleast the order
05:26:07FromDiscord<Elegantbeef> Atleast it's close
05:27:55FromDiscord<Bung> oh, I get the idea, neat
05:31:39FromDiscord<Elegantbeef> Yep since you know the largest part of the message you can keep only that every iteration and that means you never have an issue, though `startSlice` needs to start at `8` now šŸ˜„
05:42:02FromDiscord<Bung> do you make it work now ?
05:42:48FromDiscord<Elegantbeef> Hey i dont have a test file
05:44:48FromDiscord<Bung> send you tiny scanned pdf https://media.discordapp.net/attachments/371759389889003532/981070721272909844/-_.pdf
05:45:52*wallabra joined #nim
06:31:31FromDiscord<Josef> How can I compile ni with microsoft visual C++ 7.0?
06:31:49FromDiscord<Josef> (edit) "ni" => "nim"
06:35:46FromDiscord<demotomohiro> nim can use cl.exe in visual studio by adding `--cc:vcc` option
06:36:36FromDiscord<demotomohiro> But I dont know if nim works with vc 7.0
06:38:42FromDiscord<Josef> Mm, I need to be ABI compatible and use its stdlib.
06:41:05FromDiscord<demotomohiro> Are tryig to make a program for old windows like winodws2000 or windows98?
06:43:50FromDiscord<demotomohiro> It seems oldest version `vccexe` support is vs9.0: https://github.com/nim-lang/Nim/blob/devel/tools/vccexe/vccexe.nim
06:47:15FromDiscord<demotomohiro> Probably no one have ever tried to use Nim with such a old vc version.
06:49:31FromDiscord<demotomohiro> Maybe Nim can use `cl.exe` in vc++7.0 by setting the path to `cl.exe` to `--vcc.exe` and `--vcc.linkerexe`.
06:54:25FromDiscord<Bung> ` re"stream(.)endstream"` does not work for finding string between them
07:00:50*ltriant quit (Ping timeout: 240 seconds)
07:01:15FromDiscord<huantian> Hm maybe it’s because it’s a binary stream? I haven’t used regex for that before
07:01:32FromDiscord<huantian> (At least I’d assume it’s a binary stream, since it’s a jpeg)
07:02:49*ltriant joined #nim
07:06:09FromDiscord<Bung> no idea, i can simpley done it in js `/stream(.)endstream/.exec('streamabcendstream')`
07:07:30*ltriant quit (Ping timeout: 240 seconds)
07:14:28*gsalazar joined #nim
07:28:00*jjido joined #nim
07:29:15*ltriant joined #nim
07:30:23FromDiscord<Josef> In reply to @demotomohiro "Maybe Nim can use": How is that done specifically?
07:37:22*ltriant quit (Ping timeout: 272 seconds)
07:38:12FromDiscord<demotomohiro> Add `--vcc.exe:c:\path\to\cl.exe` and `--vcc.linkerexe:c:\path\to\cl.exe` option when you call Nim.↵You can see how nim call backend c compiler with `--listcmd` option.
07:39:27FromDiscord<demotomohiro> Nim's compiler options are explained here: https://nim-lang.org/docs/nimc.html
07:41:32FromDiscord<demotomohiro> Or you can also specify path to `cl.exe` using nim.cfg file like: https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg
07:45:50FromDiscord<demotomohiro> This is how Nim read configuration file when you run Nim: https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
08:05:36FromDiscord<Bung> I use `re"stream(?sU:.)endstream"` finally I found 4 jpegs in pdf , whats others in a scanned pdf ?
08:16:30*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:16:39FromDiscord<jmgomez> hey guys,
08:16:57FromDiscord<Elegantbeef> Hey Jmgomez what macro question do you have today?
08:18:30FromDiscord<jmgomez> (edit) "hey guys," => "sent a code paste, see https://play.nim-lang.org/#ix=3Z0e"
08:18:45FromDiscord<jmgomez> Sorry I hit enter before time
08:19:23FromDiscord<Elegantbeef> you dont put varTo in it
08:19:31FromDiscord<Elegantbeef> `varTo = ident"varTo"`
08:26:36FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Z0f
08:26:54FromDiscord<Elegantbeef> `result = newStmtList()`
08:27:00FromDiscord<Elegantbeef> Wait never mind
08:27:44FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/LaJ
08:27:50FromDiscord<Elegantbeef> Probably needs to be `result[^1].add:`
08:32:21FromDiscord<jmgomez> doesnt seem to like it neither :/
08:32:39FromDiscord<Elegantbeef> I just wish someone had the forsight to implement error messages in the compiler
08:33:58FromDiscord<jmgomez> I think I will end up by just creating the ast structure needed
08:34:09FromDiscord<Elegantbeef> Just provide the friggin error message
08:34:36FromDiscord<jmgomez> ohh it's the same Error: undeclared identifier: 'varTo'
08:35:03FromDiscord<Elegantbeef> You didnt pass in `varTo = ident"varTo"` did you?
08:35:37FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Z0i
08:36:07FromDiscord<jmgomez> I did. That's a WIP prop3 have the same type
08:36:24FromDiscord<Elegantbeef> after you assign result do `echo result.treerepr` and send it here
08:38:37FromDiscord<jmgomez> sent a long message, see http://ix.io/3Z0j
08:38:54FromDiscord<Elegantbeef> You removed the indentation
08:38:56FromDiscord<Elegantbeef> This is literally unreadable šŸ˜„
08:39:06FromDiscord<Elegantbeef> Oh nvm just matrix
08:39:21FromDiscord<Elegantbeef> ok so then yes what i said should work
08:39:42FromDiscord<Elegantbeef> I mean why are you even using `varTo` why not just use `result`
08:40:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Z0k
08:43:14FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Z0l
08:48:49FromDiscord<jmgomez> it has some nice stuff in there that I didnt know so thanks! But, it displaced the problem to varFrom, now the error is Error: undeclared identifier: 'varFrom'
08:49:40FromDiscord<Elegantbeef> I forgot to pass that in in the last generation logic
08:50:08FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Z0m
08:51:50FromDiscord<jmgomez> the error is actually on the prev, where it was passed
08:52:46FromDiscord<Elegantbeef> Hmmmph
08:54:35FromDiscord<Elegantbeef> you may want to pass in `ident="prop3"` but idk
08:54:46FromDiscord<Elegantbeef> this is off
08:55:48FromDiscord<jmgomez> no worries, will do it the AST way for the part where I do the assignations
08:56:05FromDiscord<jmgomez> thanks for the time, learned a few tricks more!
08:56:52FromDiscord<jmgomez> btw a bit unrelated but is it possible to override cpp virtual functions?
08:58:44FromDiscord<Elegantbeef> I'm still in the land of "people use the CPP backend?!" šŸ˜„
09:00:04FromDiscord<jmgomez> haha ok, just so you know objectively it may be one of the biggest use cases. C++ interop sucks outside of nim, nobody can really do it
09:00:15FromDiscord<Elegantbeef> Oh i know
09:00:22FromDiscord<Elegantbeef> I jusut dont have any reason to use it
09:01:14FromDiscord<jmgomez> arent you into gamedev?
09:01:20FromDiscord<Elegantbeef> Yea
09:01:39FromDiscord<jmgomez> hmm lot of things are built on cpp, what do you use?
09:01:49FromDiscord<Elegantbeef> Opengl + sdl2 + assimp presently
09:02:05FromDiscord<Elegantbeef> I'd much prefer C apis to C++ apis when it comes to code to depend upon
09:02:43FromDiscord<jmgomez> ohh I see, makes sense. Maybe one day you would like to take a look at UE šŸ˜„
09:02:53FromDiscord<Elegantbeef> Nope i despise epic
09:03:31FromDiscord<jmgomez> they mostly sucks but the tech is crazy
09:03:44FromDiscord<Elegantbeef> Sure but I need the tech like i need a car crash
09:03:51FromDiscord<Elegantbeef> Have you seen my present project?
09:04:10FromDiscord<jmgomez> lol, no I havent is it out there?
09:04:36FromDiscord<Elegantbeef> Here's a vidja
09:04:46FromDiscord<Elegantbeef> Damn i upped my bitrate a bit that's 40MB for like 10s
09:05:02FromDiscord<Elegantbeef> simplescreenrecorder-2022-05-30\_14.50.10.mp4 [simplescreenrecorder-2022-05-30_14.50.10.mp4](https://t2bot.io/_matrix/media/r0/download/matrix.org/AyTCZFjXrzmQiAVAoDqERXcf)
09:05:29FromDiscord<Elegantbeef> Not like i need nanite or any of the other tech they have to offer šŸ˜„
09:08:16FromDiscord<jmgomez> looks pretty cool!
09:08:20FromDiscord<jmgomez> congrats
09:08:33FromDiscord<Elegantbeef> Thanks
09:10:17FromDiscord<jmgomez> for me it's more the engine itself than a particular feature but I guess it depends on the game. I particularly like their animation tools, the vfx tool and the networking stuff. Lots of things already built in but for sure it depends on the game, if you dont need any of those it probably be better to just dont use an engine
09:11:40FromDiscord<Elegantbeef> Yea i personally dont do animation heavy things since i'm not competent in those parts, so i'm actually quite happy with my raylib like framework
09:13:18FromDiscord<Elegantbeef> I am delaying my work towards particle systems though
09:13:48FromDiscord<Elegantbeef> I started on it ages ago but went on hiatus from this project for a bit, still dont like the design i had going
09:13:59FromDiscord<Elegantbeef> Need to start with an API and dogfood it like my GUI
09:14:05FromDiscord<Elegantbeef> Man i love my GUI API now
09:14:08FromDiscord<Rika> I thought I was in the game dev channel by mistake
09:14:15FromDiscord<Elegantbeef> Lol
09:14:25FromDiscord<Elegantbeef> Hey no one else is talking and this is nim related so i'm staying! šŸ˜›
09:18:21FromDiscord<jmgomez> haha, what are you using for the GUI?
09:18:29FromDiscord<Elegantbeef> My own
09:18:50FromDiscord<Elegantbeef> I have this quite good retained mode API
09:19:05FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/981124648366403584/image.png
09:19:34FromDiscord<Elegantbeef> Using closures for pretty much all of the retaining, it makes a fantastic declarative GUI
09:19:39FromDiscord<jmgomez> ohh the api looks great
09:20:23FromDiscord<Turgut> does Nims macro/template system provide anything special that most other languages do not?
09:20:24FromDiscord<jmgomez> one of the things that I would like to see in Nim For UE in the future is a declarative GUI, maybe based on karak
09:20:55FromDiscord<Elegantbeef> Well it's a macro system so you can introspect all of the code you give↵(@Turgut)
09:21:15FromDiscord<Elegantbeef> Typed macros have access to all of the types and the like
09:21:26FromDiscord<Elegantbeef> I think languages with macro systems will have the same
09:21:45FromDiscord<Turgut> im looking for Nim-specifics that other languages may not have
09:21:59FromDiscord<jmgomez> Does other typed langs allows you to modify their AST?
09:22:07FromDiscord<Rika> Those with macros do
09:22:25FromDiscord<jmgomez> Which one?
09:22:44FromDiscord<Rika> Technically perhaps rust?
09:23:45FromDiscord<Elegantbeef> Rust macros dont
09:23:50FromDiscord<Elegantbeef> Rust macros are token macros
09:23:59FromDiscord<Elegantbeef> Procedural work a bit more like Nim's templates afaik
09:24:18FromDiscord<Elegantbeef> Nim-like macros are relatively uncommon
09:24:59FromDiscord<jmgomez> That's what I thought. I mean, being able to define async/await or (sugar) as libraries I dont think many (typed) langs can do that
09:25:07FromDiscord<Rika> Aren’t token macros ā€œlower levelā€ and therefore have equivalent functionality but with more work?
09:25:21FromDiscord<Elegantbeef> If you want Nim specifics look at distinct types, subrange types, Arc/Orc's move semantics that copy isntead of erroring when a move cannot be made(helpful for debugging), and the general ergonomic syntax to performance šŸ˜„
09:25:29FromDiscord<Elegantbeef> Token macros are higher level afaik
09:25:45FromDiscord<Elegantbeef> You get a stream of tokens and operate on them like if you got a `seq[Ident]`
09:25:47FromDiscord<Elegantbeef> I could be wrong
09:25:48FromDiscord<Rika> I think he wants Nim specifics related to macros
09:26:05FromDiscord<jmgomez> In reply to @Elegantbeef "If you want Nim": Plus C++ interop. Rust C++ interop just sucks
09:26:26FromDiscord<Rika> In reply to @jmgomez "That's what I thought.": I believe a few languages could, but do not
09:27:00FromDiscord<jmgomez> In reply to @Rika "I believe a few": Im not so sure about it and I will need an counter example xD
09:27:01FromDiscord<Rika> Maybe not, trying to think harder about it
09:28:12FromDiscord<Elegantbeef> You can theoretically do it with any language with macros
09:28:25FromDiscord<Elegantbeef> The issue is that it's not as nice in rust for example
09:28:40FromDiscord<Elegantbeef> Since rust does explicit macro calls and does not have command syntax
09:28:45FromDiscord<Rika> ~~rust async is a mess even without macros usage I’ve heard~~
09:29:24FromDiscord<Elegantbeef> Oh yea it's a fuck up I know an active Rust user that wishes they did it the Nim way to make it more modifiable and not take up the code space
09:30:02FromDiscord<Rika> I don’t know the specifics of why they’re bad but I’d like to know lol
09:30:55FromDiscord<Elegantbeef> https://kevinhoffman.medium.com/rust-async-and-the-terrible-horrible-no-good-very-bad-day-348ebc836274 šŸ˜„
09:32:26FromDiscord<Elegantbeef> I dont recall their complains presently, so cannot really say what they saidi
09:35:34FromDiscord<Elegantbeef> @Turgut\: oh there are some experimental features that are very Nim exclusive↵https://nim-lang.org/docs/manual_experimental.html#ast-based-overloading↵https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros
09:35:51FromDiscord<Elegantbeef> They're both experimental but are quite interesting and powerful ideas
09:36:17FromDiscord<Turgut> thanks very much @ElegantBeef
09:36:45FromDiscord<Elegantbeef> There are also dot operators there
09:38:14FromDiscord<Rika> TRMs are especially experimental
09:38:20FromDiscord<Rika> Slated for removal as well I believe
09:38:27FromDiscord<Elegantbeef> And marked for removal
09:38:30FromDiscord<Elegantbeef> Yea
09:38:33*adium quit (Ping timeout: 246 seconds)
09:38:34FromDiscord<Elegantbeef> Sadly
09:38:42FromDiscord<Rika> Same with the AST based overloading afaik (unfortunately for this one)
09:38:56FromDiscord<Rika> I think TRMs are too crazy so I’m not that saddened by it’s removal
09:39:19FromDiscord<Elegantbeef> I mean they give you power when you need it and hidden enough most people arent going to reach for them
09:40:08FromDiscord<Elegantbeef> If they dont add much compiler complexity(i dont recall if they do) it'd be nice to keep them for weirdos
09:40:34FromDiscord<Rika> I’d assume they do add a good bit
10:05:36FromDiscord<Josef> Can I use specific MSVCR.dll with nim?
10:24:12FromDiscord<mratsim> In reply to @Elegantbeef "https://kevinhoffman.medium.com/rust-async-and-the-": They want interfaces for async/futures
10:25:08*averell quit (Ping timeout: 250 seconds)
10:27:16*averell joined #nim
10:35:50FromDiscord<Josef> What's the point in macros, if you have full comptime evaluation?
10:36:01FromDiscord<Josef> (edit) "full" => "firstclass"
10:37:48FromDiscord<planetis> In reply to @Josef "What's the point in": that's what const does, so different things?
10:38:58FromDiscord<Here> In reply to @Josef "What's the point in": Dynamically accessing things in a static language
10:39:06FromDiscord<Josef> Well, once you have comptime evaluation, the only thing that macros give you is custom syntax.
10:39:54FromDiscord<Here> My main macros are mostly called "hasField" and "getField"
10:40:02FromDiscord<planetis> I guess so and also being able to generate a ton of code
10:40:13FromDiscord<Here> For that I tend to use templates
10:41:05FromDiscord<Bung> how to handle stream object filter defined as `/CCITTFaxDecode/ImageMask true/BitsPerComponent 1/Width 800/DecodeParms<</K -1/Columns 800>>/Height 1200/Type/XObject>>stream` in pdf ?
10:41:35FromDiscord<Josef> But you don't have to generate code if you have comptime eval in the first place.
10:42:17FromDiscord<Josef> As it allows you to specialize your code on the statically know strings / data.↵Resulting in same performance and less potential bugs.
10:42:43FromDiscord<Josef> (edit) "potential bugs." => "arcane compile errors."
10:42:48FromDiscord<Here> In reply to @Josef "But you don't have": The only way to assign to a field that way is iterating over the types fields and filtering for the one you want to assign to, which is very ugly to read
10:43:28FromDiscord<Here> And macros are compile time evaluated, at least the very simple ones I write
10:43:51FromDiscord<Josef> Can you show an example of this ugly code in comparison to macros?
10:46:25FromDiscord<Here> I'm on phone atm, but look at norm models module at the proc getRelatedFieldNameTo iirc it's an example of the general mechanism (iterating over fields of a type and doing something if it's the right field name). Imagine using that just to filter a given fieldname
10:46:44FromDiscord<Here> Then compare that to the "dot" macro in norms macro module
10:47:01FromDiscord<planetis> What's going on here, so you claim macros are useful or not? Because what you describe can only be done with macros, you get full comp time type introspection not just static strings
10:47:58FromDiscord<planetis> what am I supposed to do with a static string when I want to generate some code based on it? Use a macro
10:50:26FromDiscord<Josef> But you don't need to generate code in the first place. You can just pass it to function `foo(myStaticString)(myRuntimeArguments)`.
10:50:42FromDiscord<Josef> In reply to @Isofruit "Then compare that to": I will take a look, thanks.
10:51:44FromDiscord<planetis> well it depends on what are you trying to achieve
10:56:29FromDiscord<planetis> I personally don't see a reason you would pass a static argument to a proc but I am an odd case.
10:57:27FromDiscord<planetis> If you see how strutils.parseEnum generates code to parse enums https://nim-lang.github.io/Nim/enumutils.html you can't do it without a macro
10:58:11NimEventerNew thread by Slangmgh: How to disable implicit convert float to int., see https://forum.nim-lang.org/t/9187
10:58:48FromDiscord<Josef> Well, I could for want a futamura projection: `compiler = interpreter.evaluate(interpreterInStaticString)`
10:58:59FromDiscord<Josef> (edit) "Well, I could for ... want" added "example"
11:03:44FromDiscord<Rika> And what benefit would that have over a macro
11:08:50FromDiscord<Josef> You won't work Nim AST directly => less bugs, easier to read compile errors, probably also faster.
11:08:58FromDiscord<Josef> (edit) "You won't work ... Nim" added "with"
11:10:30*averell quit (Ping timeout: 252 seconds)
11:10:58FromDiscord<Rika> How so?
11:11:07FromDiscord<planetis> why faster?
11:11:49FromDiscord<demotomohiro> Nim has `parsestmt` proc that take compile time string and return AST but most of people implement macros with Nim AST(`NimNode`).
11:13:43FromDiscord<planetis> there are many ways to work with macros, use whichever is easier depending on the case
11:14:18FromDiscord<planetis> this generates safe enum conversions https://github.com/planetis-m/dumpster/blob/master/utils/safeenums.nim
11:14:43FromDiscord<planetis> it's not harder to write unless you don't know the ast you need to generate
11:15:20FromDiscord<planetis> here a comp time matrix transpose https://github.com/planetis-m/dumpster/blob/master/vectorisation/ctranspose.nim
11:16:12FromDiscord<planetis> (these are just demos to answer forum questions and nothing serious)
11:21:43FromDiscord<Josef> sent a long message, see http://ix.io/3Z0O
11:23:38FromDiscord<Rika> How would code transformation work without the AST transformation I’m not too sure
11:23:54FromDiscord<planetis> which language do you work with?
11:23:59FromDiscord<Rika> Nim won’t remove macros, Nim wants to allow ā€œcustom syntaxā€
11:24:11FromDiscord<Rika> In reply to @planetis "which language do you": I assume Zig, ā€œcomptimeā€ is from Zig
11:24:38FromDiscord<planetis> is serde serialization faster with its tuples, I doupt
11:26:56FromDiscord<demotomohiro> In macro, you can access given expressions or statements as AST. AST makes easier to scan or modify rather than strings.
11:27:23FromDiscord<Entikan> sent a code paste, see https://paste.rs/cjY
11:28:31FromDiscord<Rika> .mitems
11:28:41FromDiscord<Rika> Before the colon
11:28:54FromDiscord<demotomohiro> `for foo in seqOfFoos.mitems:`
11:29:59FromDiscord<Entikan> Nice. Thanks!
11:43:36FromDiscord<planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Z0S
11:43:41FromDiscord<planetis> ...so someone should make a comptime macro
11:44:29FromDiscord<planetis> not sure if the first one could work, but does it in Zig?
11:51:41*jjido joined #nim
11:59:29*rockcavera joined #nim
11:59:30*rockcavera quit (Changing host)
11:59:30*rockcavera joined #nim
12:01:32NimEventerNew Nimble package! autoderef - Syntax sugar which supports auto-dereferencing, see https://github.com/sls1005/autoderef
12:05:24*ltriant joined #nim
12:21:21*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:32:38*firq quit (Quit: Konversation terminated!)
12:39:28*averell joined #nim
13:06:19*firq joined #nim
13:08:51*arkurious joined #nim
13:24:39*wallabra quit (Ping timeout: 246 seconds)
13:26:27*wallabra joined #nim
13:46:28*rockcavera quit (Ping timeout: 244 seconds)
13:57:56*rockcavera joined #nim
13:57:56*rockcavera quit (Changing host)
13:57:57*rockcavera joined #nim
14:35:11*juniorfreutas joined #nim
14:50:46*juniorfreutas quit (Quit: Client closed)
14:56:30*jjido joined #nim
15:14:27*averell quit (Ping timeout: 240 seconds)
15:19:32*averell joined #nim
15:21:22*derpydoo joined #nim
15:37:51*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:58:40*jmdaemon joined #nim
16:12:53*jmd_ joined #nim
16:13:59*jmdaemon quit (Ping timeout: 255 seconds)
16:35:19*jjido joined #nim
16:52:12*gsalazar quit (Ping timeout: 246 seconds)
17:17:39NimEventerNew post on r/nim by hc0re: Complex, multi-line anonymous functions?, see https://reddit.com/r/nim/comments/v1v99q/complex_multiline_anonymous_functions/
17:26:03*jmdaemon joined #nim
17:27:20*jmd_ quit (Ping timeout: 260 seconds)
17:31:49*c0re1 joined #nim
17:32:35*c0re1 quit (Client Quit)
17:33:27*PMunch joined #nim
17:35:41*c0re1 joined #nim
17:36:00*c0re1 quit (Client Quit)
17:36:14*c0re1 joined #nim
17:36:47c0re1hello everyone!
17:51:07PMunchHello
17:53:19*rockcavera quit (Remote host closed the connection)
18:50:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:58:59*jjido joined #nim
19:00:44*c0re1 quit (Quit: WeeChat 3.5)
19:01:43*rockcavera joined #nim
19:01:43*rockcavera quit (Changing host)
19:01:43*rockcavera joined #nim
19:02:20*gsalazar joined #nim
19:05:07*jmdaemon quit (Ping timeout: 260 seconds)
19:07:03*gsalazar quit (Ping timeout: 256 seconds)
19:16:02*lumo_e joined #nim
19:31:07*ehmry quit (Read error: Connection reset by peer)
19:35:48*ehmry joined #nim
19:43:59*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
19:55:44*jjido joined #nim
20:15:50*PMunch quit (Quit: leaving)
20:17:06*om3ga joined #nim
20:28:16*derpydoo quit (Quit: derpydoo)
21:01:21*jmdaemon joined #nim
21:38:52*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
21:39:48*jjido joined #nim
21:52:42*om3ga quit (Quit: Bye)
21:57:09*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:20:53*oprypin quit (Quit: Bye)
22:21:04*oprypin joined #nim
22:24:45*toluene quit (Read error: Connection reset by peer)
22:24:55*lumo_e quit (Quit: Quit)
22:26:50*toluene joined #nim
22:27:41*toluene quit (Read error: Connection reset by peer)
22:29:45*toluene joined #nim
22:39:51*noeontheend joined #nim
22:52:53*derpydoo joined #nim
23:45:10*noeontheend quit (Ping timeout: 240 seconds)
23:56:56*xet7 joined #nim
23:58:32*noeontheend joined #nim