00:00:15 | FromDiscord | <Yepoleb> nice, thanks |
00:00:36 | FromDiscord | <Elegantbeef> Yea if you run it refc you'll see an issue with the data |
00:00:49 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/980984155028471838/image.png |
00:01:00 | FromDiscord | <Elegantbeef> That should never happen for obvious reasons š |
00:01:14 | FromDiscord | <Elegantbeef> With orc it properly counts from 0-100 |
00:02:42 | FromDiscord | <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:00 | FromDiscord | <Elegantbeef> Orc/arc are much nicer for most things |
00:03:48 | FromDiscord | <Yepoleb> that's a big relief |
00:04:08 | FromDiscord | <Yepoleb> thanks for explaining and testing this for me |
00:04:26 | FromDiscord | <Elegantbeef> Like global heap allocated variables can be accessed safely with a `{.cast(gcsafe).}:` block |
00:04:40 | FromDiscord | <Elegantbeef> No problem |
00:04:51 | FromDiscord | <Elegantbeef> I'm contemplating what to work on so this makes me pretend i'm doing something productive š |
00:05:48 | FromDiscord | <Yepoleb> documentation š |
00:06:08 | FromDiscord | <Yepoleb> is global heap and shared heap the same thing? |
00:06:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YZr |
00:07:33 | FromDiscord | <Yepoleb> is that not true for refc? |
00:07:59 | FromDiscord | <Elegantbeef> No in refc the heap isnt shared so you cannot access that variable that way afaik |
00:08:02 | FromDiscord | <Elegantbeef> I'd need to test it |
00:14:30 | FromDiscord | <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:42 | FromDiscord | <Yepoleb> i think i read somewhere that global variables are exempt, but i can't find it anymore |
00:15:50 | FromDiscord | <Elegantbeef> They might beāµ(@Yepoleb) |
00:15:59 | FromDiscord | <Elegantbeef> But i just showed a global variable causing havoc |
00:16:02 | FromDiscord | <Elegantbeef> So who knows |
00:16:14 | FromDiscord | <Yepoleb> yeah, right |
00:17:32 | FromDiscord | <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:42 | FromDiscord | <Izanamić®Megumi> so |
03:04:01 | FromDiscord | <Izanamić®Megumi> I'm trying to get started with Nim but it keeps returning me errors with my helloworld.nim file |
03:04:28 | FromDiscord | <Izanamić®Megumi> https://media.discordapp.net/attachments/371759389889003532/981030373909737522/unknown.png |
03:04:36 | FromDiscord | <Izanamić®Megumi> I wonder if I've done something wrong |
03:06:22 | FromDiscord | <Izanamić®Megumi> oh wait |
03:06:24 | FromDiscord | <Elegantbeef> You dont seem to have a `gcc` setup |
03:06:26 | FromDiscord | <Izanamić®Megumi> I know what gcc is |
03:06:27 | FromDiscord | <Elegantbeef> How did you install Nim? |
03:06:33 | FromDiscord | <Izanamić®Megumi> lemme try installing it |
03:06:50 | FromDiscord | <Elegantbeef> You may want to use choosenim |
03:06:57 | FromDiscord | <Izanamić®Megumi> In reply to @Elegantbeef "How did you install": normally I guess? |
03:07:07 | FromDiscord | <Izanamić®Megumi> from nim-lang.org then running finish.exe |
03:07:24 | FromDiscord | <Izanamić®Megumi> In reply to @Elegantbeef "You may want to": is that a different compiler? |
03:07:45 | FromDiscord | <Elegantbeef> No it's a better way to get Nim |
03:10:12 | FromDiscord | <demotomohiro> You need to set `PATH` environmrnt variable so that you can run gcc on command prompt. |
03:11:28 | FromDiscord | <Izanamić®Megumi> In reply to @Elegantbeef "No it's a better": well I did what the video told me to do |
03:11:52 | FromDiscord | <Izanamić®Megumi> so I don't know where to get this choose nim |
03:12:03 | FromDiscord | <Izanamić®Megumi> either way I'm downloading gcc, hope it gets it to work |
03:12:47 | FromDiscord | <Izanamić®Megumi> the one I downloaded is .tar.gz though |
03:12:59 | FromDiscord | <huantian> I think finish.exe should install gcc you just have to add it to path right? |
03:13:25 | FromDiscord | <Izanamić®Megumi> when it asked me to add stuff to path I said yes |
03:14:04 | FromDiscord | <Izanamić®Megumi> trying it again |
03:14:20 | FromDiscord | <demotomohiro> So `gcc --version` works on your console? |
03:14:59 | FromDiscord | <Izanamić®Megumi> https://media.discordapp.net/attachments/371759389889003532/981033019605405776/unknown.png |
03:15:28 | FromDiscord | <Izanamić®Megumi> ill try restarting |
03:15:30 | FromDiscord | <Izanamić®Megumi> might work |
03:18:28 | FromDiscord | <Izanamić®Megumi> it did |
03:18:30 | FromDiscord | <Izanamić®Megumi> lmao |
03:18:39 | FromDiscord | <Izanamić®Megumi> thanks either way |
04:34:15 | FromDiscord | <proton> How to show lines when use --stacktrace |
04:40:52 | FromDiscord | <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:54 | FromDiscord | <Elegantbeef> what you're saying doesnt make any sense |
04:43:30 | FromDiscord | <Bung> am looking for help |
04:44:02 | FromDiscord | <Elegantbeef> And i'm trying to offer it, so provide code and the file |
04:44:50 | FromDiscord | <Bung> https://media.discordapp.net/attachments/371759389889003532/981055634118152202/Screenshot_2022-05-31_at_12.45.06_PM.png |
04:46:29 | FromDiscord | <Elegantbeef> That's indeed some code that really is hard to process |
04:47:41 | FromDiscord | <Bung> ok , I'll push to github |
04:47:51 | FromDiscord | <Elegantbeef> Eh i'm writing a cleaner solution |
04:49:07 | FromDiscord | <Bung> I was get the idea from internet, it is a py script extract jpg from pdf |
04:51:30 | FromDiscord | <Bung> https://github.com/bung87/pdf2image |
04:57:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YZP |
04:58:06 | FromDiscord | <Elegantbeef> Shit that doesnt work properly |
04:58:16 | FromDiscord | <huantian> Bad beef |
04:58:40 | FromDiscord | <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:27 | FromDiscord | <Bung> I get the point of your code , but the sub string find will fails when it in middle of two read ? |
05:07:42 | FromDiscord | <Elegantbeef> Yea that's the issue i spoke of |
05:07:52 | FromDiscord | <Elegantbeef> If you're reading it all in memory just use regex |
05:07:57 | FromDiscord | <Elegantbeef> If you want to be efficient fix that bug with mine |
05:09:45 | FromDiscord | <proton> Anyone knows why stacktrace doesn't show line number any more? |
05:09:46 | FromDiscord | <Bung> I have no idea how to fix that in that way , I also face this when I programing http form parser |
05:11:05 | FromDiscord | <Elegantbeef> Bung you can use the stream API and do `readStr` and do the check on that instead |
05:11:23 | FromDiscord | <Elegantbeef> But anyway regex is just easier here |
05:11:38 | FromDiscord | <Elegantbeef> They should are you certain you dont have `-d:danger`?āµ(@proton) |
05:13:29 | FromDiscord | <Bung> I agree with you ,I want to know why my code does not work, since my code is less dependency |
05:14:01 | FromDiscord | <proton> sent a long message, see https://paste.rs/GAT |
05:19:21 | FromDiscord | <proton> Have no idea which line to check.š |
05:20:36 | * | wallabra quit (Ping timeout: 246 seconds) |
05:22:20 | FromDiscord | <Elegantbeef> That might work |
05:22:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/qOs |
05:22:55 | FromDiscord | <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:58 | FromDiscord | <Elegantbeef> `read = file.readBuffer(hayStackBuff[8].addr, hayStackBuff.len - 8)` whoops |
05:24:24 | FromDiscord | <Bung> index out of bounds [IndexDefect] |
05:24:27 | FromDiscord | <Elegantbeef> Fuck that's still wrong |
05:24:27 | FromDiscord | <Elegantbeef> Yea |
05:24:34 | FromDiscord | <Elegantbeef> ` hayStackBuff.add hayStackBuff.toOpenArray(hayStackBuff.len - 8, 8)` is wrong |
05:24:39 | FromDiscord | <Elegantbeef> Atleast the order |
05:26:07 | FromDiscord | <Elegantbeef> Atleast it's close |
05:27:55 | FromDiscord | <Bung> oh, I get the idea, neat |
05:31:39 | FromDiscord | <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:02 | FromDiscord | <Bung> do you make it work now ? |
05:42:48 | FromDiscord | <Elegantbeef> Hey i dont have a test file |
05:44:48 | FromDiscord | <Bung> send you tiny scanned pdf https://media.discordapp.net/attachments/371759389889003532/981070721272909844/-_.pdf |
05:45:52 | * | wallabra joined #nim |
06:31:31 | FromDiscord | <Josef> How can I compile ni with microsoft visual C++ 7.0? |
06:31:49 | FromDiscord | <Josef> (edit) "ni" => "nim" |
06:35:46 | FromDiscord | <demotomohiro> nim can use cl.exe in visual studio by adding `--cc:vcc` option |
06:36:36 | FromDiscord | <demotomohiro> But I dont know if nim works with vc 7.0 |
06:38:42 | FromDiscord | <Josef> Mm, I need to be ABI compatible and use its stdlib. |
06:41:05 | FromDiscord | <demotomohiro> Are tryig to make a program for old windows like winodws2000 or windows98? |
06:43:50 | FromDiscord | <demotomohiro> It seems oldest version `vccexe` support is vs9.0: https://github.com/nim-lang/Nim/blob/devel/tools/vccexe/vccexe.nim |
06:47:15 | FromDiscord | <demotomohiro> Probably no one have ever tried to use Nim with such a old vc version. |
06:49:31 | FromDiscord | <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:25 | FromDiscord | <Bung> ` re"stream(.)endstream"` does not work for finding string between them |
07:00:50 | * | ltriant quit (Ping timeout: 240 seconds) |
07:01:15 | FromDiscord | <huantian> Hm maybe itās because itās a binary stream? I havenāt used regex for that before |
07:01:32 | FromDiscord | <huantian> (At least Iād assume itās a binary stream, since itās a jpeg) |
07:02:49 | * | ltriant joined #nim |
07:06:09 | FromDiscord | <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:23 | FromDiscord | <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:12 | FromDiscord | <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:27 | FromDiscord | <demotomohiro> Nim's compiler options are explained here: https://nim-lang.org/docs/nimc.html |
07:41:32 | FromDiscord | <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:50 | FromDiscord | <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:36 | FromDiscord | <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:39 | FromDiscord | <jmgomez> hey guys, |
08:16:57 | FromDiscord | <Elegantbeef> Hey Jmgomez what macro question do you have today? |
08:18:30 | FromDiscord | <jmgomez> (edit) "hey guys," => "sent a code paste, see https://play.nim-lang.org/#ix=3Z0e" |
08:18:45 | FromDiscord | <jmgomez> Sorry I hit enter before time |
08:19:23 | FromDiscord | <Elegantbeef> you dont put varTo in it |
08:19:31 | FromDiscord | <Elegantbeef> `varTo = ident"varTo"` |
08:26:36 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Z0f |
08:26:54 | FromDiscord | <Elegantbeef> `result = newStmtList()` |
08:27:00 | FromDiscord | <Elegantbeef> Wait never mind |
08:27:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/LaJ |
08:27:50 | FromDiscord | <Elegantbeef> Probably needs to be `result[^1].add:` |
08:32:21 | FromDiscord | <jmgomez> doesnt seem to like it neither :/ |
08:32:39 | FromDiscord | <Elegantbeef> I just wish someone had the forsight to implement error messages in the compiler |
08:33:58 | FromDiscord | <jmgomez> I think I will end up by just creating the ast structure needed |
08:34:09 | FromDiscord | <Elegantbeef> Just provide the friggin error message |
08:34:36 | FromDiscord | <jmgomez> ohh it's the same Error: undeclared identifier: 'varTo' |
08:35:03 | FromDiscord | <Elegantbeef> You didnt pass in `varTo = ident"varTo"` did you? |
08:35:37 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Z0i |
08:36:07 | FromDiscord | <jmgomez> I did. That's a WIP prop3 have the same type |
08:36:24 | FromDiscord | <Elegantbeef> after you assign result do `echo result.treerepr` and send it here |
08:38:37 | FromDiscord | <jmgomez> sent a long message, see http://ix.io/3Z0j |
08:38:54 | FromDiscord | <Elegantbeef> You removed the indentation |
08:38:56 | FromDiscord | <Elegantbeef> This is literally unreadable š |
08:39:06 | FromDiscord | <Elegantbeef> Oh nvm just matrix |
08:39:21 | FromDiscord | <Elegantbeef> ok so then yes what i said should work |
08:39:42 | FromDiscord | <Elegantbeef> I mean why are you even using `varTo` why not just use `result` |
08:40:32 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Z0k |
08:43:14 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3Z0l |
08:48:49 | FromDiscord | <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:40 | FromDiscord | <Elegantbeef> I forgot to pass that in in the last generation logic |
08:50:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Z0m |
08:51:50 | FromDiscord | <jmgomez> the error is actually on the prev, where it was passed |
08:52:46 | FromDiscord | <Elegantbeef> Hmmmph |
08:54:35 | FromDiscord | <Elegantbeef> you may want to pass in `ident="prop3"` but idk |
08:54:46 | FromDiscord | <Elegantbeef> this is off |
08:55:48 | FromDiscord | <jmgomez> no worries, will do it the AST way for the part where I do the assignations |
08:56:05 | FromDiscord | <jmgomez> thanks for the time, learned a few tricks more! |
08:56:52 | FromDiscord | <jmgomez> btw a bit unrelated but is it possible to override cpp virtual functions? |
08:58:44 | FromDiscord | <Elegantbeef> I'm still in the land of "people use the CPP backend?!" š |
09:00:04 | FromDiscord | <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:15 | FromDiscord | <Elegantbeef> Oh i know |
09:00:22 | FromDiscord | <Elegantbeef> I jusut dont have any reason to use it |
09:01:14 | FromDiscord | <jmgomez> arent you into gamedev? |
09:01:20 | FromDiscord | <Elegantbeef> Yea |
09:01:39 | FromDiscord | <jmgomez> hmm lot of things are built on cpp, what do you use? |
09:01:49 | FromDiscord | <Elegantbeef> Opengl + sdl2 + assimp presently |
09:02:05 | FromDiscord | <Elegantbeef> I'd much prefer C apis to C++ apis when it comes to code to depend upon |
09:02:43 | FromDiscord | <jmgomez> ohh I see, makes sense. Maybe one day you would like to take a look at UE š |
09:02:53 | FromDiscord | <Elegantbeef> Nope i despise epic |
09:03:31 | FromDiscord | <jmgomez> they mostly sucks but the tech is crazy |
09:03:44 | FromDiscord | <Elegantbeef> Sure but I need the tech like i need a car crash |
09:03:51 | FromDiscord | <Elegantbeef> Have you seen my present project? |
09:04:10 | FromDiscord | <jmgomez> lol, no I havent is it out there? |
09:04:36 | FromDiscord | <Elegantbeef> Here's a vidja |
09:04:46 | FromDiscord | <Elegantbeef> Damn i upped my bitrate a bit that's 40MB for like 10s |
09:05:02 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> Not like i need nanite or any of the other tech they have to offer š |
09:08:16 | FromDiscord | <jmgomez> looks pretty cool! |
09:08:20 | FromDiscord | <jmgomez> congrats |
09:08:33 | FromDiscord | <Elegantbeef> Thanks |
09:10:17 | FromDiscord | <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:40 | FromDiscord | <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:18 | FromDiscord | <Elegantbeef> I am delaying my work towards particle systems though |
09:13:48 | FromDiscord | <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:59 | FromDiscord | <Elegantbeef> Need to start with an API and dogfood it like my GUI |
09:14:05 | FromDiscord | <Elegantbeef> Man i love my GUI API now |
09:14:08 | FromDiscord | <Rika> I thought I was in the game dev channel by mistake |
09:14:15 | FromDiscord | <Elegantbeef> Lol |
09:14:25 | FromDiscord | <Elegantbeef> Hey no one else is talking and this is nim related so i'm staying! š |
09:18:21 | FromDiscord | <jmgomez> haha, what are you using for the GUI? |
09:18:29 | FromDiscord | <Elegantbeef> My own |
09:18:50 | FromDiscord | <Elegantbeef> I have this quite good retained mode API |
09:19:05 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/981124648366403584/image.png |
09:19:34 | FromDiscord | <Elegantbeef> Using closures for pretty much all of the retaining, it makes a fantastic declarative GUI |
09:19:39 | FromDiscord | <jmgomez> ohh the api looks great |
09:20:23 | FromDiscord | <Turgut> does Nims macro/template system provide anything special that most other languages do not? |
09:20:24 | FromDiscord | <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:55 | FromDiscord | <Elegantbeef> Well it's a macro system so you can introspect all of the code you giveāµ(@Turgut) |
09:21:15 | FromDiscord | <Elegantbeef> Typed macros have access to all of the types and the like |
09:21:26 | FromDiscord | <Elegantbeef> I think languages with macro systems will have the same |
09:21:45 | FromDiscord | <Turgut> im looking for Nim-specifics that other languages may not have |
09:21:59 | FromDiscord | <jmgomez> Does other typed langs allows you to modify their AST? |
09:22:07 | FromDiscord | <Rika> Those with macros do |
09:22:25 | FromDiscord | <jmgomez> Which one? |
09:22:44 | FromDiscord | <Rika> Technically perhaps rust? |
09:23:45 | FromDiscord | <Elegantbeef> Rust macros dont |
09:23:50 | FromDiscord | <Elegantbeef> Rust macros are token macros |
09:23:59 | FromDiscord | <Elegantbeef> Procedural work a bit more like Nim's templates afaik |
09:24:18 | FromDiscord | <Elegantbeef> Nim-like macros are relatively uncommon |
09:24:59 | FromDiscord | <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:07 | FromDiscord | <Rika> Arenāt token macros ālower levelā and therefore have equivalent functionality but with more work? |
09:25:21 | FromDiscord | <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:29 | FromDiscord | <Elegantbeef> Token macros are higher level afaik |
09:25:45 | FromDiscord | <Elegantbeef> You get a stream of tokens and operate on them like if you got a `seq[Ident]` |
09:25:47 | FromDiscord | <Elegantbeef> I could be wrong |
09:25:48 | FromDiscord | <Rika> I think he wants Nim specifics related to macros |
09:26:05 | FromDiscord | <jmgomez> In reply to @Elegantbeef "If you want Nim": Plus C++ interop. Rust C++ interop just sucks |
09:26:26 | FromDiscord | <Rika> In reply to @jmgomez "That's what I thought.": I believe a few languages could, but do not |
09:27:00 | FromDiscord | <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:01 | FromDiscord | <Rika> Maybe not, trying to think harder about it |
09:28:12 | FromDiscord | <Elegantbeef> You can theoretically do it with any language with macros |
09:28:25 | FromDiscord | <Elegantbeef> The issue is that it's not as nice in rust for example |
09:28:40 | FromDiscord | <Elegantbeef> Since rust does explicit macro calls and does not have command syntax |
09:28:45 | FromDiscord | <Rika> ~~rust async is a mess even without macros usage Iāve heard~~ |
09:29:24 | FromDiscord | <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:02 | FromDiscord | <Rika> I donāt know the specifics of why theyāre bad but Iād like to know lol |
09:30:55 | FromDiscord | <Elegantbeef> https://kevinhoffman.medium.com/rust-async-and-the-terrible-horrible-no-good-very-bad-day-348ebc836274 š |
09:32:26 | FromDiscord | <Elegantbeef> I dont recall their complains presently, so cannot really say what they saidi |
09:35:34 | FromDiscord | <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:51 | FromDiscord | <Elegantbeef> They're both experimental but are quite interesting and powerful ideas |
09:36:17 | FromDiscord | <Turgut> thanks very much @ElegantBeef |
09:36:45 | FromDiscord | <Elegantbeef> There are also dot operators there |
09:38:14 | FromDiscord | <Rika> TRMs are especially experimental |
09:38:20 | FromDiscord | <Rika> Slated for removal as well I believe |
09:38:27 | FromDiscord | <Elegantbeef> And marked for removal |
09:38:30 | FromDiscord | <Elegantbeef> Yea |
09:38:33 | * | adium quit (Ping timeout: 246 seconds) |
09:38:34 | FromDiscord | <Elegantbeef> Sadly |
09:38:42 | FromDiscord | <Rika> Same with the AST based overloading afaik (unfortunately for this one) |
09:38:56 | FromDiscord | <Rika> I think TRMs are too crazy so Iām not that saddened by itās removal |
09:39:19 | FromDiscord | <Elegantbeef> I mean they give you power when you need it and hidden enough most people arent going to reach for them |
09:40:08 | FromDiscord | <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:34 | FromDiscord | <Rika> Iād assume they do add a good bit |
10:05:36 | FromDiscord | <Josef> Can I use specific MSVCR.dll with nim? |
10:24:12 | FromDiscord | <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:50 | FromDiscord | <Josef> What's the point in macros, if you have full comptime evaluation? |
10:36:01 | FromDiscord | <Josef> (edit) "full" => "firstclass" |
10:37:48 | FromDiscord | <planetis> In reply to @Josef "What's the point in": that's what const does, so different things? |
10:38:58 | FromDiscord | <Here> In reply to @Josef "What's the point in": Dynamically accessing things in a static language |
10:39:06 | FromDiscord | <Josef> Well, once you have comptime evaluation, the only thing that macros give you is custom syntax. |
10:39:54 | FromDiscord | <Here> My main macros are mostly called "hasField" and "getField" |
10:40:02 | FromDiscord | <planetis> I guess so and also being able to generate a ton of code |
10:40:13 | FromDiscord | <Here> For that I tend to use templates |
10:41:05 | FromDiscord | <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:35 | FromDiscord | <Josef> But you don't have to generate code if you have comptime eval in the first place. |
10:42:17 | FromDiscord | <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:43 | FromDiscord | <Josef> (edit) "potential bugs." => "arcane compile errors." |
10:42:48 | FromDiscord | <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:28 | FromDiscord | <Here> And macros are compile time evaluated, at least the very simple ones I write |
10:43:51 | FromDiscord | <Josef> Can you show an example of this ugly code in comparison to macros? |
10:46:25 | FromDiscord | <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:44 | FromDiscord | <Here> Then compare that to the "dot" macro in norms macro module |
10:47:01 | FromDiscord | <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:58 | FromDiscord | <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:26 | FromDiscord | <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:42 | FromDiscord | <Josef> In reply to @Isofruit "Then compare that to": I will take a look, thanks. |
10:51:44 | FromDiscord | <planetis> well it depends on what are you trying to achieve |
10:56:29 | FromDiscord | <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:27 | FromDiscord | <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:11 | NimEventer | New thread by Slangmgh: How to disable implicit convert float to int., see https://forum.nim-lang.org/t/9187 |
10:58:48 | FromDiscord | <Josef> Well, I could for want a futamura projection: `compiler = interpreter.evaluate(interpreterInStaticString)` |
10:58:59 | FromDiscord | <Josef> (edit) "Well, I could for ... want" added "example" |
11:03:44 | FromDiscord | <Rika> And what benefit would that have over a macro |
11:08:50 | FromDiscord | <Josef> You won't work Nim AST directly => less bugs, easier to read compile errors, probably also faster. |
11:08:58 | FromDiscord | <Josef> (edit) "You won't work ... Nim" added "with" |
11:10:30 | * | averell quit (Ping timeout: 252 seconds) |
11:10:58 | FromDiscord | <Rika> How so? |
11:11:07 | FromDiscord | <planetis> why faster? |
11:11:49 | FromDiscord | <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:43 | FromDiscord | <planetis> there are many ways to work with macros, use whichever is easier depending on the case |
11:14:18 | FromDiscord | <planetis> this generates safe enum conversions https://github.com/planetis-m/dumpster/blob/master/utils/safeenums.nim |
11:14:43 | FromDiscord | <planetis> it's not harder to write unless you don't know the ast you need to generate |
11:15:20 | FromDiscord | <planetis> here a comp time matrix transpose https://github.com/planetis-m/dumpster/blob/master/vectorisation/ctranspose.nim |
11:16:12 | FromDiscord | <planetis> (these are just demos to answer forum questions and nothing serious) |
11:21:43 | FromDiscord | <Josef> sent a long message, see http://ix.io/3Z0O |
11:23:38 | FromDiscord | <Rika> How would code transformation work without the AST transformation Iām not too sure |
11:23:54 | FromDiscord | <planetis> which language do you work with? |
11:23:59 | FromDiscord | <Rika> Nim wonāt remove macros, Nim wants to allow ācustom syntaxā |
11:24:11 | FromDiscord | <Rika> In reply to @planetis "which language do you": I assume Zig, ācomptimeā is from Zig |
11:24:38 | FromDiscord | <planetis> is serde serialization faster with its tuples, I doupt |
11:26:56 | FromDiscord | <demotomohiro> In macro, you can access given expressions or statements as AST. AST makes easier to scan or modify rather than strings. |
11:27:23 | FromDiscord | <Entikan> sent a code paste, see https://paste.rs/cjY |
11:28:31 | FromDiscord | <Rika> .mitems |
11:28:41 | FromDiscord | <Rika> Before the colon |
11:28:54 | FromDiscord | <demotomohiro> `for foo in seqOfFoos.mitems:` |
11:29:59 | FromDiscord | <Entikan> Nice. Thanks! |
11:43:36 | FromDiscord | <planetis> sent a code paste, see https://play.nim-lang.org/#ix=3Z0S |
11:43:41 | FromDiscord | <planetis> ...so someone should make a comptime macro |
11:44:29 | FromDiscord | <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:32 | NimEventer | New 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:39 | NimEventer | New 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:47 | c0re1 | hello everyone! |
17:51:07 | PMunch | Hello |
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 |