<< 17-04-2020 >>

00:00:12FromDiscord<KingDarBoja> Ofc, being developed by Microsoft... that's what you get
00:00:21FromDiscord<KingDarBoja> Like C# is Microsoft Java
00:00:29audiophileoh I see
00:00:29krux02_that is how it started
00:00:41audiophileas long as it gets rid of the weak typing I'm cool with it haha
00:00:43companion_cubestill much better than js
00:00:49krux02_KingDarBoja: C# started as a Java fork.
00:00:52FromDiscord<KingDarBoja> Yeah, agreed
00:00:55FromDiscord<KingDarBoja> oh
00:01:16krux02_Embrace Extend Exterminate, they tried with java, got sued, and then they had to call their fork C#.
00:01:31FromDiscord<KingDarBoja> Wait what
00:01:48krux02_yes
00:02:13krux02_they really wanted to dominate Java.
00:03:24krux02_https://www.cnet.com/news/sun-microsoft-settle-java-suit/
00:03:44*Tlongir joined #nim
00:05:20krux02_> Though Microsoft may clone Java, it won't be allowed to say its products are Java-compatible.
00:05:52*krux02_ is now known as krux02
00:06:12FromDiscord<KingDarBoja> Reading the article, hold on
00:06:29*FromDiscord <KingDarBoja> Then Sun's lawsuit froze Microsoft's plans to modify Java for its own benefit, and Java became established in the meantime.
00:09:28FromDiscord<KingDarBoja> Well, although Java phrase is "Code Once, Run Everywhere", since Sun got bought by Oracle, the language has been more limited to the public on every new version
00:14:18Yardanicooh nice not everyone's asleep :P
00:14:35Prestigeo/
00:16:16FromDiscord<KingDarBoja> πŸ˜„
00:18:17Yardanicotime to continue reading this craftinginterpreters book, so far most of the stuff is not new for me (like recursive-descent parsing, lexing, etc), although scoping stuff is interesting
00:18:35Yardanicoalso it's additional excersise to translate Java to Nim as you read the book :P
00:18:51PrestigeYardanico: learning for fun?
00:18:51audiophileare you interested in compilers?
00:18:57audiophilecompilers is the only course I nearly flukned
00:19:00audiophile*flunked
00:19:11YardanicoPrestige: yeah, why not
00:19:28Yardanicomaybe I'll make my own best (TM) language /s
00:19:32FromDiscord<KingDarBoja> https://www.reddit.com/r/java/comments/a0ngus/explain_the_java_no_longer_free_for_commercial/
00:19:41*hoffentlichja quit (Ping timeout: 256 seconds)
00:19:52PrestigeI'd love to work on a language, even if it were just to learn
00:19:55audiophilerelevant xkcd https://xkcd.com/927/
00:20:05Yardanicoso far the most surprising thing is that I'm really just using a few nim std modules
00:20:20PrestigeI've never gotten into anything very low level before though
00:20:39Yardanicotables for the environment (scoping), strformat for formatting a few error messages, "os" for reading files, strutils for some string stuff
00:21:20Yardanicobut I'm still not in the end of the first part of the book where all fun (functions, classes, etc) happens
00:21:29audiophilewait what book
00:21:35Yardanicoaudiophile: http://www.craftinginterpreters.com/
00:21:53audiophileoh nice thanks!
00:22:01audiophileis it good for those new to this?
00:22:09Yardanicoin the book you basically write two interpreters for the same language Lox, first one in Java (I'm doing it in Nim instead), second in C (I'm not sure which one to choose yet though)
00:22:26audiophileohh
00:22:42audiophileare you open sourcing your code by any chance
00:22:45Yardanicoyes
00:22:49audiophileok :)
00:23:14YardanicoI only had a bit of experience with recursive descent before reading the book (https://github.com/Yardanico/nim-mathexpr/), but it's quite interesting
00:23:28FromDiscord<KingDarBoja> ❀️ Dart
00:23:35audiophileso this book might give you more ideas for your nimexpr
00:23:41FromDiscord<KingDarBoja> Like the Google TypeScript but without JS cons
00:24:00YardanicoMy source is in https://github.com/Yardanico/nim-lox , there is also https://github.com/cabhishek/nimlox but I don't look into it because I want my own implementation :)
00:24:12*Tyresc quit (Quit: WeeChat 2.9-dev)
00:24:12Yardanicoyou might compare them both but mine's not complete yet since I only completed chapter 8
00:24:22audiophileah that's ok!
00:24:33audiophileI star your repo because I will follow closely >_>
00:25:05audiophilewhy interpreter? because it is easier than writing a compiled language?
00:25:14FromDiscord<KingDarBoja> I did the same cuz I like Yard
00:25:17Yardanicoaudiophile: well kinda yeah
00:25:28audiophileah ok
00:25:39audiophilebut it should still help understand what makes nim tick right?
00:25:42audiophileat least to some extent
00:25:46Yardanicoyeah
00:25:48YardanicoAST and stuff
00:25:50audiophileNICE
00:26:01Yardanicoalthough later in the book you implement a bytecode compiler and a VM
00:26:02audiophileI've been emailing senior devs around asking for help on how to approach this
00:26:10audiophileVM meaning something like the jvm?
00:26:10audiophilekinda
00:26:18Yardanicoaudiophile: well, not that advanced
00:26:22Yardanicomore like in CPython
00:26:22audiophilekinda :)
00:26:25audiophileoh :(
00:26:31Yardanicoor NimScript I guess
00:26:44Yardaniconim compiler has an embedded VM too
00:26:49Yardanicofor running nim at compile-time
00:27:02audiophileI'm a bit fuzzy on compiling etc so I'm lost here ?
00:27:32*FromDiscord <KingDarBoja> I get lost everytime after reading some comments
00:27:58companion_cubehow do I make an openArray from a `ptr T` and a length?
00:28:13Yardanicocompanion_cube: openarray is not a concrete type
00:28:49Yardanicomeaning you can't create variables of this type
00:28:59*ZoomZoomZoom quit (Read error: Connection reset by peer)
00:29:08companion_cubeoh, it's only for arguments? ok
00:29:09Yardanicoit's meant to be used when you want some routine to accept different container types like seqs/strings/arrays
00:29:20companion_cubeI actually just want to print the pointer's content
00:29:23companion_cubefor debug purpose
00:29:30Yardanicowell you can cast it to UncheckedArray
00:29:50companion_cubehow do I set the length though?
00:30:37Yardanicoyou don't :P
00:30:50audiophilewhat you mean by concrete type
00:30:51audiophilebuiltin/
00:30:52audiophile?
00:31:12companion_cubeYardanico: so that doesn't help me putting my ptr+len into a `fmt"…"` :D
00:31:26Yardanicocompanion_cube: you can cast to UncheckedArray and make a seq out of it
00:31:41Yardanicolike for i in 0..<mylen: myseq[i] = myunchedkarray[i]
00:32:02Yardanicoaudiophile: for some info on that there's https://en.wikipedia.org/wiki/Abstract_type
00:32:13companion_cubeugh, that allocates and stuff :D
00:32:19YardanicoI can't really explain since I don't know a lot about this topic, but I kinda can understand in my head the difference between the two :P
00:32:33audiophileI think I've come across abstract in oop in java
00:32:41FromDiscord<KingDarBoja> I do
00:33:14FromDiscord<KingDarBoja> But I prefer a image to explain this
00:34:06PrestigeAttempting to create my own type/object, is there a way to initialize one of its members without it being passed in as a constructor argument?
00:34:27audiophilewhats an equivalent to turtle library from python? for drawing lines etc
00:34:59*inv2004 quit (Read error: Connection reset by peer)
00:34:59FromDiscord<KingDarBoja> You could init that on the constructor body
00:35:22FromDiscord<KingDarBoja> OMG my internet is trash again
00:35:53YardanicoPrestige: if you mean default fields in type type itself, that's not (yet) there
00:36:06Yardanicobut you can just create (and it's better to) a constructor for your type
00:36:11zacharycarterGot hot reloading working via a plugin system and `--gc:arc`: https://github.com/zacharycarter/junkers - still lots of testing to do but so far looks promising
00:36:17Yardanicobtw the convention is initType for "object" types and newObject for "ref object"
00:36:18PrestigeI meant a new type, I guess I just haven't ran into docs about contructors yet
00:36:28YardanicoPrestige: constructors are just ordinary procs
00:36:29FromDiscord<KingDarBoja> +1 for Yard tip
00:36:46Yardanicolike I have
00:36:47Yardanicoproc newParser*(tokens: seq[Token]): Parser = Parser(tokens: tokens)
00:36:47Prestigeoh so I'd just create a proc with w/e name to initialize the object?
00:36:53Prestigeokay, cool thanks
00:45:16audiophileguise where/how do i learn metaprogramming, macros?
00:48:25*FromDiscord <KingDarBoja> To learn how to macro, you must become a macro
00:50:53*rmnull joined #nim
00:50:53FromGitter<matrixbot> `nerdrat` Hello everyone today I updated nim with `choosenim update stable`. However after creating a project with `nimble init` I try to build the binary with `nimble build` but stops trowing the following error: ⏎ ⏎ ```$ nim c -d:danger koch.nim ⏎ $ ./koch --latest nimble``` ⏎ ⏎ But it didn't solved the problem. [https://gitter.im/nim-lang/Nim?at=5e98fd6d2ff88975b425ec8c]
00:51:48leorize[m]@nerdrat: join us here on IRC at #freenode_#nim:matrix.org
00:52:17*nerdrat[m] joined #nim
00:52:34leorize[m]what version of choosenim are you on?
00:53:30nerdrat[m]<leorize[m] "what version of choosenim are yo"> Latest, I did `choosenim update self` first.
00:54:06nerdrat[m]I think is `v0.6.0`
00:54:18leorize[m]what does `nim --version` give you?
00:55:01nerdrat[m]<leorize[m] "what does `nim --version` give y"> ```
00:55:16Yardaniconerdrat[m]: it got stripped in IRC
00:55:27Yardanicowe can't see :P just tell the version and (possibly) the hash
00:55:50leorize[m]please don't use the reply function in matrix
00:56:02leorize[m]the IRC way is to just mention people
00:56:18nerdrat[m]Ok it is 1.2.0 leorize[m]
00:56:24*hoffentlichja joined #nim
00:56:33leorize[m]hmm, you're on the latest
00:56:36leorize[m]what's your nimble version?
00:56:44leorize[m]`nimble --version`
00:57:11nerdrat[m]v0.11.0
00:58:27leorize[m]ping dom96, shashlick
00:58:31nerdrat[m]I also cleaned the cache leorize[m].
01:00:24leorize[m]I've no idea why it doesn't work then, hopefully the choosenim authors I pinged will have some ideas
01:01:47nerdrat[m]The issue in github is closed, I don't know what else can I do. leorize[m]
01:02:09leorize[m]you don't have to ping me for every message :P
01:02:18leorize[m]can you link the issue here?
01:02:31nerdrat[m]Sorry
01:02:55nerdrat[m]https://github.com/nim-lang/nimble/issues/693
01:02:57disbot_βž₯ Document how to recover from corrupted nimble cache ; snippet at 12https://play.nim-lang.org/#ix=2ilH
01:05:40leorize[m]can you try to compile a file with just `import strformat`?
01:05:56*chemist69_ joined #nim
01:08:32nerdrat[m]It gives me the same error using `nim c -r myproject.nim`
01:08:32nerdrat[m]`Error: cannot open file: strformat`
01:08:59*chemist69 quit (Ping timeout: 256 seconds)
01:09:01leorize[m]looks like your nim installation is botched
01:09:16leorize[m]can I have the output of `nim dump`?
01:10:27*nerdrat[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/RNfVdGGYhxGuCmjNvSrATznx >
01:11:12leorizetry reinstalling nim then
01:11:29leorizeyour nim installation seems to be corrupted
01:11:34disrupteknimph includes a working choosenim, fwiw.
01:11:38disruptek!repo nimph
01:11:38disbot_https://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 59⭐ 4🍴 7& 1 more...
01:13:21nerdrat[m]I simply delete the `.choosenim/toolchains/nim-1.2.0/` or how can I reinstall nim with choosenim?
01:13:35leorize`choosenim stable`?
01:13:40leorizeI'm not sure, I don't use choosenim
01:15:38nerdrat[m]Dammit! I'll select another toolchain that works and then I'll delete the toolchain directory of nim-1.2.0.
01:16:53nerdrat[m]I hope this doesn't break anything else
01:18:27*ryan_ joined #nim
01:19:32disruptekwhat is choosenim buying you, here?
01:19:51shashlickCommon disruptek, not this again
01:20:02disruptekwhat?
01:20:30disruptekyou think i put this user up to this?
01:20:34*Tlongir quit (Ping timeout: 240 seconds)
01:21:17shashlickQuit your bashing
01:21:37disruptekquit trying to justify poor software behavior.
01:22:00disruptekoh, actually you aren't doing so. or helping the user. my bad.
01:22:03*lritter quit (Ping timeout: 250 seconds)
01:22:05shashlickGosh, way to inspire
01:22:24disrupteki agree. i'm tired of merely accepting the status quo.
01:22:51disrupteki wish you were, too.
01:23:04*lritter joined #nim
01:23:27shashlicknerdrat: agree with leorize, would have helped to see contents of the lib directory
01:24:29shashlickSeems like an extraction issue of some sort with nimarchive
01:32:49*krux02 quit (Ping timeout: 252 seconds)
01:33:17FromDiscord<Zed> this may get a biased answer, but how do you guys find nim against crystal?, im wanting to learn one or the other
01:33:22*hoffentl1chja joined #nim
01:33:51disruptekdepends on what you want to write.
01:34:03nerdrat[m]Crystal is a bloated ruby copy
01:34:09*krux02 joined #nim
01:34:17*hoffentl1chja left #nim (#nim)
01:34:17FromDiscord<Zed> more embedded things, raspberry pi etc..
01:34:39FromDiscord<Zed> why do you say that?
01:35:16disrupteki don't really think crystal is comparable for that.
01:35:35*hoffentlichja quit (Disconnected by services)
01:35:53leorize[m]crystal leans a bit further on the application programming spectrum than we do
01:36:55nerdrat[m]leorize[m]: Reinstalling nim-1.2.0 didn't work
01:36:57disrupteki'm trying to think of anyone in the nim community that writes crystal, but i'm drawing a blank.
01:37:35FromDiscord<Zed> lol, what would say nim is best used for?
01:37:49FromDiscord<Varriount> leorize: I like to think Nim is suitable for application development too
01:37:51shashlicknerdrat: can you check the lib directory for contents
01:39:06nerdrat[m]I checked `strformat.nim` is where it should be.
01:39:39nerdrat[m]inside the `pure` directory
01:39:49shashlickdoes it have anything in it
01:40:17shashlickwell, the error says file not found so hm
01:40:30shashlickcan you zip the entire folder and post it somewhere
01:41:14disrupteknim is like a more elegant python that is hugely performant and has the chops to compete with lisp in terms of abstraction.
01:41:17nerdrat[m]yes 713 lines of nim code
01:41:33FromDiscord<KingDarBoja> Hold my beer
01:41:41disrupteki think crystal is a supercharged ruby. if ruby is what you want, crystal lets you make it run faster.
01:42:00zacharycarterdoes crystal have windows support yet?
01:42:08FromDiscord<Zed> nope
01:42:08disruptekit has no place in my toolbox, so i can't speak on it much. no, no windows support afaik.
01:42:22zacharycarteryeah - still not interested in it then
01:42:22*naught-fowl quit (Remote host closed the connection)
01:42:30FromDiscord<Zed> the only way you can get windows support is if you run a linux subsystem
01:42:32zacharycarterprobably won't be when it does
01:42:35shashlickalso can you zip the ~/.choosenim folder (without toolchains)
01:42:50zacharycarterI like Nim - and Nim is getting better afiact
01:42:57zacharycarterafaict
01:42:57FromDiscord<KingDarBoja> No windows = Not my interest
01:42:58shashlickpresuming you are on linux
01:43:11FromDiscord<Zed> crystal seems to have more libraries for it then nim does
01:43:29disruptekyou have to understand that nim boils down to really simple C that can be compiled and run anywhere, very quickly. simple C that is infinitely portable and offers little undefined behavior.
01:43:31zacharycarteryeah but extending Nim's ecosystem is simple
01:43:38zacharycarterjust find a comparable C/C++ library and write bindings to it
01:44:01disruptekdoes crystal compile to javascript?
01:44:03Yardanicodisruptek: well crystal uses LLVM and LLVM isn't exactly bad at portability between popular OSes
01:44:21*hoffentlichja joined #nim
01:44:27zacharycarterWindows is pretty popular
01:44:31zacharycarterand Nim has nlvm
01:44:34YardanicoZig works on most major OSes which support LLVM fwiw
01:44:48Yardanicolinux, macos, windows, freebsd, netbsd, and probably others if you can compile llvm on them
01:44:50disrupteki think my dad uses windows. it's blue, right?
01:44:52zacharycarteryeah but Zig is extremely immature and doesn't have async or netcode yet
01:44:59Yardanicozacharycarter: it does have async though
01:45:06zacharycartera preliminary release of it
01:45:15FromDiscord<Zed> I think V is a better zig
01:45:20Yardanicono
01:45:23zacharycarterI think V is vaporware
01:45:25disrupteklol
01:45:28Yardanicopls don't bring V into discussion
01:45:32Yardanicodisruptek: btw glad to see you back :P
01:45:36disruptekzig is a legit v, maybe.
01:45:37FromDiscord<Zed> why not?
01:45:40disruptekYardanico: o7
01:45:45Yardanicobecause V is overhyped
01:45:54zacharycarterbecause the V author makes bold claims that never end up being accurate
01:46:01disruptekit's nothing.
01:46:07disruptekno rule.
01:46:09Yardanicoalso V is a good example of why github stars are useless
01:46:10disruptekno role, rather.
01:46:30zacharycarterIf you want to compare all these languages - my suggestion - try to build something with them
01:46:38zacharycarterthen you'll have something to back your speculation
01:46:50disruptekgood advice.
01:46:57zacharycarterI've tried doing what I do with Nim with Zig and I hit major roadblocks
01:47:04FromDiscord<Zed> what would your default project be?
01:47:10zacharycarterI can't use Crystal because there's no windows support
01:47:20Yardanicowell yeah I know Zig stdlib is really undocumented and there's no real network facilities yet
01:47:23zacharycartera game that doesn't use SDL2
01:48:20zacharycarterfor instance, with Nim I have this working right now - https://imgur.com/a/ExIVYLm
01:48:26disrupteki wrote a crossword solver as my first nim project.
01:48:32FromDiscord<Chiqqum_Ngbata> I began working on a project in nim and was doing this sort of comparison myself. Zig was appealing until I realized it wasn't at all documented (it is now but at the time it wasn't)
01:49:03zacharycarterdoesn't look like much but I'm using sokol_app, sokol_gfx, cr (For hot reloading plugins) and physfs
01:49:10Yardanicoyeah I tried writing some simple stuff with zig
01:49:42Yardanicohttps://github.com/Yardanico/zig-osureplay and a version of my recursive-descent math evaluator (it got lost when I cleaned my home partition though)
01:50:14YardanicoI like cross-compilation in Zig so you don't have to build the cross-compilers yourself :P and you can already use it with nim
01:50:36FromDiscord<Chiqqum_Ngbata> Nim probably fits (personal opinion) a similar niche as Python; good for glue code, super readable, but obviously performs much better out of the box. Much more mature than Zig
01:50:42Yardanicoyeah
01:50:52YardanicoNim is the sweet spot between performance and code readability ;)
01:51:15disrupteki don't zig ever achieving the abstractions we can with nim's metaprogramming, though.
01:51:21disruptekit's a better C, sure.
01:51:22Yardanicoyeah, Zig is against all that
01:51:27disruptekbut we don't need another C.
01:51:36YardanicoZig's main goal is to be as explicit as possible :P
01:51:38FromDiscord<Chiqqum_Ngbata> I've enjoyed Nim in general. Some parts have felt hostile but I actually have a theory that weird warts is probably a good sign that there is less aversion to experimenting, and is ultimately a good thing
01:51:41zacharycarteryou can avoid cross compilation with Nim using nlvm too
01:51:42Yardanico"There is no hidden control flow, no hidden memory allocations, no preprocessor, and no macros. "
01:52:12Yardanicozacharycarter: well but Zig just acts as a C compiler (it bundles clang)
01:52:19Yardanicoalso it's a pretty small download for what it has
01:52:27Yardanicowell, not clang, but libclang
01:52:39FromDiscord<KingDarBoja> https://www.slant.co/versus/395/5522/~nim_vs_rust Random comparison link
01:52:42disruptekpretty heavy though, when you think about it.
01:52:54FromDiscord<KingDarBoja> Oops, wrong link
01:52:57Yardanico@KingDarBoja see https://www.slant.co/topics/6032/~systems-programming-languages btw
01:53:17disruptekjust ask yourself what these languages are going to be doing in 10 years.
01:53:18FromDiscord<KingDarBoja> Thank you πŸ˜„
01:53:22FromDiscord<Zed> nims at the top with the big boys
01:53:26FromDiscord<Zed> that's good
01:53:54Yardanicoyeah I added quite a lot of pros a few years ago :D
01:54:03Yardanico"Tiberium" there is me
01:54:08FromDiscord<Chiqqum_Ngbata> Unfortunately I don't really see a clear path to adoption for Zig. Rust serves basically the same niche, has significant features Zig doesn't, and Zig isn't radically simpler--common Rust complaint
01:54:25FromDiscord<KingDarBoja> _No big name backer_ as cons
01:55:07Yardanicoyeah ikr
01:55:26FromDiscord<KingDarBoja> Oh boy, there is Elixir
01:55:47FromDiscord<KingDarBoja> πŸ˜„ But I find the lack of distinction between the "system" programming category distrubing
01:55:52Yardanicoyeah
01:56:44FromDiscord<Zed> what about micro python?
01:56:52Yardanicowhat about it?
01:56:57FromDiscord<Zed> or is that basically nim but worse
01:57:02FromDiscord<KingDarBoja> I didn't expected Golang to be really focused on system
01:57:08leorizepython is always nim but worse :P
01:57:08Yardanicothat's entirely different from nim
01:57:14FromDiscord<KingDarBoja> As I pretty much heard it being used mostly for backend stuff
01:57:16Yardanicomicropython is python for microcontrollers
01:57:26FromDiscord<KingDarBoja> Whereas Rust is the big one for embedding and stuff like that
01:57:27Yardanicoand it's not the best option if you want your microcontrollers to be fast :P
01:57:56FromDiscord<KingDarBoja> Python is the big one besides Javascript for most stuff nowadays
01:58:10FromDiscord<KingDarBoja> As again, the syntax and the HUGE community and libraries has made it so popular
01:58:24leorizeIMO languages with fibers kinda restricted themselves from approaching low-level
01:58:26FromDiscord<KingDarBoja> But ofc doesn't mean it is the best
01:58:31FromDiscord<Zed> i see go mentioned alot
01:58:51FromDiscord<KingDarBoja> And where is my boy Dart
01:58:55FromDiscord<KingDarBoja> πŸ’”
01:59:06leorizeDart is DOA
01:59:11FromDiscord<KingDarBoja> DOA?
01:59:23leorizegoogle is desperately trying to keep it afloat with Flutter
01:59:30leorizedead-on-arrival
01:59:34FromDiscord<KingDarBoja> Ahhh
01:59:43FromDiscord<KingDarBoja> Well Flutter seems very comfortable to work on
01:59:53FromDiscord<KingDarBoja> Too bad it is only mobile mostly
02:00:03FromDiscord<Chiqqum_Ngbata> I think Flutter has a chance. It will become much more appealing if Fuschia sees daylight
02:00:05FromDiscord<KingDarBoja> But I find Dart like the TypeScript-brother
02:00:52shashlicknerdrat[m]: just tried installing choosenim and running the strformat test 25 times locally in a loop, no luck reproducing the issue so anything you can share will be helpful
02:01:27FromDiscord<KingDarBoja> But hey
02:01:34leorizenerdrat[m]: can you post the full output of running `nim c thing/that/import/strformat.nim`?
02:01:39FromDiscord<KingDarBoja> Ruby has been on DOA if it were by ROR
02:01:50FromDiscord<Zed> why doesn't google just merger fuchisa and android?
02:02:01FromDiscord<Zed> *merge
02:02:06leorizethey can't
02:02:08FromDiscord<KingDarBoja> Sounds easy, but doesn't
02:02:25leorizethey are fundamentally different
02:02:28leorizeactually they can
02:02:53leorizethey're google, they have the resources to put things together
02:03:07leorizethe blocker might just be that fuchisa is not ready yet
02:03:13Yardanicowell yeah, but they started Fuchsia to have a platform they can have full control of :P
02:03:27FromDiscord<KingDarBoja> Well what about V? I remember the Odin author blaming its perfomance
02:03:39Yardanicoa lot of false claims
02:03:40leorizeV stands for vaporware
02:03:54*dddddd quit (Ping timeout: 240 seconds)
02:04:02YardanicoAs I said before the only good V is https://github.com/belamenso/v
02:04:06*ryan_ is now known as number_one
02:04:41FromDiscord<KingDarBoja> WTF
02:04:44Yardanicook gonna continue my interpreter , need to figure out how to add break statement :P
02:04:58Yardanico@KingDarBoja I've also made a fork of it https://github.com/Yardanico/nim-emojify
02:05:12Yardanicoit uses different emojis instead of V
02:05:16FromDiscord<KingDarBoja> looool
02:05:35Yardanicotook me a while to figure out how it works the first time I looked at the src tbh
02:05:48FromDiscord<KingDarBoja> https://github.com/vlang/v/issues/35
02:05:49FromDiscord<Zed> https://www.emojicode.org/
02:05:50disbot_βž₯ This language is not as advertised ; snippet at 12https://play.nim-lang.org/#ix=27la
02:06:07Yardanico@KingDarBoja well right now they try to fix things
02:06:19Yardanicolike they actually have a proper AST now (they didn't until start of 2020 or something like that)
02:06:29FromDiscord<Zed> emojicode is the future guys
02:06:32Yardanicoyes
02:06:36Yardanicotime to write nim -> emojicode compiler
02:06:40FromDiscord<Zed> it's how the egyptians coded on their walls
02:07:01Yardanicoand they funniest thing is that it's fast
02:07:07Yardanicowritten in C and compiles to native code with LLVM
02:07:09FromDiscord<KingDarBoja> I do rather let V evolve
02:07:19FromDiscord<KingDarBoja> As everything has its own peaks and falls
02:07:30Yardanicoalso see https://andrewkelley.me/post/why-donating-to-musl-libc-project.html about some V language drama
02:07:36Yardanicoarticle by author of Zig
02:07:38leorizeto be fair after their marketing stunt I don't really trust V anymore
02:07:58leorizenot that I ever trusted their magical claims
02:08:00FromDiscord<Zed> V has a sponsor now as well
02:08:10Yardanicowho
02:08:13Yardanicoi'll find them'
02:08:19FromDiscord<KingDarBoja> The Doom Guy
02:08:25FromDiscord<Zed> https://www.mx.com/
02:08:31FromDiscord<Zed> some finance company
02:08:36leorizeV has more sponsors than Nim + Zig before it even release :)
02:08:56FromDiscord<Zed> it's actually a front
02:09:05FromDiscord<Zed> the company is also vaporware
02:09:30Yardanicoleorize: well if Nim development started in 2015+ 4raq could've done the same hype thing :D
02:09:32FromDiscord<KingDarBoja> Idk but sponsors seems to be hard to earn as they will try to push things faster on the worst case (?)
02:09:34FromDiscord<Zed> pretend you have a sponsor to draw more sponsors in
02:09:43Yardanicobig brain
02:10:12FromDiscord<Zed> well anybody can setup a website and a product, doesn't mean it's real
02:10:16Yardanicoah yeah I also remember how V author did twitter polls to decide on language syntax
02:10:24leorizeYardanico: well you can try to find the original marketing of Nim in the Lazarus forums
02:10:34Yardanicoyeah I know it was like Pascal++ or something initially :P
02:11:02Yardanicoand I also know the compiler was in object pascal
02:12:08leorizewell let just say that the pascal people wasn't happy with Nim :P
02:12:22leorize4raq said the forum only spread FUD about Nim
02:12:28FromDiscord<KingDarBoja> FUD?
02:12:30Yardanicowow http://nimrod-lang.org/ still works
02:13:03Yardanico"FUD is an acronym for fear, uncertainty and doubt. "
02:13:18zacharycarterhttps://github.com/vlang/v/issues/35
02:13:19disbot_βž₯ This language is not as advertised ; snippet at 12https://play.nim-lang.org/#ix=27la
02:13:36Yardanicowell yeah some of these are fixed but generally it's true
02:13:57zacharycarteryes
02:15:00YardanicoI guess it's time to make my own language called V++ XDDDD
02:15:53Yardanicoalso I wonder why would you ever release an UI lib for your language in GPLv3 https://github.com/vlang/ui
02:16:08Yardanicomeaning that all apps which use it must be open-sourced
02:16:30leorizethey are a FOSS advocate :P
02:16:40zacharycarteralso lol at that UI lib's syntax
02:16:47Yardanicoalso what is this "verified" symbol https://github.com/vlang
02:16:53Yardanicocan nim org get it too? :P ask github support pls
02:16:54zacharycarteror interface rather
02:17:18Yardanicohttps://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/verifying-your-organizations-domain huh
02:17:20zacharycarterso much nesting
02:17:54zacharycarterthat's about the only thing they can verify when it comes to vlang
02:20:29Yardanicoprobably the "best" thing is that the docs mention
02:20:31Yardanico"(Work in progress) There's no garbage collection or reference counting. V cleans everything up during compilation. If your V program compiles, it's guaranteed that it's going to be leak free."
02:21:17disruptekhey, it's only been a year.
02:21:19disruptekgive them a break.
02:21:32Yardanicowell anyway I wonder how they'll implement this memory management model
02:21:39*muffindrake quit (Ping timeout: 272 seconds)
02:21:47Yardanicowhen they have raw pointers
02:22:11disruptekmaybe they'll figure out how to pivot to some other absurd claim in the next year.
02:22:41FromDiscord<KingDarBoja> I see Volt being mentioned but no idea how that related to Vlang
02:22:45leorize"V is the first language to use machine learning to provide leak-free memory safe code"
02:22:55zacharycarterlol
02:23:04YardanicoVolt is a multi-service chat client *supposedly* written in V and *supposedly* using vlang's UI lib
02:23:08disruptekV is the last language to use machine learning.
02:23:19FromDiscord<KingDarBoja> Also, didn't know there was so much criticism on V but ofc, it is better to not trust because scammers could show up
02:23:25kungtotteThey're working under the Dorothy model of software development where they make a claim, click their heels three times and wish for it really hard
02:23:30*muffindrake joined #nim
02:23:51Yardanico@KingDarBoja it would not receive critisicm if it didn't make very ambitious claims when it was in pre-alpha state
02:24:09FromDiscord<KingDarBoja> Yeah, I think the guy lost the focus and got too cocky
02:24:14FromDiscord<KingDarBoja> But let's see how it goes
02:24:14disruptekshashlick: just how many pairs of ruby slippers do you have in your closet?
02:25:21kungtotteI wonder how they're going to achieve hot code reloading since so many features depend on compiler magic
02:25:24FromDiscord<KingDarBoja> But holy cr*p that's a lot of money on patreon
02:25:34Yardanicojust for a simple example of ambitious claims
02:25:35Yardanicohttps://github.com/vlang/gitly
02:25:39Yardanicovery nice repository
02:25:43shashlickjust sold my favorite pair a week ago on Craigs
02:27:00disruptekdamnit.
02:27:09FromDiscord<KingDarBoja> Machine Learning Scam = Siraj Raval
02:28:10FromDiscord<KingDarBoja> Lol wtf that vlang repo
02:28:17Yardanicook lets stop talking about it already :P
02:28:22Yardanicowe have nim :)
02:28:54disrupteki heard there's a new package manager for nim where bugs aren't just fixed, they also inform features and growth in the compiler and the ecosystem as a whole.
02:29:07*FromDiscord <KingDarBoja> Mom, can we have Nim? We have Nim at home... Nim at Home: Python
02:29:08Yardanicodisruptek: wow how much does it cost?!
02:29:19disruptekmy bad. it's not new.
02:29:29Yardanico@KingDarBoja nim at home: Object Pascal
02:29:34FromDiscord<KingDarBoja> LOL
02:29:42disruptekpeople have been using it for six months and there have only been like 3 bugs reported.
02:29:44FromDiscord<KingDarBoja> Someone should start making Nim memes and share at offtopic
02:29:49Yardanicohttps://github.com/nim-lang/Nim/commit/405b86068e6a3d39970b9129ceec0a9108464b28
02:29:54Yardanicofor first commit in nim git repo
02:30:04Yardanicoand yes its object pascal
02:30:25Yardanicoalthough a lot of stuff looks the same as it is today :)
02:30:33Yardanicomost of the core language didn't change since then
02:31:13Yardanicohmm I actually got curious, gonna try to compile it
02:33:14Yardaniconimrod 0.2.1 version
02:39:31*krux02 quit (Remote host closed the connection)
02:39:32Yardanicohad to patch it a bit (change shell -> fpsystem since "shell" got removed in FPC) but it worked
02:39:34Yardanicoit actually compiled
02:39:50Yardanico"Nimrod Compiler Version 0.2.1* (2020/04/17 05:39:30) [Linux: amd64]"
02:42:13*oculux quit (Ping timeout: 250 seconds)
02:43:21Yardanicowait what
02:46:51leorizeYardanico: 4raq wrote pas2nim for a reason
02:46:56Yardanicoleorize: xddd
02:47:22leorizeyep, a lot of the code in the current compiler can be traced directly to the pascal code
02:48:02Yardanicoi know that :) really facsinating stuff
02:48:32FromDiscord<KingDarBoja> Awesome
02:48:37FromDiscord<KingDarBoja> Yard, how old are you mate?
02:48:45YardanicoI turned 20 today :D
02:48:46FromDiscord<KingDarBoja> I think I asked that before, right?
02:48:50FromDiscord<KingDarBoja> OH
02:48:55FromDiscord<KingDarBoja> Happy Birthday
02:48:57disruptekolder now.
02:48:59Yardanicothanks
02:49:01leorize[m]happy cake day
02:49:03FromDiscord<KingDarBoja> Someone make a Nim cake and put him a Crown
02:49:07disruptekπŸ‘‘
02:49:26leorize[m]πŸŽ‚ πŸ‘‘
02:49:45FromDiscord<KingDarBoja> Can we have a Nim emoji on Discord?
02:50:26YardanicoI'll try to add nim crown now
02:50:57leorize[m]looks like Nim is not only consisted of old people :P
02:51:01FromDiscord<Yardanico> @KingDarBoja :nim1:
02:51:08FromDiscord<KingDarBoja> Ewww
02:51:14FromDiscord<KingDarBoja> Better the goldish crown
02:51:19FromDiscord<KingDarBoja> Hold on
02:51:32Yardanicothe one on the website?
02:52:04FromDiscord<KingDarBoja> https://raw.githubusercontent.com/vscode-icons/vscode-icons/master/icons/file_type_nim.svg?sanitize=true
02:52:24Yardanicoyeah that's the website one
02:52:31Yardanicohttps://nim-lang.org/assets/img/logo.svg
02:52:36FromDiscord<KingDarBoja> Yeah, svg 32x32 for ya,
02:52:39PrestigeIs there a way to assign a variable to an iterator at the top level of a module?
02:52:42Yardanicosvg doesn't have a size
02:53:00Prestigeer assign an iterator to a variable*
02:53:10Yardanicowell you can do that, yes
02:53:14FromDiscord<KingDarBoja> Viewport if you wish
02:53:18leorize[m]yes you can, the syntax is weird though
02:53:23FromDiscord<KingDarBoja> And maybe the nimble box? πŸ˜„
02:54:04leorize[m]note that us IRC users can't see your custom emojis
02:54:10Yardanicoyeah
02:54:31FromDiscord<KingDarBoja> Oh :/
02:54:50PrestigeI can see them O.o
02:54:55Yardanicoyou can see the text
02:54:59Yardanicothey're icons on discord
02:55:08Prestigehttps://0x0.st/iQUw.png
02:55:25leorizethose are just unicode emojis
02:56:02leorizecustom emojis are stuff like this :nim1:
02:56:07FromDiscord<KingDarBoja> What chat is that? IRC?
02:56:09leorizewe can't see it, it's just text
02:56:51leorizethat's weechat
02:56:57leorizecustomized I think
02:57:05FromDiscord<KingDarBoja> I love how we moved from E-v-il topic into emojis
02:57:30FromDiscord<Yardanico> :nim1:
02:57:58FromDiscord<KingDarBoja> Awesome!
02:58:11FromDiscord<KingDarBoja> Much better than the black-gold one
02:58:30*FromDiscord <KingDarBoja> A crown for the king, all kneel before Yardanico
02:58:33Prestigeleorize: what was the syntax? I'm trying to do something like https://play.nim-lang.org/#ix=2im0
02:58:43disruptek~araq
02:58:43Yardanicowe have a real king who goes by the name of 4raq :P
02:58:43disbot_araq: 11πŸ‘‘ the powers that He πŸ‘‘ -- disruptek
02:59:10FromDiscord<Yardanico> @KingDarBoja :nimble:
02:59:28Prestigeoh you all meant the :text:
02:59:38leorize[m]Prestige: https://play.nim-lang.org/#ix=2im2
03:00:00YardanicoPrestige: on discord it's like this https://i.imgur.com/boZQxEH.png
03:00:07Prestigeah
03:00:16Prestigecome join us on irc Yardanico :P
03:00:25Yardanicowell I'm everywhere
03:00:26leorizehe is on irc
03:00:39disruptekonly chumps use irc.
03:00:43Yardaniconim forum, nim discord, nim gitter, nim telegram, nim github
03:00:43Prestigerip well all the discord folk come over
03:00:57YardanicoPrestige: well discord is more and more used for nim :)
03:01:03FromDiscord<KingDarBoja> nim whatssap?
03:01:06FromDiscord<KingDarBoja> Xd
03:01:10FromDiscord<KingDarBoja> NVM
03:01:16YardanicoNim server has 820 members as of now, but most of them are not really active
03:01:23leorize[m]if I use matrix to bridge discord here, then everyone from discord will appear as irc users :P
03:02:11Prestigeleorize[m]: that's interesting about the iterator example
03:02:18Prestigecan we just not specify the type?
03:02:24Yardanicoof course?
03:02:36Yardaniconim supports automatic type interference
03:02:54leorize[m]do specify the type if you have overloads though
03:02:56Yardanicoyou only need to use types in proc declaration/type declaration, in most other places it can be omitted
03:03:03Yardanicowell you also need to specify them with generics
03:03:09Yardanicobtw "auto" exists :P
03:03:28Yardanicoand yes it can be even used for proc arguments
03:03:48*audiophile quit (Ping timeout: 256 seconds)
03:03:55PrestigeI actually have a type/class that has the iterator as a member so I was hoping to type it, just curious how you'd write a type for that example
03:04:29leorize[m]Prestige: https://play.nim-lang.org/#ix=2im6
03:04:39leorize[m]or easier, just `echo typeof(variable)` and you'll know what to put in there
03:04:58Prestigeah I see, thanks
03:05:18leorize[m]closure iterators are really weird
03:05:18leorize[m]https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators
03:05:24leorize[m]take note of that before using them
03:05:59FromDiscord<KingDarBoja> A offtopic question (as most of you guys are on IRC)
03:06:21FromDiscord<KingDarBoja> Do you guys have a system engineer degree or something related?
03:06:29FromDiscord<KingDarBoja> Just curious
03:06:35leorizei don't have any degree
03:06:36YardanicoI'm 2nd year in uni (CS)
03:07:22FromDiscord<KingDarBoja> Noise, now I am feeling old here xD
03:07:31Yardanicohow old are you? :P
03:07:37FromDiscord<KingDarBoja> 26
03:07:39leorize[m]don't worry, we have our share of old people here too
03:07:50leorize[m]I think
03:07:54FromDiscord<KingDarBoja> No CS degree, only electronics & mechanical engineering
03:08:15Prestigeno degree, 25 and work as a software engineer
03:08:18Yardanicook now I have to figure out how to add break statement to my Lox interpreter (it's an exercise in the book)
03:08:20FromDiscord<KingDarBoja> Pushed into soft dev because no jobs for me
03:08:40Prestigetrying to cross over from JS land
03:08:46FromDiscord<KingDarBoja> Awesome Presti
03:09:01FromDiscord<KingDarBoja> IMO, JS land is blessed with TS
03:09:04FromDiscord<KingDarBoja> Ofc not perfect
03:09:20PrestigeYeah, I just spend a while writing documentation for TS so our company can switch over
03:09:24leorize[m]nah, JS land is blessed with Nim :)
03:09:27Prestigejust got approved by the VP this week
03:09:46PrestigeAnyone writing JS using nim? I'm curious how nice it is to work with
03:10:09Yardanicowell there's karax for SPA but I didn't try it
03:10:15leorize[m]I did write an app with it, but I'm not a frequent user
03:10:18Yardaniconim forum frontend is in Nim
03:10:33*rmnull quit (Quit: WeeChat 2.8)
03:10:36FromDiscord<KingDarBoja> karax ~= angular (?)
03:10:41leorize[m]alehander92 uses the JS backend a ton IIRC
03:10:48FromDiscord<KingDarBoja> ohhh
03:11:11leorize[m]according to an outdated benchmark, karax is lighter and faster than all major frameworks
03:11:40Prestigethat's pretty awesome
03:11:49FromDiscord<KingDarBoja> x2
03:12:05FromDiscord<KingDarBoja> Hopefully Nim will not have tons of libraries like JS on npm does
03:12:20FromDiscord<KingDarBoja> I mean, unnecessary, out of maintenance libraries
03:12:38leorize[m]we don't have unnecessary, but we do have rotting libraries
03:14:35Yardanicomy interpreter is finally turing complete :D https://github.com/Yardanico/nim-lox/blob/master/examples/testloop.lox
03:17:18PrestigeReading about methods vs procs, methods are preferred for new object types right? Also looks like it requires a base pragma, now
03:17:28Yardaniconot really
03:17:35leorizemethod and proc are different things
03:17:38leorizeyou can't compare them
03:17:42*FromDiscord <KingDarBoja> VSCode will raise a warning about using methods btw
03:17:44Yardanicothe preferred is still "proc" unless you need runtime dispatch
03:18:12Yardanicowhat warning?
03:18:18Yardanicoabout --multimethods:on ?
03:18:28Prestigeah I see, thanks
03:18:39FromDiscord<KingDarBoja> I think it was that, can't remember
03:18:47FromDiscord<KingDarBoja> But pretty much I use procs everywhere
03:18:54Yardanicoyeah, me too
03:19:02Yardanicothere are object variants too
03:19:03FromDiscord<KingDarBoja> Even when I code Python stuff, I started to use proc isntead of def
03:19:05PrestigeCool, just want to make sure I'm using best practices
03:19:06YardanicoI use them in my interpreter
03:19:37FromDiscord<KingDarBoja> Best practices is relative
03:19:46Yardanicohttps://nim-lang.org/docs/nep1.html for style guide btw
03:19:57Prestigesweet
03:20:02FromDiscord<KingDarBoja> But if someone with a good background suggest you something, better follow it
03:20:11FromDiscord<KingDarBoja> Okay I am writing non-sense
03:20:26Yardanicothis style guide also has a pretty good table of name conventions for identifiers
03:20:33disruptekprefer object variants to methods.
03:20:41Yardanicolike initT, newP, find, contains, add, etc
03:20:46disrupteker, s/methods/object inheritance/.
03:20:53leorizehttps://nim-lang.org/docs/apis.html
03:21:13Yardanicoyeah this table
03:21:13Prestigehow have I not stumbled upon that link
03:21:24leorizeiirc there were talks about removing methods and replace them with a macro
03:21:53disruptekstrongly doubt that'd happen.
03:22:09disruptekbut i expect dispatch performance will improve.
03:23:51disrupteki used to think that multi-methods were cool, and why would i not want that flexibility if it's supported? now i think it's pretty much a misguided feature.
03:24:47FromDiscord<KingDarBoja> I think I have followed everything except this
03:24:52*FromDiscord <KingDarBoja> The 'return' statement should ideally be used when its control-flow properties are required.
03:24:53disruptekprobably i just need to encounter fewer inheritance bugs.
03:25:08disruptekuse `result = something` instead.
03:25:46FromDiscord<KingDarBoja> I know, but used to return instead
03:25:50disrupteki almost never use return. prefer block: result = ... ; break
03:26:11disruptekit works, it's just code smell imo.
03:26:17disruptekstyle nit.
03:26:52leorizeyep I also prefer `result`
03:26:56disruptekwhen you use result instead, you provide the ability to inspect the result at the bottom of the scope or add control flow there at a later date.
03:27:00leorizethough it's a habit from my days of using pascal
03:27:38disrupteklean on block. it's awesome. especially named blocks.
03:27:59leorize[m]`return` is like `goto`
03:28:10zacharycarterwhat if you need to exit eraly from a function?
03:28:13zacharycarterearly*
03:28:16leorize[m]it breaks your reading flow
03:28:18zacharycarterhow do you avoid return?
03:28:35leorize[m]zacharycarter: structure it so that you don't have to, or use it if you can't
03:28:41disruptekbreak a block.
03:28:54zacharycarterI don't get the breaking a block thing
03:29:01FromDiscord<KingDarBoja> `break`
03:29:02leorize[m]nim-style goto
03:29:04zacharycarterno I get that
03:29:17*FromDiscord <KingDarBoja> Was trying to make a joke
03:29:26disruptekblock found: for i in 0 .. 10: if foo[i]: break ... echo "not found"
03:29:28zacharycarterI know what break does and what a block is, I just don't understand how this helps
03:29:34FromDiscord<KingDarBoja> But being serious, I don't see harm on using return
03:29:40FromDiscord<KingDarBoja> But ofc, newbie here
03:29:53disruptekwhen you break a block, you skip the remaining statements in the block.
03:30:01zacharycarterah okay
03:30:15zacharycarterso just wrap the entire proc body in a block essentially
03:30:24leorize[m]KingDarBoja: well there aren't any harm, but the reading flow is better when you use `return` less
03:30:49disruptekzacharycarter: yes, though obviously there are exceptions when that's just plain silly.
03:30:53zacharycarteryes
03:30:58zacharycarterbut I now understand thanks
03:31:06*FromDiscord <KingDarBoja> you provide the ability to inspect the result at the bottom of the scope or add control flow there at a later date.
03:31:10disrupteki err on the side of silly. 😁
03:31:13FromDiscord<KingDarBoja> I don't get the idea, sorry
03:31:27Yardanico@KingDarBoja with "result" you don't "return"
03:31:33disruptekwhen you break the block, you haven't returned from the proc.
03:31:35Yardanicoso the compiler is free to add whatever it wants at the end of the proc
03:31:47leorizeYardanico: it's not something for the compiler :P
03:31:49disruptekso after the block, you can add some inspection or debugging or w/e.
03:31:49FromDiscord<KingDarBoja> Ah ok
03:32:20FromDiscord<KingDarBoja> That's sounds useful
03:32:25FromDiscord<KingDarBoja> Ofc when needed
03:33:16disruptekhttps://github.com/disruptek/nimph/blob/master/src/nimph/project.nim#L403
03:33:35disrupteki use return in something like 8% of my procs. you see block all over my code.
03:34:05disruptekthat's an example of a simple and efficient exploit of the semantics for a typical found/unfound scenario.
03:35:00disruptekhttps://github.com/disruptek/nimph/blob/master/src/nimph/project.nim#L540 -- nested named blocks
03:35:45FromDiscord<KingDarBoja> That's seems very golang-like
03:35:47FromDiscord<KingDarBoja> But nice
03:36:17leorizenim blocks are `go to` but a bit better
03:36:23FromDiscord<KingDarBoja> Ok, that last one is another level
03:36:34disruptekthey open new scopes.
03:37:10PrestigeGoing to push some code soon, would anyone mind reviewing it? Not many lines yet
03:37:18*zacharycarter quit (Ping timeout: 265 seconds)
03:38:18leorizesure, just post it here :)
03:38:29FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/parser.nim#L867 me ~abusing~ using return
03:38:51leorizenah, that's not abusing return
03:38:58PrestigeThanks! - https://github.com/avahe-kellenberger/nimdow/tree/development leorize
03:39:20PrestigeIt will eventually be an actual window manager
03:39:28leorizehttps://github.com/alaviss/nim.nvim/blob/master/indent/nim.vim#L95 <- this is abusing return
03:39:37disruptekconverters will hurt you in the end.
03:39:55Prestigeah what's wrong with converters?
03:40:04leorizeI take literal days to fix a bug in that indent plugin
03:40:07FromDiscord<KingDarBoja> I will give you a star πŸ˜„
03:40:09leorizeso I wrote a better one: https://github.com/alaviss/nim.nvim/blob/indent-rewrite/indent/nim.vim#L169
03:40:41leorizePrestige: they have the weirdest semantics in Nim :)
03:40:45disruptekthere are basically two uses of converters that i can get behind.
03:40:55leorizethey apply when you don't want them to, and they don't apply when you want them to
03:40:59FromDiscord<KingDarBoja> Holy cr*p, that's a lot of if-else
03:41:16disruptek1) grandfathering types; convert new to old, vice-versa.
03:41:38leorize@KingDarBoja: yep, but now everything is structured and you can follow the code
03:41:56leorizein the older version `return` was literally `goto`
03:42:11*nsf joined #nim
03:42:19leorizeesp when vimscript hinders your ability to follow code by 150%
03:42:25disruptekhmm, i cannot remember my second use of converters.
03:42:36PrestigeShould I just manually cast instead of using a converter?
03:42:37disruptekhelp me out, leorize.
03:42:58disruptekcast is unsafe. use foo.int32 or int32(foo)
03:43:28YardanicoPrestige: you don't need to specify "void" btw
03:43:31leorizehttps://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L17-L19 <- this is weird syntax
03:43:32Yardanicoas I said before
03:43:42PrestigeYeah I just like the verbosity cuz of old habbits
03:43:58YardanicoPrestige: oh, in the link above you don't need ()
03:44:03Yardanicothe one leorize shared
03:44:15leorizedisruptek: sorry, I used converter once to try to mimic "object composition" and I'm scarred for life
03:44:24*rockcavera quit (Remote host closed the connection)
03:44:34Yardanicoterm rewriting macros are still more fun than converters though :DD
03:44:39PrestigeYeah, I kind of like having the separation
03:44:48disrupteki prefer my iteration with .items or .pairs to name those procs explicitly, but that's another style nit.
03:44:51Prestigemaybe I'll just use a blank line instead
03:45:23leorizeyea, a blank line is what people usually use
03:45:34disruptekhttps://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L29
03:46:00leorizeah, there it is, the evil use of return
03:46:09disruptekaraq makes a good case for removing the return and inverting the if clause so it dominates the body of the proc.
03:46:28PrestigeWhat do you mean by inverting the if clause?
03:46:45disruptekif e.theType in this.listenerMap: ..do things..
03:46:50PrestigeI usually return early to avoid a bunch of nesting
03:46:56leorizeI think the `if not something: return` pattern was shepherd to people by C-family of language
03:47:01disrupteki used to code that way.
03:47:25disrupteki got better since i came to nim.
03:47:34PrestigeWhat changed your mind about it?
03:47:39disrupteki still use block: if x: break if y: break if z: break sometimes.
03:47:51disruptekbut i almost never use `continue`, either. it's sloppy.
03:48:09disruptekaraq's point is that it helps the reader understand the nesting.
03:48:13leorizefor me, turns out a bunch of nesting works better when you read the code than a return
03:48:16PrestigeI think returning early makes it easier to read
03:48:34disruptekthe problem is that you have to remember everything that the if clause is NOT.
03:48:51disruptekby the time you get half a page down, it's hard to see what's in play.
03:49:04disruptekeasy for the author, hard for the reader.
03:49:16leorizehttps://github.com/alaviss/nim.nvim/blob/master/indent/nim.vim#L95 <- exactly what happened here
03:49:28PrestigeHm I always thought it was easier to read 🀷
03:49:40leorizeI `return` so much I can't even follow my own code :P
03:49:45Prestigealthough I like to make my functions very short
03:49:47disruptekit's subjective, of course.
03:50:00disrupteki'm just telling you that i changed my style recently.
03:50:21disruptekalso, i'm old.
03:50:30leorizewell, you'll understand once you got hit by it :)
03:51:25PrestigeI used to program the other way but switch a few years ago
03:51:33Prestigeswitched*
03:51:52PrestigeAnyway thanks for the feedback - guess most of it looked correct at least lol
03:52:04leorizeremove all the `: void` please :)
03:52:08disrupteki don't like a lot of nesting, either. i also almost never have multi-line if clauses.
03:52:48leorizeI hated nesting until I implemented code folding in nim.nvim :)
03:53:08disrupteki want to see how big procs are.
03:53:19disrupteki don't want to forget what's inside.
03:56:59FromDiscord<KingDarBoja> https://imgur.com/Cmv8yiR
03:57:11disruptekking i'm looking at your language parser.
03:57:22disruptekyou realize that #[]# is not a doc comment, right?
03:57:35FromDiscord<KingDarBoja> WHAT
03:57:47disruptek##[]##
03:57:56disruptek#[ is the multi-line version of #
03:58:00FromDiscord<KingDarBoja> 🀦
03:58:29disruptektry multi-line let and var blocks. you might like them.
03:58:40FromDiscord<KingDarBoja> Thanks for the review, didn't know I was wrong
03:58:51disruptekalso, they are nicer to read and have less impact on a diff.
03:58:55FromDiscord<KingDarBoja> Ah yeah, I think Rika said the same about AST type
03:59:04disruptekabout what?
03:59:04FromDiscord<KingDarBoja> I mean, using a single one for all
03:59:09disruptekoh, yeah.
03:59:31FromDiscord<KingDarBoja> https://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim Look at this, scroll down a bit 🌱
03:59:51leorizePrestige: https://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L6-L10 <- can share the type block
03:59:54*waleee-cl quit (Quit: Connection closed for inactivity)
04:00:08leorizehttps://github.com/avahe-kellenberger/nimdow/blob/development/nimdowpkg/event/xeventmanager.nim#L13 <- unneeded `return`, though this is subjective
04:00:21Yardanicobtw it's actually pretty fun to help people learn nim :P
04:00:22Yardanicoe.g. see https://github.com/wiremoons/weather-nim/pull/2
04:00:23disbot_βž₯ A lot of changes
04:00:33FromDiscord<KingDarBoja> Oh ffs, my internet is trash, I can't wait for the monday to get new ISP provider
04:01:09Yardanicoalthough this PR is subjective too of course
04:01:10PrestigeThanks leorize :)
04:01:44leorizePrestige: I'd have to warn you that the `eventPoller` might not work the way you'd like it to
04:01:50leorizeclosure iterators are expensive
04:02:17Prestigewas just about to read a link about closure iterators - what would u suggest, just a normal iterator?
04:02:35leorizeread it first then decide if you wanna use it
04:02:57leorizeI feel like you don't need this, though I've never written any WM
04:04:53Prestigejust by the definition of an inline iterator, that sounds better
04:05:11disruptekusually we say newLocation() to alloc a new Location and then initLocation() to do some setup logic on it.
04:05:37leorizewe use `create` for `ptr` and `new` for `ref` respectively
04:05:40disruptekyou can simply result = Location(start: startToken.start, ...)
04:05:43Yardanicobtw guys, a PR from the dark times of Nim https://github.com/nim-lang/Nim/pull/2849
04:05:45disbot_βž₯ Feature #2811 hump, snake and now dash
04:05:57Yardanicoapart from allowing unicode in identifiers it added ability to use unicode dash symbol in identifiers
04:06:01*supakeen quit (Quit: WeeChat 1.9.1)
04:06:02Yardanico(it got removed later though)
04:06:20leorizeare you diving the history of nim? :P
04:06:41*supakeen joined #nim
04:06:54Yardanicowas searching for "norecurse" in Nim, stumbled upon https://irclogs.nim-lang.org/10-01-2018.html and it turns out I actually saw this issue myself 2 years ago
04:07:20FromDiscord<KingDarBoja> disruptek: you reviewing it?
04:07:27disrupteki mean, i was.
04:07:31FromDiscord<KingDarBoja> oh
04:07:35Yardanicohttps://github.com/nim-lang/Nim/issues/2811 is the #2 commented issue in nim repo right now
04:07:36disruptekthis kinda thing is pretty painful:
04:07:36disbot_βž₯ Unicode dashes as "lisp'ish" alternative to hump and snake notation
04:07:42disruptekhttps://github.com/KingDarBoja/Phosphate/blob/master/src/language/ast.nim#L25
04:08:15FromDiscord<KingDarBoja> πŸ™ˆ
04:08:26disruptekπŸ˜„
04:08:29Yardanicothe #1 being https://github.com/nim-lang/Nim/issues/8363
04:08:30disbot_βž₯ Rework Nim's exception handling ; snippet at 12https://play.nim-lang.org/#ix=27OQ
04:08:45FromDiscord<KingDarBoja> Remember, it is a 1:1 port so I do it like a python guy
04:09:04leorizewe are still working torward that proposal
04:09:07disrupteki get it. read some small projects to get ideas.
04:09:12FromDiscord<KingDarBoja> ofc I will improve my code
04:09:22disruptekeveryone starts as a newbie.
04:09:47disrupteki am hesitant to recommend any of my smaller stuff because my style has already improved.
04:10:14disruptekand of course there's dogshit in my larger work, too.
04:10:24Prestigeleorize: I think this may be better in general: https://play.nim-lang.org/#ix=2imm
04:10:26disrupteknim is very forgiving, though.
04:10:42YardanicoPrestige: you don't need to inherit from RootObj for XEventManager
04:10:51Yardanicoyou only need to inherit from RootObj if you want to inherit from your own object later
04:10:52FromDiscord<KingDarBoja> I know, I have been collecting suggestions on some text file
04:11:00PrestigeOh nice, thanks
04:11:20FromDiscord<KingDarBoja> And I will improve the code, just rushing the port a little bit
04:11:52*FromDiscord <KingDarBoja> Just a litle, been idle these days cuz job and wanting to chat here
04:12:16disruptekcool.
04:12:23FromDiscord<KingDarBoja> Btw, I haven't pushed latest features
04:12:40FromDiscord<KingDarBoja> Been dealing with the GraphQLError class to see what's need
04:12:56disruptekima use that shit when it's done, btw.
04:12:58FromDiscord<KingDarBoja> But ended up writing extra utils as needed
04:13:12disruptekit will go into nimph for actions support.
04:13:15FromDiscord<KingDarBoja> Also, got accepted into the Graphql-python org yey
04:13:15disruptekgithub actions.
04:14:46Yardanicoby the way I found a good way to format floats so they don't have ".0" if they don't have a floating-point part :P
04:14:59YardanicoformatBiggestFloat(ffDecimal, -1) and then trimZeros on that variable
04:15:16disrupteki just email my floats to timothee for print-out.
04:15:22Yardanicolul
04:15:27FromDiscord<KingDarBoja> lol
04:15:30Yardanicoi use it for my interpreter since it only has floats for numbers
04:15:39FromDiscord<KingDarBoja> Oh just tested the let indent
04:15:40disruptekwut
04:15:45FromDiscord<KingDarBoja> This is some good stuff
04:15:53Yardanicodisruptek: http://www.craftinginterpreters.com/
04:15:54disruptekhttps://github.com/disruptek/gittyup/blob/master/gittyup.nim
04:18:54disruptekthis thing is pretty cool, but it never could have been written without shashlick's nimterop. his work is the backbone of too many projects. we need insurance on him, i think.
04:19:56disruptekalso, `once()` is a cute template to know about.
04:20:25Yardanicodisruptek: what's it for?
04:20:36Yardanicooh found
04:20:44Yardanico"Executes a block of code only once (the first time the block is reached)." actually pretty nice, yeah
04:21:34Prestigehm seems weird that the bitops functions don't take varargs[T]
04:21:37disruptekso, converters... kinda like the auto keyword.
04:21:51disruptekvery, very specific use-cases that you probably don't have.
04:22:14disrupteki used auto to write a generic against a type that wasn't exported, for example.
04:22:22disruptekvery, very specific.
04:23:24FromDiscord<KingDarBoja> Is there a equivalent to Python unpack asterisk ?
04:23:33Yardanicofor what specifically?
04:23:36disrupteknope.
04:23:43FromDiscord<KingDarBoja> Oh
04:24:16disruptekalso, converters are less dangerous if not exported. that's a whole 'nother story.
04:25:12disruptekvarargs is a little trappy, too. i advise against it.
04:25:48disruptekhere's a demo of some abuse:
04:25:52disruptek!repo jsonconvert
04:25:53disbot_https://github.com/disruptek/jsonconvert -- 9jsonconvert: 11lazy json node conversion 15 0⭐ 0🍴
04:26:24Prestigedisruptek: just cuz of implicity or something?
04:26:43PrestigeI could use a an array for this I suppose
04:27:24disruptekvarargs are troublesome elsewhere in the language (macros) so they may hinder your code ultimately.
04:27:34disruptekopenArray is probably what you want.
04:27:35Prestigecool, I'll use arrays then
04:28:18disruptekking: use discard less, if at all.
04:28:56disruptekbasically, it's a nice feature and discard discards it. keep it and use it instead.
04:29:33disruptekokay, that's enough criticism for now. good on you guys for writing nim. keep it up!
04:30:03leorize[m]you can use this to format float
04:30:06leorize[m]!repo nim-ryu
04:30:07disbot_https://github.com/disruptek/ryu -- 9ryu: 11ryu for nim 15 5⭐ 2🍴 7& 2 more...
04:30:13disrupteklol
04:30:18leorize[m]get you the nicest float :P
04:30:30Yardanicoleorize[m]: "This repository has been archived by the owner. It is now read-only." hm
04:30:31disrupteknot that one.
04:30:44leorize[m]if you feel like printing your float at x4 the speed, then
04:30:45disruptek!repo alaviss/nim-ryu
04:30:46disbot_https://github.com/alaviss/nim-ryu -- 9nim-ryu: 11An implementation of the ryū float-to-string conversion algorithm. This version is written from scratch based on the paper. 15 1⭐ 0🍴
04:30:58leorize[m]s/speed/x4 the time*/
04:31:01Yardanicobut there's no license :(
04:31:13Yardanicoso it's all rights reserved
04:31:27leorize[m]^ yea use that for x4 the time spent
04:31:31leorize[m]you got my word, it's ISC licensed
04:31:36PrestigeSo if I'm not to use converters, should I just manually cast ints to x.cint?
04:31:41leorize[m]I just forgot to push the license :p
04:31:50disruptekthat's not a cast, but yes.
04:31:56leorize[m]though I might just re license it to MIT for easy adoption
04:32:04disruptekcast[cint](x) is a cast.
04:32:15PrestigeThat's what I am doing atm since I'm not using converters
04:32:22Yardanicoright now I just do https://github.com/Yardanico/nim-lox/blob/master/src/types.nim#L21 and it works fine :D
04:32:41disruptekcint(x) is a safe conversion whereas cast[]() is not.
04:33:02leorize[m]`cast[]` in nim is `reinterpret_cast` in C++
04:33:31Prestigeah thank you disruptek
04:33:38PrestigeI couldnt find much on casting/type conversion
04:33:39leorize[m]the `Type(x)` is `static_cast` and/or `dynamic_cast` in C++
04:33:42leorize[m]just in case you came from C++ :P
04:34:03PrestigeI came from java and javascript D:
04:34:11*disbot_ is now known as disbot
04:34:27nerdrat[m]leorize[m]: I finally found the problem. I Wonder who else in here updated through `choosenim
04:34:42leorize[m]nice :)
04:34:44disruptekwhat was the issue?
04:35:05disrupteki mean, what was the solution?
04:35:09nerdrat[m] Choosenim is doing something weird at extracting the tarball
04:35:36disruptekthat sounds like me in about 25mins.
04:37:06disruptekif you can shed more light on it, i think shashlick would be interested.
04:38:22nerdrat[m]I downloaded the tarball myself, verified the checksum both choosenim's and the one that extracted had the same checksum. However when I check the toolchain directory inside `.choosenim` directory, various files including the `nim.cfg` and all files inside `dist/nimble` were binary data!!!! I think choosenim is messing the tarball, I wonder who else had this problem? am I the only one?
04:38:45disruptekwhat platform?
04:38:49leorizeprobably the nimarchive version used was broken
04:39:29nerdrat[m]linux amd64
04:40:47leorizeI gotta write a proper cli library for nim sometimes
04:41:23leorizeactually I planned that long ago when I was writing my own tool, but was too lazy to work on it :P
04:41:26disrupteknerdrat[m]: well, i'm surprised. but i don't use that choosenim.
04:41:47disrupteki use this one: https://github.com/disruptek/nimph/blob/master/choosenim
04:42:31nerdrat[m]I solved it copying the config directory from the tarball I extracted to the `.choosenim/config` "these are text files of course". And also all `dist/nimble`.
04:44:02disrupteki recommend using git. it works well and millions of people use it for software distribution every day.
04:44:47nerdrat[m]This is a problem. I wonder if dom96 is aware of this behavior.
04:44:56*Romanson joined #nim
04:45:16disruptekit's disappointing, yes.
04:46:19disruptekonly shashlick can fix it, though.
04:47:20FromDiscord<KingDarBoja> I just read this -> king: use discard less, if at all.
04:47:30FromDiscord<KingDarBoja> The lag with my internet xD
04:49:28nerdrat[m]I saw this open issue but I don't know if it is directly related https://github.com/dom96/choosenim/issues/193 it seems so.
04:49:30disbotβž₯ choosenim installs Nim/config/nim.cfg but not Nim/config/config.nims ; snippet at 12https://play.nim-lang.org/#ix=2imo
04:49:40FromDiscord<Varriount> Disruptek: You're still up?
04:53:41PrestigeHm I am not sure, but I don't think a window manager requires more than one thread..
04:54:08FromDiscord<Zed> dumb question, how do you make a function return nothing? like c has void, kotlin Unit, what does nim have?
04:54:28FromDiscord<Varriount> Omit the return type, or put void
04:54:32Prestigeimplicit void
04:54:40FromDiscord<Varriount> Preferably the former
04:56:42FromDiscord<Zed> awesome thanks
04:57:49shashlicknerdcat[m]: good to know, so it is an extraction issue - that helps
04:58:02shashlickcan you provide any info on your platform / OS
04:58:15shashlicknerdrat[m] rather
05:01:47shashlickwhat distro and version are you using
05:03:30FromDiscord<KingDarBoja> https://www.youtube.com/watch?v=lkaqxonhLLg
05:03:50FromDiscord<KingDarBoja> Oops, this isn't off-topic, ignore that
05:10:26*hpyc9 quit (*.net *.split)
05:10:26*Northstrider[m] quit (*.net *.split)
05:10:26*Spy653 quit (*.net *.split)
05:10:26*sirikon quit (*.net *.split)
05:10:27*Demos[m] quit (*.net *.split)
05:10:27*GitterIntegratio quit (*.net *.split)
05:10:27*BitPuffin quit (*.net *.split)
05:10:27*oprypin quit (*.net *.split)
05:10:27*FromGitter quit (*.net *.split)
05:10:27*golechwi1 quit (*.net *.split)
05:10:27*sepples quit (*.net *.split)
05:10:27*Northstrider quit (*.net *.split)
05:10:27*lmariscal0641 quit (*.net *.split)
05:11:38FromDiscord<Zed> im confused with nim, do you guys program in a main function? and then have all your code and function calls inside of there? or just write code and then call functions when you need them outside of a main
05:11:52FromDiscord<Zed> if that makes any sense
05:13:20FromDiscord<KingDarBoja> I do the second right now
05:13:40FromDiscord<KingDarBoja> Put all the code outside any main and just call it when need it
05:13:53FromDiscord<KingDarBoja> But ofc, I am a mewbie so someone expert on the topic should answer
05:14:00FromDiscord<KingDarBoja> newbie*
05:14:01*hax-scramper quit (Ping timeout: 264 seconds)
05:15:04*hpyc9 joined #nim
05:15:04*Northstrider[m] joined #nim
05:15:04*Spy653 joined #nim
05:15:04*sirikon joined #nim
05:15:04*GitterIntegratio joined #nim
05:15:04*BitPuffin joined #nim
05:15:04*Demos[m] joined #nim
05:15:04*Northstrider joined #nim
05:15:04*oprypin joined #nim
05:15:04*FromGitter joined #nim
05:15:04*golechwi1 joined #nim
05:15:04*sepples joined #nim
05:15:04*lmariscal0641 joined #nim
05:15:14FromDiscord<Rika> ah finally, booted into linux now
05:15:43FromDiscord<Rika> @Zed theres an optimization nim does when you do the former (i dont know why)
05:17:49FromDiscord<Zed> weird, are nim functions like C? where you have to define a function prototype if you want to use a function underneath your main code?
05:18:14FromDiscord<Zed> this language is really confusing me
05:19:10*narimiran joined #nim
05:19:11Yardanico@Zed yes you need forward declaration
05:19:20Yardanicothere's also "reorder" pragma but it won't work if you have recursive dependency
05:19:32Yardanicoe.g. if proc a calls proc b, proc b calls proc a
05:19:55leorize[m]the best practice is to just order it correctly
05:20:18leorize[m]make your program compiles faster, and the macro system also benefits from it
05:20:43leorize[m]and in Nim we don't have the idea of a "main" function
05:21:04FromDiscord<Rika> is the optimization thing i said right?
05:21:07leorize[m]modules instead have "initialization" code, which is called to initialize the module
05:22:01leorize[m]any top-level statement is a part of this initialization code
05:22:07leorize[m]@Rika yep
05:23:22leorize[m]the "write a main function then call it at the top-level" is a way to optimize the code
05:24:26FromDiscord<Rika> why though?
05:24:48leorize[m]this is mainly due to Nim interpreting any top-level variables as "global" (which isn't wrong), so optimizations can't be done on them.
05:24:54leorize[m]that's my speculation fwiw
05:25:52leorize[m]function-scoped variables are guaranteed to not be accessed outside of the stack frame, so they can be optimized away for example
05:27:37leorize[m]globals are never easy to optimize
05:32:00FromDiscord<Zed> how do you import a function from another file? looking through some nim code and they use
05:32:01FromDiscord<Zed> import function/fileWithfunctions
05:32:01FromDiscord<Zed> which i have done but i cant seem to use the functions i have imported
05:32:09FromDiscord<Zed> sorry for all the dumb questions guys
05:32:21Yardanicoyou need to export a symbol so other modules will be able to use it
05:32:25Yardanicoyou do that with an asterisk (*)
05:32:36Yardanicolike proc myexportedproc*(...)...
05:32:45Yardanicoor const MyUrl* = "stuff"
05:33:23FromDiscord<Zed> do you have too type
05:33:23FromDiscord<Zed> export thatFunction
05:33:35FromDiscord<Zed> i have seen this done somewhere
05:35:42FromDiscord<Zed> no you do not have to
05:36:32leorize[m]the export is for you to reexport some symbol from module you imported
05:36:54leorize[m]it's not something done often though
05:56:00*hax-scramper joined #nim
06:05:36*solitudesf joined #nim
06:25:42*silvernode joined #nim
06:28:30silvernodeGot my first issue: https://github.com/silvernode/space-nim/issues/4
06:28:30disbotβž₯ Connect player with grid
06:28:41*xcm quit (Remote host closed the connection)
06:30:54*xcm joined #nim
06:31:00silvernodeHaven't had time to really work on some of the suggestions people here gave me. Such as creating a position type with a reference to a grid type. Some terms were used in that suggestion that I don't understand, terms like "ofc".
06:36:24silvernodeCreating a new branch called "grid" to experiment with code. I have never done a grid before so the code is probably not going to make sense.
06:37:06*PMunch joined #nim
06:51:46*tane joined #nim
06:55:43*silvernode quit (Ping timeout: 250 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:02:40*NimBot joined #nim
07:04:51*gmpreussner joined #nim
07:06:50*lritter quit (Quit: Leaving)
07:28:17*xcm quit (Remote host closed the connection)
07:30:32*xcm joined #nim
07:48:38*liblq-dev joined #nim
07:52:52*Vladar joined #nim
07:54:13*Romanson quit (Quit: Connection closed for inactivity)
08:05:36dadadadoes somebody know whether staticRead/slurp cache their file reading? When different macros use staticRead in the same module, then you can assume there not be changes to the underlying source, so this is why I'm asking.
08:08:19dadadato clarify what I mean... when using staticRead to read Nim source files, of the same project, that the macro is running in, while macros run it can be assumed that the sources aren't changed
08:08:44PMunchHmm, question. Nimlsp uses jsonschema which can be strict or relaxed when it comes to extra fields in the json data. This manifests in issues like the one Prestige had where it just refuses to do certain things. I like that nimlsp was strict, because it has led us to find at least two implementations with bugs in them, so I kinda want to keep it strict. But from a usability standpoint it should probably be lenient. Would defaulting it to strict
08:08:44PMunchbut adding a flag to make it lenient and adding a section in the README about it telling you to turn on lenient mode and to report a bug with the editor in question be an acceptable solution?
08:09:11PMunchdadada, I don't think they cache
08:09:31dadadaPMunch: okay, then I won't be stupid to use my own cache
08:09:36dadadas/be/feel
08:27:35PMunchHmm, I generate a procedure and a forward declaration in a macro (in two different quote do blocks, later glued together). But I get an ambiguous error when I try to call it. Tried to make the name of the procedure an ident node and quote it in the quote do macro, but that didn't work..
08:27:49FromGitter<faulander> good morning guys. since i am coming from python, what is the best way of implementing classes, init procs and class methods. If you could point me to a resource which explains that?
08:29:03Yardaniconim doesn't have classes, for init procs - just use initT if your object's type is "object", and newT if it's "ref object", like initTable if it's "object" and newTable if it's "ref object"
08:29:27Yardanicoread https://nim-lang.org/docs/tut2.html#object-oriented-programming
08:29:39Yardanicocontains quite a lot of useful info about OOP in nim, but you rarely need real methods and inheritance
08:29:47PMunchAaah, all the parameter names need to be quoted..
08:30:25FromDiscord<Recruit_main707> Faulander: I also came from python, don’t let nim’s simplistic OOP push you back, you will realize they have everything you will need
08:30:56Yardanicomost stuff in nim is done via composition :)
08:31:22Yardanicoalso nim UFCS or MCS (method call syntax) is really good
08:31:46Yardanicoa.b() == a.b == b(a) == b a
08:31:56Yardaniconot in all contexts of course, but generally it's like this
08:32:04PMunchfaulander, to expand on that Nim initialises memory to null when you create a new object. And most types are made to accept null as an empty state so you rarely need initialisation (e.g. `var x: Table[string, string]; echo x.hasKey("hello")` would work and return "false" even though the table isn't initalised)
08:33:24Yardanicowell also it should be mentioned that some type have a proper "default" value
08:33:27FromDiscord<Rika> not null, zeromem
08:33:36FromDiscord<Rika> all default to default state
08:33:43Yardanicoall the "primitive" types and all "object" types have a default value, not neccessarily correct one though
08:33:44FromDiscord<Rika> strings are "", ints 0, floats 0
08:34:04PMunchWell yeah, I just assume that Python people don't necessarily know about things like zeromem..
08:34:06FromDiscord<Rika> any objects that arent ref are initialized w/ fields that are in default state
08:36:17Yardanicoalso "ptr" and "pointer" are not initialized of course, but that's another topic :P
08:37:05FromDiscord<Recruit_main707> he left??
08:38:16FromDiscord<Rika> who is he
08:38:32FromDiscord<Recruit_main707> Faulander
08:39:06FromDiscord<Rika> how do you know, are you in irc
08:39:13FromDiscord<Yardanico> Faulander is from gitter
08:39:40FromDiscord<Rika> didnt notice lol
08:39:41FromDiscord<mratsim> The citizen of this country are not accounted for
08:39:45FromDiscord<Recruit_main707> > how do you know, are you in irc
08:39:45FromDiscord<Recruit_main707> thats why i asked xD
08:40:19YardanicoEnglish is not Nim, you can't just omit punctuation
08:40:23Yardanicoah nvm
08:40:35YardanicoI just thought that "he left???" was meant as a surprise on the fact, not the question
08:40:49PMunchAre you on IRC or in IRC?
08:40:54PMunchI've always said "on"
08:40:54FromDiscord<Rika> same here
08:41:07PMunch"in" a channel, but "on" the network
08:41:12FromDiscord<Rika> at
08:41:13FromDiscord<Rika> πŸ˜›
08:41:17FromDiscord<Recruit_main707> id say in ngl
08:41:45YardanicoPMunch: there's that thing about how to properly say "in Ukraine" in russian too
08:42:20PMunchWouldn't that just be "in Russia" nowadays? /s
08:42:29Yardanicoxd, not (yet) :D
08:42:31Yardanicosome people say "Π² ΡƒΠΊΡ€Π°ΠΈΠ½Π΅" -> "in ukraine", some say "Π½Π° ΡƒΠΊΡ€Π°ΠΈΠ½Π΅" -> "on ukraine"
08:42:59PMunchYeah it's always confusing for people learning Norwegian as well
08:43:20Yardanicowell it's a political issue mostly :D
08:43:40PMunchWhere I live "TromsΓΈ" you say in "TromsΓΈ" but the city is on an island named "TromsΓΈya" and you say on "TromsΓΈya"
08:43:57PMunchAnd of course we say in the kitchen and on the bedroom.
08:44:05FromGitter<faulander> oh, beautiful norway right?
08:44:09YardanicoPMunch: same about irc
08:44:13Yardanico"on github", "on discord"
08:44:16PMunchOh no, we say on the kitchen as well, but in the living room
08:44:18Yardanico"in nim server on discord"
08:44:19FromGitter<faulander> and i am here, my browser just hang
08:44:22*solitudesf quit (Ping timeout: 256 seconds)
08:44:30YardanicoPMunch: we say "on the kitchen" -> "Π½Π° ΠΊΡƒΡ…Π½Π΅" too lol
08:44:30PMunchfaulander, yeah Norway is quite beautiful :)
08:44:59FromGitter<faulander> i visited all european countries, but norway was too expensive to stay long ;)
08:45:28PMunchHehe, yeah it's not the cheapest place to be
08:45:42PMunchNice for us when we're on vacation though, pretty much anywhere else is comparatively cheap
08:46:04FromGitter<faulander> i am getting close to rewrite all of my python utilities in nim. i just struggle with the more complex ones. i am not sure to understand nims "Type"-System well.
08:46:08PMunchNot so much now though that the oil price and Norwegian currency has plummeted..
08:46:45FromDiscord<Recruit_main707> Faulander: do you know about c/c++ structs?
08:46:46FromGitter<faulander> @pmutua : Except Switzerland ;)
08:46:47FromDiscord<mratsim> imagine in Venezuela
08:47:23FromDiscord<mratsim> oil price were already an issue and now covid drove them further down
08:47:37*solitudesf joined #nim
08:48:14FromDiscord<Recruit_main707> do we have some kind of python vs nim about oop?
08:48:20FromGitter<faulander> > *<FromDiscord>* <Recruit_main707> Faulander: do you know about c/c++ structs? ⏎ ⏎ unfortunatelly not. i was programming in 6502 assembler, all kind of basic dialects, then pascal, delphi, vb - then stopped programming for 20 years, started with python again 2 years ago
08:48:26FromDiscord<mratsim> @faulander, if you make everything a ref object, it works like Python
08:48:55FromDiscord<mratsim> pascal delphi can help you, there was a translator tool to convert pascal to Nim πŸ˜‰
08:49:11FromDiscord<mratsim> bootstrapping was done in Pascal a very very long time ago AFAIK
08:49:12FromGitter<faulander> that was 30 years ago in school ;)
08:49:19Yardanico@mratsim yeah you're right
08:49:21Yardanicopas2nim
08:49:25FromDiscord<mratsim> well you didn't forget your multiplication tables did you?
08:49:38FromGitter<faulander> i cannot remember much, only that i liked that i don't need linenumbers :D
08:49:55Yardanicoyou can still find traces of pascal code in nim compiler
08:50:14FromDiscord<mratsim> 6502, that reminds me that my SNES emulator has been collecting dust for 2 years
08:50:23FromGitter<faulander> and that i hated the procedures had to be declared before usage - i like nims forward declaration. python has no such reglementation.
08:50:28FromDiscord<mratsim> the "type" follows Pascal record section
08:50:55FromDiscord<mratsim> Nim forward declaration is considered a limitation so will likely be lifted at one point
08:51:14FromDiscord<mratsim> you can already use {.reorder: on.}
08:51:21FromGitter<faulander> oh jesus. then i am f*cked.
08:51:42Yardanicoreorder won't help if you have recursive dependency though
08:51:46Yardanicobut yeah it's good
08:51:46FromDiscord<mratsim> well the issue with those is that you can't have files with types that depend on each other
08:52:04Yardaniconah I mean procedures
08:52:10FromDiscord<mratsim> which is a common pattern in other languages
08:52:39Yardanicoproc a = b() proc b = a() I have a few places in my wip lox interpreter where I need forward decls, I'll probably refactor that once I finish the boot (or at least the first part)
08:53:14FromDiscord<mratsim> boot? is there an OS tutorial as well?
08:53:32Yardanicobook*
08:53:34Yardanicosorry :P
08:53:39Yardanicohttp://www.craftinginterpreters.com/
08:54:00Yardanicothe book talks about implementing a simple C and JS-like language first in Java, then in C
08:54:11YardanicoI'm following it but instead of Java I use Nim
08:54:59Yardanicooh right you already know since you starred the repo :D
08:56:34FromDiscord<mratsim> Yeah, when I was trying to optimize interpreters 2 years ago I scoured the web for all interpreter resources
08:57:39FromGitter<faulander> so let me try to outline an example in python, would be nice if you could tell me how you would write that in nim, that would get me going: ⏎ class Person: ⏎ variable1 = "hello" ⏎ variable2 = 123 ⏎ ... [https://gitter.im/nim-lang/Nim?at=5e996f8263e7b73a5fe1551d]
08:57:42FromDiscord<mratsim> I saw that he published the last chapter about optimization, but it's too high-level for my needs which are optimizing the bytecode interpretation
08:57:55FromDiscord<mratsim> The sum of my interpeter optimization is collated here: https://github.com/status-im/nimbus/wiki/Interpreter-optimization-resources
08:58:01FromDiscord<mratsim> knowledge*
08:58:53FromDiscord<mratsim> @faulander, your edits are not transferred to IRC/Discord
08:59:09Yardanicohuh, so I actually found the place where I needed to put "{.noinline.}" :P
08:59:45Yardanicowas adapting https://forum.nim-lang.org/t/1305 (see bottom) to publish it on nimble, and turns out the C compiler aggressively inlines all calls to the decode procedure so for each string there's like 600 lines of assembly instructions added
08:59:55Yardanicoafter adding "{.noinline.}" it's fine though
09:00:12FromGitter<faulander> what is the irc server/channel= Would prefer it over gitter anyway, oldschool as i am
09:00:19Yardanicofreenode #nim
09:02:34dadadais there any way to set the lineInfo of a NimNode manually? copyLineInfo only works if you already have a NimNode with a the lineInfo that you want, is there anything else?
09:03:23dadadaparseExpr sets the macros.nim file/lines as fileInfo, which isn't helpful
09:03:59*Faulander joined #nim
09:04:06Yardanicoyay
09:04:23PMunchdadada, I don't think so
09:04:46dadadaPMunch: well, I suspected it :-(
09:04:50Faulanderback in 1990! ;)
09:04:54FromDiscord<mratsim> @faulander, in pseudocode: https://play.nim-lang.org/#ix=2inp
09:05:13PMunchWelcome back!
09:05:23FromDiscord<mratsim> you have what I saw from the broken formatting at the top
09:05:23Yardanicowith httpclient it's basically the same but getContent :P
09:06:23Faulanderperfect @mratsim, that will get me going!
09:06:46Faulanderoh, i need to learn IRC again haahaha
09:07:05PMunchWhat is there to learn? Text goes in, text comes out
09:07:26FromDiscord<mratsim> We said that in machine learning "garbage in, garbage out"
09:07:28PMunchW08el10l 12th02er04e 06ar08e 10co12lo02ur04s 06of08 c10ou12rs02e
09:07:39Faulanderoh jesus, i did use IRC for some ... not very legal ... "things" back then
09:08:02Faulanderregistering nick, mentioning users, etc.
09:08:23PMunchmratsim, I was referencing this: https://photos.app.goo.gl/Y7DBUYSLpnt6Njj8A
09:08:57PMunchWoops, wrong link
09:09:52*couven92 joined #nim
09:10:57PMunchhttps://youtu.be/wb3AFMe2OQY?t=113 that's the link I meant to share
09:11:06*dddddd joined #nim
09:13:29*hax-scramper quit (Ping timeout: 256 seconds)
09:13:31Faulanderi have added some comments and cleanup: https://play.nim-lang.org/#ix=2inr
09:14:26dadadaI think there should be an optional argument for parseExpr/parseStmt (s: string, info: LineInfo = LineInfo()) (or something like that) ...
09:14:43FromDiscord<mratsim> you can use "let x = initPerson(...)"
09:14:53FromDiscord<mratsim> echo x
09:15:08FromDiscord<mratsim> and let value = x.someOtherProc()
09:15:42dadadaparseExpr puts some default LineInfo now, that's not very helpful, this would help me to override it
09:15:54FromDiscord<Recruit_main707> Do we hav some kind of py2nim tool?
09:16:14Faulanderand now it should be working python code ;) https://play.nim-lang.org/#ix=2ins
09:16:17FromDiscord<Recruit_main707> I probably ask the dumbest shits ever, sorry :P
09:16:27FromDiscord<mratsim> we do
09:16:32FromDiscord<mratsim> it was used at Status
09:16:48FromDiscord<mratsim> https://github.com/metacraft-labs/py2nim
09:17:16PMunchI think there was a macro as well that rewrote some Python code to Nim :P
09:17:18FromDiscord<Rika> was?
09:17:39PMunchLike you just typed Python code in your Nim file and it rewrote the AST to be actual Nim code
09:17:48FromDiscord<mratsim> 3rd commit of Nimbus was py2nim generated: https://github.com/status-im/nimbus/commit/8ce5fa17736cd582c5e22feac2b18ec64633e2c1
09:17:49PMunchI think it was just a for fun project though
09:18:04FromDiscord<Recruit_main707> It could be useful
09:18:04FromDiscord<mratsim> was because it was for bootstrapping
09:18:16FromDiscord<Recruit_main707> How reliable it is?
09:18:28YardanicoPMunch: yeah it's in nimpylib
09:18:34FromDiscord<mratsim> then we cleaned up the code, removed all the OOP and built Nim code
09:18:37Yardanicobut it's almost entirely useless, just to show off :P
09:19:06FromDiscord<mratsim> it's serviceable but you will get Python-like code with lots of ref objects and methods
09:20:03Faulanderthat would help me alot ... i don't want to write python code and convert it, i want to learn the nim way of doing things, and if i can write python code, that would translate into how nim is doing it structurewise, that would be of immense value
09:21:06Yardanicowell it won't show how "proper" nim should be written :P
09:21:21FromDiscord<Recruit_main707> Just don’t take it as the Nim way
09:21:24FromDiscord<mratsim> did you read this btw? https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers
09:21:51FromDiscord<mratsim> in particular the section about objects: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers#objects
09:22:53FromDiscord<Recruit_main707> Being efficiency the most important feature, and having imho the cleanest syntax of all the programming languages shows how great of a project Nim is
09:23:12FromDiscord<Rika> am i the only dumbass who makes ref seq[] fields or is it totally valid to have ref seq[] fields
09:23:56FromDiscord<mratsim> ref seq are valid and Araq made some ref seq for TableRef iirc
09:24:19Yardanicoyeah it is valid
09:24:26Yardanicoa pointer to a pointer to seq data
09:24:29FromDiscord<mratsim> I prefer to use type foo[T] {.shallow.} = object \n data seq[T]
09:24:36Faulanderaaah, that link is glorious. thanks mratsim!
09:24:37FromDiscord<mratsim> this avoids a ref indirection
09:24:49Yardanicoyou can do "ref ref ref ref seq[int]" :P
09:25:45FromDiscord<Rika> ref seq[] is valid, but is it smart
09:26:11FromDiscord<Recruit_main707> from my complete ignorance, I’m gonna say no
09:26:17FromDiscord<Rika> i just want to be able to share a seq, where contents are changed in both "accessors"
09:26:35FromDiscord<mratsim> there are tests for ref seq
09:26:39FromDiscord<mratsim> 5*
09:27:03FromDiscord<Rika> i'd like a better solution of course since seqs are pointers internally no
09:27:04FromDiscord<mratsim> yes in that case use ref seq
09:27:22FromDiscord<Rika> is that the only possible way? or can i escape refseq
09:27:29FromDiscord<mratsim> you can use raw pointers
09:27:44FromDiscord<mratsim> with finalizers
09:27:53PMunchHmm, could nimsuggest support semantic highlighting?
09:27:56FromDiscord<Rika> that sounds debatably worse
09:28:13FromDiscord<Rika> I HEARD SEMANTIC HIGHLIGHTING?
09:28:17*chemist69_ quit (Quit: WeeChat 2.7)
09:28:24FromDiscord<mratsim> something like this: https://github.com/mratsim/Arraymancer/blob/master/src/tensor/backend/cuda.nim#L29-L41
09:28:28FromDiscord<Rika> (tbh though i really want that in vscode-nim)
09:28:34*chemist69 joined #nim
09:28:57PMunchRika, yes I'm looking at the proposed LSP spec for doing semantic highlighting
09:29:35PMunchHmm I guess the highlight command in nimsuggest should give me everything I need
09:30:56dom96Reports of choosenim corrupting the extracted files, doesn't bode well for nimarchive :(
09:31:17FromDiscord<Rika> ??? really?
09:31:34PMunchnimarchive?
09:33:38dom96oh, I see shashlick stepped in, thank you shashlick.
09:34:39Faulandertype Animal = ref object of RootObj --> inheritance, type Animal = object --> new object?
09:35:12FromDiscord<Rika> 1st is reference object, basically "pointer to actual object"
09:35:31FromDiscord<Rika> 2nd is regular object, can still have "inheritance" but i dont think it works too well
09:36:27*waleee-cl joined #nim
09:37:04dom96nerdrat[m], please report this as an issue on GitHub if you can. You can also give choosenim 0.4.0 a try, it's the version before nimarchive was introduced: https://github.com/dom96/choosenim/releases/tag/v0.4.0
09:40:03PMunchLooking at the Java language server and getting PTSD from my Java days
09:40:11PMunchThe project is 1148 files..
09:40:14PMunchNot lines, files
09:40:18Yardanicowhat
09:40:24Zevv1448 lines, that's not much!
09:40:29YardanicoZevv: LMAO
09:40:44Yardanicooh java is 1 class per file right
09:40:54Yardanico everything MUST be OOP, every single thing
09:41:04*krux02 joined #nim
09:41:12YardanicoPMunch: can you give link please?
09:41:20PMunchhttps://github.com/eclipse/eclipse.jdt.ls
09:41:29PMunchFor comparison nimlsp is 40 files
09:41:36PMunchOh wait..
09:41:43PMunchIt counts the .git folder..
09:41:50YardanicoPMunch: 120 thousand lines of Java code
09:41:53Yardanicowhat the heck
09:42:00Yardanico(I counted with cloc)
09:42:07Yardanicoand that's excluding comments
09:42:11Yardanicoand blank lines
09:43:00Yardaniconow I wonder if I should add my 30-line library to nimble ..
09:43:12PMunchnimlsp is 14 files, java lsp is 1009 files..
09:43:26YardanicoI mean people asked in https://forum.nim-lang.org/t/1305 but I refactored it a bit so it's just 30 lines now
09:43:31Faulanderrika, do correctly understand you. if intend to use inheritance i use ref object, if not, i CAN use object, but also ref object, correct?
09:43:46FromDiscord<Rika> yes yes
09:43:47YardanicoFaulander: yes, but there's other difference too
09:44:03Yardanicoif you use "object" and want to modify the instance in the proc you'll need to add it as "var MyType" in arguments
09:44:09FromDiscord<Rika> object is usually copy by value, ref object is "copy by reference"
09:44:12Yardanicobut when you have "ref object" you just write it as "MyType"
09:44:13Yardanicoyeah
09:44:24FromDiscord<Rika> techinically theyre both by value, just the value being copied differs
09:44:52Faulanderhmm, i need to try that out to correctly understand i think.
09:45:11PMunchLines in the project as counted by "find . -not -path '*/\.*' -type f -exec cat {} \; | wc -l"
09:45:26PMunchJava LSP: 230211, Nim LSP 1785
09:45:32YardanicoPMunch: well seems like it has a lot of Eclipse-specific stuff too
09:45:43PMunchNo, that's not a typo, 230k lines of.. stuff..
09:45:56PMunchStill..
09:45:58Yardanicoand cloc gives 120k lines of pure Java code (without comments and blank lines)
09:46:06Yardanicofor nimlsp "cloc" gives 1314 lines of pure code :)
09:46:25Faulanderso i understand "cope by reference right"? Copy by value is clear, thats a separate copy, copy by ref means if i change the referenced object, the reference object is changed too?
09:46:52YardanicoFaulander: if you pass your "ref object" to a procedure it can change it, yes
09:47:01Yardanicoeven if your "ref object" instance was declared with "let"
09:47:20Yardanicobecause "let" actually still works there -> it won't let you modify the reference itself
09:47:28FromDiscord<Rika> ok so faulander, `var a = someObject; var b = a; changing b will not change a`
09:47:49FromDiscord<Rika> `let a = someRef; let b = a; changing b will change a too`
09:48:19Faulanderthanks Rika, thats exactly what i meant
09:49:23PMunchJust to put this into context, the Nim compiler (as counted by "find . -name '*.nim'") consists of 336890 lines
09:49:46Yardanicoand that's including the whole stdlib
09:49:46PMunchThe Java LSP plug-in is more than 2/3 the size of the entire Nim compiler and tools..
09:49:51PMunchYup
09:49:52Faulanderso if i only have one instance of the object in my program, i can savely use ref object without putting much thought in it
09:50:03Yardanicowith "cloc compiler/" it's just 60k lines of compiler code (with 7k blank and 10k comments)
09:50:32PMunchSo by cloc the Java LSP plug-in is twice as much code as the entire Nim compiler, tools, and stdlib
09:50:45PMunchNo wonder RSI is a big problem in the software industry..
09:50:58Yardanicowell not exactly :P
09:51:09YardanicoNim repo has 260k lines of Nim code in total
09:51:25PMunchAh okay :P
09:51:33Yardanicowonder where does that amount come from, hmm
09:51:34PMunchI was wondering how much documentation was in there :P
09:51:49PMunchCloc should have a mode like baobab
09:51:55Yardanicoah right
09:52:00Yardanico"tests" 100k lines of Nim code :DDDDD
09:52:05Yardanicomore than the whole compiler
09:52:56FromDiscord<mratsim> Tests for such complex piece of machinery are expected to be longer than the code
09:52:56YardanicoPMunch: yeah it has "--by-percent"
09:53:29FromDiscord<mratsim> each "if/elif/else" or case statements technically needs a factor 2 to N more tests to cover all branches
09:54:55PMunchYardanico, should have a mode to output as .dot circle diagram :P
09:55:00Yardanicooh
09:58:41Yardanicohmm can't find it in "cloc" program
09:59:14YardanicoCloc being https://github.com/AlDanial/cloc
10:01:29*abm joined #nim
10:01:49PMunchOh no, not that kind of should, the other kind
10:01:55PMunchAs in, they should have implemented it
10:11:01PMunchHmm, I appear to need a hierarchy of style scopes to implement this semantic highlighting feature
10:12:47PMunchhttp://ix.io/2inQ <- something like this
10:13:08Yardanicolol
10:14:30PMunchFor all of these kinds: https://nim-lang.org/0.19.2/idetools.html#parsing-idetools-output
10:17:47PMunchHmm, highlight doesn't do string literals..
10:18:32PMunchNot sure if this is really sufficient to implement syntax highlighting..
10:18:33PMunchhttp://ix.io/2inS
10:22:07PMunchI guess I could implement some basic keyword recognition as well
10:22:17PMunchAlong with strings and comments
10:22:24Yardanicoyay
10:22:32YardanicoI mostly use VSCode because of the Nim extension
10:22:48Yardanicoif there was a way to have good Nim support in an editor like Sublime Text or similar I would use it instead :P
10:22:52Yardanicoand nimlsp solves that
10:29:31PMunchExactly
10:33:07dom96I'm constantly considering writing my own Nim extension for VS Code
10:33:15Yardanicoin Nim? :P
10:33:18dom96no
10:33:20PMunchHelp with NimLSP instead :)
10:33:28Yardanicowhat's wrong with current nim extension for vscode though?
10:33:42FromDiscord<Recruit_main707> its wonky
10:33:47YardanicoI know it has its own issues but not sure why a full rewrite is needed
10:34:08*sunwukong joined #nim
10:34:16*fredrik92 joined #nim
10:35:07PMunchFor every fix in NimLSP you fix something for every editor, much less cumulative work
10:36:47*couven92 quit (Ping timeout: 256 seconds)
10:37:02AraqI would have fixed it a long time ago but it's much code written in TypeScript and I don't even know how to test out my changes
10:37:37*fredrik92 is now known as couven92
10:39:34krux02Yardanico, A full rewrite is usually necessary if the old codebase is unmaintainable and the original maintainer is gone (probably because of this state)
10:40:31Araqor maybe because he was paid to do it and found a new job...
10:40:43Yardanicolol
10:40:53Yardanicowell the original creator of vscode-nim still seems to make occasional commits https://github.com/pragmagic/vscode-nim/commit/dbff0e830945a059f1990461c7c8215ede8dc822
10:41:03Araqthe original author is rarely the person who thinks "omg my code is so messy it needs to die already"
10:41:39*zacharycarter joined #nim
10:41:43FromDiscord<Recruit_main707> pragmatic has some of the bes projects of nim, but he tends to abandon the ones i like the most :p
10:41:51Yardanicoit's not a single person
10:41:58Yardanico"Pragmagic, Inc."
10:42:07Yardanicohttp://pragmagic.io/
10:42:08dom96Yardanico, it does a lot of annoying things, the bracket behaviour is wrong for example.
10:42:12Yardanicothey even mention nim on their page
10:42:27FromDiscord<Recruit_main707> the more you know
10:42:48dom96So I don't have a lot of confidence that the extension is well built
10:51:13FromDiscord<flywind> A new async http server(based on asyncdispatch and nativesockets). Now it works and begins to add more tests.
10:51:16FromDiscord<flywind> https://github.com/iocrate/netkit
10:51:33FromDiscord<Recruit_main707> nice
10:52:16FromDiscord<Rika> Interesting
10:56:51dom96Nice!
11:00:26zacharycarterwhy doesn't it bill itself as that then? the project description is rather misleading
11:00:49Yardanicozacharycarter: ?
11:01:09zacharycarterinstead of - Out-of-the-box, stable and secure network facilities and utilities written by pure Nim.
11:01:33Yardanico"Netkit is not intended to be a high-level productivity development tool" is about development, not usage
11:01:43Yardanico" ut rather a reliable and efficient network infrastructure." (but)
11:01:58zacharycarteryeah but the only functionality I see is an async http server
11:02:03zacharycarternot really network facilities and utiltiies
11:02:07FromDiscord<flywind> Now only server part is finished.
11:02:08Yardanicowell they'll add more later (TM)
11:02:33zacharycarterwell what else is going to be added? it mentions TCP / UDP/ Websockets
11:02:41zacharycarterthat's pretty vague
11:03:13*narimiran quit (Ping timeout: 264 seconds)
11:03:32zacharycarterI still find myself going to enet for reliable udp sockets
11:05:01zacharycartereither way - cool stuff
11:06:07Yardanicothere's also https://github.com/zielmicha/reactor.nim
11:06:15Yardanicobut it's not really maintaned
11:06:23Yardanicobut has quite a lot of stuff implemented
11:06:27FromDiscord<Rika> ooh reactor style
11:06:45Yardaniconot really
11:06:45zacharycarterI've never gotten anywhere with that project
11:07:11PMunchI think I might have a problem with implicit return abuse: http://ix.io/2io0/nim
11:07:33FromDiscord<Yardanico> @flywind https://github.com/zielmicha/reactor.nim worth checking out as it's related to your project
11:07:40AraqPMunch: definitely.
11:08:30dom96Rika: pretty sure async await itself is an example of the reactor pattern
11:09:11Araqonce again, we need an async that works with --gc:arc
11:09:33FromDiscord<flywind> Thanks. I'll check it. @Yardanico
11:09:56YardanicoAraq: would it be hard for current implementation to support it?
11:10:00*Romanson joined #nim
11:10:25AraqYardanico: IME yeah, it's very hard.
11:10:31PMunchIt used to be worse though: http://ix.io/2io2/nim
11:10:34Araqit works with --gc:orc though
11:10:49PMunch--gc:urukhai
11:11:02Yardanicoahaha
11:11:14Yardanico"Uruk-hai (for short, Uruks) were brutal warriors of Middle-earth, and the strongest Orcs" ORCs :DD
11:11:36Araqthanks for the lecture
11:11:45PMunchHuh, didn't know they were considered orcs
11:11:56Araqbut I think many knew already
11:13:08FromDiscord<Rika> not me
11:16:55livcddoes nim-chronos work with arc?
11:18:38FromDiscord<Rika> only one way to test
11:36:27*couven92 quit (Read error: Connection reset by peer)
11:36:55*couven92 joined #nim
11:43:54zacharycarterAraq: is the fix for https://github.com/nim-lang/Nim/issues/13935 to not make this assert - https://github.com/nim-lang/Nim/blob/a6682de0045468ae1d15afbd2fd5378960e15eb7/lib/system/mmdisp.nim#L87 - when `nimV2` is defined?
11:43:57disbotβž₯ SIGSEV encountered when creating threads in a loop w/ --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2ioe
11:47:05Yardanicozacharycarter: I don't think so, sysAssert is just an assert
11:47:17*sunwukong quit (Quit: Leaving)
11:47:17Yardanicoit's a template which only checks if condition is false
11:47:31Yardanicoand if -d:useSysAssert is defined and it's false, it prints out a message
11:47:36Yardanicoit doesn't quit the program or anything like that
11:55:40*rockcavera joined #nim
11:58:04zacharycarterhmmm
11:58:53*leth joined #nim
11:59:16lethis there a way to join arrays together in a static block?
11:59:26leth(a simple way)
11:59:37FromDiscord<Recruit_main707> do we have any web browser made in Nim??
12:00:36Yardanicothat's a very complex task if you actually mean implementing a whole browser (with layout, rendering, etc) in Nim
12:00:37Yardanicoso no
12:01:27FromDiscord<Recruit_main707> :(
12:01:28*couven92 quit (Read error: Connection reset by peer)
12:01:53*couven92 joined #nim
12:06:01*supakeen quit (Quit: WeeChat 1.9.1)
12:06:46*supakeen joined #nim
12:07:45FromDiscord<Rika> even firefox is just partially in rust
12:08:21Yardanicojust a tiny bit though
12:08:33Yardanicomost of it is C/C++/JS of course
12:09:09*dadada quit (Ping timeout: 256 seconds)
12:09:25Yardanicobrowsers are the most complex single piece of software we have nowadays
12:09:47Yardanicolike chromium literally can take 50-100 times longer to compile than linux kernel
12:10:42*dadada joined #nim
12:10:51FromDiscord<Rika> all because it has to implement 3 languages
12:11:05*dadada is now known as Guest44318
12:11:27YardanicoHTML and CSS are not programming languages though :P
12:11:45FromDiscord<Recruit_main707> the forbidden debate :0
12:11:47FromDiscord<Rika> i said LANGUAGES
12:11:51Yardanicowhich ones?
12:11:56FromDiscord<Rika> did i say programming did i
12:11:57FromDiscord<Rika> hmmmmmmmm
12:12:04FromDiscord<Rika> smh cant read
12:12:24*someunknownuser joined #nim
12:14:21PMunchHaha :P
12:16:10*xcm quit (Remote host closed the connection)
12:16:39*narimiran joined #nim
12:17:17FromDiscord<Generic> can the nim compiler invoke multiple c compiler instances in parallel?
12:17:28FromDiscord<Generic> like make -j4
12:18:11*xcm joined #nim
12:18:32Yardanicoit does that by default
12:18:36PMunch@Generic, --parallelBuild:4
12:18:37lqdev[m]@Generic it does that by default
12:18:41PMunchOh it does?
12:18:47Yardanicoyes
12:18:53PMunchNeat
12:18:59Yardanicohttps://nim-lang.org/docs/nimc.html "0 for auto detect"
12:19:00Yardanicoand 0 is default
12:19:05PMunchRight
12:19:07Yardanicoon my 3700X it uses all 16 threads
12:19:48Yardanicoso the compilation is pretty darn fast :P
12:20:18FromDiscord<Generic> ah, then it must have been the lack of conflicting console outputs which kept me from noticing it
12:38:57*Romanson quit ()
12:43:34*solitudesf quit (Ping timeout: 256 seconds)
12:45:04FromGitter<sealmove> guys, I am trying to play around with some windows paths but some procs don't work with them. Do I have to convert `\`s to `/`?
12:46:18Yardanicoyou can use / proc
12:46:34FromDiscord<Rika> "parent" / "childdir"
12:46:35Yardanicolike "myfolder" / "myfolder2" / "myfile.nim" will construct a path with DirSep for the OS
12:46:38FromDiscord<Rika> in `os`
12:46:43Yardanicoso if you're on linux it'll use /, on windows \
12:46:46FromDiscord<Rika> module `os`
12:46:55FromGitter<sealmove> when I use `/` proc I get a mixed string with `\` and `/`
12:47:02FromDiscord<Rika> ? really?
12:47:04Yardanicoyes they're escaping and stuff
12:47:07Yardanicothey'' work anyway
12:47:14FromDiscord<Rika> i mean \ AND / for windows?
12:47:18FromGitter<sealmove> I mean, I already have a string with `\`s and want to manipulate it
12:47:40FromDiscord<Rika> thatString / newString to add a folder then
12:47:54FromGitter<sealmove> yes, this gives me mixed string
12:48:07FromDiscord<Rika> can you show the output
12:48:58Yardanico@sealmove oh then that's harder
12:49:01Yardanicowell actually wait
12:49:15Yardanicomaybe you do stuff like "myfolder1/" / "myfolder2" ?
12:51:30FromGitter<sealmove> https://play.nim-lang.org/#ix=2iov
12:51:46FromDiscord<Rika> i mean show output since playground is linux
12:52:09FromGitter<sealmove> I am working on linux, but the paths are taken from Windows
12:52:17FromDiscord<Rika> then thats the reason
12:52:29FromDiscord<Rika> maybe set nim to compile for windows
12:52:57*tane quit (Quit: Leaving)
12:53:04Yardanicoyes
12:53:09FromGitter<sealmove> hmm, or I can manually convert the string to linux format in order to use the procs and then convert it back to Windows format?
12:53:17Yardanicoyou need --os:windows or manually concat with "\"
12:53:39FromGitter<sealmove> I see, thanks
12:55:17*opi joined #nim
12:57:50*Romanson joined #nim
12:59:56shashlickdom96 second time someone has had extraction issues but not sure what how to debug without reproducing locally
13:00:06*dwdv joined #nim
13:00:42dom96shashlick, do you know what OS/arch this user is on?
13:00:50shashlickEverything is statically linked with nimarchive, maybe we need an older libc or musl, I don't know
13:01:50*zacharycarter quit (Ping timeout: 265 seconds)
13:03:04dom96would be strange if this is a libc issue
13:03:14dom96I would expect an outright crash then
13:03:20dom96but maybe there is some weirdness possible here too
13:04:02*Senketsu joined #nim
13:04:47shashlickThey mentioned Linux amd64 that's it
13:05:34shashlickIf the wrapper was bad, it would fail consistently
13:05:36dom96yeah, we need more info. The Linux distro and version for example
13:05:54dom96if all else fails we can ask for ssh access to their machine
13:06:03shashlickI couldn't repro locally
13:06:46*solitudesf joined #nim
13:07:20shashlickLike the damn nimterop issue on osx with 1.2.0 and devel, consistently segfaults on Travis with no stack trace but works fine locally
13:07:51*opi quit (Quit: WeeChat 1.6)
13:08:56*hax-scramper joined #nim
13:11:13dom96shashlick, is that still a problem? AFAIK you can at least grab the same docker images that Travis uses and/or maybe even ssh into Travis, although that may require paying them
13:12:08*opi joined #nim
13:12:21shashlickCan you do that for osx as well?
13:12:42shashlickI've used the Linux image in the past successfully
13:13:03dom96I've never done it, but there must be a way. We can't be the only ones having such problems.
13:13:20shashlickI'll dig around
13:13:36disrupteklivcd: chronos does not work with arc.
13:13:46shashlickWould you mind running nimble test on nimterop head? You have osx right?
13:17:59*opi quit (Changing host)
13:17:59*opi joined #nim
13:20:14*tane joined #nim
13:20:28*Guest44318 is now known as dadaad
13:20:29*dadaad is now known as dadada
13:20:48*disruptek is now known as dadasdad
13:20:57dadadawhy does https://play.nim-lang.org/#ix=2ioH output foo, echo bar echo foo
13:21:09dadadainstead of foo: echo bar echo foo
13:21:43dom96shashlick, supposed to be doing non-hobby work right now, but I'll get to that in the evening, just remind me in around 6 hours.
13:22:06dadadaI'm looking for a way of getting the accurate original code for a NimNode
13:23:26dadadaargs.toStrLit.strVal gives the same result here
13:23:27*Spy653 quit (Quit: Connection closed for inactivity)
13:23:49dadasdadnode.repr
13:24:20solitudesfyou cant
13:24:27dadadadadasdad: that's what I used, you should have looked first, but your nick is splendid
13:25:10dadasdadonce the code is parsed, it's in a new format. you can render it but you cannot recover the original string.
13:25:49*tane quit (Quit: Leaving)
13:25:52*Senketsu quit (Quit: WeeChat 2.7)
13:26:18dom96yeah, the rendering isn't perfect either (fixing these would be appreciated)
13:26:35dadadanodes keep their original line/col in the lineinfo object, all that's missing is that the lineinfo object also keeps the original finalline/finalcolumn, and then it would be easy to extract from the sources, if needed
13:27:43*Senketsu joined #nim
13:27:55solitudesfyour complaint is about comma/column, which arent a part of any NimNode so thats irrelevant
13:33:38*Senketsu quit (Quit: WeeChat 2.7)
13:34:25*zacharycarter joined #nim
13:35:01*Senketsu joined #nim
13:36:16*Senketsu quit (Client Quit)
13:37:20*clyybber joined #nim
13:39:01*zacharycarter quit (Ping timeout: 258 seconds)
13:41:25clyybberAraq: How should we treat tuples of vars?
13:41:45clyybberSince mutability is not part of a type normally they are a bit tricky
13:41:47*Senketsu joined #nim
13:42:24clyybberMy first intuitive guess would be that they should only be allowed as return types/rvalues
13:45:35*xcm quit (Remote host closed the connection)
13:49:09*xcm joined #nim
14:04:01FromDiscord<mratsim> var tuple as return value have similar issues to var arrays as return value
14:04:07FromDiscord<mratsim> it crashes the compiler
14:04:11FromDiscord<mratsim> unless it's for iterators
14:05:41clyybberYeah. Where are var arrays as return values used?
14:05:48clyybberOr allowed/working rather
14:06:23*Senketsu quit (Quit: WeeChat 2.7)
14:07:53livcddisbot: so no async works with arc atm gotcha!
14:08:50*opi quit (Quit: Leaving)
14:09:04FromDiscord<clyybber> @mratsim ping
14:09:53FromDiscord<clyybber> Do you mean returning arrays of vars? What would that be useful for?
14:11:36*dadasdad is now known as disruptek
14:11:55disrupteklivcd: async works with arc, it just leaks memory.
14:12:11*zacharycarter joined #nim
14:12:22disrupteki run all my async code in a thread, anyway. solves the many problems i have with async.
14:12:38*opi joined #nim
14:14:03disrupteki thought var tuples are fixed now. cooldome closed my issue.
14:14:26clyybberdisruptek: Oh hey you're back!
14:14:32disrupteksup dawg
14:14:42companion_cubeI still need to get back to openapi
14:15:22disruptekare you the one that filed an issue for v3?
14:15:25*Senketsu joined #nim
14:15:55companion_cubeyep
14:16:25disruptekah, cool.
14:16:31*Senketsu quit (Client Quit)
14:16:46*endragor quit (Remote host closed the connection)
14:16:51disruptekdid you see that the schema is contained in a schema2 file or w/e?
14:17:27companion_cubeit's encoded in nim constructs, right?
14:17:31companion_cube(I did see the file)
14:17:37disruptekyeah.
14:17:57clyybberIMO the way to fix this date time issue is to make `var a: DateTime` equal `var a = default(DateTime)`
14:18:53disruptekyes, but we're just using datetime as a proxy for all reqinit objs, right?
14:19:00clyybberWhich Yeah
14:19:06clyybberd/Which
14:19:26disrupteki want an operator for that.
14:19:34disruptek?mydate
14:19:50clyybberWhat would it do?
14:20:01disruptekx == default(x)
14:20:05clyybberAh
14:20:19*nsf quit (Quit: WeeChat 2.8)
14:20:58disruptekx != default(x) i guess.
14:21:19disruptektricky. maybe it cannot be unary.
14:21:36disruptek?+ and ?- maybe.
14:21:46FromDiscord<treeform> Is there a way to get current modules path, or main module path during compile? I want to compile in the path it was compiled from.
14:21:50clyybberWhy can't it be unary?
14:22:01clyybberI thought every op can be unary
14:22:05clyybberMaybe I'm wrong
14:22:12disruptekbecause it's confusing.
14:22:25disruptektreeform: sure; using the compiler's config.
14:22:38disrupteksee nimph/src/nimph/config.nim
14:22:51clyybberI think there is currentSourcePath or something like that no?
14:22:58clyybberThat points to the current module
14:23:24FromDiscord<treeform> yes thanks currentSourcePath
14:23:27disrupteki think the project path isn't well-propogated.
14:23:56disrupteki jump through a ton of hoops to figure this out in bump.
14:24:22clyybberYeah, but when doing it in your own project its simpler
14:24:27clyybberSince you know where the file is
14:24:29disruptekalso, shashlick added some way to query the compiler for an arbitrary options list.
14:25:54FromDiscord<mratsim> @clyybber it would be useful for big integers
14:26:17FromDiscord<mratsim> you often work on half/half an array to implement multiplication and division
14:27:12FromDiscord<mratsim> this requires being able to split a bigint in 2: https://github.com/status-im/nim-stint/blob/master/stint/private/uint_div.nim#L123-L169
14:27:43FromDiscord<clyybber> The issue with this is that it conflicts with nims way of not attaching var to the type
14:27:56FromDiscord<clyybber> So ptr would be more appropriate there I think
14:29:06FromDiscord<clyybber> If I understood your right you meant to use `array[2, var array[...]]` right?
14:29:19FromDiscord<mratsim> well not even
14:29:35zacharycarteris there a way for to choosenim to list the current toolchain directory?
14:30:01FromDiscord<mratsim> I would like to be able to do `proc lo[N, uint64](x: array[N, uint64]): var array[N div2, uint64]`
14:30:23FromDiscord<clyybber> Ah, gotchu
14:30:27FromDiscord<mratsim> see bug: https://github.com/nim-lang/Nim/issues/8053
14:30:54FromDiscord<clyybber> Okay, thats a codegen bug
14:31:05FromDiscord<mratsim> ah it was closed
14:31:08FromDiscord<mratsim> I missed that
14:31:11FromDiscord<mratsim> have to retry
14:31:12FromDiscord<clyybber> Yeah πŸ˜„
14:32:25disruptekwhen did this datetime issue arrive?
14:32:31disruptek!issue datetime
14:32:32disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling 7& 29 more...
14:32:42disrupteknot that one.
14:33:53disruptek#14002
14:33:54disbothttps://github.com/nim-lang/Nim/pull/14002 -- 3fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` compiles and is usable
14:34:29disruptekwhatever changed actually broke working code i had.
14:34:55clyybberBut its not merged?
14:35:13disrupteki mean, i cannot build disbot in 1.2.
14:35:16clyybberOh
14:35:23clyybberBecause of DateTime?
14:35:26disruptekyeah.
14:35:46clyybberI thought this issue has existed since forever
14:36:04zacharycarterQuestion - https://github.com/nim-lang/Nim/blob/devel/lib/system/threads.nim#L148 - shouldn't that also check to ensure that `nimV2` isn't defined?
14:36:24zacharycarter`nimV2` = `--gc:arc` correct?
14:39:33disruptekthere's a better define.
14:39:41zacharycarterwhat is that?
14:39:51dom96IIRC nimV2 is something else
14:40:01clyybberNope nimV2 is essentially gc:arc
14:40:05disruptekit's in alloc.nim iirc.
14:40:27zacharycarterwell regardless - shouldn't that check include checking for arc?
14:40:42clyybberNot sure, why would it?
14:41:07zacharycarterbecause if it doesn't it's going to execute `nimGC_setStackBottom` and `initGC` etc
14:41:17zacharycarterwe don't want that to happen in the case we're using `arc` correct?
14:41:20clyybberOh, yeah then it probably should :D
14:41:23zacharycarter:D
14:41:42zacharycarterokay I will try to find a better suited define in alloc.nim and then PR
14:41:45leorizenimV2 is --seqsv2 iirc
14:43:01disruptekgcDestructors
14:43:51disruptektechnically, #11081 is consistent now.
14:43:52disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling ; snippet at 12https://play.nim-lang.org/#ix=20PX
14:44:03zacharycarter`gcarc` is it I guess
14:44:04disruptekall three examples fail to compile due to uninit datetime.
14:44:49disrupteknot gcDestructors?
14:45:08zacharycarterhttps://github.com/nim-lang/Nim/blob/9c46927fad6535cf7e172f5af5e93d179cec1020/compiler/commands.nim#L494-L504
14:45:11clyybberleorize: Yeah, optSeqDestructors implies nimV2
14:45:23clyybberAnd so does optOwnedRefs
14:45:31leorizezacharycarter: https://github.com/nim-lang/Nim/blob/352232e62dea88191339af3aaa943cb93fb4db02/lib/system/gc_interface.nim#L3
14:45:34leorizefix that instead
14:45:37disruptekoh, i see; it's both. 😁
14:46:02leorizehmm, it already disabled that code path
14:46:04zacharycarterleorize: what needs fixing there? I'm dumb - please explain more
14:46:06clyybberdisruptek: lol :D
14:46:24leorizezacharycarter: look at the when you referred to
14:46:30leorizeit has `not usesDestructors`
14:46:38zacharycarteroh so add gcarc there
14:46:51leorizegcDestructors has already been added there
14:47:07disruptekjust PR the removal of one of the names.
14:47:08leorizethat code path is already disabled on arc
14:47:14zacharycartergotcha
14:47:20zacharycarterso nothing needs fixing - good
14:47:53zacharycarterjust trying to hunt down what's causing this thread error and why it only happens in the c backend and not the cpp backend
14:48:08disruptekprobably exception-related.
14:48:36zacharycarterokay good to know that
14:48:57dadadadoes Nim have any generalized wasy of distinguishing specific kinds of types? ie. int, int8, Natural, are all useful for counting stuff (countables?); seq[foo], array, tables, ..., are all containers/collections (enumerables/collections); I'm asking this because this would help me with writing a template that takes two arguments, where one argument is the former category and the second is in the latter one
14:49:03dadadas/wasy/way
14:49:30disruptekint or int8
14:49:33clyybberOrdinal for the first
14:49:38narimirandadada: Ordinal
14:49:53clyybberAnd for the latter there is none. Concepts are probably what you want
14:49:55dadadaokay, thanks so there's one :-)
14:50:05clyybberOr unbounded generics
14:50:12disruptekoh, i thought you were asking about typeclasses.
14:50:42companion_cubedisruptek: I'm new to nim, why is nimph a separate thing from nimble?
14:51:07disruptekbecause its approach is so fundamentally different.
14:51:33dadadaI'd like to do something like template myTempl(ord: Ordinal, e: Enumarable) # I think in C# they call it Enumarable
14:51:59companion_cubebecause of lockfiles?
14:52:30disruptekno; nimble asserts environment while nimph merely vets it.
14:53:17disruptekif you look at the code, i've added {.warning: "this needs implementing to warn of foo".} in the doctor.
14:53:38disruptekthere's a lot more that we know about the environment and can teach the user about.
14:53:58companion_cubehmmmmmmm
14:54:31disruptekwhat language are you coming from?
14:54:50companion_cubeOCaml mostly
14:54:53zacharycarterYardanico: I don't think this comment is accurate - https://github.com/nim-lang/Nim/issues/13935#issuecomment-614271961
14:54:54disbotβž₯ SIGSEV encountered when creating threads in a loop w/ --gc:arc ; snippet at 12https://play.nim-lang.org/#ix=2ioe
14:55:04zacharycarterI tried the commit you said is working, and it's not
14:55:31leorize[m]disruptek: I need some help on this: https://github.com/nim-lang/nimble/pull/768#issuecomment-611113450
14:55:32disbotβž₯ nimscript{wrapper,api}: don't copy generated script to package directory
14:56:20disruptekyou can forge your location and run the compiler's config parsing.
14:56:47leorizeyea but nimble don't link to the compiler
14:57:03disruptekoh, i forgot.
14:57:18disruptekyou're basically screwed.
14:58:12disruptekmaybe i don't understand the use-case, though.
14:58:29dom96leorize: I was going to suggest a compile change to make this possible.
14:58:32dom96*compiler
14:59:34disruptekyou cannot run the nimscript from the package directory?
14:59:37*opi quit (Ping timeout: 264 seconds)
15:01:15*leorize[m]1 joined #nim
15:01:18leorize[m]if I can this PR wouldn't be there :P
15:01:56disruptekno; chdir package-dir; nim e /some/script/elsewhere.nims
15:02:24dom96imports break then
15:02:28leorizealready did, the compiler still won't parse the configs
15:02:46disruptekah; it thinks the project dir is where the script is located.
15:02:51leorizeyea
15:03:01disruptekcan you pass that as an override in the command-line?
15:03:35leorizenope, you can't
15:03:42disruptekshit, really?
15:03:53leorizethe compiler isn't really geared for scripting, yet
15:03:59disruptekhey, let's stream it.
15:05:08disruptekjust have to merge obs.
15:06:37leorizeI think we'd want something along the lines of: `nim e --realScript:/path/to/nims file.nimble`
15:07:55dom96you may want to get Araq's approval first
15:08:24disruptek~stream
15:08:24disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
15:09:09*oculux joined #nim
15:10:50leorizedisruptek: project .nims file will be run along side the .nim file
15:11:23*opi joined #nim
15:11:47leorizecheck twitch chat lol
15:14:45dadadawhy is the len proc not documented for sets like it is for strings/seqs? https://nim-lang.org/docs/system.html#system-module-sets
15:15:10leorizeit's just an alias for `card`
15:15:11dadadaI mean, in this table, it might be somewhere else, but in this table it looks like you'd have to use card instead
15:15:56leorizeyea, the right term is `card`. it's a set, and a set don't have a length
15:15:56FromDiscord<mratsim> @dadada, len is new, less than a year old
15:16:28disruptekthat's my fault.
15:16:32FromDiscord<mratsim> the rational is that `len` is for O(1) but for a set you need to iterate on the set to get the number of elements contained
15:16:37disrupteki added len and didn't add it everywhere in the docs.
15:16:45disrupteklen is an alias.
15:17:08FromDiscord<mratsim> well before you added it, it wasn't there because of the reason I explained
15:17:18dadadasuppose you're new to Nim, you look at the sets table and compare it to the seq table, you're likely to conclude that there's no len for sets, because you rightly expect there to be consistency in documentation, and if there's len documented for seq and not for sets, you'd expect that to accurately reflect the way things are
15:17:22*silvernode joined #nim
15:17:23FromDiscord<mratsim> in-between counting set elements was changed to popcount instead of testing bit by bit
15:17:51FromDiscord<mratsim> sure
15:18:04disruptekthe idea of len() is not to differentiate from card() semantically; it's to enable the same code to be written against sets and seqs.
15:18:27FromDiscord<mratsim> yes, but in the past len for sets was very slow
15:18:30disruptekwhat it means is, how many elements are in this collection.
15:18:56leorizeI don't even think speed is something that we concern ourselves with the API
15:19:00dadadadisruptek: yeah, exactly why I need len for sets now, and then I looked it up in the docs, was disappointed, tried len on sets nevertheless, and then I didn't know whether it is deprecated or not (thought that may be the reason for it not being in the docs)
15:19:06leorizeiirc even linked list have `len`
15:19:15disrupteknope, they don't.
15:19:26disrupteki thought about adding it, though.
15:19:48leorizebtw check twitch chat again
15:19:48FromDiscord<mratsim> there was some discussion I don't know where, were we didn't want to have a len for set because it would automatically make an user algorith O(n^2) if called in a loop and it was assumed to be like seq.len
15:19:50zacharycarterdisruptek - I think you were right, looks like this commit broke threading for `--gc:arc` and the C target
15:19:54zacharycarterc3344862b0d6061cc1581f29c81b29b75c78615
15:20:02zacharycarterwhich is - --exception:goto switch for deterministic exception handling (#12977)
15:20:03disbothttps://github.com/nim-lang/Nim/pull/12977 -- 6--exception:goto switch for deterministic exception handling
15:20:53disruptekmratsim: it makes sense. i hate it, too.
15:21:07disruptekmaybe we just issue a warning.
15:21:38disrupteki mean, it's really not on us to explain the complexity of every algo in the stdlib.
15:21:47leorizezacharycarter: try --gc:arc --exceptions:setjmp
15:21:53zacharycarterokay
15:21:56leorizeif that works, then the bug is in --exceptions:goto
15:22:07disruptekwe have to be able to provide slow-but-useful algos as well as fast ones.
15:22:25FromDiscord<mratsim> @disruptek, with the popcount implementation it's fine
15:22:47zacharycarterleorize: yeah `--exceptions:setjmp` works :D I'll add that to my comment in the issue
15:22:56FromDiscord<mratsim> a popcount is as fast as retrieving the data from memory
15:23:15dom96disruptek, documenting the complexity would certainly be helpful
15:23:26FromDiscord<mratsim> well base data structures need to be reasonably fast
15:23:27disrupteki get it.
15:23:39disrupteki hadn't read your popcount comment.
15:23:49leorize[m]https://github.com/nim-lang/Nim/blob/devel/compiler/bitsets.nim#L99
15:23:59leorize[m]pretty sure it's not implemented like that atm
15:24:14FromDiscord<mratsim> isn't that just for compile-time?
15:24:25FromDiscord<mratsim> pretty sure I saw a PR from @narimiran on that
15:25:05FromDiscord<mratsim> otherwise that's bad
15:26:11leorizeah, I see it
15:26:14leorizelib/system/sets.nim
15:26:43leorizeit's not popcnt though
15:27:56FromDiscord<mratsim> still much better than looping on each bits
15:28:13FromDiscord<mratsim> and the length is 1 or 2 since we can store uint16 at most in a bitset
15:28:58*couven92 quit (Ping timeout: 256 seconds)
15:29:15*narimiran quit (Ping timeout: 265 seconds)
15:30:07*Trustable joined #nim
15:35:08Araqmratsim: problem is the slow loop is O(1) still ;-)
15:35:27Araqsometimes CS theory is a failure
15:36:07leorizeAraq: what do you think about the `--realScript` idea above?
15:36:59*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:37:25AraqI rarely read the logs
15:37:55leorizeit's something like this: `nim e --realScript:/path/to/nims project.nimble`
15:38:19Araqeverything that improves Nimble is fine with me
15:38:40Araqstill need to write my RFC about nuking Nim's config system .... :P
15:38:49dom96oh really
15:38:55leorizelol I'm adding this to make nimble work with the config system
15:39:01leorizeyou can't just nuke it like that
15:39:04dom96I'll put that on a poster and start writing PRs for the compiler then :P
15:40:02Araqdom96: be my guest, I'm not hostile to PRs. I'm hostile to PRs that fix X while at the same time change Y and then remove Z because the OP doesn't like Z
15:42:00dom96Araq, a while ago you were really against me changing anything in the compiler for the sake of Nimble.
15:42:01FromDiscord<0ffh> hi, sorry noob question: what was the keyword top have something execute (like closing file for cleanup, etc) when leaving scope?
15:42:07*narimiran joined #nim
15:42:13dom96Araq, by "a while ago" I mean years ago of course :)
15:42:20leorize0ffh: `defer`
15:42:22AraqI also don't understand your point. iirc we introduced the whole nimbleDir feature for Nimble
15:42:24FromDiscord<0ffh> thx
15:42:34*liblq-dev quit (Ping timeout: 240 seconds)
15:43:01Araqdom96: yet the better *design* is often the result of making the Nim compiler unaware of Nimble
15:43:05leorizecan we eventually get rid of nimbleDir? :P
15:43:09dom96Araq, fair enough, you allowed that.
15:44:32dom96leorize: sure, what will we replace it with?
15:44:58leorizeconfiguration files for package manager
15:45:12leorizenimph use that and it works well
15:45:20disruptekwhat do you need a config file for?
15:45:31dom96you mean *for Nim* not for the package manager?
15:45:34FromDiscord<mratsim> we use NIMBLE_DIR extensively to make nimble compatible with our submodules system
15:46:07FromDiscord<mratsim> and not pollute our own personal repo
15:46:07*zacharycarter quit (Ping timeout: 250 seconds)
15:46:30FromDiscord<mratsim> i.e. in our work environment "export NIMBLE_DIR=vendor/.nimble"
15:46:43FromDiscord<mratsim> and then we're good
15:47:12dom96mratsim: I think leorize is referring to something else
15:47:22dom96i.e. the --nimbleDir switch supported by the compiler
15:47:34leorizeafaict the idea of `nimbledir` is so that you don't have to use a `cfg` file to point the compiler to the actual packages
15:48:20leorizeyou can just use a cfg file that do `for i in walkDir(nimblepath): switch "path", i`
15:48:58dom96so you want Nimble to generate a cfg file which the compiler can then read
15:49:12dom96Right now Nimble generates a .nims file, so that the compiler can read it
15:49:15dom96and you're working to fix that
15:49:16dom96:P
15:49:22dom96Can you see the irony? :)
15:50:02leorizethe compiler is chasing nimble :P
15:50:29*tane_ joined #nim
15:51:48Araqnimble generating the .nims file to run seems to me the best way to do it, what's wrong with it?
15:52:14Araqshashlick did a terrific job on that.
15:52:31leorizedisruptek: does nimph work with Nim's `pkg` import prefix?
15:52:55disruptekif it works in nim it works in nimph, afaik.
15:53:21*fputs joined #nim
15:53:30leorizei think the pkg import prefix requires --nimbledir to be configured
15:53:31disrupteknimph doesn't express the environment except in ways that the nim compiler reads the environment. that's how they communicate.
15:53:58FromDiscord<mratsim> sometimes I accidentally commit the ".nims" file generated πŸ˜›
15:54:08dom96mratsim: :'(
15:55:46FromDiscord<mratsim> https://github.com/mratsim/constantine/pull/24/commits/47bc4289381eb3bbbe7d2c1a1b9dee96891e7875
15:55:47disbotβž₯ Initial support for Elliptic Curve
15:57:38*chemist69 quit (Ping timeout: 256 seconds)
15:58:35*chemist69 joined #nim
16:01:23*narimiran quit (Ping timeout: 260 seconds)
16:10:09*narimiran joined #nim
16:15:50Araqsounds like a job for a better gitignore
16:16:50dom96Yeah, say what you will but I personally dislike having dozens of these files and needing to remove them manually
16:17:27dom96Maybe that's a bug and Nimble should be removing them, but since it's still happening the best way to ensure it stops happening is to stop generating these files.
16:22:31*liblq-dev joined #nim
16:23:14clyybberAraq: What do you think about this: https://irclogs.nim-lang.org/17-04-2020.html#13:41:25 ?
16:24:41shashlickWhy lot a flag to specify explicit project path to Nim
16:24:42*narimiran quit (Remote host closed the connection)
16:25:05shashlickSo it will load imports and cfg files even though the nim or nims file is elsewhere
16:25:19shashlickBut nothing generic about that
16:27:37*xcm quit (Remote host closed the connection)
16:29:45*xcm joined #nim
16:33:43*narimiran joined #nim
16:34:59*couven92 joined #nim
16:38:55Araqdom96: huh? for me they are deleted
16:39:07Araqor maybe they are stored where I don't notice :P
16:39:20leorizethey're deleted unless nimble crashes
16:39:32leorizeor if you run an old nimble that doesn't have the bug fixed
16:39:40shashlickthis is based on leorize's PR
16:40:15Araqclyybber: it's covered by our RFC regarding borrowing
16:40:19shashlickhe avoids the copy altogether and makes imports work
16:40:19Araqat least it should be
16:40:26shashlickbut cfg files get missed
16:40:45shashlickit would be cool if we could override the project dir - wondering what other use cases it will benefit to make it worthwhile
16:40:59Araqwell here is my idea once again:
16:41:38*audiophile joined #nim
16:41:38Araqthe config should only be concerned with user specific or machine specific settings (like which C compiler to use or whether you like colors in the compiler's output)
16:41:53Araqeverything else should be done inside the .nim file via pragmas
16:42:00Araqfor two reasons:
16:42:02Araq- simplicity
16:42:08audiophile:D
16:42:14Araq- composability
16:42:25Araqin fact, inside a Nimble package only pragmas really work
16:42:38Araqas the package config is simply ignored altogether
16:42:56Araq(the Nim compiler does it this way since forever)
16:42:59audiophileany idea when competitive programming websites will add support for nim? or is that something we have to request?
16:43:15leorizeAraq: --path is a popular one that people use
16:43:43Araqleorize: yeah
16:44:02Araq--path is an open problem but a .path pragma sounds feasible
16:44:25shashlicki like that cfg files for packages are ignored
16:44:40shashlickbut i do agree pragmas for everything possible in cfg files is very useful
16:44:57*waleee-cl quit (Quit: Connection closed for inactivity)
16:45:18disruptekugh .path sounds bad.
16:45:30shashlickbut what about all the legacy cfg files out there
16:45:51Araqshashlick: we support them for another decade but phase them out
16:46:01shashlicki'm on board with that idea
16:46:05clyybberAraq: Yeah, I don't really refer to the safety of that feature, just that it introduces var to the type system, because we then have tuple[var int, var int] for example.
16:46:14shashlicki'd really like a {.define.}
16:46:25Araqshashlick: we have it, check it out on devel
16:46:38shashlickpeace
16:46:43Araqclyybber: it's an old feature though, how else would 'mitems' and 'mpairs' work?
16:46:54clyybberYeah, I am aware
16:47:01*narimiran quit (Ping timeout: 264 seconds)
16:47:15clyybberI'm just thinking about how it fits into the type system
16:47:26clyybberAnd how it fits with view/lent/var
16:47:35Araqwell it's a type.
16:47:43Araqso that's how it fits :P
16:47:43shashlickokay but are there other cases where overriding the project dir would be useful
16:47:49clyybberBecause in theory having an object field thats a view into some array isn't too crazy either
16:48:22clyybberAraq: Heh, ok so do we want to support object[field: var int] ?
16:48:46Araqclyybber: yeah, every type that contains lent/var becomes a "borrowing" type
16:49:02leorizeif `var type` becomes first class can we get rid of `byaddr`? :P
16:49:07shashlickleorize how did you fix the import issue with your PR
16:49:07clyybberAh okay. That makes sense
16:49:17leorizeshashlick: --path
16:49:18Araqand a borrowing type must be derived from the first parameter yada yada
16:49:26shashlickyep
16:49:28clyybberOr we use that from syntax?
16:49:32Araqleorize: yes
16:49:41Araqclyybber: yes, as a later extension
16:49:44clyybberBut yeah, first parameter is good enough for now
16:49:54shashlickthe thing i still don't like is that we need to prepend text to the nimble file for it to work
16:50:10shashlickwould be cool to tell nim here's two nim files, put them together and run it as one
16:50:16leorizeshashlick: in fact I can now generate `include file.nimble` instead of copying the content
16:50:26leorizestill won't make the configuration parses though
16:50:28Araqleorize: I think we need 'var x = byvar(y)' instead of .byaddr
16:50:38leorizeyea
16:50:44Araqbut we can always map .byaddr to the new, better implementation
16:50:53Araqwhich is why I accepted it.
16:51:16leorizeI'm still waiting for first-class borrowing :P
16:51:34Araqdon't wait for it, implement it
16:51:48leorizeI'm working on some other things
16:52:07Araqfair enough
16:52:10leorizeit's harder than I expected to make sure that the GC is not touched, at all in a code path
16:52:38Araqwell you use --gc:arc and there you go
16:53:09leorizeif I'm gonna implement an alternative `osproc`, I want it to work everywhere
16:53:41leorizecan't have users if I can't get it to work without --gc:arc
16:54:26Araqah I see your problem.
16:54:34Araqstill there is GC_disable/enable
16:56:58dom96Araq, so in each module I would need multiple {.path.} pragmas?
16:57:06dom96how would this work?
16:57:43clyybberAraq: Another thing regarding default fields (since its required to fix the DateTime issue properly), I think I'll do the transformation in transf.nim for now, as injectdestructors doesn't process VM code. But that means I can't optimize the unneccessary initializations away.
16:57:51dom96How would you deprecate the global config files?
16:58:00clyybberSo the question is, do we want to make the VM ready for injectdestructors?
16:58:49clyybberI feel like we must eventually, since people probably expect their custom destructors to be called for closing files and things like that
16:59:31dom96I'm starting to think it may be a good idea to set up dedicated chat rooms for things like Nimble or maybe even specific Nim/Nimble feature/change proposals
16:59:51dom96Otherwise it's just way too easy to lose context and get lost in the noise of other discussions
17:01:14Araqclyybber: yeah... the VM needs to run destructors, yay
17:01:55Araqdom96: well the config remains but we don't add more features to it
17:02:20Araqand we also see the pragma system is powerful enough so that you can avoid the config system altogether
17:03:00shashlickAraq: so you talking about deprecating .cfg files only, or .nims files getting autoloaded as well?
17:05:16Araqshashlick: both .cfg and .nims files are wrong... *cough*
17:06:09Araq.nims files had a good idea, use Nim instead of the undocumented .cfg file format
17:06:34Araqbut the implementation is messed up and continues to cost development resources
17:06:54Araqit's very subtle that system.nim is actually processed twice
17:06:58dom96based on user experiences, it seems that most user's expectations are that nim configuration should go into the .nimble file
17:07:12dom96and I think that is the least surprising and might be worth pursuing
17:07:22Araqso here is a possible implementation, shashlick
17:07:28disruptekthat's bananas.
17:07:31dom96of course I know that Araq does not want everyone to use Nimble-by-default so this won't happen
17:07:52Araqdisruptek: let me finish please and then you can raise your voice, ok?
17:08:04disrupteki'm responding to dom.
17:08:06disruptekbut, sure.
17:08:49Araqinside system.nim at the end of it we have something like {.autoinclude: "globalconfig.nim".}; {.autoinclude: "$project.nims".}
17:09:14Araqand that's it, pragmas inside these autoinclude files do the configuration
17:10:18Araqso ok, these are my thoughts, now I'm ready to take your feedback
17:10:36disruptekmumble.
17:10:42clyybberI find deprecating .cfg a good idea
17:10:44disruptek~stream
17:10:44disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
17:11:05*someunknownuser quit (Ping timeout: 240 seconds)
17:11:13Araqhmm ok
17:11:48clyybberAbout the other stuff, I don't know. In theory it seems like a cool way to solve the problem
17:12:02clyybberBut nims files are also used to compile dependencies, right?
17:12:15clyybberWon't that break here?
17:15:17clyybberMaybe I misunderstood what you proposed
17:15:51*NimBot joined #nim
17:18:00Araqclyybber, discussions was moved to mumble...
17:19:03clyybberOkay
17:19:04dom96That's a nice way to get a less noisy conversation :)
17:19:19dom96as long as multiple people don't speak at once
17:20:00Yardanicono recordings though :(
17:21:18supakeenMumble can be recorded of course if you'd want to.
17:21:31shashlickjust jumped on so missed part of the discussion
17:21:34supakeendom96: If it gets out of hand mumble offers a lot of things to ensure that doesn't happen :)
17:21:58*tane_ is now known as tane
17:22:01*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
17:22:21disruptekthis is recorded.
17:22:29disruptekyou can participate live or watch later.
17:22:42dom96lol
17:22:45dom96you should make that clear
17:23:02disruptek~stream
17:23:03disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
17:23:19Yardanicodisruptek: well doesn't twich remove all streams if you don't pay?
17:23:24Yardanicoafter a month I mean
17:23:25disrupteknope.
17:23:26Yardanicorecording of the stream
17:23:28disruptekwell, yes.
17:23:38disruptekif you need to know what happened here next month, i'll let you know.
17:23:44supakeenhehehe
17:26:54opireading IRC channel over Twitch, heh
17:27:08Yardanicoopi: you can connect to twitch from irc too btw
17:27:55opiYardanico: I'm just a Nim lurker, so I did not expect to crash head on into *deep discussions* ;-)
17:32:30Yardanico~mumble
17:32:30disbotno footnotes for `mumble`. πŸ™
17:32:40leorize~stream
17:32:40disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat)
17:32:45Yardanicoyeah
17:33:27*someunknownuser joined #nim
17:44:13*someunknownuser quit (Quit: someunknownuser)
17:44:31*someunknownuser joined #nim
17:44:42FromDiscord<treeform> PMunch, the 15GB of free memory is an interesting problem . The memory is "freed" for nim, but its not "freed" for the os. I can see some sort of system that goes, hey I have a GB of free memory, lets return it to the OS....
17:45:20FromDiscord<treeform> Another solution could be that when allocating 100mb chunks of memory it would use system malloc and system free, by passing the free pool logic...
17:47:04FromDiscord<treeform> Avatarfighter, about UDP hole punching is code-wise pretty easy, but it requires servers to exist... its a system problem not a library problem.
17:47:42FromDiscord<treeform> faulander, I added a way to resize images, I don't know if you saw.
17:55:41*dddddd quit (Ping timeout: 250 seconds)
17:57:11disruptekshashlick: there's a newer fork/replacement for plumble iirc.
17:57:21*Lord_Nightmare joined #nim
18:04:07*narimiran joined #nim
18:05:35PrestigePMunch: didn't read all of your chat earlier, but I think having a "non-strict mode" for jsonschema would be a good idea
18:09:10*narimiran quit (Quit: leaving)
18:13:34*yumaikas quit (Ping timeout: 240 seconds)
18:14:50*zacharycarter joined #nim
18:16:28*shodan45 quit (Quit: No Ping reply in 180 seconds.)
18:24:17*waleee-cl joined #nim
18:25:52*shodan45 joined #nim
18:30:37*clyybber quit (Quit: WeeChat 2.8)
18:31:34*opi quit (Ping timeout: 240 seconds)
18:34:23*opal quit (Ping timeout: 240 seconds)
18:38:06*opal joined #nim
18:39:39someunknownuserAre methods currently supposed to work with --gc:arc?
18:39:50Yardanicosomeunknownuser: try it :P
18:40:23someunknownuserI am asking because I am having problems getting them to work properly
18:40:50someunknownuserIn some cases the base methods are called instead of the overwritten ones
18:43:07*fputs quit (Quit: WeeChat 2.8)
18:45:47Araqsomeunknownuser, is that specific to --gc:arc?
18:45:54someunknownuseryes
18:46:12Araqthen report it please, it's supposed to work, the impl was ported
18:46:46someunknownuserok, I am trying to create a mininal example
18:46:49FromDiscord<Recruit_main707> are they on different files?
18:47:36someunknownuseryes
18:47:57FromDiscord<Recruit_main707> are you sure thats arc specific??
18:48:42FromDiscord<Recruit_main707> and you are calling it from the first or second file?
18:48:42someunknownuseryes, but you can try for yourself. The project in question is on github: https://github.com/pseudo-random/editor
18:49:10someunknownusercalling from the file which defines the base methods
18:49:29someunknownuserthat would be window_manager.nim
18:55:59someunknownuserwhen I rename the arguments to be the same as in the base method it seems to work
18:56:32zedeusdamn, jester crashes with arc but asynchttpserver alone doesn't
18:56:55FromDiscord<Recruit_main707> Araq: is thats how its supposed to work??
18:57:49someunknownusereven if it is how that is supposed to work, changing the gc should not affect method resolution imo
19:00:46*Vladar quit (Quit: Leaving)
19:05:32*opi joined #nim
19:10:13*opi quit (Ping timeout: 258 seconds)
19:14:13*Romanson quit (Quit: Connection closed for inactivity)
19:16:22*opi joined #nim
19:23:23*opal quit (Ping timeout: 240 seconds)
19:24:51*opal joined #nim
19:32:36dadadahmm, you can't access the sons of a NimNode directly, what I want to do is to add something to the beginning of a nnkCommand
19:32:46dadadathere's add() for adding stuff to the end
19:33:18dadadaof course I can create a new command NimNode, but that seems inefficient
19:35:09disruptekshashlick: might have reproduced the choosenim problem? https://api.travis-ci.org/v3/job/674719467/log.txt
19:38:15*Faulander is now known as Faulander|afk
19:45:23*opi quit (Quit: Leaving)
19:50:27shashlickthat's the github API limit issue
19:50:40disruptekah, cool.
19:50:48shashlicka pain nonetheless
19:54:38*nullwarp joined #nim
20:01:30FromDiscord<Varriount> Do we currently have a good, cross-platform way to dynamically allocate something on the stack?
20:02:19leorize[m]no, and please never do that
20:02:44leorize[m]dynamic stack allocation and cross platform is a recipe for disaster
20:04:48leorize[m]usually the best way would be to allocate a static chunk (ie. an `array[2048, char]`) then use parts of it as needed
20:04:50FromDiscord<Varriount> leorize: I should use recursion then?
20:05:07leorize[m]depends on what you're doing
20:05:30FromDiscord<Varriount> Path processing. Specifically collapsing `..` elements.
20:05:38leorize[m]though recursion is a kind of dynamic stack allocation, just a bit more structured
20:07:34leorize[m]I think a seq acting as a stack works here
20:09:34FromDiscord<Varriount> I guess. Seems like a waste to allocate something that will only store a couple of integers on the heap though.
20:10:01*yumaikas joined #nim
20:10:22leorizesystemd devs thought so and they stack overflowed their stuff to oblivion :P
20:10:33leorizea big static array works too if you feel like it
20:10:33FromDiscord<Varriount> Good point.
20:12:56*leorize[m]1 left #nim ("User left")
20:16:05leorizea nim int is 8 bytes on a 64 bit machine
20:16:38leorizea typical path is usually < 256 char
20:17:02leorizeso around 2kb of stack space for an array[256, int]
20:17:13*Tyresc joined #nim
20:17:15FromDiscord<SrMordred> Are nim incremental compilation working? iΒ΄m experimenting on windows and looks like it compiles eveything again even if nothing is change
20:17:18leorizeshould be affordable given how stack size are typically 2-4MB
20:17:26companion_cubegosh I read `8 bits` and was panicked for a second'
20:18:09leorize@Varriount: as an optimization I guess you can use this for path shorter than 256 char
20:19:15leorizeof course the true optimization is to bring out SIMD and get position of all path seps simultaniously :P
20:21:08leorizebut until someone create a lib that let you do low overhead runtime function selection based on processor I don't see SIMD getting used in generic library code anytime soon
20:22:28*ZoomZoomZoom joined #nim
20:27:16*tane quit (Quit: Leaving)
20:33:48*filcuc joined #nim
20:39:14*nullwarp quit (Remote host closed the connection)
20:40:46*endragor joined #nim
20:46:08FromDiscord<Generic> @SrMordred afaik there was some work on incremental compilation though it's not complete and currently paused
20:46:18*couven92 quit (Read error: Connection reset by peer)
20:46:43leorizedisruptek is working on incremental compilation
20:46:43*couven92 joined #nim
20:47:07FromDiscord<SrMordred> @Generic oh, i thought that it was already working. thanks!
20:50:12*nullwarp joined #nim
20:52:37*someunknownuser quit (Quit: someunknownuser)
20:57:57*endragor quit (Remote host closed the connection)
21:09:25FromDiscord<Recruit_main707> how does incremental compilation work??
21:15:51PMunchPrestige, yes but should it be the default?
21:16:31PrestigeI think most have that set by default, so it may be implicitly expected by the end user of the lib
21:16:40PMunchtreeform, it's a tough problem indeed.. And one that can't really be properly solved without either A moving memory or B having better control over memory (something that OSes don't provide unfortunately)
21:17:12PMunchA requires another level of indirection if it should be completely hidden from the caller though..
21:17:17PrestigePMunch: before you go, let me PM you my pub key
21:18:16*couven92 quit (Read error: Connection reset by peer)
21:18:39*couven92 joined #nim
21:35:14*solitudesf quit (Ping timeout: 240 seconds)
21:41:17*PMunch quit (Quit: leaving)
21:44:06*liblq-dev quit (Quit: WeeChat 2.7.1)
21:44:32FromDiscord<Elegant Beef> So im currently playing around with xlib making a tiled window manager, and any clues how to manage createnotify messages? It seems some applications send more than one and the parent isnt set
21:46:37PrestigeElegant Beef: I'm doing the same currently, haven't gotten quite there yet though. Using this for a reference https://tronche.com/gui/x/xlib/
21:46:46FromDiscord<Elegant Beef> Yea same
21:47:17FromDiscord<Elegant Beef> Nothing quite explains how to handle windows on created
21:47:27FromDiscord<Elegant Beef> A lot of what i see frames them but if i do that it just ends poorly
21:47:57PrestigeI'm also using an existing wm in C as reference as well, if that will help you
21:48:17PrestigeI'm about at the same step as you are
21:49:37Prestigehttps://github.com/avahe-kellenberger/dwm/blob/master/src/dwm.c the run function handles the events
21:49:40FromDiscord<Elegant Beef> I've looked at basic_wm and dwm
21:49:57FromDiscord<Elegant Beef> The C code is written so minimalistically it's hard for my tiny brain to follow
21:50:03FromDiscord<Elegant Beef> atleast in DWM
21:50:37PrestigeIt's been taking me some time to determine what some variable names stand for but I'm making progress
21:51:16PrestigeI don't see dwm handling any createnotify events actually
21:52:17FromDiscord<Elegant Beef> IIRC it usues the map or other notify message to handle it
21:52:20FromDiscord<Elegant Beef> uses*
21:52:33PrestigeYeah
21:53:10*filcuc quit (Quit: Konversation terminated!)
21:53:15PrestigeI'm away from my computer for another 30 mins but I'll let you know if I find anything when I'm back
21:53:40FromDiscord<Elegant Beef> Ok, idk about you but my plan is to use nimscript for customizing/widgets, and nuklear or cimgui for the default bar
21:54:26FromDiscord<Elegant Beef> The embeddedNimScript repo looks promising for this, since it can communicate from nims to nim and vice versa
21:54:31PrestigeI'm probably going to not have a bar integrated in the WM, I'll make it a separate program
22:00:11disruptek!repo nuklear
22:00:12disbothttps://github.com/zacharycarter/nuklear-nim -- 9nuklear-nim: 11Nim bindings for https://github.com/vurtun/nuklear/ 15 94⭐ 8🍴 7& 1 more...
22:02:17shashlickfolks, appreciate feedback - made a big README update for https://github.com/nimterop/nimterop
22:06:03*dddddd joined #nim
22:08:06FromDiscord<Recruit_main707> ill read it now
22:08:14*Faulander|afk quit (Read error: Connection reset by peer)
22:13:31PrestigeElegant Beef: this might be useful https://tronche.com/gui/x/xlib/events/processing-overview.html
22:28:52*couven92 quit (Ping timeout: 256 seconds)
22:31:54FromDiscord<KingDarBoja> Hi guys
22:32:23FromDiscord<Elegant Beef> I just dont quite see which windows on created are important and which arent
22:36:33FromDiscord<KingDarBoja> That single tests that doesn't work on your suite and you have no idea why lol
22:41:58Prestigehm Elegant Beef do u know the difference between DefaultRootWindow and XDefaultRootWindow?
22:42:11FromDiscord<Elegant Beef> No
22:47:21FromDiscord<Recruit_main707> can you write some kind of program that reads c2nim errors and tries to fix them? (ie: put a `;` where it expects it and pray that works :P )
22:49:08FromDiscord<KingDarBoja> I think I request some help on checking a module from Python source code vs my Nim approach
22:49:19FromDiscord<KingDarBoja> I think I will have to*
22:52:25FromDiscord<Recruit_main707> ask
22:54:18FromDiscord<KingDarBoja> Hold on, watching some anime OST right now
22:54:30FromDiscord<Recruit_main707> xD
22:54:48FromDiscord<KingDarBoja> SAIDO CHESTOOOO
22:57:38FromDiscord<exelotl> shashlick: I don't think it should link to "theindex". Not twice, and especially not as the first mention of links docs. It's a bad user experience x)
23:00:36FromDiscord<exelotl> *of links to docs
23:01:24FromDiscord<exelotl> the new readme content is good though! much better organised
23:02:25FromDiscord<Recruit_main707> Downloading https://github.com/alehander42/Nim using git may i ask why does this appear when running a nimble file?
23:03:21*D_ joined #nim
23:06:37shashlickexelotl: cool, ya theindex lists all modules, that's the only reason, but it isn't really the best
23:09:17FromDiscord<exelotl> I've accidentally clicked on it multiple times because it's the most promising-looking link on the page
23:09:46shashlickπŸ˜„
23:11:53FromDiscord<exelotl> One thing that I think is missing - as a newcomer, it needs to be explained somewhere early on, that the code in the readme goes into a file which *is* your wrapper, as in, you can import it in a real program and use it.
23:15:05dadadakrux02: hey yo! mathAstFind would definitely be plenty useful!
23:15:53krux02dadada, what is mathAstFind?
23:16:08dadadalike you wrote in the discussion section of https://github.com/krux02/ast-pattern-matching/
23:16:11dadadait's at the bottom
23:16:32dadadaI assume you wrote that "A matchAstFind that would recursively search though the ast and stop at the first match would make sense. Here it would also be sane to use the else branch for the case that the entire ast does not have any match at all."
23:16:38krux02Ah I remember now
23:16:48krux02yes I wrote that
23:16:53krux02a long time ago though
23:17:14FromDiscord<exelotl> shashlick: What I mean is, it's a small thing but I think the readme really needs to say what to *do* with the code. Because, initially, I was still in the mindset that I somehow need to run the code by entering some command or something
23:18:07krux02dadada, yes that else branch is good
23:18:27krux02I just don't get the time to implement it.
23:18:41krux02I will probably implement it as needed.
23:18:59dadadaahm, I could use it right now :-()
23:19:02dadada:D
23:19:24FromDiscord<Recruit_main707> Languist (py2nim) seems to be outdated, does anyone know if it’s dead?
23:19:46krux02ok fair point
23:20:16krux02good to know that ast-pattern-matching is useful for you
23:20:48krux02Recruit_main707: I am not even sure if py2nim is a sane projet to begin with.
23:20:56dadadastuff like is what separates Nim from the rest :D
23:21:37krux02yea I use ast pattern matching in my opengl wrapper generator
23:21:59krux02sorry I mean my nim to glsl compiler
23:22:06FromDiscord<Recruit_main707> krux02: py2nim now works with languist, (it just basically calls it)
23:23:27shashlickexelotl: will try to cover that better - also realize i didn't talk about command line as much - the -d:xxx stuff
23:25:34*Trustable quit (Remote host closed the connection)
23:27:53dadadaso we have a walker for iterating/walking through a NimNode tree recursively?
23:27:58dadadas/so/do
23:28:14dadadaI'm really not in the mood for rolling my own :-(
23:41:34*abm quit (Read error: Connection reset by peer)
23:55:59*krux02_ joined #nim